@defra/interactive-map 0.0.27-alpha → 0.0.29-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/css/index.css +1 -1
- package/dist/esm/im-core.js +1 -1
- package/dist/esm/im-shell.js +1 -1
- package/dist/umd/im-core.js +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
- package/plugins/beta/map-styles/dist/esm/im-map-styles-plugin.js +1 -1
- package/plugins/beta/map-styles/dist/umd/im-map-styles-plugin.js +1 -1
- package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
- package/src/App/components/Hints/Hints.jsx +2 -1
- package/src/App/components/Hints/Hints.test.jsx +2 -2
- package/src/App/components/PopupMenu/PopupMenu.module.scss +6 -0
- package/src/App/controls/keyboardMappings.js +1 -2
- package/src/App/controls/keyboardShortcuts.js +5 -3
- package/src/App/controls/keyboardShortcuts.test.js +24 -0
- package/src/InteractiveMap/deviceChecker.js +3 -2
- package/src/InteractiveMap/deviceChecker.test.js +7 -10
- package/src/config/defaults.js +1 -1
- package/src/utils/htmlToPlainText.js +11 -0
- package/src/utils/htmlToPlainText.test.js +5 -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 E=_.prototype=new g;E.constructor=_,y(E,b.prototype),E.isPureReactComponent=!0;var w=Array.isArray;function P(){}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 T=/\/+/g;function j(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?"."+j(e,0):i,w(a)?(o="",null!=l&&(o=l.replace(T,"$&/")+"/"),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(T,"$&/")+"/")+l,a=O(c.type,s,c.props)),t.push(a)),1;l=0;var f,d=""===i?".":i+":";if(w(e))for(var h=0;h<e.length;h++)l+=x(i=e[h],t,o,u=d+j(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+j(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(P,P):(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 M(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 D="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:M}},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(P,D)}catch(e){D(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:()=>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_UPDATE_MARKER:"app:updatemarker",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_FEATURES:"map:setfeatures",MAP_SET_ACTIVE_FEATURE:"map:setactivefeature",MAP_SELECT_FEATURE:"map:selectfeature",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,Rt:()=>s,xK:()=>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(){return null!==a}function s(e,t){if(!a)throw new Error("ReverseGeocode not initialised");return a(e,t)}},902(e,t,n){n.d(t,{C1:()=>u,Ey:()=>s,ip:()=>c});var r=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",o=new Set,i=new Set;function a(e){r!==e&&(r=e,i.forEach(function(t){return t(e)}),o.forEach(function(t){return t(e)}))}function u(){var e=window.matchMedia("(pointer: coarse)"),t=function(e){a(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";n!==r&&(r=n,i.forEach(function(e){return e(n)}),setTimeout(function(){o.forEach(function(e){return e(n)})},150))},u=function(e){"Tab"===e.key&&a("keyboard")};return window.addEventListener("pointerdown",n,{passive:!0}),window.addEventListener("keydown",u,{passive:!0}),function(){e.removeEventListener("change",t),window.removeEventListener("pointerdown",n),window.removeEventListener("keydown",u)}}function c(){return"unknown"===r?(r="mouse","mouse"):r}function s(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){e._isClosingViaBack=!1;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),0===v.size&&(globalThis.removeEventListener("popstate",d),h=!1)};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 E(e){try{return JSON.parse(e)}catch(e){return console.log(e),null}}function w(e,t){e.innerHTML='<div class="im-c-error">'.concat(t,"</div>")}var P=a(205);function A(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 application",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 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)}var k=["mapViewParamKey"];function T(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?T(Object(n),!0).forEach(function(t){x(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(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"!=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 C=a(902),M=a(233),D=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:"once",value:function(e,t){var n=this,r=function(){n.off(e,r),t.apply(void 0,arguments)};return this.on(e,r)}},{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 U=0;crypto.randomUUID=function(){return U=Math.max(Date.now(),U+1),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e,t){var n=t<12?Number.parseInt(U.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 q=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"})),q(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),Y(this,"_isClosingViaBack",!1),Y(this,"_isLoading",!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||(w(n,i),(0,P.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]=E(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=j(j({},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(){A(e.config)?e.loadApp():e.removeApp()}),"hybrid"===n){var i=null!=r?r:o,a=window.matchMedia("(max-width: ".concat(i,"px)")),u=function(){A(e.config)?e._isHidden?e.showApp():null==e._root?e.loadApp():(0,P.N)(e):e._root&&e.hideApp()};return a.addEventListener("change",u),function(){return a.removeEventListener("change",u)}}return null}(this),A(this.config)?this.loadApp():(0,P.i)()}},{key:"_handleButtonClick",value:function(e){this._isHidden?(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this.showApp()):this._root||(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),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,t=this;if(this.config.manageHistoryState)if(null!==(e=history.state)&&void 0!==e&&e.isBack){if(this._isClosingViaBack)return;this._isClosingViaBack=!0,history.back(),setTimeout(function(){t._isClosingViaBack=!1},1e3)}else{this.config.preserveStateOnClose?this.hideApp():this.removeApp();var n=this.config.mapViewQueryParam,r=this._removeMapParamFromUrl(location.href,n);history.replaceState(history.state,"",r)}else this.config.preserveStateOnClose?this.hideApp():this.removeApp()}},{key:"loadApp",value:(n=$().m(function e(){var t,n,r,o,i,u,c,s,l,f,p=this;return $().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._root&&!this._isLoading){e.n=1;break}return e.a(2);case 1:return this._isLoading=!0,this._openButton&&(this._openButton.style.display="none"),e.p=2,e.n=3,a.e(935).then(a.bind(a,286));case 3:return t=e.v,n=t.initialiseApp,e.n=4,this.config.mapProvider.load();case 4:return r=e.v,o=r.MapProvider,i=r.mapFramework,u=r.mapProviderConfig,this.config.reverseGeocodeProvider&&(0,M.H_)(this.config.reverseGeocodeProvider,u.crs),e.n=5,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 5: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)||(p[e]=c[e])}),(0,P.N)(this),this.eventBus.emit(D.q.APP_OPENED,{statePreserved:!1}),e.n=7;break;case 6:throw e.p=6,f=e.v,null===(l=this._openButton)||void 0===l||l.removeAttribute("style"),w(this.rootEl,this.config.genericErrorText),console.error(f),f;case 7:return e.p=7,this._isLoading=!1,e.f(7);case 8:return e.a(2)}},e,this,[[2,6,7,8]])}),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,P.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,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(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,P.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),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(D.q.APP_ADD_MARKER,{id:e,coords:t,options:n})}},{key:"updateMarker",value:function(e,t){this.eventBus.emit(D.q.APP_UPDATE_MARKER,{id:e,options:t})}},{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&&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})());
|
|
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 E=Array.isArray;function P(){}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 T=/\/+/g;function j(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?"."+j(e,0):i,E(a)?(o="",null!=l&&(o=l.replace(T,"$&/")+"/"),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(T,"$&/")+"/")+l,a=O(c.type,s,c.props)),t.push(a)),1;l=0;var f,d=""===i?".":i+":";if(E(e))for(var h=0;h<e.length;h++)l+=x(i=e[h],t,o,u=d+j(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+j(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(P,P):(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 M(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 D="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:M}},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(P,D)}catch(e){D(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:()=>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_UPDATE_MARKER:"app:updatemarker",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_FEATURES:"map:setfeatures",MAP_SET_ACTIVE_FEATURE:"map:setactivefeature",MAP_SELECT_FEATURE:"map:selectfeature",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"}},0(e,t,n){n.d(t,{v:()=>o});var r="[interactive-map]",o={warn:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(e=console).warn.apply(e,[r].concat(n))},error:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(e=console).error.apply(e,[r].concat(n))}}},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,Rt:()=>s,xK:()=>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(){return null!==a}function s(e,t){if(!a)throw new Error("ReverseGeocode not initialised");return a(e,t)}},902(e,t,n){n.d(t,{C1:()=>u,Ey:()=>s,ip:()=>c});var r=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",o=new Set,i=new Set;function a(e){r!==e&&(r=e,i.forEach(function(t){return t(e)}),o.forEach(function(t){return t(e)}))}function u(){var e=window.matchMedia("(pointer: coarse)"),t=function(e){a(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";n!==r&&(r=n,i.forEach(function(e){return e(n)}),setTimeout(function(){o.forEach(function(e){return e(n)})},150))},u=function(e){"Tab"===e.key&&a("keyboard")};return window.addEventListener("pointerdown",n,{passive:!0}),window.addEventListener("keydown",u,{passive:!0}),function(){e.removeEventListener("change",t),window.removeEventListener("pointerdown",n),window.removeEventListener("keydown",u)}}function c(){return"unknown"===r?(r="mouse","mouse"):r}function s(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:()=>te});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){e._isClosingViaBack=!1;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),0===v.size&&(globalThis.removeEventListener("popstate",d),h=!1)};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 E(e,t){e.innerHTML='<div class="im-c-error">'.concat(t,"</div>")}var P=a(205),A=a(0);function S(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 O={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>Shift</kbd> + <kbd>?</kbd> <span class="im-u-visually-hidden">to view </span>keyboard shortcuts',mapLabel:"Interactive map application",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 k(e){return k="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},k(e)}var T=["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 x(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){C(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 C(e,t,n){return(t=function(e){var t=function(e){if("object"!=k(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==k(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var M=a(902),D=a(233),R=a(12);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 L(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 N(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,H(r.key),r)}}function H(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+""}var I=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 L(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 L(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)?L(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:"once",value:function(e,t){var n=this,r=function(){n.off(e,r),t.apply(void 0,arguments)};return this.on(e,r)}},{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&&N(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();new I;var U=a(901);if("undefined"!=typeof crypto&&!crypto.randomUUID){var F=0;crypto.randomUUID=function(){return F=Math.max(Date.now(),F+1),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e,t){var n=t<12?Number.parseInt(F.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 V=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"})),V(e)}}function $(e){return $="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},$(e)}function G(){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 W(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]())):(W(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,W(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=s,W(f,"constructor",s),W(s,"constructor",c),c.displayName="GeneratorFunction",W(s,o,"GeneratorFunction"),W(f),W(f,o,"Generator"),W(f,r,function(){return this}),W(f,"toString",function(){return"[object Generator]"}),(G=function(){return{w:i,m:p}})()}function W(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}W=function(e,t,n,r){function i(t,n){W(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))},W(e,t,n,r)}function z(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 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 Q(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){Z(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 Y(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,J(r.key),r)}}function Z(e,t,n){return(t=J(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J(e){var t=function(e){if("object"!=$(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=$(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$(t)?t:t+""}var X=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),Z(this,"_openButton",null),Z(this,"_root",null),Z(this,"_breakpointDetector",null),Z(this,"_interfaceDetectorCleanup",null),Z(this,"_hybridBehaviourCleanup",null),Z(this,"_isHidden",!1),Z(this,"_isClosingViaBack",!1),Z(this,"_isLoading",!1),this.id=t,this.rootEl=document.getElementById(t),!this.rootEl)throw new Error('Element with id "'.concat(t,'" not found'));this.eventBus=new I,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,P.i)(),A.v.warn(null==a?void 0:a.error),0):(A.v.warn("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,M.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,T),r=x(x({},O),n);return void 0!==t&&(console.warn("[InteractiveMap] mapViewParamKey is deprecated — use mapViewQueryParam instead."),r.mapViewQueryParam=t),r}(Q(Q({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(){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,P.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,P.i)()}},{key:"_handleButtonClick",value:function(e){this._isHidden?(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this.showApp()):this._root||(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),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,t=this;if(this.config.manageHistoryState)if(null!==(e=history.state)&&void 0!==e&&e.isBack){if(this._isClosingViaBack)return;this._isClosingViaBack=!0,history.back(),setTimeout(function(){t._isClosingViaBack=!1},1e3)}else{this.config.preserveStateOnClose?this.hideApp():this.removeApp();var n=this.config.mapViewQueryParam,r=this._removeMapParamFromUrl(location.href,n);history.replaceState(history.state,"",r)}else this.config.preserveStateOnClose?this.hideApp():this.removeApp()}},{key:"loadApp",value:(n=G().m(function e(){var t,n,r,o,i,u,c,s,l,f,p=this;return G().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._root&&!this._isLoading){e.n=1;break}return e.a(2);case 1:return this._isLoading=!0,this._openButton&&(this._openButton.style.display="none"),e.p=2,e.n=3,a.e(935).then(a.bind(a,455));case 3:return t=e.v,n=t.initialiseApp,e.n=4,this.config.mapProvider.load();case 4: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=5,n(this.rootEl,Q(Q({id:this.id,initialBreakpoint:this._breakpointDetector.getBreakpoint(),initialInterfaceType:(0,M.ip)()},this.config),{},{MapProvider:o,mapProviderConfig:u,mapFramework:i,eventBus:this.eventBus,breakpointDetector:this._breakpointDetector,handleExitClick:this._handleExitClick.bind(this)}));case 5: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)||(p[e]=c[e])}),(0,P.N)(this),this.eventBus.emit(R.q.APP_OPENED,{statePreserved:!1}),e.n=7;break;case 6:throw e.p=6,f=e.v,null===(l=this._openButton)||void 0===l||l.removeAttribute("style"),E(this.rootEl,this.config.genericErrorText),console.error(f),f;case 7:return e.p=7,this._isLoading=!1,e.f(7);case 8:return e.a(2)}},e,this,[[2,6,7,8]])}),r=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){z(i,r,o,a,u,"next",e)}function u(e){z(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,P.N)(this,{isFullscreen:!1}),this.eventBus.emit(R.q.APP_CLOSED,{statePreserved:!1}),this.eventBus.emit(R.q.MAP_DESTROY,{mapId:this.id})}},{key:"hideApp",value:function(){this._isHidden=!0,this.rootEl.style.display="none",(0,U.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(R.q.APP_CLOSED,{statePreserved:!0})}},{key:"showApp",value:function(){this._isHidden=!1,this.rootEl.style.display="",this._openButton&&(this._openButton.style.display="none"),(0,P.N)(this),this.eventBus.emit(R.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(R.q.APP_ADD_MARKER,{id:e,coords:t,options:n})}},{key:"updateMarker",value:function(e,t){this.eventBus.emit(R.q.APP_UPDATE_MARKER,{id:e,options:t})}},{key:"removeMarker",value:function(e){this.eventBus.emit(R.q.APP_REMOVE_MARKER,e)}},{key:"setMode",value:function(e){this.eventBus.emit(R.q.APP_SET_MODE,e)}},{key:"addButton",value:function(e,t){this.eventBus.emit(R.q.APP_ADD_BUTTON,{id:e,config:t})}},{key:"toggleButtonState",value:function(e,t,n){this.eventBus.emit(R.q.APP_TOGGLE_BUTTON_STATE,{id:e,prop:t,value:n})}},{key:"addPanel",value:function(e,t){this.eventBus.emit(R.q.APP_ADD_PANEL,{id:e,config:t})}},{key:"removePanel",value:function(e){this.eventBus.emit(R.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(R.q.APP_SHOW_PANEL,{id:e,focus:n})}},{key:"hidePanel",value:function(e){this.eventBus.emit(R.q.APP_HIDE_PANEL,e)}},{key:"addControl",value:function(e,t){this.eventBus.emit(R.q.APP_ADD_CONTROL,{id:e,config:t})}},{key:"fitToBounds",value:function(e){this.eventBus.emitWhenReady(R.q.MAP_FIT_TO_BOUNDS,e)}},{key:"setView",value:function(e){this.eventBus.emitWhenReady(R.q.MAP_SET_VIEW,e)}},{key:"open",value:function(){this._isHidden?this.showApp():this._root||this.loadApp()}},{key:"close",value:function(){this._handleExitClick()}}],t&&Y(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r}(),ee="undefined"==typeof window?globalThis:window;ee.defra=ee.defra||{},ee.preactCompat=c,ee.preactJsxRuntime=l,ee.preactHooks={useState:c.useState},ee.defra.InteractiveMap=X,ee.preactCompat.default||(ee.preactCompat.default=ee.preactCompat),ee.preactCompat.createRoot||(ee.preactCompat.createRoot=function(e){return{render:function(t){ee.preactCompat.render(t,e)},unmount:function(){ee.preactCompat.render(null,e)}}});const te=X;return u.default})());
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as e,useContext as t,createContext as i,useState as
|
|
1
|
+
import{useEffect as e,useContext as t,createContext as i,useState as a,useCallback as l}from"preact/compat";import{jsx as s,Fragment as r,jsxs as m}from"preact/jsx-runtime";import o from"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/objectWithoutProperties";var p="app:ready",n="map:setstyle",c="map:setsize",d="map:setpixelratio",b="map:initmapstyles";var h,v;var u=/mac/i.test(null!==(h=null===(v=navigator.userAgentData)||void 0===v?void 0:v.platform)&&void 0!==h?h:navigator.platform)?"<kbd>Option</kbd>":"<kbd>Alt</kbd>";"".concat(u," + <kbd>Enter</kbd>"),"".concat(u," + <kbd>→</kbd>, <kbd>←</kbd>, <kbd>↑</kbd> or <kbd>↓</kbd>"),new Set;function y(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,a)}return i}function f(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?y(Object(i),!0).forEach(function(t){o(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}var g={slot:"middle",open:!1,dismissible:!0,modal:!0};f({},g),f(f({},g),{},{width:"500px"}),f(f({},g),{},{width:"500px"});var _={small:1,medium:1.5,large:2},w={InitComponent:function(t){var{pluginConfig:i,services:a}=t,{eventBus:l}=a,m=()=>{l.emit(b,i.mapStyles)};return e(()=>(l.on(p,m),()=>l.off(p,m)),[]),s(r,{})},panels:[{id:"mapStyles",label:"Map styles",mobile:{slot:"drawer",modal:!0,dismissible:!0},tablet:{slot:"left-top",modal:!0,width:"400px",dismissible:!0},desktop:{slot:"left-top",modal:!0,width:"400px",dismissible:!0},render:e=>{var{mapState:t,pluginConfig:i,services:a,mapProvider:l}=e,{mapStyle:r,mapSize:o}=t,{mapStyles:p}=i,{eventBus:b}=a,{supportsMapSizes:h}=l.capabilities;return m("div",{className:"im-c-map-styles",children:[s("div",{className:"im-c-map-styles__group",children:s("div",{className:"im-c-map-styles__inner",children:p.filter(e=>e.url).map(e=>s("div",{className:"im-c-map-styles__item",children:m("button",{className:"im-c-map-styles__button","aria-pressed":e.id===r.id,onClick:()=>{return t=e,void b.emit(n,t);var t},children:[s("div",{className:"im-c-map-styles__image",children:s("img",{src:e.thumbnail||void 0,alt:"",height:"60",width:"60"})}),e.label]})},e.id))})}),h&&m("div",{className:"im-c-map-styles__group",children:[s("h3",{className:"im-c-map-styles__heading",id:"map-text-sizes",children:"Map size"}),s("div",{className:"im-c-map-styles__inner",children:["small","medium","large"].map(e=>s("div",{className:"im-c-map-styles__item",children:m("button",{className:"im-c-map-styles__button",onClick:()=>{return t=e,b.emit(c,t),void b.emit(d,window.devicePixelRatio*_[t]);var t},"aria-pressed":e===o,children:[s("div",{className:"im-c-map-styles__image",children:m("svg",{width:"60",height:"60",viewBox:"0 0 60 60",fillRule:"evenodd",children:[s("rect",{className:"im-c-map-styles__image-bg",width:"100%",height:"100%"}),s("g",{style:{transform:"scale(".concat(_[e],")"),transformOrigin:"8px 52px"},children:s("path",{d:"M8 51.785L12.948 38.9h1.837l5.274 12.885h-1.943l-1.503-3.903h-5.387l-1.415 3.903H8zm3.718-5.291h4.368l-1.345-3.569-.914-2.671c-.164.826-.395 1.646-.694 2.46l-1.415 3.78zm15.592 4.139c-3.698 3.143-7.836.271-6.315-2.562.963-1.794 5.529-1.982 6.183-2.21.022-.825.052-2.27-2.241-2.312-1.751-.031-2.242 1.025-2.435 1.776l-1.547-.211c.234-1.102.963-2.856 4.21-2.874 4.037-.022 3.612 2.962 3.612 3.524v2.11c0 .315 0 3.012.501 3.911h-1.652c-.164-.328-.27-.712-.316-1.152zm-.132-3.533c-.907.37-3.444.694-3.964.914-1.293.548-.911 2.399.225 2.637.639.134 3.739.476 3.739-2.971v-.58z"})})]})}),e[0].toUpperCase()+e.slice(1)]})},e))})]})]})}}],buttons:[{id:"mapStyles",label:"Styles",panelId:"mapStyles",iconId:"map",mobile:{slot:"top-left",showLabel:!1},tablet:{slot:"top-left",showLabel:!0},desktop:{slot:"top-left",showLabel:!0}}],icons:[{id:"map",svgContent:'<path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/>'}]};export{w as manifest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[657],{561(e,t,i){i.r(t),i.d(t,{manifest:()=>
|
|
1
|
+
"use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[657],{561(e,t,i){i.r(t),i.d(t,{manifest:()=>f});var s,r,a=i(738),n="app:ready",l=i(287),o=/mac/i.test(null!==(s=null===(r=navigator.userAgentData)||void 0===r?void 0:r.platform)&&void 0!==s?s:navigator.platform)?"<kbd>Option</kbd>":"<kbd>Alt</kbd>";"".concat(o," + <kbd>Enter</kbd>"),"".concat(o," + <kbd>→</kbd>, <kbd>←</kbd>, <kbd>↑</kbd> or <kbd>↓</kbd>");new Set,new Set;function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function m(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,s)}return i}function p(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?m(Object(i),!0).forEach(function(t){d(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):m(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function d(e,t,i){return(t=function(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=c(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var u={slot:"middle",open:!1,dismissible:!0,modal:!0},b=(p({},u),p(p({},u),{},{width:"500px"}),p(p({},u),{},{width:"500px"}),{small:1,medium:1.5,large:2}),f={InitComponent:function(e){var t=e.pluginConfig,i=e.services.eventBus,s=function(){i.emit("map:initmapstyles",t.mapStyles)};return(0,a.useEffect)(function(){return i.on(n,s),function(){return i.off(n,s)}},[]),(0,l.jsx)(l.Fragment,{})},panels:[{id:"mapStyles",label:"Map styles",mobile:{slot:"drawer",modal:!0,dismissible:!0},tablet:{slot:"left-top",modal:!0,width:"400px",dismissible:!0},desktop:{slot:"left-top",modal:!0,width:"400px",dismissible:!0},render:function(e){var t=e.mapState,i=e.pluginConfig,s=e.services,r=e.mapProvider,a=t.mapStyle,n=t.mapSize,o=i.mapStyles,c=s.eventBus,m=r.capabilities.supportsMapSizes;return(0,l.jsxs)("div",{className:"im-c-map-styles",children:[(0,l.jsx)("div",{className:"im-c-map-styles__group",children:(0,l.jsx)("div",{className:"im-c-map-styles__inner",children:o.filter(function(e){return e.url}).map(function(e){return(0,l.jsx)("div",{className:"im-c-map-styles__item",children:(0,l.jsxs)("button",{className:"im-c-map-styles__button","aria-pressed":e.id===a.id,onClick:function(){return t=e,void c.emit("map:setstyle",t);var t},children:[(0,l.jsx)("div",{className:"im-c-map-styles__image",children:(0,l.jsx)("img",{src:e.thumbnail||void 0,alt:"",height:"60",width:"60"})}),e.label]})},e.id)})})}),m&&(0,l.jsxs)("div",{className:"im-c-map-styles__group",children:[(0,l.jsx)("h3",{className:"im-c-map-styles__heading",id:"map-text-sizes",children:"Map size"}),(0,l.jsx)("div",{className:"im-c-map-styles__inner",children:["small","medium","large"].map(function(e){return(0,l.jsx)("div",{className:"im-c-map-styles__item",children:(0,l.jsxs)("button",{className:"im-c-map-styles__button",onClick:function(){return t=e,c.emit("map:setsize",t),void c.emit("map:setpixelratio",window.devicePixelRatio*b[t]);var t},"aria-pressed":e===n,children:[(0,l.jsx)("div",{className:"im-c-map-styles__image",children:(0,l.jsxs)("svg",{width:"60",height:"60",viewBox:"0 0 60 60",fillRule:"evenodd",children:[(0,l.jsx)("rect",{className:"im-c-map-styles__image-bg",width:"100%",height:"100%"}),(0,l.jsx)("g",{style:{transform:"scale(".concat(b[e],")"),transformOrigin:"8px 52px"},children:(0,l.jsx)("path",{d:"M8 51.785L12.948 38.9h1.837l5.274 12.885h-1.943l-1.503-3.903h-5.387l-1.415 3.903H8zm3.718-5.291h4.368l-1.345-3.569-.914-2.671c-.164.826-.395 1.646-.694 2.46l-1.415 3.78zm15.592 4.139c-3.698 3.143-7.836.271-6.315-2.562.963-1.794 5.529-1.982 6.183-2.21.022-.825.052-2.27-2.241-2.312-1.751-.031-2.242 1.025-2.435 1.776l-1.547-.211c.234-1.102.963-2.856 4.21-2.874 4.037-.022 3.612 2.962 3.612 3.524v2.11c0 .315 0 3.012.501 3.911h-1.652c-.164-.328-.27-.712-.316-1.152zm-.132-3.533c-.907.37-3.444.694-3.964.914-1.293.548-.911 2.399.225 2.637.639.134 3.739.476 3.739-2.971v-.58z"})})]})}),e[0].toUpperCase()+e.slice(1)]})},e)})})]})]})}}],buttons:[{id:"mapStyles",label:"Styles",panelId:"mapStyles",iconId:"map",mobile:{slot:"top-left",showLabel:!1},tablet:{slot:"top-left",showLabel:!0},desktop:{slot:"top-left",showLabel:!0}}],icons:[{id:"map",svgContent:'<path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/>'}]}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/objectWithoutProperties";import{useContext as t,createContext as r,useState as n,useCallback as o,useRef as i,useEffect as a,useMemo as l}from"preact/compat";import{jsxs as s,jsx as c}from"preact/jsx-runtime";var u={APP_ADD_MARKER:"app:addmarker",APP_UPDATE_MARKER:"app:updatemarker",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_FEATURES:"map:setfeatures",MAP_SET_ACTIVE_FEATURE:"map:setactivefeature",MAP_SELECT_FEATURE:"map:selectfeature",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"};function p(e,t,r={}){const n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function d(e,t,r={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!g(e[0])||!g(e[1]))throw new Error("coordinates must contain numbers");return p({type:"Point",coordinates:e},t,r)}function f(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return p({type:"LineString",coordinates:e},t,r)}function v(e,t={}){const r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function y(e,t,r={}){return p({type:"MultiLineString",coordinates:e},t,r)}function g(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}const m=11102230246251565e-32,E=134217729,h=(3+8*m)*m;function S(e,t,r,n,o){let i,a,l,s,c=t[0],u=n[0],p=0,d=0;u>c==u>-c?(i=c,c=t[++p]):(i=u,u=n[++d]);let f=0;if(p<e&&d<r)for(u>c==u>-c?(a=c+i,l=i-(a-c),c=t[++p]):(a=u+i,l=i-(a-u),u=n[++d]),i=a,0!==l&&(o[f++]=l);p<e&&d<r;)u>c==u>-c?(a=i+c,s=a-i,l=i-(a-s)+(c-s),c=t[++p]):(a=i+u,s=a-i,l=i-(a-s)+(u-s),u=n[++d]),i=a,0!==l&&(o[f++]=l);for(;p<e;)a=i+c,s=a-i,l=i-(a-s)+(c-s),c=t[++p],i=a,0!==l&&(o[f++]=l);for(;d<r;)a=i+u,s=a-i,l=i-(a-s)+(u-s),u=n[++d],i=a,0!==l&&(o[f++]=l);return 0===i&&0!==f||(o[f++]=i),f}function b(e){return new Float64Array(e)}const P=b(4),A=b(8),O=b(12),_=b(16),w=b(4);function M(e,t,r,n,o,i){const a=(t-i)*(r-o),l=(e-o)*(n-i),s=a-l,c=Math.abs(a+l);return Math.abs(s)>=33306690738754716e-32*c?s:-function(e,t,r,n,o,i,a){let l,s,c,u,p,d,f,v,y,g,m,b,M,k,T,I,C,L;const F=e-o,D=r-o,R=t-i,j=n-i;k=F*j,d=E*F,f=d-(d-F),v=F-f,d=E*j,y=d-(d-j),g=j-y,T=v*g-(k-f*y-v*y-f*g),I=R*D,d=E*R,f=d-(d-R),v=R-f,d=E*D,y=d-(d-D),g=D-y,C=v*g-(I-f*y-v*y-f*g),m=T-C,p=T-m,P[0]=T-(m+p)+(p-C),b=k+m,p=b-k,M=k-(b-p)+(m-p),m=M-I,p=M-m,P[1]=M-(m+p)+(p-I),L=b+m,p=L-b,P[2]=b-(L-p)+(m-p),P[3]=L;let x=function(e,t){let r=t[0];for(let n=1;n<e;n++)r+=t[n];return r}(4,P),B=22204460492503146e-32*a;if(x>=B||-x>=B)return x;if(p=e-F,l=e-(F+p)+(p-o),p=r-D,c=r-(D+p)+(p-o),p=t-R,s=t-(R+p)+(p-i),p=n-j,u=n-(j+p)+(p-i),0===l&&0===s&&0===c&&0===u)return x;if(B=11093356479670487e-47*a+h*Math.abs(x),x+=F*u+j*l-(R*c+D*s),x>=B||-x>=B)return x;k=l*j,d=E*l,f=d-(d-l),v=l-f,d=E*j,y=d-(d-j),g=j-y,T=v*g-(k-f*y-v*y-f*g),I=s*D,d=E*s,f=d-(d-s),v=s-f,d=E*D,y=d-(d-D),g=D-y,C=v*g-(I-f*y-v*y-f*g),m=T-C,p=T-m,w[0]=T-(m+p)+(p-C),b=k+m,p=b-k,M=k-(b-p)+(m-p),m=M-I,p=M-m,w[1]=M-(m+p)+(p-I),L=b+m,p=L-b,w[2]=b-(L-p)+(m-p),w[3]=L;const N=S(4,P,4,w,A);k=F*u,d=E*F,f=d-(d-F),v=F-f,d=E*u,y=d-(d-u),g=u-y,T=v*g-(k-f*y-v*y-f*g),I=R*c,d=E*R,f=d-(d-R),v=R-f,d=E*c,y=d-(d-c),g=c-y,C=v*g-(I-f*y-v*y-f*g),m=T-C,p=T-m,w[0]=T-(m+p)+(p-C),b=k+m,p=b-k,M=k-(b-p)+(m-p),m=M-I,p=M-m,w[1]=M-(m+p)+(p-I),L=b+m,p=L-b,w[2]=b-(L-p)+(m-p),w[3]=L;const G=S(N,A,4,w,O);k=l*u,d=E*l,f=d-(d-l),v=l-f,d=E*u,y=d-(d-u),g=u-y,T=v*g-(k-f*y-v*y-f*g),I=s*c,d=E*s,f=d-(d-s),v=s-f,d=E*c,y=d-(d-c),g=c-y,C=v*g-(I-f*y-v*y-f*g),m=T-C,p=T-m,w[0]=T-(m+p)+(p-C),b=k+m,p=b-k,M=k-(b-p)+(m-p),m=M-I,p=M-m,w[1]=M-(m+p)+(p-I),L=b+m,p=L-b,w[2]=b-(L-p)+(m-p),w[3]=L;const U=S(G,O,4,w,_);return _[U-1]}(e,t,r,n,o,i,c)}function k(e,t){var r,n,o,i,a,l,s,c,u,p=0,d=e[0],f=e[1],v=t.length;for(r=0;r<v;r++){n=0;var y=t[r],g=y.length-1;if((c=y[0])[0]!==y[g][0]&&c[1]!==y[g][1])throw new Error("First and last coordinates in a ring must be the same");for(i=c[0]-d,a=c[1]-f;n<g;n++){if(l=(u=y[n+1])[0]-d,s=u[1]-f,0===a&&0===s){if(l<=0&&i>=0||i<=0&&l>=0)return 0}else if(s>=0&&a<=0||s<=0&&a>=0){if(0===(o=M(i,l,a,s,0,0)))return 0;(o>0&&s>0&&a<=0||o<0&&s<=0&&a>0)&&p++}c=u,a=s,i=l}}return p%2!=0}function T(e){return"Feature"===e.type?e.geometry:e}function I(e,t,r={}){if(!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");const n=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e),o=T(t),i=o.type,a=t.bbox;let l=o.coordinates;if(a&&!1===function(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}(n,a))return!1;"Polygon"===i&&(l=[l]);let s=!1;for(var c=0;c<l.length;++c){const e=k(n,l[c]);if(0===e)return!r.ignoreBoundary;e&&(s=!0)}return s}class C{constructor(e=[],t=L){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const o=e-1>>1,i=t[o];if(r(n,i)>=0)break;t[e]=i,e=o}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,o=t[e];for(;e<n;){let n=1+(e<<1),i=t[n];const a=n+1;if(a<this.length&&r(t[a],i)<0&&(n=a,i=t[a]),r(i,o)>=0)break;t[e]=i,e=n}t[e]=o}}function L(e,t){return e<t?-1:e>t?1:0}function F(e,t){return e.p.x>t.p.x?1:e.p.x<t.p.x?-1:e.p.y!==t.p.y?e.p.y>t.p.y?1:-1:1}function D(e,t){return e.rightSweepEvent.p.x>t.rightSweepEvent.p.x?1:e.rightSweepEvent.p.x<t.rightSweepEvent.p.x?-1:e.rightSweepEvent.p.y!==t.rightSweepEvent.p.y?e.rightSweepEvent.p.y<t.rightSweepEvent.p.y?1:-1:1}class R{constructor(e,t,r,n){this.p={x:e[0],y:e[1]},this.featureId=t,this.ringId=r,this.eventId=n,this.otherEvent=null,this.isLeftEndpoint=null}isSamePoint(e){return this.p.x===e.p.x&&this.p.y===e.p.y}}let j=0,x=0,B=0;function N(e,t){const r="Feature"===e.type?e.geometry:e;let n=r.coordinates;"Polygon"!==r.type&&"MultiLineString"!==r.type||(n=[n]),"LineString"===r.type&&(n=[[n]]);for(let e=0;e<n.length;e++)for(let r=0;r<n[e].length;r++){let o=n[e][r][0],i=null;x+=1;for(let a=0;a<n[e][r].length-1;a++){i=n[e][r][a+1];const l=new R(o,j,x,B),s=new R(i,j,x,B+1);l.otherEvent=s,s.otherEvent=l,F(l,s)>0?(s.isLeftEndpoint=!0,l.isLeftEndpoint=!1):(l.isLeftEndpoint=!0,s.isLeftEndpoint=!1),t.push(l),t.push(s),o=i,B+=1}}j+=1}class G{constructor(e){this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}}function U(e,t){if(null===e||null===t)return!1;if(e.leftSweepEvent.ringId===t.leftSweepEvent.ringId&&(e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.rightSweepEvent)||e.leftSweepEvent.isSamePoint(t.leftSweepEvent)||e.leftSweepEvent.isSamePoint(t.rightSweepEvent)))return!1;const r=e.leftSweepEvent.p.x,n=e.leftSweepEvent.p.y,o=e.rightSweepEvent.p.x,i=e.rightSweepEvent.p.y,a=t.leftSweepEvent.p.x,l=t.leftSweepEvent.p.y,s=t.rightSweepEvent.p.x,c=t.rightSweepEvent.p.y,u=(c-l)*(o-r)-(s-a)*(i-n),p=(s-a)*(n-l)-(c-l)*(r-a),d=(o-r)*(n-l)-(i-n)*(r-a);if(0===u)return!1;const f=p/u,v=d/u;if(f>=0&&f<=1&&v>=0&&v<=1){return[r+f*(o-r),n+f*(i-n)]}return!1}var V=function(e,t){const r=new C([],F);return function(e,t){if("FeatureCollection"===e.type){const r=e.features;for(let e=0;e<r.length;e++)N(r[e],t)}else N(e,t)}(e,r),function(e,t){t=t||!1;const r=[],n=new C([],D);for(;e.length;){const o=e.pop();if(o.isLeftEndpoint){const e=new G(o);for(let i=0;i<n.data.length;i++){const a=n.data[i];if(t&&a.leftSweepEvent.featureId===o.featureId)continue;const l=U(e,a);!1!==l&&r.push(l)}n.push(e)}else!1===o.isLeftEndpoint&&n.pop()}return r}(r,t)};function H(e,t,r={}){const{removeDuplicates:n=!0,ignoreSelfIntersections:o=!0}=r;let i=[];"FeatureCollection"===e.type?i=i.concat(e.features):"Feature"===e.type?i.push(e):"LineString"!==e.type&&"Polygon"!==e.type&&"MultiLineString"!==e.type&&"MultiPolygon"!==e.type||i.push(p(e)),"FeatureCollection"===t.type?i=i.concat(t.features):"Feature"===t.type?i.push(t):"LineString"!==t.type&&"Polygon"!==t.type&&"MultiLineString"!==t.type&&"MultiPolygon"!==t.type||i.push(p(t));const a=V(v(i),o);let l=[];if(n){const e={};a.forEach(t=>{const r=t.join(",");e[r]||(e[r]=!0,l.push(t))})}else l=a;return v(l.map(e=>d(e)))}function K(e,t){!function(e,t){var r,n,o,i,a,l,s,c,u,p,d=0,f="FeatureCollection"===e.type,v="Feature"===e.type,y=f?e.features.length:1;for(r=0;r<y;r++){for(l=f?e.features[r].geometry:v?e.geometry:e,c=f?e.features[r].properties:v?e.properties:{},u=f?e.features[r].bbox:v?e.bbox:void 0,p=f?e.features[r].id:v?e.id:void 0,a=(s=!!l&&"GeometryCollection"===l.type)?l.geometries.length:1,o=0;o<a;o++)if(null!==(i=s?l.geometries[o]:l))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(i,d,c,u,p))return!1;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===t(i.geometries[n],d,c,u,p))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,c,u,p))return!1;d++}}(e,function(e,r,n,o,i){var a,l=null===e?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==t(p(e,n,{bbox:o,id:i}),r,0)&&void 0}switch(l){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var s=0;s<e.coordinates.length;s++){var c=e.coordinates[s];if(!1===t(p({type:a,coordinates:c},n),r,s))return!1}})}function W(e,t={}){const r=T(e);switch(t.properties||"Feature"!==e.type||(t.properties=e.properties),r.type){case"Polygon":return function(e,t={}){const r=T(e),n=r.coordinates,o=t.properties?t.properties:"Feature"===e.type?e.properties:{};return Y(n,o)}(r,t);case"MultiPolygon":return function(e,t={}){const r=T(e),n=r.coordinates,o=t.properties?t.properties:"Feature"===e.type?e.properties:{},i=[];return n.forEach(e=>{i.push(Y(e,o))}),v(i)}(r,t);default:throw new Error("invalid poly")}}function Y(e,t){return e.length>1?y(e,t):f(e[0],t)}function q(e,t){for(let r=0;r<e.coordinates.length-1;r++)if(X(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}function z(e,t,r){for(const r of t.coordinates)if(I(r,e))return!0;return H(t,W(e),{ignoreSelfIntersections:r}).features.length>0}function X(e,t,r){const n=r[0]-e[0],o=r[1]-e[1],i=t[0]-e[0],a=t[1]-e[1];return 0===n*a-o*i&&(Math.abs(i)>=Math.abs(a)?i>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:a>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1])}var J=function(e,t,{ignoreSelfIntersections:r=!0}={ignoreSelfIntersections:!0}){let n=!0;return K(e,e=>{K(t,t=>{if(!1===n)return!1;n=function(e,t,r){switch(e.type){case"Point":switch(t.type){case"Point":return n=e.coordinates,o=t.coordinates,!(n[0]===o[0]&&n[1]===o[1]);case"LineString":return!q(t,e);case"Polygon":return!I(e,t)}break;case"LineString":switch(t.type){case"Point":return!q(e,t);case"LineString":return!function(e,t,r){const n=H(e,t,{ignoreSelfIntersections:r});if(n.features.length>0)return!0;return!1}(e,t,r);case"Polygon":return!z(t,e,r)}break;case"Polygon":switch(t.type){case"Point":return!I(t,e);case"LineString":return!z(e,t,r);case"Polygon":return!function(e,t,r){for(const r of e.coordinates[0])if(I(r,t))return!0;for(const r of t.coordinates[0])if(I(r,e))return!0;const n=H(W(e),W(t),{ignoreSelfIntersections:r});if(n.features.length>0)return!0;return!1}(t,e,r)}}var n,o;return!1}(e.geometry,t.geometry,r)})}),n};function Z(e){var t=e.geometry||e;switch(t.type){case"Polygon":return function(e,t,r={}){for(const t of e){if(t.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(t[t.length-1].length!==t[0].length)throw new Error("First and last Position are not equivalent.");for(let e=0;e<t[t.length-1].length;e++)if(t[t.length-1][e]!==t[0][e])throw new Error("First and last Position are not equivalent.")}return p({type:"Polygon",coordinates:e},t,r)}(t.coordinates);case"MultiPolygon":return function(e,t,r={}){return p({type:"MultiPolygon",coordinates:e},t,r)}(t.coordinates);case"LineString":return f(t.coordinates);case"MultiLineString":return y(t.coordinates);case"Point":return d(t.coordinates);case"MultiPoint":return function(e,t,r={}){return p({type:"MultiPoint",coordinates:e},t,r)}(t.coordinates);default:throw new Error("Unsupported geometry type: ".concat(t.type))}}function Q(e,t){return t.some(t=>!J(Z(t),Z(e)))}function $(e){if(e.length<2)return!1;if(e.some(e=>{var t;return!(null!==(t=e.geometry)&&void 0!==t&&t.type)}))return!1;for(var t=new Set([0]),r=!0;r;){r=!1;for(var n=1;n<e.length;n++)if(!t.has(n)){var o=[...t].map(t=>e[t]);Q(e[n],o)&&(t.add(n),r=!0)}}return t.size===e.length}var ee=e=>{var t={};for(var r of e)t[r.layerId]=r;return t},te=(e,t,r)=>{try{return(null==e?void 0:e.getFeaturesAtPoint(t,r))||[]}catch(e){return console.warn("Feature query failed:",e),[]}},re=e=>{var t,r=null===(t=e.geometry)||void 0===t?void 0:t.type;return"Point"===r||"MultiPoint"===r};var ne=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",oe=new Set;new Set;function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ae(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ie(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var le={slot:"middle",open:!1,dismissible:!0,modal:!0};ae({},le),ae(ae({},le),{},{width:"500px"}),ae(ae({},le),{},{width:"500px"});var se={small:1,medium:1.5,large:2},ce=e=>!!e.label&&(!e.symbol&&!e.symbolSvgContent&&(null===e.symbol||null===e.symbolSvgContent));function ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function pe(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ue(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var de=(e,t,r,n)=>({featureId:e,multiSelect:t,layerId:r.layerId,idProperty:r.idProperty,properties:n.properties,geometry:n.geometry}),fe=e=>{var t,{featureId:r,feature:n,config:o,selectedFeatures:i,dispatch:a,multiSelect:l}=e;if(!i.length)return!1;var s=i.findIndex(e=>e.featureId===r&&e.layerId===o.layerId);if(-1!==s){if(i.length<3)return!1;var c=(e=>{for(var t=new Set([0]),r=!0;r;){r=!1;for(var n=1;n<e.length;n++){var o;if(!t.has(n)){var i=[...t].map(t=>e[t]);null!==(o=e[n].geometry)&&void 0!==o&&o.type&&Q(e[n],i)&&(t.add(n),r=!0)}}}return t.size===e.length?null:[...t].map(t=>e[t])})(i.filter((e,t)=>t!==s));return!!c&&(a({type:"SET_SELECTED_FEATURES",payload:c}),!0)}var u=i.filter(e=>{var t;return null===(t=e.geometry)||void 0===t?void 0:t.type});return!(null===(t=n.geometry)||void 0===t||!t.type||!u.length)&&(!Q(n,u)&&(a({type:"TOGGLE_SELECTED_FEATURES",payload:pe(pe({},de(r,l,o,n)),{},{replaceAll:!0})}),!0))},ve=e=>{var{mapProvider:t,layers:r,interactionModes:n,multiSelect:i,dispatch:a,markers:l,layerConfigMap:s,debug:c,tolerance:u,processFeatureMatch:p,processFallback:d,scale:f}=e;return o(e=>{var{point:o,coords:v}=e,y=c?te(t,o,{radius:u}):null;if(y&&console.log("--- Features at ".concat(v," ---"),y),n.includes("selectMarker")){var g=((e,t,r)=>{for(var n of e.items){var o,i=null===(o=e.markerRefs)||void 0===o?void 0:o.get(n.id);if(i&&!ce(n)){var a=i.closest(".im-c-viewport__markers")||i.parentElement,l=a?a.getBoundingClientRect():{left:0,top:0},{left:s,top:c,right:u,bottom:p}=i.getBoundingClientRect(),d=t.x*r,f=t.y*r;if(d>=s-l.left&&d<=u-l.left&&f>=c-l.top&&f<=p-l.top)return n.id}}return null})(l,o,f);if(g)return void a({type:"TOGGLE_SELECTED_MARKERS",payload:{markerId:g,multiSelect:i}})}if(n.includes("selectFeature")&&r.length>0){var m=((e,t)=>{var r=e.filter(e=>{var r;return t[null===(r=e.layer)||void 0===r?void 0:r.id]}),n=r.find(re);if(n)return{feature:n,config:t[n.layer.id]};var o=r[0];return o?{feature:o,config:t[o.layer.id]}:null})(null!=y?y:te(t,o,{radius:u}),s);if(m)return void p(m)}d({coords:v})},[t,r,n,i,a,l,s,c,u,p,d,f])},ye=e=>{var t,{mapState:r,pluginState:n,services:l,mapProvider:s}=e,{markers:c,mapSize:u}=r,{dispatch:p,layers:d,interactionModes:f,multiSelect:v,contiguous:y,marker:g,tolerance:m,selectedFeatures:E,selectedMarkers:h,selectionBounds:S,deselectOnClickOutside:b}=n,{eventBus:P}=l,A=ee(d),O=null!==(t=se[u])&&void 0!==t?t:1,_=o(e=>{var t,r,n,{feature:o,config:i}=e;c.remove("location");var a=null!==(t=null===(r=o.properties)||void 0===r?void 0:r[i.idProperty])&&void 0!==t?t:o.id;if(null!=a){var l=null===(n=s.getFeatureGeometry)||void 0===n?void 0:n.call(s,i.layerId,a,i.idProperty),u=l?pe(pe({},o),{},{geometry:l}):o;if(y&&v)if(fe({featureId:a,feature:u,config:i,selectedFeatures:E,dispatch:p,multiSelect:v}))return;p({type:"TOGGLE_SELECTED_FEATURES",payload:de(a,v,i,u)})}},[c,p,v,y,E,s]),w=o(e=>{var{coords:t}=e,r=f.includes("placeMarker");(r||b)&&(p({type:"CLEAR_SELECTED_FEATURES"}),r&&(c.add("location",t,g),P.emit("interact:markerchange",{coords:t})))},[f,p,c,g,P,b]),M=ve({mapProvider:s,layers:d,interactionModes:f,multiSelect:v,dispatch:p,markers:c,layerConfigMap:A,debug:null==n?void 0:n.debug,tolerance:m,processFeatureMatch:_,processFallback:w,scale:O});return((e,t,r,n)=>{var o=i(null);a(()=>{if(!(t.length>0)||n){var i=o.current;(null===i||0===i.features.length&&0===i.markers.length)&&0===t.length&&0===r.length||(e.emit("interact:selectionchange",{selectedFeatures:t,selectedMarkers:r,selectionBounds:n,contiguous:$(t)}),o.current={features:t,markers:r})}},[t,r,n])})(P,E,h,S),{handleInteraction:M}};function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function me(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ge(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ge(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var Ee=(e,t)=>{var r,n;return t?null!==(r=null===(n=e.properties)||void 0===n?void 0:n[t.idProperty])&&void 0!==r?r:e.id:null},he=e=>{var t=e.closest(".im-c-viewport__markers");if(!t)return!1;var r=t.getBoundingClientRect(),{left:n,right:o,top:i,bottom:a}=e.getBoundingClientRect();return o>r.left&&n<r.right&&a>r.top&&i<r.bottom},Se=(e,t,r)=>{var n,o,i,a=t[null===(n=e.layer)||void 0===n?void 0:n.id];if(null==a||!a.labelProperty)return null;var l=Ee(e,a),s=null==l?null:String(l);return null==s||r.has(s)?null:(r.add(s),{id:s,label:null!==(o=null===(i=e.properties)||void 0===i?void 0:i[a.labelProperty])&&void 0!==o?o:s})};function be(e){var{markers:t,interactionModes:r,layers:n,mapProvider:o,multiSelect:i,eventBus:l}=e;a(()=>{var e=()=>{var e=[];null!=r&&r.includes("selectMarker")&&e.push(...(e=>{var t=[];for(var r of e.items){var n;if(r.label){var o=null===(n=e.markerRefs)||void 0===n?void 0:n.get(r.id);!ce(r)&&o&&he(o)&&t.push({id:r.id,label:r.label})}}return t})(t)),null!=r&&r.includes("selectFeature")&&n.length>0&&e.push(...((e,t)=>{var r=[],n=new Set,o=t.map(e=>e.layerId),i=ee(t),a=e.getVisibleFeatures(o);for(var l of a){var s=Se(l,i,n);s&&r.push(s)}return r})(o,n)),l.emit(u.MAP_SET_FEATURES,{items:e,multiselectable:i})};return e(),l.on(u.MAP_MOVE_END,e),l.on(u.MAP_DATA_CHANGE,e),()=>{l.off(u.MAP_MOVE_END,e),l.off(u.MAP_DATA_CHANGE,e)}},[t,r,n,o,i,l])}function Pe(e){var{markers:t,interactionModes:r,layers:n,mapProvider:o,eventBus:i,dispatch:l,listboxActiveItemRef:s}=e;a(()=>{var e=e=>{var{id:i}=e;if(null===i)return s.current=null,void l({type:"SET_LISTBOX_ACTIVE",payload:null});if(t.items.find(e=>e.id===i))return s.current={id:i,isMarker:!0},void l({type:"SET_LISTBOX_ACTIVE",payload:null});if(null!=r&&r.includes("selectFeature")&&n.length>0){var a=n.map(e=>e.layerId),c=ee(n),u=((e,t,r)=>{for(var n of e){var o,i=t[null===(o=n.layer)||void 0===o?void 0:o.id],a=Ee(n,i);if(null!=a&&String(a)===String(r))return{feature:n,config:i,rawId:a}}return null})(o.getVisibleFeatures(a),c,i);if(u){var p={featureId:u.rawId,layerId:u.config.layerId,idProperty:u.config.idProperty,geometry:u.feature.geometry};s.current=me(me({id:i,isMarker:!1},p),{},{properties:u.feature.properties}),l({type:"SET_LISTBOX_ACTIVE",payload:p})}}};return i.on(u.MAP_SET_ACTIVE_FEATURE,e),()=>{i.off(u.MAP_SET_ACTIVE_FEATURE,e)}},[t,r,n,o,i,l,s])}function Ae(e){var{mapState:t,pluginState:r,services:n,mapProvider:o}=e,{markers:l}=t,{dispatch:s,interactionModes:c,layers:p,multiSelect:d}=r,{eventBus:f}=n,v=i(null);be({markers:l,interactionModes:c,layers:p,mapProvider:o,multiSelect:d,eventBus:f}),Pe({markers:l,interactionModes:c,layers:p,mapProvider:o,eventBus:f,dispatch:s,listboxActiveItemRef:v}),function(e){var{eventBus:t,dispatch:r,listboxActiveItemRef:n,multiSelect:o}=e;a(()=>{var e=()=>{var e=n.current;if(e)if(e.isMarker)r({type:"TOGGLE_SELECTED_MARKERS",payload:{markerId:e.id,multiSelect:o}});else{var{featureId:t,layerId:i,idProperty:a,geometry:l,properties:s}=e;r({type:"TOGGLE_SELECTED_FEATURES",payload:{featureId:t,layerId:i,idProperty:a,geometry:l,properties:s,multiSelect:o,replaceAll:!o}})}};return t.on(u.MAP_SELECT_FEATURE,e),()=>{t.off(u.MAP_SELECT_FEATURE,e)}},[t,r,n,o])}({eventBus:f,dispatch:s,listboxActiveItemRef:v,multiSelect:d})}var Oe=(e,t)=>{if(!e)return null;if("string"==typeof e)return e.trim();if("object"==typeof e){if(t&&e[t])return e[t];var r=Object.values(e)[0];return null!=r?r:null}return null},_e={light:{haloColor:"#ffffff",selectedColor:"#0b0c0c",activeColor:"#ffdd00",foregroundColor:"#0b0c0c"},dark:{haloColor:"#0b0c0c",selectedColor:"#ffffff",activeColor:"#ffdd00",foregroundColor:"#ffffff"}},we=e=>{var{mapProvider:t,mapStyle:r,pluginState:n,selectedFeatures:o,dispatch:i,events:s,eventBus:c}=e,{layers:u,listboxActiveItem:p}=n,d=l(()=>r?((e,t)=>{var r,n,o,i={};if(!t)return i;var a=null!==(r=_e[t.mapColorScheme])&&void 0!==r?r:_e.light,l=null!==(n=t.activeColor)&&void 0!==n?n:a.activeColor,s=null!==(o=t.selectedColor)&&void 0!==o?o:a.selectedColor;return e.forEach(e=>{var r=e.activeStroke||l,n=e.selectedStroke||s,o=e.selectedFill||"transparent",a=e.selectedStrokeWidth||3,c=a+6;i[e.layerId]={stroke:Oe(r,t.id),selectionStroke:Oe(n,t.id),fill:Oe(o,t.id),strokeWidth:a,activeStrokeWidth:c}}),i})(u,r):null,[u,r]),f=()=>{var e,r=p?[{featureId:p.featureId,layerId:p.layerId,idProperty:p.idProperty,geometry:p.geometry}]:[],n=null===(e=t.updateHighlightedFeatures)||void 0===e?void 0:e.call(t,o,r,d);i({type:"UPDATE_SELECTED_BOUNDS",payload:n})};a(()=>{if(t&&d){f();var e=()=>{c.once(s.MAP_DATA_CHANGE,f)};return c.on(s.MAP_STYLE_CHANGE,e),()=>{c.off(s.MAP_STYLE_CHANGE,e)}}},[o,p,t,d,c])};function Me(e){var{crossHair:t,enabled:r,selectMarkerOnly:n,appState:l}=e,s=i(r);s.current=r;var c=i(n);c.current=n;var u=i(t);u.current=t;var p=i(!1),d=o(()=>{var e="unknown"===ne?(ne="mouse","mouse"):ne,t=["touch","keyboard"].includes(e);!s.current||p.current||!t||"touch"===e&&c.current?u.current.hide():u.current.fixAtCenter()},[]);a(()=>{d()},[r,n,d]),a(()=>{return e=d,oe.add(e),()=>{oe.delete(e)};var e},[d]),a(()=>{var e,t=null===(e=l.layoutRefs)||void 0===e||null===(e=e.appContainerRef)||void 0===e?void 0:e.current;if(t){var r=e=>{var t=!!e.target.closest('[role="listbox"], [role="option"]');p.current!==t&&(p.current=t,d())};return t.addEventListener("focusin",r),()=>{t.removeEventListener("focusin",r)}}},[l.layoutRefs,d])}function ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Te(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ke(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Ie(e){var t,r,n,{getAppState:o,mapState:i,getPluginState:a,buttonConfig:l,events:s,eventBus:c,handleInteraction:u,clickReadyRef:p,closeApp:d}=e,{selectDone:f,selectAtTarget:v,selectCancel:y}=l,g=()=>u(i.crossHair.getDetail()),m=e=>{p.current&&u(e)},{handleKeydown:E,handleKeyup:h}=(t=o().layoutRefs.viewportRef,r=g,n=!1,{handleKeydown:e=>{n="Enter"===e.key&&t.current===e.target},handleKeyup:e=>{"Enter"===e.key&&n&&(e.preventDefault(),r())}}),S=((e,t)=>(r,n)=>{var o=t();e.markers.remove("location"),o.dispatch({type:"TOGGLE_SELECTED_FEATURES",payload:Te({multiSelect:o.multiSelect,addToExisting:n},r)})})(i,a),b=e=>S(e,!0),P=e=>S(e,!1);return document.addEventListener("keydown",E),document.addEventListener("keyup",h),c.on(s.MAP_CLICK,m),c.on("interact:selectFeature",b),c.on("interact:unselectFeature",P),v.onClick=g,f.onClick=()=>{var e,t=a(),r=i.markers.getMarker("location"),{coords:n}=r||{},{selectionBounds:l,selectedFeatures:s,selectedMarkers:u}=t;o().disabledButtons.has("selectDone")||(c.emit("interact:done",((e,t,r,n)=>Te(Te(Te(Te({},e&&{coords:e}),!e&&t&&{selectedFeatures:t}),!e&&(null==r?void 0:r.length)&&{selectedMarkers:r}),!e&&n&&{selectionBounds:n}))(n,s,u,l)),(null===(e=t.closeOnAction)||void 0===e||e)&&d())},y.onClick=()=>{var e;c.emit("interact:cancel"),(null===(e=a().closeOnAction)||void 0===e||e)&&d()},()=>{f.onClick=null,v.onClick=null,y.onClick=null,document.removeEventListener("keydown",E),document.removeEventListener("keyup",h),c.off(s.MAP_CLICK,m),c.off("interact:selectFeature",b),c.off("interact:unselectFeature",P)}}var Ce=e=>1===(null==e?void 0:e.length)&&e.includes("selectMarker");function Le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Fe(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Le(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var De={ENABLE:(e,t)=>Fe(Fe(Fe({},e),t),{},{enabled:!0}),DISABLE:e=>Fe(Fe({},e),{},{enabled:!1,selectedFeatures:[],selectedMarkers:[],selectionBounds:null,listboxActiveItem:null}),TOGGLE_SELECTED_FEATURES:(e,t)=>{var{featureId:r,multiSelect:n,layerId:o,idProperty:i,addToExisting:a=!0,replaceAll:l=!1,properties:s,geometry:c}=t,u=Array.isArray(e.selectedFeatures)?e.selectedFeatures:[],p=u.findIndex(e=>e.featureId===r&&e.layerId===o);if(!1===a){var d=u.filter((e,t)=>t!==p);return Fe(Fe({},e),{},{selectedFeatures:d,selectionBounds:null})}var f,v={featureId:r,layerId:o,idProperty:i,properties:s,geometry:c};if(n&&!l){var y=[...u];-1===p?y.push(v):y.splice(p,1),f=y}else{f=-1!==p&&1===u.length?[]:[v]}return Fe(Fe({},e),{},{selectedFeatures:f,selectedMarkers:n&&!l?e.selectedMarkers:[],selectionBounds:null})},TOGGLE_SELECTED_MARKERS:(e,t)=>{var{markerId:r,multiSelect:n}=t,o=e.selectedMarkers,i=o.includes(r);if(n){var a=i?o.filter(e=>e!==r):[...o,r];return Fe(Fe({},e),{},{selectedMarkers:a})}return Fe(Fe({},e),{},{selectedFeatures:[],selectionBounds:null,selectedMarkers:i&&1===o.length?[]:[r]})},UPDATE_SELECTED_BOUNDS:(e,t)=>JSON.stringify(t)===JSON.stringify(e.selectionBounds)?e:Fe(Fe({},e),{},{selectionBounds:t}),CLEAR_SELECTED_FEATURES:e=>Fe(Fe({},e),{},{selectedFeatures:[],selectedMarkers:[],selectionBounds:null}),SET_SELECTED_FEATURES:(e,t)=>Fe(Fe({},e),{},{selectedFeatures:t,selectionBounds:null}),SELECT_MARKER:(e,t)=>{var{markerId:r,multiSelect:n}=t,o=e.selectedMarkers;if(o.includes(r))return e;var i=n?[...o,r]:[r];return Fe(Fe({},e),{},{selectedFeatures:n?e.selectedFeatures:[],selectionBounds:null,selectedMarkers:i})},UNSELECT_MARKER:(e,t)=>{var{markerId:r}=t,n=e.selectedMarkers;return n.includes(r)?Fe(Fe({},e),{},{selectedMarkers:n.filter(e=>e!==r)}):e},SET_LISTBOX_ACTIVE:(e,t)=>Fe(Fe({},e),{},{listboxActiveItem:null!=t?t:null})},Re={tolerance:10,interactionModes:["selectMarker"],multiSelect:!1,contiguous:!1,deselectOnClickOutside:!1,marker:{}};function je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function xe(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?je(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var Be="Select features",Ne={InitComponent:e=>{var{appState:t,mapState:r,services:n,buttonConfig:o,mapProvider:l,pluginState:s}=e,{dispatch:c,enabled:p,selectedFeatures:d,interactionModes:f,layers:v}=s,{eventBus:y,closeApp:g}=n,{crossHair:m,mapStyle:E,markers:h}=r,S=Ce(f);Ae({mapState:r,pluginState:s,services:n,mapProvider:l});var{handleInteraction:b}=ye({mapState:r,pluginState:s,services:n,mapProvider:l});return we({mapProvider:l,mapStyle:E,pluginState:s,selectedFeatures:d,dispatch:c,events:u,eventBus:y}),a(()=>{y.emit("interact:active",{active:p,interactionModes:f})},[p,f]),function(e){var{enabled:t,interactionModes:r,markers:n,layers:o,eventBus:i}=e;a(()=>{if(t){var e=(null==r?void 0:r.includes("selectMarker"))&&n.items.some(e=>e.label),a=(null==r?void 0:r.includes("selectFeature"))&&o.some(e=>e.labelProperty);(e||a)&&i.emit("interact:listboxcapable")}},[t,r,n,o,i])}({enabled:p,interactionModes:f,markers:h,layers:v,eventBus:y}),((e,t,r,n)=>{a(()=>{var o,i=t&&(null==r?void 0:r.includes("selectFeature"))?n.map(e=>e.layerId):[];return null===(o=e.setHoverCursor)||void 0===o||o.call(e,i),()=>{var t;return null===(t=e.setHoverCursor)||void 0===t?void 0:t.call(e,[])}},[t,r,n])})(l,p,f,v),Me({crossHair:m,enabled:p,selectMarkerOnly:S,appState:t}),function(e){var{pluginState:t,appState:r,mapState:n,buttonConfig:o,eventBus:l,handleInteraction:s,closeApp:c}=e,p=i(s);p.current=s;var d=i(t);d.current=t;var f=i(r);f.current=r;var v=i(!1);a(()=>{v.current=!1;var e=setTimeout(()=>{v.current=!0},0);return()=>clearTimeout(e)},[t.enabled]),a(()=>{if(t.enabled)return Ie({getAppState:()=>f.current,mapState:n,getPluginState:()=>d.current,buttonConfig:o,events:u,eventBus:l,handleInteraction:e=>p.current(e),clickReadyRef:v,closeApp:c})},[t.enabled,o,l,c])}({pluginState:s,appState:t,mapState:r,buttonConfig:o,eventBus:y,handleInteraction:b,closeApp:g}),null},reducer:{initialState:{enabled:!1,layers:[],marker:null,interactionModes:null,multiSelect:!1,deselectOnClickOutside:!1,selectedFeatures:[],selectedMarkers:[],selectionBounds:null,closeOnAction:!0,listboxActiveItem:null},actions:De},buttons:[{id:"selectCancel",label:"Back",variant:"tertiary",hiddenWhen:e=>{var{appConfig:t,appState:r,pluginState:n}=e;return!n.enabled||!(["hybrid","buttonFirst"].includes(t.behaviour)&&r.isFullscreen)},mobile:{slot:"actions",showLabel:!0},tablet:{slot:"actions",showLabel:!0},desktop:{slot:"actions",showLabel:!0}},{id:"selectAtTarget",label:"Select",variant:"primary",hiddenWhen:e=>{var{appState:t,pluginState:r}=e;return!r.enabled||"touch"!==t.interfaceType||Ce(r.interactionModes)},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}},{id:"selectDone",label:"Continue",variant:"primary",excludeWhen:e=>{var{appState:t,pluginState:r}=e;return!r.enabled||!t.isFullscreen},enableWhen:e=>{var{mapState:t,pluginState:r}=e;return!!t.markers.items.some(e=>"location"===e.id)||!!r.selectionBounds},mobile:{slot:"actions",showLabel:!0},tablet:{slot:"actions",showLabel:!0},desktop:{slot:"actions",showLabel:!0}}],keyboardShortcuts:[{id:"clickAtTarget",title:"Click at target",command:"<kbd>Enter</kbd>"},{id:"selectFeatures",group:Be,context:"listbox",title:"Select features",command:"<kbd>Tab</kbd>"},{id:"navigateFeatures",group:Be,context:"listbox",title:"Navigate features",command:"<kbd>↑</kbd> or <kbd>↓</kbd>"},{id:"selectFeature",group:Be,context:"listbox",title:"Select a feature",command:"<kbd>Enter</kbd> or <kbd>Space</kbd>"},{id:"dismissHintOrReturn",group:Be,context:"listbox",title:"Dismiss hint / return to map",command:"<kbd>Escape</kbd>"}],icons:[{id:"select",svgContent:'<path d="M22 14a8 8 0 0 1-8 8"/><path d="M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2"/><path d="M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1"/><path d="M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10"/><path d="M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"/>'}],api:{enable:(e,t)=>{var{pluginState:r,pluginConfig:n}=e;r.dispatch({type:"ENABLE",payload:xe(xe(xe({},Re),n),t)})},disable:e=>{var{pluginState:t}=e;t.dispatch({type:"DISABLE"})},clear:e=>{var{pluginState:t,mapState:r}=e;t.dispatch({type:"CLEAR_SELECTED_FEATURES"}),r.markers.remove("location")},selectFeature:(e,t)=>{var{services:r}=e,{featureId:n,layerId:o,idProperty:i}=t;r.eventBus.emit("interact:selectFeature",{featureId:n,layerId:o,idProperty:i})},unselectFeature:(e,t)=>{var{services:r}=e,{featureId:n,layerId:o,idProperty:i}=t;r.eventBus.emit("interact:unselectFeature",{featureId:n,layerId:o,idProperty:i})},selectMarker:(e,t)=>{var{pluginState:r}=e;r.dispatch({type:"SELECT_MARKER",payload:{markerId:t,multiSelect:r.multiSelect}})},unselectMarker:(e,t)=>{var{pluginState:r}=e;r.dispatch({type:"UNSELECT_MARKER",payload:{markerId:t}})}}};export{Ne as manifest};
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/objectWithoutProperties";import{useContext as t,createContext as r,useState as n,useCallback as o,useRef as i,useEffect as a,useMemo as l}from"preact/compat";import{jsxs as s,jsx as c}from"preact/jsx-runtime";var u={APP_ADD_MARKER:"app:addmarker",APP_UPDATE_MARKER:"app:updatemarker",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_FEATURES:"map:setfeatures",MAP_SET_ACTIVE_FEATURE:"map:setactivefeature",MAP_SELECT_FEATURE:"map:selectfeature",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"};function p(e,t,r={}){const n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function d(e,t,r={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!g(e[0])||!g(e[1]))throw new Error("coordinates must contain numbers");return p({type:"Point",coordinates:e},t,r)}function f(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return p({type:"LineString",coordinates:e},t,r)}function v(e,t={}){const r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function y(e,t,r={}){return p({type:"MultiLineString",coordinates:e},t,r)}function g(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}const m=11102230246251565e-32,E=134217729,h=(3+8*m)*m;function b(e,t,r,n,o){let i,a,l,s,c=t[0],u=n[0],p=0,d=0;u>c==u>-c?(i=c,c=t[++p]):(i=u,u=n[++d]);let f=0;if(p<e&&d<r)for(u>c==u>-c?(a=c+i,l=i-(a-c),c=t[++p]):(a=u+i,l=i-(a-u),u=n[++d]),i=a,0!==l&&(o[f++]=l);p<e&&d<r;)u>c==u>-c?(a=i+c,s=a-i,l=i-(a-s)+(c-s),c=t[++p]):(a=i+u,s=a-i,l=i-(a-s)+(u-s),u=n[++d]),i=a,0!==l&&(o[f++]=l);for(;p<e;)a=i+c,s=a-i,l=i-(a-s)+(c-s),c=t[++p],i=a,0!==l&&(o[f++]=l);for(;d<r;)a=i+u,s=a-i,l=i-(a-s)+(u-s),u=n[++d],i=a,0!==l&&(o[f++]=l);return 0===i&&0!==f||(o[f++]=i),f}function S(e){return new Float64Array(e)}const P=S(4),A=S(8),O=S(12),_=S(16),w=S(4);function k(e,t,r,n,o,i){const a=(t-i)*(r-o),l=(e-o)*(n-i),s=a-l,c=Math.abs(a+l);return Math.abs(s)>=33306690738754716e-32*c?s:-function(e,t,r,n,o,i,a){let l,s,c,u,p,d,f,v,y,g,m,S,k,M,T,I,C,L;const F=e-o,D=r-o,R=t-i,j=n-i;M=F*j,d=E*F,f=d-(d-F),v=F-f,d=E*j,y=d-(d-j),g=j-y,T=v*g-(M-f*y-v*y-f*g),I=R*D,d=E*R,f=d-(d-R),v=R-f,d=E*D,y=d-(d-D),g=D-y,C=v*g-(I-f*y-v*y-f*g),m=T-C,p=T-m,P[0]=T-(m+p)+(p-C),S=M+m,p=S-M,k=M-(S-p)+(m-p),m=k-I,p=k-m,P[1]=k-(m+p)+(p-I),L=S+m,p=L-S,P[2]=S-(L-p)+(m-p),P[3]=L;let x=function(e,t){let r=t[0];for(let n=1;n<e;n++)r+=t[n];return r}(4,P),B=22204460492503146e-32*a;if(x>=B||-x>=B)return x;if(p=e-F,l=e-(F+p)+(p-o),p=r-D,c=r-(D+p)+(p-o),p=t-R,s=t-(R+p)+(p-i),p=n-j,u=n-(j+p)+(p-i),0===l&&0===s&&0===c&&0===u)return x;if(B=11093356479670487e-47*a+h*Math.abs(x),x+=F*u+j*l-(R*c+D*s),x>=B||-x>=B)return x;M=l*j,d=E*l,f=d-(d-l),v=l-f,d=E*j,y=d-(d-j),g=j-y,T=v*g-(M-f*y-v*y-f*g),I=s*D,d=E*s,f=d-(d-s),v=s-f,d=E*D,y=d-(d-D),g=D-y,C=v*g-(I-f*y-v*y-f*g),m=T-C,p=T-m,w[0]=T-(m+p)+(p-C),S=M+m,p=S-M,k=M-(S-p)+(m-p),m=k-I,p=k-m,w[1]=k-(m+p)+(p-I),L=S+m,p=L-S,w[2]=S-(L-p)+(m-p),w[3]=L;const N=b(4,P,4,w,A);M=F*u,d=E*F,f=d-(d-F),v=F-f,d=E*u,y=d-(d-u),g=u-y,T=v*g-(M-f*y-v*y-f*g),I=R*c,d=E*R,f=d-(d-R),v=R-f,d=E*c,y=d-(d-c),g=c-y,C=v*g-(I-f*y-v*y-f*g),m=T-C,p=T-m,w[0]=T-(m+p)+(p-C),S=M+m,p=S-M,k=M-(S-p)+(m-p),m=k-I,p=k-m,w[1]=k-(m+p)+(p-I),L=S+m,p=L-S,w[2]=S-(L-p)+(m-p),w[3]=L;const G=b(N,A,4,w,O);M=l*u,d=E*l,f=d-(d-l),v=l-f,d=E*u,y=d-(d-u),g=u-y,T=v*g-(M-f*y-v*y-f*g),I=s*c,d=E*s,f=d-(d-s),v=s-f,d=E*c,y=d-(d-c),g=c-y,C=v*g-(I-f*y-v*y-f*g),m=T-C,p=T-m,w[0]=T-(m+p)+(p-C),S=M+m,p=S-M,k=M-(S-p)+(m-p),m=k-I,p=k-m,w[1]=k-(m+p)+(p-I),L=S+m,p=L-S,w[2]=S-(L-p)+(m-p),w[3]=L;const U=b(G,O,4,w,_);return _[U-1]}(e,t,r,n,o,i,c)}function M(e,t){var r,n,o,i,a,l,s,c,u,p=0,d=e[0],f=e[1],v=t.length;for(r=0;r<v;r++){n=0;var y=t[r],g=y.length-1;if((c=y[0])[0]!==y[g][0]&&c[1]!==y[g][1])throw new Error("First and last coordinates in a ring must be the same");for(i=c[0]-d,a=c[1]-f;n<g;n++){if(l=(u=y[n+1])[0]-d,s=u[1]-f,0===a&&0===s){if(l<=0&&i>=0||i<=0&&l>=0)return 0}else if(s>=0&&a<=0||s<=0&&a>=0){if(0===(o=k(i,l,a,s,0,0)))return 0;(o>0&&s>0&&a<=0||o<0&&s<=0&&a>0)&&p++}c=u,a=s,i=l}}return p%2!=0}function T(e){return"Feature"===e.type?e.geometry:e}function I(e,t,r={}){if(!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");const n=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e),o=T(t),i=o.type,a=t.bbox;let l=o.coordinates;if(a&&!1===function(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}(n,a))return!1;"Polygon"===i&&(l=[l]);let s=!1;for(var c=0;c<l.length;++c){const e=M(n,l[c]);if(0===e)return!r.ignoreBoundary;e&&(s=!0)}return s}class C{constructor(e=[],t=L){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const o=e-1>>1,i=t[o];if(r(n,i)>=0)break;t[e]=i,e=o}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,o=t[e];for(;e<n;){let n=1+(e<<1),i=t[n];const a=n+1;if(a<this.length&&r(t[a],i)<0&&(n=a,i=t[a]),r(i,o)>=0)break;t[e]=i,e=n}t[e]=o}}function L(e,t){return e<t?-1:e>t?1:0}function F(e,t){return e.p.x>t.p.x?1:e.p.x<t.p.x?-1:e.p.y!==t.p.y?e.p.y>t.p.y?1:-1:1}function D(e,t){return e.rightSweepEvent.p.x>t.rightSweepEvent.p.x?1:e.rightSweepEvent.p.x<t.rightSweepEvent.p.x?-1:e.rightSweepEvent.p.y!==t.rightSweepEvent.p.y?e.rightSweepEvent.p.y<t.rightSweepEvent.p.y?1:-1:1}class R{constructor(e,t,r,n){this.p={x:e[0],y:e[1]},this.featureId=t,this.ringId=r,this.eventId=n,this.otherEvent=null,this.isLeftEndpoint=null}isSamePoint(e){return this.p.x===e.p.x&&this.p.y===e.p.y}}let j=0,x=0,B=0;function N(e,t){const r="Feature"===e.type?e.geometry:e;let n=r.coordinates;"Polygon"!==r.type&&"MultiLineString"!==r.type||(n=[n]),"LineString"===r.type&&(n=[[n]]);for(let e=0;e<n.length;e++)for(let r=0;r<n[e].length;r++){let o=n[e][r][0],i=null;x+=1;for(let a=0;a<n[e][r].length-1;a++){i=n[e][r][a+1];const l=new R(o,j,x,B),s=new R(i,j,x,B+1);l.otherEvent=s,s.otherEvent=l,F(l,s)>0?(s.isLeftEndpoint=!0,l.isLeftEndpoint=!1):(l.isLeftEndpoint=!0,s.isLeftEndpoint=!1),t.push(l),t.push(s),o=i,B+=1}}j+=1}class G{constructor(e){this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}}function U(e,t){if(null===e||null===t)return!1;if(e.leftSweepEvent.ringId===t.leftSweepEvent.ringId&&(e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.rightSweepEvent)||e.leftSweepEvent.isSamePoint(t.leftSweepEvent)||e.leftSweepEvent.isSamePoint(t.rightSweepEvent)))return!1;const r=e.leftSweepEvent.p.x,n=e.leftSweepEvent.p.y,o=e.rightSweepEvent.p.x,i=e.rightSweepEvent.p.y,a=t.leftSweepEvent.p.x,l=t.leftSweepEvent.p.y,s=t.rightSweepEvent.p.x,c=t.rightSweepEvent.p.y,u=(c-l)*(o-r)-(s-a)*(i-n),p=(s-a)*(n-l)-(c-l)*(r-a),d=(o-r)*(n-l)-(i-n)*(r-a);if(0===u)return!1;const f=p/u,v=d/u;if(f>=0&&f<=1&&v>=0&&v<=1){return[r+f*(o-r),n+f*(i-n)]}return!1}var V=function(e,t){const r=new C([],F);return function(e,t){if("FeatureCollection"===e.type){const r=e.features;for(let e=0;e<r.length;e++)N(r[e],t)}else N(e,t)}(e,r),function(e,t){t=t||!1;const r=[],n=new C([],D);for(;e.length;){const o=e.pop();if(o.isLeftEndpoint){const e=new G(o);for(let i=0;i<n.data.length;i++){const a=n.data[i];if(t&&a.leftSweepEvent.featureId===o.featureId)continue;const l=U(e,a);!1!==l&&r.push(l)}n.push(e)}else!1===o.isLeftEndpoint&&n.pop()}return r}(r,t)};function H(e,t,r={}){const{removeDuplicates:n=!0,ignoreSelfIntersections:o=!0}=r;let i=[];"FeatureCollection"===e.type?i=i.concat(e.features):"Feature"===e.type?i.push(e):"LineString"!==e.type&&"Polygon"!==e.type&&"MultiLineString"!==e.type&&"MultiPolygon"!==e.type||i.push(p(e)),"FeatureCollection"===t.type?i=i.concat(t.features):"Feature"===t.type?i.push(t):"LineString"!==t.type&&"Polygon"!==t.type&&"MultiLineString"!==t.type&&"MultiPolygon"!==t.type||i.push(p(t));const a=V(v(i),o);let l=[];if(n){const e={};a.forEach(t=>{const r=t.join(",");e[r]||(e[r]=!0,l.push(t))})}else l=a;return v(l.map(e=>d(e)))}function K(e,t){!function(e,t){var r,n,o,i,a,l,s,c,u,p,d=0,f="FeatureCollection"===e.type,v="Feature"===e.type,y=f?e.features.length:1;for(r=0;r<y;r++){for(l=f?e.features[r].geometry:v?e.geometry:e,c=f?e.features[r].properties:v?e.properties:{},u=f?e.features[r].bbox:v?e.bbox:void 0,p=f?e.features[r].id:v?e.id:void 0,a=(s=!!l&&"GeometryCollection"===l.type)?l.geometries.length:1,o=0;o<a;o++)if(null!==(i=s?l.geometries[o]:l))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(i,d,c,u,p))return!1;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===t(i.geometries[n],d,c,u,p))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,c,u,p))return!1;d++}}(e,function(e,r,n,o,i){var a,l=null===e?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==t(p(e,n,{bbox:o,id:i}),r,0)&&void 0}switch(l){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var s=0;s<e.coordinates.length;s++){var c=e.coordinates[s];if(!1===t(p({type:a,coordinates:c},n),r,s))return!1}})}function W(e,t={}){const r=T(e);switch(t.properties||"Feature"!==e.type||(t.properties=e.properties),r.type){case"Polygon":return function(e,t={}){const r=T(e),n=r.coordinates,o=t.properties?t.properties:"Feature"===e.type?e.properties:{};return Y(n,o)}(r,t);case"MultiPolygon":return function(e,t={}){const r=T(e),n=r.coordinates,o=t.properties?t.properties:"Feature"===e.type?e.properties:{},i=[];return n.forEach(e=>{i.push(Y(e,o))}),v(i)}(r,t);default:throw new Error("invalid poly")}}function Y(e,t){return e.length>1?y(e,t):f(e[0],t)}function q(e,t){for(let r=0;r<e.coordinates.length-1;r++)if(X(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}function z(e,t,r){for(const r of t.coordinates)if(I(r,e))return!0;return H(t,W(e),{ignoreSelfIntersections:r}).features.length>0}function X(e,t,r){const n=r[0]-e[0],o=r[1]-e[1],i=t[0]-e[0],a=t[1]-e[1];return 0===n*a-o*i&&(Math.abs(i)>=Math.abs(a)?i>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:a>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1])}var J=function(e,t,{ignoreSelfIntersections:r=!0}={ignoreSelfIntersections:!0}){let n=!0;return K(e,e=>{K(t,t=>{if(!1===n)return!1;n=function(e,t,r){switch(e.type){case"Point":switch(t.type){case"Point":return n=e.coordinates,o=t.coordinates,!(n[0]===o[0]&&n[1]===o[1]);case"LineString":return!q(t,e);case"Polygon":return!I(e,t)}break;case"LineString":switch(t.type){case"Point":return!q(e,t);case"LineString":return!function(e,t,r){const n=H(e,t,{ignoreSelfIntersections:r});if(n.features.length>0)return!0;return!1}(e,t,r);case"Polygon":return!z(t,e,r)}break;case"Polygon":switch(t.type){case"Point":return!I(t,e);case"LineString":return!z(e,t,r);case"Polygon":return!function(e,t,r){for(const r of e.coordinates[0])if(I(r,t))return!0;for(const r of t.coordinates[0])if(I(r,e))return!0;const n=H(W(e),W(t),{ignoreSelfIntersections:r});if(n.features.length>0)return!0;return!1}(t,e,r)}}var n,o;return!1}(e.geometry,t.geometry,r)})}),n};function Z(e){var t=e.geometry||e;switch(t.type){case"Polygon":return function(e,t,r={}){for(const t of e){if(t.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(t[t.length-1].length!==t[0].length)throw new Error("First and last Position are not equivalent.");for(let e=0;e<t[t.length-1].length;e++)if(t[t.length-1][e]!==t[0][e])throw new Error("First and last Position are not equivalent.")}return p({type:"Polygon",coordinates:e},t,r)}(t.coordinates);case"MultiPolygon":return function(e,t,r={}){return p({type:"MultiPolygon",coordinates:e},t,r)}(t.coordinates);case"LineString":return f(t.coordinates);case"MultiLineString":return y(t.coordinates);case"Point":return d(t.coordinates);case"MultiPoint":return function(e,t,r={}){return p({type:"MultiPoint",coordinates:e},t,r)}(t.coordinates);default:throw new Error("Unsupported geometry type: ".concat(t.type))}}function Q(e,t){return t.some(t=>!J(Z(t),Z(e)))}function $(e){if(e.length<2)return!1;if(e.some(e=>{var t;return!(null!==(t=e.geometry)&&void 0!==t&&t.type)}))return!1;for(var t=new Set([0]),r=!0;r;){r=!1;for(var n=1;n<e.length;n++)if(!t.has(n)){var o=[...t].map(t=>e[t]);Q(e[n],o)&&(t.add(n),r=!0)}}return t.size===e.length}var ee=e=>{var t={};for(var r of e)t[r.layerId]=r;return t},te=(e,t,r)=>{try{return(null==e?void 0:e.getFeaturesAtPoint(t,r))||[]}catch(e){return console.warn("Feature query failed:",e),[]}},re=e=>{var t,r=null===(t=e.geometry)||void 0===t?void 0:t.type;return"Point"===r||"MultiPoint"===r};var ne=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",oe=new Set;var ie,ae;var le=/mac/i.test(null!==(ie=null===(ae=navigator.userAgentData)||void 0===ae?void 0:ae.platform)&&void 0!==ie?ie:navigator.platform)?"<kbd>Option</kbd>":"<kbd>Alt</kbd>";"".concat(le," + <kbd>Enter</kbd>"),"".concat(le," + <kbd>→</kbd>, <kbd>←</kbd>, <kbd>↑</kbd> or <kbd>↓</kbd>"),new Set;function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ce(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?se(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var ue={slot:"middle",open:!1,dismissible:!0,modal:!0};ce({},ue),ce(ce({},ue),{},{width:"500px"}),ce(ce({},ue),{},{width:"500px"});var pe={small:1,medium:1.5,large:2},de=e=>!!e.label&&(!e.symbol&&!e.symbolSvgContent&&(null===e.symbol||null===e.symbolSvgContent));function fe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ve(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?fe(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var ye=(e,t,r,n)=>({featureId:e,multiSelect:t,layerId:r.layerId,idProperty:r.idProperty,properties:n.properties,geometry:n.geometry}),ge=e=>{var t,{featureId:r,feature:n,config:o,selectedFeatures:i,dispatch:a,multiSelect:l}=e;if(!i.length)return!1;var s=i.findIndex(e=>e.featureId===r&&e.layerId===o.layerId);if(-1!==s){if(i.length<3)return!1;var c=(e=>{for(var t=new Set([0]),r=!0;r;){r=!1;for(var n=1;n<e.length;n++){var o;if(!t.has(n)){var i=[...t].map(t=>e[t]);null!==(o=e[n].geometry)&&void 0!==o&&o.type&&Q(e[n],i)&&(t.add(n),r=!0)}}}return t.size===e.length?null:[...t].map(t=>e[t])})(i.filter((e,t)=>t!==s));return!!c&&(a({type:"SET_SELECTED_FEATURES",payload:c}),!0)}var u=i.filter(e=>{var t;return null===(t=e.geometry)||void 0===t?void 0:t.type});return!(null===(t=n.geometry)||void 0===t||!t.type||!u.length)&&(!Q(n,u)&&(a({type:"TOGGLE_SELECTED_FEATURES",payload:ve(ve({},ye(r,l,o,n)),{},{replaceAll:!0})}),!0))},me=e=>{var{mapProvider:t,layers:r,interactionModes:n,multiSelect:i,dispatch:a,markers:l,layerConfigMap:s,debug:c,tolerance:u,processFeatureMatch:p,processFallback:d,scale:f}=e;return o(e=>{var{point:o,coords:v}=e,y=c?te(t,o,{radius:u}):null;if(y&&console.log("--- Features at ".concat(v," ---"),y),n.includes("selectMarker")){var g=((e,t,r)=>{for(var n of e.items){var o,i=null===(o=e.markerRefs)||void 0===o?void 0:o.get(n.id);if(i&&!de(n)){var a=i.closest(".im-c-viewport__markers")||i.parentElement,l=a?a.getBoundingClientRect():{left:0,top:0},{left:s,top:c,right:u,bottom:p}=i.getBoundingClientRect(),d=t.x*r,f=t.y*r;if(d>=s-l.left&&d<=u-l.left&&f>=c-l.top&&f<=p-l.top)return n.id}}return null})(l,o,f);if(g)return void a({type:"TOGGLE_SELECTED_MARKERS",payload:{markerId:g,multiSelect:i}})}if(n.includes("selectFeature")&&r.length>0){var m=((e,t)=>{var r=e.filter(e=>{var r;return t[null===(r=e.layer)||void 0===r?void 0:r.id]}),n=r.find(re);if(n)return{feature:n,config:t[n.layer.id]};var o=r[0];return o?{feature:o,config:t[o.layer.id]}:null})(null!=y?y:te(t,o,{radius:u}),s);if(m)return void p(m)}d({coords:v})},[t,r,n,i,a,l,s,c,u,p,d,f])},Ee=e=>{var t,{mapState:r,pluginState:n,services:l,mapProvider:s}=e,{markers:c,mapSize:u}=r,{dispatch:p,layers:d,interactionModes:f,multiSelect:v,contiguous:y,marker:g,tolerance:m,selectedFeatures:E,selectedMarkers:h,selectionBounds:b,deselectOnClickOutside:S}=n,{eventBus:P}=l,A=ee(d),O=null!==(t=pe[u])&&void 0!==t?t:1,_=o(e=>{var t,r,n,{feature:o,config:i}=e;c.remove("location");var a=null!==(t=null===(r=o.properties)||void 0===r?void 0:r[i.idProperty])&&void 0!==t?t:o.id;if(null!=a){var l=null===(n=s.getFeatureGeometry)||void 0===n?void 0:n.call(s,i.layerId,a,i.idProperty),u=l?ve(ve({},o),{},{geometry:l}):o;if(y&&v)if(ge({featureId:a,feature:u,config:i,selectedFeatures:E,dispatch:p,multiSelect:v}))return;p({type:"TOGGLE_SELECTED_FEATURES",payload:ye(a,v,i,u)})}},[c,p,v,y,E,s]),w=o(e=>{var{coords:t}=e,r=f.includes("placeMarker");(r||S)&&(p({type:"CLEAR_SELECTED_FEATURES"}),r&&(c.add("location",t,g),P.emit("interact:markerchange",{coords:t})))},[f,p,c,g,P,S]),k=me({mapProvider:s,layers:d,interactionModes:f,multiSelect:v,dispatch:p,markers:c,layerConfigMap:A,debug:null==n?void 0:n.debug,tolerance:m,processFeatureMatch:_,processFallback:w,scale:O});return((e,t,r,n)=>{var o=i(null);a(()=>{if(!(t.length>0)||n){var i=o.current;(null===i||0===i.features.length&&0===i.markers.length)&&0===t.length&&0===r.length||(e.emit("interact:selectionchange",{selectedFeatures:t,selectedMarkers:r,selectionBounds:n,contiguous:$(t)}),o.current={features:t,markers:r})}},[t,r,n])})(P,E,h,b),{handleInteraction:k}};function he(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function be(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?he(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):he(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var Se=(e,t)=>{var r,n;return t?null!==(r=null===(n=e.properties)||void 0===n?void 0:n[t.idProperty])&&void 0!==r?r:e.id:null},Pe=e=>{var t=e.closest(".im-c-viewport__markers");if(!t)return!1;var r=t.getBoundingClientRect(),{left:n,right:o,top:i,bottom:a}=e.getBoundingClientRect();return o>r.left&&n<r.right&&a>r.top&&i<r.bottom},Ae=(e,t,r)=>{var n,o,i,a=t[null===(n=e.layer)||void 0===n?void 0:n.id];if(null==a||!a.labelProperty)return null;var l=Se(e,a),s=null==l?null:String(l);return null==s||r.has(s)?null:(r.add(s),{id:s,label:null!==(o=null===(i=e.properties)||void 0===i?void 0:i[a.labelProperty])&&void 0!==o?o:s})};function Oe(e){var{markers:t,interactionModes:r,layers:n,mapProvider:o,multiSelect:i,eventBus:l}=e;a(()=>{var e=()=>{var e=[];null!=r&&r.includes("selectMarker")&&e.push(...(e=>{var t=[];for(var r of e.items){var n;if(r.label){var o=null===(n=e.markerRefs)||void 0===n?void 0:n.get(r.id);!de(r)&&o&&Pe(o)&&t.push({id:r.id,label:r.label})}}return t})(t)),null!=r&&r.includes("selectFeature")&&n.length>0&&e.push(...((e,t)=>{var r=[],n=new Set,o=t.map(e=>e.layerId),i=ee(t),a=e.getVisibleFeatures(o);for(var l of a){var s=Ae(l,i,n);s&&r.push(s)}return r})(o,n)),l.emit(u.MAP_SET_FEATURES,{items:e,multiselectable:i})};return e(),l.on(u.MAP_MOVE_END,e),l.on(u.MAP_DATA_CHANGE,e),()=>{l.off(u.MAP_MOVE_END,e),l.off(u.MAP_DATA_CHANGE,e)}},[t,r,n,o,i,l])}function _e(e){var{markers:t,interactionModes:r,layers:n,mapProvider:o,eventBus:i,dispatch:l,listboxActiveItemRef:s}=e;a(()=>{var e=e=>{var{id:i}=e;if(null===i)return s.current=null,void l({type:"SET_LISTBOX_ACTIVE",payload:null});if(t.items.find(e=>e.id===i))return s.current={id:i,isMarker:!0},void l({type:"SET_LISTBOX_ACTIVE",payload:null});if(null!=r&&r.includes("selectFeature")&&n.length>0){var a=n.map(e=>e.layerId),c=ee(n),u=((e,t,r)=>{for(var n of e){var o,i=t[null===(o=n.layer)||void 0===o?void 0:o.id],a=Se(n,i);if(null!=a&&String(a)===String(r))return{feature:n,config:i,rawId:a}}return null})(o.getVisibleFeatures(a),c,i);if(u){var p={featureId:u.rawId,layerId:u.config.layerId,idProperty:u.config.idProperty,geometry:u.feature.geometry};s.current=be(be({id:i,isMarker:!1},p),{},{properties:u.feature.properties}),l({type:"SET_LISTBOX_ACTIVE",payload:p})}}};return i.on(u.MAP_SET_ACTIVE_FEATURE,e),()=>{i.off(u.MAP_SET_ACTIVE_FEATURE,e)}},[t,r,n,o,i,l,s])}function we(e){var{mapState:t,pluginState:r,services:n,mapProvider:o}=e,{markers:l}=t,{dispatch:s,interactionModes:c,layers:p,multiSelect:d}=r,{eventBus:f}=n,v=i(null);Oe({markers:l,interactionModes:c,layers:p,mapProvider:o,multiSelect:d,eventBus:f}),_e({markers:l,interactionModes:c,layers:p,mapProvider:o,eventBus:f,dispatch:s,listboxActiveItemRef:v}),function(e){var{eventBus:t,dispatch:r,listboxActiveItemRef:n,multiSelect:o}=e;a(()=>{var e=()=>{var e=n.current;if(e)if(e.isMarker)r({type:"TOGGLE_SELECTED_MARKERS",payload:{markerId:e.id,multiSelect:o}});else{var{featureId:t,layerId:i,idProperty:a,geometry:l,properties:s}=e;r({type:"TOGGLE_SELECTED_FEATURES",payload:{featureId:t,layerId:i,idProperty:a,geometry:l,properties:s,multiSelect:o,replaceAll:!o}})}};return t.on(u.MAP_SELECT_FEATURE,e),()=>{t.off(u.MAP_SELECT_FEATURE,e)}},[t,r,n,o])}({eventBus:f,dispatch:s,listboxActiveItemRef:v,multiSelect:d})}var ke=(e,t)=>{if(!e)return null;if("string"==typeof e)return e.trim();if("object"==typeof e){if(t&&e[t])return e[t];var r=Object.values(e)[0];return null!=r?r:null}return null},Me={light:{haloColor:"#ffffff",selectedColor:"#0b0c0c",activeColor:"#ffdd00",foregroundColor:"#0b0c0c"},dark:{haloColor:"#0b0c0c",selectedColor:"#ffffff",activeColor:"#ffdd00",foregroundColor:"#ffffff"}},Te=e=>{var{mapProvider:t,mapStyle:r,pluginState:n,selectedFeatures:o,dispatch:i,events:s,eventBus:c}=e,{layers:u,listboxActiveItem:p}=n,d=l(()=>r?((e,t)=>{var r,n,o,i={};if(!t)return i;var a=null!==(r=Me[t.mapColorScheme])&&void 0!==r?r:Me.light,l=null!==(n=t.activeColor)&&void 0!==n?n:a.activeColor,s=null!==(o=t.selectedColor)&&void 0!==o?o:a.selectedColor;return e.forEach(e=>{var r=e.activeStroke||l,n=e.selectedStroke||s,o=e.selectedFill||"transparent",a=e.selectedStrokeWidth||3,c=a+6;i[e.layerId]={stroke:ke(r,t.id),selectionStroke:ke(n,t.id),fill:ke(o,t.id),strokeWidth:a,activeStrokeWidth:c}}),i})(u,r):null,[u,r]),f=()=>{var e,r=p?[{featureId:p.featureId,layerId:p.layerId,idProperty:p.idProperty,geometry:p.geometry}]:[],n=null===(e=t.updateHighlightedFeatures)||void 0===e?void 0:e.call(t,o,r,d);i({type:"UPDATE_SELECTED_BOUNDS",payload:n})};a(()=>{if(t&&d){f();var e=()=>{c.once(s.MAP_DATA_CHANGE,f)};return c.on(s.MAP_STYLE_CHANGE,e),()=>{c.off(s.MAP_STYLE_CHANGE,e)}}},[o,p,t,d,c])};function Ie(e){var{crossHair:t,enabled:r,selectMarkerOnly:n,appState:l}=e,s=i(r);s.current=r;var c=i(n);c.current=n;var u=i(t);u.current=t;var p=i(!1),d=o(()=>{var e="unknown"===ne?(ne="mouse","mouse"):ne,t=["touch","keyboard"].includes(e);!s.current||p.current||!t||"touch"===e&&c.current?u.current.hide():u.current.fixAtCenter()},[]);a(()=>{d()},[r,n,d]),a(()=>{return e=d,oe.add(e),()=>{oe.delete(e)};var e},[d]),a(()=>{var e,t=null===(e=l.layoutRefs)||void 0===e||null===(e=e.appContainerRef)||void 0===e?void 0:e.current;if(t){var r=e=>{var t=!!e.target.closest('[role="listbox"], [role="option"]');p.current!==t&&(p.current=t,d())};return t.addEventListener("focusin",r),()=>{t.removeEventListener("focusin",r)}}},[l.layoutRefs,d])}function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Le(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ce(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Fe(e){var t,r,n,{getAppState:o,mapState:i,getPluginState:a,buttonConfig:l,events:s,eventBus:c,handleInteraction:u,clickReadyRef:p,closeApp:d}=e,{selectDone:f,selectAtTarget:v,selectCancel:y}=l,g=()=>u(i.crossHair.getDetail()),m=e=>{p.current&&u(e)},{handleKeydown:E,handleKeyup:h}=(t=o().layoutRefs.viewportRef,r=g,n=!1,{handleKeydown:e=>{n="Enter"===e.key&&t.current===e.target},handleKeyup:e=>{"Enter"===e.key&&n&&(e.preventDefault(),r())}}),b=((e,t)=>(r,n)=>{var o=t();e.markers.remove("location"),o.dispatch({type:"TOGGLE_SELECTED_FEATURES",payload:Le({multiSelect:o.multiSelect,addToExisting:n},r)})})(i,a),S=e=>b(e,!0),P=e=>b(e,!1);return document.addEventListener("keydown",E),document.addEventListener("keyup",h),c.on(s.MAP_CLICK,m),c.on("interact:selectFeature",S),c.on("interact:unselectFeature",P),v.onClick=g,f.onClick=()=>{var e,t=a(),r=i.markers.getMarker("location"),{coords:n}=r||{},{selectionBounds:l,selectedFeatures:s,selectedMarkers:u}=t;o().disabledButtons.has("selectDone")||(c.emit("interact:done",((e,t,r,n)=>Le(Le(Le(Le({},e&&{coords:e}),!e&&t&&{selectedFeatures:t}),!e&&(null==r?void 0:r.length)&&{selectedMarkers:r}),!e&&n&&{selectionBounds:n}))(n,s,u,l)),(null===(e=t.closeOnAction)||void 0===e||e)&&d())},y.onClick=()=>{var e;c.emit("interact:cancel"),(null===(e=a().closeOnAction)||void 0===e||e)&&d()},()=>{f.onClick=null,v.onClick=null,y.onClick=null,document.removeEventListener("keydown",E),document.removeEventListener("keyup",h),c.off(s.MAP_CLICK,m),c.off("interact:selectFeature",S),c.off("interact:unselectFeature",P)}}var De=e=>1===(null==e?void 0:e.length)&&e.includes("selectMarker");function Re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function je(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Re(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Re(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var xe={ENABLE:(e,t)=>je(je(je({},e),t),{},{enabled:!0}),DISABLE:e=>je(je({},e),{},{enabled:!1,selectedFeatures:[],selectedMarkers:[],selectionBounds:null,listboxActiveItem:null}),TOGGLE_SELECTED_FEATURES:(e,t)=>{var{featureId:r,multiSelect:n,layerId:o,idProperty:i,addToExisting:a=!0,replaceAll:l=!1,properties:s,geometry:c}=t,u=Array.isArray(e.selectedFeatures)?e.selectedFeatures:[],p=u.findIndex(e=>e.featureId===r&&e.layerId===o);if(!1===a){var d=u.filter((e,t)=>t!==p);return je(je({},e),{},{selectedFeatures:d,selectionBounds:null})}var f,v={featureId:r,layerId:o,idProperty:i,properties:s,geometry:c};if(n&&!l){var y=[...u];-1===p?y.push(v):y.splice(p,1),f=y}else{f=-1!==p&&1===u.length?[]:[v]}return je(je({},e),{},{selectedFeatures:f,selectedMarkers:n&&!l?e.selectedMarkers:[],selectionBounds:null})},TOGGLE_SELECTED_MARKERS:(e,t)=>{var{markerId:r,multiSelect:n}=t,o=e.selectedMarkers,i=o.includes(r);if(n){var a=i?o.filter(e=>e!==r):[...o,r];return je(je({},e),{},{selectedMarkers:a})}return je(je({},e),{},{selectedFeatures:[],selectionBounds:null,selectedMarkers:i&&1===o.length?[]:[r]})},UPDATE_SELECTED_BOUNDS:(e,t)=>JSON.stringify(t)===JSON.stringify(e.selectionBounds)?e:je(je({},e),{},{selectionBounds:t}),CLEAR_SELECTED_FEATURES:e=>je(je({},e),{},{selectedFeatures:[],selectedMarkers:[],selectionBounds:null}),SET_SELECTED_FEATURES:(e,t)=>je(je({},e),{},{selectedFeatures:t,selectionBounds:null}),SELECT_MARKER:(e,t)=>{var{markerId:r,multiSelect:n}=t,o=e.selectedMarkers;if(o.includes(r))return e;var i=n?[...o,r]:[r];return je(je({},e),{},{selectedFeatures:n?e.selectedFeatures:[],selectionBounds:null,selectedMarkers:i})},UNSELECT_MARKER:(e,t)=>{var{markerId:r}=t,n=e.selectedMarkers;return n.includes(r)?je(je({},e),{},{selectedMarkers:n.filter(e=>e!==r)}):e},SET_LISTBOX_ACTIVE:(e,t)=>je(je({},e),{},{listboxActiveItem:null!=t?t:null})},Be={tolerance:10,interactionModes:["selectMarker"],multiSelect:!1,contiguous:!1,deselectOnClickOutside:!1,marker:{}};function Ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ge(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ne(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var Ue="Select features",Ve={InitComponent:e=>{var{appState:t,mapState:r,services:n,buttonConfig:o,mapProvider:l,pluginState:s}=e,{dispatch:c,enabled:p,selectedFeatures:d,interactionModes:f,layers:v}=s,{eventBus:y,closeApp:g}=n,{crossHair:m,mapStyle:E,markers:h}=r,b=De(f);we({mapState:r,pluginState:s,services:n,mapProvider:l});var{handleInteraction:S}=Ee({mapState:r,pluginState:s,services:n,mapProvider:l});return Te({mapProvider:l,mapStyle:E,pluginState:s,selectedFeatures:d,dispatch:c,events:u,eventBus:y}),a(()=>{y.emit("interact:active",{active:p,interactionModes:f})},[p,f]),function(e){var{enabled:t,interactionModes:r,markers:n,layers:o,eventBus:i}=e;a(()=>{if(t){var e=(null==r?void 0:r.includes("selectMarker"))&&n.items.some(e=>e.label),a=(null==r?void 0:r.includes("selectFeature"))&&o.some(e=>e.labelProperty);(e||a)&&i.emit("interact:listboxcapable")}},[t,r,n,o,i])}({enabled:p,interactionModes:f,markers:h,layers:v,eventBus:y}),((e,t,r,n)=>{a(()=>{var o,i=t&&(null==r?void 0:r.includes("selectFeature"))?n.map(e=>e.layerId):[];return null===(o=e.setHoverCursor)||void 0===o||o.call(e,i),()=>{var t;return null===(t=e.setHoverCursor)||void 0===t?void 0:t.call(e,[])}},[t,r,n])})(l,p,f,v),Ie({crossHair:m,enabled:p,selectMarkerOnly:b,appState:t}),function(e){var{pluginState:t,appState:r,mapState:n,buttonConfig:o,eventBus:l,handleInteraction:s,closeApp:c}=e,p=i(s);p.current=s;var d=i(t);d.current=t;var f=i(r);f.current=r;var v=i(!1);a(()=>{v.current=!1;var e=setTimeout(()=>{v.current=!0},0);return()=>clearTimeout(e)},[t.enabled]),a(()=>{if(t.enabled)return Fe({getAppState:()=>f.current,mapState:n,getPluginState:()=>d.current,buttonConfig:o,events:u,eventBus:l,handleInteraction:e=>p.current(e),clickReadyRef:v,closeApp:c})},[t.enabled,o,l,c])}({pluginState:s,appState:t,mapState:r,buttonConfig:o,eventBus:y,handleInteraction:S,closeApp:g}),null},reducer:{initialState:{enabled:!1,layers:[],marker:null,interactionModes:null,multiSelect:!1,deselectOnClickOutside:!1,selectedFeatures:[],selectedMarkers:[],selectionBounds:null,closeOnAction:!0,listboxActiveItem:null},actions:xe},buttons:[{id:"selectCancel",label:"Back",variant:"tertiary",hiddenWhen:e=>{var{appConfig:t,appState:r,pluginState:n}=e;return!n.enabled||!(["hybrid","buttonFirst"].includes(t.behaviour)&&r.isFullscreen)},mobile:{slot:"actions",showLabel:!0},tablet:{slot:"actions",showLabel:!0},desktop:{slot:"actions",showLabel:!0}},{id:"selectAtTarget",label:"Select",variant:"primary",hiddenWhen:e=>{var{appState:t,pluginState:r}=e;return!r.enabled||"touch"!==t.interfaceType||De(r.interactionModes)},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}},{id:"selectDone",label:"Continue",variant:"primary",excludeWhen:e=>{var{appState:t,pluginState:r}=e;return!r.enabled||!t.isFullscreen},enableWhen:e=>{var{mapState:t,pluginState:r}=e;return!!t.markers.items.some(e=>"location"===e.id)||!!r.selectionBounds},mobile:{slot:"actions",showLabel:!0},tablet:{slot:"actions",showLabel:!0},desktop:{slot:"actions",showLabel:!0}}],keyboardShortcuts:[{id:"clickAtTarget",title:"Click at target",command:"<kbd>Enter</kbd>"},{id:"selectFeatures",group:Ue,context:"listbox",title:"Select features",command:"<kbd>Tab</kbd>"},{id:"navigateFeatures",group:Ue,context:"listbox",title:"Navigate features",command:"<kbd>↑</kbd> or <kbd>↓</kbd>"},{id:"selectFeature",group:Ue,context:"listbox",title:"Select a feature",command:"<kbd>Enter</kbd> or <kbd>Space</kbd>"},{id:"dismissHintOrReturn",group:Ue,context:"listbox",title:"Dismiss hint / return to map",command:"<kbd>Escape</kbd>"}],icons:[{id:"select",svgContent:'<path d="M22 14a8 8 0 0 1-8 8"/><path d="M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2"/><path d="M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1"/><path d="M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10"/><path d="M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"/>'}],api:{enable:(e,t)=>{var{pluginState:r,pluginConfig:n}=e;r.dispatch({type:"ENABLE",payload:Ge(Ge(Ge({},Be),n),t)})},disable:e=>{var{pluginState:t}=e;t.dispatch({type:"DISABLE"})},clear:e=>{var{pluginState:t,mapState:r}=e;t.dispatch({type:"CLEAR_SELECTED_FEATURES"}),r.markers.remove("location")},selectFeature:(e,t)=>{var{services:r}=e,{featureId:n,layerId:o,idProperty:i}=t;r.eventBus.emit("interact:selectFeature",{featureId:n,layerId:o,idProperty:i})},unselectFeature:(e,t)=>{var{services:r}=e,{featureId:n,layerId:o,idProperty:i}=t;r.eventBus.emit("interact:unselectFeature",{featureId:n,layerId:o,idProperty:i})},selectMarker:(e,t)=>{var{pluginState:r}=e;r.dispatch({type:"SELECT_MARKER",payload:{markerId:t,multiSelect:r.multiSelect}})},unselectMarker:(e,t)=>{var{pluginState:r}=e;r.dispatch({type:"UNSELECT_MARKER",payload:{markerId:t}})}}};export{Ve as manifest};
|