@vlci/cdmciutat 35.0.0 → 36.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/aigua.js +1 -1
- package/dist/js/analitica.js +1 -1
- package/dist/js/ciclista.js +1 -1
- package/dist/js/contaminacio.js +1 -1
- package/dist/js/emt.js +1 -1
- package/dist/js/energia.js +1 -1
- package/dist/js/initialCalls.js +1 -1
- package/dist/js/legacy.js +1 -1
- package/dist/js/mediAmbient.js +1 -1
- package/dist/js/piae.js +1 -1
- package/dist/js/residus.js +1 -1
- package/dist/js/seuElectronica.js +1 -1
- package/dist/js/soroll.js +1 -1
- package/dist/js/vehicles.js +1 -1
- package/package.json +1 -1
package/dist/js/aigua.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.aigua=e():t.aigua=e()}(self,(()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,o)=>{for(var a in o)t.o(o,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:o[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{MONTHS_YEAR:()=>r,MONTHS_YEAR_SHORT:()=>n,TEXTS_COMMON:()=>i,THRESHOLDS:()=>St,addPointInteger:()=>y,buildCamarasTrafico:()=>Ct,buildTableCalidadAire:()=>At,calculateMaxYAxis:()=>L,calculatePentahoPath:()=>Mt,calculateXAxisStart:()=>I,checkAllGroupsCollapsed:()=>gt,checkAndTransformMaxValue:()=>v,configureDataBar:()=>z,configureDataGaugeCommon:()=>B,configureDataGaugeMonthCommon:()=>k,configureDataLine:()=>R,configureDataValidate:()=>Wt,configureLinesChartValidates:()=>Ut,convertToLanguageSelectorDateRange:()=>st,convertToTableTreeView:()=>pt,downloadCSVTable:()=>yt,downloadPDFTable:()=>bt,formatCellMultiplesLines:()=>ft,formatDayMonthYear:()=>u,formatDecimalNumberfromDotToComma:()=>A,formatMilMillionEuros:()=>F,formatMonthAnyo:()=>c,formatName:()=>x,formatNameHeaderColumn:()=>dt,formatRoundTooltip:()=>N,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>d,formatToMillions:()=>b,formatToTons:()=>S,formatTooltip:()=>w,formatTooltipPie:()=>T,formatTrimestre:()=>m,formatWithPrefix:()=>M,getEnvironment:()=>vt,getMaxFieldNumberFromData:()=>U,getMonth:()=>a,getMonthList:()=>h,getSelectCommonOptions:()=>ot,getSelectTwoColumnsOptions:()=>at,initBarChart:()=>Tt,initBarChartComparationMonth:()=>_t,initChart:()=>C,initElement:()=>E,initStackedBarChart:()=>wt,initStackedBarChartMonthSeries:()=>Lt,initTable:()=>ut,initValueDefaultDate:()=>it,initialCalls:()=>Et,loadIframeOnClickEvent:()=>Rt,printDataChart:()=>D,printDataInHTMLElements:()=>W,printNoDataChart:()=>$,resetFilter:()=>et,resetFilterDate:()=>nt,resetFilterDates:()=>rt,resetFilterToDefault:()=>ct,resultsetWithFields:()=>P,selectConfigDatasource:()=>Q,selectConfigDatasourceAllValue:()=>tt,selectFilterAll:()=>Z,selectValueDefaultInFilter:()=>lt,separateDayMonthYearToSlash:()=>l,splitDataset:()=>J,subtractOneDay:()=>p,subtractOneMonth:()=>g,traverseRows:()=>ht,updateDomElement:()=>j,updateObject:()=>G,updateStackedBarOptions:()=>It});const o={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function a(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}const r={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])},n={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},i={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function l(t){return t.substring(6,8)+"/"+t.substring(4,6)+"/"+t.substring(0,4)}function s(t){return[t.substring(0,4),o[t.substring(4,6)]]}function c(t){const[e,o]=s(t);return`${o} ${e}`}function u(t){const[e,a,r]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${a} ${e}`}function d(t){const[e,o]=s(t);return`${o.substring(0,3)} ${e}`}function f(t){const[e,o]=s(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function h(t,e){const o=t[e];return Array.from(o.values()).map((t=>t.slice(0,3)))}function p(t){const e=Math.floor(t/1e4);let o=new Date(e,t%1e4/100-1,t%100);return o.setDate(o.getDate()-1),`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}${o.getDate().toString().padStart(2,"0")}`}function g(t){let e;const o=new Date(Math.floor(t/100),t%100-1,0);return e=`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}`,e}function y(t,e=2){let o=navigator.language||navigator.userLanguage;o=o.length<=2?`${o}-${o.toUpperCase()}`:o;const a={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===o?t.toLocaleString("de-DE",a):t.toLocaleString(o,a)}function b(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function S(t){return t>=1e3?t/1e3+" Tn":t.toString()}function A(t){return("string"==typeof t?parseFloat(t):t).toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})}function M(t){return t>=1e6?{value:(t/1e6).toFixed(2),unit:"G"}:t>=1e3?{value:(t/1e3).toFixed(2),unit:"M"}:{value:t.toFixed(2),unit:"k"}}function v(t,e){return"GWh"===e?{value:parseFloat((t/1e6).toFixed(2)),unit:"GWh"}:"MWh"===e?{value:parseFloat(t/1e3).toFixed(2),unit:"MWh"}:{value:parseFloat(t).toFixed(2),unit:"kWh"}}function x(t,e=29){if(t.length>=e){const o=t.split(" ");let a="",r="";return o.forEach((t=>{`${a} ${t}`.length<=e?a+=(a?" ":"")+t:(r+=`${a}\n`,a=t)})),r+=a,r}return t}function E(t,e,o="MainContentLoadedCustom"){let a=document.getElementById(t);return a?Promise.resolve(e(a)):new Promise((r=>{document.body.addEventListener(o,(()=>{a=document.getElementById(t),a?r(e(a)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),r(null))}))}))}function C(t,e){return E(t,(t=>{const o=echarts.init(t);o.setOption(e,!0),window.addEventListener("resize",(()=>{null!=o&&void 0!==o&&o.resize()}));const a=document.getElementById("main-content");return a&&(a.addEventListener("shown.bs.collapse",(()=>{o.resize()})),a.addEventListener("hidden.bs.collapse",(()=>{o.resize()}))),o}))}function $(t,e){const o=t?document.querySelector(t):null,a=e?document.querySelector(e):null;o&&(o.hidden=!0),a&&(a.style.background="url('./build/images/nodata1.png') no-repeat top center",a.hidden=!1)}function D(t,e){const o=t?document.querySelector(t):null,a=e?document.querySelector(e):null;o&&(o.hidden=!0),a&&(a.style.background="#ffffff",a.hidden=!1)}function w(t,e=!1,o=!0,a=""){let r=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach((t=>{const n=e?Math.round(t.data):t.data,i=o?`<div style="font-weight: 400;color: #666;">${l=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${l}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${y(n)} ${a}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${y(n)} ${a}`:"-"}\n </span>\n </div>`;var l;r+=i})),r}function I(t){return 100*(t-120)/t}function L(t,e){const o=Math.max(...t);return o+(e-o%e)}function T(t,e=!1){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,a=e?`${t.percent}%`:y(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${a} </span></div>`}function N(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${y(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function F(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${y(o)} €`:o>=e?`${y(o/e)} M €`:"-"}function O(t,e,o=1){const a=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(a/5e3)}function B(t,e,o,a=30,r=15,n=30,i=-70,l=70,s=3){const c=O(t,e.data,1.1),u=l,d=o.slice(),f=[];let m=r,h=n,p=i;for(let o=0;o<t.length;o+=1)f.push({value:t[o][e.data],name:x(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(p)}%`,`${String(m)}%`],fontFamily:"Montserrat",fontSize:a},detail:{offsetCenter:[`${String(p)}%`,`${String(h)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>y(Math.round(t))}}),p+=u,(o+1)%s==0&&(h+=n,m+=2*r,p=i);return[c,f]}function k(t,e,o,r=0){return[O(e,o.data,1),t=>function(t,e,o){const r=y(Math.round(e)),n=a(t[o][0]),i=t[o][1],l=`\n${n} ${i} : ${r}`,s=`${r}\n${n} ${i}`;return window.innerWidth<=1710?l:s}(e,t,r),[{value:e[r][o.data]}]]}function _(t,e){const{resultset:o}={resultset:t},a=new Set,r=new Set,n=o.map((([t,o,n])=>{const i=e?Math.round(n):n;return a.add(t),r.add(o),{day:o,type:t,value:i}})),i=Array.from(r.values()),l=Array.from(a.values());return l.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[l.map((t=>{const e=n.filter((e=>e.type===t)).map((({day:e,value:o})=>[e,t,o])),o=i.map((t=>{const o=e.find((([e])=>e===t));return o?o[2]:null}));return{name:t,data:o}})),l,r]}function R(t,e=[],o=!1){const[a,r,n]=_(t,o);return a.forEach((t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())})),[a,n,r]}function z(t,e,o=!1){const[a,r,n]=_(t,o);return a.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[a,n,r]}function P(t){const{resultset:e,metadata:o}=t,a=[];return e.forEach((t=>{const e={};t.forEach(((t,a)=>{e[o[a].colName]=t})),a.push(e)})),a}function G(t,e){const o={...t};return Object.keys(e).forEach((a=>{Object.prototype.hasOwnProperty.call(e,a)&&("series"===a&&Array.isArray(e[a])?o[a]=e[a].map(((e,o)=>({...Array.isArray(t[a])&&t[a][o]||{},...e}))):"object"!=typeof e[a]||null===e[a]||Array.isArray(e[a])?t[a]!==e[a]&&(o[a]=e[a]):o[a]=G(t[a]||{},e[a]))})),o}function W(t,e){console.log("INICIO HTML");const o=()=>{t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((o=>{const a=o[0],r=o[1];"object"==typeof r?r.className?document.querySelector(r.className).className=t[a]:r.element&&r.format&&(document.querySelector(r.element).textContent=e[t.id][a].format(t[a])):document.querySelector(r).textContent=t[a]}))}))};try{o()}catch(t){document.body.addEventListener("MainContentLoadedCustom",(()=>{o()}))}}function U(t,e){const o=P(t),a=[];let r=null;return o.forEach((t=>{const o=t[e];"number"!=typeof o||Number.isNaN(o)||a.push(o)})),a.length>0&&(r=Math.max(...a)),r}function j(t,e){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function J(t,e=!0){const o={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?o.Cont.push([t[3],t[4],t[2]]):o.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?o.Mob.push([t[3],t[4],t[2]]):o.Mob.push([t[3],t[2]]))})),o}const Y=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],q=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],V=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],H=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],X=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function Z(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function K(t){for(const e of t)if(Array.isArray(e)){if(!K(e))return!1}else if("All"!==e)return!1;return!0}function Q(t,e,o,a){return K(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=a,!0}function tt(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function et(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function ot(t="Todos"){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:t,noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function at(t="Todos"){const e=ot(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function rt(t,e,o,a){const r=Dashboards.getParameterValue(o),n=Dashboards.getParameterValue(a);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[n]),!0}function nt(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function it(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function lt(t,e){const o=Dashboards.getParameterValue(e),a=t.parameter;t.dashboard.setParameter(a,[o])}function st(t){t.regional.es={monthNames:Y,abbreviatedMonthNames:q,dayNames:V,abbreviatedDayNames:H,dayNamesMin:X,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function ct(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function ut(t,e){return E(t,(t=>new Tabulator(t,e)))}function dt(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function ft(t,e){const o=t.getValue().split(" ");let a="",r="";return o.forEach((t=>{(r+t).length<=e?r+=`${t} `:(a+=`${r}<br>`,r=`${t} `)})),a+=`${r}<br>`,a}function mt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach((t=>{t.getTreeChildren().length>0&&mt(t,e)}))}function ht(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&mt(t,e)}))}function pt(t,e,o,a){const r=[];for(const n in t)if(t.hasOwnProperty(n)){const i=t[n],l={[e]:i[0],_children:[]};i.shift(),i.forEach(((t,r)=>{const n={[e]:o[r],[a]:t};l._children.push(n)})),r.push(l)}return r}function gt(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function yt(t,e,o){const a=document.getElementById(o),r=a.cloneNode(!0);a.parentNode.replaceChild(r,a),r.addEventListener("click",(()=>{t.download("csv",`${e}.csv`,{delimiter:";"})}))}function bt(t,e,o){const a=document.getElementById(o),r=a.cloneNode(!0);a.parentNode.replaceChild(r,a),r.addEventListener("click",(()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})}))}const St={SO2:[100,200,350,500,750,751],NO2:[40,90,120,230,340,341],O3:[50,100,130,240,380,381],PM10:[20,40,50,100,150,151],PM25:[10,20,25,50,75,76]};function At(t){const e=[],o={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function a(t,e,a){const r=document.createElement("td");if(r.setAttribute("id",t),null!=e){r.innerHTML=e;const t=function(t,e){let a;return void 0===e?a=6:"ND"===e?a=7:(a=5,t.forEach(((t,o)=>{e<=t&&5===a&&(a=o)}))),o[a]}(a,e);r.classList.add(t)}return r}return t.forEach((t=>{const o=t;"noData"===o.operationalstatus&&(o.so2value="ND",o.no2value="ND",o.o3value="ND",o.pm10value="ND",o.pm25value="ND"),"A09_CABANYAL_60m"===o.entityid&&(o.pm10value=void 0,o.pm25value=void 0);const r=document.createElement("tr"),n=document.createElement("td");n.innerHTML=o.address,r.appendChild(n),r.appendChild(a(`${o.entityid}_so2`,o.so2value,St.SO2)),r.appendChild(a(`${o.entityid}_no2`,o.no2value,St.NO2)),r.appendChild(a(`${o.entityid}_o3`,o.o3value,St.O3)),r.appendChild(a(`${o.entityid}_pm10`,o.pm10value,St.PM10)),r.appendChild(a(`${o.entityid}_pm25`,o.pm25value,St.PM25)),e.push(r)})),e}function Mt(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function vt(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function xt(t,e){document.querySelectorAll(`[${t}]`).forEach((o=>{!function(t,e,o){const a=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(a.innerHTML=this.responseText,o&&o()),404===this.status&&(a.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(o.getAttribute(t),o,e)}))}function Et(t){xt("include-html-cabecera",(function(){!function(){const t=vt();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=vt();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),xt("include-html-menu"),xt("include-html-main-container",(function(){document.body.dispatchEvent(new Event("MainContentLoadedCustom")),function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])}(),t&&t()})),xt("include-html-copyright")}function Ct(t,e,o,a,r,n){let i=!1,l=!1;const s=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(o);t?(s&&(s.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),l=!0):(e.classList.remove("blur"),u(),l=!1)}const f=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(l||u(),i||(i=!0,window.setTimeout(d,n)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(s&&(s.setAttribute("sandbox","allow-scripts"),f(s)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(r).addEventListener("click",(()=>{d(!1),window.setTimeout(d,n)}))):document.querySelectorAll(a)[0].style.display="none"}const $t={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${b(t)}€`}}]},Dt=(t,e)=>{e.sort(((t,e)=>parseInt(t.anyo)-parseInt(e.anyo)));const o={};e.forEach((e=>{const a=e[1],r=e[0];r!==t.seriesName||o[a]||(o[a]=0),r===t.seriesName&&(o[a]+=e[2])}));let a=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(o))a+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${y(r)}</span></div>`;return a};function wt(t,e,o=void 0,a=void 0){const r=null===a?void 0:a,n=new Set(e.map((t=>t[1])));let i;const l={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>Dt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,a,r){const n={},i=r.contentSize[1]/2,l=r.viewSize[1],s=t[1];return s<i?n.top=10:s+i>l?n.bottom=10:n.top=s-i,t[0]<r.viewSize[0]/2?n.left=t[0]+20:n.right=r.viewSize[0]-t[0]+20,n}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>y(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(n),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>y(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};r&&r.itemStyle&&Array.isArray(r.itemStyle.borderColor)&&(i=[...r.itemStyle.borderColor],delete r.itemStyle.borderColor);const o=function(t){return t.reduce(((t,e)=>{const o=e[0];return t[o]||(t[o]=[]),t[o].push(e),t}),{})}(e),a=Object.keys(o);n.forEach((t=>{a.forEach((e=>{void 0===o[e].find((e=>e[1]===t))&&(o[e].push([o[e][0][0],t,void 0]),o[e].sort())}))}));const l=[];return Object.keys(o).forEach((e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=o[e].map((t=>t[2]));let a={};a=void 0!==r?G(t,r):t,l.push({...a})})),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==o?G(l,o):l,C(t,s)}function It(t){let e={};return e=G($t,t),e}function Lt(t,e,o={},r={}){let n={};n=G(o,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach((e=>{t.add(e[1])})),Array.from(t).sort(((t,e)=>t-e))}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},l=null===r?i:G(r,i),s=e;s.forEach(((t,e)=>{s[e][0]=a(t[0])})),wt(t,s,n,l)}function Tt(t,e=void 0){const o={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>N(t,!1)},series:[{type:"bar",showBackground:!0}]};let a={};a=void 0!==e?G(o,e):o,C(t,a)}const Nt="es_ES",Ft={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function Ot(t){return Math.max(...t.map((t=>Number(t[0]))))}function Bt(t){const e=t.filter((e=>Number(e[0])===Ot(t))),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,a])=>{const r=parseInt(e,10)-1;o[r]=a})),o}function kt(t){const e=t.filter((e=>Number(e[0])===Ot(t)-1)),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,a])=>{const r=parseInt(e,10)-1;o[r]=a})),o}function _t(t,e,o=void 0){const a=Ot(e).toString(),r=(Ot(e)-1).toString();Tt(t,G({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[r,a],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:h(Ft,Nt),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:r,type:"bar",data:kt(e)},{name:a,type:"bar",barGap:0,data:Bt(e)}]},o))}function Rt(t,e,o){const a=document.querySelector(e),r=document.querySelector(t);let n=!1;r.addEventListener("click",(()=>{!1===n&&(n=!0,a.setAttribute("src","about:blank"),a.setAttribute("src",o),a.onload=()=>{n=!1})})),r.disabled=!1}const zt="id",Pt="fecha",Gt="value";function Wt(t,e,o,a,r="es_ES"){const[n,i]=function(t,e,o){const a=[],r=[];return t.forEach((t=>{e.includes(`${t[zt]}`)?a.push(`${t[Pt]}`):o.includes(`${t[zt]}`)&&r.push(`${t[Pt]}`)})),[a.map((t=>[t,0])),r.map((t=>[t,0]))]}(t,o,a);let l="es_ES"==r?"Datos sin validar":"Dades sense validar";0===i.length&&(l="");const s={name:"Datos validados",type:"line",data:[...n,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",u="";if(0===i.length){const e=t[t.length-1].fecha;c=e,u=e}else c=i[0][0],u=i[i.length-1][0];return[...e,s,{name:"Datos NO validados",type:"line",data:i,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:l,xAxis:c,yAxis:0},{name:"end",xAxis:u,yAxis:Math.max(...t.filter((t=>null!==t[Gt])).map((t=>parseInt(`${t[Gt]}`,10))))}]]}}]}function Ut(t,e,o=void 0){C(t,G({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>w(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},o))}return e})(),t.exports=e()}},e={};function o(a){var r=e[a];if(void 0!==r)return r.exports;var n=e[a]={exports:{}};return t[a](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var a in e)o.o(e,a)&&!o.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var a={};return(()=>{"use strict";o.r(a),o.d(a,{echartAiguaBarMonth:()=>V,echartAiguaGaugeSemicircle:()=>H,echartAiguaRelojSemicircle:()=>X,echartAiguaStackedBarYears:()=>K,echartBarrisBarYear:()=>Q,echartBarrisGaugeMonth:()=>nt,echartBarrisGaugeYear:()=>rt,echartBarrisLineMonth:()=>tt,echartBenimamet:()=>P,echartConsumAguaBarris:()=>Y,echartConsumTotalAgua:()=>q,echartExposicio:()=>W,echartMalilla:()=>G,echartMestalla:()=>U,echartPerellonet:()=>J,echartSotenis:()=>j});const t="8%",e="2.5%",r="5%",n="18%",i="20%",l="10%",s="90%",c="1%",u="0%",d=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],f=33,m=27,h=30;function p(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const o={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",o):t.toLocaleString(e,o)}function g(t){return 100*(1-17/t)}function y(t,e=!1){let o=`<p>${t[0].name}</p>`;return t.forEach((t=>{const a=e?Math.round(t.data):t.data,r=`<div>${n=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${n}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?p(a):"-"}</strong></div>`;var n;o+=r})),o}function b(t){return p(t)}function S(t){return{1:"GENER",2:"FEBRER",3:"MARÇ",4:"ABRIL",5:"MAIG",6:"JUNY",7:"JULIO",8:"AGOST",9:"SETEMBRE",10:"OCTUBRE",11:"NOVEMBRE",12:"DESEMBRE"}[t]}function A(t,e){const o=t?document.querySelector(t):null,a=e?document.querySelector(e):null;o&&(o.hidden=!0),a&&(a.style.background="url('./build/images/nodata1.png') no-repeat top center",a.hidden=!1)}function M(t,e){const o=t?document.querySelector(t):null,a=e?document.querySelector(e):null;o&&(o.hidden=!0),a&&(a.style.background="#ffffff",a.hidden=!1)}function v(t,e){return t.reduce(((t,o)=>{const a=o[e];return t[a]||(t[a]=[]),t[a].push(o),t}),{})}function x(t,e,o=1){const a=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(a/5e3)}function E(t){return Math.round(document.getElementById(t).offsetWidth/f)}function C(o,a,d,f,m,h,p,g=5,S="",A=m,M=100,v,x=void 0,E=void 0){return{title:{text:S,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>y(t),textStyle:{fontFamily:"Montserrat"}},legend:a?{type:"plain",data:a,textStyle:{fontFamily:"Montserrat"},top:x||t,selected:v}:null,grid:{left:e,right:r,bottom:n,top:a?x?"30%":i:l,heigh:s,containLabel:!0},xAxis:{type:"category",data:d,boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{name:f,nameLocation:"end",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"bold",padding:[0,0,0,p]},type:"value",scale:!0,min:E,axisLabel:{margin:g,formatter:b,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:o,dataZoom:[{show:h,data:d,start:A,end:M,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}],toolbox:{show:h,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:c,top:u}}}function D(t,e,o,a){return{color:d,title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:a,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"},formatter:t=>function(t,e){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${t.color};"></span>`;let a=`${t.name} : `;return a+=`<span style="font-weight:bold">${p(t.value)}</span>`,e&&(a+=`<span> (${t.percent}%)</span>`),o+a}(t,!1)},splitNumber:3,series:{type:"gauge",max:e,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:5},axisLabel:{show:!0,distance:70,formatter:t=>p(Math.round(t)),fontFamily:"Montserrat",color:"#666"},data:o,detail:{fontSize:a/1.2,color:"inherit",formatter:t=>p(Math.round(t))}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:m,top:h}}}function w(t,e,o="",a){return{title:{text:o,left:"center",top:"top",padding:10,textStyle:{fontSize:a,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:x(t,2),itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:10,splitNumber:5,lineStyle:{width:2,color:"#999"}},splitLine:{distance:10,length:14,lineStyle:{width:3,color:"#999"}},axisLabel:{fontFamily:"Montserrat",color:"#666",fontSize:14,show:!0,distance:40,formatter:t=>p(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[-5,"-10%"],fontSize:a+5,fontWeight:"bolder",formatter:o=>function(t,e,o){const a=p(Math.round(e)),r=(n=t[o][0],{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(n.toString(),10)]);var n;const i=t[o][1],l=`\n\n\n${r} ${i} : ${a}`,s=`${a}\n${r} ${i}`;return window.innerWidth<=1710?l:s}(t,o,e),fontFamily:"Montserrat",color:"inherit"},data:[{value:t[e][2]}]},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:m,top:h}}}function I(t){if(t.length>=29){const e=t.split(" ");let o="",a="";for(const t of e)`${o} ${t}`.length<=29?o+=(o?" ":"")+t:(a+=`${o}\n`,o=t);return a+=o,a}return t}function L(t,e,o,a,r){let n=20,i=35,l=-190,s=a;t.length<=2&&(l=-140,s+=100,n=25,i=42);const c=d.slice(),u=[];for(let a=0;a<t.length;a+=1)u.push({value:t[a][e],name:I(t[a][o]),color:c.shift(),title:{offsetCenter:[String(l),`${String(n)}%`],fontFamily:"Montserrat",fontSize:r-3},detail:{offsetCenter:[String(l),`${String(i)}%`],fontFamily:"Montserrat"}}),l+=s,(a+1)%3==0&&(i+=30,n+=30,l=-190);return u}function T(t,e){const o=document.getElementById(t);if(!o)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const a=echarts.init(o);return a.setOption(e,!0),$(window).on("resize",(()=>{null!=a&&void 0!==a&&a.resize()})),a}function N(t){return t.replace(/^(\d{4})[-|\/](\d{2})[-|\/](\d{2})$/g,"$3/$2/$1")}function F(t){return 100*(t-120)/t}function O(t,e,o,a,r,n,i,l,s=!1,c=!1,u=void 0,f=!0,m=d.slice(),h=!1,p=void 0,y=void 0){const b=t.resultset||t;if(0===b.length)A(`#${n}`,`#${i}`),l&&A(`#${l}`,`#${i}`);else{M(`#${i}`,`#${n}`),l&&M(`#${i}`,`#${l}`);const t=function(t,e,o=!1){const{resultset:a}={resultset:t},r=new Set,n=new Set,i=e,l=a.map((([t,e,a])=>{const i=o?Math.round(a):a;return r.add(t),n.add(e),{day:e,type:t,value:i}})),s=Array.from(n.values()),c=Array.from(r.values());return c.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[c.map((t=>{const e=l.filter((e=>e.type===t)).map((({day:e,value:o})=>[e,t,o])),o=s.map((t=>{const o=e.find((([e])=>e===t));return o?o[2]:null}));return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:o}})),n,c]}(b,m,h),d=t[0],A=t[1],v=t[2],x=f?v:null,E=c?(S=A,Array.from(S.values()).map((t=>{const[e,o]=t.split("/");return function(t){const e=t.slice(0,2);return`${t.slice(3,5)}/${e}`}(t)}))):Array.from(A.values());void 0===u&&(u=s?g(A.size):F(A.size)),T(n,C(d,x,E,r,u,e,o,void 0,a,void 0,void 0,void 0,p,y))}var S}function B(t,e,o,a,r,n,i,l,s,c=""){const u=C(t,e,o,a,r,n,s,void 0,c);return u.yAxis.nameTextStyle.align="left",delete u.yAxis.axisLabel.margin,u.yAxis.max=i,u.yAxis.min=l,delete u.toolbox.show,u}const k=-20,_="INJECCIÓ D'AIGUA AL BARRI DE",R=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];function z(t,e,o,a,r){const n=r;if(0===t.resultset.length)$(`#${o}, #${a}`).hide(),$("#no_dataSotenis").css("background","url('./build/images/nodata1.png') no-repeat top center").show();else{$("#no_dataSotenis").hide(),$(`#${o}, #${a}`).css("background","#ffffff").show();const r=function(t,e){const o=t.resultset,a=o.length,r=new Set,n=[];let i;for(let t=0;t<a;t+=1)o[t][6]===e&&(r.add(N(o[t][1])),i={fecha:o[t][1],mesAbr:o[t][4],diaAbr:o[t][3],tipoUso:o[t][7],valor:o[t][8],measureunit:o[t][9]},n.push(i));const l={date:r,dataIndustrial:[],dataDomestic:[],dataMuni:[],dataNoReg:[],arrayDomestic:[],arrayInd:[],arrayMuni:[],arrayNoReg:[],mapData:n};let s,c,u,d,f=0;for(let t=0;t<n.length;t+=1){const e=t+1<n.length?t+1:n.length-1;f+=n[t].valor,"Domèstic"===n[t].tipoUso&&(s=n[t].valor),"Industrial"===n[t].tipoUso&&(c=n[t].valor),"Serv.Municipal"===n[t].tipoUso&&(u=n[t].valor),"Aigua no registrada per comptadors"===n[t].tipoUso&&(d=n[t].valor),n[t].fecha===n[e].fecha&&t!==n.length-1||(l.dataIndustrial.push(c),l.dataDomestic.push(s),l.dataMuni.push(u),l.dataNoReg.push(d),l.arrayDomestic.push(s/f*100),l.arrayInd.push(c/f*100),l.arrayMuni.push(u/f*100),l.arrayNoReg.push(d/f*100),f=0,s=c=u=d=0)}return l}(t,e);!function(t,e,o){const a=F(t.date.size);T(e,B([{name:R[0],type:"line",symbol:"circle",data:t.dataNoReg},{name:R[1],type:"line",symbol:"circle",data:t.dataDomestic},{name:R[2],type:"line",symbol:"circle",data:t.dataIndustrial},{name:R[3],type:"line",symbol:"circle",data:t.dataMuni}],R,Array.from(t.date.values()),t.mapData[0].measureunit,a,!0,null,0,k,o))}(r,o,n),function(t,e,o){const a=F(t.date.size);T(e,B([{name:R[0],type:"bar",stack:"total",data:t.arrayNoReg},{name:R[1],type:"bar",stack:"total",data:t.arrayDomestic},{name:R[2],type:"bar",stack:"total",data:t.arrayInd},{name:R[3],type:"bar",stack:"total",data:t.arrayMuni}],R,Array.from(t.date.values()),"%",a,!0,100,0,k,o))}(r,a,n)}}function P(t,e){z(e,"Benimamet","chartBenimamet","chartBenimametStacked",`${_} BENIMÀMET`)}function G(t,e){z(e,"Malilla","chartMalilla","chartMalillaStacked",`${_} MALILLA`)}function W(t,e){z(e,"Exposicio","chartExposicio","chartExposicioStacked",`${_} EXPOSICIÓ`)}function U(t,e){z(e,"Mestalla","chartMestalla","chartMestallaStacked",`${_} MESTALLA`)}function j(t,e){z(e,"Soternes","chartSotenis","chartSotenisStacked",`${_} SOTERNES`)}function J(t,e){z(e,"Perellonet","chartPerellonet","chartPerellonetStacked",`${_} PERELLONET`)}function Y(t,e){let o=e.resultset.filter((t=>"València Ciutat"!==t[1]));o=o.map((t=>t.slice(1))),O(o,!0,1,"INJECCIÓ D'AIGUA PER BARRIS","m3","chartConsumAguaBarris","no_dataConsumAguaBarris")}function q(t,e){let o=e.resultset.filter((t=>"kpi-valencia-ciudad-total"===t[0]));o=o.map((t=>t.slice(1))),O(o,!0,1,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ DIÀRIA","m3","chartConsumTotalAgua","no_dataConsumTotalAgua",void 0,void 0,void 0,void 0,!1)}function V(t,e){0===e.resultset.length?A("#chartAiguaTotalBarMonth","#no_dataAiguaTotalBarMonth"):(M("#no_dataAiguaTotalBarMonth","#chartAiguaTotalBarMonth"),T("chartAiguaTotalBarMonth",function(t,e,o=-45,a="",r=e){const n=new Set,i=[];t.forEach((t=>{const e=t[0].toString().padStart(2,"0");n.add(`${e}/${t[1]}`),i.push(Math.round(t[2]))}));const l=i.length<100?40:80;return C({name:r,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:i},null,Array.from(n.values()),e,l,!0,o,25,a)}(e.resultset,"m3",void 0,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ MENSUAL","València Ciutat")))}function H(t,e){if(0===e.resultset.length)A("#chartYearAiguaTotalgauge_semicircle","#no_dataYearAiguaTotalgauge_semicircle");else{M("#no_dataYearAiguaTotalgauge_semicircle","#chartYearAiguaTotalgauge_semicircle");const t=E("chartYearAiguaTotalgauge_semicircle"),o=function(t,e="",o){const a=[],r=x(t,1,1.1),n=r.toString().length>=9?100:95,i=115===n?-45:-35;let l=t.length<5?t.length*i:-190;for(let e=0;e<t.length;e+=1)a.push({value:t[e][1],name:String(t[e][0]),title:{offsetCenter:[String(l),"20%"],fontFamily:"Montserrat"},detail:{offsetCenter:[String(l),"35%"],fontFamily:"Montserrat"}}),l+=n;return D(e,r,a,o)}(e.resultset,"INJECCIÓ TOTAL D'AIGUA: ÚLTIMS ANYS",t);T("chartYearAiguaTotalgauge_semicircle",o)}}function X(t,e){if(0===e.resultset.length)A("#chartAiguaTotalreloj_semicircle","#no_dataAiguaTotalreloj_semicircle"),A("#chartAiguaTotalreloj_semicircle_lastmonth","#no_dataAiguaTotalreloj_semicircle_lastmonth");else{M("#no_dataAiguaTotalreloj_semicircle","#chartAiguaTotalreloj_semicircle"),M("#no_dataAiguaTotalreloj_semicircle_lastmonth","#chartAiguaTotalreloj_semicircle_lastmonth");const t=0,o=1,a=e.resultset,r=E("chartAiguaTotalreloj_semicircle");T("chartAiguaTotalreloj_semicircle",w(a,t,"INJECCIÓ TOTAL D'AIGUA: MES ACTUAL",r)),T("chartAiguaTotalreloj_semicircle_lastmonth",w(a,o,"INJECCIÓ TOTAL D'AIGUA: MES ANTERIOR",r))}}var Z=o(2725);function K(t,e){if(0===e.resultset.length)A("#chartAiguaTotalstackedBarYears","#no_dataAiguaTotalstackedBarYears");else{M("#no_dataAiguaTotalstackedBarYears","#chartAiguaTotalstackedBarYears");const t={title:{text:"INJECCIÓ TOTAL D'AIGUA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nm3"}};(0,Z.initStackedBarChartMonthSeries)("chartAiguaTotalstackedBarYears",e.resultset,t)}}function Q(t,o){!function(t,o,a,l,c="",u="total",f=0,m=1,h=2,S=d){if(0===a.length)A(`#${t}`,`#${o}`);else{M(`#${o}`,`#${t}`);const d=[];let A=v(a,f);const x=new Set(a.map((t=>t[m]))),E=Object.keys(A);x.forEach((t=>{E.forEach((e=>{void 0===A[e].find((e=>e[m]===t))&&(A[e].push([A[e][0][f],t,void 0]),A[e][0][1].length>4?A[e].sort(((t,e)=>{const[o,a]=t[1].split("/"),[r,n]=e[1].split("/"),i=new Date(a,o-1,1),l=new Date(n,r-1,1);return i.getTime()-l.getTime()})):A[e].sort())}))}));const C=Object.entries(A).sort(((t,e)=>t[0].localeCompare(e[0]))),$=""===u?90:0;A=Object.fromEntries(C),Object.keys(A).forEach((t=>{d.push({name:t,type:"bar",stack:u,label:{show:!0,fontFamily:"Montserrat",rotate:$,formatter:t=>p(Math.round(t.value))},emphasis:{focus:"series"},data:A[t].map((t=>t[h]))})}));const D=""!==u?g(x.size):100*(1-7/x.size);T(t,{color:S,title:{text:c,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>y(t,!0)},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:e,right:r,bottom:n,top:i,heigh:s,containLabel:!0},yAxis:{type:"value",splitNumber:4,name:l,nameLocation:"end",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666"},axisLabel:{formatter:b,textStyle:{fontSize:8,fontFamily:"Montserrat",color:"#666"}}},xAxis:{type:"category",data:[...x],axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:d,toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50},dataZoom:[{show:!0,data:[...x],start:D,end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}]})}}("chartBarrisBar","no_dataBarrisBar",o.resultset,"m3","INJECCIÓ D'AIGUA PER BARRIS: HISTÒRIC ANUAL","")}function tt(t,e){O(e,!0,1,"INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ: HISTÒRIC MENSUAL","m3","chartBarrisLineMonth","no_dataBarrisLineMonth",void 0,!0,void 0,void 0,void 0,void 0,!0)}const et={es_ES:new Map([["chartNameBarrisGaugeYear","INYECCIÓN DE AGUA POR BARRIOS: EVOLUCIÓN DEL AÑO"]]),ca_ES:new Map([["chartNameBarrisGaugeYear","INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ANY"]])},ot="ca_ES",at={color:void 0,title:{text:"",left:"center",top:"top",padding:10,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"}},splitNumber:3,series:{type:"gauge",max:void 0,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:10},axisLabel:{show:!0,distance:70,formatter:void 0,fontFamily:"Montserrat",color:"#666"},data:[],detail:{fontSize:12,color:"inherit"}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:27,top:30}};function rt(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",(()=>{requestAnimationFrame((()=>{!function(t,e){const o=e.resultset,a=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"];if(0===e.length)(0,Z.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,Z.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e={type:0,data:1,time:2},[r,n]=(0,Z.configureDataGaugeCommon)(o,e,a.slice(),t.fontSize,t.paramOffsetCenterTitle,t.paramOffsetCenterDetail,t.paramOffsetLabel,t.paramCalculatedOffset,t.paramNumberOfElementsByLine),i={...at};i.title.text=t.chartName,i.series.max=r,i.series.data=n,i.series.detail.fontSize=t.fontSize,i.series.detail.formatter=t=>(0,Z.addPointInteger)(Math.round(t)),i.series.axisTick.splitNumber=5,i.color=a.slice(),i.series.axisLabel.formatter=t=>(0,Z.addPointInteger)(Math.round(t)),i.tooltip.formatter=t=>function(t){let e=`${t.name} : `;return e+=`<span style="font-weight:bold">${(0,Z.addPointInteger)(Math.round(t.value))}</span>`,t.marker+e}(t),(0,Z.initChart)(t.idChart,i)}}({idChart:"chartBarrisGaugeYear",idNoData:"no_dataBarrisGaugeYear",chartName:`${et[ot].get("chartNameBarrisGaugeYear")} ${e.resultset[0][2]}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-100,paramCalculatedOffset:100,paramNumberOfElementsByLine:3},e)}))}))}function nt(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",(()=>{requestAnimationFrame((()=>{!function(t,e,o,a,r,n,i){if(0===r.length)A(`#${t}`,`#${o}`),A(`#${e}`,`#${a}`);else{M(`#${o}`,`#${t}`),M(`#${a}`,`#${e}`);const l=0,s=2,c=function(t,e){const o=x(t,e,1.1);let a=50,r=180;o>9999999&&(a=65,r=95);const n=v(t,1);let[i,l]=Object.values(n);return Object.values(n).slice(1).forEach((t=>{l=t})),[l,i,n,o,a,r]}(r,s),u=c[0],d=c[1],f=c[2],m=c[3],h=c[5],p=E(t),g=L(u,s,l,h,p),y=L(d,s,l,h,p);T(t,D(`${n}${S(String(Object.keys(f)[1]))}`,m,g,p)),T(e,D(`${i}${S(String(Object.keys(f)[0]))}`,m,y,p))}}("chartBarrisMesActual","chartBarrisMesAnterior","no_dataBarrisMesActual","no_dataBarrisMesAnterior",e.resultset,"INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ","INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ")}))}))}})(),a})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.aigua=e():t.aigua=e()}(self,()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,o)=>{for(var a in o)t.o(o,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:o[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{MONTHS_YEAR:()=>r,MONTHS_YEAR_SHORT:()=>n,TEXTS_COMMON:()=>i,THRESHOLDS:()=>Mt,addPointInteger:()=>b,buildCamarasTrafico:()=>Dt,buildTableCalidadAire:()=>vt,calculateMaxYAxis:()=>L,calculatePentahoPath:()=>xt,calculateXAxisStart:()=>I,capitalizarTexto:()=>x,checkAllGroupsCollapsed:()=>bt,configureDataBar:()=>P,configureDataGaugeCommon:()=>k,configureDataGaugeMonthCommon:()=>R,configureDataLine:()=>z,configureDataValidate:()=>Jt,configureLinesChartValidates:()=>Wt,convertDateToInteger:()=>y,convertToLanguageSelectorDateRange:()=>ct,convertToTableTreeView:()=>yt,downloadCSVTable:()=>St,downloadPDFTable:()=>At,formatCellMultiplesLines:()=>ht,formatDayMonthYear:()=>u,formatMilMillionEuros:()=>F,formatMonthAnyo:()=>c,formatName:()=>v,formatNameHeaderColumn:()=>mt,formatRoundTooltip:()=>N,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>d,formatToMillions:()=>S,formatToTons:()=>A,formatTooltip:()=>w,formatTooltipPie:()=>T,formatTrimestre:()=>m,formatWithPrefix:()=>M,getEnvironment:()=>Et,getMaxFieldNumberFromData:()=>J,getMonth:()=>a,getMonthList:()=>h,getSelectCommonOptions:()=>at,getSelectTwoColumnsOptions:()=>rt,initBarChart:()=>Ft,initBarChartComparationMonth:()=>zt,initChart:()=>C,initElement:()=>E,initStackedBarChart:()=>Lt,initStackedBarChartMonthSeries:()=>Nt,initTable:()=>ft,initValueDefaultDate:()=>lt,initialCalls:()=>$t,loadIframeOnClickEvent:()=>Pt,printDataChart:()=>D,printDataInHTMLElements:()=>j,printEchart:()=>O,printNoDataChart:()=>$,resetFilter:()=>ot,resetFilterDate:()=>it,resetFilterDates:()=>nt,resetFilterToDefault:()=>ut,resultsetWithFields:()=>G,selectConfigDatasource:()=>tt,selectConfigDatasourceAllValue:()=>et,selectFilterAll:()=>K,selectFilterNumItemsDefault:()=>dt,selectValueDefaultInFilter:()=>st,separateDayMonthYearToSlash:()=>l,splitDataset:()=>Y,subtractOneDay:()=>p,subtractOneMonth:()=>g,traverseRows:()=>gt,updateDomElement:()=>W,updateObject:()=>U,updateStackedBarOptions:()=>Tt});const o={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function a(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}const r={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])},n={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},i={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function s(t){return[t.substring(0,4),o[t.substring(4,6)]]}function c(t){const[e,o]=s(t);return`${o} ${e}`}function u(t){const[e,a,r]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${a} ${e}`}function d(t){const[e,o]=s(t);return`${o.substring(0,3)} ${e}`}function f(t){const[e,o]=s(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function h(t,e){const o=t[e];return Array.from(o.values()).map(t=>t.slice(0,3))}function p(t){const e=Math.floor(t/1e4),o=new Date(e,t%1e4/100-1,t%100);return o.setDate(o.getDate()-1),`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}${o.getDate().toString().padStart(2,"0")}`}function g(t){let e;const o=new Date(Math.floor(t/100),t%100-1,0);return e=`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}`,e}function y(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function b(t,e=2){let o=navigator.language||navigator.userLanguage;o=o.length<=2?`${o}-${o.toUpperCase()}`:o;const a={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===o?t.toLocaleString("de-DE",a):t.toLocaleString(o,a)}function S(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function A(t){return t>=1e3?t/1e3+" Tn":t.toString()}function M(t){let e,o;return t>=1e6?(e=t/1e6,o="G"):t>=1e3?(e=t/1e3,o="M"):(e=t,o="k"),{value:Math.round(100*e)/100,prefix:o}}function v(t,e=29){if(t.length>=e){const o=t.split(" ");let a="",r="";return o.forEach(t=>{`${a} ${t}`.length<=e?a+=(a?" ":"")+t:(r+=`${a}\n`,a=t)}),r+=a,r}return t}function x(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,o)=>e+o[0].toUpperCase())}function E(t,e,o="MainContentLoadedCustom"){let a=document.getElementById(t);return a?Promise.resolve(e(a)):new Promise(r=>{document.body.addEventListener(o,()=>{a=document.getElementById(t),a?r(e(a)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),r(null))})})}function C(t,e){return E(t,t=>{const o=echarts.init(t);o.setOption(e,!0),window.addEventListener("resize",()=>{null!=o&&void 0!==o&&o.resize()});const a=document.getElementById("main-content");return a&&(a.addEventListener("shown.bs.collapse",()=>{o.resize()}),a.addEventListener("hidden.bs.collapse",()=>{o.resize()})),o})}function $(t,e){const o=t?document.querySelector(t):null,a=e?document.querySelector(e):null;o&&(o.hidden=!0),a&&(a.style.background="url('./build/images/nodata1.png') no-repeat top center",a.hidden=!1)}function D(t,e){const o=t?document.querySelector(t):null,a=e?document.querySelector(e):null;o&&(o.hidden=!0),a&&(a.style.background="#ffffff",a.hidden=!1)}function w(t,e=!1,o=!0,a=""){let r=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach(t=>{const n=e?Math.round(t.data):t.data,i=o?`<div style="font-weight: 400;color: #666;">${l=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${l}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${b(n)} ${a}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${b(n)} ${a}`:"-"}\n </span>\n </div>`;var l;r+=i}),r}function I(t){return 100*(t-120)/t}function L(t,e){const o=Math.max(...t);return o+(e-o%e)}function T(t,e=!1){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,a=e?`${t.percent}%`:b(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${a} </span></div>`}function N(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${b(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function F(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${b(o)} €`:o>=e?`${b(o/e)} M €`:"-"}function O(t,e,o){return 0===t.length?($(`#${e}`,`#${o}`),!1):(D(`#${o}`,`#${e}`),!0)}function B(t,e,o=1){const a=Math.max(...t.map(t=>t[e]))*o;return 5e3*Math.ceil(a/5e3)}function k(t,e,o,a=30,r=15,n=30,i=-70,l=70,s=3){const c=B(t,e.data,1.1),u=l,d=o.slice(),f=[];let m=r,h=n,p=i;for(let o=0;o<t.length;o+=1)f.push({value:t[o][e.data],name:v(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(p)}%`,`${String(m)}%`],fontFamily:"Montserrat",fontSize:a},detail:{offsetCenter:[`${String(p)}%`,`${String(h)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>b(Math.round(t))}}),p+=u,(o+1)%s===0&&(h+=n,m+=2*r,p=i);return[c,f]}function R(t,e,o,r=0){return[B(e,o.data,1),t=>function(t,e,o){const r=b(Math.round(e)),n=a(t[o][0]),i=t[o][1],l=`\n${n} ${i} : ${r}`,s=`${r}\n${n} ${i}`;return window.innerWidth<=1710?l:s}(e,t,r),[{value:e[r][o.data]}]]}function _(t,e){const{resultset:o}={resultset:t},a=new Set,r=new Set,n=o.map(([t,o,n])=>{const i=e?Math.round(n):n;return a.add(t),r.add(o),{day:o,type:t,value:i}}),i=Array.from(r.values()),l=Array.from(a.values());return l.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[l.map(t=>{const e=n.filter(e=>e.type===t).map(({day:e,value:o})=>[e,t,o]),o=i.map(t=>{const o=e.find(([e])=>e===t);return o?o[2]:null});return{name:t,data:o}}),l,r]}function z(t,e=[],o=!1){const[a,r,n]=_(t,o);return a.forEach(t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())}),[a,n,r]}function P(t,e,o=!1){const[a,r,n]=_(t,o);return a.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[a,n,r]}function G(t){const{resultset:e,metadata:o}=t,a=[];return e.forEach(t=>{const e={};t.forEach((t,a)=>{e[o[a].colName]=t}),a.push(e)}),a}function U(t,e){const o={...t};return Object.keys(e).forEach(a=>{Object.prototype.hasOwnProperty.call(e,a)&&("series"===a&&Array.isArray(e[a])?o[a]=e[a].map((e,o)=>({...Array.isArray(t[a])&&t[a][o]||{},...e})):"object"!=typeof e[a]||null===e[a]||Array.isArray(e[a])?t[a]!==e[a]&&(o[a]=e[a]):o[a]=U(t[a]||{},e[a]))}),o}function j(t,e){const o=()=>{t.forEach(t=>{t.id in e&&Object.entries(e[t.id]).forEach(o=>{const a=o[0],r=o[1];"object"==typeof r?r.className?document.querySelector(r.className).className=t[a]:r.element&&r.format&&(document.querySelector(r.element).textContent=e[t.id][a].format(t[a])):document.querySelector(r).textContent=t[a]})})};try{o()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{o()})}}function J(t,e){const o=G(t),a=[];let r=null;return o.forEach(t=>{const o=t[e];"number"!=typeof o||Number.isNaN(o)||a.push(o)}),a.length>0&&(r=Math.max(...a)),r}function W(t,e){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function Y(t,e=!0){const o={Cont:[],Mob:[]};return t.forEach(t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?o.Cont.push([t[3],t[4],t[2]]):o.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?o.Mob.push([t[3],t[4],t[2]]):o.Mob.push([t[3],t[2]]))}),o}const q=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],V=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],H=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],X=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],Z=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function K(t){const e=t.resultset.map(t=>t[0]);return this.dashboard.fireChange(this.parameter,e),t}function Q(t){for(const e of t)if(Array.isArray(e)){if(!Q(e))return!1}else if("All"!==e)return!1;return!0}function tt(t,e,o,a){return Q(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=a,!0}function et(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function ot(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function at(t="Todos"){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:t,noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function rt(t="Todos"){const e=at(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function nt(t,e,o,a){const r=Dashboards.getParameterValue(o),n=Dashboards.getParameterValue(a);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[n]),!0}function it(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function lt(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function st(t,e){const o=Dashboards.getParameterValue(e),a=t.parameter;t.dashboard.setParameter(a,[o])}function ct(t){t.regional.es={monthNames:q,abbreviatedMonthNames:V,dayNames:H,abbreviatedDayNames:X,dayNamesMin:Z,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function ut(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function dt(t,e,o,a=0){const r=t.resultset.slice(0,o).map(t=>t[a]);return Dashboards.setParameter(e,r),t}function ft(t,e){return E(t,t=>new Tabulator(t,e))}function mt(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function ht(t,e){const o=t.getValue().split(" ");let a="",r="";return o.forEach(t=>{(r+t).length<=e?r+=`${t} `:(a+=`${r}<br>`,r=`${t} `)}),a+=`${r}<br>`,a}function pt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach(t=>{t.getTreeChildren().length>0&&pt(t,e)})}function gt(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&pt(t,e)})}function yt(t,e,o,a){const r=[];for(const n in t)if(t.hasOwnProperty(n)){const i=t[n],l={[e]:i[0],_children:[]};i.shift(),i.forEach((t,r)=>{const n={[e]:o[r],[a]:t};l._children.push(n)}),r.push(l)}return r}function bt(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function St(t,e,o){const a=document.getElementById(o),r=a.cloneNode(!0);a.parentNode.replaceChild(r,a),r.addEventListener("click",()=>{t.download("csv",`${e}.csv`,{delimiter:";"})})}function At(t,e,o){const a=document.getElementById(o),r=a.cloneNode(!0);a.parentNode.replaceChild(r,a),r.addEventListener("click",()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})})}const Mt={SO2:[100,200,350,500,750,751],NO2:[40,90,120,230,340,341],O3:[50,100,130,240,380,381],PM10:[20,40,50,100,150,151],PM25:[10,20,25,50,75,76]};function vt(t){const e=[],o={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function a(t,e,a){const r=document.createElement("td");if(r.setAttribute("id",t),null!=e){r.innerHTML=e;const t=function(t,e){let a;return void 0===e?a=6:"ND"===e?a=7:(a=5,t.forEach((t,o)=>{e<=t&&5===a&&(a=o)})),o[a]}(a,e);r.classList.add(t)}return r}return t.forEach(t=>{const o=t;"noData"===o.operationalstatus&&(o.so2value="ND",o.no2value="ND",o.o3value="ND",o.pm10value="ND",o.pm25value="ND");const r=document.createElement("tr"),n=document.createElement("td");n.innerHTML=o.address,r.appendChild(n),r.appendChild(a(`${o.entityid}_so2`,o.so2value,Mt.SO2)),r.appendChild(a(`${o.entityid}_no2`,o.no2value,Mt.NO2)),r.appendChild(a(`${o.entityid}_o3`,o.o3value,Mt.O3)),r.appendChild(a(`${o.entityid}_pm10`,o.pm10value,Mt.PM10)),r.appendChild(a(`${o.entityid}_pm25`,o.pm25value,Mt.PM25)),e.push(r)}),e}function xt(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function Et(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function Ct(t,e){document.querySelectorAll(`[${t}]`).forEach(o=>{!function(t,e,o){const a=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(a.innerHTML=this.responseText,o&&o()),404===this.status&&(a.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(o.getAttribute(t),o,e)})}function $t(t){Ct("include-html-cabecera",function(){!function(){const t=Et();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=Et();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Ct("include-html-menu"),Ct("include-html-main-container",function(){document.body.dispatchEvent(new Event("MainContentLoadedCustom")),function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])}(),t&&t()}),Ct("include-html-copyright")}function Dt(t,e,o,a,r,n){let i=!1,l=!1;const s=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(o);t?(s&&(s.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),l=!0):(e.classList.remove("blur"),u(),l=!1)}const f=t=>{new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(l||u(),i||(i=!0,window.setTimeout(d,n)))})}).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(s&&(s.setAttribute("sandbox","allow-scripts"),f(s)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(r).addEventListener("click",()=>{d(!1),window.setTimeout(d,n)})):document.querySelectorAll(a)[0].style.display="none"}const wt={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${S(t)}€`}}]},It=(t,e)=>{e.sort((t,e)=>parseInt(t.anyo)-parseInt(e.anyo));const o={};e.forEach(e=>{const a=e[1],r=e[0];r!==t.seriesName||o[a]||(o[a]=0),r===t.seriesName&&(o[a]+=e[2])});let a=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(o))a+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${b(r)}</span></div>`;return a};function Lt(t,e,o=void 0,a=void 0){const r=null===a?void 0:a,n=new Set(e.map(t=>t[1]));let i;const l={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>It(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,a,r){const n={},i=r.contentSize[1]/2,l=r.viewSize[1],s=t[1];return s<i?n.top=10:s+i>l?n.bottom=10:n.top=s-i,t[0]<r.viewSize[0]/2?n.left=t[0]+20:n.right=r.viewSize[0]-t[0]+20,n}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>b(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(n),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>b(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};r&&r.itemStyle&&Array.isArray(r.itemStyle.borderColor)&&(i=[...r.itemStyle.borderColor],delete r.itemStyle.borderColor);const o=function(t){return t.reduce((t,e)=>{const o=e[0];return t[o]||(t[o]=[]),t[o].push(e),t},{})}(e),a=Object.keys(o);n.forEach(t=>{a.forEach(e=>{void 0===o[e].find(e=>e[1]===t)&&(o[e].push([o[e][0][0],t,void 0]),o[e].sort())})});const l=[];return Object.keys(o).forEach(e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=o[e].map(t=>t[2]);let a={};a=void 0!==r?U(t,r):t,l.push({...a})}),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==o?U(l,o):l,C(t,s)}function Tt(t){let e={};return e=U(wt,t),e}function Nt(t,e,o={},r={}){let n={};n=U(o,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach(e=>{t.add(e[1])}),Array.from(t).sort((t,e)=>t-e)}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},l=null===r?i:U(r,i),s=e;s.forEach((t,e)=>{s[e][0]=a(t[0])}),Lt(t,s,n,l)}function Ft(t,e=void 0){const o={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>N(t,!1)},series:[{type:"bar",showBackground:!0}]};let a={};a=void 0!==e?U(o,e):o,C(t,a)}const Ot="es_ES",Bt={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function kt(t){return Math.max(...t.map(t=>Number(t[0])))}function Rt(t){const e=t.filter(e=>Number(e[0])===kt(t)),o=Array.from({length:12},()=>0);return e.forEach(([t,e,a])=>{const r=parseInt(e,10)-1;o[r]=a}),o}function _t(t){const e=t.filter(e=>Number(e[0])===kt(t)-1),o=Array.from({length:12},()=>0);return e.forEach(([t,e,a])=>{const r=parseInt(e,10)-1;o[r]=a}),o}function zt(t,e,o=void 0){const a=kt(e).toString(),r=(kt(e)-1).toString();Ft(t,U({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[r,a],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:h(Bt,Ot),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:r,type:"bar",data:_t(e)},{name:a,type:"bar",barGap:0,data:Rt(e)}]},o))}function Pt(t,e,o){const a=document.querySelector(e),r=document.querySelector(t);let n=!1;r.addEventListener("click",()=>{!1===n&&(n=!0,a.setAttribute("src","about:blank"),a.setAttribute("src",o),a.onload=()=>{n=!1})}),r.disabled=!1}const Gt="id",Ut="fecha",jt="value";function Jt(t,e,o,a,r="es_ES"){const[n,i]=function(t,e,o){const a=[],r=[];return t.forEach(t=>{e.includes(`${t[Gt]}`)?a.push(`${t[Ut]}`):o.includes(`${t[Gt]}`)&&r.push(`${t[Ut]}`)}),[a.map(t=>[t,0]),r.map(t=>[t,0])]}(t,o,a);let l="es_ES"==r?"Datos sin validar":"Dades sense validar";0===i.length&&(l="");const s={name:"Datos validados",type:"line",data:[...n,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",u="";if(0===i.length){const e=t[t.length-1].fecha;c=e,u=e}else c=i[0][0],u=i[i.length-1][0];return[...e,s,{name:"Datos NO validados",type:"line",data:i,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:l,xAxis:c,yAxis:0},{name:"end",xAxis:u,yAxis:Math.max(...t.filter(t=>null!==t[jt]).map(t=>parseInt(`${t[jt]}`,10)))}]]}}]}function Wt(t,e,o=void 0){C(t,U({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>w(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},o))}return e})(),t.exports=e()}},e={};function o(a){var r=e[a];if(void 0!==r)return r.exports;var n=e[a]={exports:{}};return t[a](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var a in e)o.o(e,a)&&!o.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var a={};return(()=>{"use strict";o.r(a),o.d(a,{echartAiguaBarMonth:()=>V,echartAiguaGaugeSemicircle:()=>H,echartAiguaRelojSemicircle:()=>X,echartAiguaStackedBarYears:()=>K,echartBarrisBarYear:()=>Q,echartBarrisGaugeMonth:()=>nt,echartBarrisGaugeYear:()=>rt,echartBarrisLineMonth:()=>tt,echartBenimamet:()=>P,echartConsumAguaBarris:()=>Y,echartConsumTotalAgua:()=>q,echartExposicio:()=>U,echartMalilla:()=>G,echartMestalla:()=>j,echartPerellonet:()=>W,echartSotenis:()=>J});const t="8%",e="2.5%",r="5%",n="18%",i="20%",l="10%",s="90%",c="1%",u="0%",d=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],f=33,m=27,h=30;function p(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const o={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",o):t.toLocaleString(e,o)}function g(t){return 100*(1-17/t)}function y(t,e=!1){let o=`<p>${t[0].name}</p>`;return t.forEach(t=>{const a=e?Math.round(t.data):t.data,r=`<div>${n=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${n}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?p(a):"-"}</strong></div>`;var n;o+=r}),o}function b(t){return p(t)}function S(t){return{1:"GENER",2:"FEBRER",3:"MARÇ",4:"ABRIL",5:"MAIG",6:"JUNY",7:"JULIO",8:"AGOST",9:"SETEMBRE",10:"OCTUBRE",11:"NOVEMBRE",12:"DESEMBRE"}[t]}function A(t,e){const o=t?document.querySelector(t):null,a=e?document.querySelector(e):null;o&&(o.hidden=!0),a&&(a.style.background="url('./build/images/nodata1.png') no-repeat top center",a.hidden=!1)}function M(t,e){const o=t?document.querySelector(t):null,a=e?document.querySelector(e):null;o&&(o.hidden=!0),a&&(a.style.background="#ffffff",a.hidden=!1)}function v(t,e){return t.reduce((t,o)=>{const a=o[e];return t[a]||(t[a]=[]),t[a].push(o),t},{})}function x(t,e,o=1){const a=Math.max(...t.map(t=>t[e]))*o;return 5e3*Math.ceil(a/5e3)}function E(t){return Math.round(document.getElementById(t).offsetWidth/f)}function C(o,a,d,f,m,h,p,g=5,S="",A=m,M=100,v,x=void 0,E=void 0){return{title:{text:S,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>y(t),textStyle:{fontFamily:"Montserrat"}},legend:a?{type:"plain",data:a,textStyle:{fontFamily:"Montserrat"},top:x||t,selected:v}:null,grid:{left:e,right:r,bottom:n,top:a?x?"30%":i:l,heigh:s,containLabel:!0},xAxis:{type:"category",data:d,boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{name:f,nameLocation:"end",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"bold",padding:[0,0,0,p]},type:"value",scale:!0,min:E,axisLabel:{margin:g,formatter:b,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:o,dataZoom:[{show:h,data:d,start:A,end:M,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}],toolbox:{show:h,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:c,top:u}}}function D(t,e,o,a){return{color:d,title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:a,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"},formatter:t=>function(t,e){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${t.color};"></span>`;let a=`${t.name} : `;return a+=`<span style="font-weight:bold">${p(t.value)}</span>`,e&&(a+=`<span> (${t.percent}%)</span>`),o+a}(t,!1)},splitNumber:3,series:{type:"gauge",max:e,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:5},axisLabel:{show:!0,distance:70,formatter:t=>p(Math.round(t)),fontFamily:"Montserrat",color:"#666"},data:o,detail:{fontSize:a/1.2,color:"inherit",formatter:t=>p(Math.round(t))}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:m,top:h}}}function w(t,e,o="",a){return{title:{text:o,left:"center",top:"top",padding:10,textStyle:{fontSize:a,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:x(t,2),itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:10,splitNumber:5,lineStyle:{width:2,color:"#999"}},splitLine:{distance:10,length:14,lineStyle:{width:3,color:"#999"}},axisLabel:{fontFamily:"Montserrat",color:"#666",fontSize:14,show:!0,distance:40,formatter:t=>p(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[-5,"-10%"],fontSize:a+5,fontWeight:"bolder",formatter:o=>function(t,e,o){const a=p(Math.round(e)),r=(n=t[o][0],{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(n.toString(),10)]);var n;const i=t[o][1],l=`\n\n\n${r} ${i} : ${a}`,s=`${a}\n${r} ${i}`;return window.innerWidth<=1710?l:s}(t,o,e),fontFamily:"Montserrat",color:"inherit"},data:[{value:t[e][2]}]},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:m,top:h}}}function I(t){if(t.length>=29){const e=t.split(" ");let o="",a="";for(const t of e)`${o} ${t}`.length<=29?o+=(o?" ":"")+t:(a+=`${o}\n`,o=t);return a+=o,a}return t}function L(t,e,o,a,r){let n=20,i=35,l=-190,s=a;t.length<=2&&(l=-140,s+=100,n=25,i=42);const c=d.slice(),u=[];for(let a=0;a<t.length;a+=1)u.push({value:t[a][e],name:I(t[a][o]),color:c.shift(),title:{offsetCenter:[String(l),`${String(n)}%`],fontFamily:"Montserrat",fontSize:r-3},detail:{offsetCenter:[String(l),`${String(i)}%`],fontFamily:"Montserrat"}}),l+=s,(a+1)%3==0&&(i+=30,n+=30,l=-190);return u}function T(t,e){const o=document.getElementById(t);if(!o)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const a=echarts.init(o);return a.setOption(e,!0),$(window).on("resize",()=>{null!=a&&void 0!==a&&a.resize()}),a}function N(t){return t.replace(/^(\d{4})[-|\/](\d{2})[-|\/](\d{2})$/g,"$3/$2/$1")}function F(t){return 100*(t-120)/t}function O(t,e,o,a,r,n,i,l,s=!1,c=!1,u=void 0,f=!0,m=d.slice(),h=!1,p=void 0,y=void 0){const b=t.resultset||t;if(0===b.length)A(`#${n}`,`#${i}`),l&&A(`#${l}`,`#${i}`);else{M(`#${i}`,`#${n}`),l&&M(`#${i}`,`#${l}`);const t=function(t,e,o=!1){const{resultset:a}={resultset:t},r=new Set,n=new Set,i=e,l=a.map(([t,e,a])=>{const i=o?Math.round(a):a;return r.add(t),n.add(e),{day:e,type:t,value:i}}),s=Array.from(n.values()),c=Array.from(r.values());return c.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[c.map(t=>{const e=l.filter(e=>e.type===t).map(({day:e,value:o})=>[e,t,o]),o=s.map(t=>{const o=e.find(([e])=>e===t);return o?o[2]:null});return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:o}}),n,c]}(b,m,h),d=t[0],A=t[1],v=t[2],x=f?v:null,E=c?(S=A,Array.from(S.values()).map(t=>{const[e,o]=t.split("/");return function(t){const e=t.slice(0,2);return`${t.slice(3,5)}/${e}`}(t)})):Array.from(A.values());void 0===u&&(u=s?g(A.size):F(A.size)),T(n,C(d,x,E,r,u,e,o,void 0,a,void 0,void 0,void 0,p,y))}var S}function B(t,e,o,a,r,n,i,l,s,c=""){const u=C(t,e,o,a,r,n,s,void 0,c);return u.yAxis.nameTextStyle.align="left",delete u.yAxis.axisLabel.margin,u.yAxis.max=i,u.yAxis.min=l,delete u.toolbox.show,u}const k=-20,R="INJECCIÓ D'AIGUA AL BARRI DE",_=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];function z(t,e,o,a,r){const n=r;if(0===t.resultset.length)$(`#${o}, #${a}`).hide(),$("#no_dataSotenis").css("background","url('./build/images/nodata1.png') no-repeat top center").show();else{$("#no_dataSotenis").hide(),$(`#${o}, #${a}`).css("background","#ffffff").show();const r=function(t,e){const o=t.resultset,a=o.length,r=new Set,n=[];let i;for(let t=0;t<a;t+=1)o[t][6]===e&&(r.add(N(o[t][1])),i={fecha:o[t][1],mesAbr:o[t][4],diaAbr:o[t][3],tipoUso:o[t][7],valor:o[t][8],measureunit:o[t][9]},n.push(i));const l={date:r,dataIndustrial:[],dataDomestic:[],dataMuni:[],dataNoReg:[],arrayDomestic:[],arrayInd:[],arrayMuni:[],arrayNoReg:[],mapData:n};let s,c,u,d,f=0;for(let t=0;t<n.length;t+=1){const e=t+1<n.length?t+1:n.length-1;f+=n[t].valor,"Domèstic"===n[t].tipoUso&&(s=n[t].valor),"Industrial"===n[t].tipoUso&&(c=n[t].valor),"Serv.Municipal"===n[t].tipoUso&&(u=n[t].valor),"Aigua no registrada per comptadors"===n[t].tipoUso&&(d=n[t].valor),n[t].fecha===n[e].fecha&&t!==n.length-1||(l.dataIndustrial.push(c),l.dataDomestic.push(s),l.dataMuni.push(u),l.dataNoReg.push(d),l.arrayDomestic.push(s/f*100),l.arrayInd.push(c/f*100),l.arrayMuni.push(u/f*100),l.arrayNoReg.push(d/f*100),f=0,s=c=u=d=0)}return l}(t,e);!function(t,e,o){const a=F(t.date.size);T(e,B([{name:_[0],type:"line",symbol:"circle",data:t.dataNoReg},{name:_[1],type:"line",symbol:"circle",data:t.dataDomestic},{name:_[2],type:"line",symbol:"circle",data:t.dataIndustrial},{name:_[3],type:"line",symbol:"circle",data:t.dataMuni}],_,Array.from(t.date.values()),t.mapData[0].measureunit,a,!0,null,0,k,o))}(r,o,n),function(t,e,o){const a=F(t.date.size);T(e,B([{name:_[0],type:"bar",stack:"total",data:t.arrayNoReg},{name:_[1],type:"bar",stack:"total",data:t.arrayDomestic},{name:_[2],type:"bar",stack:"total",data:t.arrayInd},{name:_[3],type:"bar",stack:"total",data:t.arrayMuni}],_,Array.from(t.date.values()),"%",a,!0,100,0,k,o))}(r,a,n)}}function P(t,e){z(e,"Benimamet","chartBenimamet","chartBenimametStacked",`${R} BENIMÀMET`)}function G(t,e){z(e,"Malilla","chartMalilla","chartMalillaStacked",`${R} MALILLA`)}function U(t,e){z(e,"Exposicio","chartExposicio","chartExposicioStacked",`${R} EXPOSICIÓ`)}function j(t,e){z(e,"Mestalla","chartMestalla","chartMestallaStacked",`${R} MESTALLA`)}function J(t,e){z(e,"Soternes","chartSotenis","chartSotenisStacked",`${R} SOTERNES`)}function W(t,e){z(e,"Perellonet","chartPerellonet","chartPerellonetStacked",`${R} PERELLONET`)}function Y(t,e){let o=e.resultset.filter(t=>"València Ciutat"!==t[1]);o=o.map(t=>t.slice(1)),O(o,!0,1,"INJECCIÓ D'AIGUA PER BARRIS","m3","chartConsumAguaBarris","no_dataConsumAguaBarris")}function q(t,e){let o=e.resultset.filter(t=>"kpi-valencia-ciudad-total"===t[0]);o=o.map(t=>t.slice(1)),O(o,!0,1,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ DIÀRIA","m3","chartConsumTotalAgua","no_dataConsumTotalAgua",void 0,void 0,void 0,void 0,!1)}function V(t,e){0===e.resultset.length?A("#chartAiguaTotalBarMonth","#no_dataAiguaTotalBarMonth"):(M("#no_dataAiguaTotalBarMonth","#chartAiguaTotalBarMonth"),T("chartAiguaTotalBarMonth",function(t,e,o=-45,a="",r=e){const n=new Set,i=[];t.forEach(t=>{const e=t[0].toString().padStart(2,"0");n.add(`${e}/${t[1]}`),i.push(Math.round(t[2]))});const l=i.length<100?40:80;return C({name:r,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:i},null,Array.from(n.values()),e,l,!0,o,25,a)}(e.resultset,"m3",void 0,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ MENSUAL","València Ciutat")))}function H(t,e){if(0===e.resultset.length)A("#chartYearAiguaTotalgauge_semicircle","#no_dataYearAiguaTotalgauge_semicircle");else{M("#no_dataYearAiguaTotalgauge_semicircle","#chartYearAiguaTotalgauge_semicircle");const t=E("chartYearAiguaTotalgauge_semicircle"),o=function(t,e="",o){const a=[],r=x(t,1,1.1),n=r.toString().length>=9?100:95,i=115===n?-45:-35;let l=t.length<5?t.length*i:-190;for(let e=0;e<t.length;e+=1)a.push({value:t[e][1],name:String(t[e][0]),title:{offsetCenter:[String(l),"20%"],fontFamily:"Montserrat"},detail:{offsetCenter:[String(l),"35%"],fontFamily:"Montserrat"}}),l+=n;return D(e,r,a,o)}(e.resultset,"INJECCIÓ TOTAL D'AIGUA: ÚLTIMS ANYS",t);T("chartYearAiguaTotalgauge_semicircle",o)}}function X(t,e){if(0===e.resultset.length)A("#chartAiguaTotalreloj_semicircle","#no_dataAiguaTotalreloj_semicircle"),A("#chartAiguaTotalreloj_semicircle_lastmonth","#no_dataAiguaTotalreloj_semicircle_lastmonth");else{M("#no_dataAiguaTotalreloj_semicircle","#chartAiguaTotalreloj_semicircle"),M("#no_dataAiguaTotalreloj_semicircle_lastmonth","#chartAiguaTotalreloj_semicircle_lastmonth");const t=0,o=1,a=e.resultset,r=E("chartAiguaTotalreloj_semicircle");T("chartAiguaTotalreloj_semicircle",w(a,t,"INJECCIÓ TOTAL D'AIGUA: MES ACTUAL",r)),T("chartAiguaTotalreloj_semicircle_lastmonth",w(a,o,"INJECCIÓ TOTAL D'AIGUA: MES ANTERIOR",r))}}var Z=o(2725);function K(t,e){if(0===e.resultset.length)A("#chartAiguaTotalstackedBarYears","#no_dataAiguaTotalstackedBarYears");else{M("#no_dataAiguaTotalstackedBarYears","#chartAiguaTotalstackedBarYears");const t={title:{text:"INJECCIÓ TOTAL D'AIGUA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nm3"}};(0,Z.initStackedBarChartMonthSeries)("chartAiguaTotalstackedBarYears",e.resultset,t)}}function Q(t,o){!function(t,o,a,l,c="",u="total",f=0,m=1,h=2,S=d){if(0===a.length)A(`#${t}`,`#${o}`);else{M(`#${o}`,`#${t}`);const d=[];let A=v(a,f);const x=new Set(a.map(t=>t[m])),E=Object.keys(A);x.forEach(t=>{E.forEach(e=>{void 0===A[e].find(e=>e[m]===t)&&(A[e].push([A[e][0][f],t,void 0]),A[e][0][1].length>4?A[e].sort((t,e)=>{const[o,a]=t[1].split("/"),[r,n]=e[1].split("/"),i=new Date(a,o-1,1),l=new Date(n,r-1,1);return i.getTime()-l.getTime()}):A[e].sort())})});const C=Object.entries(A).sort((t,e)=>t[0].localeCompare(e[0])),$=""===u?90:0;A=Object.fromEntries(C),Object.keys(A).forEach(t=>{d.push({name:t,type:"bar",stack:u,label:{show:!0,fontFamily:"Montserrat",rotate:$,formatter:t=>p(Math.round(t.value))},emphasis:{focus:"series"},data:A[t].map(t=>t[h])})});const D=""!==u?g(x.size):100*(1-7/x.size);T(t,{color:S,title:{text:c,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>y(t,!0)},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:e,right:r,bottom:n,top:i,heigh:s,containLabel:!0},yAxis:{type:"value",splitNumber:4,name:l,nameLocation:"end",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666"},axisLabel:{formatter:b,textStyle:{fontSize:8,fontFamily:"Montserrat",color:"#666"}}},xAxis:{type:"category",data:[...x],axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:d,toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50},dataZoom:[{show:!0,data:[...x],start:D,end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}]})}}("chartBarrisBar","no_dataBarrisBar",o.resultset,"m3","INJECCIÓ D'AIGUA PER BARRIS: HISTÒRIC ANUAL","")}function tt(t,e){O(e,!0,1,"INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ: HISTÒRIC MENSUAL","m3","chartBarrisLineMonth","no_dataBarrisLineMonth",void 0,!0,void 0,void 0,void 0,void 0,!0)}const et={es_ES:new Map([["chartNameBarrisGaugeYear","INYECCIÓN DE AGUA POR BARRIOS: EVOLUCIÓN DEL AÑO"]]),ca_ES:new Map([["chartNameBarrisGaugeYear","INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ANY"]])},ot="ca_ES",at={color:void 0,title:{text:"",left:"center",top:"top",padding:10,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"}},splitNumber:3,series:{type:"gauge",max:void 0,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:10},axisLabel:{show:!0,distance:70,formatter:void 0,fontFamily:"Montserrat",color:"#666"},data:[],detail:{fontSize:12,color:"inherit"}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:27,top:30}};function rt(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",()=>{requestAnimationFrame(()=>{!function(t,e){const o=e.resultset,a=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"];if(0===e.length)(0,Z.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,Z.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e={type:0,data:1,time:2},[r,n]=(0,Z.configureDataGaugeCommon)(o,e,a.slice(),t.fontSize,t.paramOffsetCenterTitle,t.paramOffsetCenterDetail,t.paramOffsetLabel,t.paramCalculatedOffset,t.paramNumberOfElementsByLine),i={...at};i.title.text=t.chartName,i.series.max=r,i.series.data=n,i.series.detail.fontSize=t.fontSize,i.series.detail.formatter=t=>(0,Z.addPointInteger)(Math.round(t)),i.series.axisTick.splitNumber=5,i.color=a.slice(),i.series.axisLabel.formatter=t=>(0,Z.addPointInteger)(Math.round(t)),i.tooltip.formatter=t=>function(t){let e=`${t.name} : `;return e+=`<span style="font-weight:bold">${(0,Z.addPointInteger)(Math.round(t.value))}</span>`,t.marker+e}(t),(0,Z.initChart)(t.idChart,i)}}({idChart:"chartBarrisGaugeYear",idNoData:"no_dataBarrisGaugeYear",chartName:`${et[ot].get("chartNameBarrisGaugeYear")} ${e.resultset[0][2]}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-100,paramCalculatedOffset:100,paramNumberOfElementsByLine:3},e)})})}function nt(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",()=>{requestAnimationFrame(()=>{!function(t,e,o,a,r,n,i){if(0===r.length)A(`#${t}`,`#${o}`),A(`#${e}`,`#${a}`);else{M(`#${o}`,`#${t}`),M(`#${a}`,`#${e}`);const l=0,s=2,c=function(t,e){const o=x(t,e,1.1);let a=50,r=180;o>9999999&&(a=65,r=95);const n=v(t,1);let[i,l]=Object.values(n);return Object.values(n).slice(1).forEach(t=>{l=t}),[l,i,n,o,a,r]}(r,s),u=c[0],d=c[1],f=c[2],m=c[3],h=c[5],p=E(t),g=L(u,s,l,h,p),y=L(d,s,l,h,p);T(t,D(`${n}${S(String(Object.keys(f)[1]))}`,m,g,p)),T(e,D(`${i}${S(String(Object.keys(f)[0]))}`,m,y,p))}}("chartBarrisMesActual","chartBarrisMesAnterior","no_dataBarrisMesActual","no_dataBarrisMesAnterior",e.resultset,"INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ","INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ")})})}})(),a})());
|
package/dist/js/analitica.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.analitica=e():t.analitica=e()}(self,(()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{MONTHS_YEAR:()=>r,MONTHS_YEAR_SHORT:()=>a,TEXTS_COMMON:()=>i,THRESHOLDS:()=>St,addPointInteger:()=>g,buildCamarasTrafico:()=>Ct,buildTableCalidadAire:()=>vt,calculateMaxYAxis:()=>N,calculatePentahoPath:()=>Mt,calculateXAxisStart:()=>$,checkAllGroupsCollapsed:()=>yt,checkAndTransformMaxValue:()=>A,configureDataBar:()=>W,configureDataGaugeCommon:()=>k,configureDataGaugeMonthCommon:()=>P,configureDataLine:()=>_,configureDataValidate:()=>qt,configureLinesChartValidates:()=>Jt,convertToLanguageSelectorDateRange:()=>st,convertToTableTreeView:()=>ht,downloadCSVTable:()=>gt,downloadPDFTable:()=>bt,formatCellMultiplesLines:()=>ft,formatDayMonthYear:()=>u,formatDecimalNumberfromDotToComma:()=>v,formatMilMillionEuros:()=>T,formatMonthAnyo:()=>c,formatName:()=>x,formatNameHeaderColumn:()=>dt,formatRoundTooltip:()=>O,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>d,formatToMillions:()=>b,formatToTons:()=>S,formatTooltip:()=>F,formatTooltipPie:()=>L,formatTrimestre:()=>m,formatWithPrefix:()=>M,getEnvironment:()=>At,getMaxFieldNumberFromData:()=>J,getMonth:()=>n,getMonthList:()=>p,getSelectCommonOptions:()=>ot,getSelectTwoColumnsOptions:()=>nt,initBarChart:()=>Lt,initBarChartComparationMonth:()=>zt,initChart:()=>C,initElement:()=>E,initStackedBarChart:()=>Ft,initStackedBarChartMonthSeries:()=>Nt,initTable:()=>ut,initValueDefaultDate:()=>it,initialCalls:()=>Et,loadIframeOnClickEvent:()=>_t,printDataChart:()=>w,printDataInHTMLElements:()=>q,printNoDataChart:()=>D,resetFilter:()=>et,resetFilterDate:()=>at,resetFilterDates:()=>rt,resetFilterToDefault:()=>ct,resultsetWithFields:()=>B,selectConfigDatasource:()=>Q,selectConfigDatasourceAllValue:()=>tt,selectFilterAll:()=>Z,selectValueDefaultInFilter:()=>lt,separateDayMonthYearToSlash:()=>l,splitDataset:()=>V,subtractOneDay:()=>h,subtractOneMonth:()=>y,traverseRows:()=>pt,updateDomElement:()=>j,updateObject:()=>R,updateStackedBarOptions:()=>$t});const o={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function n(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}const r={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])},a={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},i={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function l(t){return t.substring(6,8)+"/"+t.substring(4,6)+"/"+t.substring(0,4)}function s(t){return[t.substring(0,4),o[t.substring(4,6)]]}function c(t){const[e,o]=s(t);return`${o} ${e}`}function u(t){const[e,n,r]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${n} ${e}`}function d(t){const[e,o]=s(t);return`${o.substring(0,3)} ${e}`}function f(t){const[e,o]=s(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function p(t,e){const o=t[e];return Array.from(o.values()).map((t=>t.slice(0,3)))}function h(t){const e=Math.floor(t/1e4);let o=new Date(e,t%1e4/100-1,t%100);return o.setDate(o.getDate()-1),`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}${o.getDate().toString().padStart(2,"0")}`}function y(t){let e;const o=new Date(Math.floor(t/100),t%100-1,0);return e=`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}`,e}function g(t,e=2){let o=navigator.language||navigator.userLanguage;o=o.length<=2?`${o}-${o.toUpperCase()}`:o;const n={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===o?t.toLocaleString("de-DE",n):t.toLocaleString(o,n)}function b(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function S(t){return t>=1e3?t/1e3+" Tn":t.toString()}function v(t){return("string"==typeof t?parseFloat(t):t).toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})}function M(t){return t>=1e6?{value:(t/1e6).toFixed(2),unit:"G"}:t>=1e3?{value:(t/1e3).toFixed(2),unit:"M"}:{value:t.toFixed(2),unit:"k"}}function A(t,e){return"GWh"===e?{value:parseFloat((t/1e6).toFixed(2)),unit:"GWh"}:"MWh"===e?{value:parseFloat(t/1e3).toFixed(2),unit:"MWh"}:{value:parseFloat(t).toFixed(2),unit:"kWh"}}function x(t,e=29){if(t.length>=e){const o=t.split(" ");let n="",r="";return o.forEach((t=>{`${n} ${t}`.length<=e?n+=(n?" ":"")+t:(r+=`${n}\n`,n=t)})),r+=n,r}return t}function E(t,e,o="MainContentLoadedCustom"){let n=document.getElementById(t);return n?Promise.resolve(e(n)):new Promise((r=>{document.body.addEventListener(o,(()=>{n=document.getElementById(t),n?r(e(n)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),r(null))}))}))}function C(t,e){return E(t,(t=>{const o=echarts.init(t);o.setOption(e,!0),window.addEventListener("resize",(()=>{null!=o&&void 0!==o&&o.resize()}));const n=document.getElementById("main-content");return n&&(n.addEventListener("shown.bs.collapse",(()=>{o.resize()})),n.addEventListener("hidden.bs.collapse",(()=>{o.resize()}))),o}))}function D(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function w(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function F(t,e=!1,o=!0,n=""){let r=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach((t=>{const a=e?Math.round(t.data):t.data,i=o?`<div style="font-weight: 400;color: #666;">${l=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${l}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${g(a)} ${n}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${g(a)} ${n}`:"-"}\n </span>\n </div>`;var l;r+=i})),r}function $(t){return 100*(t-120)/t}function N(t,e){const o=Math.max(...t);return o+(e-o%e)}function L(t,e=!1){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,n=e?`${t.percent}%`:g(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${n} </span></div>`}function O(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${g(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function T(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${g(o)} €`:o>=e?`${g(o/e)} M €`:"-"}function I(t,e,o=1){const n=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(n/5e3)}function k(t,e,o,n=30,r=15,a=30,i=-70,l=70,s=3){const c=I(t,e.data,1.1),u=l,d=o.slice(),f=[];let m=r,p=a,h=i;for(let o=0;o<t.length;o+=1)f.push({value:t[o][e.data],name:x(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(h)}%`,`${String(m)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(h)}%`,`${String(p)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>g(Math.round(t))}}),h+=u,(o+1)%s==0&&(p+=a,m+=2*r,h=i);return[c,f]}function P(t,e,o,r=0){return[I(e,o.data,1),t=>function(t,e,o){const r=g(Math.round(e)),a=n(t[o][0]),i=t[o][1],l=`\n${a} ${i} : ${r}`,s=`${r}\n${a} ${i}`;return window.innerWidth<=1710?l:s}(e,t,r),[{value:e[r][o.data]}]]}function z(t,e){const{resultset:o}={resultset:t},n=new Set,r=new Set,a=o.map((([t,o,a])=>{const i=e?Math.round(a):a;return n.add(t),r.add(o),{day:o,type:t,value:i}})),i=Array.from(r.values()),l=Array.from(n.values());return l.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[l.map((t=>{const e=a.filter((e=>e.type===t)).map((({day:e,value:o})=>[e,t,o])),o=i.map((t=>{const o=e.find((([e])=>e===t));return o?o[2]:null}));return{name:t,data:o}})),l,r]}function _(t,e=[],o=!1){const[n,r,a]=z(t,o);return n.forEach((t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())})),[n,a,r]}function W(t,e,o=!1){const[n,r,a]=z(t,o);return n.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[n,a,r]}function B(t){const{resultset:e,metadata:o}=t,n=[];return e.forEach((t=>{const e={};t.forEach(((t,n)=>{e[o[n].colName]=t})),n.push(e)})),n}function R(t,e){const o={...t};return Object.keys(e).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&("series"===n&&Array.isArray(e[n])?o[n]=e[n].map(((e,o)=>({...Array.isArray(t[n])&&t[n][o]||{},...e}))):"object"!=typeof e[n]||null===e[n]||Array.isArray(e[n])?t[n]!==e[n]&&(o[n]=e[n]):o[n]=R(t[n]||{},e[n]))})),o}function q(t,e){console.log("INICIO HTML");const o=()=>{t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((o=>{const n=o[0],r=o[1];"object"==typeof r?r.className?document.querySelector(r.className).className=t[n]:r.element&&r.format&&(document.querySelector(r.element).textContent=e[t.id][n].format(t[n])):document.querySelector(r).textContent=t[n]}))}))};try{o()}catch(t){document.body.addEventListener("MainContentLoadedCustom",(()=>{o()}))}}function J(t,e){const o=B(t),n=[];let r=null;return o.forEach((t=>{const o=t[e];"number"!=typeof o||Number.isNaN(o)||n.push(o)})),n.length>0&&(r=Math.max(...n)),r}function j(t,e){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function V(t,e=!0){const o={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?o.Cont.push([t[3],t[4],t[2]]):o.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?o.Mob.push([t[3],t[4],t[2]]):o.Mob.push([t[3],t[2]]))})),o}const G=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],H=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],Y=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],U=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],X=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function Z(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function K(t){for(const e of t)if(Array.isArray(e)){if(!K(e))return!1}else if("All"!==e)return!1;return!0}function Q(t,e,o,n){return K(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function tt(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function et(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function ot(t="Todos"){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:t,noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function nt(t="Todos"){const e=ot(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function rt(t,e,o,n){const r=Dashboards.getParameterValue(o),a=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function at(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function it(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function lt(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;t.dashboard.setParameter(n,[o])}function st(t){t.regional.es={monthNames:G,abbreviatedMonthNames:H,dayNames:Y,abbreviatedDayNames:U,dayNamesMin:X,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function ct(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function ut(t,e){return E(t,(t=>new Tabulator(t,e)))}function dt(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function ft(t,e){const o=t.getValue().split(" ");let n="",r="";return o.forEach((t=>{(r+t).length<=e?r+=`${t} `:(n+=`${r}<br>`,r=`${t} `)})),n+=`${r}<br>`,n}function mt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach((t=>{t.getTreeChildren().length>0&&mt(t,e)}))}function pt(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&mt(t,e)}))}function ht(t,e,o,n){const r=[];for(const a in t)if(t.hasOwnProperty(a)){const i=t[a],l={[e]:i[0],_children:[]};i.shift(),i.forEach(((t,r)=>{const a={[e]:o[r],[n]:t};l._children.push(a)})),r.push(l)}return r}function yt(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function gt(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",(()=>{t.download("csv",`${e}.csv`,{delimiter:";"})}))}function bt(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",(()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})}))}const St={SO2:[100,200,350,500,750,751],NO2:[40,90,120,230,340,341],O3:[50,100,130,240,380,381],PM10:[20,40,50,100,150,151],PM25:[10,20,25,50,75,76]};function vt(t){const e=[],o={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function n(t,e,n){const r=document.createElement("td");if(r.setAttribute("id",t),null!=e){r.innerHTML=e;const t=function(t,e){let n;return void 0===e?n=6:"ND"===e?n=7:(n=5,t.forEach(((t,o)=>{e<=t&&5===n&&(n=o)}))),o[n]}(n,e);r.classList.add(t)}return r}return t.forEach((t=>{const o=t;"noData"===o.operationalstatus&&(o.so2value="ND",o.no2value="ND",o.o3value="ND",o.pm10value="ND",o.pm25value="ND"),"A09_CABANYAL_60m"===o.entityid&&(o.pm10value=void 0,o.pm25value=void 0);const r=document.createElement("tr"),a=document.createElement("td");a.innerHTML=o.address,r.appendChild(a),r.appendChild(n(`${o.entityid}_so2`,o.so2value,St.SO2)),r.appendChild(n(`${o.entityid}_no2`,o.no2value,St.NO2)),r.appendChild(n(`${o.entityid}_o3`,o.o3value,St.O3)),r.appendChild(n(`${o.entityid}_pm10`,o.pm10value,St.PM10)),r.appendChild(n(`${o.entityid}_pm25`,o.pm25value,St.PM25)),e.push(r)})),e}function Mt(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function At(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function xt(t,e){document.querySelectorAll(`[${t}]`).forEach((o=>{!function(t,e,o){const n=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(n.innerHTML=this.responseText,o&&o()),404===this.status&&(n.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(o.getAttribute(t),o,e)}))}function Et(t){xt("include-html-cabecera",(function(){!function(){const t=At();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=At();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),xt("include-html-menu"),xt("include-html-main-container",(function(){document.body.dispatchEvent(new Event("MainContentLoadedCustom")),function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])}(),t&&t()})),xt("include-html-copyright")}function Ct(t,e,o,n,r,a){let i=!1,l=!1;const s=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(o);t?(s&&(s.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),l=!0):(e.classList.remove("blur"),u(),l=!1)}const f=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(l||u(),i||(i=!0,window.setTimeout(d,a)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(s&&(s.setAttribute("sandbox","allow-scripts"),f(s)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(r).addEventListener("click",(()=>{d(!1),window.setTimeout(d,a)}))):document.querySelectorAll(n)[0].style.display="none"}const Dt={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${b(t)}€`}}]},wt=(t,e)=>{e.sort(((t,e)=>parseInt(t.anyo)-parseInt(e.anyo)));const o={};e.forEach((e=>{const n=e[1],r=e[0];r!==t.seriesName||o[n]||(o[n]=0),r===t.seriesName&&(o[n]+=e[2])}));let n=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(o))n+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${g(r)}</span></div>`;return n};function Ft(t,e,o=void 0,n=void 0){const r=null===n?void 0:n,a=new Set(e.map((t=>t[1])));let i;const l={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>wt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,n,r){const a={},i=r.contentSize[1]/2,l=r.viewSize[1],s=t[1];return s<i?a.top=10:s+i>l?a.bottom=10:a.top=s-i,t[0]<r.viewSize[0]/2?a.left=t[0]+20:a.right=r.viewSize[0]-t[0]+20,a}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>g(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(a),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>g(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};r&&r.itemStyle&&Array.isArray(r.itemStyle.borderColor)&&(i=[...r.itemStyle.borderColor],delete r.itemStyle.borderColor);const o=function(t){return t.reduce(((t,e)=>{const o=e[0];return t[o]||(t[o]=[]),t[o].push(e),t}),{})}(e),n=Object.keys(o);a.forEach((t=>{n.forEach((e=>{void 0===o[e].find((e=>e[1]===t))&&(o[e].push([o[e][0][0],t,void 0]),o[e].sort())}))}));const l=[];return Object.keys(o).forEach((e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=o[e].map((t=>t[2]));let n={};n=void 0!==r?R(t,r):t,l.push({...n})})),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==o?R(l,o):l,C(t,s)}function $t(t){let e={};return e=R(Dt,t),e}function Nt(t,e,o={},r={}){let a={};a=R(o,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach((e=>{t.add(e[1])})),Array.from(t).sort(((t,e)=>t-e))}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},l=null===r?i:R(r,i),s=e;s.forEach(((t,e)=>{s[e][0]=n(t[0])})),Ft(t,s,a,l)}function Lt(t,e=void 0){const o={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>O(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?R(o,e):o,C(t,n)}const Ot="es_ES",Tt={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function It(t){return Math.max(...t.map((t=>Number(t[0]))))}function kt(t){const e=t.filter((e=>Number(e[0])===It(t))),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function Pt(t){const e=t.filter((e=>Number(e[0])===It(t)-1)),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function zt(t,e,o=void 0){const n=It(e).toString(),r=(It(e)-1).toString();Lt(t,R({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[r,n],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:p(Tt,Ot),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:r,type:"bar",data:Pt(e)},{name:n,type:"bar",barGap:0,data:kt(e)}]},o))}function _t(t,e,o){const n=document.querySelector(e),r=document.querySelector(t);let a=!1;r.addEventListener("click",(()=>{!1===a&&(a=!0,n.setAttribute("src","about:blank"),n.setAttribute("src",o),n.onload=()=>{a=!1})})),r.disabled=!1}const Wt="id",Bt="fecha",Rt="value";function qt(t,e,o,n,r="es_ES"){const[a,i]=function(t,e,o){const n=[],r=[];return t.forEach((t=>{e.includes(`${t[Wt]}`)?n.push(`${t[Bt]}`):o.includes(`${t[Wt]}`)&&r.push(`${t[Bt]}`)})),[n.map((t=>[t,0])),r.map((t=>[t,0]))]}(t,o,n);let l="es_ES"==r?"Datos sin validar":"Dades sense validar";0===i.length&&(l="");const s={name:"Datos validados",type:"line",data:[...a,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",u="";if(0===i.length){const e=t[t.length-1].fecha;c=e,u=e}else c=i[0][0],u=i[i.length-1][0];return[...e,s,{name:"Datos NO validados",type:"line",data:i,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:l,xAxis:c,yAxis:0},{name:"end",xAxis:u,yAxis:Math.max(...t.filter((t=>null!==t[Rt])).map((t=>parseInt(`${t[Rt]}`,10))))}]]}}]}function Jt(t,e,o=void 0){C(t,R({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>F(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},o))}return e})(),t.exports=e()}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,o),a.exports}o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";o.r(n),o.d(n,{loadAnaliticaFrames:()=>e});var t=o(2725);function e(){(0,t.loadIframeOnClickEvent)("#tabSmartCity","#iframeSmartCity","https://lookerstudio.google.com/embed/reporting/ff43c17f-23cb-4edb-923b-a7b061d829dc/page/6WdoC?hl=ca"),(0,t.loadIframeOnClickEvent)("#tabCdmCiutat","#iframeCdMCiutat","https://lookerstudio.google.com/embed/reporting/2da9d93e-d833-4a00-833a-19ac0746dc9f/page/6WdoC?hl=ca"),window.addEventListener("load",(()=>{document.querySelector("#iframeValenciaMinut").setAttribute("src","https://lookerstudio.google.com/embed/reporting/14a41533-3cd8-4f75-b303-9a494c0e4a9d/page/6WdoC?hl=ca")}))}})(),n})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.analitica=e():t.analitica=e()}(self,()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{MONTHS_YEAR:()=>r,MONTHS_YEAR_SHORT:()=>a,TEXTS_COMMON:()=>i,THRESHOLDS:()=>Mt,addPointInteger:()=>b,buildCamarasTrafico:()=>wt,buildTableCalidadAire:()=>At,calculateMaxYAxis:()=>N,calculatePentahoPath:()=>xt,calculateXAxisStart:()=>F,capitalizarTexto:()=>x,checkAllGroupsCollapsed:()=>bt,configureDataBar:()=>R,configureDataGaugeCommon:()=>z,configureDataGaugeMonthCommon:()=>k,configureDataLine:()=>B,configureDataValidate:()=>jt,configureLinesChartValidates:()=>Vt,convertDateToInteger:()=>g,convertToLanguageSelectorDateRange:()=>ct,convertToTableTreeView:()=>gt,downloadCSVTable:()=>St,downloadPDFTable:()=>vt,formatCellMultiplesLines:()=>pt,formatDayMonthYear:()=>u,formatMilMillionEuros:()=>T,formatMonthAnyo:()=>c,formatName:()=>A,formatNameHeaderColumn:()=>mt,formatRoundTooltip:()=>O,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>d,formatToMillions:()=>S,formatToTons:()=>v,formatTooltip:()=>$,formatTooltipPie:()=>L,formatTrimestre:()=>m,formatWithPrefix:()=>M,getEnvironment:()=>Et,getMaxFieldNumberFromData:()=>j,getMonth:()=>n,getMonthList:()=>p,getSelectCommonOptions:()=>nt,getSelectTwoColumnsOptions:()=>rt,initBarChart:()=>Tt,initBarChartComparationMonth:()=>Bt,initChart:()=>C,initElement:()=>E,initStackedBarChart:()=>Nt,initStackedBarChartMonthSeries:()=>Ot,initTable:()=>ft,initValueDefaultDate:()=>lt,initialCalls:()=>Dt,loadIframeOnClickEvent:()=>Rt,printDataChart:()=>w,printDataInHTMLElements:()=>J,printEchart:()=>I,printNoDataChart:()=>D,resetFilter:()=>ot,resetFilterDate:()=>it,resetFilterDates:()=>at,resetFilterToDefault:()=>ut,resultsetWithFields:()=>W,selectConfigDatasource:()=>tt,selectConfigDatasourceAllValue:()=>et,selectFilterAll:()=>K,selectFilterNumItemsDefault:()=>dt,selectValueDefaultInFilter:()=>st,separateDayMonthYearToSlash:()=>l,splitDataset:()=>H,subtractOneDay:()=>h,subtractOneMonth:()=>y,traverseRows:()=>yt,updateDomElement:()=>V,updateObject:()=>q,updateStackedBarOptions:()=>Lt});const o={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function n(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}const r={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])},a={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},i={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function s(t){return[t.substring(0,4),o[t.substring(4,6)]]}function c(t){const[e,o]=s(t);return`${o} ${e}`}function u(t){const[e,n,r]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${n} ${e}`}function d(t){const[e,o]=s(t);return`${o.substring(0,3)} ${e}`}function f(t){const[e,o]=s(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function p(t,e){const o=t[e];return Array.from(o.values()).map(t=>t.slice(0,3))}function h(t){const e=Math.floor(t/1e4),o=new Date(e,t%1e4/100-1,t%100);return o.setDate(o.getDate()-1),`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}${o.getDate().toString().padStart(2,"0")}`}function y(t){let e;const o=new Date(Math.floor(t/100),t%100-1,0);return e=`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}`,e}function g(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function b(t,e=2){let o=navigator.language||navigator.userLanguage;o=o.length<=2?`${o}-${o.toUpperCase()}`:o;const n={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===o?t.toLocaleString("de-DE",n):t.toLocaleString(o,n)}function S(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function v(t){return t>=1e3?t/1e3+" Tn":t.toString()}function M(t){let e,o;return t>=1e6?(e=t/1e6,o="G"):t>=1e3?(e=t/1e3,o="M"):(e=t,o="k"),{value:Math.round(100*e)/100,prefix:o}}function A(t,e=29){if(t.length>=e){const o=t.split(" ");let n="",r="";return o.forEach(t=>{`${n} ${t}`.length<=e?n+=(n?" ":"")+t:(r+=`${n}\n`,n=t)}),r+=n,r}return t}function x(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,o)=>e+o[0].toUpperCase())}function E(t,e,o="MainContentLoadedCustom"){let n=document.getElementById(t);return n?Promise.resolve(e(n)):new Promise(r=>{document.body.addEventListener(o,()=>{n=document.getElementById(t),n?r(e(n)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),r(null))})})}function C(t,e){return E(t,t=>{const o=echarts.init(t);o.setOption(e,!0),window.addEventListener("resize",()=>{null!=o&&void 0!==o&&o.resize()});const n=document.getElementById("main-content");return n&&(n.addEventListener("shown.bs.collapse",()=>{o.resize()}),n.addEventListener("hidden.bs.collapse",()=>{o.resize()})),o})}function D(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function w(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function $(t,e=!1,o=!0,n=""){let r=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach(t=>{const a=e?Math.round(t.data):t.data,i=o?`<div style="font-weight: 400;color: #666;">${l=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${l}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${b(a)} ${n}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${b(a)} ${n}`:"-"}\n </span>\n </div>`;var l;r+=i}),r}function F(t){return 100*(t-120)/t}function N(t,e){const o=Math.max(...t);return o+(e-o%e)}function L(t,e=!1){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,n=e?`${t.percent}%`:b(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${n} </span></div>`}function O(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${b(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function T(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${b(o)} €`:o>=e?`${b(o/e)} M €`:"-"}function I(t,e,o){return 0===t.length?(D(`#${e}`,`#${o}`),!1):(w(`#${o}`,`#${e}`),!0)}function P(t,e,o=1){const n=Math.max(...t.map(t=>t[e]))*o;return 5e3*Math.ceil(n/5e3)}function z(t,e,o,n=30,r=15,a=30,i=-70,l=70,s=3){const c=P(t,e.data,1.1),u=l,d=o.slice(),f=[];let m=r,p=a,h=i;for(let o=0;o<t.length;o+=1)f.push({value:t[o][e.data],name:A(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(h)}%`,`${String(m)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(h)}%`,`${String(p)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>b(Math.round(t))}}),h+=u,(o+1)%s===0&&(p+=a,m+=2*r,h=i);return[c,f]}function k(t,e,o,r=0){return[P(e,o.data,1),t=>function(t,e,o){const r=b(Math.round(e)),a=n(t[o][0]),i=t[o][1],l=`\n${a} ${i} : ${r}`,s=`${r}\n${a} ${i}`;return window.innerWidth<=1710?l:s}(e,t,r),[{value:e[r][o.data]}]]}function _(t,e){const{resultset:o}={resultset:t},n=new Set,r=new Set,a=o.map(([t,o,a])=>{const i=e?Math.round(a):a;return n.add(t),r.add(o),{day:o,type:t,value:i}}),i=Array.from(r.values()),l=Array.from(n.values());return l.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[l.map(t=>{const e=a.filter(e=>e.type===t).map(({day:e,value:o})=>[e,t,o]),o=i.map(t=>{const o=e.find(([e])=>e===t);return o?o[2]:null});return{name:t,data:o}}),l,r]}function B(t,e=[],o=!1){const[n,r,a]=_(t,o);return n.forEach(t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())}),[n,a,r]}function R(t,e,o=!1){const[n,r,a]=_(t,o);return n.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[n,a,r]}function W(t){const{resultset:e,metadata:o}=t,n=[];return e.forEach(t=>{const e={};t.forEach((t,n)=>{e[o[n].colName]=t}),n.push(e)}),n}function q(t,e){const o={...t};return Object.keys(e).forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&("series"===n&&Array.isArray(e[n])?o[n]=e[n].map((e,o)=>({...Array.isArray(t[n])&&t[n][o]||{},...e})):"object"!=typeof e[n]||null===e[n]||Array.isArray(e[n])?t[n]!==e[n]&&(o[n]=e[n]):o[n]=q(t[n]||{},e[n]))}),o}function J(t,e){const o=()=>{t.forEach(t=>{t.id in e&&Object.entries(e[t.id]).forEach(o=>{const n=o[0],r=o[1];"object"==typeof r?r.className?document.querySelector(r.className).className=t[n]:r.element&&r.format&&(document.querySelector(r.element).textContent=e[t.id][n].format(t[n])):document.querySelector(r).textContent=t[n]})})};try{o()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{o()})}}function j(t,e){const o=W(t),n=[];let r=null;return o.forEach(t=>{const o=t[e];"number"!=typeof o||Number.isNaN(o)||n.push(o)}),n.length>0&&(r=Math.max(...n)),r}function V(t,e){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function H(t,e=!0){const o={Cont:[],Mob:[]};return t.forEach(t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?o.Cont.push([t[3],t[4],t[2]]):o.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?o.Mob.push([t[3],t[4],t[2]]):o.Mob.push([t[3],t[2]]))}),o}const G=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Y=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],U=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],X=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],Z=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function K(t){const e=t.resultset.map(t=>t[0]);return this.dashboard.fireChange(this.parameter,e),t}function Q(t){for(const e of t)if(Array.isArray(e)){if(!Q(e))return!1}else if("All"!==e)return!1;return!0}function tt(t,e,o,n){return Q(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function et(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function ot(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function nt(t="Todos"){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:t,noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function rt(t="Todos"){const e=nt(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function at(t,e,o,n){const r=Dashboards.getParameterValue(o),a=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function it(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function lt(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function st(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;t.dashboard.setParameter(n,[o])}function ct(t){t.regional.es={monthNames:G,abbreviatedMonthNames:Y,dayNames:U,abbreviatedDayNames:X,dayNamesMin:Z,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function ut(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function dt(t,e,o,n=0){const r=t.resultset.slice(0,o).map(t=>t[n]);return Dashboards.setParameter(e,r),t}function ft(t,e){return E(t,t=>new Tabulator(t,e))}function mt(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function pt(t,e){const o=t.getValue().split(" ");let n="",r="";return o.forEach(t=>{(r+t).length<=e?r+=`${t} `:(n+=`${r}<br>`,r=`${t} `)}),n+=`${r}<br>`,n}function ht(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach(t=>{t.getTreeChildren().length>0&&ht(t,e)})}function yt(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&ht(t,e)})}function gt(t,e,o,n){const r=[];for(const a in t)if(t.hasOwnProperty(a)){const i=t[a],l={[e]:i[0],_children:[]};i.shift(),i.forEach((t,r)=>{const a={[e]:o[r],[n]:t};l._children.push(a)}),r.push(l)}return r}function bt(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function St(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",()=>{t.download("csv",`${e}.csv`,{delimiter:";"})})}function vt(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})})}const Mt={SO2:[100,200,350,500,750,751],NO2:[40,90,120,230,340,341],O3:[50,100,130,240,380,381],PM10:[20,40,50,100,150,151],PM25:[10,20,25,50,75,76]};function At(t){const e=[],o={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function n(t,e,n){const r=document.createElement("td");if(r.setAttribute("id",t),null!=e){r.innerHTML=e;const t=function(t,e){let n;return void 0===e?n=6:"ND"===e?n=7:(n=5,t.forEach((t,o)=>{e<=t&&5===n&&(n=o)})),o[n]}(n,e);r.classList.add(t)}return r}return t.forEach(t=>{const o=t;"noData"===o.operationalstatus&&(o.so2value="ND",o.no2value="ND",o.o3value="ND",o.pm10value="ND",o.pm25value="ND");const r=document.createElement("tr"),a=document.createElement("td");a.innerHTML=o.address,r.appendChild(a),r.appendChild(n(`${o.entityid}_so2`,o.so2value,Mt.SO2)),r.appendChild(n(`${o.entityid}_no2`,o.no2value,Mt.NO2)),r.appendChild(n(`${o.entityid}_o3`,o.o3value,Mt.O3)),r.appendChild(n(`${o.entityid}_pm10`,o.pm10value,Mt.PM10)),r.appendChild(n(`${o.entityid}_pm25`,o.pm25value,Mt.PM25)),e.push(r)}),e}function xt(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function Et(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function Ct(t,e){document.querySelectorAll(`[${t}]`).forEach(o=>{!function(t,e,o){const n=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(n.innerHTML=this.responseText,o&&o()),404===this.status&&(n.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(o.getAttribute(t),o,e)})}function Dt(t){Ct("include-html-cabecera",function(){!function(){const t=Et();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=Et();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Ct("include-html-menu"),Ct("include-html-main-container",function(){document.body.dispatchEvent(new Event("MainContentLoadedCustom")),function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])}(),t&&t()}),Ct("include-html-copyright")}function wt(t,e,o,n,r,a){let i=!1,l=!1;const s=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(o);t?(s&&(s.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),l=!0):(e.classList.remove("blur"),u(),l=!1)}const f=t=>{new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(l||u(),i||(i=!0,window.setTimeout(d,a)))})}).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(s&&(s.setAttribute("sandbox","allow-scripts"),f(s)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(r).addEventListener("click",()=>{d(!1),window.setTimeout(d,a)})):document.querySelectorAll(n)[0].style.display="none"}const $t={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${S(t)}€`}}]},Ft=(t,e)=>{e.sort((t,e)=>parseInt(t.anyo)-parseInt(e.anyo));const o={};e.forEach(e=>{const n=e[1],r=e[0];r!==t.seriesName||o[n]||(o[n]=0),r===t.seriesName&&(o[n]+=e[2])});let n=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(o))n+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${b(r)}</span></div>`;return n};function Nt(t,e,o=void 0,n=void 0){const r=null===n?void 0:n,a=new Set(e.map(t=>t[1]));let i;const l={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>Ft(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,n,r){const a={},i=r.contentSize[1]/2,l=r.viewSize[1],s=t[1];return s<i?a.top=10:s+i>l?a.bottom=10:a.top=s-i,t[0]<r.viewSize[0]/2?a.left=t[0]+20:a.right=r.viewSize[0]-t[0]+20,a}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>b(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(a),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>b(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};r&&r.itemStyle&&Array.isArray(r.itemStyle.borderColor)&&(i=[...r.itemStyle.borderColor],delete r.itemStyle.borderColor);const o=function(t){return t.reduce((t,e)=>{const o=e[0];return t[o]||(t[o]=[]),t[o].push(e),t},{})}(e),n=Object.keys(o);a.forEach(t=>{n.forEach(e=>{void 0===o[e].find(e=>e[1]===t)&&(o[e].push([o[e][0][0],t,void 0]),o[e].sort())})});const l=[];return Object.keys(o).forEach(e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=o[e].map(t=>t[2]);let n={};n=void 0!==r?q(t,r):t,l.push({...n})}),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==o?q(l,o):l,C(t,s)}function Lt(t){let e={};return e=q($t,t),e}function Ot(t,e,o={},r={}){let a={};a=q(o,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach(e=>{t.add(e[1])}),Array.from(t).sort((t,e)=>t-e)}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},l=null===r?i:q(r,i),s=e;s.forEach((t,e)=>{s[e][0]=n(t[0])}),Nt(t,s,a,l)}function Tt(t,e=void 0){const o={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>O(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?q(o,e):o,C(t,n)}const It="es_ES",Pt={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function zt(t){return Math.max(...t.map(t=>Number(t[0])))}function kt(t){const e=t.filter(e=>Number(e[0])===zt(t)),o=Array.from({length:12},()=>0);return e.forEach(([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n}),o}function _t(t){const e=t.filter(e=>Number(e[0])===zt(t)-1),o=Array.from({length:12},()=>0);return e.forEach(([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n}),o}function Bt(t,e,o=void 0){const n=zt(e).toString(),r=(zt(e)-1).toString();Tt(t,q({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[r,n],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:p(Pt,It),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:r,type:"bar",data:_t(e)},{name:n,type:"bar",barGap:0,data:kt(e)}]},o))}function Rt(t,e,o){const n=document.querySelector(e),r=document.querySelector(t);let a=!1;r.addEventListener("click",()=>{!1===a&&(a=!0,n.setAttribute("src","about:blank"),n.setAttribute("src",o),n.onload=()=>{a=!1})}),r.disabled=!1}const Wt="id",qt="fecha",Jt="value";function jt(t,e,o,n,r="es_ES"){const[a,i]=function(t,e,o){const n=[],r=[];return t.forEach(t=>{e.includes(`${t[Wt]}`)?n.push(`${t[qt]}`):o.includes(`${t[Wt]}`)&&r.push(`${t[qt]}`)}),[n.map(t=>[t,0]),r.map(t=>[t,0])]}(t,o,n);let l="es_ES"==r?"Datos sin validar":"Dades sense validar";0===i.length&&(l="");const s={name:"Datos validados",type:"line",data:[...a,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",u="";if(0===i.length){const e=t[t.length-1].fecha;c=e,u=e}else c=i[0][0],u=i[i.length-1][0];return[...e,s,{name:"Datos NO validados",type:"line",data:i,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:l,xAxis:c,yAxis:0},{name:"end",xAxis:u,yAxis:Math.max(...t.filter(t=>null!==t[Jt]).map(t=>parseInt(`${t[Jt]}`,10)))}]]}}]}function Vt(t,e,o=void 0){C(t,q({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>$(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},o))}return e})(),t.exports=e()}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,o),a.exports}o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";o.r(n),o.d(n,{loadAnaliticaFrames:()=>e});var t=o(2725);function e(){(0,t.loadIframeOnClickEvent)("#tabSmartCity","#iframeSmartCity","https://lookerstudio.google.com/embed/reporting/ff43c17f-23cb-4edb-923b-a7b061d829dc/page/6WdoC?hl=ca"),(0,t.loadIframeOnClickEvent)("#tabCdmCiutat","#iframeCdMCiutat","https://lookerstudio.google.com/embed/reporting/2da9d93e-d833-4a00-833a-19ac0746dc9f/page/6WdoC?hl=ca"),window.addEventListener("load",()=>{document.querySelector("#iframeValenciaMinut").setAttribute("src","https://lookerstudio.google.com/embed/reporting/14a41533-3cd8-4f75-b303-9a494c0e4a9d/page/6WdoC?hl=ca")})}})(),n})());
|