@maptiler/sdk 3.4.0 → 3.4.1-rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/maptiler-sdk.mjs
CHANGED
|
@@ -3,11 +3,11 @@ var dn = (r) => {
|
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
5
|
var Eo = (r, e, t) => e in r ? Ao(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
-
var S = (r, e, t) => Eo(r, typeof e != "symbol" ? e + "" : e, t),
|
|
7
|
-
var P = (r, e, t) => (
|
|
6
|
+
var S = (r, e, t) => Eo(r, typeof e != "symbol" ? e + "" : e, t), tr = (r, e, t) => e.has(r) || dn("Cannot " + t);
|
|
7
|
+
var P = (r, e, t) => (tr(r, e, "read from private field"), t ? t.call(r) : e.get(r)), be = (r, e, t) => e.has(r) ? dn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), _e = (r, e, t, n) => (tr(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), H = (r, e, t) => (tr(r, e, "access private method"), t);
|
|
8
8
|
import k from "maplibre-gl";
|
|
9
|
-
import { Language as To, getLanguageInfoFromCode as hn, config as
|
|
10
|
-
import { MapStyle as Tp, MapStyleVariant as _p, ReferenceMapStyle as
|
|
9
|
+
import { Language as To, getLanguageInfoFromCode as hn, config as rr, MapStyle as Qe, mapStylePresetList as nr, expandMapStyle as _o, MapStyleVariant as Io, ReferenceMapStyle as Mo, toLanguageInfo as yn, getLanguageInfoFromFlag as Po, geolocation as mn } from "@maptiler/client";
|
|
10
|
+
import { MapStyle as Tp, MapStyleVariant as _p, ReferenceMapStyle as Ip, ServiceError as Mp, areSameLanguages as Pp, bufferToPixelDataBrowser as Rp, circumferenceAtLatitude as zp, coordinates as Fp, data as $p, elevation as Op, expandMapStyle as jp, geocoding as Np, geolocation as Dp, getAutoLanguage as Up, getBufferToPixelDataParser as Bp, getLanguageInfoFromCode as qp, getLanguageInfoFromFlag as Gp, getLanguageInfoFromKey as Vp, getTileCache as Hp, isLanguageInfo as Kp, mapStylePresetList as Xp, math as Wp, misc as Zp, staticMaps as Yp, styleToStyle as Jp, toLanguageInfo as Qp } from "@maptiler/client";
|
|
11
11
|
import Ro from "events";
|
|
12
12
|
import { v4 as zo } from "uuid";
|
|
13
13
|
import { Base64 as Fo } from "js-base64";
|
|
@@ -149,7 +149,7 @@ class $o extends Ro {
|
|
|
149
149
|
* Set the MapTiler Cloud API key
|
|
150
150
|
*/
|
|
151
151
|
set apiKey(t) {
|
|
152
|
-
this._apiKey = t,
|
|
152
|
+
this._apiKey = t, rr.apiKey = t, this.emit("apiKey", t);
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* Get the MapTiler Cloud API key
|
|
@@ -161,28 +161,28 @@ class $o extends Ro {
|
|
|
161
161
|
* Set a the custom fetch function to replace the default one
|
|
162
162
|
*/
|
|
163
163
|
set fetch(t) {
|
|
164
|
-
|
|
164
|
+
rr.fetch = t;
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
167
|
* Get the fetch fucntion
|
|
168
168
|
*/
|
|
169
169
|
get fetch() {
|
|
170
|
-
return
|
|
170
|
+
return rr.fetch;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
const D = new $o(),
|
|
173
|
+
const D = new $o(), xr = "localcache_source", kr = "localcache", Oo = "maptiler_sdk", jo = 1e3, No = 100, Cr = typeof caches < "u", { addProtocol: vn } = k;
|
|
174
174
|
function Do(r, e) {
|
|
175
|
-
if (
|
|
175
|
+
if (Cr && D.caching && D.session && r.host === V.maptilerApiHost) {
|
|
176
176
|
if (e === "Source" && r.href.includes("tiles.json"))
|
|
177
|
-
return r.href.replace("https://", `${
|
|
177
|
+
return r.href.replace("https://", `${xr}://`);
|
|
178
178
|
if (e === "Tile" || e === "Glyphs")
|
|
179
|
-
return r.href.replace("https://", `${
|
|
179
|
+
return r.href.replace("https://", `${kr}://`);
|
|
180
180
|
}
|
|
181
181
|
return r.href;
|
|
182
182
|
}
|
|
183
|
-
let
|
|
183
|
+
let ar;
|
|
184
184
|
async function fa() {
|
|
185
|
-
return
|
|
185
|
+
return ar || (ar = await caches.open(Oo)), ar;
|
|
186
186
|
}
|
|
187
187
|
let bn = 0;
|
|
188
188
|
async function Uo() {
|
|
@@ -192,10 +192,10 @@ async function Uo() {
|
|
|
192
192
|
}
|
|
193
193
|
function Bo() {
|
|
194
194
|
vn(
|
|
195
|
-
|
|
195
|
+
xr,
|
|
196
196
|
async (r, e) => {
|
|
197
197
|
if (!r.url) throw new Error("");
|
|
198
|
-
r.url = r.url.replace(`${
|
|
198
|
+
r.url = r.url.replace(`${xr}://`, "https://");
|
|
199
199
|
const t = r;
|
|
200
200
|
t.signal = e.signal;
|
|
201
201
|
const n = await fetch(r.url, t), a = await n.json();
|
|
@@ -205,9 +205,9 @@ function Bo() {
|
|
|
205
205
|
expires: n.headers.get("Expires")
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
|
-
), vn(
|
|
208
|
+
), vn(kr, async (r, e) => {
|
|
209
209
|
if (!r.url) throw new Error("");
|
|
210
|
-
r.url = r.url.replace(`${
|
|
210
|
+
r.url = r.url.replace(`${kr}://`, "https://");
|
|
211
211
|
const t = new URL(r.url), n = new URL(t);
|
|
212
212
|
n.searchParams.delete("mtsid"), n.searchParams.delete("key");
|
|
213
213
|
const a = n.toString(), o = new URL(t);
|
|
@@ -267,7 +267,7 @@ function Sn(r) {
|
|
|
267
267
|
function da() {
|
|
268
268
|
return Math.random().toString(36).substring(2);
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function Ot(r) {
|
|
271
271
|
return /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi.test(r);
|
|
272
272
|
}
|
|
273
273
|
function Vo(r) {
|
|
@@ -1977,11 +1977,11 @@ var ii = 8, si = {
|
|
|
1977
1977
|
"color"
|
|
1978
1978
|
],
|
|
1979
1979
|
length: 2
|
|
1980
|
-
},
|
|
1980
|
+
}, Ii = {
|
|
1981
1981
|
type: "array",
|
|
1982
1982
|
value: "*",
|
|
1983
1983
|
minimum: 1
|
|
1984
|
-
},
|
|
1984
|
+
}, Mi = {
|
|
1985
1985
|
anchor: {
|
|
1986
1986
|
type: "enum",
|
|
1987
1987
|
default: "viewport",
|
|
@@ -3378,8 +3378,8 @@ var ii = 8, si = {
|
|
|
3378
3378
|
}
|
|
3379
3379
|
},
|
|
3380
3380
|
function_stop: _i,
|
|
3381
|
-
expression:
|
|
3382
|
-
light:
|
|
3381
|
+
expression: Ii,
|
|
3382
|
+
light: Mi,
|
|
3383
3383
|
sky: Pi,
|
|
3384
3384
|
terrain: Ri,
|
|
3385
3385
|
projection: zi,
|
|
@@ -3577,7 +3577,7 @@ class g {
|
|
|
3577
3577
|
this.message = (e ? `${e}: ` : "") + n, a && (this.identifier = a), t != null && t.__line__ && (this.line = t.__line__);
|
|
3578
3578
|
}
|
|
3579
3579
|
}
|
|
3580
|
-
function
|
|
3580
|
+
function Tt(r, ...e) {
|
|
3581
3581
|
for (const t of e)
|
|
3582
3582
|
for (const n in t)
|
|
3583
3583
|
r[n] = t[n];
|
|
@@ -3608,7 +3608,7 @@ class Dr {
|
|
|
3608
3608
|
return this.bindings[e] ? !0 : this.parent ? this.parent.has(e) : !1;
|
|
3609
3609
|
}
|
|
3610
3610
|
}
|
|
3611
|
-
const
|
|
3611
|
+
const jt = { kind: "null" }, b = { kind: "number" }, I = { kind: "string" }, _ = { kind: "boolean" }, de = { kind: "color" }, Nt = { kind: "projectionDefinition" }, Re = { kind: "object" }, T = { kind: "value" }, Ki = { kind: "error" }, Dt = { kind: "collator" }, Ut = { kind: "formatted" }, Bt = { kind: "padding" }, nt = { kind: "colorArray" }, qt = { kind: "numberArray" }, ft = { kind: "resolvedImage" }, Gt = { kind: "variableAnchorOffsetCollection" };
|
|
3612
3612
|
function Z(r, e) {
|
|
3613
3613
|
return {
|
|
3614
3614
|
kind: "array",
|
|
@@ -3624,33 +3624,33 @@ function j(r) {
|
|
|
3624
3624
|
return r.kind;
|
|
3625
3625
|
}
|
|
3626
3626
|
const Xi = [
|
|
3627
|
-
|
|
3627
|
+
jt,
|
|
3628
3628
|
b,
|
|
3629
|
-
|
|
3629
|
+
I,
|
|
3630
3630
|
_,
|
|
3631
3631
|
de,
|
|
3632
|
-
Ot,
|
|
3633
3632
|
Nt,
|
|
3633
|
+
Ut,
|
|
3634
3634
|
Re,
|
|
3635
3635
|
Z(T),
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3636
|
+
Bt,
|
|
3637
|
+
qt,
|
|
3638
|
+
nt,
|
|
3639
|
+
ft,
|
|
3640
|
+
Gt
|
|
3641
3641
|
];
|
|
3642
|
-
function
|
|
3642
|
+
function at(r, e) {
|
|
3643
3643
|
if (e.kind === "error")
|
|
3644
3644
|
return null;
|
|
3645
3645
|
if (r.kind === "array") {
|
|
3646
|
-
if (e.kind === "array" && (e.N === 0 && e.itemType.kind === "value" || !
|
|
3646
|
+
if (e.kind === "array" && (e.N === 0 && e.itemType.kind === "value" || !at(r.itemType, e.itemType)) && (typeof r.N != "number" || r.N === e.N))
|
|
3647
3647
|
return null;
|
|
3648
3648
|
} else {
|
|
3649
3649
|
if (r.kind === e.kind)
|
|
3650
3650
|
return null;
|
|
3651
3651
|
if (r.kind === "value") {
|
|
3652
3652
|
for (const t of Xi)
|
|
3653
|
-
if (!
|
|
3653
|
+
if (!at(t, e))
|
|
3654
3654
|
return null;
|
|
3655
3655
|
}
|
|
3656
3656
|
}
|
|
@@ -3670,33 +3670,33 @@ function ba(r) {
|
|
|
3670
3670
|
return r = r % 360, r < 0 && (r += 360), r;
|
|
3671
3671
|
}
|
|
3672
3672
|
function wa([r, e, t, n]) {
|
|
3673
|
-
r =
|
|
3673
|
+
r = or(r), e = or(e), t = or(t);
|
|
3674
3674
|
let a, o;
|
|
3675
|
-
const i =
|
|
3676
|
-
r === e && e === t ? a = o = i : (a =
|
|
3675
|
+
const i = ir((0.2225045 * r + 0.7168786 * e + 0.0606169 * t) / ya);
|
|
3676
|
+
r === e && e === t ? a = o = i : (a = ir((0.4360747 * r + 0.3850649 * e + 0.1430804 * t) / ha), o = ir((0.0139322 * r + 0.0971045 * e + 0.7141733 * t) / ma));
|
|
3677
3677
|
const s = 116 * i - 16;
|
|
3678
3678
|
return [s < 0 ? 0 : s, 500 * (a - i), 200 * (i - o), n];
|
|
3679
3679
|
}
|
|
3680
|
-
function
|
|
3680
|
+
function or(r) {
|
|
3681
3681
|
return r <= 0.04045 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
|
|
3682
3682
|
}
|
|
3683
|
-
function
|
|
3683
|
+
function ir(r) {
|
|
3684
3684
|
return r > Wi ? Math.pow(r, 1 / 3) : r / va + ga;
|
|
3685
3685
|
}
|
|
3686
3686
|
function Sa([r, e, t, n]) {
|
|
3687
3687
|
let a = (r + 16) / 116, o = isNaN(e) ? a : a + e / 500, i = isNaN(t) ? a : a - t / 200;
|
|
3688
|
-
return a = ya *
|
|
3689
|
-
|
|
3688
|
+
return a = ya * lr(a), o = ha * lr(o), i = ma * lr(i), [
|
|
3689
|
+
sr(3.1338561 * o - 1.6168667 * a - 0.4906146 * i),
|
|
3690
3690
|
// D50 -> sRGB
|
|
3691
|
-
|
|
3692
|
-
|
|
3691
|
+
sr(-0.9787684 * o + 1.9161415 * a + 0.033454 * i),
|
|
3692
|
+
sr(0.0719453 * o - 0.2289914 * a + 1.4052427 * i),
|
|
3693
3693
|
n
|
|
3694
3694
|
];
|
|
3695
3695
|
}
|
|
3696
|
-
function
|
|
3696
|
+
function sr(r) {
|
|
3697
3697
|
return r = r <= 304e-5 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - 0.055, r < 0 ? 0 : r > 1 ? 1 : r;
|
|
3698
3698
|
}
|
|
3699
|
-
function
|
|
3699
|
+
function lr(r) {
|
|
3700
3700
|
return r > qe ? r * r * r : va * (r - ga);
|
|
3701
3701
|
}
|
|
3702
3702
|
function Ji(r) {
|
|
@@ -3717,13 +3717,13 @@ function es([r, e, t, n]) {
|
|
|
3717
3717
|
const ts = Object.hasOwn || function(e, t) {
|
|
3718
3718
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
3719
3719
|
};
|
|
3720
|
-
function
|
|
3720
|
+
function et(r, e) {
|
|
3721
3721
|
return ts(r, e) ? r[e] : void 0;
|
|
3722
3722
|
}
|
|
3723
3723
|
function rs(r) {
|
|
3724
3724
|
if (r = r.toLowerCase().trim(), r === "transparent")
|
|
3725
3725
|
return [0, 0, 0, 0];
|
|
3726
|
-
const e =
|
|
3726
|
+
const e = et(ns, r);
|
|
3727
3727
|
if (e) {
|
|
3728
3728
|
const [a, o, i] = e;
|
|
3729
3729
|
return [a / 255, o / 255, i / 255, 1];
|
|
@@ -3732,10 +3732,10 @@ function rs(r) {
|
|
|
3732
3732
|
const o = r.length < 6 ? 1 : 2;
|
|
3733
3733
|
let i = 1;
|
|
3734
3734
|
return [
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3735
|
+
bt(r.slice(i, i += o)),
|
|
3736
|
+
bt(r.slice(i, i += o)),
|
|
3737
|
+
bt(r.slice(i, i += o)),
|
|
3738
|
+
bt(r.slice(i, i + o) || "ff")
|
|
3739
3739
|
];
|
|
3740
3740
|
}
|
|
3741
3741
|
if (r.startsWith("rgb")) {
|
|
@@ -3817,7 +3817,7 @@ function rs(r) {
|
|
|
3817
3817
|
}
|
|
3818
3818
|
}
|
|
3819
3819
|
}
|
|
3820
|
-
function
|
|
3820
|
+
function bt(r) {
|
|
3821
3821
|
return parseInt(r.padEnd(2, r), 16) / 255;
|
|
3822
3822
|
}
|
|
3823
3823
|
function Cn(r, e) {
|
|
@@ -3982,7 +3982,7 @@ const ns = {
|
|
|
3982
3982
|
function Le(r, e, t) {
|
|
3983
3983
|
return r + t * (e - r);
|
|
3984
3984
|
}
|
|
3985
|
-
function
|
|
3985
|
+
function Ve(r, e, t) {
|
|
3986
3986
|
return r.map((n, a) => Le(n, e[a], t));
|
|
3987
3987
|
}
|
|
3988
3988
|
class F {
|
|
@@ -4084,7 +4084,7 @@ class F {
|
|
|
4084
4084
|
static interpolate(e, t, n, a = "rgb") {
|
|
4085
4085
|
switch (a) {
|
|
4086
4086
|
case "rgb": {
|
|
4087
|
-
const [o, i, s, l] =
|
|
4087
|
+
const [o, i, s, l] = Ve(e.rgb, t.rgb, n);
|
|
4088
4088
|
return new F(o, i, s, l, !1);
|
|
4089
4089
|
}
|
|
4090
4090
|
case "hcl": {
|
|
@@ -4103,7 +4103,7 @@ class F {
|
|
|
4103
4103
|
return new F(y, m, w, v, !1);
|
|
4104
4104
|
}
|
|
4105
4105
|
case "lab": {
|
|
4106
|
-
const [o, i, s, l] = Sa(
|
|
4106
|
+
const [o, i, s, l] = Sa(Ve(e.lab, t.lab, n));
|
|
4107
4107
|
return new F(o, i, s, l, !1);
|
|
4108
4108
|
}
|
|
4109
4109
|
}
|
|
@@ -4125,7 +4125,7 @@ class Br {
|
|
|
4125
4125
|
}
|
|
4126
4126
|
}
|
|
4127
4127
|
const as = ["bottom", "center", "top"];
|
|
4128
|
-
class
|
|
4128
|
+
class Lr {
|
|
4129
4129
|
constructor(e, t, n, a, o, i) {
|
|
4130
4130
|
this.text = e, this.image = t, this.scale = n, this.fontStack = a, this.textColor = o, this.verticalAlign = i;
|
|
4131
4131
|
}
|
|
@@ -4135,7 +4135,7 @@ class me {
|
|
|
4135
4135
|
this.sections = e;
|
|
4136
4136
|
}
|
|
4137
4137
|
static fromString(e) {
|
|
4138
|
-
return new me([new
|
|
4138
|
+
return new me([new Lr(e, null, null, null, null, null)]);
|
|
4139
4139
|
}
|
|
4140
4140
|
isEmpty() {
|
|
4141
4141
|
return this.sections.length === 0 ? !0 : !this.sections.some((e) => e.text.length !== 0 || e.image && e.image.name.length !== 0);
|
|
@@ -4183,7 +4183,7 @@ class Q {
|
|
|
4183
4183
|
return JSON.stringify(this.values);
|
|
4184
4184
|
}
|
|
4185
4185
|
static interpolate(e, t, n) {
|
|
4186
|
-
return new Q(
|
|
4186
|
+
return new Q(Ve(e.values, t.values, n));
|
|
4187
4187
|
}
|
|
4188
4188
|
}
|
|
4189
4189
|
class ee {
|
|
@@ -4211,7 +4211,7 @@ class ee {
|
|
|
4211
4211
|
return JSON.stringify(this.values);
|
|
4212
4212
|
}
|
|
4213
4213
|
static interpolate(e, t, n) {
|
|
4214
|
-
return new ee(
|
|
4214
|
+
return new ee(Ve(e.values, t.values, n));
|
|
4215
4215
|
}
|
|
4216
4216
|
}
|
|
4217
4217
|
class X {
|
|
@@ -4330,17 +4330,17 @@ class ie {
|
|
|
4330
4330
|
function xa(r, e, t, n) {
|
|
4331
4331
|
return typeof r == "number" && r >= 0 && r <= 255 && typeof e == "number" && e >= 0 && e <= 255 && typeof t == "number" && t >= 0 && t <= 255 ? typeof n > "u" || typeof n == "number" && n >= 0 && n <= 1 ? null : `Invalid rgba value [${[r, e, t, n].join(", ")}]: 'a' must be between 0 and 1.` : `Invalid rgba value [${(typeof n == "number" ? [r, e, t, n] : [r, e, t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`;
|
|
4332
4332
|
}
|
|
4333
|
-
function
|
|
4333
|
+
function ot(r) {
|
|
4334
4334
|
if (r === null || typeof r == "string" || typeof r == "boolean" || typeof r == "number" || r instanceof ie || r instanceof F || r instanceof Br || r instanceof me || r instanceof Q || r instanceof ee || r instanceof X || r instanceof ue || r instanceof Ee)
|
|
4335
4335
|
return !0;
|
|
4336
4336
|
if (Array.isArray(r)) {
|
|
4337
4337
|
for (const e of r)
|
|
4338
|
-
if (!
|
|
4338
|
+
if (!ot(e))
|
|
4339
4339
|
return !1;
|
|
4340
4340
|
return !0;
|
|
4341
4341
|
} else if (typeof r == "object") {
|
|
4342
4342
|
for (const e in r)
|
|
4343
|
-
if (!
|
|
4343
|
+
if (!ot(r[e]))
|
|
4344
4344
|
return !1;
|
|
4345
4345
|
return !0;
|
|
4346
4346
|
} else
|
|
@@ -4348,9 +4348,9 @@ function at(r) {
|
|
|
4348
4348
|
}
|
|
4349
4349
|
function B(r) {
|
|
4350
4350
|
if (r === null)
|
|
4351
|
-
return
|
|
4351
|
+
return jt;
|
|
4352
4352
|
if (typeof r == "string")
|
|
4353
|
-
return
|
|
4353
|
+
return I;
|
|
4354
4354
|
if (typeof r == "boolean")
|
|
4355
4355
|
return _;
|
|
4356
4356
|
if (typeof r == "number")
|
|
@@ -4358,21 +4358,21 @@ function B(r) {
|
|
|
4358
4358
|
if (r instanceof F)
|
|
4359
4359
|
return de;
|
|
4360
4360
|
if (r instanceof ie)
|
|
4361
|
-
return
|
|
4361
|
+
return Nt;
|
|
4362
4362
|
if (r instanceof Br)
|
|
4363
|
-
return
|
|
4363
|
+
return Dt;
|
|
4364
4364
|
if (r instanceof me)
|
|
4365
|
-
return
|
|
4365
|
+
return Ut;
|
|
4366
4366
|
if (r instanceof Q)
|
|
4367
|
-
return
|
|
4367
|
+
return Bt;
|
|
4368
4368
|
if (r instanceof ee)
|
|
4369
|
-
return
|
|
4369
|
+
return qt;
|
|
4370
4370
|
if (r instanceof X)
|
|
4371
|
-
return
|
|
4371
|
+
return nt;
|
|
4372
4372
|
if (r instanceof ue)
|
|
4373
|
-
return
|
|
4373
|
+
return Gt;
|
|
4374
4374
|
if (r instanceof Ee)
|
|
4375
|
-
return
|
|
4375
|
+
return ft;
|
|
4376
4376
|
if (Array.isArray(r)) {
|
|
4377
4377
|
const e = r.length;
|
|
4378
4378
|
let t;
|
|
@@ -4391,23 +4391,23 @@ function B(r) {
|
|
|
4391
4391
|
} else
|
|
4392
4392
|
return Re;
|
|
4393
4393
|
}
|
|
4394
|
-
function
|
|
4394
|
+
function tt(r) {
|
|
4395
4395
|
const e = typeof r;
|
|
4396
4396
|
return r === null ? "" : e === "string" || e === "number" || e === "boolean" ? String(r) : r instanceof F || r instanceof ie || r instanceof me || r instanceof Q || r instanceof ee || r instanceof X || r instanceof ue || r instanceof Ee ? r.toString() : JSON.stringify(r);
|
|
4397
4397
|
}
|
|
4398
|
-
class
|
|
4398
|
+
class He {
|
|
4399
4399
|
constructor(e, t) {
|
|
4400
4400
|
this.type = e, this.value = t;
|
|
4401
4401
|
}
|
|
4402
4402
|
static parse(e, t) {
|
|
4403
4403
|
if (e.length !== 2)
|
|
4404
4404
|
return t.error(`'literal' expression requires exactly one argument, but found ${e.length - 1} instead.`);
|
|
4405
|
-
if (!
|
|
4405
|
+
if (!ot(e[1]))
|
|
4406
4406
|
return t.error("invalid value");
|
|
4407
4407
|
const n = e[1];
|
|
4408
4408
|
let a = B(n);
|
|
4409
4409
|
const o = t.expectedType;
|
|
4410
|
-
return a.kind === "array" && a.N === 0 && o && o.kind === "array" && (typeof o.N != "number" || o.N === 0) && (a = o), new
|
|
4410
|
+
return a.kind === "array" && a.N === 0 && o && o.kind === "array" && (typeof o.N != "number" || o.N === 0) && (a = o), new He(a, n);
|
|
4411
4411
|
}
|
|
4412
4412
|
evaluate() {
|
|
4413
4413
|
return this.value;
|
|
@@ -4418,8 +4418,8 @@ class Ve {
|
|
|
4418
4418
|
return !0;
|
|
4419
4419
|
}
|
|
4420
4420
|
}
|
|
4421
|
-
const
|
|
4422
|
-
string:
|
|
4421
|
+
const wt = {
|
|
4422
|
+
string: I,
|
|
4423
4423
|
number: b,
|
|
4424
4424
|
boolean: _,
|
|
4425
4425
|
object: Re
|
|
@@ -4437,9 +4437,9 @@ class se {
|
|
|
4437
4437
|
let s;
|
|
4438
4438
|
if (e.length > 2) {
|
|
4439
4439
|
const u = e[1];
|
|
4440
|
-
if (typeof u != "string" || !(u in
|
|
4440
|
+
if (typeof u != "string" || !(u in wt) || u === "object")
|
|
4441
4441
|
return t.error('The item type argument of "array" must be one of string, number, boolean', 1);
|
|
4442
|
-
s =
|
|
4442
|
+
s = wt[u], n++;
|
|
4443
4443
|
} else
|
|
4444
4444
|
s = T;
|
|
4445
4445
|
let l;
|
|
@@ -4450,9 +4450,9 @@ class se {
|
|
|
4450
4450
|
}
|
|
4451
4451
|
a = Z(s, l);
|
|
4452
4452
|
} else {
|
|
4453
|
-
if (!
|
|
4453
|
+
if (!wt[o])
|
|
4454
4454
|
throw new Error(`Types doesn't contain name = ${o}`);
|
|
4455
|
-
a =
|
|
4455
|
+
a = wt[o];
|
|
4456
4456
|
}
|
|
4457
4457
|
const i = [];
|
|
4458
4458
|
for (; n < e.length; n++) {
|
|
@@ -4466,7 +4466,7 @@ class se {
|
|
|
4466
4466
|
evaluate(e) {
|
|
4467
4467
|
for (let t = 0; t < this.args.length; t++) {
|
|
4468
4468
|
const n = this.args[t].evaluate(e);
|
|
4469
|
-
if (
|
|
4469
|
+
if (at(this.type, B(n))) {
|
|
4470
4470
|
if (t === this.args.length - 1)
|
|
4471
4471
|
throw new N(`Expected value to be of type ${j(this.type)}, but found ${j(B(n))} instead.`);
|
|
4472
4472
|
} else return n;
|
|
@@ -4484,7 +4484,7 @@ const An = {
|
|
|
4484
4484
|
"to-boolean": _,
|
|
4485
4485
|
"to-color": de,
|
|
4486
4486
|
"to-number": b,
|
|
4487
|
-
"to-string":
|
|
4487
|
+
"to-string": I
|
|
4488
4488
|
};
|
|
4489
4489
|
class ke {
|
|
4490
4490
|
constructor(e, t) {
|
|
@@ -4577,13 +4577,13 @@ class ke {
|
|
|
4577
4577
|
throw new N(`Could not convert ${JSON.stringify(t)} to number.`);
|
|
4578
4578
|
}
|
|
4579
4579
|
case "formatted":
|
|
4580
|
-
return me.fromString(
|
|
4580
|
+
return me.fromString(tt(this.args[0].evaluate(e)));
|
|
4581
4581
|
case "resolvedImage":
|
|
4582
|
-
return Ee.fromString(
|
|
4582
|
+
return Ee.fromString(tt(this.args[0].evaluate(e)));
|
|
4583
4583
|
case "projectionDefinition":
|
|
4584
4584
|
return this.args[0].evaluate(e);
|
|
4585
4585
|
default:
|
|
4586
|
-
return
|
|
4586
|
+
return tt(this.args[0].evaluate(e));
|
|
4587
4587
|
}
|
|
4588
4588
|
}
|
|
4589
4589
|
eachChild(e) {
|
|
@@ -4618,7 +4618,7 @@ class ka {
|
|
|
4618
4618
|
return t || (t = F.parse(e), this._parseColorCache.set(e, t)), t;
|
|
4619
4619
|
}
|
|
4620
4620
|
}
|
|
4621
|
-
class
|
|
4621
|
+
class Vt {
|
|
4622
4622
|
constructor(e, t, n = [], a, o = new Dr(), i = []) {
|
|
4623
4623
|
this.registry = e, this.path = n, this.key = n.map((s) => `[${s}]`).join(""), this.scope = o, this.errors = i, this.expectedType = a, this._isConstant = t;
|
|
4624
4624
|
}
|
|
@@ -4657,10 +4657,10 @@ class qt {
|
|
|
4657
4657
|
else if (this.checkSubtype(s, l))
|
|
4658
4658
|
return null;
|
|
4659
4659
|
}
|
|
4660
|
-
if (!(i instanceof
|
|
4660
|
+
if (!(i instanceof He) && i.type.kind !== "resolvedImage" && this._isConstant(i)) {
|
|
4661
4661
|
const s = new ka();
|
|
4662
4662
|
try {
|
|
4663
|
-
i = new
|
|
4663
|
+
i = new He(i.type, i.evaluate(s));
|
|
4664
4664
|
} catch (l) {
|
|
4665
4665
|
return this.error(l.message), null;
|
|
4666
4666
|
}
|
|
@@ -4680,7 +4680,7 @@ class qt {
|
|
|
4680
4680
|
*/
|
|
4681
4681
|
concat(e, t, n) {
|
|
4682
4682
|
const a = typeof e == "number" ? this.path.concat(e) : this.path, o = n ? this.scope.concat(n) : this.scope;
|
|
4683
|
-
return new
|
|
4683
|
+
return new Vt(this.registry, this._isConstant, a, t || null, o, this.errors);
|
|
4684
4684
|
}
|
|
4685
4685
|
/**
|
|
4686
4686
|
* Push a parsing (or type checking) error into the `this.errors`
|
|
@@ -4701,11 +4701,11 @@ class qt {
|
|
|
4701
4701
|
* @returns null if `t` is a subtype of `expected`; otherwise returns an error message
|
|
4702
4702
|
*/
|
|
4703
4703
|
checkSubtype(e, t) {
|
|
4704
|
-
const n =
|
|
4704
|
+
const n = at(e, t);
|
|
4705
4705
|
return n && this.error(n), n;
|
|
4706
4706
|
}
|
|
4707
4707
|
}
|
|
4708
|
-
class
|
|
4708
|
+
class Ht {
|
|
4709
4709
|
constructor(e, t) {
|
|
4710
4710
|
this.type = t.type, this.bindings = [].concat(e), this.result = t;
|
|
4711
4711
|
}
|
|
@@ -4733,13 +4733,13 @@ class Gt {
|
|
|
4733
4733
|
n.push([i, s]);
|
|
4734
4734
|
}
|
|
4735
4735
|
const a = t.parse(e[e.length - 1], e.length - 1, t.expectedType, n);
|
|
4736
|
-
return a ? new
|
|
4736
|
+
return a ? new Ht(n, a) : null;
|
|
4737
4737
|
}
|
|
4738
4738
|
outputDefined() {
|
|
4739
4739
|
return this.result.outputDefined();
|
|
4740
4740
|
}
|
|
4741
4741
|
}
|
|
4742
|
-
class
|
|
4742
|
+
class Kt {
|
|
4743
4743
|
constructor(e, t) {
|
|
4744
4744
|
this.type = t.type, this.name = e, this.boundExpression = t;
|
|
4745
4745
|
}
|
|
@@ -4747,7 +4747,7 @@ class Vt {
|
|
|
4747
4747
|
if (e.length !== 2 || typeof e[1] != "string")
|
|
4748
4748
|
return t.error("'var' expression requires exactly one string literal argument.");
|
|
4749
4749
|
const n = e[1];
|
|
4750
|
-
return t.scope.has(n) ? new
|
|
4750
|
+
return t.scope.has(n) ? new Kt(n, t.scope.get(n)) : t.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`, 1);
|
|
4751
4751
|
}
|
|
4752
4752
|
evaluate(e) {
|
|
4753
4753
|
return this.boundExpression.evaluate(e);
|
|
@@ -4796,7 +4796,7 @@ class Gr {
|
|
|
4796
4796
|
if (e.length !== 3)
|
|
4797
4797
|
return t.error(`Expected 2 arguments, but found ${e.length - 1} instead.`);
|
|
4798
4798
|
const n = t.parse(e[1], 1, T), a = t.parse(e[2], 2, T);
|
|
4799
|
-
return !n || !a ? null : Ur(n.type, [_,
|
|
4799
|
+
return !n || !a ? null : Ur(n.type, [_, I, b, jt, T]) ? new Gr(n, a) : t.error(`Expected first argument to be of type boolean, string, number or null, but found ${j(n.type)} instead`);
|
|
4800
4800
|
}
|
|
4801
4801
|
evaluate(e) {
|
|
4802
4802
|
const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
|
|
@@ -4815,7 +4815,7 @@ class Gr {
|
|
|
4815
4815
|
return !0;
|
|
4816
4816
|
}
|
|
4817
4817
|
}
|
|
4818
|
-
class
|
|
4818
|
+
class _t {
|
|
4819
4819
|
constructor(e, t, n) {
|
|
4820
4820
|
this.type = b, this.needle = e, this.haystack = t, this.fromIndex = n;
|
|
4821
4821
|
}
|
|
@@ -4825,13 +4825,13 @@ class Et {
|
|
|
4825
4825
|
const n = t.parse(e[1], 1, T), a = t.parse(e[2], 2, T);
|
|
4826
4826
|
if (!n || !a)
|
|
4827
4827
|
return null;
|
|
4828
|
-
if (!Ur(n.type, [_,
|
|
4828
|
+
if (!Ur(n.type, [_, I, b, jt, T]))
|
|
4829
4829
|
return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${j(n.type)} instead`);
|
|
4830
4830
|
if (e.length === 4) {
|
|
4831
4831
|
const o = t.parse(e[3], 3, b);
|
|
4832
|
-
return o ? new
|
|
4832
|
+
return o ? new _t(n, a, o) : null;
|
|
4833
4833
|
} else
|
|
4834
|
-
return new
|
|
4834
|
+
return new _t(n, a);
|
|
4835
4835
|
}
|
|
4836
4836
|
evaluate(e) {
|
|
4837
4837
|
const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
|
|
@@ -4953,7 +4953,7 @@ class Hr {
|
|
|
4953
4953
|
return this.branches.every(([e, t]) => t.outputDefined()) && this.otherwise.outputDefined();
|
|
4954
4954
|
}
|
|
4955
4955
|
}
|
|
4956
|
-
class
|
|
4956
|
+
class It {
|
|
4957
4957
|
constructor(e, t, n, a) {
|
|
4958
4958
|
this.type = e, this.input = t, this.beginIndex = n, this.endIndex = a;
|
|
4959
4959
|
}
|
|
@@ -4963,13 +4963,13 @@ class Tt {
|
|
|
4963
4963
|
const n = t.parse(e[1], 1, T), a = t.parse(e[2], 2, b);
|
|
4964
4964
|
if (!n || !a)
|
|
4965
4965
|
return null;
|
|
4966
|
-
if (!Ur(n.type, [Z(T),
|
|
4966
|
+
if (!Ur(n.type, [Z(T), I, T]))
|
|
4967
4967
|
return t.error(`Expected first argument to be of type array or string, but found ${j(n.type)} instead`);
|
|
4968
4968
|
if (e.length === 4) {
|
|
4969
4969
|
const o = t.parse(e[3], 3, b);
|
|
4970
|
-
return o ? new
|
|
4970
|
+
return o ? new It(n.type, n, a, o) : null;
|
|
4971
4971
|
} else
|
|
4972
|
-
return new
|
|
4972
|
+
return new It(n.type, n, a);
|
|
4973
4973
|
}
|
|
4974
4974
|
evaluate(e) {
|
|
4975
4975
|
const t = this.input.evaluate(e), n = this.beginIndex.evaluate(e);
|
|
@@ -5001,7 +5001,7 @@ function Ca(r, e) {
|
|
|
5001
5001
|
throw new N("Input is not a number.");
|
|
5002
5002
|
return 0;
|
|
5003
5003
|
}
|
|
5004
|
-
class
|
|
5004
|
+
class Xt {
|
|
5005
5005
|
constructor(e, t, n) {
|
|
5006
5006
|
this.type = e, this.input = t, this.labels = [], this.outputs = [];
|
|
5007
5007
|
for (const [a, o] of n)
|
|
@@ -5029,7 +5029,7 @@ class Ht {
|
|
|
5029
5029
|
return null;
|
|
5030
5030
|
o = o || p.type, a.push([s, p]);
|
|
5031
5031
|
}
|
|
5032
|
-
return new
|
|
5032
|
+
return new Xt(o, n, a);
|
|
5033
5033
|
}
|
|
5034
5034
|
evaluate(e) {
|
|
5035
5035
|
const t = this.labels, n = this.outputs;
|
|
@@ -5056,10 +5056,10 @@ class Ht {
|
|
|
5056
5056
|
function ss(r) {
|
|
5057
5057
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
5058
5058
|
}
|
|
5059
|
-
var
|
|
5059
|
+
var ur, En;
|
|
5060
5060
|
function ls() {
|
|
5061
|
-
if (En) return
|
|
5062
|
-
En = 1,
|
|
5061
|
+
if (En) return ur;
|
|
5062
|
+
En = 1, ur = r;
|
|
5063
5063
|
function r(e, t, n, a) {
|
|
5064
5064
|
this.cx = 3 * e, this.bx = 3 * (n - e) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * t, this.by = 3 * (a - t) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = e, this.p1y = t, this.p2x = n, this.p2y = a;
|
|
5065
5065
|
}
|
|
@@ -5091,7 +5091,7 @@ function ls() {
|
|
|
5091
5091
|
solve: function(e, t) {
|
|
5092
5092
|
return this.sampleCurveY(this.solveCurveX(e, t));
|
|
5093
5093
|
}
|
|
5094
|
-
},
|
|
5094
|
+
}, ur;
|
|
5095
5095
|
}
|
|
5096
5096
|
var us = ls(), cs = /* @__PURE__ */ ss(us);
|
|
5097
5097
|
class he {
|
|
@@ -5103,12 +5103,12 @@ class he {
|
|
|
5103
5103
|
static interpolationFactor(e, t, n, a) {
|
|
5104
5104
|
let o = 0;
|
|
5105
5105
|
if (e.name === "exponential")
|
|
5106
|
-
o =
|
|
5106
|
+
o = cr(t, e.base, n, a);
|
|
5107
5107
|
else if (e.name === "linear")
|
|
5108
|
-
o =
|
|
5108
|
+
o = cr(t, 1, n, a);
|
|
5109
5109
|
else if (e.name === "cubic-bezier") {
|
|
5110
5110
|
const i = e.controlPoints;
|
|
5111
|
-
o = new cs(i[0], i[1], i[2], i[3]).solve(
|
|
5111
|
+
o = new cs(i[0], i[1], i[2], i[3]).solve(cr(t, 1, n, a));
|
|
5112
5112
|
}
|
|
5113
5113
|
return o;
|
|
5114
5114
|
}
|
|
@@ -5144,7 +5144,7 @@ class he {
|
|
|
5144
5144
|
return null;
|
|
5145
5145
|
const s = [];
|
|
5146
5146
|
let l = null;
|
|
5147
|
-
(n === "interpolate-hcl" || n === "interpolate-lab") && t.expectedType !=
|
|
5147
|
+
(n === "interpolate-hcl" || n === "interpolate-lab") && t.expectedType != nt ? l = de : t.expectedType && t.expectedType.kind !== "value" && (l = t.expectedType);
|
|
5148
5148
|
for (let u = 0; u < i.length; u += 2) {
|
|
5149
5149
|
const c = i[u], p = i[u + 1], f = u + 3, d = u + 4;
|
|
5150
5150
|
if (typeof c != "number")
|
|
@@ -5156,7 +5156,7 @@ class he {
|
|
|
5156
5156
|
return null;
|
|
5157
5157
|
l = l || h.type, s.push([c, h]);
|
|
5158
5158
|
}
|
|
5159
|
-
return !we(l, b) && !we(l,
|
|
5159
|
+
return !we(l, b) && !we(l, Nt) && !we(l, de) && !we(l, Bt) && !we(l, qt) && !we(l, nt) && !we(l, Gt) && !we(l, Z(b)) ? t.error(`Type ${j(l)} is not interpolatable.`) : new he(l, n, a, o, s);
|
|
5160
5160
|
}
|
|
5161
5161
|
evaluate(e) {
|
|
5162
5162
|
const t = this.labels, n = this.outputs;
|
|
@@ -5185,7 +5185,7 @@ class he {
|
|
|
5185
5185
|
case "variableAnchorOffsetCollection":
|
|
5186
5186
|
return ue.interpolate(c, p, u);
|
|
5187
5187
|
case "array":
|
|
5188
|
-
return
|
|
5188
|
+
return Ve(c, p, u);
|
|
5189
5189
|
case "projectionDefinition":
|
|
5190
5190
|
return ie.interpolate(c, p, u);
|
|
5191
5191
|
}
|
|
@@ -5214,12 +5214,12 @@ class he {
|
|
|
5214
5214
|
return this.outputs.every((e) => e.outputDefined());
|
|
5215
5215
|
}
|
|
5216
5216
|
}
|
|
5217
|
-
function
|
|
5217
|
+
function cr(r, e, t, n) {
|
|
5218
5218
|
const a = n - t, o = r - t;
|
|
5219
5219
|
return a === 0 ? 0 : e === 1 ? o / a : (Math.pow(e, o) - 1) / (Math.pow(e, a) - 1);
|
|
5220
5220
|
}
|
|
5221
5221
|
F.interpolate, Q.interpolate, ee.interpolate, X.interpolate, ue.interpolate;
|
|
5222
|
-
class
|
|
5222
|
+
class it {
|
|
5223
5223
|
constructor(e, t) {
|
|
5224
5224
|
this.type = e, this.args = t;
|
|
5225
5225
|
}
|
|
@@ -5238,7 +5238,7 @@ class ot {
|
|
|
5238
5238
|
}
|
|
5239
5239
|
if (!n)
|
|
5240
5240
|
throw new Error("No output type");
|
|
5241
|
-
return a && o.some((s) =>
|
|
5241
|
+
return a && o.some((s) => at(a, s.type)) ? new it(T, o) : new it(n, o);
|
|
5242
5242
|
}
|
|
5243
5243
|
evaluate(e) {
|
|
5244
5244
|
let t = null, n = 0, a;
|
|
@@ -5293,7 +5293,7 @@ function ws(r, e, t, n) {
|
|
|
5293
5293
|
function Ss(r, e, t, n) {
|
|
5294
5294
|
return n.compare(e, t) >= 0;
|
|
5295
5295
|
}
|
|
5296
|
-
function
|
|
5296
|
+
function Xe(r, e, t) {
|
|
5297
5297
|
const n = r !== "==" && r !== "!=";
|
|
5298
5298
|
return class Aa {
|
|
5299
5299
|
constructor(o, i, s) {
|
|
@@ -5320,7 +5320,7 @@ function Ke(r, e, t) {
|
|
|
5320
5320
|
if (o.length === 4) {
|
|
5321
5321
|
if (l.type.kind !== "string" && u.type.kind !== "string" && l.type.kind !== "value" && u.type.kind !== "value")
|
|
5322
5322
|
return i.error("Cannot use collator to compare non-string types.");
|
|
5323
|
-
if (c = i.parse(o[3], 3,
|
|
5323
|
+
if (c = i.parse(o[3], 3, Dt), !c)
|
|
5324
5324
|
return null;
|
|
5325
5325
|
}
|
|
5326
5326
|
return new Aa(l, u, c);
|
|
@@ -5347,10 +5347,10 @@ function Ke(r, e, t) {
|
|
|
5347
5347
|
}
|
|
5348
5348
|
};
|
|
5349
5349
|
}
|
|
5350
|
-
const xs =
|
|
5351
|
-
class
|
|
5350
|
+
const xs = Xe("==", ps, La), ks = Xe("!=", fs, gs), Cs = Xe("<", ds, vs), Ls = Xe(">", hs, bs), As = Xe("<=", ys, ws), Es = Xe(">=", ms, Ss);
|
|
5351
|
+
class Wt {
|
|
5352
5352
|
constructor(e, t, n) {
|
|
5353
|
-
this.type =
|
|
5353
|
+
this.type = Dt, this.locale = n, this.caseSensitive = e, this.diacriticSensitive = t;
|
|
5354
5354
|
}
|
|
5355
5355
|
static parse(e, t) {
|
|
5356
5356
|
if (e.length !== 2)
|
|
@@ -5365,7 +5365,7 @@ class Kt {
|
|
|
5365
5365
|
if (!o)
|
|
5366
5366
|
return null;
|
|
5367
5367
|
let i = null;
|
|
5368
|
-
return n.locale && (i = t.parse(n.locale, 1,
|
|
5368
|
+
return n.locale && (i = t.parse(n.locale, 1, I), !i) ? null : new Wt(a, o, i);
|
|
5369
5369
|
}
|
|
5370
5370
|
evaluate(e) {
|
|
5371
5371
|
return new Br(this.caseSensitive.evaluate(e), this.diacriticSensitive.evaluate(e), this.locale ? this.locale.evaluate(e) : null);
|
|
@@ -5379,7 +5379,7 @@ class Kt {
|
|
|
5379
5379
|
}
|
|
5380
5380
|
class Kr {
|
|
5381
5381
|
constructor(e, t, n, a, o) {
|
|
5382
|
-
this.type =
|
|
5382
|
+
this.type = I, this.number = e, this.locale = t, this.currency = n, this.minFractionDigits = a, this.maxFractionDigits = o;
|
|
5383
5383
|
}
|
|
5384
5384
|
static parse(e, t) {
|
|
5385
5385
|
if (e.length !== 3)
|
|
@@ -5391,10 +5391,10 @@ class Kr {
|
|
|
5391
5391
|
if (typeof a != "object" || Array.isArray(a))
|
|
5392
5392
|
return t.error("NumberFormat options argument must be an object.");
|
|
5393
5393
|
let o = null;
|
|
5394
|
-
if (a.locale && (o = t.parse(a.locale, 1,
|
|
5394
|
+
if (a.locale && (o = t.parse(a.locale, 1, I), !o))
|
|
5395
5395
|
return null;
|
|
5396
5396
|
let i = null;
|
|
5397
|
-
if (a.currency && (i = t.parse(a.currency, 1,
|
|
5397
|
+
if (a.currency && (i = t.parse(a.currency, 1, I), !i))
|
|
5398
5398
|
return null;
|
|
5399
5399
|
let s = null;
|
|
5400
5400
|
if (a["min-fraction-digits"] && (s = t.parse(a["min-fraction-digits"], 1, b), !s))
|
|
@@ -5419,7 +5419,7 @@ class Kr {
|
|
|
5419
5419
|
}
|
|
5420
5420
|
class Xr {
|
|
5421
5421
|
constructor(e) {
|
|
5422
|
-
this.type =
|
|
5422
|
+
this.type = Ut, this.sections = e;
|
|
5423
5423
|
}
|
|
5424
5424
|
static parse(e, t) {
|
|
5425
5425
|
if (e.length < 2)
|
|
@@ -5437,7 +5437,7 @@ class Xr {
|
|
|
5437
5437
|
if (s["font-scale"] && (l = t.parse(s["font-scale"], 1, b), !l))
|
|
5438
5438
|
return null;
|
|
5439
5439
|
let u = null;
|
|
5440
|
-
if (s["text-font"] && (u = t.parse(s["text-font"], 1, Z(
|
|
5440
|
+
if (s["text-font"] && (u = t.parse(s["text-font"], 1, Z(I)), !u))
|
|
5441
5441
|
return null;
|
|
5442
5442
|
let c = null;
|
|
5443
5443
|
if (s["text-color"] && (c = t.parse(s["text-color"], 1, de), !c))
|
|
@@ -5446,7 +5446,7 @@ class Xr {
|
|
|
5446
5446
|
if (s["vertical-align"]) {
|
|
5447
5447
|
if (typeof s["vertical-align"] == "string" && !as.includes(s["vertical-align"]))
|
|
5448
5448
|
return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${s["vertical-align"]}' instead.`);
|
|
5449
|
-
if (p = t.parse(s["vertical-align"], 1,
|
|
5449
|
+
if (p = t.parse(s["vertical-align"], 1, I), !p)
|
|
5450
5450
|
return null;
|
|
5451
5451
|
}
|
|
5452
5452
|
const f = a[a.length - 1];
|
|
@@ -5466,7 +5466,7 @@ class Xr {
|
|
|
5466
5466
|
evaluate(e) {
|
|
5467
5467
|
const t = (n) => {
|
|
5468
5468
|
const a = n.content.evaluate(e);
|
|
5469
|
-
return B(a) ===
|
|
5469
|
+
return B(a) === ft ? new Lr("", a, null, null, null, n.verticalAlign ? n.verticalAlign.evaluate(e) : null) : new Lr(tt(a), null, n.scale ? n.scale.evaluate(e) : null, n.font ? n.font.evaluate(e).join(",") : null, n.textColor ? n.textColor.evaluate(e) : null, n.verticalAlign ? n.verticalAlign.evaluate(e) : null);
|
|
5470
5470
|
};
|
|
5471
5471
|
return new me(this.sections.map(t));
|
|
5472
5472
|
}
|
|
@@ -5480,12 +5480,12 @@ class Xr {
|
|
|
5480
5480
|
}
|
|
5481
5481
|
class Wr {
|
|
5482
5482
|
constructor(e) {
|
|
5483
|
-
this.type =
|
|
5483
|
+
this.type = ft, this.input = e;
|
|
5484
5484
|
}
|
|
5485
5485
|
static parse(e, t) {
|
|
5486
5486
|
if (e.length !== 2)
|
|
5487
5487
|
return t.error("Expected two arguments.");
|
|
5488
|
-
const n = t.parse(e[1], 1,
|
|
5488
|
+
const n = t.parse(e[1], 1, I);
|
|
5489
5489
|
return n ? new Wr(n) : t.error("No image name provided.");
|
|
5490
5490
|
}
|
|
5491
5491
|
evaluate(e) {
|
|
@@ -5526,29 +5526,29 @@ class Zr {
|
|
|
5526
5526
|
}
|
|
5527
5527
|
const ye = 8192;
|
|
5528
5528
|
function Ts(r, e) {
|
|
5529
|
-
const t = _s(r[0]), n =
|
|
5529
|
+
const t = _s(r[0]), n = Ms(r[1]), a = Math.pow(2, e.z);
|
|
5530
5530
|
return [Math.round(t * a * ye), Math.round(n * a * ye)];
|
|
5531
5531
|
}
|
|
5532
5532
|
function Yr(r, e) {
|
|
5533
5533
|
const t = Math.pow(2, e.z), n = (r[0] / ye + e.x) / t, a = (r[1] / ye + e.y) / t;
|
|
5534
|
-
return [
|
|
5534
|
+
return [Is(n), Ps(a)];
|
|
5535
5535
|
}
|
|
5536
5536
|
function _s(r) {
|
|
5537
5537
|
return (180 + r) / 360;
|
|
5538
5538
|
}
|
|
5539
|
-
function
|
|
5539
|
+
function Is(r) {
|
|
5540
5540
|
return r * 360 - 180;
|
|
5541
5541
|
}
|
|
5542
|
-
function
|
|
5542
|
+
function Ms(r) {
|
|
5543
5543
|
return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + r * Math.PI / 360))) / 360;
|
|
5544
5544
|
}
|
|
5545
5545
|
function Ps(r) {
|
|
5546
5546
|
return 360 / Math.PI * Math.atan(Math.exp((180 - r * 360) * Math.PI / 180)) - 90;
|
|
5547
5547
|
}
|
|
5548
|
-
function
|
|
5548
|
+
function dt(r, e) {
|
|
5549
5549
|
r[0] = Math.min(r[0], e[0]), r[1] = Math.min(r[1], e[1]), r[2] = Math.max(r[2], e[0]), r[3] = Math.max(r[3], e[1]);
|
|
5550
5550
|
}
|
|
5551
|
-
function
|
|
5551
|
+
function st(r, e) {
|
|
5552
5552
|
return !(r[0] <= e[0] || r[2] >= e[2] || r[1] <= e[1] || r[3] >= e[3]);
|
|
5553
5553
|
}
|
|
5554
5554
|
function Rs(r, e, t) {
|
|
@@ -5558,18 +5558,18 @@ function zs(r, e, t) {
|
|
|
5558
5558
|
const n = r[0] - e[0], a = r[1] - e[1], o = r[0] - t[0], i = r[1] - t[1];
|
|
5559
5559
|
return n * i - o * a === 0 && n * o <= 0 && a * i <= 0;
|
|
5560
5560
|
}
|
|
5561
|
-
function
|
|
5561
|
+
function Zt(r, e, t, n) {
|
|
5562
5562
|
const a = [e[0] - r[0], e[1] - r[1]], o = [n[0] - t[0], n[1] - t[1]];
|
|
5563
5563
|
return js(o, a) === 0 ? !1 : !!(_n(r, e, t, n) && _n(t, n, r, e));
|
|
5564
5564
|
}
|
|
5565
5565
|
function Fs(r, e, t) {
|
|
5566
5566
|
for (const n of t)
|
|
5567
5567
|
for (let a = 0; a < n.length - 1; ++a)
|
|
5568
|
-
if (
|
|
5568
|
+
if (Zt(r, e, n[a], n[a + 1]))
|
|
5569
5569
|
return !0;
|
|
5570
5570
|
return !1;
|
|
5571
5571
|
}
|
|
5572
|
-
function
|
|
5572
|
+
function We(r, e, t = !1) {
|
|
5573
5573
|
let n = !1;
|
|
5574
5574
|
for (const a of e)
|
|
5575
5575
|
for (let o = 0; o < a.length - 1; o++) {
|
|
@@ -5581,13 +5581,13 @@ function Xe(r, e, t = !1) {
|
|
|
5581
5581
|
}
|
|
5582
5582
|
function $s(r, e) {
|
|
5583
5583
|
for (const t of e)
|
|
5584
|
-
if (
|
|
5584
|
+
if (We(r, t))
|
|
5585
5585
|
return !0;
|
|
5586
5586
|
return !1;
|
|
5587
5587
|
}
|
|
5588
5588
|
function Ea(r, e) {
|
|
5589
5589
|
for (const t of r)
|
|
5590
|
-
if (!
|
|
5590
|
+
if (!We(t, e))
|
|
5591
5591
|
return !1;
|
|
5592
5592
|
for (let t = 0; t < r.length - 1; ++t)
|
|
5593
5593
|
if (Fs(r[t], r[t + 1], e))
|
|
@@ -5613,7 +5613,7 @@ function Jr(r, e, t) {
|
|
|
5613
5613
|
const o = [];
|
|
5614
5614
|
for (let i = 0; i < r[a].length; i++) {
|
|
5615
5615
|
const s = Ts(r[a][i], t);
|
|
5616
|
-
|
|
5616
|
+
dt(e, s), o.push(s);
|
|
5617
5617
|
}
|
|
5618
5618
|
n.push(o);
|
|
5619
5619
|
}
|
|
@@ -5633,12 +5633,12 @@ function _a(r, e, t, n) {
|
|
|
5633
5633
|
let o = r[0] - t[0] > a ? -n : t[0] - r[0] > a ? n : 0;
|
|
5634
5634
|
o === 0 && (o = r[0] - t[2] > a ? -n : t[2] - r[0] > a ? n : 0), r[0] += o;
|
|
5635
5635
|
}
|
|
5636
|
-
|
|
5636
|
+
dt(e, r);
|
|
5637
5637
|
}
|
|
5638
5638
|
function Ns(r) {
|
|
5639
5639
|
r[0] = r[1] = 1 / 0, r[2] = r[3] = -1 / 0;
|
|
5640
5640
|
}
|
|
5641
|
-
function
|
|
5641
|
+
function In(r, e, t, n) {
|
|
5642
5642
|
const a = Math.pow(2, n.z) * ye, o = [n.x * ye, n.y * ye], i = [];
|
|
5643
5643
|
for (const s of r)
|
|
5644
5644
|
for (const l of s) {
|
|
@@ -5647,13 +5647,13 @@ function Mn(r, e, t, n) {
|
|
|
5647
5647
|
}
|
|
5648
5648
|
return i;
|
|
5649
5649
|
}
|
|
5650
|
-
function
|
|
5650
|
+
function Mn(r, e, t, n) {
|
|
5651
5651
|
const a = Math.pow(2, n.z) * ye, o = [n.x * ye, n.y * ye], i = [];
|
|
5652
5652
|
for (const s of r) {
|
|
5653
5653
|
const l = [];
|
|
5654
5654
|
for (const u of s) {
|
|
5655
5655
|
const c = [u.x + o[0], u.y + o[1]];
|
|
5656
|
-
|
|
5656
|
+
dt(e, c), l.push(c);
|
|
5657
5657
|
}
|
|
5658
5658
|
i.push(l);
|
|
5659
5659
|
}
|
|
@@ -5668,16 +5668,16 @@ function In(r, e, t, n) {
|
|
|
5668
5668
|
function Ds(r, e) {
|
|
5669
5669
|
const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = r.canonicalID();
|
|
5670
5670
|
if (e.type === "Polygon") {
|
|
5671
|
-
const o = Jr(e.coordinates, n, a), i =
|
|
5672
|
-
if (!
|
|
5671
|
+
const o = Jr(e.coordinates, n, a), i = In(r.geometry(), t, n, a);
|
|
5672
|
+
if (!st(t, n))
|
|
5673
5673
|
return !1;
|
|
5674
5674
|
for (const s of i)
|
|
5675
|
-
if (!
|
|
5675
|
+
if (!We(s, o))
|
|
5676
5676
|
return !1;
|
|
5677
5677
|
}
|
|
5678
5678
|
if (e.type === "MultiPolygon") {
|
|
5679
|
-
const o = Ta(e.coordinates, n, a), i =
|
|
5680
|
-
if (!
|
|
5679
|
+
const o = Ta(e.coordinates, n, a), i = In(r.geometry(), t, n, a);
|
|
5680
|
+
if (!st(t, n))
|
|
5681
5681
|
return !1;
|
|
5682
5682
|
for (const s of i)
|
|
5683
5683
|
if (!$s(s, o))
|
|
@@ -5688,16 +5688,16 @@ function Ds(r, e) {
|
|
|
5688
5688
|
function Us(r, e) {
|
|
5689
5689
|
const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = r.canonicalID();
|
|
5690
5690
|
if (e.type === "Polygon") {
|
|
5691
|
-
const o = Jr(e.coordinates, n, a), i =
|
|
5692
|
-
if (!
|
|
5691
|
+
const o = Jr(e.coordinates, n, a), i = Mn(r.geometry(), t, n, a);
|
|
5692
|
+
if (!st(t, n))
|
|
5693
5693
|
return !1;
|
|
5694
5694
|
for (const s of i)
|
|
5695
5695
|
if (!Ea(s, o))
|
|
5696
5696
|
return !1;
|
|
5697
5697
|
}
|
|
5698
5698
|
if (e.type === "MultiPolygon") {
|
|
5699
|
-
const o = Ta(e.coordinates, n, a), i =
|
|
5700
|
-
if (!
|
|
5699
|
+
const o = Ta(e.coordinates, n, a), i = Mn(r.geometry(), t, n, a);
|
|
5700
|
+
if (!st(t, n))
|
|
5701
5701
|
return !1;
|
|
5702
5702
|
for (const s of i)
|
|
5703
5703
|
if (!Os(s, o))
|
|
@@ -5712,7 +5712,7 @@ class Fe {
|
|
|
5712
5712
|
static parse(e, t) {
|
|
5713
5713
|
if (e.length !== 2)
|
|
5714
5714
|
return t.error(`'within' expression requires exactly one argument, but found ${e.length - 1} instead.`);
|
|
5715
|
-
if (
|
|
5715
|
+
if (ot(e[1])) {
|
|
5716
5716
|
const n = e[1];
|
|
5717
5717
|
if (n.type === "FeatureCollection") {
|
|
5718
5718
|
const a = [];
|
|
@@ -5751,7 +5751,7 @@ class Fe {
|
|
|
5751
5751
|
return !0;
|
|
5752
5752
|
}
|
|
5753
5753
|
}
|
|
5754
|
-
class
|
|
5754
|
+
class Ia {
|
|
5755
5755
|
constructor(e = [], t = (n, a) => n < a ? -1 : n > a ? 1 : 0) {
|
|
5756
5756
|
if (this.data = e, this.length = this.data.length, this.compare = t, this.length > 0)
|
|
5757
5757
|
for (let n = (this.length >> 1) - 1; n >= 0; n--) this._down(n);
|
|
@@ -5858,20 +5858,20 @@ class Qr {
|
|
|
5858
5858
|
return e;
|
|
5859
5859
|
}
|
|
5860
5860
|
}
|
|
5861
|
-
const
|
|
5862
|
-
function
|
|
5861
|
+
const Ar = 100, Er = 50;
|
|
5862
|
+
function Ma(r, e) {
|
|
5863
5863
|
return e[0] - r[0];
|
|
5864
5864
|
}
|
|
5865
|
-
function
|
|
5865
|
+
function Mt(r) {
|
|
5866
5866
|
return r[1] - r[0] + 1;
|
|
5867
5867
|
}
|
|
5868
5868
|
function ve(r, e) {
|
|
5869
5869
|
return r[1] >= r[0] && r[1] < e;
|
|
5870
5870
|
}
|
|
5871
|
-
function
|
|
5871
|
+
function Tr(r, e) {
|
|
5872
5872
|
if (r[0] > r[1])
|
|
5873
5873
|
return [null, null];
|
|
5874
|
-
const t =
|
|
5874
|
+
const t = Mt(r);
|
|
5875
5875
|
if (e) {
|
|
5876
5876
|
if (t === 2)
|
|
5877
5877
|
return [r, null];
|
|
@@ -5889,19 +5889,19 @@ function Ar(r, e) {
|
|
|
5889
5889
|
[r[0] + n + 1, r[1]]
|
|
5890
5890
|
];
|
|
5891
5891
|
}
|
|
5892
|
-
function
|
|
5892
|
+
function _r(r, e) {
|
|
5893
5893
|
if (!ve(e, r.length))
|
|
5894
5894
|
return [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
5895
5895
|
const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
5896
5896
|
for (let n = e[0]; n <= e[1]; ++n)
|
|
5897
|
-
|
|
5897
|
+
dt(t, r[n]);
|
|
5898
5898
|
return t;
|
|
5899
5899
|
}
|
|
5900
|
-
function
|
|
5900
|
+
function Ir(r) {
|
|
5901
5901
|
const e = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
5902
5902
|
for (const t of r)
|
|
5903
5903
|
for (const n of t)
|
|
5904
|
-
|
|
5904
|
+
dt(e, n);
|
|
5905
5905
|
return e;
|
|
5906
5906
|
}
|
|
5907
5907
|
function Fn(r) {
|
|
@@ -5929,7 +5929,7 @@ function Vs(r, e, t, n, a) {
|
|
|
5929
5929
|
const l = r[s], u = r[s + 1];
|
|
5930
5930
|
for (let c = n[0]; c < n[1]; ++c) {
|
|
5931
5931
|
const p = t[c], f = t[c + 1];
|
|
5932
|
-
if (
|
|
5932
|
+
if (Zt(l, u, p, f))
|
|
5933
5933
|
return 0;
|
|
5934
5934
|
i = Math.min(i, tn(l, u, p, f, a));
|
|
5935
5935
|
}
|
|
@@ -5947,7 +5947,7 @@ function Hs(r, e, t, n, a) {
|
|
|
5947
5947
|
return i;
|
|
5948
5948
|
}
|
|
5949
5949
|
function Ks(r, e, t) {
|
|
5950
|
-
if (
|
|
5950
|
+
if (We(r, e, !0))
|
|
5951
5951
|
return 0;
|
|
5952
5952
|
let n = 1 / 0;
|
|
5953
5953
|
for (const a of e) {
|
|
@@ -5964,7 +5964,7 @@ function Xs(r, e, t, n) {
|
|
|
5964
5964
|
if (!ve(e, r.length))
|
|
5965
5965
|
return NaN;
|
|
5966
5966
|
for (let o = e[0]; o <= e[1]; ++o)
|
|
5967
|
-
if (
|
|
5967
|
+
if (We(r[o], t, !0))
|
|
5968
5968
|
return 0;
|
|
5969
5969
|
let a = 1 / 0;
|
|
5970
5970
|
for (let o = e[0]; o < e[1]; ++o) {
|
|
@@ -5972,7 +5972,7 @@ function Xs(r, e, t, n) {
|
|
|
5972
5972
|
for (const l of t)
|
|
5973
5973
|
for (let u = 0, c = l.length, p = c - 1; u < c; p = u++) {
|
|
5974
5974
|
const f = l[p], d = l[u];
|
|
5975
|
-
if (
|
|
5975
|
+
if (Zt(i, s, f, d))
|
|
5976
5976
|
return 0;
|
|
5977
5977
|
a = Math.min(a, tn(i, s, f, d, n));
|
|
5978
5978
|
}
|
|
@@ -5982,15 +5982,15 @@ function Xs(r, e, t, n) {
|
|
|
5982
5982
|
function $n(r, e) {
|
|
5983
5983
|
for (const t of r)
|
|
5984
5984
|
for (const n of t)
|
|
5985
|
-
if (
|
|
5985
|
+
if (We(n, e, !0))
|
|
5986
5986
|
return !0;
|
|
5987
5987
|
return !1;
|
|
5988
5988
|
}
|
|
5989
5989
|
function Ws(r, e, t, n = 1 / 0) {
|
|
5990
|
-
const a =
|
|
5990
|
+
const a = Ir(r), o = Ir(e);
|
|
5991
5991
|
if (n !== 1 / 0 && en(a, o, t) >= n)
|
|
5992
5992
|
return n;
|
|
5993
|
-
if (
|
|
5993
|
+
if (st(a, o)) {
|
|
5994
5994
|
if ($n(r, e))
|
|
5995
5995
|
return 0;
|
|
5996
5996
|
} else if ($n(e, r))
|
|
@@ -6002,7 +6002,7 @@ function Ws(r, e, t, n = 1 / 0) {
|
|
|
6002
6002
|
for (const d of e)
|
|
6003
6003
|
for (let h = 0, y = d.length, m = y - 1; h < y; m = h++) {
|
|
6004
6004
|
const w = d[m], v = d[h];
|
|
6005
|
-
if (
|
|
6005
|
+
if (Zt(p, f, w, v))
|
|
6006
6006
|
return 0;
|
|
6007
6007
|
i = Math.min(i, tn(p, f, w, v, t));
|
|
6008
6008
|
}
|
|
@@ -6012,26 +6012,26 @@ function Ws(r, e, t, n = 1 / 0) {
|
|
|
6012
6012
|
function On(r, e, t, n, a, o) {
|
|
6013
6013
|
if (!o)
|
|
6014
6014
|
return;
|
|
6015
|
-
const i = en(
|
|
6015
|
+
const i = en(_r(n, o), a, t);
|
|
6016
6016
|
i < e && r.push([i, o, [0, 0]]);
|
|
6017
6017
|
}
|
|
6018
|
-
function
|
|
6018
|
+
function St(r, e, t, n, a, o, i) {
|
|
6019
6019
|
if (!o || !i)
|
|
6020
6020
|
return;
|
|
6021
|
-
const s = en(
|
|
6021
|
+
const s = en(_r(n, o), _r(a, i), t);
|
|
6022
6022
|
s < e && r.push([s, o, i]);
|
|
6023
6023
|
}
|
|
6024
|
-
function
|
|
6024
|
+
function Pt(r, e, t, n, a = 1 / 0) {
|
|
6025
6025
|
let o = Math.min(n.distance(r[0], t[0][0]), a);
|
|
6026
6026
|
if (o === 0)
|
|
6027
6027
|
return o;
|
|
6028
|
-
const i = new
|
|
6028
|
+
const i = new Ia([[0, [0, r.length - 1], [0, 0]]], Ma), s = Ir(t);
|
|
6029
6029
|
for (; i.length > 0; ) {
|
|
6030
6030
|
const l = i.pop();
|
|
6031
6031
|
if (l[0] >= o)
|
|
6032
6032
|
continue;
|
|
6033
|
-
const u = l[1], c = e ?
|
|
6034
|
-
if (
|
|
6033
|
+
const u = l[1], c = e ? Er : Ar;
|
|
6034
|
+
if (Mt(u) <= c) {
|
|
6035
6035
|
if (!ve(u, r.length))
|
|
6036
6036
|
return NaN;
|
|
6037
6037
|
if (e) {
|
|
@@ -6046,23 +6046,23 @@ function Mt(r, e, t, n, a = 1 / 0) {
|
|
|
6046
6046
|
return 0;
|
|
6047
6047
|
}
|
|
6048
6048
|
} else {
|
|
6049
|
-
const p =
|
|
6049
|
+
const p = Tr(u, e);
|
|
6050
6050
|
On(i, o, n, r, s, p[0]), On(i, o, n, r, s, p[1]);
|
|
6051
6051
|
}
|
|
6052
6052
|
}
|
|
6053
6053
|
return o;
|
|
6054
6054
|
}
|
|
6055
|
-
function
|
|
6055
|
+
function Rt(r, e, t, n, a, o = 1 / 0) {
|
|
6056
6056
|
let i = Math.min(o, a.distance(r[0], t[0]));
|
|
6057
6057
|
if (i === 0)
|
|
6058
6058
|
return i;
|
|
6059
|
-
const s = new
|
|
6059
|
+
const s = new Ia([[0, [0, r.length - 1], [0, t.length - 1]]], Ma);
|
|
6060
6060
|
for (; s.length > 0; ) {
|
|
6061
6061
|
const l = s.pop();
|
|
6062
6062
|
if (l[0] >= i)
|
|
6063
6063
|
continue;
|
|
6064
|
-
const u = l[1], c = l[2], p = e ?
|
|
6065
|
-
if (
|
|
6064
|
+
const u = l[1], c = l[2], p = e ? Er : Ar, f = n ? Er : Ar;
|
|
6065
|
+
if (Mt(u) <= p && Mt(c) <= f) {
|
|
6066
6066
|
if (!ve(u, r.length) && ve(c, t.length))
|
|
6067
6067
|
return NaN;
|
|
6068
6068
|
let d;
|
|
@@ -6081,8 +6081,8 @@ function It(r, e, t, n, a, o = 1 / 0) {
|
|
|
6081
6081
|
} else
|
|
6082
6082
|
d = Hs(r, u, t, c, a), i = Math.min(i, d);
|
|
6083
6083
|
} else {
|
|
6084
|
-
const d =
|
|
6085
|
-
|
|
6084
|
+
const d = Tr(u, e), h = Tr(c, n);
|
|
6085
|
+
St(s, i, a, r, t, d[0], h[0]), St(s, i, a, r, t, d[0], h[1]), St(s, i, a, r, t, d[1], h[0]), St(s, i, a, r, t, d[1], h[1]);
|
|
6086
6086
|
}
|
|
6087
6087
|
}
|
|
6088
6088
|
return i;
|
|
@@ -6096,13 +6096,13 @@ function Zs(r, e) {
|
|
|
6096
6096
|
for (const i of e) {
|
|
6097
6097
|
switch (i.type) {
|
|
6098
6098
|
case "Point":
|
|
6099
|
-
o = Math.min(o,
|
|
6099
|
+
o = Math.min(o, Rt(n, !1, [i.coordinates], !1, a, o));
|
|
6100
6100
|
break;
|
|
6101
6101
|
case "LineString":
|
|
6102
|
-
o = Math.min(o,
|
|
6102
|
+
o = Math.min(o, Rt(n, !1, i.coordinates, !0, a, o));
|
|
6103
6103
|
break;
|
|
6104
6104
|
case "Polygon":
|
|
6105
|
-
o = Math.min(o,
|
|
6105
|
+
o = Math.min(o, Pt(n, !1, i.coordinates, a, o));
|
|
6106
6106
|
break;
|
|
6107
6107
|
}
|
|
6108
6108
|
if (o === 0)
|
|
@@ -6119,13 +6119,13 @@ function Ys(r, e) {
|
|
|
6119
6119
|
for (const i of e) {
|
|
6120
6120
|
switch (i.type) {
|
|
6121
6121
|
case "Point":
|
|
6122
|
-
o = Math.min(o,
|
|
6122
|
+
o = Math.min(o, Rt(n, !0, [i.coordinates], !1, a, o));
|
|
6123
6123
|
break;
|
|
6124
6124
|
case "LineString":
|
|
6125
|
-
o = Math.min(o,
|
|
6125
|
+
o = Math.min(o, Rt(n, !0, i.coordinates, !0, a, o));
|
|
6126
6126
|
break;
|
|
6127
6127
|
case "Polygon":
|
|
6128
|
-
o = Math.min(o,
|
|
6128
|
+
o = Math.min(o, Pt(n, !0, i.coordinates, a, o));
|
|
6129
6129
|
break;
|
|
6130
6130
|
}
|
|
6131
6131
|
if (o === 0)
|
|
@@ -6143,10 +6143,10 @@ function Js(r, e) {
|
|
|
6143
6143
|
for (const s of n) {
|
|
6144
6144
|
switch (i.type) {
|
|
6145
6145
|
case "Point":
|
|
6146
|
-
o = Math.min(o,
|
|
6146
|
+
o = Math.min(o, Pt([i.coordinates], !1, s, a, o));
|
|
6147
6147
|
break;
|
|
6148
6148
|
case "LineString":
|
|
6149
|
-
o = Math.min(o,
|
|
6149
|
+
o = Math.min(o, Pt(i.coordinates, !0, s, a, o));
|
|
6150
6150
|
break;
|
|
6151
6151
|
case "Polygon":
|
|
6152
6152
|
o = Math.min(o, Ws(s, i.coordinates, a, o));
|
|
@@ -6157,7 +6157,7 @@ function Js(r, e) {
|
|
|
6157
6157
|
}
|
|
6158
6158
|
return o;
|
|
6159
6159
|
}
|
|
6160
|
-
function
|
|
6160
|
+
function pr(r) {
|
|
6161
6161
|
return r.type === "MultiPolygon" ? r.coordinates.map((e) => ({
|
|
6162
6162
|
type: "Polygon",
|
|
6163
6163
|
coordinates: e
|
|
@@ -6176,14 +6176,14 @@ class $e {
|
|
|
6176
6176
|
static parse(e, t) {
|
|
6177
6177
|
if (e.length !== 2)
|
|
6178
6178
|
return t.error(`'distance' expression requires exactly one argument, but found ${e.length - 1} instead.`);
|
|
6179
|
-
if (
|
|
6179
|
+
if (ot(e[1])) {
|
|
6180
6180
|
const n = e[1];
|
|
6181
6181
|
if (n.type === "FeatureCollection")
|
|
6182
|
-
return new $e(n, n.features.map((a) =>
|
|
6182
|
+
return new $e(n, n.features.map((a) => pr(a.geometry)).flat());
|
|
6183
6183
|
if (n.type === "Feature")
|
|
6184
|
-
return new $e(n,
|
|
6184
|
+
return new $e(n, pr(n.geometry));
|
|
6185
6185
|
if ("type" in n && "coordinates" in n)
|
|
6186
|
-
return new $e(n,
|
|
6186
|
+
return new $e(n, pr(n));
|
|
6187
6187
|
}
|
|
6188
6188
|
return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.");
|
|
6189
6189
|
}
|
|
@@ -6204,7 +6204,7 @@ class $e {
|
|
|
6204
6204
|
return !0;
|
|
6205
6205
|
}
|
|
6206
6206
|
}
|
|
6207
|
-
class
|
|
6207
|
+
class ht {
|
|
6208
6208
|
constructor(e) {
|
|
6209
6209
|
this.type = T, this.key = e;
|
|
6210
6210
|
}
|
|
@@ -6212,12 +6212,12 @@ class dt {
|
|
|
6212
6212
|
if (e.length !== 2)
|
|
6213
6213
|
return t.error(`Expected 1 argument, but found ${e.length - 1} instead.`);
|
|
6214
6214
|
const n = e[1];
|
|
6215
|
-
return n == null ? t.error("Global state property must be defined.") : typeof n != "string" ? t.error(`Global state property must be string, but found ${typeof e[1]} instead.`) : new
|
|
6215
|
+
return n == null ? t.error("Global state property must be defined.") : typeof n != "string" ? t.error(`Global state property must be string, but found ${typeof e[1]} instead.`) : new ht(n);
|
|
6216
6216
|
}
|
|
6217
6217
|
evaluate(e) {
|
|
6218
6218
|
var t;
|
|
6219
6219
|
const n = (t = e.globals) === null || t === void 0 ? void 0 : t.globalState;
|
|
6220
|
-
return !n || Object.keys(n).length === 0 ? null :
|
|
6220
|
+
return !n || Object.keys(n).length === 0 ? null : et(n, this.key);
|
|
6221
6221
|
}
|
|
6222
6222
|
eachChild() {
|
|
6223
6223
|
}
|
|
@@ -6237,33 +6237,33 @@ const rn = {
|
|
|
6237
6237
|
at: qr,
|
|
6238
6238
|
boolean: se,
|
|
6239
6239
|
case: Hr,
|
|
6240
|
-
coalesce:
|
|
6241
|
-
collator:
|
|
6240
|
+
coalesce: it,
|
|
6241
|
+
collator: Wt,
|
|
6242
6242
|
format: Xr,
|
|
6243
6243
|
image: Wr,
|
|
6244
6244
|
in: Gr,
|
|
6245
|
-
"index-of":
|
|
6245
|
+
"index-of": _t,
|
|
6246
6246
|
interpolate: he,
|
|
6247
6247
|
"interpolate-hcl": he,
|
|
6248
6248
|
"interpolate-lab": he,
|
|
6249
6249
|
length: Zr,
|
|
6250
|
-
let:
|
|
6251
|
-
literal:
|
|
6250
|
+
let: Ht,
|
|
6251
|
+
literal: He,
|
|
6252
6252
|
match: Vr,
|
|
6253
6253
|
number: se,
|
|
6254
6254
|
"number-format": Kr,
|
|
6255
6255
|
object: se,
|
|
6256
|
-
slice:
|
|
6257
|
-
step:
|
|
6256
|
+
slice: It,
|
|
6257
|
+
step: Xt,
|
|
6258
6258
|
string: se,
|
|
6259
6259
|
"to-boolean": ke,
|
|
6260
6260
|
"to-color": ke,
|
|
6261
6261
|
"to-number": ke,
|
|
6262
6262
|
"to-string": ke,
|
|
6263
|
-
var:
|
|
6263
|
+
var: Kt,
|
|
6264
6264
|
within: Fe,
|
|
6265
6265
|
distance: $e,
|
|
6266
|
-
"global-state":
|
|
6266
|
+
"global-state": ht
|
|
6267
6267
|
};
|
|
6268
6268
|
class le {
|
|
6269
6269
|
constructor(e, t, n, a) {
|
|
@@ -6286,7 +6286,7 @@ class le {
|
|
|
6286
6286
|
u.length === e.length - 1);
|
|
6287
6287
|
let l = null;
|
|
6288
6288
|
for (const [u, c] of s) {
|
|
6289
|
-
l = new
|
|
6289
|
+
l = new Vt(t.registry, zt, t.path, null, t.scope);
|
|
6290
6290
|
const p = [];
|
|
6291
6291
|
let f = !1;
|
|
6292
6292
|
for (let d = 1; d < e.length; d++) {
|
|
@@ -6340,7 +6340,7 @@ function jn(r, [e, t, n, a]) {
|
|
|
6340
6340
|
function Nn(r, e) {
|
|
6341
6341
|
return r in e;
|
|
6342
6342
|
}
|
|
6343
|
-
function
|
|
6343
|
+
function fr(r, e) {
|
|
6344
6344
|
const t = e[r];
|
|
6345
6345
|
return typeof t > "u" ? null : t;
|
|
6346
6346
|
}
|
|
@@ -6353,19 +6353,19 @@ function Qs(r, e, t, n) {
|
|
|
6353
6353
|
}
|
|
6354
6354
|
return !1;
|
|
6355
6355
|
}
|
|
6356
|
-
function
|
|
6356
|
+
function Ie(r) {
|
|
6357
6357
|
return { type: r };
|
|
6358
6358
|
}
|
|
6359
6359
|
le.register(rn, {
|
|
6360
6360
|
error: [
|
|
6361
6361
|
Ki,
|
|
6362
|
-
[
|
|
6362
|
+
[I],
|
|
6363
6363
|
(r, [e]) => {
|
|
6364
6364
|
throw new N(e.evaluate(r));
|
|
6365
6365
|
}
|
|
6366
6366
|
],
|
|
6367
6367
|
typeof: [
|
|
6368
|
-
|
|
6368
|
+
I,
|
|
6369
6369
|
[T],
|
|
6370
6370
|
(r, [e]) => j(B(e.evaluate(r)))
|
|
6371
6371
|
],
|
|
@@ -6391,11 +6391,11 @@ le.register(rn, {
|
|
|
6391
6391
|
type: _,
|
|
6392
6392
|
overloads: [
|
|
6393
6393
|
[
|
|
6394
|
-
[
|
|
6394
|
+
[I],
|
|
6395
6395
|
(r, [e]) => Nn(e.evaluate(r), r.properties())
|
|
6396
6396
|
],
|
|
6397
6397
|
[
|
|
6398
|
-
[
|
|
6398
|
+
[I, Re],
|
|
6399
6399
|
(r, [e, t]) => Nn(e.evaluate(r), t.evaluate(r))
|
|
6400
6400
|
]
|
|
6401
6401
|
]
|
|
@@ -6404,19 +6404,19 @@ le.register(rn, {
|
|
|
6404
6404
|
type: T,
|
|
6405
6405
|
overloads: [
|
|
6406
6406
|
[
|
|
6407
|
-
[
|
|
6408
|
-
(r, [e]) =>
|
|
6407
|
+
[I],
|
|
6408
|
+
(r, [e]) => fr(e.evaluate(r), r.properties())
|
|
6409
6409
|
],
|
|
6410
6410
|
[
|
|
6411
|
-
[
|
|
6412
|
-
(r, [e, t]) =>
|
|
6411
|
+
[I, Re],
|
|
6412
|
+
(r, [e, t]) => fr(e.evaluate(r), t.evaluate(r))
|
|
6413
6413
|
]
|
|
6414
6414
|
]
|
|
6415
6415
|
},
|
|
6416
6416
|
"feature-state": [
|
|
6417
6417
|
T,
|
|
6418
|
-
[
|
|
6419
|
-
(r, [e]) =>
|
|
6418
|
+
[I],
|
|
6419
|
+
(r, [e]) => fr(e.evaluate(r), r.featureState || {})
|
|
6420
6420
|
],
|
|
6421
6421
|
properties: [
|
|
6422
6422
|
Re,
|
|
@@ -6424,7 +6424,7 @@ le.register(rn, {
|
|
|
6424
6424
|
(r) => r.properties()
|
|
6425
6425
|
],
|
|
6426
6426
|
"geometry-type": [
|
|
6427
|
-
|
|
6427
|
+
I,
|
|
6428
6428
|
[],
|
|
6429
6429
|
(r) => r.geometryType()
|
|
6430
6430
|
],
|
|
@@ -6460,7 +6460,7 @@ le.register(rn, {
|
|
|
6460
6460
|
],
|
|
6461
6461
|
"+": [
|
|
6462
6462
|
b,
|
|
6463
|
-
|
|
6463
|
+
Ie(b),
|
|
6464
6464
|
(r, e) => {
|
|
6465
6465
|
let t = 0;
|
|
6466
6466
|
for (const n of e)
|
|
@@ -6470,7 +6470,7 @@ le.register(rn, {
|
|
|
6470
6470
|
],
|
|
6471
6471
|
"*": [
|
|
6472
6472
|
b,
|
|
6473
|
-
|
|
6473
|
+
Ie(b),
|
|
6474
6474
|
(r, e) => {
|
|
6475
6475
|
let t = 1;
|
|
6476
6476
|
for (const n of e)
|
|
@@ -6573,12 +6573,12 @@ le.register(rn, {
|
|
|
6573
6573
|
],
|
|
6574
6574
|
min: [
|
|
6575
6575
|
b,
|
|
6576
|
-
|
|
6576
|
+
Ie(b),
|
|
6577
6577
|
(r, e) => Math.min(...e.map((t) => t.evaluate(r)))
|
|
6578
6578
|
],
|
|
6579
6579
|
max: [
|
|
6580
6580
|
b,
|
|
6581
|
-
|
|
6581
|
+
Ie(b),
|
|
6582
6582
|
(r, e) => Math.max(...e.map((t) => t.evaluate(r)))
|
|
6583
6583
|
],
|
|
6584
6584
|
abs: [
|
|
@@ -6606,7 +6606,7 @@ le.register(rn, {
|
|
|
6606
6606
|
],
|
|
6607
6607
|
"filter-==": [
|
|
6608
6608
|
_,
|
|
6609
|
-
[
|
|
6609
|
+
[I, T],
|
|
6610
6610
|
(r, [e, t]) => r.properties()[e.value] === t.value
|
|
6611
6611
|
],
|
|
6612
6612
|
"filter-id-==": [
|
|
@@ -6616,12 +6616,12 @@ le.register(rn, {
|
|
|
6616
6616
|
],
|
|
6617
6617
|
"filter-type-==": [
|
|
6618
6618
|
_,
|
|
6619
|
-
[
|
|
6619
|
+
[I],
|
|
6620
6620
|
(r, [e]) => r.geometryType() === e.value
|
|
6621
6621
|
],
|
|
6622
6622
|
"filter-<": [
|
|
6623
6623
|
_,
|
|
6624
|
-
[
|
|
6624
|
+
[I, T],
|
|
6625
6625
|
(r, [e, t]) => {
|
|
6626
6626
|
const n = r.properties()[e.value], a = t.value;
|
|
6627
6627
|
return typeof n == typeof a && n < a;
|
|
@@ -6637,7 +6637,7 @@ le.register(rn, {
|
|
|
6637
6637
|
],
|
|
6638
6638
|
"filter->": [
|
|
6639
6639
|
_,
|
|
6640
|
-
[
|
|
6640
|
+
[I, T],
|
|
6641
6641
|
(r, [e, t]) => {
|
|
6642
6642
|
const n = r.properties()[e.value], a = t.value;
|
|
6643
6643
|
return typeof n == typeof a && n > a;
|
|
@@ -6653,7 +6653,7 @@ le.register(rn, {
|
|
|
6653
6653
|
],
|
|
6654
6654
|
"filter-<=": [
|
|
6655
6655
|
_,
|
|
6656
|
-
[
|
|
6656
|
+
[I, T],
|
|
6657
6657
|
(r, [e, t]) => {
|
|
6658
6658
|
const n = r.properties()[e.value], a = t.value;
|
|
6659
6659
|
return typeof n == typeof a && n <= a;
|
|
@@ -6669,7 +6669,7 @@ le.register(rn, {
|
|
|
6669
6669
|
],
|
|
6670
6670
|
"filter->=": [
|
|
6671
6671
|
_,
|
|
6672
|
-
[
|
|
6672
|
+
[I, T],
|
|
6673
6673
|
(r, [e, t]) => {
|
|
6674
6674
|
const n = r.properties()[e.value], a = t.value;
|
|
6675
6675
|
return typeof n == typeof a && n >= a;
|
|
@@ -6695,7 +6695,7 @@ le.register(rn, {
|
|
|
6695
6695
|
],
|
|
6696
6696
|
"filter-type-in": [
|
|
6697
6697
|
_,
|
|
6698
|
-
[Z(
|
|
6698
|
+
[Z(I)],
|
|
6699
6699
|
(r, [e]) => e.value.indexOf(r.geometryType()) >= 0
|
|
6700
6700
|
],
|
|
6701
6701
|
"filter-id-in": [
|
|
@@ -6705,13 +6705,13 @@ le.register(rn, {
|
|
|
6705
6705
|
],
|
|
6706
6706
|
"filter-in-small": [
|
|
6707
6707
|
_,
|
|
6708
|
-
[
|
|
6708
|
+
[I, Z(T)],
|
|
6709
6709
|
// assumes v is an array literal
|
|
6710
6710
|
(r, [e, t]) => t.value.indexOf(r.properties()[e.value]) >= 0
|
|
6711
6711
|
],
|
|
6712
6712
|
"filter-in-large": [
|
|
6713
6713
|
_,
|
|
6714
|
-
[
|
|
6714
|
+
[I, Z(T)],
|
|
6715
6715
|
// assumes v is a array literal with values sorted in ascending order and of a single type
|
|
6716
6716
|
(r, [e, t]) => Qs(r.properties()[e.value], t.value, 0, t.value.length - 1)
|
|
6717
6717
|
],
|
|
@@ -6723,7 +6723,7 @@ le.register(rn, {
|
|
|
6723
6723
|
(r, [e, t]) => e.evaluate(r) && t.evaluate(r)
|
|
6724
6724
|
],
|
|
6725
6725
|
[
|
|
6726
|
-
|
|
6726
|
+
Ie(_),
|
|
6727
6727
|
(r, e) => {
|
|
6728
6728
|
for (const t of e)
|
|
6729
6729
|
if (!t.evaluate(r))
|
|
@@ -6741,7 +6741,7 @@ le.register(rn, {
|
|
|
6741
6741
|
(r, [e, t]) => e.evaluate(r) || t.evaluate(r)
|
|
6742
6742
|
],
|
|
6743
6743
|
[
|
|
6744
|
-
|
|
6744
|
+
Ie(_),
|
|
6745
6745
|
(r, e) => {
|
|
6746
6746
|
for (const t of e)
|
|
6747
6747
|
if (t.evaluate(r))
|
|
@@ -6758,7 +6758,7 @@ le.register(rn, {
|
|
|
6758
6758
|
],
|
|
6759
6759
|
"is-supported-script": [
|
|
6760
6760
|
_,
|
|
6761
|
-
[
|
|
6761
|
+
[I],
|
|
6762
6762
|
// At parse time this will always return true, so we need to exclude this expression with isGlobalPropertyConstant
|
|
6763
6763
|
(r, [e]) => {
|
|
6764
6764
|
const t = r.globals && r.globals.isSupportedScript;
|
|
@@ -6766,49 +6766,49 @@ le.register(rn, {
|
|
|
6766
6766
|
}
|
|
6767
6767
|
],
|
|
6768
6768
|
upcase: [
|
|
6769
|
-
|
|
6770
|
-
[
|
|
6769
|
+
I,
|
|
6770
|
+
[I],
|
|
6771
6771
|
(r, [e]) => e.evaluate(r).toUpperCase()
|
|
6772
6772
|
],
|
|
6773
6773
|
downcase: [
|
|
6774
|
-
|
|
6775
|
-
[
|
|
6774
|
+
I,
|
|
6775
|
+
[I],
|
|
6776
6776
|
(r, [e]) => e.evaluate(r).toLowerCase()
|
|
6777
6777
|
],
|
|
6778
6778
|
concat: [
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
(r, e) => e.map((t) =>
|
|
6779
|
+
I,
|
|
6780
|
+
Ie(T),
|
|
6781
|
+
(r, e) => e.map((t) => tt(t.evaluate(r))).join("")
|
|
6782
6782
|
],
|
|
6783
6783
|
"resolved-locale": [
|
|
6784
|
-
|
|
6785
|
-
[
|
|
6784
|
+
I,
|
|
6785
|
+
[Dt],
|
|
6786
6786
|
(r, [e]) => e.evaluate(r).resolvedLocale()
|
|
6787
6787
|
]
|
|
6788
6788
|
});
|
|
6789
6789
|
function el(r) {
|
|
6790
6790
|
return Array.isArray(r) ? `(${r.map(j).join(", ")})` : `(${j(r.type)}...)`;
|
|
6791
6791
|
}
|
|
6792
|
-
function
|
|
6793
|
-
if (r instanceof
|
|
6794
|
-
return
|
|
6792
|
+
function zt(r) {
|
|
6793
|
+
if (r instanceof Kt)
|
|
6794
|
+
return zt(r.boundExpression);
|
|
6795
6795
|
if (r instanceof le && r.name === "error")
|
|
6796
6796
|
return !1;
|
|
6797
|
-
if (r instanceof
|
|
6797
|
+
if (r instanceof Wt)
|
|
6798
6798
|
return !1;
|
|
6799
6799
|
if (r instanceof Fe)
|
|
6800
6800
|
return !1;
|
|
6801
6801
|
if (r instanceof $e)
|
|
6802
6802
|
return !1;
|
|
6803
|
-
if (r instanceof
|
|
6803
|
+
if (r instanceof ht)
|
|
6804
6804
|
return !1;
|
|
6805
6805
|
const e = r instanceof ke || r instanceof se;
|
|
6806
6806
|
let t = !0;
|
|
6807
6807
|
return r.eachChild((n) => {
|
|
6808
|
-
e ? t = t &&
|
|
6809
|
-
}), t ?
|
|
6808
|
+
e ? t = t && zt(n) : t = t && n instanceof He;
|
|
6809
|
+
}), t ? Yt(r) && Jt(r, ["zoom", "heatmap-density", "elevation", "line-progress", "accumulated", "is-supported-script"]) : !1;
|
|
6810
6810
|
}
|
|
6811
|
-
function
|
|
6811
|
+
function Yt(r) {
|
|
6812
6812
|
if (r instanceof le) {
|
|
6813
6813
|
if (r.name === "get" && r.args.length === 1)
|
|
6814
6814
|
return !1;
|
|
@@ -6825,32 +6825,32 @@ function Wt(r) {
|
|
|
6825
6825
|
return !1;
|
|
6826
6826
|
let e = !0;
|
|
6827
6827
|
return r.eachChild((t) => {
|
|
6828
|
-
e && !
|
|
6828
|
+
e && !Yt(t) && (e = !1);
|
|
6829
6829
|
}), e;
|
|
6830
6830
|
}
|
|
6831
|
-
function
|
|
6831
|
+
function lt(r) {
|
|
6832
6832
|
if (r instanceof le && r.name === "feature-state")
|
|
6833
6833
|
return !1;
|
|
6834
6834
|
let e = !0;
|
|
6835
6835
|
return r.eachChild((t) => {
|
|
6836
|
-
e && !
|
|
6836
|
+
e && !lt(t) && (e = !1);
|
|
6837
6837
|
}), e;
|
|
6838
6838
|
}
|
|
6839
|
-
function
|
|
6839
|
+
function Jt(r, e) {
|
|
6840
6840
|
if (r instanceof le && e.indexOf(r.name) >= 0)
|
|
6841
6841
|
return !1;
|
|
6842
6842
|
let t = !0;
|
|
6843
6843
|
return r.eachChild((n) => {
|
|
6844
|
-
t && !
|
|
6844
|
+
t && !Jt(n, e) && (t = !1);
|
|
6845
6845
|
}), t;
|
|
6846
6846
|
}
|
|
6847
|
-
function
|
|
6847
|
+
function Mr(r) {
|
|
6848
6848
|
return { result: "success", value: r };
|
|
6849
6849
|
}
|
|
6850
6850
|
function Be(r) {
|
|
6851
6851
|
return { result: "error", value: r };
|
|
6852
6852
|
}
|
|
6853
|
-
function
|
|
6853
|
+
function Ft(r) {
|
|
6854
6854
|
return r["property-type"] === "data-driven" || r["property-type"] === "cross-faded-data-driven";
|
|
6855
6855
|
}
|
|
6856
6856
|
function Pa(r) {
|
|
@@ -6859,7 +6859,7 @@ function Pa(r) {
|
|
|
6859
6859
|
function Ra(r) {
|
|
6860
6860
|
return !!r.expression && r.expression.interpolated;
|
|
6861
6861
|
}
|
|
6862
|
-
function
|
|
6862
|
+
function M(r) {
|
|
6863
6863
|
return r instanceof Number ? "number" : r instanceof String ? "string" : r instanceof Boolean ? "boolean" : Array.isArray(r) ? "array" : r === null ? "null" : typeof r;
|
|
6864
6864
|
}
|
|
6865
6865
|
function nn(r) {
|
|
@@ -6890,12 +6890,12 @@ function za(r) {
|
|
|
6890
6890
|
return Array.isArray(r) && r.length > 0 && typeof r[0] == "string" && r[0] in rn;
|
|
6891
6891
|
}
|
|
6892
6892
|
function Fa(r, e) {
|
|
6893
|
-
const t = new
|
|
6894
|
-
return n ?
|
|
6893
|
+
const t = new Vt(rn, zt, [], e ? nl(e) : void 0), n = t.parse(r, void 0, void 0, void 0, e && e.type === "string" ? { typeAnnotation: "coerce" } : void 0);
|
|
6894
|
+
return n ? Mr(new tl(n, e)) : Be(t.errors);
|
|
6895
6895
|
}
|
|
6896
6896
|
class Dn {
|
|
6897
6897
|
constructor(e, t) {
|
|
6898
|
-
this.kind = e, this._styleExpression = t, this.isStateDependent = e !== "constant" && !
|
|
6898
|
+
this.kind = e, this._styleExpression = t, this.isStateDependent = e !== "constant" && !lt(t.expression), this.globalStateRefs = an(t.expression);
|
|
6899
6899
|
}
|
|
6900
6900
|
evaluateWithoutErrorHandling(e, t, n, a, o, i) {
|
|
6901
6901
|
return this._styleExpression.evaluateWithoutErrorHandling(e, t, n, a, o, i);
|
|
@@ -6906,7 +6906,7 @@ class Dn {
|
|
|
6906
6906
|
}
|
|
6907
6907
|
class Un {
|
|
6908
6908
|
constructor(e, t, n, a) {
|
|
6909
|
-
this.kind = e, this.zoomStops = n, this._styleExpression = t, this.isStateDependent = e !== "camera" && !
|
|
6909
|
+
this.kind = e, this.zoomStops = n, this._styleExpression = t, this.isStateDependent = e !== "camera" && !lt(t.expression), this.globalStateRefs = an(t.expression), this.interpolationType = a;
|
|
6910
6910
|
}
|
|
6911
6911
|
evaluateWithoutErrorHandling(e, t, n, a, o, i) {
|
|
6912
6912
|
return this._styleExpression.evaluateWithoutErrorHandling(e, t, n, a, o, i);
|
|
@@ -6922,13 +6922,13 @@ function rl(r, e) {
|
|
|
6922
6922
|
const t = Fa(r, e);
|
|
6923
6923
|
if (t.result === "error")
|
|
6924
6924
|
return t;
|
|
6925
|
-
const n = t.value.expression, a =
|
|
6926
|
-
if (!a && !
|
|
6925
|
+
const n = t.value.expression, a = Yt(n);
|
|
6926
|
+
if (!a && !Ft(e))
|
|
6927
6927
|
return Be([new fe("", "data expressions not supported")]);
|
|
6928
|
-
const o =
|
|
6928
|
+
const o = Jt(n, ["zoom"]);
|
|
6929
6929
|
if (!o && !Pa(e))
|
|
6930
6930
|
return Be([new fe("", "zoom expressions not supported")]);
|
|
6931
|
-
const i =
|
|
6931
|
+
const i = Ct(n);
|
|
6932
6932
|
if (!i && !o)
|
|
6933
6933
|
return Be([new fe("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);
|
|
6934
6934
|
if (i instanceof fe)
|
|
@@ -6936,43 +6936,43 @@ function rl(r, e) {
|
|
|
6936
6936
|
if (i instanceof he && !Ra(e))
|
|
6937
6937
|
return Be([new fe("", '"interpolate" expressions cannot be used with this property')]);
|
|
6938
6938
|
if (!i)
|
|
6939
|
-
return
|
|
6939
|
+
return Mr(a ? new Dn("constant", t.value) : new Dn("source", t.value));
|
|
6940
6940
|
const s = i instanceof he ? i.interpolation : void 0;
|
|
6941
|
-
return
|
|
6941
|
+
return Mr(a ? new Un("camera", t.value, i.labels, s) : new Un("composite", t.value, i.labels, s));
|
|
6942
6942
|
}
|
|
6943
|
-
function
|
|
6943
|
+
function Ct(r) {
|
|
6944
6944
|
let e = null;
|
|
6945
|
-
if (r instanceof
|
|
6946
|
-
e =
|
|
6947
|
-
else if (r instanceof
|
|
6945
|
+
if (r instanceof Ht)
|
|
6946
|
+
e = Ct(r.result);
|
|
6947
|
+
else if (r instanceof it) {
|
|
6948
6948
|
for (const t of r.args)
|
|
6949
|
-
if (e =
|
|
6949
|
+
if (e = Ct(t), e)
|
|
6950
6950
|
break;
|
|
6951
|
-
} else (r instanceof
|
|
6951
|
+
} else (r instanceof Xt || r instanceof he) && r.input instanceof le && r.input.name === "zoom" && (e = r);
|
|
6952
6952
|
return e instanceof fe || r.eachChild((t) => {
|
|
6953
|
-
const n =
|
|
6953
|
+
const n = Ct(t);
|
|
6954
6954
|
n instanceof fe ? e = n : !e && n ? e = new fe("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : e && n && e !== n && (e = new fe("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));
|
|
6955
6955
|
}), e;
|
|
6956
6956
|
}
|
|
6957
6957
|
function an(r, e = /* @__PURE__ */ new Set()) {
|
|
6958
|
-
return r instanceof
|
|
6958
|
+
return r instanceof ht && e.add(r.key), r.eachChild((t) => {
|
|
6959
6959
|
an(t, e);
|
|
6960
6960
|
}), e;
|
|
6961
6961
|
}
|
|
6962
6962
|
function nl(r) {
|
|
6963
6963
|
const e = {
|
|
6964
6964
|
color: de,
|
|
6965
|
-
string:
|
|
6965
|
+
string: I,
|
|
6966
6966
|
number: b,
|
|
6967
|
-
enum:
|
|
6967
|
+
enum: I,
|
|
6968
6968
|
boolean: _,
|
|
6969
|
-
formatted:
|
|
6970
|
-
padding:
|
|
6971
|
-
numberArray:
|
|
6972
|
-
colorArray:
|
|
6973
|
-
projectionDefinition:
|
|
6974
|
-
resolvedImage:
|
|
6975
|
-
variableAnchorOffsetCollection:
|
|
6969
|
+
formatted: Ut,
|
|
6970
|
+
padding: Bt,
|
|
6971
|
+
numberArray: qt,
|
|
6972
|
+
colorArray: nt,
|
|
6973
|
+
projectionDefinition: Nt,
|
|
6974
|
+
resolvedImage: ft,
|
|
6975
|
+
variableAnchorOffsetCollection: Gt
|
|
6976
6976
|
};
|
|
6977
6977
|
return r.type === "array" ? Z(e[r.value] || T, r.length) : e[r.type];
|
|
6978
6978
|
}
|
|
@@ -7048,15 +7048,15 @@ function je(r) {
|
|
|
7048
7048
|
function te(r) {
|
|
7049
7049
|
const e = r.key, t = r.value, n = r.valueSpec || {}, a = r.objectElementValidators || {}, o = r.style, i = r.styleSpec, s = r.validateSpec;
|
|
7050
7050
|
let l = [];
|
|
7051
|
-
const u =
|
|
7051
|
+
const u = M(t);
|
|
7052
7052
|
if (u !== "object")
|
|
7053
7053
|
return [new g(e, t, `object expected, ${u} found`)];
|
|
7054
7054
|
for (const c in t) {
|
|
7055
|
-
const p = c.split(".")[0], f =
|
|
7055
|
+
const p = c.split(".")[0], f = et(n, p) || n["*"];
|
|
7056
7056
|
let d;
|
|
7057
|
-
if (
|
|
7057
|
+
if (et(a, p))
|
|
7058
7058
|
d = a[p];
|
|
7059
|
-
else if (
|
|
7059
|
+
else if (et(n, p))
|
|
7060
7060
|
d = s;
|
|
7061
7061
|
else if (a["*"])
|
|
7062
7062
|
d = a["*"];
|
|
@@ -7083,8 +7083,8 @@ function te(r) {
|
|
|
7083
7083
|
}
|
|
7084
7084
|
function on(r) {
|
|
7085
7085
|
const e = r.value, t = r.valueSpec, n = r.validateSpec, a = r.style, o = r.styleSpec, i = r.key, s = r.arrayElementValidator || n;
|
|
7086
|
-
if (
|
|
7087
|
-
return [new g(i, e, `array expected, ${
|
|
7086
|
+
if (M(e) !== "array")
|
|
7087
|
+
return [new g(i, e, `array expected, ${M(e)} found`)];
|
|
7088
7088
|
if (t.length && e.length !== t.length)
|
|
7089
7089
|
return [new g(i, e, `array length ${t.length} expected, length ${e.length} found`)];
|
|
7090
7090
|
if (t["min-length"] && e.length < t["min-length"])
|
|
@@ -7093,7 +7093,7 @@ function on(r) {
|
|
|
7093
7093
|
type: t.value,
|
|
7094
7094
|
values: t.values
|
|
7095
7095
|
};
|
|
7096
|
-
o.$version < 7 && (l.function = t.function),
|
|
7096
|
+
o.$version < 7 && (l.function = t.function), M(t.value) === "object" && (l = t.value);
|
|
7097
7097
|
let u = [];
|
|
7098
7098
|
for (let c = 0; c < e.length; c++)
|
|
7099
7099
|
u = u.concat(s({
|
|
@@ -7108,15 +7108,15 @@ function on(r) {
|
|
|
7108
7108
|
}));
|
|
7109
7109
|
return u;
|
|
7110
7110
|
}
|
|
7111
|
-
function
|
|
7111
|
+
function Qt(r) {
|
|
7112
7112
|
const e = r.key, t = r.value, n = r.valueSpec;
|
|
7113
|
-
let a =
|
|
7113
|
+
let a = M(t);
|
|
7114
7114
|
return a === "number" && t !== t && (a = "NaN"), a !== "number" ? [new g(e, t, `number expected, ${a} found`)] : "minimum" in n && t < n.minimum ? [new g(e, t, `${t} is less than the minimum value ${n.minimum}`)] : "maximum" in n && t > n.maximum ? [new g(e, t, `${t} is greater than the maximum value ${n.maximum}`)] : [];
|
|
7115
7115
|
}
|
|
7116
7116
|
function ja(r) {
|
|
7117
7117
|
const e = r.valueSpec, t = U(r.value.type);
|
|
7118
7118
|
let n, a = {}, o, i;
|
|
7119
|
-
const s = t !== "categorical" && r.value.property === void 0, l = !s, u =
|
|
7119
|
+
const s = t !== "categorical" && r.value.property === void 0, l = !s, u = M(r.value.stops) === "array" && M(r.value.stops[0]) === "array" && M(r.value.stops[0][0]) === "object", c = te({
|
|
7120
7120
|
key: r.key,
|
|
7121
7121
|
value: r.value,
|
|
7122
7122
|
valueSpec: r.styleSpec.function,
|
|
@@ -7128,7 +7128,7 @@ function ja(r) {
|
|
|
7128
7128
|
default: h
|
|
7129
7129
|
}
|
|
7130
7130
|
});
|
|
7131
|
-
return t === "identity" && s && c.push(new g(r.key, r.value, 'missing required property "property"')), t !== "identity" && !r.value.stops && c.push(new g(r.key, r.value, 'missing required property "stops"')), t === "exponential" && r.valueSpec.expression && !Ra(r.valueSpec) && c.push(new g(r.key, r.value, "exponential functions not supported")), r.styleSpec.$version >= 8 && (l && !
|
|
7131
|
+
return t === "identity" && s && c.push(new g(r.key, r.value, 'missing required property "property"')), t !== "identity" && !r.value.stops && c.push(new g(r.key, r.value, 'missing required property "stops"')), t === "exponential" && r.valueSpec.expression && !Ra(r.valueSpec) && c.push(new g(r.key, r.value, "exponential functions not supported")), r.styleSpec.$version >= 8 && (l && !Ft(r.valueSpec) ? c.push(new g(r.key, r.value, "property functions not supported")) : s && !Pa(r.valueSpec) && c.push(new g(r.key, r.value, "zoom functions not supported"))), (t === "categorical" || u) && r.value.property === void 0 && c.push(new g(r.key, r.value, '"property" property is required')), c;
|
|
7132
7132
|
function p(y) {
|
|
7133
7133
|
if (t === "identity")
|
|
7134
7134
|
return [new g(y.key, y.value, 'identity function may not have a "stops" property')];
|
|
@@ -7142,18 +7142,18 @@ function ja(r) {
|
|
|
7142
7142
|
style: y.style,
|
|
7143
7143
|
styleSpec: y.styleSpec,
|
|
7144
7144
|
arrayElementValidator: f
|
|
7145
|
-
})),
|
|
7145
|
+
})), M(w) === "array" && w.length === 0 && m.push(new g(y.key, w, "array must have at least one stop")), m;
|
|
7146
7146
|
}
|
|
7147
7147
|
function f(y) {
|
|
7148
7148
|
let m = [];
|
|
7149
7149
|
const w = y.value, v = y.key;
|
|
7150
|
-
if (
|
|
7151
|
-
return [new g(v, w, `array expected, ${
|
|
7150
|
+
if (M(w) !== "array")
|
|
7151
|
+
return [new g(v, w, `array expected, ${M(w)} found`)];
|
|
7152
7152
|
if (w.length !== 2)
|
|
7153
7153
|
return [new g(v, w, `array length 2 expected, length ${w.length} found`)];
|
|
7154
7154
|
if (u) {
|
|
7155
|
-
if (
|
|
7156
|
-
return [new g(v, w, `object expected, ${
|
|
7155
|
+
if (M(w[0]) !== "object")
|
|
7156
|
+
return [new g(v, w, `object expected, ${M(w[0])} found`)];
|
|
7157
7157
|
if (w[0].zoom === void 0)
|
|
7158
7158
|
return [new g(v, w, "object stop key must have zoom")];
|
|
7159
7159
|
if (w[0].value === void 0)
|
|
@@ -7167,7 +7167,7 @@ function ja(r) {
|
|
|
7167
7167
|
validateSpec: y.validateSpec,
|
|
7168
7168
|
style: y.style,
|
|
7169
7169
|
styleSpec: y.styleSpec,
|
|
7170
|
-
objectElementValidators: { zoom:
|
|
7170
|
+
objectElementValidators: { zoom: Qt, value: d }
|
|
7171
7171
|
}));
|
|
7172
7172
|
} else
|
|
7173
7173
|
m = m.concat(d({
|
|
@@ -7187,7 +7187,7 @@ function ja(r) {
|
|
|
7187
7187
|
}));
|
|
7188
7188
|
}
|
|
7189
7189
|
function d(y, m) {
|
|
7190
|
-
const w =
|
|
7190
|
+
const w = M(y.value), v = U(y.value), x = y.value !== null ? y.value : m;
|
|
7191
7191
|
if (!n)
|
|
7192
7192
|
n = w;
|
|
7193
7193
|
else if (w !== n)
|
|
@@ -7196,7 +7196,7 @@ function ja(r) {
|
|
|
7196
7196
|
return [new g(y.key, x, "stop domain value must be a number, string, or boolean")];
|
|
7197
7197
|
if (w !== "number" && t !== "categorical") {
|
|
7198
7198
|
let A = `number expected, ${w} found`;
|
|
7199
|
-
return
|
|
7199
|
+
return Ft(e) && t === void 0 && (A += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), [new g(y.key, x, A)];
|
|
7200
7200
|
}
|
|
7201
7201
|
return t === "categorical" && w === "number" && (!isFinite(v) || Math.floor(v) !== v) ? [new g(y.key, x, `integer expected, found ${v}`)] : t !== "categorical" && w === "number" && o !== void 0 && v < o ? [new g(y.key, x, "stop domain values must appear in ascending order")] : (o = v, t === "categorical" && v in a ? [new g(y.key, x, "stop domain values must be unique")] : (a[v] = !0, []));
|
|
7202
7202
|
}
|
|
@@ -7211,52 +7211,52 @@ function ja(r) {
|
|
|
7211
7211
|
});
|
|
7212
7212
|
}
|
|
7213
7213
|
}
|
|
7214
|
-
function
|
|
7214
|
+
function Ke(r) {
|
|
7215
7215
|
const e = (r.expressionContext === "property" ? rl : Fa)(je(r.value), r.valueSpec);
|
|
7216
7216
|
if (e.result === "error")
|
|
7217
7217
|
return e.value.map((n) => new g(`${r.key}${n.key}`, r.value, n.message));
|
|
7218
7218
|
const t = e.value.expression || e.value._styleExpression.expression;
|
|
7219
7219
|
if (r.expressionContext === "property" && r.propertyKey === "text-font" && !t.outputDefined())
|
|
7220
7220
|
return [new g(r.key, r.value, `Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];
|
|
7221
|
-
if (r.expressionContext === "property" && r.propertyType === "layout" && !
|
|
7221
|
+
if (r.expressionContext === "property" && r.propertyType === "layout" && !lt(t))
|
|
7222
7222
|
return [new g(r.key, r.value, '"feature-state" data expressions are not supported with layout properties.')];
|
|
7223
|
-
if (r.expressionContext === "filter" && !
|
|
7223
|
+
if (r.expressionContext === "filter" && !lt(t))
|
|
7224
7224
|
return [new g(r.key, r.value, '"feature-state" data expressions are not supported with filters.')];
|
|
7225
7225
|
if (r.expressionContext && r.expressionContext.indexOf("cluster") === 0) {
|
|
7226
|
-
if (!
|
|
7226
|
+
if (!Jt(t, ["zoom", "feature-state"]))
|
|
7227
7227
|
return [new g(r.key, r.value, '"zoom" and "feature-state" expressions are not supported with cluster properties.')];
|
|
7228
|
-
if (r.expressionContext === "cluster-initial" && !
|
|
7228
|
+
if (r.expressionContext === "cluster-initial" && !Yt(t))
|
|
7229
7229
|
return [new g(r.key, r.value, "Feature data expressions are not supported with initial expression part of cluster properties.")];
|
|
7230
7230
|
}
|
|
7231
7231
|
return [];
|
|
7232
7232
|
}
|
|
7233
7233
|
function ol(r) {
|
|
7234
|
-
const e = r.value, t = r.key, n =
|
|
7234
|
+
const e = r.value, t = r.key, n = M(e);
|
|
7235
7235
|
return n !== "boolean" ? [new g(t, e, `boolean expected, ${n} found`)] : [];
|
|
7236
7236
|
}
|
|
7237
|
-
function
|
|
7238
|
-
const e = r.key, t = r.value, n =
|
|
7237
|
+
function Pr(r) {
|
|
7238
|
+
const e = r.key, t = r.value, n = M(t);
|
|
7239
7239
|
return n !== "string" ? [new g(e, t, `color expected, ${n} found`)] : F.parse(String(t)) ? [] : [new g(e, t, `color expected, "${t}" found`)];
|
|
7240
7240
|
}
|
|
7241
|
-
function
|
|
7241
|
+
function ut(r) {
|
|
7242
7242
|
const e = r.key, t = r.value, n = r.valueSpec, a = [];
|
|
7243
7243
|
return Array.isArray(n.values) ? n.values.indexOf(U(t)) === -1 && a.push(new g(e, t, `expected one of [${n.values.join(", ")}], ${JSON.stringify(t)} found`)) : Object.keys(n.values).indexOf(U(t)) === -1 && a.push(new g(e, t, `expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(t)} found`)), a;
|
|
7244
7244
|
}
|
|
7245
7245
|
function sn(r) {
|
|
7246
|
-
return $a(je(r.value)) ?
|
|
7246
|
+
return $a(je(r.value)) ? Ke(Tt({}, r, {
|
|
7247
7247
|
expressionContext: "filter",
|
|
7248
7248
|
valueSpec: { value: "boolean" }
|
|
7249
7249
|
})) : Na(r);
|
|
7250
7250
|
}
|
|
7251
7251
|
function Na(r) {
|
|
7252
7252
|
const e = r.value, t = r.key;
|
|
7253
|
-
if (
|
|
7254
|
-
return [new g(t, e, `array expected, ${
|
|
7253
|
+
if (M(e) !== "array")
|
|
7254
|
+
return [new g(t, e, `array expected, ${M(e)} found`)];
|
|
7255
7255
|
const n = r.styleSpec;
|
|
7256
7256
|
let a, o = [];
|
|
7257
7257
|
if (e.length < 1)
|
|
7258
7258
|
return [new g(t, e, "filter array must have at least 1 element")];
|
|
7259
|
-
switch (o = o.concat(
|
|
7259
|
+
switch (o = o.concat(ut({
|
|
7260
7260
|
key: `${t}[0]`,
|
|
7261
7261
|
value: e[0],
|
|
7262
7262
|
valueSpec: n.filter_operator,
|
|
@@ -7275,9 +7275,9 @@ function Na(r) {
|
|
|
7275
7275
|
/* falls through */
|
|
7276
7276
|
case "in":
|
|
7277
7277
|
case "!in":
|
|
7278
|
-
e.length >= 2 && (a =
|
|
7278
|
+
e.length >= 2 && (a = M(e[1]), a !== "string" && o.push(new g(`${t}[1]`, e[1], `string expected, ${a} found`)));
|
|
7279
7279
|
for (let i = 2; i < e.length; i++)
|
|
7280
|
-
a =
|
|
7280
|
+
a = M(e[i]), U(e[1]) === "$type" ? o = o.concat(ut({
|
|
7281
7281
|
key: `${t}[${i}]`,
|
|
7282
7282
|
value: e[i],
|
|
7283
7283
|
valueSpec: n.geometry_type,
|
|
@@ -7298,7 +7298,7 @@ function Na(r) {
|
|
|
7298
7298
|
break;
|
|
7299
7299
|
case "has":
|
|
7300
7300
|
case "!has":
|
|
7301
|
-
a =
|
|
7301
|
+
a = M(e[1]), e.length !== 2 ? o.push(new g(t, e, `filter array for "${e[0]}" operator must have 2 elements`)) : a !== "string" && o.push(new g(`${t}[1]`, e[1], `string expected, ${a} found`));
|
|
7302
7302
|
break;
|
|
7303
7303
|
}
|
|
7304
7304
|
return o;
|
|
@@ -7320,7 +7320,7 @@ function Da(r, e) {
|
|
|
7320
7320
|
if (!c)
|
|
7321
7321
|
return [new g(t, i, `unknown property "${s}"`)];
|
|
7322
7322
|
let p;
|
|
7323
|
-
if (
|
|
7323
|
+
if (M(i) === "string" && Ft(c) && !c.tokens && (p = /^{([^}]+)}$/.exec(i)))
|
|
7324
7324
|
return [new g(t, i, `"${s}" does not support interpolation syntax
|
|
7325
7325
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(p[1])} }\`.`)];
|
|
7326
7326
|
const f = [];
|
|
@@ -7344,8 +7344,8 @@ function Ba(r) {
|
|
|
7344
7344
|
function qa(r) {
|
|
7345
7345
|
let e = [];
|
|
7346
7346
|
const t = r.value, n = r.key, a = r.style, o = r.styleSpec;
|
|
7347
|
-
if (
|
|
7348
|
-
return [new g(n, t, `object expected, ${
|
|
7347
|
+
if (M(t) !== "object")
|
|
7348
|
+
return [new g(n, t, `object expected, ${M(t)} found`)];
|
|
7349
7349
|
!t.type && !t.ref && e.push(new g(n, t, 'either "type" or "ref" is required'));
|
|
7350
7350
|
let i = U(t.type);
|
|
7351
7351
|
const s = U(t.ref);
|
|
@@ -7407,7 +7407,7 @@ function qa(r) {
|
|
|
7407
7407
|
validateSpec: l.validateSpec,
|
|
7408
7408
|
objectElementValidators: {
|
|
7409
7409
|
"*"(u) {
|
|
7410
|
-
return Ba(
|
|
7410
|
+
return Ba(Tt({ layerType: i }, u));
|
|
7411
7411
|
}
|
|
7412
7412
|
}
|
|
7413
7413
|
});
|
|
@@ -7422,7 +7422,7 @@ function qa(r) {
|
|
|
7422
7422
|
validateSpec: l.validateSpec,
|
|
7423
7423
|
objectElementValidators: {
|
|
7424
7424
|
"*"(u) {
|
|
7425
|
-
return Ua(
|
|
7425
|
+
return Ua(Tt({ layerType: i }, u));
|
|
7426
7426
|
}
|
|
7427
7427
|
}
|
|
7428
7428
|
});
|
|
@@ -7431,14 +7431,14 @@ function qa(r) {
|
|
|
7431
7431
|
})), e;
|
|
7432
7432
|
}
|
|
7433
7433
|
function Ne(r) {
|
|
7434
|
-
const e = r.value, t = r.key, n =
|
|
7434
|
+
const e = r.value, t = r.key, n = M(e);
|
|
7435
7435
|
return n !== "string" ? [new g(t, e, `string expected, ${n} found`)] : [];
|
|
7436
7436
|
}
|
|
7437
7437
|
function il(r) {
|
|
7438
7438
|
var e;
|
|
7439
7439
|
const t = (e = r.sourceName) !== null && e !== void 0 ? e : "", n = r.value, a = r.styleSpec, o = a.source_raster_dem, i = r.style;
|
|
7440
7440
|
let s = [];
|
|
7441
|
-
const l =
|
|
7441
|
+
const l = M(n);
|
|
7442
7442
|
if (n === void 0)
|
|
7443
7443
|
return s;
|
|
7444
7444
|
if (l !== "object")
|
|
@@ -7496,11 +7496,11 @@ function Ga(r) {
|
|
|
7496
7496
|
}), e.cluster)
|
|
7497
7497
|
for (const l in e.clusterProperties) {
|
|
7498
7498
|
const [u, c] = e.clusterProperties[l], p = typeof u == "string" ? [u, ["accumulated"], ["get", l]] : u;
|
|
7499
|
-
s.push(...
|
|
7499
|
+
s.push(...Ke({
|
|
7500
7500
|
key: `${t}.${l}.map`,
|
|
7501
7501
|
value: c,
|
|
7502
7502
|
expressionContext: "cluster-map"
|
|
7503
|
-
})), s.push(...
|
|
7503
|
+
})), s.push(...Ke({
|
|
7504
7504
|
key: `${t}.${l}.reduce`,
|
|
7505
7505
|
value: p,
|
|
7506
7506
|
expressionContext: "cluster-reduce"
|
|
@@ -7528,7 +7528,7 @@ function Ga(r) {
|
|
|
7528
7528
|
case "canvas":
|
|
7529
7529
|
return [new g(t, null, "Please use runtime APIs to add canvas sources, rather than including them in stylesheets.", "source.canvas")];
|
|
7530
7530
|
default:
|
|
7531
|
-
return
|
|
7531
|
+
return ut({
|
|
7532
7532
|
key: `${t}.type`,
|
|
7533
7533
|
value: e.type,
|
|
7534
7534
|
valueSpec: { values: ["vector", "raster", "raster-dem", "geojson", "video", "image"] }
|
|
@@ -7536,7 +7536,7 @@ function Ga(r) {
|
|
|
7536
7536
|
}
|
|
7537
7537
|
}
|
|
7538
7538
|
function sl({ key: r, value: e }) {
|
|
7539
|
-
if (
|
|
7539
|
+
if (M(e) === "string")
|
|
7540
7540
|
return Ne({ key: r, value: e });
|
|
7541
7541
|
{
|
|
7542
7542
|
const t = [];
|
|
@@ -7548,7 +7548,7 @@ function sl({ key: r, value: e }) {
|
|
|
7548
7548
|
function Va(r) {
|
|
7549
7549
|
const e = r.value, t = r.styleSpec, n = t.light, a = r.style;
|
|
7550
7550
|
let o = [];
|
|
7551
|
-
const i =
|
|
7551
|
+
const i = M(e);
|
|
7552
7552
|
if (e === void 0)
|
|
7553
7553
|
return o;
|
|
7554
7554
|
if (i !== "object")
|
|
@@ -7574,7 +7574,7 @@ function Va(r) {
|
|
|
7574
7574
|
return o;
|
|
7575
7575
|
}
|
|
7576
7576
|
function Ha(r) {
|
|
7577
|
-
const e = r.value, t = r.styleSpec, n = t.sky, a = r.style, o =
|
|
7577
|
+
const e = r.value, t = r.styleSpec, n = t.sky, a = r.style, o = M(e);
|
|
7578
7578
|
if (e === void 0)
|
|
7579
7579
|
return [];
|
|
7580
7580
|
if (o !== "object")
|
|
@@ -7593,7 +7593,7 @@ function Ha(r) {
|
|
|
7593
7593
|
function Ka(r) {
|
|
7594
7594
|
const e = r.value, t = r.styleSpec, n = t.terrain, a = r.style;
|
|
7595
7595
|
let o = [];
|
|
7596
|
-
const i =
|
|
7596
|
+
const i = M(e);
|
|
7597
7597
|
if (e === void 0)
|
|
7598
7598
|
return o;
|
|
7599
7599
|
if (i !== "object")
|
|
@@ -7610,14 +7610,14 @@ function Ka(r) {
|
|
|
7610
7610
|
return o;
|
|
7611
7611
|
}
|
|
7612
7612
|
function ll(r) {
|
|
7613
|
-
return Ne(r).length === 0 ? [] :
|
|
7613
|
+
return Ne(r).length === 0 ? [] : Ke(r);
|
|
7614
7614
|
}
|
|
7615
7615
|
function ul(r) {
|
|
7616
|
-
return Ne(r).length === 0 ? [] :
|
|
7616
|
+
return Ne(r).length === 0 ? [] : Ke(r);
|
|
7617
7617
|
}
|
|
7618
7618
|
function cl(r) {
|
|
7619
7619
|
const e = r.key, t = r.value;
|
|
7620
|
-
if (
|
|
7620
|
+
if (M(t) === "array") {
|
|
7621
7621
|
if (t.length < 1 || t.length > 4)
|
|
7622
7622
|
return [new g(e, t, `padding requires 1 to 4 values; ${t.length} values found`)];
|
|
7623
7623
|
const a = {
|
|
@@ -7633,7 +7633,7 @@ function cl(r) {
|
|
|
7633
7633
|
}));
|
|
7634
7634
|
return o;
|
|
7635
7635
|
} else
|
|
7636
|
-
return
|
|
7636
|
+
return Qt({
|
|
7637
7637
|
key: e,
|
|
7638
7638
|
value: t,
|
|
7639
7639
|
valueSpec: {}
|
|
@@ -7641,7 +7641,7 @@ function cl(r) {
|
|
|
7641
7641
|
}
|
|
7642
7642
|
function pl(r) {
|
|
7643
7643
|
const e = r.key, t = r.value;
|
|
7644
|
-
if (
|
|
7644
|
+
if (M(t) === "array") {
|
|
7645
7645
|
const a = {
|
|
7646
7646
|
type: "number"
|
|
7647
7647
|
};
|
|
@@ -7657,7 +7657,7 @@ function pl(r) {
|
|
|
7657
7657
|
}));
|
|
7658
7658
|
return o;
|
|
7659
7659
|
} else
|
|
7660
|
-
return
|
|
7660
|
+
return Qt({
|
|
7661
7661
|
key: e,
|
|
7662
7662
|
value: t,
|
|
7663
7663
|
valueSpec: {}
|
|
@@ -7665,29 +7665,29 @@ function pl(r) {
|
|
|
7665
7665
|
}
|
|
7666
7666
|
function fl(r) {
|
|
7667
7667
|
const e = r.key, t = r.value;
|
|
7668
|
-
if (
|
|
7668
|
+
if (M(t) === "array") {
|
|
7669
7669
|
if (t.length < 1)
|
|
7670
7670
|
return [new g(e, t, "array length at least 1 expected, length 0 found")];
|
|
7671
7671
|
let a = [];
|
|
7672
7672
|
for (let o = 0; o < t.length; o++)
|
|
7673
|
-
a = a.concat(
|
|
7673
|
+
a = a.concat(Pr({
|
|
7674
7674
|
key: `${e}[${o}]`,
|
|
7675
7675
|
value: t[o]
|
|
7676
7676
|
}));
|
|
7677
7677
|
return a;
|
|
7678
7678
|
} else
|
|
7679
|
-
return
|
|
7679
|
+
return Pr({
|
|
7680
7680
|
key: e,
|
|
7681
7681
|
value: t
|
|
7682
7682
|
});
|
|
7683
7683
|
}
|
|
7684
7684
|
function dl(r) {
|
|
7685
|
-
const e = r.key, t = r.value, n =
|
|
7685
|
+
const e = r.key, t = r.value, n = M(t), a = r.styleSpec;
|
|
7686
7686
|
if (n !== "array" || t.length < 1 || t.length % 2 !== 0)
|
|
7687
7687
|
return [new g(e, t, "variableAnchorOffsetCollection requires a non-empty array of even length")];
|
|
7688
7688
|
let o = [];
|
|
7689
7689
|
for (let i = 0; i < t.length; i += 2)
|
|
7690
|
-
o = o.concat(
|
|
7690
|
+
o = o.concat(ut({
|
|
7691
7691
|
key: `${e}[${i}]`,
|
|
7692
7692
|
value: t[i],
|
|
7693
7693
|
valueSpec: a.layout_symbol["text-anchor"]
|
|
@@ -7736,7 +7736,7 @@ function Xa(r) {
|
|
|
7736
7736
|
});
|
|
7737
7737
|
}
|
|
7738
7738
|
function hl(r) {
|
|
7739
|
-
const e = r.value, t = r.styleSpec, n = t.projection, a = r.style, o =
|
|
7739
|
+
const e = r.value, t = r.styleSpec, n = t.projection, a = r.style, o = M(e);
|
|
7740
7740
|
if (e === void 0)
|
|
7741
7741
|
return [];
|
|
7742
7742
|
if (o !== "object")
|
|
@@ -7756,7 +7756,7 @@ function yl(r) {
|
|
|
7756
7756
|
const e = r.key;
|
|
7757
7757
|
let t = r.value;
|
|
7758
7758
|
t = t instanceof String ? t.valueOf() : t;
|
|
7759
|
-
const n =
|
|
7759
|
+
const n = M(t);
|
|
7760
7760
|
return n === "array" && !gl(t) && !ml(t) ? [new g(e, t, `projection expected, invalid array ${JSON.stringify(t)} found`)] : ["array", "string"].includes(n) ? [] : [new g(e, t, `projection expected, invalid type "${n}" found`)];
|
|
7761
7761
|
}
|
|
7762
7762
|
function ml(r) {
|
|
@@ -7770,7 +7770,7 @@ function vl(r) {
|
|
|
7770
7770
|
}
|
|
7771
7771
|
function Wa(r) {
|
|
7772
7772
|
return vl(r.value) ? [] : [
|
|
7773
|
-
new g(r.key, r.value, `object expected, ${
|
|
7773
|
+
new g(r.key, r.value, `object expected, ${M(r.value)} found`)
|
|
7774
7774
|
];
|
|
7775
7775
|
}
|
|
7776
7776
|
const qn = {
|
|
@@ -7779,10 +7779,10 @@ const qn = {
|
|
|
7779
7779
|
},
|
|
7780
7780
|
array: on,
|
|
7781
7781
|
boolean: ol,
|
|
7782
|
-
number:
|
|
7783
|
-
color:
|
|
7782
|
+
number: Qt,
|
|
7783
|
+
color: Pr,
|
|
7784
7784
|
constants: Oa,
|
|
7785
|
-
enum:
|
|
7785
|
+
enum: ut,
|
|
7786
7786
|
filter: sn,
|
|
7787
7787
|
function: ja,
|
|
7788
7788
|
layer: qa,
|
|
@@ -7803,9 +7803,9 @@ const qn = {
|
|
|
7803
7803
|
sprite: Xa,
|
|
7804
7804
|
state: Wa
|
|
7805
7805
|
};
|
|
7806
|
-
function
|
|
7806
|
+
function $t(r) {
|
|
7807
7807
|
const e = r.value, t = r.valueSpec, n = r.styleSpec;
|
|
7808
|
-
return r.validateSpec =
|
|
7808
|
+
return r.validateSpec = $t, t.expression && nn(U(e)) ? ja(r) : t.expression && za(je(e)) ? Ke(r) : t.type && qn[t.type] ? qn[t.type](r) : te(Tt({}, r, {
|
|
7809
7809
|
valueSpec: t.type ? n[t.type] : t
|
|
7810
7810
|
}));
|
|
7811
7811
|
}
|
|
@@ -7815,13 +7815,13 @@ function Za(r) {
|
|
|
7815
7815
|
}
|
|
7816
7816
|
function Y(r, e = Hi) {
|
|
7817
7817
|
let t = [];
|
|
7818
|
-
return t = t.concat(
|
|
7818
|
+
return t = t.concat($t({
|
|
7819
7819
|
key: "",
|
|
7820
7820
|
value: r,
|
|
7821
7821
|
valueSpec: e.$root,
|
|
7822
7822
|
styleSpec: e,
|
|
7823
7823
|
style: r,
|
|
7824
|
-
validateSpec:
|
|
7824
|
+
validateSpec: $t,
|
|
7825
7825
|
objectElementValidators: {
|
|
7826
7826
|
glyphs: Za,
|
|
7827
7827
|
"*"() {
|
|
@@ -7848,7 +7848,7 @@ function ce(r) {
|
|
|
7848
7848
|
return function(e) {
|
|
7849
7849
|
return r({
|
|
7850
7850
|
...e,
|
|
7851
|
-
validateSpec:
|
|
7851
|
+
validateSpec: $t
|
|
7852
7852
|
});
|
|
7853
7853
|
};
|
|
7854
7854
|
}
|
|
@@ -7863,7 +7863,7 @@ function pe(r) {
|
|
|
7863
7863
|
function Gn(r) {
|
|
7864
7864
|
if (!r)
|
|
7865
7865
|
return {
|
|
7866
|
-
style:
|
|
7866
|
+
style: Qe[nr[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
|
|
7867
7867
|
requiresUrlMonitoring: !1,
|
|
7868
7868
|
// default styles don't require URL monitoring
|
|
7869
7869
|
isFallback: !0
|
|
@@ -7875,7 +7875,7 @@ function Gn(r) {
|
|
|
7875
7875
|
requiresUrlMonitoring: !1,
|
|
7876
7876
|
isFallback: !1
|
|
7877
7877
|
} : t.isValidJSON ? {
|
|
7878
|
-
style:
|
|
7878
|
+
style: Qe[nr[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
|
|
7879
7879
|
requiresUrlMonitoring: !1,
|
|
7880
7880
|
// default styles don't require URL monitoring
|
|
7881
7881
|
isFallback: !0
|
|
@@ -7889,11 +7889,11 @@ function Gn(r) {
|
|
|
7889
7889
|
isFallback: !1
|
|
7890
7890
|
};
|
|
7891
7891
|
}
|
|
7892
|
-
return r instanceof
|
|
7892
|
+
return r instanceof Io ? {
|
|
7893
7893
|
style: r.getExpandedStyleURL(),
|
|
7894
7894
|
requiresUrlMonitoring: !1,
|
|
7895
7895
|
isFallback: !1
|
|
7896
|
-
} : r instanceof
|
|
7896
|
+
} : r instanceof Mo ? {
|
|
7897
7897
|
style: r.getDefaultVariant().getExpandedStyleURL(),
|
|
7898
7898
|
requiresUrlMonitoring: !1,
|
|
7899
7899
|
isFallback: !1
|
|
@@ -7902,7 +7902,7 @@ function Gn(r) {
|
|
|
7902
7902
|
requiresUrlMonitoring: !1,
|
|
7903
7903
|
isFallback: !1
|
|
7904
7904
|
} : {
|
|
7905
|
-
style:
|
|
7905
|
+
style: Qe[nr[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
|
|
7906
7906
|
requiresUrlMonitoring: !1,
|
|
7907
7907
|
// default styles don't require URL monitoring
|
|
7908
7908
|
isFallback: !0
|
|
@@ -8065,8 +8065,8 @@ class Cl extends ri {
|
|
|
8065
8065
|
}
|
|
8066
8066
|
}
|
|
8067
8067
|
}
|
|
8068
|
-
var K, oe, Se, xe, W,
|
|
8069
|
-
class
|
|
8068
|
+
var K, oe, Se, xe, W, pt, q, Ja, J, Qa;
|
|
8069
|
+
class dr {
|
|
8070
8070
|
constructor(e, t) {
|
|
8071
8071
|
be(this, q);
|
|
8072
8072
|
be(this, K);
|
|
@@ -8075,7 +8075,7 @@ class pr {
|
|
|
8075
8075
|
be(this, Se);
|
|
8076
8076
|
be(this, xe);
|
|
8077
8077
|
be(this, W, !1);
|
|
8078
|
-
be(this,
|
|
8078
|
+
be(this, pt);
|
|
8079
8079
|
e.style !== void 0 && _e(this, W, !0), _e(this, K, {
|
|
8080
8080
|
// set defaults
|
|
8081
8081
|
zoomAdjust: -4,
|
|
@@ -8132,18 +8132,18 @@ class pr {
|
|
|
8132
8132
|
_e(this, oe, e), _e(this, Se, ge("div", "maplibregl-ctrl maplibregl-ctrl-group"));
|
|
8133
8133
|
for (const [t, n] of Object.entries(P(this, K).containerStyle))
|
|
8134
8134
|
P(this, Se).style.setProperty(t, n);
|
|
8135
|
-
return P(this, K).container = P(this, Se), P(this, K).zoom = e.getZoom() + P(this, K).zoomAdjust, this.map = new
|
|
8135
|
+
return P(this, K).container = P(this, Se), P(this, K).zoom = e.getZoom() + P(this, K).zoomAdjust, this.map = new Mu(P(this, K)), this.map.once("style.load", () => {
|
|
8136
8136
|
this.map.resize();
|
|
8137
8137
|
}), this.map.once("load", () => {
|
|
8138
|
-
H(this, q, Ja).call(this, P(this, K).parentRect), _e(this,
|
|
8138
|
+
H(this, q, Ja).call(this, P(this, K).parentRect), _e(this, pt, H(this, q, Qa).call(this));
|
|
8139
8139
|
}), P(this, Se);
|
|
8140
8140
|
}
|
|
8141
8141
|
onRemove() {
|
|
8142
8142
|
var e;
|
|
8143
|
-
(e = P(this,
|
|
8143
|
+
(e = P(this, pt)) == null || e.call(this), ln(P(this, Se));
|
|
8144
8144
|
}
|
|
8145
8145
|
}
|
|
8146
|
-
K = new WeakMap(), oe = new WeakMap(), Se = new WeakMap(), xe = new WeakMap(), W = new WeakMap(),
|
|
8146
|
+
K = new WeakMap(), oe = new WeakMap(), Se = new WeakMap(), xe = new WeakMap(), W = new WeakMap(), pt = new WeakMap(), q = new WeakSet(), Ja = function(e) {
|
|
8147
8147
|
e === void 0 || e.linePaint === void 0 && e.fillPaint === void 0 || (_e(this, xe, {
|
|
8148
8148
|
type: "Feature",
|
|
8149
8149
|
properties: {
|
|
@@ -8228,13 +8228,13 @@ class Ll {
|
|
|
8228
8228
|
this.projectionButton.classList.remove("maplibregl-ctrl-projection-globe"), this.projectionButton.classList.remove("maplibregl-ctrl-projection-mercator"), this.map.isGlobeProjection() ? (this.projectionButton.classList.add("maplibregl-ctrl-projection-mercator"), this.projectionButton.title = "Enable Mercator projection") : (this.projectionButton.classList.add("maplibregl-ctrl-projection-globe"), this.projectionButton.title = "Enable Globe projection");
|
|
8229
8229
|
}
|
|
8230
8230
|
}
|
|
8231
|
-
const Al = "@maptiler/sdk", El = "3.4.
|
|
8231
|
+
const Al = "@maptiler/sdk", El = "3.4.1-rc2", Tl = "The Javascript & TypeScript map SDK tailored for MapTiler Cloud", _l = "MapTiler", Il = "dist/maptiler-sdk.mjs", Ml = "dist/maptiler-sdk.d.ts", Pl = "dist/maptiler-sdk.css", Rl = "module", zl = "dist/maptiler-sdk.mjs", Fl = { ".": { import: "./dist/maptiler-sdk.mjs", types: "./dist/maptiler-sdk.d.ts" }, "./dist/maptiler-sdk.css": { import: "./dist/maptiler-sdk.css" }, "./style.css": { import: "./dist/maptiler-sdk.css" } }, $l = ["maptiler", "map", "sdk", "webmap", "cloud", "webGL", "maplibre"], Ol = "https://docs.maptiler.com/sdk-js/", jl = "BSD-3-Clause", Nl = { type: "git", url: "https://github.com/maptiler/maptiler-sdk-js.git" }, Dl = { prepare: "husky", doc: "rm -rf docs/* && typedoc --out docs && cp -r images docs/", ncu: "npx npm-check-updates", lint: "tsc --noEmit && eslint src", "lint:fix": "tsc --noEmit && eslint src --fix", "test:watch": "vitest watch -c vite.config-test.ts --dom", test: "vitest run -c vite.config-test.ts --dom", "install:clean": "rm -rf build/ dist/ node_modules/ && npm ci", dev: "npm run build-css && vite -c vite.config-dev.ts", "dev-umd": "npm run build-css && tsc && NODE_ENV=development vite build -w -c vite.config-umd.ts", "build-css": "mkdir -p dist build && node scripts/replace-path-with-content.js src/style/style_template.css dist/tmp_maptiler-sdk.css && cat node_modules/maplibre-gl/dist/maplibre-gl.css dist/tmp_maptiler-sdk.css > dist/maptiler-sdk.css && rm dist/tmp_maptiler-sdk.css && cp dist/maptiler-sdk.css build/maptiler-sdk.css", "build-umd": "tsc && NODE_ENV=production vite build -c vite.config-umd.ts", "build-es": "tsc && NODE_ENV=production vite build -c vite.config-es.ts", build: "npm run build-es; npm run build-umd; npm run build-css", make: "npm run install:clean && npm run build" }, Ul = { "@canvas/image-data": "^1.0.0", "@eslint/js": "^9.21.0", "@types/color-convert": "^2.0.4", "@types/color-name": "^2.0.0", "@types/stats.js": "^0.17.4", "@types/uuid": "^10.0.0", "@types/xmldom": "^0.1.31", "@vitest/web-worker": "^3.0.9", "@xmldom/xmldom": "^0.8.10", concurrently: "^9.1.2", eslint: "^9.21.0", "eslint-config-prettier": "^10.0.2", "eslint-plugin-prettier": "^5.2.3", "happy-dom": "^17.4.4", husky: "^8.0.0", jiti: "^2.4.2", "lint-staged": "^15.4.3", prettier: "3.5.2", "stats.js": "^0.17.0", typedoc: "^0.27.6", typescript: "^5.7.3", "typescript-eslint": "^8.25.0", vite: "^6.0.7", "vite-plugin-dts": "^4.5.0", vitest: "^3.0.9" }, Bl = { "@maplibre/maplibre-gl-style-spec": "^23.0.0", "@maptiler/client": "^2.3.2", events: "^3.3.0", "gl-matrix": "^3.4.3", "js-base64": "^3.7.7", "maplibre-gl": "^5.5.0", uuid: "^11.0.5" }, ql = {
|
|
8232
8232
|
name: Al,
|
|
8233
8233
|
version: El,
|
|
8234
8234
|
description: Tl,
|
|
8235
8235
|
author: _l,
|
|
8236
|
-
module:
|
|
8237
|
-
types:
|
|
8236
|
+
module: Il,
|
|
8237
|
+
types: Ml,
|
|
8238
8238
|
style: Pl,
|
|
8239
8239
|
type: Rl,
|
|
8240
8240
|
main: zl,
|
|
@@ -8285,15 +8285,15 @@ class Gl {
|
|
|
8285
8285
|
return e.searchParams.append("sdk", ql.version), e.searchParams.append("key", D.apiKey), e.searchParams.append("mtsid", Nr), e.searchParams.append("session", D.session ? "1" : "0"), e.searchParams.append("caching", D.caching ? "1" : "0"), e.searchParams.append("lang-updated", this.map.isLanguageUpdated() ? "1" : "0"), e.searchParams.append("terrain", this.map.getTerrain() ? "1" : "0"), e.searchParams.append("globe", this.map.isGlobeProjection() ? "1" : "0"), this.registeredModules.size > 0 && e.searchParams.append("modules", Array.from(this.registeredModules).join("|")), e.href;
|
|
8286
8286
|
}
|
|
8287
8287
|
}
|
|
8288
|
-
var
|
|
8288
|
+
var ct = typeof Float32Array < "u" ? Float32Array : Array;
|
|
8289
8289
|
Math.hypot || (Math.hypot = function() {
|
|
8290
8290
|
for (var r = 0, e = arguments.length; e--; )
|
|
8291
8291
|
r += arguments[e] * arguments[e];
|
|
8292
8292
|
return Math.sqrt(r);
|
|
8293
8293
|
});
|
|
8294
|
-
function
|
|
8295
|
-
var r = new
|
|
8296
|
-
return
|
|
8294
|
+
function rt() {
|
|
8295
|
+
var r = new ct(16);
|
|
8296
|
+
return ct != Float32Array && (r[1] = 0, r[2] = 0, r[3] = 0, r[4] = 0, r[6] = 0, r[7] = 0, r[8] = 0, r[9] = 0, r[11] = 0, r[12] = 0, r[13] = 0, r[14] = 0), r[0] = 1, r[5] = 1, r[10] = 1, r[15] = 1, r;
|
|
8297
8297
|
}
|
|
8298
8298
|
function Vl(r, e, t, n, a, o, i, s, l, u, c, p, f, d, h, y, m) {
|
|
8299
8299
|
return r[0] = e, r[1] = t, r[2] = n, r[3] = a, r[4] = o, r[5] = i, r[6] = s, r[7] = l, r[8] = u, r[9] = c, r[10] = p, r[11] = f, r[12] = d, r[13] = h, r[14] = y, r[15] = m, r;
|
|
@@ -8323,15 +8323,15 @@ function Wl(r, e, t, n, a) {
|
|
|
8323
8323
|
return r[0] = o / t, r[1] = 0, r[2] = 0, r[3] = 0, r[4] = 0, r[5] = o, r[6] = 0, r[7] = 0, r[8] = 0, r[9] = 0, r[11] = -1, r[12] = 0, r[13] = 0, r[15] = 0, a != null && a !== 1 / 0 ? (i = 1 / (n - a), r[10] = (a + n) * i, r[14] = 2 * a * n * i) : (r[10] = -1, r[14] = -2 * n), r;
|
|
8324
8324
|
}
|
|
8325
8325
|
var Zl = Wl;
|
|
8326
|
-
function
|
|
8327
|
-
var r = new
|
|
8328
|
-
return
|
|
8326
|
+
function Lt() {
|
|
8327
|
+
var r = new ct(3);
|
|
8328
|
+
return ct != Float32Array && (r[0] = 0, r[1] = 0, r[2] = 0), r;
|
|
8329
8329
|
}
|
|
8330
8330
|
function Yl(r, e, t) {
|
|
8331
|
-
var n = new
|
|
8331
|
+
var n = new ct(3);
|
|
8332
8332
|
return n[0] = r, n[1] = e, n[2] = t, n;
|
|
8333
8333
|
}
|
|
8334
|
-
function
|
|
8334
|
+
function hr(r, e) {
|
|
8335
8335
|
var t = e[0], n = e[1], a = e[2], o = t * t + n * n + a * a;
|
|
8336
8336
|
return o > 0 && (o = 1 / Math.sqrt(o)), r[0] = e[0] * o, r[1] = e[1] * o, r[2] = e[2] * o, r;
|
|
8337
8337
|
}
|
|
@@ -8340,7 +8340,7 @@ function Wn(r, e, t) {
|
|
|
8340
8340
|
return r[0] = a * l - o * s, r[1] = o * i - n * l, r[2] = n * s - a * i, r;
|
|
8341
8341
|
}
|
|
8342
8342
|
(function() {
|
|
8343
|
-
var r =
|
|
8343
|
+
var r = Lt();
|
|
8344
8344
|
return function(e, t, n, a, o, i) {
|
|
8345
8345
|
var s, l;
|
|
8346
8346
|
for (t || (t = 3), n || (n = 0), a ? l = Math.min(a * t + n, e.length) : l = e.length, s = n; s < l; s += t)
|
|
@@ -8351,9 +8351,9 @@ function Wn(r, e, t) {
|
|
|
8351
8351
|
function Jl(r) {
|
|
8352
8352
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
8353
8353
|
}
|
|
8354
|
-
var
|
|
8354
|
+
var yr, Zn;
|
|
8355
8355
|
function Ql() {
|
|
8356
|
-
return Zn || (Zn = 1,
|
|
8356
|
+
return Zn || (Zn = 1, yr = {
|
|
8357
8357
|
aliceblue: [240, 248, 255],
|
|
8358
8358
|
antiquewhite: [250, 235, 215],
|
|
8359
8359
|
aqua: [0, 255, 255],
|
|
@@ -8502,11 +8502,11 @@ function Ql() {
|
|
|
8502
8502
|
whitesmoke: [245, 245, 245],
|
|
8503
8503
|
yellow: [255, 255, 0],
|
|
8504
8504
|
yellowgreen: [154, 205, 50]
|
|
8505
|
-
}),
|
|
8505
|
+
}), yr;
|
|
8506
8506
|
}
|
|
8507
|
-
var
|
|
8507
|
+
var mr, Yn;
|
|
8508
8508
|
function eo() {
|
|
8509
|
-
if (Yn) return
|
|
8509
|
+
if (Yn) return mr;
|
|
8510
8510
|
Yn = 1;
|
|
8511
8511
|
const r = Ql(), e = {};
|
|
8512
8512
|
for (const a of Object.keys(r))
|
|
@@ -8528,7 +8528,7 @@ function eo() {
|
|
|
8528
8528
|
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
8529
8529
|
gray: { channels: 1, labels: ["gray"] }
|
|
8530
8530
|
};
|
|
8531
|
-
|
|
8531
|
+
mr = t;
|
|
8532
8532
|
for (const a of Object.keys(t)) {
|
|
8533
8533
|
if (!("channels" in t[a]))
|
|
8534
8534
|
throw new Error("missing channels property: " + a);
|
|
@@ -8805,11 +8805,11 @@ function eo() {
|
|
|
8805
8805
|
return "000000".substring(s.length) + s;
|
|
8806
8806
|
}, t.rgb.gray = function(a) {
|
|
8807
8807
|
return [(a[0] + a[1] + a[2]) / 3 / 255 * 100];
|
|
8808
|
-
},
|
|
8808
|
+
}, mr;
|
|
8809
8809
|
}
|
|
8810
|
-
var
|
|
8810
|
+
var gr, Jn;
|
|
8811
8811
|
function eu() {
|
|
8812
|
-
if (Jn) return
|
|
8812
|
+
if (Jn) return gr;
|
|
8813
8813
|
Jn = 1;
|
|
8814
8814
|
const r = eo();
|
|
8815
8815
|
function e() {
|
|
@@ -8846,18 +8846,18 @@ function eu() {
|
|
|
8846
8846
|
s.unshift(i[u].parent), l = n(r[i[u].parent][u], l), u = i[u].parent;
|
|
8847
8847
|
return l.conversion = s, l;
|
|
8848
8848
|
}
|
|
8849
|
-
return
|
|
8849
|
+
return gr = function(o) {
|
|
8850
8850
|
const i = t(o), s = {}, l = Object.keys(i);
|
|
8851
8851
|
for (let u = l.length, c = 0; c < u; c++) {
|
|
8852
8852
|
const p = l[c];
|
|
8853
8853
|
i[p].parent !== null && (s[p] = a(p, i));
|
|
8854
8854
|
}
|
|
8855
8855
|
return s;
|
|
8856
|
-
},
|
|
8856
|
+
}, gr;
|
|
8857
8857
|
}
|
|
8858
|
-
var
|
|
8858
|
+
var vr, Qn;
|
|
8859
8859
|
function tu() {
|
|
8860
|
-
if (Qn) return
|
|
8860
|
+
if (Qn) return vr;
|
|
8861
8861
|
Qn = 1;
|
|
8862
8862
|
const r = eo(), e = eu(), t = {}, n = Object.keys(r);
|
|
8863
8863
|
function a(i) {
|
|
@@ -8888,7 +8888,7 @@ function tu() {
|
|
|
8888
8888
|
const c = s[u];
|
|
8889
8889
|
t[i][u] = o(c), t[i][u].raw = a(c);
|
|
8890
8890
|
});
|
|
8891
|
-
}),
|
|
8891
|
+
}), vr = t, vr;
|
|
8892
8892
|
}
|
|
8893
8893
|
var ru = tu();
|
|
8894
8894
|
const nu = /* @__PURE__ */ Jl(ru);
|
|
@@ -8939,7 +8939,7 @@ function to({
|
|
|
8939
8939
|
indexBufferLength: f
|
|
8940
8940
|
};
|
|
8941
8941
|
}
|
|
8942
|
-
function
|
|
8942
|
+
function At(r) {
|
|
8943
8943
|
if (!r)
|
|
8944
8944
|
return [1, 1, 1, 0];
|
|
8945
8945
|
if (r === "transparent")
|
|
@@ -8962,9 +8962,9 @@ function Ir(r) {
|
|
|
8962
8962
|
}
|
|
8963
8963
|
return console.warn([`[parseColorStringToVec4]: Color ${r} is either not a valid color or its type is not supported, defaulting to black`]), [0, 0, 0, 1];
|
|
8964
8964
|
}
|
|
8965
|
-
let
|
|
8965
|
+
let Ye;
|
|
8966
8966
|
function iu(r) {
|
|
8967
|
-
return
|
|
8967
|
+
return Ye = Ye ?? document.createElement("canvas").getContext("2d"), Ye ? (Ye.fillStyle = r, Ye.fillStyle) : "#000000";
|
|
8968
8968
|
}
|
|
8969
8969
|
const un = 1, re = un / 2, ne = un / 2, ae = un / 2, su = [-0.5, -0.5, ae, re, -0.5, ae, re, ne, ae, -0.5, ne, ae], lu = [-0.5, -0.5, -0.5, -0.5, ne, -0.5, re, ne, -0.5, re, -0.5, -0.5], uu = [-0.5, ne, -0.5, -0.5, ne, ae, re, ne, ae, re, ne, -0.5], cu = [-0.5, -0.5, -0.5, re, -0.5, -0.5, re, -0.5, ae, -0.5, -0.5, ae], pu = [re, -0.5, -0.5, re, ne, -0.5, re, ne, ae, re, -0.5, ae], fu = [-0.5, -0.5, -0.5, -0.5, -0.5, ae, -0.5, ne, ae, -0.5, ne, -0.5], du = [...su, ...lu, ...uu, ...cu, ...pu, ...fu], hu = [
|
|
8970
8970
|
// Front
|
|
@@ -9050,9 +9050,9 @@ void main(void) {
|
|
|
9050
9050
|
}
|
|
9051
9051
|
`;
|
|
9052
9052
|
var mu = /* @__PURE__ */ ((r) => (r.UNIVERSE_DARK = "universe-dark", r))(mu || {});
|
|
9053
|
-
const
|
|
9053
|
+
const Ge = {
|
|
9054
9054
|
stars: {
|
|
9055
|
-
color: "
|
|
9055
|
+
color: "hsl(233,100%,92%)",
|
|
9056
9056
|
preset: "stars"
|
|
9057
9057
|
},
|
|
9058
9058
|
space: {
|
|
@@ -9070,13 +9070,17 @@ const Pr = {
|
|
|
9070
9070
|
"milkyway-bright": {
|
|
9071
9071
|
color: "hsl(233,100%,92%)",
|
|
9072
9072
|
preset: "milkyway-bright"
|
|
9073
|
+
},
|
|
9074
|
+
"milkyway-colored": {
|
|
9075
|
+
color: "black",
|
|
9076
|
+
preset: "milkyway-colored"
|
|
9073
9077
|
}
|
|
9074
9078
|
};
|
|
9075
|
-
var
|
|
9076
|
-
let
|
|
9079
|
+
var Me = /* @__PURE__ */ ((r) => (r.POSITIVE_X = "pX", r.NEGATIVE_X = "nX", r.POSITIVE_Y = "pY", r.NEGATIVE_Y = "nY", r.POSITIVE_Z = "pZ", r.NEGATIVE_Z = "nZ", r))(Me || {});
|
|
9080
|
+
let br, ra;
|
|
9077
9081
|
function gu({ gl: r, faces: e, onLoadedCallback: t, forceRefresh: n }) {
|
|
9078
|
-
if (
|
|
9079
|
-
return
|
|
9082
|
+
if (br && !n && ra === JSON.stringify(e))
|
|
9083
|
+
return br;
|
|
9080
9084
|
ra = JSON.stringify(e);
|
|
9081
9085
|
const a = r.createTexture();
|
|
9082
9086
|
if (r.bindTexture(r.TEXTURE_CUBE_MAP, a), !e) {
|
|
@@ -9100,20 +9104,20 @@ function gu({ gl: r, faces: e, onLoadedCallback: t, forceRefresh: n }) {
|
|
|
9100
9104
|
r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MAG_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MIN_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), r.texImage2D(u, 0, p, f, d, h), l === 5 && (r.bindTexture(r.TEXTURE_CUBE_MAP, a), r.generateMipmap(r.TEXTURE_CUBE_MAP), t !== void 0 && t());
|
|
9101
9105
|
}, h.src = s;
|
|
9102
9106
|
}
|
|
9103
|
-
}), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MAG_FILTER, r.LINEAR),
|
|
9107
|
+
}), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MAG_FILTER, r.LINEAR), br = a, a;
|
|
9104
9108
|
}
|
|
9105
9109
|
function vu(r, e) {
|
|
9106
|
-
if (e ===
|
|
9110
|
+
if (e === Me.POSITIVE_X)
|
|
9107
9111
|
return r.TEXTURE_CUBE_MAP_POSITIVE_X;
|
|
9108
|
-
if (e ===
|
|
9112
|
+
if (e === Me.NEGATIVE_X)
|
|
9109
9113
|
return r.TEXTURE_CUBE_MAP_NEGATIVE_X;
|
|
9110
|
-
if (e ===
|
|
9114
|
+
if (e === Me.POSITIVE_Y)
|
|
9111
9115
|
return r.TEXTURE_CUBE_MAP_POSITIVE_Y;
|
|
9112
|
-
if (e ===
|
|
9116
|
+
if (e === Me.NEGATIVE_Y)
|
|
9113
9117
|
return r.TEXTURE_CUBE_MAP_NEGATIVE_Y;
|
|
9114
|
-
if (e ===
|
|
9118
|
+
if (e === Me.POSITIVE_Z)
|
|
9115
9119
|
return r.TEXTURE_CUBE_MAP_POSITIVE_Z;
|
|
9116
|
-
if (e ===
|
|
9120
|
+
if (e === Me.NEGATIVE_Z)
|
|
9117
9121
|
return r.TEXTURE_CUBE_MAP_NEGATIVE_Z;
|
|
9118
9122
|
throw new Error(`[CubemapLayer][loadCubemapTexture]: Invalid key ${e}`);
|
|
9119
9123
|
}
|
|
@@ -9128,7 +9132,7 @@ function bu(r, e, t) {
|
|
|
9128
9132
|
function Ce(r, e, t) {
|
|
9129
9133
|
return r + (e - r) * t;
|
|
9130
9134
|
}
|
|
9131
|
-
const De = "https://api.maptiler.com/resources/space", wu = ["vertexPosition"], Su = ["projectionMatrix", "modelViewMatrix", "cubeSampler", "bgColor", "fadeOpacity"], na = "%USE_TEXTURE_MACRO_MARKER%", xu = "#define USE_TEXTURE", ku =
|
|
9135
|
+
const De = "https://api.maptiler.com/resources/space", wu = ["vertexPosition"], Su = ["projectionMatrix", "modelViewMatrix", "cubeSampler", "bgColor", "fadeOpacity"], na = "%USE_TEXTURE_MACRO_MARKER%", xu = "#define USE_TEXTURE", ku = Ge.stars;
|
|
9132
9136
|
function Cu(r, e) {
|
|
9133
9137
|
if (r === !0)
|
|
9134
9138
|
return e;
|
|
@@ -9139,11 +9143,15 @@ function Cu(r, e) {
|
|
|
9139
9143
|
if (r.faces || r.path)
|
|
9140
9144
|
return delete t.preset, t;
|
|
9141
9145
|
const n = r.preset;
|
|
9142
|
-
if (!(n in
|
|
9143
|
-
throw new Error(`[CubemapLayer]: Invalid preset "${n}". Available presets: ${Object.keys(
|
|
9144
|
-
return
|
|
9146
|
+
if (!(n === void 0) && !(n in Ge))
|
|
9147
|
+
throw new Error(`[CubemapLayer]: Invalid preset "${n}". Available presets: ${Object.keys(Ge).join(", ")}`);
|
|
9148
|
+
return {
|
|
9149
|
+
...t,
|
|
9150
|
+
// this _could_ be nullish_
|
|
9151
|
+
color: t.color ?? Ge[n].color ?? "hsl(233,100%,92%)"
|
|
9152
|
+
};
|
|
9145
9153
|
}
|
|
9146
|
-
class
|
|
9154
|
+
class wr {
|
|
9147
9155
|
/**
|
|
9148
9156
|
* Creates a new instance of CubemapLayer
|
|
9149
9157
|
*
|
|
@@ -9244,6 +9252,12 @@ class vr {
|
|
|
9244
9252
|
* @type {string}
|
|
9245
9253
|
*/
|
|
9246
9254
|
S(this, "currentFacesDefinitionKey", "");
|
|
9255
|
+
/**
|
|
9256
|
+
* The configuration options for the cubemap layer.
|
|
9257
|
+
* @type {CubemapLayerConstructorOptions}
|
|
9258
|
+
* @private
|
|
9259
|
+
*/
|
|
9260
|
+
S(this, "options");
|
|
9247
9261
|
/**
|
|
9248
9262
|
* Animates the cubemap image fading in.
|
|
9249
9263
|
* This method gradually increases the opacity of the cubemap image to create a fade-in effect.
|
|
@@ -9259,7 +9273,7 @@ class vr {
|
|
|
9259
9273
|
*/
|
|
9260
9274
|
S(this, "imageFadeInDelta", 0);
|
|
9261
9275
|
const t = Cu(e, ku);
|
|
9262
|
-
this.currentFacesDefinitionKey = JSON.stringify(t.faces ?? t.preset ?? t.path), this.bgColor = [0, 0, 0, 0], this.targetBgColor =
|
|
9276
|
+
this.options = t, this.currentFacesDefinitionKey = JSON.stringify(t.faces ?? t.preset ?? t.path), this.bgColor = [0, 0, 0, 0], this.targetBgColor = At(t.color), this.faces = aa(t), this.useCubemapTexture = this.faces !== null;
|
|
9263
9277
|
}
|
|
9264
9278
|
/**
|
|
9265
9279
|
* Updates the cubemap object with the current faces and shader configuration.
|
|
@@ -9331,7 +9345,7 @@ class vr {
|
|
|
9331
9345
|
* @param {CustomRenderMethodInput} _options - Additional options for the render method.
|
|
9332
9346
|
*/
|
|
9333
9347
|
prerender(e, t) {
|
|
9334
|
-
this.updateTexture(e, this.faces);
|
|
9348
|
+
this.faces && this.updateTexture(e, this.faces);
|
|
9335
9349
|
}
|
|
9336
9350
|
/**
|
|
9337
9351
|
* Lerps the background color transition of the cubemap layer.
|
|
@@ -9393,13 +9407,13 @@ class vr {
|
|
|
9393
9407
|
throw new Error("[CubemapLayer]: Map is undefined");
|
|
9394
9408
|
if (this.cubemap === void 0)
|
|
9395
9409
|
throw new Error("[CubemapLayer]: Cubemap is undefined");
|
|
9396
|
-
this.texture === void 0 && console.warn("[CubemapLayer]: Texture is undefined, no
|
|
9397
|
-
const n = 0.1, a = 1e4, o = e.canvas, i = o.clientWidth / o.clientHeight, s = this.map.transform, l = s.fov * (Math.PI / 180), u =
|
|
9410
|
+
this.texture === void 0 && process.env.NODE_ENV === "development" && console.warn("[CubemapLayer]: Texture is undefined, no texture will be rendered to cubemap"), e.disable(e.DEPTH_TEST), e.enable(e.BLEND), e.blendFunc(e.SRC_ALPHA, e.DST_ALPHA), e.useProgram(this.cubemap.shaderProgram), e.bindBuffer(e.ARRAY_BUFFER, this.cubemap.positionBuffer), e.vertexAttribPointer(this.cubemap.programInfo.attributesLocations.vertexPosition, 3, e.FLOAT, !1, 0, 0), e.enableVertexAttribArray(this.cubemap.programInfo.attributesLocations.vertexPosition);
|
|
9411
|
+
const n = 0.1, a = 1e4, o = e.canvas, i = o.clientWidth / o.clientHeight, s = this.map.transform, l = s.fov * (Math.PI / 180), u = rt();
|
|
9398
9412
|
Zl(u, l, i, n, a), Xn(u, u, s.rollInRadians), Kn(u, u, -s.pitchInRadians), Xn(u, u, s.bearingInRadians);
|
|
9399
9413
|
const c = s.center.lat * Math.PI / 180, p = s.center.lng * Math.PI / 180;
|
|
9400
9414
|
Kn(u, u, c), Xl(u, u, -p), e.uniformMatrix4fv(this.cubemap.programInfo.uniformsLocations.projectionMatrix, !1, u);
|
|
9401
|
-
const f =
|
|
9402
|
-
if (e.uniformMatrix4fv(this.cubemap.programInfo.uniformsLocations.modelViewMatrix, !1, f), e.uniform4fv(this.cubemap.programInfo.uniformsLocations.bgColor, new Float32Array(this.bgColor)), this.
|
|
9415
|
+
const f = rt();
|
|
9416
|
+
if (e.uniformMatrix4fv(this.cubemap.programInfo.uniformsLocations.modelViewMatrix, !1, f), e.uniform4fv(this.cubemap.programInfo.uniformsLocations.bgColor, new Float32Array(this.bgColor)), e.uniform1f(this.cubemap.programInfo.uniformsLocations.fadeOpacity, this.currentFadeOpacity), this.useCubemapTexture && this.texture && (e.activeTexture(e.TEXTURE0), e.bindTexture(e.TEXTURE_CUBE_MAP, this.texture), e.uniform1i(this.cubemap.programInfo.uniformsLocations.cubeSampler, 0)), this.cubemap.indexBuffer === void 0)
|
|
9403
9417
|
throw new Error("Index buffer is undefined");
|
|
9404
9418
|
if (this.cubemap.indexBufferLength === void 0)
|
|
9405
9419
|
throw new Error("Index buffer length is undefined");
|
|
@@ -9408,8 +9422,19 @@ class vr {
|
|
|
9408
9422
|
setBgColor(e) {
|
|
9409
9423
|
this.targetBgColor = e, this.previousBgColor = this.bgColor, this.transitionDelta = 0;
|
|
9410
9424
|
}
|
|
9425
|
+
/**
|
|
9426
|
+
* Returns the current configuration options for the cubemap layer.
|
|
9427
|
+
* @returns {CubemapLayerConstructorOptions} The current configuration options.
|
|
9428
|
+
*/
|
|
9429
|
+
getConfig() {
|
|
9430
|
+
return this.options;
|
|
9431
|
+
}
|
|
9411
9432
|
async setCubemapFaces(e) {
|
|
9412
|
-
await this.animateOut(),
|
|
9433
|
+
if (await this.animateOut(), !e.faces && !e.preset && !e.path) {
|
|
9434
|
+
this.faces = null, this.useCubemapTexture = !1, this.currentFacesDefinitionKey = "", this.animateIn();
|
|
9435
|
+
return;
|
|
9436
|
+
}
|
|
9437
|
+
this.faces = aa(e), this.currentFacesDefinitionKey = JSON.stringify(e.faces ?? e.preset ?? e.path);
|
|
9413
9438
|
}
|
|
9414
9439
|
/**
|
|
9415
9440
|
* Sets the cubemap for the layer based on the provided definition.
|
|
@@ -9424,10 +9449,17 @@ class vr {
|
|
|
9424
9449
|
* Finally, it calls `updateCubemap` to apply the changes and trigger a repaint of the map.
|
|
9425
9450
|
*/
|
|
9426
9451
|
async setCubemap(e) {
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9452
|
+
this.options = e;
|
|
9453
|
+
const t = JSON.stringify(e.faces ?? e.preset ?? e.path);
|
|
9454
|
+
this.currentFacesDefinitionKey !== t && await this.setCubemapFaces(e);
|
|
9455
|
+
const n = At(e.color);
|
|
9456
|
+
if (e.color && this.targetBgColor.toString() !== n.toString())
|
|
9457
|
+
this.setBgColor(n);
|
|
9458
|
+
else if (e.preset && e.preset in Ge) {
|
|
9459
|
+
const a = Ge[e.preset];
|
|
9460
|
+
this.setBgColor(At(a.color));
|
|
9461
|
+
}
|
|
9462
|
+
this.updateCubemap();
|
|
9431
9463
|
}
|
|
9432
9464
|
/**
|
|
9433
9465
|
* Shows the cubemap layer by setting its visibility to "visible".
|
|
@@ -9537,18 +9569,18 @@ void main() {
|
|
|
9537
9569
|
// gl_FragColor = color;
|
|
9538
9570
|
gl_FragColor = vec4(color.rgb * color.a, color.a);
|
|
9539
9571
|
}
|
|
9540
|
-
`,
|
|
9572
|
+
`, Je = 2, Eu = ["position"], Tu = ["matrix", "rotationMatrix", "stopsNumber", "stops", "colors", "maxDistance", "scale"], _u = [
|
|
9541
9573
|
-2,
|
|
9542
9574
|
-2,
|
|
9543
9575
|
0,
|
|
9544
|
-
|
|
9576
|
+
Je,
|
|
9545
9577
|
-2,
|
|
9546
9578
|
0,
|
|
9547
9579
|
-2,
|
|
9548
|
-
|
|
9580
|
+
Je,
|
|
9549
9581
|
0,
|
|
9550
|
-
|
|
9551
|
-
|
|
9582
|
+
Je,
|
|
9583
|
+
Je,
|
|
9552
9584
|
0
|
|
9553
9585
|
], oa = {
|
|
9554
9586
|
scale: 0.9,
|
|
@@ -9558,7 +9590,7 @@ void main() {
|
|
|
9558
9590
|
[0.2, "rgba(98, 168, 229, 0.0)"]
|
|
9559
9591
|
]
|
|
9560
9592
|
}, ia = 0.075;
|
|
9561
|
-
class
|
|
9593
|
+
class Sr {
|
|
9562
9594
|
/**
|
|
9563
9595
|
* Creates a new RadialGradientLayer instance.
|
|
9564
9596
|
*
|
|
@@ -9695,26 +9727,26 @@ class br {
|
|
|
9695
9727
|
e.disable(e.DEPTH_TEST), e.enable(e.BLEND), e.useProgram(this.plane.shaderProgram), e.bindBuffer(e.ARRAY_BUFFER, this.plane.positionBuffer);
|
|
9696
9728
|
const n = this.plane.programInfo.attributesLocations.position;
|
|
9697
9729
|
e.enableVertexAttribArray(n), e.vertexAttribPointer(n, 3, e.FLOAT, !1, 0, 0);
|
|
9698
|
-
const a =
|
|
9730
|
+
const a = rt(), o = this.scale;
|
|
9699
9731
|
Kl(a, a, [o, o, o]);
|
|
9700
|
-
const i =
|
|
9732
|
+
const i = rt();
|
|
9701
9733
|
Hl(i, t.defaultProjectionData.mainMatrix, a);
|
|
9702
9734
|
const s = this.plane.programInfo.uniformsLocations.matrix;
|
|
9703
9735
|
e.uniformMatrix4fv(s, !1, i);
|
|
9704
|
-
const l =
|
|
9705
|
-
Wn(f, p, c),
|
|
9706
|
-
const d =
|
|
9707
|
-
Wn(d, c, f),
|
|
9736
|
+
const l = rt(), u = this.map.transform.cameraPosition, c = hr(Lt(), u), p = Yl(0, 1, 0), f = Lt();
|
|
9737
|
+
Wn(f, p, c), hr(f, f);
|
|
9738
|
+
const d = Lt();
|
|
9739
|
+
Wn(d, c, f), hr(d, d), Vl(l, f[0], f[1], f[2], 0, d[0], d[1], d[2], 0, c[0], c[1], c[2], 0, 0, 0, 0, 1);
|
|
9708
9740
|
const h = this.plane.programInfo.uniformsLocations.rotationMatrix;
|
|
9709
9741
|
e.uniformMatrix4fv(h, !1, l);
|
|
9710
9742
|
const y = this.gradient.stops.length, m = [], w = [];
|
|
9711
9743
|
for (let v = 0; v <= y; v++)
|
|
9712
9744
|
if (v < y) {
|
|
9713
9745
|
m[v] = this.gradient.stops[v][0];
|
|
9714
|
-
const x =
|
|
9746
|
+
const x = At(this.gradient.stops[v][1]);
|
|
9715
9747
|
w.push(...x);
|
|
9716
9748
|
}
|
|
9717
|
-
e.uniform1i(this.plane.programInfo.uniformsLocations.stopsNumber, y), e.uniform1fv(this.plane.programInfo.uniformsLocations.stops, new Float32Array(m)), e.uniform4fv(this.plane.programInfo.uniformsLocations.colors, new Float32Array(w)), e.uniform1f(this.plane.programInfo.uniformsLocations.maxDistance,
|
|
9749
|
+
e.uniform1i(this.plane.programInfo.uniformsLocations.stopsNumber, y), e.uniform1fv(this.plane.programInfo.uniformsLocations.stops, new Float32Array(m)), e.uniform4fv(this.plane.programInfo.uniformsLocations.colors, new Float32Array(w)), e.uniform1f(this.plane.programInfo.uniformsLocations.maxDistance, Je), e.uniform1f(this.plane.programInfo.uniformsLocations.scale, o), e.drawArrays(e.TRIANGLE_STRIP, 0, 4);
|
|
9718
9750
|
}
|
|
9719
9751
|
/**
|
|
9720
9752
|
* Sets a new gradient for the radial gradient layer and animates the transition.
|
|
@@ -9735,16 +9767,16 @@ class br {
|
|
|
9735
9767
|
this.map.setLayoutProperty(this.id, "visibility", "none");
|
|
9736
9768
|
}
|
|
9737
9769
|
}
|
|
9738
|
-
function
|
|
9770
|
+
function xt(r) {
|
|
9739
9771
|
var a;
|
|
9740
9772
|
const { map: e, property: t } = r, n = e.getStyle();
|
|
9741
9773
|
return n ? (a = n.metadata) != null && a.maptiler ? n.metadata.maptiler[t] ? n.metadata.maptiler[t] : null : (console.warn(`[extractCustomLayerStyle]: No custom layer metadata found in the style for property \`${t}\`. The property will use default values.`), null) : (console.warn("[extractCustomLayerStyle]: `Map.getStyle()` is returning undefined, are you initiating before style is ready?"), null);
|
|
9742
9774
|
}
|
|
9743
|
-
const
|
|
9775
|
+
const Iu = {
|
|
9744
9776
|
POINT: "POINT",
|
|
9745
9777
|
COUNTRY: "COUNTRY"
|
|
9746
9778
|
};
|
|
9747
|
-
let
|
|
9779
|
+
let Mu = class ro extends k.Map {
|
|
9748
9780
|
constructor(t) {
|
|
9749
9781
|
Ko(t.container), t.apiKey && (D.apiKey = t.apiKey);
|
|
9750
9782
|
const { style: n, requiresUrlMonitoring: a, isFallback: o } = Gn(t.style);
|
|
@@ -9791,7 +9823,7 @@ let Iu = class ro extends k.Map {
|
|
|
9791
9823
|
this.options = t, this.setStyle(n), a && this.monitorStyleUrl(n);
|
|
9792
9824
|
const u = () => {
|
|
9793
9825
|
let h = "The distant style could not be loaded.";
|
|
9794
|
-
this.getStyle() ? h += "Leaving the style as is." : (this.setStyle(
|
|
9826
|
+
this.getStyle() ? h += "Leaving the style as is." : (this.setStyle(Qe.STREETS), h += `Loading default MapTiler Cloud style "${Qe.STREETS.getDefaultVariant().getId()}" as a fallback.`), console.warn(h);
|
|
9795
9827
|
};
|
|
9796
9828
|
if (this.on("style.load", () => {
|
|
9797
9829
|
this.styleInProcess = !1;
|
|
@@ -9807,7 +9839,7 @@ let Iu = class ro extends k.Map {
|
|
|
9807
9839
|
u();
|
|
9808
9840
|
return;
|
|
9809
9841
|
}
|
|
9810
|
-
}), D.caching && !
|
|
9842
|
+
}), D.caching && !Cr && console.warn("The cache API is only available in secure contexts. More info at https://developer.mozilla.org/en-US/docs/Web/API/Cache"), D.caching && Cr && Bo(), typeof t.language > "u")
|
|
9811
9843
|
this.primaryLanguage = D.primaryLanguage;
|
|
9812
9844
|
else {
|
|
9813
9845
|
const h = yn(t.language, R);
|
|
@@ -9819,7 +9851,7 @@ let Iu = class ro extends k.Map {
|
|
|
9819
9851
|
if (!t.geolocate || t.center || t.hash && i)
|
|
9820
9852
|
return;
|
|
9821
9853
|
try {
|
|
9822
|
-
if (t.geolocate ===
|
|
9854
|
+
if (t.geolocate === Iu.COUNTRY) {
|
|
9823
9855
|
await this.fitToIpBounds();
|
|
9824
9856
|
return;
|
|
9825
9857
|
}
|
|
@@ -9936,9 +9968,9 @@ let Iu = class ro extends k.Map {
|
|
|
9936
9968
|
canvasContextAttributes: L,
|
|
9937
9969
|
refreshExpiredTiles: $,
|
|
9938
9970
|
maxBounds: Te,
|
|
9939
|
-
scrollZoom:
|
|
9940
|
-
minZoom:
|
|
9941
|
-
maxZoom:
|
|
9971
|
+
scrollZoom: Ze,
|
|
9972
|
+
minZoom: gt,
|
|
9973
|
+
maxZoom: vt,
|
|
9942
9974
|
boxZoom: go,
|
|
9943
9975
|
locale: vo,
|
|
9944
9976
|
fadeDuration: bo,
|
|
@@ -9949,7 +9981,7 @@ let Iu = class ro extends k.Map {
|
|
|
9949
9981
|
pixelRatio: Co,
|
|
9950
9982
|
validateStyle: Lo
|
|
9951
9983
|
} = t;
|
|
9952
|
-
this.minimap = new
|
|
9984
|
+
this.minimap = new dr(h, {
|
|
9953
9985
|
zoom: y,
|
|
9954
9986
|
center: m,
|
|
9955
9987
|
style: w,
|
|
@@ -9960,9 +9992,9 @@ let Iu = class ro extends k.Map {
|
|
|
9960
9992
|
canvasContextAttributes: L,
|
|
9961
9993
|
refreshExpiredTiles: $,
|
|
9962
9994
|
maxBounds: Te,
|
|
9963
|
-
scrollZoom:
|
|
9964
|
-
minZoom:
|
|
9965
|
-
maxZoom:
|
|
9995
|
+
scrollZoom: Ze,
|
|
9996
|
+
minZoom: gt,
|
|
9997
|
+
maxZoom: vt,
|
|
9966
9998
|
boxZoom: go,
|
|
9967
9999
|
locale: vo,
|
|
9968
10000
|
fadeDuration: bo,
|
|
@@ -9973,7 +10005,7 @@ let Iu = class ro extends k.Map {
|
|
|
9973
10005
|
pixelRatio: Co,
|
|
9974
10006
|
validateStyle: Lo
|
|
9975
10007
|
}), this.addControl(this.minimap, h.position ?? "bottom-left");
|
|
9976
|
-
} else h === !0 ? (this.minimap = new
|
|
10008
|
+
} else h === !0 ? (this.minimap = new dr({}, t), this.addControl(this.minimap, "bottom-left")) : h !== void 0 && h !== !1 && (this.minimap = new dr({}, t), this.addControl(this.minimap, h));
|
|
9977
10009
|
});
|
|
9978
10010
|
const d = (h) => {
|
|
9979
10011
|
h.terrain && (p = !0, f = {
|
|
@@ -9997,55 +10029,96 @@ let Iu = class ro extends k.Map {
|
|
|
9997
10029
|
getSpace() {
|
|
9998
10030
|
return this.space;
|
|
9999
10031
|
}
|
|
10032
|
+
/**
|
|
10033
|
+
* Sets the space for the map.
|
|
10034
|
+
* @param {CubemapDefinition} space the `CubemapDefinition` options to set.
|
|
10035
|
+
* @remarks This method, at present, ** overwrites ** the current config.
|
|
10036
|
+
* If an option is not set it will internally revert to the default option
|
|
10037
|
+
* unless explicitly set when calling.
|
|
10038
|
+
*/
|
|
10000
10039
|
setSpace(t) {
|
|
10001
10040
|
if (this.space) {
|
|
10002
10041
|
this.space.setCubemap(t);
|
|
10003
10042
|
return;
|
|
10004
10043
|
}
|
|
10005
|
-
this.space = new
|
|
10044
|
+
this.space = new wr(t), this.once("load", () => {
|
|
10006
10045
|
const n = this.getLayersOrder()[0];
|
|
10007
10046
|
this.space && this.addLayer(this.space, n);
|
|
10008
10047
|
});
|
|
10009
10048
|
}
|
|
10010
10049
|
setSpaceFromStyle({ style: t }) {
|
|
10011
|
-
var
|
|
10012
|
-
(
|
|
10050
|
+
var o, i;
|
|
10051
|
+
if (!((i = (o = t.metadata) == null ? void 0 : o.maptiler) != null && i.space))
|
|
10052
|
+
return;
|
|
10053
|
+
const n = t.metadata.maptiler.space, a = () => {
|
|
10054
|
+
if (this.space) {
|
|
10055
|
+
const s = this.getLayersOrder()[0];
|
|
10056
|
+
this.addLayer(this.space, s), this.space.setCubemap(n);
|
|
10057
|
+
}
|
|
10058
|
+
};
|
|
10059
|
+
if (!this.styleInProcess) {
|
|
10060
|
+
a();
|
|
10061
|
+
return;
|
|
10062
|
+
}
|
|
10063
|
+
this.once("style.load", () => {
|
|
10064
|
+
a();
|
|
10065
|
+
});
|
|
10013
10066
|
}
|
|
10014
10067
|
setHaloFromStyle({ style: t }) {
|
|
10015
|
-
var
|
|
10016
|
-
|
|
10068
|
+
var o;
|
|
10069
|
+
const n = (o = t.metadata) == null ? void 0 : o.maptiler;
|
|
10070
|
+
if (!(n != null && n.halo))
|
|
10071
|
+
return;
|
|
10072
|
+
const a = () => {
|
|
10073
|
+
var i;
|
|
10074
|
+
if (this.halo) {
|
|
10075
|
+
const s = this.getLayersOrder().indexOf(((i = this.space) == null ? void 0 : i.id) ?? "") + 1, l = this.getLayersOrder()[s];
|
|
10076
|
+
this.addLayer(this.halo, l), this.halo.setGradient(n.halo);
|
|
10077
|
+
}
|
|
10078
|
+
};
|
|
10079
|
+
if (!this.styleInProcess) {
|
|
10080
|
+
a();
|
|
10081
|
+
return;
|
|
10082
|
+
}
|
|
10083
|
+
this.once("style.load", () => {
|
|
10084
|
+
a();
|
|
10085
|
+
});
|
|
10017
10086
|
}
|
|
10018
10087
|
setSpaceFromCurrentStyle() {
|
|
10019
|
-
const t =
|
|
10088
|
+
const t = xt({ map: this, property: "space" });
|
|
10020
10089
|
if (t && this.space) {
|
|
10021
10090
|
this.space.setCubemap(t);
|
|
10022
10091
|
return;
|
|
10023
10092
|
}
|
|
10024
10093
|
}
|
|
10025
10094
|
setHaloFromCurrentStyle() {
|
|
10026
|
-
const t =
|
|
10095
|
+
const t = xt({ map: this, property: "halo" });
|
|
10027
10096
|
if (t && this.halo) {
|
|
10028
10097
|
this.halo.setGradient(t);
|
|
10029
10098
|
return;
|
|
10030
10099
|
}
|
|
10031
10100
|
}
|
|
10032
10101
|
initSpace({ options: t = this.options, before: n }) {
|
|
10033
|
-
if (this.space
|
|
10034
|
-
|
|
10102
|
+
if (this.space) {
|
|
10103
|
+
this.getLayer(this.space.id) || this.addLayer(this.space, n);
|
|
10104
|
+
return;
|
|
10105
|
+
}
|
|
10106
|
+
if (t.space === !1) return;
|
|
10107
|
+
const a = xt({ map: this, property: "space" });
|
|
10035
10108
|
if (t.space) {
|
|
10036
|
-
this.space = new
|
|
10109
|
+
this.space = new wr(t.space), this.addLayer(this.space, n);
|
|
10037
10110
|
return;
|
|
10038
10111
|
}
|
|
10039
|
-
a && (this.space = new
|
|
10112
|
+
a && (this.space = new wr(a), this.addLayer(this.space, n));
|
|
10040
10113
|
}
|
|
10041
10114
|
initHalo({ options: t = this.options, before: n }) {
|
|
10042
10115
|
if (this.halo && this.getLayer(this.halo.id) || t.halo === !1) return;
|
|
10043
|
-
const a =
|
|
10116
|
+
const a = xt({ map: this, property: "halo" });
|
|
10044
10117
|
if (t.halo) {
|
|
10045
|
-
this.halo = new
|
|
10118
|
+
this.halo = new Sr(t.halo), this.addLayer(this.halo, n);
|
|
10046
10119
|
return;
|
|
10047
10120
|
}
|
|
10048
|
-
a && (this.halo = new
|
|
10121
|
+
a && (this.halo = new Sr(a), this.addLayer(this.halo, n));
|
|
10049
10122
|
}
|
|
10050
10123
|
getHalo() {
|
|
10051
10124
|
return this.halo;
|
|
@@ -10055,7 +10128,7 @@ let Iu = class ro extends k.Map {
|
|
|
10055
10128
|
this.halo.setGradient(t);
|
|
10056
10129
|
return;
|
|
10057
10130
|
}
|
|
10058
|
-
this.halo = new
|
|
10131
|
+
this.halo = new Sr(t), this.once("load", () => {
|
|
10059
10132
|
var s;
|
|
10060
10133
|
const n = this.getLayersOrder(), a = n[0], o = n.indexOf(((s = this.space) == null ? void 0 : s.id) ?? "") + 2, i = n[o];
|
|
10061
10134
|
this.halo && this.addLayer(this.halo, this.space ? i : a);
|
|
@@ -10167,16 +10240,16 @@ let Iu = class ro extends k.Map {
|
|
|
10167
10240
|
this.styleInProcess = !0, super.setStyle(a.style, n);
|
|
10168
10241
|
const o = this.getLayersOrder()[0];
|
|
10169
10242
|
if (typeof a.style != "string" && !a.requiresUrlMonitoring) {
|
|
10170
|
-
if (this.space) {
|
|
10171
|
-
const s = a.style;
|
|
10172
|
-
this.setSpaceFromStyle({ style: s });
|
|
10173
|
-
} else
|
|
10174
|
-
this.initSpace({ before: o });
|
|
10175
10243
|
if (this.halo) {
|
|
10176
10244
|
const s = a.style;
|
|
10177
10245
|
this.setHaloFromStyle({ style: s });
|
|
10178
10246
|
} else
|
|
10179
10247
|
this.initHalo({ before: o });
|
|
10248
|
+
if (this.space) {
|
|
10249
|
+
const s = a.style;
|
|
10250
|
+
this.setSpaceFromStyle({ style: s });
|
|
10251
|
+
} else
|
|
10252
|
+
this.initSpace({ before: o });
|
|
10180
10253
|
return this;
|
|
10181
10254
|
}
|
|
10182
10255
|
this.once("style.load", () => {
|
|
@@ -10184,9 +10257,9 @@ let Iu = class ro extends k.Map {
|
|
|
10184
10257
|
this.space ? this.setSpaceFromCurrentStyle() : this.initSpace({ before: s }), this.halo ? this.setHaloFromCurrentStyle() : this.initHalo({ before: s });
|
|
10185
10258
|
});
|
|
10186
10259
|
try {
|
|
10187
|
-
|
|
10260
|
+
super.setStyle(a.style, n);
|
|
10188
10261
|
} catch (s) {
|
|
10189
|
-
|
|
10262
|
+
console.error("[Map.setStyle]: Error while setting style:", s);
|
|
10190
10263
|
}
|
|
10191
10264
|
return this;
|
|
10192
10265
|
}
|
|
@@ -10687,16 +10760,16 @@ function Ru(r) {
|
|
|
10687
10760
|
times: n
|
|
10688
10761
|
};
|
|
10689
10762
|
}
|
|
10690
|
-
function
|
|
10763
|
+
function Et(r) {
|
|
10691
10764
|
const e = ["Polygon", "LineString", "Point", "Track", "gx:Track"];
|
|
10692
10765
|
let t, n, a, o, i;
|
|
10693
10766
|
const s = [], l = [];
|
|
10694
10767
|
if (E(r, "MultiGeometry") !== null)
|
|
10695
|
-
return
|
|
10768
|
+
return Et(E(r, "MultiGeometry"));
|
|
10696
10769
|
if (E(r, "MultiTrack") !== null)
|
|
10697
|
-
return
|
|
10770
|
+
return Et(E(r, "MultiTrack"));
|
|
10698
10771
|
if (E(r, "gx:MultiTrack") !== null)
|
|
10699
|
-
return
|
|
10772
|
+
return Et(E(r, "gx:MultiTrack"));
|
|
10700
10773
|
for (a = 0; a < e.length; a++)
|
|
10701
10774
|
if (n = G(r, e[a]), n) {
|
|
10702
10775
|
for (o = 0; o < n.length; o++)
|
|
@@ -10729,7 +10802,7 @@ function Lt(r) {
|
|
|
10729
10802
|
return { geoms: s, coordTimes: l };
|
|
10730
10803
|
}
|
|
10731
10804
|
function zu(r, e, t, n) {
|
|
10732
|
-
const a =
|
|
10805
|
+
const a = Et(r), o = {}, i = O(E(r, "name")), s = O(E(r, "address")), l = O(E(r, "description")), u = E(r, "TimeSpan"), c = E(r, "TimeStamp"), p = E(r, "ExtendedData"), f = E(r, "visibility");
|
|
10733
10806
|
let d, h = O(E(r, "styleUrl")), y = E(r, "LineStyle"), m = E(r, "PolyStyle");
|
|
10734
10807
|
if (!a.geoms.length) return [];
|
|
10735
10808
|
if (i && (o.name = i), s && (o.address = s), h) {
|
|
@@ -10986,13 +11059,13 @@ const zr = [
|
|
|
10986
11059
|
// https://colorhunt.co/palette/10a19d540375ff7000ffbf00
|
|
10987
11060
|
["#10A19D", "#540375", "#FF7000", "#FFBF00"]
|
|
10988
11061
|
];
|
|
10989
|
-
function
|
|
11062
|
+
function er() {
|
|
10990
11063
|
return zr[~~(Math.random() * zr.length)][~~(Math.random() * 4)];
|
|
10991
11064
|
}
|
|
10992
|
-
function
|
|
11065
|
+
function yt() {
|
|
10993
11066
|
return `maptiler_source_${da()}`;
|
|
10994
11067
|
}
|
|
10995
|
-
function
|
|
11068
|
+
function mt() {
|
|
10996
11069
|
return `maptiler_layer_${da()}`;
|
|
10997
11070
|
}
|
|
10998
11071
|
function Fr(r, e) {
|
|
@@ -11101,12 +11174,12 @@ function yo(r, e = 10) {
|
|
|
11101
11174
|
}).flat()
|
|
11102
11175
|
];
|
|
11103
11176
|
}
|
|
11104
|
-
function
|
|
11177
|
+
function kt(r) {
|
|
11105
11178
|
const e = r.toString(16);
|
|
11106
11179
|
return e.length === 1 ? `0${e}` : e;
|
|
11107
11180
|
}
|
|
11108
11181
|
function Bu(r) {
|
|
11109
|
-
return `#${
|
|
11182
|
+
return `#${kt(r[0])}${kt(r[1])}${kt(r[2])}${r.length === 4 ? kt(r[3]) : ""}`;
|
|
11110
11183
|
}
|
|
11111
11184
|
class C extends Array {
|
|
11112
11185
|
constructor(t = {}) {
|
|
@@ -12048,7 +12121,7 @@ async function qu(r, e, t = {}) {
|
|
|
12048
12121
|
throw new Error("Creating a polyline layer requires an existing .sourceId or a valid .data property");
|
|
12049
12122
|
let n = e.data;
|
|
12050
12123
|
if (typeof n == "string") {
|
|
12051
|
-
if (
|
|
12124
|
+
if (Ot(n))
|
|
12052
12125
|
n = `https://api.maptiler.com/data/${e.data}/features.json?key=${D.apiKey}`;
|
|
12053
12126
|
else if (((a = n.split(".").pop()) == null ? void 0 : a.toLowerCase().trim()) === "gpx") {
|
|
12054
12127
|
const s = await (await fetch(n, t)).text();
|
|
@@ -12071,7 +12144,7 @@ async function qu(r, e, t = {}) {
|
|
|
12071
12144
|
function Gu(r, e) {
|
|
12072
12145
|
if (e.layerId && r.getLayer(e.layerId))
|
|
12073
12146
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
12074
|
-
const t = e.sourceId ??
|
|
12147
|
+
const t = e.sourceId ?? yt(), n = e.layerId ?? mt(), a = {
|
|
12075
12148
|
polylineLayerId: n,
|
|
12076
12149
|
polylineOutlineLayerId: "",
|
|
12077
12150
|
polylineSourceId: t
|
|
@@ -12080,7 +12153,7 @@ function Gu(r, e) {
|
|
|
12080
12153
|
type: "geojson",
|
|
12081
12154
|
data: e.data
|
|
12082
12155
|
});
|
|
12083
|
-
const o = e.lineWidth ?? 3, i = e.lineColor ??
|
|
12156
|
+
const o = e.lineWidth ?? 3, i = e.lineColor ?? er(), s = e.lineOpacity ?? 1, l = e.lineBlur ?? 0, u = e.lineGapWidth ?? 0;
|
|
12084
12157
|
let c = e.lineDashArray ?? null;
|
|
12085
12158
|
const p = e.outlineWidth ?? 1, f = e.outlineColor ?? "#FFFFFF", d = e.outlineOpacity ?? 1, h = e.outlineBlur ?? 0;
|
|
12086
12159
|
if (typeof c == "string" && (c = fn(c)), e.outline === !0) {
|
|
@@ -12137,20 +12210,20 @@ function Gu(r, e) {
|
|
|
12137
12210
|
function Vu(r, e) {
|
|
12138
12211
|
if (e.layerId && r.getLayer(e.layerId))
|
|
12139
12212
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
12140
|
-
const t = e.sourceId ??
|
|
12213
|
+
const t = e.sourceId ?? yt(), n = e.layerId ?? mt(), a = {
|
|
12141
12214
|
polygonLayerId: n,
|
|
12142
12215
|
polygonOutlineLayerId: e.outline ? `${n}_outline` : "",
|
|
12143
12216
|
polygonSourceId: t
|
|
12144
12217
|
};
|
|
12145
12218
|
if (e.data && !r.getSource(t)) {
|
|
12146
12219
|
let y = e.data;
|
|
12147
|
-
typeof y == "string" &&
|
|
12220
|
+
typeof y == "string" && Ot(y) && (y = `https://api.maptiler.com/data/${y}/features.json?key=${D.apiKey}`), r.addSource(t, {
|
|
12148
12221
|
type: "geojson",
|
|
12149
12222
|
data: y
|
|
12150
12223
|
});
|
|
12151
12224
|
}
|
|
12152
12225
|
let o = e.outlineDashArray ?? null;
|
|
12153
|
-
const i = e.outlineWidth ?? 1, s = e.outlineColor ?? "#FFFFFF", l = e.outlineOpacity ?? 1, u = e.outlineBlur ?? 0, c = e.fillColor ??
|
|
12226
|
+
const i = e.outlineWidth ?? 1, s = e.outlineColor ?? "#FFFFFF", l = e.outlineOpacity ?? 1, u = e.outlineBlur ?? 0, c = e.fillColor ?? er(), p = e.fillOpacity ?? 1, f = e.outlinePosition ?? "center", d = e.pattern ?? null;
|
|
12154
12227
|
typeof o == "string" && (o = fn(o));
|
|
12155
12228
|
const h = (y = null) => {
|
|
12156
12229
|
if (r.addLayer(
|
|
@@ -12220,7 +12293,7 @@ function Vu(r, e) {
|
|
|
12220
12293
|
function Hu(r, e) {
|
|
12221
12294
|
if (e.layerId && r.getLayer(e.layerId))
|
|
12222
12295
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
12223
|
-
const t = e.minPointRadius ?? 10, n = e.maxPointRadius ?? 50, a = e.cluster ?? !1, o = 20, i = Array.isArray(e.pointColor) ? e.pointColor : mo.TURBO.scale(10, e.cluster ? 1e4 : 1e3).resample("ease-out-square"), s = i.getBounds(), l = e.sourceId ??
|
|
12296
|
+
const t = e.minPointRadius ?? 10, n = e.maxPointRadius ?? 50, a = e.cluster ?? !1, o = 20, i = Array.isArray(e.pointColor) ? e.pointColor : mo.TURBO.scale(10, e.cluster ? 1e4 : 1e3).resample("ease-out-square"), s = i.getBounds(), l = e.sourceId ?? yt(), u = e.layerId ?? mt(), c = e.showLabel ?? a, p = e.alignOnViewport ?? !0, f = e.outline ?? !1, d = e.outlineOpacity ?? 1, h = e.outlineWidth ?? 1, y = e.outlineColor ?? "#FFFFFF";
|
|
12224
12297
|
let m;
|
|
12225
12298
|
const w = e.zoomCompensation ?? !0, v = e.minzoom ?? 0, x = e.maxzoom ?? 23;
|
|
12226
12299
|
typeof e.pointOpacity == "number" ? m = e.pointOpacity : Array.isArray(e.pointOpacity) ? m = z(e.pointOpacity) : e.cluster ? m = jr(i, "point_count") : e.property ? m = jr(i, e.property) : m = z([
|
|
@@ -12237,7 +12310,7 @@ function Hu(r, e) {
|
|
|
12237
12310
|
};
|
|
12238
12311
|
if (e.data && !r.getSource(l)) {
|
|
12239
12312
|
let L = e.data;
|
|
12240
|
-
typeof L == "string" &&
|
|
12313
|
+
typeof L == "string" && Ot(L) && (L = `https://api.maptiler.com/data/${L}/features.json?key=${D.apiKey}`), r.addSource(l, {
|
|
12241
12314
|
type: "geojson",
|
|
12242
12315
|
data: L,
|
|
12243
12316
|
cluster: a
|
|
@@ -12246,11 +12319,11 @@ function Hu(r, e) {
|
|
|
12246
12319
|
if (a) {
|
|
12247
12320
|
A.clusterLayerId = `${u}_cluster`;
|
|
12248
12321
|
const L = Array.from({ length: o }, ($, Te) => {
|
|
12249
|
-
const
|
|
12322
|
+
const Ze = s.min + Te * (s.max - s.min) / (o - 1);
|
|
12250
12323
|
return {
|
|
12251
|
-
value:
|
|
12324
|
+
value: Ze,
|
|
12252
12325
|
pointRadius: t + (n - t) * (Te / (o - 1)) ** 0.5,
|
|
12253
|
-
color: i.getColorHex(
|
|
12326
|
+
color: i.getColorHex(Ze)
|
|
12254
12327
|
};
|
|
12255
12328
|
});
|
|
12256
12329
|
r.addLayer(
|
|
@@ -12303,7 +12376,7 @@ function Hu(r, e) {
|
|
|
12303
12376
|
e.beforeId
|
|
12304
12377
|
);
|
|
12305
12378
|
} else {
|
|
12306
|
-
let L = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) :
|
|
12379
|
+
let L = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) : er(), $ = typeof e.pointRadius == "number" ? w ? z([
|
|
12307
12380
|
{ zoom: 0, value: e.pointRadius * 0.025 },
|
|
12308
12381
|
{ zoom: 2, value: e.pointRadius * 0.05 },
|
|
12309
12382
|
{ zoom: 4, value: e.pointRadius * 0.1 },
|
|
@@ -12317,12 +12390,12 @@ function Hu(r, e) {
|
|
|
12317
12390
|
{ zoom: 16, value: t * 1 }
|
|
12318
12391
|
]) : t;
|
|
12319
12392
|
if (e.property && Array.isArray(e.pointColor)) {
|
|
12320
|
-
const Te = Array.from({ length: o }, (
|
|
12321
|
-
const
|
|
12393
|
+
const Te = Array.from({ length: o }, (Ze, gt) => {
|
|
12394
|
+
const vt = s.min + gt * (s.max - s.min) / (o - 1);
|
|
12322
12395
|
return {
|
|
12323
|
-
value:
|
|
12324
|
-
pointRadius: typeof e.pointRadius == "number" ? e.pointRadius : t + (n - t) * (
|
|
12325
|
-
color: typeof e.pointColor == "string" ? e.pointColor : i.getColorHex(
|
|
12396
|
+
value: vt,
|
|
12397
|
+
pointRadius: typeof e.pointRadius == "number" ? e.pointRadius : t + (n - t) * (gt / (o - 1)) ** 0.5,
|
|
12398
|
+
color: typeof e.pointColor == "string" ? e.pointColor : i.getColorHex(vt)
|
|
12326
12399
|
};
|
|
12327
12400
|
});
|
|
12328
12401
|
L = $r(Te, e.property), $ = Or(Te, e.property, w);
|
|
@@ -12387,7 +12460,7 @@ function Hu(r, e) {
|
|
|
12387
12460
|
function Ku(r, e) {
|
|
12388
12461
|
if (e.layerId && r.getLayer(e.layerId))
|
|
12389
12462
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
12390
|
-
const t = e.sourceId ??
|
|
12463
|
+
const t = e.sourceId ?? yt(), n = e.layerId ?? mt(), a = e.minzoom ?? 0, o = e.maxzoom ?? 23, i = e.zoomCompensation ?? !0, s = e.opacity ?? [
|
|
12391
12464
|
{ zoom: a, value: 0 },
|
|
12392
12465
|
{ zoom: a + 0.25, value: 1 },
|
|
12393
12466
|
{ zoom: o - 0.25, value: 1 },
|
|
@@ -12418,7 +12491,7 @@ function Ku(r, e) {
|
|
|
12418
12491
|
};
|
|
12419
12492
|
if (e.data && !r.getSource(t)) {
|
|
12420
12493
|
let v = e.data;
|
|
12421
|
-
typeof v == "string" &&
|
|
12494
|
+
typeof v == "string" && Ot(v) && (v = `https://api.maptiler.com/data/${v}/features.json?key=${D.apiKey}`), r.addSource(t, {
|
|
12422
12495
|
type: "geojson",
|
|
12423
12496
|
data: v
|
|
12424
12497
|
});
|
|
@@ -12451,9 +12524,9 @@ const xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
12451
12524
|
colorPalettes: zr,
|
|
12452
12525
|
computeRampedOutlineWidth: po,
|
|
12453
12526
|
dashArrayMaker: fn,
|
|
12454
|
-
generateRandomLayerName:
|
|
12455
|
-
generateRandomSourceName:
|
|
12456
|
-
getRandomColor:
|
|
12527
|
+
generateRandomLayerName: mt,
|
|
12528
|
+
generateRandomSourceName: yt,
|
|
12529
|
+
getRandomColor: er,
|
|
12457
12530
|
heatmapIntensityFromColorRamp: yo,
|
|
12458
12531
|
lerpZoomNumberValues: Fr,
|
|
12459
12532
|
opacityDrivenByProperty: jr,
|
|
@@ -12466,9 +12539,9 @@ const xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
12466
12539
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12467
12540
|
qo();
|
|
12468
12541
|
function kc() {
|
|
12469
|
-
return "3.4.
|
|
12542
|
+
return "3.4.1-rc2";
|
|
12470
12543
|
}
|
|
12471
|
-
const Cc = k.Map, Lc = k.Marker, Ac = k.Popup, Ec = k.Style, Tc = k.CanvasSource, _c = k.GeoJSONSource,
|
|
12544
|
+
const Cc = k.Map, Lc = k.Marker, Ac = k.Popup, Ec = k.Style, Tc = k.CanvasSource, _c = k.GeoJSONSource, Ic = k.ImageSource, Mc = k.RasterTileSource, Pc = k.RasterDEMTileSource, Rc = k.VectorTileSource, zc = k.VideoSource, Fc = k.NavigationControl, $c = k.GeolocateControl, Oc = k.AttributionControl, jc = k.LogoControl, Nc = k.ScaleControl, Dc = k.FullscreenControl, Uc = k.TerrainControl, Bc = k.BoxZoomHandler, qc = k.ScrollZoomHandler, Gc = k.CooperativeGesturesHandler, Vc = k.KeyboardHandler, Hc = k.TwoFingersTouchPitchHandler, Kc = k.MapWheelEvent, Xc = k.MapTouchEvent, Wc = k.MapMouseEvent, Zc = k.config, Yc = k.getVersion, {
|
|
12472
12545
|
setRTLTextPlugin: Jc,
|
|
12473
12546
|
getRTLTextPluginStatus: Qc,
|
|
12474
12547
|
LngLat: ep,
|
|
@@ -12510,9 +12583,9 @@ export {
|
|
|
12510
12583
|
mo as ColorRampCollection,
|
|
12511
12584
|
mc as CooperativeGesturesHandler,
|
|
12512
12585
|
Gc as CooperativeGesturesHandlerMLGL,
|
|
12513
|
-
|
|
12586
|
+
Me as CubemapFaceNames,
|
|
12514
12587
|
mu as CubemapImagesPresets,
|
|
12515
|
-
|
|
12588
|
+
wr as CubemapLayer,
|
|
12516
12589
|
ge as DOMcreate,
|
|
12517
12590
|
ln as DOMremove,
|
|
12518
12591
|
dp as DoubleClickZoomHandler,
|
|
@@ -12526,10 +12599,10 @@ export {
|
|
|
12526
12599
|
_c as GeoJSONSourceMLGL,
|
|
12527
12600
|
ri as GeolocateControl,
|
|
12528
12601
|
$c as GeolocateControlMLGL,
|
|
12529
|
-
|
|
12602
|
+
Iu as GeolocationType,
|
|
12530
12603
|
sp as Hash,
|
|
12531
12604
|
sc as ImageSource,
|
|
12532
|
-
|
|
12605
|
+
Ic as ImageSourceMLGL,
|
|
12533
12606
|
gc as KeyboardHandler,
|
|
12534
12607
|
Vc as KeyboardHandlerMLGL,
|
|
12535
12608
|
R as Language,
|
|
@@ -12537,7 +12610,7 @@ export {
|
|
|
12537
12610
|
tp as LngLatBounds,
|
|
12538
12611
|
ni as LogoControl,
|
|
12539
12612
|
jc as LogoControlMLGL,
|
|
12540
|
-
|
|
12613
|
+
Mu as Map,
|
|
12541
12614
|
Cc as MapMLGL,
|
|
12542
12615
|
Sc as MapMouseEvent,
|
|
12543
12616
|
Wc as MapMouseEventMLGL,
|
|
@@ -12560,18 +12633,18 @@ export {
|
|
|
12560
12633
|
lp as Point,
|
|
12561
12634
|
nc as Popup,
|
|
12562
12635
|
Ac as PopupMLGL,
|
|
12563
|
-
|
|
12636
|
+
Sr as RadialGradientLayer,
|
|
12564
12637
|
uc as RasterDEMTileSource,
|
|
12565
12638
|
Pc as RasterDEMTileSourceMLGL,
|
|
12566
12639
|
lc as RasterTileSource,
|
|
12567
|
-
|
|
12568
|
-
|
|
12640
|
+
Mc as RasterTileSourceMLGL,
|
|
12641
|
+
Ip as ReferenceMapStyle,
|
|
12569
12642
|
ai as ScaleControl,
|
|
12570
12643
|
Nc as ScaleControlMLGL,
|
|
12571
12644
|
yc as ScrollZoomHandler,
|
|
12572
12645
|
qc as ScrollZoomHandlerMLGL,
|
|
12573
12646
|
$o as SdkConfig,
|
|
12574
|
-
|
|
12647
|
+
Mp as ServiceError,
|
|
12575
12648
|
ac as Style,
|
|
12576
12649
|
Ec as StyleMLGL,
|
|
12577
12650
|
Uc as TerrainControMLGL,
|
|
@@ -12594,7 +12667,7 @@ export {
|
|
|
12594
12667
|
D as config,
|
|
12595
12668
|
Zc as configMLGL,
|
|
12596
12669
|
Fp as coordinates,
|
|
12597
|
-
|
|
12670
|
+
Ge as cubemapPresets,
|
|
12598
12671
|
$p as data,
|
|
12599
12672
|
ec as displayWebGLContextLostWarning,
|
|
12600
12673
|
Op as elevation,
|