Last active
June 3, 2022 23:05
-
-
Save AlanPew/1cb7f76d22991db3872ccd178d1de9e2 to your computer and use it in GitHub Desktop.
infra test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Open Infrastructure Map</title> | |
<meta name="twitter:card" content="summary"> | |
<meta name="twitter:site" content="@openinframap"> | |
<meta name="twitter:creator" content="@russss"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<meta name="description" content="Map of the world's electricity, telecoms, oil, and gas infrastructure, using data from OpenStreetMap"> | |
<meta property="og:description" content="Map of the world's electricity, telecoms, oil, and gas infrastructure, using data from OpenStreetMap"> | |
<meta property="og:title" content="Open Infrastructure Map"> | |
<link rel="canonical" href="https://openinframap.org"> | |
<script defer="defer" src="main.44114679bea524683b3e.js"></script> | |
</head> | |
<body> | |
<noscript>You must have Javascript enabled to view Open Infrastructure Map</noscript> | |
<div id="container" style="display:none"> | |
<header> | |
<h1>Open Infrastructure Map</h1> | |
<a href="/about">about</a> | |
| <a href="/stats">stats</a> | |
</header> | |
<div id="map"></div> | |
</div> | |
</body> | |
</html> |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(()=>{ | |
var t = { | |
4815: (t,e,r)=>{ | |
"use strict"; | |
var i = r(3379) | |
, n = r.n(i) | |
, o = r(7795) | |
, a = r.n(o) | |
, s = r(569) | |
, l = r.n(s) | |
, u = r(3565) | |
, c = r.n(u) | |
, p = r(9216) | |
, h = r.n(p) | |
, f = r(4589) | |
, d = r.n(f) | |
, m = r(1424) | |
, y = {}; | |
y.styleTagTransform = d(), | |
y.setAttributes = c(), | |
y.insert = l().bind(null, "head"), | |
y.domAPI = a(), | |
y.insertStyleElement = h(), | |
n()(m.Z, y), | |
m.Z && m.Z.locals && m.Z.locals; | |
var g = r(2054) | |
, v = {}; | |
v.styleTagTransform = d(), | |
v.setAttributes = c(), | |
v.insert = l().bind(null, "head"), | |
v.domAPI = a(), | |
v.insertStyleElement = h(), | |
n()(g.Z, v), | |
g.Z && g.Z.locals && g.Z.locals; | |
var _ = r(2739) | |
, x = r.n(_); | |
function b(t, e) { | |
var r = function(t) { | |
for (var e = t.split(/([#.])/), r = "", i = "", n = [], o = 0; o < e.length; o++) { | |
var a = e[o]; | |
"#" === a ? i = e[++o] : "." === a ? n.push(e[++o]) : a.length && (r = a) | |
} | |
return { | |
tag: r || "div", | |
id: i, | |
className: n.join(" ") | |
} | |
}(t) | |
, i = r.tag | |
, n = r.id | |
, o = r.className | |
, a = e ? document.createElementNS(e, i) : document.createElement(i); | |
return n && (a.id = n), | |
o && (e ? a.setAttribute("class", o) : a.className = o), | |
a | |
} | |
function w(t, e) { | |
var r = O(t) | |
, i = O(e); | |
return e === i && i.__redom_view && (e = i.__redom_view), | |
i.parentNode && (E(0, i, r), | |
r.removeChild(i)), | |
e | |
} | |
function E(t, e, r) { | |
var i = e.__redom_lifecycle; | |
if (C(i)) | |
e.__redom_lifecycle = {}; | |
else { | |
var n = r; | |
for (e.__redom_mounted && k(e, "onunmount"); n; ) { | |
var o = n.__redom_lifecycle || {}; | |
for (var a in i) | |
o[a] && (o[a] -= i[a]); | |
C(o) && (n.__redom_lifecycle = null), | |
n = n.parentNode | |
} | |
} | |
} | |
function C(t) { | |
if (null == t) | |
return !0; | |
for (var e in t) | |
if (t[e]) | |
return !1; | |
return !0 | |
} | |
var A = ["onmount", "onremount", "onunmount"] | |
, z = "undefined" != typeof window && "ShadowRoot"in window; | |
function S(t, e, r, i) { | |
var n = O(t) | |
, o = O(e); | |
e === o && o.__redom_view && (e = o.__redom_view), | |
e !== o && (o.__redom_view = e); | |
var a = o.__redom_mounted | |
, s = o.parentNode; | |
return a && s !== n && E(0, o, s), | |
null != r ? i ? n.replaceChild(o, O(r)) : n.insertBefore(o, O(r)) : n.appendChild(o), | |
function(t, e, r, i) { | |
for (var n = e.__redom_lifecycle || (e.__redom_lifecycle = {}), o = r === i, a = !1, s = 0, l = A; s < l.length; s += 1) { | |
var u = l[s]; | |
o || t !== e && u in t && (n[u] = (n[u] || 0) + 1), | |
n[u] && (a = !0) | |
} | |
if (a) { | |
var c = r | |
, p = !1; | |
for ((o || c && c.__redom_mounted) && (k(e, o ? "onremount" : "onmount"), | |
p = !0); c; ) { | |
var h = c.parentNode | |
, f = c.__redom_lifecycle || (c.__redom_lifecycle = {}); | |
for (var d in n) | |
f[d] = (f[d] || 0) + n[d]; | |
if (p) | |
break; | |
(c.nodeType === Node.DOCUMENT_NODE || z && c instanceof ShadowRoot || h && h.__redom_mounted) && (k(c, o ? "onremount" : "onmount"), | |
p = !0), | |
c = h | |
} | |
} else | |
e.__redom_lifecycle = {} | |
}(e, o, n, s), | |
e | |
} | |
function k(t, e) { | |
"onmount" === e || "onremount" === e ? t.__redom_mounted = !0 : "onunmount" === e && (t.__redom_mounted = !1); | |
var r = t.__redom_lifecycle; | |
if (r) { | |
var i = t.__redom_view | |
, n = 0; | |
for (var o in i && i[e] && i[e](), | |
r) | |
o && n++; | |
if (n) | |
for (var a = t.firstChild; a; ) { | |
var s = a.nextSibling; | |
k(a, e), | |
a = s | |
} | |
} | |
} | |
function T(t, e, r) { | |
var i = O(t); | |
if ("object" == typeof e) | |
for (var n in e) | |
D(i, n, e[n]); | |
else | |
D(i, e, r) | |
} | |
function D(t, e, r) { | |
t.style[e] = null == r ? "" : r | |
} | |
var I = "http://www.w3.org/1999/xlink"; | |
function F(t, e, r, i) { | |
var n = O(t); | |
if ("object" == typeof e) | |
for (var o in e) | |
F(n, o, e[o], i); | |
else { | |
var a = n instanceof SVGElement | |
, s = "function" == typeof r; | |
if ("style" === e && "object" == typeof r) | |
T(n, r); | |
else if (a && s) | |
n[e] = r; | |
else if ("dataset" === e) | |
P(n, r); | |
else if (a || !(e in n) && !s || "list" === e) { | |
if (a && "xlink" === e) | |
return void B(n, r); | |
i && "class" === e && (r = n.className + " " + r), | |
null == r ? n.removeAttribute(e) : n.setAttribute(e, r) | |
} else | |
n[e] = r | |
} | |
} | |
function B(t, e, r) { | |
if ("object" == typeof e) | |
for (var i in e) | |
B(t, i, e[i]); | |
else | |
null != r ? t.setAttributeNS(I, e, r) : t.removeAttributeNS(I, e, r) | |
} | |
function P(t, e, r) { | |
if ("object" == typeof e) | |
for (var i in e) | |
P(t, i, e[i]); | |
else | |
null != r ? t.dataset[e] = r : delete t.dataset[e] | |
} | |
function M(t) { | |
return document.createTextNode(null != t ? t : "") | |
} | |
function L(t, e, r) { | |
for (var i = 0, n = e; i < n.length; i += 1) { | |
var o = n[i]; | |
if (0 === o || o) { | |
var a = typeof o; | |
"function" === a ? o(t) : "string" === a || "number" === a ? t.appendChild(M(o)) : U(O(o)) ? S(t, o) : o.length ? L(t, o, r) : "object" === a && F(t, o, null, r) | |
} | |
} | |
} | |
function R(t) { | |
return "string" == typeof t ? j(t) : O(t) | |
} | |
function O(t) { | |
return t.nodeType && t || !t.el && t || O(t.el) | |
} | |
function U(t) { | |
return t && t.nodeType | |
} | |
var V = {}; | |
function j(t) { | |
for (var e, r = [], i = arguments.length - 1; i-- > 0; ) | |
r[i] = arguments[i + 1]; | |
var n = typeof t; | |
if ("string" === n) | |
e = q(t).cloneNode(!1); | |
else if (U(t)) | |
e = t.cloneNode(!1); | |
else { | |
if ("function" !== n) | |
throw new Error("At least one argument required"); | |
var o = t; | |
e = new (Function.prototype.bind.apply(o, [null].concat(r))) | |
} | |
return L(O(e), r, !0), | |
e | |
} | |
var N = j; | |
function q(t) { | |
return V[t] || (V[t] = b(t)) | |
} | |
function G(t) { | |
for (var e = [], r = arguments.length - 1; r-- > 0; ) | |
e[r] = arguments[r + 1]; | |
for (var i = O(t), n = Z(t, e, i.firstChild); n; ) { | |
var o = n.nextSibling; | |
w(t, n), | |
n = o | |
} | |
} | |
function Z(t, e, r) { | |
for (var i = r, n = new Array(e.length), o = 0; o < e.length; o++) | |
n[o] = e[o] && O(e[o]); | |
for (var a = 0; a < e.length; a++) { | |
var s = e[a]; | |
if (s) { | |
var l = n[a]; | |
if (l !== i) | |
if (U(l)) { | |
var u = i && i.nextSibling | |
, c = null != s.__redom_index && u === n[a + 1]; | |
S(t, s, i, c), | |
c && (i = u) | |
} else | |
null != s.length && (i = Z(t, s, i)); | |
else | |
i = i.nextSibling | |
} | |
} | |
return i | |
} | |
j.extend = function(t) { | |
for (var e = [], r = arguments.length - 1; r-- > 0; ) | |
e[r] = arguments[r + 1]; | |
var i = q(t); | |
return j.bind.apply(j, [this, i].concat(e)) | |
} | |
; | |
var X = function(t, e, r) { | |
this.View = t, | |
this.initData = r, | |
this.oldLookup = {}, | |
this.lookup = {}, | |
this.oldViews = [], | |
this.views = [], | |
null != e && (this.key = "function" == typeof e ? e : function(t) { | |
return function(e) { | |
return e[t] | |
} | |
}(e)) | |
}; | |
function W(t, e, r, i) { | |
return new H(t,e,r,i) | |
} | |
X.prototype.update = function(t, e) { | |
for (var r = this, i = r.View, n = r.key, o = r.initData, a = null != n, s = this.lookup, l = {}, u = new Array(t.length), c = this.views, p = 0; p < t.length; p++) { | |
var h = t[p] | |
, f = void 0; | |
if (a) { | |
var d = n(h); | |
f = s[d] || new i(o,h,p,t), | |
l[d] = f, | |
f.__redom_id = d | |
} else | |
f = c[p] || new i(o,h,p,t); | |
f.update && f.update(h, p, t, e), | |
O(f.el).__redom_view = f, | |
u[p] = f | |
} | |
this.oldViews = c, | |
this.views = u, | |
this.oldLookup = s, | |
this.lookup = l | |
} | |
; | |
var H = function(t, e, r, i) { | |
this.View = e, | |
this.initData = i, | |
this.views = [], | |
this.pool = new X(e,r,i), | |
this.el = R(t), | |
this.keySet = null != r | |
}; | |
H.prototype.update = function(t, e) { | |
void 0 === t && (t = []); | |
var r = this.keySet | |
, i = this.views; | |
this.pool.update(t, e); | |
var n = this.pool | |
, o = n.views | |
, a = n.lookup; | |
if (r) | |
for (var s = 0; s < i.length; s++) { | |
var l = i[s]; | |
null == a[l.__redom_id] && (l.__redom_index = null, | |
w(this, l)) | |
} | |
for (var u = 0; u < o.length; u++) | |
o[u].__redom_index = u; | |
G(this, o), | |
r && (this.lookup = a), | |
this.views = o | |
} | |
, | |
H.extend = function(t, e, r, i) { | |
return H.bind(H, t, e, r, i) | |
} | |
, | |
W.extend = H.extend; | |
var K = "http://www.w3.org/2000/svg" | |
, J = {}; | |
function Y(t) { | |
for (var e, r = [], i = arguments.length - 1; i-- > 0; ) | |
r[i] = arguments[i + 1]; | |
var n = typeof t; | |
if ("string" === n) | |
e = $(t).cloneNode(!1); | |
else if (U(t)) | |
e = t.cloneNode(!1); | |
else { | |
if ("function" !== n) | |
throw new Error("At least one argument required"); | |
var o = t; | |
e = new (Function.prototype.bind.apply(o, [null].concat(r))) | |
} | |
return L(O(e), r, !0), | |
e | |
} | |
function $(t) { | |
return J[t] || (J[t] = b(t, K)) | |
} | |
Y.extend = function(t) { | |
var e = $(t); | |
return Y.bind(this, e) | |
} | |
, | |
Y.ns = K; | |
var Q = r(6668) | |
, tt = r.n(Q) | |
, et = r(2307) | |
, rt = r.n(et); | |
class it { | |
constructor(t, e=[]) { | |
this._layers = t, | |
this._identifiers = this._initLayerIdentifiers(), | |
this._default_visible = e, | |
this._container = N("div", { | |
class: "mapboxgl-ctrl layer-switcher-list" | |
}), | |
this._container.appendChild(N("h3", "Layers")), | |
this._visible = [...e] | |
} | |
_initLayerIdentifiers() { | |
let t = {}; | |
return Object.keys(this._layers).sort().forEach((e=>{ | |
let r = 1 | |
, i = null; | |
do { | |
i = e.slice(0, r), | |
r++ | |
} while (i in t); | |
t[i] = e | |
} | |
)), | |
t | |
} | |
_getLayerIdentifiers() { | |
let t = [] | |
, e = tt()(this._identifiers); | |
return this._visible.sort().forEach((r=>{ | |
t.push(e[r]) | |
} | |
)), | |
t | |
} | |
_updateVisibility() { | |
var t = this._map.getStyle().layers; | |
for (let e of t) { | |
let t = e.id; | |
for (let e in this._layers) { | |
let r = this._layers[e]; | |
t.startsWith(r) && (this._visible.includes(e) ? this._map.setLayoutProperty(t, "visibility", "visible") : this._map.setLayoutProperty(t, "visibility", "none")) | |
} | |
} | |
this.urlhash && this.urlhash._updateHash() | |
} | |
setInitialVisibility(t) { | |
for (let e of t.layers) | |
for (let t in this._layers) { | |
let r = this._layers[t]; | |
e.id.startsWith(r) && !this._visible.includes(e.id) && ("layout"in e || (e.layout = {}), | |
e.layout.visibility = "none") | |
} | |
} | |
getURLString() { | |
return rt()(this._visible.sort(), this._default_visible.sort()) ? null : this._getLayerIdentifiers().join(",") | |
} | |
setURLString(t) { | |
if (t) { | |
const e = t.split(","); | |
0 == e.length ? this._visible = [...this._default_visible] : this._visible = e.map((t=>this._identifiers[t])).filter((t=>t)) | |
} else | |
this._visible = [...this._default_visible]; | |
this._map && this._updateVisibility() | |
} | |
onAdd(t) { | |
this._map = t, | |
t.isStyleLoaded() ? this._updateVisibility() : t.on("load", (()=>{ | |
this._updateVisibility() | |
} | |
)), | |
this._createList(); | |
const e = N("div", { | |
class: "mapboxgl-ctrl mapboxgl-ctrl-group layer-switcher" | |
}); | |
return e.appendChild(this._container), | |
e.onmouseover = t=>{ | |
this._container.style.display = "block" | |
} | |
, | |
e.onmouseout = t=>{ | |
this._container.style.display = "none" | |
} | |
, | |
e | |
} | |
_createList() { | |
var t = N("ul") | |
, e = 0; | |
for (let r in this._layers) { | |
let i = N("input", { | |
type: "checkbox", | |
id: "layer" + e, | |
checked: this._visible.includes(r) | |
}) | |
, n = N("label", r, { | |
for: "layer" + e | |
}); | |
i.onchange = t=>{ | |
t.target.checked ? this._visible.push(r) : this._visible = this._visible.filter((t=>t !== r)), | |
this._updateVisibility() | |
} | |
; | |
let o = N("li", [n, i]); | |
t.appendChild(o), | |
e++ | |
} | |
this._container.appendChild(t) | |
} | |
} | |
function nt(t, e) { | |
for (var r = 0; r < e.length; r++) { | |
var i = e[r]; | |
i.enumerable = i.enumerable || !1, | |
i.configurable = !0, | |
"value"in i && (i.writable = !0), | |
Object.defineProperty(t, i.key, i) | |
} | |
} | |
var ot = function() { | |
function t() { | |
!function(t, e) { | |
if (!(t instanceof e)) | |
throw new TypeError("Cannot call a class as a function") | |
}(this, t) | |
} | |
var e, r; | |
return e = t, | |
(r = [{ | |
key: "onAdd", | |
value: function(t) { | |
var e = this; | |
this._map = t; | |
var r = N("button", "Edit in JOSM"); | |
return r.onclick = function(t) { | |
e._click(), | |
t.preventDefault() | |
} | |
, | |
this._control = N("div", r, { | |
class: "maplibregl-ctrl" | |
}), | |
t.on("zoomend", (function() { | |
e.updateVisibility() | |
} | |
)), | |
this.updateVisibility(), | |
this._control | |
} | |
}, { | |
key: "updateVisibility", | |
value: function() { | |
this._map.getZoom() > 14 ? T(this._control, { | |
display: "block" | |
}) : T(this._control, { | |
display: "none" | |
}) | |
} | |
}, { | |
key: "_getJosmURL", | |
value: function() { | |
var t = this._map.getBounds(); | |
return "http://127.0.0.1:8111/load_and_zoom?left=" + t.getWest() + "&right=" + t.getEast() + "&top=" + t.getNorth() + "&bottom=" + t.getSouth() | |
} | |
}, { | |
key: "_click", | |
value: function() { | |
var t = this._getJosmURL(); | |
fetch(t).catch((function(t) { | |
alert("Unable to edit in JOSM - make sure it's running and has remote control enabled.\nError: " + t) | |
} | |
)) | |
} | |
}]) && nt(e.prototype, r), | |
t | |
}(); | |
function at(t, e) { | |
for (var r = 0; r < e.length; r++) { | |
var i = e[r]; | |
i.enumerable = i.enumerable || !1, | |
i.configurable = !0, | |
"value"in i && (i.writable = !0), | |
Object.defineProperty(t, i.key, i) | |
} | |
} | |
var st = function() { | |
function t() { | |
!function(t, e) { | |
if (!(t instanceof e)) | |
throw new TypeError("Cannot call a class as a function") | |
}(this, t) | |
} | |
var e, r; | |
return e = t, | |
(r = [{ | |
key: "onAdd", | |
value: function(t) { | |
this._map = t; | |
var e = N("a", N("img", { | |
src: "img/maptiler.png" | |
}), { | |
href: "https://www.maptiler.com", | |
target: "_blank" | |
}); | |
return this._control = N("div#maptiler-attribution", e, { | |
class: "maplibregl-ctrl" | |
}), | |
this._control | |
} | |
}]) && at(e.prototype, r), | |
t | |
}(); | |
function lt(t, e) { | |
for (var r = 0; r < e.length; r++) { | |
var i = e[r]; | |
i.enumerable = i.enumerable || !1, | |
i.configurable = !0, | |
"value"in i && (i.writable = !0), | |
Object.defineProperty(t, i.key, i) | |
} | |
} | |
const ut = function() { | |
function t(e) { | |
var r = this; | |
!function(t, e) { | |
if (!(t instanceof e)) | |
throw new TypeError("Cannot call a class as a function") | |
}(this, t), | |
this.content = N("div", { | |
class: "infobox-content" | |
}); | |
var i = N("a", "×") | |
, n = N("div", e, i, { | |
class: "infobox-header" | |
}); | |
this.el = N("div", n, this.content, { | |
class: "infobox" | |
}), | |
i.onclick = function(t) { | |
w(document.body, r.el), | |
t.preventDefault() | |
} | |
} | |
var e, r; | |
return e = t, | |
(r = [{ | |
key: "update", | |
value: function(t) { | |
this.content.innerHTML = t | |
} | |
}]) && lt(e.prototype, r), | |
t | |
}(); | |
var ct = r(2021) | |
, pt = {}; | |
pt.styleTagTransform = d(), | |
pt.setAttributes = c(), | |
pt.insert = l().bind(null, "head"), | |
pt.domAPI = a(), | |
pt.insertStyleElement = h(), | |
n()(ct.Z, pt), | |
ct.Z && ct.Z.locals && ct.Z.locals; | |
var ht = r(333) | |
, ft = r.n(ht) | |
, dt = r(1144) | |
, mt = r.n(dt) | |
, yt = ["en", "es", "de", "fr", "hi", "ur", "zh", "ru", "pt", "ja"] | |
, gt = mt().list().filter((function(t) { | |
return yt.includes(t) | |
} | |
)).map((function(t) { | |
return "name_".concat(t) | |
} | |
)).concat(["name"]); | |
function vt(t, e) { | |
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"]; | |
if (!r) { | |
if (Array.isArray(t) || (r = function(t, e) { | |
if (t) { | |
if ("string" == typeof t) | |
return _t(t, e); | |
var r = Object.prototype.toString.call(t).slice(8, -1); | |
return "Object" === r && t.constructor && (r = t.constructor.name), | |
"Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _t(t, e) : void 0 | |
} | |
}(t)) || e && t && "number" == typeof t.length) { | |
r && (t = r); | |
var i = 0 | |
, n = function() {}; | |
return { | |
s: n, | |
n: function() { | |
return i >= t.length ? { | |
done: !0 | |
} : { | |
done: !1, | |
value: t[i++] | |
} | |
}, | |
e: function(t) { | |
throw t | |
}, | |
f: n | |
} | |
} | |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") | |
} | |
var o, a = !0, s = !1; | |
return { | |
s: function() { | |
r = r.call(t) | |
}, | |
n: function() { | |
var t = r.next(); | |
return a = t.done, | |
t | |
}, | |
e: function(t) { | |
s = !0, | |
o = t | |
}, | |
f: function() { | |
try { | |
a || null == r.return || r.return() | |
} finally { | |
if (s) | |
throw o | |
} | |
} | |
} | |
} | |
function _t(t, e) { | |
(null == e || e > t.length) && (e = t.length); | |
for (var r = 0, i = new Array(e); r < e; r++) | |
i[r] = t[r]; | |
return i | |
} | |
function xt(t, e) { | |
for (var r = 0; r < e.length; r++) { | |
var i = e[r]; | |
i.enumerable = i.enumerable || !1, | |
i.configurable = !0, | |
"value"in i && (i.writable = !0), | |
Object.defineProperty(t, i.key, i) | |
} | |
} | |
var bt = ["osm_id", "name", "wikidata", "wikipedia", "construction", "tunnel", "is_node", "area", "gid", "ref_len"] | |
, wt = function() { | |
function t(e, r) { | |
!function(t, e) { | |
if (!(t instanceof e)) | |
throw new TypeError("Cannot call a class as a function") | |
}(this, t), | |
this.layers = e, | |
this.min_zoom = r, | |
this.popup_obj = null | |
} | |
var e, r; | |
return e = t, | |
(r = [{ | |
key: "add", | |
value: function(t) { | |
var e = this; | |
this._map = t; | |
var r, i = vt(this.layers); | |
try { | |
for (i.s(); !(r = i.n()).done; ) { | |
var n = r.value; | |
t.on("click", n, (function(t) { | |
e._map.getZoom() > e.min_zoom && e.popup(t) | |
} | |
)), | |
t.on("mouseenter", n, (function() { | |
e._map.getZoom() > e.min_zoom && (t.getCanvas().style.cursor = "pointer") | |
} | |
)), | |
t.on("mouseleave", n, (function() { | |
e._map.getZoom() > e.min_zoom && (t.getCanvas().style.cursor = "") | |
} | |
)) | |
} | |
} catch (t) { | |
i.e(t) | |
} finally { | |
i.f() | |
} | |
} | |
}, { | |
key: "osmLink", | |
value: function(t, e) { | |
var r = "" | |
, i = ""; | |
return t > 0 ? e ? (r = "https://openstreetmap.org/node/".concat(t), | |
i = "Node ".concat(t)) : (r = "https://openstreetmap.org/way/".concat(t), | |
i = "Way ".concat(t)) : (r = "https://openstreetmap.org/relation/".concat(-t), | |
i = "Relation ".concat(-t)), | |
N("a", i, { | |
href: r, | |
target: "_blank" | |
}) | |
} | |
}, { | |
key: "renderKey", | |
value: function(t, e, r) { | |
if (bt.includes(t) || t.startsWith("name_")) | |
return null; | |
if (!e) | |
return null; | |
if (t.startsWith("voltage") && (e = "".concat(Number(parseFloat(e).toFixed(2)), " kV")), | |
"output" == t) { | |
var i = parseFloat(e); | |
e = i < 1 ? "".concat((1e3 * i).toFixed(2), " kW") : "".concat(i.toFixed(2), " MW") | |
} | |
return "frequency" == t && "0" == e && (e = "DC"), | |
"url" == t && (e = N("a", "Website", { | |
href: e, | |
target: "_blank" | |
}), | |
t = "Website"), | |
"repd_id" == t ? (t = "REPD ID", | |
e = e.split(";").map((function(t) { | |
return N("span", N("a", t, { | |
href: "https://repd.russss.dev/repd/repd/".concat(t), | |
target: "_blank" | |
}), M(", ")) | |
} | |
))) : t = ft()(t), | |
N("tr", N("th", t), N("td", e)) | |
} | |
}, { | |
key: "nameTags", | |
value: function(t) { | |
var e, r = "", i = vt(gt); | |
try { | |
for (i.s(); !(e = i.n()).done; ) { | |
var n = e.value; | |
if (t.properties[n]) { | |
r = t.properties[n]; | |
break | |
} | |
} | |
} catch (t) { | |
i.e(t) | |
} finally { | |
i.f() | |
} | |
r || (r = t.layer.id); | |
var o = N("div.nameContainer", N("h3", r)); | |
return t.properties.name && r != t.properties.name && S(o, N("h4", t.properties.name)), | |
o | |
} | |
}, { | |
key: "popupHtml", | |
value: function(t) { | |
var e = this | |
, r = N("table", { | |
class: "item_info" | |
}); | |
G(r, Object.keys(t.properties).sort().map((function(r) { | |
return e.renderKey(r, t.properties[r], t.properties) | |
} | |
))); | |
var i = N("div"); | |
t.properties.osm_id && S(i, N("a", N("div.ext_link.osm_link"), { | |
href: this.osmLink(t.properties.osm_id, t.properties.is_node), | |
target: "_blank", | |
title: "OpenStreetMap" | |
})); | |
var n = null; | |
if (t.properties.wikidata) | |
n = N("div"), | |
this.fetch_wikidata(t.properties.wikidata, n, i); | |
else { | |
var o = this.wp_link(t.properties.wikipedia); | |
o && S(i, o) | |
} | |
var a = N("div", this.nameTags(t), i, n, r); | |
return t.layer.id.startsWith("power_plant") && S(a, N("a", "More info", { | |
href: "/stats/object/plant/" + t.properties.osm_id, | |
target: "_blank" | |
})), | |
a | |
} | |
}, { | |
key: "popup", | |
value: function(t) { | |
this.popup_obj && this.popup_obj.isOpen() && this.popup_obj.remove(), | |
this.popup_obj = (new (x().Popup)).setLngLat(t.lngLat).setDOMContent(this.popupHtml(t.features[0])).addTo(this._map) | |
} | |
}, { | |
key: "fetch_wikidata", | |
value: function(t, e, r) { | |
fetch("https://openinframap.org/wikidata/".concat(t)).then((function(t) { | |
return t.json() | |
} | |
)).then((function(i) { | |
i.thumbnail && S(e, N("a", N("img.wikidata_image", { | |
src: i.thumbnail | |
}), { | |
href: "https://commons.wikimedia.org/wiki/File:".concat(i.image), | |
target: "_blank" | |
})); | |
var n = mt().list(); | |
n.push("en"); | |
var o, a = vt(n); | |
try { | |
for (a.s(); !(o = a.n()).done; ) { | |
var s = o.value; | |
if (i.sitelinks["".concat(s, "wiki")]) { | |
S(r, N("a", N("div.ext_link.wikipedia_link"), { | |
href: i.sitelinks["".concat(s, "wiki")].url, | |
target: "_blank", | |
title: "Wikipedia" | |
})); | |
break | |
} | |
} | |
} catch (t) { | |
a.e(t) | |
} finally { | |
a.f() | |
} | |
i.sitelinks.commonswiki && S(r, N("a", N("div.ext_link.commons_link"), { | |
href: i.sitelinks.commonswiki.url, | |
target: "_blank", | |
title: "Wikimedia Commons" | |
})), | |
S(r, N("a", N("div.ext_link.wikidata_link"), { | |
href: "https://wikidata.org/wiki/".concat(t), | |
target: "_blank", | |
title: "Wikidata" | |
})) | |
} | |
)) | |
} | |
}, { | |
key: "wp_link", | |
value: function(t) { | |
if (!t) | |
return null; | |
var e = t.split(":", 2); | |
if (e.length > 1) { | |
var r = "https://".concat(e[0], ".wikipedia.org/wiki/").concat(e[1]); | |
return N("a", N("div.ext_link.wikipedia_link"), { | |
href: r, | |
target: "_blank", | |
title: "Wikipedia" | |
}) | |
} | |
} | |
}]) && xt(e.prototype, r), | |
t | |
}() | |
, Et = { | |
"text-halo-width": 4, | |
"text-halo-blur": 2, | |
"text-halo-color": "rgba(230, 230, 230, 1)" | |
} | |
, Ct = ["step", ["zoom"], ["get", "name"], 14, ["case", ["has", "operator"], ["concat", ["get", "name"], " (", ["get", "operator"], ")"], ["get", "name"]]] | |
, At = ["any", ["==", ["get", "location"], "underground"], ["==", ["get", "location"], "underwater"], ["==", ["get", "tunnel"], !0], ["all", ["==", ["get", "type"], "cable"], ["==", ["get", "location"], ""]]]; | |
function zt(t, e) { | |
(null == e || e > t.length) && (e = t.length); | |
for (var r = 0, i = new Array(e); r < e; r++) | |
i[r] = t[r]; | |
return i | |
} | |
var St = [[null, "#7A7A85"], [10, "#6E97B8"], [25, "#55B555"], [52, "#B59F10"], [132, "#B55D00"], [220, "#C73030"], [310, "#B54EB2"], [550, "#00C1CF"]] | |
, kt = { | |
HVDC: "#4E01B5", | |
"Traction (<50 Hz)": "#A8B596" | |
} | |
, Tt = { | |
coal: "power_plant_coal", | |
geothermal: "power_plant_geothermal", | |
hydro: "power_plant_hydro", | |
nuclear: "power_plant_nuclear", | |
oil: "power_plant_oilgas", | |
gas: "power_plant_oilgas", | |
diesel: "power_plant_oilgas", | |
solar: "power_plant_solar", | |
wind: "power_plant_wind", | |
biomass: "power_plant_biomass", | |
waste: "power_plant_waste", | |
battery: "power_plant_battery" | |
} | |
, Dt = ["all", ["has", "frequency"], ["!=", ["get", "frequency"], ""], ["!=", ["to-number", ["get", "frequency"]], 50], ["!=", ["to-number", ["get", "frequency"]], 60]] | |
, It = ["all", ["has", "frequency"], ["!=", ["get", "frequency"], ""], ["==", ["to-number", ["get", "frequency"]], 0]]; | |
function Ft(t) { | |
for (var e = ["step", ["to-number", ["coalesce", ["get", t], 0]]], r = 0, i = St; r < i.length; r++) { | |
var n = i[r]; | |
null != n[0] ? (e.push(n[0] - .01), | |
e.push(n[1])) : e.push(n[1]) | |
} | |
return ["case", It, kt.HVDC, Dt, kt["Traction (<50 Hz)"], e] | |
} | |
function Bt(t) { | |
var e = 7 * (t - 1); | |
return ["interpolate", ["linear"], ["zoom"], 9.999, 0, 10, ["case", ["has", "voltage_3"], .5 * (e - 7), ["has", "voltage_2"], .5 * (e - 3.5), 0], 13, ["case", ["has", "voltage_3"], e - 7, ["has", "voltage_2"], e - 3.5, 0]] | |
} | |
var Pt = ["interpolate", ["linear"], ["zoom"], 2, .5, 10, ["match", ["get", "line"], "bay", 1, "busbar", 1, ["interpolate", ["linear"], ["coalesce", ["get", "voltage"], 0], 0, 1, 100, 1.8, 800, 4]]] | |
, Mt = ["to-number", ["coalesce", ["get", "voltage"], 0]] | |
, Lt = ["to-number", ["coalesce", ["get", "output"], 0]] | |
, Rt = ["all", ["any", [">", Mt, 200], ["all", [">", Mt, 200], [">", ["zoom"], 6]], ["all", [">", Mt, 100], [">", ["zoom"], 7]], ["all", [">", Mt, 25], [">", ["zoom"], 9]], ["all", [">", Mt, 9], [">", ["zoom"], 10]], [">", ["zoom"], 11]], ["any", ["!=", ["get", "substation"], "transition"], [">", ["zoom"], 12]]] | |
, Ot = ["interpolate", ["linear"], ["zoom"], 5, ["interpolate", ["linear"], Mt, 0, 0, 200, 1, 750, 3], 12, ["interpolate", ["linear"], Mt, 10, 1, 30, 3, 100, 5, 300, 7, 600, 9], 15, 3] | |
, Ut = ["any", ["==", ["coalesce", ["get", "area"], 0], 0], ["all", ["<", ["coalesce", ["get", "area"], 0], 100], ["<", ["zoom"], 16]], ["all", ["<", ["coalesce", ["get", "area"], 0], 250], ["<", ["zoom"], 15]], ["<", ["zoom"], 13]] | |
, Vt = ["all", ["==", ["get", "substation"], "converter"], ["any", [">", Mt, 100], [">", ["zoom"], 6]]] | |
, jt = ["all", ["any", [">", Mt, 399], ["all", [">", Mt, 200], [">", ["zoom"], 8]], ["all", [">", Mt, 100], [">", ["zoom"], 10]], ["all", [">", Mt, 50], [">", ["zoom"], 12]], [">", ["zoom"], 13]], ["any", ["==", ["to-number", ["get", "area"]], 0], ["<", ["zoom"], 17]], ["!=", ["get", "substation"], "transition"]] | |
, Nt = ["all", ["any", [">", Mt, 199], ["all", [">", Mt, 99], [">=", ["zoom"], 4]], ["all", [">", Mt, 49], [">=", ["zoom"], 5]], ["all", [">", Mt, 24], [">=", ["zoom"], 6]], ["all", [">", Mt, 9], [">=", ["zoom"], 9]], [">", ["zoom"], 10]], ["any", ["all", ["!=", ["get", "line"], "busbar"], ["!=", ["get", "line"], "bay"]], [">", ["zoom"], 12]]] | |
, qt = ["all", ["any", ["all", [">", Mt, 330], [">", ["zoom"], 7]], ["all", [">", Mt, 200], [">", ["zoom"], 8]], ["all", [">", Mt, 100], [">", ["zoom"], 9]], [">", ["zoom"], 10]], ["any", ["all", ["!=", ["get", "line"], "busbar"], ["!=", ["get", "line"], "bay"]], [">", ["zoom"], 12]]] | |
, Gt = ["get", "construction"] | |
, Zt = ["case", Gt, " (under construction) ", ""] | |
, Xt = ["any", [">", Lt, 1e3], ["all", [">", Lt, 750], [">", ["zoom"], 5]], ["all", [">", Lt, 250], [">", ["zoom"], 6]], ["all", [">", Lt, 100], [">", ["zoom"], 7]], ["all", [">", Lt, 10], [">", ["zoom"], 9]], ["all", [">", Lt, 1], [">", ["zoom"], 11]], [">", ["zoom"], 12]] | |
, Wt = ["case", [">", Lt, 1], ["concat", Lt, " MW"], ["concat", ["round", ["*", Lt, 1e3]], " kW"]] | |
, Ht = ["coalesce"].concat(gt.map((function(t) { | |
return ["get", t] | |
} | |
))) | |
, Kt = ["step", ["zoom"], ["concat", Ht], 9, ["case", ["all", ["!", ["has", "name"]], ["has", "output"]], ["concat", Wt, Zt], ["has", "output"], ["concat", Ht, " \n", Wt, "\n", Zt], Ht]] | |
, Jt = ["interpolate", ["linear"], ["zoom"], 4, ["case", Gt, .3, .6], 8, ["case", Gt, .3, 1]] | |
, Yt = ["case", It, " DC", Dt, ["concat", " ", ["get", "frequency"], " Hz"], ""]; | |
function $t(t, e) { | |
var r = Math.pow(10, e); | |
return ["/", ["round", ["*", t, r]], r] | |
} | |
var Qt = ["case", ["all", ["has", "voltage_3"], ["!=", ["get", "voltage_3"], ["get", "voltage_2"]]], ["concat", $t(["get", "voltage"], 3), "/", $t(["get", "voltage_2"], 3), "/", $t(["get", "voltage_3"], 3), " kV"], ["all", ["has", "voltage_2"], ["!=", ["get", "voltage_2"], ["get", "voltage"]]], ["concat", $t(["get", "voltage"], 3), "/", $t(["get", "voltage_2"], 3), " kV"], ["has", "voltage"], ["concat", $t(["get", "voltage"], 3), " kV"], ""] | |
, te = ["case", ["all", ["has", "voltage"], ["has", "name"], ["!=", Ht, ""]], ["concat", Ht, " (", Qt, Yt, ")", Zt], ["has", "voltage"], ["concat", Qt, Yt, Zt], Ht] | |
, ee = ["step", ["zoom"], Ht, 12, ["case", ["all", ["!=", Ht, ""], ["has", "voltage"]], ["concat", Ht, " ", Mt, " kV", Yt, Zt], ["all", ["==", Ht, ""], ["has", "voltage"]], ["concat", "Substation ", Mt, " kV", Yt, Zt], Ht]] | |
, re = [{ | |
zorder: 60, | |
id: "power_line_case", | |
type: "line", | |
source: "openinframap", | |
"source-layer": "power_line", | |
filter: ["==", ["get", "tunnel"], !0], | |
minzoom: 12, | |
paint: { | |
"line-opacity": ["case", Gt, .2, .4], | |
"line-color": "#7C4544", | |
"line-width": ["interpolate", ["linear"], ["zoom"], 12, 4, 18, 10] | |
}, | |
layout: { | |
"line-join": "round", | |
"line-cap": "round" | |
} | |
}, { | |
zorder: 61, | |
id: "power_line_underground_1", | |
type: "line", | |
filter: ["all", At, Nt], | |
source: "openinframap", | |
"source-layer": "power_line", | |
minzoom: 0, | |
paint: { | |
"line-color": Ft("voltage"), | |
"line-width": Pt, | |
"line-dasharray": [3, 2], | |
"line-offset": Bt(1), | |
"line-opacity": Jt | |
}, | |
layout: { | |
"line-join": "round", | |
"line-cap": "round" | |
} | |
}, { | |
zorder: 61, | |
id: "power_line_underground_2", | |
type: "line", | |
filter: ["all", At, Nt, ["has", "voltage_2"]], | |
source: "openinframap", | |
"source-layer": "power_line", | |
minzoom: 10, | |
paint: { | |
"line-color": Ft("voltage_2"), | |
"line-width": Pt, | |
"line-dasharray": [3, 2], | |
"line-offset": Bt(2), | |
"line-opacity": Jt | |
}, | |
layout: { | |
"line-join": "round", | |
"line-cap": "round" | |
} | |
}, { | |
zorder: 61, | |
id: "power_line_underground_3", | |
type: "line", | |
filter: ["all", At, Nt, ["has", "voltage_3"]], | |
source: "openinframap", | |
"source-layer": "power_line", | |
minzoom: 10, | |
paint: { | |
"line-color": Ft("voltage_3"), | |
"line-width": Pt, | |
"line-dasharray": [3, 2], | |
"line-offset": Bt(3), | |
"line-opacity": Jt | |
}, | |
layout: { | |
"line-join": "round", | |
"line-cap": "round" | |
} | |
}, { | |
zorder: 160, | |
id: "power_plant", | |
type: "fill", | |
source: "openinframap", | |
minzoom: 5, | |
"source-layer": "power_plant", | |
paint: { | |
"fill-opacity": ["case", Gt, .05, .2] | |
} | |
}, { | |
zorder: 161, | |
id: "power_plant_outline", | |
type: "line", | |
filter: ["!", Gt], | |
source: "openinframap", | |
minzoom: 8, | |
"source-layer": "power_plant", | |
paint: { | |
"line-color": "rgb(80,80,80)", | |
"line-opacity": .4, | |
"line-width": 1 | |
}, | |
layout: { | |
"line-join": "round" | |
} | |
}, { | |
zorder: 161, | |
id: "power_plant_outline_construction", | |
type: "line", | |
filter: Gt, | |
source: "openinframap", | |
minzoom: 8, | |
"source-layer": "power_plant", | |
paint: { | |
"line-color": "rgb(163,139,16)", | |
"line-opacity": .4, | |
"line-width": 1, | |
"line-dasharray": [2, 2] | |
}, | |
layout: { | |
"line-join": "round" | |
} | |
}, { | |
zorder: 161, | |
id: "power_substation", | |
type: "fill", | |
filter: Rt, | |
source: "openinframap", | |
"source-layer": "power_substation", | |
minzoom: 13, | |
paint: { | |
"fill-opacity": .3, | |
"fill-color": Ft("voltage"), | |
"fill-outline-color": "rgba(0, 0, 0, 1)" | |
} | |
}, { | |
zorder: 162, | |
id: "power_solar_panel", | |
type: "fill", | |
source: "openinframap", | |
"source-layer": "power_generator_area", | |
filter: ["==", ["get", "source"], "solar"], | |
minzoom: 13, | |
paint: { | |
"fill-color": "#726BA9", | |
"fill-outline-color": "rgba(50, 50, 50, 1)" | |
} | |
}, { | |
zorder: 260, | |
id: "power_line_1", | |
type: "line", | |
source: "openinframap", | |
"source-layer": "power_line", | |
filter: ["all", ["!", At], Nt], | |
minzoom: 0, | |
paint: { | |
"line-color": Ft("voltage"), | |
"line-width": Pt, | |
"line-offset": Bt(1), | |
"line-opacity": Jt | |
}, | |
layout: { | |
"line-join": "round", | |
"line-cap": "round" | |
} | |
}, { | |
zorder: 260, | |
id: "power_line_2", | |
type: "line", | |
source: "openinframap", | |
"source-layer": "power_line", | |
filter: ["all", ["!", At], Nt, ["has", "voltage_2"]], | |
minzoom: 10, | |
paint: { | |
"line-color": Ft("voltage_2"), | |
"line-width": Pt, | |
"line-offset": Bt(2), | |
"line-opacity": Jt | |
}, | |
layout: { | |
"line-join": "round", | |
"line-cap": "round" | |
} | |
}, { | |
zorder: 260, | |
id: "power_line_3", | |
type: "line", | |
source: "openinframap", | |
"source-layer": "power_line", | |
filter: ["all", ["!", At], Nt, ["has", "voltage_3"]], | |
minzoom: 10, | |
paint: { | |
"line-color": Ft("voltage_3"), | |
"line-width": Pt, | |
"line-offset": Bt(3), | |
"line-opacity": Jt | |
}, | |
layout: { | |
"line-join": "round", | |
"line-cap": "round" | |
} | |
}, { | |
zorder: 261, | |
id: "power_transformer", | |
type: "symbol", | |
source: "openinframap", | |
"source-layer": "power_transformer", | |
minzoom: 14, | |
paint: Et, | |
layout: { | |
"icon-image": "power_transformer" | |
} | |
}, { | |
zorder: 262, | |
id: "power_compensator", | |
type: "symbol", | |
source: "openinframap", | |
"source-layer": "power_compensator", | |
minzoom: 14, | |
paint: Et, | |
layout: { | |
"icon-image": "power_compensator" | |
} | |
}, { | |
zorder: 263, | |
id: "power_switch", | |
type: "symbol", | |
source: "openinframap", | |
"source-layer": "power_switch", | |
minzoom: 14, | |
paint: Et, | |
layout: { | |
"icon-image": "power_switch" | |
} | |
}, { | |
zorder: 264, | |
id: "power_tower", | |
type: "symbol", | |
filter: ["==", ["get", "type"], "tower"], | |
source: "openinframap", | |
"source-layer": "power_tower", | |
minzoom: 13, | |
paint: Et, | |
layout: { | |
"icon-image": ["case", ["get", "transition"], "power_tower_transition", ["any", ["has", "transformer"], ["has", "substation"]], "power_tower_transformer", "power_tower"], | |
"icon-offset": ["case", ["any", ["has", "transformer"], ["has", "substation"]], ["literal", [12, 0]], ["literal", [0, 0]]], | |
"icon-allow-overlap": !0, | |
"icon-size": ["interpolate", ["linear"], ["zoom"], 13, .6, 17, 1], | |
"text-field": "{ref}", | |
"text-size": ["step", ["zoom"], 0, 14, 10], | |
"text-offset": [0, 1.5], | |
"text-max-angle": 10 | |
} | |
}, { | |
zorder: 265, | |
id: "power_pole", | |
type: "symbol", | |
filter: ["==", ["get", "type"], "pole"], | |
source: "openinframap", | |
"source-layer": "power_tower", | |
minzoom: 13, | |
paint: Et, | |
layout: { | |
"icon-image": ["case", ["get", "transition"], "power_pole_transition", ["any", ["has", "transformer"], ["has", "substation"]], "power_pole_transformer", "power_pole"], | |
"icon-offset": ["case", ["any", ["has", "transformer"], ["has", "substation"]], ["literal", [10, 0]], ["literal", [0, 0]]], | |
"icon-allow-overlap": !0, | |
"icon-size": ["interpolate", ["linear"], ["zoom"], 13, .2, 17, .8], | |
"text-field": "{ref}", | |
"text-size": ["step", ["zoom"], 0, 14, 10], | |
"text-offset": [0, 1], | |
"text-max-angle": 10 | |
} | |
}, { | |
zorder: 266, | |
id: "power_wind_turbine", | |
type: "symbol", | |
source: "openinframap", | |
"source-layer": "power_generator", | |
filter: ["==", ["get", "source"], "wind"], | |
minzoom: 11, | |
paint: Et, | |
layout: { | |
"icon-image": "power_wind", | |
"icon-anchor": "bottom", | |
"icon-size": ["interpolate", ["linear"], ["zoom"], 11, .5, 14, 1], | |
"text-field": "{name}", | |
"text-size": ["step", ["zoom"], 0, 12, 9], | |
"text-offset": [0, 1], | |
"text-anchor": "top" | |
} | |
}, { | |
zorder: 267, | |
id: "power_wind_turbine_point", | |
type: "circle", | |
source: "openinframap", | |
"source-layer": "power_generator", | |
filter: ["==", ["get", "source"], "wind"], | |
minzoom: 9, | |
maxzoom: 11, | |
paint: { | |
"circle-radius": 1.5, | |
"circle-color": "#444444" | |
} | |
}, { | |
zorder: 268, | |
id: "power_substation_point", | |
type: "circle", | |
filter: ["all", Rt, Ut, ["!", Vt]], | |
source: "openinframap", | |
"source-layer": "power_substation_point", | |
minzoom: 5, | |
layout: {}, | |
paint: { | |
"circle-radius": Ot, | |
"circle-color": Ft("voltage"), | |
"circle-stroke-color": "#555", | |
"circle-stroke-width": ["interpolate", ["linear"], ["zoom"], 5, .1, 8, .5, 15, 2], | |
"circle-opacity": Jt, | |
"circle-stroke-opacity": Jt | |
} | |
}, { | |
zorder: 560, | |
id: "power_line_ref", | |
type: "symbol", | |
filter: ["all", qt, ["!=", ["coalesce", ["get", "ref"], ""], ""], ["<", ["length", ["get", "ref"]], 5]], | |
source: "openinframap", | |
"source-layer": "power_line", | |
minzoom: 7, | |
layout: { | |
"icon-image": "power_line_ref", | |
"text-field": "{ref}", | |
"symbol-placement": "line-center", | |
"text-size": 10, | |
"text-max-angle": 10 | |
} | |
}, { | |
zorder: 561, | |
id: "power_line_label", | |
type: "symbol", | |
filter: ["all", Nt], | |
source: "openinframap", | |
"source-layer": "power_line", | |
minzoom: 11, | |
paint: Et, | |
layout: { | |
"text-field": te, | |
"symbol-placement": "line", | |
"symbol-spacing": 400, | |
"text-size": ["interpolate", ["linear"], ["zoom"], 11, 10, 18, 13], | |
"text-offset": ["case", ["has", "voltage_3"], ["literal", [0, 1.5]], ["has", "voltage_2"], ["literal", [0, 1.25]], ["literal", [0, 1]]], | |
"text-max-angle": 10 | |
} | |
}, { | |
zorder: 562, | |
id: "power_substation_ref_label", | |
type: "symbol", | |
filter: jt, | |
source: "openinframap", | |
"source-layer": "power_substation_point", | |
minzoom: 14.5, | |
layout: { | |
"symbol-z-order": "source", | |
"text-field": "{ref}", | |
"text-anchor": "bottom", | |
"text-offset": [0, -.5], | |
"text-size": ["interpolate", ["linear"], ["zoom"], 14, 9, 18, 12], | |
"text-max-width": 8 | |
}, | |
paint: Et | |
}, { | |
zorder: 562, | |
id: "power_substation_label", | |
type: "symbol", | |
source: "openinframap", | |
filter: jt, | |
"source-layer": "power_substation_point", | |
minzoom: 8, | |
layout: { | |
"symbol-sort-key": ["-", 1e4, Mt], | |
"symbol-z-order": "source", | |
"text-field": ee, | |
"text-anchor": "top", | |
"text-offset": [0, .5], | |
"text-size": ["interpolate", ["linear"], ["zoom"], 8, 10, 18, ["interpolate", ["linear"], Mt, 0, 10, 400, 16]], | |
"text-max-width": 8 | |
}, | |
paint: Et | |
}, { | |
zorder: 562, | |
id: "power_converter_point", | |
type: "symbol", | |
filter: ["all", Vt, Ut], | |
source: "openinframap", | |
"source-layer": "power_substation_point", | |
minzoom: 5.5, | |
layout: { | |
"icon-image": "converter", | |
"icon-size": ["interpolate", ["linear"], ["zoom"], 5, .4, 9, 1], | |
"text-field": ee, | |
"text-anchor": "top", | |
"text-offset": [0, 1.2], | |
"text-size": ["interpolate", ["linear"], ["zoom"], 7, 10, 18, ["interpolate", ["linear"], Lt, 0, 10, 2e3, 16]], | |
"text-optional": !0 | |
}, | |
paint: Object.assign({}, Et, { | |
"text-opacity": ["step", ["zoom"], 0, 7, 1] | |
}) | |
}, { | |
zorder: 563, | |
id: "power_plant_label", | |
type: "symbol", | |
source: "openinframap", | |
filter: Xt, | |
"source-layer": "power_plant_point", | |
minzoom: 6, | |
maxzoom: 24, | |
layout: { | |
"symbol-sort-key": ["-", 1e4, Lt], | |
"symbol-z-order": "source", | |
"icon-allow-overlap": !0, | |
"icon-image": function() { | |
for (var t = ["match", ["get", "source"]], e = 0, r = Object.entries(Tt); e < r.length; e++) { | |
var i = (a = r[e], | |
s = 2, | |
function(t) { | |
if (Array.isArray(t)) | |
return t | |
}(a) || function(t, e) { | |
var r = null == t ? null : "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"]; | |
if (null != r) { | |
var i, n, o = [], a = !0, s = !1; | |
try { | |
for (r = r.call(t); !(a = (i = r.next()).done) && (o.push(i.value), | |
!e || o.length !== e); a = !0) | |
; | |
} catch (t) { | |
s = !0, | |
n = t | |
} finally { | |
try { | |
a || null == r.return || r.return() | |
} finally { | |
if (s) | |
throw n | |
} | |
} | |
return o | |
} | |
}(a, s) || function(t, e) { | |
if (t) { | |
if ("string" == typeof t) | |
return zt(t, e); | |
var r = Object.prototype.toString.call(t).slice(8, -1); | |
return "Object" === r && t.constructor && (r = t.constructor.name), | |
"Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? zt(t, e) : void 0 | |
} | |
}(a, s) || function() { | |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") | |
}()) | |
, n = i[0] | |
, o = i[1]; | |
t.push(n, o) | |
} | |
var a, s; | |
return t.push("power_plant"), | |
t | |
}(), | |
"icon-size": ["interpolate", ["linear"], ["zoom"], 6, .6, 10, .8], | |
"text-field": Kt, | |
"text-anchor": "top", | |
"text-offset": [0, 1], | |
"text-size": ["interpolate", ["linear"], ["zoom"], 7, 10, 18, ["interpolate", ["linear"], Lt, 0, 10, 2e3, 16]], | |
"text-optional": !0 | |
}, | |
paint: Object.assign({}, Et, { | |
"icon-opacity": ["step", ["zoom"], ["case", Gt, .5, 1], 11, 0], | |
"text-opacity": ["step", ["zoom"], 0, 7, 1] | |
}) | |
}]; | |
const ie = [{ | |
zorder: 40, | |
id: "telecoms_line", | |
type: "line", | |
source: "openinframap", | |
minzoom: 2, | |
"source-layer": "telecoms_communication_line", | |
paint: { | |
"line-color": "#61637A", | |
"line-width": ["interpolate", ["linear"], ["zoom"], 3, .3, 11, 2], | |
"line-dasharray": [3, 2] | |
} | |
}, { | |
zorder: 140, | |
id: "telecoms_data_center", | |
type: "fill", | |
source: "openinframap", | |
minzoom: 10, | |
"source-layer": "telecoms_data_center", | |
paint: { | |
"fill-opacity": .3, | |
"fill-color": "#7D59AB", | |
"fill-outline-color": "rgba(0, 0, 0, 1)" | |
} | |
}, { | |
zorder: 141, | |
id: "telecoms_mast", | |
type: "symbol", | |
source: "openinframap", | |
minzoom: 10, | |
"source-layer": "telecoms_mast", | |
paint: Et, | |
layout: { | |
"icon-image": "comms_tower", | |
"icon-anchor": "bottom", | |
"icon-size": ["interpolate", ["linear"], ["zoom"], 10, .6, 14, 1], | |
"text-field": Ct, | |
"text-size": { | |
stops: [[11, 0], [12, 0], [12.01, 10]] | |
}, | |
"text-anchor": "top", | |
"text-offset": { | |
stops: [[11, [0, 1]], [16, [0, 2]]] | |
}, | |
"text-optional": !0 | |
} | |
}, { | |
id: "telecoms_data_center_symbol", | |
type: "symbol", | |
source: "openinframap", | |
minzoom: 11, | |
"source-layer": "telecoms_data_center", | |
paint: Et, | |
layout: { | |
"text-field": Ct, | |
"text-size": { | |
stops: [[11, 0], [13, 0], [13.01, 10]] | |
}, | |
"text-offset": [0, 1], | |
"text-anchor": "top" | |
} | |
}, { | |
id: "telecoms_line_label", | |
type: "symbol", | |
source: "openinframap", | |
minzoom: 9, | |
"source-layer": "telecoms_communication_line", | |
paint: Et, | |
layout: { | |
"text-field": ["coalesce"].concat(gt.map((function(t) { | |
return ["get", t] | |
} | |
))), | |
"symbol-placement": "line", | |
"symbol-spacing": 400, | |
"text-size": 10, | |
"text-offset": [0, 1], | |
"text-max-angle": 10 | |
} | |
}] | |
, ne = [{ | |
zorder: 20, | |
id: "water_pipeline_case", | |
type: "line", | |
source: "openinframap", | |
minzoom: 7, | |
"source-layer": "water_pipeline", | |
paint: { | |
"line-color": "#bbbbbb", | |
"line-width": ["interpolate", ["linear"], ["zoom"], 8, 1.5, 13, 4] | |
}, | |
layout: { | |
"line-cap": "round", | |
"line-join": "round" | |
} | |
}, { | |
zorder: 21, | |
id: "water_pipeline", | |
type: "line", | |
source: "openinframap", | |
minzoom: 3, | |
"source-layer": "water_pipeline", | |
paint: { | |
"line-color": "#7B7CBA", | |
"line-width": ["interpolate", ["linear"], ["zoom"], 3, .3, 13, 2] | |
} | |
}, { | |
zorder: 520, | |
id: "water_pipeline_label", | |
type: "symbol", | |
source: "openinframap", | |
"source-layer": "water_pipeline", | |
minzoom: 11, | |
paint: Et, | |
layout: { | |
"text-field": "{name}", | |
"symbol-placement": "line", | |
"symbol-spacing": 400, | |
"text-size": 10, | |
"text-offset": [0, 1], | |
"text-max-angle": 10 | |
} | |
}]; | |
var oe = ["coalesce", ["get", "substance"], ["get", "type"], ""] | |
, ae = "#BFBC6B" | |
, se = "#CC9F83" | |
, le = [{ | |
zorder: 0, | |
id: "petroleum_pipeline_case", | |
type: "line", | |
source: "openinframap", | |
minzoom: 7, | |
"source-layer": "petroleum_pipeline", | |
paint: { | |
"line-color": "#666666", | |
"line-width": ["interpolate", ["linear"], ["zoom"], 8, 1.5, 13, 5] | |
}, | |
layout: { | |
"line-cap": "round", | |
"line-join": "round" | |
} | |
}, { | |
zorder: 1, | |
id: "petroleum_pipeline", | |
type: "line", | |
source: "openinframap", | |
minzoom: 3, | |
"source-layer": "petroleum_pipeline", | |
paint: { | |
"line-color": ["match", oe, ["gas", "natural_gas", "cng"], ae, se], | |
"line-width": ["interpolate", ["linear"], ["zoom"], 3, 1, 13, 3.5] | |
} | |
}, { | |
zorder: 100, | |
id: "petroleum_site", | |
type: "fill", | |
source: "openinframap", | |
minzoom: 8, | |
"source-layer": "petroleum_site", | |
paint: { | |
"fill-opacity": .3, | |
"fill-color": se, | |
"fill-outline-color": "rgba(0, 0, 0, 1)" | |
} | |
}, { | |
zorder: 101, | |
id: "petroleum_well", | |
type: "circle", | |
source: "openinframap", | |
minzoom: 10, | |
"source-layer": "petroleum_well", | |
paint: { | |
"circle-color": se, | |
"circle-stroke-color": "#666666", | |
"circle-stroke-width": 1, | |
"circle-radius": ["interpolate", ["linear"], ["zoom"], 10, 1, 12, 2, 14, 5] | |
} | |
}, { | |
zorder: 500, | |
id: "petroleum_pipeline_label", | |
type: "symbol", | |
source: "openinframap", | |
"source-layer": "petroleum_pipeline", | |
minzoom: 12, | |
paint: Et, | |
layout: { | |
"text-field": ["concat", ["get", "operator"], ["case", ["all", ["!=", oe, ""], ["!=", ["get", "operator"], ""]], ["concat", " (", oe, ")"], oe]], | |
"symbol-placement": "line", | |
"symbol-spacing": 400, | |
"text-size": 10, | |
"text-offset": [0, 1], | |
"text-max-angle": 10 | |
} | |
}, { | |
zorder: 501, | |
id: "petroleum_site_label", | |
type: "symbol", | |
source: "openinframap", | |
"source-layer": "petroleum_site", | |
minzoom: 12, | |
layout: { | |
"text-field": "{name}", | |
"text-anchor": "top", | |
"text-offset": [0, 1], | |
"text-size": 11 | |
}, | |
paint: Et | |
}, { | |
zorder: 502, | |
id: "petroleum_well_label", | |
type: "symbol", | |
source: "openinframap", | |
"source-layer": "petroleum_well", | |
minzoom: 13, | |
layout: { | |
"text-field": "Well {name}", | |
"text-anchor": "top", | |
"text-offset": [0, .5], | |
"text-size": 10 | |
}, | |
paint: Et | |
}]; | |
function ue(t, e) { | |
(null == e || e > t.length) && (e = t.length); | |
for (var r = 0, i = new Array(e); r < e; r++) | |
i[r] = t[r]; | |
return i | |
} | |
function ce(t, e) { | |
var r, i = function(t, e) { | |
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"]; | |
if (!r) { | |
if (Array.isArray(t) || (r = function(t, e) { | |
if (t) { | |
if ("string" == typeof t) | |
return ue(t, e); | |
var r = Object.prototype.toString.call(t).slice(8, -1); | |
return "Object" === r && t.constructor && (r = t.constructor.name), | |
"Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? ue(t, e) : void 0 | |
} | |
}(t)) || e && t && "number" == typeof t.length) { | |
r && (t = r); | |
var i = 0 | |
, n = function() {}; | |
return { | |
s: n, | |
n: function() { | |
return i >= t.length ? { | |
done: !0 | |
} : { | |
done: !1, | |
value: t[i++] | |
} | |
}, | |
e: function(t) { | |
throw t | |
}, | |
f: n | |
} | |
} | |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") | |
} | |
var o, a = !0, s = !1; | |
return { | |
s: function() { | |
r = r.call(t) | |
}, | |
n: function() { | |
var t = r.next(); | |
return a = t.done, | |
t | |
}, | |
e: function(t) { | |
s = !0, | |
o = t | |
}, | |
f: function() { | |
try { | |
a || null == r.return || r.return() | |
} finally { | |
if (s) | |
throw o | |
} | |
} | |
} | |
}(t); | |
try { | |
for (i.s(); !(r = i.n()).done; ) { | |
var n = r.value; | |
if (n.id == e) | |
return n | |
} | |
} catch (t) { | |
i.e(t) | |
} finally { | |
i.f() | |
} | |
return null | |
} | |
function pe(t, e) { | |
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "" | |
, i = 15 | |
, n = 30 | |
, o = Y("line", { | |
x1: 0, | |
y1: i / 2, | |
x2: n, | |
y2: i / 2 | |
}); | |
return T(o, { | |
stroke: t, | |
"stroke-width": e, | |
"stroke-dasharray": r | |
}), | |
Y("svg", o, { | |
height: i, | |
width: n | |
}) | |
} | |
function he(t, e) { | |
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 2 | |
, i = ce(t, e) | |
, n = ""; | |
return i.paint["line-dasharray"] && (n = i.paint["line-dasharray"].join(" ")), | |
pe(i.paint["line-color"], r, n) | |
} | |
function fe(t, e) { | |
var r = ce(t, e) | |
, i = 1 | |
, n = ""; | |
return r.paint["fill-opacity"] && (i = r.paint["fill-opacity"]), | |
r.paint["fill-outline-color"] && (n = r.paint["fill-outline-color"]), | |
function(t) { | |
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "black" | |
, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1 | |
, i = 15 | |
, n = 30 | |
, o = Y("rect", { | |
width: n, | |
height: i | |
}); | |
return T(o, { | |
fill: t, | |
stroke: e, | |
"stroke-width": 1, | |
opacity: r | |
}), | |
Y("svg", o, { | |
height: i, | |
width: n | |
}) | |
}(r.paint["fill-color"], n, i) | |
} | |
var de = r(3465) | |
, me = {}; | |
function ye(t, e) { | |
return function(t) { | |
if (Array.isArray(t)) | |
return t | |
}(t) || function(t, e) { | |
var r = null == t ? null : "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"]; | |
if (null != r) { | |
var i, n, o = [], a = !0, s = !1; | |
try { | |
for (r = r.call(t); !(a = (i = r.next()).done) && (o.push(i.value), | |
!e || o.length !== e); a = !0) | |
; | |
} catch (t) { | |
s = !0, | |
n = t | |
} finally { | |
try { | |
a || null == r.return || r.return() | |
} finally { | |
if (s) | |
throw n | |
} | |
} | |
return o | |
} | |
}(t, e) || ge(t, e) || function() { | |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") | |
}() | |
} | |
function ge(t, e) { | |
if (t) { | |
if ("string" == typeof t) | |
return ve(t, e); | |
var r = Object.prototype.toString.call(t).slice(8, -1); | |
return "Object" === r && t.constructor && (r = t.constructor.name), | |
"Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? ve(t, e) : void 0 | |
} | |
} | |
function ve(t, e) { | |
(null == e || e > t.length) && (e = t.length); | |
for (var r = 0, i = new Array(e); r < e; r++) | |
i[r] = t[r]; | |
return i | |
} | |
function _e(t) { | |
return (_e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) { | |
return typeof t | |
} | |
: function(t) { | |
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t | |
} | |
)(t) | |
} | |
function xe(t, e) { | |
if (!(t instanceof e)) | |
throw new TypeError("Cannot call a class as a function") | |
} | |
function be(t, e) { | |
for (var r = 0; r < e.length; r++) { | |
var i = e[r]; | |
i.enumerable = i.enumerable || !1, | |
i.configurable = !0, | |
"value"in i && (i.writable = !0), | |
Object.defineProperty(t, i.key, i) | |
} | |
} | |
function we(t, e, r) { | |
return e && be(t.prototype, e), | |
r && be(t, r), | |
t | |
} | |
me.styleTagTransform = d(), | |
me.setAttributes = c(), | |
me.insert = l().bind(null, "head"), | |
me.domAPI = a(), | |
me.insertStyleElement = h(), | |
n()(de.Z, me), | |
de.Z && de.Z.locals && de.Z.locals; | |
var Ee = function() { | |
function t() { | |
xe(this, t), | |
this.el = N("td") | |
} | |
return we(t, [{ | |
key: "update", | |
value: function(t) { | |
if ("object" != _e(t)) | |
this.el.textContent = t; | |
else { | |
if (null === t) | |
return; | |
S(this.el, t) | |
} | |
} | |
}]), | |
t | |
}() | |
, Ce = W.extend("tr", Ee) | |
, Ae = function() { | |
function t() { | |
xe(this, t) | |
} | |
return we(t, [{ | |
key: "onAdd", | |
value: function(t) { | |
var e = this; | |
return this._map = t, | |
this._control = N("button", { | |
class: "maplibregl-ctrl-icon oim-key-control" | |
}), | |
this._container = N("div", { | |
class: "maplibregl-ctrl oim-key-panel" | |
}), | |
this.populate(), | |
this._control.onclick = function(t) { | |
e._container.style.display = "block", | |
e._control.style.display = "none" | |
} | |
, | |
setTimeout((function(t) { | |
return e.resize() | |
} | |
), 100), | |
this._map.on("resize", (function(t) { | |
return e.resize() | |
} | |
)), | |
N("div", this._control, this._container, { | |
class: "maplibregl-ctrl maplibregl-ctrl-group" | |
}) | |
} | |
}, { | |
key: "resize", | |
value: function() { | |
var t, e = window.getComputedStyle(this._map.getContainer()); | |
t = "none" != this._control.style.display ? this._control.getBoundingClientRect() : this._container.getBoundingClientRect(); | |
var r = parseInt(e.height) - t.top - 80 + "px"; | |
T(this._pane, { | |
"max-height": r | |
}) | |
} | |
}, { | |
key: "header", | |
value: function() { | |
var t = this | |
, e = N(".oim-key-close", "×"); | |
return e.onclick = function(e) { | |
t._container.style.display = "none", | |
t._control.style.display = "block" | |
} | |
, | |
N(".oim-key-header", N("h2", "Key"), e) | |
} | |
}, { | |
key: "populate", | |
value: function() { | |
S(this._container, this.header()); | |
var t = N(".oim-key-pane"); | |
t.appendChild(N("h3", "Power Lines")), | |
S(t, this.voltageTable()), | |
t.appendChild(N("h3", "Power Plants")), | |
S(t, this.plantTable()), | |
t.appendChild(N("h3", "Power Generators")), | |
S(t, this.generatorTable()), | |
t.appendChild(N("h3", "Other Power")), | |
S(t, this.towerTable()), | |
t.appendChild(N("h3", "Telecoms")), | |
S(t, this.telecomTable()), | |
t.appendChild(N("h3", "Petroleum")), | |
S(t, this.petroleumTable()), | |
t.appendChild(N("h3", "Water")), | |
S(t, this.waterTable()), | |
this._pane = t, | |
S(this._container, t) | |
} | |
}, { | |
key: "voltageTable", | |
value: function() { | |
var t, e = [], r = function(t, e) { | |
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"]; | |
if (!r) { | |
if (Array.isArray(t) || (r = ge(t))) { | |
r && (t = r); | |
var i = 0 | |
, n = function() {}; | |
return { | |
s: n, | |
n: function() { | |
return i >= t.length ? { | |
done: !0 | |
} : { | |
done: !1, | |
value: t[i++] | |
} | |
}, | |
e: function(t) { | |
throw t | |
}, | |
f: n | |
} | |
} | |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") | |
} | |
var o, a = !0, s = !1; | |
return { | |
s: function() { | |
r = r.call(t) | |
}, | |
n: function() { | |
var t = r.next(); | |
return a = t.done, | |
t | |
}, | |
e: function(t) { | |
s = !0, | |
o = t | |
}, | |
f: function() { | |
try { | |
a || null == r.return || r.return() | |
} finally { | |
if (s) | |
throw o | |
} | |
} | |
} | |
}(St); | |
try { | |
for (r.s(); !(t = r.n()).done; ) { | |
var i = t.value | |
, n = i[0]; | |
n = null === n ? "< 10 kV" : "≥ ".concat(n, " kV"), | |
e.push([n, i[1]]) | |
} | |
} catch (t) { | |
r.e(t) | |
} finally { | |
r.f() | |
} | |
for (var o = 0, a = Object.entries(kt); o < a.length; o++) { | |
var s = ye(a[o], 2) | |
, l = s[0] | |
, u = s[1]; | |
e.push([l, u]) | |
} | |
(e = e.map((function(t) { | |
return [t[0], pe(t[1], 4)] | |
} | |
))).push(["Underground", pe("#7A7A85", 2, "3 2")]), | |
e.push(["Line Reference", this.sprite("power_line_ref")]); | |
var c = W("table", Ce); | |
return c.update(e), | |
c | |
} | |
}, { | |
key: "sprite", | |
value: function(t) { | |
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 25 | |
, r = N("img.oim-plant-sprite", { | |
src: "/style/sprites/".concat(t, ".svg"), | |
height: e | |
}); | |
return T(r, { | |
"max-width": e + "px" | |
}), | |
r | |
} | |
}, { | |
key: "plantTable", | |
value: function() { | |
for (var t = [], e = 0, r = Object.entries(Tt); e < r.length; e++) { | |
var i = ye(r[e], 2) | |
, n = i[0] | |
, o = i[1]; | |
t.push([n.charAt(0).toUpperCase() + n.slice(1), this.sprite(o)]) | |
} | |
var a = W("table", Ce); | |
return a.update(t), | |
a | |
} | |
}, { | |
key: "generatorTable", | |
value: function() { | |
var t = [["Wind Turbine", this.sprite("power_wind")], ["Solar Panel", fe(re, "power_solar_panel")]] | |
, e = W("table", Ce); | |
return e.update(t), | |
e | |
} | |
}, { | |
key: "towerTable", | |
value: function() { | |
var t = [["Tower/Pylon", this.sprite("power_tower")], ["Transition Tower", this.sprite("power_tower_transition")], ["Pole", this.sprite("power_pole", 8)], ["Transition Pole", this.sprite("power_pole_transition")], ["Transformer", this.sprite("power_transformer")], ["Switch", this.sprite("power_switch")], ["Compensator", this.sprite("power_compensator")], ["Converter", this.sprite("converter")]] | |
, e = W("table", Ce); | |
return e.update(t), | |
e | |
} | |
}, { | |
key: "telecomTable", | |
value: function() { | |
var t = [["Cable", he(ie, "telecoms_line")], ["Tower/Mast", this.sprite("comms_tower")], ["Datacenter/Exchange", fe(ie, "telecoms_data_center")]] | |
, e = W("table", Ce); | |
return e.update(t), | |
e | |
} | |
}, { | |
key: "petroleumTable", | |
value: function() { | |
var t = [["Oil Pipeline", pe(se, 2)], ["Gas Pipeline", pe(ae, 2)], ["Petroleum Facility", fe(le, "petroleum_site")]] | |
, e = W("table", Ce); | |
return e.update(t), | |
e | |
} | |
}, { | |
key: "waterTable", | |
value: function() { | |
var t = [["Water Pipeline", he(ne, "water_pipeline")]] | |
, e = W("table", Ce); | |
return e.update(t), | |
e | |
} | |
}]), | |
t | |
}(); | |
const ze = JSON.parse('{"version":8,"name":"OpenInfraMap","sources":{"openmaptiles":{"type":"vector","url":"https://api.maptiler.com/tiles/v3/tiles.json?key=ovWmI52zsF0gsGSw8mzW"},"openinframap":{"type":"vector","url":"https://openinframap.org/map.json"},"solar_heatmap":{"type":"vector","url":"https://openinframap.org/heatmap.json"}},"sprite":"https://openinframap.org/style/sprite","glyphs":"https://api.maptiler.com/fonts/{fontstack}/{range}.pbf?key=ovWmI52zsF0gsGSw8mzW","layers":[],"id":"openinframap"}') | |
, Se = [{ | |
id: "background", | |
type: "background", | |
paint: { | |
"background-color": "rgb(242,243,240)" | |
} | |
}, { | |
id: "park", | |
type: "fill", | |
source: "openmaptiles", | |
"source-layer": "park", | |
filter: ["==", "$type", "Polygon"], | |
layout: { | |
visibility: "visible" | |
}, | |
paint: { | |
"fill-color": "rgb(230, 233, 229)" | |
} | |
}, { | |
id: "water", | |
type: "fill", | |
source: "openmaptiles", | |
"source-layer": "water", | |
filter: ["==", "$type", "Polygon"], | |
layout: { | |
visibility: "visible" | |
}, | |
paint: { | |
"fill-color": "hsl(207, 12%, 78%)", | |
"fill-antialias": !0 | |
} | |
}, { | |
id: "landcover_ice_shelf", | |
type: "fill", | |
source: "openmaptiles", | |
"source-layer": "landcover", | |
maxzoom: 8, | |
filter: ["all", ["==", "$type", "Polygon"], ["==", "subclass", "ice_shelf"]], | |
layout: { | |
visibility: "visible" | |
}, | |
paint: { | |
"fill-color": "hsl(0, 0%, 98%)", | |
"fill-opacity": .7 | |
} | |
}, { | |
id: "landcover_glacier", | |
type: "fill", | |
source: "openmaptiles", | |
"source-layer": "landcover", | |
maxzoom: 8, | |
filter: ["all", ["==", "$type", "Polygon"], ["==", "subclass", "glacier"]], | |
layout: { | |
visibility: "visible" | |
}, | |
paint: { | |
"fill-color": "hsl(0, 0%, 98%)", | |
"fill-opacity": { | |
base: 1, | |
stops: [[0, 1], [8, .5]] | |
} | |
} | |
}, { | |
id: "landuse_residential", | |
type: "fill", | |
source: "openmaptiles", | |
"source-layer": "landuse", | |
maxzoom: 16, | |
filter: ["all", ["==", "$type", "Polygon"], ["==", "class", "residential"]], | |
layout: { | |
visibility: "visible" | |
}, | |
paint: { | |
"fill-color": "rgb(234, 234, 230)", | |
"fill-opacity": { | |
base: .6, | |
stops: [[8, .8], [9, .6]] | |
} | |
} | |
}, { | |
id: "landcover_wood", | |
type: "fill", | |
source: "openmaptiles", | |
"source-layer": "landcover", | |
minzoom: 10, | |
filter: ["all", ["==", "$type", "Polygon"], ["==", "class", "wood"]], | |
layout: { | |
visibility: "visible" | |
}, | |
paint: { | |
"fill-color": "rgb(220,226,220)", | |
"fill-opacity": { | |
base: 1, | |
stops: [[8, 0], [12, 1]] | |
} | |
} | |
}, { | |
id: "waterway", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "waterway", | |
filter: ["==", "$type", "LineString"], | |
layout: { | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "hsl(207, 20%, 78%)" | |
} | |
}, { | |
id: "building", | |
type: "fill", | |
source: "openmaptiles", | |
"source-layer": "building", | |
minzoom: 12, | |
paint: { | |
"fill-color": "rgb(234, 234, 229)", | |
"fill-outline-color": "rgb(219, 219, 218)", | |
"fill-antialias": !0 | |
} | |
}, { | |
id: "tunnel_motorway_casing", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 6, | |
filter: ["all", ["==", "$type", "LineString"], ["all", ["==", "brunnel", "tunnel"], ["==", "class", "motorway"]]], | |
layout: { | |
"line-cap": "butt", | |
"line-join": "miter", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "rgb(213, 213, 213)", | |
"line-width": { | |
base: 1.4, | |
stops: [[5.8, 0], [6, 3], [20, 40]] | |
}, | |
"line-opacity": 1 | |
} | |
}, { | |
id: "tunnel_motorway_inner", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 6, | |
filter: ["all", ["==", "$type", "LineString"], ["all", ["==", "brunnel", "tunnel"], ["==", "class", "motorway"]]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "rgb(234,234,234)", | |
"line-width": { | |
base: 1.4, | |
stops: [[4, 2], [6, 1.3], [20, 30]] | |
} | |
} | |
}, { | |
id: "aeroway-taxiway", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "aeroway", | |
minzoom: 12, | |
filter: ["all", ["in", "class", "taxiway"]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "hsl(0, 0%, 88%)", | |
"line-width": { | |
base: 1.55, | |
stops: [[13, 1.8], [20, 20]] | |
}, | |
"line-opacity": 1 | |
} | |
}, { | |
id: "aeroway-runway-casing", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "aeroway", | |
minzoom: 11, | |
filter: ["all", ["in", "class", "runway"]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "hsl(0, 0%, 88%)", | |
"line-width": { | |
base: 1.5, | |
stops: [[11, 6], [17, 55]] | |
}, | |
"line-opacity": 1 | |
} | |
}, { | |
id: "aeroway-area", | |
type: "fill", | |
source: "openmaptiles", | |
"source-layer": "aeroway", | |
minzoom: 4, | |
filter: ["all", ["==", "$type", "Polygon"], ["in", "class", "runway", "taxiway"]], | |
layout: { | |
visibility: "visible" | |
}, | |
paint: { | |
"fill-opacity": { | |
base: 1, | |
stops: [[13, 0], [14, 1]] | |
}, | |
"fill-color": "rgba(255, 255, 255, 1)" | |
} | |
}, { | |
id: "aeroway-runway", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "aeroway", | |
minzoom: 11, | |
filter: ["all", ["in", "class", "runway"], ["==", "$type", "LineString"]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "rgba(255, 255, 255, 1)", | |
"line-width": { | |
base: 1.5, | |
stops: [[11, 4], [17, 50]] | |
}, | |
"line-opacity": 1 | |
} | |
}, { | |
id: "highway_path", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
filter: ["all", ["==", "$type", "LineString"], ["==", "class", "path"]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "rgb(234, 234, 234)", | |
"line-width": { | |
base: 1.2, | |
stops: [[13, 1], [20, 10]] | |
}, | |
"line-opacity": .9 | |
} | |
}, { | |
id: "highway_minor_casing", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 8, | |
filter: ["all", ["==", "$type", "LineString"], ["in", "class", "minor", "service", "track"]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "hsl(0, 0%, 83%)", | |
"line-width": { | |
base: 1.3, | |
stops: [[13, 1.9], [20, 21]] | |
} | |
} | |
}, { | |
id: "highway_minor", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 8, | |
filter: ["all", ["==", "$type", "LineString"], ["in", "class", "minor", "service", "track"]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "hsl(0, 0%, 92%)", | |
"line-width": { | |
base: 1.55, | |
stops: [[13, 1.8], [20, 20]] | |
} | |
} | |
}, { | |
id: "highway_major_casing", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 11, | |
filter: ["all", ["==", "$type", "LineString"], ["in", "class", "primary", "secondary", "tertiary", "trunk"]], | |
layout: { | |
"line-cap": "butt", | |
"line-join": "miter", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "rgb(213, 213, 213)", | |
"line-dasharray": [12, 0], | |
"line-width": { | |
base: 1.3, | |
stops: [[10, 3], [20, 23]] | |
} | |
} | |
}, { | |
id: "highway_major_inner", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 11, | |
filter: ["all", ["==", "$type", "LineString"], ["in", "class", "primary", "secondary", "tertiary", "trunk"]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "#fff", | |
"line-width": { | |
base: 1.3, | |
stops: [[10, 2], [20, 20]] | |
} | |
} | |
}, { | |
id: "highway_major_subtle", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
maxzoom: 11, | |
filter: ["all", ["==", "$type", "LineString"], ["in", "class", "primary", "secondary", "tertiary", "trunk"]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "hsla(0, 0%, 85%, 0.69)", | |
"line-width": 1 | |
} | |
}, { | |
id: "highway_motorway_casing", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 6, | |
filter: ["all", ["==", "$type", "LineString"], ["all", ["!in", "brunnel", "bridge", "tunnel"], ["==", "class", "motorway"]]], | |
layout: { | |
"line-cap": "butt", | |
"line-join": "miter", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "rgb(213, 213, 213)", | |
"line-width": { | |
base: 1.4, | |
stops: [[5.8, 0], [6, 3], [20, 40]] | |
}, | |
"line-dasharray": [2, 0], | |
"line-opacity": 1 | |
} | |
}, { | |
id: "highway_motorway_inner", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 6, | |
filter: ["all", ["==", "$type", "LineString"], ["all", ["!in", "brunnel", "bridge", "tunnel"], ["==", "class", "motorway"]]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": { | |
base: 1, | |
stops: [[5.8, "hsla(0, 0%, 85%, 0.53)"], [6, "#fff"]] | |
}, | |
"line-width": { | |
base: 1.4, | |
stops: [[4, 2], [6, 1.3], [20, 30]] | |
} | |
} | |
}, { | |
id: "highway_motorway_subtle", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
maxzoom: 6, | |
filter: ["all", ["==", "$type", "LineString"], ["==", "class", "motorway"]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "hsla(0, 0%, 85%, 0.53)", | |
"line-width": { | |
base: 1, | |
stops: [[4, 1], [6, 1.3]] | |
} | |
} | |
}, { | |
id: "railway_transit", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 16, | |
filter: ["all", ["==", "$type", "LineString"], ["all", ["==", "class", "transit"], ["!in", "brunnel", "tunnel"]]], | |
layout: { | |
visibility: "visible", | |
"line-join": "round" | |
}, | |
paint: { | |
"line-color": "#dddddd", | |
"line-width": 3 | |
} | |
}, { | |
id: "railway_transit_dashline", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 16, | |
filter: ["all", ["==", "$type", "LineString"], ["all", ["==", "class", "transit"], ["!in", "brunnel", "tunnel"]]], | |
layout: { | |
visibility: "visible", | |
"line-join": "round" | |
}, | |
paint: { | |
"line-color": "#fafafa", | |
"line-width": 2, | |
"line-dasharray": [3, 3] | |
} | |
}, { | |
id: "railway_service", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 16, | |
filter: ["all", ["==", "$type", "LineString"], ["all", ["==", "class", "rail"], ["has", "service"]]], | |
layout: { | |
visibility: "visible", | |
"line-join": "round" | |
}, | |
paint: { | |
"line-color": "#dddddd", | |
"line-width": 3 | |
} | |
}, { | |
id: "railway_service_dashline", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 16, | |
filter: ["all", ["==", "$type", "LineString"], ["==", "class", "rail"], ["has", "service"]], | |
layout: { | |
visibility: "visible", | |
"line-join": "round" | |
}, | |
paint: { | |
"line-color": "#fafafa", | |
"line-width": 2, | |
"line-dasharray": [3, 3] | |
} | |
}, { | |
id: "railway", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 7, | |
filter: ["all", ["==", "$type", "LineString"], ["all", ["!has", "service"], ["==", "class", "rail"]]], | |
layout: { | |
visibility: "visible", | |
"line-join": "round" | |
}, | |
paint: { | |
"line-color": "#c0c0c0", | |
"line-width": { | |
base: 1.3, | |
stops: [[9, 1], [20, 7]] | |
} | |
} | |
}, { | |
id: "railway_dashline", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 11, | |
filter: ["all", ["==", "$type", "LineString"], ["all", ["!has", "service"], ["==", "class", "rail"]]], | |
layout: { | |
visibility: "visible", | |
"line-join": "round" | |
}, | |
paint: { | |
"line-color": "#fafafa", | |
"line-width": { | |
base: 1.3, | |
stops: [[11, 1], [20, 6]] | |
}, | |
"line-dasharray": [3, 3] | |
} | |
}, { | |
id: "highway_motorway_bridge_casing", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 6, | |
filter: ["all", ["==", "$type", "LineString"], ["all", ["==", "brunnel", "bridge"], ["==", "class", "motorway"]]], | |
layout: { | |
"line-cap": "butt", | |
"line-join": "miter", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": "rgb(213, 213, 213)", | |
"line-width": { | |
base: 1.4, | |
stops: [[5.8, 0], [6, 5], [20, 45]] | |
}, | |
"line-dasharray": [2, 0], | |
"line-opacity": 1 | |
} | |
}, { | |
id: "highway_motorway_bridge_inner", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "transportation", | |
minzoom: 6, | |
filter: ["all", ["==", "$type", "LineString"], ["all", ["==", "brunnel", "bridge"], ["==", "class", "motorway"]]], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round", | |
visibility: "visible" | |
}, | |
paint: { | |
"line-color": { | |
base: 1, | |
stops: [[5.8, "hsla(0, 0%, 85%, 0.53)"], [6, "#fff"]] | |
}, | |
"line-width": { | |
base: 1.4, | |
stops: [[4, 2], [6, 1.3], [20, 30]] | |
} | |
} | |
}, { | |
id: "boundary_country", | |
type: "line", | |
source: "openmaptiles", | |
"source-layer": "boundary", | |
filter: ["==", "admin_level", 2], | |
layout: { | |
"line-cap": "round", | |
"line-join": "round" | |
}, | |
paint: { | |
"line-color": "rgb(230, 204, 207)", | |
"line-width": { | |
base: 1.1, | |
stops: [[3, 1], [22, 20]] | |
}, | |
"line-blur": { | |
base: 1, | |
stops: [[0, .4], [22, 4]] | |
}, | |
"line-dasharray": [4, 4] | |
} | |
}]; | |
var ke = "hsl(0, 0%, 20%)" | |
, Te = "rgb(242,243,240)"; | |
const De = [{ | |
id: "place_suburb", | |
type: "symbol", | |
source: "openmaptiles", | |
"source-layer": "place", | |
minzoom: 12, | |
maxzoom: 17, | |
filter: ["all", ["==", "$type", "Point"], ["==", "class", "suburb"]], | |
layout: { | |
"text-anchor": "center", | |
"text-field": "{name:latin}\n{name:nonlatin}", | |
"text-font": ["Metropolis Regular", "Noto Sans Regular"], | |
"text-justify": "center", | |
"text-offset": [.5, 0], | |
"text-size": { | |
base: 1, | |
stops: [[12, 9], [17, 17]] | |
}, | |
visibility: "visible" | |
}, | |
paint: { | |
"text-color": ke, | |
"text-halo-blur": 1, | |
"text-halo-color": Te, | |
"text-halo-width": 2 | |
} | |
}, { | |
id: "place_village", | |
type: "symbol", | |
source: "openmaptiles", | |
"source-layer": "place", | |
minzoom: 12, | |
maxzoom: 17, | |
filter: ["all", ["==", "$type", "Point"], ["==", "class", "village"]], | |
layout: { | |
"text-anchor": "center", | |
"text-field": "{name:latin}\n{name:nonlatin}", | |
"text-font": ["Metropolis Regular", "Noto Sans Regular"], | |
"text-justify": "center", | |
"text-offset": [.5, .2], | |
"text-size": { | |
base: 1, | |
stops: [[12, 9], [17, 18]] | |
}, | |
visibility: "visible" | |
}, | |
paint: { | |
"text-color": ke, | |
"text-halo-blur": 1, | |
"text-halo-color": Te, | |
"text-halo-width": 2 | |
} | |
}, { | |
id: "place_town", | |
type: "symbol", | |
source: "openmaptiles", | |
"source-layer": "place", | |
minzoom: 10, | |
maxzoom: 15, | |
filter: ["all", ["==", "$type", "Point"], ["==", "class", "town"]], | |
layout: { | |
"text-anchor": "center", | |
"text-field": "{name:latin}\n{name:nonlatin}", | |
"text-font": ["Metropolis Regular", "Noto Sans Regular"], | |
"text-justify": "center", | |
"text-offset": [.5, .2], | |
"text-size": { | |
base: 1, | |
stops: [[10, 9], [15, 18]] | |
}, | |
visibility: "visible" | |
}, | |
paint: { | |
"text-color": ke, | |
"text-halo-blur": 1, | |
"text-halo-color": Te, | |
"text-halo-width": 2 | |
} | |
}, { | |
id: "place_city", | |
type: "symbol", | |
source: "openmaptiles", | |
"source-layer": "place", | |
minzoom: 7.5, | |
maxzoom: 12, | |
filter: ["all", ["==", "$type", "Point"], ["all", ["!=", "capital", 2], ["==", "class", "city"], [">", "rank", 3]]], | |
layout: { | |
"text-anchor": "center", | |
"text-field": "{name:latin}\n{name:nonlatin}", | |
"text-font": ["Metropolis Regular", "Noto Sans Regular"], | |
"text-justify": "center", | |
"text-offset": [.5, .2], | |
"text-size": 12, | |
visibility: "visible" | |
}, | |
paint: { | |
"text-color": ke, | |
"text-halo-blur": 1, | |
"text-halo-color": Te, | |
"text-halo-width": 2 | |
} | |
}, { | |
id: "place_capital", | |
type: "symbol", | |
source: "openmaptiles", | |
"source-layer": "place", | |
minzoom: 5.5, | |
maxzoom: 12, | |
filter: ["all", ["==", "$type", "Point"], ["all", ["==", "capital", 2], ["==", "class", "city"]]], | |
layout: { | |
"text-anchor": "center", | |
"text-field": "{name:latin}\n{name:nonlatin}", | |
"text-font": ["Metropolis Regular", "Noto Sans Regular"], | |
"text-justify": "center", | |
"text-offset": [.5, .2], | |
"text-size": 14, | |
visibility: "visible" | |
}, | |
paint: { | |
"text-color": ke, | |
"text-halo-blur": 1, | |
"text-halo-color": Te, | |
"text-halo-width": 2 | |
} | |
}, { | |
id: "place_city_large", | |
type: "symbol", | |
source: "openmaptiles", | |
"source-layer": "place", | |
minzoom: 7, | |
maxzoom: 12, | |
filter: ["all", ["==", "$type", "Point"], ["all", ["!=", "capital", 2], ["<=", "rank", 3], ["==", "class", "city"]]], | |
layout: { | |
"text-anchor": "center", | |
"text-field": "{name:latin}\n{name:nonlatin}", | |
"text-font": ["Metropolis Regular", "Noto Sans Regular"], | |
"text-justify": "center", | |
"text-offset": [.5, .2], | |
"text-size": 14, | |
visibility: "visible" | |
}, | |
paint: { | |
"text-color": ke, | |
"text-halo-blur": 1, | |
"text-halo-color": Te, | |
"text-halo-width": 2 | |
} | |
}, { | |
id: "place_state", | |
type: "symbol", | |
source: "openmaptiles", | |
"source-layer": "place", | |
minzoom: 5, | |
maxzoom: 12, | |
filter: ["all", ["==", "$type", "Point"], ["==", "class", "state"]], | |
layout: { | |
"text-field": "{name:latin}\n{name:nonlatin}", | |
"text-font": ["Metropolis Regular", "Noto Sans Regular"], | |
"text-size": 15, | |
visibility: "visible" | |
}, | |
paint: { | |
"text-color": ke, | |
"text-halo-blur": 1, | |
"text-halo-color": Te, | |
"text-halo-width": 2 | |
} | |
}, { | |
id: "place_country_other", | |
type: "symbol", | |
source: "openmaptiles", | |
"source-layer": "place", | |
maxzoom: 8, | |
filter: ["all", ["==", "$type", "Point"], ["==", "class", "country"], ["!has", "iso_a2"]], | |
layout: { | |
"text-field": ["case", ["has", "name:en"], ["get", "name:en"], ["get", "name:latin"]], | |
"text-font": ["Metropolis Light Italic", "Noto Sans Italic"], | |
"text-size": { | |
base: 1, | |
stops: [[0, 9], [6, 13]] | |
}, | |
visibility: "visible" | |
}, | |
paint: { | |
"text-color": ke, | |
"text-halo-color": Te, | |
"text-halo-width": 2 | |
} | |
}, { | |
id: "place_country_minor", | |
type: "symbol", | |
source: "openmaptiles", | |
"source-layer": "place", | |
maxzoom: 8, | |
filter: ["all", ["==", "$type", "Point"], ["==", "class", "country"], [">=", "rank", 2], ["has", "iso_a2"]], | |
layout: { | |
"text-field": ["case", ["has", "name:en"], ["get", "name:en"], ["get", "name:latin"]], | |
"text-font": ["Metropolis Regular", "Noto Sans Regular"], | |
"text-size": { | |
base: 1, | |
stops: [[0, 10], [6, 12]] | |
}, | |
visibility: "visible" | |
}, | |
paint: { | |
"text-color": ke, | |
"text-halo-color": Te, | |
"text-halo-width": 2 | |
} | |
}, { | |
id: "place_country_major", | |
type: "symbol", | |
source: "openmaptiles", | |
"source-layer": "place", | |
maxzoom: 5, | |
filter: ["all", ["==", "$type", "Point"], ["<=", "rank", 1], ["==", "class", "country"], ["has", "iso_a2"]], | |
layout: { | |
"text-anchor": "center", | |
"text-field": ["case", ["has", "name:en"], ["get", "name:en"], ["get", "name:latin"]], | |
"text-font": ["Metropolis Regular", "Noto Sans Regular"], | |
"text-size": { | |
base: 1.4, | |
stops: [[0, 10], [3, 12], [4, 14]] | |
}, | |
visibility: "visible" | |
}, | |
paint: { | |
"text-color": ke, | |
"text-halo-color": Te, | |
"text-halo-width": 2.4 | |
} | |
}]; | |
var Ie = [{ | |
zorder: 162, | |
id: "heatmap_solar", | |
type: "heatmap", | |
source: "solar_heatmap", | |
"source-layer": "power_heatmap_solar", | |
minzoom: 1, | |
maxzoom: 13, | |
paint: { | |
"heatmap-weight": ["interpolate", ["linear"], ["to-number", ["get", "output"]], 0, 0, 70, .125, 250, .25, 1e3, .35, 7e3, .5, 14e3, 1], | |
"heatmap-intensity": .8, | |
"heatmap-color": ["interpolate", ["linear"], ["heatmap-density"], 0, "rgba(255,255,204,0)", .1, "rgb(255,237,160)", .2, "rgb(254,217,118)", .3, "rgb(254,178,76)", .45, "rgb(253,141,60)", .55, "rgb(252,78,42)", .7, "rgb(227,26,28)", .9, "rgb(189,0,38)", 1, "rgb(128,0,38)"], | |
"heatmap-radius": ["interpolate", ["linear"], ["zoom"], 2, 2, 6, 6, 10, 12, 12, 20] | |
}, | |
layout: { | |
visibility: "none" | |
} | |
}]; | |
function Fe() { | |
if (!x().supported({ | |
failIfMajorPerformanceCaveat: !0 | |
})) { | |
var t = new ut("Warning"); | |
t.update('Your browser may have performance or functionality issues with OpenInfraMap.<br/><a href="http://webglreport.com">WebGL</a> with hardware acceleration is required for this site to perform well.'), | |
S(document.body, t) | |
} | |
x().setRTLTextPlugin("https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js", null, !0); | |
var e = re.concat(Ie, le, ie, ne); | |
e.sort((function(t, e) { | |
return t.zorder < e.zorder ? -1 : t.zorder > e.zorder ? 1 : 0 | |
} | |
)); | |
var r = new it({ | |
Power: "power_", | |
"Solar Generation": "heatmap_", | |
Telecoms: "telecoms_", | |
"Oil & Gas": "petroleum_", | |
Water: "water_", | |
Labels: "place_" | |
},["Power", "Labels"]) | |
, i = new class { | |
constructor(t) { | |
this.layerSwitcher = t, | |
this._onHashChange() | |
} | |
enable(t) { | |
this._map = t, | |
t.on("moveend", (()=>{ | |
this._updateHash() | |
} | |
)), | |
window.addEventListener("hashchange", (()=>{ | |
this._onHashChange() | |
} | |
), !1) | |
} | |
_onHashChange() { | |
const t = window.location.hash.replace("#", "").split("/"); | |
if (t.length >= 3) { | |
let e = ""; | |
this._map && this._map.jumpTo({ | |
center: [+t[2], +t[1]], | |
zoom: +t[0] | |
}); | |
for (let r = 3; r < t.length; r++) { | |
let i = t[r] | |
, n = i.match(/([a-z])=(.*)/); | |
if (n) { | |
if ("m" != n[1]) | |
return !1; | |
markerString = n[2] | |
} else | |
e = i | |
} | |
return this.layerSwitcher && this.layerSwitcher.setURLString(e), | |
!0 | |
} | |
return this.layerSwitcher && this.layerSwitcher.setURLString(""), | |
!1 | |
} | |
_updateHash() { | |
try { | |
window.history.replaceState(window.history.state, "", this.getHashString()) | |
} catch (t) { | |
console.log(t) | |
} | |
} | |
getHashString() { | |
const t = this._map.getCenter() | |
, e = Math.round(100 * this._map.getZoom()) / 100 | |
, r = Math.ceil((e * Math.LN2 + Math.log(512 / 360 / .5)) / Math.LN10) | |
, i = Math.pow(10, r) | |
, n = Math.round(t.lng * i) / i | |
, o = Math.round(t.lat * i) / i; | |
this._map.getBearing(), | |
this._map.getPitch(); | |
let a = `#${e}/${o}/${n}` | |
, s = null; | |
return this.layerSwitcher && (s = this.layerSwitcher.getURLString()), | |
s && (a += "/" + s), | |
a | |
} | |
init(t) { | |
t.hash = !1; | |
const e = window.location.hash.replace("#", "").split("/"); | |
return e.length >= 3 && (t.center = [+e[2], +e[1]], | |
t.zoom = +e[0]), | |
t | |
} | |
} | |
(r); | |
r.urlhash = i, | |
ze.layers = Se.concat(e, De), | |
r.setInitialVisibility(ze); | |
var n = new (x().Map)(i.init({ | |
container: "map", | |
style: ze, | |
minZoom: 2, | |
maxZoom: 17.9, | |
center: [12, 26] | |
})); | |
n.dragRotate.disable(), | |
n.touchZoomRotate.disableRotation(), | |
i.enable(n), | |
n.addControl(new (x().NavigationControl)({ | |
showCompass: !1 | |
}), "top-right"), | |
n.addControl(new (x().GeolocateControl)({ | |
positionOptions: { | |
enableHighAccuracy: !0 | |
}, | |
trackUserLocation: !0 | |
})), | |
n.addControl(new st, "bottom-right"), | |
n.addControl(new (x().ScaleControl)({ | |
position: "bottom-left" | |
})), | |
n.addControl(new Ae, "top-right"), | |
n.addControl(r, "top-right"), | |
n.addControl(new ot, "bottom-right"), | |
new wt(e.map((function(t) { | |
return t.id | |
} | |
)),9).add(n) | |
} | |
"loading" != document.readyState ? Fe() : document.addEventListener("DOMContentLoaded", Fe) | |
} | |
, | |
2054: (t,e,r)=>{ | |
"use strict"; | |
r.d(e, { | |
Z: ()=>c | |
}); | |
var i = r(3645) | |
, n = r.n(i) | |
, o = r(1667) | |
, a = r.n(o) | |
, s = new URL(r(659),r.b) | |
, l = n()((function(t) { | |
return t[1] | |
} | |
)) | |
, u = a()(s); | |
l.push([t.id, ".layer-switcher {\n min-height: 30px;\n min-width: 30px;\n background: url(" + u + ")\n white;\n background-repeat: no-repeat;\n background-size: 15px 15px;\n background-position: center;\n}\n\n.layer-switcher-list {\n background: white;\n padding-left: 8px;\n padding-right: 8px;\n position: relative;\n display: none;\n margin: 0 !important;\n font-size: 15px;\n}\n\n.layer-switcher-list h3 {\n margin: 0px;\n margin-top: 6px;\n}\n\n.layer-switcher-list ul {\n list-style: none;\n padding: 0;\n user-select: none;\n margin-bottom: 4px;\n}\n\n.layer-switcher-list li {\n display: block;\n width: 100%;\n height: 25px;\n}\n\n.layer-switcher-list input {\n margin-left: 8px;\n margin-top: 4px;\n float: right;\n}\n\n.layer-switcher-list label {\n float: left;\n}\n", ""]); | |
const c = l | |
} | |
, | |
7274: (t,e,r)=>{ | |
"use strict"; | |
r.d(e, { | |
Z: ()=>lt | |
}); | |
var i = r(3645) | |
, n = r.n(i) | |
, o = r(1667) | |
, a = r.n(o) | |
, s = new URL(r(6248),r.b) | |
, l = new URL(r(851),r.b) | |
, u = new URL(r(4710),r.b) | |
, c = new URL(r(1963),r.b) | |
, p = new URL(r(9168),r.b) | |
, h = new URL(r(9515),r.b) | |
, f = new URL(r(4842),r.b) | |
, d = new URL(r(6181),r.b) | |
, m = new URL(r(7103),r.b) | |
, y = new URL(r(3561),r.b) | |
, g = new URL(r(2502),r.b) | |
, v = new URL(r(35),r.b) | |
, _ = new URL(r(6734),r.b) | |
, x = new URL(r(798),r.b) | |
, b = new URL(r(9566),r.b) | |
, w = new URL(r(4127),r.b) | |
, E = new URL(r(292),r.b) | |
, C = new URL(r(7120),r.b) | |
, A = new URL(r(9450),r.b) | |
, z = new URL(r(7355),r.b) | |
, S = new URL(r(2832),r.b) | |
, k = new URL(r(425),r.b) | |
, T = new URL(r(87),r.b) | |
, D = new URL(r(6220),r.b) | |
, I = new URL(r(1716),r.b) | |
, F = new URL(r(2896),r.b) | |
, B = new URL(r(2820),r.b) | |
, P = n()((function(t) { | |
return t[1] | |
} | |
)) | |
, M = a()(s) | |
, L = a()(l) | |
, R = a()(u) | |
, O = a()(c) | |
, U = a()(p) | |
, V = a()(h) | |
, j = a()(f) | |
, N = a()(d) | |
, q = a()(m) | |
, G = a()(y) | |
, Z = a()(g) | |
, X = a()(v) | |
, W = a()(_) | |
, H = a()(x) | |
, K = a()(b) | |
, J = a()(w) | |
, Y = a()(E) | |
, $ = a()(C) | |
, Q = a()(A) | |
, tt = a()(z) | |
, et = a()(S) | |
, rt = a()(k) | |
, it = a()(T) | |
, nt = a()(D) | |
, ot = a()(I) | |
, at = a()(F) | |
, st = a()(B); | |
P.push([t.id, ".mapboxgl-map,.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas,.maplibregl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen,.maplibregl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass,.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer,.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active,.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right,.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left,.maplibregl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right,.maplibregl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left,.maplibregl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right,.maplibregl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl,.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl,.maplibregl-ctrl-top-left .maplibregl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl,.maplibregl-ctrl-top-right .maplibregl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group,.maplibregl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty),.maplibregl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty),.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button,.maplibregl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button,.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon,.maplibregl-ctrl button .maplibregl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon,.maplibregl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button,.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner,.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus,.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled,.maplibregl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover,.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible,.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible),.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child,.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child,.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child,.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(" + M + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(" + L + ")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(" + R + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(" + O + ")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(" + U + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(" + V + ")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(" + j + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(" + N + ")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(" + q + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(" + G + ")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(" + Z + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(" + N + ")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(" + X + ")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(" + W + ")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(" + H + ")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(" + K + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(" + J + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(" + Y + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(" + $ + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(" + Q + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(" + tt + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{-webkit-animation:maplibregl-spin 2s linear infinite;-moz-animation:maplibregl-spin 2s infinite linear;-o-animation:maplibregl-spin 2s infinite linear;-ms-animation:maplibregl-spin 2s infinite linear;animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(" + et + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(" + rt + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(" + Y + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(" + $ + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(" + Q + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(" + tt + ")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(" + it + ")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(" + nt + ")}}@-webkit-keyframes maplibregl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes maplibregl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes maplibregl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes maplibregl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url(" + ot + ")}a.mapboxgl-ctrl-logo.mapboxgl-compact,a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{background-color:transparent;background-image:url(" + ot + ")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{background-image:url(" + ot + ")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib,.maplibregl-ctrl.maplibregl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact,.maplibregl-ctrl-attrib.maplibregl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner,.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url(" + at + ");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner,.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(" + st + ")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(" + at + ')}}.mapboxgl-ctrl-attrib a,.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover,.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map,.maplibregl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty,.maplibregl-attrib-empty{display:none}.mapboxgl-ctrl-scale,.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup,.maplibregl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right,.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right,.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left,.maplibregl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right,.maplibregl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip,.maplibregl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip,.maplibregl-popup-anchor-top .maplibregl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-left .maplibregl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-right .maplibregl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button,.maplibregl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover,.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content,.maplibregl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content,.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content,.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content,.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content,.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer,.maplibregl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *,.maplibregl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer,.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer,.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.mapboxgl-marker,.maplibregl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.maplibregl-user-location-dot{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before,.maplibregl-user-location-dot:before{background-color:#1da1f2;content:"";width:15px;height:15px;border-radius:50%;position:absolute;-webkit-animation:maplibregl-user-location-dot-pulse 2s infinite;-moz-animation:maplibregl-user-location-dot-pulse 2s infinite;-ms-animation:maplibregl-user-location-dot-pulse 2s infinite;animation:maplibregl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after,.maplibregl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes maplibregl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes maplibregl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes maplibregl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale,.maplibregl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after,.maplibregl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle,.maplibregl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active,.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom,.maplibregl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}', ""]); | |
const lt = P | |
} | |
, | |
1424: (t,e,r)=>{ | |
"use strict"; | |
r.d(e, { | |
Z: ()=>s | |
}); | |
var i = r(3645) | |
, n = r.n(i) | |
, o = r(7274) | |
, a = n()((function(t) { | |
return t[1] | |
} | |
)); | |
a.i(o.Z), | |
a.push([t.id, "html {\n width: 100%;\n height: 100%;\n font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\n color: #333;\n}\n\nbody,\n#container,\n#map {\n width: 100%;\n height: 100%;\n margin: 0px;\n}\n\n#container {\n display: block !important;\n}\n\nheader {\n z-index: 2;\n padding: 4px;\n border-radius: 0px 0px 4px 0px;\n border-right: 1px #eee solid;\n border-bottom: 1px #eee solid;\n background-color: rgba(255, 255, 255, 0.5);\n top: 0px;\n left: 0px;\n position: absolute;\n display: block;\n font-size: 13px;\n}\n\nheader, .maplibregl-ctrl.maplibregl-ctrl-attrib {\n backdrop-filter: blur(3px) saturate(80%);\n}\n\nh1 {\n display: inline;\n margin: 0px;\n font-size: 18px;\n}\n\na {\n color: #333;\n}\n\n.infobox {\n display: block;\n position: absolute;\n bottom: 40px;\n min-width: 60px;\n max-width: 300px;\n left: 5%;\n background-color: white;\n padding: 5px;\n border: 1px solid #999;\n border-radius: 4px;\n}\n\n.infobox-header {\n font-weight: bold;\n padding-bottom: 5px;\n border-bottom: 1px solid #bbb;\n margin-bottom: 4px;\n}\n\n.infobox-header a {\n cursor: pointer;\n float: right;\n margin-top: -3px;\n}\n\n.infobox-content {\n clear: both;\n}\n\n.maplibregl-ctrl-attrib {\n font-size: 10px;\n line-height: 14px;\n border-radius: 4px 0px 0px 0px;\n}\n\ncanvas:focus {\n /* Remove unnecessary focus border */\n outline:none;\n}\n\n#maptiler-attribution {\n background-color: rgba(255, 255, 255, 0.5);\n backdrop-filter: blur(3px) saturate(80%);\n border-radius: 4px;\n}\n\n#maptiler-attribution img {\n display: block;\n width: 100px;\n padding: 2px;\n}\n", ""]); | |
const s = a | |
} | |
, | |
2021: (t,e,r)=>{ | |
"use strict"; | |
r.d(e, { | |
Z: ()=>y | |
}); | |
var i = r(3645) | |
, n = r.n(i) | |
, o = r(1667) | |
, a = r.n(o) | |
, s = new URL(r(9617),r.b) | |
, l = new URL(r(7251),r.b) | |
, u = new URL(r(3478),r.b) | |
, c = new URL(r(6518),r.b) | |
, p = n()((function(t) { | |
return t[1] | |
} | |
)) | |
, h = a()(s) | |
, f = a()(l) | |
, d = a()(u) | |
, m = a()(c); | |
p.push([t.id, 'table.item_info th {\n\ttext-align: left;\n}\n\n.maplibregl-popup {\n max-width: 350px !important; \n}\n\n.maplibregl-popup .nameContainer {\n margin-bottom: 5px;\n}\n\n.maplibregl-popup h3 {\n margin-top: 0px;\n margin-bottom: 0px;\n}\n\n.maplibregl-popup h4::before {\n content: "("\n}\n\n.maplibregl-popup h4::after {\n content: ")"\n}\n\n.maplibregl-popup h4 {\n font-weight: normal;\n margin-top: 0px;\n margin-bottom: 0px;\n}\n\n.wikidata_image {\n border: 1px solid #ddd;\n}\n\ndiv.ext_link {\n display: inline-block;\n height: 30px;\n width: 30px;\n background-size: 30px 30px;\n}\n\ndiv.wikidata_link {\nbackground-image: url(' + h + ");\n}\n\ndiv.wikipedia_link {\n background-image: url(" + f + ");\n}\n\ndiv.osm_link {\n height: 20px;\n width: 20px;\n background-size: 20px 20px;\n background-repeat: no-repeat;\n padding-bottom: 5px;\n padding-right: 3px;\n background-image: url(" + d + ");\n}\n\ndiv.commons_link {\n height: 25px;\n width: 25px;\n background-size: 25px 25px;\n background-repeat: no-repeat;\n padding-bottom: 3px;\nbackground-image: url(" + m + ");\n}\n", ""]); | |
const y = p | |
} | |
, | |
3465: (t,e,r)=>{ | |
"use strict"; | |
r.d(e, { | |
Z: ()=>c | |
}); | |
var i = r(3645) | |
, n = r.n(i) | |
, o = r(1667) | |
, a = r.n(o) | |
, s = new URL(r(1630),r.b) | |
, l = n()((function(t) { | |
return t[1] | |
} | |
)) | |
, u = a()(s); | |
l.push([t.id, ".oim-key-control {\n min-height: 30px;\n min-width: 30px;\n background: url(" + u + ") white;\n background-repeat: no-repeat;\n background-size: 20px 20px;\n background-position: center;\n}\n\n.oim-key-panel {\n display: none;\n min-width: 220px;\n min-height: 300px;\n margin: 0px 0px 8px 0px !important; \n}\n\n.oim-key-pane {\n padding-left: 8px;\n padding-right: 2px;\n overflow-y: scroll;\n}\n\n.oim-key-pane h3 {\n margin-top: 0;\n margin-bottom: 3px;\n border-bottom: 1px #eee solid;\n clear: both;\n}\n\n.oim-key-pane table {\n width: 100%;\n padding: 0px;\n}\n.oim-key-pane table tr {\n padding: 0px;\n}\n\n\n.oim-key-pane table td {\n vertical-align: center;\n}\n\n.oim-key-pane table tr td:nth-child(2) {\n width: 30px;\n text-align: center;\n}\n\n\n.oim-plant-sprite {\n margin-left: auto;\n margin-right: auto;\n vertical-align: middle;\n}\n\n.oim-key-header {\n width: 100%;\n height: 20px;\n padding-bottom: 5px;\n padding-top: 2px;\n padding-left: 8px;\n background-color: #eee;\n}\n\n.oim-key-header h2 {\n margin: 0px;\n display: inline;\n}\n\n.oim-key-close {\n padding-right: 14px;\n float: right;\n font-weight: bold;\n font-size: 1.6em;\n cursor: pointer;\n}\n", ""]); | |
const c = l | |
} | |
, | |
3645: t=>{ | |
"use strict"; | |
t.exports = function(t) { | |
var e = []; | |
return e.toString = function() { | |
return this.map((function(e) { | |
var r = t(e); | |
return e[2] ? "@media ".concat(e[2], " {").concat(r, "}") : r | |
} | |
)).join("") | |
} | |
, | |
e.i = function(t, r, i) { | |
"string" == typeof t && (t = [[null, t, ""]]); | |
var n = {}; | |
if (i) | |
for (var o = 0; o < this.length; o++) { | |
var a = this[o][0]; | |
null != a && (n[a] = !0) | |
} | |
for (var s = 0; s < t.length; s++) { | |
var l = [].concat(t[s]); | |
i && n[l[0]] || (r && (l[2] ? l[2] = "".concat(r, " and ").concat(l[2]) : l[2] = r), | |
e.push(l)) | |
} | |
} | |
, | |
e | |
} | |
} | |
, | |
1667: t=>{ | |
"use strict"; | |
t.exports = function(t, e) { | |
return e || (e = {}), | |
t ? (t = String(t.__esModule ? t.default : t), | |
/^['"].*['"]$/.test(t) && (t = t.slice(1, -1)), | |
e.hash && (t += e.hash), | |
/["'() \t\n]|(%20)/.test(t) || e.needQuotes ? '"'.concat(t.replace(/"/g, '\\"').replace(/\n/g, "\\n"), '"') : t) : t | |
} | |
} | |
, | |
1144: t=>{ | |
"use strict"; | |
var e = function() { | |
var t, e, r = window.navigator || window.clientInformation || {}, i = [].concat(r.languages, r.language, r.userLanguage, r.browserLanguage, r.systemLanguage), n = []; | |
for (e = 0; e < i.length; e++) | |
(t = i[e]) && (t = t.replace(/-.*/, "").toLowerCase()) && -1 === n.indexOf(t) && n.push(t); | |
return n | |
}; | |
t.exports = { | |
first: function() { | |
var t = e(); | |
return t.length ? t[0] : null | |
}, | |
list: e, | |
pick: function(t, r) { | |
var i, n = e(), o = null; | |
for (r = r || null, | |
i = 0; i < n.length && null === o; i++) | |
-1 !== t.indexOf(n[i]) && (o = n[i]); | |
return null === o && (o = r), | |
o | |
} | |
} | |
} | |
, | |
6668: t=>{ | |
var e, r, i = 9007199254740991, n = /^(?:0|[1-9]\d*)$/, o = Object.prototype, a = o.hasOwnProperty, s = o.toString, l = o.propertyIsEnumerable, u = (e = Object.keys, | |
r = Object, | |
function(t) { | |
return e(r(t)) | |
} | |
); | |
function c(t, e, r, i) { | |
return function(t, e) { | |
t && function(t, e, r) { | |
for (var i = -1, n = Object(t), o = r(t), a = o.length; a--; ) { | |
var s = o[++i]; | |
if (!1 === e(n[s], s, n)) | |
break | |
} | |
}(t, e, v) | |
}(t, (function(t, n, o) { | |
e(i, r(t), n, o) | |
} | |
)), | |
i | |
} | |
function p(t, e) { | |
return !!(e = null == e ? i : e) && ("number" == typeof t || n.test(t)) && t > -1 && t % 1 == 0 && t < e | |
} | |
var h = Array.isArray; | |
function f(t) { | |
return null != t && function(t) { | |
return "number" == typeof t && t > -1 && t % 1 == 0 && t <= i | |
}(t.length) && !function(t) { | |
var e = function(t) { | |
var e = typeof t; | |
return !!t && ("object" == e || "function" == e) | |
}(t) ? s.call(t) : ""; | |
return "[object Function]" == e || "[object GeneratorFunction]" == e | |
}(t) | |
} | |
var d, m, y, g = (d = function(t, e, r) { | |
t[e] = r | |
} | |
, | |
y = function(t) { | |
return t | |
} | |
, | |
m = function() { | |
return y | |
} | |
, | |
function(t, e) { | |
return c(t, d, m(), {}) | |
} | |
); | |
function v(t) { | |
return f(t) ? function(t, e) { | |
var r = h(t) || function(t) { | |
return function(t) { | |
return function(t) { | |
return !!t && "object" == typeof t | |
}(t) && f(t) | |
}(t) && a.call(t, "callee") && (!l.call(t, "callee") || "[object Arguments]" == s.call(t)) | |
}(t) ? function(t, e) { | |
for (var r = -1, i = Array(t); ++r < t; ) | |
i[r] = e(r); | |
return i | |
}(t.length, String) : [] | |
, i = r.length | |
, n = !!i; | |
for (var o in t) | |
!e && !a.call(t, o) || n && ("length" == o || p(o, i)) || r.push(o); | |
return r | |
}(t) : function(t) { | |
if (r = (e = t) && e.constructor, | |
e !== ("function" == typeof r && r.prototype || o)) | |
return u(t); | |
var e, r, i = []; | |
for (var n in Object(t)) | |
a.call(t, n) && "constructor" != n && i.push(n); | |
return i | |
}(t) | |
} | |
t.exports = g | |
} | |
, | |
2307: (t,e,r)=>{ | |
t = r.nmd(t); | |
var i = "__lodash_hash_undefined__" | |
, n = 9007199254740991 | |
, o = "[object Arguments]" | |
, a = "[object Array]" | |
, s = "[object Boolean]" | |
, l = "[object Date]" | |
, u = "[object Error]" | |
, c = "[object Function]" | |
, p = "[object Map]" | |
, h = "[object Number]" | |
, f = "[object Object]" | |
, d = "[object Promise]" | |
, m = "[object RegExp]" | |
, y = "[object Set]" | |
, g = "[object String]" | |
, v = "[object WeakMap]" | |
, _ = "[object ArrayBuffer]" | |
, x = "[object DataView]" | |
, b = /^\[object .+?Constructor\]$/ | |
, w = /^(?:0|[1-9]\d*)$/ | |
, E = {}; | |
E["[object Float32Array]"] = E["[object Float64Array]"] = E["[object Int8Array]"] = E["[object Int16Array]"] = E["[object Int32Array]"] = E["[object Uint8Array]"] = E["[object Uint8ClampedArray]"] = E["[object Uint16Array]"] = E["[object Uint32Array]"] = !0, | |
E[o] = E[a] = E[_] = E[s] = E[x] = E[l] = E[u] = E[c] = E[p] = E[h] = E[f] = E[m] = E[y] = E[g] = E[v] = !1; | |
var C = "object" == typeof r.g && r.g && r.g.Object === Object && r.g | |
, A = "object" == typeof self && self && self.Object === Object && self | |
, z = C || A || Function("return this")() | |
, S = e && !e.nodeType && e | |
, k = S && t && !t.nodeType && t | |
, T = k && k.exports === S | |
, D = T && C.process | |
, I = function() { | |
try { | |
return D && D.binding && D.binding("util") | |
} catch (t) {} | |
}() | |
, F = I && I.isTypedArray; | |
function B(t, e) { | |
for (var r = -1, i = null == t ? 0 : t.length; ++r < i; ) | |
if (e(t[r], r, t)) | |
return !0; | |
return !1 | |
} | |
function P(t) { | |
var e = -1 | |
, r = Array(t.size); | |
return t.forEach((function(t, i) { | |
r[++e] = [i, t] | |
} | |
)), | |
r | |
} | |
function M(t) { | |
var e = -1 | |
, r = Array(t.size); | |
return t.forEach((function(t) { | |
r[++e] = t | |
} | |
)), | |
r | |
} | |
var L, R, O, U = Array.prototype, V = Function.prototype, j = Object.prototype, N = z["__core-js_shared__"], q = V.toString, G = j.hasOwnProperty, Z = (L = /[^.]+$/.exec(N && N.keys && N.keys.IE_PROTO || "")) ? "Symbol(src)_1." + L : "", X = j.toString, W = RegExp("^" + q.call(G).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), H = T ? z.Buffer : void 0, K = z.Symbol, J = z.Uint8Array, Y = j.propertyIsEnumerable, $ = U.splice, Q = K ? K.toStringTag : void 0, tt = Object.getOwnPropertySymbols, et = H ? H.isBuffer : void 0, rt = (R = Object.keys, | |
O = Object, | |
function(t) { | |
return R(O(t)) | |
} | |
), it = kt(z, "DataView"), nt = kt(z, "Map"), ot = kt(z, "Promise"), at = kt(z, "Set"), st = kt(z, "WeakMap"), lt = kt(Object, "create"), ut = Ft(it), ct = Ft(nt), pt = Ft(ot), ht = Ft(at), ft = Ft(st), dt = K ? K.prototype : void 0, mt = dt ? dt.valueOf : void 0; | |
function yt(t) { | |
var e = -1 | |
, r = null == t ? 0 : t.length; | |
for (this.clear(); ++e < r; ) { | |
var i = t[e]; | |
this.set(i[0], i[1]) | |
} | |
} | |
function gt(t) { | |
var e = -1 | |
, r = null == t ? 0 : t.length; | |
for (this.clear(); ++e < r; ) { | |
var i = t[e]; | |
this.set(i[0], i[1]) | |
} | |
} | |
function vt(t) { | |
var e = -1 | |
, r = null == t ? 0 : t.length; | |
for (this.clear(); ++e < r; ) { | |
var i = t[e]; | |
this.set(i[0], i[1]) | |
} | |
} | |
function _t(t) { | |
var e = -1 | |
, r = null == t ? 0 : t.length; | |
for (this.__data__ = new vt; ++e < r; ) | |
this.add(t[e]) | |
} | |
function xt(t) { | |
var e = this.__data__ = new gt(t); | |
this.size = e.size | |
} | |
function bt(t, e) { | |
for (var r = t.length; r--; ) | |
if (Bt(t[r][0], e)) | |
return r; | |
return -1 | |
} | |
function wt(t) { | |
return null == t ? void 0 === t ? "[object Undefined]" : "[object Null]" : Q && Q in Object(t) ? function(t) { | |
var e = G.call(t, Q) | |
, r = t[Q]; | |
try { | |
t[Q] = void 0; | |
var i = !0 | |
} catch (t) {} | |
var n = X.call(t); | |
return i && (e ? t[Q] = r : delete t[Q]), | |
n | |
}(t) : function(t) { | |
return X.call(t) | |
}(t) | |
} | |
function Et(t) { | |
return Vt(t) && wt(t) == o | |
} | |
function Ct(t, e, r, i, n) { | |
return t === e || (null == t || null == e || !Vt(t) && !Vt(e) ? t != t && e != e : function(t, e, r, i, n, c) { | |
var d = Mt(t) | |
, v = Mt(e) | |
, b = d ? a : Dt(t) | |
, w = v ? a : Dt(e) | |
, E = (b = b == o ? f : b) == f | |
, C = (w = w == o ? f : w) == f | |
, A = b == w; | |
if (A && Lt(t)) { | |
if (!Lt(e)) | |
return !1; | |
d = !0, | |
E = !1 | |
} | |
if (A && !E) | |
return c || (c = new xt), | |
d || jt(t) ? At(t, e, r, i, n, c) : function(t, e, r, i, n, o, a) { | |
switch (r) { | |
case x: | |
if (t.byteLength != e.byteLength || t.byteOffset != e.byteOffset) | |
return !1; | |
t = t.buffer, | |
e = e.buffer; | |
case _: | |
return !(t.byteLength != e.byteLength || !o(new J(t), new J(e))); | |
case s: | |
case l: | |
case h: | |
return Bt(+t, +e); | |
case u: | |
return t.name == e.name && t.message == e.message; | |
case m: | |
case g: | |
return t == e + ""; | |
case p: | |
var c = P; | |
case y: | |
var f = 1 & i; | |
if (c || (c = M), | |
t.size != e.size && !f) | |
return !1; | |
var d = a.get(t); | |
if (d) | |
return d == e; | |
i |= 2, | |
a.set(t, e); | |
var v = At(c(t), c(e), i, n, o, a); | |
return a.delete(t), | |
v; | |
case "[object Symbol]": | |
if (mt) | |
return mt.call(t) == mt.call(e) | |
} | |
return !1 | |
}(t, e, b, r, i, n, c); | |
if (!(1 & r)) { | |
var z = E && G.call(t, "__wrapped__") | |
, S = C && G.call(e, "__wrapped__"); | |
if (z || S) { | |
var k = z ? t.value() : t | |
, T = S ? e.value() : e; | |
return c || (c = new xt), | |
n(k, T, r, i, c) | |
} | |
} | |
return !!A && (c || (c = new xt), | |
function(t, e, r, i, n, o) { | |
var a = 1 & r | |
, s = zt(t) | |
, l = s.length; | |
if (l != zt(e).length && !a) | |
return !1; | |
for (var u = l; u--; ) { | |
var c = s[u]; | |
if (!(a ? c in e : G.call(e, c))) | |
return !1 | |
} | |
var p = o.get(t); | |
if (p && o.get(e)) | |
return p == e; | |
var h = !0; | |
o.set(t, e), | |
o.set(e, t); | |
for (var f = a; ++u < l; ) { | |
var d = t[c = s[u]] | |
, m = e[c]; | |
if (i) | |
var y = a ? i(m, d, c, e, t, o) : i(d, m, c, t, e, o); | |
if (!(void 0 === y ? d === m || n(d, m, r, i, o) : y)) { | |
h = !1; | |
break | |
} | |
f || (f = "constructor" == c) | |
} | |
if (h && !f) { | |
var g = t.constructor | |
, v = e.constructor; | |
g == v || !("constructor"in t) || !("constructor"in e) || "function" == typeof g && g instanceof g && "function" == typeof v && v instanceof v || (h = !1) | |
} | |
return o.delete(t), | |
o.delete(e), | |
h | |
}(t, e, r, i, n, c)) | |
}(t, e, r, i, Ct, n)) | |
} | |
function At(t, e, r, i, n, o) { | |
var a = 1 & r | |
, s = t.length | |
, l = e.length; | |
if (s != l && !(a && l > s)) | |
return !1; | |
var u = o.get(t); | |
if (u && o.get(e)) | |
return u == e; | |
var c = -1 | |
, p = !0 | |
, h = 2 & r ? new _t : void 0; | |
for (o.set(t, e), | |
o.set(e, t); ++c < s; ) { | |
var f = t[c] | |
, d = e[c]; | |
if (i) | |
var m = a ? i(d, f, c, e, t, o) : i(f, d, c, t, e, o); | |
if (void 0 !== m) { | |
if (m) | |
continue; | |
p = !1; | |
break | |
} | |
if (h) { | |
if (!B(e, (function(t, e) { | |
if (a = e, | |
!h.has(a) && (f === t || n(f, t, r, i, o))) | |
return h.push(e); | |
var a | |
} | |
))) { | |
p = !1; | |
break | |
} | |
} else if (f !== d && !n(f, d, r, i, o)) { | |
p = !1; | |
break | |
} | |
} | |
return o.delete(t), | |
o.delete(e), | |
p | |
} | |
function zt(t) { | |
return function(t, e, r) { | |
var i = e(t); | |
return Mt(t) ? i : function(t, e) { | |
for (var r = -1, i = e.length, n = t.length; ++r < i; ) | |
t[n + r] = e[r]; | |
return t | |
}(i, r(t)) | |
}(t, Nt, Tt) | |
} | |
function St(t, e) { | |
var r, i, n = t.__data__; | |
return ("string" == (i = typeof (r = e)) || "number" == i || "symbol" == i || "boolean" == i ? "__proto__" !== r : null === r) ? n["string" == typeof e ? "string" : "hash"] : n.map | |
} | |
function kt(t, e) { | |
var r = function(t, e) { | |
return null == t ? void 0 : t[e] | |
}(t, e); | |
return function(t) { | |
return !(!Ut(t) || function(t) { | |
return !!Z && Z in t | |
}(t)) && (Rt(t) ? W : b).test(Ft(t)) | |
}(r) ? r : void 0 | |
} | |
yt.prototype.clear = function() { | |
this.__data__ = lt ? lt(null) : {}, | |
this.size = 0 | |
} | |
, | |
yt.prototype.delete = function(t) { | |
var e = this.has(t) && delete this.__data__[t]; | |
return this.size -= e ? 1 : 0, | |
e | |
} | |
, | |
yt.prototype.get = function(t) { | |
var e = this.__data__; | |
if (lt) { | |
var r = e[t]; | |
return r === i ? void 0 : r | |
} | |
return G.call(e, t) ? e[t] : void 0 | |
} | |
, | |
yt.prototype.has = function(t) { | |
var e = this.__data__; | |
return lt ? void 0 !== e[t] : G.call(e, t) | |
} | |
, | |
yt.prototype.set = function(t, e) { | |
var r = this.__data__; | |
return this.size += this.has(t) ? 0 : 1, | |
r[t] = lt && void 0 === e ? i : e, | |
this | |
} | |
, | |
gt.prototype.clear = function() { | |
this.__data__ = [], | |
this.size = 0 | |
} | |
, | |
gt.prototype.delete = function(t) { | |
var e = this.__data__ | |
, r = bt(e, t); | |
return !(r < 0 || (r == e.length - 1 ? e.pop() : $.call(e, r, 1), | |
--this.size, | |
0)) | |
} | |
, | |
gt.prototype.get = function(t) { | |
var e = this.__data__ | |
, r = bt(e, t); | |
return r < 0 ? void 0 : e[r][1] | |
} | |
, | |
gt.prototype.has = function(t) { | |
return bt(this.__data__, t) > -1 | |
} | |
, | |
gt.prototype.set = function(t, e) { | |
var r = this.__data__ | |
, i = bt(r, t); | |
return i < 0 ? (++this.size, | |
r.push([t, e])) : r[i][1] = e, | |
this | |
} | |
, | |
vt.prototype.clear = function() { | |
this.size = 0, | |
this.__data__ = { | |
hash: new yt, | |
map: new (nt || gt), | |
string: new yt | |
} | |
} | |
, | |
vt.prototype.delete = function(t) { | |
var e = St(this, t).delete(t); | |
return this.size -= e ? 1 : 0, | |
e | |
} | |
, | |
vt.prototype.get = function(t) { | |
return St(this, t).get(t) | |
} | |
, | |
vt.prototype.has = function(t) { | |
return St(this, t).has(t) | |
} | |
, | |
vt.prototype.set = function(t, e) { | |
var r = St(this, t) | |
, i = r.size; | |
return r.set(t, e), | |
this.size += r.size == i ? 0 : 1, | |
this | |
} | |
, | |
_t.prototype.add = _t.prototype.push = function(t) { | |
return this.__data__.set(t, i), | |
this | |
} | |
, | |
_t.prototype.has = function(t) { | |
return this.__data__.has(t) | |
} | |
, | |
xt.prototype.clear = function() { | |
this.__data__ = new gt, | |
this.size = 0 | |
} | |
, | |
xt.prototype.delete = function(t) { | |
var e = this.__data__ | |
, r = e.delete(t); | |
return this.size = e.size, | |
r | |
} | |
, | |
xt.prototype.get = function(t) { | |
return this.__data__.get(t) | |
} | |
, | |
xt.prototype.has = function(t) { | |
return this.__data__.has(t) | |
} | |
, | |
xt.prototype.set = function(t, e) { | |
var r = this.__data__; | |
if (r instanceof gt) { | |
var i = r.__data__; | |
if (!nt || i.length < 199) | |
return i.push([t, e]), | |
this.size = ++r.size, | |
this; | |
r = this.__data__ = new vt(i) | |
} | |
return r.set(t, e), | |
this.size = r.size, | |
this | |
} | |
; | |
var Tt = tt ? function(t) { | |
return null == t ? [] : (t = Object(t), | |
function(e, r) { | |
for (var i = -1, n = null == e ? 0 : e.length, o = 0, a = []; ++i < n; ) { | |
var s = e[i]; | |
l = s, | |
Y.call(t, l) && (a[o++] = s) | |
} | |
var l; | |
return a | |
}(tt(t))) | |
} | |
: function() { | |
return [] | |
} | |
, Dt = wt; | |
function It(t, e) { | |
return !!(e = null == e ? n : e) && ("number" == typeof t || w.test(t)) && t > -1 && t % 1 == 0 && t < e | |
} | |
function Ft(t) { | |
if (null != t) { | |
try { | |
return q.call(t) | |
} catch (t) {} | |
try { | |
return t + "" | |
} catch (t) {} | |
} | |
return "" | |
} | |
function Bt(t, e) { | |
return t === e || t != t && e != e | |
} | |
(it && Dt(new it(new ArrayBuffer(1))) != x || nt && Dt(new nt) != p || ot && Dt(ot.resolve()) != d || at && Dt(new at) != y || st && Dt(new st) != v) && (Dt = function(t) { | |
var e = wt(t) | |
, r = e == f ? t.constructor : void 0 | |
, i = r ? Ft(r) : ""; | |
if (i) | |
switch (i) { | |
case ut: | |
return x; | |
case ct: | |
return p; | |
case pt: | |
return d; | |
case ht: | |
return y; | |
case ft: | |
return v | |
} | |
return e | |
} | |
); | |
var Pt = Et(function() { | |
return arguments | |
}()) ? Et : function(t) { | |
return Vt(t) && G.call(t, "callee") && !Y.call(t, "callee") | |
} | |
, Mt = Array.isArray | |
, Lt = et || function() { | |
return !1 | |
} | |
; | |
function Rt(t) { | |
if (!Ut(t)) | |
return !1; | |
var e = wt(t); | |
return e == c || "[object GeneratorFunction]" == e || "[object AsyncFunction]" == e || "[object Proxy]" == e | |
} | |
function Ot(t) { | |
return "number" == typeof t && t > -1 && t % 1 == 0 && t <= n | |
} | |
function Ut(t) { | |
var e = typeof t; | |
return null != t && ("object" == e || "function" == e) | |
} | |
function Vt(t) { | |
return null != t && "object" == typeof t | |
} | |
var jt = F ? function(t) { | |
return function(e) { | |
return t(e) | |
} | |
}(F) : function(t) { | |
return Vt(t) && Ot(t.length) && !!E[wt(t)] | |
} | |
; | |
function Nt(t) { | |
return null != (e = t) && Ot(e.length) && !Rt(e) ? function(t, e) { | |
var r = Mt(t) | |
, i = !r && Pt(t) | |
, n = !r && !i && Lt(t) | |
, o = !r && !i && !n && jt(t) | |
, a = r || i || n || o | |
, s = a ? function(t, e) { | |
for (var r = -1, i = Array(t); ++r < t; ) | |
i[r] = e(r); | |
return i | |
}(t.length, String) : [] | |
, l = s.length; | |
for (var u in t) | |
!e && !G.call(t, u) || a && ("length" == u || n && ("offset" == u || "parent" == u) || o && ("buffer" == u || "byteLength" == u || "byteOffset" == u) || It(u, l)) || s.push(u); | |
return s | |
}(t) : function(t) { | |
if (r = (e = t) && e.constructor, | |
e !== ("function" == typeof r && r.prototype || j)) | |
return rt(t); | |
var e, r, i = []; | |
for (var n in Object(t)) | |
G.call(t, n) && "constructor" != n && i.push(n); | |
return i | |
}(t); | |
var e | |
} | |
t.exports = function(t, e) { | |
return Ct(t, e) | |
} | |
} | |
, | |
2739: function(t) { | |
t.exports = function() { | |
"use strict"; | |
var t, e, r; | |
function i(i, n) { | |
if (t) | |
if (e) { | |
var o = "var sharedChunk = {}; (" + t + ")(sharedChunk); (" + e + ")(sharedChunk);" | |
, a = {}; | |
t(a), | |
r = n(a), | |
"undefined" != typeof window && (r.workerUrl = window.URL.createObjectURL(new Blob([o],{ | |
type: "text/javascript" | |
}))) | |
} else | |
e = n; | |
else | |
t = n | |
} | |
return i(0, (function(t) { | |
function e(t, e) { | |
return t(e = { | |
exports: {} | |
}, e.exports), | |
e.exports | |
} | |
var r = i; | |
function i(t, e, r, i) { | |
this.cx = 3 * t, | |
this.bx = 3 * (r - t) - this.cx, | |
this.ax = 1 - this.cx - this.bx, | |
this.cy = 3 * e, | |
this.by = 3 * (i - e) - this.cy, | |
this.ay = 1 - this.cy - this.by, | |
this.p1x = t, | |
this.p1y = i, | |
this.p2x = r, | |
this.p2y = i | |
} | |
i.prototype.sampleCurveX = function(t) { | |
return ((this.ax * t + this.bx) * t + this.cx) * t | |
} | |
, | |
i.prototype.sampleCurveY = function(t) { | |
return ((this.ay * t + this.by) * t + this.cy) * t | |
} | |
, | |
i.prototype.sampleCurveDerivativeX = function(t) { | |
return (3 * this.ax * t + 2 * this.bx) * t + this.cx | |
} | |
, | |
i.prototype.solveCurveX = function(t, e) { | |
var r, i, n, o, a; | |
for (void 0 === e && (e = 1e-6), | |
n = t, | |
a = 0; a < 8; a++) { | |
if (o = this.sampleCurveX(n) - t, | |
Math.abs(o) < e) | |
return n; | |
var s = this.sampleCurveDerivativeX(n); | |
if (Math.abs(s) < 1e-6) | |
break; | |
n -= o / s | |
} | |
if ((n = t) < (r = 0)) | |
return r; | |
if (n > (i = 1)) | |
return i; | |
for (; r < i; ) { | |
if (o = this.sampleCurveX(n), | |
Math.abs(o - t) < e) | |
return n; | |
t > o ? r = n : i = n, | |
n = .5 * (i - r) + r | |
} | |
return n | |
} | |
, | |
i.prototype.solve = function(t, e) { | |
return this.sampleCurveY(this.solveCurveX(t, e)) | |
} | |
; | |
var n = o; | |
function o(t, e) { | |
this.x = t, | |
this.y = e | |
} | |
o.prototype = { | |
clone: function() { | |
return new o(this.x,this.y) | |
}, | |
add: function(t) { | |
return this.clone()._add(t) | |
}, | |
sub: function(t) { | |
return this.clone()._sub(t) | |
}, | |
multByPoint: function(t) { | |
return this.clone()._multByPoint(t) | |
}, | |
divByPoint: function(t) { | |
return this.clone()._divByPoint(t) | |
}, | |
mult: function(t) { | |
return this.clone()._mult(t) | |
}, | |
div: function(t) { | |
return this.clone()._div(t) | |
}, | |
rotate: function(t) { | |
return this.clone()._rotate(t) | |
}, | |
rotateAround: function(t, e) { | |
return this.clone()._rotateAround(t, e) | |
}, | |
matMult: function(t) { | |
return this.clone()._matMult(t) | |
}, | |
unit: function() { | |
return this.clone()._unit() | |
}, | |
perp: function() { | |
return this.clone()._perp() | |
}, | |
round: function() { | |
return this.clone()._round() | |
}, | |
mag: function() { | |
return Math.sqrt(this.x * this.x + this.y * this.y) | |
}, | |
equals: function(t) { | |
return this.x === t.x && this.y === t.y | |
}, | |
dist: function(t) { | |
return Math.sqrt(this.distSqr(t)) | |
}, | |
distSqr: function(t) { | |
var e = t.x - this.x | |
, r = t.y - this.y; | |
return e * e + r * r | |
}, | |
angle: function() { | |
return Math.atan2(this.y, this.x) | |
}, | |
angleTo: function(t) { | |
return Math.atan2(this.y - t.y, this.x - t.x) | |
}, | |
angleWith: function(t) { | |
return this.angleWithSep(t.x, t.y) | |
}, | |
angleWithSep: function(t, e) { | |
return Math.atan2(this.x * e - this.y * t, this.x * t + this.y * e) | |
}, | |
_matMult: function(t) { | |
var e = t[2] * this.x + t[3] * this.y; | |
return this.x = t[0] * this.x + t[1] * this.y, | |
this.y = e, | |
this | |
}, | |
_add: function(t) { | |
return this.x += t.x, | |
this.y += t.y, | |
this | |
}, | |
_sub: function(t) { | |
return this.x -= t.x, | |
this.y -= t.y, | |
this | |
}, | |
_mult: function(t) { | |
return this.x *= t, | |
this.y *= t, | |
this | |
}, | |
_div: function(t) { | |
return this.x /= t, | |
this.y /= t, | |
this | |
}, | |
_multByPoint: function(t) { | |
return this.x *= t.x, | |
this.y *= t.y, | |
this | |
}, | |
_divByPoint: function(t) { | |
return this.x /= t.x, | |
this.y /= t.y, | |
this | |
}, | |
_unit: function() { | |
return this._div(this.mag()), | |
this | |
}, | |
_perp: function() { | |
var t = this.y; | |
return this.y = this.x, | |
this.x = -t, | |
this | |
}, | |
_rotate: function(t) { | |
var e = Math.cos(t) | |
, r = Math.sin(t) | |
, i = r * this.x + e * this.y; | |
return this.x = e * this.x - r * this.y, | |
this.y = i, | |
this | |
}, | |
_rotateAround: function(t, e) { | |
var r = Math.cos(t) | |
, i = Math.sin(t) | |
, n = e.y + i * (this.x - e.x) + r * (this.y - e.y); | |
return this.x = e.x + r * (this.x - e.x) - i * (this.y - e.y), | |
this.y = n, | |
this | |
}, | |
_round: function() { | |
return this.x = Math.round(this.x), | |
this.y = Math.round(this.y), | |
this | |
} | |
}, | |
o.convert = function(t) { | |
return t instanceof o ? t : Array.isArray(t) ? new o(t[0],t[1]) : t | |
} | |
; | |
var a = "undefined" != typeof self ? self : {} | |
, s = Math.pow(2, 53) - 1; | |
function l(t, e, i, n) { | |
var o = new r(t,e,i,n); | |
return function(t) { | |
return o.solve(t) | |
} | |
} | |
var u = l(.25, .1, .25, 1); | |
function c(t, e, r) { | |
return Math.min(r, Math.max(e, t)) | |
} | |
function p(t, e, r) { | |
var i = r - e | |
, n = ((t - e) % i + i) % i + e; | |
return n === e ? r : n | |
} | |
function h(t) { | |
for (var e = [], r = arguments.length - 1; r-- > 0; ) | |
e[r] = arguments[r + 1]; | |
for (var i = 0, n = e; i < n.length; i += 1) { | |
var o = n[i]; | |
for (var a in o) | |
t[a] = o[a] | |
} | |
return t | |
} | |
var f = 1; | |
function d() { | |
return f++ | |
} | |
function m() { | |
return function t(e) { | |
return e ? (e ^ 16 * Math.random() >> e / 4).toString(16) : ([1e7] + -[1e3] + -4e3 + -8e3 + -1e11).replace(/[018]/g, t) | |
}() | |
} | |
function y(t) { | |
return !!t && /^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t) | |
} | |
function g(t, e) { | |
t.forEach((function(t) { | |
e[t] && (e[t] = e[t].bind(e)) | |
} | |
)) | |
} | |
function v(t, e) { | |
return -1 !== t.indexOf(e, t.length - e.length) | |
} | |
function _(t, e, r) { | |
var i = {}; | |
for (var n in t) | |
i[n] = e.call(r || this, t[n], n, t); | |
return i | |
} | |
function x(t, e, r) { | |
var i = {}; | |
for (var n in t) | |
e.call(r || this, t[n], n, t) && (i[n] = t[n]); | |
return i | |
} | |
function b(t) { | |
return Array.isArray(t) ? t.map(b) : "object" == typeof t && t ? _(t, b) : t | |
} | |
var w = {}; | |
function E(t) { | |
w[t] || ("undefined" != typeof console && console.warn(t), | |
w[t] = !0) | |
} | |
function C(t, e, r) { | |
return (r.y - t.y) * (e.x - t.x) > (e.y - t.y) * (r.x - t.x) | |
} | |
function A(t) { | |
for (var e = 0, r = 0, i = t.length, n = i - 1, o = void 0, a = void 0; r < i; n = r++) | |
e += ((a = t[n]).x - (o = t[r]).x) * (o.y + a.y); | |
return e | |
} | |
function z() { | |
return "undefined" != typeof WorkerGlobalScope && "undefined" != typeof self && self instanceof WorkerGlobalScope | |
} | |
function S(t) { | |
var e = {}; | |
if (t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g, (function(t, r, i, n) { | |
var o = i || n; | |
return e[r] = !o || o.toLowerCase(), | |
"" | |
} | |
)), | |
e["max-age"]) { | |
var r = parseInt(e["max-age"], 10); | |
isNaN(r) ? delete e["max-age"] : e["max-age"] = r | |
} | |
return e | |
} | |
var k = null; | |
function T(t) { | |
if (null == k) { | |
var e = t.navigator ? t.navigator.userAgent : null; | |
k = !!t.safari || !(!e || !(/\b(iPad|iPhone|iPod)\b/.test(e) || e.match("Safari") && !e.match("Chrome"))) | |
} | |
return k | |
} | |
function D(t) { | |
try { | |
var e = a[t]; | |
return e.setItem("_mapbox_test_", 1), | |
e.removeItem("_mapbox_test_"), | |
!0 | |
} catch (t) { | |
return !1 | |
} | |
} | |
var I, F, B, P, M = a.performance && a.performance.now ? a.performance.now.bind(a.performance) : Date.now.bind(Date), L = a.requestAnimationFrame || a.mozRequestAnimationFrame || a.webkitRequestAnimationFrame || a.msRequestAnimationFrame, R = a.cancelAnimationFrame || a.mozCancelAnimationFrame || a.webkitCancelAnimationFrame || a.msCancelAnimationFrame, O = { | |
now: M, | |
frame: function(t) { | |
var e = L(t); | |
return { | |
cancel: function() { | |
return R(e) | |
} | |
} | |
}, | |
getImageData: function(t, e) { | |
void 0 === e && (e = 0); | |
var r = a.document.createElement("canvas") | |
, i = r.getContext("2d"); | |
if (!i) | |
throw new Error("failed to create canvas 2d context"); | |
return r.width = t.width, | |
r.height = t.height, | |
i.drawImage(t, 0, 0, t.width, t.height), | |
i.getImageData(-e, -e, t.width + 2 * e, t.height + 2 * e) | |
}, | |
resolveURL: function(t) { | |
return I || (I = a.document.createElement("a")), | |
I.href = t, | |
I.href | |
}, | |
hardwareConcurrency: a.navigator && a.navigator.hardwareConcurrency || 4, | |
get devicePixelRatio() { | |
return a.devicePixelRatio | |
}, | |
get prefersReducedMotion() { | |
return !!a.matchMedia && (null == F && (F = a.matchMedia("(prefers-reduced-motion: reduce)")), | |
F.matches) | |
} | |
}, U = { | |
API_URL: "https://api.mapbox.com", | |
get EVENTS_URL() { | |
return this.API_URL ? 0 === this.API_URL.indexOf("https://api.mapbox.cn") ? "https://events.mapbox.cn/events/v2" : 0 === this.API_URL.indexOf("https://api.mapbox.com") ? "https://events.mapbox.com/events/v2" : null : null | |
}, | |
FEEDBACK_URL: "https://apps.mapbox.com/feedback", | |
REQUIRE_ACCESS_TOKEN: !0, | |
ACCESS_TOKEN: null, | |
MAX_PARALLEL_IMAGE_REQUESTS: 16, | |
REGISTERED_PROTOCOLS: {} | |
}, V = { | |
supported: !1, | |
testSupport: function(t) { | |
!j && P && (N ? q(t) : B = t) | |
} | |
}, j = !1, N = !1; | |
function q(t) { | |
var e = t.createTexture(); | |
t.bindTexture(t.TEXTURE_2D, e); | |
try { | |
if (t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, P), | |
t.isContextLost()) | |
return; | |
V.supported = !0 | |
} catch (t) {} | |
t.deleteTexture(e), | |
j = !0 | |
} | |
a.document && ((P = a.document.createElement("img")).onload = function() { | |
B && q(B), | |
B = null, | |
N = !0 | |
} | |
, | |
P.onerror = function() { | |
j = !0, | |
B = null | |
} | |
, | |
P.src = "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="); | |
var G = "01" | |
, Z = function(t, e) { | |
this._transformRequestFn = t, | |
this._customAccessToken = e, | |
this._createSkuToken() | |
}; | |
function X(t) { | |
return 0 === t.indexOf("mapbox:") | |
} | |
Z.prototype._createSkuToken = function() { | |
var t = function() { | |
for (var t = "", e = 0; e < 10; e++) | |
t += "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62 * Math.random())]; | |
return { | |
token: ["1", G, t].join(""), | |
tokenExpiresAt: Date.now() + 432e5 | |
} | |
}(); | |
this._skuToken = t.token, | |
this._skuTokenExpiresAt = t.tokenExpiresAt | |
} | |
, | |
Z.prototype._isSkuTokenExpired = function() { | |
return Date.now() > this._skuTokenExpiresAt | |
} | |
, | |
Z.prototype.transformRequest = function(t, e) { | |
return this._transformRequestFn && this._transformRequestFn(t, e) || { | |
url: t | |
} | |
} | |
, | |
Z.prototype.normalizeStyleURL = function(t, e) { | |
if (!X(t)) | |
return t; | |
var r = J(t); | |
return r.path = "/styles/v1" + r.path, | |
this._makeAPIURL(r, this._customAccessToken || e) | |
} | |
, | |
Z.prototype.normalizeGlyphsURL = function(t, e) { | |
if (!X(t)) | |
return t; | |
var r = J(t); | |
return r.path = "/fonts/v1" + r.path, | |
this._makeAPIURL(r, this._customAccessToken || e) | |
} | |
, | |
Z.prototype.normalizeSourceURL = function(t, e) { | |
if (!X(t)) | |
return t; | |
var r = J(t); | |
return r.path = "/v4/" + r.authority + ".json", | |
r.params.push("secure"), | |
this._makeAPIURL(r, this._customAccessToken || e) | |
} | |
, | |
Z.prototype.normalizeSpriteURL = function(t, e, r, i) { | |
var n = J(t); | |
return X(t) ? (n.path = "/styles/v1" + n.path + "/sprite" + e + r, | |
this._makeAPIURL(n, this._customAccessToken || i)) : (n.path += "" + e + r, | |
Y(n)) | |
} | |
, | |
Z.prototype.normalizeTileURL = function(t, e) { | |
if (this._isSkuTokenExpired() && this._createSkuToken(), | |
t && !X(t)) | |
return t; | |
var r = J(t); | |
r.path = r.path.replace(/(\.(png|jpg)\d*)(?=$)/, (O.devicePixelRatio >= 2 || 512 === e ? "@2x" : "") + (V.supported ? ".webp" : "$1")), | |
r.path = r.path.replace(/^.+\/v4\//, "/"), | |
r.path = "/v4" + r.path; | |
var i = this._customAccessToken || function(t) { | |
for (var e = 0, r = t; e < r.length; e += 1) { | |
var i = r[e].match(/^access_token=(.*)$/); | |
if (i) | |
return i[1] | |
} | |
return null | |
}(r.params) || U.ACCESS_TOKEN; | |
return U.REQUIRE_ACCESS_TOKEN && i && this._skuToken && r.params.push("sku=" + this._skuToken), | |
this._makeAPIURL(r, i) | |
} | |
, | |
Z.prototype.canonicalizeTileURL = function(t, e) { | |
var r = J(t); | |
if (!r.path.match(/(^\/v4\/)/) || !r.path.match(/\.[\w]+$/)) | |
return t; | |
var i = "mapbox://tiles/"; | |
i += r.path.replace("/v4/", ""); | |
var n = r.params; | |
return e && (n = n.filter((function(t) { | |
return !t.match(/^access_token=/) | |
} | |
))), | |
n.length && (i += "?" + n.join("&")), | |
i | |
} | |
, | |
Z.prototype.canonicalizeTileset = function(t, e) { | |
for (var r = !!e && X(e), i = [], n = 0, o = t.tiles || []; n < o.length; n += 1) { | |
var a = o[n]; | |
H(a) ? i.push(this.canonicalizeTileURL(a, r)) : i.push(a) | |
} | |
return i | |
} | |
, | |
Z.prototype._makeAPIURL = function(t, e) { | |
var r = "See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes" | |
, i = J(U.API_URL); | |
if (t.protocol = i.protocol, | |
t.authority = i.authority, | |
"http" === t.protocol) { | |
var n = t.params.indexOf("secure"); | |
n >= 0 && t.params.splice(n, 1) | |
} | |
if ("/" !== i.path && (t.path = "" + i.path + t.path), | |
!U.REQUIRE_ACCESS_TOKEN) | |
return Y(t); | |
if (!(e = e || U.ACCESS_TOKEN)) | |
throw new Error("An API access token is required to use Mapbox GL. " + r); | |
if ("s" === e[0]) | |
throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). " + r); | |
return t.params = t.params.filter((function(t) { | |
return -1 === t.indexOf("access_token") | |
} | |
)), | |
t.params.push("access_token=" + e), | |
Y(t) | |
} | |
, | |
Z.prototype.setTransformRequest = function(t) { | |
this._transformRequestFn = t | |
} | |
; | |
var W = /^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i; | |
function H(t) { | |
return W.test(t) | |
} | |
var K = /^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/; | |
function J(t) { | |
var e = t.match(K); | |
if (!e) | |
throw new Error("Unable to parse URL object"); | |
return { | |
protocol: e[1], | |
authority: e[2], | |
path: e[3] || "/", | |
params: e[4] ? e[4].split("&") : [] | |
} | |
} | |
function Y(t) { | |
var e = t.params.length ? "?" + t.params.join("&") : ""; | |
return t.protocol + "://" + t.authority + t.path + e | |
} | |
function $(t) { | |
if (!t) | |
return null; | |
var e = t.split("."); | |
if (!e || 3 !== e.length) | |
return null; | |
try { | |
return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t) { | |
return "%" + ("00" + t.charCodeAt(0).toString(16)).slice(-2) | |
} | |
)).join(""))) | |
} catch (t) { | |
return null | |
} | |
} | |
var Q = function(t) { | |
this.type = t, | |
this.anonId = null, | |
this.eventData = {}, | |
this.queue = [], | |
this.pendingRequest = null | |
}; | |
Q.prototype.getStorageKey = function(t) { | |
var e, r = $(U.ACCESS_TOKEN); | |
return e = r && r.u ? a.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g, (function(t, e) { | |
return String.fromCharCode(Number("0x" + e)) | |
} | |
))) : U.ACCESS_TOKEN || "", | |
t ? "mapbox.eventData." + t + ":" + e : "mapbox.eventData:" + e | |
} | |
, | |
Q.prototype.fetchEventData = function() { | |
var t = D("localStorage") | |
, e = this.getStorageKey() | |
, r = this.getStorageKey("uuid"); | |
if (t) | |
try { | |
var i = a.localStorage.getItem(e); | |
i && (this.eventData = JSON.parse(i)); | |
var n = a.localStorage.getItem(r); | |
n && (this.anonId = n) | |
} catch (t) { | |
E("Unable to read from LocalStorage") | |
} | |
} | |
, | |
Q.prototype.saveEventData = function() { | |
var t = D("localStorage") | |
, e = this.getStorageKey() | |
, r = this.getStorageKey("uuid"); | |
if (t) | |
try { | |
a.localStorage.setItem(r, this.anonId), | |
Object.keys(this.eventData).length >= 1 && a.localStorage.setItem(e, JSON.stringify(this.eventData)) | |
} catch (t) { | |
E("Unable to write to LocalStorage") | |
} | |
} | |
, | |
Q.prototype.processRequests = function(t) {} | |
, | |
Q.prototype.postEvent = function(t, e, r, i) { | |
var n = this; | |
if (U.EVENTS_URL) { | |
var o = J(U.EVENTS_URL); | |
o.params.push("access_token=" + (i || U.ACCESS_TOKEN || "")); | |
var a = { | |
event: this.type, | |
created: new Date(t).toISOString(), | |
sdkIdentifier: "mapbox-gl-js", | |
sdkVersion: "1.15.2", | |
skuId: G, | |
userId: this.anonId | |
} | |
, s = e ? h(a, e) : a | |
, l = { | |
url: Y(o), | |
headers: { | |
"Content-Type": "text/plain" | |
}, | |
body: JSON.stringify([s]) | |
}; | |
this.pendingRequest = wt(l, (function(t) { | |
n.pendingRequest = null, | |
r(t), | |
n.saveEventData(), | |
n.processRequests(i) | |
} | |
)) | |
} | |
} | |
, | |
Q.prototype.queueRequest = function(t, e) { | |
this.queue.push(t), | |
this.processRequests(e) | |
} | |
; | |
var tt, et, rt = function(t) { | |
function e() { | |
t.call(this, "map.load"), | |
this.success = {}, | |
this.skuToken = "" | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.postMapLoadEvent = function(t, e, r, i) { | |
this.skuToken = r, | |
(U.EVENTS_URL && i || U.ACCESS_TOKEN && Array.isArray(t) && t.some((function(t) { | |
return X(t) || H(t) | |
} | |
))) && this.queueRequest({ | |
id: e, | |
timestamp: Date.now() | |
}, i) | |
} | |
, | |
e.prototype.processRequests = function(t) { | |
var e = this; | |
if (!this.pendingRequest && 0 !== this.queue.length) { | |
var r = this.queue.shift() | |
, i = r.id | |
, n = r.timestamp; | |
i && this.success[i] || (this.anonId || this.fetchEventData(), | |
y(this.anonId) || (this.anonId = m()), | |
this.postEvent(n, { | |
skuToken: this.skuToken | |
}, (function(t) { | |
t || i && (e.success[i] = !0) | |
} | |
), t)) | |
} | |
} | |
, | |
e | |
}(Q), it = new (function(t) { | |
function e(e) { | |
t.call(this, "appUserTurnstile"), | |
this._customAccessToken = e | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.postTurnstileEvent = function(t, e) { | |
U.EVENTS_URL && U.ACCESS_TOKEN && Array.isArray(t) && t.some((function(t) { | |
return X(t) || H(t) | |
} | |
)) && this.queueRequest(Date.now(), e) | |
} | |
, | |
e.prototype.processRequests = function(t) { | |
var e = this; | |
if (!this.pendingRequest && 0 !== this.queue.length) { | |
this.anonId && this.eventData.lastSuccess && this.eventData.tokenU || this.fetchEventData(); | |
var r = $(U.ACCESS_TOKEN) | |
, i = r ? r.u : U.ACCESS_TOKEN | |
, n = i !== this.eventData.tokenU; | |
y(this.anonId) || (this.anonId = m(), | |
n = !0); | |
var o = this.queue.shift(); | |
if (this.eventData.lastSuccess) { | |
var a = new Date(this.eventData.lastSuccess) | |
, s = new Date(o) | |
, l = (o - this.eventData.lastSuccess) / 864e5; | |
n = n || l >= 1 || l < -1 || a.getDate() !== s.getDate() | |
} else | |
n = !0; | |
if (!n) | |
return this.processRequests(); | |
this.postEvent(o, { | |
"enabled.telemetry": !1 | |
}, (function(t) { | |
t || (e.eventData.lastSuccess = o, | |
e.eventData.tokenU = i) | |
} | |
), t) | |
} | |
} | |
, | |
e | |
}(Q)), nt = it.postTurnstileEvent.bind(it), ot = new rt, at = ot.postMapLoadEvent.bind(ot), st = 500, lt = 50; | |
function ut() { | |
a.caches && !tt && (tt = a.caches.open("mapbox-tiles")) | |
} | |
function ct(t) { | |
var e = t.indexOf("?"); | |
return e < 0 ? t : t.slice(0, e) | |
} | |
var pt, ht = 1 / 0; | |
function ft() { | |
return null == pt && (pt = a.OffscreenCanvas && new a.OffscreenCanvas(1,1).getContext("2d") && "function" == typeof a.createImageBitmap), | |
pt | |
} | |
var dt = { | |
Unknown: "Unknown", | |
Style: "Style", | |
Source: "Source", | |
Tile: "Tile", | |
Glyphs: "Glyphs", | |
SpriteImage: "SpriteImage", | |
SpriteJSON: "SpriteJSON", | |
Image: "Image" | |
}; | |
"function" == typeof Object.freeze && Object.freeze(dt); | |
var mt = function(t) { | |
function e(e, r, i) { | |
401 === r && H(i) && (e += ": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"), | |
t.call(this, e), | |
this.status = r, | |
this.url = i, | |
this.name = this.constructor.name, | |
this.message = e | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.toString = function() { | |
return this.name + ": " + this.message + " (" + this.status + "): " + this.url | |
} | |
, | |
e | |
}(Error) | |
, yt = z() ? function() { | |
return self.worker && self.worker.referrer | |
} | |
: function() { | |
return ("blob:" === a.location.protocol ? a.parent : a).location.href | |
} | |
; | |
function gt(t, e) { | |
var r, i = new a.AbortController, n = new a.Request(t.url,{ | |
method: t.method || "GET", | |
body: t.body, | |
credentials: t.credentials, | |
headers: t.headers, | |
referrer: yt(), | |
signal: i.signal | |
}), o = !1, s = !1, l = (r = n.url).indexOf("sku=") > 0 && H(r); | |
"json" === t.type && n.headers.set("Accept", "application/json"); | |
var u = function(r, i, o) { | |
if (!s) { | |
if (r && "SecurityError" !== r.message && E(r), | |
i && o) | |
return c(i); | |
var u = Date.now(); | |
a.fetch(n).then((function(r) { | |
if (r.ok) { | |
var i = l ? r.clone() : null; | |
return c(r, i, u) | |
} | |
return e(new mt(r.statusText,r.status,t.url)) | |
} | |
)).catch((function(t) { | |
20 !== t.code && e(new Error(t.message)) | |
} | |
)) | |
} | |
} | |
, c = function(r, i, l) { | |
("arrayBuffer" === t.type ? r.arrayBuffer() : "json" === t.type ? r.json() : r.text()).then((function(t) { | |
s || (i && l && function(t, e, r) { | |
if (ut(), | |
tt) { | |
var i = { | |
status: e.status, | |
statusText: e.statusText, | |
headers: new a.Headers | |
}; | |
e.headers.forEach((function(t, e) { | |
return i.headers.set(e, t) | |
} | |
)); | |
var n = S(e.headers.get("Cache-Control") || ""); | |
n["no-store"] || (n["max-age"] && i.headers.set("Expires", new Date(r + 1e3 * n["max-age"]).toUTCString()), | |
new Date(i.headers.get("Expires")).getTime() - r < 42e4 || function(t, e) { | |
if (void 0 === et) | |
try { | |
new Response(new ReadableStream), | |
et = !0 | |
} catch (t) { | |
et = !1 | |
} | |
et ? e(t.body) : t.blob().then(e) | |
}(e, (function(e) { | |
var r = new a.Response(e,i); | |
ut(), | |
tt && tt.then((function(e) { | |
return e.put(ct(t.url), r) | |
} | |
)).catch((function(t) { | |
return E(t.message) | |
} | |
)) | |
} | |
))) | |
} | |
}(n, i, l), | |
o = !0, | |
e(null, t, r.headers.get("Cache-Control"), r.headers.get("Expires"))) | |
} | |
)).catch((function(t) { | |
s || e(new Error(t.message)) | |
} | |
)) | |
}; | |
return l ? function(t, e) { | |
if (ut(), | |
!tt) | |
return e(null); | |
var r = ct(t.url); | |
tt.then((function(t) { | |
t.match(r).then((function(i) { | |
var n = function(t) { | |
if (!t) | |
return !1; | |
var e = new Date(t.headers.get("Expires") || 0) | |
, r = S(t.headers.get("Cache-Control") || ""); | |
return e > Date.now() && !r["no-cache"] | |
}(i); | |
t.delete(r), | |
n && t.put(r, i.clone()), | |
e(null, i, n) | |
} | |
)).catch(e) | |
} | |
)).catch(e) | |
}(n, u) : u(null, null), | |
{ | |
cancel: function() { | |
s = !0, | |
o || i.abort() | |
} | |
} | |
} | |
var vt, _t, xt = function(t, e) { | |
if (/:\/\//.test(t.url) && !/^https?:|^file:/.test(t.url)) { | |
if (z() && self.worker && self.worker.actor) | |
return self.worker.actor.send("getResource", t, e); | |
if (!z()) { | |
var r = t.url.substring(0, t.url.indexOf("://")); | |
return (U.REGISTERED_PROTOCOLS[r] || gt)(t, e) | |
} | |
} | |
if (!(/^file:/.test(i = t.url) || /^file:/.test(yt()) && !/^\w+:/.test(i))) { | |
if (a.fetch && a.Request && a.AbortController && a.Request.prototype.hasOwnProperty("signal")) | |
return gt(t, e); | |
if (z() && self.worker && self.worker.actor) | |
return self.worker.actor.send("getResource", t, e, void 0, !0) | |
} | |
var i; | |
return function(t, e) { | |
var r = new a.XMLHttpRequest; | |
for (var i in r.open(t.method || "GET", t.url, !0), | |
"arrayBuffer" === t.type && (r.responseType = "arraybuffer"), | |
t.headers) | |
r.setRequestHeader(i, t.headers[i]); | |
return "json" === t.type && (r.responseType = "text", | |
r.setRequestHeader("Accept", "application/json")), | |
r.withCredentials = "include" === t.credentials, | |
r.onerror = function() { | |
e(new Error(r.statusText)) | |
} | |
, | |
r.onload = function() { | |
if ((r.status >= 200 && r.status < 300 || 0 === r.status) && null !== r.response) { | |
var i = r.response; | |
if ("json" === t.type) | |
try { | |
i = JSON.parse(r.response) | |
} catch (t) { | |
return e(t) | |
} | |
e(null, i, r.getResponseHeader("Cache-Control"), r.getResponseHeader("Expires")) | |
} else | |
e(new mt(r.statusText,r.status,t.url)) | |
} | |
, | |
r.send(t.body), | |
{ | |
cancel: function() { | |
return r.abort() | |
} | |
} | |
}(t, e) | |
}, bt = function(t, e) { | |
return xt(h(t, { | |
type: "arrayBuffer" | |
}), e) | |
}, wt = function(t, e) { | |
return xt(h(t, { | |
method: "POST" | |
}), e) | |
}, Et = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="; | |
vt = [], | |
_t = 0; | |
var Ct = function(t, e) { | |
if (V.supported && (t.headers || (t.headers = {}), | |
t.headers.accept = "image/webp,*/*"), | |
_t >= U.MAX_PARALLEL_IMAGE_REQUESTS) { | |
var r = { | |
requestParameters: t, | |
callback: e, | |
cancelled: !1, | |
cancel: function() { | |
this.cancelled = !0 | |
} | |
}; | |
return vt.push(r), | |
r | |
} | |
_t++; | |
var i = !1 | |
, n = function() { | |
if (!i) | |
for (i = !0, | |
_t--; vt.length && _t < U.MAX_PARALLEL_IMAGE_REQUESTS; ) { | |
var t = vt.shift(); | |
t.cancelled || (t.cancel = Ct(t.requestParameters, t.callback).cancel) | |
} | |
} | |
, o = bt(t, (function(t, r, i, o) { | |
n(), | |
t ? e(t) : r && (ft() ? function(t, e) { | |
var r = new a.Blob([new Uint8Array(t)],{ | |
type: "image/png" | |
}); | |
a.createImageBitmap(r).then((function(t) { | |
e(null, t) | |
} | |
)).catch((function(t) { | |
e(new Error("Could not load image because of " + t.message + ". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")) | |
} | |
)) | |
}(r, e) : function(t, e, r, i) { | |
var n = new a.Image | |
, o = a.URL; | |
n.onload = function() { | |
e(null, n), | |
o.revokeObjectURL(n.src), | |
n.onload = null, | |
a.requestAnimationFrame((function() { | |
n.src = Et | |
} | |
)) | |
} | |
, | |
n.onerror = function() { | |
return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")) | |
} | |
; | |
var s = new a.Blob([new Uint8Array(t)],{ | |
type: "image/png" | |
}); | |
n.cacheControl = r, | |
n.expires = i, | |
n.src = t.byteLength ? o.createObjectURL(s) : Et | |
}(r, e, i, o)) | |
} | |
)); | |
return { | |
cancel: function() { | |
o.cancel(), | |
n() | |
} | |
} | |
}; | |
function At(t, e, r) { | |
r[t] && -1 !== r[t].indexOf(e) || (r[t] = r[t] || [], | |
r[t].push(e)) | |
} | |
function zt(t, e, r) { | |
if (r && r[t]) { | |
var i = r[t].indexOf(e); | |
-1 !== i && r[t].splice(i, 1) | |
} | |
} | |
var St = function(t, e) { | |
void 0 === e && (e = {}), | |
h(this, e), | |
this.type = t | |
} | |
, kt = function(t) { | |
function e(e, r) { | |
void 0 === r && (r = {}), | |
t.call(this, "error", h({ | |
error: e | |
}, r)) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e | |
}(St) | |
, Tt = function() {}; | |
Tt.prototype.on = function(t, e) { | |
return this._listeners = this._listeners || {}, | |
At(t, e, this._listeners), | |
this | |
} | |
, | |
Tt.prototype.off = function(t, e) { | |
return zt(t, e, this._listeners), | |
zt(t, e, this._oneTimeListeners), | |
this | |
} | |
, | |
Tt.prototype.once = function(t, e) { | |
return this._oneTimeListeners = this._oneTimeListeners || {}, | |
At(t, e, this._oneTimeListeners), | |
this | |
} | |
, | |
Tt.prototype.fire = function(t, e) { | |
"string" == typeof t && (t = new St(t,e || {})); | |
var r = t.type; | |
if (this.listens(r)) { | |
t.target = this; | |
for (var i = 0, n = this._listeners && this._listeners[r] ? this._listeners[r].slice() : []; i < n.length; i += 1) | |
n[i].call(this, t); | |
for (var o = 0, a = this._oneTimeListeners && this._oneTimeListeners[r] ? this._oneTimeListeners[r].slice() : []; o < a.length; o += 1) { | |
var s = a[o]; | |
zt(r, s, this._oneTimeListeners), | |
s.call(this, t) | |
} | |
var l = this._eventedParent; | |
l && (h(t, "function" == typeof this._eventedParentData ? this._eventedParentData() : this._eventedParentData), | |
l.fire(t)) | |
} else | |
t instanceof kt && console.error(t.error); | |
return this | |
} | |
, | |
Tt.prototype.listens = function(t) { | |
return this._listeners && this._listeners[t] && this._listeners[t].length > 0 || this._oneTimeListeners && this._oneTimeListeners[t] && this._oneTimeListeners[t].length > 0 || this._eventedParent && this._eventedParent.listens(t) | |
} | |
, | |
Tt.prototype.setEventedParent = function(t, e) { | |
return this._eventedParent = t, | |
this._eventedParentData = e, | |
this | |
} | |
; | |
var Dt = { | |
$version: 8, | |
$root: { | |
version: { | |
required: !0, | |
type: "enum", | |
values: [8] | |
}, | |
name: { | |
type: "string" | |
}, | |
metadata: { | |
type: "*" | |
}, | |
center: { | |
type: "array", | |
value: "number" | |
}, | |
zoom: { | |
type: "number" | |
}, | |
bearing: { | |
type: "number", | |
default: 0, | |
period: 360, | |
units: "degrees" | |
}, | |
pitch: { | |
type: "number", | |
default: 0, | |
units: "degrees" | |
}, | |
light: { | |
type: "light" | |
}, | |
sources: { | |
required: !0, | |
type: "sources" | |
}, | |
sprite: { | |
type: "string" | |
}, | |
glyphs: { | |
type: "string" | |
}, | |
transition: { | |
type: "transition" | |
}, | |
layers: { | |
required: !0, | |
type: "array", | |
value: "layer" | |
} | |
}, | |
sources: { | |
"*": { | |
type: "source" | |
} | |
}, | |
source: ["source_vector", "source_raster", "source_raster_dem", "source_geojson", "source_video", "source_image"], | |
source_vector: { | |
type: { | |
required: !0, | |
type: "enum", | |
values: { | |
vector: {} | |
} | |
}, | |
url: { | |
type: "string" | |
}, | |
tiles: { | |
type: "array", | |
value: "string" | |
}, | |
bounds: { | |
type: "array", | |
value: "number", | |
length: 4, | |
default: [-180, -85.051129, 180, 85.051129] | |
}, | |
scheme: { | |
type: "enum", | |
values: { | |
xyz: {}, | |
tms: {} | |
}, | |
default: "xyz" | |
}, | |
minzoom: { | |
type: "number", | |
default: 0 | |
}, | |
maxzoom: { | |
type: "number", | |
default: 22 | |
}, | |
attribution: { | |
type: "string" | |
}, | |
promoteId: { | |
type: "promoteId" | |
}, | |
volatile: { | |
type: "boolean", | |
default: !1 | |
}, | |
"*": { | |
type: "*" | |
} | |
}, | |
source_raster: { | |
type: { | |
required: !0, | |
type: "enum", | |
values: { | |
raster: {} | |
} | |
}, | |
url: { | |
type: "string" | |
}, | |
tiles: { | |
type: "array", | |
value: "string" | |
}, | |
bounds: { | |
type: "array", | |
value: "number", | |
length: 4, | |
default: [-180, -85.051129, 180, 85.051129] | |
}, | |
minzoom: { | |
type: "number", | |
default: 0 | |
}, | |
maxzoom: { | |
type: "number", | |
default: 22 | |
}, | |
tileSize: { | |
type: "number", | |
default: 512, | |
units: "pixels" | |
}, | |
scheme: { | |
type: "enum", | |
values: { | |
xyz: {}, | |
tms: {} | |
}, | |
default: "xyz" | |
}, | |
attribution: { | |
type: "string" | |
}, | |
volatile: { | |
type: "boolean", | |
default: !1 | |
}, | |
"*": { | |
type: "*" | |
} | |
}, | |
source_raster_dem: { | |
type: { | |
required: !0, | |
type: "enum", | |
values: { | |
"raster-dem": {} | |
} | |
}, | |
url: { | |
type: "string" | |
}, | |
tiles: { | |
type: "array", | |
value: "string" | |
}, | |
bounds: { | |
type: "array", | |
value: "number", | |
length: 4, | |
default: [-180, -85.051129, 180, 85.051129] | |
}, | |
minzoom: { | |
type: "number", | |
default: 0 | |
}, | |
maxzoom: { | |
type: "number", | |
default: 22 | |
}, | |
tileSize: { | |
type: "number", | |
default: 512, | |
units: "pixels" | |
}, | |
attribution: { | |
type: "string" | |
}, | |
encoding: { | |
type: "enum", | |
values: { | |
terrarium: {}, | |
mapbox: {} | |
}, | |
default: "mapbox" | |
}, | |
volatile: { | |
type: "boolean", | |
default: !1 | |
}, | |
"*": { | |
type: "*" | |
} | |
}, | |
source_geojson: { | |
type: { | |
required: !0, | |
type: "enum", | |
values: { | |
geojson: {} | |
} | |
}, | |
data: { | |
type: "*" | |
}, | |
maxzoom: { | |
type: "number", | |
default: 18 | |
}, | |
attribution: { | |
type: "string" | |
}, | |
buffer: { | |
type: "number", | |
default: 128, | |
maximum: 512, | |
minimum: 0 | |
}, | |
filter: { | |
type: "*" | |
}, | |
tolerance: { | |
type: "number", | |
default: .375 | |
}, | |
cluster: { | |
type: "boolean", | |
default: !1 | |
}, | |
clusterRadius: { | |
type: "number", | |
default: 50, | |
minimum: 0 | |
}, | |
clusterMaxZoom: { | |
type: "number" | |
}, | |
clusterMinPoints: { | |
type: "number" | |
}, | |
clusterProperties: { | |
type: "*" | |
}, | |
lineMetrics: { | |
type: "boolean", | |
default: !1 | |
}, | |
generateId: { | |
type: "boolean", | |
default: !1 | |
}, | |
promoteId: { | |
type: "promoteId" | |
} | |
}, | |
source_video: { | |
type: { | |
required: !0, | |
type: "enum", | |
values: { | |
video: {} | |
} | |
}, | |
urls: { | |
required: !0, | |
type: "array", | |
value: "string" | |
}, | |
coordinates: { | |
required: !0, | |
type: "array", | |
length: 4, | |
value: { | |
type: "array", | |
length: 2, | |
value: "number" | |
} | |
} | |
}, | |
source_image: { | |
type: { | |
required: !0, | |
type: "enum", | |
values: { | |
image: {} | |
} | |
}, | |
url: { | |
required: !0, | |
type: "string" | |
}, | |
coordinates: { | |
required: !0, | |
type: "array", | |
length: 4, | |
value: { | |
type: "array", | |
length: 2, | |
value: "number" | |
} | |
} | |
}, | |
layer: { | |
id: { | |
type: "string", | |
required: !0 | |
}, | |
type: { | |
type: "enum", | |
values: { | |
fill: {}, | |
line: {}, | |
symbol: {}, | |
circle: {}, | |
heatmap: {}, | |
"fill-extrusion": {}, | |
raster: {}, | |
hillshade: {}, | |
background: {} | |
}, | |
required: !0 | |
}, | |
metadata: { | |
type: "*" | |
}, | |
source: { | |
type: "string" | |
}, | |
"source-layer": { | |
type: "string" | |
}, | |
minzoom: { | |
type: "number", | |
minimum: 0, | |
maximum: 24 | |
}, | |
maxzoom: { | |
type: "number", | |
minimum: 0, | |
maximum: 24 | |
}, | |
filter: { | |
type: "filter" | |
}, | |
layout: { | |
type: "layout" | |
}, | |
paint: { | |
type: "paint" | |
} | |
}, | |
layout: ["layout_fill", "layout_line", "layout_circle", "layout_heatmap", "layout_fill-extrusion", "layout_symbol", "layout_raster", "layout_hillshade", "layout_background"], | |
layout_background: { | |
visibility: { | |
type: "enum", | |
values: { | |
visible: {}, | |
none: {} | |
}, | |
default: "visible", | |
"property-type": "constant" | |
} | |
}, | |
layout_fill: { | |
"fill-sort-key": { | |
type: "number", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
visibility: { | |
type: "enum", | |
values: { | |
visible: {}, | |
none: {} | |
}, | |
default: "visible", | |
"property-type": "constant" | |
} | |
}, | |
layout_circle: { | |
"circle-sort-key": { | |
type: "number", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
visibility: { | |
type: "enum", | |
values: { | |
visible: {}, | |
none: {} | |
}, | |
default: "visible", | |
"property-type": "constant" | |
} | |
}, | |
layout_heatmap: { | |
visibility: { | |
type: "enum", | |
values: { | |
visible: {}, | |
none: {} | |
}, | |
default: "visible", | |
"property-type": "constant" | |
} | |
}, | |
"layout_fill-extrusion": { | |
visibility: { | |
type: "enum", | |
values: { | |
visible: {}, | |
none: {} | |
}, | |
default: "visible", | |
"property-type": "constant" | |
} | |
}, | |
layout_line: { | |
"line-cap": { | |
type: "enum", | |
values: { | |
butt: {}, | |
round: {}, | |
square: {} | |
}, | |
default: "butt", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"line-join": { | |
type: "enum", | |
values: { | |
bevel: {}, | |
round: {}, | |
miter: {} | |
}, | |
default: "miter", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"line-miter-limit": { | |
type: "number", | |
default: 2, | |
requires: [{ | |
"line-join": "miter" | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"line-round-limit": { | |
type: "number", | |
default: 1.05, | |
requires: [{ | |
"line-join": "round" | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"line-sort-key": { | |
type: "number", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
visibility: { | |
type: "enum", | |
values: { | |
visible: {}, | |
none: {} | |
}, | |
default: "visible", | |
"property-type": "constant" | |
} | |
}, | |
layout_symbol: { | |
"symbol-placement": { | |
type: "enum", | |
values: { | |
point: {}, | |
line: {}, | |
"line-center": {} | |
}, | |
default: "point", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"symbol-spacing": { | |
type: "number", | |
default: 250, | |
minimum: 1, | |
units: "pixels", | |
requires: [{ | |
"symbol-placement": "line" | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"symbol-avoid-edges": { | |
type: "boolean", | |
default: !1, | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"symbol-sort-key": { | |
type: "number", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"symbol-z-order": { | |
type: "enum", | |
values: { | |
auto: {}, | |
"viewport-y": {}, | |
source: {} | |
}, | |
default: "auto", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"icon-allow-overlap": { | |
type: "boolean", | |
default: !1, | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"icon-ignore-placement": { | |
type: "boolean", | |
default: !1, | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"icon-optional": { | |
type: "boolean", | |
default: !1, | |
requires: ["icon-image", "text-field"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"icon-rotation-alignment": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {}, | |
auto: {} | |
}, | |
default: "auto", | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"icon-size": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
units: "factor of the original icon size", | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"icon-text-fit": { | |
type: "enum", | |
values: { | |
none: {}, | |
width: {}, | |
height: {}, | |
both: {} | |
}, | |
default: "none", | |
requires: ["icon-image", "text-field"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"icon-text-fit-padding": { | |
type: "array", | |
value: "number", | |
length: 4, | |
default: [0, 0, 0, 0], | |
units: "pixels", | |
requires: ["icon-image", "text-field", { | |
"icon-text-fit": ["both", "width", "height"] | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"icon-image": { | |
type: "resolvedImage", | |
tokens: !0, | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"icon-rotate": { | |
type: "number", | |
default: 0, | |
period: 360, | |
units: "degrees", | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"icon-padding": { | |
type: "number", | |
default: 2, | |
minimum: 0, | |
units: "pixels", | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"icon-keep-upright": { | |
type: "boolean", | |
default: !1, | |
requires: ["icon-image", { | |
"icon-rotation-alignment": "map" | |
}, { | |
"symbol-placement": ["line", "line-center"] | |
}], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"icon-offset": { | |
type: "array", | |
value: "number", | |
length: 2, | |
default: [0, 0], | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"icon-anchor": { | |
type: "enum", | |
values: { | |
center: {}, | |
left: {}, | |
right: {}, | |
top: {}, | |
bottom: {}, | |
"top-left": {}, | |
"top-right": {}, | |
"bottom-left": {}, | |
"bottom-right": {} | |
}, | |
default: "center", | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"icon-pitch-alignment": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {}, | |
auto: {} | |
}, | |
default: "auto", | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-pitch-alignment": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {}, | |
auto: {} | |
}, | |
default: "auto", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-rotation-alignment": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {}, | |
auto: {} | |
}, | |
default: "auto", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-field": { | |
type: "formatted", | |
default: "", | |
tokens: !0, | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-font": { | |
type: "array", | |
value: "string", | |
default: ["Open Sans Regular", "Arial Unicode MS Regular"], | |
requires: ["text-field"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-size": { | |
type: "number", | |
default: 16, | |
minimum: 0, | |
units: "pixels", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-max-width": { | |
type: "number", | |
default: 10, | |
minimum: 0, | |
units: "ems", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-line-height": { | |
type: "number", | |
default: 1.2, | |
units: "ems", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-letter-spacing": { | |
type: "number", | |
default: 0, | |
units: "ems", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-justify": { | |
type: "enum", | |
values: { | |
auto: {}, | |
left: {}, | |
center: {}, | |
right: {} | |
}, | |
default: "center", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-radial-offset": { | |
type: "number", | |
units: "ems", | |
default: 0, | |
requires: ["text-field"], | |
"property-type": "data-driven", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature"] | |
} | |
}, | |
"text-variable-anchor": { | |
type: "array", | |
value: "enum", | |
values: { | |
center: {}, | |
left: {}, | |
right: {}, | |
top: {}, | |
bottom: {}, | |
"top-left": {}, | |
"top-right": {}, | |
"bottom-left": {}, | |
"bottom-right": {} | |
}, | |
requires: ["text-field", { | |
"symbol-placement": ["point"] | |
}], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-anchor": { | |
type: "enum", | |
values: { | |
center: {}, | |
left: {}, | |
right: {}, | |
top: {}, | |
bottom: {}, | |
"top-left": {}, | |
"top-right": {}, | |
"bottom-left": {}, | |
"bottom-right": {} | |
}, | |
default: "center", | |
requires: ["text-field", { | |
"!": "text-variable-anchor" | |
}], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-max-angle": { | |
type: "number", | |
default: 45, | |
units: "degrees", | |
requires: ["text-field", { | |
"symbol-placement": ["line", "line-center"] | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-writing-mode": { | |
type: "array", | |
value: "enum", | |
values: { | |
horizontal: {}, | |
vertical: {} | |
}, | |
requires: ["text-field", { | |
"symbol-placement": ["point"] | |
}], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-rotate": { | |
type: "number", | |
default: 0, | |
period: 360, | |
units: "degrees", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-padding": { | |
type: "number", | |
default: 2, | |
minimum: 0, | |
units: "pixels", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-keep-upright": { | |
type: "boolean", | |
default: !0, | |
requires: ["text-field", { | |
"text-rotation-alignment": "map" | |
}, { | |
"symbol-placement": ["line", "line-center"] | |
}], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-transform": { | |
type: "enum", | |
values: { | |
none: {}, | |
uppercase: {}, | |
lowercase: {} | |
}, | |
default: "none", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-offset": { | |
type: "array", | |
value: "number", | |
units: "ems", | |
length: 2, | |
default: [0, 0], | |
requires: ["text-field", { | |
"!": "text-radial-offset" | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-allow-overlap": { | |
type: "boolean", | |
default: !1, | |
requires: ["text-field"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-ignore-placement": { | |
type: "boolean", | |
default: !1, | |
requires: ["text-field"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-optional": { | |
type: "boolean", | |
default: !1, | |
requires: ["text-field", "icon-image"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
visibility: { | |
type: "enum", | |
values: { | |
visible: {}, | |
none: {} | |
}, | |
default: "visible", | |
"property-type": "constant" | |
} | |
}, | |
layout_raster: { | |
visibility: { | |
type: "enum", | |
values: { | |
visible: {}, | |
none: {} | |
}, | |
default: "visible", | |
"property-type": "constant" | |
} | |
}, | |
layout_hillshade: { | |
visibility: { | |
type: "enum", | |
values: { | |
visible: {}, | |
none: {} | |
}, | |
default: "visible", | |
"property-type": "constant" | |
} | |
}, | |
filter: { | |
type: "array", | |
value: "*" | |
}, | |
filter_operator: { | |
type: "enum", | |
values: { | |
"==": {}, | |
"!=": {}, | |
">": {}, | |
">=": {}, | |
"<": {}, | |
"<=": {}, | |
in: {}, | |
"!in": {}, | |
all: {}, | |
any: {}, | |
none: {}, | |
has: {}, | |
"!has": {}, | |
within: {} | |
} | |
}, | |
geometry_type: { | |
type: "enum", | |
values: { | |
Point: {}, | |
LineString: {}, | |
Polygon: {} | |
} | |
}, | |
function: { | |
expression: { | |
type: "expression" | |
}, | |
stops: { | |
type: "array", | |
value: "function_stop" | |
}, | |
base: { | |
type: "number", | |
default: 1, | |
minimum: 0 | |
}, | |
property: { | |
type: "string", | |
default: "$zoom" | |
}, | |
type: { | |
type: "enum", | |
values: { | |
identity: {}, | |
exponential: {}, | |
interval: {}, | |
categorical: {} | |
}, | |
default: "exponential" | |
}, | |
colorSpace: { | |
type: "enum", | |
values: { | |
rgb: {}, | |
lab: {}, | |
hcl: {} | |
}, | |
default: "rgb" | |
}, | |
default: { | |
type: "*", | |
required: !1 | |
} | |
}, | |
function_stop: { | |
type: "array", | |
minimum: 0, | |
maximum: 24, | |
value: ["number", "color"], | |
length: 2 | |
}, | |
expression: { | |
type: "array", | |
value: "*", | |
minimum: 1 | |
}, | |
light: { | |
anchor: { | |
type: "enum", | |
default: "viewport", | |
values: { | |
map: {}, | |
viewport: {} | |
}, | |
"property-type": "data-constant", | |
transition: !1, | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
} | |
}, | |
position: { | |
type: "array", | |
default: [1.15, 210, 30], | |
length: 3, | |
value: "number", | |
"property-type": "data-constant", | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
} | |
}, | |
color: { | |
type: "color", | |
"property-type": "data-constant", | |
default: "#ffffff", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
transition: !0 | |
}, | |
intensity: { | |
type: "number", | |
"property-type": "data-constant", | |
default: .5, | |
minimum: 0, | |
maximum: 1, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
transition: !0 | |
} | |
}, | |
paint: ["paint_fill", "paint_line", "paint_circle", "paint_heatmap", "paint_fill-extrusion", "paint_symbol", "paint_raster", "paint_hillshade", "paint_background"], | |
paint_fill: { | |
"fill-antialias": { | |
type: "boolean", | |
default: !0, | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"fill-opacity": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"fill-color": { | |
type: "color", | |
default: "#000000", | |
transition: !0, | |
requires: [{ | |
"!": "fill-pattern" | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"fill-outline-color": { | |
type: "color", | |
transition: !0, | |
requires: [{ | |
"!": "fill-pattern" | |
}, { | |
"fill-antialias": !0 | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"fill-translate": { | |
type: "array", | |
value: "number", | |
length: 2, | |
default: [0, 0], | |
transition: !0, | |
units: "pixels", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"fill-translate-anchor": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {} | |
}, | |
default: "map", | |
requires: ["fill-translate"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"fill-pattern": { | |
type: "resolvedImage", | |
transition: !0, | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "cross-faded-data-driven" | |
} | |
}, | |
"paint_fill-extrusion": { | |
"fill-extrusion-opacity": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"fill-extrusion-color": { | |
type: "color", | |
default: "#000000", | |
transition: !0, | |
requires: [{ | |
"!": "fill-extrusion-pattern" | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"fill-extrusion-translate": { | |
type: "array", | |
value: "number", | |
length: 2, | |
default: [0, 0], | |
transition: !0, | |
units: "pixels", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"fill-extrusion-translate-anchor": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {} | |
}, | |
default: "map", | |
requires: ["fill-extrusion-translate"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"fill-extrusion-pattern": { | |
type: "resolvedImage", | |
transition: !0, | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "cross-faded-data-driven" | |
}, | |
"fill-extrusion-height": { | |
type: "number", | |
default: 0, | |
minimum: 0, | |
units: "meters", | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"fill-extrusion-base": { | |
type: "number", | |
default: 0, | |
minimum: 0, | |
units: "meters", | |
transition: !0, | |
requires: ["fill-extrusion-height"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"fill-extrusion-vertical-gradient": { | |
type: "boolean", | |
default: !0, | |
transition: !1, | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
} | |
}, | |
paint_line: { | |
"line-opacity": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"line-color": { | |
type: "color", | |
default: "#000000", | |
transition: !0, | |
requires: [{ | |
"!": "line-pattern" | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"line-translate": { | |
type: "array", | |
value: "number", | |
length: 2, | |
default: [0, 0], | |
transition: !0, | |
units: "pixels", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"line-translate-anchor": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {} | |
}, | |
default: "map", | |
requires: ["line-translate"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"line-width": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
transition: !0, | |
units: "pixels", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"line-gap-width": { | |
type: "number", | |
default: 0, | |
minimum: 0, | |
transition: !0, | |
units: "pixels", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"line-offset": { | |
type: "number", | |
default: 0, | |
transition: !0, | |
units: "pixels", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"line-blur": { | |
type: "number", | |
default: 0, | |
minimum: 0, | |
transition: !0, | |
units: "pixels", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"line-dasharray": { | |
type: "array", | |
value: "number", | |
minimum: 0, | |
transition: !0, | |
units: "line widths", | |
requires: [{ | |
"!": "line-pattern" | |
}], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "cross-faded" | |
}, | |
"line-pattern": { | |
type: "resolvedImage", | |
transition: !0, | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
}, | |
"property-type": "cross-faded-data-driven" | |
}, | |
"line-gradient": { | |
type: "color", | |
transition: !1, | |
requires: [{ | |
"!": "line-dasharray" | |
}, { | |
"!": "line-pattern" | |
}, { | |
source: "geojson", | |
has: { | |
lineMetrics: !0 | |
} | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["line-progress"] | |
}, | |
"property-type": "color-ramp" | |
} | |
}, | |
paint_circle: { | |
"circle-radius": { | |
type: "number", | |
default: 5, | |
minimum: 0, | |
transition: !0, | |
units: "pixels", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"circle-color": { | |
type: "color", | |
default: "#000000", | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"circle-blur": { | |
type: "number", | |
default: 0, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"circle-opacity": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"circle-translate": { | |
type: "array", | |
value: "number", | |
length: 2, | |
default: [0, 0], | |
transition: !0, | |
units: "pixels", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"circle-translate-anchor": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {} | |
}, | |
default: "map", | |
requires: ["circle-translate"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"circle-pitch-scale": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {} | |
}, | |
default: "map", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"circle-pitch-alignment": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {} | |
}, | |
default: "viewport", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"circle-stroke-width": { | |
type: "number", | |
default: 0, | |
minimum: 0, | |
transition: !0, | |
units: "pixels", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"circle-stroke-color": { | |
type: "color", | |
default: "#000000", | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"circle-stroke-opacity": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
} | |
}, | |
paint_heatmap: { | |
"heatmap-radius": { | |
type: "number", | |
default: 30, | |
minimum: 1, | |
transition: !0, | |
units: "pixels", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"heatmap-weight": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
transition: !1, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"heatmap-intensity": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"heatmap-color": { | |
type: "color", | |
default: ["interpolate", ["linear"], ["heatmap-density"], 0, "rgba(0, 0, 255, 0)", .1, "royalblue", .3, "cyan", .5, "lime", .7, "yellow", 1, "red"], | |
transition: !1, | |
expression: { | |
interpolated: !0, | |
parameters: ["heatmap-density"] | |
}, | |
"property-type": "color-ramp" | |
}, | |
"heatmap-opacity": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
} | |
}, | |
paint_symbol: { | |
"icon-opacity": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"icon-color": { | |
type: "color", | |
default: "#000000", | |
transition: !0, | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"icon-halo-color": { | |
type: "color", | |
default: "rgba(0, 0, 0, 0)", | |
transition: !0, | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"icon-halo-width": { | |
type: "number", | |
default: 0, | |
minimum: 0, | |
transition: !0, | |
units: "pixels", | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"icon-halo-blur": { | |
type: "number", | |
default: 0, | |
minimum: 0, | |
transition: !0, | |
units: "pixels", | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"icon-translate": { | |
type: "array", | |
value: "number", | |
length: 2, | |
default: [0, 0], | |
transition: !0, | |
units: "pixels", | |
requires: ["icon-image"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"icon-translate-anchor": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {} | |
}, | |
default: "map", | |
requires: ["icon-image", "icon-translate"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-opacity": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-color": { | |
type: "color", | |
default: "#000000", | |
transition: !0, | |
overridable: !0, | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-halo-color": { | |
type: "color", | |
default: "rgba(0, 0, 0, 0)", | |
transition: !0, | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-halo-width": { | |
type: "number", | |
default: 0, | |
minimum: 0, | |
transition: !0, | |
units: "pixels", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-halo-blur": { | |
type: "number", | |
default: 0, | |
minimum: 0, | |
transition: !0, | |
units: "pixels", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom", "feature", "feature-state"] | |
}, | |
"property-type": "data-driven" | |
}, | |
"text-translate": { | |
type: "array", | |
value: "number", | |
length: 2, | |
default: [0, 0], | |
transition: !0, | |
units: "pixels", | |
requires: ["text-field"], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"text-translate-anchor": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {} | |
}, | |
default: "map", | |
requires: ["text-field", "text-translate"], | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
} | |
}, | |
paint_raster: { | |
"raster-opacity": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"raster-hue-rotate": { | |
type: "number", | |
default: 0, | |
period: 360, | |
transition: !0, | |
units: "degrees", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"raster-brightness-min": { | |
type: "number", | |
default: 0, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"raster-brightness-max": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"raster-saturation": { | |
type: "number", | |
default: 0, | |
minimum: -1, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"raster-contrast": { | |
type: "number", | |
default: 0, | |
minimum: -1, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"raster-resampling": { | |
type: "enum", | |
values: { | |
linear: {}, | |
nearest: {} | |
}, | |
default: "linear", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"raster-fade-duration": { | |
type: "number", | |
default: 300, | |
minimum: 0, | |
transition: !1, | |
units: "milliseconds", | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
} | |
}, | |
paint_hillshade: { | |
"hillshade-illumination-direction": { | |
type: "number", | |
default: 335, | |
minimum: 0, | |
maximum: 359, | |
transition: !1, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"hillshade-illumination-anchor": { | |
type: "enum", | |
values: { | |
map: {}, | |
viewport: {} | |
}, | |
default: "viewport", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"hillshade-exaggeration": { | |
type: "number", | |
default: .5, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"hillshade-shadow-color": { | |
type: "color", | |
default: "#000000", | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"hillshade-highlight-color": { | |
type: "color", | |
default: "#FFFFFF", | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"hillshade-accent-color": { | |
type: "color", | |
default: "#000000", | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
} | |
}, | |
paint_background: { | |
"background-color": { | |
type: "color", | |
default: "#000000", | |
transition: !0, | |
requires: [{ | |
"!": "background-pattern" | |
}], | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
}, | |
"background-pattern": { | |
type: "resolvedImage", | |
transition: !0, | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom"] | |
}, | |
"property-type": "cross-faded" | |
}, | |
"background-opacity": { | |
type: "number", | |
default: 1, | |
minimum: 0, | |
maximum: 1, | |
transition: !0, | |
expression: { | |
interpolated: !0, | |
parameters: ["zoom"] | |
}, | |
"property-type": "data-constant" | |
} | |
}, | |
transition: { | |
duration: { | |
type: "number", | |
default: 300, | |
minimum: 0, | |
units: "milliseconds" | |
}, | |
delay: { | |
type: "number", | |
default: 0, | |
minimum: 0, | |
units: "milliseconds" | |
} | |
}, | |
"property-type": { | |
"data-driven": { | |
type: "property-type" | |
}, | |
"cross-faded": { | |
type: "property-type" | |
}, | |
"cross-faded-data-driven": { | |
type: "property-type" | |
}, | |
"color-ramp": { | |
type: "property-type" | |
}, | |
"data-constant": { | |
type: "property-type" | |
}, | |
constant: { | |
type: "property-type" | |
} | |
}, | |
promoteId: { | |
"*": { | |
type: "string" | |
} | |
} | |
} | |
, It = function(t, e, r, i) { | |
this.message = (t ? t + ": " : "") + r, | |
i && (this.identifier = i), | |
null != e && e.__line__ && (this.line = e.__line__) | |
}; | |
function Ft(t) { | |
var e = t.value; | |
return e ? [new It(t.key,e,"constants have been deprecated as of v8")] : [] | |
} | |
function Bt(t) { | |
for (var e = [], r = arguments.length - 1; r-- > 0; ) | |
e[r] = arguments[r + 1]; | |
for (var i = 0, n = e; i < n.length; i += 1) { | |
var o = n[i]; | |
for (var a in o) | |
t[a] = o[a] | |
} | |
return t | |
} | |
function Pt(t) { | |
return t instanceof Number || t instanceof String || t instanceof Boolean ? t.valueOf() : t | |
} | |
function Mt(t) { | |
if (Array.isArray(t)) | |
return t.map(Mt); | |
if (t instanceof Object && !(t instanceof Number || t instanceof String || t instanceof Boolean)) { | |
var e = {}; | |
for (var r in t) | |
e[r] = Mt(t[r]); | |
return e | |
} | |
return Pt(t) | |
} | |
var Lt = function(t) { | |
function e(e, r) { | |
t.call(this, r), | |
this.message = r, | |
this.key = e | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e | |
}(Error) | |
, Rt = function(t, e) { | |
void 0 === e && (e = []), | |
this.parent = t, | |
this.bindings = {}; | |
for (var r = 0, i = e; r < i.length; r += 1) { | |
var n = i[r]; | |
this.bindings[n[0]] = n[1] | |
} | |
}; | |
Rt.prototype.concat = function(t) { | |
return new Rt(this,t) | |
} | |
, | |
Rt.prototype.get = function(t) { | |
if (this.bindings[t]) | |
return this.bindings[t]; | |
if (this.parent) | |
return this.parent.get(t); | |
throw new Error(t + " not found in scope.") | |
} | |
, | |
Rt.prototype.has = function(t) { | |
return !!this.bindings[t] || !!this.parent && this.parent.has(t) | |
} | |
; | |
var Ot = { | |
kind: "null" | |
} | |
, Ut = { | |
kind: "number" | |
} | |
, Vt = { | |
kind: "string" | |
} | |
, jt = { | |
kind: "boolean" | |
} | |
, Nt = { | |
kind: "color" | |
} | |
, qt = { | |
kind: "object" | |
} | |
, Gt = { | |
kind: "value" | |
} | |
, Zt = { | |
kind: "collator" | |
} | |
, Xt = { | |
kind: "formatted" | |
} | |
, Wt = { | |
kind: "resolvedImage" | |
}; | |
function Ht(t, e) { | |
return { | |
kind: "array", | |
itemType: t, | |
N: e | |
} | |
} | |
function Kt(t) { | |
if ("array" === t.kind) { | |
var e = Kt(t.itemType); | |
return "number" == typeof t.N ? "array<" + e + ", " + t.N + ">" : "value" === t.itemType.kind ? "array" : "array<" + e + ">" | |
} | |
return t.kind | |
} | |
var Jt = [Ot, Ut, Vt, jt, Nt, Xt, qt, Ht(Gt), Wt]; | |
function Yt(t, e) { | |
if ("error" === e.kind) | |
return null; | |
if ("array" === t.kind) { | |
if ("array" === e.kind && (0 === e.N && "value" === e.itemType.kind || !Yt(t.itemType, e.itemType)) && ("number" != typeof t.N || t.N === e.N)) | |
return null | |
} else { | |
if (t.kind === e.kind) | |
return null; | |
if ("value" === t.kind) | |
for (var r = 0, i = Jt; r < i.length; r += 1) | |
if (!Yt(i[r], e)) | |
return null | |
} | |
return "Expected " + Kt(t) + " but found " + Kt(e) + " instead." | |
} | |
function $t(t, e) { | |
return e.some((function(e) { | |
return e.kind === t.kind | |
} | |
)) | |
} | |
function Qt(t, e) { | |
return e.some((function(e) { | |
return "null" === e ? null === t : "array" === e ? Array.isArray(t) : "object" === e ? t && !Array.isArray(t) && "object" == typeof t : e === typeof t | |
} | |
)) | |
} | |
var te = e((function(t, e) { | |
var r = { | |
transparent: [0, 0, 0, 0], | |
aliceblue: [240, 248, 255, 1], | |
antiquewhite: [250, 235, 215, 1], | |
aqua: [0, 255, 255, 1], | |
aquamarine: [127, 255, 212, 1], | |
azure: [240, 255, 255, 1], | |
beige: [245, 245, 220, 1], | |
bisque: [255, 228, 196, 1], | |
black: [0, 0, 0, 1], | |
blanchedalmond: [255, 235, 205, 1], | |
blue: [0, 0, 255, 1], | |
blueviolet: [138, 43, 226, 1], | |
brown: [165, 42, 42, 1], | |
burlywood: [222, 184, 135, 1], | |
cadetblue: [95, 158, 160, 1], | |
chartreuse: [127, 255, 0, 1], | |
chocolate: [210, 105, 30, 1], | |
coral: [255, 127, 80, 1], | |
cornflowerblue: [100, 149, 237, 1], | |
cornsilk: [255, 248, 220, 1], | |
crimson: [220, 20, 60, 1], | |
cyan: [0, 255, 255, 1], | |
darkblue: [0, 0, 139, 1], | |
darkcyan: [0, 139, 139, 1], | |
darkgoldenrod: [184, 134, 11, 1], | |
darkgray: [169, 169, 169, 1], | |
darkgreen: [0, 100, 0, 1], | |
darkgrey: [169, 169, 169, 1], | |
darkkhaki: [189, 183, 107, 1], | |
darkmagenta: [139, 0, 139, 1], | |
darkolivegreen: [85, 107, 47, 1], | |
darkorange: [255, 140, 0, 1], | |
darkorchid: [153, 50, 204, 1], | |
darkred: [139, 0, 0, 1], | |
darksalmon: [233, 150, 122, 1], | |
darkseagreen: [143, 188, 143, 1], | |
darkslateblue: [72, 61, 139, 1], | |
darkslategray: [47, 79, 79, 1], | |
darkslategrey: [47, 79, 79, 1], | |
darkturquoise: [0, 206, 209, 1], | |
darkviolet: [148, 0, 211, 1], | |
deeppink: [255, 20, 147, 1], | |
deepskyblue: [0, 191, 255, 1], | |
dimgray: [105, 105, 105, 1], | |
dimgrey: [105, 105, 105, 1], | |
dodgerblue: [30, 144, 255, 1], | |
firebrick: [178, 34, 34, 1], | |
floralwhite: [255, 250, 240, 1], | |
forestgreen: [34, 139, 34, 1], | |
fuchsia: [255, 0, 255, 1], | |
gainsboro: [220, 220, 220, 1], | |
ghostwhite: [248, 248, 255, 1], | |
gold: [255, 215, 0, 1], | |
goldenrod: [218, 165, 32, 1], | |
gray: [128, 128, 128, 1], | |
green: [0, 128, 0, 1], | |
greenyellow: [173, 255, 47, 1], | |
grey: [128, 128, 128, 1], | |
honeydew: [240, 255, 240, 1], | |
hotpink: [255, 105, 180, 1], | |
indianred: [205, 92, 92, 1], | |
indigo: [75, 0, 130, 1], | |
ivory: [255, 255, 240, 1], | |
khaki: [240, 230, 140, 1], | |
lavender: [230, 230, 250, 1], | |
lavenderblush: [255, 240, 245, 1], | |
lawngreen: [124, 252, 0, 1], | |
lemonchiffon: [255, 250, 205, 1], | |
lightblue: [173, 216, 230, 1], | |
lightcoral: [240, 128, 128, 1], | |
lightcyan: [224, 255, 255, 1], | |
lightgoldenrodyellow: [250, 250, 210, 1], | |
lightgray: [211, 211, 211, 1], | |
lightgreen: [144, 238, 144, 1], | |
lightgrey: [211, 211, 211, 1], | |
lightpink: [255, 182, 193, 1], | |
lightsalmon: [255, 160, 122, 1], | |
lightseagreen: [32, 178, 170, 1], | |
lightskyblue: [135, 206, 250, 1], | |
lightslategray: [119, 136, 153, 1], | |
lightslategrey: [119, 136, 153, 1], | |
lightsteelblue: [176, 196, 222, 1], | |
lightyellow: [255, 255, 224, 1], | |
lime: [0, 255, 0, 1], | |
limegreen: [50, 205, 50, 1], | |
linen: [250, 240, 230, 1], | |
magenta: [255, 0, 255, 1], | |
maroon: [128, 0, 0, 1], | |
mediumaquamarine: [102, 205, 170, 1], | |
mediumblue: [0, 0, 205, 1], | |
mediumorchid: [186, 85, 211, 1], | |
mediumpurple: [147, 112, 219, 1], | |
mediumseagreen: [60, 179, 113, 1], | |
mediumslateblue: [123, 104, 238, 1], | |
mediumspringgreen: [0, 250, 154, 1], | |
mediumturquoise: [72, 209, 204, 1], | |
mediumvioletred: [199, 21, 133, 1], | |
midnightblue: [25, 25, 112, 1], | |
mintcream: [245, 255, 250, 1], | |
mistyrose: [255, 228, 225, 1], | |
moccasin: [255, 228, 181, 1], | |
navajowhite: [255, 222, 173, 1], | |
navy: [0, 0, 128, 1], | |
oldlace: [253, 245, 230, 1], | |
olive: [128, 128, 0, 1], | |
olivedrab: [107, 142, 35, 1], | |
orange: [255, 165, 0, 1], | |
orangered: [255, 69, 0, 1], | |
orchid: [218, 112, 214, 1], | |
palegoldenrod: [238, 232, 170, 1], | |
palegreen: [152, 251, 152, 1], | |
paleturquoise: [175, 238, 238, 1], | |
palevioletred: [219, 112, 147, 1], | |
papayawhip: [255, 239, 213, 1], | |
peachpuff: [255, 218, 185, 1], | |
peru: [205, 133, 63, 1], | |
pink: [255, 192, 203, 1], | |
plum: [221, 160, 221, 1], | |
powderblue: [176, 224, 230, 1], | |
purple: [128, 0, 128, 1], | |
rebeccapurple: [102, 51, 153, 1], | |
red: [255, 0, 0, 1], | |
rosybrown: [188, 143, 143, 1], | |
royalblue: [65, 105, 225, 1], | |
saddlebrown: [139, 69, 19, 1], | |
salmon: [250, 128, 114, 1], | |
sandybrown: [244, 164, 96, 1], | |
seagreen: [46, 139, 87, 1], | |
seashell: [255, 245, 238, 1], | |
sienna: [160, 82, 45, 1], | |
silver: [192, 192, 192, 1], | |
skyblue: [135, 206, 235, 1], | |
slateblue: [106, 90, 205, 1], | |
slategray: [112, 128, 144, 1], | |
slategrey: [112, 128, 144, 1], | |
snow: [255, 250, 250, 1], | |
springgreen: [0, 255, 127, 1], | |
steelblue: [70, 130, 180, 1], | |
tan: [210, 180, 140, 1], | |
teal: [0, 128, 128, 1], | |
thistle: [216, 191, 216, 1], | |
tomato: [255, 99, 71, 1], | |
turquoise: [64, 224, 208, 1], | |
violet: [238, 130, 238, 1], | |
wheat: [245, 222, 179, 1], | |
white: [255, 255, 255, 1], | |
whitesmoke: [245, 245, 245, 1], | |
yellow: [255, 255, 0, 1], | |
yellowgreen: [154, 205, 50, 1] | |
}; | |
function i(t) { | |
return (t = Math.round(t)) < 0 ? 0 : t > 255 ? 255 : t | |
} | |
function n(t) { | |
return i("%" === t[t.length - 1] ? parseFloat(t) / 100 * 255 : parseInt(t)) | |
} | |
function o(t) { | |
return (e = "%" === t[t.length - 1] ? parseFloat(t) / 100 : parseFloat(t)) < 0 ? 0 : e > 1 ? 1 : e; | |
var e | |
} | |
function a(t, e, r) { | |
return r < 0 ? r += 1 : r > 1 && (r -= 1), | |
6 * r < 1 ? t + (e - t) * r * 6 : 2 * r < 1 ? e : 3 * r < 2 ? t + (e - t) * (2 / 3 - r) * 6 : t | |
} | |
try { | |
e.parseCSSColor = function(t) { | |
var e, s = t.replace(/ /g, "").toLowerCase(); | |
if (s in r) | |
return r[s].slice(); | |
if ("#" === s[0]) | |
return 4 === s.length ? (e = parseInt(s.substr(1), 16)) >= 0 && e <= 4095 ? [(3840 & e) >> 4 | (3840 & e) >> 8, 240 & e | (240 & e) >> 4, 15 & e | (15 & e) << 4, 1] : null : 7 === s.length && (e = parseInt(s.substr(1), 16)) >= 0 && e <= 16777215 ? [(16711680 & e) >> 16, (65280 & e) >> 8, 255 & e, 1] : null; | |
var l = s.indexOf("(") | |
, u = s.indexOf(")"); | |
if (-1 !== l && u + 1 === s.length) { | |
var c = s.substr(0, l) | |
, p = s.substr(l + 1, u - (l + 1)).split(",") | |
, h = 1; | |
switch (c) { | |
case "rgba": | |
if (4 !== p.length) | |
return null; | |
h = o(p.pop()); | |
case "rgb": | |
return 3 !== p.length ? null : [n(p[0]), n(p[1]), n(p[2]), h]; | |
case "hsla": | |
if (4 !== p.length) | |
return null; | |
h = o(p.pop()); | |
case "hsl": | |
if (3 !== p.length) | |
return null; | |
var f = (parseFloat(p[0]) % 360 + 360) % 360 / 360 | |
, d = o(p[1]) | |
, m = o(p[2]) | |
, y = m <= .5 ? m * (d + 1) : m + d - m * d | |
, g = 2 * m - y; | |
return [i(255 * a(g, y, f + 1 / 3)), i(255 * a(g, y, f)), i(255 * a(g, y, f - 1 / 3)), h]; | |
default: | |
return null | |
} | |
} | |
return null | |
} | |
} catch (t) {} | |
} | |
)).parseCSSColor | |
, ee = function(t, e, r, i) { | |
void 0 === i && (i = 1), | |
this.r = t, | |
this.g = e, | |
this.b = r, | |
this.a = i | |
}; | |
ee.parse = function(t) { | |
if (t) { | |
if (t instanceof ee) | |
return t; | |
if ("string" == typeof t) { | |
var e = te(t); | |
if (e) | |
return new ee(e[0] / 255 * e[3],e[1] / 255 * e[3],e[2] / 255 * e[3],e[3]) | |
} | |
} | |
} | |
, | |
ee.prototype.toString = function() { | |
var t = this.toArray() | |
, e = t[1] | |
, r = t[2] | |
, i = t[3]; | |
return "rgba(" + Math.round(t[0]) + "," + Math.round(e) + "," + Math.round(r) + "," + i + ")" | |
} | |
, | |
ee.prototype.toArray = function() { | |
var t = this.a; | |
return 0 === t ? [0, 0, 0, 0] : [255 * this.r / t, 255 * this.g / t, 255 * this.b / t, t] | |
} | |
, | |
ee.black = new ee(0,0,0,1), | |
ee.white = new ee(1,1,1,1), | |
ee.transparent = new ee(0,0,0,0), | |
ee.red = new ee(1,0,0,1); | |
var re = function(t, e, r) { | |
this.sensitivity = t ? e ? "variant" : "case" : e ? "accent" : "base", | |
this.locale = r, | |
this.collator = new Intl.Collator(this.locale ? this.locale : [],{ | |
sensitivity: this.sensitivity, | |
usage: "search" | |
}) | |
}; | |
re.prototype.compare = function(t, e) { | |
return this.collator.compare(t, e) | |
} | |
, | |
re.prototype.resolvedLocale = function() { | |
return new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale | |
} | |
; | |
var ie = function(t, e, r, i, n) { | |
this.text = t, | |
this.image = e, | |
this.scale = r, | |
this.fontStack = i, | |
this.textColor = n | |
} | |
, ne = function(t) { | |
this.sections = t | |
}; | |
ne.fromString = function(t) { | |
return new ne([new ie(t,null,null,null,null)]) | |
} | |
, | |
ne.prototype.isEmpty = function() { | |
return 0 === this.sections.length || !this.sections.some((function(t) { | |
return 0 !== t.text.length || t.image && 0 !== t.image.name.length | |
} | |
)) | |
} | |
, | |
ne.factory = function(t) { | |
return t instanceof ne ? t : ne.fromString(t) | |
} | |
, | |
ne.prototype.toString = function() { | |
return 0 === this.sections.length ? "" : this.sections.map((function(t) { | |
return t.text | |
} | |
)).join("") | |
} | |
, | |
ne.prototype.serialize = function() { | |
for (var t = ["format"], e = 0, r = this.sections; e < r.length; e += 1) { | |
var i = r[e]; | |
if (i.image) | |
t.push(["image", i.image.name]); | |
else { | |
t.push(i.text); | |
var n = {}; | |
i.fontStack && (n["text-font"] = ["literal", i.fontStack.split(",")]), | |
i.scale && (n["font-scale"] = i.scale), | |
i.textColor && (n["text-color"] = ["rgba"].concat(i.textColor.toArray())), | |
t.push(n) | |
} | |
} | |
return t | |
} | |
; | |
var oe = function(t) { | |
this.name = t.name, | |
this.available = t.available | |
}; | |
function ae(t, e, r, i) { | |
return "number" == typeof t && t >= 0 && t <= 255 && "number" == typeof e && e >= 0 && e <= 255 && "number" == typeof r && r >= 0 && r <= 255 ? void 0 === i || "number" == typeof i && i >= 0 && i <= 1 ? null : "Invalid rgba value [" + [t, e, r, i].join(", ") + "]: 'a' must be between 0 and 1." : "Invalid rgba value [" + ("number" == typeof i ? [t, e, r, i] : [t, e, r]).join(", ") + "]: 'r', 'g', and 'b' must be between 0 and 255." | |
} | |
function se(t) { | |
if (null === t) | |
return !0; | |
if ("string" == typeof t) | |
return !0; | |
if ("boolean" == typeof t) | |
return !0; | |
if ("number" == typeof t) | |
return !0; | |
if (t instanceof ee) | |
return !0; | |
if (t instanceof re) | |
return !0; | |
if (t instanceof ne) | |
return !0; | |
if (t instanceof oe) | |
return !0; | |
if (Array.isArray(t)) { | |
for (var e = 0, r = t; e < r.length; e += 1) | |
if (!se(r[e])) | |
return !1; | |
return !0 | |
} | |
if ("object" == typeof t) { | |
for (var i in t) | |
if (!se(t[i])) | |
return !1; | |
return !0 | |
} | |
return !1 | |
} | |
function le(t) { | |
if (null === t) | |
return Ot; | |
if ("string" == typeof t) | |
return Vt; | |
if ("boolean" == typeof t) | |
return jt; | |
if ("number" == typeof t) | |
return Ut; | |
if (t instanceof ee) | |
return Nt; | |
if (t instanceof re) | |
return Zt; | |
if (t instanceof ne) | |
return Xt; | |
if (t instanceof oe) | |
return Wt; | |
if (Array.isArray(t)) { | |
for (var e, r = t.length, i = 0, n = t; i < n.length; i += 1) { | |
var o = le(n[i]); | |
if (e) { | |
if (e === o) | |
continue; | |
e = Gt; | |
break | |
} | |
e = o | |
} | |
return Ht(e || Gt, r) | |
} | |
return qt | |
} | |
function ue(t) { | |
var e = typeof t; | |
return null === t ? "" : "string" === e || "number" === e || "boolean" === e ? String(t) : t instanceof ee || t instanceof ne || t instanceof oe ? t.toString() : JSON.stringify(t) | |
} | |
oe.prototype.toString = function() { | |
return this.name | |
} | |
, | |
oe.fromString = function(t) { | |
return t ? new oe({ | |
name: t, | |
available: !1 | |
}) : null | |
} | |
, | |
oe.prototype.serialize = function() { | |
return ["image", this.name] | |
} | |
; | |
var ce = function(t, e) { | |
this.type = t, | |
this.value = e | |
}; | |
ce.parse = function(t, e) { | |
if (2 !== t.length) | |
return e.error("'literal' expression requires exactly one argument, but found " + (t.length - 1) + " instead."); | |
if (!se(t[1])) | |
return e.error("invalid value"); | |
var r = t[1] | |
, i = le(r) | |
, n = e.expectedType; | |
return "array" !== i.kind || 0 !== i.N || !n || "array" !== n.kind || "number" == typeof n.N && 0 !== n.N || (i = n), | |
new ce(i,r) | |
} | |
, | |
ce.prototype.evaluate = function() { | |
return this.value | |
} | |
, | |
ce.prototype.eachChild = function() {} | |
, | |
ce.prototype.outputDefined = function() { | |
return !0 | |
} | |
, | |
ce.prototype.serialize = function() { | |
return "array" === this.type.kind || "object" === this.type.kind ? ["literal", this.value] : this.value instanceof ee ? ["rgba"].concat(this.value.toArray()) : this.value instanceof ne ? this.value.serialize() : this.value | |
} | |
; | |
var pe = function(t) { | |
this.name = "ExpressionEvaluationError", | |
this.message = t | |
}; | |
pe.prototype.toJSON = function() { | |
return this.message | |
} | |
; | |
var he = { | |
string: Vt, | |
number: Ut, | |
boolean: jt, | |
object: qt | |
} | |
, fe = function(t, e) { | |
this.type = t, | |
this.args = e | |
}; | |
fe.parse = function(t, e) { | |
if (t.length < 2) | |
return e.error("Expected at least one argument."); | |
var r, i = 1, n = t[0]; | |
if ("array" === n) { | |
var o, a; | |
if (t.length > 2) { | |
var s = t[1]; | |
if ("string" != typeof s || !(s in he) || "object" === s) | |
return e.error('The item type argument of "array" must be one of string, number, boolean', 1); | |
o = he[s], | |
i++ | |
} else | |
o = Gt; | |
if (t.length > 3) { | |
if (null !== t[2] && ("number" != typeof t[2] || t[2] < 0 || t[2] !== Math.floor(t[2]))) | |
return e.error('The length argument to "array" must be a positive integer literal', 2); | |
a = t[2], | |
i++ | |
} | |
r = Ht(o, a) | |
} else | |
r = he[n]; | |
for (var l = []; i < t.length; i++) { | |
var u = e.parse(t[i], i, Gt); | |
if (!u) | |
return null; | |
l.push(u) | |
} | |
return new fe(r,l) | |
} | |
, | |
fe.prototype.evaluate = function(t) { | |
for (var e = 0; e < this.args.length; e++) { | |
var r = this.args[e].evaluate(t); | |
if (!Yt(this.type, le(r))) | |
return r; | |
if (e === this.args.length - 1) | |
throw new pe("Expected value to be of type " + Kt(this.type) + ", but found " + Kt(le(r)) + " instead.") | |
} | |
return null | |
} | |
, | |
fe.prototype.eachChild = function(t) { | |
this.args.forEach(t) | |
} | |
, | |
fe.prototype.outputDefined = function() { | |
return this.args.every((function(t) { | |
return t.outputDefined() | |
} | |
)) | |
} | |
, | |
fe.prototype.serialize = function() { | |
var t = this.type | |
, e = [t.kind]; | |
if ("array" === t.kind) { | |
var r = t.itemType; | |
if ("string" === r.kind || "number" === r.kind || "boolean" === r.kind) { | |
e.push(r.kind); | |
var i = t.N; | |
("number" == typeof i || this.args.length > 1) && e.push(i) | |
} | |
} | |
return e.concat(this.args.map((function(t) { | |
return t.serialize() | |
} | |
))) | |
} | |
; | |
var de = function(t) { | |
this.type = Xt, | |
this.sections = t | |
}; | |
de.parse = function(t, e) { | |
if (t.length < 2) | |
return e.error("Expected at least one argument."); | |
var r = t[1]; | |
if (!Array.isArray(r) && "object" == typeof r) | |
return e.error("First argument must be an image or text section."); | |
for (var i = [], n = !1, o = 1; o <= t.length - 1; ++o) { | |
var a = t[o]; | |
if (n && "object" == typeof a && !Array.isArray(a)) { | |
n = !1; | |
var s = null; | |
if (a["font-scale"] && !(s = e.parse(a["font-scale"], 1, Ut))) | |
return null; | |
var l = null; | |
if (a["text-font"] && !(l = e.parse(a["text-font"], 1, Ht(Vt)))) | |
return null; | |
var u = null; | |
if (a["text-color"] && !(u = e.parse(a["text-color"], 1, Nt))) | |
return null; | |
var c = i[i.length - 1]; | |
c.scale = s, | |
c.font = l, | |
c.textColor = u | |
} else { | |
var p = e.parse(t[o], 1, Gt); | |
if (!p) | |
return null; | |
var h = p.type.kind; | |
if ("string" !== h && "value" !== h && "null" !== h && "resolvedImage" !== h) | |
return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'."); | |
n = !0, | |
i.push({ | |
content: p, | |
scale: null, | |
font: null, | |
textColor: null | |
}) | |
} | |
} | |
return new de(i) | |
} | |
, | |
de.prototype.evaluate = function(t) { | |
return new ne(this.sections.map((function(e) { | |
var r = e.content.evaluate(t); | |
return le(r) === Wt ? new ie("",r,null,null,null) : new ie(ue(r),null,e.scale ? e.scale.evaluate(t) : null,e.font ? e.font.evaluate(t).join(",") : null,e.textColor ? e.textColor.evaluate(t) : null) | |
} | |
))) | |
} | |
, | |
de.prototype.eachChild = function(t) { | |
for (var e = 0, r = this.sections; e < r.length; e += 1) { | |
var i = r[e]; | |
t(i.content), | |
i.scale && t(i.scale), | |
i.font && t(i.font), | |
i.textColor && t(i.textColor) | |
} | |
} | |
, | |
de.prototype.outputDefined = function() { | |
return !1 | |
} | |
, | |
de.prototype.serialize = function() { | |
for (var t = ["format"], e = 0, r = this.sections; e < r.length; e += 1) { | |
var i = r[e]; | |
t.push(i.content.serialize()); | |
var n = {}; | |
i.scale && (n["font-scale"] = i.scale.serialize()), | |
i.font && (n["text-font"] = i.font.serialize()), | |
i.textColor && (n["text-color"] = i.textColor.serialize()), | |
t.push(n) | |
} | |
return t | |
} | |
; | |
var me = function(t) { | |
this.type = Wt, | |
this.input = t | |
}; | |
me.parse = function(t, e) { | |
if (2 !== t.length) | |
return e.error("Expected two arguments."); | |
var r = e.parse(t[1], 1, Vt); | |
return r ? new me(r) : e.error("No image name provided.") | |
} | |
, | |
me.prototype.evaluate = function(t) { | |
var e = this.input.evaluate(t) | |
, r = oe.fromString(e); | |
return r && t.availableImages && (r.available = t.availableImages.indexOf(e) > -1), | |
r | |
} | |
, | |
me.prototype.eachChild = function(t) { | |
t(this.input) | |
} | |
, | |
me.prototype.outputDefined = function() { | |
return !1 | |
} | |
, | |
me.prototype.serialize = function() { | |
return ["image", this.input.serialize()] | |
} | |
; | |
var ye = { | |
"to-boolean": jt, | |
"to-color": Nt, | |
"to-number": Ut, | |
"to-string": Vt | |
} | |
, ge = function(t, e) { | |
this.type = t, | |
this.args = e | |
}; | |
ge.parse = function(t, e) { | |
if (t.length < 2) | |
return e.error("Expected at least one argument."); | |
var r = t[0]; | |
if (("to-boolean" === r || "to-string" === r) && 2 !== t.length) | |
return e.error("Expected one argument."); | |
for (var i = ye[r], n = [], o = 1; o < t.length; o++) { | |
var a = e.parse(t[o], o, Gt); | |
if (!a) | |
return null; | |
n.push(a) | |
} | |
return new ge(i,n) | |
} | |
, | |
ge.prototype.evaluate = function(t) { | |
if ("boolean" === this.type.kind) | |
return Boolean(this.args[0].evaluate(t)); | |
if ("color" === this.type.kind) { | |
for (var e, r, i = 0, n = this.args; i < n.length; i += 1) { | |
if (r = null, | |
(e = n[i].evaluate(t))instanceof ee) | |
return e; | |
if ("string" == typeof e) { | |
var o = t.parseColor(e); | |
if (o) | |
return o | |
} else if (Array.isArray(e) && !(r = e.length < 3 || e.length > 4 ? "Invalid rbga value " + JSON.stringify(e) + ": expected an array containing either three or four numeric values." : ae(e[0], e[1], e[2], e[3]))) | |
return new ee(e[0] / 255,e[1] / 255,e[2] / 255,e[3]) | |
} | |
throw new pe(r || "Could not parse color from value '" + ("string" == typeof e ? e : String(JSON.stringify(e))) + "'") | |
} | |
if ("number" === this.type.kind) { | |
for (var a = null, s = 0, l = this.args; s < l.length; s += 1) { | |
if (null === (a = l[s].evaluate(t))) | |
return 0; | |
var u = Number(a); | |
if (!isNaN(u)) | |
return u | |
} | |
throw new pe("Could not convert " + JSON.stringify(a) + " to number.") | |
} | |
return "formatted" === this.type.kind ? ne.fromString(ue(this.args[0].evaluate(t))) : "resolvedImage" === this.type.kind ? oe.fromString(ue(this.args[0].evaluate(t))) : ue(this.args[0].evaluate(t)) | |
} | |
, | |
ge.prototype.eachChild = function(t) { | |
this.args.forEach(t) | |
} | |
, | |
ge.prototype.outputDefined = function() { | |
return this.args.every((function(t) { | |
return t.outputDefined() | |
} | |
)) | |
} | |
, | |
ge.prototype.serialize = function() { | |
if ("formatted" === this.type.kind) | |
return new de([{ | |
content: this.args[0], | |
scale: null, | |
font: null, | |
textColor: null | |
}]).serialize(); | |
if ("resolvedImage" === this.type.kind) | |
return new me(this.args[0]).serialize(); | |
var t = ["to-" + this.type.kind]; | |
return this.eachChild((function(e) { | |
t.push(e.serialize()) | |
} | |
)), | |
t | |
} | |
; | |
var ve = ["Unknown", "Point", "LineString", "Polygon"] | |
, _e = function() { | |
this.globals = null, | |
this.feature = null, | |
this.featureState = null, | |
this.formattedSection = null, | |
this._parseColorCache = {}, | |
this.availableImages = null, | |
this.canonical = null | |
}; | |
_e.prototype.id = function() { | |
return this.feature && "id"in this.feature ? this.feature.id : null | |
} | |
, | |
_e.prototype.geometryType = function() { | |
return this.feature ? "number" == typeof this.feature.type ? ve[this.feature.type] : this.feature.type : null | |
} | |
, | |
_e.prototype.geometry = function() { | |
return this.feature && "geometry"in this.feature ? this.feature.geometry : null | |
} | |
, | |
_e.prototype.canonicalID = function() { | |
return this.canonical | |
} | |
, | |
_e.prototype.properties = function() { | |
return this.feature && this.feature.properties || {} | |
} | |
, | |
_e.prototype.parseColor = function(t) { | |
var e = this._parseColorCache[t]; | |
return e || (e = this._parseColorCache[t] = ee.parse(t)), | |
e | |
} | |
; | |
var xe = function(t, e, r, i) { | |
this.name = t, | |
this.type = e, | |
this._evaluate = r, | |
this.args = i | |
}; | |
xe.prototype.evaluate = function(t) { | |
return this._evaluate(t, this.args) | |
} | |
, | |
xe.prototype.eachChild = function(t) { | |
this.args.forEach(t) | |
} | |
, | |
xe.prototype.outputDefined = function() { | |
return !1 | |
} | |
, | |
xe.prototype.serialize = function() { | |
return [this.name].concat(this.args.map((function(t) { | |
return t.serialize() | |
} | |
))) | |
} | |
, | |
xe.parse = function(t, e) { | |
var r, i = t[0], n = xe.definitions[i]; | |
if (!n) | |
return e.error('Unknown expression "' + i + '". If you wanted a literal array, use ["literal", [...]].', 0); | |
for (var o = Array.isArray(n) ? n[0] : n.type, a = Array.isArray(n) ? [[n[1], n[2]]] : n.overloads, s = a.filter((function(e) { | |
var r = e[0]; | |
return !Array.isArray(r) || r.length === t.length - 1 | |
} | |
)), l = null, u = 0, c = s; u < c.length; u += 1) { | |
var p = c[u] | |
, h = p[0] | |
, f = p[1]; | |
l = new Ne(e.registry,e.path,null,e.scope); | |
for (var d = [], m = !1, y = 1; y < t.length; y++) { | |
var g = t[y] | |
, v = Array.isArray(h) ? h[y - 1] : h.type | |
, _ = l.parse(g, 1 + d.length, v); | |
if (!_) { | |
m = !0; | |
break | |
} | |
d.push(_) | |
} | |
if (!m) | |
if (Array.isArray(h) && h.length !== d.length) | |
l.error("Expected " + h.length + " arguments, but found " + d.length + " instead."); | |
else { | |
for (var x = 0; x < d.length; x++) { | |
var b = Array.isArray(h) ? h[x] : h.type | |
, w = d[x]; | |
l.concat(x + 1).checkSubtype(b, w.type) | |
} | |
if (0 === l.errors.length) | |
return new xe(i,o,f,d) | |
} | |
} | |
if (1 === s.length) | |
(r = e.errors).push.apply(r, l.errors); | |
else { | |
for (var E = (s.length ? s : a).map((function(t) { | |
var e; | |
return e = t[0], | |
Array.isArray(e) ? "(" + e.map(Kt).join(", ") + ")" : "(" + Kt(e.type) + "...)" | |
} | |
)).join(" | "), C = [], A = 1; A < t.length; A++) { | |
var z = e.parse(t[A], 1 + C.length); | |
if (!z) | |
return null; | |
C.push(Kt(z.type)) | |
} | |
e.error("Expected arguments of type " + E + ", but found (" + C.join(", ") + ") instead.") | |
} | |
return null | |
} | |
, | |
xe.register = function(t, e) { | |
for (var r in xe.definitions = e, | |
e) | |
t[r] = xe | |
} | |
; | |
var be = function(t, e, r) { | |
this.type = Zt, | |
this.locale = r, | |
this.caseSensitive = t, | |
this.diacriticSensitive = e | |
}; | |
function we(t, e) { | |
t[0] = Math.min(t[0], e[0]), | |
t[1] = Math.min(t[1], e[1]), | |
t[2] = Math.max(t[2], e[0]), | |
t[3] = Math.max(t[3], e[1]) | |
} | |
function Ee(t, e) { | |
return !(t[0] <= e[0] || t[2] >= e[2] || t[1] <= e[1] || t[3] >= e[3]) | |
} | |
function Ce(t, e) { | |
var r = (180 + t[0]) / 360 | |
, i = (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + t[1] * Math.PI / 360))) / 360 | |
, n = Math.pow(2, e.z); | |
return [Math.round(r * n * 8192), Math.round(i * n * 8192)] | |
} | |
function Ae(t, e, r) { | |
return e[1] > t[1] != r[1] > t[1] && t[0] < (r[0] - e[0]) * (t[1] - e[1]) / (r[1] - e[1]) + e[0] | |
} | |
function ze(t, e) { | |
for (var r, i, n, o, a, s, l, u = !1, c = 0, p = e.length; c < p; c++) | |
for (var h = e[c], f = 0, d = h.length; f < d - 1; f++) { | |
if ((o = (r = t)[0] - (i = h[f])[0]) * (l = r[1] - (n = h[f + 1])[1]) - (s = r[0] - n[0]) * (a = r[1] - i[1]) == 0 && o * s <= 0 && a * l <= 0) | |
return !1; | |
Ae(t, h[f], h[f + 1]) && (u = !u) | |
} | |
return u | |
} | |
function Se(t, e) { | |
for (var r = 0; r < e.length; r++) | |
if (ze(t, e[r])) | |
return !0; | |
return !1 | |
} | |
function ke(t, e, r, i) { | |
var n = i[0] - r[0] | |
, o = i[1] - r[1] | |
, a = (t[0] - r[0]) * o - n * (t[1] - r[1]) | |
, s = (e[0] - r[0]) * o - n * (e[1] - r[1]); | |
return a > 0 && s < 0 || a < 0 && s > 0 | |
} | |
function Te(t, e, r) { | |
for (var i = 0, n = r; i < n.length; i += 1) | |
for (var o = n[i], a = 0; a < o.length - 1; ++a) | |
if (0 != (p = [(c = o[a + 1])[0] - (u = o[a])[0], c[1] - u[1]])[0] * (h = [(l = e)[0] - (s = t)[0], l[1] - s[1]])[1] - p[1] * h[0] && ke(s, l, u, c) && ke(u, c, s, l)) | |
return !0; | |
var s, l, u, c, p, h; | |
return !1 | |
} | |
function De(t, e) { | |
for (var r = 0; r < t.length; ++r) | |
if (!ze(t[r], e)) | |
return !1; | |
for (var i = 0; i < t.length - 1; ++i) | |
if (Te(t[i], t[i + 1], e)) | |
return !1; | |
return !0 | |
} | |
function Ie(t, e) { | |
for (var r = 0; r < e.length; r++) | |
if (De(t, e[r])) | |
return !0; | |
return !1 | |
} | |
function Fe(t, e, r) { | |
for (var i = [], n = 0; n < t.length; n++) { | |
for (var o = [], a = 0; a < t[n].length; a++) { | |
var s = Ce(t[n][a], r); | |
we(e, s), | |
o.push(s) | |
} | |
i.push(o) | |
} | |
return i | |
} | |
function Be(t, e, r) { | |
for (var i = [], n = 0; n < t.length; n++) { | |
var o = Fe(t[n], e, r); | |
i.push(o) | |
} | |
return i | |
} | |
function Pe(t, e, r, i) { | |
if (t[0] < r[0] || t[0] > r[2]) { | |
var n = .5 * i | |
, o = t[0] - r[0] > n ? -i : r[0] - t[0] > n ? i : 0; | |
0 === o && (o = t[0] - r[2] > n ? -i : r[2] - t[0] > n ? i : 0), | |
t[0] += o | |
} | |
we(e, t) | |
} | |
function Me(t, e, r, i) { | |
for (var n = 8192 * Math.pow(2, i.z), o = [8192 * i.x, 8192 * i.y], a = [], s = 0, l = t; s < l.length; s += 1) | |
for (var u = 0, c = l[s]; u < c.length; u += 1) { | |
var p = c[u] | |
, h = [p.x + o[0], p.y + o[1]]; | |
Pe(h, e, r, n), | |
a.push(h) | |
} | |
return a | |
} | |
function Le(t, e, r, i) { | |
for (var n, o = 8192 * Math.pow(2, i.z), a = [8192 * i.x, 8192 * i.y], s = [], l = 0, u = t; l < u.length; l += 1) { | |
for (var c = [], p = 0, h = u[l]; p < h.length; p += 1) { | |
var f = h[p] | |
, d = [f.x + a[0], f.y + a[1]]; | |
we(e, d), | |
c.push(d) | |
} | |
s.push(c) | |
} | |
if (e[2] - e[0] <= o / 2) { | |
(n = e)[0] = n[1] = 1 / 0, | |
n[2] = n[3] = -1 / 0; | |
for (var m = 0, y = s; m < y.length; m += 1) | |
for (var g = 0, v = y[m]; g < v.length; g += 1) | |
Pe(v[g], e, r, o) | |
} | |
return s | |
} | |
be.parse = function(t, e) { | |
if (2 !== t.length) | |
return e.error("Expected one argument."); | |
var r = t[1]; | |
if ("object" != typeof r || Array.isArray(r)) | |
return e.error("Collator options argument must be an object."); | |
var i = e.parse(void 0 !== r["case-sensitive"] && r["case-sensitive"], 1, jt); | |
if (!i) | |
return null; | |
var n = e.parse(void 0 !== r["diacritic-sensitive"] && r["diacritic-sensitive"], 1, jt); | |
if (!n) | |
return null; | |
var o = null; | |
return r.locale && !(o = e.parse(r.locale, 1, Vt)) ? null : new be(i,n,o) | |
} | |
, | |
be.prototype.evaluate = function(t) { | |
return new re(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale ? this.locale.evaluate(t) : null) | |
} | |
, | |
be.prototype.eachChild = function(t) { | |
t(this.caseSensitive), | |
t(this.diacriticSensitive), | |
this.locale && t(this.locale) | |
} | |
, | |
be.prototype.outputDefined = function() { | |
return !1 | |
} | |
, | |
be.prototype.serialize = function() { | |
var t = {}; | |
return t["case-sensitive"] = this.caseSensitive.serialize(), | |
t["diacritic-sensitive"] = this.diacriticSensitive.serialize(), | |
this.locale && (t.locale = this.locale.serialize()), | |
["collator", t] | |
} | |
; | |
var Re = function(t, e) { | |
this.type = jt, | |
this.geojson = t, | |
this.geometries = e | |
}; | |
function Oe(t) { | |
if (t instanceof xe) { | |
if ("get" === t.name && 1 === t.args.length) | |
return !1; | |
if ("feature-state" === t.name) | |
return !1; | |
if ("has" === t.name && 1 === t.args.length) | |
return !1; | |
if ("properties" === t.name || "geometry-type" === t.name || "id" === t.name) | |
return !1; | |
if (/^filter-/.test(t.name)) | |
return !1 | |
} | |
if (t instanceof Re) | |
return !1; | |
var e = !0; | |
return t.eachChild((function(t) { | |
e && !Oe(t) && (e = !1) | |
} | |
)), | |
e | |
} | |
function Ue(t) { | |
if (t instanceof xe && "feature-state" === t.name) | |
return !1; | |
var e = !0; | |
return t.eachChild((function(t) { | |
e && !Ue(t) && (e = !1) | |
} | |
)), | |
e | |
} | |
function Ve(t, e) { | |
if (t instanceof xe && e.indexOf(t.name) >= 0) | |
return !1; | |
var r = !0; | |
return t.eachChild((function(t) { | |
r && !Ve(t, e) && (r = !1) | |
} | |
)), | |
r | |
} | |
Re.parse = function(t, e) { | |
if (2 !== t.length) | |
return e.error("'within' expression requires exactly one argument, but found " + (t.length - 1) + " instead."); | |
if (se(t[1])) { | |
var r = t[1]; | |
if ("FeatureCollection" === r.type) | |
for (var i = 0; i < r.features.length; ++i) { | |
var n = r.features[i].geometry.type; | |
if ("Polygon" === n || "MultiPolygon" === n) | |
return new Re(r,r.features[i].geometry) | |
} | |
else if ("Feature" === r.type) { | |
var o = r.geometry.type; | |
if ("Polygon" === o || "MultiPolygon" === o) | |
return new Re(r,r.geometry) | |
} else if ("Polygon" === r.type || "MultiPolygon" === r.type) | |
return new Re(r,r) | |
} | |
return e.error("'within' expression requires valid geojson object that contains polygon geometry type.") | |
} | |
, | |
Re.prototype.evaluate = function(t) { | |
if (null != t.geometry() && null != t.canonicalID()) { | |
if ("Point" === t.geometryType()) | |
return function(t, e) { | |
var r = [1 / 0, 1 / 0, -1 / 0, -1 / 0] | |
, i = [1 / 0, 1 / 0, -1 / 0, -1 / 0] | |
, n = t.canonicalID(); | |
if ("Polygon" === e.type) { | |
var o = Fe(e.coordinates, i, n) | |
, a = Me(t.geometry(), r, i, n); | |
if (!Ee(r, i)) | |
return !1; | |
for (var s = 0, l = a; s < l.length; s += 1) | |
if (!ze(l[s], o)) | |
return !1 | |
} | |
if ("MultiPolygon" === e.type) { | |
var u = Be(e.coordinates, i, n) | |
, c = Me(t.geometry(), r, i, n); | |
if (!Ee(r, i)) | |
return !1; | |
for (var p = 0, h = c; p < h.length; p += 1) | |
if (!Se(h[p], u)) | |
return !1 | |
} | |
return !0 | |
}(t, this.geometries); | |
if ("LineString" === t.geometryType()) | |
return function(t, e) { | |
var r = [1 / 0, 1 / 0, -1 / 0, -1 / 0] | |
, i = [1 / 0, 1 / 0, -1 / 0, -1 / 0] | |
, n = t.canonicalID(); | |
if ("Polygon" === e.type) { | |
var o = Fe(e.coordinates, i, n) | |
, a = Le(t.geometry(), r, i, n); | |
if (!Ee(r, i)) | |
return !1; | |
for (var s = 0, l = a; s < l.length; s += 1) | |
if (!De(l[s], o)) | |
return !1 | |
} | |
if ("MultiPolygon" === e.type) { | |
var u = Be(e.coordinates, i, n) | |
, c = Le(t.geometry(), r, i, n); | |
if (!Ee(r, i)) | |
return !1; | |
for (var p = 0, h = c; p < h.length; p += 1) | |
if (!Ie(h[p], u)) | |
return !1 | |
} | |
return !0 | |
}(t, this.geometries) | |
} | |
return !1 | |
} | |
, | |
Re.prototype.eachChild = function() {} | |
, | |
Re.prototype.outputDefined = function() { | |
return !0 | |
} | |
, | |
Re.prototype.serialize = function() { | |
return ["within", this.geojson] | |
} | |
; | |
var je = function(t, e) { | |
this.type = e.type, | |
this.name = t, | |
this.boundExpression = e | |
}; | |
je.parse = function(t, e) { | |
if (2 !== t.length || "string" != typeof t[1]) | |
return e.error("'var' expression requires exactly one string literal argument."); | |
var r = t[1]; | |
return e.scope.has(r) ? new je(r,e.scope.get(r)) : e.error('Unknown variable "' + r + '". Make sure "' + r + '" has been bound in an enclosing "let" expression before using it.', 1) | |
} | |
, | |
je.prototype.evaluate = function(t) { | |
return this.boundExpression.evaluate(t) | |
} | |
, | |
je.prototype.eachChild = function() {} | |
, | |
je.prototype.outputDefined = function() { | |
return !1 | |
} | |
, | |
je.prototype.serialize = function() { | |
return ["var", this.name] | |
} | |
; | |
var Ne = function(t, e, r, i, n) { | |
void 0 === e && (e = []), | |
void 0 === i && (i = new Rt), | |
void 0 === n && (n = []), | |
this.registry = t, | |
this.path = e, | |
this.key = e.map((function(t) { | |
return "[" + t + "]" | |
} | |
)).join(""), | |
this.scope = i, | |
this.errors = n, | |
this.expectedType = r | |
}; | |
function qe(t, e) { | |
for (var r, i = t.length - 1, n = 0, o = i, a = 0; n <= o; ) | |
if ((r = t[a = Math.floor((n + o) / 2)]) <= e) { | |
if (a === i || e < t[a + 1]) | |
return a; | |
n = a + 1 | |
} else { | |
if (!(r > e)) | |
throw new pe("Input is not a number."); | |
o = a - 1 | |
} | |
return 0 | |
} | |
Ne.prototype.parse = function(t, e, r, i, n) { | |
return void 0 === n && (n = {}), | |
e ? this.concat(e, r, i)._parse(t, n) : this._parse(t, n) | |
} | |
, | |
Ne.prototype._parse = function(t, e) { | |
function r(t, e, r) { | |
return "assert" === r ? new fe(e,[t]) : "coerce" === r ? new ge(e,[t]) : t | |
} | |
if (null !== t && "string" != typeof t && "boolean" != typeof t && "number" != typeof t || (t = ["literal", t]), | |
Array.isArray(t)) { | |
if (0 === t.length) | |
return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].'); | |
var i = t[0]; | |
if ("string" != typeof i) | |
return this.error("Expression name must be a string, but found " + typeof i + ' instead. If you wanted a literal array, use ["literal", [...]].', 0), | |
null; | |
var n = this.registry[i]; | |
if (n) { | |
var o = n.parse(t, this); | |
if (!o) | |
return null; | |
if (this.expectedType) { | |
var a = this.expectedType | |
, s = o.type; | |
if ("string" !== a.kind && "number" !== a.kind && "boolean" !== a.kind && "object" !== a.kind && "array" !== a.kind || "value" !== s.kind) | |
if ("color" !== a.kind && "formatted" !== a.kind && "resolvedImage" !== a.kind || "value" !== s.kind && "string" !== s.kind) { | |
if (this.checkSubtype(a, s)) | |
return null | |
} else | |
o = r(o, a, e.typeAnnotation || "coerce"); | |
else | |
o = r(o, a, e.typeAnnotation || "assert") | |
} | |
if (!(o instanceof ce) && "resolvedImage" !== o.type.kind && function t(e) { | |
if (e instanceof je) | |
return t(e.boundExpression); | |
if (e instanceof xe && "error" === e.name) | |
return !1; | |
if (e instanceof be) | |
return !1; | |
if (e instanceof Re) | |
return !1; | |
var r = e instanceof ge || e instanceof fe | |
, i = !0; | |
return e.eachChild((function(e) { | |
i = r ? i && t(e) : i && e instanceof ce | |
} | |
)), | |
!!i && Oe(e) && Ve(e, ["zoom", "heatmap-density", "line-progress", "accumulated", "is-supported-script"]) | |
}(o)) { | |
var l = new _e; | |
try { | |
o = new ce(o.type,o.evaluate(l)) | |
} catch (t) { | |
return this.error(t.message), | |
null | |
} | |
} | |
return o | |
} | |
return this.error('Unknown expression "' + i + '". If you wanted a literal array, use ["literal", [...]].', 0) | |
} | |
return this.error(void 0 === t ? "'undefined' value invalid. Use null instead." : "object" == typeof t ? 'Bare objects invalid. Use ["literal", {...}] instead.' : "Expected an array, but found " + typeof t + " instead.") | |
} | |
, | |
Ne.prototype.concat = function(t, e, r) { | |
var i = "number" == typeof t ? this.path.concat(t) : this.path | |
, n = r ? this.scope.concat(r) : this.scope; | |
return new Ne(this.registry,i,e || null,n,this.errors) | |
} | |
, | |
Ne.prototype.error = function(t) { | |
for (var e = [], r = arguments.length - 1; r-- > 0; ) | |
e[r] = arguments[r + 1]; | |
var i = "" + this.key + e.map((function(t) { | |
return "[" + t + "]" | |
} | |
)).join(""); | |
this.errors.push(new Lt(i,t)) | |
} | |
, | |
Ne.prototype.checkSubtype = function(t, e) { | |
var r = Yt(t, e); | |
return r && this.error(r), | |
r | |
} | |
; | |
var Ge = function(t, e, r) { | |
this.type = t, | |
this.input = e, | |
this.labels = [], | |
this.outputs = []; | |
for (var i = 0, n = r; i < n.length; i += 1) { | |
var o = n[i] | |
, a = o[1]; | |
this.labels.push(o[0]), | |
this.outputs.push(a) | |
} | |
}; | |
function Ze(t, e, r) { | |
return t * (1 - r) + e * r | |
} | |
Ge.parse = function(t, e) { | |
if (t.length - 1 < 4) | |
return e.error("Expected at least 4 arguments, but found only " + (t.length - 1) + "."); | |
if ((t.length - 1) % 2 != 0) | |
return e.error("Expected an even number of arguments."); | |
var r = e.parse(t[1], 1, Ut); | |
if (!r) | |
return null; | |
var i = [] | |
, n = null; | |
e.expectedType && "value" !== e.expectedType.kind && (n = e.expectedType); | |
for (var o = 1; o < t.length; o += 2) { | |
var a = 1 === o ? -1 / 0 : t[o] | |
, s = t[o + 1] | |
, l = o | |
, u = o + 1; | |
if ("number" != typeof a) | |
return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.', l); | |
if (i.length && i[i.length - 1][0] >= a) | |
return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.', l); | |
var c = e.parse(s, u, n); | |
if (!c) | |
return null; | |
n = n || c.type, | |
i.push([a, c]) | |
} | |
return new Ge(n,r,i) | |
} | |
, | |
Ge.prototype.evaluate = function(t) { | |
var e = this.labels | |
, r = this.outputs; | |
if (1 === e.length) | |
return r[0].evaluate(t); | |
var i = this.input.evaluate(t); | |
if (i <= e[0]) | |
return r[0].evaluate(t); | |
var n = e.length; | |
return i >= e[n - 1] ? r[n - 1].evaluate(t) : r[qe(e, i)].evaluate(t) | |
} | |
, | |
Ge.prototype.eachChild = function(t) { | |
t(this.input); | |
for (var e = 0, r = this.outputs; e < r.length; e += 1) | |
t(r[e]) | |
} | |
, | |
Ge.prototype.outputDefined = function() { | |
return this.outputs.every((function(t) { | |
return t.outputDefined() | |
} | |
)) | |
} | |
, | |
Ge.prototype.serialize = function() { | |
for (var t = ["step", this.input.serialize()], e = 0; e < this.labels.length; e++) | |
e > 0 && t.push(this.labels[e]), | |
t.push(this.outputs[e].serialize()); | |
return t | |
} | |
; | |
var Xe = Object.freeze({ | |
__proto__: null, | |
number: Ze, | |
color: function(t, e, r) { | |
return new ee(Ze(t.r, e.r, r),Ze(t.g, e.g, r),Ze(t.b, e.b, r),Ze(t.a, e.a, r)) | |
}, | |
array: function(t, e, r) { | |
return t.map((function(t, i) { | |
return Ze(t, e[i], r) | |
} | |
)) | |
} | |
}) | |
, We = 6 / 29 * 3 * (6 / 29) | |
, He = Math.PI / 180 | |
, Ke = 180 / Math.PI; | |
function Je(t) { | |
return t > .008856451679035631 ? Math.pow(t, 1 / 3) : t / We + 4 / 29 | |
} | |
function Ye(t) { | |
return t > 6 / 29 ? t * t * t : We * (t - 4 / 29) | |
} | |
function $e(t) { | |
return 255 * (t <= .0031308 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - .055) | |
} | |
function Qe(t) { | |
return (t /= 255) <= .04045 ? t / 12.92 : Math.pow((t + .055) / 1.055, 2.4) | |
} | |
function tr(t) { | |
var e = Qe(t.r) | |
, r = Qe(t.g) | |
, i = Qe(t.b) | |
, n = Je((.4124564 * e + .3575761 * r + .1804375 * i) / .95047) | |
, o = Je((.2126729 * e + .7151522 * r + .072175 * i) / 1); | |
return { | |
l: 116 * o - 16, | |
a: 500 * (n - o), | |
b: 200 * (o - Je((.0193339 * e + .119192 * r + .9503041 * i) / 1.08883)), | |
alpha: t.a | |
} | |
} | |
function er(t) { | |
var e = (t.l + 16) / 116 | |
, r = isNaN(t.a) ? e : e + t.a / 500 | |
, i = isNaN(t.b) ? e : e - t.b / 200; | |
return e = 1 * Ye(e), | |
r = .95047 * Ye(r), | |
i = 1.08883 * Ye(i), | |
new ee($e(3.2404542 * r - 1.5371385 * e - .4985314 * i),$e(-.969266 * r + 1.8760108 * e + .041556 * i),$e(.0556434 * r - .2040259 * e + 1.0572252 * i),t.alpha) | |
} | |
function rr(t, e, r) { | |
var i = e - t; | |
return t + r * (i > 180 || i < -180 ? i - 360 * Math.round(i / 360) : i) | |
} | |
var ir = { | |
forward: tr, | |
reverse: er, | |
interpolate: function(t, e, r) { | |
return { | |
l: Ze(t.l, e.l, r), | |
a: Ze(t.a, e.a, r), | |
b: Ze(t.b, e.b, r), | |
alpha: Ze(t.alpha, e.alpha, r) | |
} | |
} | |
} | |
, nr = { | |
forward: function(t) { | |
var e = tr(t) | |
, r = e.l | |
, i = e.a | |
, n = e.b | |
, o = Math.atan2(n, i) * Ke; | |
return { | |
h: o < 0 ? o + 360 : o, | |
c: Math.sqrt(i * i + n * n), | |
l: r, | |
alpha: t.a | |
} | |
}, | |
reverse: function(t) { | |
var e = t.h * He | |
, r = t.c; | |
return er({ | |
l: t.l, | |
a: Math.cos(e) * r, | |
b: Math.sin(e) * r, | |
alpha: t.alpha | |
}) | |
}, | |
interpolate: function(t, e, r) { | |
return { | |
h: rr(t.h, e.h, r), | |
c: Ze(t.c, e.c, r), | |
l: Ze(t.l, e.l, r), | |
alpha: Ze(t.alpha, e.alpha, r) | |
} | |
} | |
} | |
, or = Object.freeze({ | |
__proto__: null, | |
lab: ir, | |
hcl: nr | |
}) | |
, ar = function(t, e, r, i, n) { | |
this.type = t, | |
this.operator = e, | |
this.interpolation = r, | |
this.input = i, | |
this.labels = [], | |
this.outputs = []; | |
for (var o = 0, a = n; o < a.length; o += 1) { | |
var s = a[o] | |
, l = s[1]; | |
this.labels.push(s[0]), | |
this.outputs.push(l) | |
} | |
}; | |
function sr(t, e, r, i) { | |
var n = i - r | |
, o = t - r; | |
return 0 === n ? 0 : 1 === e ? o / n : (Math.pow(e, o) - 1) / (Math.pow(e, n) - 1) | |
} | |
ar.interpolationFactor = function(t, e, i, n) { | |
var o = 0; | |
if ("exponential" === t.name) | |
o = sr(e, t.base, i, n); | |
else if ("linear" === t.name) | |
o = sr(e, 1, i, n); | |
else if ("cubic-bezier" === t.name) { | |
var a = t.controlPoints; | |
o = new r(a[0],a[1],a[2],a[3]).solve(sr(e, 1, i, n)) | |
} | |
return o | |
} | |
, | |
ar.parse = function(t, e) { | |
var r = t[0] | |
, i = t[1] | |
, n = t[2] | |
, o = t.slice(3); | |
if (!Array.isArray(i) || 0 === i.length) | |
return e.error("Expected an interpolation type expression.", 1); | |
if ("linear" === i[0]) | |
i = { | |
name: "linear" | |
}; | |
else if ("exponential" === i[0]) { | |
var a = i[1]; | |
if ("number" != typeof a) | |
return e.error("Exponential interpolation requires a numeric base.", 1, 1); | |
i = { | |
name: "exponential", | |
base: a | |
} | |
} else { | |
if ("cubic-bezier" !== i[0]) | |
return e.error("Unknown interpolation type " + String(i[0]), 1, 0); | |
var s = i.slice(1); | |
if (4 !== s.length || s.some((function(t) { | |
return "number" != typeof t || t < 0 || t > 1 | |
} | |
))) | |
return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.", 1); | |
i = { | |
name: "cubic-bezier", | |
controlPoints: s | |
} | |
} | |
if (t.length - 1 < 4) | |
return e.error("Expected at least 4 arguments, but found only " + (t.length - 1) + "."); | |
if ((t.length - 1) % 2 != 0) | |
return e.error("Expected an even number of arguments."); | |
if (!(n = e.parse(n, 2, Ut))) | |
return null; | |
var l = [] | |
, u = null; | |
"interpolate-hcl" === r || "interpolate-lab" === r ? u = Nt : e.expectedType && "value" !== e.expectedType.kind && (u = e.expectedType); | |
for (var c = 0; c < o.length; c += 2) { | |
var p = o[c] | |
, h = o[c + 1] | |
, f = c + 3 | |
, d = c + 4; | |
if ("number" != typeof p) | |
return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.', f); | |
if (l.length && l[l.length - 1][0] >= p) | |
return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.', f); | |
var m = e.parse(h, d, u); | |
if (!m) | |
return null; | |
u = u || m.type, | |
l.push([p, m]) | |
} | |
return "number" === u.kind || "color" === u.kind || "array" === u.kind && "number" === u.itemType.kind && "number" == typeof u.N ? new ar(u,r,i,n,l) : e.error("Type " + Kt(u) + " is not interpolatable.") | |
} | |
, | |
ar.prototype.evaluate = function(t) { | |
var e = this.labels | |
, r = this.outputs; | |
if (1 === e.length) | |
return r[0].evaluate(t); | |
var i = this.input.evaluate(t); | |
if (i <= e[0]) | |
return r[0].evaluate(t); | |
var n = e.length; | |
if (i >= e[n - 1]) | |
return r[n - 1].evaluate(t); | |
var o = qe(e, i) | |
, a = ar.interpolationFactor(this.interpolation, i, e[o], e[o + 1]) | |
, s = r[o].evaluate(t) | |
, l = r[o + 1].evaluate(t); | |
return "interpolate" === this.operator ? Xe[this.type.kind.toLowerCase()](s, l, a) : "interpolate-hcl" === this.operator ? nr.reverse(nr.interpolate(nr.forward(s), nr.forward(l), a)) : ir.reverse(ir.interpolate(ir.forward(s), ir.forward(l), a)) | |
} | |
, | |
ar.prototype.eachChild = function(t) { | |
t(this.input); | |
for (var e = 0, r = this.outputs; e < r.length; e += 1) | |
t(r[e]) | |
} | |
, | |
ar.prototype.outputDefined = function() { | |
return this.outputs.every((function(t) { | |
return t.outputDefined() | |
} | |
)) | |
} | |
, | |
ar.prototype.serialize = function() { | |
var t; | |
t = "linear" === this.interpolation.name ? ["linear"] : "exponential" === this.interpolation.name ? 1 === this.interpolation.base ? ["linear"] : ["exponential", this.interpolation.base] : ["cubic-bezier"].concat(this.interpolation.controlPoints); | |
for (var e = [this.operator, t, this.input.serialize()], r = 0; r < this.labels.length; r++) | |
e.push(this.labels[r], this.outputs[r].serialize()); | |
return e | |
} | |
; | |
var lr = function(t, e) { | |
this.type = t, | |
this.args = e | |
}; | |
lr.parse = function(t, e) { | |
if (t.length < 2) | |
return e.error("Expectected at least one argument."); | |
var r = null | |
, i = e.expectedType; | |
i && "value" !== i.kind && (r = i); | |
for (var n = [], o = 0, a = t.slice(1); o < a.length; o += 1) { | |
var s = e.parse(a[o], 1 + n.length, r, void 0, { | |
typeAnnotation: "omit" | |
}); | |
if (!s) | |
return null; | |
r = r || s.type, | |
n.push(s) | |
} | |
var l = i && n.some((function(t) { | |
return Yt(i, t.type) | |
} | |
)); | |
return new lr(l ? Gt : r,n) | |
} | |
, | |
lr.prototype.evaluate = function(t) { | |
for (var e, r = null, i = 0, n = 0, o = this.args; n < o.length && (i++, | |
(r = o[n].evaluate(t)) && r instanceof oe && !r.available && (e || (e = r.name), | |
r = null, | |
i === this.args.length && (r = e)), | |
null === r); n += 1) | |
; | |
return r | |
} | |
, | |
lr.prototype.eachChild = function(t) { | |
this.args.forEach(t) | |
} | |
, | |
lr.prototype.outputDefined = function() { | |
return this.args.every((function(t) { | |
return t.outputDefined() | |
} | |
)) | |
} | |
, | |
lr.prototype.serialize = function() { | |
var t = ["coalesce"]; | |
return this.eachChild((function(e) { | |
t.push(e.serialize()) | |
} | |
)), | |
t | |
} | |
; | |
var ur = function(t, e) { | |
this.type = e.type, | |
this.bindings = [].concat(t), | |
this.result = e | |
}; | |
ur.prototype.evaluate = function(t) { | |
return this.result.evaluate(t) | |
} | |
, | |
ur.prototype.eachChild = function(t) { | |
for (var e = 0, r = this.bindings; e < r.length; e += 1) | |
t(r[e][1]); | |
t(this.result) | |
} | |
, | |
ur.parse = function(t, e) { | |
if (t.length < 4) | |
return e.error("Expected at least 3 arguments, but found " + (t.length - 1) + " instead."); | |
for (var r = [], i = 1; i < t.length - 1; i += 2) { | |
var n = t[i]; | |
if ("string" != typeof n) | |
return e.error("Expected string, but found " + typeof n + " instead.", i); | |
if (/[^a-zA-Z0-9_]/.test(n)) | |
return e.error("Variable names must contain only alphanumeric characters or '_'.", i); | |
var o = e.parse(t[i + 1], i + 1); | |
if (!o) | |
return null; | |
r.push([n, o]) | |
} | |
var a = e.parse(t[t.length - 1], t.length - 1, e.expectedType, r); | |
return a ? new ur(r,a) : null | |
} | |
, | |
ur.prototype.outputDefined = function() { | |
return this.result.outputDefined() | |
} | |
, | |
ur.prototype.serialize = function() { | |
for (var t = ["let"], e = 0, r = this.bindings; e < r.length; e += 1) { | |
var i = r[e]; | |
t.push(i[0], i[1].serialize()) | |
} | |
return t.push(this.result.serialize()), | |
t | |
} | |
; | |
var cr = function(t, e, r) { | |
this.type = t, | |
this.index = e, | |
this.input = r | |
}; | |
cr.parse = function(t, e) { | |
if (3 !== t.length) | |
return e.error("Expected 2 arguments, but found " + (t.length - 1) + " instead."); | |
var r = e.parse(t[1], 1, Ut) | |
, i = e.parse(t[2], 2, Ht(e.expectedType || Gt)); | |
return r && i ? new cr(i.type.itemType,r,i) : null | |
} | |
, | |
cr.prototype.evaluate = function(t) { | |
var e = this.index.evaluate(t) | |
, r = this.input.evaluate(t); | |
if (e < 0) | |
throw new pe("Array index out of bounds: " + e + " < 0."); | |
if (e >= r.length) | |
throw new pe("Array index out of bounds: " + e + " > " + (r.length - 1) + "."); | |
if (e !== Math.floor(e)) | |
throw new pe("Array index must be an integer, but found " + e + " instead."); | |
return r[e] | |
} | |
, | |
cr.prototype.eachChild = function(t) { | |
t(this.index), | |
t(this.input) | |
} | |
, | |
cr.prototype.outputDefined = function() { | |
return !1 | |
} | |
, | |
cr.prototype.serialize = function() { | |
return ["at", this.index.serialize(), this.input.serialize()] | |
} | |
; | |
var pr = function(t, e) { | |
this.type = jt, | |
this.needle = t, | |
this.haystack = e | |
}; | |
pr.parse = function(t, e) { | |
if (3 !== t.length) | |
return e.error("Expected 2 arguments, but found " + (t.length - 1) + " instead."); | |
var r = e.parse(t[1], 1, Gt) | |
, i = e.parse(t[2], 2, Gt); | |
return r && i ? $t(r.type, [jt, Vt, Ut, Ot, Gt]) ? new pr(r,i) : e.error("Expected first argument to be of type boolean, string, number or null, but found " + Kt(r.type) + " instead") : null | |
} | |
, | |
pr.prototype.evaluate = function(t) { | |
var e = this.needle.evaluate(t) | |
, r = this.haystack.evaluate(t); | |
if (!r) | |
return !1; | |
if (!Qt(e, ["boolean", "string", "number", "null"])) | |
throw new pe("Expected first argument to be of type boolean, string, number or null, but found " + Kt(le(e)) + " instead."); | |
if (!Qt(r, ["string", "array"])) | |
throw new pe("Expected second argument to be of type array or string, but found " + Kt(le(r)) + " instead."); | |
return r.indexOf(e) >= 0 | |
} | |
, | |
pr.prototype.eachChild = function(t) { | |
t(this.needle), | |
t(this.haystack) | |
} | |
, | |
pr.prototype.outputDefined = function() { | |
return !0 | |
} | |
, | |
pr.prototype.serialize = function() { | |
return ["in", this.needle.serialize(), this.haystack.serialize()] | |
} | |
; | |
var hr = function(t, e, r) { | |
this.type = Ut, | |
this.needle = t, | |
this.haystack = e, | |
this.fromIndex = r | |
}; | |
hr.parse = function(t, e) { | |
if (t.length <= 2 || t.length >= 5) | |
return e.error("Expected 3 or 4 arguments, but found " + (t.length - 1) + " instead."); | |
var r = e.parse(t[1], 1, Gt) | |
, i = e.parse(t[2], 2, Gt); | |
if (!r || !i) | |
return null; | |
if (!$t(r.type, [jt, Vt, Ut, Ot, Gt])) | |
return e.error("Expected first argument to be of type boolean, string, number or null, but found " + Kt(r.type) + " instead"); | |
if (4 === t.length) { | |
var n = e.parse(t[3], 3, Ut); | |
return n ? new hr(r,i,n) : null | |
} | |
return new hr(r,i) | |
} | |
, | |
hr.prototype.evaluate = function(t) { | |
var e = this.needle.evaluate(t) | |
, r = this.haystack.evaluate(t); | |
if (!Qt(e, ["boolean", "string", "number", "null"])) | |
throw new pe("Expected first argument to be of type boolean, string, number or null, but found " + Kt(le(e)) + " instead."); | |
if (!Qt(r, ["string", "array"])) | |
throw new pe("Expected second argument to be of type array or string, but found " + Kt(le(r)) + " instead."); | |
if (this.fromIndex) { | |
var i = this.fromIndex.evaluate(t); | |
return r.indexOf(e, i) | |
} | |
return r.indexOf(e) | |
} | |
, | |
hr.prototype.eachChild = function(t) { | |
t(this.needle), | |
t(this.haystack), | |
this.fromIndex && t(this.fromIndex) | |
} | |
, | |
hr.prototype.outputDefined = function() { | |
return !1 | |
} | |
, | |
hr.prototype.serialize = function() { | |
if (null != this.fromIndex && void 0 !== this.fromIndex) { | |
var t = this.fromIndex.serialize(); | |
return ["index-of", this.needle.serialize(), this.haystack.serialize(), t] | |
} | |
return ["index-of", this.needle.serialize(), this.haystack.serialize()] | |
} | |
; | |
var fr = function(t, e, r, i, n, o) { | |
this.inputType = t, | |
this.type = e, | |
this.input = r, | |
this.cases = i, | |
this.outputs = n, | |
this.otherwise = o | |
}; | |
fr.parse = function(t, e) { | |
if (t.length < 5) | |
return e.error("Expected at least 4 arguments, but found only " + (t.length - 1) + "."); | |
if (t.length % 2 != 1) | |
return e.error("Expected an even number of arguments."); | |
var r, i; | |
e.expectedType && "value" !== e.expectedType.kind && (i = e.expectedType); | |
for (var n = {}, o = [], a = 2; a < t.length - 1; a += 2) { | |
var s = t[a] | |
, l = t[a + 1]; | |
Array.isArray(s) || (s = [s]); | |
var u = e.concat(a); | |
if (0 === s.length) | |
return u.error("Expected at least one branch label."); | |
for (var c = 0, p = s; c < p.length; c += 1) { | |
var h = p[c]; | |
if ("number" != typeof h && "string" != typeof h) | |
return u.error("Branch labels must be numbers or strings."); | |
if ("number" == typeof h && Math.abs(h) > Number.MAX_SAFE_INTEGER) | |
return u.error("Branch labels must be integers no larger than " + Number.MAX_SAFE_INTEGER + "."); | |
if ("number" == typeof h && Math.floor(h) !== h) | |
return u.error("Numeric branch labels must be integer values."); | |
if (r) { | |
if (u.checkSubtype(r, le(h))) | |
return null | |
} else | |
r = le(h); | |
if (void 0 !== n[String(h)]) | |
return u.error("Branch labels must be unique."); | |
n[String(h)] = o.length | |
} | |
var f = e.parse(l, a, i); | |
if (!f) | |
return null; | |
i = i || f.type, | |
o.push(f) | |
} | |
var d = e.parse(t[1], 1, Gt); | |
if (!d) | |
return null; | |
var m = e.parse(t[t.length - 1], t.length - 1, i); | |
return m ? "value" !== d.type.kind && e.concat(1).checkSubtype(r, d.type) ? null : new fr(r,i,d,n,o,m) : null | |
} | |
, | |
fr.prototype.evaluate = function(t) { | |
var e = this.input.evaluate(t); | |
return (le(e) === this.inputType && this.outputs[this.cases[e]] || this.otherwise).evaluate(t) | |
} | |
, | |
fr.prototype.eachChild = function(t) { | |
t(this.input), | |
this.outputs.forEach(t), | |
t(this.otherwise) | |
} | |
, | |
fr.prototype.outputDefined = function() { | |
return this.outputs.every((function(t) { | |
return t.outputDefined() | |
} | |
)) && this.otherwise.outputDefined() | |
} | |
, | |
fr.prototype.serialize = function() { | |
for (var t = this, e = ["match", this.input.serialize()], r = [], i = {}, n = 0, o = Object.keys(this.cases).sort(); n < o.length; n += 1) { | |
var a = o[n]; | |
void 0 === (p = i[this.cases[a]]) ? (i[this.cases[a]] = r.length, | |
r.push([this.cases[a], [a]])) : r[p][1].push(a) | |
} | |
for (var s = function(e) { | |
return "number" === t.inputType.kind ? Number(e) : e | |
}, l = 0, u = r; l < u.length; l += 1) { | |
var c = u[l] | |
, p = c[0] | |
, h = c[1]; | |
e.push(1 === h.length ? s(h[0]) : h.map(s)), | |
e.push(this.outputs[outputIndex$1].serialize()) | |
} | |
return e.push(this.otherwise.serialize()), | |
e | |
} | |
; | |
var dr = function(t, e, r) { | |
this.type = t, | |
this.branches = e, | |
this.otherwise = r | |
}; | |
dr.parse = function(t, e) { | |
if (t.length < 4) | |
return e.error("Expected at least 3 arguments, but found only " + (t.length - 1) + "."); | |
if (t.length % 2 != 0) | |
return e.error("Expected an odd number of arguments."); | |
var r; | |
e.expectedType && "value" !== e.expectedType.kind && (r = e.expectedType); | |
for (var i = [], n = 1; n < t.length - 1; n += 2) { | |
var o = e.parse(t[n], n, jt); | |
if (!o) | |
return null; | |
var a = e.parse(t[n + 1], n + 1, r); | |
if (!a) | |
return null; | |
i.push([o, a]), | |
r = r || a.type | |
} | |
var s = e.parse(t[t.length - 1], t.length - 1, r); | |
return s ? new dr(r,i,s) : null | |
} | |
, | |
dr.prototype.evaluate = function(t) { | |
for (var e = 0, r = this.branches; e < r.length; e += 1) { | |
var i = r[e] | |
, n = i[1]; | |
if (i[0].evaluate(t)) | |
return n.evaluate(t) | |
} | |
return this.otherwise.evaluate(t) | |
} | |
, | |
dr.prototype.eachChild = function(t) { | |
for (var e = 0, r = this.branches; e < r.length; e += 1) { | |
var i = r[e] | |
, n = i[1]; | |
t(i[0]), | |
t(n) | |
} | |
t(this.otherwise) | |
} | |
, | |
dr.prototype.outputDefined = function() { | |
return this.branches.every((function(t) { | |
return t[1].outputDefined() | |
} | |
)) && this.otherwise.outputDefined() | |
} | |
, | |
dr.prototype.serialize = function() { | |
var t = ["case"]; | |
return this.eachChild((function(e) { | |
t.push(e.serialize()) | |
} | |
)), | |
t | |
} | |
; | |
var mr = function(t, e, r, i) { | |
this.type = t, | |
this.input = e, | |
this.beginIndex = r, | |
this.endIndex = i | |
}; | |
function yr(t, e) { | |
return "==" === t || "!=" === t ? "boolean" === e.kind || "string" === e.kind || "number" === e.kind || "null" === e.kind || "value" === e.kind : "string" === e.kind || "number" === e.kind || "value" === e.kind | |
} | |
function gr(t, e, r, i) { | |
return 0 === i.compare(e, r) | |
} | |
function vr(t, e, r) { | |
var i = "==" !== t && "!=" !== t; | |
return function() { | |
function n(t, e, r) { | |
this.type = jt, | |
this.lhs = t, | |
this.rhs = e, | |
this.collator = r, | |
this.hasUntypedArgument = "value" === t.type.kind || "value" === e.type.kind | |
} | |
return n.parse = function(t, e) { | |
if (3 !== t.length && 4 !== t.length) | |
return e.error("Expected two or three arguments."); | |
var r = t[0] | |
, o = e.parse(t[1], 1, Gt); | |
if (!o) | |
return null; | |
if (!yr(r, o.type)) | |
return e.concat(1).error('"' + r + "\" comparisons are not supported for type '" + Kt(o.type) + "'."); | |
var a = e.parse(t[2], 2, Gt); | |
if (!a) | |
return null; | |
if (!yr(r, a.type)) | |
return e.concat(2).error('"' + r + "\" comparisons are not supported for type '" + Kt(a.type) + "'."); | |
if (o.type.kind !== a.type.kind && "value" !== o.type.kind && "value" !== a.type.kind) | |
return e.error("Cannot compare types '" + Kt(o.type) + "' and '" + Kt(a.type) + "'."); | |
i && ("value" === o.type.kind && "value" !== a.type.kind ? o = new fe(a.type,[o]) : "value" !== o.type.kind && "value" === a.type.kind && (a = new fe(o.type,[a]))); | |
var s = null; | |
if (4 === t.length) { | |
if ("string" !== o.type.kind && "string" !== a.type.kind && "value" !== o.type.kind && "value" !== a.type.kind) | |
return e.error("Cannot use collator to compare non-string types."); | |
if (!(s = e.parse(t[3], 3, Zt))) | |
return null | |
} | |
return new n(o,a,s) | |
} | |
, | |
n.prototype.evaluate = function(n) { | |
var o = this.lhs.evaluate(n) | |
, a = this.rhs.evaluate(n); | |
if (i && this.hasUntypedArgument) { | |
var s = le(o) | |
, l = le(a); | |
if (s.kind !== l.kind || "string" !== s.kind && "number" !== s.kind) | |
throw new pe('Expected arguments for "' + t + '" to be (string, string) or (number, number), but found (' + s.kind + ", " + l.kind + ") instead.") | |
} | |
if (this.collator && !i && this.hasUntypedArgument) { | |
var u = le(o) | |
, c = le(a); | |
if ("string" !== u.kind || "string" !== c.kind) | |
return e(n, o, a) | |
} | |
return this.collator ? r(n, o, a, this.collator.evaluate(n)) : e(n, o, a) | |
} | |
, | |
n.prototype.eachChild = function(t) { | |
t(this.lhs), | |
t(this.rhs), | |
this.collator && t(this.collator) | |
} | |
, | |
n.prototype.outputDefined = function() { | |
return !0 | |
} | |
, | |
n.prototype.serialize = function() { | |
var e = [t]; | |
return this.eachChild((function(t) { | |
e.push(t.serialize()) | |
} | |
)), | |
e | |
} | |
, | |
n | |
}() | |
} | |
mr.parse = function(t, e) { | |
if (t.length <= 2 || t.length >= 5) | |
return e.error("Expected 3 or 4 arguments, but found " + (t.length - 1) + " instead."); | |
var r = e.parse(t[1], 1, Gt) | |
, i = e.parse(t[2], 2, Ut); | |
if (!r || !i) | |
return null; | |
if (!$t(r.type, [Ht(Gt), Vt, Gt])) | |
return e.error("Expected first argument to be of type array or string, but found " + Kt(r.type) + " instead"); | |
if (4 === t.length) { | |
var n = e.parse(t[3], 3, Ut); | |
return n ? new mr(r.type,r,i,n) : null | |
} | |
return new mr(r.type,r,i) | |
} | |
, | |
mr.prototype.evaluate = function(t) { | |
var e = this.input.evaluate(t) | |
, r = this.beginIndex.evaluate(t); | |
if (!Qt(e, ["string", "array"])) | |
throw new pe("Expected first argument to be of type array or string, but found " + Kt(le(e)) + " instead."); | |
if (this.endIndex) { | |
var i = this.endIndex.evaluate(t); | |
return e.slice(r, i) | |
} | |
return e.slice(r) | |
} | |
, | |
mr.prototype.eachChild = function(t) { | |
t(this.input), | |
t(this.beginIndex), | |
this.endIndex && t(this.endIndex) | |
} | |
, | |
mr.prototype.outputDefined = function() { | |
return !1 | |
} | |
, | |
mr.prototype.serialize = function() { | |
if (null != this.endIndex && void 0 !== this.endIndex) { | |
var t = this.endIndex.serialize(); | |
return ["slice", this.input.serialize(), this.beginIndex.serialize(), t] | |
} | |
return ["slice", this.input.serialize(), this.beginIndex.serialize()] | |
} | |
; | |
var _r = vr("==", (function(t, e, r) { | |
return e === r | |
} | |
), gr) | |
, xr = vr("!=", (function(t, e, r) { | |
return e !== r | |
} | |
), (function(t, e, r, i) { | |
return !gr(0, e, r, i) | |
} | |
)) | |
, br = vr("<", (function(t, e, r) { | |
return e < r | |
} | |
), (function(t, e, r, i) { | |
return i.compare(e, r) < 0 | |
} | |
)) | |
, wr = vr(">", (function(t, e, r) { | |
return e > r | |
} | |
), (function(t, e, r, i) { | |
return i.compare(e, r) > 0 | |
} | |
)) | |
, Er = vr("<=", (function(t, e, r) { | |
return e <= r | |
} | |
), (function(t, e, r, i) { | |
return i.compare(e, r) <= 0 | |
} | |
)) | |
, Cr = vr(">=", (function(t, e, r) { | |
return e >= r | |
} | |
), (function(t, e, r, i) { | |
return i.compare(e, r) >= 0 | |
} | |
)) | |
, Ar = function(t, e, r, i, n) { | |
this.type = Vt, | |
this.number = t, | |
this.locale = e, | |
this.currency = r, | |
this.minFractionDigits = i, | |
this.maxFractionDigits = n | |
}; | |
Ar.parse = function(t, e) { | |
if (3 !== t.length) | |
return e.error("Expected two arguments."); | |
var r = e.parse(t[1], 1, Ut); | |
if (!r) | |
return null; | |
var i = t[2]; | |
if ("object" != typeof i || Array.isArray(i)) | |
return e.error("NumberFormat options argument must be an object."); | |
var n = null; | |
if (i.locale && !(n = e.parse(i.locale, 1, Vt))) | |
return null; | |
var o = null; | |
if (i.currency && !(o = e.parse(i.currency, 1, Vt))) | |
return null; | |
var a = null; | |
if (i["min-fraction-digits"] && !(a = e.parse(i["min-fraction-digits"], 1, Ut))) | |
return null; | |
var s = null; | |
return i["max-fraction-digits"] && !(s = e.parse(i["max-fraction-digits"], 1, Ut)) ? null : new Ar(r,n,o,a,s) | |
} | |
, | |
Ar.prototype.evaluate = function(t) { | |
return new Intl.NumberFormat(this.locale ? this.locale.evaluate(t) : [],{ | |
style: this.currency ? "currency" : "decimal", | |
currency: this.currency ? this.currency.evaluate(t) : void 0, | |
minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(t) : void 0, | |
maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(t) : void 0 | |
}).format(this.number.evaluate(t)) | |
} | |
, | |
Ar.prototype.eachChild = function(t) { | |
t(this.number), | |
this.locale && t(this.locale), | |
this.currency && t(this.currency), | |
this.minFractionDigits && t(this.minFractionDigits), | |
this.maxFractionDigits && t(this.maxFractionDigits) | |
} | |
, | |
Ar.prototype.outputDefined = function() { | |
return !1 | |
} | |
, | |
Ar.prototype.serialize = function() { | |
var t = {}; | |
return this.locale && (t.locale = this.locale.serialize()), | |
this.currency && (t.currency = this.currency.serialize()), | |
this.minFractionDigits && (t["min-fraction-digits"] = this.minFractionDigits.serialize()), | |
this.maxFractionDigits && (t["max-fraction-digits"] = this.maxFractionDigits.serialize()), | |
["number-format", this.number.serialize(), t] | |
} | |
; | |
var zr = function(t) { | |
this.type = Ut, | |
this.input = t | |
}; | |
zr.parse = function(t, e) { | |
if (2 !== t.length) | |
return e.error("Expected 1 argument, but found " + (t.length - 1) + " instead."); | |
var r = e.parse(t[1], 1); | |
return r ? "array" !== r.type.kind && "string" !== r.type.kind && "value" !== r.type.kind ? e.error("Expected argument of type string or array, but found " + Kt(r.type) + " instead.") : new zr(r) : null | |
} | |
, | |
zr.prototype.evaluate = function(t) { | |
var e = this.input.evaluate(t); | |
if ("string" == typeof e) | |
return e.length; | |
if (Array.isArray(e)) | |
return e.length; | |
throw new pe("Expected value to be of type string or array, but found " + Kt(le(e)) + " instead.") | |
} | |
, | |
zr.prototype.eachChild = function(t) { | |
t(this.input) | |
} | |
, | |
zr.prototype.outputDefined = function() { | |
return !1 | |
} | |
, | |
zr.prototype.serialize = function() { | |
var t = ["length"]; | |
return this.eachChild((function(e) { | |
t.push(e.serialize()) | |
} | |
)), | |
t | |
} | |
; | |
var Sr = { | |
"==": _r, | |
"!=": xr, | |
">": wr, | |
"<": br, | |
">=": Cr, | |
"<=": Er, | |
array: fe, | |
at: cr, | |
boolean: fe, | |
case: dr, | |
coalesce: lr, | |
collator: be, | |
format: de, | |
image: me, | |
in: pr, | |
"index-of": hr, | |
interpolate: ar, | |
"interpolate-hcl": ar, | |
"interpolate-lab": ar, | |
length: zr, | |
let: ur, | |
literal: ce, | |
match: fr, | |
number: fe, | |
"number-format": Ar, | |
object: fe, | |
slice: mr, | |
step: Ge, | |
string: fe, | |
"to-boolean": ge, | |
"to-color": ge, | |
"to-number": ge, | |
"to-string": ge, | |
var: je, | |
within: Re | |
}; | |
function kr(t, e) { | |
var r = e[0] | |
, i = e[1] | |
, n = e[2] | |
, o = e[3]; | |
r = r.evaluate(t), | |
i = i.evaluate(t), | |
n = n.evaluate(t); | |
var a = o ? o.evaluate(t) : 1 | |
, s = ae(r, i, n, a); | |
if (s) | |
throw new pe(s); | |
return new ee(r / 255 * a,i / 255 * a,n / 255 * a,a) | |
} | |
function Tr(t, e) { | |
return t in e | |
} | |
function Dr(t, e) { | |
var r = e[t]; | |
return void 0 === r ? null : r | |
} | |
function Ir(t) { | |
return { | |
type: t | |
} | |
} | |
function Fr(t) { | |
return { | |
result: "success", | |
value: t | |
} | |
} | |
function Br(t) { | |
return { | |
result: "error", | |
value: t | |
} | |
} | |
function Pr(t) { | |
return "data-driven" === t["property-type"] || "cross-faded-data-driven" === t["property-type"] | |
} | |
function Mr(t) { | |
return !!t.expression && t.expression.parameters.indexOf("zoom") > -1 | |
} | |
function Lr(t) { | |
return !!t.expression && t.expression.interpolated | |
} | |
function Rr(t) { | |
return t instanceof Number ? "number" : t instanceof String ? "string" : t instanceof Boolean ? "boolean" : Array.isArray(t) ? "array" : null === t ? "null" : typeof t | |
} | |
function Or(t) { | |
return "object" == typeof t && null !== t && !Array.isArray(t) | |
} | |
function Ur(t) { | |
return t | |
} | |
function Vr(t, e, r) { | |
return void 0 !== t ? t : void 0 !== e ? e : void 0 !== r ? r : void 0 | |
} | |
function jr(t, e, r, i, n) { | |
return Vr(typeof r === n ? i[r] : void 0, t.default, e.default) | |
} | |
function Nr(t, e, r) { | |
if ("number" !== Rr(r)) | |
return Vr(t.default, e.default); | |
var i = t.stops.length; | |
if (1 === i) | |
return t.stops[0][1]; | |
if (r <= t.stops[0][0]) | |
return t.stops[0][1]; | |
if (r >= t.stops[i - 1][0]) | |
return t.stops[i - 1][1]; | |
var n = qe(t.stops.map((function(t) { | |
return t[0] | |
} | |
)), r); | |
return t.stops[n][1] | |
} | |
function qr(t, e, r) { | |
var i = void 0 !== t.base ? t.base : 1; | |
if ("number" !== Rr(r)) | |
return Vr(t.default, e.default); | |
var n = t.stops.length; | |
if (1 === n) | |
return t.stops[0][1]; | |
if (r <= t.stops[0][0]) | |
return t.stops[0][1]; | |
if (r >= t.stops[n - 1][0]) | |
return t.stops[n - 1][1]; | |
var o = qe(t.stops.map((function(t) { | |
return t[0] | |
} | |
)), r) | |
, a = function(t, e, r, i) { | |
var n = i - r | |
, o = t - r; | |
return 0 === n ? 0 : 1 === e ? o / n : (Math.pow(e, o) - 1) / (Math.pow(e, n) - 1) | |
}(r, i, t.stops[o][0], t.stops[o + 1][0]) | |
, s = t.stops[o][1] | |
, l = t.stops[o + 1][1] | |
, u = Xe[e.type] || Ur; | |
if (t.colorSpace && "rgb" !== t.colorSpace) { | |
var c = or[t.colorSpace]; | |
u = function(t, e) { | |
return c.reverse(c.interpolate(c.forward(t), c.forward(e), a)) | |
} | |
} | |
return "function" == typeof s.evaluate ? { | |
evaluate: function() { | |
for (var t = [], e = arguments.length; e--; ) | |
t[e] = arguments[e]; | |
var r = s.evaluate.apply(void 0, t) | |
, i = l.evaluate.apply(void 0, t); | |
if (void 0 !== r && void 0 !== i) | |
return u(r, i, a) | |
} | |
} : u(s, l, a) | |
} | |
function Gr(t, e, r) { | |
return "color" === e.type ? r = ee.parse(r) : "formatted" === e.type ? r = ne.fromString(r.toString()) : "resolvedImage" === e.type ? r = oe.fromString(r.toString()) : Rr(r) === e.type || "enum" === e.type && e.values[r] || (r = void 0), | |
Vr(r, t.default, e.default) | |
} | |
xe.register(Sr, { | |
error: [{ | |
kind: "error" | |
}, [Vt], function(t, e) { | |
throw new pe(e[0].evaluate(t)) | |
} | |
], | |
typeof: [Vt, [Gt], function(t, e) { | |
return Kt(le(e[0].evaluate(t))) | |
} | |
], | |
"to-rgba": [Ht(Ut, 4), [Nt], function(t, e) { | |
return e[0].evaluate(t).toArray() | |
} | |
], | |
rgb: [Nt, [Ut, Ut, Ut], kr], | |
rgba: [Nt, [Ut, Ut, Ut, Ut], kr], | |
has: { | |
type: jt, | |
overloads: [[[Vt], function(t, e) { | |
return Tr(e[0].evaluate(t), t.properties()) | |
} | |
], [[Vt, qt], function(t, e) { | |
var r = e[1]; | |
return Tr(e[0].evaluate(t), r.evaluate(t)) | |
} | |
]] | |
}, | |
get: { | |
type: Gt, | |
overloads: [[[Vt], function(t, e) { | |
return Dr(e[0].evaluate(t), t.properties()) | |
} | |
], [[Vt, qt], function(t, e) { | |
var r = e[1]; | |
return Dr(e[0].evaluate(t), r.evaluate(t)) | |
} | |
]] | |
}, | |
"feature-state": [Gt, [Vt], function(t, e) { | |
return Dr(e[0].evaluate(t), t.featureState || {}) | |
} | |
], | |
properties: [qt, [], function(t) { | |
return t.properties() | |
} | |
], | |
"geometry-type": [Vt, [], function(t) { | |
return t.geometryType() | |
} | |
], | |
id: [Gt, [], function(t) { | |
return t.id() | |
} | |
], | |
zoom: [Ut, [], function(t) { | |
return t.globals.zoom | |
} | |
], | |
"heatmap-density": [Ut, [], function(t) { | |
return t.globals.heatmapDensity || 0 | |
} | |
], | |
"line-progress": [Ut, [], function(t) { | |
return t.globals.lineProgress || 0 | |
} | |
], | |
accumulated: [Gt, [], function(t) { | |
return void 0 === t.globals.accumulated ? null : t.globals.accumulated | |
} | |
], | |
"+": [Ut, Ir(Ut), function(t, e) { | |
for (var r = 0, i = 0, n = e; i < n.length; i += 1) | |
r += n[i].evaluate(t); | |
return r | |
} | |
], | |
"*": [Ut, Ir(Ut), function(t, e) { | |
for (var r = 1, i = 0, n = e; i < n.length; i += 1) | |
r *= n[i].evaluate(t); | |
return r | |
} | |
], | |
"-": { | |
type: Ut, | |
overloads: [[[Ut, Ut], function(t, e) { | |
var r = e[1]; | |
return e[0].evaluate(t) - r.evaluate(t) | |
} | |
], [[Ut], function(t, e) { | |
return -e[0].evaluate(t) | |
} | |
]] | |
}, | |
"/": [Ut, [Ut, Ut], function(t, e) { | |
var r = e[1]; | |
return e[0].evaluate(t) / r.evaluate(t) | |
} | |
], | |
"%": [Ut, [Ut, Ut], function(t, e) { | |
var r = e[1]; | |
return e[0].evaluate(t) % r.evaluate(t) | |
} | |
], | |
ln2: [Ut, [], function() { | |
return Math.LN2 | |
} | |
], | |
pi: [Ut, [], function() { | |
return Math.PI | |
} | |
], | |
e: [Ut, [], function() { | |
return Math.E | |
} | |
], | |
"^": [Ut, [Ut, Ut], function(t, e) { | |
var r = e[1]; | |
return Math.pow(e[0].evaluate(t), r.evaluate(t)) | |
} | |
], | |
sqrt: [Ut, [Ut], function(t, e) { | |
return Math.sqrt(e[0].evaluate(t)) | |
} | |
], | |
log10: [Ut, [Ut], function(t, e) { | |
return Math.log(e[0].evaluate(t)) / Math.LN10 | |
} | |
], | |
ln: [Ut, [Ut], function(t, e) { | |
return Math.log(e[0].evaluate(t)) | |
} | |
], | |
log2: [Ut, [Ut], function(t, e) { | |
return Math.log(e[0].evaluate(t)) / Math.LN2 | |
} | |
], | |
sin: [Ut, [Ut], function(t, e) { | |
return Math.sin(e[0].evaluate(t)) | |
} | |
], | |
cos: [Ut, [Ut], function(t, e) { | |
return Math.cos(e[0].evaluate(t)) | |
} | |
], | |
tan: [Ut, [Ut], function(t, e) { | |
return Math.tan(e[0].evaluate(t)) | |
} | |
], | |
asin: [Ut, [Ut], function(t, e) { | |
return Math.asin(e[0].evaluate(t)) | |
} | |
], | |
acos: [Ut, [Ut], function(t, e) { | |
return Math.acos(e[0].evaluate(t)) | |
} | |
], | |
atan: [Ut, [Ut], function(t, e) { | |
return Math.atan(e[0].evaluate(t)) | |
} | |
], | |
min: [Ut, Ir(Ut), function(t, e) { | |
return Math.min.apply(Math, e.map((function(e) { | |
return e.evaluate(t) | |
} | |
))) | |
} | |
], | |
max: [Ut, Ir(Ut), function(t, e) { | |
return Math.max.apply(Math, e.map((function(e) { | |
return e.evaluate(t) | |
} | |
))) | |
} | |
], | |
abs: [Ut, [Ut], function(t, e) { | |
return Math.abs(e[0].evaluate(t)) | |
} | |
], | |
round: [Ut, [Ut], function(t, e) { | |
var r = e[0].evaluate(t); | |
return r < 0 ? -Math.round(-r) : Math.round(r) | |
} | |
], | |
floor: [Ut, [Ut], function(t, e) { | |
return Math.floor(e[0].evaluate(t)) | |
} | |
], | |
ceil: [Ut, [Ut], function(t, e) { | |
return Math.ceil(e[0].evaluate(t)) | |
} | |
], | |
"filter-==": [jt, [Vt, Gt], function(t, e) { | |
var r = e[0] | |
, i = e[1]; | |
return t.properties()[r.value] === i.value | |
} | |
], | |
"filter-id-==": [jt, [Gt], function(t, e) { | |
var r = e[0]; | |
return t.id() === r.value | |
} | |
], | |
"filter-type-==": [jt, [Vt], function(t, e) { | |
var r = e[0]; | |
return t.geometryType() === r.value | |
} | |
], | |
"filter-<": [jt, [Vt, Gt], function(t, e) { | |
var r = e[0] | |
, i = e[1] | |
, n = t.properties()[r.value] | |
, o = i.value; | |
return typeof n == typeof o && n < o | |
} | |
], | |
"filter-id-<": [jt, [Gt], function(t, e) { | |
var r = e[0] | |
, i = t.id() | |
, n = r.value; | |
return typeof i == typeof n && i < n | |
} | |
], | |
"filter->": [jt, [Vt, Gt], function(t, e) { | |
var r = e[0] | |
, i = e[1] | |
, n = t.properties()[r.value] | |
, o = i.value; | |
return typeof n == typeof o && n > o | |
} | |
], | |
"filter-id->": [jt, [Gt], function(t, e) { | |
var r = e[0] | |
, i = t.id() | |
, n = r.value; | |
return typeof i == typeof n && i > n | |
} | |
], | |
"filter-<=": [jt, [Vt, Gt], function(t, e) { | |
var r = e[0] | |
, i = e[1] | |
, n = t.properties()[r.value] | |
, o = i.value; | |
return typeof n == typeof o && n <= o | |
} | |
], | |
"filter-id-<=": [jt, [Gt], function(t, e) { | |
var r = e[0] | |
, i = t.id() | |
, n = r.value; | |
return typeof i == typeof n && i <= n | |
} | |
], | |
"filter->=": [jt, [Vt, Gt], function(t, e) { | |
var r = e[0] | |
, i = e[1] | |
, n = t.properties()[r.value] | |
, o = i.value; | |
return typeof n == typeof o && n >= o | |
} | |
], | |
"filter-id->=": [jt, [Gt], function(t, e) { | |
var r = e[0] | |
, i = t.id() | |
, n = r.value; | |
return typeof i == typeof n && i >= n | |
} | |
], | |
"filter-has": [jt, [Gt], function(t, e) { | |
return e[0].value in t.properties() | |
} | |
], | |
"filter-has-id": [jt, [], function(t) { | |
return null !== t.id() && void 0 !== t.id() | |
} | |
], | |
"filter-type-in": [jt, [Ht(Vt)], function(t, e) { | |
return e[0].value.indexOf(t.geometryType()) >= 0 | |
} | |
], | |
"filter-id-in": [jt, [Ht(Gt)], function(t, e) { | |
return e[0].value.indexOf(t.id()) >= 0 | |
} | |
], | |
"filter-in-small": [jt, [Vt, Ht(Gt)], function(t, e) { | |
var r = e[0]; | |
return e[1].value.indexOf(t.properties()[r.value]) >= 0 | |
} | |
], | |
"filter-in-large": [jt, [Vt, Ht(Gt)], function(t, e) { | |
var r = e[0] | |
, i = e[1]; | |
return function(t, e, r, i) { | |
for (; r <= i; ) { | |
var n = r + i >> 1; | |
if (e[n] === t) | |
return !0; | |
e[n] > t ? i = n - 1 : r = n + 1 | |
} | |
return !1 | |
}(t.properties()[r.value], i.value, 0, i.value.length - 1) | |
} | |
], | |
all: { | |
type: jt, | |
overloads: [[[jt, jt], function(t, e) { | |
var r = e[1]; | |
return e[0].evaluate(t) && r.evaluate(t) | |
} | |
], [Ir(jt), function(t, e) { | |
for (var r = 0, i = e; r < i.length; r += 1) | |
if (!i[r].evaluate(t)) | |
return !1; | |
return !0 | |
} | |
]] | |
}, | |
any: { | |
type: jt, | |
overloads: [[[jt, jt], function(t, e) { | |
var r = e[1]; | |
return e[0].evaluate(t) || r.evaluate(t) | |
} | |
], [Ir(jt), function(t, e) { | |
for (var r = 0, i = e; r < i.length; r += 1) | |
if (i[r].evaluate(t)) | |
return !0; | |
return !1 | |
} | |
]] | |
}, | |
"!": [jt, [jt], function(t, e) { | |
return !e[0].evaluate(t) | |
} | |
], | |
"is-supported-script": [jt, [Vt], function(t, e) { | |
var r = t.globals && t.globals.isSupportedScript; | |
return !r || r(e[0].evaluate(t)) | |
} | |
], | |
upcase: [Vt, [Vt], function(t, e) { | |
return e[0].evaluate(t).toUpperCase() | |
} | |
], | |
downcase: [Vt, [Vt], function(t, e) { | |
return e[0].evaluate(t).toLowerCase() | |
} | |
], | |
concat: [Vt, Ir(Gt), function(t, e) { | |
return e.map((function(e) { | |
return ue(e.evaluate(t)) | |
} | |
)).join("") | |
} | |
], | |
"resolved-locale": [Vt, [Zt], function(t, e) { | |
return e[0].evaluate(t).resolvedLocale() | |
} | |
] | |
}); | |
var Zr = function(t, e) { | |
this.expression = t, | |
this._warningHistory = {}, | |
this._evaluator = new _e, | |
this._defaultValue = e ? function(t) { | |
return "color" === t.type && Or(t.default) ? new ee(0,0,0,0) : "color" === t.type ? ee.parse(t.default) || null : void 0 === t.default ? null : t.default | |
}(e) : null, | |
this._enumValues = e && "enum" === e.type ? e.values : null | |
}; | |
function Xr(t) { | |
return Array.isArray(t) && t.length > 0 && "string" == typeof t[0] && t[0]in Sr | |
} | |
function Wr(t, e) { | |
var r = new Ne(Sr,[],e ? function(t) { | |
var e = { | |
color: Nt, | |
string: Vt, | |
number: Ut, | |
enum: Vt, | |
boolean: jt, | |
formatted: Xt, | |
resolvedImage: Wt | |
}; | |
return "array" === t.type ? Ht(e[t.value] || Gt, t.length) : e[t.type] | |
}(e) : void 0) | |
, i = r.parse(t, void 0, void 0, void 0, e && "string" === e.type ? { | |
typeAnnotation: "coerce" | |
} : void 0); | |
return i ? Fr(new Zr(i,e)) : Br(r.errors) | |
} | |
Zr.prototype.evaluateWithoutErrorHandling = function(t, e, r, i, n, o) { | |
return this._evaluator.globals = t, | |
this._evaluator.feature = e, | |
this._evaluator.featureState = r, | |
this._evaluator.canonical = i, | |
this._evaluator.availableImages = n || null, | |
this._evaluator.formattedSection = o, | |
this.expression.evaluate(this._evaluator) | |
} | |
, | |
Zr.prototype.evaluate = function(t, e, r, i, n, o) { | |
this._evaluator.globals = t, | |
this._evaluator.feature = e || null, | |
this._evaluator.featureState = r || null, | |
this._evaluator.canonical = i, | |
this._evaluator.availableImages = n || null, | |
this._evaluator.formattedSection = o || null; | |
try { | |
var a = this.expression.evaluate(this._evaluator); | |
if (null == a || "number" == typeof a && a != a) | |
return this._defaultValue; | |
if (this._enumValues && !(a in this._enumValues)) | |
throw new pe("Expected value to be one of " + Object.keys(this._enumValues).map((function(t) { | |
return JSON.stringify(t) | |
} | |
)).join(", ") + ", but found " + JSON.stringify(a) + " instead."); | |
return a | |
} catch (t) { | |
return this._warningHistory[t.message] || (this._warningHistory[t.message] = !0, | |
"undefined" != typeof console && console.warn(t.message)), | |
this._defaultValue | |
} | |
} | |
; | |
var Hr = function(t, e) { | |
this.kind = t, | |
this._styleExpression = e, | |
this.isStateDependent = "constant" !== t && !Ue(e.expression) | |
}; | |
Hr.prototype.evaluateWithoutErrorHandling = function(t, e, r, i, n, o) { | |
return this._styleExpression.evaluateWithoutErrorHandling(t, e, r, i, n, o) | |
} | |
, | |
Hr.prototype.evaluate = function(t, e, r, i, n, o) { | |
return this._styleExpression.evaluate(t, e, r, i, n, o) | |
} | |
; | |
var Kr = function(t, e, r, i) { | |
this.kind = t, | |
this.zoomStops = r, | |
this._styleExpression = e, | |
this.isStateDependent = "camera" !== t && !Ue(e.expression), | |
this.interpolationType = i | |
}; | |
function Jr(t, e) { | |
if ("error" === (t = Wr(t, e)).result) | |
return t; | |
var r = t.value.expression | |
, i = Oe(r); | |
if (!i && !Pr(e)) | |
return Br([new Lt("","data expressions not supported")]); | |
var n = Ve(r, ["zoom"]); | |
if (!n && !Mr(e)) | |
return Br([new Lt("","zoom expressions not supported")]); | |
var o = function t(e) { | |
var r = null; | |
if (e instanceof ur) | |
r = t(e.result); | |
else if (e instanceof lr) | |
for (var i = 0, n = e.args; i < n.length && !(r = t(n[i])); i += 1) | |
; | |
else | |
(e instanceof Ge || e instanceof ar) && e.input instanceof xe && "zoom" === e.input.name && (r = e); | |
return r instanceof Lt || e.eachChild((function(e) { | |
var i = t(e); | |
i instanceof Lt ? r = i : !r && i ? r = new Lt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : r && i && r !== i && (r = new Lt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.')) | |
} | |
)), | |
r | |
}(r); | |
return o || n ? o instanceof Lt ? Br([o]) : o instanceof ar && !Lr(e) ? Br([new Lt("",'"interpolate" expressions cannot be used with this property')]) : Fr(o ? new Kr(i ? "camera" : "composite",t.value,o.labels,o instanceof ar ? o.interpolation : void 0) : new Hr(i ? "constant" : "source",t.value)) : Br([new Lt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]) | |
} | |
Kr.prototype.evaluateWithoutErrorHandling = function(t, e, r, i, n, o) { | |
return this._styleExpression.evaluateWithoutErrorHandling(t, e, r, i, n, o) | |
} | |
, | |
Kr.prototype.evaluate = function(t, e, r, i, n, o) { | |
return this._styleExpression.evaluate(t, e, r, i, n, o) | |
} | |
, | |
Kr.prototype.interpolationFactor = function(t, e, r) { | |
return this.interpolationType ? ar.interpolationFactor(this.interpolationType, t, e, r) : 0 | |
} | |
; | |
var Yr = function(t, e) { | |
this._parameters = t, | |
this._specification = e, | |
Bt(this, function t(e, r) { | |
var i, n, o, a = "color" === r.type, s = e.stops && "object" == typeof e.stops[0][0], l = s || !(s || void 0 !== e.property), u = e.type || (Lr(r) ? "exponential" : "interval"); | |
if (a && ((e = Bt({}, e)).stops && (e.stops = e.stops.map((function(t) { | |
return [t[0], ee.parse(t[1])] | |
} | |
))), | |
e.default = ee.parse(e.default ? e.default : r.default)), | |
e.colorSpace && "rgb" !== e.colorSpace && !or[e.colorSpace]) | |
throw new Error("Unknown color space: " + e.colorSpace); | |
if ("exponential" === u) | |
i = qr; | |
else if ("interval" === u) | |
i = Nr; | |
else if ("categorical" === u) { | |
i = jr, | |
n = Object.create(null); | |
for (var c = 0, p = e.stops; c < p.length; c += 1) { | |
var h = p[c]; | |
n[h[0]] = h[1] | |
} | |
o = typeof e.stops[0][0] | |
} else { | |
if ("identity" !== u) | |
throw new Error('Unknown function type "' + u + '"'); | |
i = Gr | |
} | |
if (s) { | |
for (var f = {}, d = [], m = 0; m < e.stops.length; m++) { | |
var y = e.stops[m] | |
, g = y[0].zoom; | |
void 0 === f[g] && (f[g] = { | |
zoom: g, | |
type: e.type, | |
property: e.property, | |
default: e.default, | |
stops: [] | |
}, | |
d.push(g)), | |
f[g].stops.push([y[0].value, y[1]]) | |
} | |
for (var v = [], _ = 0, x = d; _ < x.length; _ += 1) { | |
var b = x[_]; | |
v.push([f[b].zoom, t(f[b], r)]) | |
} | |
var w = { | |
name: "linear" | |
}; | |
return { | |
kind: "composite", | |
interpolationType: w, | |
interpolationFactor: ar.interpolationFactor.bind(void 0, w), | |
zoomStops: v.map((function(t) { | |
return t[0] | |
} | |
)), | |
evaluate: function(t, i) { | |
var n = t.zoom; | |
return qr({ | |
stops: v, | |
base: e.base | |
}, r, n).evaluate(n, i) | |
} | |
} | |
} | |
if (l) { | |
var E = "exponential" === u ? { | |
name: "exponential", | |
base: void 0 !== e.base ? e.base : 1 | |
} : null; | |
return { | |
kind: "camera", | |
interpolationType: E, | |
interpolationFactor: ar.interpolationFactor.bind(void 0, E), | |
zoomStops: e.stops.map((function(t) { | |
return t[0] | |
} | |
)), | |
evaluate: function(t) { | |
return i(e, r, t.zoom, n, o) | |
} | |
} | |
} | |
return { | |
kind: "source", | |
evaluate: function(t, a) { | |
var s = a && a.properties ? a.properties[e.property] : void 0; | |
return void 0 === s ? Vr(e.default, r.default) : i(e, r, s, n, o) | |
} | |
} | |
}(this._parameters, this._specification)) | |
}; | |
function $r(t) { | |
var e = t.key | |
, r = t.value | |
, i = t.valueSpec || {} | |
, n = t.objectElementValidators || {} | |
, o = t.style | |
, a = t.styleSpec | |
, s = [] | |
, l = Rr(r); | |
if ("object" !== l) | |
return [new It(e,r,"object expected, " + l + " found")]; | |
for (var u in r) { | |
var c = u.split(".")[0] | |
, p = i[c] || i["*"] | |
, h = void 0; | |
if (n[c]) | |
h = n[c]; | |
else if (i[c]) | |
h = Ei; | |
else if (n["*"]) | |
h = n["*"]; | |
else { | |
if (!i["*"]) { | |
s.push(new It(e,r[u],'unknown property "' + u + '"')); | |
continue | |
} | |
h = Ei | |
} | |
s = s.concat(h({ | |
key: (e ? e + "." : e) + u, | |
value: r[u], | |
valueSpec: p, | |
style: o, | |
styleSpec: a, | |
object: r, | |
objectKey: u | |
}, r)) | |
} | |
for (var f in i) | |
n[f] || i[f].required && void 0 === i[f].default && void 0 === r[f] && s.push(new It(e,r,'missing required property "' + f + '"')); | |
return s | |
} | |
function Qr(t) { | |
var e = t.value | |
, r = t.valueSpec | |
, i = t.style | |
, n = t.styleSpec | |
, o = t.key | |
, a = t.arrayElementValidator || Ei; | |
if ("array" !== Rr(e)) | |
return [new It(o,e,"array expected, " + Rr(e) + " found")]; | |
if (r.length && e.length !== r.length) | |
return [new It(o,e,"array length " + r.length + " expected, length " + e.length + " found")]; | |
if (r["min-length"] && e.length < r["min-length"]) | |
return [new It(o,e,"array length at least " + r["min-length"] + " expected, length " + e.length + " found")]; | |
var s = { | |
type: r.value, | |
values: r.values | |
}; | |
n.$version < 7 && (s.function = r.function), | |
"object" === Rr(r.value) && (s = r.value); | |
for (var l = [], u = 0; u < e.length; u++) | |
l = l.concat(a({ | |
array: e, | |
arrayIndex: u, | |
value: e[u], | |
valueSpec: s, | |
style: i, | |
styleSpec: n, | |
key: o + "[" + u + "]" | |
})); | |
return l | |
} | |
function ti(t) { | |
var e = t.key | |
, r = t.value | |
, i = t.valueSpec | |
, n = Rr(r); | |
return "number" === n && r != r && (n = "NaN"), | |
"number" !== n ? [new It(e,r,"number expected, " + n + " found")] : "minimum"in i && r < i.minimum ? [new It(e,r,r + " is less than the minimum value " + i.minimum)] : "maximum"in i && r > i.maximum ? [new It(e,r,r + " is greater than the maximum value " + i.maximum)] : [] | |
} | |
function ei(t) { | |
var e, r, i, n = t.valueSpec, o = Pt(t.value.type), a = {}, s = "categorical" !== o && void 0 === t.value.property, l = !s, u = "array" === Rr(t.value.stops) && "array" === Rr(t.value.stops[0]) && "object" === Rr(t.value.stops[0][0]), c = $r({ | |
key: t.key, | |
value: t.value, | |
valueSpec: t.styleSpec.function, | |
style: t.style, | |
styleSpec: t.styleSpec, | |
objectElementValidators: { | |
stops: function(t) { | |
if ("identity" === o) | |
return [new It(t.key,t.value,'identity function may not have a "stops" property')]; | |
var e = [] | |
, r = t.value; | |
return e = e.concat(Qr({ | |
key: t.key, | |
value: r, | |
valueSpec: t.valueSpec, | |
style: t.style, | |
styleSpec: t.styleSpec, | |
arrayElementValidator: p | |
})), | |
"array" === Rr(r) && 0 === r.length && e.push(new It(t.key,r,"array must have at least one stop")), | |
e | |
}, | |
default: function(t) { | |
return Ei({ | |
key: t.key, | |
value: t.value, | |
valueSpec: n, | |
style: t.style, | |
styleSpec: t.styleSpec | |
}) | |
} | |
} | |
}); | |
return "identity" === o && s && c.push(new It(t.key,t.value,'missing required property "property"')), | |
"identity" === o || t.value.stops || c.push(new It(t.key,t.value,'missing required property "stops"')), | |
"exponential" === o && t.valueSpec.expression && !Lr(t.valueSpec) && c.push(new It(t.key,t.value,"exponential functions not supported")), | |
t.styleSpec.$version >= 8 && (l && !Pr(t.valueSpec) ? c.push(new It(t.key,t.value,"property functions not supported")) : s && !Mr(t.valueSpec) && c.push(new It(t.key,t.value,"zoom functions not supported"))), | |
"categorical" !== o && !u || void 0 !== t.value.property || c.push(new It(t.key,t.value,'"property" property is required')), | |
c; | |
function p(t) { | |
var e = [] | |
, o = t.value | |
, s = t.key; | |
if ("array" !== Rr(o)) | |
return [new It(s,o,"array expected, " + Rr(o) + " found")]; | |
if (2 !== o.length) | |
return [new It(s,o,"array length 2 expected, length " + o.length + " found")]; | |
if (u) { | |
if ("object" !== Rr(o[0])) | |
return [new It(s,o,"object expected, " + Rr(o[0]) + " found")]; | |
if (void 0 === o[0].zoom) | |
return [new It(s,o,"object stop key must have zoom")]; | |
if (void 0 === o[0].value) | |
return [new It(s,o,"object stop key must have value")]; | |
if (i && i > Pt(o[0].zoom)) | |
return [new It(s,o[0].zoom,"stop zoom values must appear in ascending order")]; | |
Pt(o[0].zoom) !== i && (i = Pt(o[0].zoom), | |
r = void 0, | |
a = {}), | |
e = e.concat($r({ | |
key: s + "[0]", | |
value: o[0], | |
valueSpec: { | |
zoom: {} | |
}, | |
style: t.style, | |
styleSpec: t.styleSpec, | |
objectElementValidators: { | |
zoom: ti, | |
value: h | |
} | |
})) | |
} else | |
e = e.concat(h({ | |
key: s + "[0]", | |
value: o[0], | |
valueSpec: {}, | |
style: t.style, | |
styleSpec: t.styleSpec | |
}, o)); | |
return Xr(Mt(o[1])) ? e.concat([new It(s + "[1]",o[1],"expressions are not allowed in function stops.")]) : e.concat(Ei({ | |
key: s + "[1]", | |
value: o[1], | |
valueSpec: n, | |
style: t.style, | |
styleSpec: t.styleSpec | |
})) | |
} | |
function h(t, i) { | |
var s = Rr(t.value) | |
, l = Pt(t.value) | |
, u = null !== t.value ? t.value : i; | |
if (e) { | |
if (s !== e) | |
return [new It(t.key,u,s + " stop domain type must match previous stop domain type " + e)] | |
} else | |
e = s; | |
if ("number" !== s && "string" !== s && "boolean" !== s) | |
return [new It(t.key,u,"stop domain value must be a number, string, or boolean")]; | |
if ("number" !== s && "categorical" !== o) { | |
var c = "number expected, " + s + " found"; | |
return Pr(n) && void 0 === o && (c += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), | |
[new It(t.key,u,c)] | |
} | |
return "categorical" !== o || "number" !== s || isFinite(l) && Math.floor(l) === l ? "categorical" !== o && "number" === s && void 0 !== r && l < r ? [new It(t.key,u,"stop domain values must appear in ascending order")] : (r = l, | |
"categorical" === o && l in a ? [new It(t.key,u,"stop domain values must be unique")] : (a[l] = !0, | |
[])) : [new It(t.key,u,"integer expected, found " + l)] | |
} | |
} | |
function ri(t) { | |
var e = ("property" === t.expressionContext ? Jr : Wr)(Mt(t.value), t.valueSpec); | |
if ("error" === e.result) | |
return e.value.map((function(e) { | |
return new It("" + t.key + e.key,t.value,e.message) | |
} | |
)); | |
var r = e.value.expression || e.value._styleExpression.expression; | |
if ("property" === t.expressionContext && "text-font" === t.propertyKey && !r.outputDefined()) | |
return [new It(t.key,t.value,'Invalid data expression for "' + t.propertyKey + '". Output values must be contained as literals within the expression.')]; | |
if ("property" === t.expressionContext && "layout" === t.propertyType && !Ue(r)) | |
return [new It(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')]; | |
if ("filter" === t.expressionContext && !Ue(r)) | |
return [new It(t.key,t.value,'"feature-state" data expressions are not supported with filters.')]; | |
if (t.expressionContext && 0 === t.expressionContext.indexOf("cluster")) { | |
if (!Ve(r, ["zoom", "feature-state"])) | |
return [new It(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')]; | |
if ("cluster-initial" === t.expressionContext && !Oe(r)) | |
return [new It(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")] | |
} | |
return [] | |
} | |
function ii(t) { | |
var e = t.key | |
, r = t.value | |
, i = t.valueSpec | |
, n = []; | |
return Array.isArray(i.values) ? -1 === i.values.indexOf(Pt(r)) && n.push(new It(e,r,"expected one of [" + i.values.join(", ") + "], " + JSON.stringify(r) + " found")) : -1 === Object.keys(i.values).indexOf(Pt(r)) && n.push(new It(e,r,"expected one of [" + Object.keys(i.values).join(", ") + "], " + JSON.stringify(r) + " found")), | |
n | |
} | |
function ni(t) { | |
if (!0 === t || !1 === t) | |
return !0; | |
if (!Array.isArray(t) || 0 === t.length) | |
return !1; | |
switch (t[0]) { | |
case "has": | |
return t.length >= 2 && "$id" !== t[1] && "$type" !== t[1]; | |
case "in": | |
return t.length >= 3 && ("string" != typeof t[1] || Array.isArray(t[2])); | |
case "!in": | |
case "!has": | |
case "none": | |
return !1; | |
case "==": | |
case "!=": | |
case ">": | |
case ">=": | |
case "<": | |
case "<=": | |
return 3 !== t.length || Array.isArray(t[1]) || Array.isArray(t[2]); | |
case "any": | |
case "all": | |
for (var e = 0, r = t.slice(1); e < r.length; e += 1) { | |
var i = r[e]; | |
if (!ni(i) && "boolean" != typeof i) | |
return !1 | |
} | |
return !0; | |
default: | |
return !0 | |
} | |
} | |
Yr.deserialize = function(t) { | |
return new Yr(t._parameters,t._specification) | |
} | |
, | |
Yr.serialize = function(t) { | |
return { | |
_parameters: t._parameters, | |
_specification: t._specification | |
} | |
} | |
; | |
var oi = { | |
type: "boolean", | |
default: !1, | |
transition: !1, | |
"property-type": "data-driven", | |
expression: { | |
interpolated: !1, | |
parameters: ["zoom", "feature"] | |
} | |
}; | |
function ai(t) { | |
if (null == t) | |
return { | |
filter: function() { | |
return !0 | |
}, | |
needGeometry: !1 | |
}; | |
ni(t) || (t = li(t)); | |
var e = Wr(t, oi); | |
if ("error" === e.result) | |
throw new Error(e.value.map((function(t) { | |
return t.key + ": " + t.message | |
} | |
)).join(", ")); | |
return { | |
filter: function(t, r, i) { | |
return e.value.evaluate(t, r, {}, i) | |
}, | |
needGeometry: function t(e) { | |
if (!Array.isArray(e)) | |
return !1; | |
if ("within" === e[0]) | |
return !0; | |
for (var r = 1; r < e.length; r++) | |
if (t(e[r])) | |
return !0; | |
return !1 | |
}(t) | |
} | |
} | |
function si(t, e) { | |
return t < e ? -1 : t > e ? 1 : 0 | |
} | |
function li(t) { | |
if (!t) | |
return !0; | |
var e, r = t[0]; | |
return t.length <= 1 ? "any" !== r : "==" === r ? ui(t[1], t[2], "==") : "!=" === r ? hi(ui(t[1], t[2], "==")) : "<" === r || ">" === r || "<=" === r || ">=" === r ? ui(t[1], t[2], r) : "any" === r ? (e = t.slice(1), | |
["any"].concat(e.map(li))) : "all" === r ? ["all"].concat(t.slice(1).map(li)) : "none" === r ? ["all"].concat(t.slice(1).map(li).map(hi)) : "in" === r ? ci(t[1], t.slice(2)) : "!in" === r ? hi(ci(t[1], t.slice(2))) : "has" === r ? pi(t[1]) : "!has" === r ? hi(pi(t[1])) : "within" !== r || t | |
} | |
function ui(t, e, r) { | |
switch (t) { | |
case "$type": | |
return ["filter-type-" + r, e]; | |
case "$id": | |
return ["filter-id-" + r, e]; | |
default: | |
return ["filter-" + r, t, e] | |
} | |
} | |
function ci(t, e) { | |
if (0 === e.length) | |
return !1; | |
switch (t) { | |
case "$type": | |
return ["filter-type-in", ["literal", e]]; | |
case "$id": | |
return ["filter-id-in", ["literal", e]]; | |
default: | |
return e.length > 200 && !e.some((function(t) { | |
return typeof t != typeof e[0] | |
} | |
)) ? ["filter-in-large", t, ["literal", e.sort(si)]] : ["filter-in-small", t, ["literal", e]] | |
} | |
} | |
function pi(t) { | |
switch (t) { | |
case "$type": | |
return !0; | |
case "$id": | |
return ["filter-has-id"]; | |
default: | |
return ["filter-has", t] | |
} | |
} | |
function hi(t) { | |
return ["!", t] | |
} | |
function fi(t) { | |
return ni(Mt(t.value)) ? ri(Bt({}, t, { | |
expressionContext: "filter", | |
valueSpec: { | |
value: "boolean" | |
} | |
})) : function t(e) { | |
var r = e.value | |
, i = e.key; | |
if ("array" !== Rr(r)) | |
return [new It(i,r,"array expected, " + Rr(r) + " found")]; | |
var n, o = e.styleSpec, a = []; | |
if (r.length < 1) | |
return [new It(i,r,"filter array must have at least 1 element")]; | |
switch (a = a.concat(ii({ | |
key: i + "[0]", | |
value: r[0], | |
valueSpec: o.filter_operator, | |
style: e.style, | |
styleSpec: e.styleSpec | |
})), | |
Pt(r[0])) { | |
case "<": | |
case "<=": | |
case ">": | |
case ">=": | |
r.length >= 2 && "$type" === Pt(r[1]) && a.push(new It(i,r,'"$type" cannot be use with operator "' + r[0] + '"')); | |
case "==": | |
case "!=": | |
3 !== r.length && a.push(new It(i,r,'filter array for operator "' + r[0] + '" must have 3 elements')); | |
case "in": | |
case "!in": | |
r.length >= 2 && "string" !== (n = Rr(r[1])) && a.push(new It(i + "[1]",r[1],"string expected, " + n + " found")); | |
for (var s = 2; s < r.length; s++) | |
n = Rr(r[s]), | |
"$type" === Pt(r[1]) ? a = a.concat(ii({ | |
key: i + "[" + s + "]", | |
value: r[s], | |
valueSpec: o.geometry_type, | |
style: e.style, | |
styleSpec: e.styleSpec | |
})) : "string" !== n && "number" !== n && "boolean" !== n && a.push(new It(i + "[" + s + "]",r[s],"string, number, or boolean expected, " + n + " found")); | |
break; | |
case "any": | |
case "all": | |
case "none": | |
for (var l = 1; l < r.length; l++) | |
a = a.concat(t({ | |
key: i + "[" + l + "]", | |
value: r[l], | |
style: e.style, | |
styleSpec: e.styleSpec | |
})); | |
break; | |
case "has": | |
case "!has": | |
n = Rr(r[1]), | |
2 !== r.length ? a.push(new It(i,r,'filter array for "' + r[0] + '" operator must have 2 elements')) : "string" !== n && a.push(new It(i + "[1]",r[1],"string expected, " + n + " found")); | |
break; | |
case "within": | |
n = Rr(r[1]), | |
2 !== r.length ? a.push(new It(i,r,'filter array for "' + r[0] + '" operator must have 2 elements')) : "object" !== n && a.push(new It(i + "[1]",r[1],"object expected, " + n + " found")) | |
} | |
return a | |
}(t) | |
} | |
function di(t, e) { | |
var r = t.key | |
, i = t.style | |
, n = t.styleSpec | |
, o = t.value | |
, a = t.objectKey | |
, s = n[e + "_" + t.layerType]; | |
if (!s) | |
return []; | |
var l = a.match(/^(.*)-transition$/); | |
if ("paint" === e && l && s[l[1]] && s[l[1]].transition) | |
return Ei({ | |
key: r, | |
value: o, | |
valueSpec: n.transition, | |
style: i, | |
styleSpec: n | |
}); | |
var u, c = t.valueSpec || s[a]; | |
if (!c) | |
return [new It(r,o,'unknown property "' + a + '"')]; | |
if ("string" === Rr(o) && Pr(c) && !c.tokens && (u = /^{([^}]+)}$/.exec(o))) | |
return [new It(r,o,'"' + a + '" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": ' + JSON.stringify(u[1]) + " }`.")]; | |
var p = []; | |
return "symbol" === t.layerType && ("text-field" === a && i && !i.glyphs && p.push(new It(r,o,'use of "text-field" requires a style "glyphs" property')), | |
"text-font" === a && Or(Mt(o)) && "identity" === Pt(o.type) && p.push(new It(r,o,'"text-font" does not support identity functions'))), | |
p.concat(Ei({ | |
key: t.key, | |
value: o, | |
valueSpec: c, | |
style: i, | |
styleSpec: n, | |
expressionContext: "property", | |
propertyType: e, | |
propertyKey: a | |
})) | |
} | |
function mi(t) { | |
return di(t, "paint") | |
} | |
function yi(t) { | |
return di(t, "layout") | |
} | |
function gi(t) { | |
var e = [] | |
, r = t.value | |
, i = t.key | |
, n = t.style | |
, o = t.styleSpec; | |
r.type || r.ref || e.push(new It(i,r,'either "type" or "ref" is required')); | |
var a, s = Pt(r.type), l = Pt(r.ref); | |
if (r.id) | |
for (var u = Pt(r.id), c = 0; c < t.arrayIndex; c++) { | |
var p = n.layers[c]; | |
Pt(p.id) === u && e.push(new It(i,r.id,'duplicate layer id "' + r.id + '", previously used at line ' + p.id.__line__)) | |
} | |
if ("ref"in r) | |
["type", "source", "source-layer", "filter", "layout"].forEach((function(t) { | |
t in r && e.push(new It(i,r[t],'"' + t + '" is prohibited for ref layers')) | |
} | |
)), | |
n.layers.forEach((function(t) { | |
Pt(t.id) === l && (a = t) | |
} | |
)), | |
a ? a.ref ? e.push(new It(i,r.ref,"ref cannot reference another ref layer")) : s = Pt(a.type) : e.push(new It(i,r.ref,'ref layer "' + l + '" not found')); | |
else if ("background" !== s) | |
if (r.source) { | |
var h = n.sources && n.sources[r.source] | |
, f = h && Pt(h.type); | |
h ? "vector" === f && "raster" === s ? e.push(new It(i,r.source,'layer "' + r.id + '" requires a raster source')) : "raster" === f && "raster" !== s ? e.push(new It(i,r.source,'layer "' + r.id + '" requires a vector source')) : "vector" !== f || r["source-layer"] ? "raster-dem" === f && "hillshade" !== s ? e.push(new It(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")) : "line" !== s || !r.paint || !r.paint["line-gradient"] || "geojson" === f && h.lineMetrics || e.push(new It(i,r,'layer "' + r.id + '" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')) : e.push(new It(i,r,'layer "' + r.id + '" must specify a "source-layer"')) : e.push(new It(i,r.source,'source "' + r.source + '" not found')) | |
} else | |
e.push(new It(i,r,'missing required property "source"')); | |
return e = e.concat($r({ | |
key: i, | |
value: r, | |
valueSpec: o.layer, | |
style: t.style, | |
styleSpec: t.styleSpec, | |
objectElementValidators: { | |
"*": function() { | |
return [] | |
}, | |
type: function() { | |
return Ei({ | |
key: i + ".type", | |
value: r.type, | |
valueSpec: o.layer.type, | |
style: t.style, | |
styleSpec: t.styleSpec, | |
object: r, | |
objectKey: "type" | |
}) | |
}, | |
filter: fi, | |
layout: function(t) { | |
return $r({ | |
layer: r, | |
key: t.key, | |
value: t.value, | |
style: t.style, | |
styleSpec: t.styleSpec, | |
objectElementValidators: { | |
"*": function(t) { | |
return yi(Bt({ | |
layerType: s | |
}, t)) | |
} | |
} | |
}) | |
}, | |
paint: function(t) { | |
return $r({ | |
layer: r, | |
key: t.key, | |
value: t.value, | |
style: t.style, | |
styleSpec: t.styleSpec, | |
objectElementValidators: { | |
"*": function(t) { | |
return mi(Bt({ | |
layerType: s | |
}, t)) | |
} | |
} | |
}) | |
} | |
} | |
})) | |
} | |
function vi(t) { | |
var e = t.value | |
, r = t.key | |
, i = Rr(e); | |
return "string" !== i ? [new It(r,e,"string expected, " + i + " found")] : [] | |
} | |
var _i = { | |
promoteId: function(t) { | |
var e = t.key | |
, r = t.value; | |
if ("string" === Rr(r)) | |
return vi({ | |
key: e, | |
value: r | |
}); | |
var i = []; | |
for (var n in r) | |
i.push.apply(i, vi({ | |
key: e + "." + n, | |
value: r[n] | |
})); | |
return i | |
} | |
}; | |
function xi(t) { | |
var e = t.value | |
, r = t.key | |
, i = t.styleSpec | |
, n = t.style; | |
if (!e.type) | |
return [new It(r,e,'"type" is required')]; | |
var o, a = Pt(e.type); | |
switch (a) { | |
case "vector": | |
case "raster": | |
case "raster-dem": | |
return $r({ | |
key: r, | |
value: e, | |
valueSpec: i["source_" + a.replace("-", "_")], | |
style: t.style, | |
styleSpec: i, | |
objectElementValidators: _i | |
}); | |
case "geojson": | |
if (o = $r({ | |
key: r, | |
value: e, | |
valueSpec: i.source_geojson, | |
style: n, | |
styleSpec: i, | |
objectElementValidators: _i | |
}), | |
e.cluster) | |
for (var s in e.clusterProperties) { | |
var l = e.clusterProperties[s] | |
, u = l[0] | |
, c = "string" == typeof u ? [u, ["accumulated"], ["get", s]] : u; | |
o.push.apply(o, ri({ | |
key: r + "." + s + ".map", | |
value: l[1], | |
expressionContext: "cluster-map" | |
})), | |
o.push.apply(o, ri({ | |
key: r + "." + s + ".reduce", | |
value: c, | |
expressionContext: "cluster-reduce" | |
})) | |
} | |
return o; | |
case "video": | |
return $r({ | |
key: r, | |
value: e, | |
valueSpec: i.source_video, | |
style: n, | |
styleSpec: i | |
}); | |
case "image": | |
return $r({ | |
key: r, | |
value: e, | |
valueSpec: i.source_image, | |
style: n, | |
styleSpec: i | |
}); | |
case "canvas": | |
return [new It(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")]; | |
default: | |
return ii({ | |
key: r + ".type", | |
value: e.type, | |
valueSpec: { | |
values: ["vector", "raster", "raster-dem", "geojson", "video", "image"] | |
}, | |
style: n, | |
styleSpec: i | |
}) | |
} | |
} | |
function bi(t) { | |
var e = t.value | |
, r = t.styleSpec | |
, i = r.light | |
, n = t.style | |
, o = [] | |
, a = Rr(e); | |
if (void 0 === e) | |
return o; | |
if ("object" !== a) | |
return o.concat([new It("light",e,"object expected, " + a + " found")]); | |
for (var s in e) { | |
var l = s.match(/^(.*)-transition$/); | |
o = o.concat(l && i[l[1]] && i[l[1]].transition ? Ei({ | |
key: s, | |
value: e[s], | |
valueSpec: r.transition, | |
style: n, | |
styleSpec: r | |
}) : i[s] ? Ei({ | |
key: s, | |
value: e[s], | |
valueSpec: i[s], | |
style: n, | |
styleSpec: r | |
}) : [new It(s,e[s],'unknown property "' + s + '"')]) | |
} | |
return o | |
} | |
var wi = { | |
"*": function() { | |
return [] | |
}, | |
array: Qr, | |
boolean: function(t) { | |
var e = t.value | |
, r = t.key | |
, i = Rr(e); | |
return "boolean" !== i ? [new It(r,e,"boolean expected, " + i + " found")] : [] | |
}, | |
number: ti, | |
color: function(t) { | |
var e = t.key | |
, r = t.value | |
, i = Rr(r); | |
return "string" !== i ? [new It(e,r,"color expected, " + i + " found")] : null === te(r) ? [new It(e,r,'color expected, "' + r + '" found')] : [] | |
}, | |
constants: Ft, | |
enum: ii, | |
filter: fi, | |
function: ei, | |
layer: gi, | |
object: $r, | |
source: xi, | |
light: bi, | |
string: vi, | |
formatted: function(t) { | |
return 0 === vi(t).length ? [] : ri(t) | |
}, | |
resolvedImage: function(t) { | |
return 0 === vi(t).length ? [] : ri(t) | |
} | |
}; | |
function Ei(t) { | |
var e = t.value | |
, r = t.valueSpec | |
, i = t.styleSpec; | |
return r.expression && Or(Pt(e)) ? ei(t) : r.expression && Xr(Mt(e)) ? ri(t) : r.type && wi[r.type] ? wi[r.type](t) : $r(Bt({}, t, { | |
valueSpec: r.type ? i[r.type] : r | |
})) | |
} | |
function Ci(t) { | |
var e = t.value | |
, r = t.key | |
, i = vi(t); | |
return i.length || (-1 === e.indexOf("{fontstack}") && i.push(new It(r,e,'"glyphs" url must include a "{fontstack}" token')), | |
-1 === e.indexOf("{range}") && i.push(new It(r,e,'"glyphs" url must include a "{range}" token'))), | |
i | |
} | |
function Ai(t, e) { | |
void 0 === e && (e = Dt); | |
var r = []; | |
return r = r.concat(Ei({ | |
key: "", | |
value: t, | |
valueSpec: e.$root, | |
styleSpec: e, | |
style: t, | |
objectElementValidators: { | |
glyphs: Ci, | |
"*": function() { | |
return [] | |
} | |
} | |
})), | |
t.constants && (r = r.concat(Ft({ | |
key: "constants", | |
value: t.constants, | |
style: t, | |
styleSpec: e | |
}))), | |
zi(r) | |
} | |
function zi(t) { | |
return [].concat(t).sort((function(t, e) { | |
return t.line - e.line | |
} | |
)) | |
} | |
function Si(t) { | |
return function() { | |
for (var e = [], r = arguments.length; r--; ) | |
e[r] = arguments[r]; | |
return zi(t.apply(this, e)) | |
} | |
} | |
Ai.source = Si(xi), | |
Ai.light = Si(bi), | |
Ai.layer = Si(gi), | |
Ai.filter = Si(fi), | |
Ai.paintProperty = Si(mi), | |
Ai.layoutProperty = Si(yi); | |
var ki = Ai | |
, Ti = ki.light | |
, Di = ki.paintProperty | |
, Ii = ki.layoutProperty; | |
function Fi(t, e) { | |
var r = !1; | |
if (e && e.length) | |
for (var i = 0, n = e; i < n.length; i += 1) | |
t.fire(new kt(new Error(n[i].message))), | |
r = !0; | |
return r | |
} | |
var Bi = Pi; | |
function Pi(t, e, r) { | |
var i = this.cells = []; | |
if (t instanceof ArrayBuffer) { | |
this.arrayBuffer = t; | |
var n = new Int32Array(this.arrayBuffer); | |
t = n[0], | |
this.d = (e = n[1]) + 2 * (r = n[2]); | |
for (var o = 0; o < this.d * this.d; o++) { | |
var a = n[3 + o] | |
, s = n[3 + o + 1]; | |
i.push(a === s ? null : n.subarray(a, s)) | |
} | |
var l = n[3 + i.length + 1]; | |
this.keys = n.subarray(n[3 + i.length], l), | |
this.bboxes = n.subarray(l), | |
this.insert = this._insertReadonly | |
} else { | |
this.d = e + 2 * r; | |
for (var u = 0; u < this.d * this.d; u++) | |
i.push([]); | |
this.keys = [], | |
this.bboxes = [] | |
} | |
this.n = e, | |
this.extent = t, | |
this.padding = r, | |
this.scale = e / t, | |
this.uid = 0; | |
var c = r / e * t; | |
this.min = -c, | |
this.max = t + c | |
} | |
Pi.prototype.insert = function(t, e, r, i, n) { | |
this._forEachCell(e, r, i, n, this._insertCell, this.uid++), | |
this.keys.push(t), | |
this.bboxes.push(e), | |
this.bboxes.push(r), | |
this.bboxes.push(i), | |
this.bboxes.push(n) | |
} | |
, | |
Pi.prototype._insertReadonly = function() { | |
throw "Cannot insert into a GridIndex created from an ArrayBuffer." | |
} | |
, | |
Pi.prototype._insertCell = function(t, e, r, i, n, o) { | |
this.cells[n].push(o) | |
} | |
, | |
Pi.prototype.query = function(t, e, r, i, n) { | |
var o = this.min | |
, a = this.max; | |
if (t <= o && e <= o && a <= r && a <= i && !n) | |
return Array.prototype.slice.call(this.keys); | |
var s = []; | |
return this._forEachCell(t, e, r, i, this._queryCell, s, {}, n), | |
s | |
} | |
, | |
Pi.prototype._queryCell = function(t, e, r, i, n, o, a, s) { | |
var l = this.cells[n]; | |
if (null !== l) | |
for (var u = this.keys, c = this.bboxes, p = 0; p < l.length; p++) { | |
var h = l[p]; | |
if (void 0 === a[h]) { | |
var f = 4 * h; | |
(s ? s(c[f + 0], c[f + 1], c[f + 2], c[f + 3]) : t <= c[f + 2] && e <= c[f + 3] && r >= c[f + 0] && i >= c[f + 1]) ? (a[h] = !0, | |
o.push(u[h])) : a[h] = !1 | |
} | |
} | |
} | |
, | |
Pi.prototype._forEachCell = function(t, e, r, i, n, o, a, s) { | |
for (var l = this._convertToCellCoord(t), u = this._convertToCellCoord(e), c = this._convertToCellCoord(r), p = this._convertToCellCoord(i), h = l; h <= c; h++) | |
for (var f = u; f <= p; f++) { | |
var d = this.d * f + h; | |
if ((!s || s(this._convertFromCellCoord(h), this._convertFromCellCoord(f), this._convertFromCellCoord(h + 1), this._convertFromCellCoord(f + 1))) && n.call(this, t, e, r, i, d, o, a, s)) | |
return | |
} | |
} | |
, | |
Pi.prototype._convertFromCellCoord = function(t) { | |
return (t - this.padding) / this.scale | |
} | |
, | |
Pi.prototype._convertToCellCoord = function(t) { | |
return Math.max(0, Math.min(this.d - 1, Math.floor(t * this.scale) + this.padding)) | |
} | |
, | |
Pi.prototype.toArrayBuffer = function() { | |
if (this.arrayBuffer) | |
return this.arrayBuffer; | |
for (var t = this.cells, e = 3 + this.cells.length + 1 + 1, r = 0, i = 0; i < this.cells.length; i++) | |
r += this.cells[i].length; | |
var n = new Int32Array(e + r + this.keys.length + this.bboxes.length); | |
n[0] = this.extent, | |
n[1] = this.n, | |
n[2] = this.padding; | |
for (var o = e, a = 0; a < t.length; a++) { | |
var s = t[a]; | |
n[3 + a] = o, | |
n.set(s, o), | |
o += s.length | |
} | |
return n[3 + t.length] = o, | |
n.set(this.keys, o), | |
n[3 + t.length + 1] = o += this.keys.length, | |
n.set(this.bboxes, o), | |
o += this.bboxes.length, | |
n.buffer | |
} | |
; | |
var Mi = a.ImageData | |
, Li = a.ImageBitmap | |
, Ri = {}; | |
function Oi(t, e, r) { | |
void 0 === r && (r = {}), | |
Object.defineProperty(e, "_classRegistryKey", { | |
value: t, | |
writeable: !1 | |
}), | |
Ri[t] = { | |
klass: e, | |
omit: r.omit || [], | |
shallow: r.shallow || [] | |
} | |
} | |
for (var Ui in Oi("Object", Object), | |
Bi.serialize = function(t, e) { | |
var r = t.toArrayBuffer(); | |
return e && e.push(r), | |
{ | |
buffer: r | |
} | |
} | |
, | |
Bi.deserialize = function(t) { | |
return new Bi(t.buffer) | |
} | |
, | |
Oi("Grid", Bi), | |
Oi("Color", ee), | |
Oi("Error", Error), | |
Oi("ResolvedImage", oe), | |
Oi("StylePropertyFunction", Yr), | |
Oi("StyleExpression", Zr, { | |
omit: ["_evaluator"] | |
}), | |
Oi("ZoomDependentExpression", Kr), | |
Oi("ZoomConstantExpression", Hr), | |
Oi("CompoundExpression", xe, { | |
omit: ["_evaluate"] | |
}), | |
Sr) | |
Sr[Ui]._classRegistryKey || Oi("Expression_" + Ui, Sr[Ui]); | |
function Vi(t) { | |
return t && "undefined" != typeof ArrayBuffer && (t instanceof ArrayBuffer || t.constructor && "ArrayBuffer" === t.constructor.name) | |
} | |
function ji(t) { | |
return Li && t instanceof Li | |
} | |
function Ni(t, e) { | |
if (null == t || "boolean" == typeof t || "number" == typeof t || "string" == typeof t || t instanceof Boolean || t instanceof Number || t instanceof String || t instanceof Date || t instanceof RegExp) | |
return t; | |
if (Vi(t) || ji(t)) | |
return e && e.push(t), | |
t; | |
if (ArrayBuffer.isView(t)) { | |
var r = t; | |
return e && e.push(r.buffer), | |
r | |
} | |
if (t instanceof Mi) | |
return e && e.push(t.data.buffer), | |
t; | |
if (Array.isArray(t)) { | |
for (var i = [], n = 0, o = t; n < o.length; n += 1) | |
i.push(Ni(o[n], e)); | |
return i | |
} | |
if ("object" == typeof t) { | |
var a = t.constructor | |
, s = a._classRegistryKey; | |
if (!s) | |
throw new Error("can't serialize object of unregistered class"); | |
var l = a.serialize ? a.serialize(t, e) : {}; | |
if (!a.serialize) { | |
for (var u in t) | |
if (t.hasOwnProperty(u) && !(Ri[s].omit.indexOf(u) >= 0)) { | |
var c = t[u]; | |
l[u] = Ri[s].shallow.indexOf(u) >= 0 ? c : Ni(c, e) | |
} | |
t instanceof Error && (l.message = t.message) | |
} | |
if (l.$name) | |
throw new Error("$name property is reserved for worker serialization logic."); | |
return "Object" !== s && (l.$name = s), | |
l | |
} | |
throw new Error("can't serialize object of type " + typeof t) | |
} | |
function qi(t) { | |
if (null == t || "boolean" == typeof t || "number" == typeof t || "string" == typeof t || t instanceof Boolean || t instanceof Number || t instanceof String || t instanceof Date || t instanceof RegExp || Vi(t) || ji(t) || ArrayBuffer.isView(t) || t instanceof Mi) | |
return t; | |
if (Array.isArray(t)) | |
return t.map(qi); | |
if ("object" == typeof t) { | |
var e = t.$name || "Object" | |
, r = Ri[e].klass; | |
if (!r) | |
throw new Error("can't deserialize unregistered class " + e); | |
if (r.deserialize) | |
return r.deserialize(t); | |
for (var i = Object.create(r.prototype), n = 0, o = Object.keys(t); n < o.length; n += 1) { | |
var a = o[n]; | |
if ("$name" !== a) { | |
var s = t[a]; | |
i[a] = Ri[e].shallow.indexOf(a) >= 0 ? s : qi(s) | |
} | |
} | |
return i | |
} | |
throw new Error("can't deserialize object of type " + typeof t) | |
} | |
var Gi = function() { | |
this.first = !0 | |
}; | |
Gi.prototype.update = function(t, e) { | |
var r = Math.floor(t); | |
return this.first ? (this.first = !1, | |
this.lastIntegerZoom = r, | |
this.lastIntegerZoomTime = 0, | |
this.lastZoom = t, | |
this.lastFloorZoom = r, | |
!0) : (this.lastFloorZoom > r ? (this.lastIntegerZoom = r + 1, | |
this.lastIntegerZoomTime = e) : this.lastFloorZoom < r && (this.lastIntegerZoom = r, | |
this.lastIntegerZoomTime = e), | |
t !== this.lastZoom && (this.lastZoom = t, | |
this.lastFloorZoom = r, | |
!0)) | |
} | |
; | |
var Zi = { | |
"Latin-1 Supplement": function(t) { | |
return t >= 128 && t <= 255 | |
}, | |
Arabic: function(t) { | |
return t >= 1536 && t <= 1791 | |
}, | |
"Arabic Supplement": function(t) { | |
return t >= 1872 && t <= 1919 | |
}, | |
"Arabic Extended-A": function(t) { | |
return t >= 2208 && t <= 2303 | |
}, | |
"Hangul Jamo": function(t) { | |
return t >= 4352 && t <= 4607 | |
}, | |
"Unified Canadian Aboriginal Syllabics": function(t) { | |
return t >= 5120 && t <= 5759 | |
}, | |
Khmer: function(t) { | |
return t >= 6016 && t <= 6143 | |
}, | |
"Unified Canadian Aboriginal Syllabics Extended": function(t) { | |
return t >= 6320 && t <= 6399 | |
}, | |
"General Punctuation": function(t) { | |
return t >= 8192 && t <= 8303 | |
}, | |
"Letterlike Symbols": function(t) { | |
return t >= 8448 && t <= 8527 | |
}, | |
"Number Forms": function(t) { | |
return t >= 8528 && t <= 8591 | |
}, | |
"Miscellaneous Technical": function(t) { | |
return t >= 8960 && t <= 9215 | |
}, | |
"Control Pictures": function(t) { | |
return t >= 9216 && t <= 9279 | |
}, | |
"Optical Character Recognition": function(t) { | |
return t >= 9280 && t <= 9311 | |
}, | |
"Enclosed Alphanumerics": function(t) { | |
return t >= 9312 && t <= 9471 | |
}, | |
"Geometric Shapes": function(t) { | |
return t >= 9632 && t <= 9727 | |
}, | |
"Miscellaneous Symbols": function(t) { | |
return t >= 9728 && t <= 9983 | |
}, | |
"Miscellaneous Symbols and Arrows": function(t) { | |
return t >= 11008 && t <= 11263 | |
}, | |
"CJK Radicals Supplement": function(t) { | |
return t >= 11904 && t <= 12031 | |
}, | |
"Kangxi Radicals": function(t) { | |
return t >= 12032 && t <= 12255 | |
}, | |
"Ideographic Description Characters": function(t) { | |
return t >= 12272 && t <= 12287 | |
}, | |
"CJK Symbols and Punctuation": function(t) { | |
return t >= 12288 && t <= 12351 | |
}, | |
Hiragana: function(t) { | |
return t >= 12352 && t <= 12447 | |
}, | |
Katakana: function(t) { | |
return t >= 12448 && t <= 12543 | |
}, | |
Bopomofo: function(t) { | |
return t >= 12544 && t <= 12591 | |
}, | |
"Hangul Compatibility Jamo": function(t) { | |
return t >= 12592 && t <= 12687 | |
}, | |
Kanbun: function(t) { | |
return t >= 12688 && t <= 12703 | |
}, | |
"Bopomofo Extended": function(t) { | |
return t >= 12704 && t <= 12735 | |
}, | |
"CJK Strokes": function(t) { | |
return t >= 12736 && t <= 12783 | |
}, | |
"Katakana Phonetic Extensions": function(t) { | |
return t >= 12784 && t <= 12799 | |
}, | |
"Enclosed CJK Letters and Months": function(t) { | |
return t >= 12800 && t <= 13055 | |
}, | |
"CJK Compatibility": function(t) { | |
return t >= 13056 && t <= 13311 | |
}, | |
"CJK Unified Ideographs Extension A": function(t) { | |
return t >= 13312 && t <= 19903 | |
}, | |
"Yijing Hexagram Symbols": function(t) { | |
return t >= 19904 && t <= 19967 | |
}, | |
"CJK Unified Ideographs": function(t) { | |
return t >= 19968 && t <= 40959 | |
}, | |
"Yi Syllables": function(t) { | |
return t >= 40960 && t <= 42127 | |
}, | |
"Yi Radicals": function(t) { | |
return t >= 42128 && t <= 42191 | |
}, | |
"Hangul Jamo Extended-A": function(t) { | |
return t >= 43360 && t <= 43391 | |
}, | |
"Hangul Syllables": function(t) { | |
return t >= 44032 && t <= 55215 | |
}, | |
"Hangul Jamo Extended-B": function(t) { | |
return t >= 55216 && t <= 55295 | |
}, | |
"Private Use Area": function(t) { | |
return t >= 57344 && t <= 63743 | |
}, | |
"CJK Compatibility Ideographs": function(t) { | |
return t >= 63744 && t <= 64255 | |
}, | |
"Arabic Presentation Forms-A": function(t) { | |
return t >= 64336 && t <= 65023 | |
}, | |
"Vertical Forms": function(t) { | |
return t >= 65040 && t <= 65055 | |
}, | |
"CJK Compatibility Forms": function(t) { | |
return t >= 65072 && t <= 65103 | |
}, | |
"Small Form Variants": function(t) { | |
return t >= 65104 && t <= 65135 | |
}, | |
"Arabic Presentation Forms-B": function(t) { | |
return t >= 65136 && t <= 65279 | |
}, | |
"Halfwidth and Fullwidth Forms": function(t) { | |
return t >= 65280 && t <= 65519 | |
} | |
}; | |
function Xi(t) { | |
for (var e = 0, r = t; e < r.length; e += 1) | |
if (Wi(r[e].charCodeAt(0))) | |
return !0; | |
return !1 | |
} | |
function Wi(t) { | |
return !(746 !== t && 747 !== t && (t < 4352 || !(Zi["Bopomofo Extended"](t) || Zi.Bopomofo(t) || Zi["CJK Compatibility Forms"](t) && !(t >= 65097 && t <= 65103) || Zi["CJK Compatibility Ideographs"](t) || Zi["CJK Compatibility"](t) || Zi["CJK Radicals Supplement"](t) || Zi["CJK Strokes"](t) || !(!Zi["CJK Symbols and Punctuation"](t) || t >= 12296 && t <= 12305 || t >= 12308 && t <= 12319 || 12336 === t) || Zi["CJK Unified Ideographs Extension A"](t) || Zi["CJK Unified Ideographs"](t) || Zi["Enclosed CJK Letters and Months"](t) || Zi["Hangul Compatibility Jamo"](t) || Zi["Hangul Jamo Extended-A"](t) || Zi["Hangul Jamo Extended-B"](t) || Zi["Hangul Jamo"](t) || Zi["Hangul Syllables"](t) || Zi.Hiragana(t) || Zi["Ideographic Description Characters"](t) || Zi.Kanbun(t) || Zi["Kangxi Radicals"](t) || Zi["Katakana Phonetic Extensions"](t) || Zi.Katakana(t) && 12540 !== t || !(!Zi["Halfwidth and Fullwidth Forms"](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) || !(!Zi["Small Form Variants"](t) || t >= 65112 && t <= 65118 || t >= 65123 && t <= 65126) || Zi["Unified Canadian Aboriginal Syllabics"](t) || Zi["Unified Canadian Aboriginal Syllabics Extended"](t) || Zi["Vertical Forms"](t) || Zi["Yijing Hexagram Symbols"](t) || Zi["Yi Syllables"](t) || Zi["Yi Radicals"](t)))) | |
} | |
function Hi(t) { | |
return !(Wi(t) || function(t) { | |
return !!(Zi["Latin-1 Supplement"](t) && (167 === t || 169 === t || 174 === t || 177 === t || 188 === t || 189 === t || 190 === t || 215 === t || 247 === t) || Zi["General Punctuation"](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) || Zi["Letterlike Symbols"](t) || Zi["Number Forms"](t) || Zi["Miscellaneous Technical"](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) || Zi["Control Pictures"](t) && 9251 !== t || Zi["Optical Character Recognition"](t) || Zi["Enclosed Alphanumerics"](t) || Zi["Geometric Shapes"](t) || Zi["Miscellaneous Symbols"](t) && !(t >= 9754 && t <= 9759) || Zi["Miscellaneous Symbols and Arrows"](t) && (t >= 11026 && t <= 11055 || t >= 11088 && t <= 11097 || t >= 11192 && t <= 11243) || Zi["CJK Symbols and Punctuation"](t) || Zi.Katakana(t) || Zi["Private Use Area"](t) || Zi["CJK Compatibility Forms"](t) || Zi["Small Form Variants"](t) || Zi["Halfwidth and Fullwidth Forms"](t) || 8734 === t || 8756 === t || 8757 === t || t >= 9984 && t <= 10087 || t >= 10102 && t <= 10131 || 65532 === t || 65533 === t) | |
}(t)) | |
} | |
function Ki(t) { | |
return t >= 1424 && t <= 2303 || Zi["Arabic Presentation Forms-A"](t) || Zi["Arabic Presentation Forms-B"](t) | |
} | |
function Ji(t, e) { | |
return !(!e && Ki(t) || t >= 2304 && t <= 3583 || t >= 3840 && t <= 4255 || Zi.Khmer(t)) | |
} | |
function Yi(t) { | |
for (var e = 0, r = t; e < r.length; e += 1) | |
if (Ki(r[e].charCodeAt(0))) | |
return !0; | |
return !1 | |
} | |
var $i = null | |
, Qi = "unavailable" | |
, tn = null | |
, en = function(t) { | |
t && "string" == typeof t && t.indexOf("NetworkError") > -1 && (Qi = "error"), | |
$i && $i(t) | |
}; | |
function rn() { | |
nn.fire(new St("pluginStateChange",{ | |
pluginStatus: Qi, | |
pluginURL: tn | |
})) | |
} | |
var nn = new Tt | |
, on = function() { | |
return Qi | |
} | |
, an = function() { | |
if ("deferred" !== Qi || !tn) | |
throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified"); | |
Qi = "loading", | |
rn(), | |
tn && bt({ | |
url: tn | |
}, (function(t) { | |
t ? en(t) : (Qi = "loaded", | |
rn()) | |
} | |
)) | |
} | |
, sn = { | |
applyArabicShaping: null, | |
processBidirectionalText: null, | |
processStyledBidirectionalText: null, | |
isLoaded: function() { | |
return "loaded" === Qi || null != sn.applyArabicShaping | |
}, | |
isLoading: function() { | |
return "loading" === Qi | |
}, | |
setState: function(t) { | |
Qi = t.pluginStatus, | |
tn = t.pluginURL | |
}, | |
isParsed: function() { | |
return null != sn.applyArabicShaping && null != sn.processBidirectionalText && null != sn.processStyledBidirectionalText | |
}, | |
getPluginURL: function() { | |
return tn | |
} | |
} | |
, ln = function(t, e) { | |
this.zoom = t, | |
e ? (this.now = e.now, | |
this.fadeDuration = e.fadeDuration, | |
this.zoomHistory = e.zoomHistory, | |
this.transition = e.transition) : (this.now = 0, | |
this.fadeDuration = 0, | |
this.zoomHistory = new Gi, | |
this.transition = {}) | |
}; | |
ln.prototype.isSupportedScript = function(t) { | |
return function(t, e) { | |
for (var r = 0, i = t; r < i.length; r += 1) | |
if (!Ji(i[r].charCodeAt(0), e)) | |
return !1; | |
return !0 | |
}(t, sn.isLoaded()) | |
} | |
, | |
ln.prototype.crossFadingFactor = function() { | |
return 0 === this.fadeDuration ? 1 : Math.min((this.now - this.zoomHistory.lastIntegerZoomTime) / this.fadeDuration, 1) | |
} | |
, | |
ln.prototype.getCrossfadeParameters = function() { | |
var t = this.zoom | |
, e = t - Math.floor(t) | |
, r = this.crossFadingFactor(); | |
return t > this.zoomHistory.lastIntegerZoom ? { | |
fromScale: 2, | |
toScale: 1, | |
t: e + (1 - e) * r | |
} : { | |
fromScale: .5, | |
toScale: 1, | |
t: 1 - (1 - r) * e | |
} | |
} | |
; | |
var un = function(t, e) { | |
this.property = t, | |
this.value = e, | |
this.expression = function(t, e) { | |
if (Or(t)) | |
return new Yr(t,e); | |
if (Xr(t)) { | |
var r = Jr(t, e); | |
if ("error" === r.result) | |
throw new Error(r.value.map((function(t) { | |
return t.key + ": " + t.message | |
} | |
)).join(", ")); | |
return r.value | |
} | |
var i = t; | |
return "string" == typeof t && "color" === e.type && (i = ee.parse(t)), | |
{ | |
kind: "constant", | |
evaluate: function() { | |
return i | |
} | |
} | |
}(void 0 === e ? t.specification.default : e, t.specification) | |
}; | |
un.prototype.isDataDriven = function() { | |
return "source" === this.expression.kind || "composite" === this.expression.kind | |
} | |
, | |
un.prototype.possiblyEvaluate = function(t, e, r) { | |
return this.property.possiblyEvaluate(this, t, e, r) | |
} | |
; | |
var cn = function(t) { | |
this.property = t, | |
this.value = new un(t,void 0) | |
}; | |
cn.prototype.transitioned = function(t, e) { | |
return new hn(this.property,this.value,e,h({}, t.transition, this.transition),t.now) | |
} | |
, | |
cn.prototype.untransitioned = function() { | |
return new hn(this.property,this.value,null,{},0) | |
} | |
; | |
var pn = function(t) { | |
this._properties = t, | |
this._values = Object.create(t.defaultTransitionablePropertyValues) | |
}; | |
pn.prototype.getValue = function(t) { | |
return b(this._values[t].value.value) | |
} | |
, | |
pn.prototype.setValue = function(t, e) { | |
this._values.hasOwnProperty(t) || (this._values[t] = new cn(this._values[t].property)), | |
this._values[t].value = new un(this._values[t].property,null === e ? void 0 : b(e)) | |
} | |
, | |
pn.prototype.getTransition = function(t) { | |
return b(this._values[t].transition) | |
} | |
, | |
pn.prototype.setTransition = function(t, e) { | |
this._values.hasOwnProperty(t) || (this._values[t] = new cn(this._values[t].property)), | |
this._values[t].transition = b(e) || void 0 | |
} | |
, | |
pn.prototype.serialize = function() { | |
for (var t = {}, e = 0, r = Object.keys(this._values); e < r.length; e += 1) { | |
var i = r[e] | |
, n = this.getValue(i); | |
void 0 !== n && (t[i] = n); | |
var o = this.getTransition(i); | |
void 0 !== o && (t[i + "-transition"] = o) | |
} | |
return t | |
} | |
, | |
pn.prototype.transitioned = function(t, e) { | |
for (var r = new fn(this._properties), i = 0, n = Object.keys(this._values); i < n.length; i += 1) { | |
var o = n[i]; | |
r._values[o] = this._values[o].transitioned(t, e._values[o]) | |
} | |
return r | |
} | |
, | |
pn.prototype.untransitioned = function() { | |
for (var t = new fn(this._properties), e = 0, r = Object.keys(this._values); e < r.length; e += 1) { | |
var i = r[e]; | |
t._values[i] = this._values[i].untransitioned() | |
} | |
return t | |
} | |
; | |
var hn = function(t, e, r, i, n) { | |
this.property = t, | |
this.value = e, | |
this.begin = n + i.delay || 0, | |
this.end = this.begin + i.duration || 0, | |
t.specification.transition && (i.delay || i.duration) && (this.prior = r) | |
}; | |
hn.prototype.possiblyEvaluate = function(t, e, r) { | |
var i = t.now || 0 | |
, n = this.value.possiblyEvaluate(t, e, r) | |
, o = this.prior; | |
if (o) { | |
if (i > this.end) | |
return this.prior = null, | |
n; | |
if (this.value.isDataDriven()) | |
return this.prior = null, | |
n; | |
if (i < this.begin) | |
return o.possiblyEvaluate(t, e, r); | |
var a = (i - this.begin) / (this.end - this.begin); | |
return this.property.interpolate(o.possiblyEvaluate(t, e, r), n, function(t) { | |
if (t <= 0) | |
return 0; | |
if (t >= 1) | |
return 1; | |
var e = t * t | |
, r = e * t; | |
return 4 * (t < .5 ? r : 3 * (t - e) + r - .75) | |
}(a)) | |
} | |
return n | |
} | |
; | |
var fn = function(t) { | |
this._properties = t, | |
this._values = Object.create(t.defaultTransitioningPropertyValues) | |
}; | |
fn.prototype.possiblyEvaluate = function(t, e, r) { | |
for (var i = new yn(this._properties), n = 0, o = Object.keys(this._values); n < o.length; n += 1) { | |
var a = o[n]; | |
i._values[a] = this._values[a].possiblyEvaluate(t, e, r) | |
} | |
return i | |
} | |
, | |
fn.prototype.hasTransition = function() { | |
for (var t = 0, e = Object.keys(this._values); t < e.length; t += 1) | |
if (this._values[e[t]].prior) | |
return !0; | |
return !1 | |
} | |
; | |
var dn = function(t) { | |
this._properties = t, | |
this._values = Object.create(t.defaultPropertyValues) | |
}; | |
dn.prototype.getValue = function(t) { | |
return b(this._values[t].value) | |
} | |
, | |
dn.prototype.setValue = function(t, e) { | |
this._values[t] = new un(this._values[t].property,null === e ? void 0 : b(e)) | |
} | |
, | |
dn.prototype.serialize = function() { | |
for (var t = {}, e = 0, r = Object.keys(this._values); e < r.length; e += 1) { | |
var i = r[e] | |
, n = this.getValue(i); | |
void 0 !== n && (t[i] = n) | |
} | |
return t | |
} | |
, | |
dn.prototype.possiblyEvaluate = function(t, e, r) { | |
for (var i = new yn(this._properties), n = 0, o = Object.keys(this._values); n < o.length; n += 1) { | |
var a = o[n]; | |
i._values[a] = this._values[a].possiblyEvaluate(t, e, r) | |
} | |
return i | |
} | |
; | |
var mn = function(t, e, r) { | |
this.property = t, | |
this.value = e, | |
this.parameters = r | |
}; | |
mn.prototype.isConstant = function() { | |
return "constant" === this.value.kind | |
} | |
, | |
mn.prototype.constantOr = function(t) { | |
return "constant" === this.value.kind ? this.value.value : t | |
} | |
, | |
mn.prototype.evaluate = function(t, e, r, i) { | |
return this.property.evaluate(this.value, this.parameters, t, e, r, i) | |
} | |
; | |
var yn = function(t) { | |
this._properties = t, | |
this._values = Object.create(t.defaultPossiblyEvaluatedValues) | |
}; | |
yn.prototype.get = function(t) { | |
return this._values[t] | |
} | |
; | |
var gn = function(t) { | |
this.specification = t | |
}; | |
gn.prototype.possiblyEvaluate = function(t, e) { | |
return t.expression.evaluate(e) | |
} | |
, | |
gn.prototype.interpolate = function(t, e, r) { | |
var i = Xe[this.specification.type]; | |
return i ? i(t, e, r) : t | |
} | |
; | |
var vn = function(t, e) { | |
this.specification = t, | |
this.overrides = e | |
}; | |
vn.prototype.possiblyEvaluate = function(t, e, r, i) { | |
return new mn(this,"constant" === t.expression.kind || "camera" === t.expression.kind ? { | |
kind: "constant", | |
value: t.expression.evaluate(e, null, {}, r, i) | |
} : t.expression,e) | |
} | |
, | |
vn.prototype.interpolate = function(t, e, r) { | |
if ("constant" !== t.value.kind || "constant" !== e.value.kind) | |
return t; | |
if (void 0 === t.value.value || void 0 === e.value.value) | |
return new mn(this,{ | |
kind: "constant", | |
value: void 0 | |
},t.parameters); | |
var i = Xe[this.specification.type]; | |
return i ? new mn(this,{ | |
kind: "constant", | |
value: i(t.value.value, e.value.value, r) | |
},t.parameters) : t | |
} | |
, | |
vn.prototype.evaluate = function(t, e, r, i, n, o) { | |
return "constant" === t.kind ? t.value : t.evaluate(e, r, i, n, o) | |
} | |
; | |
var _n = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.possiblyEvaluate = function(t, e, r, i) { | |
if (void 0 === t.value) | |
return new mn(this,{ | |
kind: "constant", | |
value: void 0 | |
},e); | |
if ("constant" === t.expression.kind) { | |
var n = t.expression.evaluate(e, null, {}, r, i) | |
, o = "resolvedImage" === t.property.specification.type && "string" != typeof n ? n.name : n | |
, a = this._calculate(o, o, o, e); | |
return new mn(this,{ | |
kind: "constant", | |
value: a | |
},e) | |
} | |
if ("camera" === t.expression.kind) { | |
var s = this._calculate(t.expression.evaluate({ | |
zoom: e.zoom - 1 | |
}), t.expression.evaluate({ | |
zoom: e.zoom | |
}), t.expression.evaluate({ | |
zoom: e.zoom + 1 | |
}), e); | |
return new mn(this,{ | |
kind: "constant", | |
value: s | |
},e) | |
} | |
return new mn(this,t.expression,e) | |
} | |
, | |
e.prototype.evaluate = function(t, e, r, i, n, o) { | |
if ("source" === t.kind) { | |
var a = t.evaluate(e, r, i, n, o); | |
return this._calculate(a, a, a, e) | |
} | |
return "composite" === t.kind ? this._calculate(t.evaluate({ | |
zoom: Math.floor(e.zoom) - 1 | |
}, r, i), t.evaluate({ | |
zoom: Math.floor(e.zoom) | |
}, r, i), t.evaluate({ | |
zoom: Math.floor(e.zoom) + 1 | |
}, r, i), e) : t.value | |
} | |
, | |
e.prototype._calculate = function(t, e, r, i) { | |
return i.zoom > i.zoomHistory.lastIntegerZoom ? { | |
from: t, | |
to: e | |
} : { | |
from: r, | |
to: e | |
} | |
} | |
, | |
e.prototype.interpolate = function(t) { | |
return t | |
} | |
, | |
e | |
}(vn) | |
, xn = function(t) { | |
this.specification = t | |
}; | |
xn.prototype.possiblyEvaluate = function(t, e, r, i) { | |
if (void 0 !== t.value) { | |
if ("constant" === t.expression.kind) { | |
var n = t.expression.evaluate(e, null, {}, r, i); | |
return this._calculate(n, n, n, e) | |
} | |
return this._calculate(t.expression.evaluate(new ln(Math.floor(e.zoom - 1),e)), t.expression.evaluate(new ln(Math.floor(e.zoom),e)), t.expression.evaluate(new ln(Math.floor(e.zoom + 1),e)), e) | |
} | |
} | |
, | |
xn.prototype._calculate = function(t, e, r, i) { | |
return i.zoom > i.zoomHistory.lastIntegerZoom ? { | |
from: t, | |
to: e | |
} : { | |
from: r, | |
to: e | |
} | |
} | |
, | |
xn.prototype.interpolate = function(t) { | |
return t | |
} | |
; | |
var bn = function(t) { | |
this.specification = t | |
}; | |
bn.prototype.possiblyEvaluate = function(t, e, r, i) { | |
return !!t.expression.evaluate(e, null, {}, r, i) | |
} | |
, | |
bn.prototype.interpolate = function() { | |
return !1 | |
} | |
; | |
var wn = function(t) { | |
for (var e in this.properties = t, | |
this.defaultPropertyValues = {}, | |
this.defaultTransitionablePropertyValues = {}, | |
this.defaultTransitioningPropertyValues = {}, | |
this.defaultPossiblyEvaluatedValues = {}, | |
this.overridableProperties = [], | |
t) { | |
var r = t[e]; | |
r.specification.overridable && this.overridableProperties.push(e); | |
var i = this.defaultPropertyValues[e] = new un(r,void 0) | |
, n = this.defaultTransitionablePropertyValues[e] = new cn(r); | |
this.defaultTransitioningPropertyValues[e] = n.untransitioned(), | |
this.defaultPossiblyEvaluatedValues[e] = i.possiblyEvaluate({}) | |
} | |
}; | |
Oi("DataDrivenProperty", vn), | |
Oi("DataConstantProperty", gn), | |
Oi("CrossFadedDataDrivenProperty", _n), | |
Oi("CrossFadedProperty", xn), | |
Oi("ColorRampProperty", bn); | |
var En = function(t) { | |
function e(e, r) { | |
if (t.call(this), | |
this.id = e.id, | |
this.type = e.type, | |
this._featureFilter = { | |
filter: function() { | |
return !0 | |
}, | |
needGeometry: !1 | |
}, | |
"custom" !== e.type && (this.metadata = (e = e).metadata, | |
this.minzoom = e.minzoom, | |
this.maxzoom = e.maxzoom, | |
"background" !== e.type && (this.source = e.source, | |
this.sourceLayer = e["source-layer"], | |
this.filter = e.filter), | |
r.layout && (this._unevaluatedLayout = new dn(r.layout)), | |
r.paint)) { | |
for (var i in this._transitionablePaint = new pn(r.paint), | |
e.paint) | |
this.setPaintProperty(i, e.paint[i], { | |
validate: !1 | |
}); | |
for (var n in e.layout) | |
this.setLayoutProperty(n, e.layout[n], { | |
validate: !1 | |
}); | |
this._transitioningPaint = this._transitionablePaint.untransitioned(), | |
this.paint = new yn(r.paint) | |
} | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.getCrossfadeParameters = function() { | |
return this._crossfadeParameters | |
} | |
, | |
e.prototype.getLayoutProperty = function(t) { | |
return "visibility" === t ? this.visibility : this._unevaluatedLayout.getValue(t) | |
} | |
, | |
e.prototype.setLayoutProperty = function(t, e, r) { | |
void 0 === r && (r = {}), | |
null != e && this._validate(Ii, "layers." + this.id + ".layout." + t, t, e, r) || ("visibility" !== t ? this._unevaluatedLayout.setValue(t, e) : this.visibility = e) | |
} | |
, | |
e.prototype.getPaintProperty = function(t) { | |
return v(t, "-transition") ? this._transitionablePaint.getTransition(t.slice(0, -"-transition".length)) : this._transitionablePaint.getValue(t) | |
} | |
, | |
e.prototype.setPaintProperty = function(t, e, r) { | |
if (void 0 === r && (r = {}), | |
null != e && this._validate(Di, "layers." + this.id + ".paint." + t, t, e, r)) | |
return !1; | |
if (v(t, "-transition")) | |
return this._transitionablePaint.setTransition(t.slice(0, -"-transition".length), e || void 0), | |
!1; | |
var i = this._transitionablePaint._values[t] | |
, n = "cross-faded-data-driven" === i.property.specification["property-type"] | |
, o = i.value.isDataDriven() | |
, a = i.value; | |
this._transitionablePaint.setValue(t, e), | |
this._handleSpecialPaintPropertyUpdate(t); | |
var s = this._transitionablePaint._values[t].value; | |
return s.isDataDriven() || o || n || this._handleOverridablePaintPropertyUpdate(t, a, s) | |
} | |
, | |
e.prototype._handleSpecialPaintPropertyUpdate = function(t) {} | |
, | |
e.prototype._handleOverridablePaintPropertyUpdate = function(t, e, r) { | |
return !1 | |
} | |
, | |
e.prototype.isHidden = function(t) { | |
return !!(this.minzoom && t < this.minzoom) || !!(this.maxzoom && t >= this.maxzoom) || "none" === this.visibility | |
} | |
, | |
e.prototype.updateTransitions = function(t) { | |
this._transitioningPaint = this._transitionablePaint.transitioned(t, this._transitioningPaint) | |
} | |
, | |
e.prototype.hasTransition = function() { | |
return this._transitioningPaint.hasTransition() | |
} | |
, | |
e.prototype.recalculate = function(t, e) { | |
t.getCrossfadeParameters && (this._crossfadeParameters = t.getCrossfadeParameters()), | |
this._unevaluatedLayout && (this.layout = this._unevaluatedLayout.possiblyEvaluate(t, void 0, e)), | |
this.paint = this._transitioningPaint.possiblyEvaluate(t, void 0, e) | |
} | |
, | |
e.prototype.serialize = function() { | |
var t = { | |
id: this.id, | |
type: this.type, | |
source: this.source, | |
"source-layer": this.sourceLayer, | |
metadata: this.metadata, | |
minzoom: this.minzoom, | |
maxzoom: this.maxzoom, | |
filter: this.filter, | |
layout: this._unevaluatedLayout && this._unevaluatedLayout.serialize(), | |
paint: this._transitionablePaint && this._transitionablePaint.serialize() | |
}; | |
return this.visibility && (t.layout = t.layout || {}, | |
t.layout.visibility = this.visibility), | |
x(t, (function(t, e) { | |
return !(void 0 === t || "layout" === e && !Object.keys(t).length || "paint" === e && !Object.keys(t).length) | |
} | |
)) | |
} | |
, | |
e.prototype._validate = function(t, e, r, i, n) { | |
return void 0 === n && (n = {}), | |
(!n || !1 !== n.validate) && Fi(this, t.call(ki, { | |
key: e, | |
layerType: this.type, | |
objectKey: r, | |
value: i, | |
styleSpec: Dt, | |
style: { | |
glyphs: !0, | |
sprite: !0 | |
} | |
})) | |
} | |
, | |
e.prototype.is3D = function() { | |
return !1 | |
} | |
, | |
e.prototype.isTileClipped = function() { | |
return !1 | |
} | |
, | |
e.prototype.hasOffscreenPass = function() { | |
return !1 | |
} | |
, | |
e.prototype.resize = function() {} | |
, | |
e.prototype.isStateDependent = function() { | |
for (var t in this.paint._values) { | |
var e = this.paint.get(t); | |
if (e instanceof mn && Pr(e.property.specification) && ("source" === e.value.kind || "composite" === e.value.kind) && e.value.isStateDependent) | |
return !0 | |
} | |
return !1 | |
} | |
, | |
e | |
}(Tt) | |
, Cn = { | |
Int8: Int8Array, | |
Uint8: Uint8Array, | |
Int16: Int16Array, | |
Uint16: Uint16Array, | |
Int32: Int32Array, | |
Uint32: Uint32Array, | |
Float32: Float32Array | |
} | |
, An = function(t, e) { | |
this._structArray = t, | |
this._pos1 = e * this.size, | |
this._pos2 = this._pos1 / 2, | |
this._pos4 = this._pos1 / 4, | |
this._pos8 = this._pos1 / 8 | |
} | |
, zn = function() { | |
this.isTransferred = !1, | |
this.capacity = -1, | |
this.resize(0) | |
}; | |
function Sn(t, e) { | |
void 0 === e && (e = 1); | |
var r = 0 | |
, i = 0; | |
return { | |
members: t.map((function(t) { | |
var n = Cn[t.type].BYTES_PER_ELEMENT | |
, o = r = kn(r, Math.max(e, n)) | |
, a = t.components || 1; | |
return i = Math.max(i, n), | |
r += n * a, | |
{ | |
name: t.name, | |
type: t.type, | |
components: a, | |
offset: o | |
} | |
} | |
)), | |
size: kn(r, Math.max(i, e)), | |
alignment: e | |
} | |
} | |
function kn(t, e) { | |
return Math.ceil(t / e) * e | |
} | |
zn.serialize = function(t, e) { | |
return t._trim(), | |
e && (t.isTransferred = !0, | |
e.push(t.arrayBuffer)), | |
{ | |
length: t.length, | |
arrayBuffer: t.arrayBuffer | |
} | |
} | |
, | |
zn.deserialize = function(t) { | |
var e = Object.create(this.prototype); | |
return e.arrayBuffer = t.arrayBuffer, | |
e.length = t.length, | |
e.capacity = t.arrayBuffer.byteLength / e.bytesPerElement, | |
e._refreshViews(), | |
e | |
} | |
, | |
zn.prototype._trim = function() { | |
this.length !== this.capacity && (this.capacity = this.length, | |
this.arrayBuffer = this.arrayBuffer.slice(0, this.length * this.bytesPerElement), | |
this._refreshViews()) | |
} | |
, | |
zn.prototype.clear = function() { | |
this.length = 0 | |
} | |
, | |
zn.prototype.resize = function(t) { | |
this.reserve(t), | |
this.length = t | |
} | |
, | |
zn.prototype.reserve = function(t) { | |
if (t > this.capacity) { | |
this.capacity = Math.max(t, Math.floor(5 * this.capacity), 128), | |
this.arrayBuffer = new ArrayBuffer(this.capacity * this.bytesPerElement); | |
var e = this.uint8; | |
this._refreshViews(), | |
e && this.uint8.set(e) | |
} | |
} | |
, | |
zn.prototype._refreshViews = function() { | |
throw new Error("_refreshViews() must be implemented by each concrete StructArray layout") | |
} | |
; | |
var Tn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.int16 = new Int16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e) { | |
var r = this.length; | |
return this.resize(r + 1), | |
this.emplace(r, t, e) | |
} | |
, | |
e.prototype.emplace = function(t, e, r) { | |
var i = 2 * t; | |
return this.int16[i + 0] = e, | |
this.int16[i + 1] = r, | |
t | |
} | |
, | |
e | |
}(zn); | |
Tn.prototype.bytesPerElement = 4, | |
Oi("StructArrayLayout2i4", Tn); | |
var Dn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.int16 = new Int16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i) { | |
var n = this.length; | |
return this.resize(n + 1), | |
this.emplace(n, t, e, r, i) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n) { | |
var o = 4 * t; | |
return this.int16[o + 0] = e, | |
this.int16[o + 1] = r, | |
this.int16[o + 2] = i, | |
this.int16[o + 3] = n, | |
t | |
} | |
, | |
e | |
}(zn); | |
Dn.prototype.bytesPerElement = 8, | |
Oi("StructArrayLayout4i8", Dn); | |
var In = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.int16 = new Int16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i, n, o) { | |
var a = this.length; | |
return this.resize(a + 1), | |
this.emplace(a, t, e, r, i, n, o) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n, o, a) { | |
var s = 6 * t; | |
return this.int16[s + 0] = e, | |
this.int16[s + 1] = r, | |
this.int16[s + 2] = i, | |
this.int16[s + 3] = n, | |
this.int16[s + 4] = o, | |
this.int16[s + 5] = a, | |
t | |
} | |
, | |
e | |
}(zn); | |
In.prototype.bytesPerElement = 12, | |
Oi("StructArrayLayout2i4i12", In); | |
var Fn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.int16 = new Int16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i, n, o) { | |
var a = this.length; | |
return this.resize(a + 1), | |
this.emplace(a, t, e, r, i, n, o) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n, o, a) { | |
var s = 4 * t | |
, l = 8 * t; | |
return this.int16[s + 0] = e, | |
this.int16[s + 1] = r, | |
this.uint8[l + 4] = i, | |
this.uint8[l + 5] = n, | |
this.uint8[l + 6] = o, | |
this.uint8[l + 7] = a, | |
t | |
} | |
, | |
e | |
}(zn); | |
Fn.prototype.bytesPerElement = 8, | |
Oi("StructArrayLayout2i4ub8", Fn); | |
var Bn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.float32 = new Float32Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e) { | |
var r = this.length; | |
return this.resize(r + 1), | |
this.emplace(r, t, e) | |
} | |
, | |
e.prototype.emplace = function(t, e, r) { | |
var i = 2 * t; | |
return this.float32[i + 0] = e, | |
this.float32[i + 1] = r, | |
t | |
} | |
, | |
e | |
}(zn); | |
Bn.prototype.bytesPerElement = 8, | |
Oi("StructArrayLayout2f8", Bn); | |
var Pn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.uint16 = new Uint16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i, n, o, a, s, l, u) { | |
var c = this.length; | |
return this.resize(c + 1), | |
this.emplace(c, t, e, r, i, n, o, a, s, l, u) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n, o, a, s, l, u, c) { | |
var p = 10 * t; | |
return this.uint16[p + 0] = e, | |
this.uint16[p + 1] = r, | |
this.uint16[p + 2] = i, | |
this.uint16[p + 3] = n, | |
this.uint16[p + 4] = o, | |
this.uint16[p + 5] = a, | |
this.uint16[p + 6] = s, | |
this.uint16[p + 7] = l, | |
this.uint16[p + 8] = u, | |
this.uint16[p + 9] = c, | |
t | |
} | |
, | |
e | |
}(zn); | |
Pn.prototype.bytesPerElement = 20, | |
Oi("StructArrayLayout10ui20", Pn); | |
var Mn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.int16 = new Int16Array(this.arrayBuffer), | |
this.uint16 = new Uint16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i, n, o, a, s, l, u, c, p) { | |
var h = this.length; | |
return this.resize(h + 1), | |
this.emplace(h, t, e, r, i, n, o, a, s, l, u, c, p) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n, o, a, s, l, u, c, p, h) { | |
var f = 12 * t; | |
return this.int16[f + 0] = e, | |
this.int16[f + 1] = r, | |
this.int16[f + 2] = i, | |
this.int16[f + 3] = n, | |
this.uint16[f + 4] = o, | |
this.uint16[f + 5] = a, | |
this.uint16[f + 6] = s, | |
this.uint16[f + 7] = l, | |
this.int16[f + 8] = u, | |
this.int16[f + 9] = c, | |
this.int16[f + 10] = p, | |
this.int16[f + 11] = h, | |
t | |
} | |
, | |
e | |
}(zn); | |
Mn.prototype.bytesPerElement = 24, | |
Oi("StructArrayLayout4i4ui4i24", Mn); | |
var Ln = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.float32 = new Float32Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r) { | |
var i = this.length; | |
return this.resize(i + 1), | |
this.emplace(i, t, e, r) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i) { | |
var n = 3 * t; | |
return this.float32[n + 0] = e, | |
this.float32[n + 1] = r, | |
this.float32[n + 2] = i, | |
t | |
} | |
, | |
e | |
}(zn); | |
Ln.prototype.bytesPerElement = 12, | |
Oi("StructArrayLayout3f12", Ln); | |
var Rn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.uint32 = new Uint32Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t) { | |
var e = this.length; | |
return this.resize(e + 1), | |
this.emplace(e, t) | |
} | |
, | |
e.prototype.emplace = function(t, e) { | |
return this.uint32[1 * t + 0] = e, | |
t | |
} | |
, | |
e | |
}(zn); | |
Rn.prototype.bytesPerElement = 4, | |
Oi("StructArrayLayout1ul4", Rn); | |
var On = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.int16 = new Int16Array(this.arrayBuffer), | |
this.uint32 = new Uint32Array(this.arrayBuffer), | |
this.uint16 = new Uint16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i, n, o, a, s, l) { | |
var u = this.length; | |
return this.resize(u + 1), | |
this.emplace(u, t, e, r, i, n, o, a, s, l) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n, o, a, s, l, u) { | |
var c = 10 * t | |
, p = 5 * t; | |
return this.int16[c + 0] = e, | |
this.int16[c + 1] = r, | |
this.int16[c + 2] = i, | |
this.int16[c + 3] = n, | |
this.int16[c + 4] = o, | |
this.int16[c + 5] = a, | |
this.uint32[p + 3] = s, | |
this.uint16[c + 8] = l, | |
this.uint16[c + 9] = u, | |
t | |
} | |
, | |
e | |
}(zn); | |
On.prototype.bytesPerElement = 20, | |
Oi("StructArrayLayout6i1ul2ui20", On); | |
var Un = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.int16 = new Int16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i, n, o) { | |
var a = this.length; | |
return this.resize(a + 1), | |
this.emplace(a, t, e, r, i, n, o) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n, o, a) { | |
var s = 6 * t; | |
return this.int16[s + 0] = e, | |
this.int16[s + 1] = r, | |
this.int16[s + 2] = i, | |
this.int16[s + 3] = n, | |
this.int16[s + 4] = o, | |
this.int16[s + 5] = a, | |
t | |
} | |
, | |
e | |
}(zn); | |
Un.prototype.bytesPerElement = 12, | |
Oi("StructArrayLayout2i2i2i12", Un); | |
var Vn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.float32 = new Float32Array(this.arrayBuffer), | |
this.int16 = new Int16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i, n) { | |
var o = this.length; | |
return this.resize(o + 1), | |
this.emplace(o, t, e, r, i, n) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n, o) { | |
var a = 4 * t | |
, s = 8 * t; | |
return this.float32[a + 0] = e, | |
this.float32[a + 1] = r, | |
this.float32[a + 2] = i, | |
this.int16[s + 6] = n, | |
this.int16[s + 7] = o, | |
t | |
} | |
, | |
e | |
}(zn); | |
Vn.prototype.bytesPerElement = 16, | |
Oi("StructArrayLayout2f1f2i16", Vn); | |
var jn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.float32 = new Float32Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i) { | |
var n = this.length; | |
return this.resize(n + 1), | |
this.emplace(n, t, e, r, i) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n) { | |
var o = 12 * t | |
, a = 3 * t; | |
return this.uint8[o + 0] = e, | |
this.uint8[o + 1] = r, | |
this.float32[a + 1] = i, | |
this.float32[a + 2] = n, | |
t | |
} | |
, | |
e | |
}(zn); | |
jn.prototype.bytesPerElement = 12, | |
Oi("StructArrayLayout2ub2f12", jn); | |
var Nn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.uint16 = new Uint16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r) { | |
var i = this.length; | |
return this.resize(i + 1), | |
this.emplace(i, t, e, r) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i) { | |
var n = 3 * t; | |
return this.uint16[n + 0] = e, | |
this.uint16[n + 1] = r, | |
this.uint16[n + 2] = i, | |
t | |
} | |
, | |
e | |
}(zn); | |
Nn.prototype.bytesPerElement = 6, | |
Oi("StructArrayLayout3ui6", Nn); | |
var qn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.int16 = new Int16Array(this.arrayBuffer), | |
this.uint16 = new Uint16Array(this.arrayBuffer), | |
this.uint32 = new Uint32Array(this.arrayBuffer), | |
this.float32 = new Float32Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i, n, o, a, s, l, u, c, p, h, f, d, m, y) { | |
var g = this.length; | |
return this.resize(g + 1), | |
this.emplace(g, t, e, r, i, n, o, a, s, l, u, c, p, h, f, d, m, y) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n, o, a, s, l, u, c, p, h, f, d, m, y, g) { | |
var v = 24 * t | |
, _ = 12 * t | |
, x = 48 * t; | |
return this.int16[v + 0] = e, | |
this.int16[v + 1] = r, | |
this.uint16[v + 2] = i, | |
this.uint16[v + 3] = n, | |
this.uint32[_ + 2] = o, | |
this.uint32[_ + 3] = a, | |
this.uint32[_ + 4] = s, | |
this.uint16[v + 10] = l, | |
this.uint16[v + 11] = u, | |
this.uint16[v + 12] = c, | |
this.float32[_ + 7] = p, | |
this.float32[_ + 8] = h, | |
this.uint8[x + 36] = f, | |
this.uint8[x + 37] = d, | |
this.uint8[x + 38] = m, | |
this.uint32[_ + 10] = y, | |
this.int16[v + 22] = g, | |
t | |
} | |
, | |
e | |
}(zn); | |
qn.prototype.bytesPerElement = 48, | |
Oi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48", qn); | |
var Gn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.int16 = new Int16Array(this.arrayBuffer), | |
this.uint16 = new Uint16Array(this.arrayBuffer), | |
this.uint32 = new Uint32Array(this.arrayBuffer), | |
this.float32 = new Float32Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i, n, o, a, s, l, u, c, p, h, f, d, m, y, g, v, _, x, b, w, E, C, A, z, S) { | |
var k = this.length; | |
return this.resize(k + 1), | |
this.emplace(k, t, e, r, i, n, o, a, s, l, u, c, p, h, f, d, m, y, g, v, _, x, b, w, E, C, A, z, S) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n, o, a, s, l, u, c, p, h, f, d, m, y, g, v, _, x, b, w, E, C, A, z, S, k) { | |
var T = 34 * t | |
, D = 17 * t; | |
return this.int16[T + 0] = e, | |
this.int16[T + 1] = r, | |
this.int16[T + 2] = i, | |
this.int16[T + 3] = n, | |
this.int16[T + 4] = o, | |
this.int16[T + 5] = a, | |
this.int16[T + 6] = s, | |
this.int16[T + 7] = l, | |
this.uint16[T + 8] = u, | |
this.uint16[T + 9] = c, | |
this.uint16[T + 10] = p, | |
this.uint16[T + 11] = h, | |
this.uint16[T + 12] = f, | |
this.uint16[T + 13] = d, | |
this.uint16[T + 14] = m, | |
this.uint16[T + 15] = y, | |
this.uint16[T + 16] = g, | |
this.uint16[T + 17] = v, | |
this.uint16[T + 18] = _, | |
this.uint16[T + 19] = x, | |
this.uint16[T + 20] = b, | |
this.uint16[T + 21] = w, | |
this.uint16[T + 22] = E, | |
this.uint32[D + 12] = C, | |
this.float32[D + 13] = A, | |
this.float32[D + 14] = z, | |
this.float32[D + 15] = S, | |
this.float32[D + 16] = k, | |
t | |
} | |
, | |
e | |
}(zn); | |
Gn.prototype.bytesPerElement = 68, | |
Oi("StructArrayLayout8i15ui1ul4f68", Gn); | |
var Zn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.float32 = new Float32Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t) { | |
var e = this.length; | |
return this.resize(e + 1), | |
this.emplace(e, t) | |
} | |
, | |
e.prototype.emplace = function(t, e) { | |
return this.float32[1 * t + 0] = e, | |
t | |
} | |
, | |
e | |
}(zn); | |
Zn.prototype.bytesPerElement = 4, | |
Oi("StructArrayLayout1f4", Zn); | |
var Xn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.int16 = new Int16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r) { | |
var i = this.length; | |
return this.resize(i + 1), | |
this.emplace(i, t, e, r) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i) { | |
var n = 3 * t; | |
return this.int16[n + 0] = e, | |
this.int16[n + 1] = r, | |
this.int16[n + 2] = i, | |
t | |
} | |
, | |
e | |
}(zn); | |
Xn.prototype.bytesPerElement = 6, | |
Oi("StructArrayLayout3i6", Xn); | |
var Wn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.uint32 = new Uint32Array(this.arrayBuffer), | |
this.uint16 = new Uint16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r) { | |
var i = this.length; | |
return this.resize(i + 1), | |
this.emplace(i, t, e, r) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i) { | |
var n = 4 * t; | |
return this.uint32[2 * t + 0] = e, | |
this.uint16[n + 2] = r, | |
this.uint16[n + 3] = i, | |
t | |
} | |
, | |
e | |
}(zn); | |
Wn.prototype.bytesPerElement = 8, | |
Oi("StructArrayLayout1ul2ui8", Wn); | |
var Hn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.uint16 = new Uint16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e) { | |
var r = this.length; | |
return this.resize(r + 1), | |
this.emplace(r, t, e) | |
} | |
, | |
e.prototype.emplace = function(t, e, r) { | |
var i = 2 * t; | |
return this.uint16[i + 0] = e, | |
this.uint16[i + 1] = r, | |
t | |
} | |
, | |
e | |
}(zn); | |
Hn.prototype.bytesPerElement = 4, | |
Oi("StructArrayLayout2ui4", Hn); | |
var Kn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.uint16 = new Uint16Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t) { | |
var e = this.length; | |
return this.resize(e + 1), | |
this.emplace(e, t) | |
} | |
, | |
e.prototype.emplace = function(t, e) { | |
return this.uint16[1 * t + 0] = e, | |
t | |
} | |
, | |
e | |
}(zn); | |
Kn.prototype.bytesPerElement = 2, | |
Oi("StructArrayLayout1ui2", Kn); | |
var Jn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._refreshViews = function() { | |
this.uint8 = new Uint8Array(this.arrayBuffer), | |
this.float32 = new Float32Array(this.arrayBuffer) | |
} | |
, | |
e.prototype.emplaceBack = function(t, e, r, i) { | |
var n = this.length; | |
return this.resize(n + 1), | |
this.emplace(n, t, e, r, i) | |
} | |
, | |
e.prototype.emplace = function(t, e, r, i, n) { | |
var o = 4 * t; | |
return this.float32[o + 0] = e, | |
this.float32[o + 1] = r, | |
this.float32[o + 2] = i, | |
this.float32[o + 3] = n, | |
t | |
} | |
, | |
e | |
}(zn); | |
Jn.prototype.bytesPerElement = 16, | |
Oi("StructArrayLayout4f16", Jn); | |
var Yn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e; | |
var r = { | |
anchorPointX: { | |
configurable: !0 | |
}, | |
anchorPointY: { | |
configurable: !0 | |
}, | |
x1: { | |
configurable: !0 | |
}, | |
y1: { | |
configurable: !0 | |
}, | |
x2: { | |
configurable: !0 | |
}, | |
y2: { | |
configurable: !0 | |
}, | |
featureIndex: { | |
configurable: !0 | |
}, | |
sourceLayerIndex: { | |
configurable: !0 | |
}, | |
bucketIndex: { | |
configurable: !0 | |
}, | |
anchorPoint: { | |
configurable: !0 | |
} | |
}; | |
return r.anchorPointX.get = function() { | |
return this._structArray.int16[this._pos2 + 0] | |
} | |
, | |
r.anchorPointY.get = function() { | |
return this._structArray.int16[this._pos2 + 1] | |
} | |
, | |
r.x1.get = function() { | |
return this._structArray.int16[this._pos2 + 2] | |
} | |
, | |
r.y1.get = function() { | |
return this._structArray.int16[this._pos2 + 3] | |
} | |
, | |
r.x2.get = function() { | |
return this._structArray.int16[this._pos2 + 4] | |
} | |
, | |
r.y2.get = function() { | |
return this._structArray.int16[this._pos2 + 5] | |
} | |
, | |
r.featureIndex.get = function() { | |
return this._structArray.uint32[this._pos4 + 3] | |
} | |
, | |
r.sourceLayerIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 8] | |
} | |
, | |
r.bucketIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 9] | |
} | |
, | |
r.anchorPoint.get = function() { | |
return new n(this.anchorPointX,this.anchorPointY) | |
} | |
, | |
Object.defineProperties(e.prototype, r), | |
e | |
}(An); | |
Yn.prototype.size = 20; | |
var $n = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.get = function(t) { | |
return new Yn(this,t) | |
} | |
, | |
e | |
}(On); | |
Oi("CollisionBoxArray", $n); | |
var Qn = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e; | |
var r = { | |
anchorX: { | |
configurable: !0 | |
}, | |
anchorY: { | |
configurable: !0 | |
}, | |
glyphStartIndex: { | |
configurable: !0 | |
}, | |
numGlyphs: { | |
configurable: !0 | |
}, | |
vertexStartIndex: { | |
configurable: !0 | |
}, | |
lineStartIndex: { | |
configurable: !0 | |
}, | |
lineLength: { | |
configurable: !0 | |
}, | |
segment: { | |
configurable: !0 | |
}, | |
lowerSize: { | |
configurable: !0 | |
}, | |
upperSize: { | |
configurable: !0 | |
}, | |
lineOffsetX: { | |
configurable: !0 | |
}, | |
lineOffsetY: { | |
configurable: !0 | |
}, | |
writingMode: { | |
configurable: !0 | |
}, | |
placedOrientation: { | |
configurable: !0 | |
}, | |
hidden: { | |
configurable: !0 | |
}, | |
crossTileID: { | |
configurable: !0 | |
}, | |
associatedIconIndex: { | |
configurable: !0 | |
} | |
}; | |
return r.anchorX.get = function() { | |
return this._structArray.int16[this._pos2 + 0] | |
} | |
, | |
r.anchorY.get = function() { | |
return this._structArray.int16[this._pos2 + 1] | |
} | |
, | |
r.glyphStartIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 2] | |
} | |
, | |
r.numGlyphs.get = function() { | |
return this._structArray.uint16[this._pos2 + 3] | |
} | |
, | |
r.vertexStartIndex.get = function() { | |
return this._structArray.uint32[this._pos4 + 2] | |
} | |
, | |
r.lineStartIndex.get = function() { | |
return this._structArray.uint32[this._pos4 + 3] | |
} | |
, | |
r.lineLength.get = function() { | |
return this._structArray.uint32[this._pos4 + 4] | |
} | |
, | |
r.segment.get = function() { | |
return this._structArray.uint16[this._pos2 + 10] | |
} | |
, | |
r.lowerSize.get = function() { | |
return this._structArray.uint16[this._pos2 + 11] | |
} | |
, | |
r.upperSize.get = function() { | |
return this._structArray.uint16[this._pos2 + 12] | |
} | |
, | |
r.lineOffsetX.get = function() { | |
return this._structArray.float32[this._pos4 + 7] | |
} | |
, | |
r.lineOffsetY.get = function() { | |
return this._structArray.float32[this._pos4 + 8] | |
} | |
, | |
r.writingMode.get = function() { | |
return this._structArray.uint8[this._pos1 + 36] | |
} | |
, | |
r.placedOrientation.get = function() { | |
return this._structArray.uint8[this._pos1 + 37] | |
} | |
, | |
r.placedOrientation.set = function(t) { | |
this._structArray.uint8[this._pos1 + 37] = t | |
} | |
, | |
r.hidden.get = function() { | |
return this._structArray.uint8[this._pos1 + 38] | |
} | |
, | |
r.hidden.set = function(t) { | |
this._structArray.uint8[this._pos1 + 38] = t | |
} | |
, | |
r.crossTileID.get = function() { | |
return this._structArray.uint32[this._pos4 + 10] | |
} | |
, | |
r.crossTileID.set = function(t) { | |
this._structArray.uint32[this._pos4 + 10] = t | |
} | |
, | |
r.associatedIconIndex.get = function() { | |
return this._structArray.int16[this._pos2 + 22] | |
} | |
, | |
Object.defineProperties(e.prototype, r), | |
e | |
}(An); | |
Qn.prototype.size = 48; | |
var to = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.get = function(t) { | |
return new Qn(this,t) | |
} | |
, | |
e | |
}(qn); | |
Oi("PlacedSymbolArray", to); | |
var eo = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e; | |
var r = { | |
anchorX: { | |
configurable: !0 | |
}, | |
anchorY: { | |
configurable: !0 | |
}, | |
rightJustifiedTextSymbolIndex: { | |
configurable: !0 | |
}, | |
centerJustifiedTextSymbolIndex: { | |
configurable: !0 | |
}, | |
leftJustifiedTextSymbolIndex: { | |
configurable: !0 | |
}, | |
verticalPlacedTextSymbolIndex: { | |
configurable: !0 | |
}, | |
placedIconSymbolIndex: { | |
configurable: !0 | |
}, | |
verticalPlacedIconSymbolIndex: { | |
configurable: !0 | |
}, | |
key: { | |
configurable: !0 | |
}, | |
textBoxStartIndex: { | |
configurable: !0 | |
}, | |
textBoxEndIndex: { | |
configurable: !0 | |
}, | |
verticalTextBoxStartIndex: { | |
configurable: !0 | |
}, | |
verticalTextBoxEndIndex: { | |
configurable: !0 | |
}, | |
iconBoxStartIndex: { | |
configurable: !0 | |
}, | |
iconBoxEndIndex: { | |
configurable: !0 | |
}, | |
verticalIconBoxStartIndex: { | |
configurable: !0 | |
}, | |
verticalIconBoxEndIndex: { | |
configurable: !0 | |
}, | |
featureIndex: { | |
configurable: !0 | |
}, | |
numHorizontalGlyphVertices: { | |
configurable: !0 | |
}, | |
numVerticalGlyphVertices: { | |
configurable: !0 | |
}, | |
numIconVertices: { | |
configurable: !0 | |
}, | |
numVerticalIconVertices: { | |
configurable: !0 | |
}, | |
useRuntimeCollisionCircles: { | |
configurable: !0 | |
}, | |
crossTileID: { | |
configurable: !0 | |
}, | |
textBoxScale: { | |
configurable: !0 | |
}, | |
textOffset0: { | |
configurable: !0 | |
}, | |
textOffset1: { | |
configurable: !0 | |
}, | |
collisionCircleDiameter: { | |
configurable: !0 | |
} | |
}; | |
return r.anchorX.get = function() { | |
return this._structArray.int16[this._pos2 + 0] | |
} | |
, | |
r.anchorY.get = function() { | |
return this._structArray.int16[this._pos2 + 1] | |
} | |
, | |
r.rightJustifiedTextSymbolIndex.get = function() { | |
return this._structArray.int16[this._pos2 + 2] | |
} | |
, | |
r.centerJustifiedTextSymbolIndex.get = function() { | |
return this._structArray.int16[this._pos2 + 3] | |
} | |
, | |
r.leftJustifiedTextSymbolIndex.get = function() { | |
return this._structArray.int16[this._pos2 + 4] | |
} | |
, | |
r.verticalPlacedTextSymbolIndex.get = function() { | |
return this._structArray.int16[this._pos2 + 5] | |
} | |
, | |
r.placedIconSymbolIndex.get = function() { | |
return this._structArray.int16[this._pos2 + 6] | |
} | |
, | |
r.verticalPlacedIconSymbolIndex.get = function() { | |
return this._structArray.int16[this._pos2 + 7] | |
} | |
, | |
r.key.get = function() { | |
return this._structArray.uint16[this._pos2 + 8] | |
} | |
, | |
r.textBoxStartIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 9] | |
} | |
, | |
r.textBoxEndIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 10] | |
} | |
, | |
r.verticalTextBoxStartIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 11] | |
} | |
, | |
r.verticalTextBoxEndIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 12] | |
} | |
, | |
r.iconBoxStartIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 13] | |
} | |
, | |
r.iconBoxEndIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 14] | |
} | |
, | |
r.verticalIconBoxStartIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 15] | |
} | |
, | |
r.verticalIconBoxEndIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 16] | |
} | |
, | |
r.featureIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 17] | |
} | |
, | |
r.numHorizontalGlyphVertices.get = function() { | |
return this._structArray.uint16[this._pos2 + 18] | |
} | |
, | |
r.numVerticalGlyphVertices.get = function() { | |
return this._structArray.uint16[this._pos2 + 19] | |
} | |
, | |
r.numIconVertices.get = function() { | |
return this._structArray.uint16[this._pos2 + 20] | |
} | |
, | |
r.numVerticalIconVertices.get = function() { | |
return this._structArray.uint16[this._pos2 + 21] | |
} | |
, | |
r.useRuntimeCollisionCircles.get = function() { | |
return this._structArray.uint16[this._pos2 + 22] | |
} | |
, | |
r.crossTileID.get = function() { | |
return this._structArray.uint32[this._pos4 + 12] | |
} | |
, | |
r.crossTileID.set = function(t) { | |
this._structArray.uint32[this._pos4 + 12] = t | |
} | |
, | |
r.textBoxScale.get = function() { | |
return this._structArray.float32[this._pos4 + 13] | |
} | |
, | |
r.textOffset0.get = function() { | |
return this._structArray.float32[this._pos4 + 14] | |
} | |
, | |
r.textOffset1.get = function() { | |
return this._structArray.float32[this._pos4 + 15] | |
} | |
, | |
r.collisionCircleDiameter.get = function() { | |
return this._structArray.float32[this._pos4 + 16] | |
} | |
, | |
Object.defineProperties(e.prototype, r), | |
e | |
}(An); | |
eo.prototype.size = 68; | |
var ro = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.get = function(t) { | |
return new eo(this,t) | |
} | |
, | |
e | |
}(Gn); | |
Oi("SymbolInstanceArray", ro); | |
var io = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.getoffsetX = function(t) { | |
return this.float32[1 * t + 0] | |
} | |
, | |
e | |
}(Zn); | |
Oi("GlyphOffsetArray", io); | |
var no = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.getx = function(t) { | |
return this.int16[3 * t + 0] | |
} | |
, | |
e.prototype.gety = function(t) { | |
return this.int16[3 * t + 1] | |
} | |
, | |
e.prototype.gettileUnitDistanceFromAnchor = function(t) { | |
return this.int16[3 * t + 2] | |
} | |
, | |
e | |
}(Xn); | |
Oi("SymbolLineVertexArray", no); | |
var oo = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e; | |
var r = { | |
featureIndex: { | |
configurable: !0 | |
}, | |
sourceLayerIndex: { | |
configurable: !0 | |
}, | |
bucketIndex: { | |
configurable: !0 | |
} | |
}; | |
return r.featureIndex.get = function() { | |
return this._structArray.uint32[this._pos4 + 0] | |
} | |
, | |
r.sourceLayerIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 2] | |
} | |
, | |
r.bucketIndex.get = function() { | |
return this._structArray.uint16[this._pos2 + 3] | |
} | |
, | |
Object.defineProperties(e.prototype, r), | |
e | |
}(An); | |
oo.prototype.size = 8; | |
var ao = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.get = function(t) { | |
return new oo(this,t) | |
} | |
, | |
e | |
}(Wn); | |
Oi("FeatureIndexArray", ao); | |
var so = Sn([{ | |
name: "a_pos", | |
components: 2, | |
type: "Int16" | |
}], 4).members | |
, lo = function(t) { | |
void 0 === t && (t = []), | |
this.segments = t | |
}; | |
function uo(t, e) { | |
return 256 * (t = c(Math.floor(t), 0, 255)) + c(Math.floor(e), 0, 255) | |
} | |
lo.prototype.prepareSegment = function(t, e, r, i) { | |
var n = this.segments[this.segments.length - 1]; | |
return t > lo.MAX_VERTEX_ARRAY_LENGTH && E("Max vertices per segment is " + lo.MAX_VERTEX_ARRAY_LENGTH + ": bucket requested " + t), | |
(!n || n.vertexLength + t > lo.MAX_VERTEX_ARRAY_LENGTH || n.sortKey !== i) && (n = { | |
vertexOffset: e.length, | |
primitiveOffset: r.length, | |
vertexLength: 0, | |
primitiveLength: 0 | |
}, | |
void 0 !== i && (n.sortKey = i), | |
this.segments.push(n)), | |
n | |
} | |
, | |
lo.prototype.get = function() { | |
return this.segments | |
} | |
, | |
lo.prototype.destroy = function() { | |
for (var t = 0, e = this.segments; t < e.length; t += 1) { | |
var r = e[t]; | |
for (var i in r.vaos) | |
r.vaos[i].destroy() | |
} | |
} | |
, | |
lo.simpleSegment = function(t, e, r, i) { | |
return new lo([{ | |
vertexOffset: t, | |
primitiveOffset: e, | |
vertexLength: r, | |
primitiveLength: i, | |
vaos: {}, | |
sortKey: 0 | |
}]) | |
} | |
, | |
lo.MAX_VERTEX_ARRAY_LENGTH = Math.pow(2, 16) - 1, | |
Oi("SegmentVector", lo); | |
var co = Sn([{ | |
name: "a_pattern_from", | |
components: 4, | |
type: "Uint16" | |
}, { | |
name: "a_pattern_to", | |
components: 4, | |
type: "Uint16" | |
}, { | |
name: "a_pixel_ratio_from", | |
components: 1, | |
type: "Uint16" | |
}, { | |
name: "a_pixel_ratio_to", | |
components: 1, | |
type: "Uint16" | |
}]) | |
, po = e((function(t) { | |
t.exports = function(t, e) { | |
var r, i, n, o, a, s, l, u; | |
for (i = t.length - (r = 3 & t.length), | |
n = e, | |
a = 3432918353, | |
s = 461845907, | |
u = 0; u < i; ) | |
l = 255 & t.charCodeAt(u) | (255 & t.charCodeAt(++u)) << 8 | (255 & t.charCodeAt(++u)) << 16 | (255 & t.charCodeAt(++u)) << 24, | |
++u, | |
n = 27492 + (65535 & (o = 5 * (65535 & (n = (n ^= l = (65535 & (l = (l = (65535 & l) * a + (((l >>> 16) * a & 65535) << 16) & 4294967295) << 15 | l >>> 17)) * s + (((l >>> 16) * s & 65535) << 16) & 4294967295) << 13 | n >>> 19)) + ((5 * (n >>> 16) & 65535) << 16) & 4294967295)) + ((58964 + (o >>> 16) & 65535) << 16); | |
switch (l = 0, | |
r) { | |
case 3: | |
l ^= (255 & t.charCodeAt(u + 2)) << 16; | |
case 2: | |
l ^= (255 & t.charCodeAt(u + 1)) << 8; | |
case 1: | |
n ^= l = (65535 & (l = (l = (65535 & (l ^= 255 & t.charCodeAt(u))) * a + (((l >>> 16) * a & 65535) << 16) & 4294967295) << 15 | l >>> 17)) * s + (((l >>> 16) * s & 65535) << 16) & 4294967295 | |
} | |
return n ^= t.length, | |
n = 2246822507 * (65535 & (n ^= n >>> 16)) + ((2246822507 * (n >>> 16) & 65535) << 16) & 4294967295, | |
n = 3266489909 * (65535 & (n ^= n >>> 13)) + ((3266489909 * (n >>> 16) & 65535) << 16) & 4294967295, | |
(n ^= n >>> 16) >>> 0 | |
} | |
} | |
)) | |
, ho = e((function(t) { | |
t.exports = function(t, e) { | |
for (var r, i = t.length, n = e ^ i, o = 0; i >= 4; ) | |
r = 1540483477 * (65535 & (r = 255 & t.charCodeAt(o) | (255 & t.charCodeAt(++o)) << 8 | (255 & t.charCodeAt(++o)) << 16 | (255 & t.charCodeAt(++o)) << 24)) + ((1540483477 * (r >>> 16) & 65535) << 16), | |
n = 1540483477 * (65535 & n) + ((1540483477 * (n >>> 16) & 65535) << 16) ^ (r = 1540483477 * (65535 & (r ^= r >>> 24)) + ((1540483477 * (r >>> 16) & 65535) << 16)), | |
i -= 4, | |
++o; | |
switch (i) { | |
case 3: | |
n ^= (255 & t.charCodeAt(o + 2)) << 16; | |
case 2: | |
n ^= (255 & t.charCodeAt(o + 1)) << 8; | |
case 1: | |
n = 1540483477 * (65535 & (n ^= 255 & t.charCodeAt(o))) + ((1540483477 * (n >>> 16) & 65535) << 16) | |
} | |
return n = 1540483477 * (65535 & (n ^= n >>> 13)) + ((1540483477 * (n >>> 16) & 65535) << 16), | |
(n ^= n >>> 15) >>> 0 | |
} | |
} | |
)) | |
, fo = po | |
, mo = ho; | |
fo.murmur3 = po, | |
fo.murmur2 = mo; | |
var yo = function() { | |
this.ids = [], | |
this.positions = [], | |
this.indexed = !1 | |
}; | |
yo.prototype.add = function(t, e, r, i) { | |
this.ids.push(vo(t)), | |
this.positions.push(e, r, i) | |
} | |
, | |
yo.prototype.getPositions = function(t) { | |
for (var e = vo(t), r = 0, i = this.ids.length - 1; r < i; ) { | |
var n = r + i >> 1; | |
this.ids[n] >= e ? i = n : r = n + 1 | |
} | |
for (var o = []; this.ids[r] === e; ) | |
o.push({ | |
index: this.positions[3 * r], | |
start: this.positions[3 * r + 1], | |
end: this.positions[3 * r + 2] | |
}), | |
r++; | |
return o | |
} | |
, | |
yo.serialize = function(t, e) { | |
var r = new Float64Array(t.ids) | |
, i = new Uint32Array(t.positions); | |
return function t(e, r, i, n) { | |
for (; i < n; ) { | |
for (var o = e[i + n >> 1], a = i - 1, s = n + 1; ; ) { | |
do { | |
a++ | |
} while (e[a] < o); | |
do { | |
s-- | |
} while (e[s] > o); | |
if (a >= s) | |
break; | |
_o(e, a, s), | |
_o(r, 3 * a, 3 * s), | |
_o(r, 3 * a + 1, 3 * s + 1), | |
_o(r, 3 * a + 2, 3 * s + 2) | |
} | |
s - i < n - s ? (t(e, r, i, s), | |
i = s + 1) : (t(e, r, s + 1, n), | |
n = s) | |
} | |
}(r, i, 0, r.length - 1), | |
e && e.push(r.buffer, i.buffer), | |
{ | |
ids: r, | |
positions: i | |
} | |
} | |
, | |
yo.deserialize = function(t) { | |
var e = new yo; | |
return e.ids = t.ids, | |
e.positions = t.positions, | |
e.indexed = !0, | |
e | |
} | |
; | |
var go = Math.pow(2, 53) - 1; | |
function vo(t) { | |
var e = +t; | |
return !isNaN(e) && e <= go ? e : fo(String(t)) | |
} | |
function _o(t, e, r) { | |
var i = t[e]; | |
t[e] = t[r], | |
t[r] = i | |
} | |
Oi("FeaturePositionMap", yo); | |
var xo = function(t, e) { | |
this.gl = t.gl, | |
this.location = e | |
} | |
, bo = function(t) { | |
function e(e, r) { | |
t.call(this, e, r), | |
this.current = 0 | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.set = function(t) { | |
this.current !== t && (this.current = t, | |
this.gl.uniform1i(this.location, t)) | |
} | |
, | |
e | |
}(xo) | |
, wo = function(t) { | |
function e(e, r) { | |
t.call(this, e, r), | |
this.current = 0 | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.set = function(t) { | |
this.current !== t && (this.current = t, | |
this.gl.uniform1f(this.location, t)) | |
} | |
, | |
e | |
}(xo) | |
, Eo = function(t) { | |
function e(e, r) { | |
t.call(this, e, r), | |
this.current = [0, 0] | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.set = function(t) { | |
t[0] === this.current[0] && t[1] === this.current[1] || (this.current = t, | |
this.gl.uniform2f(this.location, t[0], t[1])) | |
} | |
, | |
e | |
}(xo) | |
, Co = function(t) { | |
function e(e, r) { | |
t.call(this, e, r), | |
this.current = [0, 0, 0] | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.set = function(t) { | |
t[0] === this.current[0] && t[1] === this.current[1] && t[2] === this.current[2] || (this.current = t, | |
this.gl.uniform3f(this.location, t[0], t[1], t[2])) | |
} | |
, | |
e | |
}(xo) | |
, Ao = function(t) { | |
function e(e, r) { | |
t.call(this, e, r), | |
this.current = [0, 0, 0, 0] | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.set = function(t) { | |
t[0] === this.current[0] && t[1] === this.current[1] && t[2] === this.current[2] && t[3] === this.current[3] || (this.current = t, | |
this.gl.uniform4f(this.location, t[0], t[1], t[2], t[3])) | |
} | |
, | |
e | |
}(xo) | |
, zo = function(t) { | |
function e(e, r) { | |
t.call(this, e, r), | |
this.current = ee.transparent | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.set = function(t) { | |
t.r === this.current.r && t.g === this.current.g && t.b === this.current.b && t.a === this.current.a || (this.current = t, | |
this.gl.uniform4f(this.location, t.r, t.g, t.b, t.a)) | |
} | |
, | |
e | |
}(xo) | |
, So = new Float32Array(16) | |
, ko = function(t) { | |
function e(e, r) { | |
t.call(this, e, r), | |
this.current = So | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.set = function(t) { | |
if (t[12] !== this.current[12] || t[0] !== this.current[0]) | |
return this.current = t, | |
void this.gl.uniformMatrix4fv(this.location, !1, t); | |
for (var e = 1; e < 16; e++) | |
if (t[e] !== this.current[e]) { | |
this.current = t, | |
this.gl.uniformMatrix4fv(this.location, !1, t); | |
break | |
} | |
} | |
, | |
e | |
}(xo); | |
function To(t) { | |
return [uo(255 * t.r, 255 * t.g), uo(255 * t.b, 255 * t.a)] | |
} | |
var Do = function(t, e, r) { | |
this.value = t, | |
this.uniformNames = e.map((function(t) { | |
return "u_" + t | |
} | |
)), | |
this.type = r | |
}; | |
Do.prototype.setUniform = function(t, e, r) { | |
t.set(r.constantOr(this.value)) | |
} | |
, | |
Do.prototype.getBinding = function(t, e, r) { | |
return "color" === this.type ? new zo(t,e) : new wo(t,e) | |
} | |
; | |
var Io = function(t, e) { | |
this.uniformNames = e.map((function(t) { | |
return "u_" + t | |
} | |
)), | |
this.patternFrom = null, | |
this.patternTo = null, | |
this.pixelRatioFrom = 1, | |
this.pixelRatioTo = 1 | |
}; | |
Io.prototype.setConstantPatternPositions = function(t, e) { | |
this.pixelRatioFrom = e.pixelRatio, | |
this.pixelRatioTo = t.pixelRatio, | |
this.patternFrom = e.tlbr, | |
this.patternTo = t.tlbr | |
} | |
, | |
Io.prototype.setUniform = function(t, e, r, i) { | |
var n = "u_pattern_to" === i ? this.patternTo : "u_pattern_from" === i ? this.patternFrom : "u_pixel_ratio_to" === i ? this.pixelRatioTo : "u_pixel_ratio_from" === i ? this.pixelRatioFrom : null; | |
n && t.set(n) | |
} | |
, | |
Io.prototype.getBinding = function(t, e, r) { | |
return "u_pattern" === r.substr(0, 9) ? new Ao(t,e) : new wo(t,e) | |
} | |
; | |
var Fo = function(t, e, r, i) { | |
this.expression = t, | |
this.type = r, | |
this.maxValue = 0, | |
this.paintVertexAttributes = e.map((function(t) { | |
return { | |
name: "a_" + t, | |
type: "Float32", | |
components: "color" === r ? 2 : 1, | |
offset: 0 | |
} | |
} | |
)), | |
this.paintVertexArray = new i | |
}; | |
Fo.prototype.populatePaintArray = function(t, e, r, i, n) { | |
var o = this.paintVertexArray.length | |
, a = this.expression.evaluate(new ln(0), e, {}, i, [], n); | |
this.paintVertexArray.resize(t), | |
this._setPaintValue(o, t, a) | |
} | |
, | |
Fo.prototype.updatePaintArray = function(t, e, r, i) { | |
var n = this.expression.evaluate({ | |
zoom: 0 | |
}, r, i); | |
this._setPaintValue(t, e, n) | |
} | |
, | |
Fo.prototype._setPaintValue = function(t, e, r) { | |
if ("color" === this.type) | |
for (var i = To(r), n = t; n < e; n++) | |
this.paintVertexArray.emplace(n, i[0], i[1]); | |
else { | |
for (var o = t; o < e; o++) | |
this.paintVertexArray.emplace(o, r); | |
this.maxValue = Math.max(this.maxValue, Math.abs(r)) | |
} | |
} | |
, | |
Fo.prototype.upload = function(t) { | |
this.paintVertexArray && this.paintVertexArray.arrayBuffer && (this.paintVertexBuffer && this.paintVertexBuffer.buffer ? this.paintVertexBuffer.updateData(this.paintVertexArray) : this.paintVertexBuffer = t.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent)) | |
} | |
, | |
Fo.prototype.destroy = function() { | |
this.paintVertexBuffer && this.paintVertexBuffer.destroy() | |
} | |
; | |
var Bo = function(t, e, r, i, n, o) { | |
this.expression = t, | |
this.uniformNames = e.map((function(t) { | |
return "u_" + t + "_t" | |
} | |
)), | |
this.type = r, | |
this.useIntegerZoom = i, | |
this.zoom = n, | |
this.maxValue = 0, | |
this.paintVertexAttributes = e.map((function(t) { | |
return { | |
name: "a_" + t, | |
type: "Float32", | |
components: "color" === r ? 4 : 2, | |
offset: 0 | |
} | |
} | |
)), | |
this.paintVertexArray = new o | |
}; | |
Bo.prototype.populatePaintArray = function(t, e, r, i, n) { | |
var o = this.expression.evaluate(new ln(this.zoom), e, {}, i, [], n) | |
, a = this.expression.evaluate(new ln(this.zoom + 1), e, {}, i, [], n) | |
, s = this.paintVertexArray.length; | |
this.paintVertexArray.resize(t), | |
this._setPaintValue(s, t, o, a) | |
} | |
, | |
Bo.prototype.updatePaintArray = function(t, e, r, i) { | |
var n = this.expression.evaluate({ | |
zoom: this.zoom | |
}, r, i) | |
, o = this.expression.evaluate({ | |
zoom: this.zoom + 1 | |
}, r, i); | |
this._setPaintValue(t, e, n, o) | |
} | |
, | |
Bo.prototype._setPaintValue = function(t, e, r, i) { | |
if ("color" === this.type) | |
for (var n = To(r), o = To(i), a = t; a < e; a++) | |
this.paintVertexArray.emplace(a, n[0], n[1], o[0], o[1]); | |
else { | |
for (var s = t; s < e; s++) | |
this.paintVertexArray.emplace(s, r, i); | |
this.maxValue = Math.max(this.maxValue, Math.abs(r), Math.abs(i)) | |
} | |
} | |
, | |
Bo.prototype.upload = function(t) { | |
this.paintVertexArray && this.paintVertexArray.arrayBuffer && (this.paintVertexBuffer && this.paintVertexBuffer.buffer ? this.paintVertexBuffer.updateData(this.paintVertexArray) : this.paintVertexBuffer = t.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent)) | |
} | |
, | |
Bo.prototype.destroy = function() { | |
this.paintVertexBuffer && this.paintVertexBuffer.destroy() | |
} | |
, | |
Bo.prototype.setUniform = function(t, e) { | |
var r = this.useIntegerZoom ? Math.floor(e.zoom) : e.zoom | |
, i = c(this.expression.interpolationFactor(r, this.zoom, this.zoom + 1), 0, 1); | |
t.set(i) | |
} | |
, | |
Bo.prototype.getBinding = function(t, e, r) { | |
return new wo(t,e) | |
} | |
; | |
var Po = function(t, e, r, i, n, o) { | |
this.expression = t, | |
this.type = e, | |
this.useIntegerZoom = r, | |
this.zoom = i, | |
this.layerId = o, | |
this.zoomInPaintVertexArray = new n, | |
this.zoomOutPaintVertexArray = new n | |
}; | |
Po.prototype.populatePaintArray = function(t, e, r) { | |
var i = this.zoomInPaintVertexArray.length; | |
this.zoomInPaintVertexArray.resize(t), | |
this.zoomOutPaintVertexArray.resize(t), | |
this._setPaintValues(i, t, e.patterns && e.patterns[this.layerId], r) | |
} | |
, | |
Po.prototype.updatePaintArray = function(t, e, r, i, n) { | |
this._setPaintValues(t, e, r.patterns && r.patterns[this.layerId], n) | |
} | |
, | |
Po.prototype._setPaintValues = function(t, e, r, i) { | |
if (i && r) { | |
var n = i[r.min] | |
, o = i[r.mid] | |
, a = i[r.max]; | |
if (n && o && a) | |
for (var s = t; s < e; s++) | |
this.zoomInPaintVertexArray.emplace(s, o.tl[0], o.tl[1], o.br[0], o.br[1], n.tl[0], n.tl[1], n.br[0], n.br[1], o.pixelRatio, n.pixelRatio), | |
this.zoomOutPaintVertexArray.emplace(s, o.tl[0], o.tl[1], o.br[0], o.br[1], a.tl[0], a.tl[1], a.br[0], a.br[1], o.pixelRatio, a.pixelRatio) | |
} | |
} | |
, | |
Po.prototype.upload = function(t) { | |
this.zoomInPaintVertexArray && this.zoomInPaintVertexArray.arrayBuffer && this.zoomOutPaintVertexArray && this.zoomOutPaintVertexArray.arrayBuffer && (this.zoomInPaintVertexBuffer = t.createVertexBuffer(this.zoomInPaintVertexArray, co.members, this.expression.isStateDependent), | |
this.zoomOutPaintVertexBuffer = t.createVertexBuffer(this.zoomOutPaintVertexArray, co.members, this.expression.isStateDependent)) | |
} | |
, | |
Po.prototype.destroy = function() { | |
this.zoomOutPaintVertexBuffer && this.zoomOutPaintVertexBuffer.destroy(), | |
this.zoomInPaintVertexBuffer && this.zoomInPaintVertexBuffer.destroy() | |
} | |
; | |
var Mo = function(t, e, r) { | |
this.binders = {}, | |
this._buffers = []; | |
var i = []; | |
for (var n in t.paint._values) | |
if (r(n)) { | |
var o = t.paint.get(n); | |
if (o instanceof mn && Pr(o.property.specification)) { | |
var a = Ro(n, t.type) | |
, s = o.value | |
, l = o.property.specification.type | |
, u = o.property.useIntegerZoom | |
, c = o.property.specification["property-type"] | |
, p = "cross-faded" === c || "cross-faded-data-driven" === c; | |
if ("constant" === s.kind) | |
this.binders[n] = p ? new Io(s.value,a) : new Do(s.value,a,l), | |
i.push("/u_" + n); | |
else if ("source" === s.kind || p) { | |
var h = Oo(n, l, "source"); | |
this.binders[n] = p ? new Po(s,l,u,e,h,t.id) : new Fo(s,a,l,h), | |
i.push("/a_" + n) | |
} else { | |
var f = Oo(n, l, "composite"); | |
this.binders[n] = new Bo(s,a,l,u,e,f), | |
i.push("/z_" + n) | |
} | |
} | |
} | |
this.cacheKey = i.sort().join("") | |
}; | |
Mo.prototype.getMaxValue = function(t) { | |
var e = this.binders[t]; | |
return e instanceof Fo || e instanceof Bo ? e.maxValue : 0 | |
} | |
, | |
Mo.prototype.populatePaintArrays = function(t, e, r, i, n) { | |
for (var o in this.binders) { | |
var a = this.binders[o]; | |
(a instanceof Fo || a instanceof Bo || a instanceof Po) && a.populatePaintArray(t, e, r, i, n) | |
} | |
} | |
, | |
Mo.prototype.setConstantPatternPositions = function(t, e) { | |
for (var r in this.binders) { | |
var i = this.binders[r]; | |
i instanceof Io && i.setConstantPatternPositions(t, e) | |
} | |
} | |
, | |
Mo.prototype.updatePaintArrays = function(t, e, r, i, n) { | |
var o = !1; | |
for (var a in t) | |
for (var s = 0, l = e.getPositions(a); s < l.length; s += 1) { | |
var u = l[s] | |
, c = r.feature(u.index); | |
for (var p in this.binders) { | |
var h = this.binders[p]; | |
if ((h instanceof Fo || h instanceof Bo || h instanceof Po) && !0 === h.expression.isStateDependent) { | |
var f = i.paint.get(p); | |
h.expression = f.value, | |
h.updatePaintArray(u.start, u.end, c, t[a], n), | |
o = !0 | |
} | |
} | |
} | |
return o | |
} | |
, | |
Mo.prototype.defines = function() { | |
var t = []; | |
for (var e in this.binders) { | |
var r = this.binders[e]; | |
(r instanceof Do || r instanceof Io) && t.push.apply(t, r.uniformNames.map((function(t) { | |
return "#define HAS_UNIFORM_" + t | |
} | |
))) | |
} | |
return t | |
} | |
, | |
Mo.prototype.getBinderAttributes = function() { | |
var t = []; | |
for (var e in this.binders) { | |
var r = this.binders[e]; | |
if (r instanceof Fo || r instanceof Bo) | |
for (var i = 0; i < r.paintVertexAttributes.length; i++) | |
t.push(r.paintVertexAttributes[i].name); | |
else if (r instanceof Po) | |
for (var n = 0; n < co.members.length; n++) | |
t.push(co.members[n].name) | |
} | |
return t | |
} | |
, | |
Mo.prototype.getBinderUniforms = function() { | |
var t = []; | |
for (var e in this.binders) { | |
var r = this.binders[e]; | |
if (r instanceof Do || r instanceof Io || r instanceof Bo) | |
for (var i = 0, n = r.uniformNames; i < n.length; i += 1) | |
t.push(n[i]) | |
} | |
return t | |
} | |
, | |
Mo.prototype.getPaintVertexBuffers = function() { | |
return this._buffers | |
} | |
, | |
Mo.prototype.getUniforms = function(t, e) { | |
var r = []; | |
for (var i in this.binders) { | |
var n = this.binders[i]; | |
if (n instanceof Do || n instanceof Io || n instanceof Bo) | |
for (var o = 0, a = n.uniformNames; o < a.length; o += 1) { | |
var s = a[o]; | |
if (e[s]) { | |
var l = n.getBinding(t, e[s], s); | |
r.push({ | |
name: s, | |
property: i, | |
binding: l | |
}) | |
} | |
} | |
} | |
return r | |
} | |
, | |
Mo.prototype.setUniforms = function(t, e, r, i) { | |
for (var n = 0, o = e; n < o.length; n += 1) { | |
var a = o[n] | |
, s = a.name | |
, l = a.property; | |
this.binders[l].setUniform(a.binding, i, r.get(l), s) | |
} | |
} | |
, | |
Mo.prototype.updatePaintBuffers = function(t) { | |
for (var e in this._buffers = [], | |
this.binders) { | |
var r = this.binders[e]; | |
if (t && r instanceof Po) { | |
var i = 2 === t.fromScale ? r.zoomInPaintVertexBuffer : r.zoomOutPaintVertexBuffer; | |
i && this._buffers.push(i) | |
} else | |
(r instanceof Fo || r instanceof Bo) && r.paintVertexBuffer && this._buffers.push(r.paintVertexBuffer) | |
} | |
} | |
, | |
Mo.prototype.upload = function(t) { | |
for (var e in this.binders) { | |
var r = this.binders[e]; | |
(r instanceof Fo || r instanceof Bo || r instanceof Po) && r.upload(t) | |
} | |
this.updatePaintBuffers() | |
} | |
, | |
Mo.prototype.destroy = function() { | |
for (var t in this.binders) { | |
var e = this.binders[t]; | |
(e instanceof Fo || e instanceof Bo || e instanceof Po) && e.destroy() | |
} | |
} | |
; | |
var Lo = function(t, e, r) { | |
void 0 === r && (r = function() { | |
return !0 | |
} | |
), | |
this.programConfigurations = {}; | |
for (var i = 0, n = t; i < n.length; i += 1) { | |
var o = n[i]; | |
this.programConfigurations[o.id] = new Mo(o,e,r) | |
} | |
this.needsUpload = !1, | |
this._featureMap = new yo, | |
this._bufferOffset = 0 | |
}; | |
function Ro(t, e) { | |
return { | |
"text-opacity": ["opacity"], | |
"icon-opacity": ["opacity"], | |
"text-color": ["fill_color"], | |
"icon-color": ["fill_color"], | |
"text-halo-color": ["halo_color"], | |
"icon-halo-color": ["halo_color"], | |
"text-halo-blur": ["halo_blur"], | |
"icon-halo-blur": ["halo_blur"], | |
"text-halo-width": ["halo_width"], | |
"icon-halo-width": ["halo_width"], | |
"line-gap-width": ["gapwidth"], | |
"line-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"], | |
"fill-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"], | |
"fill-extrusion-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"] | |
}[t] || [t.replace(e + "-", "").replace(/-/g, "_")] | |
} | |
function Oo(t, e, r) { | |
var i = { | |
color: { | |
source: Bn, | |
composite: Jn | |
}, | |
number: { | |
source: Zn, | |
composite: Bn | |
} | |
} | |
, n = function(t) { | |
return { | |
"line-pattern": { | |
source: Pn, | |
composite: Pn | |
}, | |
"fill-pattern": { | |
source: Pn, | |
composite: Pn | |
}, | |
"fill-extrusion-pattern": { | |
source: Pn, | |
composite: Pn | |
} | |
}[t] | |
}(t); | |
return n && n[r] || i[e][r] | |
} | |
Lo.prototype.populatePaintArrays = function(t, e, r, i, n, o) { | |
for (var a in this.programConfigurations) | |
this.programConfigurations[a].populatePaintArrays(t, e, i, n, o); | |
void 0 !== e.id && this._featureMap.add(e.id, r, this._bufferOffset, t), | |
this._bufferOffset = t, | |
this.needsUpload = !0 | |
} | |
, | |
Lo.prototype.updatePaintArrays = function(t, e, r, i) { | |
for (var n = 0, o = r; n < o.length; n += 1) { | |
var a = o[n]; | |
this.needsUpload = this.programConfigurations[a.id].updatePaintArrays(t, this._featureMap, e, a, i) || this.needsUpload | |
} | |
} | |
, | |
Lo.prototype.get = function(t) { | |
return this.programConfigurations[t] | |
} | |
, | |
Lo.prototype.upload = function(t) { | |
if (this.needsUpload) { | |
for (var e in this.programConfigurations) | |
this.programConfigurations[e].upload(t); | |
this.needsUpload = !1 | |
} | |
} | |
, | |
Lo.prototype.destroy = function() { | |
for (var t in this.programConfigurations) | |
this.programConfigurations[t].destroy() | |
} | |
, | |
Oi("ConstantBinder", Do), | |
Oi("CrossFadedConstantBinder", Io), | |
Oi("SourceExpressionBinder", Fo), | |
Oi("CrossFadedCompositeBinder", Po), | |
Oi("CompositeExpressionBinder", Bo), | |
Oi("ProgramConfiguration", Mo, { | |
omit: ["_buffers"] | |
}), | |
Oi("ProgramConfigurationSet", Lo); | |
var Uo = Math.pow(2, 14) - 1 | |
, Vo = -Uo - 1; | |
function jo(t) { | |
for (var e = 8192 / t.extent, r = t.loadGeometry(), i = 0; i < r.length; i++) | |
for (var n = r[i], o = 0; o < n.length; o++) { | |
var a = n[o] | |
, s = Math.round(a.x * e) | |
, l = Math.round(a.y * e); | |
a.x = c(s, Vo, Uo), | |
a.y = c(l, Vo, Uo), | |
(s < a.x || s > a.x + 1 || l < a.y || l > a.y + 1) && E("Geometry exceeds allowed extent, reduce your vector tile buffer size") | |
} | |
return r | |
} | |
function No(t, e) { | |
return { | |
type: t.type, | |
id: t.id, | |
properties: t.properties, | |
geometry: e ? jo(t) : [] | |
} | |
} | |
function qo(t, e, r, i, n) { | |
t.emplaceBack(2 * e + (i + 1) / 2, 2 * r + (n + 1) / 2) | |
} | |
var Go = function(t) { | |
this.zoom = t.zoom, | |
this.overscaling = t.overscaling, | |
this.layers = t.layers, | |
this.layerIds = this.layers.map((function(t) { | |
return t.id | |
} | |
)), | |
this.index = t.index, | |
this.hasPattern = !1, | |
this.layoutVertexArray = new Tn, | |
this.indexArray = new Nn, | |
this.segments = new lo, | |
this.programConfigurations = new Lo(t.layers,t.zoom), | |
this.stateDependentLayerIds = this.layers.filter((function(t) { | |
return t.isStateDependent() | |
} | |
)).map((function(t) { | |
return t.id | |
} | |
)) | |
}; | |
function Zo(t, e) { | |
for (var r = 0; r < t.length; r++) | |
if (ta(e, t[r])) | |
return !0; | |
for (var i = 0; i < e.length; i++) | |
if (ta(t, e[i])) | |
return !0; | |
return !!Ko(t, e) | |
} | |
function Xo(t, e, r) { | |
return !!ta(t, e) || !!Yo(e, t, r) | |
} | |
function Wo(t, e) { | |
if (1 === t.length) | |
return Qo(e, t[0]); | |
for (var r = 0; r < e.length; r++) | |
for (var i = e[r], n = 0; n < i.length; n++) | |
if (ta(t, i[n])) | |
return !0; | |
for (var o = 0; o < t.length; o++) | |
if (Qo(e, t[o])) | |
return !0; | |
for (var a = 0; a < e.length; a++) | |
if (Ko(t, e[a])) | |
return !0; | |
return !1 | |
} | |
function Ho(t, e, r) { | |
if (t.length > 1) { | |
if (Ko(t, e)) | |
return !0; | |
for (var i = 0; i < e.length; i++) | |
if (Yo(e[i], t, r)) | |
return !0 | |
} | |
for (var n = 0; n < t.length; n++) | |
if (Yo(t[n], e, r)) | |
return !0; | |
return !1 | |
} | |
function Ko(t, e) { | |
if (0 === t.length || 0 === e.length) | |
return !1; | |
for (var r = 0; r < t.length - 1; r++) | |
for (var i = t[r], n = t[r + 1], o = 0; o < e.length - 1; o++) | |
if (Jo(i, n, e[o], e[o + 1])) | |
return !0; | |
return !1 | |
} | |
function Jo(t, e, r, i) { | |
return C(t, r, i) !== C(e, r, i) && C(t, e, r) !== C(t, e, i) | |
} | |
function Yo(t, e, r) { | |
var i = r * r; | |
if (1 === e.length) | |
return t.distSqr(e[0]) < i; | |
for (var n = 1; n < e.length; n++) | |
if ($o(t, e[n - 1], e[n]) < i) | |
return !0; | |
return !1 | |
} | |
function $o(t, e, r) { | |
var i = e.distSqr(r); | |
if (0 === i) | |
return t.distSqr(e); | |
var n = ((t.x - e.x) * (r.x - e.x) + (t.y - e.y) * (r.y - e.y)) / i; | |
return t.distSqr(n < 0 ? e : n > 1 ? r : r.sub(e)._mult(n)._add(e)) | |
} | |
function Qo(t, e) { | |
for (var r, i, n, o = !1, a = 0; a < t.length; a++) | |
for (var s = 0, l = (r = t[a]).length - 1; s < r.length; l = s++) | |
(i = r[s]).y > e.y != (n = r[l]).y > e.y && e.x < (n.x - i.x) * (e.y - i.y) / (n.y - i.y) + i.x && (o = !o); | |
return o | |
} | |
function ta(t, e) { | |
for (var r = !1, i = 0, n = t.length - 1; i < t.length; n = i++) { | |
var o = t[i] | |
, a = t[n]; | |
o.y > e.y != a.y > e.y && e.x < (a.x - o.x) * (e.y - o.y) / (a.y - o.y) + o.x && (r = !r) | |
} | |
return r | |
} | |
function ea(t, e, r) { | |
var i = r[0] | |
, n = r[2]; | |
if (t.x < i.x && e.x < i.x || t.x > n.x && e.x > n.x || t.y < i.y && e.y < i.y || t.y > n.y && e.y > n.y) | |
return !1; | |
var o = C(t, e, r[0]); | |
return o !== C(t, e, r[1]) || o !== C(t, e, r[2]) || o !== C(t, e, r[3]) | |
} | |
function ra(t, e, r) { | |
var i = e.paint.get(t).value; | |
return "constant" === i.kind ? i.value : r.programConfigurations.get(e.id).getMaxValue(t) | |
} | |
function ia(t) { | |
return Math.sqrt(t[0] * t[0] + t[1] * t[1]) | |
} | |
function na(t, e, r, i, o) { | |
if (!e[0] && !e[1]) | |
return t; | |
var a = n.convert(e)._mult(o); | |
"viewport" === r && a._rotate(-i); | |
for (var s = [], l = 0; l < t.length; l++) | |
s.push(t[l].sub(a)); | |
return s | |
} | |
Go.prototype.populate = function(t, e, r) { | |
var i = this.layers[0] | |
, n = [] | |
, o = null | |
, a = !1; | |
"circle" === i.type && (a = !(o = i.layout.get("circle-sort-key")).isConstant()); | |
for (var s = 0, l = t; s < l.length; s += 1) { | |
var u = l[s] | |
, c = u.feature | |
, p = u.id | |
, h = u.index | |
, f = u.sourceLayerIndex | |
, d = this.layers[0]._featureFilter.needGeometry | |
, m = No(c, d); | |
if (this.layers[0]._featureFilter.filter(new ln(this.zoom), m, r)) { | |
var y = a ? o.evaluate(m, {}, r) : void 0 | |
, g = { | |
id: p, | |
properties: c.properties, | |
type: c.type, | |
sourceLayerIndex: f, | |
index: h, | |
geometry: d ? m.geometry : jo(c), | |
patterns: {}, | |
sortKey: y | |
}; | |
n.push(g) | |
} | |
} | |
a && n.sort((function(t, e) { | |
return t.sortKey - e.sortKey | |
} | |
)); | |
for (var v = 0, _ = n; v < _.length; v += 1) { | |
var x = _[v] | |
, b = x.geometry | |
, w = x.index | |
, E = x.sourceLayerIndex | |
, C = t[w].feature; | |
this.addFeature(x, b, w, r), | |
e.featureIndex.insert(C, b, w, E, this.index) | |
} | |
} | |
, | |
Go.prototype.update = function(t, e, r) { | |
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t, e, this.stateDependentLayers, r) | |
} | |
, | |
Go.prototype.isEmpty = function() { | |
return 0 === this.layoutVertexArray.length | |
} | |
, | |
Go.prototype.uploadPending = function() { | |
return !this.uploaded || this.programConfigurations.needsUpload | |
} | |
, | |
Go.prototype.upload = function(t) { | |
this.uploaded || (this.layoutVertexBuffer = t.createVertexBuffer(this.layoutVertexArray, so), | |
this.indexBuffer = t.createIndexBuffer(this.indexArray)), | |
this.programConfigurations.upload(t), | |
this.uploaded = !0 | |
} | |
, | |
Go.prototype.destroy = function() { | |
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), | |
this.indexBuffer.destroy(), | |
this.programConfigurations.destroy(), | |
this.segments.destroy()) | |
} | |
, | |
Go.prototype.addFeature = function(t, e, r, i) { | |
for (var n = 0, o = e; n < o.length; n += 1) | |
for (var a = 0, s = o[n]; a < s.length; a += 1) { | |
var l = s[a] | |
, u = l.x | |
, c = l.y; | |
if (!(u < 0 || u >= 8192 || c < 0 || c >= 8192)) { | |
var p = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray, t.sortKey) | |
, h = p.vertexLength; | |
qo(this.layoutVertexArray, u, c, -1, -1), | |
qo(this.layoutVertexArray, u, c, 1, -1), | |
qo(this.layoutVertexArray, u, c, 1, 1), | |
qo(this.layoutVertexArray, u, c, -1, 1), | |
this.indexArray.emplaceBack(h, h + 1, h + 2), | |
this.indexArray.emplaceBack(h, h + 3, h + 2), | |
p.vertexLength += 4, | |
p.primitiveLength += 2 | |
} | |
} | |
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t, r, {}, i) | |
} | |
, | |
Oi("CircleBucket", Go, { | |
omit: ["layers"] | |
}); | |
var oa = new wn({ | |
"circle-sort-key": new vn(Dt.layout_circle["circle-sort-key"]) | |
}) | |
, aa = { | |
paint: new wn({ | |
"circle-radius": new vn(Dt.paint_circle["circle-radius"]), | |
"circle-color": new vn(Dt.paint_circle["circle-color"]), | |
"circle-blur": new vn(Dt.paint_circle["circle-blur"]), | |
"circle-opacity": new vn(Dt.paint_circle["circle-opacity"]), | |
"circle-translate": new gn(Dt.paint_circle["circle-translate"]), | |
"circle-translate-anchor": new gn(Dt.paint_circle["circle-translate-anchor"]), | |
"circle-pitch-scale": new gn(Dt.paint_circle["circle-pitch-scale"]), | |
"circle-pitch-alignment": new gn(Dt.paint_circle["circle-pitch-alignment"]), | |
"circle-stroke-width": new vn(Dt.paint_circle["circle-stroke-width"]), | |
"circle-stroke-color": new vn(Dt.paint_circle["circle-stroke-color"]), | |
"circle-stroke-opacity": new vn(Dt.paint_circle["circle-stroke-opacity"]) | |
}), | |
layout: oa | |
} | |
, sa = "undefined" != typeof Float32Array ? Float32Array : Array; | |
function la(t) { | |
return t[0] = 1, | |
t[1] = 0, | |
t[2] = 0, | |
t[3] = 0, | |
t[4] = 0, | |
t[5] = 1, | |
t[6] = 0, | |
t[7] = 0, | |
t[8] = 0, | |
t[9] = 0, | |
t[10] = 1, | |
t[11] = 0, | |
t[12] = 0, | |
t[13] = 0, | |
t[14] = 0, | |
t[15] = 1, | |
t | |
} | |
function ua(t, e, r) { | |
var i = e[0] | |
, n = e[1] | |
, o = e[2] | |
, a = e[3] | |
, s = e[4] | |
, l = e[5] | |
, u = e[6] | |
, c = e[7] | |
, p = e[8] | |
, h = e[9] | |
, f = e[10] | |
, d = e[11] | |
, m = e[12] | |
, y = e[13] | |
, g = e[14] | |
, v = e[15] | |
, _ = r[0] | |
, x = r[1] | |
, b = r[2] | |
, w = r[3]; | |
return t[0] = _ * i + x * s + b * p + w * m, | |
t[1] = _ * n + x * l + b * h + w * y, | |
t[2] = _ * o + x * u + b * f + w * g, | |
t[3] = _ * a + x * c + b * d + w * v, | |
t[4] = (_ = r[4]) * i + (x = r[5]) * s + (b = r[6]) * p + (w = r[7]) * m, | |
t[5] = _ * n + x * l + b * h + w * y, | |
t[6] = _ * o + x * u + b * f + w * g, | |
t[7] = _ * a + x * c + b * d + w * v, | |
t[8] = (_ = r[8]) * i + (x = r[9]) * s + (b = r[10]) * p + (w = r[11]) * m, | |
t[9] = _ * n + x * l + b * h + w * y, | |
t[10] = _ * o + x * u + b * f + w * g, | |
t[11] = _ * a + x * c + b * d + w * v, | |
t[12] = (_ = r[12]) * i + (x = r[13]) * s + (b = r[14]) * p + (w = r[15]) * m, | |
t[13] = _ * n + x * l + b * h + w * y, | |
t[14] = _ * o + x * u + b * f + w * g, | |
t[15] = _ * a + x * c + b * d + w * v, | |
t | |
} | |
Math.hypot || (Math.hypot = function() { | |
for (var t = arguments, e = 0, r = arguments.length; r--; ) | |
e += t[r] * t[r]; | |
return Math.sqrt(e) | |
} | |
); | |
var ca, pa = ua; | |
function ha(t, e, r) { | |
var i = e[0] | |
, n = e[1] | |
, o = e[2] | |
, a = e[3]; | |
return t[0] = r[0] * i + r[4] * n + r[8] * o + r[12] * a, | |
t[1] = r[1] * i + r[5] * n + r[9] * o + r[13] * a, | |
t[2] = r[2] * i + r[6] * n + r[10] * o + r[14] * a, | |
t[3] = r[3] * i + r[7] * n + r[11] * o + r[15] * a, | |
t | |
} | |
ca = new sa(3), | |
sa != Float32Array && (ca[0] = 0, | |
ca[1] = 0, | |
ca[2] = 0), | |
function() { | |
var t = new sa(4); | |
sa != Float32Array && (t[0] = 0, | |
t[1] = 0, | |
t[2] = 0, | |
t[3] = 0) | |
}(); | |
var fa = (function() { | |
var t = new sa(2); | |
sa != Float32Array && (t[0] = 0, | |
t[1] = 0) | |
}(), | |
function(t) { | |
function e(e) { | |
t.call(this, e, aa) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.createBucket = function(t) { | |
return new Go(t) | |
} | |
, | |
e.prototype.queryRadius = function(t) { | |
var e = t; | |
return ra("circle-radius", this, e) + ra("circle-stroke-width", this, e) + ia(this.paint.get("circle-translate")) | |
} | |
, | |
e.prototype.queryIntersectsFeature = function(t, e, r, i, n, o, a, s) { | |
for (var l = na(t, this.paint.get("circle-translate"), this.paint.get("circle-translate-anchor"), o.angle, a), u = this.paint.get("circle-radius").evaluate(e, r) + this.paint.get("circle-stroke-width").evaluate(e, r), c = "map" === this.paint.get("circle-pitch-alignment"), p = c ? l : function(t, e) { | |
return t.map((function(t) { | |
return da(t, e) | |
} | |
)) | |
}(l, s), h = c ? u * a : u, f = 0, d = i; f < d.length; f += 1) | |
for (var m = 0, y = d[f]; m < y.length; m += 1) { | |
var g = y[m] | |
, v = c ? g : da(g, s) | |
, _ = h | |
, x = ha([], [g.x, g.y, 0, 1], s); | |
if ("viewport" === this.paint.get("circle-pitch-scale") && "map" === this.paint.get("circle-pitch-alignment") ? _ *= x[3] / o.cameraToCenterDistance : "map" === this.paint.get("circle-pitch-scale") && "viewport" === this.paint.get("circle-pitch-alignment") && (_ *= o.cameraToCenterDistance / x[3]), | |
Xo(p, v, _)) | |
return !0 | |
} | |
return !1 | |
} | |
, | |
e | |
}(En)); | |
function da(t, e) { | |
var r = ha([], [t.x, t.y, 0, 1], e); | |
return new n(r[0] / r[3],r[1] / r[3]) | |
} | |
var ma = function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e | |
}(Go); | |
function ya(t, e, r, i) { | |
var n = e.width | |
, o = e.height; | |
if (i) { | |
if (i instanceof Uint8ClampedArray) | |
i = new Uint8Array(i.buffer); | |
else if (i.length !== n * o * r) | |
throw new RangeError("mismatched image size") | |
} else | |
i = new Uint8Array(n * o * r); | |
return t.width = n, | |
t.height = o, | |
t.data = i, | |
t | |
} | |
function ga(t, e, r) { | |
var i = e.width | |
, n = e.height; | |
if (i !== t.width || n !== t.height) { | |
var o = ya({}, { | |
width: i, | |
height: n | |
}, r); | |
va(t, o, { | |
x: 0, | |
y: 0 | |
}, { | |
x: 0, | |
y: 0 | |
}, { | |
width: Math.min(t.width, i), | |
height: Math.min(t.height, n) | |
}, r), | |
t.width = i, | |
t.height = n, | |
t.data = o.data | |
} | |
} | |
function va(t, e, r, i, n, o) { | |
if (0 === n.width || 0 === n.height) | |
return e; | |
if (n.width > t.width || n.height > t.height || r.x > t.width - n.width || r.y > t.height - n.height) | |
throw new RangeError("out of range source coordinates for image copy"); | |
if (n.width > e.width || n.height > e.height || i.x > e.width - n.width || i.y > e.height - n.height) | |
throw new RangeError("out of range destination coordinates for image copy"); | |
for (var a = t.data, s = e.data, l = 0; l < n.height; l++) | |
for (var u = ((r.y + l) * t.width + r.x) * o, c = ((i.y + l) * e.width + i.x) * o, p = 0; p < n.width * o; p++) | |
s[c + p] = a[u + p]; | |
return e | |
} | |
Oi("HeatmapBucket", ma, { | |
omit: ["layers"] | |
}); | |
var _a = function(t, e) { | |
ya(this, t, 1, e) | |
}; | |
_a.prototype.resize = function(t) { | |
ga(this, t, 1) | |
} | |
, | |
_a.prototype.clone = function() { | |
return new _a({ | |
width: this.width, | |
height: this.height | |
},new Uint8Array(this.data)) | |
} | |
, | |
_a.copy = function(t, e, r, i, n) { | |
va(t, e, r, i, n, 1) | |
} | |
; | |
var xa = function(t, e) { | |
ya(this, t, 4, e) | |
}; | |
xa.prototype.resize = function(t) { | |
ga(this, t, 4) | |
} | |
, | |
xa.prototype.replace = function(t, e) { | |
e ? this.data.set(t) : this.data = t instanceof Uint8ClampedArray ? new Uint8Array(t.buffer) : t | |
} | |
, | |
xa.prototype.clone = function() { | |
return new xa({ | |
width: this.width, | |
height: this.height | |
},new Uint8Array(this.data)) | |
} | |
, | |
xa.copy = function(t, e, r, i, n) { | |
va(t, e, r, i, n, 4) | |
} | |
, | |
Oi("AlphaImage", _a), | |
Oi("RGBAImage", xa); | |
var ba = { | |
paint: new wn({ | |
"heatmap-radius": new vn(Dt.paint_heatmap["heatmap-radius"]), | |
"heatmap-weight": new vn(Dt.paint_heatmap["heatmap-weight"]), | |
"heatmap-intensity": new gn(Dt.paint_heatmap["heatmap-intensity"]), | |
"heatmap-color": new bn(Dt.paint_heatmap["heatmap-color"]), | |
"heatmap-opacity": new gn(Dt.paint_heatmap["heatmap-opacity"]) | |
}) | |
}; | |
function wa(t) { | |
var e = {} | |
, r = t.resolution || 256 | |
, i = t.clips ? t.clips.length : 1 | |
, n = t.image || new xa({ | |
width: r, | |
height: i | |
}) | |
, o = function(r, i, o) { | |
e[t.evaluationKey] = o; | |
var a = t.expression.evaluate(e); | |
n.data[r + i + 0] = Math.floor(255 * a.r / a.a), | |
n.data[r + i + 1] = Math.floor(255 * a.g / a.a), | |
n.data[r + i + 2] = Math.floor(255 * a.b / a.a), | |
n.data[r + i + 3] = Math.floor(255 * a.a) | |
}; | |
if (t.clips) | |
for (var a = 0, s = 0; a < i; ++a, | |
s += 4 * r) | |
for (var l = 0, u = 0; l < r; l++, | |
u += 4) { | |
var c = l / (r - 1) | |
, p = t.clips[a]; | |
o(s, u, p.start * (1 - c) + p.end * c) | |
} | |
else | |
for (var h = 0, f = 0; h < r; h++, | |
f += 4) | |
o(0, f, h / (r - 1)); | |
return n | |
} | |
var Ea = function(t) { | |
function e(e) { | |
t.call(this, e, ba), | |
this._updateColorRamp() | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.createBucket = function(t) { | |
return new ma(t) | |
} | |
, | |
e.prototype._handleSpecialPaintPropertyUpdate = function(t) { | |
"heatmap-color" === t && this._updateColorRamp() | |
} | |
, | |
e.prototype._updateColorRamp = function() { | |
this.colorRamp = wa({ | |
expression: this._transitionablePaint._values["heatmap-color"].value.expression, | |
evaluationKey: "heatmapDensity", | |
image: this.colorRamp | |
}), | |
this.colorRampTexture = null | |
} | |
, | |
e.prototype.resize = function() { | |
this.heatmapFbo && (this.heatmapFbo.destroy(), | |
this.heatmapFbo = null) | |
} | |
, | |
e.prototype.queryRadius = function() { | |
return 0 | |
} | |
, | |
e.prototype.queryIntersectsFeature = function() { | |
return !1 | |
} | |
, | |
e.prototype.hasOffscreenPass = function() { | |
return 0 !== this.paint.get("heatmap-opacity") && "none" !== this.visibility | |
} | |
, | |
e | |
}(En) | |
, Ca = { | |
paint: new wn({ | |
"hillshade-illumination-direction": new gn(Dt.paint_hillshade["hillshade-illumination-direction"]), | |
"hillshade-illumination-anchor": new gn(Dt.paint_hillshade["hillshade-illumination-anchor"]), | |
"hillshade-exaggeration": new gn(Dt.paint_hillshade["hillshade-exaggeration"]), | |
"hillshade-shadow-color": new gn(Dt.paint_hillshade["hillshade-shadow-color"]), | |
"hillshade-highlight-color": new gn(Dt.paint_hillshade["hillshade-highlight-color"]), | |
"hillshade-accent-color": new gn(Dt.paint_hillshade["hillshade-accent-color"]) | |
}) | |
} | |
, Aa = function(t) { | |
function e(e) { | |
t.call(this, e, Ca) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.hasOffscreenPass = function() { | |
return 0 !== this.paint.get("hillshade-exaggeration") && "none" !== this.visibility | |
} | |
, | |
e | |
}(En) | |
, za = Sn([{ | |
name: "a_pos", | |
components: 2, | |
type: "Int16" | |
}], 4).members | |
, Sa = Ta | |
, ka = Ta; | |
function Ta(t, e, r) { | |
r = r || 2; | |
var i, n, o, a, s, l, u, c = e && e.length, p = c ? e[0] * r : t.length, h = Da(t, 0, p, r, !0), f = []; | |
if (!h || h.next === h.prev) | |
return f; | |
if (c && (h = function(t, e, r, i) { | |
var n, o, a, s = []; | |
for (n = 0, | |
o = e.length; n < o; n++) | |
(a = Da(t, e[n] * i, n < o - 1 ? e[n + 1] * i : t.length, i, !1)) === a.next && (a.steiner = !0), | |
s.push(ja(a)); | |
for (s.sort(Ra), | |
n = 0; n < s.length; n++) | |
Oa(s[n], r), | |
r = Ia(r, r.next); | |
return r | |
}(t, e, h, r)), | |
t.length > 80 * r) { | |
i = o = t[0], | |
n = a = t[1]; | |
for (var d = r; d < p; d += r) | |
(s = t[d]) < i && (i = s), | |
(l = t[d + 1]) < n && (n = l), | |
s > o && (o = s), | |
l > a && (a = l); | |
u = 0 !== (u = Math.max(o - i, a - n)) ? 1 / u : 0 | |
} | |
return Fa(h, f, r, i, n, u), | |
f | |
} | |
function Da(t, e, r, i, n) { | |
var o, a; | |
if (n === ts(t, e, r, i) > 0) | |
for (o = e; o < r; o += i) | |
a = Ya(o, t[o], t[o + 1], a); | |
else | |
for (o = r - i; o >= e; o -= i) | |
a = Ya(o, t[o], t[o + 1], a); | |
return a && Za(a, a.next) && ($a(a), | |
a = a.next), | |
a | |
} | |
function Ia(t, e) { | |
if (!t) | |
return t; | |
e || (e = t); | |
var r, i = t; | |
do { | |
if (r = !1, | |
i.steiner || !Za(i, i.next) && 0 !== Ga(i.prev, i, i.next)) | |
i = i.next; | |
else { | |
if ($a(i), | |
(i = e = i.prev) === i.next) | |
break; | |
r = !0 | |
} | |
} while (r || i !== e); | |
return e | |
} | |
function Fa(t, e, r, i, n, o, a) { | |
if (t) { | |
!a && o && function(t, e, r, i) { | |
var n = t; | |
do { | |
null === n.z && (n.z = Va(n.x, n.y, e, r, i)), | |
n.prevZ = n.prev, | |
n.nextZ = n.next, | |
n = n.next | |
} while (n !== t); | |
n.prevZ.nextZ = null, | |
n.prevZ = null, | |
function(t) { | |
var e, r, i, n, o, a, s, l, u = 1; | |
do { | |
for (r = t, | |
t = null, | |
o = null, | |
a = 0; r; ) { | |
for (a++, | |
i = r, | |
s = 0, | |
e = 0; e < u && (s++, | |
i = i.nextZ); e++) | |
; | |
for (l = u; s > 0 || l > 0 && i; ) | |
0 !== s && (0 === l || !i || r.z <= i.z) ? (n = r, | |
r = r.nextZ, | |
s--) : (n = i, | |
i = i.nextZ, | |
l--), | |
o ? o.nextZ = n : t = n, | |
n.prevZ = o, | |
o = n; | |
r = i | |
} | |
o.nextZ = null, | |
u *= 2 | |
} while (a > 1) | |
}(n) | |
}(t, i, n, o); | |
for (var s, l, u = t; t.prev !== t.next; ) | |
if (s = t.prev, | |
l = t.next, | |
o ? Pa(t, i, n, o) : Ba(t)) | |
e.push(s.i / r), | |
e.push(t.i / r), | |
e.push(l.i / r), | |
$a(t), | |
t = l.next, | |
u = l.next; | |
else if ((t = l) === u) { | |
a ? 1 === a ? Fa(t = Ma(Ia(t), e, r), e, r, i, n, o, 2) : 2 === a && La(t, e, r, i, n, o) : Fa(Ia(t), e, r, i, n, o, 1); | |
break | |
} | |
} | |
} | |
function Ba(t) { | |
var e = t.prev | |
, r = t | |
, i = t.next; | |
if (Ga(e, r, i) >= 0) | |
return !1; | |
for (var n = t.next.next; n !== t.prev; ) { | |
if (Na(e.x, e.y, r.x, r.y, i.x, i.y, n.x, n.y) && Ga(n.prev, n, n.next) >= 0) | |
return !1; | |
n = n.next | |
} | |
return !0 | |
} | |
function Pa(t, e, r, i) { | |
var n = t.prev | |
, o = t | |
, a = t.next; | |
if (Ga(n, o, a) >= 0) | |
return !1; | |
for (var s = n.x > o.x ? n.x > a.x ? n.x : a.x : o.x > a.x ? o.x : a.x, l = n.y > o.y ? n.y > a.y ? n.y : a.y : o.y > a.y ? o.y : a.y, u = Va(n.x < o.x ? n.x < a.x ? n.x : a.x : o.x < a.x ? o.x : a.x, n.y < o.y ? n.y < a.y ? n.y : a.y : o.y < a.y ? o.y : a.y, e, r, i), c = Va(s, l, e, r, i), p = t.prevZ, h = t.nextZ; p && p.z >= u && h && h.z <= c; ) { | |
if (p !== t.prev && p !== t.next && Na(n.x, n.y, o.x, o.y, a.x, a.y, p.x, p.y) && Ga(p.prev, p, p.next) >= 0) | |
return !1; | |
if (p = p.prevZ, | |
h !== t.prev && h !== t.next && Na(n.x, n.y, o.x, o.y, a.x, a.y, h.x, h.y) && Ga(h.prev, h, h.next) >= 0) | |
return !1; | |
h = h.nextZ | |
} | |
for (; p && p.z >= u; ) { | |
if (p !== t.prev && p !== t.next && Na(n.x, n.y, o.x, o.y, a.x, a.y, p.x, p.y) && Ga(p.prev, p, p.next) >= 0) | |
return !1; | |
p = p.prevZ | |
} | |
for (; h && h.z <= c; ) { | |
if (h !== t.prev && h !== t.next && Na(n.x, n.y, o.x, o.y, a.x, a.y, h.x, h.y) && Ga(h.prev, h, h.next) >= 0) | |
return !1; | |
h = h.nextZ | |
} | |
return !0 | |
} | |
function Ma(t, e, r) { | |
var i = t; | |
do { | |
var n = i.prev | |
, o = i.next.next; | |
!Za(n, o) && Xa(n, i, i.next, o) && Ka(n, o) && Ka(o, n) && (e.push(n.i / r), | |
e.push(i.i / r), | |
e.push(o.i / r), | |
$a(i), | |
$a(i.next), | |
i = t = o), | |
i = i.next | |
} while (i !== t); | |
return Ia(i) | |
} | |
function La(t, e, r, i, n, o) { | |
var a = t; | |
do { | |
for (var s = a.next.next; s !== a.prev; ) { | |
if (a.i !== s.i && qa(a, s)) { | |
var l = Ja(a, s); | |
return a = Ia(a, a.next), | |
l = Ia(l, l.next), | |
Fa(a, e, r, i, n, o), | |
void Fa(l, e, r, i, n, o) | |
} | |
s = s.next | |
} | |
a = a.next | |
} while (a !== t) | |
} | |
function Ra(t, e) { | |
return t.x - e.x | |
} | |
function Oa(t, e) { | |
if (e = function(t, e) { | |
var r, i = e, n = t.x, o = t.y, a = -1 / 0; | |
do { | |
if (o <= i.y && o >= i.next.y && i.next.y !== i.y) { | |
var s = i.x + (o - i.y) * (i.next.x - i.x) / (i.next.y - i.y); | |
if (s <= n && s > a) { | |
if (a = s, | |
s === n) { | |
if (o === i.y) | |
return i; | |
if (o === i.next.y) | |
return i.next | |
} | |
r = i.x < i.next.x ? i : i.next | |
} | |
} | |
i = i.next | |
} while (i !== e); | |
if (!r) | |
return null; | |
if (n === a) | |
return r; | |
var l, u = r, c = r.x, p = r.y, h = 1 / 0; | |
i = r; | |
do { | |
n >= i.x && i.x >= c && n !== i.x && Na(o < p ? n : a, o, c, p, o < p ? a : n, o, i.x, i.y) && (l = Math.abs(o - i.y) / (n - i.x), | |
Ka(i, t) && (l < h || l === h && (i.x > r.x || i.x === r.x && Ua(r, i))) && (r = i, | |
h = l)), | |
i = i.next | |
} while (i !== u); | |
return r | |
}(t, e)) { | |
var r = Ja(e, t); | |
Ia(e, e.next), | |
Ia(r, r.next) | |
} | |
} | |
function Ua(t, e) { | |
return Ga(t.prev, t, e.prev) < 0 && Ga(e.next, t, t.next) < 0 | |
} | |
function Va(t, e, r, i, n) { | |
return (t = 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = 32767 * (t - r) * n) | t << 8)) | t << 4)) | t << 2)) | t << 1)) | (e = 1431655765 & ((e = 858993459 & ((e = 252645135 & ((e = 16711935 & ((e = 32767 * (e - i) * n) | e << 8)) | e << 4)) | e << 2)) | e << 1)) << 1 | |
} | |
function ja(t) { | |
var e = t | |
, r = t; | |
do { | |
(e.x < r.x || e.x === r.x && e.y < r.y) && (r = e), | |
e = e.next | |
} while (e !== t); | |
return r | |
} | |
function Na(t, e, r, i, n, o, a, s) { | |
return (n - a) * (e - s) - (t - a) * (o - s) >= 0 && (t - a) * (i - s) - (r - a) * (e - s) >= 0 && (r - a) * (o - s) - (n - a) * (i - s) >= 0 | |
} | |
function qa(t, e) { | |
return t.next.i !== e.i && t.prev.i !== e.i && !function(t, e) { | |
var r = t; | |
do { | |
if (r.i !== t.i && r.next.i !== t.i && r.i !== e.i && r.next.i !== e.i && Xa(r, r.next, t, e)) | |
return !0; | |
r = r.next | |
} while (r !== t); | |
return !1 | |
}(t, e) && (Ka(t, e) && Ka(e, t) && function(t, e) { | |
var r = t | |
, i = !1 | |
, n = (t.x + e.x) / 2 | |
, o = (t.y + e.y) / 2; | |
do { | |
r.y > o != r.next.y > o && r.next.y !== r.y && n < (r.next.x - r.x) * (o - r.y) / (r.next.y - r.y) + r.x && (i = !i), | |
r = r.next | |
} while (r !== t); | |
return i | |
}(t, e) && (Ga(t.prev, t, e.prev) || Ga(t, e.prev, e)) || Za(t, e) && Ga(t.prev, t, t.next) > 0 && Ga(e.prev, e, e.next) > 0) | |
} | |
function Ga(t, e, r) { | |
return (e.y - t.y) * (r.x - e.x) - (e.x - t.x) * (r.y - e.y) | |
} | |
function Za(t, e) { | |
return t.x === e.x && t.y === e.y | |
} | |
function Xa(t, e, r, i) { | |
var n = Ha(Ga(t, e, r)) | |
, o = Ha(Ga(t, e, i)) | |
, a = Ha(Ga(r, i, t)) | |
, s = Ha(Ga(r, i, e)); | |
return n !== o && a !== s || !(0 !== n || !Wa(t, r, e)) || !(0 !== o || !Wa(t, i, e)) || !(0 !== a || !Wa(r, t, i)) || !(0 !== s || !Wa(r, e, i)) | |
} | |
function Wa(t, e, r) { | |
return e.x <= Math.max(t.x, r.x) && e.x >= Math.min(t.x, r.x) && e.y <= Math.max(t.y, r.y) && e.y >= Math.min(t.y, r.y) | |
} | |
function Ha(t) { | |
return t > 0 ? 1 : t < 0 ? -1 : 0 | |
} | |
function Ka(t, e) { | |
return Ga(t.prev, t, t.next) < 0 ? Ga(t, e, t.next) >= 0 && Ga(t, t.prev, e) >= 0 : Ga(t, e, t.prev) < 0 || Ga(t, t.next, e) < 0 | |
} | |
function Ja(t, e) { | |
var r = new Qa(t.i,t.x,t.y) | |
, i = new Qa(e.i,e.x,e.y) | |
, n = t.next | |
, o = e.prev; | |
return t.next = e, | |
e.prev = t, | |
r.next = n, | |
n.prev = r, | |
i.next = r, | |
r.prev = i, | |
o.next = i, | |
i.prev = o, | |
i | |
} | |
function Ya(t, e, r, i) { | |
var n = new Qa(t,e,r); | |
return i ? (n.next = i.next, | |
n.prev = i, | |
i.next.prev = n, | |
i.next = n) : (n.prev = n, | |
n.next = n), | |
n | |
} | |
function $a(t) { | |
t.next.prev = t.prev, | |
t.prev.next = t.next, | |
t.prevZ && (t.prevZ.nextZ = t.nextZ), | |
t.nextZ && (t.nextZ.prevZ = t.prevZ) | |
} | |
function Qa(t, e, r) { | |
this.i = t, | |
this.x = e, | |
this.y = r, | |
this.prev = null, | |
this.next = null, | |
this.z = null, | |
this.prevZ = null, | |
this.nextZ = null, | |
this.steiner = !1 | |
} | |
function ts(t, e, r, i) { | |
for (var n = 0, o = e, a = r - i; o < r; o += i) | |
n += (t[a] - t[o]) * (t[o + 1] + t[a + 1]), | |
a = o; | |
return n | |
} | |
function es(t, e, r, i, n) { | |
!function t(e, r, i, n, o) { | |
for (; n > i; ) { | |
if (n - i > 600) { | |
var a = n - i + 1 | |
, s = r - i + 1 | |
, l = Math.log(a) | |
, u = .5 * Math.exp(2 * l / 3) | |
, c = .5 * Math.sqrt(l * u * (a - u) / a) * (s - a / 2 < 0 ? -1 : 1); | |
t(e, r, Math.max(i, Math.floor(r - s * u / a + c)), Math.min(n, Math.floor(r + (a - s) * u / a + c)), o) | |
} | |
var p = e[r] | |
, h = i | |
, f = n; | |
for (rs(e, i, r), | |
o(e[n], p) > 0 && rs(e, i, n); h < f; ) { | |
for (rs(e, h, f), | |
h++, | |
f--; o(e[h], p) < 0; ) | |
h++; | |
for (; o(e[f], p) > 0; ) | |
f-- | |
} | |
0 === o(e[i], p) ? rs(e, i, f) : rs(e, ++f, n), | |
f <= r && (i = f + 1), | |
r <= f && (n = f - 1) | |
} | |
}(t, e, r || 0, i || t.length - 1, n || is) | |
} | |
function rs(t, e, r) { | |
var i = t[e]; | |
t[e] = t[r], | |
t[r] = i | |
} | |
function is(t, e) { | |
return t < e ? -1 : t > e ? 1 : 0 | |
} | |
function ns(t, e) { | |
var r = t.length; | |
if (r <= 1) | |
return [t]; | |
for (var i, n, o = [], a = 0; a < r; a++) { | |
var s = A(t[a]); | |
0 !== s && (t[a].area = Math.abs(s), | |
void 0 === n && (n = s < 0), | |
n === s < 0 ? (i && o.push(i), | |
i = [t[a]]) : i.push(t[a])) | |
} | |
if (i && o.push(i), | |
e > 1) | |
for (var l = 0; l < o.length; l++) | |
o[l].length <= e || (es(o[l], e, 1, o[l].length - 1, os), | |
o[l] = o[l].slice(0, e)); | |
return o | |
} | |
function os(t, e) { | |
return e.area - t.area | |
} | |
function as(t, e, r) { | |
for (var i = r.patternDependencies, n = !1, o = 0, a = e; o < a.length; o += 1) { | |
var s = a[o].paint.get(t + "-pattern"); | |
s.isConstant() || (n = !0); | |
var l = s.constantOr(null); | |
l && (n = !0, | |
i[l.to] = !0, | |
i[l.from] = !0) | |
} | |
return n | |
} | |
function ss(t, e, r, i, n) { | |
for (var o = n.patternDependencies, a = 0, s = e; a < s.length; a += 1) { | |
var l = s[a] | |
, u = l.paint.get(t + "-pattern").value; | |
if ("constant" !== u.kind) { | |
var c = u.evaluate({ | |
zoom: i - 1 | |
}, r, {}, n.availableImages) | |
, p = u.evaluate({ | |
zoom: i | |
}, r, {}, n.availableImages) | |
, h = u.evaluate({ | |
zoom: i + 1 | |
}, r, {}, n.availableImages); | |
p = p && p.name ? p.name : p, | |
h = h && h.name ? h.name : h, | |
o[c = c && c.name ? c.name : c] = !0, | |
o[p] = !0, | |
o[h] = !0, | |
r.patterns[l.id] = { | |
min: c, | |
mid: p, | |
max: h | |
} | |
} | |
} | |
return r | |
} | |
Ta.deviation = function(t, e, r, i) { | |
var n = e && e.length | |
, o = Math.abs(ts(t, 0, n ? e[0] * r : t.length, r)); | |
if (n) | |
for (var a = 0, s = e.length; a < s; a++) | |
o -= Math.abs(ts(t, e[a] * r, a < s - 1 ? e[a + 1] * r : t.length, r)); | |
var l = 0; | |
for (a = 0; a < i.length; a += 3) { | |
var u = i[a] * r | |
, c = i[a + 1] * r | |
, p = i[a + 2] * r; | |
l += Math.abs((t[u] - t[p]) * (t[c + 1] - t[u + 1]) - (t[u] - t[c]) * (t[p + 1] - t[u + 1])) | |
} | |
return 0 === o && 0 === l ? 0 : Math.abs((l - o) / o) | |
} | |
, | |
Ta.flatten = function(t) { | |
for (var e = t[0][0].length, r = { | |
vertices: [], | |
holes: [], | |
dimensions: e | |
}, i = 0, n = 0; n < t.length; n++) { | |
for (var o = 0; o < t[n].length; o++) | |
for (var a = 0; a < e; a++) | |
r.vertices.push(t[n][o][a]); | |
n > 0 && r.holes.push(i += t[n - 1].length) | |
} | |
return r | |
} | |
, | |
Sa.default = ka; | |
var ls = function(t) { | |
this.zoom = t.zoom, | |
this.overscaling = t.overscaling, | |
this.layers = t.layers, | |
this.layerIds = this.layers.map((function(t) { | |
return t.id | |
} | |
)), | |
this.index = t.index, | |
this.hasPattern = !1, | |
this.patternFeatures = [], | |
this.layoutVertexArray = new Tn, | |
this.indexArray = new Nn, | |
this.indexArray2 = new Hn, | |
this.programConfigurations = new Lo(t.layers,t.zoom), | |
this.segments = new lo, | |
this.segments2 = new lo, | |
this.stateDependentLayerIds = this.layers.filter((function(t) { | |
return t.isStateDependent() | |
} | |
)).map((function(t) { | |
return t.id | |
} | |
)) | |
}; | |
ls.prototype.populate = function(t, e, r) { | |
this.hasPattern = as("fill", this.layers, e); | |
for (var i = this.layers[0].layout.get("fill-sort-key"), n = !i.isConstant(), o = [], a = 0, s = t; a < s.length; a += 1) { | |
var l = s[a] | |
, u = l.feature | |
, c = l.id | |
, p = l.index | |
, h = l.sourceLayerIndex | |
, f = this.layers[0]._featureFilter.needGeometry | |
, d = No(u, f); | |
if (this.layers[0]._featureFilter.filter(new ln(this.zoom), d, r)) { | |
var m = n ? i.evaluate(d, {}, r, e.availableImages) : void 0 | |
, y = { | |
id: c, | |
properties: u.properties, | |
type: u.type, | |
sourceLayerIndex: h, | |
index: p, | |
geometry: f ? d.geometry : jo(u), | |
patterns: {}, | |
sortKey: m | |
}; | |
o.push(y) | |
} | |
} | |
n && o.sort((function(t, e) { | |
return t.sortKey - e.sortKey | |
} | |
)); | |
for (var g = 0, v = o; g < v.length; g += 1) { | |
var _ = v[g] | |
, x = _.geometry | |
, b = _.index | |
, w = _.sourceLayerIndex; | |
if (this.hasPattern) { | |
var E = ss("fill", this.layers, _, this.zoom, e); | |
this.patternFeatures.push(E) | |
} else | |
this.addFeature(_, x, b, r, {}); | |
e.featureIndex.insert(t[b].feature, x, b, w, this.index) | |
} | |
} | |
, | |
ls.prototype.update = function(t, e, r) { | |
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t, e, this.stateDependentLayers, r) | |
} | |
, | |
ls.prototype.addFeatures = function(t, e, r) { | |
for (var i = 0, n = this.patternFeatures; i < n.length; i += 1) { | |
var o = n[i]; | |
this.addFeature(o, o.geometry, o.index, e, r) | |
} | |
} | |
, | |
ls.prototype.isEmpty = function() { | |
return 0 === this.layoutVertexArray.length | |
} | |
, | |
ls.prototype.uploadPending = function() { | |
return !this.uploaded || this.programConfigurations.needsUpload | |
} | |
, | |
ls.prototype.upload = function(t) { | |
this.uploaded || (this.layoutVertexBuffer = t.createVertexBuffer(this.layoutVertexArray, za), | |
this.indexBuffer = t.createIndexBuffer(this.indexArray), | |
this.indexBuffer2 = t.createIndexBuffer(this.indexArray2)), | |
this.programConfigurations.upload(t), | |
this.uploaded = !0 | |
} | |
, | |
ls.prototype.destroy = function() { | |
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), | |
this.indexBuffer.destroy(), | |
this.indexBuffer2.destroy(), | |
this.programConfigurations.destroy(), | |
this.segments.destroy(), | |
this.segments2.destroy()) | |
} | |
, | |
ls.prototype.addFeature = function(t, e, r, i, n) { | |
for (var o = 0, a = ns(e, 500); o < a.length; o += 1) { | |
for (var s = a[o], l = 0, u = 0, c = s; u < c.length; u += 1) | |
l += c[u].length; | |
for (var p = this.segments.prepareSegment(l, this.layoutVertexArray, this.indexArray), h = p.vertexLength, f = [], d = [], m = 0, y = s; m < y.length; m += 1) { | |
var g = y[m]; | |
if (0 !== g.length) { | |
g !== s[0] && d.push(f.length / 2); | |
var v = this.segments2.prepareSegment(g.length, this.layoutVertexArray, this.indexArray2) | |
, _ = v.vertexLength; | |
this.layoutVertexArray.emplaceBack(g[0].x, g[0].y), | |
this.indexArray2.emplaceBack(_ + g.length - 1, _), | |
f.push(g[0].x), | |
f.push(g[0].y); | |
for (var x = 1; x < g.length; x++) | |
this.layoutVertexArray.emplaceBack(g[x].x, g[x].y), | |
this.indexArray2.emplaceBack(_ + x - 1, _ + x), | |
f.push(g[x].x), | |
f.push(g[x].y); | |
v.vertexLength += g.length, | |
v.primitiveLength += g.length | |
} | |
} | |
for (var b = Sa(f, d), w = 0; w < b.length; w += 3) | |
this.indexArray.emplaceBack(h + b[w], h + b[w + 1], h + b[w + 2]); | |
p.vertexLength += l, | |
p.primitiveLength += b.length / 3 | |
} | |
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t, r, n, i) | |
} | |
, | |
Oi("FillBucket", ls, { | |
omit: ["layers", "patternFeatures"] | |
}); | |
var us = new wn({ | |
"fill-sort-key": new vn(Dt.layout_fill["fill-sort-key"]) | |
}) | |
, cs = { | |
paint: new wn({ | |
"fill-antialias": new gn(Dt.paint_fill["fill-antialias"]), | |
"fill-opacity": new vn(Dt.paint_fill["fill-opacity"]), | |
"fill-color": new vn(Dt.paint_fill["fill-color"]), | |
"fill-outline-color": new vn(Dt.paint_fill["fill-outline-color"]), | |
"fill-translate": new gn(Dt.paint_fill["fill-translate"]), | |
"fill-translate-anchor": new gn(Dt.paint_fill["fill-translate-anchor"]), | |
"fill-pattern": new _n(Dt.paint_fill["fill-pattern"]) | |
}), | |
layout: us | |
} | |
, ps = function(t) { | |
function e(e) { | |
t.call(this, e, cs) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.recalculate = function(e, r) { | |
t.prototype.recalculate.call(this, e, r); | |
var i = this.paint._values["fill-outline-color"]; | |
"constant" === i.value.kind && void 0 === i.value.value && (this.paint._values["fill-outline-color"] = this.paint._values["fill-color"]) | |
} | |
, | |
e.prototype.createBucket = function(t) { | |
return new ls(t) | |
} | |
, | |
e.prototype.queryRadius = function() { | |
return ia(this.paint.get("fill-translate")) | |
} | |
, | |
e.prototype.queryIntersectsFeature = function(t, e, r, i, n, o, a) { | |
return Wo(na(t, this.paint.get("fill-translate"), this.paint.get("fill-translate-anchor"), o.angle, a), i) | |
} | |
, | |
e.prototype.isTileClipped = function() { | |
return !0 | |
} | |
, | |
e | |
}(En) | |
, hs = Sn([{ | |
name: "a_pos", | |
components: 2, | |
type: "Int16" | |
}, { | |
name: "a_normal_ed", | |
components: 4, | |
type: "Int16" | |
}], 4).members | |
, fs = ds; | |
function ds(t, e, r, i, n) { | |
this.properties = {}, | |
this.extent = r, | |
this.type = 0, | |
this._pbf = t, | |
this._geometry = -1, | |
this._keys = i, | |
this._values = n, | |
t.readFields(ms, this, e) | |
} | |
function ms(t, e, r) { | |
1 == t ? e.id = r.readVarint() : 2 == t ? function(t, e) { | |
for (var r = t.readVarint() + t.pos; t.pos < r; ) { | |
var i = e._keys[t.readVarint()] | |
, n = e._values[t.readVarint()]; | |
e.properties[i] = n | |
} | |
}(r, e) : 3 == t ? e.type = r.readVarint() : 4 == t && (e._geometry = r.pos) | |
} | |
function ys(t) { | |
for (var e, r, i = 0, n = 0, o = t.length, a = o - 1; n < o; a = n++) | |
i += ((r = t[a]).x - (e = t[n]).x) * (e.y + r.y); | |
return i | |
} | |
ds.types = ["Unknown", "Point", "LineString", "Polygon"], | |
ds.prototype.loadGeometry = function() { | |
var t = this._pbf; | |
t.pos = this._geometry; | |
for (var e, r = t.readVarint() + t.pos, i = 1, o = 0, a = 0, s = 0, l = []; t.pos < r; ) { | |
if (o <= 0) { | |
var u = t.readVarint(); | |
i = 7 & u, | |
o = u >> 3 | |
} | |
if (o--, | |
1 === i || 2 === i) | |
a += t.readSVarint(), | |
s += t.readSVarint(), | |
1 === i && (e && l.push(e), | |
e = []), | |
e.push(new n(a,s)); | |
else { | |
if (7 !== i) | |
throw new Error("unknown command " + i); | |
e && e.push(e[0].clone()) | |
} | |
} | |
return e && l.push(e), | |
l | |
} | |
, | |
ds.prototype.bbox = function() { | |
var t = this._pbf; | |
t.pos = this._geometry; | |
for (var e = t.readVarint() + t.pos, r = 1, i = 0, n = 0, o = 0, a = 1 / 0, s = -1 / 0, l = 1 / 0, u = -1 / 0; t.pos < e; ) { | |
if (i <= 0) { | |
var c = t.readVarint(); | |
r = 7 & c, | |
i = c >> 3 | |
} | |
if (i--, | |
1 === r || 2 === r) | |
(n += t.readSVarint()) < a && (a = n), | |
n > s && (s = n), | |
(o += t.readSVarint()) < l && (l = o), | |
o > u && (u = o); | |
else if (7 !== r) | |
throw new Error("unknown command " + r) | |
} | |
return [a, l, s, u] | |
} | |
, | |
ds.prototype.toGeoJSON = function(t, e, r) { | |
var i, n, o = this.extent * Math.pow(2, r), a = this.extent * t, s = this.extent * e, l = this.loadGeometry(), u = ds.types[this.type]; | |
function c(t) { | |
for (var e = 0; e < t.length; e++) { | |
var r = t[e]; | |
t[e] = [360 * (r.x + a) / o - 180, 360 / Math.PI * Math.atan(Math.exp((180 - 360 * (r.y + s) / o) * Math.PI / 180)) - 90] | |
} | |
} | |
switch (this.type) { | |
case 1: | |
var p = []; | |
for (i = 0; i < l.length; i++) | |
p[i] = l[i][0]; | |
c(l = p); | |
break; | |
case 2: | |
for (i = 0; i < l.length; i++) | |
c(l[i]); | |
break; | |
case 3: | |
for (l = function(t) { | |
var e = t.length; | |
if (e <= 1) | |
return [t]; | |
for (var r, i, n = [], o = 0; o < e; o++) { | |
var a = ys(t[o]); | |
0 !== a && (void 0 === i && (i = a < 0), | |
i === a < 0 ? (r && n.push(r), | |
r = [t[o]]) : r.push(t[o])) | |
} | |
return r && n.push(r), | |
n | |
}(l), | |
i = 0; i < l.length; i++) | |
for (n = 0; n < l[i].length; n++) | |
c(l[i][n]) | |
} | |
1 === l.length ? l = l[0] : u = "Multi" + u; | |
var h = { | |
type: "Feature", | |
geometry: { | |
type: u, | |
coordinates: l | |
}, | |
properties: this.properties | |
}; | |
return "id"in this && (h.id = this.id), | |
h | |
} | |
; | |
var gs = vs; | |
function vs(t, e) { | |
this.version = 1, | |
this.name = null, | |
this.extent = 4096, | |
this.length = 0, | |
this._pbf = t, | |
this._keys = [], | |
this._values = [], | |
this._features = [], | |
t.readFields(_s, this, e), | |
this.length = this._features.length | |
} | |
function _s(t, e, r) { | |
15 === t ? e.version = r.readVarint() : 1 === t ? e.name = r.readString() : 5 === t ? e.extent = r.readVarint() : 2 === t ? e._features.push(r.pos) : 3 === t ? e._keys.push(r.readString()) : 4 === t && e._values.push(function(t) { | |
for (var e = null, r = t.readVarint() + t.pos; t.pos < r; ) { | |
var i = t.readVarint() >> 3; | |
e = 1 === i ? t.readString() : 2 === i ? t.readFloat() : 3 === i ? t.readDouble() : 4 === i ? t.readVarint64() : 5 === i ? t.readVarint() : 6 === i ? t.readSVarint() : 7 === i ? t.readBoolean() : null | |
} | |
return e | |
}(r)) | |
} | |
function xs(t, e, r) { | |
if (3 === t) { | |
var i = new gs(r,r.readVarint() + r.pos); | |
i.length && (e[i.name] = i) | |
} | |
} | |
vs.prototype.feature = function(t) { | |
if (t < 0 || t >= this._features.length) | |
throw new Error("feature index out of bounds"); | |
this._pbf.pos = this._features[t]; | |
var e = this._pbf.readVarint() + this._pbf.pos; | |
return new fs(this._pbf,e,this.extent,this._keys,this._values) | |
} | |
; | |
var bs = { | |
VectorTile: function(t, e) { | |
this.layers = t.readFields(xs, {}, e) | |
}, | |
VectorTileFeature: fs, | |
VectorTileLayer: gs | |
} | |
, ws = bs.VectorTileFeature.types | |
, Es = Math.pow(2, 13); | |
function Cs(t, e, r, i, n, o, a, s) { | |
t.emplaceBack(e, r, 2 * Math.floor(i * Es) + a, n * Es * 2, o * Es * 2, Math.round(s)) | |
} | |
var As = function(t) { | |
this.zoom = t.zoom, | |
this.overscaling = t.overscaling, | |
this.layers = t.layers, | |
this.layerIds = this.layers.map((function(t) { | |
return t.id | |
} | |
)), | |
this.index = t.index, | |
this.hasPattern = !1, | |
this.layoutVertexArray = new In, | |
this.indexArray = new Nn, | |
this.programConfigurations = new Lo(t.layers,t.zoom), | |
this.segments = new lo, | |
this.stateDependentLayerIds = this.layers.filter((function(t) { | |
return t.isStateDependent() | |
} | |
)).map((function(t) { | |
return t.id | |
} | |
)) | |
}; | |
function zs(t, e) { | |
return t.x === e.x && (t.x < 0 || t.x > 8192) || t.y === e.y && (t.y < 0 || t.y > 8192) | |
} | |
As.prototype.populate = function(t, e, r) { | |
this.features = [], | |
this.hasPattern = as("fill-extrusion", this.layers, e); | |
for (var i = 0, n = t; i < n.length; i += 1) { | |
var o = n[i] | |
, a = o.feature | |
, s = o.id | |
, l = o.index | |
, u = o.sourceLayerIndex | |
, c = this.layers[0]._featureFilter.needGeometry | |
, p = No(a, c); | |
if (this.layers[0]._featureFilter.filter(new ln(this.zoom), p, r)) { | |
var h = { | |
id: s, | |
sourceLayerIndex: u, | |
index: l, | |
geometry: c ? p.geometry : jo(a), | |
properties: a.properties, | |
type: a.type, | |
patterns: {} | |
}; | |
this.hasPattern ? this.features.push(ss("fill-extrusion", this.layers, h, this.zoom, e)) : this.addFeature(h, h.geometry, l, r, {}), | |
e.featureIndex.insert(a, h.geometry, l, u, this.index, !0) | |
} | |
} | |
} | |
, | |
As.prototype.addFeatures = function(t, e, r) { | |
for (var i = 0, n = this.features; i < n.length; i += 1) { | |
var o = n[i]; | |
this.addFeature(o, o.geometry, o.index, e, r) | |
} | |
} | |
, | |
As.prototype.update = function(t, e, r) { | |
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t, e, this.stateDependentLayers, r) | |
} | |
, | |
As.prototype.isEmpty = function() { | |
return 0 === this.layoutVertexArray.length | |
} | |
, | |
As.prototype.uploadPending = function() { | |
return !this.uploaded || this.programConfigurations.needsUpload | |
} | |
, | |
As.prototype.upload = function(t) { | |
this.uploaded || (this.layoutVertexBuffer = t.createVertexBuffer(this.layoutVertexArray, hs), | |
this.indexBuffer = t.createIndexBuffer(this.indexArray)), | |
this.programConfigurations.upload(t), | |
this.uploaded = !0 | |
} | |
, | |
As.prototype.destroy = function() { | |
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), | |
this.indexBuffer.destroy(), | |
this.programConfigurations.destroy(), | |
this.segments.destroy()) | |
} | |
, | |
As.prototype.addFeature = function(t, e, r, i, n) { | |
for (var o = 0, a = ns(e, 500); o < a.length; o += 1) { | |
for (var s = a[o], l = 0, u = 0, c = s; u < c.length; u += 1) | |
l += c[u].length; | |
for (var p = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray), h = 0, f = s; h < f.length; h += 1) { | |
var d = f[h]; | |
if (0 !== d.length && !((F = d).every((function(t) { | |
return t.x < 0 | |
} | |
)) || F.every((function(t) { | |
return t.x > 8192 | |
} | |
)) || F.every((function(t) { | |
return t.y < 0 | |
} | |
)) || F.every((function(t) { | |
return t.y > 8192 | |
} | |
)))) | |
for (var m = 0, y = 0; y < d.length; y++) { | |
var g = d[y]; | |
if (y >= 1) { | |
var v = d[y - 1]; | |
if (!zs(g, v)) { | |
p.vertexLength + 4 > lo.MAX_VERTEX_ARRAY_LENGTH && (p = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray)); | |
var _ = g.sub(v)._perp()._unit() | |
, x = v.dist(g); | |
m + x > 32768 && (m = 0), | |
Cs(this.layoutVertexArray, g.x, g.y, _.x, _.y, 0, 0, m), | |
Cs(this.layoutVertexArray, g.x, g.y, _.x, _.y, 0, 1, m), | |
Cs(this.layoutVertexArray, v.x, v.y, _.x, _.y, 0, 0, m += x), | |
Cs(this.layoutVertexArray, v.x, v.y, _.x, _.y, 0, 1, m); | |
var b = p.vertexLength; | |
this.indexArray.emplaceBack(b, b + 2, b + 1), | |
this.indexArray.emplaceBack(b + 1, b + 2, b + 3), | |
p.vertexLength += 4, | |
p.primitiveLength += 2 | |
} | |
} | |
} | |
} | |
if (p.vertexLength + l > lo.MAX_VERTEX_ARRAY_LENGTH && (p = this.segments.prepareSegment(l, this.layoutVertexArray, this.indexArray)), | |
"Polygon" === ws[t.type]) { | |
for (var w = [], E = [], C = p.vertexLength, A = 0, z = s; A < z.length; A += 1) { | |
var S = z[A]; | |
if (0 !== S.length) { | |
S !== s[0] && E.push(w.length / 2); | |
for (var k = 0; k < S.length; k++) { | |
var T = S[k]; | |
Cs(this.layoutVertexArray, T.x, T.y, 0, 0, 1, 1, 0), | |
w.push(T.x), | |
w.push(T.y) | |
} | |
} | |
} | |
for (var D = Sa(w, E), I = 0; I < D.length; I += 3) | |
this.indexArray.emplaceBack(C + D[I], C + D[I + 2], C + D[I + 1]); | |
p.primitiveLength += D.length / 3, | |
p.vertexLength += l | |
} | |
} | |
var F; | |
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t, r, n, i) | |
} | |
, | |
Oi("FillExtrusionBucket", As, { | |
omit: ["layers", "features"] | |
}); | |
var Ss = { | |
paint: new wn({ | |
"fill-extrusion-opacity": new gn(Dt["paint_fill-extrusion"]["fill-extrusion-opacity"]), | |
"fill-extrusion-color": new vn(Dt["paint_fill-extrusion"]["fill-extrusion-color"]), | |
"fill-extrusion-translate": new gn(Dt["paint_fill-extrusion"]["fill-extrusion-translate"]), | |
"fill-extrusion-translate-anchor": new gn(Dt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]), | |
"fill-extrusion-pattern": new _n(Dt["paint_fill-extrusion"]["fill-extrusion-pattern"]), | |
"fill-extrusion-height": new vn(Dt["paint_fill-extrusion"]["fill-extrusion-height"]), | |
"fill-extrusion-base": new vn(Dt["paint_fill-extrusion"]["fill-extrusion-base"]), | |
"fill-extrusion-vertical-gradient": new gn(Dt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]) | |
}) | |
} | |
, ks = function(t) { | |
function e(e) { | |
t.call(this, e, Ss) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.createBucket = function(t) { | |
return new As(t) | |
} | |
, | |
e.prototype.queryRadius = function() { | |
return ia(this.paint.get("fill-extrusion-translate")) | |
} | |
, | |
e.prototype.is3D = function() { | |
return !0 | |
} | |
, | |
e.prototype.queryIntersectsFeature = function(t, e, r, i, o, a, s, l) { | |
var u = na(t, this.paint.get("fill-extrusion-translate"), this.paint.get("fill-extrusion-translate-anchor"), a.angle, s) | |
, c = this.paint.get("fill-extrusion-height").evaluate(e, r) | |
, p = this.paint.get("fill-extrusion-base").evaluate(e, r) | |
, h = function(t, e, r, i) { | |
for (var o = [], a = 0, s = t; a < s.length; a += 1) { | |
var l = s[a] | |
, u = [l.x, l.y, 0, 1]; | |
ha(u, u, e), | |
o.push(new n(u[0] / u[3],u[1] / u[3])) | |
} | |
return o | |
}(u, l) | |
, f = function(t, e, r, i) { | |
for (var o = [], a = [], s = i[8] * e, l = i[9] * e, u = i[10] * e, c = i[11] * e, p = i[8] * r, h = i[9] * r, f = i[10] * r, d = i[11] * r, m = 0, y = t; m < y.length; m += 1) { | |
for (var g = [], v = [], _ = 0, x = y[m]; _ < x.length; _ += 1) { | |
var b = x[_] | |
, w = b.x | |
, E = b.y | |
, C = i[0] * w + i[4] * E + i[12] | |
, A = i[1] * w + i[5] * E + i[13] | |
, z = i[2] * w + i[6] * E + i[14] | |
, S = i[3] * w + i[7] * E + i[15] | |
, k = z + u | |
, T = S + c | |
, D = C + p | |
, I = A + h | |
, F = z + f | |
, B = S + d | |
, P = new n((C + s) / T,(A + l) / T); | |
P.z = k / T, | |
g.push(P); | |
var M = new n(D / B,I / B); | |
M.z = F / B, | |
v.push(M) | |
} | |
o.push(g), | |
a.push(v) | |
} | |
return [o, a] | |
}(i, p, c, l); | |
return function(t, e, r) { | |
var i = 1 / 0; | |
Wo(r, e) && (i = Ds(r, e[0])); | |
for (var n = 0; n < e.length; n++) | |
for (var o = e[n], a = t[n], s = 0; s < o.length - 1; s++) { | |
var l = o[s] | |
, u = [l, o[s + 1], a[s + 1], a[s], l]; | |
Zo(r, u) && (i = Math.min(i, Ds(r, u))) | |
} | |
return i !== 1 / 0 && i | |
}(f[0], f[1], h) | |
} | |
, | |
e | |
}(En); | |
function Ts(t, e) { | |
return t.x * e.x + t.y * e.y | |
} | |
function Ds(t, e) { | |
if (1 === t.length) { | |
for (var r, i = 0, n = e[i++]; !r || n.equals(r); ) | |
if (!(r = e[i++])) | |
return 1 / 0; | |
for (; i < e.length; i++) { | |
var o = e[i] | |
, a = t[0] | |
, s = r.sub(n) | |
, l = o.sub(n) | |
, u = a.sub(n) | |
, c = Ts(s, s) | |
, p = Ts(s, l) | |
, h = Ts(l, l) | |
, f = Ts(u, s) | |
, d = Ts(u, l) | |
, m = c * h - p * p | |
, y = (h * f - p * d) / m | |
, g = (c * d - p * f) / m | |
, v = n.z * (1 - y - g) + r.z * y + o.z * g; | |
if (isFinite(v)) | |
return v | |
} | |
return 1 / 0 | |
} | |
for (var _ = 1 / 0, x = 0, b = e; x < b.length; x += 1) | |
_ = Math.min(_, b[x].z); | |
return _ | |
} | |
var Is = Sn([{ | |
name: "a_pos_normal", | |
components: 2, | |
type: "Int16" | |
}, { | |
name: "a_data", | |
components: 4, | |
type: "Uint8" | |
}], 4).members | |
, Fs = Sn([{ | |
name: "a_uv_x", | |
components: 1, | |
type: "Float32" | |
}, { | |
name: "a_split_index", | |
components: 1, | |
type: "Float32" | |
}]).members | |
, Bs = bs.VectorTileFeature.types | |
, Ps = Math.cos(Math.PI / 180 * 37.5) | |
, Ms = Math.pow(2, 14) / .5 | |
, Ls = function(t) { | |
var e = this; | |
this.zoom = t.zoom, | |
this.overscaling = t.overscaling, | |
this.layers = t.layers, | |
this.layerIds = this.layers.map((function(t) { | |
return t.id | |
} | |
)), | |
this.index = t.index, | |
this.hasPattern = !1, | |
this.patternFeatures = [], | |
this.lineClipsArray = [], | |
this.gradients = {}, | |
this.layers.forEach((function(t) { | |
e.gradients[t.id] = {} | |
} | |
)), | |
this.layoutVertexArray = new Fn, | |
this.layoutVertexArray2 = new Bn, | |
this.indexArray = new Nn, | |
this.programConfigurations = new Lo(t.layers,t.zoom), | |
this.segments = new lo, | |
this.maxLineLength = 0, | |
this.stateDependentLayerIds = this.layers.filter((function(t) { | |
return t.isStateDependent() | |
} | |
)).map((function(t) { | |
return t.id | |
} | |
)) | |
}; | |
Ls.prototype.populate = function(t, e, r) { | |
this.hasPattern = as("line", this.layers, e); | |
for (var i = this.layers[0].layout.get("line-sort-key"), n = !i.isConstant(), o = [], a = 0, s = t; a < s.length; a += 1) { | |
var l = s[a] | |
, u = l.feature | |
, c = l.id | |
, p = l.index | |
, h = l.sourceLayerIndex | |
, f = this.layers[0]._featureFilter.needGeometry | |
, d = No(u, f); | |
if (this.layers[0]._featureFilter.filter(new ln(this.zoom), d, r)) { | |
var m = n ? i.evaluate(d, {}, r) : void 0 | |
, y = { | |
id: c, | |
properties: u.properties, | |
type: u.type, | |
sourceLayerIndex: h, | |
index: p, | |
geometry: f ? d.geometry : jo(u), | |
patterns: {}, | |
sortKey: m | |
}; | |
o.push(y) | |
} | |
} | |
n && o.sort((function(t, e) { | |
return t.sortKey - e.sortKey | |
} | |
)); | |
for (var g = 0, v = o; g < v.length; g += 1) { | |
var _ = v[g] | |
, x = _.geometry | |
, b = _.index | |
, w = _.sourceLayerIndex; | |
if (this.hasPattern) { | |
var E = ss("line", this.layers, _, this.zoom, e); | |
this.patternFeatures.push(E) | |
} else | |
this.addFeature(_, x, b, r, {}); | |
e.featureIndex.insert(t[b].feature, x, b, w, this.index) | |
} | |
} | |
, | |
Ls.prototype.update = function(t, e, r) { | |
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t, e, this.stateDependentLayers, r) | |
} | |
, | |
Ls.prototype.addFeatures = function(t, e, r) { | |
for (var i = 0, n = this.patternFeatures; i < n.length; i += 1) { | |
var o = n[i]; | |
this.addFeature(o, o.geometry, o.index, e, r) | |
} | |
} | |
, | |
Ls.prototype.isEmpty = function() { | |
return 0 === this.layoutVertexArray.length | |
} | |
, | |
Ls.prototype.uploadPending = function() { | |
return !this.uploaded || this.programConfigurations.needsUpload | |
} | |
, | |
Ls.prototype.upload = function(t) { | |
this.uploaded || (0 !== this.layoutVertexArray2.length && (this.layoutVertexBuffer2 = t.createVertexBuffer(this.layoutVertexArray2, Fs)), | |
this.layoutVertexBuffer = t.createVertexBuffer(this.layoutVertexArray, Is), | |
this.indexBuffer = t.createIndexBuffer(this.indexArray)), | |
this.programConfigurations.upload(t), | |
this.uploaded = !0 | |
} | |
, | |
Ls.prototype.destroy = function() { | |
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), | |
this.indexBuffer.destroy(), | |
this.programConfigurations.destroy(), | |
this.segments.destroy()) | |
} | |
, | |
Ls.prototype.lineFeatureClips = function(t) { | |
if (t.properties && t.properties.hasOwnProperty("mapbox_clip_start") && t.properties.hasOwnProperty("mapbox_clip_end")) | |
return { | |
start: +t.properties.mapbox_clip_start, | |
end: +t.properties.mapbox_clip_end | |
} | |
} | |
, | |
Ls.prototype.addFeature = function(t, e, r, i, n) { | |
var o = this.layers[0].layout | |
, a = o.get("line-join").evaluate(t, {}) | |
, s = o.get("line-cap") | |
, l = o.get("line-miter-limit") | |
, u = o.get("line-round-limit"); | |
this.lineClips = this.lineFeatureClips(t); | |
for (var c = 0, p = e; c < p.length; c += 1) | |
this.addLine(p[c], t, a, s, l, u); | |
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t, r, n, i) | |
} | |
, | |
Ls.prototype.addLine = function(t, e, r, i, n, o) { | |
if (this.distance = 0, | |
this.scaledDistance = 0, | |
this.totalDistance = 0, | |
this.lineClips) { | |
this.lineClipsArray.push(this.lineClips); | |
for (var a = 0; a < t.length - 1; a++) | |
this.totalDistance += t[a].dist(t[a + 1]); | |
this.updateScaledDistance(), | |
this.maxLineLength = Math.max(this.maxLineLength, this.totalDistance) | |
} | |
for (var s = "Polygon" === Bs[e.type], l = t.length; l >= 2 && t[l - 1].equals(t[l - 2]); ) | |
l--; | |
for (var u = 0; u < l - 1 && t[u].equals(t[u + 1]); ) | |
u++; | |
if (!(l < (s ? 3 : 2))) { | |
"bevel" === r && (n = 1.05); | |
var c, p = this.overscaling <= 16 ? 122880 / (512 * this.overscaling) : 0, h = this.segments.prepareSegment(10 * l, this.layoutVertexArray, this.indexArray), f = void 0, d = void 0, m = void 0, y = void 0; | |
this.e1 = this.e2 = -1, | |
s && (y = t[u].sub(c = t[l - 2])._unit()._perp()); | |
for (var g = u; g < l; g++) | |
if (!(d = g === l - 1 ? s ? t[u + 1] : void 0 : t[g + 1]) || !t[g].equals(d)) { | |
y && (m = y), | |
c && (f = c), | |
c = t[g], | |
y = d ? d.sub(c)._unit()._perp() : m; | |
var v = (m = m || y).add(y); | |
0 === v.x && 0 === v.y || v._unit(); | |
var _ = m.x * y.x + m.y * y.y | |
, x = v.x * y.x + v.y * y.y | |
, b = 0 !== x ? 1 / x : 1 / 0 | |
, w = 2 * Math.sqrt(2 - 2 * x) | |
, E = x < Ps && f && d | |
, C = m.x * y.y - m.y * y.x > 0; | |
if (E && g > u) { | |
var A = c.dist(f); | |
if (A > 2 * p) { | |
var z = c.sub(c.sub(f)._mult(p / A)._round()); | |
this.updateDistance(f, z), | |
this.addCurrentVertex(z, m, 0, 0, h), | |
f = z | |
} | |
} | |
var S = f && d | |
, k = S ? r : s ? "butt" : i; | |
if (S && "round" === k && (b < o ? k = "miter" : b <= 2 && (k = "fakeround")), | |
"miter" === k && b > n && (k = "bevel"), | |
"bevel" === k && (b > 2 && (k = "flipbevel"), | |
b < n && (k = "miter")), | |
f && this.updateDistance(f, c), | |
"miter" === k) | |
v._mult(b), | |
this.addCurrentVertex(c, v, 0, 0, h); | |
else if ("flipbevel" === k) { | |
if (b > 100) | |
v = y.mult(-1); | |
else { | |
var T = b * m.add(y).mag() / m.sub(y).mag(); | |
v._perp()._mult(T * (C ? -1 : 1)) | |
} | |
this.addCurrentVertex(c, v, 0, 0, h), | |
this.addCurrentVertex(c, v.mult(-1), 0, 0, h) | |
} else if ("bevel" === k || "fakeround" === k) { | |
var D = -Math.sqrt(b * b - 1) | |
, I = C ? D : 0 | |
, F = C ? 0 : D; | |
if (f && this.addCurrentVertex(c, m, I, F, h), | |
"fakeround" === k) | |
for (var B = Math.round(180 * w / Math.PI / 20), P = 1; P < B; P++) { | |
var M = P / B; | |
if (.5 !== M) { | |
var L = M - .5; | |
M += M * L * (M - 1) * ((1.0904 + _ * (_ * (3.55645 - 1.43519 * _) - 3.2452)) * L * L + (.848013 + _ * (.215638 * _ - 1.06021))) | |
} | |
var R = y.sub(m)._mult(M)._add(m)._unit()._mult(C ? -1 : 1); | |
this.addHalfVertex(c, R.x, R.y, !1, C, 0, h) | |
} | |
d && this.addCurrentVertex(c, y, -I, -F, h) | |
} else if ("butt" === k) | |
this.addCurrentVertex(c, v, 0, 0, h); | |
else if ("square" === k) { | |
var O = f ? 1 : -1; | |
this.addCurrentVertex(c, v, O, O, h) | |
} else | |
"round" === k && (f && (this.addCurrentVertex(c, m, 0, 0, h), | |
this.addCurrentVertex(c, m, 1, 1, h, !0)), | |
d && (this.addCurrentVertex(c, y, -1, -1, h, !0), | |
this.addCurrentVertex(c, y, 0, 0, h))); | |
if (E && g < l - 1) { | |
var U = c.dist(d); | |
if (U > 2 * p) { | |
var V = c.add(d.sub(c)._mult(p / U)._round()); | |
this.updateDistance(c, V), | |
this.addCurrentVertex(V, y, 0, 0, h), | |
c = V | |
} | |
} | |
} | |
} | |
} | |
, | |
Ls.prototype.addCurrentVertex = function(t, e, r, i, n, o) { | |
void 0 === o && (o = !1); | |
var a = e.y * i - e.x | |
, s = -e.y - e.x * i; | |
this.addHalfVertex(t, e.x + e.y * r, e.y - e.x * r, o, !1, r, n), | |
this.addHalfVertex(t, a, s, o, !0, -i, n), | |
this.distance > Ms / 2 && 0 === this.totalDistance && (this.distance = 0, | |
this.addCurrentVertex(t, e, r, i, n, o)) | |
} | |
, | |
Ls.prototype.addHalfVertex = function(t, e, r, i, n, o, a) { | |
var s = .5 * (this.lineClips ? this.scaledDistance * (Ms - 1) : this.scaledDistance); | |
this.layoutVertexArray.emplaceBack((t.x << 1) + (i ? 1 : 0), (t.y << 1) + (n ? 1 : 0), Math.round(63 * e) + 128, Math.round(63 * r) + 128, 1 + (0 === o ? 0 : o < 0 ? -1 : 1) | (63 & s) << 2, s >> 6), | |
this.lineClips && this.layoutVertexArray2.emplaceBack((this.scaledDistance - this.lineClips.start) / (this.lineClips.end - this.lineClips.start), this.lineClipsArray.length); | |
var l = a.vertexLength++; | |
this.e1 >= 0 && this.e2 >= 0 && (this.indexArray.emplaceBack(this.e1, this.e2, l), | |
a.primitiveLength++), | |
n ? this.e2 = l : this.e1 = l | |
} | |
, | |
Ls.prototype.updateScaledDistance = function() { | |
this.scaledDistance = this.lineClips ? this.lineClips.start + (this.lineClips.end - this.lineClips.start) * this.distance / this.totalDistance : this.distance | |
} | |
, | |
Ls.prototype.updateDistance = function(t, e) { | |
this.distance += t.dist(e), | |
this.updateScaledDistance() | |
} | |
, | |
Oi("LineBucket", Ls, { | |
omit: ["layers", "patternFeatures"] | |
}); | |
var Rs = new wn({ | |
"line-cap": new gn(Dt.layout_line["line-cap"]), | |
"line-join": new vn(Dt.layout_line["line-join"]), | |
"line-miter-limit": new gn(Dt.layout_line["line-miter-limit"]), | |
"line-round-limit": new gn(Dt.layout_line["line-round-limit"]), | |
"line-sort-key": new vn(Dt.layout_line["line-sort-key"]) | |
}) | |
, Os = { | |
paint: new wn({ | |
"line-opacity": new vn(Dt.paint_line["line-opacity"]), | |
"line-color": new vn(Dt.paint_line["line-color"]), | |
"line-translate": new gn(Dt.paint_line["line-translate"]), | |
"line-translate-anchor": new gn(Dt.paint_line["line-translate-anchor"]), | |
"line-width": new vn(Dt.paint_line["line-width"]), | |
"line-gap-width": new vn(Dt.paint_line["line-gap-width"]), | |
"line-offset": new vn(Dt.paint_line["line-offset"]), | |
"line-blur": new vn(Dt.paint_line["line-blur"]), | |
"line-dasharray": new xn(Dt.paint_line["line-dasharray"]), | |
"line-pattern": new _n(Dt.paint_line["line-pattern"]), | |
"line-gradient": new bn(Dt.paint_line["line-gradient"]) | |
}), | |
layout: Rs | |
} | |
, Us = new (function(t) { | |
function e() { | |
t.apply(this, arguments) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.possiblyEvaluate = function(e, r) { | |
return r = new ln(Math.floor(r.zoom),{ | |
now: r.now, | |
fadeDuration: r.fadeDuration, | |
zoomHistory: r.zoomHistory, | |
transition: r.transition | |
}), | |
t.prototype.possiblyEvaluate.call(this, e, r) | |
} | |
, | |
e.prototype.evaluate = function(e, r, i, n) { | |
return r = h({}, r, { | |
zoom: Math.floor(r.zoom) | |
}), | |
t.prototype.evaluate.call(this, e, r, i, n) | |
} | |
, | |
e | |
}(vn))(Os.paint.properties["line-width"].specification); | |
Us.useIntegerZoom = !0; | |
var Vs = function(t) { | |
function e(e) { | |
t.call(this, e, Os), | |
this.gradientVersion = 0 | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype._handleSpecialPaintPropertyUpdate = function(t) { | |
"line-gradient" === t && (this.stepInterpolant = this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ge, | |
this.gradientVersion = (this.gradientVersion + 1) % s) | |
} | |
, | |
e.prototype.gradientExpression = function() { | |
return this._transitionablePaint._values["line-gradient"].value.expression | |
} | |
, | |
e.prototype.recalculate = function(e, r) { | |
t.prototype.recalculate.call(this, e, r), | |
this.paint._values["line-floorwidth"] = Us.possiblyEvaluate(this._transitioningPaint._values["line-width"].value, e) | |
} | |
, | |
e.prototype.createBucket = function(t) { | |
return new Ls(t) | |
} | |
, | |
e.prototype.queryRadius = function(t) { | |
var e = t | |
, r = js(ra("line-width", this, e), ra("line-gap-width", this, e)) | |
, i = ra("line-offset", this, e); | |
return r / 2 + Math.abs(i) + ia(this.paint.get("line-translate")) | |
} | |
, | |
e.prototype.queryIntersectsFeature = function(t, e, r, i, o, a, s) { | |
var l = na(t, this.paint.get("line-translate"), this.paint.get("line-translate-anchor"), a.angle, s) | |
, u = s / 2 * js(this.paint.get("line-width").evaluate(e, r), this.paint.get("line-gap-width").evaluate(e, r)) | |
, c = this.paint.get("line-offset").evaluate(e, r); | |
return c && (i = function(t, e) { | |
for (var r = [], i = new n(0,0), o = 0; o < t.length; o++) { | |
for (var a = t[o], s = [], l = 0; l < a.length; l++) { | |
var u = a[l] | |
, c = a[l + 1] | |
, p = 0 === l ? i : u.sub(a[l - 1])._unit()._perp() | |
, h = l === a.length - 1 ? i : c.sub(u)._unit()._perp() | |
, f = p._add(h)._unit(); | |
f._mult(1 / (f.x * h.x + f.y * h.y)), | |
s.push(f._mult(e)._add(u)) | |
} | |
r.push(s) | |
} | |
return r | |
}(i, c * s)), | |
function(t, e, r) { | |
for (var i = 0; i < e.length; i++) { | |
var n = e[i]; | |
if (t.length >= 3) | |
for (var o = 0; o < n.length; o++) | |
if (ta(t, n[o])) | |
return !0; | |
if (Ho(t, n, r)) | |
return !0 | |
} | |
return !1 | |
}(l, i, u) | |
} | |
, | |
e.prototype.isTileClipped = function() { | |
return !0 | |
} | |
, | |
e | |
}(En); | |
function js(t, e) { | |
return e > 0 ? e + 2 * t : t | |
} | |
var Ns = Sn([{ | |
name: "a_pos_offset", | |
components: 4, | |
type: "Int16" | |
}, { | |
name: "a_data", | |
components: 4, | |
type: "Uint16" | |
}, { | |
name: "a_pixeloffset", | |
components: 4, | |
type: "Int16" | |
}], 4) | |
, qs = Sn([{ | |
name: "a_projected_pos", | |
components: 3, | |
type: "Float32" | |
}], 4) | |
, Gs = (Sn([{ | |
name: "a_fade_opacity", | |
components: 1, | |
type: "Uint32" | |
}], 4), | |
Sn([{ | |
name: "a_placed", | |
components: 2, | |
type: "Uint8" | |
}, { | |
name: "a_shift", | |
components: 2, | |
type: "Float32" | |
}])) | |
, Zs = (Sn([{ | |
type: "Int16", | |
name: "anchorPointX" | |
}, { | |
type: "Int16", | |
name: "anchorPointY" | |
}, { | |
type: "Int16", | |
name: "x1" | |
}, { | |
type: "Int16", | |
name: "y1" | |
}, { | |
type: "Int16", | |
name: "x2" | |
}, { | |
type: "Int16", | |
name: "y2" | |
}, { | |
type: "Uint32", | |
name: "featureIndex" | |
}, { | |
type: "Uint16", | |
name: "sourceLayerIndex" | |
}, { | |
type: "Uint16", | |
name: "bucketIndex" | |
}]), | |
Sn([{ | |
name: "a_pos", | |
components: 2, | |
type: "Int16" | |
}, { | |
name: "a_anchor_pos", | |
components: 2, | |
type: "Int16" | |
}, { | |
name: "a_extrude", | |
components: 2, | |
type: "Int16" | |
}], 4)) | |
, Xs = Sn([{ | |
name: "a_pos", | |
components: 2, | |
type: "Float32" | |
}, { | |
name: "a_radius", | |
components: 1, | |
type: "Float32" | |
}, { | |
name: "a_flags", | |
components: 2, | |
type: "Int16" | |
}], 4); | |
function Ws(t, e, r) { | |
return t.sections.forEach((function(t) { | |
t.text = function(t, e, r) { | |
var i = e.layout.get("text-transform").evaluate(r, {}); | |
return "uppercase" === i ? t = t.toLocaleUpperCase() : "lowercase" === i && (t = t.toLocaleLowerCase()), | |
sn.applyArabicShaping && (t = sn.applyArabicShaping(t)), | |
t | |
}(t.text, e, r) | |
} | |
)), | |
t | |
} | |
Sn([{ | |
name: "triangle", | |
components: 3, | |
type: "Uint16" | |
}]), | |
Sn([{ | |
type: "Int16", | |
name: "anchorX" | |
}, { | |
type: "Int16", | |
name: "anchorY" | |
}, { | |
type: "Uint16", | |
name: "glyphStartIndex" | |
}, { | |
type: "Uint16", | |
name: "numGlyphs" | |
}, { | |
type: "Uint32", | |
name: "vertexStartIndex" | |
}, { | |
type: "Uint32", | |
name: "lineStartIndex" | |
}, { | |
type: "Uint32", | |
name: "lineLength" | |
}, { | |
type: "Uint16", | |
name: "segment" | |
}, { | |
type: "Uint16", | |
name: "lowerSize" | |
}, { | |
type: "Uint16", | |
name: "upperSize" | |
}, { | |
type: "Float32", | |
name: "lineOffsetX" | |
}, { | |
type: "Float32", | |
name: "lineOffsetY" | |
}, { | |
type: "Uint8", | |
name: "writingMode" | |
}, { | |
type: "Uint8", | |
name: "placedOrientation" | |
}, { | |
type: "Uint8", | |
name: "hidden" | |
}, { | |
type: "Uint32", | |
name: "crossTileID" | |
}, { | |
type: "Int16", | |
name: "associatedIconIndex" | |
}]), | |
Sn([{ | |
type: "Int16", | |
name: "anchorX" | |
}, { | |
type: "Int16", | |
name: "anchorY" | |
}, { | |
type: "Int16", | |
name: "rightJustifiedTextSymbolIndex" | |
}, { | |
type: "Int16", | |
name: "centerJustifiedTextSymbolIndex" | |
}, { | |
type: "Int16", | |
name: "leftJustifiedTextSymbolIndex" | |
}, { | |
type: "Int16", | |
name: "verticalPlacedTextSymbolIndex" | |
}, { | |
type: "Int16", | |
name: "placedIconSymbolIndex" | |
}, { | |
type: "Int16", | |
name: "verticalPlacedIconSymbolIndex" | |
}, { | |
type: "Uint16", | |
name: "key" | |
}, { | |
type: "Uint16", | |
name: "textBoxStartIndex" | |
}, { | |
type: "Uint16", | |
name: "textBoxEndIndex" | |
}, { | |
type: "Uint16", | |
name: "verticalTextBoxStartIndex" | |
}, { | |
type: "Uint16", | |
name: "verticalTextBoxEndIndex" | |
}, { | |
type: "Uint16", | |
name: "iconBoxStartIndex" | |
}, { | |
type: "Uint16", | |
name: "iconBoxEndIndex" | |
}, { | |
type: "Uint16", | |
name: "verticalIconBoxStartIndex" | |
}, { | |
type: "Uint16", | |
name: "verticalIconBoxEndIndex" | |
}, { | |
type: "Uint16", | |
name: "featureIndex" | |
}, { | |
type: "Uint16", | |
name: "numHorizontalGlyphVertices" | |
}, { | |
type: "Uint16", | |
name: "numVerticalGlyphVertices" | |
}, { | |
type: "Uint16", | |
name: "numIconVertices" | |
}, { | |
type: "Uint16", | |
name: "numVerticalIconVertices" | |
}, { | |
type: "Uint16", | |
name: "useRuntimeCollisionCircles" | |
}, { | |
type: "Uint32", | |
name: "crossTileID" | |
}, { | |
type: "Float32", | |
name: "textBoxScale" | |
}, { | |
type: "Float32", | |
components: 2, | |
name: "textOffset" | |
}, { | |
type: "Float32", | |
name: "collisionCircleDiameter" | |
}]), | |
Sn([{ | |
type: "Float32", | |
name: "offsetX" | |
}]), | |
Sn([{ | |
type: "Int16", | |
name: "x" | |
}, { | |
type: "Int16", | |
name: "y" | |
}, { | |
type: "Int16", | |
name: "tileUnitDistanceFromAnchor" | |
}]); | |
var Hs = { | |
"!": "︕", | |
"#": "#", | |
$: "$", | |
"%": "%", | |
"&": "&", | |
"(": "︵", | |
")": "︶", | |
"*": "*", | |
"+": "+", | |
",": "︐", | |
"-": "︲", | |
".": "・", | |
"/": "/", | |
":": "︓", | |
";": "︔", | |
"<": "︿", | |
"=": "=", | |
">": "﹀", | |
"?": "︖", | |
"@": "@", | |
"[": "﹇", | |
"\\": "\", | |
"]": "﹈", | |
"^": "^", | |
_: "︳", | |
"`": "`", | |
"{": "︷", | |
"|": "―", | |
"}": "︸", | |
"~": "~", | |
"¢": "¢", | |
"£": "£", | |
"¥": "¥", | |
"¦": "¦", | |
"¬": "¬", | |
"¯": " ̄", | |
"–": "︲", | |
"—": "︱", | |
"‘": "﹃", | |
"’": "﹄", | |
"“": "﹁", | |
"”": "﹂", | |
"…": "︙", | |
"‧": "・", | |
"₩": "₩", | |
"、": "︑", | |
"。": "︒", | |
"〈": "︿", | |
"〉": "﹀", | |
"《": "︽", | |
"》": "︾", | |
"「": "﹁", | |
"」": "﹂", | |
"『": "﹃", | |
"』": "﹄", | |
"【": "︻", | |
"】": "︼", | |
"〔": "︹", | |
"〕": "︺", | |
"〖": "︗", | |
"〗": "︘", | |
"!": "︕", | |
"(": "︵", | |
")": "︶", | |
",": "︐", | |
"-": "︲", | |
".": "・", | |
":": "︓", | |
";": "︔", | |
"<": "︿", | |
">": "﹀", | |
"?": "︖", | |
"[": "﹇", | |
"]": "﹈", | |
"_": "︳", | |
"{": "︷", | |
"|": "―", | |
"}": "︸", | |
"⦅": "︵", | |
"⦆": "︶", | |
"。": "︒", | |
"「": "﹁", | |
"」": "﹂" | |
} | |
, Ks = function(t, e, r, i, n) { | |
var o, a, s = 8 * n - i - 1, l = (1 << s) - 1, u = l >> 1, c = -7, p = r ? n - 1 : 0, h = r ? -1 : 1, f = t[e + p]; | |
for (p += h, | |
o = f & (1 << -c) - 1, | |
f >>= -c, | |
c += s; c > 0; o = 256 * o + t[e + p], | |
p += h, | |
c -= 8) | |
; | |
for (a = o & (1 << -c) - 1, | |
o >>= -c, | |
c += i; c > 0; a = 256 * a + t[e + p], | |
p += h, | |
c -= 8) | |
; | |
if (0 === o) | |
o = 1 - u; | |
else { | |
if (o === l) | |
return a ? NaN : 1 / 0 * (f ? -1 : 1); | |
a += Math.pow(2, i), | |
o -= u | |
} | |
return (f ? -1 : 1) * a * Math.pow(2, o - i) | |
} | |
, Js = function(t, e, r, i, n, o) { | |
var a, s, l, u = 8 * o - n - 1, c = (1 << u) - 1, p = c >> 1, h = 23 === n ? Math.pow(2, -24) - Math.pow(2, -77) : 0, f = i ? 0 : o - 1, d = i ? 1 : -1, m = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0; | |
for (e = Math.abs(e), | |
isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0, | |
a = c) : (a = Math.floor(Math.log(e) / Math.LN2), | |
e * (l = Math.pow(2, -a)) < 1 && (a--, | |
l *= 2), | |
(e += a + p >= 1 ? h / l : h * Math.pow(2, 1 - p)) * l >= 2 && (a++, | |
l /= 2), | |
a + p >= c ? (s = 0, | |
a = c) : a + p >= 1 ? (s = (e * l - 1) * Math.pow(2, n), | |
a += p) : (s = e * Math.pow(2, p - 1) * Math.pow(2, n), | |
a = 0)); n >= 8; t[r + f] = 255 & s, | |
f += d, | |
s /= 256, | |
n -= 8) | |
; | |
for (a = a << n | s, | |
u += n; u > 0; t[r + f] = 255 & a, | |
f += d, | |
a /= 256, | |
u -= 8) | |
; | |
t[r + f - d] |= 128 * m | |
} | |
, Ys = $s; | |
function $s(t) { | |
this.buf = ArrayBuffer.isView && ArrayBuffer.isView(t) ? t : new Uint8Array(t || 0), | |
this.pos = 0, | |
this.type = 0, | |
this.length = this.buf.length | |
} | |
$s.Varint = 0, | |
$s.Fixed64 = 1, | |
$s.Bytes = 2, | |
$s.Fixed32 = 5; | |
var Qs = "undefined" == typeof TextDecoder ? null : new TextDecoder("utf8"); | |
function tl(t) { | |
return t.type === $s.Bytes ? t.readVarint() + t.pos : t.pos + 1 | |
} | |
function el(t, e, r) { | |
return r ? 4294967296 * e + (t >>> 0) : 4294967296 * (e >>> 0) + (t >>> 0) | |
} | |
function rl(t, e, r) { | |
var i = e <= 16383 ? 1 : e <= 2097151 ? 2 : e <= 268435455 ? 3 : Math.floor(Math.log(e) / (7 * Math.LN2)); | |
r.realloc(i); | |
for (var n = r.pos - 1; n >= t; n--) | |
r.buf[n + i] = r.buf[n] | |
} | |
function il(t, e) { | |
for (var r = 0; r < t.length; r++) | |
e.writeVarint(t[r]) | |
} | |
function nl(t, e) { | |
for (var r = 0; r < t.length; r++) | |
e.writeSVarint(t[r]) | |
} | |
function ol(t, e) { | |
for (var r = 0; r < t.length; r++) | |
e.writeFloat(t[r]) | |
} | |
function al(t, e) { | |
for (var r = 0; r < t.length; r++) | |
e.writeDouble(t[r]) | |
} | |
function sl(t, e) { | |
for (var r = 0; r < t.length; r++) | |
e.writeBoolean(t[r]) | |
} | |
function ll(t, e) { | |
for (var r = 0; r < t.length; r++) | |
e.writeFixed32(t[r]) | |
} | |
function ul(t, e) { | |
for (var r = 0; r < t.length; r++) | |
e.writeSFixed32(t[r]) | |
} | |
function cl(t, e) { | |
for (var r = 0; r < t.length; r++) | |
e.writeFixed64(t[r]) | |
} | |
function pl(t, e) { | |
for (var r = 0; r < t.length; r++) | |
e.writeSFixed64(t[r]) | |
} | |
function hl(t, e) { | |
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + 16777216 * t[e + 3] | |
} | |
function fl(t, e, r) { | |
t[r] = e, | |
t[r + 1] = e >>> 8, | |
t[r + 2] = e >>> 16, | |
t[r + 3] = e >>> 24 | |
} | |
function dl(t, e) { | |
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + (t[e + 3] << 24) | |
} | |
function ml(t, e, r) { | |
1 === t && r.readMessage(yl, e) | |
} | |
function yl(t, e, r) { | |
if (3 === t) { | |
var i = r.readMessage(gl, {}) | |
, n = i.width | |
, o = i.height | |
, a = i.left | |
, s = i.top | |
, l = i.advance; | |
e.push({ | |
id: i.id, | |
bitmap: new _a({ | |
width: n + 6, | |
height: o + 6 | |
},i.bitmap), | |
metrics: { | |
width: n, | |
height: o, | |
left: a, | |
top: s, | |
advance: l | |
} | |
}) | |
} | |
} | |
function gl(t, e, r) { | |
1 === t ? e.id = r.readVarint() : 2 === t ? e.bitmap = r.readBytes() : 3 === t ? e.width = r.readVarint() : 4 === t ? e.height = r.readVarint() : 5 === t ? e.left = r.readSVarint() : 6 === t ? e.top = r.readSVarint() : 7 === t && (e.advance = r.readVarint()) | |
} | |
function vl(t) { | |
for (var e = 0, r = 0, i = 0, n = t; i < n.length; i += 1) { | |
var o = n[i]; | |
e += o.w * o.h, | |
r = Math.max(r, o.w) | |
} | |
t.sort((function(t, e) { | |
return e.h - t.h | |
} | |
)); | |
for (var a = [{ | |
x: 0, | |
y: 0, | |
w: Math.max(Math.ceil(Math.sqrt(e / .95)), r), | |
h: 1 / 0 | |
}], s = 0, l = 0, u = 0, c = t; u < c.length; u += 1) | |
for (var p = c[u], h = a.length - 1; h >= 0; h--) { | |
var f = a[h]; | |
if (!(p.w > f.w || p.h > f.h)) { | |
if (p.x = f.x, | |
p.y = f.y, | |
l = Math.max(l, p.y + p.h), | |
s = Math.max(s, p.x + p.w), | |
p.w === f.w && p.h === f.h) { | |
var d = a.pop(); | |
h < a.length && (a[h] = d) | |
} else | |
p.h === f.h ? (f.x += p.w, | |
f.w -= p.w) : p.w === f.w ? (f.y += p.h, | |
f.h -= p.h) : (a.push({ | |
x: f.x + p.w, | |
y: f.y, | |
w: f.w - p.w, | |
h: p.h | |
}), | |
f.y += p.h, | |
f.h -= p.h); | |
break | |
} | |
} | |
return { | |
w: s, | |
h: l, | |
fill: e / (s * l) || 0 | |
} | |
} | |
$s.prototype = { | |
destroy: function() { | |
this.buf = null | |
}, | |
readFields: function(t, e, r) { | |
for (r = r || this.length; this.pos < r; ) { | |
var i = this.readVarint() | |
, n = i >> 3 | |
, o = this.pos; | |
this.type = 7 & i, | |
t(n, e, this), | |
this.pos === o && this.skip(i) | |
} | |
return e | |
}, | |
readMessage: function(t, e) { | |
return this.readFields(t, e, this.readVarint() + this.pos) | |
}, | |
readFixed32: function() { | |
var t = hl(this.buf, this.pos); | |
return this.pos += 4, | |
t | |
}, | |
readSFixed32: function() { | |
var t = dl(this.buf, this.pos); | |
return this.pos += 4, | |
t | |
}, | |
readFixed64: function() { | |
var t = hl(this.buf, this.pos) + 4294967296 * hl(this.buf, this.pos + 4); | |
return this.pos += 8, | |
t | |
}, | |
readSFixed64: function() { | |
var t = hl(this.buf, this.pos) + 4294967296 * dl(this.buf, this.pos + 4); | |
return this.pos += 8, | |
t | |
}, | |
readFloat: function() { | |
var t = Ks(this.buf, this.pos, !0, 23, 4); | |
return this.pos += 4, | |
t | |
}, | |
readDouble: function() { | |
var t = Ks(this.buf, this.pos, !0, 52, 8); | |
return this.pos += 8, | |
t | |
}, | |
readVarint: function(t) { | |
var e, r, i = this.buf; | |
return e = 127 & (r = i[this.pos++]), | |
r < 128 ? e : (e |= (127 & (r = i[this.pos++])) << 7, | |
r < 128 ? e : (e |= (127 & (r = i[this.pos++])) << 14, | |
r < 128 ? e : (e |= (127 & (r = i[this.pos++])) << 21, | |
r < 128 ? e : function(t, e, r) { | |
var i, n, o = r.buf; | |
if (i = (112 & (n = o[r.pos++])) >> 4, | |
n < 128) | |
return el(t, i, e); | |
if (i |= (127 & (n = o[r.pos++])) << 3, | |
n < 128) | |
return el(t, i, e); | |
if (i |= (127 & (n = o[r.pos++])) << 10, | |
n < 128) | |
return el(t, i, e); | |
if (i |= (127 & (n = o[r.pos++])) << 17, | |
n < 128) | |
return el(t, i, e); | |
if (i |= (127 & (n = o[r.pos++])) << 24, | |
n < 128) | |
return el(t, i, e); | |
if (i |= (1 & (n = o[r.pos++])) << 31, | |
n < 128) | |
return el(t, i, e); | |
throw new Error("Expected varint not more than 10 bytes") | |
}(e |= (15 & (r = i[this.pos])) << 28, t, this)))) | |
}, | |
readVarint64: function() { | |
return this.readVarint(!0) | |
}, | |
readSVarint: function() { | |
var t = this.readVarint(); | |
return t % 2 == 1 ? (t + 1) / -2 : t / 2 | |
}, | |
readBoolean: function() { | |
return Boolean(this.readVarint()) | |
}, | |
readString: function() { | |
var t = this.readVarint() + this.pos | |
, e = this.pos; | |
return this.pos = t, | |
t - e >= 12 && Qs ? function(t, e, r) { | |
return Qs.decode(t.subarray(e, r)) | |
}(this.buf, e, t) : function(t, e, r) { | |
for (var i = "", n = e; n < r; ) { | |
var o, a, s, l = t[n], u = null, c = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1; | |
if (n + c > r) | |
break; | |
1 === c ? l < 128 && (u = l) : 2 === c ? 128 == (192 & (o = t[n + 1])) && (u = (31 & l) << 6 | 63 & o) <= 127 && (u = null) : 3 === c ? (a = t[n + 2], | |
128 == (192 & (o = t[n + 1])) && 128 == (192 & a) && ((u = (15 & l) << 12 | (63 & o) << 6 | 63 & a) <= 2047 || u >= 55296 && u <= 57343) && (u = null)) : 4 === c && (a = t[n + 2], | |
s = t[n + 3], | |
128 == (192 & (o = t[n + 1])) && 128 == (192 & a) && 128 == (192 & s) && ((u = (15 & l) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) <= 65535 || u >= 1114112) && (u = null)), | |
null === u ? (u = 65533, | |
c = 1) : u > 65535 && (u -= 65536, | |
i += String.fromCharCode(u >>> 10 & 1023 | 55296), | |
u = 56320 | 1023 & u), | |
i += String.fromCharCode(u), | |
n += c | |
} | |
return i | |
}(this.buf, e, t) | |
}, | |
readBytes: function() { | |
var t = this.readVarint() + this.pos | |
, e = this.buf.subarray(this.pos, t); | |
return this.pos = t, | |
e | |
}, | |
readPackedVarint: function(t, e) { | |
if (this.type !== $s.Bytes) | |
return t.push(this.readVarint(e)); | |
var r = tl(this); | |
for (t = t || []; this.pos < r; ) | |
t.push(this.readVarint(e)); | |
return t | |
}, | |
readPackedSVarint: function(t) { | |
if (this.type !== $s.Bytes) | |
return t.push(this.readSVarint()); | |
var e = tl(this); | |
for (t = t || []; this.pos < e; ) | |
t.push(this.readSVarint()); | |
return t | |
}, | |
readPackedBoolean: function(t) { | |
if (this.type !== $s.Bytes) | |
return t.push(this.readBoolean()); | |
var e = tl(this); | |
for (t = t || []; this.pos < e; ) | |
t.push(this.readBoolean()); | |
return t | |
}, | |
readPackedFloat: function(t) { | |
if (this.type !== $s.Bytes) | |
return t.push(this.readFloat()); | |
var e = tl(this); | |
for (t = t || []; this.pos < e; ) | |
t.push(this.readFloat()); | |
return t | |
}, | |
readPackedDouble: function(t) { | |
if (this.type !== $s.Bytes) | |
return t.push(this.readDouble()); | |
var e = tl(this); | |
for (t = t || []; this.pos < e; ) | |
t.push(this.readDouble()); | |
return t | |
}, | |
readPackedFixed32: function(t) { | |
if (this.type !== $s.Bytes) | |
return t.push(this.readFixed32()); | |
var e = tl(this); | |
for (t = t || []; this.pos < e; ) | |
t.push(this.readFixed32()); | |
return t | |
}, | |
readPackedSFixed32: function(t) { | |
if (this.type !== $s.Bytes) | |
return t.push(this.readSFixed32()); | |
var e = tl(this); | |
for (t = t || []; this.pos < e; ) | |
t.push(this.readSFixed32()); | |
return t | |
}, | |
readPackedFixed64: function(t) { | |
if (this.type !== $s.Bytes) | |
return t.push(this.readFixed64()); | |
var e = tl(this); | |
for (t = t || []; this.pos < e; ) | |
t.push(this.readFixed64()); | |
return t | |
}, | |
readPackedSFixed64: function(t) { | |
if (this.type !== $s.Bytes) | |
return t.push(this.readSFixed64()); | |
var e = tl(this); | |
for (t = t || []; this.pos < e; ) | |
t.push(this.readSFixed64()); | |
return t | |
}, | |
skip: function(t) { | |
var e = 7 & t; | |
if (e === $s.Varint) | |
for (; this.buf[this.pos++] > 127; ) | |
; | |
else if (e === $s.Bytes) | |
this.pos = this.readVarint() + this.pos; | |
else if (e === $s.Fixed32) | |
this.pos += 4; | |
else { | |
if (e !== $s.Fixed64) | |
throw new Error("Unimplemented type: " + e); | |
this.pos += 8 | |
} | |
}, | |
writeTag: function(t, e) { | |
this.writeVarint(t << 3 | e) | |
}, | |
realloc: function(t) { | |
for (var e = this.length || 16; e < this.pos + t; ) | |
e *= 2; | |
if (e !== this.length) { | |
var r = new Uint8Array(e); | |
r.set(this.buf), | |
this.buf = r, | |
this.length = e | |
} | |
}, | |
finish: function() { | |
return this.length = this.pos, | |
this.pos = 0, | |
this.buf.subarray(0, this.length) | |
}, | |
writeFixed32: function(t) { | |
this.realloc(4), | |
fl(this.buf, t, this.pos), | |
this.pos += 4 | |
}, | |
writeSFixed32: function(t) { | |
this.realloc(4), | |
fl(this.buf, t, this.pos), | |
this.pos += 4 | |
}, | |
writeFixed64: function(t) { | |
this.realloc(8), | |
fl(this.buf, -1 & t, this.pos), | |
fl(this.buf, Math.floor(t * (1 / 4294967296)), this.pos + 4), | |
this.pos += 8 | |
}, | |
writeSFixed64: function(t) { | |
this.realloc(8), | |
fl(this.buf, -1 & t, this.pos), | |
fl(this.buf, Math.floor(t * (1 / 4294967296)), this.pos + 4), | |
this.pos += 8 | |
}, | |
writeVarint: function(t) { | |
(t = +t || 0) > 268435455 || t < 0 ? function(t, e) { | |
var r, i; | |
if (t >= 0 ? (r = t % 4294967296 | 0, | |
i = t / 4294967296 | 0) : (i = ~(-t / 4294967296), | |
4294967295 ^ (r = ~(-t % 4294967296)) ? r = r + 1 | 0 : (r = 0, | |
i = i + 1 | 0)), | |
t >= 0x10000000000000000 || t < -0x10000000000000000) | |
throw new Error("Given varint doesn't fit into 10 bytes"); | |
e.realloc(10), | |
function(t, e, r) { | |
r.buf[r.pos++] = 127 & t | 128, | |
t >>>= 7, | |
r.buf[r.pos++] = 127 & t | 128, | |
t >>>= 7, | |
r.buf[r.pos++] = 127 & t | 128, | |
t >>>= 7, | |
r.buf[r.pos++] = 127 & t | 128, | |
r.buf[r.pos] = 127 & (t >>>= 7) | |
}(r, 0, e), | |
function(t, e) { | |
var r = (7 & t) << 4; | |
e.buf[e.pos++] |= r | ((t >>>= 3) ? 128 : 0), | |
t && (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), | |
t && (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), | |
t && (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), | |
t && (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), | |
t && (e.buf[e.pos++] = 127 & t))))) | |
}(i, e) | |
}(t, this) : (this.realloc(4), | |
this.buf[this.pos++] = 127 & t | (t > 127 ? 128 : 0), | |
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), | |
t <= 127 || (this.buf[this.pos++] = t >>> 7 & 127)))) | |
}, | |
writeSVarint: function(t) { | |
this.writeVarint(t < 0 ? 2 * -t - 1 : 2 * t) | |
}, | |
writeBoolean: function(t) { | |
this.writeVarint(Boolean(t)) | |
}, | |
writeString: function(t) { | |
t = String(t), | |
this.realloc(4 * t.length), | |
this.pos++; | |
var e = this.pos; | |
this.pos = function(t, e, r) { | |
for (var i, n, o = 0; o < e.length; o++) { | |
if ((i = e.charCodeAt(o)) > 55295 && i < 57344) { | |
if (!n) { | |
i > 56319 || o + 1 === e.length ? (t[r++] = 239, | |
t[r++] = 191, | |
t[r++] = 189) : n = i; | |
continue | |
} | |
if (i < 56320) { | |
t[r++] = 239, | |
t[r++] = 191, | |
t[r++] = 189, | |
n = i; | |
continue | |
} | |
i = n - 55296 << 10 | i - 56320 | 65536, | |
n = null | |
} else | |
n && (t[r++] = 239, | |
t[r++] = 191, | |
t[r++] = 189, | |
n = null); | |
i < 128 ? t[r++] = i : (i < 2048 ? t[r++] = i >> 6 | 192 : (i < 65536 ? t[r++] = i >> 12 | 224 : (t[r++] = i >> 18 | 240, | |
t[r++] = i >> 12 & 63 | 128), | |
t[r++] = i >> 6 & 63 | 128), | |
t[r++] = 63 & i | 128) | |
} | |
return r | |
}(this.buf, t, this.pos); | |
var r = this.pos - e; | |
r >= 128 && rl(e, r, this), | |
this.pos = e - 1, | |
this.writeVarint(r), | |
this.pos += r | |
}, | |
writeFloat: function(t) { | |
this.realloc(4), | |
Js(this.buf, t, this.pos, !0, 23, 4), | |
this.pos += 4 | |
}, | |
writeDouble: function(t) { | |
this.realloc(8), | |
Js(this.buf, t, this.pos, !0, 52, 8), | |
this.pos += 8 | |
}, | |
writeBytes: function(t) { | |
var e = t.length; | |
this.writeVarint(e), | |
this.realloc(e); | |
for (var r = 0; r < e; r++) | |
this.buf[this.pos++] = t[r] | |
}, | |
writeRawMessage: function(t, e) { | |
this.pos++; | |
var r = this.pos; | |
t(e, this); | |
var i = this.pos - r; | |
i >= 128 && rl(r, i, this), | |
this.pos = r - 1, | |
this.writeVarint(i), | |
this.pos += i | |
}, | |
writeMessage: function(t, e, r) { | |
this.writeTag(t, $s.Bytes), | |
this.writeRawMessage(e, r) | |
}, | |
writePackedVarint: function(t, e) { | |
e.length && this.writeMessage(t, il, e) | |
}, | |
writePackedSVarint: function(t, e) { | |
e.length && this.writeMessage(t, nl, e) | |
}, | |
writePackedBoolean: function(t, e) { | |
e.length && this.writeMessage(t, sl, e) | |
}, | |
writePackedFloat: function(t, e) { | |
e.length && this.writeMessage(t, ol, e) | |
}, | |
writePackedDouble: function(t, e) { | |
e.length && this.writeMessage(t, al, e) | |
}, | |
writePackedFixed32: function(t, e) { | |
e.length && this.writeMessage(t, ll, e) | |
}, | |
writePackedSFixed32: function(t, e) { | |
e.length && this.writeMessage(t, ul, e) | |
}, | |
writePackedFixed64: function(t, e) { | |
e.length && this.writeMessage(t, cl, e) | |
}, | |
writePackedSFixed64: function(t, e) { | |
e.length && this.writeMessage(t, pl, e) | |
}, | |
writeBytesField: function(t, e) { | |
this.writeTag(t, $s.Bytes), | |
this.writeBytes(e) | |
}, | |
writeFixed32Field: function(t, e) { | |
this.writeTag(t, $s.Fixed32), | |
this.writeFixed32(e) | |
}, | |
writeSFixed32Field: function(t, e) { | |
this.writeTag(t, $s.Fixed32), | |
this.writeSFixed32(e) | |
}, | |
writeFixed64Field: function(t, e) { | |
this.writeTag(t, $s.Fixed64), | |
this.writeFixed64(e) | |
}, | |
writeSFixed64Field: function(t, e) { | |
this.writeTag(t, $s.Fixed64), | |
this.writeSFixed64(e) | |
}, | |
writeVarintField: function(t, e) { | |
this.writeTag(t, $s.Varint), | |
this.writeVarint(e) | |
}, | |
writeSVarintField: function(t, e) { | |
this.writeTag(t, $s.Varint), | |
this.writeSVarint(e) | |
}, | |
writeStringField: function(t, e) { | |
this.writeTag(t, $s.Bytes), | |
this.writeString(e) | |
}, | |
writeFloatField: function(t, e) { | |
this.writeTag(t, $s.Fixed32), | |
this.writeFloat(e) | |
}, | |
writeDoubleField: function(t, e) { | |
this.writeTag(t, $s.Fixed64), | |
this.writeDouble(e) | |
}, | |
writeBooleanField: function(t, e) { | |
this.writeVarintField(t, Boolean(e)) | |
} | |
}; | |
var _l = function(t, e) { | |
var r = e.pixelRatio | |
, i = e.version | |
, n = e.stretchX | |
, o = e.stretchY | |
, a = e.content; | |
this.paddedRect = t, | |
this.pixelRatio = r, | |
this.stretchX = n, | |
this.stretchY = o, | |
this.content = a, | |
this.version = i | |
} | |
, xl = { | |
tl: { | |
configurable: !0 | |
}, | |
br: { | |
configurable: !0 | |
}, | |
tlbr: { | |
configurable: !0 | |
}, | |
displaySize: { | |
configurable: !0 | |
} | |
}; | |
xl.tl.get = function() { | |
return [this.paddedRect.x + 1, this.paddedRect.y + 1] | |
} | |
, | |
xl.br.get = function() { | |
return [this.paddedRect.x + this.paddedRect.w - 1, this.paddedRect.y + this.paddedRect.h - 1] | |
} | |
, | |
xl.tlbr.get = function() { | |
return this.tl.concat(this.br) | |
} | |
, | |
xl.displaySize.get = function() { | |
return [(this.paddedRect.w - 2) / this.pixelRatio, (this.paddedRect.h - 2) / this.pixelRatio] | |
} | |
, | |
Object.defineProperties(_l.prototype, xl); | |
var bl = function(t, e) { | |
var r = {} | |
, i = {}; | |
this.haveRenderCallbacks = []; | |
var n = []; | |
this.addImages(t, r, n), | |
this.addImages(e, i, n); | |
var o = vl(n) | |
, a = new xa({ | |
width: o.w || 1, | |
height: o.h || 1 | |
}); | |
for (var s in t) { | |
var l = t[s] | |
, u = r[s].paddedRect; | |
xa.copy(l.data, a, { | |
x: 0, | |
y: 0 | |
}, { | |
x: u.x + 1, | |
y: u.y + 1 | |
}, l.data) | |
} | |
for (var c in e) { | |
var p = e[c] | |
, h = i[c].paddedRect | |
, f = h.x + 1 | |
, d = h.y + 1 | |
, m = p.data.width | |
, y = p.data.height; | |
xa.copy(p.data, a, { | |
x: 0, | |
y: 0 | |
}, { | |
x: f, | |
y: d | |
}, p.data), | |
xa.copy(p.data, a, { | |
x: 0, | |
y: y - 1 | |
}, { | |
x: f, | |
y: d - 1 | |
}, { | |
width: m, | |
height: 1 | |
}), | |
xa.copy(p.data, a, { | |
x: 0, | |
y: 0 | |
}, { | |
x: f, | |
y: d + y | |
}, { | |
width: m, | |
height: 1 | |
}), | |
xa.copy(p.data, a, { | |
x: m - 1, | |
y: 0 | |
}, { | |
x: f - 1, | |
y: d | |
}, { | |
width: 1, | |
height: y | |
}), | |
xa.copy(p.data, a, { | |
x: 0, | |
y: 0 | |
}, { | |
x: f + m, | |
y: d | |
}, { | |
width: 1, | |
height: y | |
}) | |
} | |
this.image = a, | |
this.iconPositions = r, | |
this.patternPositions = i | |
}; | |
bl.prototype.addImages = function(t, e, r) { | |
for (var i in t) { | |
var n = t[i] | |
, o = { | |
x: 0, | |
y: 0, | |
w: n.data.width + 2, | |
h: n.data.height + 2 | |
}; | |
r.push(o), | |
e[i] = new _l(o,n), | |
n.hasRenderCallback && this.haveRenderCallbacks.push(i) | |
} | |
} | |
, | |
bl.prototype.patchUpdatedImages = function(t, e) { | |
for (var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks), | |
t.updatedImages) | |
this.patchUpdatedImage(this.iconPositions[r], t.getImage(r), e), | |
this.patchUpdatedImage(this.patternPositions[r], t.getImage(r), e) | |
} | |
, | |
bl.prototype.patchUpdatedImage = function(t, e, r) { | |
if (t && e && t.version !== e.version) { | |
t.version = e.version; | |
var i = t.tl; | |
r.update(e.data, void 0, { | |
x: i[0], | |
y: i[1] | |
}) | |
} | |
} | |
, | |
Oi("ImagePosition", _l), | |
Oi("ImageAtlas", bl); | |
var wl = { | |
horizontal: 1, | |
vertical: 2, | |
horizontalOnly: 3 | |
} | |
, El = function() { | |
this.scale = 1, | |
this.fontStack = "", | |
this.imageName = null | |
}; | |
El.forText = function(t, e) { | |
var r = new El; | |
return r.scale = t || 1, | |
r.fontStack = e, | |
r | |
} | |
, | |
El.forImage = function(t) { | |
var e = new El; | |
return e.imageName = t, | |
e | |
} | |
; | |
var Cl = function() { | |
this.text = "", | |
this.sectionIndex = [], | |
this.sections = [], | |
this.imageSectionID = null | |
}; | |
function Al(t, e, r, i, n, o, a, s, l, u, c, p, h, f, d, m) { | |
var y, g = Cl.fromFeature(t, n); | |
p === wl.vertical && g.verticalizePunctuation(); | |
var v = sn.processBidirectionalText | |
, _ = sn.processStyledBidirectionalText; | |
if (v && 1 === g.sections.length) { | |
y = []; | |
for (var x = 0, b = v(g.toString(), Fl(g, u, o, e, i, f, d)); x < b.length; x += 1) { | |
var w = b[x] | |
, E = new Cl; | |
E.text = w, | |
E.sections = g.sections; | |
for (var C = 0; C < w.length; C++) | |
E.sectionIndex.push(0); | |
y.push(E) | |
} | |
} else if (_) { | |
y = []; | |
for (var A = 0, z = _(g.text, g.sectionIndex, Fl(g, u, o, e, i, f, d)); A < z.length; A += 1) { | |
var S = z[A] | |
, k = new Cl; | |
k.text = S[0], | |
k.sectionIndex = S[1], | |
k.sections = g.sections, | |
y.push(k) | |
} | |
} else | |
y = function(t, e) { | |
for (var r = [], i = t.text, n = 0, o = 0, a = e; o < a.length; o += 1) { | |
var s = a[o]; | |
r.push(t.substring(n, s)), | |
n = s | |
} | |
return n < i.length && r.push(t.substring(n, i.length)), | |
r | |
}(g, Fl(g, u, o, e, i, f, d)); | |
var T = [] | |
, D = { | |
positionedLines: T, | |
text: g.toString(), | |
top: c[1], | |
bottom: c[1], | |
left: c[0], | |
right: c[0], | |
writingMode: p, | |
iconsInText: !1, | |
verticalizable: !1 | |
}; | |
return function(t, e, r, i, n, o, a, s, l, u, c, p) { | |
for (var h = 0, f = -17, d = 0, m = 0, y = "right" === s ? 1 : "left" === s ? 0 : .5, g = 0, v = 0, _ = n; v < _.length; v += 1) { | |
var x = _[v]; | |
x.trim(); | |
var b = x.getMaxScale() | |
, w = 24 * (b - 1) | |
, E = { | |
positionedGlyphs: [], | |
lineOffset: 0 | |
}; | |
t.positionedLines[g] = E; | |
var C = E.positionedGlyphs | |
, A = 0; | |
if (x.length()) { | |
for (var z = 0; z < x.length(); z++) { | |
var S = x.getSection(z) | |
, k = x.getSectionIndex(z) | |
, T = x.getCharCode(z) | |
, D = 0 | |
, I = null | |
, F = null | |
, B = null | |
, P = 24 | |
, M = !(l === wl.horizontal || !c && !Wi(T) || c && (zl[T] || (G = T, | |
Zi.Arabic(G) || Zi["Arabic Supplement"](G) || Zi["Arabic Extended-A"](G) || Zi["Arabic Presentation Forms-A"](G) || Zi["Arabic Presentation Forms-B"](G)))); | |
if (S.imageName) { | |
var L = i[S.imageName]; | |
if (!L) | |
continue; | |
B = S.imageName, | |
t.iconsInText = t.iconsInText || !0, | |
F = L.paddedRect; | |
var R = L.displaySize; | |
S.scale = 24 * S.scale / p, | |
D = w + (24 - R[1] * S.scale), | |
P = (I = { | |
width: R[0], | |
height: R[1], | |
left: 1, | |
top: -3, | |
advance: M ? R[1] : R[0] | |
}).advance; | |
var O = M ? R[0] * S.scale - 24 * b : R[1] * S.scale - 24 * b; | |
O > 0 && O > A && (A = O) | |
} else { | |
var U = r[S.fontStack] | |
, V = U && U[T]; | |
if (V && V.rect) | |
F = V.rect, | |
I = V.metrics; | |
else { | |
var j = e[S.fontStack] | |
, N = j && j[T]; | |
if (!N) | |
continue; | |
I = N.metrics | |
} | |
D = 24 * (b - S.scale) | |
} | |
M ? (t.verticalizable = !0, | |
C.push({ | |
glyph: T, | |
imageName: B, | |
x: h, | |
y: f + D, | |
vertical: M, | |
scale: S.scale, | |
fontStack: S.fontStack, | |
sectionIndex: k, | |
metrics: I, | |
rect: F | |
}), | |
h += P * S.scale + u) : (C.push({ | |
glyph: T, | |
imageName: B, | |
x: h, | |
y: f + D, | |
vertical: M, | |
scale: S.scale, | |
fontStack: S.fontStack, | |
sectionIndex: k, | |
metrics: I, | |
rect: F | |
}), | |
h += I.advance * S.scale + u) | |
} | |
0 !== C.length && (d = Math.max(h - u, d), | |
Pl(C, 0, C.length - 1, y, A)), | |
h = 0; | |
var q = o * b + A; | |
E.lineOffset = Math.max(A, w), | |
f += q, | |
m = Math.max(q, m), | |
++g | |
} else | |
f += o, | |
++g | |
} | |
var G, Z = f - -17, X = Bl(a), W = X.horizontalAlign, H = X.verticalAlign; | |
(function(t, e, r, i, n, o, a, s, l) { | |
var u, c = (e - r) * n; | |
u = o !== a ? -s * i - -17 : (-i * l + .5) * a; | |
for (var p = 0, h = t; p < h.length; p += 1) | |
for (var f = 0, d = h[p].positionedGlyphs; f < d.length; f += 1) { | |
var m = d[f]; | |
m.x += c, | |
m.y += u | |
} | |
} | |
)(t.positionedLines, y, W, H, d, m, o, Z, n.length), | |
t.top += -H * Z, | |
t.bottom = t.top + Z, | |
t.left += -W * d, | |
t.right = t.left + d | |
}(D, e, r, i, y, a, s, l, p, u, h, m), | |
!function(t) { | |
for (var e = 0, r = t; e < r.length; e += 1) | |
if (0 !== r[e].positionedGlyphs.length) | |
return !1; | |
return !0 | |
}(T) && D | |
} | |
Cl.fromFeature = function(t, e) { | |
for (var r = new Cl, i = 0; i < t.sections.length; i++) { | |
var n = t.sections[i]; | |
n.image ? r.addImageSection(n) : r.addTextSection(n, e) | |
} | |
return r | |
} | |
, | |
Cl.prototype.length = function() { | |
return this.text.length | |
} | |
, | |
Cl.prototype.getSection = function(t) { | |
return this.sections[this.sectionIndex[t]] | |
} | |
, | |
Cl.prototype.getSectionIndex = function(t) { | |
return this.sectionIndex[t] | |
} | |
, | |
Cl.prototype.getCharCode = function(t) { | |
return this.text.charCodeAt(t) | |
} | |
, | |
Cl.prototype.verticalizePunctuation = function() { | |
this.text = function(t) { | |
for (var e = "", r = 0; r < t.length; r++) { | |
var i = t.charCodeAt(r + 1) || null | |
, n = t.charCodeAt(r - 1) || null; | |
e += i && Hi(i) && !Hs[t[r + 1]] || n && Hi(n) && !Hs[t[r - 1]] || !Hs[t[r]] ? t[r] : Hs[t[r]] | |
} | |
return e | |
}(this.text) | |
} | |
, | |
Cl.prototype.trim = function() { | |
for (var t = 0, e = 0; e < this.text.length && zl[this.text.charCodeAt(e)]; e++) | |
t++; | |
for (var r = this.text.length, i = this.text.length - 1; i >= 0 && i >= t && zl[this.text.charCodeAt(i)]; i--) | |
r--; | |
this.text = this.text.substring(t, r), | |
this.sectionIndex = this.sectionIndex.slice(t, r) | |
} | |
, | |
Cl.prototype.substring = function(t, e) { | |
var r = new Cl; | |
return r.text = this.text.substring(t, e), | |
r.sectionIndex = this.sectionIndex.slice(t, e), | |
r.sections = this.sections, | |
r | |
} | |
, | |
Cl.prototype.toString = function() { | |
return this.text | |
} | |
, | |
Cl.prototype.getMaxScale = function() { | |
var t = this; | |
return this.sectionIndex.reduce((function(e, r) { | |
return Math.max(e, t.sections[r].scale) | |
} | |
), 0) | |
} | |
, | |
Cl.prototype.addTextSection = function(t, e) { | |
this.text += t.text, | |
this.sections.push(El.forText(t.scale, t.fontStack || e)); | |
for (var r = this.sections.length - 1, i = 0; i < t.text.length; ++i) | |
this.sectionIndex.push(r) | |
} | |
, | |
Cl.prototype.addImageSection = function(t) { | |
var e = t.image ? t.image.name : ""; | |
if (0 !== e.length) { | |
var r = this.getNextImageSectionCharCode(); | |
r ? (this.text += String.fromCharCode(r), | |
this.sections.push(El.forImage(e)), | |
this.sectionIndex.push(this.sections.length - 1)) : E("Reached maximum number of images 6401") | |
} else | |
E("Can't add FormattedSection with an empty image.") | |
} | |
, | |
Cl.prototype.getNextImageSectionCharCode = function() { | |
return this.imageSectionID ? this.imageSectionID >= 63743 ? null : ++this.imageSectionID : (this.imageSectionID = 57344, | |
this.imageSectionID) | |
} | |
; | |
var zl = { | |
9: !0, | |
10: !0, | |
11: !0, | |
12: !0, | |
13: !0, | |
32: !0 | |
} | |
, Sl = {}; | |
function kl(t, e, r, i, n, o) { | |
if (e.imageName) { | |
var a = i[e.imageName]; | |
return a ? a.displaySize[0] * e.scale * 24 / o + n : 0 | |
} | |
var s = r[e.fontStack] | |
, l = s && s[t]; | |
return l ? l.metrics.advance * e.scale + n : 0 | |
} | |
function Tl(t, e, r, i) { | |
var n = Math.pow(t - e, 2); | |
return i ? t < e ? n / 2 : 2 * n : n + Math.abs(r) * r | |
} | |
function Dl(t, e, r) { | |
var i = 0; | |
return 10 === t && (i -= 1e4), | |
r && (i += 150), | |
40 !== t && 65288 !== t || (i += 50), | |
41 !== e && 65289 !== e || (i += 50), | |
i | |
} | |
function Il(t, e, r, i, n, o) { | |
for (var a = null, s = Tl(e, r, n, o), l = 0, u = i; l < u.length; l += 1) { | |
var c = u[l] | |
, p = Tl(e - c.x, r, n, o) + c.badness; | |
p <= s && (a = c, | |
s = p) | |
} | |
return { | |
index: t, | |
x: e, | |
priorBreak: a, | |
badness: s | |
} | |
} | |
function Fl(t, e, r, i, n, o, a) { | |
if ("point" !== o) | |
return []; | |
if (!t) | |
return []; | |
for (var s, l = [], u = function(t, e, r, i, n, o) { | |
for (var a = 0, s = 0; s < t.length(); s++) { | |
var l = t.getSection(s); | |
a += kl(t.getCharCode(s), l, i, n, e, o) | |
} | |
return a / Math.max(1, Math.ceil(a / r)) | |
}(t, e, r, i, n, a), c = t.text.indexOf("") >= 0, p = 0, h = 0; h < t.length(); h++) { | |
var f = t.getSection(h) | |
, d = t.getCharCode(h); | |
if (zl[d] || (p += kl(d, f, i, n, e, a)), | |
h < t.length() - 1) { | |
var m = !((s = d) < 11904 || !(Zi["Bopomofo Extended"](s) || Zi.Bopomofo(s) || Zi["CJK Compatibility Forms"](s) || Zi["CJK Compatibility Ideographs"](s) || Zi["CJK Compatibility"](s) || Zi["CJK Radicals Supplement"](s) || Zi["CJK Strokes"](s) || Zi["CJK Symbols and Punctuation"](s) || Zi["CJK Unified Ideographs Extension A"](s) || Zi["CJK Unified Ideographs"](s) || Zi["Enclosed CJK Letters and Months"](s) || Zi["Halfwidth and Fullwidth Forms"](s) || Zi.Hiragana(s) || Zi["Ideographic Description Characters"](s) || Zi["Kangxi Radicals"](s) || Zi["Katakana Phonetic Extensions"](s) || Zi.Katakana(s) || Zi["Vertical Forms"](s) || Zi["Yi Radicals"](s) || Zi["Yi Syllables"](s))); | |
(Sl[d] || m || f.imageName) && l.push(Il(h + 1, p, u, l, Dl(d, t.getCharCode(h + 1), m && c), !1)) | |
} | |
} | |
return function t(e) { | |
return e ? t(e.priorBreak).concat(e.index) : [] | |
}(Il(t.length(), p, u, l, 0, !0)) | |
} | |
function Bl(t) { | |
var e = .5 | |
, r = .5; | |
switch (t) { | |
case "right": | |
case "top-right": | |
case "bottom-right": | |
e = 1; | |
break; | |
case "left": | |
case "top-left": | |
case "bottom-left": | |
e = 0 | |
} | |
switch (t) { | |
case "bottom": | |
case "bottom-right": | |
case "bottom-left": | |
r = 1; | |
break; | |
case "top": | |
case "top-right": | |
case "top-left": | |
r = 0 | |
} | |
return { | |
horizontalAlign: e, | |
verticalAlign: r | |
} | |
} | |
function Pl(t, e, r, i, n) { | |
if (i || n) | |
for (var o = t[r], a = (t[r].x + o.metrics.advance * o.scale) * i, s = e; s <= r; s++) | |
t[s].x -= a, | |
t[s].y += n | |
} | |
function Ml(t, e, r, i, n, o) { | |
var a, s = t.image; | |
if (s.content) { | |
var l = s.content | |
, u = s.pixelRatio || 1; | |
a = [l[0] / u, l[1] / u, s.displaySize[0] - l[2] / u, s.displaySize[1] - l[3] / u] | |
} | |
var c, p, h, f, d = e.left * o, m = e.right * o; | |
"width" === r || "both" === r ? (f = n[0] + d - i[3], | |
p = n[0] + m + i[1]) : p = (f = n[0] + (d + m - s.displaySize[0]) / 2) + s.displaySize[0]; | |
var y = e.top * o | |
, g = e.bottom * o; | |
return "height" === r || "both" === r ? (c = n[1] + y - i[0], | |
h = n[1] + g + i[2]) : h = (c = n[1] + (y + g - s.displaySize[1]) / 2) + s.displaySize[1], | |
{ | |
image: s, | |
top: c, | |
right: p, | |
bottom: h, | |
left: f, | |
collisionPadding: a | |
} | |
} | |
Sl[10] = !0, | |
Sl[32] = !0, | |
Sl[38] = !0, | |
Sl[40] = !0, | |
Sl[41] = !0, | |
Sl[43] = !0, | |
Sl[45] = !0, | |
Sl[47] = !0, | |
Sl[173] = !0, | |
Sl[183] = !0, | |
Sl[8203] = !0, | |
Sl[8208] = !0, | |
Sl[8211] = !0, | |
Sl[8231] = !0; | |
var Ll = function(t) { | |
function e(e, r, i, n) { | |
t.call(this, e, r), | |
this.angle = i, | |
void 0 !== n && (this.segment = n) | |
} | |
return t && (e.__proto__ = t), | |
(e.prototype = Object.create(t && t.prototype)).constructor = e, | |
e.prototype.clone = function() { | |
return new e(this.x,this.y,this.angle,this.segment) | |
} | |
, | |
e | |
}(n); | |
function Rl(t, e) { | |
var r = e.expression; | |
if ("constant" === r.kind) | |
return { | |
kind: "constant", | |
layoutSize: r.evaluate(new ln(t + 1)) | |
}; | |
if ("source" === r.kind) | |
return { | |
kind: "source" | |
}; | |
for (var i = r.zoomStops, n = r.interpolationType, o = 0; o < i.length && i[o] <= t; ) | |
o++; | |
for (var a = o = Math.max(0, o - 1); a < i.length && i[a] < t + 1; ) | |
a++; | |
a = Math.min(i.length - 1, a); | |
var s = i[o] | |
, l = i[a]; | |
return "composite" === r.kind ? { | |
kind: "composite", | |
minZoom: s, | |
maxZoom: l, | |
interpolationType: n | |
} : { | |
kind: "camera", | |
minZoom: s, | |
maxZoom: l, | |
minSize: r.evaluate(new ln(s)), | |
maxSize: r.evaluate(new ln(l)), | |
interpolationType: n | |
} | |
} | |
function Ol(t, e, r) { | |
var i = e.uSize | |
, n = r.lowerSize; | |
return "source" === t.kind ? n / 128 : "composite" === t.kind ? Ze(n / 128, r.upperSize / 128, e.uSizeT) : i | |
} | |
function Ul(t, e) { | |
var r = 0 | |
, i = 0; | |
if ("constant" === t.kind) | |
i = t.layoutSize; | |
else if ("source" !== t.kind) { | |
var n = t.interpolationType | |
, o = n ? c(ar.interpolationFactor(n, e, t.minZoom, t.maxZoom), 0, 1) : 0; | |
"camera" === t.kind ? i = Ze(t.minSize, t.maxSize, o) : r = o | |
} | |
return { | |
uSizeT: r, | |
uSize: i | |
} | |
} | |
Oi("Anchor", Ll); | |
var Vl = Object.freeze({ | |
__proto__: null, | |
getSizeData: Rl, | |
evaluateSizeForFeature: Ol, | |
evaluateSizeForZoom: Ul, | |
SIZE_PACK_FACTOR: 128 | |
}); | |
function jl(t, e, r, i, n) { | |
if (void 0 === e.segment) | |
return !0; | |
for (var o = e, a = e.segment + 1, s = 0; s > -r / 2; ) { | |
if (--a < 0) | |
return !1; | |
s -= t[a].dist(o), | |
o = t[a] | |
} | |
s += t[a].dist(t[a + 1]), | |
a++; | |
for (var l = [], u = 0; s < r / 2; ) { | |
var c = t[a] | |
, p = t[a + 1]; | |
if (!p) | |
return !1; | |
var h = t[a - 1].angleTo(c) - c.angleTo(p); | |
for (h = Math.abs((h + 3 * Math.PI) % (2 * Math.PI) - Math.PI), | |
l.push({ | |
distance: s, | |
angleDelta: h | |
}), | |
u += h; s - l[0].distance > i; ) | |
u -= l.shift().angleDelta; | |
if (u > n) | |
return !1; | |
a++, | |
s += c.dist(p) | |
} | |
return !0 | |
} | |
function Nl(t) { | |
for (var e = 0, r = 0; r < t.length - 1; r++) | |
e += t[r].dist(t[r + 1]); | |
return e | |
} | |
function ql(t, e, r) { | |
return t ? .6 * e * r : 0 | |
} | |
function Gl(t, e) { | |
return Math.max(t ? t.right - t.left : 0, e ? e.right - e.left : 0) | |
} | |
function Zl(t, e, r, i, n, o) { | |
for (var a = ql(r, n, o), s = Gl(r, i) * o, l = 0, u = Nl(t) / 2, c = 0; c < t.length - 1; c++) { | |
var p = t[c] | |
, h = t[c + 1] | |
, f = p.dist(h); | |
if (l + f > u) { | |
var d = (u - l) / f | |
, m = Ze(p.x, h.x, d) | |
, y = Ze(p.y, h.y, d) | |
, g = new Ll(m,y,h.angleTo(p),c); | |
return g._round(), | |
!a || jl(t, g, s, a, e) ? g : void 0 | |
} | |
l += f | |
} | |
} | |
function Xl(t, e, r, i, n, o, a, s, l) { | |
var u = ql(i, o, a) | |
, c = Gl(i, n) | |
, p = c * a | |
, h = 0 === t[0].x || t[0].x === l || 0 === t[0].y || t[0].y === l; | |
return e - p < e / 4 && (e = p + e / 4), | |
function t(e, r, i, n, o, a, s, l, u) { | |
for (var c = a / 2, p = Nl(e), h = 0, f = r - i, d = [], m = 0; m < e.length - 1; m++) { | |
for (var y = e[m], g = e[m + 1], v = y.dist(g), _ = g.angleTo(y); f + i < h + v; ) { | |
var x = ((f += i) - h) / v | |
, b = Ze(y.x, g.x, x) | |
, w = Ze(y.y, g.y, x); | |
if (b >= 0 && b < u && w >= 0 && w < u && f - c >= 0 && f + c <= p) { | |
var E = new Ll(b,w,_,m); | |
E._round(), | |
n && !jl(e, E, a, n, o) || d.push(E) | |
} | |
} | |
h += v | |
} | |
return l || d.length || s || (d = t(e, h / 2, i, n, o, a, s, !0, u)), | |
d | |
}(t, h ? e / 2 * s % e : (c / 2 + 2 * o) * a * s % e, e, u, r, p, h, !1, l) | |
} | |
function Wl(t, e, r, i, o) { | |
for (var a = [], s = 0; s < t.length; s++) | |
for (var l = t[s], u = void 0, c = 0; c < l.length - 1; c++) { | |
var p = l[c] | |
, h = l[c + 1]; | |
p.x < e && h.x < e || (p.x < e ? p = new n(e,p.y + (e - p.x) / (h.x - p.x) * (h.y - p.y))._round() : h.x < e && (h = new n(e,p.y + (e - p.x) / (h.x - p.x) * (h.y - p.y))._round()), | |
p.y < r && h.y < r || (p.y < r ? p = new n(p.x + (r - p.y) / (h.y - p.y) * (h.x - p.x),r)._round() : h.y < r && (h = new n(p.x + (r - p.y) / (h.y - p.y) * (h.x - p.x),r)._round()), | |
p.x >= i && h.x >= i || (p.x >= i ? p = new n(i,p.y + (i - p.x) / (h.x - p.x) * (h.y - p.y))._round() : h.x >= i && (h = new n(i,p.y + (i - p.x) / (h.x - p.x) * (h.y - p.y))._round()), | |
p.y >= o && h.y >= o || (p.y >= o ? p = new n(p.x + (o - p.y) / (h.y - p.y) * (h.x - p.x),o)._round() : h.y >= o && (h = new n(p.x + (o - p.y) / (h.y - p.y) * (h.x - p.x),o)._round()), | |
u && p.equals(u[u.length - 1]) || a.push(u = [p]), | |
u.push(h))))) | |
} | |
return a | |
} | |
function Hl(t, e, r, i) { | |
var o = [] | |
, a = t.image | |
, s = a.pixelRatio | |
, l = a.paddedRect.w - 2 | |
, u = a.paddedRect.h - 2 | |
, c = t.right - t.left | |
, p = t.bottom - t.top | |
, h = a.stretchX || [[0, l]] | |
, f = a.stretchY || [[0, u]] | |
, d = function(t, e) { | |
return t + e[1] - e[0] | |
} | |
, m = h.reduce(d, 0) | |
, y = f.reduce(d, 0) | |
, g = l - m | |
, v = u - y | |
, _ = 0 | |
, x = m | |
, b = 0 | |
, w = y | |
, E = 0 | |
, C = g | |
, A = 0 | |
, z = v; | |
if (a.content && i) { | |
var S = a.content; | |
_ = Kl(h, 0, S[0]), | |
b = Kl(f, 0, S[1]), | |
x = Kl(h, S[0], S[2]), | |
w = Kl(f, S[1], S[3]), | |
E = S[0] - _, | |
A = S[1] - b, | |
C = S[2] - S[0] - x, | |
z = S[3] - S[1] - w | |
} | |
var k = function(i, o, l, u) { | |
var h = Yl(i.stretch - _, x, c, t.left) | |
, f = $l(i.fixed - E, C, i.stretch, m) | |
, d = Yl(o.stretch - b, w, p, t.top) | |
, g = $l(o.fixed - A, z, o.stretch, y) | |
, v = Yl(l.stretch - _, x, c, t.left) | |
, S = $l(l.fixed - E, C, l.stretch, m) | |
, k = Yl(u.stretch - b, w, p, t.top) | |
, T = $l(u.fixed - A, z, u.stretch, y) | |
, D = new n(h,d) | |
, I = new n(v,d) | |
, F = new n(v,k) | |
, B = new n(h,k) | |
, P = new n(f / s,g / s) | |
, M = new n(S / s,T / s) | |
, L = e * Math.PI / 180; | |
if (L) { | |
var R = Math.sin(L) | |
, O = Math.cos(L) | |
, U = [O, -R, R, O]; | |
D._matMult(U), | |
I._matMult(U), | |
B._matMult(U), | |
F._matMult(U) | |
} | |
var V = i.stretch + i.fixed | |
, j = o.stretch + o.fixed; | |
return { | |
tl: D, | |
tr: I, | |
bl: B, | |
br: F, | |
tex: { | |
x: a.paddedRect.x + 1 + V, | |
y: a.paddedRect.y + 1 + j, | |
w: l.stretch + l.fixed - V, | |
h: u.stretch + u.fixed - j | |
}, | |
writingMode: void 0, | |
glyphOffset: [0, 0], | |
sectionIndex: 0, | |
pixelOffsetTL: P, | |
pixelOffsetBR: M, | |
minFontScaleX: C / s / c, | |
minFontScaleY: z / s / p, | |
isSDF: r | |
} | |
}; | |
if (i && (a.stretchX || a.stretchY)) | |
for (var T = Jl(h, g, m), D = Jl(f, v, y), I = 0; I < T.length - 1; I++) | |
for (var F = T[I], B = T[I + 1], P = 0; P < D.length - 1; P++) | |
o.push(k(F, D[P], B, D[P + 1])); | |
else | |
o.push(k({ | |
fixed: 0, | |
stretch: -1 | |
}, { | |
fixed: 0, | |
stretch: -1 | |
}, { | |
fixed: 0, | |
stretch: l + 1 | |
}, { | |
fixed: 0, | |
stretch: u + 1 | |
})); | |
return o | |
} | |
function Kl(t, e, r) { | |
for (var i = 0, n = 0, o = t; n < o.length; n += 1) { | |
var a = o[n]; | |
i += Math.max(e, Math.min(r, a[1])) - Math.max(e, Math.min(r, a[0])) | |
} | |
return i | |
} | |
function Jl(t, e, r) { | |
for (var i = [{ | |
fixed: -1, | |
stretch: 0 | |
}], n = 0, o = t; n < o.length; n += 1) { | |
var a = o[n] | |
, s = a[0] | |
, l = a[1] | |
, u = i[i.length - 1]; | |
i.push({ | |
fixed: s - u.stretch, | |
stretch: u.stretch | |
}), | |
i.push({ | |
fixed: s - u.stretch, | |
stretch: u.stretch + (l - s) | |
}) | |
} | |
return i.push({ | |
fixed: e + 1, | |
stretch: r | |
}), | |
i | |
} | |
function Yl(t, e, r, i) { | |
return t / e * r + i | |
} | |
function $l(t, e, r, i) { | |
return t - e * r / i | |
} | |
var Ql = function(t, e, r, i, o, a, s, l, u, c) { | |
if (this.boxStartIndex = t.length, | |
u) { | |
var p = a.top | |
, h = a.bottom | |
, f = a.collisionPadding; | |
f && (p -= f[1], | |
h += f[3]); | |
var d = h - p; | |
d > 0 && (d = Math.max(10, d), | |
this.circleDiameter = d) | |
} else { | |
var m = a.top * s - l | |
, y = a.bottom * s + l | |
, g = a.left * s - l | |
, v = a.right * s + l | |
, _ = a.collisionPadding; | |
if (_ && (g -= _[0] * s, | |
m -= _[1] * s, | |
v += _[2] * s, | |
y += _[3] * s), | |
c) { | |
var x = new n(g,m) | |
, b = new n(v,m) | |
, w = new n(g,y) | |
, E = new n(v,y) | |
, C = c * Math.PI / 180; | |
x._rotate(C), | |
b._rotate(C), | |
w._rotate(C), | |
E._rotate(C), | |
g = Math.min(x.x, b.x, w.x, E.x), | |
v = Math.max(x.x, b.x, w.x, E.x), | |
m = Math.min(x.y, b.y, w.y, E.y), | |
y = Math.max(x.y, b.y, w.y, E.y) | |
} | |
t.emplaceBack(e.x, e.y, g, m, v, y, r, i, o) | |
} | |
this.boxEndIndex = t.length | |
} | |
, tu = function(t, e) { | |
if (void 0 === t && (t = []), | |
void 0 === e && (e = eu), | |
this.data = t, | |
this.length = this.data.length, | |
this.compare = e, | |
this.length > 0) | |
for (var r = (this.length >> 1) - 1; r >= 0; r--) | |
this._down(r) | |
}; | |
function eu(t, e) { | |
return t < e ? -1 : t > e ? 1 : 0 | |
} | |
function ru(t, e, r) { | |
void 0 === e && (e = 1), | |
void 0 === r && (r = !1); | |
for (var i = 1 / 0, o = 1 / 0, a = -1 / 0, s = -1 / 0, l = t[0], u = 0; u < l.length; u++) { | |
var c = l[u]; | |
(!u || c.x < i) && (i = c.x), | |
(!u || c.y < o) && (o = c.y), | |
(!u || c.x > a) && (a = c.x), | |
(!u || c.y > s) && (s = c.y) | |
} | |
var p = Math.min(a - i, s - o) | |
, h = p / 2 | |
, f = new tu([],iu); | |
if (0 === p) | |
return new n(i,o); | |
for (var d = i; d < a; d += p) | |
for (var m = o; m < s; m += p) | |
f.push(new nu(d + h,m + h,h,t)); | |
for (var y = function(t) { | |
for (var e = 0, r = 0, i = 0, n = t[0], o = 0, a = n.length, s = a - 1; o < a; s = o++) { | |
var l = n[o] | |
, u = n[s] | |
, c = l.x * u.y - u.x * l.y; | |
r += (l.x + u.x) * c, | |
i += (l.y + u.y) * c, | |
e += 3 * c | |
} | |
return new nu(r / e,i / e,0,t) | |
}(t), g = f.length; f.length; ) { | |
var v = f.pop(); | |
(v.d > y.d || !y.d) && (y = v, | |
r && console.log("found best %d after %d probes", Math.round(1e4 * v.d) / 1e4, g)), | |
v.max - y.d <= e || (f.push(new nu(v.p.x - (h = v.h / 2),v.p.y - h,h,t)), | |
f.push(new nu(v.p.x + h,v.p.y - h,h,t)), | |
f.push(new nu(v.p.x - h,v.p.y + h,h,t)), | |
f.push(new nu(v.p.x + h,v.p.y + h,h,t)), | |
g += 4) | |
} | |
return r && (console.log("num probes: " + g), | |
console.log("best distance: " + y.d)), | |
y.p | |
} | |
function iu(t, e) { | |
return e.max - t.max | |
} | |
function nu(t, e, r, i) { | |
this.p = new n(t,e), | |
this.h = r, | |
this.d = function(t, e) { | |
for (var r = !1, i = 1 / 0, n = 0; n < e.length; n++) | |
for (var o = e[n], a = 0, s = o.length, l = s - 1; a < s; l = a++) { | |
var u = o[a] | |
, c = o[l]; | |
u.y > t.y != c.y > t.y && t.x < (c.x - u.x) * (t.y - u.y) / (c.y - u.y) + u.x && (r = !r), | |
i = Math.min(i, $o(t, u, c)) | |
} | |
return (r ? 1 : -1) * Math.sqrt(i) | |
}(this.p, i), | |
this.max = this.d + this.h * Math.SQRT2 | |
} | |
tu.prototype.push = function(t) { | |
this.data.push(t), | |
this.length++, | |
this._up(this.length - 1) | |
} | |
, | |
tu.prototype.pop = function() { | |
if (0 !== this.length) { | |
var t = this.data[0] | |
, e = this.data.pop(); | |
return this.length--, | |
this.length > 0 && (this.data[0] = e, | |
this._down(0)), | |
t | |
} | |
} | |
, | |
tu.prototype.peek = function() { | |
return this.data[0] | |
} | |
, | |
tu.prototype._up = function(t) { | |
for (var e = this.data, r = this.compare, i = e[t]; t > 0; ) { | |
var n = t - 1 >> 1 | |
, o = e[n]; | |
if (r(i, o) >= 0) | |
break; | |
e[t] = o, | |
t = n | |
} | |
e[t] = i | |
} | |
, | |
tu.prototype._down = function(t) { | |
for (var e = this.data, r = this.compare, i = this.length >> 1, n = e[t]; t < i; ) { | |
var o = 1 + (t << 1) | |
, a = e[o] | |
, s = o + 1; | |
if (s < this.length && r(e[s], a) < 0 && (o = s, | |
a = e[s]), | |
r(a, n) >= 0) | |
break; | |
e[t] = a, | |
t = o | |
} | |
e[t] = n | |
} | |
; | |
var ou = Number.POSITIVE_INFINITY; | |
function au(t, e) { | |
return e[1] !== ou ? function(t, e, r) { | |
var i = 0 | |
, n = 0; | |
switch (e = Math.abs(e), | |
r = Math.abs(r), | |
t) { | |
case "top-right": | |
case "top-left": | |
case "top": | |
n = r - 7; | |
break; | |
case "bottom-right": | |
case "bottom-left": | |
case "bottom": | |
n = 7 - r | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment