@macrostrat/map-interface 1.2.3 → 1.3.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 (123) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/{container.b61e4d0f.js → container.fc5b1a23.js} +4 -4
  3. package/dist/cjs/{container.b61e4d0f.js.map → container.fc5b1a23.js.map} +1 -1
  4. package/dist/cjs/{context-panel.8c4b009c.js → context-panel.3061a63e.js} +2 -2
  5. package/dist/cjs/{context-panel.8c4b009c.js.map → context-panel.3061a63e.js.map} +1 -1
  6. package/dist/cjs/{controls.7ce3e95c.js → controls.9d7ddc44.js} +3 -3
  7. package/dist/cjs/{controls.7ce3e95c.js.map → controls.9d7ddc44.js.map} +1 -1
  8. package/dist/cjs/{dev.8ee72000.js → dev.079a11ee.js} +2 -2
  9. package/dist/cjs/{dev.8ee72000.js.map → dev.079a11ee.js.map} +1 -1
  10. package/dist/cjs/{header.b86c0710.js → header.356d9f4c.js} +3 -3
  11. package/dist/cjs/header.356d9f4c.js.map +1 -0
  12. package/dist/cjs/{helpers.0f72ddaf.js → helpers.5a745a3a.js} +21 -3
  13. package/dist/cjs/helpers.5a745a3a.js.map +1 -0
  14. package/dist/cjs/index.js +8 -8
  15. package/dist/cjs/{location-info.92e70042.js → location-info.99003993.js} +13 -3
  16. package/dist/cjs/location-info.99003993.js.map +1 -0
  17. package/dist/cjs/{location-panel.6a4dc310.js → location-panel.c5a55484.js} +4 -4
  18. package/dist/cjs/{location-panel.6a4dc310.js.map → location-panel.c5a55484.js.map} +1 -1
  19. package/dist/cjs/main.module.0bbfa859.js.map +1 -1
  20. package/dist/cjs/{main.module.3dbc089f.css → main.module.13eb33f8.css} +10 -1
  21. package/dist/cjs/main.module.13eb33f8.css.map +1 -0
  22. package/dist/cjs/{main.module.f085a193.css → main.module.16d04f5b.css} +19 -8
  23. package/dist/cjs/main.module.16d04f5b.css.map +1 -0
  24. package/dist/cjs/{main.module.62939ea7.js → main.module.e392b038.js} +4 -1
  25. package/dist/cjs/main.module.e392b038.js.map +1 -0
  26. package/dist/cjs/{main.module.92978d8b.css → main.module.e872989b.css} +2 -2
  27. package/dist/cjs/{main.module.92978d8b.css.map → main.module.e872989b.css.map} +1 -1
  28. package/dist/cjs/main.module.e958948e.js.map +1 -1
  29. package/dist/cjs/{map-page.cde24ee5.js → map-page.3c65558b.js} +9 -8
  30. package/dist/cjs/map-page.3c65558b.js.map +1 -0
  31. package/dist/cjs/{map-view.12e9ea3e.js → map-view.e031052e.js} +64 -36
  32. package/dist/cjs/map-view.e031052e.js.map +1 -0
  33. package/dist/esm/{container.2ebe27af.js → container.1c2aa81d.js} +5 -5
  34. package/dist/esm/{container.2ebe27af.js.map → container.1c2aa81d.js.map} +1 -1
  35. package/dist/esm/{context-panel.c288c5cd.js → context-panel.5dae1a8c.js} +2 -2
  36. package/dist/esm/{context-panel.c288c5cd.js.map → context-panel.5dae1a8c.js.map} +1 -1
  37. package/dist/esm/{controls.f757ce16.js → controls.8efb9074.js} +4 -4
  38. package/dist/esm/{controls.f757ce16.js.map → controls.8efb9074.js.map} +1 -1
  39. package/dist/esm/{dev.58b994e7.js → dev.3d88888b.js} +2 -2
  40. package/dist/esm/{dev.58b994e7.js.map → dev.3d88888b.js.map} +1 -1
  41. package/dist/esm/{header.b4aa864a.js → header.a3da6906.js} +3 -3
  42. package/dist/esm/header.a3da6906.js.map +1 -0
  43. package/dist/esm/{helpers.fb1d7227.js → helpers.d32a342a.js} +20 -4
  44. package/dist/esm/helpers.d32a342a.js.map +1 -0
  45. package/dist/esm/index.d.ts +29 -14
  46. package/dist/esm/index.d.ts.map +1 -1
  47. package/dist/esm/index.js +9 -9
  48. package/dist/esm/{location-info.5543bb05.js → location-info.4b39fdfc.js} +13 -3
  49. package/dist/esm/location-info.4b39fdfc.js.map +1 -0
  50. package/dist/esm/{location-panel.f22673f5.js → location-panel.c9942d88.js} +4 -4
  51. package/dist/esm/{location-panel.f22673f5.js.map → location-panel.c9942d88.js.map} +1 -1
  52. package/dist/esm/main.module.303f6d99.js.map +1 -1
  53. package/dist/esm/{main.module.f70e002b.js → main.module.504d756b.js} +4 -1
  54. package/dist/esm/main.module.504d756b.js.map +1 -0
  55. package/dist/esm/main.module.9c57cc95.js.map +1 -1
  56. package/dist/esm/{map-page.f9f59ea0.js → map-page.660a1723.js} +9 -8
  57. package/dist/esm/map-page.660a1723.js.map +1 -0
  58. package/dist/esm/{map-view.4f256782.js → map-view.d1c5b113.js} +68 -40
  59. package/dist/esm/map-view.d1c5b113.js.map +1 -0
  60. package/dist/node/container.ab523076.js +2 -0
  61. package/dist/node/{container.abd6f0d2.js.map → container.ab523076.js.map} +1 -1
  62. package/dist/node/{context-panel.7c2f42c9.js → context-panel.0ae29ecf.js} +2 -2
  63. package/dist/node/{context-panel.7c2f42c9.js.map → context-panel.0ae29ecf.js.map} +1 -1
  64. package/dist/node/{controls.ffb44307.js → controls.511f309b.js} +2 -2
  65. package/dist/node/{controls.ffb44307.js.map → controls.511f309b.js.map} +1 -1
  66. package/dist/node/{dev.3cbf6106.js → dev.709287ba.js} +2 -2
  67. package/dist/node/{dev.3cbf6106.js.map → dev.709287ba.js.map} +1 -1
  68. package/dist/node/header.98a4cf12.js +2 -0
  69. package/dist/node/{header.4b58753a.js.map → header.98a4cf12.js.map} +1 -1
  70. package/dist/node/helpers.6bda171f.js.map +1 -1
  71. package/dist/node/index.js +1 -1
  72. package/dist/node/index.js.map +1 -1
  73. package/dist/node/location-info.db66c3fb.js +2 -0
  74. package/dist/node/location-info.db66c3fb.js.map +1 -0
  75. package/dist/node/{location-panel.c39983e3.js → location-panel.dd1d2b37.js} +2 -2
  76. package/dist/node/{location-panel.c39983e3.js.map → location-panel.dd1d2b37.js.map} +1 -1
  77. package/dist/node/{main.module.ba3f4a78.css → main.module.3943144e.css} +2 -2
  78. package/dist/node/main.module.3943144e.css.map +1 -0
  79. package/dist/node/main.module.7c928a6f.js +2 -0
  80. package/dist/node/main.module.7c928a6f.js.map +1 -0
  81. package/dist/node/{main.module.61b261c8.css → main.module.8a9943af.css} +2 -2
  82. package/dist/node/main.module.8a9943af.css.map +1 -0
  83. package/dist/node/main.module.91a06e96.css +2 -0
  84. package/dist/node/main.module.91a06e96.css.map +1 -0
  85. package/dist/node/{map-page.f99c4a48.js → map-page.a9602658.js} +2 -2
  86. package/dist/node/map-page.a9602658.js.map +1 -0
  87. package/dist/node/{map-view.77013338.js → map-view.663640da.js} +2 -2
  88. package/dist/node/map-view.663640da.js.map +1 -0
  89. package/package.json +5 -5
  90. package/src/context-panel/main.module.sass +1 -1
  91. package/src/dev/map-page.ts +2 -10
  92. package/src/helpers.ts +31 -4
  93. package/src/location-info/index.ts +15 -6
  94. package/src/location-panel/header.ts +5 -3
  95. package/src/location-panel/main.module.sass +5 -0
  96. package/src/main.module.sass +15 -8
  97. package/src/map-view.ts +92 -45
  98. package/dist/cjs/header.b86c0710.js.map +0 -1
  99. package/dist/cjs/helpers.0f72ddaf.js.map +0 -1
  100. package/dist/cjs/location-info.92e70042.js.map +0 -1
  101. package/dist/cjs/main.module.3dbc089f.css.map +0 -1
  102. package/dist/cjs/main.module.62939ea7.js.map +0 -1
  103. package/dist/cjs/main.module.f085a193.css.map +0 -1
  104. package/dist/cjs/map-page.cde24ee5.js.map +0 -1
  105. package/dist/cjs/map-view.12e9ea3e.js.map +0 -1
  106. package/dist/esm/header.b4aa864a.js.map +0 -1
  107. package/dist/esm/helpers.fb1d7227.js.map +0 -1
  108. package/dist/esm/location-info.5543bb05.js.map +0 -1
  109. package/dist/esm/main.module.f70e002b.js.map +0 -1
  110. package/dist/esm/map-page.f9f59ea0.js.map +0 -1
  111. package/dist/esm/map-view.4f256782.js.map +0 -1
  112. package/dist/node/container.abd6f0d2.js +0 -2
  113. package/dist/node/header.4b58753a.js +0 -2
  114. package/dist/node/location-info.9f59aad3.js +0 -2
  115. package/dist/node/location-info.9f59aad3.js.map +0 -1
  116. package/dist/node/main.module.24615279.js +0 -2
  117. package/dist/node/main.module.24615279.js.map +0 -1
  118. package/dist/node/main.module.61b261c8.css.map +0 -1
  119. package/dist/node/main.module.89f269c7.css +0 -2
  120. package/dist/node/main.module.89f269c7.css.map +0 -1
  121. package/dist/node/main.module.ba3f4a78.css.map +0 -1
  122. package/dist/node/map-page.f99c4a48.js.map +0 -1
  123. package/dist/node/map-view.77013338.js.map +0 -1
@@ -1,13 +1,13 @@
1
- import $jKrEn$mainmodulef70e002bjs from "./main.module.f70e002b.js";
2
- import "../cjs/main.module.f085a193.css";
3
- import {MapLoadingReporter as $4bc3dd5f0732eed3$export$e57f9eaa51773f82, MapMovedReporter as $4bc3dd5f0732eed3$export$f6eeee399afc4e9a, MapPaddingManager as $4bc3dd5f0732eed3$export$2ab96428dea558d6, MapResizeManager as $4bc3dd5f0732eed3$export$31b2e088aff2dc5d} from "./helpers.fb1d7227.js";
1
+ import $jKrEn$mainmodule504d756bjs from "./main.module.504d756b.js";
2
+ import "../cjs/main.module.16d04f5b.css";
3
+ import {MapLoadingReporter as $4bc3dd5f0732eed3$export$e57f9eaa51773f82, MapMovedReporter as $4bc3dd5f0732eed3$export$f6eeee399afc4e9a, MapResizeManager as $4bc3dd5f0732eed3$export$31b2e088aff2dc5d, MapPaddingManager as $4bc3dd5f0732eed3$export$2ab96428dea558d6} from "./helpers.d32a342a.js";
4
4
  import {getMapPadding as $82fe09613877ffc2$export$bb78f9f01775eef1} from "./utils.d40349f0.js";
5
5
  import $jKrEn$macrostrathyper from "@macrostrat/hyper";
6
- import {useMapDispatch as $jKrEn$useMapDispatch, useMapRef as $jKrEn$useMapRef, addTerrainToStyle as $jKrEn$addTerrainToStyle, useMapPosition as $jKrEn$useMapPosition, use3DTerrain as $jKrEn$use3DTerrain} from "@macrostrat/mapbox-react";
7
- import {setMapPosition as $jKrEn$setMapPosition, getMapPosition as $jKrEn$getMapPosition, mapViewInfo as $jKrEn$mapViewInfo, getMapboxStyle as $jKrEn$getMapboxStyle} from "@macrostrat/mapbox-utils";
6
+ import {useMapDispatch as $jKrEn$useMapDispatch, useMapRef as $jKrEn$useMapRef, useMapStatus as $jKrEn$useMapStatus, getTerrainLayerForStyle as $jKrEn$getTerrainLayerForStyle, useMapPosition as $jKrEn$useMapPosition, use3DTerrain as $jKrEn$use3DTerrain} from "@macrostrat/mapbox-react";
7
+ import {setMapPosition as $jKrEn$setMapPosition, getMapPosition as $jKrEn$getMapPosition, mapViewInfo as $jKrEn$mapViewInfo, mergeStyles as $jKrEn$mergeStyles, getMapboxStyle as $jKrEn$getMapboxStyle} from "@macrostrat/mapbox-utils";
8
8
  import $jKrEn$classnames from "classnames";
9
9
  import $jKrEn$mapboxgl from "mapbox-gl";
10
- import {useRef as $jKrEn$useRef} from "react";
10
+ import {useRef as $jKrEn$useRef, useState as $jKrEn$useState, useEffect as $jKrEn$useEffect} from "react";
11
11
  import "mapbox-gl/dist/mapbox-gl.css";
12
12
  import {useAsyncEffect as $jKrEn$useAsyncEffect} from "@macrostrat/ui-components";
13
13
 
@@ -26,23 +26,23 @@ function $parcel$interopDefault(a) {
26
26
 
27
27
 
28
28
 
29
- const $0118fc9193bb1bf4$var$h = (0, $jKrEn$macrostrathyper).styled((0, ($parcel$interopDefault($jKrEn$mainmodulef70e002bjs))));
29
+ const $0118fc9193bb1bf4$var$h = (0, $jKrEn$macrostrathyper).styled((0, ($parcel$interopDefault($jKrEn$mainmodule504d756bjs))));
30
30
  function $0118fc9193bb1bf4$var$defaultInitializeMap(container, args = {}) {
31
31
  const { mapPosition: mapPosition, ...rest } = args;
32
- console.log("Initializing map (default)", args);
33
32
  const map = new (0, $jKrEn$mapboxgl).Map({
34
33
  container: container,
35
34
  maxZoom: 18,
36
- //maxTileCacheSize: 0,
37
35
  logoPosition: "bottom-left",
38
36
  trackResize: true,
39
37
  antialias: true,
40
38
  optimizeForTerrain: true,
41
39
  ...rest
42
40
  });
41
+ let _mapPosition = mapPosition;
42
+ if (_mapPosition == null && rest.center == null && rest.bounds == null) // If no map positioning information is provided, we use the default
43
+ _mapPosition = $0118fc9193bb1bf4$var$defaultMapPosition;
43
44
  // set initial map position
44
- if (mapPosition != null) (0, $jKrEn$setMapPosition)(map, mapPosition);
45
- //setMapPosition(map, mapPosition);
45
+ if (_mapPosition != null) (0, $jKrEn$setMapPosition)(map, _mapPosition);
46
46
  return map;
47
47
  }
48
48
  const $0118fc9193bb1bf4$var$defaultMapPosition = {
@@ -54,8 +54,8 @@ const $0118fc9193bb1bf4$var$defaultMapPosition = {
54
54
  };
55
55
  function $0118fc9193bb1bf4$export$ab1e7a67d6ec5ad8(props) {
56
56
  let { terrainSourceID: terrainSourceID } = props;
57
- const { enableTerrain: enableTerrain = true, style: style, mapPosition: mapPosition = $0118fc9193bb1bf4$var$defaultMapPosition, initializeMap: initializeMap = $0118fc9193bb1bf4$var$defaultInitializeMap, children: children, mapboxToken: mapboxToken, accessToken: // Deprecated
58
- accessToken, infoMarkerPosition: infoMarkerPosition, transformRequest: transformRequest, projection: projection, onMapLoaded: onMapLoaded = null, onStyleLoaded: onStyleLoaded = null, onMapMoved: onMapMoved = null, ...rest } = props;
57
+ const { enableTerrain: enableTerrain = true, style: style, mapPosition: mapPosition, initializeMap: initializeMap = $0118fc9193bb1bf4$var$defaultInitializeMap, children: children, mapboxToken: mapboxToken, accessToken: // Deprecated
58
+ accessToken, infoMarkerPosition: infoMarkerPosition, transformRequest: transformRequest, projection: projection, onMapLoaded: onMapLoaded = null, onStyleLoaded: onStyleLoaded = null, onMapMoved: onMapMoved = null, standalone: standalone = false, overlayStyles: overlayStyles, transformStyle: transformStyle, ...rest } = props;
59
59
  if (enableTerrain) terrainSourceID ??= "mapbox-3d-dem";
60
60
  const _mapboxToken = mapboxToken ?? accessToken;
61
61
  if (_mapboxToken != null) (0, $jKrEn$mapboxgl).accessToken = _mapboxToken;
@@ -63,8 +63,10 @@ function $0118fc9193bb1bf4$export$ab1e7a67d6ec5ad8(props) {
63
63
  let mapRef = (0, $jKrEn$useMapRef)();
64
64
  const ref = (0, $jKrEn$useRef)();
65
65
  const parentRef = (0, $jKrEn$useRef)();
66
- (0, $jKrEn$useAsyncEffect)(async ()=>{
67
- /** Manager to update map style */ if (style == null) return;
66
+ const [baseStyle, setBaseStyle] = (0, $jKrEn$useState)(null);
67
+ const isStyleLoaded = (0, $jKrEn$useMapStatus)((state)=>state.isStyleLoaded);
68
+ (0, $jKrEn$useEffect)(()=>{
69
+ /** Manager to update map style */ if (baseStyle == null) return;
68
70
  let map = mapRef.current;
69
71
  /** If we can, we try to update the map style with terrain information
70
72
  * immediately, before the style is loaded. This allows us to avoid a
@@ -74,17 +76,22 @@ function $0118fc9193bb1bf4$export$ab1e7a67d6ec5ad8(props) {
74
76
  * doesn't always work.
75
77
  */ // We either get the map position directly from the map or from props
76
78
  const estMapPosition = map == null ? mapPosition : (0, $jKrEn$getMapPosition)(map);
77
- let newStyle = style;
78
79
  const { mapUse3D: mapUse3D } = (0, $jKrEn$mapViewInfo)(estMapPosition);
79
- /** If style is a string, we can't update it with terrain layers immediately.
80
- * We need to wait for the style to load and then update it.
81
- */ if (typeof style === "string") newStyle = await (0, $jKrEn$getMapboxStyle)(style, {
82
- access_token: (0, $jKrEn$mapboxgl).accessToken
83
- });
84
- if (mapUse3D) // We can update the style with terrain layers immediately
85
- newStyle = (0, $jKrEn$addTerrainToStyle)(newStyle, terrainSourceID);
80
+ let newStyle = baseStyle;
81
+ const overlayStyles = props.overlayStyles ?? [];
82
+ if (overlayStyles.length > 0) newStyle = (0, $jKrEn$mergeStyles)(newStyle, ...overlayStyles);
83
+ if (mapUse3D) {
84
+ // We can update the style with terrain layers immediately
85
+ const terrainStyle = (0, $jKrEn$getTerrainLayerForStyle)(newStyle, terrainSourceID);
86
+ newStyle = (0, $jKrEn$mergeStyles)(newStyle, terrainStyle);
87
+ }
88
+ if (transformStyle != null) newStyle = transformStyle(newStyle);
86
89
  if (map != null) {
87
90
  console.log("Setting style", newStyle);
91
+ dispatch({
92
+ type: "set-style-loaded",
93
+ payload: false
94
+ });
88
95
  map.setStyle(newStyle);
89
96
  } else {
90
97
  console.log("Initializing map", newStyle);
@@ -104,21 +111,38 @@ function $0118fc9193bb1bf4$export$ab1e7a67d6ec5ad8(props) {
104
111
  });
105
112
  onMapLoaded?.(map);
106
113
  }
107
- const loadCallback = ()=>{
108
- onStyleLoaded?.(map);
109
- // Set initial terrain state
110
- dispatch({
111
- type: "set-style-loaded",
112
- payload: true
113
- });
114
- };
115
- map = mapRef.current;
116
- if (map.style?._loaded) // Catch a race condition where the style is loaded before the callback is set
117
- loadCallback();
118
- map.on("style.load", loadCallback);
119
- return ()=>{
120
- map.off("style.load", loadCallback);
121
- };
114
+ }, [
115
+ baseStyle,
116
+ overlayStyles,
117
+ transformStyle
118
+ ]);
119
+ /** Check back every 0.1 seconds to see if the map has loaded.
120
+ * We do it this way because mapboxgl loading events are unreliable */ (0, $jKrEn$useEffect)(()=>{
121
+ if (isStyleLoaded) return;
122
+ const interval = setInterval(()=>{
123
+ const map = mapRef.current;
124
+ if (map == null) return;
125
+ if (map.isStyleLoaded()) {
126
+ // Wait a tick before setting the style loaded state
127
+ dispatch({
128
+ type: "set-style-loaded",
129
+ payload: true
130
+ });
131
+ onStyleLoaded?.(map);
132
+ clearInterval(interval);
133
+ }
134
+ }, 50);
135
+ return ()=>clearInterval(interval);
136
+ }, [
137
+ isStyleLoaded
138
+ ]);
139
+ (0, $jKrEn$useAsyncEffect)(async ()=>{
140
+ /** Manager to update map style */ let newStyle;
141
+ if (typeof style === "string") newStyle = await (0, $jKrEn$getMapboxStyle)(style, {
142
+ access_token: (0, $jKrEn$mapboxgl).accessToken
143
+ });
144
+ else newStyle = style;
145
+ setBaseStyle(newStyle);
122
146
  }, [
123
147
  style
124
148
  ]);
@@ -130,8 +154,12 @@ function $0118fc9193bb1bf4$export$ab1e7a67d6ec5ad8(props) {
130
154
  "is-rotated": mapIsRotated ?? false,
131
155
  "is-3d-available": mapUse3D ?? false
132
156
  }, `${_projection}-projection`);
157
+ const parentClassName = (0, $jKrEn$classnames)({
158
+ standalone: standalone
159
+ });
133
160
  return $0118fc9193bb1bf4$var$h("div.map-view-container.main-view", {
134
- ref: parentRef
161
+ ref: parentRef,
162
+ className: parentClassName
135
163
  }, [
136
164
  $0118fc9193bb1bf4$var$h("div.mapbox-map#map", {
137
165
  ref: ref,
@@ -169,4 +197,4 @@ function $0118fc9193bb1bf4$export$cee395a8a2a00b29({ mapUse3D: mapUse3D, terrain
169
197
 
170
198
 
171
199
  export {$0118fc9193bb1bf4$export$ab1e7a67d6ec5ad8 as MapView, $0118fc9193bb1bf4$export$cee395a8a2a00b29 as MapTerrainManager};
172
- //# sourceMappingURL=map-view.4f256782.js.map
200
+ //# sourceMappingURL=map-view.d1c5b113.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,sEAAK;AAmC5B,SAAS,2CAAqB,SAAS,EAAE,OAAyB,CAAC,CAAC;IAClE,MAAM,eAAE,WAAW,EAAE,GAAG,MAAM,GAAG;IAEjC,MAAM,MAAM,IAAI,CAAA,GAAA,eAAO,EAAE,GAAG,CAAC;mBAC3B;QACA,SAAS;QACT,cAAc;QACd,aAAa;QACb,WAAW;QACX,oBAAoB;QACpB,GAAG,IAAI;IACT;IAEA,IAAI,eAAe;IACnB,IAAI,gBAAgB,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,MAAM,IAAI,MAChE,oEAAoE;IACpE,eAAe;IAGjB,2BAA2B;IAC3B,IAAI,gBAAgB,MAClB,CAAA,GAAA,qBAAa,EAAE,KAAK;IAGtB,OAAO;AACT;AAEA,MAAM,2CAAkC;IACtC,QAAQ;QACN,KAAK;QACL,KAAK;QACL,UAAU;IACZ;AACF;AAEO,SAAS,0CAAQ,KAAmB;IACzC,IAAI,mBAAE,eAAe,EAAE,GAAG;IAC1B,MAAM,iBACJ,gBAAgB,aAChB,KAAK,eACL,WAAW,iBACX,gBAAgB,sDAChB,QAAQ,eACR,WAAW,eACX,aAAa;IACb,WAAW,sBACX,kBAAkB,oBAClB,gBAAgB,cAChB,UAAU,eACV,cAAc,qBACd,gBAAgB,kBAChB,aAAa,kBACb,aAAa,sBACb,aAAa,kBACb,cAAc,EACd,GAAG,MACJ,GAAG;IACJ,IAAI,eACF,oBAAoB;IAGtB,MAAM,eAAe,eAAe;IAEpC,IAAI,gBAAgB,MAClB,CAAA,GAAA,eAAO,EAAE,WAAW,GAAG;IAGzB,MAAM,WAAW,CAAA,GAAA,qBAAa;IAC9B,IAAI,SAAS,CAAA,GAAA,gBAAQ;IACrB,MAAM,MAAM,CAAA,GAAA,aAAK;IACjB,MAAM,YAAY,CAAA,GAAA,aAAK;IAEvB,MAAM,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,eAAO,EAAkB;IAC3D,MAAM,gBAAgB,CAAA,GAAA,mBAAW,EAAE,CAAC,QAAU,MAAM,aAAa;IAEjE,CAAA,GAAA,gBAAQ,EAAE;QACR,gCAAgC,GAChC,IAAI,aAAa,MAAM;QACvB,IAAI,MAAM,OAAO,OAAO;QAExB;;;;;;KAMC,GACD,qEAAqE;QACrE,MAAM,iBACJ,OAAO,OAAO,cAAc,CAAA,GAAA,qBAAa,EAAE;QAC7C,MAAM,YAAE,QAAQ,EAAE,GAAG,CAAA,GAAA,kBAAU,EAAE;QAEjC,IAAI,WAA2B;QAE/B,MAAM,gBAAgB,MAAM,aAAa,IAAI,EAAE;QAE/C,IAAI,cAAc,MAAM,GAAG,GACzB,WAAW,CAAA,GAAA,kBAAU,EAAE,aAAa;QAGtC,IAAI,UAAU;YACZ,0DAA0D;YAC1D,MAAM,eAAe,CAAA,GAAA,8BAAsB,EAAE,UAAU;YACvD,WAAW,CAAA,GAAA,kBAAU,EAAE,UAAU;QACnC;QAEA,IAAI,kBAAkB,MACpB,WAAW,eAAe;QAG5B,IAAI,OAAO,MAAM;YACf,QAAQ,GAAG,CAAC,iBAAiB;YAC7B,SAAS;gBAAE,MAAM;gBAAoB,SAAS;YAAM;YACpD,IAAI,QAAQ,CAAC;QACf,OAAO;YACL,QAAQ,GAAG,CAAC,oBAAoB;YAChC,MAAM,MAAM,cAAc,IAAI,OAAO,EAAE;gBACrC,OAAO;4BACP;6BACA;kCACA;gBACA,GAAG,IAAI;YACT;YACA,SAAS;gBAAE,MAAM;gBAAW,SAAS;YAAI;YACzC,IAAI,UAAU,CAAC,CAAA,GAAA,yCAAY,EAAE,KAAK,YAAY;gBAAE,SAAS;YAAM;YAC/D,cAAc;QAChB;IACF,GAAG;QAAC;QAAW;QAAe;KAAe;IAE7C;sEACoE,GACpE,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,eAAe;QACnB,MAAM,WAAW,YAAY;YAC3B,MAAM,MAAM,OAAO,OAAO;YAC1B,IAAI,OAAO,MAAM;YACjB,IAAI,IAAI,aAAa,IAAI;gBACvB,oDAAoD;gBACpD,SAAS;oBAAE,MAAM;oBAAoB,SAAS;gBAAK;gBACnD,gBAAgB;gBAChB,cAAc;YAChB;QACF,GAAG;QACH,OAAO,IAAM,cAAc;IAC7B,GAAG;QAAC;KAAc;IAElB,CAAA,GAAA,qBAAa,EAAE;QACb,gCAAgC,GAChC,IAAI;QACJ,IAAI,OAAO,UAAU,UACnB,WAAW,MAAM,CAAA,GAAA,qBAAa,EAAE,OAAO;YACrC,cAAc,CAAA,GAAA,eAAO,EAAE,WAAW;QACpC;aAEA,WAAW;QAEb,aAAa;IACf,GAAG;QAAC;KAAM;IAEV,MAAM,uBAAuB,CAAA,GAAA,qBAAa;IAC1C,MAAM,YAAE,QAAQ,gBAAE,YAAY,EAAE,GAAG,CAAA,GAAA,kBAAU,EAAE;IAE/C,qBAAqB;IACrB,MAAM,cAAc,OAAO,OAAO,EAAE,iBAAiB,QAAQ;IAE7D,MAAM,YAAY,CAAA,GAAA,iBAAS,EACzB;QACE,cAAc,gBAAgB;QAC9B,mBAAmB,YAAY;IACjC,GACA,GAAG,YAAY,WAAW,CAAC;IAG7B,MAAM,kBAAkB,CAAA,GAAA,iBAAS,EAAE;oBACjC;IACF;IAEA,OAAO,wBACL,oCACA;QAAE,KAAK;QAAW,WAAW;IAAgB,GAC7C;QACE,wBAAE,sBAAsB;iBAAE;uBAAK;QAAU;QACzC,wBAAE,CAAA,GAAA,yCAAiB,GAAG;YACpB,gBAAgB;gBAAC;gBAAmB;aAAwB;QAC9D;QACA,wBAAE,CAAA,GAAA,yCAAe,GAAG;wBAAE;QAAW;QACjC,wBAAE,CAAA,GAAA,yCAAe,GAAG;YAAE,cAAc;QAAI;QACxC,wBAAE,CAAA,GAAA,yCAAgB,GAAG;YACnB,cAAc;uBACd;gCACA;QACF;QACA,wBAAE,2CAAmB;sBAAE;6BAAU;mBAAiB;QAAM;QACxD;KACD;AAEL;AAEO,SAAS,0CAAkB,YAChC,QAAQ,mBACR,eAAe,SACf,KAAK,EAKN;IACC,CAAA,GAAA,mBAAW,EAAE,UAAU;IAEvB,OAAO;AACT","sources":["packages/map-interface/src/map-view.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport {\n useMapRef,\n useMapDispatch,\n useMapPosition,\n use3DTerrain,\n getTerrainLayerForStyle,\n useMapStatus,\n} from \"@macrostrat/mapbox-react\";\nimport {\n mapViewInfo,\n MapPosition,\n setMapPosition,\n getMapPosition,\n getMapboxStyle,\n mergeStyles,\n} from \"@macrostrat/mapbox-utils\";\nimport classNames from \"classnames\";\nimport mapboxgl from \"mapbox-gl\";\nimport { useEffect, useRef, useState } from \"react\";\nimport styles from \"./main.module.sass\";\nimport {\n MapLoadingReporter,\n MapMovedReporter,\n MapPaddingManager,\n MapResizeManager,\n} from \"./helpers\";\nimport \"mapbox-gl/dist/mapbox-gl.css\";\nimport { getMapPadding } from \"./utils\";\nimport { useAsyncEffect } from \"@macrostrat/ui-components\";\n\nconst h = hyper.styled(styles);\n\ntype MapboxCoreOptions = Omit<mapboxgl.MapboxOptions, \"container\">;\n\nexport interface MapViewProps extends MapboxCoreOptions {\n showLineSymbols?: boolean;\n children?: React.ReactNode;\n mapboxToken?: string;\n // Deprecated\n accessToken?: string;\n terrainSourceID?: string;\n enableTerrain?: boolean;\n infoMarkerPosition?: mapboxgl.LngLatLike;\n mapPosition?: MapPosition;\n initializeMap?: (\n container: HTMLElement,\n args: MapboxOptionsExt\n ) => mapboxgl.Map;\n onMapLoaded?: (map: mapboxgl.Map) => void;\n onStyleLoaded?: (map: mapboxgl.Map) => void;\n onMapMoved?: (mapPosition: MapPosition, map: mapboxgl.Map) => void;\n /** This map sets its own viewport, rather than being positioned by a parent.\n * This is a hack to ensure that the map can overflow its \"safe area\" when false */\n standalone?: boolean;\n /** Overlay styles to apply to the map: a list of mapbox style objects or fragments to\n * overlay on top of the main map style at runtime */\n overlayStyles?: Partial<mapboxgl.Style>[];\n /** A function to transform the map style before it is loaded */\n transformStyle?: (style: mapboxgl.Style) => mapboxgl.Style;\n}\n\nexport interface MapboxOptionsExt extends MapboxCoreOptions {\n mapPosition?: MapPosition;\n}\n\nfunction defaultInitializeMap(container, args: MapboxOptionsExt = {}) {\n const { mapPosition, ...rest } = args;\n\n const map = new mapboxgl.Map({\n container,\n maxZoom: 18,\n logoPosition: \"bottom-left\",\n trackResize: true,\n antialias: true,\n optimizeForTerrain: true,\n ...rest,\n });\n\n let _mapPosition = mapPosition;\n if (_mapPosition == null && rest.center == null && rest.bounds == null) {\n // If no map positioning information is provided, we use the default\n _mapPosition = defaultMapPosition;\n }\n\n // set initial map position\n if (_mapPosition != null) {\n setMapPosition(map, _mapPosition);\n }\n\n return map;\n}\n\nconst defaultMapPosition: MapPosition = {\n camera: {\n lat: 34,\n lng: -120,\n altitude: 300000,\n },\n};\n\nexport function MapView(props: MapViewProps) {\n let { terrainSourceID } = props;\n const {\n enableTerrain = true,\n style,\n mapPosition,\n initializeMap = defaultInitializeMap,\n children,\n mapboxToken,\n // Deprecated\n accessToken,\n infoMarkerPosition,\n transformRequest,\n projection,\n onMapLoaded = null,\n onStyleLoaded = null,\n onMapMoved = null,\n standalone = false,\n overlayStyles,\n transformStyle,\n ...rest\n } = props;\n if (enableTerrain) {\n terrainSourceID ??= \"mapbox-3d-dem\";\n }\n\n const _mapboxToken = mapboxToken ?? accessToken;\n\n if (_mapboxToken != null) {\n mapboxgl.accessToken = _mapboxToken;\n }\n\n const dispatch = useMapDispatch();\n let mapRef = useMapRef();\n const ref = useRef<HTMLDivElement>();\n const parentRef = useRef<HTMLDivElement>();\n\n const [baseStyle, setBaseStyle] = useState<mapboxgl.Style>(null);\n const isStyleLoaded = useMapStatus((state) => state.isStyleLoaded);\n\n useEffect(() => {\n /** Manager to update map style */\n if (baseStyle == null) return;\n let map = mapRef.current;\n\n /** If we can, we try to update the map style with terrain information\n * immediately, before the style is loaded. This allows us to avoid a\n * flash of the map without terrain.\n *\n * To do this, we need to estimate the map position before load, which\n * doesn't always work.\n */\n // We either get the map position directly from the map or from props\n const estMapPosition: MapPosition | null =\n map == null ? mapPosition : getMapPosition(map);\n const { mapUse3D } = mapViewInfo(estMapPosition);\n\n let newStyle: mapboxgl.Style = baseStyle;\n\n const overlayStyles = props.overlayStyles ?? [];\n\n if (overlayStyles.length > 0) {\n newStyle = mergeStyles(newStyle, ...overlayStyles);\n }\n\n if (mapUse3D) {\n // We can update the style with terrain layers immediately\n const terrainStyle = getTerrainLayerForStyle(newStyle, terrainSourceID);\n newStyle = mergeStyles(newStyle, terrainStyle);\n }\n\n if (transformStyle != null) {\n newStyle = transformStyle(newStyle);\n }\n\n if (map != null) {\n console.log(\"Setting style\", newStyle);\n dispatch({ type: \"set-style-loaded\", payload: false });\n map.setStyle(newStyle);\n } else {\n console.log(\"Initializing map\", newStyle);\n const map = initializeMap(ref.current, {\n style: newStyle,\n projection,\n mapPosition,\n transformRequest,\n ...rest,\n });\n dispatch({ type: \"set-map\", payload: map });\n map.setPadding(getMapPadding(ref, parentRef), { animate: false });\n onMapLoaded?.(map);\n }\n }, [baseStyle, overlayStyles, transformStyle]);\n\n /** Check back every 0.1 seconds to see if the map has loaded.\n * We do it this way because mapboxgl loading events are unreliable */\n useEffect(() => {\n if (isStyleLoaded) return;\n const interval = setInterval(() => {\n const map = mapRef.current;\n if (map == null) return;\n if (map.isStyleLoaded()) {\n // Wait a tick before setting the style loaded state\n dispatch({ type: \"set-style-loaded\", payload: true });\n onStyleLoaded?.(map);\n clearInterval(interval);\n }\n }, 50);\n return () => clearInterval(interval);\n }, [isStyleLoaded]);\n\n useAsyncEffect(async () => {\n /** Manager to update map style */\n let newStyle: mapboxgl.Style;\n if (typeof style === \"string\") {\n newStyle = await getMapboxStyle(style, {\n access_token: mapboxgl.accessToken,\n });\n } else {\n newStyle = style;\n }\n setBaseStyle(newStyle);\n }, [style]);\n\n const _computedMapPosition = useMapPosition();\n const { mapUse3D, mapIsRotated } = mapViewInfo(_computedMapPosition);\n\n // Get map projection\n const _projection = mapRef.current?.getProjection()?.name ?? \"mercator\";\n\n const className = classNames(\n {\n \"is-rotated\": mapIsRotated ?? false,\n \"is-3d-available\": mapUse3D ?? false,\n },\n `${_projection}-projection`\n );\n\n const parentClassName = classNames({\n standalone,\n });\n\n return h(\n \"div.map-view-container.main-view\",\n { ref: parentRef, className: parentClassName },\n [\n h(\"div.mapbox-map#map\", { ref, className }),\n h(MapLoadingReporter, {\n ignoredSources: [\"elevationMarker\", \"crossSectionEndpoints\"],\n }),\n h(MapMovedReporter, { onMapMoved }),\n h(MapResizeManager, { containerRef: ref }),\n h(MapPaddingManager, {\n containerRef: ref,\n parentRef,\n infoMarkerPosition,\n }),\n h(MapTerrainManager, { mapUse3D, terrainSourceID, style }),\n children,\n ]\n );\n}\n\nexport function MapTerrainManager({\n mapUse3D,\n terrainSourceID,\n style,\n}: {\n mapUse3D?: boolean;\n terrainSourceID?: string;\n style?: mapboxgl.Style | string;\n}) {\n use3DTerrain(mapUse3D, terrainSourceID);\n\n return null;\n}\n"],"names":[],"version":3,"file":"map-view.d1c5b113.js.map"}
@@ -0,0 +1,2 @@
1
+ require("./main.module.7c928a6f.js"),require("./main.module.91a06e96.css"),require("./controls.511f309b.js");var e=require("@macrostrat/hyper");function r(e){return e&&e.__esModule?e.default:e}require("classnames"),require("transition-hook"),require("@macrostrat/mapbox-react"),require("@macrostrat/ui-components"),require("@macrostrat/mapbox-utils"),require("@blueprintjs/core");var i={};i=new URL("main.module.7c928a6f.js","file:"+__filename).toString(),new URL("controls.511f309b.js","file:"+__filename).toString(),r(e).styled(r(i));
2
+ //# sourceMappingURL=container.ab523076.js.map
@@ -1 +1 @@
1
- {"mappings":"A,Q,8C,Q,+C,Q,2C,I,E,Q,qB,S,E,C,E,O,G,E,U,C,E,O,C,C,C,Q,c,Q,mB,Q,4B,Q,6B,Q,4B,Q,qB,I,E,C,EEAA,EAAiB,IAAA,IAAoB,2CAAA,QAAA,YAA4C,QAAQ,GCAxE,IAAA,IAAoB,wCAAA,QAAA,YAAyC,QAAQ,GFiB5E,AAAA,AAAA,EAAA,GAAM,MAAM,CAAC,EAAA","sources":["<anon>","packages/map-interface/src/container.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-d62d2349645b8f4c.js","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-a05b7f3aef7398d8.js"],"sourcesContent":["require(\"./main.module.24615279.js\");\nrequire(\"./main.module.89f269c7.css\");\nrequire(\"./controls.ffb44307.js\");\nvar $lAyW8$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $lAyW8$classnames = require(\"classnames\");\nvar $lAyW8$transitionhook = require(\"transition-hook\");\nvar $lAyW8$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $lAyW8$macrostratuicomponents = require(\"@macrostrat/ui-components\");\nvar $lAyW8$macrostratmapboxutils = require(\"@macrostrat/mapbox-utils\");\nvar $lAyW8$blueprintjscore = require(\"@blueprintjs/core\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nvar $14b8bde8ee648c70$exports = {};\n$14b8bde8ee648c70$exports = new URL(\"main.module.24615279.js\", \"file:\" + __filename).toString();\n\n\n\n\n\n\nvar $df60ba5b782d207f$exports = {};\n$df60ba5b782d207f$exports = new URL(\"controls.ffb44307.js\", \"file:\" + __filename).toString();\n\n\n\n\nconst $4661d95a4b848918$var$h = (0, ($parcel$interopDefault($lAyW8$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($14b8bde8ee648c70$exports))));\nconst $4661d95a4b848918$export$ec68dd77edbe678b = (props)=>$4661d95a4b848918$var$h((0, $lAyW8$blueprintjscore.Card), {\n ...props,\n className: (0, ($parcel$interopDefault($lAyW8$classnames)))(\"panel-card\", props.className)\n });\nvar $4661d95a4b848918$export$612ca936d3ed4784 = /*#__PURE__*/ function(DetailPanelStyle) {\n DetailPanelStyle[\"FIXED\"] = \"fixed\";\n DetailPanelStyle[\"FLOATING\"] = \"floating\";\n return DetailPanelStyle;\n}({});\nconst $4661d95a4b848918$export$9fa5da0bcfd0a290 = (props)=>$4661d95a4b848918$var$h($4661d95a4b848918$var$MapProviders, $4661d95a4b848918$var$h($4661d95a4b848918$var$_MapAreaContainer, props));\nfunction $4661d95a4b848918$var$_MapAreaContainer({ children: children, className: className, navbar: navbar, contextPanel: contextPanel = null, detailPanel: detailPanel = null, detailPanelOpen: detailPanelOpen, contextPanelOpen: contextPanelOpen = true, bottomPanel: bottomPanel = null, mainPanel: mainPanel, mapControls: mapControls = $4661d95a4b848918$var$h((0, $df60ba5b782d207f$exports.MapBottomControls)), contextStackProps: contextStackProps = null, detailStackProps: detailStackProps = null, detailPanelStyle: detailPanelStyle = \"floating\", fitViewport: fitViewport = true, showPanelOutlines: showPanelOutlines = false, preventMapInteraction: preventMapInteraction = false, ...rest }) {\n const _detailPanelOpen = detailPanelOpen ?? detailPanel != null;\n const contextPanelTrans = (0, $lAyW8$transitionhook.useTransition)(contextPanelOpen, 800);\n const detailPanelTrans = (0, $lAyW8$transitionhook.useTransition)(_detailPanelOpen, 800);\n /*- We apply a custom style to the panel container when we are interacting\n with the search bar, so that we can block map interactions until search\n bar focus is lost.\n - We also apply a custom style when the infodrawer is open so we can hide\n the search bar on mobile platforms\n - These styles are doubly applied so we can have both namespaced and\n outside-accessible styles for each case.\n */ const mainUIClassNames = (0, ($parcel$interopDefault($lAyW8$classnames)))(\"map-container\", className, `detail-panel-${detailPanelStyle}`, `context-panel-${contextPanelTrans.stage}`, `map-context-${contextPanelTrans.stage}`, `detail-panel-${detailPanelTrans.stage}`, `map-detail-${detailPanelTrans.stage}`, {\n \"detail-panel-open\": _detailPanelOpen,\n \"map-context-open\": contextPanelOpen,\n \"show-panel-outlines\": showPanelOutlines,\n \"fit-viewport\": fitViewport\n });\n const mapControlsExt = $4661d95a4b848918$var$h([\n $4661d95a4b848918$var$h((0, $lAyW8$macrostratmapboxreact.ZoomControl), {\n className: \"zoom-control\"\n }),\n $4661d95a4b848918$var$h(\"div.spacer\"),\n mapControls\n ]);\n const detailStackExt = $4661d95a4b848918$var$h(\"div.detail-stack.infodrawer-container\", detailStackProps, [\n $4661d95a4b848918$var$h(\"div.detail-panel-holder\", null, detailPanel),\n $4661d95a4b848918$var$h.if(detailPanelStyle == \"floating\")([\n mapControlsExt\n ])\n ]);\n let contextStack = null;\n if (navbar != null || contextPanel != null) contextStack = $4661d95a4b848918$var$h($4661d95a4b848918$var$ContextStack, {\n navbar: navbar,\n ...contextStackProps\n }, [\n $4661d95a4b848918$var$h.if(contextPanelTrans.shouldMount)([\n contextPanel\n ])\n ]);\n return $4661d95a4b848918$var$h($4661d95a4b848918$export$fa395a37c3898ae3, {\n className: mainUIClassNames\n }, [\n $4661d95a4b848918$var$h(\"div.main-row\", [\n $4661d95a4b848918$var$h(\"div.map-ui\", {\n ...rest\n }, [\n contextStack,\n //h(MapView),\n children ?? mainPanel,\n $4661d95a4b848918$var$h.if(detailPanelStyle == \"floating\")([\n detailStackExt\n ]),\n $4661d95a4b848918$var$h.if(detailPanelStyle == \"fixed\")(\"div.map-control-stack\", mapControlsExt)\n ]),\n $4661d95a4b848918$var$h.if(detailPanelStyle == \"fixed\")([\n detailStackExt\n ])\n ]),\n $4661d95a4b848918$var$h(\"div.bottom\", null, bottomPanel)\n ]);\n}\nfunction $4661d95a4b848918$var$ContextStack(props) {\n const { adaptiveWidth: adaptiveWidth, navbar: navbar, children: children, ...rest } = props;\n const props1 = (0, $lAyW8$macrostrathyper.addClassNames)(rest, {\n \"adaptive-width\": adaptiveWidth\n });\n return $4661d95a4b848918$var$h(\"div.context-stack\", props1, [\n navbar,\n $4661d95a4b848918$var$h(\"div.context-panel-holder\", null, children),\n $4661d95a4b848918$var$h(\"div.spacer\")\n ]);\n}\nconst $4661d95a4b848918$var$MapProviders = ({ children: children })=>$4661d95a4b848918$var$h((0, $lAyW8$macrostratuicomponents.ToasterContext), $4661d95a4b848918$var$h((0, $lAyW8$macrostratmapboxreact.MapboxMapProvider), children));\nfunction $4661d95a4b848918$export$fa395a37c3898ae3({ className: className, children: children }) {\n const mapPosition = (0, $lAyW8$macrostratmapboxreact.useMapPosition)();\n if (mapPosition != null) {\n const { mapIsRotated: mapIsRotated, mapUse3D: mapUse3D, mapIsGlobal: mapIsGlobal } = (0, $lAyW8$macrostratmapboxutils.mapViewInfo)(mapPosition);\n className = (0, ($parcel$interopDefault($lAyW8$classnames)))(className, {\n \"map-is-rotated\": mapIsRotated,\n \"map-3d-available\": mapUse3D,\n \"map-is-global\": mapIsGlobal\n });\n }\n return $4661d95a4b848918$var$h(\"div\", {\n className: className\n }, children);\n} //const _MapPage = compose(HotkeysProvider, MapPage);\n\n\n//# sourceMappingURL=container.abd6f0d2.js.map\n","import hyper, { addClassNames } from \"@macrostrat/hyper\";\nimport { HTMLDivProps } from \"@blueprintjs/core\";\nimport styles from \"./main.module.sass\";\nimport classNames from \"classnames\";\nimport { useTransition } from \"transition-hook\";\nimport {\n MapboxMapProvider,\n ZoomControl,\n useMapPosition,\n} from \"@macrostrat/mapbox-react\";\nimport { ToasterContext } from \"@macrostrat/ui-components\";\nimport { MapBottomControls } from \"./controls\";\nimport { mapViewInfo, MapPosition } from \"@macrostrat/mapbox-utils\";\nimport { Card } from \"@blueprintjs/core\";\n\nimport { ReactNode } from \"react\";\n\nconst h = hyper.styled(styles);\n\ntype AnyElement = React.ReactNode | React.ReactElement | React.ReactFragment;\n\nexport const PanelCard = (props) =>\n h(Card, { ...props, className: classNames(\"panel-card\", props.className) });\n\ninterface ContextStackProps extends HTMLDivProps {\n adaptiveWidth: boolean;\n navbar: AnyElement;\n}\n\nexport enum DetailPanelStyle {\n FIXED = \"fixed\",\n FLOATING = \"floating\",\n}\n\nexport const MapAreaContainer = (props) =>\n h(MapProviders, h(_MapAreaContainer, props));\n\ninterface MapAreaContainerProps {\n navbar: AnyElement;\n children?: AnyElement;\n mapControls?: AnyElement;\n contextPanel?: AnyElement;\n contextStack?: AnyElement;\n mainPanel?: AnyElement;\n detailPanel?: AnyElement;\n bottomPanel?: AnyElement;\n className?: string;\n detailPanelOpen?: boolean;\n contextPanelOpen?: boolean;\n contextStackProps?: ContextStackProps;\n detailStackProps?: HTMLDivProps;\n detailPanelStyle: DetailPanelStyle;\n fitViewport?: boolean;\n showPanelOutlines?: boolean;\n preventMapInteraction?: boolean;\n}\n\nfunction _MapAreaContainer({\n children,\n className,\n navbar,\n contextPanel = null,\n detailPanel = null,\n detailPanelOpen,\n contextPanelOpen = true,\n bottomPanel = null,\n mainPanel,\n mapControls = h(MapBottomControls),\n contextStackProps = null,\n detailStackProps = null,\n detailPanelStyle = DetailPanelStyle.FLOATING,\n fitViewport = true,\n showPanelOutlines = false,\n preventMapInteraction = false,\n ...rest\n}: MapAreaContainerProps) {\n const _detailPanelOpen = detailPanelOpen ?? detailPanel != null;\n const contextPanelTrans = useTransition(contextPanelOpen, 800);\n const detailPanelTrans = useTransition(_detailPanelOpen, 800);\n\n /*- We apply a custom style to the panel container when we are interacting\n with the search bar, so that we can block map interactions until search\n bar focus is lost.\n - We also apply a custom style when the infodrawer is open so we can hide\n the search bar on mobile platforms\n - These styles are doubly applied so we can have both namespaced and\n outside-accessible styles for each case.\n */\n const mainUIClassNames = classNames(\n \"map-container\",\n className,\n `detail-panel-${detailPanelStyle}`,\n `context-panel-${contextPanelTrans.stage}`,\n `map-context-${contextPanelTrans.stage}`,\n `detail-panel-${detailPanelTrans.stage}`,\n `map-detail-${detailPanelTrans.stage}`,\n {\n \"detail-panel-open\": _detailPanelOpen,\n \"map-context-open\": contextPanelOpen,\n \"show-panel-outlines\": showPanelOutlines,\n \"fit-viewport\": fitViewport,\n }\n );\n\n const mapControlsExt = h([\n h(ZoomControl, { className: \"zoom-control\" }),\n h(\"div.spacer\"),\n mapControls,\n ]);\n\n const detailStackExt = h(\n \"div.detail-stack.infodrawer-container\",\n detailStackProps,\n [\n h(\"div.detail-panel-holder\", null, detailPanel),\n h.if(detailPanelStyle == DetailPanelStyle.FLOATING)([mapControlsExt]),\n ]\n );\n\n let contextStack = null;\n if (navbar != null || contextPanel != null) {\n contextStack = h(ContextStack, { navbar, ...contextStackProps }, [\n h.if(contextPanelTrans.shouldMount)([contextPanel]),\n ]);\n }\n\n return h(MapStyledContainer, { className: mainUIClassNames }, [\n h(\"div.main-row\", [\n h(\"div.map-ui\", { ...rest }, [\n contextStack,\n //h(MapView),\n children ?? mainPanel,\n h.if(detailPanelStyle == DetailPanelStyle.FLOATING)([detailStackExt]),\n h.if(detailPanelStyle == DetailPanelStyle.FIXED)(\n \"div.map-control-stack\",\n mapControlsExt\n ),\n ]),\n h.if(detailPanelStyle == DetailPanelStyle.FIXED)([detailStackExt]),\n ]),\n h(\"div.bottom\", null, bottomPanel),\n ]);\n}\n\nfunction ContextStack(props: ContextStackProps) {\n const { adaptiveWidth, navbar, children, ...rest } = props;\n const props1 = addClassNames(rest, { \"adaptive-width\": adaptiveWidth });\n return h(\"div.context-stack\", props1, [\n navbar,\n h(\"div.context-panel-holder\", null, children),\n h(\"div.spacer\"),\n ]);\n}\n\nconst MapProviders = ({ children }) =>\n h(ToasterContext, h(MapboxMapProvider, children));\n\ninterface MapContainerProps {\n className?: string;\n children?: ReactNode;\n}\n\nexport function MapStyledContainer({ className, children }: MapContainerProps) {\n const mapPosition = useMapPosition();\n if (mapPosition != null) {\n const { mapIsRotated, mapUse3D, mapIsGlobal } = mapViewInfo(mapPosition);\n className = classNames(className, {\n \"map-is-rotated\": mapIsRotated,\n \"map-3d-available\": mapUse3D,\n \"map-is-global\": mapIsGlobal,\n });\n }\n\n return h(\"div\", { className }, children);\n}\n\n//const _MapPage = compose(HotkeysProvider, MapPage);\n","module.exports = new __parcel__URL__(\"main.module.24615279.js\").toString();","module.exports = new __parcel__URL__(\"controls.ffb44307.js\").toString();"],"names":["require","$lAyW8$macrostrathyper","$parcel$interopDefault","a","__esModule","default","$14b8bde8ee648c70$exports","URL","__filename","toString","styled"],"version":3,"file":"container.abd6f0d2.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,Q,8C,Q,+C,Q,2C,I,E,Q,qB,S,E,C,E,O,G,E,U,C,E,O,C,C,C,Q,c,Q,mB,Q,4B,Q,6B,Q,4B,Q,qB,I,E,C,EEAA,EAAiB,IAAA,IAAoB,2CAAA,QAAA,YAA4C,QAAQ,GCAxE,IAAA,IAAoB,wCAAA,QAAA,YAAyC,QAAQ,GFiB5E,AAAA,AAAA,EAAA,GAAM,MAAM,CAAC,EAAA","sources":["<anon>","packages/map-interface/src/container.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-d62d2349645b8f4c.js","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-a05b7f3aef7398d8.js"],"sourcesContent":["require(\"./main.module.7c928a6f.js\");\nrequire(\"./main.module.91a06e96.css\");\nrequire(\"./controls.511f309b.js\");\nvar $lAyW8$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $lAyW8$classnames = require(\"classnames\");\nvar $lAyW8$transitionhook = require(\"transition-hook\");\nvar $lAyW8$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $lAyW8$macrostratuicomponents = require(\"@macrostrat/ui-components\");\nvar $lAyW8$macrostratmapboxutils = require(\"@macrostrat/mapbox-utils\");\nvar $lAyW8$blueprintjscore = require(\"@blueprintjs/core\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nvar $14b8bde8ee648c70$exports = {};\n$14b8bde8ee648c70$exports = new URL(\"main.module.7c928a6f.js\", \"file:\" + __filename).toString();\n\n\n\n\n\n\nvar $df60ba5b782d207f$exports = {};\n$df60ba5b782d207f$exports = new URL(\"controls.511f309b.js\", \"file:\" + __filename).toString();\n\n\n\n\nconst $4661d95a4b848918$var$h = (0, ($parcel$interopDefault($lAyW8$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($14b8bde8ee648c70$exports))));\nconst $4661d95a4b848918$export$ec68dd77edbe678b = (props)=>$4661d95a4b848918$var$h((0, $lAyW8$blueprintjscore.Card), {\n ...props,\n className: (0, ($parcel$interopDefault($lAyW8$classnames)))(\"panel-card\", props.className)\n });\nvar $4661d95a4b848918$export$612ca936d3ed4784 = /*#__PURE__*/ function(DetailPanelStyle) {\n DetailPanelStyle[\"FIXED\"] = \"fixed\";\n DetailPanelStyle[\"FLOATING\"] = \"floating\";\n return DetailPanelStyle;\n}({});\nconst $4661d95a4b848918$export$9fa5da0bcfd0a290 = (props)=>$4661d95a4b848918$var$h($4661d95a4b848918$var$MapProviders, $4661d95a4b848918$var$h($4661d95a4b848918$var$_MapAreaContainer, props));\nfunction $4661d95a4b848918$var$_MapAreaContainer({ children: children, className: className, navbar: navbar, contextPanel: contextPanel = null, detailPanel: detailPanel = null, detailPanelOpen: detailPanelOpen, contextPanelOpen: contextPanelOpen = true, bottomPanel: bottomPanel = null, mainPanel: mainPanel, mapControls: mapControls = $4661d95a4b848918$var$h((0, $df60ba5b782d207f$exports.MapBottomControls)), contextStackProps: contextStackProps = null, detailStackProps: detailStackProps = null, detailPanelStyle: detailPanelStyle = \"floating\", fitViewport: fitViewport = true, showPanelOutlines: showPanelOutlines = false, preventMapInteraction: preventMapInteraction = false, ...rest }) {\n const _detailPanelOpen = detailPanelOpen ?? detailPanel != null;\n const contextPanelTrans = (0, $lAyW8$transitionhook.useTransition)(contextPanelOpen, 800);\n const detailPanelTrans = (0, $lAyW8$transitionhook.useTransition)(_detailPanelOpen, 800);\n /*- We apply a custom style to the panel container when we are interacting\n with the search bar, so that we can block map interactions until search\n bar focus is lost.\n - We also apply a custom style when the infodrawer is open so we can hide\n the search bar on mobile platforms\n - These styles are doubly applied so we can have both namespaced and\n outside-accessible styles for each case.\n */ const mainUIClassNames = (0, ($parcel$interopDefault($lAyW8$classnames)))(\"map-container\", className, `detail-panel-${detailPanelStyle}`, `context-panel-${contextPanelTrans.stage}`, `map-context-${contextPanelTrans.stage}`, `detail-panel-${detailPanelTrans.stage}`, `map-detail-${detailPanelTrans.stage}`, {\n \"detail-panel-open\": _detailPanelOpen,\n \"map-context-open\": contextPanelOpen,\n \"show-panel-outlines\": showPanelOutlines,\n \"fit-viewport\": fitViewport\n });\n const mapControlsExt = $4661d95a4b848918$var$h([\n $4661d95a4b848918$var$h((0, $lAyW8$macrostratmapboxreact.ZoomControl), {\n className: \"zoom-control\"\n }),\n $4661d95a4b848918$var$h(\"div.spacer\"),\n mapControls\n ]);\n const detailStackExt = $4661d95a4b848918$var$h(\"div.detail-stack.infodrawer-container\", detailStackProps, [\n $4661d95a4b848918$var$h(\"div.detail-panel-holder\", null, detailPanel),\n $4661d95a4b848918$var$h.if(detailPanelStyle == \"floating\")([\n mapControlsExt\n ])\n ]);\n let contextStack = null;\n if (navbar != null || contextPanel != null) contextStack = $4661d95a4b848918$var$h($4661d95a4b848918$var$ContextStack, {\n navbar: navbar,\n ...contextStackProps\n }, [\n $4661d95a4b848918$var$h.if(contextPanelTrans.shouldMount)([\n contextPanel\n ])\n ]);\n return $4661d95a4b848918$var$h($4661d95a4b848918$export$fa395a37c3898ae3, {\n className: mainUIClassNames\n }, [\n $4661d95a4b848918$var$h(\"div.main-row\", [\n $4661d95a4b848918$var$h(\"div.map-ui\", {\n ...rest\n }, [\n contextStack,\n //h(MapView),\n children ?? mainPanel,\n $4661d95a4b848918$var$h.if(detailPanelStyle == \"floating\")([\n detailStackExt\n ]),\n $4661d95a4b848918$var$h.if(detailPanelStyle == \"fixed\")(\"div.map-control-stack\", mapControlsExt)\n ]),\n $4661d95a4b848918$var$h.if(detailPanelStyle == \"fixed\")([\n detailStackExt\n ])\n ]),\n $4661d95a4b848918$var$h(\"div.bottom\", null, bottomPanel)\n ]);\n}\nfunction $4661d95a4b848918$var$ContextStack(props) {\n const { adaptiveWidth: adaptiveWidth, navbar: navbar, children: children, ...rest } = props;\n const props1 = (0, $lAyW8$macrostrathyper.addClassNames)(rest, {\n \"adaptive-width\": adaptiveWidth\n });\n return $4661d95a4b848918$var$h(\"div.context-stack\", props1, [\n navbar,\n $4661d95a4b848918$var$h(\"div.context-panel-holder\", null, children),\n $4661d95a4b848918$var$h(\"div.spacer\")\n ]);\n}\nconst $4661d95a4b848918$var$MapProviders = ({ children: children })=>$4661d95a4b848918$var$h((0, $lAyW8$macrostratuicomponents.ToasterContext), $4661d95a4b848918$var$h((0, $lAyW8$macrostratmapboxreact.MapboxMapProvider), children));\nfunction $4661d95a4b848918$export$fa395a37c3898ae3({ className: className, children: children }) {\n const mapPosition = (0, $lAyW8$macrostratmapboxreact.useMapPosition)();\n if (mapPosition != null) {\n const { mapIsRotated: mapIsRotated, mapUse3D: mapUse3D, mapIsGlobal: mapIsGlobal } = (0, $lAyW8$macrostratmapboxutils.mapViewInfo)(mapPosition);\n className = (0, ($parcel$interopDefault($lAyW8$classnames)))(className, {\n \"map-is-rotated\": mapIsRotated,\n \"map-3d-available\": mapUse3D,\n \"map-is-global\": mapIsGlobal\n });\n }\n return $4661d95a4b848918$var$h(\"div\", {\n className: className\n }, children);\n} //const _MapPage = compose(HotkeysProvider, MapPage);\n\n\n//# sourceMappingURL=container.ab523076.js.map\n","import hyper, { addClassNames } from \"@macrostrat/hyper\";\nimport { HTMLDivProps } from \"@blueprintjs/core\";\nimport styles from \"./main.module.sass\";\nimport classNames from \"classnames\";\nimport { useTransition } from \"transition-hook\";\nimport {\n MapboxMapProvider,\n ZoomControl,\n useMapPosition,\n} from \"@macrostrat/mapbox-react\";\nimport { ToasterContext } from \"@macrostrat/ui-components\";\nimport { MapBottomControls } from \"./controls\";\nimport { mapViewInfo, MapPosition } from \"@macrostrat/mapbox-utils\";\nimport { Card } from \"@blueprintjs/core\";\n\nimport { ReactNode } from \"react\";\n\nconst h = hyper.styled(styles);\n\ntype AnyElement = React.ReactNode | React.ReactElement | React.ReactFragment;\n\nexport const PanelCard = (props) =>\n h(Card, { ...props, className: classNames(\"panel-card\", props.className) });\n\ninterface ContextStackProps extends HTMLDivProps {\n adaptiveWidth: boolean;\n navbar: AnyElement;\n}\n\nexport enum DetailPanelStyle {\n FIXED = \"fixed\",\n FLOATING = \"floating\",\n}\n\nexport const MapAreaContainer = (props) =>\n h(MapProviders, h(_MapAreaContainer, props));\n\ninterface MapAreaContainerProps {\n navbar: AnyElement;\n children?: AnyElement;\n mapControls?: AnyElement;\n contextPanel?: AnyElement;\n contextStack?: AnyElement;\n mainPanel?: AnyElement;\n detailPanel?: AnyElement;\n bottomPanel?: AnyElement;\n className?: string;\n detailPanelOpen?: boolean;\n contextPanelOpen?: boolean;\n contextStackProps?: ContextStackProps;\n detailStackProps?: HTMLDivProps;\n detailPanelStyle: DetailPanelStyle;\n fitViewport?: boolean;\n showPanelOutlines?: boolean;\n preventMapInteraction?: boolean;\n}\n\nfunction _MapAreaContainer({\n children,\n className,\n navbar,\n contextPanel = null,\n detailPanel = null,\n detailPanelOpen,\n contextPanelOpen = true,\n bottomPanel = null,\n mainPanel,\n mapControls = h(MapBottomControls),\n contextStackProps = null,\n detailStackProps = null,\n detailPanelStyle = DetailPanelStyle.FLOATING,\n fitViewport = true,\n showPanelOutlines = false,\n preventMapInteraction = false,\n ...rest\n}: MapAreaContainerProps) {\n const _detailPanelOpen = detailPanelOpen ?? detailPanel != null;\n const contextPanelTrans = useTransition(contextPanelOpen, 800);\n const detailPanelTrans = useTransition(_detailPanelOpen, 800);\n\n /*- We apply a custom style to the panel container when we are interacting\n with the search bar, so that we can block map interactions until search\n bar focus is lost.\n - We also apply a custom style when the infodrawer is open so we can hide\n the search bar on mobile platforms\n - These styles are doubly applied so we can have both namespaced and\n outside-accessible styles for each case.\n */\n const mainUIClassNames = classNames(\n \"map-container\",\n className,\n `detail-panel-${detailPanelStyle}`,\n `context-panel-${contextPanelTrans.stage}`,\n `map-context-${contextPanelTrans.stage}`,\n `detail-panel-${detailPanelTrans.stage}`,\n `map-detail-${detailPanelTrans.stage}`,\n {\n \"detail-panel-open\": _detailPanelOpen,\n \"map-context-open\": contextPanelOpen,\n \"show-panel-outlines\": showPanelOutlines,\n \"fit-viewport\": fitViewport,\n }\n );\n\n const mapControlsExt = h([\n h(ZoomControl, { className: \"zoom-control\" }),\n h(\"div.spacer\"),\n mapControls,\n ]);\n\n const detailStackExt = h(\n \"div.detail-stack.infodrawer-container\",\n detailStackProps,\n [\n h(\"div.detail-panel-holder\", null, detailPanel),\n h.if(detailPanelStyle == DetailPanelStyle.FLOATING)([mapControlsExt]),\n ]\n );\n\n let contextStack = null;\n if (navbar != null || contextPanel != null) {\n contextStack = h(ContextStack, { navbar, ...contextStackProps }, [\n h.if(contextPanelTrans.shouldMount)([contextPanel]),\n ]);\n }\n\n return h(MapStyledContainer, { className: mainUIClassNames }, [\n h(\"div.main-row\", [\n h(\"div.map-ui\", { ...rest }, [\n contextStack,\n //h(MapView),\n children ?? mainPanel,\n h.if(detailPanelStyle == DetailPanelStyle.FLOATING)([detailStackExt]),\n h.if(detailPanelStyle == DetailPanelStyle.FIXED)(\n \"div.map-control-stack\",\n mapControlsExt\n ),\n ]),\n h.if(detailPanelStyle == DetailPanelStyle.FIXED)([detailStackExt]),\n ]),\n h(\"div.bottom\", null, bottomPanel),\n ]);\n}\n\nfunction ContextStack(props: ContextStackProps) {\n const { adaptiveWidth, navbar, children, ...rest } = props;\n const props1 = addClassNames(rest, { \"adaptive-width\": adaptiveWidth });\n return h(\"div.context-stack\", props1, [\n navbar,\n h(\"div.context-panel-holder\", null, children),\n h(\"div.spacer\"),\n ]);\n}\n\nconst MapProviders = ({ children }) =>\n h(ToasterContext, h(MapboxMapProvider, children));\n\ninterface MapContainerProps {\n className?: string;\n children?: ReactNode;\n}\n\nexport function MapStyledContainer({ className, children }: MapContainerProps) {\n const mapPosition = useMapPosition();\n if (mapPosition != null) {\n const { mapIsRotated, mapUse3D, mapIsGlobal } = mapViewInfo(mapPosition);\n className = classNames(className, {\n \"map-is-rotated\": mapIsRotated,\n \"map-3d-available\": mapUse3D,\n \"map-is-global\": mapIsGlobal,\n });\n }\n\n return h(\"div\", { className }, children);\n}\n\n//const _MapPage = compose(HotkeysProvider, MapPage);\n","module.exports = new __parcel__URL__(\"main.module.7c928a6f.js\").toString();","module.exports = new __parcel__URL__(\"controls.511f309b.js\").toString();"],"names":["require","$lAyW8$macrostrathyper","$parcel$interopDefault","a","__esModule","default","$14b8bde8ee648c70$exports","URL","__filename","toString","styled"],"version":3,"file":"container.ab523076.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- require("./main.module.61b261c8.css"),require("./main.module.e200d631.js");var e=require("@blueprintjs/core"),r=require("@macrostrat/hyper");function a(e){return e&&e.__esModule?e.default:e}require("@macrostrat/mapbox-react"),require("@macrostrat/ui-components");var i={};i=new URL("main.module.61b261c8.css","file:"+__filename).toString(),a(r).styled(a(i))(e.Spinner,{size:16});
2
- //# sourceMappingURL=context-panel.7c2f42c9.js.map
1
+ require("./main.module.8a9943af.css"),require("./main.module.e200d631.js");var e=require("@blueprintjs/core"),r=require("@macrostrat/hyper");function a(e){return e&&e.__esModule?e.default:e}require("@macrostrat/mapbox-react"),require("@macrostrat/ui-components");var i={};i=new URL("main.module.8a9943af.css","file:"+__filename).toString(),a(r).styled(a(i))(e.Spinner,{size:16});
2
+ //# sourceMappingURL=context-panel.0ae29ecf.js.map
@@ -1 +1 @@
1
- {"mappings":"A,Q,+C,Q,8C,I,E,Q,qB,E,Q,qB,S,E,C,E,O,G,E,U,C,E,O,C,C,C,Q,4B,Q,6B,I,E,C,EEAA,EAAiB,IAAA,IAAoB,4CAAA,QAAA,YAA6C,QAAQ,GDSnE,AAFb,AAAA,AAAA,EAAA,GAAM,MAAM,CAAC,EAAA,IAEE,EAAA,OAAM,CAAG,CAAE,KAAM,EAAG","sources":["<anon>","packages/map-interface/src/context-panel/index.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-7d2d42ad16b9364e.js"],"sourcesContent":["require(\"./main.module.61b261c8.css\");\nrequire(\"./main.module.e200d631.js\");\nvar $14Taq$blueprintjscore = require(\"@blueprintjs/core\");\nvar $14Taq$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $14Taq$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $14Taq$macrostratuicomponents = require(\"@macrostrat/ui-components\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n\nvar $e988a53ec4c6f1a8$exports = {};\n$e988a53ec4c6f1a8$exports = new URL(\"main.module.61b261c8.css\", \"file:\" + __filename).toString();\n\n\n\n\nconst $8c3698ca3fcf939f$var$h = (0, ($parcel$interopDefault($14Taq$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($e988a53ec4c6f1a8$exports))));\nconst $8c3698ca3fcf939f$var$spinnerElement = $8c3698ca3fcf939f$var$h((0, $14Taq$blueprintjscore.Spinner), {\n size: 16\n});\nfunction $8c3698ca3fcf939f$export$4ec83e90d030b2f3({ isLoading: isLoading = false, onClick: onClick, active: active = false, large: large = true, icon: icon = \"menu\", style: style }) {\n return $8c3698ca3fcf939f$var$h((0, $14Taq$blueprintjscore.Button), {\n className: \"loading-button\",\n icon: isLoading ? $8c3698ca3fcf939f$var$spinnerElement : icon,\n large: large,\n minimal: true,\n onClick: onClick,\n active: active && !isLoading,\n style: style\n });\n}\nfunction $8c3698ca3fcf939f$export$9e3bae3c08bde368(props) {\n const isLoading = (0, $14Taq$macrostratmapboxreact.useMapStatus)((s)=>s.isLoading);\n return $8c3698ca3fcf939f$var$h($8c3698ca3fcf939f$export$4ec83e90d030b2f3, {\n ...props,\n isLoading: isLoading\n });\n}\nfunction $8c3698ca3fcf939f$export$a8cc0062d02a3841({ className: className, children: children, headerElement: headerElement = null, title: title = null, statusElement: statusElement = null, rightElement: rightElement = null, height: height, width: width, style: style = {} }) {\n let _rightElement = null;\n if (rightElement != null) _rightElement = $8c3698ca3fcf939f$var$h(\"div.right-element\", rightElement);\n let _headerElement = headerElement;\n if (title != null && _headerElement == null) {\n if (typeof title === \"string\") _headerElement = $8c3698ca3fcf939f$var$h((0, $14Taq$blueprintjscore.Text), {\n tagName: \"h2\",\n ellipsize: true\n }, title);\n else _headerElement = title;\n }\n if (_headerElement != null) _headerElement = $8c3698ca3fcf939f$var$h([\n _headerElement,\n $8c3698ca3fcf939f$var$h((0, $14Taq$macrostratuicomponents.Spacer))\n ]);\n return $8c3698ca3fcf939f$var$h(\"div.searchbar-holder\", {\n className: className,\n style: {\n width: width\n }\n }, [\n $8c3698ca3fcf939f$var$h(\"div.navbar-holder\", [\n $8c3698ca3fcf939f$var$h((0, $14Taq$blueprintjscore.Navbar), {\n className: \"searchbar navbar panel\",\n style: {\n height: height,\n ...style\n }\n }, [\n _headerElement,\n children,\n _rightElement\n ])\n ]),\n $8c3698ca3fcf939f$var$h.if(statusElement != null)((0, $14Taq$blueprintjscore.Card), {\n className: \"status-tongue\"\n }, statusElement)\n ]);\n}\n\n\n//# sourceMappingURL=context-panel.7c2f42c9.js.map\n","import { useMemo } from \"react\";\nimport { Navbar, Button, Spinner, Card, Text } from \"@blueprintjs/core\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { useMapStatus } from \"@macrostrat/mapbox-react\";\nimport { Spacer } from \"@macrostrat/ui-components\";\n\nconst h = hyper.styled(styles);\n\nconst spinnerElement = h(Spinner, { size: 16 });\n\nexport function LoadingButton({\n isLoading = false,\n onClick,\n active = false,\n large = true,\n icon = \"menu\",\n style,\n}) {\n return h(Button, {\n className: \"loading-button\",\n icon: isLoading ? spinnerElement : icon,\n large,\n minimal: true,\n onClick,\n active: active && !isLoading,\n style,\n });\n}\n\nexport function MapLoadingButton(props) {\n const isLoading = useMapStatus((s) => s.isLoading);\n return h(LoadingButton, { ...props, isLoading });\n}\n\ntype AnyChildren = React.ReactNode;\n\nexport interface FloatingNavbarProps {\n className?: string;\n children?: AnyChildren;\n headerElement?: AnyChildren;\n title?: AnyChildren;\n statusElement?: AnyChildren;\n rightElement?: AnyChildren;\n height?: number | string;\n width?: number | string;\n style?: object;\n}\n\nexport function FloatingNavbar({\n className,\n children,\n headerElement = null,\n title = null,\n statusElement = null,\n rightElement = null,\n height,\n width,\n style = {},\n}: FloatingNavbarProps) {\n let _rightElement: React.ReactNode | null = null;\n if (rightElement != null) {\n _rightElement = h(\"div.right-element\", rightElement);\n }\n\n let _headerElement: React.ReactNode | null = headerElement;\n if (title != null && _headerElement == null) {\n if (typeof title === \"string\") {\n _headerElement = h(Text, { tagName: \"h2\", ellipsize: true }, title);\n } else {\n _headerElement = title;\n }\n }\n\n if (_headerElement != null) {\n _headerElement = h([_headerElement, h(Spacer)]);\n }\n\n return h(\"div.searchbar-holder\", { className, style: { width } }, [\n h(\"div.navbar-holder\", [\n h(\n Navbar,\n {\n className: \"searchbar navbar panel\",\n style: { height, ...style },\n },\n [_headerElement, children, _rightElement]\n ),\n ]),\n h.if(statusElement != null)(\n Card,\n { className: \"status-tongue\" },\n statusElement\n ),\n ]);\n}\n","module.exports = new __parcel__URL__(\"main.module.61b261c8.css\").toString();"],"names":["require","$14Taq$blueprintjscore","$14Taq$macrostrathyper","$parcel$interopDefault","a","__esModule","default","$e988a53ec4c6f1a8$exports","URL","__filename","toString","$8c3698ca3fcf939f$var$h","styled","Spinner","size"],"version":3,"file":"context-panel.7c2f42c9.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,Q,+C,Q,8C,I,E,Q,qB,E,Q,qB,S,E,C,E,O,G,E,U,C,E,O,C,C,C,Q,4B,Q,6B,I,E,C,EEAA,EAAiB,IAAA,IAAoB,4CAAA,QAAA,YAA6C,QAAQ,GDSnE,AAFb,AAAA,AAAA,EAAA,GAAM,MAAM,CAAC,EAAA,IAEE,EAAA,OAAM,CAAG,CAAE,KAAM,EAAG","sources":["<anon>","packages/map-interface/src/context-panel/index.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-7d2d42ad16b9364e.js"],"sourcesContent":["require(\"./main.module.8a9943af.css\");\nrequire(\"./main.module.e200d631.js\");\nvar $14Taq$blueprintjscore = require(\"@blueprintjs/core\");\nvar $14Taq$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $14Taq$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $14Taq$macrostratuicomponents = require(\"@macrostrat/ui-components\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n\nvar $e988a53ec4c6f1a8$exports = {};\n$e988a53ec4c6f1a8$exports = new URL(\"main.module.8a9943af.css\", \"file:\" + __filename).toString();\n\n\n\n\nconst $8c3698ca3fcf939f$var$h = (0, ($parcel$interopDefault($14Taq$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($e988a53ec4c6f1a8$exports))));\nconst $8c3698ca3fcf939f$var$spinnerElement = $8c3698ca3fcf939f$var$h((0, $14Taq$blueprintjscore.Spinner), {\n size: 16\n});\nfunction $8c3698ca3fcf939f$export$4ec83e90d030b2f3({ isLoading: isLoading = false, onClick: onClick, active: active = false, large: large = true, icon: icon = \"menu\", style: style }) {\n return $8c3698ca3fcf939f$var$h((0, $14Taq$blueprintjscore.Button), {\n className: \"loading-button\",\n icon: isLoading ? $8c3698ca3fcf939f$var$spinnerElement : icon,\n large: large,\n minimal: true,\n onClick: onClick,\n active: active && !isLoading,\n style: style\n });\n}\nfunction $8c3698ca3fcf939f$export$9e3bae3c08bde368(props) {\n const isLoading = (0, $14Taq$macrostratmapboxreact.useMapStatus)((s)=>s.isLoading);\n return $8c3698ca3fcf939f$var$h($8c3698ca3fcf939f$export$4ec83e90d030b2f3, {\n ...props,\n isLoading: isLoading\n });\n}\nfunction $8c3698ca3fcf939f$export$a8cc0062d02a3841({ className: className, children: children, headerElement: headerElement = null, title: title = null, statusElement: statusElement = null, rightElement: rightElement = null, height: height, width: width, style: style = {} }) {\n let _rightElement = null;\n if (rightElement != null) _rightElement = $8c3698ca3fcf939f$var$h(\"div.right-element\", rightElement);\n let _headerElement = headerElement;\n if (title != null && _headerElement == null) {\n if (typeof title === \"string\") _headerElement = $8c3698ca3fcf939f$var$h((0, $14Taq$blueprintjscore.Text), {\n tagName: \"h2\",\n ellipsize: true\n }, title);\n else _headerElement = title;\n }\n if (_headerElement != null) _headerElement = $8c3698ca3fcf939f$var$h([\n _headerElement,\n $8c3698ca3fcf939f$var$h((0, $14Taq$macrostratuicomponents.Spacer))\n ]);\n return $8c3698ca3fcf939f$var$h(\"div.searchbar-holder\", {\n className: className,\n style: {\n width: width\n }\n }, [\n $8c3698ca3fcf939f$var$h(\"div.navbar-holder\", [\n $8c3698ca3fcf939f$var$h((0, $14Taq$blueprintjscore.Navbar), {\n className: \"searchbar navbar panel\",\n style: {\n height: height,\n ...style\n }\n }, [\n _headerElement,\n children,\n _rightElement\n ])\n ]),\n $8c3698ca3fcf939f$var$h.if(statusElement != null)((0, $14Taq$blueprintjscore.Card), {\n className: \"status-tongue\"\n }, statusElement)\n ]);\n}\n\n\n//# sourceMappingURL=context-panel.0ae29ecf.js.map\n","import { useMemo } from \"react\";\nimport { Navbar, Button, Spinner, Card, Text } from \"@blueprintjs/core\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { useMapStatus } from \"@macrostrat/mapbox-react\";\nimport { Spacer } from \"@macrostrat/ui-components\";\n\nconst h = hyper.styled(styles);\n\nconst spinnerElement = h(Spinner, { size: 16 });\n\nexport function LoadingButton({\n isLoading = false,\n onClick,\n active = false,\n large = true,\n icon = \"menu\",\n style,\n}) {\n return h(Button, {\n className: \"loading-button\",\n icon: isLoading ? spinnerElement : icon,\n large,\n minimal: true,\n onClick,\n active: active && !isLoading,\n style,\n });\n}\n\nexport function MapLoadingButton(props) {\n const isLoading = useMapStatus((s) => s.isLoading);\n return h(LoadingButton, { ...props, isLoading });\n}\n\ntype AnyChildren = React.ReactNode;\n\nexport interface FloatingNavbarProps {\n className?: string;\n children?: AnyChildren;\n headerElement?: AnyChildren;\n title?: AnyChildren;\n statusElement?: AnyChildren;\n rightElement?: AnyChildren;\n height?: number | string;\n width?: number | string;\n style?: object;\n}\n\nexport function FloatingNavbar({\n className,\n children,\n headerElement = null,\n title = null,\n statusElement = null,\n rightElement = null,\n height,\n width,\n style = {},\n}: FloatingNavbarProps) {\n let _rightElement: React.ReactNode | null = null;\n if (rightElement != null) {\n _rightElement = h(\"div.right-element\", rightElement);\n }\n\n let _headerElement: React.ReactNode | null = headerElement;\n if (title != null && _headerElement == null) {\n if (typeof title === \"string\") {\n _headerElement = h(Text, { tagName: \"h2\", ellipsize: true }, title);\n } else {\n _headerElement = title;\n }\n }\n\n if (_headerElement != null) {\n _headerElement = h([_headerElement, h(Spacer)]);\n }\n\n return h(\"div.searchbar-holder\", { className, style: { width } }, [\n h(\"div.navbar-holder\", [\n h(\n Navbar,\n {\n className: \"searchbar navbar panel\",\n style: { height, ...style },\n },\n [_headerElement, children, _rightElement]\n ),\n ]),\n h.if(statusElement != null)(\n Card,\n { className: \"status-tongue\" },\n statusElement\n ),\n ]);\n}\n","module.exports = new __parcel__URL__(\"main.module.8a9943af.css\").toString();"],"names":["require","$14Taq$blueprintjscore","$14Taq$macrostrathyper","$parcel$interopDefault","a","__esModule","default","$e988a53ec4c6f1a8$exports","URL","__filename","toString","$8c3698ca3fcf939f$var$h","styled","Spinner","size"],"version":3,"file":"context-panel.0ae29ecf.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- require("./main.module.24615279.js"),require("./main.module.89f269c7.css"),require("react"),require("mapbox-gl");var r=require("@macrostrat/hyper");function e(r){return r&&r.__esModule?r.default:r}require("@macrostrat/mapbox-react"),require("@macrostrat/ui-components");var t=globalThis,a={},i={},o=t.parcelRequire94c2;null==o&&((o=function(r){if(r in a)return a[r].exports;if(r in i){var e=i[r];delete i[r];var t={id:r,exports:{}};return a[r]=t,e.call(t.exports,t,t.exports),t.exports}var o=Error("Cannot find module '"+r+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(r,e){i[r]=e},t.parcelRequire94c2=o),o.register;var u=o("6ULxP");e(r).styled(e(u));
2
- //# sourceMappingURL=controls.ffb44307.js.map
1
+ require("./main.module.7c928a6f.js"),require("./main.module.91a06e96.css"),require("react"),require("mapbox-gl");var r=require("@macrostrat/hyper");function e(r){return r&&r.__esModule?r.default:r}require("@macrostrat/mapbox-react"),require("@macrostrat/ui-components");var t=globalThis,a={},i={},o=t.parcelRequire94c2;null==o&&((o=function(r){if(r in a)return a[r].exports;if(r in i){var e=i[r];delete i[r];var t={id:r,exports:{}};return a[r]=t,e.call(t.exports,t,t.exports),t.exports}var o=Error("Cannot find module '"+r+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(r,e){i[r]=e},t.parcelRequire94c2=o),o.register;var u=o("6ULxP");e(r).styled(e(u));
2
+ //# sourceMappingURL=controls.511f309b.js.map
@@ -1 +1 @@
1
- {"mappings":"A,Q,8C,Q,+C,Q,S,Q,a,I,E,Q,qB,S,E,C,E,O,G,E,U,C,E,O,C,C,C,Q,4B,Q,6B,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,SCcU,AAAA,AAAA,EAAA,GAAM,MAAM,CAAC,EAAA","sources":["<anon>","packages/map-interface/src/controls.ts"],"sourcesContent":["require(\"./main.module.24615279.js\");\nrequire(\"./main.module.89f269c7.css\");\nvar $kbh3o$react = require(\"react\");\nvar $kbh3o$mapboxgl = require(\"mapbox-gl\");\nvar $kbh3o$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $kbh3o$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $kbh3o$macrostratuicomponents = require(\"@macrostrat/ui-components\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire94c2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\n\n\nvar $6ULxP = parcelRequire(\"6ULxP\");\n\n\nconst $7a11e3c77fefb3c4$var$h = (0, ($parcel$interopDefault($kbh3o$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($6ULxP))));\nfunction $7a11e3c77fefb3c4$var$ScaleControl(props) {\n const optionsRef = (0, $kbh3o$react.useRef)({\n maxWidth: 200,\n unit: \"metric\"\n });\n return $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratmapboxreact.MapControlWrapper), {\n className: \"map-scale-control\",\n control: (0, $kbh3o$mapboxgl.ScaleControl),\n options: optionsRef.current,\n ...props\n });\n}\nfunction $7a11e3c77fefb3c4$var$GeolocationControl(props) {\n const optionsRef = (0, $kbh3o$react.useRef)({\n showAccuracyCircle: true,\n showUserLocation: true,\n trackUserLocation: true,\n positionOptions: {\n enableHighAccuracy: true\n }\n });\n return $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratmapboxreact.MapControlWrapper), {\n control: (0, $kbh3o$mapboxgl.GeolocateControl),\n options: optionsRef.current,\n ...props\n });\n}\nfunction $7a11e3c77fefb3c4$export$db1a2e058a06fb5c({ children: children }) {\n const { isInitialized: isInitialized } = (0, $kbh3o$macrostratmapboxreact.useMapStatus)();\n if (!isInitialized) return null;\n return $7a11e3c77fefb3c4$var$h(\"div.map-controls\", [\n $7a11e3c77fefb3c4$var$h($7a11e3c77fefb3c4$var$ScaleControl),\n $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratmapboxreact.ThreeDControl), {\n className: \"map-3d-control\"\n }),\n $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratmapboxreact.CompassControl), {\n className: \"compass-control\"\n }),\n $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratmapboxreact.GlobeControl), {\n className: \"globe-control\"\n }),\n $7a11e3c77fefb3c4$var$h($7a11e3c77fefb3c4$var$GeolocationControl, {\n className: \"geolocation-control\"\n }),\n // If we have global development tools enabled, show the button\n $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratuicomponents.DevToolsButtonSlot), {\n className: \"map-control\"\n }),\n children\n ]);\n}\n\n\n//# sourceMappingURL=controls.ffb44307.js.map\n","import { useRef } from \"react\";\nimport { GeolocateControl } from \"mapbox-gl\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport {\n CompassControl,\n GlobeControl,\n ThreeDControl,\n MapControlWrapper,\n useMapStatus,\n} from \"@macrostrat/mapbox-react\";\nimport { ScaleControl as BaseScaleControl } from \"mapbox-gl\";\nimport { DevToolsButtonSlot } from \"@macrostrat/ui-components\";\n\nconst h = hyper.styled(styles);\n\nfunction ScaleControl(props) {\n const optionsRef = useRef({\n maxWidth: 200,\n unit: \"metric\",\n });\n return h(MapControlWrapper, {\n className: \"map-scale-control\",\n control: BaseScaleControl,\n options: optionsRef.current,\n ...props,\n });\n}\n\nfunction GeolocationControl(props) {\n const optionsRef = useRef({\n showAccuracyCircle: true,\n showUserLocation: true,\n trackUserLocation: true,\n positionOptions: {\n enableHighAccuracy: true,\n },\n });\n return h(MapControlWrapper, {\n control: GeolocateControl,\n options: optionsRef.current,\n ...props,\n });\n}\n\nexport function MapBottomControls({ children }) {\n const { isInitialized } = useMapStatus();\n\n if (!isInitialized) {\n return null;\n }\n\n return h(\"div.map-controls\", [\n h(ScaleControl),\n h(ThreeDControl, { className: \"map-3d-control\" }),\n h(CompassControl, { className: \"compass-control\" }),\n h(GlobeControl, { className: \"globe-control\" }),\n h(GeolocationControl, { className: \"geolocation-control\" }),\n // If we have global development tools enabled, show the button\n h(DevToolsButtonSlot, { className: \"map-control\" }),\n children,\n ]);\n}\n"],"names":["require","$kbh3o$macrostrathyper","$parcel$interopDefault","a","__esModule","default","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$6ULxP","styled"],"version":3,"file":"controls.ffb44307.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,Q,8C,Q,+C,Q,S,Q,a,I,E,Q,qB,S,E,C,E,O,G,E,U,C,E,O,C,C,C,Q,4B,Q,6B,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,SCcU,AAAA,AAAA,EAAA,GAAM,MAAM,CAAC,EAAA","sources":["<anon>","packages/map-interface/src/controls.ts"],"sourcesContent":["require(\"./main.module.7c928a6f.js\");\nrequire(\"./main.module.91a06e96.css\");\nvar $kbh3o$react = require(\"react\");\nvar $kbh3o$mapboxgl = require(\"mapbox-gl\");\nvar $kbh3o$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $kbh3o$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $kbh3o$macrostratuicomponents = require(\"@macrostrat/ui-components\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire94c2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\n\n\nvar $6ULxP = parcelRequire(\"6ULxP\");\n\n\nconst $7a11e3c77fefb3c4$var$h = (0, ($parcel$interopDefault($kbh3o$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($6ULxP))));\nfunction $7a11e3c77fefb3c4$var$ScaleControl(props) {\n const optionsRef = (0, $kbh3o$react.useRef)({\n maxWidth: 200,\n unit: \"metric\"\n });\n return $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratmapboxreact.MapControlWrapper), {\n className: \"map-scale-control\",\n control: (0, $kbh3o$mapboxgl.ScaleControl),\n options: optionsRef.current,\n ...props\n });\n}\nfunction $7a11e3c77fefb3c4$var$GeolocationControl(props) {\n const optionsRef = (0, $kbh3o$react.useRef)({\n showAccuracyCircle: true,\n showUserLocation: true,\n trackUserLocation: true,\n positionOptions: {\n enableHighAccuracy: true\n }\n });\n return $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratmapboxreact.MapControlWrapper), {\n control: (0, $kbh3o$mapboxgl.GeolocateControl),\n options: optionsRef.current,\n ...props\n });\n}\nfunction $7a11e3c77fefb3c4$export$db1a2e058a06fb5c({ children: children }) {\n const { isInitialized: isInitialized } = (0, $kbh3o$macrostratmapboxreact.useMapStatus)();\n if (!isInitialized) return null;\n return $7a11e3c77fefb3c4$var$h(\"div.map-controls\", [\n $7a11e3c77fefb3c4$var$h($7a11e3c77fefb3c4$var$ScaleControl),\n $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratmapboxreact.ThreeDControl), {\n className: \"map-3d-control\"\n }),\n $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratmapboxreact.CompassControl), {\n className: \"compass-control\"\n }),\n $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratmapboxreact.GlobeControl), {\n className: \"globe-control\"\n }),\n $7a11e3c77fefb3c4$var$h($7a11e3c77fefb3c4$var$GeolocationControl, {\n className: \"geolocation-control\"\n }),\n // If we have global development tools enabled, show the button\n $7a11e3c77fefb3c4$var$h((0, $kbh3o$macrostratuicomponents.DevToolsButtonSlot), {\n className: \"map-control\"\n }),\n children\n ]);\n}\n\n\n//# sourceMappingURL=controls.511f309b.js.map\n","import { useRef } from \"react\";\nimport { GeolocateControl } from \"mapbox-gl\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport {\n CompassControl,\n GlobeControl,\n ThreeDControl,\n MapControlWrapper,\n useMapStatus,\n} from \"@macrostrat/mapbox-react\";\nimport { ScaleControl as BaseScaleControl } from \"mapbox-gl\";\nimport { DevToolsButtonSlot } from \"@macrostrat/ui-components\";\n\nconst h = hyper.styled(styles);\n\nfunction ScaleControl(props) {\n const optionsRef = useRef({\n maxWidth: 200,\n unit: \"metric\",\n });\n return h(MapControlWrapper, {\n className: \"map-scale-control\",\n control: BaseScaleControl,\n options: optionsRef.current,\n ...props,\n });\n}\n\nfunction GeolocationControl(props) {\n const optionsRef = useRef({\n showAccuracyCircle: true,\n showUserLocation: true,\n trackUserLocation: true,\n positionOptions: {\n enableHighAccuracy: true,\n },\n });\n return h(MapControlWrapper, {\n control: GeolocateControl,\n options: optionsRef.current,\n ...props,\n });\n}\n\nexport function MapBottomControls({ children }) {\n const { isInitialized } = useMapStatus();\n\n if (!isInitialized) {\n return null;\n }\n\n return h(\"div.map-controls\", [\n h(ScaleControl),\n h(ThreeDControl, { className: \"map-3d-control\" }),\n h(CompassControl, { className: \"compass-control\" }),\n h(GlobeControl, { className: \"globe-control\" }),\n h(GeolocationControl, { className: \"geolocation-control\" }),\n // If we have global development tools enabled, show the button\n h(DevToolsButtonSlot, { className: \"map-control\" }),\n children,\n ]);\n}\n"],"names":["require","$kbh3o$macrostrathyper","$parcel$interopDefault","a","__esModule","default","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$6ULxP","styled"],"version":3,"file":"controls.511f309b.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- require("./map-page.f99c4a48.js"),require("./tile-extent.28db5d2c.js"),require("./vector-tile-features.b5a23b71.js"),require("./xray.bce11e7b.js");var e=globalThis,r={},i={},t=e.parcelRequire94c2;null==t&&((t=function(e){if(e in r)return r[e].exports;if(e in i){var t=i[e];delete i[e];var a={id:e,exports:{}};return r[e]=a,t.call(a.exports,a,a.exports),a.exports}var c=Error("Cannot find module '"+e+"'");throw c.code="MODULE_NOT_FOUND",c}).register=function(e,r){i[e]=r},e.parcelRequire94c2=t),t.register,new URL("map-page.f99c4a48.js","file:"+__filename).toString(),t("2DICz"),t("gnyJS"),t("2mAQJ");
2
- //# sourceMappingURL=dev.3cbf6106.js.map
1
+ require("./map-page.a9602658.js"),require("./tile-extent.28db5d2c.js"),require("./vector-tile-features.b5a23b71.js"),require("./xray.bce11e7b.js");var e=globalThis,r={},i={},t=e.parcelRequire94c2;null==t&&((t=function(e){if(e in r)return r[e].exports;if(e in i){var t=i[e];delete i[e];var a={id:e,exports:{}};return r[e]=a,t.call(a.exports,a,a.exports),a.exports}var c=Error("Cannot find module '"+e+"'");throw c.code="MODULE_NOT_FOUND",c}).register=function(e,r){i[e]=r},e.parcelRequire94c2=t),t.register,new URL("map-page.a9602658.js","file:"+__filename).toString(),t("2DICz"),t("gnyJS"),t("2mAQJ");
2
+ //# sourceMappingURL=dev.709287ba.js.map
@@ -1 +1 @@
1
- {"mappings":"A,Q,2C,Q,8C,Q,uD,Q,uC,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,CEAiB,IAAA,IAAoB,wCAAA,QAAA,YAAyC,QAAQ,G,E,S,E,S,E","sources":["<anon>","packages/map-interface/src/dev/index.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-f14b5173fc324a77.js"],"sourcesContent":["require(\"./map-page.f99c4a48.js\");\nrequire(\"./tile-extent.28db5d2c.js\");\nrequire(\"./vector-tile-features.b5a23b71.js\");\nrequire(\"./xray.bce11e7b.js\");\n\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire94c2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $dc6a786c8b10a4e8$exports = {};\n$dc6a786c8b10a4e8$exports = new URL(\"map-page.f99c4a48.js\", \"file:\" + __filename).toString();\n\n\nparcelRequire(\"2DICz\");\nparcelRequire(\"gnyJS\");\nparcelRequire(\"2mAQJ\");\n\n\n//# sourceMappingURL=dev.3cbf6106.js.map\n","export * from \"./map-page\";\nexport * from \"./tile-extent\";\nexport * from \"./vector-tile-features\";\nexport * from \"./xray\";\n","module.exports = new __parcel__URL__(\"map-page.f99c4a48.js\").toString();"],"names":["require","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","URL","__filename","toString"],"version":3,"file":"dev.3cbf6106.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,Q,2C,Q,8C,Q,uD,Q,uC,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,CEAiB,IAAA,IAAoB,wCAAA,QAAA,YAAyC,QAAQ,G,E,S,E,S,E","sources":["<anon>","packages/map-interface/src/dev/index.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-f14b5173fc324a77.js"],"sourcesContent":["require(\"./map-page.a9602658.js\");\nrequire(\"./tile-extent.28db5d2c.js\");\nrequire(\"./vector-tile-features.b5a23b71.js\");\nrequire(\"./xray.bce11e7b.js\");\n\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire94c2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $dc6a786c8b10a4e8$exports = {};\n$dc6a786c8b10a4e8$exports = new URL(\"map-page.a9602658.js\", \"file:\" + __filename).toString();\n\n\nparcelRequire(\"2DICz\");\nparcelRequire(\"gnyJS\");\nparcelRequire(\"2mAQJ\");\n\n\n//# sourceMappingURL=dev.709287ba.js.map\n","export * from \"./map-page\";\nexport * from \"./tile-extent\";\nexport * from \"./vector-tile-features\";\nexport * from \"./xray\";\n","module.exports = new __parcel__URL__(\"map-page.a9602658.js\").toString();"],"names":["require","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","URL","__filename","toString"],"version":3,"file":"dev.709287ba.js.map","sourceRoot":"../../../../"}
@@ -0,0 +1,2 @@
1
+ require("./main.module.3943144e.css"),require("./main.module.3a8fef67.js"),require("./location-info.db66c3fb.js"),require("@blueprintjs/core");var e=require("@macrostrat/hyper");function r(e){return e&&e.__esModule?e.default:e}require("@macrostrat/ui-components"),require("@macrostrat/mapbox-react"),require("classnames");var a={};a=new URL("main.module.3943144e.css","file:"+__filename).toString(),new URL("location-info.db66c3fb.js","file:"+__filename).toString(),r(e).styled(r(a));
2
+ //# sourceMappingURL=header.98a4cf12.js.map
@@ -1 +1 @@
1
- {"mappings":"A,Q,+C,Q,8C,Q,gD,Q,qB,I,E,Q,qB,S,E,C,E,O,G,E,U,C,E,O,C,C,C,Q,6B,Q,4B,Q,c,I,E,C,EEAA,EAAiB,IAAA,IAAoB,4CAAA,QAAA,YAA6C,QAAQ,GCAzE,IAAA,IAAoB,6CAAA,QAAA,YAA8C,QAAQ,GFYjF,AAAA,AAAA,EAAA,GAAM,MAAM,CAAC,EAAA","sources":["<anon>","packages/map-interface/src/location-panel/header.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-6d6e92b02eb73299.js","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-c5bf3b5be72c4e09.js"],"sourcesContent":["require(\"./main.module.ba3f4a78.css\");\nrequire(\"./main.module.3a8fef67.js\");\nrequire(\"./location-info.9f59aad3.js\");\nvar $9HnAS$blueprintjscore = require(\"@blueprintjs/core\");\nvar $9HnAS$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $9HnAS$macrostratuicomponents = require(\"@macrostrat/ui-components\");\nvar $9HnAS$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $9HnAS$classnames = require(\"classnames\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n\nvar $b3d3cdac95f8f8a9$exports = {};\n$b3d3cdac95f8f8a9$exports = new URL(\"main.module.ba3f4a78.css\", \"file:\" + __filename).toString();\n\n\n\nvar $7d4f3c2ee54a88a2$exports = {};\n$7d4f3c2ee54a88a2$exports = new URL(\"location-info.9f59aad3.js\", \"file:\" + __filename).toString();\n\n\n\n\nconst $1a913554a5c0869b$var$h = (0, ($parcel$interopDefault($9HnAS$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($b3d3cdac95f8f8a9$exports))));\nfunction $1a913554a5c0869b$var$PositionButton({ position: position, bounds: bounds, showCopyLink: showCopyLink = false }) {\n const focusState = (0, $9HnAS$macrostratmapboxreact.useFocusState)(position);\n const copyLinkIsVisible = (0, $9HnAS$macrostratmapboxreact.isCentered)(focusState) && showCopyLink;\n return $1a913554a5c0869b$var$h(\"div.position-controls\", [\n $1a913554a5c0869b$var$h((0, $9HnAS$macrostratmapboxreact.LocationFocusButton), {\n location: position,\n bounds: bounds,\n focusState: focusState\n }, []),\n $1a913554a5c0869b$var$h.if(copyLinkIsVisible && position != null)($1a913554a5c0869b$var$CopyLinkButton, {\n itemName: \"position\"\n })\n ]);\n}\nfunction $1a913554a5c0869b$var$CopyLinkButton({ itemName: itemName, children: children, onClick: onClick, ...rest }) {\n const toaster = (0, $9HnAS$macrostratuicomponents.useToaster)();\n let message = `Copied link`;\n if (itemName != null) message += ` to ${itemName}`;\n message += \"!\";\n return $1a913554a5c0869b$var$h((0, $9HnAS$blueprintjscore.Button), {\n className: \"copy-link-button\",\n rightIcon: $1a913554a5c0869b$var$h((0, $9HnAS$blueprintjscore.Icon), {\n icon: \"link\",\n size: 12\n }),\n minimal: true,\n small: true,\n onClick () {\n navigator.clipboard.writeText(window.location.href).then(()=>{\n toaster?.show({\n message: message,\n intent: \"success\",\n icon: \"clipboard\",\n timeout: 1000\n });\n onClick?.();\n }, ()=>{\n toaster?.show({\n message: \"Failed to copy link\",\n intent: \"danger\",\n icon: \"error\",\n timeout: 1000\n });\n });\n },\n ...rest\n }, children ?? \"Copy link\");\n}\nfunction $1a913554a5c0869b$export$e9ff14c4822c2e8c(props) {\n const { onClose: onClose, position: position, bounds: bounds, zoom: zoom = 7, elevation: elevation, showCopyPositionButton: showCopyPositionButton, fixedHeight: fixedHeight = false, children: children, className: className } = props;\n let leftButton = null;\n if (bounds != null || position != null) leftButton = $1a913554a5c0869b$var$h($1a913554a5c0869b$var$PositionButton, {\n position: position,\n bounds: bounds,\n showCopyLink: showCopyPositionButton\n });\n return $1a913554a5c0869b$var$h(\"header.location-panel-header\", {\n className: (0, ($parcel$interopDefault($9HnAS$classnames)))(className, {\n \"fixed-height\": fixedHeight\n })\n }, [\n leftButton,\n children,\n $1a913554a5c0869b$var$h(\"div.spacer\"),\n $1a913554a5c0869b$var$h.if(position != null)((0, $7d4f3c2ee54a88a2$exports.LngLatCoords), {\n position: position,\n zoom: zoom,\n className: \"infodrawer-header-item\"\n }),\n $1a913554a5c0869b$var$h.if(elevation != null)((0, $7d4f3c2ee54a88a2$exports.Elevation), {\n elevation: elevation,\n className: \"infodrawer-header-item\"\n }),\n $1a913554a5c0869b$var$h.if(onClose != null)((0, $9HnAS$blueprintjscore.Button), {\n minimal: true,\n icon: \"cross\",\n onClick: onClose\n })\n ]);\n}\n\n\n//# sourceMappingURL=header.4b58753a.js.map\n","import { Icon, Button } from \"@blueprintjs/core\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { useToaster } from \"@macrostrat/ui-components\";\nimport { LngLatCoords, Elevation } from \"../location-info\";\nimport {\n LocationFocusButton,\n useFocusState,\n isCentered,\n} from \"@macrostrat/mapbox-react\";\nimport classNames from \"classnames\";\n\nconst h = hyper.styled(styles);\n\nfunction PositionButton({ position, bounds, showCopyLink = false }) {\n const focusState = useFocusState(position);\n\n const copyLinkIsVisible = isCentered(focusState) && showCopyLink;\n\n return h(\"div.position-controls\", [\n h(LocationFocusButton, { location: position, bounds, focusState }, []),\n h.if(copyLinkIsVisible && position != null)(CopyLinkButton, {\n itemName: \"position\",\n }),\n ]);\n}\n\nfunction CopyLinkButton({ itemName, children, onClick, ...rest }) {\n const toaster = useToaster();\n\n let message = `Copied link`;\n if (itemName != null) {\n message += ` to ${itemName}`;\n }\n message += \"!\";\n\n return h(\n Button,\n {\n className: \"copy-link-button\",\n rightIcon: h(Icon, { icon: \"link\", size: 12 }),\n minimal: true,\n small: true,\n onClick() {\n navigator.clipboard.writeText(window.location.href).then(\n () => {\n toaster?.show({\n message,\n intent: \"success\",\n icon: \"clipboard\",\n timeout: 1000,\n });\n onClick?.();\n },\n () => {\n toaster?.show({\n message: \"Failed to copy link\",\n intent: \"danger\",\n icon: \"error\",\n timeout: 1000,\n });\n }\n );\n },\n ...rest,\n },\n children ?? \"Copy link\"\n );\n}\n\nexport interface InfoDrawerHeaderProps {\n onClose?: () => void;\n position?: mapboxgl.LngLat;\n zoom?: number;\n elevation?: number;\n showCopyPositionButton?: boolean;\n bounds?: mapboxgl.LngLatBounds;\n fixedHeight?: boolean;\n children?: React.ReactNode;\n className?: string;\n}\n\nexport function InfoDrawerHeader(props: InfoDrawerHeaderProps) {\n const {\n onClose,\n position,\n bounds,\n zoom = 7,\n elevation,\n showCopyPositionButton,\n fixedHeight = false,\n children,\n className,\n } = props;\n\n let leftButton = null;\n if (bounds != null || position != null) {\n leftButton = h(PositionButton, {\n position,\n bounds,\n showCopyLink: showCopyPositionButton,\n });\n }\n\n return h(\n \"header.location-panel-header\",\n {\n className: classNames(className, { \"fixed-height\": fixedHeight }),\n },\n [\n leftButton,\n children,\n h(\"div.spacer\"),\n h.if(position != null)(LngLatCoords, {\n position,\n zoom,\n className: \"infodrawer-header-item\",\n }),\n h.if(elevation != null)(Elevation, {\n elevation,\n className: \"infodrawer-header-item\",\n }),\n h.if(onClose != null)(Button, {\n minimal: true,\n icon: \"cross\",\n onClick: onClose,\n }),\n ]\n );\n}\n","module.exports = new __parcel__URL__(\"main.module.ba3f4a78.css\").toString();","module.exports = new __parcel__URL__(\"location-info.9f59aad3.js\").toString();"],"names":["require","$9HnAS$macrostrathyper","$parcel$interopDefault","a","__esModule","default","$b3d3cdac95f8f8a9$exports","URL","__filename","toString","styled"],"version":3,"file":"header.4b58753a.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,Q,+C,Q,8C,Q,gD,Q,qB,I,E,Q,qB,S,E,C,E,O,G,E,U,C,E,O,C,C,C,Q,6B,Q,4B,Q,c,I,E,C,EEAA,EAAiB,IAAA,IAAoB,4CAAA,QAAA,YAA6C,QAAQ,GCAzE,IAAA,IAAoB,6CAAA,QAAA,YAA8C,QAAQ,GFcjF,AAAA,AAAA,EAAA,GAAM,MAAM,CAAC,EAAA","sources":["<anon>","packages/map-interface/src/location-panel/header.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-6d6e92b02eb73299.js","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-c5bf3b5be72c4e09.js"],"sourcesContent":["require(\"./main.module.3943144e.css\");\nrequire(\"./main.module.3a8fef67.js\");\nrequire(\"./location-info.db66c3fb.js\");\nvar $9HnAS$blueprintjscore = require(\"@blueprintjs/core\");\nvar $9HnAS$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $9HnAS$macrostratuicomponents = require(\"@macrostrat/ui-components\");\nvar $9HnAS$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $9HnAS$classnames = require(\"classnames\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n\nvar $b3d3cdac95f8f8a9$exports = {};\n$b3d3cdac95f8f8a9$exports = new URL(\"main.module.3943144e.css\", \"file:\" + __filename).toString();\n\n\n\nvar $7d4f3c2ee54a88a2$exports = {};\n$7d4f3c2ee54a88a2$exports = new URL(\"location-info.db66c3fb.js\", \"file:\" + __filename).toString();\n\n\n\n\nconst $1a913554a5c0869b$var$h = (0, ($parcel$interopDefault($9HnAS$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($b3d3cdac95f8f8a9$exports))));\nfunction $1a913554a5c0869b$var$PositionButton({ position: position, bounds: bounds, showCopyLink: showCopyLink = false }) {\n const focusState = (0, $9HnAS$macrostratmapboxreact.useFocusState)(position);\n const copyLinkIsVisible = (0, $9HnAS$macrostratmapboxreact.isCentered)(focusState) && showCopyLink;\n return $1a913554a5c0869b$var$h(\"div.position-controls\", [\n $1a913554a5c0869b$var$h((0, $9HnAS$macrostratmapboxreact.LocationFocusButton), {\n location: position,\n bounds: bounds,\n focusState: focusState\n }, []),\n $1a913554a5c0869b$var$h.if(copyLinkIsVisible && position != null)($1a913554a5c0869b$var$CopyLinkButton, {\n itemName: \"position\"\n })\n ]);\n}\nfunction $1a913554a5c0869b$var$CopyLinkButton({ itemName: itemName, children: children, onClick: onClick, ...rest }) {\n const toaster = (0, $9HnAS$macrostratuicomponents.useToaster)();\n let message = `Copied link`;\n if (itemName != null) message += ` to ${itemName}`;\n message += \"!\";\n return $1a913554a5c0869b$var$h((0, $9HnAS$blueprintjscore.Button), {\n className: \"copy-link-button\",\n rightIcon: $1a913554a5c0869b$var$h((0, $9HnAS$blueprintjscore.Icon), {\n icon: \"link\",\n size: 12\n }),\n minimal: true,\n small: true,\n onClick () {\n navigator.clipboard.writeText(window.location.href).then(()=>{\n toaster?.show({\n message: message,\n intent: \"success\",\n icon: \"clipboard\",\n timeout: 1000\n });\n onClick?.();\n }, ()=>{\n toaster?.show({\n message: \"Failed to copy link\",\n intent: \"danger\",\n icon: \"error\",\n timeout: 1000\n });\n });\n },\n ...rest\n }, children ?? \"Copy link\");\n}\nfunction $1a913554a5c0869b$export$e9ff14c4822c2e8c(props) {\n const { onClose: onClose, position: position, bounds: bounds, zoom: zoom = 7, elevation: elevation, showCopyPositionButton: showCopyPositionButton, fixedHeight: fixedHeight = false, children: children, className: className } = props;\n let leftButton = null;\n if (bounds != null || position != null) leftButton = $1a913554a5c0869b$var$h($1a913554a5c0869b$var$PositionButton, {\n position: position,\n bounds: bounds,\n showCopyLink: showCopyPositionButton\n });\n return $1a913554a5c0869b$var$h(\"header.location-panel-header\", {\n className: (0, ($parcel$interopDefault($9HnAS$classnames)))(className, {\n \"fixed-height\": fixedHeight\n })\n }, [\n leftButton,\n children,\n $1a913554a5c0869b$var$h(\"div.spacer\"),\n $1a913554a5c0869b$var$h.if(position != null)((0, $7d4f3c2ee54a88a2$exports.LngLatCoords), {\n position: position,\n zoom: zoom,\n className: \"infodrawer-header-item\"\n }),\n $1a913554a5c0869b$var$h.if(elevation != null)((0, $7d4f3c2ee54a88a2$exports.Elevation), {\n elevation: elevation,\n className: \"infodrawer-header-item\"\n }),\n $1a913554a5c0869b$var$h.if(onClose != null)((0, $9HnAS$blueprintjscore.Button), {\n minimal: true,\n icon: \"cross\",\n onClick: onClose\n })\n ]);\n}\n\n\n//# sourceMappingURL=header.98a4cf12.js.map\n","import { Icon, Button } from \"@blueprintjs/core\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { useToaster } from \"@macrostrat/ui-components\";\nimport { LngLatCoords, Elevation } from \"../location-info\";\nimport {\n LocationFocusButton,\n useFocusState,\n isCentered,\n} from \"@macrostrat/mapbox-react\";\nimport classNames from \"classnames\";\nimport type { ReactNode } from \"react\";\nimport type { LngLatBounds, LngLatLike } from \"mapbox-gl\";\n\nconst h = hyper.styled(styles);\n\nfunction PositionButton({ position, bounds, showCopyLink = false }) {\n const focusState = useFocusState(position);\n\n const copyLinkIsVisible = isCentered(focusState) && showCopyLink;\n\n return h(\"div.position-controls\", [\n h(LocationFocusButton, { location: position, bounds, focusState }, []),\n h.if(copyLinkIsVisible && position != null)(CopyLinkButton, {\n itemName: \"position\",\n }),\n ]);\n}\n\nfunction CopyLinkButton({ itemName, children, onClick, ...rest }) {\n const toaster = useToaster();\n\n let message = `Copied link`;\n if (itemName != null) {\n message += ` to ${itemName}`;\n }\n message += \"!\";\n\n return h(\n Button,\n {\n className: \"copy-link-button\",\n rightIcon: h(Icon, { icon: \"link\", size: 12 }),\n minimal: true,\n small: true,\n onClick() {\n navigator.clipboard.writeText(window.location.href).then(\n () => {\n toaster?.show({\n message,\n intent: \"success\",\n icon: \"clipboard\",\n timeout: 1000,\n });\n onClick?.();\n },\n () => {\n toaster?.show({\n message: \"Failed to copy link\",\n intent: \"danger\",\n icon: \"error\",\n timeout: 1000,\n });\n }\n );\n },\n ...rest,\n },\n children ?? \"Copy link\"\n );\n}\n\nexport interface InfoDrawerHeaderProps {\n onClose?: () => void;\n position?: LngLatLike;\n zoom?: number;\n elevation?: number;\n showCopyPositionButton?: boolean;\n bounds?: LngLatBounds;\n fixedHeight?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\nexport function InfoDrawerHeader(props: InfoDrawerHeaderProps) {\n const {\n onClose,\n position,\n bounds,\n zoom = 7,\n elevation,\n showCopyPositionButton,\n fixedHeight = false,\n children,\n className,\n } = props;\n\n let leftButton = null;\n if (bounds != null || position != null) {\n leftButton = h(PositionButton, {\n position,\n bounds,\n showCopyLink: showCopyPositionButton,\n });\n }\n\n return h(\n \"header.location-panel-header\",\n {\n className: classNames(className, { \"fixed-height\": fixedHeight }),\n },\n [\n leftButton,\n children,\n h(\"div.spacer\"),\n h.if(position != null)(LngLatCoords, {\n position,\n zoom,\n className: \"infodrawer-header-item\",\n }),\n h.if(elevation != null)(Elevation, {\n elevation,\n className: \"infodrawer-header-item\",\n }),\n h.if(onClose != null)(Button, {\n minimal: true,\n icon: \"cross\",\n onClick: onClose,\n }),\n ]\n );\n}\n","module.exports = new __parcel__URL__(\"main.module.3943144e.css\").toString();","module.exports = new __parcel__URL__(\"location-info.db66c3fb.js\").toString();"],"names":["require","$9HnAS$macrostrathyper","$parcel$interopDefault","a","__esModule","default","$b3d3cdac95f8f8a9$exports","URL","__filename","toString","styled"],"version":3,"file":"header.98a4cf12.js.map","sourceRoot":"../../../../"}
@@ -1 +1 @@
1
- {"mappings":"A,Q,wC,Q,4B,Q,S,Q,c,Q,uB,Q,4B,Q,6BEAiB,IAAA,IAAoB,qCAAA,QAAA,YAAsC,QAAQ","sources":["<anon>","packages/map-interface/src/helpers.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-e6d33222b7cde4f3.js"],"sourcesContent":["require(\"./utils.dd92f725.js\");\nvar $2crMj$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $2crMj$react = require(\"react\");\nvar $2crMj$underscore = require(\"underscore\");\nvar $2crMj$useresizeobserver = require(\"use-resize-observer\");\nvar $2crMj$macrostratmapboxutils = require(\"@macrostrat/mapbox-utils\");\nvar $2crMj$macrostratuicomponents = require(\"@macrostrat/ui-components\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n\n\n\n\nvar $976134caf6f51524$exports = {};\n$976134caf6f51524$exports = new URL(\"utils.dd92f725.js\", \"file:\" + __filename).toString();\n\n\n\nfunction $f6c715b8ad8cb91a$export$31b2e088aff2dc5d({ containerRef: containerRef }) {\n const mapRef = (0, $2crMj$macrostratmapboxreact.useMapRef)();\n const debouncedResize = (0, $2crMj$react.useRef)((0, $2crMj$underscore.debounce)(()=>{\n mapRef.current?.resize();\n }, 100));\n (0, ($parcel$interopDefault($2crMj$useresizeobserver)))({\n ref: containerRef,\n onResize: debouncedResize.current\n });\n return null;\n}\nfunction $f6c715b8ad8cb91a$export$2ab96428dea558d6({ containerRef: containerRef, parentRef: parentRef, infoMarkerPosition: infoMarkerPosition, debounceTime: debounceTime = 200 }) {\n const mapRef = (0, $2crMj$macrostratmapboxreact.useMapRef)();\n const [padding, setPadding] = (0, $2crMj$react.useState)((0, $976134caf6f51524$exports.getMapPadding)(containerRef, parentRef));\n const _updateMapPadding = (0, $2crMj$react.useCallback)(()=>{\n const newPadding = (0, $976134caf6f51524$exports.getMapPadding)(containerRef, parentRef);\n setPadding(newPadding);\n }, [\n containerRef.current,\n parentRef.current\n ]);\n const updateMapPadding = (0, $2crMj$react.useMemo)(()=>(0, $2crMj$underscore.debounce)(_updateMapPadding, debounceTime), [\n _updateMapPadding,\n debounceTime\n ]);\n (0, $2crMj$react.useEffect)(()=>{\n const map = mapRef.current;\n if (map == null) return;\n // Update map padding on load\n updateMapPadding();\n }, [\n mapRef.current\n ]);\n (0, ($parcel$interopDefault($2crMj$useresizeobserver)))({\n ref: parentRef,\n onResize (sz) {\n updateMapPadding();\n },\n round (n) {\n return Math.round(n);\n }\n });\n // Ideally, we would not have to do this when we know the infobox is loaded\n (0, $2crMj$macrostratmapboxreact.useMapEaseTo)({\n center: infoMarkerPosition,\n padding: padding\n });\n return null;\n}\nfunction $f6c715b8ad8cb91a$export$f6eeee399afc4e9a({ onMapMoved: onMapMoved = null }) {\n const mapRef = (0, $2crMj$macrostratmapboxreact.useMapRef)();\n const dispatch = (0, $2crMj$macrostratmapboxreact.useMapDispatch)();\n const isInitialized = (0, $2crMj$macrostratmapboxreact.useMapInitialized)();\n const mapMovedCallback = (0, $2crMj$react.useCallback)(()=>{\n const map = mapRef.current;\n if (map == null) return;\n const mapPosition = (0, $2crMj$macrostratmapboxutils.getMapPosition)(map);\n dispatch({\n type: \"map-moved\",\n payload: mapPosition\n });\n onMapMoved?.(mapPosition, map);\n }, [\n onMapMoved,\n dispatch,\n isInitialized\n ]);\n (0, $2crMj$react.useEffect)(()=>{\n // Get the current value of the map. Useful for gradually moving away\n // from class component\n const map = mapRef.current;\n if (map == null) return;\n // Update the URI when the map moves\n mapMovedCallback();\n const cb = (0, $2crMj$underscore.debounce)(mapMovedCallback, 100);\n map.on(\"moveend\", cb);\n return ()=>{\n map?.off(\"moveend\", cb);\n };\n }, [\n mapMovedCallback\n ]);\n return null;\n}\nfunction $f6c715b8ad8cb91a$export$e57f9eaa51773f82({ ignoredSources: ignoredSources, onMapLoading: onMapLoading = null, onMapIdle: onMapIdle = null, mapIsLoading: mapIsLoading }) {\n const mapRef = (0, $2crMj$macrostratmapboxreact.useMapRef)();\n const loadingRef = (0, $2crMj$react.useRef)(false);\n const dispatch = (0, $2crMj$macrostratmapboxreact.useMapDispatch)();\n const isInitialized = (0, $2crMj$macrostratmapboxreact.useMapInitialized)();\n (0, $2crMj$react.useEffect)(()=>{\n const map = mapRef.current;\n const mapIsLoading = loadingRef.current;\n if (map == null) return;\n let didSendLoading = false;\n const loadingCallback = (evt)=>{\n if (ignoredSources.includes(evt.sourceId) || mapIsLoading) return;\n if (didSendLoading) return;\n onMapLoading?.(evt);\n dispatch({\n type: \"set-loading\",\n payload: true\n });\n loadingRef.current = true;\n didSendLoading = true;\n };\n const idleCallback = (evt)=>{\n if (!mapIsLoading) return;\n dispatch({\n type: \"set-loading\",\n payload: false\n });\n loadingRef.current = false;\n onMapIdle?.(evt);\n };\n map.on(\"sourcedataloading\", loadingCallback);\n map.on(\"idle\", idleCallback);\n return ()=>{\n map?.off(\"sourcedataloading\", loadingCallback);\n map?.off(\"idle\", idleCallback);\n };\n }, [\n ignoredSources,\n mapIsLoading,\n isInitialized\n ]);\n return null;\n}\nfunction $f6c715b8ad8cb91a$export$5c90a91c7455938c({ position: position, setPosition: setPosition, centerMarker: centerMarker = true }) {\n const mapRef = (0, $2crMj$macrostratmapboxreact.useMapRef)();\n const markerRef = (0, $2crMj$react.useRef)(null);\n const isInitialized = (0, $2crMj$macrostratmapboxreact.useMapInitialized)();\n (0, $976134caf6f51524$exports.useMapMarker)(mapRef, markerRef, position);\n (0, $2crMj$react.useEffect)(()=>{\n const map = mapRef.current;\n if (map == null || setPosition == null) return;\n const handleMapClick = (event)=>{\n setPosition(event.lngLat, event, mapRef.current);\n // We should integrate this with the \"easeToCenter\" hook\n if (centerMarker) mapRef.current?.flyTo({\n center: event.lngLat,\n duration: 800\n });\n };\n map.on(\"click\", handleMapClick);\n return ()=>{\n map?.off(\"click\", handleMapClick);\n };\n }, [\n setPosition,\n isInitialized\n ]);\n return null;\n}\nfunction $f6c715b8ad8cb91a$export$566518253d2584f8() {\n const inDarkMode = (0, $2crMj$macrostratuicomponents.useInDarkMode)();\n return inDarkMode ? \"mapbox://styles/mapbox/dark-v10\" : \"mapbox://styles/mapbox/light-v10\";\n}\n\n\n//# sourceMappingURL=helpers.6bda171f.js.map\n","import {\n useMapRef,\n useMapEaseTo,\n useMapDispatch,\n useMapStatus,\n useMapInitialized,\n} from \"@macrostrat/mapbox-react\";\nimport { useMemo, useRef } from \"react\";\nimport { debounce } from \"underscore\";\nimport useResizeObserver from \"use-resize-observer\";\n\nimport { getMapPosition } from \"@macrostrat/mapbox-utils\";\nimport mapboxgl from \"mapbox-gl\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { getMapPadding, useMapMarker } from \"./utils\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\n\nexport function MapResizeManager({ containerRef }) {\n const mapRef = useMapRef();\n\n const debouncedResize = useRef(\n debounce(() => {\n mapRef.current?.resize();\n }, 100)\n );\n\n useResizeObserver({\n ref: containerRef,\n onResize: debouncedResize.current,\n });\n\n return null;\n}\n\ninterface MapPaddingManagerProps {\n containerRef: React.RefObject<HTMLDivElement>;\n parentRef: React.RefObject<HTMLDivElement>;\n infoMarkerPosition: mapboxgl.LngLatLike;\n debounceTime?: number;\n}\n\nexport function MapPaddingManager({\n containerRef,\n parentRef,\n infoMarkerPosition,\n debounceTime = 200,\n}: MapPaddingManagerProps) {\n const mapRef = useMapRef();\n\n const [padding, setPadding] = useState(\n getMapPadding(containerRef, parentRef)\n );\n\n const _updateMapPadding = useCallback(() => {\n const newPadding = getMapPadding(containerRef, parentRef);\n setPadding(newPadding);\n }, [containerRef.current, parentRef.current]);\n\n const updateMapPadding = useMemo(\n () => debounce(_updateMapPadding, debounceTime),\n [_updateMapPadding, debounceTime]\n );\n\n useEffect(() => {\n const map = mapRef.current;\n if (map == null) return;\n // Update map padding on load\n updateMapPadding();\n }, [mapRef.current]);\n\n useResizeObserver({\n ref: parentRef,\n onResize(sz) {\n updateMapPadding();\n },\n round(n) {\n return Math.round(n);\n },\n });\n\n // Ideally, we would not have to do this when we know the infobox is loaded\n useMapEaseTo({ center: infoMarkerPosition, padding });\n\n return null;\n}\n\nexport function MapMovedReporter({ onMapMoved = null }) {\n const mapRef = useMapRef();\n const dispatch = useMapDispatch();\n const isInitialized = useMapInitialized();\n\n const mapMovedCallback = useCallback(() => {\n const map = mapRef.current;\n if (map == null) return;\n const mapPosition = getMapPosition(map);\n dispatch({ type: \"map-moved\", payload: mapPosition });\n onMapMoved?.(mapPosition, map);\n }, [onMapMoved, dispatch, isInitialized]);\n\n useEffect(() => {\n // Get the current value of the map. Useful for gradually moving away\n // from class component\n const map = mapRef.current;\n if (map == null) return;\n // Update the URI when the map moves\n mapMovedCallback();\n const cb = debounce(mapMovedCallback, 100);\n map.on(\"moveend\", cb);\n return () => {\n map?.off(\"moveend\", cb);\n };\n }, [mapMovedCallback]);\n return null;\n}\n\nexport function MapLoadingReporter({\n ignoredSources,\n onMapLoading = null,\n onMapIdle = null,\n mapIsLoading,\n}) {\n const mapRef = useMapRef();\n const loadingRef = useRef(false);\n const dispatch = useMapDispatch();\n const isInitialized = useMapInitialized();\n\n useEffect(() => {\n const map = mapRef.current;\n const mapIsLoading = loadingRef.current;\n if (map == null) return;\n\n let didSendLoading = false;\n\n const loadingCallback = (evt) => {\n if (ignoredSources.includes(evt.sourceId) || mapIsLoading) return;\n if (didSendLoading) return;\n onMapLoading?.(evt);\n dispatch({ type: \"set-loading\", payload: true });\n loadingRef.current = true;\n didSendLoading = true;\n };\n const idleCallback = (evt) => {\n if (!mapIsLoading) return;\n dispatch({ type: \"set-loading\", payload: false });\n loadingRef.current = false;\n onMapIdle?.(evt);\n };\n map.on(\"sourcedataloading\", loadingCallback);\n map.on(\"idle\", idleCallback);\n return () => {\n map?.off(\"sourcedataloading\", loadingCallback);\n map?.off(\"idle\", idleCallback);\n };\n }, [ignoredSources, mapIsLoading, isInitialized]);\n return null;\n}\n\nexport function MapMarker({ position, setPosition, centerMarker = true }) {\n const mapRef = useMapRef();\n const markerRef = useRef(null);\n const isInitialized = useMapInitialized();\n\n useMapMarker(mapRef, markerRef, position);\n\n useEffect(() => {\n const map = mapRef.current;\n if (map == null || setPosition == null) return;\n\n const handleMapClick = (event: mapboxgl.MapMouseEvent) => {\n setPosition(event.lngLat, event, mapRef.current);\n // We should integrate this with the \"easeToCenter\" hook\n if (centerMarker) {\n mapRef.current?.flyTo({ center: event.lngLat, duration: 800 });\n }\n };\n\n map.on(\"click\", handleMapClick);\n\n return () => {\n map?.off(\"click\", handleMapClick);\n };\n }, [setPosition, isInitialized]);\n\n return null;\n}\n\nexport function useBasicStylePair() {\n const inDarkMode = useInDarkMode();\n return inDarkMode\n ? \"mapbox://styles/mapbox/dark-v10\"\n : \"mapbox://styles/mapbox/light-v10\";\n}\n","module.exports = new __parcel__URL__(\"utils.dd92f725.js\").toString();"],"names":["require","URL","__filename","toString"],"version":3,"file":"helpers.6bda171f.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,Q,wC,Q,4B,Q,S,Q,c,Q,uB,Q,4B,Q,6BEAiB,IAAA,IAAoB,qCAAA,QAAA,YAAsC,QAAQ","sources":["<anon>","packages/map-interface/src/helpers.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-e6d33222b7cde4f3.js"],"sourcesContent":["require(\"./utils.dd92f725.js\");\nvar $2crMj$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $2crMj$react = require(\"react\");\nvar $2crMj$underscore = require(\"underscore\");\nvar $2crMj$useresizeobserver = require(\"use-resize-observer\");\nvar $2crMj$macrostratmapboxutils = require(\"@macrostrat/mapbox-utils\");\nvar $2crMj$macrostratuicomponents = require(\"@macrostrat/ui-components\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n\n\n\n\nvar $976134caf6f51524$exports = {};\n$976134caf6f51524$exports = new URL(\"utils.dd92f725.js\", \"file:\" + __filename).toString();\n\n\n\nfunction $f6c715b8ad8cb91a$export$31b2e088aff2dc5d({ containerRef: containerRef }) {\n const mapRef = (0, $2crMj$macrostratmapboxreact.useMapRef)();\n const debouncedResize = (0, $2crMj$react.useRef)((0, $2crMj$underscore.debounce)(()=>{\n mapRef.current?.resize();\n }, 100));\n (0, ($parcel$interopDefault($2crMj$useresizeobserver)))({\n ref: containerRef,\n onResize: debouncedResize.current\n });\n return null;\n}\nfunction $f6c715b8ad8cb91a$export$2ab96428dea558d6({ containerRef: containerRef, parentRef: parentRef, infoMarkerPosition: infoMarkerPosition, debounceTime: debounceTime = 200 }) {\n const mapRef = (0, $2crMj$macrostratmapboxreact.useMapRef)();\n const [padding, setPadding] = (0, $2crMj$react.useState)((0, $976134caf6f51524$exports.getMapPadding)(containerRef, parentRef));\n const _updateMapPadding = (0, $2crMj$react.useCallback)(()=>{\n const newPadding = (0, $976134caf6f51524$exports.getMapPadding)(containerRef, parentRef);\n setPadding(newPadding);\n }, [\n containerRef.current,\n parentRef.current\n ]);\n const updateMapPadding = (0, $2crMj$react.useMemo)(()=>(0, $2crMj$underscore.debounce)(_updateMapPadding, debounceTime), [\n _updateMapPadding,\n debounceTime\n ]);\n (0, $2crMj$react.useEffect)(()=>{\n const map = mapRef.current;\n if (map == null) return;\n // Update map padding on load\n updateMapPadding();\n }, [\n mapRef.current\n ]);\n (0, ($parcel$interopDefault($2crMj$useresizeobserver)))({\n ref: parentRef,\n onResize (sz) {\n updateMapPadding();\n },\n round (n) {\n return Math.round(n);\n }\n });\n // Ideally, we would not have to do this when we know the infobox is loaded\n (0, $2crMj$macrostratmapboxreact.useMapEaseTo)({\n center: infoMarkerPosition,\n padding: padding\n });\n return null;\n}\nfunction $f6c715b8ad8cb91a$export$f6eeee399afc4e9a({ onMapMoved: onMapMoved = null }) {\n const mapRef = (0, $2crMj$macrostratmapboxreact.useMapRef)();\n const dispatch = (0, $2crMj$macrostratmapboxreact.useMapDispatch)();\n const isInitialized = (0, $2crMj$macrostratmapboxreact.useMapInitialized)();\n const mapMovedCallback = (0, $2crMj$react.useCallback)(()=>{\n const map = mapRef.current;\n if (map == null) return;\n const mapPosition = (0, $2crMj$macrostratmapboxutils.getMapPosition)(map);\n dispatch({\n type: \"map-moved\",\n payload: mapPosition\n });\n onMapMoved?.(mapPosition, map);\n }, [\n onMapMoved,\n dispatch,\n isInitialized\n ]);\n (0, $2crMj$react.useEffect)(()=>{\n // Get the current value of the map. Useful for gradually moving away\n // from class component\n const map = mapRef.current;\n if (map == null) return;\n // Update the URI when the map moves\n mapMovedCallback();\n const cb = (0, $2crMj$underscore.debounce)(mapMovedCallback, 100);\n map.on(\"moveend\", cb);\n return ()=>{\n map?.off(\"moveend\", cb);\n };\n }, [\n mapMovedCallback\n ]);\n return null;\n}\nfunction $f6c715b8ad8cb91a$export$e57f9eaa51773f82({ ignoredSources: ignoredSources, onMapLoading: onMapLoading = null, onMapIdle: onMapIdle = null, mapIsLoading: mapIsLoading }) {\n const mapRef = (0, $2crMj$macrostratmapboxreact.useMapRef)();\n const loadingRef = (0, $2crMj$react.useRef)(false);\n const dispatch = (0, $2crMj$macrostratmapboxreact.useMapDispatch)();\n const isInitialized = (0, $2crMj$macrostratmapboxreact.useMapInitialized)();\n (0, $2crMj$react.useEffect)(()=>{\n const map = mapRef.current;\n const mapIsLoading = loadingRef.current;\n if (map == null) return;\n let didSendLoading = false;\n const loadingCallback = (evt)=>{\n if (ignoredSources.includes(evt.sourceId) || mapIsLoading) return;\n if (didSendLoading) return;\n onMapLoading?.(evt);\n dispatch({\n type: \"set-loading\",\n payload: true\n });\n loadingRef.current = true;\n didSendLoading = true;\n };\n const idleCallback = (evt)=>{\n if (!mapIsLoading) return;\n dispatch({\n type: \"set-loading\",\n payload: false\n });\n loadingRef.current = false;\n onMapIdle?.(evt);\n };\n map.on(\"sourcedataloading\", loadingCallback);\n map.on(\"idle\", idleCallback);\n return ()=>{\n map?.off(\"sourcedataloading\", loadingCallback);\n map?.off(\"idle\", idleCallback);\n };\n }, [\n ignoredSources,\n mapIsLoading,\n isInitialized\n ]);\n return null;\n}\nfunction $f6c715b8ad8cb91a$export$5c90a91c7455938c({ position: position, setPosition: setPosition, centerMarker: centerMarker = true }) {\n const mapRef = (0, $2crMj$macrostratmapboxreact.useMapRef)();\n const markerRef = (0, $2crMj$react.useRef)(null);\n const isInitialized = (0, $2crMj$macrostratmapboxreact.useMapInitialized)();\n (0, $976134caf6f51524$exports.useMapMarker)(mapRef, markerRef, position);\n (0, $2crMj$react.useEffect)(()=>{\n const map = mapRef.current;\n if (map == null || setPosition == null) return;\n const handleMapClick = (event)=>{\n setPosition(event.lngLat, event, mapRef.current);\n // We should integrate this with the \"easeToCenter\" hook\n if (centerMarker) mapRef.current?.flyTo({\n center: event.lngLat,\n duration: 800\n });\n };\n map.on(\"click\", handleMapClick);\n return ()=>{\n map?.off(\"click\", handleMapClick);\n };\n }, [\n setPosition,\n isInitialized\n ]);\n return null;\n}\nfunction $f6c715b8ad8cb91a$export$6daf1520df36ae21(opts = {}) {\n const { styleType: styleType } = opts;\n const inDarkMode = (0, $2crMj$macrostratuicomponents.useInDarkMode)();\n const props = (0, $2crMj$react.useMemo)(()=>{\n return {\n styleType: styleType,\n inDarkMode: inDarkMode\n };\n }, [\n styleType,\n inDarkMode\n ]);\n return $f6c715b8ad8cb91a$export$3503bf0b3851527b(props);\n}\nfunction $f6c715b8ad8cb91a$export$3503bf0b3851527b(opts) {\n const { styleType: styleType = \"macrostrat\", inDarkMode: inDarkMode = false } = opts ?? {};\n if (styleType == \"macrostrat\") return inDarkMode ? \"mapbox://styles/jczaplewski/cl5uoqzzq003614o6url9ou9z?optimize=true\" : \"mapbox://styles/jczaplewski/clatdbkw4002q14lov8zx0bm0?optimize=true\";\n else return inDarkMode ? \"mapbox://styles/mapbox/dark-v10\" : \"mapbox://styles/mapbox/light-v10\";\n}\nconst $f6c715b8ad8cb91a$export$566518253d2584f8 = $f6c715b8ad8cb91a$export$6daf1520df36ae21;\n\n\n//# sourceMappingURL=helpers.6bda171f.js.map\n","import {\n useMapRef,\n useMapEaseTo,\n useMapDispatch,\n useMapStatus,\n useMapInitialized,\n} from \"@macrostrat/mapbox-react\";\nimport { useMemo, useRef } from \"react\";\nimport { debounce } from \"underscore\";\nimport useResizeObserver from \"use-resize-observer\";\n\nimport { getMapPosition } from \"@macrostrat/mapbox-utils\";\nimport mapboxgl from \"mapbox-gl\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { getMapPadding, useMapMarker } from \"./utils\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\n\nexport function MapResizeManager({ containerRef }) {\n const mapRef = useMapRef();\n\n const debouncedResize = useRef(\n debounce(() => {\n mapRef.current?.resize();\n }, 100)\n );\n\n useResizeObserver({\n ref: containerRef,\n onResize: debouncedResize.current,\n });\n\n return null;\n}\n\ninterface MapPaddingManagerProps {\n containerRef: React.RefObject<HTMLDivElement>;\n parentRef: React.RefObject<HTMLDivElement>;\n infoMarkerPosition: mapboxgl.LngLatLike;\n debounceTime?: number;\n}\n\nexport function MapPaddingManager({\n containerRef,\n parentRef,\n infoMarkerPosition,\n debounceTime = 200,\n}: MapPaddingManagerProps) {\n const mapRef = useMapRef();\n\n const [padding, setPadding] = useState(\n getMapPadding(containerRef, parentRef)\n );\n\n const _updateMapPadding = useCallback(() => {\n const newPadding = getMapPadding(containerRef, parentRef);\n setPadding(newPadding);\n }, [containerRef.current, parentRef.current]);\n\n const updateMapPadding = useMemo(\n () => debounce(_updateMapPadding, debounceTime),\n [_updateMapPadding, debounceTime]\n );\n\n useEffect(() => {\n const map = mapRef.current;\n if (map == null) return;\n // Update map padding on load\n updateMapPadding();\n }, [mapRef.current]);\n\n useResizeObserver({\n ref: parentRef,\n onResize(sz) {\n updateMapPadding();\n },\n round(n) {\n return Math.round(n);\n },\n });\n\n // Ideally, we would not have to do this when we know the infobox is loaded\n useMapEaseTo({ center: infoMarkerPosition, padding });\n\n return null;\n}\n\nexport function MapMovedReporter({ onMapMoved = null }) {\n const mapRef = useMapRef();\n const dispatch = useMapDispatch();\n const isInitialized = useMapInitialized();\n\n const mapMovedCallback = useCallback(() => {\n const map = mapRef.current;\n if (map == null) return;\n const mapPosition = getMapPosition(map);\n dispatch({ type: \"map-moved\", payload: mapPosition });\n onMapMoved?.(mapPosition, map);\n }, [onMapMoved, dispatch, isInitialized]);\n\n useEffect(() => {\n // Get the current value of the map. Useful for gradually moving away\n // from class component\n const map = mapRef.current;\n if (map == null) return;\n // Update the URI when the map moves\n mapMovedCallback();\n const cb = debounce(mapMovedCallback, 100);\n map.on(\"moveend\", cb);\n return () => {\n map?.off(\"moveend\", cb);\n };\n }, [mapMovedCallback]);\n return null;\n}\n\nexport function MapLoadingReporter({\n ignoredSources,\n onMapLoading = null,\n onMapIdle = null,\n mapIsLoading,\n}) {\n const mapRef = useMapRef();\n const loadingRef = useRef(false);\n const dispatch = useMapDispatch();\n const isInitialized = useMapInitialized();\n\n useEffect(() => {\n const map = mapRef.current;\n const mapIsLoading = loadingRef.current;\n if (map == null) return;\n\n let didSendLoading = false;\n\n const loadingCallback = (evt) => {\n if (ignoredSources.includes(evt.sourceId) || mapIsLoading) return;\n if (didSendLoading) return;\n onMapLoading?.(evt);\n dispatch({ type: \"set-loading\", payload: true });\n loadingRef.current = true;\n didSendLoading = true;\n };\n const idleCallback = (evt) => {\n if (!mapIsLoading) return;\n dispatch({ type: \"set-loading\", payload: false });\n loadingRef.current = false;\n onMapIdle?.(evt);\n };\n map.on(\"sourcedataloading\", loadingCallback);\n map.on(\"idle\", idleCallback);\n return () => {\n map?.off(\"sourcedataloading\", loadingCallback);\n map?.off(\"idle\", idleCallback);\n };\n }, [ignoredSources, mapIsLoading, isInitialized]);\n return null;\n}\n\nexport function MapMarker({ position, setPosition, centerMarker = true }) {\n const mapRef = useMapRef();\n const markerRef = useRef(null);\n const isInitialized = useMapInitialized();\n\n useMapMarker(mapRef, markerRef, position);\n\n useEffect(() => {\n const map = mapRef.current;\n if (map == null || setPosition == null) return;\n\n const handleMapClick = (event: mapboxgl.MapMouseEvent) => {\n setPosition(event.lngLat, event, mapRef.current);\n // We should integrate this with the \"easeToCenter\" hook\n if (centerMarker) {\n mapRef.current?.flyTo({ center: event.lngLat, duration: 800 });\n }\n };\n\n map.on(\"click\", handleMapClick);\n\n return () => {\n map?.off(\"click\", handleMapClick);\n };\n }, [setPosition, isInitialized]);\n\n return null;\n}\n\nexport function useBasicMapStyle(\n opts: {\n styleType?: \"macrostrat\" | \"standard\";\n } = {}\n) {\n const { styleType } = opts;\n const inDarkMode = useInDarkMode();\n\n const props = useMemo(() => {\n return { styleType, inDarkMode };\n }, [styleType, inDarkMode]);\n\n return getBasicMapStyle(props);\n}\n\nexport function getBasicMapStyle(opts: {\n styleType?: \"macrostrat\" | \"standard\";\n inDarkMode?: boolean;\n}) {\n const { styleType = \"macrostrat\", inDarkMode = false } = opts ?? {};\n\n if (styleType == \"macrostrat\") {\n return inDarkMode\n ? \"mapbox://styles/jczaplewski/cl5uoqzzq003614o6url9ou9z?optimize=true\"\n : \"mapbox://styles/jczaplewski/clatdbkw4002q14lov8zx0bm0?optimize=true\";\n } else {\n return inDarkMode\n ? \"mapbox://styles/mapbox/dark-v10\"\n : \"mapbox://styles/mapbox/light-v10\";\n }\n}\n\nexport const useBasicStylePair = useBasicMapStyle;\n","module.exports = new __parcel__URL__(\"utils.dd92f725.js\").toString();"],"names":["require","URL","__filename","toString"],"version":3,"file":"helpers.6bda171f.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- require("./context-panel.7c2f42c9.js"),require("./location-panel.c39983e3.js"),require("./dev.3cbf6106.js"),require("./container.abd6f0d2.js"),require("./map-view.77013338.js"),require("./controls.ffb44307.js"),require("./helpers.6bda171f.js"),require("./utils.dd92f725.js"),require("./location-info.9f59aad3.js"),require("./expansion-panel.62240ee3.js");var e=globalThis,r={},a={},i=e.parcelRequire94c2;null==i&&((i=function(e){if(e in r)return r[e].exports;if(e in a){var i=a[e];delete a[e];var n={id:e,exports:{}};return r[e]=n,i.call(n.exports,n,n.exports),n.exports}var c=Error("Cannot find module '"+e+"'");throw c.code="MODULE_NOT_FOUND",c}).register=function(e,r){a[e]=r},e.parcelRequire94c2=i),i.register,new URL("context-panel.7c2f42c9.js","file:"+__filename).toString(),new URL("location-panel.c39983e3.js","file:"+__filename).toString(),new URL("dev.3cbf6106.js","file:"+__filename).toString(),i("lw3Ik"),i("3wYIs"),i("cL8YF"),i("7CmOU"),i("R3my3"),i("66CcX"),i("e9x7B");
1
+ require("./context-panel.0ae29ecf.js"),require("./location-panel.dd1d2b37.js"),require("./dev.709287ba.js"),require("./container.ab523076.js"),require("./map-view.663640da.js"),require("./controls.511f309b.js"),require("./helpers.6bda171f.js"),require("./utils.dd92f725.js"),require("./location-info.db66c3fb.js"),require("./expansion-panel.62240ee3.js");var e=globalThis,r={},a={},i=e.parcelRequire94c2;null==i&&((i=function(e){if(e in r)return r[e].exports;if(e in a){var i=a[e];delete a[e];var n={id:e,exports:{}};return r[e]=n,i.call(n.exports,n,n.exports),n.exports}var c=Error("Cannot find module '"+e+"'");throw c.code="MODULE_NOT_FOUND",c}).register=function(e,r){a[e]=r},e.parcelRequire94c2=i),i.register,new URL("context-panel.0ae29ecf.js","file:"+__filename).toString(),new URL("location-panel.dd1d2b37.js","file:"+__filename).toString(),new URL("dev.709287ba.js","file:"+__filename).toString(),i("lw3Ik"),i("3wYIs"),i("cL8YF"),i("7CmOU"),i("R3my3"),i("66CcX"),i("e9x7B");
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"mappings":"A,Q,gD,Q,iD,Q,sC,Q,4C,Q,2C,Q,2C,Q,0C,Q,wC,Q,gD,Q,kD,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,CEAiB,IAAA,IAAoB,6CAAA,QAAA,YAA8C,QAAQ,GCA1E,IAAA,IAAoB,8CAAA,QAAA,YAA+C,QAAQ,GCA3E,IAAA,IAAoB,mCAAA,QAAA,YAAoC,QAAQ,G,E,S,E,S,E,S,E,S,E,S,E,S,E","sources":["<anon>","packages/map-interface/src/index.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-236b755256a6c7a4.js","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-6b95ac51dd58ea56.js","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-d1ee864570c44cc4.js"],"sourcesContent":["require(\"./context-panel.7c2f42c9.js\");\nrequire(\"./location-panel.c39983e3.js\");\nrequire(\"./dev.3cbf6106.js\");\nrequire(\"./container.abd6f0d2.js\");\nrequire(\"./map-view.77013338.js\");\nrequire(\"./controls.ffb44307.js\");\nrequire(\"./helpers.6bda171f.js\");\nrequire(\"./utils.dd92f725.js\");\nrequire(\"./location-info.9f59aad3.js\");\nrequire(\"./expansion-panel.62240ee3.js\");\n\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire94c2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $98cdcb2099c80b13$exports = {};\n$98cdcb2099c80b13$exports = new URL(\"context-panel.7c2f42c9.js\", \"file:\" + __filename).toString();\n\n\nvar $8b2849cf2ef954b4$exports = {};\n$8b2849cf2ef954b4$exports = new URL(\"location-panel.c39983e3.js\", \"file:\" + __filename).toString();\n\n\nvar $4aea815117692f31$exports = {};\n$4aea815117692f31$exports = new URL(\"dev.3cbf6106.js\", \"file:\" + __filename).toString();\n\n\nparcelRequire(\"lw3Ik\");\nparcelRequire(\"3wYIs\");\nparcelRequire(\"cL8YF\");\nparcelRequire(\"7CmOU\");\nparcelRequire(\"R3my3\");\nparcelRequire(\"66CcX\");\nparcelRequire(\"e9x7B\");\n\n\n//# sourceMappingURL=index.js.map\n","export * from \"./context-panel\";\nexport * from \"./location-panel\";\nexport * from \"./dev\";\nexport * from \"./container\";\nexport * from \"./map-view\";\nexport * from \"./controls\";\nexport * from \"./helpers\";\nexport * from \"./utils\";\nexport * from \"./location-info\";\nexport * from \"./expansion-panel\";\n","module.exports = new __parcel__URL__(\"context-panel.7c2f42c9.js\").toString();","module.exports = new __parcel__URL__(\"location-panel.c39983e3.js\").toString();","module.exports = new __parcel__URL__(\"dev.3cbf6106.js\").toString();"],"names":["require","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","URL","__filename","toString"],"version":3,"file":"index.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,Q,gD,Q,iD,Q,sC,Q,4C,Q,2C,Q,2C,Q,0C,Q,wC,Q,gD,Q,kD,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,CEAiB,IAAA,IAAoB,6CAAA,QAAA,YAA8C,QAAQ,GCA1E,IAAA,IAAoB,8CAAA,QAAA,YAA+C,QAAQ,GCA3E,IAAA,IAAoB,mCAAA,QAAA,YAAoC,QAAQ,G,E,S,E,S,E,S,E,S,E,S,E,S,E","sources":["<anon>","packages/map-interface/src/index.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-236b755256a6c7a4.js","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-6b95ac51dd58ea56.js","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-d1ee864570c44cc4.js"],"sourcesContent":["require(\"./context-panel.0ae29ecf.js\");\nrequire(\"./location-panel.dd1d2b37.js\");\nrequire(\"./dev.709287ba.js\");\nrequire(\"./container.ab523076.js\");\nrequire(\"./map-view.663640da.js\");\nrequire(\"./controls.511f309b.js\");\nrequire(\"./helpers.6bda171f.js\");\nrequire(\"./utils.dd92f725.js\");\nrequire(\"./location-info.db66c3fb.js\");\nrequire(\"./expansion-panel.62240ee3.js\");\n\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire94c2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $98cdcb2099c80b13$exports = {};\n$98cdcb2099c80b13$exports = new URL(\"context-panel.0ae29ecf.js\", \"file:\" + __filename).toString();\n\n\nvar $8b2849cf2ef954b4$exports = {};\n$8b2849cf2ef954b4$exports = new URL(\"location-panel.dd1d2b37.js\", \"file:\" + __filename).toString();\n\n\nvar $4aea815117692f31$exports = {};\n$4aea815117692f31$exports = new URL(\"dev.709287ba.js\", \"file:\" + __filename).toString();\n\n\nparcelRequire(\"lw3Ik\");\nparcelRequire(\"3wYIs\");\nparcelRequire(\"cL8YF\");\nparcelRequire(\"7CmOU\");\nparcelRequire(\"R3my3\");\nparcelRequire(\"66CcX\");\nparcelRequire(\"e9x7B\");\n\n\n//# sourceMappingURL=index.js.map\n","export * from \"./context-panel\";\nexport * from \"./location-panel\";\nexport * from \"./dev\";\nexport * from \"./container\";\nexport * from \"./map-view\";\nexport * from \"./controls\";\nexport * from \"./helpers\";\nexport * from \"./utils\";\nexport * from \"./location-info\";\nexport * from \"./expansion-panel\";\n","module.exports = new __parcel__URL__(\"context-panel.0ae29ecf.js\").toString();","module.exports = new __parcel__URL__(\"location-panel.dd1d2b37.js\").toString();","module.exports = new __parcel__URL__(\"dev.709287ba.js\").toString();"],"names":["require","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","URL","__filename","toString"],"version":3,"file":"index.js.map","sourceRoot":"../../../../"}
@@ -0,0 +1,2 @@
1
+ require("./utils.274d0452.js"),require("./hash-string.3fc8ceb0.js"),require("@macrostrat/hyper"),require("@macrostrat/mapbox-utils"),require("mapbox-gl"),new URL("utils.274d0452.js","file:"+__filename).toString(),new URL("hash-string.3fc8ceb0.js","file:"+__filename).toString();
2
+ //# sourceMappingURL=location-info.db66c3fb.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"A,Q,wC,Q,8C,Q,qB,Q,4B,Q,aEAiB,IAAA,IAAoB,qCAAA,QAAA,YAAsC,QAAQ,GCAlE,IAAA,IAAoB,2CAAA,QAAA,YAA4C,QAAQ","sources":["<anon>","packages/map-interface/src/location-info/index.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-f7ce3849bd4f1ea7.js","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-06e58204e8d93615.js"],"sourcesContent":["require(\"./utils.274d0452.js\");\nrequire(\"./hash-string.3fc8ceb0.js\");\nvar $eCMm3$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $eCMm3$macrostratmapboxutils = require(\"@macrostrat/mapbox-utils\");\nvar $eCMm3$mapboxgl = require(\"mapbox-gl\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n\nvar $fad104fcb02659ca$exports = {};\n$fad104fcb02659ca$exports = new URL(\"utils.274d0452.js\", \"file:\" + __filename).toString();\n\n\n\nvar $26ce4b364a39726a$exports = {};\n$26ce4b364a39726a$exports = new URL(\"hash-string.3fc8ceb0.js\", \"file:\" + __filename).toString();\n\n\nfunction $0b0abb433c4cd5a3$export$716098b85fd0efdf(props) {\n const { value: value, unit: unit } = props;\n return (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))(\"span.value-with-unit\", [\n (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))(\"span.value\", [\n value\n ]),\n (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))(\"span.spacer\", [\n \" \"\n ]),\n (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))(\"span.unit\", [\n unit\n ])\n ]);\n}\nfunction $0b0abb433c4cd5a3$export$af8082af0bea3eb1(props) {\n const { value: value, labels: labels, precision: precision = 3, format: format = (0, $fad104fcb02659ca$exports.formatValue) } = props;\n const direction = value < 0 ? labels[1] : labels[0];\n return (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))($0b0abb433c4cd5a3$export$716098b85fd0efdf, {\n value: format(Math.abs(value), precision) + \"\\xb0\",\n unit: direction\n });\n}\nfunction $0b0abb433c4cd5a3$export$f195b3550849e560(props) {\n /** Formatted geographic coordinates */ const { position: position, className: className, precision: precision, zoom: zoom } = props;\n let { format: format } = props;\n if (position == null) return null;\n let lat;\n let lng;\n if (Array.isArray(position)) [lng, lat] = position;\n else if (position instanceof (0, $eCMm3$mapboxgl.LngLat)) [lng, lat] = position.toArray();\n else if (\"lng\" in position) {\n lat = position.lat;\n lng = position.lng;\n } else if (\"lon\" in position) {\n lat = position.lat;\n lng = position.lon;\n }\n if (zoom != null && format == null && precision == null) format = (val, _)=>(0, $eCMm3$macrostratmapboxutils.formatCoordForZoomLevel)(val, zoom);\n return (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))(\"div.lnglat-container\", {\n className: className\n }, [\n (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))(\"span.lnglat\", [\n (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))($0b0abb433c4cd5a3$export$af8082af0bea3eb1, {\n value: lat,\n labels: [\n \"N\",\n \"S\"\n ],\n precision: precision,\n format: format\n }),\n \", \",\n (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))($0b0abb433c4cd5a3$export$af8082af0bea3eb1, {\n value: (0, $eCMm3$macrostratmapboxutils.normalizeLng)(lng),\n labels: [\n \"E\",\n \"W\"\n ],\n precision: precision,\n format: format\n })\n ])\n ]);\n}\nfunction $0b0abb433c4cd5a3$export$58bfb4f6ec5aa58d(props) {\n /** Renders an elevation value in meters and a parenthetical conversion to feet. */ const { elevation: elevation, className: className, includeFeet: includeFeet = true } = props;\n if (elevation == null) return null;\n return (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))(\"div.elevation\", {\n className: className\n }, [\n (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))($0b0abb433c4cd5a3$export$716098b85fd0efdf, {\n value: elevation,\n unit: \"m\"\n }),\n (0, ($parcel$interopDefault($eCMm3$macrostrathyper))).if(includeFeet)(\"span.secondary\", [\n \" (\",\n (0, ($parcel$interopDefault($eCMm3$macrostrathyper)))($0b0abb433c4cd5a3$export$716098b85fd0efdf, {\n value: (0, $eCMm3$macrostratmapboxutils.metersToFeet)(elevation),\n unit: \"ft\"\n }),\n \")\"\n ])\n ]);\n}\n\n\n//# sourceMappingURL=location-info.db66c3fb.js.map\n","import h from \"@macrostrat/hyper\";\nimport {\n formatCoordForZoomLevel,\n metersToFeet,\n normalizeLng,\n} from \"@macrostrat/mapbox-utils\";\nimport { formatValue } from \"./utils\";\nimport { LngLat } from \"mapbox-gl\";\n\nexport * from \"./hash-string\";\n\nexport function ValueWithUnit(props) {\n const { value, unit } = props;\n return h(\"span.value-with-unit\", [\n h(\"span.value\", [value]),\n h(\"span.spacer\", [\" \"]),\n h(\"span.unit\", [unit]),\n ]);\n}\n\nexport function DegreeCoord(props) {\n const { value, labels, precision = 3, format = formatValue } = props;\n const direction = value < 0 ? labels[1] : labels[0];\n\n return h(ValueWithUnit, {\n value: format(Math.abs(value), precision) + \"°\",\n unit: direction,\n });\n}\n\nexport interface LngLatProps {\n /** Map position */\n position: mapboxgl.LngLatLike | null;\n className?: string;\n /** Zoom level (used to infer coordinate rounding if provided) */\n zoom?: number;\n /** Number of decimal places to round coordinates to */\n precision?: number;\n /** Function to format coordinates */\n format?: (val: number, precision: number) => string;\n}\n\nexport function LngLatCoords(props: LngLatProps) {\n /** Formatted geographic coordinates */\n const { position, className, precision, zoom } = props;\n let { format } = props;\n if (position == null) {\n return null;\n }\n\n let lat: number;\n let lng: number;\n if (Array.isArray(position)) {\n [lng, lat] = position;\n } else if (position instanceof LngLat) {\n [lng, lat] = position.toArray();\n } else if (\"lng\" in position) {\n lat = position.lat;\n lng = position.lng;\n } else if (\"lon\" in position) {\n lat = position.lat;\n lng = position.lon;\n }\n\n if (zoom != null && format == null && precision == null) {\n format = (val, _) => formatCoordForZoomLevel(val, zoom);\n }\n\n return h(\"div.lnglat-container\", { className }, [\n h(\"span.lnglat\", [\n h(DegreeCoord, {\n value: lat,\n labels: [\"N\", \"S\"],\n precision,\n format,\n }),\n \", \",\n h(DegreeCoord, {\n value: normalizeLng(lng),\n labels: [\"E\", \"W\"],\n precision,\n format,\n }),\n ]),\n ]);\n}\n\nexport function Elevation(props) {\n /** Renders an elevation value in meters and a parenthetical conversion to feet. */\n const { elevation, className, includeFeet = true } = props;\n if (elevation == null) return null;\n return h(\"div.elevation\", { className }, [\n h(ValueWithUnit, { value: elevation, unit: \"m\" }),\n h.if(includeFeet)(\"span.secondary\", [\n \" (\",\n h(ValueWithUnit, { value: metersToFeet(elevation), unit: \"ft\" }),\n \")\",\n ]),\n ]);\n}\n","module.exports = new __parcel__URL__(\"utils.274d0452.js\").toString();","module.exports = new __parcel__URL__(\"hash-string.3fc8ceb0.js\").toString();"],"names":["require","URL","__filename","toString"],"version":3,"file":"location-info.db66c3fb.js.map","sourceRoot":"../../../../"}