!function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}var f="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},l=Array.prototype,p=Object.prototype,h="undefined"!=typeof Symbol?Symbol.prototype:null,d=l.slice,m=p.toString,v=p.hasOwnProperty,g="undefined"!=typeof ArrayBuffer,y="undefined"!=typeof DataView,M=Array.isArray,w=Object.keys,b=Object.create,Y=g&&ArrayBuffer.isView,E=isNaN,A=isFinite,x=!{toString:null}.propertyIsEnumerable("toString"),O=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],N=Math.pow(2,53)-1;function S(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),n=Array(r),i=0;i=0&&r<=N}}function et(t){return function(e){return null==e?void 0:e[t]}}var rt=et("byteLength"),nt=tt(rt),it=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var at,ot=g?function(t){return Y?Y(t)&&!B(t):nt(t)&&it.test(m.call(t))}:(at=!1,function(){return at}),st=et("length");function ut(t,e){e=function(t){for(var e={},r=t.length,n=0;n":">",'"':""","'":"'","`":"`"};function Ft(t,e,r,n,i){if(!(n instanceof e))return t.apply(r,i);var a=function(t){if(!C(t))return{};if(b)return b(t);var e=function(){};e.prototype=t;var r=new e;return e.prototype=null,r}(t.prototype),o=t.apply(a,i);return C(o)?o:a}Lt(jt),Lt(function(t){for(var e={},r=ct(t),n=0,i=r.length;n/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Pt=S((function(t,e){var r=Pt.placeholder,n=function(){for(var i=0,a=e.length,o=Array(a),s=0;s1)$t(s,e-1,r,n),i=n.length;else for(var u=0,c=s.length;u0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}}),2);var Vt,Wt=(Vt=1,function(t,e,r){e=It(e,r);for(var n=st(t),i=Vt>0?0:n-1;i>=0&&i0?o=a>=0?a:Math.max(a+s,o):s=a>=0?Math.min(a+1,s):a+s+1;else if(r&&a&&s)return n[a=r(n,i)]===i?a:-1;if(i!=i)return(a=e(d.call(n,o,s),Z))>=0?a+o:-1;for(a=t>0?o:s-1;a>=0&&a=0}function te(t){return function(t,e,r){if(null==e||r)return Ht(t)||(t=bt(t)),t[_t(t.length-1)];var n=Ht(t)?xt(t):bt(t),i=st(n);e=Math.max(Math.min(e,i),0);for(var a=i-1,o=0;o1&&(n=Tt(n,e[1])),e=ht(t)):(n=ee,e=$t(e,!1,!1),t=Object(t));for(var i=0,a=e.length;i1&&(r=e[1])):(e=Kt($t(e,!1,!1),String),i=function(t,r){return!Zt(e,r)}),re(t,i,r)}));var ne=S((function(t,e){return e=$t(e,!0,!0),Qt(t,(function(t){return!Zt(e,t)}))}));function ie(t,e,r,n){k(e)||(n=r,r=e,e=!1),null!=r&&(r=It(r,n));for(var i=[],a=[],o=0,s=st(t);o0&&void 0!==arguments[0]?arguments[0]:{},r=e.includeComputedColumns,n=void 0===r||r,a="",o=",",s='"';return t.forEach((function(t,e){if(n||!t.isComputed){var r=t.title();r.indexOf(s)>-1&&r.replace(s,"\\"+s),r.indexOf(o)>-1&&(r=s+r+s),a+=(e>0?o:"")+r}})),ae(i.numRows()).forEach((function(e){a+="\n",t.forEach((function(t,r){if(n||!t.isComputed){var i=""+("date"===t.type()?t.raw(e):t.val(e));i.indexOf(s)>-1&&i.replace(s,"\\"+s),i.indexOf(o)>-1&&(i=s+i+s),a+=(r>0?o:"")+i}}))})),a},toCSV:function(){return this.csv.apply(this,arguments)},filterColumns:function(r){return t=t.filter((function(t){return!r[t.name()]})),Xt(r,(function(t,r){t&&e[r]&&delete e[r]})),i},eachRow:function(t){var e;for(e=0;ee&&(t.length=e,r.length=e),i},columnOrder:function(e){return arguments.length?(t.length=0,e.forEach((function(e){t.push(r[e])})),i):t.map((function(t){return r.indexOf(t)}))},align:function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=Math.max.apply(Math,o(t.map((function(t){return t.length})))),i=c(t);try{for(i.s();!(e=i.n()).done;){var a=e.value,s=Array(n-a.length).fill(r);a.add.apply(a,o(s))}}catch(t){i.e(t)}finally{i.f()}},clone:function(){return se(t.map((function(t){return t.clone()})))},clear:function(){var e,r=c(t);try{for(r.s();!(e=r.n()).done;){e.value.clear()}}catch(t){r.e(t)}finally{r.f()}},deleteRow:function(e){return t.forEach((function(t){t.deleteRow(e)})),i}};return i}function ue(t,e){return Math.abs(t-e)<1e-6}S((function(t,e){return ne(t,e)})),S((function(t){return ie($t(t,!0,!0))})),S((function(t){for(var e=t&&function(t,e,r){var n,i,a=-1/0,o=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,u=(t=Ht(t)?t:bt(t)).length;sa&&(a=n);else e=It(e,r),Xt(t,(function(t,r,n){((i=e(t,r,n))>o||i===-1/0&&a===-1/0)&&(a=t,o=i)}));return a}(t,st).length||0,r=Array(e),n=0;ns[1]&&(s[0]=r,s[1]=o[r]))}))})),e=s[0];var u={parse:function(t){if(_(t)||T(t)||D(t))return t;var n=t.replace("%","").replace("−","-").replace(/[  ]/g,"").replace("–","-").replace("—","-");return"-"!==e[0]&&(n=n.replace(new RegExp("."===e[0]?"\\.":e[0],"g"),"")),"."!==e[1]&&(n=n.replace(e[1],".")),isNaN(n)||""===n?(a[n.toLowerCase()]||""===n||r++,t):Number(n)},toNum:function(t){return t},fromNum:function(t){return t},errors:function(){return r},name:function(){return"number"},formatter:function(t){var e=t["number-format"]||"-",r=Number(t["number-divisor"]||0),n=(t["number-append"]||"").replace(/ /g," "),i=(t["number-prepend"]||"").replace(/ /g," ");return function(t,a,o){if(isNaN(t))return t;var s=e;if(0!==r&&"-"===s&&(s="n1"),0!==r&&(t=Number(t)/Math.pow(10,r)),"s"===s.substr(0,1)){var u=+s.substr(1);s="n"+Math.max(0,function(t,e){return 0===t?0:Math.round(e-Math.ceil(Math.log(Math.abs(t))/Math.LN10))}(t,u))}return o&&(s="n0"),"-"===s&&(s=ue(t,Math.round(t))?"n0":ue(t,.1*Math.round(10*t))?"n1":ue(t,.01*Math.round(100*t))?"n2":ue(t,.001*Math.round(1e3*t))?"n3":ue(t,1e-4*Math.round(1e4*t))?"n4":ue(t,1e-5*Math.round(1e5*t))?"n5":"n6"),t=Globalize.format(t,"-"!==s?s:null),a?i+t+n:t}},isValid:function(t){return""===t||a[String(t).toLowerCase()]||_(u.parse(t))},ambiguousFormats:function(){var t=[];return Xt(o,(function(e,r){e===s[1]&&t.push([r,i[r]])})),t},format:function(t){return arguments.length?(e=t,u):e}};return u},date:function(t){var e,r=0,n={},i=["",0];t=t||[],Xt(be,(function(e,r){Xt(t,(function(t){void 0===n[r]&&(n[r]=0),Ee(t,r)&&(n[r]+=1,n[r]>i[1]&&(i[0]=r,i[1]=n[r]))}))})),e=i[0];var a={parse:function(t){if(L(t)||T(t))return t;if(!e||!I(t))return r++,t;var n,i,a,o=(n=t.toLowerCase(),j((a=be[i=e]).parse)?n.match(a.parse):a.parse(n,i));if(!o)return r++,t;function s(t){return(t=+t)<30?2e3+t:1900+t}Ee(t,e)||r++;var u=(new Date).getFullYear();switch(e){case"YYYY":return new Date(o[1],0,1);case"YYYY-H":return new Date(o[1],6*(o[2]-1),1);case"H-YYYY":return new Date(o[2],6*(o[1]-1),1);case"YYYY-Q":return new Date(o[1],3*(o[2]-1),1);case"Q-YYYY":return new Date(o[2],3*(o[1]-1),1);case"YYYY-M":return new Date(o[1],o[2]-1,1);case"M-YYYY":return new Date(o[2],o[1]-1,1);case"YYYY-MMM":return new Date(+o[1],we[o[2]],1);case"MMM-YYYY":return new Date(+o[2],we[o[1]],1);case"MMM-YY":return new Date(s(+o[2]),we[o[1]],1);case"MMM":return new Date(u,we[o[1]],1);case"YYYY-WW":return Ae(o[1],o[2],1);case"WW-YYYY":return Ae(o[2],o[1],1);case"YYYY-WW-d":return Ae(o[1],o[2],o[3]);case"YYYY-MM-DD":return new Date(o[1],o[3]-1,o[4]);case"DD/MM/YYYY":return new Date(o[4],o[3]-1,o[1]);case"DD/MMM/YYYY":return new Date(o[4],we[o[3]],o[1]);case"DD/MMM/YY":return new Date(s(o[4]),we[o[3]],o[1]);case"MM/DD/YYYY":return new Date(o[4],o[1]-1,o[3]);case"MM/DD/YY":return new Date(s(o[4]),o[1]-1,o[3]);case"DD/MM/YY":return new Date(s(o[4]),o[3]-1,o[1]);case"MMM-DD-YYYY":return new Date(o[3],we[o[1]],o[2]);case"YYYY-MM-DD HH:MM":return new Date(+o[1],o[3]-1,+o[4],xe(+o[5],o[8]),+o[6]||0,+o[7]||0);case"DD.MM.YYYY HH:MM":return new Date(+o[4],o[3]-1,+o[1],xe(+o[5],o[8]),+o[6]||0,+o[7]||0);case"MM/DD/YYYY HH:MM":return new Date(+o[4],o[1]-1,+o[3],xe(+o[5],o[8]),+o[6]||0,+o[7]||0);case"ISO8601":return new Date(o.toUpperCase());default:console.warn("unknown format",e)}return r++,t},toNum:function(t){return L(t)?t.getTime():Number.NaN},fromNum:function(t){return new Date(t)},errors:function(){return r},name:function(){return"date"},format:function(t){return arguments.length?(e=t,a):e},precision:function(){return be[e].precision},formatter:function(){if(!e)return St;var t=Globalize.culture().calendar.patterns.M.replace("MMMM","MMM");switch(be[e].precision){case"year":return function(t){return L(t)?t.getFullYear():t};case"half":return function(t){return L(t)?t.getFullYear()+" H"+(t.getMonth()/6+1):t};case"quarter":return function(t){return L(t)?t.getFullYear()+" Q"+(t.getMonth()/3+1):t};case"month":return function(t){return L(t)?Globalize.format(t,"MMM yy"):t};case"week":return function(t){return L(t)?function(t){var e=t.getUTCDay(),r=new Date(t.valueOf());r.setDate(r.getDate()-(e+6)%7+3);var n=r.getUTCFullYear(),i=Math.floor((r.getTime()-new Date(n,0,1,-6))/864e5);return[n,1+Math.floor(i/7),e>0?e:7]}(t).slice(0,2).join(" W"):t};case"day":return function(t,e){return L(t)?Globalize.format(t,e?"D":"d"):t};case"day-minutes":return function(e){return L(e)?Globalize.format(e,t).replace(" "," ")+" - "+Globalize.format(e,"t").replace(" "," "):e};case"day-seconds":return function(t){return L(t)?Globalize.format(t,"T").replace(" "," "):t}}},isValid:function(t){return L(a.parse(t))},ambiguousFormats:function(){var t=[];return Xt(n,(function(e,r){e===i[1]&&t.push([r,r])})),t}};return a}},Ne=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,Se=/|<\?(?:php)?[\s\S]*?\?>/gi,Ce="

";function De(t,e){if(null===t)return null;if(void 0!==t){if((t=String(t)).indexOf("<")<0||t.indexOf(">")<0)return t;if(t=function(t,e){e=(((void 0!==e?e||"":Ce)+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var r=t,n=t;for(;;)if(n=(r=n).replace(Se,"").replace(Ne,(function(t,r){return e.indexOf("<"+r.toLowerCase()+">")>-1?t:""})),r===n)return n}(t,e),"undefined"==typeof document)return t;var r=document.createElement("div");r.innerHTML=t;for(var n=r.querySelectorAll("*"),i=0;i=1?(t=arguments[0],f=2===arguments.length?arguments[1]:t,p):De(t)},origName:function(){return De(f)},title:function(){return arguments.length?(c=arguments[0],p):De(c||t)},length:e.length,val:function(t,n){if(arguments.length){var i=n?l:e;return t<0&&(t+=i.length),r.parse(L(i[t])||_(i[t])?i[t]:De(i[t]))}},values:function(t){var n=t?l:e;return n=Kt(n,(function(t){return L(t)||_(t)?t:De(t)})),Kt(n,r.parse)},each:function(t){for(var r=0;ra[1]&&(a[1]=t))})),a[0]=r.fromNum(a[0]),a[1]=r.fromNum(a[1])),a)},sum:function(){return!!r.toNum&&(void 0===o&&(o=0,p.each((function(t){var e=r.toNum(t);Number.isFinite(e)&&(o+=e)})),o=r.fromNum(o)),o)},mean:function(){if(!r.toNum)return!1;if(void 0===s){s=0;var t=0;p.each((function(e){var n=r.toNum(e);Number.isFinite(n)&&(s+=n,t++)})),s=r.fromNum(s/t)}return s},median:function(){if(!r.toNum)return!1;if(void 0===u){var t=p.values().map(r.toNum);u=r.fromNum(function(t){var e,r=[],n=t.length,i=-1;if(1===arguments.length)for(;++it&&(l.length=t,e.length=t,p.length=t)},add:function(){var t;l.push.apply(l,arguments),(t=e).push.apply(t,arguments),p.length=e.length},clone:function(){return Te(t,e.slice(),r.name())},clear:function(){e.splice(0),p.length=e.length}};return p.total=p.sum,p}function ke(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i}function Re(t){return null===t?NaN:+t}function Ie(t){return!Z(t)}function _e(t,e){return te?1:t>=e?0:NaN}function Le(t){return{dataset:function(){if(t.url){var e=(new Date).getTime(),r="".concat(t.url).concat(t.url.indexOf("?")>-1?"&":"?","v=").concat(t.url.indexOf("//static.dwcdn.net")>-1?e-e%6e4:e);return window.fetch(r).then((function(t){return t.text()})).then((function(e){return new je(t).parse(e)}))}if(t.csv||""===t.csv)return new Promise((function(e){e(t.csv)})).then((function(e){return new je(t).parse(e)}));throw new Error("you need to provide either an URL or CSV data.")},parse:function(){return new je(t).parse(t.csv)}}}se.delimited=Le;var je=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=Object.assign({delimiter:"auto",quoteChar:'"',skipRows:0,emptyValue:null,transpose:!1,firstRowIsHeader:!0},e),this.__delimiterPatterns=Fe(e.delimiter,e.quoteChar),this.opts=e}var r,n,i;return r=t,(n=[{key:"parse",value:function(t){this.__rawData=t;var e=this.opts;"auto"===e.delimiter&&(e.delimiter=this.guessDelimiter(t,e.skipRows),this.__delimiterPatterns=Fe(e.delimiter,e.quoteChar));var r,n="|"!==e.delimiter?"|":"#";return t=n+"\n"+t.replace(/[ \r\n\f]+$/g,"").replace(/^\uFEFF/,"")+n,r=function(t,e,r){r=r||",";for(var i,a=[[]],o=null;o=t.exec(e);){var s=o[1];s.length&&s!==r&&a.push([]),i=o[2]?o[2].replace(new RegExp('""',"g"),'"'):o[3],a[a.length-1].push(void 0===i?"":i)}a[0][0].substr(0,1)===n&&(a[0][0]=a[0][0].substr(1));var u=a.length-1,c=a[u].length-1,f=a[u][c].length-1;return a[u][c].substr(f)===n&&(a[u][c]=a[u][c].substr(0,f)),a.slice(1)}(this.__delimiterPatterns,t,e.delimiter),e.transpose&&(r=function(t){var e,r,n=t,i=n.length?n.length:0,a=n[0]instanceof Array?n[0].length:0;if(0===a||0===i)return[];var o=[];for(e=0;ee&&(e=s,r=a)})),i[r]}}])&&e(r.prototype,n),i&&e(r,i),t}();function Fe(t,e){return new RegExp("(\\"+t+"|\\r?\\n|\\r|^)(?:"+e+"([^"+e+"]*(?:"+e+'"[^'+e+"]*)*)"+e+"|([^"+e+"\\"+t+"\\r\\n]*))","gi")}function Pe(t){return{dataset:function(){if(t.url)return fetch(t.url).then((function(t){return t.text()})).then((function(t){return JSON.parse(t)}));if(t.csv)return new Promise((function(e){e(t.csv)})).then((function(t){return JSON.parse(t)}));throw new Error("you need to provide either an URL or CSV data.")},parse:function(){return JSON.parse(t.csv)}}}function Ue(t){return Math.max(0,String(t-Math.floor(t)).replace(/00000*[0-9]+$/,"").replace(/33333*[0-9]+$/,"").replace(/99999*[0-9]+$/,"").length-2)}function He(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=Math.pow(10,e);return Math.round(t*r)/r}function $e(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.1,i=[],a=0,o=ie(t.filter(J)),s=o.length,u=Math.floor(s*(1-n));if(o.length<3)return Math.round(o.reduce((function(t,e){if(!e)return t;var r=Math.log(Math.abs(e))/Math.LN10;return r<8&&r>-3?t+Math.min(3,Ue(o[0])):t+(r>0?-1*(r-1):-1*r)}),0)/o.length);ie(o.map(f)).length>u?(e=function(){return ie(i).length===s},r=-1):(e=function(){return ie(i).length<=u},r=1);var c=100;do{i=o.map(f),a+=r}while(e()&&c-- >0);function f(t){return He(t,a)}return c<10&&console.warn("maximum iteration reached",t,i,a),r<0?a+=2:a--,a}function ze(e){if(!e||"object"!==t(e))return e;try{return JSON.parse(JSON.stringify(e))}catch(t){return e}}function Ge(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return null;var r=t.offsetHeight;if(!e)return r;var n=getComputedStyle(t);return r+=parseInt(n.marginTop)+parseInt(n.marginBottom)}function Ve(){for(var t=0,e=document.querySelector(".dw-chart"),r=0;r=this.expression.length?this.newToken("TEOF","EOF"):this.isWhitespace()||this.isComment()?this.next():this.isRadixInteger()||this.isNumber()||this.isOperator()||this.isString()||this.isParen()||this.isBracket()||this.isComma()||this.isSemicolon()||this.isNamedOp()||this.isConst()||this.isName()?this.current:void this.parseError('Unknown character "'+this.expression.charAt(this.pos)+'"')},Xe.prototype.isString=function(){var t=!1,e=this.pos,r=this.expression.charAt(e);if("'"===r||'"'===r)for(var n=this.expression.indexOf(r,e+1);n>=0&&this.pos"9")))break}if(e>t){var n=this.expression.substring(t,e);if(n in this.consts)return this.current=this.newToken("TNUMBER",this.consts[n]),this.pos+=n.length,!0}return!1},Xe.prototype.isNamedOp=function(){for(var t=this.pos,e=t;e"9")))break}if(e>t){var n=this.expression.substring(t,e);if(this.isOperatorEnabled(n)&&(n in this.binaryOps||n in this.unaryOps||n in this.ternaryOps))return this.current=this.newToken(We,n),this.pos+=n.length,!0}return!1},Xe.prototype.isName=function(){for(var t=this.pos,e=t,r=!1;e"9"))break}else r=!0}if(r){var i=this.expression.substring(t,e);return this.current=this.newToken("TNAME",i),this.pos+=i.length,!0}return!1},Xe.prototype.isWhitespace=function(){for(var t=!1,e=this.expression.charAt(this.pos);!(" "!==e&&"\t"!==e&&"\n"!==e&&"\r"!==e||(t=!0,this.pos++,this.pos>=this.expression.length));)e=this.expression.charAt(this.pos);return t};var Ke=/^[0-9a-f]{4}$/i;Xe.prototype.unescape=function(t){var e=t.indexOf("\\");if(e<0)return t;for(var r=t.substring(0,e);e>=0;){var n=t.charAt(++e);switch(n){case"'":r+="'";break;case'"':r+='"';break;case"\\":r+="\\";break;case"/":r+="/";break;case"b":r+="\b";break;case"f":r+="\f";break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"u":var i=t.substring(e+1,e+5);Ke.test(i)||this.parseError("Illegal escape sequence: \\u"+i),r+=String.fromCharCode(parseInt(i,16)),e+=4;break;default:throw this.parseError('Illegal escape sequence: "\\'+n+'"')}++e;var a=t.indexOf("\\",e);r+=t.substring(e,a<0?t.length:a),e=a}return r},Xe.prototype.isComment=function(){return"/"===this.expression.charAt(this.pos)&&"*"===this.expression.charAt(this.pos+1)&&(this.pos=this.expression.indexOf("*/",this.pos)+2,1===this.pos&&(this.pos=this.expression.length),!0)},Xe.prototype.isRadixInteger=function(){var t,e,r=this.pos;if(r>=this.expression.length-2||"0"!==this.expression.charAt(r))return!1;if(++r,"x"===this.expression.charAt(r))t=16,e=/^[0-9a-f]$/i,++r;else{if("b"!==this.expression.charAt(r))return!1;t=2,e=/^[01]$/i,++r}for(var n=!1,i=r;r="0"&&t<="9"||!a&&"."===t);)"."===t?a=!0:o=!0,r++,e=o;if(e&&(i=r),"e"===t||"E"===t){r++;for(var s=!0,u=!1;r="0"&&t<="9"))break;u=!0,s=!1}else s=!1;r++}u||(r=i)}return e?(this.current=this.newToken("TNUMBER",parseFloat(this.expression.substring(n,r))),this.pos=r):this.pos=i,e},Xe.prototype.isOperator=function(){var t=this.pos,e=this.expression.charAt(this.pos);if("+"===e||"-"===e||"*"===e||"/"===e||"%"===e||"^"===e||"?"===e||":"===e||"."===e)this.current=this.newToken(We,e);else if("∙"===e||"•"===e)this.current=this.newToken(We,"*");else if(">"===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(We,">="),this.pos++):this.current=this.newToken(We,">");else if("<"===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(We,"<="),this.pos++):this.current=this.newToken(We,"<");else if("|"===e){if("|"!==this.expression.charAt(this.pos+1))return!1;this.current=this.newToken(We,"||"),this.pos++}else if("="===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(We,"=="),this.pos++):this.current=this.newToken(We,e);else{if("!"!==e)return!1;"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(We,"!="),this.pos++):this.current=this.newToken(We,e)}return this.pos++,!!this.isOperatorEnabled(this.current.value)||(this.pos=t,!1)},Xe.prototype.isOperatorEnabled=function(t){return this.parser.isOperatorEnabled(t)},Xe.prototype.getCoordinates=function(){var t,e=0,r=-1;do{e++,t=this.pos-r,r=this.expression.indexOf("\n",r+1)}while(r>=0&&r=",">","in"];rr.prototype.parseComparison=function(t){for(this.parseAddSub(t);this.accept(We,nr);){var e=this.current;this.parseAddSub(t),t.push(tr(e.value))}};var ir=["+","-","||"];rr.prototype.parseAddSub=function(t){for(this.parseTerm(t);this.accept(We,ir);){var e=this.current;this.parseTerm(t),t.push(tr(e.value))}};var ar=["*","/","%"];function or(t,e){return Number(t)+Number(e)}function sr(t,e){return t-e}function ur(t,e){return t*e}function cr(t,e){return t/e}function fr(t,e){return t%e}function lr(t,e){return t===e}function pr(t,e){return t!==e}function hr(t,e){return t>e}function dr(t,e){return t=e}function vr(t,e){return t<=e}function gr(t,e){return Boolean(t&&e)}function yr(t,e){return Boolean(t||e)}function Mr(t){return Math.log(t)*Math.LOG10E}function wr(t){return-t}function br(t){return!t}function Yr(t){return t<0?Math.ceil(t):Math.floor(t)}function Er(t){return Math.random()*(t||1)}function Ar(t){return Array.isArray(t)?t.length:String(t).length}function xr(t,e,r){return t?e:r}function Or(t,e){return void 0===e||0==+e?Math.round(t):(t=+t,e=-+e,isNaN(t)||"number"!=typeof e||e%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math.round(+(t[0]+"e"+(t[1]?+t[1]-e:-e)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+e:e))))}function Nr(t,e){return t[0|e]}function Sr(t){return 1===arguments.length&&Array.isArray(t)?Math.max.apply(Math,t):Math.max.apply(Math,arguments)}function Cr(t){return 1===arguments.length&&Array.isArray(t)?Math.min.apply(Math,t):Math.min.apply(Math,arguments)}function Dr(t,e){if("function"!=typeof t)throw new Error("First argument to map is not a function");if(!Array.isArray(e))throw new Error("Second argument to map is not an array");return e.map((function(e,r){return t(e,r)}))}function Tr(t,e,r){if("function"!=typeof t)throw new Error("First argument to fold is not a function");if(!Array.isArray(r))throw new Error("Second argument to fold is not an array");return r.reduce((function(e,r,n){return t(e,r,n)}),e)}function kr(t,e){if("function"!=typeof t)throw new Error("First argument to filter is not a function");if(!Array.isArray(e))throw new Error("Second argument to filter is not an array");return e.filter((function(e,r){return t(e,r)}))}function Rr(t){return(t>0)-(t<0)||+t}function Ir(t){return Math.log(1+t)}function _r(t){return Math.log(t)/Math.LN2}function Lr(t){if(!Array.isArray(t))throw new Error("Sum argument is not an array");return t.reduce((function(t,e){return t+Number(e)}),0)}function jr(t,e,r){var n,i,a,o,s,u,c=[];if(Pr(t))return Ur(t,r);for(var f=t.length,l=0;l0;)s.unshift(Ur(c.pop(),r));if(!(o=c.pop()).apply||!o.call)throw new Error(o+" is not a function");c.push(o.apply(void 0,s))}else if("IFUNDEF"===h)c.push(function(){for(var t=c.pop(),n=[],i=p.value;i-- >0;)n.unshift(c.pop());var a=c.pop(),o=function(){for(var i=Object.assign({},r),a=0,o=n.length;a0;)s.unshift(c.pop());c.push(s)}}if(c.length>1)throw new Error("invalid Expression (parity)");return 0===c[0]?0:Ur(c[0],r)}function Fr(t,e,r){return Pr(t)?t:{type:"IEXPREVAL",value:function(r){return jr(t.value,e,r)}}}function Pr(t){return t&&"IEXPREVAL"===t.type}function Ur(t,e){return Pr(t)?t.value(e):t}function Hr(t,e){this.tokens=t,this.parser=e,this.unaryOps=e.unaryOps,this.binaryOps=e.binaryOps,this.ternaryOps=e.ternaryOps,this.functions=e.functions}function $r(t){return t.trim()}function zr(t){this.options=t||{},this.unaryOps={SIN:Math.sin,COS:Math.cos,TAN:Math.tan,ASIN:Math.asin,ACOS:Math.acos,ATAN:Math.atan,SQRT:Math.sqrt,LOG:Math.log,LOG2:Math.log2||_r,LN:Math.log,LOG10:Math.log10||Mr,LG:Math.log10||Mr,LOG1P:Math.log1p||Ir,ABS:Math.abs,CEIL:Math.ceil,FLOOR:Math.floor,ISNULL:function(t){return null===t},TRUNC:Math.trunc||Yr,"-":wr,"+":Number,EXP:Math.exp,NOT:br,LENGTH:Ar,"!":br,SIGN:Math.sign||Rr,TEXT:function(t){return e(t)?t.toISOString():String(t)},NUMBER:Number},this.binaryOps={"+":or,"-":sr,"*":ur,"/":cr,"%":fr,"^":Math.pow,"==":lr,"!=":pr,">":hr,"<":dr,">=":mr,"<=":vr,and:gr,or:yr,in:function(t,e){return Array.isArray(e)?e.includes(t):String(e).includes(t)},"[":Nr},this.ternaryOps={"?":xr};var e=function(t){return t instanceof Date&&!isNaN(t)},r=function(t){if(e(t))return t;try{var r=new Date(t);return e(r)?r:null}catch(t){return null}};function n(t){return(1===arguments.length&&Array.isArray(t)?t:Array.from(arguments)).slice(0).filter((function(t){return!isNaN(t)&&Number.isFinite(t)}))}var a=/\w*/g,o=/\w\S*/g,s=/[\\^$*+?.()|[\]{}]/g;try{a=new RegExp("\\p{L}*","ug"),o=new RegExp("[\\p{L}\\p{N}]\\S*","ug")}catch(t){}this.functions={IF:xr,RANDOM:Er,MIN:function(){var t=n.apply(this,arguments);return Cr(t)},MAX:function(){return Sr(n.apply(this,arguments))},SUM:function(){return Lr(n.apply(this,arguments))},MEAN:function(){var t=n.apply(this,arguments);return Lr(t)/t.length},MEDIAN:function(){var t=n.apply(this,arguments).sort((function(t,e){return t-e})),e=Math.floor(t.length/2);return t.length%2==1?t[e]:.5*(t[e-1]+t[e])},POW:Math.pow,ATAN2:Math.atan2,ROUND:Or,CONCAT:function(){return Array.from(arguments).join("")},TRIM:$r,SUBSTR:function(t,e,r){return t.substr(e,r)},REPLACE:function(t,e,r){return t.replace(new RegExp(String(e).replace(s,"\\$&"),"g"),r)},REPLACE_REGEX:function(t,e,r){return t.replace(new RegExp(e,"g"),r)},SPLIT:function(t,e){return String(t).split(e)},LOWER:function(t){return String(t).toLowerCase()},UPPER:function(t){return String(t).toUpperCase()},PROPER:function(t){return String(t).replace(a,(function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}))},TITLE:function(t){return String(t).replace(o,(function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}))},SORT:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!Array.isArray(t))throw new Error("First argument to SORT is not an array");return t.slice(0).sort((function(t,n){return((t="string"==typeof r?t[r]:"function"==typeof r?r(t):t)>(n="string"==typeof r?n[r]:"function"==typeof r?r(n):n)?1:t2&&void 0!==arguments[2]?arguments[2]:null;if(!Array.isArray(t))throw new Error("First argument to JOIN is not an array");return r?[t.slice(0,t.length-1).join(e),t[t.length-1]].join(r):t.join(e)},MAP:Dr,FOLD:Tr,FILTER:kr,PLUCK:function(t,e){if(!Array.isArray(t))throw new Error("First argument to PLUCK is not an array");return t.map((function(t){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:null}))},INDEXOF:function(t,e){return Array.isArray(t)||(t=String(t)),t.indexOf(e)},FIND:function(t,e){if(!Array.isArray(t))throw new Error("First argument to FIND is not an array");if("function"!=typeof e)throw new Error("Second argument to FIND is not a function");for(var r=t.length,n=0;n1&&(arguments[1]=arguments[1]-1),i(Date,Array.prototype.slice.call(arguments))},YEAR:function(t){return(t=r(t))?t.getFullYear():null},MONTH:function(t){return(t=r(t))?t.getMonth()+1:null},DAY:function(t){return(t=r(t))?t.getDate():null},WEEKDAY:function(t){return(t=r(t))?t.getDay():null},HOURS:function(t){return(t=r(t))?t.getHours():null},MINUTES:function(t){return(t=r(t))?t.getMinutes():null},SECONDS:function(t){return(t=r(t))?t.getSeconds():null},DATEDIFF:function(t,e){return t=r(t),e=r(e),t&&e?(e.getTime()-t.getTime())/864e5:null},TIMEDIFF:function(t,e){return t=r(t),e=r(e),t&&e?(e.getTime()-t.getTime())/1e3:null}},this.unaryOps.LOWER=this.functions.LOWER,this.unaryOps.UPPER=this.functions.UPPER,this.unaryOps.PROPER=this.functions.PROPER,this.unaryOps.TITLE=this.functions.TITLE,this.unaryOps.TRIM=this.functions.TRIM,this.unaryOps.YEAR=this.functions.YEAR,this.unaryOps.MONTH=this.functions.MONTH,this.unaryOps.DAY=this.functions.DAY,this.unaryOps.WEEKDAY=this.functions.WEEKDAY,this.unaryOps.HOURS=this.functions.HOURS,this.unaryOps.MINUTES=this.functions.MINUTES,this.unaryOps.SECONDS=this.functions.SECONDS,this.consts={E:Math.E,PI:Math.PI,TRUE:!0,FALSE:!1,NA:Number.NaN,NULL:Number.NaN}}rr.prototype.parseTerm=function(t){for(this.parseFactor(t);this.accept(We,ar);){var e=this.current;this.parseFactor(t),t.push(tr(e.value))}},rr.prototype.parseFactor=function(t){var e=this.tokens.unaryOps;if(this.save(),this.accept(We,(function(t){return t.value in e}))){if("-"!==this.current.value&&"+"!==this.current.value){if(this.nextToken.type===Be&&"("===this.nextToken.value)return this.restore(),void this.parseExponential(t);if("TSEMICOLON"===this.nextToken.type||"TCOMMA"===this.nextToken.type||"TEOF"===this.nextToken.type||this.nextToken.type===Be&&")"===this.nextToken.value)return this.restore(),void this.parseAtom(t)}var r=this.current;this.parseFactor(t),t.push(Ze(r.value))}else this.parseExponential(t)},rr.prototype.parseExponential=function(t){for(this.parsePostfixExpression(t);this.accept(We,"^");)this.parseFactor(t),t.push(tr("^"))},rr.prototype.parsePostfixExpression=function(t){for(this.parseFunctionCall(t);this.accept(We,"!");)t.push(Ze("!"))},rr.prototype.parseFunctionCall=function(t){var e=this.tokens.unaryOps;if(this.accept(We,(function(t){return t.value in e}))){var r=this.current;this.parseAtom(t),t.push(Ze(r.value))}else for(this.parseMemberExpression(t);this.accept(Be,"(");)if(this.accept(Be,")"))t.push(new Je("IFUNCALL",0));else{var n=this.parseArgumentList(t);t.push(new Je("IFUNCALL",n))}},rr.prototype.parseArgumentList=function(t){for(var e=0;!this.accept(Be,")");)for(this.parseExpression(t),++e;this.accept("TCOMMA");)this.parseExpression(t),++e;return e},rr.prototype.parseMemberExpression=function(t){for(this.parseAtom(t);this.accept(We,".")||this.accept("TBRACKET","[");){var e=this.current;if("."===e.value){if(!this.allowMemberAccess)throw new Error('unexpected ".", member access is not permitted');this.expect("TNAME"),t.push(new Je("IMEMBER",this.current.value))}else{if("["!==e.value)throw new Error("unexpected symbol: "+e.value);if(!this.tokens.isOperatorEnabled("["))throw new Error('unexpected "[]", arrays are disabled');this.parseExpression(t),this.expect("TBRACKET","]"),t.push(tr("["))}}},Hr.prototype.evaluate=function(t){return t=t||{},jr(this.tokens,this,t)},Hr.prototype.variables=function(){return(this.tokens||[]).filter((function(t){return"IVAR"===t.type})).map((function(t){return t.value}))},zr.prototype.parse=function(t){var e=[],r=new rr(this,new Xe(this,t),{allowMemberAccess:!0});return r.parseExpression(e),r.expect("TEOF","EOF"),new Hr(e,this)},zr.prototype.evaluate=function(t,e){return this.parse(t).evaluate(e)};var Gr=new zr;zr.parse=function(t){return Gr.parse(t)},zr.evaluate=function(t,e){return Gr.parse(t).evaluate(e)},zr.keywords=["ABS","ACOS","ACOSH","and","ASIN","ASINH","ATAN","ATAN2","ATANH","CBRT","CEIL","CONCAT","COS","COSH","DATEDIFF","DAY","E","EVERY","EXP","EXPM1","FIND","FLOOR","HOURS","IF","in","INDEXOF","ISNULL","JOIN","LENGTH","LN","LOG","LOG10","LOG1P","LOG2","LOWER","MAP","MAX","MEAN","MEDIAN","MIN","MINUTES","MONTH","NOT","NOT","or","PI","PLUCK","POW","PROPER","RANDOM","RANGE","REPLACE","REPLACE_REGEX","ROUND","SECONDS","SIGN","SIN","SINH","SLICE","SOME","SORT","SPLIT","SQRT","SUBSTR","SUM","TAN","TANH","TIMEDIFF","TITLE","TRIM","TRUNC","UPPER","WEEKDAY","YEAR"];var Vr={"+":"add","-":"subtract","*":"multiply","/":"divide","%":"remainder","^":"power","!":"factorial","<":"comparison",">":"comparison","<=":"comparison",">=":"comparison","==":"comparison","!=":"comparison","||":"concatenate",AND:"logical",OR:"logical",NOT:"logical",IN:"logical","?":"conditional",":":"conditional","=":"assignment","[":"array","()=":"fndef"};zr.prototype.isOperatorEnabled=function(t){var e=function(t){return Object.prototype.hasOwnProperty.call(Vr,t)?Vr[t]:t}(t),r=this.options.operators||{};return!(e in r)||!!r[e]};var Wr=/\{\{(.+?)\}\}/g;function Br(t){return $(t.name)?t.name():I(t.name)?t.name:t}function qr(t){var e="string"==typeof t?document.querySelector(t):t;e&&e.parentElement.removeChild(e)}var Xr=Object.freeze({__proto__:null,purifyHtml:De,significantDimension:$e,tailLength:Ue,round:He,smartRound:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,n=$e(t,r);return n+=e,t.map((function(t){return He(t,n)}))},equalish:ue,clone:ze,getNonChartHeight:Ve,outerHeight:Ge,dateFormat:function(t){var e=!0,r=!1;function n(t){return function(e){var r=Globalize.format(e,t);return"htt"!==t?r:r.toLowerCase()}}var i,a,o={date:"de"===(i=Globalize.culture().language)?"dd.":"dd",hour:"en"!==i?"H:00":"htt",minute:"de"===i?"H:mm":"h:mm",mm:"de"===i?"d.M.":"MM/dd",mmm:"de"===i?"d.MMM":"MMM dd",mmmm:"de"===i?"d. MMMM":"MMMM dd"};return a=[[n("yyyy"),function(){return!0}],[n("MMM"),function(t){return 0!==t.getMonth()}],[n(o.date),function(t){return 1!==t.getDate()}],[n(t<7?o.mm:o.mmm),function(t){return 1!==t.getDate()&&e}],[n(o.hour),function(t){return t.getHours()}],[n(o.minute),function(t){return t.getMinutes()}],[n(":ss"),function(t){return t.getSeconds()}],[n(".fff"),function(t){return t.getMilliseconds()}]],function(t){e=!r||t.getMonth()!==r.getMonth(),r=t;for(var n=a.length-1,i=a[n];!i[1](t);)i=a[--n];return i[0](t)}},htmlTemplate:function(t){var e={},r=new zr;return t.replace(Wr,(function(t,n){(n=n.trim())&&!e[n]&&(e[n]=r.parse(n))})),function(r){return De(t.replace(Wr,(function(t,n){var i=n.trim()?e[n.trim()].evaluate(r):"";return null===i?"":i})),"



      • ")}},minMax:function(t){var e=[Number.MAX_VALUE,-Number.MAX_VALUE];return t.forEach((function(t){e[0]=Math.min(e[0],t.range()[0]),e[1]=Math.max(e[1],t.range()[1])})),e},longDateFormat:function(t){return function(e){if("date"!==t.type())return e;switch(t.type(!0).precision()){case"year":return e.getFullYear();case"quarter":return e.getFullYear()+" Q"+(e.getMonth()/3+1);case"month":return Globalize.format(e,"MMM yy");case"day":return Globalize.format(e,"MMM d");case"minute":return Globalize.format(e,"t");case"second":return Globalize.format(e,"T")}}},columnNameColumn:function(t){return Te("",t.map((function(t){return t.title()})))},name:Br,getMaxChartHeight:function(){if(0===window.innerHeight)return 0;var t=window.innerHeight-8;return t-=Ve(),Math.max(t,0)},nearest:function(t,e){var r,n=Number.MAX_VALUE;return t.forEach((function(t){var i=Math.abs(t-e);i1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return t;for(var n=e.split("."),i=t,a=0;a=0;e--)t[e].apply(this,arguments)},add:function(e){t.push(e)}}}function Jr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(r,n){var i=document.createElement("script");i.src=t,i.onload=function(){e&&e(),r()},i.onerror=n,document.body.appendChild(i)}))}function Zr(t,e){var r=t.getMetadata("data.column-order",[]);return r.length&&r.length===e.numColumns()&&e.columnOrder(r),e}function tn(t,e){var r=t.getMetadata("data.changes",[]),n=t.getMetadata("data.transpose",!1),i=e.numRows();return r.forEach((function(t){var r=n?t.column:t.row,a=n?t.row:t.column;if(e.hasColumn(a))if(t.ignored=!1,0===r){if(t.previous&&"undefined"!==t.previous)if(e.column(a).title()!==t.previous)return;e.column(a).title(t.value)}else if(r<=i){if(t.previous&&"undefined"!==t.previous)if(e.column(a).raw(r-1)!==t.previous)return;e.column(a).raw(r-1,t.value)}})),Xt(t.getMetadata("data.column-format",{}),(function(t,r){t.type&&e.hasColumn(r)&&"auto"!==t.type&&e.column(r).type(t.type),t["input-format"]&&e.hasColumn(r)&&e.column(r).type(!0).format(t["input-format"])})),e}function en(t){return t.toString().toLowerCase().replace(/\s+/g,"_").replace(/[^\w-]+/g,"").replace(/-/g,"_").replace(/__+/g,"_").replace(/^_+/,"").replace(/_+$/,"").replace(/^(\d)/,"_$1").replace(/^(and|or|in|true|false)$/,"$1_")}function rn(t,e){var r=Kr(t.get(),"metadata.describe.computed-columns",{});Array.isArray(r)||(r=Object.keys(r).reduce((function(t,e){return t.push({name:e,formula:r[e]}),t}),[]));var n=tn(t,e).list(),i={},o={},s=new zr;e.eachColumn((function(t){if(!t.isComputed)if(i[t.name()]=en(t.name()),"number"===t.type()){var e=a(t.range(),2),r=e[0],n=e[1];o[t.name()]={min:r,max:n,sum:t.sum(),mean:t.mean(),median:t.median()}}else if("date"===t.type()){var s=a(t.range(),2),u=s[0],c=s[1];o[t.name()]={min:u,max:c}}}));var u=r.reduce((function(t,r,n){var i=en(r.name);return t.set(i,{name:r.name,index:e.numColumns()+n,key:i,formula:r.formula,visited:0,computed:!1,dependsOn:[]})}),new Map);r.forEach((function(t){var e=t.formula,r=t.name,n=u.get(en(r));if(e.trim())try{n.expr=s.parse(e.trim()),n.expr.variables().forEach((function(t){t=t.split("__")[0],u.has(t)&&n.dependsOn.push(u.get(t))}))}catch(t){n.error=t.message}else n.expr={evaluate:function(){return""},variables:function(){return[]}}}));for(var c=[],f=0;u.size&&!(f>1e3);)u.forEach((function(t){f++;try{l(t,[])}catch(e){if(!e.message.startsWith("circular-dependency"))throw e;t.error=e.message,u.delete(t.key),c.push(t)}}));return c.forEach((function(e){if(e.error){var r=Te(e.name,n.map((function(t){return"null"})));r.isComputed=!0,r.formula=e.formula,r.errors=[{message:e.error,row:"all"}],e.column=r}else e.column=function(e){var r=e.formula,s=e.name,u=e.expr,c=e.error,f=e.index,l=[];c&&l.push({row:"all",message:c});var p=Kr(t,"metadata.data.changes",[]).filter((function(t){return t.column===f&&t.row>0})).reduce((function(t,e){var r=t.get(e.row-1);return r&&(e.previous=r.previous),t.set(e.row-1,e),t}),new Map),h=n.map((function(t,e){var r,n={ROWNUMBER:e};Xt(t,(function(t,e){i[e]&&(n[i[e]]=t,o[e]&&Object.keys(o[e]).forEach((function(t){n["".concat(i[e],"__").concat(t)]=o[e][t]})))}));try{"function"==typeof(r=u.evaluate(n))&&(l.push({message:"formula returned function",row:e}),r=null)}catch(t){l.push({message:t.message,row:e}),r=null}if(p.has(e)){var a=p.get(e);if(void 0===a.previous||a.previous==r)return a.value}return r}));i[s]=en(s),h.forEach((function(t,e){n[e][s]=t}));var d=Te(s,h.map((function(t){return k(t)?t?"yes":"no":L(t)?t.toISOString():_(t)?String(t):D(t)?null:String(t)})));if("number"===d.type()){var m=a(d.range(),2),v=m[0],g=m[1];o[s]={min:v,max:g,sum:d.sum(),mean:d.mean(),median:d.median()}}else if("date"===d.type()){var y=a(d.range(),2),M=y[0],w=y[1];o[s]={min:M,max:w}}return d.isComputed=!0,d.errors=l,d.formula=r,d}(e)})),c.sort((function(t,e){return t.index-e.index})).forEach((function(t){var r=t.column;return e.add(r)})),e;function l(t,e){if(!t.computed){e.push(t.name);for(var r=0;r0?vn(On,--An):0,Yn--,10===xn&&(Yn=1,bn--),xn}function Dn(){return xn=An2||In(xn)>3?"":" "}function Pn(t,e){for(;--e&&Dn()&&!(xn<48||xn>102||xn>57&&xn<65||xn>70&&xn<97););return Rn(t,kn()+(e<6&&32==Tn()&&32==Dn()))}function Un(t,e){for(;Dn()&&t+xn!==57&&(t+xn!==84||47!==Tn()););return"/*"+Rn(e,An-1)+"*"+pn(47===t?t:Dn())}function Hn(t){for(;!In(Tn());)Dn();return Rn(t,An)}function $n(t){return Ln(function t(e,r,n,i,a,o,s,u,c){var f=0,l=0,p=s,h=0,d=0,m=0,v=1,g=1,y=1,M=0,w="",b=a,Y=o,E=i,A=w;for(;g;)switch(m=M,M=Dn()){case 34:case 39:case 91:case 40:A+=jn(M);break;case 9:case 10:case 13:case 32:A+=Fn(m);break;case 92:A+=Pn(kn()-1,7);continue;case 47:switch(Tn()){case 42:case 47:wn(Gn(Un(Dn(),kn()),r,n),c);break;default:A+="/"}break;case 123*v:u[f++]=yn(A)*y;case 125*v:case 59:case 0:switch(M){case 0:case 125:g=0;case 59+l:d>0&&yn(A)-p&&wn(d>32?Vn(A+";",i,n,p-1):Vn(dn(A," ","")+";",i,n,p-2),c);break;case 59:A+=";";default:if(wn(E=zn(A,r,n,f,l,a,u,w,b=[],Y=[],p),o),123===M)if(0===l)t(A,r,E,E,b,o,p,u,Y);else switch(h){case 100:case 109:case 115:t(e,E,E,i&&wn(zn(e,E,E,0,0,a,u,w,a,b=[],p),Y),a,Y,p,u,i?b:Y);break;default:t(A,E,E,E,[""],Y,p,u,Y)}}f=l=d=0,v=y=1,w=A="",p=s;break;case 58:p=1+yn(A),d=m;default:if(v<1)if(123==M)--v;else if(125==M&&0==v++&&125==Cn())continue;switch(A+=pn(M),M*v){case 38:y=l>0?1:(A+="\f",-1);break;case 44:u[f++]=(yn(A)-1)*y,y=1;break;case 64:45===Tn()&&(A+=jn(Dn())),h=Tn(),l=yn(w=A+=Hn(kn())),M++;break;case 45:45===m&&2==yn(A)&&(v=0)}}return o}("",null,null,null,[""],t=_n(t),0,[0],t))}function zn(t,e,r,n,i,a,o,s,u,c,f){for(var l=i-1,p=0===i?a:[""],h=Mn(p),d=0,m=0,v=0;d0?p[g]+" "+y:dn(y,/&\f/g,p[g])))&&(u[v++]=M);return Nn(t,e,r,0===i?cn:s,u,c,f)}function Gn(t,e,r){return Nn(t,e,r,un,pn(xn),gn(t,2,-2),0)}function Vn(t,e,r,n){return Nn(t,e,r,fn,gn(t,0,n),gn(t,n+1,-1),n)}function Wn(t,e){switch(function(t,e){return(((e<<2^vn(t,0))<<2^vn(t,1))<<2^vn(t,2))<<2^vn(t,3)}(t,e)){case 5103:return sn+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return sn+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return sn+t+on+t+an+t+t;case 6828:case 4268:return sn+t+an+t+t;case 6165:return sn+t+an+"flex-"+t+t;case 5187:return sn+t+dn(t,/(\w+).+(:[^]+)/,sn+"box-$1$2"+an+"flex-$1$2")+t;case 5443:return sn+t+an+"flex-item-"+dn(t,/flex-|-self/,"")+t;case 4675:return sn+t+an+"flex-line-pack"+dn(t,/align-content|flex-|-self/,"")+t;case 5548:return sn+t+an+dn(t,"shrink","negative")+t;case 5292:return sn+t+an+dn(t,"basis","preferred-size")+t;case 6060:return sn+"box-"+dn(t,"-grow","")+sn+t+an+dn(t,"grow","positive")+t;case 4554:return sn+dn(t,/([^-])(transform)/g,"$1"+sn+"$2")+t;case 6187:return dn(dn(dn(t,/(zoom-|grab)/,sn+"$1"),/(image-set)/,sn+"$1"),t,"")+t;case 5495:case 3959:return dn(t,/(image-set\([^]*)/,sn+"$1$`$1");case 4968:return dn(dn(t,/(.+:)(flex-)?(.*)/,sn+"box-pack:$3"+an+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+sn+t+t;case 4095:case 3583:case 4068:case 2532:return dn(t,/(.+)-inline(.+)/,sn+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(yn(t)-1-e>6)switch(vn(t,e+1)){case 109:if(45!==vn(t,e+4))break;case 102:return dn(t,/(.+:)(.+)-([^]+)/,"$1"+sn+"$2-$3$1"+on+(108==vn(t,e+3)?"$3":"$2-$3"))+t;case 115:return~mn(t,"stretch")?Wn(dn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(115!==vn(t,e+1))break;case 6444:switch(vn(t,yn(t)-3-(~mn(t,"!important")&&10))){case 107:return dn(t,":",":"+sn)+t;case 101:return dn(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+sn+(45===vn(t,14)?"inline-":"")+"box$3$1"+sn+"$2$3$1"+an+"$2box$3")+t}break;case 5936:switch(vn(t,e+11)){case 114:return sn+t+an+dn(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return sn+t+an+dn(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return sn+t+an+dn(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return sn+t+an+t+t}return t}function Bn(t,e){for(var r="",n=Mn(t),i=0;i=4;++n,i-=4)e=1540483477*(65535&(e=255&t.charCodeAt(n)|(255&t.charCodeAt(++n))<<8|(255&t.charCodeAt(++n))<<16|(255&t.charCodeAt(++n))<<24))+(59797*(e>>>16)<<16),r=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&t.charCodeAt(n+2))<<16;case 2:r^=(255&t.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+u,styles:i,next:vi}},Mi="undefined"!=typeof document;function wi(t,e,r){var n="";return r.split(" ").forEach((function(r){void 0!==t[r]?e.push(t[r]+";"):n+=r+" "})),n}var bi=function(t,e,r){var n=t.key+"-"+e.name;if((!1===r||!1===Mi&&void 0!==t.compat)&&void 0===t.registered[n]&&(t.registered[n]=e.styles),void 0===t.inserted[e.name]){var i="",a=e;do{var o=t.insert(e===a?"."+n:"",a,t.sheet,!0);Mi||void 0===o||(i+=o),a=a.next}while(void 0!==a);if(!Mi&&0!==i.length)return i}};function Yi(t,e){if(void 0===t.inserted[e.name])return t.insert("",e,t.sheet,!0)}function Ei(t,e,r){var n=[],i=wi(t,n,r);return n.length<2?r:i+e(n)}var Ai,xi=function t(e){for(var r="",n=0;n-1||function(t,e){if(void 0===t&&void 0!==e)return!1;if(void 0===e&&void 0!==t)return!1;if(t.length!==e.length)return!1;for(var r=0;r=0){var m=Qt(i.columns(),(function(e){return Bt(t.accepts,e.type())>=0}));if(m.length)o[e]=m[0].name();else{var v=Te(e,Kt(ae(i.numRows()),(function(t){return(t>25?String.fromCharCode(64+t/26):"")+String.fromCharCode(65+t%26)})),"text");i.add(v),r.chart().dataset(i),a[v.name()]=!0,o[e]=v.name()}}}})),Xt(o,(function(t,e){q(t)?(s[e]=[],Xt(t,(function(t,n){s[e][n]=!1!==t?r.dataset.column(t):null}))):s[e]=!1!==t?r.dataset.column(t):null})),r.__axisCache={axes:o,axesAsColumns:s,userAxes:ze(n)},r.__axisCache[t?"axesAsColumns":"axes"]},keys:function(){var t=this.axes();if(t.labels){var e=this.dataset.column(t.labels),r=this.chart().columnFormatter(e),n=[];return e.each((function(t){n.push(String(r(t)))})),n}return[]},keyLabel:function(t){return t},reset:function(){this.clear(),document.querySelector("#chart").innerHTML="",qr(".chart .filter-ui"),qr(".chart .legend")},clear:function(){},renderingComplete:function(){window.parent&&window.parent.postMessage&&setTimeout((function(){window.parent.postMessage("datawrapper:vis:rendered","*")}),200),this.__renderedResolve(),this.__rendered=!0,this.postRendering()},postRendering:function(){},rendered:function(){return this.__renderedDfd},supportsSmartRendering:function(){return!1},colorMap:function(){var t=this;return function(e){return t.__colors[e]=1,window.__dw&&window.__dwColorMap?window.__dwColorMap(e):e}},colorsUsed:function(){return Object.keys(this.__colors)},on:function(t,e){this.__callbacks[t]||(this.__callbacks[t]=[]),this.__callbacks[t].push(e)},fire:function(t,e){this.__callbacks&&this.__callbacks[t]&&this.__callbacks[t].forEach((function(t){"function"==typeof t&&t(e)}))}});var Ni={};function Si(t,e){if(!Ni[t]){console.warn("unknown visualization type: "+t);var r=Object.keys(Ni);return r.length>0&&console.warn("try one of these instead: "+r.join(", ")),!1}var n=xt(Oi),i=function(t){for(var e=[];"base"!==t.parentVis;)t=Ni[t.parentVis],e.push({id:t.parentVis,vis:t});return e.reverse()}(Ni[t]);return i.push({id:t,vis:Ni[t]}),i.forEach((function(r){Object.assign(n,"function"==typeof r.vis.init?r.vis.init({target:e}):r.vis.init,{id:t})})),e&&n.target(e),n}Si.register=function(t){var e,r;2===arguments.length?(e="base",r=arguments[1]):3===arguments.length&&(e=arguments[1],r=arguments[2]),Ni[t]={parentVis:e,init:r}},Si.has=function(t){return void 0!==Ni[t]},Si.base=Oi;var Ci={};function Di(t){return Ci[t]}Di.register=function(t,e){Ci[t]=e};var Ti={};function ki(t){return Ti[t]}ki.register=function(t,e){Ti[t]=e},ki.has=function(t){return void 0!==Ti[t]};var Ri=[];Te.types=Oe;var Ii={version:"chart-core@8.30.0",dataset:se,column:Te,datasource:{delimited:Le,json:Pe},utils:Xr,chart:function(t){var e,r,n,i,a,o=Qr(),s=Qr(),u={},c={get:function(e,r){return Kr(t,e,r)},getMetadata:function(e,r){return Kr(t,"metadata.".concat(e),r)},set:function(e,r){return function(t,e,r){var n=e.split("."),i=n.pop(),a=t;return n.forEach((function(t){void 0!==a[t]&&null!==a[t]||(a[t]={}),a=a[t]})),JSON.stringify(a[i])!==JSON.stringify(r)&&(a[i]=r,!0)}(t,e,r)&&o.fire(c,e,r),this},setMetadata:function(t,e){return c.set("metadata.".concat(t),e)},getElementBounds:function(t){var e=Ai.target().getBoundingClientRect(),r=t.getBoundingClientRect();return{top:r.top-e.top,right:r.right-e.left,bottom:r.bottom-e.top,left:r.left-e.left,width:r.width,height:r.height}},load:function(t,e){var r=this,n={firstRowIsHeader:c.get("metadata.data.horizontal-header",!0),transpose:c.get("metadata.data.transpose",!1)};return!t&&""!==t||e?n.url=e||"data.csv":n.csv=t,(c.get("metadata.data.json")?Pe(n):Le(n)).dataset().then((function(t){return r.dataset(t),s.fire(c,t),t})).catch((function(t){console.error("could not fetch datasource",t)}))},dataset:function(t){return arguments.length?(!0!==t&&(a=t),e=c.get("metadata.data.json")?a:Zr(c,tn(c,rn(c,a))),!0===t?e:c):e},theme:function(t){return arguments.length?(r=t,c):r||{}},vis:function(t){return arguments.length?((Ai=t).chart(c),c):Ai},hasHighlight:function(){var t=c.get("metadata.visualize.highlighted-series");return q(t)&&t.length>0},isHighlighted:function(t){if(void 0===T(t))return!1;var e=c.get("metadata.visualize.highlighted-series"),r=Br(t);return!q(e)||0===e.length||Bt(e,r)>=0},locale:function(t,e){return arguments.length?((i=t.replace("_","-"))||(i="en-US"),window.Globalize&&(Object.hasOwnProperty.call(Globalize.cultures,i)?(Globalize.culture(i),"function"==typeof e&&e()):Jr("/static/vendor/globalize/cultures/globalize.culture."+i+".js",(function(){c.locale(i),"function"==typeof e&&e()}))),c):i},metricPrefix:function(t){return arguments.length?(n=t,c):n},formatValue:function(t,e,r){var n=c.get("metadata.describe.number-format"),i=Number(c.get("metadata.describe.number-divisor")),a=c.get("metadata.describe.number-append","").replace(" "," "),o=c.get("metadata.describe.number-prepend","").replace(" "," ");return 0!==i&&(t=Number(t)/Math.pow(10,i)),"-"!==n?((r||t===Math.round(t))&&(n=n.substr(0,1)+"0"),t=Globalize.format(t,n)):0!==i&&(t=t.toFixed(1)),e?o+t+a:t},inEditor:function(){try{return window.parent!==window&&window.parent.dw&&window.parent.dw.backend&&window.parent.dw.backend.hooks}catch(t){return!1}},render:function(t){if(!Ai||!r||!e)throw new Error("cannot render the chart!");this.emotion||(this.emotion=function(t){var e=si(t);e.sheet.speedy=function(t){this.isSpeedy=t},e.compat=!0;var r=function(){for(var t=arguments.length,r=new Array(t),n=0;n1&&(r=r.replace(/\$(\d)/g,(function(t,r){return r=1+Number(r),void 0===e[r]?t:e[r]}))),r}};return c},visualization:Si,theme:Di,block:ki,notify:function(t){t.remove=function(){Ri=Ri.filter((function(e){return e!==t})),window.parent.dw.backend.fire("notifications.change",Ri)},Ri.push(t);try{return window.parent.dw.backend.fire("notifications.change",Ri),t.remove}catch(t){}}};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=Ii),exports.dw=Ii):window.dw=Ii}(); //# sourceMappingURL=dw-2.0.min.js.map