@carto/ps-react-maps 1.3.4 → 1.4.0

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.
Files changed (27) hide show
  1. package/dist/index.cjs +10 -10
  2. package/dist/index.js +1096 -543
  3. package/dist/types/assets/icons/ruler.d.ts +2 -0
  4. package/dist/types/common-stories/maps/deckgl-maps.component.d.ts +2 -0
  5. package/dist/types/common-stories/maps/google-maps.component.d.ts +3 -0
  6. package/dist/types/common-stories/maps/map-container.component.d.ts +4 -0
  7. package/dist/types/common-stories/maps/map.component.d.ts +2 -0
  8. package/dist/types/index.d.ts +1 -0
  9. package/dist/types/map-measurement-tool/custom-editable-geojson-layer.class.d.ts +10 -0
  10. package/dist/types/map-measurement-tool/custom-measurement-distance-mode.class.d.ts +6 -0
  11. package/dist/types/map-measurement-tool/index.d.ts +9 -0
  12. package/dist/types/map-measurement-tool/map-measurement-tool.component.d.ts +6 -0
  13. package/dist/types/map-measurement-tool/map-measurement-tool.const.d.ts +43 -0
  14. package/dist/types/map-measurement-tool/map-measurement-tool.context.d.ts +5 -0
  15. package/dist/types/map-measurement-tool/map-measurement-tool.hook.d.ts +10 -0
  16. package/dist/types/map-measurement-tool/map-measurement-tool.layer.d.ts +10 -0
  17. package/dist/types/map-measurement-tool/map-measurement-tool.provider.d.ts +8 -0
  18. package/dist/types/map-measurement-tool/map-measurement-tool.reducer.d.ts +14 -0
  19. package/dist/types/map-measurement-tool/map-measurement-tool.styles.d.ts +28 -0
  20. package/dist/types/map-measurement-tool/map-measurement-tool.types.d.ts +88 -0
  21. package/dist/types/map-measurement-tool/map-measurement-tool.util.d.ts +7 -0
  22. package/dist/types/map-provider/map-provider.context.d.ts +1 -0
  23. package/dist/types/utils/get-map-type/get-map-type.d.ts +1 -0
  24. package/dist/types/utils/get-map-type/index.d.ts +2 -0
  25. package/dist/types/utils/get-map-type/is-gmaps.d.ts +1 -0
  26. package/dist/types/utils/index.d.ts +1 -0
  27. package/package.json +16 -7
package/dist/index.js CHANGED
@@ -1,24 +1,28 @@
1
- import Ue, { createContext as se, useContext as ue, useCallback as P, useReducer as Tr, useRef as Fe } from "react";
2
- var wr = /* @__PURE__ */ ((r) => (r.Roadmap = "roadmap", r.Satellite = "satellite", r.Hybrid = "hybrid", r))(wr || {}), Cr = /* @__PURE__ */ ((r) => (r.DarkMatter = "dark-matter", r.Positron = "positron", r.Voyager = "voyager", r))(Cr || {});
3
- const ae = {
1
+ import rt, { createContext as ee, useContext as te, useCallback as M, useReducer as nt, useRef as ce, useMemo as Jt, useEffect as at } from "react";
2
+ import { EditableGeoJsonLayer as Kt } from "@nebula.gl/layers";
3
+ import { MeasureDistanceMode as Xt } from "@nebula.gl/edit-modes";
4
+ import { EventManager as Qt } from "mjolnir.js";
5
+ import er from "convert-units";
6
+ var tr = /* @__PURE__ */ ((t) => (t.Roadmap = "roadmap", t.Satellite = "satellite", t.Hybrid = "hybrid", t))(tr || {}), rr = /* @__PURE__ */ ((t) => (t.DarkMatter = "dark-matter", t.Positron = "positron", t.Voyager = "voyager", t))(rr || {});
7
+ const ye = {
4
8
  positron: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",
5
9
  voyager: "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",
6
10
  "dark-matter": "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
7
11
  };
8
- var Or = /* @__PURE__ */ ((r) => (r.Maplibre = "maplibre", r.GoogleMaps = "google-maps", r))(Or || {});
9
- const Ae = {
12
+ var ot = /* @__PURE__ */ ((t) => (t.Maplibre = "maplibre", t.GoogleMaps = "google-maps", t))(ot || {});
13
+ const he = {
10
14
  positron: {
11
- url: ae.positron,
15
+ url: ye.positron,
12
16
  type: "maplibre"
13
17
  /* Maplibre */
14
18
  },
15
19
  voyager: {
16
- url: ae.voyager,
20
+ url: ye.voyager,
17
21
  type: "maplibre"
18
22
  /* Maplibre */
19
23
  },
20
24
  "dark-matter": {
21
- url: ae[
25
+ url: ye[
22
26
  "dark-matter"
23
27
  /* DarkMatter */
24
28
  ],
@@ -37,9 +41,9 @@ const Ae = {
37
41
  type: "google-maps"
38
42
  /* GoogleMaps */
39
43
  }
40
- }, V = () => {
44
+ }, z = () => {
41
45
  throw new Error("You forgot to wrap your component in <MapProvider>.");
42
- }, B = {
46
+ }, K = {
43
47
  state: {
44
48
  maps: {}
45
49
  // sync: false,
@@ -49,134 +53,137 @@ const Ae = {
49
53
  },
50
54
  actions: {
51
55
  // toggleSync: stub,
52
- setViewState: V,
53
- setBasemap: V,
54
- setResize: V,
55
- setZoom: V,
56
- setLoaded: V
56
+ setViewState: z,
57
+ setBasemap: z,
58
+ setResize: z,
59
+ setZoom: z,
60
+ setLoaded: z
57
61
  }
58
- }, Ne = se(
59
- B.state
60
- ), Ve = se(B.references), Ye = se(
61
- B.actions
62
+ }, it = ee(
63
+ K.state
64
+ ), st = ee(K.references), ct = ee(
65
+ K.actions
62
66
  );
63
- var F = /* @__PURE__ */ ((r) => (r.SetViewState = "SetViewState", r.SetBasemap = "SetBasemap", r.SetResize = "SetResize", r.SetZoom = "SetZoom", r.SetLoaded = "SetLoaded", r))(F || {});
64
- function Pr(r, { type: u, payload: d }) {
67
+ var k = /* @__PURE__ */ ((t) => (t.SetViewState = "SetViewState", t.SetBasemap = "SetBasemap", t.SetResize = "SetResize", t.SetZoom = "SetZoom", t.SetLoaded = "SetLoaded", t))(k || {});
68
+ function nr(t, { type: r, payload: a }) {
65
69
  return {
66
70
  SetViewState: () => {
67
- const { id: o, viewState: y } = d, l = { ...r.maps };
68
- return l[o] = {
69
- ...r.maps[o],
70
- viewState: y
71
+ const { id: o, viewState: l } = a, f = { ...t.maps };
72
+ return f[o] = {
73
+ ...t.maps[o],
74
+ viewState: l
71
75
  }, {
72
- ...r,
73
- maps: l
76
+ ...t,
77
+ maps: f
74
78
  };
75
79
  },
76
80
  SetResize: () => {
77
- const { id: o, width: y, height: l } = d, E = { ...r.maps };
78
- return E[o] = {
79
- ...r.maps[o],
81
+ const { id: o, width: l, height: f } = a, h = { ...t.maps };
82
+ return h[o] = {
83
+ ...t.maps[o],
80
84
  viewState: {
81
- ...r.maps[o].viewState,
82
- width: y,
83
- height: l
85
+ ...t.maps[o].viewState,
86
+ width: l,
87
+ height: f
84
88
  }
85
89
  }, {
86
- ...r,
87
- maps: E
90
+ ...t,
91
+ maps: h
88
92
  };
89
93
  },
90
94
  SetBasemap: () => {
91
- const { id: o, basemap: y } = d, l = { ...r.maps }, { basemap: E } = l[o], s = Ae[E]?.type, R = Ae[y]?.type, g = s === R;
92
- return l[o] = {
93
- ...r.maps[o],
94
- basemap: y,
95
- isLoaded: g
95
+ const { id: o, basemap: l } = a, f = { ...t.maps }, { basemap: h } = f[o], u = he[h]?.type, p = he[l]?.type, y = u === p;
96
+ return f[o] = {
97
+ ...t.maps[o],
98
+ basemap: l,
99
+ isLoaded: y
96
100
  }, {
97
- ...r,
98
- maps: l
101
+ ...t,
102
+ maps: f
99
103
  };
100
104
  },
101
105
  SetZoom: () => {
102
- const { id: o, zoom: y } = d, l = { ...r.maps };
103
- return l[o] = {
104
- ...r.maps[o],
106
+ const { id: o, zoom: l } = a, f = { ...t.maps };
107
+ return f[o] = {
108
+ ...t.maps[o],
105
109
  viewState: {
106
- ...r.maps[o].viewState,
107
- zoom: y
110
+ ...t.maps[o].viewState,
111
+ zoom: l
108
112
  }
109
113
  }, {
110
- ...r,
111
- maps: l
114
+ ...t,
115
+ maps: f
112
116
  };
113
117
  },
114
118
  SetLoaded: () => {
115
- const { id: o, value: y } = d, l = { ...r.maps };
116
- return l[o] = {
117
- ...r.maps[o],
118
- isLoaded: y
119
+ const { id: o, value: l } = a, f = { ...t.maps };
120
+ return f[o] = {
121
+ ...t.maps[o],
122
+ isLoaded: l
119
123
  }, {
120
- ...r,
121
- maps: l
124
+ ...t,
125
+ maps: f
122
126
  };
123
127
  }
124
- }[u]?.() ?? r;
128
+ }[r]?.() ?? t;
125
129
  }
126
- function xr(r) {
127
- return ue(Ne).maps[r];
130
+ function ut(t) {
131
+ return te(it).maps[t];
128
132
  }
129
- function $e(r) {
130
- const u = ue(Ve), { instanceRef: d, overlayRef: h } = u.current[r], o = P(() => {
131
- const R = d?.current;
132
- return R?.deck || R?._deck;
133
- }, [d]), y = P(() => h?.current, [h]), l = P(() => o()?._getViewState(), [o]), E = P(
134
- (R) => o()?.getViewports(R),
133
+ function _e(t) {
134
+ const r = te(st), { instanceRef: a, overlayRef: s } = r.current[t], o = M(() => {
135
+ const p = a?.current;
136
+ return p?.deck || p?._deck;
137
+ }, [a]), l = M(() => s?.current, [s]), f = M(() => o()?._getViewState(), [o]), h = M(
138
+ (p) => o()?.getViewports(p),
135
139
  [o]
136
- ), s = P(
137
- (R = 0, g) => E(g)?.[R],
138
- [E]
140
+ ), u = M(
141
+ (p = 0, y) => h(y)?.[p],
142
+ [h]
139
143
  );
140
144
  return {
141
- instanceRef: d,
142
- overlayRef: h,
145
+ instanceRef: a,
146
+ overlayRef: s,
143
147
  getDeckInstance: o,
144
- getOverlayInstance: y,
145
- getViewState: l,
146
- getViewport: s,
147
- getViewports: E
148
+ getOverlayInstance: l,
149
+ getViewState: f,
150
+ getViewport: u,
151
+ getViewports: h
148
152
  };
149
153
  }
150
- function jr(r) {
151
- const { setBasemap: u, setResize: d, setViewState: h, setZoom: o, setLoaded: y } = ue(Ye), { getViewport: l } = $e(r);
154
+ function ar(t) {
155
+ const { setBasemap: r, setResize: a, setViewState: s, setZoom: o, setLoaded: l } = te(ct), { getViewport: f } = _e(t);
152
156
  return {
153
- setBasemap: (s) => u(s, r),
154
- setResize: (s) => d(s, r),
155
- setViewState: (s) => h(s, r),
156
- setZoom: (s) => o(s, r),
157
- setLoaded: (s) => y(s, r),
158
- fitBounds: (s, {
159
- boundsOptions: R,
160
- viewStateOptions: g
157
+ setBasemap: (u) => r(u, t),
158
+ setResize: (u) => a(u, t),
159
+ setViewState: (u) => s(u, t),
160
+ setZoom: (u) => o(u, t),
161
+ setLoaded: (u) => l(u, t),
162
+ fitBounds: (u, {
163
+ boundsOptions: p,
164
+ viewStateOptions: y
161
165
  } = {}) => {
162
- const T = l(), { latitude: C, longitude: p, zoom: v } = T.fitBounds(
163
- s,
164
- R
166
+ const b = f(), { latitude: O, longitude: v, zoom: E } = b.fitBounds(
167
+ u,
168
+ p
165
169
  );
166
- h({ ...g, latitude: C, longitude: p, zoom: v }, r);
170
+ s({ ...y, latitude: O, longitude: v, zoom: E }, t);
167
171
  }
168
172
  };
169
173
  }
170
- function Yr(r) {
171
- return xr(r);
174
+ function qr(t) {
175
+ return ut(t);
176
+ }
177
+ function Gr(t) {
178
+ return _e(t);
172
179
  }
173
- function $r(r) {
174
- return $e(r);
180
+ function Zr(t) {
181
+ return ar(t);
175
182
  }
176
- function Br(r) {
177
- return jr(r);
183
+ function or(t) {
184
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
178
185
  }
179
- var ie = { exports: {} }, Y = {};
186
+ var Ee = { exports: {} }, q = {};
180
187
  /**
181
188
  * @license React
182
189
  * react-jsx-runtime.production.min.js
@@ -186,25 +193,25 @@ var ie = { exports: {} }, Y = {};
186
193
  * This source code is licensed under the MIT license found in the
187
194
  * LICENSE file in the root directory of this source tree.
188
195
  */
189
- var Me;
190
- function kr() {
191
- if (Me)
192
- return Y;
193
- Me = 1;
194
- var r = Ue, u = Symbol.for("react.element"), d = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, o = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
195
- function l(E, s, R) {
196
- var g, T = {}, C = null, p = null;
197
- R !== void 0 && (C = "" + R), s.key !== void 0 && (C = "" + s.key), s.ref !== void 0 && (p = s.ref);
198
- for (g in s)
199
- h.call(s, g) && !y.hasOwnProperty(g) && (T[g] = s[g]);
200
- if (E && E.defaultProps)
201
- for (g in s = E.defaultProps, s)
202
- T[g] === void 0 && (T[g] = s[g]);
203
- return { $$typeof: u, type: E, key: C, ref: p, props: T, _owner: o.current };
196
+ var Ze;
197
+ function ir() {
198
+ if (Ze)
199
+ return q;
200
+ Ze = 1;
201
+ var t = rt, r = Symbol.for("react.element"), a = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, o = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
202
+ function f(h, u, p) {
203
+ var y, b = {}, O = null, v = null;
204
+ p !== void 0 && (O = "" + p), u.key !== void 0 && (O = "" + u.key), u.ref !== void 0 && (v = u.ref);
205
+ for (y in u)
206
+ s.call(u, y) && !l.hasOwnProperty(y) && (b[y] = u[y]);
207
+ if (h && h.defaultProps)
208
+ for (y in u = h.defaultProps, u)
209
+ b[y] === void 0 && (b[y] = u[y]);
210
+ return { $$typeof: r, type: h, key: O, ref: v, props: b, _owner: o.current };
204
211
  }
205
- return Y.Fragment = d, Y.jsx = l, Y.jsxs = l, Y;
212
+ return q.Fragment = a, q.jsx = f, q.jsxs = f, q;
206
213
  }
207
- var $ = {};
214
+ var G = {};
208
215
  /**
209
216
  * @license React
210
217
  * react-jsx-runtime.development.js
@@ -214,54 +221,54 @@ var $ = {};
214
221
  * This source code is licensed under the MIT license found in the
215
222
  * LICENSE file in the root directory of this source tree.
216
223
  */
217
- var Le;
218
- function Dr() {
219
- return Le || (Le = 1, process.env.NODE_ENV !== "production" && function() {
220
- var r = Ue, u = Symbol.for("react.element"), d = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), E = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), v = Symbol.iterator, k = "@@iterator";
221
- function W(e) {
224
+ var Je;
225
+ function sr() {
226
+ return Je || (Je = 1, process.env.NODE_ENV !== "production" && function() {
227
+ var t = rt, r = Symbol.for("react.element"), a = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), h = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), v = Symbol.for("react.offscreen"), E = Symbol.iterator, x = "@@iterator";
228
+ function U(e) {
222
229
  if (e === null || typeof e != "object")
223
230
  return null;
224
- var t = v && e[v] || e[k];
225
- return typeof t == "function" ? t : null;
231
+ var n = E && e[E] || e[x];
232
+ return typeof n == "function" ? n : null;
226
233
  }
227
- var D = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
234
+ var j = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
228
235
  function S(e) {
229
236
  {
230
- for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), a = 1; a < t; a++)
231
- n[a - 1] = arguments[a];
232
- ze("error", e, n);
237
+ for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), c = 1; c < n; c++)
238
+ i[c - 1] = arguments[c];
239
+ Te("error", e, i);
233
240
  }
234
241
  }
235
- function ze(e, t, n) {
242
+ function Te(e, n, i) {
236
243
  {
237
- var a = D.ReactDebugCurrentFrame, f = a.getStackAddendum();
238
- f !== "" && (t += "%s", n = n.concat([f]));
239
- var m = n.map(function(c) {
240
- return String(c);
244
+ var c = j.ReactDebugCurrentFrame, g = c.getStackAddendum();
245
+ g !== "" && (n += "%s", i = i.concat([g]));
246
+ var _ = i.map(function(m) {
247
+ return String(m);
241
248
  });
242
- m.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, m);
249
+ _.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, _);
243
250
  }
244
251
  }
245
- var Ze = !1, qe = !1, He = !1, Je = !1, Ge = !1, ce;
246
- ce = Symbol.for("react.module.reference");
247
- function Ke(e) {
248
- return !!(typeof e == "string" || typeof e == "function" || e === h || e === y || Ge || e === o || e === R || e === g || Je || e === p || Ze || qe || He || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === T || e.$$typeof === l || e.$$typeof === E || e.$$typeof === s || // This needs to include all possible module reference object
252
+ var F = !1, L = !1, bt = !1, _t = !1, St = !1, Me;
253
+ Me = Symbol.for("react.module.reference");
254
+ function Rt(e) {
255
+ return !!(typeof e == "string" || typeof e == "function" || e === s || e === l || St || e === o || e === p || e === y || _t || e === v || F || L || bt || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === b || e.$$typeof === f || e.$$typeof === h || e.$$typeof === u || // This needs to include all possible module reference object
249
256
  // types supported by any Flight configuration anywhere since
250
257
  // we don't know which Flight build this will end up being used
251
258
  // with.
252
- e.$$typeof === ce || e.getModuleId !== void 0));
259
+ e.$$typeof === Me || e.getModuleId !== void 0));
253
260
  }
254
- function Xe(e, t, n) {
255
- var a = e.displayName;
256
- if (a)
257
- return a;
258
- var f = t.displayName || t.name || "";
259
- return f !== "" ? n + "(" + f + ")" : n;
261
+ function Tt(e, n, i) {
262
+ var c = e.displayName;
263
+ if (c)
264
+ return c;
265
+ var g = n.displayName || n.name || "";
266
+ return g !== "" ? i + "(" + g + ")" : i;
260
267
  }
261
- function le(e) {
268
+ function Oe(e) {
262
269
  return e.displayName || "Context";
263
270
  }
264
- function x(e) {
271
+ function A(e) {
265
272
  if (e == null)
266
273
  return null;
267
274
  if (typeof e.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
@@ -269,36 +276,36 @@ function Dr() {
269
276
  if (typeof e == "string")
270
277
  return e;
271
278
  switch (e) {
272
- case h:
279
+ case s:
273
280
  return "Fragment";
274
- case d:
281
+ case a:
275
282
  return "Portal";
276
- case y:
283
+ case l:
277
284
  return "Profiler";
278
285
  case o:
279
286
  return "StrictMode";
280
- case R:
287
+ case p:
281
288
  return "Suspense";
282
- case g:
289
+ case y:
283
290
  return "SuspenseList";
284
291
  }
285
292
  if (typeof e == "object")
286
293
  switch (e.$$typeof) {
287
- case E:
288
- var t = e;
289
- return le(t) + ".Consumer";
290
- case l:
294
+ case h:
291
295
  var n = e;
292
- return le(n._context) + ".Provider";
293
- case s:
294
- return Xe(e, e.render, "ForwardRef");
295
- case T:
296
- var a = e.displayName || null;
297
- return a !== null ? a : x(e.type) || "Memo";
298
- case C: {
299
- var f = e, m = f._payload, c = f._init;
296
+ return Oe(n) + ".Consumer";
297
+ case f:
298
+ var i = e;
299
+ return Oe(i._context) + ".Provider";
300
+ case u:
301
+ return Tt(e, e.render, "ForwardRef");
302
+ case b:
303
+ var c = e.displayName || null;
304
+ return c !== null ? c : A(e.type) || "Memo";
305
+ case O: {
306
+ var g = e, _ = g._payload, m = g._init;
300
307
  try {
301
- return x(c(m));
308
+ return A(m(_));
302
309
  } catch {
303
310
  return null;
304
311
  }
@@ -306,18 +313,18 @@ function Dr() {
306
313
  }
307
314
  return null;
308
315
  }
309
- var M = Object.assign, U = 0, fe, de, pe, ve, me, ye, ge;
310
- function Re() {
316
+ var I = Object.assign, W = 0, Pe, Ce, we, xe, je, Ae, De;
317
+ function Fe() {
311
318
  }
312
- Re.__reactDisabledLog = !0;
313
- function Qe() {
319
+ Fe.__reactDisabledLog = !0;
320
+ function Mt() {
314
321
  {
315
- if (U === 0) {
316
- fe = console.log, de = console.info, pe = console.warn, ve = console.error, me = console.group, ye = console.groupCollapsed, ge = console.groupEnd;
322
+ if (W === 0) {
323
+ Pe = console.log, Ce = console.info, we = console.warn, xe = console.error, je = console.group, Ae = console.groupCollapsed, De = console.groupEnd;
317
324
  var e = {
318
325
  configurable: !0,
319
326
  enumerable: !0,
320
- value: Re,
327
+ value: Fe,
321
328
  writable: !0
322
329
  };
323
330
  Object.defineProperties(console, {
@@ -330,336 +337,336 @@ function Dr() {
330
337
  groupEnd: e
331
338
  });
332
339
  }
333
- U++;
340
+ W++;
334
341
  }
335
342
  }
336
- function er() {
343
+ function Ot() {
337
344
  {
338
- if (U--, U === 0) {
345
+ if (W--, W === 0) {
339
346
  var e = {
340
347
  configurable: !0,
341
348
  enumerable: !0,
342
349
  writable: !0
343
350
  };
344
351
  Object.defineProperties(console, {
345
- log: M({}, e, {
346
- value: fe
352
+ log: I({}, e, {
353
+ value: Pe
347
354
  }),
348
- info: M({}, e, {
349
- value: de
355
+ info: I({}, e, {
356
+ value: Ce
350
357
  }),
351
- warn: M({}, e, {
352
- value: pe
358
+ warn: I({}, e, {
359
+ value: we
353
360
  }),
354
- error: M({}, e, {
355
- value: ve
361
+ error: I({}, e, {
362
+ value: xe
356
363
  }),
357
- group: M({}, e, {
358
- value: me
364
+ group: I({}, e, {
365
+ value: je
359
366
  }),
360
- groupCollapsed: M({}, e, {
361
- value: ye
367
+ groupCollapsed: I({}, e, {
368
+ value: Ae
362
369
  }),
363
- groupEnd: M({}, e, {
364
- value: ge
370
+ groupEnd: I({}, e, {
371
+ value: De
365
372
  })
366
373
  });
367
374
  }
368
- U < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
375
+ W < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
369
376
  }
370
377
  }
371
- var G = D.ReactCurrentDispatcher, K;
372
- function z(e, t, n) {
378
+ var ue = j.ReactCurrentDispatcher, le;
379
+ function re(e, n, i) {
373
380
  {
374
- if (K === void 0)
381
+ if (le === void 0)
375
382
  try {
376
383
  throw Error();
377
- } catch (f) {
378
- var a = f.stack.trim().match(/\n( *(at )?)/);
379
- K = a && a[1] || "";
384
+ } catch (g) {
385
+ var c = g.stack.trim().match(/\n( *(at )?)/);
386
+ le = c && c[1] || "";
380
387
  }
381
388
  return `
382
- ` + K + e;
389
+ ` + le + e;
383
390
  }
384
391
  }
385
- var X = !1, Z;
392
+ var fe = !1, ne;
386
393
  {
387
- var rr = typeof WeakMap == "function" ? WeakMap : Map;
388
- Z = new rr();
394
+ var Pt = typeof WeakMap == "function" ? WeakMap : Map;
395
+ ne = new Pt();
389
396
  }
390
- function Ee(e, t) {
391
- if (!e || X)
397
+ function Le(e, n) {
398
+ if (!e || fe)
392
399
  return "";
393
400
  {
394
- var n = Z.get(e);
395
- if (n !== void 0)
396
- return n;
401
+ var i = ne.get(e);
402
+ if (i !== void 0)
403
+ return i;
397
404
  }
398
- var a;
399
- X = !0;
400
- var f = Error.prepareStackTrace;
405
+ var c;
406
+ fe = !0;
407
+ var g = Error.prepareStackTrace;
401
408
  Error.prepareStackTrace = void 0;
402
- var m;
403
- m = G.current, G.current = null, Qe();
409
+ var _;
410
+ _ = ue.current, ue.current = null, Mt();
404
411
  try {
405
- if (t) {
406
- var c = function() {
412
+ if (n) {
413
+ var m = function() {
407
414
  throw Error();
408
415
  };
409
- if (Object.defineProperty(c.prototype, "props", {
416
+ if (Object.defineProperty(m.prototype, "props", {
410
417
  set: function() {
411
418
  throw Error();
412
419
  }
413
420
  }), typeof Reflect == "object" && Reflect.construct) {
414
421
  try {
415
- Reflect.construct(c, []);
416
- } catch (j) {
417
- a = j;
422
+ Reflect.construct(m, []);
423
+ } catch (D) {
424
+ c = D;
418
425
  }
419
- Reflect.construct(e, [], c);
426
+ Reflect.construct(e, [], m);
420
427
  } else {
421
428
  try {
422
- c.call();
423
- } catch (j) {
424
- a = j;
429
+ m.call();
430
+ } catch (D) {
431
+ c = D;
425
432
  }
426
- e.call(c.prototype);
433
+ e.call(m.prototype);
427
434
  }
428
435
  } else {
429
436
  try {
430
437
  throw Error();
431
- } catch (j) {
432
- a = j;
438
+ } catch (D) {
439
+ c = D;
433
440
  }
434
441
  e();
435
442
  }
436
- } catch (j) {
437
- if (j && a && typeof j.stack == "string") {
438
- for (var i = j.stack.split(`
439
- `), w = a.stack.split(`
440
- `), b = i.length - 1, _ = w.length - 1; b >= 1 && _ >= 0 && i[b] !== w[_]; )
441
- _--;
442
- for (; b >= 1 && _ >= 0; b--, _--)
443
- if (i[b] !== w[_]) {
444
- if (b !== 1 || _ !== 1)
443
+ } catch (D) {
444
+ if (D && c && typeof D.stack == "string") {
445
+ for (var d = D.stack.split(`
446
+ `), P = c.stack.split(`
447
+ `), R = d.length - 1, T = P.length - 1; R >= 1 && T >= 0 && d[R] !== P[T]; )
448
+ T--;
449
+ for (; R >= 1 && T >= 0; R--, T--)
450
+ if (d[R] !== P[T]) {
451
+ if (R !== 1 || T !== 1)
445
452
  do
446
- if (b--, _--, _ < 0 || i[b] !== w[_]) {
447
- var O = `
448
- ` + i[b].replace(" at new ", " at ");
449
- return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && Z.set(e, O), O;
453
+ if (R--, T--, T < 0 || d[R] !== P[T]) {
454
+ var w = `
455
+ ` + d[R].replace(" at new ", " at ");
456
+ return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && ne.set(e, w), w;
450
457
  }
451
- while (b >= 1 && _ >= 0);
458
+ while (R >= 1 && T >= 0);
452
459
  break;
453
460
  }
454
461
  }
455
462
  } finally {
456
- X = !1, G.current = m, er(), Error.prepareStackTrace = f;
463
+ fe = !1, ue.current = _, Ot(), Error.prepareStackTrace = g;
457
464
  }
458
- var I = e ? e.displayName || e.name : "", De = I ? z(I) : "";
459
- return typeof e == "function" && Z.set(e, De), De;
465
+ var $ = e ? e.displayName || e.name : "", Ge = $ ? re($) : "";
466
+ return typeof e == "function" && ne.set(e, Ge), Ge;
460
467
  }
461
- function tr(e, t, n) {
462
- return Ee(e, !1);
468
+ function Ct(e, n, i) {
469
+ return Le(e, !1);
463
470
  }
464
- function nr(e) {
465
- var t = e.prototype;
466
- return !!(t && t.isReactComponent);
471
+ function wt(e) {
472
+ var n = e.prototype;
473
+ return !!(n && n.isReactComponent);
467
474
  }
468
- function q(e, t, n) {
475
+ function ae(e, n, i) {
469
476
  if (e == null)
470
477
  return "";
471
478
  if (typeof e == "function")
472
- return Ee(e, nr(e));
479
+ return Le(e, wt(e));
473
480
  if (typeof e == "string")
474
- return z(e);
481
+ return re(e);
475
482
  switch (e) {
476
- case R:
477
- return z("Suspense");
478
- case g:
479
- return z("SuspenseList");
483
+ case p:
484
+ return re("Suspense");
485
+ case y:
486
+ return re("SuspenseList");
480
487
  }
481
488
  if (typeof e == "object")
482
489
  switch (e.$$typeof) {
483
- case s:
484
- return tr(e.render);
485
- case T:
486
- return q(e.type, t, n);
487
- case C: {
488
- var a = e, f = a._payload, m = a._init;
490
+ case u:
491
+ return Ct(e.render);
492
+ case b:
493
+ return ae(e.type, n, i);
494
+ case O: {
495
+ var c = e, g = c._payload, _ = c._init;
489
496
  try {
490
- return q(m(f), t, n);
497
+ return ae(_(g), n, i);
491
498
  } catch {
492
499
  }
493
500
  }
494
501
  }
495
502
  return "";
496
503
  }
497
- var H = Object.prototype.hasOwnProperty, be = {}, he = D.ReactDebugCurrentFrame;
498
- function J(e) {
504
+ var oe = Object.prototype.hasOwnProperty, ke = {}, Ne = j.ReactDebugCurrentFrame;
505
+ function ie(e) {
499
506
  if (e) {
500
- var t = e._owner, n = q(e.type, e._source, t ? t.type : null);
501
- he.setExtraStackFrame(n);
507
+ var n = e._owner, i = ae(e.type, e._source, n ? n.type : null);
508
+ Ne.setExtraStackFrame(i);
502
509
  } else
503
- he.setExtraStackFrame(null);
510
+ Ne.setExtraStackFrame(null);
504
511
  }
505
- function ar(e, t, n, a, f) {
512
+ function xt(e, n, i, c, g) {
506
513
  {
507
- var m = Function.call.bind(H);
508
- for (var c in e)
509
- if (m(e, c)) {
510
- var i = void 0;
514
+ var _ = Function.call.bind(oe);
515
+ for (var m in e)
516
+ if (_(e, m)) {
517
+ var d = void 0;
511
518
  try {
512
- if (typeof e[c] != "function") {
513
- var w = Error((a || "React class") + ": " + n + " type `" + c + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[c] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
514
- throw w.name = "Invariant Violation", w;
519
+ if (typeof e[m] != "function") {
520
+ var P = Error((c || "React class") + ": " + i + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
521
+ throw P.name = "Invariant Violation", P;
515
522
  }
516
- i = e[c](t, c, a, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
517
- } catch (b) {
518
- i = b;
523
+ d = e[m](n, m, c, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
524
+ } catch (R) {
525
+ d = R;
519
526
  }
520
- i && !(i instanceof Error) && (J(f), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", a || "React class", n, c, typeof i), J(null)), i instanceof Error && !(i.message in be) && (be[i.message] = !0, J(f), S("Failed %s type: %s", n, i.message), J(null));
527
+ d && !(d instanceof Error) && (ie(g), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", c || "React class", i, m, typeof d), ie(null)), d instanceof Error && !(d.message in ke) && (ke[d.message] = !0, ie(g), S("Failed %s type: %s", i, d.message), ie(null));
521
528
  }
522
529
  }
523
530
  }
524
- var or = Array.isArray;
525
- function Q(e) {
526
- return or(e);
531
+ var jt = Array.isArray;
532
+ function de(e) {
533
+ return jt(e);
527
534
  }
528
- function ir(e) {
535
+ function At(e) {
529
536
  {
530
- var t = typeof Symbol == "function" && Symbol.toStringTag, n = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
531
- return n;
537
+ var n = typeof Symbol == "function" && Symbol.toStringTag, i = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
538
+ return i;
532
539
  }
533
540
  }
534
- function sr(e) {
541
+ function Dt(e) {
535
542
  try {
536
- return _e(e), !1;
543
+ return Ie(e), !1;
537
544
  } catch {
538
545
  return !0;
539
546
  }
540
547
  }
541
- function _e(e) {
548
+ function Ie(e) {
542
549
  return "" + e;
543
550
  }
544
- function Se(e) {
545
- if (sr(e))
546
- return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ir(e)), _e(e);
551
+ function Ue(e) {
552
+ if (Dt(e))
553
+ return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", At(e)), Ie(e);
547
554
  }
548
- var N = D.ReactCurrentOwner, ur = {
555
+ var H = j.ReactCurrentOwner, Ft = {
549
556
  key: !0,
550
557
  ref: !0,
551
558
  __self: !0,
552
559
  __source: !0
553
- }, Te, we, ee;
554
- ee = {};
555
- function cr(e) {
556
- if (H.call(e, "ref")) {
557
- var t = Object.getOwnPropertyDescriptor(e, "ref").get;
558
- if (t && t.isReactWarning)
560
+ }, Ve, $e, me;
561
+ me = {};
562
+ function Lt(e) {
563
+ if (oe.call(e, "ref")) {
564
+ var n = Object.getOwnPropertyDescriptor(e, "ref").get;
565
+ if (n && n.isReactWarning)
559
566
  return !1;
560
567
  }
561
568
  return e.ref !== void 0;
562
569
  }
563
- function lr(e) {
564
- if (H.call(e, "key")) {
565
- var t = Object.getOwnPropertyDescriptor(e, "key").get;
566
- if (t && t.isReactWarning)
570
+ function kt(e) {
571
+ if (oe.call(e, "key")) {
572
+ var n = Object.getOwnPropertyDescriptor(e, "key").get;
573
+ if (n && n.isReactWarning)
567
574
  return !1;
568
575
  }
569
576
  return e.key !== void 0;
570
577
  }
571
- function fr(e, t) {
572
- if (typeof e.ref == "string" && N.current && t && N.current.stateNode !== t) {
573
- var n = x(N.current.type);
574
- ee[n] || (S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', x(N.current.type), e.ref), ee[n] = !0);
578
+ function Nt(e, n) {
579
+ if (typeof e.ref == "string" && H.current && n && H.current.stateNode !== n) {
580
+ var i = A(H.current.type);
581
+ me[i] || (S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', A(H.current.type), e.ref), me[i] = !0);
575
582
  }
576
583
  }
577
- function dr(e, t) {
584
+ function It(e, n) {
578
585
  {
579
- var n = function() {
580
- Te || (Te = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
586
+ var i = function() {
587
+ Ve || (Ve = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
581
588
  };
582
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
583
- get: n,
589
+ i.isReactWarning = !0, Object.defineProperty(e, "key", {
590
+ get: i,
584
591
  configurable: !0
585
592
  });
586
593
  }
587
594
  }
588
- function pr(e, t) {
595
+ function Ut(e, n) {
589
596
  {
590
- var n = function() {
591
- we || (we = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
597
+ var i = function() {
598
+ $e || ($e = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
592
599
  };
593
- n.isReactWarning = !0, Object.defineProperty(e, "ref", {
594
- get: n,
600
+ i.isReactWarning = !0, Object.defineProperty(e, "ref", {
601
+ get: i,
595
602
  configurable: !0
596
603
  });
597
604
  }
598
605
  }
599
- var vr = function(e, t, n, a, f, m, c) {
600
- var i = {
606
+ var Vt = function(e, n, i, c, g, _, m) {
607
+ var d = {
601
608
  // This tag allows us to uniquely identify this as a React Element
602
- $$typeof: u,
609
+ $$typeof: r,
603
610
  // Built-in properties that belong on the element
604
611
  type: e,
605
- key: t,
606
- ref: n,
607
- props: c,
612
+ key: n,
613
+ ref: i,
614
+ props: m,
608
615
  // Record the component responsible for creating this element.
609
- _owner: m
616
+ _owner: _
610
617
  };
611
- return i._store = {}, Object.defineProperty(i._store, "validated", {
618
+ return d._store = {}, Object.defineProperty(d._store, "validated", {
612
619
  configurable: !1,
613
620
  enumerable: !1,
614
621
  writable: !0,
615
622
  value: !1
616
- }), Object.defineProperty(i, "_self", {
623
+ }), Object.defineProperty(d, "_self", {
617
624
  configurable: !1,
618
625
  enumerable: !1,
619
626
  writable: !1,
620
- value: a
621
- }), Object.defineProperty(i, "_source", {
627
+ value: c
628
+ }), Object.defineProperty(d, "_source", {
622
629
  configurable: !1,
623
630
  enumerable: !1,
624
631
  writable: !1,
625
- value: f
626
- }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
632
+ value: g
633
+ }), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
627
634
  };
628
- function mr(e, t, n, a, f) {
635
+ function $t(e, n, i, c, g) {
629
636
  {
630
- var m, c = {}, i = null, w = null;
631
- n !== void 0 && (Se(n), i = "" + n), lr(t) && (Se(t.key), i = "" + t.key), cr(t) && (w = t.ref, fr(t, f));
632
- for (m in t)
633
- H.call(t, m) && !ur.hasOwnProperty(m) && (c[m] = t[m]);
637
+ var _, m = {}, d = null, P = null;
638
+ i !== void 0 && (Ue(i), d = "" + i), kt(n) && (Ue(n.key), d = "" + n.key), Lt(n) && (P = n.ref, Nt(n, g));
639
+ for (_ in n)
640
+ oe.call(n, _) && !Ft.hasOwnProperty(_) && (m[_] = n[_]);
634
641
  if (e && e.defaultProps) {
635
- var b = e.defaultProps;
636
- for (m in b)
637
- c[m] === void 0 && (c[m] = b[m]);
642
+ var R = e.defaultProps;
643
+ for (_ in R)
644
+ m[_] === void 0 && (m[_] = R[_]);
638
645
  }
639
- if (i || w) {
640
- var _ = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
641
- i && dr(c, _), w && pr(c, _);
646
+ if (d || P) {
647
+ var T = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
648
+ d && It(m, T), P && Ut(m, T);
642
649
  }
643
- return vr(e, i, w, f, a, N.current, c);
650
+ return Vt(e, d, P, g, c, H.current, m);
644
651
  }
645
652
  }
646
- var re = D.ReactCurrentOwner, Ce = D.ReactDebugCurrentFrame;
647
- function L(e) {
653
+ var pe = j.ReactCurrentOwner, Ye = j.ReactDebugCurrentFrame;
654
+ function V(e) {
648
655
  if (e) {
649
- var t = e._owner, n = q(e.type, e._source, t ? t.type : null);
650
- Ce.setExtraStackFrame(n);
656
+ var n = e._owner, i = ae(e.type, e._source, n ? n.type : null);
657
+ Ye.setExtraStackFrame(i);
651
658
  } else
652
- Ce.setExtraStackFrame(null);
659
+ Ye.setExtraStackFrame(null);
653
660
  }
654
- var te;
655
- te = !1;
656
- function ne(e) {
657
- return typeof e == "object" && e !== null && e.$$typeof === u;
661
+ var ve;
662
+ ve = !1;
663
+ function ge(e) {
664
+ return typeof e == "object" && e !== null && e.$$typeof === r;
658
665
  }
659
- function Oe() {
666
+ function Be() {
660
667
  {
661
- if (re.current) {
662
- var e = x(re.current.type);
668
+ if (pe.current) {
669
+ var e = A(pe.current.type);
663
670
  if (e)
664
671
  return `
665
672
 
@@ -668,235 +675,355 @@ Check the render method of \`` + e + "`.";
668
675
  return "";
669
676
  }
670
677
  }
671
- function yr(e) {
678
+ function Yt(e) {
672
679
  {
673
680
  if (e !== void 0) {
674
- var t = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
681
+ var n = e.fileName.replace(/^.*[\\\/]/, ""), i = e.lineNumber;
675
682
  return `
676
683
 
677
- Check your code at ` + t + ":" + n + ".";
684
+ Check your code at ` + n + ":" + i + ".";
678
685
  }
679
686
  return "";
680
687
  }
681
688
  }
682
- var Pe = {};
683
- function gr(e) {
689
+ var We = {};
690
+ function Bt(e) {
684
691
  {
685
- var t = Oe();
686
- if (!t) {
687
- var n = typeof e == "string" ? e : e.displayName || e.name;
688
- n && (t = `
692
+ var n = Be();
693
+ if (!n) {
694
+ var i = typeof e == "string" ? e : e.displayName || e.name;
695
+ i && (n = `
689
696
 
690
- Check the top-level render call using <` + n + ">.");
697
+ Check the top-level render call using <` + i + ">.");
691
698
  }
692
- return t;
699
+ return n;
693
700
  }
694
701
  }
695
- function xe(e, t) {
702
+ function He(e, n) {
696
703
  {
697
704
  if (!e._store || e._store.validated || e.key != null)
698
705
  return;
699
706
  e._store.validated = !0;
700
- var n = gr(t);
701
- if (Pe[n])
707
+ var i = Bt(n);
708
+ if (We[i])
702
709
  return;
703
- Pe[n] = !0;
704
- var a = "";
705
- e && e._owner && e._owner !== re.current && (a = " It was passed a child from " + x(e._owner.type) + "."), L(e), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, a), L(null);
710
+ We[i] = !0;
711
+ var c = "";
712
+ e && e._owner && e._owner !== pe.current && (c = " It was passed a child from " + A(e._owner.type) + "."), V(e), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, c), V(null);
706
713
  }
707
714
  }
708
- function je(e, t) {
715
+ function ze(e, n) {
709
716
  {
710
717
  if (typeof e != "object")
711
718
  return;
712
- if (Q(e))
713
- for (var n = 0; n < e.length; n++) {
714
- var a = e[n];
715
- ne(a) && xe(a, t);
719
+ if (de(e))
720
+ for (var i = 0; i < e.length; i++) {
721
+ var c = e[i];
722
+ ge(c) && He(c, n);
716
723
  }
717
- else if (ne(e))
724
+ else if (ge(e))
718
725
  e._store && (e._store.validated = !0);
719
726
  else if (e) {
720
- var f = W(e);
721
- if (typeof f == "function" && f !== e.entries)
722
- for (var m = f.call(e), c; !(c = m.next()).done; )
723
- ne(c.value) && xe(c.value, t);
727
+ var g = U(e);
728
+ if (typeof g == "function" && g !== e.entries)
729
+ for (var _ = g.call(e), m; !(m = _.next()).done; )
730
+ ge(m.value) && He(m.value, n);
724
731
  }
725
732
  }
726
733
  }
727
- function Rr(e) {
734
+ function Wt(e) {
728
735
  {
729
- var t = e.type;
730
- if (t == null || typeof t == "string")
736
+ var n = e.type;
737
+ if (n == null || typeof n == "string")
731
738
  return;
732
- var n;
733
- if (typeof t == "function")
734
- n = t.propTypes;
735
- else if (typeof t == "object" && (t.$$typeof === s || // Note: Memo only checks outer props here.
739
+ var i;
740
+ if (typeof n == "function")
741
+ i = n.propTypes;
742
+ else if (typeof n == "object" && (n.$$typeof === u || // Note: Memo only checks outer props here.
736
743
  // Inner props are checked in the reconciler.
737
- t.$$typeof === T))
738
- n = t.propTypes;
744
+ n.$$typeof === b))
745
+ i = n.propTypes;
739
746
  else
740
747
  return;
741
- if (n) {
742
- var a = x(t);
743
- ar(n, e.props, "prop", a, e);
744
- } else if (t.PropTypes !== void 0 && !te) {
745
- te = !0;
746
- var f = x(t);
747
- S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", f || "Unknown");
748
+ if (i) {
749
+ var c = A(n);
750
+ xt(i, e.props, "prop", c, e);
751
+ } else if (n.PropTypes !== void 0 && !ve) {
752
+ ve = !0;
753
+ var g = A(n);
754
+ S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", g || "Unknown");
748
755
  }
749
- typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
756
+ typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
750
757
  }
751
758
  }
752
- function Er(e) {
759
+ function Ht(e) {
753
760
  {
754
- for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
755
- var a = t[n];
756
- if (a !== "children" && a !== "key") {
757
- L(e), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), L(null);
761
+ for (var n = Object.keys(e.props), i = 0; i < n.length; i++) {
762
+ var c = n[i];
763
+ if (c !== "children" && c !== "key") {
764
+ V(e), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), V(null);
758
765
  break;
759
766
  }
760
767
  }
761
- e.ref !== null && (L(e), S("Invalid attribute `ref` supplied to `React.Fragment`."), L(null));
768
+ e.ref !== null && (V(e), S("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
762
769
  }
763
770
  }
764
- function ke(e, t, n, a, f, m) {
771
+ function qe(e, n, i, c, g, _) {
765
772
  {
766
- var c = Ke(e);
767
- if (!c) {
768
- var i = "";
769
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
770
- var w = yr(f);
771
- w ? i += w : i += Oe();
772
- var b;
773
- e === null ? b = "null" : Q(e) ? b = "array" : e !== void 0 && e.$$typeof === u ? (b = "<" + (x(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, i);
773
+ var m = Rt(e);
774
+ if (!m) {
775
+ var d = "";
776
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (d += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
777
+ var P = Yt(g);
778
+ P ? d += P : d += Be();
779
+ var R;
780
+ e === null ? R = "null" : de(e) ? R = "array" : e !== void 0 && e.$$typeof === r ? (R = "<" + (A(e.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, d);
774
781
  }
775
- var _ = mr(e, t, n, f, m);
776
- if (_ == null)
777
- return _;
778
- if (c) {
779
- var O = t.children;
780
- if (O !== void 0)
781
- if (a)
782
- if (Q(O)) {
783
- for (var I = 0; I < O.length; I++)
784
- je(O[I], e);
785
- Object.freeze && Object.freeze(O);
782
+ var T = $t(e, n, i, g, _);
783
+ if (T == null)
784
+ return T;
785
+ if (m) {
786
+ var w = n.children;
787
+ if (w !== void 0)
788
+ if (c)
789
+ if (de(w)) {
790
+ for (var $ = 0; $ < w.length; $++)
791
+ ze(w[$], e);
792
+ Object.freeze && Object.freeze(w);
786
793
  } else
787
794
  S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
788
795
  else
789
- je(O, e);
796
+ ze(w, e);
790
797
  }
791
- return e === h ? Er(_) : Rr(_), _;
798
+ return e === s ? Ht(T) : Wt(T), T;
792
799
  }
793
800
  }
794
- function br(e, t, n) {
795
- return ke(e, t, n, !0);
801
+ function zt(e, n, i) {
802
+ return qe(e, n, i, !0);
796
803
  }
797
- function hr(e, t, n) {
798
- return ke(e, t, n, !1);
804
+ function qt(e, n, i) {
805
+ return qe(e, n, i, !1);
799
806
  }
800
- var _r = hr, Sr = br;
801
- $.Fragment = h, $.jsx = _r, $.jsxs = Sr;
802
- }()), $;
807
+ var Gt = qt, Zt = zt;
808
+ G.Fragment = s, G.jsx = Gt, G.jsxs = Zt;
809
+ }()), G;
803
810
  }
804
- process.env.NODE_ENV === "production" ? ie.exports = kr() : ie.exports = Dr();
805
- var oe = ie.exports;
806
- function Wr({
807
- children: r,
808
- maps: u,
809
- externalSync: d
811
+ process.env.NODE_ENV === "production" ? Ee.exports = ir() : Ee.exports = sr();
812
+ var J = Ee.exports;
813
+ function Jr({
814
+ children: t,
815
+ maps: r,
816
+ externalSync: a
810
817
  }) {
811
- const [h, o] = Tr(Pr, {
812
- ...B.state,
813
- maps: u.reduce((p, v) => (p[v.id] = {
814
- ...v,
818
+ const [s, o] = nt(nr, {
819
+ ...K.state,
820
+ maps: r.reduce((v, E) => (v[E.id] = {
821
+ ...E,
815
822
  isLoaded: !1
816
- }, p), B.state.maps)
817
- }), y = Fe(
818
- u.reduce((p, v) => (p[v.id] = {
823
+ }, v), K.state.maps)
824
+ }), l = ce(
825
+ r.reduce((v, E) => (v[E.id] = {
819
826
  instanceRef: {
820
827
  current: null
821
828
  },
822
829
  overlayRef: {
823
830
  current: null
824
831
  }
825
- }, p), {})
826
- ), l = P(
827
- (p, v, k) => {
828
- u[0].id === p && d?.({
829
- type: v,
830
- payload: k
832
+ }, v), {})
833
+ ), f = M(
834
+ (v, E, x) => {
835
+ r[0].id === v && a?.({
836
+ type: E,
837
+ payload: x
831
838
  });
832
839
  },
833
- [d, u]
834
- ), E = P(
835
- (p, v) => {
840
+ [a, r]
841
+ ), h = M(
842
+ (v, E) => {
836
843
  o({
837
- type: F.SetViewState,
844
+ type: k.SetViewState,
838
845
  payload: {
839
- id: v,
840
- viewState: p
846
+ id: E,
847
+ viewState: v
841
848
  }
842
- }), l(v, F.SetViewState, p);
849
+ }), f(E, k.SetViewState, v);
843
850
  },
844
- [o, l]
845
- ), s = P(
846
- ({ height: p, width: v }, k) => {
851
+ [o, f]
852
+ ), u = M(
853
+ ({ height: v, width: E }, x) => {
847
854
  o({
848
- type: F.SetResize,
855
+ type: k.SetResize,
849
856
  payload: {
850
- id: k,
851
- height: p,
852
- width: v
857
+ id: x,
858
+ height: v,
859
+ width: E
853
860
  }
854
- }), l(k, F.SetResize, { height: p, width: v });
861
+ }), f(x, k.SetResize, { height: v, width: E });
855
862
  },
856
- [o, l]
857
- ), R = P(
858
- (p, v) => {
863
+ [o, f]
864
+ ), p = M(
865
+ (v, E) => {
859
866
  o({
860
- type: F.SetBasemap,
867
+ type: k.SetBasemap,
861
868
  payload: {
862
- id: v,
863
- basemap: p
869
+ id: E,
870
+ basemap: v
864
871
  }
865
872
  });
866
873
  },
867
874
  [o]
868
- ), g = P(
869
- (p, v) => {
875
+ ), y = M(
876
+ (v, E) => {
870
877
  o({
871
- type: F.SetZoom,
878
+ type: k.SetZoom,
872
879
  payload: {
873
- id: v,
874
- zoom: p
880
+ id: E,
881
+ zoom: v
875
882
  }
876
883
  });
877
884
  },
878
885
  [o]
879
- ), T = P(
880
- (p, v) => {
886
+ ), b = M(
887
+ (v, E) => {
881
888
  o({
882
- type: F.SetLoaded,
889
+ type: k.SetLoaded,
883
890
  payload: {
884
- id: v,
885
- value: p
891
+ id: E,
892
+ value: v
886
893
  }
887
894
  });
888
895
  },
889
896
  [o]
890
- ), C = Fe({
891
- setViewState: E,
892
- setBasemap: R,
893
- setResize: s,
894
- setZoom: g,
895
- setLoaded: T
897
+ ), O = ce({
898
+ setViewState: h,
899
+ setBasemap: p,
900
+ setResize: u,
901
+ setZoom: y,
902
+ setLoaded: b
896
903
  });
897
- return /* @__PURE__ */ oe.jsx(Ye.Provider, { value: C.current, children: /* @__PURE__ */ oe.jsx(Ve.Provider, { value: y, children: /* @__PURE__ */ oe.jsx(Ne.Provider, { value: h, children: r }) }) });
904
+ return /* @__PURE__ */ J.jsx(ct.Provider, { value: O.current, children: /* @__PURE__ */ J.jsx(st.Provider, { value: l, children: /* @__PURE__ */ J.jsx(it.Provider, { value: s, children: t }) }) });
905
+ }
906
+ var C = /* @__PURE__ */ ((t) => (t.milimeter = "milimeter", t.centimeter = "centimeter", t.meter = "meter", t.kilometer = "kilometer", t.mile = "mile", t.feet = "feet", t))(C || {}), lt = /* @__PURE__ */ ((t) => (t.meters = "meters", t.kilometer = "kilometers", t.mile = "miles", t))(lt || {}), X = /* @__PURE__ */ ((t) => (t.AddPosition = "addPosition", t.Finish = "finish", t))(X || {});
907
+ const Ke = [
908
+ "anyclick",
909
+ "pointermove",
910
+ "panstart",
911
+ "panmove",
912
+ "panend",
913
+ "keyup"
914
+ ], cr = "mapMeasureLayer", ur = {
915
+ id: cr,
916
+ pickable: !1,
917
+ billboard: !1,
918
+ editHandlePointRadiusUnits: "pixels",
919
+ editHandlePointRadiusMinPixels: 1,
920
+ editHandlePointRadiusMaxPixels: 12,
921
+ lineWidthMinPixels: 2,
922
+ editHandlePointStrokeWidth: 3,
923
+ getEditHandlePointRadius: 3,
924
+ _subLayerProps: {
925
+ tooltips: {
926
+ fontFamily: "Open Sans, Inter, sans-serif",
927
+ fontWeight: "lighter",
928
+ getSize: 11,
929
+ lineHeight: 1.4545,
930
+ getPixelOffset: [0, 20],
931
+ getTextAnchor: "middle",
932
+ getAlignmentBaseline: "center",
933
+ updateTriggers: {}
934
+ },
935
+ guides: {
936
+ // getLineColor: conditionalRgbColor,
937
+ getLineWidth: 2
938
+ }
939
+ }
940
+ }, be = {
941
+ editing: [71, 219, 153, 255],
942
+ finished: [49, 153, 107, 255]
943
+ }, Xe = {
944
+ locale: "en",
945
+ getColumnName: "<b>Total distance</b> ",
946
+ styles: {
947
+ colors: {
948
+ editing: be.editing,
949
+ finished: be.finished
950
+ }
951
+ }
952
+ }, Qe = {
953
+ [C.kilometer]: "km",
954
+ [C.centimeter]: "cm",
955
+ [C.milimeter]: "mm",
956
+ [C.mile]: "mi",
957
+ [C.meter]: "m",
958
+ [C.feet]: "ft"
959
+ }, lr = {
960
+ [C.kilometer]: "kilometer",
961
+ [C.centimeter]: "centimeter",
962
+ [C.milimeter]: "millimeter",
963
+ [C.mile]: "mile",
964
+ [C.meter]: "meter",
965
+ [C.feet]: "foot"
966
+ };
967
+ class fr extends Kt {
968
+ eventManager;
969
+ constructor(r) {
970
+ super(r), this.eventManager = r.eventManager;
971
+ }
972
+ _addEventHandlers() {
973
+ const r = this._getEventManager(), { eventHandler: a } = this.state._editableLayerState;
974
+ for (const s of Ke)
975
+ r.on(s, a, {
976
+ // give nebula a higher priority so that it can stop propagation to deck.gl's map panning handlers
977
+ priority: 100
978
+ });
979
+ }
980
+ _removeEventHandlers(r = void 0) {
981
+ const a = r || this._getEventManager(), { eventHandler: s } = this.state._editableLayerState;
982
+ for (const o of Ke)
983
+ a.off(o, s);
984
+ }
985
+ _getEventManager() {
986
+ return this.eventManager || // @ts-ignore
987
+ this.context.deck.eventManager;
988
+ }
898
989
  }
899
- const Be = {
990
+ class dr extends Xt {
991
+ handleClick(r, a) {
992
+ super.handleClick(r, a), a.onEdit({
993
+ // data is the same
994
+ updatedData: a.data,
995
+ editType: X.AddPosition,
996
+ editContext: {
997
+ distance: this._currentDistance
998
+ }
999
+ });
1000
+ }
1001
+ handleKeyUp(r, a) {
1002
+ if (this._isMeasuringSessionFinished)
1003
+ return;
1004
+ r.stopPropagation();
1005
+ const { key: s } = r, o = this.getClickSequence().length;
1006
+ switch (s) {
1007
+ case "Enter":
1008
+ case "Escape":
1009
+ this._isMeasuringSessionFinished = !0, o === 1 && (this.resetClickSequence(), this._currentTooltips = []), a.onUpdateCursor("cell"), a.onEdit({
1010
+ updatedData: a.data,
1011
+ editType: X.Finish,
1012
+ editContext: {
1013
+ finished: this._isMeasuringSessionFinished
1014
+ }
1015
+ });
1016
+ break;
1017
+ }
1018
+ }
1019
+ }
1020
+ function mr(t) {
1021
+ return he[t]?.type;
1022
+ }
1023
+ function pr(t) {
1024
+ return mr(t) === ot.GoogleMaps;
1025
+ }
1026
+ const ft = {
900
1027
  NUMBER: {
901
1028
  style: "decimal",
902
1029
  maximumFractionDigits: 1,
@@ -918,86 +1045,512 @@ const Be = {
918
1045
  day: "2-digit"
919
1046
  }
920
1047
  };
921
- function We(r, u, d) {
922
- return Intl.NumberFormat(u, d).format(r);
1048
+ function dt(t, r, a) {
1049
+ return Intl.NumberFormat(r, a).format(t);
923
1050
  }
924
- function Fr(r, u, d = {}) {
925
- return We(r, u, { ...Be.NUMBER, ...d });
1051
+ function mt(t, r, a = {}) {
1052
+ return dt(t, r, { ...ft.NUMBER, ...a });
926
1053
  }
927
- function Ar(r, u, d = {}) {
928
- return We(r, u, { ...Be.CURRENCY, ...d });
1054
+ function vr(t, r, a = {}) {
1055
+ return dt(t, r, { ...ft.CURRENCY, ...a });
929
1056
  }
930
- var A = /* @__PURE__ */ ((r) => (r.CURRENCY = "CURRENCY", r.DEFAULT = "DEFAULT", r.NUMBER = "NUMBER", r))(A || {});
931
- const Ie = {
932
- [A.CURRENCY]: {
933
- type: A.CURRENCY,
934
- format: (r, u) => Ar(r, u)
1057
+ var N = /* @__PURE__ */ ((t) => (t.CURRENCY = "CURRENCY", t.DEFAULT = "DEFAULT", t.NUMBER = "NUMBER", t))(N || {});
1058
+ const et = {
1059
+ [N.CURRENCY]: {
1060
+ type: N.CURRENCY,
1061
+ format: (t, r) => vr(t, r)
935
1062
  },
936
- [A.NUMBER]: {
937
- type: A.NUMBER,
938
- format: (r, u) => Fr(r, u)
1063
+ [N.NUMBER]: {
1064
+ type: N.NUMBER,
1065
+ format: (t, r) => mt(t, r)
939
1066
  },
940
- [A.DEFAULT]: {
941
- type: A.DEFAULT,
942
- format: (r) => r.toLocaleString()
1067
+ [N.DEFAULT]: {
1068
+ type: N.DEFAULT,
1069
+ format: (t) => t.toLocaleString()
943
1070
  }
944
1071
  };
945
- function zr({
946
- properties: r,
947
- formatters: u = {},
948
- includeColumns: d = Object.keys(r),
949
- locale: h = "en-US",
1072
+ function gr({
1073
+ properties: t,
1074
+ formatters: r = {},
1075
+ includeColumns: a = Object.keys(t),
1076
+ locale: s = "en-US",
950
1077
  showColumnName: o = !0,
951
- title: y,
952
- getColumnName: l = Nr,
953
- getFieldHtml: E = Lr,
954
- getTitle: s = Mr,
955
- getValue: R = Ir
1078
+ title: l,
1079
+ getColumnName: f = _r,
1080
+ getFieldHtml: h = hr,
1081
+ getTitle: u = yr,
1082
+ getValue: p = Er
956
1083
  }) {
957
- const g = y ? s(y) : "", C = d.reduce((p, v) => {
958
- const k = u[v], W = r[v], D = R(W, h, k), S = o ? l(v) : "";
959
- return p + E(S, D);
1084
+ const y = l ? u(l) : "", O = a.reduce((v, E) => {
1085
+ const x = r[E], U = t[E], j = p(U, s, x), S = o ? f(E) : "";
1086
+ return v + h(S, j);
960
1087
  }, "");
961
- return g + C;
1088
+ return y + O;
962
1089
  }
963
- function Mr(r) {
964
- return `<h3 style="margin: 0"><strong>${r}</strong></h3></br>`;
1090
+ function yr(t) {
1091
+ return `<h3 style="margin: 0"><strong>${t}</strong></h3></br>`;
965
1092
  }
966
- function Lr(r, u) {
967
- return `${r}${u}</br>`;
1093
+ function hr(t, r) {
1094
+ return `${t}${r}</br>`;
968
1095
  }
969
- function Ir(r, u, d) {
1096
+ function Er(t, r, a) {
970
1097
  try {
971
- return Ur(d)(r, u);
1098
+ return br(a)(t, r);
972
1099
  } catch {
973
- return r;
1100
+ return t;
1101
+ }
1102
+ }
1103
+ function br(t) {
1104
+ return typeof t == "function" ? t : (t && et[t] || et[N.DEFAULT]).format;
1105
+ }
1106
+ function _r(t) {
1107
+ return `<strong>${t}</strong>: `;
1108
+ }
1109
+ var Sr = function(r) {
1110
+ return Rr(r) && !Tr(r);
1111
+ };
1112
+ function Rr(t) {
1113
+ return !!t && typeof t == "object";
1114
+ }
1115
+ function Tr(t) {
1116
+ var r = Object.prototype.toString.call(t);
1117
+ return r === "[object RegExp]" || r === "[object Date]" || Pr(t);
1118
+ }
1119
+ var Mr = typeof Symbol == "function" && Symbol.for, Or = Mr ? Symbol.for("react.element") : 60103;
1120
+ function Pr(t) {
1121
+ return t.$$typeof === Or;
1122
+ }
1123
+ function Cr(t) {
1124
+ return Array.isArray(t) ? [] : {};
1125
+ }
1126
+ function Q(t, r) {
1127
+ return r.clone !== !1 && r.isMergeableObject(t) ? B(Cr(t), t, r) : t;
1128
+ }
1129
+ function wr(t, r, a) {
1130
+ return t.concat(r).map(function(s) {
1131
+ return Q(s, a);
1132
+ });
1133
+ }
1134
+ function xr(t, r) {
1135
+ if (!r.customMerge)
1136
+ return B;
1137
+ var a = r.customMerge(t);
1138
+ return typeof a == "function" ? a : B;
1139
+ }
1140
+ function jr(t) {
1141
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(r) {
1142
+ return Object.propertyIsEnumerable.call(t, r);
1143
+ }) : [];
1144
+ }
1145
+ function tt(t) {
1146
+ return Object.keys(t).concat(jr(t));
1147
+ }
1148
+ function pt(t, r) {
1149
+ try {
1150
+ return r in t;
1151
+ } catch {
1152
+ return !1;
1153
+ }
1154
+ }
1155
+ function Ar(t, r) {
1156
+ return pt(t, r) && !(Object.hasOwnProperty.call(t, r) && Object.propertyIsEnumerable.call(t, r));
1157
+ }
1158
+ function Dr(t, r, a) {
1159
+ var s = {};
1160
+ return a.isMergeableObject(t) && tt(t).forEach(function(o) {
1161
+ s[o] = Q(t[o], a);
1162
+ }), tt(r).forEach(function(o) {
1163
+ Ar(t, o) || (pt(t, o) && a.isMergeableObject(r[o]) ? s[o] = xr(o, a)(t[o], r[o], a) : s[o] = Q(r[o], a));
1164
+ }), s;
1165
+ }
1166
+ function B(t, r, a) {
1167
+ a = a || {}, a.arrayMerge = a.arrayMerge || wr, a.isMergeableObject = a.isMergeableObject || Sr, a.cloneUnlessOtherwiseSpecified = Q;
1168
+ var s = Array.isArray(r), o = Array.isArray(t), l = s === o;
1169
+ return l ? s ? a.arrayMerge(t, r, a) : Dr(t, r, a) : Q(r, a);
1170
+ }
1171
+ B.all = function(r, a) {
1172
+ if (!Array.isArray(r))
1173
+ throw new Error("first argument should be an array");
1174
+ return r.reduce(function(s, o) {
1175
+ return B(s, o, a);
1176
+ }, {});
1177
+ };
1178
+ var Fr = B, Lr = Fr;
1179
+ const se = /* @__PURE__ */ or(Lr), Z = () => {
1180
+ throw new Error(
1181
+ "You forgot to wrap your component in <MeasurementToolsProvider>."
1182
+ );
1183
+ }, Se = {
1184
+ state: {
1185
+ enable: !1,
1186
+ finished: !0,
1187
+ distance: 0,
1188
+ locale: "en",
1189
+ unit: C.kilometer
1190
+ },
1191
+ actions: {
1192
+ setEnable: Z,
1193
+ setFinished: Z,
1194
+ setUnit: Z,
1195
+ setDistance: Z,
1196
+ setLocale: Z
1197
+ }
1198
+ }, vt = ee(Se.state), gt = ee(Se.actions);
1199
+ function yt() {
1200
+ return te(
1201
+ vt
1202
+ );
1203
+ }
1204
+ function ht() {
1205
+ return te(
1206
+ gt
1207
+ );
1208
+ }
1209
+ const kr = {
1210
+ nm: {
1211
+ name: {
1212
+ singular: "Nanometer",
1213
+ plural: "Nanometers"
1214
+ },
1215
+ to_anchor: 1e-9
1216
+ },
1217
+ μm: {
1218
+ name: {
1219
+ singular: "Micrometer",
1220
+ plural: "Micrometers"
1221
+ },
1222
+ to_anchor: 1e-6
1223
+ },
1224
+ mm: {
1225
+ name: {
1226
+ singular: "Millimeter",
1227
+ plural: "Millimeters"
1228
+ },
1229
+ to_anchor: 1e-3
1230
+ },
1231
+ cm: {
1232
+ name: {
1233
+ singular: "Centimeter",
1234
+ plural: "Centimeters"
1235
+ },
1236
+ to_anchor: 0.01
1237
+ },
1238
+ m: {
1239
+ name: {
1240
+ singular: "Meter",
1241
+ plural: "Meters"
1242
+ },
1243
+ to_anchor: 1
1244
+ },
1245
+ km: {
1246
+ name: {
1247
+ singular: "Kilometer",
1248
+ plural: "Kilometers"
1249
+ },
1250
+ to_anchor: 1e3
1251
+ }
1252
+ }, Nr = {
1253
+ mil: {
1254
+ name: {
1255
+ singular: "Mil",
1256
+ plural: "Mils"
1257
+ },
1258
+ to_anchor: 1 / 12e3
1259
+ },
1260
+ in: {
1261
+ name: {
1262
+ singular: "Inch",
1263
+ plural: "Inches"
1264
+ },
1265
+ to_anchor: 1 / 12
1266
+ },
1267
+ yd: {
1268
+ name: {
1269
+ singular: "Yard",
1270
+ plural: "Yards"
1271
+ },
1272
+ to_anchor: 3
1273
+ },
1274
+ "ft-us": {
1275
+ name: {
1276
+ singular: "US Survey Foot",
1277
+ plural: "US Survey Feet"
1278
+ },
1279
+ to_anchor: 1.000002
1280
+ },
1281
+ ft: {
1282
+ name: {
1283
+ singular: "Foot",
1284
+ plural: "Feet"
1285
+ },
1286
+ to_anchor: 1
1287
+ },
1288
+ fathom: {
1289
+ name: {
1290
+ singular: "Fathom",
1291
+ plural: "Fathoms"
1292
+ },
1293
+ to_anchor: 6
1294
+ },
1295
+ mi: {
1296
+ name: {
1297
+ singular: "Mile",
1298
+ plural: "Miles"
1299
+ },
1300
+ to_anchor: 5280
1301
+ },
1302
+ nMi: {
1303
+ name: {
1304
+ singular: "Nautical Mile",
1305
+ plural: "Nautical Miles"
1306
+ },
1307
+ to_anchor: 6076.12
974
1308
  }
1309
+ }, Ir = {
1310
+ systems: {
1311
+ metric: kr,
1312
+ imperial: Nr
1313
+ },
1314
+ anchors: {
1315
+ metric: {
1316
+ imperial: {
1317
+ ratio: 3.28084
1318
+ }
1319
+ },
1320
+ imperial: {
1321
+ metric: {
1322
+ ratio: 1 / 3.28084
1323
+ }
1324
+ }
1325
+ }
1326
+ }, Ur = er({
1327
+ length: Ir
1328
+ });
1329
+ function Et(t, r) {
1330
+ return Ur(t).from(Qe[C.meter]).to(Qe[r]);
975
1331
  }
976
- function Ur(r) {
977
- return typeof r == "function" ? r : (r && Ie[r] || Ie[A.DEFAULT]).format;
1332
+ function Re({
1333
+ meters: t,
1334
+ unit: r,
1335
+ locale: a
1336
+ }) {
1337
+ return `${mt(Et(t, r), a, {
1338
+ style: "unit",
1339
+ unit: lr[r],
1340
+ unitDisplay: "short"
1341
+ })}`;
978
1342
  }
979
- function Nr(r) {
980
- return `<strong>${r}</strong>: `;
1343
+ function Kr({
1344
+ mapId: t,
1345
+ defaultProps: { getColumnName: r, styles: a = Xe.styles } = {
1346
+ getColumnName: Xe.getColumnName
1347
+ },
1348
+ layerProps: s = {}
1349
+ }) {
1350
+ const { enable: o, unit: l, finished: f, locale: h } = yt(), { setDistance: u, setFinished: p } = ht(), { isLoaded: y, basemap: b } = ut(t), { getOverlayInstance: O } = _e(t), v = ce(), E = Jt(() => {
1351
+ if (!y || !pr(b))
1352
+ return null;
1353
+ const F = O()?.getDiv();
1354
+ return new Qt(F, {});
1355
+ }, [y, O, b]), x = f ? a.colors?.finished : a.colors?.editing, U = M(
1356
+ (F, L) => {
1357
+ F.html = gr({
1358
+ properties: {
1359
+ distance: Re({
1360
+ meters: L.distance,
1361
+ locale: L.locale,
1362
+ unit: l
1363
+ })
1364
+ },
1365
+ getColumnName: () => r
1366
+ });
1367
+ },
1368
+ [r, l]
1369
+ ), j = M(
1370
+ ({ editType: F, editContext: L }) => {
1371
+ F === X.AddPosition ? u(L.distance) : F === X.Finish && p(L.finished);
1372
+ },
1373
+ [u, p]
1374
+ );
1375
+ if (at(() => {
1376
+ o || (v.current = void 0);
1377
+ }, [o]), !o || !y)
1378
+ return null;
1379
+ const S = Vr(
1380
+ s,
1381
+ h,
1382
+ l,
1383
+ U,
1384
+ j,
1385
+ x || be.guide
1386
+ );
1387
+ return !v.current && !S.mode && (v.current = new dr()), new fr({
1388
+ ...S,
1389
+ mode: S?.mode || v.current,
1390
+ eventManager: E
1391
+ });
1392
+ }
1393
+ function Vr(t, r, a, s, o, l) {
1394
+ const f = se(t, {
1395
+ modeConfig: {
1396
+ // We force distance due to conversion is addressed at feature getText level
1397
+ formatTooltip: (p) => p,
1398
+ turfOptions: {
1399
+ units: lt.meters
1400
+ }
1401
+ },
1402
+ onHover: s,
1403
+ onEdit: o,
1404
+ _subLayerProps: {
1405
+ tooltips: {
1406
+ getText: (p) => Re({
1407
+ ...p,
1408
+ meters: p.text,
1409
+ locale: r,
1410
+ unit: a
1411
+ }),
1412
+ updateTriggers: {
1413
+ getText: [a, r]
1414
+ }
1415
+ }
1416
+ }
1417
+ }), h = se(ur, {
1418
+ _subLayerProps: {
1419
+ guides: {
1420
+ getLineColor: l,
1421
+ getFillColor: l
1422
+ }
1423
+ },
1424
+ getEditHandlePointColor: l,
1425
+ getEditHandlePointOutlineColor: l
1426
+ });
1427
+ return se(h, f);
1428
+ }
1429
+ function Xr({ children: t }) {
1430
+ const { distance: r, enable: a, unit: s, locale: o } = yt(), { setDistance: l, setEnable: f } = ht(), h = Et(r, s), u = () => {
1431
+ l(0), f(!a);
1432
+ };
1433
+ return t({
1434
+ enable: a,
1435
+ meters: r,
1436
+ text: Re({ meters: r, unit: s, locale: o }),
1437
+ distance: h,
1438
+ unit: s,
1439
+ onToggleButton: u
1440
+ });
1441
+ }
1442
+ var Y = /* @__PURE__ */ ((t) => (t.SetEnable = "SET_ENABLE", t.SetFinished = "SET_FINISHED", t.SetDistance = "SET_DISTANCE", t.SetUnit = "SET_UNIT", t.SetLocale = "SET_LOCALE", t))(Y || {});
1443
+ function $r(t, { type: r, payload: a }) {
1444
+ return {
1445
+ SET_ENABLE: () => ({
1446
+ ...t,
1447
+ enable: a,
1448
+ finished: !1
1449
+ }),
1450
+ SET_FINISHED: () => ({
1451
+ ...t,
1452
+ finished: a
1453
+ }),
1454
+ SET_DISTANCE: () => ({
1455
+ ...t,
1456
+ distance: a
1457
+ }),
1458
+ SET_UNIT: () => ({
1459
+ ...t,
1460
+ unit: a
1461
+ }),
1462
+ SET_LOCALE: () => ({
1463
+ ...t,
1464
+ locale: a
1465
+ })
1466
+ }[r]?.() ?? t;
1467
+ }
1468
+ function Qr({
1469
+ children: t,
1470
+ defaultProps: r = {},
1471
+ locale: a
1472
+ }) {
1473
+ const [s, o] = nt(
1474
+ $r,
1475
+ se(Se.state, r)
1476
+ ), l = M(
1477
+ (b) => {
1478
+ o({ type: Y.SetLocale, payload: b });
1479
+ },
1480
+ [o]
1481
+ );
1482
+ at(() => {
1483
+ a && l(a);
1484
+ }, [a, l]);
1485
+ const f = M(
1486
+ (b) => {
1487
+ o({ type: Y.SetEnable, payload: b });
1488
+ },
1489
+ [o]
1490
+ ), h = M(
1491
+ (b) => {
1492
+ o({ type: Y.SetFinished, payload: b });
1493
+ },
1494
+ [o]
1495
+ ), u = M(
1496
+ (b) => {
1497
+ o({ type: Y.SetDistance, payload: b });
1498
+ },
1499
+ [o]
1500
+ ), p = M(
1501
+ (b) => {
1502
+ o({ type: Y.SetUnit, payload: b });
1503
+ },
1504
+ [o]
1505
+ ), y = ce({
1506
+ setEnable: f,
1507
+ setFinished: h,
1508
+ setDistance: u,
1509
+ setUnit: p,
1510
+ setLocale: l
1511
+ });
1512
+ return /* @__PURE__ */ J.jsx(gt.Provider, { value: y.current, children: /* @__PURE__ */ J.jsx(vt.Provider, { value: s, children: t }) });
981
1513
  }
982
1514
  export {
983
- ae as CartoBasemapURL,
984
- Cr as CartoBasemapsNames,
985
- A as FormatterTypes,
986
- wr as GMapsBasemap,
987
- Ae as MAPS_BASEMAP,
988
- F as MapActions,
989
- Ye as MapActionsContext,
990
- Ne as MapContext,
991
- Wr as MapProvider,
992
- Ve as MapReferencesContext,
993
- Or as MapsTypes,
994
- zr as objectToHtml,
995
- Pr as reducer,
996
- xr as useMap,
997
- jr as useMapActions,
998
- Br as useMapActionsByID,
999
- Yr as useMapByID,
1000
- $e as useMapRefences,
1001
- $e as useMapReferences,
1002
- $r as useMapReferencesByID
1515
+ Qe as CONVERSIONS_UNITS,
1516
+ ye as CartoBasemapURL,
1517
+ rr as CartoBasemapsNames,
1518
+ fr as CustomEditableGeojsonLayer,
1519
+ dr as CustomMeasureDistanceMode,
1520
+ be as DEFAULT_COLORS,
1521
+ ur as DEFAULT_LAYER_PROPS,
1522
+ Xe as DEFAULT_PROPS,
1523
+ Ke as EVENT_MANAGER_EVENT_TYPES,
1524
+ X as EditType,
1525
+ N as FormatterTypes,
1526
+ tr as GMapsBasemap,
1527
+ lr as INTL_UNITS,
1528
+ he as MAPS_BASEMAP,
1529
+ cr as MAP_MEASURE_LAYER_ID,
1530
+ k as MapActions,
1531
+ ct as MapActionsContext,
1532
+ it as MapContext,
1533
+ Xr as MapMeasurementTools,
1534
+ Kr as MapMeasurementToolsLayer,
1535
+ Qr as MapMeasurementToolsProvider,
1536
+ C as MapMeasurementUnit,
1537
+ lt as MapMeasurementUnitTurf,
1538
+ Jr as MapProvider,
1539
+ st as MapReferencesContext,
1540
+ ot as MapsTypes,
1541
+ Et as convertMetersTo,
1542
+ mr as getMapType,
1543
+ Re as getTextLayerFormattedDistance,
1544
+ pr as isGmaps,
1545
+ gr as objectToHtml,
1546
+ nr as reducer,
1547
+ ut as useMap,
1548
+ ar as useMapActions,
1549
+ Zr as useMapActionsByID,
1550
+ qr as useMapByID,
1551
+ yt as useMapMeasurementTools,
1552
+ ht as useMapMeasurementToolsActions,
1553
+ _e as useMapRefences,
1554
+ _e as useMapReferences,
1555
+ Gr as useMapReferencesByID
1003
1556
  };