@defra/interactive-map 0.0.21-alpha → 0.0.22-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.
- package/dist/esm/im-core.js +1 -1
- package/dist/esm/im-shell.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/umd/im-core.js +1 -1
- package/dist/umd/index.js +1 -1
- package/docs/api.md +41 -2
- package/docs/plugins/datasets.md +39 -1
- package/package.json +3 -5
- package/plugins/beta/datasets/dist/umd/maplibre/im-datasets-maplibre-adapter.js +2 -0
- package/plugins/beta/datasets/dist/umd/maplibre/im-datasets-plugin.js +2 -0
- package/plugins/beta/datasets/dist/umd/maplibre/index.js +2 -0
- package/plugins/beta/datasets/src/adapters/maplibre/index.js +1 -1
- package/plugins/beta/datasets/src/index.maplibre.umd.js +23 -0
- package/providers/maplibre/dist/esm/index.js +1 -1
- package/providers/maplibre/dist/umd/index.js +1 -1
- package/providers/maplibre/src/index.js +7 -1
- package/providers/maplibre/src/index.test.js +18 -0
- package/rollup.esm.mjs +1 -1
- package/src/App/components/Viewport/MapController.jsx +1 -1
- package/src/App/hooks/useMapURLSync.js +3 -3
- package/src/App/hooks/useMapURLSync.test.js +20 -3
- package/src/InteractiveMap/InteractiveMap.js +1 -1
- package/src/InteractiveMap/InteractiveMap.test.js +4 -4
- package/src/InteractiveMap/behaviourController.js +1 -2
- package/src/InteractiveMap/buttonManager.js +1 -3
- package/src/InteractiveMap/buttonManager.test.js +16 -8
- package/src/InteractiveMap/domStateManager.js +2 -3
- package/src/InteractiveMap/historyManager.js +4 -3
- package/src/config/defaults.js +2 -1
- package/src/config/mergeConfig.js +8 -2
- package/src/config/mergeConfig.test.js +19 -0
- package/src/types.js +22 -2
- package/src/utils/mapStateSync.js +2 -2
- package/src/utils/mapStateSync.test.js +18 -0
- package/webpack.dev.mjs +4 -0
- package/webpack.umd.mjs +9 -6
- package/plugins/beta/datasets/adapters/maplibre/dist/umd/im-datasets-ml-adapter.js +0 -2
- package/plugins/beta/datasets/adapters/maplibre/dist/umd/index.js +0 -1
- package/plugins/beta/datasets/dist/umd/im-datasets-plugin.js +0 -2
- package/plugins/beta/datasets/dist/umd/index.js +0 -2
- /package/plugins/beta/datasets/{adapters/maplibre/dist → dist/adapters/maplibre}/esm/im-datasets-ml-adapter.js +0 -0
- /package/plugins/beta/datasets/{adapters/maplibre/dist → dist/adapters/maplibre}/esm/index.js +0 -0
- /package/plugins/beta/datasets/{adapters/maplibre/dist/umd/im-datasets-ml-adapter.js.LICENSE.txt → dist/umd/maplibre/im-datasets-maplibre-adapter.js.LICENSE.txt} +0 -0
- /package/plugins/beta/datasets/dist/umd/{im-datasets-plugin.js.LICENSE.txt → maplibre/im-datasets-plugin.js.LICENSE.txt} +0 -0
- /package/plugins/beta/datasets/dist/umd/{index.js.LICENSE.txt → maplibre/index.js.LICENSE.txt} +0 -0
package/dist/umd/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.InteractiveMap=t())}(this,()=>(()=>{"use strict";var e,t,n,r,o={698(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o},869(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),v=Symbol.iterator,h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,m={};function b(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}function g(){}function _(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}b.prototype.isReactComponent={},b.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},b.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=b.prototype;var w=_.prototype=new g;w.constructor=_,y(w,b.prototype),w.isPureReactComponent=!0;var P=Array.isArray;function E(){}var A={H:null,A:null,T:null,S:null},S=Object.prototype.hasOwnProperty;function O(e,t,r){var o=r.ref;return{$$typeof:n,type:e,key:t,ref:void 0!==o?o:null,props:r}}function k(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var j=/\/+/g;function T(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function x(e,t,o,i,a){var u=typeof e;"undefined"!==u&&"boolean"!==u||(e=null);var c,s,l=!1;if(null===e)l=!0;else switch(u){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0;break;case p:return x((l=e._init)(e._payload),t,o,i,a)}}if(l)return a=a(e),l=""===i?"."+T(e,0):i,P(a)?(o="",null!=l&&(o=l.replace(j,"$&/")+"/"),x(a,t,o,"",function(e){return e})):null!=a&&(k(a)&&(c=a,s=o+(null==a.key||e&&e.key===a.key?"":(""+a.key).replace(j,"$&/")+"/")+l,a=O(c.type,s,c.props)),t.push(a)),1;l=0;var f,d=""===i?".":i+":";if(P(e))for(var h=0;h<e.length;h++)l+=x(i=e[h],t,o,u=d+T(i,h),a);else if("function"==typeof(h=null===(f=e)||"object"!=typeof f?null:"function"==typeof(f=v&&f[v]||f["@@iterator"])?f:null))for(e=h.call(e),h=0;!(i=e.next()).done;)l+=x(i=i.value,t,o,u=d+T(i,h++),a);else if("object"===u){if("function"==typeof e.then)return x(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(E,E):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,o,i,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function C(e,t,n){if(null==e)return e;var r=[],o=0;return x(e,r,"","",function(e){return t.call(n,e,o++)}),r}function D(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var M="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},R={map:C,forEach:function(e,t,n){C(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return C(e,function(){t++}),t},toArray:function(e){return C(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=d,t.Children=R,t.Component=b,t.Fragment=o,t.Profiler=a,t.PureComponent=_,t.StrictMode=i,t.Suspense=l,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return A.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=y({},e.props),o=e.key;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)!S.call(t,i)||"key"===i||"__self"===i||"__source"===i||"ref"===i&&void 0===t.ref||(r[i]=t[i]);var i=arguments.length-2;if(1===i)r.children=n;else if(1<i){for(var a=Array(i),u=0;u<i;u++)a[u]=arguments[u+2];r.children=a}return O(e.type,o,r)},t.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:u,_context:e},e},t.createElement=function(e,t,n){var r,o={},i=null;if(null!=t)for(r in void 0!==t.key&&(i=""+t.key),t)S.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===o[r]&&(o[r]=a[r]);return O(e,i,o)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=k,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:D}},t.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=A.T,n={};A.T=n;try{var r=e(),o=A.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(E,M)}catch(e){M(e)}finally{null!==t&&null!==n.types&&(t.types=n.types),A.T=t}},t.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},t.use=function(e){return A.H.use(e)},t.useActionState=function(e,t,n){return A.H.useActionState(e,t,n)},t.useCallback=function(e,t){return A.H.useCallback(e,t)},t.useContext=function(e){return A.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return A.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return A.H.useEffect(e,t)},t.useEffectEvent=function(e){return A.H.useEffectEvent(e)},t.useId=function(){return A.H.useId()},t.useImperativeHandle=function(e,t,n){return A.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return A.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return A.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return A.H.useMemo(e,t)},t.useOptimistic=function(e,t){return A.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return A.H.useReducer(e,t,n)},t.useRef=function(e){return A.H.useRef(e)},t.useState=function(e){return A.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return A.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return A.H.useTransition()},t.version="19.2.4"},540(e,t,n){e.exports=n(869)},848(e,t,n){e.exports=n(698)},205(e,t,n){n.d(t,{N:()=>u,i:()=>c});var r=n(637),o=n(901),i=n(201),a=n(43);function u(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isFullscreen,n=e.config,u=e.rootEl,c=n.pageTitle,s=n.behaviour,l=n.containerHeight,f=null!=t?t:function(e){var t=e.id,n=e.behaviour,o=e.manageHistoryState;return"mapOnly"===n||("buttonFirst"===n?!1===o||(0,r.q)(a.A.mapViewParamKey)===t:(0,i.w)(e)&&(0,r.q)(a.A.mapViewParamKey)===t)}(n);["mapOnly","buttonFirst","hybrid"].includes(s)&&((0,o.U)({containerEl:u,isFullscreen:f}),document.documentElement.classList.toggle("im-is-fullscreen",f),u.classList.toggle("im-is-fullscreen",f)),["buttonFirst","hybrid"].includes(s)&&function(e){var t=e.pageTitle,n=e.isFullscreen,r=document.title.split(": "),o=r[r.length-1];document.title=n?"".concat(t,": ").concat(o):o}({pageTitle:c,isFullscreen:f});var p=f||"buttonFirst"!==s&&!(0,i.w)(n)?l:"auto";u.style.height=f?"100%":p}function c(){document.body.classList.remove("im-is-loading")}},43(e,t,n){n.d(t,{A:()=>r});const r={appColorScheme:"light",autoColorScheme:!1,backgroundColor:"var(--background-color)",behaviour:"buttonFirst",buttonClass:"im-c-open-map-button",buttonText:"Map view",containerHeight:"600px",deviceNotSupportedText:"Your device is not supported. A map is available with a more up-to-date browser or device.",enableFullscreen:!1,enableZoomControls:!0,genericErrorText:"There was a problem loading the map. Please try again later.",hasExitButton:!1,hybridWidth:null,keyboardHintText:'<span class="im-u-visually-hidden">Press </span><kbd>Alt</kbd> + <kbd>K</kbd> <span class="im-u-visually-hidden">to view </span>keyboard shortcuts',mapLabel:"Interactive map",mapProvider:null,mapSize:"small",manageHistoryState:!0,mapViewParamKey:"mv",maxMobileWidth:640,minDesktopWidth:835,nudgePanDelta:5,nudgeZoomDelta:.1,panDelta:100,pageTitle:"Map view",preserveStateOnClose:!1,readMapText:!1,reverseGeocodeProvider:null,zoomDelta:1}},12(e,t,n){n.d(t,{q:()=>r});var r={APP_ADD_MARKER:"app:addmarker",APP_REMOVE_MARKER:"app:removemarker",APP_SET_MODE:"app:setmode",APP_REVERT_MODE:"app:revertmode",APP_ADD_BUTTON:"app:addbutton",APP_TOGGLE_BUTTON_STATE:"app:togglebuttonstate",APP_ADD_PANEL:"app:addpanel",APP_REMOVE_PANEL:"app:removepanel",APP_SHOW_PANEL:"app:showpanel",APP_HIDE_PANEL:"app:hidepanel",APP_ADD_CONTROL:"app:addcontrol",APP_READY:"app:ready",APP_OPENED:"app:opened",APP_CLOSED:"app:closed",APP_PANEL_OPENED:"app:panelopened",APP_PANEL_CLOSED:"app:panelclosed",MAP_SET_STYLE:"map:setstyle",MAP_SET_SIZE:"map:setsize",MAP_SET_PIXEL_RATIO:"map:setpixelratio",MAP_FIT_TO_BOUNDS:"map:fittobounds",MAP_SET_VIEW:"map:setview",MAP_INIT_MAP_STYLES:"map:initmapstyles",MAP_STYLE_CHANGE:"map:stylechange",MAP_LOADED:"map:loaded",MAP_READY:"map:ready",MAP_SIZE_CHANGE:"map:sizechange",MAP_FIRST_IDLE:"map:firstidle",MAP_MOVE_START:"map:movestart",MAP_MOVE:"map:move",MAP_MOVE_END:"map:moveend",MAP_STATE_UPDATED:"map:stateupdated",MAP_DATA_CHANGE:"map:datachange",MAP_RENDER:"map:render",MAP_CLICK:"map:click",MAP_DESTROY:"map:destroy"}},233(e,t,n){function r(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function u(n,r,i,a){var u=r&&r.prototype instanceof s?r:s,l=Object.create(u.prototype);return o(l,"_invoke",function(n,r,o){var i,a,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,c}};function d(n,r){for(a=n,u=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,v=i[2];n>3?(o=v===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(a=0,p.v=r,p.n=i[1]):d<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,p.n=v,a=0))}if(o||n>1)return c;throw f=!0,r}return function(o,l,v){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,v),a=l,u=v;(t=a<2?e:u)||!f;){i||(a?a<3?(a>1&&(p.n=-1),d(a,u)):p.n=u:p.v=u);try{if(s=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==c)break}catch(t){i=e,a=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,i,a),!0),l}var c={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,o(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,o(d,"constructor",f),o(f,"constructor",l),l.displayName="GeneratorFunction",o(f,a,"GeneratorFunction"),o(d),o(d,a,"Generator"),o(d,i,function(){return this}),o(d,"toString",function(){return"[object Generator]"}),(r=function(){return{w:u,m:v}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,n,r){function a(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},o(e,t,n,r)}function i(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}n.d(t,{H:()=>u,R:()=>c});var a=null;function u(e,t){var n=e.url,o=e.transformRequest,u=e.load;a=function(){var e,a=(e=r().m(function e(i,a){var c;return r().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u();case 1:return c=e.v,e.a(2,c(n,o,t,i,a))}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function u(e){i(a,r,o,u,c,"next",e)}function c(e){i(a,r,o,u,c,"throw",e)}u(void 0)})});return function(e,t){return a.apply(this,arguments)}}()}function c(e,t){if(!a)throw new Error("ReverseGeocode not initialised");return a(e,t)}},902(e,t,n){n.d(t,{C1:()=>a,Ey:()=>c,ip:()=>u});var r=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",o=new Set;function i(e){r!==e&&(r=e,o.forEach(function(t){t(e)}))}function a(){var e=window.matchMedia("(pointer: coarse)"),t=function(e){i(e.matches?"touch":"mouse")};e.addEventListener("change",t);var n=function(e){var t,n="pen"===(t=e.pointerType)||"touch"===t?"touch":"mouse"===t?"mouse":"unknown";setTimeout(function(){return i(n)},150)},r=function(e){"Tab"===e.key&&i("keyboard")};return window.addEventListener("pointerdown",n,{passive:!0}),window.addEventListener("keydown",r,{passive:!0}),function(){e.removeEventListener("change",t),window.removeEventListener("pointerdown",n),window.removeEventListener("keydown",r)}}function u(){return"unknown"===r?(r="mouse","mouse"):r}function c(e){return o.add(e),function(){o.delete(e)}}},201(e,t,n){n.d(t,{g:()=>o,w:()=>r});var r=function(e){var t=e.behaviour,n=e.hybridWidth,r=e.maxMobileWidth;if("hybrid"!==t)return!1;var o=null!=n?n:r;return window.matchMedia("(max-width: ".concat(o,"px)")).matches},o=function(e){var t=e.behaviour;return["mapOnly","buttonFirst"].includes(t)||r(e)}},637(e,t,n){n.d(t,{q:()=>r});var r=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=window.location)||void 0===t?void 0:t.search;return new URLSearchParams(n).get(e)}},901(e,t,n){function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){c=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{U:()=>a});var i=function(e,t,n,r){return e!==t&&!(null!=n&&n.contains(e))&&e.matches(":not([aria-hidden]):not([data-fm-inert])")&&r.contains(e)};function a(e){var t,n=e.containerEl,o=e.isFullscreen,a=e.boundaryEl,u=void 0===a?document.body:a,c=Array.from(u.querySelectorAll("[data-fm-inert]"));if(n&&(c=c.filter(function(e){return!n.contains(e)})),c.forEach(function(e){e.removeAttribute("aria-hidden"),delete e.dataset.fmInert}),o){null===(t=document.activeElement)||void 0===t||t.blur();for(var s=n;null!==(l=s)&&void 0!==l&&l.parentNode&&s!==u&&s!==document.body;){var l,f,p=s.parentNode,d=r(p.children);try{for(d.s();!(f=d.n()).done;){var v=f.value;i(v,s,n,u)&&(v.setAttribute("aria-hidden","true"),v.dataset.fmInert="")}}catch(e){d.e(e)}finally{d.f()}s=p}}}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return o[e](n,n.exports,a),n.exports}a.m=o,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);a.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&r&&n;("object"==typeof u||"function"==typeof u)&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,n)=>(a.f[n](e,t),t),[])),a.u=e=>"im-core.js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="defra.InteractiveMap:",a.l=(e,t,o,i)=>{if(n[e])n[e].push(t);else{var u,c;if(void 0!==o)for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var f=s[l];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==r+o){u=f;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",a.nc&&u.setAttribute("nonce",a.nc),u.setAttribute("data-webpack",r+o),u.src=e),n[e]=[t];var p=(t,r)=>{u.onerror=u.onload=null,clearTimeout(d);var o=n[e];if(delete n[e],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=p.bind(null,u.onerror),u.onload=p.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={57:0};a.f.j=(t,n)=>{var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,o)=>r=e[t]=[n,o]);n.push(r[2]=o);var i=a.p+a.u(t),u=new Error;a.l(i,n=>{if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;u.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,r[1](u)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,u,c]=n,s=0;if(i.some(t=>0!==e[t])){for(r in u)a.o(u,r)&&(a.m[r]=u[r]);c&&c(a)}for(t&&t(n);s<i.length;s++)o=i[s],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var u={};a.d(u,{default:()=>Q});var c=a(540),s=a(848),l=a.t(s,2),f=a(637),p=a(201),d=a(43);function v(){var e=(0,f.q)(d.A.mapViewParamKey);h.forEach(function(t){return function(e,t){var n;if(!1!==e.config.manageHistoryState){var r=e.id===t,o="hybrid"===e.config.behaviour&&!(0,p.w)(e.config),i=null===(n=e.rootEl)||void 0===n?void 0:n.children.length;!r||i&&!e._isHidden?r||!i||o||function(e){var t,n;e.config.preserveStateOnClose?null===(t=e.hideApp)||void 0===t||t.call(e):null===(n=e.removeApp)||void 0===n||n.call(e)}(e):function(e){var t,n;e._isHidden?null===(t=e.showApp)||void 0===t||t.call(e):null===(n=e.loadApp)||void 0===n||n.call(e)}(e)}}(t,e)})}var h=new Map,y=!1;const m=function(e){y||(globalThis.addEventListener("popstate",v),y=!0),h.set(e.id,e)},b=function(e){h.delete(e.id)};function g(e){return g="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},g(e)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w(e,t,n){return(t=function(e){var t=function(e){if("object"!=g(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==g(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){try{return JSON.parse(e)}catch(e){return console.log(e),null}}function E(e,t){e.innerHTML='<div class="im-c-error">'.concat(t,"</div>")}var A=a(205);function S(e){var t=e.id,n=e.behaviour,r=(0,f.q)(d.A.mapViewParamKey)===t;return["mapOnly","inline"].includes(n)||"hybrid"===n&&!(0,p.w)(e)||r}function O(e){return O="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},O(e)}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach(function(t){T(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T(e,t,n){return(t=function(e){var t=function(e){if("object"!=O(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==O(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=a(902),C=a(233),D=a(12);function M(e){return M="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},M(e)}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function B(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L(r.key),r)}}function L(e){var t=function(e){if("object"!=M(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==M(t)?t:t+""}var N=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={},this._queued={}},t=[{key:"on",value:function(e,t){if(this.events[e]||(this.events[e]=[]),this.events[e].push(t),void 0!==this._queued[e]){try{t.apply(void 0,function(e){return function(e){if(Array.isArray(e))return R(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):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.")}()}(this._queued[e]))}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}delete this._queued[e]}return this}},{key:"off",value:function(e,t){return this.events[e]?(this.events[e]=t?this.events[e].filter(function(e){return e!==t}):[],this):this}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]?(this.events[e].forEach(function(t){try{t.apply(void 0,n)}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}}),this):this}},{key:"emitWhenReady",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]&&0!==this.events[e].length?this.emit.apply(this,[e].concat(n)):(this._queued[e]=n,this)}},{key:"destroy",value:function(){this.events={},this._queued={}}}],t&&B(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();new N;var H=a(901);if("undefined"!=typeof crypto&&!crypto.randomUUID){var I=0;crypto.randomUUID=function(){return I=Math.max(Date.now(),I+1),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e,t){var n=t<12?Number.parseInt(I.toString(16).padStart(12,"0")[t],16):16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)})}}var q="undefined"!=typeof AbortController&&!Object.getPrototypeOf((new AbortController).signal).throwIfAborted;if(q&&(Object.getPrototypeOf((new AbortController).signal).throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");throw e.name="AbortError",e}}),q&&"undefined"!=typeof URL&&URL.createObjectURL){var F=URL.createObjectURL.bind(URL);URL.createObjectURL=function(e){return e instanceof Blob&&"text/javascript"===e.type&&(e=new Blob(['if(typeof AbortController!=="undefined"){var _p=Object.getPrototypeOf(new AbortController().signal);if(!_p.throwIfAborted){_p.throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");e.name="AbortError";throw e}}}}\n',e],{type:"text/javascript"})),F(e)}}function U(e){return U="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},U(e)}function $(){var e,t,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,s=Object.create(c.prototype);return V(s,"_invoke",function(n,r,o){var i,u,c,s=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,u=0,c=e,p.n=n,a}};function d(n,r){for(u=n,c=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,v=i[2];n>3?(o=v===r)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(u=0,p.v=r,p.n=i[1]):d<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,p.n=v,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,v){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,v),u=l,c=v;(t=u<2?e:c)||!f;){i||(u?u<3?(u>1&&(p.n=-1),d(u,c)):p.n=c:p.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,u=1,c=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(V(t={},r,function(){return this}),t),f=s.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,V(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=s,V(f,"constructor",s),V(s,"constructor",c),c.displayName="GeneratorFunction",V(s,o,"GeneratorFunction"),V(f),V(f,o,"Generator"),V(f,r,function(){return this}),V(f,"toString",function(){return"[object Generator]"}),($=function(){return{w:i,m:p}})()}function V(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}V=function(e,t,n,r){function i(t,n){V(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},V(e,t,n,r)}function G(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach(function(t){Y(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function K(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Z(r.key),r)}}function Y(e,t,n){return(t=Z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){var t=function(e){if("object"!=U(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=U(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==U(t)?t:t+""}var J=function(){return e=function e(t){var n,r,o,i,a,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Y(this,"_openButton",null),Y(this,"_root",null),Y(this,"_breakpointDetector",null),Y(this,"_interfaceDetectorCleanup",null),Y(this,"_hybridBehaviourCleanup",null),Y(this,"_isHidden",!1),this.id=t,this.rootEl=document.getElementById(t),!this.rootEl)throw new Error('Element with id "'.concat(t,'" not found'));this.eventBus=new N,this.config=this._buildConfig(u),n=this.rootEl,o=(r=this.config).mapProvider,i=r.deviceNotSupportedText,a=null==o?void 0:o.checkDeviceCapabilities(),(o?null!=a&&a.isSupported||(E(n,i),(0,A.i)(),console.log(null==a?void 0:a.error),0):(console.log("No map provider"),0))&&(["buttonFirst","hybrid"].includes(this.config.behaviour)&&m(this),this._breakpointDetector=function(e){var t,n=e.maxMobileWidth,r=e.minDesktopWidth,o=e.containerEl,i="unknown",a=new Set,u=function(e){e!==i&&(i=e,requestAnimationFrame(function(){i===e&&a.forEach(function(t){return t(e)})}))};if(o){var c=function(e,t,n){e.style.containerType="inline-size";var r=e.getBoundingClientRect().width,o=t(r);e.dataset.breakpoint=o;var i=new window.ResizeObserver(function(r){var o,i,a=(null===(o=r[0])||void 0===o||null===(o=o.borderBoxSize)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.inlineSize)||(null===(i=r[0])||void 0===i?void 0:i.contentRect.width),u=t(a);e.dataset.breakpoint=u,n(u)});return i.observe(e),{initialType:o,cleanup:function(){i.disconnect(),e.style.containerType="",delete e.dataset.breakpoint}}}(o,function(e){return function(e,t,n){return e<=t?"mobile":e>=n?"desktop":"tablet"}(e,n,r)},u);i=c.initialType,u(c.initialType),t=c.cleanup}else{var s=function(e,t,n){var r={mobile:window.matchMedia("(max-width: ".concat(e,"px)")),desktop:window.matchMedia("(min-width: ".concat(t,"px)"))},o=function(){var e="tablet";r.mobile.matches?e="mobile":r.desktop.matches&&(e="desktop"),n(e)};return r.mobile.addEventListener("change",o),r.desktop.addEventListener("change",o),o(),{cleanup:function(){r.mobile.removeEventListener("change",o),r.desktop.removeEventListener("change",o)}}}(n,r,u);t=s.cleanup}return{subscribe:function(e){return a.add(e),function(){return a.delete(e)}},getBreakpoint:function(){return i},destroy:function(){var e;null===(e=t)||void 0===e||e(),a.clear()}}}({maxMobileWidth:this.config.maxMobileWidth,minDesktopWidth:this.config.minDesktopWidth,containerEl:this.rootEl}),this._interfaceDetectorCleanup=(0,x.C1)(),this._initialize())},t=[{key:"_buildConfig",value:function(e){var t=function(e){for(var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){w(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},null==e?void 0:e.dataset),n={},r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];n[i]=P(t[i])}return n}(this.rootEl);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return j(j({},d.A),e)}(z(z({id:this.id,title:document.title},t),e))}},{key:"_initialize",value:function(){var e=this;["buttonFirst","hybrid"].includes(this.config.behaviour)&&(this._openButton=function(t,n){var r=t.id,o=t.buttonText,i=t.buttonClass,a='\n <a class="'.concat(i,"\" role=\"button\">\n <svg focusable='false' aria-hidden='true' width='16' height='20' viewBox='0 0 16 20' fillRule='evenodd'>\n <path d='M15 7.5c.009 3.778-4.229 9.665-7.5 12.5C4.229 17.165-.009 11.278 0 7.5a7.5 7.5 0 1 1 15 0z'/>\n <path d='M7.5 12.961a5.46 5.46 0 1 0 0-10.922 5.46 5.46 0 1 0 0 10.922z' fill='#fff'/>\n </svg>\n <span>").concat(o,"</span>\n <span class='im-u-visually-hidden'> (Visual only)</span>\n </a>\n ");n.insertAdjacentHTML("beforebegin",a);var u=n.previousElementSibling,c=new URL(window.location.href);return c.searchParams.set(d.A.mapViewParamKey,r),u.setAttribute("href",c.toString()),u.addEventListener("click",function(t){t.preventDefault(),function(t){e._handleButtonClick(t)}(t)}),u}(this.config,this.rootEl)),this._hybridBehaviourCleanup=function(e){var t=e.config,n=t.behaviour,r=t.hybridWidth,o=t.maxMobileWidth;if("buttonFirst"===n&&e._breakpointDetector.subscribe(function(){S(e.config)?e.loadApp():e.removeApp()}),"hybrid"===n){var i=null!=r?r:o,a=window.matchMedia("(max-width: ".concat(i,"px)")),u=function(){S(e.config)?e._isHidden?e.showApp():null==e._root?e.loadApp():(0,A.N)(e):e._root&&e.hideApp()};return a.addEventListener("change",u),function(){return a.removeEventListener("change",u)}}return null}(this),S(this.config)?this.loadApp():(0,A.i)()}},{key:"_handleButtonClick",value:function(e){this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this._isHidden?this.showApp():this.loadApp()}},{key:"_removeMapParamFromUrl",value:function(e,t){var n=new RegExp("[?&]".concat(t,"=[^&]*(&|$)"));return n.test(e)?e.replace(n,function(e,t){return"&"===t?"?":""}).replace(/\?$/,""):e}},{key:"_handleExitClick",value:function(){var e;if(this.config.preserveStateOnClose?this.hideApp():this.removeApp(),this.config.manageHistoryState)if(null!==(e=history.state)&&void 0!==e&&e.isBack)history.back();else{var t=this.config.mapViewParamKey,n=this._removeMapParamFromUrl(location.href,t);history.replaceState(history.state,"",n)}}},{key:"loadApp",value:(n=$().m(function e(){var t,n,r,o,i,u,c,s,l,f=this;return $().w(function(e){for(;;)switch(e.p=e.n){case 0:return this._openButton&&(this._openButton.style.display="none"),e.p=1,e.n=2,a.e(935).then(a.bind(a,724));case 2:return t=e.v,n=t.initialiseApp,e.n=3,this.config.mapProvider.load();case 3:return r=e.v,o=r.MapProvider,i=r.mapFramework,u=r.mapProviderConfig,this.config.reverseGeocodeProvider&&(0,C.H)(this.config.reverseGeocodeProvider,u.crs),e.n=4,n(this.rootEl,z(z({id:this.id,initialBreakpoint:this._breakpointDetector.getBreakpoint(),initialInterfaceType:(0,x.ip)()},this.config),{},{MapProvider:o,mapProviderConfig:u,mapFramework:i,eventBus:this.eventBus,breakpointDetector:this._breakpointDetector,handleExitClick:this._handleExitClick.bind(this)}));case 4:c=e.v,this._root=c._root,delete c._root,s=new Set(["on","off","emit"]),Object.keys(c).forEach(function(e){s.has(e)||(f[e]=c[e])}),(0,A.N)(this),this.eventBus.emit(D.q.APP_OPENED,{statePreserved:!1}),e.n=6;break;case 5:throw e.p=5,l=e.v,E(this.rootEl,this.config.genericErrorText),console.error(l),l;case 6:return e.a(2)}},e,this,[[1,5]])}),r=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){G(i,r,o,a,u,"next",e)}function u(e){G(i,r,o,a,u,"throw",e)}a(void 0)})},function(){return r.apply(this,arguments)})},{key:"removeApp",value:function(){this._root&&"function"==typeof this.unmount&&(this.unmount(),this._root=null),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),(0,A.N)(this,{isFullscreen:!1}),this.eventBus.emit(D.q.APP_CLOSED,{statePreserved:!1}),this.eventBus.emit(D.q.MAP_DESTROY,{mapId:this.id})}},{key:"hideApp",value:function(){this._isHidden=!0,this.rootEl.style.display="none",(0,H.U)({containerEl:this.rootEl,isFullscreen:!1}),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),document.documentElement.classList.remove("im-is-fullscreen"),this.rootEl.classList.remove("im-is-fullscreen");var e=document.title.split(": ");e.length>1&&(document.title=e.at(-1)),this.eventBus.emit(D.q.APP_CLOSED,{statePreserved:!0})}},{key:"showApp",value:function(){this._isHidden=!1,this.rootEl.style.display="",this._openButton&&(this._openButton.style.display="none"),(0,A.N)(this),this.eventBus.emit(D.q.APP_OPENED,{statePreserved:!0})}},{key:"destroy",value:function(){var e,t,n;this.removeApp(),null===(e=this._breakpointDetector)||void 0===e||e.destroy(),null===(t=this._interfaceDetectorCleanup)||void 0===t||t.call(this),null===(n=this._hybridBehaviourCleanup)||void 0===n||n.call(this),b(this),this.eventBus.destroy()}},{key:"on",value:function(){var e;(e=this.eventBus).on.apply(e,arguments)}},{key:"off",value:function(){var e;(e=this.eventBus).off.apply(e,arguments)}},{key:"emit",value:function(){var e;(e=this.eventBus).emit.apply(e,arguments)}},{key:"addMarker",value:function(e,t,n){this.eventBus.emit(D.q.APP_ADD_MARKER,{id:e,coords:t,options:n})}},{key:"removeMarker",value:function(e){this.eventBus.emit(D.q.APP_REMOVE_MARKER,e)}},{key:"setMode",value:function(e){this.eventBus.emit(D.q.APP_SET_MODE,e)}},{key:"addButton",value:function(e,t){this.eventBus.emit(D.q.APP_ADD_BUTTON,{id:e,config:t})}},{key:"toggleButtonState",value:function(e,t,n){this.eventBus.emit(D.q.APP_TOGGLE_BUTTON_STATE,{id:e,prop:t,value:n})}},{key:"addPanel",value:function(e,t){this.eventBus.emit(D.q.APP_ADD_PANEL,{id:e,config:t})}},{key:"removePanel",value:function(e){this.eventBus.emit(D.q.APP_REMOVE_PANEL,e)}},{key:"showPanel",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).focus,n=void 0===t||t;this.eventBus.emit(D.q.APP_SHOW_PANEL,{id:e,focus:n})}},{key:"hidePanel",value:function(e){this.eventBus.emit(D.q.APP_HIDE_PANEL,e)}},{key:"addControl",value:function(e,t){this.eventBus.emit(D.q.APP_ADD_CONTROL,{id:e,config:t})}},{key:"fitToBounds",value:function(e){this.eventBus.emitWhenReady(D.q.MAP_FIT_TO_BOUNDS,e)}},{key:"setView",value:function(e){this.eventBus.emitWhenReady(D.q.MAP_SET_VIEW,e)}},{key:"open",value:function(){this._isHidden?this.showApp():this._root||this.loadApp()}},{key:"close",value:function(){this._handleExitClick()}}],t&&K(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r}(),X="undefined"==typeof window?globalThis:window;X.defra=X.defra||{},X.preactCompat=c,X.preactJsxRuntime=l,X.preactHooks={useState:c.useState},X.defra.InteractiveMap=J,X.preactCompat.default||(X.preactCompat.default=X.preactCompat),X.preactCompat.createRoot||(X.preactCompat.createRoot=function(e){return{render:function(t){X.preactCompat.render(t,e)},unmount:function(){X.preactCompat.render(null,e)}}});const Q=J;return u.default})());
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.InteractiveMap=t())}(this,()=>(()=>{"use strict";var e,t,n,r,o={698(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o},869(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),v=Symbol.iterator,h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,m={};function b(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}function g(){}function _(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}b.prototype.isReactComponent={},b.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},b.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=b.prototype;var w=_.prototype=new g;w.constructor=_,y(w,b.prototype),w.isPureReactComponent=!0;var P=Array.isArray;function E(){}var O={H:null,A:null,T:null,S:null},S=Object.prototype.hasOwnProperty;function A(e,t,r){var o=r.ref;return{$$typeof:n,type:e,key:t,ref:void 0!==o?o:null,props:r}}function k(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var j=/\/+/g;function T(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function x(e,t,o,i,a){var u=typeof e;"undefined"!==u&&"boolean"!==u||(e=null);var c,s,l=!1;if(null===e)l=!0;else switch(u){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0;break;case p:return x((l=e._init)(e._payload),t,o,i,a)}}if(l)return a=a(e),l=""===i?"."+T(e,0):i,P(a)?(o="",null!=l&&(o=l.replace(j,"$&/")+"/"),x(a,t,o,"",function(e){return e})):null!=a&&(k(a)&&(c=a,s=o+(null==a.key||e&&e.key===a.key?"":(""+a.key).replace(j,"$&/")+"/")+l,a=A(c.type,s,c.props)),t.push(a)),1;l=0;var f,d=""===i?".":i+":";if(P(e))for(var h=0;h<e.length;h++)l+=x(i=e[h],t,o,u=d+T(i,h),a);else if("function"==typeof(h=null===(f=e)||"object"!=typeof f?null:"function"==typeof(f=v&&f[v]||f["@@iterator"])?f:null))for(e=h.call(e),h=0;!(i=e.next()).done;)l+=x(i=i.value,t,o,u=d+T(i,h++),a);else if("object"===u){if("function"==typeof e.then)return x(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(E,E):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,o,i,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function C(e,t,n){if(null==e)return e;var r=[],o=0;return x(e,r,"","",function(e){return t.call(n,e,o++)}),r}function D(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var M="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},R={map:C,forEach:function(e,t,n){C(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return C(e,function(){t++}),t},toArray:function(e){return C(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=d,t.Children=R,t.Component=b,t.Fragment=o,t.Profiler=a,t.PureComponent=_,t.StrictMode=i,t.Suspense=l,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return O.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=y({},e.props),o=e.key;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)!S.call(t,i)||"key"===i||"__self"===i||"__source"===i||"ref"===i&&void 0===t.ref||(r[i]=t[i]);var i=arguments.length-2;if(1===i)r.children=n;else if(1<i){for(var a=Array(i),u=0;u<i;u++)a[u]=arguments[u+2];r.children=a}return A(e.type,o,r)},t.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:u,_context:e},e},t.createElement=function(e,t,n){var r,o={},i=null;if(null!=t)for(r in void 0!==t.key&&(i=""+t.key),t)S.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===o[r]&&(o[r]=a[r]);return A(e,i,o)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=k,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:D}},t.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=O.T,n={};O.T=n;try{var r=e(),o=O.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(E,M)}catch(e){M(e)}finally{null!==t&&null!==n.types&&(t.types=n.types),O.T=t}},t.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},t.use=function(e){return O.H.use(e)},t.useActionState=function(e,t,n){return O.H.useActionState(e,t,n)},t.useCallback=function(e,t){return O.H.useCallback(e,t)},t.useContext=function(e){return O.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return O.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return O.H.useEffect(e,t)},t.useEffectEvent=function(e){return O.H.useEffectEvent(e)},t.useId=function(){return O.H.useId()},t.useImperativeHandle=function(e,t,n){return O.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return O.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return O.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return O.H.useMemo(e,t)},t.useOptimistic=function(e,t){return O.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return O.H.useReducer(e,t,n)},t.useRef=function(e){return O.H.useRef(e)},t.useState=function(e){return O.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return O.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return O.H.useTransition()},t.version="19.2.4"},540(e,t,n){e.exports=n(869)},848(e,t,n){e.exports=n(698)},205(e,t,n){n.d(t,{N:()=>a,i:()=>u});var r=n(637),o=n(901),i=n(201);function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isFullscreen,n=e.config,a=e.rootEl,u=n.pageTitle,c=n.behaviour,s=n.containerHeight,l=null!=t?t:function(e){var t=e.id,n=e.behaviour,o=e.manageHistoryState;return"mapOnly"===n||("buttonFirst"===n?!1===o||(0,r.q)(e.mapViewQueryParam)===t:(0,i.w)(e)&&(0,r.q)(e.mapViewQueryParam)===t)}(n);["mapOnly","buttonFirst","hybrid"].includes(c)&&((0,o.U)({containerEl:a,isFullscreen:l}),document.documentElement.classList.toggle("im-is-fullscreen",l),a.classList.toggle("im-is-fullscreen",l)),["buttonFirst","hybrid"].includes(c)&&function(e){var t=e.pageTitle,n=e.isFullscreen,r=document.title.split(": "),o=r[r.length-1];document.title=n?"".concat(t,": ").concat(o):o}({pageTitle:u,isFullscreen:l});var f=l||"buttonFirst"!==c&&!(0,i.w)(n)?s:"auto";a.style.height=l?"100%":f}function u(){document.body.classList.remove("im-is-loading")}},12(e,t,n){n.d(t,{q:()=>r});var r={APP_ADD_MARKER:"app:addmarker",APP_REMOVE_MARKER:"app:removemarker",APP_SET_MODE:"app:setmode",APP_REVERT_MODE:"app:revertmode",APP_ADD_BUTTON:"app:addbutton",APP_TOGGLE_BUTTON_STATE:"app:togglebuttonstate",APP_ADD_PANEL:"app:addpanel",APP_REMOVE_PANEL:"app:removepanel",APP_SHOW_PANEL:"app:showpanel",APP_HIDE_PANEL:"app:hidepanel",APP_ADD_CONTROL:"app:addcontrol",APP_READY:"app:ready",APP_OPENED:"app:opened",APP_CLOSED:"app:closed",APP_PANEL_OPENED:"app:panelopened",APP_PANEL_CLOSED:"app:panelclosed",MAP_SET_STYLE:"map:setstyle",MAP_SET_SIZE:"map:setsize",MAP_SET_PIXEL_RATIO:"map:setpixelratio",MAP_FIT_TO_BOUNDS:"map:fittobounds",MAP_SET_VIEW:"map:setview",MAP_INIT_MAP_STYLES:"map:initmapstyles",MAP_STYLE_CHANGE:"map:stylechange",MAP_LOADED:"map:loaded",MAP_READY:"map:ready",MAP_SIZE_CHANGE:"map:sizechange",MAP_FIRST_IDLE:"map:firstidle",MAP_MOVE_START:"map:movestart",MAP_MOVE:"map:move",MAP_MOVE_END:"map:moveend",MAP_STATE_UPDATED:"map:stateupdated",MAP_DATA_CHANGE:"map:datachange",MAP_RENDER:"map:render",MAP_CLICK:"map:click",MAP_DESTROY:"map:destroy"}},233(e,t,n){function r(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function u(n,r,i,a){var u=r&&r.prototype instanceof s?r:s,l=Object.create(u.prototype);return o(l,"_invoke",function(n,r,o){var i,a,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,c}};function d(n,r){for(a=n,u=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,v=i[2];n>3?(o=v===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(a=0,p.v=r,p.n=i[1]):d<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,p.n=v,a=0))}if(o||n>1)return c;throw f=!0,r}return function(o,l,v){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,v),a=l,u=v;(t=a<2?e:u)||!f;){i||(a?a<3?(a>1&&(p.n=-1),d(a,u)):p.n=u:p.v=u);try{if(s=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==c)break}catch(t){i=e,a=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,i,a),!0),l}var c={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,o(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,o(d,"constructor",f),o(f,"constructor",l),l.displayName="GeneratorFunction",o(f,a,"GeneratorFunction"),o(d),o(d,a,"Generator"),o(d,i,function(){return this}),o(d,"toString",function(){return"[object Generator]"}),(r=function(){return{w:u,m:v}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,n,r){function a(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},o(e,t,n,r)}function i(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}n.d(t,{H:()=>u,R:()=>c});var a=null;function u(e,t){var n=e.url,o=e.transformRequest,u=e.load;a=function(){var e,a=(e=r().m(function e(i,a){var c;return r().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u();case 1:return c=e.v,e.a(2,c(n,o,t,i,a))}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function u(e){i(a,r,o,u,c,"next",e)}function c(e){i(a,r,o,u,c,"throw",e)}u(void 0)})});return function(e,t){return a.apply(this,arguments)}}()}function c(e,t){if(!a)throw new Error("ReverseGeocode not initialised");return a(e,t)}},902(e,t,n){n.d(t,{C1:()=>a,Ey:()=>c,ip:()=>u});var r=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",o=new Set;function i(e){r!==e&&(r=e,o.forEach(function(t){t(e)}))}function a(){var e=window.matchMedia("(pointer: coarse)"),t=function(e){i(e.matches?"touch":"mouse")};e.addEventListener("change",t);var n=function(e){var t,n="pen"===(t=e.pointerType)||"touch"===t?"touch":"mouse"===t?"mouse":"unknown";setTimeout(function(){return i(n)},150)},r=function(e){"Tab"===e.key&&i("keyboard")};return window.addEventListener("pointerdown",n,{passive:!0}),window.addEventListener("keydown",r,{passive:!0}),function(){e.removeEventListener("change",t),window.removeEventListener("pointerdown",n),window.removeEventListener("keydown",r)}}function u(){return"unknown"===r?(r="mouse","mouse"):r}function c(e){return o.add(e),function(){o.delete(e)}}},201(e,t,n){n.d(t,{g:()=>o,w:()=>r});var r=function(e){var t=e.behaviour,n=e.hybridWidth,r=e.maxMobileWidth;if("hybrid"!==t)return!1;var o=null!=n?n:r;return window.matchMedia("(max-width: ".concat(o,"px)")).matches},o=function(e){var t=e.behaviour;return["mapOnly","buttonFirst"].includes(t)||r(e)}},637(e,t,n){n.d(t,{q:()=>r});var r=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=window.location)||void 0===t?void 0:t.search;return new URLSearchParams(n).get(e)}},901(e,t,n){function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){c=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{U:()=>a});var i=function(e,t,n,r){return e!==t&&!(null!=n&&n.contains(e))&&e.matches(":not([aria-hidden]):not([data-fm-inert])")&&r.contains(e)};function a(e){var t,n=e.containerEl,o=e.isFullscreen,a=e.boundaryEl,u=void 0===a?document.body:a,c=Array.from(u.querySelectorAll("[data-fm-inert]"));if(n&&(c=c.filter(function(e){return!n.contains(e)})),c.forEach(function(e){e.removeAttribute("aria-hidden"),delete e.dataset.fmInert}),o){null===(t=document.activeElement)||void 0===t||t.blur();for(var s=n;null!==(l=s)&&void 0!==l&&l.parentNode&&s!==u&&s!==document.body;){var l,f,p=s.parentNode,d=r(p.children);try{for(d.s();!(f=d.n()).done;){var v=f.value;i(v,s,n,u)&&(v.setAttribute("aria-hidden","true"),v.dataset.fmInert="")}}catch(e){d.e(e)}finally{d.f()}s=p}}}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return o[e](n,n.exports,a),n.exports}a.m=o,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);a.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&r&&n;("object"==typeof u||"function"==typeof u)&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,n)=>(a.f[n](e,t),t),[])),a.u=e=>"im-core.js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="defra.InteractiveMap:",a.l=(e,t,o,i)=>{if(n[e])n[e].push(t);else{var u,c;if(void 0!==o)for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var f=s[l];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==r+o){u=f;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",a.nc&&u.setAttribute("nonce",a.nc),u.setAttribute("data-webpack",r+o),u.src=e),n[e]=[t];var p=(t,r)=>{u.onerror=u.onload=null,clearTimeout(d);var o=n[e];if(delete n[e],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=p.bind(null,u.onerror),u.onload=p.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={57:0};a.f.j=(t,n)=>{var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,o)=>r=e[t]=[n,o]);n.push(r[2]=o);var i=a.p+a.u(t),u=new Error;a.l(i,n=>{if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;u.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,r[1](u)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,u,c]=n,s=0;if(i.some(t=>0!==e[t])){for(r in u)a.o(u,r)&&(a.m[r]=u[r]);c&&c(a)}for(t&&t(n);s<i.length;s++)o=i[s],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var u={};a.d(u,{default:()=>ee});var c=a(540),s=a(848),l=a.t(s,2),f=a(637),p=a(201);function d(){v.forEach(function(e){!function(e,t){var n;if(!1!==e.config.manageHistoryState){var r=e.id===t,o="hybrid"===e.config.behaviour&&!(0,p.w)(e.config),i=null===(n=e.rootEl)||void 0===n?void 0:n.children.length;!r||i&&!e._isHidden?r||!i||o||function(e){var t,n;e.config.preserveStateOnClose?null===(t=e.hideApp)||void 0===t||t.call(e):null===(n=e.removeApp)||void 0===n||n.call(e)}(e):function(e){var t,n;e._isHidden?null===(t=e.showApp)||void 0===t||t.call(e):null===(n=e.loadApp)||void 0===n||n.call(e)}(e)}}(e,(0,f.q)(e.config.mapViewQueryParam))})}var v=new Map,h=!1;const y=function(e){h||(globalThis.addEventListener("popstate",d),h=!0),v.set(e.id,e)},m=function(e){v.delete(e.id)};function b(e){return b="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},b(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _(e,t,n){return(t=function(e){var t=function(e){if("object"!=b(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==b(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){try{return JSON.parse(e)}catch(e){return console.log(e),null}}function P(e,t){e.innerHTML='<div class="im-c-error">'.concat(t,"</div>")}var E=a(205);function O(e){var t=e.id,n=e.behaviour,r=(0,f.q)(e.mapViewQueryParam)===t;return["mapOnly","inline"].includes(n)||"hybrid"===n&&!(0,p.w)(e)||r}const S={appColorScheme:"light",autoColorScheme:!1,backgroundColor:"var(--background-color)",behaviour:"buttonFirst",buttonClass:"im-c-open-map-button",buttonText:"Map view",containerHeight:"600px",deviceNotSupportedText:"Your device is not supported. A map is available with a more up-to-date browser or device.",enableFullscreen:!1,enableZoomControls:!0,genericErrorText:"There was a problem loading the map. Please try again later.",hasExitButton:!1,hybridWidth:null,keyboardHintText:'<span class="im-u-visually-hidden">Press </span><kbd>Alt</kbd> + <kbd>K</kbd> <span class="im-u-visually-hidden">to view </span>keyboard shortcuts',mapLabel:"Interactive map",mapProvider:null,mapSize:"small",manageHistoryState:!0,mapViewQueryParam:"mv",urlPosition:"sync",maxMobileWidth:640,minDesktopWidth:835,nudgePanDelta:5,nudgeZoomDelta:.1,panDelta:100,pageTitle:"Map view",preserveStateOnClose:!1,readMapText:!1,reverseGeocodeProvider:null,zoomDelta:1};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)}var k=["mapViewParamKey"];function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach(function(t){x(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(e,t,n){return(t=function(e){var t=function(e){if("object"!=A(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==A(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var C=a(902),D=a(233),M=a(12);function R(e){return R="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},R(e)}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function L(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,N(r.key),r)}}function N(e){var t=function(e){if("object"!=R(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==R(t)?t:t+""}var H=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={},this._queued={}},t=[{key:"on",value:function(e,t){if(this.events[e]||(this.events[e]=[]),this.events[e].push(t),void 0!==this._queued[e]){try{t.apply(void 0,function(e){return function(e){if(Array.isArray(e))return B(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return B(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(e,t):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.")}()}(this._queued[e]))}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}delete this._queued[e]}return this}},{key:"off",value:function(e,t){return this.events[e]?(this.events[e]=t?this.events[e].filter(function(e){return e!==t}):[],this):this}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]?(this.events[e].forEach(function(t){try{t.apply(void 0,n)}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}}),this):this}},{key:"emitWhenReady",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]&&0!==this.events[e].length?this.emit.apply(this,[e].concat(n)):(this._queued[e]=n,this)}},{key:"destroy",value:function(){this.events={},this._queued={}}}],t&&L(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();new H;var I=a(901);if("undefined"!=typeof crypto&&!crypto.randomUUID){var q=0;crypto.randomUUID=function(){return q=Math.max(Date.now(),q+1),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e,t){var n=t<12?Number.parseInt(q.toString(16).padStart(12,"0")[t],16):16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)})}}var F="undefined"!=typeof AbortController&&!Object.getPrototypeOf((new AbortController).signal).throwIfAborted;if(F&&(Object.getPrototypeOf((new AbortController).signal).throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");throw e.name="AbortError",e}}),F&&"undefined"!=typeof URL&&URL.createObjectURL){var U=URL.createObjectURL.bind(URL);URL.createObjectURL=function(e){return e instanceof Blob&&"text/javascript"===e.type&&(e=new Blob(['if(typeof AbortController!=="undefined"){var _p=Object.getPrototypeOf(new AbortController().signal);if(!_p.throwIfAborted){_p.throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");e.name="AbortError";throw e}}}}\n',e],{type:"text/javascript"})),U(e)}}function V(e){return V="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},V(e)}function $(){var e,t,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,s=Object.create(c.prototype);return G(s,"_invoke",function(n,r,o){var i,u,c,s=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,u=0,c=e,p.n=n,a}};function d(n,r){for(u=n,c=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,v=i[2];n>3?(o=v===r)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(u=0,p.v=r,p.n=i[1]):d<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,p.n=v,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,v){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,v),u=l,c=v;(t=u<2?e:c)||!f;){i||(u?u<3?(u>1&&(p.n=-1),d(u,c)):p.n=c:p.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,u=1,c=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(G(t={},r,function(){return this}),t),f=s.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,G(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=s,G(f,"constructor",s),G(s,"constructor",c),c.displayName="GeneratorFunction",G(s,o,"GeneratorFunction"),G(f),G(f,o,"Generator"),G(f,r,function(){return this}),G(f,"toString",function(){return"[object Generator]"}),($=function(){return{w:i,m:p}})()}function G(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}G=function(e,t,n,r){function i(t,n){G(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},G(e,t,n,r)}function W(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){Y(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Z(r.key),r)}}function Y(e,t,n){return(t=Z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){var t=function(e){if("object"!=V(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=V(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==V(t)?t:t+""}var J=function(){return e=function e(t){var n,r,o,i,a,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Y(this,"_openButton",null),Y(this,"_root",null),Y(this,"_breakpointDetector",null),Y(this,"_interfaceDetectorCleanup",null),Y(this,"_hybridBehaviourCleanup",null),Y(this,"_isHidden",!1),this.id=t,this.rootEl=document.getElementById(t),!this.rootEl)throw new Error('Element with id "'.concat(t,'" not found'));this.eventBus=new H,this.config=this._buildConfig(u),n=this.rootEl,o=(r=this.config).mapProvider,i=r.deviceNotSupportedText,a=null==o?void 0:o.checkDeviceCapabilities(),(o?null!=a&&a.isSupported||(P(n,i),(0,E.i)(),console.log(null==a?void 0:a.error),0):(console.log("No map provider"),0))&&(["buttonFirst","hybrid"].includes(this.config.behaviour)&&y(this),this._breakpointDetector=function(e){var t,n=e.maxMobileWidth,r=e.minDesktopWidth,o=e.containerEl,i="unknown",a=new Set,u=function(e){e!==i&&(i=e,requestAnimationFrame(function(){i===e&&a.forEach(function(t){return t(e)})}))};if(o){var c=function(e,t,n){e.style.containerType="inline-size";var r=e.getBoundingClientRect().width,o=t(r);e.dataset.breakpoint=o;var i=new window.ResizeObserver(function(r){var o,i,a=(null===(o=r[0])||void 0===o||null===(o=o.borderBoxSize)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.inlineSize)||(null===(i=r[0])||void 0===i?void 0:i.contentRect.width),u=t(a);e.dataset.breakpoint=u,n(u)});return i.observe(e),{initialType:o,cleanup:function(){i.disconnect(),e.style.containerType="",delete e.dataset.breakpoint}}}(o,function(e){return function(e,t,n){return e<=t?"mobile":e>=n?"desktop":"tablet"}(e,n,r)},u);i=c.initialType,u(c.initialType),t=c.cleanup}else{var s=function(e,t,n){var r={mobile:window.matchMedia("(max-width: ".concat(e,"px)")),desktop:window.matchMedia("(min-width: ".concat(t,"px)"))},o=function(){var e="tablet";r.mobile.matches?e="mobile":r.desktop.matches&&(e="desktop"),n(e)};return r.mobile.addEventListener("change",o),r.desktop.addEventListener("change",o),o(),{cleanup:function(){r.mobile.removeEventListener("change",o),r.desktop.removeEventListener("change",o)}}}(n,r,u);t=s.cleanup}return{subscribe:function(e){return a.add(e),function(){return a.delete(e)}},getBreakpoint:function(){return i},destroy:function(){var e;null===(e=t)||void 0===e||e(),a.clear()}}}({maxMobileWidth:this.config.maxMobileWidth,minDesktopWidth:this.config.minDesktopWidth,containerEl:this.rootEl}),this._interfaceDetectorCleanup=(0,C.C1)(),this._initialize())},t=[{key:"_buildConfig",value:function(e){var t=function(e){for(var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},null==e?void 0:e.dataset),n={},r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];n[i]=w(t[i])}return n}(this.rootEl);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapViewParamKey,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,k),r=T(T({},S),n);return void 0!==t&&(console.warn("[InteractiveMap] mapViewParamKey is deprecated — use mapViewQueryParam instead."),r.mapViewQueryParam=t),r}(K(K({id:this.id,title:document.title},t),e))}},{key:"_initialize",value:function(){var e=this;["buttonFirst","hybrid"].includes(this.config.behaviour)&&(this._openButton=function(t,n){var r=t.id,o=t.buttonText,i=t.buttonClass,a='\n <a class="'.concat(i,"\" role=\"button\">\n <svg focusable='false' aria-hidden='true' width='16' height='20' viewBox='0 0 16 20' fillRule='evenodd'>\n <path d='M15 7.5c.009 3.778-4.229 9.665-7.5 12.5C4.229 17.165-.009 11.278 0 7.5a7.5 7.5 0 1 1 15 0z'/>\n <path d='M7.5 12.961a5.46 5.46 0 1 0 0-10.922 5.46 5.46 0 1 0 0 10.922z' fill='#fff'/>\n </svg>\n <span>").concat(o,"</span>\n <span class='im-u-visually-hidden'> (Visual only)</span>\n </a>\n ");n.insertAdjacentHTML("beforebegin",a);var u=n.previousElementSibling,c=new URL(window.location.href);return c.searchParams.set(t.mapViewQueryParam,r),u.setAttribute("href",c.toString()),u.addEventListener("click",function(t){t.preventDefault(),function(t){e._handleButtonClick(t)}(t)}),u}(this.config,this.rootEl)),this._hybridBehaviourCleanup=function(e){var t=e.config,n=t.behaviour,r=t.hybridWidth,o=t.maxMobileWidth;if("buttonFirst"===n&&e._breakpointDetector.subscribe(function(){O(e.config)?e.loadApp():e.removeApp()}),"hybrid"===n){var i=null!=r?r:o,a=window.matchMedia("(max-width: ".concat(i,"px)")),u=function(){O(e.config)?e._isHidden?e.showApp():null==e._root?e.loadApp():(0,E.N)(e):e._root&&e.hideApp()};return a.addEventListener("change",u),function(){return a.removeEventListener("change",u)}}return null}(this),O(this.config)?this.loadApp():(0,E.i)()}},{key:"_handleButtonClick",value:function(e){this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this._isHidden?this.showApp():this.loadApp()}},{key:"_removeMapParamFromUrl",value:function(e,t){var n=new RegExp("[?&]".concat(t,"=[^&]*(&|$)"));return n.test(e)?e.replace(n,function(e,t){return"&"===t?"?":""}).replace(/\?$/,""):e}},{key:"_handleExitClick",value:function(){var e;if(this.config.preserveStateOnClose?this.hideApp():this.removeApp(),this.config.manageHistoryState)if(null!==(e=history.state)&&void 0!==e&&e.isBack)history.back();else{var t=this.config.mapViewQueryParam,n=this._removeMapParamFromUrl(location.href,t);history.replaceState(history.state,"",n)}}},{key:"loadApp",value:(n=$().m(function e(){var t,n,r,o,i,u,c,s,l,f=this;return $().w(function(e){for(;;)switch(e.p=e.n){case 0:return this._openButton&&(this._openButton.style.display="none"),e.p=1,e.n=2,a.e(935).then(a.bind(a,724));case 2:return t=e.v,n=t.initialiseApp,e.n=3,this.config.mapProvider.load();case 3:return r=e.v,o=r.MapProvider,i=r.mapFramework,u=r.mapProviderConfig,this.config.reverseGeocodeProvider&&(0,D.H)(this.config.reverseGeocodeProvider,u.crs),e.n=4,n(this.rootEl,K(K({id:this.id,initialBreakpoint:this._breakpointDetector.getBreakpoint(),initialInterfaceType:(0,C.ip)()},this.config),{},{MapProvider:o,mapProviderConfig:u,mapFramework:i,eventBus:this.eventBus,breakpointDetector:this._breakpointDetector,handleExitClick:this._handleExitClick.bind(this)}));case 4:c=e.v,this._root=c._root,delete c._root,s=new Set(["on","off","emit"]),Object.keys(c).forEach(function(e){s.has(e)||(f[e]=c[e])}),(0,E.N)(this),this.eventBus.emit(M.q.APP_OPENED,{statePreserved:!1}),e.n=6;break;case 5:throw e.p=5,l=e.v,P(this.rootEl,this.config.genericErrorText),console.error(l),l;case 6:return e.a(2)}},e,this,[[1,5]])}),r=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){W(i,r,o,a,u,"next",e)}function u(e){W(i,r,o,a,u,"throw",e)}a(void 0)})},function(){return r.apply(this,arguments)})},{key:"removeApp",value:function(){this._root&&"function"==typeof this.unmount&&(this.unmount(),this._root=null),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),(0,E.N)(this,{isFullscreen:!1}),this.eventBus.emit(M.q.APP_CLOSED,{statePreserved:!1}),this.eventBus.emit(M.q.MAP_DESTROY,{mapId:this.id})}},{key:"hideApp",value:function(){this._isHidden=!0,this.rootEl.style.display="none",(0,I.U)({containerEl:this.rootEl,isFullscreen:!1}),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),document.documentElement.classList.remove("im-is-fullscreen"),this.rootEl.classList.remove("im-is-fullscreen");var e=document.title.split(": ");e.length>1&&(document.title=e.at(-1)),this.eventBus.emit(M.q.APP_CLOSED,{statePreserved:!0})}},{key:"showApp",value:function(){this._isHidden=!1,this.rootEl.style.display="",this._openButton&&(this._openButton.style.display="none"),(0,E.N)(this),this.eventBus.emit(M.q.APP_OPENED,{statePreserved:!0})}},{key:"destroy",value:function(){var e,t,n;this.removeApp(),null===(e=this._breakpointDetector)||void 0===e||e.destroy(),null===(t=this._interfaceDetectorCleanup)||void 0===t||t.call(this),null===(n=this._hybridBehaviourCleanup)||void 0===n||n.call(this),m(this),this.eventBus.destroy()}},{key:"on",value:function(){var e;(e=this.eventBus).on.apply(e,arguments)}},{key:"off",value:function(){var e;(e=this.eventBus).off.apply(e,arguments)}},{key:"emit",value:function(){var e;(e=this.eventBus).emit.apply(e,arguments)}},{key:"addMarker",value:function(e,t,n){this.eventBus.emit(M.q.APP_ADD_MARKER,{id:e,coords:t,options:n})}},{key:"removeMarker",value:function(e){this.eventBus.emit(M.q.APP_REMOVE_MARKER,e)}},{key:"setMode",value:function(e){this.eventBus.emit(M.q.APP_SET_MODE,e)}},{key:"addButton",value:function(e,t){this.eventBus.emit(M.q.APP_ADD_BUTTON,{id:e,config:t})}},{key:"toggleButtonState",value:function(e,t,n){this.eventBus.emit(M.q.APP_TOGGLE_BUTTON_STATE,{id:e,prop:t,value:n})}},{key:"addPanel",value:function(e,t){this.eventBus.emit(M.q.APP_ADD_PANEL,{id:e,config:t})}},{key:"removePanel",value:function(e){this.eventBus.emit(M.q.APP_REMOVE_PANEL,e)}},{key:"showPanel",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).focus,n=void 0===t||t;this.eventBus.emit(M.q.APP_SHOW_PANEL,{id:e,focus:n})}},{key:"hidePanel",value:function(e){this.eventBus.emit(M.q.APP_HIDE_PANEL,e)}},{key:"addControl",value:function(e,t){this.eventBus.emit(M.q.APP_ADD_CONTROL,{id:e,config:t})}},{key:"fitToBounds",value:function(e){this.eventBus.emitWhenReady(M.q.MAP_FIT_TO_BOUNDS,e)}},{key:"setView",value:function(e){this.eventBus.emitWhenReady(M.q.MAP_SET_VIEW,e)}},{key:"open",value:function(){this._isHidden?this.showApp():this._root||this.loadApp()}},{key:"close",value:function(){this._handleExitClick()}}],t&&Q(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r}(),X="undefined"==typeof window?globalThis:window;X.defra=X.defra||{},X.preactCompat=c,X.preactJsxRuntime=l,X.preactHooks={useState:c.useState},X.defra.InteractiveMap=J,X.preactCompat.default||(X.preactCompat.default=X.preactCompat),X.preactCompat.createRoot||(X.preactCompat.createRoot=function(e){return{render:function(t){X.preactCompat.render(t,e)},unmount:function(){X.preactCompat.render(null,e)}}});const ee=J;return u.default})());
|
package/docs/api.md
CHANGED
|
@@ -248,6 +248,32 @@ new InteractiveMap('map', {
|
|
|
248
248
|
})
|
|
249
249
|
```
|
|
250
250
|
|
|
251
|
+
#### MapLibre provider options
|
|
252
|
+
|
|
253
|
+
`maplibreProvider()` accepts an optional config object.
|
|
254
|
+
|
|
255
|
+
##### `workerUrl`
|
|
256
|
+
**Type:** `string`
|
|
257
|
+
**Default:** `undefined`
|
|
258
|
+
|
|
259
|
+
URL to a separately hosted MapLibre worker file (`maplibre-gl-csp-worker.js`). Required when running under a Content Security Policy that blocks `blob:` worker URLs — a common restriction on government and enterprise platforms.
|
|
260
|
+
|
|
261
|
+
When set, MapLibre loads its rendering worker from this URL instead of generating an inline blob, so your CSP only needs `worker-src 'self'` rather than `worker-src blob:`.
|
|
262
|
+
|
|
263
|
+
The worker file ships with maplibre-gl and must be served from your own origin (copy from `node_modules/maplibre-gl/dist/maplibre-gl-csp-worker.js`).
|
|
264
|
+
|
|
265
|
+
**ESM:**
|
|
266
|
+
|
|
267
|
+
```js
|
|
268
|
+
maplibreProvider({ workerUrl: '/your-assets-path/maplibre-gl-csp-worker.js' })
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**UMD:**
|
|
272
|
+
|
|
273
|
+
```js
|
|
274
|
+
defra.maplibreProvider({ workerUrl: '/your-assets-path/maplibre-gl-csp-worker.js' })
|
|
275
|
+
```
|
|
276
|
+
|
|
251
277
|
---
|
|
252
278
|
|
|
253
279
|
### `mapSize`
|
|
@@ -277,14 +303,27 @@ See [MapStyleConfig](./api/map-style-config.md) for full details.
|
|
|
277
303
|
|
|
278
304
|
---
|
|
279
305
|
|
|
280
|
-
### `
|
|
306
|
+
### `mapViewQueryParam`
|
|
281
307
|
**Type:** `string`
|
|
282
308
|
**Default:** `'mv'`
|
|
283
309
|
|
|
284
|
-
URL query parameter
|
|
310
|
+
URL query parameter used to control fullscreen/hybrid/buttonFirst state. Override if the default value clashes with an existing parameter on your page.
|
|
285
311
|
|
|
286
312
|
---
|
|
287
313
|
|
|
314
|
+
### `urlPosition`
|
|
315
|
+
**Type:** `'sync' | 'readOnly' | 'none'`
|
|
316
|
+
**Default:** `'sync'`
|
|
317
|
+
|
|
318
|
+
Controls how map center and zoom interact with the page URL.
|
|
319
|
+
|
|
320
|
+
| Value | Behaviour |
|
|
321
|
+
|---|---|
|
|
322
|
+
| `'sync'` | Reads center/zoom from the URL on load and writes back on pan/zoom — enables bookmarking and sharing the current map view |
|
|
323
|
+
| `'readOnly'` | Seeds the initial view from the URL but never writes back |
|
|
324
|
+
| `'none'` | Ignores the URL entirely — use when you don't want the user's pan/zoom to be persisted or shared |
|
|
325
|
+
---
|
|
326
|
+
|
|
288
327
|
### `markers`
|
|
289
328
|
**Type:** `MarkerConfig[]`
|
|
290
329
|
|
package/docs/plugins/datasets.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The datasets plugin renders GeoJSON and vector tile datasets on the map, with support for polygon, line, and symbol (point) layer types, sublayer style rules, layer visibility toggling, a key panel, and runtime style and data updates.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## ESM usage
|
|
6
6
|
|
|
7
7
|
```js
|
|
8
8
|
import createDatasetsPlugin from '@defra/interactive-map/plugins/datasets'
|
|
@@ -33,6 +33,41 @@ const interactiveMap = new InteractiveMap({
|
|
|
33
33
|
})
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
## UMD usage
|
|
37
|
+
|
|
38
|
+
Copy `plugins/beta/datasets/dist/umd/maplibre/` to `/your-assets-path/plugins/beta/datasets/umd/maplibre/`, then load the script tag. The MapLibre adapter is included — no `layerAdapter` config is needed.
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<script defer src="/your-assets-path/plugins/beta/datasets/umd/maplibre/index.js"></script>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
const datasetsPlugin = defra.datasetsMaplibrePlugin({
|
|
46
|
+
datasets: [
|
|
47
|
+
{
|
|
48
|
+
id: 'my-parcels',
|
|
49
|
+
label: 'My parcels',
|
|
50
|
+
geojson: 'https://example.com/api/parcels',
|
|
51
|
+
minZoom: 10,
|
|
52
|
+
maxZoom: 24,
|
|
53
|
+
showInKey: true,
|
|
54
|
+
showInMenu: true,
|
|
55
|
+
style: {
|
|
56
|
+
stroke: '#d4351c',
|
|
57
|
+
strokeWidth: 2,
|
|
58
|
+
fill: 'transparent'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> [!NOTE]
|
|
66
|
+
> **GOV.UK Prototype Kit** — skip the copy step. The file is served automatically. Use this path instead:
|
|
67
|
+
> ```html
|
|
68
|
+
> <script defer src="/plugin-assets/%40defra%2Finteractive-map/plugins/beta/datasets/dist/umd/maplibre/index.js"></script>
|
|
69
|
+
> ```
|
|
70
|
+
|
|
36
71
|
## Options
|
|
37
72
|
|
|
38
73
|
Options are passed to the factory function when creating the plugin.
|
|
@@ -41,6 +76,9 @@ Options are passed to the factory function when creating the plugin.
|
|
|
41
76
|
|
|
42
77
|
### `layerAdapter`
|
|
43
78
|
|
|
79
|
+
> [!NOTE]
|
|
80
|
+
> UMD users using the `datasetsMaplibrePlugin` bundle do not need to set this — the MapLibre adapter is pre-configured.
|
|
81
|
+
|
|
44
82
|
**Type:** `LayerAdapter`
|
|
45
83
|
**Required**
|
|
46
84
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra/interactive-map",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22-alpha",
|
|
4
4
|
"description": "An accessible map component",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,12 +41,10 @@
|
|
|
41
41
|
"require": "./plugins/interact/dist/umd/index.js"
|
|
42
42
|
},
|
|
43
43
|
"./plugins/datasets": {
|
|
44
|
-
"import": "./plugins/beta/datasets/dist/esm/index.js"
|
|
45
|
-
"require": "./plugins/beta/datasets/dist/umd/index.js"
|
|
44
|
+
"import": "./plugins/beta/datasets/dist/esm/index.js"
|
|
46
45
|
},
|
|
47
46
|
"./plugins/datasets/adapters/maplibre": {
|
|
48
|
-
"import": "./plugins/beta/datasets/adapters/maplibre/
|
|
49
|
-
"require": "./plugins/beta/datasets/adapters/maplibre/dist/umd/index.js"
|
|
47
|
+
"import": "./plugins/beta/datasets/dist/adapters/maplibre/esm/index.js"
|
|
50
48
|
},
|
|
51
49
|
"./plugins/map-styles": {
|
|
52
50
|
"import": "./plugins/beta/map-styles/dist/esm/index.js",
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see im-datasets-maplibre-adapter.js.LICENSE.txt */
|
|
2
|
+
"use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[580],{438(t,r,e){e.r(r),e.d(r,{default:()=>Y});var n=function(t,r,e,n,o){if(t.getLayer(r)){var i=function(t,r,e){if(!e||0===e.length)return t;var n=["!",["in",r?["to-string",["get",r]]:["to-string",["id"]],["literal",e.map(String)]]];return t?["all",t,n]:n}(e,n,o);t.setFilter(r,i)}},o=e(449);function i(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var a=function(t){return"string"==typeof t.geojson&&!!t.idProperty&&"function"==typeof t.transformRequest},l=function(t){var r,e=0,n=function(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,r){if(t){if("string"==typeof t)return i(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?i(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return l=t.done,t},e:function(t){u=!0,a=t},f:function(){try{l||null==e.return||e.return()}finally{if(u)throw a}}}}(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;e=Math.trunc((e<<5)-e+o.codePointAt(0))}}catch(t){n.e(t)}finally{n.f()}return Math.abs(e).toString(36)},u=function(t){if(t.tiles){var r=Array.isArray(t.tiles)?t.tiles.join(","):t.tiles;return"tiles-".concat(l(r))}return t.geojson?a(t)?"geojson-dynamic-".concat(t.id):"string"==typeof t.geojson?"geojson-".concat(l(t.geojson)):"geojson-".concat(t.id):"source-".concat(t.id)},s=function(t){if(function(t){return!!t.symbol}(t))return{fillLayerId:null,strokeLayerId:null,symbolLayerId:t.id};var r=!!t.fill&&"transparent"!==t.fill||(0,o.vY)(t),e=!!t.stroke,n=r?t.id:null,i=null;return e&&(i=r?"".concat(t.id,"-stroke"):t.id),{fillLayerId:n,strokeLayerId:i,symbolLayerId:null}},c=function(t,r){return{fillLayerId:"".concat(t,"-").concat(r),strokeLayerId:"".concat(t,"-").concat(r,"-stroke"),symbolLayerId:"".concat(t,"-").concat(r,"-symbol")}},y=function(t){var r;if(null!==(r=t.sublayers)&&void 0!==r&&r.length)return t.sublayers.flatMap(function(r){var e=c(t.id,r.id),n=e.fillLayerId;return[e.strokeLayerId,n,e.symbolLayerId]});var e=s(t),n=e.fillLayerId;return[e.strokeLayerId,n,e.symbolLayerId].filter(Boolean)},f=e(247),m=e(933),p=e(121);function d(t,r){if(t){if("string"==typeof t)return b(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?b(t,r):void 0}}function b(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var v=function(t){var r,e,n=(e=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,l=[],u=!0,s=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(r,e)||d(r,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.")}()),o=n[0],i=n[1],a=function(t){return t<=.25?"left":t>=.75?"right":""}(o),l=function(t){return t<=.25?"top":t>=.75?"bottom":""}(i);return l+(a&&l?"-":"")+a||"center"},h=function(t,r,e){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,i=(0,p.s8)(t,e);if(!i)return null;var a=(0,p.sR)(t),l=n?e.resolveSelected(i,a,r):e.resolve(i,a,r);return"symbol-".concat(n?"sel-":"").concat(function(t){var r,e=0,n=function(t){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=d(t))){r&&(t=r);var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;e=Math.trunc((e<<5)-e+o.codePointAt(0))}}catch(t){n.e(t)}finally{n.f()}return Math.abs(e).toString(36)}(l),"-").concat(o,"x")};function g(t){return g="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},g(t)}function S(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function _(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?S(Object(e),!0).forEach(function(r){P(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):S(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function P(t,r,e){return(r=function(t){var r=function(t){if("object"!=g(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=g(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==g(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}new Map;var w=function(t,r,e,n,i,a,l){var u=l.mapStyleId,s=l.patternRegistry,c=l.pixelRatio,y=void 0===c?1:c;if(e&&!t.getLayer(e)&&(r.fill||(0,o.vY)(r))){var m=(0,o.vY)(r)?(0,o.zp)(r,u,s,y):null,p=m?{"fill-pattern":m,"fill-opacity":r.opacity||1}:{"fill-color":(0,f.o)(r.fill,u),"fill-opacity":r.opacity||1};t.addLayer(_({id:e,type:"fill",source:n,"source-layer":i,minzoom:r.minZoom,maxzoom:r.maxZoom,layout:{visibility:a},paint:p},r.filter?{filter:r.filter}:{}))}},O=function(t,r,e,n,o,i,a){e&&r.stroke&&!t.getLayer(e)&&t.addLayer(_({id:e,type:"line",source:n,"source-layer":o,minzoom:r.minZoom,maxzoom:r.maxZoom,layout:{visibility:i},paint:_({"line-color":(0,f.o)(r.stroke,a),"line-width":r.strokeWidth||1,"line-opacity":r.opacity||1},r.strokeDashArray?{"line-dasharray":r.strokeDashArray}:{})},r.filter?{filter:r.filter}:{}))},k=function(t,r,e,n,o,i,a){var l=a.mapStyle,u=a.symbolRegistry,s=a.pixelRatio;if(e&&!t.getLayer(e)){var c=(0,p.s8)(r,u);if(c){var y=h(r,l,u,!1,s);if(y){var f=(0,p.Op)(r,c);t.addLayer(_({id:e,type:"symbol",source:n,"source-layer":o,minzoom:r.minZoom,maxzoom:r.maxZoom,layout:{visibility:i,"icon-image":y,"icon-anchor":v(f),"icon-allow-overlap":!0}},r.filter?{filter:r.filter}:{}))}}}},L=function(t,r,e,n,o,i){var a,l=i.mapStyle,u=i.symbolRegistry,s=i.patternRegistry,y=i.pixelRatio,f=l.id,d=(0,m.m)(r,e),b=c(r.id,e.id),v=b.fillLayerId,h=b.strokeLayerId,g=b.symbolLayerId,S="hidden"===r.visibility,_="hidden"===(null===(a=r.sublayerVisibility)||void 0===a?void 0:a[e.id]),P=S||_?"none":"visible";(0,p.Lo)(d)&&u?k(t,d,g,n,o,P,{mapStyle:l,symbolRegistry:u,pixelRatio:y}):(w(t,d,v,n,o,P,{mapStyleId:f,patternRegistry:s,pixelRatio:y}),O(t,d,h,n,o,P,f))},j=function(t,r){return t.flatMap(function(t){var r,e=(0,o.vY)(t)?[t]:[];return null!==(r=t.sublayers)&&void 0!==r&&r.length&&t.sublayers.forEach(function(r){var n=(0,m.m)(t,r);(0,o.vY)(n)&&e.push(n)}),e})},I=function(t){return t.flatMap(function(t){var r,e=(0,p.Lo)(t)?[t]:[];return null!==(r=t.sublayers)&&void 0!==r&&r.length&&t.sublayers.forEach(function(r){var n=(0,m.m)(t,r);(0,p.Lo)(n)&&e.push(n)}),e})};e(738);new Set,new Set,e(287);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 R(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function x(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?R(Object(e),!0).forEach(function(r){E(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):R(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function E(t,r,e){return(r=function(t){var r=function(t){if("object"!=C(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=C(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==C(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var A={slot:"middle",open:!1,dismissible:!0,modal:!0},D=(x({},A),x(x({},A),{},{width:"500px"}),x(x({},A),{},{width:"500px"}),{small:1,medium:1.5,large:2});function F(t){return F="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},F(t)}function M(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,l=[],u=!0,s=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,r)||function(t,r){if(t){if("string"==typeof t)return B(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?B(t,r):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function T(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var u=n&&n.prototype instanceof l?n:l,s=Object.create(u.prototype);return z(s,"_invoke",function(e,n,o){var i,l,u,s=0,c=o||[],y=!1,f={p:0,n:0,v:t,a:m,f:m.bind(t,4),d:function(r,e){return i=r,l=0,u=t,f.n=e,a}};function m(e,n){for(l=e,u=n,r=0;!y&&s&&!o&&r<c.length;r++){var o,i=c[r],m=f.p,p=i[2];e>3?(o=p===n)&&(u=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=t):i[0]<=m&&((o=e<2&&m<i[1])?(l=0,f.v=n,f.n=i[1]):m<p&&(o=e<3||i[0]>n||n>p)&&(i[4]=e,i[5]=n,f.n=p,l=0))}if(o||e>1)return a;throw y=!0,n}return function(o,c,p){if(s>1)throw TypeError("Generator is already running");for(y&&1===c&&m(c,p),l=c,u=p;(r=l<2?t:u)||!y;){i||(l?l<3?(l>1&&(f.n=-1),m(l,u)):f.n=u:f.v=u);try{if(s=2,i){if(l||(o="next"),r=i[o]){if(!(r=r.call(i,u)))throw TypeError("iterator result is not an object");if(!r.done)return r;u=r.value,l<2&&(l=0)}else 1===l&&(r=i.return)&&r.call(i),l<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=t}else if((r=(y=f.n<0)?u:e.call(n,f))!==a)break}catch(r){i=t,l=1,u=r}finally{s=1}}return{value:r,done:y}}}(e,o,i),!0),s}var a={};function l(){}function u(){}function s(){}r=Object.getPrototypeOf;var c=[][n]?r(r([][n]())):(z(r={},n,function(){return this}),r),y=s.prototype=l.prototype=Object.create(c);function f(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,z(t,o,"GeneratorFunction")),t.prototype=Object.create(y),t}return u.prototype=s,z(y,"constructor",s),z(s,"constructor",u),u.displayName="GeneratorFunction",z(s,o,"GeneratorFunction"),z(y),z(y,o,"Generator"),z(y,n,function(){return this}),z(y,"toString",function(){return"[object Generator]"}),(T=function(){return{w:i,m:f}})()}function z(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}z=function(t,r,e,n){function i(r,e){z(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},z(t,r,e,n)}function Z(t,r,e,n,o,i,a){try{var l=t[i](a),u=l.value}catch(t){return void e(t)}l.done?r(u):Promise.resolve(u).then(n,o)}function W(t){return function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function a(t){Z(i,n,o,a,l,"next",t)}function l(t){Z(i,n,o,a,l,"throw",t)}a(void 0)})}}function V(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,G(n.key),n)}}function G(t){var r=function(t){if("object"!=F(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=F(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==F(r)?r:r+""}var Y=function(){return t=function t(r,e,n){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this._mapProvider=r,this._map=r.map,this._symbolRegistry=e,this._patternRegistry=n,this._datasetSourceMap=new Map,this._symbolLayerIds=new Set},r=[{key:"init",value:(d=W(T().m(function t(r,e){var n,o,i=this;return T().w(function(t){for(;;)switch(t.n){case 0:return n=e.id,o=this._pixelRatio,t.n=1,Promise.all([this._mapProvider.registerPatterns(j(r,this._patternRegistry),n,this._patternRegistry),this._mapProvider.registerSymbols(I(r),e,this._symbolRegistry)]);case 1:return this._symbolLayerIds.clear(),r.forEach(function(t){return i._addLayers(t,e,o)}),t.n=2,new Promise(function(t){return i._map.once("idle",t)});case 2:return t.a(2)}},t,this)})),function(t,r){return d.apply(this,arguments)})},{key:"destroy",value:function(t){var r=this,e=new Set;t.forEach(function(t){var n=u(t);r._getLayersUsingSource(n).forEach(function(t){r._map.getLayer(t)&&r._map.removeLayer(t)}),!e.has(n)&&r._map.getSource(n)&&(r._map.removeSource(n),e.add(n))}),this._datasetSourceMap.clear()}},{key:"onStyleChange",value:(f=W(T().m(function t(r,e,n,o){var i,a,l=this;return T().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,new Promise(function(t){return l._map.once("idle",t)});case 1:return i=e.id,a=this._pixelRatio,t.n=2,Promise.all([this._mapProvider.registerPatterns(j(r,this._patternRegistry),i,this._patternRegistry),this._mapProvider.registerSymbols(I(r),e,this._symbolRegistry)]);case 2:this._symbolLayerIds.clear(),r.forEach(function(t){return l._addLayers(t,e,a)}),o.forEach(function(t){return t.reapply()}),Object.entries(n).forEach(function(t){var e=M(t,2),n=e[0],o=e[1],i=o.idProperty,a=o.ids,u=r.find(function(t){return t.id===n});u&&l._applyFeatureFilter(u,i,a)});case 3:return t.a(2)}},t,this)})),function(t,r,e,n){return f.apply(this,arguments)})},{key:"onSizeChange",value:(l=W(T().m(function t(r,e){var n,i=this;return T().w(function(t){for(;;)switch(t.n){case 0:return n=this._pixelRatio,t.n=1,Promise.all([this._mapProvider.registerSymbols(I(r),e,this._symbolRegistry),this._mapProvider.registerPatterns(j(r,this._patternRegistry),e.id,this._patternRegistry)]);case 1:r.forEach(function(t){var r;if(y(t).forEach(function(r){if(i._symbolLayerIds.has(r)&&i._map.getLayer(r)){var o=h(t,e,i._symbolRegistry,!1,n);o&&i._map.setLayoutProperty(r,"icon-image",o)}}),(0,o.vY)(t)){var a=s(t).fillLayerId;if(i._map.getLayer(a)){var l=(0,o.zp)(t,e.id,i._patternRegistry,n);l&&i._map.setPaintProperty(a,"fill-pattern",l)}}null===(r=t.sublayers)||void 0===r||r.forEach(function(r){var a=(0,m.m)(t,r),l=c(t.id,r.id),u=l.symbolLayerId,s=l.fillLayerId;if(i._map.getLayer(u)){var y=h(a,e,i._symbolRegistry,!1,n);y&&i._map.setLayoutProperty(u,"icon-image",y)}if((0,o.vY)(a)&&i._map.getLayer(s)){var f=(0,o.zp)(a,e.id,i._patternRegistry,n);f&&i._map.setPaintProperty(s,"fill-pattern",f)}})});case 2:return t.a(2)}},t,this)})),function(t,r){return l.apply(this,arguments)})},{key:"addDataset",value:function(t,r){this._addLayers(t,r,this._pixelRatio)}},{key:"removeDataset",value:function(t,r){var e=this,n=u(t);y(t).forEach(function(t){e._map.getLayer(t)&&e._map.removeLayer(t),e._symbolLayerIds.delete(t)}),!r.some(function(r){return r.id!==t.id&&u(r)===n})&&this._map.getSource(n)&&this._map.removeSource(n),this._datasetSourceMap.delete(t.id)}},{key:"showDataset",value:function(t){this._setDatasetVisibility(t,"visible")}},{key:"hideDataset",value:function(t){this._setDatasetVisibility(t,"none")}},{key:"showSublayer",value:function(t,r){var e=this,n=c(t,r);[n.fillLayerId,n.strokeLayerId,n.symbolLayerId].forEach(function(t){e._map.getLayer(t)&&e._map.setLayoutProperty(t,"visibility","visible")})}},{key:"hideSublayer",value:function(t,r){var e=this,n=c(t,r);[n.fillLayerId,n.strokeLayerId,n.symbolLayerId].forEach(function(t){e._map.getLayer(t)&&e._map.setLayoutProperty(t,"visibility","none")})}},{key:"showFeatures",value:function(t,r,e){this._applyFeatureFilter(t,r,e)}},{key:"hideFeatures",value:function(t,r,e){this._applyFeatureFilter(t,r,e)}},{key:"setStyle",value:(i=W(T().m(function t(r,e){var n,o,i=this;return T().w(function(t){for(;;)switch(t.n){case 0:return n=e.id,o=this._pixelRatio,y(r).forEach(function(t){i._map.getLayer(t)&&i._map.removeLayer(t),i._symbolLayerIds.delete(t)}),t.n=1,Promise.all([this._mapProvider.registerPatterns(j([r],this._patternRegistry),n,this._patternRegistry),this._mapProvider.registerSymbols(I([r]),e,this._symbolRegistry)]);case 1:this._addLayers(r,e,o);case 2:return t.a(2)}},t,this)})),function(t,r){return i.apply(this,arguments)})},{key:"setSublayerStyle",value:(e=W(T().m(function t(r,e,n){var o,i,a,l,u,s,y,f,m,p,d,b=this;return T().w(function(t){for(;;)switch(t.n){case 0:if(a=n.id,l=this._pixelRatio,u=c(r.id,e),s=u.fillLayerId,y=u.strokeLayerId,f=u.symbolLayerId,[s,y,f].forEach(function(t){b._map.getLayer(t)&&b._map.removeLayer(t),b._symbolLayerIds.delete(t)}),m=null===(o=r.sublayers)||void 0===o?void 0:o.find(function(t){return t.id===e})){t.n=1;break}return t.a(2);case 1:return t.n=2,Promise.all([this._mapProvider.registerPatterns(j([r],this._patternRegistry),a,this._patternRegistry),this._mapProvider.registerSymbols(I([r]),n,this._symbolRegistry)]);case 2:p=this._datasetSourceMap.get(r.id),d=null!==(i=r.tiles)&&void 0!==i&&i.length?r.sourceLayer:void 0,L(this._map,r,m,p,d,{mapStyle:n,symbolRegistry:this._symbolRegistry,patternRegistry:this._patternRegistry,pixelRatio:l}),this._maintainSymbolOrdering(r);case 3:return t.a(2)}},t,this)})),function(t,r,n){return e.apply(this,arguments)})},{key:"setOpacity",value:function(t,r){var e=this,n=this._map.getStyle();null!=n&&n.layers&&n.layers.filter(function(r){return r.id===t||r.id.startsWith("".concat(t,"-"))}).forEach(function(t){return e._setPaintOpacity(t.id,r)})}},{key:"setSublayerOpacity",value:function(t,r,e){var n=c(t,r),o=n.fillLayerId,i=n.strokeLayerId;this._setPaintOpacity(o,e),this._setPaintOpacity(i,e)}},{key:"setData",value:function(t,r){var e=this._datasetSourceMap.get(t);if(e){var n=this._map.getSource(e);n&&"function"==typeof n.setData&&n.setData(r)}}},{key:"_pixelRatio",get:function(){return this._mapProvider.map.getPixelRatio()*(D[this._mapProvider.mapSize]||1)}},{key:"_addLayers",value:function(t,r,e){var n=function(t,r,e,n,o,i){var l,c,y=e.id,f=u(r);!function(t,r,e){if(!t.getSource(e))if(r.tiles)t.addSource(e,{type:"vector",tiles:r.tiles,minzoom:r.minZoom||0,maxzoom:r.maxZoom||22});else if(r.geojson){var n=a(r)?{type:"FeatureCollection",features:[]}:r.geojson;t.addSource(e,{type:"geojson",data:n,generateId:!0})}}(t,r,f);var m=null!==(l=r.tiles)&&void 0!==l&&l.length?r.sourceLayer:void 0;if(null!==(c=r.sublayers)&&void 0!==c&&c.length)return r.sublayers.forEach(function(a){L(t,r,a,f,m,{mapStyle:e,symbolRegistry:n,patternRegistry:o,pixelRatio:i})}),f;var d=s(r),b=d.fillLayerId,v=d.strokeLayerId,h=d.symbolLayerId,g="hidden"===r.visibility?"none":"visible";return(0,p.Lo)(r)&&n?(k(t,r,h,f,m,g,{mapStyle:e,symbolRegistry:n,pixelRatio:i}),f):(w(t,r,b,f,m,g,{mapStyleId:y,patternRegistry:o,pixelRatio:i}),O(t,r,v,f,m,g,y),f)}(this._map,t,r,this._symbolRegistry,this._patternRegistry,e);this._datasetSourceMap.set(t.id,n),this._maintainSymbolOrdering(t)}},{key:"_getFirstSymbolLayerId",value:function(){var t,r=this,e=this._map.getStyle();if(null==e||!e.layers)return null;var n=e.layers.find(function(t){return r._symbolLayerIds.has(t.id)});return null!==(t=null==n?void 0:n.id)&&void 0!==t?t:null}},{key:"_maintainSymbolOrdering",value:function(t){var r=this,e=y(t).filter(function(t){return t&&r._map.getLayer(t)});e.forEach(function(t){var e;"symbol"===(null===(e=r._map.getLayer(t))||void 0===e?void 0:e.type)?r._symbolLayerIds.add(t):r._symbolLayerIds.delete(t)});var n=this._getFirstSymbolLayerId();n&&e.forEach(function(t){r._symbolLayerIds.has(t)||r._map.moveLayer(t,n)})}},{key:"_setDatasetVisibility",value:function(t,r){var e=this,n=this._map.getStyle();null!=n&&n.layers&&n.layers.filter(function(r){return r.id===t||r.id.startsWith("".concat(t,"-"))}).forEach(function(t){return e._map.setLayoutProperty(t.id,"visibility",r)})}},{key:"_applyFeatureFilter",value:function(t,r,e){var o,i=this;if(null!==(o=t.sublayers)&&void 0!==o&&o.length)t.sublayers.forEach(function(o){var a=c(t.id,o.id),l=a.fillLayerId,u=a.strokeLayerId,s=t.filter&&o.filter?["all",t.filter,o.filter]:o.filter||t.filter||null;n(i._map,l,s,r,e),n(i._map,u,s,r,e)});else{var a=s(t),l=a.fillLayerId,u=a.strokeLayerId,y=a.symbolLayerId,f=t.filter||null;[l,u,y].filter(Boolean).forEach(function(t){n(i._map,t,f,r,e)})}}},{key:"_setPaintOpacity",value:function(t,r){var e=this._map.getLayer(t);if(e){var n={line:"line-opacity",symbol:"icon-opacity"}[e.type]||"fill-opacity";this._map.setPaintProperty(t,n,r)}}},{key:"_getLayersUsingSource",value:function(t){var r=this._map.getStyle();return null!=r&&r.layers?r.layers.filter(function(r){return r.source===t}).map(function(t){return t.id}):[]}}],r&&V(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,e,i,l,f,d}()},772(t,r,e){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function i(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?o(Object(e),!0).forEach(function(r){a(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):o(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function a(t,r,e){return(r=function(t){var r=function(t){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=n(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}e.d(r,{V:()=>l,ns:()=>y,p_:()=>c});var l={minZoom:6,maxZoom:24,showInKey:!1,showInMenu:!1,visibility:"visible",style:{stroke:"#d4351c",strokeWidth:2,fill:"transparent",symbolDescription:"red outline"}},u=["stroke","strokeWidth","strokeDashArray","fill","fillPattern","fillPatternSvgContent","fillPatternForegroundColor","fillPatternBackgroundColor","opacity","symbolDescription","keySymbolShape","symbol","symbolSvgContent","symbolViewBox","symbolAnchor","symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"],s=["stroke","fill","fillPattern","fillPatternSvgContent","symbol","symbolSvgContent"],c=function(t){return s.some(function(r){return r in t})},y=function(t,r){var e=t.style||{},n=i(i({},r.style),e);!("symbolDescription"in e)&&c(e)&&delete n.symbolDescription;var o=i({},t);delete o.style,u.forEach(function(t){return delete o[t]});var a=i({},r);return delete a.style,i(i(i({},a),o),n)}},933(t,r,e){e.d(r,{m:()=>u});var n=e(772);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(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function a(t,r,e){return(r=function(t){var r=function(t){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=o(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var l=function(t,r){return"symbolDescription"in r?r.symbolDescription:(0,n.p_)(r)?void 0:t.symbolDescription},u=function(t,r){var e,n,o,u,s,c,y,f,m,p,d,b,v,h,g,S,_,P=r.style||{},w=(S=t.filter,_=r.filter,S&&_?["all",S,_]:_||S||null);return function(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?i(Object(e),!0).forEach(function(r){a(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):i(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}({id:r.id,label:r.label,stroke:null!==(e=P.stroke)&&void 0!==e?e:t.stroke,strokeWidth:null!==(n=P.strokeWidth)&&void 0!==n?n:t.strokeWidth,strokeDashArray:null!==(o=P.strokeDashArray)&&void 0!==o?o:t.strokeDashArray,opacity:null!==(u=P.opacity)&&void 0!==u?u:t.opacity,keySymbolShape:null!==(s=P.keySymbolShape)&&void 0!==s?s:t.keySymbolShape,symbolDescription:l(t,P),showInKey:null!==(c=r.showInKey)&&void 0!==c?c:t.showInKey,showInMenu:null!==(y=r.showInMenu)&&void 0!==y&&y,filter:w,minZoom:t.minZoom,maxZoom:t.maxZoom,symbol:null!==(f=P.symbol)&&void 0!==f?f:t.symbol,symbolSvgContent:null!==(m=P.symbolSvgContent)&&void 0!==m?m:t.symbolSvgContent,symbolViewBox:null!==(p=P.symbolViewBox)&&void 0!==p?p:t.symbolViewBox,symbolAnchor:null!==(d=P.symbolAnchor)&&void 0!==d?d:t.symbolAnchor,symbolBackgroundColor:null!==(b=P.symbolBackgroundColor)&&void 0!==b?b:t.symbolBackgroundColor,symbolForegroundColor:null!==(v=P.symbolForegroundColor)&&void 0!==v?v:t.symbolForegroundColor,symbolHaloWidth:null!==(h=P.symbolHaloWidth)&&void 0!==h?h:t.symbolHaloWidth,symbolGraphic:null!==(g=P.symbolGraphic)&&void 0!==g?g:t.symbolGraphic},function(t,r){var e,n;return r.fillPattern||r.fillPatternSvgContent?{fillPattern:r.fillPattern,fillPatternSvgContent:r.fillPatternSvgContent,fillPatternForegroundColor:null!==(e=r.fillPatternForegroundColor)&&void 0!==e?e:t.fillPatternForegroundColor,fillPatternBackgroundColor:null!==(n=r.fillPatternBackgroundColor)&&void 0!==n?n:t.fillPatternBackgroundColor}:"fill"in r?{fill:r.fill}:{fill:t.fill,fillPattern:t.fillPattern,fillPatternSvgContent:t.fillPatternSvgContent,fillPatternForegroundColor:t.fillPatternForegroundColor,fillPatternBackgroundColor:t.fillPatternBackgroundColor}}(t,P))}},247(t,r,e){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}e.d(r,{o:()=>o});var o=function(t,r){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===n(t)){if(r&&t[r])return t[r];var e=Object.values(t)[0];return null!=e?e:null}return null}},449(t,r,e){e.d(r,{qS:()=>s,vY:()=>a,zp:()=>u});var n=e(247);function o(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var i=function(t,r,e){return t.replace(/\{\{foregroundColor\}\}/g,r||"black").replace(/\{\{backgroundColor\}\}/g,e||"transparent")},a=function(t){return!(!t.fillPattern&&!t.fillPatternSvgContent)},l=function(t,r){return t.fillPatternSvgContent?t.fillPatternSvgContent:t.fillPattern&&null!==(e=null==r||null===(n=r.get(t.fillPattern))||void 0===n?void 0:n.svgContent)&&void 0!==e?e:null;var e,n},u=function(t,r,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=l(t,e);if(!a)return null;var u=(0,n.o)(t.fillPatternForegroundColor,r)||"black",s=(0,n.o)(t.fillPatternBackgroundColor,r)||"transparent",c=Math.max(2,i);return"pattern-".concat(function(t){var r,e=0,n=function(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,r){if(t){if("string"==typeof t)return o(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return l=t.done,t},e:function(t){u=!0,a=t},f:function(){try{l||null==e.return||e.return()}finally{if(u)throw a}}}}(t);try{for(n.s();!(r=n.n()).done;)e=(e<<5)-e+r.value.codePointAt(0),e&=e}catch(t){n.e(t)}finally{n.f()}return Math.abs(e).toString(36)}(a+u+s),"-").concat(c,"x")},s=function(t,r,e){var o=l(t,e);if(!o)return null;var a=(0,n.o)(t.fillPatternForegroundColor,r)||"black",u=(0,n.o)(t.fillPatternBackgroundColor,r)||"transparent",s=(0,n.o)(t.stroke,r)||a;return{border:i('<path d="M19 2.862v14.275c0 1.028-.835 1.862-1.862 1.862H2.863c-1.028 0-1.862-.835-1.862-1.862V2.862C1.001 1.834 1.836 1 2.863 1h14.275C18.166 1 19 1.835 19 2.862z" fill="{{backgroundColor}}" stroke="{{foregroundColor}}" stroke-width="2"/>',s,u),content:i(o,a,u)}}},121(t,r,e){e.d(r,{Lo:()=>o,Op:()=>u,n8:()=>l,s8:()=>i,sR:()=>a});var n=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),o=function(t){return!(!t.symbol&&!t.symbolSvgContent)},i=function(t,r){return t.symbolSvgContent?{svg:t.symbolSvgContent}:t.symbol?r.get(t.symbol):void 0},a=function(t){if(!o(t))return{};var r={};return n.forEach(function(e){if(null!=t[e]){var n=e.charAt(6).toLowerCase()+e.slice(7);r[n]=t[e]}}),r},l=function(t,r){var e;return t.symbolViewBox?t.symbolViewBox:null!==(e=null==r?void 0:r.viewBox)&&void 0!==e?e:"0 0 38 38"},u=function(t,r){var e;return t.symbolAnchor?t.symbolAnchor:null!==(e=null==r?void 0:r.anchor)&&void 0!==e?e:[.5,.5]}}}]);
|