!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-dsv"),require("topojson-client"),require("d3-array"),require("d3-format"),require("d3-time"),require("d3-time-format"),require("d3-shape"),require("d3-path"),require("d3-scale"),require("d3-interpolate"),require("d3-geo"),require("d3-color"),require("d3-force"),require("d3-hierarchy"),require("d3-delaunay"),require("d3-timer")):"function"==typeof define&&define.amd?define(["exports","d3-dsv","topojson-client","d3-array","d3-format","d3-time","d3-time-format","d3-shape","d3-path","d3-scale","d3-interpolate","d3-geo","d3-color","d3-force","d3-hierarchy","d3-delaunay","d3-timer"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vega={},e.d3,e.topojson,e.d3,e.d3,e.d3,e.d3,e.d3,e.d3,e.d3,e.d3,e.d3,e.d3,e.d3,e.d3,e.d3,e.d3)}(this,(function(e,t,n,r,i,a,u,o,s,l,c,f,d,h,p,m,v){"use strict";function g(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var y=g(l),b=g(c);function x(e,t,n){return e.fields=t||[],e.fname=n,e}function _(e){return null==e?null:e.fname}function k(e){return null==e?null:e.fields}function A(e){return 1===e.length?w(e[0]):D(e)}var w=function(e){return function(t){return t[e]}},D=function(e){var t=e.length;return function(n){for(var r=0;rt&&l(),o=t=n+1):"]"===r&&(o||E("Access path missing open bracket: "+e),o>0&&l(),o=0,t=n+1):n>t?l():t=n+1}return o&&E("Access path missing closing bracket: "+e),u&&E("Access path missing closing quote: "+e),n>t&&(n++,l()),i}function F(e,t,n){var r=C(e);return e=1===r.length?r[0]:e,x((n&&n.get||A)(r),[e],t||e)}var M=F("id"),S=x((function(e){return e}),[],"identity"),B=x((function(){return 0}),[],"zero"),O=x((function(){return 1}),[],"one"),R=x((function(){return!0}),[],"true"),z=x((function(){return!1}),[],"false");function q(e,t,n){var r=[t].concat([].slice.call(n));console[e].apply(console,r)}function T(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:q,r=e||0;return{level:function(e){return arguments.length?(r=+e,this):r},error:function(){return r>=1&&n(t||"error","ERROR",arguments),this},warn:function(){return r>=2&&n(t||"warn","WARN",arguments),this},info:function(){return r>=3&&n(t||"log","INFO",arguments),this},debug:function(){return r>=4&&n(t||"log","DEBUG",arguments),this}}}var L=Array.isArray;function N(e){return e===Object(e)}var P=function(e){return"__proto__"!==e};function j(){for(var e=arguments.length,t=new Array(e),n=0;n=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-r),i+r]}function ce(e){return"function"==typeof e}function fe(e,t,n){n=n||{},t=se(t)||[];var r=[],i=[],a={},u=n.comparator||he;return se(e).forEach((function(e,u){null!=e&&(r.push("descending"===t[u]?-1:1),i.push(e=ce(e)?e:F(e,null,n)),(k(e)||[]).forEach((function(e){return a[e]=1})))})),0===i.length?null:x(u(i,r),Object.keys(a))}var de=function(e,t){return(et||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t==t?-1:t!=t&&e==e?1:0)},he=function(e,t){return 1===e.length?pe(e[0],t[0]):me(e,t,e.length)},pe=function(e,t){return function(n,r){return de(e(n),e(r))*t}},me=function(e,t,n){return t.push(0),function(r,i){for(var a,u=0,o=-1;0===u&&++oa&&(a=r))}else{for(r=t(e[u]);ua&&(a=r))}return[i,a]}function xe(e,t){var n,r,i,a,u,o=e.length,s=-1;if(null==t){for(;++s=r){n=i=r;break}if(s===o)return[-1,-1];for(a=u=s;++sr&&(n=r,a=s),i=r){n=i=r;break}if(s===o)return[-1,-1];for(a=u=s;++sr&&(n=r,a=s),iu&&(i=a,a=u,u=i),r=void 0===r||r,((n=void 0===n||n)?a<=e:ae&&(n=t,t={},r=1),t[i]=a};return i(),{clear:i,has:function(e){return ke(t,e)||ke(n,e)},get:function(e){return ke(t,e)?t[e]:ke(n,e)?a(e,n[e]):void 0},set:function(e,n){return ke(t,e)?t[e]=n:a(e,n)}}}function Le(e,t,n,r){var i=t.length,a=n.length;if(!a)return t;if(!i)return n;for(var u=r||new t.constructor(i+a),o=0,s=0,l=0;o0?n[s++]:t[o++];for(;o=0;)n+=e;return n}function Pe(e,t,n,r){var i=n||" ",a=e+"",u=t-a.length;return u<=0?a:"left"===r?Ne(i,u)+a:"center"===r?Ne(i,~~(u/2))+a+Ne(i,Math.ceil(u/2)):a+Ne(i,u)}function je(e){return e&&$(e)-e[0]||0}function Ue(e){return L(e)?"["+e.map(Ue)+"]":N(e)||Re(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Ie(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e}var $e,We,Ge,He,Ve,Ye,Xe,Je=function(e){return Be(e)||Me(e)?e:Date.parse(e)};function Qe(e,t){return t=t||Je,null==e||""===e?null:t(e)}function Ke(e){return null==e||""===e?null:e+""}function Ze(e){for(var t={},n=e.length,r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},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,u=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){o=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(o)throw a}}}}var ht="year",pt="quarter",mt="month",vt="week",gt="date",yt="day",bt="dayofyear",xt="hours",_t="minutes",kt="seconds",At="milliseconds",wt=[ht,pt,mt,vt,gt,yt,bt,xt,_t,kt,At],Dt=wt.reduce((function(e,t,n){return e[t]=1+n,e}),{});function Et(e){var t=se(e).slice(),n={};return t.length||E("Missing time unit."),t.forEach((function(e){ke(Dt,e)?n[e]=1:E("Invalid time unit: ".concat(e,"."))})),(n.week||n.day?1:0)+(n.quarter||n.month||n.date?1:0)+(n.dayofyear?1:0)>1&&E("Incompatible time units: ".concat(e)),t.sort((function(e,t){return Dt[e]-Dt[t]})),t}var Ct=(ot($e={},ht,"%Y "),ot($e,pt,"Q%q "),ot($e,mt,"%b "),ot($e,gt,"%d "),ot($e,vt,"W%U "),ot($e,yt,"%a "),ot($e,bt,"%j "),ot($e,xt,"%H:00"),ot($e,_t,"00:%M"),ot($e,kt,":%S"),ot($e,At,".%L"),ot($e,"".concat(ht,"-").concat(mt),"%Y-%m "),ot($e,"".concat(ht,"-").concat(mt,"-").concat(gt),"%Y-%m-%d "),ot($e,"".concat(xt,"-").concat(_t),"%H:%M"),$e);function Ft(e,t){var n,r,i=ye({},Ct,t),a=Et(e),u=a.length,o="",s=0;for(s=0;ss;--n)if(null!=i[r=a.slice(s,n).join("-")]){o+=i[r],s=n;break}return o.trim()}var Mt=new Date;function St(e){return Mt.setFullYear(e),Mt.setMonth(0),Mt.setDate(1),Mt.setHours(0,0,0,0),Mt}function Bt(e){return Rt(new Date(e))}function Ot(e){return zt(new Date(e))}function Rt(e){return a.timeDay.count(St(e.getFullYear())-1,e)}function zt(e){return a.timeWeek.count(St(e.getFullYear())-1,e)}function qt(e){return St(e).getDay()}function Tt(e,t,n,r,i,a,u){if(0<=e&&e<100){var o=new Date(-1,t,n,r,i,a,u);return o.setFullYear(e),o}return new Date(e,t,n,r,i,a,u)}function Lt(e){return Pt(new Date(e))}function Nt(e){return jt(new Date(e))}function Pt(e){var t=Date.UTC(e.getUTCFullYear(),0,1);return a.utcDay.count(t-1,e)}function jt(e){var t=Date.UTC(e.getUTCFullYear(),0,1);return a.utcWeek.count(t-1,e)}function Ut(e){return Mt.setTime(Date.UTC(e,0,1)),Mt.getUTCDay()}function It(e,t,n,r,i,a,u){if(0<=e&&e<100){var o=new Date(Date.UTC(-1,t,n,r,i,a,u));return o.setUTCFullYear(n.y),o}return new Date(Date.UTC(e,t,n,r,i,a,u))}function $t(e,t,n,r,i){var a=t||1,u=$(e),o=function(e,t,i){return function(e,t,n,r){var i=n<=1?e:r?function(t,i){return r+n*Math.floor((e(t,i)-r)/n)}:function(t,r){return n*Math.floor(e(t,r)/n)};return t?function(e,n){return t(i(e,n),n)}:i}(n[i=i||e],r[i],e===u&&a,t)},s=new Date,l=Ze(e),c=l.year?o(ht):ve(2012),f=l.month?o(mt):l.quarter?o(pt):B,d=l.week&&l.day?o(yt,1,vt+yt):l.week?o(vt,1):l.day?o(yt,1):l.date?o(gt,1):l.dayofyear?o(bt,1):O,h=l.hours?o(xt):B,p=l.minutes?o(_t):B,m=l.seconds?o(kt):B,v=l.milliseconds?o(At):B;return function(e){s.setTime(+e);var t=c(s);return i(t,f(s),d(s,t),h(s),p(s),m(s),v(s))}}function Wt(e,t,n){return t+7*e-(n+6)%7}var Gt=(ot(We={},ht,(function(e){return e.getFullYear()})),ot(We,pt,(function(e){return Math.floor(e.getMonth()/3)})),ot(We,mt,(function(e){return e.getMonth()})),ot(We,gt,(function(e){return e.getDate()})),ot(We,xt,(function(e){return e.getHours()})),ot(We,_t,(function(e){return e.getMinutes()})),ot(We,kt,(function(e){return e.getSeconds()})),ot(We,At,(function(e){return e.getMilliseconds()})),ot(We,bt,(function(e){return Rt(e)})),ot(We,vt,(function(e){return zt(e)})),ot(We,vt+yt,(function(e,t){return Wt(zt(e),e.getDay(),qt(t))})),ot(We,yt,(function(e,t){return Wt(1,e.getDay(),qt(t))})),We),Ht=(ot(Ge={},pt,(function(e){return 3*e})),ot(Ge,vt,(function(e,t){return Wt(e,0,qt(t))})),Ge);function Vt(e,t){return $t(e,t||1,Gt,Ht,Tt)}var Yt=(ot(He={},ht,(function(e){return e.getUTCFullYear()})),ot(He,pt,(function(e){return Math.floor(e.getUTCMonth()/3)})),ot(He,mt,(function(e){return e.getUTCMonth()})),ot(He,gt,(function(e){return e.getUTCDate()})),ot(He,xt,(function(e){return e.getUTCHours()})),ot(He,_t,(function(e){return e.getUTCMinutes()})),ot(He,kt,(function(e){return e.getUTCSeconds()})),ot(He,At,(function(e){return e.getUTCMilliseconds()})),ot(He,bt,(function(e){return Pt(e)})),ot(He,vt,(function(e){return jt(e)})),ot(He,yt,(function(e,t){return Wt(1,e.getUTCDay(),Ut(t))})),ot(He,vt+yt,(function(e,t){return Wt(jt(e),e.getUTCDay(),Ut(t))})),He),Xt=(ot(Ve={},pt,(function(e){return 3*e})),ot(Ve,vt,(function(e,t){return Wt(e,0,Ut(t))})),Ve);function Jt(e,t){return $t(e,t||1,Yt,Xt,It)}var Qt=(ot(Ye={},ht,a.timeYear),ot(Ye,pt,a.timeMonth.every(3)),ot(Ye,mt,a.timeMonth),ot(Ye,vt,a.timeWeek),ot(Ye,gt,a.timeDay),ot(Ye,yt,a.timeDay),ot(Ye,bt,a.timeDay),ot(Ye,xt,a.timeHour),ot(Ye,_t,a.timeMinute),ot(Ye,kt,a.timeSecond),ot(Ye,At,a.timeMillisecond),Ye),Kt=(ot(Xe={},ht,a.utcYear),ot(Xe,pt,a.utcMonth.every(3)),ot(Xe,mt,a.utcMonth),ot(Xe,vt,a.utcWeek),ot(Xe,gt,a.utcDay),ot(Xe,yt,a.utcDay),ot(Xe,bt,a.utcDay),ot(Xe,xt,a.utcHour),ot(Xe,_t,a.utcMinute),ot(Xe,kt,a.utcSecond),ot(Xe,At,a.utcMillisecond),Xe);function Zt(e){return Qt[e]}function en(e){return Kt[e]}function tn(e,t,n){return e?e.offset(t,n):void 0}function nn(e,t,n){return tn(Zt(e),t,n)}function rn(e,t,n){return tn(en(e),t,n)}function an(e,t,n,r){return e?e.range(t,n,r):void 0}function un(e,t,n,r){return an(Zt(e),t,n,r)}function on(e,t,n,r){return an(en(e),t,n,r)}var sn,ln,cn=1e3,fn=6e4,dn=36e5,hn=864e5,pn=2592e6,mn=31536e6,vn=[ht,mt,gt,xt,_t,kt,At],gn=vn.slice(0,-1),yn=gn.slice(0,-1),bn=yn.slice(0,-1),xn=bn.slice(0,-1),_n=[ht,mt],kn=[ht],An=[[gn,1,cn],[gn,5,5e3],[gn,15,15e3],[gn,30,3e4],[yn,1,fn],[yn,5,3e5],[yn,15,9e5],[yn,30,18e5],[bn,1,dn],[bn,3,108e5],[bn,6,216e5],[bn,12,432e5],[xn,1,hn],[[ht,vt],1,6048e5],[_n,1,pn],[_n,3,7776e6],[kn,1,mn]];function wn(e){var t,n,i=e.extent,a=e.maxbins||40,u=Math.abs(je(i))/a,o=r.bisector((function(e){return e[2]})).right(An,u);return o===An.length?(t=kn,n=r.tickStep(i[0]/mn,i[1]/mn,a)):o?(t=(o=An[u/An[o-1][2]0)return r;for(r=e.length;--r>t;)if((n=e.charCodeAt(r))>=48&&n<=57)return r+1}(t,i),u=ai;)if("0"!==t[a]){++a;break}return t.slice(0,a)+u}}return t(a)},formatSpan:function(e,a,u,o){o=i.formatSpecifier(null==o?",f":o);var s,l=r.tickStep(e,a,u),c=Math.max(Math.abs(e),Math.abs(a));if(null==o.precision)switch(o.type){case"s":return isNaN(s=i.precisionPrefix(l,c))||(o.precision=s),n(o,c);case"":case"e":case"g":case"p":case"r":isNaN(s=i.precisionRound(l,c))||(o.precision=s-("e"===o.type));break;case"f":case"%":isNaN(s=i.precisionFixed(l))||(o.precision=s-2*("%"===o.type))}return t(o)}}}function Cn(){return sn=En({format:i.format,formatPrefix:i.formatPrefix})}function Fn(e){return En(i.formatLocale(e))}function Mn(e){return arguments.length?sn=Fn(e):sn}function Sn(e,t,n){N(n=n||{})||E("Invalid time multi-format specifier: ".concat(n));var r=t(kt),i=t(_t),a=t(xt),u=t(gt),o=t(vt),s=t(mt),l=t(pt),c=t(ht),f=e(n.milliseconds||".%L"),d=e(n.seconds||":%S"),h=e(n.minutes||"%I:%M"),p=e(n.hours||"%I %p"),m=e(n.date||n.day||"%a %d"),v=e(n.week||"%b %d"),g=e(n.month||"%B"),y=e(n.quarter||"%B"),b=e(n.year||"%Y");return function(e){return(r(e)1?(lr[e]=t,this):ke(lr,e)?lr[e]:null}function fr(e){var t=cr(e);return t&&t.responseType||"text"}function dr(e,t,n,r){var i=cr((t=t||{}).type||"json");return i||E("Unknown data format type: "+t.type),e=i(e,t),t.parse&&function(e,t,n,r){if(!e.length)return;var i=zn();n=n||i.timeParse,r=r||i.utcParse;var a,u,o,s,l,c,f=e.columns||Object.keys(e[0]);"auto"===t&&(t=rr(e,f));var d=(f=Object.keys(t)).map((function(e){var i,a,u=t[e];if(u&&(u.startsWith("date:")||u.startsWith("utc:")))return("'"===(a=(i=u.split(/:(.+)?/,2))[1])[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1)),("utc"===i[0]?r:n)(a);if(!Zn[u])throw Error("Illegal format pattern: "+e+":"+u);return Zn[u]}));for(o=0,l=e.length,c=f.length;o=0&&n.splice(a,1)}return n},n}function mr(e,t){return vr.apply(this,arguments)}function vr(){return(vr=ut(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n(t);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),t.error(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}var gr=Symbol("vega_id"),yr=1;function br(e){return!(!e||!xr(e))}function xr(e){return e[gr]}function _r(e,t){return e[gr]=t,e}function kr(e){var t=e===Object(e)?e:{data:e};return xr(t)?t:_r(t,yr++)}function Ar(e){return wr(e,kr({}))}function wr(e,t){for(var n in e)t[n]=e[n];return t}function Dr(e,t){return _r(t,xr(e))}function Er(e,t){return e?t?function(n,r){return e(n,r)||xr(t(n))-xr(t(r))}:function(t,n){return e(t,n)||xr(t)-xr(n)}:null}function Cr(e){return e&&e.constructor===Fr}function Fr(){var e=[],t=[],n=[],r=[],i=[],a=null,u=!1;return{constructor:Fr,insert:function(t){for(var n=se(t),r=n.length,i=0;i0&&(g(h,d,f.value),o.modifies(d));for(l=0,c=i.length;l0&&g(e,f.field,f.value)})),o.modifies(f.field);if(u)o.mod=t.length||r.length?s.filter((function(e){return m[xr(e)]>0})):s.slice();else for(p in v)o.mod.push(v[p]);return(a||null==a&&(t.length||r.length))&&o.clean(!0),o}}}var Mr="_:mod:_";function Sr(){Object.defineProperty(this,Mr,{writable:!0,value:{}})}Sr.prototype={set:function(e,t,n,r){var i=this,a=i[e],u=i[Mr];return null!=t&&t>=0?(a[t]!==n||r)&&(a[t]=n,u[t+":"+e]=-1,u[e]=-1):(a!==n||r)&&(i[e]=n,u[e]=L(n)?1+n.length:-1),i},modified:function(e,t){var n=this[Mr];if(!arguments.length){for(var r in n)if(n[r])return!0;return!1}if(L(e)){for(var i=0;i=0?t+1e?(t=n,1):0}))},debounce:function(e){var t=Lr();return this.targets().add(Lr(null,null,ge(e,(function(e){var n=e.dataflow;t.receive(e),n&&n.run&&n.run()})))),t},between:function(e,t){var n=!1;return e.targets().add(Lr(null,null,(function(){return n=!0}))),t.targets().add(Lr(null,null,(function(){return n=!1}))),this.filter((function(){return n}))},detach:function(){this._filter=R,this._targets=null}};var Ur={skip:!0};function Ir(e,t,n,r,i,a){var u,o,s=ye({},a,Ur);ce(n)||(n=ve(n)),void 0===r?u=function(t){return e.touch(n(t))}:ce(r)?(o=new Rr(null,r,i,!1),u=function(t){o.evaluate(t);var r=n(t),i=o.value;Cr(i)?e.pulse(r,i,a):e.update(r,i,s)}):u=function(t){return e.update(n(t),r,s)},t.apply(u)}function $r(e,t,n,r,i,a){if(void 0===r)t.targets().add(n);else{var u=a||{},o=new Rr(null,function(e,t){return t=ce(t)?t:ve(t),e?function(n,r){var i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}(n,r),i,!1);o.modified(u.force),o.rank=t.rank,t.targets().add(o),n&&(o.skip(!0),o.value=n.value,o.targets().add(n),e.connect(n,[o]))}}var Wr={};function Gr(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Hr(e,t){var n=[];return tt(e,t,(function(e){return n.push(e)})),n}function Vr(e,t){var n={};return e.visit(t,(function(e){n[xr(e)]=1})),function(e){return n[xr(e)]?null:e}}function Yr(e,t){return e?function(n,r){return e(n,r)&&t(n,r)}:t}function Xr(e,t,n,r){var i=this,a=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;var u,o=dt(n);try{for(o.s();!(u=o.n()).done;){var s=u.value;if(s.stamp===t){if(s.fields){var l=i.fields||(i.fields={});for(var c in s.fields)l[c]=1}s.changed(i.ADD)&&(a|=i.ADD),s.changed(i.REM)&&(a|=i.REM),s.changed(i.MOD)&&(a|=i.MOD)}}}catch(e){o.e(e)}finally{o.f()}this.changes=a}function Jr(){return Jr=ut(regeneratorRuntime.mark((function e(t,n,r){var i,a,u,o,s,l,c,f,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=[],!(i=this)._pulse){e.next=3;break}return e.abrupt("return",Kr(i));case 3:if(!i._pending){e.next=6;break}return e.next=6,i._pending;case 6:if(!n){e.next=9;break}return e.next=9,mr(i,n);case 9:if(i._touched.length){e.next=12;break}return i.debug("Dataflow invoked, but nothing to do."),e.abrupt("return",i);case 12:u=++i._clock,i._pulse=new Gr(i,u,t),i._touched.forEach((function(e){return i._enqueue(e,!0)})),i._touched=pr(M),o=0,e.prev=17;case 18:if(!(i._heap.size()>0)){e.next=35;break}if((s=i._heap.pop()).rank===s.qrank){e.next=23;break}return i._enqueue(s,!0),e.abrupt("continue",18);case 23:if(!(l=s.run(i._getPulse(s,t))).then){e.next=30;break}return e.next=27,l;case 27:l=e.sent,e.next=31;break;case 30:l.async&&(a.push(l.async),l=Wr);case 31:l!==Wr&&s._targets&&s._targets.forEach((function(e){return i._enqueue(e)})),++o,e.next=18;break;case 35:e.next=41;break;case 37:e.prev=37,e.t0=e.catch(17),i._heap.clear(),c=e.t0;case 41:if(i._input={},i._pulse=null,i.debug("Pulse ".concat(u,": ").concat(o," operators")),c&&(i._postrun=[],i.error(c)),!i._postrun.length){e.next=55;break}f=i._postrun.sort((function(e,t){return t.priority-e.priority})),i._postrun=[],d=0;case 49:if(!(d=0&&(o=r),e[t]=e[o],o=1+((t=o)<<1);e[t]=u,ti(e,i,t,n)}(t,0,e)):n=r,n}}}function ti(e,t,n,r){for(var i,a,u=e[n];n>t&&r(u,i=e[a=n-1>>1])<0;)e[n]=i,n=a;return e[n]=u}function ni(){this.logger(T()),this.logLevel(1),this._clock=0,this._rank=0,this._locale=Ln();try{this._loader=hr()}catch(e){}this._touched=pr(M),this._input={},this._pulse=null,this._heap=ei((function(e,t){return e.qrank-t.qrank})),this._postrun=[]}function ri(e){return function(){return this._log[e].apply(this,arguments)}}function ii(e,t){Rr.call(this,e,null,t)}ni.prototype={stamp:function(){return this._clock},loader:function(e){return arguments.length?(this._loader=e,this):this._loader},locale:function(e){return arguments.length?(this._locale=e,this):this._locale},logger:function(e){return arguments.length?(this._log=e,this):this._log},error:ri("error"),warn:ri("warn"),info:ri("info"),debug:ri("debug"),logLevel:ri("level"),cleanThreshold:1e4,add:function(e,t,n,r){var i,a=1;return e instanceof Rr?i=e:e&&e.prototype instanceof Rr?i=new e:ce(e)?i=new Rr(null,e):(a=0,i=new Rr(e,t)),this.rank(i),a&&(r=n,n=t),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(e,t){for(var n=e.rank,r=t.length,i=0;i=0;)i.push(t=n[r]),t===e&&E("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||Zr);var r=new Gr(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this},touch:function(e,t){var n=t||Zr;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){var r=n||Zr;return(e.set(t)||r.force)&&this.touch(e,r),this},changeset:Fr,ingest:function(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))},parse:function(e,t){var n=this.locale();return dr(e,t,n.timeParse,n.utcParse)},preload:function(e,t,n){return Pr.apply(this,arguments)},request:function(e,t){return Nr.apply(this,arguments)},events:function(e,t,n,r){for(var i,a=this,u=Lr(n,r),o=function(e){e.dataflow=a;try{u.receive(e)}catch(e){a.error(e)}finally{a.run()}},s=(i="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):se(e)).length,l=0;l=i)){l.next=9;break}return l.next=9,i;case 9:l.next=4;break;case 11:l.next=16;break;case 13:l.prev=13,l.t0=l.catch(2),n.e(l.t0);case 16:return l.prev=16,n.f(),l.finish(16);case 19:l.next=41;break;case 21:a=-1,u=dt(e),l.prev=23,u.s();case 25:if((o=u.n()).done){l.next=33;break}if(s=o.value,!(null!=(s=t(s,++a,e))&&""!==s&&(s=+s)>=s)){l.next=31;break}return l.next=31,s;case 31:l.next=25;break;case 33:l.next=38;break;case 35:l.prev=35,l.t1=l.catch(23),u.e(l.t1);case 38:return l.prev=38,u.f(),l.finish(38);case 41:case"end":return l.stop()}}),si,null,[[2,13,16,19],[23,35,38,41]])}function ci(e,t,n){var i=Float64Array.from(li(e,n));return i.sort(r.ascending),t.map((function(e){return r.quantileSorted(i,e)}))}function fi(e,t){return ci(e,[.25,.5,.75],t)}function di(e,t){var n=e.length,i=r.deviation(e,t),a=fi(e,t),u=(a[2]-a[0])/1.34;return 1.06*(Math.min(i,u)||i||Math.abs(a[0])||1)*Math.pow(n,-.2)}function hi(e){var t,n,r,i,a,u,o=e.maxbins||20,s=e.base||10,l=Math.log(s),c=e.divide||[5,2],f=e.extent[0],d=e.extent[1],h=e.span||d-f||Math.abs(f)||1;if(e.step)t=e.step;else if(e.steps){for(i=h/o,a=0,u=e.steps.length;ao;)t*=s;for(a=0,u=c.length;a=r&&h/i<=o&&(t=i)}var p=(i=Math.log(t))>=0?0:1+~~(-i/l),m=Math.pow(s,-p-1);return(e.nice||void 0===e.nice)&&(f=f<(i=Math.floor(f/t+m)*t)?i-t:i,d=Math.ceil(d/t)*t),{start:f,stop:d===f?f+t:d,step:t}}function pi(t,n,i,a){if(!t.length)return[void 0,void 0];var u,o,s,l,c=Float64Array.from(li(t,a)),f=c.length,d=n;for(s=0,l=Array(d);s=f){for(c=(l+c)/2;o>1);ru;)e[r--]=e[a]}a=u,u=n}return e}(u,t+t/4):u}e.random=Math.random;var vi=Math.sqrt(2*Math.PI),gi=Math.SQRT2,yi=NaN;function bi(t,n){t=t||0,n=null==n?1:n;var r,i,a=0,u=0;if(yi==yi)a=yi,yi=NaN;else{do{r=(a=2*e.random()-1)*a+(u=2*e.random()-1)*u}while(0===r||r>1);a*=i=Math.sqrt(-2*Math.log(r)/r),yi=u*i}return t+a*n}function xi(e,t,n){var r=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*vi)}function _i(e,t,n){var r,i=(e-(t=t||0))/(n=null==n?1:n),a=Math.abs(i);if(a>37)r=0;else{var u=Math.exp(-a*a/2);a<7.07106781186547?(r=u*((((((.0352624965998911*a+.700383064443688)*a+6.37396220353165)*a+33.912866078383)*a+112.079291497871)*a+221.213596169931)*a+220.206867912376),r/=((((((.0883883476483184*a+1.75566716318264)*a+16.064177579207)*a+86.7807322029461)*a+296.564248779674)*a+637.333633378831)*a+793.826512519948)*a+440.413735824752):r=u/(a+1/(a+2/(a+3/(a+4/(a+.65)))))/2.506628274631}return i>0?1-r:r}function ki(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*gi*function(e){var t,n=-Math.log((1-e)*(1+e));t=n<6.25?1.6536545626831027+(t=.24015818242558962+(t=(t=(t=.00018673420803405714+(t=(t=(t=4.2347877827932404e-7+(t=(t=(t=1.0512122733215323e-9+(t=(t=(t=26335093153082323e-28+(t=(t=(t=6637638134358324e-30+(t=20972767875968562e-33+(t=(t=11157877678025181e-33+(t=128584807152564e-32+(t=(t=-364441206401782e-35)*(n-=3.125)-16850591381820166e-35)*n)*n)*n-1333171662854621e-31)*n)*n)*n-4054566272975207e-29)*n-8151934197605472e-29)*n)*n-12975133253453532e-27)*n-5415412054294628e-26)*n)*n-4.112633980346984e-9)*n-2.9070369957882005e-8)*n)*n-13654692000834679e-22)*n-13882523362786469e-21)*n)*n-.000740702534166267)*n-.006033670871430149)*n)*n:n<16?3.0838856104922208+(t=1.0052589676941592+(t=.005370914553590064+(t=(t=.002491442096107851+(t=(t=.0009532893797373805+(t=(t=24031110387097894e-21+(t=6828485145957318e-20+(t=(t=12475304481671779e-21+(t=29234449089955446e-22+(t=(t=15027403968909828e-22+(t=1.8239629214389228e-8+(t=(t=9.075656193888539e-8+(t=2.2137376921775787e-9)*(n=Math.sqrt(n)-3.25))*n-2.7517406297064545e-7)*n)*n)*n-4013867526981546e-21)*n)*n)*n-47318229009055734e-21)*n)*n)*n-.0003550375203628475)*n)*n-.0016882755560235047)*n)*n-.003751208507569241)*n)*n)*n:Number.isFinite(n)?4.849906401408584+(t=1.0103004648645344+(t=(t=(t=7599527703001776e-20+(t=(t=4526062597223154e-21+(t=(t=2.2900482228026655e-7+(t=(t=2.914795345090108e-8+(t=(t=7.61570120807834e-9+(t=(t=1.5076572693500548e-9+(t=(t=-27109920616438573e-27)*(n=Math.sqrt(n)-5)-2.555641816996525e-10)*n)*n-3.789465440126737e-9)*n)*n-1.496002662714924e-8)*n)*n-6.771199775845234e-8)*n)*n-9.9298272942317e-7)*n)*n-1968177810553167e-20)*n)*n-.00021503011930044477)*n-.00013871931833623122)*n)*n:1/0;return t*e}(2*e-1)}function Ai(e,t){var n,r,i={mean:function(e){return arguments.length?(n=e||0,i):n},stdev:function(e){return arguments.length?(r=null==e?1:e,i):r},sample:function(){return bi(n,r)},pdf:function(e){return xi(e,n,r)},cdf:function(e){return _i(e,n,r)},icdf:function(e){return ki(e,n,r)}};return i.mean(e).stdev(t)}function wi(t,n){var r=Ai(),i=0,a={data:function(e){return arguments.length?(t=e,i=e?e.length:0,a.bandwidth(n)):t},bandwidth:function(e){return arguments.length?(!(n=e)&&t&&(n=di(t)),a):n},sample:function(){return t[~~(e.random()*i)]+n*r.sample()},pdf:function(e){for(var a=0,u=0;u=t&&e<=n?1/(n-t):0}function Ri(e,t,n){return null==n&&(n=null==t?1:t,t=0),en?1:(e-t)/(n-t)}function zi(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function qi(e,t){var n,r,i={min:function(e){return arguments.length?(n=e||0,i):n},max:function(e){return arguments.length?(r=null==e?1:e,i):r},sample:function(){return Bi(n,r)},pdf:function(e){return Oi(e,n,r)},cdf:function(e){return Ri(e,n,r)},icdf:function(e){return zi(e,n,r)}};return null==t&&(t=null==e?1:e,e=0),i.min(e).max(t)}function Ti(e,t,n,r){var i=r-e*e,a=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-a*e,a]}function Li(e,t,n,r){e=e.filter((function(e){var r=t(e),i=n(e);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&e.sort((function(e,n){return t(e)-t(n)}));var i,a,u,o,s=e.length,l=new Float64Array(s),c=new Float64Array(s),f=0,d=0,h=0,p=dt(e);try{for(p.s();!(o=p.n()).done;)u=o.value,l[f]=i=+t(u),c[f]=a=+n(u),d+=(i-d)/++f,h+=(a-h)/f}catch(e){p.e(e)}finally{p.f()}for(f=0;f=i&&null!=a&&(a=+a)>=a&&r(i,a,++o)}}catch(e){s.e(e)}finally{s.f()}}function Pi(e,t,n,r,i){var a=0,u=0;return Ni(e,t,n,(function(e,t){var n=t-i(e),o=t-r;a+=n*n,u+=o*o})),1-a/u}function ji(e,t,n){var r=0,i=0,a=0,u=0,o=0;Ni(e,t,n,(function(e,t){++o,r+=(e-r)/o,i+=(t-i)/o,a+=(e*t-a)/o,u+=(e*e-u)/o}));var s=Ti(r,i,a,u),l=function(e){return s[0]+s[1]*e};return{coef:s,predict:l,rSquared:Pi(e,t,n,i,l)}}function Ui(e,t,n){var r=0,i=0,a=0,u=0,o=0;Ni(e,t,n,(function(e,t){++o,e=Math.log(e),r+=(e-r)/o,i+=(t-i)/o,a+=(e*t-a)/o,u+=(e*e-u)/o}));var s=Ti(r,i,a,u),l=function(e){return s[0]+s[1]*Math.log(e)};return{coef:s,predict:l,rSquared:Pi(e,t,n,i,l)}}function Ii(e,t,n){var r=st(Li(e,t,n),4),i=r[0];r[1];var a,u,o,s=r[2],l=r[3],c=0,f=0,d=0,h=0,p=0;Ni(e,t,n,(function(e,t){a=i[p++],u=Math.log(t),c+=(t*u-c)/p,f+=((o=a*t)-f)/p,d+=(o*u-d)/p,h+=(a*o-h)/p}));var m=st(Ti(f/l,c/l,d/l,h/l),2),v=m[0],g=m[1],y=function(e){return Math.exp(v+g*(e-s))};return{coef:[Math.exp(v-g*s),g],predict:y,rSquared:Pi(e,t,n,l,y)}}function $i(e,t,n){var r=0,i=0,a=0,u=0,o=0,s=0;Ni(e,t,n,(function(e,t){var n=Math.log(e),l=Math.log(t);++s,r+=(n-r)/s,i+=(l-i)/s,a+=(n*l-a)/s,u+=(n*n-u)/s,o+=(t-o)/s}));var l=Ti(r,i,a,u),c=function(e){return l[0]*Math.pow(e,l[1])};return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Pi(e,t,n,o,c)}}function Wi(e,t,n){var r,i,a,u,o=st(Li(e,t,n),4),s=o[0],l=o[1],c=o[2],f=o[3],d=s.length,h=0,p=0,m=0,v=0,g=0;for(r=0;rMath.abs(e[t][i])&&(i=n);for(r=t;r=t;r--)e[r][n]-=e[r][t]*e[t][n]/e[t][t]}for(n=u-1;n>=0;--n){for(a=0,r=n+1;r=0;--i)for(u=t[i],o=1,s[i]+=u,a=1;a<=i;++a)o*=(i+1-a)/a,s[i-a]+=u*Math.pow(n,a)*o;return s[0]+=r,s}function Vi(e,t,n,i){for(var a=st(Li(e,t,n,!0),4),u=a[0],o=a[1],s=a[2],l=a[3],c=u.length,f=Math.max(2,~~(i*c)),d=new Float64Array(c),h=new Float64Array(c),p=new Float64Array(c).fill(1),m=-1;++m<=2;){for(var v=[0,f-1],g=0;gu[x]-y?b:x,k=0,A=0,w=0,D=0,E=0,C=1/Math.abs(u[_]-y||1),F=b;F<=x;++F){var M=u[F],S=o[F],B=Yi(Math.abs(y-M)*C)*p[F],O=M*B;k+=B,A+=O,w+=S*B,D+=S*O,E+=M*O}var R=st(Ti(A/k,w/k,D/k,E/k),2),z=R[0],q=R[1];d[g]=z+q*y,h[g]=Math.abs(o[g]-d[g]),Xi(u,g+1,v)}if(2===m)break;var T=r.median(h);if(Math.abs(T)<1e-12)break;for(var L,N,P=0;P=1?1e-12:(N=1-L*L)*N}return function(e,t,n,r){for(var i,a=e.length,u=[],o=0,s=0,l=[];o=e.length))for(;t>i&&e[a]-r<=r-e[i];)n[0]=++i,n[1]=a,++a}var Ji=.5*Math.PI/180;function Qi(e,t,n,r){n=n||25,r=Math.max(n,r||200);var i=function(t){return[t,e(t)]},a=t[0],u=t[1],o=u-a,s=o/r,l=[i(a)],c=[];if(n===r){for(var f=1;f0;)c.push(i(a+d/n*o));for(var h=l[0],p=c[c.length-1],m=1/o,v=function(e,t){for(var n=e,r=e,i=t.length,a=0;ar&&(r=u)}return 1/(r-n)}(h[1],c);p;){var g=i((h[0]+p[0])/2);g[0]-h[0]>=s&&Ki(h,g,p,m,v)>Ji?c.push(g):(h=p,l.push(p),c.pop()),p=c[c.length-1]}return l}function Ki(e,t,n,r,i){var a=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),u=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(a-u)}function Zi(e){return e&&e.length?1===e.length?e[0]:(t=e,function(e){for(var n=t.length,r=1,i=String(t[0](e));r1?e.dev/(e.valid-1):void 0},add:function(e,t){return e.dev+=e.mean_d*(t-e.mean)},rem:function(e,t){return e.dev-=e.mean_d*(t-e.mean)},req:["mean"],idx:1},variancep:{value:function(e){return e.valid>1?e.dev/e.valid:void 0},req:["variance"],idx:2},stdev:{value:function(e){return e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0},req:["variance"],idx:2},stdevp:{value:function(e){return e.valid>1?Math.sqrt(e.dev/e.valid):void 0},req:["variance"],idx:2},stderr:{value:function(e){return e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0},req:["variance"],idx:2},distinct:{value:function(e){return e.cell.data.distinct(e.get)},req:["values"],idx:3},ci0:{value:function(e){return e.cell.data.ci0(e.get)},req:["values"],idx:3},ci1:{value:function(e){return e.cell.data.ci1(e.get)},req:["values"],idx:3},median:{value:function(e){return e.cell.data.q2(e.get)},req:["values"],idx:3},q1:{value:function(e){return e.cell.data.q1(e.get)},req:["values"],idx:3},q3:{value:function(e){return e.cell.data.q3(e.get)},req:["values"],idx:3},min:{init:function(e){return e.min=void 0},value:function(e){return e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min},add:function(e,t){(te.max||void 0===e.max)&&(e.max=t)},rem:function(e,t){t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:function(e){return e.argmin=void 0},value:function(e){return e.argmin||e.cell.data.argmin(e.get)},add:function(e,t,n){te.max&&(e.argmax=n)},rem:function(e,t){t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3}},ia=Object.keys(ra);function aa(e,t){return ra[e](t)}function ua(e,t){return e.idx-t.idx}function oa(){var e=this;this.valid=0,this.missing=0,this._ops.forEach((function(t){return t.init(e)}))}function sa(e,t){var n=this;null!=e&&""!==e?e==e&&(++this.valid,this._ops.forEach((function(r){return r.add(n,e,t)}))):++this.missing}function la(e,t){var n=this;null!=e&&""!==e?e==e&&(--this.valid,this._ops.forEach((function(r){return r.rem(n,e,t)}))):--this.missing}function ca(e){var t=this;return this._out.forEach((function(n){return e[n.out]=n.value(t)})),e}function fa(e,t){var n=t||S,r=function(e){var t={};return e.forEach((function(e){return t[e.name]=e})),e.forEach((function e(n){n.req&&n.req.forEach((function(n){t[n]||e(t[n]=ra[n]())}))})),Object.values(t).sort(ua)}(e),i=e.slice().sort(ua);function a(e){this._ops=r,this._out=i,this.cell=e,this.init()}return a.prototype.init=oa,a.prototype.add=sa,a.prototype.rem=la,a.prototype.set=ca,a.prototype.get=n,a.fields=e.map((function(e){return e.out})),a}function da(e){this._key=e?F(e):xr,this.reset()}ia.forEach((function(e){ra[e]=function(e,t){return function(n){return ye({name:e,out:n||e},na,t)}}(e,ra[e])}));var ha=da.prototype;function pa(e){ii.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}ha.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},ha.add=function(e){this._add.push(e)},ha.rem=function(e){this._rem.push(e)},ha.values=function(){if(this._get=null,0===this._rem.length)return this._add;var e,t,n,r=this._add,i=this._rem,a=this._key,u=r.length,o=i.length,s=Array(u-o),l={};for(e=0;e=0;)ke(r,t=e(n[i])+"")||(r[t]=1,++a);return a},ha.extent=function(e){if(this._get!==e||!this._ext){var t=this.values(),n=xe(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},ha.argmin=function(e){return this.extent(e)[0]||{}},ha.argmax=function(e){return this.extent(e)[1]||{}},ha.min=function(e){var t=this.extent(e)[0];return null!=t?e(t):void 0},ha.max=function(e){var t=this.extent(e)[1];return null!=t?e(t):void 0},ha.quartile=function(e){return this._get===e&&this._q||(this._q=fi(this.values(),e),this._get=e),this._q},ha.q1=function(e){return this.quartile(e)[0]},ha.q2=function(e){return this.quartile(e)[1]},ha.q3=function(e){return this.quartile(e)[2]},ha.ci=function(e){return this._get===e&&this._ci||(this._ci=pi(this.values(),1e3,.05,e),this._get=e),this._ci},ha.ci0=function(e){return this.ci(e)[0]},ha.ci1=function(e){return this.ci(e)[1]},pa.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:ia},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},Ee(pa,ii,{transform:function(e,t){var n=this,r=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),a=e.modified();return r.stamp=i.stamp,r.value&&(a||t.modified(r._inputs,!0))?(r._prev=r.value,r.value=a?r.init(e):{},t.visit(t.SOURCE,(function(e){return r.add(e)}))):(r.value=r.value||r.init(e),t.visit(t.REM,(function(e){return r.rem(e)})),t.visit(t.ADD,(function(e){return r.add(e)}))),i.modifies(r._outputs),r._drop=!1!==e.drop,e.cross&&r._dims.length>1&&(r._drop=!1,r.cross()),t.clean()&&r._drop&&i.clean(!0).runAfter((function(){return n.clean()})),r.changes(i)},cross:function(){var e=this,t=e.value,n=e._dnames,r=n.map((function(){return{}})),i=n.length;function a(e){var t,a,u,o;for(t in e)for(u=e[t].tuple,a=0;ao?1/0:(t=Math.max(u,Math.min(t,o-a)),u+a*Math.floor(1e-14+(t-u)/a))};return s.start=u,s.stop=i.stop,s.step=a,this.value=x(s,k(r),e.name||"bin_"+_(r))}}),ga.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},Ee(ga,ii,{transform:function(e,t){var n=t.fork(t.ALL),r=va(xr,this.value,n.materialize(n.ADD).add),i=e.sort,a=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(a),this.value=n.source=r.data(Er(i),a),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),Ee(ya,Rr),xa.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},Ee(xa,ii,{transform:function(e,t){var n=function(t){return function(n){for(var r,i=function(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(n)}(o(n),e.case,a)||[],s=0,l=i.length;sd&&(d=g),p[++n][l]=g}}catch(e){v.e(e)}finally{v.f()}}return this.value={start:f,stop:d,step:o},t.reflow(!0).modifies(l)}}),Ee(Ba,Rr),Ra.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Ee(Ra,ii,{transform:function(e,t){var n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field"),a=n[0],u=n[1];if((i||null==a)&&(a=1/0,u=-1/0),t.visit(i?t.SOURCE:t.ADD,(function(e){var t=W(r(e));null!=t&&(tu&&(u=t))})),!Number.isFinite(a)||!Number.isFinite(u)){var o=_(r);o&&(o=' for field "'.concat(o,'"')),t.dataflow.warn("Infinite extent".concat(o,": [").concat(a,", ").concat(u,"]")),a=u=void 0}this.value=[a,u]}}),Ee(za,Rr,{connect:function(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add:function(e){this.count+=1,this.value.add.push(e)},rem:function(e){this.count-=1,this.value.rem.push(e)},mod:function(e){this.value.mod.push(e)},init:function(e){this.value.init(e,e.NO_SOURCE)},evaluate:function(){return this.value}}),Ee(qa,ii,{activate:function(e){this._targets[this._targets.active++]=e},subflow:function(e,t,n,r){var i,a,u=this.value,o=ke(u,e)&&u[e];return o?o.value.stamp0}));this.initTargets(i)}},initTargets:function(e){for(var t=this._targets,n=t.length,r=e?e.length:0,i=0;ir.cleanThreshold&&r.runAfter(u.clean),t}}),Ee(Ta,Rr),Na.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Ee(Na,ii,{transform:function(e,t){var n=t.dataflow,r=this.value,i=t.fork(),a=i.add,u=i.rem,o=i.mod,s=e.expr,l=!0;function c(t){var n=xr(t),i=s(t,e),c=r.get(n);i&&c?(r.delete(n),a.push(t)):i||c?l&&i&&!c&&o.push(t):(r.set(n,1),u.push(t))}return t.visit(t.REM,(function(e){var t=xr(e);r.has(t)?r.delete(t):u.push(e)})),t.visit(t.ADD,(function(t){s(t,e)?a.push(t):r.set(xr(t),1)})),t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),Pa.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},Ee(Pa,ii,{transform:function(e,t){var n=t.fork(t.NO_SOURCE),r=e.fields,i=Fa(r,e.as||[]),a=e.index||null,u=i.length;return n.rem=this.value,t.visit(t.SOURCE,(function(e){for(var t,o,s,l=r.map((function(t){return t(e)})),c=l.reduce((function(e,t){return Math.max(e,t.length)}),0),f=0;f0){for(n=[];--s>=0;)n.push(i=kr(u(e))),o.push(i);a.add=a.add.length?a.materialize(a.ADD).add.concat(n):n}else r=o.slice(0,-s),a.rem=a.rem.length?a.materialize(a.REM).rem.concat(r):r,o=o.slice(-s);return a.source=this.value=o,a}});var $a={value:"value",median:r.median,mean:r.mean,min:r.min,max:r.max},Wa=[];function Ga(e){ii.call(this,[],e)}function Ha(e){pa.call(this,e)}function Va(e){ii.call(this,null,e)}function Ya(e){Rr.call(this,null,Xa,e)}function Xa(e){return this.value&&!e.modified()?this.value:ze(e.fields,e.flat)}function Ja(e){ii.call(this,[],e),this._pending=null}function Qa(e,t,n){n.forEach(kr);var r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function Ka(e){ii.call(this,{},e)}function Za(e){Rr.call(this,null,eu,e)}function eu(e){if(this.value&&!e.modified())return this.value;var t,n,r=e.extents,i=r.length,a=1/0,u=-1/0;for(t=0;tu&&(u=n[1]);return[a,u]}function tu(e){Rr.call(this,null,nu,e)}function nu(e){return this.value&&!e.modified()?this.value:e.values.reduce((function(e,t){return e.concat(t)}),[])}function ru(e){ii.call(this,null,e)}function iu(e){pa.call(this,e)}function au(e){qa.call(this,e)}function uu(e){ii.call(this,null,e)}function ou(e){ii.call(this,null,e)}function su(e){ii.call(this,null,e)}Ga.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},Ee(Ga,ii,{transform:function(e,t){var n,r,i,a,u,o,s,l,c,f,d=t.fork(t.ALL),h=function(e){var t,n=e.method||$a.value;if(null!=$a[n])return n===$a.value?(t=void 0!==e.value?e.value:0,function(){return t}):$a[n];E("Unrecognized imputation method: "+n)}(e),p=function(e){var t=e.field;return function(e){return e?t(e):NaN}}(e),m=_(e.field),v=_(e.key),g=(e.groupby||[]).map(_),y=function(e,t,n,r){var i,a,u,o,s,l,c,f,d=function(e){return e(f)},h=[],p=r?r.slice():[],m={},v={};for(p.forEach((function(e,t){return m[e]=t+1})),o=0,c=e.length;o1&&!d&&E('Multi-field lookup requires explicit "as" parameter.'),d&&d.length!==l*r&&E('The "as" parameter has too few output field names.'),d=d||u.map(_),n=function(e){for(var t,n,s=0,c=0;s=l&&(n=o[i],u[xr(n)]&&r.rem.push(n),o[i]=t),++s}if(n.rem.length&&(n.visit(n.REM,(function(e){var t=xr(e);u[t]&&(u[t]=-1,r.rem.push(e)),--s})),o=o.filter((function(e){return-1!==u[xr(e)]}))),(n.rem.length||i)&&o.lengtha){for(var f=o.length-a,d=0;dd&&(d=i))})),a.start=f,a.stop=d,t.modifies(r?o:s)},_floor:function(e,t){var n="utc"===e.timezone,r=e.units?{units:e.units,step:e.step||1}:wn({extent:e.extent||be(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),i=r.units,a=r.step,u=Et(i),o=this.value||{},s=(n?Jt:Vt)(u,a);return s.unit=$(u),s.units=u,s.step=a,s.start=o.start,s.stop=o.stop,this.value=s}}),Ee(mu,ii,{transform:function(e,t){var n=t.dataflow,r=e.field,i=this.value,a=function(e){return i.set(r(e),e)},u=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,a)):t.changed()?(t.visit(t.REM,(function(e){return i.delete(r(e))})),t.visit(t.ADD,a)):u=!1,this.modified(u),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}}),Ee(vu,ii,{transform:function(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(Er(e.sort)):t.source).map(e.field))}});var gu={row_number:function(){return{next:function(e){return e.index+1}}},rank:function(){var e;return{init:function(){return e=1},next:function(t){var n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){var e;return{init:function(){return e=1},next:function(t){var n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){var e=gu.rank(),t=e.next;return{init:e.init,next:function(e){return(t(e)-1)/(e.data.length-1)}}},cume_dist:function(){var e;return{init:function(){return e=0},next:function(t){var n=t.data,r=t.compare,i=t.index;if(e0||E("ntile num must be greater than zero.");var n=gu.cume_dist(),r=n.next;return{init:n.init,next:function(e){return Math.ceil(t*r(e))}}},lag:function(e,t){return t=+t||1,{next:function(n){var r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:function(n){var r=n.index+t,i=n.data;return r0||E("nth_value nth must be greater than zero."),{next:function(n){var r=n.i0+(t-1);return r0&&!i(a[n],a[n-1])&&(e.i0=t.left(a,a[n])),r0?r:1:0}var Bu="linear",Ou="log",Ru="pow",zu="sqrt",qu="symlog",Tu="time",Lu="utc",Nu="sequential",Pu="diverging",ju="quantile",Uu="quantize",Iu="threshold",$u="ordinal",Wu="point",Gu="band",Hu="bin-ordinal",Vu="continuous",Yu="discrete",Xu="discretizing",Ju="interpolating",Qu="temporal";function Ku(){var e,t,n=l.scaleOrdinal().unknown(void 0),i=n.domain,a=n.range,u=[0,1],o=!1,s=0,c=0,f=.5;function d(){var n=i().length,l=u[1]u[1-l])))return n=Math.max(0,r.bisectRight(c,d)-1),o=d===h?n:r.bisectRight(c,h)-1,d-c[n]>t+1e-10&&++n,l&&(s=n,n=f-o,o=f-s),n>o?void 0:i().slice(n,o+1)}},n.invert=function(e){var t=n.invertRange([e,e]);return t?t[0]:t},n.copy=function(){return Ku().domain(i()).range(u).round(o).paddingInner(s).paddingOuter(c).align(f)},d()}function Zu(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return Zu(t())},e}var eo=Array.prototype.map;function to(e){return eo.call(e,W)}var no=Array.prototype.slice;var ro={};function io(e,t,n){var r=function(){var n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){var n,r=t[0],i=t[1];return i=o&&u[i]<=s&&(l<0&&(l=i),n=i);if(!(l<0))return o=e.invertExtent(u[l]),s=e.invertExtent(u[n]),[void 0===o[0]?o[1]:o[0],void 0===s[1]?s[0]:s[1]]}}(n):void 0),n.type=e,n};return r.metadata=Ze(se(n)),r}function ao(e,t,n){return arguments.length>1?(ro[e]=io(e,t,n),this):uo(e)?ro[e]:void 0}function uo(e){return ke(ro,e)}function oo(e,t){var n=ro[e];return n&&n.metadata[t]}function so(e){return oo(e,Vu)}function lo(e){return oo(e,Yu)}function co(e){return oo(e,Xu)}function fo(e){return oo(e,Ou)}function ho(e){return oo(e,Ju)}function po(e){return oo(e,ju)}ao("identity",y.scaleIdentity),ao(Bu,y.scaleLinear,Vu),ao(Ou,y.scaleLog,[Vu,Ou]),ao(Ru,y.scalePow,Vu),ao(zu,y.scaleSqrt,Vu),ao(qu,y.scaleSymlog,Vu),ao(Tu,y.scaleTime,[Vu,Qu]),ao(Lu,y.scaleUtc,[Vu,Qu]),ao(Nu,y.scaleSequential,[Vu,Ju]),ao("".concat(Nu,"-").concat(Bu),y.scaleSequential,[Vu,Ju]),ao("".concat(Nu,"-").concat(Ou),y.scaleSequentialLog,[Vu,Ju,Ou]),ao("".concat(Nu,"-").concat(Ru),y.scaleSequentialPow,[Vu,Ju]),ao("".concat(Nu,"-").concat(zu),y.scaleSequentialSqrt,[Vu,Ju]),ao("".concat(Nu,"-").concat(qu),y.scaleSequentialSymlog,[Vu,Ju]),ao("".concat(Pu,"-").concat(Bu),y.scaleDiverging,[Vu,Ju]),ao("".concat(Pu,"-").concat(Ou),y.scaleDivergingLog,[Vu,Ju,Ou]),ao("".concat(Pu,"-").concat(Ru),y.scaleDivergingPow,[Vu,Ju]),ao("".concat(Pu,"-").concat(zu),y.scaleDivergingSqrt,[Vu,Ju]),ao("".concat(Pu,"-").concat(qu),y.scaleDivergingSymlog,[Vu,Ju]),ao(ju,y.scaleQuantile,[Xu,ju]),ao(Uu,y.scaleQuantize,Xu),ao(Iu,y.scaleThreshold,Xu),ao(Hu,(function e(){var t=[],n=[];function i(e){return null==e||e!=e?void 0:n[(r.bisect(t,e)-1)%n.length]}return i.domain=function(e){return arguments.length?(t=to(e),i):t.slice()},i.range=function(e){return arguments.length?(n=no.call(e),i):n.slice()},i.tickFormat=function(e,n){return l.tickFormat(t[0],$(t),null==e?10:e,n)},i.copy=function(){return e().domain(i.domain()).range(i.range())},i}),[Yu,Xu]),ao($u,y.scaleOrdinal,Yu),ao(Gu,Ku,Yu),ao(Wu,(function(){return Zu(Ku().paddingInner(1))}),Yu);var mo=["clamp","base","constant","exponent"];function vo(e,t){var n=t[0],r=$(t)-n;return function(t){return e(n+t*r)}}function go(e,t,n){return b.piecewise(xo(t||"rgb",n),e)}function yo(e,t){for(var n=new Array(t),r=t+1,i=0;i1?(Ao[e]=t,this):Ao[e]}ko({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},_o),ko({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(function(e){return go(_o(e))}));var Do="symbol",Eo=function(e){return L(e)?e.map((function(e){return String(e)})):String(e)},Co=function(e,t){return e[1]-t[1]},Fo=function(e,t){return t[1]-e[1]};function Mo(e,t,n){var r;return Be(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(je(e.domain())/n||1)))),N(t)&&(r=t.step,t=t.interval),Re(t)&&(t=e.type===Tu?Zt(t):e.type==Lu?en(t):E("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function So(e,t,n){var r=e.range(),i=r[0],a=$(r),u=Co;if(i>a&&(r=a,a=i,i=r,u=Fo),i=Math.floor(i),a=Math.ceil(a),t=t.map((function(t){return[t,e(t)]})).filter((function(e){return i<=e[1]&&e[1]<=a})).sort(u).map((function(e){return e[0]})),n>0&&t.length>1){for(var o=[t[0],$(t)];t.length>n&&t.length>=3;)t=t.filter((function(e,t){return!(t%2)}));t.length<3&&(t=o)}return t}function Bo(e,t){return e.bins?So(e,e.bins):e.ticks?e.ticks(t):e.domain()}function Oo(e,t,n,r,i,a){var u=t.type,o=Eo;if(u===Tu||i===Tu)o=e.timeFormat(r);else if(u===Lu||i===Lu)o=e.utcFormat(r);else if(fo(u)){var s=e.formatFloat(r);if(a||t.bins)o=s;else{var l=Ro(t,n,!1);o=function(e){return l(e)?s(e):""}}}else if(t.tickFormat){var c=t.domain();o=e.formatSpan(c[0],c[c.length-1],n,r)}else r&&(o=e.format(r));return o}function Ro(e,t,n){var r=Bo(e,t),i=e.base(),a=Math.log(i),u=Math.max(1,i*t/r.length),o=function(e){var t=e/Math.pow(i,Math.round(Math.log(e)/a));return t*i1?i[1]-i[0]:i[0];for(r=1;rr?o.slice(0,r-2).map(i).join(", ")+", ending with "+o.slice(-1).map(i):o.map(i).join(", ");return"".concat(s," value").concat(1===s?"":"s",": ").concat(l)}var c=t.domain();return"values from ".concat(i(c[0])," to ").concat(i($(c)))}var Go=0;var Ho="p_";function Vo(e){return e&&e.gradient}function Yo(e,t,n){var r=e.gradient,i=e.id,a="radial"===r?Ho:"";return i||(i=e.id="gradient_"+Go++,"radial"===r?(e.x1=Xo(e.x1,.5),e.y1=Xo(e.y1,.5),e.r1=Xo(e.r1,0),e.x2=Xo(e.x2,.5),e.y2=Xo(e.y2,.5),e.r2=Xo(e.r2,.5),a=Ho):(e.x1=Xo(e.x1,0),e.y1=Xo(e.y1,0),e.x2=Xo(e.x2,1),e.y2=Xo(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+a+i+")"}function Xo(e,t){return null!=e?e:t}function Jo(e,t){var n,r=[];return n={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:r,stop:function(e,t){return r.push({offset:e,color:t}),n}}}var Qo={basis:{curve:o.curveBasis},"basis-closed":{curve:o.curveBasisClosed},"basis-open":{curve:o.curveBasisOpen},bundle:{curve:o.curveBundle,tension:"beta",value:.85},cardinal:{curve:o.curveCardinal,tension:"tension",value:0},"cardinal-open":{curve:o.curveCardinalOpen,tension:"tension",value:0},"cardinal-closed":{curve:o.curveCardinalClosed,tension:"tension",value:0},"catmull-rom":{curve:o.curveCatmullRom,tension:"alpha",value:.5},"catmull-rom-closed":{curve:o.curveCatmullRomClosed,tension:"alpha",value:.5},"catmull-rom-open":{curve:o.curveCatmullRomOpen,tension:"alpha",value:.5},linear:{curve:o.curveLinear},"linear-closed":{curve:o.curveLinearClosed},monotone:{horizontal:o.curveMonotoneY,vertical:o.curveMonotoneX},natural:{curve:o.curveNatural},step:{curve:o.curveStep},"step-after":{curve:o.curveStepAfter},"step-before":{curve:o.curveStepBefore}};function Ko(e,t,n){var r=ke(Qo,e)&&Qo[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}var Zo={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},es=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,ts=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,ns=/^((\s+,?\s*)|(,\s*))/,rs=/^[01]/;function is(e){var t=[];return(e.match(es)||[]).forEach((function(e){var n=e[0],r=n.toLowerCase(),i=Zo[r],a=function(e,t,n){for(var r=[],i=0;t&&i1&&(n*=m=Math.sqrt(m),r*=m);var v=d/n,g=f/n,y=-f/r,b=d/r,x=v*o+g*s,_=y*o+b*s,k=v*e+g*t,A=y*e+b*t,w=1/((k-x)*(k-x)+(A-_)*(A-_))-.25;w<0&&(w=0);var D=Math.sqrt(w);a==i&&(D=-D);var E=.5*(x+k)-D*(A-_),C=.5*(_+A)+D*(k-x),F=Math.atan2(_-C,x-E),M=Math.atan2(A-C,k-E)-F;M<0&&1===a?M+=os:M>0&&0===a&&(M-=os);for(var S=Math.ceil(Math.abs(M/(us+.001))),B=[],O=0;Othis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand:function(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale:function(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate:function(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate:function(e,t,n){var r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints:function(e,t,n){var r=this.x1,i=this.y1,a=this.x2,u=this.y2,o=Math.cos(e),s=Math.sin(e),l=t-t*o+n*s,c=n-t*s-n*o;return[o*r-s*i+l,s*r+o*i+c,o*r-s*u+l,s*r+o*u+c,o*a-s*i+l,s*a+o*i+c,o*a-s*u+l,s*a+o*u+c]},union:function(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect:function(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith:function(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects:function(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains:function(e,t){return!(ethis.x2||tthis.y2)},width:function(){return this.x2-this.x1},height:function(){return this.y2-this.y1}},Ee(Ys,Vs),Xs.prototype={pending:function(){return this._pending},sanitizeURL:function(e){var t=this;return Js(t),t._loader.sanitize(e,{context:"href"}).then((function(e){return Qs(t),e})).catch((function(){return Qs(t),null}))},loadImage:function(e){var t=this,n=Mu();return Js(t),t._loader.sanitize(e,{context:"image"}).then((function(e){var r=e.href;if(!r||!n)throw{url:r};var i=new n,a=ke(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=a&&(i.crossOrigin=a),i.onload=function(){return Qs(t)},i.onerror=function(){return Qs(t)},i.src=r,i})).catch((function(e){return Qs(t),{complete:!1,width:0,height:0,src:e&&e.url||""}}))},ready:function(){var e=this;return new Promise((function(t){!function n(r){e.pending()?setTimeout((function(){n(!0)}),10):t(r)}(!1)}))}};var Zs,el,tl,nl,rl,il,al,ul,ol=os-1e-8,sl=function(e,t){return Zs.add(e,t)},ll=function(e,t){return sl(el=e,tl=t)},cl=function(e){return sl(e,Zs.y1)},fl=function(e){return sl(Zs.x1,e)},dl=function(e,t){return rl*e+al*t},hl=function(e,t){return il*e+ul*t},pl=function(e,t){return sl(dl(e,t),hl(e,t))},ml=function(e,t){return ll(dl(e,t),hl(e,t))};function vl(e,t){return Zs=e,t?(nl=t*as,rl=ul=Math.cos(nl),il=Math.sin(nl),al=-il):(rl=ul=1,nl=il=al=0),gl}var gl={beginPath:function(){},closePath:function(){},moveTo:ml,lineTo:ml,rect:function(e,t,n,r){nl?(pl(e+n,t),pl(e+n,t+r),pl(e,t+r),ml(e,t)):(sl(e+n,t+r),ll(e,t))},quadraticCurveTo:function(e,t,n,r){var i=dl(e,t),a=hl(e,t),u=dl(n,r),o=hl(n,r);yl(el,i,u,cl),yl(tl,a,o,fl),ll(u,o)},bezierCurveTo:function(e,t,n,r,i,a){var u=dl(e,t),o=hl(e,t),s=dl(n,r),l=hl(n,r),c=dl(i,a),f=hl(i,a);bl(el,u,s,c,cl),bl(tl,o,l,f,fl),ll(c,f)},arc:function(e,t,n,r,i,a){if(r+=nl,i+=nl,el=n*Math.cos(i)+e,tl=n*Math.sin(i)+t,Math.abs(i-r)>ol)sl(e-n,t-n),sl(e+n,t+n);else{var u,o,s=function(r){return sl(n*Math.cos(r)+e,n*Math.sin(r)+t)};if(s(r),s(i),i!==r)if((r%=os)<0&&(r+=os),(i%=os)<0&&(i+=os),ii;++o,u-=us)s(u);else for(u=r-r%us+us,o=0;o<4&&u1e-14?(a=o*o+s*u)>=0&&(l=(-o+(a=Math.sqrt(a)))/u,c=(-o-a)/u):l=.5*s/o,0v)return!1;o>m&&(m=o)}else if(a>0){if(o0&&(e.globalAlpha=n,e.fillStyle=Bl(e,t,t.fill),!0)}var Rl=[];function zl(e,t,n){var r=null!=(r=t.strokeWidth)?r:1;return!(r<=0)&&((n*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=n,e.strokeStyle=Bl(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||Rl),e.lineDashOffset=t.strokeDashOffset||0),!0))}function ql(e,t){return e.zindex-t.zindex||e.index-t.index}function Tl(e){if(!e.zdirty)return e.zitems;var t,n,r,i=e.items,a=[];for(n=0,r=i.length;n=0;)if(n=t(i[r]))return n;if(i===a)for(r=(i=e.items).length;--r>=0;)if(!i[r].zindex&&(n=t(i[r])))return n;return null}function Pl(e){return function(t,n,r){Ll(n,(function(n){r&&!r.intersects(n.bounds)||Ul(e,t,n,n)}))}}function jl(e){return function(t,n,r){!n.items.length||r&&!r.intersects(n.bounds)||Ul(e,t,n.items[0],n.items)}}function Ul(e,t,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(e(t,r)||(Fl(t,n),n.fill&&Ol(t,n,i)&&t.fill(),n.stroke&&zl(t,n,i)&&t.stroke()))}function Il(e){return e=e||R,function(t,n,r,i,a,u){return r*=t.pixelRatio,i*=t.pixelRatio,Nl(n,(function(n){var o=n.bounds;if((!o||o.contains(a,u))&&o)return e(t,n,r,i,a,u)?n:void 0}))}}function $l(e,t){return function(n,r,i,a){var u,o,s=Array.isArray(r)?r[0]:r,l=null==t?s.fill:t,c=s.stroke&&n.isPointInStroke;return c&&(u=s.strokeWidth,o=s.strokeCap,n.lineWidth=null!=u?u:1,n.lineCap=null!=o?o:"butt"),!e(n,r)&&(l&&n.isPointInPath(i,a)||c&&n.isPointInStroke(i,a))}}function Wl(e){return Il($l(e))}function Gl(e,t){return"translate("+e+","+t+")"}function Hl(e){return"rotate("+e+")"}function Vl(e){return Gl(e.x||0,e.y||0)}function Yl(e,t,n){function r(e,n){var r=n.x||0,i=n.y||0,a=n.angle||0;e.translate(r,i),a&&e.rotate(a*=as),e.beginPath(),t(e,n),a&&e.rotate(-a),e.translate(-r,-i)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return Gl(e.x||0,e.y||0)+(e.angle?" "+Hl(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(vl(e,n.angle),n),Ks(e,n).translate(n.x||0,n.y||0)},draw:Pl(r),pick:Wl(r),isect:n||Al(r)}}var Xl=Yl("arc",(function(e,t){return zs.context(e)(t)}));function Jl(e,t,n){function r(e,n){e.beginPath(),t(e,n)}var i=$l(r);return{type:e,tag:"path",nested:!0,attr:function(e,n){var r=n.mark.items;r.length&&e("d",t(null,r))},bound:function(e,n){var r=n.items;return 0===r.length?e:(t(vl(e),r),Ks(e,r[0]))},draw:jl(r),pick:function(e,t,n,r,a,u){var o=t.items,s=t.bounds;return!o||!o.length||s&&!s.contains(a,u)?null:(n*=e.pixelRatio,r*=e.pixelRatio,i(e,o,n,r)?o[0]:null)},isect:wl,tip:n}}var Ql=Jl("area",(function(e,t){var n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Ts:qs).curve(Ko(r,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,r,i="horizontal"===e[0].orient?t[1]:t[0],a="horizontal"===e[0].orient?"y":"x",u=e.length,o=1/0;--u>=0;)!1!==e[u].defined&&(r=Math.abs(e[u][a]-i)).5&&t<1.5?.5-Math.abs(t-1):0}function ec(e,t){var n=Zl(t);e("d",Is(null,t,n,n))}function tc(e,t,n,r){var i=Zl(t);e.beginPath(),Is(e,t,(n||0)+i,(r||0)+i)}var nc=$l(tc),rc=$l(tc,!1),ic=$l(tc,!0);var ac={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",Vl(t))},bound:function(e,t){if(!t.clip&&t.items)for(var n=t.items,r=n.length,i=0;ip||am)){if(e.save(),e.translate(f,d),f=i-f,d=a-d,v&&Us(l)&&!ic(e,l,o,s))return e.restore(),null;var g=l.strokeForeground,y=!1!==t.interactive;return y&&g&&l.stroke&&rc(e,l,o,s)?(e.restore(),l):(!(c=Nl(l,(function(e){return function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,f,d)?u.pick(e,n,r,f,d):null})))&&y&&(l.fill||!g&&l.stroke)&&nc(e,l,o,s)&&(c=l),e.restore(),c||null)}}}))},isect:Dl,content:function(e,t,n){e("clip-path",t.clip?Gs(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),ec(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?ec(e,t):e("d","")}},uc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function oc(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then((function(t){e.image=t,e.image.url=e.url}))),n}function sc(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function lc(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function cc(e,t){return"center"===e?t/2:"right"===e?t:0}function fc(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var dc={type:"image",tag:"image",nested:!1,attr:function(e,t,n){var r=oc(t,n),i=sc(t,r),a=lc(t,r),u=(t.x||0)-cc(t.align,i),o=(t.y||0)-fc(t.baseline,a);e("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",uc["xmlns:xlink"],"xlink:href"),e("transform",Gl(u,o)),e("width",i),e("height",a),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){var n=t.image,r=sc(t,n),i=lc(t,n),a=(t.x||0)-cc(t.align,r),u=(t.y||0)-fc(t.baseline,i);return e.set(a,u,a+r,u+i)},draw:function(e,t,n){var r=this;Ll(t,(function(t){if(!n||n.intersects(t.bounds)){var i=oc(t,r),a=sc(t,i),u=lc(t,i);if(0!==a&&0!==u){var o,s,l,c,f=(t.x||0)-cc(t.align,a),d=(t.y||0)-fc(t.baseline,u);!1!==t.aspect&&(s=i.width/i.height,l=t.width/t.height,s==s&&l==l&&s!==l&&(l=0;)if(!1!==e[a].defined&&(n=e[a].x-t[0])*n+(r=e[a].y-t[1])*r1?t:t[0]:t;var t}function Oc(e){var t=Bc(e);return(L(t)?t.length-1:0)*Sc(e)}function Rc(e,t){var n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,r=function(e){if(Ac.width===Cc){var t=qc(e);return function(e){return Fc(e,t)}}var n=Mc(e);return function(e){return Ec(e,n)}}(e);if(r(t)>>1,r(t.slice(i))>n?o=i+1:s=i;return a+t.slice(o)}for(;o>>1),r(t.slice(0,i))=0;)if(!1!==e[i].defined&&(n=e[i].x-t[0])*n+(r=e[i].y-t[1])*r<(n=e[i].size||1)*n)return e[i];return null})),$c={arc:Xl,area:Ql,group:ac,image:dc,line:hc,path:mc,rect:gc,rule:bc,shape:xc,symbol:_c,text:Uc,trail:Ic};function Wc(e,t,n){var r=$c[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new Hs),e,n)}var Gc={mark:null};function Hc(e,t,n){var r,i,a,u,o=$c[e.marktype],s=o.bound,l=e.items,c=l&&l.length;if(o.nested)return c?a=l[0]:(Gc.mark=e,a=Gc),u=Wc(a,s,n),t=t&&t.union(u)||u;if(t=t||e.bounds&&e.bounds.clear()||new Hs,c)for(r=0,i=l.length;rt;)e.removeChild(n[--r]);return e}function rf(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function af(e,t){var n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function uf(e,t){this._active=null,this._handlers={},this._loader=e||hr(),this._tooltip=t||of}function of(e,t,n,r){e.element().setAttribute("title",r||"")}function sf(e){this._el=null,this._bgcolor=null,this._loader=new Xs(e)}Qc.prototype={toJSON:function(e){return Yc(this.root,e||0)},mark:function(e,t,n){var r=Kc(e,t=t||this.root.items[0]);return t.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},uf.prototype={initialize:function(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element:function(){return this._el},canvas:function(){return this._el&&this._el.firstChild},origin:function(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene:function(e){return arguments.length?(this._scene=e,this):this._scene},on:function(){},off:function(){},_handlerIndex:function(e,t,n){for(var r=e?e.length:0;--r>=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1},handlers:function(e){var t=this._handlers,n=[];if(e)n.push.apply(n,lt(t[this.eventName(e)]));else for(var r in t)n.push.apply(n,lt(t[r]));return n},eventName:function(e){var t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref:function(e,t,n){this._loader.sanitize(n,{context:"href"}).then((function(t){var n=new MouseEvent(e.type,e),r=Zc(null,"a");for(var i in t)r.setAttribute(i,t[i]);r.dispatchEvent(n)})).catch((function(){}))},handleTooltip:function(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,r){var i,a,u=e&&e.mark;if(u&&(i=$c[u.marktype]).tip){for((a=af(t,n))[0]-=r[0],a[1]-=r[1];e=e.mark.group;)a[0]-=e.x||0,a[1]-=e.y||0;e=i.tip(u.items,a)}return e}(t,e,this.canvas(),this._origin);var r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}},getItemBoundingClientRect:function(e){var t=this.canvas();if(t){for(var n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,a=i.width(),u=i.height(),o=i.x1+r[0]+n.left,s=i.y1+r[1]+n.top;e.mark&&(e=e.mark.group);)o+=e.x||0,s+=e.y||0;return{x:o,y:s,width:a,height:u,left:o,top:s,right:o+a,bottom:s+u}}}},sf.prototype={initialize:function(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)},element:function(){return this._el},canvas:function(){return this._el&&this._el.firstChild},background:function(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},resize:function(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this},dirty:function(){},render:function(e){var t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},_render:function(){},renderAsync:function(e){var t=this.render(e);return this._ready?this._ready.then((function(){return t})):Promise.resolve(t)},_load:function(e,t){var n=this,r=n._loader[e](t);if(!n._ready){var i=n._call;n._ready=n._loader.ready().then((function(e){e&&i(),n._ready=null}))}return r},sanitizeURL:function(e){return this._load("sanitizeURL",e)},loadImage:function(e){return this._load("loadImage",e)}};var lf="dragenter",cf="dragleave",ff="dragover",df="mousedown",hf="mousemove",pf="mouseout",mf="mouseover",vf="click",gf="mousewheel",yf="touchstart",bf="touchmove",xf="touchend",_f=hf,kf=pf,Af=vf;function wf(e,t){uf.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function Df(e,t){(function(e){return e===yf||e===bf||e===xf?[yf,bf,xf]:[e]})(t).forEach((function(t){return function(e,t){var n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?function(n){return e[t](n)}:function(n){return e.fire(t,n)}))}(e,t)}))}function Ef(e,t,n){return function(r){var i=this._active,a=this.pickEvent(r);a===i||(i&&i.exit||this.fire(n,r),this._active=a,this.fire(t,r)),this.fire(e,r)}}function Cf(e){return function(t){this.fire(e,t),this._active=null}}Ee(wf,uf,{initialize:function(e,t,n){var r=this;return this._canvas=e&&ef(e,"canvas"),[vf,df,hf,pf,cf].forEach((function(e){return Df(r,e)})),uf.prototype.initialize.call(this,e,t,n)},canvas:function(){return this._canvas},context:function(){return this._canvas.getContext("2d")},events:["keydown","keypress","keyup",lf,cf,ff,df,"mouseup",hf,pf,mf,vf,"dblclick","wheel",gf,yf,bf,xf],DOMMouseScroll:function(e){this.fire(gf,e)},mousemove:Ef(hf,mf,pf),dragover:Ef(ff,lf,cf),mouseout:Cf(pf),dragleave:Cf(cf),mousedown:function(e){this._down=this._active,this.fire(df,e)},click:function(e){this._down===this._active&&(this.fire(vf,e),this._down=null)},touchstart:function(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(yf,e,!0)},touchmove:function(e){this.fire(bf,e,!0)},touchend:function(e){this.fire(xf,e,!0),this._touch=null},fire:function(e,t,n){var r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===Af&&r&&r.href?this.handleHref(t,r,r.href):e!==_f&&e!==kf||this.handleTooltip(t,r,e!==kf),i)for(var a=0,u=i.length;a=0&&r.splice(i,1),this},pickEvent:function(e){var t=af(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick:function(e,t,n,r,i){var a=this.context();return $c[e.marktype].pick.call(this,a,e,t,n,r,i)}});var Ff="undefined"!=typeof window&&window.devicePixelRatio||1;function Mf(e){sf.call(this,e),this._options={},this._redraw=!1,this._dirty=new Hs,this._tempb=new Hs}var Sf=sf.prototype;function Bf(e,t){uf.call(this,e,t);var n=this;n._hrefHandler=Of(n,(function(e,t){t&&t.href&&n.handleHref(e,t,t.href)})),n._tooltipHandler=Of(n,(function(e,t){n.handleTooltip(e,t,e.type!==kf)}))}Ee(Mf,sf,{initialize:function(e,t,n,r,i,a){return this._options=a||{},this._canvas=this._options.externalContext?null:Eu(1,1,this._options.type),e&&this._canvas&&(nf(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Sf.initialize.call(this,e,t,n,r,i)},resize:function(e,t,n,r){if(Sf.resize.call(this,e,t,n,r),this._canvas)!function(e,t,n,r,i,a){var u="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,o=e.getContext("2d"),s=u?Ff:i;for(var l in e.width=t*s,e.height=n*s,a)o[l]=a[l];u&&1!==s&&(e.style.width=t+"px",e.style.height=n+"px"),o.pixelRatio=s,o.setTransform(s,0,0,s,s*r[0],s*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{var i=this._options.externalContext;i||E("CanvasRenderer is missing a valid canvas or context"),i.scale(this._scale,this._scale),i.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas:function(){return this._canvas},context:function(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty:function(e){for(var t=this._tempb.clear().union(e.bounds),n=e.mark.group;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render:function(e){var t=this.context(),n=this._origin,r=this._width,i=this._height,a=this._dirty,u=function(e,t,n){return(new Hs).set(0,0,t,n).translate(-e[0],-e[1])}(n,r,i);t.save();var o=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):function(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(t,u.intersect(a),n);return this.clear(-n[0],-n[1],r,i),this.draw(t,e,o),t.restore(),a.clear(),this},draw:function(e,t,n){var r=$c[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),ce(n)?(e.beginPath(),n(e),e.clip()):Kl(e,t.group)}(e,t),r.draw.call(this,e,t,n),t.clip&&e.restore()},clear:function(e,t,n,r){var i=this._options,a=this.context();"pdf"===i.type||i.externalContext||a.clearRect(e,t,n,r),null!=this._bgcolor&&(a.fillStyle=this._bgcolor,a.fillRect(e,t,n,r))}});var Of=function(e,t){return function(n){var r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)}};Ee(Bf,uf,{initialize:function(e,t,n){var r=this._svg;return r&&(r.removeEventListener(Af,this._hrefHandler),r.removeEventListener(_f,this._tooltipHandler),r.removeEventListener(kf,this._tooltipHandler)),this._svg=r=e&&ef(e,"svg"),r&&(r.addEventListener(Af,this._hrefHandler),r.addEventListener(_f,this._tooltipHandler),r.addEventListener(kf,this._tooltipHandler)),uf.prototype.initialize.call(this,e,t,n)},canvas:function(){return this._svg},on:function(e,t){var n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){var i={type:e,handler:t,listener:Of(this,t)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off:function(e,t){var n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});var Rf="aria-hidden",zf="aria-label",qf="role",Tf="aria-roledescription",Lf="graphics-object",Nf="graphics-symbol",Pf=function(e,t,n){var r;return ot(r={},qf,e),ot(r,Tf,t),ot(r,zf,n||void 0),r},jf=Ze(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Uf={axis:{desc:"axis",caption:function(e){var t=e.datum,n=e.orient,r=t.title?Hf(e):null,i=e.context,a=i.scales[t.scale].value,u=i.dataflow.locale(),o=a.type;return"".concat("left"===n||"right"===n?"Y":"X","-axis")+(r?" titled '".concat(r,"'"):"")+" for a ".concat(lo(o)?"discrete":o," scale")+" with ".concat(Wo(u,a,e))}},legend:{desc:"legend",caption:function(e){var t=e.datum,n=t.title?Hf(e):null,r="".concat(t.type||""," legend").trim(),i=t.scales,a=Object.keys(i),u=e.context,o=u.scales[i[a[0]]].value,s=u.dataflow.locale();return l=r,(l.length?l[0].toUpperCase()+l.slice(1):l)+(n?" titled '".concat(n,"'"):"")+" for ".concat(function(e){return(e=e.map((function(e){return e+("fill"===e||"stroke"===e?" color":"")}))).length<2?e[0]:e.slice(0,-1).join(", ")+" and "+$(e)}(a))+" with ".concat(Wo(s,o,e));var l}},"title-text":{desc:"title",caption:function(e){return"Title text '".concat(Gf(e),"'")}},"title-subtitle":{desc:"subtitle",caption:function(e){return"Subtitle text '".concat(Gf(e),"'")}}},If={ariaRole:qf,ariaRoleDescription:Tf,description:zf};function $f(e,t){var n=!1===t.aria;if(e(Rf,n||void 0),n||null==t.description)for(var r in If)e(If[r],void 0);else{var i=t.mark.marktype;e(zf,t.description),e(qf,t.ariaRole||("group"===i?Lf:Nf)),e(Tf,t.ariaRoleDescription||"".concat(i," mark"))}}function Wf(e){return!1===e.aria?ot({},Rf,!0):jf[e.role]?null:Uf[e.role]?function(e,t){try{var n=e.items[0],r=t.caption||function(){return""};return Pf(t.role||Nf,t.desc,n.description||r(n))}catch(e){return null}}(e,Uf[e.role]):function(e){var t=e.marktype,n="group"===t||"text"===t||e.items.some((function(e){return null!=e.description&&!1!==e.aria}));return Pf(n?Lf:Nf,"".concat(t," mark container"),e.description)}(e)}function Gf(e){return se(e.text).join(" ")}function Hf(e){try{return se($(e.items).items[0].text).join(" ")}catch(e){return null}}var Vf=function(e){return(e+"").replace(/&/g,"&").replace(//g,">")};function Yf(){var e="",t="",n="",r=[],i=function(){return t=n=""},a=function(a){t&&(e+="".concat(t,">").concat(n),i()),r.push(a)},u=function(e,n){return null!=n&&(t+=" ".concat(e,'="').concat(Vf(n).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," "),'"')),o},o={open:function(e){a(e),t="<"+e;for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i".concat(n,""):"/>"):""),i(),o},attr:u,text:function(e){return n+=Vf(e),o},toString:function(){return e}};return o}var Xf=function(e){return Jf(Yf(),e)+""};function Jf(e,t){if(e.open(t.tagName),t.hasAttributes())for(var n=t.attributes,r=n.length,i=0;i1&&e.previousSibling!=t}(u,n))&&t.insertBefore(u,n?n.nextSibling:t.firstChild),u}Ee(nd,sf,{initialize:function(e,t,n,r,i){return this._defs={},this._clearDefs(),e&&(this._svg=tf(e,0,"svg",td),this._svg.setAttributeNS(ed,"xmlns",td),this._svg.setAttributeNS(ed,"xmlns:xlink",uc["xmlns:xlink"]),this._svg.setAttribute("version",uc.version),this._svg.setAttribute("class","marks"),nf(e,1),this._root=tf(this._svg,0,"g",td),hd(this._root,Zf),nf(this._svg,1)),this.background(this._bgcolor),rd.initialize.call(this,e,t,n,r,i)},background:function(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),rd.background.apply(this,arguments)},resize:function(e,t,n,r){return rd.resize.call(this,e,t,n,r),this._svg&&(hd(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}),this._root.setAttribute("transform","translate(".concat(this._origin,")"))),this._dirty=[],this},canvas:function(){return this._svg},svg:function(){var e,t=this._svg,n=this._bgcolor;if(!t)return null;n&&(t.removeAttribute("style"),hd(e=tf(t,0,"rect",td),{width:this._width,height:this._height,fill:n}));var r=Xf(t);return n&&(t.removeChild(e),this._svg.style.setProperty("background-color",n)),r},_render:function(e){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e),nf(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty:function(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},isDirty:function(e){return this._dirtyAll||!e._svg||!e._svg.ownerSVGElement||e.dirty===this._dirtyID},_dirtyCheck:function(){this._dirtyAll=!0;var e=this._dirty;if(!e.length||!this._dirtyID)return!0;var t,n,r,i,a,u,o,s=++this._dirtyID;for(a=0,u=e.length;a1?(xd[e]=t,this):xd[e]}function kd(e,t,n){var r=[],i=(new Hs).union(t),a=e.marktype;return a?Ad(e,i,n,r):"group"===a?wd(e,i,n,r):E("Intersect scene must be mark node or group item.")}function Ad(e,t,n,r){if(function(e,t,n){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!n||n(e)))}(e,t,n)){var i=e.items,a=e.marktype,u=i.length,o=0;if("group"===a)for(;o=0;r--)if(i[r]!=a[r])return!1;for(r=i.length-1;r>=0;r--)if(!Fd(e[n=i[r]],t[n],n))return!1;return it(e)===it(t)}(e,t):e==t)}function Md(e,t){return Fd(is(e),is(t))}var Sd="top",Bd="left",Od="right",Rd="bottom",zd="start",qd="middle",Td="end",Ld="group",Nd="axis",Pd="title",jd="frame",Ud="scope",Id="legend",$d="row-header",Wd="row-footer",Gd="row-title",Hd="column-header",Vd="column-footer",Yd="column-title",Xd="padding",Jd="fit",Qd="fit-x",Kd="fit-y",Zd="none",eh="all",th="each",nh="flush",rh="column",ih="row";function ah(e){ii.call(this,null,e)}function uh(e,t,n){return t(e.bounds.clear(),e,n)}Ee(ah,ii,{transform:function(e,t){var n,r=t.dataflow,i=e.mark,a=i.marktype,u=$c[a],o=u.bound,s=i.bounds;if(u.nested)i.items.length&&r.dirty(i.items[0]),s=uh(i,o),i.items.forEach((function(e){e.bounds.clear().union(s)}));else if(a===Ld||e.modified())switch(t.visit(t.MOD,(function(e){return r.dirty(e)})),s.clear(),i.items.forEach((function(e){return s.union(uh(e,o))})),i.role){case Nd:case Id:case Pd:t.reflow()}else n=t.changed(t.REM),t.visit(t.ADD,(function(e){s.union(uh(e,o))})),t.visit(t.MOD,(function(e){n=n||s.alignsWith(e.bounds),r.dirty(e),s.union(uh(e,o))})),n&&(s.clear(),i.items.forEach((function(e){return s.union(e.bounds)})));return Cd(i),t.modifies("bounds")}});var oh=":vega_identifier:";function sh(e){ii.call(this,0,e)}function lh(e){ii.call(this,null,e)}function ch(e){ii.call(this,null,e)}sh.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},Ee(sh,ii,{transform:function(e,t){var n,r=(n=t.dataflow)._signals[oh]||(n._signals[oh]=n.add(0)),i=e.as,a=r.value;return t.visit(t.ADD,(function(e){return e[i]=e[i]||++a})),r.set(this.value=a),t}}),Ee(lh,ii,{transform:function(e,t){var n=this.value;n||((n=t.dataflow.scenegraph().mark(e.markdef,function(e){var t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index)).group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);var r=n.marktype===Ld?Ys:Vs;return t.visit(t.ADD,(function(e){return r.call(e,n)})),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});var fh={parity:function(e){return e.filter((function(e,t){return t%2?e.opacity=0:1}))},greedy:function(e,t){var n;return e.filter((function(e,r){return r&&dh(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1)}))}},dh=function(e,t,n){return n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2)},hh=function(e,t){for(var n,r=1,i=e.length,a=e[0].bounds;r1&&t.height()>1},mh=function(e){return e.forEach((function(e){return e.opacity=1})),e},vh=function(e,t){return e.reflow(t.modified()).modifies("opacity")};function gh(e){ii.call(this,null,e)}Ee(ch,ii,{transform:function(e,t){var n,r,i=fh[e.method]||fh.parity,a=e.separation||0,u=t.materialize(t.SOURCE).source;if(u&&u.length){if(!e.method)return e.modified("method")&&(mh(u),t=vh(t,e)),t;if((u=u.filter(ph)).length){if(e.sort&&(u=u.slice().sort(e.sort)),n=mh(u),t=vh(t,e),n.length>=3&&hh(n,a)){do{n=i(n,a)}while(n.length>=3&&hh(n,a));n.length<3&&!$(u).opacity&&(n.length>1&&($(n).opacity=0),$(u).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(r=function(e,t,n){var r=e.range(),i=new Hs;return t===Sd||t===Rd?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),function(e){return i.encloses(e.bounds)}}(e.boundScale,e.boundOrient,+e.boundTolerance),u.forEach((function(e){r(e)||(e.opacity=0)})));var o=n[0].mark.bounds.clear();return u.forEach((function(e){e.opacity&&o.union(e.bounds)})),t}}}}),Ee(gh,ii,{transform:function(e,t){var n=t.dataflow;if(t.visit(t.ALL,(function(e){return n.dirty(e)})),t.fields&&t.fields.zindex){var r=t.source&&t.source[0];r&&(r.mark.zdirty=!0)}}});var yh=new Hs;function bh(e,t,n){return e[t]===n?0:(e[t]=n,1)}function xh(e){var t=e.items[0].orient;return t===Bd||t===Od}function _h(e,t,n,r){var i,a,u=t.items[0],o=u.datum,s=null!=u.translate?u.translate:.5,l=u.orient,c=function(e){var t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(o),f=u.range,d=u.offset,h=u.position,p=u.minExtent,m=u.maxExtent,v=o.title&&u.items[c[2]].items[0],g=u.titlePadding,y=u.bounds,b=v&&Oc(v),x=0,_=0;switch(yh.clear().union(y),y.clear(),(i=c[0])>-1&&y.union(u.items[i].bounds),(i=c[1])>-1&&y.union(u.items[i].bounds),l){case Sd:x=h||0,_=-d,a=Math.max(p,Math.min(m,-y.y1)),y.add(0,-a).add(f,0),v&&kh(e,v,a,g,b,0,-1,y);break;case Bd:x=-d,_=h||0,a=Math.max(p,Math.min(m,-y.x1)),y.add(-a,0).add(0,f),v&&kh(e,v,a,g,b,1,-1,y);break;case Od:x=n+d,_=h||0,a=Math.max(p,Math.min(m,y.x2)),y.add(0,0).add(a,f),v&&kh(e,v,a,g,b,1,1,y);break;case Rd:x=h||0,_=r+d,a=Math.max(p,Math.min(m,y.y2)),y.add(0,0).add(f,a),v&&kh(e,v,a,g,0,0,1,y);break;default:x=u.x,_=u.y}return Ks(y.translate(x,_),u),bh(u,"x",x+s)|bh(u,"y",_+s)&&(u.bounds=yh,e.dirty(u),u.bounds=y,e.dirty(u)),u.mark.bounds.clear().union(y)}function kh(e,t,n,r,i,a,u,o){var s=t.bounds;if(t.auto){var l=u*(n+i+r),c=0,f=0;e.dirty(t),a?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(s.translate(-c,-f)),e.dirty(t)}o.union(s)}var Ah=function(e,t){return Math.floor(Math.min(e,t))},wh=function(e,t){return Math.ceil(Math.max(e,t))};function Dh(e){return(new Hs).set(0,0,e.width||0,e.height||0)}function Eh(e){var t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function Ch(e,t,n){var r=N(e)?e[t]:e;return null!=r?r:void 0!==n?n:0}function Fh(e){return e<0?Math.ceil(-e):0}function Mh(e,t,n){var r,i,a,u,o,s,l,c,f,d,h,p=!n.nodirty,m=n.bounds===nh?Dh:Eh,v=yh.set(0,0,0,0),g=Ch(n.align,rh),y=Ch(n.align,ih),b=Ch(n.padding,rh),x=Ch(n.padding,ih),_=n.columns||t.length,k=_<=0?1:Math.ceil(t.length/_),A=t.length,w=Array(A),D=Array(_),E=0,C=Array(A),F=Array(k),M=0,S=Array(A),B=Array(A),O=Array(A);for(i=0;i<_;++i)D[i]=0;for(i=0;i1)for(i=0;i0&&(S[i]+=f/2);if(y&&Ch(n.center,ih)&&1!==_)for(i=0;i0&&(B[i]+=d/2);for(i=0;ii&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),w+=a,m=0,g=t.length;m=0&&null==(x=n[v]);v-=d);o?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),k=w):(_=w,k=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),y.union(b.bounds.translate(_-(b.x||0),k-(b.y||0))),b.x=_,b.y=k,e.dirty(b),D=u(D,y[l])}return D}function zh(e,t,n,r,i,a){if(t){e.dirty(t);var u=n,o=n;r?u=Math.round(i.x1+a*i.width()):o=Math.round(i.y1+a*i.height()),t.bounds.translate(u-(t.x||0),o-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=u,t.y=o,e.dirty(t)}}function qh(e,t,n,r,i,a,u){var o=function(e,t){var n=e[t]||{};return function(t,r){return null!=n[t]?n[t]:null!=e[t]?e[t]:r}}(n,t),s=function(e,t){var n=-1/0;return e.forEach((function(e){null!=e.offset&&(n=Math.max(n,e.offset))})),n>-1/0?n:t}(e,o("offset",0)),l=o("anchor",zd),c=l===Td?1:l===qd?.5:0,f={align:th,bounds:o("bounds",nh),columns:"vertical"===o("direction")?1:e.length,padding:o("margin",8),center:o("center"),nodirty:!0};switch(t){case Bd:f.anchor={x:Math.floor(r.x1)-s,column:Td,y:c*(u||r.height()+2*r.y1),row:l};break;case Od:f.anchor={x:Math.ceil(r.x2)+s,y:c*(u||r.height()+2*r.y1),row:l};break;case Sd:f.anchor={y:Math.floor(i.y1)-s,row:Td,x:c*(a||i.width()+2*i.x1),column:l};break;case Rd:f.anchor={y:Math.ceil(i.y2)+s,x:c*(a||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:s,y:s};break;case"top-right":f.anchor={x:a-s,y:s,column:Td};break;case"bottom-left":f.anchor={x:s,y:u-s,row:Td};break;case"bottom-right":f.anchor={x:a-s,y:u-s,column:Td,row:Td}}return f}function Th(e,t){var n,r,i,a,u=t.items[0],o=u.datum,s=u.orient,l=u.bounds,c=u.x,f=u.y;return u._bounds?u._bounds.clear().union(l):u._bounds=l.clone(),l.clear(),function(e,t,n){var r=t.padding,i=r-n.x,a=r-n.y;if(t.datum.title){var u=t.items[1].items[0],o=u.anchor,s=t.titlePadding||0,l=r-u.x,c=r-u.y;switch(u.orient){case Bd:i+=Math.ceil(u.bounds.width())+s;break;case Od:case Rd:break;default:a+=u.bounds.height()+s}switch((i||a)&&Nh(e,n,i,a),u.orient){case Bd:c+=Lh(t,n,u,o,1,1);break;case Od:l+=Lh(t,n,u,Td,0,0)+s,c+=Lh(t,n,u,o,1,1);break;case Rd:l+=Lh(t,n,u,o,0,0),c+=Lh(t,n,u,Td,-1,0,1)+s;break;default:l+=Lh(t,n,u,o,0,0)}(l||c)&&Nh(e,u,l,c),(l=Math.round(u.bounds.x1-r))<0&&(Nh(e,n,-l,0),Nh(e,u,-l,0))}else(i||a)&&Nh(e,n,i,a)}(e,u,u.items[0].items[0]),l=function(e,t){return e.items.forEach((function(e){return t.union(e.bounds)})),t.x1=e.padding,t.y1=e.padding,t}(u,l),n=2*u.padding,r=2*u.padding,l.empty()||(n=Math.ceil(l.width()+n),r=Math.ceil(l.height()+r)),"symbol"===o.type&&(i=u.items[0].items[0].items[0].items,a=i.reduce((function(e,t){return e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e}),{}),i.forEach((function(e){e.width=a[e.column],e.height=e.bounds.y2-e.y}))),s!==Zd&&(u.x=c=0,u.y=f=0),u.width=n,u.height=r,Ks(l.set(c,f,c+n,f+r),u),u.mark.bounds.clear().union(l),u}function Lh(e,t,n,r,i,a,u){var o="symbol"!==e.datum.type,s=n.datum.vgrad,l=(!o||!a&&s||u?t:t.items[0]).bounds[i?"y2":"x2"]-e.padding,c=s&&a?l:0,f=s&&a?0:l,d=i<=0?0:Oc(n);return Math.round(r===zd?c:r===Td?f-d:.5*(l-d))}function Nh(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function Ph(e){ii.call(this,null,e)}Ee(Ph,ii,{transform:function(e,t){var n=t.dataflow;return e.mark.items.forEach((function(t){e.layout&&Sh(n,t,e.layout),function(e,t,n){var r,i,a,u,o,s=t.items,l=Math.max(0,t.width||0),c=Math.max(0,t.height||0),f=(new Hs).set(0,0,l,c),d=f.clone(),h=f.clone(),p=[];for(u=0,o=s.length;un.cleanThreshold)&&n.runAfter(u.clean),r}}),Ee(Wh,ii,{transform:function(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,a=t.encode;if(L(a)){if(!n.changed()&&!a.every((function(e){return i[e]})))return t.StopPropagation;a=a[0],n.encode=null}var u="enter"===a,o=i.update||z,s=i.enter||z,l=i.exit||z,c=(a&&!u?i[a]:o)||z;if(t.changed(t.ADD)&&(t.visit(t.ADD,(function(t){s(t,e),o(t,e)})),n.modifies(s.output),n.modifies(o.output),c!==z&&c!==o&&(t.visit(t.ADD,(function(t){c(t,e)})),n.modifies(c.output))),t.changed(t.REM)&&l!==z&&(t.visit(t.REM,(function(t){l(t,e)})),n.modifies(l.output)),u||c!==z){var f=t.MOD|(e.modified()?t.REFLOW:0);u?(t.visit(f,(function(t){var i=s(t,e)||r;(c(t,e)||i)&&n.mod.push(t)})),n.mod.length&&n.modifies(s.output)):t.visit(f,(function(t){(c(t,e)||r)&&n.mod.push(t)})),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}}),Ee(Gh,ii,{transform:function(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,r,i,a,u,o=t.dataflow.locale(),s=t.fork(t.NO_SOURCE|t.NO_FIELDS),l=this.value,c=e.type||Do,f=e.scale,d=+e.limit,h=Mo(f,null==e.count?5:e.count,e.minstep),p=!!e.values||c===Do,m=e.format||Lo(o,f,h,c,e.formatSpecifier,e.formatType,p),v=e.values||To(f,h);return l&&(s.rem=l),c===Do?(d&&v.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=v.slice(0,d-1),u=!0):l=v,ce(i=e.size)?(e.values||0!==f(l[0])||(l=l.slice(1)),a=l.reduce((function(t,n){return Math.max(t,i(n,e))}),0)):i=ve(a=i||8),l=l.map((function(t,n){return kr({index:n,label:m(t,n,l),value:t,offset:a,size:i(t,e)})})),u&&(u=v[l.length],l.push(kr({index:l.length,label:"…".concat(v.length-l.length," entries"),value:u,offset:a,size:i(u,e)})))):"gradient"===c?(n=f.domain(),r=bo(f,n[0],$(n)),v.length<3&&!e.values&&n[0]!==$(n)&&(v=[n[0],$(n)]),l=v.map((function(e,t){return kr({index:t,label:m(e,t,v),value:e,perc:r(e)})}))):(i=v.length-1,r=function(e){var t=e.domain(),n=t.length-1,r=+t[0],i=+$(t),a=i-r;if(e.type===Iu){var u=n?a/n:.1;a=(i+=u)-(r-=u)}return function(e){return(e-r)/a}}(f),l=v.map((function(e,t){return kr({index:t,label:m(e,t,v),value:e,perc:t?r(e):0,perc2:t===i?1:r(v[t+1])})}))),s.source=l,s.add=l,this.value=l,s}});var Hh=function(e){return e.source.x},Vh=function(e){return e.source.y},Yh=function(e){return e.target.x},Xh=function(e){return e.target.y};function Jh(e){ii.call(this,{},e)}Jh.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},Ee(Jh,ii,{transform:function(e,t){var n=e.sourceX||Hh,r=e.sourceY||Vh,i=e.targetX||Yh,a=e.targetY||Xh,u=e.as||"path",o=e.orient||"vertical",s=e.shape||"line",l=ep.get(s+"-"+o)||ep.get(s);return l||E("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,(function(e){e[u]=l(n(e),r(e),i(e),a(e))})),t.reflow(e.modified()).modifies(u)}});var Qh=function(e,t,n,r){return"M"+e+","+t+"L"+n+","+r},Kh=function(e,t,n,r){var i=n-e,a=r-t,u=Math.sqrt(i*i+a*a)/2;return"M"+e+","+t+"A"+u+","+u+" "+180*Math.atan2(a,i)/Math.PI+" 0 1 "+n+","+r},Zh=function(e,t,n,r){var i=n-e,a=r-t,u=.2*(i+a),o=.2*(a-i);return"M"+e+","+t+"C"+(e+u)+","+(t+o)+" "+(n+o)+","+(r-u)+" "+n+","+r},ep=we({line:Qh,"line-radial":function(e,t,n,r){return Qh(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n))},arc:Kh,"arc-radial":function(e,t,n,r){return Kh(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n))},curve:Zh,"curve-radial":function(e,t,n,r){return Zh(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n))},"orthogonal-horizontal":function(e,t,n,r){return"M"+e+","+t+"V"+r+"H"+n},"orthogonal-vertical":function(e,t,n,r){return"M"+e+","+t+"H"+n+"V"+r},"orthogonal-radial":function(e,t,n,r){var i=Math.cos(e),a=Math.sin(e),u=Math.cos(n),o=Math.sin(n);return"M"+t*i+","+t*a+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:n>e)?1:0)+" "+t*u+","+t*o+"L"+r*u+","+r*o},"diagonal-horizontal":function(e,t,n,r){var i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},"diagonal-vertical":function(e,t,n,r){var i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":function(e,t,n,r){var i=Math.cos(e),a=Math.sin(e),u=Math.cos(n),o=Math.sin(n),s=(t+r)/2;return"M"+t*i+","+t*a+"C"+s*i+","+s*a+" "+s*u+","+s*o+" "+r*u+","+r*o}});function tp(e){ii.call(this,null,e)}tp.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},Ee(tp,ii,{transform:function(e,t){var n,i,a,u=e.as||["startAngle","endAngle"],o=u[0],s=u[1],l=e.field||O,c=e.startAngle||0,f=null!=e.endAngle?e.endAngle:2*Math.PI,d=t.source,h=d.map(l),p=h.length,m=c,v=(f-c)/r.sum(h),g=r.range(p);for(e.sort&&g.sort((function(e,t){return h[e]-h[t]})),n=0;n0?1:0)}),0))!==t.length&&n.warn("Log scale domain includes zero: "+Ue(t)));return t}function up(e,t,n){return ce(e)&&(t||n)?vo(e,op(t||[0,1],n)):e}function op(e,t){return t?e.slice().reverse():e}function sp(e){ii.call(this,null,e)}Ee(ip,ii,{transform:function(e,t){var n=t.dataflow,i=this.value,a=function(e){var t,n=e.type,r="";if(n===Nu)return"sequential-linear";(function(e){var t=e.type;return so(t)&&t!==Tu&&t!==Lu&&(e.scheme||e.range&&e.range.length&&e.range.every(Re))})(e)&&(r=2===(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0)?"sequential-":3===t?"diverging-":"");return(r+n||Bu).toLowerCase()}(e);for(a in i&&a===i.type||(this.value=i=ao(a)()),e)if(!rp[a]){if("padding"===a&&np(i.type))continue;ce(i[a])?i[a](e[a]):n.warn("Unsupported scale property: "+a)}return function(e,t,n){var r=e.type,i=t.round||!1,a=t.range;if(null!=t.rangeStep)a=function(e,t,n){e!==Gu&&e!==Wu&&E("Only band and point scales support rangeStep.");var r=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,i=e===Wu?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Su(n,i,r)]}(r,t,n);else if(t.scheme&&(a=function(e,t,n){var r,i=t.schemeExtent;L(t.scheme)?r=go(t.scheme,t.interpolate,t.interpolateGamma):(r=wo(t.scheme.toLowerCase()))||E("Unrecognized scheme name: ".concat(t.scheme));return n=e===Iu?n+1:e===Hu?n-1:e===ju||e===Uu?+t.schemeCount||5:n,ho(e)?up(r,i,t.reverse):ce(r)?yo(up(r,i),n):e===$u?r:r.slice(0,n)}(r,t,n),ce(a))){if(e.interpolator)return e.interpolator(a);E("Scale type ".concat(r," does not support interpolating color schemes."))}if(a&&ho(r))return e.interpolator(go(op(a,t.reverse),t.interpolate,t.interpolateGamma));a&&t.interpolate&&e.interpolate?e.interpolate(xo(t.interpolate,t.interpolateGamma)):ce(e.round)?e.round(i):ce(e.rangeRound)&&e.interpolate(i?c.interpolateRound:c.interpolate);a&&e.range(op(a,t.reverse))}(i,e,function(e,t,n){var i=t.bins;if(i&&!L(i)){var a=e.domain(),u=a[0],o=$(a),s=i.step,l=null==i.start?u:i.start,c=null==i.stop?o:i.stop;s||E("Scale bins parameter missing step property."),lo&&(c=s*Math.floor(o/s)),i=r.range(l,c+s/2,s)}i?e.bins=i:e.bins&&delete e.bins;e.type===Hu&&(i?t.domain||t.domainRaw||(e.domain(i),n=i.length):e.bins=e.domain());return n}(i,e,function(e,t,n){var r=function(e,t,n){return t?(e.domain(ap(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(r>-1)return r;var i,a,u=t.domain,o=e.type,s=t.zero||void 0===t.zero&&function(e){var t=e.type;return!e.bins&&(t===Bu||t===Ru||t===zu)}(e);if(!u)return 0;np(o)&&t.padding&&u[0]!==$(u)&&(u=function(e,t,n,r,i,a){var u=Math.abs($(n)-n[0]),o=u/(u-2*r),s=e===Ou?re(t,null,o):e===zu?ie(t,null,o,.5):e===Ru?ie(t,null,o,i||1):e===qu?ae(t,null,o,a||1):ne(t,null,o);return(t=t.slice())[0]=s[0],t[t.length-1]=s[1],t}(o,u,t.range,t.padding,t.exponent,t.constant));if((s||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(i=(u=u.slice()).length-1||1,s&&(u[0]>0&&(u[0]=0),u[i]<0&&(u[i]=0)),null!=t.domainMin&&(u[0]=t.domainMin),null!=t.domainMax&&(u[i]=t.domainMax),null!=t.domainMid)){var c=(a=t.domainMid)>u[i]?i+1:ad&&(d=f),n&&c.sort(n)}return h.max=d,h}(t.source,e.groupby,l,c),r=0,i=n.length,a=n.max;r0?Math.sqrt(e):0}(2);function wp(e){return e>1?kp:e<-1?-kp:Math.asin(e)}function Dp(e,t){var n,r=e*xp(t),i=30;do{t-=n=(t+xp(t)-r)/(1+bp(t))}while(yp(n)>1e-6&&--i>0);return t/2}var Ep=function(e,t,n){function r(r,i){return[e*r*bp(i=Dp(n,i)),t*xp(i)]}return r.invert=function(r,i){return i=wp(i/t),[r/(e*bp(i)),wp((2*i+xp(2*i))/n)]},r}(Ap/kp,Ap,_p);var Cp=f.geoPath(),Fp=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Mp(e,t){return function n(){var r=t();return r.type=e,r.path=f.geoPath().projection(r),r.copy=r.copy||function(){var e=n();return Fp.forEach((function(t){r[t]&&e[t](r[t]())})),e.path.pointRadius(r.path.pointRadius()),e},r}}function Sp(e,t){if(!e||"string"!=typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Op[e]=Mp(e,t),this):Op[e]||null}function Bp(e){return e&&e.path||Cp}var Op={albers:f.geoAlbers,albersusa:f.geoAlbersUsa,azimuthalequalarea:f.geoAzimuthalEqualArea,azimuthalequidistant:f.geoAzimuthalEquidistant,conicconformal:f.geoConicConformal,conicequalarea:f.geoConicEqualArea,conicequidistant:f.geoConicEquidistant,equalEarth:f.geoEqualEarth,equirectangular:f.geoEquirectangular,gnomonic:f.geoGnomonic,identity:f.geoIdentity,mercator:f.geoMercator,mollweide:function(){return f.geoProjection(Ep).scale(169.529)},naturalEarth1:f.geoNaturalEarth1,orthographic:f.geoOrthographic,stereographic:f.geoStereographic,transversemercator:f.geoTransverseMercator};for(var Rp in Op)Sp(Rp,Op[Rp]);function zp(){}var qp=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Tp(){var e=1,t=1,n=u;function r(e,t){return t.map((function(t){return i(e,t)}))}function i(r,i){var u=[],o=[];return function(n,r,i){var u,o,s,l,c,f,d=new Array,h=new Array;u=o=-1,l=n[0]>=r,qp[l<<1].forEach(p);for(;++u=r,qp[s|l<<1].forEach(p);qp[l<<0].forEach(p);for(;++o=r,c=n[o*e]>=r,qp[l<<1|c<<2].forEach(p);++u=r,f=c,c=n[o*e+u+1]>=r,qp[s|l<<1|c<<2|f<<3].forEach(p);qp[l|c<<3].forEach(p)}u=-1,c=n[o*e]>=r,qp[c<<2].forEach(p);for(;++u=r,qp[c<<2|f<<3].forEach(p);function p(e){var t,n,r=[e[0][0]+u,e[0][1]+o],s=[e[1][0]+u,e[1][1]+o],l=a(r),c=a(s);(t=h[l])?(n=d[c])?(delete h[t.end],delete d[n.start],t===n?(t.ring.push(s),i(t.ring)):d[t.start]=h[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete h[t.end],t.ring.push(s),h[t.end=c]=t):(t=d[c])?(n=h[l])?(delete d[t.start],delete h[n.end],t===n?(t.ring.push(s),i(t.ring)):d[n.start]=h[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete d[t.start],t.ring.unshift(r),d[t.start=l]=t):d[l]=h[c]={start:l,end:c,ring:[r,s]}}qp[c<<3].forEach(p)}(r,i,(function(e){n(e,r,i),function(e){var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];for(;++t0?u.push([e]):o.push(e)})),o.forEach((function(e){for(var t,n=0,r=u.length;n0&&u0&&o=0&&a>=0||E("invalid size"),e=i,t=a,r},r.smooth=function(e){return arguments.length?(n=e?u:zp,r):n===u},r}function Lp(e,t){for(var n,r=-1,i=t.length;++rr!=h>r&&n<(d-l)*(r-c)/(h-c)+l&&(i=-i)}return i}function Pp(e,t,n){var r,i,a,u;return function(e,t,n){return(t[0]-e[0])*(n[1]-e[1])==(n[0]-e[0])*(t[1]-e[1])}(e,t,n)&&(i=e[r=+(e[0]===t[0])],a=n[r],u=t[r],i<=a&&a<=u||u<=a&&a<=i)}function jp(e,t,n){return function(i){var a=be(i),u=n?Math.min(a[0],0):a[0],o=a[1],s=o-u,l=t?r.tickStep(u,o,e):s/(e+1);return r.range(u+l,o,l)}}function Up(e){ii.call(this,null,e)}function Ip(e,t,n,r,i){var a=e.x1||0,u=e.y1||0,o=t*n<0;function s(e){e.forEach(l)}function l(e){o&&e.reverse(),e.forEach(c)}function c(e){e[0]=(e[0]-a)*t+r,e[1]=(e[1]-u)*n+i}return function(e){return e.coordinates.forEach(s),e}}function $p(e,t,n){var r=e>=0?e:di(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function Wp(e){return ce(e)?e:ve(+e)}function Gp(){var e=function(e){return e[0]},t=function(e){return e[1]},n=O,i=[-1,-1],a=960,u=500,o=2;function s(s,l){var c=$p(i[0],s,e)>>o,f=$p(i[1],s,t)>>o,d=c?c+2:0,h=f?f+2:0,p=2*d+(a>>o),m=2*h+(u>>o),v=new Float32Array(p*m),g=new Float32Array(p*m),y=v;s.forEach((function(r){var i=d+(+e(r)>>o),a=h+(+t(r)>>o);i>=0&&i=0&&a0&&f>0?(Hp(p,m,v,g,c),Vp(p,m,g,v,f),Hp(p,m,v,g,c),Vp(p,m,g,v,f),Hp(p,m,v,g,c),Vp(p,m,g,v,f)):c>0?(Hp(p,m,v,g,c),Hp(p,m,g,v,c),Hp(p,m,v,g,c),y=g):f>0&&(Vp(p,m,v,g,f),Vp(p,m,g,v,f),Vp(p,m,v,g,f),y=g);for(var b=l?Math.pow(2,-2*o):1/r.sum(y),x=0,_=p*m;x<_;++x)y[x]*=b;return{values:y,scale:1<>o),y2:h+(u>>o)}}return s.x=function(t){return arguments.length?(e=Wp(t),s):e},s.y=function(e){return arguments.length?(t=Wp(e),s):t},s.weight=function(e){return arguments.length?(n=Wp(e),s):n},s.size=function(e){if(!arguments.length)return[a,u];var t=+e[0],n=+e[1];return t>=0&&n>=0||E("invalid size"),a=t,u=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||E("invalid cell size"),o=Math.floor(Math.log(e)/Math.LN2),s):1<=i&&(o>=a&&(s-=n[o-a+u*e]),r[o-i+u*e]=s/Math.min(o+1,e-1+a-o,a))}function Vp(e,t,n,r,i){for(var a=1+(i<<1),u=0;u=i&&(o>=a&&(s-=n[u+(o-a)*e]),r[u+(o-i)*e]=s/Math.min(o+1,t-1+a-o,a))}function Yp(e){ii.call(this,null,e)}Up.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},Ee(Up,ii,{transform:function(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,a=e.field||S,u=Tp().smooth(!1!==e.smooth),o=e.thresholds||function(e,t,n){var i=jp(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?i:i(e.map((function(e){return r.max(t(e).values)})))}(i,a,e),s=null===e.as?null:e.as||"contour",l=[];return i.forEach((function(t){var n=a(t),r=u.size([n.width,n.height])(n.values,L(o)?o:o(n.values));!function(e,t,n,r){var i=r.scale||t.scale,a=r.translate||t.translate;ce(i)&&(i=i(n,r));ce(a)&&(a=a(n,r));if((1===i||null==i)&&!a)return;var u=(Be(i)?i:i[0])||1,o=(Be(i)?i:i[1])||1,s=a&&a[0]||0,l=a&&a[1]||0;e.forEach(Ip(t,u,o,s,l))}(r,n,t,e),r.forEach((function(e){l.push(wr(t,kr(null!=s?ot({},s,e):e)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}}),Yp.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};var Xp=["x","y","weight","size","cellSize","bandwidth"];function Jp(e,t){return Xp.forEach((function(n){return null!=t[n]?e[n](t[n]):0})),e}function Qp(e){ii.call(this,null,e)}Ee(Yp,ii,{transform:function(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=function(e,t){var n,r,i,a,u,o,s=[],l=function(e){return e(a)};if(null==t)s.push(e);else for(n={},r=0,i=e.length;r=0;)i.tick();else if(i.stopped()&&i.restart(),!a)return t.StopPropagation;return this.finish(e,t)},finish:function(e,t){for(var n,r=t.dataflow,i=this._argops,a=0,u=i.length;a=e.length)return t;for(var i,a,u,o=t.length,s=e[r++],l={},c={},f=-1;++fe.length)return t;var i=[];for(var a in t)i.push({key:a,values:r(t[a],n)});return i}return t}function Dm(e){ii.call(this,null,e)}Ee(km,ii,{transform:function(e,t){t.source||E("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),a=this.value;return(!a||r||t.changed())&&(a&&a.each((function(e){e.children&&br(e.data)&&i.rem.push(e.data)})),this.value=a=p.hierarchy({values:se(e.keys).reduce((function(e,t){return e.key(t),e}),wm()).entries(i.source)},Am),n&&a.each((function(e){e.children&&(e=kr(e.data),i.add.push(e),i.source.push(e))})),_m(a,xr,xr)),i.source.root=a,i}});var Em=function(e,t){return e.parent===t.parent?1:2};Ee(Dm,ii,{transform:function(e,t){t.source&&t.source.root||E(this.constructor.name+" transform requires a backing tree data source.");var n=this.layout(e.method),r=this.fields,i=t.source.root,a=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(Er(e.sort,(function(e){return e.data}))),function(e,t,n){for(var r,i=0,a=t.length;i>>5]&1<<(i&Wm)},set:function(t,n){var i=n*e+t;r(i>>>5,1<<(i&Wm))},clear:function(t,n){var r=n*e+t;i(r>>>5,~(1<<(r&Wm)))},getRange:function(t,r,i,a){for(var u,o,s,l,c=a;c>=r;--c)if((s=(u=c*e+t)>>>5)==(l=(o=c*e+i)>>>5)){if(n[s]&Gm[u&Wm]&Hm[1+(o&Wm)])return!0}else{if(n[s]&Gm[u&Wm])return!0;if(n[l]&Hm[1+(o&Wm)])return!0;for(var f=s+1;f>>5)==(l=(o=n*e+i)>>>5))r(s,Gm[u&Wm]&Hm[1+(o&Wm)]);else for(r(s,Gm[u&Wm]),r(l,Hm[1+(o&Wm)]),c=s+1;c>>5)==(l=(o=n*e+r)>>>5))i(s,Hm[u&Wm]|Gm[1+(o&Wm)]);else for(i(s,Hm[u&Wm]),i(l,Gm[1+(o&Wm)]),c=s+1;c=t||i>=e}}}(i,a)},u.ratio=r,u.padding=n,u.width=e,u.height=t,u}function Xm(e,t,n,r,i,a){var u=n/2;return e-u<0||e+u>i||t-(u=r/2)<0||t+u>a}function Jm(e,t,n,r,i,a,u,o){var s=i*a/(2*r),l=e(t-s),c=e(t+s),f=e(n-(a/=2)),d=e(n+a);return u.outOfBounds(l,f,c,d)||u.getRange(l,f,c,d)||o&&o.getRange(l,f,c,d)}var Qm=[-1,-1,1,1],Km=[-1,1,-1,1];var Zm=["right","center","left"],ev=["bottom","middle","top"];function tv(e,t,n,r,i,a,u,o,s,l,c,f){return!(i.outOfBounds(e,n,t,r)||(f&&a||i).getRange(e,n,t,r))}var nv={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},rv={naive:function(e,t,n,r){var i=e.width,a=e.height;return function(e){for(var t,n,u,o,s,l,c,f=e.datum.datum.items[r].items,d=f.length,h=e.datum.fontSize,p=Ac.width(e.datum,e.datum.text),m=0,v=0;v=m&&(m=c,e.x=s,e.y=l);return s=p/2,l=h/2,t=e.x-s,n=e.x+s,u=e.y-l,o=e.y+l,e.align="center",t<0&&n<=i?e.align="left":0<=t&&i=1;)Jm(e,f,d,l,s,c=(h+p)/2,u,o)?p=c:h=c;if(h>r)return[f,d,h,!0]}}return function(t){for(var o,l,c,f,d,h,p,m,v,g,y,b,x,_,k,A,w,D=t.datum.datum.items[r].items,E=D.length,C=t.datum.fontSize,F=Ac.width(t.datum,t.datum.text),M=n?C:0,S=!1,B=!1,O=0,R=0;R(l=void 0===D[R].x2?o:D[R].x2)&&(w=o,o=l,l=w),c>(f=void 0===D[R].y2?c:D[R].y2)&&(w=c,c=f,f=w),g=~~(((v=e(o))+(y=e(l)))/2),x=~~(((b=e(c))+(_=e(f)))/2),p=g;p>=v;--p)for(m=x;m>=b;--m)if(A=s(p,m,M,F,C)){var z=st(A,4);t.x=z[0],t.y=z[1],M=z[2],S=z[3]}for(p=g;p<=y;++p)for(m=x;m<=_;++m)if(A=s(p,m,M,F,C)){var q=st(A,4);t.x=q[0],t.y=q[1],M=q[2],S=q[3]}S||n||(d=(o+l)/2,h=(c+f)/2,(k=Math.abs(l-o+f-c))>=O&&!Xm(d,h,F,C,i,a)&&!Jm(e,d,h,C,F,C,u,null)&&(O=k,t.x=d,t.y=h,B=!0))}return!(!S&&!B)&&(d=F/2,h=C/2,u.setRange(e(t.x-d),e(t.y-h),e(t.x+d),e(t.y+h)),t.align="center",t.baseline="middle",!0)}},floodfill:function(e,t,n,r){var i=e.width,a=e.height,u=t[0],o=t[1],s=e.bitmap();return function(t){for(var l,c,f,d,h,p,m,v,g,y,b,x,_=t.datum.datum.items[r].items,k=_.length,A=t.datum.fontSize,w=Ac.width(t.datum,t.datum.text),D=[],E=n?A:0,C=!1,F=!1,M=0,S=0;S=1;)Jm(e,h,p,A,w,b=(g+y)/2,u,o)?y=b:g=b;g>E&&(t.x=h,t.y=p,E=g,C=!0)}}}C||n||(h=(l+c)/2,p=(f+d)/2,(x=Math.abs(c-l+d-f))>=M&&!Xm(h,p,w,A,i,a)&&!Jm(e,h,p,A,w,A,u,null)&&(M=x,t.x=h,t.y=p,F=!0))}return!(!C&&!F)&&(h=w/2,p=A/2,u.setRange(e(t.x-h),e(t.y-p),e(t.x+h),e(t.y+p)),t.align="center",t.baseline="middle",!0)}}};function iv(e,t,n,r,i,a,u,o,s,l,c){if(!e.length)return e;var f,d=Math.max(r.length,i.length),h=function(e,t){for(var n=new Float64Array(t),r=e.length,i=0;ii||c[3]>a)return!1;for(var d,h,p,m,v,g,y,b,x,_,k,A,w,D,E,C=null!==(l=t.textWidth)&&void 0!==l?l:0,F=0;F>>2&3)-1,p=0===d&&0===h||r[F]<0,m=d&&h?Math.SQRT1_2:1,v=r[F]<0?-1:1,g=c[1+d]+r[F]*d*m,b=(k=c[4+h]+v*f*h/2+r[F]*h*m)-f/2,x=k+f/2,A=e(g),D=e(b),E=e(x),!C){if(!tv(A,A,D,E,u,o,0,0,0,0,0,p))continue;C=Ac.width(t.datum,t.datum.text)}if(y=(_=g+v*C*d/2)+C/2,tv(A=e(g=_-C/2),w=e(y),D,E,u,o,0,0,0,0,0,p))return t.x=d?d*v<0?y:g:_,t.y=h?h*v<0?x:b:k,t.align=Zm[d*v+1],t.baseline=ev[h*v+1],u.setRange(A,D,w,E),!0}return!1}}(D,w,p,h);return A.forEach((function(e){return e.opacity=+M(e)})),A}var av=["x","y","opacity","align","baseline"],uv=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function ov(e){ii.call(this,null,e)}ov.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:uv},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:av.length,default:av}]},Ee(ov,ii,{transform:function(e,t){var n=e.modified();if(n||t.changed(t.ADD_REM)||function(n){var r=e[n];return ce(r)&&t.modified(r.fields)}("sort")){e.size&&2===e.size.length||E("Size parameter should be specified as a [width, height] array.");var r=e.as||av;return iv(t.materialize(t.SOURCE).source||[],e.size,e.sort,se(null==e.offset?1:e.offset),se(e.anchor||uv),e.avoidMarks||[],!1!==e.avoidBaseMark,e.lineAnchor||"end",e.markIndex||0,void 0===e.padding?0:e.padding,e.method||"naive").forEach((function(e){var t=e.datum;t[r[0]]=e.x,t[r[1]]=e.y,t[r[2]]=e.opacity,t[r[3]]=e.align,t[r[4]]=e.baseline})),t.reflow(n).modifies(r)}}});var sv=Object.freeze({__proto__:null,label:ov});function lv(e,t){var n,r,i,a,u,o,s=[],l=function(e){return e(a)};if(null==t)s.push(e);else for(n={},r=0,i=e.length;r=f));)if(t.x=u+i,t.y=l+a,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>o[0]||t.y+t.y1>o[1])&&(!n||!kv(t,e,o[0]))&&(!n||wv(t,n))){for(var m,v=t.sprite,g=t.width>>5,y=o[0]>>5,b=t.x-(g<<4),x=127&b,_=32-x,k=t.y1-t.y0,A=(t.y+t.y0)*y+(b>>5),w=0;w>>x:0);A+=y}return t.sprite=null,!0}return!1}return f.layout=function(){for(var s=function(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=2048/t,e.height=bv/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(Eu()),f=function(e){var t=[],n=-1;for(;++n>5)*o[1]),h=null,p=l.length,m=-1,v=[],g=l.map((function(o){return{text:e(o),font:t(o),style:r(o),weight:i(o),rotate:a(o),size:~~(n(o)+1e-14),padding:u(o),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:o}})).sort((function(e,t){return t.size-e.size}));++m>1,y.y=o[1]*(c()+.5)>>1,_v(s,y,g,m),y.hasText&&d(f,y,h)&&(v.push(y),h?Av(h,y):h=[{x:y.x+y.x0,y:y.y+y.y0},{x:y.x+y.x1,y:y.y+y.y1}],y.x-=o[0]>>1,y.y-=o[1]>>1)}return v},f.words=function(e){return arguments.length?(l=e,f):l},f.size=function(e){return arguments.length?(o=[+e[0],+e[1]],f):o},f.font=function(e){return arguments.length?(t=Ev(e),f):t},f.fontStyle=function(e){return arguments.length?(r=Ev(e),f):r},f.fontWeight=function(e){return arguments.length?(i=Ev(e),f):i},f.rotate=function(e){return arguments.length?(a=Ev(e),f):a},f.text=function(t){return arguments.length?(e=Ev(t),f):e},f.spiral=function(e){return arguments.length?(s=Cv[e]||e,f):s},f.fontSize=function(e){return arguments.length?(n=Ev(e),f):n},f.padding=function(e){return arguments.length?(u=Ev(e),f):u},f.random=function(e){return arguments.length?(c=e,f):c},f}function _v(e,t,n,r){if(!t.sprite){var i=e.context,a=e.ratio;i.clearRect(0,0,2048/a,bv/a);var u,o,s,l,c,f=0,d=0,h=0,p=n.length;for(--r;++r>5<<5,s=~~Math.max(Math.abs(y+b),Math.abs(y-b))}else u=u+31>>5<<5;if(s>h&&(h=s),f+u>=2048&&(f=0,d+=h,h=0),d+s>=bv)break;i.translate((f+(u>>1))/a,(d+(s>>1))/a),t.rotate&&i.rotate(t.rotate*yv),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=u,t.height=s,t.xoff=f,t.yoff=d,t.x1=u>>1,t.y1=s>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,f+=u}for(var _=i.getImageData(0,0,2048/a,bv/a).data,k=[];--r>=0;)if((t=n[r]).hasText){for(o=(u=t.width)>>5,s=t.y1-t.y0,l=0;l>5),E=_[2048*(d+c)+(f+l)<<2]?1<<31-l%32:0;k[D]|=E,A|=E}A?w=c:(t.y0++,s--,c--,d++)}t.y1=t.y0+w,t.sprite=k.slice(0,(t.y1-t.y0)*o)}}}function kv(e,t,n){n>>=5;for(var r,i=e.sprite,a=e.width>>5,u=e.x-(a<<4),o=127&u,s=32-o,l=e.y1-e.y0,c=(e.y+e.y0)*n+(u>>5),f=0;f>>o:0))&t[c+d])return!0;c+=n}return!1}function Av(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function wv(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0>1,v=p[1]>>1,g=h.length,y=0;yi?1:0})),r.permute(e,t)}(h,d),c)o=t,s=e,t=Array(c+f),e=zv(c+f),function(e,t,n,r,i,a,u,o,s){var l,c=0,f=0;for(l=0;c0)for(l=0;l=t?e:((n=n||new e.constructor(t)).set(e),n)}(n,t.length)},add:function(e){for(var n,r=0,i=t.length,a=e.length;rr.length||n>e)&&(e=Math.max(n,e),r=qv(t,e,r),i=qv(t,e))}}}(),e),this._indices=null,this._dims=null}function Pv(e){ii.call(this,null,e)}Nv.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},Ee(Nv,ii,{transform:function(e,t){return this._dims?e.modified("fields")||e.fields.some((function(e){return t.modified(e.fields)}))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init:function(e,t){for(var n,r,i=e.fields,a=e.query,u=this._indices={},o=this._dims=[],s=a.length,l=0;lv)for(i=v,a=Math.min(p,g);ig)for(i=Math.max(p,g),a=m;ih)for(i=h,a=Math.min(f,p);ip)for(i=Math.max(f,p),a=d;i",jv[3]="Identifier",jv[4]="Keyword",jv[5]="Null",jv[6]="Numeric",jv[7]="Punctuator",jv[8]="String",jv[9]="RegularExpression";var rg="Identifier",ig="Unexpected token %0",ag="Invalid regular expression",ug="Invalid regular expression: missing /",og="Octal literals are not allowed in strict mode.",sg="ILLEGAL",lg="Disabled.",cg=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),fg=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function dg(e,t){if(!e)throw new Error("ASSERT: "+t)}function hg(e){return e>=48&&e<=57}function pg(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function mg(e){return"01234567".indexOf(e)>=0}function vg(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function gg(e){return 10===e||13===e||8232===e||8233===e}function yg(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&cg.test(String.fromCharCode(e))}function bg(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&fg.test(String.fromCharCode(e))}var xg={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function _g(){for(;Iv<$v;){var e=Uv.charCodeAt(Iv);if(!vg(e)&&!gg(e))break;++Iv}}function kg(e){var t,n,r,i=0;for(n="u"===e?4:2,t=0;t1114111||"}"!==e)&&Ng({},ig,sg),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function wg(){var e,t;for(e=Uv.charCodeAt(Iv++),t=String.fromCharCode(e),92===e&&(117!==Uv.charCodeAt(Iv)&&Ng({},ig,sg),++Iv,(e=kg("u"))&&"\\"!==e&&yg(e.charCodeAt(0))||Ng({},ig,sg),t=e);Iv<$v&&bg(e=Uv.charCodeAt(Iv));)++Iv,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==Uv.charCodeAt(Iv)&&Ng({},ig,sg),++Iv,(e=kg("u"))&&"\\"!==e&&bg(e.charCodeAt(0))||Ng({},ig,sg),t+=e);return t}function Dg(){var e,t;return e=Iv,t=92===Uv.charCodeAt(Iv)?wg():function(){var e,t;for(e=Iv++;Iv<$v;){if(92===(t=Uv.charCodeAt(Iv)))return Iv=e,wg();if(!bg(t))break;++Iv}return Uv.slice(e,Iv)}(),{type:1===t.length?3:xg.hasOwnProperty(t)?4:"null"===t?5:"true"===t||"false"===t?1:3,value:t,start:e,end:Iv}}function Eg(){var e,t,n,r,i=Iv,a=Uv.charCodeAt(Iv),u=Uv[Iv];switch(a){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++Iv,{type:7,value:String.fromCharCode(a),start:i,end:Iv};default:if(61===(e=Uv.charCodeAt(Iv+1)))switch(a){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return Iv+=2,{type:7,value:String.fromCharCode(a)+String.fromCharCode(e),start:i,end:Iv};case 33:case 61:return Iv+=2,61===Uv.charCodeAt(Iv)&&++Iv,{type:7,value:Uv.slice(i,Iv),start:i,end:Iv}}}return">>>="===(r=Uv.substr(Iv,4))?{type:7,value:r,start:i,end:Iv+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:Iv+=3}:u===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(u)>=0||"=>"===t?{type:7,value:t,start:i,end:Iv+=2}:("//"===t&&Ng({},ig,sg),"<>=!+-*%&|^/".indexOf(u)>=0?{type:7,value:u,start:i,end:++Iv}:void Ng({},ig,sg))}function Cg(){var e,t,n;if(dg(hg((n=Uv[Iv]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=Iv,e="","."!==n){if(e=Uv[Iv++],n=Uv[Iv],"0"===e){if("x"===n||"X"===n)return++Iv,function(e){for(var t="";Iv<$v&&pg(Uv[Iv]);)t+=Uv[Iv++];return 0===t.length&&Ng({},ig,sg),yg(Uv.charCodeAt(Iv))&&Ng({},ig,sg),{type:6,value:parseInt("0x"+t,16),start:e,end:Iv}}(t);if(mg(n))return function(e){for(var t="0"+Uv[Iv++];Iv<$v&&mg(Uv[Iv]);)t+=Uv[Iv++];return(yg(Uv.charCodeAt(Iv))||hg(Uv.charCodeAt(Iv)))&&Ng({},ig,sg),{type:6,value:parseInt(t,8),octal:!0,start:e,end:Iv}}(t);n&&hg(n.charCodeAt(0))&&Ng({},ig,sg)}for(;hg(Uv.charCodeAt(Iv));)e+=Uv[Iv++];n=Uv[Iv]}if("."===n){for(e+=Uv[Iv++];hg(Uv.charCodeAt(Iv));)e+=Uv[Iv++];n=Uv[Iv]}if("e"===n||"E"===n)if(e+=Uv[Iv++],"+"!==(n=Uv[Iv])&&"-"!==n||(e+=Uv[Iv++]),hg(Uv.charCodeAt(Iv)))for(;hg(Uv.charCodeAt(Iv));)e+=Uv[Iv++];else Ng({},ig,sg);return yg(Uv.charCodeAt(Iv))&&Ng({},ig,sg),{type:6,value:parseFloat(e),start:t,end:Iv}}function Fg(){var e,t,n,r;return Wv=null,_g(),e=Iv,t=function(){var e,t,n,r;for(dg("/"===(e=Uv[Iv]),"Regular expression literal must start with a slash"),t=Uv[Iv++],n=!1,r=!1;Iv<$v;)if(t+=e=Uv[Iv++],"\\"===e)gg((e=Uv[Iv++]).charCodeAt(0))&&Ng({},ug),t+=e;else if(gg(e.charCodeAt(0)))Ng({},ug);else if(n)"]"===e&&(n=!1);else{if("/"===e){r=!0;break}"["===e&&(n=!0)}return r||Ng({},ug),{value:t.substr(1,t.length-2),literal:t}}(),n=function(){var e,t,n;for(t="",n="";Iv<$v&&bg((e=Uv[Iv]).charCodeAt(0));)++Iv,"\\"===e&&Iv<$v?Ng({},ig,sg):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Ng({},ag,n),{value:n,literal:t}}(),r=function(e,t){var n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(function(e,t){if(parseInt(t,16)<=1114111)return"x";Ng({},ag)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){Ng({},ag)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:Iv}}function Mg(){if(_g(),Iv>=$v)return{type:2,start:Iv,end:Iv};var e=Uv.charCodeAt(Iv);return yg(e)?Dg():40===e||41===e||59===e?Eg():39===e||34===e?function(){var e,t,n,r,i="",a=!1;for(dg("'"===(e=Uv[Iv])||'"'===e,"String literal must starts with a quote"),t=Iv,++Iv;Iv<$v;){if((n=Uv[Iv++])===e){e="";break}if("\\"===n)if((n=Uv[Iv++])&&gg(n.charCodeAt(0)))"\r"===n&&"\n"===Uv[Iv]&&++Iv;else switch(n){case"u":case"x":"{"===Uv[Iv]?(++Iv,i+=Ag()):i+=kg(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:mg(n)?(0!==(r="01234567".indexOf(n))&&(a=!0),Iv<$v&&mg(Uv[Iv])&&(a=!0,r=8*r+"01234567".indexOf(Uv[Iv++]),"0123".indexOf(n)>=0&&Iv<$v&&mg(Uv[Iv])&&(r=8*r+"01234567".indexOf(Uv[Iv++]))),i+=String.fromCharCode(r)):i+=n}else{if(gg(n.charCodeAt(0)))break;i+=n}}return""!==e&&Ng({},ig,sg),{type:8,value:i,octal:a,start:t,end:Iv}}():46===e?hg(Uv.charCodeAt(Iv+1))?Cg():Eg():hg(e)?Cg():Eg()}function Sg(){var e=Wv;return Iv=e.end,Wv=Mg(),Iv=e.end,e}function Bg(){var e=Iv;Wv=Mg(),Iv=e}function Og(e,t,n){var r=new ng("||"===e||"&&"===e?"LogicalExpression":"BinaryExpression");return r.operator=e,r.left=t,r.right=n,r}function Rg(e,t){var n=new ng("CallExpression");return n.callee=e,n.arguments=t,n}function zg(e){var t=new ng(rg);return t.name=e,t}function qg(e){var t=new ng("Literal");return t.value=e.value,t.raw=Uv.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function Tg(e,t,n){var r=new ng("MemberExpression");return r.computed="["===e,r.object=t,r.property=n,r.computed||(n.member=!0),r}function Lg(e,t,n){var r=new ng("Property");return r.key=t,r.value=n,r.kind=e,r}function Ng(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(function(e,t){return dg(t":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function ty(){var e,t;return e=function(){var e,t,n,r,i,a,u,o,s,l;if(e=Wv,s=Zg(),0===(i=ey(r=Wv)))return s;for(r.prec=i,Sg(),t=[e,Wv],a=[s,r,u=Zg()];(i=ey(Wv))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)u=a.pop(),o=a.pop().value,s=a.pop(),t.pop(),n=Og(o,s,u),a.push(n);(r=Sg()).prec=i,a.push(r),t.push(Wv),n=Zg(),a.push(n)}for(n=a[l=a.length-1],t.pop();l>1;)t.pop(),n=Og(a[l-1].value,a[l-2],n),l-=2;return n}(),Ug("?")&&(Sg(),t=ty(),jg(":"),e=function(e,t,n){var r=new ng("ConditionalExpression");return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,ty())),e}function ny(){var e=ty();if(Ug(","))throw new Error(lg);return e}function ry(e){Iv=0,$v=(Uv=e).length,Wv=null,Bg();var t=ny();if(2!==Wv.type)throw new Error("Unexpect token after expression.");return t}var iy,ay={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function uy(e){function t(t,n,r){return function(i){return function(t,n,r,i){var a=e(n[0]);return r&&(a=r+"("+a+")",0===r.lastIndexOf("new ",0)&&(a="("+a+")")),a+"."+t+(i<0?"":0===i?"()":"("+n.slice(1).map(e).join(",")+")")}(t,i,n,r)}}var n="new Date",r="String",i="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(t){t.length<3&&E("Missing arguments to clamp function."),t.length>3&&E("Too many arguments to clamp function.");var n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:t("getDate",n,0),day:t("getDay",n,0),year:t("getFullYear",n,0),month:t("getMonth",n,0),hours:t("getHours",n,0),minutes:t("getMinutes",n,0),seconds:t("getSeconds",n,0),milliseconds:t("getMilliseconds",n,0),time:t("getTime",n,0),timezoneoffset:t("getTimezoneOffset",n,0),utcdate:t("getUTCDate",n,0),utcday:t("getUTCDay",n,0),utcyear:t("getUTCFullYear",n,0),utcmonth:t("getUTCMonth",n,0),utchours:t("getUTCHours",n,0),utcminutes:t("getUTCMinutes",n,0),utcseconds:t("getUTCSeconds",n,0),utcmilliseconds:t("getUTCMilliseconds",n,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",r,0),lower:t("toLowerCase",r,0),substring:t("substring",r),split:t("split",r),trim:t("trim",r,0),regexp:i,test:t("test",i),if:function(t){t.length<3&&E("Missing arguments to if function."),t.length>3&&E("Too many arguments to if function.");var n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function oy(e){var t=(e=e||{}).allowed?Ze(e.allowed):{},n=e.forbidden?Ze(e.forbidden):{},r=e.constants||ay,i=(e.functions||uy)(f),a=e.globalvar,u=e.fieldvar,o=ce(a)?a:function(e){return"".concat(a,'["').concat(e,'"]')},s={},l={},c=0;function f(e){if(Re(e))return e;var t=d[e.type];return null==t&&E("Unsupported type: "+e.type),t(e)}var d={Literal:function(e){return e.raw},Identifier:function(e){var i=e.name;return c>0?i:ke(n,i)?E("Illegal identifier: "+i):ke(r,i)?r[i]:ke(t,i)?i:(s[i]=1,o(i))},MemberExpression:function(e){var t=!e.computed,n=f(e.object);t&&(c+=1);var r=f(e.property);return n===u&&(l[function(e){var t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(r)]=1),t&&(c-=1),n+(t?"."+r:"["+r+"]")},CallExpression:function(e){"Identifier"!==e.callee.type&&E("Illegal callee type: "+e.callee.type);var t=e.callee.name,n=e.arguments,r=ke(i,t)&&i[t];return r||E("Unrecognized function: "+t),ce(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:function(e){return"["+e.elements.map(f).join(",")+"]"},BinaryExpression:function(e){return"("+f(e.left)+" "+e.operator+" "+f(e.right)+")"},UnaryExpression:function(e){return"("+e.operator+f(e.argument)+")"},ConditionalExpression:function(e){return"("+f(e.test)+"?"+f(e.consequent)+":"+f(e.alternate)+")"},LogicalExpression:function(e){return"("+f(e.left)+e.operator+f(e.right)+")"},ObjectExpression:function(e){return"{"+e.properties.map(f).join(",")+"}"},Property:function(e){c+=1;var t=f(e.key);return c-=1,t+":"+f(e.value)}};function h(e){var t={code:f(e),globals:Object.keys(s),fields:Object.keys(l)};return s={},l={},t}return h.functions=i,h.constants=r,h}var sy="intersect",ly="union",cy="_vgsid_",fy=F(cy),dy="index:unit";function hy(e,t){for(var n,r,i=t.fields,a=t.values,u=i.length,o=0;o=0})):t})),ot(iy,"R_union",(function(e,t){var n=W(t[0]),r=W(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]})),iy);function yy(e,t,n,r){t[0].type!==Hv&&E("First argument to selection functions must be a string literal.");var i=t[0].value,a="unit",u="@unit",o=":"+i;(t.length>=2&&$(t).value)!==sy||ke(r,u)||(r["@unit"]=n.getData(i).indataRef(n,a)),ke(r,o)||(r[o]=n.getData(i).tuplesRef())}function by(e){var t=this.context.data[e];return t?t.values.value:[]}var xy=function(e){return function(t,n){return this.context.dataflow.locale()[e](n)(t)}},_y=xy("format"),ky=xy("timeFormat"),Ay=xy("utcFormat"),wy=xy("timeParse"),Dy=xy("utcParse"),Ey=new Date(2e3,0,1);function Cy(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(Ey.setYear(2e3),Ey.setMonth(e),Ey.setDate(t),ky.call(this,Ey,n)):""}function Fy(e,t,n,r){t[0].type!==Hv&&E("First argument to data functions must be a string literal.");var i=t[0].value,a=":"+i;if(!ke(a,r))try{r[a]=n.getData(i).tuplesRef()}catch(e){}}function My(e,t,n,r){if(t[0].type===Hv)Sy(n,r,t[0].value);else for(e in n.scales)Sy(n,r,e)}function Sy(e,t,n){var r="%"+n;if(!ke(t,r))try{t[r]=e.scaleRef(n)}catch(e){}}function By(e,t){var n;return ce(e)?e:Re(e)?(n=t.scales[e])&&n.value:void 0}function Oy(e,t,n){t.__bandwidth=function(e){return e&&e.bandwidth?e.bandwidth():0},n._bandwidth=My,n._range=My,n._scale=My;var r=function(t){return"_["+(t.type===Hv?Ue("%"+t.value):Ue("%")+"+"+e(t))+"]"};return{_bandwidth:function(e){return"this.__bandwidth(".concat(r(e[0]),")")},_range:function(e){return"".concat(r(e[0]),".range()")},_scale:function(t){return"".concat(r(t[0]),"(").concat(e(t[1]),")")}}}function Ry(e,t){return function(n,r,i){if(n){var a=By(n,(i||this).context);return a&&a.path[e](r)}return t(r)}}var zy=Ry("area",f.geoArea),qy=Ry("bounds",f.geoBounds),Ty=Ry("centroid",f.geoCentroid);function Ly(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(t){e.warn(t)}return n[n.length-1]}function Ny(e){var t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Py(e){var t=d.rgb(e);return.2126*Ny(t.r)+.7152*Ny(t.g)+.0722*Ny(t.b)}function jy(e,t){return e===t||e!=e&&t!=t||(L(e)?!(!L(t)||e.length!==t.length)&&function(e,t){for(var n=0,r=e.length;n1?n-1:0),i=1;i1?n-1:0),i=1;i1?n-1:0),i=1;i1?n-1:0),i=1;i3&&void 0!==arguments[3]?arguments[3]:5,i=e[e.length-1];return void 0===i||Math.sqrt(Math.pow(i[0]-t,2)+Math.pow(i[1]-n,2))>r?(e.push([t,n]),lt(e)):e},lassoPath:function(e){return(null!=e?e:[]).reduce((function(t,n,r){var i=st(n,2),a=i[0],u=i[1];return t+(0==r?"M ".concat(a,",").concat(u," "):r===e.length-1?" Z":"L ".concat(a,",").concat(u," "))}),"")},intersectLasso:function(e,t,n){var r,i=n.x,a=n.y,u=n.mark,o=(new Hs).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER),s=dt(t);try{for(s.s();!(r=s.n()).done;){var l=st(r.value,2),c=l[0],f=l[1];co.x2&&(o.x2=c),fo.y2&&(o.y2=f)}}catch(e){s.e(e)}finally{s.f()}return o.translate(i,a),Xy([[o.x1,o.y1],[o.x2,o.y2]],e,u).filter((function(e){return function(e,t,n){for(var r=0,i=0,a=n.length-1;it!=s>t&&e<(o-c)*(t-f)/(s-f)+c&&r++}return 1&r}(e.x,e.y,t)}))}},Qy=["view","item","group","xy","x","y"],Ky="this.",Zy={},eb={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:function(e){return"_[".concat(Ue("$"+e),"]")},functions:function(e){var t=uy(e);for(var n in Qy.forEach((function(e){return t[e]="event.vega."+e})),Jy)t[n]=Ky+n;return ye(t,Oy(e,Jy,Zy)),t},constants:ay,visitors:Zy},tb=oy(eb);function nb(e,t,n){return 1===arguments.length?Jy[e]:(Jy[e]=t,n&&(Zy[e]=n),tb&&(tb.functions[e]=Ky+e),this)}function rb(e,t){var n,r={};try{n=ry(e=Re(e)?e:Ue(e)+"")}catch(t){E("Expression parse error: "+e)}n.visit((function(e){if(e.type===Jv){var n=e.callee.name,i=eb.visitors[n];i&&i(n,e.arguments,t,r)}}));var i=tb(n);return i.globals.forEach((function(e){var n="$"+e;!ke(r,n)&&t.getSignal(e)&&(r[n]=t.signalRef(e))})),{$expr:ye({code:i.code},t.options.ast?{ast:n}:null),$fields:i.fields,$params:r}}nb("bandwidth",(function(e,t){var n=By(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),My),nb("copy",(function(e,t){var n=By(e,(t||this).context);return n?n.copy():void 0}),My),nb("domain",(function(e,t){var n=By(e,(t||this).context);return n?n.domain():[]}),My),nb("range",(function(e,t){var n=By(e,(t||this).context);return n&&n.range?n.range():[]}),My),nb("invert",(function(e,t,n){var r=By(e,(n||this).context);return r?L(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}),My),nb("scale",(function(e,t,n){var r=By(e,(n||this).context);return r?r(t):void 0}),My),nb("gradient",(function(e,t,n,r,i){e=By(e,(i||this).context);var a=Jo(t,n),u=e.domain(),o=u[0],s=$(u),l=S;return s-o?l=bo(e,o,s):e=(e.interpolator?ao("sequential")().interpolator(e.interpolator()):ao("linear")().interpolate(e.interpolate()).range(e.range())).domain([o=0,s=1]),e.ticks&&(o!==(u=e.ticks(+r||15))[0]&&u.unshift(o),s!==$(u)&&u.push(s)),u.forEach((function(t){return a.stop(l(t),e(t))})),a}),My),nb("geoArea",zy,My),nb("geoBounds",qy,My),nb("geoCentroid",Ty,My),nb("geoShape",(function(e,t,n){var r=By(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}}),My),nb("indata",(function(e,t,n){var r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(e,t,n,r){t[0].type!==Hv&&E("First argument to indata must be a string literal."),t[1].type!==Hv&&E("Second argument to indata must be a string literal.");var i=t[0].value,a=t[1].value,u="@"+a;ke(u,r)||(r[u]=n.getData(i).indataRef(n,a))})),nb("data",by,Fy),nb("treePath",(function(e,t,n){var r=Vy(e,this),i=r[t],a=r[n];return i&&a?i.path(a).map(Hy):void 0}),Fy),nb("treeAncestors",(function(e,t){var n=Vy(e,this)[t];return n?n.ancestors().map(Hy):void 0}),Fy),nb("vlSelectionTest",(function(e,t,n){for(var r,i,a,u,o,s=this.context.data[e],l=s?s.values.value:[],c=s?s[dy]&&s[dy].value:void 0,f=n===sy,d=l.length,h=0;h v || v == null) && u != null ? ").concat(r,"\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(n,"\n : v !== v && u === u ? ").concat(r," : ")}(i,a,-u,u)})).join("")+"0;");return n?r.bind(n):r}}};function lb(e,t,n){if(!e||!N(e))return e;for(var r,i=0,a=cb.length;i=0;)if(r=i[a].type,n=i[a].handler,e===r&&(t===n||t===n.raw)){this._handler.off(r,n);break}return this},addResizeListener:function(e){var t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener:function(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener:function(e,t){return dx(this,e,cx(this,e),t)},removeSignalListener:function(e,t){return hx(this,cx(this,e),t)},addDataListener:function(e,t){return dx(this,e,yb(this,e).values,t)},removeDataListener:function(e,t){return hx(this,yb(this,e).values,t)},globalCursor:function(e){if(arguments.length){if(this._globalCursor!==!!e){var t=gb(this,null);this._globalCursor=!!e,t&&gb(this,t)}return this}return this._globalCursor},preventDefault:function(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function(e,t){this._timers.push(v.interval((function(t){e({timestamp:Date.now(),elapsed:t})}),t))},events:function(e,t,n){var r,i=this,a=new Tr(n),u=function(n,r){i.runAsync(null,(function(){e===Db&&function(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[t]:i?!i[t]:e.preventDefault()))}(i,t)&&n.preventDefault(),a.receive(wb(i,n,r))}))};if("timer"===e)Fb(i,"timer",t)&&i.timer(u,t);else if(e===Db)Fb(i,"view",t)&&i.addEventListener(t,u,Eb);else if("window"===e?Fb(i,"window",t)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&Fb(i,"selector",t)&&(r=document.querySelectorAll(e)),r){for(var o=0,s=r.length;o=0;)i[e].stop();for(e=a.length;--e>=0;)for(t=(n=a[e]).sources.length;--t>=0;)n.sources[t].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},hover:function(e,t){return t=[t||"update",(e=[e||"hover"])[0]],this.on(this.events("view","mouseover",Mb),Sb,Bb(e)),this.on(this.events("view","mouseout",Mb),Sb,Bb(t)),this},data:function(e,t){return arguments.length<2?yb(this,e).values.value:bb.call(this,e,Fr().remove(R).insert(t))},change:bb,insert:function(e,t){return bb.call(this,e,Fr().insert(t))},remove:function(e,t){return bb.call(this,e,Fr().remove(t))},scale:function(e){var t=this._runtime.scales;return ke(t,e)||E("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){var n=this,r=n._renderType,i=n._eventConfig.bind,a=_d(r);e=n._el=e?$b(n,e,!0):null,function(e){var t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),mb(t,e.description()))}(n),a||n.error("Unrecognized renderer type: "+r);var u=a.handler||wf,o=e?a.renderer:a.headless;return n._renderer=o?Ub(n,n._renderer,e,o):null,n._handler=function(e,t,n,r){var i=new r(e.loader(),Ib(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,kb(e),e);return t&&t.handlers().forEach((function(e){i.on(e.type,e.handler)})),i}(n,n._handler,e,u),n._redraw=!0,e&&"none"!==i&&(t=t?n._elBind=$b(n,t,!0):e.appendChild(Ob("form",{class:"vega-bindings"})),n._bind.forEach((function(e){e.param.element&&"container"!==i&&(e.element=$b(n,e.param.element,!!e.param.input))})),n._bind.forEach((function(e){!function(e,t,n){if(t){var r=n.param,i=n.state;i||(i=n.state={elements:null,active:!1,set:null,update:function(t){t!=e.signal(r.signal)&&e.runAsync(null,(function(){i.source=!0,e.signal(r.signal,t)}))}},r.debounce&&(i.update=ge(r.debounce,i.update))),(null==r.input&&r.element?Rb:zb)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,(function(){i.source?i.source=!1:i.set(e.signal(r.signal))})),i.active=!0)}}(n,e.element||t,e)}))),n},toImageURL:function(e,t){return Yb.apply(this,arguments)},toCanvas:function(e,t){return Jb.apply(this,arguments)},toSVG:function(e){return Qb.apply(this,arguments)},getState:function(e){return this._runtime.getState(e||{data:ix,signals:ax,recurse:!0})},setState:function(e){return this.runAsync(null,(function(t){t._trigger=!1,t._runtime.setState(e)}),(function(e){e._trigger=!0})),this}});var px,mx,vx="[",gx="]",yx=/[[\]{}]/,bx={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};function xx(e,t,n){return px=t||"view",mx=n||bx,kx(e.trim()).map(Ax)}function _x(e,t,n,r,i){for(var a,u=e.length,o=0;t=0?--o:r&&r.indexOf(a)>=0&&++o}return t}function kx(e){for(var t=[],n=e.length,r=0,i=0;i"!==(e=e.slice(r+1).trim())[0])throw"Expected '>' after between selector: "+e;t=t.map(Ax);var i=Ax(e.slice(1).trim());if(i.between)return{between:t,stream:i};i.between=t;return i}(e):function(e){var t,n,r={source:px},i=[],a=[0,0],u=0,o=0,s=e.length,l=0;if("}"===e[s-1]){if(!((l=e.lastIndexOf("{"))>=0))throw"Unmatched right brace: "+e;try{a=function(e){var t=e.split(",");if(!e.length||t.length>2)throw e;return t.map((function(t){var n=+t;if(n!=n)throw e;return n}))}(e.substring(l+1,s-1))}catch(t){throw"Invalid throttle specification: "+e}s=(e=e.slice(0,l).trim()).length,l=0}if(!s)throw e;"@"===e[0]&&(u=++l);(t=_x(e,l,":"))1?(r.type=i[1],u?r.markname=i[0].slice(1):!function(e){return mx[e]}(i[0])?r.source=i[0]:r.marktype=i[0]):r.type=i[0];"!"===r.type.slice(-1)&&(r.consume=!0,r.type=r.type.slice(0,-1));null!=n&&(r.filter=n);a[0]&&(r.throttle=a[0]);a[1]&&(r.debounce=a[1]);return r}(e)}function wx(e){return N(e)?e:{type:e||"pad"}}var Dx=function(e){return+e||0};function Ex(e){return N(e)?e.signal?e:{top:Dx(e.top),bottom:Dx(e.bottom),left:Dx(e.left),right:Dx(e.right)}:{top:t=Dx(e),bottom:t,left:t,right:t};var t}var Cx=function(e){return N(e)&&!L(e)?ye({},e):{value:e}};function Fx(e,t,n,r){return null!=n?(N(n)&&!L(n)||L(n)&&n.length&&N(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1):0}function Mx(e,t,n){for(var r in t)Fx(e,r,t[r]);for(var i in n)Fx(e,i,n[i],"update")}function Sx(e,t,n){for(var r in t)n&&ke(n,r)||(e[r]=ye(e[r]||{},t[r]));return e}function Bx(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}var Ox="mark",Rx="frame",zx="scope",qx="legend-label",Tx="title-text",Lx="title-subtitle";function Nx(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}var Px=function(e){return Re(e)?Ue(e):e.signal?"(".concat(e.signal,")"):$x(e)};function jx(e){if(null!=e.gradient)return function(e){var t=[e.start,e.stop,e.count].map((function(e){return null==e?null:Ue(e)}));for(;t.length&&null==$(t);)t.pop();return t.unshift(Px(e.gradient)),"gradient(".concat(t.join(","),")")}(e);var t=e.signal?"(".concat(e.signal,")"):e.color?function(e){return e.c?Ux("hcl",e.h,e.c,e.l):e.h||e.s?Ux("hsl",e.h,e.s,e.l):e.l||e.a?Ux("lab",e.l,e.a,e.b):e.r||e.g||e.b?Ux("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?$x(e.field):void 0!==e.value?Ue(e.value):void 0;return null!=e.scale&&(t=function(e,t){var n=Px(e.scale);null!=e.range?t="lerp(_range(".concat(n,"), ").concat(+e.range,")"):(void 0!==t&&(t="_scale(".concat(n,", ").concat(t,")")),e.band&&(t=(t?t+"+":"")+"_bandwidth(".concat(n,")")+(1==+e.band?"":"*"+Ix(e.band)),e.extra&&(t="(datum.extra ? _scale(".concat(n,", datum.extra.value) : ").concat(t,")"))),null==t&&(t="0"));return t}(e,t)),void 0===t&&(t=null),null!=e.exponent&&(t="pow(".concat(t,",").concat(Ix(e.exponent),")")),null!=e.mult&&(t+="*".concat(Ix(e.mult))),null!=e.offset&&(t+="+".concat(Ix(e.offset))),e.round&&(t="round(".concat(t,")")),t}var Ux=function(e,t,n,r){return"(".concat(e,"(").concat([t,n,r].map(jx).join(","),")+'')")};function Ix(e){return N(e)?"("+jx(e)+")":e}function $x(e){return Wx(N(e)?e:{datum:e})}function Wx(e){var t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):E("Invalid field reference: "+Ue(e));return e.signal||(r=Re(r)?C(r).map(Ue).join("]["):Wx(r)),t+"["+r+"]"}function Gx(e,t,n,r,i,a){var u={};for(var o in(a=a||{}).encoders={$encode:u},e=function(e,t,n,r,i){var a,u,o,s={},l={};for(u in u="lineBreak","text"!==t||null==i[u]||Bx(u,e)||Nx(s,u,i[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),o=n===Rx?i.group:n===Ox?ye({},i.mark,i[t]):null)Bx(u,e)||("fill"===u||"stroke"===u)&&(Bx("fill",e)||Bx("stroke",e))||Nx(s,u,o[u]);for(u in se(r).forEach((function(t){var n=i.style&&i.style[t];for(var r in n)Bx(r,e)||Nx(s,r,n[r])})),e=ye({},e),s)(o=s[u]).signal?(a=a||{})[u]=o:l[u]=o;return e.enter=ye(l,e.enter),a&&(e.update=ye(a,e.update)),e}(e,t,n,r,i.config),e)u[o]=Hx(e[o],t,a,i);return a}function Hx(e,t,n,r){var i,a={},u={};for(var o in e)null!=e[o]&&(a[o]=Vx((i=e[o],L(i)?function(e){var t="";return e.forEach((function(e){var n=jx(e);t+=e.test?"(".concat(e.test,")?").concat(n,":"):n})),":"===$(t)&&(t+="null"),t}(i):jx(i)),r,n,u));return{$expr:{marktype:t,channels:a},$fields:Object.keys(u),$output:Object.keys(e)}}function Vx(e,t,n,r){var i=rb(e,t);return i.$fields.forEach((function(e){return r[e]=1})),ye(n,i.$params),i.$expr}var Yx=["value","update","init","react","bind"];function Xx(e,t){E(e+' for "outer" push: '+Ue(t))}function Jx(e,t){var n=e.name;if("outer"===e.push)t.signals[n]||Xx("No prior signal definition",n),Yx.forEach((function(t){void 0!==e[t]&&Xx("Invalid property ",t)}));else{var r=t.addSignal(n,e.value);!1===e.react&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function Qx(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function Kx(e,t,n,r){return new Qx(e,t,n,r)}function Zx(e,t){return Kx("operator",e,t)}function e_(e){var t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function t_(e,t){return t?{$field:e,$name:t}:{$field:e}}var n_=t_("key");function r_(e,t){return{$compare:e,$order:t}}function i_(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}var a_="scope",u_="view";function o_(e){return e&&e.signal}function s_(e){if(o_(e))return!0;if(N(e))for(var t in e)if(s_(e[t]))return!0;return!1}function l_(e,t){return null!=e?e:t}function c_(e){return e&&e.signal||e}var f_="timer";function d_(e,t){return(e.merge?h_:e.stream?p_:e.type?m_:E("Invalid stream specification: "+Ue(e)))(e,t)}function h_(e,t){var n=v_({merge:e.merge.map((function(e){return d_(e,t)}))},e,t);return t.addStream(n).id}function p_(e,t){var n=v_({stream:d_(e.stream,t)},e,t);return t.addStream(n).id}function m_(e,t){var n;e.type===f_?(n=t.event(f_,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(function(e){return e===a_?u_:e||u_}(e.source),e.type);var r=v_({stream:n},e,t);return 1===Object.keys(r).length?n:t.addStream(r).id}function v_(e,t,n){var r=t.between;return r&&(2!==r.length&&E('Stream "between" parameter must have 2 entries: '+Ue(t)),e.between=[d_(r[0],n),d_(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(function(e,t,n){var r="event.item";return r+(e&&"*"!==e?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===a_&&r.push("inScope(event.item)"),r.length&&(e.filter=rb("("+r.join(")&&(")+")",n).$expr),null!=(r=t.throttle)&&(e.throttle=+r),null!=(r=t.debounce)&&(e.debounce=+r),t.consume&&(e.consume=!0),e}var g_={code:"_.$value",ast:{type:"Identifier",value:"value"}};function y_(e,t,n){var r=e.encode,i={target:n},a=e.events,u=e.update,o=[];a||E("Signal update missing events specification."),Re(a)&&(a=xx(a,t.isSubscope()?a_:u_)),a=se(a).filter((function(e){return e.signal||e.scale?(o.push(e),0):1})),o.length>1&&(o=[b_(o)]),a.length&&o.push(a.length>1?{merge:a}:a[0]),null!=r&&(u&&E("Signal encode and update are mutually exclusive."),u="encode(item(),"+Ue(r)+")"),i.update=Re(u)?rb(u,t):null!=u.expr?rb(u.expr,t):null!=u.value?u.value:null!=u.signal?{$expr:g_,$params:{$value:t.signalRef(u.signal)}}:E("Invalid signal update specification."),e.force&&(i.options={force:!0}),o.forEach((function(e){return t.addUpdate(ye(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):d_(e,t)}}(e,t),i))}))}function b_(e){return{signal:"["+e.map((function(e){return e.scale?'scale("'+e.scale+'")':e.signal}))+"]"}}var x_=function(e){return function(t,n,r){return Kx(e,n,t||void 0,r)}},__=x_("aggregate"),k_=x_("axisticks"),A_=x_("bound"),w_=x_("collect"),D_=x_("compare"),E_=x_("datajoin"),C_=x_("encode"),F_=x_("expression"),M_=x_("facet"),S_=x_("field"),B_=x_("key"),O_=x_("legendentries"),R_=x_("load"),z_=x_("mark"),q_=x_("multiextent"),T_=x_("multivalues"),L_=x_("overlap"),N_=x_("params"),P_=x_("prefacet"),j_=x_("projection"),U_=x_("proxy"),I_=x_("relay"),$_=x_("render"),W_=x_("scale"),G_=x_("sieve"),H_=x_("sortitems"),V_=x_("viewlayout"),Y_=x_("values"),X_=0,J_={min:"min",max:"max",count:"sum"};function Q_(e,t){var n,r,i=t.getScale(e.name).params;for(n in i.domain=tk(e.domain,e,t),null!=e.range&&(i.range=lk(e,t,i)),null!=e.interpolate&&function(e,t){t.interpolate=K_(e.type||e),null!=e.gamma&&(t.interpolateGamma=K_(e.gamma))}(e.interpolate,i),null!=e.nice&&(i.nice=N(r=e.nice)?{interval:K_(r.interval),step:K_(r.step)}:K_(r)),null!=e.bins&&(i.bins=function(e,t){return e.signal||L(e)?Z_(e,t):t.objectProperty(e)}(e.bins,t)),e)ke(i,n)||"name"===n||(i[n]=K_(e[n],t))}function K_(e,t){return N(e)?e.signal?t.signalRef(e.signal):E("Unsupported object: "+Ue(e)):e}function Z_(e,t){return e.signal?t.signalRef(e.signal):e.map((function(e){return K_(e,t)}))}function ek(e){E("Can not find data set: "+Ue(e))}function tk(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(L(e)?nk:e.fields?ik:rk)(e,t,n);null==t.domainMin&&null==t.domainMax||E("No scale domain defined for domainMin/domainMax to override.")}function nk(e,t,n){return e.map((function(e){return K_(e,n)}))}function rk(e,t,n){var r=n.getData(e.data);return r||ek(e.data),lo(t.type)?r.valuesRef(n,e.field,uk(e.sort,!1)):po(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function ik(e,t,n){var r=e.data,i=e.fields.reduce((function(e,t){return t=Re(t)?{data:r,field:t}:L(t)||t.signal?function(e,t){var n="_:vega:_"+X_++,r=w_({});if(L(e))r.value={$ingest:e};else if(e.signal){var i="setdata("+Ue(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,G_({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e}),[]);return(lo(t.type)?ak:po(t.type)?ok:sk)(e,n,i)}function ak(e,t,n){var r,i,a=uk(e.sort,!0),u=n.map((function(e){var n=t.getData(e.data);return n||ek(e.data),n.countsRef(t,e.field,a)})),o={groupby:n_,pulse:u};a&&(r=a.op||"count",i=a.field?i_(r,a.field):"count",o.ops=[J_[r]],o.fields=[t.fieldRef(i)],o.as=[i]),r=t.add(__(o));var s=t.add(w_({pulse:e_(r)}));return i=t.add(Y_({field:n_,sort:t.sortRef(a),pulse:e_(s)})),e_(i)}function uk(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!J_[e.op]&&E("Multiple domain scales can not be sorted using "+e.op):E("No field provided for sort aggregate op: "+e.op):N(e)?e.field="key":e={field:"key"}),e}function ok(e,t,n){var r=n.map((function(e){var n=t.getData(e.data);return n||ek(e.data),n.domainRef(t,e.field)}));return e_(t.add(T_({values:r})))}function sk(e,t,n){var r=n.map((function(e){var n=t.getData(e.data);return n||ek(e.data),n.extentRef(t,e.field)}));return e_(t.add(q_({extents:r})))}function lk(e,t,n){var r=t.config.range,i=e.range;if(i.signal)return t.signalRef(i.signal);if(Re(i)){if(r&&ke(r,i))return lk(e=ye({},e,{range:r[i]}),t,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=lo(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:E("Unrecognized scale range value: "+Ue(i))}else{if(i.scheme)return n.scheme=L(i.scheme)?Z_(i.scheme,t):K_(i.scheme,t),i.extent&&(n.schemeExtent=Z_(i.extent,t)),void(i.count&&(n.schemeCount=K_(i.count,t)));if(i.step)return void(n.rangeStep=K_(i.step,t));if(lo(e.type)&&!L(i))return tk(i,e,t);L(i)||E("Unsupported range type: "+Ue(i))}return i.map((function(e){return(L(e)?Z_:K_)(e,t)}))}function ck(e,t,n){return L(e)?e.map((function(e){return ck(e,t,n)})):N(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:E("Unsupported parameter object: "+Ue(e)):e}var fk="top",dk="left",hk="right",pk="bottom",mk="center",vk="index",gk="label",yk="perc",bk="value",xk="guide-label",_k="guide-title",kk="group-title",Ak="group-subtitle",wk="symbol",Dk="gradient",Ek="discrete",Ck="size",Fk=[Ck,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],Mk={name:1,style:1,interactive:1},Sk={value:0},Bk={value:1},Ok="group",Rk="rect",zk="rule",qk="text";function Tk(e){return e.type=Ok,e.interactive=e.interactive||!1,e}function Lk(e,t){var n=function(n,r){return l_(e[n],l_(t[n],r))};return n.isVertical=function(n){return"vertical"===l_(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection))},n.gradientLength=function(){return l_(e.gradientLength,t.gradientLength||t.gradientWidth)},n.gradientThickness=function(){return l_(e.gradientThickness,t.gradientThickness||t.gradientHeight)},n.entryColumns=function(){return l_(e.columns,l_(t.columns,+n.isVertical(!0)))},n}function Nk(e,t){var n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function Pk(e,t,n){return"item.anchor === '".concat("start","' ? ").concat(e," : item.anchor === '").concat("end","' ? ").concat(t," : ").concat(n)}var jk=Pk(Ue(dk),Ue(hk),Ue(mk));function Uk(e,t){return t?e?N(e)?Object.assign({},e,{offset:Uk(e.offset,t)}):{value:e,offset:t}:t:e}function Ik(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Sx(e.encode,t,Mk)):e.interactive=!1,e}function $k(e,t,n,r){var i,a,u,o,s,l=Lk(e,n),c=l.isVertical(),f=l.gradientThickness(),d=l.gradientLength();c?(a=[0,1],u=[0,0],o=f,s=d):(a=[0,0],u=[1,0],o=d,s=f);var h={enter:i={opacity:Sk,x:Sk,y:Sk,width:Cx(o),height:Cx(s)},update:ye({},i,{opacity:Bk,fill:{gradient:t,start:a,stop:u}}),exit:{opacity:Sk}};return Mx(h,{stroke:l("gradientStrokeColor"),strokeWidth:l("gradientStrokeWidth")},{opacity:l("gradientOpacity")}),Ik({type:Rk,role:"legend-gradient",encode:h},r)}function Wk(e,t,n,r,i){var a,u,o,s,l=Lk(e,n),c=l.isVertical(),f=l.gradientThickness(),d=l.gradientLength(),h="";c?(a="y",o="y2",u="x",s="width",h="1-"):(a="x",o="x2",u="y",s="height");var p={opacity:Sk,fill:{scale:t,field:bk}};p[a]={signal:h+"datum."+yk,mult:d},p[u]=Sk,p[o]={signal:h+"datum.perc2",mult:d},p[s]=Cx(f);var m={enter:p,update:ye({},p,{opacity:Bk}),exit:{opacity:Sk}};return Mx(m,{stroke:l("gradientStrokeColor"),strokeWidth:l("gradientStrokeWidth")},{opacity:l("gradientOpacity")}),Ik({type:Rk,role:"legend-band",key:bk,from:i,encode:m},r)}var Gk="datum.".concat(yk,'<=0?"').concat(dk,'":datum.').concat(yk,'>=1?"').concat(hk,'":"').concat(mk,'"'),Hk="datum.".concat(yk,'<=0?"').concat(pk,'":datum.').concat(yk,'>=1?"').concat(fk,'":"').concat("middle",'"');function Vk(e,t,n,r){var i,a,u,o,s=Lk(e,t),l=s.isVertical(),c=Cx(s.gradientThickness()),f=s.gradientLength(),d=s("labelOverlap"),h="",p={enter:i={opacity:Sk},update:a={opacity:Bk,text:{field:gk}},exit:{opacity:Sk}};return Mx(p,{fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:l_(e.labelLimit,t.gradientLabelLimit)}),l?(i.align={value:"left"},i.baseline=a.baseline={signal:Hk},u="y",o="x",h="1-"):(i.align=a.align={signal:Gk},i.baseline={value:"top"},u="x",o="y"),i[u]=a[u]={signal:h+"datum."+yk,mult:f},i[o]=a[o]=c,c.offset=l_(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:s("labelSeparation"),method:d,order:"datum.index"}:void 0,Ik({type:qk,role:qx,style:xk,key:bk,from:r,encode:p,overlap:d},n)}function Yk(e,t,n,r,i){var a,u,o,s,l,c=Lk(e,t),f=n.entries,d=!(!f||!f.interactive),h=f?f.name:void 0,p=c("clipHeight"),m=c("symbolOffset"),v={data:"value"},g="(".concat(i,") ? datum.").concat("offset"," : datum.").concat(Ck),y=p?Cx(p):{field:Ck},b="datum.".concat(vk),x="max(1, ".concat(i,")");y.mult=.5,a={enter:u={opacity:Sk,x:{signal:g,mult:.5,offset:m},y:y},update:o={opacity:Bk,x:u.x,y:u.y},exit:{opacity:Sk}};var _=null,k=null;e.fill||(_=t.symbolBaseFillColor,k=t.symbolBaseStrokeColor),Mx(a,{fill:c("symbolFillColor",_),shape:c("symbolType"),size:c("symbolSize"),stroke:c("symbolStrokeColor",k),strokeDash:c("symbolDash"),strokeDashOffset:c("symbolDashOffset"),strokeWidth:c("symbolStrokeWidth")},{opacity:c("symbolOpacity")}),Fk.forEach((function(t){e[t]&&(o[t]=u[t]={scale:e[t],field:bk})}));var A=Ik({type:"symbol",role:"legend-symbol",key:bk,from:v,clip:!!p||void 0,encode:a},n.symbols),w=Cx(m);w.offset=c("labelOffset"),Mx(a={enter:u={opacity:Sk,x:{signal:g,offset:w},y:y},update:o={opacity:Bk,text:{field:gk},x:u.x,y:u.y},exit:{opacity:Sk}},{align:c("labelAlign"),baseline:c("labelBaseline"),fill:c("labelColor"),fillOpacity:c("labelOpacity"),font:c("labelFont"),fontSize:c("labelFontSize"),fontStyle:c("labelFontStyle"),fontWeight:c("labelFontWeight"),limit:c("labelLimit")});var D=Ik({type:qk,role:qx,style:xk,key:bk,from:v,encode:a},n.labels);return a={enter:{noBound:{value:!p},width:Sk,height:p?Cx(p):Sk,opacity:Sk},exit:{opacity:Sk},update:o={opacity:Bk,row:{signal:null},column:{signal:null}}},c.isVertical(!0)?(s="ceil(item.mark.items.length / ".concat(x,")"),o.row.signal="".concat(b,"%").concat(s),o.column.signal="floor(".concat(b," / ").concat(s,")"),l={field:["row",b]}):(o.row.signal="floor(".concat(b," / ").concat(x,")"),o.column.signal="".concat(b," % ").concat(x),l={field:b}),o.column.signal="(".concat(i,")?").concat(o.column.signal,":").concat(b),Tk({role:zx,from:r={facet:{data:r,name:"value",groupby:vk}},encode:Sx(a,f,Mk),marks:[A,D],name:h,interactive:d,sort:l})}var Xk='item.orient === "left"',Jk='item.orient === "right"',Qk="(".concat(Xk," || ").concat(Jk,")"),Kk="datum.vgrad && ".concat(Qk),Zk=Pk('"top"','"bottom"','"middle"'),eA=Pk('"right"','"left"','"center"'),tA="datum.vgrad && ".concat(Jk," ? (").concat(eA,") : (").concat(Qk," && !(datum.vgrad && ").concat(Xk,')) ? "left" : ').concat(jk),nA="item._anchor || (".concat(Qk,' ? "middle" : "start")'),rA="".concat(Kk," ? (").concat(Xk," ? -90 : 90) : 0"),iA="".concat(Qk," ? (datum.vgrad ? (").concat(Jk,' ? "bottom" : "top") : ').concat(Zk,') : "top"');function aA(e,t){var n;return N(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+uA(e.path)+")":e.sphere&&(n="geoShape("+uA(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function uA(e){return N(e)&&e.signal?e.signal:Ue(e)}function oA(e){var t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")&&t.indexOf("title")?e.type===Ok?zx:t||Ox:t}function sA(e){return{marktype:e.type,name:e.name||void 0,role:e.role||oA(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function lA(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function cA(e,t){var n=ui(e.type);n||E("Unrecognized transform type: "+Ue(e.type));var r=Kx(n.type.toLowerCase(),null,fA(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function fA(e,t,n){for(var r={},i=e.params.length,a=0;a0?",":"")+(N(i)?i.signal||hw(i):Ue(i))}return n+"]"}function mw(e){var t,n,r="{",i=0;for(t in e)n=e[t],r+=(++i>1?",":"")+Ue(t)+":"+(N(n)?n.signal||hw(n):Ue(n));return r+"}"}fw.prototype=dw.prototype={parse:function(e){return sw(e,this)},fork:function(){return new dw(this)},isSubscope:function(){return this._subid>0},toRuntime:function(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id:function(){return(this._subid?this._subid+":":0)+this._id++},add:function(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach((function(t){t.$ref=e.id})),e.refs=null),e},proxy:function(e){var t=e instanceof Qx?e_(e):e;return this.add(U_({value:t}))},addStream:function(e){return this.streams.push(e),e.id=this.id(),e},addUpdate:function(e){return this.updates.push(e),e},finish:function(){var e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){var r;e&&((r=e.data||(e.data={}))[t]||(r[t]=[])).push(n)}for(e in this.data)for(var r in n((t=this.data[e]).input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values"),t.index)n(t.index[r],e,"index:"+r);return this},pushState:function(e,t,n){this._encode.push(e_(this.add(G_({pulse:e})))),this._parent.push(t),this._lookup.push(n?e_(this.proxy(n)):null),this._markpath.push(-1)},popState:function(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent:function(){return $(this._parent)},encode:function(){return $(this._encode)},lookup:function(){return $(this._lookup)},markpath:function(){var e=this._markpath;return++e[e.length-1]},fieldRef:function(e,t){if(Re(e))return t_(e,t);e.signal||E("Unsupported field reference: "+Ue(e));var n=e.signal,r=this.field[n];if(!r){var i={name:this.signalRef(n)};t&&(i.as=t),this.field[n]=r=e_(this.add(S_(i)))}return r},compareRef:function(e){var t=this,n=!1,r=function(e){return o_(e)?(n=!0,t.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(n=!0,t.exprRef(e.expr)):e},i=se(e.field).map(r),a=se(e.order).map(r);return n?e_(this.add(D_({fields:i,orders:a}))):r_(i,a)},keyRef:function(e,t){var n=!1,r=this.signals;return e=se(e).map((function(e){return o_(e)?(n=!0,e_(r[e.signal])):e})),n?e_(this.add(B_({fields:e,flat:t}))):function(e,t){var n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef:function(e){if(!e)return e;var t=i_(e.op,e.field),n=e.order||"ascending";return n.signal?e_(this.add(D_({fields:t,orders:this.signalRef(n.signal)}))):r_(t,n)},event:function(e,t){var n=e+":"+t;if(!this.events[n]){var r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal:function(e){return ke(this.signals,e)},addSignal:function(e,t){this.hasOwnSignal(e)&&E("Duplicate signal name: "+Ue(e));var n=t instanceof Qx?t:this.add(Zx(t));return this.signals[e]=n},getSignal:function(e){return this.signals[e]||E("Unrecognized signal name: "+Ue(e)),this.signals[e]},signalRef:function(e){return this.signals[e]?e_(this.signals[e]):(ke(this.lambdas,e)||(this.lambdas[e]=this.add(Zx(null))),e_(this.lambdas[e]))},parseLambdas:function(){for(var e=Object.keys(this.lambdas),t=0,n=e.length;t=r&&e=i?1:(t-r+1)/a},icdf:function(e){return e>=0&&e<=1?r-1+Math.floor(e*a):NaN}};return u.min(t).max(n)},e.randomKDE=wi,e.randomLCG=function(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}},e.randomLogNormal=Mi,e.randomMixture=Si,e.randomNormal=Ai,e.randomUniform=qi,e.read=dr,e.regressionExp=Ii,e.regressionLinear=ji,e.regressionLoess=Vi,e.regressionLog=Ui,e.regressionPoly=Gi,e.regressionPow=$i,e.regressionQuad=Wi,e.renderModule=_d,e.repeat=Ne,e.resetDefaultLocale=function(){return Cn(),On(),Ln()},e.resetSVGClipId=Ws,e.resetSVGDefIds=function(){Ws(),Go=0},e.responseType=fr,e.runtimeContext=db,e.sampleCurve=Qi,e.sampleLogNormal=Di,e.sampleNormal=bi,e.sampleUniform=Bi,e.scale=ao,e.sceneEqual=Fd,e.sceneFromJSON=Xc,e.scenePickVisit=Nl,e.sceneToJSON=Yc,e.sceneVisit=Ll,e.sceneZOrder=Tl,e.scheme=wo,e.serializeXML=Xf,e.setRandom=function(t){e.random=t},e.span=je,e.splitAccessPath=C,e.stringValue=Ue,e.textMetrics=Ac,e.timeBin=wn,e.timeFloor=Vt,e.timeFormatLocale=zn,e.timeInterval=Zt,e.timeOffset=nn,e.timeSequence=un,e.timeUnitSpecifier=Ft,e.timeUnits=Et,e.toBoolean=Ie,e.toDate=Qe,e.toNumber=W,e.toSet=Ze,e.toString=Ke,e.transform=oi,e.transforms=ai,e.truncate=et,e.truthy=R,e.tupleid=xr,e.typeParsers=Zn,e.utcFloor=Jt,e.utcInterval=en,e.utcOffset=rn,e.utcSequence=on,e.utcdayofyear=Lt,e.utcquarter=oe,e.utcweek=Nt,e.version="5.22.1",e.visitArray=tt,e.week=Ot,e.writeConfig=U,e.zero=B,e.zoomLinear=ne,e.zoomLog=re,e.zoomPow=ie,e.zoomSymlog=ae,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=vega-core.min.js.map