!function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};__webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=2)}([function(module,exports,__webpack_require__){"use strict";var namespace=function(_namespace){return function(target){var namespaceArray=_namespace.split("."),mainPath=namespaceArray[0];window[mainPath]||(window[mainPath]={}),function constructObject(namespaceArray,obj){if(namespaceArray.length>0){var name=namespaceArray[0];obj[name]||(obj[name]={}),constructObject(namespaceArray.splice(1),obj[name])}else obj[target.name]=target;return obj}(namespaceArray.splice(1),window[mainPath])}};module.exports=namespace},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _dec,_class,_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;if(void 0!==getter)return getter.call(receiver)},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_decorator=__webpack_require__(0),_decorator2=_interopRequireDefault(_decorator),_managelayersControl=__webpack_require__(5),_css=(_interopRequireDefault(_managelayersControl),__webpack_require__(6)),ManageLayersControl=(function(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);newObj.default=obj}(_css),(_dec=(0,_decorator2.default)("M.control"))(_class=function(_M$Control){function ManageLayersControl(impl,params,options){_classCallCheck(this,ManageLayersControl),M.utils.isUndefined(M.impl.control.ManageLayersControl)&&M.exception("La implementación usada no puede crear controles ManageLayersControl");var _this=_possibleConstructorReturn(this,(ManageLayersControl.__proto__||Object.getPrototypeOf(ManageLayersControl)).call(this,impl,options.controlName));return _this.params_=params||{},_this.options_=_this.getControlOptions_(options),_this}return _inherits(ManageLayersControl,_M$Control),_createClass(ManageLayersControl,null,[{key:"NAME",get:function(){return"ManageLayers"}},{key:"TEMPLATE",get:function(){return"template_managelayers_control.html"}},{key:"CONFIG_BASE",get:function(){return{controlName:ManageLayersControl.NAME,template:ManageLayersControl.TEMPLATE,iconClass:"g-cartografia-capas2",tooltip:"Gestor capas"}}}]),_createClass(ManageLayersControl,[{key:"createView",value:function(map){var _this2=this;return new Promise(function(success,fail){M.template.compile(_this2.options_.template,{vars:_this2.options_}).then(function(html){var content=null;if(M.utils.isNullOrEmpty(_this2.options_.toolbar))content=html,_this2.getPanel()._controlsContainer.appendChild(html);else{var toolbar=_this2.options_.toolbar;!1===!M.utils.isNullOrEmpty(_this2.getPanel()._element.querySelector(toolbar.selector))&&_this2.getPanel()._controlsContainer.appendChild(toolbar.target);var button=html.querySelector(_this2.getSelectorToolbarButton_()),container=html.querySelector(_this2.getSelectorToolbarContainer_());toolbar.target.querySelector(toolbar.selectorBtn).appendChild(button),toolbar.target.querySelector(toolbar.selectorContainer).appendChild(container),content=toolbar.target}_this2.addEvents(content),success(content)})})}},{key:"getActivationButton",value:function(html){return html.querySelector("button#m-managelayerscontrol-button")}},{key:"activate",value:function(){this.getToolbarContainer_().classList.toggle("dNone"),this.getControlButton_().classList.toggle("active"),this.getTitleControlManageLayers_().innerText=this.options_.tooltip,_get(ManageLayersControl.prototype.__proto__||Object.getPrototypeOf(ManageLayersControl.prototype),"activate",this).call(this)}},{key:"deactivate",value:function(){this.getToolbarContainer_().classList.toggle("dNone"),this.getControlButton_().classList.toggle("active"),_get(ManageLayersControl.prototype.__proto__||Object.getPrototypeOf(ManageLayersControl.prototype),"deactivate",this).call(this)}},{key:"getControlOptions_",value:function(options){options=options||{};var opt_=M.utils.extend({},ManageLayersControl.CONFIG_BASE,!0);return opt_=M.utils.extend(opt_,options,!0),opt_.baseName=M.utils.isNullOrEmpty(opt_.baseName)?opt_.controlName:opt_.baseName,opt_.baseName=opt_.baseName.toLowerCase(),opt_}},{key:"getConfigDefault_",value:function(){return this.CONFIG_BASE}},{key:"addEvents",value:function(html){}},{key:"render",value:function(){}},{key:"getActivationButton",value:function(html){return html.querySelector(this.getSelectorButton_())}},{key:"equals",value:function(obj){var equals=!1;return obj instanceof ManageLayersControl&&(equals=this.name===obj.name),equals}},{key:"getSelectorToolbarButton_",value:function(){return"#toolbar-button-"+this.options_.baseName}},{key:"getSelectorToolbarContainer_",value:function(){return"#toolbar-container-"+this.options_.baseName}},{key:"getSelectorButton_",value:function(){return"#tool-btn-"+this.options_.baseName}},{key:"getSelectorContainer_",value:function(){return"#tool-"+this.options_.baseName}},{key:"getToolbarContainer_",value:function(){return this.getPanel()._element.querySelector(this.getSelectorToolbarContainer_())}},{key:"getControlContainer_",value:function(){return this.getPanel()._element.querySelector(this.getSelectorContainer_())}},{key:"getControlButton_",value:function(){return this.getPanel()._element.querySelector(this.getSelectorButton_())}},{key:"getTitleControlManageLayers_",value:function(){return this.getPanel()._element.querySelector("#toolbar-title-managelayers")}},{key:"getOptionsControlManageLayers",value:function(item){return this.getOptionsManageLayers(item,this.name.toLowerCase())}},{key:"setOptionsControlManageLayers",value:function(item,options){this.setOptionsManageLayers(item,options,this.name.toLowerCase())}},{key:"getOptionsManageLayers",value:function(item,name){var options=item.options.manageLayers;return M.utils.isNullOrEmpty(name)||M.utils.isNullOrEmpty(options)||(options=options[name]),options}},{key:"setOptionsManageLayers",value:function(item,options,name){M.utils.isNullOrEmpty(item.options.manageLayers)&&(item.options.manageLayers={}),M.utils.isNullOrEmpty(name)?item.options.manageLayers=options:item.options.manageLayers[name]=options}},{key:"resetOptionsManageLayers",value:function(layer){layer.options.manageLayers={}}},{key:"getQuerySelectorScapeCSS",value:function(target,selector,name){return target.querySelector(selector+CSS.escape(name))}},{key:"activateLoading",value:function(){this.getPanel()._element.querySelector("#m-waiting-result").classList.remove("dNone"),this.getPanel()._element.querySelector(".m-toolbar-containers-managelayers").style.minHeight="70px"}},{key:"deactivateLoading",value:function(){this.getPanel()._element.querySelector("#m-waiting-result").classList.add("dNone"),this.getPanel()._element.querySelector(".m-toolbar-containers-managelayers").style.minHeight="initial"}},{key:"addLayers",value:function(layers){this.map_.addLayers(layers)}},{key:"removeLayers",value:function(layers){this.map_.getImpl().removeItemLayers(layers)}},{key:"isLoadLayer",value:function(layer){var isLoad=!1;return null!=this.findLayerById(layer.id)&&(isLoad=!0),isLoad}},{key:"findLayerByName",value:function(layerName){return this.findItemByProperty(this.map_.getLayers(),"name",layerName)}},{key:"findLayerById",value:function(layerId){return this.findItemByProperty(this.map_.getLayers(),"id",layerId)}},{key:"findItemByProperty",value:function(lstItems,itemProperty,itemValue){var item=null;return lstItems&&itemProperty&&lstItems.some(function(it){if(it[itemProperty]===itemValue)return item=it,!0}),item}}]),ManageLayersControl}(M.Control))||_class);exports.default=ManageLayersControl},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _dec,_class,_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_decorator=__webpack_require__(0),_decorator2=_interopRequireDefault(_decorator),_mapea_core_extension=__webpack_require__(3),_mapea_core_extension2=_interopRequireDefault(_mapea_core_extension),_activelayersControl=__webpack_require__(4),_activelayersControl2=_interopRequireDefault(_activelayersControl),_baselayersControl=__webpack_require__(10),_thematiclayersControl=(_interopRequireDefault(_baselayersControl),__webpack_require__(12)),_wmclayersControl=(_interopRequireDefault(_thematiclayersControl),__webpack_require__(13)),_managelayers=(_interopRequireDefault(_wmclayersControl),__webpack_require__(14)),_managelayersControl=(_interopRequireDefault(_managelayers),__webpack_require__(1));_interopRequireDefault(_managelayersControl),(_dec=(0,_decorator2.default)("M.plugin"))(_class=function(_M$Plugin){function ManageLayers(parameters){_classCallCheck(this,ManageLayers);var _this=_possibleConstructorReturn(this,(ManageLayers.__proto__||Object.getPrototypeOf(ManageLayers)).call(this));return _this.name=M.plugin.ManageLayers.NAME,_this.map_=null,_this.controls_=[],parameters=parameters||{},_this.config_=parameters.config||{},_this.params_=parameters.params||{},_this.options_=parameters.options||{},_mapea_core_extension2.default.overrideMapeaCore(),_mapea_core_extension2.default.initMapeaCoreExtension(_this),_this}return _inherits(ManageLayers,_M$Plugin),_createClass(ManageLayers,null,[{key:"NAME",get:function(){return"ManageLayers"}},{key:"TEMPLATE",get:function(){return"template_managelayers_toolbar.html"}}]),_createClass(ManageLayers,[{key:"addTo",value:function(map){var _this2=this;this.map_=map,this.createView(map).then(function(html){_this2.toolbar_={target:html,selector:"#toolbar-"+ManageLayers.NAME.toLowerCase(),selectorBtn:".m-toolbar-buttons",selectorContainer:".m-toolbar-containers"},_this2.map_.on(M.evt.COMPLETED,function(){M.utils.isNullOrEmpty(_this2.params_.metadata)?_this2.initControls():M.remote.get(_this2.params_.metadata,null,{jsonp:!1}).then(function(response){if(!1===response.error){var data=response.text;JSON.parse(data)}else M.dialog.error("Se ha producido un error al cargar la configuración de metadatos","Configuración metadatos");_this2.initControls()})})})}},{key:"getConfigControl",value:function(name){var config=this.config_[name]||{};return config.params=config.params||{},config.options=config.options||{},config.options.toolbar=this.toolbar_,config}},{key:"initControls",value:function(){var _this3=this,ctrol=null,config=null;config=this.getConfigControl("activeLayers"),ctrol=new M.control.ActiveLayersControl(config.params,config.options),this.addControlToPlugin_(ctrol),config=this.getConfigControl("baseLayers"),ctrol=new M.control.BaseLayersControl(config.params,config.options),this.addControlToPlugin_(ctrol),config=this.getConfigControl("thematicLayers"),ctrol=new M.control.ThematicLayersControl(config.params,config.options),this.addControlToPlugin_(ctrol),this.panel_=this.getPanel_(),this.panel_.addControls(this.controls_),this.panel_.on(M.evt.ADDED_TO_MAP,function(){return _this3.fire(M.evt.ADDED_TO_MAP)}),this.map_.addPanels(this.panel_)}},{key:"createView",value:function(map){return M.template.compile(ManageLayers.TEMPLATE,{})}},{key:"addControlToPlugin_",value:function(ctrol){ctrol.on(M.evt.ACTIVATED,function(){ctrol.render()}),this.controls_.push(ctrol)}},{key:"getPanel_",value:function(){var _this4=this,name=M.utils.isNullOrEmpty(this.options_.panel)||M.utils.isNullOrEmpty(this.options_.panel.name)?"managelayers":this.options_.panel.name,panel=this.map_.getPanels(name)[0];return M.utils.isNullOrEmpty(panel)&&(panel=new M.ui.Panel(name,this.getPanelOptions_()),panel.on(M.evt.ADDED_TO_MAP,function(html){M.utils.enableTouchScroll(html)}),panel.on(M.evt.SHOW,function(evt){for(var ctrlActive=!1,ctrls=_this4.getControls(),i=0;i<ctrls.length;i++)if(ctrls[i].activated){ctrlActive=!0;break}if(!ctrlActive){_this4.map_.getControls(_activelayersControl2.default.NAME)[0].activate()}})),panel}},{key:"getPanelOptions_",value:function(){var opt_={};return M.utils.isNullOrEmpty(this.options_.panel)||(opt_=this.options_.panel),{collapsible:!0,className:"m-managelayers"+(M.utils.isNullOrEmpty(opt_.className)?"":" "+opt_.className),collapsedButtonClass:M.utils.isNullOrEmpty(opt_.collapsedClass)?"g-cartografia-capas2":opt_.collapsedClass,position:M.utils.isNullOrEmpty(opt_.position)?M.ui.position.TR:opt_.position,tooltip:M.utils.isNullOrEmpty(opt_.tooltip)?"Gestor de capas":opt_.tooltip}}},{key:"getControls",value:function(){return this.controls_}},{key:"destroy",value:function(){this.map_.removeControls(this.controls_),this.map_=null,this.controls_=null,this.panel_=null,this.params_=null,this.options_=null,this.name=null}},{key:"equals",value:function(plugin){var equals=!1;return plugin instanceof ManageLayers&&(equals=!0),equals}}]),ManageLayers}(M.Plugin))},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),MapeaCoreExtension=function(){function MapeaCoreExtension(){_classCallCheck(this,MapeaCoreExtension)}return _createClass(MapeaCoreExtension,null,[{key:"initMapeaCoreExtension",value:function(this_){if(M.utils.isNullOrEmpty(this_.fnEquals_)){this_.fnEquals_=[],this_.fnEquals_[M.layer.type.GeoJSON]=M.layer.GeoJSON.prototype.equals,this_.fnEquals_[M.layer.type.KML]=M.layer.KML.prototype.equals,this_.fnEquals_[M.layer.type.Mapbox]=M.layer.Mapbox.prototype.equals,this_.fnEquals_[M.layer.type.OSM]=M.layer.OSM.prototype.equals,this_.fnEquals_[M.layer.type.WFS]=M.layer.WFS.prototype.equals,this_.fnEquals_[M.layer.type.WMC]=M.layer.WMC.prototype.equals,this_.fnEquals_[M.layer.type.WMS]=M.layer.WMS.prototype.equals,this_.fnEquals_[M.layer.type.WMTS]=M.layer.WMTS.prototype.equals;var fnEquals_=this_.fnEquals_,_fn_equals=function(obj){return M.utils.isUndefined(this.id)?fnEquals_[this.type](obj):this.id===obj.id};M.layer.GeoJSON.prototype.equals=_fn_equals,M.layer.KML.prototype.equals=_fn_equals,M.layer.Mapbox.prototype.equals=_fn_equals,M.layer.OSM.prototype.equals=_fn_equals,M.layer.WFS.prototype.equals=_fn_equals,M.layer.WMC.prototype.equals=_fn_equals,M.layer.WMS.prototype.equals=_fn_equals,M.layer.WMTS.prototype.equals=_fn_equals}}},{key:"overrideMapeaCore",value:function(){M.impl.layer.WFS.prototype.getCapabilities=M.impl.layer.WMS.prototype.getCapabilities,M.impl.layer.WMS.prototype.getAbstractLayer=M.impl.layer.WFS.prototype.getAbstractLayer=M.impl.layer.WMTS.prototype.getAbstractLayer=function(){return new Promise(function(success,fail){M.utils.isNullOrEmpty(this.abstract_)?this.getCapabilities().then(function(info){var infoLayer=null;M.utils.isUndefined(info.getInfoCapabilities)?!M.utils.isUndefined(info.Contents)&&info.Contents.Layer&&(infoLayer=info.Contents.Layer[0]):infoLayer=info.getInfoCapabilities(this.name),this.abstract_=infoLayer?infoLayer.Abstract:"",success(this.abstract_)}.bind(this)).catch(function(err){return fail(err)}):success(this.abstract_)}.bind(this))},M.impl.layer.WMS.prototype.getMetadataURL=M.impl.layer.WFS.prototype.getMetadataURL=function(){var _this=this;return new Promise(function(success,fail){M.utils.isNullOrEmpty(_this.metadataLink_)?_this.getCapabilities().then(function(info){var infoLayer=null;_this instanceof M.impl.layer.WMTS||(infoLayer=info.getInfoCapabilities(_this.name)),_this.metadataLink_=!!infoLayer&&(!!infoLayer.MetadataURL&&infoLayer.MetadataURL[0].OnlineResource);var baseURLs=["www.ideandalucia.es","www.callejerodeandalucia.es","www.juntadeandalucia.es"],baseUrlLayer=document.createElement("a");if(baseUrlLayer.href=_this.url,!_this.metadataLink_&&baseURLs.indexOf(baseUrlLayer.hostname)>-1){M.remote.get("http://www.ideandalucia.es/catalogo/inspire/srv/spa/q",{any:_this.name},{jsonp:!0}).then(function(response){var parser=new DOMParser,xmlDoc=parser.parseFromString(response.text,"text/xml"),uuid=xmlDoc.getElementsByTagName("uuid");uuid.length&&(_this.metadataLink_="http://www.ideandalucia.es/catalogo/inspire/srv/spa/metadata.formatter.html?xsl=metadato_completo&uuid="+uuid[0].childNodes[0].nodeValue),success(_this.metadataLink_)}).catch(function(err){return fail(err)})}else success(_this.metadataLink_)}).catch(function(err){return fail(err)}):success(_this.metadataLink_)})},M.impl.layer.WMS.prototype.getStylesLayer=function(){var _this2=this;return new Promise(function(success,fail){M.utils.isNullOrEmpty(_this2.listStyles_)?_this2.getCapabilities().then(function(info){var infoLayer=info.getInfoCapabilities(_this2.name);_this2.listStyles_=M.utils.isNullOrEmpty(infoLayer)?[]:M.utils.isNullOrEmpty(infoLayer.Style)?[]:infoLayer.Style,_this2.selectedStyle_=0,M.utils.isNullOrEmpty(_this2.listStyles_[0])||M.utils.isNullOrEmpty(_this2.listStyles_[0].LegendURL)||_this2.setLegendURL(_this2.listStyles_[0].LegendURL[0].OnlineResource),_this2.listStyles_.forEach(function(style,index){style.Name==_this2.getOL3Layer().getSource().getParams().STYLES&&(_this2.selectedStyle_=index,M.utils.isNullOrEmpty(style.LegendURL)||_this2.setLegendURL(style.LegendURL[0].OnlineResource))}),success(_this2.listStyles_)}).catch(function(err){return fail(err)}):success(_this2.listStyles_)})},M.impl.layer.WMS.prototype.getSelectedStyle=function(){return M.utils.isNullOrEmpty(this.listStyles_)?null:this.listStyles_[this.selectedStyle_]},M.impl.layer.WMS.prototype.setSelectedStyle=function(selectedStyle){if(!M.utils.isNullOrEmpty(this.listStyles_)){var style=this.listStyles_[selectedStyle];this.getOL3Layer().getSource().updateParams({STYLES:style.Name}),this.selectedStyle_=selectedStyle,M.utils.isNullOrEmpty(style.LegendURL)||this.setLegendURL(style.LegendURL[0].OnlineResource)}},M.impl.GetCapabilities.prototype.getInfoCapabilities=function(layerName){var obj=this,key=null,capabilities=null;for(key in obj)if(!M.utils.isNullOrEmpty(obj[key])&&!M.utils.isUndefined(obj[key].Capability)){capabilities=obj[key].Capability;break}var info=null;return M.utils.isNullOrEmpty(capabilities)||(info=this.getInfoCapabilitiesRecursive_(capabilities.Layer,layerName)),info},M.impl.GetCapabilities.prototype.getInfoCapabilitiesRecursive_=function(layer,layerName){var itemInfo=null,i=void 0,ilen=void 0;if(!M.utils.isNullOrEmpty(layer))if(M.utils.isArray(layer))for(i=0,ilen=layer.length;i<ilen&&null===itemInfo;i++)itemInfo=this.getInfoCapabilitiesRecursive_(layer[i],layerName);else M.utils.isObject(layer)&&(M.utils.isNullOrEmpty(layerName)||layer.Name===layerName?itemInfo=layer:M.utils.isUndefined(layer.Layer)||(itemInfo=this.getInfoCapabilitiesRecursive_(layer.Layer,layerName)));return itemInfo},M.impl.Map.prototype.removeItemLayers=function(layers){var _this3=this;return M.utils.isNullOrEmpty(layers)&&(layers=[]),M.utils.isArray(layers)||(layers=[layers]),layers.forEach(function(itemLayer){_this3.layers_=_this3.layers_.filter(function(item){return item!=itemLayer}),itemLayer.type!==M.layer.type.MBtiles&&itemLayer.type!==M.layer.type.WMC&&itemLayer.getImpl().destroy(),itemLayer.type==M.layer.type.KML&&!0===itemLayer.extract&&_this3.featuresHandler_.removeLayer(itemLayer.getImpl())}),this},M.impl.layer.OSM.prototype.destroy=function(){var olMap=this.map.getMapImpl();M.utils.isNullOrEmpty(this.ol3Layer)||(olMap.removeLayer(this.ol3Layer),this.ol3Layer=null),this.map.getLayers().forEach(function(lay){(lay instanceof M.layer.OSM||lay instanceof M.layer.Mapbox)&&(this.haveOSMorMapboxLayer=!0)},this),this.haveOSMorMapboxLayer||this.map.getImpl().getMapImpl().getControls().getArray().forEach(function(data){data instanceof ol.control.Attribution&&this.map.getImpl().getMapImpl().removeControl(data)},this),this.map=null},M.impl.Layer.prototype.getLegendURL=function(){return M.utils.isNullOrEmpty(this.legendUrl_)&&(this.legendUrl_=M.utils.concatUrlPaths([M.config.THEME_URL,M.Layer.LEGEND_DEFAULT])),this.legendUrl_},M.impl.Layer.prototype.setLegendURL=function(legendUrl){this.legendUrl_=legendUrl},M.impl.Map.Z_INDEX={},M.impl.Map.Z_INDEX[M.layer.type.WMC]=1,M.impl.Map.Z_INDEX[M.layer.type.WMS]=1,M.impl.Map.Z_INDEX[M.layer.type.WMTS]=1,M.impl.Map.Z_INDEX[M.layer.type.Mapbox]=1,M.impl.Map.Z_INDEX[M.layer.type.OSM]=1,M.impl.Map.Z_INDEX[M.layer.type.KML]=1,M.impl.Map.Z_INDEX[M.layer.type.WFS]=1}}]),MapeaCoreExtension}();exports.default=MapeaCoreExtension},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _dec,_class,_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_decorator=__webpack_require__(0),_decorator2=_interopRequireDefault(_decorator),_managelayersControl=__webpack_require__(1),_managelayersControl2=_interopRequireDefault(_managelayersControl),_activelayersControl=__webpack_require__(8),_externs_htmlSortableMin=(_interopRequireDefault(_activelayersControl),__webpack_require__(9)),_externs_htmlSortableMin2=_interopRequireDefault(_externs_htmlSortableMin),ActiveLayersControl=(_dec=(0,_decorator2.default)("M.control"))(_class=function(_ManageLayersControl){function ActiveLayersControl(params,options){_classCallCheck(this,ActiveLayersControl),M.utils.isUndefined(M.impl.control.ActiveLayersControl)&&M.exception("La implementación usada no puede crear controles ActiveLayersControl");var opt_={controlName:ActiveLayersControl.NAME,iconClass:"g-cartografia-capas2",tooltip:"Capas activas"};options=M.utils.extend(opt_,options,!0);var impl=new M.impl.control.ActiveLayersControl(params),_this=_possibleConstructorReturn(this,(ActiveLayersControl.__proto__||Object.getPrototypeOf(ActiveLayersControl)).call(this,impl,params,options));return _this.params_=params||{},impl.facadeCtrol_=_this,_this.countID_=0,_this.boundClickLayer_=function(evt){return _this.clickLayer(evt)},_this}return _inherits(ActiveLayersControl,_ManageLayersControl),_createClass(ActiveLayersControl,null,[{key:"NAME",get:function(){return"ActiveLayers"}},{key:"TEMPLATE",get:function(){return"activelayers.html"}}]),_createClass(ActiveLayersControl,[{key:"addEvents",value:function(html){var _this2=this;html.querySelector(this.getSelectorContainer_()).addEventListener("input",function(evt){return _this2.clickLayerSlider(evt)})}},{key:"clickLayerSlider",value:function(evt){if(evt=evt||window.event,!M.utils.isNullOrEmpty(evt.target)){var itemTarget=evt.target,id=itemTarget.getAttribute("data-id");if(!M.utils.isNullOrEmpty(id)){var layer=this.findLayerById(id);itemTarget.classList.contains("m-accion-activelayers-transparency")&&(layer.setOpacity(itemTarget.value),itemTarget.nextElementSibling.innerHTML=100*itemTarget.value+"%")}}}},{key:"clickLayer",value:function(evt){if(evt=evt||window.event,!M.utils.isNullOrEmpty(evt.target)){var itemTarget=evt.target,id=itemTarget.getAttribute("data-id");if(!M.utils.isNullOrEmpty(id)){var layer=this.findLayerById(id),ctolContainer=this.getControlContainer_(),itemTocOptions=this.getQuerySelectorScapeCSS(ctolContainer,"#optionsTocLayer_",id);if(itemTarget.classList.contains("m-accion-activelayers-collapse")){this.getOptionsControlManageLayers(layer).collapsed=!itemTocOptions.classList.contains("dNone"),itemTocOptions.classList.toggle("dNone"),itemTarget.classList.toggle("g-cartografia-flecha-abajo2"),itemTarget.classList.toggle("g-cartografia-flecha-arriba2")}else if(itemTarget.classList.contains("m-accion-activelayers-rename")){var titleText=this.getQuerySelectorScapeCSS(ctolContainer,"#textTitleLayer_",id),input=document.createElement("input");input.type="text",input.value=titleText.innerText,titleText.innerText="",titleText.appendChild(input),input.addEventListener("focus",function(){this.select()}),input.focus();var _event_blur=function _event_blur(evt){titleText.innerHTML=input.value,layer.legend=input.value,input.removeEventListener("blur",function(evt){return _event_blur(evt)}),input=null};input.addEventListener("blur",function(evt){return _event_blur()})}else if(itemTarget.classList.contains("m-accion-activelayers-activate")){if(!0===layer.transparent||!layer.isVisible()){var opacity=itemTarget.parentElement.parentElement.querySelector("div.tools > input");M.utils.isNullOrEmpty(opacity)||layer.setOpacity(opacity.value),layer.setVisible(!layer.isVisible())}}else if(itemTarget.classList.contains("m-accion-activelayers-metadata"))layer.type!==M.layer.type.WMS&&layer.type!==M.layer.type.WFS||this.getImpl().getMetadataLink(layer).then(function(metadataLink){window.open(metadataLink,"_blank")});else if(itemTarget.classList.contains("m-accion-activelayers-info"))layer.getImpl().getAbstractLayer().then(function(descripcion){var titulo="Información: "+layer.legend;M.utils.isNullOrEmpty(descripcion)&&(descripcion="No hay descripción asociada a la capa"),M.dialog.info(descripcion,titulo)});else if(itemTarget.classList.contains("m-accion-activelayers-showstyles")){var stylesContainer=this.getQuerySelectorScapeCSS(ctolContainer,"#stylesTocLayer_",id),_configToc=this.getOptionsControlManageLayers(layer);_configToc.showStyles=stylesContainer.classList.contains("dNone"),stylesContainer.classList.toggle("dNone")}else if(itemTarget.classList.contains("m-accion-activelayers-activestyle")){var position=itemTarget.value,previousPosition=this.getImpl().getLayerStylePosition(layer);position!=previousPosition&&(this.getImpl().setLayerStyle(layer,position),this.renderPanel())}else itemTarget.classList.contains("m-accion-activelayers-remove")&&(this.resetOptionsManageLayers(layer),this.removeLayers(layer))}}}},{key:"moveLayer",value:function(itemTarget,oldIndex,newIndex){var id=M.utils.isNullOrEmpty(itemTarget)?"":itemTarget.getAttribute("data-id");M.utils.isNullOrEmpty(id)||this.getImpl().moveLayer(id,oldIndex,newIndex)}},{key:"render",value:function(){this.renderPanel()}},{key:"renderPanel",value:function(){var _this3=this;this.activateLoading(),this.getTemplateVariables_().then(function(templateVariables){M.template.compile(ActiveLayersControl.TEMPLATE,{vars:{overlayLayers:templateVariables}}).then(function(html){_this3.sortableList&&(_this3.sortableList.destroy(),_this3.sortableList=null);var actions=_this3.getControlContainer_().querySelectorAll("[class^=m-accion-]");if(Array.from(actions).forEach(function(action){action.removeEventListener("click",_this3.boundClickLayer_)}),_this3.registerImgErrorEvents_(html),_this3.getControlContainer_().innerHTML=html.innerHTML,!_this3.sortableList){var itemSortable=_this3.getControlContainer_().querySelector(".sortable-activelayers");_this3.sortableList=_externs_htmlSortableMin2.default.create(itemSortable,{animation:150,handle:".m-accion-activelayers-order",onEnd:function(evt){_this3.moveLayer(evt.item,evt.oldIndex,evt.newIndex)}})}actions=_this3.getControlContainer_().querySelectorAll("[class^=m-accion-]"),Array.from(actions).forEach(function(action){action.addEventListener("click",_this3.boundClickLayer_)}),_this3.deactivateLoading()})})}},{key:"getTemplateVariables_",value:function(){var _this4=this;this.setConfigLayers();var overlayLayers=this.getImpl().getFilterLayerList(!1),promises=overlayLayers.map(function(ly){return _this4.parseLayerForTemplate_(ly)});return Promise.all(promises).catch(function(err){return console.log("Catch",err)})}},{key:"parseLayerForTemplate_",value:function(layer,index){var _this5=this;return new Promise(function(success,fail){var configToc=_this5.getOptionsControlManageLayers(layer);M.utils.isNullOrEmpty(configToc)&&(configToc={index:index,collapsed:!0,showStyles:!1},_this5.setOptionsControlManageLayers(layer,configToc));var layerTitle=layer.legend;M.utils.isNullOrEmpty(layerTitle)&&(layerTitle=layer.name),M.utils.isNullOrEmpty(layerTitle)&&(layerTitle="Servicio - "+layer.type);var metadata=layer.options.metadata,infoLayer=layer.type===M.layer.type.WMS||layer.type===M.layer.type.WMTS||layer.type===M.layer.type.WFS,result={metadata:!M.utils.isNullOrEmpty(metadata),infoLayer:infoLayer,origen:layer.options.origen,collapsed:!0===configToc.collapsed,showStyles:!0===configToc.showStyles,base:!1===layer.transparent,visible:!0===layer.isVisible(),id:layer.id,name:layer.name,title:layerTitle,legend:layer.getLegendURL(),outOfRange:!layer.inRange(),opacity:layer.getOpacity(),opacityPer:100*layer.getOpacity(),styles:[],canEditName:"Inicial"!=layer.options.origen&&"Tematica"!=layer.options.origen,canRemove:"Inicial"!=layer.options.origen},promises=[];(layer.type===M.layer.type.WMS||layer.type===M.layer.type.WFS&&M.utils.isNullOrEmpty(metadata))&&promises.push(_this5.getImpl().getMetadataLink(layer).then(function(metadataLink){result.metadata=metadataLink}).catch(function(err){return console.log("Catch",err)})),layer.type===M.layer.type.WMS&&promises.push(_this5.getImpl().getStylesLayer(layer).then(function(styles){var selectedStyle=_this5.getImpl().getLayerStylePosition(layer);result.styles=styles.map(function(style,index){return style.id=layer.id,style.selected=selectedStyle==index,style}),result.legend=layer.getLegendURL()}).catch(function(err){return console.log("Catch",err)})),Promise.all(promises).then(function(){success(result)}).catch(function(err){return console.log("Catch",err)})})}},{key:"registerImgErrorEvents_",value:function(html){var _this6=this,imgElements=html.querySelectorAll("img");Array.prototype.forEach.call(imgElements,function(imgElem){imgElem.addEventListener("error",function(evt){var id=evt.target.getAttribute("data-id"),layer=_this6.findLayerById(id),legendErrorUrl=M.utils.concatUrlPaths([M.config.THEME_URL,M.Layer.LEGEND_ERROR]);M.utils.isNullOrEmpty(layer)||(layer.setLegendURL(legendErrorUrl),evt.target.src=legendErrorUrl)})})}},{key:"equals",value:function(obj){var equals=!1;return obj instanceof ActiveLayersControl&&(equals=this.name===obj.name),equals}},{key:"setConfigLayers",value:function(){var _this7=this;this.map_.getLayers().forEach(function(layer,index){M.utils.isUndefined(layer.options)&&(layer.options={}),M.utils.isNullOrEmpty(layer.id)&&(layer.id=_this7.countID_+++"_"+layer.name),M.utils.isNullOrEmpty(layer.options.origen)&&(layer.options.origen="Inicial"),M.utils.isNullOrEmpty(layer.options.urlLegend)||layer.setLegendURL(layer.options.urlLegend)})}}]),ActiveLayersControl}(_managelayersControl2.default))||_class;exports.default=ActiveLayersControl},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ManageLayersControl=void 0;var _dec,_class,_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;if(void 0!==getter)return getter.call(receiver)},_decorator=__webpack_require__(0),_decorator2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_decorator);exports.ManageLayersControl=(_dec=(0,_decorator2.default)("M.impl.control"))(_class=function(_M$impl$Control){function ManageLayersControl(params){_classCallCheck(this,ManageLayersControl);var _this=_possibleConstructorReturn(this,(ManageLayersControl.__proto__||Object.getPrototypeOf(ManageLayersControl)).call(this));return _this.params_=params||{},_this.facadeMap_=null,_this}return _inherits(ManageLayersControl,_M$impl$Control),_createClass(ManageLayersControl,[{key:"addTo",value:function(map,element){this.facadeMap_=map,this.element=element,_get(ManageLayersControl.prototype.__proto__||Object.getPrototypeOf(ManageLayersControl.prototype),"addTo",this).call(this,map,element)}},{key:"activate",value:function(){}},{key:"deactivate",value:function(){}},{key:"destroy",value:function(){this.deactivate(),this.element.remove(),this.facadeMap_.getMapImpl().removeControl(this),this.facadeMap_=null,this.element=null}}]),ManageLayersControl}(M.impl.Control))||_class},function(module,exports,__webpack_require__){(function(global){!function(root,factory){module.exports=factory(root)}(void 0!==global?global:this,function(root){if(root.CSS&&root.CSS.escape)return root.CSS.escape;var cssEscape=function(value){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var codeUnit,string=String(value),length=string.length,index=-1,result="",firstCodeUnit=string.charCodeAt(0);++index<length;)codeUnit=string.charCodeAt(index),result+=0!=codeUnit?codeUnit>=1&&codeUnit<=31||127==codeUnit||0==index&&codeUnit>=48&&codeUnit<=57||1==index&&codeUnit>=48&&codeUnit<=57&&45==firstCodeUnit?"\\"+codeUnit.toString(16)+" ":(0!=index||1!=length||45!=codeUnit)&&(codeUnit>=128||45==codeUnit||95==codeUnit||codeUnit>=48&&codeUnit<=57||codeUnit>=65&&codeUnit<=90||codeUnit>=97&&codeUnit<=122)?string.charAt(index):"\\"+string.charAt(index):"�";return result};return root.CSS||(root.CSS={}),root.CSS.escape=cssEscape,cssEscape})}).call(exports,__webpack_require__(7))},function(module,exports){var g;g=function(){return this}();try{g=g||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(g=window)}module.exports=g},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActiveLayersControl=void 0;var _dec,_class,_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_decorator=__webpack_require__(0),_decorator2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_decorator);exports.ActiveLayersControl=(_dec=(0,_decorator2.default)("M.impl.control"))(_class=function(_M$impl$Control){function ActiveLayersControl(params){_classCallCheck(this,ActiveLayersControl);var _this=_possibleConstructorReturn(this,(ActiveLayersControl.__proto__||Object.getPrototypeOf(ActiveLayersControl)).call(this));return _this.params_=params||{},_this.facadeMap_=null,_this.totalActiveLayers_=0,_this}return _inherits(ActiveLayersControl,_M$impl$Control),_createClass(ActiveLayersControl,[{key:"addTo",value:function(map,element){this.facadeMap_=map,this.element=element;var olMap=map.getMapImpl();ol.control.Control.call(this,{element:element,target:null}),olMap.addControl(this)}},{key:"activate",value:function(){this.registerEvents()}},{key:"deactivate",value:function(){this.unregisterEvents()}},{key:"destroy",value:function(){this.deactivate(),this.element.remove(),this.facadeMap_.getMapImpl().removeControl(this),this.facadeMap_=null,this.element=null}},{key:"registerEvents",value:function(){var _this2=this;if(!M.utils.isNullOrEmpty(this.facadeMap_)){var olMap=this.facadeMap_.getMapImpl();this.registerViewEvents_(olMap.getView()),this.registerLayersEvents_(olMap.getLayers()),olMap.on("change:view",function(evt){return _this2.onViewChange_(evt)})}}},{key:"unregisterEvents",value:function(){var _this3=this;if(!M.utils.isNullOrEmpty(this.facadeMap_)){var olMap=this.facadeMap_.getMapImpl();this.unregisterViewEvents_(olMap.getView()),this.unregisterLayersEvents_(olMap.getLayers()),olMap.un("change:view",function(evt){return _this3.onViewChange_(evt)})}}},{key:"registerViewEvents_",value:function(view){var _this4=this;view.on("change:resolution",function(){return _this4.renderPanel()})}},{key:"registerLayersEvents_",value:function(layers){var _this5=this;layers.forEach(function(ly){return _this5.registerLayerEvents_(ly)}),layers.on("remove",function(){return _this5.renderPanel()}),layers.on("add",function(evt){return _this5.onAddLayer_(evt)})}},{key:"registerLayerEvents_",value:function(layer){var _this6=this;layer.on("change:visible",function(){return _this6.renderPanel()}),layer.on("change:extent",function(){return _this6.renderPanel()})}},{key:"unregisterViewEvents_",value:function(view){var _this7=this;view.un("change:resolution",function(){return _this7.renderPanel()})}},{key:"unregisterLayersEvents_",value:function(layers){var _this8=this;layers.forEach(function(ly){return _this8.registerLayerEvents_(ly)}),layers.un("remove",function(){return _this8.renderPanel()}),layers.un("add",function(evt){return _this8.onAddLayer_(evt)})}},{key:"unregisterLayerEvents_",value:function(layer){var _this9=this;layer.un("change:visible",function(){return _this9.renderPanel()}),layer.un("change:extent",function(){return _this9.renderPanel()})}},{key:"onViewChange_",value:function(evt){this.unregisterViewEvents_(evt.oldValue);var olMap=this.facadeMap_.getMapImpl();this.registerViewEvents_(olMap.getView())}},{key:"onAddLayer_",value:function(evt){var ly=evt.element;this.registerLayerEvents_(ly),ly.setZIndex(this.totalActiveLayers_+1),this.renderPanel()}},{key:"renderPanel",value:function(evt){this.facadeCtrol_.renderPanel()}},{key:"moveLayer",value:function(id,oldIndex,newIndex){var lstLayers=this.getFilterLayerList(!1),avance=newIndex-oldIndex;if(avance>0){for(var i=avance;i>0;i--)lstLayers[newIndex+1-i].setZIndex(lstLayers[newIndex+1-i].getZIndex()+1);lstLayers[oldIndex].setZIndex(lstLayers[oldIndex].getZIndex()-avance)}else{avance*=-1;for(var _i=1;_i<=avance;_i++)lstLayers[newIndex-1+_i].setZIndex(lstLayers[newIndex-1+_i].getZIndex()-1);lstLayers[oldIndex].setZIndex(lstLayers[oldIndex].getZIndex()+avance)}}},{key:"updateOrderLayer",value:function(layer,order){layer.setZIndex(order)}},{key:"getFilterLayerList",value:function(reverse){var _this10=this,filterLayers=this.facadeMap_.getLayers().filter(function(layer){var isBaseMap=!0===layer.isBaseMap,isDrawLayer="__draw__"===layer.name,isTransparent=!0===layer.transparent,displayInLayerSwitcher=!0===layer.displayInLayerSwitcher,isNotWMC=layer.type!==M.layer.type.WMC,isNotWMSFull=!(layer.type===M.layer.type.WMS&&M.utils.isNullOrEmpty(layer.name));return isBaseMap?_this10.updateOrderLayer(layer,0):isNotWMC&&!isDrawLayer&&(!1===isTransparent?_this10.updateOrderLayer(layer,1):!1===displayInLayerSwitcher&&_this10.updateOrderLayer(layer,2)),!isBaseMap&&!isDrawLayer&&isTransparent&&isNotWMC&&isNotWMSFull&&displayInLayerSwitcher}).sort(function(a,b){var zindexA=a.getZIndex(),zindexB=b.getZIndex();if(isNaN(zindexA)&&isNaN(zindexB))return 0;if(isNaN(zindexA))return-1;if(isNaN(zindexB))return 1;var sum=zindexA-zindexB;return reverse?sum:-sum}).map(function(layer,position,arr){return reverse?layer.setZIndex(position+3):layer.setZIndex(arr.length+2-position),layer});return this.totalActiveLayers_=filterLayers.length,filterLayers}},{key:"setLayerStyle",value:function(layer,selectedStyle){layer.getImpl().setSelectedStyle(selectedStyle)}},{key:"getMetadataLink",value:function(layer){return layer.getImpl().getMetadataURL()}},{key:"getStylesLayer",value:function(layer){return layer.getImpl().getStylesLayer()}},{key:"getLayerStylePosition",value:function(layer){return layer.getImpl().selectedStyle_}}]),ActiveLayersControl}(M.impl.Control))||_class},function(module,exports,__webpack_require__){"use strict";var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};/*! Sortable 1.7.0 - MIT | git://github.com/rubaxa/Sortable.git */
!function(t){__WEBPACK_AMD_DEFINE_FACTORY__=t,void 0!==(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.call(exports,__webpack_require__,exports,module):__WEBPACK_AMD_DEFINE_FACTORY__)&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}(function(){function t(e,n){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(e);this.el=e,this.options=n=b({},n),e[z]=this;var o={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(e.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==t.supportPointer};for(var i in o)!(i in n)&&(n[i]=o[i]);dt(n);for(var a in this)"_"===a.charAt(0)&&"function"==typeof this[a]&&(this[a]=this[a].bind(this));this.nativeDraggable=!n.forceFallback&&nt,r(e,"mousedown",this._onTapStart),r(e,"touchstart",this._onTapStart),n.supportPointer&&r(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(r(e,"dragover",this),r(e,"dragenter",this)),st.push(this._onDragOver),n.store&&this.sort(n.store.get(this))}function e(t,e){"clone"!==t.lastPullMode&&(e=!0),x&&x.state!==e&&(s(x,"display",e?"none":""),e||x.state&&(t.options.group.revertClone?(N.insertBefore(x,k),t._animate(C,x)):N.insertBefore(x,C)),x.state=e)}function n(t,e,n){if(t){n=n||Q;do{if(">*"===e&&t.parentNode===n||m(t,e))return t}while(t=o(t))}return null}function o(t){var e=t.host;return e&&e.nodeType?e:t.parentNode}function i(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.preventDefault()}function r(t,e,n){t.addEventListener(e,n,tt)}function a(t,e,n){t.removeEventListener(e,n,tt)}function l(t,e,n){if(t)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(V," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(V," ")}}function s(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return Q.defaultView&&Q.defaultView.getComputedStyle?n=Q.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function c(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function d(t,e,n,o,i,r,a,l){t=t||e[z];var s=Q.createEvent("Event"),c=t.options,d="on"+n.charAt(0).toUpperCase()+n.substr(1);s.initEvent(n,!0,!0),s.to=i||e,s.from=r||e,s.item=o||e,s.clone=x,s.oldIndex=a,s.newIndex=l,e.dispatchEvent(s),c[d]&&c[d].call(t,s)}function h(t,e,n,o,i,r,a,l){var s,c,d=t[z],h=d.options.onMove;return(s=Q.createEvent("Event")).initEvent("move",!0,!0),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||e.getBoundingClientRect(),s.willInsertAfter=l,t.dispatchEvent(s),h&&(c=h.call(d,s,a)),c}function u(t){t.draggable=!1}function p(){it=!1}function f(t,e){var n=t.lastElementChild.getBoundingClientRect();return e.clientY-(n.top+n.height)>5||e.clientX-(n.left+n.width)>5}function g(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function v(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t&&(t=t.previousElementSibling);)"TEMPLATE"===t.nodeName.toUpperCase()||">*"!==e&&!m(t,e)||n++;return n}function m(t,e){if(t){var n=(e=e.split(".")).shift().toUpperCase(),o=new RegExp("\\s("+e.join("|")+")(?=\\s)","g");return!(""!==n&&t.nodeName.toUpperCase()!=n||e.length&&((" "+t.className+" ").match(o)||[]).length!=e.length)}return!1}function _(t,e){var n,o;return function(){void 0===n&&(n=arguments,o=this,J(function(){1===n.length?t.call(o,n[0]):t.apply(o,n),n=void 0},e))}}function b(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function D(t){return $&&$.dom?$.dom(t).cloneNode(!0):K?K(t).clone(!0)[0]:t.cloneNode(!0)}function y(t){lt.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&lt.push(o)}}function w(t){return J(t,0)}function T(t){return clearTimeout(t)}if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var C,S,E,x,N,k,B,P,Y,X,O,I,R,A,M,L,F,U,j,H,W={},V=/\s+/g,q=/left|right|inline/,z="Sortable"+(new Date).getTime(),G=window,Q=G.document,Z=G.parseInt,J=G.setTimeout,K=G.jQuery||G.Zepto,$=G.Polymer,tt=!1,et=!1,nt="draggable"in Q.createElement("div"),ot=function(t){return!navigator.userAgent.match(/(?:Trident.*rv[ :]?11\.|msie)/i)&&(t=Q.createElement("x"),t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents)}(),it=!1,rt=Math.abs,at=Math.min,lt=[],st=[],ct=_(function(t,e,n){if(n&&e.scroll){var o,i,r,a,l,s,c=n[z],d=e.scrollSensitivity,h=e.scrollSpeed,u=t.clientX,p=t.clientY,f=window.innerWidth,g=window.innerHeight;if(Y!==n&&(P=e.scroll,Y=n,X=e.scrollFn,!0===P)){P=n;do{if(P.offsetWidth<P.scrollWidth||P.offsetHeight<P.scrollHeight)break}while(P=P.parentNode)}P&&(o=P,i=P.getBoundingClientRect(),r=(rt(i.right-u)<=d)-(rt(i.left-u)<=d),a=(rt(i.bottom-p)<=d)-(rt(i.top-p)<=d)),r||a||(a=(g-p<=d)-(p<=d),((r=(f-u<=d)-(u<=d))||a)&&(o=G)),W.vx===r&&W.vy===a&&W.el===o||(W.el=o,W.vx=r,W.vy=a,clearInterval(W.pid),o&&(W.pid=setInterval(function(){if(s=a?a*h:0,l=r?r*h:0,"function"==typeof X)return X.call(c,l,s,t);o===G?G.scrollTo(G.pageXOffset+l,G.pageYOffset+s):(o.scrollTop+=s,o.scrollLeft+=l)},24)))}},30),dt=function(t){function e(t,e){return void 0!==t&&!0!==t||(t=n.name),"function"==typeof t?t:function(n,o){var i=o.options.group.name;return e?t:t&&(t.join?t.indexOf(i)>-1:i==t)}}var n={},o=t.group;o&&"object"==(void 0===o?"undefined":_typeof(o))||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n};try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){tt={capture:!1,passive:et=!1}}}))}catch(t){}return t.prototype={constructor:t,_onTapStart:function(t){var e,o=this,i=this.el,r=this.options,a=r.preventOnFilter,l=t.type,s=t.touches&&t.touches[0],c=(s||t).target,h=t.target.shadowRoot&&t.path&&t.path[0]||c,u=r.filter;if(y(i),!C&&!(/mousedown|pointerdown/.test(l)&&0!==t.button||r.disabled)&&!h.isContentEditable&&(c=n(c,r.draggable,i))&&B!==c){if(e=v(c,r.draggable),"function"==typeof u){if(u.call(this,t,c,this))return d(o,h,"filter",c,i,i,e),void(a&&t.preventDefault())}else if(u&&(u=u.split(",").some(function(t){if(t=n(h,t.trim(),i))return d(o,t,"filter",c,i,i,e),!0})))return void(a&&t.preventDefault());r.handle&&!n(h,r.handle,i)||this._prepareDragStart(t,s,c,e)}},_prepareDragStart:function(t,e,n,o){var i,a=this,s=a.el,h=a.options,p=s.ownerDocument;n&&!C&&n.parentNode===s&&(U=t,N=s,S=(C=n).parentNode,k=C.nextSibling,B=n,L=h.group,A=o,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,C.style["will-change"]="all",i=function(){a._disableDelayedDrag(),C.draggable=a.nativeDraggable,l(C,h.chosenClass,!0),a._triggerDragStart(t,e),d(a,N,"choose",C,N,N,A)},h.ignore.split(",").forEach(function(t){c(C,t.trim(),u)}),r(p,"mouseup",a._onDrop),r(p,"touchend",a._onDrop),r(p,"touchcancel",a._onDrop),r(p,"selectstart",a),h.supportPointer&&r(p,"pointercancel",a._onDrop),h.delay?(r(p,"mouseup",a._disableDelayedDrag),r(p,"touchend",a._disableDelayedDrag),r(p,"touchcancel",a._disableDelayedDrag),r(p,"mousemove",a._disableDelayedDrag),r(p,"touchmove",a._disableDelayedDrag),h.supportPointer&&r(p,"pointermove",a._disableDelayedDrag),a._dragStartTimer=J(i,h.delay)):i())},_disableDelayedDrag:function(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),a(t,"mouseup",this._disableDelayedDrag),a(t,"touchend",this._disableDelayedDrag),a(t,"touchcancel",this._disableDelayedDrag),a(t,"mousemove",this._disableDelayedDrag),a(t,"touchmove",this._disableDelayedDrag),a(t,"pointermove",this._disableDelayedDrag)},_triggerDragStart:function(t,e){(e=e||("touch"==t.pointerType?t:null))?(U={target:C,clientX:e.clientX,clientY:e.clientY},this._onDragStart(U,"touch")):this.nativeDraggable?(r(C,"dragend",this),r(N,"dragstart",this._onDragStart)):this._onDragStart(U,!0);try{Q.selection?w(function(){Q.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(){if(N&&C){var e=this.options;l(C,e.ghostClass,!0),l(C,e.dragClass,!1),t.active=this,d(this,N,"start",C,N,N,A)}else this._nulling()},_emulateDragOver:function(){if(j){if(this._lastX===j.clientX&&this._lastY===j.clientY)return;this._lastX=j.clientX,this._lastY=j.clientY,ot||s(E,"display","none");var t=Q.elementFromPoint(j.clientX,j.clientY),e=t,n=st.length;if(t&&t.shadowRoot&&(e=t=t.shadowRoot.elementFromPoint(j.clientX,j.clientY)),e)do{if(e[z]){for(;n--;)st[n]({clientX:j.clientX,clientY:j.clientY,target:t,rootEl:e});break}t=e}while(e=e.parentNode);ot||s(E,"display","")}},_onTouchMove:function(e){if(U){var n=this.options,o=n.fallbackTolerance,i=n.fallbackOffset,r=e.touches?e.touches[0]:e,a=r.clientX-U.clientX+i.x,l=r.clientY-U.clientY+i.y,c=e.touches?"translate3d("+a+"px,"+l+"px,0)":"translate("+a+"px,"+l+"px)";if(!t.active){if(o&&at(rt(r.clientX-this._lastX),rt(r.clientY-this._lastY))<o)return;this._dragStarted()}this._appendGhost(),H=!0,j=r,s(E,"webkitTransform",c),s(E,"mozTransform",c),s(E,"msTransform",c),s(E,"transform",c),e.preventDefault()}},_appendGhost:function(){if(!E){var t,e=C.getBoundingClientRect(),n=s(C),o=this.options;l(E=C.cloneNode(!0),o.ghostClass,!1),l(E,o.fallbackClass,!0),l(E,o.dragClass,!0),s(E,"top",e.top-Z(n.marginTop,10)),s(E,"left",e.left-Z(n.marginLeft,10)),s(E,"width",e.width),s(E,"height",e.height),s(E,"opacity","0.8"),s(E,"position","fixed"),s(E,"zIndex","100000"),s(E,"pointerEvents","none"),o.fallbackOnBody&&Q.body.appendChild(E)||N.appendChild(E),t=E.getBoundingClientRect(),s(E,"width",2*e.width-t.width),s(E,"height",2*e.height-t.height)}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;n._offUpEvents(),L.checkPull(n,n,C,t)&&((x=D(C)).draggable=!1,x.style["will-change"]="",s(x,"display","none"),l(x,n.options.chosenClass,!1),n._cloneId=w(function(){N.insertBefore(x,C),d(n,N,"clone",C)})),l(C,i.dragClass,!0),e?("touch"===e?(r(Q,"touchmove",n._onTouchMove),r(Q,"touchend",n._onDrop),r(Q,"touchcancel",n._onDrop),i.supportPointer&&(r(Q,"pointermove",n._onTouchMove),r(Q,"pointerup",n._onDrop))):(r(Q,"mousemove",n._onTouchMove),r(Q,"mouseup",n._onDrop)),n._loopId=setInterval(n._emulateDragOver,50)):(o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,C)),r(Q,"drop",n),n._dragStartId=w(n._dragStarted))},_onDragOver:function(o){var i,r,a,l,c=this.el,d=this.options,u=d.group,g=t.active,v=L===u,m=!1,_=d.sort;if(void 0!==o.preventDefault&&(o.preventDefault(),!d.dragoverBubble&&o.stopPropagation()),!C.animated&&(H=!0,g&&!d.disabled&&(v?_||(l=!N.contains(C)):F===this||(g.lastPullMode=L.checkPull(this,g,C,o))&&u.checkPut(this,g,C,o))&&(void 0===o.rootEl||o.rootEl===this.el))){if(ct(o,d,this.el),it)return;if(i=n(o.target,d.draggable,c),r=C.getBoundingClientRect(),F!==this&&(F=this,m=!0),l)return e(g,!0),S=N,void(x||k?N.insertBefore(C,x||k):_||N.appendChild(C));if(0===c.children.length||c.children[0]===E||c===o.target&&f(c,o)){if(0!==c.children.length&&c.children[0]!==E&&c===o.target&&(i=c.lastElementChild),i){if(i.animated)return;a=i.getBoundingClientRect()}e(g,v),!1!==h(N,c,C,r,i,a,o)&&(C.contains(c)||(c.appendChild(C),S=c),this._animate(r,C),i&&this._animate(a,i))}else if(i&&!i.animated&&i!==C&&void 0!==i.parentNode[z]){O!==i&&(O=i,I=s(i),R=s(i.parentNode));var b=(a=i.getBoundingClientRect()).right-a.left,D=a.bottom-a.top,y=q.test(I.cssFloat+I.display)||"flex"==R.display&&0===R["flex-direction"].indexOf("row"),w=i.offsetWidth>C.offsetWidth,T=i.offsetHeight>C.offsetHeight,B=(y?(o.clientX-a.left)/b:(o.clientY-a.top)/D)>.5,P=i.nextElementSibling,Y=!1;if(y){var X=C.offsetTop,A=i.offsetTop;Y=X===A?i.previousElementSibling===C&&!w||B&&w:i.previousElementSibling===C||C.previousElementSibling===i?(o.clientY-a.top)/D>.5:A>X}else m||(Y=P!==C&&!T||B&&T);var M=h(N,c,C,r,i,a,o,Y);!1!==M&&(1!==M&&-1!==M||(Y=1===M),it=!0,J(p,30),e(g,v),C.contains(c)||(Y&&!P?c.appendChild(C):i.parentNode.insertBefore(C,Y?P:i)),S=C.parentNode,this._animate(r,C),this._animate(a,i))}}},_animate:function(t,e){var n=this.options.animation;if(n){var o=e.getBoundingClientRect();1===t.nodeType&&(t=t.getBoundingClientRect()),s(e,"transition","none"),s(e,"transform","translate3d("+(t.left-o.left)+"px,"+(t.top-o.top)+"px,0)"),e.offsetWidth,s(e,"transition","all "+n+"ms"),s(e,"transform","translate3d(0,0,0)"),clearTimeout(e.animated),e.animated=J(function(){s(e,"transition",""),s(e,"transform",""),e.animated=!1},n)}},_offUpEvents:function(){var t=this.el.ownerDocument;a(Q,"touchmove",this._onTouchMove),a(Q,"pointermove",this._onTouchMove),a(t,"mouseup",this._onDrop),a(t,"touchend",this._onDrop),a(t,"pointerup",this._onDrop),a(t,"touchcancel",this._onDrop),a(t,"pointercancel",this._onDrop),a(t,"selectstart",this)},_onDrop:function(e){var n=this.el,o=this.options;clearInterval(this._loopId),clearInterval(W.pid),clearTimeout(this._dragStartTimer),T(this._cloneId),T(this._dragStartId),a(Q,"mouseover",this),a(Q,"mousemove",this._onTouchMove),this.nativeDraggable&&(a(Q,"drop",this),a(n,"dragstart",this._onDragStart)),this._offUpEvents(),e&&(H&&(e.preventDefault(),!o.dropBubble&&e.stopPropagation()),E&&E.parentNode&&E.parentNode.removeChild(E),N!==S&&"clone"===t.active.lastPullMode||x&&x.parentNode&&x.parentNode.removeChild(x),C&&(this.nativeDraggable&&a(C,"dragend",this),u(C),C.style["will-change"]="",l(C,this.options.ghostClass,!1),l(C,this.options.chosenClass,!1),d(this,N,"unchoose",C,S,N,A),N!==S?(M=v(C,o.draggable))>=0&&(d(null,S,"add",C,S,N,A,M),d(this,N,"remove",C,S,N,A,M),d(null,S,"sort",C,S,N,A,M),d(this,N,"sort",C,S,N,A,M)):C.nextSibling!==k&&(M=v(C,o.draggable))>=0&&(d(this,N,"update",C,S,N,A,M),d(this,N,"sort",C,S,N,A,M)),t.active&&(null!=M&&-1!==M||(M=A),d(this,N,"end",C,S,N,A,M),this.save()))),this._nulling()},_nulling:function(){N=C=S=E=k=x=B=P=Y=U=j=H=M=O=I=F=L=t.active=null,lt.forEach(function(t){t.checked=!0}),lt.length=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragover":case"dragenter":C&&(this._onDragOver(t),i(t));break;case"mouseover":this._onDrop(t);break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],o=this.el.children,i=0,r=o.length,a=this.options;i<r;i++)n(t=o[i],a.draggable,this.el)&&e.push(t.getAttribute(a.dataIdAttr)||g(t));return e},sort:function(t){var e={},o=this.el;this.toArray().forEach(function(t,i){var r=o.children[i];n(r,this.options.draggable,o)&&(e[t]=r)},this),t.forEach(function(t){e[t]&&(o.removeChild(e[t]),o.appendChild(e[t]))})},save:function(){var t=this.options.store;t&&t.set(this)},closest:function(t,e){return n(t,e||this.options.draggable,this.el)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];n[t]=e,"group"===t&&dt(n)},destroy:function(){var t=this.el;t[z]=null,a(t,"mousedown",this._onTapStart),a(t,"touchstart",this._onTapStart),a(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(a(t,"dragover",this),a(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),st.splice(st.indexOf(this._onDragOver),1),this._onDrop(),this.el=t=null}},r(Q,"touchmove",function(e){t.active&&e.preventDefault()}),t.utils={on:r,off:a,css:s,find:c,is:function(t,e){return!!n(t,e,t)},extend:b,throttle:_,closest:n,toggleClass:l,clone:D,index:v,nextTick:w,cancelNextTick:T},t.create=function(e,n){return new t(e,n)},t.version="1.7.0",t})},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _dec,_class,_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;if(void 0!==getter)return getter.call(receiver)},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_decorator=__webpack_require__(0),_decorator2=_interopRequireDefault(_decorator),_baselayersControl=__webpack_require__(11),_managelayersControl=(_interopRequireDefault(_baselayersControl),__webpack_require__(1)),_managelayersControl2=_interopRequireDefault(_managelayersControl),BaseLayersControl=(_dec=(0,_decorator2.default)("M.control"))(_class=function(_ManageLayersControl){function BaseLayersControl(params,options){_classCallCheck(this,BaseLayersControl),M.utils.isUndefined(M.impl.control.BaseLayersControl)&&M.exception("La implementación usada no puede crear controles BaseLayersControl");var opt_={controlName:BaseLayersControl.NAME,iconClass:"g-cartografia-localizacion",tooltip:"Mapas base"};options=M.utils.extend(opt_,options,!0);var impl=new M.impl.control.BaseLayersControl,_this=_possibleConstructorReturn(this,(BaseLayersControl.__proto__||Object.getPrototypeOf(BaseLayersControl)).call(this,impl,params,options));return _this.params_=params||{},_this.map_=null,_this.baseMaps_=[],_this.mapaActivo=null,_this.activatedBlankMap=null,_this}return _inherits(BaseLayersControl,_ManageLayersControl),_createClass(BaseLayersControl,null,[{key:"NAME",get:function(){return"BaseLayers"}},{key:"TEMPLATE",get:function(){return"baselayers.html"}},{key:"BASEMAP_BLANCO",get:function(){return"base_blanco"}},{key:"IMG_BASEMAP_DEFAULT",get:function(){return"assets/img/default.png"}},{key:"IMG_BASEMAP_WHITE",get:function(){return"assets/img/osm.png"}}]),_createClass(BaseLayersControl,[{key:"addTo",value:function(map){_get(BaseLayersControl.prototype.__proto__||Object.getPrototypeOf(BaseLayersControl.prototype),"addTo",this).call(this,map),this.map_=map,this.baseMaps_=this.loadConfigInicial(),this.activatedBlankMap=!!M.utils.isNullOrEmpty(this.params_.activatedBlankMap)||this.params_.activatedBlankMap,M.utils.isNullOrEmpty(this.mapaActivo)&&this.activatedBlankMap&&(this.mapaActivo=BaseLayersControl.BASEMAP_BLANCO),this.renderPanel()}},{key:"render",value:function(){}},{key:"renderPanel",value:function(){var _this2=this,tempVars=this.getTemplateVariables_();M.template.compile(BaseLayersControl.TEMPLATE,{vars:tempVars}).then(function(html){_this2.getControlContainer_().innerHTML=html.innerHTML})}},{key:"getTemplateVariables_",value:function(){var baseLayers=this.baseMaps_,configTemplate={baseLayers:baseLayers.map(this.parseLayerForTemplate_,this)};return this.activatedBlankMap&&(configTemplate.baseMapBlanco={id:BaseLayersControl.BASEMAP_BLANCO,activo:BaseLayersControl.BASEMAP_BLANCO==this.mapaActivo}),configTemplate}},{key:"parseLayerForTemplate_",value:function(baseMap){var layer=baseMap.layer,title=layer.legend;M.utils.isNullOrEmpty(title)&&(title=layer.name),M.utils.isNullOrEmpty(title)&&(title="Mapa base");var descripcion=layer.options.descripcion;M.utils.isNullOrEmpty(descripcion)&&(descripcion="Imagen mapa base - "+title);var urlImg=baseMap.img,activo=this.mapaActivo===baseMap.id;return{id:baseMap.id,title:title,descripcion:descripcion,img:urlImg,activo:activo}}},{key:"addEvents",value:function(html){var _this3=this;html.querySelector(this.getSelectorContainer_()).addEventListener("click",function(evt){return _this3.clickBaseLayer(evt)}),this.map_.on(M.evt.CHANGE_WMC,function(){_this3.mapaActivo=null,_this3.baseMaps_=_this3.loadConfigInicial(),_this3.renderPanel()})}},{key:"clickBaseLayer",value:function(evt){evt=evt||window.event;var itemTarget=evt.target;if(!M.utils.isNullOrEmpty(itemTarget)&&itemTarget.classList.contains("m-accion-baselayers-load")){evt.stopPropagation();var id=itemTarget.getAttribute("data-id");if(!M.utils.isNullOrEmpty(id)){var activeItem=this.getControlContainer_().querySelector(".baseActivo"),activeId=activeItem?activeItem.getAttribute("id"):null;if(id!=activeId){this.getControlContainer_().querySelector("#"+id).classList.toggle("baseActivo");try{var selectMap=this.findItemByProperty(this.baseMaps_,"id",id);selectMap&&selectMap.layer&&selectMap.layer.getImpl().getOL3Layer().setVisible(!0)}catch(error){console.log(error)}try{if(activeId){activeItem.classList.toggle("baseActivo");this.findItemByProperty(this.baseMaps_,"id",activeId).layer.getImpl().getOL3Layer().setVisible(!1)}}catch(error){console.log(error)}}}}}},{key:"loadConfigInicial",value:function(){var _this4=this,baseMaps=this.params_.baseMaps,bmapLoaded=!1,loadedBaseMaps=this.map_.getBaseLayers().map(function(layer){return{img:"",layer:layer}});if(loadedBaseMaps.length){for(var i=0;i<loadedBaseMaps.length;i++)loadedBaseMaps[i].layer.isVisible()&&!bmapLoaded?(loadedBaseMaps[i].activo=!0,bmapLoaded=!0):loadedBaseMaps[i].activo=!1;var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=baseMaps[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){_step.value.activo=!1}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{!_iteratorNormalCompletion&&_iterator.return&&_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}bmapLoaded||(loadedBaseMaps[0].layer.setVisible(!0),loadedBaseMaps[0].activo=!0,bmapLoaded=!0),baseMaps=[].concat(_toConsumableArray(baseMaps),_toConsumableArray(loadedBaseMaps))}return M.utils.isNullOrEmpty(baseMaps)&&(baseMaps=[]),M.utils.isArray(baseMaps)||(baseMaps=[baseMaps]),baseMaps.map(function(itemMap,index){itemMap.layer.setZIndex(0),itemMap.id="base_"+index,!0===itemMap.activo&&M.utils.isNullOrEmpty(_this4.mapaActivo)&&(_this4.mapaActivo=itemMap.id,bmapLoaded||_this4.addLayers(itemMap.layer)),M.utils.isNullOrEmpty(itemMap.img)&&(itemMap.img=_this4.getImgLayer(itemMap.layer));var baseLayer=void 0;if(itemMap.layer instanceof M.Layer)baseLayer=itemMap.layer;else try{var parameter=M.parameter.layer(itemMap.layer);M.utils.isNullOrEmpty(parameter.type)?M.dialog.error("No se ha especificado un tipo válido para la capa"):baseLayer=new M.layer[parameter.type](itemMap.layer)}catch(err){M.dialog.error("El formato de la capa ("+itemMap.layer+") no se reconoce")}return M.utils.isNullOrEmpty(baseLayer.id)&&(baseLayer.id=itemMap.id),baseLayer.isbaseLayer=!0,baseLayer.transparent=!1,M.utils.isUndefined(baseLayer.options)&&(baseLayer.options={}),baseLayer.options.queryable=!1,itemMap.layer=baseLayer,itemMap})}},{key:"equals",value:function(obj){var equals=!1;return obj instanceof BaseLayersControl&&(equals=this.name===obj.name),equals}},{key:"getImgLayer",value:function(layer){if(layer.type===M.layer.type.WMS){var legend=layer.getLegendURL();return legend||layer.url+(layer.url.indexOf("?")>-1?"&":"?")+"service=WMS&request=GetMap&layers="+layer.name+"&bbox="+this.map_.getMaxExtent()+"&width=200&height=120&version=1.1.1&srs="+this.map_.getProjection().code+"&format=image/png"}return BaseLayersControl.IMG_BASEMAP_DEFAULT}}]),BaseLayersControl}(_managelayersControl2.default))||_class;exports.default=BaseLayersControl},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.BaseLayersControl=void 0;var _dec,_class,_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_decorator=__webpack_require__(0),_decorator2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_decorator);exports.BaseLayersControl=(_dec=(0,_decorator2.default)("M.impl.control"))(_class=function(_M$impl$Control){function BaseLayersControl(params){_classCallCheck(this,BaseLayersControl);var _this=_possibleConstructorReturn(this,(BaseLayersControl.__proto__||Object.getPrototypeOf(BaseLayersControl)).call(this));return _this.params_=params||{},_this.facadeMap_=null,_this}return _inherits(BaseLayersControl,_M$impl$Control),_createClass(BaseLayersControl,[{key:"addTo",value:function(map,element){this.facadeMap_=map,this.element=element;var olMap=map.getMapImpl();ol.control.Control.call(this,{element:element,target:null}),olMap.addControl(this)}},{key:"destroy",value:function(){this.deactivate(),this.element.remove(),this.facadeMap_.getMapImpl().removeControl(this),this.facadeMap_=null,this.element=null}}]),BaseLayersControl}(M.impl.Control))||_class},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _dec,_class,_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_decorator=__webpack_require__(0),_decorator2=_interopRequireDefault(_decorator),_managelayersControl=__webpack_require__(1),_managelayersControl2=_interopRequireDefault(_managelayersControl),ThematicLayersControl=(_dec=(0,_decorator2.default)("M.control"))(_class=function(_ManageLayersControl){function ThematicLayersControl(params,options){_classCallCheck(this,ThematicLayersControl);var impl=new M.impl.control.ManageLayersControl(params),opt_={controlName:ThematicLayersControl.NAME,iconClass:"g-cartografia-medir-area",tooltip:"Capas temáticas"};options=M.utils.extend(opt_,options,!0);var _this=_possibleConstructorReturn(this,(ThematicLayersControl.__proto__||Object.getPrototypeOf(ThematicLayersControl)).call(this,impl,params,options));return _this.params_=params||{},_this.thematicLayers_=[],_this.loadConfigInicial(),_this}return _inherits(ThematicLayersControl,_ManageLayersControl),_createClass(ThematicLayersControl,null,[{key:"NAME",get:function(){return"ThematicLayers"}},{key:"TEMPLATE",get:function(){return"thematiclayers.html"}}]),_createClass(ThematicLayersControl,[{key:"equals",value:function(obj){var equals=!1;return obj instanceof ThematicLayersControl&&(equals=this.name===obj.name),equals}},{key:"render",value:function(){this.renderPanel()}},{key:"renderPanel",value:function(){var _this2=this;M.template.compile(ThematicLayersControl.TEMPLATE,{vars:this.getTemplateVariables_()}).then(function(html){_this2.getControlContainer_().innerHTML=html.innerHTML})}},{key:"addEvents",value:function(html){var _this3=this;html.querySelector(this.getSelectorContainer_()).addEventListener("click",function(evt){return _this3.clickThematicLayer(evt)})}},{key:"getTemplateVariables_",value:function(){return{groups:this.params_.groups.map(this.parseGroupForTemplate_,this)}}},{key:"parseGroupForTemplate_",value:function(group,index){var configToc=this.getOptionsControlManageLayers(group);return M.utils.isNullOrEmpty(configToc)&&(configToc={index:index,collapsed:!0,activated:!1},this.setOptionsControlManageLayers(group,configToc)),{id:group.id,title:group.title,collapsed:!0===configToc.collapsed,overlays:group.overlays.map(this.parseLayerForTemplate_,this),activated:!0===configToc.activated}}},{key:"parseLayerForTemplate_",value:function(layer,index){var layerTitle=layer.legend;return M.utils.isNullOrEmpty(layerTitle)&&(layerTitle=layer.name),M.utils.isNullOrEmpty(layerTitle)&&(layerTitle="Servicio WMS"),{id:layer.id,name:layer.name,title:layerTitle,load:!0===this.isLoadLayer(layer)}}},{key:"clickThematicLayer",value:function(evt){if(evt=evt||window.event,!M.utils.isNullOrEmpty(evt.target)){var itemTarget=evt.target,id=itemTarget.getAttribute("data-id");if(!M.utils.isNullOrEmpty(id)){evt.stopPropagation();var ctolContainer=this.getControlContainer_(),itemTocOptions=this.getQuerySelectorScapeCSS(ctolContainer,"#optionsTocGroup_",id);if(itemTarget.classList.contains("m-accion-thematiclayers-collapse")){var group=this.findItemByProperty(this.params_.groups,"id",id);this.getOptionsControlManageLayers(group).collapsed=!itemTocOptions.classList.contains("dNone"),itemTarget.classList.toggle("g-cartografia-flecha-abajo2"),itemTarget.classList.toggle("g-cartografia-flecha-arriba2"),itemTocOptions.classList.toggle("dNone")}else if(itemTarget.classList.contains("m-accion-thematiclayers-load-group")){var selectorItems=itemTarget.classList.contains("g-cartografia-mas2")?"input[type=checkbox]:not(:checked)":"input[type=checkbox]:checked",itemsSelect=itemTocOptions.querySelectorAll(selectorItems);itemsSelect.forEach(function(item,index){item.click()}),itemTarget.classList.toggle("g-cartografia-mas2"),itemTarget.classList.toggle("g-cartografia-cancelar2"),itemTarget.title=itemTarget.classList.contains("g-cartografia-mas2")?"Añadir todas las capas del grupo":"Eliminar todas las capas del grupo";var _group=this.findItemByProperty(this.params_.groups,"id",id),_configToc=this.getOptionsControlManageLayers(_group);_configToc.activated=!itemTarget.classList.contains("g-cartografia-mas2")}else if(itemTarget.classList.contains("m-accion-thematiclayers-load")){var layer=this.findItemByProperty(this.thematicLayers_,"id",id),isLoad=!itemTarget.checked;!0===isLoad?this.removeLayers(layer):this.addLayers(layer)}}}}},{key:"loadConfigInicial",value:function(){var _this4=this,groups=this.params_.groups;M.utils.isNullOrEmpty(groups)&&(groups=[]),M.utils.isArray(groups)||(groups=[groups]),groups.forEach(function(group,index){M.utils.isNullOrEmpty(group.id)&&(group.id="grp_thematic_"+index,group.index=index),M.utils.isNullOrEmpty(group.options)&&(group.options={}),M.utils.isNullOrEmpty(group.title)&&(group.title="Grupo - "+index),M.utils.isNullOrEmpty(group.overlays)&&(group.overlays=[]),group.overlays=_this4.loadConfigOverlays(group,group.overlays),_this4.thematicLayers_=_this4.thematicLayers_.concat(group.overlays)},this),this.params_.groups=groups}},{key:"loadConfigOverlays",value:function(group,overlaysParam){return M.utils.isArray(overlaysParam)||(overlaysParam=[overlaysParam]),overlaysParam.map(function(item,index){var overlay=void 0;if(item instanceof M.Layer)overlay=item;else try{var parameter=M.parameter.layer(item);M.utils.isNullOrEmpty(parameter.type)?M.dialog.error("No se ha especificado un tipo válido para la capa"):overlay=new M.layer[parameter.type](item)}catch(err){M.dialog.error("El formato de la capa ("+item+") no se reconoce")}return M.utils.isNullOrEmpty(overlay.options)&&(overlay.options={}),overlay.options.isTematica=!0,overlay.options.origen="Tematica",M.utils.isNullOrEmpty(overlay.id)&&(overlay.id="thematic_"+group.index+"_"+index),overlay})}}]),ThematicLayersControl}(_managelayersControl2.default))||_class;exports.default=ThematicLayersControl},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _dec,_class,_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;if(void 0!==getter)return getter.call(receiver)},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_decorator=__webpack_require__(0),_decorator2=_interopRequireDefault(_decorator),_managelayersControl=__webpack_require__(1),_managelayersControl2=_interopRequireDefault(_managelayersControl),WMCLayersControl=(_dec=(0,_decorator2.default)("M.control"))(_class=function(_ManageLayersControl){function WMCLayersControl(params,options){_classCallCheck(this,WMCLayersControl);var impl=new M.impl.control.ManageLayersControl(params),opt_={controlName:WMCLayersControl.NAME,iconClass:"g-cartografia-capas",tooltip:"Capas WMC"};options=M.utils.extend(opt_,options,!0);var _this=_possibleConstructorReturn(this,(WMCLayersControl.__proto__||Object.getPrototypeOf(WMCLayersControl)).call(this,impl,params,options));return _this.params_=params||{},_this}return _inherits(WMCLayersControl,_ManageLayersControl),_createClass(WMCLayersControl,null,[{key:"NAME",get:function(){return"WMCLayers"}},{key:"TEMPLATE",get:function(){return"wmclayers.html"}}]),_createClass(WMCLayersControl,[{key:"addTo",value:function(map){var _this2=this;_get(WMCLayersControl.prototype.__proto__||Object.getPrototypeOf(WMCLayersControl.prototype),"addTo",this).call(this,map),this.wmc_=this.getWMCSelected(),this.render(),this.map_.on(M.evt.CHANGE_WMC,function(wmc){_this2.wmc_=_this2.getWMCSelected(),_this2.render()},this)}},{key:"getWMCSelected",value:function(){var lstWMC=this.map_.getWMC().filter(function(wmcLayer){return 1==wmcLayer.selected}),wmc=lstWMC?lstWMC[0]:null;return wmc&&wmc.layers.forEach(function(layer,index){M.utils.isNullOrEmpty(layer.id)&&(layer.id="WMC_"+index)}),wmc}},{key:"render",value:function(){this.renderPanel()}},{key:"renderPanel",value:function(){var _this3=this;M.template.compile(WMCLayersControl.TEMPLATE,{vars:this.getTemplateVariables_()}).then(function(html){_this3.getControlContainer_().innerHTML=html.innerHTML})}},{key:"addEvents",value:function(html){var _this4=this;html.querySelector(this.getSelectorContainer_()).addEventListener("click",function(evt){return _this4.clickWmcLayer(evt)})}},{key:"getTemplateVariables_",value:function(){if(M.utils.isNullOrEmpty(this.wmc_))return{name:"",wmcLayers:[]};var wmcLayers=this.wmc_.layers.filter(function(layer){var isNotWMC=layer.type!==M.layer.type.WMC,isNotWMSFull=!(layer.type===M.layer.type.WMS&&M.utils.isNullOrEmpty(layer.name));return isNotWMC&&isNotWMSFull&&!0});return{name:this.wmc_.name,wmcLayers:wmcLayers.map(this.parseLayerForTemplate_,this)}}},{key:"parseLayerForTemplate_",value:function(layer){var layerTitle=layer.legend;return M.utils.isNullOrEmpty(layerTitle)&&(layerTitle=layer.name),M.utils.isNullOrEmpty(layerTitle)&&(layerTitle="Servicio WMS"),M.utils.isNullOrEmpty(layer.options)&&(layer.options={}),M.utils.isNullOrEmpty(layer.options.origen)&&(layer.options.isWMC=!0,layer.options.origen="WMC"),{id:layer.id,name:layer.name,title:layerTitle,load:!0===this.isLoadLayer(layer)}}},{key:"clickWmcLayer",value:function(evt){evt=evt||window.event;var itemTarget=evt.target;if(!M.utils.isNullOrEmpty(itemTarget))if(itemTarget.classList.contains("m-accion-wmclayers-load-group")){evt.stopPropagation();var selectorItems=itemTarget.classList.contains("g-cartografia-mas2")?"input[type=checkbox]:not(:checked)":"input[type=checkbox]:checked",itemsSelect=this.getControlContainer_().querySelectorAll(selectorItems);itemsSelect.forEach(function(item,index){item.click()}),itemTarget.classList.toggle("g-cartografia-mas2"),itemTarget.classList.toggle("g-cartografia-cancelar2"),itemTarget.title=itemTarget.classList.contains("g-cartografia-mas2")?"Añadir todas las capas":"Eliminar todas las capas"}else{var id=itemTarget.getAttribute("data-id");if(!M.utils.isNullOrEmpty(id)){evt.stopPropagation();var layer=this.findItemByProperty(this.wmc_.layers,"id",id);if(itemTarget.classList.contains("m-accion-wmclayers-load")){var isLoad=this.isLoadLayer(layer);!0===isLoad?(this.removeLayers(layer),this.resetOptionsManageLayers(layer)):this.addLayers(layer)}}}}},{key:"equals",value:function(obj){var equals=!1;return obj instanceof WMCLayersControl&&(equals=this.name===obj.name),equals}}]),WMCLayersControl}(_managelayersControl2.default))||_class;exports.default=WMCLayersControl},function(module,exports){}]),M.template.add("wmclayers.html",Handlebars.template({1:function(container,depth0,helpers,partials,data){var stack1,helper,alias1=null!=depth0?depth0:container.nullContext||{},alias2=helpers.helperMissing,alias4=container.escapeExpression;return'\t\t<div class="toc-item-group-header">\r\n\t\t\t<div class="layer-group-name">\r\n\t\t\t\t<span>Capas WMC: '+alias4((helper=null!=(helper=helpers.name||(null!=depth0?depth0.name:depth0))?helper:alias2,"function"==typeof helper?helper.call(alias1,{name:"name",hash:{},data:data}):helper))+'</span>\r\n\t\t\t</div>\r\n\t\t\t<div class="layer-group-button">\r\n\t\t\t\t\x3c!-- <button data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,"function"==typeof helper?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="m-accion-thematiclayers-load-group '+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.activated:depth0,{name:"if",hash:{},fn:container.program(2,data,0),inverse:container.program(4,data,0),data:data}))?stack1:"")+'"\r\n\t\t\t\t title="'+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.activated:depth0,{name:"if",hash:{},fn:container.program(6,data,0),inverse:container.program(8,data,0),data:data}))?stack1:"")+'"></button> --\x3e\r\n\t\t\t\t<button class="m-accion-wmclayers-load-group g-cartografia-mas2" title="Añadir todas las capas"></button>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t\x3c!-- <div class="title">\r\n\t\t\t<span>Capas WMC: '+alias4((helper=null!=(helper=helpers.name||(null!=depth0?depth0.name:depth0))?helper:alias2,"function"==typeof helper?helper.call(alias1,{name:"name",hash:{},data:data}):helper))+'</span>\r\n\t\t\t<button class="m-accion-wmclayers-load-group g-cartografia-mas2" title="Añadir todas las capas"></button>\r\n\t\t</div> --\x3e\r\n'+(null!=(stack1=helpers.each.call(alias1,null!=depth0?depth0.wmcLayers:depth0,{name:"each",hash:{},fn:container.program(10,data,0),inverse:container.noop,data:data}))?stack1:"")+" "},2:function(container,depth0,helpers,partials,data){return"g-cartografia-cancelar2"},4:function(container,depth0,helpers,partials,data){return"g-cartografia-mas2"},6:function(container,depth0,helpers,partials,data){return"Eliminar todas las capas del grupo"},8:function(container,depth0,helpers,partials,data){return"Añadir todas las capas del grupo"},10:function(container,depth0,helpers,partials,data){var stack1,helper,alias1=null!=depth0?depth0:container.nullContext||{},alias2=helpers.helperMissing,alias3="function",alias4=container.escapeExpression;return'\t\t<div id="wmclayer_'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="toc-item-layer">\r\n\t\t\t<input id="'+alias4((helper=null!=(helper=helpers.index||data&&data.index)?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"index",hash:{},data:data}):helper))+"-"+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="m-accion-wmclayers-load" type="checkbox" data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" value="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" '+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.load:depth0,{name:"if",hash:{},fn:container.program(11,data,0),inverse:container.noop,data:data}))?stack1:"")+'\r\n\t\t\t title="Añadir/Eliminar capa">\r\n\t\t\t<label for="'+alias4((helper=null!=(helper=helpers.index||data&&data.index)?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"index",hash:{},data:data}):helper))+"-"+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'">'+alias4((helper=null!=(helper=helpers.title||(null!=depth0?depth0.title:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"title",hash:{},data:data}):helper))+"</label>\r\n\t\t</div>\r\n\t\t"},11:function(container,depth0,helpers,partials,data){return"checked"},13:function(container,depth0,helpers,partials,data){return'\r\n\t\t<div class="info">\r\n\t\t\t<span>No se ha añadido ninguna capa WMC</span>\r\n\t\t</div>\r\n'},compiler:[7,">= 4.0.0"],main:function(container,depth0,helpers,partials,data){var stack1;return'<div id="tool-wmclayers">\r\n\t<div id="toc-wmclayers" class="m-toc-wmclayers">\r\n'+(null!=(stack1=(helpers.gt||depth0&&depth0.gt||helpers.helperMissing).call(null!=depth0?depth0:container.nullContext||{},null!=(stack1=null!=depth0?depth0.wmcLayers:depth0)?stack1.length:stack1,0,{name:"gt",hash:{},fn:container.program(1,data,0),inverse:container.program(13,data,0),data:data}))?stack1:"")+"\t</div>\r\n</div>"},useData:!0})),M.template.add("thematiclayers.html",Handlebars.template({1:function(container,depth0,helpers,partials,data){var stack1;return" "+(null!=(stack1=helpers.each.call(null!=depth0?depth0:container.nullContext||{},null!=depth0?depth0.groups:depth0,{name:"each",hash:{},fn:container.program(2,data,0),inverse:container.noop,data:data}))?stack1:"")+" "},2:function(container,depth0,helpers,partials,data){var stack1,helper,alias1=null!=depth0?depth0:container.nullContext||{},alias2=helpers.helperMissing,alias3="function",alias4=container.escapeExpression;return'\r\n\t\t<div id="tocGroup_'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="toc-item-group">\r\n\t\t\t<div class="toc-item-group-header">\r\n\t\t\t\t<div class="layer-group-name">\r\n\t\t\t\t\t<button data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="m-accion-thematiclayers-collapse '+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.collapsed:depth0,{name:"if",hash:{},fn:container.program(3,data,0),inverse:container.program(5,data,0),data:data}))?stack1:"")+'"\r\n\t\t\t\t\t title="Lista de capas"></button>\r\n\t\t\t\t\t<span>'+alias4((helper=null!=(helper=helpers.title||(null!=depth0?depth0.title:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"title",hash:{},data:data}):helper))+'</span>\r\n\t\t\t\t</div>\r\n\t\t\t\t\x3c!-- <div class="layer-group-button">\r\n\t\t\t\t\t<button data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="m-accion-thematiclayers-load-group '+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.activated:depth0,{name:"if",hash:{},fn:container.program(7,data,0),inverse:container.program(9,data,0),data:data}))?stack1:"")+'"\r\n\t\t\t\t\t title="'+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.activated:depth0,{name:"if",hash:{},fn:container.program(11,data,0),inverse:container.program(13,data,0),data:data}))?stack1:"")+'"></button>\r\n\t\t\t\t</div> --\x3e\r\n\t\t\t</div>\r\n\t\t\t<div id="optionsTocGroup_'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="toc-item-group-options'+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.collapsed:depth0,{name:"if",hash:{},fn:container.program(15,data,0),inverse:container.noop,data:data}))?stack1:"")+'">\r\n\t\t\t\t'+(null!=(stack1=(helpers.gt||depth0&&depth0.gt||alias2).call(alias1,null!=(stack1=null!=depth0?depth0.overlays:depth0)?stack1.length:stack1,0,{name:"gt",hash:{},fn:container.program(17,data,0),inverse:container.noop,data:data}))?stack1:"")+"\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t"},3:function(container,depth0,helpers,partials,data){return"g-cartografia-flecha-abajo2"},5:function(container,depth0,helpers,partials,data){return"g-cartografia-flecha-arriba2"},7:function(container,depth0,helpers,partials,data){return"g-cartografia-cancelar2"},9:function(container,depth0,helpers,partials,data){return"g-cartografia-mas2"},11:function(container,depth0,helpers,partials,data){return"Eliminar todas las capas del grupo"},13:function(container,depth0,helpers,partials,data){return"Añadir todas las capas del grupo"},15:function(container,depth0,helpers,partials,data){return" dNone"},17:function(container,depth0,helpers,partials,data){var stack1;return" "+(null!=(stack1=helpers.each.call(null!=depth0?depth0:container.nullContext||{},null!=depth0?depth0.overlays:depth0,{name:"each",hash:{},fn:container.program(18,data,0),inverse:container.noop,data:data}))?stack1:"")+" "},18:function(container,depth0,helpers,partials,data){var stack1,helper,alias1=null!=depth0?depth0:container.nullContext||{},alias2=helpers.helperMissing,alias3="function",alias4=container.escapeExpression;return'\r\n\t\t\t\t<div class="toc-item-group-overlay">\r\n\t\t\t\t\t<input id="'+alias4((helper=null!=(helper=helpers.index||data&&data.index)?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"index",hash:{},data:data}):helper))+"-"+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="m-accion-thematiclayers-load" type="checkbox" data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" value="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" title="Añadir/Eliminar capa"\r\n\t\t\t\t\t '+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.load:depth0,{name:"if",hash:{},fn:container.program(19,data,0),inverse:container.noop,data:data}))?stack1:"")+'>\r\n\t\t\t\t\t<label for="'+alias4((helper=null!=(helper=helpers.index||data&&data.index)?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"index",hash:{},data:data}):helper))+"-"+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'">'+alias4((helper=null!=(helper=helpers.title||(null!=depth0?depth0.title:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"title",hash:{},data:data}):helper))+"</label>\r\n\t\t\t\t</div>\r\n\t\t\t\t"},19:function(container,depth0,helpers,partials,data){return"checked"},compiler:[7,">= 4.0.0"],main:function(container,depth0,helpers,partials,data){var stack1;return'<div id="tool-thematiclayers">\r\n\t<div id="toc-thematiclayers" class="m-toc-thematiclayers">\r\n\t\t'+(null!=(stack1=(helpers.gt||depth0&&depth0.gt||helpers.helperMissing).call(null!=depth0?depth0:container.nullContext||{},null!=(stack1=null!=depth0?depth0.groups:depth0)?stack1.length:stack1,0,{name:"gt",hash:{},fn:container.program(1,data,0),inverse:container.noop,data:data}))?stack1:"")+"\r\n\t</div>\r\n</div>"},useData:!0})),M.template.add("template_managelayers_toolbar.html",Handlebars.template({compiler:[7,">= 4.0.0"],main:function(container,depth0,helpers,partials,data){return'<div id="toolbar-managelayers" class="m-control m-toolbar m-control-toolbar-managelayers">\r\n\t\x3c!-- TOOLBARS BUTTONS --\x3e\r\n\t<div id="toolbar-buttons-managelayers" class="m-toolbar-buttons m-toolbar-buttons-managelayers"></div>\r\n\t\x3c!-- TITLE --\x3e\r\n\t<div id="toolbar-title-managelayers" class="title">Gestión de capas</div>\r\n\r\n\t<div id="toolbar-containers-managelayers" class="m-toolbar-containers m-toolbar-containers-managelayers">\r\n\t\t<div id="m-waiting-result" class="dNone m-waiting-result g-cartografia-spinner"></div>\r\n\t</div>\r\n</div>'},useData:!0})),M.template.add("template_managelayers_control.html",Handlebars.template({compiler:[7,">= 4.0.0"],main:function(container,depth0,helpers,partials,data){var helper,alias1=null!=depth0?depth0:container.nullContext||{},alias2=helpers.helperMissing,alias3="function",alias4=container.escapeExpression;return'<div class="m-control m-managelayers-'+alias4((helper=null!=(helper=helpers.baseName||(null!=depth0?depth0.baseName:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"baseName",hash:{},data:data}):helper))+'">\r\n\t<div id="toolbar-button-'+alias4((helper=null!=(helper=helpers.baseName||(null!=depth0?depth0.baseName:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"baseName",hash:{},data:data}):helper))+'" class="m-toolbar-button m-toolbar-button-'+alias4((helper=null!=(helper=helpers.baseName||(null!=depth0?depth0.baseName:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"baseName",hash:{},data:data}):helper))+'">\r\n\t\t<button id="tool-btn-'+alias4((helper=null!=(helper=helpers.baseName||(null!=depth0?depth0.baseName:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"baseName",hash:{},data:data}):helper))+'" class="m-tool-button '+alias4((helper=null!=(helper=helpers.iconClass||(null!=depth0?depth0.iconClass:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"iconClass",hash:{},data:data}):helper))+'" title="'+alias4((helper=null!=(helper=helpers.tooltip||(null!=depth0?depth0.tooltip:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"tooltip",hash:{},data:data}):helper))+'"></button>\r\n\t</div>\r\n\t<div id="toolbar-container-'+alias4((helper=null!=(helper=helpers.baseName||(null!=depth0?depth0.baseName:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"baseName",hash:{},data:data}):helper))+'" class="m-toolbar-container m-toolbar-container-'+alias4((helper=null!=(helper=helpers.baseName||(null!=depth0?depth0.baseName:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"baseName",hash:{},data:data}):helper))+' dNone" title="">\r\n\t\t<div id="tool-'+alias4((helper=null!=(helper=helpers.baseName||(null!=depth0?depth0.baseName:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"baseName",hash:{},data:data}):helper))+'" class="m-tool-container m-tool-container-'+alias4((helper=null!=(helper=helpers.baseName||(null!=depth0?depth0.baseName:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"baseName",hash:{},data:data}):helper))+'">\r\n\t\t</div>\r\n\t</div>\r\n</div>'},useData:!0})),M.template.add("managelayers.html",Handlebars.template({compiler:[7,">= 4.0.0"],main:function(container,depth0,helpers,partials,data){return'<div class="m-managelayers">\r\n   <button id="m-managelayerscontrol-button">Show message</button>\r\n</div>\r\n'},useData:!0})),M.template.add("baselayers.html",Handlebars.template({1:function(container,depth0,helpers,partials,data){var stack1,alias1=container.lambda,alias2=container.escapeExpression;return'\t\t<div id="'+alias2(alias1(null!=(stack1=null!=depth0?depth0.baseMapBlanco:depth0)?stack1.id:stack1,depth0))+'" data-id="'+alias2(alias1(null!=(stack1=null!=depth0?depth0.baseMapBlanco:depth0)?stack1.id:stack1,depth0))+'" class="box m-accion-baselayers-load '+(null!=(stack1=helpers.if.call(null!=depth0?depth0:container.nullContext||{},null!=depth0?depth0.activo:depth0,{name:"if",hash:{},fn:container.program(2,data,0),inverse:container.noop,data:data}))?stack1:"")+'">\r\n\t\t\t<img data-id="'+alias2(alias1(null!=(stack1=null!=depth0?depth0.baseMapBlanco:depth0)?stack1.id:stack1,depth0))+'" class="m-accion-baselayers-load">\r\n\t\t\t<div class="caption simple-caption">\r\n\t\t\t\t<h5 data-id="'+alias2(alias1(null!=(stack1=null!=depth0?depth0.baseMapBlanco:depth0)?stack1.id:stack1,depth0))+'" class="m-accion-baselayers-load">Fondo Blanco</h5>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t'},2:function(container,depth0,helpers,partials,data){return" baseActivo"},4:function(container,depth0,helpers,partials,data){var stack1;return" "+(null!=(stack1=helpers.each.call(null!=depth0?depth0:container.nullContext||{},null!=depth0?depth0.baseLayers:depth0,{name:"each",hash:{},fn:container.program(5,data,0),inverse:container.noop,data:data}))?stack1:"")+" "},5:function(container,depth0,helpers,partials,data){var stack1,helper,alias1=null!=depth0?depth0:container.nullContext||{},alias2=helpers.helperMissing,alias3="function",alias4=container.escapeExpression;return'\r\n\t\t<div id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="box'+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.activo:depth0,{name:"if",hash:{},fn:container.program(2,data,0),inverse:container.noop,data:data}))?stack1:"")+'">\r\n\t\t\t<img data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="m-accion-baselayers-load" src="'+alias4((helper=null!=(helper=helpers.img||(null!=depth0?depth0.img:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"img",hash:{},data:data}):helper))+'" alt="'+alias4((helper=null!=(helper=helpers.descripcion||(null!=depth0?depth0.descripcion:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"descripcion",hash:{},data:data}):helper))+'">\r\n\t\t\t<div class="caption simple-caption">\r\n\t\t\t\t<h5 data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="m-accion-baselayers-load">'+alias4((helper=null!=(helper=helpers.title||(null!=depth0?depth0.title:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"title",hash:{},data:data}):helper))+"</h5>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t"},compiler:[7,">= 4.0.0"],main:function(container,depth0,helpers,partials,data){var stack1,alias1=null!=depth0?depth0:container.nullContext||{};return'<div id="tool-baselayers">\r\n\t<div id="toc-baselayers" class="m-toc-baselayers">\r\n'+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.baseMapBlanco:depth0,{name:"if",hash:{},fn:container.program(1,data,0),inverse:container.noop,data:data}))?stack1:"")+" "+(null!=(stack1=(helpers.gt||depth0&&depth0.gt||helpers.helperMissing).call(alias1,null!=(stack1=null!=depth0?depth0.baseLayers:depth0)?stack1.length:stack1,0,{name:"gt",hash:{},fn:container.program(4,data,0),inverse:container.noop,data:data}))?stack1:"")+"\r\n\t</div>\r\n</div>"},useData:!0})),M.template.add("activelayers.html",Handlebars.template({1:function(container,depth0,helpers,partials,data){var stack1,helper,alias1=null!=depth0?depth0:container.nullContext||{},alias2=helpers.helperMissing,alias3="function",alias4=container.escapeExpression;return'\t\t<div id="tocLayer_'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="toc-item-layer">\r\n\t\t\t<div id="titleTocLayer_'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="toc-item-layer-header '+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.outOfRange:depth0,{name:"if",hash:{},fn:container.program(2,data,0),inverse:container.noop,data:data}))?stack1:"")+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.visible:depth0,{name:"if",hash:{},fn:container.program(4,data,0),inverse:container.noop,data:data}))?stack1:"")+'">\r\n\t\t\t\t<div class="m-area-accion-activelayers-collapse">\r\n\t\t\t\t\t<button data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="m-accion-activelayers-collapse '+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.collapsed:depth0,{name:"if",hash:{},fn:container.program(6,data,0),inverse:container.program(8,data,0),data:data}))?stack1:"")+'"\r\n\t\t\t\t\t title="Opciones de capa"></button>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class="m-area-title">\r\n\t\t\t\t\t<div id="textTitleLayer_'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" title="'+alias4((helper=null!=(helper=helpers.title||(null!=depth0?depth0.title:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"title",hash:{},data:data}):helper))+'" class="m-title">'+alias4((helper=null!=(helper=helpers.title||(null!=depth0?depth0.title:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"title",hash:{},data:data}):helper))+"</div>\r\n"+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.canEditName:depth0,{name:"if",hash:{},fn:container.program(10,data,0),inverse:container.noop,data:data}))?stack1:"")+'\t\t\t\t</div>\r\n\t\t\t\t<div class="m-area-activate" title="Activar/Desactivar capa">\r\n\t\t\t\t\t<input type="checkbox" data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="m-accion-activelayers-activate" '+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.visible:depth0,{name:"if",hash:{},fn:container.program(12,data,0),inverse:container.noop,data:data}))?stack1:"")+'> </input>\r\n\t\t\t\t\t </div> <div class="m-area-origin">\r\n\t\t\t\t\t<span>'+alias4((helper=null!=(helper=helpers.origen||(null!=depth0?depth0.origen:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"origen",hash:{},data:data}):helper))+'</span>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class="m-area-order-hook" title="Orden de capas">\r\n\t\t\t\t\t<div class="m-accion-activelayers-order">\r\n\t\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">\r\n\t\t\t\t\t\t\t<path d="M25 0c-.254 0-.523.086-.719.281l-7 7a1.005 1.005 0 0 0-.218 1.094c.156.371.535.625.937.625h14.031c.551 0 1-.45 1-1a1.01 1.01 0 0 0-.437-.813L25.719.282A1.015 1.015 0 0 0 25 0zM2 13v4h46v-4zm0 10v4h46v-4zm0 10v4h46v-4zm16 8c-.402 0-.781.25-.938.625-.156.375-.066.809.22 1.094l7 7c.195.195.46.281.718.281.258 0 .523-.086.719-.281l7-7c.285-.285.375-.719.218-1.094A1.023 1.023 0 0 0 32 41z" />\r\n\t\t\t\t\t\t</svg>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div id="optionsTocLayer_'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="toc-item-layer-options'+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.collapsed:depth0,{name:"if",hash:{},fn:container.program(14,data,0),inverse:container.noop,data:data}))?stack1:"")+'">\r\n\t\t\t\t<div class="layer-option-row">\r\n\t\t\t\t\t<div class="transparency-control">\r\n\t\t\t\t\t\t<input type="range" data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" title="Nivel de transparencia" class="m-accion-activelayers-transparency"\r\n\t\t\t\t\t\t min="0" max="1" step="0.1" value="'+alias4((helper=null!=(helper=helpers.opacity||(null!=depth0?depth0.opacity:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"opacity",hash:{},data:data}):helper))+'" '+(null!=(stack1=helpers.unless.call(alias1,null!=depth0?depth0.visible:depth0,{name:"unless",hash:{},fn:container.program(16,data,0),inverse:container.noop,data:data}))?stack1:"")+" "+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.outOfRange:depth0,{name:"if",hash:{},fn:container.program(18,data,0),inverse:container.noop,data:data}))?stack1:"")+'/> <span class="transparency-percentage">'+alias4((helper=null!=(helper=helpers.opacityPer||(null!=depth0?depth0.opacityPer:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"opacityPer",hash:{},data:data}):helper))+"%</span>\r\n\t\t\t\t\t</div>\r\n"+(null!=(stack1=(helpers.gt||depth0&&depth0.gt||alias2).call(alias1,null!=(stack1=null!=depth0?depth0.styles:depth0)?stack1.length:stack1,1,{name:"gt",hash:{},fn:container.program(20,data,0),inverse:container.noop,data:data}))?stack1:"")+" "+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.metadata:depth0,{name:"if",hash:{},fn:container.program(22,data,0),inverse:container.noop,data:data}))?stack1:"")+" "+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.infoLayer:depth0,{name:"if",hash:{},fn:container.program(24,data,0),inverse:container.noop,data:data}))?stack1:"")+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.canRemove:depth0,{name:"if",hash:{},fn:container.program(26,data,0),inverse:container.noop,data:data}))?stack1:"")+'\t\t\t\t</div>\r\n\t\t\t\t<div class="layer-option-row">\r\n\t\t\t\t\t<div class="legend">\r\n\t\t\t\t\t\t<h3>Leyenda</h3>\r\n\t\t\t\t\t\t<img data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" src="'+alias4((helper=null!=(helper=helpers.legend||(null!=depth0?depth0.legend:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"legend",hash:{},data:data}):helper))+'"></img>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div class="layer-option-row">\r\n\t\t\t\t\t<div id="stylesTocLayer_'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="'+(null!=(stack1=helpers.unless.call(alias1,null!=depth0?depth0.showStyles:depth0,{name:"unless",hash:{},fn:container.program(28,data,0),inverse:container.noop,data:data}))?stack1:"")+'">\r\n\t\t\t\t\t\t<h3>Estilos de capa</h3>\r\n'+(null!=(stack1=helpers.each.call(alias1,null!=depth0?depth0.styles:depth0,{name:"each",hash:{},fn:container.program(30,data,0),inverse:container.noop,data:data}))?stack1:"")+"\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t</div>\r\n\t\t</div>\r\n"},2:function(container,depth0,helpers,partials,data){return"out-of-range"},4:function(container,depth0,helpers,partials,data){return" visible"},6:function(container,depth0,helpers,partials,data){return"g-cartografia-flecha-abajo2"},8:function(container,depth0,helpers,partials,data){return"g-cartografia-flecha-arriba2"},10:function(container,depth0,helpers,partials,data){var helper;return'\t\t\t\t\t<div class="m-button">\r\n\t\t\t\t\t\t<button data-id="'+container.escapeExpression((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:helpers.helperMissing,"function"==typeof helper?helper.call(null!=depth0?depth0:container.nullContext||{},{name:"id",hash:{},data:data}):helper))+'" class="m-accion-activelayers-rename g-cartografia-editar" title="Cambiar nombre"></button>\r\n\t\t\t\t\t</div>\r\n'},12:function(container,depth0,helpers,partials,data){return" checked"},14:function(container,depth0,helpers,partials,data){return" dNone"},16:function(container,depth0,helpers,partials,data){return" disabled "},18:function(container,depth0,helpers,partials,data){return"\r\n\t\t\t\t\t\t disabled"},20:function(container,depth0,helpers,partials,data){var helper;return'\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<button data-id="'+container.escapeExpression((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:helpers.helperMissing,"function"==typeof helper?helper.call(null!=depth0?depth0:container.nullContext||{},{name:"id",hash:{},data:data}):helper))+'" class="m-accion-activelayers-showstyles g-cartografia-lista" title="Estilos de la capa"></button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t'},22:function(container,depth0,helpers,partials,data){var helper;return'\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<button data-id="'+container.escapeExpression((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:helpers.helperMissing,"function"==typeof helper?helper.call(null!=depth0?depth0:container.nullContext||{},{name:"id",hash:{},data:data}):helper))+'" class="m-accion-activelayers-metadata g-cartografia-texto" title="Ver metadatos"></button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t'},24:function(container,depth0,helpers,partials,data){var helper;return'\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<button data-id="'+container.escapeExpression((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:helpers.helperMissing,"function"==typeof helper?helper.call(null!=depth0?depth0:container.nullContext||{},{name:"id",hash:{},data:data}):helper))+'" class="m-accion-activelayers-info g-cartografia-info" title="Información de la capa"></button>\r\n\t\t\t\t\t</div>\r\n'},26:function(container,depth0,helpers,partials,data){var helper,alias1=null!=depth0?depth0:container.nullContext||{},alias2=helpers.helperMissing,alias4=container.escapeExpression;return'\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\x3c!-- <span data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,"function"==typeof helper?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="m-accion-activelayers-remove g-cartografia-papelera"></span> --\x3e\r\n\t\t\t\t\t\t<button data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,"function"==typeof helper?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" class="m-accion-activelayers-remove g-cartografia-papelera" title="Eliminar capa"></button>\r\n\t\t\t\t\t</div>\r\n'},28:function(container,depth0,helpers,partials,data){return"dNone"},30:function(container,depth0,helpers,partials,data){var stack1,helper,alias1=null!=depth0?depth0:container.nullContext||{},alias2=helpers.helperMissing,alias3="function",alias4=container.escapeExpression;return'\t\t\t\t\t\t<div class="m-accion-activelayers-styles">\r\n\t\t\t\t\t\t\t<input id="'+alias4((helper=null!=(helper=helpers.index||data&&data.index)?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"index",hash:{},data:data}):helper))+"-"+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" data-id="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" type="radio" class="m-accion-activelayers-activestyle"\r\n\t\t\t\t\t\t\t '+(null!=(stack1=helpers.if.call(alias1,null!=depth0?depth0.selected:depth0,{name:"if",hash:{},fn:container.program(12,data,0),inverse:container.noop,data:data}))?stack1:"")+' name="'+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'" value="'+alias4((helper=null!=(helper=helpers.index||data&&data.index)?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"index",hash:{},data:data}):helper))+'" />\r\n\t\t\t\t\t\t\t<label for="'+alias4((helper=null!=(helper=helpers.index||data&&data.index)?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"index",hash:{},data:data}):helper))+"-"+alias4((helper=null!=(helper=helpers.id||(null!=depth0?depth0.id:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"id",hash:{},data:data}):helper))+'">'+alias4((helper=null!=(helper=helpers.Title||(null!=depth0?depth0.Title:depth0))?helper:alias2,typeof helper===alias3?helper.call(alias1,{name:"Title",hash:{},data:data}):helper))+"</label>\r\n\t\t\t\t\t\t</div>\r\n"},32:function(container,depth0,helpers,partials,data){return'\t\t<div class="info">\r\n\t\t\t<span>No existe ninguna capa activa</span>\r\n\t\t</div>\r\n'},compiler:[7,">= 4.0.0"],main:function(container,depth0,helpers,partials,data){var stack1;return'<div id="tool-activelayers">\r\n\t<div id="toc-activelayers" class="m-toc-activelayers sortable-activelayers">\r\n'+(null!=(stack1=helpers.each.call(null!=depth0?depth0:container.nullContext||{},null!=depth0?depth0.overlayLayers:depth0,{name:"each",hash:{},fn:container.program(1,data,0),inverse:container.program(32,data,0),data:data}))?stack1:"")+"\t</div>\r\n</div>"},useData:!0}));