From 28bd2a6c24afdc70a8fb5f9b5d0792e7dc0e4832 Mon Sep 17 00:00:00 2001 From: guillecaiati <61876344+guillecaiati@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:57:57 -0300 Subject: [PATCH 01/13] =?UTF-8?q?cambio=20/=20para=20agilizar=20la=20compi?= =?UTF-8?q?laci=C3=B3n=20de=20=C3=ADconos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://proyectos.argentina.gob.ar/issues/16259#note-29 Update _argentina.scss --- src/scss/modules/_argentina.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/modules/_argentina.scss b/src/scss/modules/_argentina.scss index 5c16255a1..18263d577 100644 --- a/src/scss/modules/_argentina.scss +++ b/src/scss/modules/_argentina.scss @@ -9,7 +9,7 @@ @import "main"; /* Form-type - ======================================================================== */ + ======================================================================== */ .form-type-date .form-inline { margin: 0 -15px; background: none; From 847995a7dfd405a561ae6225cee530e38bf999a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Bouillet?= Date: Tue, 18 Jun 2024 16:08:49 -0300 Subject: [PATCH 02/13] addStyle --- src/js/utils/document.js | 72 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/js/utils/document.js diff --git a/src/js/utils/document.js b/src/js/utils/document.js new file mode 100644 index 000000000..02d09d3b5 --- /dev/null +++ b/src/js/utils/document.js @@ -0,0 +1,72 @@ +/** + * HEAD STYLE + * + * @summary Permite agregar definiciones css dentro del head. + * + * @author Agustín Bouillet + * @param {string} scope Nombre único para identificar las asignaciones css + * @param {string} styleDefinitions Definiciones CSS + * @example + * headStyle("custom-id", `div { border: 2px solid red}`); + * @returns {undefined} + * + * MIT License + * + * Copyright (c) 2023 Argentina.gob.ar + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rightsto use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +const headStyle = (scope, styleDefinitions) => { + if (typeof scope !== "string" || scope.trim() === "") { + console.warn("No se ha provisto un _scope_ válido. Se usará: " + + "'argob-custom-css'."); + scope = "argob-custom-css"; + } + + if (typeof styleDefinitions !== "string" || styleDefinitions.trim() == ""){ + console.warn("No se ha provisto definición de estilos. " + + "Se pasa por alto la petición."); + return; + } + + const styleExists = document.getElementById(scope); + if (styleExists !== null) { + if (styleExists.textContent.trim() === styleDefinitions.trim()) { + console.warn("[addHeadStyle] Una definición de estilos " + + "con las mismas definiciones ya existe."); + return; + + } else { + styleExists.remove(); + console.warn("[addHeadStyle] Un estilo con el mismo _scope_ " + + "existe, pero tiene definiciones distintas. Se pisa."); + } + } + + document.querySelectorAll("head").forEach(h => { + const tag = document.createElement("style"); + tag.setAttribute("rel", "stylesheet"); + tag.id = scope; + tag.textContent = styleDefinitions; + + h.appendChild(tag); + }); +}; \ No newline at end of file From 879060b3c12e76470705bee9a1f568e6b0de9941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Bouillet?= Date: Tue, 18 Jun 2024 23:07:41 -0300 Subject: [PATCH 03/13] add document.js to gulp --- gulpfile.js | 1 + 1 file changed, 1 insertion(+) diff --git a/gulpfile.js b/gulpfile.js index 60732b8c4..5e092f2f8 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,6 +21,7 @@ const ponchoMinList = [ './src/js/utils/connect.js', './src/js/utils/string.js', './src/js/utils/html.js', + './src/js/utils/document.js', './src/js/utils/collections.js', './src/js/poncho-table/poncho-table.js', './src/js/poncho-agenda/src/js/poncho-agenda.js', From 937ca69290604a44028c08f18af65338aef709fc Mon Sep 17 00:00:00 2001 From: agustinbouillet Date: Wed, 19 Jun 2024 02:10:15 +0000 Subject: [PATCH 04/13] =?UTF-8?q?=F0=9F=A7=AA=20Deploy=20with=20build-ponc?= =?UTF-8?q?ho?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/js/poncho.js | 73 +++++++++++++++++++++++++++++++++++++++++++ dist/js/poncho.min.js | 2 +- 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/dist/js/poncho.js b/dist/js/poncho.js index 64bd99ba4..0a592a79d 100644 --- a/dist/js/poncho.js +++ b/dist/js/poncho.js @@ -718,6 +718,79 @@ if (typeof exports !== "undefined") { } +/** + * HEAD STYLE + * + * @summary Permite agregar definiciones css dentro del head. + * + * @author Agustín Bouillet + * @param {string} scope Nombre único para identificar las asignaciones css + * @param {string} styleDefinitions Definiciones CSS + * @example + * headStyle("custom-id", `div { border: 2px solid red}`); + * @returns {undefined} + * + * MIT License + * + * Copyright (c) 2023 Argentina.gob.ar + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rightsto use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +const headStyle = (scope, styleDefinitions) => { + if (typeof scope !== "string" || scope.trim() === "") { + console.warn("No se ha provisto un _scope_ válido. Se usará: " + + "'argob-custom-css'."); + scope = "argob-custom-css"; + } + + if (typeof styleDefinitions !== "string" || styleDefinitions.trim() == ""){ + console.warn("No se ha provisto definición de estilos. " + + "Se pasa por alto la petición."); + return; + } + + const styleExists = document.getElementById(scope); + if (styleExists !== null) { + if (styleExists.textContent.trim() === styleDefinitions.trim()) { + console.warn("[addHeadStyle] Una definición de estilos " + + "con las mismas definiciones ya existe."); + return; + + } else { + styleExists.remove(); + console.warn("[addHeadStyle] Un estilo con el mismo _scope_ " + + "existe, pero tiene definiciones distintas. Se pisa."); + } + } + + document.querySelectorAll("head").forEach(h => { + const tag = document.createElement("style"); + tag.setAttribute("rel", "stylesheet"); + tag.id = scope; + tag.textContent = styleDefinitions; + + h.appendChild(tag); + }); +}; + function flattenNestedObjects(entries) { return entries.map(entry => { return flattenObject(entry, ""); diff --git a/dist/js/poncho.min.js b/dist/js/poncho.min.js index c5880e1ac..1cdb8c613 100644 --- a/dist/js/poncho.min.js +++ b/dist/js/poncho.min.js @@ -1 +1 @@ -const ponchoColorDefinitionsList=[{description:"",scope:"",name:"Blanco",color:"#FFFFFF",code:"white",alias:["white"]},{description:"",scope:"",name:"Gris base",color:"#333333",code:"gray-base",alias:["gray-base"]},{description:"",scope:"brand",name:"Azul",color:"#242C4F",code:"azul",alias:["azul"]},{description:"",scope:"brand",name:"Azul",color:"#242C4F",code:"primary",alias:["azul","primary"]},{description:"Acción principal o exitosa",scope:"brand",name:"Verde",color:"#2E7D33",code:"success",alias:["verde","success"]},{description:"Atención o peligro",scope:"brand",name:"Rojo",color:"#C62828",code:"danger",alias:["rojo","danger"]},{description:"Foco o alerta",scope:"brand",name:"Amarillo",color:"#E7BA61",code:"warning",alias:["amarillo","warning"]},{description:"",scope:"brand",name:"Celeste",color:"#3e5a7e",code:"info",alias:["celeste","info"]},{description:"Elementos básicos",scope:"brand",name:"Negro",color:"#333333",code:"black",alias:["negro","black"]},{description:"Enlace visitado",scope:"brand",name:"Uva",color:"#6A1B99",code:"uva",alias:["uva"]},{description:"Texto secundario (subtitulos)",scope:"brand",name:"Gris",color:"#525252",code:"muted",alias:["gris","muted"]},{description:"Gris área",scope:"",name:"Gris intermedio",color:"#555555",code:"gray",alias:["grisintermedio","gris-area","gray"]},{description:"Fondo footer/header",scope:"brand",name:"Celeste Argentina",color:"#37BBED",code:"celeste-argentina",alias:["celesteargentina","celeste-argentina"]},{description:"",scope:"brand",name:"Fucsia",color:"#EC407A",code:"fucsia",alias:["fucsia"]},{description:"",scope:"brand",name:"Arándano",color:"#C2185B",code:"arandano",alias:["arandano"]},{description:"",scope:"brand",name:"Cielo",color:"#039BE5",code:"cielo",alias:["cielo"]},{description:"",scope:"brand",name:"Verdin",color:"#6EA100",code:"verdin",alias:["verdin"]},{description:"",scope:"brand",name:"Lima",color:"#CDDC39",code:"lima",alias:["lima"]},{description:"",scope:"brand",name:"Maiz",color:"#FFCE00",code:"maiz",alias:["maiz","maíz"]},{description:"",scope:"brand",name:"Tomate",color:"#EF5350",code:"tomate",alias:["tomate"]},{description:"",scope:"brand",name:"Naranja oscuro",color:"#EF6C00",code:"naranja",alias:["naranjaoscuro","naranja"]},{description:"",scope:"brand",name:"Verde azulado",color:"#008388",code:"verde-azulado",alias:["verdeazulado","verde-azulado"]},{description:"",scope:"brand",name:"Escarapela",color:"#2CB9EE",code:"escarapela",alias:["escarapela"]},{description:"",scope:"brand",name:"Lavanda",color:"#9284BE",code:"lavanda",alias:["lavanda"]},{description:"",scope:"brand",name:"Mandarina",color:"#F79525",code:"mandarina",alias:["mandarina"]},{description:"",scope:"brand",name:"Palta",color:"#50B7B2",code:"palta",alias:["palta"]},{description:"",scope:"brand",name:"Cereza",color:"#ED3D8F",code:"cereza",alias:["cereza"]},{description:"",scope:"brand",name:"Limón",color:"#D7DF23",code:"limon",alias:["limon"]},{description:"",scope:"brand",name:"Verde Jade",color:"#006666",code:"verde-jade",alias:["verdejade","verde-jade"]},{description:"",scope:"brand",name:"Verde Aloe",color:"#4FBB73",code:"verde-aloe",alias:["verdealoe","verde-aloe"]},{description:"",scope:"brand",name:"Verde Cemento",color:"#B4BEBA",code:"verde-cemento",alias:["verdecemento","verde-cemento"]},{description:"",scope:"",name:"Gray dark",color:"#444444",code:"gray-dark",alias:["gray-dark"]},{description:"",scope:"",name:"Gray border",color:"#DEE2E6",code:"gray-border",alias:["gray-border"]},{description:"",scope:"",name:"Gray hover",color:"#E9E9E9",code:"gray-hover",alias:["gray-hover"]},{description:"",scope:"",name:"gray hover light",color:"#F0F0F0",code:"gray-hover-light",alias:["gray-hover-light"]},{description:"",scope:"",name:"gray background",color:"#FFFFFF",code:"gray-background",alias:["gray-background"]},{description:"",scope:"",name:"Gray light",color:"#DDDDDD",code:"gray-light",alias:["gray-light"]},{description:"",scope:"",name:"Gray lighter",color:"#F2F2F2",code:"gray-lighter",alias:["gray-lighter"]},{description:"",scope:"brand",name:"Default",color:"#838383",code:"default",alias:["default"]},{description:"",scope:"brand",name:"Primary alt",color:"#242C4F",code:"primary-alt",alias:["primary-alt"]},{description:"",scope:"brand",name:"Primary light",color:"#F3FAFF",code:"primary-light",alias:["primary-light"]},{description:"",scope:"brand",name:"Secondary",color:"#45658D",code:"secondary",alias:["secondary"]},{description:"",scope:"brand",name:"Complementary",color:"#EF5350",code:"complementary",alias:["complementary"]},{description:"",scope:"brand",name:"Azul marino",color:"#242C4F",code:"azul-marino",alias:["azul-marino"]},{description:"",scope:"brand",name:"Amarillo intenso",color:"#E7BA61",code:"amarillo-intenso",alias:["amarillo-intenso"]}],colorVariations={high:["primary","verde-jade","success","naranja","danger","arandano","uva","celeste-argentina","palta","verdin","warning","tomate","fucsia","lavanda","black"],medium:["info","verde-azulado","verdin","warning","tomate","fucsia","lavanda","palta","lima","maiz","muted"]},ponchoColorDefinitions=t=>{return ponchoColorDefinitionsList.find(e=>e.alias.some(e=>null!=typeof t&&e==t))||!1},ponchoColor=e=>{var t="#99999";return"string"==typeof e&&(e=ponchoColorDefinitions(e))&&e.color||t},cleanUpHex=e=>{let t=e.toString().replace("#","").trim().toUpperCase();return!(t.length<3||6e.repeat(2)).join(""):t)},ponchoColorByHex=t=>ponchoColorDefinitionsList.find(e=>{return cleanUpHex(t)==cleanUpHex(e.color)});async function fetch_json(e,t={}){t=Object.assign({},{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"},redirect:"follow"},t),e=await fetch(e,t);if(e.ok)return e.json();throw new Error("HTTP error! status: "+e.status)}"undefined"!=typeof exports&&(module.exports={ponchoColorDefinitionsList:ponchoColorDefinitionsList,ponchoColorDefinitions:ponchoColorDefinitions,ponchoColor:ponchoColor,ponchoColorByHex:ponchoColorByHex,cleanUpHex:cleanUpHex});const replaceSpecialChars=e=>{if(!e)return"";var t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż",s="aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz";const a=t+t.toUpperCase(),r=s+s.toUpperCase();t=new RegExp(a.split("").join("|"),"g");return e.toString().replace(t,e=>r.charAt(a.indexOf(e)))},slugify=e=>{if(!e)return e;const t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;";var s=new RegExp(t.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,"-").replace(s,e=>"aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------".charAt(t.indexOf(e))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},secureHTML=("undefined"!=typeof exports&&(module.exports={slugify:slugify,replaceSpecialChars:replaceSpecialChars}),(e,t=[])=>{var s;return!t.some(e=>"*"===e)&&(e=e.toString().replace(//g,">"),0").replace(t,"")):e});function flattenNestedObjects(e){return e.map(e=>flattenObject(e,""))}function flattenObject(e,t){var s={};for(const i in e){var a=e[i],r=t?t+"__"+i:i;"object"==typeof a&&null!==a?Object.assign(s,flattenObject(a,r)):s[r]=a}return s}function ponchoTable(e){return ponchoTableLegacyPatch(),ponchoTableDependant(e)}"undefined"!=typeof exports&&(module.exports={secureHTML:secureHTML}),"undefined"!=typeof exports&&(module.exports={flattenObject:flattenObject,flattenNestedObjects:flattenNestedObjects}),ponchoTableLegacyPatch=()=>{document.querySelectorAll("select[id=ponchoTableFiltro]").forEach(e=>{var e=e.parentElement,t=document.createElement("div");t.id="ponchoTableFiltro",t.classList.add("row"),e.parentElement.appendChild(t),e.remove()})};class PonchoAgenda{DATE_REGEX=/^([1-9]|0[1-9]|[1-2][0-9]|3[0-1])\/([1-9]|0[1-9]|1[0-2])\/([1-9][0-9]{3})$/;constructor(e={}){e.headers=this._refactorHeaders(e),e.headersOrder=this._refactorHeadersOrder(e),this.opts=Object.assign({},this.defaults,e),this.categoryTitleClassList=this.opts.categoryTitleClassList,this.itemContClassList=this.opts.itemContClassList,this.itemClassList=this.opts.itemClassList,this.groupCategory=this.opts.groupCategory,this.dateSeparator=this.opts.dateSeparator,this.startDateId=this.opts.startDateId,this.endDateId=this.opts.endDateId,this.timeId=this.opts.timeId,this.descriptionId=this.opts.descriptionId,this.criteriaOneId=this.opts.criteriaOneId,this.criteriaTwoId=this.opts.criteriaTwoId,this.criteriaThreeId=this.opts.criteriaThreeId}defaults={allowedTags:["strong","span","dl","dt","dd","img","em","button","button","p","div","h3","ul","li","time","a","h1"],criteriaOneId:"destinatarios",criteriaThreeId:"destacado",criteriaTwoId:"url",descriptionId:"descripcion",categoryTitleClassList:["h6","text-secondary"],itemContClassList:["list-unstyled"],itemClassList:["m-b-2"],dateSeparator:"/",filterStatus:{header:"Estado",nextDates:"Próximas",pastDates:"Anteriores"},endDateId:"hasta",groupCategory:"filtro-ministerio",rangeLabel:"Fechas",startDateId:"desde",timeId:"horario"};_refactorHeadersOrder=e=>{if(e.hasOwnProperty("headersOrder")&&0this.opts.headers.hasOwnProperty(e)?this.opts.headers[e]:e;_refactorHeaders=e=>{let t=this.defaults.filterStatus.header,s=(e?.filterStatus?.header&&(t=e.filterStatus.header),this.defaults.rangeLabel);return{range:s=e?.rangeLabel?e.rangeLabel:s,...e.headers,"filtro-status":t}};_isMarkdownEnable=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter"));_markdownOptions=()=>this._isMarkdownEnable()&&this.opts.hasOwnProperty("markdownOptions")&&"object"==typeof this.opts.markdownOptions?this.opts.markdownOptions:{};_markdownConverter=e=>{return this._isMarkdownEnable()?new showdown.Converter(this._markdownOptions()).makeHtml(e):e};_isPastDate=e=>{return!!this._isValidDateFormat(e)&&this._dateParser(e).date.getTime(){var{day:e,month:s,year:a}=e;let r="";return[e,s,a].join(this.dateSeparator)+(r=t?[hours,minutes].join(":"):r)};_currentDate=()=>{var e=new Date,t=e.getFullYear(),s=e.getMonth()+1,e=e.getDate(),e=[this._pad(e),this._pad(s),t].join(this.dateSeparator);return{...this._dateParser(e),format:e}};_pad=(e,t=2)=>e.toString().padStart(t,"0");_dateParser=(e,t="00:00:00")=>{var s,a;if(this._isValidDateFormat(e))return[,e,s,a]=this.DATE_REGEX.exec(e),t=new Date(a+`-${s}-${e} `+t),{day:this._pad(e),month:this._pad(s),year:a,hours:this._pad(t.getHours()),minutes:this._pad(t.getMinutes()),date:t}};_isValidDateFormat=e=>{return null!==this.DATE_REGEX.exec(e)};_groupByFingerprintAndCategory=e=>{var t={};for(const r of e){var s=r[this.groupCategory],a=r["fingerprint"];t[a]||(t[a]={}),t[a][s]||(t[a][s]=[]),t[a][s].push(r)}return t};_refactorEntries=e=>{let d=[];return e.forEach(e=>{var t=e[this.startDateId];let s=e[this.endDateId];s=""===s.trim()?t:s;var{pastDates:a,nextDates:r}=this.opts.filterStatus,a=this._isPastDate(s)?a:r,r=this._dateParser(t),i=this._dateParser(s),o=r.date.getTime(),n=i.date.getTime(),l=[o,n].join("_");let c=this._dateTimeFormat(r);o!=n&&(c=`Del ${this._dateTimeFormat(r)} al `+this._dateTimeFormat(i));o={...e,range:c,"filtro-status":a,fingerprint:l,desde:t,hasta:s};d.push(o)}),d};itemTemplate=(e,t,s,a,r,i)=>{const o=document.createElement("dl");let n;return i?(r=this._dateParser(r,i),(n=document.createElement("time")).setAttribute("datetime",r.date.toISOString()),n.textContent=r.hours+":"+r.minutes+"hs."):(n=document.createElement("span")).textContent="--:--",[["Descripción",this._markdownConverter(e),!0,!0,"description"],[this._header(this.criteriaOneId),this._markdownConverter(t),!1,!0,"criteria-one"],[this._header(this.criteriaThreeId),this._markdownConverter(a),!1,!0,"criteria-three"],[this._header(this.criteriaTwoId),this._markdownConverter(s),!1,!0,"criteria-two"],[this._header(this.timeId),n.outerHTML,!1,!0,"time"]].forEach(e=>{var t,[e,s,a,r,i]=e;s&&((t=document.createElement("dt")).textContent=e,t.classList.add("agenda-item__dt","agenda-item__dt-"+i),a&&t.classList.add("sr-only"),(e=document.createElement("dd")).textContent=s,e.classList.add("agenda-item__dd","agenda-item__dd-"+i),r&&o.appendChild(t),o.appendChild(e))}),this.itemClassList.some(e=>e)&&o.classList.add("agenda-item",...this.itemClassList),o};_groupedEntries=e=>{let i=[];return Object.values(e).forEach(e=>{var r;Object.values(e).forEach(e=>{var t="",s="";const a=document.createElement("div");this.itemContClassList.some(e=>e)&&a.classList.add(...this.itemContClassList),e.forEach(e=>{s!=(r=e)[this.groupCategory]&&(s=r[this.groupCategory],t=document.createElement("p"),this.categoryTitleClassList.some(e=>e))&&(t.classList.add(...this.categoryTitleClassList),t.textContent=s,a.appendChild(t));var t=this.itemTemplate(e.descripcion,e.destinatarios,e.url,e.destacados,e.desde,e.horario);a.appendChild(t)}),t+=a.outerHTML,delete r.fingerprint;e={};e[this.descriptionId]=t,i.push({...r,...e})})}),i};_ponchoTableExists=()=>void 0!==ponchoTable;render=()=>{var e;this.opts.hasOwnProperty("jsonData")&&(e=this._refactorEntries(this.opts.jsonData),e=this._groupByFingerprintAndCategory(e),this.opts.jsonData=this._groupedEntries(e),this._ponchoTableExists())&&ponchoTable(this.opts)}}"undefined"!=typeof exports&&(module.exports=PonchoAgenda);const ponchoTableDependant=c=>{var h,p=[],u=!(!c.hasOwnProperty("wizard")||!c.wizard),d=c.hasOwnProperty("emptyLabel")&&c.emptyLabel?c.emptyLabel:"Todos",m={},s=!(!c.hasOwnProperty("orderFilter")||!c.orderFilter),f={},_=["*"];let e={tables:!0,simpleLineBreaks:!0,extensions:["details","images","alerts","numbers","ejes","button","target","bootstrap-tables","video"]};document.querySelector("#ponchoTable").classList.add("state-loading"),jQuery.fn.DataTable.isDataTable("#ponchoTable")&&jQuery("#ponchoTable").DataTable().destroy();const y=(e,t)=>{return s?(t=t,e.toString().localeCompare(t.toString(),"es",{numeric:!0})):null},g=e=>[...new Set(e)],b=(e=0,t,s,a=!1)=>{var r=document.createElement("option");return r.value=s.toString().trim(),r.dataset.column=e,r.textContent=t.toString().trim(),a&&r.setAttribute("selected","selected"),r},v=(e="")=>e.toString().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=e=>e<=0?0:e,x=()=>[...document.querySelectorAll("[data-filter]")].map(e=>e.value),E=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter")),a=()=>c.hasOwnProperty("markdownOptions")&&"object"===c.markdownOptions?c.markdownOptions:e,k=t=>{if("string"==typeof t){if(!E())return t;let e;return a().extensions.every(e=>{try{return showdown.extension(e),!0}catch(e){return!1}})?(e=new showdown.Converter(a())).makeHtml(t):(e=new showdown.Converter).makeHtml(t)}},w=(e,t)=>{var s=document.createElement("a");return s.setAttribute("aria-label",e),s.classList.add("btn","btn-primary","btn-sm","margin-btn"),s.target="_blank",s.href=t,s.textContent=e,s.setAttribute("rel","noopener noreferrer"),s.outerHTML},S=e=>{var t=e.split("/"),t=new Date(t[2],t[1]-1,t[0]).toISOString().split("T")[0],s=document.createElement("span"),a=(s.style.display="none",s.textContent=t,document.createElement("time"));return a.setAttribute("datetime",t),a.textContent=e,s.outerHTML+a.outerHTML},T=e=>replaceSpecialChars(e.toLowerCase()),n=(n,l,c)=>{l=l==p.length?l-1:l;const d=x();var e=h.entries.flatMap(e=>{t=n,s=e,a=c,r=d;var t,s,a,r,i=[...Array(C(t+1)).keys()].map(e=>s[p[C(t-1)]]==r[C(t-1)]&&s[p[C(t)]]==a||""==r[C(t-1)]).every(e=>e);if(e[p[C(l-1)]]==c&&i){const o=e[p[C(l)]];return j(l,m)?L(l).filter(e=>T(o).includes(T(e))):o}}).filter(e=>e),e=g(e);return e.sort(y),e},j=e=>{var t=Object.keys(m);return!!f.hasOwnProperty("filtro-"+t[e])},L=e=>{var t=Object.keys(m);return f.hasOwnProperty("filtro-"+t[e])?f["filtro-"+t[e]]:[]},r=(t,a)=>{var r=Object.keys(m);const i=x();for(let s=t+1;s<=r.length&&r.length!=s;s++){let e=n(t,s,a);0==e.length&&(e=((s,a,r)=>{var e=h.entries.flatMap(e=>{const t=e[p[C(a)]];return(e[p[C(s)]]==r||""==r)&&(j(a,m)?L(a).filter(e=>T(t).includes(T(e))):t)}).filter(e=>e),e=g(e);return e.sort(y),e})(t,s,a));const o=document.querySelector("#"+r[s]);o.innerHTML="",o.appendChild(b(s,d,"",!0)),e.forEach(e=>{var t;e.trim()&&(t=i[s]==e,o.appendChild(b(s,e,e,t)))})}},o=()=>{return window.location.hash.replace("#","")||!1},A=(_hideTable=(e=!0)=>{const t=e?"none":"block",s=e?"block":"none";document.querySelectorAll('[data-visible-as-table="true"],#ponchoTable_wrapper').forEach(e=>e.style.display=t),document.querySelectorAll('[data-visible-as-table="false"]').forEach(e=>e.style.display=s)},()=>{var e=jQuery.fn.DataTable.ext.type.search;e.string=e=>e?"string"==typeof e?replaceSpecialChars(e):e:"",e.html=e=>e?"string"==typeof e?replaceSpecialChars(e.replace(/<.*?>/g,"")):e:"";let d=jQuery("#ponchoTable").DataTable({initComplete:(e,t)=>{u&&_hideTable()},lengthChange:!1,autoWidth:!1,pageLength:c.cantidadItems,columnDefs:[{type:"html-num",targets:c.tipoNumero},{targets:c.ocultarColumnas,visible:!1}],ordering:c.orden,order:[[c.ordenColumna-1,c.ordenTipo]],dom:'<"row"<"col-sm-6"l><"col-sm-6"f>><"row"<"col-sm-12"i>><"row"<"col-sm-12"tr>><"row"<"col-md-offset-3 col-md-6 col-sm-offset-2 col-sm-8"p>>',language:{sProcessing:"Procesando...",sLengthMenu:"Mostrar _MENU_ registros",sZeroRecords:"No se encontraron resultados",sEmptyTable:"Ningún dato disponible en esta tabla",sInfo:"_TOTAL_ resultados",sInfoEmpty:"No hay resultados",sInfoFiltered:"",sInfoPostFix:"",sSearch:"Buscar:",sUrl:"",sInfoThousands:".",sLoadingRecords:"Cargando...",oPaginate:{sFirst:"<<",sLast:">>",sNext:">",sPrevious:"<"},oAria:{sSortAscending:": Activar para ordenar la columna de manera ascendente",sSortDescending:": Activar para ordenar la columna de manera descendente",paginate:{first:"Ir a la primera página",previous:"Ir a la página anterior",next:"Ir a la página siguiente",last:"Ir a la última página"}}}});jQuery("#ponchoTableSearch").keyup(function(){d.search(jQuery.fn.DataTable.ext.type.search.string(this.value)).draw()}),jQuery("#ponchoTable_filter").parent().parent().remove(),1{e=document.querySelectorAll(e+" option");return Object.values(e).map(e=>e.value).some(e=>e)};if(jQuery("select[data-filter]").change(function(){var e=jQuery(this).find("option:selected").data("column"),t=jQuery(this).find("option:selected").val();r(e,t),d.columns().search("").columns().search("").draw();const i=Object.keys(m),o=x();if(o.forEach((e,t)=>{s=i[t];var s=Object.keys(h.headers).indexOf("filtro-"+s),a=v(o[t]),r=v(replaceSpecialChars(o[t]));j(t,m)?d.columns(s).search(T(o[t])):d.columns(s).search(o[t]?`^(${a}|${r})$`:"",!0,!1,!0)}),d.draw(),u){var[n,l=0,c=""]=[i,e,t];let r=!1;n.forEach((e,t)=>{var s=p("#"+e);let a="none";s&&c&&t<=l+1?a="block":s&&!c&&t<=l+1&&(document.querySelectorAll("#"+n[l+1]).forEach(e=>e.innerHTML=""),a="block",r=!1),document.querySelectorAll(`[data-filter-name="${e}"]`).forEach(e=>e.style.display=a)}),(r=p("#"+n[l])&&c&&!p("#"+n[l+1])?!0:r)?_hideTable(!1):_hideTable()}}),c.hasOwnProperty("hash")&&c.hash){e=o();const t=e?decodeURIComponent(e):"";document.querySelectorAll("#ponchoTableSearch").forEach(e=>{e.value=t,d.search(jQuery.fn.DataTable.ext.type.search.string(t)).draw()})}}),l=e=>{(h=e).entries="function"==typeof c.refactorEntries&&null!==c.refactorEntries?c.refactorEntries(h.entries):h.entries,h.headers=(c.hasOwnProperty("headers")&&c.headers?c:h).headers,h.headers=(e=>{if(c.hasOwnProperty("headersOrder")&&0e.startsWith("filtro-")),f=c.asFilter?c.asFilter(h.entries):{},m=((r,i)=>{let o={};return i.forEach((t,s)=>{let e=[];e=f.hasOwnProperty(i[s])?f[i[s]]:r.entries.map(e=>e[t]);var a=g(e);a.sort(y),t=t.replace("filtro-",""),o[t]=[],a.forEach(e=>{o[t].push({columna:s,value:e})})}),o})(h,p),c.hasOwnProperty("filterContClassList")&&c.filterContClassList&&((e=document.getElementById("ponchoTableFiltroCont")).removeAttribute("class"),e.classList.add(...c.filterContClassList)),c.hasOwnProperty("searchContClassList")&&c.searchContClassList&&((e=document.getElementById("ponchoTableSearchCont")).removeAttribute("class"),e.classList.add(...c.searchContClassList));{var o=h;(e=document.querySelector("#ponchoTable thead")).innerHTML="";const a=document.createElement("tr"),t=(Object.keys(o.headers).forEach((e,t)=>{var s=document.createElement("th");s.textContent=o.headers[e],s.setAttribute("scope","col"),a.appendChild(s)}),e.appendChild(a),(e=document.querySelector("#ponchoTable caption")).innerHTML="",e.textContent=c.tituloTabla,document.querySelector("#ponchoTable tbody"));t.innerHTML="",o.entries.forEach((r,e)=>{if(Object.values(r).some(e=>String(e).trim())){r="function"==typeof c.customEntry&&null!==c.customEntry?c.customEntry(r):r;const i=t.insertRow();i.id="id_"+e,Object.keys(o.headers).forEach(e=>{let t=r[e];e.startsWith("btn-")&&""!=t?(s=e.replace("btn-","").replace("-"," "),t=w(s,t)):e.startsWith("fecha-")&&""!=t&&(t=S(t));var s=i.insertCell();s.dataset.title=o.headers[e],""==t&&(s.className="hidden-xs");let a=c.hasOwnProperty("allowedTags")?c.allowedTags:_;e.startsWith("btn-")&&""!=t?a=[...a,"a"]:e.startsWith("fecha-")&&""!=t&&(a=[...a,"span","time"]);e=secureHTML(t,a);E()?s.innerHTML=k(e):s.innerHTML=e})}})}{var n=h;const l=document.querySelector("#ponchoTableFiltro");l.innerHTML="",Object.keys(m).forEach((e,t)=>{const s=m[e][0].columna||0;var a=m[e].map(e=>e.value).sort(y),r=document.createElement("div"),i=(c.hasOwnProperty("filterClassList")?(i="string"==typeof c.filterClassList?c.filterClassList.split(" "):c.filterClassList,r.classList.add(...i)):(i=Math.floor(12/Object.keys(m).length),r.classList.add("col-sm-12","col-md-"+i)),r.dataset.index=t,r.dataset.filterName=e,u&&0{e&&o.appendChild(b(s,e,e,!1))}),i.appendChild(t),i.appendChild(o),r.appendChild(i),l.appendChild(r)})}document.querySelector("#ponchoTableSearchCont").style.display="block",document.querySelector("#ponchoTable").classList.remove("state-loading"),A()},t=e=>{jQuery.getJSON(e,function(e){var t=new GapiSheetData;h=t.json_data(e),l(h)})};if(c.jsonData){var O=Object.fromEntries(Object.keys(c.jsonData[0]).map(e=>[e,e])),O={entries:c.jsonData,headers:O};l(O)}else if(c.jsonUrl)t(c.jsonUrl);else if(c.hojaNombre&&c.idSpread){O=(new GapiSheetData).url(c.hojaNombre,c.idSpread);t(O)}else{if(!c.hojaNumero||!c.idSpread)throw"¡Error! No hay datos suficientes para crear la tabla.";{var I=c.hojaNumero;const P=new GapiSheetData;O=["https://sheets.googleapis.com/v4/spreadsheets/",c.idSpread,"/?alt=json&key=",P.gapi_key].join("");jQuery.getJSON(O,function(e){e=e.sheets[I-1].properties.title,e=P.url(e,c.idSpread);t(e)})}}};var content_popover=document.getElementById("content-popover");function popshow(){content_popover.classList.toggle("hidden")}function pophidde(){content_popover.classList.add("hidden")}var ponchoUbicacion=function(e){var s,a,r,i,t="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geoprovincias.json",o="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geolocalidades.json",n=jQuery('input[name="submitted['+e.provincia+']"]'),l=jQuery('input[name="submitted['+e.localidad+']"]');function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(e,t,s,a=!1,r=!1,i=!1){var o=jQuery("").attr("id",t).attr("name",e).addClass("form-control form-select").prop("required",a);return r&&o.append(""),jQuery.each(s,function(e,t){let s="";i==t.nombre&&(s='selected="selected"'),o.append("")}),o}function p(e,t){var s=l.prop("required");return n.val()?d("sLocalidades","sLocalidades",e.filter(function(e){return String(e.provincia.id)==String(t)}).map(function(e){return e.departamento.nombre&&(e.nombre=c(e.departamento.nombre.toLowerCase())+" - "+c(e.nombre.toLowerCase())),e}).sort(function(e,t){e=e.nombre.toUpperCase(),t=t.nombre.toUpperCase();return e.localeCompare(t)}),s,emptyOption=!!l.val(),l.val()):d("sLocalidades","sLocalidades",[],s,!0,!1)}t=e.urlProvincias||t,o=e.urlLocalidades||o,jQuery.getJSON(t,function(e){var t;s=[],e.results.forEach(function(e,t){s.push(e)}),e=[],e=(t=s).sort(function(e,t){e=e.nombre.toUpperCase(),t=t.nombre.toUpperCase();return e.localeCompare(t)}),t=n.prop("required"),(r=d("sProvincias","sProvincias",e,t,!0,n.val())).on("change",function(e){var t;n.val(""),l.val(""),i.children("option:not(:first)").remove(),""!=r.val()&&(n.val(r.find(":selected").text()),t=p(a,r.val()).find("option"),i.append(t),i.val(""))}),n.after(r),jQuery(r).select2()}),jQuery.getJSON(o,function(e){a=[],e.results.forEach(function(e,t){a.push(e)}),(i=p(a,r.val())).on("change",function(e){l.val(""),""!=i.val()&&l.val(i.find(":selected").text())}),l.after(i),jQuery(i).select2()}),n.hide(),l.hide()};function ponchoChart(t){"use strict";var e;function _e(e){var t={Line:"line",Bar:"bar",Pie:"pie",Area:"line","Horizontal Bar":"horizontalBar","Stacked Bar":"bar",Mixed:"mixed",HeatMap:"heatmap",default:""};return t[e]||t.default}function ye(e){var e=e.toString().replace(".",","),t=e.split(","),s=new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(t[0]);return e=1{e=e.reduce((e,t)=>e+parseFloat(t.yLabel),0);return"Total: "+new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(e)+"%"}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}}}:"line"==L&&1{e=e.reduce((e,t)=>e+parseFloat(t.yLabel),0);return"Total: "+new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(e)}}}:{enabled:!0,mode:"index",intersect:!1,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}}},"pie"==L&&(Z.forEach(function(e,t,s){g.push(ponchoColor(e))}),t=f,j=C,z=L,o=g,s=a.idComponenteGrafico,N=S,G=E,n=T,s=document.getElementById(s),new Chart(s,{type:z,data:{labels:t,datasets:[{data:j,borderColor:o,backgroundColor:o,borderWidth:2}]},options:{legend:{display:n,position:N},responsive:!0,tooltips:G}})),1==x&&(s=ponchoColor(Z[0]),"Line"==a.tipoGrafico&&(z=f,j=C,o=L,n=s,N=b[0],G=a.ejeYenCero,l=a.idComponenteGrafico,c=S,R=E,U=T,l=document.getElementById(l),new Chart(l,{type:o,data:{labels:z,datasets:[{data:j,borderColor:n,backgroundColor:n,borderWidth:2,lineTension:0,fill:!1,label:N}]},options:{legend:{display:U,position:c},tooltips:R,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:G}}]}}})),"bar"!=L&&"Area"!=a.tipoGrafico||(l=f,j=C,U=L,c=s,R=b[0],q=a.ejeYenCero,r=a.idComponenteGrafico,i=S,H=E,B=T,r=document.getElementById(r),new Chart(r,{type:U,data:{labels:l,datasets:[{data:j,borderColor:c,backgroundColor:c,borderWidth:2,lineTension:0,label:R}]},options:{legend:{display:B,position:i},tooltips:H,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:q}}]}}})),"horizontalBar"==L)&&(r=f,j=C,B=L,i=s,H=b[0],q=a.ejeYenCero,O=a.idComponenteGrafico,re=S,ie=E,ee=T,O=document.getElementById(O),new Chart(O,{type:B,data:{labels:r,datasets:[{data:j,borderColor:i,backgroundColor:i,borderWidth:2,lineTension:0,label:H}]},options:{legend:{display:ee,position:re},tooltips:ie,responsive:!0,scales:{xAxes:[{ticks:{beginAtZero:q}}]}}})),1'+ce+": "+ne[t]+"
"+de+": "+a.globals.labels[s]+"
"+pe+": "+e+"
"}},plotOptions:{heatmap:{shadeIntensity:.5,radius:0,useFillColorAsStroke:!1,colorScale:{ranges:le}}},yaxis:{show:P},legend:{show:ue,position:he},responsive:[{breakpoint:1e3,options:{yaxis:{show:!1},legend:{show:ue,position:"top"}}}]}).render(),document.getElementsByClassName("apexcharts-toolbar"));for(let e=0;e{if(!e||!e.values||0===e.values.length)throw new TypeError("Invalid response format");if(!Array.isArray(e.values)||!Array.isArray(e.values[0]))throw new TypeError("Invalid response format: values should be arrays");const i=e.values[0],o=/ |\/|_/gi;let n=[];return e.values.forEach((e,t)=>{if(0Instituto Geográfico Nacional, OpenStreetMap'}),this.markers=new L.markerClusterGroup(this.marker_cluster_options),this.ponchoLoaderTimeout}mapOpacity=(e=!1)=>{const t=e||this.map_opacity;document.querySelectorAll(this.scope_selector+" .leaflet-pane .leaflet-tile-pane").forEach(e=>e.style.opacity=t)};mapBackgroundColor=(e=!1)=>{const t=e||this.map_background;document.querySelectorAll(this.scope_selector+" .leaflet-container").forEach(e=>e.style.backgroundColor=t)};_menuTheme=()=>{if(this.theme_tool){document.querySelectorAll("#themes-tool"+this.scope_sufix).forEach(e=>e.remove());const r=document.createElement("ul");r.classList.add("pm-list-unstyled","pm-list","pm-tools","js-themes-tool"+this.scope_sufix);var e=document.createElement("li"),t=(e.setAttribute("tabindex","-1"),e.dataset.toggle="true",document.createElement("i")),s=(t.setAttribute("aria-hidden","true"),t.classList.add("pmi","pmi-adjust"),document.createElement("button"));s.title="Cambiar tema",s.tabIndex="0",s.classList.add("pm-btn","pm-btn-rounded-circle"),s.appendChild(t),s.setAttribute("role","button"),s.setAttribute("aria-label","Abre el panel de temas");const i=document.createElement("ul");i.classList.add("pm-container","pm-list","pm-list-unstyled","pm-p-1","pm-caret","pm-caret-b","pm-toggle");var t=document.createElement("button"),a=(t.textContent="Restablecer",t.classList.add("pm-item-link","js-reset-theme"),document.createElement("li"));a.classList.add("pm-item-separator"),a.appendChild(t),i.appendChild(a),this.default_themes.map(e=>e[0]).forEach((e,t)=>{var s=document.createElement("button"),e=(s.dataset.theme=e,s.textContent=this.default_themes[t][1],s.classList.add("js-set-theme","pm-item-link"),document.createElement("li"));e.appendChild(s),i.appendChild(e)}),e.appendChild(s),e.appendChild(i),r.appendChild(e),document.querySelectorAll(this.scope_selector).forEach(e=>e.appendChild(r)),document.querySelectorAll(".js-reset-theme").forEach(e=>e.addEventListener("click",()=>{localStorage.removeItem("mapTheme"),this._removeThemes(),this._setThemes()})),document.querySelectorAll(".js-set-theme").forEach(t=>t.addEventListener("click",()=>{var e=t.dataset.theme;this.useTheme(e),localStorage.setItem("mapTheme",e)}))}};_setThemeStyles=(t=!1,e=["ui","map"])=>e.map(e=>!!["ui","map"].includes(e)&&e+"-"+t);_removeThemes=(s=["ui","map"])=>{document.querySelectorAll(this.scope_selector).forEach(t=>{[...this.default_themes,...this.temes_not_visibles].map(e=>e[0]).forEach(e=>{t.classList.remove(...this._setThemeStyles(e,s))})})};_setTheme=(t,s)=>{var e=document.querySelectorAll(this.scope_selector);this._removeThemes(s),e.forEach(e=>{e.classList.add(...this._setThemeStyles(t,s))})};useTheme=(e=!1)=>{e=e||this.theme;this._setTheme(e,["ui","map"])};useMapTheme=e=>this._setTheme(e,["map"]);useUiTheme=e=>this._setTheme(e,["ui"]);_setThemes=()=>{localStorage.hasOwnProperty("mapTheme")?this._setTheme(localStorage.getItem("mapTheme"),["ui","map"]):this.theme_ui||this.theme_map?(this.theme_ui&&this._setTheme(this.theme_ui,["ui"]),this.theme_map&&this._setTheme(this.theme_map,["map"])):this.useTheme()};_slugify=e=>slugify(e);isGeoJSON=e=>"FeatureCollection"===e?.type;get entries(){return this.data.features}get geoJSON(){return this.featureCollection(this.entries)}formatInput=e=>{e.length<1&&this.errorMessage("No se puede visualizar el mapa, el documento está vacío","warning");let t;return t=this.isGeoJSON(e)?e:(e=this.features(e),this.featureCollection(e)),this._setIdIfNotExists(t)};errorMessage=(e=!1,t="danger")=>{document.querySelectorAll("#js-error-message"+this.scope_sufix).forEach(e=>e.remove());const s=document.createElement("div");s.id="js-error-message"+this.scope_sufix,s.classList.add("poncho-map--message",t);var a=document.createElement("i"),r=(a.classList.add("icono-arg-mapa-argentina","poncho-map--message__icon"),document.createElement("h2"));r.classList.add("h6","title","pm-visually-hidden"),r.textContent="¡Se produjo un error!",s.appendChild(a),s.appendChild(r);throw[["En estos momentos tenemos inconvenientes para mostrar el mapa.","text-center"],["Disculpe las molestias","text-center","p"]].forEach(e=>{var t=document.createElement(void 0!==(t=e[2])||t?t:"p");void 0===e[1]&&!e[1]||(t.className=e[1]),t.innerHTML=e[0],s.appendChild(t)}),this.error_reporting&&((a=document.querySelector(this.scope_selector+".poncho-map")).parentNode.insertBefore(s,a),"danger"==t)&&document.getElementById(this.map_selector).remove(),e};feature=e=>{var t=e[this.latitude],s=e[this.longitude];return[t,s].forEach(e=>{isNaN(Number(e))&&this.errorMessage("El archivo contiene errores en la definición de latitud y longitud.\n "+e)}),delete e[this.latitude],delete e[this.longitude],{type:"Feature",properties:e,geometry:{type:"Point",coordinates:[s,t]}}};featureCollection=e=>({type:"FeatureCollection",features:e});features=e=>e.map(this.feature);_isIdMixing=()=>Array.isArray(this.id_mixing)&&0{var e;if(this._isIdMixing())return"function"==typeof this.id_mixing?this.id_mixing(this,t).join(""):(e=this.id_mixing.map(e=>t.properties[e]?t.properties[e].toString():e),this._slugify(e.join("-")))};_setIdIfNotExists=e=>{var t=e.features.filter((e,t)=>0===t).every(e=>e.properties.hasOwnProperty("id"));return!this._isIdMixing()&&t||(t=e.features.map((e,t)=>{var s;return this._isIdMixing()?e.properties.id=this._idMixing(e):(t=t+1,s=this.title&&e.properties[this.title]?this._slugify(e.properties[this.title]):"",e.properties.id=[t,s].filter(e=>e).join("-")),e}),e.features=t),e};addHash=e=>{"string"!=typeof e&&!e||!this.hash||this.no_info||(window.location.hash="#"+e)};entry=t=>this.entries.find(e=>!(!e?.properties||e.properties[this.id]!==t||"n"===e.properties?.["pm-interactive"]));searchEntries=(t,e)=>{return e=void 0===e?this.geoJSON:e,t?e.filter(e=>{if(this.searchEntry(t,e.properties))return e}):e};searchEntry=(e,t)=>{for(const r of[...new Set([this.title,...this.search_fields])].filter(e=>e))if(t.hasOwnProperty(r)){var s=replaceSpecialChars(e).toUpperCase(),a=replaceSpecialChars(t[r]).toString().toUpperCase();try{if(a.includes(s))return t}catch(e){}}return null};_selectorName=e=>e.replace(/^(\.|\#)/,"");scrollCenter=()=>{var e=document.getElementById(this.map_selector),t=e.getBoundingClientRect(),e=(e.offsetLeft+e.offsetWidth)/2,t=t.top+window.scrollY;window.scrollTo({top:t,left:e,behavior:"smooth"})};_clearContent=()=>document.querySelector(".js-content"+this.scope_sufix).innerHTML="";toggleSlider=()=>{this.no_info||(document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.classList.toggle(this.slider_selector+"--in")}),document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.style.display=this.isSliderOpen()?"block":"none"}))};_focusOnFeature=t=>{this.map.eachLayer(e=>{e?.options?.id==t&&(e?._path?e._path.focus():e?._icon&&e._icon.focus())})};_clickToggleSlider=()=>document.querySelectorAll(".js-close-slider"+this.scope_sufix).forEach(e=>e.addEventListener("click",()=>{this._clearContent(),this.toggleSlider(),this._focusOnFeature(e.dataset.entryId)}));isSliderOpen=()=>{let t=[];return document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.classList.contains(this.slider_selector+"--in")&&t.push(!0)}),t.some(e=>e)};setContent=t=>{if(!this.no_info){this._focusOnSlider(),this.isSliderOpen()||this.toggleSlider();const s="function"==typeof this.template?this.template(this,t):this.defaultTemplate(this,t);document.querySelectorAll(this.content_selector).forEach(e=>{e.innerHTML=s}),document.querySelectorAll(".js-close-slider"+this.scope_sufix).forEach(e=>{e.dataset.entryId=t[this.id]})}};_focusOnSlider=()=>{var e;this.no_info||(this.isSliderOpen()?document.querySelector(".js-close-slider"+this.scope_sufix).focus():(e=document.querySelector(".js-slider"+this.scope_sufix))&&e.addEventListener("animationend",()=>{document.querySelector(".js-close-slider"+this.scope_sufix).focus()}))};setHeaders=e=>{var t;return[this.template_structure,this.template_structure.mixing].every(e=>e)?(t=this.template_structure.mixing.reduce((e,t)=>{if([t.key].every(e=>e))return{...e,[t.key]:t.header||""}},{}),{...e,...t}):e};header=e=>this.headers.hasOwnProperty(e)?this.headers[e]:e;_renderSlider=()=>{var e,t,s,a;!this.render_slider||this.content_outside||this.no_info||(document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>e.remove()),(e=document.createElement("button")).classList.add("btn","btn-xs","btn-secondary","btn-close","js-close-slider"+this.scope_sufix),e.title="Cerrar panel",e.setAttribute("role","button"),e.setAttribute("aria-label","Cerrar panel de información"),e.innerHTML='Cerrar✕',(t=document.createElement("a")).setAttribute("tabindex",0),t.id="js-anchor-slider"+this.scope_sufix,(s=document.createElement("div")).classList.add("content-container"),(a=document.createElement("div")).classList.add("content","js-content"+this.scope_sufix),a.tabIndex=0,s.appendChild(a),(a=document.createElement("div")).style.display="none",a.setAttribute("role","region"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-label","Panel de información"),a.classList.add("pm-container","slider","js-slider"+this.scope_sufix),a.id="slider"+this.scope_sufix,a.appendChild(e),a.appendChild(t),a.appendChild(s),document.querySelector(this.scope_selector+".poncho-map").appendChild(a))};_removeTooltips=()=>{let t=this;this.map.eachLayer(function(e){"tooltipPane"===e.options.pane&&e.removeFrom(t.map)})};_showSlider=e=>{this._removeTooltips(),e.hasOwnProperty("_latlng")?this.map.setView(e._latlng,this.map_anchor_zoom):this.fit_bounds_onevent&&this.map.fitBounds(e.getBounds().pad(.005)),e.fireEvent("click")};_showPopup=e=>{e.hasOwnProperty("_latlng")?this.markers.zoomToShowLayer(e,()=>{e.openPopup()}):(this.map.fitBounds(e.getBounds().pad(.005)),e.openPopup())};removeHash=()=>history.replaceState(null,null," ");hasHash=()=>{return window.location.hash.replace("#","")||!1};gotoHashedEntry=()=>{var e=this.hasHash();e&&this.gotoEntry(e)};gotoEntry=t=>{const s=this.entry(t),a=(e,t,s)=>{e.options.hasOwnProperty("id")&&e.options.id==t&&(this._setSelectedMarker(t,e),this.hash&&this.addHash(t),this.slider?this._showSlider(e,s):this._showPopup(e))};this.markers.eachLayer(e=>a(e,t,s)),this.map.eachLayer(e=>{e.hasOwnProperty("feature")&&"Point"!=e.feature.geometry.type&&a(e,t,s)})};_setClickeable=s=>{s.on("keypress click",t=>{document.querySelectorAll(".marker--active").forEach(e=>e.classList.remove("marker--active")),["_icon","_path"].forEach(e=>{t.sourceTarget.hasOwnProperty(e)&&t.sourceTarget[e].classList.add("marker--active")});var e=this.entries.find(e=>e?.properties&&e.properties[this.id]===s.options.id);this.setContent(e.properties)})};isFeature=e=>!!e.hasOwnProperty("feature");_clickeableFeatures=()=>{this.reset_zoom&&this.map.eachLayer(e=>{this.isFeature(e)&&"Point"!=e.feature.geometry.type&&"MultiPoint"!=e.feature.geometry.type&&"n"!=e?.feature?.properties["pm-interactive"]&&this._setClickeable(e)})};_clickeableMarkers=()=>{this.no_info||this.markers.eachLayer(this._setClickeable)};_urlHash=()=>{const t=e=>{e.on("click",()=>{this.addHash(e.options.id)})};this.markers.eachLayer(t),this.map.eachLayer(e=>{e.hasOwnProperty("feature")&&"Point"!=e.feature.geometry.type&&"MultiPoint"!=e.feature.geometry.type&&t(e)})};removeListElement=(e,t)=>{t=e.indexOf(t);return-1{if(!e.hasOwnProperty(this.title))return!1;var t=this.template_structure,s=!!t.hasOwnProperty("title")&&t.title,a=this.title||!1;if(t.hasOwnProperty("title")&&"boolean"==typeof t.title)return!1;if(!s&&!a)return!1;s=s||a;let r;t?.header?((a=document.createElement("div")).innerHTML=this._mdToHtml(t.header(this,e)),this.template_innerhtml&&(a.innerHTML=t.header(this,e)),r=a):((r=document.createElement("h2")).classList.add(...t.title_classlist),r.textContent=e[s]);a=document.createElement("header");return a.className="header",a.appendChild(r),a};_templateList=e=>{var t=this.template_structure,s=Object.keys(e);let a=s;if(t.hasOwnProperty("values")&&0{var t,s;return this.template_markdown&&this._markdownEnable()?(t=new showdown.Converter(this.markdown_options),s=secureHTML(e,this.allowed_tags),t.makeHtml((""+s).trim())):e};_markdownEnable=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter"));_templateMixing=r=>{if(this.template_structure.hasOwnProperty("mixing")&&0{var{values:e,separator:t=", ",key:s}=e;void 0===s&&this.errorMessage("Mixing requiere un valor en el atributo «key».","warning"),a[s]=e.map(e=>e in r?r[e]:e.toString()).filter(e=>e).join(t)}),Object.assign({},r,a)}return r};_setType=(e,t=!1,s=!1)=>"function"==typeof e?e(this,t,s):e;_lead=e=>{if(this.template_structure.hasOwnProperty("lead")){this.template_structure.lead.hasOwnProperty("key")||this.errorMessage("Lead requiere un valor en el atributo «key».","warning");var t,{key:s=!1,css:a="small",style:r=!1}=this.template_structure.lead;if(e[s].trim())return(t=document.createElement("p")).textContent=e[s],(s=this._setType(r,e))&&t.setAttribute("style",s),(r=this._setType(a,e))&&t.classList.add(...r.split(" ")),t}};_termIcon=(e,t)=>{var s=this.header_icons.find(e=>e.key==t);if(s){var{css:s=!1,style:a=!1,html:r=!1}=s,r=this._setType(r,e,t),a=this._setType(a,e,t),s=this._setType(s,e,t);if(s)return(e=document.createElement("i")).setAttribute("aria-hidden","true"),e.classList.add(...s.split(" ")),a&&e.setAttribute("style",a),e;if(r)return(s=document.createElement("template")).innerHTML=r,s.content}return!1};defaultTemplate=(e,t)=>{t=this._templateMixing(t);var s,a,r=this["template_structure"],i=this._templateList(t),o=this._templateTitle(t),n=document.createElement("article"),l=(n.classList.add(...r.container_classlist),document.createElement(r.definition_list_tag));l.classList.add(...r.definition_list_classlist),l.style.fontSize="1rem";for(const c of i)t.hasOwnProperty(c)&&t[c]&&((s=document.createElement(r.term_tag)).classList.add(...r.term_classlist),(a=this._termIcon(t,c))&&(s.appendChild(a),s.insertAdjacentText("beforeend"," ")),s.insertAdjacentText("beforeend",this.header(c)),(a=document.createElement(r.definition_tag)).classList.add(...r.definition_classlist),a.textContent=t[c],this.template_markdown?a.innerHTML=this._mdToHtml(t[c]):this.template_innerhtml&&(a.innerHTML=secureHTML(t[c],this.allowed_tags)),""!=this.header(c)&&l.appendChild(s),l.appendChild(a));i=this._lead(t);return i&&n.appendChild(i),o&&n.appendChild(o),n.appendChild(l),n.outerHTML};icon=(e="azul")=>new L.icon({iconUrl:"https://www.argentina.gob.ar/sites/default/files/"+`marcador-${e}.svg`,iconSize:[29,40],iconAnchor:[14,40],popupAnchor:[0,-37]});resetView=()=>this.map.setView(this.map_view,this.map_zoom);fitBounds=()=>{try{this.map.fitBounds(this.geojson.getBounds().pad(.005))}catch(e){}};_resetViewButton=()=>{this.reset_zoom&&(document.querySelectorAll(".js-reset-view"+this.scope_sufix).forEach(e=>e.remove()),document.querySelectorAll(this.scope_selector+" .leaflet-control-zoom-in").forEach(e=>{var t=document.createElement("i"),s=(t.classList.add("pmi","pmi-expand"),t.setAttribute("aria-hidden","true"),document.createElement("a"));s.classList.add("js-reset-view"+this.scope_sufix,"leaflet-control-zoom-reset"),s.href="#",s.title="Zoom para ver todo el mapa",s.setAttribute("role","button"),s.setAttribute("aria-label","Zoom para ver todo el mapa"),s.appendChild(t),s.onclick=e=>{e.preventDefault(),this.cleanState(),this.resetView()},e.after(s)}))};marker=e=>{var t;return this.marker_color&&"boolean"!=typeof this.marker_color?"string"==typeof this.marker_color?this.icon(this.marker_color):"string"==typeof this.marker_color(this,e)?(t=this.marker_color(this,e),this.icon(t)):"function"==typeof this.marker_color?this.marker_color(this,e):void 0:null};_clearLayers=()=>{this.markers.clearLayers(),this.map.eachLayer(e=>{this.isFeature(e)&&this.map.removeLayer(e)})};markersMap=e=>{var r=this;this._clearLayers(),this.geojson=new L.geoJson(e,{pointToLayer:function(e,t){var e=e["properties"],s=r.marker(e),a={},s=(a.id=e[r.id],s&&(a.icon=s),r.title&&(a.alt=e[r.title]),new L.marker(t,a));return r.map.options.minZoom=r.min_zoom,r.markers.addLayer(s),r.tooltip&&e[r.title]&&s.bindTooltip(e[r.title],r.tooltip_options),r.no_info||r.slider||(t="function"==typeof r.template?r.template(r,e):r.defaultTemplate(r,e),s.bindPopup(t)),r.markers},onEachFeature:function(e,t){var{properties:s,geometry:a}=e;t.options.id=s[r.id],e.properties.name=s[r.title],r.tooltip&&s[r.title]&&"Point"!=a.type&&"MultiPoint"!=a.type&&t.bindTooltip(s[r.title],r.tooltip_options),r.no_info||r.slider||"Point"==a.type||"MultiPoint"==a.type||(e="function"==typeof r.template?r.template(r,s):r.defaultTemplate(r,s),t.bindPopup(e))},style:function(e){const s=e["properties"];e=(e,t=!1)=>s.hasOwnProperty(e)?s[e]:t||r.featureStyle[e];return{color:e("stroke-color",e("stroke")),strokeOpacity:e("stroke-opacity"),weight:e("stroke-width"),fillColor:e("stroke"),opacity:e("stroke-opacity"),fillOpacity:e("fill-opacity")}}}),this.geojson.addTo(this.map)};_setSelectedMarker=(e,t)=>{e={entry:this.entry(e),marker:t};return this.selected_marker=e};_selectedMarker=()=>{this.map.eachLayer(t=>{this.isFeature(t)&&t.on("click",e=>{this._setSelectedMarker(t.options.id,t)})})};_hiddenSearchInput=()=>{const t=document.createElement("input");t.type="hidden",t.name="js-search-input"+this.scope_sufix,t.setAttribute("disabled","disabled"),t.id="js-search-input"+this.scope_sufix,document.querySelectorAll(this.scope_selector+".poncho-map").forEach(e=>e.appendChild(t))};_setFetureAttributes=()=>{const t=(e,t)=>{e.hasOwnProperty(t)&&(e[t].setAttribute("aria-label",e?.feature?.properties?.[this.title]),e[t].setAttribute("tabindex",0),e[t].dataset.entryId=e?.feature?.properties?.[this.id],"n"==e?.feature?.properties?.["pm-interactive"]?(e[t].dataset.interactive="n",e[t].setAttribute("role","graphics-symbol")):e[t].setAttribute("role","button"),e[t].dataset.leafletId=e._leaflet_id)};this.map.eachLayer(e=>t(e,"_path"))};_accesibleAnchors=()=>{var e=[[this.scope_selector+" .leaflet-map-pane","leaflet-map-pane"+this.scope_sufix,[["role","region"]]],[this.scope_selector+" .leaflet-control-zoom","leaflet-control-zoom"+this.scope_sufix,[["aria-label","Herramientas de zoom"],["role","region"]]],[".js-themes-tool"+this.scope_sufix,"themes-tool"+this.scope_sufix,[["aria-label","Herramienta para cambiar de tema visual"],["role","region"]]]];return e.forEach(e=>{document.querySelectorAll(e[0]).forEach(t=>{t.id=e[1],e[2].forEach(e=>t.setAttribute(e[0],e[1]))})}),e};_accesibleMenu=()=>{document.querySelectorAll(this.scope_selector+" .pm-accesible-nav").forEach(e=>e.remove());var e=this._accesibleAnchors(),e=[...e=[{text:"Ir a los marcadores del mapa",anchor:"#"+e[0][1]},{text:"Ajustar marcadores al mapa",anchor:"#",class:"js-fit-bounds"},{text:"Ir al panel de zoom",anchor:"#"+e[1][1]},{text:"Cambiar de tema",anchor:"#"+e[2][1]}],...this.accesible_menu_filter,...this.accesible_menu_search,...this.accesible_menu_extras],t=document.createElement("i");t.classList.add("pmi","pmi-universal-access","accesible-nav__icon"),t.setAttribute("aria-hidden","true");const s=document.createElement("div"),a=(s.classList.add("pm-accesible-nav","top","pm-list"),s.id="pm-accesible-nav"+this.scope_sufix,s.setAttribute("aria-label","Menú para el mapa"),s.setAttribute("role","navigation"),s.tabIndex=0,document.createElement("ul"));a.classList.add("pm-list-unstyled"),e.forEach((e,t)=>{var s=document.createElement("a"),e=(s.classList.add("pm-item-link","pm-accesible"),s.textContent=e.text,s.tabIndex=0,s.href=e.anchor,e.hasOwnProperty("class")&&""!=e.class&&s.classList.add(...e.class.split(" ")),document.createElement("li"));e.appendChild(s),a.appendChild(e)}),s.appendChild(t),s.appendChild(a);e=document.createElement("a");e.textContent="Ir a la navegación del mapa",e.classList.add("pm-item-link","pm-accesible"),e.href="#pm-accesible-nav"+this.scope_sufix,e.id="accesible-return-nav"+this.scope_sufix;const r=document.createElement("div");r.classList.add("pm-accesible-nav","bottom"),r.appendChild(t.cloneNode(!0)),r.appendChild(e),document.querySelectorAll(""+this.scope_selector).forEach(e=>{e.insertBefore(s,e.children[0]),e.appendChild(r)}),this.fit()};fit=()=>document.querySelectorAll(this.scope_selector+" .js-fit-bounds").forEach(e=>{e.onclick=e=>{e.preventDefault(),this.fitBounds()}});clearAll=()=>{[".js-filter-container"+this.scope_sufix,".js-slider"+this.scope_sufix].forEach(e=>document.querySelectorAll(e).forEach(e=>e.remove()))};cleanState=()=>history.replaceState(null,null," ");render=()=>{this._hiddenSearchInput(),this._resetViewButton(),this._setThemes(),this.titleLayer.addTo(this.map),this.markersMap(this.entries),this._selectedMarker(),this.slider&&(this._renderSlider(),this._clickeableFeatures(),this._clickeableMarkers(),this._clickToggleSlider()),this.hash&&this._urlHash(),this.scroll&&this.hasHash()&&this.scrollCenter(),setTimeout(this.gotoHashedEntry,this.anchor_delay),this._setFetureAttributes(),this._accesibleMenu(),this.mapOpacity(),this.mapBackgroundColor()}}class PonchoMapLoader{constructor(e){e=Object.assign({},{selector:"",scope:"",timeout:5e4,cover_opacity:1,cover_style:{}},e);this.scope=e.scope,this.cover_opacity=e.cover_opacity,this.cover_style=e.cover_style,this.timeout=e.timeout,this.scope_sufix="--"+this.scope,this.scope_selector=`[data-scope="${this.scope}"]`,this.ponchoLoaderTimeout}close=()=>document.querySelectorAll(".js-poncho-map__loader"+this.scope_sufix).forEach(e=>e.remove());load=()=>{this.close(),clearTimeout(this.ponchoLoaderTimeout);var e=document.querySelector(".poncho-map"+this.scope_selector),t=document.createElement("span"),s=(t.className="loader",document.createElement("div"));s.dataset.scope=this.selector,s.classList.add("poncho-map__loader","js-poncho-map__loader"+this.scope_sufix),Object.assign(s.style,this.cover_style),this.cover_opacity&&(s.style.backgroundColor=`color-mix(in srgb, transparent, var(--pm-loader-background) ${100*this.cover_opacity.toString()}%)`),s.appendChild(t),e.appendChild(s),this.ponchoLoaderTimeout=setTimeout(this.remove,this.timeout)};loader=(e,t=500)=>{this.load(),setTimeout(()=>{e(),this.remove()},t)}}class PonchoMapFilter extends PonchoMap{constructor(e,t){super(e,t);e=Object.assign({},{filters:[],filters_visible:!1,filters_info:!1,search_fields:[],messages:{reset:' Restablecer mapa',initial:"Hay {{total_results}} puntos en el mapa.",no_results_by_term:"No encontramos resultados para tu búsqueda.",no_results:"No s + this.messages.resete encontraron entradas.",results:"{{total_results}} resultados coinciden con tu búsqueda.",one_result:"{{total_results}} resultado coincide con tu búsqueda.",has_filters:' Se están usando filtros.'}},t);this.filters=e.filters,this.filters_info=e.filters_info,this.filters_visible=e.filters_visible,this.valid_fields=["checkbox","radio"],this.search_fields=e.search_fields,this.messages=e.messages,this.accesible_menu_filter=[{text:"Ir al panel de filtros",anchor:"#filtrar-busqueda"+this.scope_sufix}]}tplParser=(e,a)=>Object.keys(a).reduce(function(e,t){var s=new RegExp("\\{\\{\\s{0,2}"+t+"\\s{0,2}\\}\\}","gm");return e=e.replace(s,a[t])},e);_helpText=e=>{var t=document.querySelectorAll(this.scope_selector+" .js-poncho-map__help");const a={total_results:e.length,total_entries:this.entries.length,total_filtered_entries:this.filtered_entries.length,filter_class:"js-close-filter"+this.scope_sufix,anchor:"#",term:this.inputSearchValue,reset_search:"js-poncho-map-reset"+this.scope_sufix};t.forEach(e=>{e.innerHTML="";var t=document.createElement("ul"),s=(t.classList.add("m-b-0","list-unstyled"),t.setAttribute("aria-live","polite"),e=>{var t=document.createElement("li");return t.innerHTML=e,t});a.total_entries===a.total_results?t.appendChild(s(this.tplParser(this.messages.initial,a))):a.total_results<1?t.appendChild(s(this.tplParser(this.messages.no_results_by_term+this.messages.reset,a))):""===this.inputSearchValue&&a.total_results<1?t.appendChild(s(this.tplParser(this.messages.no_results+this.messages.reset,a))):1==a.total_results?t.appendChild(s(this.tplParser(this.messages.one_result+this.messages.reset,a))):1{e=/^([\w\-]+?)(?:__([0-9]+))(?:__([0-9]+))?$/gm.exec(e);return e?[e[1],e[2]]:null};isFilterOpen=()=>document.querySelector(".js-poncho-map-filters"+this.scope_sufix).classList.contains("filter--in");toggleFilter=()=>{document.querySelector(".js-poncho-map-filters"+this.scope_sufix).classList.toggle("filter--in")};_filterContainerHeight=()=>{var e=document.querySelector(".js-filter-container"+this.scope_sufix),t=document.querySelector(".js-close-filter"+this.scope_sufix),s=e.offsetParent.offsetHeight,a=3*this._cssVarComputedDistance(),s=s-e.offsetTop-t.offsetHeight-a,e=document.querySelector(".js-poncho-map-filters"+this.scope_sufix),t=(e.style.maxHeight=s+"px",e.offsetHeight-45),a=document.querySelector(".js-filters"+this.scope_sufix);a.style.height=t+"px",a.style.overflow="auto"};_clickToggleFilter=()=>document.querySelectorAll(".js-close-filter"+this.scope_sufix).forEach(e=>e.onclick=e=>{e.preventDefault(),this.toggleFilter(),this._filterContainerHeight()});_setFilter=e=>{const[t,s="checked"]=e;e=this.entries.map(e=>{if(e.properties.hasOwnProperty(t))return e.properties[t]}).filter(e=>e),e=[...new Set(e)].map(e=>[t,e,[e],s]);return e.sort((e,t)=>{e=e[1].toUpperCase(),t=t[1].toUpperCase();return t{var{type:e="checkbox",fields:t=!1,field:s=!1}=e;t||s||this.errorMessage("Filters requiere el uso del atributo `field` o `fields`.","warning"),s&&"radio"===e&&(s[1]=!1);let a=t||this._setFilter(s);return"radio"===e&&!1===t&&(s=a.map(e=>e[1]),a=[[a[0][0],"Todos",s,"checked"],...a]),a};_fields=(e,t)=>{var s=document.createElement("div"),a=(s.classList.add("field-list","p-b-1"),this._fieldsToUse(e));for(const c in a){var r=a[c],i=document.createElement("input"),o=(i.type=this.valid_fields.includes(e.type)?e.type:"checkbox",i.id=`id__${r[0]}__${t}__`+c,"radio"==e.type?i.name=r[0]+"__"+t:i.name=r[0]+`__${t}__`+c,i.className="form-check-input",i.value=c,void 0!==r[3]&&"checked"==r[3]&&i.setAttribute("checked","checked"),document.createElement("label")),n=(o.style.marginLeft=".33rem",o.textContent=r[1],o.className="form-check-label",o.setAttribute("for",`id__${r[0]}__${t}__`+c),document.createElement("span")),r=(n.dataset.info=r[0]+`__${t}__`+c,o.appendChild(n),document.createElement("div"));r.className="form-check",r.appendChild(i),r.appendChild(o),s.appendChild(r)}var l=document.createElement("div");return l.appendChild(s),l};_filterButton=()=>{var e=document.createElement("i"),t=(e.setAttribute("aria-hidden","true"),e.classList.add("pmi","pmi-filter"),document.createElement("span")),s=(t.textContent="Abre o cierra el filtro de búsqueda",t.classList.add("pm-visually-hidden"),document.createElement("button")),e=(s.classList.add("pm-btn","pm-btn-rounded-circle","pm-my-1","js-close-filter"+this.scope_sufix),s.id="filtrar-busqueda"+this.scope_sufix,s.appendChild(e),s.appendChild(t),s.setAttribute("role","button"),s.setAttribute("aria-label","Abre o cierra el filtro de búsqueda"),s.setAttribute("aria-controls","poncho-map-filters"+this.scope_sufix),document.createElement("div"));e.classList.add("js-filter-container"+this.scope_sufix,"filter-container"),e.appendChild(s),document.querySelector(".poncho-map"+this.scope_selector).appendChild(e)};_cssVarComputedDistance=()=>{var e=document.querySelector(".poncho-map"),e=getComputedStyle(e).getPropertyValue("--pm-slider-distance");return parseInt(e.toString().replace(/[^0-9]*/gm,""))||0};_controlZoomSize=()=>{var e=document.querySelector(this.scope_selector+" .leaflet-control-zoom");return{controlHeight:e.offsetHeight,controlTop:e.offsetTop}};_filterContainer=()=>{var e=document.createElement("div"),t=(e.className="js-filters"+this.scope_sufix,document.createElement("button")),s=(t.classList.add("btn","btn-xs","btn-secondary","btn-close","js-close-filter"+this.scope_sufix),t.title="Cerrar panel",t.setAttribute("role","button"),t.setAttribute("aria-label","Cerrar panel de filtros"),t.innerHTML='Cerrar ✕',document.createElement("form"));s.classList.add("js-formulario"+this.scope_sufix),s.appendChild(t),s.appendChild(e);const a=document.createElement("div");a.classList.add("js-poncho-map-filters"+this.scope_sufix,"pm-container","poncho-map-filters","pm-caret","pm-caret-t"),a.setAttribute("role","region"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-label","Panel de filtros"),a.id="poncho-map-filters"+this.scope_sufix,this.filters_visible&&a.classList.add("filter--in");this._cssVarComputedDistance();t=this._controlZoomSize();const r=t.controlHeight+t.controlTop+"px";a.appendChild(s),document.querySelectorAll(".js-filter-container"+this.scope_sufix).forEach(e=>{e.style.top=r,e.appendChild(a)})};_checkUncheckButtons=e=>{var t=document.createElement("button"),s=(t.classList.add("js-select-items","select-items__button"),t.textContent="Marcar todos",t.dataset.field=e.field[0],t.dataset.value=1,document.createElement("button")),e=(s.classList.add("js-select-items","select-items__button"),s.textContent="Desmarcar todos",s.dataset.field=e.field[0],s.dataset.value=0,document.createElement("div"));return e.classList.add("select-items"),e.appendChild(t),e.appendChild(s),e};_createFilters=e=>{const r=document.querySelector(".js-filters"+this.scope_sufix);e.forEach((e,t)=>{var s=document.createElement("legend"),a=(s.textContent=e.legend,s.classList.add("m-b-1","color-primary","h6"),document.createElement("fieldset"));a.appendChild(s),e.hasOwnProperty("check_uncheck_all")&&e.check_uncheck_all&&"radio"!=e?.type&&a.appendChild(this._checkUncheckButtons(e)),a.appendChild(this._fields(e,t)),r.appendChild(a)})};formFilters=()=>{var e;return this.filters.length<1?[]:(e=document.querySelector(".js-formulario"+this.scope_sufix),e=new FormData(e),Array.from(e).map(e=>{var t=this._filterPosition(e[0]);return[parseInt(t[1]),parseInt(e[1]),t[0]]}))};defaultFiltersConfiguration=()=>{return this.filters.map((e,s)=>{return this._fieldsToUse(e).map((e,t)=>[s,t,e[0],"undefinded"!=typeof e[3]&&"checked"==e[3]])}).flat()};usingFilters=()=>{return this.defaultFiltersConfiguration().every(e=>document.querySelector(`#id__${e[2]}__${e[0]}__`+e[1]).checked)};_resetFormFilters=()=>{this.defaultFiltersConfiguration().forEach(e=>{document.querySelector(`#id__${e[2]}__${e[0]}__`+e[1]).checked=e[3]})};get inputSearchValue(){var e=document.querySelector("#js-search-input"+this.scope_sufix).value.trim();return""!==e&&e}_countOccurrences=(e,s,a)=>{return e.reduce((e,t)=>s.some(e=>t.properties[a].includes(e))?e+1:e,0)};totals=()=>{return this.formFilters().map(e=>{var t=this._fieldsToUse(this.filters[e[0]])[e[1]];return[t[1],this._countOccurrences(this.filtered_entries,t[2],t[0]),...e]})};_totalsInfo=()=>{if(!this.filters_info)return"";this.totals().forEach(e=>{var t=document.querySelector(""+this.scope_selector+` [data-info="${e[4]}__${e[2]}__${e[3]}"]`),s=e[1]<2?"":"s",a=document.createElement("i"),r=(a.style.cursor="help",a.style.opacity=".75",a.style.marginLeft=".5em",a.style.marginRight=".25em",a.classList.add("fa","fa-info-circle","small","text-info"),a.title=e[1]+" resultado"+s,a.setAttribute("aria-hidden","true"),document.createElement("span")),e=(r.className="pm-visually-hidden",r.style.fontWeight="400",r.textContent=e[1]+` elemento${s}.`,document.createElement("small"));e.appendChild(a),e.appendChild(r),t.appendChild(e)})};_validateEntry=(t,s)=>{var a=this.filters.length,r=[];for(let e=0;es.filter(e=>e[0]==t))(e)));return r.every(e=>e)};_search=(t,e,s)=>{const a=this._fieldsToUse(this.filters[e])[s];return a[2].filter(e=>e).some(e=>{if(t.hasOwnProperty(a[0]))return t[a[0]].includes(e)})};_validateGroup=(t,e)=>{return e.map(e=>this._search(t,e[0],e[1])).some(e=>e)};_filterData=()=>{var e=this.formFilters(),t=this.entries.filter(e=>this._validateEntry(e.properties,this.formFilters())),t=this.searchEntries(this.inputSearchValue,t);return t=this.filters.length<1||0{e=void 0!==e?this.entries:this._filterData(),this.markersMap(e),this._selectedMarker(),this._helpText(e),this._resetSearch(),this._clickToggleFilter(),this.slider&&(this._renderSlider(),this._clickeableMarkers(),this._clickeableFeatures(),this._clickToggleSlider()),this.hash&&this._urlHash(),this._setFetureAttributes(),this._accesibleMenu()};_clearSearchInput=()=>document.querySelectorAll("#js-search-input"+this.scope_sufix).forEach(e=>e.value="");_resetSearch=()=>{document.querySelectorAll(".js-poncho-map-reset"+this.scope_sufix).forEach(e=>{e.onclick=e=>{e.preventDefault(),this._resetFormFilters(),this._filteredData(this.entries),this._clearSearchInput(),this.resetView()}})};filterChange=t=>document.querySelectorAll(".js-filters"+this.scope_sufix).forEach(e=>{e.onchange=t});checkUncheckFilters=()=>{document.querySelectorAll(this.scope_selector+" .js-select-items").forEach(t=>{t.onclick=e=>{e.preventDefault(),document.querySelectorAll(`${this.scope_selector} [id^=id__${t.dataset.field}]`).forEach(e=>{e.checked=parseInt(t.dataset.value)}),this._filteredData()}})};render=()=>{this._hiddenSearchInput(),this._resetViewButton(),this._menuTheme(),this._setThemes(),0{e.preventDefault(),this._filteredData()}),setTimeout(this.gotoHashedEntry,this.anchor_delay),this.filters_visible&&this._filterContainerHeight(),this.mapOpacity(),this.mapBackgroundColor()}}class PonchoMapSearch{constructor(e,t){var s={scope:!1,placeholder:"Su búsqueda",search_fields:e.search_fields,sort:!0,sort_reverse:!1,sort_key:"text",datalist:!0},s=(this.instance=e,Object.assign({},s,t));this.text=e.title||!1,this.datalist=s.datalist,this.placeholder=s.placeholder,this.scope=s.scope,this.scope_sufix="--"+this.scope,this.sort=s.sort,this.sort_reverse=s.sort_reverse,this.search_scope_selector=this.scope?`[data-scope="${this.scope}"]`:"",this.instance.search_fields=s.search_fields,this.instance.accesible_menu_search=[{text:"Hacer una búsqueda",anchor:"#id-poncho-map-search"+this.scope_sufix}]}sortData=(e,a)=>{e=e.sort((e,t)=>{var s=e=>{this.instance.removeAccents(e).toUpperCase()};return s(e[a]),s(t[a]),s(e[a]),s(t[a]),0});return this.sort_reverse?e.reverse():e};_triggerSearch=()=>{const t=document.querySelector(this.search_scope_selector+" .js-poncho-map-search__input");t.id="id-poncho-map-search"+this.scope_sufix,document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__submit").forEach(e=>{e.onclick=e=>{e.preventDefault();document.querySelector("#js-search-input"+this.instance.scope_sufix).value=t.value;e=t.value;this._renderSearch(e)}})};_keyup=()=>{document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__input").forEach(e=>{const t=document.querySelector("#js-search-input"+this.instance.scope_sufix);e.onkeyup=()=>{t.value=e.value},e.onkeydown=()=>{t.value=e.value}})};_placeHolder=()=>{if(!this.placeholder)return"";document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__input").forEach(e=>e.placeholder=this.placeholder.toString())};_renderSearch=e=>{var t=this.instance._filterData();this.instance.markersMap(t),this.instance.slider&&(this.instance._renderSlider(),this.instance._clickeableFeatures(),this.instance._clickeableMarkers(),this.instance._clickToggleSlider()),this.instance.hash&&this.instance._urlHash(),this.instance.resetView(),1==t.length?this.instance.gotoEntry(t[0].properties[this.instance.id]):""!=e.trim()&&(this.instance.removeHash(),setTimeout(this.instance.fitBounds,this.instance.anchor_delay)),this.instance._helpText(t),this.instance._resetSearch(),this.instance._clickToggleFilter(),this.instance._setFetureAttributes(),this.instance._accesibleMenu()};_addDataListOptions=()=>{if(!this.datalist)return null;document.querySelectorAll(this.search_scope_selector+" .js-porcho-map-search__list,"+` ${this.search_scope_selector} .js-poncho-map-search__list`).forEach(s=>{s.innerHTML="";var e=document.querySelector(this.search_scope_selector+" .js-poncho-map-search__input"),t="id-datalist"+this.scope_sufix;e.setAttribute("list",t),s.id=t,this.instance.filtered_entries.forEach(e=>{var t;e.properties[this.text]&&s.appendChild((e=e.properties[this.text],(t=document.createElement("option")).value=e,t))})})};_searchRegion=()=>{var e=document.querySelector(this.search_scope_selector);e.setAttribute("role","region"),e.setAttribute("aria-label","Buscador")};render=()=>{this._placeHolder(),this._triggerSearch(),this._addDataListOptions(),this.instance.filterChange(e=>{e.preventDefault(),this.instance._filteredData(),this._addDataListOptions()}),this._searchRegion(),this._keyup(),this.instance._accesibleMenu()}}const PONCHOMAP_GEOJSON_PROVINCES="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geo-provincias-argentinas.json",ponchoMapProvinceMergeData=(a={},r={},i="provincia")=>{if(a.hasOwnProperty("features"))return a.features.forEach((t,e)=>{var s=r.find(e=>e[i]==t.properties.fna||e[i]==t.properties.nam);!s&&t.properties.fna?delete a.features[e]:(s?.color&&!t.properties["pm-type"]&&(a.features[e].properties.stroke=ponchoColor(s.color)),"n"===t.properties["pm-interactive"]&&"n"!==s?.["pm-interactive"]&&delete s["pm-interactive"],Object.assign(a.features[e].properties,s))}),a;throw new Error("Invalid data format")},ponchoMapProvinceCssStyles=e=>{e||document.querySelectorAll(".poncho-map-province__toggle-map,.poncho-map-province__toggle-element").forEach(e=>{e.classList.remove("poncho-map-province__toggle-map","poncho-map-province__toggle-element")})};class PonchoMapProvinces extends PonchoMapFilter{constructor(e,t,s){s=Object.assign({},{initial_entry:!1,random_entry:!1,overlay_image:!0,overlay_image_bounds:[[-20.56830872133435,-44.91768177759874],[-55.861359445914566,-75.2246121480093]],overlay_image_opacity:.8,overlay_image_url:"https://www.argentina.gob.ar/sites/default/files/map-shadow.png",hide_select:!0,province_index:"provincia",fit_bounds:!0,map_view:[-40.47815508388363,-60.0045383246273],map_init_options:{zoomSnap:.2,zoomControl:!0,doubleClickZoom:!1,scrollWheelZoom:!1,boxZoom:!1},map_zoom:4.4,tooltip_options:{permanent:!1,className:"leaflet-tooltip-own",direction:"auto",offset:[0,-3],sticky:!0,opacity:1},tooltip:!0,slider:!0},s),ponchoMapProvinceCssStyles(s.hide_select),e=ponchoMapProvinceMergeData(e,t,s.province_index);super(e,s),this.initialEntry=s.initial_entry,this.randomEntry=s.random_entry,this.overlayImage=s.overlay_image,this.overlayImageUrl=s.overlay_image_url,this.overlayImageBounds=s.overlay_image_bounds,this.overlayImageOpacity=s.overlay_image_opacity,this.mapView=s.map_view,this.hideSelect=s.hide_select,this.fitToBounds=s.fit_bounds}sortObject=(e,s=0)=>e.sort((e,t)=>{e=e[s].toUpperCase(),t=t[s].toUpperCase();return te[Math.floor(Math.random()*e.length)][0];_provincesFromGeoJSON=(e,a)=>{let r={};return e.features.map(e=>{var{name:t=!1,"pm-interactive":s=!1}=e.properties;if("n"===s||!t)return!1;r[e.properties[a]]=t}).filter(e=>e),this.sortObject(Object.entries(r),1)};_selectedEntry=e=>{var t=window.location.hash.replace("#","");let s="";return t?s=t:this.initialEntry?s=this.initialEntry:this.randomEntry&&(s=this._randomEntry(e)),s};_setSelectProvinces=e=>{window.location.hash.replace("#","");e=this._provincesFromGeoJSON(e.geoJSON,e.id);const s=this._selectedEntry(e),a=document.getElementById("id_provincia");return[["","Elegí una provincia"],...e].forEach(e=>{var t=document.createElement("option");e[0]===s&&t.setAttribute("selected","selected"),t.value=e[0],t.textContent=e[1],a.appendChild(t)}),{object:a,selected:s}};_selectedPolygon=e=>{e.map.eachLayer(e=>{e.on("keypress click",e=>{e?.target?.feature?.properties&&(e=e.target.feature.properties["id"],document.getElementById("id_provincia").value=e)})})};_selectProvinces=t=>{this._selectedPolygon(t);const s=this._setSelectProvinces(t);s.selected&&t.gotoEntry(s.selected),s.object.addEventListener("change",e=>{t.gotoEntry(e.target.value),e.value=s.selected})};_overlayImage=()=>{this.overlayImage&&L.imageOverlay(this.overlayImageUrl,this.overlayImageBounds,{opacity:this.overlayImageOpacity}).addTo(this.map)};renderProvinceMap=()=>{this._overlayImage(),this.render(),this.fitToBounds&&this.fitBounds(),this._selectProvinces(this)}}class GapiSheetData{constructor(e){e=Object.assign({},{gapi_key:"AIzaSyCq2wEEKL9-6RmX-TkW23qJsrmnFHFf5tY",gapi_uri:"https://sheets.googleapis.com/v4/spreadsheets/"},e);this.gapi_key=e.gapi_key,this.gapi_uri=e.gapi_uri}url=(e,t,s)=>{return["https://sheets.googleapis.com/v4/spreadsheets/",t,"/values/",e,"?key=",void 0!==s?s:this.gapi_key,"&alt=json"].join("")};json_data=e=>{e=this.feed(e);return{feed:e,entries:this.entries(e),headers:this.headers(e)}};feed=(e,i=!0)=>{const o=e.values[0],n=/ |\/|_/gi;let l=[];return e.values.forEach((e,t)=>{if(0{const a=s?"filtro-":"";s=Object.entries(e);let r={};return s.map(e=>{return r[e[0].replace("gsx$","").replace(a,"").replace(/-/g,t)]=e[1].$t}),r};entries=e=>e.filter((e,t)=>0e.find((e,t)=>0==t)}"undefined"!=typeof exports&&(module.exports=GapiSheetData);class TranslateHTML{ATTRIBUTES=["title","placeholder","alt","value","href","src","html.lang"];constructor(e=[],t=[]){this.dictionary=this.sortByLength(e),this.attributes=t.length?t:this.ATTRIBUTES}sortByLength=e=>(e.sort((e,t)=>e[0].length>t[0].length?-1:e[0].length{const t=e||this.dictionary;this.attributes.forEach(e=>{e=e.split(".").slice(-2);const s=2===e.length?e[0]:"",a=2===e.length?e[1]:e[0];t.forEach(t=>{document.querySelectorAll(`${s}[${a}='${t[0]}']`).forEach(e=>e[a]=t[1])})})};translateHTML=(s,a)=>{for(var e,t=document.evaluate("//*/text()",document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),r=[];e=t.iterateNext();)r.push(e);r.forEach(e=>{var t=e.textContent.replace(s,a);t!==e.textContent&&(t=document.createTextNode(t),e.parentNode.replaceChild(t,e))})};translate=()=>{this.dictionary.forEach(e=>{var t=new RegExp(e[0],"g");this.translateHTML(t,e[1])})}} \ No newline at end of file +const ponchoColorDefinitionsList=[{description:"",scope:"",name:"Blanco",color:"#FFFFFF",code:"white",alias:["white"]},{description:"",scope:"",name:"Gris base",color:"#333333",code:"gray-base",alias:["gray-base"]},{description:"",scope:"brand",name:"Azul",color:"#242C4F",code:"azul",alias:["azul"]},{description:"",scope:"brand",name:"Azul",color:"#242C4F",code:"primary",alias:["azul","primary"]},{description:"Acción principal o exitosa",scope:"brand",name:"Verde",color:"#2E7D33",code:"success",alias:["verde","success"]},{description:"Atención o peligro",scope:"brand",name:"Rojo",color:"#C62828",code:"danger",alias:["rojo","danger"]},{description:"Foco o alerta",scope:"brand",name:"Amarillo",color:"#E7BA61",code:"warning",alias:["amarillo","warning"]},{description:"",scope:"brand",name:"Celeste",color:"#3e5a7e",code:"info",alias:["celeste","info"]},{description:"Elementos básicos",scope:"brand",name:"Negro",color:"#333333",code:"black",alias:["negro","black"]},{description:"Enlace visitado",scope:"brand",name:"Uva",color:"#6A1B99",code:"uva",alias:["uva"]},{description:"Texto secundario (subtitulos)",scope:"brand",name:"Gris",color:"#525252",code:"muted",alias:["gris","muted"]},{description:"Gris área",scope:"",name:"Gris intermedio",color:"#555555",code:"gray",alias:["grisintermedio","gris-area","gray"]},{description:"Fondo footer/header",scope:"brand",name:"Celeste Argentina",color:"#37BBED",code:"celeste-argentina",alias:["celesteargentina","celeste-argentina"]},{description:"",scope:"brand",name:"Fucsia",color:"#EC407A",code:"fucsia",alias:["fucsia"]},{description:"",scope:"brand",name:"Arándano",color:"#C2185B",code:"arandano",alias:["arandano"]},{description:"",scope:"brand",name:"Cielo",color:"#039BE5",code:"cielo",alias:["cielo"]},{description:"",scope:"brand",name:"Verdin",color:"#6EA100",code:"verdin",alias:["verdin"]},{description:"",scope:"brand",name:"Lima",color:"#CDDC39",code:"lima",alias:["lima"]},{description:"",scope:"brand",name:"Maiz",color:"#FFCE00",code:"maiz",alias:["maiz","maíz"]},{description:"",scope:"brand",name:"Tomate",color:"#EF5350",code:"tomate",alias:["tomate"]},{description:"",scope:"brand",name:"Naranja oscuro",color:"#EF6C00",code:"naranja",alias:["naranjaoscuro","naranja"]},{description:"",scope:"brand",name:"Verde azulado",color:"#008388",code:"verde-azulado",alias:["verdeazulado","verde-azulado"]},{description:"",scope:"brand",name:"Escarapela",color:"#2CB9EE",code:"escarapela",alias:["escarapela"]},{description:"",scope:"brand",name:"Lavanda",color:"#9284BE",code:"lavanda",alias:["lavanda"]},{description:"",scope:"brand",name:"Mandarina",color:"#F79525",code:"mandarina",alias:["mandarina"]},{description:"",scope:"brand",name:"Palta",color:"#50B7B2",code:"palta",alias:["palta"]},{description:"",scope:"brand",name:"Cereza",color:"#ED3D8F",code:"cereza",alias:["cereza"]},{description:"",scope:"brand",name:"Limón",color:"#D7DF23",code:"limon",alias:["limon"]},{description:"",scope:"brand",name:"Verde Jade",color:"#006666",code:"verde-jade",alias:["verdejade","verde-jade"]},{description:"",scope:"brand",name:"Verde Aloe",color:"#4FBB73",code:"verde-aloe",alias:["verdealoe","verde-aloe"]},{description:"",scope:"brand",name:"Verde Cemento",color:"#B4BEBA",code:"verde-cemento",alias:["verdecemento","verde-cemento"]},{description:"",scope:"",name:"Gray dark",color:"#444444",code:"gray-dark",alias:["gray-dark"]},{description:"",scope:"",name:"Gray border",color:"#DEE2E6",code:"gray-border",alias:["gray-border"]},{description:"",scope:"",name:"Gray hover",color:"#E9E9E9",code:"gray-hover",alias:["gray-hover"]},{description:"",scope:"",name:"gray hover light",color:"#F0F0F0",code:"gray-hover-light",alias:["gray-hover-light"]},{description:"",scope:"",name:"gray background",color:"#FFFFFF",code:"gray-background",alias:["gray-background"]},{description:"",scope:"",name:"Gray light",color:"#DDDDDD",code:"gray-light",alias:["gray-light"]},{description:"",scope:"",name:"Gray lighter",color:"#F2F2F2",code:"gray-lighter",alias:["gray-lighter"]},{description:"",scope:"brand",name:"Default",color:"#838383",code:"default",alias:["default"]},{description:"",scope:"brand",name:"Primary alt",color:"#242C4F",code:"primary-alt",alias:["primary-alt"]},{description:"",scope:"brand",name:"Primary light",color:"#F3FAFF",code:"primary-light",alias:["primary-light"]},{description:"",scope:"brand",name:"Secondary",color:"#45658D",code:"secondary",alias:["secondary"]},{description:"",scope:"brand",name:"Complementary",color:"#EF5350",code:"complementary",alias:["complementary"]},{description:"",scope:"brand",name:"Azul marino",color:"#242C4F",code:"azul-marino",alias:["azul-marino"]},{description:"",scope:"brand",name:"Amarillo intenso",color:"#E7BA61",code:"amarillo-intenso",alias:["amarillo-intenso"]}],colorVariations={high:["primary","verde-jade","success","naranja","danger","arandano","uva","celeste-argentina","palta","verdin","warning","tomate","fucsia","lavanda","black"],medium:["info","verde-azulado","verdin","warning","tomate","fucsia","lavanda","palta","lima","maiz","muted"]},ponchoColorDefinitions=t=>{return ponchoColorDefinitionsList.find(e=>e.alias.some(e=>null!=typeof t&&e==t))||!1},ponchoColor=e=>{var t="#99999";return"string"==typeof e&&(e=ponchoColorDefinitions(e))&&e.color||t},cleanUpHex=e=>{let t=e.toString().replace("#","").trim().toUpperCase();return!(t.length<3||6e.repeat(2)).join(""):t)},ponchoColorByHex=t=>ponchoColorDefinitionsList.find(e=>{return cleanUpHex(t)==cleanUpHex(e.color)});async function fetch_json(e,t={}){t=Object.assign({},{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"},redirect:"follow"},t),e=await fetch(e,t);if(e.ok)return e.json();throw new Error("HTTP error! status: "+e.status)}"undefined"!=typeof exports&&(module.exports={ponchoColorDefinitionsList:ponchoColorDefinitionsList,ponchoColorDefinitions:ponchoColorDefinitions,ponchoColor:ponchoColor,ponchoColorByHex:ponchoColorByHex,cleanUpHex:cleanUpHex});const replaceSpecialChars=e=>{if(!e)return"";var t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż",s="aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz";const a=t+t.toUpperCase(),r=s+s.toUpperCase();t=new RegExp(a.split("").join("|"),"g");return e.toString().replace(t,e=>r.charAt(a.indexOf(e)))},slugify=e=>{if(!e)return e;const t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;";var s=new RegExp(t.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,"-").replace(s,e=>"aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------".charAt(t.indexOf(e))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},secureHTML=("undefined"!=typeof exports&&(module.exports={slugify:slugify,replaceSpecialChars:replaceSpecialChars}),(e,t=[])=>{var s;return!t.some(e=>"*"===e)&&(e=e.toString().replace(//g,">"),0").replace(t,"")):e}),headStyle=("undefined"!=typeof exports&&(module.exports={secureHTML:secureHTML}),(s,a)=>{if("string"==typeof s&&""!==s.trim()||(s="argob-custom-css"),"string"==typeof a&&""!=a.trim()){var e=document.getElementById(s);if(null!==e){if(e.textContent.trim()===a.trim())return;e.remove()}document.querySelectorAll("head").forEach(e=>{var t=document.createElement("style");t.setAttribute("rel","stylesheet"),t.id=s,t.textContent=a,e.appendChild(t)})}});function flattenNestedObjects(e){return e.map(e=>flattenObject(e,""))}function flattenObject(e,t){var s={};for(const i in e){var a=e[i],r=t?t+"__"+i:i;"object"==typeof a&&null!==a?Object.assign(s,flattenObject(a,r)):s[r]=a}return s}function ponchoTable(e){return ponchoTableLegacyPatch(),ponchoTableDependant(e)}"undefined"!=typeof exports&&(module.exports={flattenObject:flattenObject,flattenNestedObjects:flattenNestedObjects}),ponchoTableLegacyPatch=()=>{document.querySelectorAll("select[id=ponchoTableFiltro]").forEach(e=>{var e=e.parentElement,t=document.createElement("div");t.id="ponchoTableFiltro",t.classList.add("row"),e.parentElement.appendChild(t),e.remove()})};class PonchoAgenda{DATE_REGEX=/^([1-9]|0[1-9]|[1-2][0-9]|3[0-1])\/([1-9]|0[1-9]|1[0-2])\/([1-9][0-9]{3})$/;constructor(e={}){e.headers=this._refactorHeaders(e),e.headersOrder=this._refactorHeadersOrder(e),this.opts=Object.assign({},this.defaults,e),this.categoryTitleClassList=this.opts.categoryTitleClassList,this.itemContClassList=this.opts.itemContClassList,this.itemClassList=this.opts.itemClassList,this.groupCategory=this.opts.groupCategory,this.dateSeparator=this.opts.dateSeparator,this.startDateId=this.opts.startDateId,this.endDateId=this.opts.endDateId,this.timeId=this.opts.timeId,this.descriptionId=this.opts.descriptionId,this.criteriaOneId=this.opts.criteriaOneId,this.criteriaTwoId=this.opts.criteriaTwoId,this.criteriaThreeId=this.opts.criteriaThreeId}defaults={allowedTags:["strong","span","dl","dt","dd","img","em","button","button","p","div","h3","ul","li","time","a","h1"],criteriaOneId:"destinatarios",criteriaThreeId:"destacado",criteriaTwoId:"url",descriptionId:"descripcion",categoryTitleClassList:["h6","text-secondary"],itemContClassList:["list-unstyled"],itemClassList:["m-b-2"],dateSeparator:"/",filterStatus:{header:"Estado",nextDates:"Próximas",pastDates:"Anteriores"},endDateId:"hasta",groupCategory:"filtro-ministerio",rangeLabel:"Fechas",startDateId:"desde",timeId:"horario"};_refactorHeadersOrder=e=>{if(e.hasOwnProperty("headersOrder")&&0this.opts.headers.hasOwnProperty(e)?this.opts.headers[e]:e;_refactorHeaders=e=>{let t=this.defaults.filterStatus.header,s=(e?.filterStatus?.header&&(t=e.filterStatus.header),this.defaults.rangeLabel);return{range:s=e?.rangeLabel?e.rangeLabel:s,...e.headers,"filtro-status":t}};_isMarkdownEnable=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter"));_markdownOptions=()=>this._isMarkdownEnable()&&this.opts.hasOwnProperty("markdownOptions")&&"object"==typeof this.opts.markdownOptions?this.opts.markdownOptions:{};_markdownConverter=e=>{return this._isMarkdownEnable()?new showdown.Converter(this._markdownOptions()).makeHtml(e):e};_isPastDate=e=>{return!!this._isValidDateFormat(e)&&this._dateParser(e).date.getTime(){var{day:e,month:s,year:a}=e;let r="";return[e,s,a].join(this.dateSeparator)+(r=t?[hours,minutes].join(":"):r)};_currentDate=()=>{var e=new Date,t=e.getFullYear(),s=e.getMonth()+1,e=e.getDate(),e=[this._pad(e),this._pad(s),t].join(this.dateSeparator);return{...this._dateParser(e),format:e}};_pad=(e,t=2)=>e.toString().padStart(t,"0");_dateParser=(e,t="00:00:00")=>{var s,a;if(this._isValidDateFormat(e))return[,e,s,a]=this.DATE_REGEX.exec(e),t=new Date(a+`-${s}-${e} `+t),{day:this._pad(e),month:this._pad(s),year:a,hours:this._pad(t.getHours()),minutes:this._pad(t.getMinutes()),date:t}};_isValidDateFormat=e=>{return null!==this.DATE_REGEX.exec(e)};_groupByFingerprintAndCategory=e=>{var t={};for(const r of e){var s=r[this.groupCategory],a=r["fingerprint"];t[a]||(t[a]={}),t[a][s]||(t[a][s]=[]),t[a][s].push(r)}return t};_refactorEntries=e=>{let d=[];return e.forEach(e=>{var t=e[this.startDateId];let s=e[this.endDateId];s=""===s.trim()?t:s;var{pastDates:a,nextDates:r}=this.opts.filterStatus,a=this._isPastDate(s)?a:r,r=this._dateParser(t),i=this._dateParser(s),o=r.date.getTime(),n=i.date.getTime(),l=[o,n].join("_");let c=this._dateTimeFormat(r);o!=n&&(c=`Del ${this._dateTimeFormat(r)} al `+this._dateTimeFormat(i));o={...e,range:c,"filtro-status":a,fingerprint:l,desde:t,hasta:s};d.push(o)}),d};itemTemplate=(e,t,s,a,r,i)=>{const o=document.createElement("dl");let n;return i?(r=this._dateParser(r,i),(n=document.createElement("time")).setAttribute("datetime",r.date.toISOString()),n.textContent=r.hours+":"+r.minutes+"hs."):(n=document.createElement("span")).textContent="--:--",[["Descripción",this._markdownConverter(e),!0,!0,"description"],[this._header(this.criteriaOneId),this._markdownConverter(t),!1,!0,"criteria-one"],[this._header(this.criteriaThreeId),this._markdownConverter(a),!1,!0,"criteria-three"],[this._header(this.criteriaTwoId),this._markdownConverter(s),!1,!0,"criteria-two"],[this._header(this.timeId),n.outerHTML,!1,!0,"time"]].forEach(e=>{var t,[e,s,a,r,i]=e;s&&((t=document.createElement("dt")).textContent=e,t.classList.add("agenda-item__dt","agenda-item__dt-"+i),a&&t.classList.add("sr-only"),(e=document.createElement("dd")).textContent=s,e.classList.add("agenda-item__dd","agenda-item__dd-"+i),r&&o.appendChild(t),o.appendChild(e))}),this.itemClassList.some(e=>e)&&o.classList.add("agenda-item",...this.itemClassList),o};_groupedEntries=e=>{let i=[];return Object.values(e).forEach(e=>{var r;Object.values(e).forEach(e=>{var t="",s="";const a=document.createElement("div");this.itemContClassList.some(e=>e)&&a.classList.add(...this.itemContClassList),e.forEach(e=>{s!=(r=e)[this.groupCategory]&&(s=r[this.groupCategory],t=document.createElement("p"),this.categoryTitleClassList.some(e=>e))&&(t.classList.add(...this.categoryTitleClassList),t.textContent=s,a.appendChild(t));var t=this.itemTemplate(e.descripcion,e.destinatarios,e.url,e.destacados,e.desde,e.horario);a.appendChild(t)}),t+=a.outerHTML,delete r.fingerprint;e={};e[this.descriptionId]=t,i.push({...r,...e})})}),i};_ponchoTableExists=()=>void 0!==ponchoTable;render=()=>{var e;this.opts.hasOwnProperty("jsonData")&&(e=this._refactorEntries(this.opts.jsonData),e=this._groupByFingerprintAndCategory(e),this.opts.jsonData=this._groupedEntries(e),this._ponchoTableExists())&&ponchoTable(this.opts)}}"undefined"!=typeof exports&&(module.exports=PonchoAgenda);const ponchoTableDependant=c=>{var h,p=[],u=!(!c.hasOwnProperty("wizard")||!c.wizard),d=c.hasOwnProperty("emptyLabel")&&c.emptyLabel?c.emptyLabel:"Todos",m={},s=!(!c.hasOwnProperty("orderFilter")||!c.orderFilter),f={},_=["*"];let e={tables:!0,simpleLineBreaks:!0,extensions:["details","images","alerts","numbers","ejes","button","target","bootstrap-tables","video"]};document.querySelector("#ponchoTable").classList.add("state-loading"),jQuery.fn.DataTable.isDataTable("#ponchoTable")&&jQuery("#ponchoTable").DataTable().destroy();const y=(e,t)=>{return s?(t=t,e.toString().localeCompare(t.toString(),"es",{numeric:!0})):null},g=e=>[...new Set(e)],b=(e=0,t,s,a=!1)=>{var r=document.createElement("option");return r.value=s.toString().trim(),r.dataset.column=e,r.textContent=t.toString().trim(),a&&r.setAttribute("selected","selected"),r},v=(e="")=>e.toString().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=e=>e<=0?0:e,x=()=>[...document.querySelectorAll("[data-filter]")].map(e=>e.value),E=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter")),a=()=>c.hasOwnProperty("markdownOptions")&&"object"===c.markdownOptions?c.markdownOptions:e,k=t=>{if("string"==typeof t){if(!E())return t;let e;return a().extensions.every(e=>{try{return showdown.extension(e),!0}catch(e){return!1}})?(e=new showdown.Converter(a())).makeHtml(t):(e=new showdown.Converter).makeHtml(t)}},w=(e,t)=>{var s=document.createElement("a");return s.setAttribute("aria-label",e),s.classList.add("btn","btn-primary","btn-sm","margin-btn"),s.target="_blank",s.href=t,s.textContent=e,s.setAttribute("rel","noopener noreferrer"),s.outerHTML},S=e=>{var t=e.split("/"),t=new Date(t[2],t[1]-1,t[0]).toISOString().split("T")[0],s=document.createElement("span"),a=(s.style.display="none",s.textContent=t,document.createElement("time"));return a.setAttribute("datetime",t),a.textContent=e,s.outerHTML+a.outerHTML},T=e=>replaceSpecialChars(e.toLowerCase()),n=(n,l,c)=>{l=l==p.length?l-1:l;const d=x();var e=h.entries.flatMap(e=>{t=n,s=e,a=c,r=d;var t,s,a,r,i=[...Array(C(t+1)).keys()].map(e=>s[p[C(t-1)]]==r[C(t-1)]&&s[p[C(t)]]==a||""==r[C(t-1)]).every(e=>e);if(e[p[C(l-1)]]==c&&i){const o=e[p[C(l)]];return j(l,m)?L(l).filter(e=>T(o).includes(T(e))):o}}).filter(e=>e),e=g(e);return e.sort(y),e},j=e=>{var t=Object.keys(m);return!!f.hasOwnProperty("filtro-"+t[e])},L=e=>{var t=Object.keys(m);return f.hasOwnProperty("filtro-"+t[e])?f["filtro-"+t[e]]:[]},r=(t,a)=>{var r=Object.keys(m);const i=x();for(let s=t+1;s<=r.length&&r.length!=s;s++){let e=n(t,s,a);0==e.length&&(e=((s,a,r)=>{var e=h.entries.flatMap(e=>{const t=e[p[C(a)]];return(e[p[C(s)]]==r||""==r)&&(j(a,m)?L(a).filter(e=>T(t).includes(T(e))):t)}).filter(e=>e),e=g(e);return e.sort(y),e})(t,s,a));const o=document.querySelector("#"+r[s]);o.innerHTML="",o.appendChild(b(s,d,"",!0)),e.forEach(e=>{var t;e.trim()&&(t=i[s]==e,o.appendChild(b(s,e,e,t)))})}},o=()=>{return window.location.hash.replace("#","")||!1},A=(_hideTable=(e=!0)=>{const t=e?"none":"block",s=e?"block":"none";document.querySelectorAll('[data-visible-as-table="true"],#ponchoTable_wrapper').forEach(e=>e.style.display=t),document.querySelectorAll('[data-visible-as-table="false"]').forEach(e=>e.style.display=s)},()=>{var e=jQuery.fn.DataTable.ext.type.search;e.string=e=>e?"string"==typeof e?replaceSpecialChars(e):e:"",e.html=e=>e?"string"==typeof e?replaceSpecialChars(e.replace(/<.*?>/g,"")):e:"";let d=jQuery("#ponchoTable").DataTable({initComplete:(e,t)=>{u&&_hideTable()},lengthChange:!1,autoWidth:!1,pageLength:c.cantidadItems,columnDefs:[{type:"html-num",targets:c.tipoNumero},{targets:c.ocultarColumnas,visible:!1}],ordering:c.orden,order:[[c.ordenColumna-1,c.ordenTipo]],dom:'<"row"<"col-sm-6"l><"col-sm-6"f>><"row"<"col-sm-12"i>><"row"<"col-sm-12"tr>><"row"<"col-md-offset-3 col-md-6 col-sm-offset-2 col-sm-8"p>>',language:{sProcessing:"Procesando...",sLengthMenu:"Mostrar _MENU_ registros",sZeroRecords:"No se encontraron resultados",sEmptyTable:"Ningún dato disponible en esta tabla",sInfo:"_TOTAL_ resultados",sInfoEmpty:"No hay resultados",sInfoFiltered:"",sInfoPostFix:"",sSearch:"Buscar:",sUrl:"",sInfoThousands:".",sLoadingRecords:"Cargando...",oPaginate:{sFirst:"<<",sLast:">>",sNext:">",sPrevious:"<"},oAria:{sSortAscending:": Activar para ordenar la columna de manera ascendente",sSortDescending:": Activar para ordenar la columna de manera descendente",paginate:{first:"Ir a la primera página",previous:"Ir a la página anterior",next:"Ir a la página siguiente",last:"Ir a la última página"}}}});jQuery("#ponchoTableSearch").keyup(function(){d.search(jQuery.fn.DataTable.ext.type.search.string(this.value)).draw()}),jQuery("#ponchoTable_filter").parent().parent().remove(),1{e=document.querySelectorAll(e+" option");return Object.values(e).map(e=>e.value).some(e=>e)};if(jQuery("select[data-filter]").change(function(){var e=jQuery(this).find("option:selected").data("column"),t=jQuery(this).find("option:selected").val();r(e,t),d.columns().search("").columns().search("").draw();const i=Object.keys(m),o=x();if(o.forEach((e,t)=>{s=i[t];var s=Object.keys(h.headers).indexOf("filtro-"+s),a=v(o[t]),r=v(replaceSpecialChars(o[t]));j(t,m)?d.columns(s).search(T(o[t])):d.columns(s).search(o[t]?`^(${a}|${r})$`:"",!0,!1,!0)}),d.draw(),u){var[n,l=0,c=""]=[i,e,t];let r=!1;n.forEach((e,t)=>{var s=p("#"+e);let a="none";s&&c&&t<=l+1?a="block":s&&!c&&t<=l+1&&(document.querySelectorAll("#"+n[l+1]).forEach(e=>e.innerHTML=""),a="block",r=!1),document.querySelectorAll(`[data-filter-name="${e}"]`).forEach(e=>e.style.display=a)}),(r=p("#"+n[l])&&c&&!p("#"+n[l+1])?!0:r)?_hideTable(!1):_hideTable()}}),c.hasOwnProperty("hash")&&c.hash){e=o();const t=e?decodeURIComponent(e):"";document.querySelectorAll("#ponchoTableSearch").forEach(e=>{e.value=t,d.search(jQuery.fn.DataTable.ext.type.search.string(t)).draw()})}}),l=e=>{(h=e).entries="function"==typeof c.refactorEntries&&null!==c.refactorEntries?c.refactorEntries(h.entries):h.entries,h.headers=(c.hasOwnProperty("headers")&&c.headers?c:h).headers,h.headers=(e=>{if(c.hasOwnProperty("headersOrder")&&0e.startsWith("filtro-")),f=c.asFilter?c.asFilter(h.entries):{},m=((r,i)=>{let o={};return i.forEach((t,s)=>{let e=[];e=f.hasOwnProperty(i[s])?f[i[s]]:r.entries.map(e=>e[t]);var a=g(e);a.sort(y),t=t.replace("filtro-",""),o[t]=[],a.forEach(e=>{o[t].push({columna:s,value:e})})}),o})(h,p),c.hasOwnProperty("filterContClassList")&&c.filterContClassList&&((e=document.getElementById("ponchoTableFiltroCont")).removeAttribute("class"),e.classList.add(...c.filterContClassList)),c.hasOwnProperty("searchContClassList")&&c.searchContClassList&&((e=document.getElementById("ponchoTableSearchCont")).removeAttribute("class"),e.classList.add(...c.searchContClassList));{var o=h;(e=document.querySelector("#ponchoTable thead")).innerHTML="";const a=document.createElement("tr"),t=(Object.keys(o.headers).forEach((e,t)=>{var s=document.createElement("th");s.textContent=o.headers[e],s.setAttribute("scope","col"),a.appendChild(s)}),e.appendChild(a),(e=document.querySelector("#ponchoTable caption")).innerHTML="",e.textContent=c.tituloTabla,document.querySelector("#ponchoTable tbody"));t.innerHTML="",o.entries.forEach((r,e)=>{if(Object.values(r).some(e=>String(e).trim())){r="function"==typeof c.customEntry&&null!==c.customEntry?c.customEntry(r):r;const i=t.insertRow();i.id="id_"+e,Object.keys(o.headers).forEach(e=>{let t=r[e];e.startsWith("btn-")&&""!=t?(s=e.replace("btn-","").replace("-"," "),t=w(s,t)):e.startsWith("fecha-")&&""!=t&&(t=S(t));var s=i.insertCell();s.dataset.title=o.headers[e],""==t&&(s.className="hidden-xs");let a=c.hasOwnProperty("allowedTags")?c.allowedTags:_;e.startsWith("btn-")&&""!=t?a=[...a,"a"]:e.startsWith("fecha-")&&""!=t&&(a=[...a,"span","time"]);e=secureHTML(t,a);E()?s.innerHTML=k(e):s.innerHTML=e})}})}{var n=h;const l=document.querySelector("#ponchoTableFiltro");l.innerHTML="",Object.keys(m).forEach((e,t)=>{const s=m[e][0].columna||0;var a=m[e].map(e=>e.value).sort(y),r=document.createElement("div"),i=(c.hasOwnProperty("filterClassList")?(i="string"==typeof c.filterClassList?c.filterClassList.split(" "):c.filterClassList,r.classList.add(...i)):(i=Math.floor(12/Object.keys(m).length),r.classList.add("col-sm-12","col-md-"+i)),r.dataset.index=t,r.dataset.filterName=e,u&&0{e&&o.appendChild(b(s,e,e,!1))}),i.appendChild(t),i.appendChild(o),r.appendChild(i),l.appendChild(r)})}document.querySelector("#ponchoTableSearchCont").style.display="block",document.querySelector("#ponchoTable").classList.remove("state-loading"),A()},t=e=>{jQuery.getJSON(e,function(e){var t=new GapiSheetData;h=t.json_data(e),l(h)})};if(c.jsonData){var O=Object.fromEntries(Object.keys(c.jsonData[0]).map(e=>[e,e])),O={entries:c.jsonData,headers:O};l(O)}else if(c.jsonUrl)t(c.jsonUrl);else if(c.hojaNombre&&c.idSpread){O=(new GapiSheetData).url(c.hojaNombre,c.idSpread);t(O)}else{if(!c.hojaNumero||!c.idSpread)throw"¡Error! No hay datos suficientes para crear la tabla.";{var I=c.hojaNumero;const P=new GapiSheetData;O=["https://sheets.googleapis.com/v4/spreadsheets/",c.idSpread,"/?alt=json&key=",P.gapi_key].join("");jQuery.getJSON(O,function(e){e=e.sheets[I-1].properties.title,e=P.url(e,c.idSpread);t(e)})}}};var content_popover=document.getElementById("content-popover");function popshow(){content_popover.classList.toggle("hidden")}function pophidde(){content_popover.classList.add("hidden")}var ponchoUbicacion=function(e){var s,a,r,i,t="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geoprovincias.json",o="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geolocalidades.json",n=jQuery('input[name="submitted['+e.provincia+']"]'),l=jQuery('input[name="submitted['+e.localidad+']"]');function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(e,t,s,a=!1,r=!1,i=!1){var o=jQuery("").attr("id",t).attr("name",e).addClass("form-control form-select").prop("required",a);return r&&o.append(""),jQuery.each(s,function(e,t){let s="";i==t.nombre&&(s='selected="selected"'),o.append("")}),o}function p(e,t){var s=l.prop("required");return n.val()?d("sLocalidades","sLocalidades",e.filter(function(e){return String(e.provincia.id)==String(t)}).map(function(e){return e.departamento.nombre&&(e.nombre=c(e.departamento.nombre.toLowerCase())+" - "+c(e.nombre.toLowerCase())),e}).sort(function(e,t){e=e.nombre.toUpperCase(),t=t.nombre.toUpperCase();return e.localeCompare(t)}),s,emptyOption=!!l.val(),l.val()):d("sLocalidades","sLocalidades",[],s,!0,!1)}t=e.urlProvincias||t,o=e.urlLocalidades||o,jQuery.getJSON(t,function(e){var t;s=[],e.results.forEach(function(e,t){s.push(e)}),e=[],e=(t=s).sort(function(e,t){e=e.nombre.toUpperCase(),t=t.nombre.toUpperCase();return e.localeCompare(t)}),t=n.prop("required"),(r=d("sProvincias","sProvincias",e,t,!0,n.val())).on("change",function(e){var t;n.val(""),l.val(""),i.children("option:not(:first)").remove(),""!=r.val()&&(n.val(r.find(":selected").text()),t=p(a,r.val()).find("option"),i.append(t),i.val(""))}),n.after(r),jQuery(r).select2()}),jQuery.getJSON(o,function(e){a=[],e.results.forEach(function(e,t){a.push(e)}),(i=p(a,r.val())).on("change",function(e){l.val(""),""!=i.val()&&l.val(i.find(":selected").text())}),l.after(i),jQuery(i).select2()}),n.hide(),l.hide()};function ponchoChart(t){"use strict";var e;function _e(e){var t={Line:"line",Bar:"bar",Pie:"pie",Area:"line","Horizontal Bar":"horizontalBar","Stacked Bar":"bar",Mixed:"mixed",HeatMap:"heatmap",default:""};return t[e]||t.default}function ye(e){var e=e.toString().replace(".",","),t=e.split(","),s=new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(t[0]);return e=1{e=e.reduce((e,t)=>e+parseFloat(t.yLabel),0);return"Total: "+new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(e)+"%"}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}}}:"line"==L&&1{e=e.reduce((e,t)=>e+parseFloat(t.yLabel),0);return"Total: "+new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(e)}}}:{enabled:!0,mode:"index",intersect:!1,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}}},"pie"==L&&(Z.forEach(function(e,t,s){g.push(ponchoColor(e))}),t=f,j=C,z=L,o=g,s=a.idComponenteGrafico,N=S,G=E,n=T,s=document.getElementById(s),new Chart(s,{type:z,data:{labels:t,datasets:[{data:j,borderColor:o,backgroundColor:o,borderWidth:2}]},options:{legend:{display:n,position:N},responsive:!0,tooltips:G}})),1==x&&(s=ponchoColor(Z[0]),"Line"==a.tipoGrafico&&(z=f,j=C,o=L,n=s,N=b[0],G=a.ejeYenCero,l=a.idComponenteGrafico,c=S,R=E,U=T,l=document.getElementById(l),new Chart(l,{type:o,data:{labels:z,datasets:[{data:j,borderColor:n,backgroundColor:n,borderWidth:2,lineTension:0,fill:!1,label:N}]},options:{legend:{display:U,position:c},tooltips:R,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:G}}]}}})),"bar"!=L&&"Area"!=a.tipoGrafico||(l=f,j=C,U=L,c=s,R=b[0],q=a.ejeYenCero,r=a.idComponenteGrafico,i=S,H=E,B=T,r=document.getElementById(r),new Chart(r,{type:U,data:{labels:l,datasets:[{data:j,borderColor:c,backgroundColor:c,borderWidth:2,lineTension:0,label:R}]},options:{legend:{display:B,position:i},tooltips:H,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:q}}]}}})),"horizontalBar"==L)&&(r=f,j=C,B=L,i=s,H=b[0],q=a.ejeYenCero,O=a.idComponenteGrafico,re=S,ie=E,ee=T,O=document.getElementById(O),new Chart(O,{type:B,data:{labels:r,datasets:[{data:j,borderColor:i,backgroundColor:i,borderWidth:2,lineTension:0,label:H}]},options:{legend:{display:ee,position:re},tooltips:ie,responsive:!0,scales:{xAxes:[{ticks:{beginAtZero:q}}]}}})),1'+ce+": "+ne[t]+"
"+de+": "+a.globals.labels[s]+"
"+pe+": "+e+"
"}},plotOptions:{heatmap:{shadeIntensity:.5,radius:0,useFillColorAsStroke:!1,colorScale:{ranges:le}}},yaxis:{show:P},legend:{show:ue,position:he},responsive:[{breakpoint:1e3,options:{yaxis:{show:!1},legend:{show:ue,position:"top"}}}]}).render(),document.getElementsByClassName("apexcharts-toolbar"));for(let e=0;e{if(!e||!e.values||0===e.values.length)throw new TypeError("Invalid response format");if(!Array.isArray(e.values)||!Array.isArray(e.values[0]))throw new TypeError("Invalid response format: values should be arrays");const i=e.values[0],o=/ |\/|_/gi;let n=[];return e.values.forEach((e,t)=>{if(0Instituto Geográfico Nacional, OpenStreetMap'}),this.markers=new L.markerClusterGroup(this.marker_cluster_options),this.ponchoLoaderTimeout}mapOpacity=(e=!1)=>{const t=e||this.map_opacity;document.querySelectorAll(this.scope_selector+" .leaflet-pane .leaflet-tile-pane").forEach(e=>e.style.opacity=t)};mapBackgroundColor=(e=!1)=>{const t=e||this.map_background;document.querySelectorAll(this.scope_selector+" .leaflet-container").forEach(e=>e.style.backgroundColor=t)};_menuTheme=()=>{if(this.theme_tool){document.querySelectorAll("#themes-tool"+this.scope_sufix).forEach(e=>e.remove());const r=document.createElement("ul");r.classList.add("pm-list-unstyled","pm-list","pm-tools","js-themes-tool"+this.scope_sufix);var e=document.createElement("li"),t=(e.setAttribute("tabindex","-1"),e.dataset.toggle="true",document.createElement("i")),s=(t.setAttribute("aria-hidden","true"),t.classList.add("pmi","pmi-adjust"),document.createElement("button"));s.title="Cambiar tema",s.tabIndex="0",s.classList.add("pm-btn","pm-btn-rounded-circle"),s.appendChild(t),s.setAttribute("role","button"),s.setAttribute("aria-label","Abre el panel de temas");const i=document.createElement("ul");i.classList.add("pm-container","pm-list","pm-list-unstyled","pm-p-1","pm-caret","pm-caret-b","pm-toggle");var t=document.createElement("button"),a=(t.textContent="Restablecer",t.classList.add("pm-item-link","js-reset-theme"),document.createElement("li"));a.classList.add("pm-item-separator"),a.appendChild(t),i.appendChild(a),this.default_themes.map(e=>e[0]).forEach((e,t)=>{var s=document.createElement("button"),e=(s.dataset.theme=e,s.textContent=this.default_themes[t][1],s.classList.add("js-set-theme","pm-item-link"),document.createElement("li"));e.appendChild(s),i.appendChild(e)}),e.appendChild(s),e.appendChild(i),r.appendChild(e),document.querySelectorAll(this.scope_selector).forEach(e=>e.appendChild(r)),document.querySelectorAll(".js-reset-theme").forEach(e=>e.addEventListener("click",()=>{localStorage.removeItem("mapTheme"),this._removeThemes(),this._setThemes()})),document.querySelectorAll(".js-set-theme").forEach(t=>t.addEventListener("click",()=>{var e=t.dataset.theme;this.useTheme(e),localStorage.setItem("mapTheme",e)}))}};_setThemeStyles=(t=!1,e=["ui","map"])=>e.map(e=>!!["ui","map"].includes(e)&&e+"-"+t);_removeThemes=(s=["ui","map"])=>{document.querySelectorAll(this.scope_selector).forEach(t=>{[...this.default_themes,...this.temes_not_visibles].map(e=>e[0]).forEach(e=>{t.classList.remove(...this._setThemeStyles(e,s))})})};_setTheme=(t,s)=>{var e=document.querySelectorAll(this.scope_selector);this._removeThemes(s),e.forEach(e=>{e.classList.add(...this._setThemeStyles(t,s))})};useTheme=(e=!1)=>{e=e||this.theme;this._setTheme(e,["ui","map"])};useMapTheme=e=>this._setTheme(e,["map"]);useUiTheme=e=>this._setTheme(e,["ui"]);_setThemes=()=>{localStorage.hasOwnProperty("mapTheme")?this._setTheme(localStorage.getItem("mapTheme"),["ui","map"]):this.theme_ui||this.theme_map?(this.theme_ui&&this._setTheme(this.theme_ui,["ui"]),this.theme_map&&this._setTheme(this.theme_map,["map"])):this.useTheme()};_slugify=e=>slugify(e);isGeoJSON=e=>"FeatureCollection"===e?.type;get entries(){return this.data.features}get geoJSON(){return this.featureCollection(this.entries)}formatInput=e=>{e.length<1&&this.errorMessage("No se puede visualizar el mapa, el documento está vacío","warning");let t;return t=this.isGeoJSON(e)?e:(e=this.features(e),this.featureCollection(e)),this._setIdIfNotExists(t)};errorMessage=(e=!1,t="danger")=>{document.querySelectorAll("#js-error-message"+this.scope_sufix).forEach(e=>e.remove());const s=document.createElement("div");s.id="js-error-message"+this.scope_sufix,s.classList.add("poncho-map--message",t);var a=document.createElement("i"),r=(a.classList.add("icono-arg-mapa-argentina","poncho-map--message__icon"),document.createElement("h2"));r.classList.add("h6","title","pm-visually-hidden"),r.textContent="¡Se produjo un error!",s.appendChild(a),s.appendChild(r);throw[["En estos momentos tenemos inconvenientes para mostrar el mapa.","text-center"],["Disculpe las molestias","text-center","p"]].forEach(e=>{var t=document.createElement(void 0!==(t=e[2])||t?t:"p");void 0===e[1]&&!e[1]||(t.className=e[1]),t.innerHTML=e[0],s.appendChild(t)}),this.error_reporting&&((a=document.querySelector(this.scope_selector+".poncho-map")).parentNode.insertBefore(s,a),"danger"==t)&&document.getElementById(this.map_selector).remove(),e};feature=e=>{var t=e[this.latitude],s=e[this.longitude];return[t,s].forEach(e=>{isNaN(Number(e))&&this.errorMessage("El archivo contiene errores en la definición de latitud y longitud.\n "+e)}),delete e[this.latitude],delete e[this.longitude],{type:"Feature",properties:e,geometry:{type:"Point",coordinates:[s,t]}}};featureCollection=e=>({type:"FeatureCollection",features:e});features=e=>e.map(this.feature);_isIdMixing=()=>Array.isArray(this.id_mixing)&&0{var e;if(this._isIdMixing())return"function"==typeof this.id_mixing?this.id_mixing(this,t).join(""):(e=this.id_mixing.map(e=>t.properties[e]?t.properties[e].toString():e),this._slugify(e.join("-")))};_setIdIfNotExists=e=>{var t=e.features.filter((e,t)=>0===t).every(e=>e.properties.hasOwnProperty("id"));return!this._isIdMixing()&&t||(t=e.features.map((e,t)=>{var s;return this._isIdMixing()?e.properties.id=this._idMixing(e):(t=t+1,s=this.title&&e.properties[this.title]?this._slugify(e.properties[this.title]):"",e.properties.id=[t,s].filter(e=>e).join("-")),e}),e.features=t),e};addHash=e=>{"string"!=typeof e&&!e||!this.hash||this.no_info||(window.location.hash="#"+e)};entry=t=>this.entries.find(e=>!(!e?.properties||e.properties[this.id]!==t||"n"===e.properties?.["pm-interactive"]));searchEntries=(t,e)=>{return e=void 0===e?this.geoJSON:e,t?e.filter(e=>{if(this.searchEntry(t,e.properties))return e}):e};searchEntry=(e,t)=>{for(const r of[...new Set([this.title,...this.search_fields])].filter(e=>e))if(t.hasOwnProperty(r)){var s=replaceSpecialChars(e).toUpperCase(),a=replaceSpecialChars(t[r]).toString().toUpperCase();try{if(a.includes(s))return t}catch(e){}}return null};_selectorName=e=>e.replace(/^(\.|\#)/,"");scrollCenter=()=>{var e=document.getElementById(this.map_selector),t=e.getBoundingClientRect(),e=(e.offsetLeft+e.offsetWidth)/2,t=t.top+window.scrollY;window.scrollTo({top:t,left:e,behavior:"smooth"})};_clearContent=()=>document.querySelector(".js-content"+this.scope_sufix).innerHTML="";toggleSlider=()=>{this.no_info||(document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.classList.toggle(this.slider_selector+"--in")}),document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.style.display=this.isSliderOpen()?"block":"none"}))};_focusOnFeature=t=>{this.map.eachLayer(e=>{e?.options?.id==t&&(e?._path?e._path.focus():e?._icon&&e._icon.focus())})};_clickToggleSlider=()=>document.querySelectorAll(".js-close-slider"+this.scope_sufix).forEach(e=>e.addEventListener("click",()=>{this._clearContent(),this.toggleSlider(),this._focusOnFeature(e.dataset.entryId)}));isSliderOpen=()=>{let t=[];return document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.classList.contains(this.slider_selector+"--in")&&t.push(!0)}),t.some(e=>e)};setContent=t=>{if(!this.no_info){this._focusOnSlider(),this.isSliderOpen()||this.toggleSlider();const s="function"==typeof this.template?this.template(this,t):this.defaultTemplate(this,t);document.querySelectorAll(this.content_selector).forEach(e=>{e.innerHTML=s}),document.querySelectorAll(".js-close-slider"+this.scope_sufix).forEach(e=>{e.dataset.entryId=t[this.id]})}};_focusOnSlider=()=>{var e;this.no_info||(this.isSliderOpen()?document.querySelector(".js-close-slider"+this.scope_sufix).focus():(e=document.querySelector(".js-slider"+this.scope_sufix))&&e.addEventListener("animationend",()=>{document.querySelector(".js-close-slider"+this.scope_sufix).focus()}))};setHeaders=e=>{var t;return[this.template_structure,this.template_structure.mixing].every(e=>e)?(t=this.template_structure.mixing.reduce((e,t)=>{if([t.key].every(e=>e))return{...e,[t.key]:t.header||""}},{}),{...e,...t}):e};header=e=>this.headers.hasOwnProperty(e)?this.headers[e]:e;_renderSlider=()=>{var e,t,s,a;!this.render_slider||this.content_outside||this.no_info||(document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>e.remove()),(e=document.createElement("button")).classList.add("btn","btn-xs","btn-secondary","btn-close","js-close-slider"+this.scope_sufix),e.title="Cerrar panel",e.setAttribute("role","button"),e.setAttribute("aria-label","Cerrar panel de información"),e.innerHTML='Cerrar✕',(t=document.createElement("a")).setAttribute("tabindex",0),t.id="js-anchor-slider"+this.scope_sufix,(s=document.createElement("div")).classList.add("content-container"),(a=document.createElement("div")).classList.add("content","js-content"+this.scope_sufix),a.tabIndex=0,s.appendChild(a),(a=document.createElement("div")).style.display="none",a.setAttribute("role","region"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-label","Panel de información"),a.classList.add("pm-container","slider","js-slider"+this.scope_sufix),a.id="slider"+this.scope_sufix,a.appendChild(e),a.appendChild(t),a.appendChild(s),document.querySelector(this.scope_selector+".poncho-map").appendChild(a))};_removeTooltips=()=>{let t=this;this.map.eachLayer(function(e){"tooltipPane"===e.options.pane&&e.removeFrom(t.map)})};_showSlider=e=>{this._removeTooltips(),e.hasOwnProperty("_latlng")?this.map.setView(e._latlng,this.map_anchor_zoom):this.fit_bounds_onevent&&this.map.fitBounds(e.getBounds().pad(.005)),e.fireEvent("click")};_showPopup=e=>{e.hasOwnProperty("_latlng")?this.markers.zoomToShowLayer(e,()=>{e.openPopup()}):(this.map.fitBounds(e.getBounds().pad(.005)),e.openPopup())};removeHash=()=>history.replaceState(null,null," ");hasHash=()=>{return window.location.hash.replace("#","")||!1};gotoHashedEntry=()=>{var e=this.hasHash();e&&this.gotoEntry(e)};gotoEntry=t=>{const s=this.entry(t),a=(e,t,s)=>{e.options.hasOwnProperty("id")&&e.options.id==t&&(this._setSelectedMarker(t,e),this.hash&&this.addHash(t),this.slider?this._showSlider(e,s):this._showPopup(e))};this.markers.eachLayer(e=>a(e,t,s)),this.map.eachLayer(e=>{e.hasOwnProperty("feature")&&"Point"!=e.feature.geometry.type&&a(e,t,s)})};_setClickeable=s=>{s.on("keypress click",t=>{document.querySelectorAll(".marker--active").forEach(e=>e.classList.remove("marker--active")),["_icon","_path"].forEach(e=>{t.sourceTarget.hasOwnProperty(e)&&t.sourceTarget[e].classList.add("marker--active")});var e=this.entries.find(e=>e?.properties&&e.properties[this.id]===s.options.id);this.setContent(e.properties)})};isFeature=e=>!!e.hasOwnProperty("feature");_clickeableFeatures=()=>{this.reset_zoom&&this.map.eachLayer(e=>{this.isFeature(e)&&"Point"!=e.feature.geometry.type&&"MultiPoint"!=e.feature.geometry.type&&"n"!=e?.feature?.properties["pm-interactive"]&&this._setClickeable(e)})};_clickeableMarkers=()=>{this.no_info||this.markers.eachLayer(this._setClickeable)};_urlHash=()=>{const t=e=>{e.on("click",()=>{this.addHash(e.options.id)})};this.markers.eachLayer(t),this.map.eachLayer(e=>{e.hasOwnProperty("feature")&&"Point"!=e.feature.geometry.type&&"MultiPoint"!=e.feature.geometry.type&&t(e)})};removeListElement=(e,t)=>{t=e.indexOf(t);return-1{if(!e.hasOwnProperty(this.title))return!1;var t=this.template_structure,s=!!t.hasOwnProperty("title")&&t.title,a=this.title||!1;if(t.hasOwnProperty("title")&&"boolean"==typeof t.title)return!1;if(!s&&!a)return!1;s=s||a;let r;t?.header?((a=document.createElement("div")).innerHTML=this._mdToHtml(t.header(this,e)),this.template_innerhtml&&(a.innerHTML=t.header(this,e)),r=a):((r=document.createElement("h2")).classList.add(...t.title_classlist),r.textContent=e[s]);a=document.createElement("header");return a.className="header",a.appendChild(r),a};_templateList=e=>{var t=this.template_structure,s=Object.keys(e);let a=s;if(t.hasOwnProperty("values")&&0{var t,s;return this.template_markdown&&this._markdownEnable()?(t=new showdown.Converter(this.markdown_options),s=secureHTML(e,this.allowed_tags),t.makeHtml((""+s).trim())):e};_markdownEnable=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter"));_templateMixing=r=>{if(this.template_structure.hasOwnProperty("mixing")&&0{var{values:e,separator:t=", ",key:s}=e;void 0===s&&this.errorMessage("Mixing requiere un valor en el atributo «key».","warning"),a[s]=e.map(e=>e in r?r[e]:e.toString()).filter(e=>e).join(t)}),Object.assign({},r,a)}return r};_setType=(e,t=!1,s=!1)=>"function"==typeof e?e(this,t,s):e;_lead=e=>{if(this.template_structure.hasOwnProperty("lead")){this.template_structure.lead.hasOwnProperty("key")||this.errorMessage("Lead requiere un valor en el atributo «key».","warning");var t,{key:s=!1,css:a="small",style:r=!1}=this.template_structure.lead;if(e[s].trim())return(t=document.createElement("p")).textContent=e[s],(s=this._setType(r,e))&&t.setAttribute("style",s),(r=this._setType(a,e))&&t.classList.add(...r.split(" ")),t}};_termIcon=(e,t)=>{var s=this.header_icons.find(e=>e.key==t);if(s){var{css:s=!1,style:a=!1,html:r=!1}=s,r=this._setType(r,e,t),a=this._setType(a,e,t),s=this._setType(s,e,t);if(s)return(e=document.createElement("i")).setAttribute("aria-hidden","true"),e.classList.add(...s.split(" ")),a&&e.setAttribute("style",a),e;if(r)return(s=document.createElement("template")).innerHTML=r,s.content}return!1};defaultTemplate=(e,t)=>{t=this._templateMixing(t);var s,a,r=this["template_structure"],i=this._templateList(t),o=this._templateTitle(t),n=document.createElement("article"),l=(n.classList.add(...r.container_classlist),document.createElement(r.definition_list_tag));l.classList.add(...r.definition_list_classlist),l.style.fontSize="1rem";for(const c of i)t.hasOwnProperty(c)&&t[c]&&((s=document.createElement(r.term_tag)).classList.add(...r.term_classlist),(a=this._termIcon(t,c))&&(s.appendChild(a),s.insertAdjacentText("beforeend"," ")),s.insertAdjacentText("beforeend",this.header(c)),(a=document.createElement(r.definition_tag)).classList.add(...r.definition_classlist),a.textContent=t[c],this.template_markdown?a.innerHTML=this._mdToHtml(t[c]):this.template_innerhtml&&(a.innerHTML=secureHTML(t[c],this.allowed_tags)),""!=this.header(c)&&l.appendChild(s),l.appendChild(a));i=this._lead(t);return i&&n.appendChild(i),o&&n.appendChild(o),n.appendChild(l),n.outerHTML};icon=(e="azul")=>new L.icon({iconUrl:"https://www.argentina.gob.ar/sites/default/files/"+`marcador-${e}.svg`,iconSize:[29,40],iconAnchor:[14,40],popupAnchor:[0,-37]});resetView=()=>this.map.setView(this.map_view,this.map_zoom);fitBounds=()=>{try{this.map.fitBounds(this.geojson.getBounds().pad(.005))}catch(e){}};_resetViewButton=()=>{this.reset_zoom&&(document.querySelectorAll(".js-reset-view"+this.scope_sufix).forEach(e=>e.remove()),document.querySelectorAll(this.scope_selector+" .leaflet-control-zoom-in").forEach(e=>{var t=document.createElement("i"),s=(t.classList.add("pmi","pmi-expand"),t.setAttribute("aria-hidden","true"),document.createElement("a"));s.classList.add("js-reset-view"+this.scope_sufix,"leaflet-control-zoom-reset"),s.href="#",s.title="Zoom para ver todo el mapa",s.setAttribute("role","button"),s.setAttribute("aria-label","Zoom para ver todo el mapa"),s.appendChild(t),s.onclick=e=>{e.preventDefault(),this.cleanState(),this.resetView()},e.after(s)}))};marker=e=>{var t;return this.marker_color&&"boolean"!=typeof this.marker_color?"string"==typeof this.marker_color?this.icon(this.marker_color):"string"==typeof this.marker_color(this,e)?(t=this.marker_color(this,e),this.icon(t)):"function"==typeof this.marker_color?this.marker_color(this,e):void 0:null};_clearLayers=()=>{this.markers.clearLayers(),this.map.eachLayer(e=>{this.isFeature(e)&&this.map.removeLayer(e)})};markersMap=e=>{var r=this;this._clearLayers(),this.geojson=new L.geoJson(e,{pointToLayer:function(e,t){var e=e["properties"],s=r.marker(e),a={},s=(a.id=e[r.id],s&&(a.icon=s),r.title&&(a.alt=e[r.title]),new L.marker(t,a));return r.map.options.minZoom=r.min_zoom,r.markers.addLayer(s),r.tooltip&&e[r.title]&&s.bindTooltip(e[r.title],r.tooltip_options),r.no_info||r.slider||(t="function"==typeof r.template?r.template(r,e):r.defaultTemplate(r,e),s.bindPopup(t)),r.markers},onEachFeature:function(e,t){var{properties:s,geometry:a}=e;t.options.id=s[r.id],e.properties.name=s[r.title],r.tooltip&&s[r.title]&&"Point"!=a.type&&"MultiPoint"!=a.type&&t.bindTooltip(s[r.title],r.tooltip_options),r.no_info||r.slider||"Point"==a.type||"MultiPoint"==a.type||(e="function"==typeof r.template?r.template(r,s):r.defaultTemplate(r,s),t.bindPopup(e))},style:function(e){const s=e["properties"];e=(e,t=!1)=>s.hasOwnProperty(e)?s[e]:t||r.featureStyle[e];return{color:e("stroke-color",e("stroke")),strokeOpacity:e("stroke-opacity"),weight:e("stroke-width"),fillColor:e("stroke"),opacity:e("stroke-opacity"),fillOpacity:e("fill-opacity")}}}),this.geojson.addTo(this.map)};_setSelectedMarker=(e,t)=>{e={entry:this.entry(e),marker:t};return this.selected_marker=e};_selectedMarker=()=>{this.map.eachLayer(t=>{this.isFeature(t)&&t.on("click",e=>{this._setSelectedMarker(t.options.id,t)})})};_hiddenSearchInput=()=>{const t=document.createElement("input");t.type="hidden",t.name="js-search-input"+this.scope_sufix,t.setAttribute("disabled","disabled"),t.id="js-search-input"+this.scope_sufix,document.querySelectorAll(this.scope_selector+".poncho-map").forEach(e=>e.appendChild(t))};_setFetureAttributes=()=>{const t=(e,t)=>{e.hasOwnProperty(t)&&(e[t].setAttribute("aria-label",e?.feature?.properties?.[this.title]),e[t].setAttribute("tabindex",0),e[t].dataset.entryId=e?.feature?.properties?.[this.id],"n"==e?.feature?.properties?.["pm-interactive"]?(e[t].dataset.interactive="n",e[t].setAttribute("role","graphics-symbol")):e[t].setAttribute("role","button"),e[t].dataset.leafletId=e._leaflet_id)};this.map.eachLayer(e=>t(e,"_path"))};_accesibleAnchors=()=>{var e=[[this.scope_selector+" .leaflet-map-pane","leaflet-map-pane"+this.scope_sufix,[["role","region"]]],[this.scope_selector+" .leaflet-control-zoom","leaflet-control-zoom"+this.scope_sufix,[["aria-label","Herramientas de zoom"],["role","region"]]],[".js-themes-tool"+this.scope_sufix,"themes-tool"+this.scope_sufix,[["aria-label","Herramienta para cambiar de tema visual"],["role","region"]]]];return e.forEach(e=>{document.querySelectorAll(e[0]).forEach(t=>{t.id=e[1],e[2].forEach(e=>t.setAttribute(e[0],e[1]))})}),e};_accesibleMenu=()=>{document.querySelectorAll(this.scope_selector+" .pm-accesible-nav").forEach(e=>e.remove());var e=this._accesibleAnchors(),e=[...e=[{text:"Ir a los marcadores del mapa",anchor:"#"+e[0][1]},{text:"Ajustar marcadores al mapa",anchor:"#",class:"js-fit-bounds"},{text:"Ir al panel de zoom",anchor:"#"+e[1][1]},{text:"Cambiar de tema",anchor:"#"+e[2][1]}],...this.accesible_menu_filter,...this.accesible_menu_search,...this.accesible_menu_extras],t=document.createElement("i");t.classList.add("pmi","pmi-universal-access","accesible-nav__icon"),t.setAttribute("aria-hidden","true");const s=document.createElement("div"),a=(s.classList.add("pm-accesible-nav","top","pm-list"),s.id="pm-accesible-nav"+this.scope_sufix,s.setAttribute("aria-label","Menú para el mapa"),s.setAttribute("role","navigation"),s.tabIndex=0,document.createElement("ul"));a.classList.add("pm-list-unstyled"),e.forEach((e,t)=>{var s=document.createElement("a"),e=(s.classList.add("pm-item-link","pm-accesible"),s.textContent=e.text,s.tabIndex=0,s.href=e.anchor,e.hasOwnProperty("class")&&""!=e.class&&s.classList.add(...e.class.split(" ")),document.createElement("li"));e.appendChild(s),a.appendChild(e)}),s.appendChild(t),s.appendChild(a);e=document.createElement("a");e.textContent="Ir a la navegación del mapa",e.classList.add("pm-item-link","pm-accesible"),e.href="#pm-accesible-nav"+this.scope_sufix,e.id="accesible-return-nav"+this.scope_sufix;const r=document.createElement("div");r.classList.add("pm-accesible-nav","bottom"),r.appendChild(t.cloneNode(!0)),r.appendChild(e),document.querySelectorAll(""+this.scope_selector).forEach(e=>{e.insertBefore(s,e.children[0]),e.appendChild(r)}),this.fit()};fit=()=>document.querySelectorAll(this.scope_selector+" .js-fit-bounds").forEach(e=>{e.onclick=e=>{e.preventDefault(),this.fitBounds()}});clearAll=()=>{[".js-filter-container"+this.scope_sufix,".js-slider"+this.scope_sufix].forEach(e=>document.querySelectorAll(e).forEach(e=>e.remove()))};cleanState=()=>history.replaceState(null,null," ");render=()=>{this._hiddenSearchInput(),this._resetViewButton(),this._setThemes(),this.titleLayer.addTo(this.map),this.markersMap(this.entries),this._selectedMarker(),this.slider&&(this._renderSlider(),this._clickeableFeatures(),this._clickeableMarkers(),this._clickToggleSlider()),this.hash&&this._urlHash(),this.scroll&&this.hasHash()&&this.scrollCenter(),setTimeout(this.gotoHashedEntry,this.anchor_delay),this._setFetureAttributes(),this._accesibleMenu(),this.mapOpacity(),this.mapBackgroundColor()}}class PonchoMapLoader{constructor(e){e=Object.assign({},{selector:"",scope:"",timeout:5e4,cover_opacity:1,cover_style:{}},e);this.scope=e.scope,this.cover_opacity=e.cover_opacity,this.cover_style=e.cover_style,this.timeout=e.timeout,this.scope_sufix="--"+this.scope,this.scope_selector=`[data-scope="${this.scope}"]`,this.ponchoLoaderTimeout}close=()=>document.querySelectorAll(".js-poncho-map__loader"+this.scope_sufix).forEach(e=>e.remove());load=()=>{this.close(),clearTimeout(this.ponchoLoaderTimeout);var e=document.querySelector(".poncho-map"+this.scope_selector),t=document.createElement("span"),s=(t.className="loader",document.createElement("div"));s.dataset.scope=this.selector,s.classList.add("poncho-map__loader","js-poncho-map__loader"+this.scope_sufix),Object.assign(s.style,this.cover_style),this.cover_opacity&&(s.style.backgroundColor=`color-mix(in srgb, transparent, var(--pm-loader-background) ${100*this.cover_opacity.toString()}%)`),s.appendChild(t),e.appendChild(s),this.ponchoLoaderTimeout=setTimeout(this.remove,this.timeout)};loader=(e,t=500)=>{this.load(),setTimeout(()=>{e(),this.remove()},t)}}class PonchoMapFilter extends PonchoMap{constructor(e,t){super(e,t);e=Object.assign({},{filters:[],filters_visible:!1,filters_info:!1,search_fields:[],messages:{reset:' Restablecer mapa',initial:"Hay {{total_results}} puntos en el mapa.",no_results_by_term:"No encontramos resultados para tu búsqueda.",no_results:"No s + this.messages.resete encontraron entradas.",results:"{{total_results}} resultados coinciden con tu búsqueda.",one_result:"{{total_results}} resultado coincide con tu búsqueda.",has_filters:' Se están usando filtros.'}},t);this.filters=e.filters,this.filters_info=e.filters_info,this.filters_visible=e.filters_visible,this.valid_fields=["checkbox","radio"],this.search_fields=e.search_fields,this.messages=e.messages,this.accesible_menu_filter=[{text:"Ir al panel de filtros",anchor:"#filtrar-busqueda"+this.scope_sufix}]}tplParser=(e,a)=>Object.keys(a).reduce(function(e,t){var s=new RegExp("\\{\\{\\s{0,2}"+t+"\\s{0,2}\\}\\}","gm");return e=e.replace(s,a[t])},e);_helpText=e=>{var t=document.querySelectorAll(this.scope_selector+" .js-poncho-map__help");const a={total_results:e.length,total_entries:this.entries.length,total_filtered_entries:this.filtered_entries.length,filter_class:"js-close-filter"+this.scope_sufix,anchor:"#",term:this.inputSearchValue,reset_search:"js-poncho-map-reset"+this.scope_sufix};t.forEach(e=>{e.innerHTML="";var t=document.createElement("ul"),s=(t.classList.add("m-b-0","list-unstyled"),t.setAttribute("aria-live","polite"),e=>{var t=document.createElement("li");return t.innerHTML=e,t});a.total_entries===a.total_results?t.appendChild(s(this.tplParser(this.messages.initial,a))):a.total_results<1?t.appendChild(s(this.tplParser(this.messages.no_results_by_term+this.messages.reset,a))):""===this.inputSearchValue&&a.total_results<1?t.appendChild(s(this.tplParser(this.messages.no_results+this.messages.reset,a))):1==a.total_results?t.appendChild(s(this.tplParser(this.messages.one_result+this.messages.reset,a))):1{e=/^([\w\-]+?)(?:__([0-9]+))(?:__([0-9]+))?$/gm.exec(e);return e?[e[1],e[2]]:null};isFilterOpen=()=>document.querySelector(".js-poncho-map-filters"+this.scope_sufix).classList.contains("filter--in");toggleFilter=()=>{document.querySelector(".js-poncho-map-filters"+this.scope_sufix).classList.toggle("filter--in")};_filterContainerHeight=()=>{var e=document.querySelector(".js-filter-container"+this.scope_sufix),t=document.querySelector(".js-close-filter"+this.scope_sufix),s=e.offsetParent.offsetHeight,a=3*this._cssVarComputedDistance(),s=s-e.offsetTop-t.offsetHeight-a,e=document.querySelector(".js-poncho-map-filters"+this.scope_sufix),t=(e.style.maxHeight=s+"px",e.offsetHeight-45),a=document.querySelector(".js-filters"+this.scope_sufix);a.style.height=t+"px",a.style.overflow="auto"};_clickToggleFilter=()=>document.querySelectorAll(".js-close-filter"+this.scope_sufix).forEach(e=>e.onclick=e=>{e.preventDefault(),this.toggleFilter(),this._filterContainerHeight()});_setFilter=e=>{const[t,s="checked"]=e;e=this.entries.map(e=>{if(e.properties.hasOwnProperty(t))return e.properties[t]}).filter(e=>e),e=[...new Set(e)].map(e=>[t,e,[e],s]);return e.sort((e,t)=>{e=e[1].toUpperCase(),t=t[1].toUpperCase();return t{var{type:e="checkbox",fields:t=!1,field:s=!1}=e;t||s||this.errorMessage("Filters requiere el uso del atributo `field` o `fields`.","warning"),s&&"radio"===e&&(s[1]=!1);let a=t||this._setFilter(s);return"radio"===e&&!1===t&&(s=a.map(e=>e[1]),a=[[a[0][0],"Todos",s,"checked"],...a]),a};_fields=(e,t)=>{var s=document.createElement("div"),a=(s.classList.add("field-list","p-b-1"),this._fieldsToUse(e));for(const c in a){var r=a[c],i=document.createElement("input"),o=(i.type=this.valid_fields.includes(e.type)?e.type:"checkbox",i.id=`id__${r[0]}__${t}__`+c,"radio"==e.type?i.name=r[0]+"__"+t:i.name=r[0]+`__${t}__`+c,i.className="form-check-input",i.value=c,void 0!==r[3]&&"checked"==r[3]&&i.setAttribute("checked","checked"),document.createElement("label")),n=(o.style.marginLeft=".33rem",o.textContent=r[1],o.className="form-check-label",o.setAttribute("for",`id__${r[0]}__${t}__`+c),document.createElement("span")),r=(n.dataset.info=r[0]+`__${t}__`+c,o.appendChild(n),document.createElement("div"));r.className="form-check",r.appendChild(i),r.appendChild(o),s.appendChild(r)}var l=document.createElement("div");return l.appendChild(s),l};_filterButton=()=>{var e=document.createElement("i"),t=(e.setAttribute("aria-hidden","true"),e.classList.add("pmi","pmi-filter"),document.createElement("span")),s=(t.textContent="Abre o cierra el filtro de búsqueda",t.classList.add("pm-visually-hidden"),document.createElement("button")),e=(s.classList.add("pm-btn","pm-btn-rounded-circle","pm-my-1","js-close-filter"+this.scope_sufix),s.id="filtrar-busqueda"+this.scope_sufix,s.appendChild(e),s.appendChild(t),s.setAttribute("role","button"),s.setAttribute("aria-label","Abre o cierra el filtro de búsqueda"),s.setAttribute("aria-controls","poncho-map-filters"+this.scope_sufix),document.createElement("div"));e.classList.add("js-filter-container"+this.scope_sufix,"filter-container"),e.appendChild(s),document.querySelector(".poncho-map"+this.scope_selector).appendChild(e)};_cssVarComputedDistance=()=>{var e=document.querySelector(".poncho-map"),e=getComputedStyle(e).getPropertyValue("--pm-slider-distance");return parseInt(e.toString().replace(/[^0-9]*/gm,""))||0};_controlZoomSize=()=>{var e=document.querySelector(this.scope_selector+" .leaflet-control-zoom");return{controlHeight:e.offsetHeight,controlTop:e.offsetTop}};_filterContainer=()=>{var e=document.createElement("div"),t=(e.className="js-filters"+this.scope_sufix,document.createElement("button")),s=(t.classList.add("btn","btn-xs","btn-secondary","btn-close","js-close-filter"+this.scope_sufix),t.title="Cerrar panel",t.setAttribute("role","button"),t.setAttribute("aria-label","Cerrar panel de filtros"),t.innerHTML='Cerrar ✕',document.createElement("form"));s.classList.add("js-formulario"+this.scope_sufix),s.appendChild(t),s.appendChild(e);const a=document.createElement("div");a.classList.add("js-poncho-map-filters"+this.scope_sufix,"pm-container","poncho-map-filters","pm-caret","pm-caret-t"),a.setAttribute("role","region"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-label","Panel de filtros"),a.id="poncho-map-filters"+this.scope_sufix,this.filters_visible&&a.classList.add("filter--in");this._cssVarComputedDistance();t=this._controlZoomSize();const r=t.controlHeight+t.controlTop+"px";a.appendChild(s),document.querySelectorAll(".js-filter-container"+this.scope_sufix).forEach(e=>{e.style.top=r,e.appendChild(a)})};_checkUncheckButtons=e=>{var t=document.createElement("button"),s=(t.classList.add("js-select-items","select-items__button"),t.textContent="Marcar todos",t.dataset.field=e.field[0],t.dataset.value=1,document.createElement("button")),e=(s.classList.add("js-select-items","select-items__button"),s.textContent="Desmarcar todos",s.dataset.field=e.field[0],s.dataset.value=0,document.createElement("div"));return e.classList.add("select-items"),e.appendChild(t),e.appendChild(s),e};_createFilters=e=>{const r=document.querySelector(".js-filters"+this.scope_sufix);e.forEach((e,t)=>{var s=document.createElement("legend"),a=(s.textContent=e.legend,s.classList.add("m-b-1","color-primary","h6"),document.createElement("fieldset"));a.appendChild(s),e.hasOwnProperty("check_uncheck_all")&&e.check_uncheck_all&&"radio"!=e?.type&&a.appendChild(this._checkUncheckButtons(e)),a.appendChild(this._fields(e,t)),r.appendChild(a)})};formFilters=()=>{var e;return this.filters.length<1?[]:(e=document.querySelector(".js-formulario"+this.scope_sufix),e=new FormData(e),Array.from(e).map(e=>{var t=this._filterPosition(e[0]);return[parseInt(t[1]),parseInt(e[1]),t[0]]}))};defaultFiltersConfiguration=()=>{return this.filters.map((e,s)=>{return this._fieldsToUse(e).map((e,t)=>[s,t,e[0],"undefinded"!=typeof e[3]&&"checked"==e[3]])}).flat()};usingFilters=()=>{return this.defaultFiltersConfiguration().every(e=>document.querySelector(`#id__${e[2]}__${e[0]}__`+e[1]).checked)};_resetFormFilters=()=>{this.defaultFiltersConfiguration().forEach(e=>{document.querySelector(`#id__${e[2]}__${e[0]}__`+e[1]).checked=e[3]})};get inputSearchValue(){var e=document.querySelector("#js-search-input"+this.scope_sufix).value.trim();return""!==e&&e}_countOccurrences=(e,s,a)=>{return e.reduce((e,t)=>s.some(e=>t.properties[a].includes(e))?e+1:e,0)};totals=()=>{return this.formFilters().map(e=>{var t=this._fieldsToUse(this.filters[e[0]])[e[1]];return[t[1],this._countOccurrences(this.filtered_entries,t[2],t[0]),...e]})};_totalsInfo=()=>{if(!this.filters_info)return"";this.totals().forEach(e=>{var t=document.querySelector(""+this.scope_selector+` [data-info="${e[4]}__${e[2]}__${e[3]}"]`),s=e[1]<2?"":"s",a=document.createElement("i"),r=(a.style.cursor="help",a.style.opacity=".75",a.style.marginLeft=".5em",a.style.marginRight=".25em",a.classList.add("fa","fa-info-circle","small","text-info"),a.title=e[1]+" resultado"+s,a.setAttribute("aria-hidden","true"),document.createElement("span")),e=(r.className="pm-visually-hidden",r.style.fontWeight="400",r.textContent=e[1]+` elemento${s}.`,document.createElement("small"));e.appendChild(a),e.appendChild(r),t.appendChild(e)})};_validateEntry=(t,s)=>{var a=this.filters.length,r=[];for(let e=0;es.filter(e=>e[0]==t))(e)));return r.every(e=>e)};_search=(t,e,s)=>{const a=this._fieldsToUse(this.filters[e])[s];return a[2].filter(e=>e).some(e=>{if(t.hasOwnProperty(a[0]))return t[a[0]].includes(e)})};_validateGroup=(t,e)=>{return e.map(e=>this._search(t,e[0],e[1])).some(e=>e)};_filterData=()=>{var e=this.formFilters(),t=this.entries.filter(e=>this._validateEntry(e.properties,this.formFilters())),t=this.searchEntries(this.inputSearchValue,t);return t=this.filters.length<1||0{e=void 0!==e?this.entries:this._filterData(),this.markersMap(e),this._selectedMarker(),this._helpText(e),this._resetSearch(),this._clickToggleFilter(),this.slider&&(this._renderSlider(),this._clickeableMarkers(),this._clickeableFeatures(),this._clickToggleSlider()),this.hash&&this._urlHash(),this._setFetureAttributes(),this._accesibleMenu()};_clearSearchInput=()=>document.querySelectorAll("#js-search-input"+this.scope_sufix).forEach(e=>e.value="");_resetSearch=()=>{document.querySelectorAll(".js-poncho-map-reset"+this.scope_sufix).forEach(e=>{e.onclick=e=>{e.preventDefault(),this._resetFormFilters(),this._filteredData(this.entries),this._clearSearchInput(),this.resetView()}})};filterChange=t=>document.querySelectorAll(".js-filters"+this.scope_sufix).forEach(e=>{e.onchange=t});checkUncheckFilters=()=>{document.querySelectorAll(this.scope_selector+" .js-select-items").forEach(t=>{t.onclick=e=>{e.preventDefault(),document.querySelectorAll(`${this.scope_selector} [id^=id__${t.dataset.field}]`).forEach(e=>{e.checked=parseInt(t.dataset.value)}),this._filteredData()}})};render=()=>{this._hiddenSearchInput(),this._resetViewButton(),this._menuTheme(),this._setThemes(),0{e.preventDefault(),this._filteredData()}),setTimeout(this.gotoHashedEntry,this.anchor_delay),this.filters_visible&&this._filterContainerHeight(),this.mapOpacity(),this.mapBackgroundColor()}}class PonchoMapSearch{constructor(e,t){var s={scope:!1,placeholder:"Su búsqueda",search_fields:e.search_fields,sort:!0,sort_reverse:!1,sort_key:"text",datalist:!0},s=(this.instance=e,Object.assign({},s,t));this.text=e.title||!1,this.datalist=s.datalist,this.placeholder=s.placeholder,this.scope=s.scope,this.scope_sufix="--"+this.scope,this.sort=s.sort,this.sort_reverse=s.sort_reverse,this.search_scope_selector=this.scope?`[data-scope="${this.scope}"]`:"",this.instance.search_fields=s.search_fields,this.instance.accesible_menu_search=[{text:"Hacer una búsqueda",anchor:"#id-poncho-map-search"+this.scope_sufix}]}sortData=(e,a)=>{e=e.sort((e,t)=>{var s=e=>{this.instance.removeAccents(e).toUpperCase()};return s(e[a]),s(t[a]),s(e[a]),s(t[a]),0});return this.sort_reverse?e.reverse():e};_triggerSearch=()=>{const t=document.querySelector(this.search_scope_selector+" .js-poncho-map-search__input");t.id="id-poncho-map-search"+this.scope_sufix,document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__submit").forEach(e=>{e.onclick=e=>{e.preventDefault();document.querySelector("#js-search-input"+this.instance.scope_sufix).value=t.value;e=t.value;this._renderSearch(e)}})};_keyup=()=>{document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__input").forEach(e=>{const t=document.querySelector("#js-search-input"+this.instance.scope_sufix);e.onkeyup=()=>{t.value=e.value},e.onkeydown=()=>{t.value=e.value}})};_placeHolder=()=>{if(!this.placeholder)return"";document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__input").forEach(e=>e.placeholder=this.placeholder.toString())};_renderSearch=e=>{var t=this.instance._filterData();this.instance.markersMap(t),this.instance.slider&&(this.instance._renderSlider(),this.instance._clickeableFeatures(),this.instance._clickeableMarkers(),this.instance._clickToggleSlider()),this.instance.hash&&this.instance._urlHash(),this.instance.resetView(),1==t.length?this.instance.gotoEntry(t[0].properties[this.instance.id]):""!=e.trim()&&(this.instance.removeHash(),setTimeout(this.instance.fitBounds,this.instance.anchor_delay)),this.instance._helpText(t),this.instance._resetSearch(),this.instance._clickToggleFilter(),this.instance._setFetureAttributes(),this.instance._accesibleMenu()};_addDataListOptions=()=>{if(!this.datalist)return null;document.querySelectorAll(this.search_scope_selector+" .js-porcho-map-search__list,"+` ${this.search_scope_selector} .js-poncho-map-search__list`).forEach(s=>{s.innerHTML="";var e=document.querySelector(this.search_scope_selector+" .js-poncho-map-search__input"),t="id-datalist"+this.scope_sufix;e.setAttribute("list",t),s.id=t,this.instance.filtered_entries.forEach(e=>{var t;e.properties[this.text]&&s.appendChild((e=e.properties[this.text],(t=document.createElement("option")).value=e,t))})})};_searchRegion=()=>{var e=document.querySelector(this.search_scope_selector);e.setAttribute("role","region"),e.setAttribute("aria-label","Buscador")};render=()=>{this._placeHolder(),this._triggerSearch(),this._addDataListOptions(),this.instance.filterChange(e=>{e.preventDefault(),this.instance._filteredData(),this._addDataListOptions()}),this._searchRegion(),this._keyup(),this.instance._accesibleMenu()}}const PONCHOMAP_GEOJSON_PROVINCES="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geo-provincias-argentinas.json",ponchoMapProvinceMergeData=(a={},r={},i="provincia")=>{if(a.hasOwnProperty("features"))return a.features.forEach((t,e)=>{var s=r.find(e=>e[i]==t.properties.fna||e[i]==t.properties.nam);!s&&t.properties.fna?delete a.features[e]:(s?.color&&!t.properties["pm-type"]&&(a.features[e].properties.stroke=ponchoColor(s.color)),"n"===t.properties["pm-interactive"]&&"n"!==s?.["pm-interactive"]&&delete s["pm-interactive"],Object.assign(a.features[e].properties,s))}),a;throw new Error("Invalid data format")},ponchoMapProvinceCssStyles=e=>{e||document.querySelectorAll(".poncho-map-province__toggle-map,.poncho-map-province__toggle-element").forEach(e=>{e.classList.remove("poncho-map-province__toggle-map","poncho-map-province__toggle-element")})};class PonchoMapProvinces extends PonchoMapFilter{constructor(e,t,s){s=Object.assign({},{initial_entry:!1,random_entry:!1,overlay_image:!0,overlay_image_bounds:[[-20.56830872133435,-44.91768177759874],[-55.861359445914566,-75.2246121480093]],overlay_image_opacity:.8,overlay_image_url:"https://www.argentina.gob.ar/sites/default/files/map-shadow.png",hide_select:!0,province_index:"provincia",fit_bounds:!0,map_view:[-40.47815508388363,-60.0045383246273],map_init_options:{zoomSnap:.2,zoomControl:!0,doubleClickZoom:!1,scrollWheelZoom:!1,boxZoom:!1},map_zoom:4.4,tooltip_options:{permanent:!1,className:"leaflet-tooltip-own",direction:"auto",offset:[0,-3],sticky:!0,opacity:1},tooltip:!0,slider:!0},s),ponchoMapProvinceCssStyles(s.hide_select),e=ponchoMapProvinceMergeData(e,t,s.province_index);super(e,s),this.initialEntry=s.initial_entry,this.randomEntry=s.random_entry,this.overlayImage=s.overlay_image,this.overlayImageUrl=s.overlay_image_url,this.overlayImageBounds=s.overlay_image_bounds,this.overlayImageOpacity=s.overlay_image_opacity,this.mapView=s.map_view,this.hideSelect=s.hide_select,this.fitToBounds=s.fit_bounds}sortObject=(e,s=0)=>e.sort((e,t)=>{e=e[s].toUpperCase(),t=t[s].toUpperCase();return te[Math.floor(Math.random()*e.length)][0];_provincesFromGeoJSON=(e,a)=>{let r={};return e.features.map(e=>{var{name:t=!1,"pm-interactive":s=!1}=e.properties;if("n"===s||!t)return!1;r[e.properties[a]]=t}).filter(e=>e),this.sortObject(Object.entries(r),1)};_selectedEntry=e=>{var t=window.location.hash.replace("#","");let s="";return t?s=t:this.initialEntry?s=this.initialEntry:this.randomEntry&&(s=this._randomEntry(e)),s};_setSelectProvinces=e=>{window.location.hash.replace("#","");e=this._provincesFromGeoJSON(e.geoJSON,e.id);const s=this._selectedEntry(e),a=document.getElementById("id_provincia");return[["","Elegí una provincia"],...e].forEach(e=>{var t=document.createElement("option");e[0]===s&&t.setAttribute("selected","selected"),t.value=e[0],t.textContent=e[1],a.appendChild(t)}),{object:a,selected:s}};_selectedPolygon=e=>{e.map.eachLayer(e=>{e.on("keypress click",e=>{e?.target?.feature?.properties&&(e=e.target.feature.properties["id"],document.getElementById("id_provincia").value=e)})})};_selectProvinces=t=>{this._selectedPolygon(t);const s=this._setSelectProvinces(t);s.selected&&t.gotoEntry(s.selected),s.object.addEventListener("change",e=>{t.gotoEntry(e.target.value),e.value=s.selected})};_overlayImage=()=>{this.overlayImage&&L.imageOverlay(this.overlayImageUrl,this.overlayImageBounds,{opacity:this.overlayImageOpacity}).addTo(this.map)};renderProvinceMap=()=>{this._overlayImage(),this.render(),this.fitToBounds&&this.fitBounds(),this._selectProvinces(this)}}class GapiSheetData{constructor(e){e=Object.assign({},{gapi_key:"AIzaSyCq2wEEKL9-6RmX-TkW23qJsrmnFHFf5tY",gapi_uri:"https://sheets.googleapis.com/v4/spreadsheets/"},e);this.gapi_key=e.gapi_key,this.gapi_uri=e.gapi_uri}url=(e,t,s)=>{return["https://sheets.googleapis.com/v4/spreadsheets/",t,"/values/",e,"?key=",void 0!==s?s:this.gapi_key,"&alt=json"].join("")};json_data=e=>{e=this.feed(e);return{feed:e,entries:this.entries(e),headers:this.headers(e)}};feed=(e,i=!0)=>{const o=e.values[0],n=/ |\/|_/gi;let l=[];return e.values.forEach((e,t)=>{if(0{const a=s?"filtro-":"";s=Object.entries(e);let r={};return s.map(e=>{return r[e[0].replace("gsx$","").replace(a,"").replace(/-/g,t)]=e[1].$t}),r};entries=e=>e.filter((e,t)=>0e.find((e,t)=>0==t)}"undefined"!=typeof exports&&(module.exports=GapiSheetData);class TranslateHTML{ATTRIBUTES=["title","placeholder","alt","value","href","src","html.lang"];constructor(e=[],t=[]){this.dictionary=this.sortByLength(e),this.attributes=t.length?t:this.ATTRIBUTES}sortByLength=e=>(e.sort((e,t)=>e[0].length>t[0].length?-1:e[0].length{const t=e||this.dictionary;this.attributes.forEach(e=>{e=e.split(".").slice(-2);const s=2===e.length?e[0]:"",a=2===e.length?e[1]:e[0];t.forEach(t=>{document.querySelectorAll(`${s}[${a}='${t[0]}']`).forEach(e=>e[a]=t[1])})})};translateHTML=(s,a)=>{for(var e,t=document.evaluate("//*/text()",document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),r=[];e=t.iterateNext();)r.push(e);r.forEach(e=>{var t=e.textContent.replace(s,a);t!==e.textContent&&(t=document.createTextNode(t),e.parentNode.replaceChild(t,e))})};translate=()=>{this.dictionary.forEach(e=>{var t=new RegExp(e[0],"g");this.translateHTML(t,e[1])})}} \ No newline at end of file From 6c36710cf655b90f983007ece0979785296c369c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Bouillet?= Date: Wed, 19 Jun 2024 08:44:55 -0300 Subject: [PATCH 05/13] media --- src/js/utils/document.js | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/js/utils/document.js b/src/js/utils/document.js index 02d09d3b5..ed57dd416 100644 --- a/src/js/utils/document.js +++ b/src/js/utils/document.js @@ -4,10 +4,21 @@ * @summary Permite agregar definiciones css dentro del head. * * @author Agustín Bouillet - * @param {string} scope Nombre único para identificar las asignaciones css + * @param {string} id Nombre único para identificar las asignaciones css * @param {string} styleDefinitions Definiciones CSS + * @param {string} mediaType Definición para media query * @example + * // - -

Mapa Argentina SVG

- -
- - - + + + - \ No newline at end of file + \ No newline at end of file diff --git a/src/js/mapa-argentina/demo/js/demo.js b/src/js/mapa-argentina/demo/js/demo.js new file mode 100755 index 000000000..9787355d6 --- /dev/null +++ b/src/js/mapa-argentina/demo/js/demo.js @@ -0,0 +1,32 @@ +document.addEventListener('DOMContentLoaded', () => { + document.querySelectorAll("[data-code-from]").forEach(element => { + const placeHolder = element.dataset.codeFrom; + const html = document.getElementById(placeHolder); + const text = `<script>\n` + + `// start ${html.tagName.toLocaleLowerCase()}\n` + + `${html.textContent.trim()}\n` + + `// end ${html.tagName.toLocaleLowerCase()}\n` + + `</script>`; + + const pre = document.createElement("pre"); + pre.classList.add("demo-style"); + pre.innerHTML = text; + + + + const titleTag = (element.dataset.htmltag ?element.dataset.htmltag : "p"); + + const title = document.createElement(titleTag); + title.textContent = element.dataset.title; + + if(element.dataset.styles){ + let headStyles = element.dataset.styles.split(/\,\s*/g).filter(f=>f); + title.classList.add(...headStyles); + } + + if(element.dataset.title){ + element.appendChild(title); + } + element.appendChild(pre); + }); +}); diff --git a/src/js/mapa-argentina/img/example-map-1.png b/src/js/mapa-argentina/img/example-map-1.png old mode 100644 new mode 100755 diff --git a/src/js/mapa-argentina/img/example-map-2.png b/src/js/mapa-argentina/img/example-map-2.png old mode 100644 new mode 100755 diff --git a/src/js/mapa-argentina/img/example-map-3.png b/src/js/mapa-argentina/img/example-map-3.png old mode 100644 new mode 100755 diff --git a/src/js/mapa-argentina/mapa-argentina.js b/src/js/mapa-argentina/mapa-argentina.js old mode 100644 new mode 100755 index c9df3ea17..91e7fe2d9 --- a/src/js/mapa-argentina/mapa-argentina.js +++ b/src/js/mapa-argentina/mapa-argentina.js @@ -1,10 +1,10 @@ /** * Mapa Argentina con división política - * + * * MIT License - * + * * Copyright (c) 2023 Argentina.gob.ar - * + * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, @@ -12,10 +12,10 @@ * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -25,6 +25,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ + const mapaArgentinaSvg = ` Created with Raphaël 2.2.0 Provincia de Buenos Aires La Rioja Misiones Santa Cruz La Pampa Mendoza Salta Santiago del Estero Tierra del Fuego, Antártida e Islas del Atlántico Sur Río Negro Catamarca Jujuy Chaco Formosa Entre Ríos Chubut Neuquén Córdoba Tucumán Santa Fe Corrientes San Juan San Luis Ciudad Autónoma de Buenos Aires Ciudad Autónoma de Buenos Aires `; @@ -33,42 +34,167 @@ const mapaArgentinaSvg = ` element.innerHTML = mapaArgentinaSvg); + .forEach((element) => element.innerHTML = mapaArgentinaSvg); }; +/** + * Hace el render del mapa si existe el selector: `#js-mapa-svg`. + */ +document.addEventListener("DOMContentLoaded", () => renderArgentinaMap("#js-mapa-svg")); + /** * Cambia el estilo del mapa de Argentina SVG * * @param {object} options Permite cambiar distintos aspectos del mapa. - * @param {string} selector Selector html, ej. #js-mapa-svg. + * @param {string} selector Selector html, ej. #js-mapa-svg. * @returns {undefined} */ -const argentinaMapStyle = (options={}, selector="#js-mapa-svg") => { - if (typeof selector !== 'string' || !selector.trim()) { - console.warn('Debe especificar un selector válido:', selector); - return; +class ArgentinaMap { + constructor(options={}, selector="#js-mapa-svg"){ + if (typeof selector !== "string" || !selector.trim()) { + console.warn(`Debe especificar un selector válido: ${selector}`); + return; + } + + const defaults = { + provinces: ["*"], + strokeColor: "#CCCACA", + strokeWidth: 1, + color: "#DDDDDD", + selectiveColor: [], + backgroundColor: "white", + defaultColor: "#DDDDDD", + reprStrokeColor: false, + reprStrokeWidth: false, + svgTitle: false, + svgDesc: false + }; + + let opts = Object.assign({}, defaults, options); + + this.selector = selector; + this.defaultFillColor = opts.color; + this.provinces = opts.provinces; + this.strokeColor = opts.strokeColor; + this.strokeWidth = opts.strokeWidth; + this.color = opts.color; + this.selectiveColor = opts.selectiveColor; + this.backgroundColor = opts.backgroundColor; + this.defaultColor = opts.defaultColor; + this.reprStrokeColor = opts.reprStrokeColor; + this.reprStrokeWidth = opts.reprStrokeWidth; + this.svgTitle = opts.svgTitle; + this.svgDesc = opts.svgDesc; + } + + + svgTitleAndDesc = (svgTitle, svgDesc) => { + const svg = document.querySelector(`${this.selector} > svg`); + + if(typeof svgDesc === "string" && svgDesc.trim() != ""){ + const desc = document.createElement("desc"); + desc.textContent = svgDesc; + desc.setAttribute("lang", "es"); + svg.children[0].insertAdjacentHTML("beforeBegin", desc.outerHTML); + } + + if(typeof svgDesc === "string" && svgDesc.trim() != ""){ + const title = document.createElement("title") + title.textContent = svgTitle; + title.setAttribute("lang", "es"); + svg.children[0].insertAdjacentHTML("beforeBegin", title.outerHTML); + } + } + + + provincesReference = [ + ["AR-A", "Salta"], + ["AR-B", "Buenos Aires"], + ["AR-C", "Ciudad Autónoma de Buenos Aires"], + ["AR-C", "CABA"], + ["AR-D", "San Luis"], + ["AR-E", "Entre Ríos"], + ["AR-F", "La Rioja"], + ["AR-G", "Santiago del Estero"], + ["AR-H", "Chaco"], + ["AR-J", "San Juan"], + ["AR-K", "Catamarca"], + ["AR-L", "La Pampa"], + ["AR-M", "Mendoza"], + ["AR-N", "Misiones"], + ["AR-P", "Formosa"], + ["AR-Q", "Neuquén"], + ["AR-R", "Río Negro"], + ["AR-S", "Santa Fe"], + ["AR-T", "Tucumán"], + ["AR-U", "Chubut"], + ["AR-V", "Tierra del Fuego, Antártida e Islas del Atlántico Sur"], + ["AR-W", "Corrientes"], + ["AR-X", "Córdoba"], + ["AR-Y", "Jujuy"], + ["AR-Z", "Santa Cruz"] + ]; + + /** + * Busca un ISO AR + * @param {string} term Término a buscar en la referencia + * @returns {boolean|object} + */ + matchProvince = (term) => { + if(typeof term !== "string" || term.trim() == ""){ + return false; + } + + const _normalize = (term) => term.toLocaleLowerCase() + .normalize('NFD') + // .replace(/[\u0300-\u036f,-_]/g, "") + .replace(/[\u0300-\u036f]/g, "") + .replace(/\s+/g, " "); + + const result = this.provincesReference.find((f) => { + return _normalize(f.join(" ")).includes(_normalize(term)); + + }); + + return (result ? result[0] : term) + }; + + + /** + * Imprime un color de fondo al elemento del selector. + * @param {string} selector Selector + * @param {string} backgroundColor + */ + _backgroundColor = (selector, backgroundColor) => { + document.querySelectorAll(selector).forEach(ele => { + ele.style.backgroundColor = backgroundColor; + }); } + /** * Aplica los valores a los path, rect, polyline y crcle. */ - function _stroke(selector, strokeColor, strokeWidth){ - const selectors = [ + _stroke = (selector, strokeColor, strokeWidth, directElement=false) => { + let selectors = [ `${selector} path`, `${selector} rect`, `${selector} polyline`, `${selector} circle` ].join(","); + if(directElement){ + selectors = selector; + } const mapRect = document.querySelectorAll(selectors); mapRect.forEach(ele => { ele.setAttribute("stroke", strokeColor); @@ -76,16 +202,35 @@ const argentinaMapStyle = (options={}, selector="#js-mapa-svg") => { }); } + + /** + * Cambia el color de un SVG path + * @param {string|object} selector Selector + * @param {string} color Color formato string + */ + _fill = (selector, color) => { + if(typeof selector === "string" && selector.trim() != ""){ + console.info("selector") + document.querySelectorAll(selector + " *").forEach(element => { + element.setAttribute("fill", color); + }); + } else if(selector instanceof Node){ + selector.setAttribute("fill", color); + } + }; + + /** * Agrega CABA en su versión aumentada (zoom). - * + * * @param {object} provinces Objeto con un listado de ISO provincias. * @param {object} selectiveColor Objeto con sub arrays con * ISO provincia y color. - * @returns + * @returns {object} */ - function _fixCABA(provinces, selectiveColor){ + _fixCABA = (provinces, selectiveColor) => { let prov = provinces; + if(selectiveColor.length){ let caba = selectiveColor.find(f => f[0] === "AR-C"); prov = (selectiveColor.some(f => f[0] === "AR-C") ? @@ -98,60 +243,76 @@ const argentinaMapStyle = (options={}, selector="#js-mapa-svg") => { } - // Options - const defaultFillColor = "#DDDDDD"; - const defaults = { - provinces: ["*"], - strokeColor: "#CCCACA", - strokeWidth: 1, - color: defaultFillColor, - selectiveColor: [] - }; + /** + * Personaliza la visualizacion de elementos cambiados de escala. + * + * @summary Ajusta el grosor del borde ("stroke") y el color de + * elementos como la Antártida y el zoom de CABA. + * @param {string} strokeColor Color del fill. + * @param {string|float|integer} strokeWidth Grosor de la línea. + * @returns {undefined} + */ + _representations = (strokeColor, strokeWidth) => { + if(![strokeColor, strokeWidth].some(s => s)){ + return; + } - const { - provinces, - strokeColor, - strokeWidth, - color, - selectiveColor, - defaultColor=defaultFillColor} = {...defaults, ...options}; + const width = (parseFloat(strokeWidth) !== NaN ? + strokeWidth : this.strokeWidth); - // Agrega CABA en su versión aumentada (zoom). - let augmentedProv = _fixCABA(provinces, selectiveColor); + const color = (typeof strokeColor === "string" && + strokeColor.trim() != "" ? strokeColor : this.strokeColor ); - const mapPath = document.querySelectorAll(`${selector} path[id^="AR-"]`); - mapPath.forEach(ele => { + this._stroke("#Layer_2", color, width); + this._stroke("#Sector", color, width); + this._stroke("#Layer_3", color, width); // Bordes antártida + this._stroke("#AR-C_1_", color, width, true); // Bordes CABA zoom + }; - if(selectiveColor.length){ - // Si está seteado _selectiveColor_ tiene precendencia, pinta - // cada una de las ISO provincias con su respectivo color. - let useColor = defaultColor; - const selection = augmentedProv.find(f => f[0] === ele.id); - if(selection){ - useColor = selection[1]; - } - ele.setAttribute("fill", useColor); - } else if(augmentedProv.includes("*") || augmentedProv.includes(ele.id)){ - // Si _provinces_ tiene asignados ISO provincias o un - // asterisco (*), pinta el color con el asignado en el - // indice color. - ele.setAttribute("fill", color); + render = () => { + // Agrega CABA en su versión aumentada (zoom). + const matchSelectiveColor = this.selectiveColor.map(m => + [this.matchProvince(m[0]), m[1]]); + const matchProvinces = this.provinces.map(m => this.matchProvince(m)); - } else { - // Pinta el `path`, con el color por defecto. - ele.setAttribute("fill", defaultColor); - } + let augmentedProv = this._fixCABA(matchProvinces, matchSelectiveColor); + + const container = document.querySelector(this.selector); + container.setAttribute("aria-label", "Mapa de la Republica Argentina"); + container.setAttribute("role", "region"); - }); + const mapPath = document.querySelectorAll( + `${this.selector} path[id^="AR-"]`); + mapPath.forEach(ele => { - // Estilos para las líneas y bordes. - _stroke(selector, strokeColor, strokeWidth); + if(this.selectiveColor.length){ + // Si está seteado _selectiveColor_ tiene precendencia, pinta + // cada una de las ISO provincias con su respectivo color. + const selection = augmentedProv.find(f => { + return (f[0] === ele.id); + }); + let useColor = (selection ? selection[1] : this.defaultColor); + this._fill(ele, useColor); -}; + } else if(augmentedProv.includes("*") || + augmentedProv.includes(ele.id)){ + // Si _provinces_ tiene asignados ISO provincias o un + // asterisco (*), pinta el color con el asignado en el + // indice color. + this._fill(ele, this.color); + } else { + // Pinta el `path`, con el color por defecto. + this._fill(ele, this.defaultColor); + } -/** - * Hace el render del mapa si existe el selector: `#js-mapa-svg`. - */ -document.addEventListener('DOMContentLoaded', () => renderMap("#js-mapa-svg")); \ No newline at end of file + }); + + // Estilos para las líneas y bordes. + this._stroke(this.selector, this.strokeColor, this.strokeWidth); + this._backgroundColor(this.selector, this.backgroundColor); + this._representations(this.reprStrokeColor, this.reprStrokeWidth); + this.svgTitleAndDesc(this.svgTitle, this.svgDesc); + } +} \ No newline at end of file diff --git a/src/js/mapa-argentina/readme.md b/src/js/mapa-argentina/readme.md old mode 100644 new mode 100755 index 61d403b96..d1264342b --- a/src/js/mapa-argentina/readme.md +++ b/src/js/mapa-argentina/readme.md @@ -1,11 +1,11 @@ # 📦 Mapa de Argentina SVG +Este mapa de la República Argentina en SVG permite al usuario personalizar su visualización a través de diversas opciones. Define el color de una, varias o todas las provincias; modifica el color de fondo del mapa y ajusta el grosor de las líneas para crear una representación única del país. -## 🧰 Opciones y métodos -### argentinaMapStyle() +## ArgentinaMap() -Permite asignar estilos de color de fondo, color de línea y ancho de línea al mapa. +### 🧰 Opciones y métodos @@ -62,11 +62,24 @@ Permite asignar estilos de color de fondo, color de línea y ancho de línea al * Hay que tener en cuenta que éste método tiene precedencia sobre provinces.

+ + + + + + + + + + + + +
reprStrokeColorstringfalseColor de linea para los elementos cambiados de escala como: Antártida y CABA.
reprStrokeWidth`string|float`falseGrueso de la linea para los elementos cambiados de escala.
- +**** ## 🚀 Uso @@ -133,7 +146,7 @@ document.addEventListener('DOMContentLoaded', () => { argentinaMapStyle({ selectiveColor: [ ["AR-B", "#525252"], - ["AR-C", "var(--danger, red)"], + ["AR-C", "var(--tomate, tomato)"], ["AR-E", "#525252"], ["AR-S", "#525252"], ["AR-X", "#525252"], @@ -143,4 +156,8 @@ document.addEventListener('DOMContentLoaded', () => { strokeWidth: 1 }, ".js-map"); }); -``` \ No newline at end of file +``` + +## referencias + +X11 color names, Wikipedia 2024, https://en.wikipedia.org/wiki/X11_color_names \ No newline at end of file diff --git a/src/js/mapa-argentina/resources/map.svg b/src/js/mapa-argentina/resources/map.svg index d2e4f0684..963b6b1db 100644 --- a/src/js/mapa-argentina/resources/map.svg +++ b/src/js/mapa-argentina/resources/map.svg @@ -1,278 +1,5 @@ - - - - - - - - - Created with Raphaël 2.2.0 - - Provincia de Buenos Aires - - - La Rioja - - - Misiones - - - Santa Cruz - - - La Pampa - - - Mendoza - - - Salta - - - Santiago del Estero - - - Tierra del Fuego, Antártida e Islas del Atlántico Sur - - - Río Negro - - - Catamarca - - - Jujuy - - - Chaco - - - Formosa - - - Entre Ríos - - - Chubut - - - Neuquén - - - Córdoba - - - Tucumán - - - Santa Fe - - - Corrientes - - - San Juan - - - San Luis - - - Ciudad Autónoma de Buenos Aires - - - Ciudad Autónoma de Buenos Aires - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + Created with Raphaël 2.2.0 Provincia de Buenos Aires La Rioja Misiones Santa Cruz La Pampa Mendoza Salta Santiago del Estero Tierra del Fuego, Antártida e Islas del Atlántico Sur Río Negro Catamarca Jujuy Chaco Formosa Entre Ríos Chubut Neuquén Córdoba Tucumán Santa Fe Corrientes San Juan San Luis Ciudad Autónoma de Buenos Aires Ciudad Autónoma de Buenos Aires \ No newline at end of file From 785b7c25a1f7d4237f9f4290726194af4cec585e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Bouillet?= Date: Mon, 1 Jul 2024 09:19:39 -0300 Subject: [PATCH 12/13] =?UTF-8?q?mapa=20est=C3=A1tico?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/mapa-argentina/demo/example-1.html | 2 +- src/js/mapa-argentina/demo/example-2.html | 37 +- src/js/mapa-argentina/demo/example-3.html | 117 ++- src/js/mapa-argentina/demo/example-4.html | 2 +- src/js/mapa-argentina/demo/example-5.html | 8 +- src/js/mapa-argentina/mapa-argentina.js | 843 +++++++++++++++++- .../poncho-map-provinces/demo/example-5.html | 3 +- 7 files changed, 967 insertions(+), 45 deletions(-) diff --git a/src/js/mapa-argentina/demo/example-1.html b/src/js/mapa-argentina/demo/example-1.html index 210ca6874..fe0c807c8 100755 --- a/src/js/mapa-argentina/demo/example-1.html +++ b/src/js/mapa-argentina/demo/example-1.html @@ -67,7 +67,7 @@

🚀 Uso

provinces: ["AR-C", "AR-B", "AR-E", "AR-V"], color: "var(--secondary, orange)", strokeColor: "#ccc", - strokeWidth: .75, + strokeWidth: 1, defaultColor: '#F4F4F4', }; const arg = new ArgentinaMap(options); diff --git a/src/js/mapa-argentina/demo/example-2.html b/src/js/mapa-argentina/demo/example-2.html index fc2269de6..875761b26 100755 --- a/src/js/mapa-argentina/demo/example-2.html +++ b/src/js/mapa-argentina/demo/example-2.html @@ -60,7 +60,7 @@

🚀 Uso

`.mapa { height: auto; overflow: auto; - width: 300px; + width: 400px; padding: 1em; border-radius: 15px; background-color: white;}`); @@ -68,10 +68,37 @@

🚀 Uso

+ + + + \ No newline at end of file diff --git a/src/js/mapa-argentina/demo/example-4.html b/src/js/mapa-argentina/demo/example-4.html index cd8478aa2..8f5360a92 100644 --- a/src/js/mapa-argentina/demo/example-4.html +++ b/src/js/mapa-argentina/demo/example-4.html @@ -29,7 +29,7 @@

Mapa por defecto


🚀 Uso

<script src="js-mapa-svg"></script>
-
<div style="width:300px; height: auto;" id="js-mapa-svg"></div>
+
<div style="width:400px; height: auto;" id="js-mapa-svg"></div>
diff --git a/src/js/mapa-argentina/demo/example-5.html b/src/js/mapa-argentina/demo/example-5.html index 4cbe80091..333e46fb4 100644 --- a/src/js/mapa-argentina/demo/example-5.html +++ b/src/js/mapa-argentina/demo/example-5.html @@ -68,7 +68,7 @@

🚀 Uso

`.mapa { height: auto; overflow: auto; - width: 300px; + width: 400px; padding: 1em; border-radius: 15px; background-color: white;}`); @@ -83,15 +83,15 @@

🚀 Uso

["ENTRE RIOS", color], ["santa FE", color], ["CoRdObA", color], - ["Tierra del fuego", color], + // ["Tierra del fuego", color], ["SALta", color], ], defaultColor: "#f9f9f9", strokeColor: "#ddd", strokeWidth: 1, backgroundColor: "color-mix(in srgb, var(--verde-cemento) 50%, white)", - reprStrokeColor: "color-mix(in srgb, var(--verde-cemento) 70%, black)", - reprStrokeWidth: ".5", + reprStrokeColor: "color-mix(in srgb, var(--verde-cemento) 95%, black)", + reprStrokeWidth: "1", }; const arg = new ArgentinaMap(options); diff --git a/src/js/mapa-argentina/mapa-argentina.js b/src/js/mapa-argentina/mapa-argentina.js index 91e7fe2d9..c10c444bb 100755 --- a/src/js/mapa-argentina/mapa-argentina.js +++ b/src/js/mapa-argentina/mapa-argentina.js @@ -26,8 +26,771 @@ * SOFTWARE. */ -const mapaArgentinaSvg = ` Created with Raphaël 2.2.0 Provincia de Buenos Aires La Rioja Misiones Santa Cruz La Pampa Mendoza Salta Santiago del Estero Tierra del Fuego, Antártida e Islas del Atlántico Sur Río Negro Catamarca Jujuy Chaco Formosa Entre Ríos Chubut Neuquén Córdoba Tucumán Santa Fe Corrientes San Juan San Luis Ciudad Autónoma de Buenos Aires Ciudad Autónoma de Buenos Aires `; +const mapaArgentinaSvg = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`; /** * Hace el render del mapa asignando el selector en el parámetro. @@ -77,7 +840,8 @@ class ArgentinaMap { reprStrokeColor: false, reprStrokeWidth: false, svgTitle: false, - svgDesc: false + svgDesc: false, + provincesTitleAndDesc: [] }; let opts = Object.assign({}, defaults, options); @@ -95,33 +859,49 @@ class ArgentinaMap { this.reprStrokeWidth = opts.reprStrokeWidth; this.svgTitle = opts.svgTitle; this.svgDesc = opts.svgDesc; + this.provincesTitleAndDesc = opts.provincesTitleAndDesc; } - svgTitleAndDesc = (svgTitle, svgDesc) => { - const svg = document.querySelector(`${this.selector} > svg`); + /** + * Elementos title y desc + * @param {string} selector Selector + * @param {string} title Título del elemento SVG + * @param {string} description Descripción del elemento SVG + * @returns {undefined} + */ + elementTitleAndDesc = (selector, title, description) => { + if(typeof title !== "string" && title.trim() === ""){ + return; + } - if(typeof svgDesc === "string" && svgDesc.trim() != ""){ - const desc = document.createElement("desc"); - desc.textContent = svgDesc; - desc.setAttribute("lang", "es"); - svg.children[0].insertAdjacentHTML("beforeBegin", desc.outerHTML); - } + const children = document.querySelectorAll(selector).forEach(ele => { + if(typeof description === "string" && description.trim() != ""){ + const eleDesc = document.createElementNS( + "http://www.w3.org/2000/svg", "desc"); + eleDesc.textContent = description; + eleDesc.setAttribute("lang", "es") + ele.children[0].insertAdjacentElement("beforeBegin", eleDesc); + } - if(typeof svgDesc === "string" && svgDesc.trim() != ""){ - const title = document.createElement("title") - title.textContent = svgTitle; - title.setAttribute("lang", "es"); - svg.children[0].insertAdjacentHTML("beforeBegin", title.outerHTML); - } - } + const eleTitle = document.createElementNS( + "http://www.w3.org/2000/svg", "title"); + eleTitle.textContent = title; + + eleTitle.setAttribute("onmousemove", `showTooltip(evt, 'This is blue')`); + eleTitle.setAttribute("onmouseout", `hideTooltip()`); + + + ele.children[0].insertAdjacentElement("beforeBegin", eleTitle); + }); + }; provincesReference = [ ["AR-A", "Salta"], ["AR-B", "Buenos Aires"], - ["AR-C", "Ciudad Autónoma de Buenos Aires"], ["AR-C", "CABA"], + ["AR-C", "Ciudad Autónoma de Buenos Aires"], ["AR-D", "San Luis"], ["AR-E", "Entre Ríos"], ["AR-F", "La Rioja"], @@ -187,6 +967,7 @@ class ArgentinaMap { */ _stroke = (selector, strokeColor, strokeWidth, directElement=false) => { let selectors = [ + `${selector} g`, `${selector} path`, `${selector} rect`, `${selector} polyline`, @@ -198,7 +979,10 @@ class ArgentinaMap { const mapRect = document.querySelectorAll(selectors); mapRect.forEach(ele => { ele.setAttribute("stroke", strokeColor); - ele.setAttribute("stroke-width", strokeWidth); + console.log(selector) + + ele.setAttribute("stroke-width", strokeWidth); + }); } @@ -263,10 +1047,10 @@ class ArgentinaMap { const color = (typeof strokeColor === "string" && strokeColor.trim() != "" ? strokeColor : this.strokeColor ); - this._stroke("#Layer_2", color, width); - this._stroke("#Sector", color, width); - this._stroke("#Layer_3", color, width); // Bordes antártida - this._stroke("#AR-C_1_", color, width, true); // Bordes CABA zoom + + this._stroke("#Z-AR-V", color, width); // Bordes antártida + this._stroke("#Z-AR-C", color, width); // Bordes CABA zoom + this._stroke("#LIMITE", color, 2); // Bordes CABA zoom }; @@ -283,7 +1067,7 @@ class ArgentinaMap { container.setAttribute("role", "region"); const mapPath = document.querySelectorAll( - `${this.selector} path[id^="AR-"]`); + `${this.selector} [id^="AR-"]`); mapPath.forEach(ele => { if(this.selectiveColor.length){ @@ -313,6 +1097,15 @@ class ArgentinaMap { this._stroke(this.selector, this.strokeColor, this.strokeWidth); this._backgroundColor(this.selector, this.backgroundColor); this._representations(this.reprStrokeColor, this.reprStrokeWidth); - this.svgTitleAndDesc(this.svgTitle, this.svgDesc); + // Casos especiales + this._stroke("#LIMITE", this.reprStrokeColor, "2"); // Bordes CABA zoom + this._stroke("#D-AR-C", 'none', "0"); // Bordes CABA zoom + // + this.elementTitleAndDesc(`${this.selector} > svg`, this.svgTitle, this.svgDesc); + + this.provincesTitleAndDesc.forEach(item => { + this.elementTitleAndDesc(`#${this.matchProvince(item[0])}`, item[1], item[2]) + }); + } } \ No newline at end of file diff --git a/src/js/poncho-map-provinces/demo/example-5.html b/src/js/poncho-map-provinces/demo/example-5.html index 6329747b1..5ffbd0dd6 100644 --- a/src/js/poncho-map-provinces/demo/example-5.html +++ b/src/js/poncho-map-provinces/demo/example-5.html @@ -100,7 +100,6 @@

Mapa con provincia