/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.maps_bundle_jsonpfunction=window.maps_bundle_jsonpfunction||[]).push([[21],{120:function(e,n,t){"use strict";t.d(n,"a",(function(){return l}));var o=t(39),s=t.n(o);const c={};let r,a,i;const l={getGeoFieldNames(){const e=[];return Object.values(c).forEach((n=>{e.push(...n.getGeoFieldNames())})),s.a.uniq(e)},getLocation:()=>r,getMapPanels:()=>Object.keys(c).map((e=>({...c[e],id:e}))),hasMultipleMaps:()=>Object.keys(c).length>1,register(e,n){c[e]=n},setLocation(e,n,t,o){a&&a!==e||(a=e,i&&clearTimeout(i),i=setTimeout((()=>{a=void 0}),500),r={lat:n,lon:t,zoom:o},Object.keys(c).forEach((s=>{if(s===e)return;const r=c[s];r.getIsMovementSynchronized()&&r.onLocationChange(n,t,o)})))},unregister(e){delete c[e],0===Object.keys(c).length&&(r=void 0)}}},533:function(e,n,t){"use strict";t.r(n),t.d(n,"openModal",(function(){return d}));var o=t(4),s=t(1),c=t(14),r=t(43),a=t(120),i=t(5),l=t(3);function d(){const{openModal:e}=Object(r.createReactOverlays)(Object(i.e)()),n=e(Object(l.jsx)(SynchronizeMovementModal,{onClose:()=>n.close()}))}class SynchronizeMovementModal extends o.Component{_renderSwitches(){const e=a.a.getMapPanels(),n=e.filter((e=>e.getIsMovementSynchronized()));return e.map((t=>{const o=1===n.length&&t.getIsMovementSynchronized();return Object(l.jsx)(c.EuiFormRow,{display:"columnCompressedSwitch",key:t.id,isInvalid:o,error:o?[s.i18n.translate("xpack.maps.synchronizeMovementModal.onlyOneMapSelectedError",{defaultMessage:"Select another map to synchronize map movement"})]:[]},Object(l.jsx)(c.EuiSwitch,{label:t.getTitle(),checked:t.getIsMovementSynchronized(),onChange:o=>{const s=o.target.checked;s||2!==n.length?s&&2===e.length?e.forEach((e=>{e.setIsMovementSynchronized(!0)})):t.setIsMovementSynchronized(s):n.forEach((e=>{e.setIsMovementSynchronized(!1)})),this.forceUpdate()},compressed:!0}))}))}render(){return Object(l.jsx)(o.Fragment,null,Object(l.jsx)(c.EuiModalHeader,null,Object(l.jsx)(c.EuiModalHeaderTitle,null,s.i18n.translate("xpack.maps.synchronizeMovementAction.title",{defaultMessage:"Synchronize map movement"}))),Object(l.jsx)(c.EuiModalBody,null,this._renderSwitches()))}}}}]);