@defra/interactive-map 0.0.40-alpha → 0.0.41-alpha

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 (351) hide show
  1. package/dist/css/index.css +1 -1
  2. package/dist/esm/im-core.js +1 -1
  3. package/dist/esm/im-shell.js +1 -1
  4. package/dist/umd/im-core.js +1 -1
  5. package/dist/umd/index.js +1 -1
  6. package/docs/api/control-definition.md +9 -1
  7. package/docs/api/slots.md +26 -5
  8. package/docs/assets/images/slot-map.svg +61 -262
  9. package/docs/examples/draw-tools.mdx +3 -3
  10. package/docs/plugins/draw.md +79 -16
  11. package/docs/plugins/search.md +1 -1
  12. package/govuk-prototype-kit.config.json +2 -0
  13. package/jest.setup.js +5 -0
  14. package/package.json +9 -1
  15. package/plugins/beta/draw-es/dist/esm/im-draw-es-plugin.js +1 -1
  16. package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +1 -1
  17. package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +1 -1
  18. package/plugins/beta/draw-ol/dist/esm/im-draw-ol-plugin.js +1 -1
  19. package/plugins/beta/map-styles/dist/umd/im-map-styles-plugin.js +1 -1
  20. package/plugins/beta/map-styles/dist/umd/index.js +1 -1
  21. package/plugins/datasets/dist/css/index.css +1 -1
  22. package/plugins/datasets/dist/esm/esriLayerAdapter.js +1 -1
  23. package/plugins/datasets/dist/esm/im-datasets-ml-adapter.js +1 -1
  24. package/plugins/datasets/dist/esm/im-datasets-plugin.js +1 -1
  25. package/plugins/datasets/dist/umd/im-datasets-esri-adapter.js +1 -1
  26. package/plugins/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
  27. package/plugins/datasets/dist/umd/im-datasets-plugin.js +1 -1
  28. package/plugins/datasets/dist/umd/index.js +1 -1
  29. package/plugins/datasets/src/adapters/esri/esriLayerAdapter.test.js +175 -0
  30. package/plugins/datasets/src/adapters/esri/registry/esriDataset.test.js +55 -0
  31. package/plugins/datasets/src/adapters/loadLayerAdapter.test.js +61 -0
  32. package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.test.js +14 -0
  33. package/plugins/datasets/src/api/setOpacity.test.js +9 -0
  34. package/plugins/datasets/src/components/LayersMenu/LayersMenu.jsx +10 -25
  35. package/plugins/datasets/src/components/LayersMenu/LayersMenu.test.jsx +0 -42
  36. package/plugins/datasets/src/datasets.scss +0 -1
  37. package/plugins/datasets/src/fetch/createDynamicSource.js +135 -129
  38. package/plugins/datasets/src/fetch/createDynamicSource.test.js +318 -0
  39. package/plugins/datasets/src/fetch/fetchGeoJSON.test.js +83 -0
  40. package/plugins/datasets/src/index.test.js +36 -0
  41. package/plugins/datasets/src/initialise/DatasetsInit.jsx +17 -7
  42. package/plugins/datasets/src/initialise/DatasetsInit.test.jsx +262 -0
  43. package/plugins/datasets/src/initialise/initialiseDatasets.js +16 -4
  44. package/plugins/datasets/src/initialise/initialiseDatasets.test.js +42 -0
  45. package/plugins/datasets/src/manifest.js +0 -38
  46. package/plugins/datasets/src/manifest.test.js +49 -0
  47. package/plugins/datasets/src/reducers/datasetsToMenu.test.js +54 -1
  48. package/plugins/datasets/src/reducers/pluginState.js +3 -16
  49. package/plugins/datasets/src/reducers/pluginState.test.js +23 -0
  50. package/plugins/datasets/src/registry/dataset.js +13 -1
  51. package/plugins/datasets/src/registry/dataset.test.js +61 -0
  52. package/plugins/datasets/src/registry/datasetRegistry.js +12 -6
  53. package/plugins/datasets/src/registry/datasetRegistry.test.js +16 -4
  54. package/plugins/datasets/src/registry/isVisibleWhen.js +6 -3
  55. package/plugins/datasets/src/registry/isVisibleWhen.test.js +11 -1
  56. package/plugins/datasets/src/utils/bbox.test.js +125 -0
  57. package/plugins/draw/dist/esm/im-draw-ml-adapter.js +1 -1
  58. package/plugins/draw/dist/esm/im-draw-ol-adapter.js +1 -1
  59. package/plugins/draw/dist/esm/im-draw-plugin.js +1 -1
  60. package/plugins/draw/dist/esm/index.js +1 -1
  61. package/plugins/draw/dist/umd/im-draw-ml-adapter.js +2 -1
  62. package/plugins/draw/dist/umd/im-draw-ml-adapter.js.LICENSE.txt +1 -0
  63. package/plugins/draw/dist/umd/im-draw-ol-adapter.js +1 -1
  64. package/plugins/draw/dist/umd/im-draw-plugin.js +1 -1
  65. package/plugins/draw/dist/umd/index.js +1 -1
  66. package/plugins/draw/src/DrawInit.jsx +10 -2
  67. package/plugins/draw/src/DrawInit.test.jsx +51 -10
  68. package/plugins/draw/src/adapters/maplibre/MaplibreDrawAdapter.js +91 -11
  69. package/plugins/draw/src/adapters/maplibre/MaplibreDrawAdapter.test.js +246 -4
  70. package/plugins/draw/src/adapters/maplibre/mapboxDraw.js +109 -14
  71. package/plugins/draw/src/adapters/maplibre/mapboxDraw.test.js +174 -11
  72. package/plugins/draw/src/adapters/maplibre/modes/drawMode/clickHandlers.test.js +12 -0
  73. package/plugins/draw/src/adapters/maplibre/modes/drawMode/lifecycle.js +9 -1
  74. package/plugins/draw/src/adapters/maplibre/modes/drawMode/lifecycle.test.js +24 -3
  75. package/plugins/draw/src/adapters/maplibre/modes/drawPointMode.js +194 -0
  76. package/plugins/draw/src/adapters/maplibre/modes/drawPointMode.test.js +457 -0
  77. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/__helpers__/harness.js +102 -0
  78. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/keyboardHandlers.js +82 -0
  79. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/keyboardHandlers.test.js +83 -0
  80. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointOperations.js +55 -0
  81. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointOperations.test.js +62 -0
  82. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointerHandlers.js +138 -0
  83. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointerHandlers.test.js +197 -0
  84. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/touchHandlers.js +92 -0
  85. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/touchHandlers.test.js +101 -0
  86. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/undoHandlers.js +46 -0
  87. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/undoHandlers.test.js +42 -0
  88. package/plugins/draw/src/adapters/maplibre/modes/editPointMode.js +151 -0
  89. package/plugins/draw/src/adapters/maplibre/modes/editPointMode.test.js +156 -0
  90. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/keyboardHandlers.js +4 -27
  91. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/keyboardHandlers.test.js +24 -39
  92. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/pointerHandlers.js +4 -5
  93. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/touchHandlers.js +20 -23
  94. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/touchHandlers.test.js +25 -5
  95. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/undoHandlers.js +6 -36
  96. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/undoHandlers.test.js +7 -49
  97. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/vertexOperations.js +3 -53
  98. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/vertexOperations.test.js +8 -33
  99. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode.js +29 -72
  100. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode.test.js +10 -3
  101. package/plugins/draw/src/adapters/maplibre/pointSymbolImages.js +158 -0
  102. package/plugins/draw/src/adapters/maplibre/pointSymbolImages.test.js +314 -0
  103. package/plugins/draw/src/adapters/maplibre/snap/prototypePatches.js +6 -1
  104. package/plugins/draw/src/adapters/maplibre/snap/prototypePatches.test.js +21 -0
  105. package/plugins/draw/src/adapters/maplibre/snap/snapInstance.js +6 -2
  106. package/plugins/draw/src/adapters/maplibre/snap/snapInstance.test.js +12 -0
  107. package/plugins/draw/src/adapters/maplibre/styles.js +38 -11
  108. package/plugins/draw/src/adapters/maplibre/styles.test.js +39 -0
  109. package/plugins/draw/src/adapters/maplibre/utils/editModeEvents.js +79 -0
  110. package/plugins/draw/src/adapters/maplibre/utils/editModeEvents.test.js +135 -0
  111. package/plugins/draw/src/adapters/maplibre/utils/geometryValidation.js +42 -0
  112. package/plugins/draw/src/adapters/maplibre/utils/geometryValidation.test.js +85 -0
  113. package/plugins/draw/src/adapters/maplibre/utils/keyboardShortcuts.js +34 -0
  114. package/plugins/draw/src/adapters/maplibre/utils/keyboardShortcuts.test.js +78 -0
  115. package/plugins/draw/src/adapters/maplibre/utils/snapHelpers.js +16 -3
  116. package/plugins/draw/src/adapters/maplibre/utils/snapHelpers.test.js +21 -3
  117. package/plugins/draw/src/adapters/maplibre/utils/snapMovement.js +59 -0
  118. package/plugins/draw/src/adapters/maplibre/utils/snapMovement.test.js +73 -0
  119. package/plugins/draw/src/adapters/maplibre/utils/touchDragMath.js +33 -0
  120. package/plugins/draw/src/adapters/maplibre/utils/touchDragMath.test.js +70 -0
  121. package/plugins/draw/src/adapters/openlayers/OLDrawAdapter.js +27 -2
  122. package/plugins/draw/src/adapters/openlayers/OLDrawAdapter.test.js +93 -0
  123. package/plugins/draw/src/adapters/openlayers/__helpers__/harness.js +9 -0
  124. package/plugins/draw/src/adapters/openlayers/core/OLDrawManager.js +19 -1
  125. package/plugins/draw/src/adapters/openlayers/core/OLDrawManager.test.js +34 -1
  126. package/plugins/draw/src/adapters/openlayers/core/styles.js +73 -1
  127. package/plugins/draw/src/adapters/openlayers/core/styles.test.js +122 -3
  128. package/plugins/draw/src/adapters/openlayers/draw/DrawMode.test.js +12 -0
  129. package/plugins/draw/src/adapters/openlayers/draw/drawInput.js +8 -2
  130. package/plugins/draw/src/adapters/openlayers/edit/EditMode.test.js +31 -0
  131. package/plugins/draw/src/adapters/openlayers/edit/keyboardHandler.js +9 -5
  132. package/plugins/draw/src/adapters/openlayers/edit/keyboardHandler.test.js +33 -0
  133. package/plugins/draw/src/adapters/openlayers/edit/modifyInteraction.js +5 -3
  134. package/plugins/draw/src/adapters/openlayers/edit/modifyInteraction.test.js +11 -0
  135. package/plugins/draw/src/adapters/openlayers/edit/nudge.js +10 -3
  136. package/plugins/draw/src/adapters/openlayers/edit/nudge.test.js +24 -1
  137. package/plugins/draw/src/adapters/openlayers/edit/touchHandler.js +18 -13
  138. package/plugins/draw/src/adapters/openlayers/edit/touchHandler.test.js +46 -1
  139. package/plugins/draw/src/adapters/openlayers/olDraw.js +11 -4
  140. package/plugins/draw/src/adapters/openlayers/olDraw.test.js +48 -6
  141. package/plugins/draw/src/adapters/openlayers/point/drawPointMode.js +156 -0
  142. package/plugins/draw/src/adapters/openlayers/point/drawPointMode.test.js +246 -0
  143. package/plugins/draw/src/adapters/openlayers/point/editPointMode.js +267 -0
  144. package/plugins/draw/src/adapters/openlayers/point/editPointMode.test.js +327 -0
  145. package/plugins/draw/src/adapters/openlayers/point/pointDragInteraction.js +71 -0
  146. package/plugins/draw/src/adapters/openlayers/point/pointOps.js +34 -0
  147. package/plugins/draw/src/adapters/openlayers/point/pointOps.test.js +32 -0
  148. package/plugins/draw/src/adapters/openlayers/point/pointSelectionState.js +82 -0
  149. package/plugins/draw/src/adapters/openlayers/point/pointSelectionState.test.js +107 -0
  150. package/plugins/draw/src/adapters/openlayers/point/pointSymbolImages.js +83 -0
  151. package/plugins/draw/src/adapters/openlayers/point/pointSymbolImages.test.js +214 -0
  152. package/plugins/draw/src/adapters/openlayers/snap/snapIndicator.js +3 -1
  153. package/plugins/draw/src/adapters/openlayers/snap/snapInteraction.js +6 -9
  154. package/plugins/draw/src/adapters/openlayers/snap/snapInteraction.test.js +15 -4
  155. package/plugins/draw/src/adapters/openlayers/utils/olCoords.js +1 -1
  156. package/plugins/draw/src/api/addFeature.js +16 -1
  157. package/plugins/draw/src/api/addFeature.test.js +62 -5
  158. package/plugins/draw/src/api/editFeature.js +7 -4
  159. package/plugins/draw/src/api/editFeature.test.js +16 -0
  160. package/plugins/draw/src/api/newPoint.js +42 -0
  161. package/plugins/draw/src/api/newPoint.test.js +117 -0
  162. package/plugins/draw/src/api/setStyle.js +43 -0
  163. package/plugins/draw/src/api/setStyle.test.js +75 -0
  164. package/plugins/draw/src/events.js +17 -10
  165. package/plugins/draw/src/events.test.js +14 -0
  166. package/plugins/draw/src/manifest.js +18 -6
  167. package/plugins/draw/src/manifest.test.js +32 -1
  168. package/plugins/draw/src/reducer.test.js +7 -0
  169. package/plugins/draw/src/utils/stripInternalProperties.js +19 -0
  170. package/plugins/draw/src/utils/stripInternalProperties.test.js +50 -0
  171. package/plugins/draw/src/utils/symbolKeys.js +5 -0
  172. package/plugins/draw/src/validation/liveDrawChecks.test.js +54 -0
  173. package/plugins/draw/src/validation/liveStroke.test.js +64 -1
  174. package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
  175. package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
  176. package/plugins/interact/dist/umd/index.js +1 -1
  177. package/plugins/interact/src/hooks/useHighlightSync.js +33 -12
  178. package/plugins/interact/src/hooks/useHighlightSync.test.js +96 -25
  179. package/plugins/interact/src/utils/featureQueries.js +18 -0
  180. package/plugins/interact/src/utils/featureQueries.test.js +15 -0
  181. package/plugins/interact/src/utils/spatial.js +9 -3
  182. package/plugins/interact/src/utils/spatial.test.js +12 -1
  183. package/plugins/map-key/dist/css/index.css +62 -0
  184. package/plugins/map-key/dist/esm/im-map-key-plugin.js +1 -0
  185. package/plugins/map-key/dist/esm/index.js +1 -0
  186. package/plugins/map-key/dist/umd/im-map-key-plugin.js +2 -0
  187. package/plugins/map-key/dist/umd/im-map-key-plugin.js.LICENSE.txt +1 -0
  188. package/plugins/map-key/dist/umd/index.js +2 -0
  189. package/plugins/map-key/dist/umd/index.js.LICENSE.txt +1 -0
  190. package/plugins/map-key/package.json +28 -0
  191. package/plugins/map-key/src/components/Key/EmptyKey.jsx +7 -0
  192. package/plugins/{datasets → map-key}/src/components/Key/EmptyKey.test.jsx +2 -2
  193. package/plugins/map-key/src/components/Key/Key.jsx +41 -0
  194. package/plugins/{datasets → map-key}/src/components/Key/Key.module.scss +15 -14
  195. package/plugins/map-key/src/components/Key/Key.test.jsx +73 -0
  196. package/plugins/map-key/src/components/Key/KeyGroupItem.jsx +16 -0
  197. package/plugins/map-key/src/components/Key/KeyGroupItem.test.jsx +53 -0
  198. package/plugins/map-key/src/components/Key/KeyItem.jsx +29 -0
  199. package/plugins/map-key/src/components/Key/KeyItem.test.jsx +67 -0
  200. package/plugins/map-key/src/components/Key/KeySvg.jsx +42 -0
  201. package/plugins/{datasets → map-key}/src/components/Key/KeySvg.test.jsx +14 -12
  202. package/plugins/map-key/src/components/Key/KeySvgLine.jsx +28 -0
  203. package/plugins/{datasets → map-key}/src/components/Key/KeySvgLine.test.jsx +1 -1
  204. package/plugins/map-key/src/components/Key/KeySvgPattern.jsx +23 -0
  205. package/plugins/{datasets → map-key}/src/components/Key/KeySvgPattern.test.jsx +2 -2
  206. package/plugins/map-key/src/components/Key/KeySvgRect.jsx +33 -0
  207. package/plugins/{datasets → map-key}/src/components/Key/KeySvgRect.test.jsx +1 -1
  208. package/plugins/map-key/src/components/Key/KeySvgSymbol.jsx +27 -0
  209. package/plugins/{datasets → map-key}/src/components/Key/KeySvgSymbol.test.jsx +5 -6
  210. package/plugins/map-key/src/components/Key/MapKey.jsx +50 -0
  211. package/plugins/map-key/src/components/Key/MapKey.test.jsx +130 -0
  212. package/plugins/{datasets → map-key}/src/components/Key/svgProperties.js +2 -2
  213. package/plugins/{datasets → map-key}/src/components/Key/svgProperties.test.js +2 -2
  214. package/plugins/map-key/src/index.js +13 -0
  215. package/plugins/map-key/src/index.test.js +31 -0
  216. package/plugins/map-key/src/initialise/MapKeyInit.jsx +15 -0
  217. package/plugins/map-key/src/initialise/MapKeyInit.test.jsx +39 -0
  218. package/plugins/map-key/src/manifest.js +30 -0
  219. package/plugins/map-key/src/manifest.test.js +63 -0
  220. package/plugins/map-key/src/mapKey.scss +4 -0
  221. package/plugins/map-key/src/registry/getDatasetRegistry.js +6 -0
  222. package/plugins/map-key/src/registry/getDatasetRegistry.test.js +23 -0
  223. package/plugins/map-key/src/registry/index.js +3 -0
  224. package/plugins/map-key/src/registry/index.test.js +15 -0
  225. package/plugins/menu/dist/css/index.css +80 -0
  226. package/plugins/menu/dist/esm/im-menu-plugin.js +1 -0
  227. package/plugins/menu/dist/esm/index.js +1 -0
  228. package/plugins/menu/dist/umd/im-menu-plugin.js +1 -0
  229. package/plugins/menu/dist/umd/index.js +2 -0
  230. package/plugins/menu/dist/umd/index.js.LICENSE.txt +1 -0
  231. package/plugins/menu/package.json +28 -0
  232. package/plugins/menu/src/components/Menu/CheckboxGroupWrapper.jsx +21 -0
  233. package/plugins/menu/src/components/Menu/GroupLegend.jsx +17 -0
  234. package/plugins/menu/src/components/Menu/GroupLegend.test.jsx +68 -0
  235. package/plugins/menu/src/components/Menu/Menu.jsx +19 -0
  236. package/plugins/menu/src/components/Menu/Menu.module.scss +90 -0
  237. package/plugins/menu/src/components/Menu/Menu.test.jsx +161 -0
  238. package/plugins/menu/src/components/Menu/MenuCheckbox.jsx +35 -0
  239. package/plugins/menu/src/components/Menu/MenuCheckbox.test.jsx +93 -0
  240. package/plugins/menu/src/components/Menu/MenuGroup.jsx +11 -0
  241. package/plugins/{datasets/src/components/LayersMenu/LayersMenuRadio.jsx → menu/src/components/Menu/MenuRadio.jsx} +6 -4
  242. package/plugins/{datasets/src/components/LayersMenu/LayersMenuRadio.test.jsx → menu/src/components/Menu/MenuRadio.test.jsx} +18 -18
  243. package/plugins/menu/src/components/Menu/RadioGroupWrapper.jsx +32 -0
  244. package/plugins/{datasets/src/components/LayersMenu/LayersRadioGroupWrapper.test.jsx → menu/src/components/Menu/RadioGroupWrapper.test.jsx} +21 -21
  245. package/plugins/menu/src/components/Menu/useIdPrefix.jsx +4 -0
  246. package/plugins/menu/src/index.js +13 -0
  247. package/plugins/menu/src/index.test.js +31 -0
  248. package/plugins/menu/src/initialise/MenuInit.jsx +24 -0
  249. package/plugins/menu/src/initialise/MenuInit.test.jsx +50 -0
  250. package/plugins/menu/src/initialise/createMenu.js +10 -0
  251. package/plugins/menu/src/initialise/createMenu.test.js +37 -0
  252. package/plugins/menu/src/manifest.js +35 -0
  253. package/plugins/menu/src/manifest.test.js +63 -0
  254. package/plugins/menu/src/menu.scss +4 -0
  255. package/plugins/menu/src/reducers/menuStateReducer.test.js +38 -0
  256. package/plugins/menu/src/reducers/pluginState.js +35 -0
  257. package/plugins/menu/src/reducers/pluginState.test.js +57 -0
  258. package/plugins/menu/src/registry/getDatasetRegistry.js +9 -0
  259. package/plugins/menu/src/registry/getDatasetRegistry.test.js +23 -0
  260. package/plugins/menu/src/registry/index.js +3 -0
  261. package/plugins/menu/src/registry/index.test.js +15 -0
  262. package/plugins/menu/src/registry/isVisibleWhen.js +43 -0
  263. package/plugins/menu/src/registry/isVisibleWhen.test.js +48 -0
  264. package/plugins/search/dist/css/index.css +1 -1
  265. package/plugins/search/dist/esm/im-search-plugin.js +1 -1
  266. package/plugins/search/dist/esm/index.js +1 -1
  267. package/plugins/search/dist/umd/im-search-plugin.js +1 -1
  268. package/plugins/search/dist/umd/index.js +1 -1
  269. package/plugins/search/src/Search.jsx +2 -3
  270. package/plugins/search/src/components/Form/Form.module.scss +9 -20
  271. package/plugins/search/src/index.js +0 -1
  272. package/plugins/search/src/index.test.js +2 -4
  273. package/plugins/search/src/manifest.js +1 -1
  274. package/plugins/search/src/search.scss +17 -16
  275. package/providers/beta/openlayers/dist/esm/im-openlayers-provider.js +1 -1
  276. package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +1 -1
  277. package/providers/beta/openlayers/dist/umd/index.js +1 -1
  278. package/providers/beta/openlayers/src/openlayersProvider.js +4 -1
  279. package/providers/beta/openlayers/src/openlayersProvider.test.js +18 -0
  280. package/providers/beta/openlayers/src/utils/highlightFeatures.js +52 -5
  281. package/providers/beta/openlayers/src/utils/highlightFeatures.test.js +176 -0
  282. package/providers/beta/openlayers/src/utils/symbolImages.js +40 -0
  283. package/providers/beta/openlayers/src/utils/symbolImages.test.js +58 -0
  284. package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
  285. package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
  286. package/providers/maplibre/dist/umd/index.js +1 -1
  287. package/providers/maplibre/src/utils/drawLayerBuckets.js +14 -0
  288. package/providers/maplibre/src/utils/drawLayerBuckets.test.js +18 -0
  289. package/providers/maplibre/src/utils/highlightFeatures.js +80 -55
  290. package/providers/maplibre/src/utils/highlightFeatures.test.js +156 -17
  291. package/providers/maplibre/src/utils/hoverCursor.js +30 -14
  292. package/providers/maplibre/src/utils/hoverCursor.test.js +35 -0
  293. package/providers/maplibre/src/utils/patternImages.js +1 -1
  294. package/providers/maplibre/src/utils/symbolImages.js +41 -3
  295. package/providers/maplibre/src/utils/symbolImages.test.js +40 -6
  296. package/rollup.esm.mjs +11 -1
  297. package/src/App/components/Actions/Actions.test.jsx +47 -0
  298. package/src/App/components/Hints/Hints.test.jsx +13 -0
  299. package/src/App/components/MoveControls/MoveControls.module.scss +41 -10
  300. package/src/App/components/Panel/Panel.jsx +18 -3
  301. package/src/App/components/Panel/Panel.module.scss +18 -8
  302. package/src/App/components/Panel/Panel.test.jsx +34 -0
  303. package/src/App/components/Tooltip/Tooltip.test.jsx +12 -14
  304. package/src/App/hooks/useFeatureItems.js +16 -7
  305. package/src/App/hooks/useFeatureItems.test.js +57 -0
  306. package/src/App/hooks/useLayoutMeasurements.js +95 -84
  307. package/src/App/hooks/useLayoutMeasurements.test.js +61 -1
  308. package/src/App/layout/Layout.jsx +9 -10
  309. package/src/App/layout/Layout.test.jsx +2 -0
  310. package/src/App/layout/layout.module.scss +31 -17
  311. package/src/App/registry/pluginRegistry.js +1 -1
  312. package/src/App/registry/pluginRegistry.test.js +12 -0
  313. package/src/App/renderer/HtmlElementHost.jsx +18 -5
  314. package/src/App/renderer/HtmlElementHost.test.jsx +54 -0
  315. package/src/App/renderer/mapButtons.js +28 -12
  316. package/src/App/renderer/mapButtons.test.js +17 -4
  317. package/src/App/renderer/mapControls.js +3 -1
  318. package/src/App/renderer/mapControls.test.js +16 -0
  319. package/src/App/renderer/mapPanels.js +44 -9
  320. package/src/App/renderer/mapPanels.test.js +51 -2
  321. package/src/App/renderer/orderItems.js +28 -0
  322. package/src/App/renderer/orderItems.test.js +50 -0
  323. package/src/App/renderer/slotAggregator.js +2 -18
  324. package/src/App/renderer/slotHelpers.js +3 -1
  325. package/src/App/renderer/slotHelpers.test.js +5 -0
  326. package/src/App/renderer/slots.js +3 -0
  327. package/src/App/store/AppProvider.jsx +1 -0
  328. package/src/App/store/appDispatchMiddleware.js +1 -1
  329. package/src/App/store/appDispatchMiddleware.test.js +8 -0
  330. package/src/config/events.js +2 -0
  331. package/src/scss/settings/_colors.scss +1 -0
  332. package/src/scss/settings/_dimensions.scss +2 -3
  333. package/src/scss/settings/_transition.scss +1 -1
  334. package/src/services/eventBus.js +44 -0
  335. package/src/services/eventBus.test.js +83 -0
  336. package/src/services/symbolRegistry.js +1 -1
  337. package/src/types.js +11 -1
  338. package/webpack.umd.mjs +2 -0
  339. package/plugins/datasets/src/components/Key/EmptyKey.jsx +0 -7
  340. package/plugins/datasets/src/components/Key/Key.jsx +0 -50
  341. package/plugins/datasets/src/components/Key/KeyGroupItem.jsx +0 -18
  342. package/plugins/datasets/src/components/Key/KeyItem.jsx +0 -23
  343. package/plugins/datasets/src/components/Key/KeySvg.jsx +0 -22
  344. package/plugins/datasets/src/components/Key/KeySvgLine.jsx +0 -19
  345. package/plugins/datasets/src/components/Key/KeySvgPattern.jsx +0 -13
  346. package/plugins/datasets/src/components/Key/KeySvgRect.jsx +0 -22
  347. package/plugins/datasets/src/components/Key/KeySvgSymbol.jsx +0 -16
  348. package/plugins/datasets/src/components/LayersMenu/LayersRadioGroupWrapper.jsx +0 -41
  349. /package/plugins/{datasets → menu}/src/reducers/menuStateReducer.js +0 -0
  350. /package/{providers/maplibre/src → src}/utils/rasteriseToImageData.js +0 -0
  351. /package/{providers/maplibre/src → src}/utils/rasteriseToImageData.test.js +0 -0
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/objectWithoutProperties";import a from"@babel/runtime/helpers/asyncToGenerator";class r{isBaseMapReady(){throw new Error(this.name+" must implement isBaseMapReady()")}}var n=400,i=7,o=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];var s=(t,e)=>{var a=null,r=function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];clearTimeout(a),a=setTimeout(()=>{t(...n)},e)};return r.cancel=()=>{a&&(clearTimeout(a),a=null)},r};function l(t){var{map:e,events:a,eventBus:r,getCenter:n,getZoom:i,getBounds:o,getResolution:l}=t,h=[],u=[],c=()=>{var t=i();return{center:n(),bounds:o(),resolution:l(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},d=(t,e)=>r.emit(t,e),p=()=>d(a.MAP_LOADED);e.on("load",p),h.push(["load",p]);e.once("idle",()=>d(a.MAP_FIRST_IDLE,c()));var g=()=>d(a.MAP_MOVE_START);e.on("movestart",g),h.push(["movestart",g]);var f=s(()=>{d(a.MAP_MOVE_END,c())},500);e.on("moveend",f),h.push(["moveend",f]);var y,m,v,M=(y=()=>{d(a.MAP_MOVE,c())},m=10,v=0,function(){var t=Date.now();t-v>=m&&(v=t,y(...arguments))});e.on("zoom",M),h.push(["zoom",M]);var b=()=>d(a.MAP_RENDER);e.on("render",b),h.push(["render",b]);var w=s(()=>{d(a.MAP_DATA_CHANGE,c())},500),x=t=>{t.isSourceLoaded&&w()};e.on("styledata",w),e.on("sourcedata",x),h.push(["styledata",w],["sourcedata",x]);var P=()=>d(a.MAP_STYLE_CHANGE);e.on("style.load",P),h.push(["style.load",P]);var N=t=>d(a.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]});return e.on("click",N),h.push(["click",N]),u.push(f,M,w),{remove(){u.forEach(t=>t.cancel()),h.forEach(t=>{var[a,r]=t;return e.off(a,r)})}}}let h=" ";class u{static get separator(){return h}static set separator(t){h=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let a=null;switch(e.length){case 3:a=e[0]/1+e[1]/60+e[2]/3600;break;case 2:a=e[0]/1+e[1]/60;break;case 1:a=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(a=-a),Number(a)}static toDms(t,e="d",a=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===a)switch(e){case"d":case"deg":a=4;break;case"dm":case"deg+min":a=2;break;case"dms":case"deg+min+sec":a=0;break;default:e="d",a=4}t=Math.abs(t);let r=null,n=null,i=null,o=null;switch(e){default:case"d":case"deg":n=t.toFixed(a),n<100&&(n="0"+n),n<10&&(n="0"+n),r=n+"°";break;case"dm":case"deg+min":n=Math.floor(t),i=(60*t%60).toFixed(a),60==i&&(i=(0).toFixed(a),n++),n=("000"+n).slice(-3),i<10&&(i="0"+i),r=n+"°"+u.separator+i+"′";break;case"dms":case"deg+min+sec":n=Math.floor(t),i=Math.floor(3600*t/60)%60,o=(3600*t%60).toFixed(a),60==o&&(o=(0).toFixed(a),i++),60==i&&(i=0,n++),n=("000"+n).slice(-3),i=("00"+i).slice(-2),o<10&&(o="0"+o),r=n+"°"+u.separator+i+"′"+u.separator+o+"″"}return r}static toLat(t,e,a){const r=u.toDms(u.wrap90(t),e,a);return null===r?"–":r.slice(1)+u.separator+(t<0?"S":"N")}static toLon(t,e,a){const r=u.toDms(u.wrap180(t),e,a);return null===r?"–":r+u.separator+(t<0?"W":"E")}static toBrng(t,e,a){const r=u.toDms(u.wrap360(t),e,a);return null===r?"–":r.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),a={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(a.thousands,"⁜").replace(a.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),a={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",a.decimal).replace("⁜",a.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=u.wrap360(t);const a=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*a/360)%a*16/a]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t,a=360;return 1*Math.abs(((e-90)%a+a)%a-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const c=Math.PI;class d{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=u.wrap90(Number(t)),this._lon=u.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?u.wrap90(u.parse(t)):u.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?u.wrap90(u.parse(t)):u.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?u.wrap180(u.parse(t)):u.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?u.wrap180(u.parse(t)):u.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?u.wrap180(u.parse(t)):u.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,a;if(2==t.length&&([e,a]=t,e=u.wrap90(u.parse(e)),a=u.wrap180(u.parse(a)),isNaN(e)||isNaN(a)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,a]=t[0].split(","),e=u.wrap90(u.parse(e)),a=u.wrap180(u.parse(a)),isNaN(e)||isNaN(a)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){const r=t[0];if("Point"==r.type&&Array.isArray(r.coordinates)?[a,e]=r.coordinates:(null!=r.latitude&&(e=r.latitude),null!=r.lat&&(e=r.lat),null!=r.longitude&&(a=r.longitude),null!=r.lng&&(a=r.lng),null!=r.lon&&(a=r.lon),e=u.wrap90(u.parse(e)),a=u.wrap180(u.parse(a))),isNaN(e)||isNaN(a))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(a))throw new TypeError(`invalid point ‘${t.toString()}’`);return new d(e,a)}distanceTo(t,e=6371e3){if(t instanceof d||(t=d.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);const a=e,r=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),o=i-r,s=t.lon.toRadians()-n,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r)*Math.cos(i)*Math.sin(s/2)*Math.sin(s/2);return a*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof d||(t=d.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),a=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),n=Math.cos(e)*Math.sin(a)-Math.sin(e)*Math.cos(a)*Math.cos(r),i=Math.sin(r)*Math.cos(a),o=Math.atan2(i,n).toDegrees();return u.wrap360(o)}finalBearingTo(t){t instanceof d||(t=d.parse(t));const e=t.initialBearingTo(this)+180;return u.wrap360(e)}midpointTo(t){t instanceof d||(t=d.parse(t));const e=this.lat.toRadians(),a=this.lon.toRadians(),r=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),i=Math.cos(e),o=0,s=Math.sin(e),l={x:i+Math.cos(r)*Math.cos(n),y:o+Math.cos(r)*Math.sin(n),z:s+Math.sin(r)},h=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),u=a+Math.atan2(l.y,l.x),c=h.toDegrees(),p=u.toDegrees();return new d(c,p)}intermediatePointTo(t,e){if(t instanceof d||(t=d.parse(t)),this.equals(t))return new d(this.lat,this.lon);const a=this.lat.toRadians(),r=this.lon.toRadians(),n=t.lat.toRadians(),i=t.lon.toRadians(),o=n-a,s=i-r,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(a)*Math.cos(n)*Math.sin(s/2)*Math.sin(s/2),h=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),u=Math.sin((1-e)*h)/Math.sin(h),c=Math.sin(e*h)/Math.sin(h),p=u*Math.cos(a)*Math.cos(r)+c*Math.cos(n)*Math.cos(i),g=u*Math.cos(a)*Math.sin(r)+c*Math.cos(n)*Math.sin(i),f=u*Math.sin(a)+c*Math.sin(n),y=Math.atan2(f,Math.sqrt(p*p+g*g)),m=Math.atan2(g,p),v=y.toDegrees(),M=m.toDegrees();return new d(v,M)}destinationPoint(t,e,a=6371e3){const r=t/a,n=Number(e).toRadians(),i=this.lat.toRadians(),o=this.lon.toRadians(),s=Math.sin(i)*Math.cos(r)+Math.cos(i)*Math.sin(r)*Math.cos(n),l=Math.asin(s),h=Math.sin(n)*Math.sin(r)*Math.cos(i),u=Math.cos(r)-Math.sin(i)*s,c=o+Math.atan2(h,u),p=l.toDegrees(),g=c.toDegrees();return new d(p,g)}static intersection(t,e,a,r){if(t instanceof d||(t=d.parse(t)),a instanceof d||(a=d.parse(a)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(r))throw new TypeError(`invalid brng2 ‘${r}’`);const n=t.lat.toRadians(),i=t.lon.toRadians(),o=a.lat.toRadians(),s=a.lon.toRadians(),l=Number(e).toRadians(),h=Number(r).toRadians(),u=o-n,p=s-i,g=2*Math.asin(Math.sqrt(Math.sin(u/2)*Math.sin(u/2)+Math.cos(n)*Math.cos(o)*Math.sin(p/2)*Math.sin(p/2)));if(Math.abs(g)<Number.EPSILON)return new d(t.lat,t.lon);const f=(Math.sin(o)-Math.sin(n)*Math.cos(g))/(Math.sin(g)*Math.cos(n)),y=(Math.sin(n)-Math.sin(o)*Math.cos(g))/(Math.sin(g)*Math.cos(o)),m=Math.acos(Math.min(Math.max(f,-1),1)),v=Math.acos(Math.min(Math.max(y,-1),1)),M=l-(Math.sin(s-i)>0?m:2*c-m),b=(Math.sin(s-i)>0?2*c-v:v)-h;if(0==Math.sin(M)&&0==Math.sin(b))return null;if(Math.sin(M)*Math.sin(b)<0)return null;const w=-Math.cos(M)*Math.cos(b)+Math.sin(M)*Math.sin(b)*Math.cos(g),x=Math.atan2(Math.sin(g)*Math.sin(M)*Math.sin(b),Math.cos(b)+Math.cos(M)*w),P=Math.asin(Math.min(Math.max(Math.sin(n)*Math.cos(x)+Math.cos(n)*Math.sin(x)*Math.cos(l),-1),1)),N=i+Math.atan2(Math.sin(l)*Math.sin(x)*Math.cos(n),Math.cos(x)-Math.sin(n)*Math.sin(P)),S=P.toDegrees(),E=N.toDegrees();return new d(S,E)}crossTrackDistanceTo(t,e,a=6371e3){t instanceof d||(t=d.parse(t)),e instanceof d||(e=d.parse(e));const r=a;if(this.equals(t))return 0;const n=t.distanceTo(this,r)/r,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(n)*Math.sin(i-o))*r}alongTrackDistanceTo(t,e,a=6371e3){t instanceof d||(t=d.parse(t)),e instanceof d||(e=d.parse(e));const r=a;if(this.equals(t))return 0;const n=t.distanceTo(this,r)/r,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians(),s=Math.asin(Math.sin(n)*Math.sin(i-o));return Math.acos(Math.cos(n)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-i))*r}maxLatitude(t){const e=Number(t).toRadians(),a=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(a))).toDegrees()}static crossingParallels(t,e,a){if(t.equals(e))return null;const r=Number(a).toRadians(),n=t.lat.toRadians(),i=t.lon.toRadians(),o=e.lat.toRadians(),s=e.lon.toRadians()-i,l=Math.sin(n)*Math.cos(o)*Math.cos(r)*Math.sin(s),h=Math.sin(n)*Math.cos(o)*Math.cos(r)*Math.cos(s)-Math.cos(n)*Math.sin(o)*Math.cos(r),c=Math.cos(n)*Math.cos(o)*Math.sin(r)*Math.sin(s);if(c*c>l*l+h*h)return null;const d=Math.atan2(-h,l),p=Math.acos(c/Math.sqrt(l*l+h*h)),g=i+d+p,f=(i+d-p).toDegrees(),y=g.toDegrees();return{lon1:u.wrap180(f),lon2:u.wrap180(y)}}rhumbDistanceTo(t,e=6371e3){t instanceof d||(t=d.parse(t));const a=e,r=this.lat.toRadians(),n=t.lat.toRadians(),i=n-r;let o=Math.abs(t.lon-this.lon).toRadians();Math.abs(o)>c&&(o=o>0?-(2*c-o):2*c+o);const s=Math.log(Math.tan(n/2+c/4)/Math.tan(r/2+c/4)),l=Math.abs(s)>1e-11?i/s:Math.cos(r);return Math.sqrt(i*i+l*l*o*o)*a}rhumbBearingTo(t){if(t instanceof d||(t=d.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),a=t.lat.toRadians();let r=(t.lon-this.lon).toRadians();Math.abs(r)>c&&(r=r>0?-(2*c-r):2*c+r);const n=Math.log(Math.tan(a/2+c/4)/Math.tan(e/2+c/4)),i=Math.atan2(r,n).toDegrees();return u.wrap360(i)}rhumbDestinationPoint(t,e,a=6371e3){const r=this.lat.toRadians(),n=this.lon.toRadians(),i=Number(e).toRadians(),o=t/a,s=o*Math.cos(i);let l=r+s;Math.abs(l)>c/2&&(l=l>0?c-l:-c-l);const h=Math.log(Math.tan(l/2+c/4)/Math.tan(r/2+c/4)),u=Math.abs(h)>1e-11?s/h:Math.cos(r),p=n+o*Math.sin(i)/u,g=l.toDegrees(),f=p.toDegrees();return new d(g,f)}rhumbMidpointTo(t){t instanceof d||(t=d.parse(t));const e=this.lat.toRadians();let a=this.lon.toRadians();const r=t.lat.toRadians(),n=t.lon.toRadians();Math.abs(n-a)>c&&(a+=2*c);const i=(e+r)/2,o=Math.tan(c/4+e/2),s=Math.tan(c/4+r/2),l=Math.tan(c/4+i/2);let h=((n-a)*Math.log(l)+a*Math.log(s)-n*Math.log(o))/Math.log(s/o);isFinite(h)||(h=(a+n)/2);const u=i.toDegrees(),p=h.toDegrees();return new d(u,p)}static areaOf(t,e=6371e3){const a=e,r=t[0].equals(t[t.length-1]);r||t.push(t[0]);const n=t.length-1;let i=0;for(let e=0;e<n;e++){const a=t[e].lat.toRadians(),r=t[e+1].lat.toRadians(),n=(t[e+1].lon-t[e].lon).toRadians();i+=2*Math.atan2(Math.tan(n/2)*(Math.tan(a/2)+Math.tan(r/2)),1+Math.tan(a/2)*Math.tan(r/2))}(function(t){let e=0,a=t[0].initialBearingTo(t[1]);for(let r=0;r<t.length-1;r++){const n=t[r].initialBearingTo(t[r+1]),i=t[r].finalBearingTo(t[r+1]);e+=(n-a+540)%360-180,e+=(i-n+540)%360-180,a=i}const r=t[0].initialBearingTo(t[1]);e+=(r-a+540)%360-180;return Math.abs(e)<90})(t)&&(i=Math.abs(i)-2*c);const o=Math.abs(i*a*a);return r||t.pop(),o}equals(t){return t instanceof d||(t=d.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON)&&!(Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e=void 0){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${u.toLat(this.lat,t,e)}, ${u.toLon(this.lon,t,e)}`}}function p(t,e,a){if(null!==t)for(var r,n,i,o,s,l,h,u,c=0,d=0,g=t.type,f="FeatureCollection"===g,y="Feature"===g,m=f?t.features.length:1,v=0;v<m;v++){s=(u=!!(h=f?t.features[v].geometry:y?t.geometry:t)&&"GeometryCollection"===h.type)?h.geometries.length:1;for(var M=0;M<s;M++){var b=0,w=0;if(null!==(o=u?h.geometries[M]:h)){l=o.coordinates;var x=o.type;switch(c=0,x){case null:break;case"Point":if(!1===e(l,d,v,b,w))return!1;d++,b++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===e(l[r],d,v,b,w))return!1;d++,"MultiPoint"===x&&b++}"LineString"===x&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(n=0;n<l[r].length-c;n++){if(!1===e(l[r][n],d,v,b,w))return!1;d++}"MultiLineString"===x&&b++,"Polygon"===x&&w++}"Polygon"===x&&b++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(w=0,n=0;n<l[r].length;n++){for(i=0;i<l[r][n].length-c;i++){if(!1===e(l[r][n][i],d,v,b,w))return!1;d++}w++}b++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===p(o.geometries[r],e))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var g=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const a=[1/0,1/0,-1/0,-1/0];return p(t,t=>{a[0]>t[0]&&(a[0]=t[0]),a[1]>t[1]&&(a[1]=t[1]),a[2]<t[0]&&(a[2]=t[0]),a[3]<t[1]&&(a[3]=t[1])}),a},f=(t,e)=>{var[a,r]=t,[n,i]=e,o=new d(r,a),s=new d(i,n);return o.distanceTo(s)},y=t=>{var e=t/1609.344;if(e<.5)return"".concat(Math.round(t),"m");if(e<10){var a=Number.parseFloat(e.toFixed(1)),r=1===a?"mile":"miles";return"".concat(a," ").concat(r)}var n=Math.round(e);return"".concat(n," miles")},m=(t,e,a)=>{var[r,n]=e,i=a.filter(e=>{var[a,i]=e;return(a!==r||i!==n)&&((t,e,a)=>{switch(t){case"ArrowUp":return a<0&&Math.abs(a)>=Math.abs(e);case"ArrowDown":return a>0&&Math.abs(a)>=Math.abs(e);case"ArrowLeft":return e<0&&Math.abs(e)>Math.abs(a);case"ArrowRight":return e>0&&Math.abs(e)>Math.abs(a);default:return!1}})(t,a-r,i-n)});if(!i.length)return a.findIndex(t=>t[0]===r&&t[1]===n);var o=-1,s=1/0;return i.forEach(t=>{var e=t[0]-r,i=t[1]-n,l=e*e+i*i;l<s&&(s=l,o=a.indexOf(t))}),o},v=t=>g(t);function M(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,r)}return a}function b(e){for(var a=1;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?M(Object(r),!0).forEach(function(a){t(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var w="highlighted-label";function x(t,e){if("number"==typeof t)return t;if(!Array.isArray(t)||"interpolate"!==t[0])return function(t,e){var{stops:a}=t;if(a.length<2)return a.length>0?a[0][1]:0;for(var r=a[0],n=a[a.length-1],i=1;i<a.length;i++){var o=a[i];if(o[0]>e){n=o,r=a[i-1];break}r=a[i-1],n=o}var[s,l]=r,[h,u]=n;return e<=s?l:e>=h?u:l+(e-s)/(h-s)*(u-l)}(t,e);var[,,a,...r]=t;if("zoom"!==a[0])throw new Error("Only zoom-based expressions supported");for(var n=0;n<r.length-2;n+=2){var i=r[n],o=r[n+1],s=r[n+2],l=r[n+3];if(e<=i)return o;if(e<=s)return o+(e-i)/(s-i)*(l-o)}return r[r.length-1]}function P(t,e,a){return e.flatMap(e=>{var r,n=function(t){var e,a;return"string"==typeof t?null===(e=/^{(.+)}$/.exec(t))||void 0===e?void 0:e[1]:Array.isArray(t)?null===(a=t.find(t=>Array.isArray(t)&&"get"===t[0]))||void 0===a?void 0:a[1]:null}(null===(r=e.layout)||void 0===r?void 0:r["text-field"]);return n?a.filter(t=>{var a;return t.layer.id===e.id&&(null===(a=t.properties)||void 0===a?void 0:a[n])}).map(a=>function(t,e,a,r){var n=function(t){var{type:e,coordinates:a}=t;if("Point"===e)return a;if("MultiPoint"===e)return a[0];if(e.includes("LineString")){var r="LineString"===e?a:a[0];return[(r[0][0]+r[r.length-1][0])/2,(r[0][1]+r[r.length-1][1])/2]}if(e.includes("Polygon")){var n="Polygon"===e?a[0]:a[0][0],i=n.reduce((t,e)=>[t[0]+e[0],t[1]+e[1]],[0,0]);return[i[0]/n.length,i[1]/n.length]}return null}(t.geometry);if(!n)return null;var i=r.project({lng:n[0],lat:n[1]});return{text:t.properties[a],x:i.x,y:i.y,feature:t,layer:e}}(a,e,n,t)).filter(Boolean):[]})}function N(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function S(t,e,a){var r;if(null!=e&&null!==(r=e.feature)&&void 0!==r&&r.layer){N(t,a);var{feature:n,layer:i}=e;a.highlightLayerId="highlight-".concat(i.id);var{id:o,type:s,properties:l,geometry:h}=n;t.getSource(w).setData({id:o,type:s,properties:l,geometry:h}),a.highlightedExpr=i.layout["text-size"];var u=t.getZoom(),c=function(t,e,a){return{id:"highlight-".concat(t.id),type:t.type,source:w,layout:b(b({},t.layout),{},{"text-size":e,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:b(b({},t.paint),{},{"text-color":a.text,"text-halo-color":a.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})}}(i,1.5*x(a.highlightedExpr,u),a.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"});t.addLayer(c),t.moveLayer(a.highlightLayerId)}}function E(t){t.getSource(w)||t.addSource(w,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function L(t){t.getStyle().layers.filter(t=>{var e;return"line"===(null===(e=t.layout)||void 0===e?void 0:e["symbol-placement"])}).forEach(e=>t.setLayoutProperty(e.id,"symbol-placement","line-center"))}function R(t,e,a,r){var n={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function i(){var e=t.getStyle().layers.filter(t=>"symbol"===t.type),a=t.queryRenderedFeatures({layers:e.map(t=>t.id)});n.labels=P(t,e,a)}function o(){if(i(),!n.labels.length)return null;var e=t.project(t.getCenter()),a=function(t,e){var a;return null===(a=t.reduce((t,a)=>{var r=(a.x-e.x)**2+(a.y-e.y)**2;return!t||r<t.dist?{label:a,dist:r}:t},null))||void 0===a?void 0:a.label}(n.labels,e);return n.currentPixel={x:a.x,y:a.y},S(t,a,n),"".concat(a.text," (").concat(a.layer.id,")")}return L(t),E(t),null==r||r.on(a.MAP_SET_STYLE,e=>{t.once("styledata",()=>t.once("idle",()=>{L(t),E(t),n.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)}))}),t.on("zoom",()=>{if(n.highlightLayerId&&n.highlightedExpr){var e=x(n.highlightedExpr,t.getZoom());t.setLayoutProperty(n.highlightLayerId,"text-size",1.5*e)}}),function(t){t.getStyle().layers.filter(t=>"symbol"===t.type).forEach(e=>{t.setPaintProperty(e.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(t),{refreshLabels:i,highlightNextLabel:function(e){if(i(),!n.labels.length)return null;if(!n.currentPixel)return o();var a=function(t,e){if(!e.currentPixel)return null;var a=e.labels.map((t,e)=>({pixel:[t.x,t.y],index:e})).filter(t=>t.pixel[0]!==e.currentPixel.x||t.pixel[1]!==e.currentPixel.y);if(!a.length)return null;var r=a.map(t=>t.pixel),n=m(t,[e.currentPixel.x,e.currentPixel.y],r);return(null==n||n<0||n>=a.length)&&(n=0),e.labels[a[n].index]}(e,n);return a?(n.currentPixel={x:a.x,y:a.y},S(t,a,n),"".concat(a.text," (").concat(a.layer.id,")")):null},highlightLabelAtCenter:o,clearHighlightedLabel:()=>N(t,n)}}function O(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,r)}return a}function I(e){for(var a=1;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?O(Object(r),!0).forEach(function(a){t(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var T="icon-image",D="active-highlight",A="active-highlight-inner",j="selected-highlight",_=(t,e)=>{var a,r;return null!==(a=null===(r=t._activeSymbolImageMap)||void 0===r?void 0:r[e])&&void 0!==a?a:null},C=(t,e)=>{var a,r;return null!==(a=null===(r=t._selectedSymbolImageMap)||void 0===r?void 0:r[e])&&void 0!==a?a:null},B=(t,e,a,r)=>{e.forEach(e=>{if(!a.has(e)){var n="".concat(r,"-").concat(e);["".concat(n,"-fill"),"".concat(n,"-line"),"".concat(n,"-symbol")].forEach(e=>{t.getLayer(e)&&t.setFilter(e,["==","id",""])})}})},k=(t,e)=>{var a="_".concat(e.replaceAll("-",""),"Sources");B(t,t[a]||new Set,new Set,e),t[a]=new Set},F=(t,e,a,r,n,i,o)=>{!!t.getLayer(e)||t.addLayer(I(I({id:e,type:a,source:r},n&&{"source-layer":n}),{},{paint:i})),Object.entries(i).forEach(a=>{var[r,n]=a;t.setPaintProperty(e,r,n)}),t.setFilter(e,o),t.moveLayer(e)},z=(t,e,a,r,n,i,o)=>{var s=t.getLayoutProperty(n,T),l=o(t,s);l&&((t,e,a,r,n,i,o)=>{var s;t.getLayer(e)||t.addLayer(I(I({id:e,type:"symbol",source:a},r&&{"source-layer":r}),{},{layout:{[T]:i,"icon-anchor":null!==(s=t.getLayoutProperty(n,"icon-anchor"))&&void 0!==s?s:"center","icon-allow-overlap":!0}})),t.setLayoutProperty(e,T,i),t.setFilter(e,o),t.moveLayer(e)})(t,"".concat(e,"-symbol"),a,r,n,l,i)},W=(t,e,a,r,n,i)=>{var{ids:o,fillIds:s,idProperty:l,layerId:h,hasFillGeometry:u}=a[e],c=t.getLayer(h);if(c&&r[h]){var d=r[h],p=c.sourceLayer,g=u?"fill":c.type,f="".concat(n,"-").concat(e),{fill:y}=d,m=n===j,v=(t=>t===j||t===A)(n),{lineColor:M,lineWidth:b}=((t,e)=>({lineColor:e?t.selectionStroke:t.stroke,lineWidth:e?t.strokeWidth:t.activeStrokeWidth}))(d,v),w=l?["get",l]:["id"],x=["in",w,["literal",Array.from(o)]];if("fill-extrusion"!==c.type)switch(g){case"fill":((t,e,a,r,n)=>{var{isSelected:i,idExpression:o,fillIds:s,fill:l,lineColor:h,lineWidth:u,filter:c}=n;if(i){var d=[];s.forEach(t=>d.push(t));var p=["in",o,["literal",d]];F(t,"".concat(e,"-fill"),"fill",a,r,{"fill-color":l},p)}F(t,"".concat(e,"-line"),"line",a,r,{"line-color":h,"line-width":u},c)})(t,f,e,p,{isSelected:m,idExpression:w,fillIds:s,fill:y,lineColor:M,lineWidth:b,filter:x});break;case"line":((t,e,a,r,n,i,o)=>{t.getLayer("".concat(e,"-fill"))&&t.setFilter("".concat(e,"-fill"),["==","id",""]),F(t,"".concat(e,"-line"),"line",a,r,{"line-color":n,"line-width":i},o)})(t,f,e,p,M,b,x);break;case"symbol":((t,e,a,r,n,i,o)=>{z(t,e,a,r,n,i,o)})(t,f,e,p,h,x,i)}else((t,e,a,r)=>{var{ids:n,lineColor:i,lineWidth:o,idExpression:s}=r,l=[];n.forEach(t=>l.push(t));var h=["in",s,["literal",l]],{source:u,sourceLayer:c}=t.getLayer(a);F(t,"".concat(e,"-line"),"line",u,c,{"line-color":i,"line-width":o},h)})(t,f,h,{ids:o,lineColor:M,lineWidth:b,idExpression:w})}},q=(t,e,a,r,n)=>{var i=((t,e)=>{var a={};return null==e||e.forEach(e=>{var{featureId:r,layerId:n,idProperty:i,geometry:o}=e,s=t.getLayer(n);if(s){var l=s.source;a[l]||(a[l]={ids:new Set,fillIds:new Set,idProperty:i,layerId:n,hasFillGeometry:!1}),!o||"Polygon"!==o.type&&"MultiPolygon"!==o.type||(a[l].hasFillGeometry=!0,a[l].fillIds.add(r)),a[l].ids.add(r)}}),a})(t,e),o=new Set(Object.keys(i)),s="_".concat(r.replaceAll("-",""),"Sources"),l=t[s]||new Set;return B(t,l,o,r),t[s]=o,o.forEach(e=>W(t,e,i,a,r,n)),i};var $=(t,e,a)=>{var r=(e.x-a.x)**2+(e.y-a.y)**2;if(0===r)return(t.x-e.x)**2+(t.y-e.y)**2;var n=((t.x-e.x)*(a.x-e.x)+(t.y-e.y)*(a.y-e.y))/r;return n=Math.max(0,Math.min(1,n)),(t.x-(e.x+n*(a.x-e.x)))**2+(t.y-(e.y+n*(a.y-e.y)))**2},Z=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{radius:r=10}=a,n=[[e.x-r,e.y-r],[e.x+r,e.y+r]],i=t.queryRenderedFeatures(n);if(0===i.length)return[];var o=new Set(t.queryRenderedFeatures([e.x,e.y]).map(t=>{var e,a=void 0===t.id?JSON.stringify(t.properties):t.id;return"".concat(null===(e=t.layer)||void 0===e?void 0:e.source,":").concat(a)})),s=[];i.forEach(t=>{!1===s.includes(t.layer.id)&&s.push(t.layer.id)});for(var l=new Set,h=[],u=i.length-1;u>=0;u--){var c,d=i[u],p=void 0===d.id?JSON.stringify(d.properties):d.id,g="".concat(null===(c=d.layer)||void 0===c?void 0:c.source,":").concat(p);!1===l.has(g)&&(l.add(g),h.push(d))}var f=t.unproject(e),y=[f.lng,f.lat],m=h.filter(t=>{var e=t.geometry.type;if(e.includes("Polygon"))return("Polygon"===e?[t.geometry.coordinates]:t.geometry.coordinates).some(t=>((t,e)=>{for(var[a,r]=t,n=!1,i=0,o=e.length-1;i<e.length;o=i,i++){var[s,l]=e[i],[h,u]=e[o];l>r!=u>r&&a<(h-s)*(r-l)/(u-l)+s&&(n=!n)}return n})(y,t[0]));if("Point"===e||"MultiPoint"===e){var a,r=void 0===t.id?JSON.stringify(t.properties):t.id;return o.has("".concat(null===(a=t.layer)||void 0===a?void 0:a.source,":").concat(r))}return!0});return m.map(a=>{var r=0,n=a.geometry.type,i=((t,e,a)=>{var{coordinates:r,type:n}=a,i=1/0,o=e=>t.project(e),s=t=>{for(var a=0;a<t.length-1;a++){var r=$(e,o(t[a]),o(t[a+1]));r<i&&(i=r)}};if("Point"===n){var l=o(r);i=(e.x-l.x)**2+(e.y-l.y)**2}else"LineString"===n||"MultiPoint"===n?"LineString"===n?s(r):r.forEach(t=>{var a=o(t),r=(e.x-a.x)**2+(e.y-a.y)**2;r<i&&(i=r)}):"Polygon"===n||"MultiLineString"===n?r.forEach(s):"MultiPolygon"===n&&r.forEach(t=>t.forEach(s));return i})(t,e,a.geometry);return r+=1e6*s.indexOf(a.layer.id),n.includes("Polygon")&&(r-=5e5),{f:a,score:r+=i}}).sort((t,e)=>t.score-e.score).map(t=>{var{f:e}=t;return e})},G=function(){var t=a(function*(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2;e.length&&(t._activeSymbolImageMap={},t._selectedSymbolImageMap={},yield Promise.all(e.flatMap(e=>{var o=n.getSymbolImageId(e,r,!1,i),s=n.getSymbolImageId(e,r,!0,i);return o&&s&&(t._activeSymbolImageMap[o]=s),["normal","active","selected"].map(function(){var l=a(function*(a){var l="active"===a?s:o;if("selected"===a||l&&!t.hasImage(l)){var h=yield n.rasteriseSymbolImage(e,r,a,i);h&&("selected"===a&&o&&(t._selectedSymbolImageMap[o]=h.imageId),t.hasImage(h.imageId)||t.addImage(h.imageId,h.imageData,{pixelRatio:i}))}});return function(t){return l.apply(this,arguments)}}())})))});return function(e,a,r,n){return t.apply(this,arguments)}}(),H=t=>Math.max(2,2*t),V=(t,e)=>{if(!t)return null;if("string"==typeof t)return t.trim();if("object"==typeof t){if(e&&t[e])return t[e];var a=Object.values(t)[0];return null!=a?a:null}return null},J=new Map,Y=function(){var t=a(function*(t,e,a,r){var n=a.getPatternInnerContent(t);if(!n)return null;var i=a.getPatternImageId(t,e,r);if(!i)return null;var o,s,l=J.get(i);if(!l){var h=V(t.fillPatternForegroundColor,e)||"black",u=V(t.fillPatternBackgroundColor,e)||"transparent",c=(o=h,s=u,n.replace(/\{\{foregroundColor\}\}/g,o||"black").replace(/\{\{backgroundColor\}\}/g,s||"transparent")),d='<rect width="16" height="16" fill="'.concat(u,'"/>'),p=H(r),g=Math.round(8*p),f='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(g,'" height="').concat(g,'" viewBox="0 0 16 16">').concat(d).concat(c,"</svg>");l=yield((t,e,a)=>new Promise((r,n)=>{var i="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(t)),o=new Image(e,a);o.onload=()=>{var t=document.createElement("canvas");t.width=e,t.height=a;var n=t.getContext("2d");n.drawImage(o,0,0,e,a),r(n.getImageData(0,0,e,a))},o.onerror=()=>{n(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},o.src=i}))(f,g,g),J.set(i,l)}return{imageId:i,imageData:l}});return function(e,a,r,n){return t.apply(this,arguments)}}(),K=function(){var t=a(function*(t,e,r,n,i){if(e.length){var o=H(i),s=e.reduce((e,s)=>{var l=n.getPatternImageId(s,r,i);return!l||e[l]||t.hasImage(l)||(e[l]=a(function*(){var e=yield Y(s,r,n,i);e&&!t.hasImage(e.imageId)&&t.addImage(e.imageId,e.imageData,{pixelRatio:o})})),e},{});yield Promise.all(Object.values(s).map(t=>t()))}});return function(e,a,r,n,i){return t.apply(this,arguments)}}(),U=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function X(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,r)}return a}function Q(e){for(var a=1;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?X(Object(r),!0).forEach(function(a){t(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}class tt extends r{constructor(t){var{mapFramework:e,mapProviderConfig:a={},events:r,eventBus:n}=t;super(),this.maplibreModule=e,this.events=r,this.eventBus=n,this.capabilities={supportedShortcuts:o,supportsMapSizes:!0},Object.assign(this,a)}get name(){return"MapLibreProvider"}initMap(t){var r=this;return a(function*(){var{container:a,padding:n,mapStyle:i,mapSize:o,center:s,zoom:h,bounds:u,pixelRatio:c}=t,d=e(t,U);r.mapStyleId=null==i?void 0:i.id,r.mapSize=o;var{Map:p}=r.maplibreModule,{events:g,eventBus:f}=r,y=new p(Q(Q({},d),{},{container:a,style:null==i?void 0:i.url,pixelRatio:c,padding:n,center:s,zoom:h,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}));y.touchZoomRotate.disableRotation(),r.map=y,r.map.setPadding(n),u&&y.fitBounds(u,{duration:0}),function(t){var e=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){var a=t.getCanvas();if(a&&(this.target===a||a.contains(this.target)))return}e.call(this)}}(y),function(t){var e=t.getCanvas();e.removeAttribute("role"),e.setAttribute("tabindex",-1),e.removeAttribute("aria-label"),e.style.display="block",e.addEventListener("focus",t=>{e.blur(),t.relatedTarget&&t.relatedTarget.focus({preventScroll:!0})})}(y),l({map:y,events:g,eventBus:f,getCenter:r.getCenter.bind(r),getZoom:r.getZoom.bind(r),getBounds:r.getBounds.bind(r),getResolution:r.getResolution.bind(r)}),function(t){var{mapProvider:e,map:a,events:r,eventBus:n}=t,i=t=>{a.once("style.load",()=>{n.emit(r.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),a.setStyle(t.url,{diff:!1})},o=t=>{a.setPixelRatio(t)},s=t=>{var{mapSize:a}=t;e.mapSize=a};n.on(r.MAP_SET_STYLE,i),n.on(r.MAP_SET_PIXEL_RATIO,o),n.on(r.MAP_SIZE_CHANGE,s)}({mapProvider:r,map:y,events:g,eventBus:f}),y.on("load",()=>{r.labelNavigator=R(y,null==i?void 0:i.mapColorScheme,g,f)}),r.eventBus.emit(g.MAP_READY,{map:r.map,mapStyleId:r.mapStyleId,mapSize:r.mapSize,crs:r.crs})})()}isBaseMapReady(){var t;return Boolean(null===(t=this.map)||void 0===t?void 0:t.getStyle())}destroyMap(){var t,e;this.setHoverCursor([]),null===(t=this.mapEvents)||void 0===t||t.remove(),null===(e=this.appEvents)||void 0===e||e.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}setHoverCursor(t){this.map&&(this._onHoverMove=((t,e,a)=>{var r=t.getCanvas();if(a&&t.off("mousemove",a),null==e||!e.length)return r.style.cursor="",null;var n=a=>{var n=e.filter(e=>t.getLayer(e));if(0!==n.length){var{lineLayers:i,otherLayers:o}=((t,e)=>{var a=[],r=[];for(var n of e)if("line"===t.getLayer(n).type){var i=n.endsWith("-stroke")?n.slice(0,-7):null;null!==i&&e.includes(i)||a.push(n)}else r.push(n);return{lineLayers:a,otherLayers:r}})(t,n),{x:s,y:l}=a.point,h=[[s-10,l-10],[s+10,l+10]],u=i.length>0&&t.queryRenderedFeatures(h,{layers:i}).length>0,c=o.length>0&&t.queryRenderedFeatures(a.point,{layers:o}).length>0;r.style.cursor=u||c?"pointer":""}else r.style.cursor=""};return t.on("mousemove",n),n})(this.map,t,this._onHoverMove))}setView(t){var{center:e,zoom:a}=t;this.map.flyTo({center:e||this.getCenter(),zoom:a||this.getZoom(),duration:this.map.isStyleLoaded()?n:0})}zoomIn(t){this.map.easeTo({zoom:this.getZoom()+t,duration:n})}zoomOut(t){this.map.easeTo({zoom:this.getZoom()-t,duration:n})}panBy(t){this.map.panBy(t,{duration:n})}fitToBounds(t){var e=Array.isArray(t)?t:v(t),a=this.map.isStyleLoaded()?n:0;this.map.fitBounds(e,{duration:a})}setPadding(t){this.map.setPadding(t)}updateHighlightedFeatures(t,e,a){var{LngLatBounds:r}=this.maplibreModule;return function(t){var{LngLatBounds:e,map:a,selectedFeatures:r,activeFeatures:n,stylesMap:i}=t;if(!a)return null;null!=n&&n.length?(q(a,n,i,D,_),q(a,n,i,A,C)):(k(a,D),k(a,A));var o={};null!=r&&r.length?o=q(a,r,i,j,C):k(a,j);var s=[];return Object.entries(o).forEach(t=>{var[,{ids:e,idProperty:r,layerId:n}]=t;s.push(...a.queryRenderedFeatures({layers:[n]}).filter(t=>{var a;return e.has(r?null===(a=t.properties)||void 0===a?void 0:a[r]:t.id)}))}),((t,e)=>{if(!e.length)return null;var a=new t;return e.forEach(t=>{var e=t=>"number"==typeof t[0]?a.extend(t):t.forEach(e);e(t.geometry.coordinates)}),[a.getWest(),a.getSouth(),a.getEast(),a.getNorth()]})(e,s)}({LngLatBounds:r,map:this.map,selectedFeatures:t,activeFeatures:e,stylesMap:a})}highlightNextLabel(t){var e;return(null===(e=this.labelNavigator)||void 0===e?void 0:e.highlightNextLabel(t))||null}highlightLabelAtCenter(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.highlightLabelAtCenter())||null}clearHighlightedLabel(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.clearHighlightedLabel())||null}getCenter(){var t=this.map.getCenter();return[Number(t.lng.toFixed(i)),Number(t.lat.toFixed(i))]}getZoom(){return Number(this.map.getZoom().toFixed(i))}getBounds(){return this.map.getBounds().toArray().flat(1)}getFeaturesAtPoint(t,e){return Z(this.map,t,e)}getVisibleFeatures(t){var e=t.filter(t=>this.map.getLayer(t));return e.length?this.map.queryRenderedFeatures(void 0,{layers:e}):[]}addSymbolsToMap(t,e,r){var n=this;return a(function*(){var a=n.map.getPixelRatio()||1;return G(n.map,t,e,r,a)})()}addPatternsToMap(t,e,r){var n=this;return a(function*(){var a=n.map.getPixelRatio()||1;return K(n.map,t,e,r,a)})()}getAreaDimensions(){var{LngLatBounds:t}=this.maplibreModule;return(t=>{var e,a,r,n;if(t&&"function"==typeof t.getWest)e=t.getWest(),a=t.getSouth(),r=t.getEast(),n=t.getNorth();else{if(!Array.isArray(t)||2!==t.length)return"";[[e,a],[r,n]]=t}var i=f([e,a],[r,a]),o=f([e,a],[e,n]),s=y(i),l=y(o);return"".concat(l," by ").concat(s)})(((t,e)=>{var{width:a,height:r}=e.getContainer().getBoundingClientRect(),n=e.getPadding(),i=[n.left,r-n.bottom],o=[a-n.right,n.top];return new t(e.unproject(i),e.unproject(o))})(t,this.map))}getCardinalMove(t,e){return((t,e)=>{var[a,r]=t,[n,i]=e,o=i-r,s=n-a,l=[];if(Math.abs(o)>1e-4){var h=Math.round(f([a,r],[a,i]));l.push("".concat(o>0?"north":"south"," ").concat(y(h)))}if(Math.abs(s)>1e-4){var u=Math.round(f([a,r],[n,r]));l.push("".concat(s>0?"east":"west"," ").concat(y(u)))}return l.join(", ")})(t,e)}getResolution(){return t=this.map.getCenter(),e=this.map.getZoom(),a=t.lat,r=Math.pow(2,e),40075016.686*Math.cos(a*Math.PI/180)/(512*r);var t,e,a,r}mapToScreen(t){return this.map.project(t)}screenToMap(t){var{lng:e,lat:a}=this.map.unproject([t.x,t.y]);return[e,a]}isGeometryObscured(t,e){return((t,e,a)=>{var r=a.getContainer().getBoundingClientRect(),[n,i,o,s]=v(t),l=[a.project([n,i]),a.project([n,s]),a.project([o,i]),a.project([o,s])],h=Math.min(...l.map(t=>t.x)),u=Math.max(...l.map(t=>t.x)),c=Math.min(...l.map(t=>t.y)),d=Math.max(...l.map(t=>t.y)),p=e.left-r.left,g=e.top-r.top,f=e.right-r.left,y=e.bottom-r.top;return h<f&&u>p&&c<y&&d>g})(t,e,this.map)}}export{tt as default};
1
+ import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/objectWithoutProperties";import a from"@babel/runtime/helpers/asyncToGenerator";class r{isBaseMapReady(){throw new Error(this.name+" must implement isBaseMapReady()")}}var n=400,i=7,o=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];var s=(t,e)=>{var a=null,r=function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];clearTimeout(a),a=setTimeout(()=>{t(...n)},e)};return r.cancel=()=>{a&&(clearTimeout(a),a=null)},r};function l(t){var{map:e,events:a,eventBus:r,getCenter:n,getZoom:i,getBounds:o,getResolution:l}=t,c=[],h=[],u=()=>{var t=i();return{center:n(),bounds:o(),resolution:l(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},d=(t,e)=>r.emit(t,e),p=()=>d(a.MAP_LOADED);e.on("load",p),c.push(["load",p]);e.once("idle",()=>d(a.MAP_FIRST_IDLE,u()));var g=()=>d(a.MAP_MOVE_START);e.on("movestart",g),c.push(["movestart",g]);var f=s(()=>{d(a.MAP_MOVE_END,u())},500);e.on("moveend",f),c.push(["moveend",f]);var y,m,v,M=(y=()=>{d(a.MAP_MOVE,u())},m=10,v=0,function(){var t=Date.now();t-v>=m&&(v=t,y(...arguments))});e.on("zoom",M),c.push(["zoom",M]);var b=()=>d(a.MAP_RENDER);e.on("render",b),c.push(["render",b]);var w=s(()=>{d(a.MAP_DATA_CHANGE,u())},500),x=t=>{t.isSourceLoaded&&w()};e.on("styledata",w),e.on("sourcedata",x),c.push(["styledata",w],["sourcedata",x]);var P=()=>d(a.MAP_STYLE_CHANGE);e.on("style.load",P),c.push(["style.load",P]);var N=t=>d(a.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]});return e.on("click",N),c.push(["click",N]),h.push(f,M,w),{remove(){h.forEach(t=>t.cancel()),c.forEach(t=>{var[a,r]=t;return e.off(a,r)})}}}let c=" ";class h{static get separator(){return c}static set separator(t){c=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let a=null;switch(e.length){case 3:a=e[0]/1+e[1]/60+e[2]/3600;break;case 2:a=e[0]/1+e[1]/60;break;case 1:a=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(a=-a),Number(a)}static toDms(t,e="d",a=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===a)switch(e){case"d":case"deg":a=4;break;case"dm":case"deg+min":a=2;break;case"dms":case"deg+min+sec":a=0;break;default:e="d",a=4}t=Math.abs(t);let r=null,n=null,i=null,o=null;switch(e){default:case"d":case"deg":n=t.toFixed(a),n<100&&(n="0"+n),n<10&&(n="0"+n),r=n+"°";break;case"dm":case"deg+min":n=Math.floor(t),i=(60*t%60).toFixed(a),60==i&&(i=(0).toFixed(a),n++),n=("000"+n).slice(-3),i<10&&(i="0"+i),r=n+"°"+h.separator+i+"′";break;case"dms":case"deg+min+sec":n=Math.floor(t),i=Math.floor(3600*t/60)%60,o=(3600*t%60).toFixed(a),60==o&&(o=(0).toFixed(a),i++),60==i&&(i=0,n++),n=("000"+n).slice(-3),i=("00"+i).slice(-2),o<10&&(o="0"+o),r=n+"°"+h.separator+i+"′"+h.separator+o+"″"}return r}static toLat(t,e,a){const r=h.toDms(h.wrap90(t),e,a);return null===r?"–":r.slice(1)+h.separator+(t<0?"S":"N")}static toLon(t,e,a){const r=h.toDms(h.wrap180(t),e,a);return null===r?"–":r+h.separator+(t<0?"W":"E")}static toBrng(t,e,a){const r=h.toDms(h.wrap360(t),e,a);return null===r?"–":r.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),a={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(a.thousands,"⁜").replace(a.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),a={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",a.decimal).replace("⁜",a.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=h.wrap360(t);const a=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*a/360)%a*16/a]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t,a=360;return 1*Math.abs(((e-90)%a+a)%a-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const u=Math.PI;class d{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=h.wrap90(Number(t)),this._lon=h.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?h.wrap90(h.parse(t)):h.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?h.wrap90(h.parse(t)):h.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?h.wrap180(h.parse(t)):h.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?h.wrap180(h.parse(t)):h.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?h.wrap180(h.parse(t)):h.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,a;if(2==t.length&&([e,a]=t,e=h.wrap90(h.parse(e)),a=h.wrap180(h.parse(a)),isNaN(e)||isNaN(a)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,a]=t[0].split(","),e=h.wrap90(h.parse(e)),a=h.wrap180(h.parse(a)),isNaN(e)||isNaN(a)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){const r=t[0];if("Point"==r.type&&Array.isArray(r.coordinates)?[a,e]=r.coordinates:(null!=r.latitude&&(e=r.latitude),null!=r.lat&&(e=r.lat),null!=r.longitude&&(a=r.longitude),null!=r.lng&&(a=r.lng),null!=r.lon&&(a=r.lon),e=h.wrap90(h.parse(e)),a=h.wrap180(h.parse(a))),isNaN(e)||isNaN(a))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(a))throw new TypeError(`invalid point ‘${t.toString()}’`);return new d(e,a)}distanceTo(t,e=6371e3){if(t instanceof d||(t=d.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);const a=e,r=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),o=i-r,s=t.lon.toRadians()-n,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r)*Math.cos(i)*Math.sin(s/2)*Math.sin(s/2);return a*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof d||(t=d.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),a=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),n=Math.cos(e)*Math.sin(a)-Math.sin(e)*Math.cos(a)*Math.cos(r),i=Math.sin(r)*Math.cos(a),o=Math.atan2(i,n).toDegrees();return h.wrap360(o)}finalBearingTo(t){t instanceof d||(t=d.parse(t));const e=t.initialBearingTo(this)+180;return h.wrap360(e)}midpointTo(t){t instanceof d||(t=d.parse(t));const e=this.lat.toRadians(),a=this.lon.toRadians(),r=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),i=Math.cos(e),o=0,s=Math.sin(e),l={x:i+Math.cos(r)*Math.cos(n),y:o+Math.cos(r)*Math.sin(n),z:s+Math.sin(r)},c=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),h=a+Math.atan2(l.y,l.x),u=c.toDegrees(),p=h.toDegrees();return new d(u,p)}intermediatePointTo(t,e){if(t instanceof d||(t=d.parse(t)),this.equals(t))return new d(this.lat,this.lon);const a=this.lat.toRadians(),r=this.lon.toRadians(),n=t.lat.toRadians(),i=t.lon.toRadians(),o=n-a,s=i-r,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(a)*Math.cos(n)*Math.sin(s/2)*Math.sin(s/2),c=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-e)*c)/Math.sin(c),u=Math.sin(e*c)/Math.sin(c),p=h*Math.cos(a)*Math.cos(r)+u*Math.cos(n)*Math.cos(i),g=h*Math.cos(a)*Math.sin(r)+u*Math.cos(n)*Math.sin(i),f=h*Math.sin(a)+u*Math.sin(n),y=Math.atan2(f,Math.sqrt(p*p+g*g)),m=Math.atan2(g,p),v=y.toDegrees(),M=m.toDegrees();return new d(v,M)}destinationPoint(t,e,a=6371e3){const r=t/a,n=Number(e).toRadians(),i=this.lat.toRadians(),o=this.lon.toRadians(),s=Math.sin(i)*Math.cos(r)+Math.cos(i)*Math.sin(r)*Math.cos(n),l=Math.asin(s),c=Math.sin(n)*Math.sin(r)*Math.cos(i),h=Math.cos(r)-Math.sin(i)*s,u=o+Math.atan2(c,h),p=l.toDegrees(),g=u.toDegrees();return new d(p,g)}static intersection(t,e,a,r){if(t instanceof d||(t=d.parse(t)),a instanceof d||(a=d.parse(a)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(r))throw new TypeError(`invalid brng2 ‘${r}’`);const n=t.lat.toRadians(),i=t.lon.toRadians(),o=a.lat.toRadians(),s=a.lon.toRadians(),l=Number(e).toRadians(),c=Number(r).toRadians(),h=o-n,p=s-i,g=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(n)*Math.cos(o)*Math.sin(p/2)*Math.sin(p/2)));if(Math.abs(g)<Number.EPSILON)return new d(t.lat,t.lon);const f=(Math.sin(o)-Math.sin(n)*Math.cos(g))/(Math.sin(g)*Math.cos(n)),y=(Math.sin(n)-Math.sin(o)*Math.cos(g))/(Math.sin(g)*Math.cos(o)),m=Math.acos(Math.min(Math.max(f,-1),1)),v=Math.acos(Math.min(Math.max(y,-1),1)),M=l-(Math.sin(s-i)>0?m:2*u-m),b=(Math.sin(s-i)>0?2*u-v:v)-c;if(0==Math.sin(M)&&0==Math.sin(b))return null;if(Math.sin(M)*Math.sin(b)<0)return null;const w=-Math.cos(M)*Math.cos(b)+Math.sin(M)*Math.sin(b)*Math.cos(g),x=Math.atan2(Math.sin(g)*Math.sin(M)*Math.sin(b),Math.cos(b)+Math.cos(M)*w),P=Math.asin(Math.min(Math.max(Math.sin(n)*Math.cos(x)+Math.cos(n)*Math.sin(x)*Math.cos(l),-1),1)),N=i+Math.atan2(Math.sin(l)*Math.sin(x)*Math.cos(n),Math.cos(x)-Math.sin(n)*Math.sin(P)),S=P.toDegrees(),E=N.toDegrees();return new d(S,E)}crossTrackDistanceTo(t,e,a=6371e3){t instanceof d||(t=d.parse(t)),e instanceof d||(e=d.parse(e));const r=a;if(this.equals(t))return 0;const n=t.distanceTo(this,r)/r,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(n)*Math.sin(i-o))*r}alongTrackDistanceTo(t,e,a=6371e3){t instanceof d||(t=d.parse(t)),e instanceof d||(e=d.parse(e));const r=a;if(this.equals(t))return 0;const n=t.distanceTo(this,r)/r,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians(),s=Math.asin(Math.sin(n)*Math.sin(i-o));return Math.acos(Math.cos(n)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-i))*r}maxLatitude(t){const e=Number(t).toRadians(),a=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(a))).toDegrees()}static crossingParallels(t,e,a){if(t.equals(e))return null;const r=Number(a).toRadians(),n=t.lat.toRadians(),i=t.lon.toRadians(),o=e.lat.toRadians(),s=e.lon.toRadians()-i,l=Math.sin(n)*Math.cos(o)*Math.cos(r)*Math.sin(s),c=Math.sin(n)*Math.cos(o)*Math.cos(r)*Math.cos(s)-Math.cos(n)*Math.sin(o)*Math.cos(r),u=Math.cos(n)*Math.cos(o)*Math.sin(r)*Math.sin(s);if(u*u>l*l+c*c)return null;const d=Math.atan2(-c,l),p=Math.acos(u/Math.sqrt(l*l+c*c)),g=i+d+p,f=(i+d-p).toDegrees(),y=g.toDegrees();return{lon1:h.wrap180(f),lon2:h.wrap180(y)}}rhumbDistanceTo(t,e=6371e3){t instanceof d||(t=d.parse(t));const a=e,r=this.lat.toRadians(),n=t.lat.toRadians(),i=n-r;let o=Math.abs(t.lon-this.lon).toRadians();Math.abs(o)>u&&(o=o>0?-(2*u-o):2*u+o);const s=Math.log(Math.tan(n/2+u/4)/Math.tan(r/2+u/4)),l=Math.abs(s)>1e-11?i/s:Math.cos(r);return Math.sqrt(i*i+l*l*o*o)*a}rhumbBearingTo(t){if(t instanceof d||(t=d.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),a=t.lat.toRadians();let r=(t.lon-this.lon).toRadians();Math.abs(r)>u&&(r=r>0?-(2*u-r):2*u+r);const n=Math.log(Math.tan(a/2+u/4)/Math.tan(e/2+u/4)),i=Math.atan2(r,n).toDegrees();return h.wrap360(i)}rhumbDestinationPoint(t,e,a=6371e3){const r=this.lat.toRadians(),n=this.lon.toRadians(),i=Number(e).toRadians(),o=t/a,s=o*Math.cos(i);let l=r+s;Math.abs(l)>u/2&&(l=l>0?u-l:-u-l);const c=Math.log(Math.tan(l/2+u/4)/Math.tan(r/2+u/4)),h=Math.abs(c)>1e-11?s/c:Math.cos(r),p=n+o*Math.sin(i)/h,g=l.toDegrees(),f=p.toDegrees();return new d(g,f)}rhumbMidpointTo(t){t instanceof d||(t=d.parse(t));const e=this.lat.toRadians();let a=this.lon.toRadians();const r=t.lat.toRadians(),n=t.lon.toRadians();Math.abs(n-a)>u&&(a+=2*u);const i=(e+r)/2,o=Math.tan(u/4+e/2),s=Math.tan(u/4+r/2),l=Math.tan(u/4+i/2);let c=((n-a)*Math.log(l)+a*Math.log(s)-n*Math.log(o))/Math.log(s/o);isFinite(c)||(c=(a+n)/2);const h=i.toDegrees(),p=c.toDegrees();return new d(h,p)}static areaOf(t,e=6371e3){const a=e,r=t[0].equals(t[t.length-1]);r||t.push(t[0]);const n=t.length-1;let i=0;for(let e=0;e<n;e++){const a=t[e].lat.toRadians(),r=t[e+1].lat.toRadians(),n=(t[e+1].lon-t[e].lon).toRadians();i+=2*Math.atan2(Math.tan(n/2)*(Math.tan(a/2)+Math.tan(r/2)),1+Math.tan(a/2)*Math.tan(r/2))}(function(t){let e=0,a=t[0].initialBearingTo(t[1]);for(let r=0;r<t.length-1;r++){const n=t[r].initialBearingTo(t[r+1]),i=t[r].finalBearingTo(t[r+1]);e+=(n-a+540)%360-180,e+=(i-n+540)%360-180,a=i}const r=t[0].initialBearingTo(t[1]);e+=(r-a+540)%360-180;return Math.abs(e)<90})(t)&&(i=Math.abs(i)-2*u);const o=Math.abs(i*a*a);return r||t.pop(),o}equals(t){return t instanceof d||(t=d.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON)&&!(Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e=void 0){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${h.toLat(this.lat,t,e)}, ${h.toLon(this.lon,t,e)}`}}function p(t,e,a){if(null!==t)for(var r,n,i,o,s,l,c,h,u=0,d=0,g=t.type,f="FeatureCollection"===g,y="Feature"===g,m=f?t.features.length:1,v=0;v<m;v++){s=(h=!!(c=f?t.features[v].geometry:y?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var M=0;M<s;M++){var b=0,w=0;if(null!==(o=h?c.geometries[M]:c)){l=o.coordinates;var x=o.type;switch(u=0,x){case null:break;case"Point":if(!1===e(l,d,v,b,w))return!1;d++,b++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===e(l[r],d,v,b,w))return!1;d++,"MultiPoint"===x&&b++}"LineString"===x&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(n=0;n<l[r].length-u;n++){if(!1===e(l[r][n],d,v,b,w))return!1;d++}"MultiLineString"===x&&b++,"Polygon"===x&&w++}"Polygon"===x&&b++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(w=0,n=0;n<l[r].length;n++){for(i=0;i<l[r][n].length-u;i++){if(!1===e(l[r][n][i],d,v,b,w))return!1;d++}w++}b++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===p(o.geometries[r],e))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var g=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const a=[1/0,1/0,-1/0,-1/0];return p(t,t=>{a[0]>t[0]&&(a[0]=t[0]),a[1]>t[1]&&(a[1]=t[1]),a[2]<t[0]&&(a[2]=t[0]),a[3]<t[1]&&(a[3]=t[1])}),a},f=(t,e)=>{var[a,r]=t,[n,i]=e,o=new d(r,a),s=new d(i,n);return o.distanceTo(s)},y=t=>{var e=t/1609.344;if(e<.5)return"".concat(Math.round(t),"m");if(e<10){var a=Number.parseFloat(e.toFixed(1)),r=1===a?"mile":"miles";return"".concat(a," ").concat(r)}var n=Math.round(e);return"".concat(n," miles")},m=(t,e,a)=>{var[r,n]=e,i=a.filter(e=>{var[a,i]=e;return(a!==r||i!==n)&&((t,e,a)=>{switch(t){case"ArrowUp":return a<0&&Math.abs(a)>=Math.abs(e);case"ArrowDown":return a>0&&Math.abs(a)>=Math.abs(e);case"ArrowLeft":return e<0&&Math.abs(e)>Math.abs(a);case"ArrowRight":return e>0&&Math.abs(e)>Math.abs(a);default:return!1}})(t,a-r,i-n)});if(!i.length)return a.findIndex(t=>t[0]===r&&t[1]===n);var o=-1,s=1/0;return i.forEach(t=>{var e=t[0]-r,i=t[1]-n,l=e*e+i*i;l<s&&(s=l,o=a.indexOf(t))}),o},v=t=>g(t);function M(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,r)}return a}function b(e){for(var a=1;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?M(Object(r),!0).forEach(function(a){t(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var w="highlighted-label";function x(t,e){if("number"==typeof t)return t;if(!Array.isArray(t)||"interpolate"!==t[0])return function(t,e){var{stops:a}=t;if(a.length<2)return a.length>0?a[0][1]:0;for(var r=a[0],n=a[a.length-1],i=1;i<a.length;i++){var o=a[i];if(o[0]>e){n=o,r=a[i-1];break}r=a[i-1],n=o}var[s,l]=r,[c,h]=n;return e<=s?l:e>=c?h:l+(e-s)/(c-s)*(h-l)}(t,e);var[,,a,...r]=t;if("zoom"!==a[0])throw new Error("Only zoom-based expressions supported");for(var n=0;n<r.length-2;n+=2){var i=r[n],o=r[n+1],s=r[n+2],l=r[n+3];if(e<=i)return o;if(e<=s)return o+(e-i)/(s-i)*(l-o)}return r[r.length-1]}function P(t,e,a){return e.flatMap(e=>{var r,n=function(t){var e,a;return"string"==typeof t?null===(e=/^{(.+)}$/.exec(t))||void 0===e?void 0:e[1]:Array.isArray(t)?null===(a=t.find(t=>Array.isArray(t)&&"get"===t[0]))||void 0===a?void 0:a[1]:null}(null===(r=e.layout)||void 0===r?void 0:r["text-field"]);return n?a.filter(t=>{var a;return t.layer.id===e.id&&(null===(a=t.properties)||void 0===a?void 0:a[n])}).map(a=>function(t,e,a,r){var n=function(t){var{type:e,coordinates:a}=t;if("Point"===e)return a;if("MultiPoint"===e)return a[0];if(e.includes("LineString")){var r="LineString"===e?a:a[0];return[(r[0][0]+r[r.length-1][0])/2,(r[0][1]+r[r.length-1][1])/2]}if(e.includes("Polygon")){var n="Polygon"===e?a[0]:a[0][0],i=n.reduce((t,e)=>[t[0]+e[0],t[1]+e[1]],[0,0]);return[i[0]/n.length,i[1]/n.length]}return null}(t.geometry);if(!n)return null;var i=r.project({lng:n[0],lat:n[1]});return{text:t.properties[a],x:i.x,y:i.y,feature:t,layer:e}}(a,e,n,t)).filter(Boolean):[]})}function N(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function S(t,e,a){var r;if(null!=e&&null!==(r=e.feature)&&void 0!==r&&r.layer){N(t,a);var{feature:n,layer:i}=e;a.highlightLayerId="highlight-".concat(i.id);var{id:o,type:s,properties:l,geometry:c}=n;t.getSource(w).setData({id:o,type:s,properties:l,geometry:c}),a.highlightedExpr=i.layout["text-size"];var h=t.getZoom(),u=function(t,e,a){return{id:"highlight-".concat(t.id),type:t.type,source:w,layout:b(b({},t.layout),{},{"text-size":e,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:b(b({},t.paint),{},{"text-color":a.text,"text-halo-color":a.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})}}(i,1.5*x(a.highlightedExpr,h),a.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"});t.addLayer(u),t.moveLayer(a.highlightLayerId)}}function E(t){t.getSource(w)||t.addSource(w,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function L(t){t.getStyle().layers.filter(t=>{var e;return"line"===(null===(e=t.layout)||void 0===e?void 0:e["symbol-placement"])}).forEach(e=>t.setLayoutProperty(e.id,"symbol-placement","line-center"))}function R(t,e,a,r){var n={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function i(){var e=t.getStyle().layers.filter(t=>"symbol"===t.type),a=t.queryRenderedFeatures({layers:e.map(t=>t.id)});n.labels=P(t,e,a)}function o(){if(i(),!n.labels.length)return null;var e=t.project(t.getCenter()),a=function(t,e){var a;return null===(a=t.reduce((t,a)=>{var r=(a.x-e.x)**2+(a.y-e.y)**2;return!t||r<t.dist?{label:a,dist:r}:t},null))||void 0===a?void 0:a.label}(n.labels,e);return n.currentPixel={x:a.x,y:a.y},S(t,a,n),"".concat(a.text," (").concat(a.layer.id,")")}return L(t),E(t),null==r||r.on(a.MAP_SET_STYLE,e=>{t.once("styledata",()=>t.once("idle",()=>{L(t),E(t),n.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)}))}),t.on("zoom",()=>{if(n.highlightLayerId&&n.highlightedExpr){var e=x(n.highlightedExpr,t.getZoom());t.setLayoutProperty(n.highlightLayerId,"text-size",1.5*e)}}),function(t){t.getStyle().layers.filter(t=>"symbol"===t.type).forEach(e=>{t.setPaintProperty(e.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(t),{refreshLabels:i,highlightNextLabel:function(e){if(i(),!n.labels.length)return null;if(!n.currentPixel)return o();var a=function(t,e){if(!e.currentPixel)return null;var a=e.labels.map((t,e)=>({pixel:[t.x,t.y],index:e})).filter(t=>t.pixel[0]!==e.currentPixel.x||t.pixel[1]!==e.currentPixel.y);if(!a.length)return null;var r=a.map(t=>t.pixel),n=m(t,[e.currentPixel.x,e.currentPixel.y],r);return(null==n||n<0||n>=a.length)&&(n=0),e.labels[a[n].index]}(e,n);return a?(n.currentPixel={x:a.x,y:a.y},S(t,a,n),"".concat(a.text," (").concat(a.layer.id,")")):null},highlightLabelAtCenter:o,clearHighlightedLabel:()=>N(t,n)}}var I=t=>t.endsWith(".cold")?"".concat(t.slice(0,-5),".hot"):t.endsWith(".hot")?"".concat(t.slice(0,-4),".cold"):null;function O(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,r)}return a}function T(e){for(var a=1;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?O(Object(r),!0).forEach(function(a){t(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var A="icon-image",D="active-highlight",_="active-highlight-inner",j="selected-highlight",C=(t,e)=>{var a,r;return null!==(a=null===(r=t._activeSymbolImageMap)||void 0===r?void 0:r[e])&&void 0!==a?a:null},B=(t,e)=>{var a,r;return null!==(a=null===(r=t._selectedSymbolImageMap)||void 0===r?void 0:r[e])&&void 0!==a?a:null},k=(t,e,a,r)=>{var{featureId:n,idProperty:i,geometry:o}=r,s=t.getLayer(a);s&&(e[a]||(e[a]={ids:new Set,fillIds:new Set,idProperty:i,sourceId:s.source,hasFillGeometry:!1}),!o||"Polygon"!==o.type&&"MultiPolygon"!==o.type||(e[a].hasFillGeometry=!0,e[a].fillIds.add(n)),e[a].ids.add(n))},F=(t,e,a,r)=>{e.forEach(e=>{if(!a.has(e)){var n="".concat(r,"-").concat(e);["".concat(n,"-fill"),"".concat(n,"-line"),"".concat(n,"-symbol")].forEach(e=>{t.getLayer(e)&&t.setFilter(e,["==","id",""])})}})},z=(t,e)=>{var a="_".concat(e.replaceAll("-",""),"Sources");F(t,t[a]||new Set,new Set,e),t[a]=new Set},W=(t,e,a,r,n,i,o)=>{!!t.getLayer(e)||t.addLayer(T(T({id:e,type:a,source:r},n&&{"source-layer":n}),{},{paint:i})),Object.entries(i).forEach(a=>{var[r,n]=a;t.setPaintProperty(e,r,n)}),t.setFilter(e,o),t.moveLayer(e)},q=(t,e,a,r,n,i,o)=>{var s,l=t.getLayoutProperty(n,"icon-offset");t.getLayer(e)||t.addLayer(T(T({id:e,type:"symbol",source:a},r&&{"source-layer":r}),{},{layout:T(T({[A]:i,"icon-anchor":null!==(s=t.getLayoutProperty(n,"icon-anchor"))&&void 0!==s?s:"center"},void 0!==l&&{"icon-offset":l}),{},{"icon-allow-overlap":!0})}));t.setLayoutProperty(e,A,i),void 0!==l&&t.setLayoutProperty(e,"icon-offset",l),t.setFilter(e,o),t.moveLayer(e)},$=(t,e,a,r,n,i)=>{var o,{ids:s,fillIds:l,idProperty:c,sourceId:h,hasFillGeometry:u}=a[e],d=t.getLayer(e),p=null!==(o=r[e])&&void 0!==o?o:r[I(e)];if(d&&p){var g=d.sourceLayer,f=u?"fill":d.type,y="".concat(n,"-").concat(e),{fill:m}=p,v=n===j,M=(t=>t===j||t===_)(n),{lineColor:b,lineWidth:w}=((t,e)=>({lineColor:e?t.selectionStroke:t.stroke,lineWidth:e?t.strokeWidth:t.activeStrokeWidth}))(p,M),x=c?["get",c]:["id"],P=["in",x,["literal",Array.from(s)]];if("fill-extrusion"!==d.type)switch(f){case"fill":((t,e,a,r,n)=>{var{isSelected:i,idExpression:o,fillIds:s,fill:l,lineColor:c,lineWidth:h,filter:u}=n;if(i){var d=[];s.forEach(t=>d.push(t));var p=["in",o,["literal",d]];W(t,"".concat(e,"-fill"),"fill",a,r,{"fill-color":l},p)}W(t,"".concat(e,"-line"),"line",a,r,{"line-color":c,"line-width":h},u)})(t,y,h,g,{isSelected:v,idExpression:x,fillIds:l,fill:m,lineColor:b,lineWidth:w,filter:P});break;case"line":((t,e,a,r,n,i,o)=>{t.getLayer("".concat(e,"-fill"))&&t.setFilter("".concat(e,"-fill"),["==","id",""]),W(t,"".concat(e,"-line"),"line",a,r,{"line-color":n,"line-width":i},o)})(t,y,h,g,b,w,P);break;case"symbol":((t,e,a,r,n,i,o)=>{var s=t.getLayoutProperty(n,A);if(Array.isArray(s)){var l=o===C?"user_symbolActiveImageId":"user_symbolSelectedImageId";q(t,"".concat(e,"-symbol"),a,r,n,["get",l],i)}else{var c=o(t,s);c&&q(t,"".concat(e,"-symbol"),a,r,n,c,i)}})(t,y,h,g,e,P,i)}else((t,e,a,r)=>{var{ids:n,lineColor:i,lineWidth:o,idExpression:s}=r,l=[];n.forEach(t=>l.push(t));var c=["in",s,["literal",l]],{source:h,sourceLayer:u}=t.getLayer(a);W(t,"".concat(e,"-line"),"line",h,u,{"line-color":i,"line-width":o},c)})(t,y,e,{ids:s,lineColor:b,lineWidth:w,idExpression:x})}},Z=(t,e,a,r,n)=>{var i=((t,e)=>{var a={};return null==e||e.forEach(e=>{k(t,a,e.layerId,e);var r=I(e.layerId);r&&k(t,a,r,e)}),a})(t,e),o=new Set(Object.keys(i)),s="_".concat(r.replaceAll("-",""),"Sources"),l=t[s]||new Set;return F(t,l,o,r),t[s]=o,o.forEach(e=>$(t,e,i,a,r,n)),i};var G=(t,e,a)=>{var r=(e.x-a.x)**2+(e.y-a.y)**2;if(0===r)return(t.x-e.x)**2+(t.y-e.y)**2;var n=((t.x-e.x)*(a.x-e.x)+(t.y-e.y)*(a.y-e.y))/r;return n=Math.max(0,Math.min(1,n)),(t.x-(e.x+n*(a.x-e.x)))**2+(t.y-(e.y+n*(a.y-e.y)))**2},H=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{radius:r=10}=a,n=[[e.x-r,e.y-r],[e.x+r,e.y+r]],i=t.queryRenderedFeatures(n);if(0===i.length)return[];var o=new Set(t.queryRenderedFeatures([e.x,e.y]).map(t=>{var e,a=void 0===t.id?JSON.stringify(t.properties):t.id;return"".concat(null===(e=t.layer)||void 0===e?void 0:e.source,":").concat(a)})),s=[];i.forEach(t=>{!1===s.includes(t.layer.id)&&s.push(t.layer.id)});for(var l=new Set,c=[],h=i.length-1;h>=0;h--){var u,d=i[h],p=void 0===d.id?JSON.stringify(d.properties):d.id,g="".concat(null===(u=d.layer)||void 0===u?void 0:u.source,":").concat(p);!1===l.has(g)&&(l.add(g),c.push(d))}var f=t.unproject(e),y=[f.lng,f.lat],m=c.filter(t=>{var e=t.geometry.type;if(e.includes("Polygon"))return("Polygon"===e?[t.geometry.coordinates]:t.geometry.coordinates).some(t=>((t,e)=>{for(var[a,r]=t,n=!1,i=0,o=e.length-1;i<e.length;o=i,i++){var[s,l]=e[i],[c,h]=e[o];l>r!=h>r&&a<(c-s)*(r-l)/(h-l)+s&&(n=!n)}return n})(y,t[0]));if("Point"===e||"MultiPoint"===e){var a,r=void 0===t.id?JSON.stringify(t.properties):t.id;return o.has("".concat(null===(a=t.layer)||void 0===a?void 0:a.source,":").concat(r))}return!0});return m.map(a=>{var r=0,n=a.geometry.type,i=((t,e,a)=>{var{coordinates:r,type:n}=a,i=1/0,o=e=>t.project(e),s=t=>{for(var a=0;a<t.length-1;a++){var r=G(e,o(t[a]),o(t[a+1]));r<i&&(i=r)}};if("Point"===n){var l=o(r);i=(e.x-l.x)**2+(e.y-l.y)**2}else"LineString"===n||"MultiPoint"===n?"LineString"===n?s(r):r.forEach(t=>{var a=o(t),r=(e.x-a.x)**2+(e.y-a.y)**2;r<i&&(i=r)}):"Polygon"===n||"MultiLineString"===n?r.forEach(s):"MultiPolygon"===n&&r.forEach(t=>t.forEach(s));return i})(t,e,a.geometry);return r+=1e6*s.indexOf(a.layer.id),n.includes("Polygon")&&(r-=5e5),{f:a,score:r+=i}}).sort((t,e)=>t.score-e.score).map(t=>{var{f:e}=t;return e})},V=(t,e,a)=>{var r=t.getCanvas();if(a&&t.off("mousemove",a),null==e||!e.length)return r.style.cursor="",null;var n=a=>{var n=(t=>{var e=new Set(t);return t.forEach(t=>{var a=I(t);a&&e.add(a)}),[...e]})(e).filter(e=>t.getLayer(e));if(0!==n.length){var{lineLayers:i,otherLayers:o}=((t,e)=>{var a=[],r=[];for(var n of e)if("line"===t.getLayer(n).type){var i=n.endsWith("-stroke")?n.slice(0,-7):null;null!==i&&e.includes(i)||a.push(n)}else r.push(n);return{lineLayers:a,otherLayers:r}})(t,n),{x:s,y:l}=a.point,c=[[s-10,l-10],[s+10,l+10]],h=i.length>0&&t.queryRenderedFeatures(c,{layers:i}).length>0,u=o.length>0&&t.queryRenderedFeatures(a.point,{layers:o}).length>0;r.style.cursor=h||u?"pointer":""}else r.style.cursor=""};return t.on("mousemove",n),n},J=function(){var t=a(function*(t,e,r,n){var i,o,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2;e.length&&(null!==(i=t._activeSymbolImageMap)&&void 0!==i||(t._activeSymbolImageMap={}),null!==(o=t._selectedSymbolImageMap)&&void 0!==o||(t._selectedSymbolImageMap={}),yield Promise.all(e.flatMap(e=>{var i=n.getSymbolImageId(e,r,!1,s),o=n.getSymbolImageId(e,r,!0,s);return i&&o&&(t._activeSymbolImageMap[i]=o),["normal","active","selected"].map(function(){var l=a(function*(a){var l="active"===a?o:i;if("selected"===a||l&&!t.hasImage(l)){var c=yield n.rasteriseSymbolImage(e,r,a,s);c&&("selected"===a&&i&&(t._selectedSymbolImageMap[i]=c.imageId),t.hasImage(c.imageId)||t.addImage(c.imageId,c.imageData,{pixelRatio:s}))}});return function(t){return l.apply(this,arguments)}}())})))});return function(e,a,r,n){return t.apply(this,arguments)}}(),Y=t=>Math.max(2,2*t),K=(t,e)=>{if(!t)return null;if("string"==typeof t)return t.trim();if("object"==typeof t){if(e&&t[e])return t[e];var a=Object.values(t)[0];return null!=a?a:null}return null},U=new Map,X=function(){var t=a(function*(t,e,a,r){var n=a.getPatternInnerContent(t);if(!n)return null;var i=a.getPatternImageId(t,e,r);if(!i)return null;var o,s,l=U.get(i);if(!l){var c=K(t.fillPatternForegroundColor,e)||"black",h=K(t.fillPatternBackgroundColor,e)||"transparent",u=(o=c,s=h,n.replace(/\{\{foregroundColor\}\}/g,o||"black").replace(/\{\{backgroundColor\}\}/g,s||"transparent")),d='<rect width="16" height="16" fill="'.concat(h,'"/>'),p=Y(r),g=Math.round(8*p),f='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(g,'" height="').concat(g,'" viewBox="0 0 16 16">').concat(d).concat(u,"</svg>");l=yield((t,e,a)=>new Promise((r,n)=>{var i="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(t)),o=new Image(e,a);o.onload=()=>{var t=document.createElement("canvas");t.width=e,t.height=a;var n=t.getContext("2d");n.drawImage(o,0,0,e,a),r(n.getImageData(0,0,e,a))},o.onerror=()=>{n(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},o.src=i}))(f,g,g),U.set(i,l)}return{imageId:i,imageData:l}});return function(e,a,r,n){return t.apply(this,arguments)}}(),Q=function(){var t=a(function*(t,e,r,n,i){if(e.length){var o=Y(i),s=e.reduce((e,s)=>{var l=n.getPatternImageId(s,r,i);return!l||e[l]||t.hasImage(l)||(e[l]=a(function*(){var e=yield X(s,r,n,i);e&&!t.hasImage(e.imageId)&&t.addImage(e.imageId,e.imageData,{pixelRatio:o})})),e},{});yield Promise.all(Object.values(s).map(t=>t()))}});return function(e,a,r,n,i){return t.apply(this,arguments)}}(),tt=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function et(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,r)}return a}function at(e){for(var a=1;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?et(Object(r),!0).forEach(function(a){t(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}class rt extends r{constructor(t){var{mapFramework:e,mapProviderConfig:a={},events:r,eventBus:n}=t;super(),this.maplibreModule=e,this.events=r,this.eventBus=n,this.capabilities={supportedShortcuts:o,supportsMapSizes:!0},Object.assign(this,a)}get name(){return"MapLibreProvider"}initMap(t){var r=this;return a(function*(){var{container:a,padding:n,mapStyle:i,mapSize:o,center:s,zoom:c,bounds:h,pixelRatio:u}=t,d=e(t,tt);r.mapStyleId=null==i?void 0:i.id,r.mapSize=o;var{Map:p}=r.maplibreModule,{events:g,eventBus:f}=r,y=new p(at(at({},d),{},{container:a,style:null==i?void 0:i.url,pixelRatio:u,padding:n,center:s,zoom:c,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}));y.touchZoomRotate.disableRotation(),r.map=y,r.map.setPadding(n),h&&y.fitBounds(h,{duration:0}),function(t){var e=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){var a=t.getCanvas();if(a&&(this.target===a||a.contains(this.target)))return}e.call(this)}}(y),function(t){var e=t.getCanvas();e.removeAttribute("role"),e.setAttribute("tabindex",-1),e.removeAttribute("aria-label"),e.style.display="block",e.addEventListener("focus",t=>{e.blur(),t.relatedTarget&&t.relatedTarget.focus({preventScroll:!0})})}(y),l({map:y,events:g,eventBus:f,getCenter:r.getCenter.bind(r),getZoom:r.getZoom.bind(r),getBounds:r.getBounds.bind(r),getResolution:r.getResolution.bind(r)}),function(t){var{mapProvider:e,map:a,events:r,eventBus:n}=t,i=t=>{a.once("style.load",()=>{n.emit(r.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),a.setStyle(t.url,{diff:!1})},o=t=>{a.setPixelRatio(t)},s=t=>{var{mapSize:a}=t;e.mapSize=a};n.on(r.MAP_SET_STYLE,i),n.on(r.MAP_SET_PIXEL_RATIO,o),n.on(r.MAP_SIZE_CHANGE,s)}({mapProvider:r,map:y,events:g,eventBus:f}),y.on("load",()=>{r.labelNavigator=R(y,null==i?void 0:i.mapColorScheme,g,f)}),r.eventBus.emit(g.MAP_READY,{map:r.map,mapStyleId:r.mapStyleId,mapSize:r.mapSize,crs:r.crs})})()}isBaseMapReady(){var t;return Boolean(null===(t=this.map)||void 0===t?void 0:t.getStyle())}destroyMap(){var t,e;this.setHoverCursor([]),null===(t=this.mapEvents)||void 0===t||t.remove(),null===(e=this.appEvents)||void 0===e||e.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}setHoverCursor(t){this.map&&(this._onHoverMove=V(this.map,t,this._onHoverMove))}setView(t){var{center:e,zoom:a}=t;this.map.flyTo({center:e||this.getCenter(),zoom:a||this.getZoom(),duration:this.map.isStyleLoaded()?n:0})}zoomIn(t){this.map.easeTo({zoom:this.getZoom()+t,duration:n})}zoomOut(t){this.map.easeTo({zoom:this.getZoom()-t,duration:n})}panBy(t){this.map.panBy(t,{duration:n})}fitToBounds(t){var e=Array.isArray(t)?t:v(t),a=this.map.isStyleLoaded()?n:0;this.map.fitBounds(e,{duration:a})}setPadding(t){this.map.setPadding(t)}updateHighlightedFeatures(t,e,a){var{LngLatBounds:r}=this.maplibreModule;return function(t){var{LngLatBounds:e,map:a,selectedFeatures:r,activeFeatures:n,stylesMap:i}=t;if(!a)return null;null!=n&&n.length?(Z(a,n,i,D,C),Z(a,n,i,_,B)):(z(a,D),z(a,_));var o={};null!=r&&r.length?o=Z(a,r,i,j,B):z(a,j);var s=[];return Object.entries(o).forEach(t=>{var[e,{ids:r,idProperty:n}]=t;s.push(...a.queryRenderedFeatures({layers:[e]}).filter(t=>{var e;return r.has(n?null===(e=t.properties)||void 0===e?void 0:e[n]:t.id)}))}),((t,e)=>{if(!e.length)return null;var a=new t;return e.forEach(t=>{var e=t=>"number"==typeof t[0]?a.extend(t):t.forEach(e);e(t.geometry.coordinates)}),[a.getWest(),a.getSouth(),a.getEast(),a.getNorth()]})(e,s)}({LngLatBounds:r,map:this.map,selectedFeatures:t,activeFeatures:e,stylesMap:a})}highlightNextLabel(t){var e;return(null===(e=this.labelNavigator)||void 0===e?void 0:e.highlightNextLabel(t))||null}highlightLabelAtCenter(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.highlightLabelAtCenter())||null}clearHighlightedLabel(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.clearHighlightedLabel())||null}getCenter(){var t=this.map.getCenter();return[Number(t.lng.toFixed(i)),Number(t.lat.toFixed(i))]}getZoom(){return Number(this.map.getZoom().toFixed(i))}getBounds(){return this.map.getBounds().toArray().flat(1)}getFeaturesAtPoint(t,e){return H(this.map,t,e)}getVisibleFeatures(t){var e=t.filter(t=>this.map.getLayer(t));return e.length?this.map.queryRenderedFeatures(void 0,{layers:e}):[]}addSymbolsToMap(t,e,r){var n=this;return a(function*(){var a=n.map.getPixelRatio()||1;return J(n.map,t,e,r,a)})()}addPatternsToMap(t,e,r){var n=this;return a(function*(){var a=n.map.getPixelRatio()||1;return Q(n.map,t,e,r,a)})()}getAreaDimensions(){var{LngLatBounds:t}=this.maplibreModule;return(t=>{var e,a,r,n;if(t&&"function"==typeof t.getWest)e=t.getWest(),a=t.getSouth(),r=t.getEast(),n=t.getNorth();else{if(!Array.isArray(t)||2!==t.length)return"";[[e,a],[r,n]]=t}var i=f([e,a],[r,a]),o=f([e,a],[e,n]),s=y(i),l=y(o);return"".concat(l," by ").concat(s)})(((t,e)=>{var{width:a,height:r}=e.getContainer().getBoundingClientRect(),n=e.getPadding(),i=[n.left,r-n.bottom],o=[a-n.right,n.top];return new t(e.unproject(i),e.unproject(o))})(t,this.map))}getCardinalMove(t,e){return((t,e)=>{var[a,r]=t,[n,i]=e,o=i-r,s=n-a,l=[];if(Math.abs(o)>1e-4){var c=Math.round(f([a,r],[a,i]));l.push("".concat(o>0?"north":"south"," ").concat(y(c)))}if(Math.abs(s)>1e-4){var h=Math.round(f([a,r],[n,r]));l.push("".concat(s>0?"east":"west"," ").concat(y(h)))}return l.join(", ")})(t,e)}getResolution(){return t=this.map.getCenter(),e=this.map.getZoom(),a=t.lat,r=Math.pow(2,e),40075016.686*Math.cos(a*Math.PI/180)/(512*r);var t,e,a,r}mapToScreen(t){return this.map.project(t)}screenToMap(t){var{lng:e,lat:a}=this.map.unproject([t.x,t.y]);return[e,a]}isGeometryObscured(t,e){return((t,e,a)=>{var r=a.getContainer().getBoundingClientRect(),[n,i,o,s]=v(t),l=[a.project([n,i]),a.project([n,s]),a.project([o,i]),a.project([o,s])],c=Math.min(...l.map(t=>t.x)),h=Math.max(...l.map(t=>t.x)),u=Math.min(...l.map(t=>t.y)),d=Math.max(...l.map(t=>t.y)),p=e.left-r.left,g=e.top-r.top,f=e.right-r.left,y=e.bottom-r.top;return c<f&&h>p&&u<y&&d>g})(t,e,this.map)}}export{rt as default};
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see im-maplibre-provider.js.LICENSE.txt */
2
- "use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[772],{233(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}r.r(e),r.d(e,{default:()=>Zt});var i=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"isBaseMapReady",value:function(){throw new Error(this.name+" must implement isBaseMapReady()")}}])&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),u=400,l=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];function c(t){var e=t.getCanvas();e.removeAttribute("role"),e.setAttribute("tabindex",-1),e.removeAttribute("aria-label"),e.style.display="block",e.addEventListener("focus",function(t){e.blur(),t.relatedTarget&&t.relatedTarget.focus({preventScroll:!0})})}function s(t){var e=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){var r=t.getCanvas();if(r&&(this.target===r||r.contains(this.target)))return}e.call(this)}}var f=function(t,e){var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o)},e)};return n.cancel=function(){r&&(clearTimeout(r),r=null)},n};function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function p(t){var e=t.map,r=t.events,n=t.eventBus,o=t.getCenter,a=t.getZoom,i=t.getBounds,u=t.getResolution,l=[],c=[],s=function(){var t=a();return{center:o(),bounds:i(),resolution:u(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},p=function(t,e){return n.emit(t,e)},y=function(){return p(r.MAP_LOADED)};e.on("load",y),l.push(["load",y]),e.once("idle",function(){return p(r.MAP_FIRST_IDLE,s())});var d=function(){return p(r.MAP_MOVE_START)};e.on("movestart",d),l.push(["movestart",d]);var v=f(function(){p(r.MAP_MOVE_END,s())},500);e.on("moveend",v),l.push(["moveend",v]);var g,m,b=(g=function(){p(r.MAP_MOVE,s())},m=0,function(){var t=Date.now();t-m>=10&&(m=t,g.apply(void 0,arguments))});e.on("zoom",b),l.push(["zoom",b]);var M=function(){return p(r.MAP_RENDER)};e.on("render",M),l.push(["render",M]);var w=f(function(){p(r.MAP_DATA_CHANGE,s())},500),S=function(t){t.isSourceLoaded&&w()};e.on("styledata",w),e.on("sourcedata",S),l.push(["styledata",w],["sourcedata",S]);var P=function(){return p(r.MAP_STYLE_CHANGE)};e.on("style.load",P),l.push(["style.load",P]);var O=function(t){return p(r.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]})};return e.on("click",O),l.push(["click",O]),c.push(v,b,w),{remove:function(){c.forEach(function(t){return t.cancel()}),l.forEach(function(t){var r,n,o=(n=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(r,n)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],i=o[1];return e.off(a,i)})}}}function y(t){var e=t.mapProvider,r=t.map,n=t.events,o=t.eventBus,a=function(t){r.once("style.load",function(){o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),r.setStyle(t.url,{diff:!1})},i=function(t){r.setPixelRatio(t)},u=function(t){var r=t.mapSize;e.mapSize=r};return o.on(n.MAP_SET_STYLE,a),o.on(n.MAP_SET_PIXEL_RATIO,i),o.on(n.MAP_SIZE_CHANGE,u),{remove:function(){o.off(n.MAP_SET_STYLE,a),o.off(n.MAP_SET_PIXEL_RATIO,i),o.off(n.MAP_SIZE_CHANGE,u)}}}let d=" ";class v{static get separator(){return d}static set separator(t){d=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,o=null,a=null,i=null;switch(e){default:case"d":case"deg":o=t.toFixed(r),o<100&&(o="0"+o),o<10&&(o="0"+o),n=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),a=(60*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),o++),o=("000"+o).slice(-3),a<10&&(a="0"+a),n=o+"°"+v.separator+a+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),a=Math.floor(3600*t/60)%60,i=(3600*t%60).toFixed(r),60==i&&(i=(0).toFixed(r),a++),60==a&&(a=0,o++),o=("000"+o).slice(-3),a=("00"+a).slice(-2),i<10&&(i="0"+i),n=o+"°"+v.separator+a+"′"+v.separator+i+"″"}return n}static toLat(t,e,r){const n=v.toDms(v.wrap90(t),e,r);return null===n?"–":n.slice(1)+v.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=v.toDms(v.wrap180(t),e,r);return null===n?"–":n+v.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=v.toDms(v.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=v.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const g=v,m=Math.PI;class b{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=g.wrap90(Number(t)),this._lon=g.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?g.wrap90(g.parse(t)):g.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?g.wrap90(g.parse(t)):g.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,r;if(2==t.length&&([e,r]=t,e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,r]=t[0].split(","),e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){const n=t[0];if("Point"==n.type&&Array.isArray(n.coordinates)?[r,e]=n.coordinates:(null!=n.latitude&&(e=n.latitude),null!=n.lat&&(e=n.lat),null!=n.longitude&&(r=n.longitude),null!=n.lng&&(r=n.lng),null!=n.lon&&(r=n.lon),e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r))),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${t.toString()}’`);return new b(e,r)}distanceTo(t,e=6371e3){if(t instanceof b||(t=b.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);const r=e,n=this.lat.toRadians(),o=this.lon.toRadians(),a=t.lat.toRadians(),i=a-n,u=t.lon.toRadians()-o,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(n)*Math.cos(a)*Math.sin(u/2)*Math.sin(u/2);return r*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof b||(t=b.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),o=Math.cos(e)*Math.sin(r)-Math.sin(e)*Math.cos(r)*Math.cos(n),a=Math.sin(n)*Math.cos(r),i=Math.atan2(a,o).toDegrees();return g.wrap360(i)}finalBearingTo(t){t instanceof b||(t=b.parse(t));const e=t.initialBearingTo(this)+180;return g.wrap360(e)}midpointTo(t){t instanceof b||(t=b.parse(t));const e=this.lat.toRadians(),r=this.lon.toRadians(),n=t.lat.toRadians(),o=(t.lon-this.lon).toRadians(),a=Math.cos(e),i=Math.sin(e),u={x:a+Math.cos(n)*Math.cos(o),y:0+Math.cos(n)*Math.sin(o),z:i+Math.sin(n)},l=Math.atan2(u.z,Math.sqrt(u.x*u.x+u.y*u.y)),c=r+Math.atan2(u.y,u.x),s=l.toDegrees(),f=c.toDegrees();return new b(s,f)}intermediatePointTo(t,e){if(t instanceof b||(t=b.parse(t)),this.equals(t))return new b(this.lat,this.lon);const r=this.lat.toRadians(),n=this.lon.toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=o-r,u=a-n,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(r)*Math.cos(o)*Math.sin(u/2)*Math.sin(u/2),c=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),s=Math.sin((1-e)*c)/Math.sin(c),f=Math.sin(e*c)/Math.sin(c),h=s*Math.cos(r)*Math.cos(n)+f*Math.cos(o)*Math.cos(a),p=s*Math.cos(r)*Math.sin(n)+f*Math.cos(o)*Math.sin(a),y=s*Math.sin(r)+f*Math.sin(o),d=Math.atan2(y,Math.sqrt(h*h+p*p)),v=Math.atan2(p,h),g=d.toDegrees(),m=v.toDegrees();return new b(g,m)}destinationPoint(t,e,r=6371e3){const n=t/r,o=Number(e).toRadians(),a=this.lat.toRadians(),i=this.lon.toRadians(),u=Math.sin(a)*Math.cos(n)+Math.cos(a)*Math.sin(n)*Math.cos(o),l=Math.asin(u),c=Math.sin(o)*Math.sin(n)*Math.cos(a),s=Math.cos(n)-Math.sin(a)*u,f=i+Math.atan2(c,s),h=l.toDegrees(),p=f.toDegrees();return new b(h,p)}static intersection(t,e,r,n){if(t instanceof b||(t=b.parse(t)),r instanceof b||(r=b.parse(r)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(n))throw new TypeError(`invalid brng2 ‘${n}’`);const o=t.lat.toRadians(),a=t.lon.toRadians(),i=r.lat.toRadians(),u=r.lon.toRadians(),l=Number(e).toRadians(),c=Number(n).toRadians(),s=i-o,f=u-a,h=2*Math.asin(Math.sqrt(Math.sin(s/2)*Math.sin(s/2)+Math.cos(o)*Math.cos(i)*Math.sin(f/2)*Math.sin(f/2)));if(Math.abs(h)<Number.EPSILON)return new b(t.lat,t.lon);const p=(Math.sin(i)-Math.sin(o)*Math.cos(h))/(Math.sin(h)*Math.cos(o)),y=(Math.sin(o)-Math.sin(i)*Math.cos(h))/(Math.sin(h)*Math.cos(i)),d=Math.acos(Math.min(Math.max(p,-1),1)),v=Math.acos(Math.min(Math.max(y,-1),1)),g=l-(Math.sin(u-a)>0?d:2*m-d),M=(Math.sin(u-a)>0?2*m-v:v)-c;if(0==Math.sin(g)&&0==Math.sin(M))return null;if(Math.sin(g)*Math.sin(M)<0)return null;const w=-Math.cos(g)*Math.cos(M)+Math.sin(g)*Math.sin(M)*Math.cos(h),S=Math.atan2(Math.sin(h)*Math.sin(g)*Math.sin(M),Math.cos(M)+Math.cos(g)*w),P=Math.asin(Math.min(Math.max(Math.sin(o)*Math.cos(S)+Math.cos(o)*Math.sin(S)*Math.cos(l),-1),1)),O=a+Math.atan2(Math.sin(l)*Math.sin(S)*Math.cos(o),Math.cos(S)-Math.sin(o)*Math.sin(P)),x=P.toDegrees(),E=O.toDegrees();return new b(x,E)}crossTrackDistanceTo(t,e,r=6371e3){t instanceof b||(t=b.parse(t)),e instanceof b||(e=b.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(o)*Math.sin(a-i))*n}alongTrackDistanceTo(t,e,r=6371e3){t instanceof b||(t=b.parse(t)),e instanceof b||(e=b.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians(),u=Math.asin(Math.sin(o)*Math.sin(a-i));return Math.acos(Math.cos(o)/Math.abs(Math.cos(u)))*Math.sign(Math.cos(i-a))*n}maxLatitude(t){const e=Number(t).toRadians(),r=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(r))).toDegrees()}static crossingParallels(t,e,r){if(t.equals(e))return null;const n=Number(r).toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=e.lat.toRadians(),u=e.lon.toRadians()-a,l=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.sin(u),c=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.cos(u)-Math.cos(o)*Math.sin(i)*Math.cos(n),s=Math.cos(o)*Math.cos(i)*Math.sin(n)*Math.sin(u);if(s*s>l*l+c*c)return null;const f=Math.atan2(-c,l),h=Math.acos(s/Math.sqrt(l*l+c*c)),p=a+f+h,y=(a+f-h).toDegrees(),d=p.toDegrees();return{lon1:g.wrap180(y),lon2:g.wrap180(d)}}rhumbDistanceTo(t,e=6371e3){t instanceof b||(t=b.parse(t));const r=e,n=this.lat.toRadians(),o=t.lat.toRadians(),a=o-n;let i=Math.abs(t.lon-this.lon).toRadians();Math.abs(i)>m&&(i=i>0?-(2*m-i):2*m+i);const u=Math.log(Math.tan(o/2+m/4)/Math.tan(n/2+m/4)),l=Math.abs(u)>1e-11?a/u:Math.cos(n);return Math.sqrt(a*a+l*l*i*i)*r}rhumbBearingTo(t){if(t instanceof b||(t=b.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians();let n=(t.lon-this.lon).toRadians();Math.abs(n)>m&&(n=n>0?-(2*m-n):2*m+n);const o=Math.log(Math.tan(r/2+m/4)/Math.tan(e/2+m/4)),a=Math.atan2(n,o).toDegrees();return g.wrap360(a)}rhumbDestinationPoint(t,e,r=6371e3){const n=this.lat.toRadians(),o=this.lon.toRadians(),a=Number(e).toRadians(),i=t/r,u=i*Math.cos(a);let l=n+u;Math.abs(l)>m/2&&(l=l>0?m-l:-m-l);const c=Math.log(Math.tan(l/2+m/4)/Math.tan(n/2+m/4)),s=Math.abs(c)>1e-11?u/c:Math.cos(n),f=o+i*Math.sin(a)/s,h=l.toDegrees(),p=f.toDegrees();return new b(h,p)}rhumbMidpointTo(t){t instanceof b||(t=b.parse(t));const e=this.lat.toRadians();let r=this.lon.toRadians();const n=t.lat.toRadians(),o=t.lon.toRadians();Math.abs(o-r)>m&&(r+=2*m);const a=(e+n)/2,i=Math.tan(m/4+e/2),u=Math.tan(m/4+n/2),l=Math.tan(m/4+a/2);let c=((o-r)*Math.log(l)+r*Math.log(u)-o*Math.log(i))/Math.log(u/i);isFinite(c)||(c=(r+o)/2);const s=a.toDegrees(),f=c.toDegrees();return new b(s,f)}static areaOf(t,e=6371e3){const r=e,n=t[0].equals(t[t.length-1]);n||t.push(t[0]);const o=t.length-1;let a=0;for(let e=0;e<o;e++){const r=t[e].lat.toRadians(),n=t[e+1].lat.toRadians(),o=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(o/2)*(Math.tan(r/2)+Math.tan(n/2)),1+Math.tan(r/2)*Math.tan(n/2))}(function(t){let e=0,r=t[0].initialBearingTo(t[1]);for(let n=0;n<t.length-1;n++){const o=t[n].initialBearingTo(t[n+1]),a=t[n].finalBearingTo(t[n+1]);e+=(o-r+540)%360-180,e+=(a-o+540)%360-180,r=a}return e+=(t[0].initialBearingTo(t[1])-r+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*m);const i=Math.abs(a*r*r);return n||t.pop(),i}equals(t){return t instanceof b||(t=b.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e=void 0){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`):`${g.toLat(this.lat,t,e)}, ${g.toLon(this.lon,t,e)}`}}function M(t,e,r){if(null!==t)for(var n,o,a,i,u,l,c,s,f=0,h=0,p=t.type,y="FeatureCollection"===p,d="Feature"===p,v=y?t.features.length:1,g=0;g<v;g++){u=(s=!!(c=y?t.features[g].geometry:d?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var m=0;m<u;m++){var b=0,w=0;if(null!==(i=s?c.geometries[m]:c)){l=i.coordinates;var S=i.type;switch(f=!r||"Polygon"!==S&&"MultiPolygon"!==S?0:1,S){case null:break;case"Point":if(!1===e(l,h,g,b,w))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],h,g,b,w))return!1;h++,"MultiPoint"===S&&b++}"LineString"===S&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-f;o++){if(!1===e(l[n][o],h,g,b,w))return!1;h++}"MultiLineString"===S&&b++,"Polygon"===S&&w++}"Polygon"===S&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(w=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-f;a++){if(!1===e(l[n][o][a],h,g,b,w))return!1;h++}w++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===M(i.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var w=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const r=[1/0,1/0,-1/0,-1/0];return M(t,t=>{r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])}),r};function S(t){return function(t){if(Array.isArray(t))return x(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||O(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||O(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){if(t){if("string"==typeof t)return x(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var E=function(t,e){var r=P(t,2),n=r[0],o=r[1],a=P(e,2),i=a[0],u=a[1],l=new b(o,n),c=new b(u,i);return l.distanceTo(c)},j=function(t){var e=t/1609.344;if(e<.5)return"".concat(Math.round(t),"m");if(e<10){var r=Number.parseFloat(e.toFixed(1)),n=1===r?"mile":"miles";return"".concat(r," ").concat(n)}var o=Math.round(e);return"".concat(o," miles")},N=function(t){return w(t)};function A(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function L(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function k(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?L(Object(r),!0).forEach(function(e){R(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function R(t,e,r){return(e=function(t){var e=function(t){if("object"!=I(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==I(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var C="highlighted-label";function D(t,e){if("number"==typeof t)return t;if(!Array.isArray(t)||"interpolate"!==t[0])return function(t,e){var r=t.stops;if(r.length<2)return r.length>0?r[0][1]:0;for(var n=r[0],o=r[r.length-1],a=1;a<r.length;a++){var i=r[a];if(i[0]>e){o=i,n=r[a-1];break}n=r[a-1],o=i}var u=A(n,2),l=u[0],c=u[1],s=A(o,2),f=s[0],h=s[1];return e<=l?c:e>=f?h:c+(e-l)/(f-l)*(h-c)}(t,e);var r,n=function(t){if(Array.isArray(t))return t}(r=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=n[2],a=_(n).slice(3);if("zoom"!==o[0])throw new Error("Only zoom-based expressions supported");for(var i=0;i<a.length-2;i+=2){var u=a[i],l=a[i+1],c=a[i+2],s=a[i+3];if(e<=u)return l;if(e<=c)return l+(e-u)/(c-u)*(s-l)}return a[a.length-1]}function F(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function B(t,e,r){var n,o,a,i;if(null!=e&&null!==(n=e.feature)&&void 0!==n&&n.layer){F(t,r);var u=e.feature,l=e.layer;r.highlightLayerId="highlight-".concat(l.id);var c=u.id,s=u.type,f=u.properties,h=u.geometry;t.getSource(C).setData({id:c,type:s,properties:f,geometry:h}),r.highlightedExpr=l.layout["text-size"];var p=t.getZoom(),y=(o=l,a=1.5*D(r.highlightedExpr,p),i=r.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"},{id:"highlight-".concat(o.id),type:o.type,source:C,layout:k(k({},o.layout),{},{"text-size":a,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:k(k({},o.paint),{},{"text-color":i.text,"text-halo-color":i.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})});t.addLayer(y),t.moveLayer(r.highlightLayerId)}}function G(t){t.getSource(C)||t.addSource(C,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function $(t){t.getStyle().layers.filter(function(t){var e;return"line"===(null===(e=t.layout)||void 0===e?void 0:e["symbol-placement"])}).forEach(function(e){return t.setLayoutProperty(e.id,"symbol-placement","line-center")})}function z(t,e,r,n){var o={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function a(){var e=t.getStyle().layers.filter(function(t){return"symbol"===t.type}),r=t.queryRenderedFeatures({layers:e.map(function(t){return t.id})});o.labels=function(t,e,r){return e.flatMap(function(e){var n,o,a,i,u="string"==typeof(o=null===(n=e.layout)||void 0===n?void 0:n["text-field"])?null===(a=/^{(.+)}$/.exec(o))||void 0===a?void 0:a[1]:Array.isArray(o)?null===(i=o.find(function(t){return Array.isArray(t)&&"get"===t[0]}))||void 0===i?void 0:i[1]:null;return u?r.filter(function(t){var r;return t.layer.id===e.id&&(null===(r=t.properties)||void 0===r?void 0:r[u])}).map(function(r){return function(t,e,r,n){var o=function(t){var e=t.type,r=t.coordinates;if("Point"===e)return r;if("MultiPoint"===e)return r[0];if(e.includes("LineString")){var n="LineString"===e?r:r[0];return[(n[0][0]+n[n.length-1][0])/2,(n[0][1]+n[n.length-1][1])/2]}if(e.includes("Polygon")){var o="Polygon"===e?r[0]:r[0][0],a=o.reduce(function(t,e){return[t[0]+e[0],t[1]+e[1]]},[0,0]);return[a[0]/o.length,a[1]/o.length]}return null}(t.geometry);if(!o)return null;var a=n.project({lng:o[0],lat:o[1]});return{text:t.properties[r],x:a.x,y:a.y,feature:t,layer:e}}(r,e,u,t)}).filter(Boolean):[]})}(t,e,r)}function i(){if(a(),!o.labels.length)return null;var e=t.project(t.getCenter()),r=function(t,e){var r;return null===(r=t.reduce(function(t,r){var n=Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2);return!t||n<t.dist?{label:r,dist:n}:t},null))||void 0===r?void 0:r.label}(o.labels,e);return o.currentPixel={x:r.x,y:r.y},B(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")}return $(t),G(t),null==n||n.on(r.MAP_SET_STYLE,function(e){t.once("styledata",function(){return t.once("idle",function(){$(t),G(t),o.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)})})}),t.on("zoom",function(){if(o.highlightLayerId&&o.highlightedExpr){var e=D(o.highlightedExpr,t.getZoom());t.setLayoutProperty(o.highlightLayerId,"text-size",1.5*e)}}),function(t){t.getStyle().layers.filter(function(t){return"symbol"===t.type}).forEach(function(e){t.setPaintProperty(e.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(t),{refreshLabels:a,highlightNextLabel:function(e){if(a(),!o.labels.length)return null;if(!o.currentPixel)return i();var r=function(t,e){if(!e.currentPixel)return null;var r=e.labels.map(function(t,e){return{pixel:[t.x,t.y],index:e}}).filter(function(t){return t.pixel[0]!==e.currentPixel.x||t.pixel[1]!==e.currentPixel.y});if(!r.length)return null;var n=r.map(function(t){return t.pixel}),o=function(t,e,r){var n=P(e,2),o=n[0],a=n[1],i=r.filter(function(e){var r=P(e,2),n=r[0],i=r[1];return(n!==o||i!==a)&&function(t,e,r){switch(t){case"ArrowUp":return r<0&&Math.abs(r)>=Math.abs(e);case"ArrowDown":return r>0&&Math.abs(r)>=Math.abs(e);case"ArrowLeft":return e<0&&Math.abs(e)>Math.abs(r);case"ArrowRight":return e>0&&Math.abs(e)>Math.abs(r);default:return!1}}(t,n-o,i-a)});if(!i.length)return r.findIndex(function(t){return t[0]===o&&t[1]===a});var u=-1,l=1/0;return i.forEach(function(t){var e=t[0]-o,n=t[1]-a,i=e*e+n*n;i<l&&(l=i,u=r.indexOf(t))}),u}(t,[e.currentPixel.x,e.currentPixel.y],n);return(null==o||o<0||o>=r.length)&&(o=0),e.labels[r[o].index]}(e,o);return r?(o.currentPixel={x:r.x,y:r.y},B(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")):null},highlightLabelAtCenter:i,clearHighlightedLabel:function(){return F(t,o)}}}function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function W(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||Z(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(t,e){if(t){if("string"==typeof t)return H(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?H(t,e):void 0}}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function V(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?U(Object(r),!0).forEach(function(e){Y(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Y(t,e,r){return(e=function(t){var e=function(t){if("object"!=q(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=q(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==q(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var J="icon-image",K="active-highlight",X="active-highlight-inner",Q="selected-highlight",tt=function(t,e){var r,n;return null!==(r=null===(n=t._activeSymbolImageMap)||void 0===n?void 0:n[e])&&void 0!==r?r:null},et=function(t,e){var r,n;return null!==(r=null===(n=t._selectedSymbolImageMap)||void 0===n?void 0:n[e])&&void 0!==r?r:null},rt=function(t,e,r,n){e.forEach(function(e){if(!r.has(e)){var o="".concat(n,"-").concat(e);["".concat(o,"-fill"),"".concat(o,"-line"),"".concat(o,"-symbol")].forEach(function(e){t.getLayer(e)&&t.setFilter(e,["==","id",""])})}})},nt=function(t,e){var r="_".concat(e.replaceAll("-",""),"Sources");rt(t,t[r]||new Set,new Set,e),t[r]=new Set},ot=function(t,e,r,n,o,a,i){!!t.getLayer(e)||t.addLayer(V(V({id:e,type:r,source:n},o&&{"source-layer":o}),{},{paint:a})),Object.entries(a).forEach(function(r){var n=W(r,2),o=n[0],a=n[1];t.setPaintProperty(e,o,a)}),t.setFilter(e,i),t.moveLayer(e)},at=function(t,e,r,n,o,a){var i=r[e],u=i.ids,l=i.fillIds,c=i.idProperty,s=i.layerId,f=i.hasFillGeometry,h=t.getLayer(s);if(h&&n[s]){var p=n[s],y=h.sourceLayer,d=f?"fill":h.type,v="".concat(o,"-").concat(e),g=p.fill,m=o===Q,b=function(t){return t===Q||t===X}(o),M=function(t,e){return{lineColor:e?t.selectionStroke:t.stroke,lineWidth:e?t.strokeWidth:t.activeStrokeWidth}}(p,b),w=M.lineColor,S=M.lineWidth,P=c?["get",c]:["id"],O=["in",P,["literal",Array.from(u)]];if("fill-extrusion"!==h.type)switch(d){case"fill":!function(t,e,r,n,o){var a=o.idExpression,i=o.fill,u=o.lineColor,l=o.lineWidth,c=o.filter;if(o.isSelected){var s=[];o.fillIds.forEach(function(t){return s.push(t)});var f=["in",a,["literal",s]];ot(t,"".concat(e,"-fill"),"fill",r,n,{"fill-color":i},f)}ot(t,"".concat(e,"-line"),"line",r,n,{"line-color":u,"line-width":l},c)}(t,v,e,y,{isSelected:m,idExpression:P,fillIds:l,fill:g,lineColor:w,lineWidth:S,filter:O});break;case"line":!function(t,e,r,n,o,a,i){t.getLayer("".concat(e,"-fill"))&&t.setFilter("".concat(e,"-fill"),["==","id",""]),ot(t,"".concat(e,"-line"),"line",r,n,{"line-color":o,"line-width":a},i)}(t,v,e,y,w,S,O);break;case"symbol":!function(t,e,r,n,o,a,i){!function(t,e,r,n,o,a,i){var u=t.getLayoutProperty(o,J),l=i(t,u);l&&function(t,e,r,n,o,a,i){var u;t.getLayer(e)||t.addLayer(V(V({id:e,type:"symbol",source:r},n&&{"source-layer":n}),{},{layout:Y(Y(Y({},J,a),"icon-anchor",null!==(u=t.getLayoutProperty(o,"icon-anchor"))&&void 0!==u?u:"center"),"icon-allow-overlap",!0)})),t.setLayoutProperty(e,J,a),t.setFilter(e,i),t.moveLayer(e)}(t,"".concat(e,"-symbol"),r,n,o,l,a)}(t,e,r,n,o,a,i)}(t,v,e,y,s,O,a)}else!function(t,e,r,n){var o=n.lineColor,a=n.lineWidth,i=n.idExpression,u=[];n.ids.forEach(function(t){return u.push(t)});var l=["in",i,["literal",u]],c=t.getLayer(r),s=c.source,f=c.sourceLayer;ot(t,"".concat(e,"-line"),"line",s,f,{"line-color":o,"line-width":a},l)}(t,v,s,{ids:u,lineColor:w,lineWidth:S,idExpression:P})}},it=function(t,e,r,n,o){var a=function(t,e){var r={};return null==e||e.forEach(function(e){var n=e.featureId,o=e.layerId,a=e.idProperty,i=e.geometry,u=t.getLayer(o);if(u){var l=u.source;r[l]||(r[l]={ids:new Set,fillIds:new Set,idProperty:a,layerId:o,hasFillGeometry:!1}),!i||"Polygon"!==i.type&&"MultiPolygon"!==i.type||(r[l].hasFillGeometry=!0,r[l].fillIds.add(n)),r[l].ids.add(n)}}),r}(t,e),i=new Set(Object.keys(a)),u="_".concat(n.replaceAll("-",""),"Sources"),l=t[u]||new Set;return rt(t,l,i,n),t[u]=i,i.forEach(function(e){return at(t,e,a,r,n,o)}),a};function ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return lt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ct=function(t,e,r){var n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);if(0===n)return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2);var o=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return o=Math.max(0,Math.min(1,o)),Math.pow(t.x-(e.x+o*(r.x-e.x)),2)+Math.pow(t.y-(e.y+o*(r.y-e.y)),2)};function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ft=function(t,e,r){var n=t.getCanvas();if(r&&t.off("mousemove",r),null==e||!e.length)return n.style.cursor="",null;var o=function(r){var o=e.filter(function(e){return t.getLayer(e)});if(0!==o.length){var a=function(t,e){var r,n=[],o=[],a=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return st(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?st(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}(e);try{for(a.s();!(r=a.n()).done;){var i=r.value;if("line"===t.getLayer(i).type){var u=i.endsWith("-stroke")?i.slice(0,-7):null;null!==u&&e.includes(u)||n.push(i)}else o.push(i)}}catch(t){a.e(t)}finally{a.f()}return{lineLayers:n,otherLayers:o}}(t,o),i=a.lineLayers,u=a.otherLayers,l=r.point,c=l.x,s=l.y,f=[[c-10,s-10],[c+10,s+10]],h=i.length>0&&t.queryRenderedFeatures(f,{layers:i}).length>0,p=u.length>0&&t.queryRenderedFeatures(r.point,{layers:u}).length>0;n.style.cursor=h||p?"pointer":""}else n.style.cursor=""};return t.on("mousemove",o),o};function ht(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return pt(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(pt(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,pt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,pt(f,"constructor",c),pt(c,"constructor",l),l.displayName="GeneratorFunction",pt(c,o,"GeneratorFunction"),pt(f),pt(f,o,"Generator"),pt(f,n,function(){return this}),pt(f,"toString",function(){return"[object Generator]"}),(ht=function(){return{w:a,m:h}})()}function pt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}pt=function(t,e,r,n){function a(e,r){pt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},pt(t,e,r,n)}function yt(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function dt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){yt(a,n,o,i,u,"next",t)}function u(t){yt(a,n,o,i,u,"throw",t)}i(void 0)})}}var vt=function(){var t=dt(ht().m(function t(e,r,n,o){var a,i=arguments;return ht().w(function(t){for(;;)switch(t.n){case 0:if(a=i.length>4&&void 0!==i[4]?i[4]:2,r.length){t.n=1;break}return t.a(2);case 1:return e._activeSymbolImageMap={},e._selectedSymbolImageMap={},t.n=2,Promise.all(r.flatMap(function(t){var r=o.getSymbolImageId(t,n,!1,a),i=o.getSymbolImageId(t,n,!0,a);return r&&i&&(e._activeSymbolImageMap[r]=i),["normal","active","selected"].map(function(){var u=dt(ht().m(function u(l){var c,s;return ht().w(function(u){for(;;)switch(u.n){case 0:if(c="active"===l?i:r,"selected"===l||c&&!e.hasImage(c)){u.n=1;break}return u.a(2);case 1:return u.n=2,o.rasteriseSymbolImage(t,n,l,a);case 2:(s=u.v)&&("selected"===l&&r&&(e._selectedSymbolImageMap[r]=s.imageId),e.hasImage(s.imageId)||e.addImage(s.imageId,s.imageData,{pixelRatio:a}));case 3:return u.a(2)}},u)}));return function(t){return u.apply(this,arguments)}}())}));case 2:return t.a(2)}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}(),gt=function(t){return Math.max(2,2*t)},mt=function(t,e,r){return t.replace(/\{\{foregroundColor\}\}/g,e||"black").replace(/\{\{backgroundColor\}\}/g,r||"transparent")};function bt(t){return bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bt(t)}var Mt=function(t,e){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===bt(t)){if(e&&t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null},wt=function(t,e,r){return new Promise(function(n,o){var a="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(t)),i=new Image(e,r);i.onload=function(){var t=document.createElement("canvas");t.width=e,t.height=r;var o=t.getContext("2d");o.drawImage(i,0,0,e,r),n(o.getImageData(0,0,e,r))},i.onerror=function(){o(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},i.src=a})};function St(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return Pt(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(Pt(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Pt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,Pt(f,"constructor",c),Pt(c,"constructor",l),l.displayName="GeneratorFunction",Pt(c,o,"GeneratorFunction"),Pt(f),Pt(f,o,"Generator"),Pt(f,n,function(){return this}),Pt(f,"toString",function(){return"[object Generator]"}),(St=function(){return{w:a,m:h}})()}function Pt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Pt=function(t,e,r,n){function a(e,r){Pt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},Pt(t,e,r,n)}function Ot(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function xt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){Ot(a,n,o,i,u,"next",t)}function u(t){Ot(a,n,o,i,u,"throw",t)}i(void 0)})}}var Et=new Map,jt=function(){var t=xt(St().m(function t(e,r,n,o){var a,i,u,l,c,s,f,h,p,y;return St().w(function(t){for(;;)switch(t.n){case 0:if(a=n.getPatternInnerContent(e)){t.n=1;break}return t.a(2,null);case 1:if(i=n.getPatternImageId(e,r,o)){t.n=2;break}return t.a(2,null);case 2:if(u=Et.get(i)){t.n=4;break}return l=Mt(e.fillPatternForegroundColor,r)||"black",c=Mt(e.fillPatternBackgroundColor,r)||"transparent",s=mt(a,l,c),f='<rect width="16" height="16" fill="'.concat(c,'"/>'),h=gt(o),p=Math.round(8*h),y='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(p,'" height="').concat(p,'" viewBox="0 0 16 16">').concat(f).concat(s,"</svg>"),t.n=3,wt(y,p,p);case 3:u=t.v,Et.set(i,u);case 4:return t.a(2,{imageId:i,imageData:u})}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}(),Nt=function(){var t=xt(St().m(function t(e,r,n,o,a){var i,u;return St().w(function(t){for(;;)switch(t.n){case 0:if(r.length){t.n=1;break}return t.a(2);case 1:return i=gt(a),u=r.reduce(function(t,r){var u=o.getPatternImageId(r,n,a);return!u||t[u]||e.hasImage(u)||(t[u]=xt(St().m(function t(){var u;return St().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,jt(r,n,o,a);case 1:(u=t.v)&&!e.hasImage(u.imageId)&&e.addImage(u.imageId,u.imageData,{pixelRatio:i});case 2:return t.a(2)}},t)}))),t},{}),t.n=2,Promise.all(Object.values(u).map(function(t){return t()}));case 2:return t.a(2)}},t)}));return function(e,r,n,o,a){return t.apply(this,arguments)}}();function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}var Tt=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function It(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return Lt(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(Lt(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Lt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,Lt(f,"constructor",c),Lt(c,"constructor",l),l.displayName="GeneratorFunction",Lt(c,o,"GeneratorFunction"),Lt(f),Lt(f,o,"Generator"),Lt(f,n,function(){return this}),Lt(f,"toString",function(){return"[object Generator]"}),(It=function(){return{w:a,m:h}})()}function Lt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Lt=function(t,e,r,n){function a(e,r){Lt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},Lt(t,e,r,n)}function kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Rt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?kt(Object(r),!0).forEach(function(e){_t(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _t(t,e,r){return(e=Gt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ct(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Dt(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function Ft(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){Dt(a,n,o,i,u,"next",t)}function u(t){Dt(a,n,o,i,u,"throw",t)}i(void 0)})}}function Bt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Gt(n.key),n)}}function Gt(t){var e=function(t){if("object"!=At(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=At(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==At(e)?e:e+""}function $t(t,e,r){return e=qt(e),function(t,e){if(e&&("object"==At(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zt()?Reflect.construct(e,r||[],qt(t).constructor):e.apply(t,r))}function zt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zt=function(){return!!t})()}function qt(t){return qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qt(t)}function Wt(t,e){return Wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wt(t,e)}var Zt=function(t){function e(t){var r,n=t.mapFramework,o=t.mapProviderConfig,a=void 0===o?{}:o,i=t.events,u=t.eventBus;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=$t(this,e)).maplibreModule=n,r.events=i,r.eventBus=u,r.capabilities={supportedShortcuts:l,supportsMapSizes:!0},Object.assign(r,a),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wt(t,e)}(e,t),r=e,n=[{key:"name",get:function(){return"MapLibreProvider"}},{key:"initMap",value:(i=Ft(It().m(function t(e){var r,n,o,a,i,u,l,f,h,d,v,g,m,b=this;return It().w(function(t){for(;;)switch(t.n){case 0:r=e.container,n=e.padding,o=e.mapStyle,a=e.mapSize,i=e.center,u=e.zoom,l=e.bounds,f=e.pixelRatio,h=Ct(e,Tt),this.mapStyleId=null==o?void 0:o.id,this.mapSize=a,d=this.maplibreModule.Map,v=this.events,g=this.eventBus,(m=new d(Rt(Rt({},h),{},{container:r,style:null==o?void 0:o.url,pixelRatio:f,padding:n,center:i,zoom:u,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}))).touchZoomRotate.disableRotation(),this.map=m,this.map.setPadding(n),l&&m.fitBounds(l,{duration:0}),s(m),c(m),p({map:m,events:v,eventBus:g,getCenter:this.getCenter.bind(this),getZoom:this.getZoom.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),y({mapProvider:this,map:m,events:v,eventBus:g}),m.on("load",function(){b.labelNavigator=z(m,null==o?void 0:o.mapColorScheme,v,g)}),this.eventBus.emit(v.MAP_READY,{map:this.map,mapStyleId:this.mapStyleId,mapSize:this.mapSize,crs:this.crs});case 1:return t.a(2)}},t,this)})),function(t){return i.apply(this,arguments)})},{key:"isBaseMapReady",value:function(){var t;return Boolean(null===(t=this.map)||void 0===t?void 0:t.getStyle())}},{key:"destroyMap",value:function(){var t,e;this.setHoverCursor([]),null===(t=this.mapEvents)||void 0===t||t.remove(),null===(e=this.appEvents)||void 0===e||e.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}},{key:"setHoverCursor",value:function(t){this.map&&(this._onHoverMove=ft(this.map,t,this._onHoverMove))}},{key:"setView",value:function(t){var e=t.center,r=t.zoom;this.map.flyTo({center:e||this.getCenter(),zoom:r||this.getZoom(),duration:this.map.isStyleLoaded()?u:0})}},{key:"zoomIn",value:function(t){this.map.easeTo({zoom:this.getZoom()+t,duration:u})}},{key:"zoomOut",value:function(t){this.map.easeTo({zoom:this.getZoom()-t,duration:u})}},{key:"panBy",value:function(t){this.map.panBy(t,{duration:u})}},{key:"fitToBounds",value:function(t){var e=Array.isArray(t)?t:N(t),r=this.map.isStyleLoaded()?u:0;this.map.fitBounds(e,{duration:r})}},{key:"setPadding",value:function(t){this.map.setPadding(t)}},{key:"updateHighlightedFeatures",value:function(t,e,r){return function(t){var e=t.LngLatBounds,r=t.map,n=t.selectedFeatures,o=t.activeFeatures,a=t.stylesMap;if(!r)return null;null!=o&&o.length?(it(r,o,a,K,tt),it(r,o,a,X,et)):(nt(r,K),nt(r,X));var i={};null!=n&&n.length?i=it(r,n,a,Q,et):nt(r,Q);var u=[];return Object.entries(i).forEach(function(t){var e=W(t,2)[1],n=e.ids,o=e.idProperty,a=e.layerId;u.push.apply(u,function(t){return function(t){if(Array.isArray(t))return H(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Z(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r.queryRenderedFeatures({layers:[a]}).filter(function(t){var e;return n.has(o?null===(e=t.properties)||void 0===e?void 0:e[o]:t.id)})))}),function(t,e){if(!e.length)return null;var r=new t;return e.forEach(function(t){var e=function(t){return"number"==typeof t[0]?r.extend(t):t.forEach(e)};e(t.geometry.coordinates)}),[r.getWest(),r.getSouth(),r.getEast(),r.getNorth()]}(e,u)}({LngLatBounds:this.maplibreModule.LngLatBounds,map:this.map,selectedFeatures:t,activeFeatures:e,stylesMap:r})}},{key:"highlightNextLabel",value:function(t){var e;return(null===(e=this.labelNavigator)||void 0===e?void 0:e.highlightNextLabel(t))||null}},{key:"highlightLabelAtCenter",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.highlightLabelAtCenter())||null}},{key:"clearHighlightedLabel",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.clearHighlightedLabel())||null}},{key:"getCenter",value:function(){var t=this.map.getCenter();return[Number(t.lng.toFixed(7)),Number(t.lat.toFixed(7))]}},{key:"getZoom",value:function(){return Number(this.map.getZoom().toFixed(7))}},{key:"getBounds",value:function(){return this.map.getBounds().toArray().flat(1)}},{key:"getFeaturesAtPoint",value:function(t,e){return function(t,e){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).radius,n=void 0===r?10:r,o=[[e.x-n,e.y-n],[e.x+n,e.y+n]],a=t.queryRenderedFeatures(o);if(0===a.length)return[];var i=new Set(t.queryRenderedFeatures([e.x,e.y]).map(function(t){var e,r=void 0===t.id?JSON.stringify(t.properties):t.id;return"".concat(null===(e=t.layer)||void 0===e?void 0:e.source,":").concat(r)})),u=[];a.forEach(function(t){!1===u.includes(t.layer.id)&&u.push(t.layer.id)});for(var l=new Set,c=[],s=a.length-1;s>=0;s--){var f,h=a[s],p=void 0===h.id?JSON.stringify(h.properties):h.id,y="".concat(null===(f=h.layer)||void 0===f?void 0:f.source,":").concat(p);!1===l.has(y)&&(l.add(y),c.push(h))}var d=t.unproject(e),v=[d.lng,d.lat],g=c.filter(function(t){var e=t.geometry.type;if(e.includes("Polygon"))return("Polygon"===e?[t.geometry.coordinates]:t.geometry.coordinates).some(function(t){return function(t,e){for(var r=ut(t,2),n=r[0],o=r[1],a=!1,i=0,u=e.length-1;i<e.length;u=i,i++){var l=ut(e[i],2),c=l[0],s=l[1],f=ut(e[u],2),h=f[0],p=f[1];s>o!=p>o&&n<(h-c)*(o-s)/(p-s)+c&&(a=!a)}return a}(v,t[0])});if("Point"===e||"MultiPoint"===e){var r,n=void 0===t.id?JSON.stringify(t.properties):t.id;return i.has("".concat(null===(r=t.layer)||void 0===r?void 0:r.source,":").concat(n))}return!0});return g.map(function(r){var n=0,o=r.geometry.type,a=function(t,e,r){var n=r.coordinates,o=r.type,a=1/0,i=function(e){return t.project(e)},u=function(t){for(var r=0;r<t.length-1;r++){var n=ct(e,i(t[r]),i(t[r+1]));n<a&&(a=n)}};if("Point"===o){var l=i(n);a=Math.pow(e.x-l.x,2)+Math.pow(e.y-l.y,2)}else"LineString"===o||"MultiPoint"===o?"LineString"===o?u(n):n.forEach(function(t){var r=i(t),n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);n<a&&(a=n)}):"Polygon"===o||"MultiLineString"===o?n.forEach(u):"MultiPolygon"===o&&n.forEach(function(t){return t.forEach(u)});return a}(t,e,r.geometry);return n+=1e6*u.indexOf(r.layer.id),o.includes("Polygon")&&(n-=5e5),{f:r,score:n+=a}}).sort(function(t,e){return t.score-e.score}).map(function(t){return t.f})}(this.map,t,e)}},{key:"getVisibleFeatures",value:function(t){var e=this,r=t.filter(function(t){return e.map.getLayer(t)});return r.length?this.map.queryRenderedFeatures(void 0,{layers:r}):[]}},{key:"addSymbolsToMap",value:(a=Ft(It().m(function t(e,r,n){var o;return It().w(function(t){for(;;)if(0===t.n)return o=this.map.getPixelRatio()||1,t.a(2,vt(this.map,e,r,n,o))},t,this)})),function(t,e,r){return a.apply(this,arguments)})},{key:"addPatternsToMap",value:(o=Ft(It().m(function t(e,r,n){var o;return It().w(function(t){for(;;)if(0===t.n)return o=this.map.getPixelRatio()||1,t.a(2,Nt(this.map,e,r,n,o))},t,this)})),function(t,e,r){return o.apply(this,arguments)})},{key:"getAreaDimensions",value:function(){return function(t){var e,r,n,o;if(t&&"function"==typeof t.getWest)e=t.getWest(),r=t.getSouth(),n=t.getEast(),o=t.getNorth();else{if(!Array.isArray(t)||2!==t.length)return"";var a=P(t,2),i=P(a[0],2);e=i[0],r=i[1];var u=P(a[1],2);n=u[0],o=u[1]}var l=E([e,r],[n,r]),c=E([e,r],[e,o]),s=j(l),f=j(c);return"".concat(f," by ").concat(s)}((t=this.maplibreModule.LngLatBounds,e=this.map,r=e.getContainer().getBoundingClientRect(),n=r.width,o=r.height,a=e.getPadding(),i=[a.left,o-a.bottom],u=[n-a.right,a.top],new t(e.unproject(i),e.unproject(u))));var t,e,r,n,o,a,i,u}},{key:"getCardinalMove",value:function(t,e){return function(t,e){var r=P(t,2),n=r[0],o=r[1],a=P(e,2),i=a[0],u=a[1],l=u-o,c=i-n,s=[];if(Math.abs(l)>1e-4){var f=Math.round(E([n,o],[n,u]));s.push("".concat(l>0?"north":"south"," ").concat(j(f)))}if(Math.abs(c)>1e-4){var h=Math.round(E([n,o],[i,o]));s.push("".concat(c>0?"east":"west"," ").concat(j(h)))}return s.join(", ")}(t,e)}},{key:"getResolution",value:function(){return t=this.map.getCenter(),e=this.map.getZoom(),r=t.lat,n=Math.pow(2,e),40075016.686*Math.cos(r*Math.PI/180)/(512*n);var t,e,r,n}},{key:"mapToScreen",value:function(t){return this.map.project(t)}},{key:"screenToMap",value:function(t){var e=this.map.unproject([t.x,t.y]);return[e.lng,e.lat]}},{key:"isGeometryObscured",value:function(t,e){return function(t,e,r){var n=r.getContainer().getBoundingClientRect(),o=P(N(t),4),a=o[0],i=o[1],u=o[2],l=o[3],c=[r.project([a,i]),r.project([a,l]),r.project([u,i]),r.project([u,l])],s=Math.min.apply(Math,S(c.map(function(t){return t.x}))),f=Math.max.apply(Math,S(c.map(function(t){return t.x}))),h=Math.min.apply(Math,S(c.map(function(t){return t.y}))),p=Math.max.apply(Math,S(c.map(function(t){return t.y}))),y=e.left-n.left,d=e.top-n.top,v=e.right-n.left,g=e.bottom-n.top;return s<v&&f>y&&h<g&&p>d}(t,e,this.map)}}],n&&Bt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,a,i}(i)}}]);
2
+ "use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[772],{612(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}r.r(e),r.d(e,{default:()=>Vt});var i=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"isBaseMapReady",value:function(){throw new Error(this.name+" must implement isBaseMapReady()")}}])&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),u=400,l=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];function c(t){var e=t.getCanvas();e.removeAttribute("role"),e.setAttribute("tabindex",-1),e.removeAttribute("aria-label"),e.style.display="block",e.addEventListener("focus",function(t){e.blur(),t.relatedTarget&&t.relatedTarget.focus({preventScroll:!0})})}function s(t){var e=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){var r=t.getCanvas();if(r&&(this.target===r||r.contains(this.target)))return}e.call(this)}}var f=function(t,e){var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o)},e)};return n.cancel=function(){r&&(clearTimeout(r),r=null)},n};function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function p(t){var e=t.map,r=t.events,n=t.eventBus,o=t.getCenter,a=t.getZoom,i=t.getBounds,u=t.getResolution,l=[],c=[],s=function(){var t=a();return{center:o(),bounds:i(),resolution:u(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},p=function(t,e){return n.emit(t,e)},y=function(){return p(r.MAP_LOADED)};e.on("load",y),l.push(["load",y]),e.once("idle",function(){return p(r.MAP_FIRST_IDLE,s())});var d=function(){return p(r.MAP_MOVE_START)};e.on("movestart",d),l.push(["movestart",d]);var v=f(function(){p(r.MAP_MOVE_END,s())},500);e.on("moveend",v),l.push(["moveend",v]);var g,m,b=(g=function(){p(r.MAP_MOVE,s())},m=0,function(){var t=Date.now();t-m>=10&&(m=t,g.apply(void 0,arguments))});e.on("zoom",b),l.push(["zoom",b]);var M=function(){return p(r.MAP_RENDER)};e.on("render",M),l.push(["render",M]);var w=f(function(){p(r.MAP_DATA_CHANGE,s())},500),S=function(t){t.isSourceLoaded&&w()};e.on("styledata",w),e.on("sourcedata",S),l.push(["styledata",w],["sourcedata",S]);var P=function(){return p(r.MAP_STYLE_CHANGE)};e.on("style.load",P),l.push(["style.load",P]);var O=function(t){return p(r.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]})};return e.on("click",O),l.push(["click",O]),c.push(v,b,w),{remove:function(){c.forEach(function(t){return t.cancel()}),l.forEach(function(t){var r,n,o=(n=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(r,n)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],i=o[1];return e.off(a,i)})}}}function y(t){var e=t.mapProvider,r=t.map,n=t.events,o=t.eventBus,a=function(t){r.once("style.load",function(){o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),r.setStyle(t.url,{diff:!1})},i=function(t){r.setPixelRatio(t)},u=function(t){var r=t.mapSize;e.mapSize=r};return o.on(n.MAP_SET_STYLE,a),o.on(n.MAP_SET_PIXEL_RATIO,i),o.on(n.MAP_SIZE_CHANGE,u),{remove:function(){o.off(n.MAP_SET_STYLE,a),o.off(n.MAP_SET_PIXEL_RATIO,i),o.off(n.MAP_SIZE_CHANGE,u)}}}let d=" ";class v{static get separator(){return d}static set separator(t){d=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,o=null,a=null,i=null;switch(e){default:case"d":case"deg":o=t.toFixed(r),o<100&&(o="0"+o),o<10&&(o="0"+o),n=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),a=(60*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),o++),o=("000"+o).slice(-3),a<10&&(a="0"+a),n=o+"°"+v.separator+a+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),a=Math.floor(3600*t/60)%60,i=(3600*t%60).toFixed(r),60==i&&(i=(0).toFixed(r),a++),60==a&&(a=0,o++),o=("000"+o).slice(-3),a=("00"+a).slice(-2),i<10&&(i="0"+i),n=o+"°"+v.separator+a+"′"+v.separator+i+"″"}return n}static toLat(t,e,r){const n=v.toDms(v.wrap90(t),e,r);return null===n?"–":n.slice(1)+v.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=v.toDms(v.wrap180(t),e,r);return null===n?"–":n+v.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=v.toDms(v.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=v.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const g=v,m=Math.PI;class b{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=g.wrap90(Number(t)),this._lon=g.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?g.wrap90(g.parse(t)):g.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?g.wrap90(g.parse(t)):g.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,r;if(2==t.length&&([e,r]=t,e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,r]=t[0].split(","),e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){const n=t[0];if("Point"==n.type&&Array.isArray(n.coordinates)?[r,e]=n.coordinates:(null!=n.latitude&&(e=n.latitude),null!=n.lat&&(e=n.lat),null!=n.longitude&&(r=n.longitude),null!=n.lng&&(r=n.lng),null!=n.lon&&(r=n.lon),e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r))),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${t.toString()}’`);return new b(e,r)}distanceTo(t,e=6371e3){if(t instanceof b||(t=b.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);const r=e,n=this.lat.toRadians(),o=this.lon.toRadians(),a=t.lat.toRadians(),i=a-n,u=t.lon.toRadians()-o,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(n)*Math.cos(a)*Math.sin(u/2)*Math.sin(u/2);return r*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof b||(t=b.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),o=Math.cos(e)*Math.sin(r)-Math.sin(e)*Math.cos(r)*Math.cos(n),a=Math.sin(n)*Math.cos(r),i=Math.atan2(a,o).toDegrees();return g.wrap360(i)}finalBearingTo(t){t instanceof b||(t=b.parse(t));const e=t.initialBearingTo(this)+180;return g.wrap360(e)}midpointTo(t){t instanceof b||(t=b.parse(t));const e=this.lat.toRadians(),r=this.lon.toRadians(),n=t.lat.toRadians(),o=(t.lon-this.lon).toRadians(),a=Math.cos(e),i=Math.sin(e),u={x:a+Math.cos(n)*Math.cos(o),y:0+Math.cos(n)*Math.sin(o),z:i+Math.sin(n)},l=Math.atan2(u.z,Math.sqrt(u.x*u.x+u.y*u.y)),c=r+Math.atan2(u.y,u.x),s=l.toDegrees(),f=c.toDegrees();return new b(s,f)}intermediatePointTo(t,e){if(t instanceof b||(t=b.parse(t)),this.equals(t))return new b(this.lat,this.lon);const r=this.lat.toRadians(),n=this.lon.toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=o-r,u=a-n,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(r)*Math.cos(o)*Math.sin(u/2)*Math.sin(u/2),c=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),s=Math.sin((1-e)*c)/Math.sin(c),f=Math.sin(e*c)/Math.sin(c),h=s*Math.cos(r)*Math.cos(n)+f*Math.cos(o)*Math.cos(a),p=s*Math.cos(r)*Math.sin(n)+f*Math.cos(o)*Math.sin(a),y=s*Math.sin(r)+f*Math.sin(o),d=Math.atan2(y,Math.sqrt(h*h+p*p)),v=Math.atan2(p,h),g=d.toDegrees(),m=v.toDegrees();return new b(g,m)}destinationPoint(t,e,r=6371e3){const n=t/r,o=Number(e).toRadians(),a=this.lat.toRadians(),i=this.lon.toRadians(),u=Math.sin(a)*Math.cos(n)+Math.cos(a)*Math.sin(n)*Math.cos(o),l=Math.asin(u),c=Math.sin(o)*Math.sin(n)*Math.cos(a),s=Math.cos(n)-Math.sin(a)*u,f=i+Math.atan2(c,s),h=l.toDegrees(),p=f.toDegrees();return new b(h,p)}static intersection(t,e,r,n){if(t instanceof b||(t=b.parse(t)),r instanceof b||(r=b.parse(r)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(n))throw new TypeError(`invalid brng2 ‘${n}’`);const o=t.lat.toRadians(),a=t.lon.toRadians(),i=r.lat.toRadians(),u=r.lon.toRadians(),l=Number(e).toRadians(),c=Number(n).toRadians(),s=i-o,f=u-a,h=2*Math.asin(Math.sqrt(Math.sin(s/2)*Math.sin(s/2)+Math.cos(o)*Math.cos(i)*Math.sin(f/2)*Math.sin(f/2)));if(Math.abs(h)<Number.EPSILON)return new b(t.lat,t.lon);const p=(Math.sin(i)-Math.sin(o)*Math.cos(h))/(Math.sin(h)*Math.cos(o)),y=(Math.sin(o)-Math.sin(i)*Math.cos(h))/(Math.sin(h)*Math.cos(i)),d=Math.acos(Math.min(Math.max(p,-1),1)),v=Math.acos(Math.min(Math.max(y,-1),1)),g=l-(Math.sin(u-a)>0?d:2*m-d),M=(Math.sin(u-a)>0?2*m-v:v)-c;if(0==Math.sin(g)&&0==Math.sin(M))return null;if(Math.sin(g)*Math.sin(M)<0)return null;const w=-Math.cos(g)*Math.cos(M)+Math.sin(g)*Math.sin(M)*Math.cos(h),S=Math.atan2(Math.sin(h)*Math.sin(g)*Math.sin(M),Math.cos(M)+Math.cos(g)*w),P=Math.asin(Math.min(Math.max(Math.sin(o)*Math.cos(S)+Math.cos(o)*Math.sin(S)*Math.cos(l),-1),1)),O=a+Math.atan2(Math.sin(l)*Math.sin(S)*Math.cos(o),Math.cos(S)-Math.sin(o)*Math.sin(P)),x=P.toDegrees(),E=O.toDegrees();return new b(x,E)}crossTrackDistanceTo(t,e,r=6371e3){t instanceof b||(t=b.parse(t)),e instanceof b||(e=b.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(o)*Math.sin(a-i))*n}alongTrackDistanceTo(t,e,r=6371e3){t instanceof b||(t=b.parse(t)),e instanceof b||(e=b.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians(),u=Math.asin(Math.sin(o)*Math.sin(a-i));return Math.acos(Math.cos(o)/Math.abs(Math.cos(u)))*Math.sign(Math.cos(i-a))*n}maxLatitude(t){const e=Number(t).toRadians(),r=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(r))).toDegrees()}static crossingParallels(t,e,r){if(t.equals(e))return null;const n=Number(r).toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=e.lat.toRadians(),u=e.lon.toRadians()-a,l=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.sin(u),c=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.cos(u)-Math.cos(o)*Math.sin(i)*Math.cos(n),s=Math.cos(o)*Math.cos(i)*Math.sin(n)*Math.sin(u);if(s*s>l*l+c*c)return null;const f=Math.atan2(-c,l),h=Math.acos(s/Math.sqrt(l*l+c*c)),p=a+f+h,y=(a+f-h).toDegrees(),d=p.toDegrees();return{lon1:g.wrap180(y),lon2:g.wrap180(d)}}rhumbDistanceTo(t,e=6371e3){t instanceof b||(t=b.parse(t));const r=e,n=this.lat.toRadians(),o=t.lat.toRadians(),a=o-n;let i=Math.abs(t.lon-this.lon).toRadians();Math.abs(i)>m&&(i=i>0?-(2*m-i):2*m+i);const u=Math.log(Math.tan(o/2+m/4)/Math.tan(n/2+m/4)),l=Math.abs(u)>1e-11?a/u:Math.cos(n);return Math.sqrt(a*a+l*l*i*i)*r}rhumbBearingTo(t){if(t instanceof b||(t=b.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians();let n=(t.lon-this.lon).toRadians();Math.abs(n)>m&&(n=n>0?-(2*m-n):2*m+n);const o=Math.log(Math.tan(r/2+m/4)/Math.tan(e/2+m/4)),a=Math.atan2(n,o).toDegrees();return g.wrap360(a)}rhumbDestinationPoint(t,e,r=6371e3){const n=this.lat.toRadians(),o=this.lon.toRadians(),a=Number(e).toRadians(),i=t/r,u=i*Math.cos(a);let l=n+u;Math.abs(l)>m/2&&(l=l>0?m-l:-m-l);const c=Math.log(Math.tan(l/2+m/4)/Math.tan(n/2+m/4)),s=Math.abs(c)>1e-11?u/c:Math.cos(n),f=o+i*Math.sin(a)/s,h=l.toDegrees(),p=f.toDegrees();return new b(h,p)}rhumbMidpointTo(t){t instanceof b||(t=b.parse(t));const e=this.lat.toRadians();let r=this.lon.toRadians();const n=t.lat.toRadians(),o=t.lon.toRadians();Math.abs(o-r)>m&&(r+=2*m);const a=(e+n)/2,i=Math.tan(m/4+e/2),u=Math.tan(m/4+n/2),l=Math.tan(m/4+a/2);let c=((o-r)*Math.log(l)+r*Math.log(u)-o*Math.log(i))/Math.log(u/i);isFinite(c)||(c=(r+o)/2);const s=a.toDegrees(),f=c.toDegrees();return new b(s,f)}static areaOf(t,e=6371e3){const r=e,n=t[0].equals(t[t.length-1]);n||t.push(t[0]);const o=t.length-1;let a=0;for(let e=0;e<o;e++){const r=t[e].lat.toRadians(),n=t[e+1].lat.toRadians(),o=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(o/2)*(Math.tan(r/2)+Math.tan(n/2)),1+Math.tan(r/2)*Math.tan(n/2))}(function(t){let e=0,r=t[0].initialBearingTo(t[1]);for(let n=0;n<t.length-1;n++){const o=t[n].initialBearingTo(t[n+1]),a=t[n].finalBearingTo(t[n+1]);e+=(o-r+540)%360-180,e+=(a-o+540)%360-180,r=a}return e+=(t[0].initialBearingTo(t[1])-r+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*m);const i=Math.abs(a*r*r);return n||t.pop(),i}equals(t){return t instanceof b||(t=b.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e=void 0){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`):`${g.toLat(this.lat,t,e)}, ${g.toLon(this.lon,t,e)}`}}function M(t,e,r){if(null!==t)for(var n,o,a,i,u,l,c,s,f=0,h=0,p=t.type,y="FeatureCollection"===p,d="Feature"===p,v=y?t.features.length:1,g=0;g<v;g++){u=(s=!!(c=y?t.features[g].geometry:d?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var m=0;m<u;m++){var b=0,w=0;if(null!==(i=s?c.geometries[m]:c)){l=i.coordinates;var S=i.type;switch(f=!r||"Polygon"!==S&&"MultiPolygon"!==S?0:1,S){case null:break;case"Point":if(!1===e(l,h,g,b,w))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],h,g,b,w))return!1;h++,"MultiPoint"===S&&b++}"LineString"===S&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-f;o++){if(!1===e(l[n][o],h,g,b,w))return!1;h++}"MultiLineString"===S&&b++,"Polygon"===S&&w++}"Polygon"===S&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(w=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-f;a++){if(!1===e(l[n][o][a],h,g,b,w))return!1;h++}w++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===M(i.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var w=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const r=[1/0,1/0,-1/0,-1/0];return M(t,t=>{r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])}),r};function S(t){return function(t){if(Array.isArray(t))return x(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||O(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||O(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){if(t){if("string"==typeof t)return x(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var E=function(t,e){var r=P(t,2),n=r[0],o=r[1],a=P(e,2),i=a[0],u=a[1],l=new b(o,n),c=new b(u,i);return l.distanceTo(c)},j=function(t){var e=t/1609.344;if(e<.5)return"".concat(Math.round(t),"m");if(e<10){var r=Number.parseFloat(e.toFixed(1)),n=1===r?"mile":"miles";return"".concat(r," ").concat(n)}var o=Math.round(e);return"".concat(o," miles")},N=function(t){return w(t)};function A(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function L(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function k(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?L(Object(r),!0).forEach(function(e){R(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function R(t,e,r){return(e=function(t){var e=function(t){if("object"!=I(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==I(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var C="highlighted-label";function D(t,e){if("number"==typeof t)return t;if(!Array.isArray(t)||"interpolate"!==t[0])return function(t,e){var r=t.stops;if(r.length<2)return r.length>0?r[0][1]:0;for(var n=r[0],o=r[r.length-1],a=1;a<r.length;a++){var i=r[a];if(i[0]>e){o=i,n=r[a-1];break}n=r[a-1],o=i}var u=A(n,2),l=u[0],c=u[1],s=A(o,2),f=s[0],h=s[1];return e<=l?c:e>=f?h:c+(e-l)/(f-l)*(h-c)}(t,e);var r,n=function(t){if(Array.isArray(t))return t}(r=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=n[2],a=_(n).slice(3);if("zoom"!==o[0])throw new Error("Only zoom-based expressions supported");for(var i=0;i<a.length-2;i+=2){var u=a[i],l=a[i+1],c=a[i+2],s=a[i+3];if(e<=u)return l;if(e<=c)return l+(e-u)/(c-u)*(s-l)}return a[a.length-1]}function F(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function B(t,e,r){var n,o,a,i;if(null!=e&&null!==(n=e.feature)&&void 0!==n&&n.layer){F(t,r);var u=e.feature,l=e.layer;r.highlightLayerId="highlight-".concat(l.id);var c=u.id,s=u.type,f=u.properties,h=u.geometry;t.getSource(C).setData({id:c,type:s,properties:f,geometry:h}),r.highlightedExpr=l.layout["text-size"];var p=t.getZoom(),y=(o=l,a=1.5*D(r.highlightedExpr,p),i=r.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"},{id:"highlight-".concat(o.id),type:o.type,source:C,layout:k(k({},o.layout),{},{"text-size":a,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:k(k({},o.paint),{},{"text-color":i.text,"text-halo-color":i.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})});t.addLayer(y),t.moveLayer(r.highlightLayerId)}}function G(t){t.getSource(C)||t.addSource(C,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function $(t){t.getStyle().layers.filter(function(t){var e;return"line"===(null===(e=t.layout)||void 0===e?void 0:e["symbol-placement"])}).forEach(function(e){return t.setLayoutProperty(e.id,"symbol-placement","line-center")})}function z(t,e,r,n){var o={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function a(){var e=t.getStyle().layers.filter(function(t){return"symbol"===t.type}),r=t.queryRenderedFeatures({layers:e.map(function(t){return t.id})});o.labels=function(t,e,r){return e.flatMap(function(e){var n,o,a,i,u="string"==typeof(o=null===(n=e.layout)||void 0===n?void 0:n["text-field"])?null===(a=/^{(.+)}$/.exec(o))||void 0===a?void 0:a[1]:Array.isArray(o)?null===(i=o.find(function(t){return Array.isArray(t)&&"get"===t[0]}))||void 0===i?void 0:i[1]:null;return u?r.filter(function(t){var r;return t.layer.id===e.id&&(null===(r=t.properties)||void 0===r?void 0:r[u])}).map(function(r){return function(t,e,r,n){var o=function(t){var e=t.type,r=t.coordinates;if("Point"===e)return r;if("MultiPoint"===e)return r[0];if(e.includes("LineString")){var n="LineString"===e?r:r[0];return[(n[0][0]+n[n.length-1][0])/2,(n[0][1]+n[n.length-1][1])/2]}if(e.includes("Polygon")){var o="Polygon"===e?r[0]:r[0][0],a=o.reduce(function(t,e){return[t[0]+e[0],t[1]+e[1]]},[0,0]);return[a[0]/o.length,a[1]/o.length]}return null}(t.geometry);if(!o)return null;var a=n.project({lng:o[0],lat:o[1]});return{text:t.properties[r],x:a.x,y:a.y,feature:t,layer:e}}(r,e,u,t)}).filter(Boolean):[]})}(t,e,r)}function i(){if(a(),!o.labels.length)return null;var e=t.project(t.getCenter()),r=function(t,e){var r;return null===(r=t.reduce(function(t,r){var n=Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2);return!t||n<t.dist?{label:r,dist:n}:t},null))||void 0===r?void 0:r.label}(o.labels,e);return o.currentPixel={x:r.x,y:r.y},B(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")}return $(t),G(t),null==n||n.on(r.MAP_SET_STYLE,function(e){t.once("styledata",function(){return t.once("idle",function(){$(t),G(t),o.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)})})}),t.on("zoom",function(){if(o.highlightLayerId&&o.highlightedExpr){var e=D(o.highlightedExpr,t.getZoom());t.setLayoutProperty(o.highlightLayerId,"text-size",1.5*e)}}),function(t){t.getStyle().layers.filter(function(t){return"symbol"===t.type}).forEach(function(e){t.setPaintProperty(e.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(t),{refreshLabels:a,highlightNextLabel:function(e){if(a(),!o.labels.length)return null;if(!o.currentPixel)return i();var r=function(t,e){if(!e.currentPixel)return null;var r=e.labels.map(function(t,e){return{pixel:[t.x,t.y],index:e}}).filter(function(t){return t.pixel[0]!==e.currentPixel.x||t.pixel[1]!==e.currentPixel.y});if(!r.length)return null;var n=r.map(function(t){return t.pixel}),o=function(t,e,r){var n=P(e,2),o=n[0],a=n[1],i=r.filter(function(e){var r=P(e,2),n=r[0],i=r[1];return(n!==o||i!==a)&&function(t,e,r){switch(t){case"ArrowUp":return r<0&&Math.abs(r)>=Math.abs(e);case"ArrowDown":return r>0&&Math.abs(r)>=Math.abs(e);case"ArrowLeft":return e<0&&Math.abs(e)>Math.abs(r);case"ArrowRight":return e>0&&Math.abs(e)>Math.abs(r);default:return!1}}(t,n-o,i-a)});if(!i.length)return r.findIndex(function(t){return t[0]===o&&t[1]===a});var u=-1,l=1/0;return i.forEach(function(t){var e=t[0]-o,n=t[1]-a,i=e*e+n*n;i<l&&(l=i,u=r.indexOf(t))}),u}(t,[e.currentPixel.x,e.currentPixel.y],n);return(null==o||o<0||o>=r.length)&&(o=0),e.labels[r[o].index]}(e,o);return r?(o.currentPixel={x:r.x,y:r.y},B(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")):null},highlightLabelAtCenter:i,clearHighlightedLabel:function(){return F(t,o)}}}var W=function(t){return t.endsWith(".cold")?"".concat(t.slice(0,-5),".hot"):t.endsWith(".hot")?"".concat(t.slice(0,-4),".cold"):null};function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function Z(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||H(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t,e){if(t){if("string"==typeof t)return U(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(t,e):void 0}}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function V(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?V(Object(r),!0).forEach(function(e){J(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function J(t,e,r){return(e=function(t){var e=function(t){if("object"!=q(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=q(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==q(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var K="icon-image",X="active-highlight",Q="active-highlight-inner",tt="selected-highlight",et=function(t,e){var r,n;return null!==(r=null===(n=t._activeSymbolImageMap)||void 0===n?void 0:n[e])&&void 0!==r?r:null},rt=function(t,e){var r,n;return null!==(r=null===(n=t._selectedSymbolImageMap)||void 0===n?void 0:n[e])&&void 0!==r?r:null},nt=function(t,e,r,n){var o=n.featureId,a=n.idProperty,i=n.geometry,u=t.getLayer(r);u&&(e[r]||(e[r]={ids:new Set,fillIds:new Set,idProperty:a,sourceId:u.source,hasFillGeometry:!1}),!i||"Polygon"!==i.type&&"MultiPolygon"!==i.type||(e[r].hasFillGeometry=!0,e[r].fillIds.add(o)),e[r].ids.add(o))},ot=function(t,e,r,n){e.forEach(function(e){if(!r.has(e)){var o="".concat(n,"-").concat(e);["".concat(o,"-fill"),"".concat(o,"-line"),"".concat(o,"-symbol")].forEach(function(e){t.getLayer(e)&&t.setFilter(e,["==","id",""])})}})},at=function(t,e){var r="_".concat(e.replaceAll("-",""),"Sources");ot(t,t[r]||new Set,new Set,e),t[r]=new Set},it=function(t,e,r,n,o,a,i){!!t.getLayer(e)||t.addLayer(Y(Y({id:e,type:r,source:n},o&&{"source-layer":o}),{},{paint:a})),Object.entries(a).forEach(function(r){var n=Z(r,2),o=n[0],a=n[1];t.setPaintProperty(e,o,a)}),t.setFilter(e,i),t.moveLayer(e)},ut=function(t,e,r,n,o,a,i){var u,l=t.getLayoutProperty(o,"icon-offset");t.getLayer(e)||t.addLayer(Y(Y({id:e,type:"symbol",source:r},n&&{"source-layer":n}),{},{layout:Y(Y(J(J({},K,a),"icon-anchor",null!==(u=t.getLayoutProperty(o,"icon-anchor"))&&void 0!==u?u:"center"),void 0!==l&&{"icon-offset":l}),{},{"icon-allow-overlap":!0})})),t.setLayoutProperty(e,K,a),void 0!==l&&t.setLayoutProperty(e,"icon-offset",l),t.setFilter(e,i),t.moveLayer(e)},lt=function(t,e,r,n,o){var a=function(t,e){var r={};return null==e||e.forEach(function(e){nt(t,r,e.layerId,e);var n=W(e.layerId);n&&nt(t,r,n,e)}),r}(t,e),i=new Set(Object.keys(a)),u="_".concat(n.replaceAll("-",""),"Sources"),l=t[u]||new Set;return ot(t,l,i,n),t[u]=i,i.forEach(function(e){return function(t,e,r,n,o,a){var i,u=r[e],l=u.ids,c=u.fillIds,s=u.idProperty,f=u.sourceId,h=u.hasFillGeometry,p=t.getLayer(e),y=null!==(i=n[e])&&void 0!==i?i:n[W(e)];if(p&&y){var d=p.sourceLayer,v=h?"fill":p.type,g="".concat(o,"-").concat(e),m=y.fill,b=o===tt,M=function(t){return t===tt||t===Q}(o),w=function(t,e){return{lineColor:e?t.selectionStroke:t.stroke,lineWidth:e?t.strokeWidth:t.activeStrokeWidth}}(y,M),S=w.lineColor,P=w.lineWidth,O=s?["get",s]:["id"],x=["in",O,["literal",Array.from(l)]];if("fill-extrusion"!==p.type)switch(v){case"fill":!function(t,e,r,n,o){var a=o.idExpression,i=o.fill,u=o.lineColor,l=o.lineWidth,c=o.filter;if(o.isSelected){var s=[];o.fillIds.forEach(function(t){return s.push(t)});var f=["in",a,["literal",s]];it(t,"".concat(e,"-fill"),"fill",r,n,{"fill-color":i},f)}it(t,"".concat(e,"-line"),"line",r,n,{"line-color":u,"line-width":l},c)}(t,g,f,d,{isSelected:b,idExpression:O,fillIds:c,fill:m,lineColor:S,lineWidth:P,filter:x});break;case"line":!function(t,e,r,n,o,a,i){t.getLayer("".concat(e,"-fill"))&&t.setFilter("".concat(e,"-fill"),["==","id",""]),it(t,"".concat(e,"-line"),"line",r,n,{"line-color":o,"line-width":a},i)}(t,g,f,d,S,P,x);break;case"symbol":!function(t,e,r,n,o,a,i){var u=t.getLayoutProperty(o,K);if(Array.isArray(u)){var l=i===et?"user_symbolActiveImageId":"user_symbolSelectedImageId";ut(t,"".concat(e,"-symbol"),r,n,o,["get",l],a)}else{var c=i(t,u);c&&ut(t,"".concat(e,"-symbol"),r,n,o,c,a)}}(t,g,f,d,e,x,a)}else!function(t,e,r,n){var o=n.lineColor,a=n.lineWidth,i=n.idExpression,u=[];n.ids.forEach(function(t){return u.push(t)});var l=["in",i,["literal",u]],c=t.getLayer(r),s=c.source,f=c.sourceLayer;it(t,"".concat(e,"-line"),"line",s,f,{"line-color":o,"line-width":a},l)}(t,g,e,{ids:l,lineColor:S,lineWidth:P,idExpression:O})}}(t,e,a,r,n,o)}),a};function ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return st(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?st(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ft=function(t,e,r){var n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);if(0===n)return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2);var o=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return o=Math.max(0,Math.min(1,o)),Math.pow(t.x-(e.x+o*(r.x-e.x)),2)+Math.pow(t.y-(e.y+o*(r.y-e.y)),2)};function ht(t,e){if(t){if("string"==typeof t)return pt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pt(t,e):void 0}}function pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var yt=function(t,e,r){var n=t.getCanvas();if(r&&t.off("mousemove",r),null==e||!e.length)return n.style.cursor="",null;var o=function(r){var o=function(t){var e,r=new Set(t);return t.forEach(function(t){var e=W(t);e&&r.add(e)}),function(t){if(Array.isArray(t))return pt(t)}(e=r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||ht(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e).filter(function(e){return t.getLayer(e)});if(0!==o.length){var a=function(t,e){var r,n=[],o=[],a=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ht(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){i=!0,o=t},f:function(){try{a||null==e.return||e.return()}finally{if(i)throw o}}}}(e);try{for(a.s();!(r=a.n()).done;){var i=r.value;if("line"===t.getLayer(i).type){var u=i.endsWith("-stroke")?i.slice(0,-7):null;null!==u&&e.includes(u)||n.push(i)}else o.push(i)}}catch(t){a.e(t)}finally{a.f()}return{lineLayers:n,otherLayers:o}}(t,o),i=a.lineLayers,u=a.otherLayers,l=r.point,c=l.x,s=l.y,f=[[c-10,s-10],[c+10,s+10]],h=i.length>0&&t.queryRenderedFeatures(f,{layers:i}).length>0,p=u.length>0&&t.queryRenderedFeatures(r.point,{layers:u}).length>0;n.style.cursor=h||p?"pointer":""}else n.style.cursor=""};return t.on("mousemove",o),o};function dt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return vt(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(vt(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,vt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,vt(f,"constructor",c),vt(c,"constructor",l),l.displayName="GeneratorFunction",vt(c,o,"GeneratorFunction"),vt(f),vt(f,o,"Generator"),vt(f,n,function(){return this}),vt(f,"toString",function(){return"[object Generator]"}),(dt=function(){return{w:a,m:h}})()}function vt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}vt=function(t,e,r,n){function a(e,r){vt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},vt(t,e,r,n)}function gt(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function mt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){gt(a,n,o,i,u,"next",t)}function u(t){gt(a,n,o,i,u,"throw",t)}i(void 0)})}}var bt=function(){var t=mt(dt().m(function t(e,r,n,o){var a,i,u,l=arguments;return dt().w(function(t){for(;;)switch(t.n){case 0:if(u=l.length>4&&void 0!==l[4]?l[4]:2,r.length){t.n=1;break}return t.a(2);case 1:return null!==(a=e._activeSymbolImageMap)&&void 0!==a||(e._activeSymbolImageMap={}),null!==(i=e._selectedSymbolImageMap)&&void 0!==i||(e._selectedSymbolImageMap={}),t.n=2,Promise.all(r.flatMap(function(t){var r=o.getSymbolImageId(t,n,!1,u),a=o.getSymbolImageId(t,n,!0,u);return r&&a&&(e._activeSymbolImageMap[r]=a),["normal","active","selected"].map(function(){var i=mt(dt().m(function i(l){var c,s;return dt().w(function(i){for(;;)switch(i.n){case 0:if(c="active"===l?a:r,"selected"===l||c&&!e.hasImage(c)){i.n=1;break}return i.a(2);case 1:return i.n=2,o.rasteriseSymbolImage(t,n,l,u);case 2:(s=i.v)&&("selected"===l&&r&&(e._selectedSymbolImageMap[r]=s.imageId),e.hasImage(s.imageId)||e.addImage(s.imageId,s.imageData,{pixelRatio:u}));case 3:return i.a(2)}},i)}));return function(t){return i.apply(this,arguments)}}())}));case 2:return t.a(2)}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}(),Mt=function(t){return Math.max(2,2*t)},wt=function(t,e,r){return t.replace(/\{\{foregroundColor\}\}/g,e||"black").replace(/\{\{backgroundColor\}\}/g,r||"transparent")};function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}var Pt=function(t,e){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===St(t)){if(e&&t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null},Ot=function(t,e,r){return new Promise(function(n,o){var a="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(t)),i=new Image(e,r);i.onload=function(){var t=document.createElement("canvas");t.width=e,t.height=r;var o=t.getContext("2d");o.drawImage(i,0,0,e,r),n(o.getImageData(0,0,e,r))},i.onerror=function(){o(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},i.src=a})};function xt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return Et(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(Et(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Et(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,Et(f,"constructor",c),Et(c,"constructor",l),l.displayName="GeneratorFunction",Et(c,o,"GeneratorFunction"),Et(f),Et(f,o,"Generator"),Et(f,n,function(){return this}),Et(f,"toString",function(){return"[object Generator]"}),(xt=function(){return{w:a,m:h}})()}function Et(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Et=function(t,e,r,n){function a(e,r){Et(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},Et(t,e,r,n)}function jt(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function Nt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){jt(a,n,o,i,u,"next",t)}function u(t){jt(a,n,o,i,u,"throw",t)}i(void 0)})}}var At=new Map,Tt=function(){var t=Nt(xt().m(function t(e,r,n,o){var a,i,u,l,c,s,f,h,p,y;return xt().w(function(t){for(;;)switch(t.n){case 0:if(a=n.getPatternInnerContent(e)){t.n=1;break}return t.a(2,null);case 1:if(i=n.getPatternImageId(e,r,o)){t.n=2;break}return t.a(2,null);case 2:if(u=At.get(i)){t.n=4;break}return l=Pt(e.fillPatternForegroundColor,r)||"black",c=Pt(e.fillPatternBackgroundColor,r)||"transparent",s=wt(a,l,c),f='<rect width="16" height="16" fill="'.concat(c,'"/>'),h=Mt(o),p=Math.round(8*h),y='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(p,'" height="').concat(p,'" viewBox="0 0 16 16">').concat(f).concat(s,"</svg>"),t.n=3,Ot(y,p,p);case 3:u=t.v,At.set(i,u);case 4:return t.a(2,{imageId:i,imageData:u})}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}(),It=function(){var t=Nt(xt().m(function t(e,r,n,o,a){var i,u;return xt().w(function(t){for(;;)switch(t.n){case 0:if(r.length){t.n=1;break}return t.a(2);case 1:return i=Mt(a),u=r.reduce(function(t,r){var u=o.getPatternImageId(r,n,a);return!u||t[u]||e.hasImage(u)||(t[u]=Nt(xt().m(function t(){var u;return xt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Tt(r,n,o,a);case 1:(u=t.v)&&!e.hasImage(u.imageId)&&e.addImage(u.imageId,u.imageData,{pixelRatio:i});case 2:return t.a(2)}},t)}))),t},{}),t.n=2,Promise.all(Object.values(u).map(function(t){return t()}));case 2:return t.a(2)}},t)}));return function(e,r,n,o,a){return t.apply(this,arguments)}}();function Lt(t){return Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(t)}var kt=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function Rt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return _t(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(_t(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,_t(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,_t(f,"constructor",c),_t(c,"constructor",l),l.displayName="GeneratorFunction",_t(c,o,"GeneratorFunction"),_t(f),_t(f,o,"Generator"),_t(f,n,function(){return this}),_t(f,"toString",function(){return"[object Generator]"}),(Rt=function(){return{w:a,m:h}})()}function _t(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}_t=function(t,e,r,n){function a(e,r){_t(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},_t(t,e,r,n)}function Ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ct(Object(r),!0).forEach(function(e){Ft(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ft(t,e,r){return(e=Wt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bt(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Gt(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function $t(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){Gt(a,n,o,i,u,"next",t)}function u(t){Gt(a,n,o,i,u,"throw",t)}i(void 0)})}}function zt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wt(n.key),n)}}function Wt(t){var e=function(t){if("object"!=Lt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Lt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Lt(e)?e:e+""}function qt(t,e,r){return e=Ht(e),function(t,e){if(e&&("object"==Lt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Zt()?Reflect.construct(e,r||[],Ht(t).constructor):e.apply(t,r))}function Zt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Zt=function(){return!!t})()}function Ht(t){return Ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ht(t)}function Ut(t,e){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ut(t,e)}var Vt=function(t){function e(t){var r,n=t.mapFramework,o=t.mapProviderConfig,a=void 0===o?{}:o,i=t.events,u=t.eventBus;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=qt(this,e)).maplibreModule=n,r.events=i,r.eventBus=u,r.capabilities={supportedShortcuts:l,supportsMapSizes:!0},Object.assign(r,a),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ut(t,e)}(e,t),r=e,n=[{key:"name",get:function(){return"MapLibreProvider"}},{key:"initMap",value:(i=$t(Rt().m(function t(e){var r,n,o,a,i,u,l,f,h,d,v,g,m,b=this;return Rt().w(function(t){for(;;)switch(t.n){case 0:r=e.container,n=e.padding,o=e.mapStyle,a=e.mapSize,i=e.center,u=e.zoom,l=e.bounds,f=e.pixelRatio,h=Bt(e,kt),this.mapStyleId=null==o?void 0:o.id,this.mapSize=a,d=this.maplibreModule.Map,v=this.events,g=this.eventBus,(m=new d(Dt(Dt({},h),{},{container:r,style:null==o?void 0:o.url,pixelRatio:f,padding:n,center:i,zoom:u,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}))).touchZoomRotate.disableRotation(),this.map=m,this.map.setPadding(n),l&&m.fitBounds(l,{duration:0}),s(m),c(m),p({map:m,events:v,eventBus:g,getCenter:this.getCenter.bind(this),getZoom:this.getZoom.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),y({mapProvider:this,map:m,events:v,eventBus:g}),m.on("load",function(){b.labelNavigator=z(m,null==o?void 0:o.mapColorScheme,v,g)}),this.eventBus.emit(v.MAP_READY,{map:this.map,mapStyleId:this.mapStyleId,mapSize:this.mapSize,crs:this.crs});case 1:return t.a(2)}},t,this)})),function(t){return i.apply(this,arguments)})},{key:"isBaseMapReady",value:function(){var t;return Boolean(null===(t=this.map)||void 0===t?void 0:t.getStyle())}},{key:"destroyMap",value:function(){var t,e;this.setHoverCursor([]),null===(t=this.mapEvents)||void 0===t||t.remove(),null===(e=this.appEvents)||void 0===e||e.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}},{key:"setHoverCursor",value:function(t){this.map&&(this._onHoverMove=yt(this.map,t,this._onHoverMove))}},{key:"setView",value:function(t){var e=t.center,r=t.zoom;this.map.flyTo({center:e||this.getCenter(),zoom:r||this.getZoom(),duration:this.map.isStyleLoaded()?u:0})}},{key:"zoomIn",value:function(t){this.map.easeTo({zoom:this.getZoom()+t,duration:u})}},{key:"zoomOut",value:function(t){this.map.easeTo({zoom:this.getZoom()-t,duration:u})}},{key:"panBy",value:function(t){this.map.panBy(t,{duration:u})}},{key:"fitToBounds",value:function(t){var e=Array.isArray(t)?t:N(t),r=this.map.isStyleLoaded()?u:0;this.map.fitBounds(e,{duration:r})}},{key:"setPadding",value:function(t){this.map.setPadding(t)}},{key:"updateHighlightedFeatures",value:function(t,e,r){return function(t){var e=t.LngLatBounds,r=t.map,n=t.selectedFeatures,o=t.activeFeatures,a=t.stylesMap;if(!r)return null;null!=o&&o.length?(lt(r,o,a,X,et),lt(r,o,a,Q,rt)):(at(r,X),at(r,Q));var i={};null!=n&&n.length?i=lt(r,n,a,tt,rt):at(r,tt);var u=[];return Object.entries(i).forEach(function(t){var e=Z(t,2),n=e[0],o=e[1],a=o.ids,i=o.idProperty;u.push.apply(u,function(t){return function(t){if(Array.isArray(t))return U(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||H(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r.queryRenderedFeatures({layers:[n]}).filter(function(t){var e;return a.has(i?null===(e=t.properties)||void 0===e?void 0:e[i]:t.id)})))}),function(t,e){if(!e.length)return null;var r=new t;return e.forEach(function(t){var e=function(t){return"number"==typeof t[0]?r.extend(t):t.forEach(e)};e(t.geometry.coordinates)}),[r.getWest(),r.getSouth(),r.getEast(),r.getNorth()]}(e,u)}({LngLatBounds:this.maplibreModule.LngLatBounds,map:this.map,selectedFeatures:t,activeFeatures:e,stylesMap:r})}},{key:"highlightNextLabel",value:function(t){var e;return(null===(e=this.labelNavigator)||void 0===e?void 0:e.highlightNextLabel(t))||null}},{key:"highlightLabelAtCenter",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.highlightLabelAtCenter())||null}},{key:"clearHighlightedLabel",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.clearHighlightedLabel())||null}},{key:"getCenter",value:function(){var t=this.map.getCenter();return[Number(t.lng.toFixed(7)),Number(t.lat.toFixed(7))]}},{key:"getZoom",value:function(){return Number(this.map.getZoom().toFixed(7))}},{key:"getBounds",value:function(){return this.map.getBounds().toArray().flat(1)}},{key:"getFeaturesAtPoint",value:function(t,e){return function(t,e){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).radius,n=void 0===r?10:r,o=[[e.x-n,e.y-n],[e.x+n,e.y+n]],a=t.queryRenderedFeatures(o);if(0===a.length)return[];var i=new Set(t.queryRenderedFeatures([e.x,e.y]).map(function(t){var e,r=void 0===t.id?JSON.stringify(t.properties):t.id;return"".concat(null===(e=t.layer)||void 0===e?void 0:e.source,":").concat(r)})),u=[];a.forEach(function(t){!1===u.includes(t.layer.id)&&u.push(t.layer.id)});for(var l=new Set,c=[],s=a.length-1;s>=0;s--){var f,h=a[s],p=void 0===h.id?JSON.stringify(h.properties):h.id,y="".concat(null===(f=h.layer)||void 0===f?void 0:f.source,":").concat(p);!1===l.has(y)&&(l.add(y),c.push(h))}var d=t.unproject(e),v=[d.lng,d.lat],g=c.filter(function(t){var e=t.geometry.type;if(e.includes("Polygon"))return("Polygon"===e?[t.geometry.coordinates]:t.geometry.coordinates).some(function(t){return function(t,e){for(var r=ct(t,2),n=r[0],o=r[1],a=!1,i=0,u=e.length-1;i<e.length;u=i,i++){var l=ct(e[i],2),c=l[0],s=l[1],f=ct(e[u],2),h=f[0],p=f[1];s>o!=p>o&&n<(h-c)*(o-s)/(p-s)+c&&(a=!a)}return a}(v,t[0])});if("Point"===e||"MultiPoint"===e){var r,n=void 0===t.id?JSON.stringify(t.properties):t.id;return i.has("".concat(null===(r=t.layer)||void 0===r?void 0:r.source,":").concat(n))}return!0});return g.map(function(r){var n=0,o=r.geometry.type,a=function(t,e,r){var n=r.coordinates,o=r.type,a=1/0,i=function(e){return t.project(e)},u=function(t){for(var r=0;r<t.length-1;r++){var n=ft(e,i(t[r]),i(t[r+1]));n<a&&(a=n)}};if("Point"===o){var l=i(n);a=Math.pow(e.x-l.x,2)+Math.pow(e.y-l.y,2)}else"LineString"===o||"MultiPoint"===o?"LineString"===o?u(n):n.forEach(function(t){var r=i(t),n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);n<a&&(a=n)}):"Polygon"===o||"MultiLineString"===o?n.forEach(u):"MultiPolygon"===o&&n.forEach(function(t){return t.forEach(u)});return a}(t,e,r.geometry);return n+=1e6*u.indexOf(r.layer.id),o.includes("Polygon")&&(n-=5e5),{f:r,score:n+=a}}).sort(function(t,e){return t.score-e.score}).map(function(t){return t.f})}(this.map,t,e)}},{key:"getVisibleFeatures",value:function(t){var e=this,r=t.filter(function(t){return e.map.getLayer(t)});return r.length?this.map.queryRenderedFeatures(void 0,{layers:r}):[]}},{key:"addSymbolsToMap",value:(a=$t(Rt().m(function t(e,r,n){var o;return Rt().w(function(t){for(;;)if(0===t.n)return o=this.map.getPixelRatio()||1,t.a(2,bt(this.map,e,r,n,o))},t,this)})),function(t,e,r){return a.apply(this,arguments)})},{key:"addPatternsToMap",value:(o=$t(Rt().m(function t(e,r,n){var o;return Rt().w(function(t){for(;;)if(0===t.n)return o=this.map.getPixelRatio()||1,t.a(2,It(this.map,e,r,n,o))},t,this)})),function(t,e,r){return o.apply(this,arguments)})},{key:"getAreaDimensions",value:function(){return function(t){var e,r,n,o;if(t&&"function"==typeof t.getWest)e=t.getWest(),r=t.getSouth(),n=t.getEast(),o=t.getNorth();else{if(!Array.isArray(t)||2!==t.length)return"";var a=P(t,2),i=P(a[0],2);e=i[0],r=i[1];var u=P(a[1],2);n=u[0],o=u[1]}var l=E([e,r],[n,r]),c=E([e,r],[e,o]),s=j(l),f=j(c);return"".concat(f," by ").concat(s)}((t=this.maplibreModule.LngLatBounds,e=this.map,r=e.getContainer().getBoundingClientRect(),n=r.width,o=r.height,a=e.getPadding(),i=[a.left,o-a.bottom],u=[n-a.right,a.top],new t(e.unproject(i),e.unproject(u))));var t,e,r,n,o,a,i,u}},{key:"getCardinalMove",value:function(t,e){return function(t,e){var r=P(t,2),n=r[0],o=r[1],a=P(e,2),i=a[0],u=a[1],l=u-o,c=i-n,s=[];if(Math.abs(l)>1e-4){var f=Math.round(E([n,o],[n,u]));s.push("".concat(l>0?"north":"south"," ").concat(j(f)))}if(Math.abs(c)>1e-4){var h=Math.round(E([n,o],[i,o]));s.push("".concat(c>0?"east":"west"," ").concat(j(h)))}return s.join(", ")}(t,e)}},{key:"getResolution",value:function(){return t=this.map.getCenter(),e=this.map.getZoom(),r=t.lat,n=Math.pow(2,e),40075016.686*Math.cos(r*Math.PI/180)/(512*n);var t,e,r,n}},{key:"mapToScreen",value:function(t){return this.map.project(t)}},{key:"screenToMap",value:function(t){var e=this.map.unproject([t.x,t.y]);return[e.lng,e.lat]}},{key:"isGeometryObscured",value:function(t,e){return function(t,e,r){var n=r.getContainer().getBoundingClientRect(),o=P(N(t),4),a=o[0],i=o[1],u=o[2],l=o[3],c=[r.project([a,i]),r.project([a,l]),r.project([u,i]),r.project([u,l])],s=Math.min.apply(Math,S(c.map(function(t){return t.x}))),f=Math.max.apply(Math,S(c.map(function(t){return t.x}))),h=Math.min.apply(Math,S(c.map(function(t){return t.y}))),p=Math.max.apply(Math,S(c.map(function(t){return t.y}))),y=e.left-n.left,d=e.top-n.top,v=e.right-n.left,g=e.bottom-n.top;return s<v&&f>y&&h<g&&p>d}(t,e,this.map)}}],n&&zt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,a,i}(i)}}]);
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("defra",[],r):"object"==typeof exports?exports.defra=r():(e.defra=e.defra||{},e.defra.maplibreProvider=r())}(this,()=>(()=>{"use strict";var e,r,t,n,o={},i={};function a(e){var r=i[e];if(void 0!==r)return r.exports;var t=i[e]={exports:{}};return o[e].call(t.exports,t,t.exports,a),t.exports}a.m=o,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);a.r(o);var i={};e=e||[null,r({}),r([]),r(r)];for(var u=2&n&&t;("object"==typeof u||"function"==typeof u)&&!~e.indexOf(u);u=r(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>t[e]);return i.default=()=>t,a.d(o,i),o},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((r,t)=>(a.f[t](e,r),r),[])),a.u=e=>({649:"im-maplibre-framework",772:"im-maplibre-provider"}[e]+".js"),a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="defra.maplibreProvider:",a.l=(e,r,o,i)=>{if(t[e])t[e].push(r);else{var u,c;if(void 0!==o)for(var f=document.getElementsByTagName("script"),l=0;l<f.length;l++){var p=f[l];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==n+o){u=p;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",a.nc&&u.setAttribute("nonce",a.nc),u.setAttribute("data-webpack",n+o),u.src=e),t[e]=[r];var s=(r,n)=>{u.onerror=u.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(n)),r)return r(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var r=a.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={57:0};a.f.j=(r,t)=>{var n=a.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((t,o)=>n=e[r]=[t,o]);t.push(n[2]=o);var i=a.p+a.u(r),u=new Error;a.l(i,t=>{if(a.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;u.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,n[1](u)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[i,u,c]=t,f=0;if(i.some(r=>0!==e[r])){for(n in u)a.o(u,n)&&(a.m[n]=u[n]);c&&c(a)}for(r&&r(t);f<i.length;f++)o=i[f],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var u={};function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}a.d(u,{default:()=>m});var f=function(e){if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var r,t=document.createElement("canvas"),n=!1,o=function(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return c(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw i}}}}(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;try{if((n=t.getContext(i))&&"function"==typeof n.getParameter)return{isEnabled:!0}}catch(e){}}}catch(e){o.e(e)}finally{o.f()}return{isEnabled:!1,error:"WebGL is supported, but disabled"}};function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function p(){var e,r,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,n,o,i){var c=n&&n.prototype instanceof u?n:u,f=Object.create(c.prototype);return s(f,"_invoke",function(t,n,o){var i,u,c,f=0,l=o||[],p=!1,s={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(r,t){return i=r,u=0,c=e,s.n=t,a}};function d(t,n){for(u=t,c=n,r=0;!p&&f&&!o&&r<l.length;r++){var o,i=l[r],d=s.p,b=i[2];t>3?(o=b===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=t<2&&d<i[1])?(u=0,s.v=n,s.n=i[1]):d<b&&(o=t<3||i[0]>n||n>b)&&(i[4]=t,i[5]=n,s.n=b,u=0))}if(o||t>1)return a;throw p=!0,n}return function(o,l,b){if(f>1)throw TypeError("Generator is already running");for(p&&1===l&&d(l,b),u=l,c=b;(r=u<2?e:c)||!p;){i||(u?u<3?(u>1&&(s.n=-1),d(u,c)):s.n=c:s.v=c);try{if(f=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((r=(p=s.n<0)?c:t.call(n,s))!==a)break}catch(r){i=e,u=1,c=r}finally{f=1}}return{value:r,done:p}}}(t,o,i),!0),f}var a={};function u(){}function c(){}function f(){}r=Object.getPrototypeOf;var l=[][n]?r(r([][n]())):(s(r={},n,function(){return this}),r),d=f.prototype=u.prototype=Object.create(l);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,s(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=f,s(d,"constructor",f),s(f,"constructor",c),c.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(d),s(d,o,"Generator"),s(d,n,function(){return this}),s(d,"toString",function(){return"[object Generator]"}),(p=function(){return{w:i,m:b}})()}function s(e,r,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}s=function(e,r,t,n){function i(r,t){s(e,r,function(e){return this._invoke(r,t,e)})}r?o?o(e,r,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[r]=t:(i("next",0),i("throw",1),i("return",2))},s(e,r,t,n)}function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function b(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach(function(r){y(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function y(e,r,t){return(r=function(e){var r=function(e){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=l(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function v(e,r,t,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void t(e)}u.done?r(c):Promise.resolve(c).then(n,o)}function m(){var e,r,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:function(){var e=f(["webgl2","webgl1"]),r=document.documentMode;return{isSupported:e.isEnabled&&"function"==typeof"".replaceAll,error:r?"Internet Explorer is not supported":e.error}},load:(e=p().m(function e(){var r,n,o;return p().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,a.e(649).then(a.t.bind(a,443,19));case 1:return r=e.v,t.workerUrl&&r.setWorkerUrl(t.workerUrl),e.n=2,a.e(772).then(a.bind(a,233));case 2:return n=e.v.default,o=b(b({},t),{},{crs:"EPSG:4326"}),e.a(2,{MapProvider:n,mapProviderConfig:o,mapFramework:r})}},e)}),r=function(){var r=this,t=arguments;return new Promise(function(n,o){var i=e.apply(r,t);function a(e){v(i,n,o,a,u,"next",e)}function u(e){v(i,n,o,a,u,"throw",e)}a(void 0)})},function(){return r.apply(this,arguments)})}}return u.default})());
2
+ !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("defra",[],r):"object"==typeof exports?exports.defra=r():(e.defra=e.defra||{},e.defra.maplibreProvider=r())}(this,()=>(()=>{"use strict";var e,r,t,n,o={},i={};function a(e){var r=i[e];if(void 0!==r)return r.exports;var t=i[e]={exports:{}};return o[e].call(t.exports,t,t.exports,a),t.exports}a.m=o,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);a.r(o);var i={};e=e||[null,r({}),r([]),r(r)];for(var u=2&n&&t;("object"==typeof u||"function"==typeof u)&&!~e.indexOf(u);u=r(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>t[e]);return i.default=()=>t,a.d(o,i),o},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((r,t)=>(a.f[t](e,r),r),[])),a.u=e=>({649:"im-maplibre-framework",772:"im-maplibre-provider"}[e]+".js"),a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="defra.maplibreProvider:",a.l=(e,r,o,i)=>{if(t[e])t[e].push(r);else{var u,c;if(void 0!==o)for(var f=document.getElementsByTagName("script"),l=0;l<f.length;l++){var p=f[l];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==n+o){u=p;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",a.nc&&u.setAttribute("nonce",a.nc),u.setAttribute("data-webpack",n+o),u.src=e),t[e]=[r];var s=(r,n)=>{u.onerror=u.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(n)),r)return r(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var r=a.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={57:0};a.f.j=(r,t)=>{var n=a.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((t,o)=>n=e[r]=[t,o]);t.push(n[2]=o);var i=a.p+a.u(r),u=new Error;a.l(i,t=>{if(a.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;u.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,n[1](u)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[i,u,c]=t,f=0;if(i.some(r=>0!==e[r])){for(n in u)a.o(u,n)&&(a.m[n]=u[n]);c&&c(a)}for(r&&r(t);f<i.length;f++)o=i[f],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var u={};function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}a.d(u,{default:()=>m});var f=function(e){if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var r,t=document.createElement("canvas"),n=!1,o=function(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return c(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw i}}}}(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;try{if((n=t.getContext(i))&&"function"==typeof n.getParameter)return{isEnabled:!0}}catch(e){}}}catch(e){o.e(e)}finally{o.f()}return{isEnabled:!1,error:"WebGL is supported, but disabled"}};function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function p(){var e,r,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,n,o,i){var c=n&&n.prototype instanceof u?n:u,f=Object.create(c.prototype);return s(f,"_invoke",function(t,n,o){var i,u,c,f=0,l=o||[],p=!1,s={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(r,t){return i=r,u=0,c=e,s.n=t,a}};function d(t,n){for(u=t,c=n,r=0;!p&&f&&!o&&r<l.length;r++){var o,i=l[r],d=s.p,b=i[2];t>3?(o=b===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=t<2&&d<i[1])?(u=0,s.v=n,s.n=i[1]):d<b&&(o=t<3||i[0]>n||n>b)&&(i[4]=t,i[5]=n,s.n=b,u=0))}if(o||t>1)return a;throw p=!0,n}return function(o,l,b){if(f>1)throw TypeError("Generator is already running");for(p&&1===l&&d(l,b),u=l,c=b;(r=u<2?e:c)||!p;){i||(u?u<3?(u>1&&(s.n=-1),d(u,c)):s.n=c:s.v=c);try{if(f=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((r=(p=s.n<0)?c:t.call(n,s))!==a)break}catch(r){i=e,u=1,c=r}finally{f=1}}return{value:r,done:p}}}(t,o,i),!0),f}var a={};function u(){}function c(){}function f(){}r=Object.getPrototypeOf;var l=[][n]?r(r([][n]())):(s(r={},n,function(){return this}),r),d=f.prototype=u.prototype=Object.create(l);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,s(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=f,s(d,"constructor",f),s(f,"constructor",c),c.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(d),s(d,o,"Generator"),s(d,n,function(){return this}),s(d,"toString",function(){return"[object Generator]"}),(p=function(){return{w:i,m:b}})()}function s(e,r,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}s=function(e,r,t,n){function i(r,t){s(e,r,function(e){return this._invoke(r,t,e)})}r?o?o(e,r,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[r]=t:(i("next",0),i("throw",1),i("return",2))},s(e,r,t,n)}function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function b(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach(function(r){y(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function y(e,r,t){return(r=function(e){var r=function(e){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=l(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function v(e,r,t,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void t(e)}u.done?r(c):Promise.resolve(c).then(n,o)}function m(){var e,r,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:function(){var e=f(["webgl2","webgl1"]),r=document.documentMode;return{isSupported:e.isEnabled&&"function"==typeof"".replaceAll,error:r?"Internet Explorer is not supported":e.error}},load:(e=p().m(function e(){var r,n,o;return p().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,a.e(649).then(a.t.bind(a,443,19));case 1:return r=e.v,t.workerUrl&&r.setWorkerUrl(t.workerUrl),e.n=2,a.e(772).then(a.bind(a,612));case 2:return n=e.v.default,o=b(b({},t),{},{crs:"EPSG:4326"}),e.a(2,{MapProvider:n,mapProviderConfig:o,mapFramework:r})}},e)}),r=function(){var r=this,t=arguments;return new Promise(function(n,o){var i=e.apply(r,t);function a(e){v(i,n,o,a,u,"next",e)}function u(e){v(i,n,o,a,u,"throw",e)}a(void 0)})},function(){return r.apply(this,arguments)})}}return u.default})());
@@ -0,0 +1,14 @@
1
+ // mapbox-gl-draw duplicates every layer into a `.cold`/`.hot` sibling pair, each backed by its
2
+ // own source — a feature moves from cold into hot the instant any of its properties change,
3
+ // only cooling back down later. Code that resolves a feature through one recorded layerId (a
4
+ // selection payload, a hover layer list) can silently stop finding it once it moves buckets —
5
+ // checking both siblings avoids that. A no-op for any other layer naming.
6
+ export const siblingDrawLayerId = (layerId) => {
7
+ if (layerId.endsWith('.cold')) {
8
+ return `${layerId.slice(0, -'.cold'.length)}.hot`
9
+ }
10
+ if (layerId.endsWith('.hot')) {
11
+ return `${layerId.slice(0, -'.hot'.length)}.cold`
12
+ }
13
+ return null
14
+ }