@maptalks/vt 0.63.3 → 0.63.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/maptalks.vt.js +305 -294
- package/dist/maptalks.vt.mjs +112 -102
- package/package.json +2 -2
package/dist/maptalks.vt.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/vt v0.63.
|
|
2
|
+
* @maptalks/vt v0.63.4
|
|
3
3
|
* LICENSE : undefined
|
|
4
4
|
* (c) 2016-2022 maptalks.org
|
|
5
5
|
*/
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
})), n.default = t, Object.freeze(n);
|
|
23
23
|
}
|
|
24
24
|
var r = i(n), s = i(e);
|
|
25
|
-
const o = 'function(t) {\n /*!\n Feature Filter by\n\n (c) mapbox 2016 and maptalks 2018\n www.mapbox.com | www.maptalks.org\n License: MIT, header required.\n */\n const n = [ "Unknown", "Point", "LineString", "Polygon", "MultiPoint", "MultiLineString", "MultiPolygon", "GeometryCollection" ];\n function i(t) {\n return new Function("f", "var p = (f && f.properties || {}); return " + e(t));\n }\n function e(t) {\n if (!t) return "true";\n const n = t[0];\n if (t.length <= 1) return "any" === n ? "false" : "true";\n return `(${"==" === n ? s(t[1], t[2], "===", !1) : "!=" === n ? s(t[1], t[2], "!==", !1) : "<" === n || ">" === n || "<=" === n || ">=" === n ? s(t[1], t[2], n, !0) : "any" === n ? o(t.slice(1), "||") : "all" === n ? o(t.slice(1), "&&") : "none" === n ? u(o(t.slice(1), "||")) : "in" === n ? a(t[1], t.slice(2)) : "!in" === n ? u(a(t[1], t.slice(2))) : "has" === n ? h(t[1]) : "!has" === n ? u(h(t[1])) : "true"})`;\n }\n function r(t) {\n return "$" === t[0] ? "f." + t.substring(1) : "p[" + JSON.stringify(t) + "]";\n }\n function s(t, i, e, s) {\n const o = r(t), a = "$type" === t ? n.indexOf(i) : JSON.stringify(i);\n return (s ? `typeof ${o}=== typeof ${a}&&` : "") + o + e + a;\n }\n function o(t, n) {\n return t.map(e).join(n);\n }\n function a(t, i) {\n "$type" === t && (i = i.map(t => n.indexOf(t)));\n const e = JSON.stringify(i.sort(l)), s = r(t);\n return i.length <= 200 ? `${e}.indexOf(${s}) !== -1` : `function(v, a, i, j) {\\n while (i <= j) { var m = (i + j) >> 1;\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\n }\\n return false; }(${s}, ${e},0,${i.length - 1})`;\n }\n function h(t) {\n return "$id" === t ? \'"id" in f\' : JSON.stringify(t) + " in p";\n }\n function u(t) {\n return `!(${t})`;\n }\n function l(t, n) {\n return t < n ? -1 : t > n ? 1 : 0;\n }\n function c(t) {\n for (let n = 1; n < arguments.length; n++) {\n const i = arguments[n];\n for (const n in i) t[n] = i[n];\n }\n return t;\n }\n function f(t, n) {\n for (let i = 0; i < t.stops.length; i++) if (n === t.stops[i][0]) return t.stops[i][1];\n return t.default;\n }\n function d(t, n) {\n for (var i = 0; i < t.stops.length && !(n < t.stops[i][0]); i++) ;\n return t.stops[Math.max(i - 1, 0)][1];\n }\n function y(t, n) {\n for (var i = void 0 !== t.base ? t.base : 1, e = 0; !(e >= t.stops.length || n <= t.stops[e][0]); ) e++;\n return 0 === e ? t.stops[e][1] : e === t.stops.length ? t.stops[e - 1][1] : function t(n, i, e, r, s, o) {\n return "function" == typeof s ? function() {\n var a = s.apply(void 0, arguments), h = o.apply(void 0, arguments);\n return t(n, i, e, r, a, h);\n } : s.length ? function(t, n, i, e, r, s) {\n var o = [];\n for (let a = 0; a < r.length; a++) o[a] = p(t, n, i, e, r[a], s[a]);\n return o;\n }(n, i, e, r, s, o) : p(n, i, e, r, s, o);\n }(n, i, t.stops[e - 1][0], t.stops[e][0], t.stops[e - 1][1], t.stops[e][1]);\n }\n function v(t, n) {\n return function(t, n, i) {\n return void 0 !== t ? t : void 0 !== n ? n : void 0 !== i ? i : null;\n }(n, t.default);\n }\n function p(t, n, i, e, r, s) {\n var o, a = e - i, h = t - i;\n return r * (1 - (o = 1 === n ? h / a : (Math.pow(n, h) - 1) / (Math.pow(n, a) - 1))) + s * o;\n }\n function m(t) {\n return t && "object" == typeof t && (t.stops || t.property && "identity" === t.type);\n }\n function g(t) {\n return b(t, "exponential");\n }\n function w(t) {\n return b(t, "interval");\n }\n function M(t, n) {\n if (!t) return null;\n var i = !1;\n if (Array.isArray(t)) {\n var e, r = [];\n for (let s = 0; s < t.length; s++) (e = M(t[s], n)) ? (r.push(e), i = !0) : r.push(t[s]);\n return i ? r : t;\n }\n var s, o = {\n __fn_types_loaded: !0\n }, a = [];\n for (s in t) t.hasOwnProperty(s) && a.push(s);\n const h = function(t) {\n Object.defineProperty(o, t, {\n get: function() {\n return this["__fn_" + t] || (this["__fn_" + t] = g(this["_" + t])), this["__fn_" + t].apply(this, n());\n },\n set: function(n) {\n this["_" + t] = n;\n },\n configurable: !0,\n enumerable: !0\n });\n };\n for (let n = 0, e = a.length; n < e; n++) m(t[s = a[n]]) ? (i = !0, o["_" + s] = t[s], \n h(s)) : o[s] = t[s];\n return i ? o : t;\n }\n function b(t, n) {\n if (!m(t)) return function() {\n return t;\n };\n let i = !0, e = !0;\n const r = (t = JSON.parse(JSON.stringify(t))).stops;\n if (r) for (let t = 0; t < r.length; t++) if (m(r[t][1])) {\n const s = b(r[t][1], n);\n i = i && s.isZoomConstant, e = e && s.isFeatureConstant, r[t] = [ r[t][0], s ];\n }\n const s = function t(n, i) {\n var e, r, s;\n if (m(n)) {\n var o, a = n.stops && "object" == typeof n.stops[0][0], h = a || void 0 !== n.property, u = a || !h, l = n.type || i || "exponential";\n if ("exponential" === l) o = y; else if ("interval" === l) o = d; else if ("categorical" === l) o = f; else {\n if ("identity" !== l) throw new Error(\'Unknown function type "\' + l + \'"\');\n o = v;\n }\n if (a) {\n var c = {}, p = [];\n for (let t = 0; t < n.stops.length; t++) {\n var g = n.stops[t];\n void 0 === c[g[0].zoom] && (c[g[0].zoom] = {\n zoom: g[0].zoom,\n type: n.type,\n property: n.property,\n default: n.default,\n stops: []\n }), c[g[0].zoom].stops.push([ g[0].value, g[1] ]);\n }\n for (let n in c) p.push([ c[n].zoom, t(c[n]) ]);\n e = function(t, i) {\n const e = y({\n stops: p,\n base: n.base\n }, t)(t, i);\n return "function" == typeof e ? e(t, i) : e;\n }, r = !1, s = !1;\n } else u ? (e = function(t) {\n const i = o(n, t);\n return "function" == typeof i ? i(t) : i;\n }, r = !0, s = !1) : (e = function(t, i) {\n const e = o(n, i ? i[n.property] : null);\n return "function" == typeof e ? e(t, i) : e;\n }, r = !1, s = !0);\n } else e = function() {\n return n;\n }, r = !0, s = !0;\n return e.isZoomConstant = s, e.isFeatureConstant = r, e;\n }(t, n);\n return s.isZoomConstant = i && s.isZoomConstant, s.isFeatureConstant = e && s.isFeatureConstant, \n s;\n }\n let x = 0;\n const F = "function" == typeof Object.assign;\n function A(t, ...n) {\n if (F) return Object.assign(t, ...n), t;\n for (let i = 0; i < n.length; i++) {\n const e = n[i];\n for (const n in e) t[n] = e[n];\n }\n return t;\n }\n function k(t) {\n return !O(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);\n }\n function P(t) {\n return "number" == typeof t && !isNaN(t);\n }\n function S(t) {\n return !O(t) && ("function" == typeof t || null !== t.constructor && t.constructor === Function);\n }\n function _(t) {\n return !Array.isArray(t) && "object" == typeof t && !!t;\n }\n function O(t) {\n return null == t;\n }\n function I(t) {\n for (let n = 1; n < arguments.length; n++) {\n const i = arguments[n];\n if (i) for (let n = 0, e = i.length; n < e; n++) t.push(i[n]);\n }\n return t.length;\n }\n function T(t) {\n return t < 65536 ? Uint16Array : Uint32Array;\n }\n function L(t) {\n return t < 256 ? Uint8Array : t < 65536 ? Uint16Array : Uint32Array;\n }\n function U(t) {\n return (t = Math.abs(t)) < 128 ? Int8Array : t < 32768 ? Int16Array : Float32Array;\n }\n function z(t) {\n return function t(n) {\n if (!Array.isArray(n)) return t([ n ]);\n const e = [];\n for (let t = 0; t < n.length; t++) {\n let r;\n r = !0 === n[t].filter ? function() {\n return !0;\n } : i(n[t].filter), e.push(c({}, n[t], {\n filter: r\n }));\n }\n return e;\n }(t = t.map(t => {\n const n = A({}, t);\n return n.filter && n.filter.value && (n.filter = n.filter.value), n;\n }));\n }\n function D(t) {\n return m(t) && t.property;\n }\n const E = "function" == typeof fetch && "function" == typeof AbortController, C = {\n jsonp: function(t, n) {\n const i = "_maptalks_jsonp_" + x++;\n t.match(/\\?/) ? t += "&callback=" + i : t += "?callback=" + i;\n let e = document.createElement("script");\n return e.type = "text/javascript", e.src = t, window[i] = function(t) {\n n(null, t), document.getElementsByTagName("head")[0].removeChild(e), e = null, delete window[i];\n }, document.getElementsByTagName("head")[0].appendChild(e), this;\n },\n get: function(t, n, i) {\n if (S(n)) {\n const t = i;\n i = n, n = t;\n }\n (n = n || {}).method && (n.method = n.method.toUpperCase());\n const e = "POST" === n.method;\n if (E) {\n const r = new AbortController, s = {\n signal: r.signal,\n method: n.method || "GET",\n referrerPolicy: "origin"\n };\n return e && (O(n.body) || (s.body = JSON.stringify(n.body))), O(n.headers) || (s.headers = n.headers), \n O(n.credentials) || (s.credentials = n.credentials), fetch(t, s).then(t => {\n const e = this.t(t, n.returnJSON, n.responseType);\n e.message ? i(e) : e.then(e => {\n "arraybuffer" === n.responseType ? i(null, {\n data: e,\n cacheControl: t.headers.get("Cache-Control"),\n expires: t.headers.get("Expires"),\n contentType: t.headers.get("Content-Type")\n }) : i(null, e);\n }).catch(t => {\n t.code && t.code === DOMException.ABORT_ERR || (console.error(t), i(t));\n });\n }).catch(t => {\n t.code && t.code === DOMException.ABORT_ERR || (console.error(t), i(t));\n }), r;\n }\n {\n const r = C.s(i);\n if (r.open(n.method || "GET", t, !0), n) {\n for (const t in n.headers) r.setRequestHeader(t, n.headers[t]);\n r.withCredentials = "include" === n.credentials, n.responseType && (r.responseType = n.responseType);\n }\n return r.send(e ? n.body : null), r;\n }\n },\n t: (t, n, i) => 200 !== t.status ? {\n status: t.status,\n statusText: t.statusText,\n message: `incorrect http request with status code(${t.status}): ${t.statusText}`\n } : "arraybuffer" === i ? t.arrayBuffer() : n ? t.json() : t.text(),\n o: function(t, n) {\n return function() {\n if (4 === t.readyState) if (200 === t.status) if ("arraybuffer" === t.responseType) {\n 0 === t.response.byteLength ? n({\n status: 200,\n statusText: t.statusText,\n message: "http status 200 returned without content."\n }) : n(null, {\n data: t.response,\n cacheControl: t.getResponseHeader("Cache-Control"),\n expires: t.getResponseHeader("Expires"),\n contentType: t.getResponseHeader("Content-Type")\n });\n } else n(null, t.responseText); else n({\n status: t.status,\n statusText: t.statusText,\n message: `incorrect http request with status code(${t.status}): ${t.statusText}`\n });\n };\n },\n s: function(t) {\n let n;\n try {\n n = new XMLHttpRequest;\n } catch (t) {\n try {\n n = new ActiveXObject("Msxml2.XMLHTTP");\n } catch (t) {\n try {\n n = new ActiveXObject("Microsoft.XMLHTTP");\n } catch (t) {}\n }\n }\n return n.onreadystatechange = C.o(n, t), n;\n },\n getArrayBuffer(t, n, i) {\n if (S(n)) {\n const t = i;\n i = n, n = t;\n }\n return n || (n = {}), n.responseType = "arraybuffer", C.get(t, n, i);\n }\n };\n function j(t, n, i, e, r, s) {\n var o = r - i, a = s - e;\n if (0 !== o || 0 !== a) {\n var h = ((t - i) * o + (n - e) * a) / (o * o + a * a);\n h > 1 ? (i = r, e = s) : h > 0 && (i += o * h, e += a * h);\n }\n return (o = t - i) * o + (a = n - e) * a;\n }\n function N(t, n, i, e) {\n var r = {\n id: void 0 === t ? null : t,\n type: n,\n geometry: i,\n tags: e,\n minX: 1 / 0,\n minY: 1 / 0,\n maxX: -1 / 0,\n maxY: -1 / 0\n };\n return function(t) {\n var n = t.geometry, i = t.type;\n if ("Point" === i || "MultiPoint" === i || "LineString" === i) H(t, n); else if ("Polygon" === i || "MultiLineString" === i) for (var e = 0; e < n.length; e++) H(t, n[e]); else if ("MultiPolygon" === i) for (e = 0; e < n.length; e++) for (var r = 0; r < n[e].length; r++) H(t, n[e][r]);\n }(r), r;\n }\n function H(t, n) {\n for (var i = 0; i < n.length; i += 3) t.minX = Math.min(t.minX, n[i]), t.minY = Math.min(t.minY, n[i + 1]), \n t.maxX = Math.max(t.maxX, n[i]), t.maxY = Math.max(t.maxY, n[i + 1]);\n }\n function V(t, n, i, e) {\n if (n.geometry) {\n var r = n.geometry.coordinates, s = n.geometry.type, o = Math.pow(i.tolerance / ((1 << i.maxZoom) * i.extent), 2), a = [], h = n.id;\n if (i.promoteId ? h = n.properties[i.promoteId] : i.generateId && (h = e || 0), \n "Point" === s) R(r, a); else if ("MultiPoint" === s) for (var u = 0; u < r.length; u++) R(r[u], a); else if ("LineString" === s) $(r, a, o, !1); else if ("MultiLineString" === s) {\n if (i.lineMetrics) {\n for (u = 0; u < r.length; u++) a = [], $(r[u], a, o, !1), t.push(N(h, "LineString", a, n.properties));\n return;\n }\n W(r, a, o, !1);\n } else if ("Polygon" === s) W(r, a, o, !0); else {\n if ("MultiPolygon" !== s) {\n if ("GeometryCollection" === s) {\n for (u = 0; u < n.geometry.geometries.length; u++) V(t, {\n id: h,\n geometry: n.geometry.geometries[u],\n properties: n.properties\n }, i, e);\n return;\n }\n throw new Error("Input data is not a valid GeoJSON object.");\n }\n for (u = 0; u < r.length; u++) {\n var l = [];\n W(r[u], l, o, !0), a.push(l);\n }\n }\n t.push(N(h, s, a, n.properties));\n }\n }\n function R(t, n) {\n n.push(q(t[0])), n.push(B(t[1])), n.push(0);\n }\n function $(t, n, i, e) {\n for (var r, s, o = 0, a = 0; a < t.length; a++) {\n var h = q(t[a][0]), u = B(t[a][1]);\n n.push(h), n.push(u), n.push(0), a > 0 && (o += e ? (r * u - h * s) / 2 : Math.sqrt(Math.pow(h - r, 2) + Math.pow(u - s, 2))), \n r = h, s = u;\n }\n var l = n.length - 3;\n n[2] = 1, function t(n, i, e, r) {\n for (var s, o = r, a = e - i >> 1, h = e - i, u = n[i], l = n[i + 1], c = n[e], f = n[e + 1], d = i + 3; d < e; d += 3) {\n var y = j(n[d], n[d + 1], u, l, c, f);\n if (y > o) s = d, o = y; else if (y === o) {\n var v = Math.abs(d - a);\n v < h && (s = d, h = v);\n }\n }\n o > r && (s - i > 3 && t(n, i, s, r), n[s + 2] = o, e - s > 3 && t(n, s, e, r));\n }(n, 0, l, i), n[l + 2] = 1, n.size = Math.abs(o), n.start = 0, n.end = n.size;\n }\n function W(t, n, i, e) {\n for (var r = 0; r < t.length; r++) {\n var s = [];\n $(t[r], s, i, e), n.push(s);\n }\n }\n function q(t) {\n return t / 360 + .5;\n }\n function B(t) {\n var n = Math.sin(t * Math.PI / 180), i = .5 - .25 * Math.log((1 + n) / (1 - n)) / Math.PI;\n return i < 0 ? 0 : i > 1 ? 1 : i;\n }\n function G(t, n, i, e, r, s, o, a) {\n if (e /= n, s >= (i /= n) && o < e) return t;\n if (o < i || s >= e) return null;\n for (var h = [], u = 0; u < t.length; u++) {\n var l = t[u], c = l.geometry, f = l.type, d = 0 === r ? l.minX : l.minY, y = 0 === r ? l.maxX : l.maxY;\n if (d >= i && y < e) h.push(l); else if (!(y < i || d >= e)) {\n var v = [];\n if ("Point" === f || "MultiPoint" === f) J(c, v, i, e, r); else if ("LineString" === f) X(c, v, i, e, r, !1, a.lineMetrics); else if ("MultiLineString" === f) Y(c, v, i, e, r, !1); else if ("Polygon" === f) Y(c, v, i, e, r, !0); else if ("MultiPolygon" === f) for (var p = 0; p < c.length; p++) {\n var m = [];\n Y(c[p], m, i, e, r, !0), m.length && v.push(m);\n }\n if (v.length) {\n if (a.lineMetrics && "LineString" === f) {\n for (p = 0; p < v.length; p++) h.push(N(l.id, f, v[p], l.tags));\n continue;\n }\n "LineString" !== f && "MultiLineString" !== f || (1 === v.length ? (f = "LineString", \n v = v[0]) : f = "MultiLineString"), "Point" !== f && "MultiPoint" !== f || (f = 3 === v.length ? "Point" : "MultiPoint"), \n h.push(N(l.id, f, v, l.tags));\n }\n }\n }\n return h.length ? h : null;\n }\n function J(t, n, i, e, r) {\n for (var s = 0; s < t.length; s += 3) {\n var o = t[s + r];\n o >= i && o <= e && (n.push(t[s]), n.push(t[s + 1]), n.push(t[s + 2]));\n }\n }\n function X(t, n, i, e, r, s, o) {\n for (var a, h, u = Z(t), l = 0 === r ? Q : tt, c = t.start, f = 0; f < t.length - 3; f += 3) {\n var d = t[f], y = t[f + 1], v = t[f + 2], p = t[f + 3], m = t[f + 4], g = 0 === r ? d : y, w = 0 === r ? p : m, M = !1;\n o && (a = Math.sqrt(Math.pow(d - p, 2) + Math.pow(y - m, 2))), g < i ? w > i && (h = l(u, d, y, p, m, i), \n o && (u.start = c + a * h)) : g > e ? w < e && (h = l(u, d, y, p, m, e), o && (u.start = c + a * h)) : K(u, d, y, v), \n w < i && g >= i && (h = l(u, d, y, p, m, i), M = !0), w > e && g <= e && (h = l(u, d, y, p, m, e), \n M = !0), !s && M && (o && (u.end = c + a * h), n.push(u), u = Z(t)), o && (c += a);\n }\n var b = t.length - 3;\n d = t[b], y = t[b + 1], v = t[b + 2], (g = 0 === r ? d : y) >= i && g <= e && K(u, d, y, v), \n b = u.length - 3, s && b >= 3 && (u[b] !== u[0] || u[b + 1] !== u[1]) && K(u, u[0], u[1], u[2]), \n u.length && n.push(u);\n }\n function Z(t) {\n var n = [];\n return n.size = t.size, n.start = t.start, n.end = t.end, n;\n }\n function Y(t, n, i, e, r, s) {\n for (var o = 0; o < t.length; o++) X(t[o], n, i, e, r, s, !1);\n }\n function K(t, n, i, e) {\n t.push(n), t.push(i), t.push(e);\n }\n function Q(t, n, i, e, r, s) {\n var o = (s - n) / (e - n);\n return t.push(s), t.push(i + (r - i) * o), t.push(1), o;\n }\n function tt(t, n, i, e, r, s) {\n var o = (s - i) / (r - i);\n return t.push(n + (e - n) * o), t.push(s), t.push(1), o;\n }\n function nt(t, n) {\n for (var i = [], e = 0; e < t.length; e++) {\n var r, s = t[e], o = s.type;\n if ("Point" === o || "MultiPoint" === o || "LineString" === o) r = it(s.geometry, n); else if ("MultiLineString" === o || "Polygon" === o) {\n r = [];\n for (var a = 0; a < s.geometry.length; a++) r.push(it(s.geometry[a], n));\n } else if ("MultiPolygon" === o) for (r = [], a = 0; a < s.geometry.length; a++) {\n for (var h = [], u = 0; u < s.geometry[a].length; u++) h.push(it(s.geometry[a][u], n));\n r.push(h);\n }\n i.push(N(s.id, o, r, s.tags));\n }\n return i;\n }\n function it(t, n) {\n var i = [];\n i.size = t.size, void 0 !== t.start && (i.start = t.start, i.end = t.end);\n for (var e = 0; e < t.length; e += 3) i.push(t[e] + n, t[e + 1], t[e + 2]);\n return i;\n }\n function et(t, n) {\n if (t.transformed) return t;\n var i, e, r, s = 1 << t.z, o = t.x, a = t.y;\n for (i = 0; i < t.features.length; i++) {\n var h = t.features[i], u = h.geometry, l = h.type;\n if (h.geometry = [], 1 === l) for (e = 0; e < u.length; e += 2) h.geometry.push(rt(u[e], u[e + 1], n, s, o, a)); else for (e = 0; e < u.length; e++) {\n var c = [];\n for (r = 0; r < u[e].length; r += 2) c.push(rt(u[e][r], u[e][r + 1], n, s, o, a));\n h.geometry.push(c);\n }\n }\n return t.transformed = !0, t;\n }\n function rt(t, n, i, e, r, s) {\n return [ Math.round(i * (t * e - r)), Math.round(i * (n * e - s)) ];\n }\n function st(t, n, i, e, r) {\n for (var s = n === r.maxZoom ? 0 : r.tolerance / ((1 << n) * r.extent), o = {\n features: [],\n numPoints: 0,\n numSimplified: 0,\n numFeatures: 0,\n source: null,\n x: i,\n y: e,\n z: n,\n transformed: !1,\n minX: 2,\n minY: 1,\n maxX: -1,\n maxY: 0\n }, a = 0; a < t.length; a++) {\n o.numFeatures++, ot(o, t[a], s, r);\n var h = t[a].minX, u = t[a].minY, l = t[a].maxX, c = t[a].maxY;\n h < o.minX && (o.minX = h), u < o.minY && (o.minY = u), l > o.maxX && (o.maxX = l), \n c > o.maxY && (o.maxY = c);\n }\n return o;\n }\n function ot(t, n, i, e) {\n var r = n.geometry, s = n.type, o = [];\n if ("Point" === s || "MultiPoint" === s) for (var a = 0; a < r.length; a += 3) o.push(r[a]), \n o.push(r[a + 1]), t.numPoints++, t.numSimplified++; else if ("LineString" === s) at(o, r, t, i, !1, !1); else if ("MultiLineString" === s || "Polygon" === s) for (a = 0; a < r.length; a++) at(o, r[a], t, i, "Polygon" === s, 0 === a); else if ("MultiPolygon" === s) for (var h = 0; h < r.length; h++) {\n var u = r[h];\n for (a = 0; a < u.length; a++) at(o, u[a], t, i, !0, 0 === a);\n }\n if (o.length) {\n var l = n.tags || null;\n if ("LineString" === s && e.lineMetrics) {\n for (var c in l = {}, n.tags) l[c] = n.tags[c];\n l.mapbox_clip_start = r.start / r.size, l.mapbox_clip_end = r.end / r.size;\n }\n var f = {\n geometry: o,\n type: "Polygon" === s || "MultiPolygon" === s ? 3 : "LineString" === s || "MultiLineString" === s ? 2 : 1,\n tags: l\n };\n null !== n.id && (f.id = n.id), t.features.push(f);\n }\n }\n function at(t, n, i, e, r, s) {\n var o = e * e;\n if (e > 0 && n.size < (r ? o : e)) i.numPoints += n.length / 3; else {\n for (var a = [], h = 0; h < n.length; h += 3) (0 === e || n[h + 2] > o) && (i.numSimplified++, \n a.push(n[h]), a.push(n[h + 1])), i.numPoints++;\n r && function(t, n) {\n for (var i = 0, e = 0, r = t.length, s = r - 2; e < r; s = e, e += 2) i += (t[e] - t[s]) * (t[e + 1] + t[s + 1]);\n if (i > 0 === n) for (e = 0, r = t.length; e < r / 2; e += 2) {\n var o = t[e], a = t[e + 1];\n t[e] = t[r - 2 - e], t[e + 1] = t[r - 1 - e], t[r - 2 - e] = o, t[r - 1 - e] = a;\n }\n }(a, s), t.push(a);\n }\n }\n function ht(t, n) {\n var i = (n = this.options = function(t, n) {\n for (var i in n) t[i] = n[i];\n return t;\n }(Object.create(this.options), n)).debug;\n if (i && console.time("preprocess data"), n.maxZoom < 0 || n.maxZoom > 24) throw new Error("maxZoom should be in the 0-24 range");\n if (n.promoteId && n.generateId) throw new Error("promoteId and generateId cannot be used together.");\n var e = function(t, n) {\n var i = [];\n if ("FeatureCollection" === t.type) for (var e = 0; e < t.features.length; e++) V(i, t.features[e], n, e); else "Feature" === t.type ? V(i, t, n) : V(i, {\n geometry: t\n }, n);\n return i;\n }(t, n);\n this.tiles = {}, this.tileCoords = [], i && (console.timeEnd("preprocess data"), \n console.log("index: maxZoom: %d, maxPoints: %d", n.indexMaxZoom, n.indexMaxPoints), \n console.time("generate tiles"), this.stats = {}, this.total = 0), (e = function(t, n) {\n var i = n.buffer / n.extent, e = t, r = G(t, 1, -1 - i, i, 0, -1, 2, n), s = G(t, 1, 1 - i, 2 + i, 0, -1, 2, n);\n return (r || s) && (e = G(t, 1, -i, 1 + i, 0, -1, 2, n) || [], r && (e = nt(r, 1).concat(e)), \n s && (e = e.concat(nt(s, -1)))), e;\n }(e, n)).length && this.splitTile(e, 0, 0, 0), i && (e.length && console.log("features: %d, points: %d", this.tiles[0].numFeatures, this.tiles[0].numPoints), \n console.timeEnd("generate tiles"), console.log("tiles generated:", this.total, JSON.stringify(this.stats)));\n }\n function ut(t, n, i) {\n return 32 * ((1 << t) * i + n) + t;\n }\n function lt(t, n, i, e, r, s) {\n const o = i && Array.isArray(i[0]);\n for (let a = 0, h = i.length; a < h; a++) {\n t[n] = Math.round((o ? i[a][0] : i[a].x) * e), t[n + 1] = Math.round((o ? i[a][1] : i[a].y) * e);\n let u = r || 0;\n Array.isArray(r) && (u = r[a]), u = u ? Math.round(e * u) : 0, t[n + 2] = u, n += 3, \n s && 0 !== a && a !== h - 1 && (t[n] = t[n - 3], t[n + 1] = t[n - 2], t[n + 2] = t[n - 1], \n n += 3);\n }\n return n;\n }\n function ct(t, n, i, e) {\n const r = t[3 * n], s = t[3 * n + 1], o = t[3 * i], a = t[3 * i + 1];\n return r === o && (r < 0 || r > e) || s === a && (s < 0 || s > e);\n }\n C.getJSON = function(t, n, i) {\n if (S(n)) {\n const t = i;\n i = n, n = t;\n }\n const e = function(t, n) {\n const e = "string" == typeof n ? JSON.parse(n) : n || null;\n i(t, e);\n };\n return n && n.jsonp ? C.jsonp(t, e) : ((n = n || {}).returnJSON = !0, C.get(t, n, e));\n }, ht.prototype.options = {\n maxZoom: 14,\n indexMaxZoom: 5,\n indexMaxPoints: 1e5,\n tolerance: 3,\n extent: 4096,\n buffer: 64,\n lineMetrics: !1,\n promoteId: null,\n generateId: !1,\n debug: 0\n }, ht.prototype.splitTile = function(t, n, i, e, r, s, o) {\n for (var a = [ t, n, i, e ], h = this.options, u = h.debug; a.length; ) {\n e = a.pop(), i = a.pop(), n = a.pop(), t = a.pop();\n var l = 1 << n, c = ut(n, i, e), f = this.tiles[c];\n if (!f && (u > 1 && console.time("creation"), f = this.tiles[c] = st(t, n, i, e, h), \n this.tileCoords.push({\n z: n,\n x: i,\n y: e\n }), u)) {\n u > 1 && (console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)", n, i, e, f.numFeatures, f.numPoints, f.numSimplified), \n console.timeEnd("creation"));\n var d = "z" + n;\n this.stats[d] = (this.stats[d] || 0) + 1, this.total++;\n }\n if (f.source = t, r) {\n if (n === h.maxZoom || n === r) continue;\n var y = 1 << r - n;\n if (i !== Math.floor(s / y) || e !== Math.floor(o / y)) continue;\n } else if (n === h.indexMaxZoom || f.numPoints <= h.indexMaxPoints) continue;\n if (f.source = null, 0 !== t.length) {\n u > 1 && console.time("clipping");\n var v, p, m, g, w, M, b = .5 * h.buffer / h.extent, x = .5 - b, F = .5 + b, A = 1 + b;\n v = p = m = g = null, w = G(t, l, i - b, i + F, 0, f.minX, f.maxX, h), M = G(t, l, i + x, i + A, 0, f.minX, f.maxX, h), \n t = null, w && (v = G(w, l, e - b, e + F, 1, f.minY, f.maxY, h), p = G(w, l, e + x, e + A, 1, f.minY, f.maxY, h), \n w = null), M && (m = G(M, l, e - b, e + F, 1, f.minY, f.maxY, h), g = G(M, l, e + x, e + A, 1, f.minY, f.maxY, h), \n M = null), u > 1 && console.timeEnd("clipping"), a.push(v || [], n + 1, 2 * i, 2 * e), \n a.push(p || [], n + 1, 2 * i, 2 * e + 1), a.push(m || [], n + 1, 2 * i + 1, 2 * e), \n a.push(g || [], n + 1, 2 * i + 1, 2 * e + 1);\n }\n }\n }, ht.prototype.getTile = function(t, n, i) {\n var e = this.options, r = e.extent, s = e.debug;\n if (t < 0 || t > 24) return null;\n var o = 1 << t, a = ut(t, n = (n % o + o) % o, i);\n if (this.tiles[a]) return et(this.tiles[a], r);\n s > 1 && console.log("drilling down to z%d-%d-%d", t, n, i);\n for (var h, u = t, l = n, c = i; !h && u > 0; ) u--, l = Math.floor(l / 2), c = Math.floor(c / 2), \n h = this.tiles[ut(u, l, c)];\n return h && h.source ? (s > 1 && console.log("found parent tile z%d-%d-%d", u, l, c), \n s > 1 && console.time("drilling down"), this.splitTile(h.source, u, l, c, t, n, i), \n s > 1 && console.timeEnd("drilling down"), this.tiles[a] ? et(this.tiles[a], r) : null) : null;\n };\n class ft {\n constructor(t, n) {\n this.x = t, this.y = n;\n }\n clone() {\n return new ft(this.x, this.y);\n }\n normalize() {\n const t = this.length();\n this.x /= t, this.y /= t;\n }\n negate() {\n this.x = -this.x, this.y = -this.y;\n }\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n diff(t) {\n return new ft(this.x - t.x, this.y - t.y);\n }\n distance(t) {\n const n = this.x - t.x, i = this.y - t.y;\n return Math.sqrt(n * n + i * i);\n }\n dot(t) {\n return this.x * t.x + this.y * t.y;\n }\n equals(t) {\n return this.x === t.x && this.y === t.y;\n }\n orthogonal() {\n return new ft(this.y, -this.x);\n }\n }\n function dt(t, n, i) {\n const e = (n.x - t.x) * (i.y - t.y) - (n.y - t.y) * (i.x - t.x);\n return e > 1e-5 ? 1 : e < -1e-5 ? 2 : 0;\n }\n function yt(t, n, i, e) {\n const r = n.x * e.y - n.y * e.x, s = i.x - t.x, o = i.y - t.y, a = (s * e.y - o * e.x) / r;\n return new ft(t.x + a * n.x, t.y + a * n.y);\n }\n const vt = [];\n function pt(t, n, i) {\n let e = 0;\n const r = [];\n for (let s = n; s < i; s += 3) vt[e] ? (vt[e].x = t[s], vt[e].y = t[s + 1]) : vt[e] = new ft(t[s], t[s + 1]), \n r.push(vt[e]), e++;\n const s = function(t) {\n let n;\n this.UpdateOmbb = function(t, i, e, r, s, o, a, h) {\n const u = yt(t, i, s, o), l = yt(e, r, s, o), c = yt(a, h, t, i), f = yt(a, h, e, r), d = u.distance(l) * u.distance(c);\n d < this.BestObbArea && (n = [ u, c, f, l ], this.BestObbArea = d);\n }, this.BestObbArea = Number.MAX_VALUE;\n const i = [];\n for (let n = 0; n < t.length; n++) i.push(t[(n + 1) % t.length].diff(t[n])), i[n].normalize();\n const e = new ft(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY), r = new ft(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY);\n let s, o, a, h;\n for (let n = 0; n < t.length; n++) {\n const i = t[n];\n i.x < e.x && (e.x = i.x, s = n), i.x > r.x && (r.x = i.x, o = n), i.y < e.y && (e.y = i.y, \n h = n), i.y > r.y && (r.y = i.y, a = n);\n }\n let u = new ft(0, -1), l = new ft(0, 1), c = new ft(-1, 0), f = new ft(1, 0);\n for (let n = 0; n < t.length; n++) {\n const n = [ Math.acos(u.dot(i[s])), Math.acos(l.dot(i[o])), Math.acos(c.dot(i[a])), Math.acos(f.dot(i[h])) ];\n switch (n.indexOf(Math.min.apply(Math, n))) {\n case 0:\n u = i[s].clone(), l = u.clone(), l.negate(), c = u.orthogonal(), f = c.clone(), \n f.negate(), s = (s + 1) % t.length;\n break;\n\n case 1:\n l = i[o].clone(), u = l.clone(), u.negate(), c = u.orthogonal(), f = c.clone(), \n f.negate(), o = (o + 1) % t.length;\n break;\n\n case 2:\n c = i[a].clone(), f = c.clone(), f.negate(), u = f.orthogonal(), l = u.clone(), \n l.negate(), a = (a + 1) % t.length;\n break;\n\n case 3:\n f = i[h].clone(), c = f.clone(), c.negate(), u = f.orthogonal(), l = u.clone(), \n l.negate(), h = (h + 1) % t.length;\n }\n this.UpdateOmbb(t[s], u, t[o], l, t[a], c, t[h], f);\n }\n return n;\n }(function(t) {\n if (t.length < 3) return t;\n let n = t[0];\n const i = [];\n for (let i = 1; i < t.length; i++) (t[i].x < n.x || Math.abs(t[i].x - n.x) < 1e-5 && t[i].y < n.y) && (n = t[i]);\n let e = t[0];\n do {\n i.unshift(n.clone());\n for (let i = 1; i < t.length; i++) {\n const r = dt(n, e, t[i]);\n (e.equals(n) || 1 === r || 0 === r && n.distance(t[i]) > n.distance(e)) && (e = t[i]);\n }\n n = e;\n } while (!e.equals(i[i.length - 1]));\n return i;\n }(r)), o = s[0].distance(s[1]), a = s[1].distance(s[2]), h = s.map(t => [ t.x, t.y ]);\n return h.push(+(a > o)), h;\n }\n var mt = "undefined" != typeof Float32Array ? Float32Array : Array;\n function gt() {\n var t = new mt(3);\n return mt != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0), t;\n }\n function wt(t, n, i) {\n var e = new mt(3);\n return e[0] = t, e[1] = n, e[2] = i, e;\n }\n function Mt(t, n) {\n return t[0] = n[0], t[1] = n[1], t[2] = n[2], t;\n }\n function bt(t, n, i, e) {\n return t[0] = n, t[1] = i, t[2] = e, t;\n }\n function xt(t, n, i) {\n return t[0] = n[0] + i[0], t[1] = n[1] + i[1], t[2] = n[2] + i[2], t;\n }\n function Ft(t, n, i) {\n return t[0] = n[0] / i[0], t[1] = n[1] / i[1], t[2] = n[2] / i[2], t;\n }\n function At(t, n) {\n var i = n[0], e = n[1], r = n[2], s = i * i + e * e + r * r;\n return s > 0 && (s = 1 / Math.sqrt(s), t[0] = n[0] * s, t[1] = n[1] * s, t[2] = n[2] * s), \n t;\n }\n function kt(t, n) {\n return t[0] * n[0] + t[1] * n[1] + t[2] * n[2];\n }\n function Pt(t, n, i) {\n var e = n[0], r = n[1], s = n[2], o = i[0], a = i[1], h = i[2];\n return t[0] = r * h - s * a, t[1] = s * o - e * h, t[2] = e * a - r * o, t;\n }\n var St = function(t, n, i) {\n return t[0] = n[0] - i[0], t[1] = n[1] - i[1], t[2] = n[2] - i[2], t;\n };\n function _t(t, n) {\n return t[0] = n[0], t[1] = n[1], t[2] = n[2], t[3] = n[3], t;\n }\n function Ot(t, n, i, e, r) {\n return t[0] = n, t[1] = i, t[2] = e, t[3] = r, t;\n }\n function It() {\n var t = new mt(4);\n return mt != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0), t[3] = 1, t;\n }\n function Tt(t, n) {\n var i = n[0] + n[4] + n[8], e = void 0;\n if (i > 0) e = Math.sqrt(i + 1), t[3] = .5 * e, e = .5 / e, t[0] = (n[5] - n[7]) * e, \n t[1] = (n[6] - n[2]) * e, t[2] = (n[1] - n[3]) * e; else {\n var r = 0;\n n[4] > n[0] && (r = 1), n[8] > n[3 * r + r] && (r = 2);\n var s = (r + 1) % 3, o = (r + 2) % 3;\n e = Math.sqrt(n[3 * r + r] - n[3 * s + s] - n[3 * o + o] + 1), t[r] = .5 * e, e = .5 / e, \n t[3] = (n[3 * s + o] - n[3 * o + s]) * e, t[s] = (n[3 * s + r] + n[3 * r + s]) * e, \n t[o] = (n[3 * o + r] + n[3 * r + o]) * e;\n }\n return t;\n }\n gt(), function() {\n var t, n = (t = new mt(4), mt != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0, \n t[3] = 0), t);\n }();\n var Lt, Ut = function(t, n, i) {\n return t[0] = n[0] * i, t[1] = n[1] * i, t[2] = n[2] * i, t[3] = n[3] * i, t;\n }, zt = function(t, n) {\n var i = n[0], e = n[1], r = n[2], s = n[3], o = i * i + e * e + r * r + s * s;\n return o > 0 && (o = 1 / Math.sqrt(o), t[0] = i * o, t[1] = e * o, t[2] = r * o, \n t[3] = s * o), t;\n };\n function Dt(t, n) {\n var i = n[0] - t[0], e = n[1] - t[1];\n return Math.sqrt(i * i + e * e);\n }\n function Et(t, n, i, e, r, s, o, a, h, u) {\n 0 === t ? function(t, n, i, e, r, s, o, a, h) {\n const u = [ 0, 0 ];\n for (let r = t; r < n; r += 3) {\n const t = r / 3 * 2, n = e[r], l = e[r + 1];\n i[t] = u[0] + n * s * o / a, i[t + 1] = u[1] - l * s * o / h;\n }\n }(n, i, e, r, 0, o, a, h, u) : 1 === t && function(t, n, i, e) {\n const r = pt(e, t, n), s = r[4], o = r[s], a = r[s + 1], h = r[s + 2], u = (a[1] - o[1]) / (a[0] - o[0]), l = (h[1] - a[1]) / (h[0] - a[0]), c = Dt(o, a), f = Dt(a, h);\n for (let r = t; r < n; r += 3) {\n const t = r / 3 * 2, n = e[r], s = e[r + 1];\n i[t] = jt(n, s, o, u, c), i[t + 1] = -jt(n, s, a, l, f);\n }\n }(n, i, e, r);\n }\n gt(), wt(1, 0, 0), wt(0, 1, 0), It(), It(), Lt = new mt(9), mt != Float32Array && (Lt[1] = 0, \n Lt[2] = 0, Lt[3] = 0, Lt[5] = 0, Lt[6] = 0, Lt[7] = 0), Lt[0] = 1, Lt[4] = 1, Lt[8] = 1, \n function() {\n var t = function() {\n var t = new mt(2);\n return mt != Float32Array && (t[0] = 0, t[1] = 0), t;\n }();\n }();\n const Ct = [];\n function jt(t, n, i, e, r) {\n return Ct[0] = (e * e * i[0] + e * (n - i[1]) + t) / (e * e + 1), Ct[1] = e * (Ct[0] - i[0]) + i[1], \n Dt(i, Ct) / r;\n }\n function Nt(t, n, i, e, r) {\n const s = 3 * n[i - 1], o = 3 * n[i - 1] + 1, a = t[s], h = t[o];\n return u = e, l = r, c = a, f = h, Math.sqrt((c - u) * (c - u) + (f - l) * (f - l));\n var u, l, c, f;\n }\n "undefined" != typeof undefinedThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof undefined ? global : "undefined" != typeof self && self;\n var Ht = Vt;\n function Vt(t, n) {\n this.x = t, this.y = n;\n }\n function Rt(t, n, i) {\n i = i || {}, this.w = t || 64, this.h = n || 64, this.autoResize = !!i.autoResize, \n this.shelves = [], this.freebins = [], this.stats = {}, this.bins = {}, this.maxId = 0;\n }\n function $t(t, n, i) {\n this.x = 0, this.y = t, this.w = this.free = n, this.h = i;\n }\n function Wt(t, n, i, e, r, s, o) {\n this.id = t, this.x = n, this.y = i, this.w = e, this.h = r, this.maxw = s || e, \n this.maxh = o || r, this.refcount = 0;\n }\n Vt.prototype = {\n clone: function() {\n return new Vt(this.x, this.y);\n },\n add: function(t) {\n return this.clone().u(t);\n },\n sub: function(t) {\n return this.clone().v(t);\n },\n multByPoint: function(t) {\n return this.clone().m(t);\n },\n divByPoint: function(t) {\n return this.clone().M(t);\n },\n mult: function(t) {\n return this.clone().F(t);\n },\n div: function(t) {\n return this.clone().A(t);\n },\n rotate: function(t) {\n return this.clone().k(t);\n },\n rotateAround: function(t, n) {\n return this.clone().P(t, n);\n },\n matMult: function(t) {\n return this.clone().S(t);\n },\n unit: function() {\n return this.clone()._();\n },\n perp: function() {\n return this.clone().O();\n },\n round: function() {\n return this.clone().I();\n },\n mag: function() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n },\n equals: function(t) {\n return this.x === t.x && this.y === t.y;\n },\n dist: function(t) {\n return Math.sqrt(this.distSqr(t));\n },\n distSqr: function(t) {\n var n = t.x - this.x, i = t.y - this.y;\n return n * n + i * i;\n },\n angle: function() {\n return Math.atan2(this.y, this.x);\n },\n angleTo: function(t) {\n return Math.atan2(this.y - t.y, this.x - t.x);\n },\n angleWith: function(t) {\n return this.angleWithSep(t.x, t.y);\n },\n angleWithSep: function(t, n) {\n return Math.atan2(this.x * n - this.y * t, this.x * t + this.y * n);\n },\n S: function(t) {\n var n = t[0] * this.x + t[1] * this.y, i = t[2] * this.x + t[3] * this.y;\n return this.x = n, this.y = i, this;\n },\n u: function(t) {\n return this.x += t.x, this.y += t.y, this;\n },\n v: function(t) {\n return this.x -= t.x, this.y -= t.y, this;\n },\n F: function(t) {\n return this.x *= t, this.y *= t, this;\n },\n A: function(t) {\n return this.x /= t, this.y /= t, this;\n },\n m: function(t) {\n return this.x *= t.x, this.y *= t.y, this;\n },\n M: function(t) {\n return this.x /= t.x, this.y /= t.y, this;\n },\n _: function() {\n return this.A(this.mag()), this;\n },\n O: function() {\n var t = this.y;\n return this.y = this.x, this.x = -t, this;\n },\n k: function(t) {\n var n = Math.cos(t), i = Math.sin(t), e = n * this.x - i * this.y, r = i * this.x + n * this.y;\n return this.x = e, this.y = r, this;\n },\n P: function(t, n) {\n var i = Math.cos(t), e = Math.sin(t), r = n.x + i * (this.x - n.x) - e * (this.y - n.y), s = n.y + e * (this.x - n.x) + i * (this.y - n.y);\n return this.x = r, this.y = s, this;\n },\n I: function() {\n return this.x = Math.round(this.x), this.y = Math.round(this.y), this;\n }\n }, Vt.convert = function(t) {\n return t instanceof Vt ? t : Array.isArray(t) ? new Vt(t[0], t[1]) : t;\n }, Rt.prototype.pack = function(t, n) {\n t = [].concat(t), n = n || {};\n for (var i, e, r, s, o = [], a = 0; a < t.length; a++) if (i = t[a].w || t[a].width, \n e = t[a].h || t[a].height, r = t[a].id, i && e) {\n if (!(s = this.packOne(i, e, r))) continue;\n n.inPlace && (t[a].x = s.x, t[a].y = s.y, t[a].id = s.id), o.push(s);\n }\n return this.shrink(), o;\n }, Rt.prototype.packOne = function(t, n, i) {\n var e, r, s, o, a, h, u, l, c = {\n freebin: -1,\n shelf: -1,\n waste: 1 / 0\n }, f = 0;\n if ("string" == typeof i || "number" == typeof i) {\n if (e = this.getBin(i)) return this.ref(e), e;\n "number" == typeof i && (this.maxId = Math.max(i, this.maxId));\n } else i = ++this.maxId;\n for (o = 0; o < this.freebins.length; o++) {\n if (n === (e = this.freebins[o]).maxh && t === e.maxw) return this.allocFreebin(o, t, n, i);\n n > e.maxh || t > e.maxw || n <= e.maxh && t <= e.maxw && (s = e.maxw * e.maxh - t * n) < c.waste && (c.waste = s, \n c.freebin = o);\n }\n for (o = 0; o < this.shelves.length; o++) if (f += (r = this.shelves[o]).h, !(t > r.free)) {\n if (n === r.h) return this.allocShelf(o, t, n, i);\n n > r.h || n < r.h && (s = (r.h - n) * t) < c.waste && (c.freebin = -1, c.waste = s, \n c.shelf = o);\n }\n return -1 !== c.freebin ? this.allocFreebin(c.freebin, t, n, i) : -1 !== c.shelf ? this.allocShelf(c.shelf, t, n, i) : n <= this.h - f && t <= this.w ? (r = new $t(f, this.w, n), \n this.allocShelf(this.shelves.push(r) - 1, t, n, i)) : this.autoResize ? (a = h = this.h, \n ((u = l = this.w) <= a || t > u) && (l = 2 * Math.max(t, u)), (a < u || n > a) && (h = 2 * Math.max(n, a)), \n this.resize(l, h), this.packOne(t, n, i)) : null;\n }, Rt.prototype.allocFreebin = function(t, n, i, e) {\n var r = this.freebins.splice(t, 1)[0];\n return r.id = e, r.w = n, r.h = i, r.refcount = 0, this.bins[e] = r, this.ref(r), \n r;\n }, Rt.prototype.allocShelf = function(t, n, i, e) {\n var r = this.shelves[t].alloc(n, i, e);\n return this.bins[e] = r, this.ref(r), r;\n }, Rt.prototype.shrink = function() {\n if (this.shelves.length > 0) {\n for (var t = 0, n = 0, i = 0; i < this.shelves.length; i++) {\n var e = this.shelves[i];\n n += e.h, t = Math.max(e.w - e.free, t);\n }\n this.resize(t, n);\n }\n }, Rt.prototype.getBin = function(t) {\n return this.bins[t];\n }, Rt.prototype.ref = function(t) {\n if (1 == ++t.refcount) {\n var n = t.h;\n this.stats[n] = 1 + (0 | this.stats[n]);\n }\n return t.refcount;\n }, Rt.prototype.unref = function(t) {\n return 0 === t.refcount ? 0 : (0 == --t.refcount && (this.stats[t.h]--, delete this.bins[t.id], \n this.freebins.push(t)), t.refcount);\n }, Rt.prototype.clear = function() {\n this.shelves = [], this.freebins = [], this.stats = {}, this.bins = {}, this.maxId = 0;\n }, Rt.prototype.resize = function(t, n) {\n this.w = t, this.h = n;\n for (var i = 0; i < this.shelves.length; i++) this.shelves[i].resize(t);\n return !0;\n }, $t.prototype.alloc = function(t, n, i) {\n if (t > this.free || n > this.h) return null;\n var e = this.x;\n return this.x += t, this.free -= t, new Wt(i, e, this.y, t, n, t, this.h);\n }, $t.prototype.resize = function(t) {\n return this.free += t - this.w, this.w = t, !0;\n };\n var qt = {\n exports: {}\n };\n qt.exports = function() {\n function t(t, n, i) {\n var e = t[n];\n t[n] = t[i], t[i] = e;\n }\n function n(t, n) {\n return t < n ? -1 : t > n ? 1 : 0;\n }\n return function(i, e, r, s, o) {\n !function n(i, e, r, s, o) {\n for (;s > r; ) {\n if (s - r > 600) {\n var a = s - r + 1, h = e - r + 1, u = Math.log(a), l = .5 * Math.exp(2 * u / 3), c = .5 * Math.sqrt(u * l * (a - l) / a) * (h - a / 2 < 0 ? -1 : 1), f = Math.max(r, Math.floor(e - h * l / a + c)), d = Math.min(s, Math.floor(e + (a - h) * l / a + c));\n n(i, e, f, d, o);\n }\n var y = i[e], v = r, p = s;\n for (t(i, r, e), o(i[s], y) > 0 && t(i, r, s); v < p; ) {\n for (t(i, v, p), v++, p--; o(i[v], y) < 0; ) v++;\n for (;o(i[p], y) > 0; ) p--;\n }\n 0 === o(i[r], y) ? t(i, r, p) : (p++, t(i, p, s)), p <= e && (r = p + 1), e <= p && (s = p - 1);\n }\n }(i, e, r || 0, s || i.length - 1, o || n);\n };\n }();\n var Bt = qt.exports, Gt = {\n exports: {}\n };\n function Jt(t, n) {\n if (!(this instanceof Jt)) return new Jt(t, n);\n if (this.data = t || [], this.length = this.data.length, this.compare = n || Xt, \n this.length > 0) for (var i = (this.length >> 1) - 1; i >= 0; i--) this.T(i);\n }\n function Xt(t, n) {\n return t < n ? -1 : t > n ? 1 : 0;\n }\n Gt.exports = Jt, Gt.exports.default = Jt, Jt.prototype = {\n push: function(t) {\n this.data.push(t), this.length++, this.L(this.length - 1);\n },\n pop: function() {\n if (0 !== this.length) {\n var t = this.data[0];\n return this.length--, this.length > 0 && (this.data[0] = this.data[this.length], \n this.T(0)), this.data.pop(), t;\n }\n },\n peek: function() {\n return this.data[0];\n },\n L: function(t) {\n for (var n = this.data, i = this.compare, e = n[t]; t > 0; ) {\n var r = t - 1 >> 1, s = n[r];\n if (i(e, s) >= 0) break;\n n[t] = s, t = r;\n }\n n[t] = e;\n },\n T: function(t) {\n for (var n = this.data, i = this.compare, e = this.length >> 1, r = n[t]; t < e; ) {\n var s = 1 + (t << 1), o = s + 1, a = n[s];\n if (o < this.length && i(n[o], a) < 0 && (s = o, a = n[o]), i(a, r) >= 0) break;\n n[t] = a, t = s;\n }\n n[t] = r;\n }\n };\n var Zt = Gt.exports, Yt = {\n exports: {}\n }, Kt = {\n aliceblue: [ 240, 248, 255 ],\n antiquewhite: [ 250, 235, 215 ],\n aqua: [ 0, 255, 255 ],\n aquamarine: [ 127, 255, 212 ],\n azure: [ 240, 255, 255 ],\n beige: [ 245, 245, 220 ],\n bisque: [ 255, 228, 196 ],\n black: [ 0, 0, 0 ],\n blanchedalmond: [ 255, 235, 205 ],\n blue: [ 0, 0, 255 ],\n blueviolet: [ 138, 43, 226 ],\n brown: [ 165, 42, 42 ],\n burlywood: [ 222, 184, 135 ],\n cadetblue: [ 95, 158, 160 ],\n chartreuse: [ 127, 255, 0 ],\n chocolate: [ 210, 105, 30 ],\n coral: [ 255, 127, 80 ],\n cornflowerblue: [ 100, 149, 237 ],\n cornsilk: [ 255, 248, 220 ],\n crimson: [ 220, 20, 60 ],\n cyan: [ 0, 255, 255 ],\n darkblue: [ 0, 0, 139 ],\n darkcyan: [ 0, 139, 139 ],\n darkgoldenrod: [ 184, 134, 11 ],\n darkgray: [ 169, 169, 169 ],\n darkgreen: [ 0, 100, 0 ],\n darkgrey: [ 169, 169, 169 ],\n darkkhaki: [ 189, 183, 107 ],\n darkmagenta: [ 139, 0, 139 ],\n darkolivegreen: [ 85, 107, 47 ],\n darkorange: [ 255, 140, 0 ],\n darkorchid: [ 153, 50, 204 ],\n darkred: [ 139, 0, 0 ],\n darksalmon: [ 233, 150, 122 ],\n darkseagreen: [ 143, 188, 143 ],\n darkslateblue: [ 72, 61, 139 ],\n darkslategray: [ 47, 79, 79 ],\n darkslategrey: [ 47, 79, 79 ],\n darkturquoise: [ 0, 206, 209 ],\n darkviolet: [ 148, 0, 211 ],\n deeppink: [ 255, 20, 147 ],\n deepskyblue: [ 0, 191, 255 ],\n dimgray: [ 105, 105, 105 ],\n dimgrey: [ 105, 105, 105 ],\n dodgerblue: [ 30, 144, 255 ],\n firebrick: [ 178, 34, 34 ],\n floralwhite: [ 255, 250, 240 ],\n forestgreen: [ 34, 139, 34 ],\n fuchsia: [ 255, 0, 255 ],\n gainsboro: [ 220, 220, 220 ],\n ghostwhite: [ 248, 248, 255 ],\n gold: [ 255, 215, 0 ],\n goldenrod: [ 218, 165, 32 ],\n gray: [ 128, 128, 128 ],\n green: [ 0, 128, 0 ],\n greenyellow: [ 173, 255, 47 ],\n grey: [ 128, 128, 128 ],\n honeydew: [ 240, 255, 240 ],\n hotpink: [ 255, 105, 180 ],\n indianred: [ 205, 92, 92 ],\n indigo: [ 75, 0, 130 ],\n ivory: [ 255, 255, 240 ],\n khaki: [ 240, 230, 140 ],\n lavender: [ 230, 230, 250 ],\n lavenderblush: [ 255, 240, 245 ],\n lawngreen: [ 124, 252, 0 ],\n lemonchiffon: [ 255, 250, 205 ],\n lightblue: [ 173, 216, 230 ],\n lightcoral: [ 240, 128, 128 ],\n lightcyan: [ 224, 255, 255 ],\n lightgoldenrodyellow: [ 250, 250, 210 ],\n lightgray: [ 211, 211, 211 ],\n lightgreen: [ 144, 238, 144 ],\n lightgrey: [ 211, 211, 211 ],\n lightpink: [ 255, 182, 193 ],\n lightsalmon: [ 255, 160, 122 ],\n lightseagreen: [ 32, 178, 170 ],\n lightskyblue: [ 135, 206, 250 ],\n lightslategray: [ 119, 136, 153 ],\n lightslategrey: [ 119, 136, 153 ],\n lightsteelblue: [ 176, 196, 222 ],\n lightyellow: [ 255, 255, 224 ],\n lime: [ 0, 255, 0 ],\n limegreen: [ 50, 205, 50 ],\n linen: [ 250, 240, 230 ],\n magenta: [ 255, 0, 255 ],\n maroon: [ 128, 0, 0 ],\n mediumaquamarine: [ 102, 205, 170 ],\n mediumblue: [ 0, 0, 205 ],\n mediumorchid: [ 186, 85, 211 ],\n mediumpurple: [ 147, 112, 219 ],\n mediumseagreen: [ 60, 179, 113 ],\n mediumslateblue: [ 123, 104, 238 ],\n mediumspringgreen: [ 0, 250, 154 ],\n mediumturquoise: [ 72, 209, 204 ],\n mediumvioletred: [ 199, 21, 133 ],\n midnightblue: [ 25, 25, 112 ],\n mintcream: [ 245, 255, 250 ],\n mistyrose: [ 255, 228, 225 ],\n moccasin: [ 255, 228, 181 ],\n navajowhite: [ 255, 222, 173 ],\n navy: [ 0, 0, 128 ],\n oldlace: [ 253, 245, 230 ],\n olive: [ 128, 128, 0 ],\n olivedrab: [ 107, 142, 35 ],\n orange: [ 255, 165, 0 ],\n orangered: [ 255, 69, 0 ],\n orchid: [ 218, 112, 214 ],\n palegoldenrod: [ 238, 232, 170 ],\n palegreen: [ 152, 251, 152 ],\n paleturquoise: [ 175, 238, 238 ],\n palevioletred: [ 219, 112, 147 ],\n papayawhip: [ 255, 239, 213 ],\n peachpuff: [ 255, 218, 185 ],\n peru: [ 205, 133, 63 ],\n pink: [ 255, 192, 203 ],\n plum: [ 221, 160, 221 ],\n powderblue: [ 176, 224, 230 ],\n purple: [ 128, 0, 128 ],\n rebeccapurple: [ 102, 51, 153 ],\n red: [ 255, 0, 0 ],\n rosybrown: [ 188, 143, 143 ],\n royalblue: [ 65, 105, 225 ],\n saddlebrown: [ 139, 69, 19 ],\n salmon: [ 250, 128, 114 ],\n sandybrown: [ 244, 164, 96 ],\n seagreen: [ 46, 139, 87 ],\n seashell: [ 255, 245, 238 ],\n sienna: [ 160, 82, 45 ],\n silver: [ 192, 192, 192 ],\n skyblue: [ 135, 206, 235 ],\n slateblue: [ 106, 90, 205 ],\n slategray: [ 112, 128, 144 ],\n slategrey: [ 112, 128, 144 ],\n snow: [ 255, 250, 250 ],\n springgreen: [ 0, 255, 127 ],\n steelblue: [ 70, 130, 180 ],\n tan: [ 210, 180, 140 ],\n teal: [ 0, 128, 128 ],\n thistle: [ 216, 191, 216 ],\n tomato: [ 255, 99, 71 ],\n turquoise: [ 64, 224, 208 ],\n violet: [ 238, 130, 238 ],\n wheat: [ 245, 222, 179 ],\n white: [ 255, 255, 255 ],\n whitesmoke: [ 245, 245, 245 ],\n yellow: [ 255, 255, 0 ],\n yellowgreen: [ 154, 205, 50 ]\n }, Qt = {\n exports: {}\n }, tn = function(t) {\n return !(!t || "string" == typeof t) && (t instanceof Array || Array.isArray(t) || t.length >= 0 && (t.splice instanceof Function || Object.getOwnPropertyDescriptor(t, t.length - 1) && "String" !== t.constructor.name));\n }, nn = Array.prototype.concat, en = Array.prototype.slice, rn = Qt.exports = function(t) {\n for (var n = [], i = 0, e = t.length; i < e; i++) {\n var r = t[i];\n tn(r) ? n = nn.call(n, en.call(r)) : n.push(r);\n }\n return n;\n };\n rn.wrap = function(t) {\n return function() {\n return t(rn(arguments));\n };\n };\n var sn = Kt, on = Qt.exports, an = Object.hasOwnProperty, hn = {};\n for (var un in sn) an.call(sn, un) && (hn[sn[un]] = un);\n var ln = Yt.exports = {\n to: {},\n get: {}\n };\n function cn(t, n, i) {\n return Math.min(Math.max(n, t), i);\n }\n function fn(t) {\n var n = Math.round(t).toString(16).toUpperCase();\n return n.length < 2 ? "0" + n : n;\n }\n ln.get = function(t) {\n var n, i;\n switch (t.substring(0, 3).toLowerCase()) {\n case "hsl":\n n = ln.get.hsl(t), i = "hsl";\n break;\n\n case "hwb":\n n = ln.get.hwb(t), i = "hwb";\n break;\n\n default:\n n = ln.get.rgb(t), i = "rgb";\n }\n return n ? {\n model: i,\n value: n\n } : null;\n }, ln.get.rgb = function(t) {\n if (!t) return null;\n var n, i, e, r = [ 0, 0, 0, 1 ];\n if (n = t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)) {\n for (e = n[2], n = n[1], i = 0; i < 3; i++) {\n var s = 2 * i;\n r[i] = parseInt(n.slice(s, s + 2), 16);\n }\n e && (r[3] = parseInt(e, 16) / 255);\n } else if (n = t.match(/^#([a-f0-9]{3,4})$/i)) {\n for (e = (n = n[1])[3], i = 0; i < 3; i++) r[i] = parseInt(n[i] + n[i], 16);\n e && (r[3] = parseInt(e + e, 16) / 255);\n } else if (n = t.match(/^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)) {\n for (i = 0; i < 3; i++) r[i] = parseInt(n[i + 1], 0);\n n[4] && (n[5] ? r[3] = .01 * parseFloat(n[4]) : r[3] = parseFloat(n[4]));\n } else {\n if (!(n = t.match(/^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/))) return (n = t.match(/^(\\w+)$/)) ? "transparent" === n[1] ? [ 0, 0, 0, 0 ] : an.call(sn, n[1]) ? ((r = sn[n[1]])[3] = 1, \n r) : null : null;\n for (i = 0; i < 3; i++) r[i] = Math.round(2.55 * parseFloat(n[i + 1]));\n n[4] && (n[5] ? r[3] = .01 * parseFloat(n[4]) : r[3] = parseFloat(n[4]));\n }\n for (i = 0; i < 3; i++) r[i] = cn(r[i], 0, 255);\n return r[3] = cn(r[3], 0, 1), r;\n }, ln.get.hsl = function(t) {\n if (!t) return null;\n var n = t.match(/^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);\n if (n) {\n var i = parseFloat(n[4]);\n return [ (parseFloat(n[1]) % 360 + 360) % 360, cn(parseFloat(n[2]), 0, 100), cn(parseFloat(n[3]), 0, 100), cn(isNaN(i) ? 1 : i, 0, 1) ];\n }\n return null;\n }, ln.get.hwb = function(t) {\n if (!t) return null;\n var n = t.match(/^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);\n if (n) {\n var i = parseFloat(n[4]);\n return [ (parseFloat(n[1]) % 360 + 360) % 360, cn(parseFloat(n[2]), 0, 100), cn(parseFloat(n[3]), 0, 100), cn(isNaN(i) ? 1 : i, 0, 1) ];\n }\n return null;\n }, ln.to.hex = function() {\n var t = on(arguments);\n return "#" + fn(t[0]) + fn(t[1]) + fn(t[2]) + (t[3] < 1 ? fn(Math.round(255 * t[3])) : "");\n }, ln.to.rgb = function() {\n var t = on(arguments);\n return t.length < 4 || 1 === t[3] ? "rgb(" + Math.round(t[0]) + ", " + Math.round(t[1]) + ", " + Math.round(t[2]) + ")" : "rgba(" + Math.round(t[0]) + ", " + Math.round(t[1]) + ", " + Math.round(t[2]) + ", " + t[3] + ")";\n }, ln.to.rgb.percent = function() {\n var t = on(arguments), n = Math.round(t[0] / 255 * 100), i = Math.round(t[1] / 255 * 100), e = Math.round(t[2] / 255 * 100);\n return t.length < 4 || 1 === t[3] ? "rgb(" + n + "%, " + i + "%, " + e + "%)" : "rgba(" + n + "%, " + i + "%, " + e + "%, " + t[3] + ")";\n }, ln.to.hsl = function() {\n var t = on(arguments);\n return t.length < 4 || 1 === t[3] ? "hsl(" + t[0] + ", " + t[1] + "%, " + t[2] + "%)" : "hsla(" + t[0] + ", " + t[1] + "%, " + t[2] + "%, " + t[3] + ")";\n }, ln.to.hwb = function() {\n var t = on(arguments), n = "";\n return t.length >= 4 && 1 !== t[3] && (n = ", " + t[3]), "hwb(" + t[0] + ", " + t[1] + "%, " + t[2] + "%" + n + ")";\n }, ln.to.keyword = function(t) {\n return hn[t.slice(0, 3)];\n };\n var dn = {\n exports: {}\n }, yn = Kt, vn = {};\n for (var pn in yn) yn.hasOwnProperty(pn) && (vn[yn[pn]] = pn);\n var mn = dn.exports = {\n rgb: {\n channels: 3,\n labels: "rgb"\n },\n hsl: {\n channels: 3,\n labels: "hsl"\n },\n hsv: {\n channels: 3,\n labels: "hsv"\n },\n hwb: {\n channels: 3,\n labels: "hwb"\n },\n cmyk: {\n channels: 4,\n labels: "cmyk"\n },\n xyz: {\n channels: 3,\n labels: "xyz"\n },\n lab: {\n channels: 3,\n labels: "lab"\n },\n lch: {\n channels: 3,\n labels: "lch"\n },\n hex: {\n channels: 1,\n labels: [ "hex" ]\n },\n keyword: {\n channels: 1,\n labels: [ "keyword" ]\n },\n ansi16: {\n channels: 1,\n labels: [ "ansi16" ]\n },\n ansi256: {\n channels: 1,\n labels: [ "ansi256" ]\n },\n hcg: {\n channels: 3,\n labels: [ "h", "c", "g" ]\n },\n apple: {\n channels: 3,\n labels: [ "r16", "g16", "b16" ]\n },\n gray: {\n channels: 1,\n labels: [ "gray" ]\n }\n };\n for (var gn in mn) if (mn.hasOwnProperty(gn)) {\n if (!("channels" in mn[gn])) throw new Error("missing channels property: " + gn);\n if (!("labels" in mn[gn])) throw new Error("missing channel labels property: " + gn);\n if (mn[gn].labels.length !== mn[gn].channels) throw new Error("channel and label counts mismatch: " + gn);\n var wn = mn[gn].channels, Mn = mn[gn].labels;\n delete mn[gn].channels, delete mn[gn].labels, Object.defineProperty(mn[gn], "channels", {\n value: wn\n }), Object.defineProperty(mn[gn], "labels", {\n value: Mn\n });\n }\n function bn(t, n) {\n return Math.pow(t[0] - n[0], 2) + Math.pow(t[1] - n[1], 2) + Math.pow(t[2] - n[2], 2);\n }\n mn.rgb.hsl = function(t) {\n var n, i, e = t[0] / 255, r = t[1] / 255, s = t[2] / 255, o = Math.min(e, r, s), a = Math.max(e, r, s), h = a - o;\n return a === o ? n = 0 : e === a ? n = (r - s) / h : r === a ? n = 2 + (s - e) / h : s === a && (n = 4 + (e - r) / h), \n (n = Math.min(60 * n, 360)) < 0 && (n += 360), i = (o + a) / 2, [ n, 100 * (a === o ? 0 : i <= .5 ? h / (a + o) : h / (2 - a - o)), 100 * i ];\n }, mn.rgb.hsv = function(t) {\n var n, i, e, r, s, o = t[0] / 255, a = t[1] / 255, h = t[2] / 255, u = Math.max(o, a, h), l = u - Math.min(o, a, h), c = function(t) {\n return (u - t) / 6 / l + .5;\n };\n return 0 === l ? r = s = 0 : (s = l / u, n = c(o), i = c(a), e = c(h), o === u ? r = e - i : a === u ? r = 1 / 3 + n - e : h === u && (r = 2 / 3 + i - n), \n r < 0 ? r += 1 : r > 1 && (r -= 1)), [ 360 * r, 100 * s, 100 * u ];\n }, mn.rgb.hwb = function(t) {\n var n = t[0], i = t[1], e = t[2];\n return [ mn.rgb.hsl(t)[0], 100 * (1 / 255 * Math.min(n, Math.min(i, e))), 100 * (e = 1 - 1 / 255 * Math.max(n, Math.max(i, e))) ];\n }, mn.rgb.cmyk = function(t) {\n var n, i = t[0] / 255, e = t[1] / 255, r = t[2] / 255;\n return [ 100 * ((1 - i - (n = Math.min(1 - i, 1 - e, 1 - r))) / (1 - n) || 0), 100 * ((1 - e - n) / (1 - n) || 0), 100 * ((1 - r - n) / (1 - n) || 0), 100 * n ];\n }, mn.rgb.keyword = function(t) {\n var n = vn[t];\n if (n) return n;\n var i, e = 1 / 0;\n for (var r in yn) if (yn.hasOwnProperty(r)) {\n var s = bn(t, yn[r]);\n s < e && (e = s, i = r);\n }\n return i;\n }, mn.keyword.rgb = function(t) {\n return yn[t];\n }, mn.rgb.xyz = function(t) {\n var n = t[0] / 255, i = t[1] / 255, e = t[2] / 255;\n return [ 100 * (.4124 * (n = n > .04045 ? Math.pow((n + .055) / 1.055, 2.4) : n / 12.92) + .3576 * (i = i > .04045 ? Math.pow((i + .055) / 1.055, 2.4) : i / 12.92) + .1805 * (e = e > .04045 ? Math.pow((e + .055) / 1.055, 2.4) : e / 12.92)), 100 * (.2126 * n + .7152 * i + .0722 * e), 100 * (.0193 * n + .1192 * i + .9505 * e) ];\n }, mn.rgb.lab = function(t) {\n var n = mn.rgb.xyz(t), i = n[0], e = n[1], r = n[2];\n return e /= 100, r /= 108.883, i = (i /= 95.047) > .008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116, \n [ 116 * (e = e > .008856 ? Math.pow(e, 1 / 3) : 7.787 * e + 16 / 116) - 16, 500 * (i - e), 200 * (e - (r = r > .008856 ? Math.pow(r, 1 / 3) : 7.787 * r + 16 / 116)) ];\n }, mn.hsl.rgb = function(t) {\n var n, i, e, r, s, o = t[0] / 360, a = t[1] / 100, h = t[2] / 100;\n if (0 === a) return [ s = 255 * h, s, s ];\n n = 2 * h - (i = h < .5 ? h * (1 + a) : h + a - h * a), r = [ 0, 0, 0 ];\n for (var u = 0; u < 3; u++) (e = o + 1 / 3 * -(u - 1)) < 0 && e++, e > 1 && e--, \n s = 6 * e < 1 ? n + 6 * (i - n) * e : 2 * e < 1 ? i : 3 * e < 2 ? n + (i - n) * (2 / 3 - e) * 6 : n, \n r[u] = 255 * s;\n return r;\n }, mn.hsl.hsv = function(t) {\n var n = t[0], i = t[1] / 100, e = t[2] / 100, r = i, s = Math.max(e, .01);\n return i *= (e *= 2) <= 1 ? e : 2 - e, r *= s <= 1 ? s : 2 - s, [ n, 100 * (0 === e ? 2 * r / (s + r) : 2 * i / (e + i)), 100 * ((e + i) / 2) ];\n }, mn.hsv.rgb = function(t) {\n var n = t[0] / 60, i = t[1] / 100, e = t[2] / 100, r = Math.floor(n) % 6, s = n - Math.floor(n), o = 255 * e * (1 - i), a = 255 * e * (1 - i * s), h = 255 * e * (1 - i * (1 - s));\n switch (e *= 255, r) {\n case 0:\n return [ e, h, o ];\n\n case 1:\n return [ a, e, o ];\n\n case 2:\n return [ o, e, h ];\n\n case 3:\n return [ o, a, e ];\n\n case 4:\n return [ h, o, e ];\n\n case 5:\n return [ e, o, a ];\n }\n }, mn.hsv.hsl = function(t) {\n var n, i, e, r = t[0], s = t[1] / 100, o = t[2] / 100, a = Math.max(o, .01);\n return e = (2 - s) * o, i = s * a, [ r, 100 * (i = (i /= (n = (2 - s) * a) <= 1 ? n : 2 - n) || 0), 100 * (e /= 2) ];\n }, mn.hwb.rgb = function(t) {\n var n, i, e, r, s, o, a, h = t[0] / 360, u = t[1] / 100, l = t[2] / 100, c = u + l;\n switch (c > 1 && (u /= c, l /= c), e = 6 * h - (n = Math.floor(6 * h)), 0 != (1 & n) && (e = 1 - e), \n r = u + e * ((i = 1 - l) - u), n) {\n default:\n case 6:\n case 0:\n s = i, o = r, a = u;\n break;\n\n case 1:\n s = r, o = i, a = u;\n break;\n\n case 2:\n s = u, o = i, a = r;\n break;\n\n case 3:\n s = u, o = r, a = i;\n break;\n\n case 4:\n s = r, o = u, a = i;\n break;\n\n case 5:\n s = i, o = u, a = r;\n }\n return [ 255 * s, 255 * o, 255 * a ];\n }, mn.cmyk.rgb = function(t) {\n var n = t[0] / 100, i = t[1] / 100, e = t[2] / 100, r = t[3] / 100;\n return [ 255 * (1 - Math.min(1, n * (1 - r) + r)), 255 * (1 - Math.min(1, i * (1 - r) + r)), 255 * (1 - Math.min(1, e * (1 - r) + r)) ];\n }, mn.xyz.rgb = function(t) {\n var n, i, e, r = t[0] / 100, s = t[1] / 100, o = t[2] / 100;\n return i = -.9689 * r + 1.8758 * s + .0415 * o, e = .0557 * r + -.204 * s + 1.057 * o, \n n = (n = 3.2406 * r + -1.5372 * s + -.4986 * o) > .0031308 ? 1.055 * Math.pow(n, 1 / 2.4) - .055 : 12.92 * n, \n i = i > .0031308 ? 1.055 * Math.pow(i, 1 / 2.4) - .055 : 12.92 * i, e = e > .0031308 ? 1.055 * Math.pow(e, 1 / 2.4) - .055 : 12.92 * e, \n [ 255 * (n = Math.min(Math.max(0, n), 1)), 255 * (i = Math.min(Math.max(0, i), 1)), 255 * (e = Math.min(Math.max(0, e), 1)) ];\n }, mn.xyz.lab = function(t) {\n var n = t[0], i = t[1], e = t[2];\n return i /= 100, e /= 108.883, n = (n /= 95.047) > .008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116, \n [ 116 * (i = i > .008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116) - 16, 500 * (n - i), 200 * (i - (e = e > .008856 ? Math.pow(e, 1 / 3) : 7.787 * e + 16 / 116)) ];\n }, mn.lab.xyz = function(t) {\n var n, i, e, r = t[0];\n n = t[1] / 500 + (i = (r + 16) / 116), e = i - t[2] / 200;\n var s = Math.pow(i, 3), o = Math.pow(n, 3), a = Math.pow(e, 3);\n return i = s > .008856 ? s : (i - 16 / 116) / 7.787, n = o > .008856 ? o : (n - 16 / 116) / 7.787, \n e = a > .008856 ? a : (e - 16 / 116) / 7.787, [ n *= 95.047, i *= 100, e *= 108.883 ];\n }, mn.lab.lch = function(t) {\n var n, i = t[0], e = t[1], r = t[2];\n return (n = 360 * Math.atan2(r, e) / 2 / Math.PI) < 0 && (n += 360), [ i, Math.sqrt(e * e + r * r), n ];\n }, mn.lch.lab = function(t) {\n var n, i = t[0], e = t[1];\n return n = t[2] / 360 * 2 * Math.PI, [ i, e * Math.cos(n), e * Math.sin(n) ];\n }, mn.rgb.ansi16 = function(t) {\n var n = t[0], i = t[1], e = t[2], r = 1 in arguments ? arguments[1] : mn.rgb.hsv(t)[2];\n if (0 === (r = Math.round(r / 50))) return 30;\n var s = 30 + (Math.round(e / 255) << 2 | Math.round(i / 255) << 1 | Math.round(n / 255));\n return 2 === r && (s += 60), s;\n }, mn.hsv.ansi16 = function(t) {\n return mn.rgb.ansi16(mn.hsv.rgb(t), t[2]);\n }, mn.rgb.ansi256 = function(t) {\n var n = t[0], i = t[1], e = t[2];\n return n === i && i === e ? n < 8 ? 16 : n > 248 ? 231 : Math.round((n - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(n / 255 * 5) + 6 * Math.round(i / 255 * 5) + Math.round(e / 255 * 5);\n }, mn.ansi16.rgb = function(t) {\n var n = t % 10;\n if (0 === n || 7 === n) return t > 50 && (n += 3.5), [ n = n / 10.5 * 255, n, n ];\n var i = .5 * (1 + ~~(t > 50));\n return [ (1 & n) * i * 255, (n >> 1 & 1) * i * 255, (n >> 2 & 1) * i * 255 ];\n }, mn.ansi256.rgb = function(t) {\n if (t >= 232) {\n var n = 10 * (t - 232) + 8;\n return [ n, n, n ];\n }\n var i;\n return t -= 16, [ Math.floor(t / 36) / 5 * 255, Math.floor((i = t % 36) / 6) / 5 * 255, i % 6 / 5 * 255 ];\n }, mn.rgb.hex = function(t) {\n var n = (((255 & Math.round(t[0])) << 16) + ((255 & Math.round(t[1])) << 8) + (255 & Math.round(t[2]))).toString(16).toUpperCase();\n return "000000".substring(n.length) + n;\n }, mn.hex.rgb = function(t) {\n var n = t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n if (!n) return [ 0, 0, 0 ];\n var i = n[0];\n 3 === n[0].length && (i = i.split("").map((function(t) {\n return t + t;\n })).join(""));\n var e = parseInt(i, 16);\n return [ e >> 16 & 255, e >> 8 & 255, 255 & e ];\n }, mn.rgb.hcg = function(t) {\n var n, i = t[0] / 255, e = t[1] / 255, r = t[2] / 255, s = Math.max(Math.max(i, e), r), o = Math.min(Math.min(i, e), r), a = s - o;\n return n = a <= 0 ? 0 : s === i ? (e - r) / a % 6 : s === e ? 2 + (r - i) / a : 4 + (i - e) / a + 4, \n n /= 6, [ 360 * (n %= 1), 100 * a, 100 * (a < 1 ? o / (1 - a) : 0) ];\n }, mn.hsl.hcg = function(t) {\n var n = t[1] / 100, i = t[2] / 100, e = 1, r = 0;\n return (e = i < .5 ? 2 * n * i : 2 * n * (1 - i)) < 1 && (r = (i - .5 * e) / (1 - e)), \n [ t[0], 100 * e, 100 * r ];\n }, mn.hsv.hcg = function(t) {\n var n = t[1] / 100, i = t[2] / 100, e = n * i, r = 0;\n return e < 1 && (r = (i - e) / (1 - e)), [ t[0], 100 * e, 100 * r ];\n }, mn.hcg.rgb = function(t) {\n var n = t[0] / 360, i = t[1] / 100, e = t[2] / 100;\n if (0 === i) return [ 255 * e, 255 * e, 255 * e ];\n var r, s = [ 0, 0, 0 ], o = n % 1 * 6, a = o % 1, h = 1 - a;\n switch (Math.floor(o)) {\n case 0:\n s[0] = 1, s[1] = a, s[2] = 0;\n break;\n\n case 1:\n s[0] = h, s[1] = 1, s[2] = 0;\n break;\n\n case 2:\n s[0] = 0, s[1] = 1, s[2] = a;\n break;\n\n case 3:\n s[0] = 0, s[1] = h, s[2] = 1;\n break;\n\n case 4:\n s[0] = a, s[1] = 0, s[2] = 1;\n break;\n\n default:\n s[0] = 1, s[1] = 0, s[2] = h;\n }\n return r = (1 - i) * e, [ 255 * (i * s[0] + r), 255 * (i * s[1] + r), 255 * (i * s[2] + r) ];\n }, mn.hcg.hsv = function(t) {\n var n = t[1] / 100, i = n + t[2] / 100 * (1 - n), e = 0;\n return i > 0 && (e = n / i), [ t[0], 100 * e, 100 * i ];\n }, mn.hcg.hsl = function(t) {\n var n = t[1] / 100, i = t[2] / 100 * (1 - n) + .5 * n, e = 0;\n return i > 0 && i < .5 ? e = n / (2 * i) : i >= .5 && i < 1 && (e = n / (2 * (1 - i))), \n [ t[0], 100 * e, 100 * i ];\n }, mn.hcg.hwb = function(t) {\n var n = t[1] / 100, i = n + t[2] / 100 * (1 - n);\n return [ t[0], 100 * (i - n), 100 * (1 - i) ];\n }, mn.hwb.hcg = function(t) {\n var n = t[1] / 100, i = 1 - t[2] / 100, e = i - n, r = 0;\n return e < 1 && (r = (i - e) / (1 - e)), [ t[0], 100 * e, 100 * r ];\n }, mn.apple.rgb = function(t) {\n return [ t[0] / 65535 * 255, t[1] / 65535 * 255, t[2] / 65535 * 255 ];\n }, mn.rgb.apple = function(t) {\n return [ t[0] / 255 * 65535, t[1] / 255 * 65535, t[2] / 255 * 65535 ];\n }, mn.gray.rgb = function(t) {\n return [ t[0] / 100 * 255, t[0] / 100 * 255, t[0] / 100 * 255 ];\n }, mn.gray.hsl = mn.gray.hsv = function(t) {\n return [ 0, 0, t[0] ];\n }, mn.gray.hwb = function(t) {\n return [ 0, 100, t[0] ];\n }, mn.gray.cmyk = function(t) {\n return [ 0, 0, 0, t[0] ];\n }, mn.gray.lab = function(t) {\n return [ t[0], 0, 0 ];\n }, mn.gray.hex = function(t) {\n var n = 255 & Math.round(t[0] / 100 * 255), i = ((n << 16) + (n << 8) + n).toString(16).toUpperCase();\n return "000000".substring(i.length) + i;\n }, mn.rgb.gray = function(t) {\n return [ (t[0] + t[1] + t[2]) / 3 / 255 * 100 ];\n };\n var xn = dn.exports;\n function Fn(t) {\n var n = function() {\n for (var t = {}, n = Object.keys(xn), i = n.length, e = 0; e < i; e++) t[n[e]] = {\n distance: -1,\n parent: null\n };\n return t;\n }(), i = [ t ];\n for (n[t].distance = 0; i.length; ) for (var e = i.pop(), r = Object.keys(xn[e]), s = r.length, o = 0; o < s; o++) {\n var a = r[o], h = n[a];\n -1 === h.distance && (h.distance = n[e].distance + 1, h.parent = e, i.unshift(a));\n }\n return n;\n }\n function An(t, n) {\n return function(i) {\n return n(t(i));\n };\n }\n function kn(t, n) {\n for (var i = [ n[t].parent, t ], e = xn[n[t].parent][t], r = n[t].parent; n[r].parent; ) i.unshift(n[r].parent), \n e = An(xn[n[r].parent][r], e), r = n[r].parent;\n return e.conversion = i, e;\n }\n var Pn = dn.exports, Sn = function(t) {\n for (var n = Fn(t), i = {}, e = Object.keys(n), r = e.length, s = 0; s < r; s++) {\n var o = e[s];\n null !== n[o].parent && (i[o] = kn(o, n));\n }\n return i;\n }, _n = {};\n Object.keys(Pn).forEach((function(t) {\n _n[t] = {}, Object.defineProperty(_n[t], "channels", {\n value: Pn[t].channels\n }), Object.defineProperty(_n[t], "labels", {\n value: Pn[t].labels\n });\n var n = Sn(t);\n Object.keys(n).forEach((function(i) {\n var e = n[i];\n _n[t][i] = function(t) {\n var n = function(n) {\n if (null == n) return n;\n arguments.length > 1 && (n = Array.prototype.slice.call(arguments));\n var i = t(n);\n if ("object" == typeof i) for (var e = i.length, r = 0; r < e; r++) i[r] = Math.round(i[r]);\n return i;\n };\n return "conversion" in t && (n.conversion = t.conversion), n;\n }(e), _n[t][i].raw = function(t) {\n var n = function(n) {\n return null == n ? n : (arguments.length > 1 && (n = Array.prototype.slice.call(arguments)), \n t(n));\n };\n return "conversion" in t && (n.conversion = t.conversion), n;\n }(e);\n }));\n }));\n var On = _n, In = Yt.exports, Tn = On, Ln = [].slice, Un = [ "keyword", "gray", "hex" ], zn = {};\n Object.keys(Tn).forEach((function(t) {\n zn[Ln.call(Tn[t].labels).sort().join("")] = t;\n }));\n var Dn = {};\n function En(t, n) {\n if (!(this instanceof En)) return new En(t, n);\n if (n && n in Un && (n = null), n && !(n in Tn)) throw new Error("Unknown model: " + n);\n var i, e;\n if (null == t) this.model = "rgb", this.color = [ 0, 0, 0 ], this.valpha = 1; else if (t instanceof En) this.model = t.model, \n this.color = t.color.slice(), this.valpha = t.valpha; else if ("string" == typeof t) {\n var r = In.get(t);\n if (null === r) throw new Error("Unable to parse color from string: " + t);\n this.model = r.model, e = Tn[this.model].channels, this.color = r.value.slice(0, e), \n this.valpha = "number" == typeof r.value[e] ? r.value[e] : 1;\n } else if (t.length) {\n this.model = n || "rgb", e = Tn[this.model].channels;\n var s = Ln.call(t, 0, e);\n this.color = Hn(s, e), this.valpha = "number" == typeof t[e] ? t[e] : 1;\n } else if ("number" == typeof t) t &= 16777215, this.model = "rgb", this.color = [ t >> 16 & 255, t >> 8 & 255, 255 & t ], \n this.valpha = 1; else {\n this.valpha = 1;\n var o = Object.keys(t);\n "alpha" in t && (o.splice(o.indexOf("alpha"), 1), this.valpha = "number" == typeof t.alpha ? t.alpha : 0);\n var a = o.sort().join("");\n if (!(a in zn)) throw new Error("Unable to parse color from object: " + JSON.stringify(t));\n this.model = zn[a];\n var h = Tn[this.model].labels, u = [];\n for (i = 0; i < h.length; i++) u.push(t[h[i]]);\n this.color = Hn(u);\n }\n if (Dn[this.model]) for (e = Tn[this.model].channels, i = 0; i < e; i++) {\n var l = Dn[this.model][i];\n l && (this.color[i] = l(this.color[i]));\n }\n this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this);\n }\n function Cn(t, n, i) {\n return (t = Array.isArray(t) ? t : [ t ]).forEach((function(t) {\n (Dn[t] || (Dn[t] = []))[n] = i;\n })), t = t[0], function(e) {\n var r;\n return arguments.length ? (i && (e = i(e)), (r = this[t]()).color[n] = e, r) : (r = this[t]().color[n], \n i && (r = i(r)), r);\n };\n }\n function jn(t) {\n return function(n) {\n return Math.max(0, Math.min(t, n));\n };\n }\n function Nn(t) {\n return Array.isArray(t) ? t : [ t ];\n }\n function Hn(t, n) {\n for (var i = 0; i < n; i++) "number" != typeof t[i] && (t[i] = 0);\n return t;\n }\n En.prototype = {\n toString: function() {\n return this.string();\n },\n toJSON: function() {\n return this[this.model]();\n },\n string: function(t) {\n var n = this.model in In.to ? this : this.rgb(), i = 1 === (n = n.round("number" == typeof t ? t : 1)).valpha ? n.color : n.color.concat(this.valpha);\n return In.to[n.model](i);\n },\n percentString: function(t) {\n var n = this.rgb().round("number" == typeof t ? t : 1), i = 1 === n.valpha ? n.color : n.color.concat(this.valpha);\n return In.to.rgb.percent(i);\n },\n array: function() {\n return 1 === this.valpha ? this.color.slice() : this.color.concat(this.valpha);\n },\n object: function() {\n for (var t = {}, n = Tn[this.model].channels, i = Tn[this.model].labels, e = 0; e < n; e++) t[i[e]] = this.color[e];\n return 1 !== this.valpha && (t.alpha = this.valpha), t;\n },\n unitArray: function() {\n var t = this.rgb().color;\n return t[0] /= 255, t[1] /= 255, t[2] /= 255, 1 !== this.valpha && t.push(this.valpha), \n t;\n },\n unitObject: function() {\n var t = this.rgb().object();\n return t.r /= 255, t.g /= 255, t.b /= 255, 1 !== this.valpha && (t.alpha = this.valpha), \n t;\n },\n round: function(t) {\n return t = Math.max(t || 0, 0), new En(this.color.map(function(t) {\n return function(n) {\n return function(t, n) {\n return Number(t.toFixed(n));\n }(n, t);\n };\n }(t)).concat(this.valpha), this.model);\n },\n alpha: function(t) {\n return arguments.length ? new En(this.color.concat(Math.max(0, Math.min(1, t))), this.model) : this.valpha;\n },\n red: Cn("rgb", 0, jn(255)),\n green: Cn("rgb", 1, jn(255)),\n blue: Cn("rgb", 2, jn(255)),\n hue: Cn([ "hsl", "hsv", "hsl", "hwb", "hcg" ], 0, (function(t) {\n return (t % 360 + 360) % 360;\n })),\n saturationl: Cn("hsl", 1, jn(100)),\n lightness: Cn("hsl", 2, jn(100)),\n saturationv: Cn("hsv", 1, jn(100)),\n value: Cn("hsv", 2, jn(100)),\n chroma: Cn("hcg", 1, jn(100)),\n gray: Cn("hcg", 2, jn(100)),\n white: Cn("hwb", 1, jn(100)),\n wblack: Cn("hwb", 2, jn(100)),\n cyan: Cn("cmyk", 0, jn(100)),\n magenta: Cn("cmyk", 1, jn(100)),\n yellow: Cn("cmyk", 2, jn(100)),\n black: Cn("cmyk", 3, jn(100)),\n x: Cn("xyz", 0, jn(100)),\n y: Cn("xyz", 1, jn(100)),\n z: Cn("xyz", 2, jn(100)),\n l: Cn("lab", 0, jn(100)),\n a: Cn("lab", 1),\n b: Cn("lab", 2),\n keyword: function(t) {\n return arguments.length ? new En(t) : Tn[this.model].keyword(this.color);\n },\n hex: function(t) {\n return arguments.length ? new En(t) : In.to.hex(this.rgb().round().color);\n },\n rgbNumber: function() {\n var t = this.rgb().color;\n return (255 & t[0]) << 16 | (255 & t[1]) << 8 | 255 & t[2];\n },\n luminosity: function() {\n for (var t = this.rgb().color, n = [], i = 0; i < t.length; i++) {\n var e = t[i] / 255;\n n[i] = e <= .03928 ? e / 12.92 : Math.pow((e + .055) / 1.055, 2.4);\n }\n return .2126 * n[0] + .7152 * n[1] + .0722 * n[2];\n },\n contrast: function(t) {\n var n = this.luminosity(), i = t.luminosity();\n return n > i ? (n + .05) / (i + .05) : (i + .05) / (n + .05);\n },\n level: function(t) {\n var n = this.contrast(t);\n return n >= 7.1 ? "AAA" : n >= 4.5 ? "AA" : "";\n },\n isDark: function() {\n var t = this.rgb().color;\n return (299 * t[0] + 587 * t[1] + 114 * t[2]) / 1e3 < 128;\n },\n isLight: function() {\n return !this.isDark();\n },\n negate: function() {\n for (var t = this.rgb(), n = 0; n < 3; n++) t.color[n] = 255 - t.color[n];\n return t;\n },\n lighten: function(t) {\n var n = this.hsl();\n return n.color[2] += n.color[2] * t, n;\n },\n darken: function(t) {\n var n = this.hsl();\n return n.color[2] -= n.color[2] * t, n;\n },\n saturate: function(t) {\n var n = this.hsl();\n return n.color[1] += n.color[1] * t, n;\n },\n desaturate: function(t) {\n var n = this.hsl();\n return n.color[1] -= n.color[1] * t, n;\n },\n whiten: function(t) {\n var n = this.hwb();\n return n.color[1] += n.color[1] * t, n;\n },\n blacken: function(t) {\n var n = this.hwb();\n return n.color[2] += n.color[2] * t, n;\n },\n grayscale: function() {\n var t = this.rgb().color, n = .3 * t[0] + .59 * t[1] + .11 * t[2];\n return En.rgb(n, n, n);\n },\n fade: function(t) {\n return this.alpha(this.valpha - this.valpha * t);\n },\n opaquer: function(t) {\n return this.alpha(this.valpha + this.valpha * t);\n },\n rotate: function(t) {\n var n = this.hsl(), i = n.color[0];\n return i = (i = (i + t) % 360) < 0 ? 360 + i : i, n.color[0] = i, n;\n },\n mix: function(t, n) {\n if (!t || !t.rgb) throw new Error(\'Argument to "mix" was not a Color instance, but rather an instance of \' + typeof t);\n var i = t.rgb(), e = this.rgb(), r = void 0 === n ? .5 : n, s = 2 * r - 1, o = i.alpha() - e.alpha(), a = ((s * o == -1 ? s : (s + o) / (1 + s * o)) + 1) / 2, h = 1 - a;\n return En.rgb(a * i.red() + h * e.red(), a * i.green() + h * e.green(), a * i.blue() + h * e.blue(), i.alpha() * r + e.alpha() * (1 - r));\n }\n }, Object.keys(Tn).forEach((function(t) {\n if (-1 === Un.indexOf(t)) {\n var n = Tn[t].channels;\n En.prototype[t] = function() {\n if (this.model === t) return new En(this);\n if (arguments.length) return new En(arguments, t);\n var i = "number" == typeof arguments[n] ? n : this.valpha;\n return new En(Nn(Tn[this.model][t].raw(this.color)).concat(i), t);\n }, En[t] = function(i) {\n return "number" == typeof i && (i = Hn(Ln.call(arguments), n)), new En(i, t);\n };\n }\n }));\n var Vn = En;\n class Rn {\n constructor(t, n) {\n this.position = t, this.index = n, this.faces = [], this.neighbors = [];\n }\n addUniqueNeighbor(t) {\n -1 === this.neighbors.indexOf(t) && this.neighbors.push(t);\n }\n }\n class $n {\n constructor(t, n, i, e) {\n this.a = e.a, this.b = e.b, this.c = e.c, this.v1 = t, this.v2 = n, this.v3 = i, \n this.normal = [], this.computeNormal(), t.faces.push(this), t.addUniqueNeighbor(n), \n t.addUniqueNeighbor(i), n.faces.push(this), n.addUniqueNeighbor(t), n.addUniqueNeighbor(i), \n i.faces.push(this), i.addUniqueNeighbor(t), i.addUniqueNeighbor(n);\n }\n computeNormal() {\n const t = this.v1.position, n = this.v2.position, i = this.v3.position, e = Pt([], St([], i, n), St([], t, n));\n At(this.normal, e);\n }\n hasVertex(t) {\n return t === this.v1 || t === this.v2 || t === this.v3;\n }\n }\n /*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */ const Wn = [], qn = [], Bn = [], Gn = [];\n function Jn(t, n, i) {\n const e = Pt(qn, n, i);\n t = Tt(t, function(t, n, i, e, r, s, o, a, h, u) {\n return t[0] = n, t[1] = i, t[2] = e, t[3] = r, t[4] = s, t[5] = o, t[6] = a, t[7] = h, \n t[8] = u, t;\n }(Wn, i[0], i[1], i[2], ...e, ...n));\n if ((t = function(t) {\n return t[3] < 0 ? Ut(t, t, -1) : t;\n }(t = zt(t, t)))[3] < 1 / 32767) {\n t[3] = 1 / 32767;\n const n = Math.sqrt(.9999999990686206);\n t[0] *= n, t[1] *= n, t[2] *= n;\n }\n const r = i[3] > 0 ? Pt(Bn, i, n) : Pt(Bn, n, i);\n return kt(Pt(Gn, i, n), r) < 0 && Ut(t, t, -1), t;\n }\n function Xn(t, n) {\n const i = [], e = [];\n let r = 0;\n for (r = 0; r < t.length; r += 3) {\n const n = new Rn([ t[r], t[r + 1], t[r + 2] ], r / 3);\n i.push(n);\n }\n if (!n.length) {\n const t = n;\n n = [];\n for (let i = 0; i < t; i++) n.push(i);\n }\n for (r = 0; r < n.length / 3; r++) {\n const t = {\n a: n[3 * r],\n b: n[3 * r + 1],\n c: n[3 * r + 2]\n };\n new $n(i[t.a], i[t.b], i[t.c], t);\n }\n const s = [], o = [ 0, 0, 0 ];\n for (r = 0; r < i.length; r++) {\n const t = i[r], n = t.index;\n bt(o, 0, 0, 0);\n let a = t.faces.length;\n for (let n = 0; n < a; n++) xt(o, o, t.faces[n].normal);\n a = a || 1, bt(s, a, a, a), Ft(o, o, s), e[3 * n] = o[0], e[3 * n + 1] = o[1], e[3 * n + 2] = o[2];\n }\n return e;\n }\n /*!\n * Contains code from THREE.JS\n * https://github.com/mrdoob/three.js/\n * License MIT\n * \n * Generate tangents per vertex.\n */ function Zn(t, n, i) {\n return t[0] = n[i], t[1] = n[i + 1], t[2] = n[i + 2], t;\n }\n function Yn(t, n, i) {\n return t[0] = n[i], t[1] = n[i + 1], t;\n }\n var Kn = {\n exports: {}\n };\n function Qn(t, n, i) {\n i = i || 2;\n var e, r, s, o, a, h, u, l = n && n.length, c = l ? n[0] * i : t.length, f = ti(t, 0, c, i, !0), d = [];\n if (!f || f.next === f.prev) return d;\n if (l && (f = function(t, n, i, e) {\n var r, s, o, a, h, u = [];\n for (r = 0, s = n.length; r < s; r++) o = n[r] * e, a = r < s - 1 ? n[r + 1] * e : t.length, \n (h = ti(t, o, a, e, !1)) === h.next && (h.steiner = !0), u.push(ci(h));\n for (u.sort(ai), r = 0; r < u.length; r++) i = ni(i = hi(u[r], i), i.next);\n return i;\n }(t, n, f, i)), t.length > 80 * i) {\n e = s = t[0], r = o = t[1];\n for (var y = i; y < c; y += i) (a = t[y]) < e && (e = a), (h = t[y + 1]) < r && (r = h), \n a > s && (s = a), h > o && (o = h);\n u = 0 !== (u = Math.max(s - e, o - r)) ? 1 / u : 0;\n }\n return ii(f, d, i, e, r, u), d;\n }\n function ti(t, n, i, e, r) {\n var s, o;\n if (r === Ai(t, n, i, e) > 0) for (s = n; s < i; s += e) o = bi(s, t[s], t[s + 1], o); else for (s = i - e; s >= n; s -= e) o = bi(s, t[s], t[s + 1], o);\n return o && vi(o, o.next) && (xi(o), o = o.next), o;\n }\n function ni(t, n) {\n if (!t) return t;\n n || (n = t);\n var i, e = t;\n do {\n if (i = !1, e.steiner || !vi(e, e.next) && 0 !== yi(e.prev, e, e.next)) e = e.next; else {\n if (xi(e), (e = n = e.prev) === e.next) break;\n i = !0;\n }\n } while (i || e !== n);\n return n;\n }\n function ii(t, n, i, e, r, s, o) {\n if (t) {\n !o && s && function(t, n, i, e) {\n var r = t;\n do {\n null === r.z && (r.z = li(r.x, r.y, n, i, e)), r.prevZ = r.prev, r.nextZ = r.next, \n r = r.next;\n } while (r !== t);\n r.prevZ.nextZ = null, r.prevZ = null, function(t) {\n var n, i, e, r, s, o, a, h, u = 1;\n do {\n for (i = t, t = null, s = null, o = 0; i; ) {\n for (o++, e = i, a = 0, n = 0; n < u && (a++, e = e.nextZ); n++) ;\n for (h = u; a > 0 || h > 0 && e; ) 0 !== a && (0 === h || !e || i.z <= e.z) ? (r = i, \n i = i.nextZ, a--) : (r = e, e = e.nextZ, h--), s ? s.nextZ = r : t = r, r.prevZ = s, \n s = r;\n i = e;\n }\n s.nextZ = null, u *= 2;\n } while (o > 1);\n }(r);\n }(t, e, r, s);\n for (var a, h, u = t; t.prev !== t.next; ) if (a = t.prev, h = t.next, s ? ri(t, e, r, s) : ei(t)) n.push(a.i / i), \n n.push(t.i / i), n.push(h.i / i), xi(t), t = h.next, u = h.next; else if ((t = h) === u) {\n o ? 1 === o ? ii(t = si(ni(t), n, i), n, i, e, r, s, 2) : 2 === o && oi(t, n, i, e, r, s) : ii(ni(t), n, i, e, r, s, 1);\n break;\n }\n }\n }\n function ei(t) {\n var n = t.prev, i = t, e = t.next;\n if (yi(n, i, e) >= 0) return !1;\n for (var r = t.next.next; r !== t.prev; ) {\n if (fi(n.x, n.y, i.x, i.y, e.x, e.y, r.x, r.y) && yi(r.prev, r, r.next) >= 0) return !1;\n r = r.next;\n }\n return !0;\n }\n function ri(t, n, i, e) {\n var r = t.prev, s = t, o = t.next;\n if (yi(r, s, o) >= 0) return !1;\n for (var a = r.x < s.x ? r.x < o.x ? r.x : o.x : s.x < o.x ? s.x : o.x, h = r.y < s.y ? r.y < o.y ? r.y : o.y : s.y < o.y ? s.y : o.y, u = r.x > s.x ? r.x > o.x ? r.x : o.x : s.x > o.x ? s.x : o.x, l = r.y > s.y ? r.y > o.y ? r.y : o.y : s.y > o.y ? s.y : o.y, c = li(a, h, n, i, e), f = li(u, l, n, i, e), d = t.prevZ, y = t.nextZ; d && d.z >= c && y && y.z <= f; ) {\n if (d !== t.prev && d !== t.next && fi(r.x, r.y, s.x, s.y, o.x, o.y, d.x, d.y) && yi(d.prev, d, d.next) >= 0) return !1;\n if (d = d.prevZ, y !== t.prev && y !== t.next && fi(r.x, r.y, s.x, s.y, o.x, o.y, y.x, y.y) && yi(y.prev, y, y.next) >= 0) return !1;\n y = y.nextZ;\n }\n for (;d && d.z >= c; ) {\n if (d !== t.prev && d !== t.next && fi(r.x, r.y, s.x, s.y, o.x, o.y, d.x, d.y) && yi(d.prev, d, d.next) >= 0) return !1;\n d = d.prevZ;\n }\n for (;y && y.z <= f; ) {\n if (y !== t.prev && y !== t.next && fi(r.x, r.y, s.x, s.y, o.x, o.y, y.x, y.y) && yi(y.prev, y, y.next) >= 0) return !1;\n y = y.nextZ;\n }\n return !0;\n }\n function si(t, n, i) {\n var e = t;\n do {\n var r = e.prev, s = e.next.next;\n !vi(r, s) && pi(r, e, e.next, s) && wi(r, s) && wi(s, r) && (n.push(r.i / i), n.push(e.i / i), \n n.push(s.i / i), xi(e), xi(e.next), e = t = s), e = e.next;\n } while (e !== t);\n return ni(e);\n }\n function oi(t, n, i, e, r, s) {\n var o = t;\n do {\n for (var a = o.next.next; a !== o.prev; ) {\n if (o.i !== a.i && di(o, a)) {\n var h = Mi(o, a);\n return o = ni(o, o.next), h = ni(h, h.next), ii(o, n, i, e, r, s), void ii(h, n, i, e, r, s);\n }\n a = a.next;\n }\n o = o.next;\n } while (o !== t);\n }\n function ai(t, n) {\n return t.x - n.x;\n }\n function hi(t, n) {\n var i = function(t, n) {\n var i, e = n, r = t.x, s = t.y, o = -1 / 0;\n do {\n if (s <= e.y && s >= e.next.y && e.next.y !== e.y) {\n var a = e.x + (s - e.y) * (e.next.x - e.x) / (e.next.y - e.y);\n if (a <= r && a > o) {\n if (o = a, a === r) {\n if (s === e.y) return e;\n if (s === e.next.y) return e.next;\n }\n i = e.x < e.next.x ? e : e.next;\n }\n }\n e = e.next;\n } while (e !== n);\n if (!i) return null;\n if (r === o) return i;\n var h, u = i, l = i.x, c = i.y, f = 1 / 0;\n e = i;\n do {\n r >= e.x && e.x >= l && r !== e.x && fi(s < c ? r : o, s, l, c, s < c ? o : r, s, e.x, e.y) && (h = Math.abs(s - e.y) / (r - e.x), \n wi(e, t) && (h < f || h === f && (e.x > i.x || e.x === i.x && ui(i, e))) && (i = e, \n f = h)), e = e.next;\n } while (e !== u);\n return i;\n }(t, n);\n if (!i) return n;\n var e = Mi(i, t), r = ni(i, i.next);\n return ni(e, e.next), n === i ? r : n;\n }\n function ui(t, n) {\n return yi(t.prev, t, n.prev) < 0 && yi(n.next, t, t.next) < 0;\n }\n function li(t, n, i, e, r) {\n return (t = 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = 32767 * (t - i) * r) | t << 8)) | t << 4)) | t << 2)) | t << 1)) | (n = 1431655765 & ((n = 858993459 & ((n = 252645135 & ((n = 16711935 & ((n = 32767 * (n - e) * r) | n << 8)) | n << 4)) | n << 2)) | n << 1)) << 1;\n }\n function ci(t) {\n var n = t, i = t;\n do {\n (n.x < i.x || n.x === i.x && n.y < i.y) && (i = n), n = n.next;\n } while (n !== t);\n return i;\n }\n function fi(t, n, i, e, r, s, o, a) {\n return (r - o) * (n - a) - (t - o) * (s - a) >= 0 && (t - o) * (e - a) - (i - o) * (n - a) >= 0 && (i - o) * (s - a) - (r - o) * (e - a) >= 0;\n }\n function di(t, n) {\n return t.next.i !== n.i && t.prev.i !== n.i && !function(t, n) {\n var i = t;\n do {\n if (i.i !== t.i && i.next.i !== t.i && i.i !== n.i && i.next.i !== n.i && pi(i, i.next, t, n)) return !0;\n i = i.next;\n } while (i !== t);\n return !1;\n }(t, n) && (wi(t, n) && wi(n, t) && function(t, n) {\n var i = t, e = !1, r = (t.x + n.x) / 2, s = (t.y + n.y) / 2;\n do {\n i.y > s != i.next.y > s && i.next.y !== i.y && r < (i.next.x - i.x) * (s - i.y) / (i.next.y - i.y) + i.x && (e = !e), \n i = i.next;\n } while (i !== t);\n return e;\n }(t, n) && (yi(t.prev, t, n.prev) || yi(t, n.prev, n)) || vi(t, n) && yi(t.prev, t, t.next) > 0 && yi(n.prev, n, n.next) > 0);\n }\n function yi(t, n, i) {\n return (n.y - t.y) * (i.x - n.x) - (n.x - t.x) * (i.y - n.y);\n }\n function vi(t, n) {\n return t.x === n.x && t.y === n.y;\n }\n function pi(t, n, i, e) {\n var r = gi(yi(t, n, i)), s = gi(yi(t, n, e)), o = gi(yi(i, e, t)), a = gi(yi(i, e, n));\n return r !== s && o !== a || (!(0 !== r || !mi(t, i, n)) || (!(0 !== s || !mi(t, e, n)) || (!(0 !== o || !mi(i, t, e)) || !(0 !== a || !mi(i, n, e)))));\n }\n function mi(t, n, i) {\n return n.x <= Math.max(t.x, i.x) && n.x >= Math.min(t.x, i.x) && n.y <= Math.max(t.y, i.y) && n.y >= Math.min(t.y, i.y);\n }\n function gi(t) {\n return t > 0 ? 1 : t < 0 ? -1 : 0;\n }\n function wi(t, n) {\n return yi(t.prev, t, t.next) < 0 ? yi(t, n, t.next) >= 0 && yi(t, t.prev, n) >= 0 : yi(t, n, t.prev) < 0 || yi(t, t.next, n) < 0;\n }\n function Mi(t, n) {\n var i = new Fi(t.i, t.x, t.y), e = new Fi(n.i, n.x, n.y), r = t.next, s = n.prev;\n return t.next = n, n.prev = t, i.next = r, r.prev = i, e.next = i, i.prev = e, s.next = e, \n e.prev = s, e;\n }\n function bi(t, n, i, e) {\n var r = new Fi(t, n, i);\n return e ? (r.next = e.next, r.prev = e, e.next.prev = r, e.next = r) : (r.prev = r, \n r.next = r), r;\n }\n function xi(t) {\n t.next.prev = t.prev, t.prev.next = t.next, t.prevZ && (t.prevZ.nextZ = t.nextZ), \n t.nextZ && (t.nextZ.prevZ = t.prevZ);\n }\n function Fi(t, n, i) {\n this.i = t, this.x = n, this.y = i, this.prev = null, this.next = null, this.z = null, \n this.prevZ = null, this.nextZ = null, this.steiner = !1;\n }\n function Ai(t, n, i, e) {\n for (var r = 0, s = n, o = i - e; s < i; s += e) r += (t[o] - t[s]) * (t[s + 1] + t[o + 1]), \n o = s;\n return r;\n }\n Kn.exports = Qn, Kn.exports.default = Qn, Qn.deviation = function(t, n, i, e) {\n var r = n && n.length, s = r ? n[0] * i : t.length, o = Math.abs(Ai(t, 0, s, i));\n if (r) for (var a = 0, h = n.length; a < h; a++) {\n var u = n[a] * i, l = a < h - 1 ? n[a + 1] * i : t.length;\n o -= Math.abs(Ai(t, u, l, i));\n }\n var c = 0;\n for (a = 0; a < e.length; a += 3) {\n var f = e[a] * i, d = e[a + 1] * i, y = e[a + 2] * i;\n c += Math.abs((t[f] - t[y]) * (t[d + 1] - t[f + 1]) - (t[f] - t[d]) * (t[y + 1] - t[f + 1]));\n }\n return 0 === o && 0 === c ? 0 : Math.abs((c - o) / o);\n }, Qn.flatten = function(t) {\n for (var n = t[0][0].length, i = {\n vertices: [],\n holes: [],\n dimensions: n\n }, e = 0, r = 0; r < t.length; r++) {\n for (var s = 0; s < t[r].length; s++) for (var o = 0; o < n; o++) i.vertices.push(t[r][s][o]);\n r > 0 && (e += t[r - 1].length, i.holes.push(e));\n }\n return i;\n };\n var ki = Kn.exports;\n /*!\n * @maptalks/vector-packer v0.63.1\n * LICENSE : UNLICENSED\n * (c) 2016-2022 maptalks.com\n */ const Pi = {\n Point: 1,\n LineString: 2,\n Polygon: 3,\n MultiPoint: 4,\n MultiLineString: 5,\n MultiPolygon: 6\n };\n function Si(t, n = {}) {\n var i = [];\n if ("FeatureCollection" === t.type) for (var e = 0; e < t.features.length; e++) _i(i, t.features[e], n, e); else _i(i, "Feature" === t.type ? t : {\n geometry: t\n }, n);\n return i;\n }\n function _i(t, n, i, e) {\n if (n.geometry && n.geometry.geometry) {\n var r = n.geometry.coordinates, s = n.geometry.type, o = [], a = n.id;\n if (i.promoteId ? a = n.properties[i.promoteId] : i.generateId && (a = e || 0), \n "Point" === s) Oi(r, o); else if ("MultiPoint" === s) for (var h = 0; h < r.length; h++) Oi(r[h], o); else if ("LineString" === s) Ti([ r ], o); else if ("MultiLineString" === s) {\n if (i.lineMetrics) {\n for (h = 0; h < r.length; h++) Ii(r[h], o = []), t.push(Li(a, "LineString", o, n.properties));\n return;\n }\n Ti(r, o);\n } else if ("Polygon" === s) Ti(r, o); else {\n if ("MultiPolygon" !== s) {\n if ("GeometryCollection" === s) {\n for (h = 0; h < n.geometry.geometries.length; h++) _i(t, {\n id: a,\n geometry: n.geometry.geometries[h],\n properties: n.properties\n }, i, e);\n return;\n }\n return void console.warn(`Input data type(${s}) is not a valid GeoJSON geometry type.`);\n }\n for (h = 0; h < r.length; h++) {\n var u = [];\n Ti(r[h], u), o.push(u);\n }\n }\n t.push(Li(a, s, o, n.properties));\n }\n }\n function Oi(t, n) {\n n.push([ new Ht(t[0], t[1]) ]);\n }\n function Ii(t, n) {\n for (var i = 0; i < t.length; i++) n.push(new Ht(t[i][0], t[i][1]));\n }\n function Ti(t, n, i, e) {\n for (var r = 0; r < t.length; r++) {\n var s = [];\n Ii(t[r], s), n.push(s);\n }\n }\n function Li(t, n, i, e) {\n return {\n id: void 0 === t ? null : t,\n type: Pi[n],\n geometry: i,\n properties: e\n };\n }\n /*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */ function Ui(t, {width: n, height: i}, e, r) {\n if (r) {\n if (r.length !== n * i * e) throw new RangeError("mismatched image size");\n } else r = new Uint8Array(n * i * e);\n return t.width = n, t.height = i, t.data = r, t;\n }\n function zi(t, {width: n, height: i}, e) {\n if (n === t.width && i === t.height) return;\n const r = Ui({}, {\n width: n,\n height: i\n }, e);\n Di(t, r, {\n x: 0,\n y: 0\n }, {\n x: 0,\n y: 0\n }, {\n width: Math.min(t.width, n),\n height: Math.min(t.height, i)\n }, e), t.width = n, t.height = i, t.data = r.data;\n }\n function Di(t, n, i, e, r, s) {\n if (0 === r.width || 0 === r.height) return n;\n if (r.width > t.width || r.height > t.height || i.x > t.width - r.width || i.y > t.height - r.height) throw new RangeError("out of range source coordinates for image copy");\n if (r.width > n.width || r.height > n.height || e.x > n.width - r.width || e.y > n.height - r.height) throw new RangeError("out of range destination coordinates for image copy");\n const o = t.data, a = n.data;\n if (o === a) return n;\n for (let h = 0; h < r.height; h++) {\n const u = ((i.y + h) * t.width + i.x) * s, l = ((e.y + h) * n.width + e.x) * s;\n for (let t = 0; t < r.width * s; t++) a[l + t] = o[u + t];\n }\n return n;\n }\n class Ei {\n constructor(t, n) {\n Ui(this, t, 1, n);\n }\n resize(t) {\n zi(this, t, 1);\n }\n clone() {\n return new Ei({\n width: this.width,\n height: this.height\n }, new Uint8Array(this.data));\n }\n static copy(t, n, i, e, r) {\n Di(t, n, i, e, r, 1);\n }\n }\n class Ci {\n constructor(t, n) {\n Ui(this, t, 4, n);\n }\n resize(t) {\n zi(this, t, 4);\n }\n clone() {\n return new Ci({\n width: this.width,\n height: this.height\n }, new Uint8Array(this.data));\n }\n static copy(t, n, i, e, r) {\n Di(t, n, i, e, r, 4);\n }\n }\n /*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */ class ji {\n constructor(t, {pixelRatio: n}) {\n this.paddedRect = t, this.pixelRatio = n || 1;\n }\n get tl() {\n return [ this.paddedRect.x + 1, this.paddedRect.y + 1 ];\n }\n get br() {\n return [ this.paddedRect.x + this.paddedRect.w - 1, this.paddedRect.y + this.paddedRect.h - 1 ];\n }\n get displaySize() {\n return [ (this.paddedRect.w - 2) / this.pixelRatio, (this.paddedRect.h - 2) / this.pixelRatio ];\n }\n }\n class Ni {\n constructor(t) {\n this.glyphMap = t, this.build();\n }\n build() {\n const t = this.glyphMap, n = {}, i = new Rt(0, 0, {\n autoResize: !0\n }), e = [];\n for (const i in t) {\n const r = t[i], s = {\n x: 0,\n y: 0,\n w: r.data.width + 2,\n h: r.data.height + 2\n };\n e.push(s), n[i] = new ji(s, r);\n }\n if (i.pack(e, {\n inPlace: !0\n }), !Hi(i.w) || !Hi(i.h)) {\n const t = Vi(i.w), n = Vi(i.h);\n i.resize(t, n);\n }\n const r = new Ci({\n width: i.w,\n height: i.h\n });\n for (const i in t) {\n const e = t[i], s = n[i].paddedRect;\n Ci.copy(e.data, r, {\n x: 0,\n y: 0\n }, {\n x: s.x + 1,\n y: s.y + 1\n }, e.data);\n }\n this.image = r, this.positions = n;\n }\n }\n function Hi(t) {\n return 0 == (t & t - 1) && 0 !== t;\n }\n function Vi(t) {\n return Math.pow(2, Math.ceil(Math.log(t) / Math.LN2));\n }\n /*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n * TODO 升级为potpack\n */ class Ri {\n constructor(t) {\n this.glyphMap = t, this.build();\n }\n build() {\n const t = this.glyphMap, n = {}, i = new Rt(0, 0, {\n autoResize: !0\n }), e = [];\n for (const i in t) {\n const r = t[i], s = n[i] = {};\n for (const t in r) {\n const n = r[+t];\n if (!n || 0 === n.bitmap.width || 0 === n.bitmap.height) continue;\n const i = {\n x: 0,\n y: 0,\n w: n.bitmap.width + 2,\n h: n.bitmap.height + 2\n };\n e.push(i), s[t] = {\n rect: i,\n metrics: n.metrics\n };\n }\n }\n i.pack(e, {\n inPlace: !0\n });\n const r = new Ei({\n width: i.w,\n height: i.h\n });\n for (const i in t) {\n const e = t[i];\n for (const t in e) {\n const s = e[+t];\n if (!s || 0 === s.bitmap.width || 0 === s.bitmap.height) continue;\n const o = n[i][t].rect;\n Ei.copy(s.bitmap, r, {\n x: 0,\n y: 0\n }, {\n x: o.x + 1,\n y: o.y + 1\n }, s.bitmap);\n }\n }\n this.image = r, this.positions = n;\n }\n }\n function $i(t) {\n return t < 65536 ? Uint16Array : Uint32Array;\n }\n function Wi(t) {\n return (t = Math.abs(t)) < 128 ? Int8Array : t < 32768 ? Int16Array : Float32Array;\n }\n function qi(t) {\n return t < 256 ? Uint8Array : t < 65536 ? Uint16Array : Float32Array;\n }\n function Bi(t) {\n const n = t.type, i = [];\n if (1 === n || 4 === n) for (let n = 0; n < t.geometry.length; n++) Oi(t.geometry[n], i); else if (2 === n) Ti(t.geometry, i); else if (3 === n) Ti(t.geometry, i); else if (5 === n) Ti(t.geometry, i); else if (6 === n) for (let n = 0; n < t.geometry.length; n++) {\n const e = [];\n Ti(t.geometry[n], e), i.push(e);\n }\n return t.geometry = i, t;\n }\n function Gi(t) {\n for (let n = 1; n < arguments.length; n++) {\n const i = arguments[n];\n for (const n in i) t[n] = i[n];\n }\n return t;\n }\n function Ji(t) {\n return null == t;\n }\n function Xi(t) {\n return "number" == typeof t && !isNaN(t);\n }\n function Zi(t) {\n return "object" == typeof t && !!t;\n }\n function Yi(t) {\n return !Ji(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);\n }\n const Ki = Object.prototype.hasOwnProperty;\n function Qi(t, n) {\n return Ki.call(t, n);\n }\n function te(t) {\n return m(t) && t.property;\n }\n function ne(t) {\n let n = 0;\n for (let i, e, r = 0, s = t.length, o = s - 1; r < s; o = r++) i = t[r], e = t[o], \n n += void 0 !== i.x ? (e.x - i.x) * (i.y + e.y) : (e[0] - i[0]) * (i[1] + e[1]);\n return n;\n }\n function ie(t, n, i, e, r) {\n const s = t[n * e], o = t[n * e + 1], a = t[i * e], h = t[i * e + 1];\n return s === a && (s < 0 || s > r) && o !== h || o === h && (o < 0 || o > r) && s !== a;\n }\n function ee(t, n, i) {\n let e = i;\n return n && t && (e = t[n]), void 0 === e && (e = i), 10 * (e || 0);\n }\n function re(t, n, i, e, r, s, o) {\n const a = ee(t.properties, i, e), h = a * n;\n let u = a;\n return r ? u = ee(t.properties, r, s) : o && (u = a - ee(t.properties, o, 0)), u *= n, \n {\n altitude: h,\n height: u\n };\n }\n function se(t, n) {\n return n < 1 / 0 && (t.x < 0 || t.x > n || t.y < 0 || t.y > n);\n }\n function oe(t) {\n return null == t;\n }\n function ae(t, n, i) {\n if (t === i || t === n) return t;\n const e = i - n;\n return ((t - n) % e + e) % e + n;\n }\n class he {\n constructor(t, n, i, e) {\n this.feature = t, this.symbol = n, this.fnTypes = i, this.options = e;\n }\n getPolygonResource() {\n let t = this.symbol.polygonPatternFile;\n const {polygonPatternFileFn: n} = this.fnTypes;\n return this.U(t, n);\n }\n getLineResource() {\n let t = this.symbol.linePatternFile;\n const {linePatternFileFn: n} = this.fnTypes;\n return this.U(t, n);\n }\n U(t, n) {\n return n && (t = n(this.options.zoom, this.feature.properties)), t;\n }\n }\n const ue = {\n lineWidth: 1,\n lineStrokeWidth: 1,\n lineDx: 1,\n lineDy: 1,\n lineOpacity: 1,\n linePatternAnimSpeed: 1,\n markerWidth: 1,\n markerHeight: 1,\n markerDx: 1,\n markerDy: 1,\n markerSpacing: 1,\n markerOpacity: 1,\n markerRotation: 1,\n textWrapWidth: 1,\n textSpacing: 1,\n textSize: 1,\n textHaloRadius: 1,\n textHaloOpacity: 1,\n textDx: 1,\n textDy: 1,\n textOpacity: 1,\n textRotation: 1,\n polygonOpacity: 1\n };\n class le {\n static isAtlasLoaded(t, n = {}) {\n const {iconAtlas: i} = n;\n return !!(!t || i && i.positions[t]);\n }\n static genFnTypes(t) {\n const n = {};\n for (const i in t) if (te(t[i])) {\n const e = (i + "_Fn_0").trim(), r = (i + "Fn").trim();\n ue[i] ? (n[e] = g(t[i]), n[r] = (t, i) => {\n const r = n[e](t, i);\n return te(r) ? g(r)(t, i) : r;\n }) : (n[e] = w(t[i]), n[r] = (t, i) => {\n const r = n[e](t, i);\n return te(r) ? w(r)(t, i) : r;\n });\n }\n return n;\n }\n constructor(t, n, i) {\n this.options = i, this.features = this.D(t), this.symbolDef = n, this.symbol = M(n, () => [ i.zoom ]), \n this.styledVectors = [], this.properties = {}, this.C = le.genFnTypes(this.symbolDef), \n te(this.symbolDef.visible) && (this.j = g(this.symbolDef.visible)), i.atlas && (this.iconAtlas = i.atlas.iconAtlas, \n this.glyphAtlas = i.atlas.glyphAtlas);\n }\n D(t) {\n if (!t.length) return t;\n const n = "__fea_idx".trim();\n let e, r = 0, s = t[r];\n for (;!s.geometry; ) r++, s = t[r];\n if (Array.isArray(s.geometry) && s.properties) {\n let n = s.geometry[0];\n for (;Array.isArray(n); ) n = n[0];\n n instanceof Ht && (e = t);\n }\n if (!e) if (e = [], Array.isArray(s.geometry)) for (let n = 0; n < t.length; n++) {\n const i = Gi({}, t[n]);\n e.push(Bi(i));\n } else for (let i = 0; i < t.length; i++) {\n const r = t[i], s = Si(r);\n for (let t = 0; t < s.length; t++) {\n const i = s[t];\n i[n] = r[n], e.push(i);\n }\n }\n const o = this.options.order;\n if (o) {\n const t = [];\n for (let n = 0; n < o.length; n++) o[n] && t.push(i(o[n]));\n e = e.sort((n, i) => {\n const e = t.length;\n let r = e, s = e;\n for (let o = 0; o < e && (t[o](n) && (r = o), t[o](i) && (s = o), !(r < e && s < e)); o++) ;\n return r - s;\n });\n }\n return e;\n }\n load(t = 1) {\n const n = "__fea_idx".trim(), i = "_debug_info".trim(), e = this.C, r = this.styledVectors;\n this.count = 0;\n const s = this.features;\n if (!s || !s.length) return Promise.resolve(null);\n const o = {}, a = {}, h = {\n zoom: this.options.zoom\n }, u = M(this.symbolDef, () => [ h.zoom ]);\n let l = 0, c = s.length;\n const f = this.options.debugIndex;\n try {\n for (;l < c; l++) {\n const t = s[l];\n if (!t || !t.geometry) continue;\n if (void 0 !== f && t[i].index !== f) continue;\n t.properties || (t.properties = {}), t.properties.$layer = t.layer, t.properties.$type = t.type;\n const c = this.createStyledVector(t, u, e, h, o, a);\n c && c.feature.geometry && (c.featureIdx = void 0 === t[n] ? l : t[n], this.count++, \n r.push(c));\n }\n } catch (t) {\n return Promise.reject(t);\n }\n return this.options.atlas ? Promise.resolve(this.pack(t)) : this.loadAtlas(o, a).then(() => this.pack(t));\n }\n loadAtlas(t, n) {\n return new Promise((i, e) => {\n this.fetchAtlas(t, n, (t, n) => {\n if (t) e(t); else {\n if (n) {\n const {icons: t, glyphs: i} = n;\n if (t && Object.keys(t).length) {\n for (const n in t) {\n const i = t[n], {width: e, height: r, data: s} = i.data;\n i.data = new Ci({\n width: e,\n height: r\n }, s);\n }\n this.iconAtlas = new Ni(t);\n }\n if (i && Object.keys(i).length) {\n for (const t in i) {\n const n = i[t];\n for (const t in n) {\n const i = n[t], {width: e, height: r, data: s} = i.bitmap;\n i.bitmap = new Ei({\n width: e,\n height: r\n }, s);\n }\n }\n this.glyphAtlas = new Ri(i);\n }\n }\n i({\n glyphAtlas: this.glyphAtlas,\n iconAtlas: this.iconAtlas\n });\n }\n });\n });\n }\n fetchAtlas(t, n, i) {\n Object.keys(t).length > 0 || Object.keys(n).length > 0 ? this.options.requestor(t, n, i) : i();\n }\n pack(t) {\n if (!this.count) return null;\n if (null == t) throw new Error("layout scale is undefined");\n const n = this.createDataPack(this.styledVectors, t);\n if (!n) return null;\n n.properties = this.properties, this.empty && (n.empty = !0);\n const i = n.buffers;\n delete n.buffers;\n const e = {\n data: n,\n buffers: i\n };\n if (this.iconAtlas) {\n const t = e.data.iconAtlas = ce(this.iconAtlas);\n if (t.glyphMap) for (const n in t.glyphMap) i.push(t.glyphMap[n].data.data.buffer);\n i.push(e.data.iconAtlas.image.data.buffer);\n }\n return this.glyphAtlas && (e.data.glyphAtlas = ce(this.glyphAtlas), i.push(e.data.glyphAtlas.image.data.buffer)), \n e;\n }\n createStyledVector(t, n, i, e) {\n return new he(t, n, i, e);\n }\n createDataPack(t, n) {\n if (!t || !t.length) return null;\n this.maxIndex = 0, this.maxPos = 0, this.maxAltitude = 0;\n const i = this.data = {};\n let e = this.elements = [];\n const r = this.getFormat(Array.isArray(t[0]) ? t[0][0].symbol : t[0].symbol);\n for (let t = 0; t < r.length; t++) i[r[t].name] = [];\n let s = [], o = 0;\n const a = [];\n let h = 0, u = !1;\n for (let e = 0, r = t.length; e < r; e++) {\n if (!t[e].feature.geometry) continue;\n const r = Array.isArray(t[e]) ? t[e][0].feature.id : t[e].feature.id;\n Xi(r) && (Math.abs(r) > h && (h = Math.abs(r)), r < 0 && (u = !0));\n const l = this.data.aPosition.length;\n if (Array.isArray(t[e])) for (let i = 0; i < t[e].length; i++) this.N(t[e][i], n); else this.N(t[e], n);\n const c = (i.aPosition.length - l) / 3;\n for (let n = 0; n < c; n++) s.push(t[e].featureIdx), Xi(r) && a.push(r);\n o = Math.max(o, t[e].featureIdx);\n }\n if (this.hasElements() && !e.length) return null;\n s = new (qi(o))(s), r[0].type = this.options.positionType ? this.options.positionType : Wi(Math.max(this.maxPos, this.maxAltitude));\n const l = this.options.center;\n if (l && (l[0] || l[1])) {\n const t = i.aPosition;\n for (let n = 0; n < t.length; n += 3) t[n] -= l[0], t[n + 1] -= l[1];\n }\n const c = function(t, n) {\n const i = {};\n for (let e = 0; e < t.length; e++) {\n const r = t[e], s = r.type, o = r.name;\n i[o] = s === Array ? n[o] : new s(n[o]);\n }\n return i;\n }(r, i);\n c.aPickingId = s;\n const f = [];\n for (const t in c) f.push(c[t].buffer);\n e = new ($i(this.maxIndex))(e), f.push(e.buffer);\n const d = {\n data: c,\n indices: this.hasElements() ? e : null,\n positionSize: 3,\n //!this.maxAltitude ? 2 : 3,\n buffers: f,\n symbolIndex: this.symbolDef.index || {\n index: 0\n }\n };\n if (a.length) {\n const t = u ? Wi(h) : qi(h);\n d.featureIds = new t(a), f.push(d.featureIds.buffer);\n } else d.featureIds = [];\n return d;\n }\n N(t, n) {\n this.j && this.j.isZoomConstant && !this.j(null, t.feature.properties) || this.placeVector(t, n, this.formatWidth);\n }\n addElements(...t) {\n this.maxIndex = Math.max(this.maxIndex, ...t), this.elements.push(...t);\n }\n hasElements() {\n return !0;\n }\n getAltitude(t) {\n const {altitudeProperty: n, defaultAltitude: i, altitudeScale: e} = this.options;\n let r = ee(t, n, i);\n return e && (r *= e), this.maxAltitude = Math.max(this.maxAltitude, Math.abs(r)), \n r;\n }\n getIconAtlasMaxValue() {\n const t = this.iconAtlas.positions;\n let n = 0;\n for (const i in t) if (Qi(t, i)) {\n const {tl: e, displaySize: r} = t[i], s = Math.max(e[0], e[1], r[0] - 1, r[1] - 1);\n s > n && (n = s);\n }\n return n;\n }\n }\n function ce(t) {\n let n = t.positions, i = t.image && t.image.format || "alpha";\n if (t instanceof Ni) {\n n = {};\n for (const i in t.positions) {\n const e = t.positions[i];\n n[i] = {\n paddedRect: e.paddedRect,\n pixelRatio: e.pixelRatio,\n tl: e.tl,\n br: e.br,\n displaySize: e.displaySize\n };\n }\n i = "rgba";\n }\n const e = t.image;\n return {\n image: {\n width: e.width,\n height: e.height,\n data: e.data,\n format: i\n },\n glyphMap: t.glyphMap,\n positions: n\n };\n }\n function fe(t, n, i, e) {\n const r = "__fn_textSize".trim();\n let s = t.textSize;\n if (Ji(n.textSize)) return [ 16, 16 ];\n t[r] && (s = t[r]);\n const o = [];\n var a;\n return o[0] = Ji(a = s) || "function" != typeof a && (null === a.constructor || a.constructor !== Function) ? s : s(e, i), \n o[1] = o[0], o;\n }\n function de(t) {\n const n = t.stops;\n let i = -1 / 0;\n for (let t = 0; t < n.length; t++) {\n let e = n[t][1];\n Zi(n[t][1]) && (e = de(n[t][1])), e > i && (i = e);\n }\n return i;\n }\n const ye = /\\{([\\w_]+)\\}/g;\n function ve(t, n) {\n return Yi(t) ? t.replace(ye, (function(t, i) {\n if (!n) return "";\n const e = n[i];\n return Ji(e) ? "" : Array.isArray(e) ? e.join() : e;\n })) : t;\n }\n const pe = t => t >= 11904 && t <= 12031, me = t => t >= 12032 && t <= 12255, ge = t => t >= 12272 && t <= 12287, we = t => t >= 12288 && t <= 12351, Me = t => t >= 12352 && t <= 12447, be = t => t >= 12448 && t <= 12543, xe = t => t >= 12544 && t <= 12591, Fe = t => t >= 12704 && t <= 12735, Ae = t => t >= 12736 && t <= 12783, ke = t => t >= 12784 && t <= 12799, Pe = t => t >= 12800 && t <= 13055, Se = t => t >= 13056 && t <= 13311, _e = t => t >= 13312 && t <= 19903, Oe = t => t >= 19968 && t <= 40959, Ie = t => t >= 40960 && t <= 42127, Te = t => t >= 42128 && t <= 42191, Le = t => t >= 63744 && t <= 64255, Ue = t => t >= 64336 && t <= 65023, ze = t => t >= 65040 && t <= 65055, De = t => t >= 65072 && t <= 65103, Ee = t => t >= 65104 && t <= 65135, Ce = t => t >= 65136 && t <= 65279, je = t => t >= 65280 && t <= 65519;\n function Ne(t) {\n return !((t => t >= 1536 && t <= 1791)(t) || (t => t >= 1872 && t <= 1919)(t) || (t => t >= 2208 && t <= 2303)(t) || Ue(t) || Ce(t));\n }\n function He(t) {\n return !!(746 === t || 747 === t || !(t < 4352) && (Fe(t) || xe(t) || De(t) && !(t >= 65097 && t <= 65103) || Le(t) || Se(t) || pe(t) || Ae(t) || !(!we(t) || t >= 12296 && t <= 12305 || t >= 12308 && t <= 12319 || 12336 === t) || _e(t) || Oe(t) || Pe(t) || (t => t >= 12592 && t <= 12687)(t) || (t => t >= 43360 && t <= 43391)(t) || (t => t >= 55216 && t <= 55295)(t) || (t => t >= 4352 && t <= 4607)(t) || (t => t >= 44032 && t <= 55215)(t) || Me(t) || ge(t) || (t => t >= 12688 && t <= 12703)(t) || me(t) || ke(t) || be(t) && 12540 !== t || !(!je(t) || 65288 === t || 65289 === t || 65293 === t || t >= 65306 && t <= 65310 || 65339 === t || 65341 === t || 65343 === t || t >= 65371 && t <= 65503 || 65507 === t || t >= 65512 && t <= 65519) || !(!Ee(t) || t >= 65112 && t <= 65118 || t >= 65123 && t <= 65126) || (t => t >= 5120 && t <= 5759)(t) || (t => t >= 6320 && t <= 6399)(t) || ze(t) || (t => t >= 19904 && t <= 19967)(t) || Ie(t) || Te(t)));\n }\n function Ve(t) {\n return !(He(t) || function(t) {\n return !!((t => t >= 128 && t <= 255)(t) && (167 === t || 169 === t || 174 === t || 177 === t || 188 === t || 189 === t || 190 === t || 215 === t || 247 === t) || (t => t >= 8192 && t <= 8303)(t) && (8214 === t || 8224 === t || 8225 === t || 8240 === t || 8241 === t || 8251 === t || 8252 === t || 8258 === t || 8263 === t || 8264 === t || 8265 === t || 8273 === t) || (t => t >= 8448 && t <= 8527)(t) || (t => t >= 8528 && t <= 8591)(t) || (t => t >= 8960 && t <= 9215)(t) && (t >= 8960 && t <= 8967 || t >= 8972 && t <= 8991 || t >= 8996 && t <= 9e3 || 9003 === t || t >= 9085 && t <= 9114 || t >= 9150 && t <= 9165 || 9167 === t || t >= 9169 && t <= 9179 || t >= 9186 && t <= 9215) || (t => t >= 9216 && t <= 9279)(t) && 9251 !== t || (t => t >= 9280 && t <= 9311)(t) || (t => t >= 9312 && t <= 9471)(t) || (t => t >= 9632 && t <= 9727)(t) || (t => t >= 9728 && t <= 9983)(t) && !(t >= 9754 && t <= 9759) || (t => t >= 11008 && t <= 11263)(t) && (t >= 11026 && t <= 11055 || t >= 11088 && t <= 11097 || t >= 11192 && t <= 11243) || we(t) || be(t) || (t => t >= 57344 && t <= 63743)(t) || De(t) || Ee(t) || je(t) || 8734 === t || 8756 === t || 8757 === t || t >= 9984 && t <= 10087 || t >= 10102 && t <= 10131 || 65532 === t || 65533 === t);\n }(t));\n }\n function Re(t) {\n return t >= 1424 && t <= 2303 || Ue(t) || Ce(t);\n }\n const $e = [ [ 9, 9 ], [ 32, 32 ], [ 5760, 5760 ], [ 8192, 8198 ], [ 8200, 8202 ], [ 8287, 12288 ], [ 6158, 6158 ], [ 8203, 8205 ] ];\n function We(t) {\n for (const n of $e) if (t >= n[0] && t <= n[1]) return !0;\n return !1;\n }\n const qe = {\n "!": "︕",\n "#": "#",\n $: "$",\n "%": "%",\n "&": "&",\n "(": "︵",\n ")": "︶",\n "*": "*",\n "+": "+",\n ",": "︐",\n "-": "︲",\n ".": "・",\n "/": "/",\n ":": "︓",\n ";": "︔",\n "<": "︿",\n "=": "=",\n ">": "﹀",\n "?": "︖",\n "@": "@",\n "[": "﹇",\n "\\\\": "\",\n "]": "﹈",\n "^": "^",\n H: "︳",\n "`": "`",\n "{": "︷",\n "|": "―",\n "}": "︸",\n "~": "~",\n "¢": "¢",\n "£": "£",\n "¥": "¥",\n "¦": "¦",\n "¬": "¬",\n "¯": " ̄",\n "–": "︲",\n "—": "︱",\n "‘": "﹃",\n "’": "﹄",\n "“": "﹁",\n "”": "﹂",\n "…": "︙",\n "‧": "・",\n "₩": "₩",\n "、": "︑",\n "。": "︒",\n "〈": "︿",\n "〉": "﹀",\n "《": "︽",\n "》": "︾",\n "「": "﹁",\n "」": "﹂",\n "『": "﹃",\n "』": "﹄",\n "【": "︻",\n "】": "︼",\n "〔": "︹",\n "〕": "︺",\n "〖": "︗",\n "〗": "︘",\n "!": "︕",\n "(": "︵",\n ")": "︶",\n ",": "︐",\n "-": "︲",\n ".": "・",\n ":": "︓",\n ";": "︔",\n "<": "︿",\n ">": "﹀",\n "?": "︖",\n "[": "﹇",\n "]": "﹈",\n "_": "︳",\n "{": "︷",\n "|": "―",\n "}": "︸",\n "⦅": "︵",\n "⦆": "︶",\n "。": "︒",\n "「": "﹁",\n "」": "﹂"\n };\n function Be(t, n, i, e, r, s, o, a, h, u) {\n let l = t.trim();\n 2 === u && (l = function(t) {\n let n = "";\n for (let i = 0; i < t.length; i++) {\n const e = t.charCodeAt(i + 1) || null, r = t.charCodeAt(i - 1) || null;\n n += e && Ve(e) && !qe[t[i + 1]] || r && Ve(r) && !qe[t[i - 1]] || !qe[t[i]] ? t[i] : qe[t[i]];\n }\n return n;\n }(l));\n const c = [], f = {\n positionedGlyphs: c,\n text: l,\n top: a[1],\n bottom: a[1],\n left: a[0],\n right: a[0],\n writingMode: u\n };\n let d;\n return d = function(t, n) {\n const i = [];\n let e = 0;\n for (let r = 0; r < n.length; r++) {\n const s = n[r];\n i.push(t.substring(e, s)), e = s;\n }\n return e < t.length && i.push(t.substring(e, t.length)), i;\n }(l, function(t, n, i, e) {\n if (!i) return [];\n if (!t) return [];\n const r = [], s = function(t, n, i, e) {\n let r = 0;\n for (let i = 0; i < t.length; i++) {\n const s = e[t.charCodeAt(i)];\n s && (r += s.metrics.advance + n);\n }\n return r / Math.max(1, Math.ceil(r / i));\n }(t, n, i, e);\n let o = 0;\n for (let i = 0; i < t.length; i++) {\n const h = t.charCodeAt(i), u = e[h];\n u && !Ge[h] && (o += u.metrics.advance + n), i < t.length - 1 && (Je[h] || !((a = h) < 11904) && (Fe(a) || xe(a) || De(a) || Le(a) || Se(a) || pe(a) || Ae(a) || we(a) || _e(a) || Oe(a) || Pe(a) || je(a) || Me(a) || ge(a) || me(a) || ke(a) || be(a) || ze(a) || Te(a) || Ie(a))) && r.push(Ye(i + 1, o, s, r, Ze(h, t.charCodeAt(i + 1)), !1));\n }\n var a;\n return function t(n) {\n return n ? t(n.priorBreak).concat(n.index) : [];\n }(Ye(t.length, o, s, r, 0, !0));\n }(l, o, i, n)), function(t, n, i, e, r, s, o, a, h) {\n let u = 0, l = 8, c = 0;\n const f = t.positionedGlyphs, d = "right" === s ? 1 : "left" === s ? 0 : .5;\n for (let t = 0; t < i.length; t++) {\n let r = i[t];\n if (r = r.trim(), !r.length) {\n l -= e;\n continue;\n }\n const s = f.length;\n for (let t = 0; t < r.length; t++) {\n const i = r.charCodeAt(t), e = n[i];\n e && (He(i) && 1 !== o ? (32 !== i && f.push({\n glyph: i,\n x: u,\n y: 0,\n vertical: !0\n }), u += h + a) : (32 !== i && f.push({\n glyph: i,\n x: u,\n y: l,\n vertical: !1\n }), u += e.metrics.advance + a));\n }\n f.length !== s && (c = Math.max(u - a, c), Qe(f, n, s, f.length - 1, d)), u = 0, \n l -= e;\n }\n const {horizontalAlign: y, verticalAlign: v} = Ke(r);\n !function(t, n, i, e, r, s, o) {\n const a = (n - i) * r, h = -(-e * o + .5) * s;\n if (a || h) for (let n = 0; n < t.length; n++) t[n].x += a, t[n].y += h;\n }(f, d, y, v, c, e, i.length);\n const p = i.length * e;\n t.top += -v * p, t.bottom = t.top + p, t.left += -y * c, t.right = t.left + c;\n }(f, n, d, e, r, s, u, o, h), !!c.length && f;\n }\n const Ge = {\n 9: !0,\n 10: !0,\n 11: !0,\n 12: !0,\n 13: !0,\n 32: !0\n }, Je = {\n 10: !0,\n 32: !0,\n 38: !0,\n 40: !0,\n 41: !0,\n 43: !0,\n 45: !0,\n 47: !0,\n 173: !0,\n 183: !0,\n 8203: !0,\n 8208: !0,\n 8211: !0,\n 8231: !0\n };\n function Xe(t, n, i, e) {\n const r = Math.pow(t - n, 2);\n return e ? t < n ? r / 2 : 2 * r : r + Math.abs(i) * i;\n }\n function Ze(t, n) {\n let i = 0;\n return 10 === t && (i -= 1e4), 40 !== t && 65288 !== t || (i += 50), 41 !== n && 65289 !== n || (i += 50), \n i;\n }\n function Ye(t, n, i, e, r, s) {\n let o = null, a = Xe(n, i, r, s);\n for (let t = 0; t < e.length; t++) {\n const h = e[t], u = Xe(n - h.x, i, r, s) + h.badness;\n u <= a && (o = h, a = u);\n }\n return {\n index: t,\n x: n,\n priorBreak: o,\n badness: a\n };\n }\n function Ke(t) {\n let n = .5, i = .5;\n switch (t) {\n case "right":\n case "top-right":\n case "bottom-right":\n n = 1;\n break;\n\n case "left":\n case "top-left":\n case "bottom-left":\n n = 0;\n }\n switch (t) {\n case "bottom":\n case "bottom-right":\n case "bottom-left":\n i = 1;\n break;\n\n case "top":\n case "top-right":\n case "top-left":\n i = 0;\n }\n return {\n horizontalAlign: n,\n verticalAlign: i\n };\n }\n function Qe(t, n, i, e, r) {\n if (!r) return;\n const s = n[t[e].glyph];\n if (s) {\n const n = (t[e].x + s.metrics.advance) * r;\n if (!n) return;\n for (let r = i; r <= e; r++) t[r].x -= n;\n }\n }\n function tr(t) {\n if (!function(t) {\n for (const n of t) if (Re(n.charCodeAt(0))) return !0;\n return !1;\n }(t)) return t;\n const n = [], i = [], e = [];\n let r = 0, s = 0, o = 1, a = 1;\n for (const h of t) {\n const t = h.codePointAt(0);\n We(t) ? (e.push(h), r++) : (o = Re(t) ? -1 : 1, a !== o ? (s = r, i.length && (a > 0 && i.reverse(), \n n.push(...i)), e.length && (n.splice(s, 0, ...e), e.length = 0), a = o, i.length = 0) : e.length && (i.push(...e), \n e.length = 0), i.push(h), r++);\n }\n return e.length && i.push(...e), i.length && (a > 0 && i.reverse(), n.push(...i)), \n n.reverse().join("");\n }\n const nr = /\\{ *([\\w_]+) *\\}/g;\n class ir {\n constructor(t, n, i, e, r) {\n this.feature = t, this.symbolDef = n, this.symbol = i, this.options = r, this.V = this.R.bind(this), \n this.C = e;\n }\n R(t, n) {\n return this.feature.properties[n] || "default";\n }\n getShape(t, n) {\n if (this.W) return this.W;\n const {textHorizontalAlignmentFn: i, textVerticalAlignmentFn: e, markerHorizontalAlignmentFn: r, markerVerticalAlignmentFn: s, textWrapWidthFn: o} = this.C;\n let a;\n const h = this.symbol, u = this.getIconAndGlyph(), l = this.feature.properties;\n if (u && u.glyph) {\n const {font: t, text: r} = u.glyph;\n if ("" === r) return null;\n const s = this.size[0] / 24, c = 24, f = h.textKeepUpright, d = "map" === h.textRotationAlignment && "line" === h.textPlacement && !h.isIconText, y = n.glyphMap[t], v = er(i ? i(null, l) : h.textHorizontalAlignment, e ? e(null, l) : h.textVerticalAlignment), p = 1.2 * c, m = function(t) {\n for (let n = 0; n < t.length; n++) if (!Ne(t.charAt(n).charCodeAt(0))) return !1;\n return !0;\n }(r), g = m && h.textLetterSpacing / s || 0, w = [ h.textDx / s || 0, h.textDy / s || 0 ], M = ((o ? o(null, l) : h.textWrapWidth) || 10 * c) / s;\n a = {}, a.horizontal = Be(r, y, M, p, v, "center", g, w, c, 1), m && d && f && (a.vertical = Be(r, y, M, p, v, "center", g, w, c, 2));\n } else if (u && u.icon) {\n if (!t.positions[u.icon.url]) return null;\n const n = er(r ? r(null, l) : h.markerHorizontalAlignment, s ? s(null, l) : h.markerVerticalAlignment);\n a = function(t, n) {\n const {horizontalAlign: i, verticalAlign: e} = Ke(n), r = -24 * i, s = -24 * e;\n return {\n image: t,\n top: s,\n bottom: s + 24,\n left: r,\n right: r + 24\n };\n }(t.positions[u.icon.url], n), this.size || (this.size = a.image.displaySize);\n }\n return this.W = a, a;\n }\n getIconAndGlyph() {\n if (this.iconGlyph) return this.iconGlyph;\n const {markerFileFn: t, markerTypeFn: n, markerPathFn: i, markerWidthFn: e, markerHeightFn: r, markerFillFn: s, markerFillPatternFileFn: o, markerFillOpacityFn: a, markerTextFitFn: h, markerTextFitPaddingFn: u, markerLineColorFn: l, markerLineWidthFn: c, markerLineOpacityFn: f, markerLineDasharrayFn: d, markerLinePatternFileFn: y, textNameFn: v, textFaceNameFn: p, textStyleFn: w, textWeightFn: M} = this.C, {zoom: b} = this.options, x = {}, F = this.symbol, A = this.feature.properties, k = t ? t(null, A) : F.markerFile, P = n ? n(null, A) : F.markerType, S = k || P || F.markerPath, _ = !Ji(this.symbolDef.textName);\n let O;\n if (S) {\n O = function(t, n, i, e, r, s) {\n if (Ji(n.markerWidth) && Ji(n.markerHeight)) return null;\n const o = "__fn_markerWidth".trim(), a = "__fn_markerHeight".trim();\n let h = n.markerWidth || 0, u = n.markerHeight || 0;\n return Zi(h) && ("identity" !== h.type ? h = de(h) : (h = t.markerWidth, t[o] && (h = t[o](e, i)), \n Zi(h) && (h = "identity" === h.type ? r(e, i) : de(h)))), Zi(u) && ("identity" !== u.type ? u = de(u) : (u = t.markerHeight, \n t[a] && (u = t[a](e, i)), Zi(u) && (u = "identity" === u.type ? s(e, i) : de(u)))), \n [ h, u ];\n }(F, this.symbolDef, A, b, e, r) || [ 0, 0 ];\n let t = F.markerTextFit;\n if (h && (t = h(b, A)), t && t && "none" !== t) {\n const n = F.text.textSize;\n let i = F.text.textName;\n m(i) && (i = g(i)(b, A));\n const e = ve(i, A);\n if (e) {\n const i = "__fn_textSize".trim(), r = "__fn_textSize_0".trim();\n m(n) && !F.text[i] && (F.text[r] = g(n), F.text[i] = (t, n) => {\n const i = F.text[r](t, n);\n return m(i) ? g(i)(t, n) : i;\n });\n const s = fe(F.text, F.text, A, b);\n if ("width" !== t && "both" !== t || (O[0] = s[0] * e.length), "height" !== t && "both" !== t || (O[1] = s[1]), \n s[0] && s[1]) {\n let t = F.markerTextFitPadding || [ 0, 0, 0, 0 ];\n u && (t = u(b, A)), O[0] += t[1] + t[3], O[1] += t[0] + t[2];\n }\n } else O[0] = O[1] = -1;\n }\n }\n if (_ && (O = fe(F, this.symbolDef, A, b)), !O) return x;\n if (O[0] = Math.ceil(O[0]), O[1] = Math.ceil(O[1]), this.size = O, S && O[0] >= 0 && O[1] >= 0) {\n let t;\n if (P) {\n const n = {};\n if (n.markerType = P, "path" === P && (n.markerPath = i ? i(null, A) : F.markerPath), \n e) {\n const t = e(null, A);\n Ji(t) || (n.markerWidth = t);\n } else F.markerWidth >= 0 && (n.markerWidth = F.markerWidth);\n if (r) {\n const t = r(null, A);\n Ji(t) || (n.markerHeight = t);\n } else F.markerHeight >= 0 && (n.markerHeight = F.markerHeight);\n if (s) {\n const t = s(null, A);\n Ji(t) || (n.markerFill = t);\n } else F.markerFill && (n.markerFill = F.markerFill);\n if (o) {\n const t = o(null, A);\n Ji(t) || (n.markerFillPatternFile = t);\n } else F.markerFillPatternFile && (n.markerFillPatternFile = F.markerFillPatternFile);\n if (a) {\n const t = a(null, A);\n Ji(t) || (n.markerFillOpacity = t);\n } else F.markerFillOpacity >= 0 && (n.markerFillOpacity = F.markerFillOpacity);\n if (l) {\n const t = l(null, A);\n Ji(t) || (n.markerLineColor = t);\n } else F.markerLineColor && (n.markerLineColor = F.markerLineColor);\n if (c) {\n const t = c(null, A);\n Ji(t) || (n.markerLineWidth = t);\n } else F.markerLineWidth >= 0 && (n.markerLineWidth = F.markerLineWidth);\n if (f) {\n const t = f(null, A);\n Ji(t) || (n.markerLineOpacity = t);\n } else F.markerLineOpacity >= 0 && (n.markerLineOpacity = F.markerLineOpacity);\n if (d) {\n const t = d(null, A);\n Ji(t) || (n.markerLineDasharray = t);\n } else F.markerLineDasharray && (n.markerLineDasharray = F.markerLineDasharray);\n if (y) {\n const t = y(null, A);\n Ji(t) || (n.markerLinePatternFile = t);\n } else F.markerLinePatternFile && (n.markerLinePatternFile = F.markerLinePatternFile);\n t = "vector://" + JSON.stringify(n);\n } else t = k ? k.replace(nr, this.V) : F.markerPath ? function(t, n, i) {\n if (!t.markerPath) return null;\n let e = 1;\n const r = function(t) {\n const n = {\n stroke: {\n stroke: t.markerLineColor,\n "stroke-width": t.markerLineWidth,\n "stroke-opacity": t.markerLineOpacity,\n "stroke-dasharray": null,\n "stroke-linecap": "butt",\n "stroke-linejoin": "round"\n },\n fill: {\n fill: t.markerFill,\n "fill-opacity": t.markerFillOpacity\n }\n };\n return 0 === n.stroke["stroke-width"] && (n.stroke["stroke-opacity"] = 0), n;\n }(t);\n Xi(t.markerOpacity) && (e = t.markerOpacity), Xi(t.opacity) && (e *= t.opacity);\n const s = {};\n if (r) {\n for (const t in r.stroke) Qi(r.stroke, t) && (Ji(r.stroke[t]) || (s[t] = r.stroke[t]));\n for (const t in r.fill) Qi(r.fill, t) && (Ji(r.fill[t]) || (s[t] = r.fill[t]));\n }\n const o = Array.isArray(t.markerPath) ? t.markerPath : [ t.markerPath ];\n let a;\n const h = [];\n for (let t = 0; t < o.length; t++) a = Yi(o[t]) ? {\n path: o[t]\n } : o[t], a = Gi({}, a, s), a.d = a.path, delete a.path, h.push(a);\n const u = [ \'<svg version="1.1"\', \'xmlns="http://www.w3.org/2000/svg"\' ];\n e < 1 && u.push(\'opacity="\' + e + \'"\'), t.markerPathWidth && t.markerPathHeight && u.push(\'viewBox="0 0 \' + t.markerPathWidth + " " + t.markerPathHeight + \'"\'), \n u.push(\'preserveAspectRatio="none"\'), n && u.push(\'width="\' + n + \'"\'), i && u.push(\'height="\' + i + \'"\'), \n u.push("><defs></defs>");\n for (let t = 0; t < h.length; t++) {\n let n = "<path ";\n for (const i in h[t]) Qi(h[t], i) && (n += " " + i + \'="\' + h[t][i] + \'"\');\n n += "></path>", u.push(n);\n }\n return u.push("</svg>"), "data:image/svg+xml;base64," + btoa(u.join(" "));\n }(F, O[0], O[1]) : null;\n x.icon = {\n url: t,\n size: O\n };\n }\n if (_) {\n const t = v ? v(null, A) : F.textName;\n if (t || 0 === t) {\n const n = function(t, n, i) {\n return [ n || "normal", i || "normal", "24px", t || "monospace" ].join(" ");\n }(p ? p(null, A) : F.textFaceName, w ? w(null, A) : F.textStyle, M ? M(null, A) : F.textWeight);\n let i = ve(t, A);\n i && i.length && (i = tr(i), x.glyph = {\n font: n,\n text: i\n });\n }\n }\n return this.iconGlyph = x, x;\n }\n }\n function er(t, n) {\n n && "middle" !== n || (n = "center"), t && "middle" !== t || (t = "center");\n let i = "center" !== n ? n : "";\n return i += "center" !== t ? (i.length ? "-" : "") + t : "", i\n /*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */;\n }\n function rr(t, n, i, e, r) {\n const s = [];\n for (let o = 0; o < t.length; o++) {\n const a = t[o];\n let h;\n for (let t = 0; t < a.length - 1; t++) {\n let o = a[t], u = a[t + 1];\n o.x < n && u.x < n || (o.x < n ? o = new Ht(n, o.y + (n - o.x) / (u.x - o.x) * (u.y - o.y)).I() : u.x < n && (u = new Ht(n, o.y + (n - o.x) / (u.x - o.x) * (u.y - o.y)).I()), \n o.y < i && u.y < i || (o.y < i ? o = new Ht(o.x + (i - o.y) / (u.y - o.y) * (u.x - o.x), i).I() : u.y < i && (u = new Ht(o.x + (i - o.y) / (u.y - o.y) * (u.x - o.x), i).I()), \n o.x >= e && u.x >= e || (o.x >= e ? o = new Ht(e, o.y + (e - o.x) / (u.x - o.x) * (u.y - o.y)).I() : u.x >= e && (u = new Ht(e, o.y + (e - o.x) / (u.x - o.x) * (u.y - o.y)).I()), \n o.y >= r && u.y >= r || (o.y >= r ? o = new Ht(o.x + (r - o.y) / (u.y - o.y) * (u.x - o.x), r).I() : u.y >= r && (u = new Ht(o.x + (r - o.y) / (u.y - o.y) * (u.x - o.x), r).I()), \n h && o.equals(h[h.length - 1]) || (h = [ o ], s.push(h)), h.push(u)))));\n }\n }\n return s;\n }\n class sr extends Ht {\n constructor(t, n, i, e) {\n super(t, n), this.angle = i, void 0 !== e && (this.segment = e);\n }\n clone() {\n return new sr(this.x, this.y, this.angle, this.segment);\n }\n }\n /*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */ function or(t, n, i, e, r) {\n if (void 0 === n.segment) return !0;\n let s = n, o = n.segment + 1, a = 0;\n for (;a > -i / 2; ) {\n if (o--, o < 0) return !1;\n a -= t[o].dist(s), s = t[o];\n }\n a += t[o].dist(t[o + 1]), o++;\n const h = [];\n let u = 0;\n for (;a < i / 2; ) {\n const n = t[o], i = t[o + 1];\n if (!i) return !1;\n let s = t[o - 1].angleTo(n) - n.angleTo(i);\n for (s = Math.abs((s + 3 * Math.PI) % (2 * Math.PI) - Math.PI), h.push({\n distance: a,\n angleDelta: s\n }), u += s; a - h[0].distance > e; ) u -= h.shift().angleDelta;\n if (u > r) return !1;\n o++, a += n.dist(i);\n }\n return !0;\n }\n function ar(t, n, i, e, r, s, o, a, h) {\n const u = function(t, n, i) {\n return t ? .6 * n * i : 0;\n }(e, s, o), l = function(t, n) {\n return Math.max(t ? t.right - t.left : 0, n ? n.right - n.left : 0);\n }(e, r), c = 0 === t[0].x || t[0].x === h || 0 === t[0].y || t[0].y === h;\n return n - l * o < n / 4 && (n = l * o + n / 4), function t(n, i, e, r, s, o, a, h, u) {\n const l = o / 2, c = function(t) {\n let n = 0;\n for (let i = 0; i < t.length - 1; i++) n += t[i].dist(t[i + 1]);\n return n;\n }(n);\n let f = 0, d = i - e, y = [];\n for (let t = 0; t < n.length - 1; t++) {\n const i = n[t], a = n[t + 1], h = i.dist(a), v = a.angleTo(i);\n for (;d + e < f + h; ) {\n d += e;\n const p = (d - f) / h, m = hr(i.x, a.x, p), g = hr(i.y, a.y, p);\n if (m >= 0 && m < u && g >= 0 && g < u && d - l >= 0 && d + l <= c) {\n const i = new sr(m, g, v, t);\n i.line = n, i.I(), r && !or(n, i, o, r, s) || y.push(i);\n }\n }\n f += h;\n }\n return h || y.length || a || (y = t(n, f / 2, e, r, s, o, a, !0, u)), y;\n }(t, c ? n / 2 * a % n : (l / 2 + 2 * s) * o * a % n, n, u, i, l * o, c, !1, h);\n }\n function hr(t, n, i) {\n return t * (1 - i) + n * i;\n }\n function ur(t, n) {\n const i = t.length;\n if (i <= 1) return [ t ];\n const e = [];\n let r, s;\n for (let n = 0; n < i; n++) {\n const i = ne(t[n]);\n 0 !== i && (t[n].area = Math.abs(i), void 0 === s && (s = i < 0), s === i < 0 ? (r && e.push(r), \n r = [ t[n] ]) : r.push(t[n]));\n }\n if (r && e.push(r), n > 1) for (let t = 0; t < e.length; t++) e[t].length <= n || (Bt(e[t], n, 1, e[t].length - 1, lr), \n e[t] = e[t].slice(0, n));\n return e;\n }\n function lr(t, n) {\n return n.area - t.area;\n }\n function cr(t, n, i) {\n const e = n.distSqr(i);\n if (0 === e) return t.distSqr(n);\n const r = ((t.x - n.x) * (i.x - n.x) + (t.y - n.y) * (i.y - n.y)) / e;\n return t.distSqr(r < 0 ? n : r > 1 ? i : i.sub(n).F(r).u(n));\n }\n function fr(t, n = 1, i = !1) {\n let e = 1 / 0, r = 1 / 0, s = -1 / 0, o = -1 / 0;\n const a = t[0];\n for (let t = 0; t < a.length; t++) {\n const n = a[t];\n (!t || n.x < e) && (e = n.x), (!t || n.y < r) && (r = n.y), (!t || n.x > s) && (s = n.x), \n (!t || n.y > o) && (o = n.y);\n }\n const h = Math.min(s - e, o - r);\n let u = h / 2;\n const l = new Zt(null, dr);\n if (0 === h) return new Ht(e, r);\n for (let n = e; n < s; n += h) for (let i = r; i < o; i += h) l.push(new yr(n + u, i + u, u, t));\n let c = function(t) {\n let n = 0, i = 0, e = 0;\n const r = t[0];\n for (let t = 0, s = r.length, o = s - 1; t < s; o = t++) {\n const s = r[t], a = r[o], h = s.x * a.y - a.x * s.y;\n i += (s.x + a.x) * h, e += (s.y + a.y) * h, n += 3 * h;\n }\n return new yr(i / n, e / n, 0, t);\n }(t), f = l.length;\n for (;l.length; ) {\n const e = l.pop();\n (e.d > c.d || !c.d) && (c = e, i && console.log("found best %d after %d probes", Math.round(1e4 * e.d) / 1e4, f)), \n e.max - c.d <= n || (u = e.h / 2, l.push(new yr(e.p.x - u, e.p.y - u, u, t)), l.push(new yr(e.p.x + u, e.p.y - u, u, t)), \n l.push(new yr(e.p.x - u, e.p.y + u, u, t)), l.push(new yr(e.p.x + u, e.p.y + u, u, t)), \n f += 4);\n }\n return i && (console.log("num probes: " + f), console.log("best distance: " + c.d)), \n c.p;\n }\n function dr(t, n) {\n return n.max - t.max;\n }\n function yr(t, n, i, e) {\n this.p = new Ht(t, n), this.h = i, this.d = function(t, n) {\n let i = !1, e = 1 / 0;\n for (let r = 0; r < n.length; r++) {\n const s = n[r];\n for (let n = 0, r = s.length, o = r - 1; n < r; o = n++) {\n const r = s[n], a = s[o];\n r.y > t.y != a.y > t.y && t.x < (a.x - r.x) * (t.y - r.y) / (a.y - r.y) + r.x && (i = !i), \n e = Math.min(e, cr(t, r, a));\n }\n }\n return (i ? 1 : -1) * Math.sqrt(e);\n }(this.p, e), this.max = this.d + this.h * Math.SQRT2;\n }\n const vr = 45 * Math.PI / 100;\n function pr(t, n) {\n const i = {}, e = {}, r = [];\n let s = 0;\n function o(n) {\n r.push(t[n]), s++;\n }\n function a(t, n, i) {\n const s = e[t];\n return delete e[t], e[n] = s, r[s].geometry[0].pop(), r[s].geometry[0] = r[s].geometry[0].concat(i[0]), \n s;\n }\n function h(t, n, e) {\n const s = i[n];\n return delete i[n], i[t] = s, r[s].geometry[0].shift(), r[s].geometry[0] = e[0].concat(r[s].geometry[0]), \n s;\n }\n function u(t, n, i) {\n const e = i ? n[0][n[0].length - 1] : n[0][0];\n return `${t}:${e.x}:${e.y}`;\n }\n for (let l = 0; l < t.length; l++) {\n const c = t[l], f = c.geometry;\n if (!f) continue;\n const d = c.properties[n] ? c.properties[n].toString() : null;\n if (!d) {\n o(l);\n continue;\n }\n const y = u(d, f), v = u(d, f, !0);\n if (y in e && v in i && e[y] !== i[v]) {\n const t = h(y, v, f), n = a(y, v, r[t].geometry);\n delete i[y], delete e[v], e[u(d, r[n].geometry, !0)] = n, r[t].geometry = null;\n } else y in e ? a(y, v, f) : v in i ? h(y, v, f) : (o(l), i[y] = s - 1, e[v] = s - 1);\n }\n return r.filter(t => t.geometry);\n }\n class mr extends le {\n static needMerge(t) {\n return t.mergeOnProperty && ("line" === t.textPlacement || "line" === t.markerPlacement);\n }\n static mergeLineFeatures(t, n, i) {\n const e = "__index".trim(), r = function(t, n, i) {\n const e = "__index".trim(), r = le.genFnTypes(n), {mergeOnPropertyFn: s} = r;\n if (!n.mergeOnProperty || "line" !== n.textPlacement && "line" !== n.markerPlacement) return [];\n if (!(oe(o = n.mergeOnProperty) || "string" != typeof o && (null === o.constructor || o.constructor !== String) || "line" !== n.textPlacement && "line" !== n.markerPlacement)) return [ {\n features: t,\n property: n.mergeOnProperty\n } ];\n var o;\n const a = [], h = {}, u = [];\n for (let r = 0; r < t.length; r++) {\n t[r][e] = r;\n const o = t[r].properties = t[r].properties || {};\n o.$layer = t[r].layer, o.$type = t[r].type;\n let l = n.markerPlacement;\n "line" !== l && (l = n.textPlacement);\n const c = s ? s(i, o) : n.mergeOnProperty;\n "line" !== l || oe(c) ? u.push(t[r]) : (void 0 === h[c] && (h[c] = a.length, a.push({\n features: [],\n property: c\n })), a[h[c]].features.push(t[r]));\n }\n return u.length && a.push({\n features: u\n }), a;\n }(t, n, i);\n if (r.length) {\n const n = [];\n for (let i = 0; i < r.length; i++) n.push(r[i].property ? pr(r[i].features, r[i].property) : t);\n if (1 === n.length) return n[0];\n {\n let t = [];\n for (let i = 0; i < n.length; i++) t = t.concat(n[i]);\n return t.sort((t, n) => t[e] - n[e]), t;\n }\n }\n }\n static splitPointSymbol(t, n = 0) {\n const i = [];\n if (Array.isArray(t)) {\n const n = t;\n for (let t = 0; t < n.length; t++) n[t] && i.push(...mr.splitPointSymbol(n[t], t));\n return i;\n }\n let e = null, r = null;\n for (const n in t) 0 === n.indexOf("marker") ? (e = e || {}, e[n] = t[n]) : 0 === n.indexOf("text") && (r = r || {}, \n r[n] = t[n]);\n return e && (e.isIconText = !0, t.mergeOnProperty && (e.mergeOnProperty = t.mergeOnProperty), \n i.push(e)), r && (e && (r.textPlacement = e.markerPlacement, r.textSpacing = e.markerSpacing, \n r.isIconText = !0), t.mergeOnProperty && (r.mergeOnProperty = t.mergeOnProperty), \n i.push(r)), void 0 !== t.visible && (e && (e.visible = t.visible), r && (r.visible = t.visible)), \n e && (e.markerTextFit && r && (e.text = {}, e.text.textName = r.textName, e.text.textSize = r.textSize), \n e.index = {\n index: n,\n type: 0\n }), r && (r.index = {\n index: n,\n type: 1\n }), i;\n }\n static isAtlasLoaded(t, n) {\n const {icon: i, glyph: e} = t, {iconAtlas: r, glyphAtlas: s} = n;\n if (i && (!r || !r.positions[i.url])) return !1;\n if (e) {\n if (!s || !s.positions[e.font]) return !1;\n const t = s.positions[e.font], {text: n} = e;\n for (let i = 0; i < n.length; i++) if (!t[n.charCodeAt(i)]) return !1;\n }\n return !0;\n }\n constructor(t, n, i) {\n super(t, n, i);\n }\n createStyledVector(t, n, i, e, r, s) {\n const o = new ir(t, this.symbolDef, n, i, e), a = o.getIconAndGlyph();\n if (a.icon && !this.options.atlas) {\n const {url: t, size: n} = a.icon;\n r[t] || (r[t] = a.icon.size), r[t][0] < n[0] && (r[t][0] = n[0]), r[t][1] < n[1] && (r[t][1] = n[1]);\n }\n if (a.glyph && !this.options.atlas) {\n const {font: t, text: i} = a.glyph, e = s[t] = s[t] || {};\n for (let t = 0; t < i.length; t++) e[i.charCodeAt(t)] = 1;\n "line" === n.textPlacement && (s.options = {\n isCharsCompact: !1\n });\n }\n return this.options.allowEmptyPack || a.icon || a.glyph ? o : null;\n }\n getFormat(t) {\n const n = void 0 !== t.textName, i = n ? function(t) {\n return "line" !== t.textPlacement || t.isIconText ? [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n }, {\n type: Int16Array,\n width: 2,\n name: "aShape"\n }, {\n type: Uint16Array,\n width: 2,\n name: "aTexCoord"\n }, {\n type: Uint8Array,\n width: 1,\n name: "aCount"\n } ] : [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n }, {\n type: Int16Array,\n width: 2,\n name: "aShape"\n }, {\n type: Uint16Array,\n width: 2,\n name: "aTexCoord"\n }, {\n type: Uint8Array,\n width: 1,\n name: "aCount"\n }, {\n type: Int16Array,\n width: 2,\n name: "aGlyphOffset"\n }, {\n type: Uint16Array,\n width: 3,\n name: "aSegment"\n }, {\n type: Uint8Array,\n width: 1,\n name: "aVertical"\n } ];\n }(t) : [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n }, {\n type: Int16Array,\n width: 2,\n name: "aShape"\n }, {\n type: Uint16Array,\n width: 2,\n name: "aTexCoord"\n } ];\n n ? i.push(...this.q()) : i.push(...this.B());\n const {markerOpacityFn: e, textOpacityFn: r, markerPitchAlignmentFn: s, textPitchAlignmentFn: o, markerRotationAlignmentFn: a, textRotationAlignmentFn: h, markerRotationFn: u, textRotationFn: l, markerAllowOverlapFn: c, textAllowOverlapFn: f, markerIgnorePlacementFn: d, textIgnorePlacementFn: y} = this.C;\n return (e || r) && i.push({\n type: Uint8Array,\n width: 1,\n name: "aColorOpacity"\n }), (s || o) && i.push({\n type: Uint8Array,\n width: 1,\n name: "aPitchAlign"\n }), (a || h) && i.push({\n type: Uint8Array,\n width: 1,\n name: "aRotationAlign"\n }), (u || l) && i.push({\n type: Uint16Array,\n width: 1,\n name: "aRotation"\n }), (c || f || d || y) && i.push({\n type: Uint8Array,\n width: 1,\n name: "aOverlap"\n }), i;\n }\n q() {\n const {textFillFn: t, textSizeFn: n, textHaloFillFn: i, textHaloRadiusFn: e, textHaloOpacityFn: r, textDxFn: s, textDyFn: o} = this.C, a = [];\n return t && a.push({\n type: Uint8Array,\n width: 4,\n name: "aTextFill"\n }), n && a.push({\n type: Uint8Array,\n width: 1,\n name: "aTextSize"\n }), i && a.push({\n type: Uint8Array,\n width: 4,\n name: "aTextHaloFill"\n }), e && a.push({\n type: Uint8Array,\n width: 1,\n name: "aTextHaloRadius"\n }), r && a.push({\n type: Uint8Array,\n width: 1,\n name: "aTextHaloOpacity"\n }), s && a.push({\n type: Int8Array,\n width: 1,\n name: "aTextDx"\n }), o && a.push({\n type: Int8Array,\n width: 1,\n name: "aTextDy"\n }), a;\n }\n B() {\n const {markerWidthFn: t, markerHeightFn: n, markerDxFn: i, markerDyFn: e} = this.C, r = [];\n return t && r.push({\n type: Uint8Array,\n width: 1,\n name: "aMarkerWidth"\n }), n && r.push({\n type: Uint8Array,\n width: 1,\n name: "aMarkerHeight"\n }), i && r.push({\n type: Int8Array,\n width: 1,\n name: "aMarkerDx"\n }), e && r.push({\n type: Int8Array,\n width: 1,\n name: "aMarkerDy"\n }), r;\n }\n createDataPack() {\n if (!this.iconAtlas && !this.glyphAtlas) {\n if (!this.options.allowEmptyPack) return null;\n this.empty = !0;\n }\n this.lineVertex = [];\n const t = super.createDataPack.apply(this, arguments);\n return t ? (t.lineVertex = new Int16Array(this.lineVertex), t.buffers.push(t.lineVertex.buffer), \n t) : null;\n }\n placeVector(t, n) {\n const i = t.getShape(this.iconAtlas, this.glyphAtlas);\n if (!this.options.allowEmptyPack && !i) return;\n const e = this.G(t, i, n);\n if (0 === e.length) return;\n const r = this.data;\n let s = this.data.aPosition.length / 3;\n const o = t.symbol, a = t.feature.properties, h = "line" === o.textPlacement && !o.isIconText, u = void 0 !== o.textName, l = u && h && function(t) {\n let n = 0;\n for (let i = 0; i < t.length; i++) if (He(t.charAt(i).charCodeAt(0))) n = 0; else if (n++, \n n >= 1) return !1;\n return !0;\n }(t.getIconAndGlyph().glyph.text) ? 1 : 0, {textFillFn: c, textSizeFn: f, textHaloFillFn: d, textHaloRadiusFn: y, textHaloOpacityFn: v, textDxFn: p, textDyFn: g, textPitchAlignmentFn: w, textRotationAlignmentFn: M, textRotationFn: b, textAllowOverlapFn: x, textIgnorePlacementFn: F, textOpacityFn: A, markerWidthFn: k, markerHeightFn: P, markerDxFn: S, markerDyFn: _, markerPitchAlignmentFn: O, markerRotationAlignmentFn: I, markerRotationFn: T, markerAllowOverlapFn: L, markerIgnorePlacementFn: U, markerOpacityFn: z} = this.C;\n let D, E, C, j, N, H, V, R, $, W, q, B, G, J, X, Z, Y;\n if (u) {\n const n = t.getIconAndGlyph().glyph.font;\n D = function(t, n, i) {\n const e = t.positionedGlyphs, r = [];\n for (let s = 0; s < e.length; s++) {\n const o = e[s], a = i[o.glyph];\n if (!a) continue;\n const h = a.rect;\n if (!h) continue;\n const u = 4, l = a.metrics.advance / 2, c = a.metrics.height / 2, f = n ? [ o.x + l, 0 ] : [ 0, 0 ], d = n ? [ 0, o.y - c ] : [ o.x + l, o.y - c ], y = a.metrics.left - u - l + d[0], v = a.metrics.top - u + d[1], p = y + h.w, m = v + h.h, g = new Ht(y, v), w = new Ht(p, v), M = new Ht(y, m), b = new Ht(p, m);\n if (n && o.vertical) {\n const t = new Ht(-l, l), n = -Math.PI / 2, i = new Ht(5, 0);\n g.P(n, t).u(i), w.P(n, t).u(i), M.P(n, t).u(i), b.P(n, t).u(i);\n }\n r.push({\n tl: g,\n tr: w,\n bl: M,\n br: b,\n tex: h,\n writingMode: t.writingMode,\n glyphOffset: f\n });\n }\n return r;\n }(i.horizontal, h, this.glyphAtlas.positions[n]), c && (E = c(null, a), m(E) ? E = [ 0, 0, 0, 0 ] : (E = Array.isArray(E) ? E.map(t => 255 * t) : Vn(E).array(), \n 3 === E.length && E.push(255))), f && (C = f(this.options.zoom, a), oe(C) && (C = 14)), \n d && (j = d(null, a), j = Array.isArray(j) ? j.map(t => 255 * t) : Vn(j).array(), \n 3 === j.length && j.push(255)), y && (N = y(null, a)), v && (H = 255 * v(null, a)), \n p && (V = p(null, a) || 0), g && (R = g(null, a) || 0), w && (G = +("map" === w(null, a))), \n M && (J = +("map" === M(null, a))), b && (X = ae(b(null, a), 0, 360) * Math.PI / 180);\n } else D = i ? function(t) {\n const n = t.image, i = t.top - 1 / n.pixelRatio, e = t.left - 1 / n.pixelRatio, r = t.bottom + 1 / n.pixelRatio, s = t.right + 1 / n.pixelRatio;\n let o, a, h, u;\n return o = new Ht(e, i), a = new Ht(s, i), h = new Ht(s, r), u = new Ht(e, r), [ {\n tl: o,\n tr: a,\n bl: u,\n br: h,\n tex: {\n x: n.tl[0],\n y: n.tl[1],\n w: n.displaySize[0],\n h: n.displaySize[1]\n },\n writingMode: void 0,\n glyphOffset: [ 0, 0 ]\n } ];\n }(i) : function() {\n const t = new Ht(0, 0), n = new Ht(0, 0), i = new Ht(0, 0);\n return [ {\n tl: t,\n tr: n,\n bl: new Ht(0, 0),\n br: i,\n tex: {\n x: 0,\n y: 0,\n w: 0,\n h: 0\n },\n writingMode: void 0,\n glyphOffset: [ 0, 0 ]\n } ];\n }(), k && ($ = k(null, a)), P && (W = P(null, a)), S && (q = S(null, a)), _ && (B = _(null, a)), \n O && (G = +("map" === O(null, a))), I && (J = +("map" === I(null, a))), T && (X = ae(T(null, a), 0, 360) * Math.PI / 180);\n const K = L || x;\n K && (Z = K(null, a) || 0);\n const Q = U || F;\n let tt;\n Q && (Y = Q(null, a) || 0);\n const nt = A || z;\n nt && (tt = 255 * nt(this.options.zoom, a));\n const it = this.options.EXTENT, et = D.length, rt = this.getAltitude(t.feature.properties);\n for (let t = 0; t < e.length; t++) {\n const n = e[t];\n if (it !== 1 / 0 && se(n, it)) continue;\n const i = n.x, o = n.y, a = D.length;\n for (let t = 0; t < a; t++) {\n const e = D[t], {tl: a, tr: c, bl: f, br: d, tex: y} = e;\n this.J(r, i, o, rt, 10 * a.x, 10 * a.y, y.x, y.y + y.h), u && this.X(r, h, et, e.glyphOffset, n, l), \n this.Z(r, E, C, j, N, H, V, R, $, W, q, B, tt, G, J, X, Z, Y), this.J(r, i, o, rt, 10 * c.x, 10 * c.y, y.x + y.w, y.y + y.h), \n u && this.X(r, h, et, e.glyphOffset, n, l), this.Z(r, E, C, j, N, H, V, R, $, W, q, B, tt, G, J, X, Z, Y), \n this.J(r, i, o, rt, 10 * f.x, 10 * f.y, y.x, y.y), u && this.X(r, h, et, e.glyphOffset, n, l), \n this.Z(r, E, C, j, N, H, V, R, $, W, q, B, tt, G, J, X, Z, Y), this.J(r, i, o, rt, 10 * d.x, 10 * d.y, y.x + y.w, y.y), \n u && this.X(r, h, et, e.glyphOffset, n, l), this.Z(r, E, C, j, N, H, V, R, $, W, q, B, tt, G, J, X, Z, Y), \n this.addElements(s, s + 1, s + 2), this.addElements(s + 1, s + 2, s + 3), s += 4;\n const v = Math.max(Math.abs(i), Math.abs(o), Math.abs(rt));\n v > this.maxPos && (this.maxPos = v);\n }\n }\n }\n J(t, n, i, e, r, s, o, a) {\n t.aPosition.push(n, i, e), t.aShape.push(r, s), t.aTexCoord.push(o, a);\n }\n X(t, n, i, e, r, s) {\n if (t.aCount.push(i), n) {\n t.aGlyphOffset.push(e[0], e[1]);\n const n = r.startIndex;\n t.aSegment.push(r.segment + n, n, r.line.length), t.aVertical.push(s);\n }\n }\n Z(t, n, i, e, r, s, o, a, h, u, l, c, f, d, y, v, p, m) {\n const {textFillFn: g, textSizeFn: w, textHaloFillFn: M, textHaloRadiusFn: b, textHaloOpacityFn: x, textDxFn: F, textDyFn: A, textPitchAlignmentFn: k, textRotationAlignmentFn: P, textRotationFn: S, textAllowOverlapFn: _, textIgnorePlacementFn: O, textOpacityFn: I, markerWidthFn: T, markerHeightFn: L, markerDxFn: U, markerDyFn: z, markerPitchAlignmentFn: D, markerRotationAlignmentFn: E, markerRotationFn: C, markerAllowOverlapFn: j, markerIgnorePlacementFn: N, markerOpacityFn: H} = this.C;\n g && t.aTextFill.push(...n), w && t.aTextSize.push(i), M && t.aTextHaloFill.push(...e), \n b && t.aTextHaloRadius.push(r), x && t.aTextHaloOpacity.push(s), F && t.aTextDx.push(o), \n A && t.aTextDy.push(a), T && t.aMarkerWidth.push(h), L && t.aMarkerHeight.push(u), \n U && t.aMarkerDx.push(l), z && t.aMarkerDy.push(c), (H || I) && t.aColorOpacity.push(f), \n (k || D) && t.aPitchAlign.push(d), (E || P) && t.aRotationAlign.push(y), (C || S) && t.aRotation.push(9362 * v);\n const V = j || _, R = N || O;\n (V || R) && t.aOverlap.push((V ? 8 : 0) + 4 * p + ((R ? 2 : 0) + m)), r > 0 && (this.properties.hasHalo = 1);\n }\n G(t, n, i) {\n const {feature: e, symbol: r} = t, s = this.Y(t, r), o = e.properties, {markerSpacingFn: a, textSpacingFn: h} = this.C, u = ((a ? a(null, o) : r.markerSpacing) || (h ? h(null, o) : r.textSpacing) || 250) * i;\n return function(t, n, i, e, r, s, o) {\n const {feature: a, size: h, symbol: u} = t, l = h ? 24 : 0, c = e * (h ? h[0] / l : 1), f = [];\n if ("line" === s) {\n let t = a.geometry;\n r && (t = rr(a.geometry, 0, 0, r, r));\n for (let e = 0; e < t.length; e++) {\n const s = ar(t[e], o, vr, u.isIconText ? null : i.vertical || i.horizontal || i, null, l, u.isIconText ? 1 : c, 1, r || 1 / 0);\n if (u.textPlacement && !u.isIconText) for (let t = 0; t < s.length; t++) s[t].startIndex = n.length / 3;\n if (f.push.apply(f, s), u.textPlacement && !u.isIconText) for (let i = 0; i < t[e].length; i++) n.push(t[e][i].x, t[e][i].y, 0);\n }\n } else if (3 === a.type) {\n const t = ur(a.geometry, 0);\n for (let n = 0; n < t.length; n++) {\n const i = t[n];\n if ("vertex" === s) for (let t = 0; t < i.length; t++) {\n const n = i[t];\n for (let t = 0; t < n.length; t++) se(n[t], r) || f.push(n[t]);\n } else {\n const t = fr(i, 16);\n se(t, r) || f.push(t);\n }\n }\n } else if (2 === a.type) for (let t = 0; t < a.geometry.length; t++) {\n const n = a.geometry[t];\n if ("vertex" === s) for (let t = 0; t < n.length; t++) se(n[t], r) || f.push(n[t]); else se(n[0], r) || f.push(n[0]);\n } else if (1 === a.type) for (let t = 0; t < a.geometry.length; t++) {\n const n = a.geometry[t];\n for (let t = 0; t < n.length; t++) {\n const i = n[t];\n se(i, r) || f.push(i);\n }\n }\n return f;\n }(t, this.lineVertex, n, i, this.options.EXTENT, s, u);\n }\n Y(t, n) {\n return this.C.markerPlacementFn ? this.C.markerPlacementFn(this.options.zoom, t.feature.properties) : n.markerPlacement || n.textPlacement;\n }\n }\n const gr = Math.cos(Math.PI / 180 * 37.5), wr = Math.pow(2, 16) / 1;\n class Mr extends le {\n constructor(t, n, i) {\n super(t, n, i);\n let e = !1;\n const {lineDasharrayFn: r, lineDashColorFn: s} = this.C;\n r && (e = function(t, n, i) {\n for (let e = 0; e < t.length; e++) if (i(n, t[e].properties)) return !0;\n return !1;\n }(t, this.options.zoom, r), e && (this.dasharrayFn = r)), (Fr(this.symbol.lineDasharray) || e) && s && (this.dashColorFn = s);\n }\n createStyledVector(t, n, i, e, r) {\n const s = new he(t, n, i, e), o = s.getLineResource();\n return !this.options.atlas && o && (r[o] = [ 0, 0 ]), s;\n }\n getFormat() {\n const {lineWidthFn: t, lineStrokeWidthFn: n, lineStrokeColorFn: i, lineColorFn: e, lineOpacityFn: r, lineDxFn: s, lineDyFn: o, linePatternAnimSpeedFn: a, linePatternGapFn: h} = this.C, u = [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n } ];\n if (u.push(this.options.center || this.iconAtlas ? {\n type: Int8Array,\n width: 3,\n name: "aExtrude"\n } : {\n type: Int8Array,\n width: 2,\n name: "aExtrude"\n }), u.push({\n type: Uint16Array,\n width: 1,\n name: "aLinesofar"\n }), t && u.push({\n type: Uint8Array,\n width: 1,\n name: "aLineWidth"\n }), n && u.push({\n type: Uint8Array,\n width: 1,\n name: "aLineStrokeWidth"\n }), e && u.push({\n type: Uint8Array,\n width: 4,\n name: "aColor"\n }), i && u.push({\n type: Uint8Array,\n width: 4,\n name: "aStrokeColor"\n }), r && u.push({\n type: Uint8Array,\n width: 1,\n name: "aOpacity"\n }), this.symbol.lineOffset && u.push({\n type: Int8Array,\n width: 2,\n name: "aExtrudeOffset"\n }), this.dasharrayFn && u.push({\n type: Uint8Array,\n width: 4,\n name: "aDasharray"\n }), this.dashColorFn && u.push({\n type: Uint8Array,\n width: 4,\n name: "aDashColor"\n }), this.iconAtlas) {\n const t = this.getIconAtlasMaxValue();\n u.push({\n type: t > 255 ? Uint16Array : Uint8Array,\n width: 4,\n name: "aTexInfo"\n });\n }\n return s && u.push({\n type: Int8Array,\n width: 1,\n name: "aLineDx"\n }), o && u.push({\n type: Int8Array,\n width: 1,\n name: "aLineDy"\n }), a && u.push({\n type: Int8Array,\n width: 1,\n name: "aLinePatternAnimSpeed"\n }), h && u.push({\n type: Uint8Array,\n width: 1,\n name: "aLinePatternGap"\n }), u;\n }\n placeVector(t) {\n const {lineJoinFn: n, lineCapFn: i, lineWidthFn: e, lineStrokeWidthFn: r, lineStrokeColorFn: s, lineColorFn: o, lineOpacityFn: a, lineJoinPatternModeFn: h, lineDxFn: u, lineDyFn: l, linePatternAnimSpeedFn: c, linePatternGapFn: f} = this.C, d = this.symbol, y = t.feature, v = 3 === y.type, p = y.properties, g = this.elements;\n v && (this.elements = []);\n let w = d.lineJoin || "miter", M = d.lineCap || "butt";\n if (n && (w = n(this.options.zoom, p) || "miter"), i && (M = i(this.options.zoom, p) || "butt"), \n e) {\n let t = e(this.options.zoom, p);\n Ji(t) && (t = 4), this.feaLineWidth = t;\n } else this.feaLineWidth = d.lineWidth;\n if (r) {\n let t = r(this.options.zoom, p);\n Ji(t) && (t = 0), this.feaLineStrokeWidth = t;\n } else this.feaLineStrokeWidth = d.lineStrokeWidth || 0;\n if (o && (this.feaColor = o(this.options.zoom, p) || [ 0, 0, 0, 255 ], m(this.feaColor) ? this.feaColor = [ 0, 0, 0, 0 ] : (this.feaColor = Array.isArray(this.feaColor) ? this.feaColor.map(t => 255 * t) : Vn(this.feaColor).array(), \n 3 === this.feaColor.length && this.feaColor.push(255))), s && (this.feaStrokeColor = s(this.options.zoom, p) || [ 0, 0, 0, 255 ], \n m(this.feaStrokeColor) ? this.feaStrokeColor = [ 0, 0, 0, 0 ] : (this.feaStrokeColor = Array.isArray(this.feaStrokeColor) ? this.feaStrokeColor.map(t => 255 * t) : Vn(this.feaStrokeColor).array(), \n 3 === this.feaStrokeColor.length && this.feaStrokeColor.push(255))), a) {\n let t = a(this.options.zoom, p);\n Ji(t) && (t = 1), this.feaOpacity = 255 * t;\n }\n if (this.dasharrayFn) {\n let t = this.dasharrayFn(this.options.zoom, p) || [ 0, 0, 0, 0 ];\n if (t.length < 4) {\n const n = t;\n 1 === t.length ? t = [ n[0], n[0], n[0], n[0] ] : 2 === t.length ? t = [ n[0], n[1], n[0], n[1] ] : 3 === t.length && (t = [ n[0], n[1], n[2], n[2] ]);\n }\n this.feaDash = t;\n }\n if (this.dashColorFn) {\n let t = (this.dashColorFn ? this.dashColorFn(this.options.zoom, p) : this.symbol.lineDashColor) || [ 0, 0, 0, 0 ];\n t = Array.isArray(t) ? t.map(t => 255 * t) : Vn(t).array(), 3 === t.length && t.push(255), \n this.feaDashColor = t;\n }\n if (this.iconAtlas) {\n const n = t.getLineResource(), i = this.iconAtlas.glyphMap[n];\n if (this.feaTexInfo = this.feaTexInfo || [ 0, 0, 0, 0 ], i) {\n const {tl: t, displaySize: i} = this.iconAtlas.positions[n];\n this.feaTexInfo[0] = t[0] + 1, this.feaTexInfo[1] = t[1] + 1, this.feaTexInfo[2] = i[0] - 3, \n this.feaTexInfo[3] = i[1] - 3;\n } else this.feaTexInfo[0] = this.feaTexInfo[1] = this.feaTexInfo[2] = this.feaTexInfo[3] = 0;\n this.feaJoinPatternMode = h ? h(this.options.zoom, p) || 0 : d.lineJoinPatternMode || 0;\n }\n if (u) {\n let t = u(this.options.zoom, p);\n Ji(t) && (t = 0), this.feaLineDx = t;\n }\n if (l) {\n let t = l(this.options.zoom, p);\n Ji(t) && (t = 0), this.feaLineDy = t;\n }\n if (c) {\n let t = c(this.options.zoom, p);\n Ji(t) && (t = 0), 0 !== t && (this.properties.hasPatternAnim = 1), this.feaPatternAnimSpeed = t;\n }\n if (f) {\n let t = f(this.options.zoom, p);\n Ji(t) && (t = 0), this.feaLinePatternGap = t;\n }\n const b = this.options.EXTENT;\n let x = y.geometry;\n b !== 1 / 0 && 3 !== y.type && (x = rr(y.geometry, -1, -1, b + 1, b + 1));\n for (let t = 0; t < x.length; t++) this.offset = this.data.aPosition.length / 3, \n this.K(x[t], y, w, M, 2, 1.05), v && (this.tt(g), this.elements = []);\n v && (this.elements = g);\n }\n nt() {\n return this.iconAtlas && this.feaTexInfo[2] && this.feaTexInfo[3];\n }\n K(t, n, i, e, r, s) {\n const o = this.nt() || Fr(this.feaDash) || Fr(this.symbol.lineDasharray);\n this.overscaling = 1;\n const a = this.options.EXTENT;\n if (this.distance = 0, this.scaledDistance = 0, this.totalDistance = 0, this.symbol.lineGradientProperty && n.properties && Qi(n.properties, "mapbox_clip_start") && Qi(n.properties, "mapbox_clip_end")) {\n this.clipStart = +n.properties.mapbox_clip_start, this.clipEnd = +n.properties.mapbox_clip_end;\n for (let n = 0; n < t.length - 1; n++) this.totalDistance += t[n].dist(t[n + 1]);\n this.updateScaledDistance();\n }\n const h = 3 === n.type;\n let u = t.length;\n for (;u >= 2 && t[u - 1].equals(t[u - 2]); ) u--;\n let l = 0;\n for (;l < u - 1 && t[l].equals(t[l + 1]); ) l++;\n if (u < (h ? 3 : 2)) return;\n "bevel" === i && (r = 1.05);\n const c = this.overscaling <= 16 ? 15 * a / (512 * this.overscaling) : 0, f = {\n vertexLength: 0,\n primitiveLength: 0\n };\n let d, y, v, p, m;\n this.e1 = this.e2 = -1, h && (d = t[u - 2], m = t[l].sub(d)._().O());\n for (let n = l; n < u; n++) {\n if (v = n === u - 1 ? h ? t[l + 1] : void 0 : t[n + 1], v && t[n].equals(v)) continue;\n m && (p = m), d && (y = d), d = t[n], m = v ? v.sub(d)._().O() : p, p = p || m;\n let a = p.add(m);\n 0 === a.x && 0 === a.y || a._();\n const g = p.x * m.x + p.y * m.y, w = a.x * m.x + a.y * m.y, M = 0 !== w ? 1 / w : 1 / 0, b = 2 * Math.sqrt(2 - 2 * w), x = w < gr && y && v, F = p.x * m.y - p.y * m.x > 0;\n if (!o && x && n > l) {\n const t = d.dist(y);\n if (t > 2 * c) {\n const n = d.sub(d.sub(y).F(c / t).I());\n this.updateDistance(y, n), this.addCurrentVertex(n, p, 0, 0, f), y = n;\n }\n }\n const A = y && v;\n let k = A ? i : h ? "butt" : e;\n if (A && "round" === k && (M < s ? k = "miter" : M <= 2 && (k = "fakeround")), "miter" === k && M > r && (k = "bevel"), \n "bevel" === k && (M > 2 && (k = "flipbevel"), M < r && (k = "miter")), y && this.updateDistance(y, d), \n (n > l && n < u - 1 || h && n === u - 1) && o) {\n const t = this.feaJoinPatternMode ? 0 : -p.mag() * w;\n this.addCurrentVertex(d, p, t, t, f), this.it = 1;\n }\n if ("miter" === k) a.F(M), this.addCurrentVertex(d, a, 0, 0, f); else if ("flipbevel" === k) {\n if (M > 100) a = m.mult(-1); else {\n const t = M * p.add(m).mag() / p.sub(m).mag();\n a.O().F(t * (F ? -1 : 1));\n }\n this.addCurrentVertex(d, a, 0, 0, f), this.addCurrentVertex(d, a.mult(-1), 0, 0, f);\n } else if ("bevel" === k || "fakeround" === k) {\n const t = -Math.sqrt(M * M - 1), n = F ? t : 0, i = F ? 0 : t;\n if (y && this.addCurrentVertex(d, p, n, i, f), "fakeround" === k) {\n const t = Math.round(180 * b / Math.PI / 20);\n for (let n = 1; n < t; n++) {\n let i = n / t;\n if (.5 !== i) {\n const t = i - .5;\n i += i * t * (i - 1) * ((1.0904 + g * (g * (3.55645 - 1.43519 * g) - 3.2452)) * t * t + (.848013 + g * (.215638 * g - 1.06021)));\n }\n const e = m.sub(p).F(i).u(p)._().F(F ? -1 : 1);\n this.addHalfVertex(d, e.x, e.y, !1, F, 0, f);\n }\n }\n v && this.addCurrentVertex(d, m, -n, -i, f);\n } else if ("butt" === k) this.addCurrentVertex(d, a, 0, 0, f); else if ("square" === k) {\n const t = y ? 1 : -1;\n this.addCurrentVertex(d, a, t, t, f);\n } else "round" === k && (y && (this.addCurrentVertex(d, p, 0, 0, f), this.addCurrentVertex(d, p, 1, 1, f, !0)), \n v && (this.addCurrentVertex(d, m, -1, -1, f, !0), this.addCurrentVertex(d, m, 0, 0, f)));\n if (!o && x && n < u - 1) {\n const t = d.dist(v);\n if (t > 2 * c) {\n const n = d.add(v.sub(d).F(c / t).I());\n this.updateDistance(d, n), this.addCurrentVertex(n, m, 0, 0, f), d = n;\n }\n }\n if ((n > l && n < u - 1 || h && n === l) && o) {\n delete this.it;\n const t = this.feaJoinPatternMode ? 0 : m.mag() * w;\n this.addCurrentVertex(d, m, t, t, f);\n }\n }\n }\n addCurrentVertex(t, n, i, e, r, s = !1) {\n const o = n.y * e - n.x, a = -n.y - n.x * e;\n this.addHalfVertex(t, n.x + n.y * i, n.y - n.x * i, s, !1, i, r), this.addHalfVertex(t, o, a, s, !0, -e, r), \n this.distance > wr / 2 && 0 === this.totalDistance && (this.distance = 0, this.updateScaledDistance(), \n this.addCurrentVertex(t, n, i, e, r, s));\n }\n addHalfVertex({x: t, y: n}, i, e, r, s, o, a) {\n this.fillData(this.data, t, n, i, e, r, s, 1 * this.scaledDistance);\n const h = a.vertexLength++;\n this.e1 >= 0 && this.e2 >= 0 && (this.addElements(this.e1, this.e2, h), a.primitiveLength++), \n s ? this.e2 = h : this.e1 = h;\n }\n fillData(t, n, i, e, r, s, o, a) {\n const {lineWidthFn: h, lineStrokeWidthFn: u, lineStrokeColorFn: l, lineColorFn: c, lineOpacityFn: f, lineDxFn: d, lineDyFn: y, linePatternAnimSpeedFn: v, linePatternGapFn: p} = this.C;\n if (this.options.center ? t.aPosition.push(n, i, 0) : t.aPosition.push(n = (n << 1) + (s ? 1 : 0), i = (i << 1) + (o ? 1 : 0), 0), \n t.aExtrude.push(63 * e, 63 * r), this.options.center || this.iconAtlas) {\n let n = 0;\n this.options.center && (n += 2 * s + o), this.iconAtlas && (n += 4 * (this.it && this.feaJoinPatternMode ? 1 : 0)), \n t.aExtrude.push(n);\n }\n t.aLinesofar.push(a), h && t.aLineWidth.push(Math.round(2 * this.feaLineWidth)), \n u && t.aLineStrokeWidth.push(Math.round(2 * this.feaLineStrokeWidth)), c && t.aColor.push(...this.feaColor), \n l && t.aStrokeColor.push(...this.feaStrokeColor), f && t.aOpacity.push(this.feaOpacity), \n this.dasharrayFn && t.aDasharray.push(...this.feaDash), this.dashColorFn && t.aDashColor.push(...this.feaDashColor), \n this.iconAtlas && t.aTexInfo.push(...this.feaTexInfo), d && t.aLineDx.push(this.feaLineDx), \n y && t.aLineDy.push(this.feaLineDy), v && t.aLinePatternAnimSpeed.push(127 * this.feaPatternAnimSpeed), \n p && t.aLinePatternGap.push(10 * this.feaLinePatternGap), this.maxPos = Math.max(this.maxPos, Math.abs(n) + 1, Math.abs(i) + 1);\n }\n addElements(t, n, i) {\n super.addElements(this.offset + t, this.offset + n, this.offset + i);\n }\n tt(t) {\n const n = this.options.EXTENT, i = this.elements;\n for (let e = 0; e < i.length; e += 3) n !== 1 / 0 && (xr(this.data.aPosition, i[e], i[e + 1], 3, n) || xr(this.data.aPosition, i[e + 1], i[e + 2], 3, n)) || t.push(i[e], i[e + 1], i[e + 2]);\n }\n et(t) {\n if (t.length <= 1) return t;\n const n = [], i = this.options.EXTENT;\n let e, r = !0;\n for (e = 0; e < t.length - 1; e++) {\n const s = br(t[e], t[e + 1], i);\n s && r || (n.push(t[e]), r = s);\n }\n return r || n.push(t[e]), n;\n }\n updateDistance(t, n) {\n this.distance += t.dist(n), this.updateScaledDistance();\n }\n updateScaledDistance() {\n this.scaledDistance = this.totalDistance > 0 ? (this.clipStart + (this.clipEnd - this.clipStart) * this.distance / this.totalDistance) * (wr - 1) : this.distance;\n }\n }\n function br(t, n, i) {\n return i !== 1 / 0 && (t.x < 0 && n.x < 0 || t.x > i && n.x > i || t.y < 0 && n.y < 0 || t.y > i && n.y > i);\n }\n function xr(t, n, i, e, r) {\n if (r === 1 / 0) return !1;\n const s = Math.floor(.5 * t[n * e]), o = Math.floor(.5 * t[n * e + 1]), a = Math.floor(.5 * t[i * e]), h = Math.floor(.5 * t[i * e + 1]);\n return s === a && (s < 0 || s > r) && o !== h || o === h && (o < 0 || o > r) && s !== a;\n }\n function Fr(t) {\n if (!Array.isArray(t)) return !1;\n for (let n = 0; n < t.length; n++) if (t[n]) return !0;\n return !1;\n }\n class Ar extends Mr {\n constructor(t, n, i) {\n super(t, n, i), this.rt = i.altitudeProperty;\n }\n getFormat() {\n const {lineColorFn: t, lineWidthFn: n} = this.C, i = [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n }, {\n type: Uint16Array,\n width: 1,\n name: "aLinesofar"\n }, {\n type: Uint8Array,\n width: 1,\n name: "aUp"\n }, {\n type: Int16Array,\n width: 3,\n name: "aExtrudedPosition"\n }, {\n type: Int8Array,\n width: 2,\n name: "aExtrude"\n } ];\n return t && i.push({\n type: Uint8Array,\n width: 4,\n name: "aColor"\n }), n && i.push({\n type: Uint8Array,\n width: 1,\n name: "aLineWidth"\n }), this.rt && i.push({\n type: Array,\n width: 1,\n name: "aLineHeight"\n }), i;\n }\n placeVector(t) {\n const n = t.feature;\n if (this.rt) {\n const {altitudeScale: t, altitudeProperty: i, defaultAltitude: e, heightProperty: r, defaultHeight: s, minHeightProperty: o} = this.options, {altitude: a, height: h} = re(n, t, i, e, r, s, o);\n this.feaAltitude = a, this.feaMinHeight = (a - h) / a * 32767, a > this.maxAltitude && (this.maxAltitude = a);\n }\n return super.placeVector(t);\n }\n K(t, n, i, e, r, s) {\n const o = this.data.aPosition.length / 3;\n super.K(t, n, i, e, r, s);\n const a = this.data.aPosition.length / 3, h = this.data.aPosition.length / 3 - this.offset;\n if (3 !== n.type && h > 0 && !1 !== this.options.side) {\n const t = !1 !== this.options.top ? 1 : 0, n = t + 4;\n let i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const n = this.data[t], e = n.length / i;\n for (let t = 0; t < e; t++) n.push(n[o * e + 3 * e + t]);\n }\n i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const e = this.data[t], r = e.length / i;\n for (let t = 0; t < r; t++) e.push(e[o * r + r * n + t]);\n }\n i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const e = this.data[t], r = e.length / i;\n for (let t = 0; t < r; t++) e.push(e[o * r + r * (n + 3) + t]);\n }\n super.addElements(t + 1, h + 1, h), super.addElements(h, h + 1, h + 2);\n const e = this.data.aPosition.length / 3 - this.offset;\n i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const n = this.data[t], e = n.length / i;\n for (let t = 0; t < e; t++) n.push(n[a * e - e + t]);\n }\n i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const e = this.data[t], r = e.length / i;\n for (let t = 0; t < r; t++) e.push(e[a * r - n * r - r + t]);\n }\n i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const e = this.data[t], r = e.length / i;\n for (let t = 0; t < r; t++) e.push(e[a * r - n * r - 3 * r + t]);\n }\n super.addElements(e, h - 3, e + 1), super.addElements(h - 3, e + 2, e + 1);\n }\n }\n fillData(t, n, i, e, r, s, o, a) {\n const h = !1 !== this.options.top, u = !1 !== this.options.side, l = this.feaLineWidth || this.symbol.lineWidth / 2 * (this.options.EXTENT / this.options.tileSize), c = 63 * e, f = 63 * r, d = l * e + n, y = l * r + i;\n this.st(t, n, i, e, r, s, o, a, d, y, c, f), u && (h && this.st(t, n, i, e, r, s, o, a, d, y, c, f), \n this.st(t, n, i, e, r, s, o, a, d, y, c, f), this.ot(t, n, i, e, r, s, o, a, d, y, c, f), \n this.ot(t, n, i, e, r, s, o, a, d, y, c, f)), this.maxPos = Math.max(this.maxPos, Math.abs(n), Math.abs(i));\n }\n st(t, n, i, e, r, s, o, a, h, u, l, c) {\n const {lineColorFn: f, lineWidthFn: d} = this.C;\n t.aPosition.push(n, i, 32767), t.aLinesofar.push(a), t.aUp.push(+o), t.aExtrudedPosition.push(h, u, 1), \n t.aExtrude.push(l, c), f && t.aColor.push(...this.feaColor), d && t.aLineWidth.push(Math.round(2 * this.feaLineWidth)), \n this.rt && t.aLineHeight.push(this.feaAltitude);\n }\n ot(t, n, i, e, r, s, o, a, h, u, l, c) {\n const {lineColorFn: f, lineWidthFn: d} = this.C;\n t.aPosition.push(n, i, this.feaMinHeight || 0), t.aLinesofar.push(a), t.aUp.push(+o), \n t.aExtrudedPosition.push(h, u, 1), t.aExtrude.push(l, c), f && t.aColor.push(...this.feaColor), \n d && t.aLineWidth.push(Math.round(2 * this.feaLineWidth)), this.rt && t.aLineHeight.push(this.feaAltitude);\n }\n addElements(t, n, i) {\n const e = !1 !== this.options.top, r = !1 !== this.options.side, s = (e ? 1 : 0) + (r ? 4 : 0);\n if (t *= s, n *= s, this.data.aUp[this.offset + (i *= s) + 4]) {\n if (e && super.addElements(n, t, i), r) {\n const t = e ? 1 : 0;\n super.addElements(n + t, i + t, i + t + 2), super.addElements(n + t + 1, i + t + 1 + 2, n + t + 1 + 2);\n }\n } else if (e && super.addElements(t, i, n), r) {\n const n = e ? 1 : 0;\n super.addElements(t + n, t + n + 2, i + n), super.addElements(t + n + 1 + 2, i + n + 1 + 2, i + n + 1);\n }\n }\n createDataPack(t, n) {\n this.maxAltitude = 0;\n const i = super.createDataPack(t, n);\n if (!i) return i;\n const {data: e, indices: r} = i;\n this.getFormat().reduce((t, n) => (t[n.name] = {\n size: n.width\n }, t), {}).aPickingId = {\n size: 1\n };\n const {aExtrudedPosition: s, aPosition: o, aLinesofar: a, aUp: h, aExtrude: u, aColor: l, aLineHeight: c, aLineWidth: f} = e, d = {}, y = Xn(s, r);\n let v, p = !0;\n for (let t = 0; t < y.length; t++) y[t] = -y[t], y[t] % 1 != 0 && (p = !1);\n if (!1 !== this.options.top && this.symbol.material && function(t) {\n for (const n in t) if (n.indexOf("Texture") >= 0 && t[n]) return !0;\n return !1;\n }(this.symbol.material) && (v = function(t, n, i) {\n const e = [];\n for (let r = 0; r < t.length; r += 3) {\n const t = n[r / 3];\n e.push(t / 256, i[r / 3] ? 1 : 0);\n }\n return e;\n }(s, a, h)), d.aPosition = o, v && (d.aTexCoord0 = new Float32Array(v)), d.aNormal = p ? new Int8Array(y) : new Float32Array(y), \n d.aPickingId = e.aPickingId, d.aExtrude = u, l && (d.aColor = l), f && (d.aLineWidth = f), \n c) {\n const t = Wi(this.maxAltitude);\n d.aLineHeight = new t(c);\n }\n const m = [];\n for (const t in d) m.push(d[t].buffer);\n return i.data = d, i.buffers = m, i;\n }\n }\n const kr = Math.pow(2, 16) / 1;\n class Pr extends le {\n getFormat() {\n return [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n } ];\n }\n placeVector(t) {\n const n = t.feature, i = 3 === n.type, e = n.geometry, r = this.elements;\n i && (this.elements = []);\n for (let t = 0; t < e.length; t++) this.offset = this.data.aPosition.length / 3, \n this.K(e[t], n), i && (this.tt(r), this.elements = []);\n i && (this.elements = r);\n }\n K(t, n) {\n const i = 3 === n.type;\n let e = t.length;\n for (;e >= 2 && t[e - 1].equals(t[e - 2]); ) e--;\n let r, s, o, a = 0;\n for (;a < e - 1 && t[a].equals(t[a + 1]); ) a++;\n if (!(e < (i ? 3 : 2))) {\n this.distance = 0, this.vertexLength = 0, this.primitiveLength = 0, this.e1 = this.e2 = this.e3 = -1, \n i && (r = t[e - 2]);\n for (let n = a; n < e; n++) o = i && n === e - 1 ? t[a + 1] : t[n + 1], o && t[n].equals(o) || (r && (s = r), \n r = t[n], s && (this.distance += r.dist(s)), this.addCurrentVertex(r, this.distance));\n }\n }\n addCurrentVertex(t, n) {\n const i = this.vertexLength++;\n this.addLineVertex(this.data, t, n), i >= 1 && this.addElements(i - 1, i), n > kr && (this.distance = 0, \n this.addCurrentVertex(t, this.distance));\n }\n addLineVertex(t, n) {\n t.aPosition.push(n.x, n.y, 0), this.maxPos = Math.max(this.maxPos, Math.abs(n.x), Math.abs(n.y));\n }\n addElements(t, n) {\n super.addElements(this.offset + t, this.offset + n);\n }\n tt(t) {\n const n = this.options.EXTENT, i = this.elements;\n for (let e = 0; e < i.length; e += 2) ie(this.data.aPosition, i[e], i[e + 1], 3, n) || t.push(i[e], i[e + 1]);\n }\n }\n const Sr = 45 * Math.PI / 100;\n class _r extends le {\n getFormat() {\n return [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n } ];\n }\n placeVector(t) {\n const n = this.G(t, this.symbol.markerSpacing || 250, this.symbol.markerPlacement || "point"), i = this.getAltitude(t.feature.properties);\n for (let t = 0; t < n.length; t++) {\n const e = n[t];\n this.data.aPosition.push(e.x, e.y), this.data.aPosition.push(i);\n const r = Math.max(Math.abs(e.x), Math.abs(e.y));\n r > this.maxPos && (this.maxPos = r);\n }\n }\n G(t, n, i) {\n const e = t.feature, r = t.feature.type, s = this.options.EXTENT, o = [];\n if ("line" === i) {\n let t = e.geometry;\n s && (t = rr(e.geometry, 0, 0, s, s));\n for (let i = 0; i < t.length; i++) {\n const e = ar(t[i], n, Sr, null, null, 24, 1, 1, s || 1 / 0);\n o.push.apply(o, e);\n }\n } else if (3 === r) {\n const t = ur(e.geometry, 0);\n for (let n = 0; n < t.length; n++) {\n const i = fr(t[n], 16);\n se(i, s) || o.push(i);\n }\n } else if (2 === e.type) for (let t = 0; t < e.geometry.length; t++) {\n const n = e.geometry[t];\n se(n[0], s) || o.push(n[0]);\n } else if (1 === e.type) for (let t = 0; t < e.geometry.length; t++) {\n const n = e.geometry[t];\n for (let t = 0; t < n.length; t++) {\n const i = n[t];\n se(i, s) || o.push(i);\n }\n }\n return o;\n }\n hasElements() {\n return !1;\n }\n }\n /*!\n * from @turf/bboxClip\n * https://github.com/Turfjs/turf\n * MIT LICENSE\n */ const Or = [], Ir = [];\n function Tr(t, n) {\n var i, e, r, s, o, a, h;\n for (e = 1; e <= 8; e *= 2) {\n for (i = [], s = !(Ur(r = t[t.length - 1], n) & e), o = 0; o < t.length; o++) {\n if ((h = !(Ur(a = t[o], n) & e)) !== s) {\n const t = Lr(r, a, e, n);\n i.push(void 0 !== a.x ? new Ht(t[0], t[1]) : t);\n }\n h && i.push(a), r = a, s = h;\n }\n if (!(t = i).length) break;\n }\n return i;\n }\n function Lr(t, n, i, e) {\n return Or[0] = void 0 === t.x ? t[0] : t.x, Or[1] = void 0 === t.y ? t[1] : t.y, \n t = Or, Ir[0] = void 0 === n.x ? n[0] : n.x, Ir[1] = void 0 === n.y ? n[1] : n.y, \n n = Ir, 8 & i ? [ t[0] + (n[0] - t[0]) * (e[3] - t[1]) / (n[1] - t[1]), e[3] ] : 4 & i ? [ t[0] + (n[0] - t[0]) * (e[1] - t[1]) / (n[1] - t[1]), e[1] ] : 2 & i ? [ e[2], t[1] + (n[1] - t[1]) * (e[2] - t[0]) / (n[0] - t[0]) ] : 1 & i ? [ e[0], t[1] + (n[1] - t[1]) * (e[0] - t[0]) / (n[0] - t[0]) ] : null;\n }\n function Ur(t, n) {\n Or[0] = void 0 === t.x ? t[0] : t.x, Or[1] = void 0 === t.y ? t[1] : t.y;\n var i = 0;\n return (t = Or)[0] < n[0] ? i |= 1 : t[0] > n[2] && (i |= 2), t[1] < n[1] ? i |= 4 : t[1] > n[3] && (i |= 8), \n i;\n }\n class zr extends le {\n constructor(...t) {\n super(...t), this.lineElements = [];\n }\n createStyledVector(t, n, i, e, r) {\n const s = new he(t, n, i, e), o = s.getPolygonResource();\n return !this.options.atlas && o && (r[o] = [ 0, 0 ]), s;\n }\n getFormat() {\n const t = [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n } ], {polygonFillFn: n, polygonOpacityFn: i, uvScaleFn: e, uvOffsetFn: r} = this.C;\n if (this.iconAtlas) {\n const n = this.getIconAtlasMaxValue();\n t.push({\n type: n > 255 ? Uint16Array : Uint8Array,\n width: 4,\n name: "aTexInfo"\n });\n }\n return n && t.push({\n type: Uint8Array,\n width: 4,\n name: "aColor"\n }), i && t.push({\n type: Uint8Array,\n width: 1,\n name: "aOpacity"\n }), e && t.push({\n type: Uint16Array,\n width: 2,\n name: "aUVScale"\n }), r && t.push({\n type: Uint8Array,\n width: 2,\n name: "aUVOffset"\n }), t;\n }\n createDataPack(...t) {\n this.maxLineIndex = 0, this.lineElements = [];\n const n = super.createDataPack(...t);\n if (!n) return n;\n let i = this.lineElements;\n return i = new ($i(this.maxLineIndex))(this.lineElements), n.lineIndices = i, n.buffers.push(i.buffer), \n n;\n }\n placeVector(t, n) {\n const i = t.feature;\n this.at(i.geometry, i, n);\n }\n at(t, n) {\n let i, e, r, s;\n const {polygonFillFn: o, polygonOpacityFn: a, uvScaleFn: h, uvOffsetFn: u} = this.C, l = n.properties;\n o && (i = o(this.options.zoom, l) || [ 255, 255, 255, 255 ], m(i) ? i = [ 0, 0, 0, 0 ] : (i = Array.isArray(i) ? i.map(t => 255 * t) : Vn(i).array(), \n 3 === i.length && i.push(255))), a && (e = a(this.options.zoom, l), Ji(e) && (e = 1), \n e *= 255), h && (r = h(this.options.zoom, l), Ji(r) && (r = [ 1, 1 ]), r = [ 255 * r[0], 255 * r[1] ]), \n u && (s = u(this.options.zoom, l), Ji(s) && (s = [ 0, 0 ]), s = [ 255 * s[0], 255 * s[1] ]);\n const c = !!this.iconAtlas, f = ur(t, 500), d = this.getAltitude(l), y = [ 0, 0 ], v = [ 0, 0 ];\n if (c) {\n const {polygonPatternFileFn: t} = this.C, n = t ? t(null, l) : this.symbol.polygonPatternFile;\n if (this.iconAtlas.glyphMap[n]) {\n const t = this.iconAtlas.positions[n];\n y[0] = t.tl[0] + 1, y[1] = t.tl[1] + 1, v[0] = t.displaySize[0] - 3, v[1] = t.displaySize[1] - 3;\n }\n }\n const p = [ -1, -1, n.extent + 1, n.extent + 1 ];\n for (let t = 0; t < f.length; t++) {\n const n = f[t], o = this.data.aPosition.length / 3, a = [], h = [];\n for (let t = 0; t < n.length; t++) {\n let o = n[t];\n if (this.options.EXTENT !== 1 / 0 && (o = Tr(o, p)), 0 === o.length) continue;\n 0 !== t && h.push(a.length / 2);\n const u = this.lineElements.length;\n this.data.aPosition.push(o[0].x, o[0].y, d), c && this.data.aTexInfo.push(...y, ...v), \n void 0 !== i && this.data.aColor.push(...i), void 0 !== e && this.data.aOpacity.push(e), \n void 0 !== r && this.data.aUVScale.push(...r), void 0 !== s && this.data.aUVOffset.push(...s), \n this.maxPos = Math.max(this.maxPos, Math.abs(o[0].x), Math.abs(o[0].y)), this.addLineElements(u + o.length - 1, u), \n a.push(o[0].x), a.push(o[0].y);\n for (let t = 1; t < o.length; t++) this.data.aPosition.push(o[t].x, o[t].y, d), \n c && this.data.aTexInfo.push(...y, ...v), void 0 !== i && this.data.aColor.push(...i), \n void 0 !== e && this.data.aOpacity.push(e), void 0 !== r && this.data.aUVScale.push(...r), \n void 0 !== s && this.data.aUVOffset.push(...s), this.maxPos = Math.max(this.maxPos, Math.abs(o[t].x), Math.abs(o[t].y)), \n this.addLineElements(u + t - 1, u + t), a.push(o[t].x), a.push(o[t].y);\n }\n const u = ki(a, h);\n for (let t = 0; t < u.length; t += 3) this.addElements(o + u[t], o + u[t + 1], o + u[t + 2]);\n }\n }\n addLineElements(...t) {\n this.maxLineIndex = Math.max(this.maxLineIndex, ...t), this.lineElements.push(...t);\n }\n }\n var Dr = Object.freeze({\n __proto__: null,\n clipPolygon: Tr,\n calculateSignedArea: ne,\n getFeaAltitudeAndHeight: re,\n convertRTLText: tr\n });\n const Er = {\n polygonPatternFile: 1,\n markerFile: 1,\n markerPlacement: 1,\n markerSpacing: 1,\n textName: 1,\n textStyle: 1,\n textFaceName: 1,\n textWeight: 1,\n textPlacement: 1,\n textSpacing: 1,\n lineJoin: 1,\n lineCap: 1,\n linePatternFile: 1\n };\n Object.assign({\n visible: 1,\n textHorizontalAlignment: 1,\n textVerticalAlignment: 1,\n textWrapWidth: 1,\n markerHorizontalAlignment: 1,\n markerVerticalAlignment: 1\n }, Er), Object.assign({\n lineDasharray: 1\n }, Er);\n function Cr(t, n, i, e, r, s, o, a, h, u, l, c, f, d, y) {\n const v = n.length, p = r / 3;\n for (let i = 2, e = v; i < e; i += 3) t[r + i - 2] = n[i - 2], t[r + i - 1] = n[i - 1], \n t[r + i - 0] = n[i] - s;\n r += v;\n for (let i = 2, e = v; i < e; i += 3) t[r + i - 2] = n[i - 2], t[r + i - 1] = n[i - 1], \n t[r + i - 0] = n[i] - o;\n r += v;\n for (let i = 2, e = v; i < e; i += 3) t[r + i - 2] = n[i - 2], t[r + i - 1] = n[i - 1], \n t[r + i - 0] = n[i] - s;\n r += v;\n for (let i = 2, e = v; i < e; i += 3) t[r + i - 2] = n[i - 2], t[r + i - 1] = n[i - 1], \n t[r + i - 0] = n[i] - o;\n r += v, (i = i || []).push(v / 3);\n for (let n = 0; n < i.length; n++) {\n jr(p + (i[n - 1] || 0), p + i[n], t, v / 3, a, e, h, u, l, c, f, d, y);\n }\n return r;\n }\n function jr(t, n, i, e, r, s, o, a, h, u, l, c, f) {\n const d = s.length;\n let y, v;\n for (let o = t, a = n; o < a - 1; o++) y = o, v = o + 1, ct(i, y, v, r) || ((o - t) % 2 == 1 && (y += 2 * e, \n v += 2 * e), s.push(y + e, y, v), s.push(v, v + e, y + e));\n o && function(t, n, i, e, r, s, o, a, h) {\n let u, l = 0, c = 0, f = 0, d = 0;\n for (let y = e.length - 1; y >= 0; y--) {\n const v = 3 * e[y], p = 3 * e[y] + 1, m = 3 * e[y] + 2, g = i[v], w = i[p], M = i[m];\n l || c || (l = Math.max(i[m], i[3 * e[y - 2] + 2]), c = Math.min(i[m], i[3 * e[y - 2] + 2]), \n u = l - c);\n let b = f;\n const x = y % 6;\n 0 === t ? (5 === x && (d = Nt(i, e, y, g, w)), b = 2 === x || 3 === x || 4 === x ? f : f + d) : 1 === t && (2 === x || 3 === x || 4 === x ? b = 0 : 5 === x ? (d = Nt(i, e, y, g, w), \n b = d) : b = d);\n const F = b * o * a / r, A = M === l ? 0 : u * h / s;\n n[v / 3 * 2] = F, n[v / 3 * 2 + 1] = -A, 0 === x && (f += d);\n }\n }(a, h, i, s.slice(d, s.length), u[0], u[1], l, c, f);\n }\n function Nr(t, n, i, e, r, s, o, a, h, u) {\n void 0 === n.top && (n.top = !0), void 0 === n.side && (n.side = !0);\n const {altitudeScale: l, altitudeProperty: c, defaultAltitude: f, heightProperty: d, minHeightProperty: y, defaultHeight: v, tangent: p, uv: m, uvScale: M, topUVMode: b, sideUVMode: x, top: F, side: A, topThickness: k} = n, S = function(t, n, {altitudeScale: i, altitudeProperty: e, defaultAltitude: r, heightProperty: s, minHeightProperty: o, defaultHeight: a}, {side: h, top: u, topThickness: l, uvOrigin: c, uv: f, uvSize: d, topUVMode: y, sideUVMode: v, glScale: p, localScale: m, vScale: g}, w) {\n const M = n / t[0].extent, b = [], x = [], F = [], A = [], k = [], S = [], _ = !!f, O = !!u, T = !!h, z = _ ? [] : null;\n function D(t, i, e, r) {\n if (O) {\n const r = ki(A, e, 3);\n if (0 === r.length) return i;\n let s;\n I(k, A), i += A.length;\n for (let n = 2, i = r.length; n < i; n += 3) s = r[n - 1], r[n - 1] = r[n] + t / 3, \n r[n] = s + t / 3, r[n - 2] += t / 3;\n I(S, r), _ && Et(y || 0, t, i, z, k, 0, p, m, d[0], d[1]), l > 0 && !T && (i = Cr(k, A, e, S, i, 0, l, n, _, v || 0, z, d, p, m, g));\n }\n return T && (O && (l = 0), i = Cr(k, A, e, S, i, l, r, n, _, v || 0, z, d, p, m, g)), \n i;\n }\n let E = 0, C = 0;\n const j = [ -1, -1, n + 1, n + 1 ];\n let N = 0, H = t.length;\n void 0 !== w && (N = w, H = w + 1);\n let V = 0, R = !1;\n for (;N < H; N++) {\n const h = t[N], u = h.id;\n P(u) && (Math.abs(u) > V && (V = Math.abs(u)), u < 0 && (R = !0));\n const l = h.geometry, {altitude: c, height: f} = Dr.getFeaAltitudeAndHeight(h, i, e, r, s, a, o);\n E = Math.max(Math.abs(c), E);\n const d = k.length;\n let y = C, v = [];\n A.length = 0;\n for (let t = 0, i = l.length; t < i; t++) {\n const e = Dr.calculateSignedArea(l[t]) < 0;\n !e && t > 0 && (C = D(y, C, v, f * M), A.length = 0, v = [], y = C);\n let r = l[t];\n if (n !== 1 / 0 && (r = Dr.clipPolygon(r, j)), !r.length) {\n t === i - 1 && (C = D(y, C, v, f * M));\n continue;\n }\n const s = r.length;\n Array.isArray(r[0]) ? r[0][0] === r[s - 1][0] && r[0][1] === r[s - 1][1] || r.push([ r[0][0], r[0][1] ]) : r[0].x === r[s - 1].x && r[0].y === r[s - 1].y || r.push(r[0]), \n e && v.push(A.length / 3), lt(A, A.length, r, M, c), t === i - 1 && (C = D(y, C, v, f * M));\n }\n const p = k.length - d, m = "__fea_idx".trim();\n for (let t = 0; t < p / 3; t++) x.push(void 0 === h[m] ? N : h[m]), b.push(N), P(u) && F.push(u);\n }\n const $ = L(x.length ? x[x.length - 1] : 0), W = {\n maxAltitude: E,\n vertices: new (U(Math.max(512, E)))(k),\n indices: S,\n pickingIds: new $(x),\n featureIndexes: b\n };\n if (F.length) {\n const t = R ? U(V) : L(V);\n W.featureIds = new t(F);\n } else W.featureIds = [];\n return z && (z.length = k.length / 3 * 2, W.uvs = z), W;\n }(t, i, {\n altitudeScale: l,\n altitudeProperty: c,\n defaultAltitude: f || 0,\n heightProperty: d,\n minHeightProperty: y,\n defaultHeight: v || 0\n }, {\n top: F,\n side: A,\n topThickness: 10 * k || 0,\n uv: m || p,\n uvSize: M ? [ .5 * M[0], .5 * M[1] ] : [ .5, .5 ],\n uvOrigin: e,\n topUVMode: b,\n sideUVMode: x,\n glScale: r,\n localScale: o,\n vScale: s\n }, u), _ = [], O = new (T(S.vertices.length / 3))(S.indices);\n delete S.indices, _.push(O.buffer, S.vertices.buffer, S.pickingIds.buffer);\n const z = Xn(S.vertices, O);\n let E = !0;\n for (let t = 0; t < z.length; t++) z[t] = -z[t], z[t] % 1 != 0 && (E = !1);\n if (S.normals = z, p) {\n let t = function(t, n, i, e) {\n const r = t.length / 3, s = new Array(4 * r), o = [], a = [];\n for (let t = 0; t < r; t++) o[t] = [ 0, 0, 0 ], a[t] = [ 0, 0, 0 ];\n const h = [ 0, 0, 0 ], u = [ 0, 0, 0 ], l = [ 0, 0, 0 ], c = [ 0, 0 ], f = [ 0, 0 ], d = [ 0, 0 ], y = [ 0, 0, 0 ], v = [ 0, 0, 0 ];\n function p(n, e, r) {\n Zn(h, t, 3 * n), Zn(u, t, 3 * e), Zn(l, t, 3 * r), Yn(c, i, 2 * n), Yn(f, i, 2 * e), \n Yn(d, i, 2 * r);\n const s = u[0] - h[0], p = l[0] - h[0], m = u[1] - h[1], g = l[1] - h[1], w = u[2] - h[2], M = l[2] - h[2], b = f[0] - c[0], x = d[0] - c[0], F = f[1] - c[1], A = d[1] - c[1], k = 1 / (b * A - x * F);\n bt(y, (A * s - F * p) * k, (A * m - F * g) * k, (A * w - F * M) * k), bt(v, (b * p - x * s) * k, (b * g - x * m) * k, (b * M - x * w) * k), \n xt(o[n], o[n], y), xt(o[e], o[e], y), xt(o[r], o[r], y), xt(a[n], a[n], v), xt(a[e], a[e], v), \n xt(a[r], a[r], v);\n }\n for (let t = 0, n = e.length; t < n; t += 3) p(e[t + 0], e[t + 1], e[t + 2]);\n const m = [], g = [], w = [], M = [];\n let b, x, F;\n function A(t) {\n Zn(w, n, 3 * t), Mt(M, w), x = o[t], Mt(m, x), St(m, m, function(t, n, i) {\n return t[0] = n[0] * i, t[1] = n[1] * i, t[2] = n[2] * i, t;\n }(w, w, kt(w, x))), At(m, m), Pt(g, M, x), F = kt(g, a[t]), b = F < 0 ? -1 : 1, \n s[4 * t] = m[0], s[4 * t + 1] = m[1], s[4 * t + 2] = m[2], s[4 * t + 3] = b;\n }\n for (let t = 0, n = e.length; t < n; t += 3) A(e[t + 0]), A(e[t + 1]), A(e[t + 2]);\n return s;\n }(S.vertices, S.normals, S.uvs, O);\n t = function(t, n) {\n const i = new Float32Array(n.length), e = [], r = [], s = [];\n for (let o = 0; o < n.length; o += 4) {\n const a = o / 4 * 3;\n bt(r, t[a] || 0, t[a + 1] || 0, t[a + 2] || 0), Ot(e, n[o] || 0, n[o + 1] || 0, n[o + 2] || 0, n[o + 3] || 0), \n Jn(s, r, e), _t(i.subarray(o, o + 4), s);\n }\n return i;\n }(S.normals, t), S.tangents = t, _.push(t.buffer), delete S.normals;\n }\n if (S.normals && (S.normals = E ? new Int8Array(S.normals) : new Float32Array(S.normals), \n _.push(S.normals.buffer)), S.uvs) {\n const t = S.uvs;\n S.uvs = new Float32Array(t), _.push(S.uvs.buffer);\n }\n const C = function(t, n, i, e) {\n const r = {};\n if (D(n.polygonFill)) {\n const s = {}, o = w(n.polygonFill), a = new Uint8Array(4 * e.length);\n for (let n = 0; n < e.length; n++) {\n const r = t[e[n]], h = r.properties || {};\n h.$layer = r.layer, h.$type = r.type;\n let u = o(i, h);\n if (delete h.$layer, delete h.$type, Array.isArray(u) || (u = s[u] = s[u] || Vn(u).array()), \n Array.isArray(u)) {\n for (let t = 0; t < u.length; t++) Hr[t] = 255 * u[t];\n 3 === u.length && (Hr[3] = 255);\n }\n a[4 * n] = Hr[0], a[4 * n + 1] = Hr[1], a[4 * n + 2] = Hr[2], a[4 * n + 3] = Hr[3];\n }\n r.aColor = a;\n }\n if (D(n.polygonOpacity)) {\n const s = g(n.polygonOpacity), o = new Uint8Array(e.length);\n for (let n = 0; n < e.length; n++) {\n const r = t[e[n]], a = r.properties || {};\n a.$layer = r.layer, a.$type = r.type;\n const h = s(i, a);\n delete a.$layer, delete a.$type, o[n] = 255 * h;\n }\n r.aOpacity = o;\n }\n return r;\n }(t, a, h, S.featureIndexes), j = {\n data: {\n data: {\n aPosition: S.vertices,\n aNormal: S.normals,\n aTexCoord0: S.uvs,\n aTangent: S.tangents,\n aPickingId: S.pickingIds\n },\n indices: O,\n properties: {\n maxAltitude: S.maxAltitude\n }\n },\n buffers: _\n };\n return S.featureIds.length ? (j.data.featureIds = S.featureIds, _.push(j.data.featureIds.buffer)) : j.data.featureIds = [], \n C.aColor && (j.data.data.aColor = C.aColor, j.buffers.push(C.aColor.buffer)), C.aOpacity && (j.data.data.aOpacity = C.aOpacity, \n j.buffers.push(C.aOpacity.buffer)), j;\n }\n const Hr = [];\n function Vr(t, n, {altitudeScale: i, altitudeProperty: e, defaultAltitude: r, heightProperty: s, minHeightProperty: o, defaultHeight: a, bottom: h}) {\n const u = h, l = n / t[0].extent, c = 2 * function(t, n) {\n let i = 0;\n for (let e = 0, r = t.length; e < r; e++) {\n const r = t[e];\n if (P(r.geometry[0][0])) {\n const t = 3 * r.geometry.length;\n i += n ? 2 * t - 6 : t;\n } else for (let t = 0, e = r.geometry.length; t < e; t++) {\n let e = 3 * r.geometry[t].length;\n 3 === r.type && (e -= 3), i += n ? 2 * e - 6 : e;\n }\n }\n return i;\n }(t) + 3 * t.length * 2, f = [], d = new Int16Array(c), y = [];\n function v(t, i, e) {\n const r = i - t, s = d.subarray(t, i), o = d.subarray(i, i + r);\n o.set(s);\n for (let t = 2, n = o.length; t < n; t += 3) o[t] = s[t] - e;\n const a = t / 3, h = r / 3;\n let l, c;\n for (let t = a, i = h + a; t < i; t++) t < i - 1 ? (l = t, c = t + 1) : (l = t, \n c = a), ct(d, l, c, n) || (y.push(l, c), u && y.push(l + h, c + h), Rr(d, l, n) || y.push(l, l + h));\n return i + r;\n }\n let p = 0, m = 0;\n const g = "__fea_idx".trim();\n for (let n = 0, h = t.length; n < h; n++) {\n const h = t[n], u = h.geometry, {altitude: c, height: w} = Dr.getFeaAltitudeAndHeight(h, i, e, r, s, a, o);\n m = Math.max(Math.abs(c), m);\n let M = p;\n for (let t = 0, n = u.length; t < n; t++) {\n let n = u[t];\n const i = n.length;\n n[0][0] === n[i - 1][0] && n[0][1] === n[i - 1][1] && (n = n.slice(0, i - 1)), p = lt(d, M, n, l, c), \n p = v(M, p, w * l), M = p;\n }\n const b = y.length - f.length;\n for (let t = 0; t < b; t++) f.push(h[g]);\n }\n const w = new (T(y.reduce((t, n) => Math.max(t, n), 0)))(y), M = L(t.length);\n return {\n aPosition: new (U(Math.max(512, m)))(d),\n indices: w,\n aPickingId: new M(f)\n };\n }\n function Rr(t, n, i) {\n const e = t[3 * n], r = t[3 * n + 1];\n return e < 0 || e > i || r < 0 || r > i;\n }\n function $r(t, n, i) {\n const e = Vr(t, i, n), r = [ e.aPosition.buffer, e.indices.buffer, e.aPickingId.buffer ], s = e.indices;\n return delete e.indices, {\n data: {\n data: e,\n indices: s\n },\n buffers: r\n };\n }\n class Wr {\n constructor(t, n, i, e, r) {\n this.id = t, this.options = n, this.upload = i, this.ht(n.style), this.requests = {}, \n this.ut = 0, this.lt = e, this.loadings = r;\n }\n updateStyle(t, n) {\n this.options.style = t, this.ht(t), this.ut++, n();\n }\n updateOptions(t, n) {\n this.options = A(this.options, t), n();\n }\n loadTile(t, n) {\n const i = this.loadings, e = t.tileInfo.url, r = this.options.debugTile;\n if (r) {\n const {x: i, y: e, z: s} = t.tileInfo;\n if (s !== r.z || i !== r.x || e !== r.y) return void n();\n }\n if (this.lt.has(e)) {\n const {features: r, layers: s} = this.lt.get(e), o = i[e];\n if (delete i[e], !r || !r.length) return this.ct(o), void n();\n if (o) for (let n = 0; n < o.length; n++) this.ft.call(o[n].ref, t, o[n].callback, e, s, r);\n this.ft(t, n, e, s, r);\n } else i[e] ? i[e].push({\n callback: n,\n ref: this\n }) : (i[e] = [ {\n callback: n,\n ref: this\n } ], this.requests[e] = this.getTileFeatures(t.tileInfo, (n, r, s, o) => {\n const a = i[e];\n if (delete i[e], this.checkIfCanceled(e)) return delete this.requests[e], void this.ct(a, null, {\n canceled: !0\n });\n if (delete this.requests[e], this.options.debug && r) for (let n = 0; n < r.length; n++) r[n]._debug_info = {\n index: n,\n tileId: t.tileInfo.id\n };\n if (n) return n.loading || this.lt.add(e, {\n features: [],\n layers: []\n }), void this.ct(a, n);\n if (!r || !r.length) return this.lt.add(e, {\n features: [],\n layers: []\n }), void this.ct(a);\n if (this.lt.add(e, {\n features: r,\n layers: s\n }), a) for (let n = 0; n < a.length; n++) this.ft.call(a[n].ref, t, a[n].callback, e, s, r, o);\n }));\n }\n ft(t, n, i, e, r, s) {\n this.dt(e, r, t).then(t => {\n t.canceled ? n(null, {\n canceled: !0\n }) : (t.data.style = this.ut, s && A(t.data, s), n(null, t.data, t.buffers));\n }).catch(t => {\n n(t);\n });\n }\n abortTile(t, n) {\n delete this.requests[t], this.yt(t), n();\n }\n yt(t) {\n const n = this.loadings[t];\n if (n) for (let t = 0; t < n.length; t++) n[t].callback(null, {\n canceled: !0\n });\n delete this.loadings[t];\n }\n ct(t, n, i) {\n if (t) for (let e = 0; e < t.length; e++) t[e].callback(n, i);\n }\n checkIfCanceled(t) {\n return !this.requests[t];\n }\n fetchIconGlyphs(t, n, i) {\n this.upload("fetchIconGlyphs", {\n icons: t,\n glyphs: n\n }, null, i);\n }\n dt(t, n, {glScale: i, zScale: e, tileInfo: r}) {\n if (!n.length) return Promise.resolve({\n data: null,\n buffers: []\n });\n const s = !this.options.style.style.length && !this.options.style.featureStyle.length;\n let o = this.pluginConfig.slice(0);\n s && (o = this.vt(t)), this.featurePlugins && I(o, this.featurePlugins);\n const a = n[0].extent, h = r.z, u = {\n x: r.extent2d.xmin * i,\n y: r.extent2d.ymax * i\n }, l = [], c = [], f = [], d = this.options, y = [], v = {}, p = [ Promise.resolve(this.ut) ];\n let m = 0, g = -1;\n for (let t = 0; t < o.length; t++) {\n g++;\n const r = o[t];\n r.type !== m && (g = 0, m = r.type);\n const d = 0 === r.type ? l : c;\n if (r.symbol && !1 === r.symbol.visible) {\n d[g] = null;\n continue;\n }\n const {tileFeatures: w, tileFeaIndexes: M} = this.pt(r.type, r.filter, n, v, t);\n if (!w.length) {\n d[g] = null;\n continue;\n }\n const b = T(M[M.length - 1]);\n d[g] = {\n styledFeatures: new b(M)\n }, f.push({\n idx: t,\n typeIdx: g\n }), y.push(d[g].styledFeatures.buffer);\n let x = this.gt(w, r, {\n extent: a,\n tilePoint: u,\n glScale: i,\n zScale: e,\n zoom: h\n });\n s && (x = x.then(t => {\n if (!t) return null;\n if (t.data) t.data.layer = w[0].layer; else if (Array.isArray(t)) for (let n = 0; n < t.length; n++) t[n] && t[n].data && (t[n].data.layer = w[0].layer);\n return t;\n })), p.push(x);\n }\n return Promise.all(p).then(([i, ...e]) => {\n function r(t, n) {\n if (void 0 === t.data.ref && (t.data.type = o[f[n].idx].renderPlugin.dataConfig.type, \n t.data.filter = o[f[n].idx].filter.def, t.buffers && t.buffers.length)) for (let n = 0; n < t.buffers.length; n++) y.push(t.buffers[n]);\n }\n if (i !== this.ut) return {\n canceled: !0\n };\n for (let t = 0; t < e.length; t++) {\n if (!e[t]) continue;\n const n = e[t], i = 0 === o[f[t].idx].type ? l : c;\n if (Array.isArray(n)) {\n const e = [];\n for (let i = 0; i < n.length; i++) n[i] && (r(n[i], t), (void 0 === n[i].data.ref || n[n[i].data.ref]) && e.push(n[i].data));\n e.length && (i[f[t].typeIdx].data = e);\n } else r(n, t), i[f[t].typeIdx].data = n.data;\n }\n const s = {}, h = t;\n if (d.features || d.schema) {\n let t;\n for (let i = 0, e = n.length; i < e; i++) if (t = n[i], h[t.layer].properties || (h[t.layer].properties = Gr(t.properties)), \n d.features && t && v[i]) if ("id" === d.features) s[i] = t.id; else {\n const n = A({}, t);\n d.pickingGeometry || delete n.geometry, delete n.extent, delete n.properties.$layer, \n delete n.properties.$type, delete n.__index, s[i] = n;\n }\n }\n return {\n data: {\n schema: h,\n data: l,\n featureData: c,\n extent: a,\n features: s\n },\n buffers: y\n };\n });\n }\n gt(t, n, i) {\n const e = n.renderPlugin.dataConfig, r = n.symbol, s = this.options.tileSize[0], {extent: o, glScale: a, zScale: h, zoom: u, tilePoint: l} = i, c = o / s, f = e.type, d = this.options.debugTile && this.options.debugTile.index;\n if ("3d-extrusion" === f) {\n const n = Jr(r);\n return n && (e.uv = 1, 2 === n && (e.tangent = 1)), Promise.all([ Promise.resolve(Nr(t, e, o, l, a, h, this.options.tileSize[1] / o, r, u, d)) ]);\n }\n if ("3d-wireframe" === f) return Promise.all([ Promise.resolve($r(t, e, o)) ]);\n if ("point" === f) {\n const n = A({}, e, {\n EXTENT: o,\n requestor: this.fetchIconGlyphs.bind(this),\n zoom: u,\n debugIndex: d\n }), i = mr.splitPointSymbol(r);\n return mr.needMerge(i[0]) && (t = mr.mergeLineFeatures(t, i[0], u)), Promise.all(i.map(i => new mr(t, i, n).load(c)));\n }\n if ("native-point" === f) {\n const n = A({}, e, {\n EXTENT: o,\n zoom: u,\n debugIndex: d\n });\n return Xr(t, r, n, _r, o / s);\n }\n if ("line" === f) {\n const n = A({}, e, {\n EXTENT: o,\n requestor: this.fetchIconGlyphs.bind(this),\n tileRatio: c,\n zoom: u,\n debugIndex: d\n });\n return Xr(t, r, n, Mr);\n }\n if ("native-line" === f) {\n const n = A({}, e, {\n EXTENT: o,\n zoom: u,\n debugIndex: d\n });\n return Xr(t, r, n, Pr);\n }\n if ("fill" === f) {\n const n = A({}, e, {\n EXTENT: o,\n requestor: this.fetchIconGlyphs.bind(this),\n zoom: u,\n debugIndex: d\n });\n return Xr(t, r, n, zr);\n }\n if ("line-extrusion" === f) {\n delete r.lineGradientProperty, r.lineJoin = "miter", r.lineCap = "butt";\n const n = Jr(r);\n n && (e.uv = 1, 2 === n && (e.tangent = 1));\n const i = A({}, e, {\n EXTENT: o,\n tileSize: s,\n zScale: h,\n glScale: a,\n zoom: u,\n debugIndex: d\n });\n if (n) {\n const n = [];\n if (!1 !== e.top) {\n const e = A({}, i);\n e.side = !1, n.push(new Ar(t, r, e));\n }\n return !1 !== e.side && (i.side = !0, i.top = !1, n.push(new Ar(t, r, i))), Promise.all(n.map(t => t.load()));\n }\n return Promise.all([ new Ar(t, r, i).load() ]);\n }\n return Promise.resolve([]);\n }\n pt(t, n, i, e) {\n const r = "__fea_idx".trim(), s = [], o = [], a = i.length;\n for (let h = 0; h < a; h++) if ((1 === t || void 0 === i[h].id || !this.styledFeatures[i[h].id]) && ((!n.def || "default" === n.def) && !e[h] || !0 === n.def || Array.isArray(n.def) && n(i[h]))) {\n e[h] = 1;\n const n = A({}, i[h]);\n if (n[r] = h, o.push(n), s.push(h), 1 === t) break;\n }\n return {\n tileFeatures: o,\n tileFeaIndexes: s\n };\n }\n ht(t) {\n const {style: n, featureStyle: i} = t, e = {};\n i.forEach(t => {\n Array.isArray(t.id) ? (t.id.forEach(t => {\n e[t] = 1;\n }), t.filter = [ "in", "$id", ...t.id ]) : (e[t.id] = 1, t.filter = [ "==", "$id", t.id ]);\n });\n const r = z(n);\n for (let t = 0; t < n.length; t++) r[t].filter && (r[t].filter.def = n[t].filter ? n[t].filter.value || n[t].filter : void 0), \n r[t].type = 0;\n const s = [], o = z(i);\n for (let t = 0; t < i.length; t++) o[t].type = 1, o[t].filter.def = i[t].filter ? i[t].filter.value || i[t].filter : void 0, \n o[t].renderPlugin && s.push(o[t]);\n this.pluginConfig = r, this.featurePlugins = s, this.styledFeatures = e;\n }\n vt(t) {\n let n = this.wt;\n this.wt || (n = this.wt = {});\n const e = [ "", "Point", "LineString", "Polygon", "MultiPoint", "MultiLineString", "MultiPolygon" ], r = [];\n for (const s in t) {\n const o = s;\n if (!n[s]) {\n const r = [];\n for (let n = 0; n < t[s].types.length; n++) {\n const a = t[s].types[n], h = [ "all", [ "==", "$layer", o ], [ "==", "$type", e[a] ] ], u = {\n filter: i(h),\n renderPlugin: qr(a),\n symbol: Br(a)\n };\n u.filter.def = h, u.type = 0, r.push(u);\n }\n n[o] = r;\n }\n r.push(...n[o]);\n }\n return r;\n }\n }\n function qr(t) {\n switch (t) {\n case 1:\n return {\n type: "native-point",\n dataConfig: {\n type: "native-point",\n only2D: !0\n }\n };\n\n case 2:\n return {\n type: "native-line",\n dataConfig: {\n type: "native-line",\n only2D: !0\n }\n };\n\n case 3:\n return {\n type: "fill",\n dataConfig: {\n type: "fill",\n only2D: !0\n }\n };\n }\n return null;\n }\n function Br(t) {\n switch (t) {\n case 1:\n return {\n markerFill: "#f00",\n markerSize: 10\n };\n\n case 2:\n return {\n lineColor: "#fff"\n };\n\n case 3:\n return {\n polygonFill: "#00f",\n polygonOpacity: .4\n };\n }\n return null;\n }\n function Gr(t) {\n if (Array.isArray(t) || !_(t)) return {};\n const n = {};\n for (const i in t) {\n const e = t[i];\n k(e) ? n[i] = "string" : P(e) ? n[i] = "number" : !0 === e || !1 === e ? n[i] = "boolean" : Array.isArray(e) ? n[i] = "array" : n[i] = "object";\n }\n return n;\n }\n function Jr(t) {\n if (!t) return 0;\n let n = 0;\n for (const i in t) {\n if (("normalTexture" === i || "bumpTexture" === i) && t[i]) return 2;\n if (i.indexOf("Texture") > 0 && t[i]) n = 1; else if (_(t[i])) {\n const e = Jr(t[i]);\n if (2 === e) return e;\n 1 === e && (n = 1);\n }\n }\n return n;\n }\n function Xr(t, n, i, e, r) {\n const s = {}, o = Array.isArray(n) ? n : [ n ];\n let a = -1;\n for (let t = 0; t < o.length; t++) s[t] = Zr(o[t]), !s[t] && o[t] && -1 === a && (a = t);\n const h = [];\n for (let n = 0; n < o.length; n++) o[n] && (o[n].index = {\n index: n\n }, s[n] || n === a ? h.push(new e(t, o[n], i).load(r)) : h.push({\n data: {\n ref: a,\n symbolIndex: {\n index: n\n }\n }\n }));\n return Promise.all(h);\n }\n function Zr(t) {\n if (!t) return 0;\n for (const n in t) if (D(t[n])) return 1;\n return 0;\n }\n function Yr(t, n) {\n Kr(t.geometry, n);\n }\n function Kr(t, n) {\n if (t) switch (t.type) {\n case "Point":\n Qr(t.coordinates, n);\n break;\n\n case "MultiPoint":\n case "LineString":\n ts(t.coordinates, n);\n break;\n\n case "MultiLineString":\n case "Polygon":\n ns(t.coordinates, n);\n break;\n\n case "MultiPolygon":\n !function(t, n) {\n for (let i = 0; i < t.length; i++) ns(t[i], n);\n }(t.coordinates, n);\n break;\n\n case "GeometryCollection":\n for (let i = 0; i < t.geometries.length; i++) Kr(t.geometries[i], n);\n }\n }\n function Qr(t, n) {\n n[0] = Math.min(n[0], t[0]), n[1] = Math.min(n[1], t[1]), n[2] = Math.max(n[2], t[0]), \n n[3] = Math.max(n[3], t[1]);\n }\n function ts(t, n) {\n for (let i = 0; i < t.length; i++) Qr(t[i], n);\n }\n function ns(t, n) {\n for (let i = 0; i < t.length; i++) ts(t[i], n);\n }\n class is extends Wr {\n constructor(t, n, i, e, r, s) {\n super(t, n, i, e, r), (n = n || {}).extent || (n.extent = 8192), this.zoomOffset = 0, \n n.tileSize && (this.zoomOffset = -function(t) {\n if (Math.log2) return Math.log2(t);\n const n = Math.log(t) * Math.LOG2E, i = Math.round(n);\n return Math.abs(i - n) < 1e-14 ? i : n;\n }(n.tileSize[0] / 256)), this.setData(n.data, s);\n }\n setData(t, n) {\n if (delete this.index, !t) return void n();\n const i = {\n maxZoom: 24,\n tolerance: this.options.extent / this.options.tileSize[0] * 1,\n extent: this.options.extent,\n buffer: this.options.tileBuffer || 64,\n debug: 0,\n lineMetrics: !0,\n indexMaxZoom: 5,\n indexMaxPoints: 1e5\n };\n if (k(t) && "{" != t.substring(0, 1) || t.url) C.getJSON(t.url ? t.url : t, t.url ? t : {}, (t, e) => {\n if (t && n(t), !e) return void n(null, {\n extent: null,\n idMap: {}\n });\n const r = e, {first1000: s, idMap: o} = this.Mt(r);\n this.bt(s, o, r, i, n);\n }); else {\n "string" == typeof t && (t = JSON.parse(t));\n const e = Array.isArray(t) ? t : t.features;\n let r = e;\n e && e.length > 1e3 && (r = e.slice(0, 1e3)), this.bt(r, null, t, i, n);\n }\n }\n bt(t, n, i, e, r) {\n try {\n const s = t && t.length ? function(t) {\n let n = [ Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY ];\n switch (t.type) {\n case "FeatureCollection":\n for (let i = 0; i < t.features.length; i++) Yr(t.features[i], n);\n break;\n\n case "Feature":\n Yr(t, n);\n break;\n\n default:\n Kr(t, n);\n }\n return n;\n }({\n type: "FeatureCollection",\n features: t\n }) : null;\n this.index = function(t, n) {\n return new ht(t, n);\n }(i, this.options.geojsonvt || e), r(null, {\n extent: s,\n idMap: n\n });\n } catch (t) {\n console.warn(t), r({\n error: t.message\n });\n }\n }\n Mt(t) {\n const n = [], i = {};\n let e = 0;\n function r(t) {\n t && ("Feature" !== t.type || t.geometry) && (void 0 !== t.id && null !== t.id || (t.id = e++), \n i[t.id] = A({}, t), t.geometry ? (i[t.id].geometry = A({}, t.geometry), i[t.id].geometry.coordinates = null) : t.coordinates && (i[t.id].coordinates = null), \n n.length < 1e3 && n.push(t));\n }\n return Array.isArray(t) ? t.forEach(t => {\n r(t);\n }) : t.features && t.features.forEach(t => {\n r(t);\n }), {\n first1000: n,\n idMap: i\n };\n }\n getTileFeatures(t, n) {\n const i = [];\n if (!this.index) return setTimeout((function() {\n n({\n loading: !0\n });\n }), 1), 1;\n const e = this.index.getTile(t.z + this.zoomOffset, t.x, t.y);\n if (!e || 0 === e.features.length) return setTimeout((function() {\n n(null, i, []);\n }), 1), 1;\n const r = [];\n for (let t = 0, n = e.features.length; t < n; t++) {\n const n = e.features[t];\n let s = n.layer;\n void 0 === s && (s = "0"), r[s] = {\n types: {}\n };\n r[s].types[n.type] = 1, n.tags = n.tags || {}, i.push({\n type: n.type,\n layer: s,\n id: n.id,\n geometry: n.geometry,\n properties: n.tags,\n extent: this.options.extent\n });\n }\n for (const t in r) r[t].types = Object.keys(r[t].types).map(t => +t);\n return setTimeout((function() {\n n(null, i, r);\n }), 1), 1;\n }\n onRemove() {\n delete this.index;\n }\n }\n var es = {\n /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\n read: function(t, n, i, e, r) {\n var s, o, a = 8 * r - e - 1, h = (1 << a) - 1, u = h >> 1, l = -7, c = i ? r - 1 : 0, f = i ? -1 : 1, d = t[n + c];\n for (c += f, s = d & (1 << -l) - 1, d >>= -l, l += a; l > 0; s = 256 * s + t[n + c], \n c += f, l -= 8) ;\n for (o = s & (1 << -l) - 1, s >>= -l, l += e; l > 0; o = 256 * o + t[n + c], c += f, \n l -= 8) ;\n if (0 === s) s = 1 - u; else {\n if (s === h) return o ? NaN : 1 / 0 * (d ? -1 : 1);\n o += Math.pow(2, e), s -= u;\n }\n return (d ? -1 : 1) * o * Math.pow(2, s - e);\n },\n write: function(t, n, i, e, r, s) {\n var o, a, h, u = 8 * s - r - 1, l = (1 << u) - 1, c = l >> 1, f = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, d = e ? 0 : s - 1, y = e ? 1 : -1, v = n < 0 || 0 === n && 1 / n < 0 ? 1 : 0;\n for (n = Math.abs(n), isNaN(n) || n === 1 / 0 ? (a = isNaN(n) ? 1 : 0, o = l) : (o = Math.floor(Math.log(n) / Math.LN2), \n n * (h = Math.pow(2, -o)) < 1 && (o--, h *= 2), (n += o + c >= 1 ? f / h : f * Math.pow(2, 1 - c)) * h >= 2 && (o++, \n h /= 2), o + c >= l ? (a = 0, o = l) : o + c >= 1 ? (a = (n * h - 1) * Math.pow(2, r), \n o += c) : (a = n * Math.pow(2, c - 1) * Math.pow(2, r), o = 0)); r >= 8; t[i + d] = 255 & a, \n d += y, a /= 256, r -= 8) ;\n for (o = o << r | a, u += r; u > 0; t[i + d] = 255 & o, d += y, o /= 256, u -= 8) ;\n t[i + d - y] |= 128 * v;\n }\n }, rs = os, ss = es;\n function os(t) {\n this.buf = ArrayBuffer.isView && ArrayBuffer.isView(t) ? t : new Uint8Array(t || 0), \n this.pos = 0, this.type = 0, this.length = this.buf.length;\n }\n os.Varint = 0, os.Fixed64 = 1, os.Bytes = 2, os.Fixed32 = 5;\n var as = "undefined" == typeof TextDecoder ? null : new TextDecoder("utf8");\n function hs(t) {\n return t.type === os.Bytes ? t.readVarint() + t.pos : t.pos + 1;\n }\n function us(t, n, i) {\n return i ? 4294967296 * n + (t >>> 0) : 4294967296 * (n >>> 0) + (t >>> 0);\n }\n function ls(t, n, i) {\n var e = n <= 16383 ? 1 : n <= 2097151 ? 2 : n <= 268435455 ? 3 : Math.floor(Math.log(n) / (7 * Math.LN2));\n i.realloc(e);\n for (var r = i.pos - 1; r >= t; r--) i.buf[r + e] = i.buf[r];\n }\n function cs(t, n) {\n for (var i = 0; i < t.length; i++) n.writeVarint(t[i]);\n }\n function fs(t, n) {\n for (var i = 0; i < t.length; i++) n.writeSVarint(t[i]);\n }\n function ds(t, n) {\n for (var i = 0; i < t.length; i++) n.writeFloat(t[i]);\n }\n function ys(t, n) {\n for (var i = 0; i < t.length; i++) n.writeDouble(t[i]);\n }\n function vs(t, n) {\n for (var i = 0; i < t.length; i++) n.writeBoolean(t[i]);\n }\n function ps(t, n) {\n for (var i = 0; i < t.length; i++) n.writeFixed32(t[i]);\n }\n function ms(t, n) {\n for (var i = 0; i < t.length; i++) n.writeSFixed32(t[i]);\n }\n function gs(t, n) {\n for (var i = 0; i < t.length; i++) n.writeFixed64(t[i]);\n }\n function ws(t, n) {\n for (var i = 0; i < t.length; i++) n.writeSFixed64(t[i]);\n }\n function Ms(t, n) {\n return (t[n] | t[n + 1] << 8 | t[n + 2] << 16) + 16777216 * t[n + 3];\n }\n function bs(t, n, i) {\n t[i] = n, t[i + 1] = n >>> 8, t[i + 2] = n >>> 16, t[i + 3] = n >>> 24;\n }\n function xs(t, n) {\n return (t[n] | t[n + 1] << 8 | t[n + 2] << 16) + (t[n + 3] << 24);\n }\n os.prototype = {\n destroy: function() {\n this.buf = null;\n },\n readFields: function(t, n, i) {\n for (i = i || this.length; this.pos < i; ) {\n var e = this.readVarint(), r = e >> 3, s = this.pos;\n this.type = 7 & e, t(r, n, this), this.pos === s && this.skip(e);\n }\n return n;\n },\n readMessage: function(t, n) {\n return this.readFields(t, n, this.readVarint() + this.pos);\n },\n readFixed32: function() {\n var t = Ms(this.buf, this.pos);\n return this.pos += 4, t;\n },\n readSFixed32: function() {\n var t = xs(this.buf, this.pos);\n return this.pos += 4, t;\n },\n readFixed64: function() {\n var t = Ms(this.buf, this.pos) + 4294967296 * Ms(this.buf, this.pos + 4);\n return this.pos += 8, t;\n },\n readSFixed64: function() {\n var t = Ms(this.buf, this.pos) + 4294967296 * xs(this.buf, this.pos + 4);\n return this.pos += 8, t;\n },\n readFloat: function() {\n var t = ss.read(this.buf, this.pos, !0, 23, 4);\n return this.pos += 4, t;\n },\n readDouble: function() {\n var t = ss.read(this.buf, this.pos, !0, 52, 8);\n return this.pos += 8, t;\n },\n readVarint: function(t) {\n var n, i, e = this.buf;\n return n = 127 & (i = e[this.pos++]), i < 128 ? n : (n |= (127 & (i = e[this.pos++])) << 7, \n i < 128 ? n : (n |= (127 & (i = e[this.pos++])) << 14, i < 128 ? n : (n |= (127 & (i = e[this.pos++])) << 21, \n i < 128 ? n : function(t, n, i) {\n var e, r, s = i.buf;\n if (r = s[i.pos++], e = (112 & r) >> 4, r < 128) return us(t, e, n);\n if (r = s[i.pos++], e |= (127 & r) << 3, r < 128) return us(t, e, n);\n if (r = s[i.pos++], e |= (127 & r) << 10, r < 128) return us(t, e, n);\n if (r = s[i.pos++], e |= (127 & r) << 17, r < 128) return us(t, e, n);\n if (r = s[i.pos++], e |= (127 & r) << 24, r < 128) return us(t, e, n);\n if (r = s[i.pos++], e |= (1 & r) << 31, r < 128) return us(t, e, n);\n throw new Error("Expected varint not more than 10 bytes");\n }(n |= (15 & (i = e[this.pos])) << 28, t, this))));\n },\n readVarint64: function() {\n return this.readVarint(!0);\n },\n readSVarint: function() {\n var t = this.readVarint();\n return t % 2 == 1 ? (t + 1) / -2 : t / 2;\n },\n readBoolean: function() {\n return Boolean(this.readVarint());\n },\n readString: function() {\n var t = this.readVarint() + this.pos, n = this.pos;\n return this.pos = t, t - n >= 12 && as ? function(t, n, i) {\n return as.decode(t.subarray(n, i));\n }(this.buf, n, t) : function(t, n, i) {\n var e = "", r = n;\n for (;r < i; ) {\n var s, o, a, h = t[r], u = null, l = h > 239 ? 4 : h > 223 ? 3 : h > 191 ? 2 : 1;\n if (r + l > i) break;\n 1 === l ? h < 128 && (u = h) : 2 === l ? 128 == (192 & (s = t[r + 1])) && (u = (31 & h) << 6 | 63 & s) <= 127 && (u = null) : 3 === l ? (s = t[r + 1], \n o = t[r + 2], 128 == (192 & s) && 128 == (192 & o) && ((u = (15 & h) << 12 | (63 & s) << 6 | 63 & o) <= 2047 || u >= 55296 && u <= 57343) && (u = null)) : 4 === l && (s = t[r + 1], \n o = t[r + 2], a = t[r + 3], 128 == (192 & s) && 128 == (192 & o) && 128 == (192 & a) && ((u = (15 & h) << 18 | (63 & s) << 12 | (63 & o) << 6 | 63 & a) <= 65535 || u >= 1114112) && (u = null)), \n null === u ? (u = 65533, l = 1) : u > 65535 && (u -= 65536, e += String.fromCharCode(u >>> 10 & 1023 | 55296), \n u = 56320 | 1023 & u), e += String.fromCharCode(u), r += l;\n }\n return e;\n }(this.buf, n, t);\n },\n readBytes: function() {\n var t = this.readVarint() + this.pos, n = this.buf.subarray(this.pos, t);\n return this.pos = t, n;\n },\n readPackedVarint: function(t, n) {\n if (this.type !== os.Bytes) return t.push(this.readVarint(n));\n var i = hs(this);\n for (t = t || []; this.pos < i; ) t.push(this.readVarint(n));\n return t;\n },\n readPackedSVarint: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readSVarint());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readSVarint());\n return t;\n },\n readPackedBoolean: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readBoolean());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readBoolean());\n return t;\n },\n readPackedFloat: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readFloat());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readFloat());\n return t;\n },\n readPackedDouble: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readDouble());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readDouble());\n return t;\n },\n readPackedFixed32: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readFixed32());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readFixed32());\n return t;\n },\n readPackedSFixed32: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readSFixed32());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readSFixed32());\n return t;\n },\n readPackedFixed64: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readFixed64());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readFixed64());\n return t;\n },\n readPackedSFixed64: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readSFixed64());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readSFixed64());\n return t;\n },\n skip: function(t) {\n var n = 7 & t;\n if (n === os.Varint) for (;this.buf[this.pos++] > 127; ) ; else if (n === os.Bytes) this.pos = this.readVarint() + this.pos; else if (n === os.Fixed32) this.pos += 4; else {\n if (n !== os.Fixed64) throw new Error("Unimplemented type: " + n);\n this.pos += 8;\n }\n },\n writeTag: function(t, n) {\n this.writeVarint(t << 3 | n);\n },\n realloc: function(t) {\n for (var n = this.length || 16; n < this.pos + t; ) n *= 2;\n if (n !== this.length) {\n var i = new Uint8Array(n);\n i.set(this.buf), this.buf = i, this.length = n;\n }\n },\n finish: function() {\n return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length);\n },\n writeFixed32: function(t) {\n this.realloc(4), bs(this.buf, t, this.pos), this.pos += 4;\n },\n writeSFixed32: function(t) {\n this.realloc(4), bs(this.buf, t, this.pos), this.pos += 4;\n },\n writeFixed64: function(t) {\n this.realloc(8), bs(this.buf, -1 & t, this.pos), bs(this.buf, Math.floor(t * (1 / 4294967296)), this.pos + 4), \n this.pos += 8;\n },\n writeSFixed64: function(t) {\n this.realloc(8), bs(this.buf, -1 & t, this.pos), bs(this.buf, Math.floor(t * (1 / 4294967296)), this.pos + 4), \n this.pos += 8;\n },\n writeVarint: function(t) {\n (t = +t || 0) > 268435455 || t < 0 ? function(t, n) {\n var i, e;\n t >= 0 ? (i = t % 4294967296 | 0, e = t / 4294967296 | 0) : (e = ~(-t / 4294967296), \n 4294967295 ^ (i = ~(-t % 4294967296)) ? i = i + 1 | 0 : (i = 0, e = e + 1 | 0));\n if (t >= 0x10000000000000000 || t < -0x10000000000000000) throw new Error("Given varint doesn\'t fit into 10 bytes");\n n.realloc(10), function(t, n, i) {\n i.buf[i.pos++] = 127 & t | 128, t >>>= 7, i.buf[i.pos++] = 127 & t | 128, t >>>= 7, \n i.buf[i.pos++] = 127 & t | 128, t >>>= 7, i.buf[i.pos++] = 127 & t | 128, t >>>= 7, \n i.buf[i.pos] = 127 & t;\n }(i, 0, n), function(t, n) {\n var i = (7 & t) << 4;\n if (n.buf[n.pos++] |= i | ((t >>>= 3) ? 128 : 0), !t) return;\n if (n.buf[n.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;\n if (n.buf[n.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;\n if (n.buf[n.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;\n if (n.buf[n.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;\n n.buf[n.pos++] = 127 & t;\n }(e, n);\n }(t, this) : (this.realloc(4), this.buf[this.pos++] = 127 & t | (t > 127 ? 128 : 0), \n t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), \n t <= 127 || (this.buf[this.pos++] = t >>> 7 & 127))));\n },\n writeSVarint: function(t) {\n this.writeVarint(t < 0 ? 2 * -t - 1 : 2 * t);\n },\n writeBoolean: function(t) {\n this.writeVarint(Boolean(t));\n },\n writeString: function(t) {\n t = String(t), this.realloc(4 * t.length), this.pos++;\n var n = this.pos;\n this.pos = function(t, n, i) {\n for (var e, r, s = 0; s < n.length; s++) {\n if ((e = n.charCodeAt(s)) > 55295 && e < 57344) {\n if (!r) {\n e > 56319 || s + 1 === n.length ? (t[i++] = 239, t[i++] = 191, t[i++] = 189) : r = e;\n continue;\n }\n if (e < 56320) {\n t[i++] = 239, t[i++] = 191, t[i++] = 189, r = e;\n continue;\n }\n e = r - 55296 << 10 | e - 56320 | 65536, r = null;\n } else r && (t[i++] = 239, t[i++] = 191, t[i++] = 189, r = null);\n e < 128 ? t[i++] = e : (e < 2048 ? t[i++] = e >> 6 | 192 : (e < 65536 ? t[i++] = e >> 12 | 224 : (t[i++] = e >> 18 | 240, \n t[i++] = e >> 12 & 63 | 128), t[i++] = e >> 6 & 63 | 128), t[i++] = 63 & e | 128);\n }\n return i;\n }(this.buf, t, this.pos);\n var i = this.pos - n;\n i >= 128 && ls(n, i, this), this.pos = n - 1, this.writeVarint(i), this.pos += i;\n },\n writeFloat: function(t) {\n this.realloc(4), ss.write(this.buf, t, this.pos, !0, 23, 4), this.pos += 4;\n },\n writeDouble: function(t) {\n this.realloc(8), ss.write(this.buf, t, this.pos, !0, 52, 8), this.pos += 8;\n },\n writeBytes: function(t) {\n var n = t.length;\n this.writeVarint(n), this.realloc(n);\n for (var i = 0; i < n; i++) this.buf[this.pos++] = t[i];\n },\n writeRawMessage: function(t, n) {\n this.pos++;\n var i = this.pos;\n t(n, this);\n var e = this.pos - i;\n e >= 128 && ls(i, e, this), this.pos = i - 1, this.writeVarint(e), this.pos += e;\n },\n writeMessage: function(t, n, i) {\n this.writeTag(t, os.Bytes), this.writeRawMessage(n, i);\n },\n writePackedVarint: function(t, n) {\n n.length && this.writeMessage(t, cs, n);\n },\n writePackedSVarint: function(t, n) {\n n.length && this.writeMessage(t, fs, n);\n },\n writePackedBoolean: function(t, n) {\n n.length && this.writeMessage(t, vs, n);\n },\n writePackedFloat: function(t, n) {\n n.length && this.writeMessage(t, ds, n);\n },\n writePackedDouble: function(t, n) {\n n.length && this.writeMessage(t, ys, n);\n },\n writePackedFixed32: function(t, n) {\n n.length && this.writeMessage(t, ps, n);\n },\n writePackedSFixed32: function(t, n) {\n n.length && this.writeMessage(t, ms, n);\n },\n writePackedFixed64: function(t, n) {\n n.length && this.writeMessage(t, gs, n);\n },\n writePackedSFixed64: function(t, n) {\n n.length && this.writeMessage(t, ws, n);\n },\n writeBytesField: function(t, n) {\n this.writeTag(t, os.Bytes), this.writeBytes(n);\n },\n writeFixed32Field: function(t, n) {\n this.writeTag(t, os.Fixed32), this.writeFixed32(n);\n },\n writeSFixed32Field: function(t, n) {\n this.writeTag(t, os.Fixed32), this.writeSFixed32(n);\n },\n writeFixed64Field: function(t, n) {\n this.writeTag(t, os.Fixed64), this.writeFixed64(n);\n },\n writeSFixed64Field: function(t, n) {\n this.writeTag(t, os.Fixed64), this.writeSFixed64(n);\n },\n writeVarintField: function(t, n) {\n this.writeTag(t, os.Varint), this.writeVarint(n);\n },\n writeSVarintField: function(t, n) {\n this.writeTag(t, os.Varint), this.writeSVarint(n);\n },\n writeStringField: function(t, n) {\n this.writeTag(t, os.Bytes), this.writeString(n);\n },\n writeFloatField: function(t, n) {\n this.writeTag(t, os.Fixed32), this.writeFloat(n);\n },\n writeDoubleField: function(t, n) {\n this.writeTag(t, os.Fixed64), this.writeDouble(n);\n },\n writeBooleanField: function(t, n) {\n this.writeVarintField(t, Boolean(n));\n }\n };\n var Fs = Ht, As = ks;\n function ks(t, n, i, e, r) {\n this.properties = {}, this.extent = i, this.type = 0, this.xt = t, this.Ft = -1, \n this.At = e, this.kt = r, t.readFields(Ps, this, n);\n }\n function Ps(t, n, i) {\n 1 == t ? n.id = i.readVarint() : 2 == t ? function(t, n) {\n var i = t.readVarint() + t.pos;\n for (;t.pos < i; ) {\n var e = n.At[t.readVarint()], r = n.kt[t.readVarint()];\n n.properties[e] = r;\n }\n }(i, n) : 3 == t ? n.type = i.readVarint() : 4 == t && (n.Ft = i.pos);\n }\n function Ss(t) {\n for (var n, i, e = 0, r = 0, s = t.length, o = s - 1; r < s; o = r++) n = t[r], \n e += ((i = t[o]).x - n.x) * (n.y + i.y);\n return e;\n }\n ks.types = [ "Unknown", "Point", "LineString", "Polygon" ], ks.prototype.loadGeometry = function() {\n var t = this.xt;\n t.pos = this.Ft;\n for (var n, i = t.readVarint() + t.pos, e = 1, r = 0, s = 0, o = 0, a = []; t.pos < i; ) {\n if (r <= 0) {\n var h = t.readVarint();\n e = 7 & h, r = h >> 3;\n }\n if (r--, 1 === e || 2 === e) s += t.readSVarint(), o += t.readSVarint(), 1 === e && (n && a.push(n), \n n = []), n.push(new Fs(s, o)); else {\n if (7 !== e) throw new Error("unknown command " + e);\n n && n.push(n[0].clone());\n }\n }\n return n && a.push(n), a;\n }, ks.prototype.bbox = function() {\n var t = this.xt;\n t.pos = this.Ft;\n for (var n = t.readVarint() + t.pos, i = 1, e = 0, r = 0, s = 0, o = 1 / 0, a = -1 / 0, h = 1 / 0, u = -1 / 0; t.pos < n; ) {\n if (e <= 0) {\n var l = t.readVarint();\n i = 7 & l, e = l >> 3;\n }\n if (e--, 1 === i || 2 === i) (r += t.readSVarint()) < o && (o = r), r > a && (a = r), \n (s += t.readSVarint()) < h && (h = s), s > u && (u = s); else if (7 !== i) throw new Error("unknown command " + i);\n }\n return [ o, h, a, u ];\n }, ks.prototype.toGeoJSON = function(t, n, i) {\n var e, r, s = this.extent * Math.pow(2, i), o = this.extent * t, a = this.extent * n, h = this.loadGeometry(), u = ks.types[this.type];\n function l(t) {\n for (var n = 0; n < t.length; n++) {\n var i = t[n], e = 180 - 360 * (i.y + a) / s;\n t[n] = [ 360 * (i.x + o) / s - 180, 360 / Math.PI * Math.atan(Math.exp(e * Math.PI / 180)) - 90 ];\n }\n }\n switch (this.type) {\n case 1:\n var c = [];\n for (e = 0; e < h.length; e++) c[e] = h[e][0];\n l(h = c);\n break;\n\n case 2:\n for (e = 0; e < h.length; e++) l(h[e]);\n break;\n\n case 3:\n for (h = function(t) {\n var n = t.length;\n if (n <= 1) return [ t ];\n for (var i, e, r = [], s = 0; s < n; s++) {\n var o = Ss(t[s]);\n 0 !== o && (void 0 === e && (e = o < 0), e === o < 0 ? (i && r.push(i), i = [ t[s] ]) : i.push(t[s]));\n }\n i && r.push(i);\n return r;\n }(h), e = 0; e < h.length; e++) for (r = 0; r < h[e].length; r++) l(h[e][r]);\n }\n 1 === h.length ? h = h[0] : u = "Multi" + u;\n var f = {\n type: "Feature",\n geometry: {\n type: u,\n coordinates: h\n },\n properties: this.properties\n };\n return "id" in this && (f.id = this.id), f;\n };\n var _s = As, Os = Is;\n function Is(t, n) {\n this.version = 1, this.name = null, this.extent = 4096, this.length = 0, this.xt = t, \n this.At = [], this.kt = [], this.Pt = [], t.readFields(Ts, this, n), this.length = this.Pt.length;\n }\n function Ts(t, n, i) {\n 15 === t ? n.version = i.readVarint() : 1 === t ? n.name = i.readString() : 5 === t ? n.extent = i.readVarint() : 2 === t ? n.Pt.push(i.pos) : 3 === t ? n.At.push(i.readString()) : 4 === t && n.kt.push(function(t) {\n var n = null, i = t.readVarint() + t.pos;\n for (;t.pos < i; ) {\n var e = t.readVarint() >> 3;\n n = 1 === e ? t.readString() : 2 === e ? t.readFloat() : 3 === e ? t.readDouble() : 4 === e ? t.readVarint64() : 5 === e ? t.readVarint() : 6 === e ? t.readSVarint() : 7 === e ? t.readBoolean() : null;\n }\n return n;\n }(i));\n }\n Is.prototype.feature = function(t) {\n if (t < 0 || t >= this.Pt.length) throw new Error("feature index out of bounds");\n this.xt.pos = this.Pt[t];\n var n = this.xt.readVarint() + this.xt.pos;\n return new _s(this.xt, n, this.extent, this.At, this.kt);\n };\n var Ls = Os;\n function Us(t, n, i) {\n if (3 === t) {\n var e = new Ls(i, i.readVarint() + i.pos);\n e.length && (n[e.name] = e);\n }\n }\n var zs = function(t, n) {\n this.layers = t.readFields(Us, {}, n);\n };\n class Ds extends Wr {\n constructor(t, n, i, e, r, s) {\n super(t, n, i, e, r), n = n || {}, s();\n }\n getTileFeatures(t, n) {\n const i = t.url;\n return C.getArrayBuffer(i, (t, i) => {\n if (t) return void n(t);\n const e = new zs(new rs(i.data)), r = [];\n if (!e.layers) return void n(null, r, []);\n const s = {};\n let o;\n for (const n in e.layers) if (a = e.layers, h = n, Object.prototype.hasOwnProperty.call(a, h)) {\n s[n] = {\n types: {}\n };\n const i = s[n].types;\n for (let s = 0, a = e.layers[n].length; s < a; s++) try {\n o = e.layers[n].feature(s), i[o.type] = 1, r.push({\n type: o.type,\n layer: n,\n geometry: o.loadGeometry(),\n properties: o.properties,\n extent: o.extent\n });\n } catch (t) {\n console.warn("error when load vt geometry:", t);\n }\n }\n var a, h;\n for (const t in s) s[t].types = Object.keys(s[t].types).map(t => +t);\n n(null, r, s, {\n byteLength: i.data.byteLength\n });\n });\n }\n abortTile(t, n) {\n const i = this.requests[t];\n delete this.requests[t], i && i.abort && i.abort(), this.yt(t), n();\n }\n onRemove() {\n for (const t in this.requests) this.requests[t].abort();\n this.requests = {};\n }\n }\n let Es = 0;\n const Cs = new class {\n constructor(t) {\n this.max = t, this.reset();\n }\n reset() {\n return this.data = {}, this.order = [], this;\n }\n clear() {\n this.reset();\n }\n add(t, n) {\n return this.has(t) ? (this.order.splice(this.order.indexOf(t), 1), this.data[t] = n, \n this.order.push(t)) : (this.data[t] = n, this.order.push(t), this.order.length > this.max && this.getAndRemove(this.order[0])), \n this;\n }\n has(t) {\n return t in this.data;\n }\n keys() {\n return this.order;\n }\n getAndRemove(t) {\n if (!this.has(t)) return null;\n const n = this.data[t];\n return delete this.data[t], this.order.splice(this.order.indexOf(t), 1), n;\n }\n get(t) {\n return this.has(t) ? this.data[t] : null;\n }\n remove(t) {\n return this.has(t) ? (delete this.data[t], this.order.splice(this.order.indexOf(t), 1), \n this) : this;\n }\n setMaxSize(t) {\n for (this.max = t; this.order.length > this.max; ) this.getAndRemove(this.order[0]);\n return this;\n }\n }(128), js = {};\n class Ns {\n constructor(t) {\n this.St = {}, this._t = {}, this.workerId = t;\n }\n addLayer({actorId: t, mapId: n, layerId: i, params: e}, r) {\n if (this.Ot(n, i)) return;\n const s = this.It(n, i), o = e.type, a = e.options, h = this.send.bind(this, t);\n this.St[s] = "GeoJSONVectorTileLayer" === o ? new is(i, a, h, Cs, js, r) : new Ds(i, a, h, Cs, js, r);\n }\n removeLayer({mapId: t, layerId: n}, i) {\n const e = this.Ot(t, n), r = this.It(t, n);\n delete this.St[r], e && (e.onRemove(i), this.Tt());\n }\n loadTile({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && r.loadTile(i, e);\n }\n abortTile({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && r.abortTile && r.abortTile(i.url, e);\n }\n removeTile({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && r.removeTile(i, e);\n }\n updateStyle({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && (r.updateStyle(i, e), this.Tt());\n }\n updateOptions({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && (r.updateOptions(i, e), this.Tt());\n }\n setData({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && (r.setData(i.data, e), this.Tt());\n }\n receive(t) {\n const n = t.callback, i = this._t[n];\n delete this._t[n], i && t.error ? i(new Error(t.error)) : i && i(null, t.data);\n }\n send(t, n, i, e, r) {\n const s = r ? `${t}-${Es++}` : null;\n r && (this._t[s] = r), postMessage({\n type: "<request>",\n workerId: this.workerId,\n actorId: t,\n command: n,\n params: i,\n callback: String(s)\n }, e || []);\n }\n It(t, n) {\n return `${t}-${n}`;\n }\n Ot(t, n) {\n const i = this.It(t, n);\n return this.St[i];\n }\n Tt() {\n const t = Object.keys(js);\n for (let n = 0; n < t.length; n++) delete js[t[n]];\n Cs.reset();\n }\n }\n t.initialize = function() {}, t.onmessage = function(t, n) {\n const i = t.data;\n if (this.dispatcher || (this.dispatcher = new Ns(t.workerId)), "<response>" === t.type) this.dispatcher.workerId === t.workerId && this.dispatcher.receive(t); else {\n const e = i.command;\n this.dispatcher[e]({\n actorId: t.actorId,\n mapId: i.mapId,\n layerId: i.layerId,\n params: i.params\n }, (t, i, r) => {\n t && console.error(e, t), n(t, i, r);\n });\n }\n }, Object.defineProperty(t, "Lt", {\n value: !0\n });\n}';
|
|
25
|
+
const o = 'function(t) {\n /*!\n Feature Filter by\n\n (c) mapbox 2016 and maptalks 2018\n www.mapbox.com | www.maptalks.org\n License: MIT, header required.\n */\n const n = [ "Unknown", "Point", "LineString", "Polygon", "MultiPoint", "MultiLineString", "MultiPolygon", "GeometryCollection" ];\n function i(t) {\n return new Function("f", "var p = (f && f.properties || {}); return " + e(t));\n }\n function e(t) {\n if (!t) return "true";\n const n = t[0];\n if (t.length <= 1) return "any" === n ? "false" : "true";\n return `(${"==" === n ? s(t[1], t[2], "===", !1) : "!=" === n ? s(t[1], t[2], "!==", !1) : "<" === n || ">" === n || "<=" === n || ">=" === n ? s(t[1], t[2], n, !0) : "any" === n ? o(t.slice(1), "||") : "all" === n ? o(t.slice(1), "&&") : "none" === n ? u(o(t.slice(1), "||")) : "in" === n ? a(t[1], t.slice(2)) : "!in" === n ? u(a(t[1], t.slice(2))) : "has" === n ? h(t[1]) : "!has" === n ? u(h(t[1])) : "true"})`;\n }\n function r(t) {\n return "$" === t[0] ? "f." + t.substring(1) : "p[" + JSON.stringify(t) + "]";\n }\n function s(t, i, e, s) {\n const o = r(t), a = "$type" === t ? n.indexOf(i) : JSON.stringify(i);\n return (s ? `typeof ${o}=== typeof ${a}&&` : "") + o + e + a;\n }\n function o(t, n) {\n return t.map(e).join(n);\n }\n function a(t, i) {\n "$type" === t && (i = i.map(t => n.indexOf(t)));\n const e = JSON.stringify(i.sort(l)), s = r(t);\n return i.length <= 200 ? `${e}.indexOf(${s}) !== -1` : `function(v, a, i, j) {\\n while (i <= j) { var m = (i + j) >> 1;\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\n }\\n return false; }(${s}, ${e},0,${i.length - 1})`;\n }\n function h(t) {\n return "$id" === t ? \'"id" in f\' : JSON.stringify(t) + " in p";\n }\n function u(t) {\n return `!(${t})`;\n }\n function l(t, n) {\n return t < n ? -1 : t > n ? 1 : 0;\n }\n function c(t) {\n for (let n = 1; n < arguments.length; n++) {\n const i = arguments[n];\n for (const n in i) t[n] = i[n];\n }\n return t;\n }\n function f(t, n) {\n for (let i = 0; i < t.stops.length; i++) if (n === t.stops[i][0]) return t.stops[i][1];\n return t.default;\n }\n function d(t, n) {\n for (var i = 0; i < t.stops.length && !(n < t.stops[i][0]); i++) ;\n return t.stops[Math.max(i - 1, 0)][1];\n }\n function y(t, n) {\n for (var i = void 0 !== t.base ? t.base : 1, e = 0; !(e >= t.stops.length || n <= t.stops[e][0]); ) e++;\n return 0 === e ? t.stops[e][1] : e === t.stops.length ? t.stops[e - 1][1] : function t(n, i, e, r, s, o) {\n return "function" == typeof s ? function() {\n var a = s.apply(void 0, arguments), h = o.apply(void 0, arguments);\n return t(n, i, e, r, a, h);\n } : s.length ? function(t, n, i, e, r, s) {\n var o = [];\n for (let a = 0; a < r.length; a++) o[a] = p(t, n, i, e, r[a], s[a]);\n return o;\n }(n, i, e, r, s, o) : p(n, i, e, r, s, o);\n }(n, i, t.stops[e - 1][0], t.stops[e][0], t.stops[e - 1][1], t.stops[e][1]);\n }\n function v(t, n) {\n return function(t, n, i) {\n return void 0 !== t ? t : void 0 !== n ? n : void 0 !== i ? i : null;\n }(n, t.default);\n }\n function p(t, n, i, e, r, s) {\n var o, a = e - i, h = t - i;\n return r * (1 - (o = 1 === n ? h / a : (Math.pow(n, h) - 1) / (Math.pow(n, a) - 1))) + s * o;\n }\n function m(t) {\n return t && "object" == typeof t && (t.stops || t.property && "identity" === t.type);\n }\n function g(t) {\n return b(t, "exponential");\n }\n function w(t) {\n return b(t, "interval");\n }\n function M(t, n) {\n if (!t) return null;\n var i = !1;\n if (Array.isArray(t)) {\n var e, r = [];\n for (let s = 0; s < t.length; s++) (e = M(t[s], n)) ? (r.push(e), i = !0) : r.push(t[s]);\n return i ? r : t;\n }\n var s, o = {\n __fn_types_loaded: !0\n }, a = [];\n for (s in t) t.hasOwnProperty(s) && a.push(s);\n const h = function(t) {\n Object.defineProperty(o, t, {\n get: function() {\n return this["__fn_" + t] || (this["__fn_" + t] = g(this["_" + t])), this["__fn_" + t].apply(this, n());\n },\n set: function(n) {\n this["_" + t] = n;\n },\n configurable: !0,\n enumerable: !0\n });\n };\n for (let n = 0, e = a.length; n < e; n++) m(t[s = a[n]]) ? (i = !0, o["_" + s] = t[s], \n h(s)) : o[s] = t[s];\n return i ? o : t;\n }\n function b(t, n) {\n if (!m(t)) return function() {\n return t;\n };\n let i = !0, e = !0;\n const r = (t = JSON.parse(JSON.stringify(t))).stops;\n if (r) for (let t = 0; t < r.length; t++) if (m(r[t][1])) {\n const s = b(r[t][1], n);\n i = i && s.isZoomConstant, e = e && s.isFeatureConstant, r[t] = [ r[t][0], s ];\n }\n const s = function t(n, i) {\n var e, r, s;\n if (m(n)) {\n var o, a = n.stops && "object" == typeof n.stops[0][0], h = a || void 0 !== n.property, u = a || !h, l = n.type || i || "exponential";\n if ("exponential" === l) o = y; else if ("interval" === l) o = d; else if ("categorical" === l) o = f; else {\n if ("identity" !== l) throw new Error(\'Unknown function type "\' + l + \'"\');\n o = v;\n }\n if (a) {\n var c = {}, p = [];\n for (let t = 0; t < n.stops.length; t++) {\n var g = n.stops[t];\n void 0 === c[g[0].zoom] && (c[g[0].zoom] = {\n zoom: g[0].zoom,\n type: n.type,\n property: n.property,\n default: n.default,\n stops: []\n }), c[g[0].zoom].stops.push([ g[0].value, g[1] ]);\n }\n for (let n in c) p.push([ c[n].zoom, t(c[n]) ]);\n e = function(t, i) {\n const e = y({\n stops: p,\n base: n.base\n }, t)(t, i);\n return "function" == typeof e ? e(t, i) : e;\n }, r = !1, s = !1;\n } else u ? (e = function(t) {\n const i = o(n, t);\n return "function" == typeof i ? i(t) : i;\n }, r = !0, s = !1) : (e = function(t, i) {\n const e = o(n, i ? i[n.property] : null);\n return "function" == typeof e ? e(t, i) : e;\n }, r = !1, s = !0);\n } else e = function() {\n return n;\n }, r = !0, s = !0;\n return e.isZoomConstant = s, e.isFeatureConstant = r, e;\n }(t, n);\n return s.isZoomConstant = i && s.isZoomConstant, s.isFeatureConstant = e && s.isFeatureConstant, \n s;\n }\n let x = 0;\n const F = "function" == typeof Object.assign;\n function A(t, ...n) {\n if (F) return Object.assign(t, ...n), t;\n for (let i = 0; i < n.length; i++) {\n const e = n[i];\n for (const n in e) t[n] = e[n];\n }\n return t;\n }\n function k(t) {\n return !O(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);\n }\n function P(t) {\n return "number" == typeof t && !isNaN(t);\n }\n function S(t) {\n return !O(t) && ("function" == typeof t || null !== t.constructor && t.constructor === Function);\n }\n function _(t) {\n return !Array.isArray(t) && "object" == typeof t && !!t;\n }\n function O(t) {\n return null == t;\n }\n function I(t) {\n for (let n = 1; n < arguments.length; n++) {\n const i = arguments[n];\n if (i) for (let n = 0, e = i.length; n < e; n++) t.push(i[n]);\n }\n return t.length;\n }\n function T(t) {\n return t < 65536 ? Uint16Array : Uint32Array;\n }\n function L(t) {\n return t < 256 ? Uint8Array : t < 65536 ? Uint16Array : Uint32Array;\n }\n function U(t) {\n return (t = Math.abs(t)) < 128 ? Int8Array : t < 32768 ? Int16Array : Float32Array;\n }\n function z(t) {\n return function t(n) {\n if (!Array.isArray(n)) return t([ n ]);\n const e = [];\n for (let t = 0; t < n.length; t++) {\n let r;\n r = !0 === n[t].filter ? function() {\n return !0;\n } : i(n[t].filter), e.push(c({}, n[t], {\n filter: r\n }));\n }\n return e;\n }(t = t.map(t => {\n const n = A({}, t);\n return n.filter && n.filter.value && (n.filter = n.filter.value), n;\n }));\n }\n function D(t) {\n return m(t) && t.property;\n }\n const E = "function" == typeof fetch && "function" == typeof AbortController, C = {\n jsonp: function(t, n) {\n const i = "_maptalks_jsonp_" + x++;\n t.match(/\\?/) ? t += "&callback=" + i : t += "?callback=" + i;\n let e = document.createElement("script");\n return e.type = "text/javascript", e.src = t, window[i] = function(t) {\n n(null, t), document.getElementsByTagName("head")[0].removeChild(e), e = null, delete window[i];\n }, document.getElementsByTagName("head")[0].appendChild(e), this;\n },\n get: function(t, n, i) {\n if (S(n)) {\n const t = i;\n i = n, n = t;\n }\n (n = n || {}).method && (n.method = n.method.toUpperCase());\n const e = "POST" === n.method;\n if (E) {\n const r = new AbortController, s = {\n signal: r.signal,\n method: n.method || "GET",\n referrerPolicy: "origin"\n };\n return e && (O(n.body) || (s.body = JSON.stringify(n.body))), O(n.headers) || (s.headers = n.headers), \n O(n.credentials) || (s.credentials = n.credentials), fetch(t, s).then(t => {\n const e = this.t(t, n.returnJSON, n.responseType);\n e.message ? i(e) : e.then(e => {\n "arraybuffer" === n.responseType ? i(null, {\n data: e,\n cacheControl: t.headers.get("Cache-Control"),\n expires: t.headers.get("Expires"),\n contentType: t.headers.get("Content-Type")\n }) : i(null, e);\n }).catch(t => {\n t.code && t.code === DOMException.ABORT_ERR || (console.error(t), i(t));\n });\n }).catch(t => {\n t.code && t.code === DOMException.ABORT_ERR || (console.error(t), i(t));\n }), r;\n }\n {\n const r = C.s(i);\n if (r.open(n.method || "GET", t, !0), n) {\n for (const t in n.headers) r.setRequestHeader(t, n.headers[t]);\n r.withCredentials = "include" === n.credentials, n.responseType && (r.responseType = n.responseType);\n }\n return r.send(e ? n.body : null), r;\n }\n },\n t: (t, n, i) => 200 !== t.status ? {\n status: t.status,\n statusText: t.statusText,\n message: `incorrect http request with status code(${t.status}): ${t.statusText}`\n } : "arraybuffer" === i ? t.arrayBuffer() : n ? t.json() : t.text(),\n o: function(t, n) {\n return function() {\n if (4 === t.readyState) if (200 === t.status) if ("arraybuffer" === t.responseType) {\n 0 === t.response.byteLength ? n({\n status: 200,\n statusText: t.statusText,\n message: "http status 200 returned without content."\n }) : n(null, {\n data: t.response,\n cacheControl: t.getResponseHeader("Cache-Control"),\n expires: t.getResponseHeader("Expires"),\n contentType: t.getResponseHeader("Content-Type")\n });\n } else n(null, t.responseText); else n({\n status: t.status,\n statusText: t.statusText,\n message: `incorrect http request with status code(${t.status}): ${t.statusText}`\n });\n };\n },\n s: function(t) {\n let n;\n try {\n n = new XMLHttpRequest;\n } catch (t) {\n try {\n n = new ActiveXObject("Msxml2.XMLHTTP");\n } catch (t) {\n try {\n n = new ActiveXObject("Microsoft.XMLHTTP");\n } catch (t) {}\n }\n }\n return n.onreadystatechange = C.o(n, t), n;\n },\n getArrayBuffer(t, n, i) {\n if (S(n)) {\n const t = i;\n i = n, n = t;\n }\n return n || (n = {}), n.responseType = "arraybuffer", C.get(t, n, i);\n }\n };\n function j(t, n, i, e, r, s) {\n var o = r - i, a = s - e;\n if (0 !== o || 0 !== a) {\n var h = ((t - i) * o + (n - e) * a) / (o * o + a * a);\n h > 1 ? (i = r, e = s) : h > 0 && (i += o * h, e += a * h);\n }\n return (o = t - i) * o + (a = n - e) * a;\n }\n function N(t, n, i, e) {\n var r = {\n id: void 0 === t ? null : t,\n type: n,\n geometry: i,\n tags: e,\n minX: 1 / 0,\n minY: 1 / 0,\n maxX: -1 / 0,\n maxY: -1 / 0\n };\n return function(t) {\n var n = t.geometry, i = t.type;\n if ("Point" === i || "MultiPoint" === i || "LineString" === i) H(t, n); else if ("Polygon" === i || "MultiLineString" === i) for (var e = 0; e < n.length; e++) H(t, n[e]); else if ("MultiPolygon" === i) for (e = 0; e < n.length; e++) for (var r = 0; r < n[e].length; r++) H(t, n[e][r]);\n }(r), r;\n }\n function H(t, n) {\n for (var i = 0; i < n.length; i += 3) t.minX = Math.min(t.minX, n[i]), t.minY = Math.min(t.minY, n[i + 1]), \n t.maxX = Math.max(t.maxX, n[i]), t.maxY = Math.max(t.maxY, n[i + 1]);\n }\n function V(t, n, i, e) {\n if (n.geometry) {\n var r = n.geometry.coordinates, s = n.geometry.type, o = Math.pow(i.tolerance / ((1 << i.maxZoom) * i.extent), 2), a = [], h = n.id;\n if (i.promoteId ? h = n.properties[i.promoteId] : i.generateId && (h = e || 0), \n "Point" === s) R(r, a); else if ("MultiPoint" === s) for (var u = 0; u < r.length; u++) R(r[u], a); else if ("LineString" === s) $(r, a, o, !1); else if ("MultiLineString" === s) {\n if (i.lineMetrics) {\n for (u = 0; u < r.length; u++) a = [], $(r[u], a, o, !1), t.push(N(h, "LineString", a, n.properties));\n return;\n }\n W(r, a, o, !1);\n } else if ("Polygon" === s) W(r, a, o, !0); else {\n if ("MultiPolygon" !== s) {\n if ("GeometryCollection" === s) {\n for (u = 0; u < n.geometry.geometries.length; u++) V(t, {\n id: h,\n geometry: n.geometry.geometries[u],\n properties: n.properties\n }, i, e);\n return;\n }\n throw new Error("Input data is not a valid GeoJSON object.");\n }\n for (u = 0; u < r.length; u++) {\n var l = [];\n W(r[u], l, o, !0), a.push(l);\n }\n }\n t.push(N(h, s, a, n.properties));\n }\n }\n function R(t, n) {\n n.push(q(t[0])), n.push(B(t[1])), n.push(0);\n }\n function $(t, n, i, e) {\n for (var r, s, o = 0, a = 0; a < t.length; a++) {\n var h = q(t[a][0]), u = B(t[a][1]);\n n.push(h), n.push(u), n.push(0), a > 0 && (o += e ? (r * u - h * s) / 2 : Math.sqrt(Math.pow(h - r, 2) + Math.pow(u - s, 2))), \n r = h, s = u;\n }\n var l = n.length - 3;\n n[2] = 1, function t(n, i, e, r) {\n for (var s, o = r, a = e - i >> 1, h = e - i, u = n[i], l = n[i + 1], c = n[e], f = n[e + 1], d = i + 3; d < e; d += 3) {\n var y = j(n[d], n[d + 1], u, l, c, f);\n if (y > o) s = d, o = y; else if (y === o) {\n var v = Math.abs(d - a);\n v < h && (s = d, h = v);\n }\n }\n o > r && (s - i > 3 && t(n, i, s, r), n[s + 2] = o, e - s > 3 && t(n, s, e, r));\n }(n, 0, l, i), n[l + 2] = 1, n.size = Math.abs(o), n.start = 0, n.end = n.size;\n }\n function W(t, n, i, e) {\n for (var r = 0; r < t.length; r++) {\n var s = [];\n $(t[r], s, i, e), n.push(s);\n }\n }\n function q(t) {\n return t / 360 + .5;\n }\n function B(t) {\n var n = Math.sin(t * Math.PI / 180), i = .5 - .25 * Math.log((1 + n) / (1 - n)) / Math.PI;\n return i < 0 ? 0 : i > 1 ? 1 : i;\n }\n function G(t, n, i, e, r, s, o, a) {\n if (e /= n, s >= (i /= n) && o < e) return t;\n if (o < i || s >= e) return null;\n for (var h = [], u = 0; u < t.length; u++) {\n var l = t[u], c = l.geometry, f = l.type, d = 0 === r ? l.minX : l.minY, y = 0 === r ? l.maxX : l.maxY;\n if (d >= i && y < e) h.push(l); else if (!(y < i || d >= e)) {\n var v = [];\n if ("Point" === f || "MultiPoint" === f) J(c, v, i, e, r); else if ("LineString" === f) X(c, v, i, e, r, !1, a.lineMetrics); else if ("MultiLineString" === f) Y(c, v, i, e, r, !1); else if ("Polygon" === f) Y(c, v, i, e, r, !0); else if ("MultiPolygon" === f) for (var p = 0; p < c.length; p++) {\n var m = [];\n Y(c[p], m, i, e, r, !0), m.length && v.push(m);\n }\n if (v.length) {\n if (a.lineMetrics && "LineString" === f) {\n for (p = 0; p < v.length; p++) h.push(N(l.id, f, v[p], l.tags));\n continue;\n }\n "LineString" !== f && "MultiLineString" !== f || (1 === v.length ? (f = "LineString", \n v = v[0]) : f = "MultiLineString"), "Point" !== f && "MultiPoint" !== f || (f = 3 === v.length ? "Point" : "MultiPoint"), \n h.push(N(l.id, f, v, l.tags));\n }\n }\n }\n return h.length ? h : null;\n }\n function J(t, n, i, e, r) {\n for (var s = 0; s < t.length; s += 3) {\n var o = t[s + r];\n o >= i && o <= e && (n.push(t[s]), n.push(t[s + 1]), n.push(t[s + 2]));\n }\n }\n function X(t, n, i, e, r, s, o) {\n for (var a, h, u = Z(t), l = 0 === r ? Q : tt, c = t.start, f = 0; f < t.length - 3; f += 3) {\n var d = t[f], y = t[f + 1], v = t[f + 2], p = t[f + 3], m = t[f + 4], g = 0 === r ? d : y, w = 0 === r ? p : m, M = !1;\n o && (a = Math.sqrt(Math.pow(d - p, 2) + Math.pow(y - m, 2))), g < i ? w > i && (h = l(u, d, y, p, m, i), \n o && (u.start = c + a * h)) : g > e ? w < e && (h = l(u, d, y, p, m, e), o && (u.start = c + a * h)) : K(u, d, y, v), \n w < i && g >= i && (h = l(u, d, y, p, m, i), M = !0), w > e && g <= e && (h = l(u, d, y, p, m, e), \n M = !0), !s && M && (o && (u.end = c + a * h), n.push(u), u = Z(t)), o && (c += a);\n }\n var b = t.length - 3;\n d = t[b], y = t[b + 1], v = t[b + 2], (g = 0 === r ? d : y) >= i && g <= e && K(u, d, y, v), \n b = u.length - 3, s && b >= 3 && (u[b] !== u[0] || u[b + 1] !== u[1]) && K(u, u[0], u[1], u[2]), \n u.length && n.push(u);\n }\n function Z(t) {\n var n = [];\n return n.size = t.size, n.start = t.start, n.end = t.end, n;\n }\n function Y(t, n, i, e, r, s) {\n for (var o = 0; o < t.length; o++) X(t[o], n, i, e, r, s, !1);\n }\n function K(t, n, i, e) {\n t.push(n), t.push(i), t.push(e);\n }\n function Q(t, n, i, e, r, s) {\n var o = (s - n) / (e - n);\n return t.push(s), t.push(i + (r - i) * o), t.push(1), o;\n }\n function tt(t, n, i, e, r, s) {\n var o = (s - i) / (r - i);\n return t.push(n + (e - n) * o), t.push(s), t.push(1), o;\n }\n function nt(t, n) {\n for (var i = [], e = 0; e < t.length; e++) {\n var r, s = t[e], o = s.type;\n if ("Point" === o || "MultiPoint" === o || "LineString" === o) r = it(s.geometry, n); else if ("MultiLineString" === o || "Polygon" === o) {\n r = [];\n for (var a = 0; a < s.geometry.length; a++) r.push(it(s.geometry[a], n));\n } else if ("MultiPolygon" === o) for (r = [], a = 0; a < s.geometry.length; a++) {\n for (var h = [], u = 0; u < s.geometry[a].length; u++) h.push(it(s.geometry[a][u], n));\n r.push(h);\n }\n i.push(N(s.id, o, r, s.tags));\n }\n return i;\n }\n function it(t, n) {\n var i = [];\n i.size = t.size, void 0 !== t.start && (i.start = t.start, i.end = t.end);\n for (var e = 0; e < t.length; e += 3) i.push(t[e] + n, t[e + 1], t[e + 2]);\n return i;\n }\n function et(t, n) {\n if (t.transformed) return t;\n var i, e, r, s = 1 << t.z, o = t.x, a = t.y;\n for (i = 0; i < t.features.length; i++) {\n var h = t.features[i], u = h.geometry, l = h.type;\n if (h.geometry = [], 1 === l) for (e = 0; e < u.length; e += 2) h.geometry.push(rt(u[e], u[e + 1], n, s, o, a)); else for (e = 0; e < u.length; e++) {\n var c = [];\n for (r = 0; r < u[e].length; r += 2) c.push(rt(u[e][r], u[e][r + 1], n, s, o, a));\n h.geometry.push(c);\n }\n }\n return t.transformed = !0, t;\n }\n function rt(t, n, i, e, r, s) {\n return [ Math.round(i * (t * e - r)), Math.round(i * (n * e - s)) ];\n }\n function st(t, n, i, e, r) {\n for (var s = n === r.maxZoom ? 0 : r.tolerance / ((1 << n) * r.extent), o = {\n features: [],\n numPoints: 0,\n numSimplified: 0,\n numFeatures: 0,\n source: null,\n x: i,\n y: e,\n z: n,\n transformed: !1,\n minX: 2,\n minY: 1,\n maxX: -1,\n maxY: 0\n }, a = 0; a < t.length; a++) {\n o.numFeatures++, ot(o, t[a], s, r);\n var h = t[a].minX, u = t[a].minY, l = t[a].maxX, c = t[a].maxY;\n h < o.minX && (o.minX = h), u < o.minY && (o.minY = u), l > o.maxX && (o.maxX = l), \n c > o.maxY && (o.maxY = c);\n }\n return o;\n }\n function ot(t, n, i, e) {\n var r = n.geometry, s = n.type, o = [];\n if ("Point" === s || "MultiPoint" === s) for (var a = 0; a < r.length; a += 3) o.push(r[a]), \n o.push(r[a + 1]), t.numPoints++, t.numSimplified++; else if ("LineString" === s) at(o, r, t, i, !1, !1); else if ("MultiLineString" === s || "Polygon" === s) for (a = 0; a < r.length; a++) at(o, r[a], t, i, "Polygon" === s, 0 === a); else if ("MultiPolygon" === s) for (var h = 0; h < r.length; h++) {\n var u = r[h];\n for (a = 0; a < u.length; a++) at(o, u[a], t, i, !0, 0 === a);\n }\n if (o.length) {\n var l = n.tags || null;\n if ("LineString" === s && e.lineMetrics) {\n for (var c in l = {}, n.tags) l[c] = n.tags[c];\n l.mapbox_clip_start = r.start / r.size, l.mapbox_clip_end = r.end / r.size;\n }\n var f = {\n geometry: o,\n type: "Polygon" === s || "MultiPolygon" === s ? 3 : "LineString" === s || "MultiLineString" === s ? 2 : 1,\n tags: l\n };\n null !== n.id && (f.id = n.id), t.features.push(f);\n }\n }\n function at(t, n, i, e, r, s) {\n var o = e * e;\n if (e > 0 && n.size < (r ? o : e)) i.numPoints += n.length / 3; else {\n for (var a = [], h = 0; h < n.length; h += 3) (0 === e || n[h + 2] > o) && (i.numSimplified++, \n a.push(n[h]), a.push(n[h + 1])), i.numPoints++;\n r && function(t, n) {\n for (var i = 0, e = 0, r = t.length, s = r - 2; e < r; s = e, e += 2) i += (t[e] - t[s]) * (t[e + 1] + t[s + 1]);\n if (i > 0 === n) for (e = 0, r = t.length; e < r / 2; e += 2) {\n var o = t[e], a = t[e + 1];\n t[e] = t[r - 2 - e], t[e + 1] = t[r - 1 - e], t[r - 2 - e] = o, t[r - 1 - e] = a;\n }\n }(a, s), t.push(a);\n }\n }\n function ht(t, n) {\n var i = (n = this.options = function(t, n) {\n for (var i in n) t[i] = n[i];\n return t;\n }(Object.create(this.options), n)).debug;\n if (i && console.time("preprocess data"), n.maxZoom < 0 || n.maxZoom > 24) throw new Error("maxZoom should be in the 0-24 range");\n if (n.promoteId && n.generateId) throw new Error("promoteId and generateId cannot be used together.");\n var e = function(t, n) {\n var i = [];\n if ("FeatureCollection" === t.type) for (var e = 0; e < t.features.length; e++) V(i, t.features[e], n, e); else "Feature" === t.type ? V(i, t, n) : V(i, {\n geometry: t\n }, n);\n return i;\n }(t, n);\n this.tiles = {}, this.tileCoords = [], i && (console.timeEnd("preprocess data"), \n console.log("index: maxZoom: %d, maxPoints: %d", n.indexMaxZoom, n.indexMaxPoints), \n console.time("generate tiles"), this.stats = {}, this.total = 0), (e = function(t, n) {\n var i = n.buffer / n.extent, e = t, r = G(t, 1, -1 - i, i, 0, -1, 2, n), s = G(t, 1, 1 - i, 2 + i, 0, -1, 2, n);\n return (r || s) && (e = G(t, 1, -i, 1 + i, 0, -1, 2, n) || [], r && (e = nt(r, 1).concat(e)), \n s && (e = e.concat(nt(s, -1)))), e;\n }(e, n)).length && this.splitTile(e, 0, 0, 0), i && (e.length && console.log("features: %d, points: %d", this.tiles[0].numFeatures, this.tiles[0].numPoints), \n console.timeEnd("generate tiles"), console.log("tiles generated:", this.total, JSON.stringify(this.stats)));\n }\n function ut(t, n, i) {\n return 32 * ((1 << t) * i + n) + t;\n }\n function lt(t, n, i, e, r, s) {\n const o = i && Array.isArray(i[0]);\n for (let a = 0, h = i.length; a < h; a++) {\n t[n] = Math.round((o ? i[a][0] : i[a].x) * e), t[n + 1] = Math.round((o ? i[a][1] : i[a].y) * e);\n let u = r || 0;\n Array.isArray(r) && (u = r[a]), u = u ? Math.round(e * u) : 0, t[n + 2] = u, n += 3, \n s && 0 !== a && a !== h - 1 && (t[n] = t[n - 3], t[n + 1] = t[n - 2], t[n + 2] = t[n - 1], \n n += 3);\n }\n return n;\n }\n function ct(t, n, i, e) {\n const r = t[3 * n], s = t[3 * n + 1], o = t[3 * i], a = t[3 * i + 1];\n return r === o && (r < 0 || r > e) || s === a && (s < 0 || s > e);\n }\n C.getJSON = function(t, n, i) {\n if (S(n)) {\n const t = i;\n i = n, n = t;\n }\n const e = function(t, n) {\n const e = "string" == typeof n ? JSON.parse(n) : n || null;\n i(t, e);\n };\n return n && n.jsonp ? C.jsonp(t, e) : ((n = n || {}).returnJSON = !0, C.get(t, n, e));\n }, ht.prototype.options = {\n maxZoom: 14,\n indexMaxZoom: 5,\n indexMaxPoints: 1e5,\n tolerance: 3,\n extent: 4096,\n buffer: 64,\n lineMetrics: !1,\n promoteId: null,\n generateId: !1,\n debug: 0\n }, ht.prototype.splitTile = function(t, n, i, e, r, s, o) {\n for (var a = [ t, n, i, e ], h = this.options, u = h.debug; a.length; ) {\n e = a.pop(), i = a.pop(), n = a.pop(), t = a.pop();\n var l = 1 << n, c = ut(n, i, e), f = this.tiles[c];\n if (!f && (u > 1 && console.time("creation"), f = this.tiles[c] = st(t, n, i, e, h), \n this.tileCoords.push({\n z: n,\n x: i,\n y: e\n }), u)) {\n u > 1 && (console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)", n, i, e, f.numFeatures, f.numPoints, f.numSimplified), \n console.timeEnd("creation"));\n var d = "z" + n;\n this.stats[d] = (this.stats[d] || 0) + 1, this.total++;\n }\n if (f.source = t, r) {\n if (n === h.maxZoom || n === r) continue;\n var y = 1 << r - n;\n if (i !== Math.floor(s / y) || e !== Math.floor(o / y)) continue;\n } else if (n === h.indexMaxZoom || f.numPoints <= h.indexMaxPoints) continue;\n if (f.source = null, 0 !== t.length) {\n u > 1 && console.time("clipping");\n var v, p, m, g, w, M, b = .5 * h.buffer / h.extent, x = .5 - b, F = .5 + b, A = 1 + b;\n v = p = m = g = null, w = G(t, l, i - b, i + F, 0, f.minX, f.maxX, h), M = G(t, l, i + x, i + A, 0, f.minX, f.maxX, h), \n t = null, w && (v = G(w, l, e - b, e + F, 1, f.minY, f.maxY, h), p = G(w, l, e + x, e + A, 1, f.minY, f.maxY, h), \n w = null), M && (m = G(M, l, e - b, e + F, 1, f.minY, f.maxY, h), g = G(M, l, e + x, e + A, 1, f.minY, f.maxY, h), \n M = null), u > 1 && console.timeEnd("clipping"), a.push(v || [], n + 1, 2 * i, 2 * e), \n a.push(p || [], n + 1, 2 * i, 2 * e + 1), a.push(m || [], n + 1, 2 * i + 1, 2 * e), \n a.push(g || [], n + 1, 2 * i + 1, 2 * e + 1);\n }\n }\n }, ht.prototype.getTile = function(t, n, i) {\n var e = this.options, r = e.extent, s = e.debug;\n if (t < 0 || t > 24) return null;\n var o = 1 << t, a = ut(t, n = (n % o + o) % o, i);\n if (this.tiles[a]) return et(this.tiles[a], r);\n s > 1 && console.log("drilling down to z%d-%d-%d", t, n, i);\n for (var h, u = t, l = n, c = i; !h && u > 0; ) u--, l = Math.floor(l / 2), c = Math.floor(c / 2), \n h = this.tiles[ut(u, l, c)];\n return h && h.source ? (s > 1 && console.log("found parent tile z%d-%d-%d", u, l, c), \n s > 1 && console.time("drilling down"), this.splitTile(h.source, u, l, c, t, n, i), \n s > 1 && console.timeEnd("drilling down"), this.tiles[a] ? et(this.tiles[a], r) : null) : null;\n };\n class ft {\n constructor(t, n) {\n this.x = t, this.y = n;\n }\n clone() {\n return new ft(this.x, this.y);\n }\n normalize() {\n const t = this.length();\n this.x /= t, this.y /= t;\n }\n negate() {\n this.x = -this.x, this.y = -this.y;\n }\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n diff(t) {\n return new ft(this.x - t.x, this.y - t.y);\n }\n distance(t) {\n const n = this.x - t.x, i = this.y - t.y;\n return Math.sqrt(n * n + i * i);\n }\n dot(t) {\n return this.x * t.x + this.y * t.y;\n }\n equals(t) {\n return this.x === t.x && this.y === t.y;\n }\n orthogonal() {\n return new ft(this.y, -this.x);\n }\n }\n function dt(t, n, i) {\n const e = (n.x - t.x) * (i.y - t.y) - (n.y - t.y) * (i.x - t.x);\n return e > 1e-5 ? 1 : e < -1e-5 ? 2 : 0;\n }\n function yt(t, n, i, e) {\n const r = n.x * e.y - n.y * e.x, s = i.x - t.x, o = i.y - t.y, a = (s * e.y - o * e.x) / r;\n return new ft(t.x + a * n.x, t.y + a * n.y);\n }\n const vt = [];\n function pt(t, n, i) {\n let e = 0;\n const r = [];\n for (let s = n; s < i; s += 3) vt[e] ? (vt[e].x = t[s], vt[e].y = t[s + 1]) : vt[e] = new ft(t[s], t[s + 1]), \n r.push(vt[e]), e++;\n const s = function(t) {\n let n;\n this.UpdateOmbb = function(t, i, e, r, s, o, a, h) {\n const u = yt(t, i, s, o), l = yt(e, r, s, o), c = yt(a, h, t, i), f = yt(a, h, e, r), d = u.distance(l) * u.distance(c);\n d < this.BestObbArea && (n = [ u, c, f, l ], this.BestObbArea = d);\n }, this.BestObbArea = Number.MAX_VALUE;\n const i = [];\n for (let n = 0; n < t.length; n++) i.push(t[(n + 1) % t.length].diff(t[n])), i[n].normalize();\n const e = new ft(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY), r = new ft(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY);\n let s, o, a, h;\n for (let n = 0; n < t.length; n++) {\n const i = t[n];\n i.x < e.x && (e.x = i.x, s = n), i.x > r.x && (r.x = i.x, o = n), i.y < e.y && (e.y = i.y, \n h = n), i.y > r.y && (r.y = i.y, a = n);\n }\n let u = new ft(0, -1), l = new ft(0, 1), c = new ft(-1, 0), f = new ft(1, 0);\n for (let n = 0; n < t.length; n++) {\n const n = [ Math.acos(u.dot(i[s])), Math.acos(l.dot(i[o])), Math.acos(c.dot(i[a])), Math.acos(f.dot(i[h])) ];\n switch (n.indexOf(Math.min.apply(Math, n))) {\n case 0:\n u = i[s].clone(), l = u.clone(), l.negate(), c = u.orthogonal(), f = c.clone(), \n f.negate(), s = (s + 1) % t.length;\n break;\n\n case 1:\n l = i[o].clone(), u = l.clone(), u.negate(), c = u.orthogonal(), f = c.clone(), \n f.negate(), o = (o + 1) % t.length;\n break;\n\n case 2:\n c = i[a].clone(), f = c.clone(), f.negate(), u = f.orthogonal(), l = u.clone(), \n l.negate(), a = (a + 1) % t.length;\n break;\n\n case 3:\n f = i[h].clone(), c = f.clone(), c.negate(), u = f.orthogonal(), l = u.clone(), \n l.negate(), h = (h + 1) % t.length;\n }\n this.UpdateOmbb(t[s], u, t[o], l, t[a], c, t[h], f);\n }\n return n;\n }(function(t) {\n if (t.length < 3) return t;\n let n = t[0];\n const i = [];\n for (let i = 1; i < t.length; i++) (t[i].x < n.x || Math.abs(t[i].x - n.x) < 1e-5 && t[i].y < n.y) && (n = t[i]);\n let e = t[0];\n do {\n i.unshift(n.clone());\n for (let i = 1; i < t.length; i++) {\n const r = dt(n, e, t[i]);\n (e.equals(n) || 1 === r || 0 === r && n.distance(t[i]) > n.distance(e)) && (e = t[i]);\n }\n n = e;\n } while (!e.equals(i[i.length - 1]));\n return i;\n }(r)), o = s[0].distance(s[1]), a = s[1].distance(s[2]), h = s.map(t => [ t.x, t.y ]);\n return h.push(+(a > o)), h;\n }\n var mt = "undefined" != typeof Float32Array ? Float32Array : Array;\n function gt() {\n var t = new mt(3);\n return mt != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0), t;\n }\n function wt(t, n, i) {\n var e = new mt(3);\n return e[0] = t, e[1] = n, e[2] = i, e;\n }\n function Mt(t, n) {\n return t[0] = n[0], t[1] = n[1], t[2] = n[2], t;\n }\n function bt(t, n, i, e) {\n return t[0] = n, t[1] = i, t[2] = e, t;\n }\n function xt(t, n, i) {\n return t[0] = n[0] + i[0], t[1] = n[1] + i[1], t[2] = n[2] + i[2], t;\n }\n function Ft(t, n, i) {\n return t[0] = n[0] / i[0], t[1] = n[1] / i[1], t[2] = n[2] / i[2], t;\n }\n function At(t, n) {\n var i = n[0], e = n[1], r = n[2], s = i * i + e * e + r * r;\n return s > 0 && (s = 1 / Math.sqrt(s), t[0] = n[0] * s, t[1] = n[1] * s, t[2] = n[2] * s), \n t;\n }\n function kt(t, n) {\n return t[0] * n[0] + t[1] * n[1] + t[2] * n[2];\n }\n function Pt(t, n, i) {\n var e = n[0], r = n[1], s = n[2], o = i[0], a = i[1], h = i[2];\n return t[0] = r * h - s * a, t[1] = s * o - e * h, t[2] = e * a - r * o, t;\n }\n var St = function(t, n, i) {\n return t[0] = n[0] - i[0], t[1] = n[1] - i[1], t[2] = n[2] - i[2], t;\n };\n function _t(t, n) {\n return t[0] = n[0], t[1] = n[1], t[2] = n[2], t[3] = n[3], t;\n }\n function Ot(t, n, i, e, r) {\n return t[0] = n, t[1] = i, t[2] = e, t[3] = r, t;\n }\n function It() {\n var t = new mt(4);\n return mt != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0), t[3] = 1, t;\n }\n function Tt(t, n) {\n var i = n[0] + n[4] + n[8], e = void 0;\n if (i > 0) e = Math.sqrt(i + 1), t[3] = .5 * e, e = .5 / e, t[0] = (n[5] - n[7]) * e, \n t[1] = (n[6] - n[2]) * e, t[2] = (n[1] - n[3]) * e; else {\n var r = 0;\n n[4] > n[0] && (r = 1), n[8] > n[3 * r + r] && (r = 2);\n var s = (r + 1) % 3, o = (r + 2) % 3;\n e = Math.sqrt(n[3 * r + r] - n[3 * s + s] - n[3 * o + o] + 1), t[r] = .5 * e, e = .5 / e, \n t[3] = (n[3 * s + o] - n[3 * o + s]) * e, t[s] = (n[3 * s + r] + n[3 * r + s]) * e, \n t[o] = (n[3 * o + r] + n[3 * r + o]) * e;\n }\n return t;\n }\n gt(), function() {\n var t, n = (t = new mt(4), mt != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0, \n t[3] = 0), t);\n }();\n var Lt, Ut = function(t, n, i) {\n return t[0] = n[0] * i, t[1] = n[1] * i, t[2] = n[2] * i, t[3] = n[3] * i, t;\n }, zt = function(t, n) {\n var i = n[0], e = n[1], r = n[2], s = n[3], o = i * i + e * e + r * r + s * s;\n return o > 0 && (o = 1 / Math.sqrt(o), t[0] = i * o, t[1] = e * o, t[2] = r * o, \n t[3] = s * o), t;\n };\n function Dt(t, n) {\n var i = n[0] - t[0], e = n[1] - t[1];\n return Math.sqrt(i * i + e * e);\n }\n function Et(t, n, i, e, r, s, o, a, h, u) {\n 0 === t ? function(t, n, i, e, r, s, o, a, h) {\n const u = [ 0, 0 ];\n for (let r = t; r < n; r += 3) {\n const t = r / 3 * 2, n = e[r], l = e[r + 1];\n i[t] = u[0] + n * s * o / a, i[t + 1] = u[1] - l * s * o / h;\n }\n }(n, i, e, r, 0, o, a, h, u) : 1 === t && function(t, n, i, e) {\n const r = pt(e, t, n), s = r[4], o = r[s], a = r[s + 1], h = r[s + 2], u = (a[1] - o[1]) / (a[0] - o[0]), l = (h[1] - a[1]) / (h[0] - a[0]), c = Dt(o, a), f = Dt(a, h);\n for (let r = t; r < n; r += 3) {\n const t = r / 3 * 2, n = e[r], s = e[r + 1];\n i[t] = jt(n, s, o, u, c), i[t + 1] = -jt(n, s, a, l, f);\n }\n }(n, i, e, r);\n }\n gt(), wt(1, 0, 0), wt(0, 1, 0), It(), It(), Lt = new mt(9), mt != Float32Array && (Lt[1] = 0, \n Lt[2] = 0, Lt[3] = 0, Lt[5] = 0, Lt[6] = 0, Lt[7] = 0), Lt[0] = 1, Lt[4] = 1, Lt[8] = 1, \n function() {\n var t = function() {\n var t = new mt(2);\n return mt != Float32Array && (t[0] = 0, t[1] = 0), t;\n }();\n }();\n const Ct = [];\n function jt(t, n, i, e, r) {\n return Ct[0] = (e * e * i[0] + e * (n - i[1]) + t) / (e * e + 1), Ct[1] = e * (Ct[0] - i[0]) + i[1], \n Dt(i, Ct) / r;\n }\n function Nt(t, n, i, e, r) {\n const s = 3 * n[i - 1], o = 3 * n[i - 1] + 1, a = t[s], h = t[o];\n return u = e, l = r, c = a, f = h, Math.sqrt((c - u) * (c - u) + (f - l) * (f - l));\n var u, l, c, f;\n }\n "undefined" != typeof undefinedThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof undefined ? global : "undefined" != typeof self && self;\n var Ht = Vt;\n function Vt(t, n) {\n this.x = t, this.y = n;\n }\n function Rt(t, n, i) {\n i = i || {}, this.w = t || 64, this.h = n || 64, this.autoResize = !!i.autoResize, \n this.shelves = [], this.freebins = [], this.stats = {}, this.bins = {}, this.maxId = 0;\n }\n function $t(t, n, i) {\n this.x = 0, this.y = t, this.w = this.free = n, this.h = i;\n }\n function Wt(t, n, i, e, r, s, o) {\n this.id = t, this.x = n, this.y = i, this.w = e, this.h = r, this.maxw = s || e, \n this.maxh = o || r, this.refcount = 0;\n }\n Vt.prototype = {\n clone: function() {\n return new Vt(this.x, this.y);\n },\n add: function(t) {\n return this.clone().u(t);\n },\n sub: function(t) {\n return this.clone().v(t);\n },\n multByPoint: function(t) {\n return this.clone().m(t);\n },\n divByPoint: function(t) {\n return this.clone().M(t);\n },\n mult: function(t) {\n return this.clone().F(t);\n },\n div: function(t) {\n return this.clone().A(t);\n },\n rotate: function(t) {\n return this.clone().k(t);\n },\n rotateAround: function(t, n) {\n return this.clone().P(t, n);\n },\n matMult: function(t) {\n return this.clone().S(t);\n },\n unit: function() {\n return this.clone()._();\n },\n perp: function() {\n return this.clone().O();\n },\n round: function() {\n return this.clone().I();\n },\n mag: function() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n },\n equals: function(t) {\n return this.x === t.x && this.y === t.y;\n },\n dist: function(t) {\n return Math.sqrt(this.distSqr(t));\n },\n distSqr: function(t) {\n var n = t.x - this.x, i = t.y - this.y;\n return n * n + i * i;\n },\n angle: function() {\n return Math.atan2(this.y, this.x);\n },\n angleTo: function(t) {\n return Math.atan2(this.y - t.y, this.x - t.x);\n },\n angleWith: function(t) {\n return this.angleWithSep(t.x, t.y);\n },\n angleWithSep: function(t, n) {\n return Math.atan2(this.x * n - this.y * t, this.x * t + this.y * n);\n },\n S: function(t) {\n var n = t[0] * this.x + t[1] * this.y, i = t[2] * this.x + t[3] * this.y;\n return this.x = n, this.y = i, this;\n },\n u: function(t) {\n return this.x += t.x, this.y += t.y, this;\n },\n v: function(t) {\n return this.x -= t.x, this.y -= t.y, this;\n },\n F: function(t) {\n return this.x *= t, this.y *= t, this;\n },\n A: function(t) {\n return this.x /= t, this.y /= t, this;\n },\n m: function(t) {\n return this.x *= t.x, this.y *= t.y, this;\n },\n M: function(t) {\n return this.x /= t.x, this.y /= t.y, this;\n },\n _: function() {\n return this.A(this.mag()), this;\n },\n O: function() {\n var t = this.y;\n return this.y = this.x, this.x = -t, this;\n },\n k: function(t) {\n var n = Math.cos(t), i = Math.sin(t), e = n * this.x - i * this.y, r = i * this.x + n * this.y;\n return this.x = e, this.y = r, this;\n },\n P: function(t, n) {\n var i = Math.cos(t), e = Math.sin(t), r = n.x + i * (this.x - n.x) - e * (this.y - n.y), s = n.y + e * (this.x - n.x) + i * (this.y - n.y);\n return this.x = r, this.y = s, this;\n },\n I: function() {\n return this.x = Math.round(this.x), this.y = Math.round(this.y), this;\n }\n }, Vt.convert = function(t) {\n return t instanceof Vt ? t : Array.isArray(t) ? new Vt(t[0], t[1]) : t;\n }, Rt.prototype.pack = function(t, n) {\n t = [].concat(t), n = n || {};\n for (var i, e, r, s, o = [], a = 0; a < t.length; a++) if (i = t[a].w || t[a].width, \n e = t[a].h || t[a].height, r = t[a].id, i && e) {\n if (!(s = this.packOne(i, e, r))) continue;\n n.inPlace && (t[a].x = s.x, t[a].y = s.y, t[a].id = s.id), o.push(s);\n }\n return this.shrink(), o;\n }, Rt.prototype.packOne = function(t, n, i) {\n var e, r, s, o, a, h, u, l, c = {\n freebin: -1,\n shelf: -1,\n waste: 1 / 0\n }, f = 0;\n if ("string" == typeof i || "number" == typeof i) {\n if (e = this.getBin(i)) return this.ref(e), e;\n "number" == typeof i && (this.maxId = Math.max(i, this.maxId));\n } else i = ++this.maxId;\n for (o = 0; o < this.freebins.length; o++) {\n if (n === (e = this.freebins[o]).maxh && t === e.maxw) return this.allocFreebin(o, t, n, i);\n n > e.maxh || t > e.maxw || n <= e.maxh && t <= e.maxw && (s = e.maxw * e.maxh - t * n) < c.waste && (c.waste = s, \n c.freebin = o);\n }\n for (o = 0; o < this.shelves.length; o++) if (f += (r = this.shelves[o]).h, !(t > r.free)) {\n if (n === r.h) return this.allocShelf(o, t, n, i);\n n > r.h || n < r.h && (s = (r.h - n) * t) < c.waste && (c.freebin = -1, c.waste = s, \n c.shelf = o);\n }\n return -1 !== c.freebin ? this.allocFreebin(c.freebin, t, n, i) : -1 !== c.shelf ? this.allocShelf(c.shelf, t, n, i) : n <= this.h - f && t <= this.w ? (r = new $t(f, this.w, n), \n this.allocShelf(this.shelves.push(r) - 1, t, n, i)) : this.autoResize ? (a = h = this.h, \n ((u = l = this.w) <= a || t > u) && (l = 2 * Math.max(t, u)), (a < u || n > a) && (h = 2 * Math.max(n, a)), \n this.resize(l, h), this.packOne(t, n, i)) : null;\n }, Rt.prototype.allocFreebin = function(t, n, i, e) {\n var r = this.freebins.splice(t, 1)[0];\n return r.id = e, r.w = n, r.h = i, r.refcount = 0, this.bins[e] = r, this.ref(r), \n r;\n }, Rt.prototype.allocShelf = function(t, n, i, e) {\n var r = this.shelves[t].alloc(n, i, e);\n return this.bins[e] = r, this.ref(r), r;\n }, Rt.prototype.shrink = function() {\n if (this.shelves.length > 0) {\n for (var t = 0, n = 0, i = 0; i < this.shelves.length; i++) {\n var e = this.shelves[i];\n n += e.h, t = Math.max(e.w - e.free, t);\n }\n this.resize(t, n);\n }\n }, Rt.prototype.getBin = function(t) {\n return this.bins[t];\n }, Rt.prototype.ref = function(t) {\n if (1 == ++t.refcount) {\n var n = t.h;\n this.stats[n] = 1 + (0 | this.stats[n]);\n }\n return t.refcount;\n }, Rt.prototype.unref = function(t) {\n return 0 === t.refcount ? 0 : (0 == --t.refcount && (this.stats[t.h]--, delete this.bins[t.id], \n this.freebins.push(t)), t.refcount);\n }, Rt.prototype.clear = function() {\n this.shelves = [], this.freebins = [], this.stats = {}, this.bins = {}, this.maxId = 0;\n }, Rt.prototype.resize = function(t, n) {\n this.w = t, this.h = n;\n for (var i = 0; i < this.shelves.length; i++) this.shelves[i].resize(t);\n return !0;\n }, $t.prototype.alloc = function(t, n, i) {\n if (t > this.free || n > this.h) return null;\n var e = this.x;\n return this.x += t, this.free -= t, new Wt(i, e, this.y, t, n, t, this.h);\n }, $t.prototype.resize = function(t) {\n return this.free += t - this.w, this.w = t, !0;\n };\n var qt = {\n exports: {}\n };\n qt.exports = function() {\n function t(t, n, i) {\n var e = t[n];\n t[n] = t[i], t[i] = e;\n }\n function n(t, n) {\n return t < n ? -1 : t > n ? 1 : 0;\n }\n return function(i, e, r, s, o) {\n !function n(i, e, r, s, o) {\n for (;s > r; ) {\n if (s - r > 600) {\n var a = s - r + 1, h = e - r + 1, u = Math.log(a), l = .5 * Math.exp(2 * u / 3), c = .5 * Math.sqrt(u * l * (a - l) / a) * (h - a / 2 < 0 ? -1 : 1), f = Math.max(r, Math.floor(e - h * l / a + c)), d = Math.min(s, Math.floor(e + (a - h) * l / a + c));\n n(i, e, f, d, o);\n }\n var y = i[e], v = r, p = s;\n for (t(i, r, e), o(i[s], y) > 0 && t(i, r, s); v < p; ) {\n for (t(i, v, p), v++, p--; o(i[v], y) < 0; ) v++;\n for (;o(i[p], y) > 0; ) p--;\n }\n 0 === o(i[r], y) ? t(i, r, p) : (p++, t(i, p, s)), p <= e && (r = p + 1), e <= p && (s = p - 1);\n }\n }(i, e, r || 0, s || i.length - 1, o || n);\n };\n }();\n var Bt = qt.exports, Gt = {\n exports: {}\n };\n function Jt(t, n) {\n if (!(this instanceof Jt)) return new Jt(t, n);\n if (this.data = t || [], this.length = this.data.length, this.compare = n || Xt, \n this.length > 0) for (var i = (this.length >> 1) - 1; i >= 0; i--) this.T(i);\n }\n function Xt(t, n) {\n return t < n ? -1 : t > n ? 1 : 0;\n }\n Gt.exports = Jt, Gt.exports.default = Jt, Jt.prototype = {\n push: function(t) {\n this.data.push(t), this.length++, this.L(this.length - 1);\n },\n pop: function() {\n if (0 !== this.length) {\n var t = this.data[0];\n return this.length--, this.length > 0 && (this.data[0] = this.data[this.length], \n this.T(0)), this.data.pop(), t;\n }\n },\n peek: function() {\n return this.data[0];\n },\n L: function(t) {\n for (var n = this.data, i = this.compare, e = n[t]; t > 0; ) {\n var r = t - 1 >> 1, s = n[r];\n if (i(e, s) >= 0) break;\n n[t] = s, t = r;\n }\n n[t] = e;\n },\n T: function(t) {\n for (var n = this.data, i = this.compare, e = this.length >> 1, r = n[t]; t < e; ) {\n var s = 1 + (t << 1), o = s + 1, a = n[s];\n if (o < this.length && i(n[o], a) < 0 && (s = o, a = n[o]), i(a, r) >= 0) break;\n n[t] = a, t = s;\n }\n n[t] = r;\n }\n };\n var Zt = Gt.exports, Yt = {\n exports: {}\n }, Kt = {\n aliceblue: [ 240, 248, 255 ],\n antiquewhite: [ 250, 235, 215 ],\n aqua: [ 0, 255, 255 ],\n aquamarine: [ 127, 255, 212 ],\n azure: [ 240, 255, 255 ],\n beige: [ 245, 245, 220 ],\n bisque: [ 255, 228, 196 ],\n black: [ 0, 0, 0 ],\n blanchedalmond: [ 255, 235, 205 ],\n blue: [ 0, 0, 255 ],\n blueviolet: [ 138, 43, 226 ],\n brown: [ 165, 42, 42 ],\n burlywood: [ 222, 184, 135 ],\n cadetblue: [ 95, 158, 160 ],\n chartreuse: [ 127, 255, 0 ],\n chocolate: [ 210, 105, 30 ],\n coral: [ 255, 127, 80 ],\n cornflowerblue: [ 100, 149, 237 ],\n cornsilk: [ 255, 248, 220 ],\n crimson: [ 220, 20, 60 ],\n cyan: [ 0, 255, 255 ],\n darkblue: [ 0, 0, 139 ],\n darkcyan: [ 0, 139, 139 ],\n darkgoldenrod: [ 184, 134, 11 ],\n darkgray: [ 169, 169, 169 ],\n darkgreen: [ 0, 100, 0 ],\n darkgrey: [ 169, 169, 169 ],\n darkkhaki: [ 189, 183, 107 ],\n darkmagenta: [ 139, 0, 139 ],\n darkolivegreen: [ 85, 107, 47 ],\n darkorange: [ 255, 140, 0 ],\n darkorchid: [ 153, 50, 204 ],\n darkred: [ 139, 0, 0 ],\n darksalmon: [ 233, 150, 122 ],\n darkseagreen: [ 143, 188, 143 ],\n darkslateblue: [ 72, 61, 139 ],\n darkslategray: [ 47, 79, 79 ],\n darkslategrey: [ 47, 79, 79 ],\n darkturquoise: [ 0, 206, 209 ],\n darkviolet: [ 148, 0, 211 ],\n deeppink: [ 255, 20, 147 ],\n deepskyblue: [ 0, 191, 255 ],\n dimgray: [ 105, 105, 105 ],\n dimgrey: [ 105, 105, 105 ],\n dodgerblue: [ 30, 144, 255 ],\n firebrick: [ 178, 34, 34 ],\n floralwhite: [ 255, 250, 240 ],\n forestgreen: [ 34, 139, 34 ],\n fuchsia: [ 255, 0, 255 ],\n gainsboro: [ 220, 220, 220 ],\n ghostwhite: [ 248, 248, 255 ],\n gold: [ 255, 215, 0 ],\n goldenrod: [ 218, 165, 32 ],\n gray: [ 128, 128, 128 ],\n green: [ 0, 128, 0 ],\n greenyellow: [ 173, 255, 47 ],\n grey: [ 128, 128, 128 ],\n honeydew: [ 240, 255, 240 ],\n hotpink: [ 255, 105, 180 ],\n indianred: [ 205, 92, 92 ],\n indigo: [ 75, 0, 130 ],\n ivory: [ 255, 255, 240 ],\n khaki: [ 240, 230, 140 ],\n lavender: [ 230, 230, 250 ],\n lavenderblush: [ 255, 240, 245 ],\n lawngreen: [ 124, 252, 0 ],\n lemonchiffon: [ 255, 250, 205 ],\n lightblue: [ 173, 216, 230 ],\n lightcoral: [ 240, 128, 128 ],\n lightcyan: [ 224, 255, 255 ],\n lightgoldenrodyellow: [ 250, 250, 210 ],\n lightgray: [ 211, 211, 211 ],\n lightgreen: [ 144, 238, 144 ],\n lightgrey: [ 211, 211, 211 ],\n lightpink: [ 255, 182, 193 ],\n lightsalmon: [ 255, 160, 122 ],\n lightseagreen: [ 32, 178, 170 ],\n lightskyblue: [ 135, 206, 250 ],\n lightslategray: [ 119, 136, 153 ],\n lightslategrey: [ 119, 136, 153 ],\n lightsteelblue: [ 176, 196, 222 ],\n lightyellow: [ 255, 255, 224 ],\n lime: [ 0, 255, 0 ],\n limegreen: [ 50, 205, 50 ],\n linen: [ 250, 240, 230 ],\n magenta: [ 255, 0, 255 ],\n maroon: [ 128, 0, 0 ],\n mediumaquamarine: [ 102, 205, 170 ],\n mediumblue: [ 0, 0, 205 ],\n mediumorchid: [ 186, 85, 211 ],\n mediumpurple: [ 147, 112, 219 ],\n mediumseagreen: [ 60, 179, 113 ],\n mediumslateblue: [ 123, 104, 238 ],\n mediumspringgreen: [ 0, 250, 154 ],\n mediumturquoise: [ 72, 209, 204 ],\n mediumvioletred: [ 199, 21, 133 ],\n midnightblue: [ 25, 25, 112 ],\n mintcream: [ 245, 255, 250 ],\n mistyrose: [ 255, 228, 225 ],\n moccasin: [ 255, 228, 181 ],\n navajowhite: [ 255, 222, 173 ],\n navy: [ 0, 0, 128 ],\n oldlace: [ 253, 245, 230 ],\n olive: [ 128, 128, 0 ],\n olivedrab: [ 107, 142, 35 ],\n orange: [ 255, 165, 0 ],\n orangered: [ 255, 69, 0 ],\n orchid: [ 218, 112, 214 ],\n palegoldenrod: [ 238, 232, 170 ],\n palegreen: [ 152, 251, 152 ],\n paleturquoise: [ 175, 238, 238 ],\n palevioletred: [ 219, 112, 147 ],\n papayawhip: [ 255, 239, 213 ],\n peachpuff: [ 255, 218, 185 ],\n peru: [ 205, 133, 63 ],\n pink: [ 255, 192, 203 ],\n plum: [ 221, 160, 221 ],\n powderblue: [ 176, 224, 230 ],\n purple: [ 128, 0, 128 ],\n rebeccapurple: [ 102, 51, 153 ],\n red: [ 255, 0, 0 ],\n rosybrown: [ 188, 143, 143 ],\n royalblue: [ 65, 105, 225 ],\n saddlebrown: [ 139, 69, 19 ],\n salmon: [ 250, 128, 114 ],\n sandybrown: [ 244, 164, 96 ],\n seagreen: [ 46, 139, 87 ],\n seashell: [ 255, 245, 238 ],\n sienna: [ 160, 82, 45 ],\n silver: [ 192, 192, 192 ],\n skyblue: [ 135, 206, 235 ],\n slateblue: [ 106, 90, 205 ],\n slategray: [ 112, 128, 144 ],\n slategrey: [ 112, 128, 144 ],\n snow: [ 255, 250, 250 ],\n springgreen: [ 0, 255, 127 ],\n steelblue: [ 70, 130, 180 ],\n tan: [ 210, 180, 140 ],\n teal: [ 0, 128, 128 ],\n thistle: [ 216, 191, 216 ],\n tomato: [ 255, 99, 71 ],\n turquoise: [ 64, 224, 208 ],\n violet: [ 238, 130, 238 ],\n wheat: [ 245, 222, 179 ],\n white: [ 255, 255, 255 ],\n whitesmoke: [ 245, 245, 245 ],\n yellow: [ 255, 255, 0 ],\n yellowgreen: [ 154, 205, 50 ]\n }, Qt = {\n exports: {}\n }, tn = function(t) {\n return !(!t || "string" == typeof t) && (t instanceof Array || Array.isArray(t) || t.length >= 0 && (t.splice instanceof Function || Object.getOwnPropertyDescriptor(t, t.length - 1) && "String" !== t.constructor.name));\n }, nn = Array.prototype.concat, en = Array.prototype.slice, rn = Qt.exports = function(t) {\n for (var n = [], i = 0, e = t.length; i < e; i++) {\n var r = t[i];\n tn(r) ? n = nn.call(n, en.call(r)) : n.push(r);\n }\n return n;\n };\n rn.wrap = function(t) {\n return function() {\n return t(rn(arguments));\n };\n };\n var sn = Kt, on = Qt.exports, an = Object.hasOwnProperty, hn = {};\n for (var un in sn) an.call(sn, un) && (hn[sn[un]] = un);\n var ln = Yt.exports = {\n to: {},\n get: {}\n };\n function cn(t, n, i) {\n return Math.min(Math.max(n, t), i);\n }\n function fn(t) {\n var n = Math.round(t).toString(16).toUpperCase();\n return n.length < 2 ? "0" + n : n;\n }\n ln.get = function(t) {\n var n, i;\n switch (t.substring(0, 3).toLowerCase()) {\n case "hsl":\n n = ln.get.hsl(t), i = "hsl";\n break;\n\n case "hwb":\n n = ln.get.hwb(t), i = "hwb";\n break;\n\n default:\n n = ln.get.rgb(t), i = "rgb";\n }\n return n ? {\n model: i,\n value: n\n } : null;\n }, ln.get.rgb = function(t) {\n if (!t) return null;\n var n, i, e, r = [ 0, 0, 0, 1 ];\n if (n = t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)) {\n for (e = n[2], n = n[1], i = 0; i < 3; i++) {\n var s = 2 * i;\n r[i] = parseInt(n.slice(s, s + 2), 16);\n }\n e && (r[3] = parseInt(e, 16) / 255);\n } else if (n = t.match(/^#([a-f0-9]{3,4})$/i)) {\n for (e = (n = n[1])[3], i = 0; i < 3; i++) r[i] = parseInt(n[i] + n[i], 16);\n e && (r[3] = parseInt(e + e, 16) / 255);\n } else if (n = t.match(/^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)) {\n for (i = 0; i < 3; i++) r[i] = parseInt(n[i + 1], 0);\n n[4] && (n[5] ? r[3] = .01 * parseFloat(n[4]) : r[3] = parseFloat(n[4]));\n } else {\n if (!(n = t.match(/^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/))) return (n = t.match(/^(\\w+)$/)) ? "transparent" === n[1] ? [ 0, 0, 0, 0 ] : an.call(sn, n[1]) ? ((r = sn[n[1]])[3] = 1, \n r) : null : null;\n for (i = 0; i < 3; i++) r[i] = Math.round(2.55 * parseFloat(n[i + 1]));\n n[4] && (n[5] ? r[3] = .01 * parseFloat(n[4]) : r[3] = parseFloat(n[4]));\n }\n for (i = 0; i < 3; i++) r[i] = cn(r[i], 0, 255);\n return r[3] = cn(r[3], 0, 1), r;\n }, ln.get.hsl = function(t) {\n if (!t) return null;\n var n = t.match(/^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);\n if (n) {\n var i = parseFloat(n[4]);\n return [ (parseFloat(n[1]) % 360 + 360) % 360, cn(parseFloat(n[2]), 0, 100), cn(parseFloat(n[3]), 0, 100), cn(isNaN(i) ? 1 : i, 0, 1) ];\n }\n return null;\n }, ln.get.hwb = function(t) {\n if (!t) return null;\n var n = t.match(/^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);\n if (n) {\n var i = parseFloat(n[4]);\n return [ (parseFloat(n[1]) % 360 + 360) % 360, cn(parseFloat(n[2]), 0, 100), cn(parseFloat(n[3]), 0, 100), cn(isNaN(i) ? 1 : i, 0, 1) ];\n }\n return null;\n }, ln.to.hex = function() {\n var t = on(arguments);\n return "#" + fn(t[0]) + fn(t[1]) + fn(t[2]) + (t[3] < 1 ? fn(Math.round(255 * t[3])) : "");\n }, ln.to.rgb = function() {\n var t = on(arguments);\n return t.length < 4 || 1 === t[3] ? "rgb(" + Math.round(t[0]) + ", " + Math.round(t[1]) + ", " + Math.round(t[2]) + ")" : "rgba(" + Math.round(t[0]) + ", " + Math.round(t[1]) + ", " + Math.round(t[2]) + ", " + t[3] + ")";\n }, ln.to.rgb.percent = function() {\n var t = on(arguments), n = Math.round(t[0] / 255 * 100), i = Math.round(t[1] / 255 * 100), e = Math.round(t[2] / 255 * 100);\n return t.length < 4 || 1 === t[3] ? "rgb(" + n + "%, " + i + "%, " + e + "%)" : "rgba(" + n + "%, " + i + "%, " + e + "%, " + t[3] + ")";\n }, ln.to.hsl = function() {\n var t = on(arguments);\n return t.length < 4 || 1 === t[3] ? "hsl(" + t[0] + ", " + t[1] + "%, " + t[2] + "%)" : "hsla(" + t[0] + ", " + t[1] + "%, " + t[2] + "%, " + t[3] + ")";\n }, ln.to.hwb = function() {\n var t = on(arguments), n = "";\n return t.length >= 4 && 1 !== t[3] && (n = ", " + t[3]), "hwb(" + t[0] + ", " + t[1] + "%, " + t[2] + "%" + n + ")";\n }, ln.to.keyword = function(t) {\n return hn[t.slice(0, 3)];\n };\n var dn = {\n exports: {}\n }, yn = Kt, vn = {};\n for (var pn in yn) yn.hasOwnProperty(pn) && (vn[yn[pn]] = pn);\n var mn = dn.exports = {\n rgb: {\n channels: 3,\n labels: "rgb"\n },\n hsl: {\n channels: 3,\n labels: "hsl"\n },\n hsv: {\n channels: 3,\n labels: "hsv"\n },\n hwb: {\n channels: 3,\n labels: "hwb"\n },\n cmyk: {\n channels: 4,\n labels: "cmyk"\n },\n xyz: {\n channels: 3,\n labels: "xyz"\n },\n lab: {\n channels: 3,\n labels: "lab"\n },\n lch: {\n channels: 3,\n labels: "lch"\n },\n hex: {\n channels: 1,\n labels: [ "hex" ]\n },\n keyword: {\n channels: 1,\n labels: [ "keyword" ]\n },\n ansi16: {\n channels: 1,\n labels: [ "ansi16" ]\n },\n ansi256: {\n channels: 1,\n labels: [ "ansi256" ]\n },\n hcg: {\n channels: 3,\n labels: [ "h", "c", "g" ]\n },\n apple: {\n channels: 3,\n labels: [ "r16", "g16", "b16" ]\n },\n gray: {\n channels: 1,\n labels: [ "gray" ]\n }\n };\n for (var gn in mn) if (mn.hasOwnProperty(gn)) {\n if (!("channels" in mn[gn])) throw new Error("missing channels property: " + gn);\n if (!("labels" in mn[gn])) throw new Error("missing channel labels property: " + gn);\n if (mn[gn].labels.length !== mn[gn].channels) throw new Error("channel and label counts mismatch: " + gn);\n var wn = mn[gn].channels, Mn = mn[gn].labels;\n delete mn[gn].channels, delete mn[gn].labels, Object.defineProperty(mn[gn], "channels", {\n value: wn\n }), Object.defineProperty(mn[gn], "labels", {\n value: Mn\n });\n }\n function bn(t, n) {\n return Math.pow(t[0] - n[0], 2) + Math.pow(t[1] - n[1], 2) + Math.pow(t[2] - n[2], 2);\n }\n mn.rgb.hsl = function(t) {\n var n, i, e = t[0] / 255, r = t[1] / 255, s = t[2] / 255, o = Math.min(e, r, s), a = Math.max(e, r, s), h = a - o;\n return a === o ? n = 0 : e === a ? n = (r - s) / h : r === a ? n = 2 + (s - e) / h : s === a && (n = 4 + (e - r) / h), \n (n = Math.min(60 * n, 360)) < 0 && (n += 360), i = (o + a) / 2, [ n, 100 * (a === o ? 0 : i <= .5 ? h / (a + o) : h / (2 - a - o)), 100 * i ];\n }, mn.rgb.hsv = function(t) {\n var n, i, e, r, s, o = t[0] / 255, a = t[1] / 255, h = t[2] / 255, u = Math.max(o, a, h), l = u - Math.min(o, a, h), c = function(t) {\n return (u - t) / 6 / l + .5;\n };\n return 0 === l ? r = s = 0 : (s = l / u, n = c(o), i = c(a), e = c(h), o === u ? r = e - i : a === u ? r = 1 / 3 + n - e : h === u && (r = 2 / 3 + i - n), \n r < 0 ? r += 1 : r > 1 && (r -= 1)), [ 360 * r, 100 * s, 100 * u ];\n }, mn.rgb.hwb = function(t) {\n var n = t[0], i = t[1], e = t[2];\n return [ mn.rgb.hsl(t)[0], 100 * (1 / 255 * Math.min(n, Math.min(i, e))), 100 * (e = 1 - 1 / 255 * Math.max(n, Math.max(i, e))) ];\n }, mn.rgb.cmyk = function(t) {\n var n, i = t[0] / 255, e = t[1] / 255, r = t[2] / 255;\n return [ 100 * ((1 - i - (n = Math.min(1 - i, 1 - e, 1 - r))) / (1 - n) || 0), 100 * ((1 - e - n) / (1 - n) || 0), 100 * ((1 - r - n) / (1 - n) || 0), 100 * n ];\n }, mn.rgb.keyword = function(t) {\n var n = vn[t];\n if (n) return n;\n var i, e = 1 / 0;\n for (var r in yn) if (yn.hasOwnProperty(r)) {\n var s = bn(t, yn[r]);\n s < e && (e = s, i = r);\n }\n return i;\n }, mn.keyword.rgb = function(t) {\n return yn[t];\n }, mn.rgb.xyz = function(t) {\n var n = t[0] / 255, i = t[1] / 255, e = t[2] / 255;\n return [ 100 * (.4124 * (n = n > .04045 ? Math.pow((n + .055) / 1.055, 2.4) : n / 12.92) + .3576 * (i = i > .04045 ? Math.pow((i + .055) / 1.055, 2.4) : i / 12.92) + .1805 * (e = e > .04045 ? Math.pow((e + .055) / 1.055, 2.4) : e / 12.92)), 100 * (.2126 * n + .7152 * i + .0722 * e), 100 * (.0193 * n + .1192 * i + .9505 * e) ];\n }, mn.rgb.lab = function(t) {\n var n = mn.rgb.xyz(t), i = n[0], e = n[1], r = n[2];\n return e /= 100, r /= 108.883, i = (i /= 95.047) > .008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116, \n [ 116 * (e = e > .008856 ? Math.pow(e, 1 / 3) : 7.787 * e + 16 / 116) - 16, 500 * (i - e), 200 * (e - (r = r > .008856 ? Math.pow(r, 1 / 3) : 7.787 * r + 16 / 116)) ];\n }, mn.hsl.rgb = function(t) {\n var n, i, e, r, s, o = t[0] / 360, a = t[1] / 100, h = t[2] / 100;\n if (0 === a) return [ s = 255 * h, s, s ];\n n = 2 * h - (i = h < .5 ? h * (1 + a) : h + a - h * a), r = [ 0, 0, 0 ];\n for (var u = 0; u < 3; u++) (e = o + 1 / 3 * -(u - 1)) < 0 && e++, e > 1 && e--, \n s = 6 * e < 1 ? n + 6 * (i - n) * e : 2 * e < 1 ? i : 3 * e < 2 ? n + (i - n) * (2 / 3 - e) * 6 : n, \n r[u] = 255 * s;\n return r;\n }, mn.hsl.hsv = function(t) {\n var n = t[0], i = t[1] / 100, e = t[2] / 100, r = i, s = Math.max(e, .01);\n return i *= (e *= 2) <= 1 ? e : 2 - e, r *= s <= 1 ? s : 2 - s, [ n, 100 * (0 === e ? 2 * r / (s + r) : 2 * i / (e + i)), 100 * ((e + i) / 2) ];\n }, mn.hsv.rgb = function(t) {\n var n = t[0] / 60, i = t[1] / 100, e = t[2] / 100, r = Math.floor(n) % 6, s = n - Math.floor(n), o = 255 * e * (1 - i), a = 255 * e * (1 - i * s), h = 255 * e * (1 - i * (1 - s));\n switch (e *= 255, r) {\n case 0:\n return [ e, h, o ];\n\n case 1:\n return [ a, e, o ];\n\n case 2:\n return [ o, e, h ];\n\n case 3:\n return [ o, a, e ];\n\n case 4:\n return [ h, o, e ];\n\n case 5:\n return [ e, o, a ];\n }\n }, mn.hsv.hsl = function(t) {\n var n, i, e, r = t[0], s = t[1] / 100, o = t[2] / 100, a = Math.max(o, .01);\n return e = (2 - s) * o, i = s * a, [ r, 100 * (i = (i /= (n = (2 - s) * a) <= 1 ? n : 2 - n) || 0), 100 * (e /= 2) ];\n }, mn.hwb.rgb = function(t) {\n var n, i, e, r, s, o, a, h = t[0] / 360, u = t[1] / 100, l = t[2] / 100, c = u + l;\n switch (c > 1 && (u /= c, l /= c), e = 6 * h - (n = Math.floor(6 * h)), 0 != (1 & n) && (e = 1 - e), \n r = u + e * ((i = 1 - l) - u), n) {\n default:\n case 6:\n case 0:\n s = i, o = r, a = u;\n break;\n\n case 1:\n s = r, o = i, a = u;\n break;\n\n case 2:\n s = u, o = i, a = r;\n break;\n\n case 3:\n s = u, o = r, a = i;\n break;\n\n case 4:\n s = r, o = u, a = i;\n break;\n\n case 5:\n s = i, o = u, a = r;\n }\n return [ 255 * s, 255 * o, 255 * a ];\n }, mn.cmyk.rgb = function(t) {\n var n = t[0] / 100, i = t[1] / 100, e = t[2] / 100, r = t[3] / 100;\n return [ 255 * (1 - Math.min(1, n * (1 - r) + r)), 255 * (1 - Math.min(1, i * (1 - r) + r)), 255 * (1 - Math.min(1, e * (1 - r) + r)) ];\n }, mn.xyz.rgb = function(t) {\n var n, i, e, r = t[0] / 100, s = t[1] / 100, o = t[2] / 100;\n return i = -.9689 * r + 1.8758 * s + .0415 * o, e = .0557 * r + -.204 * s + 1.057 * o, \n n = (n = 3.2406 * r + -1.5372 * s + -.4986 * o) > .0031308 ? 1.055 * Math.pow(n, 1 / 2.4) - .055 : 12.92 * n, \n i = i > .0031308 ? 1.055 * Math.pow(i, 1 / 2.4) - .055 : 12.92 * i, e = e > .0031308 ? 1.055 * Math.pow(e, 1 / 2.4) - .055 : 12.92 * e, \n [ 255 * (n = Math.min(Math.max(0, n), 1)), 255 * (i = Math.min(Math.max(0, i), 1)), 255 * (e = Math.min(Math.max(0, e), 1)) ];\n }, mn.xyz.lab = function(t) {\n var n = t[0], i = t[1], e = t[2];\n return i /= 100, e /= 108.883, n = (n /= 95.047) > .008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116, \n [ 116 * (i = i > .008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116) - 16, 500 * (n - i), 200 * (i - (e = e > .008856 ? Math.pow(e, 1 / 3) : 7.787 * e + 16 / 116)) ];\n }, mn.lab.xyz = function(t) {\n var n, i, e, r = t[0];\n n = t[1] / 500 + (i = (r + 16) / 116), e = i - t[2] / 200;\n var s = Math.pow(i, 3), o = Math.pow(n, 3), a = Math.pow(e, 3);\n return i = s > .008856 ? s : (i - 16 / 116) / 7.787, n = o > .008856 ? o : (n - 16 / 116) / 7.787, \n e = a > .008856 ? a : (e - 16 / 116) / 7.787, [ n *= 95.047, i *= 100, e *= 108.883 ];\n }, mn.lab.lch = function(t) {\n var n, i = t[0], e = t[1], r = t[2];\n return (n = 360 * Math.atan2(r, e) / 2 / Math.PI) < 0 && (n += 360), [ i, Math.sqrt(e * e + r * r), n ];\n }, mn.lch.lab = function(t) {\n var n, i = t[0], e = t[1];\n return n = t[2] / 360 * 2 * Math.PI, [ i, e * Math.cos(n), e * Math.sin(n) ];\n }, mn.rgb.ansi16 = function(t) {\n var n = t[0], i = t[1], e = t[2], r = 1 in arguments ? arguments[1] : mn.rgb.hsv(t)[2];\n if (0 === (r = Math.round(r / 50))) return 30;\n var s = 30 + (Math.round(e / 255) << 2 | Math.round(i / 255) << 1 | Math.round(n / 255));\n return 2 === r && (s += 60), s;\n }, mn.hsv.ansi16 = function(t) {\n return mn.rgb.ansi16(mn.hsv.rgb(t), t[2]);\n }, mn.rgb.ansi256 = function(t) {\n var n = t[0], i = t[1], e = t[2];\n return n === i && i === e ? n < 8 ? 16 : n > 248 ? 231 : Math.round((n - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(n / 255 * 5) + 6 * Math.round(i / 255 * 5) + Math.round(e / 255 * 5);\n }, mn.ansi16.rgb = function(t) {\n var n = t % 10;\n if (0 === n || 7 === n) return t > 50 && (n += 3.5), [ n = n / 10.5 * 255, n, n ];\n var i = .5 * (1 + ~~(t > 50));\n return [ (1 & n) * i * 255, (n >> 1 & 1) * i * 255, (n >> 2 & 1) * i * 255 ];\n }, mn.ansi256.rgb = function(t) {\n if (t >= 232) {\n var n = 10 * (t - 232) + 8;\n return [ n, n, n ];\n }\n var i;\n return t -= 16, [ Math.floor(t / 36) / 5 * 255, Math.floor((i = t % 36) / 6) / 5 * 255, i % 6 / 5 * 255 ];\n }, mn.rgb.hex = function(t) {\n var n = (((255 & Math.round(t[0])) << 16) + ((255 & Math.round(t[1])) << 8) + (255 & Math.round(t[2]))).toString(16).toUpperCase();\n return "000000".substring(n.length) + n;\n }, mn.hex.rgb = function(t) {\n var n = t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n if (!n) return [ 0, 0, 0 ];\n var i = n[0];\n 3 === n[0].length && (i = i.split("").map((function(t) {\n return t + t;\n })).join(""));\n var e = parseInt(i, 16);\n return [ e >> 16 & 255, e >> 8 & 255, 255 & e ];\n }, mn.rgb.hcg = function(t) {\n var n, i = t[0] / 255, e = t[1] / 255, r = t[2] / 255, s = Math.max(Math.max(i, e), r), o = Math.min(Math.min(i, e), r), a = s - o;\n return n = a <= 0 ? 0 : s === i ? (e - r) / a % 6 : s === e ? 2 + (r - i) / a : 4 + (i - e) / a + 4, \n n /= 6, [ 360 * (n %= 1), 100 * a, 100 * (a < 1 ? o / (1 - a) : 0) ];\n }, mn.hsl.hcg = function(t) {\n var n = t[1] / 100, i = t[2] / 100, e = 1, r = 0;\n return (e = i < .5 ? 2 * n * i : 2 * n * (1 - i)) < 1 && (r = (i - .5 * e) / (1 - e)), \n [ t[0], 100 * e, 100 * r ];\n }, mn.hsv.hcg = function(t) {\n var n = t[1] / 100, i = t[2] / 100, e = n * i, r = 0;\n return e < 1 && (r = (i - e) / (1 - e)), [ t[0], 100 * e, 100 * r ];\n }, mn.hcg.rgb = function(t) {\n var n = t[0] / 360, i = t[1] / 100, e = t[2] / 100;\n if (0 === i) return [ 255 * e, 255 * e, 255 * e ];\n var r, s = [ 0, 0, 0 ], o = n % 1 * 6, a = o % 1, h = 1 - a;\n switch (Math.floor(o)) {\n case 0:\n s[0] = 1, s[1] = a, s[2] = 0;\n break;\n\n case 1:\n s[0] = h, s[1] = 1, s[2] = 0;\n break;\n\n case 2:\n s[0] = 0, s[1] = 1, s[2] = a;\n break;\n\n case 3:\n s[0] = 0, s[1] = h, s[2] = 1;\n break;\n\n case 4:\n s[0] = a, s[1] = 0, s[2] = 1;\n break;\n\n default:\n s[0] = 1, s[1] = 0, s[2] = h;\n }\n return r = (1 - i) * e, [ 255 * (i * s[0] + r), 255 * (i * s[1] + r), 255 * (i * s[2] + r) ];\n }, mn.hcg.hsv = function(t) {\n var n = t[1] / 100, i = n + t[2] / 100 * (1 - n), e = 0;\n return i > 0 && (e = n / i), [ t[0], 100 * e, 100 * i ];\n }, mn.hcg.hsl = function(t) {\n var n = t[1] / 100, i = t[2] / 100 * (1 - n) + .5 * n, e = 0;\n return i > 0 && i < .5 ? e = n / (2 * i) : i >= .5 && i < 1 && (e = n / (2 * (1 - i))), \n [ t[0], 100 * e, 100 * i ];\n }, mn.hcg.hwb = function(t) {\n var n = t[1] / 100, i = n + t[2] / 100 * (1 - n);\n return [ t[0], 100 * (i - n), 100 * (1 - i) ];\n }, mn.hwb.hcg = function(t) {\n var n = t[1] / 100, i = 1 - t[2] / 100, e = i - n, r = 0;\n return e < 1 && (r = (i - e) / (1 - e)), [ t[0], 100 * e, 100 * r ];\n }, mn.apple.rgb = function(t) {\n return [ t[0] / 65535 * 255, t[1] / 65535 * 255, t[2] / 65535 * 255 ];\n }, mn.rgb.apple = function(t) {\n return [ t[0] / 255 * 65535, t[1] / 255 * 65535, t[2] / 255 * 65535 ];\n }, mn.gray.rgb = function(t) {\n return [ t[0] / 100 * 255, t[0] / 100 * 255, t[0] / 100 * 255 ];\n }, mn.gray.hsl = mn.gray.hsv = function(t) {\n return [ 0, 0, t[0] ];\n }, mn.gray.hwb = function(t) {\n return [ 0, 100, t[0] ];\n }, mn.gray.cmyk = function(t) {\n return [ 0, 0, 0, t[0] ];\n }, mn.gray.lab = function(t) {\n return [ t[0], 0, 0 ];\n }, mn.gray.hex = function(t) {\n var n = 255 & Math.round(t[0] / 100 * 255), i = ((n << 16) + (n << 8) + n).toString(16).toUpperCase();\n return "000000".substring(i.length) + i;\n }, mn.rgb.gray = function(t) {\n return [ (t[0] + t[1] + t[2]) / 3 / 255 * 100 ];\n };\n var xn = dn.exports;\n function Fn(t) {\n var n = function() {\n for (var t = {}, n = Object.keys(xn), i = n.length, e = 0; e < i; e++) t[n[e]] = {\n distance: -1,\n parent: null\n };\n return t;\n }(), i = [ t ];\n for (n[t].distance = 0; i.length; ) for (var e = i.pop(), r = Object.keys(xn[e]), s = r.length, o = 0; o < s; o++) {\n var a = r[o], h = n[a];\n -1 === h.distance && (h.distance = n[e].distance + 1, h.parent = e, i.unshift(a));\n }\n return n;\n }\n function An(t, n) {\n return function(i) {\n return n(t(i));\n };\n }\n function kn(t, n) {\n for (var i = [ n[t].parent, t ], e = xn[n[t].parent][t], r = n[t].parent; n[r].parent; ) i.unshift(n[r].parent), \n e = An(xn[n[r].parent][r], e), r = n[r].parent;\n return e.conversion = i, e;\n }\n var Pn = dn.exports, Sn = function(t) {\n for (var n = Fn(t), i = {}, e = Object.keys(n), r = e.length, s = 0; s < r; s++) {\n var o = e[s];\n null !== n[o].parent && (i[o] = kn(o, n));\n }\n return i;\n }, _n = {};\n Object.keys(Pn).forEach((function(t) {\n _n[t] = {}, Object.defineProperty(_n[t], "channels", {\n value: Pn[t].channels\n }), Object.defineProperty(_n[t], "labels", {\n value: Pn[t].labels\n });\n var n = Sn(t);\n Object.keys(n).forEach((function(i) {\n var e = n[i];\n _n[t][i] = function(t) {\n var n = function(n) {\n if (null == n) return n;\n arguments.length > 1 && (n = Array.prototype.slice.call(arguments));\n var i = t(n);\n if ("object" == typeof i) for (var e = i.length, r = 0; r < e; r++) i[r] = Math.round(i[r]);\n return i;\n };\n return "conversion" in t && (n.conversion = t.conversion), n;\n }(e), _n[t][i].raw = function(t) {\n var n = function(n) {\n return null == n ? n : (arguments.length > 1 && (n = Array.prototype.slice.call(arguments)), \n t(n));\n };\n return "conversion" in t && (n.conversion = t.conversion), n;\n }(e);\n }));\n }));\n var On = _n, In = Yt.exports, Tn = On, Ln = [].slice, Un = [ "keyword", "gray", "hex" ], zn = {};\n Object.keys(Tn).forEach((function(t) {\n zn[Ln.call(Tn[t].labels).sort().join("")] = t;\n }));\n var Dn = {};\n function En(t, n) {\n if (!(this instanceof En)) return new En(t, n);\n if (n && n in Un && (n = null), n && !(n in Tn)) throw new Error("Unknown model: " + n);\n var i, e;\n if (null == t) this.model = "rgb", this.color = [ 0, 0, 0 ], this.valpha = 1; else if (t instanceof En) this.model = t.model, \n this.color = t.color.slice(), this.valpha = t.valpha; else if ("string" == typeof t) {\n var r = In.get(t);\n if (null === r) throw new Error("Unable to parse color from string: " + t);\n this.model = r.model, e = Tn[this.model].channels, this.color = r.value.slice(0, e), \n this.valpha = "number" == typeof r.value[e] ? r.value[e] : 1;\n } else if (t.length) {\n this.model = n || "rgb", e = Tn[this.model].channels;\n var s = Ln.call(t, 0, e);\n this.color = Hn(s, e), this.valpha = "number" == typeof t[e] ? t[e] : 1;\n } else if ("number" == typeof t) t &= 16777215, this.model = "rgb", this.color = [ t >> 16 & 255, t >> 8 & 255, 255 & t ], \n this.valpha = 1; else {\n this.valpha = 1;\n var o = Object.keys(t);\n "alpha" in t && (o.splice(o.indexOf("alpha"), 1), this.valpha = "number" == typeof t.alpha ? t.alpha : 0);\n var a = o.sort().join("");\n if (!(a in zn)) throw new Error("Unable to parse color from object: " + JSON.stringify(t));\n this.model = zn[a];\n var h = Tn[this.model].labels, u = [];\n for (i = 0; i < h.length; i++) u.push(t[h[i]]);\n this.color = Hn(u);\n }\n if (Dn[this.model]) for (e = Tn[this.model].channels, i = 0; i < e; i++) {\n var l = Dn[this.model][i];\n l && (this.color[i] = l(this.color[i]));\n }\n this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this);\n }\n function Cn(t, n, i) {\n return (t = Array.isArray(t) ? t : [ t ]).forEach((function(t) {\n (Dn[t] || (Dn[t] = []))[n] = i;\n })), t = t[0], function(e) {\n var r;\n return arguments.length ? (i && (e = i(e)), (r = this[t]()).color[n] = e, r) : (r = this[t]().color[n], \n i && (r = i(r)), r);\n };\n }\n function jn(t) {\n return function(n) {\n return Math.max(0, Math.min(t, n));\n };\n }\n function Nn(t) {\n return Array.isArray(t) ? t : [ t ];\n }\n function Hn(t, n) {\n for (var i = 0; i < n; i++) "number" != typeof t[i] && (t[i] = 0);\n return t;\n }\n En.prototype = {\n toString: function() {\n return this.string();\n },\n toJSON: function() {\n return this[this.model]();\n },\n string: function(t) {\n var n = this.model in In.to ? this : this.rgb(), i = 1 === (n = n.round("number" == typeof t ? t : 1)).valpha ? n.color : n.color.concat(this.valpha);\n return In.to[n.model](i);\n },\n percentString: function(t) {\n var n = this.rgb().round("number" == typeof t ? t : 1), i = 1 === n.valpha ? n.color : n.color.concat(this.valpha);\n return In.to.rgb.percent(i);\n },\n array: function() {\n return 1 === this.valpha ? this.color.slice() : this.color.concat(this.valpha);\n },\n object: function() {\n for (var t = {}, n = Tn[this.model].channels, i = Tn[this.model].labels, e = 0; e < n; e++) t[i[e]] = this.color[e];\n return 1 !== this.valpha && (t.alpha = this.valpha), t;\n },\n unitArray: function() {\n var t = this.rgb().color;\n return t[0] /= 255, t[1] /= 255, t[2] /= 255, 1 !== this.valpha && t.push(this.valpha), \n t;\n },\n unitObject: function() {\n var t = this.rgb().object();\n return t.r /= 255, t.g /= 255, t.b /= 255, 1 !== this.valpha && (t.alpha = this.valpha), \n t;\n },\n round: function(t) {\n return t = Math.max(t || 0, 0), new En(this.color.map(function(t) {\n return function(n) {\n return function(t, n) {\n return Number(t.toFixed(n));\n }(n, t);\n };\n }(t)).concat(this.valpha), this.model);\n },\n alpha: function(t) {\n return arguments.length ? new En(this.color.concat(Math.max(0, Math.min(1, t))), this.model) : this.valpha;\n },\n red: Cn("rgb", 0, jn(255)),\n green: Cn("rgb", 1, jn(255)),\n blue: Cn("rgb", 2, jn(255)),\n hue: Cn([ "hsl", "hsv", "hsl", "hwb", "hcg" ], 0, (function(t) {\n return (t % 360 + 360) % 360;\n })),\n saturationl: Cn("hsl", 1, jn(100)),\n lightness: Cn("hsl", 2, jn(100)),\n saturationv: Cn("hsv", 1, jn(100)),\n value: Cn("hsv", 2, jn(100)),\n chroma: Cn("hcg", 1, jn(100)),\n gray: Cn("hcg", 2, jn(100)),\n white: Cn("hwb", 1, jn(100)),\n wblack: Cn("hwb", 2, jn(100)),\n cyan: Cn("cmyk", 0, jn(100)),\n magenta: Cn("cmyk", 1, jn(100)),\n yellow: Cn("cmyk", 2, jn(100)),\n black: Cn("cmyk", 3, jn(100)),\n x: Cn("xyz", 0, jn(100)),\n y: Cn("xyz", 1, jn(100)),\n z: Cn("xyz", 2, jn(100)),\n l: Cn("lab", 0, jn(100)),\n a: Cn("lab", 1),\n b: Cn("lab", 2),\n keyword: function(t) {\n return arguments.length ? new En(t) : Tn[this.model].keyword(this.color);\n },\n hex: function(t) {\n return arguments.length ? new En(t) : In.to.hex(this.rgb().round().color);\n },\n rgbNumber: function() {\n var t = this.rgb().color;\n return (255 & t[0]) << 16 | (255 & t[1]) << 8 | 255 & t[2];\n },\n luminosity: function() {\n for (var t = this.rgb().color, n = [], i = 0; i < t.length; i++) {\n var e = t[i] / 255;\n n[i] = e <= .03928 ? e / 12.92 : Math.pow((e + .055) / 1.055, 2.4);\n }\n return .2126 * n[0] + .7152 * n[1] + .0722 * n[2];\n },\n contrast: function(t) {\n var n = this.luminosity(), i = t.luminosity();\n return n > i ? (n + .05) / (i + .05) : (i + .05) / (n + .05);\n },\n level: function(t) {\n var n = this.contrast(t);\n return n >= 7.1 ? "AAA" : n >= 4.5 ? "AA" : "";\n },\n isDark: function() {\n var t = this.rgb().color;\n return (299 * t[0] + 587 * t[1] + 114 * t[2]) / 1e3 < 128;\n },\n isLight: function() {\n return !this.isDark();\n },\n negate: function() {\n for (var t = this.rgb(), n = 0; n < 3; n++) t.color[n] = 255 - t.color[n];\n return t;\n },\n lighten: function(t) {\n var n = this.hsl();\n return n.color[2] += n.color[2] * t, n;\n },\n darken: function(t) {\n var n = this.hsl();\n return n.color[2] -= n.color[2] * t, n;\n },\n saturate: function(t) {\n var n = this.hsl();\n return n.color[1] += n.color[1] * t, n;\n },\n desaturate: function(t) {\n var n = this.hsl();\n return n.color[1] -= n.color[1] * t, n;\n },\n whiten: function(t) {\n var n = this.hwb();\n return n.color[1] += n.color[1] * t, n;\n },\n blacken: function(t) {\n var n = this.hwb();\n return n.color[2] += n.color[2] * t, n;\n },\n grayscale: function() {\n var t = this.rgb().color, n = .3 * t[0] + .59 * t[1] + .11 * t[2];\n return En.rgb(n, n, n);\n },\n fade: function(t) {\n return this.alpha(this.valpha - this.valpha * t);\n },\n opaquer: function(t) {\n return this.alpha(this.valpha + this.valpha * t);\n },\n rotate: function(t) {\n var n = this.hsl(), i = n.color[0];\n return i = (i = (i + t) % 360) < 0 ? 360 + i : i, n.color[0] = i, n;\n },\n mix: function(t, n) {\n if (!t || !t.rgb) throw new Error(\'Argument to "mix" was not a Color instance, but rather an instance of \' + typeof t);\n var i = t.rgb(), e = this.rgb(), r = void 0 === n ? .5 : n, s = 2 * r - 1, o = i.alpha() - e.alpha(), a = ((s * o == -1 ? s : (s + o) / (1 + s * o)) + 1) / 2, h = 1 - a;\n return En.rgb(a * i.red() + h * e.red(), a * i.green() + h * e.green(), a * i.blue() + h * e.blue(), i.alpha() * r + e.alpha() * (1 - r));\n }\n }, Object.keys(Tn).forEach((function(t) {\n if (-1 === Un.indexOf(t)) {\n var n = Tn[t].channels;\n En.prototype[t] = function() {\n if (this.model === t) return new En(this);\n if (arguments.length) return new En(arguments, t);\n var i = "number" == typeof arguments[n] ? n : this.valpha;\n return new En(Nn(Tn[this.model][t].raw(this.color)).concat(i), t);\n }, En[t] = function(i) {\n return "number" == typeof i && (i = Hn(Ln.call(arguments), n)), new En(i, t);\n };\n }\n }));\n var Vn = En;\n class Rn {\n constructor(t, n) {\n this.position = t, this.index = n, this.faces = [], this.neighbors = [];\n }\n addUniqueNeighbor(t) {\n -1 === this.neighbors.indexOf(t) && this.neighbors.push(t);\n }\n }\n class $n {\n constructor(t, n, i, e) {\n this.a = e.a, this.b = e.b, this.c = e.c, this.v1 = t, this.v2 = n, this.v3 = i, \n this.normal = [], this.computeNormal(), t.faces.push(this), t.addUniqueNeighbor(n), \n t.addUniqueNeighbor(i), n.faces.push(this), n.addUniqueNeighbor(t), n.addUniqueNeighbor(i), \n i.faces.push(this), i.addUniqueNeighbor(t), i.addUniqueNeighbor(n);\n }\n computeNormal() {\n const t = this.v1.position, n = this.v2.position, i = this.v3.position, e = Pt([], St([], i, n), St([], t, n));\n At(this.normal, e);\n }\n hasVertex(t) {\n return t === this.v1 || t === this.v2 || t === this.v3;\n }\n }\n /*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */ const Wn = [], qn = [], Bn = [], Gn = [];\n function Jn(t, n, i) {\n const e = Pt(qn, n, i);\n t = Tt(t, function(t, n, i, e, r, s, o, a, h, u) {\n return t[0] = n, t[1] = i, t[2] = e, t[3] = r, t[4] = s, t[5] = o, t[6] = a, t[7] = h, \n t[8] = u, t;\n }(Wn, i[0], i[1], i[2], ...e, ...n));\n if ((t = function(t) {\n return t[3] < 0 ? Ut(t, t, -1) : t;\n }(t = zt(t, t)))[3] < 1 / 32767) {\n t[3] = 1 / 32767;\n const n = Math.sqrt(.9999999990686206);\n t[0] *= n, t[1] *= n, t[2] *= n;\n }\n const r = i[3] > 0 ? Pt(Bn, i, n) : Pt(Bn, n, i);\n return kt(Pt(Gn, i, n), r) < 0 && Ut(t, t, -1), t;\n }\n function Xn(t, n) {\n const i = [], e = [];\n let r = 0;\n for (r = 0; r < t.length; r += 3) {\n const n = new Rn([ t[r], t[r + 1], t[r + 2] ], r / 3);\n i.push(n);\n }\n if (!n.length) {\n const t = n;\n n = [];\n for (let i = 0; i < t; i++) n.push(i);\n }\n for (r = 0; r < n.length / 3; r++) {\n const t = {\n a: n[3 * r],\n b: n[3 * r + 1],\n c: n[3 * r + 2]\n };\n new $n(i[t.a], i[t.b], i[t.c], t);\n }\n const s = [], o = [ 0, 0, 0 ];\n for (r = 0; r < i.length; r++) {\n const t = i[r], n = t.index;\n bt(o, 0, 0, 0);\n let a = t.faces.length;\n for (let n = 0; n < a; n++) xt(o, o, t.faces[n].normal);\n a = a || 1, bt(s, a, a, a), Ft(o, o, s), e[3 * n] = o[0], e[3 * n + 1] = o[1], e[3 * n + 2] = o[2];\n }\n return e;\n }\n /*!\n * Contains code from THREE.JS\n * https://github.com/mrdoob/three.js/\n * License MIT\n * \n * Generate tangents per vertex.\n */ function Zn(t, n, i) {\n return t[0] = n[i], t[1] = n[i + 1], t[2] = n[i + 2], t;\n }\n function Yn(t, n, i) {\n return t[0] = n[i], t[1] = n[i + 1], t;\n }\n var Kn = {\n exports: {}\n };\n function Qn(t, n, i) {\n i = i || 2;\n var e, r, s, o, a, h, u, l = n && n.length, c = l ? n[0] * i : t.length, f = ti(t, 0, c, i, !0), d = [];\n if (!f || f.next === f.prev) return d;\n if (l && (f = function(t, n, i, e) {\n var r, s, o, a, h, u = [];\n for (r = 0, s = n.length; r < s; r++) o = n[r] * e, a = r < s - 1 ? n[r + 1] * e : t.length, \n (h = ti(t, o, a, e, !1)) === h.next && (h.steiner = !0), u.push(ci(h));\n for (u.sort(ai), r = 0; r < u.length; r++) i = ni(i = hi(u[r], i), i.next);\n return i;\n }(t, n, f, i)), t.length > 80 * i) {\n e = s = t[0], r = o = t[1];\n for (var y = i; y < c; y += i) (a = t[y]) < e && (e = a), (h = t[y + 1]) < r && (r = h), \n a > s && (s = a), h > o && (o = h);\n u = 0 !== (u = Math.max(s - e, o - r)) ? 1 / u : 0;\n }\n return ii(f, d, i, e, r, u), d;\n }\n function ti(t, n, i, e, r) {\n var s, o;\n if (r === Ai(t, n, i, e) > 0) for (s = n; s < i; s += e) o = bi(s, t[s], t[s + 1], o); else for (s = i - e; s >= n; s -= e) o = bi(s, t[s], t[s + 1], o);\n return o && vi(o, o.next) && (xi(o), o = o.next), o;\n }\n function ni(t, n) {\n if (!t) return t;\n n || (n = t);\n var i, e = t;\n do {\n if (i = !1, e.steiner || !vi(e, e.next) && 0 !== yi(e.prev, e, e.next)) e = e.next; else {\n if (xi(e), (e = n = e.prev) === e.next) break;\n i = !0;\n }\n } while (i || e !== n);\n return n;\n }\n function ii(t, n, i, e, r, s, o) {\n if (t) {\n !o && s && function(t, n, i, e) {\n var r = t;\n do {\n null === r.z && (r.z = li(r.x, r.y, n, i, e)), r.prevZ = r.prev, r.nextZ = r.next, \n r = r.next;\n } while (r !== t);\n r.prevZ.nextZ = null, r.prevZ = null, function(t) {\n var n, i, e, r, s, o, a, h, u = 1;\n do {\n for (i = t, t = null, s = null, o = 0; i; ) {\n for (o++, e = i, a = 0, n = 0; n < u && (a++, e = e.nextZ); n++) ;\n for (h = u; a > 0 || h > 0 && e; ) 0 !== a && (0 === h || !e || i.z <= e.z) ? (r = i, \n i = i.nextZ, a--) : (r = e, e = e.nextZ, h--), s ? s.nextZ = r : t = r, r.prevZ = s, \n s = r;\n i = e;\n }\n s.nextZ = null, u *= 2;\n } while (o > 1);\n }(r);\n }(t, e, r, s);\n for (var a, h, u = t; t.prev !== t.next; ) if (a = t.prev, h = t.next, s ? ri(t, e, r, s) : ei(t)) n.push(a.i / i), \n n.push(t.i / i), n.push(h.i / i), xi(t), t = h.next, u = h.next; else if ((t = h) === u) {\n o ? 1 === o ? ii(t = si(ni(t), n, i), n, i, e, r, s, 2) : 2 === o && oi(t, n, i, e, r, s) : ii(ni(t), n, i, e, r, s, 1);\n break;\n }\n }\n }\n function ei(t) {\n var n = t.prev, i = t, e = t.next;\n if (yi(n, i, e) >= 0) return !1;\n for (var r = t.next.next; r !== t.prev; ) {\n if (fi(n.x, n.y, i.x, i.y, e.x, e.y, r.x, r.y) && yi(r.prev, r, r.next) >= 0) return !1;\n r = r.next;\n }\n return !0;\n }\n function ri(t, n, i, e) {\n var r = t.prev, s = t, o = t.next;\n if (yi(r, s, o) >= 0) return !1;\n for (var a = r.x < s.x ? r.x < o.x ? r.x : o.x : s.x < o.x ? s.x : o.x, h = r.y < s.y ? r.y < o.y ? r.y : o.y : s.y < o.y ? s.y : o.y, u = r.x > s.x ? r.x > o.x ? r.x : o.x : s.x > o.x ? s.x : o.x, l = r.y > s.y ? r.y > o.y ? r.y : o.y : s.y > o.y ? s.y : o.y, c = li(a, h, n, i, e), f = li(u, l, n, i, e), d = t.prevZ, y = t.nextZ; d && d.z >= c && y && y.z <= f; ) {\n if (d !== t.prev && d !== t.next && fi(r.x, r.y, s.x, s.y, o.x, o.y, d.x, d.y) && yi(d.prev, d, d.next) >= 0) return !1;\n if (d = d.prevZ, y !== t.prev && y !== t.next && fi(r.x, r.y, s.x, s.y, o.x, o.y, y.x, y.y) && yi(y.prev, y, y.next) >= 0) return !1;\n y = y.nextZ;\n }\n for (;d && d.z >= c; ) {\n if (d !== t.prev && d !== t.next && fi(r.x, r.y, s.x, s.y, o.x, o.y, d.x, d.y) && yi(d.prev, d, d.next) >= 0) return !1;\n d = d.prevZ;\n }\n for (;y && y.z <= f; ) {\n if (y !== t.prev && y !== t.next && fi(r.x, r.y, s.x, s.y, o.x, o.y, y.x, y.y) && yi(y.prev, y, y.next) >= 0) return !1;\n y = y.nextZ;\n }\n return !0;\n }\n function si(t, n, i) {\n var e = t;\n do {\n var r = e.prev, s = e.next.next;\n !vi(r, s) && pi(r, e, e.next, s) && wi(r, s) && wi(s, r) && (n.push(r.i / i), n.push(e.i / i), \n n.push(s.i / i), xi(e), xi(e.next), e = t = s), e = e.next;\n } while (e !== t);\n return ni(e);\n }\n function oi(t, n, i, e, r, s) {\n var o = t;\n do {\n for (var a = o.next.next; a !== o.prev; ) {\n if (o.i !== a.i && di(o, a)) {\n var h = Mi(o, a);\n return o = ni(o, o.next), h = ni(h, h.next), ii(o, n, i, e, r, s), void ii(h, n, i, e, r, s);\n }\n a = a.next;\n }\n o = o.next;\n } while (o !== t);\n }\n function ai(t, n) {\n return t.x - n.x;\n }\n function hi(t, n) {\n var i = function(t, n) {\n var i, e = n, r = t.x, s = t.y, o = -1 / 0;\n do {\n if (s <= e.y && s >= e.next.y && e.next.y !== e.y) {\n var a = e.x + (s - e.y) * (e.next.x - e.x) / (e.next.y - e.y);\n if (a <= r && a > o) {\n if (o = a, a === r) {\n if (s === e.y) return e;\n if (s === e.next.y) return e.next;\n }\n i = e.x < e.next.x ? e : e.next;\n }\n }\n e = e.next;\n } while (e !== n);\n if (!i) return null;\n if (r === o) return i;\n var h, u = i, l = i.x, c = i.y, f = 1 / 0;\n e = i;\n do {\n r >= e.x && e.x >= l && r !== e.x && fi(s < c ? r : o, s, l, c, s < c ? o : r, s, e.x, e.y) && (h = Math.abs(s - e.y) / (r - e.x), \n wi(e, t) && (h < f || h === f && (e.x > i.x || e.x === i.x && ui(i, e))) && (i = e, \n f = h)), e = e.next;\n } while (e !== u);\n return i;\n }(t, n);\n if (!i) return n;\n var e = Mi(i, t), r = ni(i, i.next);\n return ni(e, e.next), n === i ? r : n;\n }\n function ui(t, n) {\n return yi(t.prev, t, n.prev) < 0 && yi(n.next, t, t.next) < 0;\n }\n function li(t, n, i, e, r) {\n return (t = 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = 32767 * (t - i) * r) | t << 8)) | t << 4)) | t << 2)) | t << 1)) | (n = 1431655765 & ((n = 858993459 & ((n = 252645135 & ((n = 16711935 & ((n = 32767 * (n - e) * r) | n << 8)) | n << 4)) | n << 2)) | n << 1)) << 1;\n }\n function ci(t) {\n var n = t, i = t;\n do {\n (n.x < i.x || n.x === i.x && n.y < i.y) && (i = n), n = n.next;\n } while (n !== t);\n return i;\n }\n function fi(t, n, i, e, r, s, o, a) {\n return (r - o) * (n - a) - (t - o) * (s - a) >= 0 && (t - o) * (e - a) - (i - o) * (n - a) >= 0 && (i - o) * (s - a) - (r - o) * (e - a) >= 0;\n }\n function di(t, n) {\n return t.next.i !== n.i && t.prev.i !== n.i && !function(t, n) {\n var i = t;\n do {\n if (i.i !== t.i && i.next.i !== t.i && i.i !== n.i && i.next.i !== n.i && pi(i, i.next, t, n)) return !0;\n i = i.next;\n } while (i !== t);\n return !1;\n }(t, n) && (wi(t, n) && wi(n, t) && function(t, n) {\n var i = t, e = !1, r = (t.x + n.x) / 2, s = (t.y + n.y) / 2;\n do {\n i.y > s != i.next.y > s && i.next.y !== i.y && r < (i.next.x - i.x) * (s - i.y) / (i.next.y - i.y) + i.x && (e = !e), \n i = i.next;\n } while (i !== t);\n return e;\n }(t, n) && (yi(t.prev, t, n.prev) || yi(t, n.prev, n)) || vi(t, n) && yi(t.prev, t, t.next) > 0 && yi(n.prev, n, n.next) > 0);\n }\n function yi(t, n, i) {\n return (n.y - t.y) * (i.x - n.x) - (n.x - t.x) * (i.y - n.y);\n }\n function vi(t, n) {\n return t.x === n.x && t.y === n.y;\n }\n function pi(t, n, i, e) {\n var r = gi(yi(t, n, i)), s = gi(yi(t, n, e)), o = gi(yi(i, e, t)), a = gi(yi(i, e, n));\n return r !== s && o !== a || (!(0 !== r || !mi(t, i, n)) || (!(0 !== s || !mi(t, e, n)) || (!(0 !== o || !mi(i, t, e)) || !(0 !== a || !mi(i, n, e)))));\n }\n function mi(t, n, i) {\n return n.x <= Math.max(t.x, i.x) && n.x >= Math.min(t.x, i.x) && n.y <= Math.max(t.y, i.y) && n.y >= Math.min(t.y, i.y);\n }\n function gi(t) {\n return t > 0 ? 1 : t < 0 ? -1 : 0;\n }\n function wi(t, n) {\n return yi(t.prev, t, t.next) < 0 ? yi(t, n, t.next) >= 0 && yi(t, t.prev, n) >= 0 : yi(t, n, t.prev) < 0 || yi(t, t.next, n) < 0;\n }\n function Mi(t, n) {\n var i = new Fi(t.i, t.x, t.y), e = new Fi(n.i, n.x, n.y), r = t.next, s = n.prev;\n return t.next = n, n.prev = t, i.next = r, r.prev = i, e.next = i, i.prev = e, s.next = e, \n e.prev = s, e;\n }\n function bi(t, n, i, e) {\n var r = new Fi(t, n, i);\n return e ? (r.next = e.next, r.prev = e, e.next.prev = r, e.next = r) : (r.prev = r, \n r.next = r), r;\n }\n function xi(t) {\n t.next.prev = t.prev, t.prev.next = t.next, t.prevZ && (t.prevZ.nextZ = t.nextZ), \n t.nextZ && (t.nextZ.prevZ = t.prevZ);\n }\n function Fi(t, n, i) {\n this.i = t, this.x = n, this.y = i, this.prev = null, this.next = null, this.z = null, \n this.prevZ = null, this.nextZ = null, this.steiner = !1;\n }\n function Ai(t, n, i, e) {\n for (var r = 0, s = n, o = i - e; s < i; s += e) r += (t[o] - t[s]) * (t[s + 1] + t[o + 1]), \n o = s;\n return r;\n }\n Kn.exports = Qn, Kn.exports.default = Qn, Qn.deviation = function(t, n, i, e) {\n var r = n && n.length, s = r ? n[0] * i : t.length, o = Math.abs(Ai(t, 0, s, i));\n if (r) for (var a = 0, h = n.length; a < h; a++) {\n var u = n[a] * i, l = a < h - 1 ? n[a + 1] * i : t.length;\n o -= Math.abs(Ai(t, u, l, i));\n }\n var c = 0;\n for (a = 0; a < e.length; a += 3) {\n var f = e[a] * i, d = e[a + 1] * i, y = e[a + 2] * i;\n c += Math.abs((t[f] - t[y]) * (t[d + 1] - t[f + 1]) - (t[f] - t[d]) * (t[y + 1] - t[f + 1]));\n }\n return 0 === o && 0 === c ? 0 : Math.abs((c - o) / o);\n }, Qn.flatten = function(t) {\n for (var n = t[0][0].length, i = {\n vertices: [],\n holes: [],\n dimensions: n\n }, e = 0, r = 0; r < t.length; r++) {\n for (var s = 0; s < t[r].length; s++) for (var o = 0; o < n; o++) i.vertices.push(t[r][s][o]);\n r > 0 && (e += t[r - 1].length, i.holes.push(e));\n }\n return i;\n };\n var ki = Kn.exports;\n /*!\n * @maptalks/vector-packer v0.63.4\n * LICENSE : UNLICENSED\n * (c) 2016-2022 maptalks.com\n */ const Pi = {\n Point: 1,\n LineString: 2,\n Polygon: 3,\n MultiPoint: 4,\n MultiLineString: 5,\n MultiPolygon: 6\n };\n function Si(t, n = {}) {\n var i = [];\n if ("FeatureCollection" === t.type) for (var e = 0; e < t.features.length; e++) _i(i, t.features[e], n, e); else _i(i, "Feature" === t.type ? t : {\n geometry: t\n }, n);\n return i;\n }\n function _i(t, n, i, e) {\n if (n.geometry && n.geometry.geometry) {\n var r = n.geometry.coordinates, s = n.geometry.type, o = [], a = n.id;\n if (i.promoteId ? a = n.properties[i.promoteId] : i.generateId && (a = e || 0), \n "Point" === s) Oi(r, o); else if ("MultiPoint" === s) for (var h = 0; h < r.length; h++) Oi(r[h], o); else if ("LineString" === s) Ti([ r ], o); else if ("MultiLineString" === s) {\n if (i.lineMetrics) {\n for (h = 0; h < r.length; h++) Ii(r[h], o = []), t.push(Li(a, "LineString", o, n.properties));\n return;\n }\n Ti(r, o);\n } else if ("Polygon" === s) Ti(r, o); else {\n if ("MultiPolygon" !== s) {\n if ("GeometryCollection" === s) {\n for (h = 0; h < n.geometry.geometries.length; h++) _i(t, {\n id: a,\n geometry: n.geometry.geometries[h],\n properties: n.properties\n }, i, e);\n return;\n }\n return void console.warn(`Input data type(${s}) is not a valid GeoJSON geometry type.`);\n }\n for (h = 0; h < r.length; h++) {\n var u = [];\n Ti(r[h], u), o.push(u);\n }\n }\n t.push(Li(a, s, o, n.properties));\n }\n }\n function Oi(t, n) {\n n.push([ new Ht(t[0], t[1]) ]);\n }\n function Ii(t, n) {\n for (var i = 0; i < t.length; i++) n.push(new Ht(t[i][0], t[i][1]));\n }\n function Ti(t, n, i, e) {\n for (var r = 0; r < t.length; r++) {\n var s = [];\n Ii(t[r], s), n.push(s);\n }\n }\n function Li(t, n, i, e) {\n return {\n id: void 0 === t ? null : t,\n type: Pi[n],\n geometry: i,\n properties: e\n };\n }\n /*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */ function Ui(t, {width: n, height: i}, e, r) {\n if (r) {\n if (r.length !== n * i * e) throw new RangeError("mismatched image size");\n } else r = new Uint8Array(n * i * e);\n return t.width = n, t.height = i, t.data = r, t;\n }\n function zi(t, {width: n, height: i}, e) {\n if (n === t.width && i === t.height) return;\n const r = Ui({}, {\n width: n,\n height: i\n }, e);\n Di(t, r, {\n x: 0,\n y: 0\n }, {\n x: 0,\n y: 0\n }, {\n width: Math.min(t.width, n),\n height: Math.min(t.height, i)\n }, e), t.width = n, t.height = i, t.data = r.data;\n }\n function Di(t, n, i, e, r, s) {\n if (0 === r.width || 0 === r.height) return n;\n if (r.width > t.width || r.height > t.height || i.x > t.width - r.width || i.y > t.height - r.height) throw new RangeError("out of range source coordinates for image copy");\n if (r.width > n.width || r.height > n.height || e.x > n.width - r.width || e.y > n.height - r.height) throw new RangeError("out of range destination coordinates for image copy");\n const o = t.data, a = n.data;\n if (o === a) return n;\n for (let h = 0; h < r.height; h++) {\n const u = ((i.y + h) * t.width + i.x) * s, l = ((e.y + h) * n.width + e.x) * s;\n for (let t = 0; t < r.width * s; t++) a[l + t] = o[u + t];\n }\n return n;\n }\n class Ei {\n constructor(t, n) {\n Ui(this, t, 1, n);\n }\n resize(t) {\n zi(this, t, 1);\n }\n clone() {\n return new Ei({\n width: this.width,\n height: this.height\n }, new Uint8Array(this.data));\n }\n static copy(t, n, i, e, r) {\n Di(t, n, i, e, r, 1);\n }\n }\n class Ci {\n constructor(t, n) {\n Ui(this, t, 4, n);\n }\n resize(t) {\n zi(this, t, 4);\n }\n clone() {\n return new Ci({\n width: this.width,\n height: this.height\n }, new Uint8Array(this.data));\n }\n static copy(t, n, i, e, r) {\n Di(t, n, i, e, r, 4);\n }\n }\n /*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */ class ji {\n constructor(t, {pixelRatio: n}) {\n this.paddedRect = t, this.pixelRatio = n || 1;\n }\n get tl() {\n return [ this.paddedRect.x + 1, this.paddedRect.y + 1 ];\n }\n get br() {\n return [ this.paddedRect.x + this.paddedRect.w - 1, this.paddedRect.y + this.paddedRect.h - 1 ];\n }\n get displaySize() {\n return [ (this.paddedRect.w - 2) / this.pixelRatio, (this.paddedRect.h - 2) / this.pixelRatio ];\n }\n }\n class Ni {\n constructor(t) {\n this.glyphMap = t, this.build();\n }\n build() {\n const t = this.glyphMap, n = {}, i = new Rt(0, 0, {\n autoResize: !0\n }), e = [];\n for (const i in t) {\n const r = t[i], s = {\n x: 0,\n y: 0,\n w: r.data.width + 2,\n h: r.data.height + 2\n };\n e.push(s), n[i] = new ji(s, r);\n }\n if (i.pack(e, {\n inPlace: !0\n }), !Hi(i.w) || !Hi(i.h)) {\n const t = Vi(i.w), n = Vi(i.h);\n i.resize(t, n);\n }\n const r = new Ci({\n width: i.w,\n height: i.h\n });\n for (const i in t) {\n const e = t[i], s = n[i].paddedRect;\n Ci.copy(e.data, r, {\n x: 0,\n y: 0\n }, {\n x: s.x + 1,\n y: s.y + 1\n }, e.data);\n }\n this.image = r, this.positions = n;\n }\n }\n function Hi(t) {\n return 0 == (t & t - 1) && 0 !== t;\n }\n function Vi(t) {\n return Math.pow(2, Math.ceil(Math.log(t) / Math.LN2));\n }\n /*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n * TODO 升级为potpack\n */ class Ri {\n constructor(t) {\n this.glyphMap = t, this.build();\n }\n build() {\n const t = this.glyphMap, n = {}, i = new Rt(0, 0, {\n autoResize: !0\n }), e = [];\n for (const i in t) {\n const r = t[i], s = n[i] = {};\n for (const t in r) {\n const n = r[+t];\n if (!n || 0 === n.bitmap.width || 0 === n.bitmap.height) continue;\n const i = {\n x: 0,\n y: 0,\n w: n.bitmap.width + 2,\n h: n.bitmap.height + 2\n };\n e.push(i), s[t] = {\n rect: i,\n metrics: n.metrics\n };\n }\n }\n i.pack(e, {\n inPlace: !0\n });\n const r = new Ei({\n width: i.w,\n height: i.h\n });\n for (const i in t) {\n const e = t[i];\n for (const t in e) {\n const s = e[+t];\n if (!s || 0 === s.bitmap.width || 0 === s.bitmap.height) continue;\n const o = n[i][t].rect;\n Ei.copy(s.bitmap, r, {\n x: 0,\n y: 0\n }, {\n x: o.x + 1,\n y: o.y + 1\n }, s.bitmap);\n }\n }\n this.image = r, this.positions = n;\n }\n }\n function $i(t) {\n return t < 65536 ? Uint16Array : Uint32Array;\n }\n function Wi(t) {\n return (t = Math.abs(t)) < 128 ? Int8Array : t < 32768 ? Int16Array : Float32Array;\n }\n function qi(t) {\n return t < 256 ? Uint8Array : t < 65536 ? Uint16Array : Float32Array;\n }\n function Bi(t) {\n const n = t.type, i = [];\n if (1 === n || 4 === n) for (let n = 0; n < t.geometry.length; n++) Oi(t.geometry[n], i); else if (2 === n) Ti(t.geometry, i); else if (3 === n) Ti(t.geometry, i); else if (5 === n) Ti(t.geometry, i); else if (6 === n) for (let n = 0; n < t.geometry.length; n++) {\n const e = [];\n Ti(t.geometry[n], e), i.push(e);\n }\n return t.geometry = i, t;\n }\n function Gi(t) {\n for (let n = 1; n < arguments.length; n++) {\n const i = arguments[n];\n for (const n in i) t[n] = i[n];\n }\n return t;\n }\n function Ji(t) {\n return null == t;\n }\n function Xi(t) {\n return "number" == typeof t && !isNaN(t);\n }\n function Zi(t) {\n return "object" == typeof t && !!t;\n }\n function Yi(t) {\n return !Ji(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);\n }\n const Ki = Object.prototype.hasOwnProperty;\n function Qi(t, n) {\n return Ki.call(t, n);\n }\n function te(t) {\n return m(t) && t.property;\n }\n function ne(t) {\n let n = 0;\n for (let i, e, r = 0, s = t.length, o = s - 1; r < s; o = r++) i = t[r], e = t[o], \n n += void 0 !== i.x ? (e.x - i.x) * (i.y + e.y) : (e[0] - i[0]) * (i[1] + e[1]);\n return n;\n }\n function ie(t, n, i, e, r) {\n const s = t[n * e], o = t[n * e + 1], a = t[i * e], h = t[i * e + 1];\n return s === a && (s < 0 || s > r) && o !== h || o === h && (o < 0 || o > r) && s !== a;\n }\n function ee(t, n, i) {\n let e = i;\n return n && t && (e = t[n]), void 0 === e && (e = i), 10 * (e || 0);\n }\n function re(t, n, i, e, r, s, o) {\n const a = ee(t.properties, i, e), h = a * n;\n let u = a;\n return r ? u = ee(t.properties, r, s) : o && (u = a - ee(t.properties, o, 0)), u *= n, \n {\n altitude: h,\n height: u\n };\n }\n function se(t, n) {\n return n < 1 / 0 && (t.x < 0 || t.x > n || t.y < 0 || t.y > n);\n }\n function oe(t) {\n return null == t;\n }\n function ae(t, n, i) {\n if (t === i || t === n) return t;\n const e = i - n;\n return ((t - n) % e + e) % e + n;\n }\n class he {\n constructor(t, n, i, e) {\n this.feature = t, this.symbol = n, this.fnTypes = i, this.options = e;\n }\n getPolygonResource() {\n let t = this.symbol.polygonPatternFile;\n const {polygonPatternFileFn: n} = this.fnTypes;\n return this.U(t, n);\n }\n getLineResource() {\n let t = this.symbol.linePatternFile;\n const {linePatternFileFn: n} = this.fnTypes;\n return this.U(t, n);\n }\n U(t, n) {\n return n && (t = n(this.options.zoom, this.feature.properties)), t;\n }\n }\n const ue = {\n lineWidth: 1,\n lineStrokeWidth: 1,\n lineDx: 1,\n lineDy: 1,\n lineOpacity: 1,\n linePatternAnimSpeed: 1,\n markerWidth: 1,\n markerHeight: 1,\n markerDx: 1,\n markerDy: 1,\n markerSpacing: 1,\n markerOpacity: 1,\n markerRotation: 1,\n textWrapWidth: 1,\n textSpacing: 1,\n textSize: 1,\n textHaloRadius: 1,\n textHaloOpacity: 1,\n textDx: 1,\n textDy: 1,\n textOpacity: 1,\n textRotation: 1,\n polygonOpacity: 1\n };\n class le {\n static isAtlasLoaded(t, n = {}) {\n const {iconAtlas: i} = n;\n return !!(!t || i && i.positions[t]);\n }\n static genFnTypes(t) {\n const n = {};\n for (const i in t) if (te(t[i])) {\n const e = (i + "_Fn_0").trim(), r = (i + "Fn").trim();\n ue[i] ? (n[e] = g(t[i]), n[r] = (t, i) => {\n const r = n[e](t, i);\n return te(r) ? g(r)(t, i) : r;\n }) : (n[e] = w(t[i]), n[r] = (t, i) => {\n const r = n[e](t, i);\n return te(r) ? w(r)(t, i) : r;\n });\n }\n return n;\n }\n constructor(t, n, i) {\n this.options = i, this.features = this.D(t), this.symbolDef = n, this.symbol = M(n, () => [ i.zoom ]), \n this.styledVectors = [], this.properties = {}, this.C = le.genFnTypes(this.symbolDef), \n te(this.symbolDef.visible) && (this.j = g(this.symbolDef.visible)), i.atlas && (this.iconAtlas = i.atlas.iconAtlas, \n this.glyphAtlas = i.atlas.glyphAtlas);\n }\n D(t) {\n if (!t.length) return t;\n const n = "__fea_idx".trim();\n let e, r = 0, s = t[r];\n for (;!s.geometry; ) r++, s = t[r];\n if (Array.isArray(s.geometry) && s.properties) {\n let n = s.geometry[0];\n for (;Array.isArray(n); ) n = n[0];\n n instanceof Ht && (e = t);\n }\n if (!e) if (e = [], Array.isArray(s.geometry)) for (let n = 0; n < t.length; n++) {\n const i = Gi({}, t[n]);\n e.push(Bi(i));\n } else for (let i = 0; i < t.length; i++) {\n const r = t[i], s = Si(r);\n for (let t = 0; t < s.length; t++) {\n const i = s[t];\n i[n] = r[n], e.push(i);\n }\n }\n const o = this.options.order;\n if (o) {\n const t = [];\n for (let n = 0; n < o.length; n++) o[n] && t.push(i(o[n]));\n e = e.sort((n, i) => {\n const e = t.length;\n let r = e, s = e;\n for (let o = 0; o < e && (t[o](n) && (r = o), t[o](i) && (s = o), !(r < e && s < e)); o++) ;\n return r - s;\n });\n }\n return e;\n }\n load(t = 1) {\n const n = "__fea_idx".trim(), i = "_debug_info".trim(), e = this.C, r = this.styledVectors;\n this.count = 0;\n const s = this.features;\n if (!s || !s.length) return Promise.resolve(null);\n const o = {}, a = {}, h = {\n zoom: this.options.zoom\n }, u = M(this.symbolDef, () => [ h.zoom ]);\n let l = 0, c = s.length;\n const f = this.options.debugIndex;\n try {\n for (;l < c; l++) {\n const t = s[l];\n if (!t || !t.geometry) continue;\n if (void 0 !== f && t[i].index !== f) continue;\n t.properties || (t.properties = {}), t.properties.$layer = t.layer, t.properties.$type = t.type;\n const c = this.createStyledVector(t, u, e, h, o, a);\n c && c.feature.geometry && (c.featureIdx = void 0 === t[n] ? l : t[n], this.count++, \n r.push(c));\n }\n } catch (t) {\n return Promise.reject(t);\n }\n return this.options.atlas ? Promise.resolve(this.pack(t)) : this.loadAtlas(o, a).then(() => this.pack(t));\n }\n loadAtlas(t, n) {\n return new Promise((i, e) => {\n this.fetchAtlas(t, n, (t, n) => {\n if (t) e(t); else {\n if (n) {\n const {icons: t, glyphs: i} = n;\n if (t && Object.keys(t).length) {\n for (const n in t) {\n const i = t[n], {width: e, height: r, data: s} = i.data;\n i.data = new Ci({\n width: e,\n height: r\n }, s);\n }\n this.iconAtlas = new Ni(t);\n }\n if (i && Object.keys(i).length) {\n for (const t in i) {\n const n = i[t];\n for (const t in n) {\n const i = n[t], {width: e, height: r, data: s} = i.bitmap;\n i.bitmap = new Ei({\n width: e,\n height: r\n }, s);\n }\n }\n this.glyphAtlas = new Ri(i);\n }\n }\n i({\n glyphAtlas: this.glyphAtlas,\n iconAtlas: this.iconAtlas\n });\n }\n });\n });\n }\n fetchAtlas(t, n, i) {\n Object.keys(t).length > 0 || Object.keys(n).length > 0 ? this.options.requestor(t, n, i) : i();\n }\n pack(t) {\n if (!this.count) return null;\n if (null == t) throw new Error("layout scale is undefined");\n const n = this.createDataPack(this.styledVectors, t);\n if (!n) return null;\n n.properties = this.properties, this.empty && (n.empty = !0);\n const i = n.buffers;\n delete n.buffers;\n const e = {\n data: n,\n buffers: i\n };\n if (this.iconAtlas) {\n const t = e.data.iconAtlas = ce(this.iconAtlas);\n if (t.glyphMap) for (const n in t.glyphMap) i.push(t.glyphMap[n].data.data.buffer);\n i.push(e.data.iconAtlas.image.data.buffer);\n }\n return this.glyphAtlas && (e.data.glyphAtlas = ce(this.glyphAtlas), i.push(e.data.glyphAtlas.image.data.buffer)), \n e;\n }\n createStyledVector(t, n, i, e) {\n return new he(t, n, i, e);\n }\n createDataPack(t, n) {\n if (!t || !t.length) return null;\n this.maxIndex = 0, this.maxPos = 0, this.maxAltitude = 0;\n const i = this.data = {};\n let e = this.elements = [];\n const r = this.getFormat(Array.isArray(t[0]) ? t[0][0].symbol : t[0].symbol);\n for (let t = 0; t < r.length; t++) i[r[t].name] = [];\n let s = [], o = 0;\n const a = [];\n let h = 0, u = !1;\n for (let e = 0, r = t.length; e < r; e++) {\n if (!t[e].feature.geometry) continue;\n const r = Array.isArray(t[e]) ? t[e][0].feature.id : t[e].feature.id;\n Xi(r) && (Math.abs(r) > h && (h = Math.abs(r)), r < 0 && (u = !0));\n const l = this.data.aPosition.length;\n if (Array.isArray(t[e])) for (let i = 0; i < t[e].length; i++) this.N(t[e][i], n); else this.N(t[e], n);\n const c = (i.aPosition.length - l) / 3;\n for (let n = 0; n < c; n++) s.push(t[e].featureIdx), Xi(r) && a.push(r);\n o = Math.max(o, t[e].featureIdx);\n }\n if (this.hasElements() && !e.length) return null;\n s = new (qi(o))(s), r[0].type = this.options.positionType ? this.options.positionType : Wi(Math.max(this.maxPos, this.maxAltitude));\n const l = this.options.center;\n if (l && (l[0] || l[1])) {\n const t = i.aPosition;\n for (let n = 0; n < t.length; n += 3) t[n] -= l[0], t[n + 1] -= l[1];\n }\n const c = function(t, n) {\n const i = {};\n for (let e = 0; e < t.length; e++) {\n const r = t[e], s = r.type, o = r.name;\n i[o] = s === Array ? n[o] : new s(n[o]);\n }\n return i;\n }(r, i);\n c.aPickingId = s;\n const f = [];\n for (const t in c) f.push(c[t].buffer);\n e = new ($i(this.maxIndex))(e), f.push(e.buffer);\n const d = {\n data: c,\n indices: this.hasElements() ? e : null,\n positionSize: 3,\n //!this.maxAltitude ? 2 : 3,\n buffers: f,\n symbolIndex: this.symbolDef.index || {\n index: 0\n }\n };\n if (a.length) {\n const t = u ? Wi(h) : qi(h);\n d.featureIds = new t(a), f.push(d.featureIds.buffer);\n } else d.featureIds = [];\n return d;\n }\n N(t, n) {\n this.j && this.j.isZoomConstant && !this.j(null, t.feature.properties) || this.placeVector(t, n, this.formatWidth);\n }\n addElements(...t) {\n this.maxIndex = Math.max(this.maxIndex, ...t), this.elements.push(...t);\n }\n hasElements() {\n return !0;\n }\n getAltitude(t) {\n const {altitudeProperty: n, defaultAltitude: i, altitudeScale: e} = this.options;\n let r = ee(t, n, i);\n return e && (r *= e), this.maxAltitude = Math.max(this.maxAltitude, Math.abs(r)), \n r;\n }\n getIconAtlasMaxValue() {\n const t = this.iconAtlas.positions;\n let n = 0;\n for (const i in t) if (Qi(t, i)) {\n const {tl: e, displaySize: r} = t[i], s = Math.max(e[0], e[1], r[0] - 1, r[1] - 1);\n s > n && (n = s);\n }\n return n;\n }\n }\n function ce(t) {\n let n = t.positions, i = t.image && t.image.format || "alpha";\n if (t instanceof Ni) {\n n = {};\n for (const i in t.positions) {\n const e = t.positions[i];\n n[i] = {\n paddedRect: e.paddedRect,\n pixelRatio: e.pixelRatio,\n tl: e.tl,\n br: e.br,\n displaySize: e.displaySize\n };\n }\n i = "rgba";\n }\n const e = t.image;\n return {\n image: {\n width: e.width,\n height: e.height,\n data: e.data,\n format: i\n },\n glyphMap: t.glyphMap,\n positions: n\n };\n }\n function fe(t, n, i, e) {\n const r = "__fn_textSize".trim();\n let s = t.textSize;\n if (Ji(n.textSize)) return [ 16, 16 ];\n t[r] && (s = t[r]);\n const o = [];\n var a;\n return o[0] = Ji(a = s) || "function" != typeof a && (null === a.constructor || a.constructor !== Function) ? s : s(e, i), \n o[1] = o[0], o;\n }\n function de(t) {\n const n = t.stops;\n let i = -1 / 0;\n for (let t = 0; t < n.length; t++) {\n let e = n[t][1];\n Zi(n[t][1]) && (e = de(n[t][1])), e > i && (i = e);\n }\n return i;\n }\n const ye = /\\{([\\w_]+)\\}/g;\n function ve(t, n) {\n return Yi(t) ? t.replace(ye, (function(t, i) {\n if (!n) return "";\n const e = n[i];\n return Ji(e) ? "" : Array.isArray(e) ? e.join() : e;\n })) : t;\n }\n const pe = t => t >= 11904 && t <= 12031, me = t => t >= 12032 && t <= 12255, ge = t => t >= 12272 && t <= 12287, we = t => t >= 12288 && t <= 12351, Me = t => t >= 12352 && t <= 12447, be = t => t >= 12448 && t <= 12543, xe = t => t >= 12544 && t <= 12591, Fe = t => t >= 12704 && t <= 12735, Ae = t => t >= 12736 && t <= 12783, ke = t => t >= 12784 && t <= 12799, Pe = t => t >= 12800 && t <= 13055, Se = t => t >= 13056 && t <= 13311, _e = t => t >= 13312 && t <= 19903, Oe = t => t >= 19968 && t <= 40959, Ie = t => t >= 40960 && t <= 42127, Te = t => t >= 42128 && t <= 42191, Le = t => t >= 63744 && t <= 64255, Ue = t => t >= 64336 && t <= 65023, ze = t => t >= 65040 && t <= 65055, De = t => t >= 65072 && t <= 65103, Ee = t => t >= 65104 && t <= 65135, Ce = t => t >= 65136 && t <= 65279, je = t => t >= 65280 && t <= 65519;\n function Ne(t) {\n return !((t => t >= 1536 && t <= 1791)(t) || (t => t >= 1872 && t <= 1919)(t) || (t => t >= 2208 && t <= 2303)(t) || Ue(t) || Ce(t));\n }\n function He(t) {\n return !!(746 === t || 747 === t || !(t < 4352) && (Fe(t) || xe(t) || De(t) && !(t >= 65097 && t <= 65103) || Le(t) || Se(t) || pe(t) || Ae(t) || !(!we(t) || t >= 12296 && t <= 12305 || t >= 12308 && t <= 12319 || 12336 === t) || _e(t) || Oe(t) || Pe(t) || (t => t >= 12592 && t <= 12687)(t) || (t => t >= 43360 && t <= 43391)(t) || (t => t >= 55216 && t <= 55295)(t) || (t => t >= 4352 && t <= 4607)(t) || (t => t >= 44032 && t <= 55215)(t) || Me(t) || ge(t) || (t => t >= 12688 && t <= 12703)(t) || me(t) || ke(t) || be(t) && 12540 !== t || !(!je(t) || 65288 === t || 65289 === t || 65293 === t || t >= 65306 && t <= 65310 || 65339 === t || 65341 === t || 65343 === t || t >= 65371 && t <= 65503 || 65507 === t || t >= 65512 && t <= 65519) || !(!Ee(t) || t >= 65112 && t <= 65118 || t >= 65123 && t <= 65126) || (t => t >= 5120 && t <= 5759)(t) || (t => t >= 6320 && t <= 6399)(t) || ze(t) || (t => t >= 19904 && t <= 19967)(t) || Ie(t) || Te(t)));\n }\n function Ve(t) {\n return !(He(t) || function(t) {\n return !!((t => t >= 128 && t <= 255)(t) && (167 === t || 169 === t || 174 === t || 177 === t || 188 === t || 189 === t || 190 === t || 215 === t || 247 === t) || (t => t >= 8192 && t <= 8303)(t) && (8214 === t || 8224 === t || 8225 === t || 8240 === t || 8241 === t || 8251 === t || 8252 === t || 8258 === t || 8263 === t || 8264 === t || 8265 === t || 8273 === t) || (t => t >= 8448 && t <= 8527)(t) || (t => t >= 8528 && t <= 8591)(t) || (t => t >= 8960 && t <= 9215)(t) && (t >= 8960 && t <= 8967 || t >= 8972 && t <= 8991 || t >= 8996 && t <= 9e3 || 9003 === t || t >= 9085 && t <= 9114 || t >= 9150 && t <= 9165 || 9167 === t || t >= 9169 && t <= 9179 || t >= 9186 && t <= 9215) || (t => t >= 9216 && t <= 9279)(t) && 9251 !== t || (t => t >= 9280 && t <= 9311)(t) || (t => t >= 9312 && t <= 9471)(t) || (t => t >= 9632 && t <= 9727)(t) || (t => t >= 9728 && t <= 9983)(t) && !(t >= 9754 && t <= 9759) || (t => t >= 11008 && t <= 11263)(t) && (t >= 11026 && t <= 11055 || t >= 11088 && t <= 11097 || t >= 11192 && t <= 11243) || we(t) || be(t) || (t => t >= 57344 && t <= 63743)(t) || De(t) || Ee(t) || je(t) || 8734 === t || 8756 === t || 8757 === t || t >= 9984 && t <= 10087 || t >= 10102 && t <= 10131 || 65532 === t || 65533 === t);\n }(t));\n }\n function Re(t) {\n return t >= 1424 && t <= 2303 || Ue(t) || Ce(t);\n }\n const $e = [ [ 9, 9 ], [ 32, 32 ], [ 5760, 5760 ], [ 8192, 8198 ], [ 8200, 8202 ], [ 8287, 12288 ], [ 6158, 6158 ], [ 8203, 8205 ] ];\n function We(t) {\n for (const n of $e) if (t >= n[0] && t <= n[1]) return !0;\n return !1;\n }\n const qe = {\n "!": "︕",\n "#": "#",\n $: "$",\n "%": "%",\n "&": "&",\n "(": "︵",\n ")": "︶",\n "*": "*",\n "+": "+",\n ",": "︐",\n "-": "︲",\n ".": "・",\n "/": "/",\n ":": "︓",\n ";": "︔",\n "<": "︿",\n "=": "=",\n ">": "﹀",\n "?": "︖",\n "@": "@",\n "[": "﹇",\n "\\\\": "\",\n "]": "﹈",\n "^": "^",\n H: "︳",\n "`": "`",\n "{": "︷",\n "|": "―",\n "}": "︸",\n "~": "~",\n "¢": "¢",\n "£": "£",\n "¥": "¥",\n "¦": "¦",\n "¬": "¬",\n "¯": " ̄",\n "–": "︲",\n "—": "︱",\n "‘": "﹃",\n "’": "﹄",\n "“": "﹁",\n "”": "﹂",\n "…": "︙",\n "‧": "・",\n "₩": "₩",\n "、": "︑",\n "。": "︒",\n "〈": "︿",\n "〉": "﹀",\n "《": "︽",\n "》": "︾",\n "「": "﹁",\n "」": "﹂",\n "『": "﹃",\n "』": "﹄",\n "【": "︻",\n "】": "︼",\n "〔": "︹",\n "〕": "︺",\n "〖": "︗",\n "〗": "︘",\n "!": "︕",\n "(": "︵",\n ")": "︶",\n ",": "︐",\n "-": "︲",\n ".": "・",\n ":": "︓",\n ";": "︔",\n "<": "︿",\n ">": "﹀",\n "?": "︖",\n "[": "﹇",\n "]": "﹈",\n "_": "︳",\n "{": "︷",\n "|": "―",\n "}": "︸",\n "⦅": "︵",\n "⦆": "︶",\n "。": "︒",\n "「": "﹁",\n "」": "﹂"\n };\n function Be(t, n, i, e, r, s, o, a, h, u) {\n let l = t.trim();\n 2 === u && (l = function(t) {\n let n = "";\n for (let i = 0; i < t.length; i++) {\n const e = t.charCodeAt(i + 1) || null, r = t.charCodeAt(i - 1) || null;\n n += e && Ve(e) && !qe[t[i + 1]] || r && Ve(r) && !qe[t[i - 1]] || !qe[t[i]] ? t[i] : qe[t[i]];\n }\n return n;\n }(l));\n const c = [], f = {\n positionedGlyphs: c,\n text: l,\n top: a[1],\n bottom: a[1],\n left: a[0],\n right: a[0],\n writingMode: u\n };\n let d;\n return d = function(t, n) {\n const i = [];\n let e = 0;\n for (let r = 0; r < n.length; r++) {\n const s = n[r];\n i.push(t.substring(e, s)), e = s;\n }\n return e < t.length && i.push(t.substring(e, t.length)), i;\n }(l, function(t, n, i, e) {\n if (!i) return [];\n if (!t) return [];\n const r = [], s = function(t, n, i, e) {\n let r = 0;\n for (let i = 0; i < t.length; i++) {\n const s = e[t.charCodeAt(i)];\n s && (r += s.metrics.advance + n);\n }\n return r / Math.max(1, Math.ceil(r / i));\n }(t, n, i, e);\n let o = 0;\n for (let i = 0; i < t.length; i++) {\n const h = t.charCodeAt(i), u = e[h];\n u && !Ge[h] && (o += u.metrics.advance + n), i < t.length - 1 && (Je[h] || !((a = h) < 11904) && (Fe(a) || xe(a) || De(a) || Le(a) || Se(a) || pe(a) || Ae(a) || we(a) || _e(a) || Oe(a) || Pe(a) || je(a) || Me(a) || ge(a) || me(a) || ke(a) || be(a) || ze(a) || Te(a) || Ie(a))) && r.push(Ye(i + 1, o, s, r, Ze(h, t.charCodeAt(i + 1)), !1));\n }\n var a;\n return function t(n) {\n return n ? t(n.priorBreak).concat(n.index) : [];\n }(Ye(t.length, o, s, r, 0, !0));\n }(l, o, i, n)), function(t, n, i, e, r, s, o, a, h) {\n let u = 0, l = 8, c = 0;\n const f = t.positionedGlyphs, d = "right" === s ? 1 : "left" === s ? 0 : .5;\n for (let t = 0; t < i.length; t++) {\n let r = i[t];\n if (r = r.trim(), !r.length) {\n l -= e;\n continue;\n }\n const s = f.length;\n for (let t = 0; t < r.length; t++) {\n const i = r.charCodeAt(t), e = n[i];\n e && (He(i) && 1 !== o ? (32 !== i && f.push({\n glyph: i,\n x: u,\n y: 0,\n vertical: !0\n }), u += h + a) : (32 !== i && f.push({\n glyph: i,\n x: u,\n y: l,\n vertical: !1\n }), u += e.metrics.advance + a));\n }\n f.length !== s && (c = Math.max(u - a, c), Qe(f, n, s, f.length - 1, d)), u = 0, \n l -= e;\n }\n const {horizontalAlign: y, verticalAlign: v} = Ke(r);\n !function(t, n, i, e, r, s, o) {\n const a = (n - i) * r, h = -(-e * o + .5) * s;\n if (a || h) for (let n = 0; n < t.length; n++) t[n].x += a, t[n].y += h;\n }(f, d, y, v, c, e, i.length);\n const p = i.length * e;\n t.top += -v * p, t.bottom = t.top + p, t.left += -y * c, t.right = t.left + c;\n }(f, n, d, e, r, s, u, o, h), !!c.length && f;\n }\n const Ge = {\n 9: !0,\n 10: !0,\n 11: !0,\n 12: !0,\n 13: !0,\n 32: !0\n }, Je = {\n 10: !0,\n 32: !0,\n 38: !0,\n 40: !0,\n 41: !0,\n 43: !0,\n 45: !0,\n 47: !0,\n 173: !0,\n 183: !0,\n 8203: !0,\n 8208: !0,\n 8211: !0,\n 8231: !0\n };\n function Xe(t, n, i, e) {\n const r = Math.pow(t - n, 2);\n return e ? t < n ? r / 2 : 2 * r : r + Math.abs(i) * i;\n }\n function Ze(t, n) {\n let i = 0;\n return 10 === t && (i -= 1e4), 40 !== t && 65288 !== t || (i += 50), 41 !== n && 65289 !== n || (i += 50), \n i;\n }\n function Ye(t, n, i, e, r, s) {\n let o = null, a = Xe(n, i, r, s);\n for (let t = 0; t < e.length; t++) {\n const h = e[t], u = Xe(n - h.x, i, r, s) + h.badness;\n u <= a && (o = h, a = u);\n }\n return {\n index: t,\n x: n,\n priorBreak: o,\n badness: a\n };\n }\n function Ke(t) {\n let n = .5, i = .5;\n switch (t) {\n case "right":\n case "top-right":\n case "bottom-right":\n n = 1;\n break;\n\n case "left":\n case "top-left":\n case "bottom-left":\n n = 0;\n }\n switch (t) {\n case "bottom":\n case "bottom-right":\n case "bottom-left":\n i = 1;\n break;\n\n case "top":\n case "top-right":\n case "top-left":\n i = 0;\n }\n return {\n horizontalAlign: n,\n verticalAlign: i\n };\n }\n function Qe(t, n, i, e, r) {\n if (!r) return;\n const s = n[t[e].glyph];\n if (s) {\n const n = (t[e].x + s.metrics.advance) * r;\n if (!n) return;\n for (let r = i; r <= e; r++) t[r].x -= n;\n }\n }\n function tr(t) {\n if (!function(t) {\n for (const n of t) if (Re(n.charCodeAt(0))) return !0;\n return !1;\n }(t)) return t;\n const n = [], i = [], e = [];\n let r = 0, s = 0, o = 1, a = 1;\n for (const h of t) {\n const t = h.codePointAt(0);\n We(t) ? (e.push(h), r++) : (o = Re(t) ? -1 : 1, a !== o ? (s = r, i.length && (a > 0 && i.reverse(), \n n.push(...i)), e.length && (n.splice(s, 0, ...e), e.length = 0), a = o, i.length = 0) : e.length && (i.push(...e), \n e.length = 0), i.push(h), r++);\n }\n return e.length && i.push(...e), i.length && (a > 0 && i.reverse(), n.push(...i)), \n n.reverse().join("");\n }\n const nr = /\\{ *([\\w_]+) *\\}/g;\n class ir {\n constructor(t, n, i, e, r) {\n this.feature = t, this.symbolDef = n, this.symbol = i, this.options = r, this.V = this.R.bind(this), \n this.C = e;\n }\n R(t, n) {\n return this.feature.properties[n] || "default";\n }\n getShape(t, n) {\n if (this.W) return this.W;\n const {textHorizontalAlignmentFn: i, textVerticalAlignmentFn: e, markerHorizontalAlignmentFn: r, markerVerticalAlignmentFn: s, textWrapWidthFn: o} = this.C;\n let a;\n const h = this.symbol, u = this.getIconAndGlyph(), l = this.feature.properties;\n if (u && u.glyph) {\n const {font: t, text: r} = u.glyph;\n if ("" === r) return null;\n const s = this.size[0] / 24, c = 24, f = h.textKeepUpright, d = "map" === h.textRotationAlignment && "line" === h.textPlacement && !h.isIconText, y = n.glyphMap[t], v = er(i ? i(null, l) : h.textHorizontalAlignment, e ? e(null, l) : h.textVerticalAlignment), p = 1.2 * c, m = function(t) {\n for (let n = 0; n < t.length; n++) if (!Ne(t.charAt(n).charCodeAt(0))) return !1;\n return !0;\n }(r), g = m && h.textLetterSpacing / s || 0, w = [ h.textDx / s || 0, h.textDy / s || 0 ], M = ((o ? o(null, l) : h.textWrapWidth) || 10 * c) / s;\n a = {}, a.horizontal = Be(r, y, M, p, v, "center", g, w, c, 1), m && d && f && (a.vertical = Be(r, y, M, p, v, "center", g, w, c, 2));\n } else if (u && u.icon) {\n if (!t.positions[u.icon.url]) return null;\n const n = er(r ? r(null, l) : h.markerHorizontalAlignment, s ? s(null, l) : h.markerVerticalAlignment);\n a = function(t, n) {\n const {horizontalAlign: i, verticalAlign: e} = Ke(n), r = -24 * i, s = -24 * e;\n return {\n image: t,\n top: s,\n bottom: s + 24,\n left: r,\n right: r + 24\n };\n }(t.positions[u.icon.url], n), this.size || (this.size = a.image.displaySize);\n }\n return this.W = a, a;\n }\n getIconAndGlyph() {\n if (this.iconGlyph) return this.iconGlyph;\n const {markerFileFn: t, markerTypeFn: n, markerPathFn: i, markerWidthFn: e, markerHeightFn: r, markerFillFn: s, markerFillPatternFileFn: o, markerFillOpacityFn: a, markerTextFitFn: h, markerTextFitPaddingFn: u, markerLineColorFn: l, markerLineWidthFn: c, markerLineOpacityFn: f, markerLineDasharrayFn: d, markerLinePatternFileFn: y, markerPathWidthFn: v, markerPathHeightFn: p, textNameFn: w, textFaceNameFn: M, textStyleFn: b, textWeightFn: x} = this.C, {zoom: F} = this.options, A = {}, k = this.symbol, P = this.feature.properties, S = t ? t(null, P) : k.markerFile, _ = n ? n(null, P) : k.markerType, O = S || _ || k.markerPath, I = !Ji(this.symbolDef.textName);\n let T;\n if (O) {\n T = function(t, n, i, e, r, s) {\n if (Ji(n.markerWidth) && Ji(n.markerHeight)) return null;\n const o = "__fn_markerWidth".trim(), a = "__fn_markerHeight".trim();\n let h = n.markerWidth || 0, u = n.markerHeight || 0;\n return Zi(h) && ("identity" !== h.type ? h = de(h) : (h = t.markerWidth, t[o] && (h = t[o](e, i)), \n Zi(h) && (h = "identity" === h.type ? r(e, i) : de(h)))), Zi(u) && ("identity" !== u.type ? u = de(u) : (u = t.markerHeight, \n t[a] && (u = t[a](e, i)), Zi(u) && (u = "identity" === u.type ? s(e, i) : de(u)))), \n [ h, u ];\n }(k, this.symbolDef, P, F, e, r) || [ 0, 0 ];\n let t = k.markerTextFit;\n if (h && (t = h(F, P)), t && t && "none" !== t) {\n const n = k.text.textSize;\n let i = k.text.textName;\n m(i) && (i = g(i)(F, P));\n const e = ve(i, P);\n if (e) {\n const i = "__fn_textSize".trim(), r = "__fn_textSize_0".trim();\n m(n) && !k.text[i] && (k.text[r] = g(n), k.text[i] = (t, n) => {\n const i = k.text[r](t, n);\n return m(i) ? g(i)(t, n) : i;\n });\n const s = fe(k.text, k.text, P, F);\n if ("width" !== t && "both" !== t || (T[0] = s[0] * e.length), "height" !== t && "both" !== t || (T[1] = s[1]), \n s[0] && s[1]) {\n let t = k.markerTextFitPadding || [ 0, 0, 0, 0 ];\n u && (t = u(F, P)), T[0] += t[1] + t[3], T[1] += t[0] + t[2];\n }\n } else T[0] = T[1] = -1;\n }\n }\n if (I && (T = fe(k, this.symbolDef, P, F)), !T) return A;\n if (T[0] = Math.ceil(T[0]), T[1] = Math.ceil(T[1]), this.size = T, O && T[0] >= 0 && T[1] >= 0) {\n let t;\n if (_) {\n const n = {};\n if (n.markerType = _, "path" === _ && (n.markerPath = i ? i(null, P) : k.markerPath, \n n.markerPathWidth = v ? v(null, P) : k.markerPathWidth, n.markerPathHeight = p ? p(null, P) : k.markerPathHeight), \n e) {\n const t = e(null, P);\n Ji(t) || (n.markerWidth = t);\n } else k.markerWidth >= 0 && (n.markerWidth = k.markerWidth);\n if (r) {\n const t = r(null, P);\n Ji(t) || (n.markerHeight = t);\n } else k.markerHeight >= 0 && (n.markerHeight = k.markerHeight);\n if (s) {\n const t = s(null, P);\n Ji(t) || (n.markerFill = t);\n } else k.markerFill && (n.markerFill = k.markerFill);\n if (o) {\n const t = o(null, P);\n Ji(t) || (n.markerFillPatternFile = t);\n } else k.markerFillPatternFile && (n.markerFillPatternFile = k.markerFillPatternFile);\n if (a) {\n const t = a(null, P);\n Ji(t) || (n.markerFillOpacity = t);\n } else k.markerFillOpacity >= 0 && (n.markerFillOpacity = k.markerFillOpacity);\n if (l) {\n const t = l(null, P);\n Ji(t) || (n.markerLineColor = t);\n } else k.markerLineColor && (n.markerLineColor = k.markerLineColor);\n if (c) {\n const t = c(null, P);\n Ji(t) || (n.markerLineWidth = t);\n } else k.markerLineWidth >= 0 && (n.markerLineWidth = k.markerLineWidth);\n if (f) {\n const t = f(null, P);\n Ji(t) || (n.markerLineOpacity = t);\n } else k.markerLineOpacity >= 0 && (n.markerLineOpacity = k.markerLineOpacity);\n if (d) {\n const t = d(null, P);\n Ji(t) || (n.markerLineDasharray = t);\n } else k.markerLineDasharray && (n.markerLineDasharray = k.markerLineDasharray);\n if (y) {\n const t = y(null, P);\n Ji(t) || (n.markerLinePatternFile = t);\n } else k.markerLinePatternFile && (n.markerLinePatternFile = k.markerLinePatternFile);\n t = "vector://" + JSON.stringify(n);\n } else t = S ? S.replace(nr, this.V) : k.markerPath ? function(t, n, i) {\n if (!t.markerPath) return null;\n let e = 1;\n const r = function(t) {\n const n = {\n stroke: {\n stroke: t.markerLineColor,\n "stroke-width": t.markerLineWidth,\n "stroke-opacity": t.markerLineOpacity,\n "stroke-dasharray": null,\n "stroke-linecap": "butt",\n "stroke-linejoin": "round"\n },\n fill: {\n fill: t.markerFill,\n "fill-opacity": t.markerFillOpacity\n }\n };\n return 0 === n.stroke["stroke-width"] && (n.stroke["stroke-opacity"] = 0), n;\n }(t);\n Xi(t.markerOpacity) && (e = t.markerOpacity), Xi(t.opacity) && (e *= t.opacity);\n const s = {};\n if (r) {\n for (const t in r.stroke) Qi(r.stroke, t) && (Ji(r.stroke[t]) || (s[t] = r.stroke[t]));\n for (const t in r.fill) Qi(r.fill, t) && (Ji(r.fill[t]) || (s[t] = r.fill[t]));\n }\n const o = Array.isArray(t.markerPath) ? t.markerPath : [ t.markerPath ];\n let a;\n const h = [];\n for (let t = 0; t < o.length; t++) a = Yi(o[t]) ? {\n path: o[t]\n } : o[t], a = Gi({}, a, s), a.d = a.path, delete a.path, h.push(a);\n const u = [ \'<svg version="1.1"\', \'xmlns="http://www.w3.org/2000/svg"\' ];\n e < 1 && u.push(\'opacity="\' + e + \'"\'), t.markerPathWidth && t.markerPathHeight && u.push(\'viewBox="0 0 \' + t.markerPathWidth + " " + t.markerPathHeight + \'"\'), \n u.push(\'preserveAspectRatio="none"\'), n && u.push(\'width="\' + n + \'"\'), i && u.push(\'height="\' + i + \'"\'), \n u.push("><defs></defs>");\n for (let t = 0; t < h.length; t++) {\n let n = "<path ";\n for (const i in h[t]) Qi(h[t], i) && (n += " " + i + \'="\' + h[t][i] + \'"\');\n n += "></path>", u.push(n);\n }\n return u.push("</svg>"), "data:image/svg+xml;base64," + btoa(u.join(" "));\n }(k, T[0], T[1]) : null;\n A.icon = {\n url: t,\n size: T\n };\n }\n if (I) {\n const t = w ? w(null, P) : k.textName;\n if (t || 0 === t) {\n const n = function(t, n, i) {\n return [ n || "normal", i || "normal", "24px", t || "monospace" ].join(" ");\n }(M ? M(null, P) : k.textFaceName, b ? b(null, P) : k.textStyle, x ? x(null, P) : k.textWeight);\n let i = ve(t, P);\n i && i.length && (i = tr(i), A.glyph = {\n font: n,\n text: i\n });\n }\n }\n return this.iconGlyph = A, A;\n }\n }\n function er(t, n) {\n n && "middle" !== n || (n = "center"), t && "middle" !== t || (t = "center");\n let i = "center" !== n ? n : "";\n return i += "center" !== t ? (i.length ? "-" : "") + t : "", i\n /*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */;\n }\n function rr(t, n, i, e, r) {\n const s = [];\n for (let o = 0; o < t.length; o++) {\n const a = t[o];\n let h;\n for (let t = 0; t < a.length - 1; t++) {\n let o = a[t], u = a[t + 1];\n o.x < n && u.x < n || (o.x < n ? o = new Ht(n, o.y + (n - o.x) / (u.x - o.x) * (u.y - o.y)).I() : u.x < n && (u = new Ht(n, o.y + (n - o.x) / (u.x - o.x) * (u.y - o.y)).I()), \n o.y < i && u.y < i || (o.y < i ? o = new Ht(o.x + (i - o.y) / (u.y - o.y) * (u.x - o.x), i).I() : u.y < i && (u = new Ht(o.x + (i - o.y) / (u.y - o.y) * (u.x - o.x), i).I()), \n o.x >= e && u.x >= e || (o.x >= e ? o = new Ht(e, o.y + (e - o.x) / (u.x - o.x) * (u.y - o.y)).I() : u.x >= e && (u = new Ht(e, o.y + (e - o.x) / (u.x - o.x) * (u.y - o.y)).I()), \n o.y >= r && u.y >= r || (o.y >= r ? o = new Ht(o.x + (r - o.y) / (u.y - o.y) * (u.x - o.x), r).I() : u.y >= r && (u = new Ht(o.x + (r - o.y) / (u.y - o.y) * (u.x - o.x), r).I()), \n h && o.equals(h[h.length - 1]) || (h = [ o ], s.push(h)), h.push(u)))));\n }\n }\n return s;\n }\n class sr extends Ht {\n constructor(t, n, i, e) {\n super(t, n), this.angle = i, void 0 !== e && (this.segment = e);\n }\n clone() {\n return new sr(this.x, this.y, this.angle, this.segment);\n }\n }\n /*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */ function or(t, n, i, e, r) {\n if (void 0 === n.segment) return !0;\n let s = n, o = n.segment + 1, a = 0;\n for (;a > -i / 2; ) {\n if (o--, o < 0) return !1;\n a -= t[o].dist(s), s = t[o];\n }\n a += t[o].dist(t[o + 1]), o++;\n const h = [];\n let u = 0;\n for (;a < i / 2; ) {\n const n = t[o], i = t[o + 1];\n if (!i) return !1;\n let s = t[o - 1].angleTo(n) - n.angleTo(i);\n for (s = Math.abs((s + 3 * Math.PI) % (2 * Math.PI) - Math.PI), h.push({\n distance: a,\n angleDelta: s\n }), u += s; a - h[0].distance > e; ) u -= h.shift().angleDelta;\n if (u > r) return !1;\n o++, a += n.dist(i);\n }\n return !0;\n }\n function ar(t, n, i, e, r, s, o, a, h) {\n const u = function(t, n, i) {\n return t ? .6 * n * i : 0;\n }(e, s, o), l = function(t, n) {\n return Math.max(t ? t.right - t.left : 0, n ? n.right - n.left : 0);\n }(e, r), c = 0 === t[0].x || t[0].x === h || 0 === t[0].y || t[0].y === h;\n return n - l * o < n / 4 && (n = l * o + n / 4), function t(n, i, e, r, s, o, a, h, u) {\n const l = o / 2, c = function(t) {\n let n = 0;\n for (let i = 0; i < t.length - 1; i++) n += t[i].dist(t[i + 1]);\n return n;\n }(n);\n let f = 0, d = i - e, y = [];\n for (let t = 0; t < n.length - 1; t++) {\n const i = n[t], a = n[t + 1], h = i.dist(a), v = a.angleTo(i);\n for (;d + e < f + h; ) {\n d += e;\n const p = (d - f) / h, m = hr(i.x, a.x, p), g = hr(i.y, a.y, p);\n if (m >= 0 && m < u && g >= 0 && g < u && d - l >= 0 && d + l <= c) {\n const i = new sr(m, g, v, t);\n i.line = n, i.I(), r && !or(n, i, o, r, s) || y.push(i);\n }\n }\n f += h;\n }\n return h || y.length || a || (y = t(n, f / 2, e, r, s, o, a, !0, u)), y;\n }(t, c ? n / 2 * a % n : (l / 2 + 2 * s) * o * a % n, n, u, i, l * o, c, !1, h);\n }\n function hr(t, n, i) {\n return t * (1 - i) + n * i;\n }\n function ur(t, n) {\n const i = t.length;\n if (i <= 1) return [ t ];\n const e = [];\n let r, s;\n for (let n = 0; n < i; n++) {\n const i = ne(t[n]);\n 0 !== i && (t[n].area = Math.abs(i), void 0 === s && (s = i < 0), s === i < 0 ? (r && e.push(r), \n r = [ t[n] ]) : r.push(t[n]));\n }\n if (r && e.push(r), n > 1) for (let t = 0; t < e.length; t++) e[t].length <= n || (Bt(e[t], n, 1, e[t].length - 1, lr), \n e[t] = e[t].slice(0, n));\n return e;\n }\n function lr(t, n) {\n return n.area - t.area;\n }\n function cr(t, n, i) {\n const e = n.distSqr(i);\n if (0 === e) return t.distSqr(n);\n const r = ((t.x - n.x) * (i.x - n.x) + (t.y - n.y) * (i.y - n.y)) / e;\n return t.distSqr(r < 0 ? n : r > 1 ? i : i.sub(n).F(r).u(n));\n }\n function fr(t, n = 1, i = !1) {\n let e = 1 / 0, r = 1 / 0, s = -1 / 0, o = -1 / 0;\n const a = t[0];\n for (let t = 0; t < a.length; t++) {\n const n = a[t];\n (!t || n.x < e) && (e = n.x), (!t || n.y < r) && (r = n.y), (!t || n.x > s) && (s = n.x), \n (!t || n.y > o) && (o = n.y);\n }\n const h = Math.min(s - e, o - r);\n let u = h / 2;\n const l = new Zt(null, dr);\n if (0 === h) return new Ht(e, r);\n for (let n = e; n < s; n += h) for (let i = r; i < o; i += h) l.push(new yr(n + u, i + u, u, t));\n let c = function(t) {\n let n = 0, i = 0, e = 0;\n const r = t[0];\n for (let t = 0, s = r.length, o = s - 1; t < s; o = t++) {\n const s = r[t], a = r[o], h = s.x * a.y - a.x * s.y;\n i += (s.x + a.x) * h, e += (s.y + a.y) * h, n += 3 * h;\n }\n return new yr(i / n, e / n, 0, t);\n }(t), f = l.length;\n for (;l.length; ) {\n const e = l.pop();\n (e.d > c.d || !c.d) && (c = e, i && console.log("found best %d after %d probes", Math.round(1e4 * e.d) / 1e4, f)), \n e.max - c.d <= n || (u = e.h / 2, l.push(new yr(e.p.x - u, e.p.y - u, u, t)), l.push(new yr(e.p.x + u, e.p.y - u, u, t)), \n l.push(new yr(e.p.x - u, e.p.y + u, u, t)), l.push(new yr(e.p.x + u, e.p.y + u, u, t)), \n f += 4);\n }\n return i && (console.log("num probes: " + f), console.log("best distance: " + c.d)), \n c.p;\n }\n function dr(t, n) {\n return n.max - t.max;\n }\n function yr(t, n, i, e) {\n this.p = new Ht(t, n), this.h = i, this.d = function(t, n) {\n let i = !1, e = 1 / 0;\n for (let r = 0; r < n.length; r++) {\n const s = n[r];\n for (let n = 0, r = s.length, o = r - 1; n < r; o = n++) {\n const r = s[n], a = s[o];\n r.y > t.y != a.y > t.y && t.x < (a.x - r.x) * (t.y - r.y) / (a.y - r.y) + r.x && (i = !i), \n e = Math.min(e, cr(t, r, a));\n }\n }\n return (i ? 1 : -1) * Math.sqrt(e);\n }(this.p, e), this.max = this.d + this.h * Math.SQRT2;\n }\n const vr = 45 * Math.PI / 100;\n function pr(t, n) {\n const i = {}, e = {}, r = [];\n let s = 0;\n function o(n) {\n r.push(t[n]), s++;\n }\n function a(t, n, i) {\n const s = e[t];\n return delete e[t], e[n] = s, r[s].geometry[0].pop(), r[s].geometry[0] = r[s].geometry[0].concat(i[0]), \n s;\n }\n function h(t, n, e) {\n const s = i[n];\n return delete i[n], i[t] = s, r[s].geometry[0].shift(), r[s].geometry[0] = e[0].concat(r[s].geometry[0]), \n s;\n }\n function u(t, n, i) {\n const e = i ? n[0][n[0].length - 1] : n[0][0];\n return `${t}:${e.x}:${e.y}`;\n }\n for (let l = 0; l < t.length; l++) {\n const c = t[l], f = c.geometry;\n if (!f) continue;\n const d = c.properties[n] ? c.properties[n].toString() : null;\n if (!d) {\n o(l);\n continue;\n }\n const y = u(d, f), v = u(d, f, !0);\n if (y in e && v in i && e[y] !== i[v]) {\n const t = h(y, v, f), n = a(y, v, r[t].geometry);\n delete i[y], delete e[v], e[u(d, r[n].geometry, !0)] = n, r[t].geometry = null;\n } else y in e ? a(y, v, f) : v in i ? h(y, v, f) : (o(l), i[y] = s - 1, e[v] = s - 1);\n }\n return r.filter(t => t.geometry);\n }\n class mr extends le {\n static needMerge(t) {\n return t.mergeOnProperty && ("line" === t.textPlacement || "line" === t.markerPlacement);\n }\n static mergeLineFeatures(t, n, i) {\n const e = "__index".trim(), r = function(t, n, i) {\n const e = "__index".trim(), r = le.genFnTypes(n), {mergeOnPropertyFn: s} = r;\n if (!n.mergeOnProperty || "line" !== n.textPlacement && "line" !== n.markerPlacement) return [];\n if (!(oe(o = n.mergeOnProperty) || "string" != typeof o && (null === o.constructor || o.constructor !== String) || "line" !== n.textPlacement && "line" !== n.markerPlacement)) return [ {\n features: t,\n property: n.mergeOnProperty\n } ];\n var o;\n const a = [], h = {}, u = [];\n for (let r = 0; r < t.length; r++) {\n t[r][e] = r;\n const o = t[r].properties = t[r].properties || {};\n o.$layer = t[r].layer, o.$type = t[r].type;\n let l = n.markerPlacement;\n "line" !== l && (l = n.textPlacement);\n const c = s ? s(i, o) : n.mergeOnProperty;\n "line" !== l || oe(c) ? u.push(t[r]) : (void 0 === h[c] && (h[c] = a.length, a.push({\n features: [],\n property: c\n })), a[h[c]].features.push(t[r]));\n }\n return u.length && a.push({\n features: u\n }), a;\n }(t, n, i);\n if (r.length) {\n const n = [];\n for (let i = 0; i < r.length; i++) n.push(r[i].property ? pr(r[i].features, r[i].property) : t);\n if (1 === n.length) return n[0];\n {\n let t = [];\n for (let i = 0; i < n.length; i++) t = t.concat(n[i]);\n return t.sort((t, n) => t[e] - n[e]), t;\n }\n }\n }\n static splitPointSymbol(t, n = 0) {\n const i = [];\n if (Array.isArray(t)) {\n const n = t;\n for (let t = 0; t < n.length; t++) n[t] && i.push(...mr.splitPointSymbol(n[t], t));\n return i;\n }\n let e = null, r = null;\n for (const n in t) 0 === n.indexOf("marker") ? (e = e || {}, e[n] = t[n]) : 0 === n.indexOf("text") && (r = r || {}, \n r[n] = t[n]);\n return e && (e.isIconText = !0, t.mergeOnProperty && (e.mergeOnProperty = t.mergeOnProperty), \n i.push(e)), r && (e && (r.textPlacement = e.markerPlacement, r.textSpacing = e.markerSpacing, \n r.isIconText = !0), t.mergeOnProperty && (r.mergeOnProperty = t.mergeOnProperty), \n i.push(r)), void 0 !== t.visible && (e && (e.visible = t.visible), r && (r.visible = t.visible)), \n e && (e.markerTextFit && r && (e.text = {}, e.text.textName = r.textName, e.text.textSize = r.textSize), \n e.index = {\n index: n,\n type: 0\n }), r && (r.index = {\n index: n,\n type: 1\n }), i;\n }\n static isAtlasLoaded(t, n) {\n const {icon: i, glyph: e} = t, {iconAtlas: r, glyphAtlas: s} = n;\n if (i && (!r || !r.positions[i.url])) return !1;\n if (e) {\n if (!s || !s.positions[e.font]) return !1;\n const t = s.positions[e.font], {text: n} = e;\n for (let i = 0; i < n.length; i++) if (!t[n.charCodeAt(i)]) return !1;\n }\n return !0;\n }\n constructor(t, n, i) {\n super(t, n, i);\n }\n createStyledVector(t, n, i, e, r, s) {\n const o = new ir(t, this.symbolDef, n, i, e), a = o.getIconAndGlyph();\n if (a.icon && !this.options.atlas) {\n const {url: t, size: n} = a.icon;\n r[t] || (r[t] = a.icon.size), r[t][0] < n[0] && (r[t][0] = n[0]), r[t][1] < n[1] && (r[t][1] = n[1]);\n }\n if (a.glyph && !this.options.atlas) {\n const {font: t, text: i} = a.glyph, e = s[t] = s[t] || {};\n for (let t = 0; t < i.length; t++) e[i.charCodeAt(t)] = 1;\n "line" === n.textPlacement && (s.options = {\n isCharsCompact: !1\n });\n }\n return this.options.allowEmptyPack || a.icon || a.glyph ? o : null;\n }\n getFormat(t) {\n const n = void 0 !== t.textName, i = n ? function(t) {\n return "line" !== t.textPlacement || t.isIconText ? [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n }, {\n type: Int16Array,\n width: 2,\n name: "aShape"\n }, {\n type: Uint16Array,\n width: 2,\n name: "aTexCoord"\n }, {\n type: Uint8Array,\n width: 1,\n name: "aCount"\n } ] : [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n }, {\n type: Int16Array,\n width: 2,\n name: "aShape"\n }, {\n type: Uint16Array,\n width: 2,\n name: "aTexCoord"\n }, {\n type: Uint8Array,\n width: 1,\n name: "aCount"\n }, {\n type: Int16Array,\n width: 2,\n name: "aGlyphOffset"\n }, {\n type: Uint16Array,\n width: 3,\n name: "aSegment"\n }, {\n type: Uint8Array,\n width: 1,\n name: "aVertical"\n } ];\n }(t) : [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n }, {\n type: Int16Array,\n width: 2,\n name: "aShape"\n }, {\n type: Uint16Array,\n width: 2,\n name: "aTexCoord"\n } ];\n n ? i.push(...this.q()) : i.push(...this.B());\n const {markerOpacityFn: e, textOpacityFn: r, markerPitchAlignmentFn: s, textPitchAlignmentFn: o, markerRotationAlignmentFn: a, textRotationAlignmentFn: h, markerRotationFn: u, textRotationFn: l, markerAllowOverlapFn: c, textAllowOverlapFn: f, markerIgnorePlacementFn: d, textIgnorePlacementFn: y} = this.C;\n return (e || r) && i.push({\n type: Uint8Array,\n width: 1,\n name: "aColorOpacity"\n }), (s || o) && i.push({\n type: Uint8Array,\n width: 1,\n name: "aPitchAlign"\n }), (a || h) && i.push({\n type: Uint8Array,\n width: 1,\n name: "aRotationAlign"\n }), (u || l) && i.push({\n type: Uint16Array,\n width: 1,\n name: "aRotation"\n }), (c || f || d || y) && i.push({\n type: Uint8Array,\n width: 1,\n name: "aOverlap"\n }), i;\n }\n q() {\n const {textFillFn: t, textSizeFn: n, textHaloFillFn: i, textHaloRadiusFn: e, textHaloOpacityFn: r, textDxFn: s, textDyFn: o} = this.C, a = [];\n return t && a.push({\n type: Uint8Array,\n width: 4,\n name: "aTextFill"\n }), n && a.push({\n type: Uint8Array,\n width: 1,\n name: "aTextSize"\n }), i && a.push({\n type: Uint8Array,\n width: 4,\n name: "aTextHaloFill"\n }), e && a.push({\n type: Uint8Array,\n width: 1,\n name: "aTextHaloRadius"\n }), r && a.push({\n type: Uint8Array,\n width: 1,\n name: "aTextHaloOpacity"\n }), s && a.push({\n type: Int8Array,\n width: 1,\n name: "aTextDx"\n }), o && a.push({\n type: Int8Array,\n width: 1,\n name: "aTextDy"\n }), a;\n }\n B() {\n const {markerWidthFn: t, markerHeightFn: n, markerDxFn: i, markerDyFn: e} = this.C, r = [];\n return t && r.push({\n type: Uint8Array,\n width: 1,\n name: "aMarkerWidth"\n }), n && r.push({\n type: Uint8Array,\n width: 1,\n name: "aMarkerHeight"\n }), i && r.push({\n type: Int8Array,\n width: 1,\n name: "aMarkerDx"\n }), e && r.push({\n type: Int8Array,\n width: 1,\n name: "aMarkerDy"\n }), r;\n }\n createDataPack() {\n if (!this.iconAtlas && !this.glyphAtlas) {\n if (!this.options.allowEmptyPack) return null;\n this.empty = !0;\n }\n this.lineVertex = [];\n const t = super.createDataPack.apply(this, arguments);\n return t ? (t.lineVertex = new Int16Array(this.lineVertex), t.buffers.push(t.lineVertex.buffer), \n t) : null;\n }\n placeVector(t, n) {\n const i = t.getShape(this.iconAtlas, this.glyphAtlas);\n if (!this.options.allowEmptyPack && !i) return;\n const e = this.G(t, i, n);\n if (0 === e.length) return;\n const r = this.data;\n let s = this.data.aPosition.length / 3;\n const o = t.symbol, a = t.feature.properties, h = "line" === o.textPlacement && !o.isIconText, u = void 0 !== o.textName, l = u && h && function(t) {\n let n = 0;\n for (let i = 0; i < t.length; i++) if (He(t.charAt(i).charCodeAt(0))) n = 0; else if (n++, \n n >= 1) return !1;\n return !0;\n }(t.getIconAndGlyph().glyph.text) ? 1 : 0, {textFillFn: c, textSizeFn: f, textHaloFillFn: d, textHaloRadiusFn: y, textHaloOpacityFn: v, textDxFn: p, textDyFn: g, textPitchAlignmentFn: w, textRotationAlignmentFn: M, textRotationFn: b, textAllowOverlapFn: x, textIgnorePlacementFn: F, textOpacityFn: A, markerWidthFn: k, markerHeightFn: P, markerDxFn: S, markerDyFn: _, markerPitchAlignmentFn: O, markerRotationAlignmentFn: I, markerRotationFn: T, markerAllowOverlapFn: L, markerIgnorePlacementFn: U, markerOpacityFn: z} = this.C;\n let D, E, C, j, N, H, V, R, $, W, q, B, G, J, X, Z, Y;\n if (u) {\n const n = t.getIconAndGlyph().glyph.font;\n D = function(t, n, i) {\n const e = t.positionedGlyphs, r = [];\n for (let s = 0; s < e.length; s++) {\n const o = e[s], a = i[o.glyph];\n if (!a) continue;\n const h = a.rect;\n if (!h) continue;\n const u = 4, l = a.metrics.advance / 2, c = a.metrics.height / 2, f = n ? [ o.x + l, 0 ] : [ 0, 0 ], d = n ? [ 0, o.y - c ] : [ o.x + l, o.y - c ], y = a.metrics.left - u - l + d[0], v = a.metrics.top - u + d[1], p = y + h.w, m = v + h.h, g = new Ht(y, v), w = new Ht(p, v), M = new Ht(y, m), b = new Ht(p, m);\n if (n && o.vertical) {\n const t = new Ht(-l, l), n = -Math.PI / 2, i = new Ht(5, 0);\n g.P(n, t).u(i), w.P(n, t).u(i), M.P(n, t).u(i), b.P(n, t).u(i);\n }\n r.push({\n tl: g,\n tr: w,\n bl: M,\n br: b,\n tex: h,\n writingMode: t.writingMode,\n glyphOffset: f\n });\n }\n return r;\n }(i.horizontal, h, this.glyphAtlas.positions[n]), c && (E = c(null, a), m(E) ? E = [ 0, 0, 0, 0 ] : (E = Array.isArray(E) ? E.map(t => 255 * t) : Vn(E).array(), \n 3 === E.length && E.push(255))), f && (C = f(this.options.zoom, a), oe(C) && (C = 14)), \n d && (j = d(null, a), j = Array.isArray(j) ? j.map(t => 255 * t) : Vn(j).array(), \n 3 === j.length && j.push(255)), y && (N = y(null, a)), v && (H = 255 * v(null, a)), \n p && (V = p(null, a) || 0), g && (R = g(null, a) || 0), w && (G = +("map" === w(null, a))), \n M && (J = +("map" === M(null, a))), b && (X = ae(b(null, a), 0, 360) * Math.PI / 180);\n } else D = i ? function(t) {\n const n = t.image, i = t.top - 1 / n.pixelRatio, e = t.left - 1 / n.pixelRatio, r = t.bottom + 1 / n.pixelRatio, s = t.right + 1 / n.pixelRatio;\n let o, a, h, u;\n return o = new Ht(e, i), a = new Ht(s, i), h = new Ht(s, r), u = new Ht(e, r), [ {\n tl: o,\n tr: a,\n bl: u,\n br: h,\n tex: {\n x: n.tl[0],\n y: n.tl[1],\n w: n.displaySize[0],\n h: n.displaySize[1]\n },\n writingMode: void 0,\n glyphOffset: [ 0, 0 ]\n } ];\n }(i) : function() {\n const t = new Ht(0, 0), n = new Ht(0, 0), i = new Ht(0, 0);\n return [ {\n tl: t,\n tr: n,\n bl: new Ht(0, 0),\n br: i,\n tex: {\n x: 0,\n y: 0,\n w: 0,\n h: 0\n },\n writingMode: void 0,\n glyphOffset: [ 0, 0 ]\n } ];\n }(), k && ($ = k(null, a)), P && (W = P(null, a)), S && (q = S(null, a)), _ && (B = _(null, a)), \n O && (G = +("map" === O(null, a))), I && (J = +("map" === I(null, a))), T && (X = ae(T(null, a), 0, 360) * Math.PI / 180);\n const K = L || x;\n K && (Z = K(null, a) || 0);\n const Q = U || F;\n let tt;\n Q && (Y = Q(null, a) || 0);\n const nt = A || z;\n nt && (tt = 255 * nt(this.options.zoom, a));\n const it = this.options.EXTENT, et = D.length, rt = this.getAltitude(t.feature.properties);\n for (let t = 0; t < e.length; t++) {\n const n = e[t];\n if (it !== 1 / 0 && se(n, it)) continue;\n const i = n.x, o = n.y, a = D.length;\n for (let t = 0; t < a; t++) {\n const e = D[t], {tl: a, tr: c, bl: f, br: d, tex: y} = e;\n this.J(r, i, o, rt, 10 * a.x, 10 * a.y, y.x, y.y + y.h), u && this.X(r, h, et, e.glyphOffset, n, l), \n this.Z(r, E, C, j, N, H, V, R, $, W, q, B, tt, G, J, X, Z, Y), this.J(r, i, o, rt, 10 * c.x, 10 * c.y, y.x + y.w, y.y + y.h), \n u && this.X(r, h, et, e.glyphOffset, n, l), this.Z(r, E, C, j, N, H, V, R, $, W, q, B, tt, G, J, X, Z, Y), \n this.J(r, i, o, rt, 10 * f.x, 10 * f.y, y.x, y.y), u && this.X(r, h, et, e.glyphOffset, n, l), \n this.Z(r, E, C, j, N, H, V, R, $, W, q, B, tt, G, J, X, Z, Y), this.J(r, i, o, rt, 10 * d.x, 10 * d.y, y.x + y.w, y.y), \n u && this.X(r, h, et, e.glyphOffset, n, l), this.Z(r, E, C, j, N, H, V, R, $, W, q, B, tt, G, J, X, Z, Y), \n this.addElements(s, s + 1, s + 2), this.addElements(s + 1, s + 2, s + 3), s += 4;\n const v = Math.max(Math.abs(i), Math.abs(o), Math.abs(rt));\n v > this.maxPos && (this.maxPos = v);\n }\n }\n }\n J(t, n, i, e, r, s, o, a) {\n t.aPosition.push(n, i, e), t.aShape.push(r, s), t.aTexCoord.push(o, a);\n }\n X(t, n, i, e, r, s) {\n if (t.aCount.push(i), n) {\n t.aGlyphOffset.push(e[0], e[1]);\n const n = r.startIndex;\n t.aSegment.push(r.segment + n, n, r.line.length), t.aVertical.push(s);\n }\n }\n Z(t, n, i, e, r, s, o, a, h, u, l, c, f, d, y, v, p, m) {\n const {textFillFn: g, textSizeFn: w, textHaloFillFn: M, textHaloRadiusFn: b, textHaloOpacityFn: x, textDxFn: F, textDyFn: A, textPitchAlignmentFn: k, textRotationAlignmentFn: P, textRotationFn: S, textAllowOverlapFn: _, textIgnorePlacementFn: O, textOpacityFn: I, markerWidthFn: T, markerHeightFn: L, markerDxFn: U, markerDyFn: z, markerPitchAlignmentFn: D, markerRotationAlignmentFn: E, markerRotationFn: C, markerAllowOverlapFn: j, markerIgnorePlacementFn: N, markerOpacityFn: H} = this.C;\n g && t.aTextFill.push(...n), w && t.aTextSize.push(i), M && t.aTextHaloFill.push(...e), \n b && t.aTextHaloRadius.push(r), x && t.aTextHaloOpacity.push(s), F && t.aTextDx.push(o), \n A && t.aTextDy.push(a), T && t.aMarkerWidth.push(h), L && t.aMarkerHeight.push(u), \n U && t.aMarkerDx.push(l), z && t.aMarkerDy.push(c), (H || I) && t.aColorOpacity.push(f), \n (k || D) && t.aPitchAlign.push(d), (E || P) && t.aRotationAlign.push(y), (C || S) && t.aRotation.push(9362 * v);\n const V = j || _, R = N || O;\n (V || R) && t.aOverlap.push((V ? 8 : 0) + 4 * p + ((R ? 2 : 0) + m)), r > 0 && (this.properties.hasHalo = 1);\n }\n G(t, n, i) {\n const {feature: e, symbol: r} = t, s = this.Y(t, r), o = e.properties, {markerSpacingFn: a, textSpacingFn: h} = this.C, u = ((a ? a(null, o) : r.markerSpacing) || (h ? h(null, o) : r.textSpacing) || 250) * i;\n return function(t, n, i, e, r, s, o) {\n const {feature: a, size: h, symbol: u} = t, l = h ? 24 : 0, c = e * (h ? h[0] / l : 1), f = [];\n if ("line" === s) {\n let t = a.geometry;\n r && (t = rr(a.geometry, 0, 0, r, r));\n for (let e = 0; e < t.length; e++) {\n const s = ar(t[e], o, vr, u.isIconText ? null : i.vertical || i.horizontal || i, null, l, u.isIconText ? 1 : c, 1, r || 1 / 0);\n if (u.textPlacement && !u.isIconText) for (let t = 0; t < s.length; t++) s[t].startIndex = n.length / 3;\n if (f.push.apply(f, s), u.textPlacement && !u.isIconText) for (let i = 0; i < t[e].length; i++) n.push(t[e][i].x, t[e][i].y, 0);\n }\n } else if (3 === a.type) {\n const t = ur(a.geometry, 0);\n for (let n = 0; n < t.length; n++) {\n const i = t[n];\n if ("vertex" === s) for (let t = 0; t < i.length; t++) {\n const n = i[t];\n for (let t = 0; t < n.length; t++) se(n[t], r) || f.push(n[t]);\n } else {\n const t = fr(i, 16);\n se(t, r) || f.push(t);\n }\n }\n } else if (2 === a.type) for (let t = 0; t < a.geometry.length; t++) {\n const n = a.geometry[t];\n if ("vertex" === s) for (let t = 0; t < n.length; t++) se(n[t], r) || f.push(n[t]); else se(n[0], r) || f.push(n[0]);\n } else if (1 === a.type) for (let t = 0; t < a.geometry.length; t++) {\n const n = a.geometry[t];\n for (let t = 0; t < n.length; t++) {\n const i = n[t];\n se(i, r) || f.push(i);\n }\n }\n return f;\n }(t, this.lineVertex, n, i, this.options.EXTENT, s, u);\n }\n Y(t, n) {\n return this.C.markerPlacementFn ? this.C.markerPlacementFn(this.options.zoom, t.feature.properties) : n.markerPlacement || n.textPlacement;\n }\n }\n const gr = Math.cos(Math.PI / 180 * 37.5), wr = Math.pow(2, 16) / 1;\n class Mr extends le {\n constructor(t, n, i) {\n super(t, n, i);\n let e = !1;\n const {lineDasharrayFn: r, lineDashColorFn: s} = this.C;\n r && (e = function(t, n, i) {\n for (let e = 0; e < t.length; e++) if (i(n, t[e].properties)) return !0;\n return !1;\n }(t, this.options.zoom, r), e && (this.dasharrayFn = r)), (Fr(this.symbol.lineDasharray) || e) && s && (this.dashColorFn = s);\n }\n createStyledVector(t, n, i, e, r) {\n const s = new he(t, n, i, e), o = s.getLineResource();\n return !this.options.atlas && o && (r[o] = [ 0, 0 ]), s;\n }\n getFormat() {\n const {lineWidthFn: t, lineStrokeWidthFn: n, lineStrokeColorFn: i, lineColorFn: e, lineOpacityFn: r, lineDxFn: s, lineDyFn: o, linePatternAnimSpeedFn: a, linePatternGapFn: h} = this.C, u = [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n } ];\n if (u.push(this.options.center || this.iconAtlas ? {\n type: Int8Array,\n width: 3,\n name: "aExtrude"\n } : {\n type: Int8Array,\n width: 2,\n name: "aExtrude"\n }), u.push({\n type: Uint16Array,\n width: 1,\n name: "aLinesofar"\n }), t && u.push({\n type: Uint8Array,\n width: 1,\n name: "aLineWidth"\n }), n && u.push({\n type: Uint8Array,\n width: 1,\n name: "aLineStrokeWidth"\n }), e && u.push({\n type: Uint8Array,\n width: 4,\n name: "aColor"\n }), i && u.push({\n type: Uint8Array,\n width: 4,\n name: "aStrokeColor"\n }), r && u.push({\n type: Uint8Array,\n width: 1,\n name: "aOpacity"\n }), this.symbol.lineOffset && u.push({\n type: Int8Array,\n width: 2,\n name: "aExtrudeOffset"\n }), this.dasharrayFn && u.push({\n type: Uint8Array,\n width: 4,\n name: "aDasharray"\n }), this.dashColorFn && u.push({\n type: Uint8Array,\n width: 4,\n name: "aDashColor"\n }), this.iconAtlas) {\n const t = this.getIconAtlasMaxValue();\n u.push({\n type: t > 255 ? Uint16Array : Uint8Array,\n width: 4,\n name: "aTexInfo"\n });\n }\n return s && u.push({\n type: Int8Array,\n width: 1,\n name: "aLineDx"\n }), o && u.push({\n type: Int8Array,\n width: 1,\n name: "aLineDy"\n }), a && u.push({\n type: Int8Array,\n width: 1,\n name: "aLinePatternAnimSpeed"\n }), h && u.push({\n type: Uint8Array,\n width: 1,\n name: "aLinePatternGap"\n }), u;\n }\n placeVector(t) {\n const {lineJoinFn: n, lineCapFn: i, lineWidthFn: e, lineStrokeWidthFn: r, lineStrokeColorFn: s, lineColorFn: o, lineOpacityFn: a, lineJoinPatternModeFn: h, lineDxFn: u, lineDyFn: l, linePatternAnimSpeedFn: c, linePatternGapFn: f} = this.C, d = this.symbol, y = t.feature, v = 3 === y.type, p = y.properties, g = this.elements;\n v && (this.elements = []);\n let w = d.lineJoin || "miter", M = d.lineCap || "butt";\n if (n && (w = n(this.options.zoom, p) || "miter"), i && (M = i(this.options.zoom, p) || "butt"), \n e) {\n let t = e(this.options.zoom, p);\n Ji(t) && (t = 4), this.feaLineWidth = t;\n } else this.feaLineWidth = d.lineWidth;\n if (r) {\n let t = r(this.options.zoom, p);\n Ji(t) && (t = 0), this.feaLineStrokeWidth = t;\n } else this.feaLineStrokeWidth = d.lineStrokeWidth || 0;\n if (o && (this.feaColor = o(this.options.zoom, p) || [ 0, 0, 0, 255 ], m(this.feaColor) ? this.feaColor = [ 0, 0, 0, 0 ] : (this.feaColor = Array.isArray(this.feaColor) ? this.feaColor.map(t => 255 * t) : Vn(this.feaColor).array(), \n 3 === this.feaColor.length && this.feaColor.push(255))), s && (this.feaStrokeColor = s(this.options.zoom, p) || [ 0, 0, 0, 255 ], \n m(this.feaStrokeColor) ? this.feaStrokeColor = [ 0, 0, 0, 0 ] : (this.feaStrokeColor = Array.isArray(this.feaStrokeColor) ? this.feaStrokeColor.map(t => 255 * t) : Vn(this.feaStrokeColor).array(), \n 3 === this.feaStrokeColor.length && this.feaStrokeColor.push(255))), a) {\n let t = a(this.options.zoom, p);\n Ji(t) && (t = 1), this.feaOpacity = 255 * t;\n }\n if (this.dasharrayFn) {\n let t = this.dasharrayFn(this.options.zoom, p) || [ 0, 0, 0, 0 ];\n if (t.length < 4) {\n const n = t;\n 1 === t.length ? t = [ n[0], n[0], n[0], n[0] ] : 2 === t.length ? t = [ n[0], n[1], n[0], n[1] ] : 3 === t.length && (t = [ n[0], n[1], n[2], n[2] ]);\n }\n this.feaDash = t;\n }\n if (this.dashColorFn) {\n let t = (this.dashColorFn ? this.dashColorFn(this.options.zoom, p) : this.symbol.lineDashColor) || [ 0, 0, 0, 0 ];\n t = Array.isArray(t) ? t.map(t => 255 * t) : Vn(t).array(), 3 === t.length && t.push(255), \n this.feaDashColor = t;\n }\n if (this.iconAtlas) {\n const n = t.getLineResource(), i = this.iconAtlas.glyphMap[n];\n if (this.feaTexInfo = this.feaTexInfo || [ 0, 0, 0, 0 ], i) {\n const {tl: t, displaySize: i} = this.iconAtlas.positions[n];\n this.feaTexInfo[0] = t[0] + 1, this.feaTexInfo[1] = t[1] + 1, this.feaTexInfo[2] = i[0] - 3, \n this.feaTexInfo[3] = i[1] - 3;\n } else this.feaTexInfo[0] = this.feaTexInfo[1] = this.feaTexInfo[2] = this.feaTexInfo[3] = 0;\n this.feaJoinPatternMode = h ? h(this.options.zoom, p) || 0 : d.lineJoinPatternMode || 0;\n }\n if (u) {\n let t = u(this.options.zoom, p);\n Ji(t) && (t = 0), this.feaLineDx = t;\n }\n if (l) {\n let t = l(this.options.zoom, p);\n Ji(t) && (t = 0), this.feaLineDy = t;\n }\n if (c) {\n let t = c(this.options.zoom, p);\n Ji(t) && (t = 0), 0 !== t && (this.properties.hasPatternAnim = 1), this.feaPatternAnimSpeed = t;\n }\n if (f) {\n let t = f(this.options.zoom, p);\n Ji(t) && (t = 0), this.feaLinePatternGap = t;\n }\n const b = this.options.EXTENT;\n let x = y.geometry;\n b !== 1 / 0 && 3 !== y.type && (x = rr(y.geometry, -1, -1, b + 1, b + 1));\n for (let t = 0; t < x.length; t++) this.offset = this.data.aPosition.length / 3, \n this.K(x[t], y, w, M, 2, 1.05), v && (this.tt(g), this.elements = []);\n v && (this.elements = g);\n }\n nt() {\n return this.iconAtlas && this.feaTexInfo[2] && this.feaTexInfo[3];\n }\n K(t, n, i, e, r, s) {\n const o = this.nt() || Fr(this.feaDash) || Fr(this.symbol.lineDasharray);\n this.overscaling = 1;\n const a = this.options.EXTENT;\n if (this.distance = 0, this.scaledDistance = 0, this.totalDistance = 0, this.symbol.lineGradientProperty && n.properties && Qi(n.properties, "mapbox_clip_start") && Qi(n.properties, "mapbox_clip_end")) {\n this.clipStart = +n.properties.mapbox_clip_start, this.clipEnd = +n.properties.mapbox_clip_end;\n for (let n = 0; n < t.length - 1; n++) this.totalDistance += t[n].dist(t[n + 1]);\n this.updateScaledDistance();\n }\n const h = 3 === n.type;\n let u = t.length;\n for (;u >= 2 && t[u - 1].equals(t[u - 2]); ) u--;\n let l = 0;\n for (;l < u - 1 && t[l].equals(t[l + 1]); ) l++;\n if (u < (h ? 3 : 2)) return;\n "bevel" === i && (r = 1.05);\n const c = this.overscaling <= 16 ? 15 * a / (512 * this.overscaling) : 0, f = {\n vertexLength: 0,\n primitiveLength: 0\n };\n let d, y, v, p, m;\n this.e1 = this.e2 = -1, h && (d = t[u - 2], m = t[l].sub(d)._().O());\n for (let n = l; n < u; n++) {\n if (v = n === u - 1 ? h ? t[l + 1] : void 0 : t[n + 1], v && t[n].equals(v)) continue;\n m && (p = m), d && (y = d), d = t[n], m = v ? v.sub(d)._().O() : p, p = p || m;\n let a = p.add(m);\n 0 === a.x && 0 === a.y || a._();\n const g = p.x * m.x + p.y * m.y, w = a.x * m.x + a.y * m.y, M = 0 !== w ? 1 / w : 1 / 0, b = 2 * Math.sqrt(2 - 2 * w), x = w < gr && y && v, F = p.x * m.y - p.y * m.x > 0;\n if (!o && x && n > l) {\n const t = d.dist(y);\n if (t > 2 * c) {\n const n = d.sub(d.sub(y).F(c / t).I());\n this.updateDistance(y, n), this.addCurrentVertex(n, p, 0, 0, f), y = n;\n }\n }\n const A = y && v;\n let k = A ? i : h ? "butt" : e;\n if (A && "round" === k && (M < s ? k = "miter" : M <= 2 && (k = "fakeround")), "miter" === k && M > r && (k = "bevel"), \n "bevel" === k && (M > 2 && (k = "flipbevel"), M < r && (k = "miter")), y && this.updateDistance(y, d), \n (n > l && n < u - 1 || h && n === u - 1) && o) {\n const t = this.feaJoinPatternMode ? 0 : -p.mag() * w;\n this.addCurrentVertex(d, p, t, t, f), this.it = 1;\n }\n if ("miter" === k) a.F(M), this.addCurrentVertex(d, a, 0, 0, f); else if ("flipbevel" === k) {\n if (M > 100) a = m.mult(-1); else {\n const t = M * p.add(m).mag() / p.sub(m).mag();\n a.O().F(t * (F ? -1 : 1));\n }\n this.addCurrentVertex(d, a, 0, 0, f), this.addCurrentVertex(d, a.mult(-1), 0, 0, f);\n } else if ("bevel" === k || "fakeround" === k) {\n const t = -Math.sqrt(M * M - 1), n = F ? t : 0, i = F ? 0 : t;\n if (y && this.addCurrentVertex(d, p, n, i, f), "fakeround" === k) {\n const t = Math.round(180 * b / Math.PI / 20);\n for (let n = 1; n < t; n++) {\n let i = n / t;\n if (.5 !== i) {\n const t = i - .5;\n i += i * t * (i - 1) * ((1.0904 + g * (g * (3.55645 - 1.43519 * g) - 3.2452)) * t * t + (.848013 + g * (.215638 * g - 1.06021)));\n }\n const e = m.sub(p).F(i).u(p)._().F(F ? -1 : 1);\n this.addHalfVertex(d, e.x, e.y, !1, F, 0, f);\n }\n }\n v && this.addCurrentVertex(d, m, -n, -i, f);\n } else if ("butt" === k) this.addCurrentVertex(d, a, 0, 0, f); else if ("square" === k) {\n const t = y ? 1 : -1;\n this.addCurrentVertex(d, a, t, t, f);\n } else "round" === k && (y && (this.addCurrentVertex(d, p, 0, 0, f), this.addCurrentVertex(d, p, 1, 1, f, !0)), \n v && (this.addCurrentVertex(d, m, -1, -1, f, !0), this.addCurrentVertex(d, m, 0, 0, f)));\n if (!o && x && n < u - 1) {\n const t = d.dist(v);\n if (t > 2 * c) {\n const n = d.add(v.sub(d).F(c / t).I());\n this.updateDistance(d, n), this.addCurrentVertex(n, m, 0, 0, f), d = n;\n }\n }\n if ((n > l && n < u - 1 || h && n === l) && o) {\n delete this.it;\n const t = this.feaJoinPatternMode ? 0 : m.mag() * w;\n this.addCurrentVertex(d, m, t, t, f);\n }\n }\n }\n addCurrentVertex(t, n, i, e, r, s = !1) {\n const o = n.y * e - n.x, a = -n.y - n.x * e;\n this.addHalfVertex(t, n.x + n.y * i, n.y - n.x * i, s, !1, i, r), this.addHalfVertex(t, o, a, s, !0, -e, r), \n this.distance > wr / 2 && 0 === this.totalDistance && (this.distance = 0, this.updateScaledDistance(), \n this.addCurrentVertex(t, n, i, e, r, s));\n }\n addHalfVertex({x: t, y: n}, i, e, r, s, o, a) {\n this.fillData(this.data, t, n, i, e, r, s, 1 * this.scaledDistance);\n const h = a.vertexLength++;\n this.e1 >= 0 && this.e2 >= 0 && (this.addElements(this.e1, this.e2, h), a.primitiveLength++), \n s ? this.e2 = h : this.e1 = h;\n }\n fillData(t, n, i, e, r, s, o, a) {\n const {lineWidthFn: h, lineStrokeWidthFn: u, lineStrokeColorFn: l, lineColorFn: c, lineOpacityFn: f, lineDxFn: d, lineDyFn: y, linePatternAnimSpeedFn: v, linePatternGapFn: p} = this.C;\n if (this.options.center ? t.aPosition.push(n, i, 0) : t.aPosition.push(n = (n << 1) + (s ? 1 : 0), i = (i << 1) + (o ? 1 : 0), 0), \n t.aExtrude.push(63 * e, 63 * r), this.options.center || this.iconAtlas) {\n let n = 0;\n this.options.center && (n += 2 * s + o), this.iconAtlas && (n += 4 * (this.it && this.feaJoinPatternMode ? 1 : 0)), \n t.aExtrude.push(n);\n }\n t.aLinesofar.push(a), h && t.aLineWidth.push(Math.round(2 * this.feaLineWidth)), \n u && t.aLineStrokeWidth.push(Math.round(2 * this.feaLineStrokeWidth)), c && t.aColor.push(...this.feaColor), \n l && t.aStrokeColor.push(...this.feaStrokeColor), f && t.aOpacity.push(this.feaOpacity), \n this.dasharrayFn && t.aDasharray.push(...this.feaDash), this.dashColorFn && t.aDashColor.push(...this.feaDashColor), \n this.iconAtlas && t.aTexInfo.push(...this.feaTexInfo), d && t.aLineDx.push(this.feaLineDx), \n y && t.aLineDy.push(this.feaLineDy), v && t.aLinePatternAnimSpeed.push(127 * this.feaPatternAnimSpeed), \n p && t.aLinePatternGap.push(10 * this.feaLinePatternGap), this.maxPos = Math.max(this.maxPos, Math.abs(n) + 1, Math.abs(i) + 1);\n }\n addElements(t, n, i) {\n super.addElements(this.offset + t, this.offset + n, this.offset + i);\n }\n tt(t) {\n const n = this.options.EXTENT, i = this.elements;\n for (let e = 0; e < i.length; e += 3) n !== 1 / 0 && (xr(this.data.aPosition, i[e], i[e + 1], 3, n) || xr(this.data.aPosition, i[e + 1], i[e + 2], 3, n)) || t.push(i[e], i[e + 1], i[e + 2]);\n }\n et(t) {\n if (t.length <= 1) return t;\n const n = [], i = this.options.EXTENT;\n let e, r = !0;\n for (e = 0; e < t.length - 1; e++) {\n const s = br(t[e], t[e + 1], i);\n s && r || (n.push(t[e]), r = s);\n }\n return r || n.push(t[e]), n;\n }\n updateDistance(t, n) {\n this.distance += t.dist(n), this.updateScaledDistance();\n }\n updateScaledDistance() {\n this.scaledDistance = this.totalDistance > 0 ? (this.clipStart + (this.clipEnd - this.clipStart) * this.distance / this.totalDistance) * (wr - 1) : this.distance;\n }\n }\n function br(t, n, i) {\n return i !== 1 / 0 && (t.x < 0 && n.x < 0 || t.x > i && n.x > i || t.y < 0 && n.y < 0 || t.y > i && n.y > i);\n }\n function xr(t, n, i, e, r) {\n if (r === 1 / 0) return !1;\n const s = Math.floor(.5 * t[n * e]), o = Math.floor(.5 * t[n * e + 1]), a = Math.floor(.5 * t[i * e]), h = Math.floor(.5 * t[i * e + 1]);\n return s === a && (s < 0 || s > r) && o !== h || o === h && (o < 0 || o > r) && s !== a;\n }\n function Fr(t) {\n if (!Array.isArray(t)) return !1;\n for (let n = 0; n < t.length; n++) if (t[n]) return !0;\n return !1;\n }\n class Ar extends Mr {\n constructor(t, n, i) {\n super(t, n, i), this.rt = i.altitudeProperty;\n }\n getFormat() {\n const {lineColorFn: t, lineWidthFn: n} = this.C, i = [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n }, {\n type: Uint16Array,\n width: 1,\n name: "aLinesofar"\n }, {\n type: Uint8Array,\n width: 1,\n name: "aUp"\n }, {\n type: Int16Array,\n width: 3,\n name: "aExtrudedPosition"\n }, {\n type: Int8Array,\n width: 2,\n name: "aExtrude"\n } ];\n return t && i.push({\n type: Uint8Array,\n width: 4,\n name: "aColor"\n }), n && i.push({\n type: Uint8Array,\n width: 1,\n name: "aLineWidth"\n }), this.rt && i.push({\n type: Array,\n width: 1,\n name: "aLineHeight"\n }), i;\n }\n placeVector(t) {\n const n = t.feature;\n if (this.rt) {\n const {altitudeScale: t, altitudeProperty: i, defaultAltitude: e, heightProperty: r, defaultHeight: s, minHeightProperty: o} = this.options, {altitude: a, height: h} = re(n, t, i, e, r, s, o);\n this.feaAltitude = a, this.feaMinHeight = (a - h) / a * 32767, a > this.maxAltitude && (this.maxAltitude = a);\n }\n return super.placeVector(t);\n }\n K(t, n, i, e, r, s) {\n const o = this.data.aPosition.length / 3;\n super.K(t, n, i, e, r, s);\n const a = this.data.aPosition.length / 3, h = this.data.aPosition.length / 3 - this.offset;\n if (3 !== n.type && h > 0 && !1 !== this.options.side) {\n const t = !1 !== this.options.top ? 1 : 0, n = t + 4;\n let i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const n = this.data[t], e = n.length / i;\n for (let t = 0; t < e; t++) n.push(n[o * e + 3 * e + t]);\n }\n i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const e = this.data[t], r = e.length / i;\n for (let t = 0; t < r; t++) e.push(e[o * r + r * n + t]);\n }\n i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const e = this.data[t], r = e.length / i;\n for (let t = 0; t < r; t++) e.push(e[o * r + r * (n + 3) + t]);\n }\n super.addElements(t + 1, h + 1, h), super.addElements(h, h + 1, h + 2);\n const e = this.data.aPosition.length / 3 - this.offset;\n i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const n = this.data[t], e = n.length / i;\n for (let t = 0; t < e; t++) n.push(n[a * e - e + t]);\n }\n i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const e = this.data[t], r = e.length / i;\n for (let t = 0; t < r; t++) e.push(e[a * r - n * r - r + t]);\n }\n i = this.data.aPosition.length / 3;\n for (const t in this.data) {\n const e = this.data[t], r = e.length / i;\n for (let t = 0; t < r; t++) e.push(e[a * r - n * r - 3 * r + t]);\n }\n super.addElements(e, h - 3, e + 1), super.addElements(h - 3, e + 2, e + 1);\n }\n }\n fillData(t, n, i, e, r, s, o, a) {\n const h = !1 !== this.options.top, u = !1 !== this.options.side, l = this.feaLineWidth || this.symbol.lineWidth / 2 * (this.options.EXTENT / this.options.tileSize), c = 63 * e, f = 63 * r, d = l * e + n, y = l * r + i;\n this.st(t, n, i, e, r, s, o, a, d, y, c, f), u && (h && this.st(t, n, i, e, r, s, o, a, d, y, c, f), \n this.st(t, n, i, e, r, s, o, a, d, y, c, f), this.ot(t, n, i, e, r, s, o, a, d, y, c, f), \n this.ot(t, n, i, e, r, s, o, a, d, y, c, f)), this.maxPos = Math.max(this.maxPos, Math.abs(n), Math.abs(i));\n }\n st(t, n, i, e, r, s, o, a, h, u, l, c) {\n const {lineColorFn: f, lineWidthFn: d} = this.C;\n t.aPosition.push(n, i, 32767), t.aLinesofar.push(a), t.aUp.push(+o), t.aExtrudedPosition.push(h, u, 1), \n t.aExtrude.push(l, c), f && t.aColor.push(...this.feaColor), d && t.aLineWidth.push(Math.round(2 * this.feaLineWidth)), \n this.rt && t.aLineHeight.push(this.feaAltitude);\n }\n ot(t, n, i, e, r, s, o, a, h, u, l, c) {\n const {lineColorFn: f, lineWidthFn: d} = this.C;\n t.aPosition.push(n, i, this.feaMinHeight || 0), t.aLinesofar.push(a), t.aUp.push(+o), \n t.aExtrudedPosition.push(h, u, 1), t.aExtrude.push(l, c), f && t.aColor.push(...this.feaColor), \n d && t.aLineWidth.push(Math.round(2 * this.feaLineWidth)), this.rt && t.aLineHeight.push(this.feaAltitude);\n }\n addElements(t, n, i) {\n const e = !1 !== this.options.top, r = !1 !== this.options.side, s = (e ? 1 : 0) + (r ? 4 : 0);\n if (t *= s, n *= s, this.data.aUp[this.offset + (i *= s) + 4]) {\n if (e && super.addElements(n, t, i), r) {\n const t = e ? 1 : 0;\n super.addElements(n + t, i + t, i + t + 2), super.addElements(n + t + 1, i + t + 1 + 2, n + t + 1 + 2);\n }\n } else if (e && super.addElements(t, i, n), r) {\n const n = e ? 1 : 0;\n super.addElements(t + n, t + n + 2, i + n), super.addElements(t + n + 1 + 2, i + n + 1 + 2, i + n + 1);\n }\n }\n createDataPack(t, n) {\n this.maxAltitude = 0;\n const i = super.createDataPack(t, n);\n if (!i) return i;\n const {data: e, indices: r} = i;\n this.getFormat().reduce((t, n) => (t[n.name] = {\n size: n.width\n }, t), {}).aPickingId = {\n size: 1\n };\n const {aExtrudedPosition: s, aPosition: o, aLinesofar: a, aUp: h, aExtrude: u, aColor: l, aLineHeight: c, aLineWidth: f} = e, d = {}, y = Xn(s, r);\n let v, p = !0;\n for (let t = 0; t < y.length; t++) y[t] = -y[t], y[t] % 1 != 0 && (p = !1);\n if (!1 !== this.options.top && this.symbol.material && function(t) {\n for (const n in t) if (n.indexOf("Texture") >= 0 && t[n]) return !0;\n return !1;\n }(this.symbol.material) && (v = function(t, n, i) {\n const e = [];\n for (let r = 0; r < t.length; r += 3) {\n const t = n[r / 3];\n e.push(t / 256, i[r / 3] ? 1 : 0);\n }\n return e;\n }(s, a, h)), d.aPosition = o, v && (d.aTexCoord0 = new Float32Array(v)), d.aNormal = p ? new Int8Array(y) : new Float32Array(y), \n d.aPickingId = e.aPickingId, d.aExtrude = u, l && (d.aColor = l), f && (d.aLineWidth = f), \n c) {\n const t = Wi(this.maxAltitude);\n d.aLineHeight = new t(c);\n }\n const m = [];\n for (const t in d) m.push(d[t].buffer);\n return i.data = d, i.buffers = m, i;\n }\n }\n const kr = Math.pow(2, 16) / 1;\n class Pr extends le {\n getFormat() {\n return [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n } ];\n }\n placeVector(t) {\n const n = t.feature, i = 3 === n.type, e = n.geometry, r = this.elements;\n i && (this.elements = []);\n for (let t = 0; t < e.length; t++) this.offset = this.data.aPosition.length / 3, \n this.K(e[t], n), i && (this.tt(r), this.elements = []);\n i && (this.elements = r);\n }\n K(t, n) {\n const i = 3 === n.type;\n let e = t.length;\n for (;e >= 2 && t[e - 1].equals(t[e - 2]); ) e--;\n let r, s, o, a = 0;\n for (;a < e - 1 && t[a].equals(t[a + 1]); ) a++;\n if (!(e < (i ? 3 : 2))) {\n this.distance = 0, this.vertexLength = 0, this.primitiveLength = 0, this.e1 = this.e2 = this.e3 = -1, \n i && (r = t[e - 2]);\n for (let n = a; n < e; n++) o = i && n === e - 1 ? t[a + 1] : t[n + 1], o && t[n].equals(o) || (r && (s = r), \n r = t[n], s && (this.distance += r.dist(s)), this.addCurrentVertex(r, this.distance));\n }\n }\n addCurrentVertex(t, n) {\n const i = this.vertexLength++;\n this.addLineVertex(this.data, t, n), i >= 1 && this.addElements(i - 1, i), n > kr && (this.distance = 0, \n this.addCurrentVertex(t, this.distance));\n }\n addLineVertex(t, n) {\n t.aPosition.push(n.x, n.y, 0), this.maxPos = Math.max(this.maxPos, Math.abs(n.x), Math.abs(n.y));\n }\n addElements(t, n) {\n super.addElements(this.offset + t, this.offset + n);\n }\n tt(t) {\n const n = this.options.EXTENT, i = this.elements;\n for (let e = 0; e < i.length; e += 2) ie(this.data.aPosition, i[e], i[e + 1], 3, n) || t.push(i[e], i[e + 1]);\n }\n }\n const Sr = 45 * Math.PI / 100;\n class _r extends le {\n getFormat() {\n return [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n } ];\n }\n placeVector(t) {\n const n = this.G(t, this.symbol.markerSpacing || 250, this.symbol.markerPlacement || "point"), i = this.getAltitude(t.feature.properties);\n for (let t = 0; t < n.length; t++) {\n const e = n[t];\n this.data.aPosition.push(e.x, e.y), this.data.aPosition.push(i);\n const r = Math.max(Math.abs(e.x), Math.abs(e.y));\n r > this.maxPos && (this.maxPos = r);\n }\n }\n G(t, n, i) {\n const e = t.feature, r = t.feature.type, s = this.options.EXTENT, o = [];\n if ("line" === i) {\n let t = e.geometry;\n s && (t = rr(e.geometry, 0, 0, s, s));\n for (let i = 0; i < t.length; i++) {\n const e = ar(t[i], n, Sr, null, null, 24, 1, 1, s || 1 / 0);\n o.push.apply(o, e);\n }\n } else if (3 === r) {\n const t = ur(e.geometry, 0);\n for (let n = 0; n < t.length; n++) {\n const i = fr(t[n], 16);\n se(i, s) || o.push(i);\n }\n } else if (2 === e.type) for (let t = 0; t < e.geometry.length; t++) {\n const n = e.geometry[t];\n se(n[0], s) || o.push(n[0]);\n } else if (1 === e.type) for (let t = 0; t < e.geometry.length; t++) {\n const n = e.geometry[t];\n for (let t = 0; t < n.length; t++) {\n const i = n[t];\n se(i, s) || o.push(i);\n }\n }\n return o;\n }\n hasElements() {\n return !1;\n }\n }\n /*!\n * from @turf/bboxClip\n * https://github.com/Turfjs/turf\n * MIT LICENSE\n */ const Or = [], Ir = [];\n function Tr(t, n) {\n var i, e, r, s, o, a, h;\n for (e = 1; e <= 8; e *= 2) {\n for (i = [], s = !(Ur(r = t[t.length - 1], n) & e), o = 0; o < t.length; o++) {\n if ((h = !(Ur(a = t[o], n) & e)) !== s) {\n const t = Lr(r, a, e, n);\n i.push(void 0 !== a.x ? new Ht(t[0], t[1]) : t);\n }\n h && i.push(a), r = a, s = h;\n }\n if (!(t = i).length) break;\n }\n return i;\n }\n function Lr(t, n, i, e) {\n return Or[0] = void 0 === t.x ? t[0] : t.x, Or[1] = void 0 === t.y ? t[1] : t.y, \n t = Or, Ir[0] = void 0 === n.x ? n[0] : n.x, Ir[1] = void 0 === n.y ? n[1] : n.y, \n n = Ir, 8 & i ? [ t[0] + (n[0] - t[0]) * (e[3] - t[1]) / (n[1] - t[1]), e[3] ] : 4 & i ? [ t[0] + (n[0] - t[0]) * (e[1] - t[1]) / (n[1] - t[1]), e[1] ] : 2 & i ? [ e[2], t[1] + (n[1] - t[1]) * (e[2] - t[0]) / (n[0] - t[0]) ] : 1 & i ? [ e[0], t[1] + (n[1] - t[1]) * (e[0] - t[0]) / (n[0] - t[0]) ] : null;\n }\n function Ur(t, n) {\n Or[0] = void 0 === t.x ? t[0] : t.x, Or[1] = void 0 === t.y ? t[1] : t.y;\n var i = 0;\n return (t = Or)[0] < n[0] ? i |= 1 : t[0] > n[2] && (i |= 2), t[1] < n[1] ? i |= 4 : t[1] > n[3] && (i |= 8), \n i;\n }\n class zr extends le {\n constructor(...t) {\n super(...t), this.lineElements = [];\n }\n createStyledVector(t, n, i, e, r) {\n const s = new he(t, n, i, e), o = s.getPolygonResource();\n return !this.options.atlas && o && (r[o] = [ 0, 0 ]), s;\n }\n getFormat() {\n const t = [ {\n type: Int16Array,\n width: 3,\n name: "aPosition"\n } ], {polygonFillFn: n, polygonOpacityFn: i, uvScaleFn: e, uvOffsetFn: r} = this.C;\n if (this.iconAtlas) {\n const n = this.getIconAtlasMaxValue();\n t.push({\n type: n > 255 ? Uint16Array : Uint8Array,\n width: 4,\n name: "aTexInfo"\n });\n }\n return n && t.push({\n type: Uint8Array,\n width: 4,\n name: "aColor"\n }), i && t.push({\n type: Uint8Array,\n width: 1,\n name: "aOpacity"\n }), e && t.push({\n type: Uint16Array,\n width: 2,\n name: "aUVScale"\n }), r && t.push({\n type: Uint8Array,\n width: 2,\n name: "aUVOffset"\n }), t;\n }\n createDataPack(...t) {\n this.maxLineIndex = 0, this.lineElements = [];\n const n = super.createDataPack(...t);\n if (!n) return n;\n let i = this.lineElements;\n return i = new ($i(this.maxLineIndex))(this.lineElements), n.lineIndices = i, n.buffers.push(i.buffer), \n n;\n }\n placeVector(t, n) {\n const i = t.feature;\n this.at(i.geometry, i, n);\n }\n at(t, n) {\n let i, e, r, s;\n const {polygonFillFn: o, polygonOpacityFn: a, uvScaleFn: h, uvOffsetFn: u} = this.C, l = n.properties;\n o && (i = o(this.options.zoom, l) || [ 255, 255, 255, 255 ], m(i) ? i = [ 0, 0, 0, 0 ] : (i = Array.isArray(i) ? i.map(t => 255 * t) : Vn(i).array(), \n 3 === i.length && i.push(255))), a && (e = a(this.options.zoom, l), Ji(e) && (e = 1), \n e *= 255), h && (r = h(this.options.zoom, l), Ji(r) && (r = [ 1, 1 ]), r = [ 255 * r[0], 255 * r[1] ]), \n u && (s = u(this.options.zoom, l), Ji(s) && (s = [ 0, 0 ]), s = [ 255 * s[0], 255 * s[1] ]);\n const c = !!this.iconAtlas, f = ur(t, 500), d = this.getAltitude(l), y = [ 0, 0 ], v = [ 0, 0 ];\n if (c) {\n const {polygonPatternFileFn: t} = this.C, n = t ? t(null, l) : this.symbol.polygonPatternFile;\n if (this.iconAtlas.glyphMap[n]) {\n const t = this.iconAtlas.positions[n];\n y[0] = t.tl[0] + 1, y[1] = t.tl[1] + 1, v[0] = t.displaySize[0] - 3, v[1] = t.displaySize[1] - 3;\n }\n }\n const p = [ -1, -1, n.extent + 1, n.extent + 1 ];\n for (let t = 0; t < f.length; t++) {\n const n = f[t], o = this.data.aPosition.length / 3, a = [], h = [];\n for (let t = 0; t < n.length; t++) {\n let o = n[t];\n if (this.options.EXTENT !== 1 / 0 && (o = Tr(o, p)), 0 === o.length) continue;\n 0 !== t && h.push(a.length / 2);\n const u = this.lineElements.length;\n this.data.aPosition.push(o[0].x, o[0].y, d), c && this.data.aTexInfo.push(...y, ...v), \n void 0 !== i && this.data.aColor.push(...i), void 0 !== e && this.data.aOpacity.push(e), \n void 0 !== r && this.data.aUVScale.push(...r), void 0 !== s && this.data.aUVOffset.push(...s), \n this.maxPos = Math.max(this.maxPos, Math.abs(o[0].x), Math.abs(o[0].y)), this.addLineElements(u + o.length - 1, u), \n a.push(o[0].x), a.push(o[0].y);\n for (let t = 1; t < o.length; t++) this.data.aPosition.push(o[t].x, o[t].y, d), \n c && this.data.aTexInfo.push(...y, ...v), void 0 !== i && this.data.aColor.push(...i), \n void 0 !== e && this.data.aOpacity.push(e), void 0 !== r && this.data.aUVScale.push(...r), \n void 0 !== s && this.data.aUVOffset.push(...s), this.maxPos = Math.max(this.maxPos, Math.abs(o[t].x), Math.abs(o[t].y)), \n this.addLineElements(u + t - 1, u + t), a.push(o[t].x), a.push(o[t].y);\n }\n const u = ki(a, h);\n for (let t = 0; t < u.length; t += 3) this.addElements(o + u[t], o + u[t + 1], o + u[t + 2]);\n }\n }\n addLineElements(...t) {\n this.maxLineIndex = Math.max(this.maxLineIndex, ...t), this.lineElements.push(...t);\n }\n }\n var Dr = Object.freeze({\n __proto__: null,\n clipPolygon: Tr,\n calculateSignedArea: ne,\n getFeaAltitudeAndHeight: re,\n convertRTLText: tr\n });\n const Er = {\n polygonPatternFile: 1,\n markerFile: 1,\n markerPlacement: 1,\n markerSpacing: 1,\n textName: 1,\n textStyle: 1,\n textFaceName: 1,\n textWeight: 1,\n textPlacement: 1,\n textSpacing: 1,\n lineJoin: 1,\n lineCap: 1,\n linePatternFile: 1\n };\n Object.assign({\n visible: 1,\n textHorizontalAlignment: 1,\n textVerticalAlignment: 1,\n textWrapWidth: 1,\n markerHorizontalAlignment: 1,\n markerVerticalAlignment: 1\n }, Er), Object.assign({\n lineDasharray: 1\n }, Er);\n function Cr(t, n, i, e, r, s, o, a, h, u, l, c, f, d, y) {\n const v = n.length, p = r / 3;\n for (let i = 2, e = v; i < e; i += 3) t[r + i - 2] = n[i - 2], t[r + i - 1] = n[i - 1], \n t[r + i - 0] = n[i] - s;\n r += v;\n for (let i = 2, e = v; i < e; i += 3) t[r + i - 2] = n[i - 2], t[r + i - 1] = n[i - 1], \n t[r + i - 0] = n[i] - o;\n r += v;\n for (let i = 2, e = v; i < e; i += 3) t[r + i - 2] = n[i - 2], t[r + i - 1] = n[i - 1], \n t[r + i - 0] = n[i] - s;\n r += v;\n for (let i = 2, e = v; i < e; i += 3) t[r + i - 2] = n[i - 2], t[r + i - 1] = n[i - 1], \n t[r + i - 0] = n[i] - o;\n r += v, (i = i || []).push(v / 3);\n for (let n = 0; n < i.length; n++) {\n jr(p + (i[n - 1] || 0), p + i[n], t, v / 3, a, e, h, u, l, c, f, d, y);\n }\n return r;\n }\n function jr(t, n, i, e, r, s, o, a, h, u, l, c, f) {\n const d = s.length;\n let y, v;\n for (let o = t, a = n; o < a - 1; o++) y = o, v = o + 1, ct(i, y, v, r) || ((o - t) % 2 == 1 && (y += 2 * e, \n v += 2 * e), s.push(y + e, y, v), s.push(v, v + e, y + e));\n o && function(t, n, i, e, r, s, o, a, h) {\n let u, l = 0, c = 0, f = 0, d = 0;\n for (let y = e.length - 1; y >= 0; y--) {\n const v = 3 * e[y], p = 3 * e[y] + 1, m = 3 * e[y] + 2, g = i[v], w = i[p], M = i[m];\n l || c || (l = Math.max(i[m], i[3 * e[y - 2] + 2]), c = Math.min(i[m], i[3 * e[y - 2] + 2]), \n u = l - c);\n let b = f;\n const x = y % 6;\n 0 === t ? (5 === x && (d = Nt(i, e, y, g, w)), b = 2 === x || 3 === x || 4 === x ? f : f + d) : 1 === t && (2 === x || 3 === x || 4 === x ? b = 0 : 5 === x ? (d = Nt(i, e, y, g, w), \n b = d) : b = d);\n const F = b * o * a / r, A = M === l ? 0 : u * h / s;\n n[v / 3 * 2] = F, n[v / 3 * 2 + 1] = -A, 0 === x && (f += d);\n }\n }(a, h, i, s.slice(d, s.length), u[0], u[1], l, c, f);\n }\n function Nr(t, n, i, e, r, s, o, a, h, u) {\n void 0 === n.top && (n.top = !0), void 0 === n.side && (n.side = !0);\n const {altitudeScale: l, altitudeProperty: c, defaultAltitude: f, heightProperty: d, minHeightProperty: y, defaultHeight: v, tangent: p, uv: m, uvScale: M, topUVMode: b, sideUVMode: x, top: F, side: A, topThickness: k} = n, S = function(t, n, {altitudeScale: i, altitudeProperty: e, defaultAltitude: r, heightProperty: s, minHeightProperty: o, defaultHeight: a}, {side: h, top: u, topThickness: l, uvOrigin: c, uv: f, uvSize: d, topUVMode: y, sideUVMode: v, glScale: p, localScale: m, vScale: g}, w) {\n const M = n / t[0].extent, b = [], x = [], F = [], A = [], k = [], S = [], _ = !!f, O = !!u, T = !!h, z = _ ? [] : null;\n function D(t, i, e, r) {\n if (O) {\n const r = ki(A, e, 3);\n if (0 === r.length) return i;\n let s;\n I(k, A), i += A.length;\n for (let n = 2, i = r.length; n < i; n += 3) s = r[n - 1], r[n - 1] = r[n] + t / 3, \n r[n] = s + t / 3, r[n - 2] += t / 3;\n I(S, r), _ && Et(y || 0, t, i, z, k, 0, p, m, d[0], d[1]), l > 0 && !T && (i = Cr(k, A, e, S, i, 0, l, n, _, v || 0, z, d, p, m, g));\n }\n return T && (O && (l = 0), i = Cr(k, A, e, S, i, l, r, n, _, v || 0, z, d, p, m, g)), \n i;\n }\n let E = 0, C = 0;\n const j = [ -1, -1, n + 1, n + 1 ];\n let N = 0, H = t.length;\n void 0 !== w && (N = w, H = w + 1);\n let V = 0, R = !1;\n for (;N < H; N++) {\n const h = t[N], u = h.id;\n P(u) && (Math.abs(u) > V && (V = Math.abs(u)), u < 0 && (R = !0));\n const l = h.geometry, {altitude: c, height: f} = Dr.getFeaAltitudeAndHeight(h, i, e, r, s, a, o);\n E = Math.max(Math.abs(c), E);\n const d = k.length;\n let y = C, v = [];\n A.length = 0;\n for (let t = 0, i = l.length; t < i; t++) {\n const e = Dr.calculateSignedArea(l[t]) < 0;\n !e && t > 0 && (C = D(y, C, v, f * M), A.length = 0, v = [], y = C);\n let r = l[t];\n if (n !== 1 / 0 && (r = Dr.clipPolygon(r, j)), !r.length) {\n t === i - 1 && (C = D(y, C, v, f * M));\n continue;\n }\n const s = r.length;\n Array.isArray(r[0]) ? r[0][0] === r[s - 1][0] && r[0][1] === r[s - 1][1] || r.push([ r[0][0], r[0][1] ]) : r[0].x === r[s - 1].x && r[0].y === r[s - 1].y || r.push(r[0]), \n e && v.push(A.length / 3), lt(A, A.length, r, M, c), t === i - 1 && (C = D(y, C, v, f * M));\n }\n const p = k.length - d, m = "__fea_idx".trim();\n for (let t = 0; t < p / 3; t++) x.push(void 0 === h[m] ? N : h[m]), b.push(N), P(u) && F.push(u);\n }\n const $ = L(x.length ? x[x.length - 1] : 0), W = {\n maxAltitude: E,\n vertices: new (U(Math.max(512, E)))(k),\n indices: S,\n pickingIds: new $(x),\n featureIndexes: b\n };\n if (F.length) {\n const t = R ? U(V) : L(V);\n W.featureIds = new t(F);\n } else W.featureIds = [];\n return z && (z.length = k.length / 3 * 2, W.uvs = z), W;\n }(t, i, {\n altitudeScale: l,\n altitudeProperty: c,\n defaultAltitude: f || 0,\n heightProperty: d,\n minHeightProperty: y,\n defaultHeight: v || 0\n }, {\n top: F,\n side: A,\n topThickness: 10 * k || 0,\n uv: m || p,\n uvSize: M ? [ .5 * M[0], .5 * M[1] ] : [ .5, .5 ],\n uvOrigin: e,\n topUVMode: b,\n sideUVMode: x,\n glScale: r,\n localScale: o,\n vScale: s\n }, u), _ = [], O = new (T(S.vertices.length / 3))(S.indices);\n delete S.indices, _.push(O.buffer, S.vertices.buffer, S.pickingIds.buffer);\n const z = Xn(S.vertices, O);\n let E = !0;\n for (let t = 0; t < z.length; t++) z[t] = -z[t], z[t] % 1 != 0 && (E = !1);\n if (S.normals = z, p) {\n let t = function(t, n, i, e) {\n const r = t.length / 3, s = new Array(4 * r), o = [], a = [];\n for (let t = 0; t < r; t++) o[t] = [ 0, 0, 0 ], a[t] = [ 0, 0, 0 ];\n const h = [ 0, 0, 0 ], u = [ 0, 0, 0 ], l = [ 0, 0, 0 ], c = [ 0, 0 ], f = [ 0, 0 ], d = [ 0, 0 ], y = [ 0, 0, 0 ], v = [ 0, 0, 0 ];\n function p(n, e, r) {\n Zn(h, t, 3 * n), Zn(u, t, 3 * e), Zn(l, t, 3 * r), Yn(c, i, 2 * n), Yn(f, i, 2 * e), \n Yn(d, i, 2 * r);\n const s = u[0] - h[0], p = l[0] - h[0], m = u[1] - h[1], g = l[1] - h[1], w = u[2] - h[2], M = l[2] - h[2], b = f[0] - c[0], x = d[0] - c[0], F = f[1] - c[1], A = d[1] - c[1], k = 1 / (b * A - x * F);\n bt(y, (A * s - F * p) * k, (A * m - F * g) * k, (A * w - F * M) * k), bt(v, (b * p - x * s) * k, (b * g - x * m) * k, (b * M - x * w) * k), \n xt(o[n], o[n], y), xt(o[e], o[e], y), xt(o[r], o[r], y), xt(a[n], a[n], v), xt(a[e], a[e], v), \n xt(a[r], a[r], v);\n }\n for (let t = 0, n = e.length; t < n; t += 3) p(e[t + 0], e[t + 1], e[t + 2]);\n const m = [], g = [], w = [], M = [];\n let b, x, F;\n function A(t) {\n Zn(w, n, 3 * t), Mt(M, w), x = o[t], Mt(m, x), St(m, m, function(t, n, i) {\n return t[0] = n[0] * i, t[1] = n[1] * i, t[2] = n[2] * i, t;\n }(w, w, kt(w, x))), At(m, m), Pt(g, M, x), F = kt(g, a[t]), b = F < 0 ? -1 : 1, \n s[4 * t] = m[0], s[4 * t + 1] = m[1], s[4 * t + 2] = m[2], s[4 * t + 3] = b;\n }\n for (let t = 0, n = e.length; t < n; t += 3) A(e[t + 0]), A(e[t + 1]), A(e[t + 2]);\n return s;\n }(S.vertices, S.normals, S.uvs, O);\n t = function(t, n) {\n const i = new Float32Array(n.length), e = [], r = [], s = [];\n for (let o = 0; o < n.length; o += 4) {\n const a = o / 4 * 3;\n bt(r, t[a] || 0, t[a + 1] || 0, t[a + 2] || 0), Ot(e, n[o] || 0, n[o + 1] || 0, n[o + 2] || 0, n[o + 3] || 0), \n Jn(s, r, e), _t(i.subarray(o, o + 4), s);\n }\n return i;\n }(S.normals, t), S.tangents = t, _.push(t.buffer), delete S.normals;\n }\n if (S.normals && (S.normals = E ? new Int8Array(S.normals) : new Float32Array(S.normals), \n _.push(S.normals.buffer)), S.uvs) {\n const t = S.uvs;\n S.uvs = new Float32Array(t), _.push(S.uvs.buffer);\n }\n const C = function(t, n, i, e) {\n const r = {};\n if (D(n.polygonFill)) {\n const s = {}, o = w(n.polygonFill), a = new Uint8Array(4 * e.length);\n for (let n = 0; n < e.length; n++) {\n const r = t[e[n]], h = r.properties || {};\n h.$layer = r.layer, h.$type = r.type;\n let u = o(i, h);\n if (delete h.$layer, delete h.$type, Array.isArray(u) || (u = s[u] = s[u] || Vn(u).array()), \n Array.isArray(u)) {\n for (let t = 0; t < u.length; t++) Hr[t] = 255 * u[t];\n 3 === u.length && (Hr[3] = 255);\n }\n a[4 * n] = Hr[0], a[4 * n + 1] = Hr[1], a[4 * n + 2] = Hr[2], a[4 * n + 3] = Hr[3];\n }\n r.aColor = a;\n }\n if (D(n.polygonOpacity)) {\n const s = g(n.polygonOpacity), o = new Uint8Array(e.length);\n for (let n = 0; n < e.length; n++) {\n const r = t[e[n]], a = r.properties || {};\n a.$layer = r.layer, a.$type = r.type;\n const h = s(i, a);\n delete a.$layer, delete a.$type, o[n] = 255 * h;\n }\n r.aOpacity = o;\n }\n return r;\n }(t, a, h, S.featureIndexes), j = {\n data: {\n data: {\n aPosition: S.vertices,\n aNormal: S.normals,\n aTexCoord0: S.uvs,\n aTangent: S.tangents,\n aPickingId: S.pickingIds\n },\n indices: O,\n properties: {\n maxAltitude: S.maxAltitude\n }\n },\n buffers: _\n };\n return S.featureIds.length ? (j.data.featureIds = S.featureIds, _.push(j.data.featureIds.buffer)) : j.data.featureIds = [], \n C.aColor && (j.data.data.aColor = C.aColor, j.buffers.push(C.aColor.buffer)), C.aOpacity && (j.data.data.aOpacity = C.aOpacity, \n j.buffers.push(C.aOpacity.buffer)), j;\n }\n const Hr = [];\n function Vr(t, n, {altitudeScale: i, altitudeProperty: e, defaultAltitude: r, heightProperty: s, minHeightProperty: o, defaultHeight: a, bottom: h}) {\n const u = h, l = n / t[0].extent, c = 2 * function(t, n) {\n let i = 0;\n for (let e = 0, r = t.length; e < r; e++) {\n const r = t[e];\n if (P(r.geometry[0][0])) {\n const t = 3 * r.geometry.length;\n i += n ? 2 * t - 6 : t;\n } else for (let t = 0, e = r.geometry.length; t < e; t++) {\n let e = 3 * r.geometry[t].length;\n 3 === r.type && (e -= 3), i += n ? 2 * e - 6 : e;\n }\n }\n return i;\n }(t) + 3 * t.length * 2, f = [], d = new Int16Array(c), y = [];\n function v(t, i, e) {\n const r = i - t, s = d.subarray(t, i), o = d.subarray(i, i + r);\n o.set(s);\n for (let t = 2, n = o.length; t < n; t += 3) o[t] = s[t] - e;\n const a = t / 3, h = r / 3;\n let l, c;\n for (let t = a, i = h + a; t < i; t++) t < i - 1 ? (l = t, c = t + 1) : (l = t, \n c = a), ct(d, l, c, n) || (y.push(l, c), u && y.push(l + h, c + h), Rr(d, l, n) || y.push(l, l + h));\n return i + r;\n }\n let p = 0, m = 0;\n const g = "__fea_idx".trim();\n for (let n = 0, h = t.length; n < h; n++) {\n const h = t[n], u = h.geometry, {altitude: c, height: w} = Dr.getFeaAltitudeAndHeight(h, i, e, r, s, a, o);\n m = Math.max(Math.abs(c), m);\n let M = p;\n for (let t = 0, n = u.length; t < n; t++) {\n let n = u[t];\n const i = n.length;\n n[0][0] === n[i - 1][0] && n[0][1] === n[i - 1][1] && (n = n.slice(0, i - 1)), p = lt(d, M, n, l, c), \n p = v(M, p, w * l), M = p;\n }\n const b = y.length - f.length;\n for (let t = 0; t < b; t++) f.push(h[g]);\n }\n const w = new (T(y.reduce((t, n) => Math.max(t, n), 0)))(y), M = L(t.length);\n return {\n aPosition: new (U(Math.max(512, m)))(d),\n indices: w,\n aPickingId: new M(f)\n };\n }\n function Rr(t, n, i) {\n const e = t[3 * n], r = t[3 * n + 1];\n return e < 0 || e > i || r < 0 || r > i;\n }\n function $r(t, n, i) {\n const e = Vr(t, i, n), r = [ e.aPosition.buffer, e.indices.buffer, e.aPickingId.buffer ], s = e.indices;\n return delete e.indices, {\n data: {\n data: e,\n indices: s\n },\n buffers: r\n };\n }\n class Wr {\n constructor(t, n, i, e, r) {\n this.id = t, this.options = n, this.upload = i, this.ht(n.style), this.requests = {}, \n this.ut = 0, this.lt = e, this.loadings = r;\n }\n updateStyle(t, n) {\n this.options.style = t, this.ht(t), this.ut++, n();\n }\n updateOptions(t, n) {\n this.options = A(this.options, t), n();\n }\n loadTile(t, n) {\n const i = this.loadings, e = t.tileInfo.url, r = this.options.debugTile;\n if (r) {\n const {x: i, y: e, z: s} = t.tileInfo;\n if (s !== r.z || i !== r.x || e !== r.y) return void n();\n }\n if (this.lt.has(e)) {\n const {features: r, layers: s} = this.lt.get(e), o = i[e];\n if (delete i[e], !r || !r.length) return this.ct(o), void n();\n if (o) for (let n = 0; n < o.length; n++) this.ft.call(o[n].ref, t, o[n].callback, e, s, r);\n this.ft(t, n, e, s, r);\n } else i[e] ? i[e].push({\n callback: n,\n ref: this\n }) : (i[e] = [ {\n callback: n,\n ref: this\n } ], this.requests[e] = this.getTileFeatures(t.tileInfo, (n, r, s, o) => {\n const a = i[e];\n if (delete i[e], this.checkIfCanceled(e)) return delete this.requests[e], void this.ct(a, null, {\n canceled: !0\n });\n if (delete this.requests[e], this.options.debug && r) for (let n = 0; n < r.length; n++) r[n]._debug_info = {\n index: n,\n tileId: t.tileInfo.id\n };\n if (n) return n.loading || this.lt.add(e, {\n features: [],\n layers: []\n }), void this.ct(a, n);\n if (!r || !r.length) return this.lt.add(e, {\n features: [],\n layers: []\n }), void this.ct(a);\n if (this.lt.add(e, {\n features: r,\n layers: s\n }), a) for (let n = 0; n < a.length; n++) this.ft.call(a[n].ref, t, a[n].callback, e, s, r, o);\n }));\n }\n ft(t, n, i, e, r, s) {\n this.dt(e, r, t).then(t => {\n t.canceled ? n(null, {\n canceled: !0\n }) : (t.data.style = this.ut, s && A(t.data, s), n(null, t.data, t.buffers));\n }).catch(t => {\n n(t);\n });\n }\n abortTile(t, n) {\n delete this.requests[t], this.yt(t), n();\n }\n yt(t) {\n const n = this.loadings[t];\n if (n) for (let t = 0; t < n.length; t++) n[t].callback(null, {\n canceled: !0\n });\n delete this.loadings[t];\n }\n ct(t, n, i) {\n if (t) for (let e = 0; e < t.length; e++) t[e].callback(n, i);\n }\n checkIfCanceled(t) {\n return !this.requests[t];\n }\n fetchIconGlyphs(t, n, i) {\n this.upload("fetchIconGlyphs", {\n icons: t,\n glyphs: n\n }, null, i);\n }\n dt(t, n, {glScale: i, zScale: e, tileInfo: r}) {\n if (!n.length) return Promise.resolve({\n data: null,\n buffers: []\n });\n const s = !this.options.style.style.length && !this.options.style.featureStyle.length;\n let o = this.pluginConfig.slice(0);\n s && (o = this.vt(t)), this.featurePlugins && I(o, this.featurePlugins);\n const a = n[0].extent, h = r.z, u = {\n x: r.extent2d.xmin * i,\n y: r.extent2d.ymax * i\n }, l = [], c = [], f = [], d = this.options, y = [], v = {}, p = [ Promise.resolve(this.ut) ];\n let m = 0, g = -1;\n for (let t = 0; t < o.length; t++) {\n g++;\n const r = o[t];\n r.type !== m && (g = 0, m = r.type);\n const d = 0 === r.type ? l : c;\n if (r.symbol && !1 === r.symbol.visible) {\n d[g] = null;\n continue;\n }\n const {tileFeatures: w, tileFeaIndexes: M} = this.pt(r.type, r.filter, n, v, t);\n if (!w.length) {\n d[g] = null;\n continue;\n }\n const b = T(M[M.length - 1]);\n d[g] = {\n styledFeatures: new b(M)\n }, f.push({\n idx: t,\n typeIdx: g\n }), y.push(d[g].styledFeatures.buffer);\n let x = this.gt(w, r, {\n extent: a,\n tilePoint: u,\n glScale: i,\n zScale: e,\n zoom: h\n });\n s && (x = x.then(t => {\n if (!t) return null;\n if (t.data) t.data.layer = w[0].layer; else if (Array.isArray(t)) for (let n = 0; n < t.length; n++) t[n] && t[n].data && (t[n].data.layer = w[0].layer);\n return t;\n })), p.push(x);\n }\n return Promise.all(p).then(([i, ...e]) => {\n function r(t, n) {\n if (void 0 === t.data.ref && (t.data.type = o[f[n].idx].renderPlugin.dataConfig.type, \n t.data.filter = o[f[n].idx].filter.def, t.buffers && t.buffers.length)) for (let n = 0; n < t.buffers.length; n++) y.push(t.buffers[n]);\n }\n if (i !== this.ut) return {\n canceled: !0\n };\n for (let t = 0; t < e.length; t++) {\n if (!e[t]) continue;\n const n = e[t], i = 0 === o[f[t].idx].type ? l : c;\n if (Array.isArray(n)) {\n const e = [];\n for (let i = 0; i < n.length; i++) n[i] && (r(n[i], t), (void 0 === n[i].data.ref || n[n[i].data.ref]) && e.push(n[i].data));\n e.length && (i[f[t].typeIdx].data = e);\n } else r(n, t), i[f[t].typeIdx].data = n.data;\n }\n const s = {}, h = t;\n if (d.features || d.schema) {\n let t;\n for (let i = 0, e = n.length; i < e; i++) if (t = n[i], h[t.layer].properties || (h[t.layer].properties = Gr(t.properties)), \n d.features && t && v[i]) if ("id" === d.features) s[i] = t.id; else {\n const n = A({}, t);\n d.pickingGeometry || delete n.geometry, delete n.extent, delete n.properties.$layer, \n delete n.properties.$type, delete n.__index, s[i] = n;\n }\n }\n return {\n data: {\n schema: h,\n data: l,\n featureData: c,\n extent: a,\n features: s\n },\n buffers: y\n };\n });\n }\n gt(t, n, i) {\n const e = n.renderPlugin.dataConfig, r = n.symbol, s = this.options.tileSize[0], {extent: o, glScale: a, zScale: h, zoom: u, tilePoint: l} = i, c = o / s, f = e.type, d = this.options.debugTile && this.options.debugTile.index;\n if ("3d-extrusion" === f) {\n const n = Jr(r);\n return n && (e.uv = 1, 2 === n && (e.tangent = 1)), Promise.all([ Promise.resolve(Nr(t, e, o, l, a, h, this.options.tileSize[1] / o, r, u, d)) ]);\n }\n if ("3d-wireframe" === f) return Promise.all([ Promise.resolve($r(t, e, o)) ]);\n if ("point" === f) {\n const n = A({}, e, {\n EXTENT: o,\n requestor: this.fetchIconGlyphs.bind(this),\n zoom: u,\n debugIndex: d\n }), i = mr.splitPointSymbol(r);\n return mr.needMerge(i[0]) && (t = mr.mergeLineFeatures(t, i[0], u)), Promise.all(i.map(i => new mr(t, i, n).load(c)));\n }\n if ("native-point" === f) {\n const n = A({}, e, {\n EXTENT: o,\n zoom: u,\n debugIndex: d\n });\n return Xr(t, r, n, _r, o / s);\n }\n if ("line" === f) {\n const n = A({}, e, {\n EXTENT: o,\n requestor: this.fetchIconGlyphs.bind(this),\n tileRatio: c,\n zoom: u,\n debugIndex: d\n });\n return Xr(t, r, n, Mr);\n }\n if ("native-line" === f) {\n const n = A({}, e, {\n EXTENT: o,\n zoom: u,\n debugIndex: d\n });\n return Xr(t, r, n, Pr);\n }\n if ("fill" === f) {\n const n = A({}, e, {\n EXTENT: o,\n requestor: this.fetchIconGlyphs.bind(this),\n zoom: u,\n debugIndex: d\n });\n return Xr(t, r, n, zr);\n }\n if ("line-extrusion" === f) {\n delete r.lineGradientProperty, r.lineJoin = "miter", r.lineCap = "butt";\n const n = Jr(r);\n n && (e.uv = 1, 2 === n && (e.tangent = 1));\n const i = A({}, e, {\n EXTENT: o,\n tileSize: s,\n zScale: h,\n glScale: a,\n zoom: u,\n debugIndex: d\n });\n if (n) {\n const n = [];\n if (!1 !== e.top) {\n const e = A({}, i);\n e.side = !1, n.push(new Ar(t, r, e));\n }\n return !1 !== e.side && (i.side = !0, i.top = !1, n.push(new Ar(t, r, i))), Promise.all(n.map(t => t.load()));\n }\n return Promise.all([ new Ar(t, r, i).load() ]);\n }\n return Promise.resolve([]);\n }\n pt(t, n, i, e) {\n const r = "__fea_idx".trim(), s = [], o = [], a = i.length;\n for (let h = 0; h < a; h++) if ((1 === t || void 0 === i[h].id || !this.styledFeatures[i[h].id]) && ((!n.def || "default" === n.def) && !e[h] || !0 === n.def || Array.isArray(n.def) && n(i[h]))) {\n e[h] = 1;\n const n = A({}, i[h]);\n if (n[r] = h, o.push(n), s.push(h), 1 === t) break;\n }\n return {\n tileFeatures: o,\n tileFeaIndexes: s\n };\n }\n ht(t) {\n const {style: n, featureStyle: i} = t, e = {};\n i.forEach(t => {\n Array.isArray(t.id) ? (t.id.forEach(t => {\n e[t] = 1;\n }), t.filter = [ "in", "$id", ...t.id ]) : (e[t.id] = 1, t.filter = [ "==", "$id", t.id ]);\n });\n const r = z(n);\n for (let t = 0; t < n.length; t++) r[t].filter && (r[t].filter.def = n[t].filter ? n[t].filter.value || n[t].filter : void 0), \n r[t].type = 0;\n const s = [], o = z(i);\n for (let t = 0; t < i.length; t++) o[t].type = 1, o[t].filter.def = i[t].filter ? i[t].filter.value || i[t].filter : void 0, \n o[t].renderPlugin && s.push(o[t]);\n this.pluginConfig = r, this.featurePlugins = s, this.styledFeatures = e;\n }\n vt(t) {\n let n = this.wt;\n this.wt || (n = this.wt = {});\n const e = [ "", "Point", "LineString", "Polygon", "MultiPoint", "MultiLineString", "MultiPolygon" ], r = [];\n for (const s in t) {\n const o = s;\n if (!n[s]) {\n const r = [];\n for (let n = 0; n < t[s].types.length; n++) {\n const a = t[s].types[n], h = [ "all", [ "==", "$layer", o ], [ "==", "$type", e[a] ] ], u = {\n filter: i(h),\n renderPlugin: qr(a),\n symbol: Br(a)\n };\n u.filter.def = h, u.type = 0, r.push(u);\n }\n n[o] = r;\n }\n r.push(...n[o]);\n }\n return r;\n }\n }\n function qr(t) {\n switch (t) {\n case 1:\n return {\n type: "native-point",\n dataConfig: {\n type: "native-point",\n only2D: !0\n }\n };\n\n case 2:\n return {\n type: "native-line",\n dataConfig: {\n type: "native-line",\n only2D: !0\n }\n };\n\n case 3:\n return {\n type: "fill",\n dataConfig: {\n type: "fill",\n only2D: !0\n }\n };\n }\n return null;\n }\n function Br(t) {\n switch (t) {\n case 1:\n return {\n markerFill: "#f00",\n markerSize: 10\n };\n\n case 2:\n return {\n lineColor: "#fff"\n };\n\n case 3:\n return {\n polygonFill: "#00f",\n polygonOpacity: .4\n };\n }\n return null;\n }\n function Gr(t) {\n if (Array.isArray(t) || !_(t)) return {};\n const n = {};\n for (const i in t) {\n const e = t[i];\n k(e) ? n[i] = "string" : P(e) ? n[i] = "number" : !0 === e || !1 === e ? n[i] = "boolean" : Array.isArray(e) ? n[i] = "array" : n[i] = "object";\n }\n return n;\n }\n function Jr(t) {\n if (!t) return 0;\n let n = 0;\n for (const i in t) {\n if (("normalTexture" === i || "bumpTexture" === i) && t[i]) return 2;\n if (i.indexOf("Texture") > 0 && t[i]) n = 1; else if (_(t[i])) {\n const e = Jr(t[i]);\n if (2 === e) return e;\n 1 === e && (n = 1);\n }\n }\n return n;\n }\n function Xr(t, n, i, e, r) {\n const s = {}, o = Array.isArray(n) ? n : [ n ];\n let a = -1;\n for (let t = 0; t < o.length; t++) s[t] = Zr(o[t]), !s[t] && o[t] && -1 === a && (a = t);\n const h = [];\n for (let n = 0; n < o.length; n++) o[n] && (o[n].index = {\n index: n\n }, s[n] || n === a ? h.push(new e(t, o[n], i).load(r)) : h.push({\n data: {\n ref: a,\n symbolIndex: {\n index: n\n }\n }\n }));\n return Promise.all(h);\n }\n function Zr(t) {\n if (!t) return 0;\n for (const n in t) if (D(t[n])) return 1;\n return 0;\n }\n function Yr(t, n) {\n Kr(t.geometry, n);\n }\n function Kr(t, n) {\n if (t) switch (t.type) {\n case "Point":\n Qr(t.coordinates, n);\n break;\n\n case "MultiPoint":\n case "LineString":\n ts(t.coordinates, n);\n break;\n\n case "MultiLineString":\n case "Polygon":\n ns(t.coordinates, n);\n break;\n\n case "MultiPolygon":\n !function(t, n) {\n for (let i = 0; i < t.length; i++) ns(t[i], n);\n }(t.coordinates, n);\n break;\n\n case "GeometryCollection":\n for (let i = 0; i < t.geometries.length; i++) Kr(t.geometries[i], n);\n }\n }\n function Qr(t, n) {\n n[0] = Math.min(n[0], t[0]), n[1] = Math.min(n[1], t[1]), n[2] = Math.max(n[2], t[0]), \n n[3] = Math.max(n[3], t[1]);\n }\n function ts(t, n) {\n for (let i = 0; i < t.length; i++) Qr(t[i], n);\n }\n function ns(t, n) {\n for (let i = 0; i < t.length; i++) ts(t[i], n);\n }\n class is extends Wr {\n constructor(t, n, i, e, r, s) {\n super(t, n, i, e, r), (n = n || {}).extent || (n.extent = 8192), this.zoomOffset = 0, \n n.tileSize && (this.zoomOffset = -function(t) {\n if (Math.log2) return Math.log2(t);\n const n = Math.log(t) * Math.LOG2E, i = Math.round(n);\n return Math.abs(i - n) < 1e-14 ? i : n;\n }(n.tileSize[0] / 256)), this.setData(n.data, s);\n }\n setData(t, n) {\n if (delete this.index, !t) return void n();\n const i = {\n maxZoom: 24,\n tolerance: this.options.extent / this.options.tileSize[0] * 1,\n extent: this.options.extent,\n buffer: this.options.tileBuffer || 64,\n debug: 0,\n lineMetrics: !0,\n indexMaxZoom: 5,\n indexMaxPoints: 1e5\n };\n if (k(t) && "{" != t.substring(0, 1) || t.url) C.getJSON(t.url ? t.url : t, t.url ? t : {}, (t, e) => {\n if (t && n(t), !e) return void n(null, {\n extent: null,\n idMap: {}\n });\n const r = e, {first1000: s, idMap: o} = this.Mt(r);\n this.bt(s, o, r, i, n);\n }); else {\n "string" == typeof t && (t = JSON.parse(t));\n const e = Array.isArray(t) ? t : t.features;\n let r = e;\n e && e.length > 1e3 && (r = e.slice(0, 1e3)), this.bt(r, null, t, i, n);\n }\n }\n bt(t, n, i, e, r) {\n try {\n const s = t && t.length ? function(t) {\n let n = [ Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY ];\n switch (t.type) {\n case "FeatureCollection":\n for (let i = 0; i < t.features.length; i++) Yr(t.features[i], n);\n break;\n\n case "Feature":\n Yr(t, n);\n break;\n\n default:\n Kr(t, n);\n }\n return n;\n }({\n type: "FeatureCollection",\n features: t\n }) : null;\n this.index = function(t, n) {\n return new ht(t, n);\n }(i, this.options.geojsonvt || e), r(null, {\n extent: s,\n idMap: n\n });\n } catch (t) {\n console.warn(t), r({\n error: t.message\n });\n }\n }\n Mt(t) {\n const n = [], i = {};\n let e = 0;\n function r(t) {\n t && ("Feature" !== t.type || t.geometry) && (void 0 !== t.id && null !== t.id || (t.id = e++), \n i[t.id] = A({}, t), t.geometry ? (i[t.id].geometry = A({}, t.geometry), i[t.id].geometry.coordinates = null) : t.coordinates && (i[t.id].coordinates = null), \n n.length < 1e3 && n.push(t));\n }\n return Array.isArray(t) ? t.forEach(t => {\n r(t);\n }) : t.features && t.features.forEach(t => {\n r(t);\n }), {\n first1000: n,\n idMap: i\n };\n }\n getTileFeatures(t, n) {\n const i = [];\n if (!this.index) return setTimeout((function() {\n n({\n loading: !0\n });\n }), 1), 1;\n const e = this.index.getTile(t.z + this.zoomOffset, t.x, t.y);\n if (!e || 0 === e.features.length) return setTimeout((function() {\n n(null, i, []);\n }), 1), 1;\n const r = [];\n for (let t = 0, n = e.features.length; t < n; t++) {\n const n = e.features[t];\n let s = n.layer;\n void 0 === s && (s = "0"), r[s] = {\n types: {}\n };\n r[s].types[n.type] = 1, n.tags = n.tags || {}, i.push({\n type: n.type,\n layer: s,\n id: n.id,\n geometry: n.geometry,\n properties: n.tags,\n extent: this.options.extent\n });\n }\n for (const t in r) r[t].types = Object.keys(r[t].types).map(t => +t);\n return setTimeout((function() {\n n(null, i, r);\n }), 1), 1;\n }\n onRemove() {\n delete this.index;\n }\n }\n var es = {\n /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\n read: function(t, n, i, e, r) {\n var s, o, a = 8 * r - e - 1, h = (1 << a) - 1, u = h >> 1, l = -7, c = i ? r - 1 : 0, f = i ? -1 : 1, d = t[n + c];\n for (c += f, s = d & (1 << -l) - 1, d >>= -l, l += a; l > 0; s = 256 * s + t[n + c], \n c += f, l -= 8) ;\n for (o = s & (1 << -l) - 1, s >>= -l, l += e; l > 0; o = 256 * o + t[n + c], c += f, \n l -= 8) ;\n if (0 === s) s = 1 - u; else {\n if (s === h) return o ? NaN : 1 / 0 * (d ? -1 : 1);\n o += Math.pow(2, e), s -= u;\n }\n return (d ? -1 : 1) * o * Math.pow(2, s - e);\n },\n write: function(t, n, i, e, r, s) {\n var o, a, h, u = 8 * s - r - 1, l = (1 << u) - 1, c = l >> 1, f = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, d = e ? 0 : s - 1, y = e ? 1 : -1, v = n < 0 || 0 === n && 1 / n < 0 ? 1 : 0;\n for (n = Math.abs(n), isNaN(n) || n === 1 / 0 ? (a = isNaN(n) ? 1 : 0, o = l) : (o = Math.floor(Math.log(n) / Math.LN2), \n n * (h = Math.pow(2, -o)) < 1 && (o--, h *= 2), (n += o + c >= 1 ? f / h : f * Math.pow(2, 1 - c)) * h >= 2 && (o++, \n h /= 2), o + c >= l ? (a = 0, o = l) : o + c >= 1 ? (a = (n * h - 1) * Math.pow(2, r), \n o += c) : (a = n * Math.pow(2, c - 1) * Math.pow(2, r), o = 0)); r >= 8; t[i + d] = 255 & a, \n d += y, a /= 256, r -= 8) ;\n for (o = o << r | a, u += r; u > 0; t[i + d] = 255 & o, d += y, o /= 256, u -= 8) ;\n t[i + d - y] |= 128 * v;\n }\n }, rs = os, ss = es;\n function os(t) {\n this.buf = ArrayBuffer.isView && ArrayBuffer.isView(t) ? t : new Uint8Array(t || 0), \n this.pos = 0, this.type = 0, this.length = this.buf.length;\n }\n os.Varint = 0, os.Fixed64 = 1, os.Bytes = 2, os.Fixed32 = 5;\n var as = "undefined" == typeof TextDecoder ? null : new TextDecoder("utf8");\n function hs(t) {\n return t.type === os.Bytes ? t.readVarint() + t.pos : t.pos + 1;\n }\n function us(t, n, i) {\n return i ? 4294967296 * n + (t >>> 0) : 4294967296 * (n >>> 0) + (t >>> 0);\n }\n function ls(t, n, i) {\n var e = n <= 16383 ? 1 : n <= 2097151 ? 2 : n <= 268435455 ? 3 : Math.floor(Math.log(n) / (7 * Math.LN2));\n i.realloc(e);\n for (var r = i.pos - 1; r >= t; r--) i.buf[r + e] = i.buf[r];\n }\n function cs(t, n) {\n for (var i = 0; i < t.length; i++) n.writeVarint(t[i]);\n }\n function fs(t, n) {\n for (var i = 0; i < t.length; i++) n.writeSVarint(t[i]);\n }\n function ds(t, n) {\n for (var i = 0; i < t.length; i++) n.writeFloat(t[i]);\n }\n function ys(t, n) {\n for (var i = 0; i < t.length; i++) n.writeDouble(t[i]);\n }\n function vs(t, n) {\n for (var i = 0; i < t.length; i++) n.writeBoolean(t[i]);\n }\n function ps(t, n) {\n for (var i = 0; i < t.length; i++) n.writeFixed32(t[i]);\n }\n function ms(t, n) {\n for (var i = 0; i < t.length; i++) n.writeSFixed32(t[i]);\n }\n function gs(t, n) {\n for (var i = 0; i < t.length; i++) n.writeFixed64(t[i]);\n }\n function ws(t, n) {\n for (var i = 0; i < t.length; i++) n.writeSFixed64(t[i]);\n }\n function Ms(t, n) {\n return (t[n] | t[n + 1] << 8 | t[n + 2] << 16) + 16777216 * t[n + 3];\n }\n function bs(t, n, i) {\n t[i] = n, t[i + 1] = n >>> 8, t[i + 2] = n >>> 16, t[i + 3] = n >>> 24;\n }\n function xs(t, n) {\n return (t[n] | t[n + 1] << 8 | t[n + 2] << 16) + (t[n + 3] << 24);\n }\n os.prototype = {\n destroy: function() {\n this.buf = null;\n },\n readFields: function(t, n, i) {\n for (i = i || this.length; this.pos < i; ) {\n var e = this.readVarint(), r = e >> 3, s = this.pos;\n this.type = 7 & e, t(r, n, this), this.pos === s && this.skip(e);\n }\n return n;\n },\n readMessage: function(t, n) {\n return this.readFields(t, n, this.readVarint() + this.pos);\n },\n readFixed32: function() {\n var t = Ms(this.buf, this.pos);\n return this.pos += 4, t;\n },\n readSFixed32: function() {\n var t = xs(this.buf, this.pos);\n return this.pos += 4, t;\n },\n readFixed64: function() {\n var t = Ms(this.buf, this.pos) + 4294967296 * Ms(this.buf, this.pos + 4);\n return this.pos += 8, t;\n },\n readSFixed64: function() {\n var t = Ms(this.buf, this.pos) + 4294967296 * xs(this.buf, this.pos + 4);\n return this.pos += 8, t;\n },\n readFloat: function() {\n var t = ss.read(this.buf, this.pos, !0, 23, 4);\n return this.pos += 4, t;\n },\n readDouble: function() {\n var t = ss.read(this.buf, this.pos, !0, 52, 8);\n return this.pos += 8, t;\n },\n readVarint: function(t) {\n var n, i, e = this.buf;\n return n = 127 & (i = e[this.pos++]), i < 128 ? n : (n |= (127 & (i = e[this.pos++])) << 7, \n i < 128 ? n : (n |= (127 & (i = e[this.pos++])) << 14, i < 128 ? n : (n |= (127 & (i = e[this.pos++])) << 21, \n i < 128 ? n : function(t, n, i) {\n var e, r, s = i.buf;\n if (r = s[i.pos++], e = (112 & r) >> 4, r < 128) return us(t, e, n);\n if (r = s[i.pos++], e |= (127 & r) << 3, r < 128) return us(t, e, n);\n if (r = s[i.pos++], e |= (127 & r) << 10, r < 128) return us(t, e, n);\n if (r = s[i.pos++], e |= (127 & r) << 17, r < 128) return us(t, e, n);\n if (r = s[i.pos++], e |= (127 & r) << 24, r < 128) return us(t, e, n);\n if (r = s[i.pos++], e |= (1 & r) << 31, r < 128) return us(t, e, n);\n throw new Error("Expected varint not more than 10 bytes");\n }(n |= (15 & (i = e[this.pos])) << 28, t, this))));\n },\n readVarint64: function() {\n return this.readVarint(!0);\n },\n readSVarint: function() {\n var t = this.readVarint();\n return t % 2 == 1 ? (t + 1) / -2 : t / 2;\n },\n readBoolean: function() {\n return Boolean(this.readVarint());\n },\n readString: function() {\n var t = this.readVarint() + this.pos, n = this.pos;\n return this.pos = t, t - n >= 12 && as ? function(t, n, i) {\n return as.decode(t.subarray(n, i));\n }(this.buf, n, t) : function(t, n, i) {\n var e = "", r = n;\n for (;r < i; ) {\n var s, o, a, h = t[r], u = null, l = h > 239 ? 4 : h > 223 ? 3 : h > 191 ? 2 : 1;\n if (r + l > i) break;\n 1 === l ? h < 128 && (u = h) : 2 === l ? 128 == (192 & (s = t[r + 1])) && (u = (31 & h) << 6 | 63 & s) <= 127 && (u = null) : 3 === l ? (s = t[r + 1], \n o = t[r + 2], 128 == (192 & s) && 128 == (192 & o) && ((u = (15 & h) << 12 | (63 & s) << 6 | 63 & o) <= 2047 || u >= 55296 && u <= 57343) && (u = null)) : 4 === l && (s = t[r + 1], \n o = t[r + 2], a = t[r + 3], 128 == (192 & s) && 128 == (192 & o) && 128 == (192 & a) && ((u = (15 & h) << 18 | (63 & s) << 12 | (63 & o) << 6 | 63 & a) <= 65535 || u >= 1114112) && (u = null)), \n null === u ? (u = 65533, l = 1) : u > 65535 && (u -= 65536, e += String.fromCharCode(u >>> 10 & 1023 | 55296), \n u = 56320 | 1023 & u), e += String.fromCharCode(u), r += l;\n }\n return e;\n }(this.buf, n, t);\n },\n readBytes: function() {\n var t = this.readVarint() + this.pos, n = this.buf.subarray(this.pos, t);\n return this.pos = t, n;\n },\n readPackedVarint: function(t, n) {\n if (this.type !== os.Bytes) return t.push(this.readVarint(n));\n var i = hs(this);\n for (t = t || []; this.pos < i; ) t.push(this.readVarint(n));\n return t;\n },\n readPackedSVarint: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readSVarint());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readSVarint());\n return t;\n },\n readPackedBoolean: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readBoolean());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readBoolean());\n return t;\n },\n readPackedFloat: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readFloat());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readFloat());\n return t;\n },\n readPackedDouble: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readDouble());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readDouble());\n return t;\n },\n readPackedFixed32: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readFixed32());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readFixed32());\n return t;\n },\n readPackedSFixed32: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readSFixed32());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readSFixed32());\n return t;\n },\n readPackedFixed64: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readFixed64());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readFixed64());\n return t;\n },\n readPackedSFixed64: function(t) {\n if (this.type !== os.Bytes) return t.push(this.readSFixed64());\n var n = hs(this);\n for (t = t || []; this.pos < n; ) t.push(this.readSFixed64());\n return t;\n },\n skip: function(t) {\n var n = 7 & t;\n if (n === os.Varint) for (;this.buf[this.pos++] > 127; ) ; else if (n === os.Bytes) this.pos = this.readVarint() + this.pos; else if (n === os.Fixed32) this.pos += 4; else {\n if (n !== os.Fixed64) throw new Error("Unimplemented type: " + n);\n this.pos += 8;\n }\n },\n writeTag: function(t, n) {\n this.writeVarint(t << 3 | n);\n },\n realloc: function(t) {\n for (var n = this.length || 16; n < this.pos + t; ) n *= 2;\n if (n !== this.length) {\n var i = new Uint8Array(n);\n i.set(this.buf), this.buf = i, this.length = n;\n }\n },\n finish: function() {\n return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length);\n },\n writeFixed32: function(t) {\n this.realloc(4), bs(this.buf, t, this.pos), this.pos += 4;\n },\n writeSFixed32: function(t) {\n this.realloc(4), bs(this.buf, t, this.pos), this.pos += 4;\n },\n writeFixed64: function(t) {\n this.realloc(8), bs(this.buf, -1 & t, this.pos), bs(this.buf, Math.floor(t * (1 / 4294967296)), this.pos + 4), \n this.pos += 8;\n },\n writeSFixed64: function(t) {\n this.realloc(8), bs(this.buf, -1 & t, this.pos), bs(this.buf, Math.floor(t * (1 / 4294967296)), this.pos + 4), \n this.pos += 8;\n },\n writeVarint: function(t) {\n (t = +t || 0) > 268435455 || t < 0 ? function(t, n) {\n var i, e;\n t >= 0 ? (i = t % 4294967296 | 0, e = t / 4294967296 | 0) : (e = ~(-t / 4294967296), \n 4294967295 ^ (i = ~(-t % 4294967296)) ? i = i + 1 | 0 : (i = 0, e = e + 1 | 0));\n if (t >= 0x10000000000000000 || t < -0x10000000000000000) throw new Error("Given varint doesn\'t fit into 10 bytes");\n n.realloc(10), function(t, n, i) {\n i.buf[i.pos++] = 127 & t | 128, t >>>= 7, i.buf[i.pos++] = 127 & t | 128, t >>>= 7, \n i.buf[i.pos++] = 127 & t | 128, t >>>= 7, i.buf[i.pos++] = 127 & t | 128, t >>>= 7, \n i.buf[i.pos] = 127 & t;\n }(i, 0, n), function(t, n) {\n var i = (7 & t) << 4;\n if (n.buf[n.pos++] |= i | ((t >>>= 3) ? 128 : 0), !t) return;\n if (n.buf[n.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;\n if (n.buf[n.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;\n if (n.buf[n.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;\n if (n.buf[n.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;\n n.buf[n.pos++] = 127 & t;\n }(e, n);\n }(t, this) : (this.realloc(4), this.buf[this.pos++] = 127 & t | (t > 127 ? 128 : 0), \n t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), \n t <= 127 || (this.buf[this.pos++] = t >>> 7 & 127))));\n },\n writeSVarint: function(t) {\n this.writeVarint(t < 0 ? 2 * -t - 1 : 2 * t);\n },\n writeBoolean: function(t) {\n this.writeVarint(Boolean(t));\n },\n writeString: function(t) {\n t = String(t), this.realloc(4 * t.length), this.pos++;\n var n = this.pos;\n this.pos = function(t, n, i) {\n for (var e, r, s = 0; s < n.length; s++) {\n if ((e = n.charCodeAt(s)) > 55295 && e < 57344) {\n if (!r) {\n e > 56319 || s + 1 === n.length ? (t[i++] = 239, t[i++] = 191, t[i++] = 189) : r = e;\n continue;\n }\n if (e < 56320) {\n t[i++] = 239, t[i++] = 191, t[i++] = 189, r = e;\n continue;\n }\n e = r - 55296 << 10 | e - 56320 | 65536, r = null;\n } else r && (t[i++] = 239, t[i++] = 191, t[i++] = 189, r = null);\n e < 128 ? t[i++] = e : (e < 2048 ? t[i++] = e >> 6 | 192 : (e < 65536 ? t[i++] = e >> 12 | 224 : (t[i++] = e >> 18 | 240, \n t[i++] = e >> 12 & 63 | 128), t[i++] = e >> 6 & 63 | 128), t[i++] = 63 & e | 128);\n }\n return i;\n }(this.buf, t, this.pos);\n var i = this.pos - n;\n i >= 128 && ls(n, i, this), this.pos = n - 1, this.writeVarint(i), this.pos += i;\n },\n writeFloat: function(t) {\n this.realloc(4), ss.write(this.buf, t, this.pos, !0, 23, 4), this.pos += 4;\n },\n writeDouble: function(t) {\n this.realloc(8), ss.write(this.buf, t, this.pos, !0, 52, 8), this.pos += 8;\n },\n writeBytes: function(t) {\n var n = t.length;\n this.writeVarint(n), this.realloc(n);\n for (var i = 0; i < n; i++) this.buf[this.pos++] = t[i];\n },\n writeRawMessage: function(t, n) {\n this.pos++;\n var i = this.pos;\n t(n, this);\n var e = this.pos - i;\n e >= 128 && ls(i, e, this), this.pos = i - 1, this.writeVarint(e), this.pos += e;\n },\n writeMessage: function(t, n, i) {\n this.writeTag(t, os.Bytes), this.writeRawMessage(n, i);\n },\n writePackedVarint: function(t, n) {\n n.length && this.writeMessage(t, cs, n);\n },\n writePackedSVarint: function(t, n) {\n n.length && this.writeMessage(t, fs, n);\n },\n writePackedBoolean: function(t, n) {\n n.length && this.writeMessage(t, vs, n);\n },\n writePackedFloat: function(t, n) {\n n.length && this.writeMessage(t, ds, n);\n },\n writePackedDouble: function(t, n) {\n n.length && this.writeMessage(t, ys, n);\n },\n writePackedFixed32: function(t, n) {\n n.length && this.writeMessage(t, ps, n);\n },\n writePackedSFixed32: function(t, n) {\n n.length && this.writeMessage(t, ms, n);\n },\n writePackedFixed64: function(t, n) {\n n.length && this.writeMessage(t, gs, n);\n },\n writePackedSFixed64: function(t, n) {\n n.length && this.writeMessage(t, ws, n);\n },\n writeBytesField: function(t, n) {\n this.writeTag(t, os.Bytes), this.writeBytes(n);\n },\n writeFixed32Field: function(t, n) {\n this.writeTag(t, os.Fixed32), this.writeFixed32(n);\n },\n writeSFixed32Field: function(t, n) {\n this.writeTag(t, os.Fixed32), this.writeSFixed32(n);\n },\n writeFixed64Field: function(t, n) {\n this.writeTag(t, os.Fixed64), this.writeFixed64(n);\n },\n writeSFixed64Field: function(t, n) {\n this.writeTag(t, os.Fixed64), this.writeSFixed64(n);\n },\n writeVarintField: function(t, n) {\n this.writeTag(t, os.Varint), this.writeVarint(n);\n },\n writeSVarintField: function(t, n) {\n this.writeTag(t, os.Varint), this.writeSVarint(n);\n },\n writeStringField: function(t, n) {\n this.writeTag(t, os.Bytes), this.writeString(n);\n },\n writeFloatField: function(t, n) {\n this.writeTag(t, os.Fixed32), this.writeFloat(n);\n },\n writeDoubleField: function(t, n) {\n this.writeTag(t, os.Fixed64), this.writeDouble(n);\n },\n writeBooleanField: function(t, n) {\n this.writeVarintField(t, Boolean(n));\n }\n };\n var Fs = Ht, As = ks;\n function ks(t, n, i, e, r) {\n this.properties = {}, this.extent = i, this.type = 0, this.xt = t, this.Ft = -1, \n this.At = e, this.kt = r, t.readFields(Ps, this, n);\n }\n function Ps(t, n, i) {\n 1 == t ? n.id = i.readVarint() : 2 == t ? function(t, n) {\n var i = t.readVarint() + t.pos;\n for (;t.pos < i; ) {\n var e = n.At[t.readVarint()], r = n.kt[t.readVarint()];\n n.properties[e] = r;\n }\n }(i, n) : 3 == t ? n.type = i.readVarint() : 4 == t && (n.Ft = i.pos);\n }\n function Ss(t) {\n for (var n, i, e = 0, r = 0, s = t.length, o = s - 1; r < s; o = r++) n = t[r], \n e += ((i = t[o]).x - n.x) * (n.y + i.y);\n return e;\n }\n ks.types = [ "Unknown", "Point", "LineString", "Polygon" ], ks.prototype.loadGeometry = function() {\n var t = this.xt;\n t.pos = this.Ft;\n for (var n, i = t.readVarint() + t.pos, e = 1, r = 0, s = 0, o = 0, a = []; t.pos < i; ) {\n if (r <= 0) {\n var h = t.readVarint();\n e = 7 & h, r = h >> 3;\n }\n if (r--, 1 === e || 2 === e) s += t.readSVarint(), o += t.readSVarint(), 1 === e && (n && a.push(n), \n n = []), n.push(new Fs(s, o)); else {\n if (7 !== e) throw new Error("unknown command " + e);\n n && n.push(n[0].clone());\n }\n }\n return n && a.push(n), a;\n }, ks.prototype.bbox = function() {\n var t = this.xt;\n t.pos = this.Ft;\n for (var n = t.readVarint() + t.pos, i = 1, e = 0, r = 0, s = 0, o = 1 / 0, a = -1 / 0, h = 1 / 0, u = -1 / 0; t.pos < n; ) {\n if (e <= 0) {\n var l = t.readVarint();\n i = 7 & l, e = l >> 3;\n }\n if (e--, 1 === i || 2 === i) (r += t.readSVarint()) < o && (o = r), r > a && (a = r), \n (s += t.readSVarint()) < h && (h = s), s > u && (u = s); else if (7 !== i) throw new Error("unknown command " + i);\n }\n return [ o, h, a, u ];\n }, ks.prototype.toGeoJSON = function(t, n, i) {\n var e, r, s = this.extent * Math.pow(2, i), o = this.extent * t, a = this.extent * n, h = this.loadGeometry(), u = ks.types[this.type];\n function l(t) {\n for (var n = 0; n < t.length; n++) {\n var i = t[n], e = 180 - 360 * (i.y + a) / s;\n t[n] = [ 360 * (i.x + o) / s - 180, 360 / Math.PI * Math.atan(Math.exp(e * Math.PI / 180)) - 90 ];\n }\n }\n switch (this.type) {\n case 1:\n var c = [];\n for (e = 0; e < h.length; e++) c[e] = h[e][0];\n l(h = c);\n break;\n\n case 2:\n for (e = 0; e < h.length; e++) l(h[e]);\n break;\n\n case 3:\n for (h = function(t) {\n var n = t.length;\n if (n <= 1) return [ t ];\n for (var i, e, r = [], s = 0; s < n; s++) {\n var o = Ss(t[s]);\n 0 !== o && (void 0 === e && (e = o < 0), e === o < 0 ? (i && r.push(i), i = [ t[s] ]) : i.push(t[s]));\n }\n i && r.push(i);\n return r;\n }(h), e = 0; e < h.length; e++) for (r = 0; r < h[e].length; r++) l(h[e][r]);\n }\n 1 === h.length ? h = h[0] : u = "Multi" + u;\n var f = {\n type: "Feature",\n geometry: {\n type: u,\n coordinates: h\n },\n properties: this.properties\n };\n return "id" in this && (f.id = this.id), f;\n };\n var _s = As, Os = Is;\n function Is(t, n) {\n this.version = 1, this.name = null, this.extent = 4096, this.length = 0, this.xt = t, \n this.At = [], this.kt = [], this.Pt = [], t.readFields(Ts, this, n), this.length = this.Pt.length;\n }\n function Ts(t, n, i) {\n 15 === t ? n.version = i.readVarint() : 1 === t ? n.name = i.readString() : 5 === t ? n.extent = i.readVarint() : 2 === t ? n.Pt.push(i.pos) : 3 === t ? n.At.push(i.readString()) : 4 === t && n.kt.push(function(t) {\n var n = null, i = t.readVarint() + t.pos;\n for (;t.pos < i; ) {\n var e = t.readVarint() >> 3;\n n = 1 === e ? t.readString() : 2 === e ? t.readFloat() : 3 === e ? t.readDouble() : 4 === e ? t.readVarint64() : 5 === e ? t.readVarint() : 6 === e ? t.readSVarint() : 7 === e ? t.readBoolean() : null;\n }\n return n;\n }(i));\n }\n Is.prototype.feature = function(t) {\n if (t < 0 || t >= this.Pt.length) throw new Error("feature index out of bounds");\n this.xt.pos = this.Pt[t];\n var n = this.xt.readVarint() + this.xt.pos;\n return new _s(this.xt, n, this.extent, this.At, this.kt);\n };\n var Ls = Os;\n function Us(t, n, i) {\n if (3 === t) {\n var e = new Ls(i, i.readVarint() + i.pos);\n e.length && (n[e.name] = e);\n }\n }\n var zs = function(t, n) {\n this.layers = t.readFields(Us, {}, n);\n };\n class Ds extends Wr {\n constructor(t, n, i, e, r, s) {\n super(t, n, i, e, r), n = n || {}, s();\n }\n getTileFeatures(t, n) {\n const i = t.url;\n return C.getArrayBuffer(i, (t, i) => {\n if (t) return void n(t);\n const e = new zs(new rs(i.data)), r = [];\n if (!e.layers) return void n(null, r, []);\n const s = {};\n let o;\n for (const n in e.layers) if (a = e.layers, h = n, Object.prototype.hasOwnProperty.call(a, h)) {\n s[n] = {\n types: {}\n };\n const i = s[n].types;\n for (let s = 0, a = e.layers[n].length; s < a; s++) try {\n o = e.layers[n].feature(s), i[o.type] = 1, r.push({\n type: o.type,\n layer: n,\n geometry: o.loadGeometry(),\n properties: o.properties,\n extent: o.extent\n });\n } catch (t) {\n console.warn("error when load vt geometry:", t);\n }\n }\n var a, h;\n for (const t in s) s[t].types = Object.keys(s[t].types).map(t => +t);\n n(null, r, s, {\n byteLength: i.data.byteLength\n });\n });\n }\n abortTile(t, n) {\n const i = this.requests[t];\n delete this.requests[t], i && i.abort && i.abort(), this.yt(t), n();\n }\n onRemove() {\n for (const t in this.requests) this.requests[t].abort();\n this.requests = {};\n }\n }\n let Es = 0;\n const Cs = new class {\n constructor(t) {\n this.max = t, this.reset();\n }\n reset() {\n return this.data = {}, this.order = [], this;\n }\n clear() {\n this.reset();\n }\n add(t, n) {\n return this.has(t) ? (this.order.splice(this.order.indexOf(t), 1), this.data[t] = n, \n this.order.push(t)) : (this.data[t] = n, this.order.push(t), this.order.length > this.max && this.getAndRemove(this.order[0])), \n this;\n }\n has(t) {\n return t in this.data;\n }\n keys() {\n return this.order;\n }\n getAndRemove(t) {\n if (!this.has(t)) return null;\n const n = this.data[t];\n return delete this.data[t], this.order.splice(this.order.indexOf(t), 1), n;\n }\n get(t) {\n return this.has(t) ? this.data[t] : null;\n }\n remove(t) {\n return this.has(t) ? (delete this.data[t], this.order.splice(this.order.indexOf(t), 1), \n this) : this;\n }\n setMaxSize(t) {\n for (this.max = t; this.order.length > this.max; ) this.getAndRemove(this.order[0]);\n return this;\n }\n }(128), js = {};\n class Ns {\n constructor(t) {\n this.St = {}, this._t = {}, this.workerId = t;\n }\n addLayer({actorId: t, mapId: n, layerId: i, params: e}, r) {\n if (this.Ot(n, i)) return;\n const s = this.It(n, i), o = e.type, a = e.options, h = this.send.bind(this, t);\n this.St[s] = "GeoJSONVectorTileLayer" === o ? new is(i, a, h, Cs, js, r) : new Ds(i, a, h, Cs, js, r);\n }\n removeLayer({mapId: t, layerId: n}, i) {\n const e = this.Ot(t, n), r = this.It(t, n);\n delete this.St[r], e && (e.onRemove(i), this.Tt());\n }\n loadTile({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && r.loadTile(i, e);\n }\n abortTile({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && r.abortTile && r.abortTile(i.url, e);\n }\n removeTile({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && r.removeTile(i, e);\n }\n updateStyle({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && (r.updateStyle(i, e), this.Tt());\n }\n updateOptions({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && (r.updateOptions(i, e), this.Tt());\n }\n setData({mapId: t, layerId: n, params: i}, e) {\n const r = this.Ot(t, n);\n r && (r.setData(i.data, e), this.Tt());\n }\n receive(t) {\n const n = t.callback, i = this._t[n];\n delete this._t[n], i && t.error ? i(new Error(t.error)) : i && i(null, t.data);\n }\n send(t, n, i, e, r) {\n const s = r ? `${t}-${Es++}` : null;\n r && (this._t[s] = r), postMessage({\n type: "<request>",\n workerId: this.workerId,\n actorId: t,\n command: n,\n params: i,\n callback: String(s)\n }, e || []);\n }\n It(t, n) {\n return `${t}-${n}`;\n }\n Ot(t, n) {\n const i = this.It(t, n);\n return this.St[i];\n }\n Tt() {\n const t = Object.keys(js);\n for (let n = 0; n < t.length; n++) delete js[t[n]];\n Cs.reset();\n }\n }\n t.initialize = function() {}, t.onmessage = function(t, n) {\n const i = t.data;\n if (this.dispatcher || (this.dispatcher = new Ns(t.workerId)), "<response>" === t.type) this.dispatcher.workerId === t.workerId && this.dispatcher.receive(t); else {\n const e = i.command;\n this.dispatcher[e]({\n actorId: t.actorId,\n mapId: i.mapId,\n layerId: i.layerId,\n params: i.params\n }, (t, i, r) => {\n t && console.error(e, t), n(t, i, r);\n });\n }\n }, Object.defineProperty(t, "Lt", {\n value: !0\n });\n}';
|
|
26
26
|
/*!
|
|
27
27
|
Feature Filter by
|
|
28
28
|
|
|
@@ -191,10 +191,10 @@
|
|
|
191
191
|
return s.isZoomConstant = e && s.isZoomConstant, s.isFeatureConstant = i && s.isFeatureConstant,
|
|
192
192
|
s;
|
|
193
193
|
}
|
|
194
|
-
let
|
|
195
|
-
const
|
|
196
|
-
function
|
|
197
|
-
if (
|
|
194
|
+
let T = 0;
|
|
195
|
+
const O = "function" == typeof Object.assign;
|
|
196
|
+
function F(t, ...n) {
|
|
197
|
+
if (O) return Object.assign(t, ...n), t;
|
|
198
198
|
for (let e = 0; e < n.length; e++) {
|
|
199
199
|
const i = n[e];
|
|
200
200
|
for (const n in i) t[n] = i[n];
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
}
|
|
240
240
|
return e;
|
|
241
241
|
}(t = t.map(t => {
|
|
242
|
-
const n =
|
|
242
|
+
const n = F({}, t);
|
|
243
243
|
return n.filter && n.filter.value && (n.filter = n.filter.value), n;
|
|
244
244
|
}));
|
|
245
245
|
}
|
|
@@ -297,10 +297,10 @@
|
|
|
297
297
|
return this.clone().P();
|
|
298
298
|
},
|
|
299
299
|
perp: function() {
|
|
300
|
-
return this.clone().
|
|
300
|
+
return this.clone().T();
|
|
301
301
|
},
|
|
302
302
|
round: function() {
|
|
303
|
-
return this.clone().
|
|
303
|
+
return this.clone().O();
|
|
304
304
|
},
|
|
305
305
|
mag: function() {
|
|
306
306
|
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
P: function() {
|
|
353
353
|
return this._(this.mag()), this;
|
|
354
354
|
},
|
|
355
|
-
|
|
355
|
+
T: function() {
|
|
356
356
|
var t = this.y;
|
|
357
357
|
return this.y = this.x, this.x = -t, this;
|
|
358
358
|
},
|
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
var e = Math.cos(t), i = Math.sin(t), r = n.x + e * (this.x - n.x) - i * (this.y - n.y), s = n.y + i * (this.x - n.x) + e * (this.y - n.y);
|
|
365
365
|
return this.x = r, this.y = s, this;
|
|
366
366
|
},
|
|
367
|
-
|
|
367
|
+
O: function() {
|
|
368
368
|
return this.x = Math.round(this.x), this.y = Math.round(this.y), this;
|
|
369
369
|
}
|
|
370
370
|
}, V.convert = function(t) {
|
|
@@ -476,7 +476,7 @@
|
|
|
476
476
|
function q(t, n) {
|
|
477
477
|
if (!(this instanceof q)) return new q(t, n);
|
|
478
478
|
if (this.data = t || [], this.length = this.data.length, this.compare = n || J,
|
|
479
|
-
this.length > 0) for (var e = (this.length >> 1) - 1; e >= 0; e--) this.
|
|
479
|
+
this.length > 0) for (var e = (this.length >> 1) - 1; e >= 0; e--) this.F(e);
|
|
480
480
|
}
|
|
481
481
|
function J(t, n) {
|
|
482
482
|
return t < n ? -1 : t > n ? 1 : 0;
|
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
if (0 !== this.length) {
|
|
490
490
|
var t = this.data[0];
|
|
491
491
|
return this.length--, this.length > 0 && (this.data[0] = this.data[this.length],
|
|
492
|
-
this.
|
|
492
|
+
this.F(0)), this.data.pop(), t;
|
|
493
493
|
}
|
|
494
494
|
},
|
|
495
495
|
peek: function() {
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
}
|
|
504
504
|
n[t] = i;
|
|
505
505
|
},
|
|
506
|
-
|
|
506
|
+
F: function(t) {
|
|
507
507
|
for (var n = this.data, e = this.compare, i = this.length >> 1, r = n[t]; t < i; ) {
|
|
508
508
|
var s = 1 + (t << 1), o = s + 1, a = n[s];
|
|
509
509
|
if (o < this.length && e(n[o], a) < 0 && (s = o, a = n[o]), e(a, r) >= 0) break;
|
|
@@ -1137,24 +1137,24 @@
|
|
|
1137
1137
|
}(i);
|
|
1138
1138
|
}));
|
|
1139
1139
|
}));
|
|
1140
|
-
var Pt = kt,
|
|
1141
|
-
Object.keys(
|
|
1142
|
-
Ct[
|
|
1140
|
+
var Pt = kt, Tt = $.exports, Ot = Pt, Ft = [].slice, It = [ "keyword", "gray", "hex" ], Ct = {};
|
|
1141
|
+
Object.keys(Ot).forEach((function(t) {
|
|
1142
|
+
Ct[Ft.call(Ot[t].labels).sort().join("")] = t;
|
|
1143
1143
|
}));
|
|
1144
1144
|
var Et = {};
|
|
1145
1145
|
function Ht(t, n) {
|
|
1146
1146
|
if (!(this instanceof Ht)) return new Ht(t, n);
|
|
1147
|
-
if (n && n in It && (n = null), n && !(n in
|
|
1147
|
+
if (n && n in It && (n = null), n && !(n in Ot)) throw new Error("Unknown model: " + n);
|
|
1148
1148
|
var e, i;
|
|
1149
1149
|
if (null == t) this.model = "rgb", this.color = [ 0, 0, 0 ], this.valpha = 1; else if (t instanceof Ht) this.model = t.model,
|
|
1150
1150
|
this.color = t.color.slice(), this.valpha = t.valpha; else if ("string" == typeof t) {
|
|
1151
|
-
var r =
|
|
1151
|
+
var r = Tt.get(t);
|
|
1152
1152
|
if (null === r) throw new Error("Unable to parse color from string: " + t);
|
|
1153
|
-
this.model = r.model, i =
|
|
1153
|
+
this.model = r.model, i = Ot[this.model].channels, this.color = r.value.slice(0, i),
|
|
1154
1154
|
this.valpha = "number" == typeof r.value[i] ? r.value[i] : 1;
|
|
1155
1155
|
} else if (t.length) {
|
|
1156
|
-
this.model = n || "rgb", i =
|
|
1157
|
-
var s =
|
|
1156
|
+
this.model = n || "rgb", i = Ot[this.model].channels;
|
|
1157
|
+
var s = Ft.call(t, 0, i);
|
|
1158
1158
|
this.color = Nt(s, i), this.valpha = "number" == typeof t[i] ? t[i] : 1;
|
|
1159
1159
|
} else if ("number" == typeof t) t &= 16777215, this.model = "rgb", this.color = [ t >> 16 & 255, t >> 8 & 255, 255 & t ],
|
|
1160
1160
|
this.valpha = 1; else {
|
|
@@ -1164,11 +1164,11 @@
|
|
|
1164
1164
|
var a = o.sort().join("");
|
|
1165
1165
|
if (!(a in Ct)) throw new Error("Unable to parse color from object: " + JSON.stringify(t));
|
|
1166
1166
|
this.model = Ct[a];
|
|
1167
|
-
var l =
|
|
1167
|
+
var l = Ot[this.model].labels, h = [];
|
|
1168
1168
|
for (e = 0; e < l.length; e++) h.push(t[l[e]]);
|
|
1169
1169
|
this.color = Nt(h);
|
|
1170
1170
|
}
|
|
1171
|
-
if (Et[this.model]) for (i =
|
|
1171
|
+
if (Et[this.model]) for (i = Ot[this.model].channels, e = 0; e < i; e++) {
|
|
1172
1172
|
var c = Et[this.model][e];
|
|
1173
1173
|
c && (this.color[e] = c(this.color[e]));
|
|
1174
1174
|
}
|
|
@@ -1203,18 +1203,18 @@
|
|
|
1203
1203
|
return this[this.model]();
|
|
1204
1204
|
},
|
|
1205
1205
|
string: function(t) {
|
|
1206
|
-
var n = this.model in
|
|
1207
|
-
return
|
|
1206
|
+
var n = this.model in Tt.to ? this : this.rgb(), e = 1 === (n = n.round("number" == typeof t ? t : 1)).valpha ? n.color : n.color.concat(this.valpha);
|
|
1207
|
+
return Tt.to[n.model](e);
|
|
1208
1208
|
},
|
|
1209
1209
|
percentString: function(t) {
|
|
1210
1210
|
var n = this.rgb().round("number" == typeof t ? t : 1), e = 1 === n.valpha ? n.color : n.color.concat(this.valpha);
|
|
1211
|
-
return
|
|
1211
|
+
return Tt.to.rgb.percent(e);
|
|
1212
1212
|
},
|
|
1213
1213
|
array: function() {
|
|
1214
1214
|
return 1 === this.valpha ? this.color.slice() : this.color.concat(this.valpha);
|
|
1215
1215
|
},
|
|
1216
1216
|
object: function() {
|
|
1217
|
-
for (var t = {}, n =
|
|
1217
|
+
for (var t = {}, n = Ot[this.model].channels, e = Ot[this.model].labels, i = 0; i < n; i++) t[e[i]] = this.color[i];
|
|
1218
1218
|
return 1 !== this.valpha && (t.alpha = this.valpha), t;
|
|
1219
1219
|
},
|
|
1220
1220
|
unitArray: function() {
|
|
@@ -1264,10 +1264,10 @@
|
|
|
1264
1264
|
a: Dt("lab", 1),
|
|
1265
1265
|
b: Dt("lab", 2),
|
|
1266
1266
|
keyword: function(t) {
|
|
1267
|
-
return arguments.length ? new Ht(t) :
|
|
1267
|
+
return arguments.length ? new Ht(t) : Ot[this.model].keyword(this.color);
|
|
1268
1268
|
},
|
|
1269
1269
|
hex: function(t) {
|
|
1270
|
-
return arguments.length ? new Ht(t) :
|
|
1270
|
+
return arguments.length ? new Ht(t) : Tt.to.hex(this.rgb().round().color);
|
|
1271
1271
|
},
|
|
1272
1272
|
rgbNumber: function() {
|
|
1273
1273
|
var t = this.rgb().color;
|
|
@@ -1342,16 +1342,16 @@
|
|
|
1342
1342
|
var e = t.rgb(), i = this.rgb(), r = void 0 === n ? .5 : n, s = 2 * r - 1, o = e.alpha() - i.alpha(), a = ((s * o == -1 ? s : (s + o) / (1 + s * o)) + 1) / 2, l = 1 - a;
|
|
1343
1343
|
return Ht.rgb(a * e.red() + l * i.red(), a * e.green() + l * i.green(), a * e.blue() + l * i.blue(), e.alpha() * r + i.alpha() * (1 - r));
|
|
1344
1344
|
}
|
|
1345
|
-
}, Object.keys(
|
|
1345
|
+
}, Object.keys(Ot).forEach((function(t) {
|
|
1346
1346
|
if (-1 === It.indexOf(t)) {
|
|
1347
|
-
var n =
|
|
1347
|
+
var n = Ot[t].channels;
|
|
1348
1348
|
Ht.prototype[t] = function() {
|
|
1349
1349
|
if (this.model === t) return new Ht(this);
|
|
1350
1350
|
if (arguments.length) return new Ht(arguments, t);
|
|
1351
1351
|
var e = "number" == typeof arguments[n] ? n : this.valpha;
|
|
1352
|
-
return new Ht(Lt(
|
|
1352
|
+
return new Ht(Lt(Ot[this.model][t].raw(this.color)).concat(e), t);
|
|
1353
1353
|
}, Ht[t] = function(e) {
|
|
1354
|
-
return "number" == typeof e && (e = Nt(
|
|
1354
|
+
return "number" == typeof e && (e = Nt(Ft.call(arguments), n)), new Ht(e, t);
|
|
1355
1355
|
};
|
|
1356
1356
|
}
|
|
1357
1357
|
}));
|
|
@@ -1605,7 +1605,7 @@
|
|
|
1605
1605
|
};
|
|
1606
1606
|
var pn = Vt.exports;
|
|
1607
1607
|
/*!
|
|
1608
|
-
* @maptalks/vector-packer v0.63.
|
|
1608
|
+
* @maptalks/vector-packer v0.63.4
|
|
1609
1609
|
* LICENSE : UNLICENSED
|
|
1610
1610
|
* (c) 2016-2022 maptalks.com
|
|
1611
1611
|
*/ const yn = {
|
|
@@ -1764,7 +1764,7 @@
|
|
|
1764
1764
|
return [ (this.paddedRect.w - 2) / this.pixelRatio, (this.paddedRect.h - 2) / this.pixelRatio ];
|
|
1765
1765
|
}
|
|
1766
1766
|
}
|
|
1767
|
-
class
|
|
1767
|
+
class Tn {
|
|
1768
1768
|
constructor(t) {
|
|
1769
1769
|
this.glyphMap = t, this.build();
|
|
1770
1770
|
}
|
|
@@ -1783,8 +1783,8 @@
|
|
|
1783
1783
|
}
|
|
1784
1784
|
if (e.pack(i, {
|
|
1785
1785
|
inPlace: !0
|
|
1786
|
-
}), !
|
|
1787
|
-
const t =
|
|
1786
|
+
}), !On(e.w) || !On(e.h)) {
|
|
1787
|
+
const t = Fn(e.w), n = Fn(e.h);
|
|
1788
1788
|
e.resize(t, n);
|
|
1789
1789
|
}
|
|
1790
1790
|
const r = new kn({
|
|
@@ -1804,10 +1804,10 @@
|
|
|
1804
1804
|
this.image = r, this.positions = n;
|
|
1805
1805
|
}
|
|
1806
1806
|
}
|
|
1807
|
-
function
|
|
1807
|
+
function On(t) {
|
|
1808
1808
|
return 0 == (t & t - 1) && 0 !== t;
|
|
1809
1809
|
}
|
|
1810
|
-
function
|
|
1810
|
+
function Fn(t) {
|
|
1811
1811
|
return Math.pow(2, Math.ceil(Math.log(t) / Math.LN2));
|
|
1812
1812
|
}
|
|
1813
1813
|
/*!
|
|
@@ -2069,7 +2069,7 @@
|
|
|
2069
2069
|
height: r
|
|
2070
2070
|
}, s);
|
|
2071
2071
|
}
|
|
2072
|
-
this.iconAtlas = new
|
|
2072
|
+
this.iconAtlas = new Tn(t);
|
|
2073
2073
|
}
|
|
2074
2074
|
if (e && Object.keys(e).length) {
|
|
2075
2075
|
for (const t in e) {
|
|
@@ -2201,7 +2201,7 @@
|
|
|
2201
2201
|
}
|
|
2202
2202
|
function Kn(t) {
|
|
2203
2203
|
let n = t.positions, e = t.image && t.image.format || "alpha";
|
|
2204
|
-
if (t instanceof
|
|
2204
|
+
if (t instanceof Tn) {
|
|
2205
2205
|
n = {};
|
|
2206
2206
|
for (const e in t.positions) {
|
|
2207
2207
|
const i = t.positions[e];
|
|
@@ -2261,17 +2261,17 @@
|
|
|
2261
2261
|
function Pe(t) {
|
|
2262
2262
|
return !!(746 === t || 747 === t || !(t < 4352) && (ce(t) || he(t) || Ae(t) && !(t >= 65097 && t <= 65103) || xe(t) || pe(t) || ie(t) || ue(t) || !(!oe(t) || t >= 12296 && t <= 12305 || t >= 12308 && t <= 12319 || 12336 === t) || ye(t) || me(t) || de(t) || (t => t >= 12592 && t <= 12687)(t) || (t => t >= 43360 && t <= 43391)(t) || (t => t >= 55216 && t <= 55295)(t) || (t => t >= 4352 && t <= 4607)(t) || (t => t >= 44032 && t <= 55215)(t) || ae(t) || se(t) || (t => t >= 12688 && t <= 12703)(t) || re(t) || fe(t) || le(t) && 12540 !== t || !(!Se(t) || 65288 === t || 65289 === t || 65293 === t || t >= 65306 && t <= 65310 || 65339 === t || 65341 === t || 65343 === t || t >= 65371 && t <= 65503 || 65507 === t || t >= 65512 && t <= 65519) || !(!_e(t) || t >= 65112 && t <= 65118 || t >= 65123 && t <= 65126) || (t => t >= 5120 && t <= 5759)(t) || (t => t >= 6320 && t <= 6399)(t) || we(t) || (t => t >= 19904 && t <= 19967)(t) || ge(t) || ve(t)));
|
|
2263
2263
|
}
|
|
2264
|
-
function
|
|
2264
|
+
function Te(t) {
|
|
2265
2265
|
return !(Pe(t) || function(t) {
|
|
2266
2266
|
return !!((t => t >= 128 && t <= 255)(t) && (167 === t || 169 === t || 174 === t || 177 === t || 188 === t || 189 === t || 190 === t || 215 === t || 247 === t) || (t => t >= 8192 && t <= 8303)(t) && (8214 === t || 8224 === t || 8225 === t || 8240 === t || 8241 === t || 8251 === t || 8252 === t || 8258 === t || 8263 === t || 8264 === t || 8265 === t || 8273 === t) || (t => t >= 8448 && t <= 8527)(t) || (t => t >= 8528 && t <= 8591)(t) || (t => t >= 8960 && t <= 9215)(t) && (t >= 8960 && t <= 8967 || t >= 8972 && t <= 8991 || t >= 8996 && t <= 9e3 || 9003 === t || t >= 9085 && t <= 9114 || t >= 9150 && t <= 9165 || 9167 === t || t >= 9169 && t <= 9179 || t >= 9186 && t <= 9215) || (t => t >= 9216 && t <= 9279)(t) && 9251 !== t || (t => t >= 9280 && t <= 9311)(t) || (t => t >= 9312 && t <= 9471)(t) || (t => t >= 9632 && t <= 9727)(t) || (t => t >= 9728 && t <= 9983)(t) && !(t >= 9754 && t <= 9759) || (t => t >= 11008 && t <= 11263)(t) && (t >= 11026 && t <= 11055 || t >= 11088 && t <= 11097 || t >= 11192 && t <= 11243) || oe(t) || le(t) || (t => t >= 57344 && t <= 63743)(t) || Ae(t) || _e(t) || Se(t) || 8734 === t || 8756 === t || 8757 === t || t >= 9984 && t <= 10087 || t >= 10102 && t <= 10131 || 65532 === t || 65533 === t);
|
|
2267
2267
|
}(t));
|
|
2268
2268
|
}
|
|
2269
|
-
function
|
|
2269
|
+
function Oe(t) {
|
|
2270
2270
|
return t >= 1424 && t <= 2303 || be(t) || Me(t);
|
|
2271
2271
|
}
|
|
2272
|
-
const
|
|
2272
|
+
const Fe = [ [ 9, 9 ], [ 32, 32 ], [ 5760, 5760 ], [ 8192, 8198 ], [ 8200, 8202 ], [ 8287, 12288 ], [ 6158, 6158 ], [ 8203, 8205 ] ];
|
|
2273
2273
|
function Ie(t) {
|
|
2274
|
-
for (const n of
|
|
2274
|
+
for (const n of Fe) if (t >= n[0] && t <= n[1]) return !0;
|
|
2275
2275
|
return !1;
|
|
2276
2276
|
}
|
|
2277
2277
|
const Ce = {
|
|
@@ -2365,7 +2365,7 @@
|
|
|
2365
2365
|
let n = "";
|
|
2366
2366
|
for (let e = 0; e < t.length; e++) {
|
|
2367
2367
|
const i = t.charCodeAt(e + 1) || null, r = t.charCodeAt(e - 1) || null;
|
|
2368
|
-
n += i &&
|
|
2368
|
+
n += i && Te(i) && !Ce[t[e + 1]] || r && Te(r) && !Ce[t[e - 1]] || !Ce[t[e]] ? t[e] : Ce[t[e]];
|
|
2369
2369
|
}
|
|
2370
2370
|
return n;
|
|
2371
2371
|
}(c));
|
|
@@ -2530,14 +2530,14 @@
|
|
|
2530
2530
|
}
|
|
2531
2531
|
function je(t) {
|
|
2532
2532
|
if (!function(t) {
|
|
2533
|
-
for (const n of t) if (
|
|
2533
|
+
for (const n of t) if (Oe(n.charCodeAt(0))) return !0;
|
|
2534
2534
|
return !1;
|
|
2535
2535
|
}(t)) return t;
|
|
2536
2536
|
const n = [], e = [], i = [];
|
|
2537
2537
|
let r = 0, s = 0, o = 1, a = 1;
|
|
2538
2538
|
for (const l of t) {
|
|
2539
2539
|
const t = l.codePointAt(0);
|
|
2540
|
-
Ie(t) ? (i.push(l), r++) : (o =
|
|
2540
|
+
Ie(t) ? (i.push(l), r++) : (o = Oe(t) ? -1 : 1, a !== o ? (s = r, e.length && (a > 0 && e.reverse(),
|
|
2541
2541
|
n.push(...e)), i.length && (n.splice(s, 0, ...i), i.length = 0), a = o, e.length = 0) : i.length && (e.push(...i),
|
|
2542
2542
|
i.length = 0), e.push(l), r++);
|
|
2543
2543
|
}
|
|
@@ -2584,10 +2584,10 @@
|
|
|
2584
2584
|
}
|
|
2585
2585
|
getIconAndGlyph() {
|
|
2586
2586
|
if (this.iconGlyph) return this.iconGlyph;
|
|
2587
|
-
const {markerFileFn: t, markerTypeFn: n, markerPathFn: e, markerWidthFn: i, markerHeightFn: r, markerFillFn: s, markerFillPatternFileFn: o, markerFillOpacityFn: a, markerTextFitFn: l, markerTextFitPaddingFn: h, markerLineColorFn: c, markerLineWidthFn: u, markerLineOpacityFn: f, markerLineDasharrayFn: d, markerLinePatternFileFn: p,
|
|
2588
|
-
let
|
|
2589
|
-
if (
|
|
2590
|
-
|
|
2587
|
+
const {markerFileFn: t, markerTypeFn: n, markerPathFn: e, markerWidthFn: i, markerHeightFn: r, markerFillFn: s, markerFillPatternFileFn: o, markerFillOpacityFn: a, markerTextFitFn: l, markerTextFitPaddingFn: h, markerLineColorFn: c, markerLineWidthFn: u, markerLineOpacityFn: f, markerLineDasharrayFn: d, markerLinePatternFileFn: p, markerPathWidthFn: y, markerPathHeightFn: m, textNameFn: g, textFaceNameFn: v, textStyleFn: x, textWeightFn: b} = this.D, {zoom: w} = this.options, A = {}, S = this.symbol, k = this.feature.properties, P = t ? t(null, k) : S.markerFile, T = n ? n(null, k) : S.markerType, O = P || T || S.markerPath, F = !Ln(this.symbolDef.textName);
|
|
2588
|
+
let I;
|
|
2589
|
+
if (O) {
|
|
2590
|
+
I = function(t, n, e, i, r, s) {
|
|
2591
2591
|
if (Ln(n.markerWidth) && Ln(n.markerHeight)) return null;
|
|
2592
2592
|
const o = "__fn_markerWidth".trim(), a = "__fn_markerHeight".trim();
|
|
2593
2593
|
let l = n.markerWidth || 0, h = n.markerHeight || 0;
|
|
@@ -2595,76 +2595,77 @@
|
|
|
2595
2595
|
zn(l) && (l = "identity" === l.type ? r(i, e) : te(l)))), zn(h) && ("identity" !== h.type ? h = te(h) : (h = t.markerHeight,
|
|
2596
2596
|
t[a] && (h = t[a](i, e)), zn(h) && (h = "identity" === h.type ? s(i, e) : te(h)))),
|
|
2597
2597
|
[ l, h ];
|
|
2598
|
-
}(
|
|
2599
|
-
let t =
|
|
2600
|
-
if (l && (t = l(
|
|
2601
|
-
const n =
|
|
2602
|
-
let e =
|
|
2603
|
-
_(e) && (e = M(e)(
|
|
2604
|
-
const i = ee(e,
|
|
2598
|
+
}(S, this.symbolDef, k, w, i, r) || [ 0, 0 ];
|
|
2599
|
+
let t = S.markerTextFit;
|
|
2600
|
+
if (l && (t = l(w, k)), t && t && "none" !== t) {
|
|
2601
|
+
const n = S.text.textSize;
|
|
2602
|
+
let e = S.text.textName;
|
|
2603
|
+
_(e) && (e = M(e)(w, k));
|
|
2604
|
+
const i = ee(e, k);
|
|
2605
2605
|
if (i) {
|
|
2606
2606
|
const e = "__fn_textSize".trim(), r = "__fn_textSize_0".trim();
|
|
2607
|
-
_(n) && !
|
|
2608
|
-
const e =
|
|
2607
|
+
_(n) && !S.text[e] && (S.text[r] = M(n), S.text[e] = (t, n) => {
|
|
2608
|
+
const e = S.text[r](t, n);
|
|
2609
2609
|
return _(e) ? M(e)(t, n) : e;
|
|
2610
2610
|
});
|
|
2611
|
-
const s = Qn(
|
|
2612
|
-
if ("width" !== t && "both" !== t || (
|
|
2611
|
+
const s = Qn(S.text, S.text, k, w);
|
|
2612
|
+
if ("width" !== t && "both" !== t || (I[0] = s[0] * i.length), "height" !== t && "both" !== t || (I[1] = s[1]),
|
|
2613
2613
|
s[0] && s[1]) {
|
|
2614
|
-
let t =
|
|
2615
|
-
h && (t = h(
|
|
2614
|
+
let t = S.markerTextFitPadding || [ 0, 0, 0, 0 ];
|
|
2615
|
+
h && (t = h(w, k)), I[0] += t[1] + t[3], I[1] += t[0] + t[2];
|
|
2616
2616
|
}
|
|
2617
|
-
} else
|
|
2617
|
+
} else I[0] = I[1] = -1;
|
|
2618
2618
|
}
|
|
2619
2619
|
}
|
|
2620
|
-
if (
|
|
2621
|
-
if (
|
|
2620
|
+
if (F && (I = Qn(S, this.symbolDef, k, w)), !I) return A;
|
|
2621
|
+
if (I[0] = Math.ceil(I[0]), I[1] = Math.ceil(I[1]), this.size = I, O && I[0] >= 0 && I[1] >= 0) {
|
|
2622
2622
|
let t;
|
|
2623
|
-
if (
|
|
2623
|
+
if (T) {
|
|
2624
2624
|
const n = {};
|
|
2625
|
-
if (n.markerType =
|
|
2625
|
+
if (n.markerType = T, "path" === T && (n.markerPath = e ? e(null, k) : S.markerPath,
|
|
2626
|
+
n.markerPathWidth = y ? y(null, k) : S.markerPathWidth, n.markerPathHeight = m ? m(null, k) : S.markerPathHeight),
|
|
2626
2627
|
i) {
|
|
2627
|
-
const t = i(null,
|
|
2628
|
+
const t = i(null, k);
|
|
2628
2629
|
Ln(t) || (n.markerWidth = t);
|
|
2629
|
-
} else
|
|
2630
|
+
} else S.markerWidth >= 0 && (n.markerWidth = S.markerWidth);
|
|
2630
2631
|
if (r) {
|
|
2631
|
-
const t = r(null,
|
|
2632
|
+
const t = r(null, k);
|
|
2632
2633
|
Ln(t) || (n.markerHeight = t);
|
|
2633
|
-
} else
|
|
2634
|
+
} else S.markerHeight >= 0 && (n.markerHeight = S.markerHeight);
|
|
2634
2635
|
if (s) {
|
|
2635
|
-
const t = s(null,
|
|
2636
|
+
const t = s(null, k);
|
|
2636
2637
|
Ln(t) || (n.markerFill = t);
|
|
2637
|
-
} else
|
|
2638
|
+
} else S.markerFill && (n.markerFill = S.markerFill);
|
|
2638
2639
|
if (o) {
|
|
2639
|
-
const t = o(null,
|
|
2640
|
+
const t = o(null, k);
|
|
2640
2641
|
Ln(t) || (n.markerFillPatternFile = t);
|
|
2641
|
-
} else
|
|
2642
|
+
} else S.markerFillPatternFile && (n.markerFillPatternFile = S.markerFillPatternFile);
|
|
2642
2643
|
if (a) {
|
|
2643
|
-
const t = a(null,
|
|
2644
|
+
const t = a(null, k);
|
|
2644
2645
|
Ln(t) || (n.markerFillOpacity = t);
|
|
2645
|
-
} else
|
|
2646
|
+
} else S.markerFillOpacity >= 0 && (n.markerFillOpacity = S.markerFillOpacity);
|
|
2646
2647
|
if (c) {
|
|
2647
|
-
const t = c(null,
|
|
2648
|
+
const t = c(null, k);
|
|
2648
2649
|
Ln(t) || (n.markerLineColor = t);
|
|
2649
|
-
} else
|
|
2650
|
+
} else S.markerLineColor && (n.markerLineColor = S.markerLineColor);
|
|
2650
2651
|
if (u) {
|
|
2651
|
-
const t = u(null,
|
|
2652
|
+
const t = u(null, k);
|
|
2652
2653
|
Ln(t) || (n.markerLineWidth = t);
|
|
2653
|
-
} else
|
|
2654
|
+
} else S.markerLineWidth >= 0 && (n.markerLineWidth = S.markerLineWidth);
|
|
2654
2655
|
if (f) {
|
|
2655
|
-
const t = f(null,
|
|
2656
|
+
const t = f(null, k);
|
|
2656
2657
|
Ln(t) || (n.markerLineOpacity = t);
|
|
2657
|
-
} else
|
|
2658
|
+
} else S.markerLineOpacity >= 0 && (n.markerLineOpacity = S.markerLineOpacity);
|
|
2658
2659
|
if (d) {
|
|
2659
|
-
const t = d(null,
|
|
2660
|
+
const t = d(null, k);
|
|
2660
2661
|
Ln(t) || (n.markerLineDasharray = t);
|
|
2661
|
-
} else
|
|
2662
|
+
} else S.markerLineDasharray && (n.markerLineDasharray = S.markerLineDasharray);
|
|
2662
2663
|
if (p) {
|
|
2663
|
-
const t = p(null,
|
|
2664
|
+
const t = p(null, k);
|
|
2664
2665
|
Ln(t) || (n.markerLinePatternFile = t);
|
|
2665
|
-
} else
|
|
2666
|
+
} else S.markerLinePatternFile && (n.markerLinePatternFile = S.markerLinePatternFile);
|
|
2666
2667
|
t = "vector://" + JSON.stringify(n);
|
|
2667
|
-
} else t =
|
|
2668
|
+
} else t = P ? P.replace(Ue, this.V) : S.markerPath ? function(t, n, e) {
|
|
2668
2669
|
if (!t.markerPath) return null;
|
|
2669
2670
|
let i = 1;
|
|
2670
2671
|
const r = function(t) {
|
|
@@ -2706,26 +2707,26 @@
|
|
|
2706
2707
|
n += "></path>", h.push(n);
|
|
2707
2708
|
}
|
|
2708
2709
|
return h.push("</svg>"), "data:image/svg+xml;base64," + btoa(h.join(" "));
|
|
2709
|
-
}(
|
|
2710
|
-
|
|
2710
|
+
}(S, I[0], I[1]) : null;
|
|
2711
|
+
A.icon = {
|
|
2711
2712
|
url: t,
|
|
2712
|
-
size:
|
|
2713
|
+
size: I
|
|
2713
2714
|
};
|
|
2714
2715
|
}
|
|
2715
|
-
if (
|
|
2716
|
-
const t =
|
|
2716
|
+
if (F) {
|
|
2717
|
+
const t = g ? g(null, k) : S.textName;
|
|
2717
2718
|
if (t || 0 === t) {
|
|
2718
2719
|
const n = function(t, n, e) {
|
|
2719
2720
|
return [ n || "normal", e || "normal", "24px", t || "monospace" ].join(" ");
|
|
2720
|
-
}(
|
|
2721
|
-
let e = ee(t,
|
|
2722
|
-
e && e.length && (e = je(e),
|
|
2721
|
+
}(v ? v(null, k) : S.textFaceName, x ? x(null, k) : S.textStyle, b ? b(null, k) : S.textWeight);
|
|
2722
|
+
let e = ee(t, k);
|
|
2723
|
+
e && e.length && (e = je(e), A.glyph = {
|
|
2723
2724
|
font: n,
|
|
2724
2725
|
text: e
|
|
2725
2726
|
});
|
|
2726
2727
|
}
|
|
2727
2728
|
}
|
|
2728
|
-
return this.iconGlyph =
|
|
2729
|
+
return this.iconGlyph = A, A;
|
|
2729
2730
|
}
|
|
2730
2731
|
}
|
|
2731
2732
|
function We(t, n) {
|
|
@@ -2745,10 +2746,10 @@
|
|
|
2745
2746
|
let l;
|
|
2746
2747
|
for (let t = 0; t < a.length - 1; t++) {
|
|
2747
2748
|
let o = a[t], h = a[t + 1];
|
|
2748
|
-
o.x < n && h.x < n || (o.x < n ? o = new z(n, o.y + (n - o.x) / (h.x - o.x) * (h.y - o.y)).
|
|
2749
|
-
o.y < e && h.y < e || (o.y < e ? o = new z(o.x + (e - o.y) / (h.y - o.y) * (h.x - o.x), e).
|
|
2750
|
-
o.x >= i && h.x >= i || (o.x >= i ? o = new z(i, o.y + (i - o.x) / (h.x - o.x) * (h.y - o.y)).
|
|
2751
|
-
o.y >= r && h.y >= r || (o.y >= r ? o = new z(o.x + (r - o.y) / (h.y - o.y) * (h.x - o.x), r).
|
|
2749
|
+
o.x < n && h.x < n || (o.x < n ? o = new z(n, o.y + (n - o.x) / (h.x - o.x) * (h.y - o.y)).O() : h.x < n && (h = new z(n, o.y + (n - o.x) / (h.x - o.x) * (h.y - o.y)).O()),
|
|
2750
|
+
o.y < e && h.y < e || (o.y < e ? o = new z(o.x + (e - o.y) / (h.y - o.y) * (h.x - o.x), e).O() : h.y < e && (h = new z(o.x + (e - o.y) / (h.y - o.y) * (h.x - o.x), e).O()),
|
|
2751
|
+
o.x >= i && h.x >= i || (o.x >= i ? o = new z(i, o.y + (i - o.x) / (h.x - o.x) * (h.y - o.y)).O() : h.x >= i && (h = new z(i, o.y + (i - o.x) / (h.x - o.x) * (h.y - o.y)).O()),
|
|
2752
|
+
o.y >= r && h.y >= r || (o.y >= r ? o = new z(o.x + (r - o.y) / (h.y - o.y) * (h.x - o.x), r).O() : h.y >= r && (h = new z(o.x + (r - o.y) / (h.y - o.y) * (h.x - o.x), r).O()),
|
|
2752
2753
|
l && o.equals(l[l.length - 1]) || (l = [ o ], s.push(l)), l.push(h)))));
|
|
2753
2754
|
}
|
|
2754
2755
|
}
|
|
@@ -2809,7 +2810,7 @@
|
|
|
2809
2810
|
const m = (d - f) / l, g = Ye(e.x, a.x, m), v = Ye(e.y, a.y, m);
|
|
2810
2811
|
if (g >= 0 && g < h && v >= 0 && v < h && d - c >= 0 && d + c <= u) {
|
|
2811
2812
|
const e = new Xe(g, v, y, t);
|
|
2812
|
-
e.line = n, e.
|
|
2813
|
+
e.line = n, e.O(), r && !qe(n, e, o, r, s) || p.push(e);
|
|
2813
2814
|
}
|
|
2814
2815
|
}
|
|
2815
2816
|
f += l;
|
|
@@ -3179,7 +3180,7 @@
|
|
|
3179
3180
|
for (let e = 0; e < t.length; e++) if (Pe(t.charAt(e).charCodeAt(0))) n = 0; else if (n++,
|
|
3180
3181
|
n >= 1) return !1;
|
|
3181
3182
|
return !0;
|
|
3182
|
-
}(t.getIconAndGlyph().glyph.text) ? 1 : 0, {textFillFn: u, textSizeFn: f, textHaloFillFn: d, textHaloRadiusFn: p, textHaloOpacityFn: y, textDxFn: m, textDyFn: g, textPitchAlignmentFn: v, textRotationAlignmentFn: x, textRotationFn: b, textAllowOverlapFn: w, textIgnorePlacementFn: A, textOpacityFn: M, markerWidthFn: S, markerHeightFn: k, markerDxFn: P, markerDyFn:
|
|
3183
|
+
}(t.getIconAndGlyph().glyph.text) ? 1 : 0, {textFillFn: u, textSizeFn: f, textHaloFillFn: d, textHaloRadiusFn: p, textHaloOpacityFn: y, textDxFn: m, textDyFn: g, textPitchAlignmentFn: v, textRotationAlignmentFn: x, textRotationFn: b, textAllowOverlapFn: w, textIgnorePlacementFn: A, textOpacityFn: M, markerWidthFn: S, markerHeightFn: k, markerDxFn: P, markerDyFn: T, markerPitchAlignmentFn: O, markerRotationAlignmentFn: F, markerRotationFn: I, markerAllowOverlapFn: C, markerIgnorePlacementFn: E, markerOpacityFn: H} = this.D;
|
|
3183
3184
|
let D, R, L, N, V, j, U, G, W, B, X, q, J, Y, $, Z, K;
|
|
3184
3185
|
if (h) {
|
|
3185
3186
|
const n = t.getIconAndGlyph().glyph.font;
|
|
@@ -3245,8 +3246,8 @@
|
|
|
3245
3246
|
writingMode: void 0,
|
|
3246
3247
|
glyphOffset: [ 0, 0 ]
|
|
3247
3248
|
} ];
|
|
3248
|
-
}(), S && (W = S(null, a)), k && (B = k(null, a)), P && (X = P(null, a)),
|
|
3249
|
-
|
|
3249
|
+
}(), S && (W = S(null, a)), k && (B = k(null, a)), P && (X = P(null, a)), T && (q = T(null, a)),
|
|
3250
|
+
O && (J = +("map" === O(null, a))), F && (Y = +("map" === F(null, a))), I && ($ = Jn(I(null, a), 0, 360) * Math.PI / 180);
|
|
3250
3251
|
const Q = C || w;
|
|
3251
3252
|
Q && (Z = Q(null, a) || 0);
|
|
3252
3253
|
const tt = E || A;
|
|
@@ -3284,13 +3285,13 @@
|
|
|
3284
3285
|
}
|
|
3285
3286
|
}
|
|
3286
3287
|
J(t, n, e, i, r, s, o, a, l, h, c, u, f, d, p, y, m, g) {
|
|
3287
|
-
const {textFillFn: v, textSizeFn: x, textHaloFillFn: b, textHaloRadiusFn: w, textHaloOpacityFn: A, textDxFn: _, textDyFn: M, textPitchAlignmentFn: S, textRotationAlignmentFn: k, textRotationFn: P, textAllowOverlapFn:
|
|
3288
|
+
const {textFillFn: v, textSizeFn: x, textHaloFillFn: b, textHaloRadiusFn: w, textHaloOpacityFn: A, textDxFn: _, textDyFn: M, textPitchAlignmentFn: S, textRotationAlignmentFn: k, textRotationFn: P, textAllowOverlapFn: T, textIgnorePlacementFn: O, textOpacityFn: F, markerWidthFn: I, markerHeightFn: C, markerDxFn: E, markerDyFn: H, markerPitchAlignmentFn: D, markerRotationAlignmentFn: R, markerRotationFn: L, markerAllowOverlapFn: N, markerIgnorePlacementFn: z, markerOpacityFn: V} = this.D;
|
|
3288
3289
|
v && t.aTextFill.push(...n), x && t.aTextSize.push(e), b && t.aTextHaloFill.push(...i),
|
|
3289
3290
|
w && t.aTextHaloRadius.push(r), A && t.aTextHaloOpacity.push(s), _ && t.aTextDx.push(o),
|
|
3290
3291
|
M && t.aTextDy.push(a), I && t.aMarkerWidth.push(l), C && t.aMarkerHeight.push(h),
|
|
3291
|
-
E && t.aMarkerDx.push(c), H && t.aMarkerDy.push(u), (V ||
|
|
3292
|
+
E && t.aMarkerDx.push(c), H && t.aMarkerDy.push(u), (V || F) && t.aColorOpacity.push(f),
|
|
3292
3293
|
(S || D) && t.aPitchAlign.push(d), (R || k) && t.aRotationAlign.push(p), (L || P) && t.aRotation.push(9362 * y);
|
|
3293
|
-
const j = N ||
|
|
3294
|
+
const j = N || T, U = z || O;
|
|
3294
3295
|
(j || U) && t.aOverlap.push((j ? 8 : 0) + 4 * m + ((U ? 2 : 0) + g)), r > 0 && (this.properties.hasHalo = 1);
|
|
3295
3296
|
}
|
|
3296
3297
|
B(t, n, e) {
|
|
@@ -3514,17 +3515,17 @@
|
|
|
3514
3515
|
primitiveLength: 0
|
|
3515
3516
|
};
|
|
3516
3517
|
let d, p, y, m, g;
|
|
3517
|
-
this.e1 = this.e2 = -1, l && (d = t[h - 2], g = t[c].sub(d).P().
|
|
3518
|
+
this.e1 = this.e2 = -1, l && (d = t[h - 2], g = t[c].sub(d).P().T());
|
|
3518
3519
|
for (let n = c; n < h; n++) {
|
|
3519
3520
|
if (y = n === h - 1 ? l ? t[c + 1] : void 0 : t[n + 1], y && t[n].equals(y)) continue;
|
|
3520
|
-
g && (m = g), d && (p = d), d = t[n], g = y ? y.sub(d).P().
|
|
3521
|
+
g && (m = g), d && (p = d), d = t[n], g = y ? y.sub(d).P().T() : m, m = m || g;
|
|
3521
3522
|
let a = m.add(g);
|
|
3522
3523
|
0 === a.x && 0 === a.y || a.P();
|
|
3523
3524
|
const v = m.x * g.x + m.y * g.y, x = a.x * g.x + a.y * g.y, b = 0 !== x ? 1 / x : 1 / 0, w = 2 * Math.sqrt(2 - 2 * x), A = x < si && p && y, _ = m.x * g.y - m.y * g.x > 0;
|
|
3524
3525
|
if (!o && A && n > c) {
|
|
3525
3526
|
const t = d.dist(p);
|
|
3526
3527
|
if (t > 2 * u) {
|
|
3527
|
-
const n = d.sub(d.sub(p).A(u / t).
|
|
3528
|
+
const n = d.sub(d.sub(p).A(u / t).O());
|
|
3528
3529
|
this.updateDistance(p, n), this.addCurrentVertex(n, m, 0, 0, f), p = n;
|
|
3529
3530
|
}
|
|
3530
3531
|
}
|
|
@@ -3539,7 +3540,7 @@
|
|
|
3539
3540
|
if ("miter" === S) a.A(b), this.addCurrentVertex(d, a, 0, 0, f); else if ("flipbevel" === S) {
|
|
3540
3541
|
if (b > 100) a = g.mult(-1); else {
|
|
3541
3542
|
const t = b * m.add(g).mag() / m.sub(g).mag();
|
|
3542
|
-
a.
|
|
3543
|
+
a.T().A(t * (_ ? -1 : 1));
|
|
3543
3544
|
}
|
|
3544
3545
|
this.addCurrentVertex(d, a, 0, 0, f), this.addCurrentVertex(d, a.mult(-1), 0, 0, f);
|
|
3545
3546
|
} else if ("bevel" === S || "fakeround" === S) {
|
|
@@ -3565,7 +3566,7 @@
|
|
|
3565
3566
|
if (!o && A && n < h - 1) {
|
|
3566
3567
|
const t = d.dist(y);
|
|
3567
3568
|
if (t > 2 * u) {
|
|
3568
|
-
const n = d.add(y.sub(d).A(u / t).
|
|
3569
|
+
const n = d.add(y.sub(d).A(u / t).O());
|
|
3569
3570
|
this.updateDistance(d, n), this.addCurrentVertex(n, g, 0, 0, f), d = n;
|
|
3570
3571
|
}
|
|
3571
3572
|
}
|
|
@@ -4086,7 +4087,7 @@
|
|
|
4086
4087
|
},
|
|
4087
4088
|
convertRTLText: je
|
|
4088
4089
|
});
|
|
4089
|
-
const
|
|
4090
|
+
const Ti = {
|
|
4090
4091
|
polygonPatternFile: 1,
|
|
4091
4092
|
markerFile: 1,
|
|
4092
4093
|
markerPlacement: 1,
|
|
@@ -4100,17 +4101,17 @@
|
|
|
4100
4101
|
lineJoin: 1,
|
|
4101
4102
|
lineCap: 1,
|
|
4102
4103
|
linePatternFile: 1
|
|
4103
|
-
},
|
|
4104
|
+
}, Oi = {
|
|
4104
4105
|
visible: 1,
|
|
4105
4106
|
textHorizontalAlignment: 1,
|
|
4106
4107
|
textVerticalAlignment: 1,
|
|
4107
4108
|
textWrapWidth: 1,
|
|
4108
4109
|
markerHorizontalAlignment: 1,
|
|
4109
4110
|
markerVerticalAlignment: 1
|
|
4110
|
-
},
|
|
4111
|
+
}, Fi = {
|
|
4111
4112
|
lineDasharray: 1
|
|
4112
4113
|
};
|
|
4113
|
-
Object.assign(
|
|
4114
|
+
Object.assign(Oi, Ti), Object.assign(Fi, Ti);
|
|
4114
4115
|
const Ii = [ "GeoJSONVectorTileLayer" ];
|
|
4115
4116
|
class Ci extends r.worker.Actor {
|
|
4116
4117
|
constructor(t, n) {
|
|
@@ -4229,11 +4230,11 @@
|
|
|
4229
4230
|
this.Mt = t, this.St = n, this.kt = e || [ 0, 1, 0 ];
|
|
4230
4231
|
}
|
|
4231
4232
|
draw(t, n, e, i, r) {
|
|
4232
|
-
this.Pt || this.
|
|
4233
|
-
if (!this.
|
|
4234
|
-
this.
|
|
4233
|
+
this.Pt || this.Tt();
|
|
4234
|
+
if (!this.Ot) {
|
|
4235
|
+
this.Ot = this.Mt.buffer(new Uint16Array([ 0, 0, 0, i, 0, i, i, i, i, i, i, 0, i, 0, 0, 0 ]));
|
|
4235
4236
|
const t = i / e;
|
|
4236
|
-
this.
|
|
4237
|
+
this.Ft = this.Mt.buffer(new Uint16Array([ 0, i - 64 * t, 0, i, 512 * t, i - 64 * t, 512 * t, i ]));
|
|
4237
4238
|
}
|
|
4238
4239
|
let s = this.It;
|
|
4239
4240
|
if (!s) {
|
|
@@ -4254,7 +4255,7 @@
|
|
|
4254
4255
|
data: s
|
|
4255
4256
|
}), this.Pt({
|
|
4256
4257
|
transform: n,
|
|
4257
|
-
data: this.
|
|
4258
|
+
data: this.Ot,
|
|
4258
4259
|
debugLine: 1,
|
|
4259
4260
|
primitive: "lines",
|
|
4260
4261
|
framebuffer: r || null,
|
|
@@ -4262,7 +4263,7 @@
|
|
|
4262
4263
|
count: 8
|
|
4263
4264
|
}), this.Pt({
|
|
4264
4265
|
transform: n,
|
|
4265
|
-
data: this.
|
|
4266
|
+
data: this.Ft,
|
|
4266
4267
|
debugLine: 0,
|
|
4267
4268
|
primitive: "triangle strip",
|
|
4268
4269
|
framebuffer: r || null,
|
|
@@ -4272,10 +4273,10 @@
|
|
|
4272
4273
|
}
|
|
4273
4274
|
delete() {
|
|
4274
4275
|
this.Ct && (this.Ct.destroy(), delete this.Ct), this.Et && (this.Et.destroy(), delete this.Et),
|
|
4275
|
-
this.
|
|
4276
|
+
this.Ot && (this.Ot.destroy(), this.Ft.destroy(), delete this.Ot, delete this.Ft),
|
|
4276
4277
|
this.Pt && (this.Pt.destroy(), delete this.Pt);
|
|
4277
4278
|
}
|
|
4278
|
-
|
|
4279
|
+
Tt() {
|
|
4279
4280
|
this.Et = this.Mt.buffer(new Uint8Array([ 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1 ])),
|
|
4280
4281
|
this.Pt = this.Mt({
|
|
4281
4282
|
vert: "\n attribute vec2 aPosition;\n attribute vec2 aTexCoord;\n uniform mat4 transform;\n\n varying vec2 vTexCoord;\n void main()\n {\n gl_Position = transform * vec4(aPosition, 0.0, 1.0);\n vTexCoord = aTexCoord;\n }\n ",
|
|
@@ -4327,7 +4328,7 @@
|
|
|
4327
4328
|
}, null, Di.length / 2, {
|
|
4328
4329
|
positionSize: 2
|
|
4329
4330
|
})).generateBuffers(t), this.Dt = new e.reshader.Scene, this.Rt = [], this.Lt = 0,
|
|
4330
|
-
this.Nt = n, this.St = i, this.
|
|
4331
|
+
this.Nt = n, this.St = i, this.Tt(t);
|
|
4331
4332
|
}
|
|
4332
4333
|
start() {
|
|
4333
4334
|
this.Lt = 0, this.Dt.clear();
|
|
@@ -4347,7 +4348,7 @@
|
|
|
4347
4348
|
const t = this.Lt++;
|
|
4348
4349
|
return this.Rt[t] || (this.Rt[t] = new e.reshader.Mesh(this.Ht)), this.Rt[t];
|
|
4349
4350
|
}
|
|
4350
|
-
|
|
4351
|
+
Tt(t) {
|
|
4351
4352
|
const n = this.Nt, i = {
|
|
4352
4353
|
viewport: {
|
|
4353
4354
|
x: 0,
|
|
@@ -4609,7 +4610,7 @@
|
|
|
4609
4610
|
}
|
|
4610
4611
|
o && i.Pn();
|
|
4611
4612
|
const h = s[0].z, c = this.layer.getDataSchema(h);
|
|
4612
|
-
if (this.
|
|
4613
|
+
if (this.Tn(c, e.schema), delete e.features, r && e.data.length !== l.length) {
|
|
4613
4614
|
const t = e.data;
|
|
4614
4615
|
e.data = [];
|
|
4615
4616
|
for (let n = 0; n < t.length; n++) t[n] && t[n].features && e.data.push(t[n]);
|
|
@@ -4625,7 +4626,7 @@
|
|
|
4625
4626
|
this.layer.fire("datareceived");
|
|
4626
4627
|
}
|
|
4627
4628
|
kn(t, n, e, i) {
|
|
4628
|
-
const {style: r, isUpdated: s} = this.
|
|
4629
|
+
const {style: r, isUpdated: s} = this.On(t, n, e.data), o = this.layer, a = o.isDefaultRender(), l = r.symbol, h = e.styledFeatures, c = {};
|
|
4629
4630
|
if (function(t) {
|
|
4630
4631
|
if (!t) return !1;
|
|
4631
4632
|
for (const n in t) if (void 0 !== t[n] && null !== t[n]) return !0;
|
|
@@ -4648,7 +4649,7 @@
|
|
|
4648
4649
|
} : null
|
|
4649
4650
|
};
|
|
4650
4651
|
}
|
|
4651
|
-
|
|
4652
|
+
Tn(t, n) {
|
|
4652
4653
|
for (const e in n) {
|
|
4653
4654
|
t[e] || (t[e] = {
|
|
4654
4655
|
types: n[e].types,
|
|
@@ -4658,13 +4659,13 @@
|
|
|
4658
4659
|
for (const t in i) (!r[t] || r[t] && "object" !== i[t] && "object" === r[t]) && (r[t] = i[t]);
|
|
4659
4660
|
}
|
|
4660
4661
|
}
|
|
4661
|
-
|
|
4662
|
+
On(t, n, e) {
|
|
4662
4663
|
Array.isArray(e) && (e = e[0]);
|
|
4663
4664
|
const i = this.layer;
|
|
4664
4665
|
let r, s = !1;
|
|
4665
4666
|
if (i.isDefaultRender() && 0 === t) {
|
|
4666
|
-
let t = this.
|
|
4667
|
-
t || (t = this.
|
|
4667
|
+
let t = this.Fn;
|
|
4668
|
+
t || (t = this.Fn = {});
|
|
4668
4669
|
const n = e.layer, i = e.type;
|
|
4669
4670
|
t[n] || (t[n] = []);
|
|
4670
4671
|
const o = ("plugin_" + i).trim();
|
|
@@ -4685,25 +4686,25 @@
|
|
|
4685
4686
|
}
|
|
4686
4687
|
tn(t) {
|
|
4687
4688
|
let n = this.plugins || [];
|
|
4688
|
-
return this.layer.isDefaultRender() && this.
|
|
4689
|
+
return this.layer.isDefaultRender() && this.Fn && (n = [], t ? t.layers.forEach(t => {
|
|
4689
4690
|
const e = ("plugin_" + t.type).trim();
|
|
4690
|
-
n.push(this.
|
|
4691
|
-
}) : Object.keys(this.
|
|
4692
|
-
for (let e = 0; e < this.
|
|
4691
|
+
n.push(this.Fn[t.layer][e].plugin);
|
|
4692
|
+
}) : Object.keys(this.Fn).forEach(t => {
|
|
4693
|
+
for (let e = 0; e < this.Fn[t].length; e++) n.push(this.Fn[t][e].plugin);
|
|
4693
4694
|
})), this.featurePlugins && this.featurePlugins.length && (n = n.slice(), D(n, this.featurePlugins)),
|
|
4694
4695
|
n;
|
|
4695
4696
|
}
|
|
4696
4697
|
Cn() {
|
|
4697
|
-
if (this.layer.isDefaultRender() && this.
|
|
4698
|
+
if (this.layer.isDefaultRender() && this.Fn) {
|
|
4698
4699
|
const t = [];
|
|
4699
|
-
return Object.keys(this.
|
|
4700
|
-
for (let e = 0; e < this.
|
|
4700
|
+
return Object.keys(this.Fn).forEach(n => {
|
|
4701
|
+
for (let e = 0; e < this.Fn[n].length; e++) t.push(this.Fn[n][e].plugin);
|
|
4701
4702
|
}), t;
|
|
4702
4703
|
}
|
|
4703
4704
|
return this.plugins;
|
|
4704
4705
|
}
|
|
4705
4706
|
dn(t) {
|
|
4706
|
-
const n = this.layer.isDefaultRender() && this.
|
|
4707
|
+
const n = this.layer.isDefaultRender() && this.Fn, e = this.un;
|
|
4707
4708
|
this.tn().forEach((i, r) => {
|
|
4708
4709
|
if (!i) return;
|
|
4709
4710
|
if (!this.wn(r)) return;
|
|
@@ -4717,7 +4718,7 @@
|
|
|
4717
4718
|
pluginIndex: r,
|
|
4718
4719
|
timestamp: t
|
|
4719
4720
|
};
|
|
4720
|
-
e &&
|
|
4721
|
+
e && F(o, e), i.startFrame(o);
|
|
4721
4722
|
});
|
|
4722
4723
|
}
|
|
4723
4724
|
mn(t) {
|
|
@@ -4778,7 +4779,7 @@
|
|
|
4778
4779
|
cameraPosition: e,
|
|
4779
4780
|
timestamp: i
|
|
4780
4781
|
}, s = this.un;
|
|
4781
|
-
return s &&
|
|
4782
|
+
return s && F(r, s), r;
|
|
4782
4783
|
}
|
|
4783
4784
|
Ln(t) {
|
|
4784
4785
|
if (!t) return !1;
|
|
@@ -5125,8 +5126,8 @@
|
|
|
5125
5126
|
}
|
|
5126
5127
|
function Ui(t) {
|
|
5127
5128
|
let n;
|
|
5128
|
-
Array.isArray(t.data) ? (n = [], D(n, t.data)) : (n = {},
|
|
5129
|
-
const e =
|
|
5129
|
+
Array.isArray(t.data) ? (n = [], D(n, t.data)) : (n = {}, F(n, t.data));
|
|
5130
|
+
const e = F({}, t);
|
|
5130
5131
|
return e.data = n, e;
|
|
5131
5132
|
}
|
|
5132
5133
|
function Gi(t, n) {
|
|
@@ -5179,7 +5180,7 @@
|
|
|
5179
5180
|
};
|
|
5180
5181
|
function Yi(t, n, e) {
|
|
5181
5182
|
for (let i = 0; i < t.length; i++) {
|
|
5182
|
-
const r = t[i], s =
|
|
5183
|
+
const r = t[i], s = F({}, r), {renderPlugin: o} = r, a = F({}, o);
|
|
5183
5184
|
a.sceneConfig && !Object.keys(a.sceneConfig).length && delete a.sceneConfig;
|
|
5184
5185
|
let l = -1;
|
|
5185
5186
|
for (let t = e.length - 1; t >= 0; t--) if (Ji(a, e[t])) {
|
|
@@ -5191,7 +5192,7 @@
|
|
|
5191
5192
|
}
|
|
5192
5193
|
const $i = "function" == typeof fetch && "function" == typeof AbortController, Zi = {
|
|
5193
5194
|
jsonp: function(t, n) {
|
|
5194
|
-
const e = "_maptalks_jsonp_" +
|
|
5195
|
+
const e = "_maptalks_jsonp_" + T++;
|
|
5195
5196
|
t.match(/\?/) ? t += "&callback=" + e : t += "?callback=" + e;
|
|
5196
5197
|
let i = document.createElement("script");
|
|
5197
5198
|
return i.type = "text/javascript", i.src = t, window[e] = function(t) {
|
|
@@ -5385,9 +5386,9 @@
|
|
|
5385
5386
|
let {style: i, featureStyle: r} = e;
|
|
5386
5387
|
i = i || [], r = r || [];
|
|
5387
5388
|
const s = new Array(i.length);
|
|
5388
|
-
for (let t = 0; t < i.length; t++) s[t] =
|
|
5389
|
+
for (let t = 0; t < i.length; t++) s[t] = F({}, i[t]), s[t].renderPlugin = n[i[t].renderPlugin];
|
|
5389
5390
|
const o = new Array(r.length);
|
|
5390
|
-
for (let t = 0; t < r.length; t++) o[t] =
|
|
5391
|
+
for (let t = 0; t < r.length; t++) o[t] = F({}, r[t]), o[t].renderPlugin = n[r[t].renderPlugin];
|
|
5391
5392
|
const a = {
|
|
5392
5393
|
style: s,
|
|
5393
5394
|
featureStyle: o
|
|
@@ -5400,9 +5401,9 @@
|
|
|
5400
5401
|
for (let e = 0; e < t.length; e++) {
|
|
5401
5402
|
const i = t[e].style;
|
|
5402
5403
|
if (i && Array.isArray(i) && i.length) for (let r = 0; r < i.length; r++) {
|
|
5403
|
-
const s =
|
|
5404
|
+
const s = F({}, t[e], i[r]);
|
|
5404
5405
|
i[r].Yn = n.length, delete s.style, n.push(s);
|
|
5405
|
-
} else n.push(
|
|
5406
|
+
} else n.push(F({}, t[e]));
|
|
5406
5407
|
}
|
|
5407
5408
|
return n;
|
|
5408
5409
|
}(t.featureStyle), this.$n = t.style || [];
|
|
@@ -5462,20 +5463,20 @@
|
|
|
5462
5463
|
const r = this.Qt(t);
|
|
5463
5464
|
if (!r) return this;
|
|
5464
5465
|
let s, o = n;
|
|
5465
|
-
if (r[n].renderPlugin.sceneConfig || (r[n].renderPlugin.sceneConfig = {}),
|
|
5466
|
+
if (r[n].renderPlugin.sceneConfig || (r[n].renderPlugin.sceneConfig = {}), F(r[n].renderPlugin.sceneConfig, e),
|
|
5466
5467
|
void 0 !== i) {
|
|
5467
5468
|
ir(this.qn, n, i), o = this.qn[n].style[i].Yn;
|
|
5468
5469
|
const t = r[o].renderPlugin;
|
|
5469
5470
|
t.sceneConfig || (t.sceneConfig = {}), s = t.sceneConfig;
|
|
5470
5471
|
} else rr(r, n), s = r[n].renderPlugin.sceneConfig;
|
|
5471
|
-
if (
|
|
5472
|
+
if (F(s, e), Array.isArray(this.options.style)) {
|
|
5472
5473
|
const t = this.options.style[n].renderPlugin;
|
|
5473
|
-
t.sceneConfig || (t.sceneConfig = {}),
|
|
5474
|
+
t.sceneConfig || (t.sceneConfig = {}), F(t.sceneConfig, e);
|
|
5474
5475
|
} else {
|
|
5475
5476
|
const r = this.Qt(t, this.options.style);
|
|
5476
5477
|
let s;
|
|
5477
5478
|
void 0 !== i ? (ir(r, n, i), s = r[n].style[i].renderPlugin) : (rr(r, n), s = r[n].renderPlugin),
|
|
5478
|
-
s.sceneConfig || (s.sceneConfig = {}),
|
|
5479
|
+
s.sceneConfig || (s.sceneConfig = {}), F(s.sceneConfig, e);
|
|
5479
5480
|
}
|
|
5480
5481
|
const a = this.getRenderer();
|
|
5481
5482
|
return a && a.updateSceneConfig(t, o, e), 0 === t ? this.fire("updatesceneconfig", {
|
|
@@ -5499,12 +5500,12 @@
|
|
|
5499
5500
|
let s, o = n;
|
|
5500
5501
|
void 0 !== i ? (ir(this.qn, n, i), o = this.qn[n].style[i].Yn, s = r[o].renderPlugin.dataConfig) : (rr(r, n),
|
|
5501
5502
|
s = r[n].renderPlugin.dataConfig);
|
|
5502
|
-
const a =
|
|
5503
|
-
if (
|
|
5503
|
+
const a = F({}, s);
|
|
5504
|
+
if (F(s, e), Array.isArray(this.options.style)) F(this.options.style[n].renderPlugin.dataConfig, e); else {
|
|
5504
5505
|
const r = this.Qt(t, this.options.style);
|
|
5505
5506
|
let s;
|
|
5506
5507
|
void 0 !== i ? (ir(r, n, i), s = r[n].style[i].renderPlugin) : (rr(r, n), s = r[n].renderPlugin),
|
|
5507
|
-
s.dataConfig || (s.dataConfig = {}),
|
|
5508
|
+
s.dataConfig || (s.dataConfig = {}), F(s.dataConfig, e);
|
|
5508
5509
|
}
|
|
5509
5510
|
const l = this.getRenderer();
|
|
5510
5511
|
return l && l.updateDataConfig(t, o, e, a), 0 === t ? this.fire("updatedataconfig", {
|
|
@@ -5543,7 +5544,7 @@
|
|
|
5543
5544
|
}
|
|
5544
5545
|
}
|
|
5545
5546
|
for (const t in e) N(e, t) && (!r.Util.isObject(e[t]) || Array.isArray(e[t]) || e[t].stops ? s[t] = e[t] : (s[t] || (s[t] = {}),
|
|
5546
|
-
|
|
5547
|
+
F(s[t], e[t])));
|
|
5547
5548
|
let u = l.options.style;
|
|
5548
5549
|
Array.isArray(u) || (u = l.Qt(t, l.options.style));
|
|
5549
5550
|
const f = JSON.parse(JSON.stringify(s));
|
|
@@ -5817,7 +5818,7 @@
|
|
|
5817
5818
|
if (!this.options.style) throw new Error("can't call update symbol when style is not set");
|
|
5818
5819
|
const e = Array.isArray(this.options.style) ? this.options.style : this.options.style.style;
|
|
5819
5820
|
if (!e[t]) throw new Error("invalid style at " + t);
|
|
5820
|
-
return
|
|
5821
|
+
return F(e[t].symbol, n), this.setStyle(this.options.style), this;
|
|
5821
5822
|
}
|
|
5822
5823
|
getPolygonOffsetCount() {
|
|
5823
5824
|
return 1;
|
|
@@ -5918,7 +5919,7 @@
|
|
|
5918
5919
|
if (Array.isArray(u) && u.length) {
|
|
5919
5920
|
const r = [], s = u.length;
|
|
5920
5921
|
for (let o = 0; o < s; o++) {
|
|
5921
|
-
const a = o === s - 1 ? c :
|
|
5922
|
+
const a = o === s - 1 ? c : F({}, c);
|
|
5922
5923
|
for (const t in u[o]) if (N(u[o], t)) {
|
|
5923
5924
|
a[("_symbol_" + t).trim()] = u[o][t];
|
|
5924
5925
|
}
|
|
@@ -5963,6 +5964,16 @@
|
|
|
5963
5964
|
default: 20,
|
|
5964
5965
|
property: "_symbol_markerHeight"
|
|
5965
5966
|
},
|
|
5967
|
+
markerPathWidth: {
|
|
5968
|
+
type: "identity",
|
|
5969
|
+
default: 20,
|
|
5970
|
+
property: "_symbol_markerPathWidth"
|
|
5971
|
+
},
|
|
5972
|
+
markerPathHeight: {
|
|
5973
|
+
type: "identity",
|
|
5974
|
+
default: 20,
|
|
5975
|
+
property: "_symbol_markerPathHeight"
|
|
5976
|
+
},
|
|
5966
5977
|
markerDx: {
|
|
5967
5978
|
type: "identity",
|
|
5968
5979
|
default: void 0,
|
|
@@ -6280,21 +6291,21 @@
|
|
|
6280
6291
|
this.we = {}, this.Ae = {}, this._e = {}, this.Me = !0, this.Se = {
|
|
6281
6292
|
id: 0,
|
|
6282
6293
|
pickingId: 0
|
|
6283
|
-
}, this.ke =
|
|
6294
|
+
}, this.ke = F({}, pr, yr), this.Pe = {};
|
|
6284
6295
|
}
|
|
6285
6296
|
hasNoAARendering() {
|
|
6286
6297
|
return !0;
|
|
6287
6298
|
}
|
|
6288
6299
|
needToRedraw() {
|
|
6289
6300
|
const t = super.needToRedraw();
|
|
6290
|
-
return t || (this.painter && this.painter.needToRedraw() || this.
|
|
6301
|
+
return t || (this.painter && this.painter.needToRedraw() || this.Te && this.Te.needToRedraw() || this.Oe && this.Oe.needToRedraw());
|
|
6291
6302
|
}
|
|
6292
6303
|
draw(t, n) {
|
|
6293
6304
|
const e = this.layer;
|
|
6294
6305
|
if (this.prepareCanvas(), this.hn = this.cn(this.getMap().getGLRes()), this.Me) this.buildMesh(),
|
|
6295
|
-
this.
|
|
6306
|
+
this.Fe(), this.Ie(), this.Pe = {}, this.Ce = !1, this.Me = !1, this.Ee = !1; else if (this.Ce) {
|
|
6296
6307
|
const t = this.atlas, n = this.He, e = this.De;
|
|
6297
|
-
delete this.atlas, delete this.He, delete this.De, this.buildMesh(t), this.
|
|
6308
|
+
delete this.atlas, delete this.He, delete this.De, this.buildMesh(t), this.Fe(n),
|
|
6298
6309
|
this.Ie(e), this.Ce = !1, this.Ee = !1;
|
|
6299
6310
|
} else if (this.Ee) {
|
|
6300
6311
|
const t = this.De;
|
|
@@ -6308,13 +6319,13 @@
|
|
|
6308
6319
|
this.painter && this.meshes && (this.painter.startFrame(i), this.painter.addMesh(this.meshes, null, {
|
|
6309
6320
|
bloom: 1
|
|
6310
6321
|
}), this.painter.prepareRender(i), i.polygonOffsetIndex = r++, this.painter.render(i)),
|
|
6311
|
-
this.Le && (this.
|
|
6322
|
+
this.Le && (this.Oe.startFrame(i), this.Oe.addMesh(this.Le, null, {
|
|
6312
6323
|
bloom: 1
|
|
6313
|
-
}), this.
|
|
6314
|
-
this.
|
|
6324
|
+
}), this.Oe.prepareRender(i), i.polygonOffsetIndex = r++, this.Oe.render(i)), this.Re && (this.Te.startFrame(i),
|
|
6325
|
+
this.Te.addMesh(this.Re, null, {
|
|
6315
6326
|
bloom: 1
|
|
6316
|
-
}), this.
|
|
6317
|
-
this.
|
|
6327
|
+
}), this.Te.prepareRender(i), e.options.collision && this.Te.updateCollision(i),
|
|
6328
|
+
this.Te.render(i)), this.completeRender(), this.layer.fire("canvasisdirty");
|
|
6318
6329
|
}
|
|
6319
6330
|
supportRenderMode(t) {
|
|
6320
6331
|
return "noAa" === t;
|
|
@@ -6333,7 +6344,7 @@
|
|
|
6333
6344
|
cameraPosition: this.getMap().cameraPosition,
|
|
6334
6345
|
timestamp: this.getFrameTimestamp()
|
|
6335
6346
|
};
|
|
6336
|
-
return this.un &&
|
|
6347
|
+
return this.un && F(t, this.un), t;
|
|
6337
6348
|
}
|
|
6338
6349
|
drawOnInteracting(t, n, e) {
|
|
6339
6350
|
this.draw(n, e);
|
|
@@ -6355,7 +6366,7 @@
|
|
|
6355
6366
|
} else s.visible || (this.Ne = !0), this.We(s.geometry, n), t.push(s);
|
|
6356
6367
|
}
|
|
6357
6368
|
return t.length || (this.meshes && this.painter && (this.painter.deleteMesh(this.meshes),
|
|
6358
|
-
delete this.meshes), this.Re && (this.
|
|
6369
|
+
delete this.meshes), this.Re && (this.Te.deleteMesh(this.Re), delete this.Re), this.Le && (this.Oe.deleteMesh(this.Le),
|
|
6359
6370
|
delete this.Le)), n[3] && (n[0] /= n[3], n[1] /= n[3]), {
|
|
6360
6371
|
features: t,
|
|
6361
6372
|
center: n
|
|
@@ -6451,16 +6462,16 @@
|
|
|
6451
6462
|
});
|
|
6452
6463
|
});
|
|
6453
6464
|
}
|
|
6454
|
-
|
|
6465
|
+
Fe(t) {
|
|
6455
6466
|
const n = Object.keys(this.we), i = Object.keys(this.Ae);
|
|
6456
|
-
if (!n.length && !i.length) return void (this.Re && (this.
|
|
6467
|
+
if (!n.length && !i.length) return void (this.Re && (this.Te.deleteMesh(this.Re),
|
|
6457
6468
|
delete this.Re));
|
|
6458
6469
|
const {features: r, center: s} = this.Ge(), o = [], a = [];
|
|
6459
6470
|
for (let t = 0; t < r.length; t++) {
|
|
6460
6471
|
const n = r[t][xr];
|
|
6461
6472
|
this.we[n] && o.push(r[t]), this.Ae[n] && a.push(r[t]);
|
|
6462
6473
|
}
|
|
6463
|
-
if (!o.length && !a.length) return void (this.Re && (this.
|
|
6474
|
+
if (!o.length && !a.length) return void (this.Re && (this.Te.deleteMesh(this.Re),
|
|
6464
6475
|
delete this.Re));
|
|
6465
6476
|
const l = this.Ne;
|
|
6466
6477
|
this.$e = s;
|
|
@@ -6468,14 +6479,14 @@
|
|
|
6468
6479
|
this.He = {};
|
|
6469
6480
|
const c = [], u = [];
|
|
6470
6481
|
this.Ke = !0, Promise.all(h).then(t => {
|
|
6471
|
-
if (this.Re && (this.
|
|
6472
|
-
const n = this.
|
|
6482
|
+
if (this.Re && (this.Te.deleteMesh(this.Re), delete this.Re), !t || !t.length) return void this.setToRedraw();
|
|
6483
|
+
const n = this.Te.createGeometries(t.map(t => t && t.data), this.xe);
|
|
6473
6484
|
for (let e = 0; e < n.length; e++) this.Be(n[e].geometry, t[e] && t[e].data);
|
|
6474
6485
|
const i = t[0] && t[0].data.iconAtlas, r = t[0] && t[0].data.glyphAtlas || t[1] && t[1].data.glyphAtlas;
|
|
6475
6486
|
i && (this.He.iconAtlas = i), r && (this.He.glyphAtlas = r);
|
|
6476
6487
|
const o = e.mat4.identity([]);
|
|
6477
6488
|
e.mat4.translate(o, o, e.vec3.set(u, s[0], s[1], 0)), e.mat4.scale(o, o, e.vec3.set(c, 1, 1, this.hn));
|
|
6478
|
-
const a = this.
|
|
6489
|
+
const a = this.Te.createMeshes(n, o);
|
|
6479
6490
|
for (let t = 0; t < a.length; t++) a[t].geometry.properties.originElements = a[t].geometry.properties.elements.slice(),
|
|
6480
6491
|
a[t].setUniform("level", 0), a[t].material.set("flipY", 1), a[t].properties.meshKey = gr++;
|
|
6481
6492
|
this.Re = a, l && (this.Ne = !0), this.Ke = !1, this.setToRedraw();
|
|
@@ -6505,7 +6516,7 @@
|
|
|
6505
6516
|
positionType: Float32Array,
|
|
6506
6517
|
altitudeProperty: "altitude",
|
|
6507
6518
|
defaultAltitude: 0
|
|
6508
|
-
}, s =
|
|
6519
|
+
}, s = F({}, r);
|
|
6509
6520
|
r.allowEmptyPack = 1;
|
|
6510
6521
|
return ri.splitPointSymbol(this.ke).map((e, i) => new ri(0 === i ? t : n, e, 0 === i ? r : s).load());
|
|
6511
6522
|
}
|
|
@@ -6547,7 +6558,7 @@
|
|
|
6547
6558
|
}), !0;
|
|
6548
6559
|
}
|
|
6549
6560
|
ii(t) {
|
|
6550
|
-
return this.ri(t, this.Le, this.De, this.si, this.
|
|
6561
|
+
return this.ri(t, this.Le, this.De, this.si, this.Oe, ai, mr, this.oi);
|
|
6551
6562
|
}
|
|
6552
6563
|
ri(t, n, e, i, r, s, o, a) {
|
|
6553
6564
|
if (!n) return !1;
|
|
@@ -6572,7 +6583,7 @@
|
|
|
6572
6583
|
if (e[0].geometry.properties.aFeaIds.indexOf(d) < 0) return this.ei(), this.setToRedraw(),
|
|
6573
6584
|
!1;
|
|
6574
6585
|
}
|
|
6575
|
-
const y =
|
|
6586
|
+
const y = F({}, o), m = p.map(t => this.createVectorPacks(r, s, y, t, e[0], i));
|
|
6576
6587
|
return Promise.all(m).then(t => {
|
|
6577
6588
|
for (let e = 0; e < t.length; e++) {
|
|
6578
6589
|
let i;
|
|
@@ -6603,15 +6614,15 @@
|
|
|
6603
6614
|
}), !0;
|
|
6604
6615
|
}
|
|
6605
6616
|
Ie(t) {
|
|
6606
|
-
if (!Object.keys(this._e).length) return void (this.Le && (this.
|
|
6617
|
+
if (!Object.keys(this._e).length) return void (this.Le && (this.Oe.deleteMesh(this.Le),
|
|
6607
6618
|
delete this.Le));
|
|
6608
6619
|
const {features: n, center: e} = this.Ge();
|
|
6609
6620
|
if (!n.length) return;
|
|
6610
6621
|
const i = this.Ne;
|
|
6611
6622
|
this.si = e;
|
|
6612
|
-
const r = this.oi(n), s =
|
|
6623
|
+
const r = this.oi(n), s = F({}, mr), o = r.map((n, i) => this.createMesh(this.Oe, ai, s, n, t && t[i], e));
|
|
6613
6624
|
this.ai = !0, Promise.all(o).then(t => {
|
|
6614
|
-
this.Le && this.
|
|
6625
|
+
this.Le && this.Oe.deleteMesh(this.Le);
|
|
6615
6626
|
const n = [], e = [];
|
|
6616
6627
|
for (let i = 0; i < t.length; i++) {
|
|
6617
6628
|
const r = t[i] && t[i].meshes;
|
|
@@ -6692,7 +6703,7 @@
|
|
|
6692
6703
|
}
|
|
6693
6704
|
pick(t, n, e) {
|
|
6694
6705
|
const i = [];
|
|
6695
|
-
return [ this.painter, this.
|
|
6706
|
+
return [ this.painter, this.Te, this.Oe ].forEach(r => {
|
|
6696
6707
|
if (!r) return;
|
|
6697
6708
|
const s = r.pick(t, n, e.tolerance);
|
|
6698
6709
|
if (s && s.data && s.data.feature) {
|
|
@@ -6741,14 +6752,14 @@
|
|
|
6741
6752
|
}
|
|
6742
6753
|
onGeometrySymbolChange(t) {
|
|
6743
6754
|
const n = t.target._getParent() || t.target, e = t.properties;
|
|
6744
|
-
for (const t in e) if (N(e, t) &&
|
|
6755
|
+
for (const t in e) if (N(e, t) && Fi[t]) return void this.pi(n);
|
|
6745
6756
|
const i = n[fr], r = n._getInternalSymbol(), s = this.features[i];
|
|
6746
6757
|
if (this.ni(n), s) if (function(t, n) {
|
|
6747
6758
|
return Array.isArray(t) ? !!Array.isArray(n) && t.length === n.length : !Array.isArray(n);
|
|
6748
6759
|
}(r, s)) {
|
|
6749
6760
|
if (Array.isArray(r)) for (let t = 0; t < r.length; t++) {
|
|
6750
|
-
if (!
|
|
6751
|
-
} else if (!
|
|
6761
|
+
if (!Tr(r[t], s[t])) return void this.pi(n);
|
|
6762
|
+
} else if (!Tr(r, s)) return void this.pi(n);
|
|
6752
6763
|
this.onGeometryPositionChange(t);
|
|
6753
6764
|
} else this.pi(n); else this.pi(n);
|
|
6754
6765
|
}
|
|
@@ -6810,10 +6821,10 @@
|
|
|
6810
6821
|
t && (this.canvas.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height)),
|
|
6811
6822
|
this.prepareRequestors(), this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height),
|
|
6812
6823
|
this.painter = this.createPainter();
|
|
6813
|
-
const n = cr.get3DPainterClass("icon"), e =
|
|
6814
|
-
this.
|
|
6815
|
-
const i = cr.get3DPainterClass("line"), r =
|
|
6816
|
-
this.
|
|
6824
|
+
const n = cr.get3DPainterClass("icon"), e = F({}, pr, yr);
|
|
6825
|
+
this.Te = new n(this.regl, this.layer, e, this.layer.options.sceneConfig, 0);
|
|
6826
|
+
const i = cr.get3DPainterClass("line"), r = F({}, mr);
|
|
6827
|
+
this.Oe = new i(this.regl, this.layer, r, this.layer.options.sceneConfig, 0), this.layer.getGeometries() && this.onGeometryAdd(this.layer.getGeometries());
|
|
6817
6828
|
}
|
|
6818
6829
|
createPainter() {}
|
|
6819
6830
|
nn() {
|
|
@@ -6855,13 +6866,13 @@
|
|
|
6855
6866
|
this.painter && this.painter.resize(n.width, n.height));
|
|
6856
6867
|
}
|
|
6857
6868
|
onRemove() {
|
|
6858
|
-
super.onRemove(), this.painter && this.painter.delete(), this.
|
|
6859
|
-
this.
|
|
6869
|
+
super.onRemove(), this.painter && this.painter.delete(), this.Te && this.Te.delete(),
|
|
6870
|
+
this.Oe && this.Oe.delete();
|
|
6860
6871
|
}
|
|
6861
6872
|
drawOutline(t) {
|
|
6862
|
-
if (this.bn && (this.painter && this.painter.outlineAll(t), this.
|
|
6863
|
-
this.
|
|
6864
|
-
this.
|
|
6873
|
+
if (this.bn && (this.painter && this.painter.outlineAll(t), this.Te.outlineAll(t),
|
|
6874
|
+
this.Oe.outlineAll(t)), this.gi) for (let n = 0; n < this.gi.length; n++) this.painter && this.painter.outline(t, this.gi[n]),
|
|
6875
|
+
this.Te.outline(t, this.gi[n]), this.Oe.outline(t, this.gi[n]);
|
|
6865
6876
|
}
|
|
6866
6877
|
outlineAll() {
|
|
6867
6878
|
this.bn = !0, this.setToRedraw();
|
|
@@ -6916,7 +6927,7 @@
|
|
|
6916
6927
|
for (let e = 0; e < t.length; e++) n += t[e];
|
|
6917
6928
|
return n;
|
|
6918
6929
|
}
|
|
6919
|
-
function
|
|
6930
|
+
function Tr(t, n) {
|
|
6920
6931
|
if (Object.keys(t).sort().join() !== Object.keys(n.properties || {}).filter(t => 0 === t.indexOf(vr)).map(t => t.substring(vr.length)).sort().join()) return !1;
|
|
6921
6932
|
for (const e in t) if (N(t, e)) {
|
|
6922
6933
|
const i = (vr + e).trim();
|
|
@@ -6924,7 +6935,7 @@
|
|
|
6924
6935
|
}
|
|
6925
6936
|
return !0;
|
|
6926
6937
|
}
|
|
6927
|
-
function
|
|
6938
|
+
function Or(t, n, e) {
|
|
6928
6939
|
if (!t || t.type !== n) return null;
|
|
6929
6940
|
const i = new e(t.id, t.options), s = t.geometries, o = [];
|
|
6930
6941
|
for (let t = 0; t < s.length; t++) {
|
|
@@ -6933,12 +6944,12 @@
|
|
|
6933
6944
|
}
|
|
6934
6945
|
return i.addGeometry(o), i;
|
|
6935
6946
|
}
|
|
6936
|
-
class
|
|
6947
|
+
class Fr extends cr {
|
|
6937
6948
|
static fromJSON(t) {
|
|
6938
|
-
return
|
|
6949
|
+
return Or(t, "PointLayer", Fr);
|
|
6939
6950
|
}
|
|
6940
6951
|
}
|
|
6941
|
-
|
|
6952
|
+
Fr.mergeOptions({
|
|
6942
6953
|
glyphSdfLimitPerFrame: 15,
|
|
6943
6954
|
iconErrorUrl: null,
|
|
6944
6955
|
workarounds: {
|
|
@@ -6955,8 +6966,8 @@
|
|
|
6955
6966
|
uniquePlacement: !1,
|
|
6956
6967
|
depthFunc: "always"
|
|
6957
6968
|
}
|
|
6958
|
-
}),
|
|
6959
|
-
|
|
6969
|
+
}), Fr.registerJSONType("PointLayer"), Fr.registerRenderer("canvas", null);
|
|
6970
|
+
Fr.registerRenderer("gl", class extends wr {
|
|
6960
6971
|
constructor(...t) {
|
|
6961
6972
|
super(...t), this.GeometryTypes = [ r.Marker, r.MultiPoint ];
|
|
6962
6973
|
}
|
|
@@ -6968,7 +6979,7 @@
|
|
|
6968
6979
|
});
|
|
6969
6980
|
class Ir extends cr {
|
|
6970
6981
|
static fromJSON(t) {
|
|
6971
|
-
return
|
|
6982
|
+
return Or(t, "LineStringLayer", Ir);
|
|
6972
6983
|
}
|
|
6973
6984
|
}
|
|
6974
6985
|
Ir.registerJSONType("LineStringLayer");
|
|
@@ -6979,7 +6990,7 @@
|
|
|
6979
6990
|
}), Ir.registerRenderer("canvas", null);
|
|
6980
6991
|
class Cr extends cr {
|
|
6981
6992
|
static fromJSON(t) {
|
|
6982
|
-
return
|
|
6993
|
+
return Or(t, "PolygonLayer", Cr);
|
|
6983
6994
|
}
|
|
6984
6995
|
}
|
|
6985
6996
|
Cr.registerJSONType("PolygonLayer");
|
|
@@ -7019,7 +7030,7 @@
|
|
|
7019
7030
|
if (!n.length) return;
|
|
7020
7031
|
const i = this.Ne;
|
|
7021
7032
|
this.vi = e;
|
|
7022
|
-
const r = this.xi(n), s =
|
|
7033
|
+
const r = this.xi(n), s = F({}, Er), o = r.map((n, i) => this.createMesh(this.painter, mi, s, n, t && t[i], e));
|
|
7023
7034
|
this.di = !0, Promise.all(o).then(t => {
|
|
7024
7035
|
this.meshes && this.painter.deleteMesh(this.meshes);
|
|
7025
7036
|
const n = [], e = [];
|
|
@@ -7045,7 +7056,7 @@
|
|
|
7045
7056
|
}
|
|
7046
7057
|
createPainter() {
|
|
7047
7058
|
const t = cr.get3DPainterClass("fill");
|
|
7048
|
-
this.painterSymbol =
|
|
7059
|
+
this.painterSymbol = F({}, Er);
|
|
7049
7060
|
return new t(this.regl, this.layer, this.painterSymbol, this.layer.options.sceneConfig, 0);
|
|
7050
7061
|
}
|
|
7051
7062
|
updateMesh(t) {
|
|
@@ -7368,7 +7379,7 @@
|
|
|
7368
7379
|
if (f.length) {
|
|
7369
7380
|
const t = e.getRenderer().isEnableTileStencil();
|
|
7370
7381
|
for (let e = 0; e < f.length; e++) f[e] && (h = !0, this.Pi(f[e], s, n.timestamp, Qr++, t));
|
|
7371
|
-
l.animation && (f.
|
|
7382
|
+
l.animation && (f.Ti = n.timestamp);
|
|
7372
7383
|
const i = this.Mi(n);
|
|
7373
7384
|
this.bi[i] = f;
|
|
7374
7385
|
}
|
|
@@ -7398,8 +7409,8 @@
|
|
|
7398
7409
|
if (!this._i[h]) {
|
|
7399
7410
|
let n = null, e = r.animation;
|
|
7400
7411
|
if (e) {
|
|
7401
|
-
const i = t.sceneConfig.animationDuration || 800, r = (t.timestamp - c.
|
|
7402
|
-
c.
|
|
7412
|
+
const i = t.sceneConfig.animationDuration || 800, r = (t.timestamp - c.Ti) / i, s = c[0].properties.createTime;
|
|
7413
|
+
c.Ti - s < i && r < 1 && (!0 !== e && 1 !== e || (e = "linear"), n = "linear" === e ? r : Wr(e, r),
|
|
7403
7414
|
f = !0);
|
|
7404
7415
|
}
|
|
7405
7416
|
c.forEach(t => {
|
|
@@ -7496,16 +7507,16 @@
|
|
|
7496
7507
|
zt: function(t) {
|
|
7497
7508
|
return this.bi[t];
|
|
7498
7509
|
},
|
|
7499
|
-
|
|
7510
|
+
Oi(t, n) {
|
|
7500
7511
|
if (Array.isArray(t)) t.forEach((t, e) => {
|
|
7501
7512
|
const {features: i} = t.properties;
|
|
7502
|
-
this.
|
|
7513
|
+
this.Fi(t, n[e], i);
|
|
7503
7514
|
}); else {
|
|
7504
7515
|
const {features: e} = t.properties;
|
|
7505
|
-
this.
|
|
7516
|
+
this.Fi(t, Array.isArray(n) ? n[0] : n, e);
|
|
7506
7517
|
}
|
|
7507
7518
|
},
|
|
7508
|
-
|
|
7519
|
+
Fi(t, n, e) {
|
|
7509
7520
|
const i = n.featureIndexes || n.data.featureIndexes;
|
|
7510
7521
|
if (i) if (this.Ai) {
|
|
7511
7522
|
const r = n.indices;
|
|
@@ -7638,13 +7649,13 @@
|
|
|
7638
7649
|
const {attrName: s, symbolName: o, evaluate: a} = e, l = (gs + s + "Index").trim();
|
|
7639
7650
|
let h = t.data[s];
|
|
7640
7651
|
if (!h) {
|
|
7641
|
-
if (
|
|
7652
|
+
if (Os(n[o])) {
|
|
7642
7653
|
h = t.data[s] = new e.type(e.width * r.length), ws(t, n, e);
|
|
7643
7654
|
return Ps(s, t, t.properties[l], a), h;
|
|
7644
7655
|
}
|
|
7645
7656
|
return null;
|
|
7646
7657
|
}
|
|
7647
|
-
return
|
|
7658
|
+
return Os(n[o]) ? (ws(t, n, e), h) : (h && h.buffer && h.buffer.destroy && h.buffer.destroy(),
|
|
7648
7659
|
delete t.data[s], As(t, s), null);
|
|
7649
7660
|
}
|
|
7650
7661
|
function ws(t, n, e) {
|
|
@@ -7736,7 +7747,7 @@
|
|
|
7736
7747
|
for (let t = 0; t < h; t += 2) {
|
|
7737
7748
|
const a = e[t], h = e[t + 1];
|
|
7738
7749
|
let c = s[r[a]];
|
|
7739
|
-
c && c.feature &&
|
|
7750
|
+
c && c.feature && Ts(o, c, i, a, h, l, n);
|
|
7740
7751
|
}
|
|
7741
7752
|
} else {
|
|
7742
7753
|
o = n.data[t], o.dirty = !0;
|
|
@@ -7745,12 +7756,12 @@
|
|
|
7745
7756
|
for (let t = 0; t < a; t++) {
|
|
7746
7757
|
if (r[t] === r[l] && t < a - 1) continue;
|
|
7747
7758
|
let h = s[r[l]];
|
|
7748
|
-
h && h.feature && (
|
|
7759
|
+
h && h.feature && (Ts(o, h, i, l, t === a - 1 ? a : t, e, n), l = t);
|
|
7749
7760
|
}
|
|
7750
7761
|
}
|
|
7751
7762
|
o.dirty && (n.updateData(t, o), o.dirty = !1);
|
|
7752
7763
|
}
|
|
7753
|
-
function
|
|
7764
|
+
function Ts(t, n, e, i, r, s, o) {
|
|
7754
7765
|
const a = (n = n.feature).properties || {};
|
|
7755
7766
|
void 0 === a.$layer && (n.properties || (n.properties = a), a.$layer = n.layer,
|
|
7756
7767
|
a.$type = n.type);
|
|
@@ -7767,10 +7778,10 @@
|
|
|
7767
7778
|
}
|
|
7768
7779
|
} else t[i] !== l && (fs(t, l, i, r), t.dirty = !0);
|
|
7769
7780
|
}
|
|
7770
|
-
function
|
|
7781
|
+
function Os(t) {
|
|
7771
7782
|
return t && _(t) && t.property;
|
|
7772
7783
|
}
|
|
7773
|
-
const {loginIBLResOnCanvas:
|
|
7784
|
+
const {loginIBLResOnCanvas: Fs, logoutIBLResOnCanvas: Is, getIBLResOnCanvas: Cs} = e.reshader.pbr.PBRUtils, Es = [], Hs = [], Ds = t => 0 === t.getUniform("level"), Rs = t => t.getUniform("level") > 0;
|
|
7774
7785
|
class Ls {
|
|
7775
7786
|
constructor(t, n, i, r, s, o) {
|
|
7776
7787
|
this.regl = t, this.layer = n, this.canvas = n.getRenderer().canvas, this.sceneConfig = r || {},
|
|
@@ -8020,7 +8031,7 @@
|
|
|
8020
8031
|
return delete this.Ui, this.setToRedraw(e), i;
|
|
8021
8032
|
}
|
|
8022
8033
|
Gi(t, n) {
|
|
8023
|
-
for (const e in n) if (ys(n, e) &&
|
|
8034
|
+
for (const e in n) if (ys(n, e) && Oi[e] && !Ji(n[e], t[e])) return !0;
|
|
8024
8035
|
return !1;
|
|
8025
8036
|
}
|
|
8026
8037
|
ji(t, n, e) {
|
|
@@ -8225,7 +8236,7 @@
|
|
|
8225
8236
|
}
|
|
8226
8237
|
createIBLTextures() {
|
|
8227
8238
|
const t = this.layer.getRenderer().canvas;
|
|
8228
|
-
|
|
8239
|
+
Fs(t, this.regl, this.getMap()), this.setToRedraw(!0), this.layer.fire("iblupdated");
|
|
8229
8240
|
}
|
|
8230
8241
|
disposeIBLTextures() {
|
|
8231
8242
|
const t = this.layer.getRenderer().canvas;
|
|
@@ -9011,11 +9022,11 @@
|
|
|
9011
9022
|
}
|
|
9012
9023
|
let m = t && d && 0 === d.collides, g = 1, v = !1;
|
|
9013
9024
|
if (this.sceneConfig.fading) {
|
|
9014
|
-
const t = this.
|
|
9015
|
-
if (this.
|
|
9025
|
+
const t = this.Tr(n);
|
|
9026
|
+
if (this.Or) t[r] = m ? 1 : -1; else if (u && delete n.Fr, g = this.Ir(u, m, t, r),
|
|
9016
9027
|
u ? (g > 0 && (m = !0), v = this.isBoxFading(n, r), v && this.setToRedraw()) : m || (this.Cr(t, r),
|
|
9017
9028
|
g = 0), m) {
|
|
9018
|
-
const e = n.
|
|
9029
|
+
const e = n.Fr;
|
|
9019
9030
|
if (e && 1 === g && t[r] > 0) {
|
|
9020
9031
|
let {fadeOutDelay: t, fadingDuration: n} = this.sceneConfig;
|
|
9021
9032
|
ss(n) && (n = Ks), ss(t) && (t = to);
|
|
@@ -9059,7 +9070,7 @@
|
|
|
9059
9070
|
const {frameTimestamp: e} = this.ar;
|
|
9060
9071
|
let i = this.sceneConfig.fadingDuration;
|
|
9061
9072
|
ss(i) && (i = Ks);
|
|
9062
|
-
return e - Math.abs(this.
|
|
9073
|
+
return e - Math.abs(this.Tr(t)[n]) < i;
|
|
9063
9074
|
}
|
|
9064
9075
|
Pr(t, n, e, i, r, s, o) {
|
|
9065
9076
|
const a = this.getSymbol(t.properties.symbolIndex), l = this.Er(a, t, n[i]), h = this.Rr(a, t, n[i]);
|
|
@@ -9098,7 +9109,7 @@
|
|
|
9098
9109
|
h = (a - l) / r) : (l > 0 && (e[i] = l = -(a + o)), h = 1 - (a + l) / r), (h < 0 || h > 1) && (h = is(h, 0, 1)),
|
|
9099
9110
|
h;
|
|
9100
9111
|
}
|
|
9101
|
-
|
|
9112
|
+
Tr(t) {
|
|
9102
9113
|
this.Lr || (this.Lr = {});
|
|
9103
9114
|
const {meshKey: n} = t.properties;
|
|
9104
9115
|
if (!this.Lr[n]) {
|
|
@@ -9114,7 +9125,7 @@
|
|
|
9114
9125
|
const n = this.scene.getMeshes();
|
|
9115
9126
|
if (n && n.length) {
|
|
9116
9127
|
for (let e = 0; e < n.length; e++) {
|
|
9117
|
-
const i = this.
|
|
9128
|
+
const i = this.Tr(n[e]);
|
|
9118
9129
|
i.timestamp < this.zr ? delete n[e]._fading_timestamps : i.timestamp = t;
|
|
9119
9130
|
}
|
|
9120
9131
|
this.zr = t;
|
|
@@ -9192,10 +9203,10 @@
|
|
|
9192
9203
|
const t = this.layer.getRenderer();
|
|
9193
9204
|
this.qr = this.scene.getMeshes().filter(n => !t.isForeground(n) && !n.properties.isLinePlacement);
|
|
9194
9205
|
} else n && !this.kr && (this.Kr = t.getResolution());
|
|
9195
|
-
if (n) this.Qr && (clearTimeout(this.Qr), delete this.
|
|
9206
|
+
if (n) this.Qr && (clearTimeout(this.Qr), delete this.Or, delete this.Qr), this.Or = this.Kr && t.getResolution() > this.Kr; else if (this.kr && !this.Qr) {
|
|
9196
9207
|
let {fadeOutDelay: t, fadingDuration: n} = this.sceneConfig;
|
|
9197
9208
|
ss(t) && (t = to), ss(n) && (n = Ks), this.Qr = setTimeout(() => {
|
|
9198
|
-
delete this.
|
|
9209
|
+
delete this.Or, delete this.Qr;
|
|
9199
9210
|
}, t + n + 1);
|
|
9200
9211
|
}
|
|
9201
9212
|
this.kr = n;
|
|
@@ -9255,9 +9266,9 @@
|
|
|
9255
9266
|
const e = this.layer.getRenderer(), i = e.getCurrentTileZoom(), r = e.getFrameTimestamp(), s = [];
|
|
9256
9267
|
for (let o = 0; o < this.qr.length; o++) {
|
|
9257
9268
|
const a = this.qr[o], l = a.properties.tile;
|
|
9258
|
-
!a.
|
|
9269
|
+
!a.Fr && e.isBackTile(l.id) && (a.Fr = r);
|
|
9259
9270
|
const h = l.z - i > 0 ? 2 * (l.z - i) - 1 : 2 * (i - l.z);
|
|
9260
|
-
a.properties.level = h, a.setUniform("level", h), e.isForeground(a) || a.
|
|
9271
|
+
a.properties.level = h, a.setUniform("level", h), e.isForeground(a) || a.Fr && r - a.Fr > t + n ? delete a.Fr : s.push(a);
|
|
9261
9272
|
}
|
|
9262
9273
|
delete this.qr, s.length && (this.qr = s);
|
|
9263
9274
|
}
|
|
@@ -9309,7 +9320,7 @@
|
|
|
9309
9320
|
const {uniquePlacements: o} = e.geometry.properties;
|
|
9310
9321
|
if (o) for (let t = 0; t < o.length; t++) {
|
|
9311
9322
|
if (!o[t]) continue;
|
|
9312
|
-
const {key: n, index: s} = o[t], a = this.
|
|
9323
|
+
const {key: n, index: s} = o[t], a = this.Tr(e), l = so(n, i), h = r[l];
|
|
9313
9324
|
if (h) {
|
|
9314
9325
|
const t = h.length, n = h[t - 3].properties.meshKey, i = h[t - 2], r = h[t - 1];
|
|
9315
9326
|
this.ss[n] = this.ss[n] || {}, this.ss[n][r] = 1, this.os(a, s, i, r), h.push(e, a, s);
|
|
@@ -9403,8 +9414,8 @@
|
|
|
9403
9414
|
const o = Math.sin(n), a = Math.cos(n);
|
|
9404
9415
|
return e.mat2.set(t, a, -o, o, a);
|
|
9405
9416
|
}
|
|
9406
|
-
const bo = [], wo = [], Ao = [], _o = [], Mo = [], So = [], ko = [], Po = [],
|
|
9407
|
-
function
|
|
9417
|
+
const bo = [], wo = [], Ao = [], _o = [], Mo = [], So = [], ko = [], Po = [], To = [ 1, -1 ], Oo = [ 1, 1 ];
|
|
9418
|
+
function Fo(t, n, i, r, s) {
|
|
9408
9419
|
const o = n.material.uniforms, a = s.cameraToCenterDistance, l = n.geometry.properties, h = this.getSymbol(l.symbolIndex), c = n.geometry.desc.positionSize, u = l.aAnchor, f = e.vec3.set(bo, u[i * c], u[i * c + 1], 2 === c ? 0 : u[i * c + 2]);
|
|
9409
9420
|
let d = ho(wo, f, r, s.width, s.height);
|
|
9410
9421
|
const p = d[2];
|
|
@@ -9412,26 +9423,26 @@
|
|
|
9412
9423
|
if (o.markerPerspectiveRatio) {
|
|
9413
9424
|
y = is(.5 + .5 * (1 - (1 - a / p) * o.markerPerspectiveRatio), 0, 4);
|
|
9414
9425
|
}
|
|
9415
|
-
const {aShape: m, aMarkerDx: g, aMarkerDy: v, aMarkerWidth: x, aMarkerHeight: b, aPitchAlign: w, aRotationAlign: A, aRotation: _} = l, M = g ? g[i] : h.markerDx, S = v ? v[i] : h.markerDy, k = w ? w[i] : o.pitchWithMap, P = A ? A[i] : o.rotateWithMap,
|
|
9416
|
-
let
|
|
9417
|
-
0 === o.flipY && 1 === k && (e.vec2.multiply(
|
|
9418
|
-
e.vec2.multiply(I, I,
|
|
9426
|
+
const {aShape: m, aMarkerDx: g, aMarkerDy: v, aMarkerWidth: x, aMarkerHeight: b, aPitchAlign: w, aRotationAlign: A, aRotation: _} = l, M = g ? g[i] : h.markerDx, S = v ? v[i] : h.markerDy, k = w ? w[i] : o.pitchWithMap, P = A ? A[i] : o.rotateWithMap, T = e.vec2.set(Po, M || 0, -(S || 0));
|
|
9427
|
+
let O = e.vec2.set(_o, m[2 * i] / 10, m[2 * i + 1] / 10), F = e.vec2.set(Mo, m[2 * i + 2] / 10, m[2 * i + 3] / 10), I = e.vec2.set(So, m[2 * i + 4] / 10, m[2 * i + 5] / 10), C = e.vec2.set(ko, m[2 * i + 6] / 10, m[2 * i + 7] / 10);
|
|
9428
|
+
0 === o.flipY && 1 === k && (e.vec2.multiply(O, O, To), e.vec2.multiply(F, F, To),
|
|
9429
|
+
e.vec2.multiply(I, I, To), e.vec2.multiply(C, C, To));
|
|
9419
9430
|
let E = x ? x[i] : h.markerWidth;
|
|
9420
9431
|
ss(E) && (E = 15);
|
|
9421
9432
|
let H = b ? b[i] : h.markerHeight;
|
|
9422
9433
|
ss(H) && (H = 15);
|
|
9423
|
-
const D = e.vec2.set(
|
|
9424
|
-
e.vec2.mul(
|
|
9434
|
+
const D = e.vec2.set(Oo, E / 24, H / 24);
|
|
9435
|
+
e.vec2.mul(O, O, D), e.vec2.mul(F, F, D), e.vec2.mul(I, I, D), e.vec2.mul(C, C, D);
|
|
9425
9436
|
let R = _ ? _[i] / 9362 : -(h.markerRotation || 0) * Math.PI / 180;
|
|
9426
9437
|
const L = s.getBearing() * Math.PI / 180;
|
|
9427
9438
|
if (L * P || R) {
|
|
9428
9439
|
const t = xo(Ao, R, L, P, k);
|
|
9429
|
-
|
|
9440
|
+
O = e.vec2.transformMat2(O, O, t), F = e.vec2.transformMat2(F, F, t), I = e.vec2.transformMat2(I, I, t),
|
|
9430
9441
|
C = e.vec2.transformMat2(C, C, t);
|
|
9431
9442
|
}
|
|
9432
|
-
return 1 === k ? go(t, f,
|
|
9433
|
-
e.vec2.multiply(
|
|
9434
|
-
vo(t, d,
|
|
9443
|
+
return 1 === k ? go(t, f, O, F, I, C, r, T, o, s, p, y) : (e.vec2.multiply(O, O, To),
|
|
9444
|
+
e.vec2.multiply(F, F, To), e.vec2.multiply(I, I, To), e.vec2.multiply(C, C, To),
|
|
9445
|
+
vo(t, d, O, F, I, C, T, y)), t;
|
|
9435
9446
|
}
|
|
9436
9447
|
const Io = [], Co = [], Eo = [], Ho = [], Do = [], Ro = [], Lo = [ 1, -1 ];
|
|
9437
9448
|
function No(t, n, i, r, s, o, a, l, h) {
|
|
@@ -10128,23 +10139,23 @@
|
|
|
10128
10139
|
A = (w.textSizeFn = w.textSizeFn || M(A))(c, w);
|
|
10129
10140
|
}
|
|
10130
10141
|
A /= 24;
|
|
10131
|
-
let k, P,
|
|
10132
|
-
if (_(
|
|
10133
|
-
|
|
10142
|
+
let k, P, T = h ? h(c, w) : l;
|
|
10143
|
+
if (_(T)) {
|
|
10144
|
+
T = (w.fitPaddingFn = w.fitPaddingFn || S(T))(c, w);
|
|
10134
10145
|
}
|
|
10135
|
-
if (
|
|
10146
|
+
if (T[0] === T[2] && T[1] === T[3] || (k = r.aPadOffsetX, P = r.aPadOffsetY, k || (k = r.aPadOffsetX = new Int8Array(p.length),
|
|
10136
10147
|
P = r.aPadOffsetY = new Int8Array(p.length))), delete w.$layer, delete w.$type,
|
|
10137
10148
|
p && e) {
|
|
10138
|
-
const n = Math.abs((f - s) / 10 * A) + (
|
|
10149
|
+
const n = Math.abs((f - s) / 10 * A) + (T[1] + T[3] || 0);
|
|
10139
10150
|
if (ea[0] = n, p[t] !== ea[0] && (fs(p, ea[0], t, t + 4), p.dirty = !0), k) {
|
|
10140
|
-
const n = (
|
|
10151
|
+
const n = (T[1] + T[3]) / 2 - T[3];
|
|
10141
10152
|
ia[0] = n, k[t] !== ia[0] && (fs(k, n, t, t + 4), k.dirty = !0);
|
|
10142
10153
|
}
|
|
10143
10154
|
}
|
|
10144
10155
|
if (y && i) {
|
|
10145
|
-
const n = Math.abs((d - u) / 10 * A) + (
|
|
10156
|
+
const n = Math.abs((d - u) / 10 * A) + (T[0] + T[2] || 0);
|
|
10146
10157
|
if (ea[0] = n, y[t] !== ea[0] && (fs(y, ea[0], t, t + 4), y.dirty = !0), P) {
|
|
10147
|
-
const n =
|
|
10158
|
+
const n = T[0] - (T[0] + T[2]) / 2;
|
|
10148
10159
|
ia[0] = n, P[t] !== ia[0] && (fs(P, n, t, t + 4), P.dirty = !0);
|
|
10149
10160
|
}
|
|
10150
10161
|
}
|
|
@@ -10386,10 +10397,10 @@
|
|
|
10386
10397
|
const o = i.properties.meshKey;
|
|
10387
10398
|
this.startMeshCollision(i), this.ks(i), this.forEachBox(i, this.Ss), this.Ps(i),
|
|
10388
10399
|
this.endMeshCollision(o);
|
|
10389
|
-
for (let t = 0; t < i.meshes.length; t++) this.
|
|
10400
|
+
for (let t = 0; t < i.meshes.length; t++) this.Ts(i.meshes[t]);
|
|
10390
10401
|
}
|
|
10391
10402
|
}
|
|
10392
|
-
|
|
10403
|
+
Ts(t) {
|
|
10393
10404
|
const n = t && t.geometry && t.geometry.properties.aOpacity;
|
|
10394
10405
|
n && n.dirty && (t.geometry.updateData("aOpacity", n), n.dirty = !1);
|
|
10395
10406
|
}
|
|
@@ -10399,9 +10410,9 @@
|
|
|
10399
10410
|
const i = {
|
|
10400
10411
|
boxIndex: 0
|
|
10401
10412
|
}, r = e.length;
|
|
10402
|
-
for (let s = 0; s < r; s++) this.
|
|
10413
|
+
for (let s = 0; s < r; s++) this.Os(t, e[s], n, i);
|
|
10403
10414
|
}
|
|
10404
|
-
|
|
10415
|
+
Os(t, n, i, r) {
|
|
10405
10416
|
const s = this.getMap(), {collideBoxIndex: o} = t.meshes[0].geometry.properties;
|
|
10406
10417
|
if (!o[n]) return !1;
|
|
10407
10418
|
const a = e.mat4.multiply(da, s.projViewMatrix, t.meshes[0].localTransform);
|
|
@@ -10430,7 +10441,7 @@
|
|
|
10430
10441
|
f++;
|
|
10431
10442
|
}
|
|
10432
10443
|
if (!h) return !1;
|
|
10433
|
-
return i.call(this, t, l, a, r.boxIndex++) && this.
|
|
10444
|
+
return i.call(this, t, l, a, r.boxIndex++) && this.Fs(t, n), !0;
|
|
10434
10445
|
}
|
|
10435
10446
|
ks(t) {
|
|
10436
10447
|
const n = t.meshes;
|
|
@@ -10439,7 +10450,7 @@
|
|
|
10439
10450
|
i && (i.properties.visElemts.count = 0);
|
|
10440
10451
|
}
|
|
10441
10452
|
}
|
|
10442
|
-
|
|
10453
|
+
Fs(t, n) {
|
|
10443
10454
|
const e = t.meshes;
|
|
10444
10455
|
for (let t = 0; t < e.length; t++) {
|
|
10445
10456
|
const i = e[t];
|
|
@@ -10471,7 +10482,7 @@
|
|
|
10471
10482
|
for (let e = i; e < r; e += 6) {
|
|
10472
10483
|
const i = a[u] = a[u] || [];
|
|
10473
10484
|
u++;
|
|
10474
|
-
const r =
|
|
10485
|
+
const r = Fo.call(this, i, t, n[e], s, o);
|
|
10475
10486
|
if (!h) {
|
|
10476
10487
|
const t = this.isCollides(r);
|
|
10477
10488
|
1 === t ? h = 1 : -1 === t && c++;
|
|
@@ -10616,7 +10627,7 @@
|
|
|
10616
10627
|
b.x = x.x, b.y = x.y, x.x = n[3 * v], x.y = n[3 * v + 1], w += A, A = b.dist(x) / u;
|
|
10617
10628
|
}
|
|
10618
10629
|
const _ = (g - w) / A, M = x.sub(b), S = M.mult(_).s(b);
|
|
10619
|
-
S.s(M.P().
|
|
10630
|
+
S.s(M.P().T().A(s * p));
|
|
10620
10631
|
const k = y + Math.atan2(x.y - b.y, x.x - b.x);
|
|
10621
10632
|
return t[0] = (S.x - e[0]) / u, t[1] = (S.y - e[1]) / u, t[2] = k, t;
|
|
10622
10633
|
}(t, r, o, v, g[0], g[1], x[0], x[1], x[2], i / 24, l, a);
|
|
@@ -10644,15 +10655,15 @@
|
|
|
10644
10655
|
}, Pa = function(t) {
|
|
10645
10656
|
const n = this.layer.getRenderer(), e = this.getSymbol(t.properties.symbolIndex);
|
|
10646
10657
|
return !this.cs(t) && n.isForeground(t) && "line" === e.textPlacement;
|
|
10647
|
-
},
|
|
10658
|
+
}, Ta = function(t) {
|
|
10648
10659
|
const n = this.layer.getRenderer(), e = this.getSymbol(t.properties.symbolIndex);
|
|
10649
10660
|
return !this.cs(t) && !n.isForeground(t) && "line" === e.textPlacement;
|
|
10650
|
-
},
|
|
10661
|
+
}, Oa = [], Fa = [], Ia = [], Ca = [], Ea = [], Ha = [], Da = [], Ra = [], La = [], Na = [ 1, -1 ], za = new Int16Array(2), Va = [], ja = [];
|
|
10651
10662
|
class Ua extends ro {
|
|
10652
10663
|
constructor(t, n, e, i, r) {
|
|
10653
10664
|
super(t, n, e, i, r), this.propAllowOverlap = "textAllowOverlap", this.propIgnorePlacement = "textIgnorePlacement",
|
|
10654
10665
|
this.colorCache = {}, this.Is = Sa.bind(this), this.Cs = ka.bind(this), this.Es = Pa.bind(this),
|
|
10655
|
-
this.Hs =
|
|
10666
|
+
this.Hs = Ta.bind(this), this.isLabelCollides = $o.bind(this), this.Ds();
|
|
10656
10667
|
}
|
|
10657
10668
|
Ds() {
|
|
10658
10669
|
this.Rs = [];
|
|
@@ -10762,7 +10773,7 @@
|
|
|
10762
10773
|
if (!a) return;
|
|
10763
10774
|
const l = 1 === t.material.uniforms.pitchWithMap, h = s.elements;
|
|
10764
10775
|
if (!l) {
|
|
10765
|
-
const n = e.mat4.multiply(
|
|
10776
|
+
const n = e.mat4.multiply(Oa, i.projViewMatrix, t.localTransform), r = new Array(a.length);
|
|
10766
10777
|
a = this.Gs(r, a, n, i.width, i.height);
|
|
10767
10778
|
}
|
|
10768
10779
|
const c = this.Br(), u = r.properties.visElemts = r.properties.visElemts || new h.constructor(h.length);
|
|
@@ -10788,7 +10799,7 @@
|
|
|
10788
10799
|
return this.zs[o] = a, a;
|
|
10789
10800
|
}
|
|
10790
10801
|
forEachBox(t, n) {
|
|
10791
|
-
const i = this.getMap(), r = e.mat4.multiply(
|
|
10802
|
+
const i = this.getMap(), r = e.mat4.multiply(Oa, i.projViewMatrix, t.localTransform), {collideIds: s, aCount: o, features: a, elements: l} = t.geometry.properties, h = s, c = this.isEnableUniquePlacement(), u = this.ls(1);
|
|
10792
10803
|
u[0].allElements = l, u[0].mesh = t;
|
|
10793
10804
|
let f = 0, d = l[0], p = 0, y = h[d];
|
|
10794
10805
|
for (let e = 0; e <= l.length; e += 6) if (d = l[e], h[d] !== y || e === l.length) {
|
|
@@ -10816,20 +10827,20 @@
|
|
|
10816
10827
|
let w = !0;
|
|
10817
10828
|
const A = n[i], _ = n[r - 1], M = y ? y[A] : t.properties.textSize, S = this.Bs(t, M, s, A, _, v, b, a);
|
|
10818
10829
|
if (null === S) return Ba(d, n, i, r), !1;
|
|
10819
|
-
const k = _ - A <= 3, P = t.material.uniforms,
|
|
10830
|
+
const k = _ - A <= 3, P = t.material.uniforms, T = 1 === P.pitchWithMap, O = Math.floor(S / 2), F = S % 2;
|
|
10820
10831
|
for (let o = i; o < r; o += 6) {
|
|
10821
10832
|
const a = n[o];
|
|
10822
10833
|
let h;
|
|
10823
|
-
if (h =
|
|
10834
|
+
if (h = O || o !== i || k ? O || o !== r - 6 || k ? ba.call(this, Fa, t, M, s, a, v, b, O) : ja : Va,
|
|
10824
10835
|
!h) {
|
|
10825
10836
|
w = !1, l || Ba(d, n, i, r);
|
|
10826
10837
|
break;
|
|
10827
10838
|
}
|
|
10828
10839
|
let c = h[2];
|
|
10829
|
-
|
|
10840
|
+
F && (c -= Math.PI / 2);
|
|
10830
10841
|
const u = xo(Da, c, 0, P.rotateWithMap, P.pitchWithMap);
|
|
10831
10842
|
for (let t = 0; t < 4; t++) e.vec2.set(Ra, f[2 * (a + t)] / 10, f[2 * (a + t) + 1] / 10),
|
|
10832
|
-
e.vec2.scale(Ra, Ra, M / 24), e.vec2.transformMat2(Ra, Ra, u),
|
|
10843
|
+
e.vec2.scale(Ra, Ra, M / 24), e.vec2.transformMat2(Ra, Ra, u), T ? (e.vec2.multiply(Ra, Ra, Na),
|
|
10833
10844
|
e.vec2.add(La, Ra, h)) : (e.vec2.multiply(La, h, Na), e.vec2.add(La, Ra, La)), za[0] = 10 * La[0],
|
|
10834
10845
|
za[1] = 10 * La[1], d[2 * (a + t)] === za[0] && d[2 * (a + t) + 1] === za[1] || (d.dirty = !0,
|
|
10835
10846
|
d[2 * (a + t)] = za[0], d[2 * (a + t) + 1] = za[1]);
|
|
@@ -11965,27 +11976,27 @@
|
|
|
11965
11976
|
const n = this.getSymbol({
|
|
11966
11977
|
index: 0
|
|
11967
11978
|
}), e = n.texWaveNormal, i = this.getCachedTexture(e), r = this;
|
|
11968
|
-
if (i) i.loading || (this.Po = this.
|
|
11979
|
+
if (i) i.loading || (this.Po = this.To(t, i)); else {
|
|
11969
11980
|
const n = new Image;
|
|
11970
11981
|
n.loading = !0, n.onload = function() {
|
|
11971
|
-
delete this.loading, r.Po = r.
|
|
11982
|
+
delete this.loading, r.Po = r.To(t, this), this.ko = [ this.width, this.height ],
|
|
11972
11983
|
r.setToRedraw();
|
|
11973
11984
|
}, n.onerror = () => {
|
|
11974
11985
|
console.error("invalid water wave normal texture:" + e);
|
|
11975
11986
|
}, this.addCachedTexture(e, n), n.src = e;
|
|
11976
11987
|
}
|
|
11977
11988
|
const s = n.texWavePerturbation, o = this.getCachedTexture(s);
|
|
11978
|
-
if (o) o.loading || (this.
|
|
11989
|
+
if (o) o.loading || (this.Oo = this.To(t, o)); else {
|
|
11979
11990
|
const n = new Image;
|
|
11980
11991
|
n.loading = !0, n.onload = function() {
|
|
11981
|
-
delete this.loading, r.
|
|
11992
|
+
delete this.loading, r.Oo = r.To(t, this), this.ko = [ this.width, this.height ],
|
|
11982
11993
|
r.setToRedraw();
|
|
11983
11994
|
}, n.onerror = () => {
|
|
11984
11995
|
console.error("invalid water wave perturbation texture:" + s);
|
|
11985
11996
|
}, this.addCachedTexture(s, n), n.src = s;
|
|
11986
11997
|
}
|
|
11987
11998
|
}
|
|
11988
|
-
|
|
11999
|
+
To(t, n) {
|
|
11989
12000
|
return this.So ? t.texture({
|
|
11990
12001
|
width: this.ko[0],
|
|
11991
12002
|
height: this.ko[1],
|
|
@@ -12109,7 +12120,7 @@
|
|
|
12109
12120
|
bo(t, n) {
|
|
12110
12121
|
const {iblTexes: e} = this.getIBLRes(), i = t.projViewMatrix, r = t.getLightManager();
|
|
12111
12122
|
let s = r && r.getDirectionalLight() || {};
|
|
12112
|
-
const o = r && r.getAmbientLight() || {}, a = this.getSymbol(wl), l = this.
|
|
12123
|
+
const o = r && r.getAmbientLight() || {}, a = this.getSymbol(wl), l = this.Fo = this.Fo || [], h = {
|
|
12113
12124
|
hdrHsv: o.hsv || [ 0, 0, 0 ],
|
|
12114
12125
|
specularPBR: e && e.prefilterMap,
|
|
12115
12126
|
rgbmRange: e && e.rgbmRange,
|
|
@@ -12124,7 +12135,7 @@
|
|
|
12124
12135
|
camPos: t.cameraPosition,
|
|
12125
12136
|
timeElapsed: a.animation ? (this.layer.getRenderer().getFrameTimestamp() || 0) / (1 / (a.waterSpeed || 1) * 1e4) : 0,
|
|
12126
12137
|
normalTexture: this.Po || this.So,
|
|
12127
|
-
heightTexture: this.
|
|
12138
|
+
heightTexture: this.Oo || this.So,
|
|
12128
12139
|
waveParams: [ .09, a.uvScale || 3, .03, -.5 ],
|
|
12129
12140
|
waterDir: Ml(l, a.waterDirection || 0),
|
|
12130
12141
|
waterBaseColor: a.waterBaseColor || [ .1451, .2588, .4863, 1 ],
|
|
@@ -12136,7 +12147,7 @@
|
|
|
12136
12147
|
}
|
|
12137
12148
|
delete() {
|
|
12138
12149
|
super.delete(), this.So && (this.So.destroy(), delete this.So), this.Po && this.Po.destroy(),
|
|
12139
|
-
this.
|
|
12150
|
+
this.Oo && this.Oo.destroy(), this.shader && this.shader.dispose(), this.wo && this.wo.dispose(),
|
|
12140
12151
|
this._o && (this._o.geometry.dispose(), this._o.material && this._o.material.dispose(),
|
|
12141
12152
|
this._o.dispose(), delete this._o), this.disposeIBLTextures();
|
|
12142
12153
|
}
|
|
@@ -12166,12 +12177,12 @@
|
|
|
12166
12177
|
kl.registerAt(Qi);
|
|
12167
12178
|
const Pl = ts("line-gradient", qs);
|
|
12168
12179
|
Pl.registerAt(Qi);
|
|
12169
|
-
const
|
|
12180
|
+
const Tl = ts("icon", ya);
|
|
12181
|
+
Tl.registerAt(Qi);
|
|
12182
|
+
const Ol = ts("text", Ua);
|
|
12170
12183
|
Ol.registerAt(Qi);
|
|
12171
|
-
const Fl = ts("
|
|
12184
|
+
const Fl = ts("native-line", Za);
|
|
12172
12185
|
Fl.registerAt(Qi);
|
|
12173
|
-
const Tl = ts("native-line", Za);
|
|
12174
|
-
Tl.registerAt(Qi);
|
|
12175
12186
|
ts("native-point", Ya).registerAt(Qi);
|
|
12176
12187
|
const Il = ts("phong", il);
|
|
12177
12188
|
Il.registerAt(Qi);
|
|
@@ -12264,7 +12275,7 @@
|
|
|
12264
12275
|
const Ll = ts("water", _l);
|
|
12265
12276
|
Ll.registerAt(Qi), cr.registerPainter("lit", ll), cr.registerPainter("icon", ya),
|
|
12266
12277
|
cr.registerPainter("fill", Ws), cr.registerPainter("line", Xs), cr.registerPainter("line-gradient", qs),
|
|
12267
|
-
cr.registerPainter("water", _l), Qi.VERSION = "0.63.
|
|
12278
|
+
cr.registerPainter("water", _l), Qi.VERSION = "0.63.4", cr.VERSION = "0.63.4";
|
|
12268
12279
|
if (s.mat4.create(), s.transcoders) {
|
|
12269
12280
|
const t = r.Map.VERSION;
|
|
12270
12281
|
if (t.indexOf("1.0.0-beta") >= 0 || t.indexOf("1.0.0-alpha") >= 0) {
|
|
@@ -12275,14 +12286,14 @@
|
|
|
12275
12286
|
}));
|
|
12276
12287
|
} else r.registerWorkerAdapter("@maptalks/vt", o);
|
|
12277
12288
|
t.FillPainter = Ws, t.FillPlugin = Sl, t.GLTFPhongPlugin = Hl, t.GLTFStandardPlugin = Dl,
|
|
12278
|
-
t.GeoJSONVectorTileLayer = ar, t.HeatmapPlugin = Rl, t.IconPainter = ya, t.IconPlugin =
|
|
12289
|
+
t.GeoJSONVectorTileLayer = ar, t.HeatmapPlugin = Rl, t.IconPainter = ya, t.IconPlugin = Tl,
|
|
12279
12290
|
t.LineGradientPlugin = Pl, t.LinePainter = Xs, t.LinePlugin = kl, t.LineStringLayer = Ir,
|
|
12280
|
-
t.LitPlugin = El, t.MapboxVectorTileLayer = sr, t.NativeLinePainter = Za, t.NativeLinePlugin =
|
|
12291
|
+
t.LitPlugin = El, t.MapboxVectorTileLayer = sr, t.NativeLinePainter = Za, t.NativeLinePlugin = Fl,
|
|
12281
12292
|
t.NativePointPainter = Ya, t.PackUtil = Pi, t.PhongPainter = il, t.PhongPlugin = Il,
|
|
12282
|
-
t.PointLayer =
|
|
12283
|
-
t.TextPainter = Ua, t.TextPlugin =
|
|
12293
|
+
t.PointLayer = Fr, t.PolygonLayer = Cr, t.SYMBOLS_NEED_REBUILD_IN_VECTOR = Fi, t.SYMBOLS_NEED_REBUILD_IN_VT = Oi,
|
|
12294
|
+
t.TextPainter = Ua, t.TextPlugin = Ol, t.Vector3DLayer = cr, t.VectorTileLayer = Qi,
|
|
12284
12295
|
t.VectorTileLayerRenderer = ji, t.WaterPlugin = Ll, t.WireframePainter = sl, t.WireframePlugin = Cl,
|
|
12285
12296
|
Object.defineProperty(t, "t", {
|
|
12286
12297
|
value: !0
|
|
12287
|
-
}), "undefined" != typeof console && console.log("@maptalks/vt v0.63.
|
|
12298
|
+
}), "undefined" != typeof console && console.log("@maptalks/vt v0.63.4");
|
|
12288
12299
|
}));
|