@vlci/cdmciutat 22.0.0 → 23.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/legacy.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see legacy.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.legacy=e():t.legacy=e()}(self,(()=>(()=>{var t={421:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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,{addPointInteger:()=>c,buildCamarasTrafico:()=>G,buildTableCalidadAire:()=>x,calculateMaxYAxis:()=>y,calculatePentahoPath:()=>F,calculateXAxisStart:()=>m,configureDataGaugeCommon:()=>b,configureDataGaugeMonthCommon:()=>E,configureDataLine:()=>I,convertToTableTreeView:()=>R,formatMonthAnyo:()=>a,formatName:()=>h,formatNameHeaderColumn:()=>N,formatShortMonthShortYear:()=>s,formatShortMonthYear:()=>i,formatToMillions:()=>u,formatTooltip:()=>g,formatTooltipPie:()=>S,formatTrimestre:()=>l,getMonth:()=>n,getSelectCommonOptions:()=>U,initChart:()=>f,initStackedBarChart:()=>z,initStackedBarChartMonthSeries:()=>V,initTable:()=>O,initialCalls:()=>B,printDataChart:()=>p,printDataInHTMLElements:()=>M,printNoDataChart:()=>d,resetFilter:()=>_,resultsetWithFields:()=>w,selectConfigDatasource:()=>L,selectFilterAll:()=>C,splitDataset:()=>T,traverseRows:()=>P});const r={"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)]}function o(t){return[t.substring(0,4),r[t.substring(4,6)]]}function a(t){const[e,r]=o(t);return`${r} ${e}`}function i(t){const[e,r]=o(t);return`${r.substring(0,3)} ${e}`}function s(t){const[e,r]=o(t);return`${r.substring(0,3)} '${e.substring(2,4)}`}function l(t){const[e,r]=t.split("-");return`${parseFloat(r)/3}T ${e}`}function c(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const r={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",r):t.toLocaleString(e,r)}function u(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function h(t,e=29){if(t.length>=e){const r=t.split(" ");let n="",o="";return r.forEach((t=>{`${n} ${t}`.length<=e?n+=(n?" ":"")+t:(o+=`${n}\n`,n=t)})),o+=n,o}return t}function f(t,e){const r=document.getElementById(t);if(!r)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const n=echarts.init(r);return n.setOption(e,!0),window.addEventListener("resize",(()=>{null!=n&&void 0!==n&&n.resize()})),n}function d(t,e){const r=t?document.querySelector(t):null,n=e?document.querySelector(e):null;r&&(r.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function p(t,e){const r=t?document.querySelector(t):null,n=e?document.querySelector(e):null;r&&(r.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function g(t,e=!1,r=!0,n=""){let o=`<p>${t[0].name}</p>`;return t.forEach((t=>{const a=e?Math.round(t.data):t.data,i=r?`<div>${s=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${s}"></span>`} ${t.seriesName}: \n <strong style="float: right; margin-left:20px">\n ${t.data?`${c(a)} ${n}`:"-"}\n </strong>\n </div>`:`<div>\n <strong>${t.data?`${c(a)} ${n}`:"-"}\n </strong>\n </div>`;var s;o+=i})),o}function m(t){return 100*(t-120)/t}function y(t,e){const r=Math.max(...t);return r+(e-r%e)}function S(t,e=!1){const r=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,n=e?`${t.percent}%`:c(t.value);return`<div> ${r} ${t.name} <strong style="float: right; margin-left:20px"> ${n} </strong></div>`}function A(t,e,r=1){const n=Math.max(...t.map((t=>t[e])))*r;return 5e3*Math.ceil(n/5e3)}function b(t,e,r,n=30,o=15,a=30,i=-70,s=70,l=3){const u=A(t,e.data,1.1),f=s,d=r.slice(),p=[];let g=o,m=a,y=i;for(let r=0;r<t.length;r+=1)p.push({value:t[r][e.data],name:h(String(t[r][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(y)}%`,`${String(g)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(y)}%`,`${String(m)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>c(Math.round(t))}}),y+=f,(r+1)%l==0&&(m+=a,g+=2*o,y=i);return[u,p]}function E(t,e,r,o=0){return[A(e,r.data,1),t=>function(t,e,r){const o=c(Math.round(e)),a=n(t[r][0]),i=t[r][1],s=`\n${a} ${i} : ${o}`,l=`${o}\n${a} ${i}`;return window.innerWidth<=1710?s:l}(e,t,o),[{value:e[o][r.data]}]]}function I(t,e,r=!1){const{resultset:n}={resultset:t},o=new Set,a=new Set,i=e,s=n.map((([t,e,n])=>{const i=r?Math.round(n):n;return o.add(t),a.add(e),{day:e,type:t,value:i}})),l=Array.from(a.values()),c=Array.from(o.values());return c.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[c.map((t=>{const e=s.filter((e=>e.type===t)).map((({day:e,value:r})=>[e,t,r])),r=l.map((t=>{const r=e.find((([e])=>e===t));return r?r[2]:null}));return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:r}})),a,c]}function w(t){const{resultset:e,metadata:r}=t,n=[];return e.forEach((t=>{const e={};t.forEach(((t,n)=>{e[r[n].colName]=t})),n.push(e)})),n}function v(t,e){const r=t;return Object.keys(e).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&("object"!=typeof e[n]||Array.isArray(e[n])?r[n]=e[n]:r[n]=v(t[n]||{},e[n]))})),t}function M(t,e){t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((r=>{const n=r[0],o=r[1];"object"==typeof o?o.className?document.querySelector(o.className).className=t[n]:o.element&&o.format&&(document.querySelector(o.element).textContent=e[t.id][n].format(t[n])):document.querySelector(o).textContent=t[n]}))}))}function T(t,e=!0){const r={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?r.Cont.push([t[3],t[4],t[2]]):r.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?r.Mob.push([t[3],t[4],t[2]]):r.Mob.push([t[3],t[2]]))})),r}function C(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function D(t){for(const e of t)if(Array.isArray(e)){if(!D(e))return!1}else if("All"!==e)return!1;return!0}function L(t,e,r,n){return D(e)?(t.queryDefinition.dataAccessId=r,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function _(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function U(){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function O(t,e){const r=document.getElementById(t);return r?new Tabulator(r,e):(console.error(`No se pudo encontrar el elemento con ID ${t}.`),null)}function N(t,e){let r=t.getValue();return r.length>e&&(r=`${r.substr(0,e)}<br>${r.substr(e)}`),r}function k(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const r=t.getTreeChildren();r.length>0&&r.forEach((t=>{t.getTreeChildren().length>0&&k(t,e)}))}function P(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&k(t,e)}))}function R(t,e,r,n){const o=[];for(const a in t)if(t.hasOwnProperty(a)){const i=t[a],s={[e]:i[0],_children:[]};i.shift(),i.forEach(((t,o)=>{const a={[e]:r[o],[n]:t};s._children.push(a)})),o.push(s)}return o}function x(t){const e=[],r=[100,200,350,500,750,751],n=[40,90,120,230,340,341],o=[50,100,130,240,380,381],a=[20,40,50,100,150,151],i=[10,20,25,50,75,76],s={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function l(t,e,r){const n=document.createElement("td");if(n.setAttribute("id",t),null!=e){n.innerHTML=e;const t=function(t,e){let r;return void 0===e?r=6:"ND"===e?r=7:(r=5,t.forEach(((t,n)=>{e<=t&&5===r&&(r=n)}))),s[r]}(r,e);n.classList.add(t)}return n}return t.forEach((t=>{const s=t;"noData"===s.operationalstatus&&(s.so2value="ND",s.no2value="ND",s.o3value="ND",s.pm10value="ND",s.pm25value="ND"),"A09_CABANYAL_60m"===s.entityid&&(s.pm10value=void 0,s.pm25value=void 0);const c=document.createElement("tr"),u=document.createElement("td");u.innerHTML=s.address,c.appendChild(u),c.appendChild(l(`${s.entityid}_so2`,s.so2value,r)),c.appendChild(l(`${s.entityid}_no2`,s.no2value,n)),c.appendChild(l(`${s.entityid}_o3`,s.o3value,o)),c.appendChild(l(`${s.entityid}_pm10`,s.pm10value,a)),c.appendChild(l(`${s.entityid}_pm25`,s.pm25value,i)),e.push(c)})),e}function $(t,e){document.querySelectorAll(`[${t}]`).forEach((r=>{!function(t,e,r){const n=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(n.innerHTML=this.responseText,r&&r()),404===this.status&&(n.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(r.getAttribute(t),r,e)}))}function B(t){$("include-html-cabecera"),$("include-html-menu"),$("include-html-main-container",t),$("include-html-copyright")}function F(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 G(t,e,r,n,o,a){let i=!1,s=!1;const l=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.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")):(l&&l.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 h(t=!0){const e=document.querySelector(r);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),s=!0):(e.classList.remove("blur"),u(),s=!1)}const f=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(s||u(),i||(i=!0,window.setTimeout(h,a)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(l&&(l.setAttribute("sandbox","allow-scripts"),f(l)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(o).addEventListener("click",(()=>{h(!1),window.setTimeout(h,a)}))):document.querySelectorAll(n)[0].style.display="none"}function z(t,e,r=void 0,n=void 0){const o=null===n?void 0:n,a=new Set(e.map((t=>t[1])));let i;const s={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>g(t,!0)},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=>c(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=>c(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};o&&o.itemStyle&&Array.isArray(o.itemStyle.borderColor)&&(i=[...o.itemStyle.borderColor],delete o.itemStyle.borderColor);const r=function(t,e){return t.reduce(((t,e)=>{const r=e[0];return t[r]||(t[r]=[]),t[r].push(e),t}),{})}(e),n=Object.keys(r);a.forEach((t=>{n.forEach((e=>{void 0===r[e].find((e=>e[1]===t))&&(r[e].push([r[e][0][0],t,void 0]),r[e].sort())}))}));const s=[];return Object.keys(r).forEach((e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=r[e].map((t=>t[2]));let n={};n=void 0!==o?v(t,o):t,s.push({...n})})),s})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==r?v(s,r):s,f(t,l)}function V(t,e,r={},o={}){let a={};a=v(r,{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"]}},s=null===o?i:v(o,i),l=e;l.forEach(((t,e)=>{l[e][0]=n(t[0])})),z(t,l,a,s)}return e})(),t.exports=e()},742:(t,e)=>{"use strict";e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,a=s(t),i=a[0],l=a[1],c=new o(function(t,e,r){return 3*(e+r)/4-r}(0,i,l)),u=0,h=l>0?i-4:i;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[u++]=e>>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,a=[],i=16383,s=0,c=n-o;s<c;s+=i)a.push(l(t,s,s+i>c?c:s+i));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)r[i]=a[i],n[a.charCodeAt(i)]=i;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,n){for(var o,a,i=[],s=e;s<n;s+=3)o=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),i.push(r[(a=o)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(t,e,r)=>{"use strict";const n=r(742),o=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(t){return+t!=t&&(t=0),l.alloc(+t)},e.INSPECT_MAX_BYTES=50;const i=2147483647;function s(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=s(r);const o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(H(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return l.from(n,e,r);const o=function(t){if(l.isBuffer(t)){const e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||q(t.length)?s(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return u(t),s(t<0?0:0|p(t))}function f(t){const e=t.length<0?0:0|p(t.length),r=s(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,l.prototype),n}function p(t){if(t>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function g(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(o)return n?-1:W(t).length;e=(""+e).toLowerCase(),o=!0}}function m(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return _(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return D(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function S(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:A(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):A(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function A(t,e,r,n,o){let a,i=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;i=2,s/=2,l/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){let n=-1;for(a=r;a<s;a++)if(c(t,a)===c(e,-1===n?0:a-n)){if(-1===n&&(n=a),a-n+1===l)return n*i}else-1!==n&&(a-=a-n),n=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let n=0;n<l;n++)if(c(t,a+n)!==c(e,n)){r=!1;break}if(r)return a}return-1}function b(t,e,r,n){r=Number(r)||0;const o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;const a=e.length;let i;for(n>a/2&&(n=a/2),i=0;i<n;++i){const n=parseInt(e.substr(2*i,2),16);if(q(n))return i;t[r+i]=n}return i}function E(t,e,r,n){return J(W(e,t.length-r),t,r,n)}function I(t,e,r,n){return J(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r,n){return J(Z(e),t,r,n)}function v(t,e,r,n){return J(function(t,e){let r,n,o;const a=[];for(let i=0;i<t.length&&!((e-=2)<0);++i)r=t.charCodeAt(i),n=r>>8,o=r%256,a.push(o),a.push(n);return a}(e,t.length-r),t,r,n)}function M(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);const n=[];let o=e;for(;o<r;){const e=t[o];let a=null,i=e>239?4:e>223?3:e>191?2:1;if(o+i<=r){let r,n,s,l;switch(i){case 1:e<128&&(a=e);break;case 2:r=t[o+1],128==(192&r)&&(l=(31&e)<<6|63&r,l>127&&(a=l));break;case 3:r=t[o+1],n=t[o+2],128==(192&r)&&128==(192&n)&&(l=(15&e)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:r=t[o+1],n=t[o+2],s=t[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(l=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,i=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=i}return function(t){const e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=C));return r}(n)}e.kMaxLength=i,l.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(t,e,r){return c(t,e,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(t,e,r){return function(t,e,r){return u(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},l.allocUnsafe=function(t){return h(t)},l.allocUnsafeSlow=function(t){return h(t)},l.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==l.prototype},l.compare=function(t,e){if(H(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),H(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,a=Math.min(r,n);o<a;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=l.allocUnsafe(e);let o=0;for(r=0;r<t.length;++r){let e=t[r];if(H(e,Uint8Array))o+e.length>n.length?(l.isBuffer(e)||(e=l.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else{if(!l.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},l.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},l.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},l.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?T(this,0,t):m.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(t,e,r,n,o){if(H(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;let a=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(e>>>=0);const s=Math.min(a,i),c=this.slice(n,o),u=t.slice(e,r);for(let t=0;t<s;++t)if(c[t]!==u[t]){a=c[t],i=u[t];break}return a<i?-1:i<a?1:0},l.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},l.prototype.indexOf=function(t,e,r){return S(this,t,e,r,!0)},l.prototype.lastIndexOf=function(t,e,r){return S(this,t,e,r,!1)},l.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return I(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function D(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function L(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function _(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=e;n<r;++n)o+=K[t[n]];return o}function U(t,e,r){const n=t.slice(e,r);let o="";for(let t=0;t<n.length-1;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}function O(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,o,a){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function k(t,e,r,n,o){z(e,n,o,t,r,7);let a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;let i=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,r}function P(t,e,r,n,o){z(e,n,o,t,r,7);let a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;let i=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=i,i>>=8,t[r+2]=i,i>>=8,t[r+1]=i,i>>=8,t[r]=i,r+8}function R(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(t,e,r,n,a){return e=+e,r>>>=0,a||R(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function $(t,e,r,n,a){return e=+e,r>>>=0,a||R(t,0,r,8),o.write(t,e,r,n,52,8),r+8}l.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let n=this[t],o=1,a=0;for(;++a<e&&(o*=256);)n+=this[t+a]*o;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readBigUInt64LE=X((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||j(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))})),l.prototype.readBigUInt64BE=X((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||j(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),l.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let n=this[t],o=1,a=0;for(;++a<e&&(o*=256);)n+=this[t+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let n=e,o=1,a=this[t+--n];for(;n>0&&(o*=256);)a+=this[t+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a},l.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readBigInt64LE=X((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||j(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),l.prototype.readBigInt64BE=X((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||j(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),l.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);let o=1,a=0;for(this[e]=255&t;++a<r&&(o*=256);)this[e+a]=t/o&255;return e+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);let o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigUInt64LE=X((function(t,e=0){return k(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=X((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let o=0,a=1,i=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===i&&0!==this[e+o-1]&&(i=1),this[e+o]=(t/a>>0)-i&255;return e+r},l.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let o=r-1,a=1,i=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===i&&0!==this[e+o+1]&&(i=1),this[e+o]=(t/a>>0)-i&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigInt64LE=X((function(t,e=0){return k(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=X((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(t,e,r){return x(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return x(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return $(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return $(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},l.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{const a=l.isBuffer(t)?t:l.from(t,n),i=a.length;if(0===i)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%i]}return this};const B={};function F(t,e,r){B[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function G(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function z(t,e,r,n,o,a){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let o;throw o=a>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){V(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||j(e,t.length-(r+1))}(n,o,a)}function V(t,e){if("number"!=typeof t)throw new B.ERR_INVALID_ARG_TYPE(e,"number",t)}function j(t,e,r){if(Math.floor(t)!==t)throw V(t,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=G(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=G(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n}),RangeError);const Y=/[^+/0-9A-Za-z-_]/g;function W(t,e){let r;e=e||1/0;const n=t.length;let o=null;const a=[];for(let i=0;i<n;++i){if(r=t.charCodeAt(i),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}const K=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function X(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},924:(t,e,r)=>{"use strict";var n=r(210),o=r(559),a=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&a(t,".prototype.")>-1?o(r):r}},559:(t,e,r)=>{"use strict";var n=r(612),o=r(210),a=r(771),i=o("%TypeError%"),s=o("%Function.prototype.apply%"),l=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||n.call(l,s),u=o("%Object.defineProperty%",!0),h=o("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){if("function"!=typeof t)throw new i("a function is required");var e=c(n,l,arguments);return a(e,1+h(0,t.length-(arguments.length-1)),!0)};var f=function(){return c(n,s,arguments)};u?u(t.exports,"apply",{value:f}):t.exports.apply=f},296:(t,e,r)=>{"use strict";var n=r(44)(),o=r(210),a=n&&o("%Object.defineProperty%",!0);if(a)try{a({},"a",{value:1})}catch(t){a=!1}var i=o("%SyntaxError%"),s=o("%TypeError%"),l=r(275);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],h=!!l&&l(t,e);if(a)a(t,e,{configurable:null===c&&h?h.configurable:!c,enumerable:null===n&&h?h.enumerable:!n,value:r,writable:null===o&&h?h.writable:!o});else{if(!u&&(n||o||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},29:(t,e,r)=>{"use strict";var n=r(320),o=Object.prototype.toString,a=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=r),"[object Array]"===o.call(t)?function(t,e,r){for(var n=0,o=t.length;n<o;n++)a.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,i):"string"==typeof t?function(t,e,r){for(var n=0,o=t.length;n<o;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,i):function(t,e,r){for(var n in t)a.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,i)}},648:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var o=0;o<e.length;o+=1)r[o+t.length]=e[o];return r};t.exports=function(t){var o=this;if("function"!=typeof o||"[object Function]"!==e.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var a,i=function(t,e){for(var r=[],n=1,o=0;n<t.length;n+=1,o+=1)r[o]=t[n];return r}(arguments),s=r(0,o.length-i.length),l=[],c=0;c<s;c++)l[c]="$"+c;if(a=Function("binder","return function ("+function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=",");return r}(l)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var e=o.apply(this,n(i,arguments));return Object(e)===e?e:this}return o.apply(t,n(i,arguments))})),o.prototype){var u=function(){};u.prototype=o.prototype,a.prototype=new u,u.prototype=null}return a}},612:(t,e,r)=>{"use strict";var n=r(648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{"use strict";var n,o=SyntaxError,a=Function,i=TypeError,s=function(t){try{return a('"use strict"; return ('+t+").constructor;")()}catch(t){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(t){l=null}var c=function(){throw new i},u=l?function(){try{return c}catch(t){try{return l(arguments,"callee").get}catch(t){return c}}}():c,h=r(405)(),f=r(185)(),d=Object.getPrototypeOf||(f?function(t){return t.__proto__}:null),p={},g="undefined"!=typeof Uint8Array&&d?d(Uint8Array):n,m={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h&&d?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&d?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h&&d?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h&&d?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&d?d(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":u,"%TypedArray%":g,"%TypeError%":i,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(d)try{null.error}catch(t){var y=d(d(t));m["%Error.prototype%"]=y}var S=function t(e){var r;if("%AsyncFunction%"===e)r=s("async function () {}");else if("%GeneratorFunction%"===e)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=s("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&d&&(r=d(o.prototype))}return m[e]=r,r},A={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(612),E=r(824),I=b.call(Function.call,Array.prototype.concat),w=b.call(Function.apply,Array.prototype.splice),v=b.call(Function.call,String.prototype.replace),M=b.call(Function.call,String.prototype.slice),T=b.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,D=/\\(\\)?/g,L=function(t,e){var r,n=t;if(E(A,n)&&(n="%"+(r=A[n])[0]+"%"),E(m,n)){var a=m[n];if(a===p&&(a=S(n)),void 0===a&&!e)throw new i("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:a}}throw new o("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new i('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,t))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=M(t,0,1),r=M(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return v(t,C,(function(t,e,r,o){n[n.length]=r?v(o,D,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",a=L("%"+n+"%",e),s=a.name,c=a.value,u=!1,h=a.alias;h&&(n=h[0],w(r,I([0,1],h)));for(var f=1,d=!0;f<r.length;f+=1){var p=r[f],g=M(p,0,1),y=M(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===y||"'"===y||"`"===y)&&g!==y)throw new o("property names with quotes must have matching quotes");if("constructor"!==p&&d||(u=!0),E(m,s="%"+(n+="."+p)+"%"))c=m[s];else if(null!=c){if(!(p in c)){if(!e)throw new i("base intrinsic for "+t+" exists, but the property is not available.");return}if(l&&f+1>=r.length){var S=l(c,p);c=(d=!!S)&&"get"in S&&!("originalValue"in S.get)?S.get:c[p]}else d=E(c,p),c=c[p];d&&!u&&(m[s]=c)}}return c}},275:(t,e,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},44:(t,e,r)=>{"use strict";var n=r(210)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},185:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},410:(t,e,r)=>{"use strict";var n=r(419);t.exports=function(){return n()&&!!Symbol.toStringTag}},824:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,a=r(612);t.exports=a.call(n,o)},645:(t,e)=>{e.read=function(t,e,r,n,o){var a,i,s=8*o-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?o-1:0,f=r?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(i=a&(1<<-u)-1,a>>=-u,u+=n;u>0;i=256*i+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return i?NaN:1/0*(d?-1:1);i+=Math.pow(2,n),a-=c}return(d?-1:1)*i*Math.pow(2,a-n)},e.write=function(t,e,r,n,o,a){var i,s,l,c=8*a-o-1,u=(1<<c)-1,h=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,i=u):(i=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-i))<1&&(i--,l*=2),(e+=i+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(i++,l/=2),i+h>=u?(s=0,i=u):i+h>=1?(s=(e*l-1)*Math.pow(2,o),i+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,o),i=0));o>=8;t[r+d]=255&s,d+=p,s/=256,o-=8);for(i=i<<o|s,c+=o;c>0;t[r+d]=255&i,d+=p,i/=256,c-=8);t[r+d-p]|=128*g}},717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},584:(t,e,r)=>{"use strict";var n=r(410)(),o=r(924)("Object.prototype.toString"),a=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===o(t)},i=function(t){return!!a(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o(t)&&"[object Function]"===o(t.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=i,t.exports=s?a:i},320:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var a=/^\s*class\b/,i=function(t){try{var e=n.call(t);return a.test(e)}catch(t){return!1}},s=function(t){try{return!i(t)&&(n.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;l.call(f)===l.call(document.all)&&(h=function(t){if((u||!t)&&(void 0===t||"object"==typeof t))try{var e=l.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!i(t)&&s(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return s(t);if(i(t))return!1;var e=l.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},662:(t,e,r)=>{"use strict";var n,o=Object.prototype.toString,a=Function.prototype.toString,i=/^\s*(?:function)?\*/,s=r(410)(),l=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(i.test(a.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===o.call(t);if(!l)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&l(e)}return l(t)===n}},692:(t,e,r)=>{"use strict";var n=r(430);t.exports=function(t){return!!n(t)}},155:t=>{var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,l=[],c=!1,u=-1;function h(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&f())}function f(){if(!c){var t=i(h);c=!0;for(var e=l.length;e;){for(s=l,l=[];++u<e;)s&&s[u].run();u=-1,e=l.length}s=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new d(t,e)),1!==l.length||c||i(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},771:(t,e,r)=>{"use strict";var n=r(210),o=r(296),a=r(44)(),i=r(275),s=n("%TypeError%"),l=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||l(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in t&&i){var u=i(t,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(a?o(t,"length",e,!0,!0):o(t,"length",e)),t}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},955:(t,e,r)=>{"use strict";var n=r(584),o=r(662),a=r(430),i=r(692);function s(t){return t.call.bind(t)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=s(Object.prototype.toString),h=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(l)var p=s(BigInt.prototype.valueOf);if(c)var g=s(Symbol.prototype.valueOf);function m(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function y(t){return"[object Map]"===u(t)}function S(t){return"[object Set]"===u(t)}function A(t){return"[object WeakMap]"===u(t)}function b(t){return"[object WeakSet]"===u(t)}function E(t){return"[object ArrayBuffer]"===u(t)}function I(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function w(t){return"[object DataView]"===u(t)}function v(t){return"undefined"!=typeof DataView&&(w.working?w(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=o,e.isTypedArray=i,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):i(t)||v(t)},e.isUint8Array=function(t){return"Uint8Array"===a(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===a(t)},e.isUint16Array=function(t){return"Uint16Array"===a(t)},e.isUint32Array=function(t){return"Uint32Array"===a(t)},e.isInt8Array=function(t){return"Int8Array"===a(t)},e.isInt16Array=function(t){return"Int16Array"===a(t)},e.isInt32Array=function(t){return"Int32Array"===a(t)},e.isFloat32Array=function(t){return"Float32Array"===a(t)},e.isFloat64Array=function(t){return"Float64Array"===a(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===a(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===a(t)},y.working="undefined"!=typeof Map&&y(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(y.working?y(t):t instanceof Map)},S.working="undefined"!=typeof Set&&S(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(S.working?S(t):t instanceof Set)},A.working="undefined"!=typeof WeakMap&&A(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(A.working?A(t):t instanceof WeakMap)},b.working="undefined"!=typeof WeakSet&&b(new WeakSet),e.isWeakSet=function(t){return b(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=I,w.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&w(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=v;var M="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function T(t){return"[object SharedArrayBuffer]"===u(t)}function C(t){return void 0!==M&&(void 0===T.working&&(T.working=T(new M)),T.working?T(t):t instanceof M)}function D(t){return m(t,h)}function L(t){return m(t,f)}function _(t){return m(t,d)}function U(t){return l&&m(t,p)}function O(t){return c&&m(t,g)}e.isSharedArrayBuffer=C,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===u(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===u(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===u(t)},e.isGeneratorObject=function(t){return"[object Generator]"===u(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===u(t)},e.isNumberObject=D,e.isStringObject=L,e.isBooleanObject=_,e.isBigIntObject=U,e.isSymbolObject=O,e.isBoxedPrimitive=function(t){return D(t)||L(t)||_(t)||U(t)||O(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(I(t)||C(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},539:(t,e,r)=>{var n=r(155),o=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},a=/%[sdj%]/g;e.format=function(t){if(!A(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(c(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,i=String(t).replace(a,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r<o;s=n[++r])y(s)||!I(s)?i+=" "+s:i+=" "+c(s);return i},e.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.deprecate(t,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),o=!0}return t.apply(this,arguments)}};var i={},s=/^$/;if(n.env.NODE_DEBUG){var l=n.env.NODE_DEBUG;l=l.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+l+"$","i")}function c(t,r){var n={seen:[],stylize:h};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&e._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,t,n.depth)}function u(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function h(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&M(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return A(o)||(o=f(t,o,n)),o}var a=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(A(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return S(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}(t,r);if(a)return a;var i=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(r)),v(r)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return d(r);if(0===i.length){if(M(r)){var l=r.name?": "+r.name:"";return t.stylize("[Function"+l+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return t.stylize(Date.prototype.toString.call(r),"date");if(v(r))return d(r)}var c,u="",h=!1,I=["{","}"];return g(r)&&(h=!0,I=["[","]"]),M(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(u=" "+RegExp.prototype.toString.call(r)),w(r)&&(u=" "+Date.prototype.toUTCString.call(r)),v(r)&&(u=" "+d(r)),0!==i.length||h&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=h?function(t,e,r,n,o){for(var a=[],i=0,s=e.length;i<s;++i)L(e,String(i))?a.push(p(t,e,r,n,String(i),!0)):a.push("");return o.forEach((function(o){o.match(/^\d+$/)||a.push(p(t,e,r,n,o,!0))})),a}(t,r,n,s,i):i.map((function(e){return p(t,r,n,s,e,h)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,u,I)):I[0]+u+I[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,o,a){var i,s,l;if((l=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),L(n,o)||(i="["+o+"]"),s||(t.seen.indexOf(l.value)<0?(s=y(r)?f(t,l.value,null):f(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),b(i)){if(a&&o.match(/^\d+$/))return s;(i=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.slice(1,-1),i=t.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=t.stylize(i,"string"))}return i+": "+s}function g(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function y(t){return null===t}function S(t){return"number"==typeof t}function A(t){return"string"==typeof t}function b(t){return void 0===t}function E(t){return I(t)&&"[object RegExp]"===T(t)}function I(t){return"object"==typeof t&&null!==t}function w(t){return I(t)&&"[object Date]"===T(t)}function v(t){return I(t)&&("[object Error]"===T(t)||t instanceof Error)}function M(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function C(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(s.test(t)){var r=n.pid;i[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else i[t]=function(){};return i[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(955),e.isArray=g,e.isBoolean=m,e.isNull=y,e.isNullOrUndefined=function(t){return null==t},e.isNumber=S,e.isString=A,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=E,e.types.isRegExp=E,e.isObject=I,e.isDate=w,e.types.isDate=w,e.isError=v,e.types.isNativeError=v,e.isFunction=M,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[C((t=new Date).getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":"),[t.getDate(),D[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(717),e._extend=function(t,e){if(!e||!I(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var _="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function U(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(_&&t[_]){var e;if("function"!=typeof(e=t[_]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,_,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],a=0;a<arguments.length;a++)o.push(arguments[a]);o.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),_&&Object.defineProperty(e,_,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,o(t))},e.promisify.custom=_,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var o=e.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var a=this,i=function(){return o.apply(a,arguments)};t.apply(this,e).then((function(t){n.nextTick(i.bind(null,null,t))}),(function(t){n.nextTick(U.bind(null,t,i))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,o(t)),e}},430:(t,e,r)=>{"use strict";var n=r(29),o=r(83),a=r(559),i=r(924),s=r(275),l=i("Object.prototype.toString"),c=r(410)(),u="undefined"==typeof globalThis?r.g:globalThis,h=o(),f=i("String.prototype.slice"),d=Object.getPrototypeOf,p=i("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},g={__proto__:null};n(h,c&&s&&d?function(t){var e=new u[t];if(Symbol.toStringTag in e){var r=d(e),n=s(r,Symbol.toStringTag);if(!n){var o=d(r);n=s(o,Symbol.toStringTag)}g["$"+t]=a(n.get)}}:function(t){var e=new u[t],r=e.slice||e.set;r&&(g["$"+t]=a(r))}),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!c){var e=f(l(t),8,-1);return p(h,e)>-1?e:"Object"===e&&function(t){var e=!1;return n(g,(function(r,n){if(!e)try{r(t),e=f(n,1)}catch(t){}})),e}(t)}return s?function(t){var e=!1;return n(g,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=f(n,1))}catch(t){}})),e}(t):null}},382:(t,e,r)=>{var n=r(764).Buffer;function o(t,e){this.buffer=t,this.position=0,this.isBigEndian=e||!1}function a(t,e,r){return function(){var n;return n=this.isBigEndian?e.call(this.buffer,this.position):t.call(this.buffer,this.position),this.position+=r,n}}t.exports=o,o.prototype.readUInt8=a(n.prototype.readUInt8,n.prototype.readUInt8,1),o.prototype.readUInt16=a(n.prototype.readUInt16LE,n.prototype.readUInt16BE,2),o.prototype.readUInt32=a(n.prototype.readUInt32LE,n.prototype.readUInt32BE,4),o.prototype.readInt8=a(n.prototype.readInt8,n.prototype.readInt8,1),o.prototype.readInt16=a(n.prototype.readInt16LE,n.prototype.readInt16BE,2),o.prototype.readInt32=a(n.prototype.readInt32LE,n.prototype.readInt32BE,4),o.prototype.readFloat=a(n.prototype.readFloatLE,n.prototype.readFloatBE,4),o.prototype.readDouble=a(n.prototype.readDoubleLE,n.prototype.readDoubleBE,8),o.prototype.readVarInt=function(){var t,e=0,r=0;do{e+=(127&(t=this.buffer[this.position+r]))<<7*r,r++}while(t>=128);return this.position+=r,e}},659:(t,e,r)=>{var n=r(764).Buffer;function o(t,e){this.buffer=new n(t),this.position=0,this.allowResize=e}function a(t,e){return function(r,n){this.ensureSize(e),t.call(this.buffer,r,this.position,n),this.position+=e}}t.exports=o,o.prototype.writeUInt8=a(n.prototype.writeUInt8,1),o.prototype.writeUInt16LE=a(n.prototype.writeUInt16LE,2),o.prototype.writeUInt16BE=a(n.prototype.writeUInt16BE,2),o.prototype.writeUInt32LE=a(n.prototype.writeUInt32LE,4),o.prototype.writeUInt32BE=a(n.prototype.writeUInt32BE,4),o.prototype.writeInt8=a(n.prototype.writeInt8,1),o.prototype.writeInt16LE=a(n.prototype.writeInt16LE,2),o.prototype.writeInt16BE=a(n.prototype.writeInt16BE,2),o.prototype.writeInt32LE=a(n.prototype.writeInt32LE,4),o.prototype.writeInt32BE=a(n.prototype.writeInt32BE,4),o.prototype.writeFloatLE=a(n.prototype.writeFloatLE,4),o.prototype.writeFloatBE=a(n.prototype.writeFloatBE,4),o.prototype.writeDoubleLE=a(n.prototype.writeDoubleLE,8),o.prototype.writeDoubleBE=a(n.prototype.writeDoubleBE,8),o.prototype.writeBuffer=function(t){this.ensureSize(t.length),t.copy(this.buffer,this.position,0,t.length),this.position+=t.length},o.prototype.writeVarInt=function(t){for(var e=1;0!=(4294967168&t);)this.writeUInt8(127&t|128),t>>>=7,e++;return this.writeUInt8(127&t),e},o.prototype.ensureSize=function(t){if(this.buffer.length<this.position+t){if(!this.allowResize)throw new RangeError("index out of range");var e=new n(this.position+t);this.buffer.copy(e,0,0,this.buffer.length),this.buffer=e}}},56:(t,e,r)=>{var n=r(764).Buffer;t.exports=m;var o=r(905),a=r(213),i=r(503),s=r(978),l=r(665),c=r(606),u=r(763),h=r(292),f=r(382),d=r(659),p=r(620),g=r(172);function m(){this.srid=void 0,this.hasZ=!1,this.hasM=!1}m.parse=function(t,e){if("string"==typeof t||t instanceof p)return m._parseWkt(t);if(n.isBuffer(t)||t instanceof f)return m._parseWkb(t,e);throw new Error("first argument must be a string or Buffer")},m._parseWkt=function(t){var e,r,n=(e=t instanceof p?t:new p(t)).matchRegex([/^SRID=(\d+);/]);n&&(r=parseInt(n[1],10));var f=e.matchType(),d=e.matchDimension(),g={srid:r,hasZ:d.hasZ,hasM:d.hasM};switch(f){case o.wkt.Point:return a._parseWkt(e,g);case o.wkt.LineString:return i._parseWkt(e,g);case o.wkt.Polygon:return s._parseWkt(e,g);case o.wkt.MultiPoint:return l._parseWkt(e,g);case o.wkt.MultiLineString:return c._parseWkt(e,g);case o.wkt.MultiPolygon:return u._parseWkt(e,g);case o.wkt.GeometryCollection:return h._parseWkt(e,g)}},m._parseWkb=function(t,e){var r,n,d,p={};switch((r=t instanceof f?t:new f(t)).isBigEndian=!r.readInt8(),n=r.readUInt32(),p.hasSrid=536870912==(536870912&n),p.isEwkb=536870912&n||1073741824&n||2147483648&n,p.hasSrid&&(p.srid=r.readUInt32()),p.hasZ=!1,p.hasM=!1,p.isEwkb||e&&e.isEwkb?(2147483648&n&&(p.hasZ=!0),1073741824&n&&(p.hasM=!0),d=15&n):n>=1e3&&n<2e3?(p.hasZ=!0,d=n-1e3):n>=2e3&&n<3e3?(p.hasM=!0,d=n-2e3):n>=3e3&&n<4e3?(p.hasZ=!0,p.hasM=!0,d=n-3e3):d=n,d){case o.wkb.Point:return a._parseWkb(r,p);case o.wkb.LineString:return i._parseWkb(r,p);case o.wkb.Polygon:return s._parseWkb(r,p);case o.wkb.MultiPoint:return l._parseWkb(r,p);case o.wkb.MultiLineString:return c._parseWkb(r,p);case o.wkb.MultiPolygon:return u._parseWkb(r,p);case o.wkb.GeometryCollection:return h._parseWkb(r,p);default:throw new Error("GeometryType "+d+" not supported")}},m.parseTwkb=function(t){var e,r={},n=(e=t instanceof f?t:new f(t)).readUInt8(),d=e.readUInt8(),p=15&n;if(r.precision=g.decode(n>>4),r.precisionFactor=Math.pow(10,r.precision),r.hasBoundingBox=d>>0&1,r.hasSizeAttribute=d>>1&1,r.hasIdList=d>>2&1,r.hasExtendedPrecision=d>>3&1,r.isEmpty=d>>4&1,r.hasExtendedPrecision){var m=e.readUInt8();r.hasZ=1==(1&m),r.hasM=2==(2&m),r.zPrecision=g.decode((28&m)>>2),r.zPrecisionFactor=Math.pow(10,r.zPrecision),r.mPrecision=g.decode((224&m)>>5),r.mPrecisionFactor=Math.pow(10,r.mPrecision)}else r.hasZ=!1,r.hasM=!1;if(r.hasSizeAttribute&&e.readVarInt(),r.hasBoundingBox){var y=2;r.hasZ&&y++,r.hasM&&y++;for(var S=0;S<y;S++)e.readVarInt(),e.readVarInt()}switch(p){case o.wkb.Point:return a._parseTwkb(e,r);case o.wkb.LineString:return i._parseTwkb(e,r);case o.wkb.Polygon:return s._parseTwkb(e,r);case o.wkb.MultiPoint:return l._parseTwkb(e,r);case o.wkb.MultiLineString:return c._parseTwkb(e,r);case o.wkb.MultiPolygon:return u._parseTwkb(e,r);case o.wkb.GeometryCollection:return h._parseTwkb(e,r);default:throw new Error("GeometryType "+p+" not supported")}},m.parseGeoJSON=function(t){return m._parseGeoJSON(t)},m._parseGeoJSON=function(t,e){var r;switch(t.type){case o.geoJSON.Point:r=a._parseGeoJSON(t);break;case o.geoJSON.LineString:r=i._parseGeoJSON(t);break;case o.geoJSON.Polygon:r=s._parseGeoJSON(t);break;case o.geoJSON.MultiPoint:r=l._parseGeoJSON(t);break;case o.geoJSON.MultiLineString:r=c._parseGeoJSON(t);break;case o.geoJSON.MultiPolygon:r=u._parseGeoJSON(t);break;case o.geoJSON.GeometryCollection:r=h._parseGeoJSON(t);break;default:throw new Error("GeometryType "+t.type+" not supported")}if(t.crs&&t.crs.type&&"name"===t.crs.type&&t.crs.properties&&t.crs.properties.name){var n=t.crs.properties.name;if(0===n.indexOf("EPSG:"))r.srid=parseInt(n.substring(5));else{if(0!==n.indexOf("urn:ogc:def:crs:EPSG::"))throw new Error("Unsupported crs: "+n);r.srid=parseInt(n.substring(22))}}else e||(r.srid=4326);return r},m.prototype.toEwkt=function(){return"SRID="+this.srid+";"+this.toWkt()},m.prototype.toEwkb=function(){var t=new d(this._getWkbSize()+4),e=this.toWkb();return t.writeInt8(1),t.writeUInt32LE((536870912|e.slice(1,5).readUInt32LE(0))>>>0,!0),t.writeUInt32LE(this.srid),t.writeBuffer(e.slice(5)),t.buffer},m.prototype._getWktType=function(t,e){var r=t;return this.hasZ&&this.hasM?r+=" ZM ":this.hasZ?r+=" Z ":this.hasM&&(r+=" M "),!e||this.hasZ||this.hasM||(r+=" "),e&&(r+="EMPTY"),r},m.prototype._getWktCoordinate=function(t){var e=t.x+" "+t.y;return this.hasZ&&(e+=" "+t.z),this.hasM&&(e+=" "+t.m),e},m.prototype._writeWkbType=function(t,e,r){var n=0;void 0!==this.srid||r&&void 0!==r.srid?(this.hasZ&&(n|=2147483648),this.hasM&&(n|=1073741824)):this.hasZ&&this.hasM?n+=3e3:this.hasZ?n+=1e3:this.hasM&&(n+=2e3),t.writeUInt32LE(n+e>>>0,!0)},m.getTwkbPrecision=function(t,e,r){return{xy:t,z:e,m:r,xyFactor:Math.pow(10,t),zFactor:Math.pow(10,e),mFactor:Math.pow(10,r)}},m.prototype._writeTwkbHeader=function(t,e,r,n){var o=(g.encode(r.xy)<<4)+e,a=(this.hasZ||this.hasM)<<3;if(a+=n<<4,t.writeUInt8(o),t.writeUInt8(a),this.hasZ||this.hasM){var i=0;this.hasZ&&(i|=1),this.hasM&&(i|=2),t.writeUInt8(i)}},m.prototype.toGeoJSON=function(t){var e={};return this.srid&&t&&(t.shortCrs?e.crs={type:"name",properties:{name:"EPSG:"+this.srid}}:t.longCrs&&(e.crs={type:"name",properties:{name:"urn:ogc:def:crs:EPSG::"+this.srid}})),e}},292:(t,e,r)=>{t.exports=s;var n=r(539),o=r(905),a=r(56),i=r(659);function s(t,e){a.call(this),this.geometries=t||[],this.srid=e,this.geometries.length>0&&(this.hasZ=this.geometries[0].hasZ,this.hasM=this.geometries[0].hasM)}n.inherits(s,a),s.Z=function(t,e){var r=new s(t,e);return r.hasZ=!0,r},s.M=function(t,e){var r=new s(t,e);return r.hasM=!0,r},s.ZM=function(t,e){var r=new s(t,e);return r.hasZ=!0,r.hasM=!0,r},s._parseWkt=function(t,e){var r=new s;if(r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"]))return r;t.expectGroupStart();do{r.geometries.push(a.parse(t))}while(t.isMatch([","]));return t.expectGroupEnd(),r},s._parseWkb=function(t,e){var r=new s;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;for(var n=t.readUInt32(),o=0;o<n;o++)r.geometries.push(a.parse(t,e));return r},s._parseTwkb=function(t,e){var r=new s;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=t.readVarInt(),o=0;o<n;o++)r.geometries.push(a.parseTwkb(t));return r},s._parseGeoJSON=function(t){for(var e=new s,r=0;r<t.geometries.length;r++)e.geometries.push(a._parseGeoJSON(t.geometries[r],!0));return e.geometries.length>0&&(e.hasZ=e.geometries[0].hasZ),e},s.prototype.toWkt=function(){if(0===this.geometries.length)return this._getWktType(o.wkt.GeometryCollection,!0);for(var t=this._getWktType(o.wkt.GeometryCollection,!1)+"(",e=0;e<this.geometries.length;e++)t+=this.geometries[e].toWkt()+",";return(t=t.slice(0,-1))+")"},s.prototype.toWkb=function(){var t=new i(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,o.wkb.GeometryCollection),t.writeUInt32LE(this.geometries.length);for(var e=0;e<this.geometries.length;e++)t.writeBuffer(this.geometries[e].toWkb({srid:this.srid}));return t.buffer},s.prototype.toTwkb=function(){var t=new i(0,!0),e=a.getTwkbPrecision(5,0,0),r=0===this.geometries.length;if(this._writeTwkbHeader(t,o.wkb.GeometryCollection,e,r),this.geometries.length>0){t.writeVarInt(this.geometries.length);for(var n=0;n<this.geometries.length;n++)t.writeBuffer(this.geometries[n].toTwkb())}return t.buffer},s.prototype._getWkbSize=function(){for(var t=9,e=0;e<this.geometries.length;e++)t+=this.geometries[e]._getWkbSize();return t},s.prototype.toGeoJSON=function(t){var e=a.prototype.toGeoJSON.call(this,t);e.type=o.geoJSON.GeometryCollection,e.geometries=[];for(var r=0;r<this.geometries.length;r++)e.geometries.push(this.geometries[r].toGeoJSON());return e}},503:(t,e,r)=>{t.exports=l;var n=r(539),o=r(56),a=r(905),i=r(213),s=r(659);function l(t,e){o.call(this),this.points=t||[],this.srid=e,this.points.length>0&&(this.hasZ=this.points[0].hasZ,this.hasM=this.points[0].hasM)}n.inherits(l,o),l.Z=function(t,e){var r=new l(t,e);return r.hasZ=!0,r},l.M=function(t,e){var r=new l(t,e);return r.hasM=!0,r},l.ZM=function(t,e){var r=new l(t,e);return r.hasZ=!0,r.hasM=!0,r},l._parseWkt=function(t,e){var r=new l;return r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"])||(t.expectGroupStart(),r.points.push.apply(r.points,t.matchCoordinates(e)),t.expectGroupEnd()),r},l._parseWkb=function(t,e){var r=new l;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;for(var n=t.readUInt32(),o=0;o<n;o++)r.points.push(i._readWkbPoint(t,e));return r},l._parseTwkb=function(t,e){var r=new l;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=new i(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),o=t.readVarInt(),a=0;a<o;a++)r.points.push(i._readTwkbPoint(t,e,n));return r},l._parseGeoJSON=function(t){var e=new l;t.coordinates.length>0&&(e.hasZ=t.coordinates[0].length>2);for(var r=0;r<t.coordinates.length;r++)e.points.push(i._readGeoJSONPoint(t.coordinates[r]));return e},l.prototype.toWkt=function(){return 0===this.points.length?this._getWktType(a.wkt.LineString,!0):this._getWktType(a.wkt.LineString,!1)+this._toInnerWkt()},l.prototype._toInnerWkt=function(){for(var t="(",e=0;e<this.points.length;e++)t+=this._getWktCoordinate(this.points[e])+",";return(t=t.slice(0,-1))+")"},l.prototype.toWkb=function(t){var e=new s(this._getWkbSize());e.writeInt8(1),this._writeWkbType(e,a.wkb.LineString,t),e.writeUInt32LE(this.points.length);for(var r=0;r<this.points.length;r++)this.points[r]._writeWkbPoint(e);return e.buffer},l.prototype.toTwkb=function(){var t=new s(0,!0),e=o.getTwkbPrecision(5,0,0),r=0===this.points.length;if(this._writeTwkbHeader(t,a.wkb.LineString,e,r),this.points.length>0){t.writeVarInt(this.points.length);for(var n=new i(0,0,0,0),l=0;l<this.points.length;l++)this.points[l]._writeTwkbPoint(t,e,n)}return t.buffer},l.prototype._getWkbSize=function(){var t=16;return this.hasZ&&(t+=8),this.hasM&&(t+=8),9+this.points.length*t},l.prototype.toGeoJSON=function(t){var e=o.prototype.toGeoJSON.call(this,t);e.type=a.geoJSON.LineString,e.coordinates=[];for(var r=0;r<this.points.length;r++)this.hasZ?e.coordinates.push([this.points[r].x,this.points[r].y,this.points[r].z]):e.coordinates.push([this.points[r].x,this.points[r].y]);return e}},606:(t,e,r)=>{t.exports=c;var n=r(539),o=r(905),a=r(56),i=r(213),s=r(503),l=r(659);function c(t,e){a.call(this),this.lineStrings=t||[],this.srid=e,this.lineStrings.length>0&&(this.hasZ=this.lineStrings[0].hasZ,this.hasM=this.lineStrings[0].hasM)}n.inherits(c,a),c.Z=function(t,e){var r=new c(t,e);return r.hasZ=!0,r},c.M=function(t,e){var r=new c(t,e);return r.hasM=!0,r},c.ZM=function(t,e){var r=new c(t,e);return r.hasZ=!0,r.hasM=!0,r},c._parseWkt=function(t,e){var r=new c;if(r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"]))return r;t.expectGroupStart();do{t.expectGroupStart(),r.lineStrings.push(new s(t.matchCoordinates(e))),t.expectGroupEnd()}while(t.isMatch([","]));return t.expectGroupEnd(),r},c._parseWkb=function(t,e){var r=new c;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;for(var n=t.readUInt32(),o=0;o<n;o++)r.lineStrings.push(a.parse(t,e));return r},c._parseTwkb=function(t,e){var r=new c;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=new i(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),o=t.readVarInt(),a=0;a<o;a++){var l=new s;l.hasZ=e.hasZ,l.hasM=e.hasM;for(var u=t.readVarInt(),h=0;h<u;h++)l.points.push(i._readTwkbPoint(t,e,n));r.lineStrings.push(l)}return r},c._parseGeoJSON=function(t){var e=new c;t.coordinates.length>0&&t.coordinates[0].length>0&&(e.hasZ=t.coordinates[0][0].length>2);for(var r=0;r<t.coordinates.length;r++)e.lineStrings.push(s._parseGeoJSON({coordinates:t.coordinates[r]}));return e},c.prototype.toWkt=function(){if(0===this.lineStrings.length)return this._getWktType(o.wkt.MultiLineString,!0);for(var t=this._getWktType(o.wkt.MultiLineString,!1)+"(",e=0;e<this.lineStrings.length;e++)t+=this.lineStrings[e]._toInnerWkt()+",";return(t=t.slice(0,-1))+")"},c.prototype.toWkb=function(){var t=new l(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,o.wkb.MultiLineString),t.writeUInt32LE(this.lineStrings.length);for(var e=0;e<this.lineStrings.length;e++)t.writeBuffer(this.lineStrings[e].toWkb({srid:this.srid}));return t.buffer},c.prototype.toTwkb=function(){var t=new l(0,!0),e=a.getTwkbPrecision(5,0,0),r=0===this.lineStrings.length;if(this._writeTwkbHeader(t,o.wkb.MultiLineString,e,r),this.lineStrings.length>0){t.writeVarInt(this.lineStrings.length);for(var n=new i(0,0,0,0),s=0;s<this.lineStrings.length;s++){t.writeVarInt(this.lineStrings[s].points.length);for(var c=0;c<this.lineStrings[s].points.length;c++)this.lineStrings[s].points[c]._writeTwkbPoint(t,e,n)}}return t.buffer},c.prototype._getWkbSize=function(){for(var t=9,e=0;e<this.lineStrings.length;e++)t+=this.lineStrings[e]._getWkbSize();return t},c.prototype.toGeoJSON=function(t){var e=a.prototype.toGeoJSON.call(this,t);e.type=o.geoJSON.MultiLineString,e.coordinates=[];for(var r=0;r<this.lineStrings.length;r++)e.coordinates.push(this.lineStrings[r].toGeoJSON().coordinates);return e}},665:(t,e,r)=>{t.exports=l;var n=r(539),o=r(905),a=r(56),i=r(213),s=r(659);function l(t,e){a.call(this),this.points=t||[],this.srid=e,this.points.length>0&&(this.hasZ=this.points[0].hasZ,this.hasM=this.points[0].hasM)}n.inherits(l,a),l.Z=function(t,e){var r=new l(t,e);return r.hasZ=!0,r},l.M=function(t,e){var r=new l(t,e);return r.hasM=!0,r},l.ZM=function(t,e){var r=new l(t,e);return r.hasZ=!0,r.hasM=!0,r},l._parseWkt=function(t,e){var r=new l;return r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"])||(t.expectGroupStart(),r.points.push.apply(r.points,t.matchCoordinates(e)),t.expectGroupEnd()),r},l._parseWkb=function(t,e){var r=new l;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;for(var n=t.readUInt32(),o=0;o<n;o++)r.points.push(a.parse(t,e));return r},l._parseTwkb=function(t,e){var r=new l;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=new i(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),o=t.readVarInt(),a=0;a<o;a++)r.points.push(i._readTwkbPoint(t,e,n));return r},l._parseGeoJSON=function(t){var e=new l;t.coordinates.length>0&&(e.hasZ=t.coordinates[0].length>2);for(var r=0;r<t.coordinates.length;r++)e.points.push(i._parseGeoJSON({coordinates:t.coordinates[r]}));return e},l.prototype.toWkt=function(){if(0===this.points.length)return this._getWktType(o.wkt.MultiPoint,!0);for(var t=this._getWktType(o.wkt.MultiPoint,!1)+"(",e=0;e<this.points.length;e++)t+=this._getWktCoordinate(this.points[e])+",";return(t=t.slice(0,-1))+")"},l.prototype.toWkb=function(){var t=new s(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,o.wkb.MultiPoint),t.writeUInt32LE(this.points.length);for(var e=0;e<this.points.length;e++)t.writeBuffer(this.points[e].toWkb({srid:this.srid}));return t.buffer},l.prototype.toTwkb=function(){var t=new s(0,!0),e=a.getTwkbPrecision(5,0,0),r=0===this.points.length;if(this._writeTwkbHeader(t,o.wkb.MultiPoint,e,r),this.points.length>0){t.writeVarInt(this.points.length);for(var n=new i(0,0,0,0),l=0;l<this.points.length;l++)this.points[l]._writeTwkbPoint(t,e,n)}return t.buffer},l.prototype._getWkbSize=function(){var t=16;return this.hasZ&&(t+=8),this.hasM&&(t+=8),t+=5,9+this.points.length*t},l.prototype.toGeoJSON=function(t){var e=a.prototype.toGeoJSON.call(this,t);e.type=o.geoJSON.MultiPoint,e.coordinates=[];for(var r=0;r<this.points.length;r++)e.coordinates.push(this.points[r].toGeoJSON().coordinates);return e}},763:(t,e,r)=>{t.exports=c;var n=r(539),o=r(905),a=r(56),i=r(213),s=r(978),l=r(659);function c(t,e){a.call(this),this.polygons=t||[],this.srid=e,this.polygons.length>0&&(this.hasZ=this.polygons[0].hasZ,this.hasM=this.polygons[0].hasM)}n.inherits(c,a),c.Z=function(t,e){var r=new c(t,e);return r.hasZ=!0,r},c.M=function(t,e){var r=new c(t,e);return r.hasM=!0,r},c.ZM=function(t,e){var r=new c(t,e);return r.hasZ=!0,r.hasM=!0,r},c._parseWkt=function(t,e){var r=new c;if(r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"]))return r;t.expectGroupStart();do{t.expectGroupStart();var n=[],o=[];for(t.expectGroupStart(),n.push.apply(n,t.matchCoordinates(e)),t.expectGroupEnd();t.isMatch([","]);)t.expectGroupStart(),o.push(t.matchCoordinates(e)),t.expectGroupEnd();r.polygons.push(new s(n,o)),t.expectGroupEnd()}while(t.isMatch([","]));return t.expectGroupEnd(),r},c._parseWkb=function(t,e){var r=new c;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;for(var n=t.readUInt32(),o=0;o<n;o++)r.polygons.push(a.parse(t,e));return r},c._parseTwkb=function(t,e){var r=new c;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=new i(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),o=t.readVarInt(),a=0;a<o;a++){var l=new s;l.hasZ=e.hasZ,l.hasM=e.hasM;for(var u=t.readVarInt(),h=t.readVarInt(),f=0;f<h;f++)l.exteriorRing.push(i._readTwkbPoint(t,e,n));for(f=1;f<u;f++){for(var d=[],p=t.readVarInt(),g=0;g<p;g++)d.push(i._readTwkbPoint(t,e,n));l.interiorRings.push(d)}r.polygons.push(l)}return r},c._parseGeoJSON=function(t){var e=new c;t.coordinates.length>0&&t.coordinates[0].length>0&&t.coordinates[0][0].length>0&&(e.hasZ=t.coordinates[0][0][0].length>2);for(var r=0;r<t.coordinates.length;r++)e.polygons.push(s._parseGeoJSON({coordinates:t.coordinates[r]}));return e},c.prototype.toWkt=function(){if(0===this.polygons.length)return this._getWktType(o.wkt.MultiPolygon,!0);for(var t=this._getWktType(o.wkt.MultiPolygon,!1)+"(",e=0;e<this.polygons.length;e++)t+=this.polygons[e]._toInnerWkt()+",";return(t=t.slice(0,-1))+")"},c.prototype.toWkb=function(){var t=new l(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,o.wkb.MultiPolygon),t.writeUInt32LE(this.polygons.length);for(var e=0;e<this.polygons.length;e++)t.writeBuffer(this.polygons[e].toWkb({srid:this.srid}));return t.buffer},c.prototype.toTwkb=function(){var t=new l(0,!0),e=a.getTwkbPrecision(5,0,0),r=0===this.polygons.length;if(this._writeTwkbHeader(t,o.wkb.MultiPolygon,e,r),this.polygons.length>0){t.writeVarInt(this.polygons.length);for(var n=new i(0,0,0,0),s=0;s<this.polygons.length;s++){t.writeVarInt(1+this.polygons[s].interiorRings.length),t.writeVarInt(this.polygons[s].exteriorRing.length);for(var c=0;c<this.polygons[s].exteriorRing.length;c++)this.polygons[s].exteriorRing[c]._writeTwkbPoint(t,e,n);for(c=0;c<this.polygons[s].interiorRings.length;c++){t.writeVarInt(this.polygons[s].interiorRings[c].length);for(var u=0;u<this.polygons[s].interiorRings[c].length;u++)this.polygons[s].interiorRings[c][u]._writeTwkbPoint(t,e,n)}}}return t.buffer},c.prototype._getWkbSize=function(){for(var t=9,e=0;e<this.polygons.length;e++)t+=this.polygons[e]._getWkbSize();return t},c.prototype.toGeoJSON=function(t){var e=a.prototype.toGeoJSON.call(this,t);e.type=o.geoJSON.MultiPolygon,e.coordinates=[];for(var r=0;r<this.polygons.length;r++)e.coordinates.push(this.polygons[r].toGeoJSON().coordinates);return e}},213:(t,e,r)=>{t.exports=l;var n=r(539),o=r(56),a=r(905),i=r(659),s=r(172);function l(t,e,r,n,a){o.call(this),this.x=t,this.y=e,this.z=r,this.m=n,this.srid=a,this.hasZ=void 0!==this.z,this.hasM=void 0!==this.m}n.inherits(l,o),l.Z=function(t,e,r,n){var o=new l(t,e,r,void 0,n);return o.hasZ=!0,o},l.M=function(t,e,r,n){var o=new l(t,e,void 0,r,n);return o.hasM=!0,o},l.ZM=function(t,e,r,n,o){var a=new l(t,e,r,n,o);return a.hasZ=!0,a.hasM=!0,a},l._parseWkt=function(t,e){var r=new l;if(r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"]))return r;t.expectGroupStart();var n=t.matchCoordinate(e);return r.x=n.x,r.y=n.y,r.z=n.z,r.m=n.m,t.expectGroupEnd(),r},l._parseWkb=function(t,e){var r=l._readWkbPoint(t,e);return r.srid=e.srid,r},l._readWkbPoint=function(t,e){return new l(t.readDouble(),t.readDouble(),e.hasZ?t.readDouble():void 0,e.hasM?t.readDouble():void 0)},l._parseTwkb=function(t,e){var r=new l;return r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty||(r.x=s.decode(t.readVarInt())/e.precisionFactor,r.y=s.decode(t.readVarInt())/e.precisionFactor,r.z=e.hasZ?s.decode(t.readVarInt())/e.zPrecisionFactor:void 0,r.m=e.hasM?s.decode(t.readVarInt())/e.mPrecisionFactor:void 0),r},l._readTwkbPoint=function(t,e,r){return r.x+=s.decode(t.readVarInt())/e.precisionFactor,r.y+=s.decode(t.readVarInt())/e.precisionFactor,e.hasZ&&(r.z+=s.decode(t.readVarInt())/e.zPrecisionFactor),e.hasM&&(r.m+=s.decode(t.readVarInt())/e.mPrecisionFactor),new l(r.x,r.y,r.z,r.m)},l._parseGeoJSON=function(t){return l._readGeoJSONPoint(t.coordinates)},l._readGeoJSONPoint=function(t){return 0===t.length?new l:t.length>2?new l(t[0],t[1],t[2]):new l(t[0],t[1])},l.prototype.toWkt=function(){return void 0===this.x&&void 0===this.y&&void 0===this.z&&void 0===this.m?this._getWktType(a.wkt.Point,!0):this._getWktType(a.wkt.Point,!1)+"("+this._getWktCoordinate(this)+")"},l.prototype.toWkb=function(t){var e=new i(this._getWkbSize());return e.writeInt8(1),this._writeWkbType(e,a.wkb.Point,t),void 0===this.x&&void 0===this.y?(e.writeDoubleLE(NaN),e.writeDoubleLE(NaN),this.hasZ&&e.writeDoubleLE(NaN),this.hasM&&e.writeDoubleLE(NaN)):this._writeWkbPoint(e),e.buffer},l.prototype._writeWkbPoint=function(t){t.writeDoubleLE(this.x),t.writeDoubleLE(this.y),this.hasZ&&t.writeDoubleLE(this.z),this.hasM&&t.writeDoubleLE(this.m)},l.prototype.toTwkb=function(){var t=new i(0,!0),e=o.getTwkbPrecision(5,0,0),r=void 0===this.x&&void 0===this.y;return this._writeTwkbHeader(t,a.wkb.Point,e,r),r||this._writeTwkbPoint(t,e,new l(0,0,0,0)),t.buffer},l.prototype._writeTwkbPoint=function(t,e,r){var n=this.x*e.xyFactor,o=this.y*e.xyFactor,a=this.z*e.zFactor,i=this.m*e.mFactor;t.writeVarInt(s.encode(n-r.x)),t.writeVarInt(s.encode(o-r.y)),this.hasZ&&t.writeVarInt(s.encode(a-r.z)),this.hasM&&t.writeVarInt(s.encode(i-r.m)),r.x=n,r.y=o,r.z=a,r.m=i},l.prototype._getWkbSize=function(){var t=21;return this.hasZ&&(t+=8),this.hasM&&(t+=8),t},l.prototype.toGeoJSON=function(t){var e=o.prototype.toGeoJSON.call(this,t);return e.type=a.geoJSON.Point,void 0===this.x&&void 0===this.y?e.coordinates=[]:void 0!==this.z?e.coordinates=[this.x,this.y,this.z]:e.coordinates=[this.x,this.y],e}},978:(t,e,r)=>{t.exports=l;var n=r(539),o=r(56),a=r(905),i=r(213),s=r(659);function l(t,e,r){o.call(this),this.exteriorRing=t||[],this.interiorRings=e||[],this.srid=r,this.exteriorRing.length>0&&(this.hasZ=this.exteriorRing[0].hasZ,this.hasM=this.exteriorRing[0].hasM)}n.inherits(l,o),l.Z=function(t,e,r){var n=new l(t,e,r);return n.hasZ=!0,n},l.M=function(t,e,r){var n=new l(t,e,r);return n.hasM=!0,n},l.ZM=function(t,e,r){var n=new l(t,e,r);return n.hasZ=!0,n.hasM=!0,n},l._parseWkt=function(t,e){var r=new l;if(r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"]))return r;for(t.expectGroupStart(),t.expectGroupStart(),r.exteriorRing.push.apply(r.exteriorRing,t.matchCoordinates(e)),t.expectGroupEnd();t.isMatch([","]);)t.expectGroupStart(),r.interiorRings.push(t.matchCoordinates(e)),t.expectGroupEnd();return t.expectGroupEnd(),r},l._parseWkb=function(t,e){var r=new l;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;var n=t.readUInt32();if(n>0){for(var o=t.readUInt32(),a=0;a<o;a++)r.exteriorRing.push(i._readWkbPoint(t,e));for(a=1;a<n;a++){for(var s=[],c=t.readUInt32(),u=0;u<c;u++)s.push(i._readWkbPoint(t,e));r.interiorRings.push(s)}}return r},l._parseTwkb=function(t,e){var r=new l;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=new i(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),o=t.readVarInt(),a=t.readVarInt(),s=0;s<a;s++)r.exteriorRing.push(i._readTwkbPoint(t,e,n));for(s=1;s<o;s++){for(var c=[],u=t.readVarInt(),h=0;h<u;h++)c.push(i._readTwkbPoint(t,e,n));r.interiorRings.push(c)}return r},l._parseGeoJSON=function(t){var e=new l;t.coordinates.length>0&&t.coordinates[0].length>0&&(e.hasZ=t.coordinates[0][0].length>2);for(var r=0;r<t.coordinates.length;r++){r>0&&e.interiorRings.push([]);for(var n=0;n<t.coordinates[r].length;n++)0===r?e.exteriorRing.push(i._readGeoJSONPoint(t.coordinates[r][n])):e.interiorRings[r-1].push(i._readGeoJSONPoint(t.coordinates[r][n]))}return e},l.prototype.toWkt=function(){return 0===this.exteriorRing.length?this._getWktType(a.wkt.Polygon,!0):this._getWktType(a.wkt.Polygon,!1)+this._toInnerWkt()},l.prototype._toInnerWkt=function(){for(var t="((",e=0;e<this.exteriorRing.length;e++)t+=this._getWktCoordinate(this.exteriorRing[e])+",";for(t=t.slice(0,-1),t+=")",e=0;e<this.interiorRings.length;e++){t+=",(";for(var r=0;r<this.interiorRings[e].length;r++)t+=this._getWktCoordinate(this.interiorRings[e][r])+",";t=t.slice(0,-1),t+=")"}return t+")"},l.prototype.toWkb=function(t){var e=new s(this._getWkbSize());e.writeInt8(1),this._writeWkbType(e,a.wkb.Polygon,t),this.exteriorRing.length>0?(e.writeUInt32LE(1+this.interiorRings.length),e.writeUInt32LE(this.exteriorRing.length)):e.writeUInt32LE(0);for(var r=0;r<this.exteriorRing.length;r++)this.exteriorRing[r]._writeWkbPoint(e);for(r=0;r<this.interiorRings.length;r++){e.writeUInt32LE(this.interiorRings[r].length);for(var n=0;n<this.interiorRings[r].length;n++)this.interiorRings[r][n]._writeWkbPoint(e)}return e.buffer},l.prototype.toTwkb=function(){var t=new s(0,!0),e=o.getTwkbPrecision(5,0,0),r=0===this.exteriorRing.length;if(this._writeTwkbHeader(t,a.wkb.Polygon,e,r),this.exteriorRing.length>0){t.writeVarInt(1+this.interiorRings.length),t.writeVarInt(this.exteriorRing.length);for(var n=new i(0,0,0,0),l=0;l<this.exteriorRing.length;l++)this.exteriorRing[l]._writeTwkbPoint(t,e,n);for(l=0;l<this.interiorRings.length;l++){t.writeVarInt(this.interiorRings[l].length);for(var c=0;c<this.interiorRings[l].length;c++)this.interiorRings[l][c]._writeTwkbPoint(t,e,n)}}return t.buffer},l.prototype._getWkbSize=function(){var t=16;this.hasZ&&(t+=8),this.hasM&&(t+=8);var e=9;this.exteriorRing.length>0&&(e+=4+this.exteriorRing.length*t);for(var r=0;r<this.interiorRings.length;r++)e+=4+this.interiorRings[r].length*t;return e},l.prototype.toGeoJSON=function(t){var e=o.prototype.toGeoJSON.call(this,t);if(e.type=a.geoJSON.Polygon,e.coordinates=[],this.exteriorRing.length>0){for(var r=[],n=0;n<this.exteriorRing.length;n++)this.hasZ?r.push([this.exteriorRing[n].x,this.exteriorRing[n].y,this.exteriorRing[n].z]):r.push([this.exteriorRing[n].x,this.exteriorRing[n].y]);e.coordinates.push(r)}for(var i=0;i<this.interiorRings.length;i++){for(var s=[],l=0;l<this.interiorRings[i].length;l++)this.hasZ?s.push([this.interiorRings[i][l].x,this.interiorRings[i][l].y,this.interiorRings[i][l].z]):s.push([this.interiorRings[i][l].x,this.interiorRings[i][l].y]);e.coordinates.push(s)}return e}},905:t=>{t.exports={wkt:{Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION"},wkb:{Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6,GeometryCollection:7},geoJSON:{Point:"Point",LineString:"LineString",Polygon:"Polygon",MultiPoint:"MultiPoint",MultiLineString:"MultiLineString",MultiPolygon:"MultiPolygon",GeometryCollection:"GeometryCollection"}}},620:(t,e,r)=>{t.exports=a;var n=r(905),o=r(213);function a(t){this.value=t,this.position=0}a.prototype.match=function(t){this.skipWhitespaces();for(var e=0;e<t.length;e++)if(0===this.value.substring(this.position).indexOf(t[e]))return this.position+=t[e].length,t[e];return null},a.prototype.matchRegex=function(t){this.skipWhitespaces();for(var e=0;e<t.length;e++){var r=this.value.substring(this.position).match(t[e]);if(r)return this.position+=r[0].length,r}return null},a.prototype.isMatch=function(t){this.skipWhitespaces();for(var e=0;e<t.length;e++)if(0===this.value.substring(this.position).indexOf(t[e]))return this.position+=t[e].length,!0;return!1},a.prototype.matchType=function(){var t=this.match([n.wkt.Point,n.wkt.LineString,n.wkt.Polygon,n.wkt.MultiPoint,n.wkt.MultiLineString,n.wkt.MultiPolygon,n.wkt.GeometryCollection]);if(!t)throw new Error("Expected geometry type");return t},a.prototype.matchDimension=function(){switch(this.match(["ZM","Z","M"])){case"ZM":return{hasZ:!0,hasM:!0};case"Z":return{hasZ:!0,hasM:!1};case"M":return{hasZ:!1,hasM:!0};default:return{hasZ:!1,hasM:!1}}},a.prototype.expectGroupStart=function(){if(!this.isMatch(["("]))throw new Error("Expected group start")},a.prototype.expectGroupEnd=function(){if(!this.isMatch([")"]))throw new Error("Expected group end")},a.prototype.matchCoordinate=function(t){var e;if(!(e=t.hasZ&&t.hasM?this.matchRegex([/^(\S*)\s+(\S*)\s+(\S*)\s+([^\s,)]*)/]):t.hasZ||t.hasM?this.matchRegex([/^(\S*)\s+(\S*)\s+([^\s,)]*)/]):this.matchRegex([/^(\S*)\s+([^\s,)]*)/])))throw new Error("Expected coordinates");return t.hasZ&&t.hasM?new o(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4])):t.hasZ?new o(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])):t.hasM?new o(parseFloat(e[1]),parseFloat(e[2]),void 0,parseFloat(e[3])):new o(parseFloat(e[1]),parseFloat(e[2]))},a.prototype.matchCoordinates=function(t){var e=[];do{var r=this.isMatch(["("]);e.push(this.matchCoordinate(t)),r&&this.expectGroupEnd()}while(this.isMatch([","]));return e},a.prototype.skipWhitespaces=function(){for(;this.position<this.value.length&&" "===this.value[this.position];)this.position++}},11:(t,e,r)=>{e.Types=r(905),e.Geometry=r(56),e.Point=r(213),e.LineString=r(503),e.Polygon=r(978),e.MultiPoint=r(665),e.MultiLineString=r(606),e.MultiPolygon=r(763),e.GeometryCollection=r(292)},172:t=>{t.exports={encode:function(t){return t<<1^t>>31},decode:function(t){return t>>1^-(1&t)}}},83:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],o="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof o[n[e]]&&(t[t.length]=n[e]);return t}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.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";r.r(n),r.d(n,{BOTTOM_GRID:()=>i,CENTER_VALENCIA:()=>y,COLORS:()=>g,DAY_VALUE:()=>d,DEFAULT_NAME_MARGIN_Y:()=>f,DIVSIZE:()=>m,HEIGH_GRID:()=>c,IDIOMA:()=>t,LEFT_GRID:()=>o,NAME_MARGIN_Y_BARRIOS:()=>Dr,NIGHT_VALUE:()=>p,RIGTH_GRID:()=>a,RIGTH_TOOLBOX:()=>u,TOP_GRID:()=>s,TOP_GRID_SIN_LEYENDA:()=>l,TOP_LEGEND:()=>e,TOP_TOOLBOX:()=>h,addDatesToGaps:()=>Lt,addPointInteger:()=>b,calcularRuta:()=>ct,calculateXAxisMonth:()=>E,calculateXAxisStart:()=>It,calculateXAxisYear:()=>I,changeImg:()=>st,chargeData:()=>ze,clearInputs:()=>Re,closeFilter:()=>it,closePopUp:()=>ot,commonPostFetch:()=>Q,configureDataGaugeMonth:()=>K,configureDataLine:()=>q,configureGaugeYearBig:()=>Mt,createChart:()=>Hn,createCheckBoxFilter:()=>ft,createCheckBoxFilterVar:()=>pt,createGauge:()=>H,createLeafletMap:()=>Qt,createLeafletMapPolygon:()=>Xt,createObjectMarkerElements:()=>te,createSerie:()=>Ve,drawMarkers:()=>re,drawMarkersPolygon:()=>ne,echartAccesosBarYear:()=>ce,echartAccesosGaugeMonth:()=>he,echartAccesosGaugeVehicles:()=>jt,echartAccesosGaugeYear:()=>de,echartAccesosHorStackedBarVehicles:()=>Ht,echartAccesosLineMonth:()=>ge,echartAccesosPieVehicles:()=>Jt,echartAccesosVerStackedBarVehicles:()=>qt,echartAccessosCiutat:()=>_t,echartAcessosAnellCiclista:()=>ie,echartAiguaBarMonth:()=>Wr,echartAiguaGaugeSemicircle:()=>Zr,echartAiguaRelojSemicircle:()=>Jr,echartAiguaStackedBarYears:()=>Hr,echartAltUsuarisDiaries:()=>ro,echartAnellBarYear:()=>le,echartAnellCiclista:()=>se,echartAnellGaugeMonth:()=>ue,echartAnellGaugeYear:()=>fe,echartAnellLineMonth:()=>pe,echartBarrisBarYear:()=>qr,echartBarrisGaugeMonth:()=>tn,echartBarrisGaugeYear:()=>Qr,echartBarrisLineMonth:()=>Kr,echartBenimamet:()=>Nr,echartConectadosGaugeMonth:()=>no,echartConectadosGaugeYear:()=>oo,echartConectadosHorStackedBar:()=>io,echartConectadosVerStackedBar:()=>so,echartConsumAguaBarris:()=>kr,echartConsumTotalAgua:()=>Pr,echartDesKgsBar:()=>gn,echartDesKgsGauge:()=>dn,echartDesKgsHorStackedBar:()=>cn,echartDesKgsPerTipusResidu:()=>an,echartDesKgsPie:()=>mn,echartDesKgsStackedBar:()=>un,echartExposicio:()=>xr,echartGaugeMonth:()=>x,echartGaugeYear:()=>B,echartInstancesSeuElectronicaBarMonth:()=>bn,echartInstancesSeuElectronicaRelojSemicircle:()=>vn,echartInstancesSeuElectronicaStackedBarYears:()=>Cn,echartInstanciesDonadesAlta:()=>Ln,echartInstanciesSeuElectronica:()=>An,echartIntensidadAnualCiclista:()=>Ae,echartIntensidadDiarialCiclista:()=>Ee,echartIntensidadMensualCiclista:()=>be,echartIntensidadRealTimeCiclista:()=>Ie,echartKgsResidus:()=>en,echartKgsResidusBarMonth:()=>pn,echartKgsResidusRelojSemicircle:()=>hn,echartKgsResidusStackedBarYears:()=>ln,echartLine:()=>vt,echartLineLinia:()=>We,echartLineTitol:()=>Ye,echartMalilla:()=>Br,echartMestalla:()=>Gr,echartNO:()=>Er,echartNO2:()=>br,echartNOX:()=>Ir,echartNotificacionsTelematic:()=>Un,echartO3:()=>vr,echartPIAEDonadesAltaBarMonth:()=>jn,echartPIAEDonadesAltaGaugeMonth:()=>Wn,echartPIAEDonadesAltaGaugeYear:()=>Zn,echartPIAEDonadesAltaStackedBarYears:()=>Yn,echartPM1:()=>Mr,echartPM10:()=>Ar,echartPM25:()=>Tr,echartPerellonet:()=>Vr,echartPuntosMedidaBicis:()=>ye,echartPuntosMedidaTrafico:()=>ae,echartResolucionsAssentades:()=>_n,echartSO2:()=>wr,echartSeuElectronica:()=>Sn,echartSeuElectronicaBarMonth:()=>En,echartSeuElectronicaRelojSemicircle:()=>Mn,echartSeuElectronicaStackedBarYears:()=>Dn,echartSonometroManana:()=>Xn,echartSonometroNoche:()=>to,echartSonometroTarde:()=>Qn,echartSotenis:()=>Yr,echartTemperatureMitjanaDiaria:()=>Jn,echartUsuarisConectadosDiaries:()=>ao,echartUsuarisPerLinea:()=>fr,echartUsuarisPerLiniaBarYear:()=>yr,echartUsuarisPerLiniaGaugeMonth:()=>nr,echartUsuarisPerLiniaGaugeYear:()=>er,echartUsuarisPerLiniaLineMonth:()=>gr,echartUsuarisPerTitol:()=>ur,echartUsuarisPerTitolBarYear:()=>mr,echartUsuarisPerTitolGaugeMonth:()=>rr,echartUsuarisPerTitolGaugeYear:()=>tr,echartUsuarisPerTitolLineMonth:()=>pr,echartUsuarisTotals:()=>lr,echartUsuarisTotalsBarMonth:()=>Le,echartUsuarisTotalsGaugeMonth:()=>ir,echartUsuarisTotalsGaugeYear:()=>Qe,echartUsuarisTotalsStackedBarYears:()=>sr,echartVerStackedBar:()=>R,echartVieBarYear:()=>Zt,echartVieGaugeMonth:()=>$t,echartVieGaugeYear:()=>Yt,echartVieLineMonth:()=>Wt,echartViePrincCiutat:()=>kt,echartYearInstancesSeuElectronicaGaugeSemicircle:()=>In,echartYearKgsResidusGaugeSemicircle:()=>fn,echartYearSeuElectronicaGaugeSemicircle:()=>wn,filterData:()=>He,filterDatesUpdate:()=>$e,filterEMT1Update:()=>xe,filterEMT2Update:()=>Be,filterVarUpdate:()=>dt,filterWindow:()=>at,formatDDMM:()=>bt,formatName:()=>J,formatRoundTooltip:()=>G,formatSixDigitDate:()=>yt,formatTooltip:()=>w,formatearFecha:()=>At,formatoFecha:()=>gt,formatoFecha2:()=>mt,formatoFecha3:()=>St,formatterReloj:()=>k,generateDatesArray:()=>Dt,getCommonOptionDonut:()=>V,getCommonOptionGaugeUmbral:()=>z,getCommonOptionPie:()=>j,getCommonOptions:()=>P,getCommonOptionsBar:()=>F,getCommonOptionsGaugeMonth:()=>Z,getCommonOptionsGaugeYears:()=>W,getCommonOptionsLimited:()=>_r,getConfigurationGaugeYears:()=>Y,getDateFromStr:()=>Tt,getMaxValue:()=>O,getMonth:()=>T,getMonthComplete:()=>C,getStringFromDate:()=>Ct,getTime:()=>Et,getWidthElementChart:()=>N,handlerActivarFiltro:()=>Ze,handlerDesactivarFiltro:()=>Je,includeHTMLCabecera:()=>tt,includeHTMLFooter:()=>rt,includeHTMLMenu:()=>et,indoPopUp:()=>nt,initChart:()=>X,initStackedBarChartSedeElec:()=>Tn,listeneresAgua:()=>Ur,listeneresContamina:()=>Cr,listeneresEMT:()=>qe,listeneresVehicles:()=>Nt,llamadasIniciales:()=>ht,loadAnaliticaFrames:()=>lo,loadMap:()=>eo,mapPuntosMedidaBicis:()=>me,mapPuntosMedidaTrafico:()=>oe,normalImg:()=>lt,obtenerGeoJson:()=>ee,obtenerRuta:()=>ut,prepareData:()=>Lr,printDataChart:()=>_,printNoDataChart:()=>D,setDOMData:()=>Ce,splitData:()=>U,tableAcceso:()=>Pt,tableVariacio:()=>Rt,tableVias:()=>xt,tramosBicis:()=>De,usdEmtUsuarisPerLinea:()=>dr,usdEmtUsuarisPerTitol:()=>hr,usdEmtUsuarisTotals:()=>cr,xAxisFormatWithoutYear:()=>wt,yAxisFormat:()=>v});const t="ca_ES",e="8%",o="2.5%",a="5%",i="18%",s="20%",l="10%",c="90%",u="1%",h="0%",f=0,d=65,p=55,g=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],m=33,y=[39.46975,-.37739],S=27,A=30;function b(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const r={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",r):t.toLocaleString(e,r)}function E(t){return 100*(1-17/t)}function I(t){return 100*(1-7/t)}function w(t,e=!1){let r=`<p>${t[0].name}</p>`;return t.forEach((t=>{const n=e?Math.round(t.data):t.data,o=`<div>${a=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${a}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?b(n):"-"}</strong></div>`;var a;r+=o})),r}function v(t){return b(t)}function M(){const t=$("#formFilterDates").find("input");$(t).each(((t,e)=>{e.checked&&(e.checked=!1)}));const e=$("#formFilterVar").find("input");$(e).each(((t,e)=>{e.checked&&(e.checked=!1)})),function(){let t=0;const e=$("#formFilterDates").find("input");$(e).each(((e,r)=>{t+=1,r.checked=!0})),t=0;const r=$("#formFilterVar").find("input");$(r).each(((e,r)=>{t+=1,null!=render_tableVariacio?t<=2&&(r.checked=!0):t<=3&&(r.checked=!0)})),Dashboards.getParameterValue("filterVarParam").length>0&&Dashboards.fireChange("filterVarParam")}()}function T(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())]}function C(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 D(t,e){const r=t?document.querySelector(t):null,n=e?document.querySelector(e):null;r&&(r.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function _(t,e){const r=t?document.querySelector(t):null,n=e?document.querySelector(e):null;r&&(r.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function U(t,e){return t.reduce(((t,r)=>{const n=r[e];return t[n]||(t[n]=[]),t[n].push(r),t}),{})}function O(t,e,r=1){const n=Math.max(...t.map((t=>t[e])))*r;return 5e3*Math.ceil(n/5e3)}function N(t){return Math.round(document.getElementById(t).offsetWidth/m)}function k(t,e,r){const n=b(Math.round(e)),o=T(t[r][0]),a=t[r][1],i=`\n\n\n${o} ${a} : ${n}`,s=`${n}\n${o} ${a}`;return window.innerWidth<=1710?i:s}function P(t,r,n,f,d,p,g,m=5,y="",S=d,A=100,b,E=void 0,I=void 0){return{title:{text:y,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>w(t),textStyle:{fontFamily:"Montserrat"}},legend:r?{type:"plain",data:r,textStyle:{fontFamily:"Montserrat"},top:E||e,selected:b}:null,grid:{left:o,right:a,bottom:i,top:r?E?"30%":s:l,heigh:c,containLabel:!0},xAxis:{type:"category",data:n,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,g]},type:"value",scale:!0,min:I,axisLabel:{margin:m,formatter:v,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:t,dataZoom:[{show:p,data:n,start:S,end:A,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:p,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:u,top:h}}}function R(t,e,r,n,l="",u="total",h=0,f=1,d=2,p=g){if(0===r.length)D(`#${t}`,`#${e}`);else{_(`#${e}`,`#${t}`);const g=[];let m=U(r,h);const y=new Set(r.map((t=>t[f]))),S=Object.keys(m);y.forEach((t=>{S.forEach((e=>{void 0===m[e].find((e=>e[f]===t))&&(m[e].push([m[e][0][h],t,void 0]),m[e][0][1].length>4?m[e].sort(((t,e)=>{const[r,n]=t[1].split("/"),[o,a]=e[1].split("/"),i=new Date(n,r-1,1),s=new Date(a,o-1,1);return i.getTime()-s.getTime()})):m[e].sort())}))}));const A=Object.entries(m).sort(((t,e)=>t[0].localeCompare(e[0]))),M=""===u?90:0;m=Object.fromEntries(A),Object.keys(m).forEach((t=>{g.push({name:t,type:"bar",stack:u,label:{show:!0,fontFamily:"Montserrat",rotate:M,formatter:t=>b(Math.round(t.value))},emphasis:{focus:"series"},data:m[t].map((t=>t[d]))})}));const T=""!==u?E(y.size):I(y.size);X(t,{color:p,title:{text:l,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>w(t,!0)},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:o,right:a,bottom:i,top:s,heigh:c,containLabel:!0},yAxis:{type:"value",splitNumber:4,name:n,nameLocation:"end",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666"},axisLabel:{formatter:v,textStyle:{fontSize:8,fontFamily:"Montserrat",color:"#666"}}},xAxis:{type:"category",data:[...y],axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:g,toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50},dataZoom:[{show:!0,data:[...y],start:T,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)"}}}]})}}function x(t,e,r,n,o,a,i){if(0===o.length)D(`#${t}`,`#${r}`),D(`#${e}`,`#${n}`);else{_(`#${r}`,`#${t}`),_(`#${n}`,`#${e}`);const s=0,l=2,c=K(o,l,1),u=c[0],h=c[1],f=c[2],d=c[3],p=c[5],g=N(t),m=H(u,l,s,p,g),y=H(h,l,s,p,g);X(t,Y(`${a}${C(String(Object.keys(f)[1]))}`,d,m,g)),X(e,Y(`${i}${C(String(Object.keys(f)[0]))}`,d,y,g))}}function B(t,e,r,n){0===r.length?D(`#${t}`,`#${e}`):_(`#${e}`,`#${t}`);const o=O(r,1,1.1),a=N(t);let i=180;o>9999999&&(i=95);const s=H(r,1,0,i,a);X(t,Y(`${n} ${r[0][2]}`,o,s,a))}function F(t,e,r=-45,n="",o=e){const a=new Set,i=[];t.forEach((t=>{const e=t[0].toString().padStart(2,"0");a.add(`${e}/${t[1]}`),i.push(Math.round(t[2]))}));const s=i.length<100?40:80;return P({name:o,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:i},null,Array.from(a.values()),e,s,!0,r,25,n)}function G(t,e){const r=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${t.color};"></span>`;let n=`${t.name} : `;return n+=`<span style="font-weight:bold">${b(t.value)}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),r+n}function z(t,e,r,n){return{series:[{type:"gauge",center:["50%","50%"],startAngle:200,endAngle:-20,min:0,max:100,splitNumber:0,progress:{show:!1,width:5,itemStyle:{color:"#666"}},axisLine:{lineStyle:{width:18}},axisTick:{show:!1},splitLine:{length:15,lineStyle:{width:2,color:"#999"}},axisLabel:{distance:25,color:"#999",fontSize:20,show:!1},anchor:{show:!0,showAbove:!0,size:25,itemStyle:{borderWidth:10},show:!1},pointer:{show:!0,icon:"path://M12.8,0.7l12,40.1H0.7L12.8,0.7z",length:"12%",width:20,offsetCenter:[0,"-40%"],itemStyle:{color:"#ccc"}},axisLine:{lineStyle:{width:35,color:[[e,"#e56b6f"],[e+r,"#ffbf69"],[1,"#a1c483"]]}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},title:{show:!0,offsetCenter:[0,"45%"],textStyle:{color:"#000",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:15}},detail:{fontSize:30,offsetCenter:[0,"90%"],valueAnimation:!0,color:"#666",textStyle:{color:"#000",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:35}},data:[{value:t,name:n}]}]}}function V(t,e,r,n){return{tooltip:{trigger:"item",formatter:t=>G(t,!1),textStyle:{fontSize:13.5,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},title:{text:e,left:"center",top:"40%",textStyle:{fontSize:13.5,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{left:"center",bottom:"0%",textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},series:[{top:"0%",bottom:"15%",type:"pie",radius:r||["65%","75%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:5,borderColor:"#f1f1f1",borderWidth:1},label:{show:!1,position:"center",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},emphasis:{label:{show:!1,fontSize:20}},labelLine:{show:!1},color:n||["#fcb9b2","#ffd97d","#64a6bd","#98c9a3","#ff9b85"],data:t}]}}function j(t,e,r,n=g){return{textStyle:{fontFamily:"Montserrat"},title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:r-4,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"item",textStyle:{fontFamily:"Montserrat"},formatter:t=>G(t,!0)},legend:{orient:"horizontal",textStyle:{fontFamily:"Montserrat"},left:e.length>5?"10%":"12%",bottom:"10%",top:"65%",selectedMode:!1},series:[{type:"pie",radius:"33%",data:e,color:n,top:"-30%",emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:10,top:20}}}function Y(t,e,r,n){return{color:g,title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:n,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"},formatter:t=>G(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=>b(Math.round(t)),fontFamily:"Montserrat",color:"#666"},data:r,detail:{fontSize:n/1.2,color:"inherit",formatter:t=>b(Math.round(t))}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:S,top:A}}}function W(t,e="",r){const n=[],o=O(t,1,1.1),a=o.toString().length>=9?100:95,i=115===a?-45:-35;let s=t.length<5?t.length*i:-190;for(let e=0;e<t.length;e+=1)n.push({value:t[e][1],name:String(t[e][0]),title:{offsetCenter:[String(s),"20%"],fontFamily:"Montserrat"},detail:{offsetCenter:[String(s),"35%"],fontFamily:"Montserrat"}}),s+=a;return Y(e,o,n,r)}function Z(t,e,r="",n){return{title:{text:r,left:"center",top:"top",padding:10,textStyle:{fontSize:n,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:O(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=>b(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[-5,"-10%"],fontSize:n+5,fontWeight:"bolder",formatter:r=>k(t,r,e),fontFamily:"Montserrat",color:"inherit"},data:[{value:t[e][2]}]},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:S,top:A}}}function J(t){if(t.length>=29){const e=t.split(" ");let r="",n="";for(const t of e)`${r} ${t}`.length<=29?r+=(r?" ":"")+t:(n+=`${r}\n`,r=t);return n+=r,n}return t}function H(t,e,r,n,o){let a=20,i=35,s=-190,l=n;t.length<=2&&(s=-140,l+=100,a=25,i=42);const c=g.slice(),u=[];for(let n=0;n<t.length;n+=1)u.push({value:t[n][e],name:J(t[n][r]),color:c.shift(),title:{offsetCenter:[String(s),`${String(a)}%`],fontFamily:"Montserrat",fontSize:o-3},detail:{offsetCenter:[String(s),`${String(i)}%`],fontFamily:"Montserrat"}}),s+=l,(n+1)%3==0&&(i+=30,a+=30,s=-190);return u}function q(t,e,r=!1){const{resultset:n}={resultset:t},o=new Set,a=new Set,i=e,s=n.map((([t,e,n])=>{const i=r?Math.round(n):n;return o.add(t),a.add(e),{day:e,type:t,value:i}})),l=Array.from(a.values()),c=Array.from(o.values());return c.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[c.map((t=>{const e=s.filter((e=>e.type===t)).map((({day:e,value:r})=>[e,t,r])),r=l.map((t=>{const r=e.find((([e])=>e===t));return r?r[2]:null}));return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:r}})),a,c]}function K(t,e,r){const n=O(t,e,1.1);let o=50,a=180;n>9999999&&(o=65,a=95);const i=U(t,r);let[s,l]=Object.values(i);return Object.values(i).slice(1).forEach((t=>{l=t})),[l,s,i,n,o,a]}function X(t,e){const r=document.getElementById(t);if(!r)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const n=echarts.init(r);return n.setOption(e,!0),$(window).on("resize",(()=>{null!=n&&void 0!==n&&n.resize()})),n}function Q(){$("#chart2").css("width","100%")}function tt(){let t,e,r,n;const o=document.getElementsByTagName("*");for(t=0;t<o.length;t+=1)if(e=o[t],r=e.getAttribute("include-html-cabecera"),r)return n=new XMLHttpRequest,n.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(e.innerHTML=this.responseText),404===this.status&&(e.innerHTML="No se ha podido cargar correctamente."))},n.open("GET",r,!0),void n.send()}function et(t){let e,r,n,o;const a=document.getElementsByTagName("*");for(e=0;e<a.length;e+=1)if(r=a[e],n=r.getAttribute("include-html-menu"),n)return o=new XMLHttpRequest,o.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(r.innerHTML=this.responseText,$(t).removeClass("imgNavMenu"),$(t).addClass("imgNavMenuActive")),404===this.status&&(r.innerHTML="No se ha podido cargar correctamente."))},o.open("GET",n,!0),void o.send()}function rt(){let t,e,r,n;const o=document.getElementsByTagName("*");for(t=0;t<o.length;t+=1)if(e=o[t],r=e.getAttribute("include-html-footer"),r)return n=new XMLHttpRequest,n.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(e.innerHTML=this.responseText),404===this.status&&(e.innerHTML="No se ha podido cargar correctamente."))},n.open("GET",r,!0),void n.send()}function nt(){$("#idPopupInfo").show()}function ot(){$("#idPopupInfo").hide()}function at(){"none"===$("#layoutFilter").css("display")?$("#layoutFilter").show():$("#layoutFilter").hide()}function it(){$("#layoutFilter").hide()}function st(t,e){0!==t.childNodes[1].childNodes.length?$(`#${t.children[0].children[0].children[0].children[0].id}`).attr("src",`/pentaho/api/repos/%3Apublic%3Asc_valencia%3ACiutat%3Abuild%3Aimages/${t.children[0].children[0].children[0].children[0].src.split("/").pop().split(".")[0]}_hover.svg}`):t.children[0].src=`/pentaho/api/repos/%3Apublic%3Asc_valencia%3ACiutat%3Abuild%3Aimages%3A${e}_hover.svg/content`}function lt(t,e){0!=t.childNodes[1].childNodes.length?$(`#${t.children[0].children[0].children[0].children[0].id}`).attr("src",`/pentaho/api/repos/%3Apublic%3Asc_valencia%3ACiutat%3Abuild%3Aimages/${t.children[0].children[0].children[0].children[0].src.split("/").pop().split("_")[0]}.svg}`):t.children[0].src=`/pentaho/api/repos/%3Apublic%3Asc_valencia%3ACiutat%3Abuild%3Aimages%3A${e}.svg/content`}function ct(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 ut(t){return`${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 ht(t){$(document).click((()=>{const t=$("#layoutFilter");t.is(event.target)||t.has(event.target).length||t.hide()})),tt(),et(t),rt()}function ft(t,e,r){const n=$("#formFilterDates");if(""===Dashboards.getParameterValue("updateFilter")){const r=new Set;for(let n=t-1;n>0;--n)r.add(e[n]);for(const[t,e]of r.entries())n.append(`<input type="checkbox" id="${t}" onclick="legacy.filterDatesUpdate();" />${e}<br /></input>`);M(),function(){const t=$("#formFilterDates").find("input"),e=[];$(t).each(((t,r)=>{r.checked&&e.push(r.id)})),Dashboards.fireChange("filterDatesParam",e),Dashboards.fireChange("updateFilter","True")}()}}function dt(){const t=$("#idFilterVar").find("input"),e=[];$(t).each(((t,r)=>{r.checked&&e.push(r.id.replaceAll("/","-"))})),Dashboards.fireChange("filterVarParam",e),Dashboards.fireChange("updateFilterVar","True")}function pt(t,e){const r=$("#formFilterVar");if(""===Dashboards.getParameterValue("updateFilterVar")){for(let t=e.length-1;t>=0;t--)r.append(`<input type="checkbox" id="${e[t]}" onclick="legacy.filterVarUpdate();" />${e[t]}<br /></input>`);M(),dt()}}function gt(t){return t.replace(/^(\d{4})[-|\/](\d{2})[-|\/](\d{2})$/g,"$3/$2/$1")}function mt(t){return t.replace(/^(\d{4})(\d{2})(\d{2})$/g,"$3/$2/$1")}function yt(t){const e=`20${t.slice(0,2)}`,r=t.slice(2,4);return`${t.slice(4,6)}/${r}/${e}`}function St(t,e){const r=t.slice(0,2),n=t.slice(3,6);let o;return o=null==e?`20${t.slice(7,9)}`:`20${e.slice(5,7)}`,2===o.length&&(o="2022"),`${r}/${{Gen:"01",Feb:"02",Mar:"03",Abr:"04",Mai:"05",Jun:"06",Jul:"07",Ago:"08",Sep:"09",Oct:"10",Nov:"11",Des:"12"}[n]}/${o}`}function At(t){let e=t.getUTCDate().toString();1===e.length&&(e=`0${e}`);let r=(t.getMonth()+1).toString();return 1===r.length&&(r=`0${r}`),`${e}/${r}/${t.getFullYear().toString()}`}function bt(t){const e=t.slice(0,2);return`${t.slice(3,5)}/${e}`}function Et(t){const e=t.toString().match(/(\d{2}:\d{2})/);return e?e[1]:null}function It(t){return 100*(t-120)/t}function wt(t){return Array.from(t.values()).map((t=>{const[e,r]=t.split("/");return bt(t)}))}function vt(t,e,r,n,o,a,i,s,l=!1,c=!1,u=void 0,h=!0,f=g.slice(),d=!1,p=void 0,m=void 0){const y=t.resultset||t;if(0===y.length)D(`#${a}`,`#${i}`),s&&D(`#${s}`,`#${i}`);else{_(`#${i}`,`#${a}`),s&&_(`#${i}`,`#${s}`);const t=q(y,f,d),g=t[0],S=t[1],A=t[2],b=h?A:null,I=c?wt(S):Array.from(S.values());void 0===u&&(u=l?E(S.size):It(S.size)),X(a,P(g,b,I,o,u,e,r,void 0,n,void 0,void 0,void 0,p,m))}}function Mt(t,e,r=!1){const n=[],o=1.1*O(t,1);let a,i=50,s=250,l=20,c=30,u=-80;o>9999999&&(i=65,s=75);const h=r?4:3;for(let r=0;r<t.length;r+=1)a=String(t[r][0]).replace(/\[.*?\]/g,""),a=J(a),n.push({value:t[r][1],name:a,title:{offsetCenter:[`${String(u)}%`,`${String(l)}%`],fontFamily:"Montserrat",fontSize:e},detail:{offsetCenter:[`${String(u)}%`,`${String(c)}%`],fontFamily:"Montserrat",fontSize:e}}),u+=s,(r+1)%h==0&&(c+=30,l+=30,u=-80);return[o,n,i]}function Tt(t){const e=t.split("/"),r=parseInt(e[0],10),n=parseInt(e[1],10)-1,o=parseInt(e[2],10);return new Date(o,n,r)}function Ct(t){return`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${String(t.getFullYear())}`}function Dt(t,e){const r=[];for(;t<=e;){const e=Ct(t);r.push(e),t.setDate(t.getDate()+1)}return r}function Lt(t){const e=Array.from(t.keys(),(t=>Tt(t))),r=[],n=[],o=Dt(new Date(Math.min(...e)),new Date(Math.max(...e)));return o.forEach((e=>{if(t.has(e)){const r=t.get(e);n.push(r)}else n.push(null)})),r.push(o),r.push(n),r}function _t(t,e){vt(e,!0,-6,"TRÀNSIT DE VEHICLES: ACCESSOS A LA CIUTAT","Vehicles","chartAcessosCiutat","no_dataAcessosCiutat","idTableAcceso");const r=window.innerHeight>720?void 0:"5%",n=e.resultset,o=new Date(n[n.length-1][1].replace(/(\d{2})\/(\d{2})\/(\d{4})/,"$2/$1/$3")),a=new Date(o.getFullYear(),o.getMonth()-5,o.getDate()),i=n.filter((t=>new Date(t[1].replace(/(\d{2})\/(\d{2})\/(\d{4})/,"$2/$1/$3"))>=a)).map((t=>t[2]));vt(e,!1,-6,"TRÀNSIT DE VEHICLES: ACCESSOS A LA CIUTAT","Vehicles","chartTransitAccessosCiutat","no_dataAcessosCiutat",void 0,void 0,void 0,void 0,void 0,void 0,void 0,r,1e4*Math.floor(Math.min(...i)/1.1/1e4))}function Ut(){document.querySelector("#idFiltrar").style.visibility="visible"}function Ot(){document.querySelector("#idFiltrar").style.visibility="hidden"}function Nt(){render_tableVariacio.listeners=["filterVarParam","updateFilterVar"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter"),Dashboards.fireChange("updateFilterVar"),document.querySelector("#idVariacio").addEventListener("click",Ut),document.querySelector("#idAcessosCiutat").addEventListener("click",Ot),document.querySelector("#idViePrincCiutat").addEventListener("click",Ot)}function kt(t,e){vt(e,!0,f,"TRÀNSIT DE VEHICLES: VIES PRINCIPALS DE LA CIUTAT","Vehicles","chartViePrincCiutat","no_dataViePrincCiutat","idTableViaPri")}function Pt(t,e){const r=[];if(null!=e.resultset&&e.resultset.length>0)for(let t=0;t<e.resultset.length;t++){const n=`<div><img class="imgTabulator" src="build/Imagenes/camara.svg">${e.resultset[t][3]}</div>`;r.push({tram:e.resultset[t][1],cam:e.resultset[t][2],url:n})}new Tabulator("#idTableAcceso",{selectable:!1,headerSort:!1,height:700,width:1e3,data:r,layout:"fitColumns",groupBy:["tram"],columns:[{title:"Tram",field:"tram",hozAlign:"center",headerHozAlign:"center",formatter:"html"},{title:"Descripció Càmera",field:"cam",hozAlign:"center",headerHozAlign:"center",width:560},{title:"URL",field:"url",hozAlign:"center",headerHozAlign:"center",formatter:"html"}],rowClick(t,e){}})}function Rt(t,e){const r=[],n=Dashboards.getParameterValue("filterVarParam"),o=new Set;if(null!=e.resultset&&e.resultset.length>0){if(n.length>0)for(let t=n.length-1;t>=0;t-=1)for(let a=0;a<e.resultset.length;a+=1)n[t]===e.resultset[a][3]&&(o.add(e.resultset[t][3]),r.push({dat:e.resultset[a][3].replaceAll("-","/"),tram:e.resultset[a][1],int:b(e.resultset[a][6]),vari:b((100*parseFloat(e.resultset[a][5])).toFixed(2)),dataRe:e.resultset[a][2].replaceAll("-","/"),intRe:b(e.resultset[a][7])}));else for(let t=0;t<e.resultset.length;t+=1)o.add(e.resultset[t][3].replaceAll("-","/")),r.push({dat:e.resultset[t][3].replaceAll("-","/"),tram:e.resultset[t][1],int:e.resultset[t][6],vari:(100*parseFloat(e.resultset[t][5])).toFixed(2),dataRe:e.resultset[t][2].replaceAll("-","/"),intRe:e.resultset[t][7]});const t=Array.from(o);pt(t.length,t)}0===n.length?($("#chartVariacio").hide(),$("#no_dataChartVariacio").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataChartVariacio").show()):($("#chartVariacio").show(),$("#no_dataChartVariacio").hide()),new Tabulator("#chartVariacio",{selectable:!1,headerSort:!1,height:700,width:1e3,data:r,layout:"fitColumns",groupBy:["dat"],columns:[{title:"Data",field:"dat",hozAlign:"center",headerHozAlign:"center"},{title:"Tram",field:"tram",hozAlign:"center",headerHozAlign:"center",width:560},{title:"Intensitat",field:"int",hozAlign:"center",headerHozAlign:"center"},{title:"Variació",field:"vari",hozAlign:"center",headerHozAlign:"center",formatter:(t,e,r)=>(parseFloat(t.getValue())<0?t.getElement().classList.add("custom-red-cell"):t.getElement().classList.add("custom-green-cell"),t.getValue())},{title:"Data Referència",field:"dataRe",hozAlign:"center",headerHozAlign:"center"},{title:"Intensitat Referència",field:"intRe",hozAlign:"center",headerHozAlign:"center"}],rowClick(t,e){}})}function xt(t,e){const r=[];if(null!=e.resultset)for(let t=0;t<e.resultset.length;t+=1){const n=`<div><img class="imgTabulator" src="build/Imagenes/camara.svg">${e.resultset[t][3]}</div>`;r.push({tram:e.resultset[t][1],cam:e.resultset[t][2],url:n})}new Tabulator("#idTableViaPri",{selectable:!1,headerSort:!1,height:700,width:1e3,data:r,layout:"fitColumns",groupBy:["tram"],columns:[{title:"Tram",field:"tram",hozAlign:"center",headerHozAlign:"center",formatter:"html"},{title:"Descripció Càmera",field:"cam",hozAlign:"center",headerHozAlign:"center",width:560},{title:"URL",field:"url",hozAlign:"center",headerHozAlign:"center",formatter:"html"}],rowClick(t,e){}})}function $t(t,e){document.querySelector("#tabViePrincCiutat").addEventListener("click",(()=>{requestAnimationFrame((()=>{x("chartViesMesActual","chartViesMesAnterior","no_dataViesMesActual","no_dataViesMesAnterior",e.resultset,"VIES PRINCIPALS DE LA\nCIUTAT: EVOLUCIÓ ","VIES PRINCIPALS DE LA\nCIUTAT: EVOLUCIÓ ")}))}))}var Bt=r(421);const Ft={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 Gt(t,e){const r=e.resultset,n=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"];if(0===e.length)(0,Bt.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,Bt.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e={type:0,data:1,time:2},[o,a]=(0,Bt.configureDataGaugeCommon)(r,e,n.slice(),t.fontSize,t.paramOffsetCenterTitle,t.paramOffsetCenterDetail,t.paramOffsetLabel,t.paramCalculatedOffset,t.paramNumberOfElementsByLine),i={...Ft};i.title.text=t.chartName,i.series.max=o,i.series.data=a,i.series.detail.fontSize=t.fontSize,i.series.detail.formatter=t=>(0,Bt.addPointInteger)(Math.round(t)),i.series.axisTick.splitNumber=5,i.color=n.slice(),i.series.axisLabel.formatter=t=>(0,Bt.addPointInteger)(Math.round(t)),i.tooltip.formatter=t=>function(t,e){let r=`${t.name} : `;return r+=`<span style="font-weight:bold">${(0,Bt.addPointInteger)(Math.round(t.value))}</span>`,t.marker+r}(t),(0,Bt.initChart)(t.idChart,i)}}const zt="ca_ES",Vt={es_ES:new Map([["chartAccesosGauge","ACCESOS A LA CIUDAD: ACUMULADO AÑO }"],["chartViesGaugeYear","VIAS PRINCIPALES DE LA\nCIUDAD: ACUMULADO AÑO }"]]),ca_ES:new Map([["chartAccesosGauge","ACCESSOS A LA CIUTAT: ACUMULAT ANY "],["chartViesGaugeYear","VIES PRINCIPALS DE LA\nCIUTAT: ACUMULAT ANY "]])};function jt(t,e){Gt({idChart:"chartAccesosGauge",idNoData:"no_dataAccesosGauge",chartName:`${Vt[zt].get("chartAccesosGauge")}${e.resultset[0][2]}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-75,paramCalculatedOffset:75,paramNumberOfElementsByLine:3},e)}function Yt(t,e){Gt({idChart:"chartViesGaugeYear",idNoData:"no_dataViesGaugeYear",chartName:`${Vt[zt].get("chartViesGaugeYear")}${e.resultset[0][2]}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-90,paramCalculatedOffset:90,paramNumberOfElementsByLine:3},e)}function Wt(t,e){vt(e,!0,1,"VIES PRINCIPALS DE LA CIUTAT: HISTÒRIC MENSUAL","Vehicles","chartViesLineMonth","no_dataViesLineMonth",void 0,!0)}function Zt(t,e){R("chartViesBar","no_dataViesBar",e.resultset,"Vehicles","VIES PRINCIPALS DE LA CIUTAT: HISTÒRIC ANUAL","")}function Jt(t,e){if(0===e.resultset.length)D("#chartAccesosPie","#no_dataAccesosPie");else{_("#no_dataAccesosPie","#chartAccesosPie");const t=N("chartAccesosPie"),r=e.resultset,n=[],o=0,a=1,i=2;for(let t=0;t<r.length;t+=1)n.push({value:r[t][a],name:r[t][o]});X("chartAccesosPie",j(`ACCESSOS A LA CIUTAT: DISTRIBUCIÓ ANY ${r[0][i]}`,n,t+3))}}function Ht(t,e){if(0===e.resultset.length)D("#chartAccesosHorStackedBar","#no_dataAccesosHorStackedBar");else{_("#no_dataAccesosHorStackedBar","#chartAccesosHorStackedBar");const t=e.resultset,r={title:{text:"ACCESSOS A LA CIUTAT: HISTÒRIC ANUAL"},color:["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],xAxis:{name:"\n\n\n\nVehicles"}};(0,Bt.initStackedBarChart)("chartAccesosHorStackedBar",t,r)}}function qt(t,e){R("chartAccesosStackedBar","no_dataAccesosStackedBar",e.resultset,"Vehicles","ACCESSOS A LA CIUTAT: HISTÒRIC MENSUAL")}let Kt;function Xt(t,e,r,n,o,a,i,s=!1){const l=ee(r,e.id,e.addres,e.location),c=L.map(t).setView(y,i?i.initialZoom:13),u=L.tileLayer("https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',subdomains:"abcd",maxZoom:20});c.setMinZoom(i?i.minZoom:5),c.setMaxZoom(i?i.maxZoom:20),u.addTo(c),ne(c,l,r,e,s,n,o,a)}function Qt(t="myMap",e=5,r=20,n=13,o,a,i,s){const l=L.map(t).setView([39.46975,-.37739],n),c=L.tileLayer("https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',subdomains:"abcd",maxZoom:20});l.setMinZoom(e),l.setMaxZoom(r),c.addTo(l),re(l,o,a,i,te(),s)}function te(){return{listOfselectedElements:[],elementExist(t){return this.listOfselectedElements.filter((e=>e===t)).length>0},deleteElementOfList(t){const e=this.listOfselectedElements.indexOf(t);e>-1&&this.listOfselectedElements.splice(e,1)}}}function ee(t,e=0,n=1,o=2){const{Buffer:a}=r(764),i=r(11),s={type:"FeatureCollection",features:[]},l=[],c=new Set;return t.forEach((t=>{const e=t[o];c.has(e)||(c.add(e),l.push(t))})),l.forEach((t=>{const r=i.Geometry.parse(a.from(t[o],"hex")),l={type:"Feature",properties:{objectoId:t[e],address:t[n]},geometry:r.toGeoJSON()};s.features.push(l)})),s}function re(t,e,r,n,o,a){function i(t){return{iconUrl:ut(t),iconSize:[34,34],shadowSize:[50,64],iconAnchor:[17,17],shadowAnchor:[4,62],popupAnchor:[-3,-76]}}const s=L.icon(i(r)),l=L.icon(i(n));L.geoJSON(e,{onEachFeature:function(i,s){i.properties&&i.properties.address&&s.on("click",(()=>{o.elementExist(i.properties.objectoId)?o.deleteElementOfList(i.properties.objectoId):o.listOfselectedElements.push(i.properties.objectoId),a&&Dashboards.fireChange(a,o.listOfselectedElements),re(t,e,r,n,o,a)}))},pointToLayer(t,e){let r=s;return o.elementExist(t.properties.objectoId)&&(r=l),L.marker(e,{icon:r})}}).addTo(t)}function ne(t,e,r,n,o,a,i,s){L.geoJSON(e,{onEachFeature(t,e){t.properties.address===i&&(Kt=e),function(t,e,r,n,o){const a=r.properties.address,i=r.properties.objectoId;r.properties&&a&&n.on("click",(()=>{const r=t.filter((t=>t[e.id]===i));o(r,a)}))}(r,n,t,e,s),function(t,e,r,n){const o=t.properties.address;r&&(e.on("mouseover",(()=>{e.bindPopup(o).openPopup()})),e.on("mouseout",(()=>{e.closePopup()}))),e.on("click",(()=>{Kt?(Kt.setStyle(n.unselected),e.setStyle(n.selected)):e.setStyle(n.selected),Kt=e}))}(t,e,o,a)},style:t=>t.properties.address===i?a.selected:a.unselected}).addTo(t)}function oe(t,e){document.querySelector("#tabPuntsMesuraCiutat").addEventListener("click",(()=>{requestAnimationFrame((()=>{Qt("idMapPuntsMesuraCiutat",5,20,14,ee(e.resultset,0,1,3),"build/images/mapas/marker-icon-vehiculos.svg/content","build/images/mapas/marker-icon-selected-vehiculos.svg/content","puntoMedidaLaneId")}))}))}function ae(t,e){vt(e,!0,-6,"TRÀNSIT DE VEHICLES: PUNTS DE MESURA DE LA CIUTAT","Vehicles","chartPuntsMesuraCiutat","no_dataPuntsMesuraCiutat")}function ie(t,e){vt(e,!0,15,"TRÀNSIT CICLISTA: ACCESSOS ANELL CICLISTA","Bicicletes","chartAccessosAnellCiclista","no_dataAccessosAnellCiclista")}function se(t,e){vt(e,!0,1,"TRÀNSIT CICLISTA: ANELL CICLISTA","Bicicletes","chartAnellCiclista","no_dataAnellCiclista")}function le(t,e){R("chartAnellBar","no_dataAnellBar",e.resultset,"Bicicletes","ANELL CICLISTA: HISTÒRIC ANUAL","")}function ce(t,e){R("chartAccessosAnellBar","no_dataAccessosAnellBar",e.resultset,"Bicicletes","ACCESSOS ANELL CICLISTA: HISTÒRIC ANUAL","")}function ue(t,e){x("chartAnellMesActual","chartAnellMesAnterior","no_dataAnellMesActual","no_dataAnellMesAnterior",e.resultset,"ANELL CICLISTA: EVOLUCIÓ ","ANELL CICLISTA: EVOLUCIÓ ")}function he(t,e){document.querySelector("#tabAccessosAnellCiclista").addEventListener("click",(()=>{requestAnimationFrame((()=>{x("chartAccessosAnellMesActual","chartAccessosAnellMesAnterior","no_dataAccessosAnellMesActual","no_dataAccessosAnellMesAnterior",e.resultset,"ACCESSOS ANELL CICLISTA: EVOLUCIÓ ","ACCESSOS ANELL CICLISTA: EVOLUCIÓ ")}))}))}function fe(t,e){B("chartAnellGaugeYear","no_dataAnellGaugeYear",e.resultset,"ANELL CICLISTA: EVOLUCIÓ ANY")}function de(t,e){document.querySelector("#tabAccessosAnellCiclista").addEventListener("click",(()=>{requestAnimationFrame((()=>{B("chartAccessosAnellGaugeYear","no_dataAcessosAnellGaugeYear",e.resultset,"ACCESSOS ANELL CICLISTA: EVOLUCIÓ ANY")}))}))}function pe(t,e){vt(e,!0,1,"ANELL CICLISTA: HISTÒRIC MENSUAL","Bicicletes","chartAnellLineMonth","no_dataAnellLineMonth",void 0,!0)}function ge(t,e){vt(e,!0,1,"ACCESSOS ANELL CICLISTA: HISTÒRIC MENSUAL","Bicicletes","chartAccessosAnellLineMonth","no_dataAccessosAnellLineMonth",void 0,!0)}function me(t,e){document.querySelector("#tabPuntsMesuraCiclista").addEventListener("click",(()=>{requestAnimationFrame((()=>{Qt("idMapPuntsMesuraCiclista",5,20,14,ee(e.resultset,0,1,3),"build/images/mapas/marker-icon-bicis.svg/content","build/images/mapas/marker-icon-selected-bicis.svg/content","puntoMedidaLaneId")}))}))}function ye(t,e){vt(e,!0,-6,"TRÀNSIT CICLISTA: PUNTS DE MESURA CICLISTA","Bicicletes","chartPuntsMesuraCiclista","no_dataPuntsMesuraCiclista")}function Se(t,e,r){return{dataset:{source:e.map(((t,e)=>[t,r[e]]))},title:{text:t,left:"center",top:"top",padding:20,textStyle:{fontSize:16,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"20%",bottom:"5%",left:"8%",right:"8%"},xAxis:{name:"vehicles",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},formatter:t=>{const e=t.value[0];return t.value=e,G(t,!1)}},series:[{type:"bar",showBackground:!0,label:{show:!0,position:[15,"35%"],formatter:"{b}",fontSize:14,align:"left",color:"#000",textStyle:{fontFamily:"Montserrat",fontWeight:"400"}},itemStyle:{color:t=>["#B7C258","#A3BF62","#8EBC6D","#7AB877","#65B581"][t.dataIndex]},encode:{x:"intensidad",y:"tramo"}}]}}function Ae(t,e){const r=e.resultset.reverse();X("chartIntensidadAnualCiclista",Se("Major intensitat anual",r.map((t=>t[1])),r.map((t=>t[0]))))}function be(t,e){const r=e.resultset.reverse();X("chartIntensidadMensualCiclista",Se("Major intensitat mensual",r.map((t=>t[1])),r.map((t=>t[0]))))}function Ee(t,e){X("chartIntensidadDiarialCiclista",V(e.resultset.map((([t,e])=>({name:t,value:e}))),"Major intensitat diària",void 0,["#4EA8DE","#FFBF69","#83C5BE","#E56B6F","#CDB4DB"]))}function Ie(t,e){X("chartIntensidadRealTimeCiclista",V(e.resultset.map((([t,e])=>({name:t,value:e}))),"Major intensitat darrera hora"))}const we={es_ES:new Map([["graficaUmbral","Vehiculos / hora"]]),ca_ES:new Map([["graficaUmbral","Vehicles / hora"]])},ve={weight:5,color:"#ADB4B7",opacity:1,fillColor:"#ADB4B7"},Me={weight:5,color:"#9D8BB8",opacity:1,fillColor:"#9D8BB8"},Te=e=>{X("graficaRT",z(e,.2,.3,we[t].get("graficaUmbral")))};function Ce(t,e){const r=document.querySelector("#textoNombreTramo"),n=document.querySelector("#textoHoraActualizacion"),o=document.querySelector("#textoFechaActualizacion"),a=document.querySelector("#dataDia"),i=document.querySelector("#dataMes"),s=document.querySelector("#dataAnyo"),l=t.filter((t=>t[1].includes("daily"))).map((t=>b(Math.round(t[3])))),c=t.filter((t=>t[1].includes("monthly"))).map((t=>b(Math.round(t[3])))),u=t.filter((t=>t[1].includes("annual"))).map((t=>b(Math.round(t[3])))),h=t.filter((t=>t[1].includes("rt"))).map((t=>({intensidad:b(Math.round(t[3])),fecha:t[5]})));r.textContent=e,a.textContent=l,i.textContent=c,s.textContent=u,Te(h[0].intensidad),n.textContent=Et(new Date(h[0].fecha)),o.textContent=At(new Date(h[0].fecha))}function De(t,e){const r=function(t){const e=t.map((t=>t[3])),r=Math.max(...e);return t.filter((t=>t[3]===r)).flat()[2]}(e.resultset);document.querySelector("#tabIntensidadCiclista").addEventListener("click",(()=>{const t=[];e.resultset.forEach((e=>{const r=function(t,e){const r=t.match(/_f\d{1,2}/);return r?e+r[0]:""}(e[1],e[2]);e.push(r),t.push(e)})),Ce(e.resultset.filter((t=>t[2]===r)),r);const n={id:6,addres:2,location:4},o={minZoom:5,maxZoom:20,initialZoom:14},a={unselected:ve,selected:Me};requestAnimationFrame((()=>{Xt("mapBicis",n,e.resultset,a,r,Ce,o,!0)}))}))}function Le(t,e){0===e.resultset.length?D("#chartUsuarisTotalsBarMonth","#no_dataUsuarisTotalsBarMonth"):(_("#no_dataUsuarisTotalsBarMonth","#chartUsuarisTotalsBarMonth"),X("chartUsuarisTotalsBarMonth",F(e.resultset,"Viatges",void 0,"ÚS D'EMT. USUARIS TOTALS: EVOLUCIÓ MENSUAL","Nombre viatges EMT")))}let _e,Ue,Oe,Ne,ke={start:void 0,end:void 0},Pe={start:void 0,end:void 0};function Re(t=null){let e=$("#formFilterDates").find("input");e=$("#formFilterDates").find("input"),$(e).each(((t,r)=>{r.checked&&(e[t].checked=!1)}));const r=$("#formFilterEMT1").find("input");if($(r).each(((t,e)=>{e.checked&&(r[t].checked=!1)})),t){const t=$("#formFilterEMT2").find("input");$(t).each(((e,r)=>{r.checked&&(t[e].checked=!1)}))}const n=$("#formFilterVar").find("input");$(n).each(((t,e)=>{e.checked&&(n[t].checked=!1)})),function(t){let e=0;const r=$("#formFilterDates").find("input");$(r).each((t=>{e+=1,r[t].checked=!0})),e=0;const n=$("#formFilterEMT1").find("input");$(n).each((t=>{e+=1,e<=6&&(n[t].checked=!0)}));const o=$("#formFilterEMT2").find("input");$(o).each((r=>{t&&t.includes(o[r].id)&&(e+=1,e<=6&&(o[r].checked=!0))})),e=0;const a=$("#formFilterVar").find("input");$(a).each((t=>{e+=1,e<=2&&(a[t].checked=!0)})),Dashboards.getParameterValue("filterDatesParam").length>0&&(Dashboards.fireChange("filterDatesParam"),render_echartAccessosCiutat.listeners=["filterDatesParam"],Dashboards.fireChange("filterDatesParam"),render_echartAccessosCiutat.listeners=[""]),Dashboards.getParameterValue("filterEMT2Param").length>0&&Dashboards.fireChange("filterEMT2Param"),Dashboards.getParameterValue("filterVarParam").length>0&&Dashboards.fireChange("filterVarParam")}(t)}function xe(){_e&&([ke]=_e.getOption().dataZoom);const t=$("#formFilterEMT1").find("input"),e=[];$(t).each(((t,r)=>{r.checked&&e.push(r.id)})),Dashboards.fireChange("filterEMT1Param",e),Dashboards.fireChange("updateFilterEMT1","True")}function $e(){const t=$("#formFilterDates").find("input"),e=[];$(t).each(((t,r)=>{r.checked&&e.push(r.id)})),Dashboards.fireChange("filterDatesParam",e),Dashboards.fireChange("updateFilter","True")}function Be(){Oe&&([Pe]=Oe.getOption().dataZoom);const t=$("#formFilterEMT2").find("input"),e=[];$(t).each(((t,r)=>{r.checked&&e.push(r.id)})),Dashboards.fireChange("filterEMT2Param",e),Dashboards.fireChange("updateFilterEMT2","True")}function Fe(t,e="number",r=null){let n;return"number"===e?n=new Map([...t].filter((([t])=>!Number.isNaN(Number(t))))):"includes"===e&&(n=new Map([...t].filter((([t])=>t.includes(r))))),n}function Ge(t){const e=Array.from(t.keys()).sort(((t,e)=>t-e)),r=new Map;return e.forEach((e=>{r.set(e,t.get(e))})),r}function ze(t,e,r=!1){const n=[],o=new Set,a=r?new Map:new Set;for(let i=0;i<e.length;i+=1)(0===t.length||t.includes(e[i][0]))&&(r?a.set(e[i][0],e[i][0]):a.add(e[i][0]),n.push({day:e[i][1],type:e[i][0],value:e[i][2]}),o.add(e[i][1]));return[a,n,Array.from(o.values())]}function Ve(t,e,r){const n=g.slice();return t.map(((t,o)=>{const a=e.filter((e=>e.type===t)),i=r.map((t=>{const e=a.findIndex((e=>e.day===t));return-1!==e?a[e].value:null}));return{name:t,type:"line",symbol:"circle",color:n.shift(),symbolSize:6,smooth:!1,data:i}}))}function je(t){const e={};t.forEach((t=>{const r=t.type,n=t.value;e[r]=(e[r]||0)+n}));const r=Object.keys(e).map((t=>({tipo:t,valor:e[t]})));return r.sort(((t,e)=>e.valor-t.valor)),r.map((t=>t.tipo))}function Ye(t,e,r,n,o){const a=Dashboards.getParameterValue("filterEMT1Param");if(0===r.length)D(`#${t}`,`#${e}`);else{_(`#${e}`,`#${t}`);const[i,s,l]=ze(a,r);if(!o){const t=je(s);!function(t,e){const r=$("#formFilterEMT1");""===Dashboards.getParameterValue("updateFilterEMT1")&&(e.forEach((t=>{r.append(`<input type="checkbox" id="${t}" class="titol-${t}" onclick="legacy.filterEMT1Update();" /> ${t} </br>`)})),Re(),$e(),xe())}(t.length,t),a&&a.sort(((t,e)=>t.localeCompare(e)))}if(a){const r=P(Ve(a,s,l),a,l,"Viatges",o?E(l.length):It(l.length),!0,-10,void 0,n,ke.start,ke.end);let i;o?(Ue=X(t,r),i=Ue):(_e=X(t,r),i=_e),0===$("#formFilterEMT1 :checked").length&&D(`#${t}`,`#${e}`),$(window).on("resize",(()=>{null!=i&&void 0!==i&&i.resize()}))}}}function We(t,e,r,n,o){const a=Dashboards.getParameterValue("filterEMT2Param");if(0===r.length)D(`#${t}`,`#${e}`);else{_(`#${e}`,`#${t}`);const[i,s,l]=ze(a,r,!0);if(!o){const t=Array.from(Ge(Fe(i,"number")).values());let e=[];(function(t){const e=[];return t.forEach(((t,r)=>{Array.from(r).forEach((t=>{!e.includes(t)&&Number.isNaN(Number(t))&&e.push(t)}))})),e})(i).forEach((t=>{e=e.concat(Array.from(Ge(function(t){const e=/\d+/g,r=new Map;return t.forEach((n=>{r.set(n.match(e),t.get(n))})),r}(Fe(i,"includes",t))).values()))}));let r=t.concat(e);r=[...new Set(r)];const n=je(s).slice(0,6);!function(t,e,r){const n=$("#formFilterEMT2");""===Dashboards.getParameterValue("updateFilterEMT2")&&(e.forEach((t=>{n.append(`<input type="checkbox" id="${t}" class="linea-${t}" onclick="legacy.filterEMT2Update();" />`)})),Re(r),$e(),Be())}(r.length,r,n)}if(a){const r=P(Ve(a,s,l),a,l,"Viatges",It(l.length),!0,-10,void 0,n,Pe.start,Pe.end);let i;o?(Ne=X(t,r),i=Ne):(Oe=X(t,r),i=Oe),0===$("#formFilterEMT1 :checked").length&&D(`#${t}`,`#${e}`),$(window).on("resize",(()=>{null!=i&&void 0!==i&&i.resize()}))}}}function Ze(){document.querySelector("#idFiltrar").style.visibility="visible"}function Je(){document.querySelector("#idFiltrar").style.visibility="hidden"}function He(t,e){return t.filter((t=>e.includes(t[0])))}function qe(){const t=["filterDatesParam","updateFilter","filterEMT1Param","updateFilterEMT1"],e=["filterDatesParam","updateFilter","filterEMT2Param","updateFilterEMT2"];render_echartUsuarisPerLinea.listeners=e,render_echartUsuarisPerLiniaLineMonth.listeners=e,render_echartUsuarisPerLiniaGaugeYear.listeners=e,render_echartUsuarisPerLiniaGaugeMonth.listeners=e,render_echartUsuarisPerLiniaBarYear.listeners=e,render_echartUsuarisPerTitol.listeners=t,render_echartUsuarisPerTitolLineMonth.listeners=t,render_echartUsuarisPerTitolGaugeYear.listeners=t,render_echartUsuarisPerTitolGaugeMonth.listeners=t,render_echartUsuarisPerTitolBarYear.listeners=t,render_echartUsuarisTotals.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter"),Dashboards.fireChange("filterEMT1Param"),Dashboards.fireChange("updateFilterEMT1"),Dashboards.fireChange("filterEMT2Param"),Dashboards.fireChange("updateFilterEMT2")}const Ke={es_ES:new Map([["chartUsuarisTotalsGaugeYear","USO DE EMT. USUARIOS TOTALES: ÚLTIMOS AÑOS"]]),ca_ES:new Map([["chartUsuarisTotalsGaugeYear","US D'EMT. USUARIS TOTALS: ÚLTIMS ANYS"]])},Xe={es_ES:new Map([["chartUsuarisTotalsGaugeMonth","USO DE EMT. USUARIOS TOTALES: MES ACTUAL"],["chartUsuarisTotalsGaugeLastMonth","USO DE EMT. USUARIOS TOTALES: MES ANTERIOR"]]),ca_ES:new Map([["chartUsuarisTotalsGaugeMonth","ÚS D'EMT. USUARIS TOTALS: MES ACTUAL"],["chartUsuarisTotalsGaugeLastMonth","ÚS D'EMT. USUARIS TOTALS: MES ANTERIOR"]])};function Qe(t,e){Gt({idChart:"chartUsuarisTotalsGaugeYear",idNoData:"no_dataUsuarisTotalsGaugeYear",chartName:`${Ke[zt].get("chartUsuarisTotalsGaugeYear")}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-100,paramCalculatedOffset:50,paramNumberOfElementsByLine:5},e)}function tr(t,e){const r=Dashboards.getParameterValue("filterEMT1Param");if(r.length>0){const n=He(e.resultset,r);function o(){B("chartUsuarisTitolGaugeYear","no_dataUsuarisTitolGaugeYear",n,"ÚS D'EMT. USUARIS PER TÍTOL: ANY")}r.sort(((t,e)=>t.localeCompare(e))),0===document.querySelector("#chartUsuarisTitolGaugeYear").childElementCount?document.querySelector("#tabUsuarisPerTitol").addEventListener("click",(()=>{requestAnimationFrame((()=>{o()}))})):o()}}function er(t,e){const r=Dashboards.getParameterValue("filterEMT2Param"),n=He(e.resultset,r);function o(){B("chartUsuarisLiniaGaugeYear","no_dataUsuarisLiniaGaugeYear",n,"ÚS D'EMT. USUARIS PER LÍNIA: ANY")}n.sort(((t,e)=>Number(t[0])-Number(e[0]))),0===document.querySelector("#chartUsuarisLiniaGaugeYear").childElementCount?document.querySelector("#tabUsuarisPerLinia").addEventListener("click",(()=>{requestAnimationFrame((()=>{o()}))})):o()}function rr(t,e){const r=Dashboards.getParameterValue("filterEMT1Param"),n=He(e.resultset,r);function o(){x("chartUsuarisTitolMesActual","chartUsuarisTitolMesAnterior","no_dataUsuarisTitolMesActual","no_dataUsuarisTitolMesAnterior",n,"ÚS D'EMT. USUARIS PER TÍTOL: EVOLUCIÓ ","ÚS D'EMT. USUARIS PER TÍTOL: EVOLUCIÓ ")}0===document.querySelector("#chartUsuarisTitolMesActual").childElementCount||0===document.querySelector("#chartUsuarisTitolMesAnterior").childElementCount?document.querySelector("#tabUsuarisPerTitol").addEventListener("click",(()=>{requestAnimationFrame((()=>{o()}))})):o()}function nr(t,e){const r=Dashboards.getParameterValue("filterEMT2Param"),n=He(e.resultset,r);function o(){x("chartUsuarisLiniaMesActual","chartUsuarisLiniaMesAnterior","no_dataUsuarisLiniaMesActual","no_dataUsuarisLiniaMesAnterior",n,"ÚS D'EMT. USUARIS PER LÍNIA: EVOLUCIÓ ","ÚS D'EMT. USUARIS PER LÍNIA: EVOLUCIÓ ")}n.sort(((t,e)=>Number(t[0])-Number(e[0]))),0===document.querySelector("#chartUsuarisLiniaMesActual").childElementCount||0===document.querySelector("#chartUsuarisLiniaMesAnterior").childElementCount?document.querySelector("#tabUsuarisPerLinia").addEventListener("click",(()=>{requestAnimationFrame((()=>{o()}))})):o()}const or={title:{text:"",left:"center",top:"top",padding:10,textStyle:{fontSize:12,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:void 0,itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:5,splitNumber:10,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=>(0,Bt.addPointInteger)(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[0,"0%"],fontSize:17,fontWeight:"bolder",formatter:void 0,fontFamily:"Montserrat",color:"inherit"},data:void 0},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:27,top:40}};function ar(t,e){const r=e.resultset;if(0===e.length)(0,Bt.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,Bt.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e={type:0,time:1,data:2},[n,o,a]=(0,Bt.configureDataGaugeMonthCommon)(t.idChart,r,e,0),i={...or};i.title.text=t.chartName,i.series.max=n,i.series.detail.formatter=o,i.series.data=a,(0,Bt.initChart)(t.idChart,i)}}function ir(t,e){const r={idChart:"chartUsuarisTotalsGaugeMonth",idNoData:"no_dataUsuarisTotalsGaugeMonth",chartName:`${Xe[zt].get("chartUsuarisTotalsGaugeMonth")}`},n={idChart:"chartUsuarisTotalsGaugeLastMonth",idNoData:"no_dataUsuarisTotalsGaugeLastMonth",chartName:`${Xe[zt].get("chartUsuarisTotalsGaugeLastMonth")}`};ar(r,e),ar(n,e)}function sr(t,e){if(0===e.resultset.length)D("#chartUsuarisTotalsStackedBarYears","#no_dataUsuarisTotalsStackedBarYears");else{_("#no_dataUsuarisTotalsStackedBarYears","#chartUsuarisTotalsStackedBarYears");const t={title:{text:"ÚS D'EMT. USUARIS TOTALS: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nViatges"}};(0,Bt.initStackedBarChartMonthSeries)("chartUsuarisTotalsStackedBarYears",e.resultset,t)}}function lr(t,e){vt(e,!0,1,"ÚS D'EMT: USUARIS TOTALS","Viatges","chartUsuarisTotals","no_dataUsuarisTotals",void 0,void 0,void 0,void 0,!1)}function cr(){Je(),$("#idFieldsFilterEmtUsLinea").hide(),$("#idFieldsFilterEmtUsTitol").hide()}function ur(t,e){Ye("chartUsuarisPerTitol","no_dataUsuarisPerTitol",e.resultset,"ÚS D'EMT: USUARIS PER TÍTOL",!1)}function hr(){Ze(),$("#idAllFilterFields").show(),$("#idFieldsFilterEmtUsLinea").hide(),$("#idFieldsFilterEmtUsTitol").show()}function fr(t,e){We("chartUsuarisPerLinea","no_dataUsuarisPerLinea",e.resultset,"ÚS D'EMT: USUARIS PER LÍNIA",!1)}function dr(){Je(),$("#idAllFilterFields").show(),$("#idFieldsFilterEmtUsLinea").show(),$("#idFieldsFilterEmtUsTitol").hide()}function pr(t,e){Ye("chartUsuarisTitolLineMonth","no_dataUsuarisTitolLineMonth",e.resultset,"ÚS D'EMT. USUARIS PER TÍTOL: HISTÒRIC MENSUAL",!0)}function gr(t,e){We("chartUsuarisLiniaLineMonth","no_dataUsuarisLiniaLineMonth",e.resultset,"ÚS D'EMT. USUARIS PER LÍNIA: HISTÒRIC MENSUAL",!0)}function mr(t,e){const r=Dashboards.getParameterValue("filterEMT1Param");R("chartUsuarisTitolBar","no_dataUsuarisTitolBar",He(e.resultset,r),"Viatges","ÚS D'EMT. USUARIS PER TÍTOL: HISTÒRIC ANUAL","")}function yr(t,e){const r=Dashboards.getParameterValue("filterEMT2Param");R("chartUsuarisLiniaBar","no_dataUsuarisLiniaBar",He(e.resultset,r),"Viatges","ÚS D'EMT. USUARIS PER LÍNIA: HISTÒRIC ANUAL","")}const Sr="CONTAMINACIÓ ";function Ar(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartPM10").hide(),$("#no_dataPM10").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataPM10").show();else{$("#no_dataPM10").hide(),$("#chartPM10").css("background","#ffffff"),$("#chartPM10").show();const t=`${Sr}PM10`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=10;X("chartPM10",P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t))}}function br(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length)$("#chartNO2").hide(),$("#no_dataNO2").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataNO2").show();else{$("#no_dataNO2").hide(),$("#chartNO2").css("background","#ffffff"),$("#chartNO2").show();const t=`${Sr}NO2`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));else{for(n=0;n<a;n++)i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]);ft(u.length,u)}const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=18,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t),A=720,b=window.innerHeight>A?void 0:"5%",E=P(p,d,Array.from(c.values()),l[0].measureunit,m,!1,y,void 0,t,void 0,void 0,void 0,b);X("chartNO2",S),X("chartContaminacioNO2",E)}}function Er(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartNO").hide(),$("#no_dataNO").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataNO").show();else{$("#no_dataNO").hide(),$("#chartNO").css("background","#ffffff"),$("#chartNO").show();const t=`${Sr}NO`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=18,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartNO")).setOption(S,!0),X("chartNO",S)}}function Ir(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartNOX").hide(),$("#no_dataNOX").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataNOX").show();else{$("#no_dataNOX").hide(),$("#chartNOX").css("background","#ffffff"),$("#chartNOX").show();const t=`${Sr}NOX`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=10,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartNOX")).setOption(S,!0),X("chartNOX",S)}}function wr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartSO2").hide(),$("#no_dataSO2").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataSO2").show();else{$("#no_dataSO2").hide(),$("#chartSO2").css("background","#ffffff"),$("#chartSO2").show();const t=`${Sr}SO2`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=20,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartSO2")).setOption(S,!0),X("chartSO2",S)}}function vr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartO3").hide(),$("#no_dataO3").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataO3").show();else{$("#no_dataO3").hide(),$("#chartO3").css("background","#ffffff"),$("#chartO3").show();const t=`${Sr}O3`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=20,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartO3")).setOption(S,!0),X("chartO3",S)}}function Mr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartPM1").hide(),$("#no_dataPM1").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataPM1").show();else{$("#no_dataPM1").hide(),$("#chartPM1").css("background","#ffffff"),$("#chartPM1").show();const t=`${Sr}PM1`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=20,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartPM1")).setOption(S,!0),X("chartPM1",S)}}function Tr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartPM25").hide(),$("#no_dataPM25").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataPM25").show();else{$("#no_dataPM25").hide(),$("#chartPM25").css("background","#ffffff"),$("#chartPM25").show();const t=`${Sr}PM25`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=20,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartPM25")).setOption(S,!0),X("chartPM25",S)}}function Cr(){render_echartPM10.listeners=["filterDatesParam","updateFilter"],render_echartPM1.listeners=["filterDatesParam","updateFilter"],render_echartPM25.listeners=["filterDatesParam","updateFilter"],render_echartO3.listeners=["filterDatesParam","updateFilter"],render_echartSO2.listeners=["filterDatesParam","updateFilter"],render_echartNO2.listeners=["filterDatesParam","updateFilter"],render_echartNO.listeners=["filterDatesParam","updateFilter"],render_echartNOX.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter")}const Dr=-20;function Lr(t,e,r,n){const o=U(t,n),a=Object.keys(o),i=new Set(t.map((t=>t[e])));return i.forEach((t=>{a.forEach((n=>{void 0===o[n].find((r=>r[e]===t))&&o[n].push([o[n][0][0],t,n,void 0,o[n][0][r]])}))})),a.forEach((t=>{o[t].sort(((t,r)=>{const n=t[e].split("/").reverse().join(""),o=r[e].split("/").reverse().join("");return n.localeCompare(o)}))})),[o,i]}function _r(t,e,r,n,o,a,i,s,l,c=""){const u=P(t,e,r,n,o,a,l,void 0,c);return u.yAxis.nameTextStyle.align="left",delete u.yAxis.axisLabel.margin,u.yAxis.max=i,u.yAxis.min=s,delete u.toolbox.show,u}function Ur(){render_echartMestalla.listeners=["filterDatesParam","updateFilter"],render_echartMalilla.listeners=["filterDatesParam","updateFilter"],render_echartPerellonet.listeners=["filterDatesParam","updateFilter"],render_echartExposicio.listeners=["filterDatesParam","updateFilter"],render_echartSotenis.listeners=["filterDatesParam","updateFilter"],render_echartBeninamet.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter")}const Or=-20;function Nr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartBenimamet").hide(),$("#chartBenimametStacked").hide(),$("#no_dataBeninamet").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataBeninamet").show();else{$("#no_dataBeninamet").hide(),$("#chartBenimamet").css("background","#ffffff"),$("#chartBenimametStacked").css("background","#ffffff"),$("#chartBenimamet").show(),$("#chartBenimametStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE BENIMÀMET",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Benimamet"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null)}const w=It(a.size),v=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];X("chartBenimamet",_r([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],v,Array.from(a.values()),d[0].measureunit,w,!0,null,0,Or,t)),X("chartBenimametStacked",_r([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}],v,Array.from(a.values()),"%",w,!0,100,0,Or,t))}}function kr(t,e){let r=e.resultset.filter((t=>"València Ciutat"!==t[1]));r=r.map((t=>t.slice(1))),vt(r,!0,1,"INJECCIÓ D'AIGUA PER BARRIS","m3","chartConsumAguaBarris","no_dataConsumAguaBarris")}function Pr(t,e){let r=e.resultset.filter((t=>"kpi-valencia-ciudad-total"===t[0]));r=r.map((t=>t.slice(1))),vt(r,!0,1,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ DIÀRIA","m3","chartConsumTotalAgua","no_dataConsumTotalAgua",void 0,void 0,void 0,void 0,!1)}const Rr=-20;function xr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartExposicio").hide(),$("#chartExposicioStacked").hide(),$("#no_dataExposicio").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExposicio").show();else{$("#no_dataExposicio").hide(),$("#chartExposicio").css("background","#ffffff"),$("#chartExposicioStacked").css("background","#ffffff"),$("#chartExposicio").show(),$("#chartExposicioStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE EXPOSICIÓ",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Exposicio"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=0,m=0,y=0,S=0)}const w=It(a.size),v=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];X("chartExposicio",_r([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],v,Array.from(a.values()),d[0].measureunit,w,!0,null,0,Rr,t)),X("chartExposicioStacked",_r([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}],v,Array.from(a.values()),"%",w,!0,100,0,Rr,t))}}const $r=-20;function Br(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartMalilla").hide(),$("#chartMalillaStacked").hide(),$("#no_dataMalilla").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataMalilla").show();else{$("#no_dataMalilla").hide(),$("#chartMalilla").css("background","#ffffff"),$("#chartMalillaStacked").css("background","#ffffff"),$("#chartMalilla").show(),$("#chartMalillaStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE MALILLA",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Malilla"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=0,m=0,y=0,S=0):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null)}const w=It(a.size),v=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];X("chartMalilla",_r([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],v,Array.from(a.values()),d[0].measureunit,w,!0,null,0,$r,t)),X("chartMalillaStacked",_r([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}],v,Array.from(a.values()),"%",w,!0,100,0,$r,t))}}const Fr=-20;function Gr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length)$("#chartMestalla").hide(),$("#chartMestallaStacked").hide(),$("#no_dataMestalla").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataMestalla").show();else{$("#no_dataMestalla").hide(),$("#chartMestalla").css("background","#ffffff"),$("#chartMestallaStacked").css("background","#ffffff"),$("#chartMestalla").show(),$("#chartMestallaStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE MESTALLA",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Mestalla"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));else{for(let t=0;t<o;t+=1)"Mestalla"===n[t][6]&&("Industrial"===n[t][7]&&(a.add(n[t][3]),i.push(n[t][4]),s.push(n[t][8]),h+=n[t][8]),"Domèstic"===n[t][7]&&(a.add(n[t][3]),i.push(n[t][4]),l.push(n[t][8]),h+=n[t][8]),"Serv.Municipal"===n[t][7]&&(a.add(n[t][3]),i.push(n[t][4]),c.push(n[t][8]),h+=n[t][8]),"Aigua no registrada per comptadors"===n[t][7]&&(a.add(n[t][3]),i.push(n[t][4]),u.push(n[t][8]),h+=n[t][8]),a.add(n[t][3]),i.push(n[t][4]));ft(i.length,i)}let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=0,m=0,y=0,S=0)}const w=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"],v=[{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],M=It(a.size);X("chartMestalla",_r(v,w,Array.from(a.values()),d[0].measureunit,M,!0,null,0,Fr,t)),X("chartMestallaStacked",_r([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}],w,Array.from(a.values()),"%",M,!0,100,0,Fr,t))}}const zr=-20;function Vr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartPerellonet").hide(),$("#chartPerellonetStacked").hide(),$("#no_dataPerellonet").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataPerellonet").show();else{$("#no_dataPerellonet").hide(),$("#chartPerellonet").css("background","#ffffff"),$("#chartPerellonetStacked").css("background","#ffffff"),$("#chartPerellonet").show(),$("#chartPerellonetStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE PERELLONET",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Perellonet"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=0,m=0,y=0,S=0)}const w=It(a.size),v=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"],M=[{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}];X("chartPerellonet",_r([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],v,Array.from(a.values()),d[0].measureunit,w,!0,null,0,zr,t)),X("chartPerellonetStacked",_r(M,v,Array.from(a.values()),"%",w,!0,100,0,zr,t))}}const jr=-20;function Yr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartSotenis").hide(),$("#chartSotenisStacked").hide(),$("#no_dataSotenis").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataSotenis").show();else{$("#no_dataSotenis").hide(),$("#chartSotenis").css("background","#ffffff"),$("#chartSotenisStacked").css("background","#ffffff"),$("#chartSotenis").show(),$("#chartSotenisStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE SOTERNES",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Soternes"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null)}const w=It(a.size),v=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];X("chartSotenis",_r([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],v,Array.from(a.values()),d[0].measureunit,w,!0,null,0,jr,t)),X("chartSotenisStacked",_r([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}],v,Array.from(a.values()),"%",w,!0,100,0,jr,t))}}function Wr(t,e){0===e.resultset.length?D("#chartAiguaTotalBarMonth","#no_dataAiguaTotalBarMonth"):(_("#no_dataAiguaTotalBarMonth","#chartAiguaTotalBarMonth"),X("chartAiguaTotalBarMonth",F(e.resultset,"m3",void 0,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ MENSUAL","València Ciutat")))}function Zr(t,e){if(0===e.resultset.length)D("#chartYearAiguaTotalgauge_semicircle","#no_dataYearAiguaTotalgauge_semicircle");else{_("#no_dataYearAiguaTotalgauge_semicircle","#chartYearAiguaTotalgauge_semicircle");const t=N("chartYearAiguaTotalgauge_semicircle");X("chartYearAiguaTotalgauge_semicircle",W(e.resultset,"INJECCIÓ TOTAL D'AIGUA: ÚLTIMS ANYS",t))}}function Jr(t,e){if(0===e.resultset.length)D("#chartAiguaTotalreloj_semicircle","#no_dataAiguaTotalreloj_semicircle"),D("#chartAiguaTotalreloj_semicircle_lastmonth","#no_dataAiguaTotalreloj_semicircle_lastmonth");else{_("#no_dataAiguaTotalreloj_semicircle","#chartAiguaTotalreloj_semicircle"),_("#no_dataAiguaTotalreloj_semicircle_lastmonth","#chartAiguaTotalreloj_semicircle_lastmonth");const t=0,r=1,n=e.resultset,o=N("chartAiguaTotalreloj_semicircle");X("chartAiguaTotalreloj_semicircle",Z(n,t,"INJECCIÓ TOTAL D'AIGUA: MES ACTUAL",o)),X("chartAiguaTotalreloj_semicircle_lastmonth",Z(n,r,"INJECCIÓ TOTAL D'AIGUA: MES ANTERIOR",o))}}function Hr(t,e){if(0===e.resultset.length)D("#chartAiguaTotalstackedBarYears","#no_dataAiguaTotalstackedBarYears");else{_("#no_dataAiguaTotalstackedBarYears","#chartAiguaTotalstackedBarYears");const t={title:{text:"INJECCIÓ TOTAL D'AIGUA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nm3"}};(0,Bt.initStackedBarChartMonthSeries)("chartAiguaTotalstackedBarYears",e.resultset,t)}}function qr(t,e){R("chartBarrisBar","no_dataBarrisBar",e.resultset,"m3","INJECCIÓ D'AIGUA PER BARRIS: HISTÒRIC ANUAL","")}function Kr(t,e){vt(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 Xr={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"]])};function Qr(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",(()=>{requestAnimationFrame((()=>{Gt({idChart:"chartBarrisGaugeYear",idNoData:"no_dataBarrisGaugeYear",chartName:`${Xr[zt].get("chartNameBarrisGaugeYear")} ${e.resultset[0][2]}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-100,paramCalculatedOffset:100,paramNumberOfElementsByLine:3},e)}))}))}function tn(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",(()=>{requestAnimationFrame((()=>{x("chartBarrisMesActual","chartBarrisMesAnterior","no_dataBarrisMesActual","no_dataBarrisMesAnterior",e.resultset,"INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ","INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ")}))}))}function en(t,e){if(0===e.resultset.length)D("#chartKgsResidus","#no_dataKgsResidus");else{_("#no_dataKgsResidus","#chartKgsResidus");const t="KGS. DE RESIDUS EN CONTENIDORS: EVOLUCIÓ DIÀRIA",r="KGS. DE RESIDUS EN MOBLES: EVOLUCIÓ DIÀRIA",n=e.resultset,o=0,a=1,i=2,s=3,l=new Map,c=new Map;let u=[],h=[];n.forEach((t=>{"Contenidor"===t[i]&&"total"===t[a]&&l.set(t[o],t[s]),"Moble"===t[i]&&c.set(t[o],t[s])})),u=Lt(l),h=Lt(c);const f=It(u[0].length),d=It(h[0].length),p=-30,g=[{name:"Contenidor",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u[1]}],m=[{name:"Moble",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:h[1]}];X("chartKgsResidus",P(g,null,u[0],"Kgs",f,!0,p,void 0,t)),X("chartKgsResidusMoble",P(m,null,h[0],"Kgs",d,!0,p,void 0,r))}}function rn(t,e=!0){const r={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?r.Cont.push([t[3],t[4],t[2]]):r.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?r.Mob.push([t[3],t[4],t[2]]):r.Mob.push([t[3],t[2]]))})),r}const nn=["#0077b6","#ffc300","#55828b","#a26769","#b1a7a6","#38b000"],on=nn.slice(0,-2).concat(nn.slice(-1));function an(t,e){vt(e,!0,0,"DESAGREGACIÓ KGS. CONTENIDORS PER TIPUS DE RESIDUS","Kgs","chartDesKgsPerTipusResidu","no_dataDesKgsPerTipusResidu",void 0,void 0,void 0,void 0,void 0,nn)}const sn={es_ES:new Map([["chartResidusContenidorstackedBarYears","KGS. DE RESIDUOS EN CONTENEDORES: DESGLOSE DE LOS ÚLTIMOS AÑOS"],["chartResidusMoblesstackedBarYears","KGS. DE RESIDUOS EN MUEBLES: DESGLOSE DE LOS ÚLTIMOS AÑOS"],["chartDesKgsHorStackedBar","KGS. DE RESIDUOS DE RECICLAJE: HISTORICO ANUAL"]]),ca_ES:new Map([["chartResidusContenidorstackedBarYears","KGS. DE RESIDUS EN CONTENIDORS: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["chartResidusMoblesstackedBarYears","KGS. DE RESIDUS EN MOBLES: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["chartDesKgsHorStackedBar","KGS. DE RESIDUS DE RECICLATGE: HISTÒRIC ANUAL"]])};function ln(t,e){function r(t,r,n){if(0===e.resultset.length)(0,Bt.printNoDataChart)(`#${t}`,`#${r}`);else{const e={title:{text:sn[zt].get(t)},xAxis:{name:"\n\n\n\nKgs"}};(0,Bt.initStackedBarChartMonthSeries)(t,n,e)}}const n=(0,Bt.splitDataset)(e.resultset),o=n.Cont,a=n.Mob;r("chartResidusContenidorstackedBarYears","no_dataResidusContenidorstackedBarYears",o),r("chartResidusMoblesstackedBarYears","no_dataResidusMoblesstackedBarYears",a)}function cn(t,e){const r="chartDesKgsHorStackedBar",n="no_dataDesKgsHorStackedBar";if(0===e.resultset.length)(0,Bt.printNoDataChart)(`#${r}`,`#${n}`);else{(0,Bt.printDataChart)(`#${n}`,`#${r}`);const t={title:{text:sn[zt].get(r)},color:on,xAxis:{name:"\n\n\n\nKgs"}};(0,Bt.initStackedBarChart)(r,e.resultset,t)}}function un(t,e){R("chartDesKgsStackedBar","no_dataDesKgsStackedBar",e.resultset,"Kgs","KGS. DE RESIDUS DE RECICLATGE: HISTÒRIC MENSUAL",void 0,void 0,void 0,void 0,on)}function hn(t,e){if(0===e.resultset.length)D("#chartResidusContenidorreloj_semicircle","#no_dataResidusContenidorreloj_semicircle"),D("#chartResidusContenidorreloj_semicircle_lastmonth","#no_dataResidusContenidorreloj_semicircle_lastmonth"),D("#chartResidusMoblesreloj_semicircle","#no_dataResidusMoblesreloj_semicircle"),D("#chartResidusMoblesreloj_semicircle_lastmonth","#no_dataResidusMoblesreloj_semicircle_lastmonth");else{_("#no_dataResidusContenidorreloj_semicircle","#chartResidusContenidorreloj_semicircle"),_("#no_dataResidusContenidorreloj_semicircle_lastmonth","#chartResidusContenidorreloj_semicircle_lastmonth"),_("#no_dataResidusMoblesreloj_semicircle","#chartResidusMoblesreloj_semicircle"),_("#no_dataResidusMoblesreloj_semicircle_lastmonth","#chartResidusMoblesreloj_semicircle_lastmonth");const t=0,r=1,n=rn(e.resultset),o=n.Cont,a=n.Mob,i=N("chartResidusContenidorreloj_semicircle");X("chartResidusContenidorreloj_semicircle",Z(o,t,"KGS. DE RESIDUS EN CONTENIDORS: MES ACTUAL",i)),X("chartResidusContenidorreloj_semicircle_lastmonth",Z(o,r,"KGS. DE RESIDUS EN CONTENIDORS: MES ANTERIOR",i)),X("chartResidusMoblesreloj_semicircle",Z(a,t,"KGS. DE RESIDUS EN MOBLES: MES ACTUAL",i)),X("chartResidusMoblesreloj_semicircle_lastmonth",Z(a,r,"KGS. DE RESIDUS EN MOBLES: MES ANTERIOR",i))}}function fn(t,e){if(0===e.resultset.length)D("#chartYearResidusContenidorgauge_semicircle","#no_dataYearResidusContenidorgauge_semicircle"),D("#chartYearResidusMoblesgauge_semicircle","#no_dataYearResidusMoblesgauge_semicircle");else{_("#no_dataYearResidusContenidorgauge_semicircle","#chartYearResidusContenidorgauge_semicircle"),_("#no_dataYearResidusMoblesgauge_semicircle","#chartYearResidusMoblesgauge_semicircle");const t=rn(e.resultset,!1),r=t.Cont,n=t.Mob,o=N("chartYearResidusContenidorgauge_semicircle");X("chartYearResidusContenidorgauge_semicircle",W(r,"KGS. DE RESIDUS EN CONTENIDORS: ÚLTIMS ANYS",o)),X("chartYearResidusMoblesgauge_semicircle",W(n,"KGS. DE RESIDUS EN MOBLES: ÚLTIMS ANYS",o))}}function dn(t,e){if(0===e.resultset.length)D("#chartDesKgsGauge","#no_dataDesKgsPie");else{_("#no_dataDesKgsPie","#chartDesKgsGauge");const t=e.resultset;document.querySelector("#idDesKgs").addEventListener("click",(()=>{requestAnimationFrame((()=>{const e=N("chartDesKgsGauge"),r=Mt(t,e);X("chartDesKgsGauge",Y("KGS. DE RESIDUS RSU RESTA: ÚLTIMS ANYS",r[0],r[1],e))}))}))}}function pn(t,e){if(0===e.resultset.length)D("#chartResidusContenidorBarMonth","#no_dataResidusContenidorBarMonth");else{_("#no_dataResidusContenidorBarMonth","#chartResidusContenidorBarMonth");const t=rn(e.resultset),r=t.Cont,n=t.Mob;X("chartResidusContenidorBarMonth",F(r,"Kgs",void 0,"KGS. DE RESIDUS EN CONTENIDORS: EVOLUCIÓ MENSUAL","Contenidor")),X("chartResidusMoblesBarMonth",F(n,"Kgs",void 0,"KGS. DE RESIDUS EN MOBLES: EVOLUCIÓ MENSUAL","Moble"))}}function gn(t,e){0===e.resultset.length?D("#chartDesKgsBar","#no_dataDesKgsBar"):(_("#no_dataDesKgsBar","#chartDesKgsBar"),X("chartDesKgsBar",F(e.resultset,"Kgs",void 0,"KGS. DE RESIDUS RSU RESTA: HISTÒRIC MENSUAL","RSU Resta")))}function mn(t,e){if(0===e.resultset.length)D("#chartDesKgsPie","#no_dataDesKgsPie");else{_("#no_dataDesKgsPie","#chartDesKgsPie");const t=e.resultset,r=[],n=0,o=1,a=2;for(let e=0;e<t.length;e+=1)r.push({value:t[e][o],name:t[e][n]});document.querySelector("#idDesKgs").addEventListener("click",(()=>{requestAnimationFrame((()=>{const e=N("chartDesKgsPie");X("chartDesKgsPie",j(`KGS. DE RESIDUS DE RECICLATGE: DISTRIBUCIÓ ANY ${t[0][a]}`,r,e+5,on))}))}))}}const yn={es_ES:new Map([["TittleAccChart","EVOLUCIÓN DIARIA ACCESOS A LA SEDE ELECTRÓNICA"],["Acces","Accesos"],["TittleInstancesChart","INSTANCIAS SEDE ELECTRÓNICA: EVOLUCIÓN DIARIA"],["InstancesChartText","Instancias electrónicas"],["Instances","Instancias"],["TittleInstancesYearlyChart","INSTANCIAS SEDE ELECTRÓNICA: DESGLOSE DE LOS ULTIMOS AÑOS"],["TittleAccessYearlyChart","ACCESOS A LA SEDE ELECTRÓNICA: DESGLOSE DE LOS ULTIMOS AÑOS"],["TittleInstancesMonthlyChart","INSTANCIAS SEDE ELECTRÓNICA: EVOLUCIÓN MENSUAL"],["TittleAccessMonthlyChart","ACCESOS A SEDE ELECTRÓNICA: EVOLUCIÓN MENSUAL"],["TittleInstancesPrevYearsChart","INSTANCIAS SEDE ELECTRÓNICA: ULTIMOS AÑOS"],["TittleAccessPrevYearsChart","ACCESOS SEDE ELECTRÓNICA: ULTIMOS AÑOS"],["TittleInstancesCurrMonth","INSTANCIAS SEDE ELECTRÓNICA: MES ACTUAL"],["TittleInstancesPrevMonth","INSTANCIAS SEDE ELECTRÓNICA: MES ANTERIOR"],["TittleAccessCurrMonth","ACCESOS SEDE ELECTRÓNICA: MES ACTUAL"],["TittleAccessPrevMonth","ACCESOS SEDE ELECTRÓNICA: MES ANTERIOR"]]),ca_ES:new Map([["TittleAccChart","ACCESSOS A SEU ELECTRÒNICA: EVOLUCIÓ DIÀRIA"],["Acces","Accessos"],["TittleInstancesChart","INSTÀNCIES SEU ELECTRÒNICA: EVOLUCIÓ DIÀRIA"],["InstancesChartText","Instancias electrónicas"],["Instances","Instàncies"],["TittleInstancesYearlyChart","INSTÀNCIES SEU ELECTRÒNICA: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["TittleAccessYearlyChart","ACCESSOS A SEU ELECTRÒNICA: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["TittleInstancesMonthlyChart","INSTÀNCIES SEU ELECTRÒNICA: EVOLUCIÓ MENSUAL"],["TittleAccessMonthlyChart","ACCESSOS A SEU ELECTRÒNICA: EVOLUCIÓ MENSUAL"],["TittleInstancesPrevYearsChart","INSTÀNCIES SEU ELECTRÒNICA: ÚLTIMS ANYS"],["TittleAccessPrevYearsChart","ACCESSOS A SEU ELECTRÒNICA: ÚLTIMS ANYS"],["TittleInstancesCurrMonth","INSTÀNCIES SEU ELECTRÒNICA: MES ACTUAL"],["TittleInstancesPrevMonth","INSTÀNCIES SEU ELECTRÒNICA: MES ANTERIOR"],["TittleAccessCurrMonth","ACCESSOS SEU ELECTRÒNICA: MES ACTUAL"],["TittleAccessPrevMonth","ACCESSOS A SEU ELECTRÒNICA: MES ANTERIOR"]])};function Sn(e,r){if(0===r.resultset.length)D("#chartSeuElectronica","#no_dataSeuElectronica");else{_("#no_dataSeuElectronica","#chartSeuElectronica");const e=r.resultset,n=r.resultset.length,o=new Set,a=[];for(let t=0;t<n;t+=1)o.add(e[t][0]),a.push(e[t][1]);const i=It(o.size);X("chartSeuElectronica",P([{name:yn[t].get("Acces"),type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:a}],null,Array.from(o.values()),yn[t].get("Acces"),i,!0,f,void 0,yn[t].get("TittleAccChart")))}}function An(e,r){if(0===r.resultset.length)D("#chartInstanciesSeuElectronica","#no_dataInstanciesSeuElectronica");else{_("#no_dataInstanciesSeuElectronica","#chartInstanciesSeuElectronica");const e=r.resultset,n=r.resultset.length,o=new Set,a=[],i=[];for(let t=0;t<n;t+=1)o.add(gt(e[t][0])),a.push(gt(e[t][0])),i.push(e[t][1]);const s=It(o.size);X("chartInstanciesSeuElectronica",P([{name:yn[t].get("InstancesChartText"),type:"line",symbol:"circle",symbolSize:6,smooth:!1,itemStyle:{color:"#3f02f7"},data:i}],null,Array.from(o.values()),yn[t].get("Instances"),s,!0,20,void 0,yn[t].get("TittleInstancesChart")))}}function bn(e,r){0===r.resultset.length?D("#chartInstancesSeuElectronica_BarMonth","#no_dataInstancesSeuElectronica_BarMonth"):(_("#no_dataInstancesSeuElectronica_BarMonth","#chartInstancesSeuElectronica_BarMonth"),X("chartInstancesSeuElectronica_BarMonth",F(r.resultset,yn[t].get("Instances"),void 0,yn[t].get("TittleInstancesMonthlyChart"),yn[t].get("InstancesChartText"))))}function En(e,r){0===r.resultset.length?D("#chartSeuElectronica_BarMonth","#no_dataSeuElectronica_BarMonth"):(_("#no_dataSeuElectronica_BarMonth","#chartSeuElectronica_BarMonth"),X("chartSeuElectronica_BarMonth",F(r.resultset,yn[t].get("Acces"),void 0,yn[t].get("TittleAccessMonthlyChart"))))}function In(e,r){if(0===r.resultset.length)D("#chartYearInstancesSeuElectronica_gauge_semicircle","#no_dataYearInstancesSeuElectronica_gauge_semicircle");else{_("#no_dataYearInstancesSeuElectronica_gauge_semicircle","#chartYearInstancesSeuElectronica_gauge_semicircle");const e=N("chartYearSeuElectronica_gauge_semicircle");X("chartYearInstancesSeuElectronica_gauge_semicircle",W(r.resultset,yn[t].get("TittleInstancesPrevYearsChart"),e))}}function wn(e,r){if(0===r.resultset.length)D("#chartYearSeuElectronica_gauge_semicircle","#no_dataYearSeuElectronica_gauge_semicircle");else{_("#no_dataYearSeuElectronica_gauge_semicircle","#chartYearSeuElectronica_gauge_semicircle");const e=N("chartYearSeuElectronica_gauge_semicircle");X("chartYearSeuElectronica_gauge_semicircle",W(r.resultset,yn[t].get("TittleAccessPrevYearsChart"),e))}}function vn(e,r){if(0===r.resultset.length)D("#chartInstancesSeuElectronica_reloj_semicircle","#no_dataInstancesSeuElectronica_reloj_semicircle"),D("#chartInstancesSeuElectronica_reloj_semicircle_lastmonth","#no_dataInstancesSeuElectronica_reloj_semicircle_lastmonth");else{_("#no_dataInstancesSeuElectronica_reloj_semicircle","#chartInstancesSeuElectronica_reloj_semicircle"),_("#no_dataInstancesSeuElectronica_reloj_semicircle_lastmonth","#chartInstancesSeuElectronica_reloj_semicircle_lastmonth");const e=0,n=1,o=r.resultset,a=N("chartSeuElectronica_reloj_semicircle");X("chartInstancesSeuElectronica_reloj_semicircle",Z(o,e,yn[t].get("TittleInstancesCurrMonth"),a)),X("chartInstancesSeuElectronica_reloj_semicircle_lastmonth",Z(o,n,yn[t].get("TittleInstancesPrevMonth"),a))}}function Mn(e,r){if(0===r.resultset.length)D("#chartSeuElectronica_reloj_semicircle","#no_dataSeuElectronica_reloj_semicircle"),D("#chartSeuElectronica_reloj_semicircle_lastmonth","#no_dataSeuElectronica_reloj_semicircle_lastmonth");else{_("#no_dataSeuElectronica_reloj_semicircle","#chartSeuElectronica_reloj_semicircle"),_("#no_dataSeuElectronica_reloj_semicircle_lastmonth","#chartSeuElectronica_reloj_semicircle_lastmonth");const e=0,n=1,o=r.resultset,a=N("chartSeuElectronica_reloj_semicircle");X("chartSeuElectronica_reloj_semicircle",Z(o,e,yn[t].get("TittleAccessCurrMonth"),a)),X("chartSeuElectronica_reloj_semicircle_lastmonth",Z(o,n,yn[t].get("TittleAccessPrevMonth"),a))}}function Tn(t,e){if(0===e.resultset.length)(0,Bt.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{const r={title:{text:t.chartName},xAxis:{name:`\n\n\n\n${t.yAxisName}`}};(0,Bt.initStackedBarChartMonthSeries)(t.idChart,e.resultset,r)}}function Cn(t,e){Tn({idChart:"chartInstancesSeuElectronica_stackedBarYears",idNoData:"no_dataInstancesSeuElectronica_stackedBarYears",chartName:yn[zt].get("TittleInstancesYearlyChart"),yAxisName:yn[zt].get("Instances")},e)}function Dn(t,e){Tn({idChart:"chartSeuElectronica_stackedBarYears",idNoData:"no_dataSeuElectronica_stackedBarYears",chartName:yn[zt].get("TittleAccessYearlyChart"),yAxisName:yn[zt].get("Acces")},e)}function Ln(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataInstanciesDonadesAlta").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show();const t=e.resultset,r=new Set,n=[],o=[],a=[],i=1130,s=1124,l=1122;t.forEach((t=>{t[0]===i&&(r.add(t[1]),n.push(t[2])),t[0]===l&&(r.add(t[1]),a.push(t[2])),t[0]===s&&(r.add(t[1]),o.push(t[2]))}));const c=It(r.size),u=25,h=-5,f=[{name:"Instàncies",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:a}],d=[{name:"Expedients",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:o}],p=P([{name:"Tasques",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:n}],null,Array.from(r.values()),"Tasques",c,!0,h,void 0,"TASQUES ADMINISTRATIVES PIAE REALITZADES: EVOLUCIÓ DIÀRIA"),g=P(f,null,Array.from(r.values()),"Instàncies",c,!0,u,void 0,"INSTÀNCIES PIAE DONADES D'ALTA: EVOLUCIÓ DIÀRIA"),m=P(d,null,Array.from(r.values()),"Expedients",c,!0,u,void 0,"EXPEDIENTS PIAE DONADES D'ALTA: EVOLUCIÓ DIÀRIA");X("chartInstanciesDonadesAlta",g),X("chartAdministrativesRealitzades",p),X("chartExpDonatsAlta",m)}}function _n(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataResolucionsAssentades").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show(),$("#chartResolucionsAssentades").css("background","#ffffff"),$("#chartResolucionsAssentades").show(),$("#chartNotificacionsTelematic").css("background","#ffffff"),$("#chartNotificacionsTelematic").show();const t=e.resultset,r=e.resultset.length,n=new Set,o=[];for(let e=0;e<r;e+=1)n.add(t[e][0]),o.push(t[e][1]);const a=It(n.size),i=35;X("chartResolucionsAssentades",P([{name:"Resolucions",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:o}],null,Array.from(n.values()),"Resolucions",a,!0,i,void 0,"RESOLUCIONS PIAE ASSENTADES: EVOLUCIÓ DIÀRIA"))}}function Un(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataNotificacionsTelematic").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show(),$("#chartResolucionsAssentades").css("background","#ffffff"),$("#chartResolucionsAssentades").show(),$("#chartNotificacionsTelematic").css("background","#ffffff"),$("#chartNotificacionsTelematic").show();const t=e.resultset,r=e.resultset.length,n=new Set,o=[];for(let e=0;e<r;e+=1)n.add(t[e][0]),o.push(t[e][1]);const a=It(n.size),i=40;X("chartNotificacionsTelematic",P([{name:"Notificacions",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:o}],null,Array.from(n.values()),"Notificacions",a,!0,i,void 0,"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: EVOLUCIÓ DIÀRIA"))}}const On=0,Nn=1,kn=2,Pn=3,Rn=4,xn=1130,$n=1124,Bn=1122,Fn=1143,Gn=1139;function zn(t){const e=[],r=[],n=[],o=[],a=[];return t.forEach((t=>{t[0]===xn?n.push([t[1],t[2],t[3]]):t[0]===Bn?e.push([t[1],t[2],t[3]]):t[0]===$n?r.push([t[1],t[2],t[3]]):t[0]===Fn?o.push([t[1],t[2],t[3]]):t[0]===Gn&&a.push([t[1],t[2],t[3]])})),[e,r,n,a,o]}function Vn(t,e){[{chartId:`#chartInstanciesDonadesAlta${t}`,noDataId:`#no_dataInstanciesDonadesAlta${t}`},{chartId:`#chartExpDonadesAlta${t}`,noDataId:`#no_dataExpDonadesAlta${t}`},{chartId:`#chartAdministrativesDonadesAlta${t}`,noDataId:`#no_dataAdministrativesDonadesAlta${t}`},{chartId:`#chartResDonadesAlta${t}`,noDataId:`#no_dataResDonadesAlta${t}`},{chartId:`#chartNotificacionsDonadesAlta${t}`,noDataId:`#no_dataNotificacionsDonadesAlta${t}`}].forEach((({chartId:t,noDataId:r})=>{e?_(t,r):D(r,t)}))}function jn(t,e){if(0===e.resultset.length)Vn("BarMonth");else{Vn("BarMonth");const t=zn(e.resultset),r=-30,n=F(t[On],"Instàncies",r,"INSTÀNCIES PIAE DONADES D'ALTA: EVOLUCIÓ MENSUAL"),o=F(t[Nn],"Expedients",r,"EXPEDIENTS PIAE DONADES D'ALTA: EVOLUCIÓ MENSUAL"),a=F(t[kn],"Tasques",r,"TASQUES ADMINISTRATIVES PIAE REALITZADES: EVOLUCIÓ MENSUAL"),i=F(t[Pn],"Resolucions",r,"RESOLUCIONS PIAE ASSENTADES: EVOLUCIÓ MENSUAL"),s=F(t[Rn],"Notificacions",r+15,"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: EVOLUCIÓ MENSUAL");X("chartInstanciesDonadesAltaBarMonth",n),X("chartExpDonadesAltaBarMonth",o),X("chartAdministrativesDonadesAltaBarMonth",a),X("chartResDonadesAltaBarMonth",i),X("chartNotificacionsDonadesAltaBarMonth",s)}}function Yn(t,e){if(0===e.resultset.length)Vn("StackedBarYears");else{Vn("StackedBarYears");const t=zn(e.resultset),r={title:{text:"INSTÀNCIES PIAE DONADES D'ALTA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nInstàncies"}};(0,Bt.initStackedBarChartMonthSeries)("chartInstanciesDonadesAltaStackedBarYears",t[On],r);const n={title:{text:"EXPEDIENTS PIAE DONATS D'ALTA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nExpedients"}};(0,Bt.initStackedBarChartMonthSeries)("chartExpDonadesAltaStackedBarYears",t[Nn],n);const o={title:{text:"TASQUES ADMINISTRATIVES PIAE REALITZADES: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nTasques"}};(0,Bt.initStackedBarChartMonthSeries)("chartAdministrativesDonadesAltaStackedBarYears",t[kn],o);const a={title:{text:"RESOLUCIONS PIAE ASSENTADES: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nResolucions"}};(0,Bt.initStackedBarChartMonthSeries)("chartResDonadesAltaStackedBarYears",t[Pn],a);const i={title:{text:"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nNotificacions"}};(0,Bt.initStackedBarChartMonthSeries)("chartNotificacionsDonadesAltaStackedBarYears",t[Rn],i)}}function Wn(t,e){if(0===e.resultset.length)Vn("GaugeMonth");else{Vn("GaugeMonth");const t=0,r=1,n=zn(e.resultset),o=N("chartInstanciesDonadesAltaGaugeMonth"),a=Z(n[On],t,"INSTÀNCIES PIAE DONADES D'ALTA: MES ACTUAL",o),i=Z(n[Nn],t,"EXPEDIENTS PIAE DONADES D'ALTA: MES ACTUAL",o),s=Z(n[kn],t,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ACTUAL",o),l=Z(n[Pn],t,"RESOLUCIONS PIAE ASSENTADES: MES ACTUAL",o),c=Z(n[Rn],t,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ACTUAL",o);X("chartInstanciesDonadesAltaGaugeMonth",a),X("chartExpDonadesAltaGaugeMonth",i),X("chartAdministrativesDonadesAltaGaugeMonth",s),X("chartResDonadesAltaGaugeMonth",l),X("chartNotificacionsDonadesAltaGaugeMonth",c);const u=Z(n[On],r,"INSTÀNCIES PIAE DONADES D'ALTA: MES ANTERIOR",o),h=Z(n[Nn],r,"EXPEDIENTS PIAE DONADES D'ALTA: MES ANTERIOR",o),f=Z(n[kn],r,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ANTERIOR",o),d=Z(n[Pn],r,"RESOLUCIONS PIAE ASSENTADES: MES ANTERIOR",o),p=Z(n[Rn],r,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ANTERIOR",o);X("chartInstanciesDonadesAltaGaugeLastMonth",u),X("chartExpDonadesAltaGaugeLastMonth",h),X("chartAdministrativesDonadesAltaGaugeLastMonth",f),X("chartResDonadesAltaGaugeLastMonth",d),X("chartNotificacionsDonadesAltaGaugeLastMonth",p)}}function Zn(t,e){if(0===e.resultset.length)Vn("GaugeYear");else{Vn("GaugeYear");const t=function(t){const e=[],r=[],n=[],o=[],a=[];return t.forEach((t=>{t[0]===xn?n.push([t[1],t[2]]):t[0]===Bn?e.push([t[1],t[2]]):t[0]===$n?r.push([t[1],t[2]]):t[0]===Fn?a.push([t[1],t[2]]):t[0]===Gn&&o.push([t[1],t[2]])})),[e,r,n,o,a]}(e.resultset),r=N("chartInstanciesDonadesAltaGaugeYear"),n=W(t[On],"INSTÀNCIES PIAE DONADES D'ALTA: ÚLTIMS ANYS",r),o=W(t[Nn],"EXPEDIENTS PIAE DONADES D'ALTA: ÚLTIMS ANYS",r),a=W(t[kn],"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: ÚLTIMS ANYS",r),i=W(t[Pn],"RESOLUCIONS PIAE ASSENTADES: ÚLTIMS ANYS",r),s=W(t[Rn],"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: ÚLTIMS ANYS",r);X("chartInstanciesDonadesAltaGaugeYear",n),X("chartExpDonadesAltaGaugeYear",o),X("chartAdministrativesDonadesAltaGaugeYear",a),X("chartResDonadesAltaGaugeYear",i),X("chartNotificacionsDonadesAltaGaugeYear",s)}}function Jn(t,e){vt(e,!0,15,"TEMPERATURA MITJANA DIÀRIA","ºC","chartTemperatureMitjanaDiaria","no_dataTemperatureMitjanaDiaria",void 0,void 0,!0,0)}function Hn(t,e){let r="MITJANA DIÀRIA DE SOROLL : ";const n=e.filter((e=>e[5]===t)),o=new Set(["Matí","Vesprada","Nit"]),a=new Set,i={name:"Matí",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:[],markLine:{data:[{yAxis:d}],lineStyle:{color:"#5470c6"}}},s={name:"Vesprada",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:[],markLine:{data:[{yAxis:d}],lineStyle:{color:"#5470c6"}}},l={name:"Nit",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:[],markLine:{data:[{yAxis:p}],lineStyle:{color:"#fac858"}}};r+=n[0][5],n.forEach((t=>{i.data.push(t[6]),s.data.push(t[7]),l.data.push(t[8]),a.add(gt(t[1]))}));const c=It(a.size);X("chartSonometroMapa",P([i,s,l],Array.from(o.values()),Array.from(a.values()),"dB",c,!0,-10,void 0,r))}const qn="MITJANA DE SOROLL: ";function Kn(t,e,r,n,o,a){const i=e.resultset,s=`resultadoDirecciones${a}`,l=Dashboards.getParameterValue(s).map((t=>t[0])),c=[],u={},h=i.map((t=>{const e=t[0].split("-");return`${e[2]}/${e[1]}/${e[0]}`}));Array.from(new Set(h)).forEach((t=>{u[t]=Array(l.length).fill(null)})),i.forEach((t=>{const e=gt(t[0]);l.every(((r,n)=>t[1].toString()!==r||(u[e][n]=t[2],!1)))})),l.forEach(((t,e)=>{const r={name:"",type:"line",smooth:!1,data:[],symbol:"circle",symbolSize:6,markLine:{data:[{yAxis:n}],lineStyle:{color:"#ff9933"}}},o=Object.values(u).map((t=>t[e]));r.name=t,r.data=o,c.push(r)}));const f=It(Array.from(Object.keys(u)).length),d=l.map((t=>({[t]:!1}))),p={};d.forEach(((t,e)=>{const r=Object.keys(t)[0];p[r]=e<4||t[r]})),X(r,P(c,l,Array.from(Object.keys(u)),"dB",f,!0,-10,void 0,o,void 0,void 0,p))}function Xn(t,e,r,n){const o=`${n.toUpperCase()} MATÍ`;Kn(0,e,r+n,d,qn+o,n)}function Qn(t,e,r,n){const o=`${n.toUpperCase()} VESPRADA`;Kn(0,e,r+n,d,qn+o,n)}function to(t,e,r,n){const o=`${n.toUpperCase()} NIT`;Kn(0,e,r+n,p,qn+o,n)}function eo(){var t;let e;const r=L.icon({iconUrl:"/pentaho/api/repos/public/sc_valencia/Ciutat%3Abuild/images/mapas/marker-icon-sonometros.svg/content",iconSize:[34,34],shadowSize:[50,64],iconAnchor:[17,17],shadowAnchor:[4,62],popupAnchor:[0,-26]}),n=L.icon({iconUrl:"/pentaho/api/repos/public/sc_valencia/Ciutat%3Abuild/images/mapas/marker-icon-selected-sonometros.svg/content",iconSize:[34,34],shadowSize:[50,64],iconAnchor:[17,17],shadowAnchor:[4,62],popupAnchor:[0,-26]});t=L.map("myMap").setView([39.47225,-.37739],14);let o=L.tileLayer("https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',subdomains:"abcd",maxZoom:20});t.setMinZoom(5),t.setMaxZoom(20),o.addTo(t),L.geoJSON(legacy.obtenerGeoJson(resultadoSonometros,0,5,9),{onEachFeature:function(t,o){console.log(o),function(t,e){if(t.properties&&t.properties.objectoId){let r=t.properties.address;e.bindPopup(r),e.on("click",(()=>legacy.createChart(r,resultadoSonometros)))}}(t,o),function(t){t.on("click",(t=>{var o;o=t.target,e&&e.setIcon(r),e=o,e.setIcon(n)}))}(o)},pointToLayer:function(t,e){return L.marker(e,{icon:r})}}).addTo(t)}function ro(t,e){if(0===e.resultset.length)$("#chartAltUsuarisDiaries").hide(),$("#no_dataAltUsuarisDiaries").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAltUsuarisDiaries").show();else{$("#no_dataAltUsuarisDiaries").hide(),$("#chartAltUsuarisDiaries").css("background","#ffffff"),$("#chartAltUsuarisDiaries").show();const t="WIFI: ALTES D'USUARIS DIÀRIES",r=e.resultset,n=e.resultset.length,o=new Set,a=[],i=[],s=[];for(let t=0;t<n;t+=1)"OCI.DL.001"===r[t][0]&&(o.add(mt(r[t][1])),a.push(r[t][5]),i.push(r[t][6]),s.push(r[t][7]));const l=It(o.size);X("chartAltUsuarisDiaries",P([{name:"Nombre d'altes de funcionari",type:"bar",smooth:!1,data:i},{name:"Nombre d'altes de ciutadans",type:"bar",smooth:!1,data:a},{name:"Nombre d'altes de Wifi4EU",type:"bar",smooth:!1,data:s}],["Nombre d'altes de funcionari","Nombre d'altes de Wifi4EU"],Array.from(o.values()),"Usuaris",l,!0,void 0,void 0,t))}}function no(t,e){document.querySelector("#tabUsuarisConectadosDiaries").addEventListener("click",(()=>{requestAnimationFrame((()=>{x("chartConectadosMesActual","chartConectadosMesAnterior","no_dataConectadosMesActual","no_dataConectadosMesAnterior",e.resultset,"CONNEXIONS WIFI DIÀRIES: EVOLUCIÓ ","CONNEXIONS WIFI DIÀRIES: EVOLUCIÓ ")}))}))}function oo(t,e){document.querySelector("#tabUsuarisConectadosDiaries").addEventListener("click",(()=>{requestAnimationFrame((()=>{B("chartConectadosGaugeYear","no_dataConectadosGaugeYear",e.resultset,"CONNEXIONS WIFI DIÀRIES: EVOLUCIÓ ANY")}))}))}function ao(t,e){vt(e,!0,5,"WIFI: CONNEXIONS DIÀRIES","Usuaris","chartUsuarisConectadosDiaries","no_dataUsuarisConectadosDiaries")}function io(t,e){if(0===e.resultset.length)D("#chartConectadosHorStackedBar","#no_dataConectadosHorStackedBar");else{_("#no_dataConectadosHorStackedBar","#chartConectadosHorStackedBar");const t=e.resultset,r={title:{text:"CONNEXIONS WIFI DIÀRIES: HISTÒRIC ANUAL"},color:["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],xAxis:{name:"\n\n\n\nUsuaris"}};(0,Bt.initStackedBarChart)("chartConectadosHorStackedBar",t,r)}}function so(t,e){R("chartConectadosStackedBar","no_dataConectadosStackedBar",e.resultset,"Usuaris","CONNEXIONS WIFI DIÀRIES: HISTÒRIC MENSUAL")}function lo(){const t=()=>{requestAnimationFrame((()=>{document.querySelector("#iframeSmartCity").setAttribute("src","https://lookerstudio.google.com/embed/reporting/ff43c17f-23cb-4edb-923b-a7b061d829dc/page/6WdoC?hl=ca"),document.querySelector("#tabSmartCity").removeEventListener("click",t)}))},e=()=>{requestAnimationFrame((()=>{document.querySelector("#iframeCdMCiutat").setAttribute("src","https://lookerstudio.google.com/embed/reporting/2da9d93e-d833-4a00-833a-19ac0746dc9f/page/6WdoC?hl=ca"),document.querySelector("#tabCdmCiutat").removeEventListener("click",e)}))};document.querySelector("#iframeValenciaMinut").setAttribute("src","https://lookerstudio.google.com/embed/reporting/14a41533-3cd8-4f75-b303-9a494c0e4a9d/page/6WdoC?hl=ca"),document.querySelector("#tabSmartCity").addEventListener("click",t),document.querySelector("#tabCdmCiutat").addEventListener("click",e)}})(),n})()));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.legacy=e():t.legacy=e()}(self,(()=>(()=>{var t={421:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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,{addPointInteger:()=>c,buildCamarasTrafico:()=>z,buildTableCalidadAire:()=>B,calculateMaxYAxis:()=>y,calculatePentahoPath:()=>$,calculateXAxisStart:()=>m,configureDataGaugeCommon:()=>E,configureDataGaugeMonthCommon:()=>I,configureDataLine:()=>w,convertToTableTreeView:()=>x,formatMonthAnyo:()=>a,formatName:()=>h,formatNameHeaderColumn:()=>k,formatRoundTooltip:()=>A,formatShortMonthShortYear:()=>s,formatShortMonthYear:()=>i,formatToMillions:()=>u,formatTooltip:()=>g,formatTooltipPie:()=>S,formatTrimestre:()=>l,getMonth:()=>n,getSelectCommonOptions:()=>O,initBarChart:()=>Y,initChart:()=>f,initStackedBarChart:()=>V,initStackedBarChartMonthSeries:()=>j,initTable:()=>N,initialCalls:()=>G,loadIframeOnClickEvent:()=>W,printDataChart:()=>p,printDataInHTMLElements:()=>T,printNoDataChart:()=>d,resetFilter:()=>U,resultsetWithFields:()=>v,selectConfigDatasource:()=>_,selectFilterAll:()=>D,splitDataset:()=>C,traverseRows:()=>R});const r={"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)]}function o(t){return[t.substring(0,4),r[t.substring(4,6)]]}function a(t){const[e,r]=o(t);return`${r} ${e}`}function i(t){const[e,r]=o(t);return`${r.substring(0,3)} ${e}`}function s(t){const[e,r]=o(t);return`${r.substring(0,3)} '${e.substring(2,4)}`}function l(t){const[e,r]=t.split("-");return`${parseFloat(r)/3}T ${e}`}function c(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const r={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",r):t.toLocaleString(e,r)}function u(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function h(t,e=29){if(t.length>=e){const r=t.split(" ");let n="",o="";return r.forEach((t=>{`${n} ${t}`.length<=e?n+=(n?" ":"")+t:(o+=`${n}\n`,n=t)})),o+=n,o}return t}function f(t,e){const r=document.getElementById(t);if(!r)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const n=echarts.init(r);n.setOption(e,!0),window.addEventListener("resize",(()=>{null!=n&&void 0!==n&&n.resize()}));const o=document.getElementById("main-content");return o&&(o.addEventListener("shown.bs.collapse",(()=>{n.resize()})),o.addEventListener("hidden.bs.collapse",(()=>{n.resize()}))),n}function d(t,e){const r=t?document.querySelector(t):null,n=e?document.querySelector(e):null;r&&(r.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function p(t,e){const r=t?document.querySelector(t):null,n=e?document.querySelector(e):null;r&&(r.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function g(t,e=!1,r=!0,n=""){let o=`<p>${t[0].name}</p>`;return t.forEach((t=>{const a=e?Math.round(t.data):t.data,i=r?`<div>${s=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${s}"></span>`} ${t.seriesName}: \n <strong style="float: right; margin-left:20px">\n ${t.data?`${c(a)} ${n}`:"-"}\n </strong>\n </div>`:`<div>\n <strong>${t.data?`${c(a)} ${n}`:"-"}\n </strong>\n </div>`;var s;o+=i})),o}function m(t){return 100*(t-120)/t}function y(t,e){const r=Math.max(...t);return r+(e-r%e)}function S(t,e=!1){const r=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,n=e?`${t.percent}%`:c(t.value);return`<div> ${r} ${t.name} <strong style="float: right; margin-left:20px"> ${n} </strong></div>`}function A(t,e){let r=`${t.name} : `;return r+=`<span style="font-weight:bold">${c(Math.round(t.value))}</span>`,e&&(r+=`<span> (${t.percent}%)</span>`),t.marker+r}function b(t,e,r=1){const n=Math.max(...t.map((t=>t[e])))*r;return 5e3*Math.ceil(n/5e3)}function E(t,e,r,n=30,o=15,a=30,i=-70,s=70,l=3){const u=b(t,e.data,1.1),f=s,d=r.slice(),p=[];let g=o,m=a,y=i;for(let r=0;r<t.length;r+=1)p.push({value:t[r][e.data],name:h(String(t[r][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(y)}%`,`${String(g)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(y)}%`,`${String(m)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>c(Math.round(t))}}),y+=f,(r+1)%l==0&&(m+=a,g+=2*o,y=i);return[u,p]}function I(t,e,r,o=0){return[b(e,r.data,1),t=>function(t,e,r){const o=c(Math.round(e)),a=n(t[r][0]),i=t[r][1],s=`\n${a} ${i} : ${o}`,l=`${o}\n${a} ${i}`;return window.innerWidth<=1710?s:l}(e,t,o),[{value:e[o][r.data]}]]}function w(t,e,r=!1){const{resultset:n}={resultset:t},o=new Set,a=new Set,i=e,s=n.map((([t,e,n])=>{const i=r?Math.round(n):n;return o.add(t),a.add(e),{day:e,type:t,value:i}})),l=Array.from(a.values()),c=Array.from(o.values());return c.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[c.map((t=>{const e=s.filter((e=>e.type===t)).map((({day:e,value:r})=>[e,t,r])),r=l.map((t=>{const r=e.find((([e])=>e===t));return r?r[2]:null}));return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:r}})),a,c]}function v(t){const{resultset:e,metadata:r}=t,n=[];return e.forEach((t=>{const e={};t.forEach(((t,n)=>{e[r[n].colName]=t})),n.push(e)})),n}function M(t,e){const r=t;return Object.keys(e).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&("object"!=typeof e[n]||Array.isArray(e[n])?r[n]=e[n]:r[n]=M(t[n]||{},e[n]))})),t}function T(t,e){t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((r=>{const n=r[0],o=r[1];"object"==typeof o?o.className?document.querySelector(o.className).className=t[n]:o.element&&o.format&&(document.querySelector(o.element).textContent=e[t.id][n].format(t[n])):document.querySelector(o).textContent=t[n]}))}))}function C(t,e=!0){const r={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?r.Cont.push([t[3],t[4],t[2]]):r.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?r.Mob.push([t[3],t[4],t[2]]):r.Mob.push([t[3],t[2]]))})),r}function D(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function L(t){for(const e of t)if(Array.isArray(e)){if(!L(e))return!1}else if("All"!==e)return!1;return!0}function _(t,e,r,n){return L(e)?(t.queryDefinition.dataAccessId=r,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function U(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function O(){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function N(t,e){const r=document.getElementById(t);return r?new Tabulator(r,e):(console.error(`No se pudo encontrar el elemento con ID ${t}.`),null)}function k(t,e){let r=t.getValue();return r.length>e&&(r=`${r.substr(0,e)}<br>${r.substr(e)}`),r}function P(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const r=t.getTreeChildren();r.length>0&&r.forEach((t=>{t.getTreeChildren().length>0&&P(t,e)}))}function R(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&P(t,e)}))}function x(t,e,r,n){const o=[];for(const a in t)if(t.hasOwnProperty(a)){const i=t[a],s={[e]:i[0],_children:[]};i.shift(),i.forEach(((t,o)=>{const a={[e]:r[o],[n]:t};s._children.push(a)})),o.push(s)}return o}function B(t){const e=[],r=[100,200,350,500,750,751],n=[40,90,120,230,340,341],o=[50,100,130,240,380,381],a=[20,40,50,100,150,151],i=[10,20,25,50,75,76],s={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function l(t,e,r){const n=document.createElement("td");if(n.setAttribute("id",t),null!=e){n.innerHTML=e;const t=function(t,e){let r;return void 0===e?r=6:"ND"===e?r=7:(r=5,t.forEach(((t,n)=>{e<=t&&5===r&&(r=n)}))),s[r]}(r,e);n.classList.add(t)}return n}return t.forEach((t=>{const s=t;"noData"===s.operationalstatus&&(s.so2value="ND",s.no2value="ND",s.o3value="ND",s.pm10value="ND",s.pm25value="ND"),"A09_CABANYAL_60m"===s.entityid&&(s.pm10value=void 0,s.pm25value=void 0);const c=document.createElement("tr"),u=document.createElement("td");u.innerHTML=s.address,c.appendChild(u),c.appendChild(l(`${s.entityid}_so2`,s.so2value,r)),c.appendChild(l(`${s.entityid}_no2`,s.no2value,n)),c.appendChild(l(`${s.entityid}_o3`,s.o3value,o)),c.appendChild(l(`${s.entityid}_pm10`,s.pm10value,a)),c.appendChild(l(`${s.entityid}_pm25`,s.pm25value,i)),e.push(c)})),e}function $(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 F(t,e){document.querySelectorAll(`[${t}]`).forEach((r=>{!function(t,e,r){const n=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(n.innerHTML=this.responseText,r&&r(),function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])}()),404===this.status&&(n.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(r.getAttribute(t),r,e)}))}function G(t){F("include-html-cabecera"),F("include-html-menu"),F("include-html-main-container",t),F("include-html-copyright")}function z(t,e,r,n,o,a){let i=!1,s=!1;const l=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.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")):(l&&l.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 h(t=!0){const e=document.querySelector(r);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),s=!0):(e.classList.remove("blur"),u(),s=!1)}const f=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(s||u(),i||(i=!0,window.setTimeout(h,a)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(l&&(l.setAttribute("sandbox","allow-scripts"),f(l)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(o).addEventListener("click",(()=>{h(!1),window.setTimeout(h,a)}))):document.querySelectorAll(n)[0].style.display="none"}function V(t,e,r=void 0,n=void 0){const o=null===n?void 0:n,a=new Set(e.map((t=>t[1])));let i;const s={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>g(t,!0)},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=>c(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=>c(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};o&&o.itemStyle&&Array.isArray(o.itemStyle.borderColor)&&(i=[...o.itemStyle.borderColor],delete o.itemStyle.borderColor);const r=function(t,e){return t.reduce(((t,e)=>{const r=e[0];return t[r]||(t[r]=[]),t[r].push(e),t}),{})}(e),n=Object.keys(r);a.forEach((t=>{n.forEach((e=>{void 0===r[e].find((e=>e[1]===t))&&(r[e].push([r[e][0][0],t,void 0]),r[e].sort())}))}));const s=[];return Object.keys(r).forEach((e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=r[e].map((t=>t[2]));let n={};n=void 0!==o?M(t,o):t,s.push({...n})})),s})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==r?M(s,r):s,f(t,l)}function j(t,e,r={},o={}){let a={};a=M(r,{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"]}},s=null===o?i:M(o,i),l=e;l.forEach(((t,e)=>{l[e][0]=n(t[0])})),V(t,l,a,s)}function Y(t,e,r=void 0){const n=e.map((t=>t[1])),o=e.map((t=>t[0])),a={dataset:{source:n.map(((t,e)=>[t,o[e]]))},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=>{const e=t.value[0];return t.value=e,A(t,!1)}},series:[{type:"bar",showBackground:!0,label:{show:!0,position:[15,"35%"],formatter:"{b}",fontSize:10,align:"left",color:"#000",textStyle:{fontFamily:"Montserrat",fontWeight:"400"}},itemStyle:{color:t=>["#B7C258","#A3BF62","#8EBC6D","#7AB877","#65B581","#50B28B"][t.dataIndex]},encode:{x:"intensidad",y:"tramo"}}]};let i={};i=void 0!==r?M(a,r):a,f(t,i)}function W(t,e,r){const n=()=>{document.querySelector(e).setAttribute("src",r),document.querySelector(t).removeEventListener("click",n)};document.querySelector(t).addEventListener("click",n)}return e})(),t.exports=e()},742:(t,e)=>{"use strict";e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,a=s(t),i=a[0],l=a[1],c=new o(function(t,e,r){return 3*(e+r)/4-r}(0,i,l)),u=0,h=l>0?i-4:i;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[u++]=e>>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,a=[],i=16383,s=0,c=n-o;s<c;s+=i)a.push(l(t,s,s+i>c?c:s+i));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)r[i]=a[i],n[a.charCodeAt(i)]=i;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,n){for(var o,a,i=[],s=e;s<n;s+=3)o=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),i.push(r[(a=o)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(t,e,r)=>{"use strict";const n=r(742),o=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(t){return+t!=t&&(t=0),l.alloc(+t)},e.INSPECT_MAX_BYTES=50;const i=2147483647;function s(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=s(r);const o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(H(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return l.from(n,e,r);const o=function(t){if(l.isBuffer(t)){const e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||q(t.length)?s(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return u(t),s(t<0?0:0|p(t))}function f(t){const e=t.length<0?0:0|p(t.length),r=s(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,l.prototype),n}function p(t){if(t>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function g(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(o)return n?-1:W(t).length;e=(""+e).toLowerCase(),o=!0}}function m(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return _(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return D(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function S(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:A(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):A(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function A(t,e,r,n,o){let a,i=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;i=2,s/=2,l/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){let n=-1;for(a=r;a<s;a++)if(c(t,a)===c(e,-1===n?0:a-n)){if(-1===n&&(n=a),a-n+1===l)return n*i}else-1!==n&&(a-=a-n),n=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let n=0;n<l;n++)if(c(t,a+n)!==c(e,n)){r=!1;break}if(r)return a}return-1}function b(t,e,r,n){r=Number(r)||0;const o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;const a=e.length;let i;for(n>a/2&&(n=a/2),i=0;i<n;++i){const n=parseInt(e.substr(2*i,2),16);if(q(n))return i;t[r+i]=n}return i}function E(t,e,r,n){return J(W(e,t.length-r),t,r,n)}function I(t,e,r,n){return J(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r,n){return J(Z(e),t,r,n)}function v(t,e,r,n){return J(function(t,e){let r,n,o;const a=[];for(let i=0;i<t.length&&!((e-=2)<0);++i)r=t.charCodeAt(i),n=r>>8,o=r%256,a.push(o),a.push(n);return a}(e,t.length-r),t,r,n)}function M(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);const n=[];let o=e;for(;o<r;){const e=t[o];let a=null,i=e>239?4:e>223?3:e>191?2:1;if(o+i<=r){let r,n,s,l;switch(i){case 1:e<128&&(a=e);break;case 2:r=t[o+1],128==(192&r)&&(l=(31&e)<<6|63&r,l>127&&(a=l));break;case 3:r=t[o+1],n=t[o+2],128==(192&r)&&128==(192&n)&&(l=(15&e)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:r=t[o+1],n=t[o+2],s=t[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(l=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,i=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=i}return function(t){const e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=C));return r}(n)}e.kMaxLength=i,l.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(t,e,r){return c(t,e,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(t,e,r){return function(t,e,r){return u(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},l.allocUnsafe=function(t){return h(t)},l.allocUnsafeSlow=function(t){return h(t)},l.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==l.prototype},l.compare=function(t,e){if(H(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),H(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,a=Math.min(r,n);o<a;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=l.allocUnsafe(e);let o=0;for(r=0;r<t.length;++r){let e=t[r];if(H(e,Uint8Array))o+e.length>n.length?(l.isBuffer(e)||(e=l.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else{if(!l.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},l.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},l.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},l.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?T(this,0,t):m.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(t,e,r,n,o){if(H(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;let a=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(e>>>=0);const s=Math.min(a,i),c=this.slice(n,o),u=t.slice(e,r);for(let t=0;t<s;++t)if(c[t]!==u[t]){a=c[t],i=u[t];break}return a<i?-1:i<a?1:0},l.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},l.prototype.indexOf=function(t,e,r){return S(this,t,e,r,!0)},l.prototype.lastIndexOf=function(t,e,r){return S(this,t,e,r,!1)},l.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return I(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function D(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function L(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function _(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=e;n<r;++n)o+=K[t[n]];return o}function U(t,e,r){const n=t.slice(e,r);let o="";for(let t=0;t<n.length-1;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}function O(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,o,a){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function k(t,e,r,n,o){z(e,n,o,t,r,7);let a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;let i=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,r}function P(t,e,r,n,o){z(e,n,o,t,r,7);let a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;let i=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=i,i>>=8,t[r+2]=i,i>>=8,t[r+1]=i,i>>=8,t[r]=i,r+8}function R(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(t,e,r,n,a){return e=+e,r>>>=0,a||R(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,a){return e=+e,r>>>=0,a||R(t,0,r,8),o.write(t,e,r,n,52,8),r+8}l.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let n=this[t],o=1,a=0;for(;++a<e&&(o*=256);)n+=this[t+a]*o;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readBigUInt64LE=X((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||j(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))})),l.prototype.readBigUInt64BE=X((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||j(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),l.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let n=this[t],o=1,a=0;for(;++a<e&&(o*=256);)n+=this[t+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let n=e,o=1,a=this[t+--n];for(;n>0&&(o*=256);)a+=this[t+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a},l.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readBigInt64LE=X((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||j(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),l.prototype.readBigInt64BE=X((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||j(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),l.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);let o=1,a=0;for(this[e]=255&t;++a<r&&(o*=256);)this[e+a]=t/o&255;return e+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);let o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigUInt64LE=X((function(t,e=0){return k(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=X((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let o=0,a=1,i=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===i&&0!==this[e+o-1]&&(i=1),this[e+o]=(t/a>>0)-i&255;return e+r},l.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let o=r-1,a=1,i=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===i&&0!==this[e+o+1]&&(i=1),this[e+o]=(t/a>>0)-i&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigInt64LE=X((function(t,e=0){return k(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=X((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(t,e,r){return x(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return x(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},l.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{const a=l.isBuffer(t)?t:l.from(t,n),i=a.length;if(0===i)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%i]}return this};const $={};function F(t,e,r){$[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function G(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function z(t,e,r,n,o,a){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let o;throw o=a>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new $.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){V(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||j(e,t.length-(r+1))}(n,o,a)}function V(t,e){if("number"!=typeof t)throw new $.ERR_INVALID_ARG_TYPE(e,"number",t)}function j(t,e,r){if(Math.floor(t)!==t)throw V(t,r),new $.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new $.ERR_BUFFER_OUT_OF_BOUNDS;throw new $.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=G(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=G(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n}),RangeError);const Y=/[^+/0-9A-Za-z-_]/g;function W(t,e){let r;e=e||1/0;const n=t.length;let o=null;const a=[];for(let i=0;i<n;++i){if(r=t.charCodeAt(i),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}const K=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function X(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},924:(t,e,r)=>{"use strict";var n=r(210),o=r(559),a=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&a(t,".prototype.")>-1?o(r):r}},559:(t,e,r)=>{"use strict";var n=r(612),o=r(210),a=r(771),i=o("%TypeError%"),s=o("%Function.prototype.apply%"),l=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||n.call(l,s),u=o("%Object.defineProperty%",!0),h=o("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){if("function"!=typeof t)throw new i("a function is required");var e=c(n,l,arguments);return a(e,1+h(0,t.length-(arguments.length-1)),!0)};var f=function(){return c(n,s,arguments)};u?u(t.exports,"apply",{value:f}):t.exports.apply=f},296:(t,e,r)=>{"use strict";var n=r(44)(),o=r(210),a=n&&o("%Object.defineProperty%",!0);if(a)try{a({},"a",{value:1})}catch(t){a=!1}var i=o("%SyntaxError%"),s=o("%TypeError%"),l=r(275);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],h=!!l&&l(t,e);if(a)a(t,e,{configurable:null===c&&h?h.configurable:!c,enumerable:null===n&&h?h.enumerable:!n,value:r,writable:null===o&&h?h.writable:!o});else{if(!u&&(n||o||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},29:(t,e,r)=>{"use strict";var n=r(320),o=Object.prototype.toString,a=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=r),"[object Array]"===o.call(t)?function(t,e,r){for(var n=0,o=t.length;n<o;n++)a.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,i):"string"==typeof t?function(t,e,r){for(var n=0,o=t.length;n<o;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,i):function(t,e,r){for(var n in t)a.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,i)}},648:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var o=0;o<e.length;o+=1)r[o+t.length]=e[o];return r};t.exports=function(t){var o=this;if("function"!=typeof o||"[object Function]"!==e.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var a,i=function(t,e){for(var r=[],n=1,o=0;n<t.length;n+=1,o+=1)r[o]=t[n];return r}(arguments),s=r(0,o.length-i.length),l=[],c=0;c<s;c++)l[c]="$"+c;if(a=Function("binder","return function ("+function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=",");return r}(l)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var e=o.apply(this,n(i,arguments));return Object(e)===e?e:this}return o.apply(t,n(i,arguments))})),o.prototype){var u=function(){};u.prototype=o.prototype,a.prototype=new u,u.prototype=null}return a}},612:(t,e,r)=>{"use strict";var n=r(648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{"use strict";var n,o=SyntaxError,a=Function,i=TypeError,s=function(t){try{return a('"use strict"; return ('+t+").constructor;")()}catch(t){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(t){l=null}var c=function(){throw new i},u=l?function(){try{return c}catch(t){try{return l(arguments,"callee").get}catch(t){return c}}}():c,h=r(405)(),f=r(185)(),d=Object.getPrototypeOf||(f?function(t){return t.__proto__}:null),p={},g="undefined"!=typeof Uint8Array&&d?d(Uint8Array):n,m={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h&&d?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&d?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h&&d?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h&&d?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&d?d(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":u,"%TypedArray%":g,"%TypeError%":i,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(d)try{null.error}catch(t){var y=d(d(t));m["%Error.prototype%"]=y}var S=function t(e){var r;if("%AsyncFunction%"===e)r=s("async function () {}");else if("%GeneratorFunction%"===e)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=s("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&d&&(r=d(o.prototype))}return m[e]=r,r},A={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(612),E=r(824),I=b.call(Function.call,Array.prototype.concat),w=b.call(Function.apply,Array.prototype.splice),v=b.call(Function.call,String.prototype.replace),M=b.call(Function.call,String.prototype.slice),T=b.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,D=/\\(\\)?/g,L=function(t,e){var r,n=t;if(E(A,n)&&(n="%"+(r=A[n])[0]+"%"),E(m,n)){var a=m[n];if(a===p&&(a=S(n)),void 0===a&&!e)throw new i("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:a}}throw new o("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new i('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,t))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=M(t,0,1),r=M(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return v(t,C,(function(t,e,r,o){n[n.length]=r?v(o,D,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",a=L("%"+n+"%",e),s=a.name,c=a.value,u=!1,h=a.alias;h&&(n=h[0],w(r,I([0,1],h)));for(var f=1,d=!0;f<r.length;f+=1){var p=r[f],g=M(p,0,1),y=M(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===y||"'"===y||"`"===y)&&g!==y)throw new o("property names with quotes must have matching quotes");if("constructor"!==p&&d||(u=!0),E(m,s="%"+(n+="."+p)+"%"))c=m[s];else if(null!=c){if(!(p in c)){if(!e)throw new i("base intrinsic for "+t+" exists, but the property is not available.");return}if(l&&f+1>=r.length){var S=l(c,p);c=(d=!!S)&&"get"in S&&!("originalValue"in S.get)?S.get:c[p]}else d=E(c,p),c=c[p];d&&!u&&(m[s]=c)}}return c}},275:(t,e,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},44:(t,e,r)=>{"use strict";var n=r(210)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},185:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},410:(t,e,r)=>{"use strict";var n=r(419);t.exports=function(){return n()&&!!Symbol.toStringTag}},824:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,a=r(612);t.exports=a.call(n,o)},645:(t,e)=>{e.read=function(t,e,r,n,o){var a,i,s=8*o-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?o-1:0,f=r?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(i=a&(1<<-u)-1,a>>=-u,u+=n;u>0;i=256*i+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return i?NaN:1/0*(d?-1:1);i+=Math.pow(2,n),a-=c}return(d?-1:1)*i*Math.pow(2,a-n)},e.write=function(t,e,r,n,o,a){var i,s,l,c=8*a-o-1,u=(1<<c)-1,h=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,i=u):(i=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-i))<1&&(i--,l*=2),(e+=i+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(i++,l/=2),i+h>=u?(s=0,i=u):i+h>=1?(s=(e*l-1)*Math.pow(2,o),i+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,o),i=0));o>=8;t[r+d]=255&s,d+=p,s/=256,o-=8);for(i=i<<o|s,c+=o;c>0;t[r+d]=255&i,d+=p,i/=256,c-=8);t[r+d-p]|=128*g}},717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},584:(t,e,r)=>{"use strict";var n=r(410)(),o=r(924)("Object.prototype.toString"),a=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===o(t)},i=function(t){return!!a(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o(t)&&"[object Function]"===o(t.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=i,t.exports=s?a:i},320:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var a=/^\s*class\b/,i=function(t){try{var e=n.call(t);return a.test(e)}catch(t){return!1}},s=function(t){try{return!i(t)&&(n.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;l.call(f)===l.call(document.all)&&(h=function(t){if((u||!t)&&(void 0===t||"object"==typeof t))try{var e=l.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!i(t)&&s(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return s(t);if(i(t))return!1;var e=l.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},662:(t,e,r)=>{"use strict";var n,o=Object.prototype.toString,a=Function.prototype.toString,i=/^\s*(?:function)?\*/,s=r(410)(),l=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(i.test(a.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===o.call(t);if(!l)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&l(e)}return l(t)===n}},692:(t,e,r)=>{"use strict";var n=r(430);t.exports=function(t){return!!n(t)}},155:t=>{var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,l=[],c=!1,u=-1;function h(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&f())}function f(){if(!c){var t=i(h);c=!0;for(var e=l.length;e;){for(s=l,l=[];++u<e;)s&&s[u].run();u=-1,e=l.length}s=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new d(t,e)),1!==l.length||c||i(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},771:(t,e,r)=>{"use strict";var n=r(210),o=r(296),a=r(44)(),i=r(275),s=n("%TypeError%"),l=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||l(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in t&&i){var u=i(t,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(a?o(t,"length",e,!0,!0):o(t,"length",e)),t}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},955:(t,e,r)=>{"use strict";var n=r(584),o=r(662),a=r(430),i=r(692);function s(t){return t.call.bind(t)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=s(Object.prototype.toString),h=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(l)var p=s(BigInt.prototype.valueOf);if(c)var g=s(Symbol.prototype.valueOf);function m(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function y(t){return"[object Map]"===u(t)}function S(t){return"[object Set]"===u(t)}function A(t){return"[object WeakMap]"===u(t)}function b(t){return"[object WeakSet]"===u(t)}function E(t){return"[object ArrayBuffer]"===u(t)}function I(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function w(t){return"[object DataView]"===u(t)}function v(t){return"undefined"!=typeof DataView&&(w.working?w(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=o,e.isTypedArray=i,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):i(t)||v(t)},e.isUint8Array=function(t){return"Uint8Array"===a(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===a(t)},e.isUint16Array=function(t){return"Uint16Array"===a(t)},e.isUint32Array=function(t){return"Uint32Array"===a(t)},e.isInt8Array=function(t){return"Int8Array"===a(t)},e.isInt16Array=function(t){return"Int16Array"===a(t)},e.isInt32Array=function(t){return"Int32Array"===a(t)},e.isFloat32Array=function(t){return"Float32Array"===a(t)},e.isFloat64Array=function(t){return"Float64Array"===a(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===a(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===a(t)},y.working="undefined"!=typeof Map&&y(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(y.working?y(t):t instanceof Map)},S.working="undefined"!=typeof Set&&S(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(S.working?S(t):t instanceof Set)},A.working="undefined"!=typeof WeakMap&&A(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(A.working?A(t):t instanceof WeakMap)},b.working="undefined"!=typeof WeakSet&&b(new WeakSet),e.isWeakSet=function(t){return b(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=I,w.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&w(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=v;var M="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function T(t){return"[object SharedArrayBuffer]"===u(t)}function C(t){return void 0!==M&&(void 0===T.working&&(T.working=T(new M)),T.working?T(t):t instanceof M)}function D(t){return m(t,h)}function L(t){return m(t,f)}function _(t){return m(t,d)}function U(t){return l&&m(t,p)}function O(t){return c&&m(t,g)}e.isSharedArrayBuffer=C,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===u(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===u(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===u(t)},e.isGeneratorObject=function(t){return"[object Generator]"===u(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===u(t)},e.isNumberObject=D,e.isStringObject=L,e.isBooleanObject=_,e.isBigIntObject=U,e.isSymbolObject=O,e.isBoxedPrimitive=function(t){return D(t)||L(t)||_(t)||U(t)||O(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(I(t)||C(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},539:(t,e,r)=>{var n=r(155),o=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},a=/%[sdj%]/g;e.format=function(t){if(!A(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(c(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,i=String(t).replace(a,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r<o;s=n[++r])y(s)||!I(s)?i+=" "+s:i+=" "+c(s);return i},e.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.deprecate(t,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),o=!0}return t.apply(this,arguments)}};var i={},s=/^$/;if(n.env.NODE_DEBUG){var l=n.env.NODE_DEBUG;l=l.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+l+"$","i")}function c(t,r){var n={seen:[],stylize:h};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&e._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,t,n.depth)}function u(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function h(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&M(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return A(o)||(o=f(t,o,n)),o}var a=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(A(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return S(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}(t,r);if(a)return a;var i=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(r)),v(r)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return d(r);if(0===i.length){if(M(r)){var l=r.name?": "+r.name:"";return t.stylize("[Function"+l+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return t.stylize(Date.prototype.toString.call(r),"date");if(v(r))return d(r)}var c,u="",h=!1,I=["{","}"];return g(r)&&(h=!0,I=["[","]"]),M(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(u=" "+RegExp.prototype.toString.call(r)),w(r)&&(u=" "+Date.prototype.toUTCString.call(r)),v(r)&&(u=" "+d(r)),0!==i.length||h&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=h?function(t,e,r,n,o){for(var a=[],i=0,s=e.length;i<s;++i)L(e,String(i))?a.push(p(t,e,r,n,String(i),!0)):a.push("");return o.forEach((function(o){o.match(/^\d+$/)||a.push(p(t,e,r,n,o,!0))})),a}(t,r,n,s,i):i.map((function(e){return p(t,r,n,s,e,h)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,u,I)):I[0]+u+I[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,o,a){var i,s,l;if((l=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),L(n,o)||(i="["+o+"]"),s||(t.seen.indexOf(l.value)<0?(s=y(r)?f(t,l.value,null):f(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),b(i)){if(a&&o.match(/^\d+$/))return s;(i=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.slice(1,-1),i=t.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=t.stylize(i,"string"))}return i+": "+s}function g(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function y(t){return null===t}function S(t){return"number"==typeof t}function A(t){return"string"==typeof t}function b(t){return void 0===t}function E(t){return I(t)&&"[object RegExp]"===T(t)}function I(t){return"object"==typeof t&&null!==t}function w(t){return I(t)&&"[object Date]"===T(t)}function v(t){return I(t)&&("[object Error]"===T(t)||t instanceof Error)}function M(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function C(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(s.test(t)){var r=n.pid;i[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else i[t]=function(){};return i[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(955),e.isArray=g,e.isBoolean=m,e.isNull=y,e.isNullOrUndefined=function(t){return null==t},e.isNumber=S,e.isString=A,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=E,e.types.isRegExp=E,e.isObject=I,e.isDate=w,e.types.isDate=w,e.isError=v,e.types.isNativeError=v,e.isFunction=M,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[C((t=new Date).getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":"),[t.getDate(),D[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(717),e._extend=function(t,e){if(!e||!I(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var _="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function U(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(_&&t[_]){var e;if("function"!=typeof(e=t[_]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,_,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],a=0;a<arguments.length;a++)o.push(arguments[a]);o.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),_&&Object.defineProperty(e,_,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,o(t))},e.promisify.custom=_,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var o=e.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var a=this,i=function(){return o.apply(a,arguments)};t.apply(this,e).then((function(t){n.nextTick(i.bind(null,null,t))}),(function(t){n.nextTick(U.bind(null,t,i))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,o(t)),e}},430:(t,e,r)=>{"use strict";var n=r(29),o=r(83),a=r(559),i=r(924),s=r(275),l=i("Object.prototype.toString"),c=r(410)(),u="undefined"==typeof globalThis?r.g:globalThis,h=o(),f=i("String.prototype.slice"),d=Object.getPrototypeOf,p=i("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},g={__proto__:null};n(h,c&&s&&d?function(t){var e=new u[t];if(Symbol.toStringTag in e){var r=d(e),n=s(r,Symbol.toStringTag);if(!n){var o=d(r);n=s(o,Symbol.toStringTag)}g["$"+t]=a(n.get)}}:function(t){var e=new u[t],r=e.slice||e.set;r&&(g["$"+t]=a(r))}),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!c){var e=f(l(t),8,-1);return p(h,e)>-1?e:"Object"===e&&function(t){var e=!1;return n(g,(function(r,n){if(!e)try{r(t),e=f(n,1)}catch(t){}})),e}(t)}return s?function(t){var e=!1;return n(g,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=f(n,1))}catch(t){}})),e}(t):null}},382:(t,e,r)=>{var n=r(764).Buffer;function o(t,e){this.buffer=t,this.position=0,this.isBigEndian=e||!1}function a(t,e,r){return function(){var n;return n=this.isBigEndian?e.call(this.buffer,this.position):t.call(this.buffer,this.position),this.position+=r,n}}t.exports=o,o.prototype.readUInt8=a(n.prototype.readUInt8,n.prototype.readUInt8,1),o.prototype.readUInt16=a(n.prototype.readUInt16LE,n.prototype.readUInt16BE,2),o.prototype.readUInt32=a(n.prototype.readUInt32LE,n.prototype.readUInt32BE,4),o.prototype.readInt8=a(n.prototype.readInt8,n.prototype.readInt8,1),o.prototype.readInt16=a(n.prototype.readInt16LE,n.prototype.readInt16BE,2),o.prototype.readInt32=a(n.prototype.readInt32LE,n.prototype.readInt32BE,4),o.prototype.readFloat=a(n.prototype.readFloatLE,n.prototype.readFloatBE,4),o.prototype.readDouble=a(n.prototype.readDoubleLE,n.prototype.readDoubleBE,8),o.prototype.readVarInt=function(){var t,e=0,r=0;do{e+=(127&(t=this.buffer[this.position+r]))<<7*r,r++}while(t>=128);return this.position+=r,e}},659:(t,e,r)=>{var n=r(764).Buffer;function o(t,e){this.buffer=new n(t),this.position=0,this.allowResize=e}function a(t,e){return function(r,n){this.ensureSize(e),t.call(this.buffer,r,this.position,n),this.position+=e}}t.exports=o,o.prototype.writeUInt8=a(n.prototype.writeUInt8,1),o.prototype.writeUInt16LE=a(n.prototype.writeUInt16LE,2),o.prototype.writeUInt16BE=a(n.prototype.writeUInt16BE,2),o.prototype.writeUInt32LE=a(n.prototype.writeUInt32LE,4),o.prototype.writeUInt32BE=a(n.prototype.writeUInt32BE,4),o.prototype.writeInt8=a(n.prototype.writeInt8,1),o.prototype.writeInt16LE=a(n.prototype.writeInt16LE,2),o.prototype.writeInt16BE=a(n.prototype.writeInt16BE,2),o.prototype.writeInt32LE=a(n.prototype.writeInt32LE,4),o.prototype.writeInt32BE=a(n.prototype.writeInt32BE,4),o.prototype.writeFloatLE=a(n.prototype.writeFloatLE,4),o.prototype.writeFloatBE=a(n.prototype.writeFloatBE,4),o.prototype.writeDoubleLE=a(n.prototype.writeDoubleLE,8),o.prototype.writeDoubleBE=a(n.prototype.writeDoubleBE,8),o.prototype.writeBuffer=function(t){this.ensureSize(t.length),t.copy(this.buffer,this.position,0,t.length),this.position+=t.length},o.prototype.writeVarInt=function(t){for(var e=1;0!=(4294967168&t);)this.writeUInt8(127&t|128),t>>>=7,e++;return this.writeUInt8(127&t),e},o.prototype.ensureSize=function(t){if(this.buffer.length<this.position+t){if(!this.allowResize)throw new RangeError("index out of range");var e=new n(this.position+t);this.buffer.copy(e,0,0,this.buffer.length),this.buffer=e}}},56:(t,e,r)=>{var n=r(764).Buffer;t.exports=m;var o=r(905),a=r(213),i=r(503),s=r(978),l=r(665),c=r(606),u=r(763),h=r(292),f=r(382),d=r(659),p=r(620),g=r(172);function m(){this.srid=void 0,this.hasZ=!1,this.hasM=!1}m.parse=function(t,e){if("string"==typeof t||t instanceof p)return m._parseWkt(t);if(n.isBuffer(t)||t instanceof f)return m._parseWkb(t,e);throw new Error("first argument must be a string or Buffer")},m._parseWkt=function(t){var e,r,n=(e=t instanceof p?t:new p(t)).matchRegex([/^SRID=(\d+);/]);n&&(r=parseInt(n[1],10));var f=e.matchType(),d=e.matchDimension(),g={srid:r,hasZ:d.hasZ,hasM:d.hasM};switch(f){case o.wkt.Point:return a._parseWkt(e,g);case o.wkt.LineString:return i._parseWkt(e,g);case o.wkt.Polygon:return s._parseWkt(e,g);case o.wkt.MultiPoint:return l._parseWkt(e,g);case o.wkt.MultiLineString:return c._parseWkt(e,g);case o.wkt.MultiPolygon:return u._parseWkt(e,g);case o.wkt.GeometryCollection:return h._parseWkt(e,g)}},m._parseWkb=function(t,e){var r,n,d,p={};switch((r=t instanceof f?t:new f(t)).isBigEndian=!r.readInt8(),n=r.readUInt32(),p.hasSrid=536870912==(536870912&n),p.isEwkb=536870912&n||1073741824&n||2147483648&n,p.hasSrid&&(p.srid=r.readUInt32()),p.hasZ=!1,p.hasM=!1,p.isEwkb||e&&e.isEwkb?(2147483648&n&&(p.hasZ=!0),1073741824&n&&(p.hasM=!0),d=15&n):n>=1e3&&n<2e3?(p.hasZ=!0,d=n-1e3):n>=2e3&&n<3e3?(p.hasM=!0,d=n-2e3):n>=3e3&&n<4e3?(p.hasZ=!0,p.hasM=!0,d=n-3e3):d=n,d){case o.wkb.Point:return a._parseWkb(r,p);case o.wkb.LineString:return i._parseWkb(r,p);case o.wkb.Polygon:return s._parseWkb(r,p);case o.wkb.MultiPoint:return l._parseWkb(r,p);case o.wkb.MultiLineString:return c._parseWkb(r,p);case o.wkb.MultiPolygon:return u._parseWkb(r,p);case o.wkb.GeometryCollection:return h._parseWkb(r,p);default:throw new Error("GeometryType "+d+" not supported")}},m.parseTwkb=function(t){var e,r={},n=(e=t instanceof f?t:new f(t)).readUInt8(),d=e.readUInt8(),p=15&n;if(r.precision=g.decode(n>>4),r.precisionFactor=Math.pow(10,r.precision),r.hasBoundingBox=d>>0&1,r.hasSizeAttribute=d>>1&1,r.hasIdList=d>>2&1,r.hasExtendedPrecision=d>>3&1,r.isEmpty=d>>4&1,r.hasExtendedPrecision){var m=e.readUInt8();r.hasZ=1==(1&m),r.hasM=2==(2&m),r.zPrecision=g.decode((28&m)>>2),r.zPrecisionFactor=Math.pow(10,r.zPrecision),r.mPrecision=g.decode((224&m)>>5),r.mPrecisionFactor=Math.pow(10,r.mPrecision)}else r.hasZ=!1,r.hasM=!1;if(r.hasSizeAttribute&&e.readVarInt(),r.hasBoundingBox){var y=2;r.hasZ&&y++,r.hasM&&y++;for(var S=0;S<y;S++)e.readVarInt(),e.readVarInt()}switch(p){case o.wkb.Point:return a._parseTwkb(e,r);case o.wkb.LineString:return i._parseTwkb(e,r);case o.wkb.Polygon:return s._parseTwkb(e,r);case o.wkb.MultiPoint:return l._parseTwkb(e,r);case o.wkb.MultiLineString:return c._parseTwkb(e,r);case o.wkb.MultiPolygon:return u._parseTwkb(e,r);case o.wkb.GeometryCollection:return h._parseTwkb(e,r);default:throw new Error("GeometryType "+p+" not supported")}},m.parseGeoJSON=function(t){return m._parseGeoJSON(t)},m._parseGeoJSON=function(t,e){var r;switch(t.type){case o.geoJSON.Point:r=a._parseGeoJSON(t);break;case o.geoJSON.LineString:r=i._parseGeoJSON(t);break;case o.geoJSON.Polygon:r=s._parseGeoJSON(t);break;case o.geoJSON.MultiPoint:r=l._parseGeoJSON(t);break;case o.geoJSON.MultiLineString:r=c._parseGeoJSON(t);break;case o.geoJSON.MultiPolygon:r=u._parseGeoJSON(t);break;case o.geoJSON.GeometryCollection:r=h._parseGeoJSON(t);break;default:throw new Error("GeometryType "+t.type+" not supported")}if(t.crs&&t.crs.type&&"name"===t.crs.type&&t.crs.properties&&t.crs.properties.name){var n=t.crs.properties.name;if(0===n.indexOf("EPSG:"))r.srid=parseInt(n.substring(5));else{if(0!==n.indexOf("urn:ogc:def:crs:EPSG::"))throw new Error("Unsupported crs: "+n);r.srid=parseInt(n.substring(22))}}else e||(r.srid=4326);return r},m.prototype.toEwkt=function(){return"SRID="+this.srid+";"+this.toWkt()},m.prototype.toEwkb=function(){var t=new d(this._getWkbSize()+4),e=this.toWkb();return t.writeInt8(1),t.writeUInt32LE((536870912|e.slice(1,5).readUInt32LE(0))>>>0,!0),t.writeUInt32LE(this.srid),t.writeBuffer(e.slice(5)),t.buffer},m.prototype._getWktType=function(t,e){var r=t;return this.hasZ&&this.hasM?r+=" ZM ":this.hasZ?r+=" Z ":this.hasM&&(r+=" M "),!e||this.hasZ||this.hasM||(r+=" "),e&&(r+="EMPTY"),r},m.prototype._getWktCoordinate=function(t){var e=t.x+" "+t.y;return this.hasZ&&(e+=" "+t.z),this.hasM&&(e+=" "+t.m),e},m.prototype._writeWkbType=function(t,e,r){var n=0;void 0!==this.srid||r&&void 0!==r.srid?(this.hasZ&&(n|=2147483648),this.hasM&&(n|=1073741824)):this.hasZ&&this.hasM?n+=3e3:this.hasZ?n+=1e3:this.hasM&&(n+=2e3),t.writeUInt32LE(n+e>>>0,!0)},m.getTwkbPrecision=function(t,e,r){return{xy:t,z:e,m:r,xyFactor:Math.pow(10,t),zFactor:Math.pow(10,e),mFactor:Math.pow(10,r)}},m.prototype._writeTwkbHeader=function(t,e,r,n){var o=(g.encode(r.xy)<<4)+e,a=(this.hasZ||this.hasM)<<3;if(a+=n<<4,t.writeUInt8(o),t.writeUInt8(a),this.hasZ||this.hasM){var i=0;this.hasZ&&(i|=1),this.hasM&&(i|=2),t.writeUInt8(i)}},m.prototype.toGeoJSON=function(t){var e={};return this.srid&&t&&(t.shortCrs?e.crs={type:"name",properties:{name:"EPSG:"+this.srid}}:t.longCrs&&(e.crs={type:"name",properties:{name:"urn:ogc:def:crs:EPSG::"+this.srid}})),e}},292:(t,e,r)=>{t.exports=s;var n=r(539),o=r(905),a=r(56),i=r(659);function s(t,e){a.call(this),this.geometries=t||[],this.srid=e,this.geometries.length>0&&(this.hasZ=this.geometries[0].hasZ,this.hasM=this.geometries[0].hasM)}n.inherits(s,a),s.Z=function(t,e){var r=new s(t,e);return r.hasZ=!0,r},s.M=function(t,e){var r=new s(t,e);return r.hasM=!0,r},s.ZM=function(t,e){var r=new s(t,e);return r.hasZ=!0,r.hasM=!0,r},s._parseWkt=function(t,e){var r=new s;if(r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"]))return r;t.expectGroupStart();do{r.geometries.push(a.parse(t))}while(t.isMatch([","]));return t.expectGroupEnd(),r},s._parseWkb=function(t,e){var r=new s;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;for(var n=t.readUInt32(),o=0;o<n;o++)r.geometries.push(a.parse(t,e));return r},s._parseTwkb=function(t,e){var r=new s;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=t.readVarInt(),o=0;o<n;o++)r.geometries.push(a.parseTwkb(t));return r},s._parseGeoJSON=function(t){for(var e=new s,r=0;r<t.geometries.length;r++)e.geometries.push(a._parseGeoJSON(t.geometries[r],!0));return e.geometries.length>0&&(e.hasZ=e.geometries[0].hasZ),e},s.prototype.toWkt=function(){if(0===this.geometries.length)return this._getWktType(o.wkt.GeometryCollection,!0);for(var t=this._getWktType(o.wkt.GeometryCollection,!1)+"(",e=0;e<this.geometries.length;e++)t+=this.geometries[e].toWkt()+",";return(t=t.slice(0,-1))+")"},s.prototype.toWkb=function(){var t=new i(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,o.wkb.GeometryCollection),t.writeUInt32LE(this.geometries.length);for(var e=0;e<this.geometries.length;e++)t.writeBuffer(this.geometries[e].toWkb({srid:this.srid}));return t.buffer},s.prototype.toTwkb=function(){var t=new i(0,!0),e=a.getTwkbPrecision(5,0,0),r=0===this.geometries.length;if(this._writeTwkbHeader(t,o.wkb.GeometryCollection,e,r),this.geometries.length>0){t.writeVarInt(this.geometries.length);for(var n=0;n<this.geometries.length;n++)t.writeBuffer(this.geometries[n].toTwkb())}return t.buffer},s.prototype._getWkbSize=function(){for(var t=9,e=0;e<this.geometries.length;e++)t+=this.geometries[e]._getWkbSize();return t},s.prototype.toGeoJSON=function(t){var e=a.prototype.toGeoJSON.call(this,t);e.type=o.geoJSON.GeometryCollection,e.geometries=[];for(var r=0;r<this.geometries.length;r++)e.geometries.push(this.geometries[r].toGeoJSON());return e}},503:(t,e,r)=>{t.exports=l;var n=r(539),o=r(56),a=r(905),i=r(213),s=r(659);function l(t,e){o.call(this),this.points=t||[],this.srid=e,this.points.length>0&&(this.hasZ=this.points[0].hasZ,this.hasM=this.points[0].hasM)}n.inherits(l,o),l.Z=function(t,e){var r=new l(t,e);return r.hasZ=!0,r},l.M=function(t,e){var r=new l(t,e);return r.hasM=!0,r},l.ZM=function(t,e){var r=new l(t,e);return r.hasZ=!0,r.hasM=!0,r},l._parseWkt=function(t,e){var r=new l;return r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"])||(t.expectGroupStart(),r.points.push.apply(r.points,t.matchCoordinates(e)),t.expectGroupEnd()),r},l._parseWkb=function(t,e){var r=new l;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;for(var n=t.readUInt32(),o=0;o<n;o++)r.points.push(i._readWkbPoint(t,e));return r},l._parseTwkb=function(t,e){var r=new l;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=new i(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),o=t.readVarInt(),a=0;a<o;a++)r.points.push(i._readTwkbPoint(t,e,n));return r},l._parseGeoJSON=function(t){var e=new l;t.coordinates.length>0&&(e.hasZ=t.coordinates[0].length>2);for(var r=0;r<t.coordinates.length;r++)e.points.push(i._readGeoJSONPoint(t.coordinates[r]));return e},l.prototype.toWkt=function(){return 0===this.points.length?this._getWktType(a.wkt.LineString,!0):this._getWktType(a.wkt.LineString,!1)+this._toInnerWkt()},l.prototype._toInnerWkt=function(){for(var t="(",e=0;e<this.points.length;e++)t+=this._getWktCoordinate(this.points[e])+",";return(t=t.slice(0,-1))+")"},l.prototype.toWkb=function(t){var e=new s(this._getWkbSize());e.writeInt8(1),this._writeWkbType(e,a.wkb.LineString,t),e.writeUInt32LE(this.points.length);for(var r=0;r<this.points.length;r++)this.points[r]._writeWkbPoint(e);return e.buffer},l.prototype.toTwkb=function(){var t=new s(0,!0),e=o.getTwkbPrecision(5,0,0),r=0===this.points.length;if(this._writeTwkbHeader(t,a.wkb.LineString,e,r),this.points.length>0){t.writeVarInt(this.points.length);for(var n=new i(0,0,0,0),l=0;l<this.points.length;l++)this.points[l]._writeTwkbPoint(t,e,n)}return t.buffer},l.prototype._getWkbSize=function(){var t=16;return this.hasZ&&(t+=8),this.hasM&&(t+=8),9+this.points.length*t},l.prototype.toGeoJSON=function(t){var e=o.prototype.toGeoJSON.call(this,t);e.type=a.geoJSON.LineString,e.coordinates=[];for(var r=0;r<this.points.length;r++)this.hasZ?e.coordinates.push([this.points[r].x,this.points[r].y,this.points[r].z]):e.coordinates.push([this.points[r].x,this.points[r].y]);return e}},606:(t,e,r)=>{t.exports=c;var n=r(539),o=r(905),a=r(56),i=r(213),s=r(503),l=r(659);function c(t,e){a.call(this),this.lineStrings=t||[],this.srid=e,this.lineStrings.length>0&&(this.hasZ=this.lineStrings[0].hasZ,this.hasM=this.lineStrings[0].hasM)}n.inherits(c,a),c.Z=function(t,e){var r=new c(t,e);return r.hasZ=!0,r},c.M=function(t,e){var r=new c(t,e);return r.hasM=!0,r},c.ZM=function(t,e){var r=new c(t,e);return r.hasZ=!0,r.hasM=!0,r},c._parseWkt=function(t,e){var r=new c;if(r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"]))return r;t.expectGroupStart();do{t.expectGroupStart(),r.lineStrings.push(new s(t.matchCoordinates(e))),t.expectGroupEnd()}while(t.isMatch([","]));return t.expectGroupEnd(),r},c._parseWkb=function(t,e){var r=new c;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;for(var n=t.readUInt32(),o=0;o<n;o++)r.lineStrings.push(a.parse(t,e));return r},c._parseTwkb=function(t,e){var r=new c;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=new i(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),o=t.readVarInt(),a=0;a<o;a++){var l=new s;l.hasZ=e.hasZ,l.hasM=e.hasM;for(var u=t.readVarInt(),h=0;h<u;h++)l.points.push(i._readTwkbPoint(t,e,n));r.lineStrings.push(l)}return r},c._parseGeoJSON=function(t){var e=new c;t.coordinates.length>0&&t.coordinates[0].length>0&&(e.hasZ=t.coordinates[0][0].length>2);for(var r=0;r<t.coordinates.length;r++)e.lineStrings.push(s._parseGeoJSON({coordinates:t.coordinates[r]}));return e},c.prototype.toWkt=function(){if(0===this.lineStrings.length)return this._getWktType(o.wkt.MultiLineString,!0);for(var t=this._getWktType(o.wkt.MultiLineString,!1)+"(",e=0;e<this.lineStrings.length;e++)t+=this.lineStrings[e]._toInnerWkt()+",";return(t=t.slice(0,-1))+")"},c.prototype.toWkb=function(){var t=new l(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,o.wkb.MultiLineString),t.writeUInt32LE(this.lineStrings.length);for(var e=0;e<this.lineStrings.length;e++)t.writeBuffer(this.lineStrings[e].toWkb({srid:this.srid}));return t.buffer},c.prototype.toTwkb=function(){var t=new l(0,!0),e=a.getTwkbPrecision(5,0,0),r=0===this.lineStrings.length;if(this._writeTwkbHeader(t,o.wkb.MultiLineString,e,r),this.lineStrings.length>0){t.writeVarInt(this.lineStrings.length);for(var n=new i(0,0,0,0),s=0;s<this.lineStrings.length;s++){t.writeVarInt(this.lineStrings[s].points.length);for(var c=0;c<this.lineStrings[s].points.length;c++)this.lineStrings[s].points[c]._writeTwkbPoint(t,e,n)}}return t.buffer},c.prototype._getWkbSize=function(){for(var t=9,e=0;e<this.lineStrings.length;e++)t+=this.lineStrings[e]._getWkbSize();return t},c.prototype.toGeoJSON=function(t){var e=a.prototype.toGeoJSON.call(this,t);e.type=o.geoJSON.MultiLineString,e.coordinates=[];for(var r=0;r<this.lineStrings.length;r++)e.coordinates.push(this.lineStrings[r].toGeoJSON().coordinates);return e}},665:(t,e,r)=>{t.exports=l;var n=r(539),o=r(905),a=r(56),i=r(213),s=r(659);function l(t,e){a.call(this),this.points=t||[],this.srid=e,this.points.length>0&&(this.hasZ=this.points[0].hasZ,this.hasM=this.points[0].hasM)}n.inherits(l,a),l.Z=function(t,e){var r=new l(t,e);return r.hasZ=!0,r},l.M=function(t,e){var r=new l(t,e);return r.hasM=!0,r},l.ZM=function(t,e){var r=new l(t,e);return r.hasZ=!0,r.hasM=!0,r},l._parseWkt=function(t,e){var r=new l;return r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"])||(t.expectGroupStart(),r.points.push.apply(r.points,t.matchCoordinates(e)),t.expectGroupEnd()),r},l._parseWkb=function(t,e){var r=new l;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;for(var n=t.readUInt32(),o=0;o<n;o++)r.points.push(a.parse(t,e));return r},l._parseTwkb=function(t,e){var r=new l;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=new i(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),o=t.readVarInt(),a=0;a<o;a++)r.points.push(i._readTwkbPoint(t,e,n));return r},l._parseGeoJSON=function(t){var e=new l;t.coordinates.length>0&&(e.hasZ=t.coordinates[0].length>2);for(var r=0;r<t.coordinates.length;r++)e.points.push(i._parseGeoJSON({coordinates:t.coordinates[r]}));return e},l.prototype.toWkt=function(){if(0===this.points.length)return this._getWktType(o.wkt.MultiPoint,!0);for(var t=this._getWktType(o.wkt.MultiPoint,!1)+"(",e=0;e<this.points.length;e++)t+=this._getWktCoordinate(this.points[e])+",";return(t=t.slice(0,-1))+")"},l.prototype.toWkb=function(){var t=new s(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,o.wkb.MultiPoint),t.writeUInt32LE(this.points.length);for(var e=0;e<this.points.length;e++)t.writeBuffer(this.points[e].toWkb({srid:this.srid}));return t.buffer},l.prototype.toTwkb=function(){var t=new s(0,!0),e=a.getTwkbPrecision(5,0,0),r=0===this.points.length;if(this._writeTwkbHeader(t,o.wkb.MultiPoint,e,r),this.points.length>0){t.writeVarInt(this.points.length);for(var n=new i(0,0,0,0),l=0;l<this.points.length;l++)this.points[l]._writeTwkbPoint(t,e,n)}return t.buffer},l.prototype._getWkbSize=function(){var t=16;return this.hasZ&&(t+=8),this.hasM&&(t+=8),t+=5,9+this.points.length*t},l.prototype.toGeoJSON=function(t){var e=a.prototype.toGeoJSON.call(this,t);e.type=o.geoJSON.MultiPoint,e.coordinates=[];for(var r=0;r<this.points.length;r++)e.coordinates.push(this.points[r].toGeoJSON().coordinates);return e}},763:(t,e,r)=>{t.exports=c;var n=r(539),o=r(905),a=r(56),i=r(213),s=r(978),l=r(659);function c(t,e){a.call(this),this.polygons=t||[],this.srid=e,this.polygons.length>0&&(this.hasZ=this.polygons[0].hasZ,this.hasM=this.polygons[0].hasM)}n.inherits(c,a),c.Z=function(t,e){var r=new c(t,e);return r.hasZ=!0,r},c.M=function(t,e){var r=new c(t,e);return r.hasM=!0,r},c.ZM=function(t,e){var r=new c(t,e);return r.hasZ=!0,r.hasM=!0,r},c._parseWkt=function(t,e){var r=new c;if(r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"]))return r;t.expectGroupStart();do{t.expectGroupStart();var n=[],o=[];for(t.expectGroupStart(),n.push.apply(n,t.matchCoordinates(e)),t.expectGroupEnd();t.isMatch([","]);)t.expectGroupStart(),o.push(t.matchCoordinates(e)),t.expectGroupEnd();r.polygons.push(new s(n,o)),t.expectGroupEnd()}while(t.isMatch([","]));return t.expectGroupEnd(),r},c._parseWkb=function(t,e){var r=new c;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;for(var n=t.readUInt32(),o=0;o<n;o++)r.polygons.push(a.parse(t,e));return r},c._parseTwkb=function(t,e){var r=new c;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=new i(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),o=t.readVarInt(),a=0;a<o;a++){var l=new s;l.hasZ=e.hasZ,l.hasM=e.hasM;for(var u=t.readVarInt(),h=t.readVarInt(),f=0;f<h;f++)l.exteriorRing.push(i._readTwkbPoint(t,e,n));for(f=1;f<u;f++){for(var d=[],p=t.readVarInt(),g=0;g<p;g++)d.push(i._readTwkbPoint(t,e,n));l.interiorRings.push(d)}r.polygons.push(l)}return r},c._parseGeoJSON=function(t){var e=new c;t.coordinates.length>0&&t.coordinates[0].length>0&&t.coordinates[0][0].length>0&&(e.hasZ=t.coordinates[0][0][0].length>2);for(var r=0;r<t.coordinates.length;r++)e.polygons.push(s._parseGeoJSON({coordinates:t.coordinates[r]}));return e},c.prototype.toWkt=function(){if(0===this.polygons.length)return this._getWktType(o.wkt.MultiPolygon,!0);for(var t=this._getWktType(o.wkt.MultiPolygon,!1)+"(",e=0;e<this.polygons.length;e++)t+=this.polygons[e]._toInnerWkt()+",";return(t=t.slice(0,-1))+")"},c.prototype.toWkb=function(){var t=new l(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,o.wkb.MultiPolygon),t.writeUInt32LE(this.polygons.length);for(var e=0;e<this.polygons.length;e++)t.writeBuffer(this.polygons[e].toWkb({srid:this.srid}));return t.buffer},c.prototype.toTwkb=function(){var t=new l(0,!0),e=a.getTwkbPrecision(5,0,0),r=0===this.polygons.length;if(this._writeTwkbHeader(t,o.wkb.MultiPolygon,e,r),this.polygons.length>0){t.writeVarInt(this.polygons.length);for(var n=new i(0,0,0,0),s=0;s<this.polygons.length;s++){t.writeVarInt(1+this.polygons[s].interiorRings.length),t.writeVarInt(this.polygons[s].exteriorRing.length);for(var c=0;c<this.polygons[s].exteriorRing.length;c++)this.polygons[s].exteriorRing[c]._writeTwkbPoint(t,e,n);for(c=0;c<this.polygons[s].interiorRings.length;c++){t.writeVarInt(this.polygons[s].interiorRings[c].length);for(var u=0;u<this.polygons[s].interiorRings[c].length;u++)this.polygons[s].interiorRings[c][u]._writeTwkbPoint(t,e,n)}}}return t.buffer},c.prototype._getWkbSize=function(){for(var t=9,e=0;e<this.polygons.length;e++)t+=this.polygons[e]._getWkbSize();return t},c.prototype.toGeoJSON=function(t){var e=a.prototype.toGeoJSON.call(this,t);e.type=o.geoJSON.MultiPolygon,e.coordinates=[];for(var r=0;r<this.polygons.length;r++)e.coordinates.push(this.polygons[r].toGeoJSON().coordinates);return e}},213:(t,e,r)=>{t.exports=l;var n=r(539),o=r(56),a=r(905),i=r(659),s=r(172);function l(t,e,r,n,a){o.call(this),this.x=t,this.y=e,this.z=r,this.m=n,this.srid=a,this.hasZ=void 0!==this.z,this.hasM=void 0!==this.m}n.inherits(l,o),l.Z=function(t,e,r,n){var o=new l(t,e,r,void 0,n);return o.hasZ=!0,o},l.M=function(t,e,r,n){var o=new l(t,e,void 0,r,n);return o.hasM=!0,o},l.ZM=function(t,e,r,n,o){var a=new l(t,e,r,n,o);return a.hasZ=!0,a.hasM=!0,a},l._parseWkt=function(t,e){var r=new l;if(r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"]))return r;t.expectGroupStart();var n=t.matchCoordinate(e);return r.x=n.x,r.y=n.y,r.z=n.z,r.m=n.m,t.expectGroupEnd(),r},l._parseWkb=function(t,e){var r=l._readWkbPoint(t,e);return r.srid=e.srid,r},l._readWkbPoint=function(t,e){return new l(t.readDouble(),t.readDouble(),e.hasZ?t.readDouble():void 0,e.hasM?t.readDouble():void 0)},l._parseTwkb=function(t,e){var r=new l;return r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty||(r.x=s.decode(t.readVarInt())/e.precisionFactor,r.y=s.decode(t.readVarInt())/e.precisionFactor,r.z=e.hasZ?s.decode(t.readVarInt())/e.zPrecisionFactor:void 0,r.m=e.hasM?s.decode(t.readVarInt())/e.mPrecisionFactor:void 0),r},l._readTwkbPoint=function(t,e,r){return r.x+=s.decode(t.readVarInt())/e.precisionFactor,r.y+=s.decode(t.readVarInt())/e.precisionFactor,e.hasZ&&(r.z+=s.decode(t.readVarInt())/e.zPrecisionFactor),e.hasM&&(r.m+=s.decode(t.readVarInt())/e.mPrecisionFactor),new l(r.x,r.y,r.z,r.m)},l._parseGeoJSON=function(t){return l._readGeoJSONPoint(t.coordinates)},l._readGeoJSONPoint=function(t){return 0===t.length?new l:t.length>2?new l(t[0],t[1],t[2]):new l(t[0],t[1])},l.prototype.toWkt=function(){return void 0===this.x&&void 0===this.y&&void 0===this.z&&void 0===this.m?this._getWktType(a.wkt.Point,!0):this._getWktType(a.wkt.Point,!1)+"("+this._getWktCoordinate(this)+")"},l.prototype.toWkb=function(t){var e=new i(this._getWkbSize());return e.writeInt8(1),this._writeWkbType(e,a.wkb.Point,t),void 0===this.x&&void 0===this.y?(e.writeDoubleLE(NaN),e.writeDoubleLE(NaN),this.hasZ&&e.writeDoubleLE(NaN),this.hasM&&e.writeDoubleLE(NaN)):this._writeWkbPoint(e),e.buffer},l.prototype._writeWkbPoint=function(t){t.writeDoubleLE(this.x),t.writeDoubleLE(this.y),this.hasZ&&t.writeDoubleLE(this.z),this.hasM&&t.writeDoubleLE(this.m)},l.prototype.toTwkb=function(){var t=new i(0,!0),e=o.getTwkbPrecision(5,0,0),r=void 0===this.x&&void 0===this.y;return this._writeTwkbHeader(t,a.wkb.Point,e,r),r||this._writeTwkbPoint(t,e,new l(0,0,0,0)),t.buffer},l.prototype._writeTwkbPoint=function(t,e,r){var n=this.x*e.xyFactor,o=this.y*e.xyFactor,a=this.z*e.zFactor,i=this.m*e.mFactor;t.writeVarInt(s.encode(n-r.x)),t.writeVarInt(s.encode(o-r.y)),this.hasZ&&t.writeVarInt(s.encode(a-r.z)),this.hasM&&t.writeVarInt(s.encode(i-r.m)),r.x=n,r.y=o,r.z=a,r.m=i},l.prototype._getWkbSize=function(){var t=21;return this.hasZ&&(t+=8),this.hasM&&(t+=8),t},l.prototype.toGeoJSON=function(t){var e=o.prototype.toGeoJSON.call(this,t);return e.type=a.geoJSON.Point,void 0===this.x&&void 0===this.y?e.coordinates=[]:void 0!==this.z?e.coordinates=[this.x,this.y,this.z]:e.coordinates=[this.x,this.y],e}},978:(t,e,r)=>{t.exports=l;var n=r(539),o=r(56),a=r(905),i=r(213),s=r(659);function l(t,e,r){o.call(this),this.exteriorRing=t||[],this.interiorRings=e||[],this.srid=r,this.exteriorRing.length>0&&(this.hasZ=this.exteriorRing[0].hasZ,this.hasM=this.exteriorRing[0].hasM)}n.inherits(l,o),l.Z=function(t,e,r){var n=new l(t,e,r);return n.hasZ=!0,n},l.M=function(t,e,r){var n=new l(t,e,r);return n.hasM=!0,n},l.ZM=function(t,e,r){var n=new l(t,e,r);return n.hasZ=!0,n.hasM=!0,n},l._parseWkt=function(t,e){var r=new l;if(r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM,t.isMatch(["EMPTY"]))return r;for(t.expectGroupStart(),t.expectGroupStart(),r.exteriorRing.push.apply(r.exteriorRing,t.matchCoordinates(e)),t.expectGroupEnd();t.isMatch([","]);)t.expectGroupStart(),r.interiorRings.push(t.matchCoordinates(e)),t.expectGroupEnd();return t.expectGroupEnd(),r},l._parseWkb=function(t,e){var r=new l;r.srid=e.srid,r.hasZ=e.hasZ,r.hasM=e.hasM;var n=t.readUInt32();if(n>0){for(var o=t.readUInt32(),a=0;a<o;a++)r.exteriorRing.push(i._readWkbPoint(t,e));for(a=1;a<n;a++){for(var s=[],c=t.readUInt32(),u=0;u<c;u++)s.push(i._readWkbPoint(t,e));r.interiorRings.push(s)}}return r},l._parseTwkb=function(t,e){var r=new l;if(r.hasZ=e.hasZ,r.hasM=e.hasM,e.isEmpty)return r;for(var n=new i(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),o=t.readVarInt(),a=t.readVarInt(),s=0;s<a;s++)r.exteriorRing.push(i._readTwkbPoint(t,e,n));for(s=1;s<o;s++){for(var c=[],u=t.readVarInt(),h=0;h<u;h++)c.push(i._readTwkbPoint(t,e,n));r.interiorRings.push(c)}return r},l._parseGeoJSON=function(t){var e=new l;t.coordinates.length>0&&t.coordinates[0].length>0&&(e.hasZ=t.coordinates[0][0].length>2);for(var r=0;r<t.coordinates.length;r++){r>0&&e.interiorRings.push([]);for(var n=0;n<t.coordinates[r].length;n++)0===r?e.exteriorRing.push(i._readGeoJSONPoint(t.coordinates[r][n])):e.interiorRings[r-1].push(i._readGeoJSONPoint(t.coordinates[r][n]))}return e},l.prototype.toWkt=function(){return 0===this.exteriorRing.length?this._getWktType(a.wkt.Polygon,!0):this._getWktType(a.wkt.Polygon,!1)+this._toInnerWkt()},l.prototype._toInnerWkt=function(){for(var t="((",e=0;e<this.exteriorRing.length;e++)t+=this._getWktCoordinate(this.exteriorRing[e])+",";for(t=t.slice(0,-1),t+=")",e=0;e<this.interiorRings.length;e++){t+=",(";for(var r=0;r<this.interiorRings[e].length;r++)t+=this._getWktCoordinate(this.interiorRings[e][r])+",";t=t.slice(0,-1),t+=")"}return t+")"},l.prototype.toWkb=function(t){var e=new s(this._getWkbSize());e.writeInt8(1),this._writeWkbType(e,a.wkb.Polygon,t),this.exteriorRing.length>0?(e.writeUInt32LE(1+this.interiorRings.length),e.writeUInt32LE(this.exteriorRing.length)):e.writeUInt32LE(0);for(var r=0;r<this.exteriorRing.length;r++)this.exteriorRing[r]._writeWkbPoint(e);for(r=0;r<this.interiorRings.length;r++){e.writeUInt32LE(this.interiorRings[r].length);for(var n=0;n<this.interiorRings[r].length;n++)this.interiorRings[r][n]._writeWkbPoint(e)}return e.buffer},l.prototype.toTwkb=function(){var t=new s(0,!0),e=o.getTwkbPrecision(5,0,0),r=0===this.exteriorRing.length;if(this._writeTwkbHeader(t,a.wkb.Polygon,e,r),this.exteriorRing.length>0){t.writeVarInt(1+this.interiorRings.length),t.writeVarInt(this.exteriorRing.length);for(var n=new i(0,0,0,0),l=0;l<this.exteriorRing.length;l++)this.exteriorRing[l]._writeTwkbPoint(t,e,n);for(l=0;l<this.interiorRings.length;l++){t.writeVarInt(this.interiorRings[l].length);for(var c=0;c<this.interiorRings[l].length;c++)this.interiorRings[l][c]._writeTwkbPoint(t,e,n)}}return t.buffer},l.prototype._getWkbSize=function(){var t=16;this.hasZ&&(t+=8),this.hasM&&(t+=8);var e=9;this.exteriorRing.length>0&&(e+=4+this.exteriorRing.length*t);for(var r=0;r<this.interiorRings.length;r++)e+=4+this.interiorRings[r].length*t;return e},l.prototype.toGeoJSON=function(t){var e=o.prototype.toGeoJSON.call(this,t);if(e.type=a.geoJSON.Polygon,e.coordinates=[],this.exteriorRing.length>0){for(var r=[],n=0;n<this.exteriorRing.length;n++)this.hasZ?r.push([this.exteriorRing[n].x,this.exteriorRing[n].y,this.exteriorRing[n].z]):r.push([this.exteriorRing[n].x,this.exteriorRing[n].y]);e.coordinates.push(r)}for(var i=0;i<this.interiorRings.length;i++){for(var s=[],l=0;l<this.interiorRings[i].length;l++)this.hasZ?s.push([this.interiorRings[i][l].x,this.interiorRings[i][l].y,this.interiorRings[i][l].z]):s.push([this.interiorRings[i][l].x,this.interiorRings[i][l].y]);e.coordinates.push(s)}return e}},905:t=>{t.exports={wkt:{Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION"},wkb:{Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6,GeometryCollection:7},geoJSON:{Point:"Point",LineString:"LineString",Polygon:"Polygon",MultiPoint:"MultiPoint",MultiLineString:"MultiLineString",MultiPolygon:"MultiPolygon",GeometryCollection:"GeometryCollection"}}},620:(t,e,r)=>{t.exports=a;var n=r(905),o=r(213);function a(t){this.value=t,this.position=0}a.prototype.match=function(t){this.skipWhitespaces();for(var e=0;e<t.length;e++)if(0===this.value.substring(this.position).indexOf(t[e]))return this.position+=t[e].length,t[e];return null},a.prototype.matchRegex=function(t){this.skipWhitespaces();for(var e=0;e<t.length;e++){var r=this.value.substring(this.position).match(t[e]);if(r)return this.position+=r[0].length,r}return null},a.prototype.isMatch=function(t){this.skipWhitespaces();for(var e=0;e<t.length;e++)if(0===this.value.substring(this.position).indexOf(t[e]))return this.position+=t[e].length,!0;return!1},a.prototype.matchType=function(){var t=this.match([n.wkt.Point,n.wkt.LineString,n.wkt.Polygon,n.wkt.MultiPoint,n.wkt.MultiLineString,n.wkt.MultiPolygon,n.wkt.GeometryCollection]);if(!t)throw new Error("Expected geometry type");return t},a.prototype.matchDimension=function(){switch(this.match(["ZM","Z","M"])){case"ZM":return{hasZ:!0,hasM:!0};case"Z":return{hasZ:!0,hasM:!1};case"M":return{hasZ:!1,hasM:!0};default:return{hasZ:!1,hasM:!1}}},a.prototype.expectGroupStart=function(){if(!this.isMatch(["("]))throw new Error("Expected group start")},a.prototype.expectGroupEnd=function(){if(!this.isMatch([")"]))throw new Error("Expected group end")},a.prototype.matchCoordinate=function(t){var e;if(!(e=t.hasZ&&t.hasM?this.matchRegex([/^(\S*)\s+(\S*)\s+(\S*)\s+([^\s,)]*)/]):t.hasZ||t.hasM?this.matchRegex([/^(\S*)\s+(\S*)\s+([^\s,)]*)/]):this.matchRegex([/^(\S*)\s+([^\s,)]*)/])))throw new Error("Expected coordinates");return t.hasZ&&t.hasM?new o(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4])):t.hasZ?new o(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])):t.hasM?new o(parseFloat(e[1]),parseFloat(e[2]),void 0,parseFloat(e[3])):new o(parseFloat(e[1]),parseFloat(e[2]))},a.prototype.matchCoordinates=function(t){var e=[];do{var r=this.isMatch(["("]);e.push(this.matchCoordinate(t)),r&&this.expectGroupEnd()}while(this.isMatch([","]));return e},a.prototype.skipWhitespaces=function(){for(;this.position<this.value.length&&" "===this.value[this.position];)this.position++}},11:(t,e,r)=>{e.Types=r(905),e.Geometry=r(56),e.Point=r(213),e.LineString=r(503),e.Polygon=r(978),e.MultiPoint=r(665),e.MultiLineString=r(606),e.MultiPolygon=r(763),e.GeometryCollection=r(292)},172:t=>{t.exports={encode:function(t){return t<<1^t>>31},decode:function(t){return t>>1^-(1&t)}}},83:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],o="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof o[n[e]]&&(t[t.length]=n[e]);return t}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.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";r.r(n),r.d(n,{BOTTOM_GRID:()=>i,CENTER_VALENCIA:()=>y,COLORS:()=>g,DAY_VALUE:()=>d,DEFAULT_NAME_MARGIN_Y:()=>f,DIVSIZE:()=>m,HEIGH_GRID:()=>c,IDIOMA:()=>t,LEFT_GRID:()=>o,NAME_MARGIN_Y_BARRIOS:()=>Dr,NIGHT_VALUE:()=>p,RIGTH_GRID:()=>a,RIGTH_TOOLBOX:()=>u,TOP_GRID:()=>s,TOP_GRID_SIN_LEYENDA:()=>l,TOP_LEGEND:()=>e,TOP_TOOLBOX:()=>h,addDatesToGaps:()=>Lt,addPointInteger:()=>b,calcularRuta:()=>ct,calculateXAxisMonth:()=>E,calculateXAxisStart:()=>It,calculateXAxisYear:()=>I,changeImg:()=>st,chargeData:()=>ze,clearInputs:()=>Re,closeFilter:()=>it,closePopUp:()=>ot,commonPostFetch:()=>Q,configureDataGaugeMonth:()=>K,configureDataLine:()=>q,configureGaugeYearBig:()=>Mt,createChart:()=>Hn,createCheckBoxFilter:()=>ft,createCheckBoxFilterVar:()=>pt,createGauge:()=>H,createLeafletMap:()=>Qt,createLeafletMapPolygon:()=>Xt,createObjectMarkerElements:()=>te,createSerie:()=>Ve,drawMarkers:()=>re,drawMarkersPolygon:()=>ne,echartAccesosBarYear:()=>ce,echartAccesosGaugeMonth:()=>he,echartAccesosGaugeVehicles:()=>jt,echartAccesosGaugeYear:()=>de,echartAccesosHorStackedBarVehicles:()=>Ht,echartAccesosLineMonth:()=>ge,echartAccesosPieVehicles:()=>Jt,echartAccesosVerStackedBarVehicles:()=>qt,echartAccessosCiutat:()=>_t,echartAcessosAnellCiclista:()=>ie,echartAiguaBarMonth:()=>Wr,echartAiguaGaugeSemicircle:()=>Zr,echartAiguaRelojSemicircle:()=>Jr,echartAiguaStackedBarYears:()=>Hr,echartAltUsuarisDiaries:()=>ro,echartAnellBarYear:()=>le,echartAnellCiclista:()=>se,echartAnellGaugeMonth:()=>ue,echartAnellGaugeYear:()=>fe,echartAnellLineMonth:()=>pe,echartBarrisBarYear:()=>qr,echartBarrisGaugeMonth:()=>tn,echartBarrisGaugeYear:()=>Qr,echartBarrisLineMonth:()=>Kr,echartBenimamet:()=>Nr,echartConectadosGaugeMonth:()=>no,echartConectadosGaugeYear:()=>oo,echartConectadosHorStackedBar:()=>io,echartConectadosVerStackedBar:()=>so,echartConsumAguaBarris:()=>kr,echartConsumTotalAgua:()=>Pr,echartDesKgsBar:()=>gn,echartDesKgsGauge:()=>dn,echartDesKgsHorStackedBar:()=>cn,echartDesKgsPerTipusResidu:()=>an,echartDesKgsPie:()=>mn,echartDesKgsStackedBar:()=>un,echartExposicio:()=>xr,echartGaugeMonth:()=>x,echartGaugeYear:()=>B,echartInstancesSeuElectronicaBarMonth:()=>bn,echartInstancesSeuElectronicaRelojSemicircle:()=>vn,echartInstancesSeuElectronicaStackedBarYears:()=>Cn,echartInstanciesDonadesAlta:()=>Ln,echartInstanciesSeuElectronica:()=>An,echartIntensidadAnualCiclista:()=>Ae,echartIntensidadDiarialCiclista:()=>Ee,echartIntensidadMensualCiclista:()=>be,echartIntensidadRealTimeCiclista:()=>Ie,echartKgsResidus:()=>en,echartKgsResidusBarMonth:()=>pn,echartKgsResidusRelojSemicircle:()=>hn,echartKgsResidusStackedBarYears:()=>ln,echartLine:()=>vt,echartLineLinia:()=>We,echartLineTitol:()=>Ye,echartMalilla:()=>$r,echartMestalla:()=>Gr,echartNO:()=>Er,echartNO2:()=>br,echartNOX:()=>Ir,echartNotificacionsTelematic:()=>Un,echartO3:()=>vr,echartPIAEDonadesAltaBarMonth:()=>jn,echartPIAEDonadesAltaGaugeMonth:()=>Wn,echartPIAEDonadesAltaGaugeYear:()=>Zn,echartPIAEDonadesAltaStackedBarYears:()=>Yn,echartPM1:()=>Mr,echartPM10:()=>Ar,echartPM25:()=>Tr,echartPerellonet:()=>Vr,echartPuntosMedidaBicis:()=>ye,echartPuntosMedidaTrafico:()=>ae,echartResolucionsAssentades:()=>_n,echartSO2:()=>wr,echartSeuElectronica:()=>Sn,echartSeuElectronicaBarMonth:()=>En,echartSeuElectronicaRelojSemicircle:()=>Mn,echartSeuElectronicaStackedBarYears:()=>Dn,echartSonometroManana:()=>Xn,echartSonometroNoche:()=>to,echartSonometroTarde:()=>Qn,echartSotenis:()=>Yr,echartTemperatureMitjanaDiaria:()=>Jn,echartUsuarisConectadosDiaries:()=>ao,echartUsuarisPerLinea:()=>fr,echartUsuarisPerLiniaBarYear:()=>yr,echartUsuarisPerLiniaGaugeMonth:()=>nr,echartUsuarisPerLiniaGaugeYear:()=>er,echartUsuarisPerLiniaLineMonth:()=>gr,echartUsuarisPerTitol:()=>ur,echartUsuarisPerTitolBarYear:()=>mr,echartUsuarisPerTitolGaugeMonth:()=>rr,echartUsuarisPerTitolGaugeYear:()=>tr,echartUsuarisPerTitolLineMonth:()=>pr,echartUsuarisTotals:()=>lr,echartUsuarisTotalsBarMonth:()=>Le,echartUsuarisTotalsGaugeMonth:()=>ir,echartUsuarisTotalsGaugeYear:()=>Qe,echartUsuarisTotalsStackedBarYears:()=>sr,echartVerStackedBar:()=>R,echartVieBarYear:()=>Zt,echartVieGaugeMonth:()=>Bt,echartVieGaugeYear:()=>Yt,echartVieLineMonth:()=>Wt,echartViePrincCiutat:()=>kt,echartYearInstancesSeuElectronicaGaugeSemicircle:()=>In,echartYearKgsResidusGaugeSemicircle:()=>fn,echartYearSeuElectronicaGaugeSemicircle:()=>wn,filterData:()=>He,filterDatesUpdate:()=>Be,filterEMT1Update:()=>xe,filterEMT2Update:()=>$e,filterVarUpdate:()=>dt,filterWindow:()=>at,formatDDMM:()=>bt,formatName:()=>J,formatRoundTooltip:()=>G,formatSixDigitDate:()=>yt,formatTooltip:()=>w,formatearFecha:()=>At,formatoFecha:()=>gt,formatoFecha2:()=>mt,formatoFecha3:()=>St,formatterReloj:()=>k,generateDatesArray:()=>Dt,getCommonOptionDonut:()=>V,getCommonOptionGaugeUmbral:()=>z,getCommonOptionPie:()=>j,getCommonOptions:()=>P,getCommonOptionsBar:()=>F,getCommonOptionsGaugeMonth:()=>Z,getCommonOptionsGaugeYears:()=>W,getCommonOptionsLimited:()=>_r,getConfigurationGaugeYears:()=>Y,getDateFromStr:()=>Tt,getMaxValue:()=>O,getMonth:()=>T,getMonthComplete:()=>C,getStringFromDate:()=>Ct,getTime:()=>Et,getWidthElementChart:()=>N,handlerActivarFiltro:()=>Ze,handlerDesactivarFiltro:()=>Je,includeHTMLCabecera:()=>tt,includeHTMLFooter:()=>rt,includeHTMLMenu:()=>et,indoPopUp:()=>nt,initChart:()=>X,initStackedBarChartSedeElec:()=>Tn,listeneresAgua:()=>Ur,listeneresContamina:()=>Cr,listeneresEMT:()=>qe,listeneresVehicles:()=>Nt,llamadasIniciales:()=>ht,loadAnaliticaFrames:()=>lo,loadMap:()=>eo,mapPuntosMedidaBicis:()=>me,mapPuntosMedidaTrafico:()=>oe,normalImg:()=>lt,obtenerGeoJson:()=>ee,obtenerRuta:()=>ut,prepareData:()=>Lr,printDataChart:()=>_,printNoDataChart:()=>D,setDOMData:()=>Ce,splitData:()=>U,tableAcceso:()=>Pt,tableVariacio:()=>Rt,tableVias:()=>xt,tramosBicis:()=>De,usdEmtUsuarisPerLinea:()=>dr,usdEmtUsuarisPerTitol:()=>hr,usdEmtUsuarisTotals:()=>cr,xAxisFormatWithoutYear:()=>wt,yAxisFormat:()=>v});const t="ca_ES",e="8%",o="2.5%",a="5%",i="18%",s="20%",l="10%",c="90%",u="1%",h="0%",f=0,d=65,p=55,g=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],m=33,y=[39.46975,-.37739],S=27,A=30;function b(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const r={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",r):t.toLocaleString(e,r)}function E(t){return 100*(1-17/t)}function I(t){return 100*(1-7/t)}function w(t,e=!1){let r=`<p>${t[0].name}</p>`;return t.forEach((t=>{const n=e?Math.round(t.data):t.data,o=`<div>${a=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${a}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?b(n):"-"}</strong></div>`;var a;r+=o})),r}function v(t){return b(t)}function M(){const t=$("#formFilterDates").find("input");$(t).each(((t,e)=>{e.checked&&(e.checked=!1)}));const e=$("#formFilterVar").find("input");$(e).each(((t,e)=>{e.checked&&(e.checked=!1)})),function(){let t=0;const e=$("#formFilterDates").find("input");$(e).each(((e,r)=>{t+=1,r.checked=!0})),t=0;const r=$("#formFilterVar").find("input");$(r).each(((e,r)=>{t+=1,null!=render_tableVariacio?t<=2&&(r.checked=!0):t<=3&&(r.checked=!0)})),Dashboards.getParameterValue("filterVarParam").length>0&&Dashboards.fireChange("filterVarParam")}()}function T(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())]}function C(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 D(t,e){const r=t?document.querySelector(t):null,n=e?document.querySelector(e):null;r&&(r.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function _(t,e){const r=t?document.querySelector(t):null,n=e?document.querySelector(e):null;r&&(r.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function U(t,e){return t.reduce(((t,r)=>{const n=r[e];return t[n]||(t[n]=[]),t[n].push(r),t}),{})}function O(t,e,r=1){const n=Math.max(...t.map((t=>t[e])))*r;return 5e3*Math.ceil(n/5e3)}function N(t){return Math.round(document.getElementById(t).offsetWidth/m)}function k(t,e,r){const n=b(Math.round(e)),o=T(t[r][0]),a=t[r][1],i=`\n\n\n${o} ${a} : ${n}`,s=`${n}\n${o} ${a}`;return window.innerWidth<=1710?i:s}function P(t,r,n,f,d,p,g,m=5,y="",S=d,A=100,b,E=void 0,I=void 0){return{title:{text:y,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>w(t),textStyle:{fontFamily:"Montserrat"}},legend:r?{type:"plain",data:r,textStyle:{fontFamily:"Montserrat"},top:E||e,selected:b}:null,grid:{left:o,right:a,bottom:i,top:r?E?"30%":s:l,heigh:c,containLabel:!0},xAxis:{type:"category",data:n,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,g]},type:"value",scale:!0,min:I,axisLabel:{margin:m,formatter:v,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:t,dataZoom:[{show:p,data:n,start:S,end:A,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:p,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:u,top:h}}}function R(t,e,r,n,l="",u="total",h=0,f=1,d=2,p=g){if(0===r.length)D(`#${t}`,`#${e}`);else{_(`#${e}`,`#${t}`);const g=[];let m=U(r,h);const y=new Set(r.map((t=>t[f]))),S=Object.keys(m);y.forEach((t=>{S.forEach((e=>{void 0===m[e].find((e=>e[f]===t))&&(m[e].push([m[e][0][h],t,void 0]),m[e][0][1].length>4?m[e].sort(((t,e)=>{const[r,n]=t[1].split("/"),[o,a]=e[1].split("/"),i=new Date(n,r-1,1),s=new Date(a,o-1,1);return i.getTime()-s.getTime()})):m[e].sort())}))}));const A=Object.entries(m).sort(((t,e)=>t[0].localeCompare(e[0]))),M=""===u?90:0;m=Object.fromEntries(A),Object.keys(m).forEach((t=>{g.push({name:t,type:"bar",stack:u,label:{show:!0,fontFamily:"Montserrat",rotate:M,formatter:t=>b(Math.round(t.value))},emphasis:{focus:"series"},data:m[t].map((t=>t[d]))})}));const T=""!==u?E(y.size):I(y.size);X(t,{color:p,title:{text:l,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>w(t,!0)},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:o,right:a,bottom:i,top:s,heigh:c,containLabel:!0},yAxis:{type:"value",splitNumber:4,name:n,nameLocation:"end",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666"},axisLabel:{formatter:v,textStyle:{fontSize:8,fontFamily:"Montserrat",color:"#666"}}},xAxis:{type:"category",data:[...y],axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:g,toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50},dataZoom:[{show:!0,data:[...y],start:T,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)"}}}]})}}function x(t,e,r,n,o,a,i){if(0===o.length)D(`#${t}`,`#${r}`),D(`#${e}`,`#${n}`);else{_(`#${r}`,`#${t}`),_(`#${n}`,`#${e}`);const s=0,l=2,c=K(o,l,1),u=c[0],h=c[1],f=c[2],d=c[3],p=c[5],g=N(t),m=H(u,l,s,p,g),y=H(h,l,s,p,g);X(t,Y(`${a}${C(String(Object.keys(f)[1]))}`,d,m,g)),X(e,Y(`${i}${C(String(Object.keys(f)[0]))}`,d,y,g))}}function B(t,e,r,n){0===r.length?D(`#${t}`,`#${e}`):_(`#${e}`,`#${t}`);const o=O(r,1,1.1),a=N(t);let i=180;o>9999999&&(i=95);const s=H(r,1,0,i,a);X(t,Y(`${n} ${r[0][2]}`,o,s,a))}function F(t,e,r=-45,n="",o=e){const a=new Set,i=[];t.forEach((t=>{const e=t[0].toString().padStart(2,"0");a.add(`${e}/${t[1]}`),i.push(Math.round(t[2]))}));const s=i.length<100?40:80;return P({name:o,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:i},null,Array.from(a.values()),e,s,!0,r,25,n)}function G(t,e){const r=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${t.color};"></span>`;let n=`${t.name} : `;return n+=`<span style="font-weight:bold">${b(t.value)}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),r+n}function z(t,e,r,n){return{series:[{type:"gauge",center:["50%","50%"],startAngle:200,endAngle:-20,min:0,max:100,splitNumber:0,progress:{show:!1,width:5,itemStyle:{color:"#666"}},axisLine:{lineStyle:{width:18}},axisTick:{show:!1},splitLine:{length:15,lineStyle:{width:2,color:"#999"}},axisLabel:{distance:25,color:"#999",fontSize:20,show:!1},anchor:{show:!0,showAbove:!0,size:25,itemStyle:{borderWidth:10},show:!1},pointer:{show:!0,icon:"path://M12.8,0.7l12,40.1H0.7L12.8,0.7z",length:"12%",width:20,offsetCenter:[0,"-40%"],itemStyle:{color:"#ccc"}},axisLine:{lineStyle:{width:35,color:[[e,"#e56b6f"],[e+r,"#ffbf69"],[1,"#a1c483"]]}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},title:{show:!0,offsetCenter:[0,"45%"],textStyle:{color:"#000",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:15}},detail:{fontSize:30,offsetCenter:[0,"90%"],valueAnimation:!0,color:"#666",textStyle:{color:"#000",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:35}},data:[{value:t,name:n}]}]}}function V(t,e,r,n){return{tooltip:{trigger:"item",formatter:t=>G(t,!1),textStyle:{fontSize:13.5,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},title:{text:e,left:"center",top:"40%",textStyle:{fontSize:13.5,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{left:"center",bottom:"0%",textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},series:[{top:"0%",bottom:"15%",type:"pie",radius:r||["65%","75%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:5,borderColor:"#f1f1f1",borderWidth:1},label:{show:!1,position:"center",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},emphasis:{label:{show:!1,fontSize:20}},labelLine:{show:!1},color:n||["#fcb9b2","#ffd97d","#64a6bd","#98c9a3","#ff9b85"],data:t}]}}function j(t,e,r,n=g){return{textStyle:{fontFamily:"Montserrat"},title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:r-4,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"item",textStyle:{fontFamily:"Montserrat"},formatter:t=>G(t,!0)},legend:{orient:"horizontal",textStyle:{fontFamily:"Montserrat"},left:e.length>5?"10%":"12%",bottom:"10%",top:"65%",selectedMode:!1},series:[{type:"pie",radius:"33%",data:e,color:n,top:"-30%",emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:10,top:20}}}function Y(t,e,r,n){return{color:g,title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:n,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"},formatter:t=>G(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=>b(Math.round(t)),fontFamily:"Montserrat",color:"#666"},data:r,detail:{fontSize:n/1.2,color:"inherit",formatter:t=>b(Math.round(t))}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:S,top:A}}}function W(t,e="",r){const n=[],o=O(t,1,1.1),a=o.toString().length>=9?100:95,i=115===a?-45:-35;let s=t.length<5?t.length*i:-190;for(let e=0;e<t.length;e+=1)n.push({value:t[e][1],name:String(t[e][0]),title:{offsetCenter:[String(s),"20%"],fontFamily:"Montserrat"},detail:{offsetCenter:[String(s),"35%"],fontFamily:"Montserrat"}}),s+=a;return Y(e,o,n,r)}function Z(t,e,r="",n){return{title:{text:r,left:"center",top:"top",padding:10,textStyle:{fontSize:n,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:O(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=>b(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[-5,"-10%"],fontSize:n+5,fontWeight:"bolder",formatter:r=>k(t,r,e),fontFamily:"Montserrat",color:"inherit"},data:[{value:t[e][2]}]},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:S,top:A}}}function J(t){if(t.length>=29){const e=t.split(" ");let r="",n="";for(const t of e)`${r} ${t}`.length<=29?r+=(r?" ":"")+t:(n+=`${r}\n`,r=t);return n+=r,n}return t}function H(t,e,r,n,o){let a=20,i=35,s=-190,l=n;t.length<=2&&(s=-140,l+=100,a=25,i=42);const c=g.slice(),u=[];for(let n=0;n<t.length;n+=1)u.push({value:t[n][e],name:J(t[n][r]),color:c.shift(),title:{offsetCenter:[String(s),`${String(a)}%`],fontFamily:"Montserrat",fontSize:o-3},detail:{offsetCenter:[String(s),`${String(i)}%`],fontFamily:"Montserrat"}}),s+=l,(n+1)%3==0&&(i+=30,a+=30,s=-190);return u}function q(t,e,r=!1){const{resultset:n}={resultset:t},o=new Set,a=new Set,i=e,s=n.map((([t,e,n])=>{const i=r?Math.round(n):n;return o.add(t),a.add(e),{day:e,type:t,value:i}})),l=Array.from(a.values()),c=Array.from(o.values());return c.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[c.map((t=>{const e=s.filter((e=>e.type===t)).map((({day:e,value:r})=>[e,t,r])),r=l.map((t=>{const r=e.find((([e])=>e===t));return r?r[2]:null}));return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:r}})),a,c]}function K(t,e,r){const n=O(t,e,1.1);let o=50,a=180;n>9999999&&(o=65,a=95);const i=U(t,r);let[s,l]=Object.values(i);return Object.values(i).slice(1).forEach((t=>{l=t})),[l,s,i,n,o,a]}function X(t,e){const r=document.getElementById(t);if(!r)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const n=echarts.init(r);return n.setOption(e,!0),$(window).on("resize",(()=>{null!=n&&void 0!==n&&n.resize()})),n}function Q(){$("#chart2").css("width","100%")}function tt(){let t,e,r,n;const o=document.getElementsByTagName("*");for(t=0;t<o.length;t+=1)if(e=o[t],r=e.getAttribute("include-html-cabecera"),r)return n=new XMLHttpRequest,n.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(e.innerHTML=this.responseText),404===this.status&&(e.innerHTML="No se ha podido cargar correctamente."))},n.open("GET",r,!0),void n.send()}function et(t){let e,r,n,o;const a=document.getElementsByTagName("*");for(e=0;e<a.length;e+=1)if(r=a[e],n=r.getAttribute("include-html-menu"),n)return o=new XMLHttpRequest,o.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(r.innerHTML=this.responseText,$(t).removeClass("imgNavMenu"),$(t).addClass("imgNavMenuActive")),404===this.status&&(r.innerHTML="No se ha podido cargar correctamente."))},o.open("GET",n,!0),void o.send()}function rt(){let t,e,r,n;const o=document.getElementsByTagName("*");for(t=0;t<o.length;t+=1)if(e=o[t],r=e.getAttribute("include-html-footer"),r)return n=new XMLHttpRequest,n.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(e.innerHTML=this.responseText),404===this.status&&(e.innerHTML="No se ha podido cargar correctamente."))},n.open("GET",r,!0),void n.send()}function nt(){$("#idPopupInfo").show()}function ot(){$("#idPopupInfo").hide()}function at(){"none"===$("#layoutFilter").css("display")?$("#layoutFilter").show():$("#layoutFilter").hide()}function it(){$("#layoutFilter").hide()}function st(t,e){0!==t.childNodes[1].childNodes.length?$(`#${t.children[0].children[0].children[0].children[0].id}`).attr("src",`/pentaho/api/repos/%3Apublic%3Asc_valencia%3ACiutat%3Abuild%3Aimages/${t.children[0].children[0].children[0].children[0].src.split("/").pop().split(".")[0]}_hover.svg}`):t.children[0].src=`/pentaho/api/repos/%3Apublic%3Asc_valencia%3ACiutat%3Abuild%3Aimages%3A${e}_hover.svg/content`}function lt(t,e){0!=t.childNodes[1].childNodes.length?$(`#${t.children[0].children[0].children[0].children[0].id}`).attr("src",`/pentaho/api/repos/%3Apublic%3Asc_valencia%3ACiutat%3Abuild%3Aimages/${t.children[0].children[0].children[0].children[0].src.split("/").pop().split("_")[0]}.svg}`):t.children[0].src=`/pentaho/api/repos/%3Apublic%3Asc_valencia%3ACiutat%3Abuild%3Aimages%3A${e}.svg/content`}function ct(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 ut(t){return`${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 ht(t){$(document).click((()=>{const t=$("#layoutFilter");t.is(event.target)||t.has(event.target).length||t.hide()})),tt(),et(t),rt()}function ft(t,e,r){const n=$("#formFilterDates");if(""===Dashboards.getParameterValue("updateFilter")){const r=new Set;for(let n=t-1;n>0;--n)r.add(e[n]);for(const[t,e]of r.entries())n.append(`<input type="checkbox" id="${t}" onclick="legacy.filterDatesUpdate();" />${e}<br /></input>`);M(),function(){const t=$("#formFilterDates").find("input"),e=[];$(t).each(((t,r)=>{r.checked&&e.push(r.id)})),Dashboards.fireChange("filterDatesParam",e),Dashboards.fireChange("updateFilter","True")}()}}function dt(){const t=$("#idFilterVar").find("input"),e=[];$(t).each(((t,r)=>{r.checked&&e.push(r.id.replaceAll("/","-"))})),Dashboards.fireChange("filterVarParam",e),Dashboards.fireChange("updateFilterVar","True")}function pt(t,e){const r=$("#formFilterVar");if(""===Dashboards.getParameterValue("updateFilterVar")){for(let t=e.length-1;t>=0;t--)r.append(`<input type="checkbox" id="${e[t]}" onclick="legacy.filterVarUpdate();" />${e[t]}<br /></input>`);M(),dt()}}function gt(t){return t.replace(/^(\d{4})[-|\/](\d{2})[-|\/](\d{2})$/g,"$3/$2/$1")}function mt(t){return t.replace(/^(\d{4})(\d{2})(\d{2})$/g,"$3/$2/$1")}function yt(t){const e=`20${t.slice(0,2)}`,r=t.slice(2,4);return`${t.slice(4,6)}/${r}/${e}`}function St(t,e){const r=t.slice(0,2),n=t.slice(3,6);let o;return o=null==e?`20${t.slice(7,9)}`:`20${e.slice(5,7)}`,2===o.length&&(o="2022"),`${r}/${{Gen:"01",Feb:"02",Mar:"03",Abr:"04",Mai:"05",Jun:"06",Jul:"07",Ago:"08",Sep:"09",Oct:"10",Nov:"11",Des:"12"}[n]}/${o}`}function At(t){let e=t.getUTCDate().toString();1===e.length&&(e=`0${e}`);let r=(t.getMonth()+1).toString();return 1===r.length&&(r=`0${r}`),`${e}/${r}/${t.getFullYear().toString()}`}function bt(t){const e=t.slice(0,2);return`${t.slice(3,5)}/${e}`}function Et(t){const e=t.toString().match(/(\d{2}:\d{2})/);return e?e[1]:null}function It(t){return 100*(t-120)/t}function wt(t){return Array.from(t.values()).map((t=>{const[e,r]=t.split("/");return bt(t)}))}function vt(t,e,r,n,o,a,i,s,l=!1,c=!1,u=void 0,h=!0,f=g.slice(),d=!1,p=void 0,m=void 0){const y=t.resultset||t;if(0===y.length)D(`#${a}`,`#${i}`),s&&D(`#${s}`,`#${i}`);else{_(`#${i}`,`#${a}`),s&&_(`#${i}`,`#${s}`);const t=q(y,f,d),g=t[0],S=t[1],A=t[2],b=h?A:null,I=c?wt(S):Array.from(S.values());void 0===u&&(u=l?E(S.size):It(S.size)),X(a,P(g,b,I,o,u,e,r,void 0,n,void 0,void 0,void 0,p,m))}}function Mt(t,e,r=!1){const n=[],o=1.1*O(t,1);let a,i=50,s=250,l=20,c=30,u=-80;o>9999999&&(i=65,s=75);const h=r?4:3;for(let r=0;r<t.length;r+=1)a=String(t[r][0]).replace(/\[.*?\]/g,""),a=J(a),n.push({value:t[r][1],name:a,title:{offsetCenter:[`${String(u)}%`,`${String(l)}%`],fontFamily:"Montserrat",fontSize:e},detail:{offsetCenter:[`${String(u)}%`,`${String(c)}%`],fontFamily:"Montserrat",fontSize:e}}),u+=s,(r+1)%h==0&&(c+=30,l+=30,u=-80);return[o,n,i]}function Tt(t){const e=t.split("/"),r=parseInt(e[0],10),n=parseInt(e[1],10)-1,o=parseInt(e[2],10);return new Date(o,n,r)}function Ct(t){return`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${String(t.getFullYear())}`}function Dt(t,e){const r=[];for(;t<=e;){const e=Ct(t);r.push(e),t.setDate(t.getDate()+1)}return r}function Lt(t){const e=Array.from(t.keys(),(t=>Tt(t))),r=[],n=[],o=Dt(new Date(Math.min(...e)),new Date(Math.max(...e)));return o.forEach((e=>{if(t.has(e)){const r=t.get(e);n.push(r)}else n.push(null)})),r.push(o),r.push(n),r}function _t(t,e){vt(e,!0,-6,"TRÀNSIT DE VEHICLES: ACCESSOS A LA CIUTAT","Vehicles","chartAcessosCiutat","no_dataAcessosCiutat","idTableAcceso");const r=window.innerHeight>720?void 0:"5%",n=e.resultset,o=new Date(n[n.length-1][1].replace(/(\d{2})\/(\d{2})\/(\d{4})/,"$2/$1/$3")),a=new Date(o.getFullYear(),o.getMonth()-5,o.getDate()),i=n.filter((t=>new Date(t[1].replace(/(\d{2})\/(\d{2})\/(\d{4})/,"$2/$1/$3"))>=a)).map((t=>t[2]));vt(e,!1,-6,"TRÀNSIT DE VEHICLES: ACCESSOS A LA CIUTAT","Vehicles","chartTransitAccessosCiutat","no_dataAcessosCiutat",void 0,void 0,void 0,void 0,void 0,void 0,void 0,r,1e4*Math.floor(Math.min(...i)/1.1/1e4))}function Ut(){document.querySelector("#idFiltrar").style.visibility="visible"}function Ot(){document.querySelector("#idFiltrar").style.visibility="hidden"}function Nt(){render_tableVariacio.listeners=["filterVarParam","updateFilterVar"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter"),Dashboards.fireChange("updateFilterVar"),document.querySelector("#idVariacio").addEventListener("click",Ut),document.querySelector("#idAcessosCiutat").addEventListener("click",Ot),document.querySelector("#idViePrincCiutat").addEventListener("click",Ot)}function kt(t,e){vt(e,!0,f,"TRÀNSIT DE VEHICLES: VIES PRINCIPALS DE LA CIUTAT","Vehicles","chartViePrincCiutat","no_dataViePrincCiutat","idTableViaPri")}function Pt(t,e){const r=[];if(null!=e.resultset&&e.resultset.length>0)for(let t=0;t<e.resultset.length;t++){const n=`<div><img class="imgTabulator" src="build/Imagenes/camara.svg">${e.resultset[t][3]}</div>`;r.push({tram:e.resultset[t][1],cam:e.resultset[t][2],url:n})}new Tabulator("#idTableAcceso",{selectable:!1,headerSort:!1,height:700,width:1e3,data:r,layout:"fitColumns",groupBy:["tram"],columns:[{title:"Tram",field:"tram",hozAlign:"center",headerHozAlign:"center",formatter:"html"},{title:"Descripció Càmera",field:"cam",hozAlign:"center",headerHozAlign:"center",width:560},{title:"URL",field:"url",hozAlign:"center",headerHozAlign:"center",formatter:"html"}],rowClick(t,e){}})}function Rt(t,e){const r=[],n=Dashboards.getParameterValue("filterVarParam"),o=new Set;if(null!=e.resultset&&e.resultset.length>0){if(n.length>0)for(let t=n.length-1;t>=0;t-=1)for(let a=0;a<e.resultset.length;a+=1)n[t]===e.resultset[a][3]&&(o.add(e.resultset[t][3]),r.push({dat:e.resultset[a][3].replaceAll("-","/"),tram:e.resultset[a][1],int:b(e.resultset[a][6]),vari:b((100*parseFloat(e.resultset[a][5])).toFixed(2)),dataRe:e.resultset[a][2].replaceAll("-","/"),intRe:b(e.resultset[a][7])}));else for(let t=0;t<e.resultset.length;t+=1)o.add(e.resultset[t][3].replaceAll("-","/")),r.push({dat:e.resultset[t][3].replaceAll("-","/"),tram:e.resultset[t][1],int:e.resultset[t][6],vari:(100*parseFloat(e.resultset[t][5])).toFixed(2),dataRe:e.resultset[t][2].replaceAll("-","/"),intRe:e.resultset[t][7]});const t=Array.from(o);pt(t.length,t)}0===n.length?($("#chartVariacio").hide(),$("#no_dataChartVariacio").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataChartVariacio").show()):($("#chartVariacio").show(),$("#no_dataChartVariacio").hide()),new Tabulator("#chartVariacio",{selectable:!1,headerSort:!1,height:700,width:1e3,data:r,layout:"fitColumns",groupBy:["dat"],columns:[{title:"Data",field:"dat",hozAlign:"center",headerHozAlign:"center"},{title:"Tram",field:"tram",hozAlign:"center",headerHozAlign:"center",width:560},{title:"Intensitat",field:"int",hozAlign:"center",headerHozAlign:"center"},{title:"Variació",field:"vari",hozAlign:"center",headerHozAlign:"center",formatter:(t,e,r)=>(parseFloat(t.getValue())<0?t.getElement().classList.add("custom-red-cell"):t.getElement().classList.add("custom-green-cell"),t.getValue())},{title:"Data Referència",field:"dataRe",hozAlign:"center",headerHozAlign:"center"},{title:"Intensitat Referència",field:"intRe",hozAlign:"center",headerHozAlign:"center"}],rowClick(t,e){}})}function xt(t,e){const r=[];if(null!=e.resultset)for(let t=0;t<e.resultset.length;t+=1){const n=`<div><img class="imgTabulator" src="build/Imagenes/camara.svg">${e.resultset[t][3]}</div>`;r.push({tram:e.resultset[t][1],cam:e.resultset[t][2],url:n})}new Tabulator("#idTableViaPri",{selectable:!1,headerSort:!1,height:700,width:1e3,data:r,layout:"fitColumns",groupBy:["tram"],columns:[{title:"Tram",field:"tram",hozAlign:"center",headerHozAlign:"center",formatter:"html"},{title:"Descripció Càmera",field:"cam",hozAlign:"center",headerHozAlign:"center",width:560},{title:"URL",field:"url",hozAlign:"center",headerHozAlign:"center",formatter:"html"}],rowClick(t,e){}})}function Bt(t,e){document.querySelector("#tabViePrincCiutat").addEventListener("click",(()=>{requestAnimationFrame((()=>{x("chartViesMesActual","chartViesMesAnterior","no_dataViesMesActual","no_dataViesMesAnterior",e.resultset,"VIES PRINCIPALS DE LA\nCIUTAT: EVOLUCIÓ ","VIES PRINCIPALS DE LA\nCIUTAT: EVOLUCIÓ ")}))}))}var $t=r(421);const Ft={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 Gt(t,e){const r=e.resultset,n=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"];if(0===e.length)(0,$t.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,$t.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e={type:0,data:1,time:2},[o,a]=(0,$t.configureDataGaugeCommon)(r,e,n.slice(),t.fontSize,t.paramOffsetCenterTitle,t.paramOffsetCenterDetail,t.paramOffsetLabel,t.paramCalculatedOffset,t.paramNumberOfElementsByLine),i={...Ft};i.title.text=t.chartName,i.series.max=o,i.series.data=a,i.series.detail.fontSize=t.fontSize,i.series.detail.formatter=t=>(0,$t.addPointInteger)(Math.round(t)),i.series.axisTick.splitNumber=5,i.color=n.slice(),i.series.axisLabel.formatter=t=>(0,$t.addPointInteger)(Math.round(t)),i.tooltip.formatter=t=>function(t,e){let r=`${t.name} : `;return r+=`<span style="font-weight:bold">${(0,$t.addPointInteger)(Math.round(t.value))}</span>`,t.marker+r}(t),(0,$t.initChart)(t.idChart,i)}}const zt="ca_ES",Vt={es_ES:new Map([["chartAccesosGauge","ACCESOS A LA CIUDAD: ACUMULADO AÑO }"],["chartViesGaugeYear","VIAS PRINCIPALES DE LA\nCIUDAD: ACUMULADO AÑO }"]]),ca_ES:new Map([["chartAccesosGauge","ACCESSOS A LA CIUTAT: ACUMULAT ANY "],["chartViesGaugeYear","VIES PRINCIPALS DE LA\nCIUTAT: ACUMULAT ANY "]])};function jt(t,e){Gt({idChart:"chartAccesosGauge",idNoData:"no_dataAccesosGauge",chartName:`${Vt[zt].get("chartAccesosGauge")}${e.resultset[0][2]}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-75,paramCalculatedOffset:75,paramNumberOfElementsByLine:3},e)}function Yt(t,e){Gt({idChart:"chartViesGaugeYear",idNoData:"no_dataViesGaugeYear",chartName:`${Vt[zt].get("chartViesGaugeYear")}${e.resultset[0][2]}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-90,paramCalculatedOffset:90,paramNumberOfElementsByLine:3},e)}function Wt(t,e){vt(e,!0,1,"VIES PRINCIPALS DE LA CIUTAT: HISTÒRIC MENSUAL","Vehicles","chartViesLineMonth","no_dataViesLineMonth",void 0,!0)}function Zt(t,e){R("chartViesBar","no_dataViesBar",e.resultset,"Vehicles","VIES PRINCIPALS DE LA CIUTAT: HISTÒRIC ANUAL","")}function Jt(t,e){if(0===e.resultset.length)D("#chartAccesosPie","#no_dataAccesosPie");else{_("#no_dataAccesosPie","#chartAccesosPie");const t=N("chartAccesosPie"),r=e.resultset,n=[],o=0,a=1,i=2;for(let t=0;t<r.length;t+=1)n.push({value:r[t][a],name:r[t][o]});X("chartAccesosPie",j(`ACCESSOS A LA CIUTAT: DISTRIBUCIÓ ANY ${r[0][i]}`,n,t+3))}}function Ht(t,e){if(0===e.resultset.length)D("#chartAccesosHorStackedBar","#no_dataAccesosHorStackedBar");else{_("#no_dataAccesosHorStackedBar","#chartAccesosHorStackedBar");const t=e.resultset,r={title:{text:"ACCESSOS A LA CIUTAT: HISTÒRIC ANUAL"},color:["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],xAxis:{name:"\n\n\n\nVehicles"}};(0,$t.initStackedBarChart)("chartAccesosHorStackedBar",t,r)}}function qt(t,e){R("chartAccesosStackedBar","no_dataAccesosStackedBar",e.resultset,"Vehicles","ACCESSOS A LA CIUTAT: HISTÒRIC MENSUAL")}let Kt;function Xt(t,e,r,n,o,a,i,s=!1){const l=ee(r,e.id,e.addres,e.location),c=L.map(t).setView(y,i?i.initialZoom:13),u=L.tileLayer("https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',subdomains:"abcd",maxZoom:20});c.setMinZoom(i?i.minZoom:5),c.setMaxZoom(i?i.maxZoom:20),u.addTo(c),ne(c,l,r,e,s,n,o,a)}function Qt(t="myMap",e=5,r=20,n=13,o,a,i,s){const l=L.map(t).setView([39.46975,-.37739],n),c=L.tileLayer("https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',subdomains:"abcd",maxZoom:20});l.setMinZoom(e),l.setMaxZoom(r),c.addTo(l),re(l,o,a,i,te(),s)}function te(){return{listOfselectedElements:[],elementExist(t){return this.listOfselectedElements.filter((e=>e===t)).length>0},deleteElementOfList(t){const e=this.listOfselectedElements.indexOf(t);e>-1&&this.listOfselectedElements.splice(e,1)}}}function ee(t,e=0,n=1,o=2){const{Buffer:a}=r(764),i=r(11),s={type:"FeatureCollection",features:[]},l=[],c=new Set;return t.forEach((t=>{const e=t[o];c.has(e)||(c.add(e),l.push(t))})),l.forEach((t=>{const r=i.Geometry.parse(a.from(t[o],"hex")),l={type:"Feature",properties:{objectoId:t[e],address:t[n]},geometry:r.toGeoJSON()};s.features.push(l)})),s}function re(t,e,r,n,o,a){function i(t){return{iconUrl:ut(t),iconSize:[34,34],shadowSize:[50,64],iconAnchor:[17,17],shadowAnchor:[4,62],popupAnchor:[-3,-76]}}const s=L.icon(i(r)),l=L.icon(i(n));L.geoJSON(e,{onEachFeature:function(i,s){i.properties&&i.properties.address&&s.on("click",(()=>{o.elementExist(i.properties.objectoId)?o.deleteElementOfList(i.properties.objectoId):o.listOfselectedElements.push(i.properties.objectoId),a&&Dashboards.fireChange(a,o.listOfselectedElements),re(t,e,r,n,o,a)}))},pointToLayer(t,e){let r=s;return o.elementExist(t.properties.objectoId)&&(r=l),L.marker(e,{icon:r})}}).addTo(t)}function ne(t,e,r,n,o,a,i,s){L.geoJSON(e,{onEachFeature(t,e){t.properties.address===i&&(Kt=e),function(t,e,r,n,o){const a=r.properties.address,i=r.properties.objectoId;r.properties&&a&&n.on("click",(()=>{const r=t.filter((t=>t[e.id]===i));o(r,a)}))}(r,n,t,e,s),function(t,e,r,n){const o=t.properties.address;r&&(e.on("mouseover",(()=>{e.bindPopup(o).openPopup()})),e.on("mouseout",(()=>{e.closePopup()}))),e.on("click",(()=>{Kt?(Kt.setStyle(n.unselected),e.setStyle(n.selected)):e.setStyle(n.selected),Kt=e}))}(t,e,o,a)},style:t=>t.properties.address===i?a.selected:a.unselected}).addTo(t)}function oe(t,e){document.querySelector("#tabPuntsMesuraCiutat").addEventListener("click",(()=>{requestAnimationFrame((()=>{Qt("idMapPuntsMesuraCiutat",5,20,14,ee(e.resultset,0,1,3),"build/images/mapas/marker-icon-vehiculos.svg/content","build/images/mapas/marker-icon-selected-vehiculos.svg/content","puntoMedidaLaneId")}))}))}function ae(t,e){vt(e,!0,-6,"TRÀNSIT DE VEHICLES: PUNTS DE MESURA DE LA CIUTAT","Vehicles","chartPuntsMesuraCiutat","no_dataPuntsMesuraCiutat")}function ie(t,e){vt(e,!0,15,"TRÀNSIT CICLISTA: ACCESSOS ANELL CICLISTA","Bicicletes","chartAccessosAnellCiclista","no_dataAccessosAnellCiclista")}function se(t,e){vt(e,!0,1,"TRÀNSIT CICLISTA: ANELL CICLISTA","Bicicletes","chartAnellCiclista","no_dataAnellCiclista")}function le(t,e){R("chartAnellBar","no_dataAnellBar",e.resultset,"Bicicletes","ANELL CICLISTA: HISTÒRIC ANUAL","")}function ce(t,e){R("chartAccessosAnellBar","no_dataAccessosAnellBar",e.resultset,"Bicicletes","ACCESSOS ANELL CICLISTA: HISTÒRIC ANUAL","")}function ue(t,e){x("chartAnellMesActual","chartAnellMesAnterior","no_dataAnellMesActual","no_dataAnellMesAnterior",e.resultset,"ANELL CICLISTA: EVOLUCIÓ ","ANELL CICLISTA: EVOLUCIÓ ")}function he(t,e){document.querySelector("#tabAccessosAnellCiclista").addEventListener("click",(()=>{requestAnimationFrame((()=>{x("chartAccessosAnellMesActual","chartAccessosAnellMesAnterior","no_dataAccessosAnellMesActual","no_dataAccessosAnellMesAnterior",e.resultset,"ACCESSOS ANELL CICLISTA: EVOLUCIÓ ","ACCESSOS ANELL CICLISTA: EVOLUCIÓ ")}))}))}function fe(t,e){B("chartAnellGaugeYear","no_dataAnellGaugeYear",e.resultset,"ANELL CICLISTA: EVOLUCIÓ ANY")}function de(t,e){document.querySelector("#tabAccessosAnellCiclista").addEventListener("click",(()=>{requestAnimationFrame((()=>{B("chartAccessosAnellGaugeYear","no_dataAcessosAnellGaugeYear",e.resultset,"ACCESSOS ANELL CICLISTA: EVOLUCIÓ ANY")}))}))}function pe(t,e){vt(e,!0,1,"ANELL CICLISTA: HISTÒRIC MENSUAL","Bicicletes","chartAnellLineMonth","no_dataAnellLineMonth",void 0,!0)}function ge(t,e){vt(e,!0,1,"ACCESSOS ANELL CICLISTA: HISTÒRIC MENSUAL","Bicicletes","chartAccessosAnellLineMonth","no_dataAccessosAnellLineMonth",void 0,!0)}function me(t,e){document.querySelector("#tabPuntsMesuraCiclista").addEventListener("click",(()=>{requestAnimationFrame((()=>{Qt("idMapPuntsMesuraCiclista",5,20,14,ee(e.resultset,0,1,3),"build/images/mapas/marker-icon-bicis.svg/content","build/images/mapas/marker-icon-selected-bicis.svg/content","puntoMedidaLaneId")}))}))}function ye(t,e){vt(e,!0,-6,"TRÀNSIT CICLISTA: PUNTS DE MESURA CICLISTA","Bicicletes","chartPuntsMesuraCiclista","no_dataPuntsMesuraCiclista")}function Se(t,e,r){return{dataset:{source:e.map(((t,e)=>[t,r[e]]))},title:{text:t,left:"center",top:"top",padding:20,textStyle:{fontSize:16,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"20%",bottom:"5%",left:"8%",right:"8%"},xAxis:{name:"vehicles",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},formatter:t=>{const e=t.value[0];return t.value=e,G(t,!1)}},series:[{type:"bar",showBackground:!0,label:{show:!0,position:[15,"35%"],formatter:"{b}",fontSize:14,align:"left",color:"#000",textStyle:{fontFamily:"Montserrat",fontWeight:"400"}},itemStyle:{color:t=>["#B7C258","#A3BF62","#8EBC6D","#7AB877","#65B581"][t.dataIndex]},encode:{x:"intensidad",y:"tramo"}}]}}function Ae(t,e){const r=e.resultset.reverse();X("chartIntensidadAnualCiclista",Se("Major intensitat anual",r.map((t=>t[1])),r.map((t=>t[0]))))}function be(t,e){const r=e.resultset.reverse();X("chartIntensidadMensualCiclista",Se("Major intensitat mensual",r.map((t=>t[1])),r.map((t=>t[0]))))}function Ee(t,e){X("chartIntensidadDiarialCiclista",V(e.resultset.map((([t,e])=>({name:t,value:e}))),"Major intensitat diària",void 0,["#4EA8DE","#FFBF69","#83C5BE","#E56B6F","#CDB4DB"]))}function Ie(t,e){X("chartIntensidadRealTimeCiclista",V(e.resultset.map((([t,e])=>({name:t,value:e}))),"Major intensitat darrera hora"))}const we={es_ES:new Map([["graficaUmbral","Vehiculos / hora"]]),ca_ES:new Map([["graficaUmbral","Vehicles / hora"]])},ve={weight:5,color:"#ADB4B7",opacity:1,fillColor:"#ADB4B7"},Me={weight:5,color:"#9D8BB8",opacity:1,fillColor:"#9D8BB8"},Te=e=>{X("graficaRT",z(e,.2,.3,we[t].get("graficaUmbral")))};function Ce(t,e){const r=document.querySelector("#textoNombreTramo"),n=document.querySelector("#textoHoraActualizacion"),o=document.querySelector("#textoFechaActualizacion"),a=document.querySelector("#dataDia"),i=document.querySelector("#dataMes"),s=document.querySelector("#dataAnyo"),l=t.filter((t=>t[1].includes("daily"))).map((t=>b(Math.round(t[3])))),c=t.filter((t=>t[1].includes("monthly"))).map((t=>b(Math.round(t[3])))),u=t.filter((t=>t[1].includes("annual"))).map((t=>b(Math.round(t[3])))),h=t.filter((t=>t[1].includes("rt"))).map((t=>({intensidad:b(Math.round(t[3])),fecha:t[5]})));r.textContent=e,a.textContent=l,i.textContent=c,s.textContent=u,Te(h[0].intensidad),n.textContent=Et(new Date(h[0].fecha)),o.textContent=At(new Date(h[0].fecha))}function De(t,e){const r=function(t){const e=t.map((t=>t[3])),r=Math.max(...e);return t.filter((t=>t[3]===r)).flat()[2]}(e.resultset);document.querySelector("#tabIntensidadCiclista").addEventListener("click",(()=>{const t=[];e.resultset.forEach((e=>{const r=function(t,e){const r=t.match(/_f\d{1,2}/);return r?e+r[0]:""}(e[1],e[2]);e.push(r),t.push(e)})),Ce(e.resultset.filter((t=>t[2]===r)),r);const n={id:6,addres:2,location:4},o={minZoom:5,maxZoom:20,initialZoom:14},a={unselected:ve,selected:Me};requestAnimationFrame((()=>{Xt("mapBicis",n,e.resultset,a,r,Ce,o,!0)}))}))}function Le(t,e){0===e.resultset.length?D("#chartUsuarisTotalsBarMonth","#no_dataUsuarisTotalsBarMonth"):(_("#no_dataUsuarisTotalsBarMonth","#chartUsuarisTotalsBarMonth"),X("chartUsuarisTotalsBarMonth",F(e.resultset,"Viatges",void 0,"ÚS D'EMT. USUARIS TOTALS: EVOLUCIÓ MENSUAL","Nombre viatges EMT")))}let _e,Ue,Oe,Ne,ke={start:void 0,end:void 0},Pe={start:void 0,end:void 0};function Re(t=null){let e=$("#formFilterDates").find("input");e=$("#formFilterDates").find("input"),$(e).each(((t,r)=>{r.checked&&(e[t].checked=!1)}));const r=$("#formFilterEMT1").find("input");if($(r).each(((t,e)=>{e.checked&&(r[t].checked=!1)})),t){const t=$("#formFilterEMT2").find("input");$(t).each(((e,r)=>{r.checked&&(t[e].checked=!1)}))}const n=$("#formFilterVar").find("input");$(n).each(((t,e)=>{e.checked&&(n[t].checked=!1)})),function(t){let e=0;const r=$("#formFilterDates").find("input");$(r).each((t=>{e+=1,r[t].checked=!0})),e=0;const n=$("#formFilterEMT1").find("input");$(n).each((t=>{e+=1,e<=6&&(n[t].checked=!0)}));const o=$("#formFilterEMT2").find("input");$(o).each((r=>{t&&t.includes(o[r].id)&&(e+=1,e<=6&&(o[r].checked=!0))})),e=0;const a=$("#formFilterVar").find("input");$(a).each((t=>{e+=1,e<=2&&(a[t].checked=!0)})),Dashboards.getParameterValue("filterDatesParam").length>0&&(Dashboards.fireChange("filterDatesParam"),render_echartAccessosCiutat.listeners=["filterDatesParam"],Dashboards.fireChange("filterDatesParam"),render_echartAccessosCiutat.listeners=[""]),Dashboards.getParameterValue("filterEMT2Param").length>0&&Dashboards.fireChange("filterEMT2Param"),Dashboards.getParameterValue("filterVarParam").length>0&&Dashboards.fireChange("filterVarParam")}(t)}function xe(){_e&&([ke]=_e.getOption().dataZoom);const t=$("#formFilterEMT1").find("input"),e=[];$(t).each(((t,r)=>{r.checked&&e.push(r.id)})),Dashboards.fireChange("filterEMT1Param",e),Dashboards.fireChange("updateFilterEMT1","True")}function Be(){const t=$("#formFilterDates").find("input"),e=[];$(t).each(((t,r)=>{r.checked&&e.push(r.id)})),Dashboards.fireChange("filterDatesParam",e),Dashboards.fireChange("updateFilter","True")}function $e(){Oe&&([Pe]=Oe.getOption().dataZoom);const t=$("#formFilterEMT2").find("input"),e=[];$(t).each(((t,r)=>{r.checked&&e.push(r.id)})),Dashboards.fireChange("filterEMT2Param",e),Dashboards.fireChange("updateFilterEMT2","True")}function Fe(t,e="number",r=null){let n;return"number"===e?n=new Map([...t].filter((([t])=>!Number.isNaN(Number(t))))):"includes"===e&&(n=new Map([...t].filter((([t])=>t.includes(r))))),n}function Ge(t){const e=Array.from(t.keys()).sort(((t,e)=>t-e)),r=new Map;return e.forEach((e=>{r.set(e,t.get(e))})),r}function ze(t,e,r=!1){const n=[],o=new Set,a=r?new Map:new Set;for(let i=0;i<e.length;i+=1)(0===t.length||t.includes(e[i][0]))&&(r?a.set(e[i][0],e[i][0]):a.add(e[i][0]),n.push({day:e[i][1],type:e[i][0],value:e[i][2]}),o.add(e[i][1]));return[a,n,Array.from(o.values())]}function Ve(t,e,r){const n=g.slice();return t.map(((t,o)=>{const a=e.filter((e=>e.type===t)),i=r.map((t=>{const e=a.findIndex((e=>e.day===t));return-1!==e?a[e].value:null}));return{name:t,type:"line",symbol:"circle",color:n.shift(),symbolSize:6,smooth:!1,data:i}}))}function je(t){const e={};t.forEach((t=>{const r=t.type,n=t.value;e[r]=(e[r]||0)+n}));const r=Object.keys(e).map((t=>({tipo:t,valor:e[t]})));return r.sort(((t,e)=>e.valor-t.valor)),r.map((t=>t.tipo))}function Ye(t,e,r,n,o){const a=Dashboards.getParameterValue("filterEMT1Param");if(0===r.length)D(`#${t}`,`#${e}`);else{_(`#${e}`,`#${t}`);const[i,s,l]=ze(a,r);if(!o){const t=je(s);!function(t,e){const r=$("#formFilterEMT1");""===Dashboards.getParameterValue("updateFilterEMT1")&&(e.forEach((t=>{r.append(`<input type="checkbox" id="${t}" class="titol-${t}" onclick="legacy.filterEMT1Update();" /> ${t} </br>`)})),Re(),Be(),xe())}(t.length,t),a&&a.sort(((t,e)=>t.localeCompare(e)))}if(a){const r=P(Ve(a,s,l),a,l,"Viatges",o?E(l.length):It(l.length),!0,-10,void 0,n,ke.start,ke.end);let i;o?(Ue=X(t,r),i=Ue):(_e=X(t,r),i=_e),0===$("#formFilterEMT1 :checked").length&&D(`#${t}`,`#${e}`),$(window).on("resize",(()=>{null!=i&&void 0!==i&&i.resize()}))}}}function We(t,e,r,n,o){const a=Dashboards.getParameterValue("filterEMT2Param");if(0===r.length)D(`#${t}`,`#${e}`);else{_(`#${e}`,`#${t}`);const[i,s,l]=ze(a,r,!0);if(!o){const t=Array.from(Ge(Fe(i,"number")).values());let e=[];(function(t){const e=[];return t.forEach(((t,r)=>{Array.from(r).forEach((t=>{!e.includes(t)&&Number.isNaN(Number(t))&&e.push(t)}))})),e})(i).forEach((t=>{e=e.concat(Array.from(Ge(function(t){const e=/\d+/g,r=new Map;return t.forEach((n=>{r.set(n.match(e),t.get(n))})),r}(Fe(i,"includes",t))).values()))}));let r=t.concat(e);r=[...new Set(r)];const n=je(s).slice(0,6);!function(t,e,r){const n=$("#formFilterEMT2");""===Dashboards.getParameterValue("updateFilterEMT2")&&(e.forEach((t=>{n.append(`<input type="checkbox" id="${t}" class="linea-${t}" onclick="legacy.filterEMT2Update();" />`)})),Re(r),Be(),$e())}(r.length,r,n)}if(a){const r=P(Ve(a,s,l),a,l,"Viatges",It(l.length),!0,-10,void 0,n,Pe.start,Pe.end);let i;o?(Ne=X(t,r),i=Ne):(Oe=X(t,r),i=Oe),0===$("#formFilterEMT1 :checked").length&&D(`#${t}`,`#${e}`),$(window).on("resize",(()=>{null!=i&&void 0!==i&&i.resize()}))}}}function Ze(){document.querySelector("#idFiltrar").style.visibility="visible"}function Je(){document.querySelector("#idFiltrar").style.visibility="hidden"}function He(t,e){return t.filter((t=>e.includes(t[0])))}function qe(){const t=["filterDatesParam","updateFilter","filterEMT1Param","updateFilterEMT1"],e=["filterDatesParam","updateFilter","filterEMT2Param","updateFilterEMT2"];render_echartUsuarisPerLinea.listeners=e,render_echartUsuarisPerLiniaLineMonth.listeners=e,render_echartUsuarisPerLiniaGaugeYear.listeners=e,render_echartUsuarisPerLiniaGaugeMonth.listeners=e,render_echartUsuarisPerLiniaBarYear.listeners=e,render_echartUsuarisPerTitol.listeners=t,render_echartUsuarisPerTitolLineMonth.listeners=t,render_echartUsuarisPerTitolGaugeYear.listeners=t,render_echartUsuarisPerTitolGaugeMonth.listeners=t,render_echartUsuarisPerTitolBarYear.listeners=t,render_echartUsuarisTotals.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter"),Dashboards.fireChange("filterEMT1Param"),Dashboards.fireChange("updateFilterEMT1"),Dashboards.fireChange("filterEMT2Param"),Dashboards.fireChange("updateFilterEMT2")}const Ke={es_ES:new Map([["chartUsuarisTotalsGaugeYear","USO DE EMT. USUARIOS TOTALES: ÚLTIMOS AÑOS"]]),ca_ES:new Map([["chartUsuarisTotalsGaugeYear","US D'EMT. USUARIS TOTALS: ÚLTIMS ANYS"]])},Xe={es_ES:new Map([["chartUsuarisTotalsGaugeMonth","USO DE EMT. USUARIOS TOTALES: MES ACTUAL"],["chartUsuarisTotalsGaugeLastMonth","USO DE EMT. USUARIOS TOTALES: MES ANTERIOR"]]),ca_ES:new Map([["chartUsuarisTotalsGaugeMonth","ÚS D'EMT. USUARIS TOTALS: MES ACTUAL"],["chartUsuarisTotalsGaugeLastMonth","ÚS D'EMT. USUARIS TOTALS: MES ANTERIOR"]])};function Qe(t,e){Gt({idChart:"chartUsuarisTotalsGaugeYear",idNoData:"no_dataUsuarisTotalsGaugeYear",chartName:`${Ke[zt].get("chartUsuarisTotalsGaugeYear")}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-100,paramCalculatedOffset:50,paramNumberOfElementsByLine:5},e)}function tr(t,e){const r=Dashboards.getParameterValue("filterEMT1Param");if(r.length>0){const n=He(e.resultset,r);function o(){B("chartUsuarisTitolGaugeYear","no_dataUsuarisTitolGaugeYear",n,"ÚS D'EMT. USUARIS PER TÍTOL: ANY")}r.sort(((t,e)=>t.localeCompare(e))),0===document.querySelector("#chartUsuarisTitolGaugeYear").childElementCount?document.querySelector("#tabUsuarisPerTitol").addEventListener("click",(()=>{requestAnimationFrame((()=>{o()}))})):o()}}function er(t,e){const r=Dashboards.getParameterValue("filterEMT2Param"),n=He(e.resultset,r);function o(){B("chartUsuarisLiniaGaugeYear","no_dataUsuarisLiniaGaugeYear",n,"ÚS D'EMT. USUARIS PER LÍNIA: ANY")}n.sort(((t,e)=>Number(t[0])-Number(e[0]))),0===document.querySelector("#chartUsuarisLiniaGaugeYear").childElementCount?document.querySelector("#tabUsuarisPerLinia").addEventListener("click",(()=>{requestAnimationFrame((()=>{o()}))})):o()}function rr(t,e){const r=Dashboards.getParameterValue("filterEMT1Param"),n=He(e.resultset,r);function o(){x("chartUsuarisTitolMesActual","chartUsuarisTitolMesAnterior","no_dataUsuarisTitolMesActual","no_dataUsuarisTitolMesAnterior",n,"ÚS D'EMT. USUARIS PER TÍTOL: EVOLUCIÓ ","ÚS D'EMT. USUARIS PER TÍTOL: EVOLUCIÓ ")}0===document.querySelector("#chartUsuarisTitolMesActual").childElementCount||0===document.querySelector("#chartUsuarisTitolMesAnterior").childElementCount?document.querySelector("#tabUsuarisPerTitol").addEventListener("click",(()=>{requestAnimationFrame((()=>{o()}))})):o()}function nr(t,e){const r=Dashboards.getParameterValue("filterEMT2Param"),n=He(e.resultset,r);function o(){x("chartUsuarisLiniaMesActual","chartUsuarisLiniaMesAnterior","no_dataUsuarisLiniaMesActual","no_dataUsuarisLiniaMesAnterior",n,"ÚS D'EMT. USUARIS PER LÍNIA: EVOLUCIÓ ","ÚS D'EMT. USUARIS PER LÍNIA: EVOLUCIÓ ")}n.sort(((t,e)=>Number(t[0])-Number(e[0]))),0===document.querySelector("#chartUsuarisLiniaMesActual").childElementCount||0===document.querySelector("#chartUsuarisLiniaMesAnterior").childElementCount?document.querySelector("#tabUsuarisPerLinia").addEventListener("click",(()=>{requestAnimationFrame((()=>{o()}))})):o()}const or={title:{text:"",left:"center",top:"top",padding:10,textStyle:{fontSize:12,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:void 0,itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:5,splitNumber:10,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=>(0,$t.addPointInteger)(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[0,"0%"],fontSize:17,fontWeight:"bolder",formatter:void 0,fontFamily:"Montserrat",color:"inherit"},data:void 0},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:27,top:40}};function ar(t,e){const r=e.resultset;if(0===e.length)(0,$t.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,$t.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e={type:0,time:1,data:2},[n,o,a]=(0,$t.configureDataGaugeMonthCommon)(t.idChart,r,e,0),i={...or};i.title.text=t.chartName,i.series.max=n,i.series.detail.formatter=o,i.series.data=a,(0,$t.initChart)(t.idChart,i)}}function ir(t,e){const r={idChart:"chartUsuarisTotalsGaugeMonth",idNoData:"no_dataUsuarisTotalsGaugeMonth",chartName:`${Xe[zt].get("chartUsuarisTotalsGaugeMonth")}`},n={idChart:"chartUsuarisTotalsGaugeLastMonth",idNoData:"no_dataUsuarisTotalsGaugeLastMonth",chartName:`${Xe[zt].get("chartUsuarisTotalsGaugeLastMonth")}`};ar(r,e),ar(n,e)}function sr(t,e){if(0===e.resultset.length)D("#chartUsuarisTotalsStackedBarYears","#no_dataUsuarisTotalsStackedBarYears");else{_("#no_dataUsuarisTotalsStackedBarYears","#chartUsuarisTotalsStackedBarYears");const t={title:{text:"ÚS D'EMT. USUARIS TOTALS: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nViatges"}};(0,$t.initStackedBarChartMonthSeries)("chartUsuarisTotalsStackedBarYears",e.resultset,t)}}function lr(t,e){vt(e,!0,1,"ÚS D'EMT: USUARIS TOTALS","Viatges","chartUsuarisTotals","no_dataUsuarisTotals",void 0,void 0,void 0,void 0,!1)}function cr(){Je(),$("#idFieldsFilterEmtUsLinea").hide(),$("#idFieldsFilterEmtUsTitol").hide()}function ur(t,e){Ye("chartUsuarisPerTitol","no_dataUsuarisPerTitol",e.resultset,"ÚS D'EMT: USUARIS PER TÍTOL",!1)}function hr(){Ze(),$("#idAllFilterFields").show(),$("#idFieldsFilterEmtUsLinea").hide(),$("#idFieldsFilterEmtUsTitol").show()}function fr(t,e){We("chartUsuarisPerLinea","no_dataUsuarisPerLinea",e.resultset,"ÚS D'EMT: USUARIS PER LÍNIA",!1)}function dr(){Je(),$("#idAllFilterFields").show(),$("#idFieldsFilterEmtUsLinea").show(),$("#idFieldsFilterEmtUsTitol").hide()}function pr(t,e){Ye("chartUsuarisTitolLineMonth","no_dataUsuarisTitolLineMonth",e.resultset,"ÚS D'EMT. USUARIS PER TÍTOL: HISTÒRIC MENSUAL",!0)}function gr(t,e){We("chartUsuarisLiniaLineMonth","no_dataUsuarisLiniaLineMonth",e.resultset,"ÚS D'EMT. USUARIS PER LÍNIA: HISTÒRIC MENSUAL",!0)}function mr(t,e){const r=Dashboards.getParameterValue("filterEMT1Param");R("chartUsuarisTitolBar","no_dataUsuarisTitolBar",He(e.resultset,r),"Viatges","ÚS D'EMT. USUARIS PER TÍTOL: HISTÒRIC ANUAL","")}function yr(t,e){const r=Dashboards.getParameterValue("filterEMT2Param");R("chartUsuarisLiniaBar","no_dataUsuarisLiniaBar",He(e.resultset,r),"Viatges","ÚS D'EMT. USUARIS PER LÍNIA: HISTÒRIC ANUAL","")}const Sr="CONTAMINACIÓ ";function Ar(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartPM10").hide(),$("#no_dataPM10").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataPM10").show();else{$("#no_dataPM10").hide(),$("#chartPM10").css("background","#ffffff"),$("#chartPM10").show();const t=`${Sr}PM10`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=10;X("chartPM10",P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t))}}function br(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length)$("#chartNO2").hide(),$("#no_dataNO2").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataNO2").show();else{$("#no_dataNO2").hide(),$("#chartNO2").css("background","#ffffff"),$("#chartNO2").show();const t=`${Sr}NO2`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));else{for(n=0;n<a;n++)i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]);ft(u.length,u)}const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=18,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t),A=720,b=window.innerHeight>A?void 0:"5%",E=P(p,d,Array.from(c.values()),l[0].measureunit,m,!1,y,void 0,t,void 0,void 0,void 0,b);X("chartNO2",S),X("chartContaminacioNO2",E)}}function Er(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartNO").hide(),$("#no_dataNO").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataNO").show();else{$("#no_dataNO").hide(),$("#chartNO").css("background","#ffffff"),$("#chartNO").show();const t=`${Sr}NO`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=18,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartNO")).setOption(S,!0),X("chartNO",S)}}function Ir(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartNOX").hide(),$("#no_dataNOX").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataNOX").show();else{$("#no_dataNOX").hide(),$("#chartNOX").css("background","#ffffff"),$("#chartNOX").show();const t=`${Sr}NOX`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=10,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartNOX")).setOption(S,!0),X("chartNOX",S)}}function wr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartSO2").hide(),$("#no_dataSO2").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataSO2").show();else{$("#no_dataSO2").hide(),$("#chartSO2").css("background","#ffffff"),$("#chartSO2").show();const t=`${Sr}SO2`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=20,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartSO2")).setOption(S,!0),X("chartSO2",S)}}function vr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartO3").hide(),$("#no_dataO3").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataO3").show();else{$("#no_dataO3").hide(),$("#chartO3").css("background","#ffffff"),$("#chartO3").show();const t=`${Sr}O3`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=20,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartO3")).setOption(S,!0),X("chartO3",S)}}function Mr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartPM1").hide(),$("#no_dataPM1").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataPM1").show();else{$("#no_dataPM1").hide(),$("#chartPM1").css("background","#ffffff"),$("#chartPM1").show();const t=`${Sr}PM1`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=20,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartPM1")).setOption(S,!0),X("chartPM1",S)}}function Tr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartPM25").hide(),$("#no_dataPM25").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataPM25").show();else{$("#no_dataPM25").hide(),$("#chartPM25").css("background","#ffffff"),$("#chartPM25").show();const t=`${Sr}PM25`,o=e.resultset,a=e.resultset.length,i=new Set,s=new Set,l=[],c=new Set,u=[];let h;if(r.length>0)for(let t=r.length-1;t>=0;t--)for(var n=0;n<a;n++)r[t]==o[n][4]&&(i.add(o[n][8]),u.push(o[n][4]),h={day:mt(o[n][1]),month:o[n][4],type:o[n][8],value:o[n][9],measureunit:o[n][10]},l.push(h),c.add(mt(o[n][1])),s.add(o[n][8]));const f=Array.from(c.values()),d=Array.from(s.values()),p=[];let g;for(let t=0;t<d.length;t++){const e=[],r=[];for(g={name:d[t],type:"line",symbol:"circle",symbolSize:6,smooth:!1,data:[]},n=0;n<l.length;n++)d[t]==l[n].type&&e.push([l[n].day,l[n].type,l[n].value]);let o=0;for(n=0;n<f.length;n++)f.length!=e.length?(o>=e.length&&(o=e.length-1),f[n]==e[o][0]?r.push(e[o][2]):(r.push(null),o--),o++):r.push(e[n][2]);g.data=r,p.push(g)}const m=It(c.size),y=20,S=P(p,d,Array.from(c.values()),l[0].measureunit,m,!0,y,void 0,t);echarts.init(document.getElementById("chartPM25")).setOption(S,!0),X("chartPM25",S)}}function Cr(){render_echartPM10.listeners=["filterDatesParam","updateFilter"],render_echartPM1.listeners=["filterDatesParam","updateFilter"],render_echartPM25.listeners=["filterDatesParam","updateFilter"],render_echartO3.listeners=["filterDatesParam","updateFilter"],render_echartSO2.listeners=["filterDatesParam","updateFilter"],render_echartNO2.listeners=["filterDatesParam","updateFilter"],render_echartNO.listeners=["filterDatesParam","updateFilter"],render_echartNOX.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter")}const Dr=-20;function Lr(t,e,r,n){const o=U(t,n),a=Object.keys(o),i=new Set(t.map((t=>t[e])));return i.forEach((t=>{a.forEach((n=>{void 0===o[n].find((r=>r[e]===t))&&o[n].push([o[n][0][0],t,n,void 0,o[n][0][r]])}))})),a.forEach((t=>{o[t].sort(((t,r)=>{const n=t[e].split("/").reverse().join(""),o=r[e].split("/").reverse().join("");return n.localeCompare(o)}))})),[o,i]}function _r(t,e,r,n,o,a,i,s,l,c=""){const u=P(t,e,r,n,o,a,l,void 0,c);return u.yAxis.nameTextStyle.align="left",delete u.yAxis.axisLabel.margin,u.yAxis.max=i,u.yAxis.min=s,delete u.toolbox.show,u}function Ur(){render_echartMestalla.listeners=["filterDatesParam","updateFilter"],render_echartMalilla.listeners=["filterDatesParam","updateFilter"],render_echartPerellonet.listeners=["filterDatesParam","updateFilter"],render_echartExposicio.listeners=["filterDatesParam","updateFilter"],render_echartSotenis.listeners=["filterDatesParam","updateFilter"],render_echartBeninamet.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter")}const Or=-20;function Nr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartBenimamet").hide(),$("#chartBenimametStacked").hide(),$("#no_dataBeninamet").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataBeninamet").show();else{$("#no_dataBeninamet").hide(),$("#chartBenimamet").css("background","#ffffff"),$("#chartBenimametStacked").css("background","#ffffff"),$("#chartBenimamet").show(),$("#chartBenimametStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE BENIMÀMET",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Benimamet"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null)}const w=It(a.size),v=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];X("chartBenimamet",_r([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],v,Array.from(a.values()),d[0].measureunit,w,!0,null,0,Or,t)),X("chartBenimametStacked",_r([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}],v,Array.from(a.values()),"%",w,!0,100,0,Or,t))}}function kr(t,e){let r=e.resultset.filter((t=>"València Ciutat"!==t[1]));r=r.map((t=>t.slice(1))),vt(r,!0,1,"INJECCIÓ D'AIGUA PER BARRIS","m3","chartConsumAguaBarris","no_dataConsumAguaBarris")}function Pr(t,e){let r=e.resultset.filter((t=>"kpi-valencia-ciudad-total"===t[0]));r=r.map((t=>t.slice(1))),vt(r,!0,1,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ DIÀRIA","m3","chartConsumTotalAgua","no_dataConsumTotalAgua",void 0,void 0,void 0,void 0,!1)}const Rr=-20;function xr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartExposicio").hide(),$("#chartExposicioStacked").hide(),$("#no_dataExposicio").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExposicio").show();else{$("#no_dataExposicio").hide(),$("#chartExposicio").css("background","#ffffff"),$("#chartExposicioStacked").css("background","#ffffff"),$("#chartExposicio").show(),$("#chartExposicioStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE EXPOSICIÓ",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Exposicio"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=0,m=0,y=0,S=0)}const w=It(a.size),v=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];X("chartExposicio",_r([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],v,Array.from(a.values()),d[0].measureunit,w,!0,null,0,Rr,t)),X("chartExposicioStacked",_r([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}],v,Array.from(a.values()),"%",w,!0,100,0,Rr,t))}}const Br=-20;function $r(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartMalilla").hide(),$("#chartMalillaStacked").hide(),$("#no_dataMalilla").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataMalilla").show();else{$("#no_dataMalilla").hide(),$("#chartMalilla").css("background","#ffffff"),$("#chartMalillaStacked").css("background","#ffffff"),$("#chartMalilla").show(),$("#chartMalillaStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE MALILLA",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Malilla"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=0,m=0,y=0,S=0):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null)}const w=It(a.size),v=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];X("chartMalilla",_r([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],v,Array.from(a.values()),d[0].measureunit,w,!0,null,0,Br,t)),X("chartMalillaStacked",_r([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}],v,Array.from(a.values()),"%",w,!0,100,0,Br,t))}}const Fr=-20;function Gr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length)$("#chartMestalla").hide(),$("#chartMestallaStacked").hide(),$("#no_dataMestalla").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataMestalla").show();else{$("#no_dataMestalla").hide(),$("#chartMestalla").css("background","#ffffff"),$("#chartMestallaStacked").css("background","#ffffff"),$("#chartMestalla").show(),$("#chartMestallaStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE MESTALLA",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Mestalla"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));else{for(let t=0;t<o;t+=1)"Mestalla"===n[t][6]&&("Industrial"===n[t][7]&&(a.add(n[t][3]),i.push(n[t][4]),s.push(n[t][8]),h+=n[t][8]),"Domèstic"===n[t][7]&&(a.add(n[t][3]),i.push(n[t][4]),l.push(n[t][8]),h+=n[t][8]),"Serv.Municipal"===n[t][7]&&(a.add(n[t][3]),i.push(n[t][4]),c.push(n[t][8]),h+=n[t][8]),"Aigua no registrada per comptadors"===n[t][7]&&(a.add(n[t][3]),i.push(n[t][4]),u.push(n[t][8]),h+=n[t][8]),a.add(n[t][3]),i.push(n[t][4]));ft(i.length,i)}let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=0,m=0,y=0,S=0)}const w=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"],v=[{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],M=It(a.size);X("chartMestalla",_r(v,w,Array.from(a.values()),d[0].measureunit,M,!0,null,0,Fr,t)),X("chartMestallaStacked",_r([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}],w,Array.from(a.values()),"%",M,!0,100,0,Fr,t))}}const zr=-20;function Vr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartPerellonet").hide(),$("#chartPerellonetStacked").hide(),$("#no_dataPerellonet").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataPerellonet").show();else{$("#no_dataPerellonet").hide(),$("#chartPerellonet").css("background","#ffffff"),$("#chartPerellonetStacked").css("background","#ffffff"),$("#chartPerellonet").show(),$("#chartPerellonetStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE PERELLONET",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Perellonet"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=0,m=0,y=0,S=0)}const w=It(a.size),v=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"],M=[{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}];X("chartPerellonet",_r([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],v,Array.from(a.values()),d[0].measureunit,w,!0,null,0,zr,t)),X("chartPerellonetStacked",_r(M,v,Array.from(a.values()),"%",w,!0,100,0,zr,t))}}const jr=-20;function Yr(t,e){const r=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===r.length)$("#chartSotenis").hide(),$("#chartSotenisStacked").hide(),$("#no_dataSotenis").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataSotenis").show();else{$("#no_dataSotenis").hide(),$("#chartSotenis").css("background","#ffffff"),$("#chartSotenisStacked").css("background","#ffffff"),$("#chartSotenis").show(),$("#chartSotenisStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE SOTERNES",n=e.resultset,o=e.resultset.length,a=new Set,i=[];let s=[],l=[],c=[],u=[],h=0;const f=[],d=[];let p;if(r.length>0)for(let t=r.length;t>=0;t-=1)for(let e=0;e<o;e+=1)r[t]===n[e][4]&&"Soternes"===n[e][6]&&(a.add(gt(n[e][1])),i.push(n[e][4]),p={fecha:n[e][1],mesAbr:n[e][4],diaAbr:n[e][3],tipoUso:n[e][7],valor:n[e][8],measureunit:n[e][9]},d.push(p));let g=0,m=0,y=0,S=0;const A=[],b=[],E=[],I=[];s=[],l=[],c=[],u=[];for(let t=0;t<d.length;t+=1){const e=t+1<d.length?t+1:d.length-1;t===d.length-1?("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null):d[t].fecha===d[e].fecha?(h+=d[t].valor,"Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor)):("Domèstic"===d[t].tipoUso&&(g=d[t].valor),"Industrial"===d[t].tipoUso&&(m=d[t].valor),"Serv.Municipal"===d[t].tipoUso&&(y=d[t].valor),"Aigua no registrada per comptadors"===d[t].tipoUso&&(S=d[t].valor),h+=d[t].valor,s.push(m),l.push(g),c.push(y),u.push(S),g=g/h*100,m=m/h*100,y=y/h*100,S=S/h*100,f.push([g,m,y,S]),A.push(g),b.push(m),E.push(y),I.push(S),h=0,g=null,m=null,y=null,S=null)}const w=It(a.size),v=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];X("chartSotenis",_r([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:s},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],v,Array.from(a.values()),d[0].measureunit,w,!0,null,0,jr,t)),X("chartSotenisStacked",_r([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:I},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:b},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:E}],v,Array.from(a.values()),"%",w,!0,100,0,jr,t))}}function Wr(t,e){0===e.resultset.length?D("#chartAiguaTotalBarMonth","#no_dataAiguaTotalBarMonth"):(_("#no_dataAiguaTotalBarMonth","#chartAiguaTotalBarMonth"),X("chartAiguaTotalBarMonth",F(e.resultset,"m3",void 0,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ MENSUAL","València Ciutat")))}function Zr(t,e){if(0===e.resultset.length)D("#chartYearAiguaTotalgauge_semicircle","#no_dataYearAiguaTotalgauge_semicircle");else{_("#no_dataYearAiguaTotalgauge_semicircle","#chartYearAiguaTotalgauge_semicircle");const t=N("chartYearAiguaTotalgauge_semicircle");X("chartYearAiguaTotalgauge_semicircle",W(e.resultset,"INJECCIÓ TOTAL D'AIGUA: ÚLTIMS ANYS",t))}}function Jr(t,e){if(0===e.resultset.length)D("#chartAiguaTotalreloj_semicircle","#no_dataAiguaTotalreloj_semicircle"),D("#chartAiguaTotalreloj_semicircle_lastmonth","#no_dataAiguaTotalreloj_semicircle_lastmonth");else{_("#no_dataAiguaTotalreloj_semicircle","#chartAiguaTotalreloj_semicircle"),_("#no_dataAiguaTotalreloj_semicircle_lastmonth","#chartAiguaTotalreloj_semicircle_lastmonth");const t=0,r=1,n=e.resultset,o=N("chartAiguaTotalreloj_semicircle");X("chartAiguaTotalreloj_semicircle",Z(n,t,"INJECCIÓ TOTAL D'AIGUA: MES ACTUAL",o)),X("chartAiguaTotalreloj_semicircle_lastmonth",Z(n,r,"INJECCIÓ TOTAL D'AIGUA: MES ANTERIOR",o))}}function Hr(t,e){if(0===e.resultset.length)D("#chartAiguaTotalstackedBarYears","#no_dataAiguaTotalstackedBarYears");else{_("#no_dataAiguaTotalstackedBarYears","#chartAiguaTotalstackedBarYears");const t={title:{text:"INJECCIÓ TOTAL D'AIGUA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nm3"}};(0,$t.initStackedBarChartMonthSeries)("chartAiguaTotalstackedBarYears",e.resultset,t)}}function qr(t,e){R("chartBarrisBar","no_dataBarrisBar",e.resultset,"m3","INJECCIÓ D'AIGUA PER BARRIS: HISTÒRIC ANUAL","")}function Kr(t,e){vt(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 Xr={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"]])};function Qr(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",(()=>{requestAnimationFrame((()=>{Gt({idChart:"chartBarrisGaugeYear",idNoData:"no_dataBarrisGaugeYear",chartName:`${Xr[zt].get("chartNameBarrisGaugeYear")} ${e.resultset[0][2]}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-100,paramCalculatedOffset:100,paramNumberOfElementsByLine:3},e)}))}))}function tn(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",(()=>{requestAnimationFrame((()=>{x("chartBarrisMesActual","chartBarrisMesAnterior","no_dataBarrisMesActual","no_dataBarrisMesAnterior",e.resultset,"INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ","INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ")}))}))}function en(t,e){if(0===e.resultset.length)D("#chartKgsResidus","#no_dataKgsResidus");else{_("#no_dataKgsResidus","#chartKgsResidus");const t="KGS. DE RESIDUS EN CONTENIDORS: EVOLUCIÓ DIÀRIA",r="KGS. DE RESIDUS EN MOBLES: EVOLUCIÓ DIÀRIA",n=e.resultset,o=0,a=1,i=2,s=3,l=new Map,c=new Map;let u=[],h=[];n.forEach((t=>{"Contenidor"===t[i]&&"total"===t[a]&&l.set(t[o],t[s]),"Moble"===t[i]&&c.set(t[o],t[s])})),u=Lt(l),h=Lt(c);const f=It(u[0].length),d=It(h[0].length),p=-30,g=[{name:"Contenidor",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u[1]}],m=[{name:"Moble",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:h[1]}];X("chartKgsResidus",P(g,null,u[0],"Kgs",f,!0,p,void 0,t)),X("chartKgsResidusMoble",P(m,null,h[0],"Kgs",d,!0,p,void 0,r))}}function rn(t,e=!0){const r={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?r.Cont.push([t[3],t[4],t[2]]):r.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?r.Mob.push([t[3],t[4],t[2]]):r.Mob.push([t[3],t[2]]))})),r}const nn=["#0077b6","#ffc300","#55828b","#a26769","#b1a7a6","#38b000"],on=nn.slice(0,-2).concat(nn.slice(-1));function an(t,e){vt(e,!0,0,"DESAGREGACIÓ KGS. CONTENIDORS PER TIPUS DE RESIDUS","Kgs","chartDesKgsPerTipusResidu","no_dataDesKgsPerTipusResidu",void 0,void 0,void 0,void 0,void 0,nn)}const sn={es_ES:new Map([["chartResidusContenidorstackedBarYears","KGS. DE RESIDUOS EN CONTENEDORES: DESGLOSE DE LOS ÚLTIMOS AÑOS"],["chartResidusMoblesstackedBarYears","KGS. DE RESIDUOS EN MUEBLES: DESGLOSE DE LOS ÚLTIMOS AÑOS"],["chartDesKgsHorStackedBar","KGS. DE RESIDUOS DE RECICLAJE: HISTORICO ANUAL"]]),ca_ES:new Map([["chartResidusContenidorstackedBarYears","KGS. DE RESIDUS EN CONTENIDORS: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["chartResidusMoblesstackedBarYears","KGS. DE RESIDUS EN MOBLES: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["chartDesKgsHorStackedBar","KGS. DE RESIDUS DE RECICLATGE: HISTÒRIC ANUAL"]])};function ln(t,e){function r(t,r,n){if(0===e.resultset.length)(0,$t.printNoDataChart)(`#${t}`,`#${r}`);else{const e={title:{text:sn[zt].get(t)},xAxis:{name:"\n\n\n\nKgs"}};(0,$t.initStackedBarChartMonthSeries)(t,n,e)}}const n=(0,$t.splitDataset)(e.resultset),o=n.Cont,a=n.Mob;r("chartResidusContenidorstackedBarYears","no_dataResidusContenidorstackedBarYears",o),r("chartResidusMoblesstackedBarYears","no_dataResidusMoblesstackedBarYears",a)}function cn(t,e){const r="chartDesKgsHorStackedBar",n="no_dataDesKgsHorStackedBar";if(0===e.resultset.length)(0,$t.printNoDataChart)(`#${r}`,`#${n}`);else{(0,$t.printDataChart)(`#${n}`,`#${r}`);const t={title:{text:sn[zt].get(r)},color:on,xAxis:{name:"\n\n\n\nKgs"}};(0,$t.initStackedBarChart)(r,e.resultset,t)}}function un(t,e){R("chartDesKgsStackedBar","no_dataDesKgsStackedBar",e.resultset,"Kgs","KGS. DE RESIDUS DE RECICLATGE: HISTÒRIC MENSUAL",void 0,void 0,void 0,void 0,on)}function hn(t,e){if(0===e.resultset.length)D("#chartResidusContenidorreloj_semicircle","#no_dataResidusContenidorreloj_semicircle"),D("#chartResidusContenidorreloj_semicircle_lastmonth","#no_dataResidusContenidorreloj_semicircle_lastmonth"),D("#chartResidusMoblesreloj_semicircle","#no_dataResidusMoblesreloj_semicircle"),D("#chartResidusMoblesreloj_semicircle_lastmonth","#no_dataResidusMoblesreloj_semicircle_lastmonth");else{_("#no_dataResidusContenidorreloj_semicircle","#chartResidusContenidorreloj_semicircle"),_("#no_dataResidusContenidorreloj_semicircle_lastmonth","#chartResidusContenidorreloj_semicircle_lastmonth"),_("#no_dataResidusMoblesreloj_semicircle","#chartResidusMoblesreloj_semicircle"),_("#no_dataResidusMoblesreloj_semicircle_lastmonth","#chartResidusMoblesreloj_semicircle_lastmonth");const t=0,r=1,n=rn(e.resultset),o=n.Cont,a=n.Mob,i=N("chartResidusContenidorreloj_semicircle");X("chartResidusContenidorreloj_semicircle",Z(o,t,"KGS. DE RESIDUS EN CONTENIDORS: MES ACTUAL",i)),X("chartResidusContenidorreloj_semicircle_lastmonth",Z(o,r,"KGS. DE RESIDUS EN CONTENIDORS: MES ANTERIOR",i)),X("chartResidusMoblesreloj_semicircle",Z(a,t,"KGS. DE RESIDUS EN MOBLES: MES ACTUAL",i)),X("chartResidusMoblesreloj_semicircle_lastmonth",Z(a,r,"KGS. DE RESIDUS EN MOBLES: MES ANTERIOR",i))}}function fn(t,e){if(0===e.resultset.length)D("#chartYearResidusContenidorgauge_semicircle","#no_dataYearResidusContenidorgauge_semicircle"),D("#chartYearResidusMoblesgauge_semicircle","#no_dataYearResidusMoblesgauge_semicircle");else{_("#no_dataYearResidusContenidorgauge_semicircle","#chartYearResidusContenidorgauge_semicircle"),_("#no_dataYearResidusMoblesgauge_semicircle","#chartYearResidusMoblesgauge_semicircle");const t=rn(e.resultset,!1),r=t.Cont,n=t.Mob,o=N("chartYearResidusContenidorgauge_semicircle");X("chartYearResidusContenidorgauge_semicircle",W(r,"KGS. DE RESIDUS EN CONTENIDORS: ÚLTIMS ANYS",o)),X("chartYearResidusMoblesgauge_semicircle",W(n,"KGS. DE RESIDUS EN MOBLES: ÚLTIMS ANYS",o))}}function dn(t,e){if(0===e.resultset.length)D("#chartDesKgsGauge","#no_dataDesKgsPie");else{_("#no_dataDesKgsPie","#chartDesKgsGauge");const t=e.resultset;document.querySelector("#idDesKgs").addEventListener("click",(()=>{requestAnimationFrame((()=>{const e=N("chartDesKgsGauge"),r=Mt(t,e);X("chartDesKgsGauge",Y("KGS. DE RESIDUS RSU RESTA: ÚLTIMS ANYS",r[0],r[1],e))}))}))}}function pn(t,e){if(0===e.resultset.length)D("#chartResidusContenidorBarMonth","#no_dataResidusContenidorBarMonth");else{_("#no_dataResidusContenidorBarMonth","#chartResidusContenidorBarMonth");const t=rn(e.resultset),r=t.Cont,n=t.Mob;X("chartResidusContenidorBarMonth",F(r,"Kgs",void 0,"KGS. DE RESIDUS EN CONTENIDORS: EVOLUCIÓ MENSUAL","Contenidor")),X("chartResidusMoblesBarMonth",F(n,"Kgs",void 0,"KGS. DE RESIDUS EN MOBLES: EVOLUCIÓ MENSUAL","Moble"))}}function gn(t,e){0===e.resultset.length?D("#chartDesKgsBar","#no_dataDesKgsBar"):(_("#no_dataDesKgsBar","#chartDesKgsBar"),X("chartDesKgsBar",F(e.resultset,"Kgs",void 0,"KGS. DE RESIDUS RSU RESTA: HISTÒRIC MENSUAL","RSU Resta")))}function mn(t,e){if(0===e.resultset.length)D("#chartDesKgsPie","#no_dataDesKgsPie");else{_("#no_dataDesKgsPie","#chartDesKgsPie");const t=e.resultset,r=[],n=0,o=1,a=2;for(let e=0;e<t.length;e+=1)r.push({value:t[e][o],name:t[e][n]});document.querySelector("#idDesKgs").addEventListener("click",(()=>{requestAnimationFrame((()=>{const e=N("chartDesKgsPie");X("chartDesKgsPie",j(`KGS. DE RESIDUS DE RECICLATGE: DISTRIBUCIÓ ANY ${t[0][a]}`,r,e+5,on))}))}))}}const yn={es_ES:new Map([["TittleAccChart","EVOLUCIÓN DIARIA ACCESOS A LA SEDE ELECTRÓNICA"],["Acces","Accesos"],["TittleInstancesChart","INSTANCIAS SEDE ELECTRÓNICA: EVOLUCIÓN DIARIA"],["InstancesChartText","Instancias electrónicas"],["Instances","Instancias"],["TittleInstancesYearlyChart","INSTANCIAS SEDE ELECTRÓNICA: DESGLOSE DE LOS ULTIMOS AÑOS"],["TittleAccessYearlyChart","ACCESOS A LA SEDE ELECTRÓNICA: DESGLOSE DE LOS ULTIMOS AÑOS"],["TittleInstancesMonthlyChart","INSTANCIAS SEDE ELECTRÓNICA: EVOLUCIÓN MENSUAL"],["TittleAccessMonthlyChart","ACCESOS A SEDE ELECTRÓNICA: EVOLUCIÓN MENSUAL"],["TittleInstancesPrevYearsChart","INSTANCIAS SEDE ELECTRÓNICA: ULTIMOS AÑOS"],["TittleAccessPrevYearsChart","ACCESOS SEDE ELECTRÓNICA: ULTIMOS AÑOS"],["TittleInstancesCurrMonth","INSTANCIAS SEDE ELECTRÓNICA: MES ACTUAL"],["TittleInstancesPrevMonth","INSTANCIAS SEDE ELECTRÓNICA: MES ANTERIOR"],["TittleAccessCurrMonth","ACCESOS SEDE ELECTRÓNICA: MES ACTUAL"],["TittleAccessPrevMonth","ACCESOS SEDE ELECTRÓNICA: MES ANTERIOR"]]),ca_ES:new Map([["TittleAccChart","ACCESSOS A SEU ELECTRÒNICA: EVOLUCIÓ DIÀRIA"],["Acces","Accessos"],["TittleInstancesChart","INSTÀNCIES SEU ELECTRÒNICA: EVOLUCIÓ DIÀRIA"],["InstancesChartText","Instancias electrónicas"],["Instances","Instàncies"],["TittleInstancesYearlyChart","INSTÀNCIES SEU ELECTRÒNICA: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["TittleAccessYearlyChart","ACCESSOS A SEU ELECTRÒNICA: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["TittleInstancesMonthlyChart","INSTÀNCIES SEU ELECTRÒNICA: EVOLUCIÓ MENSUAL"],["TittleAccessMonthlyChart","ACCESSOS A SEU ELECTRÒNICA: EVOLUCIÓ MENSUAL"],["TittleInstancesPrevYearsChart","INSTÀNCIES SEU ELECTRÒNICA: ÚLTIMS ANYS"],["TittleAccessPrevYearsChart","ACCESSOS A SEU ELECTRÒNICA: ÚLTIMS ANYS"],["TittleInstancesCurrMonth","INSTÀNCIES SEU ELECTRÒNICA: MES ACTUAL"],["TittleInstancesPrevMonth","INSTÀNCIES SEU ELECTRÒNICA: MES ANTERIOR"],["TittleAccessCurrMonth","ACCESSOS SEU ELECTRÒNICA: MES ACTUAL"],["TittleAccessPrevMonth","ACCESSOS A SEU ELECTRÒNICA: MES ANTERIOR"]])};function Sn(e,r){if(0===r.resultset.length)D("#chartSeuElectronica","#no_dataSeuElectronica");else{_("#no_dataSeuElectronica","#chartSeuElectronica");const e=r.resultset,n=r.resultset.length,o=new Set,a=[];for(let t=0;t<n;t+=1)o.add(e[t][0]),a.push(e[t][1]);const i=It(o.size);X("chartSeuElectronica",P([{name:yn[t].get("Acces"),type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:a}],null,Array.from(o.values()),yn[t].get("Acces"),i,!0,f,void 0,yn[t].get("TittleAccChart")))}}function An(e,r){if(0===r.resultset.length)D("#chartInstanciesSeuElectronica","#no_dataInstanciesSeuElectronica");else{_("#no_dataInstanciesSeuElectronica","#chartInstanciesSeuElectronica");const e=r.resultset,n=r.resultset.length,o=new Set,a=[],i=[];for(let t=0;t<n;t+=1)o.add(gt(e[t][0])),a.push(gt(e[t][0])),i.push(e[t][1]);const s=It(o.size);X("chartInstanciesSeuElectronica",P([{name:yn[t].get("InstancesChartText"),type:"line",symbol:"circle",symbolSize:6,smooth:!1,itemStyle:{color:"#3f02f7"},data:i}],null,Array.from(o.values()),yn[t].get("Instances"),s,!0,20,void 0,yn[t].get("TittleInstancesChart")))}}function bn(e,r){0===r.resultset.length?D("#chartInstancesSeuElectronica_BarMonth","#no_dataInstancesSeuElectronica_BarMonth"):(_("#no_dataInstancesSeuElectronica_BarMonth","#chartInstancesSeuElectronica_BarMonth"),X("chartInstancesSeuElectronica_BarMonth",F(r.resultset,yn[t].get("Instances"),void 0,yn[t].get("TittleInstancesMonthlyChart"),yn[t].get("InstancesChartText"))))}function En(e,r){0===r.resultset.length?D("#chartSeuElectronica_BarMonth","#no_dataSeuElectronica_BarMonth"):(_("#no_dataSeuElectronica_BarMonth","#chartSeuElectronica_BarMonth"),X("chartSeuElectronica_BarMonth",F(r.resultset,yn[t].get("Acces"),void 0,yn[t].get("TittleAccessMonthlyChart"))))}function In(e,r){if(0===r.resultset.length)D("#chartYearInstancesSeuElectronica_gauge_semicircle","#no_dataYearInstancesSeuElectronica_gauge_semicircle");else{_("#no_dataYearInstancesSeuElectronica_gauge_semicircle","#chartYearInstancesSeuElectronica_gauge_semicircle");const e=N("chartYearSeuElectronica_gauge_semicircle");X("chartYearInstancesSeuElectronica_gauge_semicircle",W(r.resultset,yn[t].get("TittleInstancesPrevYearsChart"),e))}}function wn(e,r){if(0===r.resultset.length)D("#chartYearSeuElectronica_gauge_semicircle","#no_dataYearSeuElectronica_gauge_semicircle");else{_("#no_dataYearSeuElectronica_gauge_semicircle","#chartYearSeuElectronica_gauge_semicircle");const e=N("chartYearSeuElectronica_gauge_semicircle");X("chartYearSeuElectronica_gauge_semicircle",W(r.resultset,yn[t].get("TittleAccessPrevYearsChart"),e))}}function vn(e,r){if(0===r.resultset.length)D("#chartInstancesSeuElectronica_reloj_semicircle","#no_dataInstancesSeuElectronica_reloj_semicircle"),D("#chartInstancesSeuElectronica_reloj_semicircle_lastmonth","#no_dataInstancesSeuElectronica_reloj_semicircle_lastmonth");else{_("#no_dataInstancesSeuElectronica_reloj_semicircle","#chartInstancesSeuElectronica_reloj_semicircle"),_("#no_dataInstancesSeuElectronica_reloj_semicircle_lastmonth","#chartInstancesSeuElectronica_reloj_semicircle_lastmonth");const e=0,n=1,o=r.resultset,a=N("chartSeuElectronica_reloj_semicircle");X("chartInstancesSeuElectronica_reloj_semicircle",Z(o,e,yn[t].get("TittleInstancesCurrMonth"),a)),X("chartInstancesSeuElectronica_reloj_semicircle_lastmonth",Z(o,n,yn[t].get("TittleInstancesPrevMonth"),a))}}function Mn(e,r){if(0===r.resultset.length)D("#chartSeuElectronica_reloj_semicircle","#no_dataSeuElectronica_reloj_semicircle"),D("#chartSeuElectronica_reloj_semicircle_lastmonth","#no_dataSeuElectronica_reloj_semicircle_lastmonth");else{_("#no_dataSeuElectronica_reloj_semicircle","#chartSeuElectronica_reloj_semicircle"),_("#no_dataSeuElectronica_reloj_semicircle_lastmonth","#chartSeuElectronica_reloj_semicircle_lastmonth");const e=0,n=1,o=r.resultset,a=N("chartSeuElectronica_reloj_semicircle");X("chartSeuElectronica_reloj_semicircle",Z(o,e,yn[t].get("TittleAccessCurrMonth"),a)),X("chartSeuElectronica_reloj_semicircle_lastmonth",Z(o,n,yn[t].get("TittleAccessPrevMonth"),a))}}function Tn(t,e){if(0===e.resultset.length)(0,$t.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{const r={title:{text:t.chartName},xAxis:{name:`\n\n\n\n${t.yAxisName}`}};(0,$t.initStackedBarChartMonthSeries)(t.idChart,e.resultset,r)}}function Cn(t,e){Tn({idChart:"chartInstancesSeuElectronica_stackedBarYears",idNoData:"no_dataInstancesSeuElectronica_stackedBarYears",chartName:yn[zt].get("TittleInstancesYearlyChart"),yAxisName:yn[zt].get("Instances")},e)}function Dn(t,e){Tn({idChart:"chartSeuElectronica_stackedBarYears",idNoData:"no_dataSeuElectronica_stackedBarYears",chartName:yn[zt].get("TittleAccessYearlyChart"),yAxisName:yn[zt].get("Acces")},e)}function Ln(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataInstanciesDonadesAlta").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show();const t=e.resultset,r=new Set,n=[],o=[],a=[],i=1130,s=1124,l=1122;t.forEach((t=>{t[0]===i&&(r.add(t[1]),n.push(t[2])),t[0]===l&&(r.add(t[1]),a.push(t[2])),t[0]===s&&(r.add(t[1]),o.push(t[2]))}));const c=It(r.size),u=25,h=-5,f=[{name:"Instàncies",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:a}],d=[{name:"Expedients",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:o}],p=P([{name:"Tasques",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:n}],null,Array.from(r.values()),"Tasques",c,!0,h,void 0,"TASQUES ADMINISTRATIVES PIAE REALITZADES: EVOLUCIÓ DIÀRIA"),g=P(f,null,Array.from(r.values()),"Instàncies",c,!0,u,void 0,"INSTÀNCIES PIAE DONADES D'ALTA: EVOLUCIÓ DIÀRIA"),m=P(d,null,Array.from(r.values()),"Expedients",c,!0,u,void 0,"EXPEDIENTS PIAE DONADES D'ALTA: EVOLUCIÓ DIÀRIA");X("chartInstanciesDonadesAlta",g),X("chartAdministrativesRealitzades",p),X("chartExpDonatsAlta",m)}}function _n(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataResolucionsAssentades").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show(),$("#chartResolucionsAssentades").css("background","#ffffff"),$("#chartResolucionsAssentades").show(),$("#chartNotificacionsTelematic").css("background","#ffffff"),$("#chartNotificacionsTelematic").show();const t=e.resultset,r=e.resultset.length,n=new Set,o=[];for(let e=0;e<r;e+=1)n.add(t[e][0]),o.push(t[e][1]);const a=It(n.size),i=35;X("chartResolucionsAssentades",P([{name:"Resolucions",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:o}],null,Array.from(n.values()),"Resolucions",a,!0,i,void 0,"RESOLUCIONS PIAE ASSENTADES: EVOLUCIÓ DIÀRIA"))}}function Un(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataNotificacionsTelematic").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show(),$("#chartResolucionsAssentades").css("background","#ffffff"),$("#chartResolucionsAssentades").show(),$("#chartNotificacionsTelematic").css("background","#ffffff"),$("#chartNotificacionsTelematic").show();const t=e.resultset,r=e.resultset.length,n=new Set,o=[];for(let e=0;e<r;e+=1)n.add(t[e][0]),o.push(t[e][1]);const a=It(n.size),i=40;X("chartNotificacionsTelematic",P([{name:"Notificacions",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:o}],null,Array.from(n.values()),"Notificacions",a,!0,i,void 0,"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: EVOLUCIÓ DIÀRIA"))}}const On=0,Nn=1,kn=2,Pn=3,Rn=4,xn=1130,Bn=1124,$n=1122,Fn=1143,Gn=1139;function zn(t){const e=[],r=[],n=[],o=[],a=[];return t.forEach((t=>{t[0]===xn?n.push([t[1],t[2],t[3]]):t[0]===$n?e.push([t[1],t[2],t[3]]):t[0]===Bn?r.push([t[1],t[2],t[3]]):t[0]===Fn?o.push([t[1],t[2],t[3]]):t[0]===Gn&&a.push([t[1],t[2],t[3]])})),[e,r,n,a,o]}function Vn(t,e){[{chartId:`#chartInstanciesDonadesAlta${t}`,noDataId:`#no_dataInstanciesDonadesAlta${t}`},{chartId:`#chartExpDonadesAlta${t}`,noDataId:`#no_dataExpDonadesAlta${t}`},{chartId:`#chartAdministrativesDonadesAlta${t}`,noDataId:`#no_dataAdministrativesDonadesAlta${t}`},{chartId:`#chartResDonadesAlta${t}`,noDataId:`#no_dataResDonadesAlta${t}`},{chartId:`#chartNotificacionsDonadesAlta${t}`,noDataId:`#no_dataNotificacionsDonadesAlta${t}`}].forEach((({chartId:t,noDataId:r})=>{e?_(t,r):D(r,t)}))}function jn(t,e){if(0===e.resultset.length)Vn("BarMonth");else{Vn("BarMonth");const t=zn(e.resultset),r=-30,n=F(t[On],"Instàncies",r,"INSTÀNCIES PIAE DONADES D'ALTA: EVOLUCIÓ MENSUAL"),o=F(t[Nn],"Expedients",r,"EXPEDIENTS PIAE DONADES D'ALTA: EVOLUCIÓ MENSUAL"),a=F(t[kn],"Tasques",r,"TASQUES ADMINISTRATIVES PIAE REALITZADES: EVOLUCIÓ MENSUAL"),i=F(t[Pn],"Resolucions",r,"RESOLUCIONS PIAE ASSENTADES: EVOLUCIÓ MENSUAL"),s=F(t[Rn],"Notificacions",r+15,"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: EVOLUCIÓ MENSUAL");X("chartInstanciesDonadesAltaBarMonth",n),X("chartExpDonadesAltaBarMonth",o),X("chartAdministrativesDonadesAltaBarMonth",a),X("chartResDonadesAltaBarMonth",i),X("chartNotificacionsDonadesAltaBarMonth",s)}}function Yn(t,e){if(0===e.resultset.length)Vn("StackedBarYears");else{Vn("StackedBarYears");const t=zn(e.resultset),r={title:{text:"INSTÀNCIES PIAE DONADES D'ALTA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nInstàncies"}};(0,$t.initStackedBarChartMonthSeries)("chartInstanciesDonadesAltaStackedBarYears",t[On],r);const n={title:{text:"EXPEDIENTS PIAE DONATS D'ALTA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nExpedients"}};(0,$t.initStackedBarChartMonthSeries)("chartExpDonadesAltaStackedBarYears",t[Nn],n);const o={title:{text:"TASQUES ADMINISTRATIVES PIAE REALITZADES: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nTasques"}};(0,$t.initStackedBarChartMonthSeries)("chartAdministrativesDonadesAltaStackedBarYears",t[kn],o);const a={title:{text:"RESOLUCIONS PIAE ASSENTADES: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nResolucions"}};(0,$t.initStackedBarChartMonthSeries)("chartResDonadesAltaStackedBarYears",t[Pn],a);const i={title:{text:"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nNotificacions"}};(0,$t.initStackedBarChartMonthSeries)("chartNotificacionsDonadesAltaStackedBarYears",t[Rn],i)}}function Wn(t,e){if(0===e.resultset.length)Vn("GaugeMonth");else{Vn("GaugeMonth");const t=0,r=1,n=zn(e.resultset),o=N("chartInstanciesDonadesAltaGaugeMonth"),a=Z(n[On],t,"INSTÀNCIES PIAE DONADES D'ALTA: MES ACTUAL",o),i=Z(n[Nn],t,"EXPEDIENTS PIAE DONADES D'ALTA: MES ACTUAL",o),s=Z(n[kn],t,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ACTUAL",o),l=Z(n[Pn],t,"RESOLUCIONS PIAE ASSENTADES: MES ACTUAL",o),c=Z(n[Rn],t,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ACTUAL",o);X("chartInstanciesDonadesAltaGaugeMonth",a),X("chartExpDonadesAltaGaugeMonth",i),X("chartAdministrativesDonadesAltaGaugeMonth",s),X("chartResDonadesAltaGaugeMonth",l),X("chartNotificacionsDonadesAltaGaugeMonth",c);const u=Z(n[On],r,"INSTÀNCIES PIAE DONADES D'ALTA: MES ANTERIOR",o),h=Z(n[Nn],r,"EXPEDIENTS PIAE DONADES D'ALTA: MES ANTERIOR",o),f=Z(n[kn],r,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ANTERIOR",o),d=Z(n[Pn],r,"RESOLUCIONS PIAE ASSENTADES: MES ANTERIOR",o),p=Z(n[Rn],r,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ANTERIOR",o);X("chartInstanciesDonadesAltaGaugeLastMonth",u),X("chartExpDonadesAltaGaugeLastMonth",h),X("chartAdministrativesDonadesAltaGaugeLastMonth",f),X("chartResDonadesAltaGaugeLastMonth",d),X("chartNotificacionsDonadesAltaGaugeLastMonth",p)}}function Zn(t,e){if(0===e.resultset.length)Vn("GaugeYear");else{Vn("GaugeYear");const t=function(t){const e=[],r=[],n=[],o=[],a=[];return t.forEach((t=>{t[0]===xn?n.push([t[1],t[2]]):t[0]===$n?e.push([t[1],t[2]]):t[0]===Bn?r.push([t[1],t[2]]):t[0]===Fn?a.push([t[1],t[2]]):t[0]===Gn&&o.push([t[1],t[2]])})),[e,r,n,o,a]}(e.resultset),r=N("chartInstanciesDonadesAltaGaugeYear"),n=W(t[On],"INSTÀNCIES PIAE DONADES D'ALTA: ÚLTIMS ANYS",r),o=W(t[Nn],"EXPEDIENTS PIAE DONADES D'ALTA: ÚLTIMS ANYS",r),a=W(t[kn],"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: ÚLTIMS ANYS",r),i=W(t[Pn],"RESOLUCIONS PIAE ASSENTADES: ÚLTIMS ANYS",r),s=W(t[Rn],"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: ÚLTIMS ANYS",r);X("chartInstanciesDonadesAltaGaugeYear",n),X("chartExpDonadesAltaGaugeYear",o),X("chartAdministrativesDonadesAltaGaugeYear",a),X("chartResDonadesAltaGaugeYear",i),X("chartNotificacionsDonadesAltaGaugeYear",s)}}function Jn(t,e){vt(e,!0,15,"TEMPERATURA MITJANA DIÀRIA","ºC","chartTemperatureMitjanaDiaria","no_dataTemperatureMitjanaDiaria",void 0,void 0,!0,0)}function Hn(t,e){let r="MITJANA DIÀRIA DE SOROLL : ";const n=e.filter((e=>e[5]===t)),o=new Set(["Matí","Vesprada","Nit"]),a=new Set,i={name:"Matí",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:[],markLine:{data:[{yAxis:d}],lineStyle:{color:"#5470c6"}}},s={name:"Vesprada",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:[],markLine:{data:[{yAxis:d}],lineStyle:{color:"#5470c6"}}},l={name:"Nit",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:[],markLine:{data:[{yAxis:p}],lineStyle:{color:"#fac858"}}};r+=n[0][5],n.forEach((t=>{i.data.push(t[6]),s.data.push(t[7]),l.data.push(t[8]),a.add(gt(t[1]))}));const c=It(a.size);X("chartSonometroMapa",P([i,s,l],Array.from(o.values()),Array.from(a.values()),"dB",c,!0,-10,void 0,r))}const qn="MITJANA DE SOROLL: ";function Kn(t,e,r,n,o,a){const i=e.resultset,s=`resultadoDirecciones${a}`,l=Dashboards.getParameterValue(s).map((t=>t[0])),c=[],u={},h=i.map((t=>{const e=t[0].split("-");return`${e[2]}/${e[1]}/${e[0]}`}));Array.from(new Set(h)).forEach((t=>{u[t]=Array(l.length).fill(null)})),i.forEach((t=>{const e=gt(t[0]);l.every(((r,n)=>t[1].toString()!==r||(u[e][n]=t[2],!1)))})),l.forEach(((t,e)=>{const r={name:"",type:"line",smooth:!1,data:[],symbol:"circle",symbolSize:6,markLine:{data:[{yAxis:n}],lineStyle:{color:"#ff9933"}}},o=Object.values(u).map((t=>t[e]));r.name=t,r.data=o,c.push(r)}));const f=It(Array.from(Object.keys(u)).length),d=l.map((t=>({[t]:!1}))),p={};d.forEach(((t,e)=>{const r=Object.keys(t)[0];p[r]=e<4||t[r]})),X(r,P(c,l,Array.from(Object.keys(u)),"dB",f,!0,-10,void 0,o,void 0,void 0,p))}function Xn(t,e,r,n){const o=`${n.toUpperCase()} MATÍ`;Kn(0,e,r+n,d,qn+o,n)}function Qn(t,e,r,n){const o=`${n.toUpperCase()} VESPRADA`;Kn(0,e,r+n,d,qn+o,n)}function to(t,e,r,n){const o=`${n.toUpperCase()} NIT`;Kn(0,e,r+n,p,qn+o,n)}function eo(){var t;let e;const r=L.icon({iconUrl:"/pentaho/api/repos/public/sc_valencia/Ciutat%3Abuild/images/mapas/marker-icon-sonometros.svg/content",iconSize:[34,34],shadowSize:[50,64],iconAnchor:[17,17],shadowAnchor:[4,62],popupAnchor:[0,-26]}),n=L.icon({iconUrl:"/pentaho/api/repos/public/sc_valencia/Ciutat%3Abuild/images/mapas/marker-icon-selected-sonometros.svg/content",iconSize:[34,34],shadowSize:[50,64],iconAnchor:[17,17],shadowAnchor:[4,62],popupAnchor:[0,-26]});t=L.map("myMap").setView([39.47225,-.37739],14);let o=L.tileLayer("https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',subdomains:"abcd",maxZoom:20});t.setMinZoom(5),t.setMaxZoom(20),o.addTo(t),L.geoJSON(legacy.obtenerGeoJson(resultadoSonometros,0,5,9),{onEachFeature:function(t,o){console.log(o),function(t,e){if(t.properties&&t.properties.objectoId){let r=t.properties.address;e.bindPopup(r),e.on("click",(()=>legacy.createChart(r,resultadoSonometros)))}}(t,o),function(t){t.on("click",(t=>{var o;o=t.target,e&&e.setIcon(r),e=o,e.setIcon(n)}))}(o)},pointToLayer:function(t,e){return L.marker(e,{icon:r})}}).addTo(t)}function ro(t,e){if(0===e.resultset.length)$("#chartAltUsuarisDiaries").hide(),$("#no_dataAltUsuarisDiaries").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAltUsuarisDiaries").show();else{$("#no_dataAltUsuarisDiaries").hide(),$("#chartAltUsuarisDiaries").css("background","#ffffff"),$("#chartAltUsuarisDiaries").show();const t="WIFI: ALTES D'USUARIS DIÀRIES",r=e.resultset,n=e.resultset.length,o=new Set,a=[],i=[],s=[];for(let t=0;t<n;t+=1)"OCI.DL.001"===r[t][0]&&(o.add(mt(r[t][1])),a.push(r[t][5]),i.push(r[t][6]),s.push(r[t][7]));const l=It(o.size);X("chartAltUsuarisDiaries",P([{name:"Nombre d'altes de funcionari",type:"bar",smooth:!1,data:i},{name:"Nombre d'altes de ciutadans",type:"bar",smooth:!1,data:a},{name:"Nombre d'altes de Wifi4EU",type:"bar",smooth:!1,data:s}],["Nombre d'altes de funcionari","Nombre d'altes de Wifi4EU"],Array.from(o.values()),"Usuaris",l,!0,void 0,void 0,t))}}function no(t,e){document.querySelector("#tabUsuarisConectadosDiaries").addEventListener("click",(()=>{requestAnimationFrame((()=>{x("chartConectadosMesActual","chartConectadosMesAnterior","no_dataConectadosMesActual","no_dataConectadosMesAnterior",e.resultset,"CONNEXIONS WIFI DIÀRIES: EVOLUCIÓ ","CONNEXIONS WIFI DIÀRIES: EVOLUCIÓ ")}))}))}function oo(t,e){document.querySelector("#tabUsuarisConectadosDiaries").addEventListener("click",(()=>{requestAnimationFrame((()=>{B("chartConectadosGaugeYear","no_dataConectadosGaugeYear",e.resultset,"CONNEXIONS WIFI DIÀRIES: EVOLUCIÓ ANY")}))}))}function ao(t,e){vt(e,!0,5,"WIFI: CONNEXIONS DIÀRIES","Usuaris","chartUsuarisConectadosDiaries","no_dataUsuarisConectadosDiaries")}function io(t,e){if(0===e.resultset.length)D("#chartConectadosHorStackedBar","#no_dataConectadosHorStackedBar");else{_("#no_dataConectadosHorStackedBar","#chartConectadosHorStackedBar");const t=e.resultset,r={title:{text:"CONNEXIONS WIFI DIÀRIES: HISTÒRIC ANUAL"},color:["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],xAxis:{name:"\n\n\n\nUsuaris"}};(0,$t.initStackedBarChart)("chartConectadosHorStackedBar",t,r)}}function so(t,e){R("chartConectadosStackedBar","no_dataConectadosStackedBar",e.resultset,"Usuaris","CONNEXIONS WIFI DIÀRIES: HISTÒRIC MENSUAL")}function lo(){(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"),document.querySelector("#iframeValenciaMinut").setAttribute("src","https://lookerstudio.google.com/embed/reporting/14a41533-3cd8-4f75-b303-9a494c0e4a9d/page/6WdoC?hl=ca")}})(),n})()));