@local-logic/maps 0.0.5 → 0.0.7

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 (153) hide show
  1. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  2. package/dist/index-7D9tjwUD.js +29 -0
  3. package/dist/index-B43MtiHH.js +30 -0
  4. package/dist/index-BZ2605rA.js +39 -0
  5. package/dist/index-C7t1isWh.js +29 -0
  6. package/dist/index-CIUYCbof.js +42 -0
  7. package/dist/index-CPq7k7F4.js +63 -0
  8. package/dist/index-CSXMNubL.js +47 -0
  9. package/dist/index-CTk5bvm9.js +155 -0
  10. package/dist/index-CXjxZmYt.js +144 -0
  11. package/dist/index-CwZ22Kq_.js +676 -0
  12. package/dist/index-D0VvNlqV.js +29 -0
  13. package/dist/index-DVitM43i.js +137 -0
  14. package/dist/index-FSH3b4mt.js +64 -0
  15. package/dist/index-J1MKzGEM.js +31 -0
  16. package/dist/index-qqbvBkdn.js +7 -0
  17. package/dist/index.d.ts +2 -0
  18. package/dist/index.es.js +4 -0
  19. package/dist/index.modern-EsUgbhzI.js +908 -0
  20. package/dist/index.umd.js +3181 -0
  21. package/dist/logo-control-NE-LlsRy.js +607 -0
  22. package/dist/mapbox-gl-D58OubwB.js +32266 -0
  23. package/dist/maplibre-gl-CfOZKUDd.js +20722 -0
  24. package/dist/scale-control-CyJd4u6j.js +716 -0
  25. package/dist/src/components/Map/Root/BaseMap/Empty/index.d.ts +3 -0
  26. package/dist/src/components/Map/Root/BaseMap/Empty/index.d.ts.map +1 -0
  27. package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts +11 -0
  28. package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts.map +1 -0
  29. package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts +4 -0
  30. package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts.map +1 -0
  31. package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts +4 -0
  32. package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts.map +1 -0
  33. package/dist/src/components/Map/Root/BaseMap/index.d.ts +4 -0
  34. package/dist/src/components/Map/Root/BaseMap/index.d.ts.map +1 -0
  35. package/dist/src/components/Map/Root/BaseMap/styles.d.ts +2 -0
  36. package/dist/src/components/Map/Root/BaseMap/styles.d.ts.map +1 -0
  37. package/dist/src/components/Map/Root/BaseMap/types.d.ts +3 -0
  38. package/dist/src/components/Map/Root/BaseMap/types.d.ts.map +1 -0
  39. package/dist/src/components/Map/Root/Layers/Google/index.d.ts +4 -0
  40. package/dist/src/components/Map/Root/Layers/Google/index.d.ts.map +1 -0
  41. package/dist/src/components/Map/Root/Layers/Mapbox/index.d.ts +4 -0
  42. package/dist/src/components/Map/Root/Layers/Mapbox/index.d.ts.map +1 -0
  43. package/dist/src/components/Map/Root/Layers/Maptiler/index.d.ts +4 -0
  44. package/dist/src/components/Map/Root/Layers/Maptiler/index.d.ts.map +1 -0
  45. package/dist/src/components/Map/Root/Layers/index.d.ts +4 -0
  46. package/dist/src/components/Map/Root/Layers/index.d.ts.map +1 -0
  47. package/dist/src/components/Map/Root/Layers/types.d.ts +13 -0
  48. package/dist/src/components/Map/Root/Layers/types.d.ts.map +1 -0
  49. package/dist/src/components/Map/Root/Layers/utils.d.ts +6 -0
  50. package/dist/src/components/Map/Root/Layers/utils.d.ts.map +1 -0
  51. package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts +6 -0
  52. package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts.map +1 -0
  53. package/dist/src/components/Map/Root/Markers/Cluster/styles.d.ts +2 -0
  54. package/dist/src/components/Map/Root/Markers/Cluster/styles.d.ts.map +1 -0
  55. package/dist/src/components/Map/Root/Markers/Google/index.d.ts +4 -0
  56. package/dist/src/components/Map/Root/Markers/Google/index.d.ts.map +1 -0
  57. package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts +4 -0
  58. package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts.map +1 -0
  59. package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts +4 -0
  60. package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts.map +1 -0
  61. package/dist/src/components/Map/Root/Markers/index.d.ts +4 -0
  62. package/dist/src/components/Map/Root/Markers/index.d.ts.map +1 -0
  63. package/dist/src/components/Map/Root/Markers/styles.d.ts +5 -0
  64. package/dist/src/components/Map/Root/Markers/styles.d.ts.map +1 -0
  65. package/dist/src/components/Map/Root/Markers/types.d.ts +28 -0
  66. package/dist/src/components/Map/Root/Markers/types.d.ts.map +1 -0
  67. package/dist/src/components/Map/Root/Popup/Google/index.d.ts +4 -0
  68. package/dist/src/components/Map/Root/Popup/Google/index.d.ts.map +1 -0
  69. package/dist/src/components/Map/Root/Popup/Mapbox/index.d.ts +4 -0
  70. package/dist/src/components/Map/Root/Popup/Mapbox/index.d.ts.map +1 -0
  71. package/dist/src/components/Map/Root/Popup/Maptiler/index.d.ts +4 -0
  72. package/dist/src/components/Map/Root/Popup/Maptiler/index.d.ts.map +1 -0
  73. package/dist/src/components/Map/Root/Popup/index.d.ts +4 -0
  74. package/dist/src/components/Map/Root/Popup/index.d.ts.map +1 -0
  75. package/dist/src/components/Map/Root/Popup/styles.d.ts +2 -0
  76. package/dist/src/components/Map/Root/Popup/styles.d.ts.map +1 -0
  77. package/dist/src/components/Map/Root/Popup/types.d.ts +10 -0
  78. package/dist/src/components/Map/Root/Popup/types.d.ts.map +1 -0
  79. package/dist/src/components/Map/Root/constants.d.ts +12 -0
  80. package/dist/src/components/Map/Root/constants.d.ts.map +1 -0
  81. package/dist/src/components/Map/Root/context.d.ts +11 -0
  82. package/dist/src/components/Map/Root/context.d.ts.map +1 -0
  83. package/dist/src/components/Map/Root/index.d.ts +8 -0
  84. package/dist/src/components/Map/Root/index.d.ts.map +1 -0
  85. package/dist/src/components/Map/Root/types.d.ts +26 -0
  86. package/dist/src/components/Map/Root/types.d.ts.map +1 -0
  87. package/dist/src/components/Map/index.d.ts +5 -0
  88. package/dist/src/components/Map/index.d.ts.map +1 -0
  89. package/dist/src/components/Map/index.stories.d.ts +8 -0
  90. package/dist/src/components/Map/index.stories.d.ts.map +1 -0
  91. package/dist/src/components/Map/index.test.d.ts +2 -0
  92. package/dist/src/components/Map/index.test.d.ts.map +1 -0
  93. package/dist/src/components/Map/storybook-data.d.ts +4 -0
  94. package/dist/src/components/Map/storybook-data.d.ts.map +1 -0
  95. package/dist/src/index.d.ts +2 -0
  96. package/dist/src/index.d.ts.map +1 -0
  97. package/dist/style.css +1 -0
  98. package/{src/components/Map/Root/Popup/styles.ts → dist/styles-uPzJnzVS.js} +4 -1
  99. package/dist/utils-YqJg0vBb.js +25 -0
  100. package/package.json +15 -3
  101. package/.env.example +0 -3
  102. package/.storybook/defaults.ts +0 -40
  103. package/.storybook/globals.css +0 -40
  104. package/.storybook/main.ts +0 -19
  105. package/.storybook/preview.tsx +0 -27
  106. package/CHANGELOG.md +0 -33
  107. package/eslint.config.mjs +0 -46
  108. package/lint-staged.config.cjs +0 -4
  109. package/postcss.config.cjs +0 -6
  110. package/prettier.config.cjs +0 -1
  111. package/src/components/Map/Root/BaseMap/Empty/index.tsx +0 -7
  112. package/src/components/Map/Root/BaseMap/Google/index.tsx +0 -96
  113. package/src/components/Map/Root/BaseMap/Mapbox/index.tsx +0 -66
  114. package/src/components/Map/Root/BaseMap/Maptiler/index.tsx +0 -59
  115. package/src/components/Map/Root/BaseMap/index.tsx +0 -34
  116. package/src/components/Map/Root/BaseMap/styles.ts +0 -1
  117. package/src/components/Map/Root/BaseMap/types.ts +0 -3
  118. package/src/components/Map/Root/Layers/Google/index.tsx +0 -97
  119. package/src/components/Map/Root/Layers/Mapbox/index.tsx +0 -74
  120. package/src/components/Map/Root/Layers/Maptiler/index.tsx +0 -74
  121. package/src/components/Map/Root/Layers/index.tsx +0 -32
  122. package/src/components/Map/Root/Layers/types.ts +0 -15
  123. package/src/components/Map/Root/Layers/utils.ts +0 -64
  124. package/src/components/Map/Root/Markers/Cluster/index.tsx +0 -27
  125. package/src/components/Map/Root/Markers/Cluster/styles.ts +0 -11
  126. package/src/components/Map/Root/Markers/Google/index.tsx +0 -49
  127. package/src/components/Map/Root/Markers/Mapbox/index.tsx +0 -52
  128. package/src/components/Map/Root/Markers/Maptiler/index.tsx +0 -52
  129. package/src/components/Map/Root/Markers/index.tsx +0 -81
  130. package/src/components/Map/Root/Markers/styles.ts +0 -39
  131. package/src/components/Map/Root/Markers/types.ts +0 -32
  132. package/src/components/Map/Root/Popup/Google/index.tsx +0 -57
  133. package/src/components/Map/Root/Popup/Google/popup.css +0 -15
  134. package/src/components/Map/Root/Popup/Mapbox/index.tsx +0 -36
  135. package/src/components/Map/Root/Popup/Mapbox/popup.css +0 -15
  136. package/src/components/Map/Root/Popup/Maptiler/index.tsx +0 -37
  137. package/src/components/Map/Root/Popup/Maptiler/popup.css +0 -15
  138. package/src/components/Map/Root/Popup/index.tsx +0 -32
  139. package/src/components/Map/Root/Popup/types.ts +0 -20
  140. package/src/components/Map/Root/constants.ts +0 -6
  141. package/src/components/Map/Root/context.tsx +0 -15
  142. package/src/components/Map/Root/index.tsx +0 -30
  143. package/src/components/Map/Root/types.ts +0 -30
  144. package/src/components/Map/index.stories.tsx +0 -134
  145. package/src/components/Map/index.test.tsx +0 -16
  146. package/src/components/Map/index.tsx +0 -1
  147. package/src/components/Map/storybook-data.ts +0 -255
  148. package/src/index.ts +0 -1
  149. package/tailwind.config.cjs +0 -1
  150. package/tsconfig.json +0 -14
  151. package/tsconfig.node.json +0 -8
  152. package/vite-env.d.ts +0 -13
  153. package/vite.config.ts +0 -46
@@ -0,0 +1,6 @@
1
+ function e(t) {
2
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
+ }
4
+ export {
5
+ e as g
6
+ };
@@ -0,0 +1,29 @@
1
+ import { jsx as r, jsxs as s, Fragment as d } from "react/jsx-runtime";
2
+ import { C as c, M as l } from "./index-CXjxZmYt.js";
3
+ import { a as f } from "./index.modern-EsUgbhzI.js";
4
+ import { c as g, i as h, b as t } from "./index-CwZ22Kq_.js";
5
+ function j({ clusters: e, onClick: o, children: m }) {
6
+ return e == null ? void 0 : e.map((a, p) => {
7
+ const i = a.geometry.coordinates[0], n = a.geometry.coordinates[1];
8
+ return /* @__PURE__ */ r(
9
+ f,
10
+ {
11
+ position: {
12
+ lat: n,
13
+ lng: i
14
+ },
15
+ onClick: () => {
16
+ o == null || o(a);
17
+ },
18
+ children: /* @__PURE__ */ r("div", { className: g, "data-is-cluster": !!a.properties.cluster, children: a.properties.cluster ? /* @__PURE__ */ r(c, { cluster: a }) : /* @__PURE__ */ s(d, { children: [
19
+ /* @__PURE__ */ r("div", { className: h, children: a.properties.icon ? /* @__PURE__ */ r(a.properties.icon, { className: t }) : /* @__PURE__ */ r(l, { className: t }) }),
20
+ m
21
+ ] }) })
22
+ },
23
+ `map-marker-${i}-${n}-${p}`
24
+ );
25
+ });
26
+ }
27
+ export {
28
+ j as default
29
+ };
@@ -0,0 +1,30 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { P as a } from "./scale-control-CyJd4u6j.js";
3
+ import "react";
4
+ import { c as s } from "./styles-uPzJnzVS.js";
5
+ function l({
6
+ latitude: o,
7
+ longitude: e,
8
+ anchor: r,
9
+ offset: f = [0, -35],
10
+ onClose: n,
11
+ children: t
12
+ }) {
13
+ return typeof o > "u" || typeof e > "u" ? null : /* @__PURE__ */ p(
14
+ a,
15
+ {
16
+ className: "mapbox-popup",
17
+ focusAfterOpen: !0,
18
+ latitude: o,
19
+ longitude: e,
20
+ anchor: r,
21
+ offset: f,
22
+ onClose: n,
23
+ closeButton: !1,
24
+ children: /* @__PURE__ */ p("div", { className: s, children: t })
25
+ }
26
+ );
27
+ }
28
+ export {
29
+ l as default
30
+ };
@@ -0,0 +1,39 @@
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { useEffect as m, useMemo as o } from "react";
3
+ import { u as s, I as d } from "./index.modern-EsUgbhzI.js";
4
+ import { c as f } from "./styles-uPzJnzVS.js";
5
+ function v({
6
+ latitude: n,
7
+ longitude: t,
8
+ offset: r = [0, -25],
9
+ onClose: e,
10
+ children: a
11
+ }) {
12
+ const i = s();
13
+ m(() => {
14
+ if (!i) return;
15
+ const c = i.addListener("click", () => {
16
+ e == null || e();
17
+ });
18
+ return () => {
19
+ c.remove();
20
+ };
21
+ }, [i]);
22
+ const p = o(() => Array.isArray(r) ? [r[0], r[1]] : [r, r], [r]);
23
+ return typeof n > "u" || typeof t > "u" ? null : /* @__PURE__ */ u(
24
+ d,
25
+ {
26
+ shouldFocus: !0,
27
+ position: {
28
+ lat: n,
29
+ lng: t
30
+ },
31
+ pixelOffset: p,
32
+ onClose: e,
33
+ children: /* @__PURE__ */ u("div", { className: f, children: a })
34
+ }
35
+ );
36
+ }
37
+ export {
38
+ v as default
39
+ };
@@ -0,0 +1,29 @@
1
+ import { jsx as r, jsxs as d, Fragment as c } from "react/jsx-runtime";
2
+ import { C as h, M as f } from "./index-CXjxZmYt.js";
3
+ import { a as g } from "./scale-control-CyJd4u6j.js";
4
+ import "react";
5
+ import { c as l, i as x, b as t } from "./index-CwZ22Kq_.js";
6
+ function k({ clusters: o, onClick: e, children: p }) {
7
+ return o == null ? void 0 : o.map((a, m) => {
8
+ const i = a.geometry.coordinates[0], n = a.geometry.coordinates[1];
9
+ return /* @__PURE__ */ r(
10
+ g,
11
+ {
12
+ anchor: "bottom",
13
+ longitude: i,
14
+ latitude: n,
15
+ onClick: (s) => {
16
+ s.originalEvent.stopPropagation(), e == null || e(a);
17
+ },
18
+ children: /* @__PURE__ */ r("div", { className: l, "data-is-cluster": !!a.properties.cluster, children: a.properties.cluster ? /* @__PURE__ */ r(h, { cluster: a }) : /* @__PURE__ */ d(c, { children: [
19
+ /* @__PURE__ */ r("div", { className: x, children: a.properties.icon ? /* @__PURE__ */ r(a.properties.icon, { className: t }) : /* @__PURE__ */ r(f, { className: t }) }),
20
+ p
21
+ ] }) })
22
+ },
23
+ `map-marker-${i}-${n}-${m}`
24
+ );
25
+ });
26
+ }
27
+ export {
28
+ k as default
29
+ };
@@ -0,0 +1,42 @@
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
+ import { useEffect as c } from "react";
3
+ import { M as f, N as d, u as M } from "./logo-control-NE-LlsRy.js";
4
+ import { u as s, d as o, a as h } from "./index-CwZ22Kq_.js";
5
+ const y = () => {
6
+ const { current: t } = M(), { setBounds: e } = s();
7
+ return c(() => {
8
+ t && e(t.getBounds().toArray().flat());
9
+ }, [t]), null;
10
+ };
11
+ function z({ children: t }) {
12
+ const {
13
+ mapProvider: e,
14
+ center: i,
15
+ zoom: n = o.zoom,
16
+ pitch: p = o.pitch,
17
+ bearing: m = o.bearing,
18
+ cooperativeGestures: u = o.cooperativeGestures,
19
+ zoomPosition: a
20
+ } = s();
21
+ return e.name !== "maptiler" ? null : /* @__PURE__ */ l(
22
+ f,
23
+ {
24
+ initialViewState: {
25
+ ...i,
26
+ zoom: n,
27
+ pitch: p,
28
+ bearing: m
29
+ },
30
+ cooperativeGestures: u,
31
+ mapStyle: `https://api.maptiler.com/maps/${e.theme || h.maptiler}/style.json?key=${e.apiKey}`,
32
+ children: [
33
+ /* @__PURE__ */ r(y, {}),
34
+ a && /* @__PURE__ */ r(d, { position: a }),
35
+ t
36
+ ]
37
+ }
38
+ );
39
+ }
40
+ export {
41
+ z as default
42
+ };
@@ -0,0 +1,63 @@
1
+ import { jsx as u, Fragment as h } from "react/jsx-runtime";
2
+ import { useState as i, useContext as P, useEffect as c } from "react";
3
+ import { G as M } from "./index.modern-EsUgbhzI.js";
4
+ import { a as x } from "./utils-YqJg0vBb.js";
5
+ function f(a, e) {
6
+ switch (a) {
7
+ case "fill":
8
+ return {
9
+ fillColor: e,
10
+ fillOpacity: 0.25
11
+ };
12
+ case "line":
13
+ return {
14
+ strokeColor: e,
15
+ strokeWeight: 2
16
+ };
17
+ default:
18
+ return {};
19
+ }
20
+ }
21
+ function d({ sources: a }) {
22
+ const [e, m] = i(null), [p, y] = i([]), o = P(M);
23
+ return c(() => {
24
+ o && m(o.map);
25
+ }, [o]), c(() => {
26
+ if (p.forEach((t) => {
27
+ t == null || t.setMap(null);
28
+ }), !e || typeof a > "u" || a.length === 0)
29
+ return;
30
+ const n = a.map((t) => {
31
+ const l = {
32
+ paths: x(t.geometry)
33
+ };
34
+ if (Array.isArray(t.layer))
35
+ t.layer.forEach((r) => {
36
+ const g = f(r.type, r.color);
37
+ Object.assign(l, g);
38
+ });
39
+ else {
40
+ const r = f(t.layer.type, t.layer.color);
41
+ Object.assign(l, r);
42
+ }
43
+ const s = new google.maps.Polygon({
44
+ // Set default options otherwise the polygon remains visible (even if eg: we only want the outline)
45
+ // We then overrider the default options with the layer options
46
+ strokeWeight: 0,
47
+ fillOpacity: 0,
48
+ ...l
49
+ });
50
+ return s.setMap(e), s;
51
+ });
52
+ return y(n), n.forEach((t) => {
53
+ t.setMap(e);
54
+ }), () => {
55
+ n.forEach((t) => {
56
+ t == null || t.setMap(null);
57
+ });
58
+ };
59
+ }, [e, a]), /* @__PURE__ */ u(h, {});
60
+ }
61
+ export {
62
+ d as default
63
+ };
@@ -0,0 +1,47 @@
1
+ import { jsxs as l, jsx as s } from "react/jsx-runtime";
2
+ import { useEffect as c } from "react";
3
+ import { M as f, N as d, u as b } from "./scale-control-CyJd4u6j.js";
4
+ import { u as n, d as a, a as x } from "./index-CwZ22Kq_.js";
5
+ const M = () => {
6
+ const { current: e } = b(), { setBounds: o } = n();
7
+ return c(() => {
8
+ if (!e)
9
+ return;
10
+ const t = e.getBounds();
11
+ t && o(t.toArray().flat());
12
+ }, [e]), null;
13
+ };
14
+ function w({ children: e }) {
15
+ const {
16
+ mapProvider: o,
17
+ center: t,
18
+ zoom: i = a.zoom,
19
+ pitch: p = a.pitch,
20
+ bearing: u = a.bearing,
21
+ cooperativeGestures: m = a.cooperativeGestures,
22
+ zoomPosition: r
23
+ } = n();
24
+ return o.name !== "mapbox" ? null : /* @__PURE__ */ l(
25
+ f,
26
+ {
27
+ mapboxAccessToken: o.apiKey,
28
+ initialViewState: {
29
+ ...t,
30
+ zoom: i,
31
+ pitch: p,
32
+ bearing: u
33
+ },
34
+ cooperativeGestures: m,
35
+ mapStyle: `mapbox://styles/${o.theme || x.mapbox}`,
36
+ interactiveLayerIds: ["road-label", "waterway-label"],
37
+ children: [
38
+ /* @__PURE__ */ s(M, {}),
39
+ r && /* @__PURE__ */ s(d, { position: r }),
40
+ e
41
+ ]
42
+ }
43
+ );
44
+ }
45
+ export {
46
+ w as default
47
+ };
@@ -0,0 +1,155 @@
1
+ import { jsx as u, Fragment as C } from "react/jsx-runtime";
2
+ import * as j from "react";
3
+ import { useContext as k, useRef as S, useState as b, useMemo as m, useEffect as w, cloneElement as I } from "react";
4
+ import { b as x, d as s } from "./logo-control-NE-LlsRy.js";
5
+ import { g as M } from "./utils-YqJg0vBb.js";
6
+ function g(t, e) {
7
+ if (!t)
8
+ throw new Error(e);
9
+ }
10
+ let $ = 0;
11
+ function z(t, e, n) {
12
+ if (t.style && t.style._loaded) {
13
+ const a = { ...n };
14
+ return delete a.id, delete a.children, t.addSource(e, a), t.getSource(e);
15
+ }
16
+ return null;
17
+ }
18
+ function A(t, e, n) {
19
+ var l, y, d;
20
+ g(e.id === n.id, "source id changed"), g(e.type === n.type, "source type changed");
21
+ let a = "", i = 0;
22
+ for (const f in e)
23
+ f !== "children" && f !== "id" && !s(n[f], e[f]) && (a = f, i++);
24
+ if (!i)
25
+ return;
26
+ const r = e.type;
27
+ if (r === "geojson")
28
+ t.setData(e.data);
29
+ else if (r === "image")
30
+ t.updateImage({
31
+ url: e.url,
32
+ coordinates: e.coordinates
33
+ });
34
+ else
35
+ switch (a) {
36
+ case "coordinates":
37
+ (l = t.setCoordinates) == null || l.call(t, e.coordinates);
38
+ break;
39
+ case "url":
40
+ (y = t.setUrl) == null || y.call(t, e.url);
41
+ break;
42
+ case "tiles":
43
+ (d = t.setTiles) == null || d.call(t, e.tiles);
44
+ break;
45
+ default:
46
+ console.warn(`Unable to update <Source> prop: ${a}`);
47
+ }
48
+ }
49
+ function E(t) {
50
+ const e = k(x).map.getMap(), n = S(t), [, a] = b(0), i = m(() => t.id || `jsx-source-${$++}`, []);
51
+ w(() => {
52
+ if (e) {
53
+ const l = () => setTimeout(() => a((y) => y + 1), 0);
54
+ return e.on("styledata", l), l(), () => {
55
+ var y;
56
+ if (e.off("styledata", l), e.style && e.style._loaded && e.getSource(i)) {
57
+ const d = (y = e.getStyle()) == null ? void 0 : y.layers;
58
+ if (d)
59
+ for (const f of d)
60
+ f.source === i && e.removeLayer(f.id);
61
+ e.removeSource(i);
62
+ }
63
+ };
64
+ }
65
+ }, [e]);
66
+ let r = e && e.style && e.getSource(i);
67
+ return r ? A(r, t, n.current) : r = z(e, i, t), n.current = t, r && j.Children.map(t.children, (l) => l && I(l, {
68
+ source: i
69
+ })) || null;
70
+ }
71
+ function F(t, e, n, a) {
72
+ if (g(n.id === a.id, "layer id changed"), g(n.type === a.type, "layer type changed"), n.type === "custom" || a.type === "custom")
73
+ return;
74
+ const { layout: i = {}, paint: r = {}, filter: l, minzoom: y, maxzoom: d, beforeId: f } = n;
75
+ if (f !== a.beforeId && t.moveLayer(e, f), i !== a.layout) {
76
+ const c = a.layout || {};
77
+ for (const o in i)
78
+ s(i[o], c[o]) || t.setLayoutProperty(e, o, i[o]);
79
+ for (const o in c)
80
+ i.hasOwnProperty(o) || t.setLayoutProperty(e, o, void 0);
81
+ }
82
+ if (r !== a.paint) {
83
+ const c = a.paint || {};
84
+ for (const o in r)
85
+ s(r[o], c[o]) || t.setPaintProperty(e, o, r[o]);
86
+ for (const o in c)
87
+ r.hasOwnProperty(o) || t.setPaintProperty(e, o, void 0);
88
+ }
89
+ s(l, a.filter) || t.setFilter(e, l), (y !== a.minzoom || d !== a.maxzoom) && t.setLayerZoomRange(e, y, d);
90
+ }
91
+ function R(t, e, n) {
92
+ if (t.style && t.style._loaded && (!("source" in n) || t.getSource(n.source))) {
93
+ const a = { ...n, id: e };
94
+ delete a.beforeId, t.addLayer(a, n.beforeId);
95
+ }
96
+ }
97
+ let U = 0;
98
+ function h(t) {
99
+ const e = k(x).map.getMap(), n = S(t), [, a] = b(0), i = m(() => t.id || `jsx-layer-${U++}`, []);
100
+ if (w(() => {
101
+ if (e) {
102
+ const l = () => a((y) => y + 1);
103
+ return e.on("styledata", l), l(), () => {
104
+ e.off("styledata", l), e.style && e.style._loaded && e.getLayer(i) && e.removeLayer(i);
105
+ };
106
+ }
107
+ }, [e]), e && e.style && e.getLayer(i))
108
+ try {
109
+ F(e, i, t, n.current);
110
+ } catch (l) {
111
+ console.warn(l);
112
+ }
113
+ else
114
+ R(e, i, t);
115
+ return n.current = t, null;
116
+ }
117
+ function L(t, e) {
118
+ switch (t) {
119
+ case "fill":
120
+ return {
121
+ "fill-color": e,
122
+ "fill-opacity": 0.25
123
+ };
124
+ case "line":
125
+ return {
126
+ "line-color": e,
127
+ "line-width": 2
128
+ };
129
+ default:
130
+ return {};
131
+ }
132
+ }
133
+ function T({ sources: t }) {
134
+ const e = m(() => !Array.isArray(t) || t.length === 0 ? [] : t.map((n) => ({
135
+ ...n,
136
+ geoJson: n.geometry ? M(n.geometry) : null
137
+ })), [t]);
138
+ return (e == null ? void 0 : e.length) === 0 ? null : /* @__PURE__ */ u(C, { children: e == null ? void 0 : e.map((n) => /* @__PURE__ */ u("div", { children: n.geoJson && /* @__PURE__ */ u(E, { id: n.key, type: "geojson", data: n.geoJson, children: n.layer && (Array.isArray(n.layer) ? n.layer.map((a, i) => /* @__PURE__ */ u(
139
+ h,
140
+ {
141
+ type: a.type,
142
+ paint: L(a.type, a.color)
143
+ },
144
+ `${n.key}-${i}`
145
+ )) : /* @__PURE__ */ u(
146
+ h,
147
+ {
148
+ type: n.layer.type,
149
+ paint: L(n.layer.type, n.layer.color)
150
+ }
151
+ )) }, n.key) }, n.key)) });
152
+ }
153
+ export {
154
+ T as default
155
+ };
@@ -0,0 +1,144 @@
1
+ import a, { createContext as M, forwardRef as g, useContext as P, useMemo as $ } from "react";
2
+ import { jsx as z } from "react/jsx-runtime";
3
+ const F = /* @__PURE__ */ new Map([
4
+ [
5
+ "bold",
6
+ /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement("path", { d: "M128,60a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,60Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,124Zm0-112a92.1,92.1,0,0,0-92,92c0,77.36,81.64,135.4,85.12,137.83a12,12,0,0,0,13.76,0,259,259,0,0,0,42.18-39C205.15,170.57,220,136.37,220,104A92.1,92.1,0,0,0,128,12Zm31.3,174.71A249.35,249.35,0,0,1,128,216.89a249.35,249.35,0,0,1-31.3-30.18C80,167.37,60,137.31,60,104a68,68,0,0,1,136,0C196,137.31,176,167.37,159.3,186.71Z" }))
7
+ ],
8
+ [
9
+ "duotone",
10
+ /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
11
+ "path",
12
+ {
13
+ d: "M128,24a80,80,0,0,0-80,80c0,72,80,128,80,128s80-56,80-128A80,80,0,0,0,128,24Zm0,112a32,32,0,1,1,32-32A32,32,0,0,1,128,136Z",
14
+ opacity: "0.2"
15
+ }
16
+ ), /* @__PURE__ */ a.createElement("path", { d: "M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z" }))
17
+ ],
18
+ [
19
+ "fill",
20
+ /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement("path", { d: "M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z" }))
21
+ ],
22
+ [
23
+ "light",
24
+ /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement("path", { d: "M128,66a38,38,0,1,0,38,38A38,38,0,0,0,128,66Zm0,64a26,26,0,1,1,26-26A26,26,0,0,1,128,130Zm0-112a86.1,86.1,0,0,0-86,86c0,30.91,14.34,63.74,41.47,94.94a252.32,252.32,0,0,0,41.09,38,6,6,0,0,0,6.88,0,252.32,252.32,0,0,0,41.09-38c27.13-31.2,41.47-64,41.47-94.94A86.1,86.1,0,0,0,128,18Zm0,206.51C113,212.93,54,163.62,54,104a74,74,0,0,1,148,0C202,163.62,143,212.93,128,224.51Z" }))
25
+ ],
26
+ [
27
+ "regular",
28
+ /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement("path", { d: "M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z" }))
29
+ ],
30
+ [
31
+ "thin",
32
+ /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement("path", { d: "M128,68a36,36,0,1,0,36,36A36,36,0,0,0,128,68Zm0,64a28,28,0,1,1,28-28A28,28,0,0,1,128,132Zm0-112a84.09,84.09,0,0,0-84,84c0,30.42,14.17,62.79,41,93.62a250,250,0,0,0,40.73,37.66,4,4,0,0,0,4.58,0A250,250,0,0,0,171,197.62c26.81-30.83,41-63.2,41-93.62A84.09,84.09,0,0,0,128,20Zm37.1,172.23A254.62,254.62,0,0,1,128,227a254.62,254.62,0,0,1-37.1-34.81C73.15,171.8,52,139.9,52,104a76,76,0,0,1,152,0C204,139.9,182.85,171.8,165.1,192.23Z" }))
33
+ ]
34
+ ]), _ = M({
35
+ color: "currentColor",
36
+ size: "1em",
37
+ weight: "regular",
38
+ mirrored: !1
39
+ });
40
+ var I = Object.defineProperty, o = Object.getOwnPropertySymbols, b = Object.prototype.hasOwnProperty, v = Object.prototype.propertyIsEnumerable, p = (r, e, t) => e in r ? I(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, u = (r, e) => {
41
+ for (var t in e || (e = {}))
42
+ b.call(e, t) && p(r, t, e[t]);
43
+ if (o)
44
+ for (var t of o(e))
45
+ v.call(e, t) && p(r, t, e[t]);
46
+ return r;
47
+ }, d = (r, e) => {
48
+ var t = {};
49
+ for (var n in r)
50
+ b.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
51
+ if (r != null && o)
52
+ for (var n of o(r))
53
+ e.indexOf(n) < 0 && v.call(r, n) && (t[n] = r[n]);
54
+ return t;
55
+ };
56
+ const w = g((r, e) => {
57
+ const t = r, {
58
+ alt: n,
59
+ color: i,
60
+ size: l,
61
+ weight: c,
62
+ mirrored: y,
63
+ children: A,
64
+ weights: Z
65
+ } = t, E = d(t, [
66
+ "alt",
67
+ "color",
68
+ "size",
69
+ "weight",
70
+ "mirrored",
71
+ "children",
72
+ "weights"
73
+ ]), m = P(_), {
74
+ color: C = "currentColor",
75
+ size: s,
76
+ weight: O = "regular",
77
+ mirrored: x = !1
78
+ } = m, j = d(m, [
79
+ "color",
80
+ "size",
81
+ "weight",
82
+ "mirrored"
83
+ ]);
84
+ return /* @__PURE__ */ a.createElement(
85
+ "svg",
86
+ u(u({
87
+ ref: e,
88
+ xmlns: "http://www.w3.org/2000/svg",
89
+ width: l ?? s,
90
+ height: l ?? s,
91
+ fill: i ?? C,
92
+ viewBox: "0 0 256 256",
93
+ transform: y || x ? "scale(-1, 1)" : void 0
94
+ }, j), E),
95
+ !!n && /* @__PURE__ */ a.createElement("title", null, n),
96
+ A,
97
+ Z.get(c ?? O)
98
+ );
99
+ });
100
+ w.displayName = "IconBase";
101
+ const B = w;
102
+ var N = Object.defineProperty, S = Object.defineProperties, R = Object.getOwnPropertyDescriptors, f = Object.getOwnPropertySymbols, D = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable, h = (r, e, t) => e in r ? N(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, q = (r, e) => {
103
+ for (var t in e || (e = {}))
104
+ D.call(e, t) && h(r, t, e[t]);
105
+ if (f)
106
+ for (var t of f(e))
107
+ k.call(e, t) && h(r, t, e[t]);
108
+ return r;
109
+ }, G = (r, e) => S(r, R(e));
110
+ const H = g((r, e) => /* @__PURE__ */ a.createElement(B, G(q({ ref: e }, r), { weights: F })));
111
+ H.displayName = "MapPin";
112
+ const J = `
113
+ rounded-full leading-none font-sans border-2
114
+ border-solid shadow-sm
115
+ flex justify-center items-center
116
+ bg-primary-100 text-base-white border-base-white
117
+ transition-all
118
+
119
+ hover:bg-base-white
120
+ hover:text-primary-100
121
+ hover:border-primary-100
122
+ `;
123
+ function Q({ cluster: r }) {
124
+ const e = $(
125
+ () => 20 + r.properties.point_count * 4,
126
+ [r.properties.point_count]
127
+ );
128
+ return /* @__PURE__ */ z(
129
+ "div",
130
+ {
131
+ className: J,
132
+ style: {
133
+ width: `${e}px`,
134
+ height: `${e}px`,
135
+ fontSize: `${e / 2.5}px`
136
+ },
137
+ children: r.properties.point_count
138
+ }
139
+ );
140
+ }
141
+ export {
142
+ Q as C,
143
+ H as M
144
+ };