@defra/interactive-map 0.0.3-alpha → 0.0.4-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 (268) hide show
  1. package/README.md +16 -57
  2. package/dist/esm/im-core.js +1 -1
  3. package/dist/esm/index.js +1 -1
  4. package/dist/umd/im-core.js +1 -1
  5. package/dist/umd/index.js +1 -1
  6. package/docs/api/button-definition.md +176 -0
  7. package/docs/api/context.md +124 -0
  8. package/docs/api/control-definition.md +72 -0
  9. package/docs/api/icon-definition.md +28 -0
  10. package/docs/api/map-style-config.md +76 -0
  11. package/docs/api/marker-config.md +51 -0
  12. package/docs/api/panel-definition.md +117 -0
  13. package/docs/api/slots.md +25 -0
  14. package/docs/api.md +713 -0
  15. package/docs/architecture.md +139 -0
  16. package/docs/building-a-plugin.md +149 -0
  17. package/docs/getting-started.md +46 -0
  18. package/docs/govuk-prototype.md +0 -0
  19. package/docs/plugins/interact.md +205 -0
  20. package/docs/plugins/map-styles.md +84 -0
  21. package/docs/plugins/plugin-context.md +67 -0
  22. package/docs/plugins/plugin-descriptor.md +71 -0
  23. package/docs/plugins/plugin-manifest.md +118 -0
  24. package/docs/plugins/scale-bar.md +62 -0
  25. package/docs/plugins/search.md +162 -0
  26. package/docs/plugins.md +116 -0
  27. package/govuk-prototype-kit.config.json +7 -7
  28. package/package.json +14 -1
  29. package/plugins/beta/datasets/dist/esm/im-datasets-plugin.js +1 -0
  30. package/plugins/beta/datasets/dist/esm/index.js +2 -0
  31. package/plugins/beta/datasets/dist/umd/im-datasets-plugin.js +1 -0
  32. package/plugins/beta/datasets/dist/umd/index.js +2 -0
  33. package/plugins/{datasets → beta/datasets}/src/manifest.js +1 -1
  34. package/plugins/{datasets → beta/datasets}/src/mapLayers.js +1 -1
  35. package/plugins/{datasets → beta/datasets}/src/panels/Key.jsx +1 -1
  36. package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +1 -0
  37. package/plugins/beta/draw-ml/dist/esm/index.js +2 -0
  38. package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +1 -0
  39. package/plugins/beta/draw-ml/dist/umd/index.js +2 -0
  40. package/plugins/{draw-ml → beta/draw-ml}/src/api/editFeature.js +1 -1
  41. package/plugins/beta/draw-ml/src/api/merge.js +9 -0
  42. package/plugins/beta/draw-ml/src/api/newLine.js +43 -0
  43. package/plugins/{draw-ml → beta/draw-ml}/src/api/newPolygon.js +5 -5
  44. package/plugins/beta/draw-ml/src/api/split.js +81 -0
  45. package/plugins/{draw-ml → beta/draw-ml}/src/defaults.js +2 -0
  46. package/plugins/{draw-ml → beta/draw-ml}/src/events.js +105 -3
  47. package/plugins/{draw-ml → beta/draw-ml}/src/manifest.js +17 -11
  48. package/plugins/{draw-ml → beta/draw-ml}/src/mapboxDraw.js +51 -2
  49. package/plugins/{draw-ml → beta/draw-ml}/src/mapboxSnap.js +2 -0
  50. package/plugins/beta/draw-ml/src/modes/createDrawMode.js +496 -0
  51. package/plugins/beta/draw-ml/src/modes/drawLineMode.js +18 -0
  52. package/plugins/beta/draw-ml/src/modes/drawPolygonMode.js +16 -0
  53. package/plugins/beta/draw-ml/src/modes/editVertexMode.js +792 -0
  54. package/plugins/{draw-ml → beta/draw-ml}/src/reducer.js +30 -2
  55. package/plugins/{draw-ml → beta/draw-ml}/src/styles.js +66 -36
  56. package/plugins/beta/draw-ml/src/undoStack.js +50 -0
  57. package/plugins/beta/draw-ml/src/utils/debounce.js +16 -0
  58. package/plugins/beta/draw-ml/src/utils/spatial.js +258 -0
  59. package/plugins/beta/frame/dist/esm/im-frame-plugin.js +1 -0
  60. package/plugins/beta/frame/dist/esm/index.js +2 -0
  61. package/plugins/beta/frame/dist/umd/im-frame-plugin.js +1 -0
  62. package/plugins/beta/frame/dist/umd/index.js +2 -0
  63. package/plugins/beta/map-styles/dist/esm/im-map-styles-plugin.js +1 -0
  64. package/plugins/beta/map-styles/dist/esm/index.js +2 -0
  65. package/plugins/beta/map-styles/dist/umd/im-map-styles-plugin.js +1 -0
  66. package/plugins/beta/map-styles/dist/umd/index.js +2 -0
  67. package/plugins/{map-styles → beta/map-styles}/src/MapStyles.jsx +1 -1
  68. package/plugins/{map-styles → beta/map-styles}/src/manifest.js +8 -10
  69. package/plugins/beta/scale-bar/dist/esm/im-scale-bar-plugin.js +1 -0
  70. package/plugins/beta/scale-bar/dist/esm/index.js +2 -0
  71. package/plugins/beta/scale-bar/dist/umd/im-scale-bar-plugin.js +1 -0
  72. package/plugins/beta/scale-bar/dist/umd/index.js +2 -0
  73. package/plugins/beta/use-location/dist/esm/im-use-location-plugin.js +1 -0
  74. package/plugins/beta/use-location/dist/esm/index.js +2 -0
  75. package/plugins/beta/use-location/dist/umd/im-use-location-plugin.js +1 -0
  76. package/plugins/beta/use-location/dist/umd/index.js +2 -0
  77. package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
  78. package/plugins/interact/dist/esm/index.js +1 -1
  79. package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
  80. package/plugins/interact/dist/umd/index.js +1 -1
  81. package/plugins/interact/src/InteractInit.test.js +97 -0
  82. package/plugins/interact/src/api/clear.test.js +18 -0
  83. package/plugins/interact/src/api/disable.test.js +12 -0
  84. package/plugins/interact/src/api/enable.test.js +48 -0
  85. package/plugins/interact/src/api/selectFeature.test.js +33 -0
  86. package/plugins/interact/src/api/unselectFeature.test.js +33 -0
  87. package/plugins/interact/src/defaults.js +1 -0
  88. package/plugins/interact/src/events.test.js +151 -0
  89. package/plugins/interact/src/hooks/useHighlightSync.test.js +212 -0
  90. package/plugins/interact/src/hooks/useInteractionHandlers.js +14 -7
  91. package/plugins/interact/src/hooks/useInteractionHandlers.test.js +260 -0
  92. package/plugins/interact/src/index.test.js +22 -0
  93. package/plugins/interact/src/manifest.js +1 -1
  94. package/plugins/interact/src/manifest.test.js +94 -0
  95. package/plugins/interact/src/reducer.js +10 -1
  96. package/plugins/interact/src/reducer.test.js +142 -0
  97. package/plugins/interact/src/utils/buildStylesMap.test.js +57 -0
  98. package/plugins/interact/src/utils/featureQueries.test.js +56 -0
  99. package/plugins/interact/src/utils/turfHelpers.js +30 -0
  100. package/plugins/interact/src/utils/turfHelpers.test.js +30 -0
  101. package/plugins/search/dist/esm/im-search-plugin.js +1 -1
  102. package/plugins/search/dist/esm/index.js +1 -1
  103. package/plugins/search/dist/umd/im-search-plugin.js +1 -1
  104. package/plugins/search/dist/umd/index.js +1 -1
  105. package/plugins/search/src/utils/parseOsNamesResults.js +3 -7
  106. package/providers/{esri → beta/esri}/src/mapEvents.js +2 -2
  107. package/providers/beta/open-names/dist/esm/im-reverse-geocode.js +2 -0
  108. package/providers/beta/open-names/dist/esm/index.js +2 -0
  109. package/providers/beta/open-names/dist/umd/im-reverse-geocode.js +2 -0
  110. package/providers/beta/open-names/dist/umd/index.js +2 -0
  111. package/providers/maplibre/dist/esm/im-maplibre-framework.js +1 -1
  112. package/providers/maplibre/dist/esm/im-maplibre-framework.js.LICENSE.txt +1 -1
  113. package/providers/maplibre/dist/esm/im-maplibre-legacy-framework.js +1 -1
  114. package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
  115. package/providers/maplibre/dist/esm/index.js +1 -1
  116. package/providers/maplibre/dist/umd/im-maplibre-framework.js +1 -1
  117. package/providers/maplibre/dist/umd/im-maplibre-framework.js.LICENSE.txt +1 -1
  118. package/providers/maplibre/dist/umd/im-maplibre-legacy-framework.js +1 -1
  119. package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
  120. package/providers/maplibre/dist/umd/index.js +1 -1
  121. package/providers/maplibre/src/index.js +14 -1
  122. package/providers/maplibre/src/maplibreProvider.js +127 -0
  123. package/sonar-project.properties +1 -1
  124. package/src/App/hooks/useInterfaceAPI.js +24 -1
  125. package/src/App/renderer/mapButtons.js +1 -1
  126. package/src/App/store/appActionsMap.js +22 -1
  127. package/src/InteractiveMap/InteractiveMap.js +114 -6
  128. package/src/config/defaults.js +29 -20
  129. package/src/config/events.js +110 -4
  130. package/src/index.js +5 -2
  131. package/src/scss/tools/_border-focus.scss +20 -4
  132. package/src/types.js +585 -0
  133. package/webpack.esm.mjs +8 -8
  134. package/webpack.umd.mjs +8 -8
  135. package/plugins/datasets/dist/esm/im-datasets-plugin.js +0 -1
  136. package/plugins/datasets/dist/esm/index.js +0 -2
  137. package/plugins/datasets/dist/umd/im-datasets-plugin.js +0 -1
  138. package/plugins/datasets/dist/umd/index.js +0 -2
  139. package/plugins/draw-ml/dist/esm/im-draw-ml-plugin.js +0 -1
  140. package/plugins/draw-ml/dist/esm/index.js +0 -2
  141. package/plugins/draw-ml/dist/umd/im-draw-ml-plugin.js +0 -1
  142. package/plugins/draw-ml/dist/umd/index.js +0 -2
  143. package/plugins/draw-ml/src/modes/drawVertexMode.js +0 -275
  144. package/plugins/draw-ml/src/modes/editVertexMode.js +0 -426
  145. package/plugins/draw-ml/src/utils.js +0 -102
  146. package/plugins/frame/dist/esm/im-frame-plugin.js +0 -1
  147. package/plugins/frame/dist/esm/index.js +0 -2
  148. package/plugins/frame/dist/umd/im-frame-plugin.js +0 -1
  149. package/plugins/frame/dist/umd/index.js +0 -2
  150. package/plugins/map-styles/dist/esm/im-map-styles-plugin.js +0 -1
  151. package/plugins/map-styles/dist/esm/index.js +0 -2
  152. package/plugins/map-styles/dist/umd/im-map-styles-plugin.js +0 -1
  153. package/plugins/map-styles/dist/umd/index.js +0 -2
  154. package/plugins/scale-bar/dist/esm/im-scale-bar-plugin.js +0 -1
  155. package/plugins/scale-bar/dist/esm/index.js +0 -2
  156. package/plugins/scale-bar/dist/umd/im-scale-bar-plugin.js +0 -1
  157. package/plugins/scale-bar/dist/umd/index.js +0 -2
  158. package/plugins/use-location/dist/esm/im-use-location-plugin.js +0 -1
  159. package/plugins/use-location/dist/esm/index.js +0 -2
  160. package/plugins/use-location/dist/umd/im-use-location-plugin.js +0 -1
  161. package/plugins/use-location/dist/umd/index.js +0 -2
  162. package/providers/open-names/dist/esm/im-reverse-geocode.js +0 -2
  163. package/providers/open-names/dist/esm/index.js +0 -2
  164. package/providers/open-names/dist/umd/im-reverse-geocode.js +0 -2
  165. package/providers/open-names/dist/umd/index.js +0 -2
  166. /package/docs/architecture/{ARCHITECTURE_DIAGRAMS.md → architecture-diagrams.md} +0 -0
  167. /package/plugins/{datasets → beta/datasets}/dist/css/index.css +0 -0
  168. /package/plugins/{datasets → beta/datasets}/dist/esm/index.js.LICENSE.txt +0 -0
  169. /package/plugins/{datasets → beta/datasets}/dist/umd/index.js.LICENSE.txt +0 -0
  170. /package/plugins/{datasets → beta/datasets}/src/DatasetsInit.jsx +0 -0
  171. /package/plugins/{datasets → beta/datasets}/src/api/addDataset.js +0 -0
  172. /package/plugins/{datasets → beta/datasets}/src/api/hideDataset.js +0 -0
  173. /package/plugins/{datasets → beta/datasets}/src/api/hideFeatures.js +0 -0
  174. /package/plugins/{datasets → beta/datasets}/src/api/removeDataset.js +0 -0
  175. /package/plugins/{datasets → beta/datasets}/src/api/showDataset.js +0 -0
  176. /package/plugins/{datasets → beta/datasets}/src/api/showFeatures.js +0 -0
  177. /package/plugins/{datasets → beta/datasets}/src/datasets.js +0 -0
  178. /package/plugins/{datasets → beta/datasets}/src/datasets.scss +0 -0
  179. /package/plugins/{datasets → beta/datasets}/src/defaults.js +0 -0
  180. /package/plugins/{datasets → beta/datasets}/src/handleSetMapStyle.js +0 -0
  181. /package/plugins/{datasets → beta/datasets}/src/index.js +0 -0
  182. /package/plugins/{datasets → beta/datasets}/src/panels/Key.module.scss +0 -0
  183. /package/plugins/{datasets → beta/datasets}/src/panels/Layers.jsx +0 -0
  184. /package/plugins/{datasets → beta/datasets}/src/panels/Layers.module.scss +0 -0
  185. /package/plugins/{datasets → beta/datasets}/src/reducer.js +0 -0
  186. /package/plugins/{datasets → beta/datasets}/src/utils/bbox.js +0 -0
  187. /package/plugins/{datasets → beta/datasets}/src/utils/debounce.js +0 -0
  188. /package/plugins/{datasets → beta/datasets}/src/utils/filters.js +0 -0
  189. /package/plugins/{draw-es → beta/draw-es}/src/DrawInit.jsx +0 -0
  190. /package/plugins/{draw-es → beta/draw-es}/src/api/addFeature.js +0 -0
  191. /package/plugins/{draw-es → beta/draw-es}/src/api/deleteFeature.js +0 -0
  192. /package/plugins/{draw-es → beta/draw-es}/src/api/editFeature.js +0 -0
  193. /package/plugins/{draw-es → beta/draw-es}/src/api/newPolygon.js +0 -0
  194. /package/plugins/{draw-es → beta/draw-es}/src/events.js +0 -0
  195. /package/plugins/{draw-es → beta/draw-es}/src/graphic.js +0 -0
  196. /package/plugins/{draw-es → beta/draw-es}/src/index.js +0 -0
  197. /package/plugins/{draw-es → beta/draw-es}/src/manifest.js +0 -0
  198. /package/plugins/{draw-es → beta/draw-es}/src/reducer.js +0 -0
  199. /package/plugins/{draw-es → beta/draw-es}/src/sketchViewModel.js +0 -0
  200. /package/plugins/{draw-ml → beta/draw-ml}/dist/css/index.css +0 -0
  201. /package/plugins/{draw-ml → beta/draw-ml}/dist/esm/index.js.LICENSE.txt +0 -0
  202. /package/plugins/{draw-ml → beta/draw-ml}/dist/umd/index.js.LICENSE.txt +0 -0
  203. /package/plugins/{draw-ml → beta/draw-ml}/src/DrawInit.jsx +0 -0
  204. /package/plugins/{draw-ml → beta/draw-ml}/src/api/addFeature.js +0 -0
  205. /package/plugins/{draw-ml → beta/draw-ml}/src/api/deleteFeature.js +0 -0
  206. /package/plugins/{draw-ml → beta/draw-ml}/src/draw.scss +0 -0
  207. /package/plugins/{draw-ml → beta/draw-ml}/src/index.js +0 -0
  208. /package/plugins/{draw-ml → beta/draw-ml}/src/modes/disabledMode.js +0 -0
  209. /package/plugins/{draw-ml/src → beta/draw-ml/src/utils}/snapHelpers.js +0 -0
  210. /package/plugins/{frame → beta/frame}/dist/css/index.css +0 -0
  211. /package/plugins/{frame → beta/frame}/dist/esm/index.js.LICENSE.txt +0 -0
  212. /package/plugins/{frame → beta/frame}/dist/umd/index.js.LICENSE.txt +0 -0
  213. /package/plugins/{frame → beta/frame}/package.json +0 -0
  214. /package/plugins/{frame → beta/frame}/src/Frame.jsx +0 -0
  215. /package/plugins/{frame → beta/frame}/src/FrameInit.jsx +0 -0
  216. /package/plugins/{frame → beta/frame}/src/api/addFrame.js +0 -0
  217. /package/plugins/{frame → beta/frame}/src/api/editFeature.js +0 -0
  218. /package/plugins/{frame → beta/frame}/src/config.js +0 -0
  219. /package/plugins/{frame → beta/frame}/src/frame.scss +0 -0
  220. /package/plugins/{frame → beta/frame}/src/index.js +0 -0
  221. /package/plugins/{frame → beta/frame}/src/manifest.js +0 -0
  222. /package/plugins/{frame → beta/frame}/src/reducer.js +0 -0
  223. /package/plugins/{frame → beta/frame}/src/utils.js +0 -0
  224. /package/plugins/{map-styles → beta/map-styles}/dist/css/index.css +0 -0
  225. /package/plugins/{map-styles → beta/map-styles}/dist/esm/index.js.LICENSE.txt +0 -0
  226. /package/plugins/{map-styles → beta/map-styles}/dist/umd/index.js.LICENSE.txt +0 -0
  227. /package/plugins/{map-styles → beta/map-styles}/src/MapStylesInit.jsx +0 -0
  228. /package/plugins/{map-styles → beta/map-styles}/src/config.js +0 -0
  229. /package/plugins/{map-styles → beta/map-styles}/src/index.js +0 -0
  230. /package/plugins/{map-styles → beta/map-styles}/src/mapStyles.scss +0 -0
  231. /package/plugins/{scale-bar → beta/scale-bar}/dist/css/index.css +0 -0
  232. /package/plugins/{scale-bar → beta/scale-bar}/dist/esm/index.js.LICENSE.txt +0 -0
  233. /package/plugins/{scale-bar → beta/scale-bar}/dist/umd/index.js.LICENSE.txt +0 -0
  234. /package/plugins/{scale-bar → beta/scale-bar}/package.json +0 -0
  235. /package/plugins/{scale-bar → beta/scale-bar}/src/ScaleBar.jsx +0 -0
  236. /package/plugins/{scale-bar → beta/scale-bar}/src/ScaleBar.test.jsx +0 -0
  237. /package/plugins/{scale-bar → beta/scale-bar}/src/index.js +0 -0
  238. /package/plugins/{scale-bar → beta/scale-bar}/src/index.test.js +0 -0
  239. /package/plugins/{scale-bar → beta/scale-bar}/src/manifest.js +0 -0
  240. /package/plugins/{scale-bar → beta/scale-bar}/src/scaleBar.scss +0 -0
  241. /package/plugins/{scale-bar → beta/scale-bar}/src/utils.js +0 -0
  242. /package/plugins/{scale-bar → beta/scale-bar}/src/utils.test.js +0 -0
  243. /package/plugins/{use-location → beta/use-location}/dist/esm/index.js.LICENSE.txt +0 -0
  244. /package/plugins/{use-location → beta/use-location}/dist/umd/index.js.LICENSE.txt +0 -0
  245. /package/plugins/{use-location → beta/use-location}/src/UseLocation.jsx +0 -0
  246. /package/plugins/{use-location → beta/use-location}/src/UseLocationInit.jsx +0 -0
  247. /package/plugins/{use-location → beta/use-location}/src/defaults.js +0 -0
  248. /package/plugins/{use-location → beta/use-location}/src/events.js +0 -0
  249. /package/plugins/{use-location → beta/use-location}/src/index.js +0 -0
  250. /package/plugins/{use-location → beta/use-location}/src/manifest.js +0 -0
  251. /package/plugins/{use-location → beta/use-location}/src/reducer.js +0 -0
  252. /package/providers/{esri → beta/esri}/src/appEvents.js +0 -0
  253. /package/providers/{esri → beta/esri}/src/defaults.js +0 -0
  254. /package/providers/{esri → beta/esri}/src/esriProvider.js +0 -0
  255. /package/providers/{esri → beta/esri}/src/esriProvider.scss +0 -0
  256. /package/providers/{esri → beta/esri}/src/index.js +0 -0
  257. /package/providers/{esri → beta/esri}/src/utils/coords.js +0 -0
  258. /package/providers/{esri → beta/esri}/src/utils/detectWebGL.js +0 -0
  259. /package/providers/{esri → beta/esri}/src/utils/esriFixes.js +0 -0
  260. /package/providers/{esri → beta/esri}/src/utils/query.js +0 -0
  261. /package/providers/{esri → beta/esri}/src/utils/spatial.js +0 -0
  262. /package/providers/{open-names → beta/open-names}/dist/esm/im-reverse-geocode.js.LICENSE.txt +0 -0
  263. /package/providers/{open-names → beta/open-names}/dist/esm/index.js.LICENSE.txt +0 -0
  264. /package/providers/{open-names → beta/open-names}/dist/umd/im-reverse-geocode.js.LICENSE.txt +0 -0
  265. /package/providers/{open-names → beta/open-names}/dist/umd/index.js.LICENSE.txt +0 -0
  266. /package/providers/{open-names → beta/open-names}/src/index.js +0 -0
  267. /package/providers/{open-names → beta/open-names}/src/reverseGeocode.js +0 -0
  268. /package/providers/{open-names → beta/open-names}/src/utils/mapToLocationModel.js +0 -0
@@ -0,0 +1,71 @@
1
+ # PluginDescriptor
2
+
3
+ Descriptor for lazy-loading a plugin.
4
+
5
+ ## Creating a Plugin Descriptor
6
+
7
+ Plugins typically export a factory function that returns a PluginDescriptor. This pattern allows configuration to be passed when registering the plugin:
8
+
9
+ ```js
10
+ // scale-bar/index.js
11
+ export default function createPlugin ({ units = 'metric' } = {}) {
12
+ return {
13
+ id: 'scaleBar',
14
+ units,
15
+ load: async () => {
16
+ const { manifest } = await import('./manifest.js')
17
+ return manifest
18
+ }
19
+ }
20
+ }
21
+ ```
22
+
23
+ Any properties passed to the factory (except `id` and `load`) are available as [pluginConfig](./plugin-context.md#pluginconfig) within the plugin:
24
+
25
+ ```js
26
+ // Registering the plugin with configuration
27
+ import createScaleBarPlugin from '@defra/interactive-map-plugin-scale-bar'
28
+
29
+ const interactiveMap = new InteractiveMap({
30
+ plugins: [
31
+ createScaleBarPlugin({ units: 'imperial' })
32
+ ]
33
+ })
34
+ ```
35
+
36
+ ```js
37
+ // Accessing configuration within the plugin
38
+ export function ScaleBar ({ mapState, pluginConfig }) {
39
+ const { units } = pluginConfig
40
+ // ...
41
+ }
42
+ ```
43
+
44
+ ## Properties
45
+
46
+ ---
47
+
48
+ ### `id`
49
+ **Type:** `string`
50
+ **Required**
51
+
52
+ Unique plugin identifier.
53
+
54
+ ---
55
+
56
+ ### `load`
57
+ **Type:** `function`
58
+ **Required**
59
+
60
+ Async function that loads and returns a [PluginManifest](./plugin-manifest.md).
61
+
62
+ ```ts
63
+ () => Promise<PluginManifest>
64
+ ```
65
+
66
+ ---
67
+
68
+ ### `manifest`
69
+ **Type:** `Partial<PluginManifest>`
70
+
71
+ Optional manifest overrides. Allows overriding properties of the loaded [PluginManifest](./plugin-manifest.md).
@@ -0,0 +1,118 @@
1
+ # PluginManifest
2
+
3
+ Manifest defining a plugin's buttons, panels, controls, icons, API methods, and state.
4
+
5
+ ## Properties
6
+
7
+ ---
8
+
9
+ ### `api`
10
+ **Type:** `Object`
11
+
12
+ Public methods exposed by the plugin for external use. These methods can be called via the plugin instance:
13
+
14
+ ```js
15
+ myPlugin.doSomething()
16
+ ```
17
+
18
+ Each function receives a [PluginContext](./plugin-context.md) as its first argument, providing access to app state, map provider, services, and more. Additional arguments follow.
19
+
20
+ ```js
21
+ {
22
+ doSomething: (context) => {
23
+ console.log(context.appState.breakpoint)
24
+ },
25
+ getValue: (context, id) => {
26
+ return context.pluginState[id]
27
+ }
28
+ }
29
+ ```
30
+
31
+ ---
32
+
33
+ ### `buttons`
34
+ **Type:** `ButtonDefinition[]`
35
+
36
+ Button definitions to register in the UI.
37
+
38
+ Buttons come with pre-built behaviour and styling, including icon support, labels, tooltips, and pressed states. Supports responsive breakpoint configuration.
39
+
40
+ See [ButtonDefinition](../api/button-definition.md) for full details.
41
+
42
+ ---
43
+
44
+ ### `controls`
45
+ **Type:** `ControlDefinition[]`
46
+
47
+ Custom control definitions to register in the UI.
48
+
49
+ Use controls for bespoke UI elements that don't fit the button or panel pattern. Controls have no pre-built behaviour or styling—you have full control over rendering and interaction. Supports responsive breakpoint configuration.
50
+
51
+ See [ControlDefinition](../api/control-definition.md) for full details.
52
+
53
+ ---
54
+
55
+ ### `icons`
56
+ **Type:** `IconDefinition[]`
57
+
58
+ Icon definitions to register in the icon registry.
59
+
60
+ The icon registry is a singleton shared across all map instances and plugins. Registering an icon with an existing ID will override it. This enforces visual consistency across the application, including when multiple map instances exist on the same page.
61
+
62
+ See [IconDefinition](../api/icon-definition.md) for full details.
63
+
64
+ ---
65
+
66
+ ### `InitComponent`
67
+ **Type:** `ComponentType`
68
+
69
+ A React/Preact component rendered when the plugin loads. Use this for initialisation logic, side effects, or rendering hidden UI elements.
70
+
71
+ - Mounted once when the app loads
72
+ - Re-renders when [PluginContext](./plugin-context.md) state changes (e.g., `appState`, `pluginState`, `mapState`)
73
+ - Typically returns `null` if no visible UI is needed
74
+
75
+ ```jsx
76
+ const InitComponent = ({ context }) => {
77
+ const { appState, mapProvider, pluginState } = context
78
+
79
+ useEffect(() => {
80
+ // Run side effects when state changes
81
+ console.log('Breakpoint:', appState.breakpoint)
82
+ }, [appState.breakpoint])
83
+
84
+ return null
85
+ }
86
+ ```
87
+
88
+ ---
89
+
90
+ ### `panels`
91
+ **Type:** `PanelDefinition[]`
92
+
93
+ Panel definitions to register in the UI.
94
+
95
+ Panels come with pre-built behaviour and styling, including headings, dismissable states, and modal overlays. Supports responsive breakpoint configuration.
96
+
97
+ See [PanelDefinition](../api/panel-definition.md) for full details.
98
+
99
+ ---
100
+
101
+ ### `reducer`
102
+ **Type:** `Object`
103
+
104
+ Reducer configuration for plugin state management.
105
+
106
+ ```js
107
+ {
108
+ initialState: {
109
+ isActive: false
110
+ },
111
+ actions: {
112
+ setActive: (state, isActive) => ({
113
+ ...state,
114
+ isActive
115
+ })
116
+ }
117
+ }
118
+ ```
@@ -0,0 +1,62 @@
1
+ # Scale Bar Plugin
2
+
3
+ Displays the current map scale. The scale bar automatically updates as the user zooms in and out.
4
+
5
+ ## Usage
6
+
7
+ ```js
8
+ import createScaleBarPlugin from '@defra/interactive-map/plugins/scale-bar'
9
+
10
+ const scaleBarPlugin = createScaleBarPlugin({
11
+ units: 'metric'
12
+ })
13
+
14
+ const interactiveMap = new InteractiveMap({
15
+ plugins: [scaleBarPlugin]
16
+ })
17
+ ```
18
+
19
+ ## Options
20
+
21
+ Options are passed to the factory function when creating the plugin.
22
+
23
+ ---
24
+
25
+ ### `units`
26
+ **Type:** `'metric' | 'imperial'`
27
+ **Default:** `'metric'`
28
+
29
+ The unit system used to display the scale.
30
+
31
+ | Value | Description |
32
+ |-------|-------------|
33
+ | `'metric'` | Displays scale in metres and kilometres |
34
+ | `'imperial'` | Displays scale in feet and miles |
35
+
36
+ ```js
37
+ createScaleBarPlugin({ units: 'imperial' })
38
+ ```
39
+
40
+ ---
41
+
42
+ ### `includeModes`
43
+ **Type:** `string[]`
44
+
45
+ Array of mode identifiers. When set, the plugin only renders when the app is in one of these modes.
46
+
47
+ ---
48
+
49
+ ### `excludeModes`
50
+ **Type:** `string[]`
51
+
52
+ Array of mode identifiers. When set, the plugin does not render when the app is in one of these modes.
53
+
54
+ ---
55
+
56
+ ## Methods
57
+
58
+ This plugin does not expose any public methods.
59
+
60
+ ## Events
61
+
62
+ This plugin does not emit any custom events.
@@ -0,0 +1,162 @@
1
+ # Search Plugin
2
+
3
+ Location search plugin with autocomplete functionality. Supports custom datasets for searching locations, addresses, or other geographic features.
4
+
5
+ ## Usage
6
+
7
+ ```js
8
+ import createSearchPlugin from '@defra/interactive-map/plugins/search'
9
+
10
+ const searchPlugin = createSearchPlugin({
11
+ showMarker: true,
12
+ datasets: [
13
+ {
14
+ id: 'os-places',
15
+ url: '/api/search',
16
+ minChars: 3
17
+ }
18
+ ]
19
+ })
20
+
21
+ const interactiveMap = new InteractiveMap({
22
+ plugins: [searchPlugin]
23
+ })
24
+ ```
25
+
26
+ ## Options
27
+
28
+ Options are passed to the factory function when creating the plugin.
29
+
30
+ ---
31
+
32
+ ### `showMarker`
33
+ **Type:** `boolean`
34
+ **Default:** `true`
35
+
36
+ Whether to display a marker at the selected location.
37
+
38
+ ---
39
+
40
+ ### `datasets`
41
+ **Type:** `SearchDataset[]`
42
+
43
+ Array of dataset configurations for search. Each dataset defines a source for search suggestions.
44
+
45
+ ```js
46
+ createSearchPlugin({
47
+ datasets: [
48
+ {
49
+ id: 'os-places',
50
+ url: '/api/os-places/search',
51
+ minChars: 3,
52
+ params: {
53
+ maxResults: 10
54
+ }
55
+ }
56
+ ]
57
+ })
58
+ ```
59
+
60
+ ---
61
+
62
+ ### `isExpanded`
63
+ **Type:** `boolean`
64
+ **Default:** `false`
65
+
66
+ Whether the search input is initially expanded on mobile devices.
67
+
68
+ ---
69
+
70
+ ### `markerColor`
71
+ **Type:** `string`
72
+
73
+ Colour of the search result marker. Overrides the default `markerColor` option.
74
+
75
+ ---
76
+
77
+ ### `includeModes`
78
+ **Type:** `string[]`
79
+
80
+ Array of mode identifiers. When set, the plugin only renders when the app is in one of these modes.
81
+
82
+ ---
83
+
84
+ ### `excludeModes`
85
+ **Type:** `string[]`
86
+
87
+ Array of mode identifiers. When set, the plugin does not render when the app is in one of these modes.
88
+
89
+ ---
90
+
91
+ ## Methods
92
+
93
+ This plugin does not expose any public methods.
94
+
95
+ ## Events
96
+
97
+ Subscribe to events using `interactiveMap.on()`.
98
+
99
+ ---
100
+
101
+ ### `search:match`
102
+
103
+ Emitted when a search result is selected.
104
+
105
+ **Payload:**
106
+ ```js
107
+ {
108
+ query: 'London',
109
+ text: 'London, Greater London',
110
+ point: [lng, lat],
111
+ bounds: [west, south, east, north]
112
+ }
113
+ ```
114
+
115
+ ```js
116
+ interactiveMap.on('search:match', ({ query, point, bounds }) => {
117
+ console.log('Location selected:', query)
118
+ console.log('Coordinates:', point)
119
+ })
120
+ ```
121
+
122
+ ---
123
+
124
+ ### `search:open`
125
+
126
+ Emitted when the search input is expanded (mobile only).
127
+
128
+ **Payload:** None
129
+
130
+ ```js
131
+ interactiveMap.on('search:open', () => {
132
+ console.log('Search opened')
133
+ })
134
+ ```
135
+
136
+ ---
137
+
138
+ ### `search:close`
139
+
140
+ Emitted when the search input is collapsed or dismissed.
141
+
142
+ **Payload:** None
143
+
144
+ ```js
145
+ interactiveMap.on('search:close', () => {
146
+ console.log('Search closed')
147
+ })
148
+ ```
149
+
150
+ ---
151
+
152
+ ### `search:clear`
153
+
154
+ Emitted when the search input is cleared.
155
+
156
+ **Payload:** None
157
+
158
+ ```js
159
+ interactiveMap.on('search:clear', () => {
160
+ console.log('Search cleared')
161
+ })
162
+ ```
@@ -0,0 +1,116 @@
1
+ # Plugins
2
+
3
+ Plugins extend the InteractiveMap with additional functionality. This page lists the available plugins and links to their documentation.
4
+
5
+ For guidance on building your own plugins, see [Building a Plugin](./building-a-plugin.md).
6
+
7
+ ## Available Plugins
8
+
9
+ The following plugins are available for use with InteractiveMap.
10
+
11
+ ### [Interact](./plugins/interact.md)
12
+
13
+ Select features or place markers on the map.
14
+
15
+ ### [Map Styles](./plugins/map-styles.md)
16
+
17
+ Map style switching plugin that adds a UI control for changing the basemap appearance and the map size (provider depending).
18
+
19
+ ### [Scale Bar](./plugins/scale-bar.md)
20
+
21
+ Scale bar display plugin that shows the current map scale.
22
+
23
+ ### [Search](./plugins/search.md)
24
+
25
+ Location search plugin with autocomplete functionality. Include custom datasets to search.
26
+
27
+ ## Alpha Plugins
28
+
29
+ The following plugins are in early development. APIs and features may change.
30
+
31
+ ### Datasets
32
+
33
+ Add datasets to your map, configure the display, layer toggling and render a key of symbology.
34
+
35
+ ### Draw for MapLibre
36
+
37
+ Draw lines and polygons using the MapLibre map provider.
38
+
39
+ ### Draw for ESRI SDK
40
+
41
+ Draw polygons using the Esri map provider.
42
+
43
+ ### Frame
44
+
45
+ Add a regular shaped frame to the map and control its position. Use to generate reports or draw features.
46
+
47
+ ### Use Location
48
+
49
+ Geolocation plugin that allows users to centre the map on their current location.
50
+
51
+ ## Coming Soon
52
+
53
+ The following plugins are planned for future releases.
54
+
55
+ ### Geometry Actions
56
+
57
+ Split and merge polygons.
58
+
59
+ ## Using Plugins
60
+
61
+ Plugins are registered via the `plugins` option when creating an InteractiveMap. Plugins typically export a factory function that accepts configuration options:
62
+
63
+ ```js
64
+ import createHighlightPlugin from '@example/highlight-plugin'
65
+
66
+ const highlightPlugin = createHighlightPlugin({
67
+ color: '#ff0000',
68
+ opacity: 0.5
69
+ })
70
+
71
+ const interactiveMap = new InteractiveMap({
72
+ // ... other options
73
+ plugins: [highlightPlugin]
74
+ })
75
+ ```
76
+
77
+ The factory function returns a [PluginDescriptor](./plugins/plugin-descriptor.md) with:
78
+
79
+ - **id** - Unique identifier for the plugin instance
80
+ - **load** - Function that returns a [PluginManifest](./plugins/plugin-manifest.md)
81
+ - **...options** - Configuration passed to the factory, available as [pluginConfig](./plugins/plugin-context.md#pluginconfig)
82
+
83
+ ## Plugin Events
84
+
85
+ Plugins can emit events that you can listen to using `interactiveMap.on()`:
86
+
87
+ ```js
88
+ interactiveMap.on('highlight:added', ({ id, coords }) => {
89
+ console.log('Highlight added:', id)
90
+ })
91
+
92
+ interactiveMap.on('highlight:removed', ({ id }) => {
93
+ console.log('Highlight removed:', id)
94
+ })
95
+ ```
96
+
97
+ ## Plugin Methods
98
+
99
+ Plugins can expose methods that you call on the plugin instance:
100
+
101
+ ```js
102
+ // After map:ready, call methods on the plugin instance
103
+ interactiveMap.on('map:ready', () => {
104
+ highlightPlugin.add('area-1', [[0, 0], [1, 0], [1, 1], [0, 1]])
105
+ highlightPlugin.remove('area-1')
106
+ })
107
+ ```
108
+
109
+ See individual plugin documentation for available events and methods.
110
+
111
+ ## Further Reading
112
+
113
+ - [Building a Plugin](./building-a-plugin.md) - Guide to creating custom plugins
114
+ - [PluginDescriptor](./plugins/plugin-descriptor.md) - Plugin registration reference
115
+ - [PluginManifest](./plugins/plugin-manifest.md) - Plugin manifest reference
116
+ - [PluginContext](./plugins/plugin-context.md) - Context available to plugin code
@@ -11,14 +11,14 @@
11
11
  "/dist/css/",
12
12
  "/dist/umd/",
13
13
  "/providers/maplibre/dist",
14
- "/providers/open-names/dist",
15
- "/plugins/datasets/dist",
14
+ "/providers/beta/open-names/dist",
15
+ "/plugins/beta/datasets/dist",
16
16
  "/plugins/interact/dist",
17
- "/plugins/map-styles/dist",
18
- "/plugins/scale-bar/dist",
17
+ "/plugins/beta/map-styles/dist",
18
+ "/plugins/beta/scale-bar/dist",
19
19
  "/plugins/search/dist",
20
- "/plugins/use-location/dist",
21
- "/plugins/draw-ml/dist",
22
- "/plugins/frame/dist"
20
+ "/plugins/beta/use-location/dist",
21
+ "/plugins/beta/draw-ml/dist",
22
+ "/plugins/beta/frame/dist"
23
23
  ]
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/interactive-map",
3
- "version": "0.0.3-alpha",
3
+ "version": "0.0.4-alpha",
4
4
  "description": "An accessible map component",
5
5
  "main": "dist/umd/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -61,6 +61,7 @@
61
61
  "@mapbox/mapbox-gl-draw": "^1.5.0",
62
62
  "@testing-library/jest-dom": "^6.6.3",
63
63
  "@testing-library/react": "^16.3.0",
64
+ "@types/geojson": "^7946.0.16",
64
65
  "@types/react": "^19.1.8",
65
66
  "@types/react-dom": "^19.1.6",
66
67
  "babel-loader": "^10.0.0",
@@ -72,11 +73,13 @@
72
73
  "express-static-gzip": "^3.0.0",
73
74
  "geodesy": "^2.4.0",
74
75
  "html-webpack-plugin": "^5.6.3",
76
+ "install": "^0.13.0",
75
77
  "jest": "^29.7.0",
76
78
  "jest-environment-jsdom": "^30.0.4",
77
79
  "mapbox-gl-snap": "^1.1.9",
78
80
  "mini-css-extract-plugin": "^2.9.2",
79
81
  "node-fetch": "^3.3.2",
82
+ "npm": "^11.8.0",
80
83
  "npm-run-all": "^4.1.5",
81
84
  "prettier": "^3.6.2",
82
85
  "react": "^19.2.0",
@@ -107,15 +110,25 @@
107
110
  ],
108
111
  "author": "",
109
112
  "license": "",
113
+ "overrides": {
114
+ "@turf/bearing": "^7.3.3"
115
+ },
110
116
  "dependencies": {
111
117
  "@arcgis/core": "^4.34.8",
112
118
  "@turf/area": "^7.2.0",
119
+ "@turf/bearing": "^7.3.3",
120
+ "@turf/boolean-disjoint": "^7.3.3",
113
121
  "@turf/boolean-valid": "^7.2.0",
122
+ "@turf/destination": "^7.3.3",
114
123
  "@turf/helpers": "^7.2.0",
124
+ "@turf/line-intersect": "^7.3.3",
125
+ "@turf/point-to-line-distance": "^7.3.3",
126
+ "@turf/polygon-to-line": "^7.3.3",
115
127
  "core-js": "^3.44.0",
116
128
  "govuk-frontend": "^5.13.0",
117
129
  "maplibre-gl": "^5.15.0",
118
130
  "maplibre-gl-legacy": "npm:maplibre-gl@1.15.3",
131
+ "polygon-splitter": "^0.0.11",
119
132
  "preact": "^10.27.2"
120
133
  }
121
134
  }
@@ -0,0 +1 @@
1
+ export const __webpack_esm_id__="im-datasets-plugin";export const __webpack_esm_ids__=["im-datasets-plugin"];export const __webpack_esm_modules__={"./plugins/beta/datasets/src/manifest.js"(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 i(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return o(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)?o(t,e):void 0}}(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 o(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 a(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 l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=u(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(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.d(e,{manifest:()=>M}),r.r(e);var c={SET_DATASETS:function(t,e){var r=e.datasets,n=e.datasetDefaults;return l(l({},t),{},{datasets:r.map(function(t){return l(l({},n),t)})})},ADD_DATASET:function(t,e){var r=e.dataset,n=e.datasetDefaults;return l(l({},t),{},{datasets:[].concat(i(t.datasets||[]),[l(l({},n),r)])})},REMOVE_DATASET:function(t,e){var r,n=e.id;return l(l({},t),{},{datasets:(null===(r=t.datasets)||void 0===r?void 0:r.filter(function(t){return t.id!==n}))||[]})},SET_DATASET_VISIBILITY:function(t,e){var r,n=e.id,i=e.visibility;return l(l({},t),{},{datasets:null===(r=t.datasets)||void 0===r?void 0:r.map(function(t){return t.id===n?l(l({},t),{},{visibility:i}):t})})},HIDE_FEATURES:function(t,e){var r=e.layerId,n=e.idProperty,o=e.featureIds,a=t.hiddenFeatures[r],u=(null==a?void 0:a.ids)||[],c=i(new Set([].concat(i(u),i(o))));return l(l({},t),{},{hiddenFeatures:l(l({},t.hiddenFeatures),{},s({},r,{idProperty:n,ids:c}))})},SHOW_FEATURES:function(t,e){var r=e.layerId,n=e.featureIds,i=t.hiddenFeatures[r];if(!i)return t;var o=i.ids.filter(function(t){return!n.includes(t)});if(0===o.length){var a=t.hiddenFeatures,c=(a[r],function(t,e){if(null==t)return{};var r,n,i=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 o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}(a,[r].map(u)));return l(l({},t),{},{hiddenFeatures:c})}return l(l({},t),{},{hiddenFeatures:l(l({},t.hiddenFeatures),{},s({},r,l(l({},i),{},{ids:o})))})}},d=r("react"),f={stroke:"#d4351c",strokeWidth:2,fill:"transparent",symbolDescription:"red outline",minZoom:6,maxZoom:24,showInKey:!1,showInLayers:!1,visibility:"visible"};function y(t){return y="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},y(t)}var p=function(t,e){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===y(t)){if(e&&t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null};function v(t){return v="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},v(t)}function m(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 b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach(function(e){h(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function h(t,e,r){return(e=function(t){var e=function(t){if("object"!=v(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==v(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g(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 S=function(t){var e,r=0,n=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 g(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)?g(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}(t);try{for(n.s();!(e=n.n()).done;)r=(r<<5)-r+e.value.codePointAt(0),r&=r}catch(t){n.e(t)}finally{n.f()}return Math.abs(r).toString(36)},j=function(t){if(t.tiles){var e=Array.isArray(t.tiles)?t.tiles.join(","):t.tiles;return"tiles-".concat(S(e))}return t.geojson?"string"==typeof t.geojson?"geojson-".concat(S(t.geojson)):"geojson-".concat(t.id):"source-".concat(t.id)},k=function(t,e,r){var n=j(r);t.getSource(n)||(r.tiles?t.addSource(n,{type:"vector",tiles:r.tiles,minzoom:r.minZoom||0,maxzoom:r.maxZoom||22}):r.geojson&&t.addSource(n,{type:"geojson",data:r.geojson}));var i=!!r.fill,o=!!r.stroke,a=i?r.id:null,l=o?i?"".concat(r.id,"-stroke"):r.id:null,s="hidden"===r.visibility?"none":"visible";if(i&&!t.getLayer(a)){var u,c=p(r.fill,e);t.addLayer(b({id:a,type:"fill",source:n,"source-layer":null!=r&&null!==(u=r.tiles)&&void 0!==u&&u.length?r.sourceLayer:void 0,layout:{visibility:s},paint:{"fill-color":c,"fill-opacity":r.opacity||1}},r.filter?{filter:r.filter}:{}))}if(o&&!t.getLayer(l)){var d,f=p(r.stroke,e);t.addLayer(b({id:l,type:"line",source:n,"source-layer":null!=r&&null!==(d=r.tiles)&&void 0!==d&&d.length?r.sourceLayer:void 0,layout:{visibility:s},paint:b({"line-color":f,"line-width":r.strokeWidth||1,"line-opacity":r.opacity||1},r.strokeDashArray?{"line-dasharray":r.strokeDashArray}:{})},r.filter?{filter:r.filter}:{}))}},w=function(t,e,r,n,i){if(t.getLayer(e)){var o=function(t,e,r){if(!r||0===r.length)return t;var n=["!",["in",["to-string",["get",e]],["literal",r.map(function(t){return String(t)})]]];return t?["all",t,n]:n}(r,n,i);t.setFilter(e,o)}};function O(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 P=function(t){var e=t.pluginConfig,r=t.pluginStateRef,n=t.mapStyleId,i=t.mapProvider,o=t.events,a=t.eventBus,l=i.map,s=e.datasets,u=function(){return r.current.datasets||s};s.forEach(function(t){k(l,n,t)}),l.once("idle",function(){a.emit("datasets:ready")});var c=function(t){var e=t.map,r=t.events,n=t.getDatasets,i=t.getHiddenFeatures,o=function(t){e.once("idle",function(){var r=t.id,o=n(),a=i();o.forEach(function(t){k(e,r,t)}),Object.entries(a).forEach(function(t){var r=function(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,i,o,a,l=[],s=!0,u=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(t){u=!0,i=t}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return O(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)?O(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.")}()}(t,2),n=r[0],i=r[1],a=i.idProperty,l=i.ids,s=o.find(function(t){return t.id===n});if(s){var u=s.filter||null,c=!!s.fill,d=!!s.stroke,f=c?n:null,y=d?c?"".concat(n,"-stroke"):n:null;f&&w(e,f,u,a,l),y&&w(e,y,u,a,l)}})})};return t.eventBus.on(r.MAP_SET_STYLE,o),o}({map:l,events:o,eventBus:a,getDatasets:u,getHiddenFeatures:function(){return r.current.hiddenFeatures||{}}});return{remove:function(){a.off(o.MAP_SET_STYLE,c);var t=u(),e=new Set;t.forEach(function(t){var r=j(t),n=function(t,e){var r=t.getStyle();return null!=r&&r.layers?r.layers.filter(function(t){return t.source===e}).map(function(t){return t.id}):[]}(l,r);n.forEach(function(t){return l.removeLayer(t)}),!e.has(r)&&l.getSource(r)&&(l.removeSource(r),e.add(r))})}}},A=function(t,e){var r=t.mapProvider,n=t.pluginState,i=r.map;i.getLayer(e)&&i.setLayoutProperty(e,"visibility","visible"),i.getLayer("".concat(e,"-stroke"))&&i.setLayoutProperty("".concat(e,"-stroke"),"visibility","visible"),n.dispatch({type:"SET_DATASET_VISIBILITY",payload:{id:e,visibility:"visible"}})},I=function(t,e){var r=t.mapProvider,n=t.pluginState,i=r.map;i.getLayer(e)&&i.setLayoutProperty(e,"visibility","none"),i.getLayer("".concat(e,"-stroke"))&&i.setLayoutProperty("".concat(e,"-stroke"),"visibility","none"),n.dispatch({type:"SET_DATASET_VISIBILITY",payload:{id:e,visibility:"hidden"}})},E=r("react/jsx-runtime");function _(t){return _="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},_(t)}function x(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 L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach(function(e){D(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function D(t,e,r){return(e=function(t){var e=function(t){if("object"!=_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(t){return function(t){if(Array.isArray(t))return F(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return F(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)?F(t,e):void 0}}(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 F(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 M={InitComponent:function(t){var e,r=t.pluginConfig,n=t.pluginState,i=t.appState,o=t.mapState,a=t.mapProvider,l=t.services,s=n.dispatch,u=l.events,c=l.eventBus,y=!(null===(e=a.map)||void 0===e||!e.getStyle()),p=(0,d.useRef)(n);p.current=n;var v=(0,d.useRef)(null);return(0,d.useEffect)(function(){var t,e,l,d,m=null===(t=null===(e=r.includeModes)||void 0===e?void 0:e.includes(i.mode))||void 0===t||t,b=null!==(l=null===(d=r.excludeModes)||void 0===d?void 0:d.includes(i.mode))&&void 0!==l&&l;y&&m&&!b&&(v.current||(n.datasets||s({type:"SET_DATASETS",payload:{datasets:r.datasets,datasetDefaults:f}}),v.current=P({mapStyleId:o.mapStyle.id,pluginConfig:r,pluginStateRef:p,mapProvider:a,events:u,eventBus:c})))},[y,i.mode]),(0,d.useEffect)(function(){return function(){v.current&&(v.current.remove(),v.current=null)}},[]),null},reducer:{initialState:{datasets:null,hiddenFeatures:{}},actions:c},panels:[{id:"datasetsLayers",label:"Layers",mobile:{slot:"bottom",modal:!0,dismissable:!0},tablet:{slot:"inset",dismissable:!0,exclusive:!0,width:"300px"},desktop:{slot:"inset",modal:!1,dismissable:!0,exclusive:!0,width:"320px"},render:function(t){var e=t.pluginState,r=t.mapProvider,n=function(t){var n=t.target,i=n.value;n.checked?A({mapProvider:r,pluginState:e},i):I({mapProvider:r,pluginState:e},i)};return(0,E.jsx)("div",{className:"im-c-datasets-layers",children:(0,E.jsx)("div",{className:"govuk-form-group",children:(0,E.jsxs)("fieldset",{className:"govuk-fieldset",children:[(0,E.jsx)("legend",{className:"govuk-visually-hidden",children:"Layers"}),(0,E.jsx)("div",{className:"govuk-checkboxes govuk-checkboxes--small","data-module":"govuk-checkboxes",children:(e.datasets||[]).filter(function(t){return t.showInLayers}).map(function(t){return(0,E.jsx)("div",{className:"im-c-datasets-layers__item".concat("hidden"!==t.visibility?" im-c-datasets-layers__item--checked":""),children:(0,E.jsxs)("div",{className:"govuk-checkboxes__item",children:[(0,E.jsx)("input",{className:"govuk-checkboxes__input",id:t.id,name:"layers",type:"checkbox",value:t.id,checked:"hidden"!==t.visibility,onChange:n}),(0,E.jsx)("label",{className:"im-c-datasets-layers__item-label govuk-label govuk-checkboxes__label",htmlFor:t.id,children:t.label})]})},t.id)})})]})})})}},{id:"datasetsKey",label:"Key",mobile:{slot:"bottom",modal:!0},tablet:{slot:"inset",width:"300px"},desktop:{slot:"inset",width:"320px"},render:function(t){var e=t.mapState,r=t.pluginState,n=e.mapStyle,i=function(t){return(0,E.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",children:"line"===t.keySymbolShape?(0,E.jsx)("line",{x1:t.strokeWidth/2,y1:"10",x2:20-t.strokeWidth/2,y2:"10",stroke:p(t.stroke,n.id),strokeWidth:t.strokeWidth,strokeLinecap:"round"}):(0,E.jsx)("rect",{x:t.strokeWidth/2,y:t.strokeWidth/2,width:20-t.strokeWidth,height:20-t.strokeWidth,rx:t.strokeWidth,ry:t.strokeWidth,fill:p(t.fill,n.id),stroke:p(t.stroke,n.id),strokeWidth:t.strokeWidth,strokeLinejoin:"round"})})};return(0,E.jsx)("div",{className:"im-c-datasets-key",children:(r.datasets||[]).filter(function(t){return t.showInKey&&"hidden"!==t.visibility}).map(function(t){return(0,E.jsx)("div",{className:"im-c-datasets-key__item",children:(0,E.jsxs)("div",{className:"im-c-datasets-key__item-label",children:[i(t),t.label,t.symbolDescription&&(0,E.jsxs)("span",{className:"govuk-visually-hidden",children:["(",p(t.symbolDescription,n.id),")"]})]})},t.id)})})}}],buttons:[{id:"datasetsLayers",label:"Layers",panelId:"datasetsLayers",iconId:"layers",excludeWhen:function(t){return!t.pluginConfig.datasets.find(function(t){return t.showInLayers})},mobile:{slot:"top-left",showLabel:!0},tablet:{slot:"top-left",showLabel:!0},desktop:{slot:"top-left",showLabel:!0}},{id:"datasetsKey",label:"Key",panelId:"datasetsKey",iconId:"key",excludeWhen:function(t){return!t.pluginConfig.datasets.find(function(t){return t.showInKey})},mobile:{slot:"top-left",showLabel:!1},tablet:{slot:"top-left",showLabel:!0},desktop:{slot:"top-left",showLabel:!0}}],icons:[{id:"layers",svgContent:'<path d="M13 13.74a2 2 0 0 1-2 0L2.5 8.87a1 1 0 0 1 0-1.74L11 2.26a2 2 0 0 1 2 0l8.5 4.87a1 1 0 0 1 0 1.74z"></path><path d="m20 14.285 1.5.845a1 1 0 0 1 0 1.74L13 21.74a2 2 0 0 1-2 0l-8.5-4.87a1 1 0 0 1 0-1.74l1.5-.845"></path>'},{id:"key",svgContent:'<path d="M3 5h.01"/><path d="M3 12h.01"/><path d="M3 19h.01"/><path d="M8 5h13"/><path d="M8 12h13"/><path d="M8 19h13"/>'}],api:{showDataset:A,hideDataset:I,addDataset:function(t,e){var r=t.mapProvider,n=t.mapState,i=t.pluginState,o=r.map;k(o,n.mapStyle.id,L(L({},f),e)),i.dispatch({type:"ADD_DATASET",payload:{dataset:e,datasetDefaults:f}})},removeDataset:function(t,e){var r,n,i=t.mapProvider,o=t.pluginState,a=i.map,l=null===(r=o.datasets)||void 0===r?void 0:r.find(function(t){return t.id===e});if(l){var s=function(t){var e=!!t.fill,r=!!t.stroke,n=e?t.id:null,i=null;return r&&(i=e?"".concat(t.id,"-stroke"):t.id),{fillLayerId:n,strokeLayerId:i}}(l),u=s.fillLayerId,c=s.strokeLayerId,d=j(l);[c,u].forEach(function(t){t&&a.getLayer(t)&&a.removeLayer(t)}),!(null===(n=o.datasets)||void 0===n?void 0:n.some(function(t){return t.id!==e&&j(t)===d}))&&a.getSource(d)&&a.removeSource(d),o.dispatch({type:"REMOVE_DATASET",payload:{id:e}})}},showFeatures:function(t,e){var r,n=t.mapProvider,i=t.pluginState,o=e.featureIds,a=e.idProperty,l=e.datasetId,s=n.map,u=i.hiddenFeatures[l];if(u){var c=null===(r=i.datasets)||void 0===r?void 0:r.find(function(t){return t.id===l});if(c){var d=c.filter||null,f=!!c.fill,y=!!c.stroke,p=f?l:null,v=null;y&&(v=f?"".concat(l,"-stroke"):l);var m=u.ids.filter(function(t){return!o.includes(t)});i.dispatch({type:"SHOW_FEATURES",payload:{layerId:l,featureIds:o}}),p&&w(s,p,d,a,m),v&&w(s,v,d,a,m)}}},hideFeatures:function(t,e){var r,n=t.mapProvider,i=t.pluginState,o=e.featureIds,a=e.idProperty,l=e.datasetId,s=n.map,u=null===(r=i.datasets)||void 0===r?void 0:r.find(function(t){return t.id===l});if(u){var c=u.filter||null,d=!!u.fill,f=!!u.stroke,y=d?l:null,p=null;f&&(p=d?"".concat(l,"-stroke"):l);var v=i.hiddenFeatures[l],m=v?T(new Set([].concat(T(v.ids),T(o)))):o;i.dispatch({type:"HIDE_FEATURES",payload:{layerId:l,idProperty:a,featureIds:o}}),y&&w(s,y,c,a,m),p&&w(s,p,c,a,m)}}}}}};
@@ -0,0 +1,2 @@
1
+ /*! For license information please see index.js.LICENSE.txt */
2
+ import*as t from"react";import*as e from"react/jsx-runtime";var r,n,o={react(e,r,n){var o,i;e.exports=(o={useEffect:()=>t.useEffect,useRef:()=>t.useRef},i={},n.d(i,o),i)},"react/jsx-runtime"(t,r,n){var o,i;t.exports=(o={jsx:()=>e.jsx,jsxs:()=>e.jsxs},i={},n.d(i,o),i)}},i={};function u(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t](r,r.exports,u),r.exports}u.m=o,u.d=(t,e)=>{for(var r in e)u.o(e,r)&&!u.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},u.f={},u.e=t=>Promise.all(Object.keys(u.f).reduce((e,r)=>(u.f[r](t,e),e),[])),u.u=t=>"../esm/"+t+".js",u.miniCssF=t=>{},u.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),u.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;if("string"==typeof import.meta.url&&(t=import.meta.url),!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),u.p=t+"../css/"})(),r={index:0},n=t=>{var e,n,{__webpack_esm_ids__:o,__webpack_esm_modules__:i,__webpack_esm_runtime__:c}=t,a=0;for(e in i)u.o(i,e)&&(u.m[e]=i[e]);for(c&&c(u);a<o.length;a++)n=o[a],u.o(r,n)&&r[n]&&r[n][0](),r[o[a]]=0},u.f.j=(t,e)=>{var o=u.o(r,t)?r[t]:void 0;if(0!==o)if(o)e.push(o[1]);else{var i=import("../css/"+u.u(t)).then(n,e=>{throw 0!==r[t]&&(r[t]=void 0),e});i=Promise.race([i,new Promise(e=>o=r[t]=[e])]),e.push(o[1]=i)}};var c={};function a(t){return a="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},a(t)}function f(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var a=n&&n.prototype instanceof c?n:c,f=Object.create(a.prototype);return s(f,"_invoke",function(r,n,o){var i,c,a,f=0,s=o||[],p=!1,l={p:0,n:0,v:t,a:b,f:b.bind(t,4),d:function(e,r){return i=e,c=0,a=t,l.n=r,u}};function b(r,n){for(c=r,a=n,e=0;!p&&f&&!o&&e<s.length;e++){var o,i=s[e],b=l.p,y=i[2];r>3?(o=y===n)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=b&&((o=r<2&&b<i[1])?(c=0,l.v=n,l.n=i[1]):b<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,l.n=y,c=0))}if(o||r>1)return u;throw p=!0,n}return function(o,s,y){if(f>1)throw TypeError("Generator is already running");for(p&&1===s&&b(s,y),c=s,a=y;(e=c<2?t:a)||!p;){i||(c?c<3?(c>1&&(l.n=-1),b(c,a)):l.n=a:l.v=a);try{if(f=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(p=l.n<0)?a:r.call(n,l))!==u)break}catch(e){i=t,c=1,a=e}finally{f=1}}return{value:e,done:p}}}(r,o,i),!0),f}var u={};function c(){}function a(){}function p(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(s(e={},n,function(){return this}),e),b=p.prototype=c.prototype=Object.create(l);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,o,"GeneratorFunction")),t.prototype=Object.create(b),t}return a.prototype=p,s(b,"constructor",p),s(p,"constructor",a),a.displayName="GeneratorFunction",s(p,o,"GeneratorFunction"),s(b),s(b,o,"Generator"),s(b,n,function(){return this}),s(b,"toString",function(){return"[object Generator]"}),(f=function(){return{w:i,m:y}})()}function s(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}s=function(t,e,r,n){function i(e,r){s(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:(i("next",0),i("throw",1),i("return",2))},s(t,e,r,n)}function p(t,e,r,n,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void r(t)}c.done?e(a):Promise.resolve(a).then(n,o)}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 b(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){y(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 y(t,e,r){return(e=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function m(){var t,e,r=b(b({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"datasets",load:(t=f().m(function t(){var e;return f().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,u.e("im-datasets-plugin").then(u.bind(u,"./plugins/beta/datasets/src/manifest.js"));case 1:return e=t.v.manifest,t.a(2,e)}},t)}),e=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function u(t){p(i,n,o,u,c,"next",t)}function c(t){p(i,n,o,u,c,"throw",t)}u(void 0)})},function(){return e.apply(this,arguments)})});return r}u.d(c,{A:()=>m});const v=c.A;export{v as default};