From 991587bcd6a50972b89667558d3a74e107d40513 Mon Sep 17 00:00:00 2001 From: MaxGruson Date: Sat, 18 May 2024 18:47:40 +0200 Subject: [PATCH] Fixed repaint --- assets/build/bundle.js | 2 +- assets/build/bundle.min.js | 2 +- assets/src/LeafletMap.js | 2 ++ carbon-fields-leaflet-map-plugin.php | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/assets/build/bundle.js b/assets/build/bundle.js index c709111..0625b11 100644 --- a/assets/build/bundle.js +++ b/assets/build/bundle.js @@ -16,7 +16,7 @@ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var leaflet__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! leaflet */ \"./node_modules/leaflet/dist/leaflet-src.js\");\n/* harmony import */ var leaflet__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(leaflet__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! leaflet-geosearch */ \"./node_modules/leaflet-geosearch/dist/geosearch.module.js\");\n/* provided dependency */ var __webpack_provided_wp_dot_element = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n/**\n * External dependencies.\n */\n\n\n\n\nclass MapField extends _wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Component {\n constructor() {\n super(...arguments);\n /**\n * Keeps references to the DOM node.\n *\n * @type {Object}\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"node\", (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createRef)());\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n componentDidMount() {\n this.setupMap();\n this.setupMapEvents();\n }\n\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n componentDidUpdate() {\n this.map.invalidateSize();\n }\n\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n componentWillUnmount() {\n // TODO: remove event listeners to prevent memory leak in older browsers\n }\n\n /**\n * Initializes the map into placeholder element.\n *\n * @return {void}\n */\n setupMap() {\n var searchProvider = this.props.value.searchProvider || this.props.field.searchProvider;\n var lat = this.props.value.lat || this.props.field.lat;\n var lng = this.props.value.lng || this.props.field.lng;\n var zoom = this.props.value.zoom || this.props.field.zoom;\n var url = this.props.value.url || this.props.field.url;\n var searchStyle = this.props.value.searchStyle || this.props.field.searchStyle;\n var searchLabel = this.props.value.searchLabel || this.props.field.searchLabel;\n var addressFormat = this.props.value.addressFormat || this.props.field.addressFormat;\n var address = this.props.value.address || this.props.field.address;\n var markerDraggable = this.props.value.markerDraggable || this.props.field.markerDraggable;\n var markerIcon = this.props.value.markerIcon || this.props.field.markerIcon;\n var searchParams = this.props.value.searchParams || this.props.field.searchParams;\n var tileLayerParams = this.props.value.tileLayerParams || this.props.field.tileLayerParams;\n switch (searchProvider) {\n case \"Algolia\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.AlgoliaProvider({\n params: searchParams\n });\n break;\n case \"Bing\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.BingProvider({\n params: searchParams\n });\n break;\n case \"Esri\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.EsriProvider({\n params: searchParams\n });\n break;\n case \"GeocodeEarth\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.GeocodeEarthProvider({\n params: searchParams\n });\n break;\n case \"Google\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.GoogleProvider({\n params: searchParams\n });\n break;\n case \"LocationIQ\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.LocationIQProvider({\n params: searchParams\n });\n break;\n case \"OpenCage\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.OpenCageProvider({\n params: searchParams\n });\n break;\n case \"OpenStreetMap\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.OpenStreetMapProvider({\n params: searchParams\n });\n break;\n case \"CivilDefenseMap\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.CivilDefenseMapProvider({\n params: searchParams\n });\n break;\n case \"Pelias\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.PeliasProvider({\n params: searchParams\n });\n break;\n case \"MapBox\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.MapBoxProvider({\n params: searchParams\n });\n break;\n case \"GeoApiFr\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.GeoApiFrProvider({\n params: searchParams\n });\n break;\n case \"Geoapify\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.GeoapifyProvider({\n params: searchParams\n });\n break;\n default:\n console.error(\"An invalid provider was supplied to Leaflet GeoSearch!\");\n break;\n }\n var addressFormatFunction = eval === null || eval === void 0 ? void 0 : (0, eval)(`\"use strict\";(${addressFormat})`);\n this.searchControl = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.GeoSearchControl({\n provider: searchProvider,\n style: searchStyle,\n showMarker: true,\n showPopup: true,\n popupFormat: addressFormatFunction,\n resultFormat: addressFormatFunction,\n searchLabel: searchLabel,\n animateZoom: true\n });\n this.map = leaflet__WEBPACK_IMPORTED_MODULE_3___default().map(this.node.current, {\n center: [lat, lng],\n zoom,\n scrollWheelZoom: false\n });\n leaflet__WEBPACK_IMPORTED_MODULE_3___default().tileLayer(url, tileLayerParams).addTo(this.map);\n this.map.addControl(this.searchControl);\n\n // Add marker\n if (address) {\n if (markerIcon) {\n this.marker = leaflet__WEBPACK_IMPORTED_MODULE_3___default().marker([lat, lng], {\n draggable: markerDraggable,\n icon: leaflet__WEBPACK_IMPORTED_MODULE_3___default().icon(markerIcon)\n });\n } else {\n this.marker = leaflet__WEBPACK_IMPORTED_MODULE_3___default().marker([lat, lng], {\n draggable: markerDraggable\n });\n }\n this.marker.addTo(this.map);\n // Add marker popup\n\n this.marker.bindPopup(address);\n this.map.whenReady(() => {\n setTimeout(() => {\n this.marker.openPopup();\n this.map.setView(this.marker.getLatLng()).panBy([0, -50]);\n }, 500);\n });\n }\n }\n\n /**\n * Adds the listeners for the map's events.\n *\n * @return {void}\n */\n setupMapEvents() {\n var onChange = this.props.onChange;\n\n // Fix map and popup view on Carbon Fields view change (e.g. when clicking through tabs in complex fields)\n var carbonBox = this.node.current.closest('.postbox.carbon-box');\n if (carbonBox) {\n this.onClassChange(carbonBox, () => {\n this.map.invalidateSize();\n });\n }\n var tabbedField = this.node.current.closest('.cf-complex__group.cf-complex__group--tabbed');\n if (tabbedField) {\n this.onHiddenToggle(tabbedField, () => {\n this.marker.closePopup();\n this.marker.openPopup();\n this.map.setView(this.marker.getLatLng()).panBy([0, -50]);\n });\n }\n // Get results from Leaflet GeoSearch\n this.map.addEventListener('geosearch/showlocation', result => {\n var r = result.location;\n\n // Create marker\n if (this.marker) {\n this.marker.remove();\n }\n this.marker = result.marker;\n this.marker.options.draggable = true;\n this.marker.addTo(this.map);\n this.marker.dragging.enable();\n var address = this.marker.getPopup().getContent();\n\n // Save location to database\n onChange({\n lat: r.y,\n lng: r.x,\n address: address\n });\n\n // Adjust lat & lng on marker move\n this.marker.addEventListener('moveend', args => {\n var l = args.target.getLatLng();\n this.map.panTo(l);\n onChange({\n lat: l.lat,\n lng: l.lng\n });\n });\n });\n }\n\n /**\n * Listen for class change\n */\n onClassChange(node, callback) {\n var lastClassString = node.classList.toString();\n var mutationObserver = new MutationObserver(mutationList => {\n var _iterator = _createForOfIteratorHelper(mutationList),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n if (item.attributeName === 'class') {\n var classString = node.classList.toString();\n if (classString !== lastClassString) {\n callback(mutationObserver);\n lastClassString = classString;\n break;\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n });\n mutationObserver.observe(node, {\n attributes: true\n });\n return mutationObserver;\n }\n\n /**\n * Listen for add/remove attribute \"hidden\"\n */\n onHiddenToggle(node, callback) {\n var lastHiddenState = node.hasAttribute('hidden');\n var mutationObserver = new MutationObserver(mutationList => {\n var _iterator2 = _createForOfIteratorHelper(mutationList),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var item = _step2.value;\n if (item.attributeName === 'hidden') {\n var hiddenState = node.hasAttribute('hidden');\n if (hiddenState !== lastHiddenState) {\n callback(mutationObserver);\n lastHiddenState = hiddenState;\n break;\n }\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n });\n mutationObserver.observe(node, {\n attributes: true\n });\n return mutationObserver;\n }\n\n /**\n * Render a Leaflet Map field.\n *\n * @return {Object}\n */\n render() {\n return __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: this.props.className,\n ref: this.node\n });\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MapField);\n\n//# sourceURL=webpack://carbon-fields-leaflet-map/./assets/src/LeafletMap.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var leaflet__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! leaflet */ \"./node_modules/leaflet/dist/leaflet-src.js\");\n/* harmony import */ var leaflet__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(leaflet__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! leaflet-geosearch */ \"./node_modules/leaflet-geosearch/dist/geosearch.module.js\");\n/* provided dependency */ var __webpack_provided_wp_dot_element = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n/**\n * External dependencies.\n */\n\n\n\n\nclass MapField extends _wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Component {\n constructor() {\n super(...arguments);\n /**\n * Keeps references to the DOM node.\n *\n * @type {Object}\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"node\", (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createRef)());\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n componentDidMount() {\n this.setupMap();\n this.setupMapEvents();\n }\n\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n componentDidUpdate() {\n this.map.invalidateSize();\n }\n\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n componentWillUnmount() {\n // TODO: remove event listeners to prevent memory leak in older browsers\n }\n\n /**\n * Initializes the map into placeholder element.\n *\n * @return {void}\n */\n setupMap() {\n var searchProvider = this.props.value.searchProvider || this.props.field.searchProvider;\n var lat = this.props.value.lat || this.props.field.lat;\n var lng = this.props.value.lng || this.props.field.lng;\n var zoom = this.props.value.zoom || this.props.field.zoom;\n var url = this.props.value.url || this.props.field.url;\n var searchStyle = this.props.value.searchStyle || this.props.field.searchStyle;\n var searchLabel = this.props.value.searchLabel || this.props.field.searchLabel;\n var addressFormat = this.props.value.addressFormat || this.props.field.addressFormat;\n var address = this.props.value.address || this.props.field.address;\n var markerDraggable = this.props.value.markerDraggable || this.props.field.markerDraggable;\n var markerIcon = this.props.value.markerIcon || this.props.field.markerIcon;\n var searchParams = this.props.value.searchParams || this.props.field.searchParams;\n var tileLayerParams = this.props.value.tileLayerParams || this.props.field.tileLayerParams;\n switch (searchProvider) {\n case \"Algolia\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.AlgoliaProvider({\n params: searchParams\n });\n break;\n case \"Bing\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.BingProvider({\n params: searchParams\n });\n break;\n case \"Esri\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.EsriProvider({\n params: searchParams\n });\n break;\n case \"GeocodeEarth\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.GeocodeEarthProvider({\n params: searchParams\n });\n break;\n case \"Google\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.GoogleProvider({\n params: searchParams\n });\n break;\n case \"LocationIQ\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.LocationIQProvider({\n params: searchParams\n });\n break;\n case \"OpenCage\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.OpenCageProvider({\n params: searchParams\n });\n break;\n case \"OpenStreetMap\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.OpenStreetMapProvider({\n params: searchParams\n });\n break;\n case \"CivilDefenseMap\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.CivilDefenseMapProvider({\n params: searchParams\n });\n break;\n case \"Pelias\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.PeliasProvider({\n params: searchParams\n });\n break;\n case \"MapBox\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.MapBoxProvider({\n params: searchParams\n });\n break;\n case \"GeoApiFr\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.GeoApiFrProvider({\n params: searchParams\n });\n break;\n case \"Geoapify\":\n searchProvider = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.GeoapifyProvider({\n params: searchParams\n });\n break;\n default:\n console.error(\"An invalid provider was supplied to Leaflet GeoSearch!\");\n break;\n }\n var addressFormatFunction = eval === null || eval === void 0 ? void 0 : (0, eval)(`\"use strict\";(${addressFormat})`);\n this.searchControl = new leaflet_geosearch__WEBPACK_IMPORTED_MODULE_4__.GeoSearchControl({\n provider: searchProvider,\n style: searchStyle,\n showMarker: true,\n showPopup: true,\n popupFormat: addressFormatFunction,\n resultFormat: addressFormatFunction,\n searchLabel: searchLabel,\n animateZoom: true\n });\n this.map = leaflet__WEBPACK_IMPORTED_MODULE_3___default().map(this.node.current, {\n center: [lat, lng],\n zoom,\n scrollWheelZoom: false\n });\n leaflet__WEBPACK_IMPORTED_MODULE_3___default().tileLayer(url, tileLayerParams).addTo(this.map);\n this.map.addControl(this.searchControl);\n\n // Add marker\n if (address) {\n if (markerIcon) {\n this.marker = leaflet__WEBPACK_IMPORTED_MODULE_3___default().marker([lat, lng], {\n draggable: markerDraggable,\n icon: leaflet__WEBPACK_IMPORTED_MODULE_3___default().icon(markerIcon)\n });\n } else {\n this.marker = leaflet__WEBPACK_IMPORTED_MODULE_3___default().marker([lat, lng], {\n draggable: markerDraggable\n });\n }\n this.marker.addTo(this.map);\n // Add marker popup\n\n this.marker.bindPopup(address);\n this.map.whenReady(() => {\n setTimeout(() => {\n this.marker.openPopup();\n this.map.setView(this.marker.getLatLng()).panBy([0, -50]);\n this.map.invalidateSize();\n }, 500);\n });\n }\n }\n\n /**\n * Adds the listeners for the map's events.\n *\n * @return {void}\n */\n setupMapEvents() {\n var onChange = this.props.onChange;\n\n // Fix map and popup view on Carbon Fields view change (e.g. when clicking through tabs in complex fields)\n var carbonBox = this.node.current.closest('.postbox.carbon-box');\n if (carbonBox) {\n this.onClassChange(carbonBox, () => {\n this.map.invalidateSize();\n });\n }\n var tabbedField = this.node.current.closest('.cf-complex__group.cf-complex__group--tabbed');\n if (tabbedField) {\n this.onHiddenToggle(tabbedField, () => {\n this.marker.closePopup();\n this.marker.openPopup();\n this.map.setView(this.marker.getLatLng()).panBy([0, -50]);\n this.map.invalidateSize();\n });\n }\n // Get results from Leaflet GeoSearch\n this.map.addEventListener('geosearch/showlocation', result => {\n var r = result.location;\n\n // Create marker\n if (this.marker) {\n this.marker.remove();\n }\n this.marker = result.marker;\n this.marker.options.draggable = true;\n this.marker.addTo(this.map);\n this.marker.dragging.enable();\n var address = this.marker.getPopup().getContent();\n\n // Save location to database\n onChange({\n lat: r.y,\n lng: r.x,\n address: address\n });\n\n // Adjust lat & lng on marker move\n this.marker.addEventListener('moveend', args => {\n var l = args.target.getLatLng();\n this.map.panTo(l);\n onChange({\n lat: l.lat,\n lng: l.lng\n });\n });\n });\n }\n\n /**\n * Listen for class change\n */\n onClassChange(node, callback) {\n var lastClassString = node.classList.toString();\n var mutationObserver = new MutationObserver(mutationList => {\n var _iterator = _createForOfIteratorHelper(mutationList),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n if (item.attributeName === 'class') {\n var classString = node.classList.toString();\n if (classString !== lastClassString) {\n callback(mutationObserver);\n lastClassString = classString;\n break;\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n });\n mutationObserver.observe(node, {\n attributes: true\n });\n return mutationObserver;\n }\n\n /**\n * Listen for add/remove attribute \"hidden\"\n */\n onHiddenToggle(node, callback) {\n var lastHiddenState = node.hasAttribute('hidden');\n var mutationObserver = new MutationObserver(mutationList => {\n var _iterator2 = _createForOfIteratorHelper(mutationList),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var item = _step2.value;\n if (item.attributeName === 'hidden') {\n var hiddenState = node.hasAttribute('hidden');\n if (hiddenState !== lastHiddenState) {\n callback(mutationObserver);\n lastHiddenState = hiddenState;\n break;\n }\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n });\n mutationObserver.observe(node, {\n attributes: true\n });\n return mutationObserver;\n }\n\n /**\n * Render a Leaflet Map field.\n *\n * @return {Object}\n */\n render() {\n return __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: this.props.className,\n ref: this.node\n });\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MapField);\n\n//# sourceURL=webpack://carbon-fields-leaflet-map/./assets/src/LeafletMap.js?"); /***/ }), diff --git a/assets/build/bundle.min.js b/assets/build/bundle.min.js index 2861f37..bf51544 100644 --- a/assets/build/bundle.min.js +++ b/assets/build/bundle.min.js @@ -1,2 +1,2 @@ /*! For license information please see bundle.min.js.LICENSE.txt */ -(()=>{var t={243:function(t,e){!function(t){"use strict";var e="1.9.4";function i(t){var e,i,n,o;for(i=1,n=arguments.length;i0?Math.floor(t):Math.ceil(t)};function I(t,e,i){return t instanceof Z?t:v(t)?new Z(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new Z(t.x,t.y):new Z(t,e,i)}function B(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.xe.y&&n.y=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.late.lng&&n.lng1,St=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",l,e),window.removeEventListener("testPassiveEventSupport",l,e)}catch(t){}return t}(),zt=!!document.createElement("canvas").getContext,Ot=!(!document.createElementNS||!$("svg").createSVGRect),Zt=!!Ot&&((Q=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(Q.firstChild&&Q.firstChild.namespaceURI)),At=!Ot&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),It=0===navigator.platform.indexOf("Mac"),Bt=0===navigator.platform.indexOf("Linux");function Rt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Nt={ie:et,ielt9:it,edge:nt,webkit:ot,android:st,android23:rt,androidStock:ht,opera:lt,chrome:ut,gecko:ct,safari:dt,phantom:pt,opera12:_t,win:mt,ie3d:ft,webkit3d:vt,gecko3d:gt,any3d:yt,mobile:bt,mobileWebkit:xt,mobileWebkit3d:wt,msPointer:Lt,pointer:Pt,touch:Mt,touchNative:Tt,mobileOpera:Ct,mobileGecko:Et,retina:kt,passiveEvents:St,canvas:zt,svg:Ot,vml:At,inlineSvg:Zt,mac:It,linux:Bt},jt=Nt.msPointer?"MSPointerDown":"pointerdown",Dt=Nt.msPointer?"MSPointerMove":"pointermove",Ft=Nt.msPointer?"MSPointerUp":"pointerup",Ut=Nt.msPointer?"MSPointerCancel":"pointercancel",Ht={touchstart:jt,touchmove:Dt,touchend:Ft,touchcancel:Ut},Wt={touchstart:te,touchmove:Qt,touchend:Qt,touchcancel:Qt},qt={},Vt=!1;function Gt(t,e,i){return"touchstart"===e&&Xt(),Wt[e]?(i=Wt[e].bind(this,i),t.addEventListener(Ht[e],i,!1),i):(console.warn("wrong event specified:",e),l)}function Kt(t,e,i){Ht[e]?t.removeEventListener(Ht[e],i,!1):console.warn("wrong event specified:",e)}function Yt(t){qt[t.pointerId]=t}function Jt(t){qt[t.pointerId]&&(qt[t.pointerId]=t)}function $t(t){delete qt[t.pointerId]}function Xt(){Vt||(document.addEventListener(jt,Yt,!0),document.addEventListener(Dt,Jt,!0),document.addEventListener(Ft,$t,!0),document.addEventListener(Ut,$t,!0),Vt=!0)}function Qt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],qt)e.touches.push(qt[i]);e.changedTouches=[e],t(e)}}function te(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&Ye(e),Qt(t,e)}function ee(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return t=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var ie=200;function ne(t,e){t.addEventListener("dblclick",e);var i,n=0;function o(t){if(1===t.detail){if("mouse"!==t.pointerType&&(!t.sourceCapabilities||t.sourceCapabilities.firesTouchEvents)){var o=$e(t);if(!o.some((function(t){return t instanceof HTMLLabelElement&&t.attributes.for}))||o.some((function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement}))){var s=Date.now();s-n<=ie?2==++i&&e(ee(t)):i=1,n=s}}}else i=t.detail}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function oe(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var se,re,ae,he,le,ue=Ce(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ce=Ce(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===ce||"OTransition"===ce?ce+"End":"transitionend";function pe(t){return"string"==typeof t?document.getElementById(t):t}function _e(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function me(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function fe(t){var e=t.parentNode;e&&e.removeChild(t)}function ve(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ge(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ye(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function be(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=Pe(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function xe(t,e){if(void 0!==t.classList)for(var i=d(e),n=0,o=i.length;n0?2*window.devicePixelRatio:1;function ti(t){return Nt.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Qe:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function ei(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var ii={__proto__:null,on:je,off:Fe,stopPropagation:Ve,disableScrollPropagation:Ge,disableClickPropagation:Ke,preventDefault:Ye,stop:Je,getPropagationPath:$e,getMousePosition:Xe,getWheelDelta:ti,isExternalTarget:ei,addListener:je,removeListener:Fe},ni=O.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Se(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=M(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,j(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=I((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=I(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=this.project(t),r=this.getPixelBounds(),a=R([r.min.add(i),r.max.subtract(n)]),h=a.getSize();if(!a.contains(s)){this._enforcingBounds=!0;var l=s.subtract(a.getCenter()),u=a.extend(s).getSize().subtract(h);o.x+=l.x<0?-u.x:u.x,o.y+=l.y<0?-u.y:u.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),s=e.divideBy(2).round(),r=n.divideBy(2).round(),a=s.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o(this._handleGeolocationResponse,this),n=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,n,t):navigator.geolocation.getCurrentPosition(e,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new D(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),fe(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(C(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)fe(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=me("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new N(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=j(t),i=I(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(i),l=R(this.project(a,n),this.project(r,n)).getSize(),u=Nt.any3d?this.options.zoomSnap:1,c=h.x/l.x,d=h.y/l.y,p=e?Math.max(c,d):Math.min(c,d);return n=this.getScaleZoom(p,n),u&&(n=Math.round(n/(u/100))*(u/100),n=e?Math.ceil(n/u)*u:Math.floor(n/u)*u),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new Z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new B(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(I(t),e)},layerPointToLatLng:function(t){var e=I(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(j(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return I(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return I(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(I(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return Xe(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=pe(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");je(e,"scroll",this._onScroll,this),this._containerId=r(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Nt.any3d,xe(t,"leaflet-container"+(Nt.touch?" leaflet-touch":"")+(Nt.retina?" leaflet-retina":"")+(Nt.ielt9?" leaflet-oldie":"")+(Nt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=_e(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ke(this._mapPane,new Z(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(xe(t.markerPane,"leaflet-zoom-hide"),xe(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){ke(this._mapPane,new Z(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return C(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){ke(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[r(this._container)]=this;var e=t?Fe:je;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Nt.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){C(this._resizeRequest),this._resizeRequest=M((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,a=!1;s;){if((i=this._targets[r(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(o&&!ei(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||a||o||!this.listens(e,!0)||(n=[this]),n},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var i=t.type;"mousedown"===i&&Ae(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}var s=this._findEventTargets(t,e);if(n){for(var r=[],a=0;a0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=Nt.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){we(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=me("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=ue,i=this._proxy.style[e];Ee(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){fe(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Ee(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(M((function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,xe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&we(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function si(t,e){return new oi(t,e)}var ri=k.extend({options:{position:"topright"},initialize:function(t){p(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return xe(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(fe(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ai=function(t){return new ri(t)};oi.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=me("div",e+"control-container",this._container);function n(n,o){var s=e+n+" "+e+o;t[n+o]=me("div",s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)fe(this._controlCorners[t]);fe(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var hi=ri.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(r(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+r(this),n),this._layerControlInputs.push(e),e.layerId=r(t.layer),je(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("span");return i.appendChild(s),s.appendChild(e),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&ne.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,je(t,"click",Ye),this.expand();var e=this;setTimeout((function(){Fe(t,"click",Ye),e._preventClick=!1}))}}),li=function(t,e,i){return new hi(t,e,i)},ui=ri.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=me("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=me("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Ke(s),je(s,"click",Je),je(s,"click",o,this),je(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";we(this._zoomInButton,e),we(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(xe(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(xe(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});oi.mergeOptions({zoomControl:!0}),oi.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ui,this.addControl(this.zoomControl))}));var ci=function(t){return new ui(t)},di=ri.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=me("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=me("div",e,i)),t.imperial&&(this._iScale=me("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),pi=function(t){return new di(t)},_i='',mi=ri.extend({options:{position:"bottomright",prefix:''+(Nt.inlineSvg?_i+" ":"")+"Leaflet"},initialize:function(t){p(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=me("div","leaflet-control-attribution"),Ke(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' ')}}});oi.mergeOptions({attributionControl:!0}),oi.addInitHook((function(){this.options.attributionControl&&(new mi).addTo(this)}));var fi=function(t){return new mi(t)};ri.Layers=hi,ri.Zoom=ui,ri.Scale=di,ri.Attribution=mi,ai.layers=li,ai.zoom=ci,ai.scale=pi,ai.attribution=fi;var vi=k.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});vi.addTo=function(t,e){return t.addHandler(e,this),this};var gi={Events:z},yi=Nt.touch?"touchstart mousedown":"mousedown",bi=O.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){p(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(je(this._dragStartTarget,yi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(bi._dragging===this&&this.finishDrag(!0),Fe(this._dragStartTarget,yi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!be(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)bi._dragging===this&&this.finishDrag();else if(!(bi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(bi._dragging=this,this._preventOutline&&Ae(this._element),Oe(),se(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Be(this._element);this._startPoint=new Z(e.clientX,e.clientY),this._startPos=Se(this._element),this._parentScale=Re(i);var n="mousedown"===t.type;je(document,n?"mousemove":"touchmove",this._onMove,this),je(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new Z(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)h&&(s=r,h=a);h>i&&(e[s]=1,Si(t,e,i,n,s),Si(t,e,i,s,o))}function zi(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;ne&&(i.push(t[n]),o=n);return oe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function Ii(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Bi(t,e,i,n){var o,s=e.x,r=e.y,a=i.x-s,h=i.y-r,l=a*a+h*h;return l>0&&((o=((t.x-s)*a+(t.y-r)*h)/l)>1?(s=i.x,r=i.y):o>0&&(s+=a*o,r+=h*o)),a=t.x-s,h=t.y-r,n?a*a+h*h:new Z(s,r)}function Ri(t){return!v(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Ni(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ri(t)}function ji(t,e){var i,n,o,s,r,a,h,l;if(!t||0===t.length)throw new Error("latlngs not passed");Ri(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var u=F([0,0]),c=j(t);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(u=Li(t));var d=t.length,p=[];for(i=0;in){h=(s-n)/o,l=[a.x-h*(a.x-r.x),a.y-h*(a.y-r.y)];break}var m=e.unproject(I(l));return F([m.lat+u.lat,m.lng+u.lng])}var Di={__proto__:null,simplify:Mi,pointToSegmentDistance:Ci,closestPointOnSegment:Ei,clipSegment:Oi,_getEdgeIntersection:Zi,_getBitCode:Ai,_sqClosestPointOnSegment:Bi,isFlat:Ri,_flat:Ni,polylineCenter:ji},Fi={project:function(t){return new Z(t.lng,t.lat)},unproject:function(t){return new D(t.y,t.x)},bounds:new B([-180,-90],[180,90])},Ui={R:6378137,R_MINOR:6356752.314245179,bounds:new B([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(a,1e-10)),new Z(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,l=.1;h<15&&Math.abs(l)>1e-7;h++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=l=Math.PI/2-2*Math.atan(r*e)-a;return new D(a*i,t.x*i/n)}},Hi={__proto__:null,LonLat:Fi,Mercator:Ui,SphericalMercator:V},Wi=i({},W,{code:"EPSG:3395",projection:Ui,transformation:function(){var t=.5/(Math.PI*Ui.R);return K(t,.5,-t,.5)}()}),qi=i({},W,{code:"EPSG:4326",projection:Fi,transformation:K(1/180,1,-1/180,.5)}),Vi=i({},H,{projection:Fi,transformation:K(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});H.Earth=W,H.EPSG3395=Wi,H.EPSG3857=Y,H.EPSG900913=J,H.EPSG4326=qi,H.Simple=Vi;var Gi=O.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[r(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[r(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});oi.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=r(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=r(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return r(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?v(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof D&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){un.prototype._setLatLngs.call(this,t),Ri(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ri(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new Z(e,e);if(t=new B(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;ot.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(l=!l);return l||un.prototype._containsPoint.call(this,t,!0)}});function pn(t,e){return new dn(t,e)}var _n=Ji.extend({initialize:function(t,e){p(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=v(t)?t:t.features;if(o){for(e=0,i=o.length;e0&&o.push(o[0].slice()),o}function xn(t,e){return t.feature?i({},t.feature,{geometry:e}):wn(e)}function wn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Ln={toGeoJSON:function(t){return xn(this,{type:"Point",coordinates:yn(this.getLatLng(),t)})}};function Pn(t,e){return new _n(t,e)}nn.include(Ln),hn.include(Ln),rn.include(Ln),un.include({toGeoJSON:function(t){var e=!Ri(this._latlngs);return xn(this,{type:(e?"Multi":"")+"LineString",coordinates:bn(this._latlngs,e?1:0,!1,t)})}}),dn.include({toGeoJSON:function(t){var e=!Ri(this._latlngs),i=e&&!Ri(this._latlngs[0]),n=bn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),xn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Ki.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),xn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var s=wn(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}})),i?xn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var Tn=Pn,Mn=Gi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=j(e),p(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(xe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){fe(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ge(this._image),this},bringToBack:function(){return this._map&&ye(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=j(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:me("img");xe(e,"leaflet-image-layer"),this._zoomAnimated&&xe(e,"leaflet-zoom-animated"),this.options.className&&xe(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Ee(this._image,i,e)},_reset:function(){var t=this._image,e=new B(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();ke(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){Te(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Cn=function(t,e,i){return new Mn(t,e,i)},En=Mn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:me("video");if(xe(e,"leaflet-image-layer"),this._zoomAnimated&&xe(e,"leaflet-zoom-animated"),this.options.className&&xe(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onloadeddata=o(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],s=0;s0?n:[e.src]}else{v(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var r=0;ro?(e.height=o+"px",xe(t,s)):we(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();ke(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(_e(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new Z(this._containerLeft,-i-this._containerBottom);o._add(Se(this._container));var s=t.layerPointToContainerPoint(o),r=I(this.options.autoPanPadding),a=I(this.options.autoPanPaddingTopLeft||r),h=I(this.options.autoPanPaddingBottomRight||r),l=t.getSize(),u=0,c=0;s.x+n+h.x>l.x&&(u=s.x+n-l.x+h.x),s.x-u-a.x<0&&(u=s.x-a.x),s.y+i+h.y>l.y&&(c=s.y+i-l.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(u||c)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([u,c]))}},_getAnchor:function(){return I(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),An=function(t,e){return new Zn(t,e)};oi.mergeOptions({closePopupOnClick:!0}),oi.include({openPopup:function(t,e,i){return this._initOverlay(Zn,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Gi.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Zn,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Ji||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){Je(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof sn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var In=On.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){On.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){On.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=On.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=me("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+r(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,s=n.latLngToContainerPoint(n.getCenter()),r=n.layerPointToContainerPoint(t),a=this.options.direction,h=o.offsetWidth,l=o.offsetHeight,u=I(this.options.offset),c=this._getAnchor();"top"===a?(e=h/2,i=l):"bottom"===a?(e=h/2,i=0):"center"===a?(e=h/2,i=l/2):"right"===a?(e=0,i=l/2):"left"===a?(e=h,i=l/2):r.xthis.options.maxZoom||in&&this._retainParent(o,s,r,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new Z(o,s);r.z=i+1;var a=this._tileCoordsToKey(r),h=this._tiles[a];h&&h.active?h.retain=!0:(h&&h.loaded&&(h.retain=!0),i+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,i);else{for(var c=o.min.y;c<=o.max.y;c++)for(var d=o.min.x;d<=o.max.x;d++){var p=new Z(d,c);if(p.z=this._tileZoom,this._isValidTile(p)){var _=this._tiles[this._tileCoordsToKey(p)];_?_.current=!0:r.push(p)}}if(r.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(d=0;di.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return j(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new N(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new Z(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(fe(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){xe(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=l,t.onmousemove=l,Nt.ielt9&&this.options.opacity<1&&Te(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&M(o(this._tileReady,this,t,null,s)),ke(s,i),this._tiles[n]={el:s,coords:t,current:!0},e.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(Te(i.el,0),C(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(xe(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Nt.ielt9||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new Z(this._wrapX?h(t.x,this._wrapX):t.x,this._wrapY?h(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new B(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Dn(t){return new jn(t)}var Fn=jn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=p(this,e)).detectRetina&&Nt.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return je(i,"load",o(this._tileOnLoad,this,e,i)),je(i,"error",o(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Nt.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return f(this._url,i(e,this.options))},_tileOnLoad:function(t,e){Nt.ielt9?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=l,e.onerror=l,!e.complete)){e.src=y;var i=this._tiles[t].coords;fe(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",y),jn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==y))return jn.prototype._tileReady.call(this,t,e,i)}});function Un(t,e){return new Fn(t,e)}var Hn=Fn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var s=(e=p(this,e)).detectRetina&&Nt.retina?2:1,r=this.getTileSize();n.width=r.x*s,n.height=r.y*s,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Fn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===qi?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=Fn.prototype.getTileUrl.call(this,t);return a+_(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Wn(t,e){return new Hn(t,e)}Fn.WMS=Hn,Un.wms=Wn;var qn=Gi.extend({options:{padding:.1},initialize:function(t){p(this,t),r(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),xe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),s=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));Nt.any3d?Ee(this._container,s,i):ke(this._container,s)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new B(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Vn=qn.extend({options:{tolerance:0},getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){qn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");je(t,"mousemove",this._onMouseMove,this),je(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),je(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){C(this._redrawRequest),delete this._ctx,fe(this._container),Fe(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Nt.retina?2:1;ke(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Nt.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){qn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[r(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[r(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Yn={_initContainer:function(){this._container=me("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(qn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Kn("shape");xe(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Kn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;fe(e),t.removeInteractiveTarget(e),delete this._layers[r(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Kn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=v(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Kn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ge(t._container)},_bringToBack:function(t){ye(t._container)}},Jn=Nt.vml?Kn:$,$n=qn.extend({_initContainer:function(){this._container=Jn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Jn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){fe(this._container),Fe(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),ke(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Jn("path");t.options.className&&xe(e,t.options.className),t.options.interactive&&xe(e,"leaflet-interactive"),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){fe(t._path),t.removeInteractiveTarget(t._path),delete this._layers[r(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ge(t._path)},_bringToBack:function(t){ye(t._path)}});function Xn(t){return Nt.svg||Nt.vml?new $n(t):null}Nt.vml&&$n.include(Yn),oi.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Gn(t)||Xn(t)}});var Qn=dn.extend({initialize:function(t,e){dn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=j(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function to(t,e){return new Qn(t,e)}$n.create=Jn,$n.pointsToPath=X,_n.geometryToLayer=mn,_n.coordsToLatLng=vn,_n.coordsToLatLngs=gn,_n.latLngToCoords=yn,_n.latLngsToCoords=bn,_n.getFeature=xn,_n.asFeature=wn,oi.mergeOptions({boxZoom:!0});var eo=vi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){je(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Fe(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){fe(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),se(),Oe(),this._startPoint=this._map.mouseEventToContainerPoint(t),je(document,{contextmenu:Je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=me("div","leaflet-zoom-box",this._container),xe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new B(this._point,this._startPoint),i=e.getSize();ke(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(fe(this._box),we(this._container,"leaflet-crosshair")),re(),Ze(),Fe(document,{contextmenu:Je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var e=new N(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});oi.addInitHook("addHandler","boxZoom",eo),oi.mergeOptions({doubleClickZoom:!0});var io=vi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});oi.addInitHook("addHandler","doubleClickZoom",io),oi.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var no=vi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new bi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}xe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){we(this._map._container,"leaflet-grab"),we(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=j(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)0?s:-s))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});oi.addInitHook("addHandler","scrollWheelZoom",so);var ro=600;oi.mergeOptions({tapHold:Nt.touchNative&&Nt.safari&&Nt.mobile,tapTolerance:15});var ao=vi.extend({addHooks:function(){je(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Fe(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new Z(e.clientX,e.clientY),this._holdTimeout=setTimeout(o((function(){this._cancel(),this._isTapValid()&&(je(document,"touchend",Ye),je(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))}),this),ro),je(document,"touchend touchcancel contextmenu",this._cancel,this),je(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){Fe(document,"touchend",Ye),Fe(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),Fe(document,"touchend touchcancel contextmenu",this._cancel,this),Fe(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new Z(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});oi.addInitHook("addHandler","tapHold",ao),oi.mergeOptions({touchZoom:Nt.touch,bounceAtZoomLimits:!0});var ho=vi.extend({addHooks:function(){xe(this._map._container,"leaflet-touch-zoom"),je(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){we(this._map._container,"leaflet-touch-zoom"),Fe(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),je(document,"touchmove",this._onTouchMove,this),je(document,"touchend touchcancel",this._onTouchEnd,this),Ye(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),s=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(s,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&s>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),C(this._animRequest);var a=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=M(a,this,!0),Ye(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,C(this._animRequest),Fe(document,"touchmove",this._onTouchMove,this),Fe(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});oi.addInitHook("addHandler","touchZoom",ho),oi.BoxZoom=eo,oi.DoubleClickZoom=io,oi.Drag=no,oi.Keyboard=oo,oi.ScrollWheelZoom=so,oi.TapHold=ao,oi.TouchZoom=ho,t.Bounds=B,t.Browser=Nt,t.CRS=H,t.Canvas=Vn,t.Circle=hn,t.CircleMarker=rn,t.Class=k,t.Control=ri,t.DivIcon=Rn,t.DivOverlay=On,t.DomEvent=ii,t.DomUtil=Ne,t.Draggable=bi,t.Evented=O,t.FeatureGroup=Ji,t.GeoJSON=_n,t.GridLayer=jn,t.Handler=vi,t.Icon=Xi,t.ImageOverlay=Mn,t.LatLng=D,t.LatLngBounds=N,t.Layer=Gi,t.LayerGroup=Ki,t.LineUtil=Di,t.Map=oi,t.Marker=nn,t.Mixin=gi,t.Path=sn,t.Point=Z,t.PolyUtil=Ti,t.Polygon=dn,t.Polyline=un,t.Popup=Zn,t.PosAnimation=ni,t.Projection=Hi,t.Rectangle=Qn,t.Renderer=qn,t.SVG=$n,t.SVGOverlay=Sn,t.TileLayer=Fn,t.Tooltip=In,t.Transformation=G,t.Util=E,t.VideoOverlay=En,t.bind=o,t.bounds=R,t.canvas=Gn,t.circle=ln,t.circleMarker=an,t.control=ai,t.divIcon=Nn,t.extend=i,t.featureGroup=$i,t.geoJSON=Pn,t.geoJson=Tn,t.gridLayer=Dn,t.icon=Qi,t.imageOverlay=Cn,t.latLng=F,t.latLngBounds=j,t.layerGroup=Yi,t.map=si,t.marker=on,t.point=I,t.polygon=pn,t.polyline=cn,t.popup=An,t.rectangle=to,t.setOptions=p,t.stamp=r,t.svg=Xn,t.svgOverlay=zn,t.tileLayer=Un,t.tooltip=Bn,t.transformation=K,t.version=e,t.videoOverlay=kn;var lo=window.L;t.noConflict=function(){return window.L=lo,this},window.L=t}(e)},594:t=>{"use strict";t.exports=cf.vendor["@wordpress/element"]}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=cf.core;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){var i=function(t,i){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,i||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(t)}(t,"string");return"symbol"===e(i)?i:String(i)}function o(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var s=i(594);cf.vendor["@wordpress/i18n"];var r=i(243),a=i.n(r);function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e0?(m(this.container.parentElement,"open"),m(this.container,"active")):this.notFoundMessage&&(this.container.appendChild(this.notFoundMessage),m(this.container.parentElement,"open")),this.results=t},e.select=function(t){return Array.from(this.container.children).forEach((function(e,i){return i===t?m(e,"active"):f(e,"active")})),this.selected=t,this.results[t]},e.count=function(){return this.results?this.results.length:0},e.clear=function(){for(this.selected=-1;this.container.lastChild;)this.container.removeChild(this.container.lastChild);f(this.container.parentElement,"open"),f(this.container,"active")},t}(),T={position:"topleft",style:"button",showMarker:!0,showPopup:!1,popupFormat:function(t){return""+t.result.label},resultFormat:function(t){return""+t.result.label},marker:{icon:r&&r.Icon?new r.Icon.Default:void 0,draggable:!1},maxMarkers:1,maxSuggestions:5,retainZoomLevel:!1,animateZoom:!0,searchLabel:"Enter address",clearSearchLabel:"Clear search",notFoundMessage:"",messageHideDelay:3e3,zoomLevel:18,classNames:{container:"leaflet-bar leaflet-control leaflet-control-geosearch",button:"leaflet-bar-part leaflet-bar-part-single",resetButton:"reset",msgbox:"leaflet-bar message",form:"",input:"",resultlist:"",item:"",notfound:"leaflet-bar-notfound"},autoComplete:!0,autoCompleteDelay:250,autoClose:!1,keepResult:!1,updateMap:!0},M="Leaflet must be loaded before instantiating the GeoSearch control",C={options:h({},T),classNames:h({},T.classNames),initialize:function(t){var e,i,n,o,s=this;if(!r)throw new Error(M);if(!t.provider)throw new Error("Provider is missing from options");this.options=h({},T,t),this.classNames=h({},this.classNames,t.classNames),this.markers=new r.FeatureGroup,this.classNames.container+=" leaflet-geosearch-"+this.options.style,this.searchElement=new L({searchLabel:this.options.searchLabel,classNames:{container:this.classNames.container,form:this.classNames.form,input:this.classNames.input},handleSubmit:function(t){return s.onSubmit(t)}}),this.button=d("a",this.classNames.button,this.searchElement.container,{title:this.options.searchLabel,href:"#",onClick:function(t){return s.onClick(t)}}),r.DomEvent.disableClickPropagation(this.button),this.resetButton=d("button",this.classNames.resetButton,this.searchElement.form,{text:"×","aria-label":this.options.clearSearchLabel,onClick:function(){""===s.searchElement.input.value?s.close():s.clearResults(null,!0)}}),r.DomEvent.disableClickPropagation(this.resetButton),this.options.autoComplete&&(this.resultList=new P({handleClick:function(t){var e=t.result;s.searchElement.input.value=e.label,s.onSubmit({query:e.label,data:e})},classNames:{resultlist:this.classNames.resultlist,item:this.classNames.item,notfound:this.classNames.notfound},notFoundMessage:this.options.notFoundMessage}),this.searchElement.form.appendChild(this.resultList.container),this.searchElement.input.addEventListener("keyup",(e=function(t){return s.autoSearch(t)},void 0===(i=this.options.autoCompleteDelay)&&(i=250),void 0===n&&(n=!1),function(){var t=[].slice.call(arguments);o&&clearTimeout(o),o=setTimeout((function(){o=null,n||e.apply(void 0,t)}),i),n&&!o&&e.apply(void 0,t)}),!0),this.searchElement.input.addEventListener("keydown",(function(t){return s.selectResult(t)}),!0),this.searchElement.input.addEventListener("keydown",(function(t){return s.clearResults(t,!0)}),!0)),this.searchElement.form.addEventListener("click",(function(t){t.preventDefault()}),!1)},onAdd:function(t){var e=this.options,i=e.showMarker,n=e.style;if(this.map=t,i&&this.markers.addTo(t),"bar"===n){var o=t.getContainer().querySelector(".leaflet-control-container");this.container=d("div","leaflet-control-geosearch leaflet-geosearch-bar"),this.container.appendChild(this.searchElement.form),o.appendChild(this.container)}return r.DomEvent.disableClickPropagation(this.searchElement.form),this.searchElement.container},onRemove:function(){var t;return null==(t=this.container)||t.remove(),this},open:function(){var t=this.searchElement,e=t.input;m(t.container,"active"),e.focus()},close:function(){f(this.searchElement.container,"active"),this.clearResults()},onClick:function(t){t.preventDefault(),t.stopPropagation(),this.searchElement.container.classList.contains("active")?this.close():this.open()},selectResult:function(t){if(-1!==[y,b,x].indexOf(t.keyCode))if(t.preventDefault(),t.keyCode!==y){var e=this.resultList.count()-1;if(!(e<0)){var i=this.resultList.selected,n=t.keyCode===b?i+1:i-1,o=this.resultList.select(n<0?e:n>e?0:n);this.searchElement.input.value=o.label}}else{var s=this.resultList.select(this.resultList.selected);this.onSubmit({query:this.searchElement.input.value,data:s})}},clearResults:function(t,e){if(void 0===e&&(e=!1),!t||27===t.keyCode){var i=this.options,n=i.autoComplete;!e&&i.keepResult||(this.searchElement.input.value="",this.markers.clearLayers()),n&&this.resultList.clear()}},autoSearch:function(t){try{var e=this;if(w.indexOf(t.keyCode)>-1)return Promise.resolve();var i=t.target.value,n=e.options.provider,o=function(){if(i.length)return Promise.resolve(n.search({query:i})).then((function(t){t=t.slice(0,e.options.maxSuggestions),e.resultList.render(t,e.options.resultFormat)}));e.resultList.clear()}();return Promise.resolve(o&&o.then?o.then((function(){})):void 0)}catch(t){return Promise.reject(t)}},onSubmit:function(t){try{var e=this;return e.resultList.clear(),Promise.resolve(e.options.provider.search(t)).then((function(i){i&&i.length>0&&e.showResult(i[0],t)}))}catch(t){return Promise.reject(t)}},showResult:function(t,e){var i=this.options,n=i.autoClose,o=i.updateMap,s=this.markers.getLayers();s.length>=this.options.maxMarkers&&this.markers.removeLayer(s[0]);var r=this.addMarker(t,e);o&&this.centerMap(t),this.map.fireEvent("geosearch/showlocation",{location:t,marker:r}),n&&this.closeResults()},closeResults:function(){var t=this.searchElement.container;t.classList.contains("active")&&f(t,"active"),this.clearResults()},addMarker:function(t,e){var i=this,n=this.options,o=n.marker,s=n.showPopup,a=n.popupFormat,h=new r.Marker([t.y,t.x],o),l=t.label;return"function"==typeof a&&(l=a({query:e,result:t})),h.bindPopup(l),this.markers.addLayer(h),s&&h.openPopup(),o.draggable&&h.on("dragend",(function(t){i.map.fireEvent("geosearch/marker/dragend",{location:h.getLatLng(),event:t})})),h},centerMap:function(t){var e=this.options,i=e.retainZoomLevel,n=e.animateZoom,o=t.bounds?new r.LatLngBounds(t.bounds):new r.LatLng(t.y,t.x).toBounds(10),s=o.isValid()?o:this.markers.getBounds();!i&&o.isValid()&&!t.bounds||i||!o.isValid()?this.map.setView(s.getCenter(),this.getZoom(),{animate:n}):this.map.fitBounds(s,{animate:n})},getZoom:function(){var t=this.options,e=t.zoomLevel;return t.retainZoomLevel?this.map.getZoom():e}};function E(){if(!r)throw new Error(M);return c(r.Control.extend(C),[].slice.call(arguments))}(g=v||(v={}))[g.SEARCH=0]="SEARCH",g[g.REVERSE=1]="REVERSE";var k,S=function(){function t(t){void 0===t&&(t={}),this.options=void 0,this.options=t}var e=t.prototype;return e.getParamString=function(t){void 0===t&&(t={});var e=h({},this.options.params,t);return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")},e.getUrl=function(t,e){return t+"?"+this.getParamString(e)},e.search=function(t){try{var e=this,i=e.endpoint({query:t.query,type:v.SEARCH});return Promise.resolve(fetch(i)).then((function(t){return Promise.resolve(t.json()).then((function(t){return e.parse({data:t})}))}))}catch(t){return Promise.reject(t)}},t}(),z=function(t){function e(){return t.apply(this,arguments)||this}l(e,t);var i=e.prototype;return i.endpoint=function(){return"https://places-dsn.algolia.net/1/places/query"},i.findBestMatchLevelIndex=function(t){var e=t.find((function(t){return"full"===t.matchLevel}))||t.find((function(t){return"partial"===t.matchLevel}));return e?t.indexOf(e):0},i.getLabel=function(t){var e,i,n,o;return[null==(e=t.locale_names)?void 0:e.default[this.findBestMatchLevelIndex(t._highlightResult.locale_names.default)],null==(i=t.city)?void 0:i.default[this.findBestMatchLevelIndex(t._highlightResult.city.default)],t.administrative[this.findBestMatchLevelIndex(t._highlightResult.administrative)],null==(n=t.postcode)?void 0:n[this.findBestMatchLevelIndex(t._highlightResult.postcode)],null==(o=t.country)?void 0:o.default].filter(Boolean).join(", ")},i.parse=function(t){var e=this;return t.data.hits.map((function(t){return{x:t._geoloc.lng,y:t._geoloc.lat,label:e.getLabel(t),bounds:null,raw:t}}))},i.search=function(t){var e=t.query;try{var i=this,n="string"==typeof e?{query:e}:e;return Promise.resolve(fetch(i.endpoint(),{method:"POST",body:JSON.stringify(h({},i.options.params,n))})).then((function(t){return Promise.resolve(t.json()).then((function(t){return i.parse({data:t})}))}))}catch(t){return Promise.reject(t)}},e}(S),O=function(t){function e(){for(var e,i=arguments.length,n=new Array(i),o=0;o=this.retries+1}createUrl(){let t=this.url;return t+=`?callback=${this.CALLBACK}`,this.apiKey&&(t+=`&key=${this.apiKey}`),this.channel&&(t+=`&channel=${this.channel}`),this.client&&(t+=`&client=${this.client}`),this.libraries.length>0&&(t+=`&libraries=${this.libraries.join(",")}`),this.language&&(t+=`&language=${this.language}`),this.region&&(t+=`®ion=${this.region}`),this.version&&(t+=`&v=${this.version}`),this.mapIds&&(t+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(t+=`&auth_referrer_policy=${this.authReferrerPolicy}`),t}deleteScript(){const t=document.getElementById(this.id);t&&t.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise(((t,e)=>{this.loadCallback((i=>{i?e(i.error):t(window.google)}))}))}loadCallback(t){this.callbacks.push(t),this.execute()}setScript(){if(document.getElementById(this.id))return void this.callback();const t=this.createUrl(),e=document.createElement("script");e.id=this.id,e.type="text/javascript",e.src=t,e.onerror=this.loadErrorCallback.bind(this),e.defer=!0,e.async=!0,this.nonce&&(e.nonce=this.nonce),document.head.appendChild(e)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(t){if(this.errors.push(t),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.log(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout((()=>{this.deleteScript(),this.setScript()}),t)}else this.onerrorEvent=t,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach((t=>{t(this.onerrorEvent)})),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}var N=function(t){function e(e){var i;return(i=t.call(this,e)||this).loader=null,i.geocoder=null,"undefined"!=typeof window&&(i.loader=new R(e).load().then((function(t){var e=new t.maps.Geocoder;return i.geocoder=e,e}))),i}l(e,t);var i=e.prototype;return i.endpoint=function(t){throw new Error("Method not implemented.")},i.parse=function(t){return t.data.results.map((function(t){var e=t.geometry.location.toJSON(),i=e.lat,n=e.lng,o=t.geometry.viewport.toJSON();return{x:n,y:i,label:t.formatted_address,bounds:[[o.south,o.west],[o.north,o.east]],raw:t}}))},i.search=function(t){try{var e=function(e){if(!e)throw new Error("GoogleMaps GeoCoder is not loaded. Are you trying to run this server side?");return Promise.resolve(e.geocode({address:t.query},(function(t){return{results:t}})).catch((function(t){return"ZERO_RESULTS"!==t.code&&console.error(t.code+": "+t.message),{results:[]}}))).then((function(t){return i.parse({data:t})}))},i=this,n=i.geocoder;return Promise.resolve(n?e(n):Promise.resolve(i.loader).then(e))}catch(t){return Promise.reject(t)}},e}(S),j=function(t){function e(e){var i;void 0===e&&(e={}),(i=t.call(this,e)||this).searchUrl=void 0,i.reverseUrl=void 0;var n="https://nominatim.openstreetmap.org";return i.searchUrl=e.searchUrl||n+"/search",i.reverseUrl=e.reverseUrl||n+"/reverse",i}l(e,t);var i=e.prototype;return i.endpoint=function(t){var e=t.query,i=t.type,n="string"==typeof e?{q:e}:e;return n.format="json",this.getUrl(i===v.REVERSE?this.reverseUrl:this.searchUrl,n)},i.parse=function(t){return(Array.isArray(t.data)?t.data:[t.data]).map((function(t){return{x:Number(t.lon),y:Number(t.lat),label:t.display_name,bounds:[[parseFloat(t.boundingbox[0]),parseFloat(t.boundingbox[2])],[parseFloat(t.boundingbox[1]),parseFloat(t.boundingbox[3])]],raw:t}}))},e}(S),D=function(t){function e(e){return t.call(this,h({},e,{searchUrl:"https://locationiq.org/v1/search.php",reverseUrl:"https://locationiq.org/v1/reverse.php"}))||this}return l(e,t),e.prototype.parse=function(e){return e.data.error?[]:t.prototype.parse.call(this,e)},e}(j),F=function(t){function e(){for(var e,i=arguments.length,n=new Array(i),o=0;o=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,r=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return r=t.done,t},e:function(t){a=!0,s=t},f:function(){try{r||null==i.return||i.return()}finally{if(a)throw s}}}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i{setTimeout((()=>{this.marker.openPopup(),this.map.setView(this.marker.getLatLng()).panBy([0,-50])}),500)})))}setupMapEvents(){var t=this.props.onChange,e=this.node.current.closest(".postbox.carbon-box");e&&this.onClassChange(e,(()=>{this.map.invalidateSize()}));var i=this.node.current.closest(".cf-complex__group.cf-complex__group--tabbed");i&&this.onHiddenToggle(i,(()=>{this.marker.closePopup(),this.marker.openPopup(),this.map.setView(this.marker.getLatLng()).panBy([0,-50])})),this.map.addEventListener("geosearch/showlocation",(e=>{var i=e.location;this.marker&&this.marker.remove(),this.marker=e.marker,this.marker.options.draggable=!0,this.marker.addTo(this.map),this.marker.dragging.enable();var n=this.marker.getPopup().getContent();t({lat:i.y,lng:i.x,address:n}),this.marker.addEventListener("moveend",(e=>{var i=e.target.getLatLng();this.map.panTo(i),t({lat:i.lat,lng:i.lng})}))}))}onClassChange(t,e){var i=t.classList.toString(),n=new MutationObserver((o=>{var s,r=G(o);try{for(r.s();!(s=r.n()).done;){if("class"===s.value.attributeName){var a=t.classList.toString();if(a!==i){e(n),i=a;break}}}}catch(t){r.e(t)}finally{r.f()}}));return n.observe(t,{attributes:!0}),n}onHiddenToggle(t,e){var i=t.hasAttribute("hidden"),n=new MutationObserver((o=>{var s,r=G(o);try{for(r.s();!(s=r.n()).done;){if("hidden"===s.value.attributeName){var a=t.hasAttribute("hidden");if(a!==i){e(n),i=a;break}}}}catch(t){r.e(t)}finally{r.f()}}));return n.observe(t,{attributes:!0}),n}render(){return V.createElement("div",{className:this.props.className,ref:this.node})}}const J=Y;var $=i(594);function X(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Q(t){for(var e=1;e{var e=this.props,i=e.id,n=e.value;(0,e.onChange)(i,Q(Q({},n),t))}))}render(){var t=this.props,e=(t.id,t.name),i=t.value,n=t.field;return $.createElement(s.Fragment,null,$.createElement(J,{className:"cf-leaflet-map__canvas",value:i,field:n,onChange:this.handleChange}),$.createElement("input",{type:"hidden",name:`${e}[lat]`,value:i.lat,readOnly:!0}),$.createElement("input",{type:"hidden",name:`${e}[lng]`,value:i.lng,readOnly:!0}),$.createElement("input",{type:"hidden",name:`${e}[address]`,value:i.address,readOnly:!0}))}}const et=tt;(0,t.registerFieldType)("leaflet_map",et)})()})(); \ No newline at end of file +(()=>{var t={243:function(t,e){!function(t){"use strict";var e="1.9.4";function i(t){var e,i,n,o;for(i=1,n=arguments.length;i0?Math.floor(t):Math.ceil(t)};function I(t,e,i){return t instanceof Z?t:v(t)?new Z(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new Z(t.x,t.y):new Z(t,e,i)}function B(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.xe.y&&n.y=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.late.lng&&n.lng1,St=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",l,e),window.removeEventListener("testPassiveEventSupport",l,e)}catch(t){}return t}(),zt=!!document.createElement("canvas").getContext,Ot=!(!document.createElementNS||!$("svg").createSVGRect),Zt=!!Ot&&((Q=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(Q.firstChild&&Q.firstChild.namespaceURI)),At=!Ot&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),It=0===navigator.platform.indexOf("Mac"),Bt=0===navigator.platform.indexOf("Linux");function Rt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Nt={ie:et,ielt9:it,edge:nt,webkit:ot,android:st,android23:rt,androidStock:ht,opera:lt,chrome:ut,gecko:ct,safari:dt,phantom:pt,opera12:_t,win:mt,ie3d:ft,webkit3d:vt,gecko3d:gt,any3d:yt,mobile:bt,mobileWebkit:xt,mobileWebkit3d:wt,msPointer:Lt,pointer:Pt,touch:Mt,touchNative:Tt,mobileOpera:Ct,mobileGecko:Et,retina:kt,passiveEvents:St,canvas:zt,svg:Ot,vml:At,inlineSvg:Zt,mac:It,linux:Bt},jt=Nt.msPointer?"MSPointerDown":"pointerdown",Dt=Nt.msPointer?"MSPointerMove":"pointermove",Ft=Nt.msPointer?"MSPointerUp":"pointerup",Ut=Nt.msPointer?"MSPointerCancel":"pointercancel",Ht={touchstart:jt,touchmove:Dt,touchend:Ft,touchcancel:Ut},Wt={touchstart:te,touchmove:Qt,touchend:Qt,touchcancel:Qt},qt={},Vt=!1;function Gt(t,e,i){return"touchstart"===e&&Xt(),Wt[e]?(i=Wt[e].bind(this,i),t.addEventListener(Ht[e],i,!1),i):(console.warn("wrong event specified:",e),l)}function Kt(t,e,i){Ht[e]?t.removeEventListener(Ht[e],i,!1):console.warn("wrong event specified:",e)}function Yt(t){qt[t.pointerId]=t}function Jt(t){qt[t.pointerId]&&(qt[t.pointerId]=t)}function $t(t){delete qt[t.pointerId]}function Xt(){Vt||(document.addEventListener(jt,Yt,!0),document.addEventListener(Dt,Jt,!0),document.addEventListener(Ft,$t,!0),document.addEventListener(Ut,$t,!0),Vt=!0)}function Qt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],qt)e.touches.push(qt[i]);e.changedTouches=[e],t(e)}}function te(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&Ye(e),Qt(t,e)}function ee(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return t=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var ie=200;function ne(t,e){t.addEventListener("dblclick",e);var i,n=0;function o(t){if(1===t.detail){if("mouse"!==t.pointerType&&(!t.sourceCapabilities||t.sourceCapabilities.firesTouchEvents)){var o=$e(t);if(!o.some((function(t){return t instanceof HTMLLabelElement&&t.attributes.for}))||o.some((function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement}))){var s=Date.now();s-n<=ie?2==++i&&e(ee(t)):i=1,n=s}}}else i=t.detail}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function oe(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var se,re,ae,he,le,ue=Ce(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ce=Ce(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===ce||"OTransition"===ce?ce+"End":"transitionend";function pe(t){return"string"==typeof t?document.getElementById(t):t}function _e(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function me(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function fe(t){var e=t.parentNode;e&&e.removeChild(t)}function ve(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ge(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ye(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function be(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=Pe(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function xe(t,e){if(void 0!==t.classList)for(var i=d(e),n=0,o=i.length;n0?2*window.devicePixelRatio:1;function ti(t){return Nt.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Qe:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function ei(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var ii={__proto__:null,on:je,off:Fe,stopPropagation:Ve,disableScrollPropagation:Ge,disableClickPropagation:Ke,preventDefault:Ye,stop:Je,getPropagationPath:$e,getMousePosition:Xe,getWheelDelta:ti,isExternalTarget:ei,addListener:je,removeListener:Fe},ni=O.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Se(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=M(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,j(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=I((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=I(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=this.project(t),r=this.getPixelBounds(),a=R([r.min.add(i),r.max.subtract(n)]),h=a.getSize();if(!a.contains(s)){this._enforcingBounds=!0;var l=s.subtract(a.getCenter()),u=a.extend(s).getSize().subtract(h);o.x+=l.x<0?-u.x:u.x,o.y+=l.y<0?-u.y:u.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),s=e.divideBy(2).round(),r=n.divideBy(2).round(),a=s.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o(this._handleGeolocationResponse,this),n=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,n,t):navigator.geolocation.getCurrentPosition(e,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new D(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),fe(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(C(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)fe(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=me("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new N(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=j(t),i=I(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(i),l=R(this.project(a,n),this.project(r,n)).getSize(),u=Nt.any3d?this.options.zoomSnap:1,c=h.x/l.x,d=h.y/l.y,p=e?Math.max(c,d):Math.min(c,d);return n=this.getScaleZoom(p,n),u&&(n=Math.round(n/(u/100))*(u/100),n=e?Math.ceil(n/u)*u:Math.floor(n/u)*u),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new Z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new B(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(I(t),e)},layerPointToLatLng:function(t){var e=I(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(j(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return I(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return I(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(I(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return Xe(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=pe(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");je(e,"scroll",this._onScroll,this),this._containerId=r(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Nt.any3d,xe(t,"leaflet-container"+(Nt.touch?" leaflet-touch":"")+(Nt.retina?" leaflet-retina":"")+(Nt.ielt9?" leaflet-oldie":"")+(Nt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=_e(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ke(this._mapPane,new Z(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(xe(t.markerPane,"leaflet-zoom-hide"),xe(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){ke(this._mapPane,new Z(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return C(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){ke(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[r(this._container)]=this;var e=t?Fe:je;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Nt.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){C(this._resizeRequest),this._resizeRequest=M((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,a=!1;s;){if((i=this._targets[r(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(o&&!ei(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||a||o||!this.listens(e,!0)||(n=[this]),n},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var i=t.type;"mousedown"===i&&Ae(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}var s=this._findEventTargets(t,e);if(n){for(var r=[],a=0;a0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=Nt.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){we(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=me("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=ue,i=this._proxy.style[e];Ee(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){fe(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Ee(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(M((function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,xe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&we(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function si(t,e){return new oi(t,e)}var ri=k.extend({options:{position:"topright"},initialize:function(t){p(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return xe(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(fe(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ai=function(t){return new ri(t)};oi.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=me("div",e+"control-container",this._container);function n(n,o){var s=e+n+" "+e+o;t[n+o]=me("div",s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)fe(this._controlCorners[t]);fe(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var hi=ri.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(r(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+r(this),n),this._layerControlInputs.push(e),e.layerId=r(t.layer),je(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("span");return i.appendChild(s),s.appendChild(e),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&ne.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,je(t,"click",Ye),this.expand();var e=this;setTimeout((function(){Fe(t,"click",Ye),e._preventClick=!1}))}}),li=function(t,e,i){return new hi(t,e,i)},ui=ri.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=me("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=me("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Ke(s),je(s,"click",Je),je(s,"click",o,this),je(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";we(this._zoomInButton,e),we(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(xe(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(xe(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});oi.mergeOptions({zoomControl:!0}),oi.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ui,this.addControl(this.zoomControl))}));var ci=function(t){return new ui(t)},di=ri.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=me("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=me("div",e,i)),t.imperial&&(this._iScale=me("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),pi=function(t){return new di(t)},_i='',mi=ri.extend({options:{position:"bottomright",prefix:''+(Nt.inlineSvg?_i+" ":"")+"Leaflet"},initialize:function(t){p(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=me("div","leaflet-control-attribution"),Ke(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' ')}}});oi.mergeOptions({attributionControl:!0}),oi.addInitHook((function(){this.options.attributionControl&&(new mi).addTo(this)}));var fi=function(t){return new mi(t)};ri.Layers=hi,ri.Zoom=ui,ri.Scale=di,ri.Attribution=mi,ai.layers=li,ai.zoom=ci,ai.scale=pi,ai.attribution=fi;var vi=k.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});vi.addTo=function(t,e){return t.addHandler(e,this),this};var gi={Events:z},yi=Nt.touch?"touchstart mousedown":"mousedown",bi=O.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){p(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(je(this._dragStartTarget,yi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(bi._dragging===this&&this.finishDrag(!0),Fe(this._dragStartTarget,yi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!be(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)bi._dragging===this&&this.finishDrag();else if(!(bi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(bi._dragging=this,this._preventOutline&&Ae(this._element),Oe(),se(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Be(this._element);this._startPoint=new Z(e.clientX,e.clientY),this._startPos=Se(this._element),this._parentScale=Re(i);var n="mousedown"===t.type;je(document,n?"mousemove":"touchmove",this._onMove,this),je(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new Z(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)h&&(s=r,h=a);h>i&&(e[s]=1,Si(t,e,i,n,s),Si(t,e,i,s,o))}function zi(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;ne&&(i.push(t[n]),o=n);return oe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function Ii(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Bi(t,e,i,n){var o,s=e.x,r=e.y,a=i.x-s,h=i.y-r,l=a*a+h*h;return l>0&&((o=((t.x-s)*a+(t.y-r)*h)/l)>1?(s=i.x,r=i.y):o>0&&(s+=a*o,r+=h*o)),a=t.x-s,h=t.y-r,n?a*a+h*h:new Z(s,r)}function Ri(t){return!v(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Ni(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ri(t)}function ji(t,e){var i,n,o,s,r,a,h,l;if(!t||0===t.length)throw new Error("latlngs not passed");Ri(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var u=F([0,0]),c=j(t);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(u=Li(t));var d=t.length,p=[];for(i=0;in){h=(s-n)/o,l=[a.x-h*(a.x-r.x),a.y-h*(a.y-r.y)];break}var m=e.unproject(I(l));return F([m.lat+u.lat,m.lng+u.lng])}var Di={__proto__:null,simplify:Mi,pointToSegmentDistance:Ci,closestPointOnSegment:Ei,clipSegment:Oi,_getEdgeIntersection:Zi,_getBitCode:Ai,_sqClosestPointOnSegment:Bi,isFlat:Ri,_flat:Ni,polylineCenter:ji},Fi={project:function(t){return new Z(t.lng,t.lat)},unproject:function(t){return new D(t.y,t.x)},bounds:new B([-180,-90],[180,90])},Ui={R:6378137,R_MINOR:6356752.314245179,bounds:new B([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(a,1e-10)),new Z(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,l=.1;h<15&&Math.abs(l)>1e-7;h++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=l=Math.PI/2-2*Math.atan(r*e)-a;return new D(a*i,t.x*i/n)}},Hi={__proto__:null,LonLat:Fi,Mercator:Ui,SphericalMercator:V},Wi=i({},W,{code:"EPSG:3395",projection:Ui,transformation:function(){var t=.5/(Math.PI*Ui.R);return K(t,.5,-t,.5)}()}),qi=i({},W,{code:"EPSG:4326",projection:Fi,transformation:K(1/180,1,-1/180,.5)}),Vi=i({},H,{projection:Fi,transformation:K(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});H.Earth=W,H.EPSG3395=Wi,H.EPSG3857=Y,H.EPSG900913=J,H.EPSG4326=qi,H.Simple=Vi;var Gi=O.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[r(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[r(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});oi.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=r(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=r(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return r(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?v(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof D&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){un.prototype._setLatLngs.call(this,t),Ri(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ri(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new Z(e,e);if(t=new B(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;ot.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(l=!l);return l||un.prototype._containsPoint.call(this,t,!0)}});function pn(t,e){return new dn(t,e)}var _n=Ji.extend({initialize:function(t,e){p(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=v(t)?t:t.features;if(o){for(e=0,i=o.length;e0&&o.push(o[0].slice()),o}function xn(t,e){return t.feature?i({},t.feature,{geometry:e}):wn(e)}function wn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Ln={toGeoJSON:function(t){return xn(this,{type:"Point",coordinates:yn(this.getLatLng(),t)})}};function Pn(t,e){return new _n(t,e)}nn.include(Ln),hn.include(Ln),rn.include(Ln),un.include({toGeoJSON:function(t){var e=!Ri(this._latlngs);return xn(this,{type:(e?"Multi":"")+"LineString",coordinates:bn(this._latlngs,e?1:0,!1,t)})}}),dn.include({toGeoJSON:function(t){var e=!Ri(this._latlngs),i=e&&!Ri(this._latlngs[0]),n=bn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),xn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Ki.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),xn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var s=wn(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}})),i?xn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var Tn=Pn,Mn=Gi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=j(e),p(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(xe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){fe(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ge(this._image),this},bringToBack:function(){return this._map&&ye(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=j(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:me("img");xe(e,"leaflet-image-layer"),this._zoomAnimated&&xe(e,"leaflet-zoom-animated"),this.options.className&&xe(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Ee(this._image,i,e)},_reset:function(){var t=this._image,e=new B(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();ke(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){Te(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Cn=function(t,e,i){return new Mn(t,e,i)},En=Mn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:me("video");if(xe(e,"leaflet-image-layer"),this._zoomAnimated&&xe(e,"leaflet-zoom-animated"),this.options.className&&xe(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onloadeddata=o(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],s=0;s0?n:[e.src]}else{v(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var r=0;ro?(e.height=o+"px",xe(t,s)):we(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();ke(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(_e(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new Z(this._containerLeft,-i-this._containerBottom);o._add(Se(this._container));var s=t.layerPointToContainerPoint(o),r=I(this.options.autoPanPadding),a=I(this.options.autoPanPaddingTopLeft||r),h=I(this.options.autoPanPaddingBottomRight||r),l=t.getSize(),u=0,c=0;s.x+n+h.x>l.x&&(u=s.x+n-l.x+h.x),s.x-u-a.x<0&&(u=s.x-a.x),s.y+i+h.y>l.y&&(c=s.y+i-l.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(u||c)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([u,c]))}},_getAnchor:function(){return I(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),An=function(t,e){return new Zn(t,e)};oi.mergeOptions({closePopupOnClick:!0}),oi.include({openPopup:function(t,e,i){return this._initOverlay(Zn,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Gi.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Zn,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Ji||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){Je(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof sn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var In=On.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){On.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){On.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=On.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=me("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+r(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,s=n.latLngToContainerPoint(n.getCenter()),r=n.layerPointToContainerPoint(t),a=this.options.direction,h=o.offsetWidth,l=o.offsetHeight,u=I(this.options.offset),c=this._getAnchor();"top"===a?(e=h/2,i=l):"bottom"===a?(e=h/2,i=0):"center"===a?(e=h/2,i=l/2):"right"===a?(e=0,i=l/2):"left"===a?(e=h,i=l/2):r.xthis.options.maxZoom||in&&this._retainParent(o,s,r,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new Z(o,s);r.z=i+1;var a=this._tileCoordsToKey(r),h=this._tiles[a];h&&h.active?h.retain=!0:(h&&h.loaded&&(h.retain=!0),i+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,i);else{for(var c=o.min.y;c<=o.max.y;c++)for(var d=o.min.x;d<=o.max.x;d++){var p=new Z(d,c);if(p.z=this._tileZoom,this._isValidTile(p)){var _=this._tiles[this._tileCoordsToKey(p)];_?_.current=!0:r.push(p)}}if(r.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(d=0;di.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return j(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new N(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new Z(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(fe(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){xe(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=l,t.onmousemove=l,Nt.ielt9&&this.options.opacity<1&&Te(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&M(o(this._tileReady,this,t,null,s)),ke(s,i),this._tiles[n]={el:s,coords:t,current:!0},e.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(Te(i.el,0),C(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(xe(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Nt.ielt9||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new Z(this._wrapX?h(t.x,this._wrapX):t.x,this._wrapY?h(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new B(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Dn(t){return new jn(t)}var Fn=jn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=p(this,e)).detectRetina&&Nt.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return je(i,"load",o(this._tileOnLoad,this,e,i)),je(i,"error",o(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Nt.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return f(this._url,i(e,this.options))},_tileOnLoad:function(t,e){Nt.ielt9?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=l,e.onerror=l,!e.complete)){e.src=y;var i=this._tiles[t].coords;fe(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",y),jn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==y))return jn.prototype._tileReady.call(this,t,e,i)}});function Un(t,e){return new Fn(t,e)}var Hn=Fn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var s=(e=p(this,e)).detectRetina&&Nt.retina?2:1,r=this.getTileSize();n.width=r.x*s,n.height=r.y*s,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Fn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===qi?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=Fn.prototype.getTileUrl.call(this,t);return a+_(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Wn(t,e){return new Hn(t,e)}Fn.WMS=Hn,Un.wms=Wn;var qn=Gi.extend({options:{padding:.1},initialize:function(t){p(this,t),r(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),xe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),s=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));Nt.any3d?Ee(this._container,s,i):ke(this._container,s)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new B(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Vn=qn.extend({options:{tolerance:0},getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){qn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");je(t,"mousemove",this._onMouseMove,this),je(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),je(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){C(this._redrawRequest),delete this._ctx,fe(this._container),Fe(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Nt.retina?2:1;ke(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Nt.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){qn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[r(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[r(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Yn={_initContainer:function(){this._container=me("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(qn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Kn("shape");xe(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Kn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;fe(e),t.removeInteractiveTarget(e),delete this._layers[r(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Kn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=v(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Kn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ge(t._container)},_bringToBack:function(t){ye(t._container)}},Jn=Nt.vml?Kn:$,$n=qn.extend({_initContainer:function(){this._container=Jn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Jn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){fe(this._container),Fe(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),ke(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Jn("path");t.options.className&&xe(e,t.options.className),t.options.interactive&&xe(e,"leaflet-interactive"),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){fe(t._path),t.removeInteractiveTarget(t._path),delete this._layers[r(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ge(t._path)},_bringToBack:function(t){ye(t._path)}});function Xn(t){return Nt.svg||Nt.vml?new $n(t):null}Nt.vml&&$n.include(Yn),oi.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Gn(t)||Xn(t)}});var Qn=dn.extend({initialize:function(t,e){dn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=j(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function to(t,e){return new Qn(t,e)}$n.create=Jn,$n.pointsToPath=X,_n.geometryToLayer=mn,_n.coordsToLatLng=vn,_n.coordsToLatLngs=gn,_n.latLngToCoords=yn,_n.latLngsToCoords=bn,_n.getFeature=xn,_n.asFeature=wn,oi.mergeOptions({boxZoom:!0});var eo=vi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){je(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Fe(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){fe(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),se(),Oe(),this._startPoint=this._map.mouseEventToContainerPoint(t),je(document,{contextmenu:Je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=me("div","leaflet-zoom-box",this._container),xe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new B(this._point,this._startPoint),i=e.getSize();ke(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(fe(this._box),we(this._container,"leaflet-crosshair")),re(),Ze(),Fe(document,{contextmenu:Je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var e=new N(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});oi.addInitHook("addHandler","boxZoom",eo),oi.mergeOptions({doubleClickZoom:!0});var io=vi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});oi.addInitHook("addHandler","doubleClickZoom",io),oi.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var no=vi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new bi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}xe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){we(this._map._container,"leaflet-grab"),we(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=j(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)0?s:-s))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});oi.addInitHook("addHandler","scrollWheelZoom",so);var ro=600;oi.mergeOptions({tapHold:Nt.touchNative&&Nt.safari&&Nt.mobile,tapTolerance:15});var ao=vi.extend({addHooks:function(){je(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Fe(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new Z(e.clientX,e.clientY),this._holdTimeout=setTimeout(o((function(){this._cancel(),this._isTapValid()&&(je(document,"touchend",Ye),je(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))}),this),ro),je(document,"touchend touchcancel contextmenu",this._cancel,this),je(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){Fe(document,"touchend",Ye),Fe(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),Fe(document,"touchend touchcancel contextmenu",this._cancel,this),Fe(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new Z(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});oi.addInitHook("addHandler","tapHold",ao),oi.mergeOptions({touchZoom:Nt.touch,bounceAtZoomLimits:!0});var ho=vi.extend({addHooks:function(){xe(this._map._container,"leaflet-touch-zoom"),je(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){we(this._map._container,"leaflet-touch-zoom"),Fe(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),je(document,"touchmove",this._onTouchMove,this),je(document,"touchend touchcancel",this._onTouchEnd,this),Ye(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),s=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(s,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&s>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),C(this._animRequest);var a=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=M(a,this,!0),Ye(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,C(this._animRequest),Fe(document,"touchmove",this._onTouchMove,this),Fe(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});oi.addInitHook("addHandler","touchZoom",ho),oi.BoxZoom=eo,oi.DoubleClickZoom=io,oi.Drag=no,oi.Keyboard=oo,oi.ScrollWheelZoom=so,oi.TapHold=ao,oi.TouchZoom=ho,t.Bounds=B,t.Browser=Nt,t.CRS=H,t.Canvas=Vn,t.Circle=hn,t.CircleMarker=rn,t.Class=k,t.Control=ri,t.DivIcon=Rn,t.DivOverlay=On,t.DomEvent=ii,t.DomUtil=Ne,t.Draggable=bi,t.Evented=O,t.FeatureGroup=Ji,t.GeoJSON=_n,t.GridLayer=jn,t.Handler=vi,t.Icon=Xi,t.ImageOverlay=Mn,t.LatLng=D,t.LatLngBounds=N,t.Layer=Gi,t.LayerGroup=Ki,t.LineUtil=Di,t.Map=oi,t.Marker=nn,t.Mixin=gi,t.Path=sn,t.Point=Z,t.PolyUtil=Ti,t.Polygon=dn,t.Polyline=un,t.Popup=Zn,t.PosAnimation=ni,t.Projection=Hi,t.Rectangle=Qn,t.Renderer=qn,t.SVG=$n,t.SVGOverlay=Sn,t.TileLayer=Fn,t.Tooltip=In,t.Transformation=G,t.Util=E,t.VideoOverlay=En,t.bind=o,t.bounds=R,t.canvas=Gn,t.circle=ln,t.circleMarker=an,t.control=ai,t.divIcon=Nn,t.extend=i,t.featureGroup=$i,t.geoJSON=Pn,t.geoJson=Tn,t.gridLayer=Dn,t.icon=Qi,t.imageOverlay=Cn,t.latLng=F,t.latLngBounds=j,t.layerGroup=Yi,t.map=si,t.marker=on,t.point=I,t.polygon=pn,t.polyline=cn,t.popup=An,t.rectangle=to,t.setOptions=p,t.stamp=r,t.svg=Xn,t.svgOverlay=zn,t.tileLayer=Un,t.tooltip=Bn,t.transformation=K,t.version=e,t.videoOverlay=kn;var lo=window.L;t.noConflict=function(){return window.L=lo,this},window.L=t}(e)},594:t=>{"use strict";t.exports=cf.vendor["@wordpress/element"]}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=cf.core;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){var i=function(t,i){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,i||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(t)}(t,"string");return"symbol"===e(i)?i:String(i)}function o(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var s=i(594);cf.vendor["@wordpress/i18n"];var r=i(243),a=i.n(r);function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e0?(m(this.container.parentElement,"open"),m(this.container,"active")):this.notFoundMessage&&(this.container.appendChild(this.notFoundMessage),m(this.container.parentElement,"open")),this.results=t},e.select=function(t){return Array.from(this.container.children).forEach((function(e,i){return i===t?m(e,"active"):f(e,"active")})),this.selected=t,this.results[t]},e.count=function(){return this.results?this.results.length:0},e.clear=function(){for(this.selected=-1;this.container.lastChild;)this.container.removeChild(this.container.lastChild);f(this.container.parentElement,"open"),f(this.container,"active")},t}(),T={position:"topleft",style:"button",showMarker:!0,showPopup:!1,popupFormat:function(t){return""+t.result.label},resultFormat:function(t){return""+t.result.label},marker:{icon:r&&r.Icon?new r.Icon.Default:void 0,draggable:!1},maxMarkers:1,maxSuggestions:5,retainZoomLevel:!1,animateZoom:!0,searchLabel:"Enter address",clearSearchLabel:"Clear search",notFoundMessage:"",messageHideDelay:3e3,zoomLevel:18,classNames:{container:"leaflet-bar leaflet-control leaflet-control-geosearch",button:"leaflet-bar-part leaflet-bar-part-single",resetButton:"reset",msgbox:"leaflet-bar message",form:"",input:"",resultlist:"",item:"",notfound:"leaflet-bar-notfound"},autoComplete:!0,autoCompleteDelay:250,autoClose:!1,keepResult:!1,updateMap:!0},M="Leaflet must be loaded before instantiating the GeoSearch control",C={options:h({},T),classNames:h({},T.classNames),initialize:function(t){var e,i,n,o,s=this;if(!r)throw new Error(M);if(!t.provider)throw new Error("Provider is missing from options");this.options=h({},T,t),this.classNames=h({},this.classNames,t.classNames),this.markers=new r.FeatureGroup,this.classNames.container+=" leaflet-geosearch-"+this.options.style,this.searchElement=new L({searchLabel:this.options.searchLabel,classNames:{container:this.classNames.container,form:this.classNames.form,input:this.classNames.input},handleSubmit:function(t){return s.onSubmit(t)}}),this.button=d("a",this.classNames.button,this.searchElement.container,{title:this.options.searchLabel,href:"#",onClick:function(t){return s.onClick(t)}}),r.DomEvent.disableClickPropagation(this.button),this.resetButton=d("button",this.classNames.resetButton,this.searchElement.form,{text:"×","aria-label":this.options.clearSearchLabel,onClick:function(){""===s.searchElement.input.value?s.close():s.clearResults(null,!0)}}),r.DomEvent.disableClickPropagation(this.resetButton),this.options.autoComplete&&(this.resultList=new P({handleClick:function(t){var e=t.result;s.searchElement.input.value=e.label,s.onSubmit({query:e.label,data:e})},classNames:{resultlist:this.classNames.resultlist,item:this.classNames.item,notfound:this.classNames.notfound},notFoundMessage:this.options.notFoundMessage}),this.searchElement.form.appendChild(this.resultList.container),this.searchElement.input.addEventListener("keyup",(e=function(t){return s.autoSearch(t)},void 0===(i=this.options.autoCompleteDelay)&&(i=250),void 0===n&&(n=!1),function(){var t=[].slice.call(arguments);o&&clearTimeout(o),o=setTimeout((function(){o=null,n||e.apply(void 0,t)}),i),n&&!o&&e.apply(void 0,t)}),!0),this.searchElement.input.addEventListener("keydown",(function(t){return s.selectResult(t)}),!0),this.searchElement.input.addEventListener("keydown",(function(t){return s.clearResults(t,!0)}),!0)),this.searchElement.form.addEventListener("click",(function(t){t.preventDefault()}),!1)},onAdd:function(t){var e=this.options,i=e.showMarker,n=e.style;if(this.map=t,i&&this.markers.addTo(t),"bar"===n){var o=t.getContainer().querySelector(".leaflet-control-container");this.container=d("div","leaflet-control-geosearch leaflet-geosearch-bar"),this.container.appendChild(this.searchElement.form),o.appendChild(this.container)}return r.DomEvent.disableClickPropagation(this.searchElement.form),this.searchElement.container},onRemove:function(){var t;return null==(t=this.container)||t.remove(),this},open:function(){var t=this.searchElement,e=t.input;m(t.container,"active"),e.focus()},close:function(){f(this.searchElement.container,"active"),this.clearResults()},onClick:function(t){t.preventDefault(),t.stopPropagation(),this.searchElement.container.classList.contains("active")?this.close():this.open()},selectResult:function(t){if(-1!==[y,b,x].indexOf(t.keyCode))if(t.preventDefault(),t.keyCode!==y){var e=this.resultList.count()-1;if(!(e<0)){var i=this.resultList.selected,n=t.keyCode===b?i+1:i-1,o=this.resultList.select(n<0?e:n>e?0:n);this.searchElement.input.value=o.label}}else{var s=this.resultList.select(this.resultList.selected);this.onSubmit({query:this.searchElement.input.value,data:s})}},clearResults:function(t,e){if(void 0===e&&(e=!1),!t||27===t.keyCode){var i=this.options,n=i.autoComplete;!e&&i.keepResult||(this.searchElement.input.value="",this.markers.clearLayers()),n&&this.resultList.clear()}},autoSearch:function(t){try{var e=this;if(w.indexOf(t.keyCode)>-1)return Promise.resolve();var i=t.target.value,n=e.options.provider,o=function(){if(i.length)return Promise.resolve(n.search({query:i})).then((function(t){t=t.slice(0,e.options.maxSuggestions),e.resultList.render(t,e.options.resultFormat)}));e.resultList.clear()}();return Promise.resolve(o&&o.then?o.then((function(){})):void 0)}catch(t){return Promise.reject(t)}},onSubmit:function(t){try{var e=this;return e.resultList.clear(),Promise.resolve(e.options.provider.search(t)).then((function(i){i&&i.length>0&&e.showResult(i[0],t)}))}catch(t){return Promise.reject(t)}},showResult:function(t,e){var i=this.options,n=i.autoClose,o=i.updateMap,s=this.markers.getLayers();s.length>=this.options.maxMarkers&&this.markers.removeLayer(s[0]);var r=this.addMarker(t,e);o&&this.centerMap(t),this.map.fireEvent("geosearch/showlocation",{location:t,marker:r}),n&&this.closeResults()},closeResults:function(){var t=this.searchElement.container;t.classList.contains("active")&&f(t,"active"),this.clearResults()},addMarker:function(t,e){var i=this,n=this.options,o=n.marker,s=n.showPopup,a=n.popupFormat,h=new r.Marker([t.y,t.x],o),l=t.label;return"function"==typeof a&&(l=a({query:e,result:t})),h.bindPopup(l),this.markers.addLayer(h),s&&h.openPopup(),o.draggable&&h.on("dragend",(function(t){i.map.fireEvent("geosearch/marker/dragend",{location:h.getLatLng(),event:t})})),h},centerMap:function(t){var e=this.options,i=e.retainZoomLevel,n=e.animateZoom,o=t.bounds?new r.LatLngBounds(t.bounds):new r.LatLng(t.y,t.x).toBounds(10),s=o.isValid()?o:this.markers.getBounds();!i&&o.isValid()&&!t.bounds||i||!o.isValid()?this.map.setView(s.getCenter(),this.getZoom(),{animate:n}):this.map.fitBounds(s,{animate:n})},getZoom:function(){var t=this.options,e=t.zoomLevel;return t.retainZoomLevel?this.map.getZoom():e}};function E(){if(!r)throw new Error(M);return c(r.Control.extend(C),[].slice.call(arguments))}(g=v||(v={}))[g.SEARCH=0]="SEARCH",g[g.REVERSE=1]="REVERSE";var k,S=function(){function t(t){void 0===t&&(t={}),this.options=void 0,this.options=t}var e=t.prototype;return e.getParamString=function(t){void 0===t&&(t={});var e=h({},this.options.params,t);return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")},e.getUrl=function(t,e){return t+"?"+this.getParamString(e)},e.search=function(t){try{var e=this,i=e.endpoint({query:t.query,type:v.SEARCH});return Promise.resolve(fetch(i)).then((function(t){return Promise.resolve(t.json()).then((function(t){return e.parse({data:t})}))}))}catch(t){return Promise.reject(t)}},t}(),z=function(t){function e(){return t.apply(this,arguments)||this}l(e,t);var i=e.prototype;return i.endpoint=function(){return"https://places-dsn.algolia.net/1/places/query"},i.findBestMatchLevelIndex=function(t){var e=t.find((function(t){return"full"===t.matchLevel}))||t.find((function(t){return"partial"===t.matchLevel}));return e?t.indexOf(e):0},i.getLabel=function(t){var e,i,n,o;return[null==(e=t.locale_names)?void 0:e.default[this.findBestMatchLevelIndex(t._highlightResult.locale_names.default)],null==(i=t.city)?void 0:i.default[this.findBestMatchLevelIndex(t._highlightResult.city.default)],t.administrative[this.findBestMatchLevelIndex(t._highlightResult.administrative)],null==(n=t.postcode)?void 0:n[this.findBestMatchLevelIndex(t._highlightResult.postcode)],null==(o=t.country)?void 0:o.default].filter(Boolean).join(", ")},i.parse=function(t){var e=this;return t.data.hits.map((function(t){return{x:t._geoloc.lng,y:t._geoloc.lat,label:e.getLabel(t),bounds:null,raw:t}}))},i.search=function(t){var e=t.query;try{var i=this,n="string"==typeof e?{query:e}:e;return Promise.resolve(fetch(i.endpoint(),{method:"POST",body:JSON.stringify(h({},i.options.params,n))})).then((function(t){return Promise.resolve(t.json()).then((function(t){return i.parse({data:t})}))}))}catch(t){return Promise.reject(t)}},e}(S),O=function(t){function e(){for(var e,i=arguments.length,n=new Array(i),o=0;o=this.retries+1}createUrl(){let t=this.url;return t+=`?callback=${this.CALLBACK}`,this.apiKey&&(t+=`&key=${this.apiKey}`),this.channel&&(t+=`&channel=${this.channel}`),this.client&&(t+=`&client=${this.client}`),this.libraries.length>0&&(t+=`&libraries=${this.libraries.join(",")}`),this.language&&(t+=`&language=${this.language}`),this.region&&(t+=`®ion=${this.region}`),this.version&&(t+=`&v=${this.version}`),this.mapIds&&(t+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(t+=`&auth_referrer_policy=${this.authReferrerPolicy}`),t}deleteScript(){const t=document.getElementById(this.id);t&&t.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise(((t,e)=>{this.loadCallback((i=>{i?e(i.error):t(window.google)}))}))}loadCallback(t){this.callbacks.push(t),this.execute()}setScript(){if(document.getElementById(this.id))return void this.callback();const t=this.createUrl(),e=document.createElement("script");e.id=this.id,e.type="text/javascript",e.src=t,e.onerror=this.loadErrorCallback.bind(this),e.defer=!0,e.async=!0,this.nonce&&(e.nonce=this.nonce),document.head.appendChild(e)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(t){if(this.errors.push(t),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.log(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout((()=>{this.deleteScript(),this.setScript()}),t)}else this.onerrorEvent=t,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach((t=>{t(this.onerrorEvent)})),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}var N=function(t){function e(e){var i;return(i=t.call(this,e)||this).loader=null,i.geocoder=null,"undefined"!=typeof window&&(i.loader=new R(e).load().then((function(t){var e=new t.maps.Geocoder;return i.geocoder=e,e}))),i}l(e,t);var i=e.prototype;return i.endpoint=function(t){throw new Error("Method not implemented.")},i.parse=function(t){return t.data.results.map((function(t){var e=t.geometry.location.toJSON(),i=e.lat,n=e.lng,o=t.geometry.viewport.toJSON();return{x:n,y:i,label:t.formatted_address,bounds:[[o.south,o.west],[o.north,o.east]],raw:t}}))},i.search=function(t){try{var e=function(e){if(!e)throw new Error("GoogleMaps GeoCoder is not loaded. Are you trying to run this server side?");return Promise.resolve(e.geocode({address:t.query},(function(t){return{results:t}})).catch((function(t){return"ZERO_RESULTS"!==t.code&&console.error(t.code+": "+t.message),{results:[]}}))).then((function(t){return i.parse({data:t})}))},i=this,n=i.geocoder;return Promise.resolve(n?e(n):Promise.resolve(i.loader).then(e))}catch(t){return Promise.reject(t)}},e}(S),j=function(t){function e(e){var i;void 0===e&&(e={}),(i=t.call(this,e)||this).searchUrl=void 0,i.reverseUrl=void 0;var n="https://nominatim.openstreetmap.org";return i.searchUrl=e.searchUrl||n+"/search",i.reverseUrl=e.reverseUrl||n+"/reverse",i}l(e,t);var i=e.prototype;return i.endpoint=function(t){var e=t.query,i=t.type,n="string"==typeof e?{q:e}:e;return n.format="json",this.getUrl(i===v.REVERSE?this.reverseUrl:this.searchUrl,n)},i.parse=function(t){return(Array.isArray(t.data)?t.data:[t.data]).map((function(t){return{x:Number(t.lon),y:Number(t.lat),label:t.display_name,bounds:[[parseFloat(t.boundingbox[0]),parseFloat(t.boundingbox[2])],[parseFloat(t.boundingbox[1]),parseFloat(t.boundingbox[3])]],raw:t}}))},e}(S),D=function(t){function e(e){return t.call(this,h({},e,{searchUrl:"https://locationiq.org/v1/search.php",reverseUrl:"https://locationiq.org/v1/reverse.php"}))||this}return l(e,t),e.prototype.parse=function(e){return e.data.error?[]:t.prototype.parse.call(this,e)},e}(j),F=function(t){function e(){for(var e,i=arguments.length,n=new Array(i),o=0;o=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,r=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return r=t.done,t},e:function(t){a=!0,s=t},f:function(){try{r||null==i.return||i.return()}finally{if(a)throw s}}}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i{setTimeout((()=>{this.marker.openPopup(),this.map.setView(this.marker.getLatLng()).panBy([0,-50]),this.map.invalidateSize()}),500)})))}setupMapEvents(){var t=this.props.onChange,e=this.node.current.closest(".postbox.carbon-box");e&&this.onClassChange(e,(()=>{this.map.invalidateSize()}));var i=this.node.current.closest(".cf-complex__group.cf-complex__group--tabbed");i&&this.onHiddenToggle(i,(()=>{this.marker.closePopup(),this.marker.openPopup(),this.map.setView(this.marker.getLatLng()).panBy([0,-50]),this.map.invalidateSize()})),this.map.addEventListener("geosearch/showlocation",(e=>{var i=e.location;this.marker&&this.marker.remove(),this.marker=e.marker,this.marker.options.draggable=!0,this.marker.addTo(this.map),this.marker.dragging.enable();var n=this.marker.getPopup().getContent();t({lat:i.y,lng:i.x,address:n}),this.marker.addEventListener("moveend",(e=>{var i=e.target.getLatLng();this.map.panTo(i),t({lat:i.lat,lng:i.lng})}))}))}onClassChange(t,e){var i=t.classList.toString(),n=new MutationObserver((o=>{var s,r=G(o);try{for(r.s();!(s=r.n()).done;){if("class"===s.value.attributeName){var a=t.classList.toString();if(a!==i){e(n),i=a;break}}}}catch(t){r.e(t)}finally{r.f()}}));return n.observe(t,{attributes:!0}),n}onHiddenToggle(t,e){var i=t.hasAttribute("hidden"),n=new MutationObserver((o=>{var s,r=G(o);try{for(r.s();!(s=r.n()).done;){if("hidden"===s.value.attributeName){var a=t.hasAttribute("hidden");if(a!==i){e(n),i=a;break}}}}catch(t){r.e(t)}finally{r.f()}}));return n.observe(t,{attributes:!0}),n}render(){return V.createElement("div",{className:this.props.className,ref:this.node})}}const J=Y;var $=i(594);function X(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Q(t){for(var e=1;e{var e=this.props,i=e.id,n=e.value;(0,e.onChange)(i,Q(Q({},n),t))}))}render(){var t=this.props,e=(t.id,t.name),i=t.value,n=t.field;return $.createElement(s.Fragment,null,$.createElement(J,{className:"cf-leaflet-map__canvas",value:i,field:n,onChange:this.handleChange}),$.createElement("input",{type:"hidden",name:`${e}[lat]`,value:i.lat,readOnly:!0}),$.createElement("input",{type:"hidden",name:`${e}[lng]`,value:i.lng,readOnly:!0}),$.createElement("input",{type:"hidden",name:`${e}[address]`,value:i.address,readOnly:!0}))}}const et=tt;(0,t.registerFieldType)("leaflet_map",et)})()})(); \ No newline at end of file diff --git a/assets/src/LeafletMap.js b/assets/src/LeafletMap.js index 27ff39f..2ba5212 100644 --- a/assets/src/LeafletMap.js +++ b/assets/src/LeafletMap.js @@ -158,6 +158,7 @@ class MapField extends Component { this.map.whenReady( () => { setTimeout( () => { this.marker.openPopup(); this.map.setView( this.marker.getLatLng() ).panBy([0,-50] ); + this.map.invalidateSize(); }, 500 ) } ); } @@ -184,6 +185,7 @@ class MapField extends Component { this.marker.closePopup(); this.marker.openPopup(); this.map.setView( this.marker.getLatLng() ).panBy([0,-50] ); + this.map.invalidateSize(); } ) } // Get results from Leaflet GeoSearch diff --git a/carbon-fields-leaflet-map-plugin.php b/carbon-fields-leaflet-map-plugin.php index fe74afb..57a7588 100644 --- a/carbon-fields-leaflet-map-plugin.php +++ b/carbon-fields-leaflet-map-plugin.php @@ -2,7 +2,7 @@ /** * Plugin Name: Carbon Field Leaflet Map * Description: Leaflet Map extension for Carbon Fields. - * Version: 1.0.3 + * Version: 1.0.4 * Author: Max Gruson * Author URI: https://max.gruson.studio * License: GPL2