@defra/interactive-map 0.0.6-alpha → 0.0.8-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 (83) hide show
  1. package/assets/templates/map.njk +2 -2
  2. package/dist/css/index.css +1 -1
  3. package/dist/esm/index.js +1 -1
  4. package/dist/umd/im-core.js +1 -1
  5. package/docs/api.md +10 -5
  6. package/package.json +56 -4
  7. package/plugins/beta/datasets/dist/esm/index.js +1 -1
  8. package/plugins/beta/draw-es/dist/esm/index.js +2 -0
  9. package/plugins/beta/draw-ml/dist/css/index.css +1 -1
  10. package/plugins/beta/draw-ml/dist/esm/index.js +1 -1
  11. package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +1 -1
  12. package/plugins/beta/draw-ml/src/DrawInit.jsx +15 -0
  13. package/plugins/beta/draw-ml/src/api/deleteFeature.js +4 -4
  14. package/plugins/beta/draw-ml/src/api/editFeature.js +10 -5
  15. package/plugins/beta/draw-ml/src/draw.scss +1 -0
  16. package/plugins/beta/draw-ml/src/events.js +2 -0
  17. package/plugins/beta/draw-ml/src/manifest.js +18 -43
  18. package/plugins/beta/draw-ml/src/modes/createDrawMode.js +35 -1
  19. package/plugins/beta/draw-ml/src/modes/editVertexMode.js +17 -1
  20. package/plugins/beta/frame/dist/esm/index.js +1 -1
  21. package/plugins/beta/map-styles/dist/esm/index.js +1 -1
  22. package/plugins/beta/scale-bar/dist/esm/index.js +1 -1
  23. package/plugins/beta/use-location/dist/esm/index.js +1 -1
  24. package/plugins/interact/dist/css/index.css +1 -1
  25. package/plugins/interact/dist/esm/index.js +1 -1
  26. package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
  27. package/plugins/interact/src/defaults.js +1 -0
  28. package/plugins/interact/src/events.js +6 -1
  29. package/plugins/interact/src/events.test.js +19 -5
  30. package/plugins/interact/src/hooks/useInteractionHandlers.js +7 -2
  31. package/plugins/interact/src/hooks/useInteractionHandlers.test.js +28 -0
  32. package/plugins/interact/src/interact.scss +1 -0
  33. package/plugins/interact/src/manifest.js +22 -16
  34. package/plugins/interact/src/manifest.test.js +1 -1
  35. package/plugins/interact/src/reducer.js +1 -0
  36. package/plugins/interact/src/reducer.test.js +1 -0
  37. package/plugins/search/dist/esm/index.js +1 -1
  38. package/providers/beta/esri/dist/css/index.css +1 -0
  39. package/providers/beta/esri/dist/esm/index.js +2 -0
  40. package/providers/beta/esri/src/esriProvider.js +12 -0
  41. package/providers/beta/esri/src/mapEvents.js +2 -2
  42. package/providers/beta/open-names/dist/esm/index.js +1 -1
  43. package/providers/maplibre/dist/esm/index.js +1 -1
  44. package/providers/maplibre/dist/esm/index.js.LICENSE.txt +5 -0
  45. package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
  46. package/providers/maplibre/src/maplibreProvider.js +11 -1
  47. package/providers/maplibre/src/utils/highlightFeatures.js +6 -2
  48. package/src/App/components/Actions/Actions.jsx +2 -1
  49. package/src/App/components/Actions/Actions.module.scss +14 -0
  50. package/src/App/components/Actions/Actions.test.jsx +2 -2
  51. package/src/App/components/MapButton/MapButton.module.scss +19 -6
  52. package/src/App/components/PopupMenu/PopupMenu.jsx +69 -14
  53. package/src/App/components/PopupMenu/PopupMenu.module.scss +70 -7
  54. package/src/App/components/PopupMenu/PopupMenu.test.jsx +102 -16
  55. package/src/App/hooks/useButtonStateEvaluator.js +2 -2
  56. package/src/App/hooks/useInterfaceAPI.js +26 -32
  57. package/src/App/registry/pluginRegistry.js +2 -2
  58. package/src/App/renderer/mapButtons.js +6 -1
  59. package/src/App/renderer/mapButtons.test.js +20 -0
  60. package/src/App/store/MapProvider.jsx +2 -2
  61. package/src/App/store/mapActionsMap.js +3 -2
  62. package/src/App/store/mapReducer.js +1 -0
  63. package/src/scss/settings/_dimensions.scss +1 -0
  64. package/webpack.esm.mjs +21 -11
  65. package/webpack.umd.mjs +0 -1
  66. package/dist/esm/im-core.js +0 -2
  67. package/plugins/beta/datasets/dist/esm/im-datasets-plugin.js +0 -2
  68. package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +0 -1
  69. package/plugins/beta/frame/dist/esm/im-frame-plugin.js +0 -1
  70. package/plugins/beta/map-styles/dist/esm/im-map-styles-plugin.js +0 -1
  71. package/plugins/beta/scale-bar/dist/esm/im-scale-bar-plugin.js +0 -1
  72. package/plugins/beta/use-location/dist/esm/im-use-location-plugin.js +0 -1
  73. package/plugins/interact/dist/esm/im-interact-plugin.js +0 -1
  74. package/plugins/search/dist/esm/im-search-plugin.js +0 -2
  75. package/plugins/search/dist/esm/im-search-plugin.js.LICENSE.txt +0 -1
  76. package/providers/beta/open-names/dist/esm/im-reverse-geocode.js +0 -2
  77. package/providers/beta/open-names/dist/esm/im-reverse-geocode.js.LICENSE.txt +0 -1
  78. package/providers/maplibre/dist/esm/im-maplibre-framework.js +0 -2
  79. package/providers/maplibre/dist/esm/im-maplibre-framework.js.LICENSE.txt +0 -4
  80. package/providers/maplibre/dist/esm/im-maplibre-provider.js +0 -2
  81. package/providers/maplibre/dist/esm/im-maplibre-provider.js.LICENSE.txt +0 -1
  82. /package/{dist/esm/im-core.js.LICENSE.txt → plugins/beta/draw-es/dist/esm/index.js.LICENSE.txt} +0 -0
  83. /package/{plugins/beta/datasets/dist/esm/im-datasets-plugin.js.LICENSE.txt → providers/beta/esri/dist/esm/index.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- import*as e from"react";import*as r from"react/jsx-runtime";var t,n,o={react(r,t,n){var o,i;r.exports=(o={useEffect:()=>e.useEffect,useRef:()=>e.useRef},i={},n.d(i,o),i)},"react/jsx-runtime"(e,t,n){var o,i;e.exports=(o={jsx:()=>r.jsx,jsxs:()=>r.jsxs},i={},n.d(i,o),i)}},i={};function c(e){var r=i[e];if(void 0!==r)return r.exports;var t=i[e]={exports:{}};return o[e](t,t.exports,c),t.exports}c.m=o,c.d=(e,r)=>{for(var t in r)c.o(r,t)&&!c.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce((r,t)=>(c.f[t](e,r),r),[])),c.u=e=>"../esm/"+e+".js",c.miniCssF=e=>{},c.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e+"../css/"})(),t={index:0},n=e=>{var r,n,{__webpack_esm_ids__:o,__webpack_esm_modules__:i,__webpack_esm_runtime__:u}=e,a=0;for(r in i)c.o(i,r)&&(c.m[r]=i[r]);for(u&&u(c);a<o.length;a++)n=o[a],c.o(t,n)&&t[n]&&t[n][0](),t[o[a]]=0},c.f.j=(e,r)=>{var o=c.o(t,e)?t[e]:void 0;if(0!==o)if(o)r.push(o[1]);else{var i=import("../css/"+c.u(e)).then(n,r=>{throw 0!==t[e]&&(t[e]=void 0),r});i=Promise.race([i,new Promise(r=>o=t[e]=[r])]),r.push(o[1]=i)}};var u={};function a(e){return a="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},a(e)}function f(){var e,r,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,n,o,i){var a=n&&n.prototype instanceof u?n:u,f=Object.create(a.prototype);return s(f,"_invoke",function(t,n,o){var i,u,a,f=0,s=o||[],p=!1,l={p:0,n:0,v:e,a:b,f:b.bind(e,4),d:function(r,t){return i=r,u=0,a=e,l.n=t,c}};function b(t,n){for(u=t,a=n,r=0;!p&&f&&!o&&r<s.length;r++){var o,i=s[r],b=l.p,y=i[2];t>3?(o=y===n)&&(a=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=b&&((o=t<2&&b<i[1])?(u=0,l.v=n,l.n=i[1]):b<y&&(o=t<3||i[0]>n||n>y)&&(i[4]=t,i[5]=n,l.n=y,u=0))}if(o||t>1)return c;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),u=s,a=y;(r=u<2?e:a)||!p;){i||(u?u<3?(u>1&&(l.n=-1),b(u,a)):l.n=a:l.v=a);try{if(f=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,a)))throw TypeError("iterator result is not an object");if(!r.done)return r;a=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((r=(p=l.n<0)?a:t.call(n,l))!==c)break}catch(r){i=e,u=1,a=r}finally{f=1}}return{value:r,done:p}}}(t,o,i),!0),f}var c={};function u(){}function a(){}function p(){}r=Object.getPrototypeOf;var l=[][n]?r(r([][n]())):(s(r={},n,function(){return this}),r),b=p.prototype=u.prototype=Object.create(l);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,o,"GeneratorFunction")),e.prototype=Object.create(b),e}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(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 p(e,r,t,n,o,i,c){try{var u=e[i](c),a=u.value}catch(e){return void t(e)}u.done?r(a):Promise.resolve(a).then(n,o)}function l(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?l(Object(t),!0).forEach(function(r){y(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(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"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=a(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function m(){var e,r,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.isExpanded&&(t.manifest={controls:[{id:"search",mobile:{slot:"banner"}}]}),b(b({showMarker:!0},t),{},{id:"search",load:(e=f().m(function e(){var r;return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.e("im-search-plugin").then(c.bind(c,"./plugins/search/src/manifest.js"));case 1:return r=e.v.manifest,e.a(2,r)}},e)}),r=function(){var r=this,t=arguments;return new Promise(function(n,o){var i=e.apply(r,t);function c(e){p(i,n,o,c,u,"next",e)}function u(e){p(i,n,o,c,u,"throw",e)}c(void 0)})},function(){return r.apply(this,arguments)})})}c.d(u,{A:()=>m});const v=u.A;export{v as default};
2
+ import{useEffect as t,useRef as e}from"react";import{jsx as r,jsxs as n}from"react/jsx-runtime";var o={"./plugins/search/src/manifest.js"(o,i,a){function s(t){return s="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},s(t)}function c(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 u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach(function(e){l(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function l(t,e,r){return(e=function(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}a.d(i,{manifest:()=>Ot}),a.r(i);var f={TOGGLE_EXPANDED:function(t,e){return u(u({},t),{},{isExpanded:e,areSuggestionsVisible:e})},SET_KEYBOARD_FOCUS_WITHIN:function(t,e){return u(u({},t),{},{hasKeyboardFocusWithin:e,areSuggestionsVisible:!0})},INPUT_BLUR:function(t,e){return u(u({},t),{},{hasKeyboardFocusWithin:!1,areSuggestionsVisible:t.areSuggestionsVisible&&"keyboard"!==e,selectedIndex:-1})},SET_VALUE:function(t,e){return u(u({},t),{},{value:e})},UPDATE_SUGGESTIONS:function(t,e){return u(u({},t),{},{suggestions:e})},SHOW_SUGGESTIONS:function(t){return u(u({},t),{},{areSuggestionsVisible:!0})},HIDE_SUGGESTIONS:function(t){return u(u({},t),{},{areSuggestionsVisible:!1})},SET_SELECTED:function(t,e){return u(u({},t),{},{selectedIndex:e,areSuggestionsVisible:e>=0})}},p=function(t){var e=t.id,n=t.isExpanded,o=t.onClick,i=t.buttonRef,a=t.searchIcon;return r("button",{"aria-label":"Open search",className:"im-c-map-button",onClick:o,"aria-controls":"".concat(e,"-search-form"),ref:i,style:n?{display:"none"}:void 0,children:a&&r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:a}})})},d=function(t){var e=t.id,n=t.pluginState,o=t.handleSuggestionClick;return r("ul",{id:"".concat(e,"-search-suggestions"),role:"listbox","aria-labelledby":"".concat(e,"-search"),className:"im-c-search-suggestions",style:n.areSuggestionsVisible&&n.suggestions.length?void 0:{display:"none"},children:n.suggestions.map(function(t,i){return r("li",{id:"".concat(e,"-search-suggestion-").concat(i),className:"im-c-search-suggestions__item",role:"option","aria-selected":n.selectedIndex===i,"aria-setsize":n.suggestions.length,"aria-posinset":i+1,onClick:function(){return o(t)},children:r("span",{className:"im-c-search-suggestions__label",dangerouslySetInnerHTML:{__html:t.marked}})},t.id)})})};function h(t){return h="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},h(t)}function y(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 m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?y(Object(r),!0).forEach(function(e){b(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function b(t,e,r){return(e=function(t){var e=function(t){if("object"!=h(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==h(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var g=function(t){var e=t.id,o=t.pluginState,i=t.pluginConfig,a=t.appState,s=t.inputRef,c=t.events,u=t.children,l=["im-c-search-form",i.isExpanded&&"im-c-search-form--default-expanded","im-c-panel"].filter(Boolean).join(" ");return n("form",{id:"".concat(e,"-search-form"),role:"search",className:l,style:m({display:i.isExpanded||o.isExpanded?"flex":void 0},"mobile"!==a.breakpoint&&(null==i?void 0:i.width)&&{width:i.width}),"aria-controls":"".concat(e,"-viewport"),onSubmit:function(t){return c.handleSubmit(t,a,o)},children:[r("button",{type:"submit",style:{display:"none"},"aria-hidden":"true",tabIndex:-1,children:"Submit"}),n("div",{className:"im-c-search__input-container".concat(o.hasKeyboardFocusWithin?" im-c-search__input-container--keyboard-focus-within":""),children:[r("label",{htmlFor:"".concat(e,"-search"),className:"im-u-visually-hidden",children:"Search"}),r("input",{id:"".concat(e,"-search"),className:"im-c-search__input",type:"search",role:"combobox","aria-expanded":o.suggestionsVisible,"aria-controls":"".concat(e,"-search-suggestions"),"aria-activedescendant":o.selectedIndex>=0?"".concat(e,"-search-suggestion-").concat(o.selectedIndex):void 0,"aria-describedby":o.value?void 0:"".concat(e,"-search-hint"),"aria-autocomplete":"list",autoComplete:"off",placeholder:"Search",name:"".concat(e,"-search"),spellCheck:!1,enterKeyHint:"search",value:o.value,onClick:c.handleInputClick,onChange:c.handleInputChange,onFocus:function(){return c.handleInputFocus(a.interfaceType)},onBlur:function(){return c.handleInputBlur(a.interfaceType)},onKeyDown:function(t){return c.handleInputKeyDown(t,o)},ref:s}),r("span",{id:"".concat(e,"-search-hint"),className:"im-c-search__hint",children:"When search results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."}),u]}),r(d,{id:e,appState:a,pluginState:o,handleSuggestionClick:function(t){return c.handleSuggestionClick(t,a)}})]})},v=function(t){var e=t.defaultExpanded,n=t.onClick,o=t.closeIcon;return r("button",{"aria-label":"Close search",className:"im-c-map-button im-c-search-close-button",type:"button",onClick:n,style:e?{display:"none"}:void 0,children:o&&r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:o}})})};let w=" ";class S{static get separator(){return w}static set separator(t){w=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,i=null,a=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),i=(60*t%60).toFixed(r),60==i&&(i=(0).toFixed(r),o++),o=("000"+o).slice(-3),i<10&&(i="0"+i),n=o+"°"+S.separator+i+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),i=Math.floor(3600*t/60)%60,a=(3600*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),i++),60==i&&(i=0,o++),o=("000"+o).slice(-3),i=("00"+i).slice(-2),a<10&&(a="0"+a),n=o+"°"+S.separator+i+"′"+S.separator+a+"″"}return n}static toLat(t,e,r){const n=S.toDms(S.wrap90(t),e,r);return null===n?"–":n.slice(1)+S.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=S.toDms(S.wrap180(t),e,r);return null===n?"–":n+S.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=S.toDms(S.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=S.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 O=S;class E{constructor(t,e,r){if(isNaN(t)||isNaN(e)||isNaN(r))throw new TypeError(`invalid vector [${t},${e},${r}]`);this.x=Number(t),this.y=Number(e),this.z=Number(r)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(t){if(!(t instanceof E))throw new TypeError("v is not Vector3d object");return new E(this.x+t.x,this.y+t.y,this.z+t.z)}minus(t){if(!(t instanceof E))throw new TypeError("v is not Vector3d object");return new E(this.x-t.x,this.y-t.y,this.z-t.z)}times(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new E(this.x*t,this.y*t,this.z*t)}dividedBy(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new E(this.x/t,this.y/t,this.z/t)}dot(t){if(!(t instanceof E))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){if(!(t instanceof E))throw new TypeError("v is not Vector3d object");const e=this.y*t.z-this.z*t.y,r=this.z*t.x-this.x*t.z,n=this.x*t.y-this.y*t.x;return new E(e,r,n)}negate(){return new E(-this.x,-this.y,-this.z)}unit(){const t=this.length;if(1==t)return this;if(0==t)return this;const e=this.x/t,r=this.y/t,n=this.z/t;return new E(e,r,n)}angleTo(t,e=void 0){if(!(t instanceof E))throw new TypeError("v is not Vector3d object");if(!(e instanceof E||null==e))throw new TypeError("n is not Vector3d object");const r=null==e||this.cross(t).dot(e)>=0?1:-1,n=this.cross(t).length*r,o=this.dot(t);return Math.atan2(n,o)}rotateAround(t,e){if(!(t instanceof E))throw new TypeError("axis is not Vector3d object");const r=e.toRadians(),n=this.unit(),o=t.unit(),i=Math.sin(r),a=Math.cos(r),s=1-a,c=o.x,u=o.y,l=o.z,f=[[s*c*c+a,s*c*u-i*l,s*c*l+i*u],[s*c*u+i*l,s*u*u+a,s*u*l-i*c],[s*c*l-i*u,s*u*l+i*c,s*l*l+a]],p=[f[0][0]*n.x+f[0][1]*n.y+f[0][2]*n.z,f[1][0]*n.x+f[1][1]*n.y+f[1][2]*n.z,f[2][0]*n.x+f[2][1]*n.y+f[2][2]*n.z];return new E(p[0],p[1],p[2])}toString(t=3){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const j=E,N={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},T={WGS84:{ellipsoid:N.WGS84}};Object.freeze(N.WGS84),Object.freeze(T.WGS84);class P{constructor(t,e,r=0){if(isNaN(t)||null==t)throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e)||null==e)throw new TypeError(`invalid lon ‘${e}’`);if(isNaN(r)||null==r)throw new TypeError(`invalid height ‘${r}’`);this._lat=O.wrap90(Number(t)),this._lon=O.wrap180(Number(e)),this._height=Number(r)}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?O.wrap90(O.parse(t)):O.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?O.wrap90(O.parse(t)):O.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)?O.wrap180(O.parse(t)):O.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?O.wrap180(O.parse(t)):O.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?O.wrap180(O.parse(t)):O.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}get height(){return this._height}set height(t){if(this._height=Number(t),isNaN(this._height))throw new TypeError(`invalid height ‘${t}’`)}get datum(){return this._datum}set datum(t){this._datum=t}static get ellipsoids(){return N}static get datums(){return T}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");let e,r,n;if("object"==typeof t[0]&&(1==t.length||!isNaN(parseFloat(t[1])))){const o=t[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([r,e,n]=o.coordinates,n=n||0):(null!=o.latitude&&(e=o.latitude),null!=o.lat&&(e=o.lat),null!=o.longitude&&(r=o.longitude),null!=o.lng&&(r=o.lng),null!=o.lon&&(r=o.lon),null!=o.height&&(n=o.height),e=O.wrap90(O.parse(e)),r=O.wrap180(O.parse(r))),null!=t[1]&&(n=t[1]),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if("string"==typeof t[0]&&2==t[0].split(",").length&&([e,r]=t[0].split(","),e=O.wrap90(O.parse(e)),r=O.wrap180(O.parse(r)),n=t[1]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(null==e&&null==r&&([e,r]=t,e=O.wrap90(O.parse(e)),r=O.wrap180(O.parse(r)),n=t[2]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);return new this(e,r,n)}toCartesian(){const t=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:N.WGS84,e=this.lat.toRadians(),r=this.lon.toRadians(),n=this.height,{a:o,f:i}=t,a=Math.sin(e),s=Math.cos(e),c=Math.sin(r),u=Math.cos(r),l=2*i-i*i,f=o/Math.sqrt(1-l*a*a);return new _((f+n)*s*u,(f+n)*s*c,(f*(1-l)+n)*a)}equals(t){if(!(t instanceof P))throw new TypeError(`invalid point ‘${t}’`);return!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON||Math.abs(this.height-t.height)>Number.EPSILON||this.datum!=t.datum||this.referenceFrame!=t.referenceFrame||this.epoch!=t.epoch)}toString(t="d",e=void 0,r=null){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);const n=(this.height>=0?" +":" ")+this.height.toFixed(r)+"m";return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)}, ${this.lon.toFixed(e)}${null==r?"":n}`):`${O.toLat(this.lat,t,e)}, ${O.toLon(this.lon,t,e)}${null==r?"":n}`}}class _ extends j{constructor(t,e,r){super(t,e,r)}toLatLon(t=N.WGS84){if(!t||!t.a)throw new TypeError(`invalid ellipsoid ‘${t}’`);const{x:e,y:r,z:n}=this,{a:o,b:i,f:a}=t,s=2*a-a*a,c=s/(1-s),u=Math.sqrt(e*e+r*r),l=i*n/(o*u)*(1+c*i/Math.sqrt(u*u+n*n)),f=l/Math.sqrt(1+l*l),p=f/l,d=isNaN(p)?0:Math.atan2(n+c*i*f*f*f,u-s*o*p*p*p),h=Math.atan2(r,e),y=Math.sin(d),m=u*Math.cos(d)+n*y-o*o/(o/Math.sqrt(1-s*y*y));return new P(d.toDegrees(),h.toDegrees(),m)}toString(t=0){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}const x={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},G={ED50:{ellipsoid:x.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:x.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:x.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:x.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:x.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:x.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:x.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:x.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:x.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:x.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:x.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(x).forEach(t=>Object.freeze(x[t])),Object.keys(G).forEach(t=>{Object.freeze(G[t]),Object.freeze(G[t].transform)});class k extends P{constructor(t,e,r=0,n=G.WGS84){if(!n||null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),this._datum=n}get datum(){return this._datum}static get ellipsoids(){return x}static get datums(){return G}static parse(...t){let e=G.WGS84;if((4==t.length||3==t.length&&"object"==typeof t[2])&&(e=t.pop()),!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.parse(...t);return r._datum=e,r}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);return this.toCartesian().convertDatum(t).toLatLon()}toCartesian(){const t=super.toCartesian();return new D(t.x,t.y,t.z,this.datum)}}class D extends _{constructor(t,e,r,n=void 0){if(n&&null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),n&&(this._datum=n)}get datum(){return this._datum}set datum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);this._datum=t}toLatLon(t=void 0){t&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=t);const e=this.datum||G.WGS84;if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.toLatLon(e.ellipsoid);return new k(r.lat,r.lon,r.height,this.datum)}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let e=null,r=null;null!=this.datum&&this.datum!=G.WGS84||(e=this,r=t.transform),t==G.WGS84&&(e=this,r=this.datum.transform.map(t=>-t)),null==r&&(e=this.convertDatum(G.WGS84),r=t.transform);const n=e.applyTransform(r);return n.datum=t,n}applyTransform(t){const{x:e,y:r,z:n}=this,o=t[0],i=t[1],a=t[2],s=t[3]/1e6+1,c=(t[4]/3600).toRadians(),u=(t[5]/3600).toRadians(),l=(t[6]/3600).toRadians();return new D(o+e*s-r*l+n*u,i+e*l+r*s-n*c,a-e*u+r*c+n*s)}}const M={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:k.ellipsoids.Airy1830};class C{constructor(t,e){if(this.easting=Number(t),this.northing=Number(e),isNaN(t)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${t}’`);if(isNaN(e)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${e}’`)}toLatLon(t=k.datums.WGS84){const{easting:e,northing:r}=this,{a:n,b:o}=M.ellipsoid,i=M.trueOrigin.lat.toRadians(),a=M.trueOrigin.lon.toRadians(),s=-M.falseOrigin.easting,c=-M.falseOrigin.northing,u=M.scaleFactor,l=1-o*o/(n*n),f=(n-o)/(n+o),p=f*f,d=f*f*f;let h=i,y=0;do{h=(r-c-y)/(n*u)+h,y=o*u*((1+f+5/4*p+5/4*d)*(h-i)-(3*f+3*f*f+21/8*d)*Math.sin(h-i)*Math.cos(h+i)+(15/8*p+15/8*d)*Math.sin(2*(h-i))*Math.cos(2*(h+i))-35/24*d*Math.sin(3*(h-i))*Math.cos(3*(h+i)))}while(Math.abs(r-c-y)>=1e-5);const m=Math.cos(h),b=Math.sin(h),g=n*u/Math.sqrt(1-l*b*b),v=n*u*(1-l)/Math.pow(1-l*b*b,1.5),w=g/v-1,S=Math.tan(h),O=S*S,E=O*O,j=1/m,N=g*g*g,T=N*g*g,P=e-s,_=P*P,x=_*P,G=_*_,D=x*_;h=h-S/(2*v*g)*_+S/(24*v*N)*(5+3*O+w-9*O*w)*G-S/(720*v*T)*(61+90*O+45*E)*(G*_);const C=a+j/g*P-j/(6*N)*(g/v+2*O)*x+j/(120*T)*(5+28*O+24*E)*D-j/(T*g*g*5040)*(61+662*O+1320*E+E*O*720)*(D*_);let I=new R(h.toDegrees(),C.toDegrees(),0,k.datums.OSGB36);return t!=k.datums.OSGB36&&(I=I.convertDatum(t),I=new R(I.lat,I.lon,I.height,I.datum)),I}static parse(t){let e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new C(e[1],e[2]);if(e=t.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!e)throw new Error(`invalid grid reference ‘${t}’`);let r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;const o=(r-2)%5*5+n%5,i=19-5*Math.floor(r/5)-Math.floor(n/5);let a=t.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${t}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],c=i+a[1];return new C(s,c)}toString(t=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);let{easting:e,northing:r}=this;if(0==t){const t={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${e.toLocaleString("en",t)},${r.toLocaleString("en",t)}`}const n=Math.floor(e/1e5),o=Math.floor(r/1e5);let i=19-o-(19-o)%5+Math.floor((n+10)/5),a=5*(19-o)%25+n%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),r=Math.floor(r%1e5/Math.pow(10,5-t/2)),e=e.toString().padStart(t/2,"0"),r=r.toString().padStart(t/2,"0"),`${s} ${e} ${r}`}}class R extends k{toOsGrid(){const t=this.datum==k.datums.OSGB36?this:this.convertDatum(k.datums.OSGB36),e=t.lat.toRadians(),r=t.lon.toRadians(),{a:n,b:o}=M.ellipsoid,i=M.trueOrigin.lat.toRadians(),a=M.trueOrigin.lon.toRadians(),s=-M.falseOrigin.easting,c=-M.falseOrigin.northing,u=M.scaleFactor,l=1-o*o/(n*n),f=(n-o)/(n+o),p=f*f,d=f*f*f,h=Math.cos(e),y=Math.sin(e),m=n*u/Math.sqrt(1-l*y*y),b=n*u*(1-l)/Math.pow(1-l*y*y,1.5),g=m/b-1,v=o*u*((1+f+5/4*p+5/4*d)*(e-i)-(3*f+3*f*f+21/8*d)*Math.sin(e-i)*Math.cos(e+i)+(15/8*p+15/8*d)*Math.sin(2*(e-i))*Math.cos(2*(e+i))-35/24*d*Math.sin(3*(e-i))*Math.cos(3*(e+i))),w=h*h*h,S=w*h*h,O=Math.tan(e)*Math.tan(e),E=O*O,j=r-a,N=j*j,T=N*j,P=T*j,_=P*j;let x=v+c+m/2*y*h*N+m/24*y*w*(5-O+9*g)*P+m/720*y*S*(61-58*O+E)*(_*j),G=s+m*h*j+m/6*w*(m/b-O)*T+m/120*S*(5-18*O+E+14*g-58*O*g)*_;x=Number(x.toFixed(3)),G=Number(G.toFixed(3));try{return new C(G,x)}catch(e){throw new Error(`${e.message} from (${t.lat.toFixed(6)},${t.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(t){const e=super.convertDatum(t);return new R(e.lat,e.lon,e.height,e.datum)}}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)}var A;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 $(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){F(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 F(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}var W=500,U=function(t,e){var r,n,o,i,a=e.MBR_XMIN,s=e.MBR_YMIN,c=e.MBR_XMAX,u=e.MBR_YMAX,l=e.GEOMETRY_X,f=e.GEOMETRY_Y;if(null==a?(r=l-W,n=f-W,o=l+W,i=f+W):(r=a,n=s,o=c,i=u),"EPSG:27700"===t)return[r,n,o,i];if("EPSG:4326"===t){var p=new C(r,n).toLatLon(),d=new C(o,i).toLatLon();return[p.lon,p.lat,d.lon,d.lat].map(function(t){return Math.round(1e6*t)/1e6})}throw new Error("Unsupported CRS: ".concat(t))},B=function(t,e){var r=e.GEOMETRY_X,n=e.GEOMETRY_Y;if("EPSG:27700"===t)return[r,n];if("EPSG:4326"===t){var o=new C(r,n).toLatLon();return[Math.round(1e6*o.lon)/1e6,Math.round(1e6*o.lat)/1e6]}throw new Error("Unsupported CRS: ".concat(t))};function z(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){return function(t){if(Array.isArray(t))return q(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.")}()}function Y(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=H(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 i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function H(t,e){if(t){if("string"==typeof t)return q(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)?q(t,e):void 0}}function q(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 K(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof s?n:s,u=Object.create(c.prototype);return X(u,"_invoke",function(r,n,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,c=t,p.n=r,a}};function d(r,n){for(s=r,c=n,e=0;!f&&u&&!o&&e<l.length;e++){var o,i=l[e],d=p.p,h=i[2];r>3?(o=h===n)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(e=s<2?t:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?c:r.call(n,p))!==a)break}catch(e){i=t,s=1,c=e}finally{u=1}}return{value:e,done:f}}}(r,o,i),!0),u}var a={};function s(){}function c(){}function u(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(X(e={},n,function(){return this}),e),f=u.prototype=s.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,X(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return c.prototype=u,X(f,"constructor",u),X(u,"constructor",c),c.displayName="GeneratorFunction",X(u,o,"GeneratorFunction"),X(f),X(f,o,"Generator"),X(f,n,function(){return this}),X(f,"toString",function(){return"[object Generator]"}),(K=function(){return{w:i,m:p}})()}function X(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}X=function(t,e,r,n){function i(e,r){X(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))},X(t,e,r,n)}function Z(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function J(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Z(i,n,o,a,s,"next",t)}function s(t){Z(i,n,o,a,s,"throw",t)}a(void 0)})}}var Q=function(t){return t.replace(/[^a-zA-Z0-9\s\-.,]/g,"").trim()},tt=function(t,e,r){var n,o={url:null===(n=t.urlTemplate)||void 0===n?void 0:n.replace("{query}",encodeURIComponent(e)),options:{method:"GET"}};return"function"==typeof t.buildRequest?t.buildRequest(e,function(){return o}):"function"==typeof r?r(o,e):o},et=function(){var t=J(K().m(function t(e,r,n){var o,i,a;return K().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,fetch(r.url,r.options);case 1:if((o=t.v).ok){t.n=2;break}return console.error("Fetch error for ".concat(e.label||"dataset",": ").concat(o.status)),t.a(2,null);case 2:return t.n=3,o.json();case 3:return i=t.v,t.a(2,e.parseResults(i,n));case 4:return t.p=4,a=t.v,console.error("Network error for ".concat(e.label||"dataset",":"),a),t.a(2,null)}},t,null,[[0,4]])}));return function(e,r,n){return t.apply(this,arguments)}}(),rt=function(){var t=J(K().m(function t(e,r,n,o){var i,a,s,c,u,l,f,p,d;return K().w(function(t){for(;;)switch(t.p=t.n){case 0:i=Q(e),a=r.filter(function(t){var e=!t.includeRegex||t.includeRegex.test(i),r=!!t.excludeRegex&&t.excludeRegex.test(i);return e&&!r}),s=[],c=Y(a),t.p=1,c.s();case 2:if((u=c.n()).done){t.n=5;break}return l=u.value,f=tt(l,i,o),t.n=3,et(l,f,i);case 3:if(null==(p=t.v)||!p.length){t.n=4;break}if(s=[].concat(V(s),V(p)),!l.exclusive){t.n=4;break}return t.a(3,5);case 4:t.n=2;break;case 5:t.n=7;break;case 6:t.p=6,d=t.v,c.e(d);case 7:return t.p=7,c.f(),t.f(7);case 8:return n({type:"UPDATE_SUGGESTIONS",payload:s}),t.a(2,{results:s,sanitisedValue:i})}},t,null,[[1,6,7,8]])}));return function(e,r,n,o){return t.apply(this,arguments)}}();function nt(t){var e=t.mapProvider,r=t.bounds,n=t.point,o=t.markers,i=t.showMarker,a=t.markerColor;e.fitToBounds(r),i&&o.add("search",n,{color:a})}function ot(t){return ot="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},ot(t)}function it(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof s?n:s,u=Object.create(c.prototype);return at(u,"_invoke",function(r,n,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,c=t,p.n=r,a}};function d(r,n){for(s=r,c=n,e=0;!f&&u&&!o&&e<l.length;e++){var o,i=l[e],d=p.p,h=i[2];r>3?(o=h===n)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(e=s<2?t:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?c:r.call(n,p))!==a)break}catch(e){i=t,s=1,c=e}finally{u=1}}return{value:e,done:f}}}(r,o,i),!0),u}var a={};function s(){}function c(){}function u(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(at(e={},n,function(){return this}),e),f=u.prototype=s.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,at(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return c.prototype=u,at(f,"constructor",u),at(u,"constructor",c),c.displayName="GeneratorFunction",at(u,o,"GeneratorFunction"),at(f),at(f,o,"Generator"),at(f,n,function(){return this}),at(f,"toString",function(){return"[object Generator]"}),(it=function(){return{w:i,m:p}})()}function at(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}at=function(t,e,r,n){function i(e,r){at(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))},at(t,e,r,n)}function st(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 ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?st(Object(r),!0).forEach(function(e){ut(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function ut(t,e,r){return(e=function(t){var e=function(t){if("object"!=ot(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ot(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ot(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lt(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function ft(t){return ft="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},ft(t)}function pt(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,e,r){return(e=function(t){var e=function(t){if("object"!=ft(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ft(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ft(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ht(t){return ht="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},ht(t)}function yt(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 mt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yt(Object(r),!0).forEach(function(e){bt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function bt(t,e,r){return(e=function(t){var e=function(t){if("object"!=ht(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ht(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gt(t){var e,r,n,o=t.dispatch,i=t.searchContainerRef,a=(e=function(e){return rt(e,t.datasets,o,t.transformRequest)},r=null,n=function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];clearTimeout(r),r=setTimeout(function(){e.apply(void 0,n)},350)},n.cancel=function(){r&&(clearTimeout(r),r=null)},n),s=function(t){var e=t.dispatch,r=t.services,n=t.viewportRef,o=t.mapProvider,i=t.markers,a=t.datasets,s=t.transformRequest,c=t.showMarker,u=t.markerColor,l="";return{handleOpenClick:function(){e({type:"TOGGLE_EXPANDED",payload:!0}),r.eventBus.emit("search:open")},handleCloseClick:function(t,n){e({type:"TOGGLE_EXPANDED",payload:!1}),e({type:"UPDATE_SUGGESTIONS",payload:[]}),e({type:"SET_VALUE",payload:""}),setTimeout(function(){return n.current.focus()},0),i.remove("search"),r.eventBus.emit("search:clear"),r.eventBus.emit("search:close")},handleSubmit:function(t,f,p){return(d=it().m(function d(){var h,y,m,b,g,v,w,S,O,E,j,N;return it().w(function(d){for(;;)switch(d.n){case 0:if(t.preventDefault(),h=p.suggestions,y=p.selectedIndex,m=p.value,b=null==m?void 0:m.trim(),e({type:"SET_SELECTED",payload:-1}),e({type:"HIDE_SUGGESTIONS"}),!(y>=0)){d.n=1;break}return v=h[y],e({type:"SET_VALUE",payload:v.text}),null===(g=n.current)||void 0===g||g.focus(),nt({mapProvider:o,bounds:v.bounds,point:v.point,markers:i,showMarker:c,markerColor:u}),r.eventBus.emit("search:match",ct({query:v.text},v)),d.a(2);case 1:if(!((null==b?void 0:b.length)<3)){d.n=2;break}return d.a(2);case 2:if(w=h,h.length&&b===l){d.n=4;break}return d.n=3,rt(b,a,e,s);case 3:S=d.v,O=S.results,E=S.sanitisedValue,w=O,l=E;case 4:w.length&&("keyboard"===f.interfaceType&&(null===(j=n.current)||void 0===j||j.focus()),"mobile"===f.breakpoint&&(e({type:"TOGGLE_EXPANDED",payload:!1}),r.eventBus.emit("search:close")),N=w[0],nt({mapProvider:o,bounds:N.bounds,point:N.point,markers:i,showMarker:c,markerColor:u}),r.eventBus.emit("search:match",ct({query:m},N)));case 5:return d.a(2)}},d)}),function(){var t=this,e=arguments;return new Promise(function(r,n){var o=d.apply(t,e);function i(t){lt(o,r,n,i,a,"next",t)}function a(t){lt(o,r,n,i,a,"throw",t)}i(void 0)})})();var d}}}(t),c=function(t){var e=t.dispatch,r=t.debouncedFetchSuggestions;return{handleInputClick:function(){e({type:"SHOW_SUGGESTIONS"})},handleInputFocus:function(t){e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:"keyboard"===t})},handleInputBlur:function(t){e({type:"INPUT_BLUR",payload:t})},handleInputChange:function(t){var n=t.target.value;if(e({type:"SET_VALUE",payload:n}),n.length<3)return r.cancel(),e({type:"UPDATE_SUGGESTIONS",payload:[]}),void e({type:"HIDE_SUGGESTIONS"});e({type:"SHOW_SUGGESTIONS"}),r(n)}}}(mt(mt({},t),{},{debouncedFetchSuggestions:a})),u=function(t){var e=t.dispatch,r=t.services,n=t.mapProvider,o=t.markers,i=t.showMarker,a=t.markerColor,s=function(t,e){var r;return e>=0?"".concat(null===(r=t[e])||void 0===r?void 0:r.text,". ").concat(e+1," of ").concat(t.length," is highlighted"):"".concat(t.length," suggestions available")};return{handleSuggestionClick:function(t,s){e({type:"SET_VALUE",payload:t.text}),e({type:"HIDE_SUGGESTIONS"}),e({type:"SET_SELECTED",payload:-1}),"mobile"===s.breakpoint&&(e({type:"TOGGLE_EXPANDED",payload:!1}),r.eventBus.emit("search:close")),nt({mapProvider:n,bounds:t.bounds,point:t.point,markers:o,showMarker:i,markerColor:a}),r.eventBus.emit("search:match",function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(r),!0).forEach(function(e){dt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({query:t.text},t))},handleInputKeyDown:function(t,n){var o=n.suggestions,i=n.selectedIndex;switch(t.key){case"ArrowDown":if(null==o||!o.length)return;if(t.preventDefault(),i<o.length-1){var a=i+1;r.announce(s(o,a)),e({type:"SET_SELECTED",payload:a}),e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!1})}break;case"ArrowUp":if(null==o||!o.length)return;t.preventDefault();var c=i>0?i-1:-1;r.announce(s(o,c)),e({type:"SET_SELECTED",payload:c}),e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:c<0});break;case"Escape":t.preventDefault(),e({type:"HIDE_SUGGESTIONS"}),e({type:"SET_SELECTED",payload:-1})}}}}(t);return mt(mt(mt(mt({},s),c),u),{},{handleOutside:function(e){i.current.contains(e.target)||(o({type:"TOGGLE_EXPANDED",payload:!1}),t.services.eventBus.emit("search:close"))}})}function vt(t){return vt="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},vt(t)}function wt(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 St(t,e,r){return(e=function(t){var e=function(t){if("object"!=vt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=vt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==vt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ot={reducer:{initialState:{isExpanded:!1,hasKeyboardFocusWithin:!1,value:"",suggestions:[],areSuggestionsVisible:!1,selectedIndex:-1},actions:f},controls:[{id:"search",label:"Search",mobile:{slot:"top-right"},tablet:{slot:"top-left"},desktop:{slot:"top-left"},render:function(o){var i=o.appConfig,a=o.iconRegistry,s=o.pluginState,c=o.pluginConfig,u=o.appState,l=o.mapState,f=o.services,d=o.mapProvider,h=i.id,y=u.interfaceType,m=c.isExpanded,b=c.customDatasets,w=c.osNamesURL,S=s.dispatch,O=s.isExpanded,E=s.areSuggestionsVisible,j=s.suggestions,N=a.close,T=a.search,P=e(null),_=e(null),x=e(null),G=e(null),k=u.layoutRefs.viewportRef,D=function(t){var e,r=t.customDatasets,n=t.crs;return[].concat([{name:"osNames",urlTemplate:t.osNamesURL,parseResults:function(t,e){return function(t,e,r){var n;if(!t||t.error||0===(null===(n=t.header)||void 0===n?void 0:n.totalresults))return[];var o=t.results;return o=function(t,e){var r=e.toLowerCase().replace(/,/g,"").split(" ");return t.filter(function(t){return r.some(function(r){return t.GAZETTEER_ENTRY.NAME1.toLowerCase().includes(r)||(n=(n=e).replace(/\s/g,""),/^(([A-Z]{1,2}\d[A-Z\d]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?\d[A-Z]{2}|BFPO ?\d{1,4}|(KY\d|MSR|VG|AI)[ -]?\d{4}|[A-Z]{2} ?\d{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$/i.test(n));var n})})}(o,e),(o=(o=function(t){return Array.from(new Map(t.map(function(t){return[t.GAZETTEER_ENTRY.ID,t]})).values())}(o)).slice(0,8)).map(function(t){return $($({id:t.GAZETTEER_ENTRY.ID,bounds:U(r,t.GAZETTEER_ENTRY),point:B(r,t.GAZETTEER_ENTRY)},function(t,e){var r,n,o,i,a,s,c=e.NAME1,u=e.COUNTY_UNITARY,l=e.DISTRICT_BOROUGH,f=e.POSTCODE_DISTRICT,p=e.LOCAL_TYPE,d="".concat(["City","Postcode"].includes(p)?"":f+", ").concat("City"===p?"":u||l),h="".concat(c).concat(d?", "+d:"");return{text:h,marked:(r=h,n=t,a=n.replace(/\s+/g,"").split("").join(String.raw(A||(o=["s*"],(i=["\\s*"])||(i=o.slice(0)),A=Object.freeze(Object.defineProperties(o,{raw:{value:Object.freeze(i)}}))))),s=new RegExp("(".concat(a,")"),"i"),r.replace(s,"<mark>$1</mark>"))}}(e,t.GAZETTEER_ENTRY)),{},{type:"os-names"})})}(t,e,n)},includeRegex:/^[a-zA-Z0-9\s,-]+$/,excludeRegex:/^(?:[a-z]{2}\s*(?:\d{3}\s*\d{3}|\d{4}\s*\d{4}|\d{5}\s*\d{5})|\d+\s*,?\s*\d+)$/i}],function(t){if(Array.isArray(t))return z(t)}(e=void 0===r?[]:r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return z(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)?z(t,e):void 0}}(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.")}())}({customDatasets:b,osNamesURL:w,crs:d.crs}),M=e(null);M.current||(M.current=gt(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(e){St(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({dispatch:S,datasets:D,services:f,mapProvider:d,viewportRef:k,searchContainerRef:P,markers:l.markers},c)));var C=M.current,R=O||!!(m&&E&&j.length);return t(function(){var t;O&&(null===(t=x.current)||void 0===t||t.focus())},[O]),t(function(){if(u.dispatch({type:"TOGGLE_HAS_EXCLUSIVE_CONTROL",payload:O}),R)return k.current.style.pointerEvents="none",document.addEventListener("focusin",C.handleOutside),document.addEventListener("pointerdown",C.handleOutside),function(){k.current.style.pointerEvents="auto",document.removeEventListener("focusin",C.handleOutside),document.removeEventListener("pointerdown",C.handleOutside)}},[O,y,E,j]),n("div",{className:"im-c-search",ref:P,children:[!m&&r(p,{id:h,isExpanded:O,onClick:function(){return C.handleOpenClick(u)},buttonRef:_,searchIcon:T}),r(g,{id:h,pluginState:s,pluginConfig:c,appState:u,inputRef:x,events:C,children:r(v,{defaultExpanded:m,onClick:function(t){return C.handleCloseClick(t,_,u)},closeIcon:N,ref:G})})]})}}],icons:[{id:"search",svgContent:'<path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle>'}]}}},i={};function a(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t](r,r.exports,a),r.exports}a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};function c(t){return c="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},c(t)}function u(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof s?n:s,u=Object.create(c.prototype);return l(u,"_invoke",function(r,n,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,c=t,p.n=r,a}};function d(r,n){for(s=r,c=n,e=0;!f&&u&&!o&&e<l.length;e++){var o,i=l[e],d=p.p,h=i[2];r>3?(o=h===n)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(e=s<2?t:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?c:r.call(n,p))!==a)break}catch(e){i=t,s=1,c=e}finally{u=1}}return{value:e,done:f}}}(r,o,i),!0),u}var a={};function s(){}function c(){}function f(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(l(e={},n,function(){return this}),e),d=f.prototype=s.prototype=Object.create(p);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,l(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=f,l(d,"constructor",f),l(f,"constructor",c),c.displayName="GeneratorFunction",l(f,o,"GeneratorFunction"),l(d),l(d,o,"Generator"),l(d,n,function(){return this}),l(d,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:h}})()}function l(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}l=function(t,e,r,n){function i(e,r){l(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))},l(t,e,r,n)}function f(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function p(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 d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach(function(e){h(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(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"!=c(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(){var t,e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.isExpanded&&(r.manifest={controls:[{id:"search",mobile:{slot:"banner"}}]}),d(d({showMarker:!0},r),{},{id:"search",load:(t=u().m(function t(){var e;return u().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Promise.resolve().then(a.bind(a,"./plugins/search/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 a(t){f(i,n,o,a,s,"next",t)}function s(t){f(i,n,o,a,s,"throw",t)}a(void 0)})},function(){return e.apply(this,arguments)})})}a.d(s,{A:()=>y});const m=s.A;export{m as default};
@@ -0,0 +1 @@
1
+ :root{font-family:inherit !important;text-rendering:auto !important;-webkit-font-smoothing:auto !important;-moz-osx-font-smoothing:auto !important}:root:not(.esri-ui):not([class*=calcite]):not([class*=esri]){--calcite-font-family: inherit !important;--calcite-sans-family: inherit !important}body,html{font-family:inherit !important;text-rendering:auto !important;-webkit-font-smoothing:auto !important;-moz-osx-font-smoothing:auto !important}.your-map-container{font-family:var(--calcite-font-family)}:not(.esri-view):not(.esri-ui):not([class*=calcite]):not([class*=esri]).calcite-typography,:not(.esri-view):not(.esri-ui):not([class*=calcite]):not([class*=esri]) .calcite-typography{font-family:inherit !important;font-size:inherit !important;font-weight:inherit !important;letter-spacing:inherit !important;line-height:inherit !important}
@@ -0,0 +1,2 @@
1
+ /*! For license information please see index.js.LICENSE.txt */
2
+ import{default as t}from"@arcgis/core/config.js";import{default as e}from"@arcgis/core/Map.js";import{default as n}from"@arcgis/core/views/MapView.js";import{default as r}from"@arcgis/core/layers/VectorTileLayer.js";import{once as o,watch as i,when as a}from"@arcgis/core/core/reactiveUtils.js";import{default as u}from"@arcgis/core/geometry/Extent.js";import{default as c}from"@arcgis/core/geometry/Point.js";var f={"./providers/beta/esri/src/esriProvider.js"(f,s,l){l.d(s,{default:()=>z}),l.r(s);var p={animationDuration:200},v=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom"];function y(t){var e=t.baseTileLayer,n=t.events,r=t.eventBus,o=function(t){e.loadStyle(t.url).then(function(){r.emit(n.MAP_STYLE_CHANGE,t)})};return r.on(n.MAP_SET_STYLE,o),{remove:function(){r.off(n.MAP_SET_STYLE,o)}}}var m=function(t,e){var n=null,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];clearTimeout(n),n=setTimeout(function(){t.apply(void 0,o)},e)};return r.cancel=function(){n&&(clearTimeout(n),n=null)},r};function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function h(t){var e=t.mapProvider,n=t.view,r=t.baseTileLayer,u=t.events,c=t.eventBus,f=t.getZoom,s=t.getCenter,l=t.getBounds,p=t.getResolution,v=!1,y=[],h=[],b=function(t){var e=function(){if(v||!n||n.destroyed||!n.extent)return null;var t=n.constraints,e=t.maxZoom,r=t.minZoom;return{center:s(),bounds:l(),resolution:p(),zoom:f(),isAtMaxZoom:n.zoom+.01>=e,isAtMinZoom:n.zoom-.01<=r}}();e&&c.emit(t,e)};a(function(){return r.loaded&&n.resolution>0},function(){return b(u.MAP_LOADED)}),o(function(){return n.ready}).then(function(){v||c.emit(u.MAP_READY,e.getMapAPI())}),o(function(){return n.stationary}).then(function(){return b(u.MAP_FIRST_IDLE)});var g=m(function(){return b(u.MAP_MOVE_END)},500);h.push(g),y.push(i(function(){return[n.interacting,n.animation]},function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,f=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){f=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(f)throw o}}return u}}(e,n)||function(t,e){if(t){if("string"==typeof t)return d(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}(e,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.")}()),o=r[0],i=r[1];(o||i)&&c.emit(u.MAP_MOVE_START),o||i||g()}));var w,O,S=(w=function(){return b(u.MAP_MOVE)},O=0,function(){var t=Date.now();t-O>=10&&(O=t,w.apply(void 0,arguments))});h.push(S),y.push(i(function(){return n.zoom},S)),y.push(i(function(){return n.extent},function(){return c.emit(u.MAP_RENDER)},{initial:!1}));var j=m(function(){return b(u.MAP_DATA_CHANGE)},500);return h.push(j),y.push(i(function(){return n.updating},function(t){return!t&&j()})),y.push(n.on("click",function(t){var e=t.mapPoint,n={x:t.x,y:t.y};c.emit(u.MAP_CLICK,{point:n,coords:[e.x,e.y]})})),{remove:function(){v=!0,h.forEach(function(t){return t.cancel()}),y.forEach(function(t){return t.remove()})}}}function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,f=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){f=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(f)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return g(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(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 g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var w=function(t){var e=1609.344,n=t/e;if(n<.5/e)return"".concat(Math.round(t),"m");if(n<10){var r=Number.parseFloat(n.toFixed(1)),o=1===r?"mile":"miles";return"".concat(r," ").concat(o)}var i=Math.round(n),a=1===i?"mile":"miles";return"".concat(i," ").concat(a)},O={top:0,right:0,bottom:0,left:0};function S(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var c=r&&r.prototype instanceof u?r:u,f=Object.create(c.prototype);return j(f,"_invoke",function(n,r,o){var i,u,c,f=0,s=o||[],l=!1,p={p:0,n:0,v:t,a:v,f:v.bind(t,4),d:function(e,n){return i=e,u=0,c=t,p.n=n,a}};function v(n,r){for(u=n,c=r,e=0;!l&&f&&!o&&e<s.length;e++){var o,i=s[e],v=p.p,y=i[2];n>3?(o=y===r)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=v&&((o=n<2&&v<i[1])?(u=0,p.v=r,p.n=i[1]):v<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,u=0))}if(o||n>1)return a;throw l=!0,r}return function(o,s,y){if(f>1)throw TypeError("Generator is already running");for(l&&1===s&&v(s,y),u=s,c=y;(e=u<2?t:c)||!l;){i||(u?u<3?(u>1&&(p.n=-1),v(u,c)):p.n=c:p.v=c);try{if(f=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(l=p.n<0)?c:n.call(r,p))!==a)break}catch(e){i=t,u=1,c=e}finally{f=1}}return{value:e,done:l}}}(n,o,i),!0),f}var a={};function u(){}function c(){}function f(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(j(e={},r,function(){return this}),e),l=f.prototype=u.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,j(t,o,"GeneratorFunction")),t.prototype=Object.create(l),t}return c.prototype=f,j(l,"constructor",f),j(f,"constructor",c),c.displayName="GeneratorFunction",j(f,o,"GeneratorFunction"),j(l),j(l,o,"Generator"),j(l,r,function(){return this}),j(l,"toString",function(){return"[object Generator]"}),(S=function(){return{w:i,m:p}})()}function j(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}j=function(t,e,n,r){function i(e,n){j(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},j(t,e,n,r)}function x(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function P(){var t;return t=S().m(function t(e,n){var o,i;return S().w(function(t){for(;;)switch(t.n){case 0:if(e&&n){t.n=1;break}return t.a(2,[]);case 1:if((o=e.map.layers.filter(function(t){return t instanceof r})).length){t.n=2;break}return t.a(2,[]);case 2:return t.n=3,e.hitTest(n,{include:o.toArray()});case 3:return i=t.v,t.a(2,i.results.map(function(t){return{layerId:t.layer.id,layerTitle:t.layer.title||t.layer.id,type:t.layer.type,geometry:t.graphic.geometry,symbol:t.graphic.symbol}}))}},t)}),P=function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){x(i,r,o,a,u,"next",t)}function u(t){x(i,r,o,a,u,"throw",t)}a(void 0)})},P.apply(this,arguments)}var E=function(t){return t?new u({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:{wkid:27700}}):void 0},T=function(t){return t?new c({x:t[0],y:t[1],spatialReference:{wkid:27700}}):void 0},A=function(t){if(t){var e=t.querySelector(".esri-view-surface");e.removeAttribute("role"),e.tabIndex=-1,e.style["outline-color"]="transparent",e.style.touchAction="none"}},M=["container","padding","mapStyle","maxExtent"];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 k(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var c=r&&r.prototype instanceof u?r:u,f=Object.create(c.prototype);return G(f,"_invoke",function(n,r,o){var i,u,c,f=0,s=o||[],l=!1,p={p:0,n:0,v:t,a:v,f:v.bind(t,4),d:function(e,n){return i=e,u=0,c=t,p.n=n,a}};function v(n,r){for(u=n,c=r,e=0;!l&&f&&!o&&e<s.length;e++){var o,i=s[e],v=p.p,y=i[2];n>3?(o=y===r)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=v&&((o=n<2&&v<i[1])?(u=0,p.v=r,p.n=i[1]):v<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,u=0))}if(o||n>1)return a;throw l=!0,r}return function(o,s,y){if(f>1)throw TypeError("Generator is already running");for(l&&1===s&&v(s,y),u=s,c=y;(e=u<2?t:c)||!l;){i||(u?u<3?(u>1&&(p.n=-1),v(u,c)):p.n=c:p.v=c);try{if(f=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(l=p.n<0)?c:n.call(r,p))!==a)break}catch(e){i=t,u=1,c=e}finally{f=1}}return{value:e,done:l}}}(n,o,i),!0),f}var a={};function u(){}function c(){}function f(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(G(e={},r,function(){return this}),e),l=f.prototype=u.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,G(t,o,"GeneratorFunction")),t.prototype=Object.create(l),t}return c.prototype=f,G(l,"constructor",f),G(f,"constructor",c),c.displayName="GeneratorFunction",G(f,o,"GeneratorFunction"),G(l),G(l,o,"Generator"),G(l,r,function(){return this}),G(l,"toString",function(){return"[object Generator]"}),(k=function(){return{w:i,m:p}})()}function G(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}G=function(t,e,n,r){function i(e,n){G(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},G(t,e,n,r)}function C(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function D(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function L(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,I(r.key),r)}}function I(t){var e=function(t){if("object"!=_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_(e)?e:e+""}var z=function(){return o=function t(e){var n=e.mapProviderConfig,r=void 0===n?{}:n,o=e.events,i=e.eventBus;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.events=o,this.eventBus=i,this.capabilities={supportedShortcuts:v,supportsMapSizes:!1},Object.assign(this,r),this.mapEventHandles=[],this.appEventHandles=[]},i=[{key:"initMap",value:(a=k().m(function o(i){var a,u,c,f,s,l,p,v,m,d;return k().w(function(o){for(;;)switch(o.n){case 0:if(a=i.container,u=i.padding,c=i.mapStyle,f=i.maxExtent,C(i,M),s=this.events,l=this.eventBus,!this.setupConfig){o.n=1;break}return o.n=1,this.setupConfig(t);case 1:p=new r({id:"baselayer",url:c.url,visible:!0}),v=new e({layers:[p]}),m=f?E(f):null,d=new n({spatialReference:27700,container:a,map:v,zoom:i.zoom,center:T(i.center),maxExtent:f,constraints:{snapToZoom:!1,minZoom:i.minZoom,maxZoom:i.maxZoom,maxScale:0,geometry:m,rotationEnabled:!1},ui:{components:[]},popupEnabled:!1}),A(d.container),d.padding=u,i.bounds&&d.when(function(){return d.goTo(E(i.bounds),{duration:0})}),this.mapEventHandles=h({mapProvider:this,map:v,view:d,baseTileLayer:p,events:s,eventBus:l,getZoom:this.getZoom.bind(this),getCenter:this.getCenter.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),this.appEventHandles=y({baseTileLayer:p,events:s,eventBus:l})||[],this.map=v,this.view=d,this.baseTileLayer=p;case 2:return o.a(2)}},o,this)}),c=function(){var t=this,e=arguments;return new Promise(function(n,r){var o=a.apply(t,e);function i(t){D(o,n,r,i,u,"next",t)}function u(t){D(o,n,r,i,u,"throw",t)}i(void 0)})},function(t){return c.apply(this,arguments)})},{key:"destroyMap",value:function(){var t,e;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.view&&(this.view.container=null,this.view.destroy(),this.view=null),this.map&&(this.map.removeAll(),this.map=null)}},{key:"getMapAPI",value:function(){return{map:this.map,view:this.view,crs:this.crs,fitToBounds:this.fitToBounds.bind(this),setView:this.setView.bind(this)}}},{key:"setView",value:function(t){var e,n=t.center,r=t.zoom;null===(e=this.view.animation)||void 0===e||e.destroy(),this.view.goTo({center:n,zoom:r,duration:p.animationDuration})}},{key:"zoomIn",value:function(t){var e;null===(e=this.view.animation)||void 0===e||e.destroy(),this.view.goTo({zoom:this.view.zoom+t,duration:p.animationDuration})}},{key:"zoomOut",value:function(t){var e;null===(e=this.view.animation)||void 0===e||e.destroy(),this.view.goTo({zoom:this.view.zoom-t,duration:p.animationDuration})}},{key:"panBy",value:function(t){var e=this.view.toScreen(this.view.center),n=e.x,r=e.y,o={x:n+t[0],y:r+t[1]},i=this.view.toMap(o);this.view.goTo({center:i,duration:p.animationDuration})}},{key:"fitToBounds",value:function(t){this.view.goTo(E(t),{duration:p.DELAY})}},{key:"setPadding",value:function(t){this.view.padding=t}},{key:"getCenter",value:function(){var t=this.view.center;return[t.x,t.y].map(function(t){return Math.round(100*t)/100})}},{key:"getZoom",value:function(){return this.view.zoom}},{key:"getBounds",value:function(){var t=this.view.extent;return[t.xmin,t.ymin,t.xmax,t.ymax].map(function(t){return Math.round(100*t)/100})}},{key:"getFeaturesAtPoint",value:function(t,e){return function(t,e){return P.apply(this,arguments)}(this.view,t)}},{key:"getAreaDimensions",value:function(){return function(t){if(!(t&&t instanceof u))return"";var e=t.xmin,n=t.ymin,r=t.xmax,o=t.ymax-n,i=w(r-e),a=w(o);return"".concat(a," by ").concat(i)}(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:O;if(!t.container)return null;var n=t.container.getBoundingClientRect(),r=n.width,o=n.height,i={x:e.left,y:o-e.bottom},a={x:r-e.right,y:e.top},c=t.toMap(i),f=t.toMap(a);return new u({xmin:c.x,ymin:c.y,xmax:f.x,ymax:f.y,spatialReference:c.spatialReference})}(this.view))}},{key:"getCardinalMove",value:function(t,e){return function(t,e){var n=b(t,2),r=n[0],o=n[1],i=b(e,2),a=i[0]-r,u=i[1]-o,c=[];return Math.abs(u)>.1&&c.push("".concat(u>0?"north":"south"," ").concat(w(Math.abs(u)))),Math.abs(a)>.1&&c.push("".concat(a>0?"east":"west"," ").concat(w(Math.abs(a)))),c.join(", ")}(t,e)}},{key:"getResolution",value:function(){return this.view.resolution}},{key:"mapToScreen",value:function(t){var e=T(t),n=this.view.toScreen(e);return{x:n.x,y:n.y}}},{key:"screenToMap",value:function(t){var e=this.view.toMap(t);return[e.x,e.y]}}],i&&L(o.prototype,i),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,i,a,c}()}},s={};function l(t){var e=s[t];if(void 0!==e)return e.exports;var n=s[t]={exports:{}};return f[t](n,n.exports,l),n.exports}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}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 y(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var c=r&&r.prototype instanceof u?r:u,f=Object.create(c.prototype);return m(f,"_invoke",function(n,r,o){var i,u,c,f=0,s=o||[],l=!1,p={p:0,n:0,v:t,a:v,f:v.bind(t,4),d:function(e,n){return i=e,u=0,c=t,p.n=n,a}};function v(n,r){for(u=n,c=r,e=0;!l&&f&&!o&&e<s.length;e++){var o,i=s[e],v=p.p,y=i[2];n>3?(o=y===r)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=v&&((o=n<2&&v<i[1])?(u=0,p.v=r,p.n=i[1]):v<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,u=0))}if(o||n>1)return a;throw l=!0,r}return function(o,s,y){if(f>1)throw TypeError("Generator is already running");for(l&&1===s&&v(s,y),u=s,c=y;(e=u<2?t:c)||!l;){i||(u?u<3?(u>1&&(p.n=-1),v(u,c)):p.n=c:p.v=c);try{if(f=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(l=p.n<0)?c:n.call(r,p))!==a)break}catch(e){i=t,u=1,c=e}finally{f=1}}return{value:e,done:l}}}(n,o,i),!0),f}var a={};function u(){}function c(){}function f(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(m(e={},r,function(){return this}),e),l=f.prototype=u.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,m(t,o,"GeneratorFunction")),t.prototype=Object.create(l),t}return c.prototype=f,m(l,"constructor",f),m(f,"constructor",c),c.displayName="GeneratorFunction",m(f,o,"GeneratorFunction"),m(l),m(l,o,"Generator"),m(l,r,function(){return this}),m(l,"toString",function(){return"[object Generator]"}),(y=function(){return{w:i,m:p}})()}function m(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}m=function(t,e,n,r){function i(e,n){m(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},m(t,e,n,r)}function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach(function(e){b(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function b(t,e,n){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 n=e.call(t,"string");if("object"!=v(n))return n;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:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}l.d=(t,e)=>{for(var n in e)l.o(e,n)&&!l.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},l.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),l.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var w=document.documentMode,O={isSupported:!!Array.prototype.findLast,error:"Array.FindLast() is not supported"},S=function(){if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var t,e=document.createElement("canvas"),n=!1,r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return p(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(["webgl2","webgl1"]);try{for(r.s();!(t=r.n()).done;){var o=t.value;try{if((n=e.getContext(o))&&"function"==typeof n.getParameter)return{isEnabled:!0}}catch(t){}}}catch(t){r.e(t)}finally{r.f()}return{isEnabled:!1,error:"WebGL is supported, but disabled"}}();function j(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:function(){return{isSupported:O.isSupported&&S.isEnabled&&!w,error:"Internet Explorer is not supported"}},load:(t=y().m(function t(){var e,r,o;return y().w(function(t){for(;;)switch(t.p=t.n){case 0:return e=h(h({},n),{},{crs:"EPSG:27700"}),t.p=1,t.n=2,Promise.resolve().then(l.bind(l,"./providers/beta/esri/src/esriProvider.js"));case 2:return r=t.v.default,t.a(2,{MapProvider:r,mapProviderConfig:e});case 3:throw t.p=3,o=t.v,console.error("Failed to load map provider",o),o;case 4:return t.a(2)}},t,null,[[1,3]])}),e=function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){g(i,r,o,a,u,"next",t)}function u(t){g(i,r,o,a,u,"throw",t)}a(void 0)})},function(){return e.apply(this,arguments)})}}export{j as default};
@@ -68,6 +68,7 @@ export default class EsriProvider {
68
68
 
69
69
  // Attach map events and store handles
70
70
  this.mapEventHandles = attachMapEvents({
71
+ mapProvider: this,
71
72
  map,
72
73
  view,
73
74
  baseTileLayer,
@@ -111,6 +112,17 @@ export default class EsriProvider {
111
112
  }
112
113
  }
113
114
 
115
+ /** Returns the public API exposed via the map:ready event. */
116
+ getMapAPI () {
117
+ return {
118
+ map: this.map,
119
+ view: this.view,
120
+ crs: this.crs,
121
+ fitToBounds: this.fitToBounds.bind(this),
122
+ setView: this.setView.bind(this)
123
+ }
124
+ }
125
+
114
126
  // ==========================
115
127
  // Side-effects
116
128
  // ==========================
@@ -7,7 +7,7 @@ const MOVE_THROTTLE_TIME = 10
7
7
  const ZOOM_TOLERANCE = 0.01
8
8
 
9
9
  export function attachMapEvents ({
10
- map,
10
+ mapProvider,
11
11
  view,
12
12
  baseTileLayer,
13
13
  events,
@@ -54,7 +54,7 @@ export function attachMapEvents ({
54
54
  // ready
55
55
  once(() => view.ready).then(() => {
56
56
  if (!destroyed) {
57
- eventBus.emit(events.MAP_READY, { map, view })
57
+ eventBus.emit(events.MAP_READY, mapProvider.getMapAPI())
58
58
  }
59
59
  })
60
60
 
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>"../esm/"+e+".js",n.miniCssF=e=>{},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e+"../css/"})(),e={index:0},r=r=>{var t,o,{__webpack_esm_ids__:i,__webpack_esm_modules__:c,__webpack_esm_runtime__:u}=r,a=0;for(t in c)n.o(c,t)&&(n.m[t]=c[t]);for(u&&u(n);a<i.length;a++)o=i[a],n.o(e,o)&&e[o]&&e[o][0](),e[i[a]]=0},n.f.j=(t,o)=>{var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)o.push(i[1]);else{var c=import("../css/"+n.u(t)).then(r,r=>{throw 0!==e[t]&&(e[t]=void 0),r});c=Promise.race([c,new Promise(r=>i=e[t]=[r])]),o.push(i[1]=c)}};var i={};function c(e){return c="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},c(e)}function u(){var e,r,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.toStringTag||"@@toStringTag";function i(t,o,n,i){var u=o&&o.prototype instanceof f?o:f,p=Object.create(u.prototype);return a(p,"_invoke",function(t,o,n){var i,u,a,f=0,p=n||[],s=!1,l={p:0,n:0,v:e,a:b,f:b.bind(e,4),d:function(r,t){return i=r,u=0,a=e,l.n=t,c}};function b(t,o){for(u=t,a=o,r=0;!s&&f&&!n&&r<p.length;r++){var n,i=p[r],b=l.p,y=i[2];t>3?(n=y===o)&&(a=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=b&&((n=t<2&&b<i[1])?(u=0,l.v=o,l.n=i[1]):b<y&&(n=t<3||i[0]>o||o>y)&&(i[4]=t,i[5]=o,l.n=y,u=0))}if(n||t>1)return c;throw s=!0,o}return function(n,p,y){if(f>1)throw TypeError("Generator is already running");for(s&&1===p&&b(p,y),u=p,a=y;(r=u<2?e:a)||!s;){i||(u?u<3?(u>1&&(l.n=-1),b(u,a)):l.n=a:l.v=a);try{if(f=2,i){if(u||(n="next"),r=i[n]){if(!(r=r.call(i,a)))throw TypeError("iterator result is not an object");if(!r.done)return r;a=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(a=TypeError("The iterator does not provide a '"+n+"' method"),u=1);i=e}else if((r=(s=l.n<0)?a:t.call(o,l))!==c)break}catch(r){i=e,u=1,a=r}finally{f=1}}return{value:r,done:s}}}(t,n,i),!0),p}var c={};function f(){}function p(){}function s(){}r=Object.getPrototypeOf;var l=[][o]?r(r([][o]())):(a(r={},o,function(){return this}),r),b=s.prototype=f.prototype=Object.create(l);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,a(e,n,"GeneratorFunction")),e.prototype=Object.create(b),e}return p.prototype=s,a(b,"constructor",s),a(s,"constructor",p),p.displayName="GeneratorFunction",a(s,n,"GeneratorFunction"),a(b),a(b,n,"Generator"),a(b,o,function(){return this}),a(b,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:y}})()}function a(e,r,t,o){var n=Object.defineProperty;try{n({},"",{})}catch(e){n=0}a=function(e,r,t,o){function i(r,t){a(e,r,function(e){return this._invoke(r,t,e)})}r?n?n(e,r,{value:t,enumerable:!o,configurable:!o,writable:!o}):e[r]=t:(i("next",0),i("throw",1),i("return",2))},a(e,r,t,o)}function f(e,r,t,o,n,i,c){try{var u=e[i](c),a=u.value}catch(e){return void t(e)}u.done?r(a):Promise.resolve(a).then(o,n)}function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?p(Object(t),!0).forEach(function(r){l(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function l(e,r,t){return(r=function(e){var r=function(e){if("object"!=c(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=c(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function b(){var e,r;return s(s({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{load:(e=u().m(function e(){var r;return u().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.e("im-reverse-geocode").then(n.bind(n,"./providers/beta/open-names/src/reverseGeocode.js"));case 1:return r=e.v,e.a(2,r.reverseGeocode)}},e)}),r=function(){var r=this,t=arguments;return new Promise(function(o,n){var i=e.apply(r,t);function c(e){f(i,o,n,c,u,"next",e)}function u(e){f(i,o,n,c,u,"throw",e)}c(void 0)})},function(){return r.apply(this,arguments)})})}n.d(i,{A:()=>b});const y=i.A;export{y as default};
2
+ var t={"./providers/beta/open-names/src/reverseGeocode.js"(t,e,r){r.d(e,{reverseGeocode:()=>S}),r.r(e);let n=" ";class o{static get separator(){return n}static set separator(t){n=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,i=null,a=null,s=null;switch(e){default:case"d":case"deg":i=t.toFixed(r),i<100&&(i="0"+i),i<10&&(i="0"+i),n=i+"°";break;case"dm":case"deg+min":i=Math.floor(t),a=(60*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),i++),i=("000"+i).slice(-3),a<10&&(a="0"+a),n=i+"°"+o.separator+a+"′";break;case"dms":case"deg+min+sec":i=Math.floor(t),a=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(r),60==s&&(s=(0).toFixed(r),a++),60==a&&(a=0,i++),i=("000"+i).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),n=i+"°"+o.separator+a+"′"+o.separator+s+"″"}return n}static toLat(t,e,r){const n=o.toDms(o.wrap90(t),e,r);return null===n?"–":n.slice(1)+o.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=o.toDms(o.wrap180(t),e,r);return null===n?"–":n+o.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=o.toDms(o.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=o.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 i=o;class a{constructor(t,e,r){if(isNaN(t)||isNaN(e)||isNaN(r))throw new TypeError(`invalid vector [${t},${e},${r}]`);this.x=Number(t),this.y=Number(e),this.z=Number(r)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");return new a(this.x+t.x,this.y+t.y,this.z+t.z)}minus(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");return new a(this.x-t.x,this.y-t.y,this.z-t.z)}times(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new a(this.x*t,this.y*t,this.z*t)}dividedBy(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new a(this.x/t,this.y/t,this.z/t)}dot(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");const e=this.y*t.z-this.z*t.y,r=this.z*t.x-this.x*t.z,n=this.x*t.y-this.y*t.x;return new a(e,r,n)}negate(){return new a(-this.x,-this.y,-this.z)}unit(){const t=this.length;if(1==t)return this;if(0==t)return this;const e=this.x/t,r=this.y/t,n=this.z/t;return new a(e,r,n)}angleTo(t,e=void 0){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");if(!(e instanceof a||null==e))throw new TypeError("n is not Vector3d object");const r=null==e||this.cross(t).dot(e)>=0?1:-1,n=this.cross(t).length*r,o=this.dot(t);return Math.atan2(n,o)}rotateAround(t,e){if(!(t instanceof a))throw new TypeError("axis is not Vector3d object");const r=e.toRadians(),n=this.unit(),o=t.unit(),i=Math.sin(r),s=Math.cos(r),l=1-s,c=o.x,u=o.y,h=o.z,p=[[l*c*c+s,l*c*u-i*h,l*c*h+i*u],[l*c*u+i*h,l*u*u+s,l*u*h-i*c],[l*c*h-i*u,l*u*h+i*c,l*h*h+s]],d=[p[0][0]*n.x+p[0][1]*n.y+p[0][2]*n.z,p[1][0]*n.x+p[1][1]*n.y+p[1][2]*n.z,p[2][0]*n.x+p[2][1]*n.y+p[2][2]*n.z];return new a(d[0],d[1],d[2])}toString(t=3){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const s=a,l={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},c={WGS84:{ellipsoid:l.WGS84}};Object.freeze(l.WGS84),Object.freeze(c.WGS84);class u{constructor(t,e,r=0){if(isNaN(t)||null==t)throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e)||null==e)throw new TypeError(`invalid lon ‘${e}’`);if(isNaN(r)||null==r)throw new TypeError(`invalid height ‘${r}’`);this._lat=i.wrap90(Number(t)),this._lon=i.wrap180(Number(e)),this._height=Number(r)}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?i.wrap90(i.parse(t)):i.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?i.wrap90(i.parse(t)):i.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)?i.wrap180(i.parse(t)):i.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?i.wrap180(i.parse(t)):i.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?i.wrap180(i.parse(t)):i.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}get height(){return this._height}set height(t){if(this._height=Number(t),isNaN(this._height))throw new TypeError(`invalid height ‘${t}’`)}get datum(){return this._datum}set datum(t){this._datum=t}static get ellipsoids(){return l}static get datums(){return c}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");let e,r,n;if("object"==typeof t[0]&&(1==t.length||!isNaN(parseFloat(t[1])))){const o=t[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([r,e,n]=o.coordinates,n=n||0):(null!=o.latitude&&(e=o.latitude),null!=o.lat&&(e=o.lat),null!=o.longitude&&(r=o.longitude),null!=o.lng&&(r=o.lng),null!=o.lon&&(r=o.lon),null!=o.height&&(n=o.height),e=i.wrap90(i.parse(e)),r=i.wrap180(i.parse(r))),null!=t[1]&&(n=t[1]),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if("string"==typeof t[0]&&2==t[0].split(",").length&&([e,r]=t[0].split(","),e=i.wrap90(i.parse(e)),r=i.wrap180(i.parse(r)),n=t[1]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(null==e&&null==r&&([e,r]=t,e=i.wrap90(i.parse(e)),r=i.wrap180(i.parse(r)),n=t[2]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);return new this(e,r,n)}toCartesian(){const t=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:l.WGS84,e=this.lat.toRadians(),r=this.lon.toRadians(),n=this.height,{a:o,f:i}=t,a=Math.sin(e),s=Math.cos(e),c=Math.sin(r),u=Math.cos(r),p=2*i-i*i,d=o/Math.sqrt(1-p*a*a);return new h((d+n)*s*u,(d+n)*s*c,(d*(1-p)+n)*a)}equals(t){if(!(t instanceof u))throw new TypeError(`invalid point ‘${t}’`);return!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON||Math.abs(this.height-t.height)>Number.EPSILON||this.datum!=t.datum||this.referenceFrame!=t.referenceFrame||this.epoch!=t.epoch)}toString(t="d",e=void 0,r=null){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);const n=(this.height>=0?" +":" ")+this.height.toFixed(r)+"m";return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)}, ${this.lon.toFixed(e)}${null==r?"":n}`):`${i.toLat(this.lat,t,e)}, ${i.toLon(this.lon,t,e)}${null==r?"":n}`}}class h extends s{constructor(t,e,r){super(t,e,r)}toLatLon(t=l.WGS84){if(!t||!t.a)throw new TypeError(`invalid ellipsoid ‘${t}’`);const{x:e,y:r,z:n}=this,{a:o,b:i,f:a}=t,s=2*a-a*a,c=s/(1-s),h=Math.sqrt(e*e+r*r),p=i*n/(o*h)*(1+c*i/Math.sqrt(h*h+n*n)),d=p/Math.sqrt(1+p*p),f=d/p,y=isNaN(f)?0:Math.atan2(n+c*i*d*d*d,h-s*o*f*f*f),m=Math.atan2(r,e),g=Math.sin(y),w=h*Math.cos(y)+n*g-o*o/(o/Math.sqrt(1-s*g*g));return new u(y.toDegrees(),m.toDegrees(),w)}toString(t=0){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}const p={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},d={ED50:{ellipsoid:p.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:p.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:p.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:p.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:p.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:p.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:p.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:p.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:p.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:p.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:p.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(p).forEach(t=>Object.freeze(p[t])),Object.keys(d).forEach(t=>{Object.freeze(d[t]),Object.freeze(d[t].transform)});class f extends u{constructor(t,e,r=0,n=d.WGS84){if(!n||null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),this._datum=n}get datum(){return this._datum}static get ellipsoids(){return p}static get datums(){return d}static parse(...t){let e=d.WGS84;if((4==t.length||3==t.length&&"object"==typeof t[2])&&(e=t.pop()),!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.parse(...t);return r._datum=e,r}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);return this.toCartesian().convertDatum(t).toLatLon()}toCartesian(){const t=super.toCartesian();return new y(t.x,t.y,t.z,this.datum)}}class y extends h{constructor(t,e,r,n=void 0){if(n&&null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),n&&(this._datum=n)}get datum(){return this._datum}set datum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);this._datum=t}toLatLon(t=void 0){t&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=t);const e=this.datum||d.WGS84;if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.toLatLon(e.ellipsoid);return new f(r.lat,r.lon,r.height,this.datum)}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let e=null,r=null;null!=this.datum&&this.datum!=d.WGS84||(e=this,r=t.transform),t==d.WGS84&&(e=this,r=this.datum.transform.map(t=>-t)),null==r&&(e=this.convertDatum(d.WGS84),r=t.transform);const n=e.applyTransform(r);return n.datum=t,n}applyTransform(t){const{x:e,y:r,z:n}=this,o=t[0],i=t[1],a=t[2],s=t[3]/1e6+1,l=(t[4]/3600).toRadians(),c=(t[5]/3600).toRadians(),u=(t[6]/3600).toRadians();return new y(o+e*s-r*u+n*c,i+e*u+r*s-n*l,a-e*c+r*l+n*s)}}const m={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:f.ellipsoids.Airy1830};class g{constructor(t,e){if(this.easting=Number(t),this.northing=Number(e),isNaN(t)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${t}’`);if(isNaN(e)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${e}’`)}toLatLon(t=f.datums.WGS84){const{easting:e,northing:r}=this,{a:n,b:o}=m.ellipsoid,i=m.trueOrigin.lat.toRadians(),a=m.trueOrigin.lon.toRadians(),s=-m.falseOrigin.easting,l=-m.falseOrigin.northing,c=m.scaleFactor,u=1-o*o/(n*n),h=(n-o)/(n+o),p=h*h,d=h*h*h;let y=i,g=0;do{y=(r-l-g)/(n*c)+y,g=o*c*((1+h+5/4*p+5/4*d)*(y-i)-(3*h+3*h*h+21/8*d)*Math.sin(y-i)*Math.cos(y+i)+(15/8*p+15/8*d)*Math.sin(2*(y-i))*Math.cos(2*(y+i))-35/24*d*Math.sin(3*(y-i))*Math.cos(3*(y+i)))}while(Math.abs(r-l-g)>=1e-5);const b=Math.cos(y),v=Math.sin(y),_=n*c/Math.sqrt(1-u*v*v),N=n*c*(1-u)/Math.pow(1-u*v*v,1.5),S=_/N-1,E=Math.tan(y),O=E*E,M=O*O,T=1/b,x=_*_*_,G=x*_*_,$=e-s,j=$*$,P=j*$,F=j*j,R=P*j;y=y-E/(2*N*_)*j+E/(24*N*x)*(5+3*O+S-9*O*S)*F-E/(720*N*G)*(61+90*O+45*M)*(F*j);const W=a+T/_*$-T/(6*x)*(_/N+2*O)*P+T/(120*G)*(5+28*O+24*M)*R-T/(G*_*_*5040)*(61+662*O+1320*M+M*O*720)*(R*j);let D=new w(y.toDegrees(),W.toDegrees(),0,f.datums.OSGB36);return t!=f.datums.OSGB36&&(D=D.convertDatum(t),D=new w(D.lat,D.lon,D.height,D.datum)),D}static parse(t){let e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new g(e[1],e[2]);if(e=t.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!e)throw new Error(`invalid grid reference ‘${t}’`);let r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;const o=(r-2)%5*5+n%5,i=19-5*Math.floor(r/5)-Math.floor(n/5);let a=t.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${t}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],l=i+a[1];return new g(s,l)}toString(t=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);let{easting:e,northing:r}=this;if(0==t){const t={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${e.toLocaleString("en",t)},${r.toLocaleString("en",t)}`}const n=Math.floor(e/1e5),o=Math.floor(r/1e5);let i=19-o-(19-o)%5+Math.floor((n+10)/5),a=5*(19-o)%25+n%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),r=Math.floor(r%1e5/Math.pow(10,5-t/2)),e=e.toString().padStart(t/2,"0"),r=r.toString().padStart(t/2,"0"),`${s} ${e} ${r}`}}class w extends f{toOsGrid(){const t=this.datum==f.datums.OSGB36?this:this.convertDatum(f.datums.OSGB36),e=t.lat.toRadians(),r=t.lon.toRadians(),{a:n,b:o}=m.ellipsoid,i=m.trueOrigin.lat.toRadians(),a=m.trueOrigin.lon.toRadians(),s=-m.falseOrigin.easting,l=-m.falseOrigin.northing,c=m.scaleFactor,u=1-o*o/(n*n),h=(n-o)/(n+o),p=h*h,d=h*h*h,y=Math.cos(e),w=Math.sin(e),b=n*c/Math.sqrt(1-u*w*w),v=n*c*(1-u)/Math.pow(1-u*w*w,1.5),_=b/v-1,N=o*c*((1+h+5/4*p+5/4*d)*(e-i)-(3*h+3*h*h+21/8*d)*Math.sin(e-i)*Math.cos(e+i)+(15/8*p+15/8*d)*Math.sin(2*(e-i))*Math.cos(2*(e+i))-35/24*d*Math.sin(3*(e-i))*Math.cos(3*(e+i))),S=y*y*y,E=S*y*y,O=Math.tan(e)*Math.tan(e),M=O*O,T=r-a,x=T*T,G=x*T,$=G*T,j=$*T;let P=N+l+b/2*w*y*x+b/24*w*S*(5-O+9*_)*$+b/720*w*E*(61-58*O+M)*(j*T),F=s+b*y*T+b/6*S*(b/v-O)*G+b/120*E*(5-18*O+M+14*_-58*O*_)*j;P=Number(P.toFixed(3)),F=Number(F.toFixed(3));try{return new g(F,P)}catch(e){throw new Error(`${e.message} from (${t.lat.toFixed(6)},${t.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(t){const e=super.convertDatum(t);return new w(e.lat,e.lon,e.height,e.datum)}}function b(t){var e=t.ID,r=t.NAME1,n=t.POPULATED_PLACE,o=t.COUNTY_UNITARY,i=t.REGION,a=t.GEOMETRY_X,s=t.GEOMETRY_Y;return{id:e||"",place:"".concat(r).concat(n?", "+n:"").concat(o?", "+o:"",", ").concat(i),county:o||"",coordinates:[a,s]}}function v(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return _(c,"_invoke",function(r,n,o){var i,s,l,c=0,u=o||[],h=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,l=t,p.n=r,a}};function d(r,n){for(s=r,l=n,e=0;!h&&c&&!o&&e<u.length;e++){var o,i=u[e],d=p.p,f=i[2];r>3?(o=f===n)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<f&&(o=r<3||i[0]>n||n>f)&&(i[4]=r,i[5]=n,p.n=f,s=0))}if(o||r>1)return a;throw h=!0,n}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&d(u,f),s=u,l=f;(e=s<2?t:l)||!h;){i||(s?s<3?(s>1&&(p.n=-1),d(s,l)):p.n=l:p.v=l);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(h=p.n<0)?l:r.call(n,p))!==a)break}catch(e){i=t,s=1,l=e}finally{c=1}}return{value:e,done:h}}}(r,o,i),!0),c}var a={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][n]?e(e([][n]())):(_(e={},n,function(){return this}),e),h=c.prototype=s.prototype=Object.create(u);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,_(t,o,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=c,_(h,"constructor",c),_(c,"constructor",l),l.displayName="GeneratorFunction",_(c,o,"GeneratorFunction"),_(h),_(h,o,"Generator"),_(h,n,function(){return this}),_(h,"toString",function(){return"[object Generator]"}),(v=function(){return{w:i,m:p}})()}function _(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}_=function(t,e,r,n){function i(e,r){_(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))},_(t,e,r,n)}function N(t,e,r,n,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,o)}var S=function(){var t,e=(t=v().m(function t(){var e,r,n,o,i,a,s,l,c,u,h,p,d,f,y=arguments;return v().w(function(t){for(;;)switch(t.p=t.n){case 0:if(e=y.length>0&&void 0!==y[0]?y[0]:"https://api.os.uk/search/names/v1/nearest?point={easting},{northing}&radius=1000&fq=local_type:Airfield%20local_type:Airport%20local_type:Bus_Station%20local_type:Chemical_Works%20local_type:City%20local_type:Coach_Station%20local_type:Electricity_Distribution%20local_type:Electricity_Production%20local_type:Further_Education%20local_type:Gas_Distribution_or_Storage%20local_type:Hamlet%20local_type:Harbour%20local_type:Helicopter_Station%20local_type:Heliport%20local_type:Higher_or_University_Education%20local_type:Hill_Or_Mountain%20local_type:Hospice%20local_type:Hospital%20local_type:Medical_Care_Accommodation%20local_type:Named_Road%20local_type:Non_State_Primary_Education%20local_type:Non_State_Secondary_Education%20local_type:Other_Settlement%20local_type:Passenger_Ferry_Terminal%20local_type:Port_Consisting_of_Docks_and_Nautical_Berthing%20local_type:Postcode%20local_type:Primary_Education%20local_type:Railway_Station%20local_type:Road_User_Services%20local_type:Secondary_Education%20local_type:Section_Of_Named_Road%20local_type:Section_Of_Numbered_Road%20local_type:Special_Needs_Education%20local_type:Suburban_Area%20local_type:Town%20local_type:Urban_Greenspace%20local_type:Vehicular_Ferry_Terminal%20local_type:Vehicular_Rail_Terminal%20local_type:Village%20local_type:Waterfall%20",r=y.length>1?y[1]:void 0,i=o=y.length>4?y[4]:void 0,"EPSG:4326"!==(n=y.length>2?y[2]:void 0)){t.n=3;break}t.p=1,i=[(i=new w(o[1],o[0]).toOsGrid()).easting,i.northing].map(function(t){return Math.round(t)}),t.n=3;break;case 2:return t.p=2,d=t.v,console.log(d),t.a(2,null);case 3:if(e=e.replace("{easting}",Math.round(i[0])).replace("{northing}",Math.round(i[1])),a=new Request(e,{method:"GET"}),!r){t.n=7;break}return t.p=4,t.n=5,r(a);case 5:a=t.v,t.n=7;break;case 6:return t.p=6,f=t.v,console.log("Error transforming request:",f),t.a(2,null);case 7:return t.n=8,fetch(a);case 8:return s=t.v,t.n=9,s.json();case 9:return l=t.v,c=b(l.results[0].GAZETTEER_ENTRY),"EPSG:4326"===n&&(u=new g(c.coordinates[0],c.coordinates[1]),h=u.toLatLon(),c.coordinates=[h.lat,h.lon]),p="Approximate centre ".concat(null==c?void 0:c.place),t.a(2,l.results?p:null)}},t,null,[[4,6],[1,2]])}),function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){N(i,n,o,a,s,"next",t)}function s(t){N(i,n,o,a,s,"throw",t)}a(void 0)})});return function(){return e.apply(this,arguments)}}()}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};function o(t){return o="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},o(t)}function i(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function s(r,n,o,i){var s=n&&n.prototype instanceof c?n:c,u=Object.create(s.prototype);return a(u,"_invoke",function(r,n,o){var i,a,s,c=0,u=o||[],h=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,a=0,s=t,p.n=r,l}};function d(r,n){for(a=r,s=n,e=0;!h&&c&&!o&&e<u.length;e++){var o,i=u[e],d=p.p,f=i[2];r>3?(o=f===n)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(a=0,p.v=n,p.n=i[1]):d<f&&(o=r<3||i[0]>n||n>f)&&(i[4]=r,i[5]=n,p.n=f,a=0))}if(o||r>1)return l;throw h=!0,n}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&d(u,f),a=u,s=f;(e=a<2?t:s)||!h;){i||(a?a<3?(a>1&&(p.n=-1),d(a,s)):p.n=s:p.v=s);try{if(c=2,i){if(a||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=i.return)&&e.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((e=(h=p.n<0)?s:r.call(n,p))!==l)break}catch(e){i=t,a=1,s=e}finally{c=1}}return{value:e,done:h}}}(r,o,i),!0),u}var l={};function c(){}function u(){}function h(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(a(e={},n,function(){return this}),e),d=h.prototype=c.prototype=Object.create(p);function f(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return u.prototype=h,a(d,"constructor",h),a(h,"constructor",u),u.displayName="GeneratorFunction",a(h,o,"GeneratorFunction"),a(d),a(d,o,"Generator"),a(d,n,function(){return this}),a(d,"toString",function(){return"[object Generator]"}),(i=function(){return{w:s,m:f}})()}function a(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}a=function(t,e,r,n){function i(e,r){a(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))},a(t,e,r,n)}function s(t,e,r,n,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).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 c(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){u(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 u(t,e,r){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(){var t,e;return c(c({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{load:(t=i().m(function t(){var e;return i().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Promise.resolve().then(r.bind(r,"./providers/beta/open-names/src/reverseGeocode.js"));case 1:return e=t.v,t.a(2,e.reverseGeocode)}},t)}),e=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){s(i,n,o,a,l,"next",t)}function l(t){s(i,n,o,a,l,"throw",t)}a(void 0)})},function(){return e.apply(this,arguments)})})}r.d(n,{A:()=>h});const p=n.A;export{p as default};