"use strict";
(self["webpackChunkEntryScapeRegistry"] = self["webpackChunkEntryScapeRegistry"] || []).push([["openlayers"],{

/***/ "./modules/commons/components/Map/utils/openlayers/colors.js"
/*!*******************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/colors.js ***!
  \*******************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BLUE: () => (/* binding */ BLUE),
/* harmony export */   GREEN: () => (/* binding */ GREEN)
/* harmony export */ });
const GREEN = '#67aa44';
const BLUE = '#3388ff';

/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/draw.js"
/*!*****************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/draw.js ***!
  \*****************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createDrawInteraction: () => (/* binding */ createDrawInteraction)
/* harmony export */ });
/* harmony import */ var ol_interaction_Draw__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ol/interaction/Draw */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/interaction/Draw.js");


/**
 * Get proper geometry function and geometry type for a given draw type.
 * @param {Object} drawType
 * @returns
 */
const getDrawTypeOptions = drawType => {
  switch (drawType) {
    case 'box':
      return {
        geometryFunction: (0,ol_interaction_Draw__WEBPACK_IMPORTED_MODULE_0__.createBox)(),
        type: 'Circle'
      };
    case 'point':
      return {
        type: 'Point'
      };
    default:
      throw new Error(`Unknown draw type ${drawType}`);
  }
};

/**
 * @param {VectorSource} source
 * @param {string} interactionType
 * @returns {Draw}
 */
const createDrawInteraction = (source, interactionType) => {
  const {
    type,
    geometryFunction
  } = getDrawTypeOptions(interactionType);
  return new ol_interaction_Draw__WEBPACK_IMPORTED_MODULE_0__["default"]({
    source,
    type,
    geometryFunction
  });
};

/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/feature.js"
/*!********************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/feature.js ***!
  \********************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createFeature: () => (/* binding */ createFeature)
/* harmony export */ });
/* harmony import */ var ol_Feature__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ol/Feature */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/Feature.js");

const createFeature = featureOptions => {
  return new ol_Feature__WEBPACK_IMPORTED_MODULE_0__["default"](featureOptions);
};

/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/featureInfo.js"
/*!************************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/featureInfo.js ***!
  \************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createOverlay: () => (/* binding */ createOverlay)
/* harmony export */ });
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.dom-collections.for-each.js");
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var ol_Overlay__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ol/Overlay */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/Overlay.js");

function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }

const createOverlay = function createOverlay() {
  let overlayOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return new ol_Overlay__WEBPACK_IMPORTED_MODULE_1__["default"](_objectSpread({
    stopEvent: true,
    offset: [-16, 0],
    positioning: 'center-right',
    autoPan: true
  }, overlayOptions));
};

/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/geometry.js"
/*!*********************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/geometry.js ***!
  \*********************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createPoint: () => (/* binding */ createPoint),
/* harmony export */   createPolygon: () => (/* binding */ createPolygon),
/* harmony export */   createPolygonFromExtent: () => (/* binding */ createPolygonFromExtent),
/* harmony export */   extentToWKT: () => (/* binding */ extentToWKT)
/* harmony export */ });
/* harmony import */ var ol_geom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ol/geom */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/geom/Point.js");
/* harmony import */ var ol_geom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ol/geom/Polygon */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/geom/Polygon.js");
/* harmony import */ var ol_format__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ol/format */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/format/WKT.js");




/**
 * Wrapper function to create point
 *
 * @param {Coordinate} coordinate
 * @returns {Point}
 */
const createPoint = coordinate => {
  return new ol_geom__WEBPACK_IMPORTED_MODULE_0__["default"](coordinate);
};

/**
 * Wrapper function to create polygon
 *
 * @param {Coordinate[]} coordinates
 * @returns {Polygon}
 */
const createPolygon = coordinates => {
  return new ol_geom__WEBPACK_IMPORTED_MODULE_1__["default"](coordinates);
};

/**
 * Creates polygon from coordinate extent
 * @param {Coordinate[]} extent
 * @returns {Polygon|undefined}
 */
const createPolygonFromExtent = extent => {
  try {
    return (0,ol_geom__WEBPACK_IMPORTED_MODULE_1__.fromExtent)(extent);
  } catch (error) {
    console.log(error);
  }
};

/**
 * Converts extent to WKT Polygon string.
 *
 * @param {number[]} extent - [minX, minY, maxX, maxY]
 * @param {string} projection - Optional projection
 * @returns {string|undefined} WKT polygon string
 */
const extentToWKT = function extentToWKT(extent) {
  let projection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'EPSG:3857';
  try {
    const polygon = (0,ol_geom__WEBPACK_IMPORTED_MODULE_1__.fromExtent)(extent).clone().transform(projection, 'EPSG:4326');
    const wkt = new ol_format__WEBPACK_IMPORTED_MODULE_2__["default"]().writeGeometry(polygon);
    return wkt;
  } catch (error) {
    console.log(`Failed to convert extent to wkt: ${extent}`);
    console.error(error);
  }
};

/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/index.js"
/*!******************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/index.js ***!
  \******************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BLUE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.BLUE),
/* harmony export */   DEFAULT_PROJECTION_CODE: () => (/* reexport safe */ _mapDefaults__WEBPACK_IMPORTED_MODULE_7__.DEFAULT_PROJECTION_CODE),
/* harmony export */   GREEN: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.GREEN),
/* harmony export */   MAX_ZOOM: () => (/* reexport safe */ _mapDefaults__WEBPACK_IMPORTED_MODULE_7__.MAX_ZOOM),
/* harmony export */   addLayers: () => (/* reexport safe */ _map__WEBPACK_IMPORTED_MODULE_6__.addLayers),
/* harmony export */   addXyData: () => (/* reexport safe */ _layer__WEBPACK_IMPORTED_MODULE_8__.addXyData),
/* harmony export */   checkProjectionSupport: () => (/* reexport safe */ _wmsCapabilities__WEBPACK_IMPORTED_MODULE_11__.checkProjectionSupport),
/* harmony export */   clearOverlays: () => (/* reexport safe */ _map__WEBPACK_IMPORTED_MODULE_6__.clearOverlays),
/* harmony export */   convertFromLonLat: () => (/* reexport safe */ _projection__WEBPACK_IMPORTED_MODULE_9__.convertFromLonLat),
/* harmony export */   convertToLonLat: () => (/* reexport safe */ _projection__WEBPACK_IMPORTED_MODULE_9__.convertToLonLat),
/* harmony export */   createAttribution: () => (/* reexport safe */ _map__WEBPACK_IMPORTED_MODULE_6__.createAttribution),
/* harmony export */   createDefaultBasemap: () => (/* reexport safe */ _layer__WEBPACK_IMPORTED_MODULE_8__.createDefaultBasemap),
/* harmony export */   createDrawInteraction: () => (/* reexport safe */ _draw__WEBPACK_IMPORTED_MODULE_2__.createDrawInteraction),
/* harmony export */   createFeature: () => (/* reexport safe */ _feature__WEBPACK_IMPORTED_MODULE_4__.createFeature),
/* harmony export */   createFill: () => (/* reexport safe */ _style__WEBPACK_IMPORTED_MODULE_10__.createFill),
/* harmony export */   createMap: () => (/* reexport safe */ _map__WEBPACK_IMPORTED_MODULE_6__.createMap),
/* harmony export */   createMarker: () => (/* reexport safe */ _style__WEBPACK_IMPORTED_MODULE_10__.createMarker),
/* harmony export */   createOverlay: () => (/* reexport safe */ _featureInfo__WEBPACK_IMPORTED_MODULE_5__.createOverlay),
/* harmony export */   createPoint: () => (/* reexport safe */ _geometry__WEBPACK_IMPORTED_MODULE_3__.createPoint),
/* harmony export */   createPolygon: () => (/* reexport safe */ _geometry__WEBPACK_IMPORTED_MODULE_3__.createPolygon),
/* harmony export */   createPolygonFromExtent: () => (/* reexport safe */ _geometry__WEBPACK_IMPORTED_MODULE_3__.createPolygonFromExtent),
/* harmony export */   createPolygonStyle: () => (/* reexport safe */ _style__WEBPACK_IMPORTED_MODULE_10__.createPolygonStyle),
/* harmony export */   createScaleLine: () => (/* reexport safe */ _map__WEBPACK_IMPORTED_MODULE_6__.createScaleLine),
/* harmony export */   createStroke: () => (/* reexport safe */ _style__WEBPACK_IMPORTED_MODULE_10__.createStroke),
/* harmony export */   createTileWMS: () => (/* reexport safe */ _layer__WEBPACK_IMPORTED_MODULE_8__.createTileWMS),
/* harmony export */   createVectorLayer: () => (/* reexport safe */ _layer__WEBPACK_IMPORTED_MODULE_8__.createVectorLayer),
/* harmony export */   extentFromLonLat: () => (/* reexport safe */ _projection__WEBPACK_IMPORTED_MODULE_9__.extentFromLonLat),
/* harmony export */   extentToLonLat: () => (/* reexport safe */ _projection__WEBPACK_IMPORTED_MODULE_9__.extentToLonLat),
/* harmony export */   extentToProjection: () => (/* reexport safe */ _projection__WEBPACK_IMPORTED_MODULE_9__.extentToProjection),
/* harmony export */   extentToWKT: () => (/* reexport safe */ _geometry__WEBPACK_IMPORTED_MODULE_3__.extentToWKT),
/* harmony export */   getExtentFromBoundingBoxes: () => (/* reexport safe */ _wmsCapabilities__WEBPACK_IMPORTED_MODULE_11__.getExtentFromBoundingBoxes),
/* harmony export */   getProjection: () => (/* reexport safe */ _projection__WEBPACK_IMPORTED_MODULE_9__.getProjection),
/* harmony export */   getWmsCapabilities: () => (/* reexport safe */ _wmsCapabilities__WEBPACK_IMPORTED_MODULE_11__.getWmsCapabilities),
/* harmony export */   getWmsData: () => (/* reexport safe */ _wmsCapabilities__WEBPACK_IMPORTED_MODULE_11__.getWmsData),
/* harmony export */   parseWmsGetCapabilites: () => (/* reexport safe */ _wmsCapabilities__WEBPACK_IMPORTED_MODULE_11__.parseWmsGetCapabilites),
/* harmony export */   registerProjection: () => (/* reexport safe */ _projection__WEBPACK_IMPORTED_MODULE_9__.registerProjection),
/* harmony export */   registerProjections: () => (/* reexport safe */ _projection__WEBPACK_IMPORTED_MODULE_9__.registerProjections),
/* harmony export */   zoomToExtent: () => (/* reexport safe */ _map__WEBPACK_IMPORTED_MODULE_6__.zoomToExtent),
/* harmony export */   zoomToLayer: () => (/* reexport safe */ _map__WEBPACK_IMPORTED_MODULE_6__.zoomToLayer)
/* harmony export */ });
/* harmony import */ var ol_ol_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ol/ol.css */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/ol.css");
/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colors */ "./modules/commons/components/Map/utils/openlayers/colors.js");
/* harmony import */ var _draw__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./draw */ "./modules/commons/components/Map/utils/openlayers/draw.js");
/* harmony import */ var _geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./geometry */ "./modules/commons/components/Map/utils/openlayers/geometry.js");
/* harmony import */ var _feature__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./feature */ "./modules/commons/components/Map/utils/openlayers/feature.js");
/* harmony import */ var _featureInfo__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./featureInfo */ "./modules/commons/components/Map/utils/openlayers/featureInfo.js");
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./map */ "./modules/commons/components/Map/utils/openlayers/map.js");
/* harmony import */ var _mapDefaults__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./mapDefaults */ "./modules/commons/components/Map/utils/openlayers/mapDefaults.js");
/* harmony import */ var _layer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./layer */ "./modules/commons/components/Map/utils/openlayers/layer.js");
/* harmony import */ var _projection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./projection */ "./modules/commons/components/Map/utils/openlayers/projection.js");
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./style */ "./modules/commons/components/Map/utils/openlayers/style.js");
/* harmony import */ var _wmsCapabilities__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./wmsCapabilities */ "./modules/commons/components/Map/utils/openlayers/wmsCapabilities.js");













/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/layer.js"
/*!******************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/layer.js ***!
  \******************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   addXyData: () => (/* binding */ addXyData),
/* harmony export */   createDefaultBasemap: () => (/* binding */ createDefaultBasemap),
/* harmony export */   createTileWMS: () => (/* binding */ createTileWMS),
/* harmony export */   createVectorLayer: () => (/* binding */ createVectorLayer)
/* harmony export */ });
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.dom-collections.for-each.js");
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var ol_layer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ol/layer */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/layer/Tile.js");
/* harmony import */ var ol_layer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ol/layer */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/layer/Vector.js");
/* harmony import */ var ol_source_TileWMS__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ol/source/TileWMS */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/source/TileWMS.js");
/* harmony import */ var ol_source_XYZ__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ol/source/XYZ */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/source/XYZ.js");
/* harmony import */ var ol_Feature__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ol/Feature */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/Feature.js");
/* harmony import */ var ol_source_Vector__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ol/source/Vector */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/source/Vector.js");
/* harmony import */ var ol_geom_Point__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ol/geom/Point */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/geom/Point.js");
/* harmony import */ var ol_proj__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ol/proj */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/proj.js");
/* harmony import */ var config__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! config */ "./app/registry/config/config.js");
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./style */ "./modules/commons/components/Map/utils/openlayers/style.js");

const _excluded = ["geometry"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }










/**
 * @returns {TileLayer}
 */
const createDefaultBasemap = function createDefaultBasemap() {
  let {
    visible = true
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  const geochooserMapURL = config__WEBPACK_IMPORTED_MODULE_9__["default"].get('itemstore.geochooserMapURL', null);
  const geochooserAttribution = config__WEBPACK_IMPORTED_MODULE_9__["default"].get('itemstore.geochooserMapAttribution', null);
  return new ol_layer__WEBPACK_IMPORTED_MODULE_1__["default"]({
    source: new ol_source_XYZ__WEBPACK_IMPORTED_MODULE_4__["default"]({
      attributions: geochooserAttribution,
      url: geochooserMapURL
    }),
    title: 'Background map',
    visible,
    type: 'basemap'
  });
};

/**
 * @param {Object} layerOptions
 * @returns {VectorLayer}
 */
const createVectorLayer = function createVectorLayer() {
  let {
    features = [],
    style
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  const vectorLayer = new ol_layer__WEBPACK_IMPORTED_MODULE_2__["default"]({
    source: new ol_source_Vector__WEBPACK_IMPORTED_MODULE_6__["default"]({
      features,
      wrapX: false
    }),
    style
  });
  return vectorLayer;
};

/**
 * Adds xy data as an layer to the map. Coordinates are assumed to be in lat lon.
 * @param {Map} map
 * @param {Object[]} data
 * @param {Style} style
 * @returns {VectorLayer}
 */
const addXyData = function addXyData(map, data) {
  let style = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (0,_style__WEBPACK_IMPORTED_MODULE_10__.createMarker)();
  const features = data.map(_ref => {
    let {
        geometry
      } = _ref,
      fields = _objectWithoutProperties(_ref, _excluded);
    return new ol_Feature__WEBPACK_IMPORTED_MODULE_5__["default"](_objectSpread({
      geometry: new ol_geom_Point__WEBPACK_IMPORTED_MODULE_7__["default"]((0,ol_proj__WEBPACK_IMPORTED_MODULE_8__.fromLonLat)(geometry))
    }, fields));
  });
  const xyLayer = createVectorLayer({
    features,
    style
  });
  map.addLayer(xyLayer);
  return xyLayer;
};

/**
 *
 * @param {Object} layerOptions
 * @returns {TileLayer}
 */
const createTileWMS = _ref2 => {
  let {
    url,
    title,
    name,
    visible
  } = _ref2;
  return new ol_layer__WEBPACK_IMPORTED_MODULE_1__["default"]({
    source: new ol_source_TileWMS__WEBPACK_IMPORTED_MODULE_3__["default"]({
      url,
      params: {
        LAYERS: name,
        TILED: true
      },
      transition: 0
    }),
    title,
    name,
    visible,
    type: 'wms'
  });
};

/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/map.js"
/*!****************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/map.js ***!
  \****************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   addLayers: () => (/* binding */ addLayers),
/* harmony export */   clearOverlays: () => (/* binding */ clearOverlays),
/* harmony export */   createAttribution: () => (/* binding */ createAttribution),
/* harmony export */   createMap: () => (/* binding */ createMap),
/* harmony export */   createScaleLine: () => (/* binding */ createScaleLine),
/* harmony export */   zoomToExtent: () => (/* binding */ zoomToExtent),
/* harmony export */   zoomToLayer: () => (/* binding */ zoomToLayer)
/* harmony export */ });
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.array.iterator.js");
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.dom-collections.for-each.js");
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.dom-collections.iterator.js");
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var ol_Map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ol/Map */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/Map.js");
/* harmony import */ var ol_View__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ol/View */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/View.js");
/* harmony import */ var ol_control__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ol/control */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/control/Attribution.js");
/* harmony import */ var ol_control__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ol/control */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/control/ScaleLine.js");
/* harmony import */ var ol_control__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ol/control */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/control/defaults.js");
/* harmony import */ var _layer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./layer */ "./modules/commons/components/Map/utils/openlayers/layer.js");
/* harmony import */ var _mapDefaults__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./mapDefaults */ "./modules/commons/components/Map/utils/openlayers/mapDefaults.js");
const _excluded = ["className", "name"],
  _excluded2 = ["className", "name"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }









/**
 * Create a new map
 *
 * @param {object} mapOptions
 * @param {string} mapOptions.target
 * @param {number} mapOptions.maxZoom
 * @param {string} mapOptions.projectionCode
 * @param {number[]} mapOptions.center
 * @param {object[]} mapOptions.layers
 * @param {object} mapOptions.basemapOptions
 * @param {object[]} mapOptions.controls
 * @returns {Map}
 */
const createMap = _ref => {
  let {
    target,
    maxZoom = _mapDefaults__WEBPACK_IMPORTED_MODULE_9__.MAX_ZOOM,
    projectionCode = _mapDefaults__WEBPACK_IMPORTED_MODULE_9__.DEFAULT_PROJECTION_CODE,
    center = [0, 0],
    layers = [],
    basemapOptions,
    controls = []
  } = _ref;
  const openLayerslayers = [(0,_layer__WEBPACK_IMPORTED_MODULE_8__.createDefaultBasemap)(basemapOptions), ...layers.map(layerConfiguration => (0,_layer__WEBPACK_IMPORTED_MODULE_8__.createTileWMS)(layerConfiguration))];
  const map = new ol_Map__WEBPACK_IMPORTED_MODULE_3__["default"]({
    layers: openLayerslayers,
    target,
    controls: (0,ol_control__WEBPACK_IMPORTED_MODULE_7__.defaults)({
      attribution: false
    }).extend(controls),
    view: new ol_View__WEBPACK_IMPORTED_MODULE_4__["default"]({
      maxZoom,
      projection: projectionCode,
      center,
      zoom: 1
    })
  });
  return map;
};

/**
 * Zooms to the extent of a vector layer. Padding is used to prevent features
 * from being rendered outside the view.
 *
 * @param {Map} map
 * @param {object} layer
 * @param {number} maxZoom
 * @returns {Map}
 */
const zoomToLayer = (map, layer, maxZoom) => {
  const layerExtent = layer.getSource().getExtent();
  if (layerExtent.filter(Number.isFinite).length !== 4) return map; // handle infinity
  map.getView().fit(layerExtent, {
    padding: [50, 50, 50, 50],
    maxZoom
  });
  return map;
};

/**
 * @param {Map} map
 * @param {number[]} extent
 * @returns {Map}
 */
const zoomToExtent = (map, extent) => {
  map.getView().fit(extent);
  return map;
};

/**
 * Removes all layers that are not marked as basemap layers
 *
 * @param {Map} map
 * @returns {Map}
 */
const clearOverlays = map => {
  for (const layer of map.getLayers().getArray()) {
    if (layer.get('type') !== 'basemap') {
      map.removeLayer(layer);
    }
  }
  return map;
};

/**
 * Convenience function to add multiple layers
 *
 * @param {Map} map
 * @param {object[]} layers
 * @returns {Map}
 */
const addLayers = (map, layers) => {
  for (const layer of layers) {
    map.addLayer(layer);
  }
  return map;
};

/**
 * Creates a scale line
 *
 * @param {object} target
 * @param {object} scaleOptions
 * @param {string} scaleOptions.className
 * @param {string} scaleOptions.name
 * @returns {object}
 */
const createScaleLine = function createScaleLine(target) {
  let _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  let {
      className = 'escoMapScaleLineControl',
      name = 'scale-line'
    } = _ref2,
    rest = _objectWithoutProperties(_ref2, _excluded);
  return new ol_control__WEBPACK_IMPORTED_MODULE_6__["default"](_objectSpread({
    target,
    className,
    name
  }, rest));
};

/**
 * Creates an attribution component
 *
 * @param {object} target
 * @param {object} attributionOptions
 * @param {string} attributionOptions.className
 * @param {string} attributionOptions.name
 * @returns {object}
 */
const createAttribution = function createAttribution(target) {
  let _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  let {
      className = 'escoAttributionControl ol-attribution',
      name = 'attribution-control'
    } = _ref3,
    rest = _objectWithoutProperties(_ref3, _excluded2);
  return new ol_control__WEBPACK_IMPORTED_MODULE_5__["default"](_objectSpread({
    target,
    className,
    name
  }, rest));
};

/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/mapDefaults.js"
/*!************************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/mapDefaults.js ***!
  \************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DEFAULT_PROJECTION_CODE: () => (/* binding */ DEFAULT_PROJECTION_CODE),
/* harmony export */   MAX_ZOOM: () => (/* binding */ MAX_ZOOM)
/* harmony export */ });
const MAX_ZOOM = 18;
const DEFAULT_PROJECTION_CODE = 'EPSG:3857';

/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/projection.js"
/*!***********************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/projection.js ***!
  \***********************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   convertFromLonLat: () => (/* binding */ convertFromLonLat),
/* harmony export */   convertToLonLat: () => (/* binding */ convertToLonLat),
/* harmony export */   extentFromLonLat: () => (/* binding */ extentFromLonLat),
/* harmony export */   extentToLonLat: () => (/* binding */ extentToLonLat),
/* harmony export */   extentToProjection: () => (/* binding */ extentToProjection),
/* harmony export */   getProjection: () => (/* binding */ getProjection),
/* harmony export */   registerProjection: () => (/* binding */ registerProjection),
/* harmony export */   registerProjections: () => (/* binding */ registerProjections)
/* harmony export */ });
/* harmony import */ var core_js_modules_es_array_flat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.flat.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.array.flat.js");
/* harmony import */ var core_js_modules_es_array_flat_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_flat_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.array.iterator.js");
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var core_js_modules_es_array_unscopables_flat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.unscopables.flat.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.array.unscopables.flat.js");
/* harmony import */ var core_js_modules_es_array_unscopables_flat_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_unscopables_flat_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.dom-collections.for-each.js");
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.dom-collections.iterator.js");
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var ol_proj__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ol/proj */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/proj.js");
/* harmony import */ var proj4__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! proj4 */ "./node_modules/.pnpm/proj4@2.20.9_geotiff@2.1.3/node_modules/proj4/lib/index.js");
/* harmony import */ var ol_proj_proj4__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ol/proj/proj4 */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/proj/proj4.js");
/* harmony import */ var ol_extent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ol/extent */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/extent.js");
/* harmony import */ var _projections__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./projections */ "./modules/commons/components/Map/utils/openlayers/projections.js");











/**
 * @param {string} projectionCode
 * @returns {Projection}
 */
const getProjection = projectionCode => {
  return (0,ol_proj__WEBPACK_IMPORTED_MODULE_5__.get)(projectionCode);
};

/**
 * @param {Coordinate[]} coordinates
 * @param {string} projectionCode
 * @returns {Coordinate[]}
 */
const convertFromLonLat = function convertFromLonLat(coordinates) {
  let projectionCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _projections__WEBPACK_IMPORTED_MODULE_9__.EPSG_WEB_MERCATOR;
  return coordinates.map(coordinate => (0,ol_proj__WEBPACK_IMPORTED_MODULE_5__.fromLonLat)(coordinate, projectionCode));
};

/**
 * @param {Coordinate[]} coordinates
 * @param {string} projectionCode
 * @returns {Coordinate[]}
 */
const convertToLonLat = function convertToLonLat(coordinates) {
  let projectionCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _projections__WEBPACK_IMPORTED_MODULE_9__.EPSG_WEB_MERCATOR;
  return coordinates.map(coordinate => (0,ol_proj__WEBPACK_IMPORTED_MODULE_5__.toLonLat)(coordinate, projectionCode));
};

/**
 * Convert extent coordinates to lon lat
 * @param {number[]} extent
 * @param {string} projectionCode
 * @returns {number[]}
 */
const extentToLonLat = function extentToLonLat(extent) {
  let projectionCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _projections__WEBPACK_IMPORTED_MODULE_9__.EPSG_WEB_MERCATOR;
  const [west, north] = (0,ol_proj__WEBPACK_IMPORTED_MODULE_5__.toLonLat)((0,ol_extent__WEBPACK_IMPORTED_MODULE_8__.getTopLeft)(extent), projectionCode);
  const [east, south] = (0,ol_proj__WEBPACK_IMPORTED_MODULE_5__.toLonLat)((0,ol_extent__WEBPACK_IMPORTED_MODULE_8__.getBottomRight)(extent), projectionCode);
  return [west, north, east, south];
};

/**
 * Convert extent coordinates from lon lat
 * @param {number[]} extent
 * @param {string} projectionCode
 * @returns {number[]}
 */
const extentFromLonLat = (_ref, projectionCode) => {
  let [west, south, east, north] = _ref;
  const coordinates = convertFromLonLat([[west, south], [east, north]], projectionCode);
  return coordinates.flat();
};

/**
 * @param {number[]} extent
 * @param {string} sourceProjectionCode
 * @param {string} targetProjectionCode
 * @returns
 */
const transformAndValidateExtent = (extent, sourceProjectionCode, targetProjectionCode) => {
  const transformedExtent = (0,ol_proj__WEBPACK_IMPORTED_MODULE_5__.transformExtent)(extent, sourceProjectionCode, targetProjectionCode);
  if (transformedExtent.every(value => Number.isFinite(value))) return transformedExtent;
};

/**
 * Transforms extent to default projection
 * @param {number[]} extent
 * @param {string} projectionCode
 * @returns
 */
const extentToProjection = function extentToProjection(extent, projectionCode) {
  let targetProjectionCode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _projections__WEBPACK_IMPORTED_MODULE_9__.EPSG_WEB_MERCATOR;
  if (projectionCode === targetProjectionCode) ;
  const sourceProjectionCode = projectionCode === _projections__WEBPACK_IMPORTED_MODULE_9__.CRS_WGS84 ? _projections__WEBPACK_IMPORTED_MODULE_9__.ESPG_WGS84 : projectionCode;
  const transformedExtent = transformAndValidateExtent(extent, sourceProjectionCode, targetProjectionCode);
  if (transformedExtent) return transformedExtent;
  const projectionExtent = getProjection(projectionCode).getExtent();
  return (0,ol_proj__WEBPACK_IMPORTED_MODULE_5__.transformExtent)(projectionExtent, sourceProjectionCode, targetProjectionCode);
};

/**
 * Register projection in OpenLayers
 * @param {object} projectionDefinition
 * @returns
 */
const registerProjection = _ref2 => {
  let {
    code,
    definition,
    boundingBox
  } = _ref2;
  if (getProjection(code)) return;
  proj4__WEBPACK_IMPORTED_MODULE_6__["default"].defs(code, definition);
  (0,ol_proj_proj4__WEBPACK_IMPORTED_MODULE_7__.register)(proj4__WEBPACK_IMPORTED_MODULE_6__["default"]);
  const projection = getProjection(code);
  projection.setWorldExtent(boundingBox);
  projection.setExtent((0,ol_proj__WEBPACK_IMPORTED_MODULE_5__.transformExtent)(boundingBox, _projections__WEBPACK_IMPORTED_MODULE_9__.ESPG_WGS84, code));
};

/**
 * @param {Object[]} projectionDefinitions
 * @returns
 */
const registerProjections = projectionDefinitions => {
  if (!projectionDefinitions) return;
  projectionDefinitions.forEach(projectionDefinition => {
    registerProjection(projectionDefinition);
  });
};

/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/projections.js"
/*!************************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/projections.js ***!
  \************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CRS_WGS84: () => (/* binding */ CRS_WGS84),
/* harmony export */   EPSG_WEB_MERCATOR: () => (/* binding */ EPSG_WEB_MERCATOR),
/* harmony export */   ESPG_WGS84: () => (/* binding */ ESPG_WGS84)
/* harmony export */ });
const EPSG_WEB_MERCATOR = 'EPSG:3857';
const ESPG_WGS84 = 'EPSG:4326';
const CRS_WGS84 = 'CRS:84';

/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/style.js"
/*!******************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/style.js ***!
  \******************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createFill: () => (/* binding */ createFill),
/* harmony export */   createMarker: () => (/* binding */ createMarker),
/* harmony export */   createPolygonStyle: () => (/* binding */ createPolygonStyle),
/* harmony export */   createStroke: () => (/* binding */ createStroke)
/* harmony export */ });
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.array.iterator.js");
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.dom-collections.for-each.js");
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.dom-collections.iterator.js");
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var ol_style__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ol/style */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/style/Circle.js");
/* harmony import */ var ol_style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ol/style */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/style/Fill.js");
/* harmony import */ var ol_style__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ol/style */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/style/Icon.js");
/* harmony import */ var ol_style__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ol/style */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/style/Stroke.js");
/* harmony import */ var ol_style__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ol/style */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/style/Style.js");
/* harmony import */ var ol_color__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ol/color */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/color.js");
/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./colors */ "./modules/commons/components/Map/utils/openlayers/colors.js");
const _excluded = ["color", "opacity"],
  _excluded2 = ["color", "opacity", "width"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }







/**
 * Adds opacity to color as alpa by converting string to rgba array. This is
 * needed because opacity is not available as an option for fills and strokes.
 * @param {string} color
 * @param {number} opacity
 * @returns {string[]}
 */
const addOpacity = (color, opacity) => {
  if (opacity === 1) return color;
  const rgbaColor = (0,ol_color__WEBPACK_IMPORTED_MODULE_8__.asArray)(color);
  return [...rgbaColor.slice(0, 3), opacity];
};

/**
 * @param {string} svg
 * @returns {string}
 */
const svgToUri = svg => {
  return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
};
const markerPath =
// eslint-disable-next-line max-len
'<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>';

/**
 * Genereates an inline svg based on an svg path and optional properties
 * @param {Object} svgOptions
 * @returns {string}
 */
const createSvg = function createSvg() {
  let {
    path = markerPath,
    color = _colors__WEBPACK_IMPORTED_MODULE_9__.GREEN,
    height = 48,
    width = 48
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  const attributes = [`fill="${color}"`, `height="${height}"`, `width="${width}"`, 'version="1.1"', 'xmlns="http://www.w3.org/2000/svg"', 'focusable="false"', 'viewBox="0 0 24 24"'].join(' ');
  return `<svg ${attributes}>${path}</svg>`;
};

/**
 * Creates a marker style based on default marker svg
 * @param {Object} markerOptions
 * @returns {Style}
 */
const createMarker = function createMarker() {
  let {
    color,
    path
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return [new ol_style__WEBPACK_IMPORTED_MODULE_7__["default"]({
    image: new ol_style__WEBPACK_IMPORTED_MODULE_5__["default"]({
      anchor: [0.5, 3],
      anchorYUnits: 'pixels',
      anchorOrigin: 'bottom-left',
      src: svgToUri(createSvg({
        path,
        color
      }))
    })
  }), new ol_style__WEBPACK_IMPORTED_MODULE_7__["default"]({
    image: new ol_style__WEBPACK_IMPORTED_MODULE_3__["default"]({
      fill: new ol_style__WEBPACK_IMPORTED_MODULE_4__["default"]({
        color: 'rgba(0,0,0,0.0)'
      }),
      radius: 5,
      displacement: [0, 27]
    })
  })];
};

/**
 *
 * @param {Object} fillOptions
 * @returns {Fill}
 */
const createFill = function createFill() {
  let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  let {
      color = _colors__WEBPACK_IMPORTED_MODULE_9__.BLUE,
      opacity = 0.2
    } = _ref,
    fillProps = _objectWithoutProperties(_ref, _excluded);
  return new ol_style__WEBPACK_IMPORTED_MODULE_4__["default"](_objectSpread({
    color: addOpacity(color, opacity)
  }, fillProps));
};

/**
 * @param {Object} strokeOptions
 * @returns {Stroke}
 */
const createStroke = function createStroke() {
  let _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  let {
      color = _colors__WEBPACK_IMPORTED_MODULE_9__.BLUE,
      opacity = 1,
      width = 3
    } = _ref2,
    strokeProps = _objectWithoutProperties(_ref2, _excluded2);
  return new ol_style__WEBPACK_IMPORTED_MODULE_6__["default"](_objectSpread({
    color: addOpacity(color, opacity),
    width
  }, strokeProps));
};

/**
 * @param {Object} styleOptions
 * @returns {Style}
 */
const createPolygonStyle = function createPolygonStyle() {
  let {
    fill = createFill(),
    stroke = createStroke()
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return new ol_style__WEBPACK_IMPORTED_MODULE_7__["default"]({
    fill,
    stroke
  });
};

/***/ },

/***/ "./modules/commons/components/Map/utils/openlayers/wmsCapabilities.js"
/*!****************************************************************************!*\
  !*** ./modules/commons/components/Map/utils/openlayers/wmsCapabilities.js ***!
  \****************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   checkProjectionSupport: () => (/* binding */ checkProjectionSupport),
/* harmony export */   getExtentFromBoundingBoxes: () => (/* binding */ getExtentFromBoundingBoxes),
/* harmony export */   getWmsCapabilities: () => (/* binding */ getWmsCapabilities),
/* harmony export */   getWmsData: () => (/* binding */ getWmsData),
/* harmony export */   parseWmsGetCapabilites: () => (/* binding */ parseWmsGetCapabilites)
/* harmony export */ });
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.array.iterator.js");
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.promise.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.promise.js");
/* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.string.includes.js");
/* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.dom-collections.for-each.js");
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.dom-collections.iterator.js");
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var core_js_modules_web_url_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.url.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.url.js");
/* harmony import */ var core_js_modules_web_url_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_url_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var core_js_modules_web_url_to_json_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.url.to-json.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.url.to-json.js");
/* harmony import */ var core_js_modules_web_url_to_json_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_url_to_json_js__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var core_js_modules_web_url_search_params_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/web.url-search-params.js */ "./node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/web.url-search-params.js");
/* harmony import */ var core_js_modules_web_url_search_params_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_url_search_params_js__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var ol_format_WMSCapabilities__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ol/format/WMSCapabilities */ "./node_modules/.pnpm/ol@10.6.1/node_modules/ol/format/WMSCapabilities.js");
/* harmony import */ var commons_errors_utils_async__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! commons/errors/utils/async */ "./modules/commons/errors/utils/async.js");
/* harmony import */ var commons_store__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! commons/store */ "./modules/commons/store/index.js");
/* harmony import */ var config__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! config */ "./app/registry/config/config.js");
/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! lodash-es */ "./node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.js");
/* harmony import */ var _projection__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./projection */ "./modules/commons/components/Map/utils/openlayers/projection.js");
/* harmony import */ var _projections__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./projections */ "./modules/commons/components/Map/utils/openlayers/projections.js");
const _excluded = ["error"];
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }















const LAYER_LIMIT_VISIBILITY = 3;
const DEFAULT_MAP_EXTENT = [-3858811.7371753007, 3192437.0539839533, 8666648.325757068, 8487560.45499612];
const CAPABILITIES_PARAMS = {
  request: 'getCapabilities',
  service: 'WMS',
  version: '1.3.0'
};

/**
 * Requests the WMS service metadata
 *
 * @param {string} url
 * @returns {Promise}
 */
const getWmsCapabilities = async url => {
  if (url.includes('http:')) return {
    error: 'loadFromHttpError'
  };
  const parsedURL = new URL(url);

  // Add required wms parameters if missing
  const searchParamKeys = Array.from(parsedURL.searchParams.keys()).map(param => param.toLowerCase());
  Object.keys(CAPABILITIES_PARAMS).forEach(param => {
    if (searchParamKeys.includes(param)) return;
    parsedURL.searchParams.set(param, CAPABILITIES_PARAMS[param]);
  });
  const wmsURI = parsedURL.href;
  const parser = new ol_format_WMSCapabilities__WEBPACK_IMPORTED_MODULE_8__["default"]();
  (0,commons_errors_utils_async__WEBPACK_IMPORTED_MODULE_9__.addIgnore)('loadViaProxy', true, true);
  return commons_store__WEBPACK_IMPORTED_MODULE_10__.entrystore.loadViaProxy(wmsURI, 'application/xml').catch(loadError => {
    console.error(loadError);
    return 'getCapabilitiesLoadError';
  }).then(response => parser.read(response)).catch(parseError => {
    console.error(parseError);
    return {
      error: 'getCapabilitiesParseError'
    };
  });
};

/**
 * Converts capabtilites root layer to array of layers
 *
 * @param {object|object[]} rootLayer
 * @returns {object[]}
 */
const rootLayerToLayers = rootLayer => {
  if (!rootLayer) return [];
  if (!rootLayer.Layer) {
    return rootLayer.Name ? [rootLayer] : [];
  }
  return Array.isArray(rootLayer.Layer) ? rootLayer.Layer : [rootLayer.Layer];
};
const getGeographical = extent => {
  if (!extent) return;
  return (0,_projection__WEBPACK_IMPORTED_MODULE_13__.extentToProjection)(extent, _projections__WEBPACK_IMPORTED_MODULE_14__.ESPG_WGS84);
};

/**
 * Parses wms layer configuration
 *
 * @param {object|object[]} rootLayer
 * @returns {object[]|undefined}
 */
const getWmsLayers = rootLayer => {
  const layers = rootLayerToLayers(rootLayer);
  return layers.map(_ref => {
    let {
      Name: name,
      Title: title,
      Abstract: description,
      EX_GeographicBoundingBox: boundingBox
    } = _ref;
    return _objectSpread({
      title,
      description,
      name,
      visible: layers.length <= LAYER_LIMIT_VISIBILITY
    }, boundingBox && {
      extent: getGeographical(boundingBox)
    });
  });
};

/**
 * Look for best matching projection in this order:
 * 1. Default projections in OpenLayers
 * 2. Other registered projections in OpenLayers
 *
 * @param {string[]} projectionCodes
 * @returns {object|undefined}
 */
const findAvailableProjection = projectionCodes => {
  if (!projectionCodes.length) return;
  const defaultProjectionCodes = [_projections__WEBPACK_IMPORTED_MODULE_14__.EPSG_WEB_MERCATOR, _projections__WEBPACK_IMPORTED_MODULE_14__.CRS_WGS84, _projections__WEBPACK_IMPORTED_MODULE_14__.ESPG_WGS84];
  const defaultProjectionCode = projectionCodes.find(projectionCode => defaultProjectionCodes.includes(projectionCode));
  if (defaultProjectionCode) return defaultProjectionCode;
  return projectionCodes.find(code => {
    return Boolean((0,_projection__WEBPACK_IMPORTED_MODULE_13__.getProjection)(code));
  });
};

/**
 * Try to find extent for a boundings box with a projection that is registered
 * in OpenLayers and transform it to default projection:
 * 1. Find a matching projection registered in OpenLayers
 * 2. Get the extent and transform it to default projection.
 *
 * @param {object[]} boundingBoxes
 * @returns {number[]|undefined}
 */
const getExtentFromBoundingBoxes = function getExtentFromBoundingBoxes() {
  let boundingBoxes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  const projectionCode = findAvailableProjection(boundingBoxes.map(_ref2 => {
    let {
      crs
    } = _ref2;
    return crs;
  }));
  if (!projectionCode) return;

  // get the extent for matching projection
  const {
    crs,
    extent
  } = boundingBoxes.find(boundingBox => {
    if (boundingBox.crs === projectionCode) return true;
    return false;
  });
  const axisOrientation = (0,_projection__WEBPACK_IMPORTED_MODULE_13__.getProjection)(crs).getAxisOrientation();
  const enuExtent = axisOrientation === 'neu' ? [extent[1], extent[0], extent[3], extent[2]] : extent;
  return (0,_projection__WEBPACK_IMPORTED_MODULE_13__.extentToProjection)(enuExtent, crs);
};

/**
 * Check if any of the provided projections is a supported projection and
 * returns first match.
 *
 * @param {string[]|undefined} projectionCodes
 * @returns {string|undefined}
 */
const checkProjectionSupport = projectionCodes => {
  return projectionCodes === null || projectionCodes === void 0 ? void 0 : projectionCodes.find(projectionCode => [_projections__WEBPACK_IMPORTED_MODULE_14__.EPSG_WEB_MERCATOR, _projections__WEBPACK_IMPORTED_MODULE_14__.ESPG_WGS84, _projections__WEBPACK_IMPORTED_MODULE_14__.CRS_WGS84].includes(projectionCode));
};
const LAYER_PATH = 'Capability.Layer';
const WMS_BASE_URI_PATH = 'Capability.Request.GetMap.DCPType[0].HTTP.Get.OnlineResource';
const checks = [{
  path: 'Capability',
  messageNls: 'loadSourceError'
}, {
  path: LAYER_PATH,
  messageNls: 'missingLayerInformation'
}, {
  path: WMS_BASE_URI_PATH,
  messageNls: 'missingBaseURI'
}];

/**
 *
 * @param {object} wmsData
 * @returns {string|undefined}
 */
const validateWmsData = wmsData => {
  for (const {
    path,
    messageNls
  } of checks) {
    const value = (0,lodash_es__WEBPACK_IMPORTED_MODULE_12__["default"])(wmsData, path);
    if (!value) {
      console.error(`Validation failed at path ${path}`);
      return messageNls;
    }
  }
};

/**
 * Extracts wms layer definitions from wms getCapabilities document, compatible
 * with visualization state.
 *
 * @param {object} data
 * @returns {object}
 */
const parseWmsGetCapabilites = data => {
  const wmsData = {
    extent: undefined,
    layers: [],
    wmsBaseURI: '',
    projection: null,
    // To be implemented
    error: '',
    basemap: 'true'
  };
  const error = validateWmsData(data);
  if (error) return {
    error
  };

  // Get url for GetMap requests
  wmsData.wmsBaseURI = (0,lodash_es__WEBPACK_IMPORTED_MODULE_12__["default"])(data, WMS_BASE_URI_PATH);
  const rootLayer = (0,lodash_es__WEBPACK_IMPORTED_MODULE_12__["default"])(data, LAYER_PATH);
  wmsData.layers = getWmsLayers(rootLayer);
  const extent = getGeographical(rootLayer.EX_GeographicBoundingBox);
  wmsData.extent = extent || DEFAULT_MAP_EXTENT;
  wmsData.initialView = wmsData.extent;
  return wmsData;
};

/**
 * Retreive and parse get capabilities data according to fields state
 *
 * @param {string} wmsURI
 * @returns {Promise<object>}
 */
const getWmsData = async wmsURI => {
  const _await$getWmsCapabili = await getWmsCapabilities(wmsURI),
    {
      error
    } = _await$getWmsCapabili,
    capabilitesResult = _objectWithoutProperties(_await$getWmsCapabili, _excluded);
  if (error) return {
    error
  };
  (0,_projection__WEBPACK_IMPORTED_MODULE_13__.registerProjections)(config__WEBPACK_IMPORTED_MODULE_11__["default"].get('itemstore.projections'));
  try {
    const wmsData = parseWmsGetCapabilites(capabilitesResult);
    return wmsData;
  } catch (parseError) {
    console.error(parseError);
    return {
      error: 'loadSourceError'
    };
  }
};

/***/ }

}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64, 