From ca6842ab760ebfa714fa4449343a78c21cee885e Mon Sep 17 00:00:00 2001 From: TJ Banghart Date: Sat, 25 Sep 2021 16:02:44 -0700 Subject: [PATCH] Remove options issue --- histogram.js | 12 ++++++------ src/common/options.js | 18 ++++-------------- src/histogram.js | 1 + 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/histogram.js b/histogram.js index 65c7e95..eacbaac 100644 --- a/histogram.js +++ b/histogram.js @@ -1,23 +1,23 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.histogram=t():e.histogram=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=99)}([function(e,t,n){"use strict";function r(e,t,n){return e.fields=t||[],e.fname=n,e}function i(e){return null==e?null:e.fname}function o(e){return null==e?null:e.fields}function a(e){return 1===e.length?s(e[0]):u(e)}n.d(t,"a",(function(){return w})),n.d(t,"b",(function(){return x})),n.d(t,"c",(function(){return O})),n.d(t,"d",(function(){return v})),n.d(t,"e",(function(){return _})),n.d(t,"f",(function(){return r})),n.d(t,"g",(function(){return o})),n.d(t,"h",(function(){return i})),n.d(t,"i",(function(){return J})),n.d(t,"j",(function(){return ee})),n.d(t,"k",(function(){return K})),n.d(t,"l",(function(){return Q})),n.d(t,"m",(function(){return ie})),n.d(t,"n",(function(){return oe})),n.d(t,"o",(function(){return l})),n.d(t,"p",(function(){return ae})),n.d(t,"q",(function(){return se})),n.d(t,"r",(function(){return ue})),n.d(t,"s",(function(){return b})),n.d(t,"t",(function(){return de})),n.d(t,"u",(function(){return f})),n.d(t,"v",(function(){return he})),n.d(t,"w",(function(){return ce})),n.d(t,"x",(function(){return d})),n.d(t,"y",(function(){return h})),n.d(t,"z",(function(){return pe})),n.d(t,"A",(function(){return ge})),n.d(t,"B",(function(){return k})),n.d(t,"C",(function(){return me})),n.d(t,"D",(function(){return be})),n.d(t,"E",(function(){return Z})),n.d(t,"F",(function(){return ye})),n.d(t,"G",(function(){return E})),n.d(t,"H",(function(){return ve})),n.d(t,"I",(function(){return xe})),n.d(t,"J",(function(){return _e})),n.d(t,"K",(function(){return Oe})),n.d(t,"L",(function(){return j})),n.d(t,"M",(function(){return we})),n.d(t,"N",(function(){return je})),n.d(t,"O",(function(){return D})),n.d(t,"P",(function(){return g})),n.d(t,"Q",(function(){return Ee})),n.d(t,"R",(function(){return B})),n.d(t,"S",(function(){return L})),n.d(t,"T",(function(){return I})),n.d(t,"U",(function(){return U})),n.d(t,"V",(function(){return C})),n.d(t,"W",(function(){return V})),n.d(t,"X",(function(){return ke})),n.d(t,"Y",(function(){return Ae})),n.d(t,"Z",(function(){return c})),n.d(t,"ab",(function(){return De})),n.d(t,"bb",(function(){return Me})),n.d(t,"cb",(function(){return Ce})),n.d(t,"db",(function(){return F})),n.d(t,"eb",(function(){return ze})),n.d(t,"fb",(function(){return Fe})),n.d(t,"gb",(function(){return Te})),n.d(t,"hb",(function(){return m})),n.d(t,"ib",(function(){return X})),n.d(t,"jb",(function(){return $e})),n.d(t,"kb",(function(){return M})),n.d(t,"lb",(function(){return p})),n.d(t,"mb",(function(){return W})),n.d(t,"nb",(function(){return Y})),n.d(t,"ob",(function(){return H})),n.d(t,"pb",(function(){return G}));const s=e=>function(t){return t[e]},u=e=>{const t=e.length;return function(n){for(let r=0;rr&&c(),s=r=i+1):"]"===o&&(s||l("Access path missing open bracket: "+e),s>0&&c(),s=0,r=i+1):i>r?c():r=i+1}return s&&l("Access path missing closing bracket: "+e),a&&l("Access path missing closing quote: "+e),i>r&&(i++,c()),t}function f(e,t,n){const i=c(e);return e=1===i.length?i[0]:e,r((n&&n.get||a)(i),[e],t||e)}const d=f("id"),h=r(e=>e,[],"identity"),p=r(()=>0,[],"zero"),g=r(()=>1,[],"one"),m=r(()=>!0,[],"true"),b=r(()=>!1,[],"false");function y(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}const v=0,x=1,_=2,O=3,w=4;function j(e,t){let n=e||v;return{level(e){return arguments.length?(n=+e,this):n},error(){return n>=x&&y(t||"error","ERROR",arguments),this},warn(){return n>=_&&y(t||"warn","WARN",arguments),this},info(){return n>=O&&y(t||"log","INFO",arguments),this},debug(){return n>=w&&y(t||"log","DEBUG",arguments),this}}}var k=Array.isArray;function E(e){return e===Object(e)}const A=e=>"__proto__"!==e;function D(...e){return e.reduce((e,t)=>{for(const n in t)if("signals"===n)e.signals=S(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;M(e,n,t[n],r)}return e},{})}function M(e,t,n,r){if(!A(t))return;let i,o;if(E(n)&&!k(n))for(i in o=E(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?M(o,i,n[i]):A(i)&&(o[i]=n[i]);else e[t]=n}function S(e,t){if(null==e)return t;const n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}function C(e){return e[e.length-1]}function F(e){return null==e||""===e?null:+e}const z=e=>t=>e*Math.exp(t),T=e=>t=>Math.log(e*t),$=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),N=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,R=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function P(e,t,n,r){const i=n(e[0]),o=n(C(e)),a=(o-i)*t;return[r(i-a),r(o-a)]}function B(e,t){return P(e,t,F,h)}function L(e,t){var n=Math.sign(e[0]);return P(e,t,T(n),z(n))}function I(e,t,n){return P(e,t,R(n),R(1/n))}function U(e,t,n){return P(e,t,$(n),N(n))}function q(e,t,n,r,i){const o=r(e[0]),a=r(C(e)),s=null!=t?r(t):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function W(e,t,n){return q(e,t,n,F,h)}function Y(e,t,n){const r=Math.sign(e[0]);return q(e,t,n,T(r),z(r))}function H(e,t,n,r){return q(e,t,n,R(r),R(1/r))}function G(e,t,n,r){return q(e,t,n,$(r),N(r))}function V(e){return 1+~~(new Date(e).getMonth()/3)}function X(e){return 1+~~(new Date(e).getUTCMonth()/3)}function J(e){return null!=e?k(e)?e:[e]:[]}function K(e,t,n){let r,i=e[0],o=e[1];return o=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-r),i+r]}function Z(e){return"function"==typeof e}function Q(e,t,n){n=n||{},t=J(t)||[];const i=[],a=[],s={},u=n.comparator||te;return J(e).forEach((e,r)=>{null!=e&&(i.push("descending"===t[r]?-1:1),a.push(e=Z(e)?e:f(e,null,n)),(o(e)||[]).forEach(e=>s[e]=1))}),0===a.length?null:r(u(a,i),Object.keys(s))}const ee=(e,t)=>(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),te=(e,t)=>1===e.length?ne(e[0],t[0]):re(e,t,e.length),ne=(e,t)=>function(n,r){return ee(e(n),e(r))*t},re=(e,t,n)=>(t.push(0),function(r,i){let o,a=0,s=-1;for(;0===a&&++se}function oe(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(t(r),n=null),e)}}function ae(e){for(let t,n,r=1,i=arguments.length;ro&&(o=r))}else{for(r=t(e[a]);ao&&(o=r))}return[i,o]}function ue(e,t){const n=e.length;let r,i,o,a,s,u=-1;if(null==t){for(;++u=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),o=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),or(e)?n[e]:void 0,set(e,t){return r(e)||(++i.size,n[e]===fe&&--i.empty),n[e]=t,this},delete(e){return r(e)&&(--i.size,++i.empty,n[e]=fe),this},clear(){i.size=i.empty=0,i.object=n={}},test(e){return arguments.length?(t=e,i):t},clean(){const e={};let r=0;for(const i in n){const o=n[i];o===fe||t&&t(o)||(e[i]=o,++r)}i.size=r,i.empty=0,i.object=n=e}};return e&&Object.keys(e).forEach(t=>{i.set(t,e[t])}),i}function he(e,t,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,u=e[0],l=C(e);la&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=e:oe.replace(/\\(.)/g,"$1")):J(e));const i=e&&e.length,o=n&&n.get||a,s=e=>o(t?[e]:c(e));let u;if(i)if(1===i){const t=s(e[0]);u=function(e){return""+t(e)}}else{const t=e.map(s);u=function(e){let n=""+t[0](e),r=0;for(;++r{t={},n={},r=0},o=(i,o)=>(++r>e&&(n=t,t={},r=1),t[i]=o);return i(),{clear:i,has:e=>ce(t,e)||ce(n,e),get:e=>ce(t,e)?t[e]:ce(n,e)?o(e,n[e]):void 0,set:(e,n)=>ce(t,e)?t[e]=n:o(e,n)}}function je(e,t,n,r){const i=t.length,o=n.length;if(!o)return t;if(!i)return n;const a=r||new t.constructor(i+o);let s=0,u=0,l=0;for(;s0?n[u++]:t[s++];for(;s=0;)n+=e;return n}function Ee(e,t,n,r){const i=n||" ",o=e+"",a=t-o.length;return a<=0?o:"left"===r?ke(i,a)+o:"center"===r?ke(i,~~(a/2))+o+ke(i,Math.ceil(a/2)):o+ke(i,a)}function Ae(e){return e&&C(e)-e[0]||0}function De(e){return k(e)?"["+e.map(De)+"]":E(e)||xe(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Me(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e}const Se=e=>ye(e)||be(e)?e:Date.parse(e);function Ce(e,t){return t=t||Se,null==e||""===e?null:t(e)}function Fe(e){return null==e||""===e?null:e+""}function ze(e){const t={},n=e.length;for(let r=0;r(e[t]=1+n,e),{});function z(e){const t=Object(r.i)(e).slice(),n={};t.length||Object(r.o)("Missing time unit."),t.forEach(e=>{Object(r.w)(F,e)?n[e]=1:Object(r.o)("Invalid time unit: ".concat(e,"."))});return(n[w]||n[k]?1:0)+(n[_]||n[O]||n[j]?1:0)+(n[E]?1:0)>1&&Object(r.o)("Incompatible time units: ".concat(e)),t.sort((e,t)=>F[e]-F[t]),t}const T={[x]:"%Y ",[_]:"Q%q ",[O]:"%b ",[j]:"%d ",[w]:"W%U ",[k]:"%a ",[E]:"%j ",[A]:"%H:00",[D]:"00:%M",[M]:":%S",[S]:".%L",["".concat(x,"-").concat(O)]:"%Y-%m ",["".concat(x,"-").concat(O,"-").concat(j)]:"%Y-%m-%d ",["".concat(A,"-").concat(D)]:"%H:%M"};function $(e,t){const n=Object(r.p)({},T,t),i=z(e),o=i.length;let a,s,u="",l=0;for(l=0;ll;--a)if(s=i.slice(l,a).join("-"),null!=n[s]){u+=n[s],l=a;break}return u.trim()}const N=new Date;function R(e){return N.setFullYear(e),N.setMonth(0),N.setDate(1),N.setHours(0,0,0,0),N}function P(e){return L(new Date(e))}function B(e){return I(new Date(e))}function L(e){return i.a.count(R(e.getFullYear())-1,e)}function I(e){return o.b.count(R(e.getFullYear())-1,e)}function U(e){return R(e).getDay()}function q(e,t,n,r,i,o,a){if(0<=e&&e<100){const s=new Date(-1,t,n,r,i,o,a);return s.setFullYear(e),s}return new Date(e,t,n,r,i,o,a)}function W(e){return H(new Date(e))}function Y(e){return G(new Date(e))}function H(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return a.a.count(t-1,e)}function G(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return s.b.count(t-1,e)}function V(e){return N.setTime(Date.UTC(e,0,1)),N.getUTCDay()}function X(e,t,n,r,i,o,a){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,r,i,o,a));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,r,i,o,a))}function J(e,t,n,i,o){const a=t||1,s=Object(r.V)(e),u=(e,t,r)=>function(e,t,n,r){const i=n<=1?e:r?(t,i)=>r+n*Math.floor((e(t,i)-r)/n):(t,r)=>n*Math.floor(e(t,r)/n);return t?(e,n)=>t(i(e,n),n):i}(n[r=r||e],i[r],e===s&&a,t),l=new Date,c=Object(r.eb)(e),f=c[x]?u(x):Object(r.m)(2012),d=c[O]?u(O):c[_]?u(_):r.lb,h=c[w]&&c[k]?u(k,1,w+k):c[w]?u(w,1):c[k]?u(k,1):c[j]?u(j,1):c[E]?u(E,1):r.P,p=c[A]?u(A):r.lb,g=c[D]?u(D):r.lb,m=c[M]?u(M):r.lb,b=c[S]?u(S):r.lb;return function(e){l.setTime(+e);const t=f(l);return o(t,d(l),h(l,t),p(l),g(l),m(l),b(l))}}function K(e,t,n){return t+7*e-(n+6)%7}const Z={[x]:e=>e.getFullYear(),[_]:e=>Math.floor(e.getMonth()/3),[O]:e=>e.getMonth(),[j]:e=>e.getDate(),[A]:e=>e.getHours(),[D]:e=>e.getMinutes(),[M]:e=>e.getSeconds(),[S]:e=>e.getMilliseconds(),[E]:e=>L(e),[w]:e=>I(e),[w+k]:(e,t)=>K(I(e),e.getDay(),U(t)),[k]:(e,t)=>K(1,e.getDay(),U(t))},Q={[_]:e=>3*e,[w]:(e,t)=>K(e,0,U(t))};function ee(e,t){return J(e,t||1,Z,Q,q)}const te={[x]:e=>e.getUTCFullYear(),[_]:e=>Math.floor(e.getUTCMonth()/3),[O]:e=>e.getUTCMonth(),[j]:e=>e.getUTCDate(),[A]:e=>e.getUTCHours(),[D]:e=>e.getUTCMinutes(),[M]:e=>e.getUTCSeconds(),[S]:e=>e.getUTCMilliseconds(),[E]:e=>H(e),[w]:e=>G(e),[k]:(e,t)=>K(1,e.getUTCDay(),V(t)),[w+k]:(e,t)=>K(G(e),e.getUTCDay(),V(t))},ne={[_]:e=>3*e,[w]:(e,t)=>K(e,0,V(t))};function re(e,t){return J(e,t||1,te,ne,X)}const ie={[x]:u.a,[_]:l.a.every(3),[O]:l.a,[w]:o.b,[j]:i.a,[k]:i.a,[E]:i.a,[A]:c.a,[D]:f.a,[M]:d.a,[S]:h.a},oe={[x]:p.a,[_]:g.a.every(3),[O]:g.a,[w]:s.b,[j]:a.a,[k]:a.a,[E]:a.a,[A]:m.a,[D]:b.a,[M]:d.a,[S]:h.a};function ae(e){return ie[e]}function se(e){return oe[e]}function ue(e,t,n){return e?e.offset(t,n):void 0}function le(e,t,n){return ue(ae(e),t,n)}function ce(e,t,n){return ue(se(e),t,n)}function fe(e,t,n,r){return e?e.range(t,n,r):void 0}function de(e,t,n,r){return fe(ae(e),t,n,r)}function he(e,t,n,r){return fe(se(e),t,n,r)}const pe=[x,O,j,A,D,M,S],ge=pe.slice(0,-1),me=ge.slice(0,-1),be=me.slice(0,-1),ye=be.slice(0,-1),ve=[x,O],xe=[x],_e=[[ge,1,1e3],[ge,5,5e3],[ge,15,15e3],[ge,30,3e4],[me,1,6e4],[me,5,3e5],[me,15,9e5],[me,30,18e5],[be,1,36e5],[be,3,108e5],[be,6,216e5],[be,12,432e5],[ye,1,864e5],[[x,w],1,6048e5],[ve,1,2592e6],[ve,3,7776e6],[xe,1,31536e6]];function Oe(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Object(r.Y)(t))/n;let o,a,s=Object(y.a)(e=>e[2]).right(_e,i);return s===_e.length?(o=xe,a=Object(v.c)(t[0]/31536e6,t[1]/31536e6,n)):s?(s=_e[i/_e[s-1][2]<_e[s][2]/i?s-1:s],o=s[0],a=s[1]):(o=pe,a=Math.max(Object(v.c)(t[0],t[1],n),1)),{units:o,step:a}}},function(e,t,n){"use strict";function r(){}n.d(t,"a",(function(){return pe})),n.d(t,"b",(function(){return ge}));var i=function(e){return null==e?r:function(){return this.querySelector(e)}},o=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)};function a(){return[]}function s(e){return function(t){return t.matches(e)}}var u=Array.prototype.find;function l(){return this.firstElementChild}var c=Array.prototype.filter;function f(){return this.children}var d=function(e){return new Array(e.length)};function h(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}h.prototype={constructor:h,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var p=function(e){return function(){return e}};function g(e,t,n,r,i,o){for(var a,s=0,u=t.length,l=o.length;st?1:e>=t?0:NaN}var v="http://www.w3.org/1999/xhtml",x={svg:"http://www.w3.org/2000/svg",xhtml:v,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},_=function(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),x.hasOwnProperty(t)?{space:x[t],local:e}:e};function O(e){return function(){this.removeAttribute(e)}}function w(e){return function(){this.removeAttributeNS(e.space,e.local)}}function j(e,t){return function(){this.setAttribute(e,t)}}function k(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function E(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function A(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}var D=function(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView};function M(e){return function(){this.style.removeProperty(e)}}function S(e,t,n){return function(){this.style.setProperty(e,t,n)}}function C(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function F(e,t){return e.style.getPropertyValue(t)||D(e).getComputedStyle(e,null).getPropertyValue(t)}function z(e){return function(){delete this[e]}}function T(e,t){return function(){this[e]=t}}function $(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function N(e){return e.trim().split(/^|\s+/)}function R(e){return e.classList||new P(e)}function P(e){this._node=e,this._names=N(e.getAttribute("class")||"")}function B(e,t){for(var n=R(e),r=-1,i=t.length;++r=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function W(){this.textContent=""}function Y(e){return function(){this.textContent=e}}function H(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function G(){this.innerHTML=""}function V(e){return function(){this.innerHTML=e}}function X(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function J(){this.nextSibling&&this.parentNode.appendChild(this)}function K(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Z(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===v&&t.documentElement.namespaceURI===v?t.createElement(e):t.createElementNS(n,e)}}function Q(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}var ee=function(e){var t=_(e);return(t.local?Q:Z)(t)};function te(){return null}function ne(){var e=this.parentNode;e&&e.removeChild(this)}function re(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ie(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function oe(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}function ae(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,o=t.length;r=E&&(E=k+1);!(j=_[E])&&++E=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=y);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==t?M:"function"==typeof t?C:S)(e,t,null==n?"":n)):F(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?z:"function"==typeof t?$:T)(e,t)):this.node()[e]},classed:function(e,t){var n=N(e+"");if(arguments.length<2){for(var r=R(this.node()),i=-1,o=n.length;++i0))return a;do{a.push(o=new Date(+n)),t(n,i),e(n)}while(o=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(s.count=function(t,o){return r.setTime(+t),i.setTime(+o),e(r),e(i),Math.floor(n(r,i))},s.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?s.filter(a?function(t){return a(t)%e==0}:function(t){return s.count(0,t)%e==0}):s:null}),s}},function(e,t,n){"use strict";n.d(t,"d",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"e",(function(){return s}));var r=1e3,i=6e4,o=36e5,a=864e5,s=6048e5},,function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return FONT_TYPE})),__webpack_require__.d(__webpack_exports__,"c",(function(){return positionLegend})),__webpack_require__.d(__webpack_exports__,"b",(function(){return fixChartSizing})),__webpack_require__.d(__webpack_exports__,"e",(function(){return setAxisFormatting})),__webpack_require__.d(__webpack_exports__,"d",(function(){return runFormatting}));var _d3_loader__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(2),ssf__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7),ssf__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(ssf__WEBPACK_IMPORTED_MODULE_1__);const FONT_TYPE="'Roboto', 'Noto Sans JP', 'Noto Sans CJK KR', 'Noto Sans Arabic UI', 'Noto Sans Devanagari UI', 'Noto Sans Hebre', 'Noto Sans Thai UI', 'Helvetica', 'Arial', sans-serif";function parseTransform(e){return e.split("(")[1].split(")")[0].split(",")}function positionRefLine(e,t){let n=t.x_hist||t.y_hist?".BOUNDING_BOX_group":".mark-group.role-frame.root",r=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(n).select("path").node().getBBox(),i=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(`.refLine${e}_marks`).selectChildren(),o=parseTransform(i.attr("transform"));"x"===e?(o[1]=r.height,i.attr("y2",-1*r.height).attr("transform",`translate(${o[0]},${o[1]})`)):(o[0]=0,i.attr("x2",r.width).attr("transform",`translate(${o[0]},${o[1]})`))}function positionLegend(orientation){if("right"===orientation){let legends=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.b(".mark-group.role-legend")._groups[0],baseLegend=legends[legends.length-2],lastLegend=legends[legends.length-1],translate=parseTransform(_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(baseLegend).select("g").attr("transform")),offset=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(baseLegend).select("g").node().getBBox(),legendOffset=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(lastLegend).select("g").node().getBBox();_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(lastLegend).select("g").attr("transform",`translate(${translate[0]}, ${eval(translate[1])+offset.height+legendOffset.height})`)}}function fixChartSizing(){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a("svg").style("width","100%").style("height","100%").style("position","fixed").style("preserveAspectRatio","none").style("top",0).style("bottom",0).style("right",0).style("left",0)}function setAxisFormatting(e,t,n,r=null){if("simple"===t)_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a("g.mark-text.role-axis-label").selectAll("text").each((function(e,t){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(n,e.datum.value))}));else{let t=e.x_hist||e.y_hist?".BOUNDING_BOX_group":".mark-group.role-frame.root";_d3_loader__WEBPACK_IMPORTED_MODULE_0__.b(t).selectAll(".mark-text.role-axis-label").each((function(e,t){0==t&&_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).selectAll("text").each((function(e,t){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(n,e.datum.value))})),1==t&&_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).selectAll("text").each((function(e,t){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(r,e.datum.value))}))}))}}function formatPointLegend(e,t,n,r){let i,o=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.b(".mark-group.role-legend-entry");i=r||n?!r&&n&&t?o._groups[0][0]:!n&&t||n&&!t?o._groups[0][1]:n&&t?o._groups[0][2]:o._groups[0][0]:o._groups[0][0],_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(i).selectAll("text").each((function(t,n){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(e,t.datum.value))}))}function formatCrossfilterSelection(e,t,n){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(".SCATTERPLOT_marks").selectAll("path").attr("fill",(function(t){for(let r of e){let e=r.field.replace(".","_");return r.values.indexOf(String(t.datum[e]))>=0?n:"#DEE1E5"}}))}function runFormatting(e,t,n,r,i,o){e.crossfilterEnabled&&e.crossfilters.length&&t.layer_points&&formatCrossfilterSelection(e.crossfilters,n,t.color_col),setAxisFormatting(t,"scatter",r,i),t.size&&t.layer_points&&formatPointLegend(o,void 0!==n[1],t.heatmap_off,t.x_hist||t.y_hist),t.reference_line_x&&positionRefLine("x",t),t.reference_line_y&&positionRefLine("y",t)}},function(e,t,n){var r={};!function(e){function t(e){for(var t="",n=e.length-1;n>=0;)t+=e.charAt(n--);return t}function n(e,t){for(var n="";n.length=t?r:n("0",t-r.length)+r}function i(e,t){var r=""+e;return r.length>=t?r:n(" ",t-r.length)+r}function o(e,t){var r=""+e;return r.length>=t?r:r+n(" ",t-r.length)}e.version="0.11.2";var a=Math.pow(2,32);function s(e,t){return e>a||e<-a?function(e,t){var r=""+Math.round(e);return r.length>=t?r:n("0",t-r.length)+r}(e,t):function(e,t){var r=""+e;return r.length>=t?r:n("0",t-r.length)+r}(Math.round(e),t)}function u(e,t){return t=t||0,e.length>=7+t&&103==(32|e.charCodeAt(t))&&101==(32|e.charCodeAt(t+1))&&110==(32|e.charCodeAt(t+2))&&101==(32|e.charCodeAt(t+3))&&114==(32|e.charCodeAt(t+4))&&97==(32|e.charCodeAt(t+5))&&108==(32|e.charCodeAt(t+6))}var l=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],c=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function f(e){e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "'}var d={};f(d);var h=[],p=0;for(p=5;p<=8;++p)h[p]=32+p;for(p=23;p<=26;++p)h[p]=0;for(p=27;p<=31;++p)h[p]=14;for(p=50;p<=58;++p)h[p]=14;for(p=59;p<=62;++p)h[p]=p-58;for(p=67;p<=68;++p)h[p]=p-58;for(p=72;p<=75;++p)h[p]=p-58;for(p=67;p<=68;++p)h[p]=p-57;for(p=76;p<=78;++p)h[p]=p-56;for(p=79;p<=81;++p)h[p]=p-34;var g=[];function m(e,t,n){for(var r=e<0?-1:1,i=e*r,o=0,a=1,s=0,u=1,l=0,c=0,f=Math.floor(i);lt&&(l>t?(c=u,s=o):(c=l,s=a)),!n)return[0,r*s,c];var d=Math.floor(r*s/c);return[d,r*s-d*c,c]}function b(e,t,n){if(e>2958465||e<0)return null;var r=0|e,i=Math.floor(86400*(e-r)),o=0,a=[],s={D:r,T:i,u:86400*(e-r)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(s.u)<1e-6&&(s.u=0),t&&t.date1904&&(r+=1462),s.u>.9999&&(s.u=0,86400==++i&&(s.T=i=0,++r,++s.D)),60===r)a=n?[1317,10,29]:[1900,2,29],o=3;else if(0===r)a=n?[1317,8,29]:[1900,1,0],o=6;else{r>60&&--r;var u=new Date(1900,0,1);u.setDate(u.getDate()+r-1),a=[u.getFullYear(),u.getMonth()+1,u.getDate()],o=u.getDay(),r<60&&(o=(o+6)%7),n&&(o=function(e,t){t[0]-=581;var n=e.getDay();e<60&&(n=(n+6)%7);return n}(u,a))}return s.y=a[0],s.m=a[1],s.d=a[2],s.S=i%60,i=Math.floor(i/60),s.M=i%60,i=Math.floor(i/60),s.H=i,s.q=o,s}g[5]=g[63]='"$"#,##0_);\\("$"#,##0\\)',g[6]=g[64]='"$"#,##0_);[Red]\\("$"#,##0\\)',g[7]=g[65]='"$"#,##0.00_);\\("$"#,##0.00\\)',g[8]=g[66]='"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',g[41]='_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',g[42]='_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',g[43]='_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',g[44]='_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)',e.parse_date_code=b;var y=new Date(1899,11,31,0,0,0),v=y.getTime(),x=new Date(1900,2,1,0,0,0);function _(e,t){var n=e.getTime();return t?n-=1262304e5:e>=x&&(n+=864e5),(n-(v+6e4*(e.getTimezoneOffset()-y.getTimezoneOffset())))/864e5}e._general_int=function(e){return e.toString(10)};var O=function(){var e=/(?:\.0*|(\.\d*[1-9])0+)$/;function t(t){return-1==t.indexOf(".")?t:t.replace(e,"$1")}var n=/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,r=/(E[+-])(\d)$/;return function(e){var i,o=Math.floor(Math.log(Math.abs(e))*Math.LOG10E);return i=o>=-4&&o<=-1?e.toPrecision(10+o):Math.abs(o)<=9?function(e){var n=e<0?12:11,r=t(e.toFixed(12));return r.length<=n||(r=e.toPrecision(10)).length<=n?r:e.toExponential(5)}(e):10===o?e.toFixed(10).substr(0,12):function(e){var n=t(e.toFixed(11));return n.length>(e<0?12:11)||"0"===n||"-0"===n?e.toPrecision(6):n}(e),t(function(e){return-1==e.indexOf("E")?e:e.replace(n,"$1E").replace(r,"$10$2")}(i.toUpperCase()))}}();function w(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(0|e)===e?e.toString(10):O(e);case"undefined":return"";case"object":if(null==e)return"";if(e instanceof Date)return T(14,_(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}e._general_num=O,e._general=w;"๐๑๒๓๔๕๖๗๘๙".split("");function j(e,t,n,i){var o,a="",s=0,u=0,f=n.y,d=0;switch(e){case 98:f=n.y+543;case 121:switch(t.length){case 1:case 2:o=f%100,d=2;break;default:o=f%1e4,d=4}break;case 109:switch(t.length){case 1:case 2:o=n.m,d=t.length;break;case 3:return c[n.m-1][1];case 5:return c[n.m-1][0];default:return c[n.m-1][2]}break;case 100:switch(t.length){case 1:case 2:o=n.d,d=t.length;break;case 3:return l[n.q][0];default:return l[n.q][1]}break;case 104:switch(t.length){case 1:case 2:o=1+(n.H+11)%12,d=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:o=n.H,d=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:o=n.M,d=t.length;break;default:throw"bad minute format: "+t}break;case 115:if("s"!=t&&"ss"!=t&&".0"!=t&&".00"!=t&&".000"!=t)throw"bad second format: "+t;return 0!==n.u||"s"!=t&&"ss"!=t?(u=i>=2?3===i?1e3:100:1===i?10:1,(s=Math.round(u*(n.S+n.u)))>=60*u&&(s=0),"s"===t?0===s?"0":""+s/u:(a=r(s,2+i),"ss"===t?a.substr(0,2):"."+a.substr(2,t.length-1))):r(n.S,t.length);case 90:switch(t){case"[h]":case"[hh]":o=24*n.D+n.H;break;case"[m]":case"[mm]":o=60*(24*n.D+n.H)+n.M;break;case"[s]":case"[ss]":o=60*(60*(24*n.D+n.H)+n.M)+Math.round(n.S+n.u);break;default:throw"bad abstime format: "+t}d=3===t.length?1:2;break;case 101:o=f,d=1}return d>0?r(o,d):""}function k(e){if(e.length<=3)return e;for(var t=e.length%3,n=e.substr(0,t);t!=e.length;t+=3)n+=(n.length>0?",":"")+e.substr(t,3);return n}var E=function(){var e=/%/g;var a=/# (\?+)( ?)\/( ?)(\d+)/;var u=/^#*0*\.([0#]+)/,l=/\).*[0#]/,c=/\(###\) ###\\?-####/;function f(e){for(var t,n="",r=0;r!=e.length;++r)switch(t=e.charCodeAt(r)){case 35:break;case 63:n+=" ";break;case 48:n+="0";break;default:n+=String.fromCharCode(t)}return n}function d(e,t){var n=Math.pow(10,t);return""+Math.round(e*n)/n}function h(e,t){var n=e-Math.floor(e),r=Math.pow(10,t);return t<(""+Math.round(n*r)).length?0:Math.round(n*r)}function p(g,b,y){if(40===g.charCodeAt(0)&&!b.match(l)){var v=b.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return y>=0?p("n",v,y):"("+p("n",v,-y)+")"}if(44===b.charCodeAt(b.length-1))return function(e,t,n){for(var r=t.length-1;44===t.charCodeAt(r-1);)--r;return E(e,t.substr(0,r),n/Math.pow(10,3*(t.length-r)))}(g,b,y);if(-1!==b.indexOf("%"))return function(t,r,i){var o=r.replace(e,""),a=r.length-o.length;return E(t,o,i*Math.pow(10,2*a))+n("%",a)}(g,b,y);if(-1!==b.indexOf("E"))return function e(t,n){var r,i=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(0==n)return"0.0E+0";if(n<0)return"-"+e(t,-n);var o=t.indexOf(".");-1===o&&(o=t.indexOf("E"));var a=Math.floor(Math.log(n)*Math.LOG10E)%o;if(a<0&&(a+=o),-1===(r=(n/Math.pow(10,a)).toPrecision(i+1+(o+a)%o)).indexOf("e")){var s=Math.floor(Math.log(n)*Math.LOG10E);for(-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+a):r+="E+"+(s-a);"0."===r.substr(0,2);)r=(r=r.charAt(0)+r.substr(2,o)+"."+r.substr(2+o)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(e,t,n,r){return t+n+r.substr(0,(o+a)%o)+"."+r.substr(a)+"E"}))}else r=n.toExponential(i);return t.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),t.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}(b,y);if(36===b.charCodeAt(0))return"$"+p(g,b.substr(" "==b.charAt(1)?2:1),y);var x,_,O,w,j=Math.abs(y),A=y<0?"-":"";if(b.match(/^00+$/))return A+s(j,b.length);if(b.match(/^[#?]+$/))return"0"===(x=s(y,0))&&(x=""),x.length>b.length?x:f(b.substr(0,b.length-x.length))+x;if(_=b.match(a))return function(e,t,o){var a=parseInt(e[4],10),s=Math.round(t*a),u=Math.floor(s/a),l=s-u*a,c=a;return o+(0===u?"":""+u)+" "+(0===l?n(" ",e[1].length+1+e[4].length):i(l,e[1].length)+e[2]+"/"+e[3]+r(c,e[4].length))}(_,j,A);if(b.match(/^#+0+$/))return A+s(j,b.length-b.indexOf("0"));if(_=b.match(u))return x=d(y,_[1].length).replace(/^([^\.]+)$/,"$1."+f(_[1])).replace(/\.$/,"."+f(_[1])).replace(/\.(\d*)$/,(function(e,t){return"."+t+n("0",f(_[1]).length-t.length)})),-1!==b.indexOf("0.")?x:x.replace(/^0\./,".");if(b=b.replace(/^#+([0.])/,"$1"),_=b.match(/^(0*)\.(#*)$/))return A+d(j,_[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,_[1].length?"0.":".");if(_=b.match(/^#{1,3},##0(\.?)$/))return A+k(s(j,0));if(_=b.match(/^#,##0\.([#0]*0)$/))return y<0?"-"+p(g,b,-y):k(""+(Math.floor(y)+function(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}(y,_[1].length)))+"."+r(h(y,_[1].length),_[1].length);if(_=b.match(/^#,#*,#0/))return p(g,b.replace(/^#,#*,/,""),y);if(_=b.match(/^([0#]+)(\\?-([0#]+))+$/))return x=t(p(g,b.replace(/[\\-]/g,""),y)),O=0,t(t(b.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return O-2147483648?""+(e>=0?0|e:e-1|0):""+Math.floor(e)}(y)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(e){return"00,"+(e.length<3?r(0,3-e.length):"")+e}))+"."+r(O,_[1].length);switch(b){case"###,##0.00":return p(g,"#,##0.00",y);case"###,###":case"##,###":case"#,###":var C=k(s(j,0));return"0"!==C?A+C:"";case"###,###.00":return p(g,"###,##0.00",y).replace(/^0\./,".");case"#,###.00":return p(g,"#,##0.00",y).replace(/^0\./,".")}throw new Error("unsupported format |"+b+"|")}function g(s,d,h){if(40===s.charCodeAt(0)&&!d.match(l)){var p=d.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return h>=0?g("n",p,h):"("+g("n",p,-h)+")"}if(44===d.charCodeAt(d.length-1))return function(e,t,n){for(var r=t.length-1;44===t.charCodeAt(r-1);)--r;return E(e,t.substr(0,r),n/Math.pow(10,3*(t.length-r)))}(s,d,h);if(-1!==d.indexOf("%"))return function(t,r,i){var o=r.replace(e,""),a=r.length-o.length;return E(t,o,i*Math.pow(10,2*a))+n("%",a)}(s,d,h);if(-1!==d.indexOf("E"))return function e(t,n){var r,i=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(0==n)return"0.0E+0";if(n<0)return"-"+e(t,-n);var o=t.indexOf(".");-1===o&&(o=t.indexOf("E"));var a=Math.floor(Math.log(n)*Math.LOG10E)%o;if(a<0&&(a+=o),!(r=(n/Math.pow(10,a)).toPrecision(i+1+(o+a)%o)).match(/[Ee]/)){var s=Math.floor(Math.log(n)*Math.LOG10E);-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+a):r+="E+"+(s-a),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(e,t,n,r){return t+n+r.substr(0,(o+a)%o)+"."+r.substr(a)+"E"}))}else r=n.toExponential(i);return t.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),t.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}(d,h);if(36===d.charCodeAt(0))return"$"+g(s,d.substr(" "==d.charAt(1)?2:1),h);var b,y,v,x,_=Math.abs(h),O=h<0?"-":"";if(d.match(/^00+$/))return O+r(_,d.length);if(d.match(/^[#?]+$/))return b=""+h,0===h&&(b=""),b.length>d.length?b:f(d.substr(0,d.length-b.length))+b;if(y=d.match(a))return function(e,t,r){return r+(0===t?"":""+t)+n(" ",e[1].length+2+e[4].length)}(y,_,O);if(d.match(/^#+0+$/))return O+r(_,d.length-d.indexOf("0"));if(y=d.match(u))return b=(b=(""+h).replace(/^([^\.]+)$/,"$1."+f(y[1])).replace(/\.$/,"."+f(y[1]))).replace(/\.(\d*)$/,(function(e,t){return"."+t+n("0",f(y[1]).length-t.length)})),-1!==d.indexOf("0.")?b:b.replace(/^0\./,".");if(d=d.replace(/^#+([0.])/,"$1"),y=d.match(/^(0*)\.(#*)$/))return O+(""+_).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,y[1].length?"0.":".");if(y=d.match(/^#{1,3},##0(\.?)$/))return O+k(""+_);if(y=d.match(/^#,##0\.([#0]*0)$/))return h<0?"-"+g(s,d,-h):k(""+h)+"."+n("0",y[1].length);if(y=d.match(/^#,#*,#0/))return g(s,d.replace(/^#,#*,/,""),h);if(y=d.match(/^([0#]+)(\\?-([0#]+))+$/))return b=t(g(s,d.replace(/[\\-]/g,""),h)),v=0,t(t(d.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return v-1||"\\"==n&&"-"==e.charAt(t+1)&&"0#".indexOf(e.charAt(t+2))>-1););break;case"?":for(;e.charAt(++t)===n;);break;case"*":++t," "!=e.charAt(t)&&"*"!=e.charAt(t)||++t;break;case"(":case")":++t;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;t-1;);break;case" ":default:++t}return!1}function S(e,t,n,r){for(var i,o,a,s=[],l="",c=0,f="",d="t",h="H";c=12?"P":"A"),m.t="T",h="h",c+=3):"AM/PM"===e.substr(c,5).toUpperCase()?(null!=i&&(m.v=i.H>=12?"PM":"AM"),m.t="T",c+=5,h="h"):"上午/下午"===e.substr(c,5).toUpperCase()?(null!=i&&(m.v=i.H>=12?"下午":"上午"),m.t="T",c+=5,h="h"):(m.t="t",++c),null==i&&"T"===m.t)return"";s[s.length]=m,d=f;break;case"[":for(l=f;"]"!==e.charAt(c++)&&c-1&&(l=(l.match(/\$([^-\[\]]*)/)||[])[1]||"$",M(e)||(s[s.length]={t:"t",v:l}));break;case".":if(null!=i){for(l=f;++c-1;)l+=f;s[s.length]={t:"n",v:l};break;case"?":for(l=f;e.charAt(++c)===f;)l+=f;s[s.length]={t:f,v:l},d=f;break;case"*":++c," "!=e.charAt(c)&&"*"!=e.charAt(c)||++c;break;case"(":case")":s[s.length]={t:1===r?"t":f,v:f},++c;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(l=f;c-1;)l+=e.charAt(c);s[s.length]={t:"D",v:l};break;case" ":s[s.length]={t:f,v:f},++c;break;case"$":s[s.length]={t:"t",v:"$"},++c;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(f))throw new Error("unrecognized character "+f+" in "+e);s[s.length]={t:"t",v:f},++c}var y,v=0,x=0;for(c=s.length-1,d="t";c>=0;--c)switch(s[c].t){case"h":case"H":s[c].t=h,d="h",v<1&&(v=1);break;case"s":(y=s[c].v.match(/\.0+$/))&&(x=Math.max(x,y[0].length-1)),v<3&&(v=3);case"d":case"y":case"M":case"e":d=s[c].t;break;case"m":"s"===d&&(s[c].t="M",v<2&&(v=2));break;case"X":break;case"Z":v<1&&s[c].v.match(/[Hh]/)&&(v=1),v<2&&s[c].v.match(/[Mm]/)&&(v=2),v<3&&s[c].v.match(/[Ss]/)&&(v=3)}switch(v){case 0:break;case 1:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M),i.M>=60&&(i.M=0,++i.H);break;case 2:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M)}var _,O="";for(c=0;c0){40==O.charCodeAt(0)?(k=t<0&&45===O.charCodeAt(0)?-t:t,A=E("n",O,k)):(A=E("n",O,k=t<0&&r>1?-t:t),k<0&&s[0]&&"t"==s[0].t&&(A=A.substr(1),s[0].v="-"+s[0].v)),_=A.length-1;var C=s.length;for(c=0;c-1){C=c;break}var F=s.length;if(C===s.length&&-1===A.indexOf("E")){for(c=s.length-1;c>=0;--c)null!=s[c]&&-1!=="n?".indexOf(s[c].t)&&(_>=s[c].v.length-1?(_-=s[c].v.length,s[c].v=A.substr(_+1,s[c].v.length)):_<0?s[c].v="":(s[c].v=A.substr(0,_+1),_=-1),s[c].t="t",F=c);_>=0&&F=0;--c)if(null!=s[c]&&-1!=="n?".indexOf(s[c].t)){for(o=s[c].v.indexOf(".")>-1&&c===C?s[c].v.indexOf(".")-1:s[c].v.length-1,S=s[c].v.substr(o+1);o>=0;--o)_>=0&&("0"===s[c].v.charAt(o)||"#"===s[c].v.charAt(o))&&(S=A.charAt(_--)+S);s[c].v=S,s[c].t="t",F=c}for(_>=0&&F-1&&c===C?s[c].v.indexOf(".")+1:0,S=s[c].v.substr(0,o);o-1&&(k=r>1&&t<0&&c>0&&"-"===s[c-1].v?-t:t,s[c].v=E(s[c].t,s[c].v,k),s[c].t="t");var z="";for(c=0;c!==s.length;++c)null!=s[c]&&(z+=s[c].v);return z}e.is_date=M,e._eval=S;var C=/\[[=<>]/,F=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function z(e,t){if(null==t)return!1;var n=parseFloat(t[2]);switch(t[1]){case"=":if(e==n)return!0;break;case">":if(e>n)return!0;break;case"<":if(e":if(e!=n)return!0;break;case">=":if(e>=n)return!0;break;case"<=":if(e<=n)return!0}return!1}function T(e,t,n){null==n&&(n={});var r="";switch(typeof e){case"string":r="m/d/yy"==e&&n.dateNF?n.dateNF:e;break;case"number":null==(r=14==e&&n.dateNF?n.dateNF:(null!=n.table?n.table:d)[e])&&(r=n.table&&n.table[h[e]]||d[h[e]]),null==r&&(r=g[e]||"General")}if(u(r,0))return w(t,n);t instanceof Date&&(t=_(t,n.date1904));var i=function(e,t){var n=A(e),r=n.length,i=n[r-1].indexOf("@");if(r<4&&i>-1&&--r,n.length>4)throw new Error("cannot find right format for |"+n.join("|")+"|");if("number"!=typeof t)return[4,4===n.length||i>-1?n[n.length-1]:"@"];switch(n.length){case 1:n=i>-1?["General","General","General",n[0]]:[n[0],n[0],n[0],"@"];break;case 2:n=i>-1?[n[0],n[0],n[0],n[1]]:[n[0],n[1],n[0],"@"];break;case 3:n=i>-1?[n[0],n[1],n[0],n[2]]:[n[0],n[1],n[2],"@"]}var o=t>0?n[0]:t<0?n[1]:n[2];if(-1===n[0].indexOf("[")&&-1===n[1].indexOf("["))return[r,o];if(null!=n[0].match(C)||null!=n[1].match(C)){var a=n[0].match(F),s=n[1].match(F);return z(t,a)?[r,n[0]]:z(t,s)?[r,n[1]]:[r,n[null!=a&&null!=s?2:1]]}return[r,o]}(r,t);if(u(i[1]))return w(t,n);if(!0===t)t="TRUE";else if(!1===t)t="FALSE";else if(""===t||null==t)return"";return S(i[1],t,n,i[0])}function $(e,t){if("number"!=typeof t){t=+t||-1;for(var n=0;n<392;++n)if(null!=d[n]){if(d[n]==e){t=n;break}}else t<0&&(t=n);t<0&&(t=391)}return d[t]=e,t}e.load=$,e._table=d,e.get_table=function(){return d},e.load_table=function(e){for(var t=0;392!=t;++t)void 0!==e[t]&&$(e[t],t)},e.init_table=f,e.format=T}(r),"undefined"==typeof DO_NOT_EXPORT_SSF&&(e.exports=r)},function(e,t,n){const r=n(30),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=n(29),{re:a,t:s}=n(19),{compareIdentifiers:u}=n(39);class l{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?a[s.LOOSE]:a[s.FULL]);if(!n)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this}}e.exports=l},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"e",(function(){return winsorize})),__webpack_require__.d(__webpack_exports__,"b",(function(){return handleErrors})),__webpack_require__.d(__webpack_exports__,"d",(function(){return prepareData})),__webpack_require__.d(__webpack_exports__,"c",(function(){return makeBins})),__webpack_require__.d(__webpack_exports__,"a",(function(){return getPercentile}));var percentile__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(48),percentile__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(percentile__WEBPACK_IMPORTED_MODULE_0__),ssf__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7),ssf__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(ssf__WEBPACK_IMPORTED_MODULE_1__);function winsorize(myData,field,p){if(void 0===p)return;p=p.split("_").map(e=>eval(e));let thresholds=percentile__WEBPACK_IMPORTED_MODULE_0___default()(p,myData.map(e=>e[field]));return myData.map(e=>{let t=Object.assign({},e);return t[field]<=thresholds[0]?t[field]=thresholds[0]:e[field]>=thresholds[1]&&(t[field]=thresholds[1]),t})}function handleErrors(e,t,n){const r=(t,n,r,i,o)=>!(!e.addError||!e.clearErrors)&&(ro?(e.addError({title:`Too Many ${n}s`,message:`This visualization requires ${i===o?"exactly":"no more than"} ${o} ${n.toLowerCase()}${1===i?"":"s"}.`,group:t}),!1):(e.clearErrors(t),!0)),{pivots:i,dimension_like:o,measure_like:a}=t.fields;return r("pivot-req","Pivot",i.length,n.min_pivots,n.max_pivots)&&r("dim-req","Dimension",o.length,n.min_dimensions,n.max_dimensions)&&r("mes-req","Measure",a.length,n.min_measures,n.max_measures)}function prepareData(e,t){var n,r=[],i={},o=[],a=[];for(var s in e){var u=e[s],l={links:[]};for(var c in u){if(l[c.replace(".","_")]=u[c].value,void 0!==u[c].links){for(var f=0;fe[field]).sort((e,t)=>e-t),breakpoints=breakpointsArray.split(",").map(e=>{switch(e.trim()){case"min":return orderedArray[0];case"max":return orderedArray[orderedArray.length-1];default:return eval(e)}});for(let e=0;et>breakpoints[e+1]);-1===t&&(t=orderedArray.length);let n=orderedArray.splice(0,t).length;preBin.push({}),preBin[e]["bin_start_"+axis]=breakpoints[e],preBin[e]["bin_end_"+axis]=breakpoints[e+1],preBin[e]["count_"+axis]=n,preBin[e].label=`${ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(valFormat,preBin[e]["bin_start_"+axis])} - ${ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(valFormat,preBin[e]["bin_end_"+axis])}`,preBin[e].order=e+1}return preBin}function getPercentile(e,t,n){return percentile__WEBPACK_IMPORTED_MODULE_0___default()(e,n.map(e=>e[t]).filter(e=>null!==e))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return D})),n.d(t,"b",(function(){return A})),n.d(t,"c",(function(){return x})),n.d(t,"d",(function(){return M})),n.d(t,"e",(function(){return k}));var r=n(51),i=n(27),o=n(104),a=n(105),s=n(106),u=n(64),l=n(50),c=n(1),f=n(0),d=n(36),h=n(47);function p(e){const t={};return n=>t[n]||(t[n]=e(n))}function g(e){const t=p(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=Object(i.a)(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return r=t(n),o=t(".1f")(1)[1],e=>{const t=r(e),n=t.indexOf(o);if(n<0)return t;let i=function(e,t){let n,r=e.lastIndexOf("e");if(r>0)return r;for(r=e.length;--r>t;)if(n=e.charCodeAt(r),n>=48&&n<=57)return r+1}(t,n);const a=in;)if("0"!==t[i]){++i;break}return t.slice(0,i)+a}}return t(n);var r,o},formatSpan(e,u,l,c){c=Object(i.a)(null==c?",f":c);const f=Object(r.c)(e,u,l),d=Math.max(Math.abs(e),Math.abs(u));let h;if(null==c.precision)switch(c.type){case"s":return isNaN(h=Object(o.a)(f,d))||(c.precision=h),n(c,d);case"":case"e":case"g":case"p":case"r":isNaN(h=Object(a.a)(f,d))||(c.precision=h-("e"===c.type));break;case"f":case"%":isNaN(h=Object(s.a)(f))||(c.precision=h-2*("%"===c.type))}return t(c)}}}let m,b;function y(){return m=g({format:u.a,formatPrefix:u.b})}function v(e){return g(Object(l.a)(e))}function x(e){return arguments.length?m=v(e):m}function _(e,t,n){n=n||{},Object(f.G)(n)||Object(f.o)("Invalid time multi-format specifier: ".concat(n));const r=t(c.i),i=t(c.f),o=t(c.d),a=t(c.a),s=t(c.k),u=t(c.g),l=t(c.h),d=t(c.l),h=e(n[c.e]||".%L"),p=e(n[c.i]||":%S"),g=e(n[c.f]||"%I:%M"),m=e(n[c.d]||"%I %p"),b=e(n[c.a]||n[c.b]||"%a %d"),y=e(n[c.k]||"%b %d"),v=e(n[c.g]||"%B"),x=e(n[c.h]||"%B"),_=e(n[c.l]||"%Y");return e=>(r(e)Object(f.I)(e)?t(e):_(t,c.p,e),utcFormat:e=>Object(f.I)(e)?n(e):_(n,c.v,e),timeParse:p(e.parse),utcParse:p(e.utcParse)}}function w(){return b=O({format:d.a,parse:d.b,utcFormat:d.c,utcParse:d.d})}function j(e){return O(Object(h.a)(e))}function k(e){return arguments.length?b=j(e):b}y(),w();const E=(e,t)=>Object(f.p)({},e,t);function A(e,t){const n=e?v(e):x(),r=t?j(t):k();return E(n,r)}function D(e,t){const n=arguments.length;return n&&2!==n&&Object(f.o)("defaultLocale expects either zero or two arguments."),n?E(x(e),k(t)):E(x(),k())}function M(){return y(),w(),D()}},function(e,t,n){const r=n(8);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},function(e,t,n){class r{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof i)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=this.options.loose;e=e.trim();const n=t?s[u.HYPHENRANGELOOSE]:s[u.HYPHENRANGE];e=e.replace(n,w(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(s[u.COMPARATORTRIM],l),o("comparator trim",e,s[u.COMPARATORTRIM]),e=(e=(e=e.replace(s[u.TILDETRIM],c)).replace(s[u.CARETTRIM],f)).split(/\s+/).join(" ");const r=t?s[u.COMPARATORLOOSE]:s[u.COMPARATOR];return e.split(" ").map(e=>h(e,this.options)).join(" ").split(/\s+/).map(e=>O(e,this.options)).filter(this.options.loose?e=>!!e.match(r):()=>!0).map(e=>new i(e,this.options))}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>d(n,t)&&e.set.some(e=>d(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(e){return!1}for(let t=0;t{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},h=(e,t)=>(o("comp",e,t),e=b(e,t),o("caret",e),e=g(e,t),o("tildes",e),e=v(e,t),o("xrange",e),e=_(e,t),o("stars",e),e),p=e=>!e||"x"===e.toLowerCase()||"*"===e,g=(e,t)=>e.trim().split(/\s+/).map(e=>m(e,t)).join(" "),m=(e,t)=>{const n=t.loose?s[u.TILDELOOSE]:s[u.TILDE];return e.replace(n,(t,n,r,i,a)=>{let s;return o("tilde",e,t,n,r,i,a),p(n)?s="":p(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:p(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o("replaceTilde pr",a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",s),s})},b=(e,t)=>e.trim().split(/\s+/).map(e=>y(e,t)).join(" "),y=(e,t)=>{o("caret",e,t);const n=t.loose?s[u.CARETLOOSE]:s[u.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,i,a,s)=>{let u;return o("caret",e,t,n,i,a,s),p(n)?u="":p(i)?u=`>=${n}.0.0${r} <${+n+1}.0.0-0`:p(a)?u="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o("replaceCaret pr",s),u="0"===n?"0"===i?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o("no pr"),u="0"===n?"0"===i?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o("caret return",u),u})},v=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map(e=>x(e,t)).join(" ")),x=(e,t)=>{e=e.trim();const n=t.loose?s[u.XRANGELOOSE]:s[u.XRANGE];return e.replace(n,(n,r,i,a,s,u)=>{o("xRange",e,n,r,i,a,s,u);const l=p(i),c=l||p(a),f=c||p(s),d=f;return"="===r&&d&&(r=""),u=t.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(a=0),s=0,">"===r?(r=">=",c?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",c?i=+i+1:a=+a+1),"<"===r&&(u="-0"),n=`${r+i}.${a}.${s}${u}`):c?n=`>=${i}.0.0${u} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${a}.0${u} <${i}.${+a+1}.0-0`),o("xRange return",n),n})},_=(e,t)=>(o("replaceStars",e,t),e.trim().replace(s[u.STAR],"")),O=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(s[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),w=e=>(t,n,r,i,o,a,s,u,l,c,f,d,h)=>`${n=p(r)?"":p(i)?`>=${r}.0.0${e?"-0":""}`:p(o)?`>=${r}.${i}.0${e?"-0":""}`:a?">="+n:`>=${n}${e?"-0":""}`} ${u=p(l)?"":p(c)?`<${+l+1}.0.0-0`:p(f)?`<${l}.${+c+1}.0-0`:d?`<=${l}.${c}.${f}-${d}`:e?`<${l}.${c}.${+f+1}-0`:"<="+u}`.trim(),j=(e,t,n)=>{for(let n=0;n0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return c}));var r=n(3),i=n(4);function o(e){return Object(r.a)((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.c)/i.e}))}var a=o(0),s=o(1),u=o(2),l=o(3),c=o(4),f=o(5),d=o(6);a.range,s.range,u.range,l.range,c.range,f.range,d.range},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return c}));var r=n(3),i=n(4);function o(e){return Object(r.a)((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/i.e}))}var a=o(0),s=o(1),u=o(2),l=o(3),c=o(4),f=o(5),d=o(6);a.range,s.range,u.range,l.range,c.range,f.range,d.range},function(e,t,n){"use strict";var r=n(17);t.a=function(e){return(e=Object(r.b)(Math.abs(e)))?e[1]:NaN}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return A})),n.d(t,"b",(function(){return D})),n.d(t,"c",(function(){return x})),n.d(t,"d",(function(){return _})),n.d(t,"e",(function(){return C})),n.d(t,"f",(function(){return S})),n.d(t,"g",(function(){return M})),n.d(t,"h",(function(){return b}));var r=n(0),i=n(107),o=n(49),a=n(10);const s=/^([A-Za-z]+:)?\/\//,u=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,l=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;async function c(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function f(e,t){t=Object(r.p)({},this.options,t);const n=this.fileAccess,i={href:null};let o,a,c;const f=u.test(e.replace(l,""));null!=e&&"string"==typeof e&&f||Object(r.o)("Sanitize failure, invalid URI: "+Object(r.ab)(e));const d=s.test(e);return(c=t.baseURL)&&!d&&(e.startsWith("/")||"/"===c[c.length-1]||(e="/"+e),e=c+e),a=(o=e.startsWith("file://"))||"file"===t.mode||"http"!==t.mode&&!d&&n,o?e=e.slice("file://".length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),a=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!a}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function d(e){return e?t=>new Promise((n,r)=>{e.readFile(t,(e,t)=>{e?r(e):n(t)})}):h}async function h(){Object(r.o)("No file system access.")}function p(e){return e?async function(t,n){const i=Object(r.p)({},this.options.http,n),o=n&&n.response,a=await e(t,i);return a.ok?Object(r.E)(a[o])?a[o]():a.text():Object(r.o)(a.status+""+a.statusText)}:g}async function g(){Object(r.o)("No HTTP fetch method available.")}const m=e=>!(Number.isNaN(+e)||e instanceof Date),b={boolean:r.bb,integer:r.db,number:r.db,date:r.cb,string:r.fb,unknown:r.y},y=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>m(e)&&Number.isInteger(+e),m,e=>!Number.isNaN(Date.parse(e))],v=["boolean","integer","number","date"];function x(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=y.length,i=y.map((e,t)=>t+1);for(let a,s,u=0,l=0;u0===e?t:e,0)-1]}function _(e,t){return t.reduce((t,n)=>(t[n]=x(e,n),t),{})}function O(e){const t=function(t,n){const i={delimiter:e};return w(t,n?Object(r.p)(n,i):i)};return t.responseType="text",t}function w(e,t){return t.header&&(e=t.header.map(r.ab).join(t.delimiter)+"\n"+e),Object(i.a)(t.delimiter).parse(e+"")}function j(t,n){const i=n&&n.property?Object(r.u)(n.property):r.y;return!Object(r.G)(t)||(o=t,"function"==typeof e&&Object(r.E)(e.isBuffer)&&e.isBuffer(o))?i(JSON.parse(t)):function(e,t){return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(i(t),n);var o}w.responseType="text",j.responseType="json";const k={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function E(e,t){let n,i,a,s;return e=j(e,t),t&&t.feature?(n=o.a,a=t.feature):t&&t.mesh?(n=o.b,a=t.mesh,s=k[t.filter]):Object(r.o)("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[a])?n(e,i,s):Object(r.o)("Invalid TopoJSON object: "+a),i&&i.features||[i]}E.responseType="json";const A={dsv:w,csv:O(","),tsv:O("\t"),json:j,topojson:E};function D(e,t){return arguments.length>1?(A[e]=t,this):Object(r.w)(A,e)?A[e]:null}function M(e){const t=D(e);return t&&t.responseType||"text"}function S(e,t,n,i){const o=D((t=t||{}).type||"json");return o||Object(r.o)("Unknown data format type: "+t.type),e=o(e,t),t.parse&&function(e,t,n,r){if(!e.length)return;const i=Object(a.e)();n=n||i.timeParse,r=r||i.utcParse;let o,s,u,l,c,f,d=e.columns||Object.keys(e[0]);"auto"===t&&(t=_(e,d));d=Object.keys(t);const h=d.map(e=>{const i=t[e];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:"))){o=i.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1));return("utc"===o[0]?r:n)(a)}if(!b[i])throw Error("Illegal format pattern: "+e+":"+i);return b[i]});for(u=0,c=e.length,f=d.length;u({options:n||{},sanitize:f,load:c,fileAccess:!!t,file:d(t),http:p(e)})}("undefined"!=typeof fetch&&fetch,null)}).call(this,n(56).Buffer)},function(e,t,n){"use strict";function r(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}n.d(t,"b",(function(){return r})),t.a=function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}},,function(e,t,n){const{MAX_SAFE_COMPONENT_LENGTH:r}=n(29),i=n(30),o=(t=e.exports={}).re=[],a=t.src=[],s=t.t={};let u=0;const l=(e,t,n)=>{const r=u++;i(r,t),s[e]=r,a[r]=t,o[r]=new RegExp(t,n?"g":void 0)};l("NUMERICIDENTIFIER","0|[1-9]\\d*"),l("NUMERICIDENTIFIERLOOSE","[0-9]+"),l("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),l("MAINVERSION",`(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})`),l("MAINVERSIONLOOSE",`(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})`),l("PRERELEASEIDENTIFIER",`(?:${a[s.NUMERICIDENTIFIER]}|${a[s.NONNUMERICIDENTIFIER]})`),l("PRERELEASEIDENTIFIERLOOSE",`(?:${a[s.NUMERICIDENTIFIERLOOSE]}|${a[s.NONNUMERICIDENTIFIER]})`),l("PRERELEASE",`(?:-(${a[s.PRERELEASEIDENTIFIER]}(?:\\.${a[s.PRERELEASEIDENTIFIER]})*))`),l("PRERELEASELOOSE",`(?:-?(${a[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[s.PRERELEASEIDENTIFIERLOOSE]})*))`),l("BUILDIDENTIFIER","[0-9A-Za-z-]+"),l("BUILD",`(?:\\+(${a[s.BUILDIDENTIFIER]}(?:\\.${a[s.BUILDIDENTIFIER]})*))`),l("FULLPLAIN",`v?${a[s.MAINVERSION]}${a[s.PRERELEASE]}?${a[s.BUILD]}?`),l("FULL",`^${a[s.FULLPLAIN]}$`),l("LOOSEPLAIN",`[v=\\s]*${a[s.MAINVERSIONLOOSE]}${a[s.PRERELEASELOOSE]}?${a[s.BUILD]}?`),l("LOOSE",`^${a[s.LOOSEPLAIN]}$`),l("GTLT","((?:<|>)?=?)"),l("XRANGEIDENTIFIERLOOSE",a[s.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),l("XRANGEIDENTIFIER",a[s.NUMERICIDENTIFIER]+"|x|X|\\*"),l("XRANGEPLAIN",`[v=\\s]*(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:${a[s.PRERELEASE]})?${a[s.BUILD]}?)?)?`),l("XRANGEPLAINLOOSE",`[v=\\s]*(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:${a[s.PRERELEASELOOSE]})?${a[s.BUILD]}?)?)?`),l("XRANGE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAIN]}$`),l("XRANGELOOSE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAINLOOSE]}$`),l("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),l("COERCERTL",a[s.COERCE],!0),l("LONETILDE","(?:~>?)"),l("TILDETRIM",`(\\s*)${a[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",l("TILDE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAIN]}$`),l("TILDELOOSE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAINLOOSE]}$`),l("LONECARET","(?:\\^)"),l("CARETTRIM",`(\\s*)${a[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",l("CARET",`^${a[s.LONECARET]}${a[s.XRANGEPLAIN]}$`),l("CARETLOOSE",`^${a[s.LONECARET]}${a[s.XRANGEPLAINLOOSE]}$`),l("COMPARATORLOOSE",`^${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]})$|^$`),l("COMPARATOR",`^${a[s.GTLT]}\\s*(${a[s.FULLPLAIN]})$|^$`),l("COMPARATORTRIM",`(\\s*)${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]}|${a[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",l("HYPHENRANGE",`^\\s*(${a[s.XRANGEPLAIN]})\\s+-\\s+(${a[s.XRANGEPLAIN]})\\s*$`),l("HYPHENRANGELOOSE",`^\\s*(${a[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[s.XRANGEPLAINLOOSE]})\\s*$`),l("STAR","(<|>)?=?\\s*\\*"),l("GTE0","^\\s*>=\\s*0.0.0\\s*$"),l("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},function(e,t,n){const{MAX_LENGTH:r}=n(29),{re:i,t:o}=n(19),a=n(8);e.exports=(e,t)=>{if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof a)return e;if("string"!=typeof e)return null;if(e.length>r)return null;if(!(t.loose?i[o.LOOSE]:i[o.FULL]).test(e))return null;try{return new a(e,t)}catch(e){return null}}},function(e,t,n){"use strict";t.a=function(e,t){return et?1:e>=t?0:NaN}},function(e,t,n){"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,r="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(n=t.cmp,function(e){return function(t,r){var i={key:t,value:e[t]},o={key:r,value:e[r]};return n(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;ne.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.c)/i.a,e=>e.getDate()-1);t.a=o;o.range},function(e,t,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/i.a}),(function(e){return e.getUTCDate()-1}));t.a=o;o.range},function(e,t,n){"use strict";var r=n(3),i=Object(r.a)((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));i.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Object(r.a)((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null},t.a=i;i.range},function(e,t,n){"use strict";var r=n(3),i=Object(r.a)((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));i.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Object(r.a)((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null},t.a=i;i.range},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(e){if(!(t=r.exec(e)))throw new Error("invalid format: "+e);var t;return new o({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function o(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}},,function(e,t){const n=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:n,MAX_SAFE_COMPONENT_LENGTH:16}},function(e,t,n){(function(t){const n="object"==typeof t&&t.env&&t.env.NODE_DEBUG&&/\bsemver\b/i.test(t.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=n}).call(this,n(68))},function(e,t,n){const r=n(11);e.exports=(e,t,n)=>r(e,t,n)>0},function(e,t,n){const r=Symbol("SemVer ANY");class i{static get ANY(){return r}constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new l(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return s(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new c(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new c(this.value,t).test(e.semver);const n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),u=s(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),l=s(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||r||o&&a||u||l}}e.exports=i;const{re:o,t:a}=n(19),s=n(55),u=n(30),l=n(8),c=n(12)},function(e,t,n){const r=n(12);e.exports=(e,t,n)=>{try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},function(e,t,n){"use strict";var r=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function(e,t){var n,i,o;return t=t||{},n=JSON.stringify([1],void 0,void 0===t.indent?2:t.indent).slice(2,-3),i=""===n?1/0:void 0===t.maxLength?80:t.maxLength,o=t.replacer,function e(t,a,s){var u,l,c,f,d,h,p,g,m,b,y,v;if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===(y=JSON.stringify(t,o)))return y;if(p=i-a.length-s,y.length<=p&&(m=y.replace(r,(function(e,t){return t||e+" "}))).length<=p)return m;if(null!=o&&(t=JSON.parse(y),o=void 0),"object"==typeof t&&null!==t){if(g=a+n,c=[],l=0,Array.isArray(t))for(b="[",u="]",p=t.length;l0)return[b,n+c.join(",\n"+g),u].join("\n"+a)}return y}(e,"",0)}},function(e,t,n){"use strict";var r=n(21);t.a=function(e){let t=e,n=e;function i(e,t,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;n(e[o],t)<0?r=o+1:i=o}return r}return 1===e.length&&(t=(t,n)=>e(t)-n,n=function(e){return(t,n)=>Object(r.a)(e(t),n)}(e)),{left:i,center:function(e,n,r,o){null==r&&(r=0),null==o&&(o=e.length);const a=i(e,n,r,o-1);return a>r&&t(e[a-1],n)>-t(e[a],n)?a-1:a},right:function(e,t,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;n(e[o],t)>0?i=o:r=o+1}return r}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return s}));var r,i,o,a,s,u,l=n(47);u={dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},r=Object(l.a)(u),i=r.format,o=r.parse,a=r.utcFormat,s=r.utcParse},,,function(e,t){const n=/^[0-9]+$/,r=(e,t)=>{const r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:er(t,e)}},function(e,t,n){const r=n(11);e.exports=(e,t,n)=>0===r(e,t,n)},function(e,t,n){const r=n(8);e.exports=(e,t,n)=>{const i=new r(e,n),o=new r(t,n);return i.compare(o)||i.compareBuild(o)}},function(e,t,n){const r=n(11);e.exports=(e,t,n)=>r(e,t,n)<0},function(e,t,n){const r=n(11);e.exports=(e,t,n)=>r(e,t,n)>=0},function(e,t,n){const r=n(11);e.exports=(e,t,n)=>r(e,t,n)<=0},function(e,t,n){const r=n(8),i=n(32),{ANY:o}=i,a=n(12),s=n(33),u=n(31),l=n(42),c=n(44),f=n(43);e.exports=(e,t,n,d)=>{let h,p,g,m,b;switch(e=new r(e,d),t=new a(t,d),n){case">":h=u,p=c,g=l,m=">",b=">=";break;case"<":h=l,p=f,g=u,m="<",b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,d))return!1;for(let n=0;n{e.semver===o&&(e=new i(">=0.0.0")),a=a||e,s=s||e,h(e.semver,a.semver,d)?a=e:g(e.semver,s.semver,d)&&(s=e)}),a.operator===m||a.operator===b)return!1;if((!s.operator||s.operator===m)&&p(e,s.semver))return!1;if(s.operator===b&&g(e,s.semver))return!1}return!0}},function(e,t,n){const r=n(19);e.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(29).SEMVER_SPEC_VERSION,SemVer:n(8),compareIdentifiers:n(39).compareIdentifiers,rcompareIdentifiers:n(39).rcompareIdentifiers,parse:n(20),valid:n(69),clean:n(70),inc:n(71),diff:n(72),major:n(73),minor:n(74),patch:n(75),prerelease:n(76),compare:n(11),rcompare:n(77),compareLoose:n(78),compareBuild:n(41),sort:n(79),rsort:n(80),gt:n(31),lt:n(42),eq:n(40),neq:n(54),gte:n(43),lte:n(44),cmp:n(55),coerce:n(81),Comparator:n(32),Range:n(12),satisfies:n(33),toComparators:n(82),maxSatisfying:n(83),minSatisfying:n(84),minVersion:n(85),validRange:n(86),outside:n(45),gtr:n(87),ltr:n(88),intersects:n(89),simplifyRange:n(90),subset:n(91)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(14),i=n(24),o=n(13),a=n(23),s=n(25),u=n(26);function l(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function c(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function f(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function d(e){var t=e.dateTime,n=e.date,s=e.time,u=e.periods,d=e.days,p=e.shortDays,g=e.months,m=e.shortMonths,b=v(u),y=x(u),Z=v(d),ye=x(d),Se=v(p),Ce=x(p),Fe=v(g),ze=x(g),Te=v(m),$e=x(m),Ne={a:function(e){return p[e.getDay()]},A:function(e){return d[e.getDay()]},b:function(e){return m[e.getMonth()]},B:function(e){return g[e.getMonth()]},c:null,d:I,e:I,f:H,g:re,G:oe,H:U,I:q,j:W,L:Y,m:G,M:V,p:function(e){return u[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:De,s:Me,S:X,u:J,U:K,V:Q,w:ee,W:te,x:null,X:null,y:ne,Y:ie,Z:ae,"%":Ae},Re={a:function(e){return p[e.getUTCDay()]},A:function(e){return d[e.getUTCDay()]},b:function(e){return m[e.getUTCMonth()]},B:function(e){return g[e.getUTCMonth()]},c:null,d:se,e:se,f:de,g:we,G:ke,H:ue,I:le,j:ce,L:fe,m:he,M:pe,p:function(e){return u[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:De,s:Me,S:ge,u:me,U:be,V:ve,w:xe,W:_e,x:null,X:null,y:Oe,Y:je,Z:Ee,"%":Ae},Pe={a:function(e,t,n){var r=Se.exec(t.slice(n));return r?(e.w=Ce.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=Z.exec(t.slice(n));return r?(e.w=ye.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=Te.exec(t.slice(n));return r?(e.m=$e.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=Fe.exec(t.slice(n));return r?(e.m=ze.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return Ie(e,t,n,r)},d:C,e:C,f:R,g:A,G:E,H:z,I:z,j:F,L:N,m:S,M:T,p:function(e,t,n){var r=b.exec(t.slice(n));return r?(e.p=y.get(r[0].toLowerCase()),n+r[0].length):-1},q:M,Q:B,s:L,S:$,u:O,U:w,V:j,w:_,W:k,x:function(e,t,r){return Ie(e,n,t,r)},X:function(e,t,n){return Ie(e,s,t,n)},y:A,Y:E,Z:D,"%":P};function Be(e,t){return function(n){var r,i,o,a=[],s=-1,u=0,l=e.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in d||(d.w=1),"Z"in d?(u=(s=c(f(d.y,0,1))).getUTCDay(),s=u>4||0===u?r.a.ceil(s):Object(r.a)(s),s=i.a.offset(s,7*(d.V-1)),d.y=s.getUTCFullYear(),d.m=s.getUTCMonth(),d.d=s.getUTCDate()+(d.w+6)%7):(u=(s=l(f(d.y,0,1))).getDay(),s=u>4||0===u?o.a.ceil(s):Object(o.a)(s),s=a.a.offset(s,7*(d.V-1)),d.y=s.getFullYear(),d.m=s.getMonth(),d.d=s.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),u="Z"in d?c(f(d.y,0,1)).getUTCDay():l(f(d.y,0,1)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+7*d.W-(u+5)%7:d.w+7*d.U-(u+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,c(d)):l(d)}}function Ie(e,t,n,r){for(var i,o,a=0,s=t.length,u=n.length;a=u)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=Pe[i in h?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return Ne.x=Be(n,Ne),Ne.X=Be(s,Ne),Ne.c=Be(t,Ne),Re.x=Be(n,Re),Re.X=Be(s,Re),Re.c=Be(t,Re),{format:function(e){var t=Be(e+="",Ne);return t.toString=function(){return e},t},parse:function(e){var t=Le(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=Be(e+="",Re);return t.toString=function(){return e},t},utcParse:function(e){var t=Le(e+="",!0);return t.toString=function(){return e},t}}}var h={"-":"",_:" ",0:"0"},p=/^\s*\d+/,g=/^%/,m=/[\\^$*+?|[\]().{}]/g;function b(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[e.toLowerCase(),t]))}function _(e,t,n){var r=p.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function O(e,t,n){var r=p.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function w(e,t,n){var r=p.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function j(e,t,n){var r=p.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function k(e,t,n){var r=p.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function A(e,t,n){var r=p.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function D(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function M(e,t,n){var r=p.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function S(e,t,n){var r=p.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function C(e,t,n){var r=p.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function F(e,t,n){var r=p.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function z(e,t,n){var r=p.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function T(e,t,n){var r=p.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function $(e,t,n){var r=p.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function N(e,t,n){var r=p.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function R(e,t,n){var r=p.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function P(e,t,n){var r=g.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function B(e,t,n){var r=p.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function L(e,t,n){var r=p.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function I(e,t){return b(e.getDate(),t,2)}function U(e,t){return b(e.getHours(),t,2)}function q(e,t){return b(e.getHours()%12||12,t,2)}function W(e,t){return b(1+a.a.count(Object(s.a)(e),e),t,3)}function Y(e,t){return b(e.getMilliseconds(),t,3)}function H(e,t){return Y(e,t)+"000"}function G(e,t){return b(e.getMonth()+1,t,2)}function V(e,t){return b(e.getMinutes(),t,2)}function X(e,t){return b(e.getSeconds(),t,2)}function J(e){var t=e.getDay();return 0===t?7:t}function K(e,t){return b(o.b.count(Object(s.a)(e)-1,e),t,2)}function Z(e){var t=e.getDay();return t>=4||0===t?Object(o.c)(e):o.c.ceil(e)}function Q(e,t){return e=Z(e),b(o.c.count(Object(s.a)(e),e)+(4===Object(s.a)(e).getDay()),t,2)}function ee(e){return e.getDay()}function te(e,t){return b(o.a.count(Object(s.a)(e)-1,e),t,2)}function ne(e,t){return b(e.getFullYear()%100,t,2)}function re(e,t){return b((e=Z(e)).getFullYear()%100,t,2)}function ie(e,t){return b(e.getFullYear()%1e4,t,4)}function oe(e,t){var n=e.getDay();return b((e=n>=4||0===n?Object(o.c)(e):o.c.ceil(e)).getFullYear()%1e4,t,4)}function ae(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+b(t/60|0,"0",2)+b(t%60,"0",2)}function se(e,t){return b(e.getUTCDate(),t,2)}function ue(e,t){return b(e.getUTCHours(),t,2)}function le(e,t){return b(e.getUTCHours()%12||12,t,2)}function ce(e,t){return b(1+i.a.count(Object(u.a)(e),e),t,3)}function fe(e,t){return b(e.getUTCMilliseconds(),t,3)}function de(e,t){return fe(e,t)+"000"}function he(e,t){return b(e.getUTCMonth()+1,t,2)}function pe(e,t){return b(e.getUTCMinutes(),t,2)}function ge(e,t){return b(e.getUTCSeconds(),t,2)}function me(e){var t=e.getUTCDay();return 0===t?7:t}function be(e,t){return b(r.b.count(Object(u.a)(e)-1,e),t,2)}function ye(e){var t=e.getUTCDay();return t>=4||0===t?Object(r.c)(e):r.c.ceil(e)}function ve(e,t){return e=ye(e),b(r.c.count(Object(u.a)(e),e)+(4===Object(u.a)(e).getUTCDay()),t,2)}function xe(e){return e.getUTCDay()}function _e(e,t){return b(r.a.count(Object(u.a)(e)-1,e),t,2)}function Oe(e,t){return b(e.getUTCFullYear()%100,t,2)}function we(e,t){return b((e=ye(e)).getUTCFullYear()%100,t,2)}function je(e,t){return b(e.getUTCFullYear()%1e4,t,4)}function ke(e,t){var n=e.getUTCDay();return b((e=n>=4||0===n?Object(r.c)(e):r.c.ceil(e)).getUTCFullYear()%1e4,t,4)}function Ee(){return"+0000"}function Ae(){return"%"}function De(e){return+e}function Me(e){return Math.floor(+e/1e3)}},function(e,t){function n(e,t){return 0===e?t[0]:t[Math.ceil(t.length*(e/100))-1]}e.exports=function(e,t,r){var i=Array.isArray(e)?e:[e],o=function(e){return e.reduce((function(e,t){return isNaN(Number(t))?e.push(function(e){return'Expect percentile to be a number but given "'+e+'" and its type is "'+typeof e+'".'}(t)):t<0?e.push(function(e){return'Expect percentile to be >= 0 but given "'+e+'" and its type is "'+typeof e+'".'}(t)):t>100&&e.push(function(e){return'Expect percentile to be <= 100 but given "'+e+'" and its type is "'+typeof e+'".'}(t)),e}),[])}(i);if(o.length)throw new Error(o.join(" "));return t=t.slice().sort((function(e,t){return r&&(e=r(e),t=r(t)),(e=Number.isNaN(e)?Number.NEGATIVE_INFINITY:e)>(t=Number.isNaN(t)?Number.NEGATIVE_INFINITY:t)?1:e1)r=f(e,t,n);else for(i=0,r=new Array(o=e.arcs.length);ii+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},u={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:a.a,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>s(100*e,t),r:s,s:function(e,t){var n=Object(a.b)(e,t);if(!n)return e+"";var i=n[0],o=n[1],s=o-(r=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,u=i.length;return s===u?i:s>u?i+new Array(s-u+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Object(a.b)(e,Math.max(0,t+s-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)},l=function(e){return e},c=Array.prototype.map,f=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];t.a=function(e){var t,n,a=void 0===e.grouping||void 0===e.thousands?l:(t=c.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(e.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),s=void 0===e.currency?"":e.currency[0]+"",d=void 0===e.currency?"":e.currency[1]+"",h=void 0===e.decimal?".":e.decimal+"",p=void 0===e.numerals?l:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(c.call(e.numerals,String)),g=void 0===e.percent?"%":e.percent+"",m=void 0===e.minus?"−":e.minus+"",b=void 0===e.nan?"NaN":e.nan+"";function y(e){var t=(e=Object(o.a)(e)).fill,n=e.align,i=e.sign,l=e.symbol,c=e.zero,y=e.width,v=e.comma,x=e.precision,_=e.trim,O=e.type;"n"===O?(v=!0,O="g"):u[O]||(void 0===x&&(x=12),_=!0,O="g"),(c||"0"===t&&"="===n)&&(c=!0,t="0",n="=");var w="$"===l?s:"#"===l&&/[boxX]/.test(O)?"0"+O.toLowerCase():"",j="$"===l?d:/[%p]/.test(O)?g:"",k=u[O],E=/[defgprs%]/.test(O);function A(e){var o,s,u,l=w,d=j;if("c"===O)d=k(e)+d,e="";else{var g=(e=+e)<0||1/e<0;if(e=isNaN(e)?b:k(Math.abs(e),x),_&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),g&&0==+e&&"+"!==i&&(g=!1),l=(g?"("===i?i:m:"-"===i||"("===i?"":i)+l,d=("s"===O?f[8+r/3]:"")+d+(g&&"("===i?")":""),E)for(o=-1,s=e.length;++o(u=e.charCodeAt(o))||u>57){d=(46===u?h+e.slice(o+1):e.slice(o))+d,e=e.slice(0,o);break}}v&&!c&&(e=a(e,1/0));var A=l.length+e.length+d.length,D=A>1)+l+e+d+D.slice(A);break;default:e=D+l+e+d}return p(e)}return x=void 0===x?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),A.toString=function(){return e+""},A}return{format:y,formatPrefix:function(e,t){var n=y(((e=Object(o.a)(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Object(i.a)(t)/3))),a=Math.pow(10,-r),s=f[8+r/3];return function(e){return n(a*e)+s}}}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s}));var r=Math.sqrt(50),i=Math.sqrt(10),o=Math.sqrt(2);function a(e,t,n){var a=(t-e)/Math.max(0,n),s=Math.floor(Math.log(a)/Math.LN10),u=a/Math.pow(10,s);return s>=0?(u>=r?10:u>=i?5:u>=o?2:1)*Math.pow(10,s):-Math.pow(10,-s)/(u>=r?10:u>=i?5:u>=o?2:1)}function s(e,t,n){var a=Math.abs(t-e)/Math.max(0,n),s=Math.pow(10,Math.floor(Math.log(a)/Math.LN10)),u=a/s;return u>=r?s*=10:u>=i?s*=5:u>=o&&(s*=2),t0)return[e];if((r=t0)for(e=Math.ceil(e/s),t=Math.floor(t/s),o=new Array(i=Math.ceil(t-e+1));++u0!==r(e,t,n)},function(e,t,n){const r=n(40),i=n(54),o=n(31),a=n(43),s=n(42),u=n(44);e.exports=(e,t,n,l)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,l);case"!=":return i(e,n,l);case">":return o(e,n,l);case">=":return a(e,n,l);case"<":return s(e,n,l);case"<=":return u(e,n,l);default:throw new TypeError("Invalid operator: "+t)}}},function(e,t,n){"use strict";(function(e){ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.histogram=e():t.histogram=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=99)}([function(t,e,n){"use strict";function r(t,e,n){return t.fields=e||[],t.fname=n,t}function i(t){return null==t?null:t.fname}function o(t){return null==t?null:t.fields}function a(t){return 1===t.length?s(t[0]):u(t)}n.d(e,"a",(function(){return w})),n.d(e,"b",(function(){return x})),n.d(e,"c",(function(){return O})),n.d(e,"d",(function(){return v})),n.d(e,"e",(function(){return _})),n.d(e,"f",(function(){return r})),n.d(e,"g",(function(){return o})),n.d(e,"h",(function(){return i})),n.d(e,"i",(function(){return J})),n.d(e,"j",(function(){return tt})),n.d(e,"k",(function(){return K})),n.d(e,"l",(function(){return Q})),n.d(e,"m",(function(){return it})),n.d(e,"n",(function(){return ot})),n.d(e,"o",(function(){return l})),n.d(e,"p",(function(){return at})),n.d(e,"q",(function(){return st})),n.d(e,"r",(function(){return ut})),n.d(e,"s",(function(){return b})),n.d(e,"t",(function(){return dt})),n.d(e,"u",(function(){return f})),n.d(e,"v",(function(){return ht})),n.d(e,"w",(function(){return ct})),n.d(e,"x",(function(){return d})),n.d(e,"y",(function(){return h})),n.d(e,"z",(function(){return pt})),n.d(e,"A",(function(){return gt})),n.d(e,"B",(function(){return k})),n.d(e,"C",(function(){return mt})),n.d(e,"D",(function(){return bt})),n.d(e,"E",(function(){return Z})),n.d(e,"F",(function(){return yt})),n.d(e,"G",(function(){return E})),n.d(e,"H",(function(){return vt})),n.d(e,"I",(function(){return xt})),n.d(e,"J",(function(){return _t})),n.d(e,"K",(function(){return Ot})),n.d(e,"L",(function(){return j})),n.d(e,"M",(function(){return wt})),n.d(e,"N",(function(){return jt})),n.d(e,"O",(function(){return D})),n.d(e,"P",(function(){return g})),n.d(e,"Q",(function(){return Et})),n.d(e,"R",(function(){return B})),n.d(e,"S",(function(){return L})),n.d(e,"T",(function(){return I})),n.d(e,"U",(function(){return U})),n.d(e,"V",(function(){return C})),n.d(e,"W",(function(){return V})),n.d(e,"X",(function(){return kt})),n.d(e,"Y",(function(){return At})),n.d(e,"Z",(function(){return c})),n.d(e,"ab",(function(){return Dt})),n.d(e,"bb",(function(){return Mt})),n.d(e,"cb",(function(){return Ct})),n.d(e,"db",(function(){return F})),n.d(e,"eb",(function(){return zt})),n.d(e,"fb",(function(){return Ft})),n.d(e,"gb",(function(){return Tt})),n.d(e,"hb",(function(){return m})),n.d(e,"ib",(function(){return X})),n.d(e,"jb",(function(){return $t})),n.d(e,"kb",(function(){return M})),n.d(e,"lb",(function(){return p})),n.d(e,"mb",(function(){return W})),n.d(e,"nb",(function(){return Y})),n.d(e,"ob",(function(){return H})),n.d(e,"pb",(function(){return G}));const s=t=>function(e){return e[t]},u=t=>{const e=t.length;return function(n){for(let r=0;rr&&c(),s=r=i+1):"]"===o&&(s||l("Access path missing open bracket: "+t),s>0&&c(),s=0,r=i+1):i>r?c():r=i+1}return s&&l("Access path missing closing bracket: "+t),a&&l("Access path missing closing quote: "+t),i>r&&(i++,c()),e}function f(t,e,n){const i=c(t);return t=1===i.length?i[0]:t,r((n&&n.get||a)(i),[t],e||t)}const d=f("id"),h=r(t=>t,[],"identity"),p=r(()=>0,[],"zero"),g=r(()=>1,[],"one"),m=r(()=>!0,[],"true"),b=r(()=>!1,[],"false");function y(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const v=0,x=1,_=2,O=3,w=4;function j(t,e){let n=t||v;return{level(t){return arguments.length?(n=+t,this):n},error(){return n>=x&&y(e||"error","ERROR",arguments),this},warn(){return n>=_&&y(e||"warn","WARN",arguments),this},info(){return n>=O&&y(e||"log","INFO",arguments),this},debug(){return n>=w&&y(e||"log","DEBUG",arguments),this}}}var k=Array.isArray;function E(t){return t===Object(t)}const A=t=>"__proto__"!==t;function D(...t){return t.reduce((t,e)=>{for(const n in e)if("signals"===n)t.signals=S(t.signals,e.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;M(t,n,e[n],r)}return t},{})}function M(t,e,n,r){if(!A(e))return;let i,o;if(E(n)&&!k(n))for(i in o=E(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?M(o,i,n[i]):A(i)&&(o[i]=n[i]);else t[e]=n}function S(t,e){if(null==t)return e;const n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}function C(t){return t[t.length-1]}function F(t){return null==t||""===t?null:+t}const z=t=>e=>t*Math.exp(e),T=t=>e=>Math.log(t*e),$=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),N=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,R=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function P(t,e,n,r){const i=n(t[0]),o=n(C(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function B(t,e){return P(t,e,F,h)}function L(t,e){var n=Math.sign(t[0]);return P(t,e,T(n),z(n))}function I(t,e,n){return P(t,e,R(n),R(1/n))}function U(t,e,n){return P(t,e,$(n),N(n))}function q(t,e,n,r,i){const o=r(t[0]),a=r(C(t)),s=null!=e?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function W(t,e,n){return q(t,e,n,F,h)}function Y(t,e,n){const r=Math.sign(t[0]);return q(t,e,n,T(r),z(r))}function H(t,e,n,r){return q(t,e,n,R(r),R(1/r))}function G(t,e,n,r){return q(t,e,n,$(r),N(r))}function V(t){return 1+~~(new Date(t).getMonth()/3)}function X(t){return 1+~~(new Date(t).getUTCMonth()/3)}function J(t){return null!=t?k(t)?t:[t]:[]}function K(t,e,n){let r,i=t[0],o=t[1];return o=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]}function Z(t){return"function"==typeof t}function Q(t,e,n){n=n||{},e=J(e)||[];const i=[],a=[],s={},u=n.comparator||et;return J(t).forEach((t,r)=>{null!=t&&(i.push("descending"===e[r]?-1:1),a.push(t=Z(t)?t:f(t,null,n)),(o(t)||[]).forEach(t=>s[t]=1))}),0===a.length?null:r(u(a,i),Object.keys(s))}const tt=(t,e)=>(te||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e==e?-1:e!=e&&t==t?1:0),et=(t,e)=>1===t.length?nt(t[0],e[0]):rt(t,e,t.length),nt=(t,e)=>function(n,r){return tt(t(n),t(r))*e},rt=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;0===a&&++st}function ot(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function at(t){for(let e,n,r=1,i=arguments.length;ro&&(o=r))}else{for(r=e(t[a]);ao&&(o=r))}return[i,o]}function ut(t,e){const n=t.length;let r,i,o,a,s,u=-1;if(null==e){for(;++u=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),o=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),or(t)?n[t]:void 0,set(t,e){return r(t)||(++i.size,n[t]===ft&&--i.empty),n[t]=e,this},delete(t){return r(t)&&(--i.size,++i.empty,n[t]=ft),this},clear(){i.size=i.empty=0,i.object=n={}},test(t){return arguments.length?(e=t,i):e},clean(){const t={};let r=0;for(const i in n){const o=n[i];o===ft||e&&e(o)||(t[i]=o,++r)}i.size=r,i.empty=0,i.object=n=t}};return t&&Object.keys(t).forEach(e=>{i.set(e,t[e])}),i}function ht(t,e,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,u=t[0],l=C(t);la&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=t:ot.replace(/\\(.)/g,"$1")):J(t));const i=t&&t.length,o=n&&n.get||a,s=t=>o(e?[t]:c(t));let u;if(i)if(1===i){const e=s(t[0]);u=function(t){return""+e(t)}}else{const e=t.map(s);u=function(t){let n=""+e[0](t),r=0;for(;++r{e={},n={},r=0},o=(i,o)=>(++r>t&&(n=e,e={},r=1),e[i]=o);return i(),{clear:i,has:t=>ct(e,t)||ct(n,t),get:t=>ct(e,t)?e[t]:ct(n,t)?o(t,n[t]):void 0,set:(t,n)=>ct(e,t)?e[t]=n:o(t,n)}}function jt(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s0?n[u++]:e[s++];for(;s=0;)n+=t;return n}function Et(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===r?kt(i,a)+o:"center"===r?kt(i,~~(a/2))+o+kt(i,Math.ceil(a/2)):o+kt(i,a)}function At(t){return t&&C(t)-t[0]||0}function Dt(t){return k(t)?"["+t.map(Dt)+"]":E(t)||xt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Mt(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t}const St=t=>yt(t)||bt(t)?t:Date.parse(t);function Ct(t,e){return e=e||St,null==t||""===t?null:e(t)}function Ft(t){return null==t||""===t?null:t+""}function zt(t){const e={},n=t.length;for(let r=0;r(t[e]=1+n,t),{});function z(t){const e=Object(r.i)(t).slice(),n={};e.length||Object(r.o)("Missing time unit."),e.forEach(t=>{Object(r.w)(F,t)?n[t]=1:Object(r.o)("Invalid time unit: ".concat(t,"."))});return(n[w]||n[k]?1:0)+(n[_]||n[O]||n[j]?1:0)+(n[E]?1:0)>1&&Object(r.o)("Incompatible time units: ".concat(t)),e.sort((t,e)=>F[t]-F[e]),e}const T={[x]:"%Y ",[_]:"Q%q ",[O]:"%b ",[j]:"%d ",[w]:"W%U ",[k]:"%a ",[E]:"%j ",[A]:"%H:00",[D]:"00:%M",[M]:":%S",[S]:".%L",["".concat(x,"-").concat(O)]:"%Y-%m ",["".concat(x,"-").concat(O,"-").concat(j)]:"%Y-%m-%d ",["".concat(A,"-").concat(D)]:"%H:%M"};function $(t,e){const n=Object(r.p)({},T,e),i=z(t),o=i.length;let a,s,u="",l=0;for(l=0;ll;--a)if(s=i.slice(l,a).join("-"),null!=n[s]){u+=n[s],l=a;break}return u.trim()}const N=new Date;function R(t){return N.setFullYear(t),N.setMonth(0),N.setDate(1),N.setHours(0,0,0,0),N}function P(t){return L(new Date(t))}function B(t){return I(new Date(t))}function L(t){return i.a.count(R(t.getFullYear())-1,t)}function I(t){return o.b.count(R(t.getFullYear())-1,t)}function U(t){return R(t).getDay()}function q(t,e,n,r,i,o,a){if(0<=t&&t<100){const s=new Date(-1,e,n,r,i,o,a);return s.setFullYear(t),s}return new Date(t,e,n,r,i,o,a)}function W(t){return H(new Date(t))}function Y(t){return G(new Date(t))}function H(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return a.a.count(e-1,t)}function G(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return s.b.count(e-1,t)}function V(t){return N.setTime(Date.UTC(t,0,1)),N.getUTCDay()}function X(t,e,n,r,i,o,a){if(0<=t&&t<100){const t=new Date(Date.UTC(-1,e,n,r,i,o,a));return t.setUTCFullYear(n.y),t}return new Date(Date.UTC(t,e,n,r,i,o,a))}function J(t,e,n,i,o){const a=e||1,s=Object(r.V)(t),u=(t,e,r)=>function(t,e,n,r){const i=n<=1?t:r?(e,i)=>r+n*Math.floor((t(e,i)-r)/n):(e,r)=>n*Math.floor(t(e,r)/n);return e?(t,n)=>e(i(t,n),n):i}(n[r=r||t],i[r],t===s&&a,e),l=new Date,c=Object(r.eb)(t),f=c[x]?u(x):Object(r.m)(2012),d=c[O]?u(O):c[_]?u(_):r.lb,h=c[w]&&c[k]?u(k,1,w+k):c[w]?u(w,1):c[k]?u(k,1):c[j]?u(j,1):c[E]?u(E,1):r.P,p=c[A]?u(A):r.lb,g=c[D]?u(D):r.lb,m=c[M]?u(M):r.lb,b=c[S]?u(S):r.lb;return function(t){l.setTime(+t);const e=f(l);return o(e,d(l),h(l,e),p(l),g(l),m(l),b(l))}}function K(t,e,n){return e+7*t-(n+6)%7}const Z={[x]:t=>t.getFullYear(),[_]:t=>Math.floor(t.getMonth()/3),[O]:t=>t.getMonth(),[j]:t=>t.getDate(),[A]:t=>t.getHours(),[D]:t=>t.getMinutes(),[M]:t=>t.getSeconds(),[S]:t=>t.getMilliseconds(),[E]:t=>L(t),[w]:t=>I(t),[w+k]:(t,e)=>K(I(t),t.getDay(),U(e)),[k]:(t,e)=>K(1,t.getDay(),U(e))},Q={[_]:t=>3*t,[w]:(t,e)=>K(t,0,U(e))};function tt(t,e){return J(t,e||1,Z,Q,q)}const et={[x]:t=>t.getUTCFullYear(),[_]:t=>Math.floor(t.getUTCMonth()/3),[O]:t=>t.getUTCMonth(),[j]:t=>t.getUTCDate(),[A]:t=>t.getUTCHours(),[D]:t=>t.getUTCMinutes(),[M]:t=>t.getUTCSeconds(),[S]:t=>t.getUTCMilliseconds(),[E]:t=>H(t),[w]:t=>G(t),[k]:(t,e)=>K(1,t.getUTCDay(),V(e)),[w+k]:(t,e)=>K(G(t),t.getUTCDay(),V(e))},nt={[_]:t=>3*t,[w]:(t,e)=>K(t,0,V(e))};function rt(t,e){return J(t,e||1,et,nt,X)}const it={[x]:u.a,[_]:l.a.every(3),[O]:l.a,[w]:o.b,[j]:i.a,[k]:i.a,[E]:i.a,[A]:c.a,[D]:f.a,[M]:d.a,[S]:h.a},ot={[x]:p.a,[_]:g.a.every(3),[O]:g.a,[w]:s.b,[j]:a.a,[k]:a.a,[E]:a.a,[A]:m.a,[D]:b.a,[M]:d.a,[S]:h.a};function at(t){return it[t]}function st(t){return ot[t]}function ut(t,e,n){return t?t.offset(e,n):void 0}function lt(t,e,n){return ut(at(t),e,n)}function ct(t,e,n){return ut(st(t),e,n)}function ft(t,e,n,r){return t?t.range(e,n,r):void 0}function dt(t,e,n,r){return ft(at(t),e,n,r)}function ht(t,e,n,r){return ft(st(t),e,n,r)}const pt=[x,O,j,A,D,M,S],gt=pt.slice(0,-1),mt=gt.slice(0,-1),bt=mt.slice(0,-1),yt=bt.slice(0,-1),vt=[x,O],xt=[x],_t=[[gt,1,1e3],[gt,5,5e3],[gt,15,15e3],[gt,30,3e4],[mt,1,6e4],[mt,5,3e5],[mt,15,9e5],[mt,30,18e5],[bt,1,36e5],[bt,3,108e5],[bt,6,216e5],[bt,12,432e5],[yt,1,864e5],[[x,w],1,6048e5],[vt,1,2592e6],[vt,3,7776e6],[xt,1,31536e6]];function Ot(t){const e=t.extent,n=t.maxbins||40,i=Math.abs(Object(r.Y)(e))/n;let o,a,s=Object(y.a)(t=>t[2]).right(_t,i);return s===_t.length?(o=xt,a=Object(v.c)(e[0]/31536e6,e[1]/31536e6,n)):s?(s=_t[i/_t[s-1][2]<_t[s][2]/i?s-1:s],o=s[0],a=s[1]):(o=pt,a=Math.max(Object(v.c)(e[0],e[1],n),1)),{units:o,step:a}}},function(t,e,n){"use strict";function r(){}n.d(e,"a",(function(){return pt})),n.d(e,"b",(function(){return gt}));var i=function(t){return null==t?r:function(){return this.querySelector(t)}},o=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)};function a(){return[]}function s(t){return function(e){return e.matches(t)}}var u=Array.prototype.find;function l(){return this.firstElementChild}var c=Array.prototype.filter;function f(){return this.children}var d=function(t){return new Array(t.length)};function h(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}h.prototype={constructor:h,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var p=function(t){return function(){return t}};function g(t,e,n,r,i,o){for(var a,s=0,u=e.length,l=o.length;se?1:t>=e?0:NaN}var v="http://www.w3.org/1999/xhtml",x={svg:"http://www.w3.org/2000/svg",xhtml:v,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},_=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),x.hasOwnProperty(e)?{space:x[e],local:t}:t};function O(t){return function(){this.removeAttribute(t)}}function w(t){return function(){this.removeAttributeNS(t.space,t.local)}}function j(t,e){return function(){this.setAttribute(t,e)}}function k(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function E(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function A(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var D=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function M(t){return function(){this.style.removeProperty(t)}}function S(t,e,n){return function(){this.style.setProperty(t,e,n)}}function C(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function F(t,e){return t.style.getPropertyValue(e)||D(t).getComputedStyle(t,null).getPropertyValue(e)}function z(t){return function(){delete this[t]}}function T(t,e){return function(){this[t]=e}}function $(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function N(t){return t.trim().split(/^|\s+/)}function R(t){return t.classList||new P(t)}function P(t){this._node=t,this._names=N(t.getAttribute("class")||"")}function B(t,e){for(var n=R(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function W(){this.textContent=""}function Y(t){return function(){this.textContent=t}}function H(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function G(){this.innerHTML=""}function V(t){return function(){this.innerHTML=t}}function X(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function J(){this.nextSibling&&this.parentNode.appendChild(this)}function K(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Z(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===v&&e.documentElement.namespaceURI===v?e.createElement(t):e.createElementNS(n,t)}}function Q(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var tt=function(t){var e=_(t);return(e.local?Q:Z)(e)};function et(){return null}function nt(){var t=this.parentNode;t&&t.removeChild(this)}function rt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function it(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ot(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function at(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r=E&&(E=k+1);!(j=_[E])&&++E=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=y);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?M:"function"==typeof e?C:S)(t,e,null==n?"":n)):F(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?z:"function"==typeof e?$:T)(t,e)):this.node()[t]},classed:function(t,e){var n=N(t+"");if(arguments.length<2){for(var r=R(this.node()),i=-1,o=n.length;++i0))return a;do{a.push(o=new Date(+n)),e(n,i),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(s.count=function(e,o){return r.setTime(+e),i.setTime(+o),t(r),t(i),Math.floor(n(r,i))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(a?function(e){return a(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}},function(t,e,n){"use strict";n.d(e,"d",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"e",(function(){return s}));var r=1e3,i=6e4,o=36e5,a=864e5,s=6048e5},,function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return FONT_TYPE})),__webpack_require__.d(__webpack_exports__,"c",(function(){return positionLegend})),__webpack_require__.d(__webpack_exports__,"b",(function(){return fixChartSizing})),__webpack_require__.d(__webpack_exports__,"e",(function(){return setAxisFormatting})),__webpack_require__.d(__webpack_exports__,"d",(function(){return runFormatting}));var _d3_loader__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(2),ssf__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7),ssf__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(ssf__WEBPACK_IMPORTED_MODULE_1__);const FONT_TYPE="'Roboto', 'Noto Sans JP', 'Noto Sans CJK KR', 'Noto Sans Arabic UI', 'Noto Sans Devanagari UI', 'Noto Sans Hebre', 'Noto Sans Thai UI', 'Helvetica', 'Arial', sans-serif";function parseTransform(t){return t.split("(")[1].split(")")[0].split(",")}function positionRefLine(t,e){let n=e.x_hist||e.y_hist?".BOUNDING_BOX_group":".mark-group.role-frame.root",r=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(n).select("path").node().getBBox(),i=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(`.refLine${t}_marks`).selectChildren(),o=parseTransform(i.attr("transform"));"x"===t?(o[1]=r.height,i.attr("y2",-1*r.height).attr("transform",`translate(${o[0]},${o[1]})`)):(o[0]=0,i.attr("x2",r.width).attr("transform",`translate(${o[0]},${o[1]})`))}function positionLegend(orientation){if("right"===orientation){let legends=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.b(".mark-group.role-legend")._groups[0],baseLegend=legends[legends.length-2],lastLegend=legends[legends.length-1],translate=parseTransform(_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(baseLegend).select("g").attr("transform")),offset=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(baseLegend).select("g").node().getBBox(),legendOffset=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(lastLegend).select("g").node().getBBox();_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(lastLegend).select("g").attr("transform",`translate(${translate[0]}, ${eval(translate[1])+offset.height+legendOffset.height})`)}}function fixChartSizing(){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a("svg").style("width","100%").style("height","100%").style("position","fixed").style("preserveAspectRatio","none").style("top",0).style("bottom",0).style("right",0).style("left",0)}function setAxisFormatting(t,e,n,r=null){if("simple"===e)_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a("g.mark-text.role-axis-label").selectAll("text").each((function(t,e){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(n,t.datum.value))}));else{let e=t.x_hist||t.y_hist?".BOUNDING_BOX_group":".mark-group.role-frame.root";_d3_loader__WEBPACK_IMPORTED_MODULE_0__.b(e).selectAll(".mark-text.role-axis-label").each((function(t,e){0==e&&_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).selectAll("text").each((function(t,e){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(n,t.datum.value))})),1==e&&_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).selectAll("text").each((function(t,e){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(r,t.datum.value))}))}))}}function formatPointLegend(t,e,n,r){let i,o=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.b(".mark-group.role-legend-entry");i=r||n?!r&&n&&e?o._groups[0][0]:!n&&e||n&&!e?o._groups[0][1]:n&&e?o._groups[0][2]:o._groups[0][0]:o._groups[0][0],_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(i).selectAll("text").each((function(e,n){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(t,e.datum.value))}))}function formatCrossfilterSelection(t,e,n){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(".SCATTERPLOT_marks").selectAll("path").attr("fill",(function(e){for(let r of t){let t=r.field.replace(".","_");return r.values.indexOf(String(e.datum[t]))>=0?n:"#DEE1E5"}}))}function runFormatting(t,e,n,r,i,o){t.crossfilterEnabled&&t.crossfilters.length&&e.layer_points&&formatCrossfilterSelection(t.crossfilters,n,e.color_col),setAxisFormatting(e,"scatter",r,i),e.size&&e.layer_points&&formatPointLegend(o,void 0!==n[1],e.heatmap_off,e.x_hist||e.y_hist),e.reference_line_x&&positionRefLine("x",e),e.reference_line_y&&positionRefLine("y",e)}},function(t,e,n){var r={};!function(t){function e(t){for(var e="",n=t.length-1;n>=0;)e+=t.charAt(n--);return e}function n(t,e){for(var n="";n.length=e?r:n("0",e-r.length)+r}function i(t,e){var r=""+t;return r.length>=e?r:n(" ",e-r.length)+r}function o(t,e){var r=""+t;return r.length>=e?r:r+n(" ",e-r.length)}t.version="0.11.2";var a=Math.pow(2,32);function s(t,e){return t>a||t<-a?function(t,e){var r=""+Math.round(t);return r.length>=e?r:n("0",e-r.length)+r}(t,e):function(t,e){var r=""+t;return r.length>=e?r:n("0",e-r.length)+r}(Math.round(t),e)}function u(t,e){return e=e||0,t.length>=7+e&&103==(32|t.charCodeAt(e))&&101==(32|t.charCodeAt(e+1))&&110==(32|t.charCodeAt(e+2))&&101==(32|t.charCodeAt(e+3))&&114==(32|t.charCodeAt(e+4))&&97==(32|t.charCodeAt(e+5))&&108==(32|t.charCodeAt(e+6))}var l=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],c=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function f(t){t[0]="General",t[1]="0",t[2]="0.00",t[3]="#,##0",t[4]="#,##0.00",t[9]="0%",t[10]="0.00%",t[11]="0.00E+00",t[12]="# ?/?",t[13]="# ??/??",t[14]="m/d/yy",t[15]="d-mmm-yy",t[16]="d-mmm",t[17]="mmm-yy",t[18]="h:mm AM/PM",t[19]="h:mm:ss AM/PM",t[20]="h:mm",t[21]="h:mm:ss",t[22]="m/d/yy h:mm",t[37]="#,##0 ;(#,##0)",t[38]="#,##0 ;[Red](#,##0)",t[39]="#,##0.00;(#,##0.00)",t[40]="#,##0.00;[Red](#,##0.00)",t[45]="mm:ss",t[46]="[h]:mm:ss",t[47]="mmss.0",t[48]="##0.0E+0",t[49]="@",t[56]='"上午/下午 "hh"時"mm"分"ss"秒 "'}var d={};f(d);var h=[],p=0;for(p=5;p<=8;++p)h[p]=32+p;for(p=23;p<=26;++p)h[p]=0;for(p=27;p<=31;++p)h[p]=14;for(p=50;p<=58;++p)h[p]=14;for(p=59;p<=62;++p)h[p]=p-58;for(p=67;p<=68;++p)h[p]=p-58;for(p=72;p<=75;++p)h[p]=p-58;for(p=67;p<=68;++p)h[p]=p-57;for(p=76;p<=78;++p)h[p]=p-56;for(p=79;p<=81;++p)h[p]=p-34;var g=[];function m(t,e,n){for(var r=t<0?-1:1,i=t*r,o=0,a=1,s=0,u=1,l=0,c=0,f=Math.floor(i);le&&(l>e?(c=u,s=o):(c=l,s=a)),!n)return[0,r*s,c];var d=Math.floor(r*s/c);return[d,r*s-d*c,c]}function b(t,e,n){if(t>2958465||t<0)return null;var r=0|t,i=Math.floor(86400*(t-r)),o=0,a=[],s={D:r,T:i,u:86400*(t-r)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(s.u)<1e-6&&(s.u=0),e&&e.date1904&&(r+=1462),s.u>.9999&&(s.u=0,86400==++i&&(s.T=i=0,++r,++s.D)),60===r)a=n?[1317,10,29]:[1900,2,29],o=3;else if(0===r)a=n?[1317,8,29]:[1900,1,0],o=6;else{r>60&&--r;var u=new Date(1900,0,1);u.setDate(u.getDate()+r-1),a=[u.getFullYear(),u.getMonth()+1,u.getDate()],o=u.getDay(),r<60&&(o=(o+6)%7),n&&(o=function(t,e){e[0]-=581;var n=t.getDay();t<60&&(n=(n+6)%7);return n}(u,a))}return s.y=a[0],s.m=a[1],s.d=a[2],s.S=i%60,i=Math.floor(i/60),s.M=i%60,i=Math.floor(i/60),s.H=i,s.q=o,s}g[5]=g[63]='"$"#,##0_);\\("$"#,##0\\)',g[6]=g[64]='"$"#,##0_);[Red]\\("$"#,##0\\)',g[7]=g[65]='"$"#,##0.00_);\\("$"#,##0.00\\)',g[8]=g[66]='"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',g[41]='_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',g[42]='_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',g[43]='_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',g[44]='_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)',t.parse_date_code=b;var y=new Date(1899,11,31,0,0,0),v=y.getTime(),x=new Date(1900,2,1,0,0,0);function _(t,e){var n=t.getTime();return e?n-=1262304e5:t>=x&&(n+=864e5),(n-(v+6e4*(t.getTimezoneOffset()-y.getTimezoneOffset())))/864e5}t._general_int=function(t){return t.toString(10)};var O=function(){var t=/(?:\.0*|(\.\d*[1-9])0+)$/;function e(e){return-1==e.indexOf(".")?e:e.replace(t,"$1")}var n=/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,r=/(E[+-])(\d)$/;return function(t){var i,o=Math.floor(Math.log(Math.abs(t))*Math.LOG10E);return i=o>=-4&&o<=-1?t.toPrecision(10+o):Math.abs(o)<=9?function(t){var n=t<0?12:11,r=e(t.toFixed(12));return r.length<=n||(r=t.toPrecision(10)).length<=n?r:t.toExponential(5)}(t):10===o?t.toFixed(10).substr(0,12):function(t){var n=e(t.toFixed(11));return n.length>(t<0?12:11)||"0"===n||"-0"===n?t.toPrecision(6):n}(t),e(function(t){return-1==t.indexOf("E")?t:t.replace(n,"$1E").replace(r,"$10$2")}(i.toUpperCase()))}}();function w(t,e){switch(typeof t){case"string":return t;case"boolean":return t?"TRUE":"FALSE";case"number":return(0|t)===t?t.toString(10):O(t);case"undefined":return"";case"object":if(null==t)return"";if(t instanceof Date)return T(14,_(t,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+t)}t._general_num=O,t._general=w;"๐๑๒๓๔๕๖๗๘๙".split("");function j(t,e,n,i){var o,a="",s=0,u=0,f=n.y,d=0;switch(t){case 98:f=n.y+543;case 121:switch(e.length){case 1:case 2:o=f%100,d=2;break;default:o=f%1e4,d=4}break;case 109:switch(e.length){case 1:case 2:o=n.m,d=e.length;break;case 3:return c[n.m-1][1];case 5:return c[n.m-1][0];default:return c[n.m-1][2]}break;case 100:switch(e.length){case 1:case 2:o=n.d,d=e.length;break;case 3:return l[n.q][0];default:return l[n.q][1]}break;case 104:switch(e.length){case 1:case 2:o=1+(n.H+11)%12,d=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:o=n.H,d=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:o=n.M,d=e.length;break;default:throw"bad minute format: "+e}break;case 115:if("s"!=e&&"ss"!=e&&".0"!=e&&".00"!=e&&".000"!=e)throw"bad second format: "+e;return 0!==n.u||"s"!=e&&"ss"!=e?(u=i>=2?3===i?1e3:100:1===i?10:1,(s=Math.round(u*(n.S+n.u)))>=60*u&&(s=0),"s"===e?0===s?"0":""+s/u:(a=r(s,2+i),"ss"===e?a.substr(0,2):"."+a.substr(2,e.length-1))):r(n.S,e.length);case 90:switch(e){case"[h]":case"[hh]":o=24*n.D+n.H;break;case"[m]":case"[mm]":o=60*(24*n.D+n.H)+n.M;break;case"[s]":case"[ss]":o=60*(60*(24*n.D+n.H)+n.M)+Math.round(n.S+n.u);break;default:throw"bad abstime format: "+e}d=3===e.length?1:2;break;case 101:o=f,d=1}return d>0?r(o,d):""}function k(t){if(t.length<=3)return t;for(var e=t.length%3,n=t.substr(0,e);e!=t.length;e+=3)n+=(n.length>0?",":"")+t.substr(e,3);return n}var E=function(){var t=/%/g;var a=/# (\?+)( ?)\/( ?)(\d+)/;var u=/^#*0*\.([0#]+)/,l=/\).*[0#]/,c=/\(###\) ###\\?-####/;function f(t){for(var e,n="",r=0;r!=t.length;++r)switch(e=t.charCodeAt(r)){case 35:break;case 63:n+=" ";break;case 48:n+="0";break;default:n+=String.fromCharCode(e)}return n}function d(t,e){var n=Math.pow(10,e);return""+Math.round(t*n)/n}function h(t,e){var n=t-Math.floor(t),r=Math.pow(10,e);return e<(""+Math.round(n*r)).length?0:Math.round(n*r)}function p(g,b,y){if(40===g.charCodeAt(0)&&!b.match(l)){var v=b.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return y>=0?p("n",v,y):"("+p("n",v,-y)+")"}if(44===b.charCodeAt(b.length-1))return function(t,e,n){for(var r=e.length-1;44===e.charCodeAt(r-1);)--r;return E(t,e.substr(0,r),n/Math.pow(10,3*(e.length-r)))}(g,b,y);if(-1!==b.indexOf("%"))return function(e,r,i){var o=r.replace(t,""),a=r.length-o.length;return E(e,o,i*Math.pow(10,2*a))+n("%",a)}(g,b,y);if(-1!==b.indexOf("E"))return function t(e,n){var r,i=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==n)return"0.0E+0";if(n<0)return"-"+t(e,-n);var o=e.indexOf(".");-1===o&&(o=e.indexOf("E"));var a=Math.floor(Math.log(n)*Math.LOG10E)%o;if(a<0&&(a+=o),-1===(r=(n/Math.pow(10,a)).toPrecision(i+1+(o+a)%o)).indexOf("e")){var s=Math.floor(Math.log(n)*Math.LOG10E);for(-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+a):r+="E+"+(s-a);"0."===r.substr(0,2);)r=(r=r.charAt(0)+r.substr(2,o)+"."+r.substr(2+o)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(t,e,n,r){return e+n+r.substr(0,(o+a)%o)+"."+r.substr(a)+"E"}))}else r=n.toExponential(i);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}(b,y);if(36===b.charCodeAt(0))return"$"+p(g,b.substr(" "==b.charAt(1)?2:1),y);var x,_,O,w,j=Math.abs(y),A=y<0?"-":"";if(b.match(/^00+$/))return A+s(j,b.length);if(b.match(/^[#?]+$/))return"0"===(x=s(y,0))&&(x=""),x.length>b.length?x:f(b.substr(0,b.length-x.length))+x;if(_=b.match(a))return function(t,e,o){var a=parseInt(t[4],10),s=Math.round(e*a),u=Math.floor(s/a),l=s-u*a,c=a;return o+(0===u?"":""+u)+" "+(0===l?n(" ",t[1].length+1+t[4].length):i(l,t[1].length)+t[2]+"/"+t[3]+r(c,t[4].length))}(_,j,A);if(b.match(/^#+0+$/))return A+s(j,b.length-b.indexOf("0"));if(_=b.match(u))return x=d(y,_[1].length).replace(/^([^\.]+)$/,"$1."+f(_[1])).replace(/\.$/,"."+f(_[1])).replace(/\.(\d*)$/,(function(t,e){return"."+e+n("0",f(_[1]).length-e.length)})),-1!==b.indexOf("0.")?x:x.replace(/^0\./,".");if(b=b.replace(/^#+([0.])/,"$1"),_=b.match(/^(0*)\.(#*)$/))return A+d(j,_[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,_[1].length?"0.":".");if(_=b.match(/^#{1,3},##0(\.?)$/))return A+k(s(j,0));if(_=b.match(/^#,##0\.([#0]*0)$/))return y<0?"-"+p(g,b,-y):k(""+(Math.floor(y)+function(t,e){return e<(""+Math.round((t-Math.floor(t))*Math.pow(10,e))).length?1:0}(y,_[1].length)))+"."+r(h(y,_[1].length),_[1].length);if(_=b.match(/^#,#*,#0/))return p(g,b.replace(/^#,#*,/,""),y);if(_=b.match(/^([0#]+)(\\?-([0#]+))+$/))return x=e(p(g,b.replace(/[\\-]/g,""),y)),O=0,e(e(b.replace(/\\/g,"")).replace(/[0#]/g,(function(t){return O-2147483648?""+(t>=0?0|t:t-1|0):""+Math.floor(t)}(y)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(t){return"00,"+(t.length<3?r(0,3-t.length):"")+t}))+"."+r(O,_[1].length);switch(b){case"###,##0.00":return p(g,"#,##0.00",y);case"###,###":case"##,###":case"#,###":var C=k(s(j,0));return"0"!==C?A+C:"";case"###,###.00":return p(g,"###,##0.00",y).replace(/^0\./,".");case"#,###.00":return p(g,"#,##0.00",y).replace(/^0\./,".")}throw new Error("unsupported format |"+b+"|")}function g(s,d,h){if(40===s.charCodeAt(0)&&!d.match(l)){var p=d.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return h>=0?g("n",p,h):"("+g("n",p,-h)+")"}if(44===d.charCodeAt(d.length-1))return function(t,e,n){for(var r=e.length-1;44===e.charCodeAt(r-1);)--r;return E(t,e.substr(0,r),n/Math.pow(10,3*(e.length-r)))}(s,d,h);if(-1!==d.indexOf("%"))return function(e,r,i){var o=r.replace(t,""),a=r.length-o.length;return E(e,o,i*Math.pow(10,2*a))+n("%",a)}(s,d,h);if(-1!==d.indexOf("E"))return function t(e,n){var r,i=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==n)return"0.0E+0";if(n<0)return"-"+t(e,-n);var o=e.indexOf(".");-1===o&&(o=e.indexOf("E"));var a=Math.floor(Math.log(n)*Math.LOG10E)%o;if(a<0&&(a+=o),!(r=(n/Math.pow(10,a)).toPrecision(i+1+(o+a)%o)).match(/[Ee]/)){var s=Math.floor(Math.log(n)*Math.LOG10E);-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+a):r+="E+"+(s-a),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(t,e,n,r){return e+n+r.substr(0,(o+a)%o)+"."+r.substr(a)+"E"}))}else r=n.toExponential(i);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}(d,h);if(36===d.charCodeAt(0))return"$"+g(s,d.substr(" "==d.charAt(1)?2:1),h);var b,y,v,x,_=Math.abs(h),O=h<0?"-":"";if(d.match(/^00+$/))return O+r(_,d.length);if(d.match(/^[#?]+$/))return b=""+h,0===h&&(b=""),b.length>d.length?b:f(d.substr(0,d.length-b.length))+b;if(y=d.match(a))return function(t,e,r){return r+(0===e?"":""+e)+n(" ",t[1].length+2+t[4].length)}(y,_,O);if(d.match(/^#+0+$/))return O+r(_,d.length-d.indexOf("0"));if(y=d.match(u))return b=(b=(""+h).replace(/^([^\.]+)$/,"$1."+f(y[1])).replace(/\.$/,"."+f(y[1]))).replace(/\.(\d*)$/,(function(t,e){return"."+e+n("0",f(y[1]).length-e.length)})),-1!==d.indexOf("0.")?b:b.replace(/^0\./,".");if(d=d.replace(/^#+([0.])/,"$1"),y=d.match(/^(0*)\.(#*)$/))return O+(""+_).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,y[1].length?"0.":".");if(y=d.match(/^#{1,3},##0(\.?)$/))return O+k(""+_);if(y=d.match(/^#,##0\.([#0]*0)$/))return h<0?"-"+g(s,d,-h):k(""+h)+"."+n("0",y[1].length);if(y=d.match(/^#,#*,#0/))return g(s,d.replace(/^#,#*,/,""),h);if(y=d.match(/^([0#]+)(\\?-([0#]+))+$/))return b=e(g(s,d.replace(/[\\-]/g,""),h)),v=0,e(e(d.replace(/\\/g,"")).replace(/[0#]/g,(function(t){return v-1||"\\"==n&&"-"==t.charAt(e+1)&&"0#".indexOf(t.charAt(e+2))>-1););break;case"?":for(;t.charAt(++e)===n;);break;case"*":++e," "!=t.charAt(e)&&"*"!=t.charAt(e)||++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e-1;);break;case" ":default:++e}return!1}function S(t,e,n,r){for(var i,o,a,s=[],l="",c=0,f="",d="t",h="H";c=12?"P":"A"),m.t="T",h="h",c+=3):"AM/PM"===t.substr(c,5).toUpperCase()?(null!=i&&(m.v=i.H>=12?"PM":"AM"),m.t="T",c+=5,h="h"):"上午/下午"===t.substr(c,5).toUpperCase()?(null!=i&&(m.v=i.H>=12?"下午":"上午"),m.t="T",c+=5,h="h"):(m.t="t",++c),null==i&&"T"===m.t)return"";s[s.length]=m,d=f;break;case"[":for(l=f;"]"!==t.charAt(c++)&&c-1&&(l=(l.match(/\$([^-\[\]]*)/)||[])[1]||"$",M(t)||(s[s.length]={t:"t",v:l}));break;case".":if(null!=i){for(l=f;++c-1;)l+=f;s[s.length]={t:"n",v:l};break;case"?":for(l=f;t.charAt(++c)===f;)l+=f;s[s.length]={t:f,v:l},d=f;break;case"*":++c," "!=t.charAt(c)&&"*"!=t.charAt(c)||++c;break;case"(":case")":s[s.length]={t:1===r?"t":f,v:f},++c;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(l=f;c-1;)l+=t.charAt(c);s[s.length]={t:"D",v:l};break;case" ":s[s.length]={t:f,v:f},++c;break;case"$":s[s.length]={t:"t",v:"$"},++c;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(f))throw new Error("unrecognized character "+f+" in "+t);s[s.length]={t:"t",v:f},++c}var y,v=0,x=0;for(c=s.length-1,d="t";c>=0;--c)switch(s[c].t){case"h":case"H":s[c].t=h,d="h",v<1&&(v=1);break;case"s":(y=s[c].v.match(/\.0+$/))&&(x=Math.max(x,y[0].length-1)),v<3&&(v=3);case"d":case"y":case"M":case"e":d=s[c].t;break;case"m":"s"===d&&(s[c].t="M",v<2&&(v=2));break;case"X":break;case"Z":v<1&&s[c].v.match(/[Hh]/)&&(v=1),v<2&&s[c].v.match(/[Mm]/)&&(v=2),v<3&&s[c].v.match(/[Ss]/)&&(v=3)}switch(v){case 0:break;case 1:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M),i.M>=60&&(i.M=0,++i.H);break;case 2:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M)}var _,O="";for(c=0;c0){40==O.charCodeAt(0)?(k=e<0&&45===O.charCodeAt(0)?-e:e,A=E("n",O,k)):(A=E("n",O,k=e<0&&r>1?-e:e),k<0&&s[0]&&"t"==s[0].t&&(A=A.substr(1),s[0].v="-"+s[0].v)),_=A.length-1;var C=s.length;for(c=0;c-1){C=c;break}var F=s.length;if(C===s.length&&-1===A.indexOf("E")){for(c=s.length-1;c>=0;--c)null!=s[c]&&-1!=="n?".indexOf(s[c].t)&&(_>=s[c].v.length-1?(_-=s[c].v.length,s[c].v=A.substr(_+1,s[c].v.length)):_<0?s[c].v="":(s[c].v=A.substr(0,_+1),_=-1),s[c].t="t",F=c);_>=0&&F=0;--c)if(null!=s[c]&&-1!=="n?".indexOf(s[c].t)){for(o=s[c].v.indexOf(".")>-1&&c===C?s[c].v.indexOf(".")-1:s[c].v.length-1,S=s[c].v.substr(o+1);o>=0;--o)_>=0&&("0"===s[c].v.charAt(o)||"#"===s[c].v.charAt(o))&&(S=A.charAt(_--)+S);s[c].v=S,s[c].t="t",F=c}for(_>=0&&F-1&&c===C?s[c].v.indexOf(".")+1:0,S=s[c].v.substr(0,o);o-1&&(k=r>1&&e<0&&c>0&&"-"===s[c-1].v?-e:e,s[c].v=E(s[c].t,s[c].v,k),s[c].t="t");var z="";for(c=0;c!==s.length;++c)null!=s[c]&&(z+=s[c].v);return z}t.is_date=M,t._eval=S;var C=/\[[=<>]/,F=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function z(t,e){if(null==e)return!1;var n=parseFloat(e[2]);switch(e[1]){case"=":if(t==n)return!0;break;case">":if(t>n)return!0;break;case"<":if(t":if(t!=n)return!0;break;case">=":if(t>=n)return!0;break;case"<=":if(t<=n)return!0}return!1}function T(t,e,n){null==n&&(n={});var r="";switch(typeof t){case"string":r="m/d/yy"==t&&n.dateNF?n.dateNF:t;break;case"number":null==(r=14==t&&n.dateNF?n.dateNF:(null!=n.table?n.table:d)[t])&&(r=n.table&&n.table[h[t]]||d[h[t]]),null==r&&(r=g[t]||"General")}if(u(r,0))return w(e,n);e instanceof Date&&(e=_(e,n.date1904));var i=function(t,e){var n=A(t),r=n.length,i=n[r-1].indexOf("@");if(r<4&&i>-1&&--r,n.length>4)throw new Error("cannot find right format for |"+n.join("|")+"|");if("number"!=typeof e)return[4,4===n.length||i>-1?n[n.length-1]:"@"];switch(n.length){case 1:n=i>-1?["General","General","General",n[0]]:[n[0],n[0],n[0],"@"];break;case 2:n=i>-1?[n[0],n[0],n[0],n[1]]:[n[0],n[1],n[0],"@"];break;case 3:n=i>-1?[n[0],n[1],n[0],n[2]]:[n[0],n[1],n[2],"@"]}var o=e>0?n[0]:e<0?n[1]:n[2];if(-1===n[0].indexOf("[")&&-1===n[1].indexOf("["))return[r,o];if(null!=n[0].match(C)||null!=n[1].match(C)){var a=n[0].match(F),s=n[1].match(F);return z(e,a)?[r,n[0]]:z(e,s)?[r,n[1]]:[r,n[null!=a&&null!=s?2:1]]}return[r,o]}(r,e);if(u(i[1]))return w(e,n);if(!0===e)e="TRUE";else if(!1===e)e="FALSE";else if(""===e||null==e)return"";return S(i[1],e,n,i[0])}function $(t,e){if("number"!=typeof e){e=+e||-1;for(var n=0;n<392;++n)if(null!=d[n]){if(d[n]==t){e=n;break}}else e<0&&(e=n);e<0&&(e=391)}return d[e]=t,e}t.load=$,t._table=d,t.get_table=function(){return d},t.load_table=function(t){for(var e=0;392!=e;++e)void 0!==t[e]&&$(t[e],e)},t.init_table=f,t.format=T}(r),"undefined"==typeof DO_NOT_EXPORT_SSF&&(t.exports=r)},function(t,e,n){const r=n(30),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=n(29),{re:a,t:s}=n(19),{compareIdentifiers:u}=n(39);class l{constructor(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof l){if(t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>i)throw new TypeError(`version is longer than ${i} characters`);r("SemVer",t,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;const n=t.trim().match(e.loose?a[s.LOOSE]:a[s.FULL]);if(!n)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this}}t.exports=l},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"e",(function(){return winsorize})),__webpack_require__.d(__webpack_exports__,"b",(function(){return handleErrors})),__webpack_require__.d(__webpack_exports__,"d",(function(){return prepareData})),__webpack_require__.d(__webpack_exports__,"c",(function(){return makeBins})),__webpack_require__.d(__webpack_exports__,"a",(function(){return getPercentile}));var percentile__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(48),percentile__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(percentile__WEBPACK_IMPORTED_MODULE_0__),ssf__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7),ssf__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(ssf__WEBPACK_IMPORTED_MODULE_1__);function winsorize(myData,field,p){if(void 0===p)return;p=p.split("_").map(e=>eval(e));let thresholds=percentile__WEBPACK_IMPORTED_MODULE_0___default()(p,myData.map(t=>t[field]));return myData.map(t=>{let e=Object.assign({},t);return e[field]<=thresholds[0]?e[field]=thresholds[0]:t[field]>=thresholds[1]&&(e[field]=thresholds[1]),e})}function handleErrors(t,e,n){const r=(e,n,r,i,o)=>!(!t.addError||!t.clearErrors)&&(ro?(t.addError({title:`Too Many ${n}s`,message:`This visualization requires ${i===o?"exactly":"no more than"} ${o} ${n.toLowerCase()}${1===i?"":"s"}.`,group:e}),!1):(t.clearErrors(e),!0)),{pivots:i,dimension_like:o,measure_like:a}=e.fields;return r("pivot-req","Pivot",i.length,n.min_pivots,n.max_pivots)&&r("dim-req","Dimension",o.length,n.min_dimensions,n.max_dimensions)&&r("mes-req","Measure",a.length,n.min_measures,n.max_measures)}function prepareData(t,e){var n,r=[],i={},o=[],a=[];for(var s in t){var u=t[s],l={links:[]};for(var c in u){if(l[c.replace(".","_")]=u[c].value,void 0!==u[c].links){for(var f=0;ft[field]).sort((t,e)=>t-e),breakpoints=breakpointsArray.split(",").map(e=>{switch(e.trim()){case"min":return orderedArray[0];case"max":return orderedArray[orderedArray.length-1];default:return eval(e)}});for(let t=0;te>breakpoints[t+1]);-1===e&&(e=orderedArray.length);let n=orderedArray.splice(0,e).length;preBin.push({}),preBin[t]["bin_start_"+axis]=breakpoints[t],preBin[t]["bin_end_"+axis]=breakpoints[t+1],preBin[t]["count_"+axis]=n,preBin[t].label=`${ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(valFormat,preBin[t]["bin_start_"+axis])} - ${ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(valFormat,preBin[t]["bin_end_"+axis])}`,preBin[t].order=t+1}return preBin}function getPercentile(t,e,n){return percentile__WEBPACK_IMPORTED_MODULE_0___default()(t,n.map(t=>t[e]).filter(t=>null!==t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return D})),n.d(e,"b",(function(){return A})),n.d(e,"c",(function(){return x})),n.d(e,"d",(function(){return M})),n.d(e,"e",(function(){return k}));var r=n(51),i=n(27),o=n(104),a=n(105),s=n(106),u=n(64),l=n(50),c=n(1),f=n(0),d=n(36),h=n(47);function p(t){const e={};return n=>e[n]||(e[n]=t(n))}function g(t){const e=p(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=Object(i.a)(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return r=e(n),o=e(".1f")(1)[1],t=>{const e=r(t),n=e.indexOf(o);if(n<0)return e;let i=function(t,e){let n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if(n=t.charCodeAt(r),n>=48&&n<=57)return r+1}(e,n);const a=in;)if("0"!==e[i]){++i;break}return e.slice(0,i)+a}}return e(n);var r,o},formatSpan(t,u,l,c){c=Object(i.a)(null==c?",f":c);const f=Object(r.c)(t,u,l),d=Math.max(Math.abs(t),Math.abs(u));let h;if(null==c.precision)switch(c.type){case"s":return isNaN(h=Object(o.a)(f,d))||(c.precision=h),n(c,d);case"":case"e":case"g":case"p":case"r":isNaN(h=Object(a.a)(f,d))||(c.precision=h-("e"===c.type));break;case"f":case"%":isNaN(h=Object(s.a)(f))||(c.precision=h-2*("%"===c.type))}return e(c)}}}let m,b;function y(){return m=g({format:u.a,formatPrefix:u.b})}function v(t){return g(Object(l.a)(t))}function x(t){return arguments.length?m=v(t):m}function _(t,e,n){n=n||{},Object(f.G)(n)||Object(f.o)("Invalid time multi-format specifier: ".concat(n));const r=e(c.i),i=e(c.f),o=e(c.d),a=e(c.a),s=e(c.k),u=e(c.g),l=e(c.h),d=e(c.l),h=t(n[c.e]||".%L"),p=t(n[c.i]||":%S"),g=t(n[c.f]||"%I:%M"),m=t(n[c.d]||"%I %p"),b=t(n[c.a]||n[c.b]||"%a %d"),y=t(n[c.k]||"%b %d"),v=t(n[c.g]||"%B"),x=t(n[c.h]||"%B"),_=t(n[c.l]||"%Y");return t=>(r(t)Object(f.I)(t)?e(t):_(e,c.p,t),utcFormat:t=>Object(f.I)(t)?n(t):_(n,c.v,t),timeParse:p(t.parse),utcParse:p(t.utcParse)}}function w(){return b=O({format:d.a,parse:d.b,utcFormat:d.c,utcParse:d.d})}function j(t){return O(Object(h.a)(t))}function k(t){return arguments.length?b=j(t):b}y(),w();const E=(t,e)=>Object(f.p)({},t,e);function A(t,e){const n=t?v(t):x(),r=e?j(e):k();return E(n,r)}function D(t,e){const n=arguments.length;return n&&2!==n&&Object(f.o)("defaultLocale expects either zero or two arguments."),n?E(x(t),k(e)):E(x(),k())}function M(){return y(),w(),D()}},function(t,e,n){const r=n(8);t.exports=(t,e,n)=>new r(t,n).compare(new r(e,n))},function(t,e,n){class r{constructor(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof r)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new r(t.raw,e);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(t=>this.parseRange(t.trim())).filter(t=>t.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){const e=this.options.loose;t=t.trim();const n=e?s[u.HYPHENRANGELOOSE]:s[u.HYPHENRANGE];t=t.replace(n,w(this.options.includePrerelease)),o("hyphen replace",t),t=t.replace(s[u.COMPARATORTRIM],l),o("comparator trim",t,s[u.COMPARATORTRIM]),t=(t=(t=t.replace(s[u.TILDETRIM],c)).replace(s[u.CARETTRIM],f)).split(/\s+/).join(" ");const r=e?s[u.COMPARATORLOOSE]:s[u.COMPARATOR];return t.split(" ").map(t=>h(t,this.options)).join(" ").split(/\s+/).map(t=>O(t,this.options)).filter(this.options.loose?t=>!!t.match(r):()=>!0).map(t=>new i(t,this.options))}intersects(t,e){if(!(t instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>d(n,e)&&t.set.some(t=>d(t,e)&&n.every(n=>t.every(t=>n.intersects(t,e)))))}test(t){if(!t)return!1;if("string"==typeof t)try{t=new a(t,this.options)}catch(t){return!1}for(let e=0;e{let n=!0;const r=t.slice();let i=r.pop();for(;n&&r.length;)n=r.every(t=>i.intersects(t,e)),i=r.pop();return n},h=(t,e)=>(o("comp",t,e),t=b(t,e),o("caret",t),t=g(t,e),o("tildes",t),t=v(t,e),o("xrange",t),t=_(t,e),o("stars",t),t),p=t=>!t||"x"===t.toLowerCase()||"*"===t,g=(t,e)=>t.trim().split(/\s+/).map(t=>m(t,e)).join(" "),m=(t,e)=>{const n=e.loose?s[u.TILDELOOSE]:s[u.TILDE];return t.replace(n,(e,n,r,i,a)=>{let s;return o("tilde",t,e,n,r,i,a),p(n)?s="":p(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:p(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o("replaceTilde pr",a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",s),s})},b=(t,e)=>t.trim().split(/\s+/).map(t=>y(t,e)).join(" "),y=(t,e)=>{o("caret",t,e);const n=e.loose?s[u.CARETLOOSE]:s[u.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(e,n,i,a,s)=>{let u;return o("caret",t,e,n,i,a,s),p(n)?u="":p(i)?u=`>=${n}.0.0${r} <${+n+1}.0.0-0`:p(a)?u="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o("replaceCaret pr",s),u="0"===n?"0"===i?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o("no pr"),u="0"===n?"0"===i?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o("caret return",u),u})},v=(t,e)=>(o("replaceXRanges",t,e),t.split(/\s+/).map(t=>x(t,e)).join(" ")),x=(t,e)=>{t=t.trim();const n=e.loose?s[u.XRANGELOOSE]:s[u.XRANGE];return t.replace(n,(n,r,i,a,s,u)=>{o("xRange",t,n,r,i,a,s,u);const l=p(i),c=l||p(a),f=c||p(s),d=f;return"="===r&&d&&(r=""),u=e.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(a=0),s=0,">"===r?(r=">=",c?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",c?i=+i+1:a=+a+1),"<"===r&&(u="-0"),n=`${r+i}.${a}.${s}${u}`):c?n=`>=${i}.0.0${u} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${a}.0${u} <${i}.${+a+1}.0-0`),o("xRange return",n),n})},_=(t,e)=>(o("replaceStars",t,e),t.trim().replace(s[u.STAR],"")),O=(t,e)=>(o("replaceGTE0",t,e),t.trim().replace(s[e.includePrerelease?u.GTE0PRE:u.GTE0],"")),w=t=>(e,n,r,i,o,a,s,u,l,c,f,d,h)=>`${n=p(r)?"":p(i)?`>=${r}.0.0${t?"-0":""}`:p(o)?`>=${r}.${i}.0${t?"-0":""}`:a?">="+n:`>=${n}${t?"-0":""}`} ${u=p(l)?"":p(c)?`<${+l+1}.0.0-0`:p(f)?`<${l}.${+c+1}.0-0`:d?`<=${l}.${c}.${f}-${d}`:t?`<${l}.${c}.${+f+1}-0`:"<="+u}`.trim(),j=(t,e,n)=>{for(let n=0;n0){const r=t[n].semver;if(r.major===e.major&&r.minor===e.minor&&r.patch===e.patch)return!0}return!1}return!0}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return c}));var r=n(3),i=n(4);function o(t){return Object(r.a)((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.c)/i.e}))}var a=o(0),s=o(1),u=o(2),l=o(3),c=o(4),f=o(5),d=o(6);a.range,s.range,u.range,l.range,c.range,f.range,d.range},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return c}));var r=n(3),i=n(4);function o(t){return Object(r.a)((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/i.e}))}var a=o(0),s=o(1),u=o(2),l=o(3),c=o(4),f=o(5),d=o(6);a.range,s.range,u.range,l.range,c.range,f.range,d.range},function(t,e,n){"use strict";var r=n(17);e.a=function(t){return(t=Object(r.b)(Math.abs(t)))?t[1]:NaN}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return A})),n.d(e,"b",(function(){return D})),n.d(e,"c",(function(){return x})),n.d(e,"d",(function(){return _})),n.d(e,"e",(function(){return C})),n.d(e,"f",(function(){return S})),n.d(e,"g",(function(){return M})),n.d(e,"h",(function(){return b}));var r=n(0),i=n(107),o=n(49),a=n(10);const s=/^([A-Za-z]+:)?\/\//,u=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,l=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;async function c(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function f(t,e){e=Object(r.p)({},this.options,e);const n=this.fileAccess,i={href:null};let o,a,c;const f=u.test(t.replace(l,""));null!=t&&"string"==typeof t&&f||Object(r.o)("Sanitize failure, invalid URI: "+Object(r.ab)(t));const d=s.test(t);return(c=e.baseURL)&&!d&&(t.startsWith("/")||"/"===c[c.length-1]||(t="/"+t),t=c+t),a=(o=t.startsWith("file://"))||"file"===e.mode||"http"!==e.mode&&!d&&n,o?t=t.slice("file://".length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),a=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(i,"localFile",{value:!!a}),i.href=t,e.target&&(i.target=e.target+""),e.rel&&(i.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(i.crossOrigin=e.crossOrigin+""),i}function d(t){return t?e=>new Promise((n,r)=>{t.readFile(e,(t,e)=>{t?r(t):n(e)})}):h}async function h(){Object(r.o)("No file system access.")}function p(t){return t?async function(e,n){const i=Object(r.p)({},this.options.http,n),o=n&&n.response,a=await t(e,i);return a.ok?Object(r.E)(a[o])?a[o]():a.text():Object(r.o)(a.status+""+a.statusText)}:g}async function g(){Object(r.o)("No HTTP fetch method available.")}const m=t=>!(Number.isNaN(+t)||t instanceof Date),b={boolean:r.bb,integer:r.db,number:r.db,date:r.cb,string:r.fb,unknown:r.y},y=[t=>"true"===t||"false"===t||!0===t||!1===t,t=>m(t)&&Number.isInteger(+t),m,t=>!Number.isNaN(Date.parse(t))],v=["boolean","integer","number","date"];function x(t,e){if(!t||!t.length)return"unknown";const n=t.length,r=y.length,i=y.map((t,e)=>e+1);for(let a,s,u=0,l=0;u0===t?e:t,0)-1]}function _(t,e){return e.reduce((e,n)=>(e[n]=x(t,n),e),{})}function O(t){const e=function(e,n){const i={delimiter:t};return w(e,n?Object(r.p)(n,i):i)};return e.responseType="text",e}function w(t,e){return e.header&&(t=e.header.map(r.ab).join(e.delimiter)+"\n"+t),Object(i.a)(e.delimiter).parse(t+"")}function j(e,n){const i=n&&n.property?Object(r.u)(n.property):r.y;return!Object(r.G)(e)||(o=e,"function"==typeof t&&Object(r.E)(t.isBuffer)&&t.isBuffer(o))?i(JSON.parse(e)):function(t,e){return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(i(e),n);var o}w.responseType="text",j.responseType="json";const k={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function E(t,e){let n,i,a,s;return t=j(t,e),e&&e.feature?(n=o.a,a=e.feature):e&&e.mesh?(n=o.b,a=e.mesh,s=k[e.filter]):Object(r.o)("Missing TopoJSON feature or mesh parameter."),i=(i=t.objects[a])?n(t,i,s):Object(r.o)("Invalid TopoJSON object: "+a),i&&i.features||[i]}E.responseType="json";const A={dsv:w,csv:O(","),tsv:O("\t"),json:j,topojson:E};function D(t,e){return arguments.length>1?(A[t]=e,this):Object(r.w)(A,t)?A[t]:null}function M(t){const e=D(t);return e&&e.responseType||"text"}function S(t,e,n,i){const o=D((e=e||{}).type||"json");return o||Object(r.o)("Unknown data format type: "+e.type),t=o(t,e),e.parse&&function(t,e,n,r){if(!t.length)return;const i=Object(a.e)();n=n||i.timeParse,r=r||i.utcParse;let o,s,u,l,c,f,d=t.columns||Object.keys(t[0]);"auto"===e&&(e=_(t,d));d=Object.keys(e);const h=d.map(t=>{const i=e[t];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:"))){o=i.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1));return("utc"===o[0]?r:n)(a)}if(!b[i])throw Error("Illegal format pattern: "+t+":"+i);return b[i]});for(u=0,c=t.length,f=d.length;u({options:n||{},sanitize:f,load:c,fileAccess:!!e,file:d(e),http:p(t)})}("undefined"!=typeof fetch&&fetch,null)}).call(this,n(56).Buffer)},function(t,e,n){"use strict";function r(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}n.d(e,"b",(function(){return r})),e.a=function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}},,function(t,e,n){const{MAX_SAFE_COMPONENT_LENGTH:r}=n(29),i=n(30),o=(e=t.exports={}).re=[],a=e.src=[],s=e.t={};let u=0;const l=(t,e,n)=>{const r=u++;i(r,e),s[t]=r,a[r]=e,o[r]=new RegExp(e,n?"g":void 0)};l("NUMERICIDENTIFIER","0|[1-9]\\d*"),l("NUMERICIDENTIFIERLOOSE","[0-9]+"),l("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),l("MAINVERSION",`(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})`),l("MAINVERSIONLOOSE",`(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})`),l("PRERELEASEIDENTIFIER",`(?:${a[s.NUMERICIDENTIFIER]}|${a[s.NONNUMERICIDENTIFIER]})`),l("PRERELEASEIDENTIFIERLOOSE",`(?:${a[s.NUMERICIDENTIFIERLOOSE]}|${a[s.NONNUMERICIDENTIFIER]})`),l("PRERELEASE",`(?:-(${a[s.PRERELEASEIDENTIFIER]}(?:\\.${a[s.PRERELEASEIDENTIFIER]})*))`),l("PRERELEASELOOSE",`(?:-?(${a[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[s.PRERELEASEIDENTIFIERLOOSE]})*))`),l("BUILDIDENTIFIER","[0-9A-Za-z-]+"),l("BUILD",`(?:\\+(${a[s.BUILDIDENTIFIER]}(?:\\.${a[s.BUILDIDENTIFIER]})*))`),l("FULLPLAIN",`v?${a[s.MAINVERSION]}${a[s.PRERELEASE]}?${a[s.BUILD]}?`),l("FULL",`^${a[s.FULLPLAIN]}$`),l("LOOSEPLAIN",`[v=\\s]*${a[s.MAINVERSIONLOOSE]}${a[s.PRERELEASELOOSE]}?${a[s.BUILD]}?`),l("LOOSE",`^${a[s.LOOSEPLAIN]}$`),l("GTLT","((?:<|>)?=?)"),l("XRANGEIDENTIFIERLOOSE",a[s.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),l("XRANGEIDENTIFIER",a[s.NUMERICIDENTIFIER]+"|x|X|\\*"),l("XRANGEPLAIN",`[v=\\s]*(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:${a[s.PRERELEASE]})?${a[s.BUILD]}?)?)?`),l("XRANGEPLAINLOOSE",`[v=\\s]*(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:${a[s.PRERELEASELOOSE]})?${a[s.BUILD]}?)?)?`),l("XRANGE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAIN]}$`),l("XRANGELOOSE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAINLOOSE]}$`),l("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),l("COERCERTL",a[s.COERCE],!0),l("LONETILDE","(?:~>?)"),l("TILDETRIM",`(\\s*)${a[s.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",l("TILDE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAIN]}$`),l("TILDELOOSE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAINLOOSE]}$`),l("LONECARET","(?:\\^)"),l("CARETTRIM",`(\\s*)${a[s.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",l("CARET",`^${a[s.LONECARET]}${a[s.XRANGEPLAIN]}$`),l("CARETLOOSE",`^${a[s.LONECARET]}${a[s.XRANGEPLAINLOOSE]}$`),l("COMPARATORLOOSE",`^${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]})$|^$`),l("COMPARATOR",`^${a[s.GTLT]}\\s*(${a[s.FULLPLAIN]})$|^$`),l("COMPARATORTRIM",`(\\s*)${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]}|${a[s.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",l("HYPHENRANGE",`^\\s*(${a[s.XRANGEPLAIN]})\\s+-\\s+(${a[s.XRANGEPLAIN]})\\s*$`),l("HYPHENRANGELOOSE",`^\\s*(${a[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[s.XRANGEPLAINLOOSE]})\\s*$`),l("STAR","(<|>)?=?\\s*\\*"),l("GTE0","^\\s*>=\\s*0.0.0\\s*$"),l("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},function(t,e,n){const{MAX_LENGTH:r}=n(29),{re:i,t:o}=n(19),a=n(8);t.exports=(t,e)=>{if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof a)return t;if("string"!=typeof t)return null;if(t.length>r)return null;if(!(e.loose?i[o.LOOSE]:i[o.FULL]).test(t))return null;try{return new a(t,e)}catch(t){return null}}},function(t,e,n){"use strict";e.a=function(t,e){return te?1:t>=e?0:NaN}},function(t,e,n){"use strict";t.exports=function(t,e){e||(e={}),"function"==typeof e&&(e={cmp:e});var n,r="boolean"==typeof e.cycles&&e.cycles,i=e.cmp&&(n=e.cmp,function(t){return function(e,r){var i={key:e,value:t[e]},o={key:r,value:t[r]};return n(i,o)}}),o=[];return function t(e){if(e&&e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return JSON.stringify(e);var n,a;if(Array.isArray(e)){for(a="[",n=0;nt.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.c)/i.a,t=>t.getDate()-1);e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/i.a}),(function(t){return t.getUTCDate()-1}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=Object(r.a)((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Object(r.a)((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null},e.a=i;i.range},function(t,e,n){"use strict";var r=n(3),i=Object(r.a)((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Object(r.a)((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null},e.a=i;i.range},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(t){if(!(e=r.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}},,function(t,e){const n=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:n,MAX_SAFE_COMPONENT_LENGTH:16}},function(t,e,n){(function(e){const n="object"==typeof e&&e.env&&e.env.NODE_DEBUG&&/\bsemver\b/i.test(e.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};t.exports=n}).call(this,n(68))},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>r(t,e,n)>0},function(t,e,n){const r=Symbol("SemVer ANY");class i{static get ANY(){return r}constructor(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof i){if(t.loose===!!e.loose)return t;t=t.value}u("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(t){const e=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],n=t.match(e);if(!n)throw new TypeError("Invalid comparator: "+t);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new l(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(t){if(u("Comparator.test",t,this.options.loose),this.semver===r||t===r)return!0;if("string"==typeof t)try{t=new l(t,this.options)}catch(t){return!1}return s(t,this.operator,this.semver,this.options)}intersects(t,e){if(!(t instanceof i))throw new TypeError("a Comparator is required");if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),""===this.operator)return""===this.value||new c(t.value,e).test(this.value);if(""===t.operator)return""===t.value||new c(this.value,e).test(t.semver);const n=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),o=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),u=s(this.semver,"<",t.semver,e)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),l=s(this.semver,">",t.semver,e)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return n||r||o&&a||u||l}}t.exports=i;const{re:o,t:a}=n(19),s=n(55),u=n(30),l=n(8),c=n(12)},function(t,e,n){const r=n(12);t.exports=(t,e,n)=>{try{e=new r(e,n)}catch(t){return!1}return e.test(t)}},function(t,e,n){"use strict";var r=/("(?:[^\\"]|\\.)*")|[:,]/g;t.exports=function(t,e){var n,i,o;return e=e||{},n=JSON.stringify([1],void 0,void 0===e.indent?2:e.indent).slice(2,-3),i=""===n?1/0:void 0===e.maxLength?80:e.maxLength,o=e.replacer,function t(e,a,s){var u,l,c,f,d,h,p,g,m,b,y,v;if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0===(y=JSON.stringify(e,o)))return y;if(p=i-a.length-s,y.length<=p&&(m=y.replace(r,(function(t,e){return e||t+" "}))).length<=p)return m;if(null!=o&&(e=JSON.parse(y),o=void 0),"object"==typeof e&&null!==e){if(g=a+n,c=[],l=0,Array.isArray(e))for(b="[",u="]",p=e.length;l0)return[b,n+c.join(",\n"+g),u].join("\n"+a)}return y}(t,"",0)}},function(t,e,n){"use strict";var r=n(21);e.a=function(t){let e=t,n=t;function i(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;n(t[o],e)<0?r=o+1:i=o}return r}return 1===t.length&&(e=(e,n)=>t(e)-n,n=function(t){return(e,n)=>Object(r.a)(t(e),n)}(t)),{left:i,center:function(t,n,r,o){null==r&&(r=0),null==o&&(o=t.length);const a=i(t,n,r,o-1);return a>r&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;n(t[o],e)>0?i=o:r=o+1}return r}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s}));var r,i,o,a,s,u,l=n(47);u={dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},r=Object(l.a)(u),i=r.format,o=r.parse,a=r.utcFormat,s=r.utcParse},,,function(t,e){const n=/^[0-9]+$/,r=(t,e)=>{const r=n.test(t),i=n.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:tr(e,t)}},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>0===r(t,e,n)},function(t,e,n){const r=n(8);t.exports=(t,e,n)=>{const i=new r(t,n),o=new r(e,n);return i.compare(o)||i.compareBuild(o)}},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>r(t,e,n)<0},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>r(t,e,n)>=0},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>r(t,e,n)<=0},function(t,e,n){const r=n(8),i=n(32),{ANY:o}=i,a=n(12),s=n(33),u=n(31),l=n(42),c=n(44),f=n(43);t.exports=(t,e,n,d)=>{let h,p,g,m,b;switch(t=new r(t,d),e=new a(e,d),n){case">":h=u,p=c,g=l,m=">",b=">=";break;case"<":h=l,p=f,g=u,m="<",b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(t,e,d))return!1;for(let n=0;n{t.semver===o&&(t=new i(">=0.0.0")),a=a||t,s=s||t,h(t.semver,a.semver,d)?a=t:g(t.semver,s.semver,d)&&(s=t)}),a.operator===m||a.operator===b)return!1;if((!s.operator||s.operator===m)&&p(t,s.semver))return!1;if(s.operator===b&&g(t,s.semver))return!1}return!0}},function(t,e,n){const r=n(19);t.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(29).SEMVER_SPEC_VERSION,SemVer:n(8),compareIdentifiers:n(39).compareIdentifiers,rcompareIdentifiers:n(39).rcompareIdentifiers,parse:n(20),valid:n(69),clean:n(70),inc:n(71),diff:n(72),major:n(73),minor:n(74),patch:n(75),prerelease:n(76),compare:n(11),rcompare:n(77),compareLoose:n(78),compareBuild:n(41),sort:n(79),rsort:n(80),gt:n(31),lt:n(42),eq:n(40),neq:n(54),gte:n(43),lte:n(44),cmp:n(55),coerce:n(81),Comparator:n(32),Range:n(12),satisfies:n(33),toComparators:n(82),maxSatisfying:n(83),minSatisfying:n(84),minVersion:n(85),validRange:n(86),outside:n(45),gtr:n(87),ltr:n(88),intersects:n(89),simplifyRange:n(90),subset:n(91)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(14),i=n(24),o=n(13),a=n(23),s=n(25),u=n(26);function l(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function c(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function f(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function d(t){var e=t.dateTime,n=t.date,s=t.time,u=t.periods,d=t.days,p=t.shortDays,g=t.months,m=t.shortMonths,b=v(u),y=x(u),Z=v(d),yt=x(d),St=v(p),Ct=x(p),Ft=v(g),zt=x(g),Tt=v(m),$t=x(m),Nt={a:function(t){return p[t.getDay()]},A:function(t){return d[t.getDay()]},b:function(t){return m[t.getMonth()]},B:function(t){return g[t.getMonth()]},c:null,d:I,e:I,f:H,g:rt,G:ot,H:U,I:q,j:W,L:Y,m:G,M:V,p:function(t){return u[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Dt,s:Mt,S:X,u:J,U:K,V:Q,w:tt,W:et,x:null,X:null,y:nt,Y:it,Z:at,"%":At},Rt={a:function(t){return p[t.getUTCDay()]},A:function(t){return d[t.getUTCDay()]},b:function(t){return m[t.getUTCMonth()]},B:function(t){return g[t.getUTCMonth()]},c:null,d:st,e:st,f:dt,g:wt,G:kt,H:ut,I:lt,j:ct,L:ft,m:ht,M:pt,p:function(t){return u[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Dt,s:Mt,S:gt,u:mt,U:bt,V:vt,w:xt,W:_t,x:null,X:null,y:Ot,Y:jt,Z:Et,"%":At},Pt={a:function(t,e,n){var r=St.exec(e.slice(n));return r?(t.w=Ct.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=Z.exec(e.slice(n));return r?(t.w=yt.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=Tt.exec(e.slice(n));return r?(t.m=$t.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=Ft.exec(e.slice(n));return r?(t.m=zt.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return It(t,e,n,r)},d:C,e:C,f:R,g:A,G:E,H:z,I:z,j:F,L:N,m:S,M:T,p:function(t,e,n){var r=b.exec(e.slice(n));return r?(t.p=y.get(r[0].toLowerCase()),n+r[0].length):-1},q:M,Q:B,s:L,S:$,u:O,U:w,V:j,w:_,W:k,x:function(t,e,r){return It(t,n,e,r)},X:function(t,e,n){return It(t,s,e,n)},y:A,Y:E,Z:D,"%":P};function Bt(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in d||(d.w=1),"Z"in d?(u=(s=c(f(d.y,0,1))).getUTCDay(),s=u>4||0===u?r.a.ceil(s):Object(r.a)(s),s=i.a.offset(s,7*(d.V-1)),d.y=s.getUTCFullYear(),d.m=s.getUTCMonth(),d.d=s.getUTCDate()+(d.w+6)%7):(u=(s=l(f(d.y,0,1))).getDay(),s=u>4||0===u?o.a.ceil(s):Object(o.a)(s),s=a.a.offset(s,7*(d.V-1)),d.y=s.getFullYear(),d.m=s.getMonth(),d.d=s.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),u="Z"in d?c(f(d.y,0,1)).getUTCDay():l(f(d.y,0,1)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+7*d.W-(u+5)%7:d.w+7*d.U-(u+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,c(d)):l(d)}}function It(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=Pt[i in h?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return Nt.x=Bt(n,Nt),Nt.X=Bt(s,Nt),Nt.c=Bt(e,Nt),Rt.x=Bt(n,Rt),Rt.X=Bt(s,Rt),Rt.c=Bt(e,Rt),{format:function(t){var e=Bt(t+="",Nt);return e.toString=function(){return t},e},parse:function(t){var e=Lt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Bt(t+="",Rt);return e.toString=function(){return t},e},utcParse:function(t){var e=Lt(t+="",!0);return e.toString=function(){return t},e}}}var h={"-":"",_:" ",0:"0"},p=/^\s*\d+/,g=/^%/,m=/[\\^$*+?|[\]().{}]/g;function b(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),e]))}function _(t,e,n){var r=p.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function O(t,e,n){var r=p.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function w(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function j(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function k(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function E(t,e,n){var r=p.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function A(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function D(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function M(t,e,n){var r=p.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function S(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function C(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function F(t,e,n){var r=p.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function z(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function T(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function $(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function N(t,e,n){var r=p.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function R(t,e,n){var r=p.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function P(t,e,n){var r=g.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function B(t,e,n){var r=p.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function L(t,e,n){var r=p.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function I(t,e){return b(t.getDate(),e,2)}function U(t,e){return b(t.getHours(),e,2)}function q(t,e){return b(t.getHours()%12||12,e,2)}function W(t,e){return b(1+a.a.count(Object(s.a)(t),t),e,3)}function Y(t,e){return b(t.getMilliseconds(),e,3)}function H(t,e){return Y(t,e)+"000"}function G(t,e){return b(t.getMonth()+1,e,2)}function V(t,e){return b(t.getMinutes(),e,2)}function X(t,e){return b(t.getSeconds(),e,2)}function J(t){var e=t.getDay();return 0===e?7:e}function K(t,e){return b(o.b.count(Object(s.a)(t)-1,t),e,2)}function Z(t){var e=t.getDay();return e>=4||0===e?Object(o.c)(t):o.c.ceil(t)}function Q(t,e){return t=Z(t),b(o.c.count(Object(s.a)(t),t)+(4===Object(s.a)(t).getDay()),e,2)}function tt(t){return t.getDay()}function et(t,e){return b(o.a.count(Object(s.a)(t)-1,t),e,2)}function nt(t,e){return b(t.getFullYear()%100,e,2)}function rt(t,e){return b((t=Z(t)).getFullYear()%100,e,2)}function it(t,e){return b(t.getFullYear()%1e4,e,4)}function ot(t,e){var n=t.getDay();return b((t=n>=4||0===n?Object(o.c)(t):o.c.ceil(t)).getFullYear()%1e4,e,4)}function at(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+b(e/60|0,"0",2)+b(e%60,"0",2)}function st(t,e){return b(t.getUTCDate(),e,2)}function ut(t,e){return b(t.getUTCHours(),e,2)}function lt(t,e){return b(t.getUTCHours()%12||12,e,2)}function ct(t,e){return b(1+i.a.count(Object(u.a)(t),t),e,3)}function ft(t,e){return b(t.getUTCMilliseconds(),e,3)}function dt(t,e){return ft(t,e)+"000"}function ht(t,e){return b(t.getUTCMonth()+1,e,2)}function pt(t,e){return b(t.getUTCMinutes(),e,2)}function gt(t,e){return b(t.getUTCSeconds(),e,2)}function mt(t){var e=t.getUTCDay();return 0===e?7:e}function bt(t,e){return b(r.b.count(Object(u.a)(t)-1,t),e,2)}function yt(t){var e=t.getUTCDay();return e>=4||0===e?Object(r.c)(t):r.c.ceil(t)}function vt(t,e){return t=yt(t),b(r.c.count(Object(u.a)(t),t)+(4===Object(u.a)(t).getUTCDay()),e,2)}function xt(t){return t.getUTCDay()}function _t(t,e){return b(r.a.count(Object(u.a)(t)-1,t),e,2)}function Ot(t,e){return b(t.getUTCFullYear()%100,e,2)}function wt(t,e){return b((t=yt(t)).getUTCFullYear()%100,e,2)}function jt(t,e){return b(t.getUTCFullYear()%1e4,e,4)}function kt(t,e){var n=t.getUTCDay();return b((t=n>=4||0===n?Object(r.c)(t):r.c.ceil(t)).getUTCFullYear()%1e4,e,4)}function Et(){return"+0000"}function At(){return"%"}function Dt(t){return+t}function Mt(t){return Math.floor(+t/1e3)}},function(t,e){function n(t,e){return 0===t?e[0]:e[Math.ceil(e.length*(t/100))-1]}t.exports=function(t,e,r){var i=Array.isArray(t)?t:[t],o=function(t){return t.reduce((function(t,e){return isNaN(Number(e))?t.push(function(t){return'Expect percentile to be a number but given "'+t+'" and its type is "'+typeof t+'".'}(e)):e<0?t.push(function(t){return'Expect percentile to be >= 0 but given "'+t+'" and its type is "'+typeof t+'".'}(e)):e>100&&t.push(function(t){return'Expect percentile to be <= 100 but given "'+t+'" and its type is "'+typeof t+'".'}(e)),t}),[])}(i);if(o.length)throw new Error(o.join(" "));return e=e.slice().sort((function(t,e){return r&&(t=r(t),e=r(e)),(t=Number.isNaN(t)?Number.NEGATIVE_INFINITY:t)>(e=Number.isNaN(e)?Number.NEGATIVE_INFINITY:e)?1:t1)r=f(t,e,n);else for(i=0,r=new Array(o=t.arcs.length);ii+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},u={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:a.a,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>s(100*t,e),r:s,s:function(t,e){var n=Object(a.b)(t,e);if(!n)return t+"";var i=n[0],o=n[1],s=o-(r=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,u=i.length;return s===u?i:s>u?i+new Array(s-u+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Object(a.b)(t,Math.max(0,e+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)},l=function(t){return t},c=Array.prototype.map,f=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];e.a=function(t){var e,n,a=void 0===t.grouping||void 0===t.thousands?l:(e=c.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),s=void 0===t.currency?"":t.currency[0]+"",d=void 0===t.currency?"":t.currency[1]+"",h=void 0===t.decimal?".":t.decimal+"",p=void 0===t.numerals?l:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(c.call(t.numerals,String)),g=void 0===t.percent?"%":t.percent+"",m=void 0===t.minus?"−":t.minus+"",b=void 0===t.nan?"NaN":t.nan+"";function y(t){var e=(t=Object(o.a)(t)).fill,n=t.align,i=t.sign,l=t.symbol,c=t.zero,y=t.width,v=t.comma,x=t.precision,_=t.trim,O=t.type;"n"===O?(v=!0,O="g"):u[O]||(void 0===x&&(x=12),_=!0,O="g"),(c||"0"===e&&"="===n)&&(c=!0,e="0",n="=");var w="$"===l?s:"#"===l&&/[boxX]/.test(O)?"0"+O.toLowerCase():"",j="$"===l?d:/[%p]/.test(O)?g:"",k=u[O],E=/[defgprs%]/.test(O);function A(t){var o,s,u,l=w,d=j;if("c"===O)d=k(t)+d,t="";else{var g=(t=+t)<0||1/t<0;if(t=isNaN(t)?b:k(Math.abs(t),x),_&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),g&&0==+t&&"+"!==i&&(g=!1),l=(g?"("===i?i:m:"-"===i||"("===i?"":i)+l,d=("s"===O?f[8+r/3]:"")+d+(g&&"("===i?")":""),E)for(o=-1,s=t.length;++o(u=t.charCodeAt(o))||u>57){d=(46===u?h+t.slice(o+1):t.slice(o))+d,t=t.slice(0,o);break}}v&&!c&&(t=a(t,1/0));var A=l.length+t.length+d.length,D=A>1)+l+t+d+D.slice(A);break;default:t=D+l+t+d}return p(t)}return x=void 0===x?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),A.toString=function(){return t+""},A}return{format:y,formatPrefix:function(t,e){var n=y(((t=Object(o.a)(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Object(i.a)(e)/3))),a=Math.pow(10,-r),s=f[8+r/3];return function(t){return n(a*t)+s}}}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=Math.sqrt(50),i=Math.sqrt(10),o=Math.sqrt(2);function a(t,e,n){var a=(e-t)/Math.max(0,n),s=Math.floor(Math.log(a)/Math.LN10),u=a/Math.pow(10,s);return s>=0?(u>=r?10:u>=i?5:u>=o?2:1)*Math.pow(10,s):-Math.pow(10,-s)/(u>=r?10:u>=i?5:u>=o?2:1)}function s(t,e,n){var a=Math.abs(e-t)/Math.max(0,n),s=Math.pow(10,Math.floor(Math.log(a)/Math.LN10)),u=a/s;return u>=r?s*=10:u>=i?s*=5:u>=o&&(s*=2),e0)return[t];if((r=e0)for(t=Math.ceil(t/s),e=Math.floor(e/s),o=new Array(i=Math.ceil(e-t+1));++u0!==r(t,e,n)},function(t,e,n){const r=n(40),i=n(54),o=n(31),a=n(43),s=n(42),u=n(44);t.exports=(t,e,n,l)=>{switch(e){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof n&&(n=n.version),t===n;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof n&&(n=n.version),t!==n;case"":case"=":case"==":return r(t,n,l);case"!=":return i(t,n,l);case">":return o(t,n,l);case">=":return a(t,n,l);case"<":return s(t,n,l);case"<=":return u(t,n,l);default:throw new TypeError("Invalid operator: "+e)}}},function(t,e,n){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -var r=n(93),i=n(94),o=n(95);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return I(e).length;default:if(r)return L(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,d=0;di&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return O(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function z(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function T(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function $(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,o){return o||$(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function R(e,t,n,r,o){return o||$(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||F(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):T(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):T(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);F(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);F(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):T(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):T(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function I(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(92))},function(e,t,n){(function(t){var n=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var n,r,i;try{n=Map}catch(e){n=function(){}}try{r=Set}catch(e){r=function(){}}try{i=Promise}catch(e){i=function(){}}function o(a,u,l,c,f){"object"==typeof u&&(l=u.depth,c=u.prototype,f=u.includeNonEnumerable,u=u.circular);var d=[],h=[],p=void 0!==t;return void 0===u&&(u=!0),void 0===l&&(l=1/0),function a(l,g){if(null===l)return null;if(0===g)return l;var m,b;if("object"!=typeof l)return l;if(e(l,n))m=new n;else if(e(l,r))m=new r;else if(e(l,i))m=new i((function(e,t){l.then((function(t){e(a(t,g-1))}),(function(e){t(a(e,g-1))}))}));else if(o.__isArray(l))m=[];else if(o.__isRegExp(l))m=new RegExp(l.source,s(l)),l.lastIndex&&(m.lastIndex=l.lastIndex);else if(o.__isDate(l))m=new Date(l.getTime());else{if(p&&t.isBuffer(l))return m=t.allocUnsafe?t.allocUnsafe(l.length):new t(l.length),l.copy(m),m;e(l,Error)?m=Object.create(l):void 0===c?(b=Object.getPrototypeOf(l),m=Object.create(b)):(m=Object.create(c),b=c)}if(u){var y=d.indexOf(l);if(-1!=y)return h[y];d.push(l),h.push(m)}for(var v in e(l,n)&&l.forEach((function(e,t){var n=a(t,g-1),r=a(e,g-1);m.set(n,r)})),e(l,r)&&l.forEach((function(e){var t=a(e,g-1);m.add(t)})),l){var x;b&&(x=Object.getOwnPropertyDescriptor(b,v)),x&&null==x.set||(m[v]=a(l[v],g-1))}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(l);for(v=0;v<_.length;v++){var O=_[v];(!(j=Object.getOwnPropertyDescriptor(l,O))||j.enumerable||f)&&(m[O]=a(l[O],g-1),j.enumerable||Object.defineProperty(m,O,{enumerable:!1}))}}if(f){var w=Object.getOwnPropertyNames(l);for(v=0;v0?e>1?Object(r.a)((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):i:null},t.a=i;i.range},function(e,t,n){"use strict";var r=n(3),i=Object(r.a)((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()}));t.a=i;i.range},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r,i,o,a,s=n(50);a={thousands:",",grouping:[3],currency:["$",""]},r=Object(s.a)(a),i=r.format,o=r.formatPrefix},,,,function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,l=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&h())}function h(){if(!c){var e=s(d);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f1)for(var n=1;n{const n=r(e,t);return n?n.version:null}},function(e,t,n){const r=n(20);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},function(e,t,n){const r=n(8);e.exports=(e,t,n,i)=>{"string"==typeof n&&(i=n,n=void 0);try{return new r(e,n).inc(t,i).version}catch(e){return null}}},function(e,t,n){const r=n(20),i=n(40);e.exports=(e,t)=>{if(i(e,t))return null;{const n=r(e),i=r(t),o=n.prerelease.length||i.prerelease.length,a=o?"pre":"",s=o?"prerelease":"";for(const e in n)if(("major"===e||"minor"===e||"patch"===e)&&n[e]!==i[e])return a+e;return s}}},function(e,t,n){const r=n(8);e.exports=(e,t)=>new r(e,t).major},function(e,t,n){const r=n(8);e.exports=(e,t)=>new r(e,t).minor},function(e,t,n){const r=n(8);e.exports=(e,t)=>new r(e,t).patch},function(e,t,n){const r=n(20);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},function(e,t,n){const r=n(11);e.exports=(e,t,n)=>r(t,e,n)},function(e,t,n){const r=n(11);e.exports=(e,t)=>r(e,t,!0)},function(e,t,n){const r=n(41);e.exports=(e,t)=>e.sort((e,n)=>r(e,n,t))},function(e,t,n){const r=n(41);e.exports=(e,t)=>e.sort((e,n)=>r(n,e,t))},function(e,t,n){const r=n(8),i=n(20),{re:o,t:a}=n(19);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=o[a.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),o[a.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[a.COERCERTL].lastIndex=-1}else n=e.match(o[a.COERCE]);return null===n?null:i(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)}},function(e,t,n){const r=n(12);e.exports=(e,t)=>new r(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},function(e,t,n){const r=n(8),i=n(12);e.exports=(e,t,n)=>{let o=null,a=null,s=null;try{s=new i(t,n)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(o&&-1!==a.compare(e)||(o=e,a=new r(o,n)))}),o}},function(e,t,n){const r=n(8),i=n(12);e.exports=(e,t,n)=>{let o=null,a=null,s=null;try{s=new i(t,n)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(o&&1!==a.compare(e)||(o=e,a=new r(o,n)))}),o}},function(e,t,n){const r=n(8),i=n(12),o=n(31);e.exports=(e,t)=>{e=new i(e,t);let n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t{const t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!o(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}})}return n&&e.test(n)?n:null}},function(e,t,n){const r=n(12);e.exports=(e,t)=>{try{return new r(e,t).range||"*"}catch(e){return null}}},function(e,t,n){const r=n(45);e.exports=(e,t,n)=>r(e,t,">",n)},function(e,t,n){const r=n(45);e.exports=(e,t,n)=>r(e,t,"<",n)},function(e,t,n){const r=n(12);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t))},function(e,t,n){const r=n(33),i=n(11);e.exports=(e,t,n)=>{const o=[];let a=null,s=null;const u=e.sort((e,t)=>i(e,t,n));for(const e of u){r(e,t,n)?(s=e,a||(a=e)):(s&&o.push([a,s]),s=null,a=null)}a&&o.push([a,null]);const l=[];for(const[e,t]of o)e===t?l.push(e):t||e!==u[0]?t?e===u[0]?l.push("<="+t):l.push(`${e} - ${t}`):l.push(">="+e):l.push("*");const c=l.join(" || "),f="string"==typeof t.raw?t.raw:String(t);return c.length{if(1===e.length&&e[0].semver===i)return 1===t.length&&t[0].semver===i;const r=new Set;let s,c,f,d,h,p,g;for(const t of e)">"===t.operator||">="===t.operator?s=u(s,t,n):"<"===t.operator||"<="===t.operator?c=l(c,t,n):r.add(t.semver);if(r.size>1)return null;if(s&&c){if(f=a(s.semver,c.semver,n),f>0)return null;if(0===f&&(">="!==s.operator||"<="!==c.operator))return null}for(const e of r){if(s&&!o(e,String(s),n))return null;if(c&&!o(e,String(c),n))return null;for(const r of t)if(!o(e,String(r),n))return!1;return!0}for(const e of t){if(g=g||">"===e.operator||">="===e.operator,p=p||"<"===e.operator||"<="===e.operator,s)if(">"===e.operator||">="===e.operator){if(d=u(s,e,n),d===e)return!1}else if(">="===s.operator&&!o(s.semver,String(e),n))return!1;if(c)if("<"===e.operator||"<="===e.operator){if(h=l(c,e,n),h===e)return!1}else if("<="===c.operator&&!o(c.semver,String(e),n))return!1;if(!e.operator&&(c||s)&&0!==f)return!1}return!(s&&p&&!c&&0!==f)&&!(c&&g&&!s&&0!==f)},u=(e,t,n)=>{if(!e)return t;const r=a(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},l=(e,t,n)=>{if(!e)return t;const r=a(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n)=>{e=new r(e,n),t=new r(t,n);let i=!1;e:for(const r of e.set){for(const e of t.set){const t=s(r,e,n);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=l(e),a=r[0],s=r[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),c=0,f=s>0?a-4:a;for(n=0;n>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[c++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,o,a=[],s=t;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,f=n?i-1:0,d=n?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=l}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,l-=8);e[n+h-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r=n(97),i=n(98);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n table tr td.key {\n text-align: left;\n color: #ffffff;\n}\n\n#vg-tooltip-element > table tr td.value {\n text-align: right;\n color: #ffffff;\n}\n",""]),t.default=i},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"JsonPatchError",(function(){return S})),n.d(r,"deepClone",(function(){return C})),n.d(r,"getValueByPointer",(function(){return T})),n.d(r,"applyOperation",(function(){return $})),n.d(r,"applyPatch",(function(){return N})),n.d(r,"applyReducer",(function(){return R})),n.d(r,"validator",(function(){return P})),n.d(r,"validate",(function(){return B})),n.d(r,"_areEquals",(function(){return L}));var i={};n.r(i),n.d(i,"unobserve",(function(){return W})),n.d(i,"observe",(function(){return Y})),n.d(i,"generate",(function(){return H})),n.d(i,"compare",(function(){return V}));var o={};n.r(o),n.d(o,"aggregate",(function(){return ln})),n.d(o,"bin",(function(){return cn})),n.d(o,"collect",(function(){return dn})),n.d(o,"compare",(function(){return hn})),n.d(o,"countpattern",(function(){return gn})),n.d(o,"cross",(function(){return mn})),n.d(o,"density",(function(){return yn})),n.d(o,"dotbin",(function(){return wn})),n.d(o,"expression",(function(){return jn})),n.d(o,"extent",(function(){return En})),n.d(o,"facet",(function(){return Dn})),n.d(o,"field",(function(){return Mn})),n.d(o,"filter",(function(){return Cn})),n.d(o,"flatten",(function(){return Fn})),n.d(o,"fold",(function(){return zn})),n.d(o,"formula",(function(){return Tn})),n.d(o,"generate",(function(){return $n})),n.d(o,"impute",(function(){return Pn})),n.d(o,"joinaggregate",(function(){return Bn})),n.d(o,"kde",(function(){return Ln})),n.d(o,"key",(function(){return In})),n.d(o,"load",(function(){return qn})),n.d(o,"lookup",(function(){return Yn})),n.d(o,"multiextent",(function(){return Hn})),n.d(o,"multivalues",(function(){return Vn})),n.d(o,"params",(function(){return Jn})),n.d(o,"pivot",(function(){return Kn})),n.d(o,"prefacet",(function(){return Zn})),n.d(o,"project",(function(){return Qn})),n.d(o,"proxy",(function(){return er})),n.d(o,"quantile",(function(){return tr})),n.d(o,"relay",(function(){return nr})),n.d(o,"sample",(function(){return rr})),n.d(o,"sequence",(function(){return ir})),n.d(o,"sieve",(function(){return or})),n.d(o,"subflow",(function(){return An})),n.d(o,"timeunit",(function(){return ar})),n.d(o,"tupleindex",(function(){return ur})),n.d(o,"values",(function(){return lr})),n.d(o,"window",(function(){return pr}));var a={};n.r(a),n.d(a,"interpolate",(function(){return Go})),n.d(a,"interpolateArray",(function(){return Bo})),n.d(a,"interpolateBasis",(function(){return Eo})),n.d(a,"interpolateBasisClosed",(function(){return Ao})),n.d(a,"interpolateDate",(function(){return Io})),n.d(a,"interpolateDiscrete",(function(){return Ga})),n.d(a,"interpolateHue",(function(){return Va})),n.d(a,"interpolateNumber",(function(){return Uo})),n.d(a,"interpolateNumberArray",(function(){return Ro})),n.d(a,"interpolateObject",(function(){return qo})),n.d(a,"interpolateRound",(function(){return Vo})),n.d(a,"interpolateString",(function(){return Ho})),n.d(a,"interpolateTransformCss",(function(){return Qa})),n.d(a,"interpolateTransformSvg",(function(){return es})),n.d(a,"interpolateZoom",(function(){return ns})),n.d(a,"interpolateRgb",(function(){return zo})),n.d(a,"interpolateRgbBasis",(function(){return $o})),n.d(a,"interpolateRgbBasisClosed",(function(){return No})),n.d(a,"interpolateHsl",(function(){return is})),n.d(a,"interpolateHslLong",(function(){return os})),n.d(a,"interpolateLab",(function(){return vs})),n.d(a,"interpolateHcl",(function(){return _s})),n.d(a,"interpolateHclLong",(function(){return Os})),n.d(a,"interpolateCubehelix",(function(){return Fs})),n.d(a,"interpolateCubehelixLong",(function(){return zs})),n.d(a,"piecewise",(function(){return qa})),n.d(a,"quantize",(function(){return Ts}));var s={};n.r(s),n.d(s,"bound",(function(){return Xd})),n.d(s,"identifier",(function(){return Kd})),n.d(s,"mark",(function(){return Zd})),n.d(s,"overlap",(function(){return Qd})),n.d(s,"render",(function(){return ah})),n.d(s,"viewlayout",(function(){return Ah}));var u={};n.r(u),n.d(u,"axisticks",(function(){return Mh})),n.d(u,"datajoin",(function(){return Sh})),n.d(u,"encode",(function(){return Fh})),n.d(u,"legendentries",(function(){return zh})),n.d(u,"linkpath",(function(){return Ph})),n.d(u,"pie",(function(){return qh})),n.d(u,"scale",(function(){return Hh})),n.d(u,"sortitems",(function(){return Jh})),n.d(u,"stack",(function(){return Zh}));var l={};n.r(l),n.d(l,"contour",(function(){return Ab})),n.d(l,"geojson",(function(){return Db})),n.d(l,"geopath",(function(){return Mb})),n.d(l,"geopoint",(function(){return Sb})),n.d(l,"geoshape",(function(){return Cb})),n.d(l,"graticule",(function(){return Fb})),n.d(l,"heatmap",(function(){return zb})),n.d(l,"isocontour",(function(){return bb})),n.d(l,"kde2d",(function(){return jb})),n.d(l,"projection",(function(){return $b}));var c={};n.r(c),n.d(c,"force",(function(){return Dy}));var f={};n.r(f),n.d(f,"nest",(function(){return Mv})),n.d(f,"pack",(function(){return $v})),n.d(f,"partition",(function(){return Rv})),n.d(f,"stratify",(function(){return Pv})),n.d(f,"tree",(function(){return Iv})),n.d(f,"treelinks",(function(){return Uv})),n.d(f,"treemap",(function(){return Yv}));var d={};n.r(d),n.d(d,"label",(function(){return lx}));var h={};n.r(h),n.d(h,"loess",(function(){return fx})),n.d(h,"regression",(function(){return hx}));var p={};n.r(p),n.d(p,"voronoi",(function(){return $x}));var g={};n.r(g),n.d(g,"wordcloud",(function(){return Vx}));var m={};n.r(m),n.d(m,"crossfilter",(function(){return t_})),n.d(m,"resolvefilter",(function(){return n_}));var b={};n.r(b),n.d(b,"Debug",(function(){return Z.a})),n.d(b,"Error",(function(){return Z.b})),n.d(b,"Info",(function(){return Z.c})),n.d(b,"None",(function(){return Z.d})),n.d(b,"Warn",(function(){return Z.e})),n.d(b,"accessor",(function(){return Z.f})),n.d(b,"accessorFields",(function(){return Z.g})),n.d(b,"accessorName",(function(){return Z.h})),n.d(b,"array",(function(){return Z.i})),n.d(b,"ascending",(function(){return Z.j})),n.d(b,"clampRange",(function(){return Z.k})),n.d(b,"compare",(function(){return Z.l})),n.d(b,"constant",(function(){return Z.m})),n.d(b,"debounce",(function(){return Z.n})),n.d(b,"error",(function(){return Z.o})),n.d(b,"extend",(function(){return Z.p})),n.d(b,"extent",(function(){return Z.q})),n.d(b,"extentIndex",(function(){return Z.r})),n.d(b,"falsy",(function(){return Z.s})),n.d(b,"fastmap",(function(){return Z.t})),n.d(b,"field",(function(){return Z.u})),n.d(b,"flush",(function(){return Z.v})),n.d(b,"hasOwnProperty",(function(){return Z.w})),n.d(b,"id",(function(){return Z.x})),n.d(b,"identity",(function(){return Z.y})),n.d(b,"inherits",(function(){return Z.z})),n.d(b,"inrange",(function(){return Z.A})),n.d(b,"isArray",(function(){return Z.B})),n.d(b,"isBoolean",(function(){return Z.C})),n.d(b,"isDate",(function(){return Z.D})),n.d(b,"isFunction",(function(){return Z.E})),n.d(b,"isNumber",(function(){return Z.F})),n.d(b,"isObject",(function(){return Z.G})),n.d(b,"isRegExp",(function(){return Z.H})),n.d(b,"isString",(function(){return Z.I})),n.d(b,"key",(function(){return Z.J})),n.d(b,"lerp",(function(){return Z.K})),n.d(b,"logger",(function(){return Z.L})),n.d(b,"lruCache",(function(){return Z.M})),n.d(b,"merge",(function(){return Z.N})),n.d(b,"mergeConfig",(function(){return Z.O})),n.d(b,"one",(function(){return Z.P})),n.d(b,"pad",(function(){return Z.Q})),n.d(b,"panLinear",(function(){return Z.R})),n.d(b,"panLog",(function(){return Z.S})),n.d(b,"panPow",(function(){return Z.T})),n.d(b,"panSymlog",(function(){return Z.U})),n.d(b,"peek",(function(){return Z.V})),n.d(b,"quarter",(function(){return Z.W})),n.d(b,"repeat",(function(){return Z.X})),n.d(b,"span",(function(){return Z.Y})),n.d(b,"splitAccessPath",(function(){return Z.Z})),n.d(b,"stringValue",(function(){return Z.ab})),n.d(b,"toBoolean",(function(){return Z.bb})),n.d(b,"toDate",(function(){return Z.cb})),n.d(b,"toNumber",(function(){return Z.db})),n.d(b,"toSet",(function(){return Z.eb})),n.d(b,"toString",(function(){return Z.fb})),n.d(b,"truncate",(function(){return Z.gb})),n.d(b,"truthy",(function(){return Z.hb})),n.d(b,"utcquarter",(function(){return Z.ib})),n.d(b,"visitArray",(function(){return Z.jb})),n.d(b,"writeConfig",(function(){return Z.kb})),n.d(b,"zero",(function(){return Z.lb})),n.d(b,"zoomLinear",(function(){return Z.mb})),n.d(b,"zoomLog",(function(){return Z.nb})),n.d(b,"zoomPow",(function(){return Z.ob})),n.d(b,"zoomSymlog",(function(){return Z.pb})),n.d(b,"Dataflow",(function(){return Ne})),n.d(b,"EventStream",(function(){return _e})),n.d(b,"MultiPulse",(function(){return Ce})),n.d(b,"Operator",(function(){return ye})),n.d(b,"Parameters",(function(){return ge})),n.d(b,"Pulse",(function(){return Ae})),n.d(b,"Transform",(function(){return Pe})),n.d(b,"changeset",(function(){return pe})),n.d(b,"definition",(function(){return Le})),n.d(b,"ingest",(function(){return ue})),n.d(b,"isTuple",(function(){return oe})),n.d(b,"transform",(function(){return Ie})),n.d(b,"transforms",(function(){return Be})),n.d(b,"tupleid",(function(){return ae})),n.d(b,"bandwidthNRD",(function(){return Qe})),n.d(b,"bin",(function(){return et})),n.d(b,"bootstrapCI",(function(){return rt})),n.d(b,"cumulativeLogNormal",(function(){return yt})),n.d(b,"cumulativeNormal",(function(){return dt})),n.d(b,"cumulativeUniform",(function(){return jt})),n.d(b,"densityLogNormal",(function(){return bt})),n.d(b,"densityNormal",(function(){return ft})),n.d(b,"densityUniform",(function(){return wt})),n.d(b,"dotbin",(function(){return it})),n.d(b,"quantileLogNormal",(function(){return vt})),n.d(b,"quantileNormal",(function(){return ht})),n.d(b,"quantileUniform",(function(){return kt})),n.d(b,"quantiles",(function(){return Ke})),n.d(b,"quartiles",(function(){return Ze})),n.d(b,"random",(function(){return tt})),n.d(b,"randomInteger",(function(){return at})),n.d(b,"randomKDE",(function(){return gt})),n.d(b,"randomLCG",(function(){return ot})),n.d(b,"randomLogNormal",(function(){return xt})),n.d(b,"randomMixture",(function(){return _t})),n.d(b,"randomNormal",(function(){return pt})),n.d(b,"randomUniform",(function(){return Et})),n.d(b,"regressionExp",(function(){return zt})),n.d(b,"regressionLinear",(function(){return Ct})),n.d(b,"regressionLoess",(function(){return Pt})),n.d(b,"regressionLog",(function(){return Ft})),n.d(b,"regressionPoly",(function(){return Nt})),n.d(b,"regressionPow",(function(){return Tt})),n.d(b,"regressionQuad",(function(){return $t})),n.d(b,"sampleCurve",(function(){return Ut})),n.d(b,"sampleLogNormal",(function(){return mt})),n.d(b,"sampleNormal",(function(){return ct})),n.d(b,"sampleUniform",(function(){return Ot})),n.d(b,"setRandom",(function(){return nt})),n.d(b,"DATE",(function(){return Ht.a})),n.d(b,"DAY",(function(){return Ht.b})),n.d(b,"DAYOFYEAR",(function(){return Ht.c})),n.d(b,"HOURS",(function(){return Ht.d})),n.d(b,"MILLISECONDS",(function(){return Ht.e})),n.d(b,"MINUTES",(function(){return Ht.f})),n.d(b,"MONTH",(function(){return Ht.g})),n.d(b,"QUARTER",(function(){return Ht.h})),n.d(b,"SECONDS",(function(){return Ht.i})),n.d(b,"TIME_UNITS",(function(){return Ht.j})),n.d(b,"WEEK",(function(){return Ht.k})),n.d(b,"YEAR",(function(){return Ht.l})),n.d(b,"dayofyear",(function(){return Ht.m})),n.d(b,"timeBin",(function(){return Ht.n})),n.d(b,"timeFloor",(function(){return Ht.o})),n.d(b,"timeInterval",(function(){return Ht.p})),n.d(b,"timeOffset",(function(){return Ht.q})),n.d(b,"timeSequence",(function(){return Ht.r})),n.d(b,"timeUnitSpecifier",(function(){return Ht.s})),n.d(b,"timeUnits",(function(){return Ht.t})),n.d(b,"utcFloor",(function(){return Ht.u})),n.d(b,"utcInterval",(function(){return Ht.v})),n.d(b,"utcOffset",(function(){return Ht.w})),n.d(b,"utcSequence",(function(){return Ht.x})),n.d(b,"utcdayofyear",(function(){return Ht.y})),n.d(b,"utcweek",(function(){return Ht.z})),n.d(b,"week",(function(){return Ht.A})),n.d(b,"format",(function(){return Q.a})),n.d(b,"formats",(function(){return Q.b})),n.d(b,"inferType",(function(){return Q.c})),n.d(b,"inferTypes",(function(){return Q.d})),n.d(b,"loader",(function(){return Q.e})),n.d(b,"read",(function(){return Q.f})),n.d(b,"responseType",(function(){return Q.g})),n.d(b,"typeParsers",(function(){return Q.h})),n.d(b,"Bounds",(function(){return El})),n.d(b,"CanvasHandler",(function(){return Vf})),n.d(b,"CanvasRenderer",(function(){return Qf})),n.d(b,"Gradient",(function(){return Tu})),n.d(b,"GroupItem",(function(){return Dl})),n.d(b,"Handler",(function(){return Nf})),n.d(b,"Item",(function(){return Al})),n.d(b,"Marks",(function(){return _f})),n.d(b,"RenderType",(function(){return Fd})),n.d(b,"Renderer",(function(){return Pf})),n.d(b,"ResourceLoader",(function(){return Ml})),n.d(b,"SVGHandler",(function(){return td})),n.d(b,"SVGRenderer",(function(){return bd})),n.d(b,"SVGStringRenderer",(function(){return Cd})),n.d(b,"Scenegraph",(function(){return Df})),n.d(b,"boundClip",(function(){return Ld})),n.d(b,"boundContext",(function(){return Jl})),n.d(b,"boundItem",(function(){return Of})),n.d(b,"boundMark",(function(){return jf})),n.d(b,"boundStroke",(function(){return Fl})),n.d(b,"domChild",(function(){return Ff})),n.d(b,"domClear",(function(){return zf})),n.d(b,"domCreate",(function(){return Sf})),n.d(b,"domFind",(function(){return Cf})),n.d(b,"font",(function(){return gf})),n.d(b,"fontFamily",(function(){return pf})),n.d(b,"fontSize",(function(){return lf})),n.d(b,"intersect",(function(){return $d})),n.d(b,"intersectBoxLine",(function(){return sc})),n.d(b,"intersectPath",(function(){return rc})),n.d(b,"intersectPoint",(function(){return ic})),n.d(b,"intersectRule",(function(){return ac})),n.d(b,"lineHeight",(function(){return cf})),n.d(b,"markup",(function(){return dd})),n.d(b,"multiLineOffset",(function(){return df})),n.d(b,"pathCurves",(function(){return Nu})),n.d(b,"pathEqual",(function(){return Ud})),n.d(b,"pathParse",(function(){return Bu})),n.d(b,"pathRectangle",(function(){return ul})),n.d(b,"pathRender",(function(){return Ju})),n.d(b,"pathSymbols",(function(){return el})),n.d(b,"pathTrail",(function(){return ll})),n.d(b,"point",(function(){return $f})),n.d(b,"renderModule",(function(){return Td})),n.d(b,"resetSVGClipId",(function(){return jl})),n.d(b,"resetSVGDefIds",(function(){return qd})),n.d(b,"sceneEqual",(function(){return Id})),n.d(b,"sceneFromJSON",(function(){return Af})),n.d(b,"scenePickVisit",(function(){return yc})),n.d(b,"sceneToJSON",(function(){return Ef})),n.d(b,"sceneVisit",(function(){return bc})),n.d(b,"sceneZOrder",(function(){return mc})),n.d(b,"serializeXML",(function(){return hd})),n.d(b,"textMetrics",(function(){return nf})),n.d(b,"interpolate",(function(){return au})),n.d(b,"interpolateColors",(function(){return ru})),n.d(b,"interpolateRange",(function(){return nu})),n.d(b,"quantizeInterpolator",(function(){return iu})),n.d(b,"scale",(function(){return Hs})),n.d(b,"scheme",(function(){return cu})),n.d(b,"projection",(function(){return ib})),n.d(b,"View",(function(){return Uj})),n.d(b,"defaultLocale",(function(){return ee.a})),n.d(b,"formatLocale",(function(){return ee.c})),n.d(b,"locale",(function(){return ee.b})),n.d(b,"resetDefaultLocale",(function(){return ee.d})),n.d(b,"timeFormatLocale",(function(){return ee.e})),n.d(b,"expressionFunction",(function(){return Vw})),n.d(b,"parse",(function(){return gD})),n.d(b,"runtimeContext",(function(){return ij})),n.d(b,"version",(function(){return mD}));var y={};n.r(y),n.d(y,"accessPathDepth",(function(){return lM})),n.d(y,"accessPathWithDatum",(function(){return rM})),n.d(y,"compile",(function(){return bI})),n.d(y,"contains",(function(){return RD})),n.d(y,"deepEqual",(function(){return SD})),n.d(y,"deleteNestedProperty",(function(){return tM})),n.d(y,"duplicate",(function(){return CD})),n.d(y,"entries",(function(){return KD})),n.d(y,"every",(function(){return BD})),n.d(y,"fieldIntersection",(function(){return GD})),n.d(y,"flatAccessWithDatum",(function(){return iM})),n.d(y,"getFirstDefined",(function(){return cM})),n.d(y,"hasIntersection",(function(){return YD})),n.d(y,"hash",(function(){return $D})),n.d(y,"internalField",(function(){return pM})),n.d(y,"isBoolean",(function(){return ZD})),n.d(y,"isEmpty",(function(){return VD})),n.d(y,"isEqual",(function(){return qD})),n.d(y,"isInternalField",(function(){return gM})),n.d(y,"isNullOrFalse",(function(){return ND})),n.d(y,"isNumeric",(function(){return bM})),n.d(y,"keys",(function(){return XD})),n.d(y,"logicalExpr",(function(){return eM})),n.d(y,"mergeDeep",(function(){return LD})),n.d(y,"normalize",(function(){return oN})),n.d(y,"normalizeAngle",(function(){return mM})),n.d(y,"omit",(function(){return zD})),n.d(y,"pick",(function(){return FD})),n.d(y,"prefixGenerator",(function(){return HD})),n.d(y,"removePathFromField",(function(){return uM})),n.d(y,"replaceAll",(function(){return sM})),n.d(y,"replacePathInField",(function(){return aM})),n.d(y,"resetIdCounter",(function(){return hM})),n.d(y,"setEqual",(function(){return WD})),n.d(y,"some",(function(){return PD})),n.d(y,"stringify",(function(){return TD})),n.d(y,"titleCase",(function(){return nM})),n.d(y,"unique",(function(){return UD})),n.d(y,"uniqueId",(function(){return dM})),n.d(y,"vals",(function(){return JD})),n.d(y,"varName",(function(){return QD})),n.d(y,"version",(function(){return kD}));var v={};n.r(v),n.d(v,"dark",(function(){return vI})),n.d(v,"excel",(function(){return xI})),n.d(v,"fivethirtyeight",(function(){return _I})),n.d(v,"ggplot2",(function(){return OI})),n.d(v,"googlecharts",(function(){return SI})),n.d(v,"latimes",(function(){return kI})),n.d(v,"quartz",(function(){return EI})),n.d(v,"urbaninstitute",(function(){return MI})),n.d(v,"version",(function(){return CI})),n.d(v,"vox",(function(){return AI})); +var r=n(93),i=n(94),o=n(95);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return I(t).length;default:if(r)return L(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return A(this,e,n);case"latin1":case"binary":return D(this,e,n);case"base64":return k(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function b(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,d=0;di&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function k(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function E(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=t.slice(e,n),f=0;fi)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,t,e,n);case"utf8":case"utf-8":return x(this,t,e,n);case"ascii":return _(this,t,e,n);case"latin1":case"binary":return O(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function z(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function T(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function $(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,r,o){return o||$(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function R(t,e,n,r,o){return o||$(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||F(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):T(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):T(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);F(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);F(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):T(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):T(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return R(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return R(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function I(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(92))},function(t,e,n){(function(e){var n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var n,r,i;try{n=Map}catch(t){n=function(){}}try{r=Set}catch(t){r=function(){}}try{i=Promise}catch(t){i=function(){}}function o(a,u,l,c,f){"object"==typeof u&&(l=u.depth,c=u.prototype,f=u.includeNonEnumerable,u=u.circular);var d=[],h=[],p=void 0!==e;return void 0===u&&(u=!0),void 0===l&&(l=1/0),function a(l,g){if(null===l)return null;if(0===g)return l;var m,b;if("object"!=typeof l)return l;if(t(l,n))m=new n;else if(t(l,r))m=new r;else if(t(l,i))m=new i((function(t,e){l.then((function(e){t(a(e,g-1))}),(function(t){e(a(t,g-1))}))}));else if(o.__isArray(l))m=[];else if(o.__isRegExp(l))m=new RegExp(l.source,s(l)),l.lastIndex&&(m.lastIndex=l.lastIndex);else if(o.__isDate(l))m=new Date(l.getTime());else{if(p&&e.isBuffer(l))return m=e.allocUnsafe?e.allocUnsafe(l.length):new e(l.length),l.copy(m),m;t(l,Error)?m=Object.create(l):void 0===c?(b=Object.getPrototypeOf(l),m=Object.create(b)):(m=Object.create(c),b=c)}if(u){var y=d.indexOf(l);if(-1!=y)return h[y];d.push(l),h.push(m)}for(var v in t(l,n)&&l.forEach((function(t,e){var n=a(e,g-1),r=a(t,g-1);m.set(n,r)})),t(l,r)&&l.forEach((function(t){var e=a(t,g-1);m.add(e)})),l){var x;b&&(x=Object.getOwnPropertyDescriptor(b,v)),x&&null==x.set||(m[v]=a(l[v],g-1))}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(l);for(v=0;v<_.length;v++){var O=_[v];(!(j=Object.getOwnPropertyDescriptor(l,O))||j.enumerable||f)&&(m[O]=a(l[O],g-1),j.enumerable||Object.defineProperty(m,O,{enumerable:!1}))}}if(f){var w=Object.getOwnPropertyNames(l);for(v=0;v0?t>1?Object(r.a)((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):i:null},e.a=i;i.range},function(t,e,n){"use strict";var r=n(3),i=Object(r.a)((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}));e.a=i;i.range},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r,i,o,a,s=n(50);a={thousands:",",grouping:[3],currency:["$",""]},r=Object(s.a)(a),i=r.format,o=r.formatPrefix},,,,function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,l=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&h())}function h(){if(!c){var t=s(d);c=!0;for(var e=l.length;e;){for(u=l,l=[];++f1)for(var n=1;n{const n=r(t,e);return n?n.version:null}},function(t,e,n){const r=n(20);t.exports=(t,e)=>{const n=r(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null}},function(t,e,n){const r=n(8);t.exports=(t,e,n,i)=>{"string"==typeof n&&(i=n,n=void 0);try{return new r(t,n).inc(e,i).version}catch(t){return null}}},function(t,e,n){const r=n(20),i=n(40);t.exports=(t,e)=>{if(i(t,e))return null;{const n=r(t),i=r(e),o=n.prerelease.length||i.prerelease.length,a=o?"pre":"",s=o?"prerelease":"";for(const t in n)if(("major"===t||"minor"===t||"patch"===t)&&n[t]!==i[t])return a+t;return s}}},function(t,e,n){const r=n(8);t.exports=(t,e)=>new r(t,e).major},function(t,e,n){const r=n(8);t.exports=(t,e)=>new r(t,e).minor},function(t,e,n){const r=n(8);t.exports=(t,e)=>new r(t,e).patch},function(t,e,n){const r=n(20);t.exports=(t,e)=>{const n=r(t,e);return n&&n.prerelease.length?n.prerelease:null}},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>r(e,t,n)},function(t,e,n){const r=n(11);t.exports=(t,e)=>r(t,e,!0)},function(t,e,n){const r=n(41);t.exports=(t,e)=>t.sort((t,n)=>r(t,n,e))},function(t,e,n){const r=n(41);t.exports=(t,e)=>t.sort((t,n)=>r(n,t,e))},function(t,e,n){const r=n(8),i=n(20),{re:o,t:a}=n(19);t.exports=(t,e)=>{if(t instanceof r)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;let n=null;if((e=e||{}).rtl){let e;for(;(e=o[a.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&e.index+e[0].length===n.index+n[0].length||(n=e),o[a.COERCERTL].lastIndex=e.index+e[1].length+e[2].length;o[a.COERCERTL].lastIndex=-1}else n=t.match(o[a.COERCE]);return null===n?null:i(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,e)}},function(t,e,n){const r=n(12);t.exports=(t,e)=>new r(t,e).set.map(t=>t.map(t=>t.value).join(" ").trim().split(" "))},function(t,e,n){const r=n(8),i=n(12);t.exports=(t,e,n)=>{let o=null,a=null,s=null;try{s=new i(e,n)}catch(t){return null}return t.forEach(t=>{s.test(t)&&(o&&-1!==a.compare(t)||(o=t,a=new r(o,n)))}),o}},function(t,e,n){const r=n(8),i=n(12);t.exports=(t,e,n)=>{let o=null,a=null,s=null;try{s=new i(e,n)}catch(t){return null}return t.forEach(t=>{s.test(t)&&(o&&1!==a.compare(t)||(o=t,a=new r(o,n)))}),o}},function(t,e,n){const r=n(8),i=n(12),o=n(31);t.exports=(t,e)=>{t=new i(t,e);let n=new r("0.0.0");if(t.test(n))return n;if(n=new r("0.0.0-0"),t.test(n))return n;n=null;for(let e=0;e{const e=new r(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":n&&!o(n,e)||(n=e);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+t.operator)}})}return n&&t.test(n)?n:null}},function(t,e,n){const r=n(12);t.exports=(t,e)=>{try{return new r(t,e).range||"*"}catch(t){return null}}},function(t,e,n){const r=n(45);t.exports=(t,e,n)=>r(t,e,">",n)},function(t,e,n){const r=n(45);t.exports=(t,e,n)=>r(t,e,"<",n)},function(t,e,n){const r=n(12);t.exports=(t,e,n)=>(t=new r(t,n),e=new r(e,n),t.intersects(e))},function(t,e,n){const r=n(33),i=n(11);t.exports=(t,e,n)=>{const o=[];let a=null,s=null;const u=t.sort((t,e)=>i(t,e,n));for(const t of u){r(t,e,n)?(s=t,a||(a=t)):(s&&o.push([a,s]),s=null,a=null)}a&&o.push([a,null]);const l=[];for(const[t,e]of o)t===e?l.push(t):e||t!==u[0]?e?t===u[0]?l.push("<="+e):l.push(`${t} - ${e}`):l.push(">="+t):l.push("*");const c=l.join(" || "),f="string"==typeof e.raw?e.raw:String(e);return c.length{if(1===t.length&&t[0].semver===i)return 1===e.length&&e[0].semver===i;const r=new Set;let s,c,f,d,h,p,g;for(const e of t)">"===e.operator||">="===e.operator?s=u(s,e,n):"<"===e.operator||"<="===e.operator?c=l(c,e,n):r.add(e.semver);if(r.size>1)return null;if(s&&c){if(f=a(s.semver,c.semver,n),f>0)return null;if(0===f&&(">="!==s.operator||"<="!==c.operator))return null}for(const t of r){if(s&&!o(t,String(s),n))return null;if(c&&!o(t,String(c),n))return null;for(const r of e)if(!o(t,String(r),n))return!1;return!0}for(const t of e){if(g=g||">"===t.operator||">="===t.operator,p=p||"<"===t.operator||"<="===t.operator,s)if(">"===t.operator||">="===t.operator){if(d=u(s,t,n),d===t)return!1}else if(">="===s.operator&&!o(s.semver,String(t),n))return!1;if(c)if("<"===t.operator||"<="===t.operator){if(h=l(c,t,n),h===t)return!1}else if("<="===c.operator&&!o(c.semver,String(t),n))return!1;if(!t.operator&&(c||s)&&0!==f)return!1}return!(s&&p&&!c&&0!==f)&&!(c&&g&&!s&&0!==f)},u=(t,e,n)=>{if(!t)return e;const r=a(t.semver,e.semver,n);return r>0?t:r<0||">"===e.operator&&">="===t.operator?e:t},l=(t,e,n)=>{if(!t)return e;const r=a(t.semver,e.semver,n);return r<0?t:r>0||"<"===e.operator&&"<="===t.operator?e:t};t.exports=(t,e,n)=>{t=new r(t,n),e=new r(e,n);let i=!1;t:for(const r of t.set){for(const t of e.set){const e=s(r,t,n);if(i=i||null!==e,e)continue t}if(i)return!1}return!0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";e.byteLength=function(t){var e=l(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=l(t),a=r[0],s=r[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),c=0,f=s>0?a-4:a;for(n=0;n>16&255,u[c++]=e>>8&255,u[c++]=255&e;2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[c++]=255&e);1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var i,o,a=[],s=e;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,f=n?i-1:0,d=n?-1:1,h=t[e+f];for(f+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+t[e+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+f],f+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=l}return(h?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;t[n+h]=255&a,h+=p,a/=256,l-=8);t[n+h-p]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){var r=n(97),i=n(98);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);t.exports=i.locals||{}},function(t,e,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function s(t){for(var e=-1,n=0;n table tr td.key {\n text-align: left;\n color: #ffffff;\n}\n\n#vg-tooltip-element > table tr td.value {\n text-align: right;\n color: #ffffff;\n}\n",""]),e.default=i},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"JsonPatchError",(function(){return S})),n.d(r,"deepClone",(function(){return C})),n.d(r,"getValueByPointer",(function(){return T})),n.d(r,"applyOperation",(function(){return $})),n.d(r,"applyPatch",(function(){return N})),n.d(r,"applyReducer",(function(){return R})),n.d(r,"validator",(function(){return P})),n.d(r,"validate",(function(){return B})),n.d(r,"_areEquals",(function(){return L}));var i={};n.r(i),n.d(i,"unobserve",(function(){return W})),n.d(i,"observe",(function(){return Y})),n.d(i,"generate",(function(){return H})),n.d(i,"compare",(function(){return V}));var o={};n.r(o),n.d(o,"aggregate",(function(){return ln})),n.d(o,"bin",(function(){return cn})),n.d(o,"collect",(function(){return dn})),n.d(o,"compare",(function(){return hn})),n.d(o,"countpattern",(function(){return gn})),n.d(o,"cross",(function(){return mn})),n.d(o,"density",(function(){return yn})),n.d(o,"dotbin",(function(){return wn})),n.d(o,"expression",(function(){return jn})),n.d(o,"extent",(function(){return En})),n.d(o,"facet",(function(){return Dn})),n.d(o,"field",(function(){return Mn})),n.d(o,"filter",(function(){return Cn})),n.d(o,"flatten",(function(){return Fn})),n.d(o,"fold",(function(){return zn})),n.d(o,"formula",(function(){return Tn})),n.d(o,"generate",(function(){return $n})),n.d(o,"impute",(function(){return Pn})),n.d(o,"joinaggregate",(function(){return Bn})),n.d(o,"kde",(function(){return Ln})),n.d(o,"key",(function(){return In})),n.d(o,"load",(function(){return qn})),n.d(o,"lookup",(function(){return Yn})),n.d(o,"multiextent",(function(){return Hn})),n.d(o,"multivalues",(function(){return Vn})),n.d(o,"params",(function(){return Jn})),n.d(o,"pivot",(function(){return Kn})),n.d(o,"prefacet",(function(){return Zn})),n.d(o,"project",(function(){return Qn})),n.d(o,"proxy",(function(){return tr})),n.d(o,"quantile",(function(){return er})),n.d(o,"relay",(function(){return nr})),n.d(o,"sample",(function(){return rr})),n.d(o,"sequence",(function(){return ir})),n.d(o,"sieve",(function(){return or})),n.d(o,"subflow",(function(){return An})),n.d(o,"timeunit",(function(){return ar})),n.d(o,"tupleindex",(function(){return ur})),n.d(o,"values",(function(){return lr})),n.d(o,"window",(function(){return pr}));var a={};n.r(a),n.d(a,"interpolate",(function(){return Go})),n.d(a,"interpolateArray",(function(){return Bo})),n.d(a,"interpolateBasis",(function(){return Eo})),n.d(a,"interpolateBasisClosed",(function(){return Ao})),n.d(a,"interpolateDate",(function(){return Io})),n.d(a,"interpolateDiscrete",(function(){return Ga})),n.d(a,"interpolateHue",(function(){return Va})),n.d(a,"interpolateNumber",(function(){return Uo})),n.d(a,"interpolateNumberArray",(function(){return Ro})),n.d(a,"interpolateObject",(function(){return qo})),n.d(a,"interpolateRound",(function(){return Vo})),n.d(a,"interpolateString",(function(){return Ho})),n.d(a,"interpolateTransformCss",(function(){return Qa})),n.d(a,"interpolateTransformSvg",(function(){return ts})),n.d(a,"interpolateZoom",(function(){return ns})),n.d(a,"interpolateRgb",(function(){return zo})),n.d(a,"interpolateRgbBasis",(function(){return $o})),n.d(a,"interpolateRgbBasisClosed",(function(){return No})),n.d(a,"interpolateHsl",(function(){return is})),n.d(a,"interpolateHslLong",(function(){return os})),n.d(a,"interpolateLab",(function(){return vs})),n.d(a,"interpolateHcl",(function(){return _s})),n.d(a,"interpolateHclLong",(function(){return Os})),n.d(a,"interpolateCubehelix",(function(){return Fs})),n.d(a,"interpolateCubehelixLong",(function(){return zs})),n.d(a,"piecewise",(function(){return qa})),n.d(a,"quantize",(function(){return Ts}));var s={};n.r(s),n.d(s,"bound",(function(){return Xd})),n.d(s,"identifier",(function(){return Kd})),n.d(s,"mark",(function(){return Zd})),n.d(s,"overlap",(function(){return Qd})),n.d(s,"render",(function(){return ah})),n.d(s,"viewlayout",(function(){return Ah}));var u={};n.r(u),n.d(u,"axisticks",(function(){return Mh})),n.d(u,"datajoin",(function(){return Sh})),n.d(u,"encode",(function(){return Fh})),n.d(u,"legendentries",(function(){return zh})),n.d(u,"linkpath",(function(){return Ph})),n.d(u,"pie",(function(){return qh})),n.d(u,"scale",(function(){return Hh})),n.d(u,"sortitems",(function(){return Jh})),n.d(u,"stack",(function(){return Zh}));var l={};n.r(l),n.d(l,"contour",(function(){return Ab})),n.d(l,"geojson",(function(){return Db})),n.d(l,"geopath",(function(){return Mb})),n.d(l,"geopoint",(function(){return Sb})),n.d(l,"geoshape",(function(){return Cb})),n.d(l,"graticule",(function(){return Fb})),n.d(l,"heatmap",(function(){return zb})),n.d(l,"isocontour",(function(){return bb})),n.d(l,"kde2d",(function(){return jb})),n.d(l,"projection",(function(){return $b}));var c={};n.r(c),n.d(c,"force",(function(){return Dy}));var f={};n.r(f),n.d(f,"nest",(function(){return Mv})),n.d(f,"pack",(function(){return $v})),n.d(f,"partition",(function(){return Rv})),n.d(f,"stratify",(function(){return Pv})),n.d(f,"tree",(function(){return Iv})),n.d(f,"treelinks",(function(){return Uv})),n.d(f,"treemap",(function(){return Yv}));var d={};n.r(d),n.d(d,"label",(function(){return lx}));var h={};n.r(h),n.d(h,"loess",(function(){return fx})),n.d(h,"regression",(function(){return hx}));var p={};n.r(p),n.d(p,"voronoi",(function(){return $x}));var g={};n.r(g),n.d(g,"wordcloud",(function(){return Vx}));var m={};n.r(m),n.d(m,"crossfilter",(function(){return e_})),n.d(m,"resolvefilter",(function(){return n_}));var b={};n.r(b),n.d(b,"Debug",(function(){return Z.a})),n.d(b,"Error",(function(){return Z.b})),n.d(b,"Info",(function(){return Z.c})),n.d(b,"None",(function(){return Z.d})),n.d(b,"Warn",(function(){return Z.e})),n.d(b,"accessor",(function(){return Z.f})),n.d(b,"accessorFields",(function(){return Z.g})),n.d(b,"accessorName",(function(){return Z.h})),n.d(b,"array",(function(){return Z.i})),n.d(b,"ascending",(function(){return Z.j})),n.d(b,"clampRange",(function(){return Z.k})),n.d(b,"compare",(function(){return Z.l})),n.d(b,"constant",(function(){return Z.m})),n.d(b,"debounce",(function(){return Z.n})),n.d(b,"error",(function(){return Z.o})),n.d(b,"extend",(function(){return Z.p})),n.d(b,"extent",(function(){return Z.q})),n.d(b,"extentIndex",(function(){return Z.r})),n.d(b,"falsy",(function(){return Z.s})),n.d(b,"fastmap",(function(){return Z.t})),n.d(b,"field",(function(){return Z.u})),n.d(b,"flush",(function(){return Z.v})),n.d(b,"hasOwnProperty",(function(){return Z.w})),n.d(b,"id",(function(){return Z.x})),n.d(b,"identity",(function(){return Z.y})),n.d(b,"inherits",(function(){return Z.z})),n.d(b,"inrange",(function(){return Z.A})),n.d(b,"isArray",(function(){return Z.B})),n.d(b,"isBoolean",(function(){return Z.C})),n.d(b,"isDate",(function(){return Z.D})),n.d(b,"isFunction",(function(){return Z.E})),n.d(b,"isNumber",(function(){return Z.F})),n.d(b,"isObject",(function(){return Z.G})),n.d(b,"isRegExp",(function(){return Z.H})),n.d(b,"isString",(function(){return Z.I})),n.d(b,"key",(function(){return Z.J})),n.d(b,"lerp",(function(){return Z.K})),n.d(b,"logger",(function(){return Z.L})),n.d(b,"lruCache",(function(){return Z.M})),n.d(b,"merge",(function(){return Z.N})),n.d(b,"mergeConfig",(function(){return Z.O})),n.d(b,"one",(function(){return Z.P})),n.d(b,"pad",(function(){return Z.Q})),n.d(b,"panLinear",(function(){return Z.R})),n.d(b,"panLog",(function(){return Z.S})),n.d(b,"panPow",(function(){return Z.T})),n.d(b,"panSymlog",(function(){return Z.U})),n.d(b,"peek",(function(){return Z.V})),n.d(b,"quarter",(function(){return Z.W})),n.d(b,"repeat",(function(){return Z.X})),n.d(b,"span",(function(){return Z.Y})),n.d(b,"splitAccessPath",(function(){return Z.Z})),n.d(b,"stringValue",(function(){return Z.ab})),n.d(b,"toBoolean",(function(){return Z.bb})),n.d(b,"toDate",(function(){return Z.cb})),n.d(b,"toNumber",(function(){return Z.db})),n.d(b,"toSet",(function(){return Z.eb})),n.d(b,"toString",(function(){return Z.fb})),n.d(b,"truncate",(function(){return Z.gb})),n.d(b,"truthy",(function(){return Z.hb})),n.d(b,"utcquarter",(function(){return Z.ib})),n.d(b,"visitArray",(function(){return Z.jb})),n.d(b,"writeConfig",(function(){return Z.kb})),n.d(b,"zero",(function(){return Z.lb})),n.d(b,"zoomLinear",(function(){return Z.mb})),n.d(b,"zoomLog",(function(){return Z.nb})),n.d(b,"zoomPow",(function(){return Z.ob})),n.d(b,"zoomSymlog",(function(){return Z.pb})),n.d(b,"Dataflow",(function(){return Nt})),n.d(b,"EventStream",(function(){return _t})),n.d(b,"MultiPulse",(function(){return Ct})),n.d(b,"Operator",(function(){return yt})),n.d(b,"Parameters",(function(){return gt})),n.d(b,"Pulse",(function(){return At})),n.d(b,"Transform",(function(){return Pt})),n.d(b,"changeset",(function(){return pt})),n.d(b,"definition",(function(){return Lt})),n.d(b,"ingest",(function(){return ut})),n.d(b,"isTuple",(function(){return ot})),n.d(b,"transform",(function(){return It})),n.d(b,"transforms",(function(){return Bt})),n.d(b,"tupleid",(function(){return at})),n.d(b,"bandwidthNRD",(function(){return Qt})),n.d(b,"bin",(function(){return te})),n.d(b,"bootstrapCI",(function(){return re})),n.d(b,"cumulativeLogNormal",(function(){return ye})),n.d(b,"cumulativeNormal",(function(){return de})),n.d(b,"cumulativeUniform",(function(){return je})),n.d(b,"densityLogNormal",(function(){return be})),n.d(b,"densityNormal",(function(){return fe})),n.d(b,"densityUniform",(function(){return we})),n.d(b,"dotbin",(function(){return ie})),n.d(b,"quantileLogNormal",(function(){return ve})),n.d(b,"quantileNormal",(function(){return he})),n.d(b,"quantileUniform",(function(){return ke})),n.d(b,"quantiles",(function(){return Kt})),n.d(b,"quartiles",(function(){return Zt})),n.d(b,"random",(function(){return ee})),n.d(b,"randomInteger",(function(){return ae})),n.d(b,"randomKDE",(function(){return ge})),n.d(b,"randomLCG",(function(){return oe})),n.d(b,"randomLogNormal",(function(){return xe})),n.d(b,"randomMixture",(function(){return _e})),n.d(b,"randomNormal",(function(){return pe})),n.d(b,"randomUniform",(function(){return Ee})),n.d(b,"regressionExp",(function(){return ze})),n.d(b,"regressionLinear",(function(){return Ce})),n.d(b,"regressionLoess",(function(){return Pe})),n.d(b,"regressionLog",(function(){return Fe})),n.d(b,"regressionPoly",(function(){return Ne})),n.d(b,"regressionPow",(function(){return Te})),n.d(b,"regressionQuad",(function(){return $e})),n.d(b,"sampleCurve",(function(){return Ue})),n.d(b,"sampleLogNormal",(function(){return me})),n.d(b,"sampleNormal",(function(){return ce})),n.d(b,"sampleUniform",(function(){return Oe})),n.d(b,"setRandom",(function(){return ne})),n.d(b,"DATE",(function(){return He.a})),n.d(b,"DAY",(function(){return He.b})),n.d(b,"DAYOFYEAR",(function(){return He.c})),n.d(b,"HOURS",(function(){return He.d})),n.d(b,"MILLISECONDS",(function(){return He.e})),n.d(b,"MINUTES",(function(){return He.f})),n.d(b,"MONTH",(function(){return He.g})),n.d(b,"QUARTER",(function(){return He.h})),n.d(b,"SECONDS",(function(){return He.i})),n.d(b,"TIME_UNITS",(function(){return He.j})),n.d(b,"WEEK",(function(){return He.k})),n.d(b,"YEAR",(function(){return He.l})),n.d(b,"dayofyear",(function(){return He.m})),n.d(b,"timeBin",(function(){return He.n})),n.d(b,"timeFloor",(function(){return He.o})),n.d(b,"timeInterval",(function(){return He.p})),n.d(b,"timeOffset",(function(){return He.q})),n.d(b,"timeSequence",(function(){return He.r})),n.d(b,"timeUnitSpecifier",(function(){return He.s})),n.d(b,"timeUnits",(function(){return He.t})),n.d(b,"utcFloor",(function(){return He.u})),n.d(b,"utcInterval",(function(){return He.v})),n.d(b,"utcOffset",(function(){return He.w})),n.d(b,"utcSequence",(function(){return He.x})),n.d(b,"utcdayofyear",(function(){return He.y})),n.d(b,"utcweek",(function(){return He.z})),n.d(b,"week",(function(){return He.A})),n.d(b,"format",(function(){return Q.a})),n.d(b,"formats",(function(){return Q.b})),n.d(b,"inferType",(function(){return Q.c})),n.d(b,"inferTypes",(function(){return Q.d})),n.d(b,"loader",(function(){return Q.e})),n.d(b,"read",(function(){return Q.f})),n.d(b,"responseType",(function(){return Q.g})),n.d(b,"typeParsers",(function(){return Q.h})),n.d(b,"Bounds",(function(){return El})),n.d(b,"CanvasHandler",(function(){return Vf})),n.d(b,"CanvasRenderer",(function(){return Qf})),n.d(b,"Gradient",(function(){return Tu})),n.d(b,"GroupItem",(function(){return Dl})),n.d(b,"Handler",(function(){return Nf})),n.d(b,"Item",(function(){return Al})),n.d(b,"Marks",(function(){return _f})),n.d(b,"RenderType",(function(){return Fd})),n.d(b,"Renderer",(function(){return Pf})),n.d(b,"ResourceLoader",(function(){return Ml})),n.d(b,"SVGHandler",(function(){return ed})),n.d(b,"SVGRenderer",(function(){return bd})),n.d(b,"SVGStringRenderer",(function(){return Cd})),n.d(b,"Scenegraph",(function(){return Df})),n.d(b,"boundClip",(function(){return Ld})),n.d(b,"boundContext",(function(){return Jl})),n.d(b,"boundItem",(function(){return Of})),n.d(b,"boundMark",(function(){return jf})),n.d(b,"boundStroke",(function(){return Fl})),n.d(b,"domChild",(function(){return Ff})),n.d(b,"domClear",(function(){return zf})),n.d(b,"domCreate",(function(){return Sf})),n.d(b,"domFind",(function(){return Cf})),n.d(b,"font",(function(){return gf})),n.d(b,"fontFamily",(function(){return pf})),n.d(b,"fontSize",(function(){return lf})),n.d(b,"intersect",(function(){return $d})),n.d(b,"intersectBoxLine",(function(){return sc})),n.d(b,"intersectPath",(function(){return rc})),n.d(b,"intersectPoint",(function(){return ic})),n.d(b,"intersectRule",(function(){return ac})),n.d(b,"lineHeight",(function(){return cf})),n.d(b,"markup",(function(){return dd})),n.d(b,"multiLineOffset",(function(){return df})),n.d(b,"pathCurves",(function(){return Nu})),n.d(b,"pathEqual",(function(){return Ud})),n.d(b,"pathParse",(function(){return Bu})),n.d(b,"pathRectangle",(function(){return ul})),n.d(b,"pathRender",(function(){return Ju})),n.d(b,"pathSymbols",(function(){return tl})),n.d(b,"pathTrail",(function(){return ll})),n.d(b,"point",(function(){return $f})),n.d(b,"renderModule",(function(){return Td})),n.d(b,"resetSVGClipId",(function(){return jl})),n.d(b,"resetSVGDefIds",(function(){return qd})),n.d(b,"sceneEqual",(function(){return Id})),n.d(b,"sceneFromJSON",(function(){return Af})),n.d(b,"scenePickVisit",(function(){return yc})),n.d(b,"sceneToJSON",(function(){return Ef})),n.d(b,"sceneVisit",(function(){return bc})),n.d(b,"sceneZOrder",(function(){return mc})),n.d(b,"serializeXML",(function(){return hd})),n.d(b,"textMetrics",(function(){return nf})),n.d(b,"interpolate",(function(){return au})),n.d(b,"interpolateColors",(function(){return ru})),n.d(b,"interpolateRange",(function(){return nu})),n.d(b,"quantizeInterpolator",(function(){return iu})),n.d(b,"scale",(function(){return Hs})),n.d(b,"scheme",(function(){return cu})),n.d(b,"projection",(function(){return ib})),n.d(b,"View",(function(){return Uj})),n.d(b,"defaultLocale",(function(){return tt.a})),n.d(b,"formatLocale",(function(){return tt.c})),n.d(b,"locale",(function(){return tt.b})),n.d(b,"resetDefaultLocale",(function(){return tt.d})),n.d(b,"timeFormatLocale",(function(){return tt.e})),n.d(b,"expressionFunction",(function(){return Vw})),n.d(b,"parse",(function(){return gD})),n.d(b,"runtimeContext",(function(){return ij})),n.d(b,"version",(function(){return mD}));var y={};n.r(y),n.d(y,"accessPathDepth",(function(){return lM})),n.d(y,"accessPathWithDatum",(function(){return rM})),n.d(y,"compile",(function(){return bI})),n.d(y,"contains",(function(){return RD})),n.d(y,"deepEqual",(function(){return SD})),n.d(y,"deleteNestedProperty",(function(){return eM})),n.d(y,"duplicate",(function(){return CD})),n.d(y,"entries",(function(){return KD})),n.d(y,"every",(function(){return BD})),n.d(y,"fieldIntersection",(function(){return GD})),n.d(y,"flatAccessWithDatum",(function(){return iM})),n.d(y,"getFirstDefined",(function(){return cM})),n.d(y,"hasIntersection",(function(){return YD})),n.d(y,"hash",(function(){return $D})),n.d(y,"internalField",(function(){return pM})),n.d(y,"isBoolean",(function(){return ZD})),n.d(y,"isEmpty",(function(){return VD})),n.d(y,"isEqual",(function(){return qD})),n.d(y,"isInternalField",(function(){return gM})),n.d(y,"isNullOrFalse",(function(){return ND})),n.d(y,"isNumeric",(function(){return bM})),n.d(y,"keys",(function(){return XD})),n.d(y,"logicalExpr",(function(){return tM})),n.d(y,"mergeDeep",(function(){return LD})),n.d(y,"normalize",(function(){return oN})),n.d(y,"normalizeAngle",(function(){return mM})),n.d(y,"omit",(function(){return zD})),n.d(y,"pick",(function(){return FD})),n.d(y,"prefixGenerator",(function(){return HD})),n.d(y,"removePathFromField",(function(){return uM})),n.d(y,"replaceAll",(function(){return sM})),n.d(y,"replacePathInField",(function(){return aM})),n.d(y,"resetIdCounter",(function(){return hM})),n.d(y,"setEqual",(function(){return WD})),n.d(y,"some",(function(){return PD})),n.d(y,"stringify",(function(){return TD})),n.d(y,"titleCase",(function(){return nM})),n.d(y,"unique",(function(){return UD})),n.d(y,"uniqueId",(function(){return dM})),n.d(y,"vals",(function(){return JD})),n.d(y,"varName",(function(){return QD})),n.d(y,"version",(function(){return kD}));var v={};n.r(v),n.d(v,"dark",(function(){return vI})),n.d(v,"excel",(function(){return xI})),n.d(v,"fivethirtyeight",(function(){return _I})),n.d(v,"ggplot2",(function(){return OI})),n.d(v,"googlecharts",(function(){return SI})),n.d(v,"latimes",(function(){return kI})),n.d(v,"quartz",(function(){return EI})),n.d(v,"urbaninstitute",(function(){return MI})),n.d(v,"version",(function(){return CI})),n.d(v,"vox",(function(){return AI})); /*! * https://github.com/Starcounter-Jack/JSON-Patch * (c) 2017 Joachim Wester * MIT license */ -var x=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=Object.prototype.hasOwnProperty;function O(e,t){return _.call(e,t)}function w(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&t<=57))return!1;n++}return!0}function E(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function A(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function D(e,t){var n=[e];for(var r in t){var i="object"==typeof t[r]?JSON.stringify(t[r],null,2):t[r];void 0!==i&&n.push(r+": "+i)}return n.join("\n")}var M=function(e){function t(t,n,r,i,o){var a=this.constructor,s=e.call(this,D(t,{name:n,index:r,operation:i,tree:o}))||this;return s.name=n,s.index=r,s.operation=i,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=D(t,{name:n,index:r,operation:i,tree:o}),s}return x(t,e),t}(Error),S=M,C=j,F={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=T(n,this.path);r&&(r=j(r));var i=$(n,{op:"remove",path:this.from}).removed;return $(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=T(n,this.from);return $(n,{op:"add",path:this.path,value:j(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:L(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},z={add:function(e,t,n){return k(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:F.move,copy:F.copy,test:F.test,_get:F._get};function T(e,t){if(""==t)return e;var n={op:"_get",path:t};return $(e,n),n.value}function $(e,t,n,r,i,o){if(void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===i&&(i=!0),void 0===o&&(o=0),n&&("function"==typeof n?n(t,0,e,t.path):P(t,0)),""===t.path){var a={newDocument:e};if("add"===t.op)return a.newDocument=t.value,a;if("replace"===t.op)return a.newDocument=t.value,a.removed=e,a;if("move"===t.op||"copy"===t.op)return a.newDocument=T(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=L(e,t.value),!1===a.test)throw new S("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a.newDocument=e,a}if("remove"===t.op)return a.removed=e,a.newDocument=null,a;if("_get"===t.op)return t.value=e,a;if(n)throw new S("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return a}r||(e=j(e));var s=(t.path||"").split("/"),u=e,l=1,c=s.length,f=void 0,d=void 0,h=void 0;for(h="function"==typeof n?n:P;;){if(d=s[l],i&&"__proto__"==d)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===f&&(void 0===u[d]?f=s.slice(0,l).join("/"):l==c-1&&(f=t.path),void 0!==f&&h(t,0,e,f)),l++,Array.isArray(u)){if("-"===d)d=u.length;else{if(n&&!k(d))throw new S("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);k(d)&&(d=~~d)}if(l>=c){if(n&&"add"===t.op&&d>u.length)throw new S("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=z[t.op].call(t,u,d,e)).test)throw new S("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(d&&-1!=d.indexOf("~")&&(d=A(d)),l>=c){if(!1===(a=F[t.op].call(t,u,d,e)).test)throw new S("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}u=u[d]}}function N(e,t,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),n&&!Array.isArray(t))throw new S("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(e=j(e));for(var o=new Array(t.length),a=0,s=t.length;a0)throw new S('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new S("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new S("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var n=0,r=t.length;n=48&&e<=57))return!1;n++}return!0}function E(t){return-1===t.indexOf("/")&&-1===t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function A(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function D(t,e){var n=[t];for(var r in e){var i="object"==typeof e[r]?JSON.stringify(e[r],null,2):e[r];void 0!==i&&n.push(r+": "+i)}return n.join("\n")}var M=function(t){function e(e,n,r,i,o){var a=this.constructor,s=t.call(this,D(e,{name:n,index:r,operation:i,tree:o}))||this;return s.name=n,s.index=r,s.operation=i,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=D(e,{name:n,index:r,operation:i,tree:o}),s}return x(e,t),e}(Error),S=M,C=j,F={add:function(t,e,n){return t[e]=this.value,{newDocument:n}},remove:function(t,e,n){var r=t[e];return delete t[e],{newDocument:n,removed:r}},replace:function(t,e,n){var r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:function(t,e,n){var r=T(n,this.path);r&&(r=j(r));var i=$(n,{op:"remove",path:this.from}).removed;return $(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(t,e,n){var r=T(n,this.from);return $(n,{op:"add",path:this.path,value:j(r)}),{newDocument:n}},test:function(t,e,n){return{newDocument:n,test:L(t[e],this.value)}},_get:function(t,e,n){return this.value=t[e],{newDocument:n}}},z={add:function(t,e,n){return k(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:n,index:e}},remove:function(t,e,n){return{newDocument:n,removed:t.splice(e,1)[0]}},replace:function(t,e,n){var r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:F.move,copy:F.copy,test:F.test,_get:F._get};function T(t,e){if(""==e)return t;var n={op:"_get",path:e};return $(t,n),n.value}function $(t,e,n,r,i,o){if(void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===i&&(i=!0),void 0===o&&(o=0),n&&("function"==typeof n?n(e,0,t,e.path):P(e,0)),""===e.path){var a={newDocument:t};if("add"===e.op)return a.newDocument=e.value,a;if("replace"===e.op)return a.newDocument=e.value,a.removed=t,a;if("move"===e.op||"copy"===e.op)return a.newDocument=T(t,e.from),"move"===e.op&&(a.removed=t),a;if("test"===e.op){if(a.test=L(t,e.value),!1===a.test)throw new S("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a.newDocument=t,a}if("remove"===e.op)return a.removed=t,a.newDocument=null,a;if("_get"===e.op)return e.value=t,a;if(n)throw new S("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,e,t);return a}r||(t=j(t));var s=(e.path||"").split("/"),u=t,l=1,c=s.length,f=void 0,d=void 0,h=void 0;for(h="function"==typeof n?n:P;;){if(d=s[l],i&&"__proto__"==d)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===f&&(void 0===u[d]?f=s.slice(0,l).join("/"):l==c-1&&(f=e.path),void 0!==f&&h(e,0,t,f)),l++,Array.isArray(u)){if("-"===d)d=u.length;else{if(n&&!k(d))throw new S("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,t);k(d)&&(d=~~d)}if(l>=c){if(n&&"add"===e.op&&d>u.length)throw new S("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);if(!1===(a=z[e.op].call(e,u,d,t)).test)throw new S("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}}else if(d&&-1!=d.indexOf("~")&&(d=A(d)),l>=c){if(!1===(a=F[e.op].call(e,u,d,t)).test)throw new S("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}u=u[d]}}function N(t,e,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),n&&!Array.isArray(e))throw new S("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(t=j(t));for(var o=new Array(e.length),a=0,s=e.length;a0)throw new S('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if(("move"===t.op||"copy"===t.op)&&"string"!=typeof t.from)throw new S("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&void 0===t.value)throw new S("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&function t(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var n=0,r=e.length;n0&&(e.patches=[],e.callback&&e.callback(r)),r}function G(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=w(t),a=w(e),s=!1,u=a.length-1;u>=0;u--){var l=e[f=a[u]];if(!O(t,f)||void 0===t[f]&&void 0!==l&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+E(f),value:j(l)}),n.push({op:"remove",path:r+"/"+E(f)}),s=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}),!0);else{var c=t[f];"object"==typeof l&&null!=l&&"object"==typeof c&&null!=c?G(l,c,n,r+"/"+E(f),i):l!==c&&(!0,i&&n.push({op:"test",path:r+"/"+E(f),value:j(l)}),n.push({op:"replace",path:r+"/"+E(f),value:j(c)}))}}if(s||o.length!=a.length)for(u=0;u{const i=t(e);return r[i]||(r[i]=1,n.push(e)),n},n.remove=e=>{const i=t(e);if(r[i]){r[i]=0;const t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function ne(e,t){try{await t(e)}catch(t){e.error(t)}}const re=Symbol("vega_id");let ie=1;function oe(e){return!(!e||!ae(e))}function ae(e){return e[re]}function se(e,t){return e[re]=t,e}function ue(e){const t=e===Object(e)?e:{data:e};return ae(t)?t:se(t,ie++)}function le(e){return ce(e,ue({}))}function ce(e,t){for(const n in e)t[n]=e[n];return t}function fe(e,t){return se(t,ae(e))}function de(e,t){return e?t?(n,r)=>e(n,r)||ae(t(n))-ae(t(r)):(t,n)=>e(t,n)||ae(t)-ae(n):null}function he(e){return e&&e.constructor===pe}function pe(){const e=[],t=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:pe,insert(t){const n=Object(Z.i)(t),r=n.length;for(let t=0;t{p(e)&&(l[ae(e)]=-1)});for(f=0,d=e.length;f0&&(b(g,p,h.value),s.modifies(p));for(f=0,d=i.length;f{p(e)&&l[ae(e)]>0&&b(e,h.field,h.value)}),s.modifies(h.field);if(a)s.mod=t.length||r.length?u.filter(e=>l[ae(e)]>0):u.slice();else for(m in c)s.mod.push(c[m]);return(o||null==o&&(t.length||r.length))&&s.clean(!0),s}}}function ge(){Object.defineProperty(this,"_:mod:_",{writable:!0,value:{}})}ge.prototype={set(e,t,n,r){const i=this,o=i[e],a=i["_:mod:_"];return null!=t&&t>=0?(o[t]!==n||r)&&(o[t]=n,a[t+":"+e]=-1,a[e]=-1):(o!==n||r)&&(i[e]=n,a[e]=Object(Z.B)(n)?1+n.length:-1),i},modified(e,t){const n=this["_:mod:_"];if(!arguments.length){for(const e in n)if(n[e])return!0;return!1}if(Object(Z.B)(e)){for(let t=0;t=0?t+1{a instanceof ye?(a!==this&&(t&&a.targets().add(this),o.push(a)),i.push({op:a,name:e,index:n})):r.set(e,n,a)};for(a in e)if(s=e[a],"pulse"===a)Object(Z.i)(s).forEach(e=>{e instanceof ye?e!==this&&(e.targets().add(this),o.push(e)):Object(Z.o)("Pulse parameters must be operator instances.")}),this.source=s;else if(Object(Z.B)(s))for(r.set(a,-1,Array(u=s.length)),l=0;l{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Oe();return this.targets().add(Oe(null,null,Object(Z.n)(e,e=>{const n=e.dataflow;t.receive(e),n&&n.run&&n.run()}))),t},between(e,t){let n=!1;return e.targets().add(Oe(null,null,()=>n=!0)),t.targets().add(Oe(null,null,()=>n=!1)),this.filter(()=>n)},detach(){}};const we={skip:!0};function je(e,t,n,r,i,o){const a=Object(Z.p)({},o,we);let s,u;Object(Z.E)(n)||(n=Object(Z.m)(n)),void 0===r?s=t=>e.touch(n(t)):Object(Z.E)(r)?(u=new ye(null,r,i,!1),s=t=>{u.evaluate(t);const r=n(t),i=u.value;he(i)?e.pulse(r,i,o):e.update(r,i,a)}):s=t=>e.update(n(t),r,a),t.apply(s)}function ke(e,t,n,r,i,o){if(void 0===r)t.targets().add(n);else{const a=o||{},s=new ye(null,function(e,t){return t=Object(Z.E)(t)?t:Object(Z.m)(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}(n,r),i,!1);s.modified(a.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}const Ee={};function Ae(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 De(e,t){const n=[];return Object(Z.jb)(e,t,e=>n.push(e)),n}function Me(e,t){const n={};return e.visit(t,e=>{n[ae(e)]=1}),e=>n[ae(e)]?null:e}function Se(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}function Ce(e,t,n,r){const i=this,o=n.length;let a=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(let e=0;et[e]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?Object(Z.B)(e)?e.some(e=>n[e]):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=Se(n.addF,t)),2&e&&(n.remF=Se(n.remF,t)),4&e&&(n.modF=Se(n.modF,t)),16&e&&(n.srcF=Se(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=De(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=De(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=De(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,r=t;if(16&e)return Object(Z.jb)(n.source,n.srcF,r),n;1&e&&Object(Z.jb)(n.add,n.addF,r),2&e&&Object(Z.jb)(n.rem,n.remF,r),4&e&&Object(Z.jb)(n.mod,n.modF,r);const i=n.source;if(8&e&&i){const e=n.add.length+n.mod.length;e===i.length||(e?Object(Z.jb)(i,Me(n,5),r):Object(Z.jb)(i,n.srcF,r))}return n}},Object(Z.z)(Ce,Ae,{fork(e){const t=new Ae(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,e=>t.add.push(e)),e&t.REM&&this.visit(t.REM,e=>t.rem.push(e)),e&t.MOD&&this.visit(t.MOD,e=>t.mod.push(e))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?Object(Z.B)(e)?e.some(e=>n[e]):n[e]:0},filter(){Object(Z.o)("MultiPulse does not support filtering.")},materialize(){Object(Z.o)("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let o=0;if(e&n.SOURCE)for(;ot=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),$e(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,function(e,t,n){const r=t,i=e.length,o=e[t];let a,s=1+(t<<1);for(;s=0&&(s=a),e[t]=e[s],s=1+((t=s)<<1);e[t]=o,$e(e,r,t,n)}(t,0,e)):r=n,r}}}function $e(e,t,n,r){let i,o;const a=e[n];for(;n>t&&(o=n-1>>1,i=e[o],r(a,i)<0);)e[n]=i,n=o;return e[n]=a}function Ne(){this.logger(Object(Z.L)()),this.logLevel(Z.b),this._clock=0,this._rank=0,this._locale=Object(ee.a)();try{this._loader=Object(Q.e)()}catch(e){}this._touched=te(Z.x),this._input={},this._pulse=null,this._heap=Te((e,t)=>e.qrank-t.qrank),this._postrun=[]}function Re(e){return function(){return this._log[e].apply(this,arguments)}}function Pe(e,t){ye.call(this,e,null,t)}Ne.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:Re("error"),warn:Re("warn"),info:Re("info"),debug:Re("debug"),logLevel:Re("level"),cleanThreshold:1e4,add:function(e,t,n,r){let i,o=1;return e instanceof ye?i=e:e&&e.prototype instanceof ye?i=new e:Object(Z.E)(e)?i=new ye(null,e):(o=0,i=new ye(e,t)),this.rank(i),o&&(r=n,n=t),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(e,t){const n=e.rank,r=t.length;for(let i=0;i=0;)t.push(n=r[i]),n===e&&Object(Z.o)("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||ze);const r=new Ae(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){const n=t||ze;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const r=n||ze;return(e.set(t)||r.force)&&this.touch(e,r),this},changeset:pe,ingest:function(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))},parse:function(e,t){const n=this.locale();return Object(Q.f)(e,t,n.timeParse,n.utcParse)},preload:async function(e,t,n){const r=this,i=r._pending||function(e){let t;const n=new Promise(e=>t=e);return n.requests=0,n.done=()=>{0==--n.requests&&(e._pending=null,t(e))},e._pending=n}(r);i.requests+=1;const o=await r.request(t,n);return r.pulse(e,r.changeset().remove(Z.hb).insert(o.data||[])),i.done(),o},request:async function(e,t){const n=this;let r,i=0;try{r=await n.loader().load(e,{context:"dataflow",response:Object(Q.g)(t&&t.type)});try{r=n.parse(r,t)}catch(t){i=-2,n.warn("Data ingestion failed",e,t)}}catch(t){i=-1,n.warn("Loading failed",e,t)}return{data:r,status:i}},events:function(e,t,n,r){const i=this,o=Oe(n,r),a=function(e){e.dataflow=i;try{o.receive(e)}catch(e){i.error(e)}finally{i.run()}};let s;s="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):Object(Z.i)(e);const u=s.length;for(let e=0;er._enqueue(e,!0)),r._touched=te(Z.x);let a,s,u,l=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(s=a.run(r._getPulse(a,e)),s.then?s=await s:s.async&&(i.push(s.async),s=Ee),s!==Ee&&a._targets&&a._targets.forEach(e=>r._enqueue(e)),++l):r._enqueue(a,!0)}catch(e){r._heap.clear(),u=e}if(r._input={},r._pulse=null,r.debug("Pulse ".concat(o,": ").concat(l," operators")),u&&(r._postrun=[],r.error(u)),r._postrun.length){const e=r._postrun.sort((e,t)=>t.priority-e.priority);r._postrun=[];for(let t=0;tr.runAsync(null,()=>{e.forEach(e=>{try{e(r)}catch(e){r.error(e)}})})),r},run:function(e,t,n){return this._pulse?Fe(this):(this.evaluate(e,t,n),this)},runAsync:async function(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running},runAfter:function(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}},_enqueue:function(e,t){const n=e.stampe.pulse),t):this._input[e.id]||function(e,t){if(t&&t.stamp===e.stamp)return t;e=e.fork(),t&&t!==Ee&&(e.source=t.source);return e}(this._pulse,n&&n.pulse)}},Object(Z.z)(Pe,ye,{run(e){if(e.stampthis.pulse=e):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Be={};function Le(e){const t=Ie(e);return t&&t.Definition||null}function Ie(e){return e=e&&e.toLowerCase(),Object(Z.w)(Be,e)?Be[e]:null}var Ue=n(21);function qe(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function We(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Ye(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}var He=function(e){return null===e?NaN:+e};function Ge(e,t,n){if(r=(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n))).length){if((t=+t)<=0||r<2)return We(e);if(t>=1)return qe(e);var r,i=(r-1)*t,o=Math.floor(i),a=qe(function e(t,n,r=0,i=t.length-1,o=Ue.a){for(;i>r;){if(i-r>600){const a=i-r+1,s=n-r+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);e(t,n,Math.max(r,Math.floor(n-s*l/a+c)),Math.min(i,Math.floor(n+(a-s)*l/a+c)),o)}const a=t[n];let s=r,u=i;for(Ye(t,r,n),o(t[i],a)>0&&Ye(t,r,i);s0;)--u}0===o(t[r],a)?Ye(t,r,u):(++u,Ye(t,u,i)),u<=n&&(r=u+1),n<=u&&(i=u-1)}return t}(e,o).subarray(0,o+1));return a+(We(e.subarray(o+1))-a)*(i-o)}}function Ve(e,t,n=He){if(r=e.length){if((t=+t)<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e);return a+(+n(e[o+1],o+1,e)-a)*(i-o)}}var Xe=function(e,t){return Ge(e,.5,t)};function*Je(e,t){if(null==t)for(let t of e)null!=t&&""!==t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)r=t(r,++n,e),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function Ke(e,t,n){const r=Float64Array.from(Je(e,n));return r.sort(Ue.a),t.map(e=>Ve(r,e))}function Ze(e,t){return Ke(e,[.25,.5,.75],t)}function Qe(e,t){const n=e.length,r=function(e,t){const n=function(e,t){let n,r=0,i=0,o=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(n=t-i,i+=n/++r,o+=n*(t-i));else{let a=-1;for(let s of e)null!=(s=t(s,++a,e))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(e,t);return n?Math.sqrt(n):n}(e,t),i=Ze(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function et(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o,a,s,u,l,c,f=e.extent[0],d=e.extent[1];const h=e.span||d-f||Math.abs(f)||1;if(e.step)o=e.step;else if(e.steps){for(u=h/t,l=0,c=e.steps.length;lt;)o*=n;for(l=0,c=i.length;l=s&&h/u<=t&&(o=u)}u=Math.log(o);const p=u>=0?0:1+~~(-u/r),g=Math.pow(n,-p-1);return(e.nice||void 0===e.nice)&&(u=Math.floor(f/o+g)*o,f=fe);const i=e.length,o=new Float64Array(i);let a,s=0,u=1,l=r(e[0]),c=l,f=l+t;for(;u=f){for(c=(l+c)/2;s>1);ia;)e[i--]=e[o]}o=a,a=r}return e}(o,t+t/4):o}function ot(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function at(e,t){let n,r,i;null==t&&(t=e,e=0);const o={min(e){return arguments.length?(n=e||0,i=r-n,o):n},max(e){return arguments.length?(r=e||0,i=r-n,o):r},sample:()=>n+Math.floor(i*tt()),pdf:e=>e===Math.floor(e)&&e>=n&&e=r?1:(t-n+1)/i},icdf:e=>e>=0&&e<=1?n-1+Math.floor(e*i):NaN};return o.min(e).max(t)}const st=Math.sqrt(2*Math.PI),ut=Math.SQRT2;let lt=NaN;function ct(e,t){e=e||0,t=null==t?1:t;let n,r,i=0,o=0;if(lt==lt)i=lt,lt=NaN;else{do{i=2*tt()-1,o=2*tt()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,lt=o*r}return e+i*t}function ft(e,t,n){const r=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*st)}function dt(e,t,n){const r=(e-(t=t||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const e=Math.exp(-i*i/2);let t;i<7.07106781186547?(t=.0352624965998911*i+.700383064443688,t=t*i+6.37396220353165,t=t*i+33.912866078383,t=t*i+112.079291497871,t=t*i+221.213596169931,t=t*i+220.206867912376,o=e*t,t=.0883883476483184*i+1.75566716318264,t=t*i+16.064177579207,t=t*i+86.7807322029461,t=t*i+296.564248779674,t=t*i+637.333633378831,t=t*i+793.826512519948,t=t*i+440.413735824752,o/=t):(t=i+.65,t=i+4/t,t=i+3/t,t=i+2/t,t=i+1/t,o=e/t/2.506628274631)}return r>0?1-o:o}function ht(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*ut*function(e){let t,n=-Math.log((1-e)*(1+e));n<6.25?(n-=3.125,t=-364441206401782e-35,t=t*n-16850591381820166e-35,t=128584807152564e-32+t*n,t=11157877678025181e-33+t*n,t=t*n-1333171662854621e-31,t=20972767875968562e-33+t*n,t=6637638134358324e-30+t*n,t=t*n-4054566272975207e-29,t=t*n-8151934197605472e-29,t=26335093153082323e-28+t*n,t=t*n-12975133253453532e-27,t=t*n-5415412054294628e-26,t=1.0512122733215323e-9+t*n,t=t*n-4.112633980346984e-9,t=t*n-2.9070369957882005e-8,t=4.2347877827932404e-7+t*n,t=t*n-13654692000834679e-22,t=t*n-13882523362786469e-21,t=.00018673420803405714+t*n,t=t*n-.000740702534166267,t=t*n-.006033670871430149,t=.24015818242558962+t*n,t=1.6536545626831027+t*n):n<16?(n=Math.sqrt(n)-3.25,t=2.2137376921775787e-9,t=9.075656193888539e-8+t*n,t=t*n-2.7517406297064545e-7,t=1.8239629214389228e-8+t*n,t=15027403968909828e-22+t*n,t=t*n-4013867526981546e-21,t=29234449089955446e-22+t*n,t=12475304481671779e-21+t*n,t=t*n-47318229009055734e-21,t=6828485145957318e-20+t*n,t=24031110387097894e-21+t*n,t=t*n-.0003550375203628475,t=.0009532893797373805+t*n,t=t*n-.0016882755560235047,t=.002491442096107851+t*n,t=t*n-.003751208507569241,t=.005370914553590064+t*n,t=1.0052589676941592+t*n,t=3.0838856104922208+t*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,t=-27109920616438573e-27,t=t*n-2.555641816996525e-10,t=1.5076572693500548e-9+t*n,t=t*n-3.789465440126737e-9,t=7.61570120807834e-9+t*n,t=t*n-1.496002662714924e-8,t=2.914795345090108e-8+t*n,t=t*n-6.771199775845234e-8,t=2.2900482228026655e-7+t*n,t=t*n-9.9298272942317e-7,t=4526062597223154e-21+t*n,t=t*n-1968177810553167e-20,t=7599527703001776e-20+t*n,t=t*n-.00021503011930044477,t=t*n-.00013871931833623122,t=1.0103004648645344+t*n,t=4.849906401408584+t*n):t=1/0;return t*e}(2*e-1)}function pt(e,t){let n,r;const i={mean(e){return arguments.length?(n=e||0,i):n},stdev(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>ct(n,r),pdf:e=>ft(e,n,r),cdf:e=>dt(e,n,r),icdf:e=>ht(e,n,r)};return i.mean(e).stdev(t)}function gt(e,t){const n=pt();let r=0;const i={data(n){return arguments.length?(e=n,r=n?n.length:0,i.bandwidth(t)):e},bandwidth(n){return arguments.length?(!(t=n)&&e&&(t=Qe(e)),i):t},sample:()=>e[~~(tt()*r)]+t*n.sample(),pdf(i){let o=0,a=0;for(;amt(n,r),pdf:e=>bt(e,n,r),cdf:e=>yt(e,n,r),icdf:e=>vt(e,n,r)};return i.mean(e).stdev(t)}function _t(e,t){let n,r=0;const i={weights(e){return arguments.length?(n=function(e){const t=[];let n,i=0;for(n=0;n=t&&e<=n?1/(n-t):0}function jt(e,t,n){return null==n&&(n=null==t?1:t,t=0),en?1:(e-t)/(n-t)}function kt(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function Et(e,t){let n,r;const i={min(e){return arguments.length?(n=e||0,i):n},max(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>Ot(n,r),pdf:e=>wt(e,n,r),cdf:e=>jt(e,n,r),icdf:e=>kt(e,n,r)};return null==t&&(t=null==e?1:e,e=0),i.min(e).max(t)}function At(e,t,n,r){const i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function Dt(e,t,n,r){e=e.filter(e=>{let r=t(e),i=n(e);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i}),r&&e.sort((e,n)=>t(e)-t(n));const i=e.length,o=new Float64Array(i),a=new Float64Array(i);let s,u,l,c=0,f=0,d=0;for(l of e)o[c]=s=+t(l),a[c]=u=+n(l),++c,f+=(s-f)/c,d+=(u-d)/c;for(c=0;c=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function St(e,t,n,r,i){let o=0,a=0;return Mt(e,t,n,(e,t)=>{const n=t-i(e),s=t-r;o+=n*n,a+=s*s}),1-o/a}function Ct(e,t,n){let r=0,i=0,o=0,a=0,s=0;Mt(e,t,n,(e,t)=>{++s,r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s});const u=At(r,i,o,a),l=e=>u[0]+u[1]*e;return{coef:u,predict:l,rSquared:St(e,t,n,i,l)}}function Ft(e,t,n){let r=0,i=0,o=0,a=0,s=0;Mt(e,t,n,(e,t)=>{++s,e=Math.log(e),r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s});const u=At(r,i,o,a),l=e=>u[0]+u[1]*Math.log(e);return{coef:u,predict:l,rSquared:St(e,t,n,i,l)}}function zt(e,t,n){const[r,i,o,a]=Dt(e,t,n);let s,u,l,c=0,f=0,d=0,h=0,p=0;Mt(e,t,n,(e,t)=>{s=r[p++],u=Math.log(t),l=s*t,c+=(t*u-c)/p,f+=(l-f)/p,d+=(l*u-d)/p,h+=(s*l-h)/p});const[g,m]=At(f/a,c/a,d/a,h/a),b=e=>Math.exp(g+m*(e-o));return{coef:[Math.exp(g-m*o),m],predict:b,rSquared:St(e,t,n,a,b)}}function Tt(e,t,n){let r=0,i=0,o=0,a=0,s=0,u=0;Mt(e,t,n,(e,t)=>{const n=Math.log(e),l=Math.log(t);++u,r+=(n-r)/u,i+=(l-i)/u,o+=(n*l-o)/u,a+=(n*n-a)/u,s+=(t-s)/u});const l=At(r,i,o,a),c=e=>l[0]*Math.pow(e,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:St(e,t,n,s,c)}}function $t(e,t,n){const[r,i,o,a]=Dt(e,t,n),s=r.length;let u,l,c,f,d=0,h=0,p=0,g=0,m=0;for(u=0;uv*(e-=o)*e+x*e+_+a;return{coef:[_-x*o+v*o*o+a,x-2*v*o,v],predict:O,rSquared:St(e,t,n,a,O)}}function Nt(e,t,n,r){if(1===r)return Ct(e,t,n);if(2===r)return $t(e,t,n);const[i,o,a,s]=Dt(e,t,n),u=i.length,l=[],c=[],f=r+1;let d,h,p,g,m;for(d=0;dMath.abs(e[r][a])&&(a=i);for(o=r;o=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(s=0,o=i+1;o{e-=a;let t=s+b[0]+b[1]*e+b[2]*e*e;for(d=3;d=0;--o)for(s=t[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}function Pt(e,t,n,r){const[i,o,a,s]=Dt(e,t,n,!0),u=i.length,l=Math.max(2,~~(r*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let e=-1;++e<=2;){const t=[0,l-1];for(let e=0;ei[a]-n?r:a;let u=0,l=0,h=0,p=0,g=0;const m=1/Math.abs(i[s]-n||1);for(let e=r;e<=a;++e){const t=i[e],r=o[e],a=Bt(Math.abs(n-t)*m)*d[e],s=t*a;u+=a,l+=s,h+=r*a,p+=r*s,g+=t*s}const[b,y]=At(l/u,h/u,p/u,g/u);c[e]=b+y*n,f[e]=Math.abs(o[e]-c[e]),Lt(i,e+1,t)}if(2===e)break;const n=Xe(f);if(Math.abs(n)<1e-12)break;for(let e,t,r=0;r=1?1e-12:(t=1-e*e)*t}return function(e,t,n,r){const i=e.length,o=[];let a,s=0,u=0,l=[];for(;s=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}const It=.1*Math.PI/180;function Ut(e,t,n,r){n=n||25,r=Math.max(n,r||200);const i=t=>[t,e(t)],o=t[0],a=t[1],s=a-o,u=s/r,l=[i(o)],c=[];if(n===r){for(let e=1;e0;)c.push(i(o+e/n*s));let f=l[0],d=c[c.length-1];for(;d;){const e=i((f[0]+d[0])/2);e[0]-f[0]>=u&&qt(f,e,d)>It?c.push(e):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function qt(e,t,n){const r=Math.atan2(n[1]-e[1],n[0]-e[0]),i=Math.atan2(t[1]-e[1],t[0]-e[0]);return Math.abs(r-i)}var Wt=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r{const n=t.length;let r=1,i=String(t[0](e));for(;r{},Jt={init:Xt,add:Xt,rem:Xt,idx:0},Kt={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.sum,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||void 0===e.max)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3}},Zt=Object.keys(Kt);function Qt(e,t){return Kt[e](t)}function en(e,t){return e.idx-t.idx}function tn(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.init(this))}function nn(e,t){null!=e&&""!==e?e==e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t))):++this.missing}function rn(e,t){null!=e&&""!==e?e==e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t))):--this.missing}function on(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function an(e,t){const n=t||Z.y,r=function(e){const t={};e.forEach(e=>t[e.name]=e);const n=e=>{e.req&&e.req.forEach(e=>{t[e]||n(t[e]=Kt[e]())})};return e.forEach(n),Object.values(t).sort(en)}(e),i=e.slice().sort(en);function o(e){this._ops=r,this._out=i,this.cell=e,this.init()}return o.prototype.init=tn,o.prototype.add=nn,o.prototype.rem=rn,o.prototype.set=on,o.prototype.get=n,o.fields=e.map(e=>e.out),o}function sn(e){this._key=e?Object(Z.u)(e):ae,this.reset()}Zt.forEach(e=>{Kt[e]=function(e,t){return n=>Object(Z.p)({name:e,out:n||e},Jt,t)}(e,Kt[e])});const un=sn.prototype;function ln(e){Pe.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}un.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},un.add=function(e){this._add.push(e)},un.rem=function(e){this._rem.push(e)},un.values=function(){if(this._get=null,0===this._rem.length)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),a={};let s,u,l;for(s=0;s=0;)r=e(t[i])+"",Object(Z.w)(n,r)||(n[r]=1,++o);return o},un.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=Object(Z.r)(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},un.argmin=function(e){return this.extent(e)[0]||{}},un.argmax=function(e){return this.extent(e)[1]||{}},un.min=function(e){const t=this.extent(e)[0];return null!=t?e(t):void 0},un.max=function(e){const t=this.extent(e)[1];return null!=t?e(t):void 0},un.quartile=function(e){return this._get===e&&this._q||(this._q=Ze(this.values(),e),this._get=e),this._q},un.q1=function(e){return this.quartile(e)[0]},un.q2=function(e){return this.quartile(e)[1]},un.q3=function(e){return this.quartile(e)[2]},un.ci=function(e){return this._get===e&&this._ci||(this._ci=rt(this.values(),1e3,.05,e),this._get=e),this._ci},un.ci0=function(e){return this.ci(e)[0]},un.ci1=function(e){return this.ci(e)[1]},ln.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Zt},{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"}]},Object(Z.z)(ln,Pe,{transform(e,t){const n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):{},t.visit(t.SOURCE,e=>n.add(e))):(n.value=n.value||n.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),r.modifies(n._outputs),n._drop=!1!==e.drop,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const e=this,t=e.value,n=e._dnames,r=n.map(()=>({})),i=n.length;function o(e){let t,o,a,s;for(t in e)for(a=e[t].tuple,o=0;o{const t=Object(Z.h)(e);return i(e),n.push(t),t}),this.cellkey=e.key?e.key:Gt(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],a=e.ops||["count"],s=e.as||[],u=o.length,l={};let c,f,d,h,p,g;for(u!==a.length&&Object(Z.o)("Unmatched number of fields and aggregate ops."),g=0;gan(e,e.field)),{}},cellkey:Gt(),cell(e,t){let n=this.value[e];return n?0===n.num&&this._drop&&n.stampo.push(e),remove:e=>a[r(e)]=++s,size:()=>i.length,data:(e,t)=>(s&&(i=i.filter(e=>!a[r(e)]),a={},s=0),t&&e&&i.sort(e),o.length&&(i=e?Object(Z.N)(e,i,o.sort(e)):i.concat(o),o=[]),i)}}function dn(e){Pe.call(this,[],e)}function hn(e){ye.call(this,null,pn,e)}function pn(e){return this.value&&!e.modified()?this.value:Object(Z.l)(e.fields,e.orders)}function gn(e){Pe.call(this,null,e)}function mn(e){Pe.call(this,null,e)}cn.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},Object(Z.z)(cn,Pe,{transform(e,t){const n=!1!==e.interval,r=this._bins(e),i=r.start,o=r.step,a=e.as||["bin0","bin1"],s=a[0],u=a[1];let l;return l=e.modified()?(t=t.reflow(!0)).SOURCE:t.modified(Object(Z.g)(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?e=>{const t=r(e);e[s]=t,e[u]=null==t?null:i+o*(1+(t-i)/o)}:e=>e[s]=r(e)),t.modifies(n?a:s)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=et(e),r=n.step;let i,o,a=n.start,s=a+Math.ceil((n.stop-a)/r)*r;null!=(i=e.anchor)&&(o=i-(a+r*Math.floor((i-a)/r)),a+=o,s+=o);const u=function(e){let n=Object(Z.db)(t(e));return null==n?null:ns?1/0:(n=Math.max(a,Math.min(n,s-r)),a+r*Math.floor(1e-14+(n-a)/r))};return u.start=a,u.stop=n.stop,u.step=r,this.value=Object(Z.f)(u,Object(Z.g)(t),e.name||"bin_"+Object(Z.h)(t))}}),dn.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},Object(Z.z)(dn,Pe,{transform(e,t){const n=t.fork(t.ALL),r=fn(ae,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(de(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),Object(Z.z)(hn,ye),gn.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"]}]},Object(Z.z)(gn,Pe,{transform(e,t){const n=t=>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)}(s(n),e.case,o)||[],u=0,l=i.length;ui[e]=1+(i[e]||0)),c=n(e=>i[e]-=1);return r?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let s,u,l;for(s in n)u=r[s],l=n[s]||0,!u&&l?(r[s]=u=ue({}),u[i]=s,u[o]=l,a.add.push(u)):0===l?(u&&a.rem.push(u),n[s]=null,r[s]=null):u[o]!==l&&(u[o]=l,a.mod.push(u));return a.modifies(t)}}),mn.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},Object(Z.z)(mn,Pe,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=function(e,t,n,r){for(var i,o,a=[],s={},u=e.length,l=0;lt[n]||Object(Z.h)(e)):null}function On(e,t,n){const r=[],i=e=>e(u);let o,a,s,u,l,c;if(null==t)r.push(e.map(n));else for(o={},a=0,s=e.length;ae(t,n))):"function"==typeof i[r]&&i[r](t[r]);return i}(e.distribution,function(e){return()=>e.materialize(e.SOURCE).source}(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let a=e.method||"pdf";"pdf"!==a&&"cdf"!==a&&Object(Z.o)("Invalid density method: "+a),e.extent||r.data||Object(Z.o)("Missing density extent parameter."),a=r[a];const s=e.as||["value","density"],u=Ut(a,e.extent||Object(Z.q)(r.data()),i,o).map(e=>{const t={};return t[s[0]]=e[0],t[s[1]]=e[1],ue(t)});this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});function wn(e){Pe.call(this,null,e)}wn.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function jn(e){ye.call(this,null,kn,e),this.modified(!0)}function kn(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Object(Z.f)(n=>t(n,e),Object(Z.g)(t),Object(Z.h)(t))}function En(e){Pe.call(this,[void 0,void 0],e)}function An(e,t){ye.call(this,e),this.parent=t,this.count=0}function Dn(e){Pe.call(this,{},e),this._keys=Object(Z.t)();const t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,r=t.active;nObject(Z.u)(e)):Object(Z.u)(e.name,e.as)}function Cn(e){Pe.call(this,Object(Z.t)(),e)}function Fn(e){Pe.call(this,[],e)}function zn(e){Pe.call(this,[],e)}function Tn(e){Pe.call(this,null,e)}function $n(e){Pe.call(this,[],e)}Object(Z.z)(wn,Pe,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,r=On(t.source,e.groupby,Z.y),i=e.smooth||!1,o=e.field,a=e.step||((e,t)=>Object(Z.Y)(Object(Z.q)(e,t))/30)(n,o),s=de((e,t)=>o(e)-o(t)),u=e.as||"bin",l=r.length;let c,f=1/0,d=-1/0,h=0;for(;hd&&(d=t),e[++c][u]=t}return this.value={start:f,stop:d,step:a},t.reflow(!0).modifies(u)}}),Object(Z.z)(jn,ye),En.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Object(Z.z)(En,Pe,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],a=n[1];if((i||null==o)&&(o=1/0,a=-1/0),t.visit(i?t.SOURCE:t.ADD,e=>{const t=Object(Z.db)(r(e));null!=t&&(ta&&(a=t))}),!Number.isFinite(o)||!Number.isFinite(a)){let e=Object(Z.h)(r);e&&(e=' for field "'.concat(e,'"')),t.dataflow.warn("Infinite extent".concat(e,": [").concat(o,", ").concat(a,"]")),o=a=void 0}this.value=[o,a]}}),Object(Z.z)(An,ye,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),Object(Z.z)(Dn,Pe,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){const i=this.value;let o,a,s=Object(Z.w)(i,e)&&i[e];return s?s.value.stampthis.subflow(e,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,e=>{const t=ae(e),n=o.get(t);void 0!==n&&(o.delete(t),s(n).rem(e))}),t.visit(t.ADD,e=>{const t=r(e);o.set(ae(e),t),s(t).add(e)}),a||t.modified(r.fields)?t.visit(t.MOD,e=>{const t=ae(e),n=o.get(t),i=r(e);n===i?s(i).mod(e):(o.set(t,i),s(n).rem(e),s(i).add(e))}):t.changed(t.MOD)&&t.visit(t.MOD,e=>{s(o.get(ae(e))).mod(e)}),a&&t.visit(t.REFLOW,e=>{const t=ae(e),n=o.get(t),i=r(e);n!==i&&(o.set(t,i),s(n).rem(e),s(i).add(e))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}}),Object(Z.z)(Mn,ye),Cn.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Object(Z.z)(Cn,Pe,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,a=i.rem,s=i.mod,u=e.expr;let l=!0;function c(t){const n=ae(t),i=u(t,e),c=r.get(n);i&&c?(r.delete(n),o.push(t)):i||c?l&&i&&!c&&s.push(t):(r.set(n,1),a.push(t))}return t.visit(t.REM,e=>{const t=ae(e);r.has(t)?r.delete(t):a.push(e)}),t.visit(t.ADD,t=>{u(t,e)?o.push(t):r.set(ae(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}}),Fn.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}]},Object(Z.z)(Fn,Pe,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=_n(r,e.as||[]),o=e.index||null,a=i.length;return n.rem=this.value,t.visit(t.SOURCE,e=>{const t=r.map(t=>t(e)),s=t.reduce((e,t)=>Math.max(e,t.length),0);let u,l,c,f=0;for(;f{for(let t,o=0;ot[r]=n(t,e))}}),Object(Z.z)($n,Pe,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i,o,a,s=this.value,u=e.size-s.length;if(u>0){for(i=[];--u>=0;)i.push(a=ue(r(e))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=s.slice(0,-u),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-u);return n.source=this.value=s,n}});const Nn={value:"value",median:Xe,mean:function(e,t){let n=0,r=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:We,max:qe},Rn=[];function Pn(e){Pe.call(this,[],e)}function Bn(e){ln.call(this,e)}function Ln(e){Pe.call(this,null,e)}function In(e){ye.call(this,null,Un,e)}function Un(e){return this.value&&!e.modified()?this.value:Object(Z.J)(e.fields,e.flat)}function qn(e){Pe.call(this,[],e),this._pending=null}function Wn(e,t,n){n.forEach(ue);const 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 Yn(e){Pe.call(this,{},e)}function Hn(e){ye.call(this,null,Gn,e)}function Gn(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let r,i,o=1/0,a=-1/0;for(r=0;ra&&(a=i[1]);return[o,a]}function Vn(e){ye.call(this,null,Xn,e)}function Xn(e){return this.value&&!e.modified()?this.value:e.values.reduce((e,t)=>e.concat(t),[])}function Jn(e){Pe.call(this,null,e)}function Kn(e){ln.call(this,e)}function Zn(e){Dn.call(this,e)}function Qn(e){Pe.call(this,null,e)}function er(e){Pe.call(this,null,e)}function tr(e){Pe.call(this,null,e)}Pn.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}]},Object(Z.z)(Pn,Pe,{transform(e,t){var n,r,i,o,a,s,u,l,c,f,d=t.fork(t.ALL),h=function(e){var t,n=e.method||Nn.value;if(null!=Nn[n])return n===Nn.value?(t=void 0!==e.value?e.value:0,()=>t):Nn[n];Object(Z.o)("Unrecognized imputation method: "+n)}(e),p=function(e){const t=e.field;return e=>e?t(e):NaN}(e),g=Object(Z.h)(e.field),m=Object(Z.h)(e.key),b=(e.groupby||[]).map(Z.h),y=function(e,t,n,r){var i,o,a,s,u,l,c,f,d=e=>e(f),h=[],p=r?r.slice():[],g={},m={};for(p.forEach((e,t)=>g[e]=t+1),s=0,c=e.length;sn.add(e))):(i=n.value=n.value||this.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),n.changes(),t.visit(t.SOURCE,e=>{Object(Z.p)(e,i[n.cellkey(e)].tuple)}),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const n=gt(t,a)[s],r=e.counts?t.length:1;Ut(n,c||Object(Z.q)(t),f,d).forEach(e=>{const n={};for(let e=0;e(this._pending=Object(Z.i)(e.data),e=>e.touch(this)))}}return n.request(e.url,e.format).then(e=>Wn(this,t,Object(Z.i)(e.data)))}}),Yn.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},Object(Z.z)(Yn,Pe,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=null==e.default?null:e.default,a=e.modified(),s=n.length;let u,l,c,f=a?t.SOURCE:t.ADD,d=t,h=e.as;return i?(l=i.length,s>1&&!h&&Object(Z.o)('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*l&&Object(Z.o)('The "as" parameter has too few output field names.'),h=h||i.map(Z.h),u=function(e){for(var t,a,u=0,c=0;ut.modified(e.fields)),f|=c?t.MOD:0),t.visit(f,u),d.modifies(h)}}),Object(Z.z)(Hn,ye),Object(Z.z)(Vn,ye),Object(Z.z)(Jn,Pe,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),Kn.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Zt,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},Object(Z.z)(Kn,ln,{_transform:ln.prototype.transform,transform(e,t){return this._transform(function(e,t){const n=e.field,r=e.value,i=("count"===e.op?"__count__":e.op)||"sum",o=Object(Z.g)(n).concat(Object(Z.g)(r)),a=function(e,t,n){const r={},i=[];return n.visit(n.SOURCE,t=>{const n=e(t);r[n]||(r[n]=1,i.push(n))}),i.sort(Z.j),t?i.slice(0,t):i}(n,e.limit||0,t);t.changed()&&e.set("__pivot__",null,null,!0);return{key:e.key,groupby:e.groupby,ops:a.map(()=>i),fields:a.map(e=>function(e,t,n,r){return Object(Z.f)(r=>t(r)===e?n(r):NaN,r,e+"")}(e,n,r,o)),as:a.map(e=>e+""),modified:e.modified.bind(e)}}(e,t),t)}}),Object(Z.z)(Zn,Dn,{transform(e,t){const n=e.subflow,r=e.field,i=e=>this.subflow(ae(e),n,t,e);return(e.modified("field")||r&&t.modified(Object(Z.g)(r)))&&Object(Z.o)("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,e=>{const t=i(e);r(e).forEach(e=>t.mod(e))}),t.visit(t.ADD,e=>{const t=i(e);r(e).forEach(e=>t.add(ue(e)))}),t.visit(t.REM,e=>{const t=i(e);r(e).forEach(e=>t.rem(e))})):(t.visit(t.MOD,e=>i(e).mod(e)),t.visit(t.ADD,e=>i(e).add(e)),t.visit(t.REM,e=>i(e).rem(e))),t.clean()&&t.runAfter(()=>this.clean()),t}}),Qn.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},Object(Z.z)(Qn,Pe,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=_n(e.fields,e.as||[]),o=r?(e,t)=>function(e,t,n,r){for(let i=0,o=n.length;i{const t=ae(e);n.rem.push(a[t]),a[t]=null}),t.visit(t.ADD,e=>{const t=o(e,ue({}));a[ae(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{n.mod.push(o(e,a[ae(e)]))}),n}}),Object(Z.z)(er,Pe,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),tr.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function nr(e){Pe.call(this,null,e)}function rr(e){Pe.call(this,[],e),this.count=0}function ir(e){Pe.call(this,null,e)}function or(e){Pe.call(this,null,e),this.modified(!0)}function ar(e){Pe.call(this,null,e)}Object(Z.z)(tr,Pe,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const i=On(t.materialize(t.SOURCE).source,e.groupby,e.field),o=(e.groupby||[]).map(Z.h),a=[],s=e.step||.01,u=e.probs||Wt(s/2,1-1e-14,s),l=u.length;return i.forEach(e=>{const t=Ke(e,u);for(let n=0;n{const t=ae(e);n.rem.push(r[t]),r[t]=null}),t.visit(t.ADD,e=>{const t=le(e);r[ae(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{const t=r[ae(e)];for(const r in e)t[r]=e[r],n.modifies(r);n.mod.push(t)})),n}}),rr.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},Object(Z.z)(rr,Pe,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce((e,t)=>(e[ae(t)]=1,e),{});let a=this.value,s=this.count,u=0;function l(e){let t,r;a.length=u&&(t=a[r],o[ae(t)]&&n.rem.push(t),a[r]=e)),++s}if(t.rem.length&&(t.visit(t.REM,e=>{const t=ae(e);o[t]&&(o[t]=-1,n.rem.push(e)),--s}),a=a.filter(e=>-1!==o[ae(e)])),(t.rem.length||r)&&a.length{o[ae(e)]||l(e)}),u=-1),r&&a.length>i){const e=a.length-i;for(let t=0;t{o[ae(e)]&&n.mod.push(e)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=a.filter(e=>!o[ae(e)])),this.count=s,this.value=n.source=a,n}}),ir.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},Object(Z.z)(ir,Pe,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Wt(e.start,e.stop,e.step||1).map(e=>{const t={};return t[r]=e,ue(t)}),n.add=t.add.concat(this.value),n}}),Object(Z.z)(or,Pe,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const sr=["unit0","unit1"];function ur(e){Pe.call(this,Object(Z.t)(),e)}function lr(e){Pe.call(this,null,e)}ar.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Ht.j,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:sr}]},Object(Z.z)(ar,Pe,{transform(e,t){const n=e.field,r=!1!==e.interval,i="utc"===e.timezone,o=this._floor(e,t),a=(i?Ht.v:Ht.p)(o.unit).offset,s=e.as||sr,u=s[0],l=s[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.modified(Object(Z.g)(n)))&&(h=(t=t.reflow(!0)).SOURCE,f=1/0,d=-1/0),t.visit(h,e=>{const t=n(e);let i,s;null==t?(e[u]=null,r&&(e[l]=null)):(e[u]=i=s=o(t),r&&(e[l]=s=a(i,c)),id&&(d=s))}),o.start=f,o.stop=d,t.modifies(r?s:u)},_floor(e,t){const n="utc"===e.timezone,{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:Object(Ht.n)({extent:e.extent||Object(Z.q)(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Object(Ht.t)(r),a=this.value||{},s=(n?Ht.u:Ht.o)(o,i);return s.unit=Object(Z.V)(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}}),Object(Z.z)(ur,Pe,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=e=>i.set(r(e),e);let a=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,e=>i.delete(r(e))),t.visit(t.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}}),Object(Z.z)(lr,Pe,{transform(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(de(e.sort)):t.source).map(e.field))}});const cr={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){const e=cr.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,r=t.compare;let i=t.index;if(e0||Object(Z.o)("ntile num must be greater than zero.");const n=cr.cume_dist(),r=n.next;return{init:n.init,next:e=>Math.ceil(t*r(e))}},lag:function(e,t){return t=+t||1,{next:n=>{const r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const r=n.index+t,i=n.data;return re(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return(t=+t)>0||Object(Z.o)("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(t-1);return rt=null,next:n=>{const r=e(n.data[n.index]);return null!=r?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{const i=r.data;return r.index<=n?t:(n=function(e,t,n){for(let r=t.length;ns[e]=1)}d(e.sort),t.forEach((e,t)=>{const s=n[t],h=Object(Z.h)(s),p=Vt(e,h,i[t]);if(d(s),o.push(p),Object(Z.w)(cr,e))a.push(function(e,t,n,r){const i=cr[e](t,n);return{init:i.init||Z.lb,update:function(e,t){t[r]=i.next(e)}}}(e,n[t],r[t],p));else{if(null==s&&"count"!==e&&Object(Z.o)("Null aggregate field specified."),"count"===e)return void l.push(p);f=!1;let t=u[h];t||(t=u[h]=[],t.field=s,c.push(t)),t.push(Qt(e,p))}}),(l.length||c.length)&&(this.cell=function(e,t,n){e=e.map(e=>an(e,e.field));const r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),a=0;a0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),re.init()),this.cell&&this.cell.init()},hr.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let a;if(n){for(a=e.p0;athis.group(i(e));let a=this.state;a&&!n||(a=this.state=new dr(e)),n||t.modified(a.inputs)?(this.value={},t.visit(t.SOURCE,e=>o(e).add(e))):(t.visit(t.REM,e=>o(e).remove(e)),t.visit(t.ADD,e=>o(e).add(e)));for(let t=0,n=this._mlen;t0)for(var r,i=e[0],o=t[0],a=e[n]-i,s=t[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*e[u]+(1-this._beta)*(i+r*a),this._beta*t[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var jr=function e(t){function n(e){return 1===t?new vr(e):new wr(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function kr(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Er(e,t){this._context=e,this._k=(1-t)/6}Er.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:kr(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:kr(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ar=function e(t){function n(e){return new Er(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Dr(e,t){this._context=e,this._k=(1-t)/6}Dr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:kr(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Mr=function e(t){function n(e){return new Dr(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Sr(e,t){this._context=e,this._k=(1-t)/6}Sr.prototype={areaStart:xr,areaEnd:xr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:kr(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Cr=function e(t){function n(e){return new Sr(e,t)}return n.tension=function(t){return e(+t)},n}(0),Fr=Math.abs,zr=Math.atan2,Tr=Math.cos,$r=Math.max,Nr=Math.min,Rr=Math.sin,Pr=Math.sqrt,Br=Math.PI,Lr=Br/2,Ir=2*Br;function Ur(e){return e>1?0:e<-1?Br:Math.acos(e)}function qr(e){return e>=1?Lr:e<=-1?-Lr:Math.asin(e)}function Wr(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function Yr(e,t){this._context=e,this._alpha=t}Yr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Wr(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Hr=function e(t){function n(e){return t?new Yr(e,t):new Er(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Gr(e,t){this._context=e,this._alpha=t}Gr.prototype={areaStart:xr,areaEnd:xr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Wr(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Vr=function e(t){function n(e){return t?new Gr(e,t):new Sr(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Xr(e,t){this._context=e,this._alpha=t}Xr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wr(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Jr=function e(t){function n(e){return t?new Xr(e,t):new Dr(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Kr(e){this._context=e}Kr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Zr=function(e){return new Kr(e)};function Qr(e){this._context=e}Qr.prototype={areaStart:xr,areaEnd:xr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ei(e){return e<0?-1:1}function ti(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(ei(o)+ei(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function ni(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ri(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function ii(e){this._context=e}function oi(e){this._context=new ai(e)}function ai(e){this._context=e}function si(e){this._context=e}function ui(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};const ci=Math.PI,fi=2*ci,di=fi-1e-6;function hi(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pi(){return new hi}hi.prototype=pi.prototype={constructor:hi,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-e,u=r-t,l=o-e,c=a-t,f=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(f>1e-6)if(Math.abs(c*s-u*l)>1e-6&&i){var d=n-o,h=r-a,p=s*s+u*u,g=d*d+h*h,m=Math.sqrt(p),b=Math.sqrt(f),y=i*Math.tan((ci-Math.acos((p+f-g)/(2*m*b)))/2),v=y/b,x=y/m;Math.abs(v-1)>1e-6&&(this._+="L"+(e+v*l)+","+(t+v*c)),this._+="A"+i+","+i+",0,0,"+ +(c*d>l*h)+","+(this._x1=e+x*s)+","+(this._y1=t+x*u)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=e+a,l=t+s,c=1^o,f=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+l:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+u+","+l),n&&(f<0&&(f=f%fi+fi),f>di?this._+="A"+n+","+n+",0,1,"+c+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=u)+","+(this._y1=l):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=ci)+","+c+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var gi=pi,mi=function(e){return function(){return e}};function bi(e){return e.innerRadius}function yi(e){return e.outerRadius}function vi(e){return e.startAngle}function xi(e){return e.endAngle}function _i(e){return e&&e.padAngle}function Oi(e,t,n,r,i,o,a,s){var u=n-e,l=r-t,c=a-i,f=s-o,d=f*u-c*l;if(!(d*d<1e-12))return[e+(d=(c*(t-o)-f*(e-i))/d)*u,t+d*l]}function wi(e,t,n,r,i,o,a){var s=e-n,u=t-r,l=(a?o:-o)/Pr(s*s+u*u),c=l*u,f=-l*s,d=e+c,h=t+f,p=n+c,g=r+f,m=(d+p)/2,b=(h+g)/2,y=p-d,v=g-h,x=y*y+v*v,_=i-o,O=d*g-p*h,w=(v<0?-1:1)*Pr($r(0,_*_*x-O*O)),j=(O*v-y*w)/x,k=(-O*y-v*w)/x,E=(O*v+y*w)/x,A=(-O*y+v*w)/x,D=j-m,M=k-b,S=E-m,C=A-b;return D*D+M*M>S*S+C*C&&(j=E,k=A),{cx:j,cy:k,x01:-c,y01:-f,x11:j*(i/_-1),y11:k*(i/_-1)}}Array.prototype.slice;var ji=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)};function ki(e){return e[0]}function Ei(e){return e[1]}var Ai=function(e,t){var n=mi(!0),r=null,i=Zr,o=null;function a(a){var s,u,l,c=(a=ji(a)).length,f=!1;for(null==r&&(o=i(l=gi())),s=0;s<=c;++s)!(s=c;--f)s.point(m[f],b[f]);s.lineEnd(),s.areaEnd()}g&&(m[l]=+e(d,l,u),b[l]=+t(d,l,u),s.point(r?+r(d,l,u):m[l],n?+n(d,l,u):b[l]))}if(h)return s=null,h+""||null}function l(){return Ai().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?ki:mi(+e),t="function"==typeof t?t:mi(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?Ei:mi(+n),u.x=function(t){return arguments.length?(e="function"==typeof t?t:mi(+t),r=null,u):e},u.x0=function(t){return arguments.length?(e="function"==typeof t?t:mi(+t),u):e},u.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:mi(+e),u):r},u.y=function(e){return arguments.length?(t="function"==typeof e?e:mi(+e),n=null,u):t},u.y0=function(e){return arguments.length?(t="function"==typeof e?e:mi(+e),u):t},u.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:mi(+e),u):n},u.lineX0=u.lineY0=function(){return l().x(e).y(t)},u.lineY1=function(){return l().x(e).y(n)},u.lineX1=function(){return l().x(r).y(t)},u.defined=function(e){return arguments.length?(i="function"==typeof e?e:mi(!!e),u):i},u.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),u):a},u.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),u):o},u},Mi={draw:function(e,t){var n=Math.sqrt(t/Br);e.moveTo(n,0),e.arc(0,0,n,0,Ir)}},Si=(Math.sqrt(1/3),Math.sin(Br/10)/Math.sin(7*Br/10));Math.sin(Ir/10),Math.cos(Ir/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12);function Ci(e,t){if("undefined"!=typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const Fi=()=>"undefined"!=typeof Image?Image:null,zi=Object(Yt.a)(Ue.a),Ti=zi.right,$i=zi.left;Object(Yt.a)(He).center;var Ni=Ti;function Ri(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Pi(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}const Bi=Symbol("implicit");function Li(){var e=new Map,t=[],n=[],r=Bi;function i(i){var o=i+"",a=e.get(o);if(!a){if(r!==Bi)return r;e.set(o,a=t.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Map;for(const r of n){const n=r+"";e.has(n)||e.set(n,t.push(r))}return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Li(t,n).unknown(r)},Ri.apply(i,arguments),i}var Ii=n(51),Ui=n(27),qi=n(104),Wi=n(64),Yi=n(105),Hi=n(106);function Gi(e,t,n,r){var i,o=Object(Ii.c)(e,t,n);switch((r=Object(Ui.a)(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=Object(qi.a)(o,a))||(r.precision=i),Object(Wi.b)(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Object(Yi.a)(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Object(Hi.a)(o))||(r.precision=i-2*("%"===r.type))}return Object(Wi.a)(r)}var Vi=function(e,t,n){e.prototype=t.prototype=n,n.constructor=e};function Xi(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ji(){}var Ki="\\s*([+-]?\\d+)\\s*",Zi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eo=/^#([0-9a-f]{3,8})$/,to=new RegExp("^rgb\\("+[Ki,Ki,Ki]+"\\)$"),no=new RegExp("^rgb\\("+[Qi,Qi,Qi]+"\\)$"),ro=new RegExp("^rgba\\("+[Ki,Ki,Ki,Zi]+"\\)$"),io=new RegExp("^rgba\\("+[Qi,Qi,Qi,Zi]+"\\)$"),oo=new RegExp("^hsl\\("+[Zi,Qi,Qi]+"\\)$"),ao=new RegExp("^hsla\\("+[Zi,Qi,Qi,Zi]+"\\)$"),so={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function uo(){return this.rgb().formatHex()}function lo(){return this.rgb().formatRgb()}function co(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=eo.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?fo(t):3===n?new mo(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ho(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ho(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=to.exec(e))?new mo(t[1],t[2],t[3],1):(t=no.exec(e))?new mo(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ro.exec(e))?ho(t[1],t[2],t[3],t[4]):(t=io.exec(e))?ho(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=oo.exec(e))?xo(t[1],t[2]/100,t[3]/100,1):(t=ao.exec(e))?xo(t[1],t[2]/100,t[3]/100,t[4]):so.hasOwnProperty(e)?fo(so[e]):"transparent"===e?new mo(NaN,NaN,NaN,0):null}function fo(e){return new mo(e>>16&255,e>>8&255,255&e,1)}function ho(e,t,n,r){return r<=0&&(e=t=n=NaN),new mo(e,t,n,r)}function po(e){return e instanceof Ji||(e=co(e)),e?new mo((e=e.rgb()).r,e.g,e.b,e.opacity):new mo}function go(e,t,n,r){return 1===arguments.length?po(e):new mo(e,t,n,null==r?1:r)}function mo(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function bo(){return"#"+vo(this.r)+vo(this.g)+vo(this.b)}function yo(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function vo(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function xo(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new wo(e,t,n,r)}function _o(e){if(e instanceof wo)return new wo(e.h,e.s,e.l,e.opacity);if(e instanceof Ji||(e=co(e)),!e)return new wo;if(e instanceof wo)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n0&&u<1?0:a,new wo(a,s,u,e.opacity)}function Oo(e,t,n,r){return 1===arguments.length?_o(e):new wo(e,t,n,null==r?1:r)}function wo(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function jo(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function ko(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}Vi(Ji,co,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:uo,formatHex:uo,formatHsl:function(){return _o(this).formatHsl()},formatRgb:lo,toString:lo}),Vi(mo,go,Xi(Ji,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new mo(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new mo(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bo,formatHex:bo,formatRgb:yo,toString:yo})),Vi(wo,Oo,Xi(Ji,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new wo(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new wo(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new mo(jo(e>=240?e-240:e+120,i,r),jo(e,i,r),jo(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Eo=function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=r()=>e;function Mo(e,t){return function(n){return e+n*t}}function So(e,t){var n=t-e;return n?Mo(e,n>180||n<-180?n-360*Math.round(n/360):n):Do(isNaN(e)?t:e)}function Co(e){return 1==(e=+e)?Fo:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Do(isNaN(t)?n:t)}}function Fo(e,t){var n=t-e;return n?Mo(e,n):Do(isNaN(e)?t:e)}var zo=function e(t){var n=Co(t);function r(e,t){var r=n((e=go(e)).r,(t=go(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Fo(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function To(e){return function(t){var n,r,i=t.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;no&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Uo(n,r)})),o=Yo.lastIndex;return ot&&(n=e,e=t,t=n),l=function(n){return Math.max(e,Math.min(t,n))}),r=u>2?ea:Qo,i=o=null,f}function f(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,u)))(e(l(t)))}return f.invert=function(n){return l(t((o||(o=r(s,a.map(e),Uo)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,Xo),c()):a.slice()},f.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},f.rangeRound=function(e){return s=Array.from(e),u=Vo,c()},f.clamp=function(e){return arguments.length?(l=!!e||Ko,c()):l!==Ko},f.interpolate=function(e){return arguments.length?(u=e,c()):u},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,r){return e=n,t=r,c()}}function ra(){return na()(Ko,Ko)}function ia(e){var t=e.domain;return e.ticks=function(e){var n=t();return Object(Ii.a)(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Gi(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,u=o[a],l=o[s],c=10;for(l0;){if((i=Object(Ii.b)(u,l,n))===r)return o[a]=u,o[s]=l,t(o);if(i>0)u=Math.floor(u/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,l=Math.floor(l*i)/i}r=i}return e},e}function oa(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a0){for(;d<=h;++d)for(c=1,l=n(d);cu)break;g.push(f)}}else for(;d<=h;++d)for(c=o-1,l=n(d);c>=1;--c)if(!((f=l*c)u)break;g.push(f)}2*g.length180?t+=360:t-e>180&&(e+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Uo(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(o.rotate,a.rotate,s,u),function(e,t,n,o){e!==t?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Uo(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(o.skewX,a.skewX,s,u),function(e,t,n,r,o,a){if(e!==n||t!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Uo(e,n)},{i:s-2,x:Uo(t,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(e){for(var t,n=-1,r=u.length;++n6/29*(6/29)*(6/29)?Math.pow(e,1/3):e/(6/29*3*(6/29))+4/29}function ds(e){return e>6/29?e*e*e:6/29*3*(6/29)*(e-4/29)}function hs(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ps(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function gs(e){if(e instanceof bs)return new bs(e.h,e.c,e.l,e.opacity);if(e instanceof cs||(e=us(e)),0===e.a&&0===e.b)return new bs(NaN,00?r:1:0}const Ns="log",Rs="time",Ps="utc",Bs="continuous";function Ls(){const e=Li().unknown(void 0),t=e.domain,n=e.range;let r,i,o=[0,1],a=!1,s=0,u=0,l=.5;function c(){const e=t().length,c=o[1]h+r*e);return n(c?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),c()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},e.bandwidth=function(){return i},e.step=function(){return r},e.round=function(e){return arguments.length?(a=!!e,c()):a},e.padding=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),s=u,c()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),c()):s},e.paddingOuter=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.align=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),c()):l},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const r=o[1]o[1-r])?void 0:(u=Math.max(0,Ti(a,f)-1),l=f===d?u:Ti(a,d)-1,f-a[u]>i+1e-10&&++u,r&&(c=u,u=s-l,l=s-c),u>l?void 0:t().slice(u,l+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return Ls().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(u).align(l)},c()}var Is=Array.prototype.map;function Us(e){return Is.call(e,Z.db)}const qs=Array.prototype.slice;const Ws={};function Ys(e,t,n){const r=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,r=t[0],i=t[1];return i=s&&n[o]<=u&&(l<0&&(l=o),r=o);if(!(l<0))return s=e.invertExtent(n[l]),u=e.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}}(n):void 0),n.type=e,n};return r.metadata=Object(Z.eb)(Object(Z.i)(n)),r}function Hs(e,t,n){return arguments.length>1?(Ws[e]=Ys(e,t,n),this):Gs(e)?Ws[e]:void 0}function Gs(e){return Object(Z.w)(Ws,e)}function Vs(e,t){const n=Ws[e];return n&&n.metadata[t]}function Xs(e){return Vs(e,Bs)}function Js(e){return Vs(e,"discrete")}function Ks(e){return Vs(e,"discretizing")}function Zs(e){return Vs(e,Ns)}function Qs(e){return Vs(e,"interpolating")}function eu(e){return Vs(e,"quantile")}Hs("identity",(function e(t){var n;function r(e){return isNaN(e=+e)?n:e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=Array.from(e,Xo),r):t.slice()},r.unknown=function(e){return arguments.length?(n=e,r):n},r.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,Xo):[0,1],ia(r)})),Hs("linear",(function e(){var t=ra();return t.copy=function(){return ta(t,e())},Ri.apply(t,arguments),ia(t)}),Bs),Hs(Ns,(function e(){var t=da(na()).domain([1,10]);return t.copy=function(){return ta(t,e()).base(t.base())},Ri.apply(t,arguments),t}),[Bs,Ns]),Hs("pow",ba,Bs),Hs("sqrt",(function(){return ba.apply(null,arguments).exponent(.5)}),Bs),Hs("symlog",(function e(){var t=xa(na());return t.copy=function(){return ta(t,e()).constant(t.constant())},Ri.apply(t,arguments)}),Bs),Hs(Rs,(function(){return Ri.apply(Fa(_a.a,Oa.a,wa.b,ja.a,ka.a,Ea.a,Aa.a,Da.a,Ma.a).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Bs,"temporal"]),Hs(Ps,(function(){return Ri.apply(Fa(za.a,Ta.a,$a.b,Na.a,Ra.a,Pa.a,Aa.a,Da.a,Ma.c).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Bs,"temporal"]),Hs("sequential",Ia,[Bs,"interpolating"]),Hs("".concat("sequential","-").concat("linear"),Ia,[Bs,"interpolating"]),Hs("".concat("sequential","-").concat(Ns),(function e(){var t=da(Ba()).domain([1,10]);return t.copy=function(){return La(t,e()).base(t.base())},Pi.apply(t,arguments)}),[Bs,"interpolating",Ns]),Hs("".concat("sequential","-").concat("pow"),Ua,[Bs,"interpolating"]),Hs("".concat("sequential","-").concat("sqrt"),(function(){return Ua.apply(null,arguments).exponent(.5)}),[Bs,"interpolating"]),Hs("".concat("sequential","-").concat("symlog"),(function e(){var t=xa(Ba());return t.copy=function(){return La(t,e()).constant(t.constant())},Pi.apply(t,arguments)}),[Bs,"interpolating"]),Hs("".concat("diverging","-").concat("linear"),(function e(){var t=ia(Wa()(Ko));return t.copy=function(){return La(t,e())},Pi.apply(t,arguments)}),[Bs,"interpolating"]),Hs("".concat("diverging","-").concat(Ns),(function e(){var t=da(Wa()).domain([.1,1,10]);return t.copy=function(){return La(t,e()).base(t.base())},Pi.apply(t,arguments)}),[Bs,"interpolating",Ns]),Hs("".concat("diverging","-").concat("pow"),Ya,[Bs,"interpolating"]),Hs("".concat("diverging","-").concat("sqrt"),(function(){return Ya.apply(null,arguments).exponent(.5)}),[Bs,"interpolating"]),Hs("".concat("diverging","-").concat("symlog"),(function e(){var t=xa(Wa());return t.copy=function(){return La(t,e()).constant(t.constant())},Pi.apply(t,arguments)}),[Bs,"interpolating"]),Hs("quantile",(function e(){var t,n=[],r=[],i=[];function o(){var e=0,t=Math.max(1,r.length);for(i=new Array(t-1);++e0?i[t-1]:n[0],t=i?[o[i-1],r]:[o[t-1],o[t]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return e().domain([n,r]).range(a).unknown(t)},Ri.apply(ia(s),arguments)}),"discretizing"),Hs("threshold",(function e(){var t,n=[.5],r=[0,1],i=1;function o(e){return e<=e?r[Ni(n,e,0,i)]:t}return o.domain=function(e){return arguments.length?(n=Array.from(e),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(e){return arguments.length?(r=Array.from(e),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return e().domain(n).range(r).unknown(t)},Ri.apply(o,arguments)}),"discretizing"),Hs("bin-ordinal",(function e(){let t=[],n=[];function r(e){return null==e||e!=e?void 0:n[(Ni(t,e)-1)%n.length]}return r.domain=function(e){return arguments.length?(t=Us(e),r):t.slice()},r.range=function(e){return arguments.length?(n=qs.call(e),r):n.slice()},r.tickFormat=function(e,n){return Gi(t[0],Object(Z.V)(t),null==e?10:e,n)},r.copy=function(){return e().domain(r.domain()).range(r.range())},r}),["discrete","discretizing"]),Hs("ordinal",Li,"discrete"),Hs("band",Ls,"discrete"),Hs("point",(function(){return function e(t){const n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return e(n())},t}(Ls().paddingInner(1))}),"discrete");const tu=["clamp","base","constant","exponent"];function nu(e,t){const n=t[0],r=Object(Z.V)(t)-n;return function(t){return e(n+t*r)}}function ru(e,t,n){return qa(au(t||"rgb",n),e)}function iu(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[t]?a[t](e[t]()):0),a):Object(Z.m)(.5)}function au(e,t){const n=a[function(e){return"interpolate"+e.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}function su(e){const t=e.length/6|0,n=new Array(t);for(let r=0;r1?(lu[e]=t,this):lu[e]}uu({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"},su),uu({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"},e=>ru(su(e)));const fu=e=>Object(Z.B)(e)?e.map(e=>String(e)):String(e),du=(e,t)=>e[1]-t[1],hu=(e,t)=>t[1]-e[1];function pu(e,t,n){let r;return Object(Z.F)(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(Object(Z.Y)(e.domain())/n||1)))),Object(Z.G)(t)&&(r=t.step,t=t.interval),Object(Z.I)(t)&&(t=e.type===Rs?Object(Ht.p)(t):e.type==Ps?Object(Ht.v)(t):Object(Z.o)("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function gu(e,t,n){let r=e.range(),i=r[0],o=Object(Z.V)(r),a=du;if(i>o&&(r=o,o=i,i=r,a=hu),i=Math.floor(i),o=Math.ceil(o),t=t.map(t=>[t,e(t)]).filter(e=>i<=e[1]&&e[1]<=o).sort(a).map(e=>e[0]),n>0&&t.length>1){const e=[t[0],Object(Z.V)(t)];for(;t.length>n&&t.length>=3;)t=t.filter((e,t)=>!(t%2));t.length<3&&(t=e)}return t}function mu(e,t){return e.bins?gu(e,e.bins):e.ticks?e.ticks(t):e.domain()}function bu(e,t,n,r,i,o){const a=t.type;let s=fu;if(a===Rs||i===Rs)s=e.timeFormat(r);else if(a===Ps||i===Ps)s=e.utcFormat(r);else if(Zs(a)){const i=e.formatFloat(r);if(o||t.bins)s=i;else{const e=yu(t,n,!1);s=t=>e(t)?i(t):""}}else if(t.tickFormat){const i=t.domain();s=e.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=e.format(r));return s}function yu(e,t,n){const r=mu(e,t),i=e.base(),o=Math.log(i),a=Math.max(1,i*t/r.length),s=e=>{let t=e/Math.pow(i,Math.round(Math.log(e)/o));return t*i1?r[1]-r[0]:r[0];for(o=1;ovu[e.type]||e.bins)(t)?wu(s):"discrete"===r?ku(s):Eu(s)}const wu=e=>(t,n,r)=>{const i=ju(r[n+1],ju(r.max,1/0)),o=Au(t,e),a=Au(i,e);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},ju=(e,t)=>null!=e?e:t,ku=e=>(t,n)=>n?e(t):null,Eu=e=>t=>e(t),Au=(e,t)=>Number.isFinite(e)?t(e):null;function Du(e,t,n,r){const i=r||t.type;return Object(Z.I)(n)&&Vs(i,"temporal")&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==Rs?n||i!==Ps?Ou(e,t,5,null,n,r,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function Mu(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=Du(e,t,n.format,n.formatType);if(Ks(t.type)){const e=_u(t).slice(1).map(i),n=e.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(e.join(", "))}if(Js(t.type)){const e=t.domain(),n=e.length,o=n>r?e.slice(0,r-2).map(i).join(", ")+", ending with "+e.slice(-1).map(i):e.map(i).join(", ");return"".concat(n," value").concat(1===n?"":"s",": ").concat(o)}{const e=t.domain();return"values from ".concat(i(e[0])," to ").concat(i(Object(Z.V)(e)))}}let Su=0;function Cu(e){return e&&e.gradient}function Fu(e,t,n){const r=e.gradient;let i=e.id,o="radial"===r?"p_":"";return i||(i=e.id="gradient_"+Su++,"radial"===r?(e.x1=zu(e.x1,.5),e.y1=zu(e.y1,.5),e.r1=zu(e.r1,0),e.x2=zu(e.x2,.5),e.y2=zu(e.y2,.5),e.r2=zu(e.r2,.5),o="p_"):(e.x1=zu(e.x1,0),e.y1=zu(e.y1,0),e.x2=zu(e.x2,1),e.y2=zu(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function zu(e,t){return null!=e?e:t}function Tu(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}}}const $u={basis:{curve:function(e){return new vr(e)}},"basis-closed":{curve:function(e){return new _r(e)}},"basis-open":{curve:function(e){return new Or(e)}},bundle:{curve:jr,tension:"beta",value:.85},cardinal:{curve:Ar,tension:"tension",value:0},"cardinal-open":{curve:Mr,tension:"tension",value:0},"cardinal-closed":{curve:Cr,tension:"tension",value:0},"catmull-rom":{curve:Hr,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Vr,tension:"alpha",value:.5},"catmull-rom-open":{curve:Jr,tension:"alpha",value:.5},linear:{curve:Zr},"linear-closed":{curve:function(e){return new Qr(e)}},monotone:{horizontal:function(e){return new oi(e)},vertical:function(e){return new ii(e)}},natural:{curve:function(e){return new si(e)}},step:{curve:function(e){return new li(e,.5)}},"step-after":{curve:function(e){return new li(e,1)}},"step-before":{curve:function(e){return new li(e,0)}}};function Nu(e,t,n){var r=Object(Z.w)($u,e)&&$u[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const Ru={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},Pu=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];function Bu(e){const t=[];let n,r,i,o,a,s,u,l,c,f;const d=e.slice().replace(Pu[0],"###$1").split(Pu[1]).slice(1);for(u=0,c=d.length;us){const e=i.length;for(l=1,t.push([a].concat(i.slice(l,l+=s))),a="M"===a?"L":"m"===a?"l":a;l1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,b=f/n,y=-f/r,v=d/r,x=m*s+b*u,_=y*s+v*u,O=m*e+b*t,w=y*e+v*t,j=(O-x)*(O-x)+(w-_)*(w-_);let k=1/j-.25;k<0&&(k=0);let E=Math.sqrt(k);o==i&&(E=-E);const A=.5*(x+O)-E*(w-_),D=.5*(_+w)+E*(O-x),M=Math.atan2(_-D,x-A),S=Math.atan2(w-D,O-A);let C=S-M;C<0&&1===o?C+=Uu:C>0&&0===o&&(C-=Uu);const F=Math.ceil(Math.abs(C/(Iu+.001))),z=[];for(let e=0;e+e}function sl(e,t,n){return Math.max(t,Math.min(e,n))}function ul(){var e=nl,t=rl,n=il,r=ol,i=al(0),o=i,a=i,s=i,u=null;function l(l,c,f){var d,h=null!=c?c:+e.call(this,l),p=null!=f?f:+t.call(this,l),g=+n.call(this,l),m=+r.call(this,l),b=Math.min(g,m)/2,y=sl(+i.call(this,l),0,b),v=sl(+o.call(this,l),0,b),x=sl(+a.call(this,l),0,b),_=sl(+s.call(this,l),0,b);if(u||(u=d=gi()),y<=0&&v<=0&&x<=0&&_<=0)u.rect(h,p,g,m);else{var O=h+g,w=p+m;u.moveTo(h+y,p),u.lineTo(O-v,p),u.bezierCurveTo(O-.448084975506*v,p,O,p+.448084975506*v,O,p+v),u.lineTo(O,w-_),u.bezierCurveTo(O,w-.448084975506*_,O-.448084975506*_,w,O-_,w),u.lineTo(h+x,w),u.bezierCurveTo(h+.448084975506*x,w,h,w-.448084975506*x,h,w-x),u.lineTo(h,p+y),u.bezierCurveTo(h,p+.448084975506*y,h+.448084975506*y,p,h+y,p),u.closePath()}if(d)return u=null,d+""||null}return l.x=function(t){return arguments.length?(e=al(t),l):e},l.y=function(e){return arguments.length?(t=al(e),l):t},l.width=function(e){return arguments.length?(n=al(e),l):n},l.height=function(e){return arguments.length?(r=al(e),l):r},l.cornerRadius=function(e,t,n,r){return arguments.length?(i=al(e),o=null!=t?al(t):i,s=null!=n?al(n):i,a=null!=r?al(r):o,l):i},l.context=function(e){return arguments.length?(u=null==e?null:e,l):u},l}function ll(){var e,t,n,r,i,o,a,s,u=null;function l(e,t,n){const r=n/2;if(i){var l=a-t,c=e-o;if(l||c){var f=Math.sqrt(l*l+c*c),d=(l/=f)*s,h=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(o-d,a-h),u.lineTo(e-l*r,t-c*r),u.arc(e,t,r,p-Math.PI,p),u.lineTo(o+d,a+h),u.arc(o,a,s,p,p+Math.PI)}else u.arc(e,t,r,0,Uu);u.closePath()}else i=1;o=e,a=t,s=r}function c(o){var a,s,c,f=o.length,d=!1;for(null==u&&(u=c=gi()),a=0;a<=f;++a)!(ae.x||0,dl=e=>e.y||0,hl=e=>!(!1===e.defined),pl=function(){var e=bi,t=yi,n=mi(0),r=null,i=vi,o=xi,a=_i,s=null;function u(){var u,l,c=+e.apply(this,arguments),f=+t.apply(this,arguments),d=i.apply(this,arguments)-Lr,h=o.apply(this,arguments)-Lr,p=Fr(h-d),g=h>d;if(s||(s=u=gi()),f1e-12)if(p>Ir-1e-12)s.moveTo(f*Tr(d),f*Rr(d)),s.arc(0,0,f,d,h,!g),c>1e-12&&(s.moveTo(c*Tr(h),c*Rr(h)),s.arc(0,0,c,h,d,g));else{var m,b,y=d,v=h,x=d,_=h,O=p,w=p,j=a.apply(this,arguments)/2,k=j>1e-12&&(r?+r.apply(this,arguments):Pr(c*c+f*f)),E=Nr(Fr(f-c)/2,+n.apply(this,arguments)),A=E,D=E;if(k>1e-12){var M=qr(k/c*Rr(j)),S=qr(k/f*Rr(j));(O-=2*M)>1e-12?(x+=M*=g?1:-1,_-=M):(O=0,x=_=(d+h)/2),(w-=2*S)>1e-12?(y+=S*=g?1:-1,v-=S):(w=0,y=v=(d+h)/2)}var C=f*Tr(y),F=f*Rr(y),z=c*Tr(_),T=c*Rr(_);if(E>1e-12){var $,N=f*Tr(v),R=f*Rr(v),P=c*Tr(x),B=c*Rr(x);if(p1e-12?D>1e-12?(m=wi(P,B,C,F,f,D,g),b=wi(N,R,z,T,f,D,g),s.moveTo(m.cx+m.x01,m.cy+m.y01),D1e-12&&O>1e-12?A>1e-12?(m=wi(z,T,N,R,c,-A,g),b=wi(C,F,P,B,c,-A,g),s.lineTo(m.cx+m.x01,m.cy+m.y01),Ae.startAngle||0).endAngle(e=>e.endAngle||0).padAngle(e=>e.padAngle||0).innerRadius(e=>e.innerRadius||0).outerRadius(e=>e.outerRadius||0).cornerRadius(e=>e.cornerRadius||0),gl=Di().x(fl).y1(dl).y0(e=>(e.y||0)+(e.height||0)).defined(hl),ml=Di().y(dl).x1(fl).x0(e=>(e.x||0)+(e.width||0)).defined(hl),bl=Ai().x(fl).y(dl).defined(hl),yl=ul().x(fl).y(dl).width(e=>e.width||0).height(e=>e.height||0).cornerRadius(e=>cl(e.cornerRadiusTopLeft,e.cornerRadius)||0,e=>cl(e.cornerRadiusTopRight,e.cornerRadius)||0,e=>cl(e.cornerRadiusBottomRight,e.cornerRadius)||0,e=>cl(e.cornerRadiusBottomLeft,e.cornerRadius)||0),vl=function(e,t){var n=null;function r(){var r;if(n||(n=r=gi()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+""||null}return e="function"==typeof e?e:mi(e||Mi),t="function"==typeof t?t:mi(void 0===t?64:+t),r.type=function(t){return arguments.length?(e="function"==typeof t?t:mi(t),r):e},r.size=function(e){return arguments.length?(t="function"==typeof e?e:mi(+e),r):t},r.context=function(e){return arguments.length?(n=null==e?null:e,r):n},r}().type(e=>el(e.shape||"circle")).size(e=>cl(e.size,64)),xl=ll().x(fl).y(dl).defined(hl).size(e=>e.size||1);function _l(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Ol(e,t,n,r){return yl.context(e)(t,n,r)}var wl=1;function jl(){wl=1}function kl(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+wl++),a=i.clipping[o]||(i.clipping[o]={id:o});return Object(Z.E)(r)?a.path=r(null):_l(n)?a.path=Ol(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function El(e){this.clear(),e&&this.union(e)}function Al(e){this.mark=e,this.bounds=this.bounds||new El}function Dl(e){Al.call(this,e),this.items=this.items||[]}function Ml(e){this._pending=0,this._loader=e||Object(Q.e)()}function Sl(e){e._pending+=1}function Cl(e){e._pending-=1}function Fl(e,t,n){if(t.stroke&&0!==t.opacity&&0!==t.strokeOpacity){const r=null!=t.strokeWidth?+t.strokeWidth:1;e.expand(r+(n?function(e,t){return e.strokeJoin&&"miter"!==e.strokeJoin?0:t}(t,r):0))}return e}El.prototype={clone(){return new El(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){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(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const 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(e,t,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(e),u=Math.sin(e),l=t-t*s+n*u,c=n-t*u-n*s;return[s*r-u*i+l,u*r+s*i+c,s*r-u*a+l,u*r+s*a+c,s*o-u*i+l,u*o+s*i+c,s*o-u*a+l,u*o+s*a+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(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(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},Object(Z.z)(Dl,Al),Ml.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return Sl(t),t._loader.sanitize(e,{context:"href"}).then(e=>(Cl(t),e)).catch(()=>(Cl(t),null))},loadImage(e){const t=this,n=Fi();return Sl(t),t._loader.sanitize(e,{context:"image"}).then(e=>{const r=e.href;if(!r||!n)throw{url:r};const i=new n,o=Object(Z.w)(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>Cl(t),i.onerror=()=>Cl(t),i.src=r,i}).catch(e=>(Cl(t),{complete:!1,width:0,height:0,src:e&&e.url||""}))},ready(){const e=this;return new Promise(t=>{!function n(r){e.pending()?setTimeout(()=>{n(!0)},10):t(r)}(!1)})}};const zl=Uu-1e-8;let Tl,$l,Nl,Rl,Pl,Bl,Ll,Il;const Ul=(e,t)=>Tl.add(e,t),ql=(e,t)=>Ul($l=e,Nl=t),Wl=e=>Ul(e,Tl.y1),Yl=e=>Ul(Tl.x1,e),Hl=(e,t)=>Pl*e+Ll*t,Gl=(e,t)=>Bl*e+Il*t,Vl=(e,t)=>Ul(Hl(e,t),Gl(e,t)),Xl=(e,t)=>ql(Hl(e,t),Gl(e,t));function Jl(e,t){return Tl=e,t?(Rl=t*Lu,Pl=Il=Math.cos(Rl),Bl=Math.sin(Rl),Ll=-Bl):(Pl=Il=1,Rl=Bl=Ll=0),Kl}const Kl={beginPath(){},closePath(){},moveTo:Xl,lineTo:Xl,rect(e,t,n,r){Rl?(Vl(e+n,t),Vl(e+n,t+r),Vl(e,t+r),Xl(e,t)):(Ul(e+n,t+r),ql(e,t))},quadraticCurveTo(e,t,n,r){const i=Hl(e,t),o=Gl(e,t),a=Hl(n,r),s=Gl(n,r);Zl($l,i,a,Wl),Zl(Nl,o,s,Yl),ql(a,s)},bezierCurveTo(e,t,n,r,i,o){const a=Hl(e,t),s=Gl(e,t),u=Hl(n,r),l=Gl(n,r),c=Hl(i,o),f=Gl(i,o);Ql($l,a,u,c,Wl),Ql(Nl,s,l,f,Yl),ql(c,f)},arc(e,t,n,r,i,o){if(r+=Rl,i+=Rl,$l=n*Math.cos(i)+e,Nl=n*Math.sin(i)+t,Math.abs(i-r)>zl)Ul(e-n,t-n),Ul(e+n,t+n);else{const a=r=>Ul(n*Math.cos(r)+e,n*Math.sin(r)+t);let s,u;if(a(r),a(i),i!==r)if((r%=Uu)<0&&(r+=Uu),(i%=Uu)<0&&(i+=Uu),ii;++u,s-=Iu)a(s);else for(s=r-r%Iu+Iu,u=0;u<4&&s1e-14?(u=a*a+s*o,u>=0&&(u=Math.sqrt(u),l=(-a+u)/o,c=(-a-u)/o)):l=.5*s/a,0m)return!1;h>g&&(g=h)}else if(f>0){if(h0&&(e.globalAlpha=n,e.fillStyle=fc(e,t,t.fill),!0)}var hc=[];function pc(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=fc(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||hc),e.lineDashOffset=t.strokeDashOffset||0),!0))}function gc(e,t){return e.zindex-t.zindex||e.index-t.index}function mc(e){if(!e.zdirty)return e.zitems;var t,n,r,i=e.items,o=[];for(n=0,r=i.length;n=0;)if(n=t(i[r]))return n;if(i===o)for(r=(i=e.items).length;--r>=0;)if(!i[r].zindex&&(n=t(i[r])))return n;return null}function vc(e){return function(t,n,r){bc(n,n=>{r&&!r.intersects(n.bounds)||xc(e,t,n,n)})}}function xc(e,t,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(e(t,r)||(uc(t,n),n.fill&&dc(t,n,i)&&t.fill(),n.stroke&&pc(t,n,i)&&t.stroke()))}function _c(e){return e=e||Z.hb,function(t,n,r,i,o,a){return r*=t.pixelRatio,i*=t.pixelRatio,yc(n,n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return e(t,n,r,i,o,a)?n:void 0})}}function Oc(e,t){return function(n,r,i,o){var a,s,u=Array.isArray(r)?r[0]:r,l=null==t?u.fill:t,c=u.stroke&&n.isPointInStroke;return c&&(a=u.strokeWidth,s=u.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!e(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function wc(e){return _c(Oc(e))}function jc(e,t){return"translate("+e+","+t+")"}function kc(e){return"rotate("+e+")"}function Ec(e){return jc(e.x||0,e.y||0)}function Ac(e,t,n){function r(e,n){var r=n.x||0,i=n.y||0,o=n.angle||0;e.translate(r,i),o&&e.rotate(o*=Lu),e.beginPath(),t(e,n),o&&e.rotate(-o),e.translate(-r,-i)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return jc(e.x||0,e.y||0)+(e.angle?" "+kc(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(Jl(e,n.angle),n),Fl(e,n).translate(n.x||0,n.y||0)},draw:vc(r),pick:wc(r),isect:n||rc(r)}}var Dc=Ac("arc",(function(e,t){return pl.context(e)(t)}));function Mc(e,t,n){function r(e,n){e.beginPath(),t(e,n)}const i=Oc(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(Jl(e),r),Fl(e,r[0]))},draw:(o=r,function(e,t,n){!t.items.length||n&&!n.intersects(t.bounds)||xc(o,e,t.items[0],t.items)}),pick:function(e,t,n,r,o,a){var s=t.items,u=t.bounds;return!s||!s.length||u&&!u.contains(o,a)?null:(n*=e.pixelRatio,r*=e.pixelRatio,i(e,s,n,r)?s[0]:null)},isect:ic,tip:n};var o}var Sc=Mc("area",(function(e,t){const n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?ml:gl).curve(Nu(r,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,r,i="horizontal"===e[0].orient?t[1]:t[0],o="horizontal"===e[0].orient?"y":"x",a=e.length,s=1/0;--a>=0;)!1!==e[a].defined&&(r=Math.abs(e[a][o]-i)).5&&t<1.5?.5-Math.abs(t-1):0}function zc(e,t){const n=Fc(t);e("d",Ol(null,t,n,n))}function Tc(e,t,n,r){const i=Fc(t);e.beginPath(),Ol(e,t,(n||0)+i,(r||0)+i)}const $c=Oc(Tc),Nc=Oc(Tc,!1),Rc=Oc(Tc,!0);var Pc={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",Ec(t))},bound:function(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let t=0;t{const r=t.x||0,i=t.y||0,o=t.strokeForeground,a=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&a&&(Tc(e,t,r,i),uc(e,t),t.fill&&dc(e,t,a)&&e.fill(),t.stroke&&!o&&pc(e,t,a)&&e.stroke()),e.save(),e.translate(r,i),t.clip&&Cc(e,t),n&&n.translate(-r,-i),bc(t,t=>{this.draw(e,t,n)}),n&&n.translate(r,i),e.restore(),o&&t.stroke&&a&&(Tc(e,t,r,i),uc(e,t),pc(e,t,a)&&e.stroke())})},pick:function(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;const a=n*e.pixelRatio,s=r*e.pixelRatio;return yc(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(i,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(ih||op))return;if(e.save(),e.translate(c,f),c=i-c,f=o-f,g&&_l(u)&&!Rc(e,u,a,s))return e.restore(),null;const m=u.strokeForeground,b=!1!==t.interactive;return b&&m&&u.stroke&&Nc(e,u,a,s)?(e.restore(),u):(l=yc(u,e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,c,f)?this.pick(e,n,r,c,f):null),!l&&b&&(u.fill||!m&&u.stroke)&&$c(e,u,a,s)&&(l=u),e.restore(),l||null)})},isect:oc,content:function(e,t,n){e("clip-path",t.clip?kl(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),zc(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?zc(e,t):e("d","")}},Bc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Lc(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(t=>{e.image=t,e.image.url=e.url})),n}function Ic(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 Uc(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 qc(e,t){return"center"===e?t/2:"right"===e?t:0}function Wc(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Yc={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const r=Lc(t,n),i=Ic(t,r),o=Uc(t,r),a=(t.x||0)-qc(t.align,i),s=(t.y||0)-Wc(t.baseline,o);e("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",Bc["xmlns:xlink"],"xlink:href"),e("transform",jc(a,s)),e("width",i),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,r=Ic(t,n),i=Uc(t,n),o=(t.x||0)-qc(t.align,r),a=(t.y||0)-Wc(t.baseline,i);return e.set(o,a,o+r,a+i)},draw:function(e,t,n){bc(t,t=>{if(n&&!n.intersects(t.bounds))return;const r=Lc(t,this);let i,o,a,s,u=Ic(t,r),l=Uc(t,r),c=(t.x||0)-qc(t.align,u),f=(t.y||0)-Wc(t.baseline,l);!1!==t.aspect&&(o=r.width/r.height,a=t.width/t.height,o==o&&a==a&&o!==a&&(a=0;)if(!1!==e[o].defined&&(n=e[o].x-t[0])*n+(r=e[o].y-t[1])*r{if(!n||n.intersects(t.bounds)){var r=null==t.opacity?1:t.opacity;r&&Kc(e,t,r)&&(uc(e,t),e.stroke())}})},pick:_c((function(e,t,n,r){return!!e.isPointInStroke&&(Kc(e,t,1)&&e.isPointInStroke(n,r))})),isect:ac},Qc=Ac("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),ef=Ac("symbol",(function(e,t){return vl.context(e)(t)}),ic);const tf=Object(Z.M)();var nf={height:lf,measureWidth:sf,estimateWidth:of,width:of,canvas:rf};function rf(e){nf.width=e&&tc?sf:of}function of(e,t){return af(hf(e,t),lf(e))}function af(e,t){return~~(.8*e.length*t)}function sf(e,t){return lf(e)<=0||!(t=hf(e,t))?0:uf(t,gf(e))}function uf(e,t){const n="(".concat(t,") ").concat(e);let r=tf.get(n);return void 0===r&&(tc.font=t,r=tc.measureText(e).width,tf.set(n,r)),r}function lf(e){return null!=e.fontSize?+e.fontSize||0:11}function cf(e){return null!=e.lineHeight?e.lineHeight:lf(e)+2}function ff(e){return t=e.lineBreak&&e.text&&!Object(Z.B)(e.text)?e.text.split(e.lineBreak):e.text,Object(Z.B)(t)?t.length>1?t:t[0]:t;var t}function df(e){const t=ff(e);return(Object(Z.B)(t)?t.length-1:0)*cf(e)}function hf(e,t){const n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,r=function(e){if(nf.width===sf){const t=gf(e);return e=>uf(e,t)}{const t=lf(e);return e=>af(e,t)}}(e);if(r(t)>>1,r(t.slice(i))>n?s=i+1:u=i;return o+t.slice(s)}for(;s>>1),r(t.slice(0,i))Math.max(e,nf.width(t,n)),0)):r=nf.width(t,f),"center"===o?l-=r/2:"right"===o&&(l-=r),e.set(l+=s,c+=u,l+r,c+i),t.angle&&!n)e.rotate(t.angle*Lu,s,u);else if(2===n)return e.rotatedPoints(t.angle*Lu,s,u);return e}var _f={arc:Dc,area:Sc,group:Pc,image:Yc,line:Hc,path:Vc,rect:Jc,rule:Zc,shape:Qc,symbol:ef,text:{type:"text",tag:"text",nested:!1,attr:function(e,t){var n,r=t.dx||0,i=(t.dy||0)+mf(t),o=vf(t),a=o.x1,s=o.y1,u=t.angle||0;e("text-anchor",bf[t.align]||"start"),u?(n=jc(a,s)+" "+kc(u),(r||i)&&(n+=" "+jc(r,i))):n=jc(a+r,s+i),e("transform",n)},bound:xf,draw:function(e,t,n){bc(t,t=>{var r,i,o,a,s,u,l,c=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===c||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=gf(t),e.textAlign=t.align||"left",i=(r=vf(t)).x1,o=r.y1,t.angle&&(e.save(),e.translate(i,o),e.rotate(t.angle*Lu),i=o=0),i+=t.dx||0,o+=(t.dy||0)+mf(t),u=ff(t),uc(e,t),Object(Z.B)(u))for(s=cf(t),a=0;a=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}))};function Of(e,t,n){var r=_f[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new El),e,n)}var wf={mark:null};function jf(e,t,n){var r,i,o,a,s=_f[e.marktype],u=s.bound,l=e.items,c=l&&l.length;if(s.nested)return c?o=l[0]:(wf.mark=e,o=wf),a=Of(o,u,n),t=t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new El,c)for(r=0,i=l.length;rt;)e.removeChild(n[--r]);return e}function Tf(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function $f(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function Nf(e,t){this._active=null,this._handlers={},this._loader=e||Object(Q.e)(),this._tooltip=t||Rf}function Rf(e,t,n,r){e.element().setAttribute("title",r||"")}function Pf(e){this._el=null,this._bgcolor=null,this._loader=new Ml(e)}Df.prototype={toJSON(e){return Ef(this.root,e||0)},mark(e,t,n){const r=Mf(e,t=t||this.root.items[0]);return t.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},Nf.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let r=e?e.length:0;--r>=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const e in t)n.push(...t[e]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then(t=>{const n=new MouseEvent(e.type,e),r=Sf(null,"a");for(const e in t)r.setAttribute(e,t[e]);r.dispatchEvent(n)}).catch(()=>{})},handleTooltip(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,r){var i,o,a=e&&e.mark;if(a&&(i=_f[a.marktype]).tip){for((o=$f(t,n))[0]-=r[0],o[1]-=r[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=i.tip(a.items,o)}return e}(t,e,this.canvas(),this._origin);const r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,o=i.width(),a=i.height();let s=i.x1+r[0]+n.left,u=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)s+=e.x||0,u+=e.y||0;return{x:s,y:u,width:o,height:a,left:s,top:u,right:s+o,bottom:u+a}}},Pf.prototype={initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(e){const t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},_render(){},renderAsync(e){const t=this.render(e);return this._ready?this._ready.then(()=>t):Promise.resolve(t)},_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){const e=n._call;n._ready=n._loader.ready().then(t=>{t&&e(),n._ready=null})}return r},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const Bf="dragleave",Lf="mousedown",If="mousemove",Uf="mouseout",qf="click",Wf=["keydown","keypress","keyup","dragenter",Bf,"dragover",Lf,"mouseup",If,Uf,"mouseover",qf,"dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],Yf=If,Hf=Uf,Gf=qf;function Vf(e,t){Nf.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function Xf(e,t){(e=>"touchstart"===e||"touchmove"===e||"touchend"===e?["touchstart","touchmove","touchend"]:[e])(t).forEach(t=>function(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}(e,t))}function Jf(e,t,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||this.fire(n,r),this._active=o,this.fire(t,r)),this.fire(e,r)}}function Kf(e){return function(t){this.fire(e,t),this._active=null}}Object(Z.z)(Vf,Nf,{initialize(e,t,n){return this._canvas=e&&Cf(e,"canvas"),[qf,Lf,If,Uf,Bf].forEach(e=>Xf(this,e)),Nf.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:Wf,DOMMouseScroll(e){this.fire("mousewheel",e)},mousemove:Jf(If,"mouseover",Uf),dragover:Jf("dragover","dragenter",Bf),mouseout:Kf(Uf),dragleave:Kf(Bf),mousedown(e){this._down=this._active,this.fire(Lf,e)},click(e){this._down===this._active&&(this.fire(qf,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",e,!0)},touchmove(e){this.fire("touchmove",e,!0)},touchend(e){this.fire("touchend",e,!0),this._touch=null},fire(e,t,n){const r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===Gf&&r&&r.href?this.handleHref(t,r,r.href):e!==Yf&&e!==Hf||this.handleTooltip(t,r,e!==Hf),i)for(let e=0,n=i.length;e=0&&r.splice(i,1),this},pickEvent(e){const t=$f(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,r,i){const o=this.context();return _f[e.marktype].pick.call(this,o,e,t,n,r,i)}});var Zf="undefined"!=typeof window&&window.devicePixelRatio||1;function Qf(e){Pf.call(this,e),this._options={},this._redraw=!1,this._dirty=new El,this._tempb=new El}const ed=Pf.prototype;function td(e,t){Nf.call(this,e,t);const n=this;n._hrefHandler=nd(n,(e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)}),n._tooltipHandler=nd(n,(e,t)=>{n.handleTooltip(e,t,e.type!==Hf)})}Object(Z.z)(Qf,Pf,{initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Ci(1,1,this._options.type),e&&this._canvas&&(zf(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),ed.initialize.call(this,e,t,n,r,i)},resize(e,t,n,r){if(ed.resize.call(this,e,t,n,r),this._canvas)!function(e,t,n,r,i,o){const a="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),u=a?Zf:i;e.width=t*u,e.height=n*u;for(const e in o)s[e]=o[e];a&&1!==u&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=u,s.setTransform(u,0,0,u,u*r[0],u*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||Object(Z.o)("CanvasRenderer is missing a valid canvas or context"),e.scale(this._scale,this._scale),e.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e){const t=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,a=(s=n,u=r,l=i,(new El).set(0,0,u,l).translate(-s[0],-s[1]));var s,u,l;t.save();const c=this._redraw||o.empty()?(this._redraw=!1,a.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,a.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(t,e,c),t.restore(),o.clear(),this},draw(e,t,n){const r=_f[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),Object(Z.E)(n)?(e.beginPath(),n(e),e.clip()):Cc(e,t.group)}(e,t),r.draw.call(this,e,t,n),t.clip&&e.restore()},clear(e,t,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(e,t,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,r))}});const nd=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)};Object(Z.z)(td,Nf,{initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(Gf,this._hrefHandler),r.removeEventListener(Yf,this._tooltipHandler),r.removeEventListener(Hf,this._tooltipHandler)),this._svg=r=e&&Cf(e,"svg"),r&&(r.addEventListener(Gf,this._hrefHandler),r.addEventListener(Yf,this._tooltipHandler),r.addEventListener(Hf,this._tooltipHandler)),Nf.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){const i={type:e,handler:t,listener:nd(this,t)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off(e,t){const 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}});const rd=(e,t,n)=>({role:e,"aria-roledescription":t,"aria-label":n||void 0}),id=Object(Z.eb)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),od={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,r=t.title?cd(e):null,i=e.context,o=i.scales[t.scale].value,a=i.dataflow.locale(),s=o.type;return"".concat("left"===n||"right"===n?"Y":"X","-axis")+(r?" titled '".concat(r,"'"):"")+" for a ".concat(Js(s)?"discrete":s," scale")+" with ".concat(Mu(a,o,e))}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?cd(e):null,r="".concat(t.type||""," legend").trim(),i=t.scales,o=Object.keys(i),a=e.context,s=a.scales[i[o[0]]].value,u=a.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(e=>e+("fill"===e||"stroke"===e?" color":""))).length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Object(Z.V)(e)}(o))+" with ".concat(Mu(u,s,e));var l}},"title-text":{desc:"title",caption:e=>"Title text '".concat(ld(e),"'")},"title-subtitle":{desc:"subtitle",caption:e=>"Subtitle text '".concat(ld(e),"'")}},ad={ariaRole:"role",ariaRoleDescription:"aria-roledescription",description:"aria-label"};function sd(e,t){const n=!1===t.aria;if(e("aria-hidden",n||void 0),n||null==t.description)for(const t in ad)e(ad[t],void 0);else{const n=t.mark.marktype;e("aria-label",t.description),e("role",t.ariaRole||("group"===n?"graphics-object":"graphics-symbol")),e("aria-roledescription",t.ariaRoleDescription||"".concat(n," mark"))}}function ud(e){return!1===e.aria?{"aria-hidden":!0}:id[e.role]?null:od[e.role]?function(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return rd(t.role||"graphics-symbol",t.desc,n.description||r(n))}catch(e){return null}}(e,od[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some(e=>null!=e.description&&!1!==e.aria);return rd(n?"graphics-object":"graphics-symbol","".concat(t," mark container"),e.description)}(e)}function ld(e){return Object(Z.i)(e.text).join(" ")}function cd(e){try{return Object(Z.i)(Object(Z.V)(e.items).items[0].text).join(" ")}catch(e){return null}}const fd=e=>(e+"").replace(/&/g,"&").replace(//g,">");function dd(){let e="",t="",n="";const r=[],i=()=>t=n="",o=(e,n)=>(null!=n&&(t+=" ".concat(e,'="').concat(fd(n).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," "),'"')),a),a={open(s,...u){(o=>{t&&(e+="".concat(t,">").concat(n),i()),r.push(o)})(s),t="<"+s;for(const e of u)for(const t in e)o(t,e[t]);return a},close(){const o=r.pop();return e+=t?t+(n?">".concat(n,""):"/>"):""),i(),a},attr:o,text:e=>(n+=fd(e),a),toString:()=>e};return a}const hd=e=>function e(t,n){if(t.open(n.tagName),n.hasAttributes()){const e=n.attributes,r=e.length;for(let n=0;n1&&e.previousSibling!=t}(a,n))&&t.insertBefore(a,n?n.nextSibling:t.firstChild),a}Object(Z.z)(bd,Pf,{initialize(e,t,n,r,i){return this._defs={},this._clearDefs(),e&&(this._svg=Ff(e,0,"svg",md),Dd(this._svg,Bc),this._svg.setAttribute("class","marks"),zf(e,1),this._root=Ff(this._svg,0,"g",md),Dd(this._root,gd),zf(this._svg,1)),this.background(this._bgcolor),yd.initialize.call(this,e,t,n,r,i)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),yd.background.apply(this,arguments)},resize(e,t,n,r){return yd.resize.call(this,e,t,n,r),this._svg&&(Dd(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(){return this._svg},svg(){const e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute("style"),n=Ff(e,0,"rect",md),Dd(n,{width:this._width,height:this._height,fill:t}));const r=hd(e);return t&&(e.removeChild(n),this._svg.style.setProperty("background-color",t)),r},_render(e){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e),zf(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},isDirty(e){return this._dirtyAll||!e._svg||e.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const e=this._dirty;if(!e.length||!this._dirtyID)return!0;const t=++this._dirtyID;let n,r,i,o,a,s,u;for(a=0,s=e.length;a{e.dirty=t})),r.zdirty||(n.exit?(o.nested&&r.items.length?(u=r.items[0],u._svg&&this._update(o,u._svg,u)):n._svg&&(u=n._svg.parentNode,u&&u.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,vd(n,t)),n._update=t)));return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const r=this._svg,i=_f[t.marktype],o=!1===t.interactive?"none":null,a="g"===i.tag;let s=null,u=0;const l=Od(t,e,n,"g",r);l.setAttribute("class",Tf(t));const c=ud(t);for(const e in c)Md(l,e,c[e]);a||Md(l,"pointer-events",o),Md(l,"clip-path",t.clip?kl(this,t,t.group):null);const f=e=>{const t=this.isDirty(e),n=Od(e,l,s,i.tag,r);t&&(this._update(i,n,e),a&&function(e,t,n){t=t.lastChild.previousSibling;let r,i=0;bc(n,n=>{r=e.mark(t,n,r),++i}),zf(t,1+i)}(this,n,e)),s=n,++u};return i.nested?t.items.length&&f(t.items[0]):bc(t,f),zf(l,u),l},_update(e,t,n){wd=t,jd=t.__values__,sd(Ed,n),e.attr(Ed,n,this);const r=kd[e.type];r&&r.call(this,e,t,n),wd&&this.style(wd,n)},style(e,t){if(null!=t)for(const n in pd){let r="font"===n?pf(t):t[n];if(r===jd[n])continue;const i=pd[n];null==r?e.removeAttribute(i):(Cu(r)&&(r=Fu(r,this._defs.gradient,Sd())),e.setAttribute(i,r+"")),jd[n]=r}},defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=Ff(e,1,"defs",md)),r=xd(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=Ff(e,1,"defs",md)),r=_d(n,t.clipping[i],r);n&&(0===r?(e.removeChild(n),t.el=null):zf(n,r))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});let wd=null,jd=null;const kd={group(e,t,n){const r=wd=t.childNodes[2];jd=r.__values__,e.foreground(Ed,n,this),jd=t.__values__,wd=t.childNodes[1],e.content(Ed,n,this);const i=wd=t.childNodes[0];e.background(Ed,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==jd.events&&(Md(r,"pointer-events",o),Md(i,"pointer-events",o),jd.events=o),n.strokeForeground&&n.stroke){const e=n.fill;Md(r,"display",null),this.style(i,n),Md(i,"stroke",null),e&&(n.fill=null),jd=r.__values__,this.style(r,n),e&&(n.fill=e),wd=null}else Md(r,"display","none")},image(e,t,n){!1===n.smooth?(Ad(t,"image-rendering","optimizeSpeed"),Ad(t,"image-rendering","pixelated")):Ad(t,"image-rendering",null)},text(e,t,n){const r=ff(n);let i,o,a,s;Object(Z.B)(r)?(o=r.map(e=>hf(n,e)),i=o.join("\n"),i!==jd.text&&(zf(t,0),a=t.ownerDocument,s=cf(n),o.forEach((e,r)=>{const i=Sf(a,"tspan",md);i.__data__=n,i.textContent=e,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),t.appendChild(i)}),jd.text=i)):(o=hf(n,r),o!==jd.text&&(t.textContent=o,jd.text=o)),Md(t,"font-family",pf(n)),Md(t,"font-size",lf(n)+"px"),Md(t,"font-style",n.fontStyle),Md(t,"font-variant",n.fontVariant),Md(t,"font-weight",n.fontWeight)}};function Ed(e,t,n){t!==jd[e]&&(n?function(e,t,n,r){null!=n?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}(wd,e,t,n):Md(wd,e,t),jd[e]=t)}function Ad(e,t,n){n!==jd[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),jd[t]=n)}function Dd(e,t){for(const n in t)Md(e,n,t[n])}function Md(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function Sd(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function Cd(e){Pf.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}Object(Z.z)(Cd,Pf,{svg(){return this._text},_render(e){const t=dd();t.open("svg",Object(Z.p)({},Bc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",gd,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=_f[t.marktype],r=n.tag,i=[sd,n.attr];e.open("g",{class:Tf(t),"clip-path":t.clip?kl(this,t,t.group):null},ud(t),{"pointer-events":"g"!==r&&!1===t.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&e.open("a",a),e.open(r,this.attr(t,o,i,"g"!==r?r:null)),"text"===r){const t=ff(o);if(Object(Z.B)(t)){const n={x:0,dy:cf(o)};for(let r=0;rthis.mark(e,t)),e.close(),r&&a?(i&&(o.fill=null),o.stroke=a,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):bc(t,o),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then(e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e})}return null},attr(e,t,n,r){const i={},o=(e,t,n,r)=>{i[r||e]=t};return Array.isArray(n)?n.forEach(e=>e(o,t,this)):n(o,t,this),r&&function(e,t,n,r,i){if(null==t)return e;"bgrect"===r&&!1===n.interactive&&(e["pointer-events"]="none");if("bgfore"===r&&(!1===n.interactive&&(e["pointer-events"]="none"),e.display="none",null!==t.fill))return e;"image"===r&&!1===t.smooth&&(e.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===r&&(e["font-family"]=pf(t),e["font-size"]=lf(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const n in pd){let r=t[n];const o=pd[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(Cu(r)&&(r=Fu(r,i.gradient,"")),e[o]=r)}}(i,t,e,r,this._defs),i},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(t).length+Object.keys(n).length){e.open("defs");for(const n in t){const r=t[n],i=r.stops;"radial"===r.gradient?(e.open("pattern",{id:"p_"+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),e.close(),e.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):e.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let t=0;t1?(zd[e]=t,this):zd[e]}function $d(e,t,n){const r=[],i=(new El).union(t),o=e.marktype;return o?Nd(e,i,n,r):"group"===o?Rd(e,i,n,r):Object(Z.o)("Intersect scene must be mark node or group item.")}function Nd(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)){const i=e.items,o=e.marktype,a=i.length;let s=0;if("group"===o)for(;s=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(n=i[r],!Id(e[n],t[n],n))return!1;return typeof e==typeof t}(e,t):e==t)}function Ud(e,t){return Id(Bu(e),Bu(t))}function qd(){jl(),Su=0}const Wd="top",Yd="left",Hd="right",Gd="end",Vd="row";function Xd(e){Pe.call(this,null,e)}function Jd(e,t,n){return t(e.bounds.clear(),e,n)}Object(Z.z)(Xd,Pe,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=_f[i],a=o.bound;let s,u=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),u=Jd(r,a),r.items.forEach(e=>{e.bounds.clear().union(u)});else if("group"===i||e.modified())switch(t.visit(t.MOD,e=>n.dirty(e)),u.clear(),r.items.forEach(e=>u.union(Jd(e,a))),r.role){case"axis":case"legend":case"title":t.reflow()}else s=t.changed(t.REM),t.visit(t.ADD,e=>{u.union(Jd(e,a))}),t.visit(t.MOD,e=>{s=s||u.alignsWith(e.bounds),n.dirty(e),u.union(Jd(e,a))}),s&&(u.clear(),r.items.forEach(e=>u.union(e.bounds)));return Ld(r),t.modifies("bounds")}});function Kd(e){Pe.call(this,0,e)}function Zd(e){Pe.call(this,null,e)}function Qd(e){Pe.call(this,null,e)}Kd.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},Object(Z.z)(Kd,Pe,{transform(e,t){const n=(i=t.dataflow)._signals[":vega_identifier:"]||(i._signals[":vega_identifier:"]=i.add(0)),r=e.as;var i;let o=n.value;return t.visit(t.ADD,e=>e[r]=e[r]||++o),n.set(this.value=o),t}}),Object(Z.z)(Zd,Pe,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,function(e){const 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),n.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);const r="group"===n.marktype?Dl:Al;return t.visit(t.ADD,e=>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}});const eh={parity:e=>e.filter((e,t)=>t%2?e.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((e,r)=>r&&th(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1))}},th=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),nh=(e,t)=>{for(var n,r=1,i=e.length,o=e[0].bounds;r{const t=e.bounds;return t.width()>1&&t.height()>1},ih=e=>(e.forEach(e=>e.opacity=1),e),oh=(e,t)=>e.reflow(t.modified()).modifies("opacity");function ah(e){Pe.call(this,null,e)}Object(Z.z)(Qd,Pe,{transform(e,t){const n=eh[e.method]||eh.parity,r=e.separation||0;let i,o,a=t.materialize(t.SOURCE).source;if(!a||!a.length)return;if(!e.method)return e.modified("method")&&(ih(a),t=oh(t,e)),t;if(a=a.filter(rh),!a.length)return;if(e.sort&&(a=a.slice().sort(e.sort)),i=ih(a),t=oh(t,e),i.length>=3&&nh(i,r)){do{i=n(i,r)}while(i.length>=3&&nh(i,r));i.length<3&&!Object(Z.V)(a).opacity&&(i.length>1&&(Object(Z.V)(i).opacity=0),Object(Z.V)(a).opacity=1)}var s,u,l,c,f;e.boundScale&&e.boundTolerance>=0&&(s=e.boundScale,u=e.boundOrient,l=+e.boundTolerance,c=s.range(),f=new El,u===Wd||"bottom"===u?f.set(c[0],-1/0,c[1],1/0):f.set(-1/0,c[0],1/0,c[1]),f.expand(l||1),o=e=>f.encloses(e.bounds),a.forEach(e=>{o(e)||(e.opacity=0)}));const d=i[0].mark.bounds.clear();return a.forEach(e=>{e.opacity&&d.union(e.bounds)}),t}}),Object(Z.z)(ah,Pe,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,e=>n.dirty(e)),t.fields&&t.fields.zindex){const e=t.source&&t.source[0];e&&(e.mark.zdirty=!0)}}});const sh=new El;function uh(e,t,n){return e[t]===n?0:(e[t]=n,1)}function lh(e){var t=e.items[0].orient;return t===Yd||t===Hd}function ch(e,t,n,r){var i,o,a=t.items[0],s=a.datum,u=null!=a.translate?a.translate:.5,l=a.orient,c=function(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,g=a.maxExtent,m=s.title&&a.items[c[2]].items[0],b=a.titlePadding,y=a.bounds,v=m&&df(m),x=0,_=0;switch(sh.clear().union(y),y.clear(),(i=c[0])>-1&&y.union(a.items[i].bounds),(i=c[1])>-1&&y.union(a.items[i].bounds),l){case Wd:x=h||0,_=-d,o=Math.max(p,Math.min(g,-y.y1)),y.add(0,-o).add(f,0),m&&fh(e,m,o,b,v,0,-1,y);break;case Yd:x=-d,_=h||0,o=Math.max(p,Math.min(g,-y.x1)),y.add(-o,0).add(0,f),m&&fh(e,m,o,b,v,1,-1,y);break;case Hd:x=n+d,_=h||0,o=Math.max(p,Math.min(g,y.x2)),y.add(0,0).add(o,f),m&&fh(e,m,o,b,v,1,1,y);break;case"bottom":x=h||0,_=r+d,o=Math.max(p,Math.min(g,y.y2)),y.add(0,0).add(f,o),m&&fh(e,m,o,b,0,0,1,y);break;default:x=a.x,_=a.y}return Fl(y.translate(x,_),a),uh(a,"x",x+u)|uh(a,"y",_+u)&&(a.bounds=sh,e.dirty(a),a.bounds=y,e.dirty(a)),a.mark.bounds.clear().union(y)}function fh(e,t,n,r,i,o,a,s){const u=t.bounds;if(t.auto){const s=a*(n+i+r);let l=0,c=0;e.dirty(t),o?l=(t.x||0)-(t.x=s):c=(t.y||0)-(t.y=s),t.mark.bounds.clear().union(u.translate(-l,-c)),e.dirty(t)}s.union(u)}const dh=(e,t)=>Math.floor(Math.min(e,t)),hh=(e,t)=>Math.ceil(Math.max(e,t));function ph(e){return(new El).set(0,0,e.width||0,e.height||0)}function gh(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function mh(e,t,n){const r=Object(Z.G)(e)?e[t]:e;return null!=r?r:void 0!==n?n:0}function bh(e){return e<0?Math.ceil(-e):0}function yh(e,t,n){var r,i,o,a,s,u,l,c,f,d,h,p=!n.nodirty,g="flush"===n.bounds?ph:gh,m=sh.set(0,0,0,0),b=mh(n.align,"column"),y=mh(n.align,Vd),v=mh(n.padding,"column"),x=mh(n.padding,Vd),_=n.columns||t.length,O=_<=0?1:Math.ceil(t.length/_),w=t.length,j=Array(w),k=Array(_),E=0,A=Array(w),D=Array(O),M=0,S=Array(w),C=Array(w),F=Array(w);for(i=0;i<_;++i)k[i]=0;for(i=0;i1)for(i=0;i0&&(S[i]+=f/2);if(y&&mh(n.center,Vd)&&1!==_)for(i=0;i0&&(C[i]+=d/2);for(i=0;ii&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),j+=o,g=0,b=t.length;g=0&&null==(x=n[m]);m-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),O=j):(_=j,O=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),y.union(v.bounds.translate(_-(v.x||0),O-(v.y||0))),v.x=_,v.y=O,e.dirty(v),k=a(k,y[l])}return k}function Oh(e,t,n,r,i,o){if(t){e.dirty(t);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.height()),t.bounds.translate(a-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=s,e.dirty(t)}}function wh(e,t,n,r,i,o,a){const s=function(e,t){const n=e[t]||{};return(t,r)=>null!=n[t]?n[t]:null!=e[t]?e[t]:r}(n,t),u=function(e,t){let n=-1/0;return e.forEach(e=>{null!=e.offset&&(n=Math.max(n,e.offset))}),n>-1/0?n:t}(e,s("offset",0)),l=s("anchor","start"),c=l===Gd?1:"middle"===l?.5:0,f={align:"each",bounds:s("bounds","flush"),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case Yd:f.anchor={x:Math.floor(r.x1)-u,column:Gd,y:c*(a||r.height()+2*r.y1),row:l};break;case Hd:f.anchor={x:Math.ceil(r.x2)+u,y:c*(a||r.height()+2*r.y1),row:l};break;case Wd:f.anchor={y:Math.floor(i.y1)-u,row:Gd,x:c*(o||i.width()+2*i.x1),column:l};break;case"bottom":f.anchor={y:Math.ceil(i.y2)+u,x:c*(o||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:u,y:u};break;case"top-right":f.anchor={x:o-u,y:u,column:Gd};break;case"bottom-left":f.anchor={x:u,y:a-u,row:Gd};break;case"bottom-right":f.anchor={x:o-u,y:a-u,column:Gd,row:Gd}}return f}function jh(e,t){var n,r,i=t.items[0],o=i.datum,a=i.orient,s=i.bounds,u=i.x,l=i.y;return i._bounds?i._bounds.clear().union(s):i._bounds=s.clone(),s.clear(),function(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(t.datum.title){var a=t.items[1].items[0],s=a.anchor,u=t.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case Yd:i+=Math.ceil(a.bounds.width())+u;break;case Hd:case"bottom":break;default:o+=a.bounds.height()+u}switch((i||o)&&Eh(e,n,i,o),a.orient){case Yd:c+=kh(t,n,a,s,1,1);break;case Hd:l+=kh(t,n,a,Gd,0,0)+u,c+=kh(t,n,a,s,1,1);break;case"bottom":l+=kh(t,n,a,s,0,0),c+=kh(t,n,a,Gd,-1,0,1)+u;break;default:l+=kh(t,n,a,s,0,0)}(l||c)&&Eh(e,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(Eh(e,n,-l,0),Eh(e,a,-l,0))}else(i||o)&&Eh(e,n,i,o)}(e,i,i.items[0].items[0]),s=function(e,t){return e.items.forEach(e=>t.union(e.bounds)),t.x1=e.padding,t.y1=e.padding,t}(i,s),n=2*i.padding,r=2*i.padding,s.empty()||(n=Math.ceil(s.width()+n),r=Math.ceil(s.height()+r)),"symbol"===o.type&&function(e){const t=e.reduce((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e),{});e.forEach(e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y})}(i.items[0].items[0].items[0].items),"none"!==a&&(i.x=u=0,i.y=l=0),i.width=n,i.height=r,Fl(s.set(u,l,u+n,l+r),i),i.mark.bounds.clear().union(s),i}function kh(e,t,n,r,i,o,a){const s="symbol"!==e.datum.type,u=n.datum.vgrad,l=(!s||!o&&u||a?t:t.items[0]).bounds[i?"y2":"x2"]-e.padding,c=u&&o?l:0,f=u&&o?0:l,d=i<=0?0:df(n);return Math.round("start"===r?c:r===Gd?f-d:.5*(l-d))}function Eh(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 Ah(e){Pe.call(this,null,e)}function Dh(e,t){let n=0;if(void 0===t)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function Mh(e){Pe.call(this,null,e)}function Sh(e){Pe.call(this,null,e)}function Ch(){return ue({})}function Fh(e){Pe.call(this,null,e)}function zh(e){Pe.call(this,[],e)}Object(Z.z)(Ah,Pe,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(t=>{e.layout&&function(e,t,n){var r,i,o,a,s,u,l,c=function(e){var t,n,r=e.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o{"none"!==(o=e.orient||Hd)&&(t[o]||(t[o]=[])).push(e)});for(const r in t){const i=t[r];yh(e,i,wh(i,r,n.legends,d,h,l,c))}p.forEach(t=>{const r=t.bounds;if(r.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=r,e.dirty(t)),n.autosize&&"fit"===n.autosize.type)switch(t.orient){case Yd:case Hd:f.add(r.x1,0).add(r.x2,0);break;case Wd:case"bottom":f.add(0,r.y1).add(0,r.y2)}else f.union(r)})}f.union(d).union(h),r&&f.union(function(e,t,n,r,i){var o,a=t.items[0],s=a.frame,u=a.orient,l=a.anchor,c=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=u===Yd||u===Hd?r:n,g=0,m=0,b=0,y=0,v=0;if("group"!==s?u===Yd?(g=i.y2,p=i.y1):u===Hd?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):u===Yd&&(g=r,p=0),o="start"===l?g:l===Gd?p:(g+p)/2,h&&h.text){switch(u){case Wd:case"bottom":v=d.bounds.height()+f;break;case Yd:y=d.bounds.width()+f;break;case Hd:y=-d.bounds.width()-f}sh.clear().union(h.bounds),sh.translate(y-(h.x||0),v-(h.y||0)),uh(h,"x",y)|uh(h,"y",v)&&(e.dirty(h),h.bounds.clear().union(sh),h.mark.bounds.clear().union(sh),e.dirty(h)),sh.clear().union(h.bounds)}else sh.clear();switch(sh.union(d.bounds),u){case Wd:m=o,b=i.y1-sh.height()-c;break;case Yd:m=i.x1-sh.width()-c,b=o;break;case Hd:m=i.x2+sh.width()+c,b=o;break;case"bottom":m=o,b=i.y2+c;break;default:m=a.x,b=a.y}return uh(a,"x",m)|uh(a,"y",b)&&(sh.translate(m,b),e.dirty(a),a.bounds.clear().union(sh),t.bounds.clear().union(sh),e.dirty(a)),a.bounds}(e,r,l,c,f));t.clip&&f.set(0,0,t.width||0,t.height||0);!function(e,t,n,r){const i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let a=e._width,s=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if("padding"===i.contains){const t=e.padding();a-=t.left+t.right,s-=t.top+t.bottom}"none"===o?(l=0,f=0,u=a,c=s):"fit"===o?(u=Math.max(0,a-l-d),c=Math.max(0,s-f-h)):"fit-x"===o?(u=Math.max(0,a-l-d),s=c+f+h):"fit-y"===o?(a=u+l+d,c=Math.max(0,s-f-h)):"pad"===o&&(a=u+l+d,s=c+f+h);e._resizeView(a,s,u,c,[l,f],i.resize)}(e,t,f,n)}(n,t,e)}),(r=e.mark.group)&&"legend-entry"!==r.mark.role?t.reflow():t;var r}}),Object(Z.z)(Mh,Pe,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,a=pu(o,null==e.count?e.values?e.values.length:10:e.count,e.minstep),s=e.format||bu(n,o,a,e.formatSpecifier,e.formatType,!!e.values),u=e.values?gu(o,e.values,a):mu(o,a);return i&&(r.rem=i),i=u.map((e,t)=>ue({index:t/(u.length-1||1),value:e,label:s(e)})),e.extra&&i.length&&i.push(ue({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),Object(Z.z)(Sh,Pe,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||Ch,o=e.key||ae,a=this.value;return Object(Z.B)(r.encode)&&(r.encode=null),a&&(e.modified("key")||t.modified(o))&&Object(Z.o)("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function(e){const t=Object(Z.t)().test(e=>e.exit);return t.lookup=n=>t.get(e(n)),t}(o)),t.visit(t.ADD,e=>{const t=o(e);let n=a.get(t);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(e),a.set(t,n),r.add.push(n)),n.datum=e,n.exit=!1}),t.visit(t.MOD,e=>{const t=o(e),n=a.get(t);n&&(n.datum=e,r.mod.push(n))}),t.visit(t.REM,e=>{const t=o(e),n=a.get(t);e!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)}),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),Object(Z.z)(Fh,Pe,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(Object(Z.B)(o)){if(!n.changed()&&!o.every(e=>i[e]))return t.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=i.update||Z.s,u=i.enter||Z.s,l=i.exit||Z.s,c=(o&&!a?i[o]:s)||Z.s;if(t.changed(t.ADD)&&(t.visit(t.ADD,t=>{u(t,e),s(t,e)}),n.modifies(u.output),n.modifies(s.output),c!==Z.s&&c!==s&&(t.visit(t.ADD,t=>{c(t,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==Z.s&&(t.visit(t.REM,t=>{l(t,e)}),n.modifies(l.output)),a||c!==Z.s){const i=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(i,t=>{const i=u(t,e)||r;(c(t,e)||i)&&n.mod.push(t)}),n.mod.length&&n.modifies(u.output)):t.visit(i,t=>{(c(t,e)||r)&&n.mod.push(t)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}}),Object(Z.z)(zh,Pe,{transform(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,r,i,o,a,s=t.dataflow.locale(),u=t.fork(t.NO_SOURCE|t.NO_FIELDS),l=this.value,c=e.type||"symbol",f=e.scale,d=+e.limit,h=pu(f,null==e.count?5:e.count,e.minstep),p=!!e.values||"symbol"===c,g=e.format||Ou(s,f,h,c,e.formatSpecifier,e.formatType,p),m=e.values||_u(f,h);return l&&(u.rem=l),"symbol"===c?(d&&m.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=m.slice(0,d-1),a=!0):l=m,Object(Z.E)(i=e.size)?(e.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce((t,n)=>Math.max(t,i(n,e)),0)):i=Object(Z.m)(o=i||8),l=l.map((t,n)=>ue({index:n,label:g(t,n,l),value:t,offset:o,size:i(t,e)})),a&&(a=m[l.length],l.push(ue({index:l.length,label:"…".concat(m.length-l.length," entries"),value:a,offset:o,size:i(a,e)})))):"gradient"===c?(n=f.domain(),r=ou(f,n[0],Object(Z.V)(n)),m.length<3&&!e.values&&n[0]!==Object(Z.V)(n)&&(m=[n[0],Object(Z.V)(n)]),l=m.map((e,t)=>ue({index:t,label:g(e,t,m),value:e,perc:r(e)}))):(i=m.length-1,r=function(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+Object(Z.V)(t),o=i-r;if("threshold"===e.type){const e=n?o/n:.1;r-=e,i+=e,o=i-r}return e=>(e-r)/o}(f),l=m.map((e,t)=>ue({index:t,label:g(e,t,m),value:e,perc:t?r(e):0,perc2:t===i?1:r(m[t+1])}))),u.source=l,u.add=l,this.value=l,u}});const Th=e=>e.source.x,$h=e=>e.source.y,Nh=e=>e.target.x,Rh=e=>e.target.y;function Ph(e){Pe.call(this,{},e)}Ph.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"}]},Object(Z.z)(Ph,Pe,{transform(e,t){var n=e.sourceX||Th,r=e.sourceY||$h,i=e.targetX||Nh,o=e.targetY||Rh,a=e.as||"path",s=e.orient||"vertical",u=e.shape||"line",l=Uh.get(u+"-"+s)||Uh.get(u);return l||Object(Z.o)("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,e=>{e[a]=l(n(e),r(e),i(e),o(e))}),t.reflow(e.modified()).modifies(a)}});const Bh=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,Lh=(e,t,n,r)=>{var i=n-e,o=r-t,a=Math.sqrt(i*i+o*o)/2;return"M"+e+","+t+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},Ih=(e,t,n,r)=>{const i=n-e,o=r-t,a=.2*(i+o),s=.2*(o-i);return"M"+e+","+t+"C"+(e+a)+","+(t+s)+" "+(n+s)+","+(r-a)+" "+n+","+r},Uh=Object(Z.t)({line:Bh,"line-radial":(e,t,n,r)=>Bh(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),arc:Lh,"arc-radial":(e,t,n,r)=>Lh(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),curve:Ih,"curve-radial":(e,t,n,r)=>Ih(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,"orthogonal-vertical":(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,"orthogonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n);return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:n>e)?1:0)+" "+t*a+","+t*s+"L"+r*a+","+r*s},"diagonal-horizontal":(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),u=(t+r)/2;return"M"+t*i+","+t*o+"C"+u*i+","+u*o+" "+u*a+","+u*s+" "+r*a+","+r*s}});function qh(e){Pe.call(this,null,e)}qh.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"]}]},Object(Z.z)(qh,Pe,{transform(e,t){var n,r,i,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],u=e.field||Z.P,l=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,f=t.source,d=f.map(u),h=d.length,p=l,g=(c-l)/Dh(d),m=Wt(h);for(e.sort&&m.sort((e,t)=>d[e]-d[t]),n=0;ne+(t<0?-1:t>0?1:0),0))!==t.length&&n.warn("Log scale domain includes zero: "+Object(Z.ab)(t)));return t}function Vh(e,t,n){return Object(Z.E)(e)&&(t||n)?nu(e,Xh(t||[0,1],n)):e}function Xh(e,t){return t?e.slice().reverse():e}function Jh(e){Pe.call(this,null,e)}Object(Z.z)(Hh,Pe,{transform(e,t){var n=t.dataflow,r=this.value,i=function(e){var t,n=e.type,r="";if("sequential"===n)return"sequential-linear";(function(e){const t=e.type;return Xs(t)&&t!==Rs&&t!==Ps&&(e.scheme||e.range&&e.range.length&&e.range.every(Z.I))})(e)&&(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0,r=2===t?"sequential-":3===t?"diverging-":"");return(r+n||"linear").toLowerCase()}(e);for(i in r&&i===r.type||(this.value=r=Hs(i)()),e)if(!Yh[i]){if("padding"===i&&Wh(r.type))continue;Object(Z.E)(r[i])?r[i](e[i]):n.warn("Unsupported scale property: "+i)}return function(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(null!=t.rangeStep)o=function(e,t,n){"band"!==e&&"point"!==e&&Object(Z.o)("Only band and point scales support rangeStep.");var r=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,i="point"===e?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*$s(n,i,r)]}(r,t,n);else if(t.scheme&&(o=function(e,t,n){var r,i,o=t.schemeExtent;Object(Z.B)(t.scheme)?i=ru(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),(i=cu(r))||Object(Z.o)("Unrecognized scheme name: ".concat(t.scheme)));return n="threshold"===e?n+1:"bin-ordinal"===e?n-1:"quantile"===e||"quantize"===e?+t.schemeCount||5:n,Qs(e)?Vh(i,o,t.reverse):Object(Z.E)(i)?iu(Vh(i,o),n):"ordinal"===e?i:i.slice(0,n)}(r,t,n),Object(Z.E)(o))){if(e.interpolator)return e.interpolator(o);Object(Z.o)("Scale type ".concat(r," does not support interpolating color schemes."))}if(o&&Qs(r))return e.interpolator(ru(Xh(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(au(t.interpolate,t.interpolateGamma)):Object(Z.E)(e.round)?e.round(i):Object(Z.E)(e.rangeRound)&&e.interpolate(i?Vo:Go);o&&e.range(Xh(o,t.reverse))}(r,e,function(e,t,n){let r=t.bins;if(r&&!Object(Z.B)(r)){const t=e.domain(),n=t[0],i=Object(Z.V)(t),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||Object(Z.o)("Scale bins parameter missing step property."),ai&&(s=o*Math.floor(i/o)),r=Wt(a,s+o/2,o)}r?e.bins=r:e.bins&&delete e.bins;"bin-ordinal"===e.type&&(r?t.domain||t.domainRaw||(e.domain(r),n=r.length):e.bins=e.domain());return n}(r,e,function(e,t,n){const r=function(e,t,n){return t?(e.domain(Gh(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(r>-1)return r;var i,o,a=t.domain,s=e.type,u=t.zero||void 0===t.zero&&function(e){const t=e.type;return!e.bins&&("linear"===t||"pow"===t||"sqrt"===t)}(e);if(!a)return 0;Wh(s)&&t.padding&&a[0]!==Object(Z.V)(a)&&(a=function(e,t,n,r,i,o){var a=Math.abs(Object(Z.V)(n)-n[0]),s=a/(a-2*r),u=e===Ns?Object(Z.nb)(t,null,s):"sqrt"===e?Object(Z.ob)(t,null,s,.5):"pow"===e?Object(Z.ob)(t,null,s,i||1):"symlog"===e?Object(Z.pb)(t,null,s,o||1):Object(Z.mb)(t,null,s);return(t=t.slice())[0]=u[0],t[t.length-1]=u[1],t}(s,a,t.range,t.padding,t.exponent,t.constant));if((u||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(i=(a=a.slice()).length-1||1,u&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=t.domainMin&&(a[0]=t.domainMin),null!=t.domainMax&&(a[i]=t.domainMax),null!=t.domainMid)){const e=(o=t.domainMid)>a[i]?i+1:oe(u);if(null==t)h.push(e.slice());else for(i={},o=0,a=e.length;od&&(d=f),n&&c.sort(n)}return h.max=d,h}(t.source,e.groupby,l,c),r=0,i=n.length,o=n.max;re;function rp(e,t){e&&op.hasOwnProperty(e.type)&&op[e.type](e,t)}var ip={Feature:function(e,t){rp(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r0){for(o=e[--i];i>0&&(t=o,n=e[--i],o=t+n,r=n-(o-t),!r););i>0&&(r<0&&e[i-1]<0||r>0&&e[i-1]>0)&&(n=2*r,t=o+n,n==t-o&&(o=t))}return o}}var cp=Math.PI,fp=cp/2,dp=cp/4,hp=2*cp,pp=180/cp,gp=cp/180,mp=Math.abs,bp=Math.atan,yp=Math.atan2,vp=Math.cos,xp=Math.ceil,_p=Math.exp,Op=(Math.floor,Math.hypot),wp=Math.log,jp=Math.pow,kp=Math.sin,Ep=Math.sign||function(e){return e>0?1:e<0?-1:0},Ap=Math.sqrt,Dp=Math.tan;function Mp(e){return e>1?0:e<-1?cp:Math.acos(e)}function Sp(e){return e>1?fp:e<-1?-fp:Math.asin(e)}function Cp(){}var Fp,zp,Tp,$p,Np=new lp,Rp=new lp,Pp={point:Cp,lineStart:Cp,lineEnd:Cp,polygonStart:function(){Pp.lineStart=Bp,Pp.lineEnd=Up},polygonEnd:function(){Pp.lineStart=Pp.lineEnd=Pp.point=Cp,Np.add(mp(Rp)),Rp=new lp},result:function(){var e=Np/2;return Np=new lp,e}};function Bp(){Pp.point=Lp}function Lp(e,t){Pp.point=Ip,Fp=Tp=e,zp=$p=t}function Ip(e,t){Rp.add($p*e-Tp*t),Tp=e,$p=t}function Up(){Ip(Fp,zp)}var qp=Pp,Wp=1/0,Yp=Wp,Hp=-Wp,Gp=Hp;var Vp,Xp,Jp,Kp,Zp={point:function(e,t){eHp&&(Hp=e);tGp&&(Gp=t)},lineStart:Cp,lineEnd:Cp,polygonStart:Cp,polygonEnd:Cp,result:function(){var e=[[Wp,Yp],[Hp,Gp]];return Hp=Gp=-(Yp=Wp=1/0),e}},Qp=0,eg=0,tg=0,ng=0,rg=0,ig=0,og=0,ag=0,sg=0,ug={point:lg,lineStart:cg,lineEnd:hg,polygonStart:function(){ug.lineStart=pg,ug.lineEnd=gg},polygonEnd:function(){ug.point=lg,ug.lineStart=cg,ug.lineEnd=hg},result:function(){var e=sg?[og/sg,ag/sg]:ig?[ng/ig,rg/ig]:tg?[Qp/tg,eg/tg]:[NaN,NaN];return Qp=eg=tg=ng=rg=ig=og=ag=sg=0,e}};function lg(e,t){Qp+=e,eg+=t,++tg}function cg(){ug.point=fg}function fg(e,t){ug.point=dg,lg(Jp=e,Kp=t)}function dg(e,t){var n=e-Jp,r=t-Kp,i=Ap(n*n+r*r);ng+=i*(Jp+e)/2,rg+=i*(Kp+t)/2,ig+=i,lg(Jp=e,Kp=t)}function hg(){ug.point=lg}function pg(){ug.point=mg}function gg(){bg(Vp,Xp)}function mg(e,t){ug.point=bg,lg(Vp=Jp=e,Xp=Kp=t)}function bg(e,t){var n=e-Jp,r=t-Kp,i=Ap(n*n+r*r);ng+=i*(Jp+e)/2,rg+=i*(Kp+t)/2,ig+=i,og+=(i=Kp*e-Jp*t)*(Jp+e),ag+=i*(Kp+t),sg+=3*i,lg(Jp=e,Kp=t)}var yg=ug;function vg(e){this._context=e}vg.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,hp)}},result:Cp};var xg,_g,Og,wg,jg,kg=new lp,Eg={point:Cp,lineStart:function(){Eg.point=Ag},lineEnd:function(){xg&&Dg(_g,Og),Eg.point=Cp},polygonStart:function(){xg=!0},polygonEnd:function(){xg=null},result:function(){var e=+kg;return kg=new lp,e}};function Ag(e,t){Eg.point=Dg,_g=wg=e,Og=jg=t}function Dg(e,t){wg-=e,jg-=t,kg.add(Ap(wg*wg+jg*jg)),wg=e,jg=t}var Mg=Eg;function Sg(){this._string=[]}function Cg(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}Sg.prototype={_radius:4.5,_circle:Cg(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=Cg(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}};var Fg=function(e,t){var n,r,i=4.5;function o(e){return e&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),up(e,n(r))),r.result()}return o.area=function(e){return up(e,n(qp)),qp.result()},o.measure=function(e){return up(e,n(Mg)),Mg.result()},o.bounds=function(e){return up(e,n(Zp)),Zp.result()},o.centroid=function(e){return up(e,n(yg)),yg.result()},o.projection=function(t){return arguments.length?(n=null==t?(e=null,np):(e=t).stream,o):e},o.context=function(e){return arguments.length?(r=null==e?(t=null,new Sg):new vg(t=e),"function"!=typeof i&&r.pointRadius(i),o):t},o.pointRadius=function(e){return arguments.length?(i="function"==typeof e?e:(r.pointRadius(+e),+e),o):i},o.projection(e).context(t)},zg=function(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:Cp,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}},Tg=function(e,t){return mp(e[0]-t[0])<1e-6&&mp(e[1]-t[1])<1e-6};function $g(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var Ng=function(e,t,n,r,i){var o,a,s=[],u=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,n,r=e[0],a=e[t];if(Tg(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o=0;--o)i.point((c=l[o])[0],c[1]);else r(d.x,d.p.x,-1,i);d=d.p}l=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}};function Rg(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r=0?1:-1,E=k*j,A=E>cp,D=m*O;if(u.add(yp(D*k*kp(E),b*w+D*vp(E))),a+=A?j+k*hp:j,A^p>=n^x>=n){var M=Ig(Bg(h),Bg(v));Wg(M);var S=Ig(o,M);Wg(S);var C=(A^j>=0?-1:1)*Sp(S[2]);(r>C||r===C&&(M[0]||M[1]))&&(s+=A^j>=0?1:-1)}}return(a<-1e-6||a<1e-6&&u<-1e-12)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),Ng(a,Xg,e,n,i)):e&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(t,n){e(t,n)&&i.point(t,n)}function p(e,t){u.point(e,t)}function g(){d.point=p,u.lineStart()}function m(){d.point=h,u.lineEnd()}function b(e,t){s.push([e,t]),c.point(e,t)}function y(){c.lineStart(),s=[]}function v(){b(s[0][0],s[0][1]),c.lineEnd();var e,t,n,r,u=c.clean(),d=l.result(),h=d.length;if(s.pop(),o.push(s),s=null,h)if(1&u){if((t=(n=d[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),e=0;e1&&2&u&&d.push(d.pop().concat(d.shift())),a.push(d.filter(Vg))}return d}};function Vg(e){return e.length>1}function Xg(e,t){return((e=e.x)[0]<0?e[1]-fp-1e-6:fp-e[1])-((t=t.x)[0]<0?t[1]-fp-1e-6:fp-t[1])}var Jg=Gg((function(){return!0}),(function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?cp:-cp,u=mp(o-n);mp(u-cp)<1e-6?(e.point(n,r=(r+a)/2>0?fp:-fp),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&u>=cp&&(mp(n-i)<1e-6&&(n-=1e-6*i),mp(o-s)<1e-6&&(o-=1e-6*s),r=function(e,t,n,r){var i,o,a=kp(e-n);return mp(a)>1e-6?bp((kp(t)*(o=vp(r))*kp(n)-kp(r)*(i=vp(t))*kp(e))/(i*o*a)):(t+r)/2}(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*fp,r.point(-cp,i),r.point(0,i),r.point(cp,i),r.point(cp,0),r.point(cp,-i),r.point(0,-i),r.point(-cp,-i),r.point(-cp,0),r.point(-cp,i);else if(mp(e[0]-t[0])>1e-6){var o=e[0]cp?e+Math.round(-e/hp)*hp:e,t]}function Qg(e,t,n){return(e%=hp)?t||n?Kg(tm(e),nm(t,n)):tm(e):t||n?nm(t,n):Zg}function em(e){return function(t,n){return[(t+=e)>cp?t-hp:t<-cp?t+hp:t,n]}}function tm(e){var t=em(e);return t.invert=em(-e),t}function nm(e,t){var n=vp(e),r=kp(e),i=vp(t),o=kp(t);function a(e,t){var a=vp(t),s=vp(e)*a,u=kp(e)*a,l=kp(t),c=l*n+s*r;return[yp(u*i-c*o,s*n-l*r),Sp(c*i+u*o)]}return a.invert=function(e,t){var a=vp(t),s=vp(e)*a,u=kp(e)*a,l=kp(t),c=l*i-u*o;return[yp(u*i+l*o,s*n+c*r),Sp(c*n-s*r)]},a}Zg.invert=Zg;function rm(e,t,n,r,i,o){if(n){var a=vp(t),s=kp(t),u=r*n;null==i?(i=t+r*hp,o=t-u/2):(i=im(a,i),o=im(a,o),(r>0?io)&&(i+=r*hp));for(var l,c=i;r>0?c>o:c0,i=mp(t)>1e-6;function o(e,n){return vp(e)*vp(n)>t}function a(e,n,r){var i=[1,0,0],o=Ig(Bg(e),Bg(n)),a=Lg(o,o),s=o[0],u=a-s*s;if(!u)return!r&&e;var l=t*a/u,c=-t*s/u,f=Ig(i,o),d=qg(i,l);Ug(d,qg(o,c));var h=f,p=Lg(d,h),g=Lg(h,h),m=p*p-g*(Lg(d,d)-1);if(!(m<0)){var b=Ap(m),y=qg(h,(-p-b)/g);if(Ug(y,d),y=Pg(y),!r)return y;var v,x=e[0],_=n[0],O=e[1],w=n[1];_0^y[1]<(mp(y[0]-x)<1e-6?O:w):O<=y[1]&&y[1]<=w:j>cp^(x<=y[0]&&y[0]<=_)){var E=qg(h,(-p+b)/g);return Ug(E,d),[y,Pg(E)]}}}function s(t,n){var i=r?e:cp-e,o=0;return t<-i?o|=1:t>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Gg(o,(function(e){var t,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(f,d){var h,p=[f,d],g=o(f,d),m=r?g?0:s(f,d):g?s(f+(f<0?cp:-cp),d):0;if(!t&&(l=u=g)&&e.lineStart(),g!==u&&(!(h=a(t,p))||Tg(t,h)||Tg(p,h))&&(p[2]=1),g!==u)c=0,g?(e.lineStart(),h=a(p,t),e.point(h[0],h[1])):(h=a(t,p),e.point(h[0],h[1],2),e.lineEnd()),t=h;else if(i&&t&&r^g){var b;m&n||!(b=a(p,t,!0))||(c=0,r?(e.lineStart(),e.point(b[0][0],b[0][1]),e.point(b[1][0],b[1][1]),e.lineEnd()):(e.point(b[1][0],b[1][1]),e.lineEnd(),e.lineStart(),e.point(b[0][0],b[0][1],3)))}!g||t&&Tg(t,p)||e.point(p[0],p[1]),t=p,u=g,n=m},lineEnd:function(){u&&e.lineEnd(),t=null},clean:function(){return c|(l&&u)<<1}}}),(function(t,r,i,o){rm(o,e,n,i,t,r)}),r?[0,-e]:[-cp,e-cp])};function am(e,t,n,r){function i(i,o){return e<=i&&i<=n&&t<=o&&o<=r}function o(i,o,s,l){var c=0,f=0;if(null==i||(c=a(i,s))!==(f=a(o,s))||u(i,o)<0^s>0)do{l.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return mp(r[0]-e)<1e-6?i>0?0:3:mp(r[0]-n)<1e-6?i>0?2:1:mp(r[1]-t)<1e-6?i>0?1:0:i>0?3:2}function s(e,t){return u(e.x,t.x)}function u(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){var u,l,c,f,d,h,p,g,m,b,y,v=a,x=zg(),_={point:O,lineStart:function(){_.point=w,l&&l.push(c=[]);b=!0,m=!1,p=g=NaN},lineEnd:function(){u&&(w(f,d),h&&m&&x.rejoin(),u.push(x.result()));_.point=O,m&&v.lineEnd()},polygonStart:function(){v=x,u=[],l=[],y=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,i=l.length;nr&&(d-o)*(r-a)>(h-a)*(e-o)&&++t:h<=r&&(d-o)*(r-a)<(h-a)*(e-o)&&--t;return t}(),n=y&&t,i=(u=Hg(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Ng(u,s,t,o,a),a.polygonEnd());v=a,u=l=c=null}};function O(e,t){i(e,t)&&v.point(e,t)}function w(o,a){var s=i(o,a);if(l&&c.push([o,a]),b)f=o,d=a,h=s,b=!1,s&&(v.lineStart(),v.point(o,a));else if(s&&m)v.point(o,a);else{var u=[p=Math.max(-1e9,Math.min(1e9,p)),g=Math.max(-1e9,Math.min(1e9,g))],x=[o=Math.max(-1e9,Math.min(1e9,o)),a=Math.max(-1e9,Math.min(1e9,a))];!function(e,t,n,r,i,o){var a,s=e[0],u=e[1],l=0,c=1,f=t[0]-s,d=t[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a0)){if(a/=d,d<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>l&&(l=a)}else if(d>0){if(a0&&(e[0]=s+l*f,e[1]=u+l*d),c<1&&(t[0]=s+c*f,t[1]=u+c*d),!0}}}}}(u,x,e,t,n,r)?s&&(v.lineStart(),v.point(o,a),y=!1):(m||(v.lineStart(),v.point(u[0],u[1])),v.point(x[0],x[1]),s||v.lineEnd(),y=!1)}p=o,g=a,m=s}return _}}function sm(e){return function(t){var n=new um;for(var r in e)n[r]=e[r];return n.stream=t,n}}function um(){}function lm(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),up(n,e.stream(Zp)),t(Zp.result()),null!=r&&e.clipExtent(r),e}function cm(e,t,n){return lm(e,(function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])}),n)}function fm(e,t,n){return cm(e,[[0,0],t],n)}function dm(e,t,n){return lm(e,(function(n){var r=+t,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([o,a])}),n)}function hm(e,t,n){return lm(e,(function(n){var r=+t,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([o,a])}),n)}um.prototype={constructor:um,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var pm=vp(30*gp),gm=function(e,t){return+t?function(e,t){function n(r,i,o,a,s,u,l,c,f,d,h,p,g,m){var b=l-r,y=c-i,v=b*b+y*y;if(v>4*t&&g--){var x=a+d,_=s+h,O=u+p,w=Ap(x*x+_*_+O*O),j=Sp(O/=w),k=mp(mp(O)-1)<1e-6||mp(o-f)<1e-6?(o+f)/2:yp(_,x),E=e(k,j),A=E[0],D=E[1],M=A-r,S=D-i,C=y*M-b*S;(C*C/v>t||mp((b*M+y*S)/v-.5)>.3||a*d+s*h+u*p2?e[2]%360*gp:0,M()):[m*pp,b*pp,y*pp]},A.angle=function(e){return arguments.length?(v=e%360*gp,M()):v*pp},A.reflectX=function(e){return arguments.length?(x=e?-1:1,M()):x<0},A.reflectY=function(e){return arguments.length?(_=e?-1:1,M()):_<0},A.precision=function(e){return arguments.length?(a=gm(s,E=e*e),S()):Ap(E)},A.fitExtent=function(e,t){return cm(A,e,t)},A.fitSize=function(e,t){return fm(A,e,t)},A.fitWidth=function(e,t){return dm(A,e,t)},A.fitHeight=function(e,t){return hm(A,e,t)},function(){return t=e.apply(this,arguments),A.invert=t.invert&&D,M()}}function xm(e){var t=0,n=cp/3,r=vm(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*gp,n=e[1]*gp):[t*pp,n*pp]},i}function _m(e,t){var n=kp(e),r=(n+kp(t))/2;if(mp(r)<1e-6)return function(e){var t=vp(e);function n(e,n){return[e*t,kp(n)/t]}return n.invert=function(e,n){return[e/t,Sp(n*t)]},n}(e);var i=1+n*(2*r-n),o=Ap(i)/r;function a(e,t){var n=Ap(i-2*r*kp(t))/r;return[n*kp(e*=r),o-n*vp(e)]}return a.invert=function(e,t){var n=o-t,a=yp(e,mp(n))*Ep(n);return n*r<0&&(a-=cp*Ep(e)*Ep(n)),[a/r,Sp((i-(e*e+n*n)*r*r)/(2*r))]},a}var Om=function(){return xm(_m).scale(155.424).center([0,33.6442])},wm=function(){return Om().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};function jm(e){return function(t,n){var r=vp(t),i=vp(n),o=e(r*i);return o===1/0?[2,0]:[o*i*kp(t),o*kp(n)]}}function km(e){return function(t,n){var r=Ap(t*t+n*n),i=e(r),o=kp(i),a=vp(i);return[yp(t*o,r*a),Sp(r&&n*o/r)]}}var Em=jm((function(e){return Ap(2/(1+e))}));Em.invert=km((function(e){return 2*Sp(e/2)}));var Am=jm((function(e){return(e=Mp(e))&&e/kp(e)}));Am.invert=km((function(e){return e}));function Dm(e,t){return[e,wp(Dp((fp+t)/2))]}Dm.invert=function(e,t){return[e,2*bp(_p(t))-fp]};function Mm(e){var t,n,r,i=ym(e),o=i.center,a=i.scale,s=i.translate,u=i.clipExtent,l=null;function c(){var o=cp*a(),s=i(function(e){function t(t){return(t=e(t[0]*gp,t[1]*gp))[0]*=pp,t[1]*=pp,t}return e=Qg(e[0]*gp,e[1]*gp,e.length>2?e[2]*gp:0),t.invert=function(t){return(t=e.invert(t[0]*gp,t[1]*gp))[0]*=pp,t[1]*=pp,t},t}(i.rotate()).invert([0,0]));return u(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:e===Dm?[[Math.max(s[0]-o,l),t],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,t)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(e){return arguments.length?(a(e),c()):a()},i.translate=function(e){return arguments.length?(s(e),c()):s()},i.center=function(e){return arguments.length?(o(e),c()):o()},i.clipExtent=function(e){return arguments.length?(null==e?l=t=n=r=null:(l=+e[0][0],t=+e[0][1],n=+e[1][0],r=+e[1][1]),c()):null==l?null:[[l,t],[n,r]]},c()}function Sm(e){return Dp((fp+e)/2)}function Cm(e,t){var n=vp(e),r=e===t?kp(e):wp(n/vp(t))/wp(Sm(t)/Sm(e)),i=n*jp(Sm(e),r)/r;if(!r)return Dm;function o(e,t){i>0?t<1e-6-fp&&(t=1e-6-fp):t>fp-1e-6&&(t=fp-1e-6);var n=i/jp(Sm(t),r);return[n*kp(r*e),i-n*vp(r*e)]}return o.invert=function(e,t){var n=i-t,o=Ep(r)*Ap(e*e+n*n),a=yp(e,mp(n))*Ep(n);return n*r<0&&(a-=cp*Ep(e)*Ep(n)),[a/r,2*bp(jp(i/o,1/r))-fp]},o}function Fm(e,t){return[e,t]}Fm.invert=Fm;function zm(e,t){var n=vp(e),r=e===t?kp(e):(n-vp(t))/(t-e),i=n/r+e;if(mp(r)<1e-6)return Fm;function o(e,t){var n=i-t,o=r*e;return[n*kp(o),i-n*vp(o)]}return o.invert=function(e,t){var n=i-t,o=yp(e,mp(n))*Ep(n);return n*r<0&&(o-=cp*Ep(e)*Ep(n)),[o/r,i-Ep(r)*Ap(e*e+n*n)]},o}var Tm=1.340264,$m=-.081106,Nm=893e-6,Rm=.003796,Pm=Ap(3)/2;function Bm(e,t){var n=Sp(Pm*kp(t)),r=n*n,i=r*r*r;return[e*vp(n)/(Pm*(Tm+3*$m*r+i*(7*Nm+9*Rm*r))),n*(Tm+$m*r+i*(Nm+Rm*r))]}Bm.invert=function(e,t){for(var n,r=t,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(Tm+$m*i+o*(Nm+Rm*i))-t)/(Tm+3*$m*i+o*(7*Nm+9*Rm*i)))*r)*i*i,!(mp(n)<1e-12));++a);return[Pm*e*(Tm+3*$m*i+o*(7*Nm+9*Rm*i))/vp(r),Sp(kp(r)/Pm)]};function Lm(e,t){var n=vp(t),r=vp(e)*n;return[n*kp(e)/r,kp(t)/r]}Lm.invert=km(bp);function Im(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),t*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}Im.invert=function(e,t){var n,r=t,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-t)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(mp(n)>1e-6&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};function Um(e,t){return[vp(t)*kp(e),kp(t)]}Um.invert=km(Sp);function qm(e,t){var n=vp(t),r=1+vp(e)*n;return[n*kp(e)/r,kp(t)/r]}qm.invert=km((function(e){return 2*bp(e)}));function Wm(e,t){return[wp(Dp((fp+t)/2)),-e]}Wm.invert=function(e,t){return[-t,2*bp(_p(e))-fp]};var Ym=Math.abs,Hm=(Math.atan,Math.atan2,Math.ceil,Math.cos),Gm=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),Vm=(Math.tan,Math.PI),Xm=Vm/2,Jm=(Math.SQRT1_2,Zm(2));Zm(Vm);function Km(e){return e>1?Xm:e<-1?-Xm:Math.asin(e)}function Zm(e){return e>0?Math.sqrt(e):0}function Qm(e,t){var n,r=e*Gm(t),i=30;do{t-=n=(t+Gm(t)-r)/(1+Hm(t))}while(Ym(n)>1e-6&&--i>0);return t/2}var eb=function(e,t,n){function r(r,i){return[e*r*Hm(i=Qm(n,i)),t*Gm(i)]}return r.invert=function(r,i){return i=Km(i/t),[r/(e*Hm(i)),Km((2*i+Gm(2*i))/n)]},r}(Jm/Xm,Jm,Vm);const tb=Fg(),nb=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function rb(e,t){return function n(){const r=t();return r.type=e,r.path=Fg().projection(r),r.copy=r.copy||function(){const e=n();return nb.forEach(t=>{r[t]&&e[t](r[t]())}),e.path.pointRadius(r.path.pointRadius()),e},r}}function ib(e,t){if(!e||"string"!=typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(ab[e]=rb(e,t),this):ab[e]||null}function ob(e){return e&&e.path||tb}const ab={albers:wm,albersusa:function(){var e,t,n,r,i,o,a=wm(),s=Om().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=Om().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(e,t){o=[e,t]}};function c(e){var t=e[0],a=e[1];return o=null,n.point(t,a),o||(r.point(t,a),o)||(i.point(t,a),o)}function f(){return e=t=null,c}return c.invert=function(e){var t=a.scale(),n=a.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(e)},c.stream=function(n){return e&&t===n?e:(r=[a.stream(t=n),s.stream(n),u.stream(n)],i=r.length,e={point:function(e,t){for(var n=-1;++n2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90]).scale(159.155)}};for(const e in ab)ib(e,ab[e]);function sb(e,t,n){var r=Wt(e,t-1e-6,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function ub(e,t,n){var r=Wt(e,t-1e-6,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}function lb(){var e,t,n,r,i,o,a,s,u,l,c,f,d=10,h=d,p=90,g=360,m=2.5;function b(){return{type:"MultiLineString",coordinates:y()}}function y(){return Wt(xp(r/p)*p,n,p).map(c).concat(Wt(xp(s/g)*g,a,g).map(f)).concat(Wt(xp(t/d)*d,e,d).filter((function(e){return mp(e%p)>1e-6})).map(u)).concat(Wt(xp(o/h)*h,i,h).filter((function(e){return mp(e%g)>1e-6})).map(l))}return b.lines=function(){return y().map((function(e){return{type:"LineString",coordinates:e}}))},b.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},b.extent=function(e){return arguments.length?b.extentMajor(e).extentMinor(e):b.extentMinor()},b.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),s>a&&(e=s,s=a,a=e),b.precision(m)):[[r,s],[n,a]]},b.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],o=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),o>i&&(n=o,o=i,i=n),b.precision(m)):[[t,o],[e,i]]},b.step=function(e){return arguments.length?b.stepMajor(e).stepMinor(e):b.stepMinor()},b.stepMajor=function(e){return arguments.length?(p=+e[0],g=+e[1],b):[p,g]},b.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],b):[d,h]},b.precision=function(d){return arguments.length?(m=+d,u=sb(o,i,90),l=ub(t,e,m),c=sb(s,a,90),f=ub(r,n,m),b):m},b.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function cb(){}const fb=[[],[[[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 db(){var e=1,t=1,n=a;function r(e,t){return t.map(t=>i(e,t))}function i(r,i){var a=[],s=[];return function(n,r,i){var a,s,u,l,c,f,d=new Array,h=new Array;a=s=-1,l=n[0]>=r,fb[l<<1].forEach(p);for(;++a=r,fb[u|l<<1].forEach(p);fb[l<<0].forEach(p);for(;++s=r,c=n[s*e]>=r,fb[l<<1|c<<2].forEach(p);++a=r,f=c,c=n[s*e+a+1]>=r,fb[u|l<<1|c<<2|f<<3].forEach(p);fb[l|c<<3].forEach(p)}a=-1,c=n[s*e]>=r,fb[c<<2].forEach(p);for(;++a=r,fb[c<<2|f<<3].forEach(p);function p(e){var t,n,r=[e[0][0]+a,e[0][1]+s],u=[e[1][0]+a,e[1][1]+s],l=o(r),c=o(u);(t=h[l])?(n=d[c])?(delete h[t.end],delete d[n.start],t===n?(t.ring.push(u),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(u),h[t.end=c]=t):(t=d[c])?(n=h[l])?(delete d[t.start],delete h[n.end],t===n?(t.ring.push(u),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,u]}}fb[c<<3].forEach(p)}(r,i,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?a.push([e]):s.push(e)}),s.forEach(e=>{for(var t,n=0,r=a.length;n{var o,a=n[0],s=n[1],u=0|a,l=0|s,c=r[l*e+u];a>0&&a0&&s=0&&o>=0||Object(Z.o)("invalid size"),e=i,t=o,r},r.smooth=function(e){return arguments.length?(n=e?a:cb,r):n===a},r}function hb(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 gb(e,t,n){var r,i,o,a;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])],o=n[r],a=t[r],i<=o&&o<=a||a<=o&&o<=i)}function mb(e,t,n){return function(r){var i=Object(Z.q)(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=t?Object(Ii.c)(o,a,e):s/(e+1);return Wt(u,a,u)}}function bb(e){Pe.call(this,null,e)}function yb(e,t,n,r,i){const o=e.x1||0,a=e.y1||0,s=t*n<0;function u(e){e.forEach(l)}function l(e){s&&e.reverse(),e.forEach(c)}function c(e){e[0]=(e[0]-o)*t+r,e[1]=(e[1]-a)*n+i}return function(e){return e.coordinates.forEach(u),e}}function vb(e,t,n){const r=e>=0?e:Qe(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function xb(e){return Object(Z.E)(e)?e:Object(Z.m)(+e)}function _b(){var e=e=>e[0],t=e=>e[1],n=Z.P,r=[-1,-1],i=960,o=500,a=2;function s(s,u){const l=vb(r[0],s,e)>>a,c=vb(r[1],s,t)>>a,f=l?l+2:0,d=c?c+2:0,h=2*f+(i>>a),p=2*d+(o>>a),g=new Float32Array(h*p),m=new Float32Array(h*p);let b=g;s.forEach(r=>{const i=f+(+e(r)>>a),o=d+(+t(r)>>a);i>=0&&i=0&&o0&&c>0?(Ob(h,p,g,m,l),wb(h,p,m,g,c),Ob(h,p,g,m,l),wb(h,p,m,g,c),Ob(h,p,g,m,l),wb(h,p,m,g,c)):l>0?(Ob(h,p,g,m,l),Ob(h,p,m,g,l),Ob(h,p,g,m,l),b=m):c>0&&(wb(h,p,g,m,c),wb(h,p,m,g,c),wb(h,p,g,m,c),b=m);const y=u?Math.pow(2,-2*a):1/Dh(b);for(let e=0,t=h*p;e>a),y2:d+(o>>a)}}return s.x=function(t){return arguments.length?(e=xb(t),s):e},s.y=function(e){return arguments.length?(t=xb(e),s):t},s.weight=function(e){return arguments.length?(n=xb(e),s):n},s.size=function(e){if(!arguments.length)return[i,o];var t=+e[0],n=+e[1];return t>=0&&n>=0||Object(Z.o)("invalid size"),i=t,o=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||Object(Z.o)("invalid cell size"),a=Math.floor(Math.log(e)/Math.LN2),s):1<=i&&(t>=o&&(s-=n[t-o+a*e]),r[t-i+a*e]=s/Math.min(t+1,e-1+o-t,o))}function wb(e,t,n,r,i){const o=1+(i<<1);for(let a=0;a=i&&(s>=o&&(u-=n[a+(s-o)*e]),r[a+(s-i)*e]=u/Math.min(s+1,t-1+o-s,o))}function jb(e){Pe.call(this,null,e)}bb.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"}]},Object(Z.z)(bb,Pe,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||Z.y,o=db().smooth(!1!==e.smooth),a=e.thresholds||function(e,t,n){const r=mb(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(e.map(e=>qe(t(e).values)))}(r,i,e),s=null===e.as?null:e.as||"contour",u=[];return r.forEach(t=>{const n=i(t),r=o.size([n.width,n.height])(n.values,Object(Z.B)(a)?a:a(n.values));!function(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;Object(Z.E)(i)&&(i=i(n,r));Object(Z.E)(o)&&(o=o(n,r));if((1===i||null==i)&&!o)return;const a=(Object(Z.F)(i)?i:i[0])||1,s=(Object(Z.F)(i)?i:i[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(yb(t,a,s,u,l))}(r,n,t,e),r.forEach(e=>{u.push(ce(t,ue(null!=s?{[s]:e}:e)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}}),jb.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"}]};const kb=["x","y","weight","size","cellSize","bandwidth"];function Eb(e,t){return kb.forEach(n=>null!=t[n]?e[n](t[n]):0),e}function Ab(e){Pe.call(this,null,e)}Object(Z.z)(jb,Pe,{transform(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,o,a,s,u=[],l=e=>e(o);if(null==t)u.push(e);else for(n={},r=0,i=e.length;rue(function(e,t){for(let n=0;nr.push(u(e))),a&&s&&(t.visit(l,e=>{var t=a(e),n=s(e);null!=t&&null!=n&&(t=+t)===t&&(n=+n)===n&&i.push([t,n])}),r=r.concat({type:"Feature",geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:"FeatureCollection",features:r}}}),Mb.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},Object(Z.z)(Mb,Pe,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||Z.y,o=e.as||"path",a=n.SOURCE;!r||e.modified()?(this.value=r=ob(e.projection),n.materialize().reflow()):a=i===Z.y||t.modified(i.fields)?n.ADD_MOD:n.ADD;const s=function(e,t){const n=e.pointRadius();e.context(null),null!=t&&e.pointRadius(t);return n}(r,e.pointRadius);return n.visit(a,e=>e[o]=r(i(e))),r.pointRadius(s),n.modifies(o)}}),Sb.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},Object(Z.z)(Sb,Pe,{transform(e,t){var n,r=e.projection,i=e.fields[0],o=e.fields[1],a=e.as||["x","y"],s=a[0],u=a[1];function l(e){const t=r([i(e),o(e)]);t?(e[s]=t[0],e[u]=t[1]):(e[s]=void 0,e[u]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(n=t.modified(i.fields)||t.modified(o.fields),t.visit(n?t.ADD_MOD:t.ADD,l)),t.modifies(a)}}),Cb.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},Object(Z.z)(Cb,Pe,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return r&&!e.modified()||(this.value=r=function(e,t,n){const r=null==n?n=>e(t(n)):r=>{var i=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(i),o};return r.context=t=>(e.context(t),r),r}(ob(e.projection),e.field||Object(Z.u)("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,e=>e[i]=r),n.modifies(i)}}),Fb.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},Object(Z.z)(Fb,Pe,{transform(e,t){var n,r=this.value,i=this.generator;if(!r.length||e.modified())for(const t in e)Object(Z.E)(i[t])&&i[t](e[t]);return n=i(),r.length?t.mod.push(fe(r[0],n)):t.add.push(ue(n)),r[0]=n,t}}),zb.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},Object(Z.z)(zb,Pe,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r="shared"===e.resolve,i=e.field||Z.y,o=function(e,t){let n;Object(Z.E)(e)?(n=n=>e(n,t),n.dep=Tb(e)):e?n=Object(Z.m)(e):(n=e=>e.$value/e.$max||0,n.dep=!0);return n}(e.opacity,e),a=function(e,t){let n;Object(Z.E)(e)?(n=n=>go(e(n,t)),n.dep=Tb(e)):n=Object(Z.m)(go(e||"#888"));return n}(e.color,e),s=e.as||"image",u={$x:0,$y:0,$value:0,$max:r?qe(n.map(e=>qe(i(e).values))):0};return n.forEach(e=>{const t=i(e),n=Object(Z.p)({},e,u);r||(n.$max=qe(t.values||[])),e[s]=function(e,t,n,r){const i=e.width,o=e.height,a=e.x1||0,s=e.y1||0,u=e.x2||i,l=e.y2||o,c=e.values,f=c?e=>c[e]:Z.lb,d=Ci(u-a,l-s),h=d.getContext("2d"),p=h.getImageData(0,0,u-a,l-s),g=p.data;for(let e=s,o=0;e{null!=e[t]&&Nb(n,t,e[t])})):nb.forEach(t=>{e.modified(t)&&Nb(n,t,e[t])}),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return 1===(e=Object(Z.i)(e)).length?e[0]:{type:"FeatureCollection",features:e.reduce((e,t)=>e.concat(function(e){return"FeatureCollection"===e.type?e.features:Object(Z.i)(e).filter(e=>null!=e).map(e=>"Feature"===e.type?e:{type:"Feature",geometry:e})}(t)),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Rb(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o,a,s,u,l,c,f,d,h=e._root,p={data:r},g=e._x0,m=e._y0,b=e._x1,y=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((l=t>=(o=(g+b)/2))?g=o:b=o,(c=n>=(a=(m+y)/2))?m=a:y=a,i=h,!(h=h[f=c<<1|l]))return i[f]=p,e;if(s=+e._x.call(null,h.data),u=+e._y.call(null,h.data),t===s&&n===u)return p.next=h,i?i[f]=p:e._root=p,e;do{i=i?i[f]=new Array(4):e._root=new Array(4),(l=t>=(o=(g+b)/2))?g=o:b=o,(c=n>=(a=(m+y)/2))?m=a:y=a}while((f=c<<1|l)==(d=(u>=a)<<1|s>=o));return i[d]=h,i[f]=p,e}var Pb=function(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i};function Bb(e){return e[0]}function Lb(e){return e[1]}function Ib(e,t,n){var r=new Ub(null==t?Bb:t,null==n?Lb:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function Ub(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function qb(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Wb=Ib.prototype=Ub.prototype;Wb.copy=function(){var e,t,n=new Ub(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=qb(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=qb(t));return n},Wb.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return Rb(this.cover(t,n),t,n,e)},Wb.addAll=function(e){var t,n,r,i,o=e.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),if&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;ne||e>=i||r>t||t>=o;)switch(s=(td||(o=u.y0)>h||(a=u.x1)=b)<<1|e>=m)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var y=e-+this._x.call(null,g.data),v=t-+this._y.call(null,g.data),x=y*y+v*v;if(x=(s=(p+m)/2))?p=s:m=s,(c=a>=(u=(g+b)/2))?g=u:b=u,t=h,!(h=h[f=c<<1|l]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):t?(i?t[f]=i:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},Wb.removeAll=function(e){for(var t=0,n=e.length;t{}};function Jb(){for(var e,t=0,n=arguments.length,r={};t=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}function Qb(e,t){for(var n,r=0,i=e.length;r0)for(var n,r,i=new Array(n),o=0;o=0&&t._call.call(null,e),t=t._next;--iy}()}finally{iy=0,function(){var e,t,n=ty,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:ty=t);ny=e,yy(r)}(),uy=0}}function by(){var e=cy.now(),t=e-sy;t>1e3&&(ly-=t,sy=e)}function yy(e){iy||(oy&&(oy=clearTimeout(oy)),e-uy>24?(e<1/0&&(oy=setTimeout(my,e-cy.now()-ly)),ay&&(ay=clearInterval(ay))):(ay||(sy=cy.now(),ay=setInterval(by,1e3)),iy=1,fy(my)))}py.prototype=gy.prototype={constructor:py,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?dy():+n)+(null==t?0:+t),this._next||ny===this||(ny?ny._next=this:ty=this,ny=this),this._call=e,this._time=n,yy()},stop:function(){this._call&&(this._call=null,this._time=1/0,yy())}};function vy(e){return e.x}function xy(e){return e.y}var _y=Math.PI*(3-Math.sqrt(5));function Oy(e){return e.index}function wy(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}const jy={center:function(e,t){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;il+p||oc+p||au.index){var g=l-s.x-s.vx,m=c-s.y-s.vy,b=g*g+m*m;be.r&&(e.r=e[t].r)}function u(){if(t){var r,i,o=t.length;for(n=new Array(o),r=0;r=s)){(e.data!==t||e.next)&&(0===f&&(p+=(f=Hb(n))*f),0===d&&(p+=(d=Hb(n))*d),p[s(e,t,r),e]));for(a=0,i=new Array(l);at(e,n):t)}function zy(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}Dy.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:Ay}]},Object(Z.z)(Dy,Pe,{transform(e,t){var n,r,i=this.value,o=t.changed(t.ADD_REM),a=e.modified(ky),s=e.iterations||300;if(i?(o&&(t.modifies("index"),i.nodes(t.source)),(a||t.changed(t.MOD))&&My(i,e,0,t)):(this.value=i=function(e,t){const n=function(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=gy(f),l=ry("tick","end"),c=function(){let e=1;return()=>(e=(1664525*e+1013904223)%4294967296)/4294967296}();function f(){d(),l.call("tick",t),n1?(null==n?s.delete(e):s.set(e,p(n)),t):s.get(e)},find:function(t,n,r){var i,o,a,s,u,l=0,c=e.length;for(null==r?r=1/0:r*=r,l=0;l1?(l.on(e,n),t):l.on(e)}}}(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),My(n,t,!0).on("end",()=>o=!0)}(t.source,e),i.on("tick",(n=t.dataflow,r=this,()=>n.touch(r).run())),e.static||(o=!0,i.tick()),t.modifies("index")),a||o||e.modified(Ey)||t.changed()&&e.restart)if(i.alpha(Math.max(i.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/s)),e.static)for(i.stop();--s>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let e,t=this._argops,s=0,u=t.length;s=0;--o)u.push(r=i[o]=new By(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Py)}function $y(e){return e.children}function Ny(e){return Array.isArray(e)?e[1]:null}function Ry(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Py(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function By(e){this.data=e,this.depth=this.height=0,this.parent=null}By.prototype=Ty.prototype={constructor:By,count:function(){return this.eachAfter(zy)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],u=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Ty(this).eachBefore(Ry)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n0&&n*n>r*r+i*i}function Wy(e,t){for(var n=0;n(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=e.x-r*s-o*u,n.y=e.y-r*u+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=t.x+r*s-o*u,n.y=t.y+r*u+o*s)):(n.x=t.x+n.r,n.y=t.y)}function Xy(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Jy(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function Ky(e){this._=e,this.next=null,this.previous=null}function Zy(e){if(!(o=(t=e,e="object"==typeof t&&"length"in t?t:Array.from(t)).length))return 0;var t,n,r,i,o,a,s,u,l,c,f,d;if((n=e[0]).x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;Vy(r,n,i=e[2]),n=new Ky(n),r=new Ky(r),i=new Ky(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(u=3;u0)throw new Error("cycle");return o}return n.id=function(t){return arguments.length?(e=ev(t),n):e},n.parentId=function(e){return arguments.length?(t=ev(e),n):t},n};function pv(e,t){return e.parent===t.parent?1:2}function gv(e){var t=e.children;return t?t[0]:e.t}function mv(e){var t=e.children;return t?t[t.length-1]:e.t}function bv(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function yv(e,t,n){return e.a.parent===t.parent?e.a:n}function vv(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}vv.prototype=Object.create(By.prototype);function xv(e,t){return e.parent===t.parent?1:2}function _v(e,t){return e+t.x}function Ov(e,t){return Math.max(e,t.y)}var wv=function(e,t,n,r,i){for(var o,a=e.children,s=-1,u=a.length,l=e.value&&(i-n)/e.value;++sd&&(d=s),m=c*c*g,(h=Math.max(d/m,m/f))>p){c-=s;break}p=h}b.push(a={value:c,dice:u1?t:1)},n}(jv),Av=function e(t){function n(e,n,r,i,o){if((a=e._squarify)&&a.ratio===t)for(var a,s,u,l,c,f=-1,d=a.length,h=e.value;++f1?t:1)},n}(jv);function Dv(e,t,n){const r={};return e.each(e=>{const i=e.data;n(i)&&(r[t(i)]=e)}),e.lookup=r,e}function Mv(e){Pe.call(this,null,e)}Mv.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const Sv=e=>e.values;function Cv(){const e=[],t={entries:t=>function t(n,r){if(++r>e.length)return n;const i=[];for(const e in n)i.push({key:e,values:t(n[e],r)});return i}(function t(n,r){if(r>=e.length)return n;const i=n.length,o=e[r++],a={},s={};let u,l,c,f=-1;for(;++f(e.push(n),t)};return t}function Fv(e){Pe.call(this,null,e)}Object(Z.z)(Mv,Pe,{transform(e,t){t.source||Object(Z.o)("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each(e=>{e.children&&oe(e.data)&&i.rem.push(e.data)}),this.value=o=Ty({values:Object(Z.i)(e.keys).reduce((e,t)=>(e.key(t),e),Cv()).entries(i.source)},Sv),n&&o.each(e=>{e.children&&(e=ue(e.data),i.add.push(e),i.source.push(e))}),Dv(o,ae,ae)),i.source.root=o,i}});const zv=(e,t)=>e.parent===t.parent?1:2;Object(Z.z)(Fv,Pe,{transform(e,t){t.source&&t.source.root||Object(Z.o)(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(de(e.sort,e=>e.data)),function(e,t,n){for(let r,i=0,o=t.length;ifunction(e,t,n){const r=e.data,i=t.length-1;for(let o=0;o=0;--i)s.push(n=t.children[i]=new vv(r[i],i)),n.parent=t;return(a.parent=new vv(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var l=i,c=i,f=i;i.eachBefore((function(e){e.xc.x&&(c=e),e.depth>f.depth&&(f=e)}));var d=l===c?1:e(l,c)/2,h=d-l.x,p=t/(c.x+d+h),g=n/(f.depth||1);i.eachBefore((function(e){e.x=(e.x+h)*p,e.y=e.depth*g}))}return i}function o(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){!function(e){for(var t,n=0,r=0,i=e.children,o=i.length;--o>=0;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(t);var o=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-o):t.z=o}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,n,r){if(n){for(var i,o=t,a=t,s=n,u=o.parent.children[0],l=o.m,c=a.m,f=s.m,d=u.m;s=mv(s),o=gv(o),s&&o;)u=gv(u),(a=mv(a)).a=t,(i=s.z+f-o.z-l+e(s._,o._))>0&&(bv(yv(s,t,r),t,i),l+=i,c+=i),f+=s.m,l+=o.m,d+=u.m,c+=a.m;s&&!mv(a)&&(a.t=s,a.m+=f-c),o&&!gv(u)&&(u.t=o,u.m+=l-d,r=t)}return r}(t,i,t.parent.A||r[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i},cluster:function(){var e=xv,t=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(t){var n=t.children;n?(t.x=function(e){return e.reduce(_v,0)/e.length}(n),t.y=function(e){return 1+e.reduce(Ov,0)}(n)):(t.x=o?a+=e(t,o):0,t.y=0,o=t)}));var s=function(e){for(var t;t=e.children;)e=t[0];return e}(i),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(i),l=s.x-e(s,u)/2,c=u.x+e(u,s)/2;return i.eachAfter(r?function(e){e.x=(e.x-i.x)*t,e.y=(i.y-e.y)*n}:function(e){e.x=(e.x-l)/(c-l)*t,e.y=(1-(i.y?e.y/i.y:1))*n})}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}},Lv=["x","y","depth","children"];function Iv(e){Fv.call(this,e)}function Uv(e){Pe.call(this,[],e)}Iv.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:Lv.length,default:Lv}]},Object(Z.z)(Iv,Fv,{layout(e){const t=e||"tidy";if(Object(Z.w)(Bv,t))return Bv[t]();Object(Z.o)("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:Lv}),Uv.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},Object(Z.z)(Uv,Pe,{transform(e,t){const n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||Object(Z.o)("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,e=>o[ae(e)]=1),r.each(e=>{const t=e.data,n=e.parent&&e.parent.data;n&&o[ae(t)]&&o[ae(n)]&&i.add.push(ue({source:n,target:t}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,e=>o[ae(e)]=1),n.forEach(e=>{(o[ae(e.source)]||o[ae(e.target)])&&i.mod.push(e)})),i}});const qv={binary:function(e,t,n,r,i){var o,a,s=e.children,u=s.length,l=new Array(u+1);for(l[0]=a=o=0;o=n-1){var c=s[t];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=u)}var f=l[t],d=r/2+f,h=t+1,p=n-1;for(;h>>1;l[g]u-o){var y=r?(i*b+a*m)/r:a;e(t,h,m,i,o,y,u),e(h,n,b,y,o,a,u)}else{var v=r?(o*b+u*m)/r:u;e(t,h,m,i,o,a,v),e(h,n,b,i,v,a,u)}}(0,u,e.value,t,n,r,i)},dice:uv,slice:wv,slicedice:function(e,t,n,r,i){(1&e.depth?wv:uv)(e,t,n,r,i)},squarify:Ev,resquarify:Av},Wv=["x0","y0","x1","y1","depth","children"];function Yv(e){Fv.call(this,e)}Yv.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Wv.length,default:Wv}]},Object(Z.z)(Yv,Fv,{layout(){const e=function(){var e=Ev,t=!1,n=1,r=1,i=[0],o=tv,a=tv,s=tv,u=tv,l=tv;function c(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(f),i=[0],t&&e.eachBefore(sv),e}function f(t){var n=i[t.depth],r=t.x0+n,c=t.y0+n,f=t.x1-n,d=t.y1-n;f{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{Object(Z.w)(qv,t)?e.tile(qv[t]):Object(Z.o)("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Wv});function Hv(e,t,n,r){const i=e.width,o=e.height,a=n||r,s=Ci(i,o).getContext("2d");t.forEach(e=>function e(t,n,r){if(!n.length)return;const i=n[0].mark.marktype;"group"===i?n.forEach(n=>{n.items.forEach(n=>e(t,n.items,r))}):_f[i].draw(t,{items:r?n.map(Gv):n})}(s,e,a));const u=new Uint32Array(s.getImageData(0,0,i,o).data.buffer),l=e.bitmap(),c=a&&e.bitmap();let f,d,h,p,g;for(d=0;d~~((e+n)/r);return a.invert=e=>e*r-n,a.bitmap=()=>function(e,t){const n=new Uint32Array(~~((e*t+32)/32));function r(e,t){n[e]|=t}function i(e,t){n[e]&=t}return{array:n,get:(t,r)=>{const i=r*e+t;return n[i>>>5]&1<<(31&i)},set:(t,n)=>{const i=n*e+t;r(i>>>5,1<<(31&i))},clear:(t,n)=>{const r=n*e+t;i(r>>>5,~(1<<(31&r)))},getRange:(t,r,i,o)=>{let a,s,u,l,c=o;for(;c>=r;--c)if(a=c*e+t,s=c*e+i,u=a>>>5,l=s>>>5,u===l){if(n[u]&Vv[31&a]&Xv[1+(31&s)])return!0}else{if(n[u]&Vv[31&a])return!0;if(n[l]&Xv[1+(31&s)])return!0;for(let e=u+1;e{let a,s,u,l,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+i,u=a>>>5,l=s>>>5,u===l)r(u,Vv[31&a]&Xv[1+(31&s)]);else for(r(u,Vv[31&a]),r(l,Xv[1+(31&s)]),c=u+1;c{let a,s,u,l,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+r,u=a>>>5,l=s>>>5,u===l)i(u,Xv[31&a]|Vv[1+(31&s)]);else for(i(u,Xv[31&a]),i(l,Vv[1+(31&s)]),c=u+1;cn<0||r<0||o>=t||i>=e}}(i,o),a.ratio=r,a.padding=n,a.width=e,a.height=t,a}function Kv(e,t,n,r,i,o){let a=n/2;return e-a<0||e+a>i||t-(a=r/2)<0||t+a>o}function Zv(e,t,n,r,i,o,a,s){const u=i*o/(2*r),l=e(t-u),c=e(t+u),f=e(n-(o/=2)),d=e(n+o);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||s&&s.getRange(l,f,c,d)}const Qv=[-1,-1,1,1],ex=[-1,1,-1,1];const tx=["right","center","left"],nx=["bottom","middle","top"];function rx(e,t,n,r,i,o,a,s,u,l,c,f){return!(i.outOfBounds(e,n,t,r)||(f&&o?o.getRange(e,n,t,r)||!function(e,t,n,r,i){return i[0]<=e&&n<=i[2]&&i[3]<=t&&r<=i[5]}(a,u,s,l,c):i.getRange(e,n,t,r)))}const ix={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},ox={naive:function(e,t,n,r){const i=e.width,o=e.height;return function(e){const t=e.datum.datum.items[r].items,n=t.length,a=e.datum.fontSize,s=nf.width(e.datum,e.datum.text);let u,l,c,f,d,h,p,g=0;for(let r=0;r=g&&(g=p,e.x=d,e.y=h);return d=s/2,h=a/2,u=e.x-d,l=e.x+d,c=e.y-h,f=e.y+h,e.align="center",u<0&&l<=i?e.align="left":0<=u&&i=1;)d=(h+p)/2,Zv(e,c,f,l,u,d,a,s)?p=d:h=d;if(h>r)return[c,f,h,!0]}}return function(t){const s=t.datum.datum.items[r].items,l=s.length,c=t.datum.fontSize,f=nf.width(t.datum,t.datum.text);let d,h,p,g,m,b,y,v,x,_,O,w,j,k,E,A,D,M=n?c:0,S=!1,C=!1,F=0;for(let r=0;rh&&(D=d,d=h,h=D),p>g&&(D=p,p=g,g=D),x=e(d),O=e(h),_=~~((x+O)/2),w=e(p),k=e(g),j=~~((w+k)/2),y=_;y>=x;--y)for(v=j;v>=w;--v)A=u(y,v,M,f,c),A&&([t.x,t.y,M,S]=A);for(y=_;y<=O;++y)for(v=j;v<=k;++v)A=u(y,v,M,f,c),A&&([t.x,t.y,M,S]=A);S||n||(E=Math.abs(h-d+g-p),m=(d+h)/2,b=(p+g)/2,E>=F&&!Kv(m,b,f,c,i,o)&&!Zv(e,m,b,c,f,c,a,null)&&(F=E,t.x=m,t.y=b,C=!0))}return!(!S&&!C)&&(m=f/2,b=c/2,a.setRange(e(t.x-m),e(t.y-b),e(t.x+m),e(t.y+b)),t.align="center",t.baseline="middle",!0)}},floodfill:function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],u=e.bitmap();return function(t){const l=t.datum.datum.items[r].items,c=l.length,f=t.datum.fontSize,d=nf.width(t.datum,t.datum.text),h=[];let p,g,m,b,y,v,x,_,O,w,j,k,E=n?f:0,A=!1,D=!1,M=0;for(let r=0;r=1;)j=(O+w)/2,Zv(e,y,v,f,d,j,a,s)?w=j:O=j;O>E&&(t.x=y,t.y=v,E=O,A=!0)}}A||n||(k=Math.abs(g-p+b-m),y=(p+g)/2,v=(m+b)/2,k>=M&&!Kv(y,v,d,f,i,o)&&!Zv(e,y,v,f,d,f,a,null)&&(M=k,t.x=y,t.y=v,D=!0))}return!(!A&&!D)&&(y=d/2,v=f/2,a.setRange(e(t.x-y),e(t.y-v),e(t.x+y),e(t.y+v)),t.align="center",t.baseline="middle",!0)}}};function ax(e,t,n,r,i,o,a,s,u,l,c){if(!e.length)return e;const f=Math.max(r.length,i.length),d=function(e,t){const n=new Float64Array(t),r=e.length;for(let t=0;t[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>i(e.datum):"line"===t?e=>{const t=e.datum.items[r].items;return i(t.length?t["start"===n?0:t.length-1]:{x:NaN,y:NaN})}:e=>{const t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:i}(p,g,s,u),y=Jv(t[0],t[1],l),v=m&&"naive"===c;var x;const _=e.map(e=>({datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:b(e)}));let O;if(!v){n&&_.sort((e,t)=>n(e.datum,t.datum));let t=!1;for(let e=0;ee.datum)].concat(o)),O=o.length?Hv(y,o,t,m):function(e,t){const n=e.bitmap();return(t||[]).forEach(t=>n.set(e(t.boundary[0]),e(t.boundary[3]))),[n,void 0]}(y,a&&_)}const w=m?ox[c](y,O,a,u):function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],u=r.length;return function(t){const l=t.boundary,c=t.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>o)return!1;let f,d,h,p,g,m,b,y,v,x,_,O,w,j,k,E=0;for(let i=0;i>>2&3)-1,h=0===f&&0===d||r[i]<0,p=f&&d?Math.SQRT1_2:1,g=r[i]<0?-1:1,m=l[1+f]+r[i]*f*p,_=l[4+d]+g*c*d/2+r[i]*d*p,y=_-c/2,v=_+c/2,O=e(m),j=e(y),k=e(v),!E){if(!rx(O,O,j,k,a,s,m,m,y,v,l,h))continue;E=nf.width(t.datum,t.datum.text)}if(x=m+g*E*f/2,m=x-E/2,b=x+E/2,O=e(m),w=e(b),rx(O,w,j,k,a,s,m,b,y,v,l,h))return t.x=f?f*g<0?b:m:x,t.y=d?d*g<0?v:y:_,t.align=tx[f*g+1],t.baseline=nx[d*g+1],a.setRange(O,j,w,k),!0}return!1}}(y,O,h,d);return _.forEach(e=>e.opacity=+w(e)),_}const sx=["x","y","opacity","align","baseline"],ux=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function lx(e){Pe.call(this,null,e)}function cx(e,t){var n,r,i,o,a,s,u=[],l=function(e){return e(o)};if(null==t)u.push(e);else for(n={},r=0,i=e.length;r{const 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)}}),fx.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},Object(Z.z)(fx,Pe,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=cx(t.materialize(t.SOURCE).source,e.groupby),i=(e.groupby||[]).map(Z.h),o=i.length,a=e.as||[Object(Z.h)(e.x),Object(Z.h)(e.y)],s=[];r.forEach(t=>{Pt(t,e.x,e.y,e.bandwidth||.3).forEach(e=>{const n={};for(let e=0;e"poly"===e?t:"quad"===e?2:1)(o,a),u=e.as||[Object(Z.h)(e.x),Object(Z.h)(e.y)],l=dx[o],c=[];let f=e.extent;Object(Z.w)(dx,o)||Object(Z.o)("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),r.forEach(n=>{if(n.length<=s)return void t.dataflow.warn("Skipping regression with more parameters than data points.");const r=l(n,e.x,e.y,a);if(e.params)return void c.push(ue({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const d=f||Object(Z.q)(n,e.x),h=e=>{const t={};for(let e=0;eh([e,r.predict(e)])):Ut(r.predict,d,25,200).forEach(h)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const px=Math.pow(2,-52),gx=new Uint32Array(512);class mx{static from(e,t=jx,n=kx){const r=e.length,i=new Float64Array(2*r);for(let o=0;o>1;if(t>0&&"number"!=typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=e.length>>1;let a=1/0,s=1/0,u=-1/0,l=-1/0;for(let t=0;tu&&(u=n),r>l&&(l=r),this._ids[t]=t}const c=(a+u)/2,f=(s+l)/2;let d,h,p,g=1/0;for(let t=0;t0&&(h=t,g=n)}let y=e[2*h],v=e[2*h+1],x=1/0;for(let t=0;tr&&(t[n++]=i,r=this._dists[i])}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(vx(m,b,y,v,_,O)){const e=h,t=y,n=v;h=p,y=_,v=O,p=e,_=t,O=n}const w=function(e,t,n,r,i,o){const a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u);return{x:e+(l*c-s*f)*d,y:t+(a*f-u*c)*d}}(m,b,y,v,_,O);this._cx=w.x,this._cy=w.y;for(let t=0;t0&&Math.abs(l-o)<=px&&Math.abs(c-a)<=px)continue;if(o=l,a=c,u===d||u===h||u===p)continue;let f=0;for(let e=0,t=this._hashKey(l,c);e0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[e],s=e-e%3;if(o=s+(e+2)%3,-1===a){if(0===i)break;e=gx[--i];continue}const u=a-a%3,l=s+(e+1)%3,c=u+(a+2)%3,f=t[o],d=t[e],h=t[l],p=t[c];if(xx(r[2*f],r[2*f+1],r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1])){t[e]=p,t[a]=f;const r=n[c];if(-1===r){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,r),this._link(a,n[o]),this._link(o,c);const s=u+(a+1)%3;i=33306690738754716e-32*Math.abs(a+s)?a-s:0}function vx(e,t,n,r,i,o){return(yx(i,o,e,t,n,r)||yx(e,t,n,r,i,o)||yx(n,r,i,o,e,t))<0}function xx(e,t,n,r,i,o,a,s){const u=e-a,l=t-s,c=n-a,f=r-s,d=i-a,h=o-s,p=c*c+f*f,g=d*d+h*h;return u*(f*g-p*h)-l*(c*g-p*d)+(u*u+l*l)*(c*h-f*d)<0}function _x(e,t,n,r,i,o){const a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u),h=(l*c-s*f)*d,p=(a*f-u*c)*d;return h*h+p*p}function Ox(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=e[i],o=t[r];let a=i-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=r}else{let i=n+1,o=r;wx(e,n+r>>1,i),t[e[n]]>t[e[r]]&&wx(e,n,r),t[e[i]]>t[e[r]]&&wx(e,i,r),t[e[n]]>t[e[i]]&&wx(e,n,i);const a=e[i],s=t[a];for(;;){do{i++}while(t[e[i]]s);if(o=o-n?(Ox(e,t,i,r),Ox(e,t,n,o-1)):(Ox(e,t,n,o-1),Ox(e,t,i,r))}}function wx(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function jx(e){return e[0]}function kx(e){return e[1]}class Ex{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const r=(e=+e)+(n=+n),i=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>1e-6||Math.abs(this._y1-i)>1e-6)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Ax{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class Dx{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let t,r,o=0,a=0,s=n.length;o1;)i-=2;for(let e=2;e4)for(let e=0;e0){if(t>=this.ymax)return null;(i=(this.ymax-t)/r)0){if(e>=this.xmax)return null;(i=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}}const Mx=2*Math.PI,Sx=Math.pow;function Cx(e){return e[0]}function Fx(e){return e[1]}function zx(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Tx{static from(e,t=Cx,n=Fx,r){return new Tx("length"in e?function(e,t,n,r){const i=e.length,o=new Float64Array(2*i);for(let a=0;a2&&function(e){const{triangles:t,coords:n}=e;for(let e=0;e1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},(e,t)=>t).sort((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]);const e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],this.triangles[1]=r[1],this.triangles[2]=r[1],o[r[0]]=1,2===r.length&&(o[r[1]]=0))}voronoi(e){return new Dx(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const t=a.indexOf(e);return t>0&&(yield a[t-1]),void(t=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[e]||!u.length)return(e+1)%(u.length>>1);let l=e,c=Sx(t-u[2*e],2)+Sx(n-u[2*e+1],2);const f=r[e];let d=f;do{let r=s[d];const f=Sx(t-u[2*r],2)+Sx(n-u[2*r+1],2);if(f=h));)if(t.x=f+i,t.y=d+o,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>s[0]||t.y+t.y1>s[1]||n&&Ix(t,e,s[0])||n&&(l=n,!((a=t).x+a.x1>l[0].x&&a.x+a.x0l[0].y&&a.y+a.y0>5,x=s[0]>>5,_=t.x-(v<<4),O=127&_,w=32-O,j=t.y1-t.y0,k=(t.y+t.y0)*x+(_>>5),E=0;E>>O:0);k+=x}return t.sprite=null,!0}return!1}return f.layout=function(){for(var u=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=2048/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(Ci()),f=function(e){var t=[],n=-1;for(;++n>5)*s[1]),h=null,p=l.length,g=-1,m=[],b=l.map(s=>({text:e(s),font:t(s),style:r(s),weight:i(s),rotate:o(s),size:~~(n(s)+1e-14),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s})).sort((e,t)=>t.size-e.size);++g>1,y.y=s[1]*(c()+.5)>>1,Lx(u,y,b,g),y.hasText&&d(f,y,h)&&(m.push(y),h?Ux(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-=s[0]>>1,y.y-=s[1]>>1)}return m},f.words=function(e){return arguments.length?(l=e,f):l},f.size=function(e){return arguments.length?(s=[+e[0],+e[1]],f):s},f.font=function(e){return arguments.length?(t=Wx(e),f):t},f.fontStyle=function(e){return arguments.length?(r=Wx(e),f):r},f.fontWeight=function(e){return arguments.length?(i=Wx(e),f):i},f.rotate=function(e){return arguments.length?(o=Wx(e),f):o},f.text=function(t){return arguments.length?(e=Wx(t),f):e},f.spiral=function(e){return arguments.length?(u=Yx[e]||e,f):u},f.fontSize=function(e){return arguments.length?(n=Wx(e),f):n},f.padding=function(e){return arguments.length?(a=Wx(e),f):a},f.random=function(e){return arguments.length?(c=e,f):c},f}function Lx(e,t,n,r){if(!t.sprite){var i=e.context,o=e.ratio;i.clearRect(0,0,2048/o,2048/o);var a,s,u,l,c,f=0,d=0,h=0,p=n.length;for(--r;++r>5<<5,u=~~Math.max(Math.abs(y+v),Math.abs(y-v))}else a=a+31>>5<<5;if(u>h&&(h=u),f+a>=2048&&(f=0,d+=h,h=0),d+u>=2048)break;i.translate((f+(a>>1))/o,(d+(u>>1))/o),t.rotate&&i.rotate(t.rotate*Px),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=a,t.height=u,t.xoff=f,t.yoff=d,t.x1=a>>1,t.y1=u>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,f+=a}for(var _=i.getImageData(0,0,2048/o,2048/o).data,O=[];--r>=0;)if((t=n[r]).hasText){for(s=(a=t.width)>>5,u=t.y1-t.y0,l=0;l>5),E=_[2048*(d+c)+(f+l)<<2]?1<<31-l%32:0;O[k]|=E,w|=E}w?j=c:(t.y0++,u--,c--,d++)}t.y1=t.y0+j,t.sprite=O.slice(0,(t.y1-t.y0)*s)}}}function Ix(e,t,n){n>>=5;for(var r,i=e.sprite,o=e.width>>5,a=e.x-(o<<4),s=127&a,u=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),f=0;f>>s:0))&t[c+d])return!0;c+=n}return!1}function Ux(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 qx(e){var t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function Wx(e){return"function"==typeof e?e:function(){return e}}var Yx={archimedean:qx,rectangular:function(e){var t=4*e[0]/e[1],n=0,r=0;return function(e){var i=e<0?-1:1;switch(Math.sqrt(1+4*i*e)-i&3){case 0:n+=t;break;case 1:r+=4;break;case 2:n-=t;break;default:r-=4}return[n,r]}}};const Hx=["x","y","font","fontSize","fontStyle","fontWeight","angle"],Gx=["text","font","rotate","fontSize","fontStyle","fontWeight"];function Vx(e){Pe.call(this,Bx(),e)}Vx.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:Hx}]},Object(Z.z)(Vx,Pe,{transform(e,t){!e.size||e.size[0]&&e.size[1]||Object(Z.o)("Wordcloud size dimensions must be non-zero.");const n=e.modified();if(!(n||t.changed(t.ADD_REM)||Gx.some((function(n){const r=e[n];return Object(Z.E)(r)&&t.modified(r.fields)}))))return;const r=t.materialize(t.SOURCE).source,i=this.value,o=e.as||Hx;let a,s=e.fontSize||14;if(Object(Z.E)(s)?a=e.fontSizeRange:s=Object(Z.m)(s),a){const e=s,t=Hs("sqrt")().domain(Object(Z.q)(r,e)).range(a);s=n=>t(e(n))}r.forEach(e=>{e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0});const u=i.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(s).random(tt).layout(),l=i.size(),c=l[0]>>1,f=l[1]>>1,d=u.length;for(let e,t,n=0;nnew Uint8Array(e),Jx=e=>new Uint16Array(e),Kx=e=>new Uint32Array(e);function Zx(e,t,n){const r=(t<257?Xx:t<65537?Jx:Kx)(e);return n&&r.set(n),r}function Qx(e,t,n){const r=1<{const r=e[t],i=e[n];return ri?1:0}),function(e,t){return Array.from(t,t=>e[t])}(e,t)}(d,u),a)l=t,c=e,t=Array(a+s),e=Kx(a+s),function(e,t,n,r,i,o,a,s,u){let l,c=0,f=0;for(l=0;c0)for(f=0;fe,size:()=>n}}function t_(e){Pe.call(this,function(){let e=8,t=[],n=Kx(0),r=Zx(0,e),i=Zx(0,e);return{data:()=>t,seen:()=>{return e=n,r=t.length,n=e.length>=r?e:((i=i||new e.constructor(r)).set(e),i);var e,r,i},add(e){for(let n,r=0,i=t.length,o=e.length;rt.length,curr:()=>r,prev:()=>i,reset:e=>i[e]=r[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){r[e]|=t},clear(e,t){r[e]&=~t},resize(t,n){(t>r.length||n>e)&&(e=Math.max(n,e),r=Zx(t,e,r),i=Zx(t,e))}}}(),e),this._indices=null,this._dims=null}function n_(e){Pe.call(this,null,e)}t_.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}}]},Object(Z.z)(t_,Pe,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some(e=>t.modified(e.fields))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],a=r.length;let s,u,l=0;for(;l{const e=i.remove(t,n);for(const t in r)r[t].reindex(e)})},update(e,t,n){const r=this._dims,i=e.query,o=t.stamp,a=r.length;let s,u,l=0;for(n.filters=0,u=0;uh)for(m=h,b=Math.min(f,p);mp)for(m=Math.max(f,p),b=d;mc)for(h=c,p=Math.min(u,f);hf)for(h=Math.max(u,f),p=l;hs[e]&n?null:a[e];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,e=>{const t=s[e]&n;return!t&&t^u[e]&n?a[e]:null}),o.filter(o.REM,e=>{const t=s[e]&n;return t&&!(t^t^u[e]&n)?a[e]:null})):(o.filter(o.ADD,l),o.filter(o.REM,e=>(s[e]&n)===i?a[e]:null)),o.filter(o.SOURCE,e=>l(e._index))}});function r_(e){this.type=e}var i_,o_,a_,s_,u_;r_.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case"CallExpression":return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];case"Identifier":case"Literal":case"RawCode":default:return[]}}(this),n=0,r=t.length;n",i_[3]="Identifier",i_[4]="Keyword",i_[5]="Null",i_[6]="Numeric",i_[7]="Punctuator",i_[8]="String",i_[9]="RegularExpression";var l_="ILLEGAL",c_=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]"),f_=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 d_(e,t){if(!e)throw new Error("ASSERT: "+t)}function h_(e){return e>=48&&e<=57}function p_(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function g_(e){return"01234567".indexOf(e)>=0}function m_(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 b_(e){return 10===e||13===e||8232===e||8233===e}function y_(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&c_.test(String.fromCharCode(e))}function v_(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&f_.test(String.fromCharCode(e))}const x_={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 __(){for(;a_1114111||"}"!==e)&&P_({},"Unexpected token %0",l_),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function j_(){var e,t;for(e=o_.charCodeAt(a_++),t=String.fromCharCode(e),92===e&&(117!==o_.charCodeAt(a_)&&P_({},"Unexpected token %0",l_),++a_,(e=O_("u"))&&"\\"!==e&&y_(e.charCodeAt(0))||P_({},"Unexpected token %0",l_),t=e);a_>>="===(r=o_.substr(a_,4))?{type:7,value:r,start:i,end:a_+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:a_+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:7,value:t,start:i,end:a_+=2}:"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:i,end:++a_}:void P_({},"Unexpected token %0",l_)}function A_(){var e,t,n;if(d_(h_((n=o_[a_]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=a_,e="","."!==n){if(e=o_[a_++],n=o_[a_],"0"===e){if("x"===n||"X"===n)return++a_,function(e){let t="";for(;a_=0&&P_({},"Invalid regular expression",n),{value:n,literal:t}}(),r=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(e,t)=>{if(parseInt(t,16)<=1114111)return"x";P_({},"Invalid regular expression")}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){P_({},"Invalid regular expression")}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:a_}}function M_(){if(__(),a_>=s_)return{type:2,start:a_,end:a_};const e=o_.charCodeAt(a_);return y_(e)?k_():40===e||41===e||59===e?E_():39===e||34===e?function(){var e,t,n,r,i="",o=!1;for(d_("'"===(e=o_[a_])||'"'===e,"String literal must starts with a quote"),t=a_,++a_;a_=0&&a_(d_(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 tO(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=u_,u=Q_(),0===(i=eO(r=u_)))return u;for(r.prec=i,S_(),t=[e,u_],o=[u,r,a=Q_()];(i=eO(u_))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=F_(s,u,a),o.push(n);(r=S_()).prec=i,o.push(r),t.push(u_),n=Q_(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=F_(o[l-1].value,o[l-2],n),l-=2;return n}(),I_("?")&&(S_(),t=tO(),L_(":"),e=function(e,t,n){const r=new r_("ConditionalExpression");return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,tO())),e}function nO(){const e=tO();if(I_(","))throw new Error("Disabled.");return e}function rO(e){a_=0,s_=(o_=e).length,u_=null,C_();const t=nO();if(2!==u_.type)throw new Error("Unexpect token after expression.");return t}var iO={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 oO(e){function t(t,n,r){return i=>function(t,n,r,i){let o=e(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+t+(i<0?"":0===i?"()":"("+n.slice(1).map(e).join(",")+")")}(t,i,n,r)}const n="new Date";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&&Object(Z.o)("Missing arguments to clamp function."),t.length>3&&Object(Z.o)("Too many arguments to clamp function.");const 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),join:t("join",null),indexof:t("indexOf",null),lastindexof:t("lastIndexOf",null),slice:t("slice",null),reverse:function(t){return"("+e(t[0])+").slice().reverse()"},parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase","String",0),lower:t("toLowerCase","String",0),substring:t("substring","String"),split:t("split","String"),replace:t("replace","String"),trim:t("trim","String",0),regexp:"RegExp",test:t("test","RegExp"),if:function(t){t.length<3&&Object(Z.o)("Missing arguments to if function."),t.length>3&&Object(Z.o)("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}var aO,sO,uO,lO,cO,fO=new lp,dO=new lp,hO={point:Cp,lineStart:Cp,lineEnd:Cp,polygonStart:function(){fO=new lp,hO.lineStart=pO,hO.lineEnd=gO},polygonEnd:function(){var e=+fO;dO.add(e<0?hp+e:e),this.lineStart=this.lineEnd=this.point=Cp},sphere:function(){dO.add(hp)}};function pO(){hO.point=mO}function gO(){bO(aO,sO)}function mO(e,t){hO.point=bO,aO=e,sO=t,uO=e*=gp,lO=vp(t=(t*=gp)/2+dp),cO=kp(t)}function bO(e,t){var n=(e*=gp)-uO,r=n>=0?1:-1,i=r*n,o=vp(t=(t*=gp)/2+dp),a=kp(t),s=cO*a,u=lO*o+s*vp(i),l=s*r*kp(i);fO.add(yp(l,u)),uO=e,lO=o,cO=a}var yO,vO,xO,_O,OO,wO,jO,kO,EO,AO,DO,MO={point:SO,lineStart:FO,lineEnd:zO,polygonStart:function(){MO.point=TO,MO.lineStart=$O,MO.lineEnd=NO,EO=new lp,hO.polygonStart()},polygonEnd:function(){hO.polygonEnd(),MO.point=SO,MO.lineStart=FO,MO.lineEnd=zO,fO<0?(yO=-(xO=180),vO=-(_O=90)):EO>1e-6?_O=90:EO<-1e-6&&(vO=-90),DO[0]=yO,DO[1]=xO},sphere:function(){yO=-(xO=180),vO=-(_O=90)}};function SO(e,t){AO.push(DO=[yO=e,xO=e]),t_O&&(_O=t)}function CO(e,t){var n=Bg([e*gp,t*gp]);if(kO){var r=Ig(kO,n),i=Ig([r[1],-r[0],0],r);Wg(i),i=Pg(i);var o,a=e-OO,s=a>0?1:-1,u=i[0]*pp*s,l=mp(a)>180;l^(s*OO_O&&(_O=o):l^(s*OO<(u=(u+360)%360-180)&&u_O&&(_O=t)),l?eRO(yO,xO)&&(xO=e):RO(e,xO)>RO(yO,xO)&&(yO=e):xO>=yO?(exO&&(xO=e)):e>OO?RO(yO,e)>RO(yO,xO)&&(xO=e):RO(e,xO)>RO(yO,xO)&&(yO=e)}else AO.push(DO=[yO=e,xO=e]);t_O&&(_O=t),kO=n,OO=e}function FO(){MO.point=CO}function zO(){DO[0]=yO,DO[1]=xO,MO.point=SO,kO=null}function TO(e,t){if(kO){var n=e-OO;EO.add(mp(n)>180?n+(n>0?360:-360):n)}else wO=e,jO=t;hO.point(e,t),CO(e,t)}function $O(){hO.lineStart()}function NO(){TO(wO,jO),hO.lineEnd(),mp(EO)>1e-6&&(yO=-(xO=180)),DO[0]=yO,DO[1]=xO,kO=null}function RO(e,t){return(t-=e)<0?t+360:t}function PO(e,t){return e[0]-t[0]}function BO(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tt.indexOf(e)>=0):t},R_union:function(e,t){var n=Object(Z.db)(t[0]),r=Object(Z.db)(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]}};function gw(e,t,n,r){"Literal"!==t[0].type&&Object(Z.o)("First argument to selection functions must be a string literal.");const i=t[0].value,o=":"+i;"intersect"!==(t.length>=2&&Object(Z.V)(t).value)||Object(Z.w)(r,"@unit")||(r["@unit"]=n.getData(i).indataRef(n,"unit")),Object(Z.w)(r,o)||(r[o]=n.getData(i).tuplesRef())}function mw(e){const t=this.context.data[e];return t?t.values.value:[]}const bw=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},yw=bw("format"),vw=bw("timeFormat"),xw=bw("utcFormat"),_w=bw("timeParse"),Ow=bw("utcParse"),ww=new Date(2e3,0,1);function jw(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(ww.setYear(2e3),ww.setMonth(e),ww.setDate(t),vw.call(this,ww,n)):""}function kw(e,t,n,r){"Literal"!==t[0].type&&Object(Z.o)("First argument to data functions must be a string literal.");const i=t[0].value,o=":"+i;if(!Object(Z.w)(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(e){}}function Ew(e,t,n,r){if("Literal"===t[0].type)Aw(n,r,t[0].value);else for(e in n.scales)Aw(n,r,e)}function Aw(e,t,n){const r="%"+n;if(!Object(Z.w)(t,r))try{t[r]=e.scaleRef(n)}catch(e){}}function Dw(e,t){let n;return Object(Z.E)(e)?e:Object(Z.I)(e)?(n=t.scales[e])&&n.value:void 0}function Mw(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=Ew,n._range=Ew,n._scale=Ew;const r=t=>"_["+("Literal"===t.type?Object(Z.ab)("%"+t.value):Object(Z.ab)("%")+"+"+e(t))+"]";return{_bandwidth:e=>"this.__bandwidth(".concat(r(e[0]),")"),_range:e=>"".concat(r(e[0]),".range()"),_scale:t=>"".concat(r(t[0]),"(").concat(e(t[1]),")")}}function Sw(e,t){return function(n,r,i){if(n){const t=Dw(n,(i||this).context);return t&&t.path[e](r)}return t(r)}}const Cw=Sw("area",(function(e){return dO=new lp,up(e,hO),2*dO})),Fw=Sw("bounds",(function(e){var t,n,r,i,o,a,s;if(_O=xO=-(yO=vO=1/0),AO=[],up(e,MO),n=AO.length){for(AO.sort(PO),t=1,o=[r=AO[0]];tRO(r[0],r[1])&&(r[1]=i[1]),RO(i[0],r[1])>RO(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=RO(r[1],i[0]))>a&&(a=s,yO=i[0],xO=r[1])}return AO=DO=null,yO===1/0||vO===1/0?[[NaN,NaN],[NaN,NaN]]:[[yO,vO],[xO,_O]]})),zw=Sw("centroid",(function(e){LO=IO=UO=qO=WO=YO=HO=GO=0,VO=new lp,XO=new lp,JO=new lp,up(e,nw);var t=+VO,n=+XO,r=+JO,i=Op(t,n,r);return i<1e-12&&(t=YO,n=HO,r=GO,IO<1e-6&&(t=UO,n=qO,r=WO),(i=Op(t,n,r))<1e-12)?[NaN,NaN]:[yp(n,t)*pp,Sp(r/i)*pp]}));function Tw(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(t){e.warn(t)}return n[n.length-1]}function $w(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Nw(e){const t=go(e);return.2126*$w(t.r)+.7152*$w(t.g)+.0722*$w(t.b)}function Rw(e,t){return e===t||e!=e&&t!=t||(Object(Z.B)(e)?!(!Object(Z.B)(t)||e.length!==t.length)&&function(e,t){for(let n=0,r=e.length;nPw(e,t)}const Lw=e=>e.data;function Iw(e,t){const n=mw.call(t,e);return n.root&&n.root.lookup||{}}const Uw=()=>"undefined"!=typeof window&&window||null;const qw={random:()=>tt(),cumulativeNormal:dt,cumulativeLogNormal:yt,cumulativeUniform:jt,densityNormal:ft,densityLogNormal:bt,densityUniform:wt,quantileNormal:ht,quantileLogNormal:vt,quantileUniform:kt,sampleNormal:ct,sampleLogNormal:mt,sampleUniform:Ot,isArray:Z.B,isBoolean:Z.C,isDate:Z.D,isDefined:e=>void 0!==e,isNumber:Z.F,isObject:Z.G,isRegExp:Z.H,isString:Z.I,isTuple:oe,isValid:e=>null!=e&&e==e,toBoolean:Z.bb,toDate:Z.cb,toNumber:Z.db,toString:Z.fb,flush:Z.v,lerp:Z.K,merge:function(){const e=[].slice.call(arguments);return e.unshift({}),Object(Z.p)(...e)},pad:Z.Q,peek:Z.V,span:Z.Y,inrange:Z.A,truncate:Z.gb,rgb:go,lab:ls,hcl:ms,hsl:Oo,luminance:Nw,contrast:function(e,t){const n=Nw(e),r=Nw(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:Wt,format:yw,utcFormat:xw,utcParse:Ow,utcOffset:Ht.w,utcSequence:Ht.x,timeFormat:vw,timeParse:_w,timeOffset:Ht.q,timeSequence:Ht.r,timeUnitSpecifier:Ht.s,monthFormat:function(e){return jw.call(this,e,1,"%B")},monthAbbrevFormat:function(e){return jw.call(this,e,1,"%b")},dayFormat:function(e){return jw.call(this,0,2+e,"%A")},dayAbbrevFormat:function(e){return jw.call(this,0,2+e,"%a")},quarter:Z.W,utcquarter:Z.ib,week:Ht.A,utcweek:Ht.z,dayofyear:Ht.m,utcdayofyear:Ht.y,warn:function(){return Tw(this.context.dataflow,"warn",arguments)},info:function(){return Tw(this.context.dataflow,"info",arguments)},debug:function(){return Tw(this.context.dataflow,"debug",arguments)},extent:Z.q,inScope:function(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},intersect:function(e,t,n){if(!e)return[];const[r,i]=e,o=(new El).set(r[0],r[1],i[0],i[1]);return $d(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=Object(Z.i)(e.marktype),r=Object(Z.i)(e.markname);t=e=>(!n.length||n.some(t=>e.marktype===t))&&(!r.length||r.some(t=>e.name===t))}return t}(t))},clampRange:Z.k,pinchDistance:function(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function(){const e=Uw();return e?e.screen:{}},containerSize:function(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function(){const e=Uw();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return $s(e||0,t||0,n||0)},setdata:function(e,t){const n=this.context.dataflow,r=this.context.data[e].input;return n.pulse(r,n.changeset().remove(Z.hb).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?Ju(n,t=t||Bu(e)):e}},panLinear:Z.R,panLog:Z.S,panPow:Z.T,panSymlog:Z.U,zoomLinear:Z.mb,zoomLog:Z.nb,zoomPow:Z.ob,zoomSymlog:Z.pb,encode:function(e,t,n){if(e){const n=this.context.dataflow,r=e.mark.source;n.pulse(r,n.changeset().encode(e,t))}return void 0!==n?n:e},modify:function(e,t,n,r,i,o){const a=this.context.dataflow,s=this.context.data[e],u=s.input,l=a.stamp();let c,f,d=s.changes;if(!1===a._trigger||!(u.value.length||t||r))return 0;if((!d||d.stamp{s.modified=!0,a.pulse(u,d).run()},!0,1)),n&&(c=!0===n?Z.hb:Object(Z.B)(n)||oe(n)?n:Bw(n),d.remove(c)),t&&d.insert(t),r&&(c=Bw(r),u.value.some(c)?d.remove(c):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1}},Ww=["view","item","group","xy","x","y"],Yw={},Hw={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>"_[".concat(Object(Z.ab)("$"+e),"]"),functions:function(e){const t=oO(e);Ww.forEach(e=>t[e]="event.vega."+e);for(const e in qw)t[e]="this."+e;return Object(Z.p)(t,Mw(e,qw,Yw)),t},constants:iO,visitors:Yw},Gw=function(e){const t=(e=e||{}).allowed?Object(Z.eb)(e.allowed):{},n=e.forbidden?Object(Z.eb)(e.forbidden):{},r=e.constants||iO,i=(e.functions||oO)(f),o=e.globalvar,a=e.fieldvar,s=Object(Z.E)(o)?o:e=>"".concat(o,'["').concat(e,'"]');let u={},l={},c=0;function f(e){if(Object(Z.I)(e))return e;const t=d[e.type];return null==t&&Object(Z.o)("Unsupported type: "+e.type),t(e)}const d={Literal:e=>e.raw,Identifier:e=>{const i=e.name;return c>0?i:Object(Z.w)(n,i)?Object(Z.o)("Illegal identifier: "+i):Object(Z.w)(r,i)?r[i]:Object(Z.w)(t,i)?i:(u[i]=1,s(i))},MemberExpression:e=>{const t=!e.computed,n=f(e.object);t&&(c+=1);const r=f(e.property);return n===a&&(l[function(e){const 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:e=>{"Identifier"!==e.callee.type&&Object(Z.o)("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=Object(Z.w)(i,t)&&i[t];return r||Object(Z.o)("Unrecognized function: "+t),Object(Z.E)(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(f).join(",")+"]",BinaryExpression:e=>"("+f(e.left)+e.operator+f(e.right)+")",UnaryExpression:e=>"("+e.operator+f(e.argument)+")",ConditionalExpression:e=>"("+f(e.test)+"?"+f(e.consequent)+":"+f(e.alternate)+")",LogicalExpression:e=>"("+f(e.left)+e.operator+f(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(f).join(",")+"}",Property:e=>{c+=1;const t=f(e.key);return c-=1,t+":"+f(e.value)}};function h(e){const t={code:f(e),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},t}return h.functions=i,h.constants=r,h}(Hw);function Vw(e,t,n){return 1===arguments.length?qw[e]:(qw[e]=t,n&&(Yw[e]=n),Gw&&(Gw.functions[e]="this."+e),this)}function Xw(e,t){const n={};let r;try{r=rO(e=Object(Z.I)(e)?e:Object(Z.ab)(e)+"")}catch(t){Object(Z.o)("Expression parse error: "+e)}r.visit(e=>{if("CallExpression"!==e.type)return;const r=e.callee.name,i=Hw.visitors[r];i&&i(r,e.arguments,t,n)});const i=Gw(r);return i.globals.forEach(e=>{const r="$"+e;!Object(Z.w)(n,r)&&t.getSignal(e)&&(n[r]=t.signalRef(e))}),{$expr:Object(Z.p)({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}Vw("bandwidth",(function(e,t){const n=Dw(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),Ew),Vw("copy",(function(e,t){const n=Dw(e,(t||this).context);return n?n.copy():void 0}),Ew),Vw("domain",(function(e,t){const n=Dw(e,(t||this).context);return n?n.domain():[]}),Ew),Vw("range",(function(e,t){const n=Dw(e,(t||this).context);return n&&n.range?n.range():[]}),Ew),Vw("invert",(function(e,t,n){const r=Dw(e,(n||this).context);return r?Object(Z.B)(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}),Ew),Vw("scale",(function(e,t,n){const r=Dw(e,(n||this).context);return r?r(t):void 0}),Ew),Vw("gradient",(function(e,t,n,r,i){e=Dw(e,(i||this).context);const o=Tu(t,n);let a=e.domain(),s=a[0],u=Object(Z.V)(a),l=Z.y;return u-s?l=ou(e,s,u):e=(e.interpolator?Hs("sequential")().interpolator(e.interpolator()):Hs("linear")().interpolate(e.interpolate()).range(e.range())).domain([s=0,u=1]),e.ticks&&(a=e.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==Object(Z.V)(a)&&a.push(u)),a.forEach(t=>o.stop(l(t),e(t))),o}),Ew),Vw("geoArea",Cw,Ew),Vw("geoBounds",Fw,Ew),Vw("geoCentroid",zw,Ew),Vw("geoShape",(function(e,t,n){const r=Dw(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}}),Ew),Vw("indata",(function(e,t,n){const 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){"Literal"!==t[0].type&&Object(Z.o)("First argument to indata must be a string literal."),"Literal"!==t[1].type&&Object(Z.o)("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,a="@"+o;Object(Z.w)(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),Vw("data",mw,kw),Vw("treePath",(function(e,t,n){const r=Iw(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(Lw):void 0}),kw),Vw("treeAncestors",(function(e,t){const n=Iw(e,this)[t];return n?n.ancestors().map(Lw):void 0}),kw),Vw("vlSelectionTest",(function(e,t,n){for(var r,i,o,a,s,u=this.context.data[e],l=u?u.values.value:[],c=u?u["index:unit"]&&u["index:unit"].value:void 0,f="intersect"===n,d=l.length,h=0;h(e[i[n].field]=t,e),{}))}return t=t||"union",Object.keys(m).forEach(e=>{m[e]=Object.keys(m[e]).map(t=>m[e][t]).reduce((n,r)=>void 0===n?r:pw[y[e]+"_"+t](n,r))}),g=Object.keys(b),n&&g.length&&(m.vlMulti="union"===t?{or:g.reduce((e,t)=>(e.push(...b[t]),e),[])}:{and:g.map(e=>({or:b[e]}))}),m}),gw);const Jw=Object(Z.eb)(["rule"]),Kw=Object(Z.eb)(["group","image","rect"]);function Zw(e){return(e+"").toLowerCase()}function Qw(e,t,n){";"!==n[n.length-1]&&(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}var ej={operator:(e,t)=>Qw(e,["_"],t.code),parameter:(e,t)=>Qw(e,["datum","_"],t.code),event:(e,t)=>Qw(e,["event"],t.code),handler:(e,t)=>Qw(e,["_","event"],"var datum=event.item&&event.item.datum;return ".concat(t.code,";")),encode:(e,t)=>{const{marktype:n,channels:r}=t;let i="var o=item,datum=o.datum,m=0,$;";for(const e in r){const t="o["+Object(Z.ab)(e)+"]";i+="$=".concat(r[e].code,";if(").concat(t,"!==$)").concat(t,"=$,m=1;")}return i+=function(e,t){let n="";return Jw[t]||(e.x2&&(e.x?(Kw[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(Kw[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),i+="return m;",Qw(e,["item","_"],i)},codegen:{get(e){const t="[".concat(e.map(Z.ab).join("]["),"]"),n=Function("_","return _".concat(t,";"));return n.path=t,n},comparator(e,t){let n;const r=Function("a","b","var u, v; return "+e.map((e,r)=>{const i=t[r];let o,a;return e.path?(o="a".concat(e.path),a="b".concat(e.path)):((n=n||{})["f"+r]=e,o="this.f".concat(r,"(a)"),a="this.f".concat(r,"(b)")),function(e,t,n,r){return"((u = ".concat(e,") < (v = ").concat(t,") || u == null) && v != null ? ").concat(n,"\n : (u > 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," : ")}(o,a,-i,i)}).join("")+"0;");return n?r.bind(n):r}}};function tj(e,t,n){if(!e||!Object(Z.G)(e))return e;for(let r,i=0,o=nj.length;ie&&e.$tupleid?ae:e);return t.fn[n]||(t.fn[n]=Object(Z.l)(r,e.$order,t.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const n=e.$subflow;return function(e,r,i){const o=t.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(i),a.detachSubflow=()=>t.detach(o),a}}},{key:"$tupleid",parse:function(){return ae}}];const rj={skip:!0};function ij(e,t,n,r){return new oj(e,t,n,r)}function oj(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||ej,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function aj(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}oj.prototype=aj.prototype={fork(){const e=new aj(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(t=>t!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),"collect"===Zw(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let i=n.get(e.parent.$ref);i?(r.connect(i,[t]),t.targets().add(i)):(n.unresolved=n.unresolved||[]).push(()=>{i=n.get(e.parent.$ref),r.connect(i,[t]),t.targets().add(i)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const r in e.data){const i=n.data[r]||(n.data[r]={});e.data[r].forEach(e=>i[e]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[Zw(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(e=>t.parseOperator(e)),n.forEach(e=>t.parseOperatorParameters(e)),(e.streams||[]).forEach(e=>t.parseStream(e)),(e.updates||[]).forEach(e=>t.parseUpdate(e)),t.resolve()},parseOperator:function(e){const t=this;"operator"!==Zw(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const t=this;if(e.params){const n=t.get(e.id);n||Object(Z.o)("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=Object(Z.B)(i)?i.map(e=>tj(e,n,t)):tj(i,n,t)}return t},parseStream:function(e){var t,n=this,r=null!=e.filter?n.eventExpression(e.filter):void 0,i=null!=e.stream?n.get(e.stream):void 0;e.source?i=n.events(e.source,e.type,r):e.merge&&(i=(t=e.merge.map(e=>n.get(e)))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map(e=>n.get(e)),i=i.between(t[0],t[1])),e.filter&&(i=i.filter(r)),null!=e.throttle&&(i=i.throttle(+e.throttle)),null!=e.debounce&&(i=i.debounce(+e.debounce)),null==i&&Object(Z.o)("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),n.stream(e,i)},parseUpdate:function(e){var t,n=Object(Z.G)(n=e.source)?n.$ref:n,r=this.get(n),i=e.update,o=void 0;r||Object(Z.o)("Source not defined: "+e.source),t=e.target&&e.target.$expr?this.eventExpression(e.target.$expr):this.get(e.target),i&&i.$expr&&(i.$params&&(o=this.parseParameters(i.$params)),i=this.handlerExpression(i.$expr)),this.update(e,r,t,i,o)},getState:function(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach(n=>{const i=t.signals[n];e.signals(n,i)&&(r[n]=i.value)})}if(e.data){var i=n.data={};Object.keys(t.data).forEach(n=>{const r=t.data[n];e.data(n,r)&&(i[n]=r.input.value)})}return t.subcontext&&!1!==e.recurse&&(n.subcontext=t.subcontext.map(t=>t.getState(e))),n},setState:function(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach(e=>{n.update(t.signals[e],i[e],rj)}),Object.keys(r||{}).forEach(e=>{n.pulse(t.data[e].input,n.changeset().remove(Z.hb).insert(r[e]))}),(e.subcontext||[]).forEach((e,n)=>{const r=t.subcontext[n];r&&r.setState(e)})}};function sj(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function uj(e,t){const n=e.globalCursor()?"undefined"!=typeof document&&document.body:e.container();if(n)return null==t?n.style.removeProperty("cursor"):n.style.cursor=t}function lj(e,t){var n=e._runtime.data;return Object(Z.w)(n,t)||Object(Z.o)("Unrecognized data set: "+t),n[t]}function cj(e,t){he(t)||Object(Z.o)("Second argument to changes must be a changeset.");const n=lj(this,e);return n.modified=!0,this.pulse(n.input,t)}function fj(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function dj(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function hj(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function pj(e,t,n){var r,i,o=e._renderer,a=o&&o.canvas();return a&&(i=hj(e),(r=$f(t.changedTouches?t.changedTouches[0]:t,a))[0]-=i[0],r[1]-=i[1]),t.dataflow=e,t.item=n,t.vega=function(e,t,n){const r=t?"group"===t.mark.marktype?t:t.mark.group:null;function i(e){var n,i=r;if(e)for(n=t;n;n=n.mark.group)if(n.mark.name===e){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(e){if(!e)return n;Object(Z.I)(e)&&(e=i(e));const t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:Object(Z.m)(e),item:Object(Z.m)(t||{}),group:i,xy:o,x:function(e){return o(e)[0]},y:function(e){return o(e)[1]}}}(e,n,r),t}const gj={trap:!1};function mj(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return!(!1===r||Object(Z.G)(r)&&!r[n])||(e.warn("Blocked ".concat(t," ").concat(n," event listener.")),!1)}function bj(e){return e.item}function yj(e){return e.item.mark.source}function vj(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function xj(e,t,n){const r=document.createElement(e);for(const e in t)r.setAttribute(e,t[e]);return null!=n&&(r.textContent=n),r}function _j(e,t,n){if(!t)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:t=>{t!==e.signal(r.signal)&&e.runAsync(null,()=>{i.source=!0,e.signal(r.signal,t)})}},r.debounce&&(i.update=Object(Z.n)(r.debounce,i.update))),function(e,t,n,r){const i=xj("div",{class:"vega-bind"}),o="radio"===n.input?i:i.appendChild(xj("label"));o.appendChild(xj("span",{class:"vega-bind-name"},n.name||n.signal)),t.appendChild(i);let a=Oj;switch(n.input){case"checkbox":a=wj;break;case"select":a=jj;break;case"radio":a=kj;break;case"range":a=Ej}a(e,o,n,r)}(i,t,r,e.signal(r.signal)),i.active||(e.on(e._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(e.signal(r.signal))}),i.active=!0),i}function Oj(e,t,n,r){const i=xj("input");for(const e in n)"signal"!==e&&"element"!==e&&i.setAttribute("input"===e?"type":e,n[e]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",()=>e.update(i.value)),e.elements=[i],e.set=e=>i.value=e}function wj(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=xj("input",i);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=e=>o.checked=!!e||null}function jj(e,t,n,r){const i=xj("select",{name:n.signal}),o=n.labels||[];n.options.forEach((e,t)=>{const n={value:e};Aj(e,r)&&(n.selected=!0),i.appendChild(xj("option",n,(o[t]||e)+""))}),t.appendChild(i),i.addEventListener("change",()=>{e.update(n.options[i.selectedIndex])}),e.elements=[i],e.set=e=>{for(let t=0,r=n.options.length;t{const s={type:"radio",name:n.signal,value:t};Aj(t,r)&&(s.checked=!0);const u=xj("input",s);u.addEventListener("change",()=>e.update(t));const l=xj("label",{},(o[a]||t)+"");return l.prepend(u),i.appendChild(l),u}),e.set=t=>{const n=e.elements,r=n.length;for(let e=0;e{u.textContent=s.value,e.update(+s.value)};s.addEventListener("input",l),s.addEventListener("change",l),e.elements=[s],e.set=e=>{s.value=e,u.textContent=e}}function Aj(e,t){return e===t||e+""==t+""}function Dj(e,t,n,r,i,o){return(t=t||new r(e.loader())).initialize(n,fj(e),dj(e),hj(e),i,o).background(e.background())}function Mj(e,t){return t?function(){try{t.apply(this,arguments)}catch(t){e.error(t)}}:null}function Sj(e,t){if("string"==typeof t){if("undefined"==typeof document)return e.error("DOM document instance not found."),null;if(!(t=document.querySelector(t)))return e.error("Signal bind element not found: "+t),null}if(t)try{t.innerHTML=""}catch(n){t=null,e.error(n)}return t}const Cj=e=>+e||0;function Fj(e){return Object(Z.G)(e)?{top:Cj(e.top),bottom:Cj(e.bottom),left:Cj(e.left),right:Cj(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(Cj(e))}async function zj(e,t,n,r){const i=Td(t),o=i&&i.headless;return o||Object(Z.o)("Unrecognized renderer type: "+t),await e.runAsync(),Dj(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}var Tj={skip:!0};function $j(e,t){var n=e.autosize(),r=e.padding();return t-(n&&"padding"===n.contains?r.left+r.right:0)}function Nj(e,t){var n=e.autosize(),r=e.padding();return t-(n&&"padding"===n.contains?r.top+r.bottom:0)}function Rj(e,t){return t.modified&&Object(Z.B)(t.input.value)&&e.indexOf("_:vega:_")}function Pj(e,t){return!("parent"===e||t instanceof Be.proxy)}function Bj(e,t,n,r){const i=e.element();i&&i.setAttribute("title",function(e){return null==e?"":Object(Z.B)(e)?Lj(e):Object(Z.G)(e)&&!Object(Z.D)(e)?(t=e,Object.keys(t).map(e=>{const n=t[e];return e+": "+(Object(Z.B)(n)?Lj(n):Ij(n))}).join("\n")):e+"";var t}(r))}function Lj(e){return"["+e.map(Ij).join(", ")+"]"}function Ij(e){return Object(Z.B)(e)?"[…]":Object(Z.G)(e)&&!Object(Z.D)(e)?"{…}":e}function Uj(e,t){const n=this;if(t=t||{},Ne.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),null!=t.logLevel&&n.logLevel(t.logLevel),t.locale||e.locale){const r=Object(Z.p)({},e.locale,t.locale);n.locale(Object(ee.b)(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Fd.Canvas,n._scenegraph=new Df;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||Bj,n._redraw=!0,n._handler=(new Vf).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=Object(Z.p)({defaults:{}},e),n=(e,t)=>{t.forEach(t=>{Object(Z.B)(e[t])&&(e[t]=Object(Z.eb)(e[t]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=function(e,t,n){return ij(e,Be,qw,n).parse(t)}(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map(e=>({state:null,param:Object(Z.p)({},e)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=$j(n,n._width),n._viewHeight=Nj(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(e){var t=e._signals,n=t.width,r=t.height,i=t.padding;function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,t=>{e._width=t.size,e._viewWidth=$j(e,t.size),o()},{size:n}),e._resizeHeight=e.add(null,t=>{e._height=t.size,e._viewHeight=Nj(e,t.size),o()},{size:r});const a=e.add(null,o,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(n),function(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}(n),function(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:"default",item:null}));e.on(e.events("view","mousemove"),t,(e,n)=>{const r=t.value,i=r?Object(Z.I)(r)?r:r.user:"default",o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}}),e.add(null,(function(t){let n=t.cursor,r=this.value;return Object(Z.I)(n)||(r=n.item,n=n.user),uj(e,n&&"default"!==n?n:r||n),r}),{cursor:t})}(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind)}function qj(e,t){return Object(Z.w)(e._signals,t)?e._signals[t]:Object(Z.o)("Unrecognized signal name: "+Object(Z.ab)(t))}function Wj(e,t){const n=(e._targets||[]).filter(e=>e._update&&e._update.handler===t);return n.length?n[0]:null}function Yj(e,t,n,r){let i=Wj(n,r);return i||(i=Mj(e,()=>r(t,n.value)),i.handler=r,e.on(n,null,i)),e}function Hj(e,t,n){const r=Wj(t,n);return r&&t._targets.remove(r),e}Object(Z.z)(Uj,Ne,{async evaluate(e,t,n){if(await Ne.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,i=hj(r=this),o=fj(r),a=dj(r),r._renderer.background(r.background()),r._renderer.resize(o,a,i),r._handler.origin(i),r._resizeListeners.forEach(e=>{try{e(o,a)}catch(e){r.error(e)}})),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(e){this.error(e)}var r,i,o,a;return n&&ne(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=null!=e?e+"":null;return t!==this._desc&&sj(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const r=qj(this,e);return 1===arguments.length?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",Fj(e)):Fj(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Td(e)||Object(Z.o)("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Ne.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(qj(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(e,t,n,r,i,o){this.runAfter(a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal("width",n,Tj),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal("height",r,Tj),a._resizeHeight.skip(!0)),a._viewWidth!==e&&(a._resize=1,a._viewWidth=e),a._viewHeight!==t&&(a._resize=1,a._viewHeight=t),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter(e=>e.resize())},!1,1)},addEventListener(e,t,n){let r=t;return n&&!1===n.trap||(r=Mj(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n,r,i=this._handler.handlers(e),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,e===r&&(t===n||t===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return Yj(this,e,qj(this,e),t)},removeSignalListener(e,t){return Hj(this,qj(this,e),t)},addDataListener(e,t){return Yj(this,e,lj(this,e).values,t)},removeDataListener(e,t){return Hj(this,lj(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=uj(this,null);this._globalCursor=!!e,t&&uj(this,t)}return this}return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function(e,t){this._timers.push(function(e,t,n){var r=new py,i=t;return null==t?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(e,t,n){t=+t,n=null==n?dy():+n,r._restart((function o(a){a+=i,r._restart(o,i+=t,n),e(a)}),t,n)},r.restart(e,t,n),r)}((function(t){e({timestamp:Date.now(),elapsed:t})}),t))},events:function(e,t,n){var r,i=this,o=new _e(n),a=function(n,r){i.runAsync(null,()=>{"view"===e&&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(),o.receive(pj(i,n,r))})};if("timer"===e)mj(i,"timer",t)&&i.timer(a,t);else if("view"===e)mj(i,"view",t)&&i.addEventListener(t,a,gj);else if("window"===e?mj(i,"window",t)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&mj(i,"selector",t)&&(r=document.querySelectorAll(e)),r){for(var s=0,u=r.length;s=0;)i[e].stop();for(e=o.length;--e>=0;)for(t=(n=o[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",bj),yj,vj(e)),this.on(this.events("view","mouseout",bj),yj,vj(t)),this},data:function(e,t){return arguments.length<2?lj(this,e).values.value:cj.call(this,e,pe().remove(Z.hb).insert(t))},change:cj,insert:function(e,t){return cj.call(this,e,pe().insert(t))},remove:function(e,t){return cj.call(this,e,pe().remove(t))},scale:function(e){var t=this._runtime.scales;return Object(Z.w)(t,e)||Object(Z.o)("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=Td(r);e=n._el=e?Sj(n,e):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),sj(t,e.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||Vf,s=e?o.renderer:o.headless;return n._renderer=s?Dj(n,n._renderer,e,s):null,n._handler=function(e,t,n,r){const i=new r(e.loader(),Mj(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,hj(e),e);return t&&t.handlers().forEach(e=>{i.on(e.type,e.handler)}),i}(n,n._handler,e,a),n._redraw=!0,e&&"none"!==i&&(t=t?n._elBind=Sj(n,t):e.appendChild(xj("form",{class:"vega-bindings"})),n._bind.forEach(e=>{e.param.element&&"container"!==i&&(e.element=Sj(n,e.param.element))}),n._bind.forEach(e=>{_j(n,e.element||t,e)})),n},toImageURL:async function(e,t){e!==Fd.Canvas&&e!==Fd.SVG&&e!==Fd.PNG&&Object(Z.o)("Unrecognized image type: "+e);const n=await zj(this,e,t);return e===Fd.SVG?function(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(e,t){return(await zj(this,Fd.Canvas,e,t)).canvas()},toSVG:async function(e){return(await zj(this,Fd.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:Rj,signals:Pj,recurse:!0})},setState:function(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},e=>{e._trigger=!0}),this}});const Gj=/[[\]{}]/,Vj={"*":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};let Xj,Jj;function Kj(e,t,n){return Xj=t||"view",Jj=n||Vj,Qj(e.trim()).map(ek)}function Zj(e,t,n,r,i){const o=e.length;let a,s=0;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function Qj(e){const t=[],n=e.length;let r=0,i=0;for(;i"!==(e=e.slice(r+1).trim())[0])throw"Expected '>' after between selector: "+e;n=n.map(ek);const i=ek(e.slice(1).trim());if(i.between)return{between:n,stream:i};i.between=n;return i}(e):function(e){const t={source:Xj},n=[];let r,i,o=[0,0],a=0,s=0,u=e.length,l=0;if("}"===e[u-1]){if(l=e.lastIndexOf("{"),!(l>=0))throw"Unmatched right brace: "+e;try{o=function(e){const t=e.split(",");if(!e.length||t.length>2)throw e;return t.map(t=>{const n=+t;if(n!=n)throw e;return n})}(e.substring(l+1,u-1))}catch(t){throw"Invalid throttle specification: "+e}e=e.slice(0,l).trim(),u=e.length,l=0}if(!u)throw e;"@"===e[0]&&(a=++l);r=Zj(e,l,":"),r1?(t.type=n[1],a?t.markname=n[0].slice(1):(c=n[0],Jj[c]?t.marktype=n[0]:t.source=n[0])):t.type=n[0];var c;"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1));null!=i&&(t.filter=i);o[0]&&(t.throttle=o[0]);o[1]&&(t.debounce=o[1]);return t}(e)}function tk(e){return Object(Z.G)(e)?e:{type:e||"pad"}}const nk=e=>+e||0;function rk(e){return Object(Z.G)(e)?e.signal?e:{top:nk(e.top),bottom:nk(e.bottom),left:nk(e.left),right:nk(e.right)}:{top:t=nk(e),bottom:t,left:t,right:t};var t}const ik=e=>Object(Z.G)(e)&&!Object(Z.B)(e)?Object(Z.p)({},e):{value:e};function ok(e,t,n,r){if(null!=n){return Object(Z.G)(n)&&!Object(Z.B)(n)||Object(Z.B)(n)&&n.length&&Object(Z.G)(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1}return 0}function ak(e,t,n){for(const n in t)ok(e,n,t[n]);for(const t in n)ok(e,t,n[t],"update")}function sk(e,t,n){for(const r in t)n&&Object(Z.w)(n,r)||(e[r]=Object(Z.p)(e[r]||{},t[r]));return e}function uk(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}function lk(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const ck=e=>Object(Z.I)(e)?Object(Z.ab)(e):e.signal?"(".concat(e.signal,")"):pk(e);function fk(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map(e=>null==e?null:Object(Z.ab)(e));for(;t.length&&null==Object(Z.V)(t);)t.pop();return t.unshift(ck(e.gradient)),"gradient(".concat(t.join(","),")")}(e);let t=e.signal?"(".concat(e.signal,")"):e.color?function(e){return e.c?dk("hcl",e.h,e.c,e.l):e.h||e.s?dk("hsl",e.h,e.s,e.l):e.l||e.a?dk("lab",e.l,e.a,e.b):e.r||e.g||e.b?dk("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?pk(e.field):void 0!==e.value?Object(Z.ab)(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=ck(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?"":"*"+hk(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(hk(e.exponent),")")),null!=e.mult&&(t+="*".concat(hk(e.mult))),null!=e.offset&&(t+="+".concat(hk(e.offset))),e.round&&(t="round(".concat(t,")")),t}const dk=(e,t,n,r)=>"(".concat(e,"(").concat([t,n,r].map(fk).join(","),")+'')");function hk(e){return Object(Z.G)(e)?"("+fk(e)+")":e}function pk(e){return function e(t){let n,r,i;if(t.signal)n="datum",i=t.signal;else if(t.group||t.parent){for(r=Math.max(1,t.level||1),n="item";r-- >0;)n+=".mark.group";t.parent?(i=t.parent,n+=".datum"):i=t.group}else t.datum?(n="datum",i=t.datum):Object(Z.o)("Invalid field reference: "+Object(Z.ab)(t));t.signal||(i=Object(Z.I)(i)?Object(Z.Z)(i).map(Z.ab).join("]["):e(i));return n+"["+i+"]"}(Object(Z.G)(e)?e:{datum:e})}function gk(e,t,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},e=function(e,t,n,r,i){const o={},a={};let s,u,l,c;for(u in u="lineBreak","text"!==t||null==i[u]||uk(u,e)||lk(o,u,i[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c="frame"===n?i.group:"mark"===n?Object(Z.p)({},i.mark,i[t]):null,c)l=uk(u,e)||("fill"===u||"stroke"===u)&&(uk("fill",e)||uk("stroke",e)),l||lk(o,u,c[u]);for(u in Object(Z.i)(r).forEach(t=>{const n=i.style&&i.style[t];for(const t in n)uk(t,e)||lk(o,t,n[t])}),e=Object(Z.p)({},e),o)c=o[u],c.signal?(s=s||{})[u]=c:a[u]=c;return e.enter=Object(Z.p)(a,e.enter),s&&(e.update=Object(Z.p)(s,e.update)),e}(e,t,n,r,i.config);for(const n in e)a[n]=mk(e[n],t,o,i);return o}function mk(e,t,n,r){const i={},o={};for(const t in e)null!=e[t]&&(i[t]=bk((a=e[t],Object(Z.B)(a)?function(e){let t="";return e.forEach(e=>{const n=fk(e);t+=e.test?"(".concat(e.test,")?").concat(n,":"):n}),":"===Object(Z.V)(t)&&(t+="null"),t}(a):fk(a)),r,n,o));var a;return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function bk(e,t,n,r){const i=Xw(e,t);return i.$fields.forEach(e=>r[e]=1),Object(Z.p)(n,i.$params),i.$expr}const yk=["value","update","init","react","bind"];function vk(e,t){Object(Z.o)(e+' for "outer" push: '+Object(Z.ab)(t))}function xk(e,t){const n=e.name;if("outer"===e.push)t.signals[n]||vk("No prior signal definition",n),yk.forEach(t=>{void 0!==e[t]&&vk("Invalid property ",t)});else{const r=t.addSignal(n,e.value);!1===e.react&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function _k(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function Ok(e,t,n,r){return new _k(e,t,n,r)}function wk(e,t){return Ok("operator",e,t)}function jk(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function kk(e,t){return t?{$field:e,$name:t}:{$field:e}}const Ek=kk("key");function Ak(e,t){return{$compare:e,$order:t}}function Dk(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}function Mk(e){return e&&e.signal}function Sk(e){if(Mk(e))return!0;if(Object(Z.G)(e))for(const t in e)if(Sk(e[t]))return!0;return!1}function Ck(e,t){return null!=e?e:t}function Fk(e){return e&&e.signal||e}function zk(e,t){return(e.merge?Tk:e.stream?$k:e.type?Nk:Object(Z.o)("Invalid stream specification: "+Object(Z.ab)(e)))(e,t)}function Tk(e,t){const n=Rk({merge:e.merge.map(e=>zk(e,t))},e,t);return t.addStream(n).id}function $k(e,t){const n=Rk({stream:zk(e.stream,t)},e,t);return t.addStream(n).id}function Nk(e,t){let n;var r;"timer"===e.type?(n=t.event("timer",e.throttle),e={between:e.between,filter:e.filter}):n=t.event("scope"===(r=e.source)?"view":r||"view",e.type);const i=Rk({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function Rk(e,t,n){let r=t.between;return r&&(2!==r.length&&Object(Z.o)('Stream "between" parameter must have 2 entries: '+Object(Z.ab)(t)),e.between=[zk(r[0],n),zk(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(function(e,t,n){const 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)),"scope"===t.source&&r.push("inScope(event.item)"),r.length&&(e.filter=Xw("("+r.join(")&&(")+")",n).$expr),null!=(r=t.throttle)&&(e.throttle=+r),null!=(r=t.debounce)&&(e.debounce=+r),t.consume&&(e.consume=!0),e}const Pk={code:"_.$value",ast:{type:"Identifier",value:"value"}};function Bk(e,t,n){const r=e.encode,i={target:n};let o=e.events,a=e.update,s=[];o||Object(Z.o)("Signal update missing events specification."),Object(Z.I)(o)&&(o=Kj(o,t.isSubscope()?"scope":"view")),o=Object(Z.i)(o).filter(e=>e.signal||e.scale?(s.push(e),0):1),s.length>1&&(s=[Lk(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&Object(Z.o)("Signal encode and update are mutually exclusive."),a="encode(item(),"+Object(Z.ab)(r)+")"),i.update=Object(Z.I)(a)?Xw(a,t):null!=a.expr?Xw(a.expr,t):null!=a.value?a.value:null!=a.signal?{$expr:Pk,$params:{$value:t.signalRef(a.signal)}}:Object(Z.o)("Invalid signal update specification."),e.force&&(i.options={force:!0}),s.forEach(e=>t.addUpdate(Object(Z.p)(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):zk(e,t)}}(e,t),i)))}function Lk(e){return{signal:"["+e.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}const Ik=e=>(t,n,r)=>Ok(e,n,t||void 0,r),Uk=Ik("aggregate"),qk=Ik("axisticks"),Wk=Ik("bound"),Yk=Ik("collect"),Hk=Ik("compare"),Gk=Ik("datajoin"),Vk=Ik("encode"),Xk=Ik("expression"),Jk=Ik("facet"),Kk=Ik("field"),Zk=Ik("key"),Qk=Ik("legendentries"),eE=Ik("load"),tE=Ik("mark"),nE=Ik("multiextent"),rE=Ik("multivalues"),iE=Ik("overlap"),oE=Ik("params"),aE=Ik("prefacet"),sE=Ik("projection"),uE=Ik("proxy"),lE=Ik("relay"),cE=Ik("render"),fE=Ik("scale"),dE=Ik("sieve"),hE=Ik("sortitems"),pE=Ik("viewlayout"),gE=Ik("values");let mE=0;const bE={min:"min",max:"max",count:"sum"};function yE(e,t){const n=t.getScale(e.name).params;let r;var i;for(r in n.domain=OE(e.domain,e,t),null!=e.range&&(n.range=function e(t,n,r){const i=n.config.range;let o=t.range;if(o.signal)return n.signalRef(o.signal);if(Object(Z.I)(o)){if(i&&Object(Z.w)(i,o))return t=Object(Z.p)({},t,{range:i[o]}),e(t,n,r);"width"===o?o=[0,{signal:"width"}]:"height"===o?o=Js(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Object(Z.o)("Unrecognized scale range value: "+Object(Z.ab)(o))}else{if(o.scheme)return r.scheme=Object(Z.B)(o.scheme)?xE(o.scheme,n):vE(o.scheme,n),o.extent&&(r.schemeExtent=xE(o.extent,n)),void(o.count&&(r.schemeCount=vE(o.count,n)));if(o.step)return void(r.rangeStep=vE(o.step,n));if(Js(t.type)&&!Object(Z.B)(o))return OE(o,t,n);Object(Z.B)(o)||Object(Z.o)("Unsupported range type: "+Object(Z.ab)(o))}return o.map(e=>(Object(Z.B)(e)?xE:vE)(e,n))}(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=vE(e.type||e),null!=e.gamma&&(t.interpolateGamma=vE(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=(i=e.nice,Object(Z.G)(i)?{interval:vE(i.interval),step:vE(i.step)}:vE(i))),null!=e.bins&&(n.bins=function(e,t){return e.signal||Object(Z.B)(e)?xE(e,t):t.objectProperty(e)}(e.bins,t)),e)Object(Z.w)(n,r)||"name"===r||(n[r]=vE(e[r],t))}function vE(e,t){return Object(Z.G)(e)?e.signal?t.signalRef(e.signal):Object(Z.o)("Unsupported object: "+Object(Z.ab)(e)):e}function xE(e,t){return e.signal?t.signalRef(e.signal):e.map(e=>vE(e,t))}function _E(e){Object(Z.o)("Can not find data set: "+Object(Z.ab)(e))}function OE(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(Object(Z.B)(e)?wE:e.fields?kE:jE)(e,t,n);null==t.domainMin&&null==t.domainMax||Object(Z.o)("No scale domain defined for domainMin/domainMax to override.")}function wE(e,t,n){return e.map(e=>vE(e,n))}function jE(e,t,n){const r=n.getData(e.data);return r||_E(e.data),Js(t.type)?r.valuesRef(n,e.field,AE(e.sort,!1)):eu(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function kE(e,t,n){const r=e.data,i=e.fields.reduce((e,t)=>(t=Object(Z.I)(t)?{data:r,field:t}:Object(Z.B)(t)||t.signal?function(e,t){const n="_:vega:_"+mE++,r=Yk({});if(Object(Z.B)(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+Object(Z.ab)(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,dE({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e),[]);return(Js(t.type)?EE:eu(t.type)?DE:ME)(e,n,i)}function EE(e,t,n){const r=AE(e.sort,!0);let i,o;const a=n.map(e=>{const n=t.getData(e.data);return n||_E(e.data),n.countsRef(t,e.field,r)}),s={groupby:Ek,pulse:a};r&&(i=r.op||"count",o=r.field?Dk(i,r.field):"count",s.ops=[bE[i]],s.fields=[t.fieldRef(o)],s.as=[o]),i=t.add(Uk(s));const u=t.add(Yk({pulse:jk(i)}));return o=t.add(gE({field:Ek,sort:t.sortRef(r),pulse:jk(u)})),jk(o)}function AE(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!bE[e.op]&&Object(Z.o)("Multiple domain scales can not be sorted using "+e.op):Object(Z.o)("No field provided for sort aggregate op: "+e.op):Object(Z.G)(e)?e.field="key":e={field:"key"}),e}function DE(e,t,n){const r=n.map(e=>{const n=t.getData(e.data);return n||_E(e.data),n.domainRef(t,e.field)});return jk(t.add(rE({values:r})))}function ME(e,t,n){const r=n.map(e=>{const n=t.getData(e.data);return n||_E(e.data),n.extentRef(t,e.field)});return jk(t.add(nE({extents:r})))}function SE(e,t,n){return Object(Z.B)(e)?e.map(e=>SE(e,t,n)):Object(Z.G)(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:Object(Z.o)("Unsupported parameter object: "+Object(Z.ab)(e)):e}const CE="value",FE=["size","shape","fill","stroke","strokeWidth","strokeDash","opacity"],zE={name:1,style:1,interactive:1},TE={value:0},$E={value:1};function NE(e){return e.type="group",e.interactive=e.interactive||!1,e}function RE(e,t){const n=(n,r)=>Ck(e[n],Ck(t[n],r));return n.isVertical=n=>"vertical"===Ck(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>Ck(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>Ck(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>Ck(e.columns,Ck(t.columns,+n.isVertical(!0))),n}function PE(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function BE(e,t,n){return"item.anchor === '".concat("start","' ? ").concat(e," : item.anchor === '").concat("end","' ? ").concat(t," : ").concat(n)}const LE=BE(Object(Z.ab)("left"),Object(Z.ab)("right"),Object(Z.ab)("center"));function IE(e,t){return t?e?Object(Z.G)(e)?Object.assign({},e,{offset:IE(e.offset,t)}):{value:e,offset:t}:t:e}function UE(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=sk(e.encode,t,zE)):e.interactive=!1,e}function qE(e,t,n,r){const i=RE(e,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let u,l,c,f,d;o?(l=[0,1],c=[0,0],f=a,d=s):(l=[0,0],c=[1,0],f=s,d=a);const h={enter:u={opacity:TE,x:TE,y:TE,width:ik(f),height:ik(d)},update:Object(Z.p)({},u,{opacity:$E,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:TE}};return ak(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),UE({type:"rect",role:"legend-gradient",encode:h},r)}function WE(e,t,n,r,i){const o=RE(e,n),a=o.isVertical(),s=o.gradientThickness(),u=o.gradientLength();let l,c,f,d,h="";a?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:TE,fill:{scale:t,field:CE}};p[l]={signal:h+"datum.perc",mult:u},p[c]=TE,p[f]={signal:h+"datum.perc2",mult:u},p[d]=ik(s);const g={enter:p,update:Object(Z.p)({},p,{opacity:$E}),exit:{opacity:TE}};return ak(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),UE({type:"rect",role:"legend-band",key:CE,from:i,encode:g},r)}const YE="datum.".concat("perc",'<=0?"').concat("left",'":datum.').concat("perc",'>=1?"').concat("right",'":"').concat("center",'"'),HE="datum.".concat("perc",'<=0?"').concat("bottom",'":datum.').concat("perc",'>=1?"').concat("top",'":"').concat("middle",'"');function GE(e,t,n,r){const i=RE(e,t),o=i.isVertical(),a=ik(i.gradientThickness()),s=i.gradientLength();let u,l,c,f,d=i("labelOverlap"),h="";const p={enter:u={opacity:TE},update:l={opacity:$E,text:{field:"label"}},exit:{opacity:TE}};return ak(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:Ck(e.labelLimit,t.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=l.baseline={signal:HE},c="y",f="x",h="1-"):(u.align=l.align={signal:YE},u.baseline={value:"top"},c="x",f="y"),u[c]=l[c]={signal:h+"datum.perc",mult:s},u[f]=l[f]=a,a.offset=Ck(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:i("labelSeparation"),method:d,order:"datum.index"}:void 0,UE({type:"text",role:"legend-label",style:"guide-label",key:CE,from:r,encode:p,overlap:d},n)}function VE(e,t,n,r,i){const o=RE(e,t),a=n.entries,s=!(!a||!a.interactive),u=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d="(".concat(i,") ? datum.").concat("offset"," : datum.").concat("size"),h=l?ik(l):{field:"size"},p="datum.".concat("index"),g="max(1, ".concat(i,")");let m,b,y,v,x;h.mult=.5,m={enter:b={opacity:TE,x:{signal:d,mult:.5,offset:c},y:h},update:y={opacity:$E,x:b.x,y:b.y},exit:{opacity:TE}};let _=null,O=null;e.fill||(_=t.symbolBaseFillColor,O=t.symbolBaseStrokeColor),ak(m,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",O),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),FE.forEach(t=>{e[t]&&(y[t]=b[t]={scale:e[t],field:CE})});const w=UE({type:"symbol",role:"legend-symbol",key:CE,from:f,clip:!!l||void 0,encode:m},n.symbols),j=ik(c);j.offset=o("labelOffset"),m={enter:b={opacity:TE,x:{signal:d,offset:j},y:h},update:y={opacity:$E,text:{field:"label"},x:b.x,y:b.y},exit:{opacity:TE}},ak(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const k=UE({type:"text",role:"legend-label",style:"guide-label",key:CE,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:TE,height:l?ik(l):TE,opacity:TE},exit:{opacity:TE},update:y={opacity:$E,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(v="ceil(item.mark.items.length / ".concat(g,")"),y.row.signal="".concat(p,"%").concat(v),y.column.signal="floor(".concat(p," / ").concat(v,")"),x={field:["row",p]}):(y.row.signal="floor(".concat(p," / ").concat(g,")"),y.column.signal="".concat(p," % ").concat(g),x={field:p}),y.column.signal="(".concat(i,")?").concat(y.column.signal,":").concat(p),NE({role:"scope",from:r={facet:{data:r,name:"value",groupby:"index"}},encode:sk(m,a,zE),marks:[w,k],name:u,interactive:s,sort:x})}const XE='item.orient === "left"',JE='item.orient === "right"',KE="(".concat(XE," || ").concat(JE,")"),ZE="datum.vgrad && ".concat(KE),QE=BE('"top"','"bottom"','"middle"'),eA=BE('"right"','"left"','"center"'),tA="datum.vgrad && ".concat(JE," ? (").concat(eA,") : (").concat(KE," && !(datum.vgrad && ").concat(XE,')) ? "left" : ').concat(LE),nA="item._anchor || (".concat(KE,' ? "middle" : "start")'),rA="".concat(ZE," ? (").concat(XE," ? -90 : 90) : 0"),iA="".concat(KE," ? (datum.vgrad ? (").concat(JE,' ? "bottom" : "top") : ').concat(QE,') : "top"');function oA(e,t){let n;return Object(Z.G)(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+aA(e.path)+")":e.sphere&&(n="geoShape("+aA(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function aA(e){return Object(Z.G)(e)&&e.signal?e.signal:Object(Z.ab)(e)}function sA(e){const t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")&&t.indexOf("title")?"group"===e.type?"scope":t||"mark":t}function uA(e){return{marktype:e.type,name:e.name||void 0,role:e.role||sA(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){const n=Le(e.type);n||Object(Z.o)("Unrecognized transform type: "+Object(Z.ab)(e.type));const r=Ok(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){const r={},i=e.params.length;for(let o=0;opA(e,t,n))):pA(e,r,n)}(e,t,n):"projection"===r?n.projectionRef(t[e.name]):e.array&&!Mk(i)?i.map(t=>hA(e,t,n)):hA(e,i,n):void(e.required&&Object(Z.o)("Missing required "+Object(Z.ab)(t.type)+" parameter: "+Object(Z.ab)(e.name)))}function hA(e,t,n){const r=e.type;if(Mk(t))return yA(r)?Object(Z.o)("Expression references can not be signals."):vA(r)?n.fieldRef(t):xA(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||vA(r);return i&&gA(t)?n.exprRef(t.expr,t.as):i&&mA(t)?kk(t.field,t.as):yA(r)?Xw(t,n):bA(r)?jk(n.getData(t).values):vA(r)?kk(t):xA(r)?n.compareRef(t):t}}function pA(e,t,n){const r=e.params.length;let i;for(let n=0;ne&&e.expr,mA=e=>e&&e.field,bA=e=>"data"===e,yA=e=>"expr"===e,vA=e=>"field"===e,xA=e=>"compare"===e;function _A(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:jk(t.getData(e.data).output)}function OA(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}function wA(e){return Object(Z.I)(e)?e:null}function jA(e,t,n){const r=Dk(n.op,n.field);let i;if(t.ops){for(let e=0,n=t.as.length;enull==e?"null":e).join(",")+"),0)",t);u.update=l.$expr,u.params=l.$params}function AA(e,t){const n=sA(e),r="group"===e.type,i=e.from&&e.from.facet,o=e.overlap;let a,s,u,l,c,f,d,h=e.layout||"scope"===n||"frame"===n;const p="mark"===n||h||i,g=function(e,t,n){let r,i,o,a,s;return e?(r=e.facet)&&(t||Object(Z.o)("Only group marks can be faceted."),null!=r.field?a=s=_A(r,n):(e.data?s=jk(n.getData(e.data).aggregate):(o=cA(Object(Z.p)({type:"aggregate",groupby:Object(Z.i)(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=_A(r,n),a=s=jk(n.add(o))),i=n.keyRef(r.groupby,!0))):a=jk(n.add(Yk(null,[{}]))),a||(a=_A(e,n)),{key:i,pulse:a,parent:s}}(e.from,r,t);s=t.add(Gk({key:g.key||(e.key?kk(e.key):void 0),pulse:g.pulse,clean:!r}));const m=jk(s);s=u=t.add(Yk({pulse:m})),s=t.add(tE({markdef:uA(e),interactive:lA(e.interactive,t),clip:oA(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:jk(s)}));const b=jk(s);s=l=t.add(Vk(gk(e.encode,e.type,n,e.style,t,{mod:!1,pulse:b}))),s.params.parent=t.encode(),e.transform&&e.transform.forEach(e=>{const n=cA(e,t),r=n.metadata;(r.generates||r.changes)&&Object(Z.o)("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),n.params.pulse=jk(s),t.add(s=n)}),e.sort&&(s=t.add(hE({sort:t.compareRef(e.sort),pulse:jk(s)})));const y=jk(s);(i||h)&&(h=t.add(pE({layout:t.objectProperty(e.layout),legends:t.legends,mark:b,pulse:y})),f=jk(h));const v=t.add(Wk({mark:b,pulse:f||y}));d=jk(v),r&&(p&&(a=t.operators,a.pop(),h&&a.pop()),t.pushState(y,f||d,m),i?function(e,t,n){const r=e.from.facet,i=r.name,o=_A(r,t);let a;r.name||Object(Z.o)("Facet must have a name: "+Object(Z.ab)(r)),r.data||Object(Z.o)("Facet must reference a data set: "+Object(Z.ab)(r)),r.field?a=t.add(aE({field:t.fieldRef(r.field),pulse:o})):r.groupby?a=t.add(Jk({key:t.keyRef(r.groupby),group:jk(t.proxy(n.parent)),pulse:o})):Object(Z.o)("Facet must specify groupby or field: "+Object(Z.ab)(r));const s=t.fork(),u=s.add(Yk()),l=s.add(dE({pulse:jk(u)}));s.addData(i,new OA(s,u,u,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,t,g):p?function(e,t,n){const r=t.add(aE({pulse:n.pulse})),i=t.fork();i.add(dE()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}(e,t,g):t.parse(e),t.popState(),p&&(h&&a.push(h),a.push(v))),o&&(d=function(e,t,n){const r=e.method,i=e.bound,o=e.separation,a={separation:Mk(o)?n.signalRef(o.signal):o,method:Mk(r)?n.signalRef(r.signal):r,pulse:t};e.order&&(a.sort=n.compareRef({field:e.order}));if(i){const e=i.tolerance;a.boundTolerance=Mk(e)?n.signalRef(e.signal):+e,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return jk(n.add(iE(a)))}(o,d,t));const x=t.add(cE({pulse:d})),_=t.add(dE({pulse:jk(x)},void 0,t.parent()));null!=e.name&&(c=e.name,t.addData(c,new OA(t,u,x,_)),e.on&&e.on.forEach(e=>{(e.insert||e.remove||e.toggle)&&Object(Z.o)("Marks only support modify triggers."),EA(e,t,c)}))}function DA(e,t){const n=t.config.legend,r=e.encode||{},i=RE(e,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,u=o.style,l={};let c,f,d,h=0;FE.forEach(t=>e[t]?(l[t]=e[t],h=h||e[t]):0),h||Object(Z.o)("Missing valid scale for legend.");const p=function(e,t){let n=e.type||"symbol";e.type||1!==function(e){return FE.reduce((t,n)=>t+(e[n]?1:0),0)}(e)||!e.fill&&!e.stroke||(n=Xs(t)?"gradient":Ks(t)?"discrete":"symbol");return"gradient"!==n?n:Ks(t)?"discrete":"gradient"}(e,t.scaleType(h)),g={title:null!=e.title,scales:l,type:p,vgrad:"symbol"!==p&&i.isVertical()},m=jk(t.add(Yk(null,[g]))),b=jk(t.add(Qk(f={type:p,scale:t.scaleRef(h),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return"gradient"===p?(d=[qE(e,h,n,r.gradient),GE(e,n,r.labels,b)],f.count=f.count||t.signalRef("max(2,2*floor((".concat(Fk(i.gradientLength()),")/100))"))):"discrete"===p?d=[WE(e,h,n,r.gradient,b),GE(e,n,r.labels,b)]:(c=function(e,t){const n=RE(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),d=[VE(e,n,r,b,Fk(c.columns))],f.size=function(e,t,n){const r=Fk(SA("size",e,n)),i=Fk(SA("strokeWidth",e,n)),o=Fk(function(e,t,n){return PE("fontSize",e)||function(e,t,n){const r=t.config.style[n];return r&&r[e]}("fontSize",t,n)}(n[1].encode,t,"guide-label"));return Xw("max(ceil(sqrt(".concat(r,")+").concat(i,"),").concat(o,")"),t)}(e,t,d[0].marks)),d=[NE({role:"legend-entry",from:m,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:s})],g.title&&d.push(function(e,t,n,r){const i=RE(e,t),o={enter:{opacity:TE},update:{opacity:$E,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:TE}};return ak(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:nA},angle:{signal:rA},align:{signal:tA},baseline:{signal:iA},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),UE({type:"text",role:"legend-title",style:"guide-title",from:r,encode:o},n)}(e,n,r.title,m)),AA(NE({role:"legend",from:m,encode:sk(MA(i,e,n),o,zE),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:u}),t)}function MA(e,t,n){const r={enter:{},update:{}};return ak(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function SA(e,t,n){return t[e]?'scale("'.concat(t[e],'",datum)'):PE(e,n[0].encode)}OA.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],a=null,s=1;for(o&&"load"===o.type&&(o=t[1]),e.add(t[0]);s{n.push(cA(e,t))}),e.on&&e.on.forEach(n=>{EA(n,t,e.name)}),t.addDataPipeline(e.name,function(e,t,n){const r=[];let i,o,a,s,u,l=null,c=!1,f=!1;e.values?Sk(e.values)||Sk(e.format)?(r.push(NA(t,e)),r.push(l=$A())):r.push(l=$A({$ingest:e.values,$format:e.format})):e.url?Sk(e.url)||Sk(e.format)?(r.push(NA(t,e)),r.push(l=$A())):r.push(l=$A({$request:e.url,$format:e.format})):e.source&&(l=i=Object(Z.i)(e.source).map(e=>jk(t.getData(e).output)),r.push(null));for(o=0,a=n.length;o"bottom"===e||"top"===e,PA=(e,t,n)=>Mk(e)?WA(e.signal,t,n):"left"===e||"top"===e?t:n,BA=(e,t,n)=>Mk(e)?UA(e.signal,t,n):RA(e)?t:n,LA=(e,t,n)=>Mk(e)?qA(e.signal,t,n):RA(e)?n:t,IA=(e,t,n)=>Mk(e)?YA(e.signal,t,n):"top"===e?{value:t}:{value:n},UA=(e,t,n)=>GA("".concat(e," === '").concat("top","' || ").concat(e," === '").concat("bottom","'"),t,n),qA=(e,t,n)=>GA("".concat(e," !== '").concat("top","' && ").concat(e," !== '").concat("bottom","'"),t,n),WA=(e,t,n)=>XA("".concat(e," === '").concat("left","' || ").concat(e," === '").concat("top","'"),t,n),YA=(e,t,n)=>XA("".concat(e," === '").concat("top","'"),t,n),HA=(e,t,n)=>XA("".concat(e," === '").concat("right","'"),t,n),GA=(e,t,n)=>(t=null!=t?ik(t):t,n=null!=n?ik(n):n,VA(t)&&VA(n)?(t=t?t.signal||Object(Z.ab)(t.value):null,n=n?n.signal||Object(Z.ab)(n.value):null,{signal:"".concat(e," ? (").concat(t,") : (").concat(n,")")}):[Object(Z.p)({test:e},t)].concat(n||[])),VA=e=>null==e||1===Object.keys(e).length,XA=(e,t,n)=>({signal:"".concat(e," ? (").concat(JA(t),") : (").concat(JA(n),")")}),JA=e=>Mk(e)?e.signal:null==e?null:Object(Z.ab)(e),KA=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function ZA(e,t,n,r){let i;if(t&&Object(Z.w)(t,e))return t[e];if(Object(Z.w)(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r["guide-title"][i]}if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r["guide-label"][i]}return null}function QA(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function eD(e,t){return{scale:e.scale,range:t}}function tD(e,t,n,r,i){const o=RE(e,t),a=e.orient,s=e.gridScale,u=PA(a,1,-1),l=function(e,t){if(1===t);else if(Object(Z.G)(e)){let n=e=Object(Z.p)({},e);for(;null!=n.mult;){if(!Object(Z.G)(n.mult))return n.mult=Mk(t)?{signal:"(".concat(n.mult,") * (").concat(t.signal,")")}:n.mult*t,e;n=n.mult=Object(Z.p)({},n.mult)}n.mult=t}else e=Mk(t)?{signal:"(".concat(t.signal,") * (").concat(e||0,")")}:t*(e||0);return e}(e.offset,u);let c,f,d;const h={enter:c={opacity:TE},update:d={opacity:$E},exit:f={opacity:TE}};ak(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:CE,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=BA(a,{signal:"height"},{signal:"width"}),m=s?{scale:s,range:0,mult:u,offset:l}:{value:0,offset:l},b=s?{scale:s,range:1,mult:u,offset:l}:Object(Z.p)(g,{mult:u,offset:l});return c.x=d.x=BA(a,p,m),c.y=d.y=LA(a,p,m),c.x2=d.x2=LA(a,b),c.y2=d.y2=BA(a,b),f.x=BA(a,p),f.y=LA(a,p),UE({type:"rule",role:"axis-grid",key:CE,from:r,encode:h},n)}function nD(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function rD(e,t,n,r,i,o){const a=RE(e,t),s=e.orient,u=e.scale,l=PA(s,-1,1),c=Fk(a("labelFlush")),f=Fk(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,g=0===c||!!c;const m=ik(i);m.mult=l,m.offset=ik(a("labelPadding")||0),m.offset.mult=l;const b={scale:u,field:CE,band:.5,offset:IE(o.offset,a("labelOffset"))},y=BA(s,g?nD(u,c,'"left"','"right"','"center"'):{value:"center"},((e,t,n)=>Mk(e)?HA(e.signal,t,n):"right"===e?{value:t}:{value:n})(s,"left","right")),v=BA(s,IA(s,"bottom","top"),g?nD(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=nD(u,c,"-(".concat(f,")"),f,0);g=g&&f;const _={opacity:TE,x:BA(s,b,m),y:LA(s,b,m)},O={enter:_,update:p={opacity:$E,text:{field:"label"},x:_.x,y:_.y,align:y,baseline:v},exit:{opacity:TE,x:_.x,y:_.y}};ak(O,{dx:!d&&g?BA(s,x):null,dy:!h&&g?LA(s,x):null}),ak(O,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const w=a("labelBound");let j=a("labelOverlap");return j=j||w?{separation:a("labelSeparation"),method:j,order:"datum.index",bound:w?{scale:u,orient:s,tolerance:w}:null}:void 0,p.align!==y&&(p.align=KA(p.align,y)),p.baseline!==v&&(p.baseline=KA(p.baseline,v)),UE({type:"text",role:"axis-label",style:"guide-label",key:CE,from:r,encode:O,overlap:j},n)}function iD(e,t,n,r){const i=RE(e,t),o=e.orient,a=PA(o,-1,1);let s,u;const l={enter:s={opacity:TE,anchor:ik(i("titleAnchor",null)),align:{signal:LE}},update:u=Object(Z.p)({},s,{opacity:$E,text:ik(e.title)}),exit:{opacity:TE}},c={signal:'lerp(range("'.concat(e.scale,'"), ').concat(BE(0,1,.5),")")};return u.x=BA(o,c),u.y=LA(o,c),s.angle=BA(o,TE,((e,t)=>0===t?0:Mk(e)?{signal:"(".concat(e.signal,") * ").concat(t)}:{value:e*t})(a,90)),s.baseline=BA(o,IA(o,"bottom","top"),{value:"bottom"}),u.angle=s.angle,u.baseline=s.baseline,ak(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(e,t,n,r){const i=(e,t)=>null!=e?(n.update[t]=KA(ik(e),n.update[t]),!1):!uk(t,r),o=i(e("titleX"),"x"),a=i(e("titleY"),"y");n.enter.auto=a===o?ik(a):BA(t,ik(a),ik(o))}(i,o,l,n),l.update.align=KA(l.update.align,s.align),l.update.angle=KA(l.update.angle,s.angle),l.update.baseline=KA(l.update.baseline,s.baseline),UE({type:"text",role:"axis-title",style:"guide-title",from:r,encode:l},n)}function oD(e,t){const n=function(e,t){var n,r,i,o,a,s,u,l,c=t.config,f=c.style,d=c.axis,h="band"===t.scaleType(e.scale)&&c.axisBand,p=e.orient;if(Mk(p)){const e=QA([c.axisX,c.axisY]),t=QA([c.axisTop,c.axisBottom,c.axisLeft,c.axisRight]);for(i of(n={},e))n[i]=BA(p,ZA(i,c.axisX,d,f),ZA(i,c.axisY,d,f));for(i of(r={},t))r[i]=(o=p.signal,a=ZA(i,c.axisTop,d,f),s=ZA(i,c.axisBottom,d,f),u=ZA(i,c.axisLeft,d,f),l=ZA(i,c.axisRight,d,f),{signal:(null!=u?"".concat(o," === '").concat("left","' ? (").concat(JA(u),") : "):"")+(null!=s?"".concat(o," === '").concat("bottom","' ? (").concat(JA(s),") : "):"")+(null!=l?"".concat(o," === '").concat("right","' ? (").concat(JA(l),") : "):"")+(null!=a?"".concat(o," === '").concat("top","' ? (").concat(JA(a),") : "):"")+"(null)"})}else n="top"===p||"bottom"===p?c.axisX:c.axisY,r=c["axis"+p[0].toUpperCase()+p.slice(1)];return n||r||h?Object(Z.p)({},d,n,r,h):d}(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,u=RE(e,n),l=function(e){const t=e("tickBand");let n,r,i=e("tickOffset");return t?t.signal?(n={signal:"(".concat(t.signal,") === 'extent' ? 1 : 0.5")},r={signal:"(".concat(t.signal,") === 'extent'")},Object(Z.G)(i)||(i={signal:"(".concat(t.signal,") === 'extent' ? 0 : ").concat(i)})):"extent"===t?(n=1,r=!0,i=0):(n=.5,r=!1):(n=e("bandPosition"),r=e("tickExtra")),{extra:r,band:n,offset:i}}(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:null!=e.title},f=jk(t.add(Yk({},[c]))),d=jk(t.add(qk({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(tD(e,n,r.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(function(e,t,n,r,i,o){const a=RE(e,t),s=e.orient,u=PA(s,-1,1);let l,c,f;const d={enter:l={opacity:TE},update:f={opacity:$E},exit:c={opacity:TE}};ak(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=ik(i);h.mult=u;const p={scale:e.scale,field:CE,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=BA(s,TE,p),f.y2=l.y2=BA(s,h),c.x=BA(s,p),f.x=l.x=LA(s,TE,p),f.x2=l.x2=LA(s,h),c.y=LA(s,p),UE({type:"rule",role:"axis-tick",key:CE,from:r,encode:d},n)}(e,n,r.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(rD(e,n,r.labels,d,p,l))),c.domain&&h.push(function(e,t,n,r){const i=RE(e,t),o=e.orient;let a,s;const u={enter:a={opacity:TE},update:s={opacity:$E},exit:{opacity:TE}};ak(u,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=eD(e,0),c=eD(e,1);return a.x=s.x=BA(o,l,TE),a.x2=s.x2=BA(o,c),a.y=s.y=LA(o,l,TE),a.y2=s.y2=LA(o,c),UE({type:"rule",role:"axis-domain",from:r,encode:u},n)}(e,n,r.domain,f)),c.title&&h.push(iD(e,n,r.title,f)),AA(NE({role:"axis",from:f,encode:sk(aD(u,e),i,zE),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:a,style:s}),t)}function aD(e,t){const n={enter:{},update:{}};return ak(n,{orient:e("orient"),offset:e("offset")||0,position:Ck(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:'abs(span(range("'.concat(t.scale,'")))')},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function sD(e,t,n){const r=Object(Z.i)(e.signals),i=Object(Z.i)(e.scales);return n||r.forEach(e=>xk(e,t)),Object(Z.i)(e.projections).forEach(e=>function(e,t){const n=t.config.projection||{},r={};for(const n in e)"name"!==n&&(r[n]=SE(e[n],n,t));for(const e in n)null==r[e]&&(r[e]=SE(n[e],e,t));t.addProjection(e.name,r)}(e,t)),i.forEach(e=>function(e,t){const n=e.type||"linear";Gs(n)||Object(Z.o)("Unrecognized scale type: "+Object(Z.ab)(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t)),Object(Z.i)(e.data).forEach(e=>TA(e,t)),i.forEach(e=>yE(e,t)),(n||r).forEach(e=>function(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?Object(Z.o)("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=Xw(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(e=>Bk(e,t,n.id))}(e,t)),Object(Z.i)(e.axes).forEach(e=>oD(e,t)),Object(Z.i)(e.marks).forEach(e=>AA(e,t)),Object(Z.i)(e.legends).forEach(e=>DA(e,t)),e.title&&FA(e.title,t),t.parseLambdas(),t}function uD(e,t){const n=t.config,r=jk(t.root=t.add(wk())),i=function(e,t){const n=n=>Ck(e[n],t[n]),r=[lD("background",n("background")),lD("autosize",tk(n("autosize"))),lD("padding",rk(n("padding"))),lD("width",n("width")||0),lD("height",n("height")||0)],i=r.reduce((e,t)=>(e[t.name]=t,e),{}),o={};return Object(Z.i)(e.signals).forEach(e=>{Object(Z.w)(i,e.name)?e=Object(Z.p)(i[e.name],e):r.push(e),o[e.name]=e}),Object(Z.i)(t.signals).forEach(e=>{Object(Z.w)(o,e.name)||Object(Z.w)(i,e.name)||r.push(e)}),r}(e,n);i.forEach(e=>xk(e,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(Yk()),a=t.add(Vk(gk((e=>sk({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e))(e.encode),"group","frame",e.style,t,{pulse:jk(o)}))),s=t.add(pE({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:jk(a)}));t.operators.pop(),t.pushState(jk(a),jk(s),null),sD(e,t,i),t.operators.push(s);let u=t.add(Wk({mark:r,pulse:jk(s)}));return u=t.add(cE({pulse:jk(u)})),u=t.add(dE({pulse:jk(u)})),t.addData("root",new OA(t,o,o,u)),t}function lD(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function cD(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function fD(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function dD(e){return(Object(Z.B)(e)?hD:pD)(e)}function hD(e){const t=e.length;let n="[";for(let r=0;r0?",":"")+(Object(Z.G)(t)?t.signal||dD(t):Object(Z.ab)(t))}return n+"]"}function pD(e){let t,n,r="{",i=0;for(t in e)n=e[t],r+=(++i>1?",":"")+Object(Z.ab)(t)+":"+(Object(Z.G)(n)?n.signal||dD(n):Object(Z.ab)(n));return r+"}"}function gD(e,t,n){return Object(Z.G)(e)||Object(Z.o)("Input Vega specification must be an object."),uD(e,new cD(t=Object(Z.O)({description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:"#4c78a8"},area:{fill:"#4c78a8"},image:null,line:{stroke:"#4c78a8",strokeWidth:2},path:{stroke:"#4c78a8"},rect:{fill:"#4c78a8"},rule:{stroke:"#000"},shape:{stroke:"#4c78a8"},symbol:{fill:"#4c78a8",size:64},text:{fill:"#000",font:"sans-serif",fontSize:11},trail:{fill:"#4c78a8",size:2},style:{"guide-label":{fill:"#000",font:"sans-serif",fontSize:10},"guide-title":{fill:"#000",font:"sans-serif",fontSize:11,fontWeight:"bold"},"group-title":{fill:"#000",font:"sans-serif",fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:"#000",font:"sans-serif",fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:"#ddd"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:"#888",grid:!1,gridWidth:1,gridColor:"#ddd",labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:"#888",tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:"#ddd",gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:"#888",titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}},t,e.config),n)).toRuntime()}cD.prototype=fD.prototype={parse(e){return sD(e,this)},fork(){return new fD(this)},isSubscope(){return this._subid>0},toRuntime(){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(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof _k?jk(e):e;return this.add(uE({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let 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){let r,i;e&&(r=e.data||(e.data={}),i=r[t]||(r[t]=[]),i.push(n))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(jk(this.add(dE({pulse:e})))),this._parent.push(t),this._lookup.push(n?jk(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Object(Z.V)(this._parent)},encode(){return Object(Z.V)(this._encode)},lookup(){return Object(Z.V)(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Object(Z.I)(e))return kk(e,t);e.signal||Object(Z.o)("Unsupported field reference: "+Object(Z.ab)(e));const n=e.signal;let r=this.field[n];if(!r){const e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=r=jk(this.add(Kk(e)))}return r},compareRef(e){let t=!1;const n=e=>Mk(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,r=Object(Z.i)(e.field).map(n),i=Object(Z.i)(e.order).map(n);return t?jk(this.add(Hk({fields:r,orders:i}))):Ak(r,i)},keyRef(e,t){let n=!1;const r=this.signals;return e=Object(Z.i)(e).map(e=>Mk(e)?(n=!0,jk(r[e.signal])):e),n?jk(this.add(Zk({fields:e,flat:t}))):function(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;const t=Dk(e.op,e.field),n=e.order||"ascending";return n.signal?jk(this.add(Hk({fields:t,orders:this.signalRef(n.signal)}))):Ak(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return Object(Z.w)(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&Object(Z.o)("Duplicate signal name: "+Object(Z.ab)(e));const n=t instanceof _k?t:this.add(wk(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||Object(Z.o)("Unrecognized signal name: "+Object(Z.ab)(e)),this.signals[e]},signalRef(e){return this.signals[e]?jk(this.signals[e]):(Object(Z.w)(this.lambdas,e)||(this.lambdas[e]=this.add(wk(null))),jk(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;tMD(e,t))}:ED(e)?{or:e.or.map(e=>MD(e,t))}:t(e)}const SD=OD.a,CD=xD.a;function FD(e,t){const n={};for(const r of t)Object(Z.w)(e,r)&&(n[r]=e[r]);return n}function zD(e,t){const n=Object.assign({},e);for(const e of t)delete n[e];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>jD()(e)).join(",")})`};const TD=jD.a;function $D(e){if(Object(Z.F)(e))return e;const t=Object(Z.I)(e)?e:jD()(e);if(t.length<250)return t;let n=0;for(let e=0;e-1}function PD(e,t){let n=0;for(const[r,i]of e.entries())if(t(i,r,n++))return!0;return!1}function BD(e,t){let n=0;for(const[r,i]of e.entries())if(!t(i,r,n++))return!1;return!0}function LD(e,...t){for(const n of t)ID(e,null!=n?n:{});return e}function ID(e,t){for(const n of XD(t))Object(Z.kb)(e,n,t[n],!0)}function UD(e,t){const n=[],r={};let i;for(const o of e)i=t(o),i in r||(r[i]=1,n.push(o));return n}function qD(e,t){const n=XD(e),r=XD(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function WD(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function YD(e,t){for(const n of e)if(t.has(n))return!0;return!1}function HD(e){const t=new Set;for(const n of e){const e=Object(Z.Z)(n).map((e,t)=>0===t?e:`[${e}]`),r=e.map((t,n)=>e.slice(0,n+1).join(""));for(const e of r)t.add(e)}return t}function GD(e,t){return void 0===e||void 0===t||YD(HD(e),HD(t))}function VD(e){return 0===XD(e).length}const XD=Object.keys,JD=Object.values,KD=Object.entries;function ZD(e){return!0===e||!1===e}function QD(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function eM(e,t){return DD(e)?"!("+eM(e.not,t)+")":AD(e)?"("+e.and.map(e=>eM(e,t)).join(") && (")+")":ED(e)?"("+e.or.map(e=>eM(e,t)).join(") || (")+")":t(e)}function tM(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&tM(e[n],t)&&delete e[n],VD(e)}function nM(e){return e.charAt(0).toUpperCase()+e.substr(1)}function rM(e,t="datum"){const n=Object(Z.Z)(e),r=[];for(let e=1;e<=n.length;e++){const i=`[${n.slice(0,e).map(Z.ab).join("][")}]`;r.push(`${t}${i}`)}return r.join(" && ")}function iM(e,t="datum"){return`${t}[${Object(Z.ab)(Object(Z.Z)(e).join("."))}]`}function oM(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function aM(e){return""+Object(Z.Z)(e).map(oM).join("\\.")}function sM(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function uM(e){return""+Object(Z.Z)(e).join(".")}function lM(e){return e?Object(Z.Z)(e).length:0}function cM(...e){for(const t of e)if(void 0!==t)return t}let fM=42;function dM(e){const t=++fM;return e?String(e)+t:t}function hM(){fM=42}function pM(e){return gM(e)?e:"__"+e}function gM(e){return 0===e.indexOf("__")}function mM(e){if(void 0!==e)return(e%360+360)%360}function bM(e){return!!Object(Z.F)(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const yM={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function vM(e){return e&&e.condition}const xM=["domain","grid","labels","ticks","title"],_M={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},OM={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},wM=Object.assign(Object.assign({},OM),{style:1,labelExpr:1,encoding:1});function jM(e){return!!wM[e]}const kM=XD({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1}),EM={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},AM={count:1,min:1,max:1};function DM(e){return!!e&&!!e.argmin}function MM(e){return!!e&&!!e.argmax}function SM(e){return Object(Z.I)(e)&&!!EM[e]}const CM=["count","valid","missing","distinct"];function FM(e){return Object(Z.I)(e)&&RD(CM,e)}const zM=["count","sum","distinct","valid","missing"],TM=Object(Z.eb)(["mean","average","median","q1","q3","min","max"]),$M="row",NM="column",RM="radius",PM="theta",BM="theta2",LM="color",IM="fill",UM="stroke",qM="shape",WM={theta:1,theta2:1,radius:1,radius2:1};function YM(e){return e in WM}const HM={longitude:1,longitude2:1,latitude:1,latitude2:1};const GM=XD(HM),VM=Object.assign(Object.assign(Object.assign(Object.assign({},{x:1,y:1,x2:1,y2:1}),WM),HM),{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1});function XM(e){return e===LM||e===IM||e===UM}const JM={row:1,column:1,facet:1},KM=XD(JM),ZM=Object.assign(Object.assign({},VM),JM),QM=XD(ZM),eS=bD(ZM,["order","detail","tooltip"]),tS=bD(eS,["row","column","facet"]);function nS(e){return!!ZM[e]}const rS=["x2","y2","latitude2","longitude2",BM,"radius2"];function iS(e){return oS(e)!==e}function oS(e){switch(e){case"x2":return"x";case"y2":return"y";case"latitude2":return"latitude";case"longitude2":return"longitude";case BM:return PM;case"radius2":return RM}return e}function aS(e){if(YM(e))switch(e){case PM:return"startAngle";case BM:return"endAngle";case RM:return"outerRadius";case"radius2":return"innerRadius"}return e}function sS(e){switch(e){case"x":return"x2";case"y":return"y2";case"latitude":return"latitude2";case"longitude":return"longitude2";case PM:return BM;case RM:return"radius2"}}function uS(e){switch(e){case"x":case"x2":return"width";case"y":case"y2":return"height"}}const lS=bD(VM,["x","y","x2","y2","latitude","longitude","latitude2","longitude2","theta","theta2","radius","radius2"]),cS=XD(lS),fS={x:1,y:1},dS=XD(fS);function hS(e){return e in fS}const pS={theta:1,radius:1},gS=XD(pS);function mS(e){return"width"===e?"x":"y"}const bS=bD(lS,["text","tooltip","href","url","description","detail","key","order"]),yS=XD(bS);const vS=Object.assign(Object.assign(Object.assign({},fS),pS),bS),xS=XD(vS);function _S(e){return!!vS[e]}function OS(e,t){return function(e){switch(e){case LM:case IM:case UM:case"description":case"detail":case"key":case"tooltip":case"href":case"order":case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"facet":case $M:case NM:return wS;case"x":case"y":case"latitude":case"longitude":return jS;case"x2":case"y2":case"latitude2":case"longitude2":return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case"size":return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case"strokeDash":return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case qM:return{point:"always",geoshape:"always"};case"text":return{text:"always"};case"angle":return{point:"always",square:"always",text:"always"};case"url":return{image:"always"};case PM:case RM:return{text:"always",arc:"always"};case BM:case"radius2":return{arc:"always"}}}(e)[t]}const wS={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},jS=bD(wS,["geoshape"]);function kS(e){switch(e){case"x":case"y":case PM:case RM:case"size":case"angle":case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case"x2":case"y2":case BM:case"radius2":return;case"facet":case $M:case NM:case qM:case"strokeDash":case"text":case"tooltip":case"href":case"url":case"description":return"discrete";case LM:case IM:case UM:return"flexible";case"latitude":case"longitude":case"latitude2":case"longitude2":case"detail":case"key":case"order":return}}function ES(e){return Object(Z.C)(e)&&(e=aT(e,void 0)),"bin"+XD(e).map(t=>SS(e[t])?QD(`_${t}_${KD(e[t])}`):QD(`_${t}_${e[t]}`)).join("")}function AS(e){return!0===e||MS(e)&&!e.binned}function DS(e){return"binned"===e||MS(e)&&!0===e.binned}function MS(e){return Object(Z.G)(e)}function SS(e){return null==e?void 0:e.selection}function CS(e){switch(e){case $M:case NM:case"size":case LM:case IM:case UM:case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case qM:return 6;case"strokeDash":return 4;default:return 10}}function FS(e){return`Invalid specification ${JSON.stringify(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}function zS(e){return("width"==e?"Width":"Height")+' "container" only works for single views and layered views.'}function TS(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function $S(e){return e?`Dropping "fit-${e}" because spec has discrete ${uS(e)}.`:'Dropping "fit" because spec has discrete size.'}function NS(e){return`Unknown field for ${e}. Cannot calculate view size.`}function RS(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function PS(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function BS(e){return`Selection not supported for ${e} yet.`}function LS(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function IS(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function US(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function qS(e){return`Invalid field type "${e}".`}function WS(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function YS(e,t){return`Dropping ${TD(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function HS(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?" when "+n:""}.`}function GS(e){return e+" encoding should be discrete (ordinal / nominal / binned)."}function VS(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function XS(e){return`Using unaggregated domain with raw field has no effect (${TD(e)}).`}function JS(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function KS(e){return`Unaggregated domain is currently unsupported for log scale (${TD(e)}).`}function ZS(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function QS(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}const eC="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function tC(e,t){return`Invalid ${e}: ${TD(t)}.`}function nC(e){return`1D error band does not support ${e}.`}function rC(e){return`Channel ${e} is required for "binned" bin.`}const iC=Object(Z.L)(Z.e);let oC=iC;function aC(...e){oC.warn(...e)}function sC(e){if(e&&Object(Z.G)(e))for(const t of gC)if(t in e)return!0;return!1}const uC=["january","february","march","april","may","june","july","august","september","october","november","december"],lC=uC.map(e=>e.substr(0,3)),cC=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],fC=cC.map(e=>e.substr(0,3));function dC(e,t){const n=[];if(t&&void 0!==e.day&&XD(e).length>1&&(aC(function(e){return`Dropping day from datetime ${TD(e)} as day cannot be combined with other units.`}(e)),delete(e=CD(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const r=t?function(e){if(bM(e)&&(e=+e),Object(Z.F)(e))return e-1;{const t=e.toLowerCase(),n=uC.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=lC.indexOf(r);if(-1!==i)return i;throw new Error(tC("month",e))}}(e.month):e.month;n.push(r)}else if(void 0!==e.quarter){const r=t?function(e){if(bM(e)&&(e=+e),Object(Z.F)(e))return e>4&&aC(tC("quarter",e)),e-1;throw new Error(tC("quarter",e))}(e.quarter):e.quarter;n.push(Object(Z.F)(r)?3*r:r+"*3")}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const r=t?function(e){if(bM(e)&&(e=+e),Object(Z.F)(e))return e%7;{const t=e.toLowerCase(),n=cC.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=fC.indexOf(r);if(-1!==i)return i;throw new Error(tC("day",e))}}(e.day):e.day;n.push(Object(Z.F)(r)?r+1:r+"+1")}else n.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const r=e[t];n.push(void 0===r?0:r)}return n}function hC(e){const t=dC(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}const pC={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},gC=XD(pC);function mC(e){return e.startsWith("utc")}const bC={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function yC(e){const t=[];for(const n of gC)vC(e,n)&&t.push(n);return t}function vC(e,t){const n=e.indexOf(t);return!(n<0)&&(!(n>0&&"seconds"===t&&"i"===e.charAt(n-1))&&(!(e.length>n+3&&"day"===t&&"o"===e.charAt(n+3))&&!(n>0&&"year"===t&&"f"===e.charAt(n-1))))}function xC(e,t,{end:n}={end:!1}){const r=rM(t),i=mC(e)?"utc":"";let o;const a={};for(const t of gC)vC(e,t)&&(a[t]="quarter"===(s=t)?`(${i}quarter(${r})-1)`:`${i}${s}(${r})`,o=t);var s;return n&&(a[o]+="+1"),function(e){const t=dC(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}function _C(e){if(!e)return;const t=yC(e);return`timeUnitSpecifier(${jD()(t)}, ${jD()(bC)})`}function OC(e){if(!e)return;let t;return Object(Z.I)(e)?t={unit:e}:Object(Z.G)(e)&&(t=Object.assign(Object.assign({},e),e.unit?{unit:e.unit}:{})),mC(t.unit)&&(t.utc=!0,t.unit=t.unit.substr(3)),t}function wC(e){return e&&!!e.signal}function jC(e){return!!e.step}function kC(e){return!Object(Z.B)(e)&&("field"in e&&"data"in e)}const EC=XD({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),AC={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},DC=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function MC(e){return e&&!!e.field&&void 0!==e.equal}function SC(e){return e&&!!e.field&&void 0!==e.lt}function CC(e){return e&&!!e.field&&void 0!==e.lte}function FC(e){return e&&!!e.field&&void 0!==e.gt}function zC(e){return e&&!!e.field&&void 0!==e.gte}function TC(e){if(e&&e.field){if(Object(Z.B)(e.range)&&2===e.range.length)return!0;if(wC(e.range))return!0}return!1}function $C(e){return e&&!!e.field&&(Object(Z.B)(e.oneOf)||Object(Z.B)(e.in))}function NC(e){return $C(e)||MC(e)||TC(e)||SC(e)||FC(e)||CC(e)||zC(e)}function RC(e,t){return lT(e,{timeUnit:t,wrapTime:!0})}function PC(e,t=!0){var n;const{field:r}=e,i=null===(n=OC(e.timeUnit))||void 0===n?void 0:n.unit,o=i?"time("+xC(i,r)+")":Yz(e,{expr:"datum"});if(MC(e))return o+"==="+RC(e.equal,i);if(SC(e)){return`${o}<${RC(e.lt,i)}`}if(FC(e)){return`${o}>${RC(e.gt,i)}`}if(CC(e)){return`${o}<=${RC(e.lte,i)}`}if(zC(e)){return`${o}>=${RC(e.gte,i)}`}if($C(e))return`indexof([${function(e,t){return e.map(e=>RC(e,t))}(e.oneOf,i).join(",")}], ${o}) !== -1`;if(function(e){return e&&!!e.field&&void 0!==e.valid}(e))return BC(o,e.valid);if(TC(e)){const{range:n}=e,r=wC(n)?{signal:n.signal+"[0]"}:n[0],a=wC(n)?{signal:n.signal+"[1]"}:n[1];if(null!==r&&null!==a&&t)return"inrange("+o+", ["+RC(r,i)+", "+RC(a,i)+"])";const s=[];return null!==r&&s.push(`${o} >= ${RC(r,i)}`),null!==a&&s.push(`${o} <= ${RC(a,i)}`),s.length>0?s.join(" && "):"true"}throw new Error("Invalid field predicate: "+JSON.stringify(e))}function BC(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function LC(e){var t;return NC(e)&&e.timeUnit?Object.assign(Object.assign({},e),{timeUnit:null===(t=OC(e.timeUnit))||void 0===t?void 0:t.unit}):e}const IC="quantitative",UC="ordinal",qC="temporal",WC="nominal",YC="geojson";const HC="linear",GC="log",VC="pow",XC="sqrt",JC="symlog",KC="time",ZC="utc",QC="quantile",eF="quantize",tF="threshold",nF="point",rF="band",iF={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function oF(e,t){const n=iF[e],r=iF[t];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}const aF={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function sF(e){return aF[e]}const uF=["linear","log","pow","sqrt","symlog","time","utc"],lF=Object(Z.eb)(uF),cF=Object(Z.eb)(["linear","log","pow","sqrt","symlog"]);const fF=Object(Z.eb)(["quantile","quantize","threshold"]),dF=uF.concat(["quantile","quantize","threshold","sequential","identity"]),hF=Object(Z.eb)(dF),pF=Object(Z.eb)(["ordinal","bin-ordinal","point","band"]);function gF(e){return e in pF}function mF(e){return e in hF}function bF(e){return e in lF}function yF(e){return e in fF}function vF(e){return null==e?void 0:e.selection}const xF=bD({type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},["type","domain","range","rangeMax","rangeMin","scheme"]),_F=XD(xF);function OF(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!RD(["point","band","identity"],e);case"bins":return!RD(["point","band","identity","ordinal"],e);case"round":return bF(e)||"band"===e||"point"===e;case"padding":case"rangeMin":case"rangeMax":return bF(e)||RD(["point","band"],e);case"paddingOuter":case"align":return RD(["point","band"],e);case"paddingInner":return"band"===e;case"domainMax":case"domainMid":case"domainMin":case"clamp":return bF(e);case"nice":return bF(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return mF(e)&&!RD(["log","time","utc","threshold","quantile"],e)}}function wF(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return XM(e)?void 0:`Cannot use the scale property "${e}" with non-color channel.`;case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function jF(e){return e&&!!e.expr}function kF(e){const t=XD(e||{}),n={};for(const r of t)n[r]=gT(e[r]);return n}const EF={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},AF=EF.arc,DF=EF.area,MF=EF.bar,SF=EF.image,CF=EF.line,FF=EF.point,zF=EF.rect,TF=EF.rule,$F=EF.text,NF=EF.tick,RF=EF.trail,PF=EF.circle,BF=EF.square,LF=EF.geoshape;function IF(e){return RD(["line","area","trail"],e)}function UF(e){return RD(["rect","bar","image","arc"],e)}const qF=XD(EF);function WF(e){return e.type}Object(Z.eb)(qF);const YF=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],HF=XD({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBand:1,timeUnitBandPosition:1}),GF=XD({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1}),VF={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},XF={binSpacing:1,continuousBandSize:5,timeUnitBandPosition:.5},JF={binSpacing:0,continuousBandSize:5,timeUnitBandPosition:.5};function KF(e){const{channel:t,channelDef:n,markDef:r,scale:i,config:o}=e,a=rz(e);return Fz(n)&&!FM(n.aggregate)&&i&&bF(i.get("type"))&&!1===i.get("zero")?ZF({fieldDef:n,channel:t,markDef:r,ref:a,config:o}):a}function ZF({fieldDef:e,channel:t,markDef:n,ref:r,config:i}){if(IF(n.type))return r;return null===_T("invalid",n,i)?r:[QF(e,t),r]}function QF(e,t){const n=ez(e,!0),r="y"===oS(t)?{field:{group:"height"}}:{value:0};return Object.assign({test:n},r)}function ez(e,t=!0){return BC(Object(Z.I)(e)?e:Yz(e,{expr:"datum"}),!t)}function tz(e,t,n,r){const i={};if(t&&(i.scale=t),Tz(e)){const{datum:t}=e;sC(t)?i.signal=hC(t):wC(t)?i.signal=t.signal:jF(t)?i.signal=t.expr:i.value=t}else i.field=Yz(e,n);if(r){const{offset:e,band:t}=r;e&&(i.offset=e),t&&(i.band=t)}return i}function nz({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:r,startSuffix:i,band:o=.5}){const a=0QD(`${"unit"===e?"":`_${e}_`}${r[e]}`)).join(""):(n?"utc":"")+"timeunit"+XD(r).map(e=>QD(`_${e}_${r[e]}`)).join("")}(f),s=(!RD(["range","mid"],t.binSuffix)&&t.binSuffix||"")+(null!==(i=t.suffix)&&void 0!==i?i:""))}a&&(o=o?`${a}_${o}`:a)}return s&&(o=`${o}_${s}`),a&&(o=`${a}_${o}`),t.forAs?uM(o):t.expr?iM(o,t.expr)+u:aM(o)+u}function Hz(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return Fz(e)&&!!e.bin;case"temporal":return!1}throw new Error(qS(e.type))}function Gz(e){return!Hz(e)}const Vz=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:r,field:i}=e;if(MM(t))return`${i} for argmax(${t.argmax})`;if(DM(t))return`${i} for argmin(${t.argmin})`;const o=OC(r),a=t||(null==o?void 0:o.unit)||(null==o?void 0:o.maxbins)&&"timeunit"||AS(n)&&"bin";return a?a.toUpperCase()+"("+i+")":i}(e);default:return function(e,t){var n;const{field:r,bin:i,timeUnit:o,aggregate:a}=e;if("count"===a)return t.countTitle;if(AS(i))return r+" (binned)";if(o){const e=null===(n=OC(o))||void 0===n?void 0:n.unit;if(e)return`${r} (${yC(e).join("-")})`}else if(a)return MM(a)?`${r} for max ${a.argmax}`:DM(a)?`${r} for min ${a.argmin}`:`${nM(a)} of ${r}`;return r}(e,t)}};let Xz=Vz;function Jz(e){Xz=e}function Kz(e,t,{allowDisabling:n,includeDefault:r=!0}){var i,o;const a=null===(i=Zz(e))||void 0===i?void 0:i.title;if(!Fz(e))return a;const s=e,u=r?Qz(s,t):void 0;return n?cM(a,s.title,u):null!==(o=null!=a?a:s.title)&&void 0!==o?o:u}function Zz(e){return Iz(e)&&e.axis?e.axis:Uz(e)&&e.legend?e.legend:wz(e)&&e.header?e.header:void 0}function Qz(e,t){return Xz(e,t)}function eT(e){var t;if(qz(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const n=null!==(t=Zz(e))&&void 0!==t?t:{},{format:r,formatType:i}=n;return{format:r,formatType:i}}}function tT(e){return Fz(e)?e:Sz(e)?e.condition:void 0}function nT(e){return Rz(e)?e:Cz(e)?e.condition:void 0}function rT(e,t,n,r={}){if(Object(Z.I)(e)||Object(Z.F)(e)||Object(Z.C)(e)){return aC(function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${TD(n)}}.`}(t,Object(Z.I)(e)?"string":Object(Z.F)(e)?"number":"boolean",e)),{value:e}}return Rz(e)?iT(e,t,n,r):Cz(e)?Object.assign(Object.assign({},e),{condition:iT(e.condition,t,n,r)}):e}function iT(e,t,n,r){if(qz(e)){const{format:i,formatType:o}=e,a=bD(e,["format","formatType"]);if(oz(o)&&!n.customFormatTypes)return aC(US(t)),iT(a,t,n,r)}else{const i=Iz(e)?"axis":Uz(e)?"legend":wz(e)?"header":null;if(i&&e[i]){const o=e[i],{format:a,formatType:s}=o,u=bD(o,["format","formatType"]);if(oz(s)&&!n.customFormatTypes)return aC(US(t)),iT(Object.assign(Object.assign({},e),{[i]:u}),t,n,r)}}return Fz(e)?oT(e,t,r):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Object(Z.F)(n)?"quantitative":Object(Z.I)(n)?"nominal":sC(n)?"temporal":void 0,Object.assign(Object.assign({},e),{type:t})}(e)}function oT(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:a}=e,s=Object.assign({},e);if(n||!r||SM(r)||MM(r)||DM(r)||(aC(function(e){return`Invalid aggregation operator "${e}".`}(r)),delete s.aggregate),i&&(s.timeUnit=OC(i)),a&&(s.field=""+a),AS(o)&&(s.bin=aT(o,t)),DS(o)&&!hS(t)&&aC(function(e){return`Channel ${e} should not be used with "binned" bin.`}(t)),Pz(s)){const{type:e}=s,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case IC:return"quantitative";case"t":case qC:return"temporal";case"o":case UC:return"ordinal";case"n":case WC:return"nominal";case YC:return"geojson"}}(e);e!==t&&(s.type=t),"quantitative"!==e&&FM(r)&&(aC(function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}(e,r)),s.type="quantitative")}else if(!iS(t)){const e=function(e,t){var n;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Ez(e)&&Object(Z.B)(e.sort))return"ordinal";const{aggregate:r,bin:i,timeUnit:o}=e;if(o)return"temporal";if(i||r&&!MM(r)&&!DM(r))return"quantitative";if(Lz(e)&&(null===(n=e.scale)||void 0===n?void 0:n.type))switch(iF[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t);s.type=e}if(Pz(s)){const{compatible:e,warning:n}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case $M:case NM:case"facet":return Gz(e)?{compatible:!1,warning:GS(t)}:sT;case"x":case"y":case LM:case IM:case UM:case"text":case"detail":case"key":case"tooltip":case"href":case"url":case"angle":case PM:case RM:case"description":return sT;case"longitude":case"longitude2":case"latitude":case"latitude2":return n!==IC?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:sT;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case BM:case"radius2":case"x2":case"y2":return"nominal"!==n||e.sort?sT:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case"strokeDash":return RD(["ordinal","nominal"],e.type)?sT:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case qM:return RD(["ordinal","nominal","geojson"],e.type)?sT:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return"nominal"!==e.type||"sort"in e?sT:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,t)||{};!1===e&&aC(n)}if(Ez(s)&&Object(Z.I)(s.sort)){const{sort:e}=s;if(yz(e))return Object.assign(Object.assign({},s),{sort:{encoding:e}});const t=e.substr(1);if("-"===e.charAt(0)&&yz(t))return Object.assign(Object.assign({},s),{sort:{encoding:t,order:"descending"}})}if(wz(s)){const{header:e}=s,{orient:t}=e,n=bD(e,["orient"]);if(t)return Object.assign(Object.assign({},s),{header:Object.assign(Object.assign({},n),{labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t})})}return s}function aT(e,t){return Object(Z.C)(e)?{maxbins:CS(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign(Object.assign({},e),{maxbins:CS(t)})}const sT={compatible:!0};function uT(e){const{formatType:t}=eT(e);return"time"===t||!t&&((n=e)&&("temporal"===n.type||Fz(n)&&!!n.timeUnit));var n}function lT(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var o;const a=t&&(null===(o=OC(t))||void 0===o?void 0:o.unit);let s,u=a||"temporal"===n;return jF(e)?s=e.expr:wC(e)?s=e.signal:sC(e)?(u=!0,s=hC(e)):(Object(Z.I)(e)||Object(Z.F)(e))&&u&&(s=`datetime(${JSON.stringify(e)})`,function(e){return!!pC[e]}(a)&&(Object(Z.F)(e)&&e<1e4||Object(Z.I)(e)&&isNaN(Date.parse(e)))&&(s=hC({[a]:e}))),s?r&&u?`time(${s})`:s:i?void 0:JSON.stringify(e)}function cT(e,t){const{type:n}=e;return t.map(t=>{const r=lT(t,{timeUnit:Fz(e)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:t})}function fT(e,t){return AS(e.bin)?_S(t)&&RD(["ordinal","nominal"],e.type):(console.warn("Only call this method for binned field defs."),!1)}function dT(e){const{anchor:t,frame:n,offset:r,orient:i,color:o,subtitleColor:a,subtitleFont:s,subtitleFontSize:u,subtitleFontStyle:l,subtitleFontWeight:c,subtitleLineHeight:f,subtitlePadding:d}=e,h=bD(e,["anchor","frame","offset","orient","color","subtitleColor","subtitleFont","subtitleFontSize","subtitleFontStyle","subtitleFontWeight","subtitleLineHeight","subtitlePadding"]),p=Object.assign(Object.assign({},h),o?{fill:o}:{}),g=Object.assign(Object.assign(Object.assign(Object.assign({},t?{anchor:t}:{}),n?{frame:n}:{}),r?{offset:r}:{}),i?{orient:i}:{}),m=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a?{subtitleColor:a}:{}),s?{subtitleFont:s}:{}),u?{subtitleFontSize:u}:{}),l?{subtitleFontStyle:l}:{}),c?{subtitleFontWeight:c}:{}),f?{subtitleLineHeight:f}:{}),d?{subtitlePadding:d}:{});return{titleMarkConfig:p,subtitleMarkConfig:FD(p,["align","baseline","dx","dy","limit"]),nonMark:g,subtitle:m}}function hT(e){return Object(Z.I)(e)||Object(Z.B)(e)&&Object(Z.I)(e[0])}function pT(e){const t=Object(Z.B)(e.condition)?e.condition.map(mT):mT(e.condition);return Object.assign(Object.assign({},gT(e)),{condition:t})}function gT(e){if(jF(e)){const{expr:t}=e,n=bD(e,["expr"]);return Object.assign({signal:t},n)}return e}function mT(e){if(jF(e)){const{expr:t}=e,n=bD(e,["expr"]);return Object.assign({signal:t},n)}return e}function bT(e){if(jF(e)){const{expr:t}=e,n=bD(e,["expr"]);return Object.assign({signal:t},n)}return wC(e)?e:void 0!==e?{value:e}:void 0}function yT(e){return wC(e)?e.signal:Object(Z.ab)(e.value)}function vT(e){return wC(e)?e.signal:null==e?null:Object(Z.ab)(e)}function xT(e){var t;return[].concat(e.type,null!==(t=e.style)&&void 0!==t?t:[])}function _T(e,t,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&void 0!==t[i]?t[i]:void 0!==t[e]?t[e]:!o||i&&i!==e?OT(e,t,n,r):void 0}function OT(e,t,n,{vgChannel:r}={}){return cM(r?wT(e,t,n.style):void 0,wT(e,t,n.style),r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function wT(e,t,n){return jT(e,xT(t),n)}function jT(e,t,n){let r;t=Object(Z.i)(t);for(const i of t){const t=n[i];t&&void 0!==t[e]&&(r=t[e])}return r}function kT(e,t){return Object(Z.i)(e).reduce((e,n)=>{var r;return e.field.push(Yz(n,t)),e.order.push(null!==(r=n.sort)&&void 0!==r?r:"ascending"),e},{field:[],order:[]})}function ET(e,t){const n=[...e];return t.forEach(e=>{for(const t of n)if(SD(t,e))return;n.push(e)}),n}function AT(e,t){return SD(e,t)||!t?e:e?[...Object(Z.i)(e),...Object(Z.i)(t)].join(", "):t}function DT(e,t){const n=e.value,r=t.value;if(null==n||null===r)return{explicit:e.explicit,value:null};if((hT(n)||wC(n))&&(hT(r)||wC(r)))return{explicit:e.explicit,value:AT(n,r)};if(hT(n)||wC(n))return{explicit:e.explicit,value:n};if(hT(r)||wC(r))return{explicit:e.explicit,value:r};if(!(hT(n)||wC(n)||hT(r)||wC(r)))return{explicit:e.explicit,value:ET(n,r)};throw new Error("It should never reach here")}function MT(e){return"mark"in e}class ST{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!MT(e)&&(WF(t=e.mark)?t.type:t)===this.name;var t}}function CT(e,t){const n=e&&e[t];return!!n&&(Object(Z.B)(n)?PD(n,e=>!!e.field):Fz(n)||Sz(n))}function FT(e){return PD(QM,t=>{if(CT(e,t)){const n=e[t];if(Object(Z.B)(n))return PD(n,e=>!!e.aggregate);{const e=tT(n);return e&&!!e.aggregate}}return!1})}function zT(e,t){const n=[],r=[],i=[],o=[],a={};return NT(e,(s,u)=>{if(Fz(s)){const{field:l,aggregate:c,bin:f,timeUnit:d}=s,h=bD(s,["field","aggregate","bin","timeUnit"]);if(c||d||f){const e=Zz(s),p=e&&e.title;let g=Yz(s,{forAs:!0});const m=Object.assign(Object.assign(Object.assign({},p?[]:{title:Kz(s,t,{allowDisabling:!0})}),h),{field:g});if(c){let e;if(MM(c)?(e="argmax",g=Yz({op:"argmax",field:c.argmax},{forAs:!0}),m.field=`${g}.${l}`):DM(c)?(e="argmin",g=Yz({op:"argmin",field:c.argmin},{forAs:!0}),m.field=`${g}.${l}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(e=c),e){const t={op:e,as:g};l&&(t.field=l),o.push(t)}}else if(n.push(g),Pz(s)&&AS(f)){if(r.push({bin:f,field:l,as:g}),n.push(Yz(s,{binSuffix:"end"})),fT(s,u)&&n.push(Yz(s,{binSuffix:"range"})),hS(u)){const e={field:g+"_end"};a[u+"2"]=e}m.bin="binned",iS(u)||(m.type=IC)}else if(d){i.push({timeUnit:d,field:l,as:g});const e=Pz(s)&&s.type!==qC&&"time";e&&("text"===u||"tooltip"===u?m.formatType=e:!function(e){return!!lS[e]}(u)?hS(u)&&(m.axis=Object.assign({formatType:e},m.axis)):m.legend=Object.assign({formatType:e},m.legend))}a[u]=m}else n.push(l),a[u]=e[u]}else a[u]=e[u]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function TT(e,t,n,r){return XD(e).reduce((i,o)=>{if(!nS(o))return aC(function(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}(o)),i;const a=e[o];if("angle"!==o||"arc"!==t||e.theta||(aC("Arc marks uses theta channel rather than angle, replacing angle with theta."),o=PM),!function(e,t,n){const r=OS(t,n);if(!r)return!1;if("binned"===r){const n=e["x2"===t?"x":"y"];return!!(Fz(n)&&Fz(e[t])&&DS(n.bin))}return!0}(e,o,t))return aC(HS(o,t)),i;if("size"===o&&"line"===t){const t=tT(e[o]);if(null==t?void 0:t.aggregate)return aC("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead."),i}if(o===LM&&(n?"fill"in e:"stroke"in e))return aC(WS("encoding",{fill:"fill"in e,stroke:"stroke"in e})),i;if("detail"===o||"order"===o&&!Object(Z.B)(a)&&!Bz(a)||"tooltip"===o&&Object(Z.B)(a))a&&(i[o]=Object(Z.i)(a).reduce((e,t)=>(Fz(t)?e.push(oT(t,o)):aC(YS(t,o)),e),[]));else{if("tooltip"===o&&null===a)i[o]=null;else if(!(Fz(a)||Tz(a)||Bz(a)||Mz(a)||wC(a)))return aC(YS(a,o)),i;i[o]=rT(a,o,r)}return i},{})}function $T(e,t){const n={};for(const r of XD(e)){const i=rT(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function NT(e,t,n){if(e)for(const r of XD(e)){const i=e[r];if(Object(Z.B)(i))for(const e of i)t.call(n,e,r);else t.call(n,i,r)}}function RT(e,t){return XD(t).reduce((n,r)=>{switch(r){case"x":case"y":case"href":case"description":case"url":case"x2":case"y2":case PM:case BM:case RM:case"radius2":case"latitude":case"longitude":case"latitude2":case"longitude2":case"text":case qM:case"angle":case"tooltip":return n;case"order":if("line"===e||"trail"===e)return n;case"detail":case"key":{const e=t[r];if(Object(Z.B)(e)||Fz(e))for(const t of Object(Z.i)(e))t.aggregate||n.push(Yz(t,{}));return n}case"size":if("trail"===e)return n;case LM:case IM:case UM:case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeDash":case"strokeWidth":{const e=tT(t[r]);return e&&!e.aggregate&&n.push(Yz(e,{})),n}}},[])}function PT(e,t,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...e.map(({fieldPrefix:e,titlePrefix:n})=>{const i=r?" of "+BT(t):"";return{field:e+t.field,type:t.type,title:wC(n)?{signal:n+`"${escape(i)}"`}:n+i}}),...UD(function(e){const t=[];for(const n of XD(e))if(CT(e,n)){const r=e[n],i=Object(Z.i)(r);for(const e of i)Fz(e)?t.push(e):Sz(e)&&t.push(e.condition)}return t}(n).map(Wz),$D)]}}function BT(e){const{title:t,field:n}=e;return cM(t,n)}function LT(e,t,n,r,i){const{scale:o,axis:a}=n;return({partName:s,mark:u,positionPrefix:l,endPositionPrefix:c,extraEncoding:f={}})=>{const d=BT(n);return IT(e,s,i,{mark:u,encoding:Object.assign(Object.assign(Object.assign({[t]:Object.assign(Object.assign(Object.assign({field:l+"_"+n.field,type:n.type},void 0!==d?{title:d}:{}),void 0!==o?{scale:o}:{}),void 0!==a?{axis:a}:{})},Object(Z.I)(c)?{[t+"2"]:{field:c+"_"+n.field}}:{}),r),f)})}}function IT(e,t,n,r){const{clip:i,color:o,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[Object.assign(Object.assign({},r),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[t]),i?{clip:i}:{}),o?{color:o}:{}),a?{opacity:a}:{}),WF(r.mark)?r.mark:{type:r.mark}),{style:`${s}-${t}`}),Object(Z.C)(e[t])?{}:e[t])})]:[]}function UT(e,t,n){const{encoding:r}=e,i="vertical"===t?"y":"x",o=r[i],a=r[i+"2"],s=r[i+"Error"],u=r[i+"Error2"];return{continuousAxisChannelDef:qT(o,n),continuousAxisChannelDef2:qT(a,n),continuousAxisChannelDefError:qT(s,n),continuousAxisChannelDefError2:qT(u,n),continuousAxis:i}}function qT(e,t){if(e&&e.aggregate){const{aggregate:n}=e,r=bD(e,["aggregate"]);return n!==t&&aC(function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}(n,t)),r}return e}function WT(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(WF(n)&&n.orient)return n.orient;if($z(i)){if($z(o)){const e=Fz(i)&&i.aggregate,n=Fz(o)&&o.aggregate;if(e||n!==t){if(n||e!==t){if(e===t&&n===t)throw new Error("Both x and y cannot have aggregate");return uT(o)&&!uT(i)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if($z(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}const YT=new ST("boxplot",GT);function HT(e){return Object(Z.F)(e)?"tukey":e}function GT(e,{config:t}){var n,r;e=Object.assign(Object.assign({},e),{encoding:$T(e.encoding,t)});const{mark:i,encoding:o,selection:a,projection:s}=e,u=bD(e,["mark","encoding","selection","projection"]),l=WF(i)?i:{type:i};a&&aC(BS("boxplot"));const c=null!==(n=l.extent)&&void 0!==n?n:t.boxplot.extent,f=_T("size",l,t),d=HT(c),{bins:h,timeUnits:p,transform:g,continuousAxisChannelDef:m,continuousAxis:b,groupby:y,aggregate:v,encodingWithoutContinuousAxis:x,ticksOrient:_,boxOrient:O,customTooltipWithoutAggregatedField:w}=function(e,t,n){const r=WT(e,"boxplot"),{continuousAxisChannelDef:i,continuousAxis:o}=UT(e,r,"boxplot"),a=i.field,s=HT(t),u=[...VT(a),{op:"median",field:a,as:"mid_box_"+a},{op:"min",field:a,as:("min-max"===s?"lower_whisker_":"min_")+a},{op:"max",field:a,as:("min-max"===s?"upper_whisker_":"max_")+a}],l="min-max"===s||"tukey"===s?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:"iqr_"+a},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${t}, datum["max_${a}"])`,as:"upper_whisker_"+a},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${t}, datum["min_${a}"])`,as:"lower_whisker_"+a}],c=e.encoding,f=o,d=(c[f],bD(c,["symbol"==typeof f?f:f+""])),{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=function(e){const{tooltip:t}=e,n=bD(e,["tooltip"]);if(!t)return{filteredEncoding:n};let r,i;if(Object(Z.B)(t)){for(const e of t)e.aggregate?(r||(r=[]),r.push(e)):(i||(i=[]),i.push(e));r&&(n.tooltip=r)}else t.aggregate?n.tooltip=t:i=t;return Object(Z.B)(i)&&1===i.length&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}(d),{bins:g,timeUnits:m,aggregate:b,groupby:y,encoding:v}=zT(p,n),x="vertical"===r?"horizontal":"vertical",_=r,O=[...g,...m,{aggregate:[...b,...u],groupby:y},...l];return{bins:g,timeUnits:m,transform:O,groupby:y,aggregate:b,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:h}}(e,c,t),{color:j,size:k}=x,E=bD(x,["color","size"]),A=e=>LT(l,b,m,e,t.boxplot),D=A(E),M=A(x),S=A(Object.assign(Object.assign({},E),k?{size:k}:{})),C=PT([{fieldPrefix:"min-max"===d?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===d?"lower_whisker_":"min_",titlePrefix:"Min"}],m,x),F={type:"tick",color:"black",opacity:1,orient:_,invalid:null,aria:!1},z="min-max"===d?C:PT([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,x),T=[...D({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:z}),...D({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:z}),...D({partName:"ticks",mark:F,positionPrefix:"lower_whisker",extraEncoding:z}),...D({partName:"ticks",mark:F,positionPrefix:"upper_whisker",extraEncoding:z})],$=[..."tukey"!==d?T:[],...M({partName:"box",mark:Object.assign(Object.assign({type:"bar"},f?{size:f}:{}),{orient:O,invalid:null,ariaRoleDescription:"box"}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:C}),...S({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},Object(Z.G)(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),f?{size:f}:{}),{orient:_,aria:!1}),positionPrefix:"mid_box",extraEncoding:C})];if("min-max"===d)return Object.assign(Object.assign({},u),{transform:(null!==(r=u.transform)&&void 0!==r?r:[]).concat(g),layer:$});const N=`datum["lower_box_${m.field}"]`,R=`datum["upper_box_${m.field}"]`,P=`(${R} - ${N})`,B=`${N} - ${c} * ${P}`,L=`${R} + ${c} * ${P}`,I=`datum["${m.field}"]`,U={joinaggregate:VT(m.field),groupby:y},q={transform:[{filter:`(${B} <= ${I}) && (${I} <= ${L})`},{aggregate:[{op:"min",field:m.field,as:"lower_whisker_"+m.field},{op:"max",field:m.field,as:"upper_whisker_"+m.field},{op:"min",field:"lower_box_"+m.field,as:"lower_box_"+m.field},{op:"max",field:"upper_box_"+m.field,as:"upper_box_"+m.field},...v],groupby:y}],layer:T},W=bD(E,["tooltip"]),{scale:Y,axis:H}=m,G=BT(m),V=zD(H,["title"]),X=IT(l,"outliers",t.boxplot,{transform:[{filter:`(${I} < ${B}) || (${I} > ${L})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[b]:Object.assign(Object.assign(Object.assign({field:m.field,type:m.type},void 0!==G?{title:G}:{}),void 0!==Y?{scale:Y}:{}),VD(V)?{}:{axis:V})},W),j?{color:j}:{}),w?{tooltip:w}:{})})[0];let J;const K=[...h,...p,U];return X?J={transform:K,layer:[X,q]}:(J=q,J.transform.unshift(...K)),Object.assign(Object.assign({},u),{layer:[J,{transform:g,layer:$}]})}function VT(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}const XT=new ST("errorbar",JT);function JT(e,{config:t}){e=Object.assign(Object.assign({},e),{encoding:$T(e.encoding,t)});const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:a,markDef:s,outerSpec:u,tooltipEncoding:l}=ZT(e,"errorbar",t);delete o.size;const c=LT(s,i,r,o,t.errorbar),f=s.thickness,d=s.size,h=Object.assign(Object.assign({type:"tick",orient:a,aria:!1},void 0!==f?{thickness:f}:{}),void 0!==d?{size:d}:{}),p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:Object.assign({type:"rule",ariaRoleDescription:"errorbar"},void 0!==f?{size:f}:{}),positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return Object.assign(Object.assign(Object.assign({},u),{transform:n}),p.length>1?{layer:p}:Object.assign({},p[0]))}function KT(e,t){const{encoding:n}=e;if(function(e){return(Rz(e.x)||Rz(e.y))&&!Rz(e.x2)&&!Rz(e.y2)&&!Rz(e.xError)&&!Rz(e.xError2)&&!Rz(e.yError)&&!Rz(e.yError2)}(n))return{orient:WT(e,t),inputType:"raw"};const r=function(e){return Rz(e.x2)||Rz(e.y2)}(n),i=function(e){return Rz(e.xError)||Rz(e.xError2)||Rz(e.yError)||Rz(e.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error(t+" cannot be both type aggregated-upper-lower and aggregated-error");const e=n.x2,r=n.y2;if(Rz(e)&&Rz(r))throw new Error(t+" cannot have both x2 and y2");if(Rz(e)){if($z(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in "+t)}if(Rz(r)){if($z(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error("Both y and y2 have to be quantitative in "+t)}throw new Error("No ranged axis")}{const e=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(Rz(r)&&!Rz(e))throw new Error(t+" cannot have xError2 without xError");if(Rz(s)&&!Rz(i))throw new Error(t+" cannot have yError2 without yError");if(Rz(e)&&Rz(i))throw new Error(t+" cannot have both xError and yError with both are quantiative");if(Rz(e)){if($z(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Rz(i)){if($z(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function ZT(e,t,n){var r;const{mark:i,encoding:o,selection:a,projection:s}=e,u=bD(e,["mark","encoding","selection","projection"]),l=WF(i)?i:{type:i};a&&aC(BS(t));const{orient:c,inputType:f}=KT(e,t),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:g,continuousAxis:m}=UT(e,c,t),{errorBarSpecificAggregate:b,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:x}=function(e,t,n,r,i,o,a,s){let u=[],l=[];const c=t.field;let f,d=!1;if("raw"===o){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&aC(function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}(t,n,a)),"stderr"===n||"stdev"===n)u=[{op:n,field:c,as:"extent_"+c},{op:t,field:c,as:"center_"+c}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:"upper_"+c},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:"lower_"+c}],f=[{fieldPrefix:"center_",titlePrefix:nM(t)},{fieldPrefix:"upper_",titlePrefix:QT(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:QT(t,n,"-")}],d=!0;else{let e,t,r;"ci"===n?(e="mean",t="ci0",r="ci1"):(e="median",t="q1",r="q3"),u=[{op:t,field:c,as:"lower_"+c},{op:r,field:c,as:"upper_"+c},{op:e,field:c,as:"center_"+c}],f=[{fieldPrefix:"upper_",titlePrefix:Kz({field:c,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Kz({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Kz({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&aC((h=e.center,`${(p=e.extent)?"extent ":""}${p&&h?"and ":""}${h?"center ":""}${p&&h?"are ":"is "}not needed when data are aggregated.`)),"aggregated-upper-lower"===o?(f=[],l=[{calculate:`datum["${n.field}"]`,as:"upper_"+c},{calculate:`datum["${c}"]`,as:"lower_"+c}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${r.field}"]`,as:"upper_"+c}],i?l.push({calculate:`datum["${c}"] + datum["${i.field}"]`,as:"lower_"+c}):l.push({calculate:`datum["${c}"] - datum["${r.field}"]`,as:"lower_"+c}));for(const e of l)f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:sM(sM(e.calculate,'datum["',""),'"]',"")})}var h,p;return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,d,h,p,g,f,t,n),_=o,O=m,w=(_[O],"x"===m?"x2":"y2"),j=(_[w],"x"===m?"xError":"yError"),k=(_[j],"x"===m?"xError2":"yError2"),E=(_[k],bD(_,["symbol"==typeof O?O:O+"","symbol"==typeof w?w:w+"","symbol"==typeof j?j:j+"","symbol"==typeof k?k:k+""])),{bins:A,timeUnits:D,aggregate:M,groupby:S,encoding:C}=zT(E,n),F=[...M,...b],z="raw"!==f?[]:S,T=PT(v,d,C,x);return{transform:[...null!==(r=u.transform)&&void 0!==r?r:[],...A,...D,...0===F.length?[]:[{aggregate:F,groupby:z}],...y],groupby:z,continuousAxisChannelDef:d,continuousAxis:m,encodingWithoutContinuousAxis:C,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:l,outerSpec:u,tooltipEncoding:T}}function QT(e,t,n){return nM(e)+" "+n+" "+t}const e$=new ST("errorband",t$);function t$(e,{config:t}){e=Object.assign(Object.assign({},e),{encoding:$T(e.encoding,t)});const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=ZT(e,"errorband",t),l=a,c=LT(l,i,r,o,t.errorband),f=void 0!==e.encoding.x&&void 0!==e.encoding.y;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p=Object.assign(Object.assign({},l.interpolate?{interpolate:l.interpolate}:{}),l.tension&&l.interpolate?{tension:l.tension}:{});return f?(d=Object.assign(Object.assign(Object.assign({},d),p),{ariaRoleDescription:"errorband"}),h=Object.assign(Object.assign(Object.assign({},h),p),{aria:!1})):l.interpolate?aC(nC("interpolate")):l.tension&&aC(nC("tension")),Object.assign(Object.assign({},s),{transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]})}const n$={};function r$(e,t,n){const r=new ST(e,t);n$[e]={normalizer:r,parts:n}}r$("boxplot",GT,["box","median","outliers","rule","ticks"]),r$("errorbar",JT,["ticks","rule"]),r$("errorband",t$,["band","borders"]);const i$=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],o$={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},a$={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},s$=XD(o$),u$=XD(a$),l$=XD({header:1,headerRow:1,headerColumn:1,headerFacet:1}),c$=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"];function f$(e){const t=[];for(const n of e||[]){const{expr:e,bind:r}=n,i=bD(n,["expr","bind"]);if(r&&e){const n=Object.assign(Object.assign({},i),{bind:r,init:e});t.push(n)}else{const n=Object.assign(Object.assign(Object.assign({},i),e?{update:e}:{}),r?{bind:r}:{});t.push(n)}}return t}const d$={single:{on:"click",fields:["_vgsid_"],resolve:"global",empty:"all",clear:"dblclick"},multi:{on:"click",fields:["_vgsid_"],toggle:"event.shiftKey",resolve:"global",empty:"all",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function h$(e){return!(!e||"legend"!==e&&!e.legend)}function p$(e){return h$(e)&&Object(Z.G)(e)}function g$(e){return"concat"in e}function m$(e){return"vconcat"in e}function b$(e){return"hconcat"in e}function y$(e){return Object(Z.G)(e)&&void 0!==e.step}function v$(e){return e.view||e.width||e.height}const x$=XD({align:1,bounds:1,center:1,columns:1,spacing:1});function _$(e,t){var n;return null!==(n=e[t])&&void 0!==n?n:e["width"===t?"continuousWidth":"continuousHeight"]}function O$(e,t){const n=w$(e,t);return y$(n)?n.step:j$}function w$(e,t){var n;return cM(null!==(n=e[t])&&void 0!==n?n:e["width"===t?"discreteWidth":"discreteHeight"],{step:e.step})}const j$=20,k$={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:j$},mark:{color:"#4c78a8",invalid:"filter",timeUnitBand:1},arc:{},area:{},bar:XF,circle:{},geoshape:{},image:{},line:{},point:{},rect:JF,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:d$,style:{},title:{},facet:{spacing:20},concat:{spacing:20}},E$=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],A$={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},D$={blue:E$[0],orange:E$[1],red:E$[2],teal:E$[3],green:E$[4],yellow:E$[5],purple:E$[6],pink:E$[7],brown:E$[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function M$(e){const t=XD(e||{}),n={};for(const r of t){const t=e[r];n[r]=vM(t)?pT(t):gT(t)}return n}const S$=[...GF,...kM,...l$,"background","padding","legend","lineBreak","scale","style","title","view"];function C$(e={}){const{color:t,font:n,fontSize:r}=e,i=bD(e,["color","font","fontSize"]),o=Object(Z.O)({},k$,n?function(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}(n):{},t?function(e={}){return{signals:[{name:"color",value:Object(Z.G)(e)?Object.assign(Object.assign({},D$),e):D$}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}(t):{},r?function(e){return{signals:[{name:"fontSize",value:Object(Z.G)(e)?Object.assign(Object.assign({},A$),e):A$}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}(r):{},i||{}),a=zD(o,S$);for(const e of["background","lineBreak","padding"])o[e]&&(a[e]=gT(o[e]));for(const e of GF)o[e]&&(a[e]=kF(o[e]));for(const e of kM)o[e]&&(a[e]=M$(o[e]));for(const e of l$)o[e]&&(a[e]=kF(o[e]));return o.legend&&(a.legend=kF(o.legend)),o.scale&&(a.scale=kF(o.scale)),o.style&&(a.style=function(e){const t=XD(e),n={};for(const r of t)n[r]=M$(e[r]);return n}(o.style)),o.title&&(a.title=kF(o.title)),o.view&&(a.view=kF(o.view)),a}const F$=["view",...qF],z$=["color","fontSize","background","padding","facet","concat","numberFormat","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],T$=Object.assign({view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"]},{area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]});function $$(e){e=CD(e);for(const t of z$)delete e[t];if(e.axis)for(const t in e.axis)vM(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of i$)delete e.legend[t];if(e.mark){for(const t of HF)delete e.mark[t];e.mark.tooltip&&Object(Z.G)(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(f$(e.params)),delete e.params);for(const t of F$){for(const n of HF)delete e[t][n];const n=T$[t];if(n)for(const r of n)delete e[t][r];N$(e,t)}for(const t of XD(n$))delete e[t];!function(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:r}=dT(e.title);VD(t)||(e.style["group-title"]=Object.assign(Object.assign({},e.style["group-title"]),t));VD(n)||(e.style["group-subtitle"]=Object.assign(Object.assign({},e.style["group-subtitle"]),n));VD(r)?delete e.title:e.title=r}(e);for(const t in e)Object(Z.G)(e[t])&&VD(e[t])&&delete e[t];return VD(e)?void 0:e}function N$(e,t,n,r){const i=r?e[t][r]:e[t];"view"===t&&(n="cell");const o=Object.assign(Object.assign({},i),e.style[null!=n?n:t]);VD(o)||(e.style[null!=n?n:t]=o),r||delete e[t]}function R$(e){return"layer"in e}const P$={zero:1,center:1,normalize:1};const B$=new Set([AF,MF,DF,TF,FF,PF,BF,CF,$F,NF]),L$=new Set([MF,DF,AF]);function I$(e,t){var n,r;const i="x"===t?"y":"radius",o=e[t],a=e[i];if(Fz(o)&&Fz(a))if("quantitative"===zz(o)&&"quantitative"===zz(a)){if(o.stack)return t;if(a.stack)return i;const e=Fz(o)&&!!o.aggregate;if(e!==(Fz(a)&&!!a.aggregate))return e?t:i;{const e=null===(n=o.scale)||void 0===n?void 0:n.type,s=null===(r=a.scale)||void 0===r?void 0:r.type;if(e&&"linear"!==e)return i;if(s&&"linear"!==s)return t}}else{if("quantitative"===zz(o))return t;if("quantitative"===zz(a))return i}else{if("quantitative"===zz(o))return t;if("quantitative"===zz(a))return i}}function U$(e,t,n={}){const r=WF(e)?e.type:e;if(!B$.has(r))return null;const i=I$(t,"x")||I$(t,"theta");if(!i)return null;const o=t[i],a=Fz(o)?Yz(o,{}):void 0;let s=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(i),u=t[s],l=Fz(u)?Yz(u,{}):void 0;l===a&&(l=void 0,u=void 0,s=void 0);const c=cS.reduce((e,n)=>{if("tooltip"!==n&&CT(t,n)){const r=t[n];for(const t of Object(Z.i)(r)){const r=tT(t);if(r.aggregate)continue;const i=Yz(r,{});i&&i===l||e.push({channel:n,fieldDef:r})}}return e},[]);let f;if(void 0!==o.stack?f=Object(Z.C)(o.stack)?o.stack?"zero":null:o.stack:c.length>0&&L$.has(r)&&(f="zero"),!f||!(f in P$))return null;var d;if(FT(t)&&0===c.length)return null;if(o.scale&&o.scale.type&&o.scale.type!==HC){if(n.disallowNonLinearStack)return null;aC(`Cannot stack non-linear scale (${o.scale.type}).`)}return Rz(t[sS(i)])?(void 0!==o.stack&&aC(`Cannot stack "${d=i}" if there is already "${d}2".`),null):(Fz(o)&&o.aggregate&&!RD(zM,o.aggregate)&&aC(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannel:u?s:void 0,groupbyField:l,fieldChannel:i,impute:null!==o.impute&&IF(r),stackBy:c,offset:f})}function q$(e){const t=bD(e,["point","line"]);return XD(t).length>1?t:t.type}function W$(e){for(const t of["line","area","rule","trail"])e[t]&&(e=Object.assign(Object.assign({},e),{[t]:zD(e[t],["point","line"])}));return e}function Y$(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?Object(Z.G)(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?Object(Z.G)(t.point)?t.point:{}:void 0}function H$(e,t={}){return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class G${constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(MT(e)){const{mark:n,encoding:r}=e,i=WF(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!Y$(i,t[i.type],r);case"area":return!!Y$(i,t[i.type],r)||!!H$(i,t[i.type])}}return!1}run(e,t,n){const{config:r}=t,{selection:i,projection:o,mark:a,encoding:s}=e,u=bD(e,["selection","projection","mark","encoding"]),l=$T(s,r),c=WF(a)?a:{type:a},f=Y$(c,r[c.type],l),d="area"===c.type&&H$(c,r[c.type]),h=[Object.assign(Object.assign({},i?{selection:i}:{}),{mark:q$(Object.assign(Object.assign({},"area"===c.type&&void 0===c.opacity&&void 0===c.fillOpacity?{opacity:.7}:{}),c)),encoding:zD(l,["shape"])})],p=U$(c,l);let g=l;if(p){const{fieldChannel:e,offset:t}=p;g=Object.assign(Object.assign({},l),{[e]:Object.assign(Object.assign({},l[e]),t?{stack:t}:{})})}return d&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"line"},FD(c,["clip","interpolate","tension","tooltip"])),d),encoding:g})),f&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},FD(c,["clip","tooltip"])),f),encoding:g})),n(Object.assign(Object.assign({},u),{layer:h}),Object.assign(Object.assign({},t),{config:W$(r)}))}}class V${constructor(){this.name="RangeStep"}hasMatchingType(e){var t;if(MT(e)&&e.encoding)for(const n of dS){const r=e.encoding[n];if(r&&Rz(r)&&(null===(t=null==r?void 0:r.scale)||void 0===t?void 0:t.rangeStep))return!0}return!1}run(e){var t;const n={};let r=Object.assign({},e.encoding);for(const e of dS){const i=uS(e),o=r[e];if(o&&Rz(o)&&(null===(t=null==o?void 0:o.scale)||void 0===t?void 0:t.rangeStep)){const{scale:t}=o,a=bD(o,["scale"]),s=bD(t,["rangeStep"]);n[i]={step:t.rangeStep},aC('Scale\'s "rangeStep" is deprecated and will be removed in Vega-Lite 5.0. Please use "width"/"height": {"step": ...} instead. See https://vega.github.io/vega-lite/docs/size.html.'),r=Object.assign(Object.assign({},r),{[e]:Object.assign(Object.assign({},a),VD(s)?{}:{scale:s})})}}return Object.assign(Object.assign(Object.assign({},n),e),{encoding:r})}}function X$(e,t){return t?Oz(e)?tN(e,t):Z$(e,t):e}function J$(e,t){return t?tN(e,t):e}function K$(e,t,n){const r=t[e];return(i=r)&&!Object(Z.I)(i)&&"repeat"in i?r.repeat in n?Object.assign(Object.assign({},t),{[e]:n[r.repeat]}):void aC(function(e){return`Unknown repeated value "${e}".`}(r.repeat)):t;var i}function Z$(e,t){if(void 0!==(e=K$("field",e,t))){if(null===e)return null;if(Ez(e)&&xz(e.sort)){const n=K$("field",e.sort,t);e=Object.assign(Object.assign({},e),n?{sort:n}:{})}return e}}function Q$(e,t){if(Fz(e))return Z$(e,t);{const n=K$("datum",e,t);return n===e||n.type||(n.type="nominal"),n}}function eN(e,t){if(!Rz(e)){if(Cz(e)){const n=Q$(e.condition,t);if(n)return Object.assign(Object.assign({},e),{condition:n});return bD(e,["condition"])}return e}{const n=Q$(e,t);if(n)return n;if(Mz(e))return{condition:e.condition}}}function tN(e,t){const n={};for(const r in e)if(Object(Z.w)(e,r)){const i=e[r];if(Object(Z.B)(i))n[r]=i.map(e=>eN(e,t)).filter(e=>e);else{const e=eN(i,t);void 0!==e&&(n[r]=e)}}return n}class nN{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(MT(e)){const{encoding:t,mark:n}=e;if("line"===n)for(const e of rS){const n=t[oS(e)];if(t[e]&&(Fz(n)&&!DS(n.bin)||Tz(n)))return!0}}return!1}run(e,t,n){const{encoding:r}=e;var i,o;return aC((i=!!r.x2,o=!!r.y2,`Line mark is for continuous lines and thus cannot be used with ${i&&o?"x2 and y2":i?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}function rN({parentEncoding:e,encoding:t={},layer:n}){let r={};if(e){const i=new Set([...XD(e),...XD(t)]);for(const o of i){const i=t[o],a=e[o];if(Rz(i)){const e=Object.assign(Object.assign({},a),i);r[o]=e}else Cz(i)?r[o]=Object.assign(Object.assign({},i),{condition:Object.assign(Object.assign({},a),i.condition)}):i||null===i?r[o]=i:(n||Bz(a)||wC(a)||Rz(a)||Object(Z.B)(a))&&(r[o]=a)}}else r=t;return!r||VD(r)?void 0:r}function iN(e){const{parentProjection:t,projection:n}=e;return t&&n&&aC(function(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${TD(t)} is overridden by a child projection ${TD(n)}.`}({parentProjection:t,projection:n})),null!=n?n:t}function oN(e,t){void 0===t&&(t=C$(e.config));const n=function(e,t={}){return aN.map(e,{config:t})}(e,t),{width:r,height:i}=e,o=function(e,t,n){let{width:r,height:i}=t;const o=MT(e)||R$(e),a={};o?"container"==r&&"container"==i?(a.type="fit",a.contains="padding"):"container"==r?(a.type="fit-x",a.contains="padding"):"container"==i&&(a.type="fit-y",a.contains="padding"):("container"==r&&(aC(zS("width")),r=void 0),"container"==i&&(aC(zS("height")),i=void 0));const s=Object.assign(Object.assign(Object.assign({type:"pad"},a),n?sN(n.autosize):{}),sN(e.autosize));"fit"!==s.type||o||(aC('Autosize "fit" only works for single views and layered views.'),s.type="pad");"container"==r&&"fit"!=s.type&&"fit-x"!=s.type&&aC(TS("width"));"container"==i&&"fit"!=s.type&&"fit-y"!=s.type&&aC(TS("height"));if(SD(s,{type:"pad"}))return;return s}(n,{width:r,height:i,autosize:e.autosize},t);return Object.assign(Object.assign({},n),o?{autosize:o}:{})}const aN=new class extends class{map(e,t){return jz(e)?this.mapFacet(e,t):function(e){return"repeat"in e}(e)?this.mapRepeat(e,t):b$(e)?this.mapHConcat(e,t):m$(e)?this.mapVConcat(e,t):g$(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(R$(e))return this.mapLayer(e,t);if(MT(e))return this.mapUnit(e,t);throw new Error(FS(e))}mapLayer(e,t){return Object.assign(Object.assign({},e),{layer:e.layer.map(e=>this.mapLayerOrUnit(e,t))})}mapHConcat(e,t){return Object.assign(Object.assign({},e),{hconcat:e.hconcat.map(e=>this.map(e,t))})}mapVConcat(e,t){return Object.assign(Object.assign({},e),{vconcat:e.vconcat.map(e=>this.map(e,t))})}mapConcat(e,t){const{concat:n}=e,r=bD(e,["concat"]);return Object.assign(Object.assign({},r),{concat:n.map(e=>this.map(e,t))})}mapFacet(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapRepeat(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}}{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[YT,XT,e$,new G$,new nN,new V$]}map(e,t){if(MT(e)){const n=CT(e.encoding,$M),r=CT(e.encoding,NM),i=CT(e.encoding,"facet");if(n||r||i)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:n,parentProjection:r}=t,i=J$(e.encoding,t.repeater),o=Object.assign(Object.assign({},e),i?{encoding:i}:{});if(n||r)return this.mapUnitWithParentEncodingOrProjection(o,t);const a=this.mapLayerOrUnit.bind(this);for(const e of this.nonFacetUnitNormalizers)if(e.hasMatchingType(o,t.config))return e.run(o,t,a);return o}mapRepeat(e,t){return function(e){return!Object(Z.B)(e.repeat)&&e.repeat.layer}(e)?this.mapLayerRepeat(e,t):this.mapNonLayerRepeat(e,t)}mapLayerRepeat(e,t){const{repeat:n,spec:r}=e,i=bD(e,["repeat","spec"]),{row:o,column:a,layer:s}=n,{repeater:u={},repeaterPrefix:l=""}=t;return o||a?this.mapRepeat(Object.assign(Object.assign({},e),{repeat:Object.assign(Object.assign({},o?{row:o}:{}),a?{column:a}:{}),spec:{repeat:{layer:s},spec:r}}),t):Object.assign(Object.assign({},i),{layer:s.map(e=>{const n=Object.assign(Object.assign({},u),{layer:e}),i=(r.name||"")+l+"child__layer_"+QD(e),o=this.mapLayerOrUnit(r,Object.assign(Object.assign({},t),{repeater:n,repeaterPrefix:i}));return o.name=i,o})})}mapNonLayerRepeat(e,t){var n;const{repeat:r,spec:i,data:o}=e,a=bD(e,["repeat","spec","data"]);!Object(Z.B)(r)&&e.columns&&(e=zD(e,["columns"]),aC(LS("repeat")));const s=[],{repeater:u={},repeaterPrefix:l=""}=t,c=!Object(Z.B)(r)&&r.row||[u?u.row:null],f=!Object(Z.B)(r)&&r.column||[u?u.column:null],d=Object(Z.B)(r)&&r||[u?u.repeat:null];for(const e of d)for(const n of c)for(const o of f){const a={repeat:e,row:n,column:o,layer:u.layer},c=(i.name||"")+l+"child__"+(Object(Z.B)(r)?""+QD(e):(r.row?"row_"+QD(n):"")+(r.column?"column_"+QD(o):"")),f=this.map(i,Object.assign(Object.assign({},t),{repeater:a,repeaterPrefix:c}));f.name=c,s.push(zD(f,["data"]))}const h=Object(Z.B)(r)?e.columns:r.column?r.column.length:1;return Object.assign(Object.assign({data:null!==(n=i.data)&&void 0!==n?n:o,align:"all"},a),{columns:h,concat:s})}mapFacet(e,t){const{facet:n}=e;return Oz(n)&&e.columns&&(e=zD(e,["columns"]),aC(LS("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:o,config:a}=t,s=iN({parentProjection:o,projection:r}),u=rN({parentEncoding:i,encoding:J$(n,t.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},e),s?{projection:s}:{}),u?{encoding:u}:{}),{config:a})}mapFacetedUnit(e,t){const n=e.encoding,{row:r,column:i,facet:o}=n,a=bD(n,["row","column","facet"]),{mark:s,width:u,projection:l,height:c,view:f,selection:d,encoding:h}=e,p=bD(e,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},t),b=J$(a,t.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},p),m),{facet:g,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u?{width:u}:{}),c?{height:c}:{}),f?{view:f}:{}),l?{projection:l}:{}),{mark:s,encoding:b}),d?{selection:d}:{})}),t)}getFacetMappingAndLayout(e,t){var n;const{row:r,column:i,facet:o}=e;if(r||i){o&&aC(`Facet encoding dropped as ${(a=[...r?[$M]:[],...i?[NM]:[]]).join(" and ")} ${a.length>1?"are":"is"} also specified.`);const t={},s={};for(const r of[$M,NM]){const i=e[r];if(i){const e=bD(i,["align","center","spacing","columns"]);t[r]=e;for(const e of["align","center","spacing"])void 0!==i[e]&&(s[e]=null!==(n=s[e])&&void 0!==n?n:{},s[e][r]=i[e])}}return{facetMapping:t,layout:s}}{const{align:e,center:n,spacing:r,columns:i}=o;return{facetMapping:X$(bD(o,["align","center","spacing","columns"]),t.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},e?{align:e}:{}),n?{center:n}:{}),r?{spacing:r}:{}),i?{columns:i}:{})}}var a}mapLayer(e,t){var{parentEncoding:n,parentProjection:r}=t,i=bD(t,["parentEncoding","parentProjection"]);const{encoding:o,projection:a}=e,s=bD(e,["encoding","projection"]),u=Object.assign(Object.assign({},i),{parentEncoding:rN({parentEncoding:n,encoding:o,layer:!0}),parentProjection:iN({parentProjection:r,projection:a})});return super.mapLayer(s,u)}};function sN(e){return Object(Z.I)(e)?{type:e}:null!=e?e:{}}const uN=["background","padding"];function lN(e,t){const n={};for(const t of uN)e&&void 0!==e[t]&&(n[t]=gT(e[t]));return t&&(n.params=e.params),n}class cN{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new cN(CD(this.explicit),CD(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return cM(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of XD(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function fN(e){return{explicit:!0,value:e}}function dN(e){return{explicit:!1,value:e}}function hN(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:pN(t,n,r,i)}}function pN(e,t,n,r){return e.explicit&&t.explicit&&aC(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${TD(n)} and ${TD(r)}). Using ${TD(n)}.`}(n,r,e.value,t.value)),e}function gN(e,t,n,r,i=pN){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:SD(e.value,t.value)?e:i(e,t,n,r)}class mN extends cN{constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function bN(e){return"url"in e}function yN(e){return"values"in e}function vN(e){return"name"in e&&!bN(e)&&!yN(e)&&!xN(e)}function xN(e){return e&&(_N(e)||ON(e)||wN(e))}function _N(e){return"sequence"in e}function ON(e){return"sphere"in e}function wN(e){return"graticule"in e}var jN;function kN(e){return"filter"in e}function EN(e){return"lookup"in e}function AN(e){return"pivot"in e}function DN(e){return"density"in e}function MN(e){return"quantile"in e}function SN(e){return"regression"in e}function CN(e){return"loess"in e}function FN(e){return"sample"in e}function zN(e){return"window"in e}function TN(e){return"joinaggregate"in e}function $N(e){return"flatten"in e}function NN(e){return"calculate"in e}function RN(e){return"bin"in e}function PN(e){return"impute"in e}function BN(e){return"timeUnit"in e}function LN(e){return"aggregate"in e}function IN(e){return"stack"in e}function UN(e){return"fold"in e}function qN(e,t,n,r){const i=Mz(t)&&t.condition,o=r(t);if(i){return{[n]:[...Object(Z.i)(i).map(t=>{const n=r(t),i=function(e){return e.selection}(t)?eP(e,t.selection):nP(e,t.test);return Object.assign({test:i},n)}),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function WN(e,t="text"){const n=e.encoding[t];return qN(e,n,t,t=>YN(t,e.config))}function YN(e,t,n="datum"){if(e){if(Bz(e))return bT(e.value);if(Rz(e)){const{format:r,formatType:i}=eT(e);return sz({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function HN(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,a=n.tooltip;if(Object(Z.B)(a))return{tooltip:VN({tooltip:a},o,i,t)};{const s=t.reactiveGeom?"datum.datum":"datum";return qN(e,a,"tooltip",e=>{const a=YN(e,i,s);if(a)return a;if(null===e)return;let u=_T("tooltip",r,i);return!0===u&&(u={content:"encoding"}),Object(Z.I)(u)?{value:u}:Object(Z.G)(u)?wC(u)?u:"encoding"===u.content?VN(n,o,i,t):{signal:s}:void 0})}}function GN(e,t,n,{reactiveGeom:r}={}){const i={},o=r?"datum.datum":"datum",a=[];function s(r,s){const u=oS(s),l=Pz(r)?r:Object.assign(Object.assign({},r),{type:e[u].type}),c=l.title||Qz(l,n),f=Object(Z.i)(c).join(", ");let d;if(hS(s)){const r="x"===s?"x2":"y2",a=tT(e[r]);if(DS(l.bin)&&a){const e=Yz(l,{expr:o}),t=Yz(a,{expr:o}),{format:s,formatType:u}=eT(l);d=gz(e,t,s,u,n),i[r]=!0}else if(t&&t.fieldChannel===s&&"normalize"===t.offset){const{format:e,formatType:t}=eT(l);d=sz({fieldOrDatumDef:l,format:e,formatType:t,expr:o,config:n,normalizeStack:!0}).signal}}d=null!=d?d:YN(l,n,o).signal,a.push({channel:s,key:f,value:d})}NT(e,(e,t)=>{Fz(e)?s(e,t):Sz(e)&&s(e.condition,t)});const u={};for(const{channel:e,key:t,value:n}of a)i[e]||u[t]||(u[t]=n);return u}function VN(e,t,n,{reactiveGeom:r}={}){const i=GN(e,t,n,{reactiveGeom:r}),o=KD(i).map(([e,t])=>`"${e}": ${t}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function XN(e){const{markDef:t,config:n}=e,r=_T("aria",t,n);return!1===r?{}:Object.assign(Object.assign(Object.assign({},r?{aria:r}:{}),function(e){const{mark:t,markDef:n,config:r}=e;if(!1===r.aria)return{};const i=_T("ariaRoleDescription",n,r);if(null!=i)return{ariaRoleDescription:{value:i}};return t in AC?{}:{ariaRoleDescription:{value:t}}}(e)),function(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return qN(e,o,"description",t=>YN(t,e.config));const a=_T("description",n,r);if(null!=a)return{description:bT(a)};if(!1===r.aria)return{};const s=GN(t,i,r);if(VD(s))return;return{description:{signal:KD(s).map(([e,t],n)=>`"${n>0?"; ":""}${e}: " + (${t})`).join(" + ")}}}(e))}function JN(e,t,n={}){const{markDef:r,encoding:i,config:o}=t,{vgChannel:a}=n;let{defaultRef:s,defaultValue:u}=n;void 0===s&&(u=null!=u?u:_T(e,r,o,{vgChannel:a,ignoreVgConfig:!0}),void 0!==u&&(s=bT(u)));const l=i[e];return qN(t,l,null!=a?a:e,n=>rz({channel:e,channelDef:n,markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s}))}function KN(e,t={filled:void 0}){var n,r,i,o;const{markDef:a,encoding:s,config:u}=e,{type:l}=a,c=null!==(n=t.filled)&&void 0!==n?n:_T("filled",a,u),f=RD(["bar","point","circle","square","geoshape"],l)?"transparent":void 0,d=null!==(i=null!==(r=_T(!0===c?"color":void 0,a,u,{vgChannel:"fill"}))&&void 0!==r?r:u.mark[!0===c&&"color"])&&void 0!==i?i:f,h=null!==(o=_T(!1===c?"color":void 0,a,u,{vgChannel:"stroke"}))&&void 0!==o?o:u.mark[!1===c&&"color"],p=c?"fill":"stroke",g=Object.assign(Object.assign({},d?{fill:bT(d)}:{}),h?{stroke:bT(h)}:{});return a.color&&(c?a.fill:a.stroke)&&aC(WS("property",{fill:"fill"in a,stroke:"stroke"in a})),Object.assign(Object.assign(Object.assign(Object.assign({},g),JN("color",e,{vgChannel:p,defaultValue:c?d:h})),JN("fill",e,{defaultValue:s.fill?d:void 0})),JN("stroke",e,{defaultValue:s.stroke?h:void 0}))}function ZN(e,t){const n=t[function(e){switch(e){case"x":return"xOffset";case"y":return"yOffset";case"x2":return"x2Offset";case"y2":return"y2Offset";case PM:return"thetaOffset";case RM:return"radiusOffset";case BM:return"theta2Offset";case"radius2":return"radius2Offset"}}(e)];if(n)return n}function QN(e,t,{defaultPos:n,vgChannel:r,isMidPoint:i}){const{encoding:o,markDef:a,config:s,stack:u}=t,l=o[e],c=o[sS(e)],f=t.scaleName(e),d=t.getScaleComponent(e),h=ZN(e,a),p=eR({model:t,defaultPos:n,channel:e,scaleName:f,scale:d}),g=!l&&hS(e)&&(o.latitude||o.longitude)?{field:t.getName(e)}:function(e){const{channel:t,channelDef:n,isMidPoint:r,scaleName:i,stack:o,offset:a,markDef:s,config:u}=e;if(Rz(n)&&o&&t===o.fieldChannel){if(Fz(n)){const e=Az({channel:t,fieldDef:n,isMidPoint:r,markDef:s,stack:o,config:u});if(void 0!==e)return nz({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",band:e,offset:a})}return tz(n,i,{suffix:"end"},{offset:a})}return KF(e)}({channel:e,channelDef:l,channel2Def:c,markDef:a,config:s,isMidPoint:i,scaleName:f,scale:d,stack:u,offset:h,defaultRef:p});return g?{[r||e]:g}:void 0}function eR({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:a}=e;return()=>{const s=oS(n),u=aS(n),l=_T(n,o,a,{vgChannel:u});if(void 0!==l)return iz(n,l);switch(t){case"zeroOrMin":case"zeroOrMax":if(r){const e=i.get("type");if(RD([GC,KC,ZC],e));else if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===t)return"y"===s?{field:{group:"height"}}:{value:0};switch(s){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":{const t=e[uS(n)];return Object.assign(Object.assign({},t),{mult:.5})}}}}!function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"}(jN||(jN={}));const tR={left:"x",center:"xc",right:"x2"},nR={top:"y",middle:"yc",bottom:"y2"};function rR(e,t,n,r="middle"){if("radius"===e||"theta"===e)return aS(e);const i="x"===e?"align":"baseline",o=_T(i,t,n);let a;return wC(o)?(aC(function(e){return`The ${e} for range marks cannot be an expression`}(i)),a=void 0):a=o,"x"===e?tR[a||("top"===r?"left":"center")]:nR[a||r]}function iR(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?oR(e,t,{defaultPos:n,defaultPos2:r}):QN(e,t,{defaultPos:n})}function oR(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,a=sS(e),s=uS(e),u=function(e,t,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=e,u=oS(n),l=uS(n),c=aS(n),f=r[u],d=e.scaleName(u),h=e.getScaleComponent(u),p=ZN(n in r||n in o?n:u,e.markDef);if(!f&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude))return{[c]:{field:e.getName(n)}};const g=function({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l}){if(Rz(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0))return tz(t,o,{suffix:"start"},{offset:u});return KF({channel:e,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:u,defaultRef:l})}({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});if(void 0!==g)return{[c]:g};return aR(n,o)||aR(n,{[n]:wT(n,o,s.style),[l]:wT(l,o,s.style)})||aR(n,s[i])||aR(n,s.mark)||{[c]:eR({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}(t,r,a),l=u[s]?rR(e,i,o):aS(e);return Object.assign(Object.assign({},QN(e,t,{defaultPos:n,vgChannel:l})),u)}function aR(e,t){const n=uS(e),r=aS(e);return void 0!==t[r]?{[r]:iz(e,t[r])}:void 0!==t[e]?{[r]:iz(e,t[e])}:t[n]?{[n]:iz(e,t[n])}:void 0}function sR(e,t,n){var r,i,o,a;const{config:s,encoding:u,markDef:l,stack:c}=e,f=sS(t),d=uS(t),h=u[t],p=u[f],g=e.getScaleComponent(t),m=g?g.get("type"):void 0,b=e.scaleName(t),y=l.orient,v=null!==(i=null!==(r=u[d])&&void 0!==r?r:u.size)&&void 0!==i?i:_T("size",l,s,{vgChannel:d}),x="bar"===n&&("x"===t?"vertical"===y:"horizontal"===y);if(Fz(h)&&(AS(h.bin)||DS(h.bin)||h.timeUnit&&!p)&&!v&&!gF(m)){const n=Az({channel:t,fieldDef:h,stack:c,markDef:l,config:s}),r=null===(o=e.component.axes[t])||void 0===o?void 0:o[0];return function({fieldDef:e,fieldDef2:t,channel:n,band:r,scaleName:i,markDef:o,spacing:a=0,axisTranslate:s,reverse:u,config:l}){const c=sS(n),f=aS(n),d=aS(c),h=ZN(n,o);if(AS(e.bin)||e.timeUnit)return{[d]:cR({channel:n,fieldDef:e,scaleName:i,markDef:o,band:(1-r)/2,offset:lR(c,a,u,s,h),config:l}),[f]:cR({channel:n,fieldDef:e,scaleName:i,markDef:o,band:1-(1-r)/2,offset:lR(n,a,u,s,h),config:l})};if(DS(e.bin)){const r=tz(e,i,{},{offset:lR(c,a,u,s,h)});if(Fz(t))return{[d]:r,[f]:tz(t,i,{},{offset:lR(n,a,u,s,h)})};if(MS(e.bin)&&e.bin.step)return{[d]:r,[f]:{signal:`scale("${i}", ${Yz(e,{expr:"datum"})} + ${e.bin.step})`,offset:lR(n,a,u,s,h)}}}return void aC(rC(c))}({fieldDef:h,fieldDef2:p,channel:t,markDef:l,scaleName:b,band:n,axisTranslate:null!==(a=null==r?void 0:r.get("translate"))&&void 0!==a?a:.5,spacing:hS(t)?_T("binSpacing",l,s):void 0,reverse:g.get("reverse"),config:s})}return(Rz(h)&&gF(m)||x)&&!p?function(e,t,n,r){var i;const{markDef:o,encoding:a,config:s,stack:u}=r,l=o.orient,c=r.scaleName(n),f=r.getScaleComponent(n),d=uS(n),h=sS(n),p="horizontal"===l&&"y"===n||"vertical"===l&&"x"===n,g=_T(p?"size":d,o,s,{vgChannel:d});let m;(a.size||void 0!==g)&&(p?m=JN("size",r,{vgChannel:d,defaultValue:g}):aC(function(e){return`Cannot apply size to non-oriented mark "${e}".`}(o.type)));const b=null!==(i=Rz(t)?Az({channel:n,fieldDef:t,markDef:o,stack:u,config:s}):void 0)&&void 0!==i?i:1;m=m||{[d]:uR(e,d,c,f,s,b)};const y="band"!==(null==f?void 0:f.get("type"))||!("band"in m[d]),v=rR(n,o,s,y?"middle":"top"),x=ZN(n,o),_=KF({channel:n,channelDef:t,markDef:o,config:s,scaleName:c,scale:f,stack:u,offset:x,defaultRef:eR({model:r,defaultPos:"mid",channel:n,scaleName:c,scale:f}),band:y?.5:(1-b)/2});if(d)return Object.assign({[v]:_},m);{const e=aS(h),t=m[d],n=x?Object.assign(Object.assign({},t),{offset:x}):t;return{[v]:_,[e]:Object(Z.B)(_)?[_[0],Object.assign(Object.assign({},_[1]),{offset:n})]:Object.assign(Object.assign({},_),{offset:n})}}}(n,h,t,e):oR(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function uR(e,t,n,r,i,o){if(r){const t=r.get("type");if("point"===t||"band"===t){if(void 0!==i[e].discreteBandSize)return{value:i[e].discreteBandSize};if(t===nF){const e=r.get("range");return jC(e)&&Object(Z.F)(e.step)?{value:e.step-2}:{value:j$-2}}return{scale:n,band:o}}return{value:i[e].continuousBandSize}}const a=O$(i.view,t),s=cM(i[e].discreteBandSize,a-2);return void 0!==s?{value:s}:void 0}function lR(e,t,n,r,i){if(YM(e))return 0;const o="x"===e||"y2"===e?-t/2:t/2;if(wC(n)||wC(i)||wC(r)){const e=vT(n),t=vT(i),a=vT(r);return{signal:(a?a+" + ":"")+(e?`(${e} ? -1 : 1) * `:"")+(t?`(${t} + ${o})`:o)}}return i=i||0,r+(n?-i-o:+i+o)}function cR({channel:e,fieldDef:t,scaleName:n,markDef:r,band:i,offset:o,config:a}){return ZF({fieldDef:t,channel:e,markDef:r,ref:nz({scaleName:n,fieldOrDatumDef:t,band:i,offset:o}),config:a})}const fR=new Set(["aria"]);function dR(e,t){const{fill:n,stroke:r}="include"===t.color?KN(e):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function(e,t){return EC.reduce((n,r)=>(fR.has(r)||void 0===e[r]||"ignore"===t[r]||(n[r]=bT(e[r])),n),{})}(e.markDef,t)),hR(e,"fill",n)),hR(e,"stroke",r)),JN("opacity",e)),JN("fillOpacity",e)),JN("strokeOpacity",e)),JN("strokeWidth",e)),JN("strokeDash",e)),function(e){const{encoding:t,mark:n}=e,r=t.order;return!IF(n)&&Bz(r)?qN(e,r,"zindex",e=>bT(e.value)):{}}(e)),HN(e)),WN(e,"href")),XN(e))}function hR(e,t,n){const{config:r,mark:i,markDef:o}=e;if("hide"===_T("invalid",o,r)&&n&&!IF(i)){const r=function(e,{invalid:t=!1,channels:n}){const r=n.reduce((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum"});o&&mF(i)&&(t[o]=!0)}return t},{}),i=XD(r);if(i.length>0){const e=t?"||":"&&";return i.map(e=>ez(e,t)).join(` ${e} `)}return}(e,{invalid:!0,channels:xS});if(r)return{[t]:[{test:r,value:null},...Object(Z.i)(n)]}}return n?{[t]:n}:{}}function pR(e){const{config:t,markDef:n}=e;if(_T("invalid",n,t)){const t=function(e,{invalid:t=!1,channels:n}){const r=n.reduce((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum"});o&&mF(i)&&(t[o]=!0)}return t},{}),i=XD(r);if(i.length>0){const e=t?"||":"&&";return i.map(e=>ez(e,t)).join(` ${e} `)}return}(e,{channels:dS});if(t)return{defined:{signal:t}}}return{}}function gR(e,t){if(void 0!==t)return{[e]:bT(t)}}const mR={has:e=>"interval"!==e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName("voronoi")},marks:(e,t,n)=>{const{x:r,y:i}=t.project.hasChannel,o=e.mark;if(IF(o))return aC(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:e.getName("voronoi"),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},HN(e,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let s=0,u=!1;return n.forEach((t,n)=>{var r;const i=null!==(r=t.name)&&void 0!==r?r:"";i===e.component.mark[0].name?s=n:i.indexOf("voronoi")>=0&&(u=!0)}),u||n.splice(s+1,0,a),n}};class bR{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.indexOf(e)>-1?aC("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const t of this._children)t.parent=e;this._children=[],e.removeChild(this),e.parent.removeChild(e),this.parent=t,e.parent=this}}class yR extends bR{constructor(e,t,n,r){super(e,t),this.type=n,this.refCounts=r,this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const e=new this.constructor;return e.debugName="clone_"+this.debugName,e._source=this._source,e._name="clone_"+this._name,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash="Output "+dM()),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}class vR extends bR{constructor(e,t){super(e),this.formula=t}clone(){return new vR(null,CD(this.formula))}static makeFromEncoding(e,t){const n=t.reduceFieldDef((e,n,r)=>{const{field:i,timeUnit:o}=n,a=OL(t)?t.encoding[sS(r)]:void 0,s=OL(t)&&Dz(r,n,a,t.stack,t.markDef,t.config);if(o){const t=Yz(n,{forAs:!0});e[$D({as:t,field:i,timeUnit:o})]=Object.assign({as:t,field:i,timeUnit:o},s?{band:!0}:{})}return e},{});return VD(n)?null:new vR(e,n)}static makeFromTransform(e,t){const n=Object.assign({},t),{timeUnit:r}=n,i=bD(n,["timeUnit"]),o=OC(r),a=Object.assign(Object.assign({},i),{timeUnit:o});return new vR(e,{[$D(a)]:a})}merge(e){this.formula=Object.assign({},this.formula);for(const t in e.formula)this.formula[t]&&!e.formula[t].band||(this.formula[t]=e.formula[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,r]of KD(this.formula))e.has(r.as)||(t[n]=r);this.formula=t}producedFields(){return new Set(JD(this.formula).map(e=>e.as))}dependentFields(){return new Set(JD(this.formula).map(e=>e.field))}hash(){return"TimeUnit "+$D(this.formula)}assemble(){const e=[];for(const t of JD(this.formula)){const{field:n,as:r,timeUnit:i}=t,o=OC(i),{unit:a,utc:s}=o,u=bD(o,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:aM(n),type:"timeunit"},a?{units:yC(a)}:{}),s?{timezone:"utc"}:{}),u),{as:[r,r+"_end"]}))}return e}}class xR{constructor(...e){this.items=e,this.hasChannel={},this.hasField={}}}const _R={has:e=>"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!h$(e.bind),parse:(e,t,n,r)=>{r.on||delete t.events,r.clear||delete t.clear},topLevelSignals:(e,t,n)=>{const r=t.name,i=t.project,o=t.bind,a=t.init&&t.init[0],s=mR.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((e,i)=>{var u,l;const c=QD(`${r}_${e.field}`);n.filter(e=>e.name===c).length||n.unshift(Object.assign(Object.assign({name:c},a?{init:$R(a[i])}:{value:null}),{on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${Object(Z.ab)(e.field)}] : null`}]:[],bind:null!==(l=null!==(u=o[e.field])&&void 0!==u?u:o[e.channel])&&void 0!==l?l:o}))}),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter(e=>e.name===r+YR)[0],a=r+"_tuple_fields",s=i.items.map(e=>QD(`${r}_${e.field}`)),u=s.map(e=>e+" !== null").join(" && ");return s.length&&(o.update=`${u} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},OR={has:e=>"multi"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+"_toggle",value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+YR,r=t.name+"_toggle";return`${r} ? null : ${n}, `+("global"===t.resolve?r+" ? null : true, ":`${r} ? null : {unit: ${JR(e)}}, `)+`${r} ? ${n} : null`}},wR={has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=Object(Z.I)(n.clear)?Kj(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>{if(_R.has(t))for(const e of t.project.items){const r=n.findIndex(n=>n.name===QD(`${t.name}_${e.field}`));-1!==r&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(e,r){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:r})}if("interval"===t.type)for(const e of t.project.items){const t=n.findIndex(t=>t.name===e.signals.visual);if(r(t,"[0, 0]"),-1===t){r(n.findIndex(t=>t.name===e.signals.data),"null")}}else{let e=n.findIndex(e=>e.name===t.name+YR);r(e,"null"),OR.has(t)&&(e=n.findIndex(e=>e.name===t.name+"_toggle"),r(e,"false"))}return n}},jR={has:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!_S(i))continue;const o=e.getScaleComponent(i),a=o?o.get("type"):void 0;if(!o||!mF(a)){aC("Scale bindings are currently only supported for scales with unbinned, continuous domains.");continue}const s={selection:t.name,field:r.field};o.set("selectionExtent",s,!0),n.push(r)}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter(e=>0===n.filter(t=>t.name===e.signals.data).length);if(!e.parent||ER(e)||0===r.length)return n;const i=n.filter(e=>e.name===t.name)[0];let o=i.update;if(o.indexOf(GR)>=0)i.update=`{${r.map(e=>`${Object(Z.ab)(e.field)}: ${e.signals.data}`).join(", ")}}`;else{for(const e of r){const t=`${Object(Z.ab)(e.field)}: ${e.signals.data}`;o.indexOf(t)<0&&(o=`${o.substring(0,o.length-1)}, ${t}}`)}i.update=o}return n.concat(r.map(e=>({name:e.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!ER(e))for(const e of t.scales){const t=n.filter(t=>t.name===e.signals.data)[0];t.push="outer",delete t.value,delete t.update}return n}};function kR(e,t){return`domain(${Object(Z.ab)(e.scaleName(t))})`}function ER(e){var t;return e.parent&&kL(e.parent)&&(null!==(t=!e.parent.parent)&&void 0!==t?t:ER(e.parent.parent))}const AR={has:e=>{const t="global"===e.resolve&&e.bind&&h$(e.bind),n=1===e.project.items.length&&"_vgsid_"!==e.project.items[0].field;return t&&!n&&aC("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,t,n,r)=>{var i;if(r.on||delete t.events,r.clear||delete t.clear,r.on||r.clear){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events)n.filter=Object(Z.i)(null!==(i=n.filter)&&void 0!==i?i:[]),n.filter.indexOf(e)<0&&n.filter.push(e)}const o=p$(t.bind)?t.bind.legend:"click",a=Object(Z.I)(o)?Kj(o,"view"):Object(Z.i)(o);t.bind={legend:{merge:a}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=p$(t.bind)&&t.bind.legend,o=e=>t=>{const n=CD(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const a=QD(e.field)+"_legend",s=`${r}_${a}`;if(0===n.filter(e=>e.name===s).length){const e=i.merge.map(o(a+"_symbols")).concat(i.merge.map(o(a+"_labels"))).concat(i.merge.map(o(a+"_entries")));n.unshift(Object.assign(Object.assign({name:s},t.init?{}:{value:null}),{on:[{events:e,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:"!event.item || !datum ? null : "+s,force:!0}]}))}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find(e=>e.name===r+YR),a=r+"_tuple_fields",s=i.items.filter(e=>e.hasLegend).map(e=>QD(`${r}_${QD(e.field)}_legend`)),u=`${s.map(e=>e+" !== null").join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&s.length>0?o.on.push({events:s.map(e=>({signal:e})),update:u}):s.length>0&&(o.update=u,delete o.value,delete o.on);const l=n.find(e=>e.name===r+"_toggle"),c=p$(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push(Object.assign(Object.assign({},l.on[0]),{events:c})):l.on[0].events=c),n}};const DR="_translate_delta",MR={has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const r=t.name,i=jR.has(t),o=r+"_translate_anchor",{x:a,y:s}=t.project.hasChannel;let u=Kj(t.translate,"scope");return i||(u=u.map(e=>(e.between[0].markname=r+PR,e))),n.push({name:o,value:{},on:[{events:u.map(e=>e.between[0]),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(i?kR(e,"x"):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(i?kR(e,"y"):`slice(${s.signals.visual})`):"")+"}"}]},{name:r+DR,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&SR(e,t,a,"width",n),void 0!==s&&SR(e,t,s,"height",n),n}};function SR(e,t,n,r,i){var o;const a=t.name,s=a+"_translate_anchor",u=a+DR,l=n.channel,c=jR.has(t),f=i.filter(e=>e.name===n.signals[c?"data":"visual"])[0],d=e.getSizeSignalRef(r).signal,h=e.getScaleComponent(l),p=h.get("type"),g=`${s}.extent_${l}`,m=`${c?"log"===p?"panLog":"pow"===p?"panPow":"panLinear":"panLinear"}(${g}, ${`${c&&"x"===l?"-":""}${u}.${l} / `+(c?""+d:`span(${g})`)}`+(c&&"pow"===p?", "+(null!==(o=h.get("exponent"))&&void 0!==o?o:1):"")+")";f.on.push({events:{signal:u},update:c?m:`clampRange(${m}, 0, ${d})`})}const CR={has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=jR.has(t),o=r+"_zoom_delta",{x:a,y:s}=t.project.hasChannel,u=Object(Z.ab)(e.scaleName("x")),l=Object(Z.ab)(e.scaleName("y"));let c=Kj(t.zoom,"scope");return i||(c=c.map(e=>(e.markname=r+PR,e))),n.push({name:r+"_zoom_anchor",on:[{events:c,update:i?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(e=>!!e).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&FR(e,t,a,"width",n),void 0!==s&&FR(e,t,s,"height",n),n}};function FR(e,t,n,r,i){var o;const a=t.name,s=n.channel,u=jR.has(t),l=i.filter(e=>e.name===n.signals[u?"data":"visual"])[0],c=e.getSizeSignalRef(r).signal,f=e.getScaleComponent(s),d=f.get("type"),h=u?kR(e,s):l.name,p=a+"_zoom_delta",g=`${u?"log"===d?"zoomLog":"pow"===d?"zoomPow":"zoomLinear":"zoomLinear"}(${h}, ${`${a}_zoom_anchor.${s}`}, ${p}`+(u&&"pow"===d?", "+(null!==(o=f.get("exponent"))&&void 0!==o?o:1):"")+")";l.on.push({events:{signal:p},update:u?g:`clampRange(${g}, 0, ${c})`})}const zR=[{has:()=>!0,parse:(e,t,n)=>{var r,i,o;const a=t.name,s=null!==(r=t.project)&&void 0!==r?r:t.project=new xR,u={},l={},c=new Set,f=(e,t)=>{const n="visual"===t?e.channel:e.field;let r=QD(`${a}_${n}`);for(let e=1;c.has(r);e++)r=QD(`${a}_${n}_${e}`);return c.add(r),{[t]:r}};if(!n.fields&&!n.encodings){const t=e.config.selection[n.type];if(n.init)for(const e of Object(Z.i)(n.init))for(const r of XD(e))tS[r]?(n.encodings||(n.encodings=[])).push(r):"interval"===n.type?(aC('Interval selections should be initialized using "x" and/or "y" keys.'),n.encodings=t.encodings):(n.fields||(n.fields=[])).push(r);else n.encodings=t.encodings,n.fields=t.fields}for(const e of null!==(i=n.fields)&&void 0!==i?i:[]){const t={type:"E",field:e};t.signals=Object.assign({},f(t,"data")),s.items.push(t),s.hasField[e]=t}for(const r of null!==(o=n.encodings)&&void 0!==o?o:[]){const n=e.fieldDef(r);if(n){let i=n.field;if(n.aggregate){aC(PS(r,n.aggregate));continue}if(!i){aC(RS(r));continue}if(n.timeUnit){i=e.vgField(r);const t={timeUnit:n.timeUnit,as:i,field:n.field};l[$D(t)]=t}if(!u[i]){let o="E";if("interval"===t.type){mF(e.getScaleComponent(r).get("type"))&&(o="R")}else n.bin&&(o="R-RE");const a={field:i,channel:r,type:o};a.signals=Object.assign(Object.assign({},f(a,"data")),f(a,"visual")),s.items.push(u[i]=a),s.hasField[i]=s.hasChannel[r]=u[i]}}else aC(RS(r))}if(n.init){const e=e=>s.items.map(t=>void 0!==e[t.channel]?e[t.channel]:e[t.field]);if("interval"===n.type)t.init=e(n.init);else{const r=Object(Z.i)(n.init);t.init=r.map(e)}}VD(l)||(s.timeUnit=new vR(null,l))},signals:(e,t,n)=>{const r=t.name+"_tuple_fields";return n.filter(e=>e.name===r).length>0?n:n.concat({name:r,value:t.project.items.map(e=>{const t=bD(e,["signals","hasLegend"]);return t.field=aM(t.field),t})})}},OR,jR,AR,MR,CR,_R,mR,wR];function TR(e,t){for(const n of zR)n.has(e)&&t(n)}function $R(e,t=!0,n=Z.y){if(Object(Z.B)(e)){const r=e.map(e=>$R(e,t,n));return t?`[${r.join(", ")}]`:r}return sC(e)?n(t?hC(e):function(e){const t=dC(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(JSON.stringify(e)):e}function NR(e,t){return XR(e,(n,r)=>{t=r.marks?r.marks(e,n,t):t,TR(n,r=>{r.marks&&(t=r.marks(e,n,t))})}),t}function RR(e){return e.map(e=>(e.on&&!e.on.length&&delete e.on,e))}const PR="_brush",BR={signals:(e,t)=>{const n=t.name,r=n+"_tuple_fields",i=jR.has(t),o=[],a=[],s=[];if(t.translate&&!i){const e="!event.item || event.item.mark.name !== "+Object(Z.ab)(n+PR);LR(t,(t,n)=>{var r;const i=Object(Z.i)(null!==(r=n.between[0].filter)&&void 0!==r?r:n.between[0].filter=[]);return i.indexOf(e)<0&&i.push(e),t})}t.project.items.forEach((n,r)=>{const i=n.channel;if("x"!==i&&"y"!==i)return void aC("Interval selections only support x and y encoding channels.");const u=t.init?t.init[r]:null,l=function(e,t,n,r){const i=n.channel,o=n.signals.visual,a=n.signals.data,s=jR.has(t),u=Object(Z.ab)(e.scaleName(i)),l=e.getScaleComponent(i),c=l?l.get("type"):void 0,f=e=>`scale(${u}, ${e})`,d=e.getSizeSignalRef("x"===i?"width":"height").signal,h=i+"(unit)",p=LR(t,(e,t)=>[...e,{events:t.between[0],update:`[${h}, ${h}]`},{events:t,update:`[${o}[0], clamp(${h}, 0, ${d})]`}]);return p.push({events:{signal:t.name+"_scale_trigger"},update:mF(c)?`[${f(a+"[0]")}, ${f(a+"[1]")}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:$R(r,!0,f)}:{value:[]}),{on:p}),Object.assign(Object.assign({name:a},r?{init:$R(r)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${u}, ${o})`}]})]}(e,t,n,u),c=n.signals.data,f=n.signals.visual,d=Object(Z.ab)(e.scaleName(i)),h=mF(e.getScaleComponent(i).get("type"))?"+":"";o.push(...l),a.push(c),s.push({scaleName:e.scaleName(i),expr:`(!isArray(${c}) || (${h}invert(${d}, ${f})[0] === ${h}${c}[0] && ${h}invert(${d}, ${f})[1] === ${h}${c}[1]))`})}),i||o.push({name:n+"_scale_trigger",value:{},on:[{events:s.map(e=>({scale:e.scaleName})),update:s.map(e=>e.expr).join(" && ")+` ? ${n+"_scale_trigger"} : {}`}]});const u=t.init,l=`unit: ${JR(e)}, fields: ${r}, values`;return o.concat(Object.assign(Object.assign({name:n+YR},u?{init:`{${l}: ${$R(u)}}`}:{}),{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+` ? {${l}: [${a}]} : null`}]}))},modifyExpr:(e,t)=>t.name+YR+", "+("global"===t.resolve?"true":`{unit: ${JR(e)}}`),marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,a=i&&i.signals.visual,s=o&&o.signals.visual,u=`data(${Object(Z.ab)(t.name+WR)})`;if(jR.has(t))return n;const l={x:void 0!==i?{signal:a+"[0]"}:{value:0},y:void 0!==o?{signal:s+"[0]"}:{value:0},x2:void 0!==i?{signal:a+"[1]"}:{field:{group:"width"}},y2:void 0!==o?{signal:s+"[1]"}:{field:{group:"height"}}};if("global"===t.resolve)for(const t of XD(l))l[t]=[Object.assign({test:`${u}.length && ${u}[0].unit === ${JR(e)}`},l[t]),{value:0}];const c=t.mark,{fill:f,fillOpacity:d,cursor:h}=c,p=bD(c,["fill","fillOpacity","cursor"]),g=XD(p).reduce((e,t)=>(e[t]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter(e=>e).join(" && "),value:p[t]},{value:null}],e),{});return[{name:r+PR+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:f},fillOpacity:{value:d}},update:l}},...n,{name:r+PR,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},h?{cursor:{value:h}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},l),g)}}]}};function LR(e,t){return e.events.reduce((e,n)=>n.between?t(e,n):(aC(n+" is not an ordered event stream for interval selections."),e),[])}function IR(e,t){const n=t.name,r=n+"_tuple_fields",i=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=i.items.map(t=>{const n=e.fieldDef(t.channel);return n&&n.bin?`[${o}[${Object(Z.ab)(e.vgField(t.channel,{}))}], ${o}[${Object(Z.ab)(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${o}[${Object(Z.ab)(t.field)}]`}).join(", "),s=`unit: ${JR(e)}, fields: ${r}, values`,u=t.events;return[{name:n+YR,on:u?[{events:u,update:`datum && item().mark.marktype !== 'group' ? {${s}: [${a}]} : null`,force:!0}]:[]}]}const UR={signals:IR,modifyExpr:(e,t)=>t.name+YR+", "+("global"===t.resolve?"null":`{unit: ${JR(e)}}`)},qR={signals:IR,modifyExpr:(e,t)=>t.name+YR+", "+("global"===t.resolve?"true":`{unit: ${JR(e)}}`)},WR="_store",YR="_tuple",HR="_modify",GR="vlSelectionResolve",VR={single:qR,multi:UR,interval:BR};function XR(e,t){const n=e.component.selection;if(n)for(const e of JD(n)){if(!0===t(e,VR[e.type]))break}}function JR(e,{escape:t}={escape:!0}){let n=t?Object(Z.ab)(e.name):e.name;const r=function(e){let t=e.parent;for(;t&&!wL(t);)t=t.parent;return t}(e);if(r){const{facet:e}=r;for(const t of KM)e[t]&&(n+=` + '__facet_${t}_' + (facet[${Object(Z.ab)(r.vgField(t))}])`)}return n}function KR(e){let t=!1;return XR(e,e=>{t=t||e.project.items.some(e=>"_vgsid_"===e.field)}),t}function ZR(e){const t=rO(e),n=new Set;return t.visit(e=>{"MemberExpression"===e.type&&function e(t){return"MemberExpression"===t.object.type?e(t.object):"datum"===t.object.name}(e)&&n.add(function e(t){const n=[];return"Identifier"===t.type?[t.name]:"Literal"===t.type?[t.value]:("MemberExpression"===t.type&&(n.push(...e(t.object)),n.push(...e(t.property))),n)}(e).slice(1).join("."))}),n}class QR extends bR{constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=nP(this.model,this.filter,this),this._dependentFields=ZR(this.expr)}clone(){return new QR(null,this.model,CD(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter "+this.expr}}function eP(e,t,n,r="datum"){const i=[];const o=eM(t,(function(t){const o=QD(t),a=e.getSelectionComponent(o,t),s=Object(Z.ab)(o+WR);if(a.project.timeUnit){const t=null!=n?n:e.component.data.raw,r=a.project.timeUnit.clone();t.parent?r.insertAsParentOf(t):t.parent=r}return"none"!==a.empty&&i.push(s),`vlSelectionTest(${s}, ${r}`+("global"===a.resolve?")":`, ${Object(Z.ab)(a.resolve)})`)}));return(i.length?"!("+i.map(e=>`length(data(${e}))`).join(" || ")+") || ":"")+`(${o})`}function tP(e,t){const n=t.encoding;let r=t.field;if(n||r){if(n&&!r){const i=e.project.items.filter(e=>e.channel===n);!i.length||i.length>1?(r=e.project.items[0].field,aC((i.length?"Multiple ":"No ")+`matching ${Object(Z.ab)(n)} encoding found for selection ${Object(Z.ab)(t.selection)}. `+`Using "field": ${Object(Z.ab)(r)}.`)):r=i[0].field}}else r=e.project.items[0].field,e.project.items.length>1&&aC(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${Object(Z.ab)(r)}.`);return`${e.name}[${Object(Z.ab)(r)}]`}function nP(e,t,n){return eM(t,t=>Object(Z.I)(t)?t:function(e){return null==e?void 0:e.selection}(t)?eP(e,t.selection,n):PC(t))}function rP(e,t,n,r){var i,o,a;e.encode=null!==(i=e.encode)&&void 0!==i?i:{},e.encode[t]=null!==(o=e.encode[t])&&void 0!==o?o:{},e.encode[t].update=null!==(a=e.encode[t].update)&&void 0!==a?a:{},e.encode[t].update[n]=r}function iP(e,t,n,r={header:!1}){var i,o;const a=e.combine(),{disable:s,orient:u,scale:l,labelExpr:c,title:f,zindex:d}=a,h=bD(a,["disable","orient","scale","labelExpr","title","zindex"]);if(!s){for(const e in h){const n=_M[e],r=h[e];if(n&&n!==t&&"both"!==n)delete h[e];else if(vM(r)){const{condition:t}=r,n=bD(r,["condition"]),i=Object(Z.i)(t),o=yM[e];if(o){const{vgProp:t,part:r}=o;rP(h,r,t,[...i.map(e=>{const{test:t}=e,n=bD(e,["test"]);return Object.assign({test:nP(null,t)},n)}),n]),delete h[e]}else if(null===o){const t={signal:i.map(e=>{const{test:t}=e,n=bD(e,["test"]);return`${nP(null,t)} ? ${yT(n)} : `}).join("")+yT(n)};h[e]=t}}else if(wC(r)){const t=yM[e];if(t){const{vgProp:n,part:i}=t;rP(h,i,n,r),delete h[e]}}}if("grid"===t){if(!h.grid)return;if(h.encode){const{grid:e}=h.encode;h.encode=Object.assign({},e?{grid:e}:{}),VD(h.encode)&&delete h.encode}return Object.assign(Object.assign({scale:l,orient:u},h),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:cM(d,0)})}{if(!r.header&&e.mainExtracted)return;if(void 0!==c){let e=c;(null===(o=null===(i=h.encode)||void 0===i?void 0:i.labels)||void 0===o?void 0:o.update)&&wC(h.encode.labels.update.text)&&(e=sM(c,"datum.label",h.encode.labels.update.text.signal)),rP(h,"labels","text",{signal:e})}if(null===h.labelAlign&&delete h.labelAlign,h.encode){for(const t of xM)e.hasAxisPart(t)||delete h.encode[t];VD(h.encode)&&delete h.encode}const t=function(e,t){if(e)return Object(Z.B)(e)&&!hT(e)?e.map(e=>Qz(e,t)).join(", "):e}(f,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:l,orient:u,grid:!1},t?{title:t}:{}),h),!1===n.aria?{aria:!1}:{}),{zindex:cM(d,0)})}}}function oP(e){const{axes:t}=e.component,n=[];for(const r of dS)if(t[r])for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const t="x"===r?"height":"width",i=e.getSizeSignalRef(t).signal;t!==i&&n.push({name:t,update:i})}return n}function aP(e,t,n,r){return Object.assign.apply(null,[{},...e.map(e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",i=t["x"===n?"axisBottom":"axisLeft"]||{},o=t["x"===n?"axisTop":"axisRight"]||{},a=new Set([...XD(i),...XD(o)]),s={};for(const t of a.values())s[t]={signal:`${r.signal} === "${e}" ? ${vT(i[t])} : ${vT(o[t])}`};return s}return t[e]})])}function sP(e,t,n,r){const i="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:t in cF?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[];const o="x"===e?"axisX":"axisY",a=wC(n)?"axisOrient":"axis"+nM(n),s=[...i,...i.map(e=>o+e.substr(4))],u=["axis",a,o];return{vlOnlyAxisConfig:aP(s,r,e,n),vgAxisConfig:aP(u,r,e,n),axisConfigStyle:uP([...u,...s],r)}}function uP(e,t){var n;const r=[{}];for(const i of e){let e=null===(n=t[i])||void 0===n?void 0:n.style;if(e){e=Object(Z.i)(e);for(const n of e)r.push(t.style[n])}}return Object.assign.apply(null,r)}function lP(e,t,n,r={}){var i;const o=jT(e,n,t);if(void 0!==o)return{configFrom:"style",configValue:o};for(const t of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==(null===(i=r[t])||void 0===i?void 0:i[e]))return{configFrom:t,configValue:r[t][e]};return{}}const cP={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{const{format:r,formatType:i}=n;return cz(e,e.type,r,i,t,!0)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return fz(r,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>{var r;return(!Fz(e)||!DS(e.bin))&&(null!==(r=t.grid)&&void 0!==r?r:function(e,t){return!gF(e)&&Fz(t)&&!AS(null==t?void 0:t.bin)}(n,e))},gridScale:({model:e,channel:t})=>function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n);return}(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||hP(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||dP(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>{var r;return null!==(r=e.labelFlush)&&void 0!==r?r:function(e,t){if("x"===t&&RD(["quantitative","temporal"],e))return!0;return}(t.type,n)},labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{var r;return null!==(r=e.labelOverlap)&&void 0!==r?r:function(e,t,n,r){if(n&&!Object(Z.G)(r)||"nominal"!==e&&"ordinal"!==e)return"log"!==t||"greedy";return}(t.type,n,Fz(t)&&!!t.timeUnit,Fz(t)?t.sort:void 0)},orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{var o;const a="x"===e?"width":"y"===e?"height":void 0,s=a?t.getSizeSignalRef(a):void 0;return null!==(o=n.tickCount)&&void 0!==o?o:function({fieldOrDatumDef:e,scaleType:t,size:n,values:r}){var i;if(!r&&!gF(t)&&"log"!==t){if(Fz(e)){if(AS(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&RD(["month","hours","day","quarter"],null===(i=OC(e.timeUnit))||void 0===i?void 0:i.unit))return}return{signal:`ceil(${n.signal}/40)`}}return}({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;const r=pP(t,n);if(void 0!==r)return r;const i=t.typedFieldDef(n),o="x"===n?"x2":"y2",a=t.fieldDef(o);return ET(i?[kz(i)]:[],Fz(a)?[kz(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function(e,t){const n=e.values;if(Object(Z.B)(n))return cT(t,n);if(wC(n))return n;return}(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>{var r;return null!==(r=e.zindex)&&void 0!==r?r:function(e,t){if("rect"===e&&Hz(t))return 1;return 0}(n,t)}};function fP(e){return`(((${e.signal} % 360) + 360) % 360)`}function dP(e,t,n,r){if(void 0!==e){if("x"===n){if(wC(e)){const n=fP(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${wC(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45{if(Lz(t)&&_z(t.sort)){const{field:r,timeUnit:i}=t,o=t.sort,a=o.map((e,t)=>`${PC({field:r,timeUnit:i,equal:e})} ? ${t} : `).join("")+o.length;e=new gP(e,{calculate:a,as:mP(t,n,{forAs:!0})})}}),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return"Calculate "+$D(this.transform)}}function mP(e,t,n){return Yz(e,Object.assign({prefix:t,suffix:"sort_index"},null!=n?n:{}))}function bP(e,t){return RD(["top","bottom"],t)?"column":RD(["left","right"],t)||"row"===e?"row":"column"}function yP(e,t,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return cM((t||{})[e],i[e],n.header[e])}function vP(e,t,n,r){const i={};for(const o of e){const e=yP(o,t||{},n,r);void 0!==e&&(i[o]=e)}return i}const xP=["row","column"],_P=["header","footer"];function OP(e,t){const n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=vP(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),u=bP(t,s),l=mM(a);return{name:t+"-title",type:"group",role:u+"-title",title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===t?{orient:"left"}:{}),{style:"guide-title"}),jP(l,u)),wP(u,l,o)),CP(r,i,t,s$,o$))}}function wP(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=hP(t,"row"===e?"left":"top","row"===e?"y":"x");return r?{align:r}:{}}function jP(e,t){const n=dP(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function kP(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of _P)if(n[i])for(const o of n[i]){const a=DP(e,t,i,n,o);null!=a&&r.push(a)}return r}function EP(e,t){var n;const{sort:r}=e;return xz(r)?{field:Yz(r,{expr:"datum"}),order:null!==(n=r.order)&&void 0!==n?n:"ascending"}:Object(Z.B)(r)?{field:mP(e,t,{expr:"datum"}),order:"ascending"}:{field:Yz(e,{expr:"datum"}),order:null!=r?r:"ascending"}}function AP(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=vP(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=sz({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,c=bP(t,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:u?sM(sM(u,"datum.label",l),"datum.value",Yz(e,{expr:"parent"})):l}},"row"===t?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),jP(o,c)),wP(c,o,a)),CP(n,e,t,u$,a$))}function DP(e,t,n,r,i){if(i){let o=null;const{facetFieldDef:a}=r,s=e.config?e.config:void 0;if(a&&i.labels){const{labelOrient:e}=vP(["labelOrient"],a.header,s,t);("row"===t&&!RD(["top","bottom"],e)||"column"===t&&!RD(["left","right"],e))&&(o=AP(a,t,s))}const u=wL(e)&&!Oz(e.facet),l=i.axes,c=(null==l?void 0:l.length)>0;if(o||c){const s="row"===t?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`},r.facetFieldDef?{from:{data:e.getName(t+"_domain")},sort:EP(a,t)}:{}),c&&u?{from:{data:e.getName("facet_domain_"+t)}}:{}),o?{title:o}:{}),i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{}),c?{axes:l}:{})}}return null}const MP={column:{start:0,end:1},row:{start:1,end:0}};function SP(e,t){return MP[t][e]}function CP(e,t,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=yP(a,null==t?void 0:t.header,e,n);void 0!==r&&(o[i[a]]=r)}return o}function FP(e){return[...zP(e,"width"),...zP(e,"height"),...zP(e,"childWidth"),...zP(e,"childHeight")]}function zP(e,t){const n="width"===t?"x":"y",r=e.component.layoutSize.get(t);if(!r||"merged"===r)return[];const i=e.getSizeSignalRef(t).signal;if("step"===r){const t=e.getScaleComponent(n);if(t){const r=t.get("type"),o=t.get("range");if(gF(r)&&jC(o)){const r=e.scaleName(n);if(wL(e.parent)){if("independent"===e.parent.component.resolve.scale[n])return[TP(r,o)]}return[TP(r,o),{name:i,update:$P(r,t,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==r){const t=i.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",r=`isFinite(${n}) ? ${n} : ${_$(e.config.view,t?"width":"height")}`;return[{name:i,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:i,value:r}]}function TP(e,t){return{name:e+"_step",value:t.step}}function $P(e,t,n){const r=t.get("type"),i=t.get("padding"),o=cM(t.get("paddingOuter"),i);let a=t.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,`bandspace(${n}, ${vT(a)}, ${vT(o)}) * ${e}_step`}function NP(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function RP(e,t){return XD(e).reduce((n,r)=>{const i=e[r];return Object.assign(Object.assign({},n),qN(t,i,r,e=>bT(e.value)))},{})}function PP(e,t){if(kL(t)||wL(t))return"shared";if(jL(t))return hS(e)?"independent":"shared";throw new Error("invalid model type for resolve")}function BP(e,t){const n=e.scale[t],r=hS(t)?"axis":"legend";return"independent"===n?("shared"===e[r][t]&&aC(function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}(t)),"independent"):e[r][t]||"shared"}const LP=Object.assign(Object.assign({},{aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1}),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),IP=XD(LP);class UP extends cN{}const qP={symbols:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){var a,s,u,l,c,f,d,h;if("symbol"!==o)return;const{markDef:p,encoding:g,config:m,mark:b}=n,y=p.filled&&"trail"!==b;let v=Object.assign(Object.assign({},function(e,t,n){for(const r of n){const n=OT(r,t.markDef,t.config);void 0!==n&&(e[r]=bT(n))}return e}({},n,YF)),KN(n,{filled:y}));const x=null!==(a=i.get("symbolOpacity"))&&void 0!==a?a:m.legend.symbolOpacity,_=null!==(s=i.get("symbolFillColor"))&&void 0!==s?s:m.legend.symbolFillColor,O=null!==(u=i.get("symbolStrokeColor"))&&void 0!==u?u:m.legend.symbolStrokeColor,w=void 0===x?null!==(l=WP(g.opacity))&&void 0!==l?l:p.opacity:void 0;if(v.fill)if("fill"===r||y&&r===LM)delete v.fill;else if(v.fill.field)_?delete v.fill:(v.fill=bT(null!==(c=m.legend.symbolBaseFillColor)&&void 0!==c?c:"black"),v.fillOpacity=bT(null!=w?w:1));else if(Object(Z.B)(v.fill)){const e=null!==(h=null!==(d=YP(null!==(f=g.fill)&&void 0!==f?f:g.color))&&void 0!==d?d:p.fill)&&void 0!==h?h:y&&p.color;e&&(v.fill=bT(e))}if(v.stroke)if("stroke"===r||!y&&r===LM)delete v.stroke;else if(v.stroke.field||O)delete v.stroke;else if(Object(Z.B)(v.stroke)){const e=cM(YP(g.stroke||g.color),p.stroke,y?p.color:void 0);e&&(v.stroke={value:e})}if("opacity"!==r){const e=Fz(t)&&GP(n,i,t);e?v.opacity=[Object.assign({test:e},bT(null!=w?w:1)),bT(m.legend.unselectedOpacity)]:w&&(v.opacity=bT(w))}return v=Object.assign(Object.assign({},v),e),VD(v)?void 0:v},gradient:function(e,{model:t,legendType:n,legendCmpt:r}){var i;if("gradient"!==n)return;const{config:o,markDef:a,encoding:s}=t;let u={};const l=void 0===(null!==(i=r.get("gradientOpacity"))&&void 0!==i?i:o.legend.gradientOpacity)?WP(s.opacity)||a.opacity:void 0;l&&(u.opacity=bT(l));return u=Object.assign(Object.assign({},u),e),VD(u)?void 0:u},labels:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},a=n.config,s=Fz(t)?GP(n,i,t):void 0,u=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o,f=oz(c)?lz({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:a}):void 0,d=Object.assign(Object.assign(Object.assign({},u?{opacity:u}:{}),f?{text:f}:{}),e);return VD(d)?void 0:d},entries:function(e,{legendCmpt:t}){const n=t.get("selections");return(null==n?void 0:n.length)?Object.assign(Object.assign({},e),{fill:{value:"transparent"}}):e}};function WP(e){return HP(e,(e,t)=>Math.max(e,t.value))}function YP(e){return HP(e,(e,t)=>cM(e,t.value))}function HP(e,t){return function(e){const t=e&&e.condition;return!!t&&(Object(Z.B)(t)||Bz(t))}(e)?Object(Z.i)(e.condition).reduce(t,e.value):Bz(e)?e.value:void 0}function GP(e,t,n){const r=t.get("selections");if(!(null==r?void 0:r.length))return;const i=Object(Z.ab)(n.field);return r.map(e=>`(!length(data(${Object(Z.ab)(QD(e)+WR)})) || (${e}[${i}] && indexof(${e}[${i}], datum.value) >= 0))`).join(" || ")}const VP={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return cz(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return fz(r,t,n)},gradientLength:e=>{var t,n;const{legend:r,legendConfig:i}=e;return null!==(n=null!==(t=r.gradientLength)&&void 0!==t?t:i.gradientLength)&&void 0!==n?n:function({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:u}=e;if(bF(i))return"horizontal"===n?"top"===r||"bottom"===r?KP(t,"width",a,o):a:KP(t,"height",u,s);return}(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>{var r,i;return null!==(i=null!==(r=e.labelOverlap)&&void 0!==r?r:t.labelOverlap)&&void 0!==i?i:function(e){if(RD(["quantile","threshold","log"],e))return"greedy";return}(n)},symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>{var i;return null!==(i=e.symbolType)&&void 0!==i?i:function(e,t,n,r){var i;if("shape"!==t){const e=null!==(i=YP(n))&&void 0!==i?i:r;if(e)return e}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(t.type,n,r.shape,t.shape)},title:({fieldOrDatumDef:e,config:t})=>Kz(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(XM(n)&&bF(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>function(e,t){const n=e.values;if(Object(Z.B)(n))return cT(t,n);if(wC(n))return n;return}(t,e)};function XP(e){const{legend:t}=e;return cM(t.type,function({channel:e,timeUnit:t,scaleType:n}){if(XM(e)){if(RD(["quarter","month","day"],t))return"symbol";if(bF(n))return"gradient"}return"symbol"}(e))}function JP({legendConfig:e,legendType:t,orient:n,legend:r}){var i,o;return null!==(o=null!==(i=r.direction)&&void 0!==i?i:e[t?"gradientDirection":"symbolDirection"])&&void 0!==o?o:function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(n,t)}function KP(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function ZP(e){const t=OL(e)?function(e){const{encoding:t}=e,n={};for(const r of[LM,...c$]){const i=nT(t[r]);i&&e.getScaleComponent(r)&&(r===qM&&Fz(i)&&i.type===YC||(n[r]=eB(e,r)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){ZP(r);for(const i of XD(r.component.legends))n.legend[i]=BP(e.component.resolve,i),"shared"===n.legend[i]&&(t[i]=tB(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of XD(t))for(const t of e.children)t.component.legends[r]&&"shared"===n.legend[r]&&delete t.component.legends[r];return t}(e);return e.component.legends=t,t}function QP(e,t,n,r){switch(t){case"disable":return void 0!==n;case"values":return!!(null==n?void 0:n.values);case"title":if("title"===t&&e===(null==r?void 0:r.title))return!0}return e===(n||{})[t]}function eB(e,t){var n,r,i;let o=e.legend(t);const{markDef:a,encoding:s,config:u}=e,l=u.legend,c=new UP({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));!function(e,t,n){var r;const i=null===(r=e.fieldDef(t))||void 0===r?void 0:r.field;XR(e,e=>{var r,o;const a=null!==(r=e.project.hasField[i])&&void 0!==r?r:e.project.hasChannel[t];if(a&&AR.has(e)){const t=null!==(o=n.get("selections"))&&void 0!==o?o:[];t.push(e.name),n.set("selections",t,!1),a.hasLegend=!0}})}(e,t,c);const f=void 0!==o?!o:l.disable;if(c.set("disable",f,void 0!==o),f)return c;o=o||{};const d=e.getScaleComponent(t).get("type"),h=nT(s[t]),p=Fz(h)?null===(n=OC(h.timeUnit))||void 0===n?void 0:n.unit:void 0,g=o.orient||u.legend.orient||"right",m=XP({legend:o,channel:t,timeUnit:p,scaleType:d}),b={legend:o,channel:t,model:e,markDef:a,encoding:s,fieldOrDatumDef:h,legendConfig:l,config:u,scaleType:d,orient:g,legendType:m,direction:JP({legend:o,legendType:m,orient:g,legendConfig:l})};for(const n of IP){if("gradient"===m&&n.startsWith("symbol")||"symbol"===m&&n.startsWith("gradient"))continue;const r=n in VP?VP[n](b):o[n];if(void 0!==r){const i=QP(r,n,o,e.fieldDef(t));(i||void 0===u.legend[n])&&c.set(n,r,i)}}const y=null!==(r=null==o?void 0:o.encoding)&&void 0!==r?r:{},v=c.get("selections"),x={},_={fieldOrDatumDef:h,model:e,channel:t,legendCmpt:c,legendType:m};for(const t of["labels","legend","title","symbols","gradient","entries"]){const n=RP(null!==(i=y[t])&&void 0!==i?i:{},e),r=t in qP?qP[t](n,_):n;void 0===r||VD(r)||(x[t]=Object.assign(Object.assign(Object.assign({},(null==v?void 0:v.length)&&Fz(h)?{name:`${QD(h.field)}_legend_${t}`}:{}),(null==v?void 0:v.length)?{interactive:!!v}:{}),{update:r}))}return VD(x)||c.set("encode",x,!!(null==o?void 0:o.encoding)),c}function tB(e,t){var n,r,i,o;if(!e)return t.clone();const a=e.getWithExplicit("orient"),s=t.getWithExplicit("orient");if(a.explicit&&s.explicit&&a.value!==s.value)return;let u=!1;for(const n of IP){const r=gN(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",(e,t)=>{switch(n){case"symbolType":return nB(e,t);case"title":return DT(e,t);case"type":return u=!0,dN("symbol")}return pN(e,t,n,"legend")});e.setWithExplicit(n,r)}return u&&((null===(r=null===(n=e.implicit)||void 0===n?void 0:n.encode)||void 0===r?void 0:r.gradient)&&tM(e.implicit,["encode","gradient"]),(null===(o=null===(i=e.explicit)||void 0===i?void 0:i.encode)||void 0===o?void 0:o.gradient)&&tM(e.explicit,["encode","gradient"])),e}function nB(e,t){return"circle"===t.value?t:e}function rB(e){const t=e.component.legends,n={};for(const r of XD(t)){const i=e.getScaleComponent(r),o=TD(i.get("domains"));if(n[o])for(const e of n[o]){tB(e,t[r])||n[o].push(t[r])}else n[o]=[t[r].clone()]}return JD(n).flat().map(t=>function(e,t){var n,r,i;const o=e.combine(),{disable:a,labelExpr:s,selections:u}=o,l=bD(o,["disable","labelExpr","selections"]);if(a)return;!1===t.aria&&null==l.aria&&(l.aria=!1);if(null===(n=l.encode)||void 0===n?void 0:n.symbols){const e=l.encode.symbols.update;!e.fill||"transparent"===e.fill.value||e.stroke||l.stroke||(e.stroke={value:"transparent"});for(const t of c$)l[t]&&delete e[t]}l.title||delete l.title;if(void 0!==s){let e=s;(null===(i=null===(r=l.encode)||void 0===r?void 0:r.labels)||void 0===i?void 0:i.update)&&wC(l.encode.labels.update.text)&&(e=sM(s,"datum.label",l.encode.labels.update.text.signal)),function(e,t,n,r){var i,o,a;e.encode=null!==(i=e.encode)&&void 0!==i?i:{},e.encode[t]=null!==(o=e.encode[t])&&void 0!==o?o:{},e.encode[t].update=null!==(a=e.encode[t].update)&&void 0!==a?a:{},e.encode[t].update[n]=r}(l,"labels","text",{signal:e})}return l}(t,e.config)).filter(e=>void 0!==e)}function iB(e){return kL(e)||jL(e)?function(e){return e.children.reduce((e,t)=>e.concat(t.assembleProjections()),oB(e))}(e):oB(e)}function oB(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n;if(t.data){const i={signal:`[${t.size.map(e=>e.signal).join(", ")}]`},o=t.data.reduce((t,n)=>{const r=wC(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return RD(t,r)||t.push(r),t},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]}},n)]}return[Object.assign(Object.assign({name:r},{translate:{signal:"[width / 2, height / 2]"}}),n)]}const aB=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class sB extends cN{constructor(e,t,n,r){super(Object.assign({},t),{name:e}),this.specifiedProjection=t,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function uB(e){e.component.projection=OL(e)?function(e){var t;if(e.hasProjection){const n=e.specifiedProjection,r=!(n&&(null!=n.scale||null!=n.translate)),i=r?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,o=r?function(e){const t=[],{encoding:n}=e;for(const r of[["longitude","latitude"],["longitude2","latitude2"]])(nT(n[r[0]])||nT(n[r[1]]))&&t.push({signal:e.getName("geojson_"+t.length)});e.channelHasField(qM)&&e.typedFieldDef(qM).type===YC&&t.push({signal:e.getName("geojson_"+t.length)});0===t.length&&t.push(e.requestDataName(jN.Main));return t}(e):void 0;return new sB(e.projectionName(!0),Object.assign(Object.assign({},null!==(t=e.config.projection)&&void 0!==t?t:{}),null!=n?n:{}),i,o)}return}(e):function(e){if(0===e.children.length)return;let t;for(const t of e.children)uB(t);const n=BD(e.children,e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=BD(aB,n=>!Object(Z.w)(e.explicit,n)&&!Object(Z.w)(t.explicit,n)||!(!Object(Z.w)(e.explicit,n)||!Object(Z.w)(t.explicit,n)||TD(e.get(n))!==TD(t.get(n))));if(TD(e.size)===TD(t.size)){if(n)return e;if(TD(e.explicit)===TD({}))return t;if(TD(t.explicit)===TD({}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0});if(t&&n){const n=e.projectionName(!0),r=new sB(n,t.specifiedProjection,t.size,CD(t.data));for(const t of e.children){const e=t.component.projection;e&&(e.isFit&&r.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}return r}return}(e)}function lB(e,t){return`${ES(e)}_${t}`}function cB(e,t,n){var r;const i=lB(null!==(r=aT(n,void 0))&&void 0!==r?r:{},t);return e.getName(i+"_bins")}function fB(e,t,n){let r,i;r=function(e){return"as"in e}(e)?Object(Z.I)(e.as)?[e.as,e.as+"_end"]:[e.as[0],e.as[1]]:[Yz(e,{forAs:!0}),Yz(e,{binSuffix:"end",forAs:!0})];const o=Object.assign({},aT(t,void 0)),a=lB(o,e.field),{signal:s,extentSignal:u}=function(e,t){return{signal:e.getName(t+"_bins"),extentSignal:e.getName(t+"_extent")}}(n,a);if(SS(o.extent)){const e=o.extent,t=e.selection;i=tP(n.getSelectionComponent(QD(t),t),e),delete o.extent}return{key:a,binComponent:Object.assign(Object.assign(Object.assign({bin:o,field:e.field,as:[r]},s?{signal:s}:{}),u?{extentSignal:u}:{}),i?{span:i}:{})}}class dB extends bR{constructor(e,t){super(e),this.bins=t}clone(){return new dB(null,CD(this.bins))}static makeFromEncoding(e,t){const n=t.reduceFieldDef((e,n,r)=>{if(Pz(n)&&AS(n.bin)){const{key:i,binComponent:o}=fB(n,n.bin,t);e[i]=Object.assign(Object.assign(Object.assign({},o),e[i]),function(e,t,n,r){var i,o;if(fT(t,n)){const a=OL(e)&&null!==(o=null!==(i=e.axis(n))&&void 0!==i?i:e.legend(n))&&void 0!==o?o:{},s=Yz(t,{expr:"datum"}),u=Yz(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Yz(t,{binSuffix:"range",forAs:!0}),formula:gz(s,u,a.format,a.formatType,r)}}return{}}(t,n,r,t.config))}return e},{});return VD(n)?null:new dB(e,n)}static makeFromTransform(e,t,n){const{key:r,binComponent:i}=fB(t,t.bin,n);return new dB(e,{[r]:i})}merge(e,t){for(const n of XD(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=UD([...this.bins[n].as,...e.bins[n].as],$D)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(JD(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(JD(this.bins).map(e=>e.field))}hash(){return"Bin "+$D(this.bins)}assemble(){return JD(this.bins).flatMap(e=>{const t=[],[n,...r]=e.as,i=e.bin,{extent:o}=i,a=bD(i,["extent"]),s=Object.assign(Object.assign(Object.assign({type:"bin",field:aM(e.field),as:n,signal:e.signal},SS(o)?{extent:null}:{extent:o}),e.span?{span:{signal:`span(${e.span})`}}:{}),a);!o&&e.extentSignal&&(t.push({type:"extent",field:aM(e.field),signal:e.extentSignal}),s.extent={signal:e.extentSignal}),t.push(s);for(const e of r)for(let r=0;r<2;r++)t.push({type:"formula",expr:Yz({field:n[r]},{expr:"datum"}),as:e[r]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t})}}function hB(e,t,n,r){const i=OL(r)?r.encoding[sS(t)]:void 0;if(Pz(n)&&OL(r)&&Dz(t,n,i,r.stack,r.markDef,r.config))e.add(Yz(n,{})),e.add(Yz(n,{suffix:"end"})),n.bin&&fT(n,t)&&e.add(Yz(n,{binSuffix:"range"}));else if(t in HM){const n=function(e){switch(e){case"latitude":return"y";case"latitude2":return"y2";case"longitude":return"x";case"longitude2":return"x2"}}(t);e.add(r.getName(n))}else e.add(Yz(n));return e}class pB extends bR{constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}clone(){return new pB(null,new Set(this.dimensions),CD(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(e,t){let n=!1;t.forEachFieldDef(e=>{e.aggregate&&(n=!0)});const r={},i=new Set;return n?(t.forEachFieldDef((e,n)=>{var o,a,s,u;const{aggregate:l,field:c}=e;if(l)if("count"===l)r["*"]=null!==(o=r["*"])&&void 0!==o?o:{},r["*"].count=new Set([Yz(e,{forAs:!0})]);else{if(DM(l)||MM(l)){const e=DM(l)?"argmin":"argmax",t=l[e];r[t]=null!==(a=r[t])&&void 0!==a?a:{},r[t][e]=new Set([Yz({op:e,field:t},{forAs:!0})])}else r[c]=null!==(s=r[c])&&void 0!==s?s:{},r[c][l]=new Set([Yz(e,{forAs:!0})]);_S(n)&&"unaggregated"===t.scaleDomain(n)&&(r[c]=null!==(u=r[c])&&void 0!==u?u:{},r[c].min=new Set([Yz({field:c,aggregate:"min"},{forAs:!0})]),r[c].max=new Set([Yz({field:c,aggregate:"max"},{forAs:!0})]))}else hB(i,n,e,t)}),i.size+XD(r).length===0?null:new pB(e,i,r)):null}static makeFromTransform(e,t){var n,r,i;const o=new Set,a={};for(const e of t.aggregate){const{op:t,field:i,as:o}=e;t&&("count"===t?(a["*"]=null!==(n=a["*"])&&void 0!==n?n:{},a["*"].count=new Set([o||Yz(e,{forAs:!0})])):(a[i]=null!==(r=a[i])&&void 0!==r?r:{},a[i][t]=new Set([o||Yz(e,{forAs:!0})])))}for(const e of null!==(i=t.groupby)&&void 0!==i?i:[])o.add(e);return o.size+XD(a).length===0?null:new pB(e,o,a)}merge(e){return WD(this.dimensions,e.dimensions)?(function(e,t){var n;for(const r of XD(t)){const i=t[r];for(const t of XD(i))r in e?e[r][t]=new Set([...null!==(n=e[r][t])&&void 0!==n?n:[],...i[t]]):e[r]={[t]:i[t]}}}(this.measures,e.measures),!0):(function(...e){oC.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...XD(this.measures)])}producedFields(){const e=new Set;for(const t of XD(this.measures))for(const n of XD(this.measures[t])){const r=this.measures[t][n];0===r.size?e.add(`${n}_${t}`):r.forEach(e.add,e)}return e}hash(){return"Aggregate "+$D({dimensions:this.dimensions,measures:this.measures})}assemble(){const e=[],t=[],n=[];for(const r of XD(this.measures))for(const i of XD(this.measures[r]))for(const o of this.measures[r][i])n.push(o),e.push(i),t.push("*"===r?null:aM(r));return{type:"aggregate",groupby:[...this.dimensions].map(aM),ops:e,fields:t,as:n}}}class gB extends bR{constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(const e of KM){const n=t.facet[e];if(n){const{bin:r,sort:i}=n;this[e]=Object.assign({name:t.getName(e+"_domain"),fields:[Yz(n),...AS(r)?[Yz(n,{binSuffix:"end"})]:[]]},xz(i)?{sortField:i}:Object(Z.B)(i)?{sortIndexField:mP(n,e)}:{})}}this.childModel=t.child}hash(){let e="Facet";for(const t of KM)this[t]&&(e+=` ${t.charAt(0)}:${$D(this[t])}`);return e}get fields(){var e;const t=[];for(const n of KM)(null===(e=this[n])||void 0===e?void 0:e.fields)&&t.push(...this[n].fields);return t}dependentFields(){const e=new Set(this.fields);for(const t of KM)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of dS){const n=this.childModel.component.scales[t];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(gF(r)&&jC(i)){const n=iL(oL(this.childModel,t));n?e[t]=n:aC(NS(t))}}}return e}assembleRowColumnHeaderData(e,t,n){const r={row:"y",column:"x"}[e],i=[],o=[],a=[];n&&n[r]&&(t?(i.push("distinct_"+n[r]),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push("distinct_"+n[r]));const{sortField:s,sortIndexField:u}=this[e];if(s){const{op:e=mz,field:t}=s;i.push(t),o.push(e),a.push(Yz(s,{forAs:!0}))}else u&&(i.push(u),o.push("max"),a.push(u));return{name:this[e].name,source:null!=t?t:this.data,transform:[Object.assign({type:"aggregate",groupby:this[e].fields},i.length?{fields:i,ops:o,as:a}:{})]}}assembleFacetHeaderData(e){var t,n;const{columns:r}=this.model.layout,{layoutHeaders:i}=this.model.component,o=[],a={};for(const e of xP){for(const r of _P){const o=null!==(t=i[e]&&i[e][r])&&void 0!==t?t:[];for(const t of o)if((null===(n=t.axes)||void 0===n?void 0:n.length)>0){a[e]=!0;break}}if(a[e]){const t=`length(data("${this.facet.name}"))`,n="row"===e?r?{signal:`ceil(${t} / ${r})`}:1:r?{signal:`min(${t}, ${r})`}:{signal:t};o.push({name:`${this.facet.name}_${e}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:s,column:u}=a;return(s||u)&&o.unshift(this.assembleRowColumnHeaderData("facet",null,e)),o}assemble(){var e,t;const n=[];let r=null;const i=this.getChildIndependentFieldsWithStep(),{column:o,row:a,facet:s}=this;if(o&&a&&(i.x||i.y)){r=`cross_${this.column.name}_${this.row.name}`;const o=[].concat(null!==(e=i.x)&&void 0!==e?e:[],null!==(t=i.y)&&void 0!==t?t:[]),a=o.map(()=>"distinct");n.push({name:r,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:o,ops:a}]})}for(const e of[NM,$M])this[e]&&n.push(this.assembleRowColumnHeaderData(e,r,i));if(s){const e=this.assembleFacetHeaderData(i);e&&n.push(...e)}return n}}function mB(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function bB(e){const t={};return function e(t,n){if(DD(t))e(t.not,n);else if(AD(t))for(const r of t.and)e(r,n);else if(ED(t))for(const r of t.or)e(r,n);else n(t)}(e.filter,e=>{var n;if(NC(e)){let r=null;MC(e)?r=gT(e.equal):CC(e)?r=gT(e.lte):SC(e)?r=gT(e.lt):FC(e)?r=gT(e.gt):zC(e)?r=gT(e.gte):TC(e)?r=e.range[0]:$C(e)&&(r=(null!==(n=e.oneOf)&&void 0!==n?n:e.in)[0]),r&&(sC(r)?t[e.field]="date":Object(Z.F)(r)?t[e.field]="number":Object(Z.I)(r)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}}),t}function yB(e){const t={};function n(e){var n;uT(e)?t[e.field]="date":"quantitative"===e.type&&(n=e.aggregate,Object(Z.I)(n)&&RD(["min","max"],n))?t[e.field]="number":lM(e.field)>1?e.field in t||(t[e.field]="flatten"):Lz(e)&&xz(e.sort)&&lM(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((OL(e)||wL(e))&&e.forEachFieldDef((t,r)=>{if(Pz(t))n(t);else{const i=oS(r),o=e.fieldDef(i);n(Object.assign(Object.assign({},t),{type:o.type}))}}),OL(e)){const{mark:n,markDef:r,encoding:i}=e;if(IF(n)&&!e.encoding.order){const e=i["horizontal"===r.orient?"y":"x"];Fz(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}class vB extends bR{constructor(e,t){super(e),this._parse=t}clone(){return new vB(null,CD(this._parse))}hash(){return"Parse "+$D(this._parse)}static makeExplicit(e,t,n){let r={};const i=t.data;return!xN(i)&&i&&i.format&&i.format.parse&&(r=i.format.parse),this.makeWithAncestors(e,r,{},n)}static makeWithAncestors(e,t,n,r){for(const e of XD(n)){const t=r.getWithExplicit(e);void 0!==t.value&&(t.explicit||t.value===n[e]||"derived"===t.value||"flatten"===n[e]?delete n[e]:aC(IS(e,n[e],t.value)))}for(const e of XD(t)){const n=r.get(e);void 0!==n&&(n===t[e]?delete t[e]:aC(IS(e,t[e],n)))}const i=new cN(t,n);r.copyAll(i);const o={};for(const e of XD(i.combine())){const t=i.get(e);null!==t&&(o[e]=t)}return 0===XD(o).length||r.parseNothing?null:new vB(e,o)}get parse(){return this._parse}merge(e){this._parse=Object.assign(Object.assign({},this._parse),e.parse),e.remove()}assembleFormatParse(){const e={};for(const t of XD(this._parse)){const n=this._parse[t];1===lM(t)&&(e[t]=n)}return e}producedFields(){return new Set(XD(this._parse))}dependentFields(){return new Set(XD(this._parse))}assembleTransforms(e=!1){return XD(this._parse).filter(t=>!e||lM(t)>1).map(e=>{const t=function(e,t){const n=rM(e);if("number"===t)return`toNumber(${n})`;if("boolean"===t)return`toBoolean(${n})`;if("string"===t)return`toString(${n})`;if("date"===t)return`toDate(${n})`;if("flatten"===t)return n;if(0===t.indexOf("date:")){return`timeParse(${n},'${mB(t.slice(5,t.length))}')`}if(0===t.indexOf("utc:")){return`utcParse(${n},'${mB(t.slice(4,t.length))}')`}return aC(`Unrecognized parse "${t}".`),null}(e,this._parse[e]);if(!t)return null;return{type:"formula",expr:t,as:uM(e)}}).filter(e=>null!==e)}}class xB extends bR{clone(){return new xB(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set(["_vgsid_"])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:"_vgsid_"}}}class _B extends bR{constructor(e,t){super(e),this.params=t}clone(){return new _B(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return"Graticule "+$D(this.params)}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class OB extends bR{constructor(e,t){super(e),this.params=t}clone(){return new OB(null,this.params)}dependentFields(){return new Set}producedFields(){var e;return new Set([null!==(e=this.params.as)&&void 0!==e?e:"data"])}hash(){return"Hash "+$D(this.params)}assemble(){return Object.assign({type:"sequence"},this.params)}}class wB extends bR{constructor(e){let t;if(super(null),xN(e=null!=e?e:{name:"source"})||(t=e.format?Object.assign({},zD(e.format,["parse"])):{}),yN(e))this._data={values:e.values};else if(bN(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];RD(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else ON(e)?this._data={values:[{type:"Sphere"}]}:(vN(e)||xN(e))&&(this._data={});this._generator=xN(e),e.name&&(this._name=e.name),t&&!VD(t)&&(this._data.format=t)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}var jB;function kB(e){return e instanceof wB||e instanceof _B||e instanceof OB}class EB{constructor(){jB.set(this,void 0),yD(this,jB,!1)}setModified(){yD(this,jB,!0)}get modifiedFlag(){return function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}(this,jB)}}jB=new WeakMap;class AB extends EB{getNodeDepths(e,t,n){n.set(e,t);for(const r of e.children)this.getNodeDepths(r,t+1,n);return n}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort((e,t)=>t[1]-e[1]);for(const e of t)this.run(e[0]);return this.modifiedFlag}}class DB extends EB{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class MB extends DB{mergeNodes(e,t){const n=t.shift();for(const r of t)e.removeChild(r),r.parent=n,r.remove()}run(e){const t=e.children.map(e=>e.hash()),n={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(e,n[t]))}}class SB extends DB{constructor(e){super(),this.requiresSelectionId=e&&KR(e)}run(e){e instanceof xB&&(this.requiresSelectionId&&(kB(e.parent)||e.parent instanceof pB||e.parent instanceof vB)||(this.setModified(),e.remove()))}}class CB extends EB{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof vR&&(n=e.producedFields(),YD(n,t)&&(this.setModified(),e.removeFormulas(t),0===e.producedFields.length&&e.remove()));for(const r of e.children)this.run(r,new Set([...t,...n]))}}class FB extends DB{constructor(){super()}run(e){e instanceof yR&&!e.isRequired()&&(this.setModified(),e.remove())}}class zB extends AB{run(e){if(!(kB(e)||e.numChildren()>1))for(const t of e.children)if(t instanceof vB)if(e instanceof vB)this.setModified(),e.merge(t);else{if(GD(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class TB extends AB{run(e){const t=[...e.children],n=e.children.filter(e=>e instanceof vB);if(e.numChildren()>1&&n.length>=1){const r={},i=new Set;for(const e of n){const t=e.parse;for(const e of XD(t))e in r?r[e]!==t[e]&&i.add(e):r[e]=t[e]}for(const e of i)delete r[e];if(!VD(r)){this.setModified();const n=new vB(e,r);for(const i of t){if(i instanceof vB)for(const e of XD(r))delete i.parse[e];e.removeChild(i),i.parent=n,i instanceof vB&&0===XD(i.parse).length&&i.remove()}}}}}class $B extends AB{run(e){e instanceof yR||e.numChildren()>0||e instanceof gB||(this.setModified(),e.remove())}}class NB extends AB{run(e){const t=e.children.filter(e=>e instanceof vR),n=t.pop();for(const e of t)this.setModified(),n.merge(e)}}class RB extends AB{run(e){const t=e.children.filter(e=>e instanceof pB),n={};for(const e of t){const t=$D(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(const t of XD(n)){const r=n[t];if(r.length>1){const t=r.pop();for(const n of r)t.merge(n)&&(e.removeChild(n),n.parent=t,n.remove(),this.setModified())}}}}class PB extends AB{constructor(e){super(),this.model=e}run(e){const t=!(kB(e)||e instanceof QR||e instanceof vB||e instanceof xB),n=[],r=[];for(const i of e.children)i instanceof dB&&(t&&!GD(e.producedFields(),i.dependentFields())?n.push(i):r.push(i));if(n.length>0){const t=n.pop();for(const e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof dB?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(r.length>1){const e=r.pop();for(const t of r)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}}class BB extends AB{run(e){const t=[...e.children];if(!PD(t,e=>e instanceof yR)||e.numChildren()<=1)return;const n=[];let r;for(const i of t)if(i instanceof yR){let t=i;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof yR))break;t=e}n.push(...t.children),r?(e.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=t,this.setModified()):r=t}else n.push(i);if(n.length){this.setModified();for(const e of n)e.parent.removeChild(e),e.parent=r}}}class LB extends bR{constructor(e,t){super(e),this.transform=t}clone(){return new LB(null,CD(this.transform))}addDimensions(e){this.transform.groupby=UD(this.transform.groupby.concat(e),e=>e)}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map(e=>e.field).filter(e=>void 0!==e).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Yz(e)}hash(){return"JoinAggregateTransform "+$D(this.transform)}assemble(){const e=[],t=[],n=[];for(const r of this.transform.joinaggregate)t.push(r.op),n.push(this.getDefaultName(r)),e.push(void 0===r.field?null:r.field);const r=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:t,fields:e},void 0!==r?{groupby:r}:{})}}class IB extends bR{constructor(e,t){super(e),this._stack=t}clone(){return new IB(null,CD(this._stack))}static makeFromTransform(e,t){const{stack:n,groupby:r,as:i,offset:o="zero"}=t,a=[],s=[];if(void 0!==t.sort)for(const e of t.sort)a.push(e.field),s.push(cM(e.order,"ascending"));const u={field:a,order:s};let l;return l=function(e){return Object(Z.B)(e)&&e.every(e=>Object(Z.I)(e))&&e.length>1}(i)?i:Object(Z.I)(i)?[i,i+"_end"]:[t.stack+"_start",t.stack+"_end"],new IB(e,{stackField:n,groupby:r,offset:o,sort:u,facetby:[],as:l})}static makeFromEncoding(e,t){const n=t.stack,{encoding:r}=t;if(!n)return null;const{groupbyChannel:i,fieldChannel:o,offset:a,impute:s}=n;let u;if(i){u=tT(r[i])}const l=function(e){return e.stack.stackBy.reduce((e,t)=>{const n=Yz(t.fieldDef);return n&&e.push(n),e},[])}(t),c=t.encoding.order;let f;return f=Object(Z.B)(c)||Fz(c)?kT(c):l.reduce((e,t)=>(e.field.push(t),e.order.push("y"===o?"descending":"ascending"),e),{field:[],order:[]}),new IB(e,{dimensionFieldDef:u,stackField:t.vgField(o),facetby:[],stackby:l,sort:f,offset:a,impute:s,as:[t.vgField(o,{suffix:"start",forAs:!0}),t.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return"Stack "+$D(this._stack)}getGroupbyFields(){const{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[Yz(e,{binSuffix:"mid"})]:[Yz(e,{}),Yz(e,{binSuffix:"end"})]:[Yz(e)]:null!=n?n:[]}assemble(){const e=[],{facetby:t,dimensionFieldDef:n,stackField:r,stackby:i,sort:o,offset:a,impute:s,as:u}=this._stack;if(s&&n){const{band:o=.5,bin:a}=n;a&&e.push({type:"formula",expr:o+"*"+Yz(n,{expr:"datum"})+`+${1-o}*`+Yz(n,{expr:"datum",binSuffix:"end"}),as:Yz(n,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:r,groupby:[...i,...t],key:Yz(n,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:r,sort:o,as:u,offset:a}),e}}class UB extends bR{constructor(e,t){super(e),this.transform=t}clone(){return new UB(null,CD(this.transform))}addDimensions(e){this.transform.groupby=UD(this.transform.groupby.concat(e),e=>e)}dependentFields(){var e,t;const n=new Set;return(null!==(e=this.transform.groupby)&&void 0!==e?e:[]).forEach(n.add,n),(null!==(t=this.transform.sort)&&void 0!==t?t:[]).forEach(e=>n.add(e.field)),this.transform.window.map(e=>e.field).filter(e=>void 0!==e).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Yz(e)}hash(){return"WindowTransform "+$D(this.transform)}assemble(){var e;const t=[],n=[],r=[],i=[];for(const e of this.transform.window)n.push(e.op),r.push(this.getDefaultName(e)),i.push(void 0===e.param?null:e.param),t.push(void 0===e.field?null:e.field);const o=this.transform.frame,a=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&n.every(e=>SM(e)))return Object.assign({type:"joinaggregate",as:r,ops:n,fields:t},void 0!==a?{groupby:a}:{});const s=[],u=[];if(void 0!==this.transform.sort)for(const t of this.transform.sort)s.push(t.field),u.push(null!==(e=t.order)&&void 0!==e?e:"ascending");const l={field:s,order:u},c=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:i,as:r,ops:n,fields:t,sort:l},void 0!==c?{ignorePeers:c}:{}),void 0!==a?{groupby:a}:{}),void 0!==o?{frame:o}:{})}}function qB(e){if(e instanceof gB)if(1!==e.numChildren()||e.children[0]instanceof yR){const n=e.model.component.data.main;!function e(t){if(t instanceof yR&&t.type===jN.Main&&1===t.numChildren()){const n=t.children[0];n instanceof gB||(n.swapWithParent(),e(t))}}(n);const r=(t=e,function e(n){if(!(n instanceof gB)){const r=n.clone();if(r instanceof yR){const e=WB+r.getSource();r.setSource(e),t.model.component.data.outputNodes[e]=r}else(r instanceof pB||r instanceof IB||r instanceof UB||r instanceof LB)&&r.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=r;return[r]}return n.children.flatMap(e)}),i=e.children.map(r).flat();for(const e of i)e.parent=n}else{const t=e.children[0];(t instanceof pB||t instanceof IB||t instanceof UB||t instanceof LB)&&t.addDimensions(e.fields),t.swapWithParent(),qB(e)}else e.children.map(qB);var t}const WB="scale_";function YB(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!YB(t.children))return!1}return!0}function HB(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function GB(e,t,n){let r=e.sources,i=!1;return i=HB(new FB,r)||i,i=HB(new SB(t),r)||i,r=r.filter(e=>e.numChildren()>0),i=HB(new $B,r)||i,r=r.filter(e=>e.numChildren()>0),n||(i=HB(new zB,r)||i,i=HB(new PB(t),r)||i,i=HB(new CB,r)||i,i=HB(new TB,r)||i,i=HB(new RB,r)||i,i=HB(new NB,r)||i,i=HB(new MB,r)||i,i=HB(new BB,r)||i),e.sources=r,i}class VB{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new VB(()=>e(t))}}function XB(e){OL(e)?function(e){const t=e.component.scales;for(const n of XD(t)){const r=JB(e,n);if(t[n].setWithExplicit("domains",r),eL(e,n),e.component.data.isFaceted){let t=e;for(;!wL(t)&&t.parent;)t=t.parent;if("shared"===t.component.resolve.scale[n])for(const e of r.value)kC(e)&&(e.data=WB+e.data.replace(WB,""))}}}(e):function(e){for(const t of e.children)XB(t);const t=e.component.scales;for(const n of XD(t)){let r,i=null;for(const t of e.children){const e=t.component.scales[n];if(e){r=void 0===r?e.getWithExplicit("domains"):gN(r,e.getWithExplicit("domains"),"domains","scale",nL);const t=e.get("selectionExtent");i&&t&&i.selection!==t.selection&&aC("The same selection must be used to override scale domains in a layered view."),i=t}}t[n].setWithExplicit("domains",r),i&&t[n].set("selectionExtent",i,!0)}}(e)}function JB(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:r}=e,i=function(e,t,n,r){if("unaggregated"===e){const{valid:e,reason:r}=tL(t,n);if(!e)return void aC(r)}else if(void 0===e&&r.useUnaggregatedDomain){const{valid:e}=tL(t,n);if(e)return"unaggregated"}return e}(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return i!==e.scaleDomain(t)&&(e.specifiedScales[t]=Object.assign(Object.assign({},e.specifiedScales[t]),{domain:i})),"x"===t&&nT(r.x2)?nT(r.x)?gN(ZB(n,i,e,"x"),ZB(n,i,e,"x2"),"domain","scale",nL):ZB(n,i,e,"x2"):"y"===t&&nT(r.y2)?nT(r.y)?gN(ZB(n,i,e,"y"),ZB(n,i,e,"y2"),"domain","scale",nL):ZB(n,i,e,"y2"):ZB(n,i,e,t)}function KB(e,t,n){var r;const i=null===(r=OC(n))||void 0===r?void 0:r.unit;return"temporal"===t||i?function(e,t,n){return e.map(e=>({signal:`{data: ${lT(e,{timeUnit:n,type:t})}}`}))}(e,t,i):[e]}function ZB(e,t,n,r){const{encoding:i}=n,o=nT(i[r]),{type:a}=o,s=o.timeUnit;if(function(e){return e&&e.unionWith}(t)){const i=ZB(e,void 0,n,r),o=KB(t.unionWith,a,s);return fN([...i.value,...o])}if(wC(t))return fN([t]);if(t&&"unaggregated"!==t&&!vF(t))return fN(KB(t,a,s));const u=n.stack;if(u&&r===u.fieldChannel){if("normalize"===u.offset)return dN([[0,1]]);const e=n.requestDataName(jN.Main);return dN([{data:e,field:n.vgField(r,{suffix:"start"})},{data:e,field:n.vgField(r,{suffix:"end"})}])}const l=_S(r)&&Fz(o)?function(e,t,n){if(!gF(n))return;const r=e.fieldDef(t),i=r.sort;if(_z(i))return{op:"min",field:mP(r,t),order:"ascending"};const{stack:o}=e,a=o?[...o.groupbyField?[o.groupbyField]:[],...o.stackBy.map(e=>e.fieldDef.field)]:void 0;if(xz(i)){const e=o&&!RD(a,i.field);return QB(i,e)}if(vz(i)){const{encoding:t,order:n}=i,r=e.fieldDef(t),{aggregate:s,field:u}=r,l=o&&!RD(a,u);if(DM(s)||MM(s))return QB({field:Yz(r),order:n},l);if(SM(s)||!s)return QB({op:s,field:u,order:n},l)}else{if("descending"===i)return{op:"min",field:e.vgField(t),order:"descending"};if(RD(["ascending",void 0],i))return!0}return}(n,r,e):void 0;if(Tz(o)){return dN(KB([o.datum],a,s))}const c=o;if("unaggregated"===t){const e=n.requestDataName(jN.Main),{field:t}=o;return dN([{data:e,field:Yz({field:t,aggregate:"min"})},{data:e,field:Yz({field:t,aggregate:"max"})}])}if(AS(c.bin)){if(gF(e))return dN("bin-ordinal"===e?[]:[{data:ZD(l)?n.requestDataName(jN.Main):n.requestDataName(jN.Raw),field:n.vgField(r,fT(c,r)?{binSuffix:"range"}:{}),sort:!0!==l&&Object(Z.G)(l)?l:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:e}=c;if(AS(e)){const t=cB(n,c.field,e);return dN([new VB(()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`})])}return dN([{data:n.requestDataName(jN.Main),field:n.vgField(r,{})}])}}if(c.timeUnit&&RD(["time","utc"],e)&&Dz(r,c,OL(n)?n.encoding[sS(r)]:void 0,n.stack,n.markDef,n.config)){const e=n.requestDataName(jN.Main);return dN([{data:e,field:n.vgField(r)},{data:e,field:n.vgField(r,{suffix:"end"})}])}return dN(l?[{data:ZD(l)?n.requestDataName(jN.Main):n.requestDataName(jN.Raw),field:n.vgField(r),sort:l}]:[{data:n.requestDataName(jN.Main),field:n.vgField(r)}])}function QB(e,t){const{op:n,field:r,order:i}=e;return Object.assign(Object.assign({op:null!=n?n:t?"sum":mz},r?{field:aM(r)}:{}),i?{order:i}:{})}function eL(e,t){var n;const r=e.component.scales[t],i=e.specifiedScales[t].domain,o=null===(n=e.fieldDef(t))||void 0===n?void 0:n.bin,a=vF(i)&&i,s=MS(o)&&SS(o.extent)&&o.extent;(a||s)&&r.set("selectionExtent",null!=a?a:s,!0)}function tL(e,t){const{aggregate:n,type:r}=e;return n?Object(Z.I)(n)&&!TM[n]?{valid:!1,reason:JS(n)}:"quantitative"===r&&"log"===t?{valid:!1,reason:KS(e)}:{valid:!0}:{valid:!1,reason:XS(e)}}function nL(e,t,n,r){return e.explicit&&t.explicit&&aC(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${TD(n)} and ${TD(r)}). Using the union of the two domains.`}(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function rL(e){const t=UD(e.map(e=>{if(kC(e)){return bD(e,["sort"])}return e}),$D),n=UD(e.map(e=>{if(kC(e)){const t=e.sort;return void 0===t||ZD(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}}).filter(e=>void 0!==e),$D);if(0===t.length)return;if(1===t.length){const t=e[0];if(kC(t)&&n.length>0){let e=n[0];if(n.length>1)aC(eC),e=!0;else if(Object(Z.G)(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return Object.assign(Object.assign({},t),{sort:e})}return t}const r=UD(n.map(e=>ZD(e)||!("op"in e)||Object(Z.I)(e.op)&&e.op in AM?e:(aC(function(e){return`Dropping sort property ${TD(e)} as unioned domains only support boolean or op "count", "min", and "max".`}(e)),!0)),$D);let i;1===r.length?i=r[0]:r.length>1&&(aC(eC),i=!0);const o=UD(e.map(e=>kC(e)?e.data:null),e=>e);if(1===o.length&&null!==o[0]){return Object.assign({data:o[0],fields:t.map(e=>e.field)},i?{sort:i}:{})}return Object.assign({fields:t},i?{sort:i}:{})}function iL(e){if(kC(e)&&Object(Z.I)(e.field))return e.field;if(function(e){return!Object(Z.B)(e)&&("fields"in e&&!("data"in e))}(e)){let t;for(const n of e.fields)if(kC(n)&&Object(Z.I)(n.field))if(t){if(t!==n.field)return aC("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return aC("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),t}if(function(e){return!Object(Z.B)(e)&&("fields"in e&&"data"in e)}(e)){aC("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const t=e.fields[0];return Object(Z.I)(t)?t:void 0}}function oL(e,t){return rL(e.component.scales[t].get("domains").map(t=>(kC(t)&&(t.data=e.lookupDataSource(t.data)),t)))}function aL(e){return XD(e.component.scales).reduce((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:o,type:a,selectionExtent:s,domains:u,range:l,reverse:c}=i,f=bD(i,["name","type","selectionExtent","domains","range","reverse"]),d=function(e,t,n,r){if(hS(n)){if(jC(e))return{step:{signal:t+"_step"}}}else if(Object(Z.G)(e)&&kC(e))return Object.assign(Object.assign({},e),{data:r.lookupDataSource(e.data)});return e}(i.range,o,n,e);let h;s&&(h=function(e,t){const n=t.selection;return{signal:tP(e.getSelectionComponent(n,QD(n)),t)}}(e,s));const p=oL(e,n);return t.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:o,type:a},p?{domain:p}:{}),h?{domainRaw:h}:{}),{range:d}),void 0!==c?{reverse:c}:{}),f)),t},[])}class sL extends cN{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||PD(this.get("domains"),e=>Object(Z.B)(e)&&2===e.length&&e[0]<=0&&e[1]>=0)}}const uL=["range","scheme"];function lL(e){return"x"===e?"width":"y"===e?"height":void 0}function cL(e,t){const n=e.fieldDef(t);if(n&&n.bin&&AS(n.bin)){const r=cB(e,n.field,n.bin),i=lL(t),o=e.getName(i);return new VB(()=>{const t=e.getSignalName(r),n=`(${t}.stop - ${t}.start) / ${t}.step`;return`${e.getSignalName(o)} / (${n})`})}}function fL(e,t){const n=t.specifiedScales[e],{size:r}=t,i=t.getScaleComponent(e).get("type");for(const r of uL)if(void 0!==n[r]){const o=OF(i,r),a=wF(e,r);if(o)if(a)aC(a);else switch(r){case"range":{const r=n.range;if(Object(Z.B)(r)){if(hS(e))return fN(r.map(e=>{if("width"===e||"height"===e){const n=t.getName(e),r=t.getSignalName.bind(t);return VB.fromName(r,n)}return e}))}else if(Object(Z.G)(r))return fN({data:t.requestDataName(jN.Main),field:r.field,sort:{op:"min",field:t.vgField(e)}});return fN(r)}case"scheme":return fN(dL(n[r]))}else aC(ZS(i,r,e))}if("x"===e||"y"===e){const t="x"===e?"width":"height",n=r[t];if(y$(n)){if(gF(i))return fN({step:n.step});aC(QS(t))}}const{rangeMin:o,rangeMax:a}=n,s=function(e,t){const{size:n,config:r,mark:i,encoding:o}=t,a=t.getSignalName.bind(t),{type:s}=nT(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case"x":case"y":{if(RD(["point","band"],u))if("x"!==e||n.width){if("y"===e&&!n.height){const e=w$(r.view,"height");if(y$(e))return e}}else{const e=w$(r.view,"width");if(y$(e))return e}const i=lL(e),o=t.getName(i);return"y"===e&&mF(u)?[VB.fromName(a,o),0]:[0,VB.fromName(a,o)]}case"size":{const o=t.component.scales[e].get("zero"),a=function e(t,n,r){if(n)return wC(n)?{signal:`${n.signal} ? 0 : ${e(t,!1,r)}`}:0;switch(t){case"bar":case"tick":return r.scale.minBandSize;case"line":case"trail":case"rule":return r.scale.minStrokeWidth;case"text":return r.scale.minFontSize;case"point":case"square":case"circle":return r.scale.minSize}throw new Error(HS("size",t))}(i,o,r),s=function(e,t,n,r){const i={x:cL(n,"x"),y:cL(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const e=hL(t,i,r.view);return Object(Z.F)(e)?e-1:new VB(()=>e.signal+" - 1")}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const e=hL(t,i,r.view);return Object(Z.F)(e)?Math.pow(.95*e,2):new VB(()=>`pow(0.95 * ${e.signal}, 2)`)}}throw new Error(HS("size",e))}(i,n,t,r);return yF(u)?function(e,t,n){const r=()=>{const r=vT(t),i=vT(e),o=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${o}, ${o})`};return wC(t)?new VB(r):{signal:r()}}(a,s,function(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&Object(Z.B)(n)?n.length+1:(aC(function(e){return`Domain for ${e} is required for threshold scale.`}(r)),3)}}(u,r,l,e)):[a,s]}case PM:return[0,2*Math.PI];case"angle":return[0,360];case RM:return[0,new VB(()=>`min(${t.getSignalName("width")},${t.getSignalName("height")})/2`)];case"strokeWidth":return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case"strokeDash":return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case qM:return"symbol";case LM:case IM:case UM:return"ordinal"===u?"nominal"===s?"category":"ordinal":void 0!==c?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case"opacity":case"fillOpacity":case"strokeOpacity":return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error("Scale range undefined for channel "+e)}(e,t);return(void 0!==o||void 0!==a)&&OF(i,"rangeMin")&&Object(Z.B)(s)&&2===s.length?fN([null!=o?o:s[0],null!=a?a:s[1]]):dN(s)}function dL(e){return function(e){return!Object(Z.I)(e)&&!!e.name}(e)?Object.assign({scheme:e.name},zD(e,["name"])):{scheme:e}}function hL(e,t,n){const r=y$(e.width)?e.width.step:O$(n,"width"),i=y$(e.height)?e.height.step:O$(n,"height");return t.x||t.y?new VB(()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`):Math.min(r,i)}function pL(e,t){OL(e)?function(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=e;for(const s of XD(n)){const u=a[s],l=n[s],c=e.getScaleComponent(s),f=nT(i[s]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=OF(h,t),b=wF(s,t);if(void 0!==d&&(m?b&&aC(b):aC(ZS(h,t,s))),m&&void 0===b)if(void 0!==d){const e=f.timeUnit,n=f.type;switch(t){case"domainMax":case"domainMin":sC(u[t])||"temporal"===n||e?l.set(t,{signal:lT(u[t],{type:n,timeUnit:e})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const n=t in gL?gL[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,markDef:o,config:r}):r.scale[t];void 0!==n&&l.set(t,n,!1)}}}(e,t):bL(e,t)}const gL={bins:({model:e,fieldOrDatumDef:t})=>Fz(t)?function(e,t){const n=t.bin;if(AS(n)){const r=cB(e,t.field,n);return new VB(()=>e.getSignalName(r))}if(DS(n)&&MS(n)&&void 0!==n.step)return{step:n.step};return}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function(e,t){if(RD([LM,IM,UM],e)&&"nominal"!==t)return"hcl";return}(e,t.type),nice:({scaleType:e,channel:t,fieldOrDatumDef:n})=>function(e,t,n){var r;if((null===(r=tT(n))||void 0===r?void 0:r.bin)||RD([KC,ZC],e))return;return t in fS||void 0}(e,t,n),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>function(e,t,n,r,i,o){if(e in fS){if(bF(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=i;if("bar"===t&&(!Fz(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===nF)return n.pointPadding}return}(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,config:r})=>function(e,t,n,r){if(void 0!==e)return;if(t in fS){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:i}=r;return cM(e,"bar"===n?t:i)}return}(e,t,n.type,r.scale),paddingOuter:({scalePadding:e,channel:t,scaleType:n,markDef:r,scalePaddingInner:i,config:o})=>function(e,t,n,r,i,o){if(void 0!==e)return;if(t in fS&&n===rF){const{bandPaddingOuter:e}=o;return cM(e,wC(i)?{signal:i.signal+"/2"}:i/2)}return}(e,t,n,r.type,i,o.scale),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>function(e,t,n,r){if("x"===n&&void 0!==r.xReverse)return mF(e)&&"descending"===t?wC(r.xReverse)?{signal:"!"+r.xReverse.signal}:!r.xReverse:r.xReverse;if(mF(e)&&"descending"===t)return!0;return}(t,Fz(e)?e.sort:void 0,n,r.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i})=>function(e,t,n,r,i){if(n&&"unaggregated"!==n&&mF(i)){if(Object(Z.B)(n)){const e=n[0],t=n[n.length-1];if(e<=0&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!yF(i))return!0;if((!Fz(t)||!t.bin)&&RD([...dS,...gS],e)){const{orient:t,type:n}=r;return!RD(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e)}return!1}(e,t,n,r,i)};function mL(e){OL(e)?function(e){const t=e.component.scales;for(const n of xS){const r=t[n];if(!r)continue;const i=fL(n,e);r.setWithExplicit("range",i)}}(e):bL(e,"range")}function bL(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?mL(n):pL(n,t);for(const r of XD(n)){let i;for(const n of e.children){const e=n.component.scales[r];if(e){i=gN(i,e.getWithExplicit(t),t,"scale",hN((e,n)=>{switch(t){case"range":return e.step&&n.step?e.step-n.step:0}return 0}))}}n[r].setWithExplicit(t,i)}}function yL(e,t,n,r){const i=function(e,t,n){var r;switch(t.type){case"nominal":case"ordinal":if(XM(e)||"discrete"===kS(e))return"shape"===e&&"ordinal"===t.type&&aC(VS(e,"ordinal")),"ordinal";if(e in fS){if(RD(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&e in pS)return"band";return void 0!==t.band||Iz(t)&&(null===(r=t.axis)||void 0===r?void 0:r.tickBand)?"band":"point";case"temporal":return XM(e)?"time":"discrete"===kS(e)?(aC(VS(e,"temporal")),"ordinal"):Fz(t)&&t.timeUnit&&OC(t.timeUnit).utc?"utc":"time";case"quantitative":return XM(e)?Fz(t)&&AS(t.bin)?"bin-ordinal":"linear":"discrete"===kS(e)?(aC(VS(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(qS(t.type))}(t,n,r),{type:o}=e;return _S(t)?void 0!==o?function(e,t){if(!_S(e))return!1;switch(e){case"x":case"y":case PM:case RM:return bF(t)||RD(["band","point"],t);case"size":case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case"angle":return bF(t)||yF(t)||RD(["band","point","ordinal"],t);case LM:case IM:case UM:return"band"!==t;case"strokeDash":return"ordinal"===t||yF(t);case qM:return"ordinal"===t}}(t,o)?Fz(n)&&(a=o,s=n.type,!(RD([UC,WC],s)?void 0===a||gF(a):s===qC?RD([KC,ZC,void 0],a):s!==IC||RD([GC,VC,XC,JC,QC,eF,tF,HC,void 0],a)))?(aC(function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}(o,i)),i):o:(aC(function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}(t,o,i)),i):i:null;var a,s}function vL(e){OL(e)?e.component.scales=function(e){const{encoding:t,mark:n}=e;return xS.reduce((r,i)=>{const o=nT(t[i]);if(o&&n===LF&&i===qM&&o.type===YC)return r;let a=o&&o.scale;if(o&&null!==a&&!1!==a){a=null!=a?a:{};const t=yL(a,i,o,n);r[i]=new sL(e.scaleName(i+"",!0),{value:t,explicit:a.type===t})}return r},{})}(e):e.component.scales=function(e){var t;const n=e.component.scales={},r={},i=e.component.resolve;for(const n of e.children){vL(n);for(const o of XD(n.component.scales))if(i.scale[o]=null!==(t=i.scale[o])&&void 0!==t?t:PP(o,e),"shared"===i.scale[o]){const e=r[o],t=n.component.scales[o].getWithExplicit("type");e?oF(e.value,t.value)?r[o]=gN(e,t,"type","scale",xL):(i.scale[o]="independent",delete r[o]):r[o]=t}}for(const t of XD(r)){const i=e.scaleName(t,!0),o=r[t];n[t]=new sL(i,o);for(const n of e.children){const e=n.component.scales[t];e&&(n.renameScale(e.get("name"),i),e.merged=!0)}}return n}(e)}const xL=hN((e,t)=>sF(e)-sF(t));class _L{constructor(){this.nameMap={}}rename(e,t){this.nameMap[e]=t}has(e){return void 0!==this.nameMap[e]}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function OL(e){return"unit"===(null==e?void 0:e.type)}function wL(e){return"facet"===(null==e?void 0:e.type)}function jL(e){return"concat"===(null==e?void 0:e.type)}function kL(e){return"layer"===(null==e?void 0:e.type)}class EL{constructor(e,t,n,r,i,o,a){var s,u;this.type=t,this.parent=n,this.config=i,this.children=[],this.correctDataNames=e=>(e.from&&e.from.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=i,this.view=kF(a),this.name=null!==(s=e.name)&&void 0!==s?s:r,this.title=hT(e.title)?{text:e.title}:e.title?this.initTitle(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new _L,this.projectionNameMap=n?n.projectionNameMap:new _L,this.signalNameMap=n?n.signalNameMap:new _L,this.data=e.data,this.description=e.description,this.transforms=(null!==(u=e.transform)&&void 0!==u?u:[]).map(e=>kN(e)?{filter:MD(e.filter,LC)}:e),this.layout="layer"===t||"unit"===t?{}:function(e,t,n){var r,i;const o=n[t],a={},{spacing:s,columns:u}=o;void 0!==s&&(a.spacing=s),void 0!==u&&(jz(e)&&!Oz(e.facet)||g$(e))&&(a.columns=u),m$(e)&&(a.columns=1);for(const t of x$)if(void 0!==e[t])if("spacing"===t){const n=e[t];a[t]=Object(Z.F)(n)?n:{row:null!==(r=n.row)&&void 0!==r?r:s,column:null!==(i=n.column)&&void 0!==i?i:s}}else a[t]=e[t];return a}(e,t,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:jz(e)||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new cN,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?CD(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}initTitle(e){const t=XD(e),n={text:gT(e.text)};for(const r of t)n[r]=gT(e[r]);return n}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(e,{ignoreRange:t}={}){vL(e),XB(e);for(const t of _F)pL(e,t);t||mL(e)}(this)}parseProjection(){uB(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){ZP(this)}assembleGroupStyle(){var e,t;if("unit"===this.type||"layer"===this.type)return null!==(t=null===(e=this.view)||void 0===e?void 0:e.style)&&void 0!==t?t:"cell"}assembleEncodeFromView(e){const t=bD(e,["style"]),n={};for(const e of XD(t)){const r=t[e];void 0!==r&&(n[e]=bT(r))}return n}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=bT(this.description)),"unit"!==this.type&&"layer"!==this.type)?VD(t)?void 0:t:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!=t?t:{})}assembleLayout(){if(!this.layout)return;const e=this.layout,{spacing:t}=e,n=bD(e,["spacing"]),{component:r,config:i}=this,o=function(e,t){const n={};for(const r of KM){const i=e[r];if(null==i?void 0:i.facetFieldDef){const{titleAnchor:e,titleOrient:o}=vP(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=bP(r,o),s=SP(e,a);void 0!==s&&(n[a]=s)}}return VD(n)?void 0:n}(r.layoutHeaders,i);return Object.assign(Object.assign(Object.assign({padding:t},this.assembleDefaultLayout()),n),o?{titleBand:o}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of KM)e[n].title&&t.push(OP(this,n));for(const e of xP)t=t.concat(kP(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:r=[]}=e;return[...n.map(e=>iP(e,"grid",t)),...r.map(e=>iP(e,"grid",t)),...n.map(e=>iP(e,"main",t)),...r.map(e=>iP(e,"main",t))].filter(e=>e)}(this.component.axes,this.config)}assembleLegends(){return rB(this)}assembleProjections(){return iB(this)}assembleTitle(){var e,t,n;const r=null!==(e=this.title)&&void 0!==e?e:{},{encoding:i}=r,o=bD(r,["encoding"]),a=Object.assign(Object.assign(Object.assign({},dT(this.config.title).nonMark),o),i?{encode:{update:i}}:{});if(a.text)return RD(["unit","layer"],this.type)?RD(["middle",void 0],a.anchor)&&(a.frame=null!==(t=a.frame)&&void 0!==t?t:"group"):a.anchor=null!==(n=a.anchor)&&void 0!==n?n:"start",VD(a)?void 0:a}assembleGroup(e=[]){const t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||wL(this.parent)?function e(t){return kL(t)||jL(t)?t.children.reduce((t,n)=>t.concat(e(n)),aL(t)):aL(t)}(this):[];r.length>0&&(t.scales=r);const i=this.assembleAxes();i.length>0&&(t.axes=i);const o=this.assembleLegends();return o.length>0&&(t.legends=o),t}getName(e){return QD((this.name?this.name+"_":"")+e)}getDataName(e){return this.getName(jN[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(wL(this.parent)){const t=mS(NP(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),r=n.get("range");if(gF(e)&&jC(r)){const e=n.get("name"),r=iL(oL(this,t));if(r){return{signal:$P(e,n,Yz({aggregate:"distinct",field:r},{expr:"datum"}))}}return aC(NS(t)),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):nS(e)&&_S(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(`Cannot find a selection named "${t}".`);return n}hasAxisOrientSignalRef(){var e,t;return(null===(e=this.component.axes.x)||void 0===e?void 0:e.some(e=>e.hasOrientSignalRef()))||(null===(t=this.component.axes.y)||void 0===t?void 0:t.some(e=>e.hasOrientSignalRef()))}}class AL extends EL{vgField(e,t={}){const n=this.fieldDef(e);if(n)return Yz(n,t)}reduceFieldDef(e,t){return function(e,t,n,r){return e?XD(e).reduce((n,i)=>{const o=e[i];return Object(Z.B)(o)?o.reduce((e,n)=>t.call(r,e,n,i),n):t.call(r,n,o,i)},n):n}(this.getMapping(),(t,n,r)=>{const i=tT(n);return i?e(t,i,r):t},t)}forEachFieldDef(e,t){NT(this.getMapping(),(t,n)=>{const r=tT(t);r&&e(r,n)},t)}}class DL extends bR{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=CD(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"value",null!==(i=o[1])&&void 0!==i?i:"density"]}clone(){return new DL(null,CD(this.transform))}dependentFields(){var e;return new Set([this.transform.density,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"DensityTransform "+$D(this.transform)}assemble(){const e=this.transform,{density:t}=e,n=bD(e,["density"]);return Object.assign({type:"kde",field:t},n)}}class ML extends bR{constructor(e,t){super(e),this.filter=t}clone(){return new ML(null,Object.assign({},this.filter))}static make(e,t){const{config:n,mark:r,markDef:i}=t;if("filter"!==_T("invalid",i,n))return null;const o=t.reduceFieldDef((e,n,i)=>{const o=_S(i)&&t.getScaleComponent(i);if(o){mF(o.get("type"))&&"count"!==n.aggregate&&!IF(r)&&(e[n.field]=n)}return e},{});return XD(o).length?new ML(e,o):null}dependentFields(){return new Set(XD(this.filter))}producedFields(){return new Set}hash(){return"FilterInvalid "+$D(this.filter)}assemble(){const e=XD(this.filter).reduce((e,t)=>{const n=this.filter[t],r=Yz(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${r}) || (isValid(${r}) && isFinite(+${r})))`):"quantitative"===n.type&&(e.push(`isValid(${r})`),e.push(`isFinite(+${r})`))),e},[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class SL extends bR{constructor(e,t){super(e),this.transform=t,this.transform=CD(t);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map((e,t)=>{var n;return null!==(n=r[t])&&void 0!==n?n:e})}clone(){return new SL(this.parent,CD(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return"FlattenTransform "+$D(this.transform)}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class CL extends bR{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=CD(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"key",null!==(i=o[1])&&void 0!==i?i:"value"]}clone(){return new CL(null,CD(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return"FoldTransform "+$D(this.transform)}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class FL extends bR{constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}clone(){return new FL(null,CD(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const r of[["longitude","latitude"],["longitude2","latitude2"]]){const i=r.map(e=>{const n=nT(t.encoding[e]);return Fz(n)?n.field:Tz(n)?{expr:""+n.datum}:Bz(n)?{expr:""+n.value}:void 0});(i[0]||i[1])&&(e=new FL(e,i,null,t.getName("geojson_"+n++)))}if(t.channelHasField(qM)){const r=t.typedFieldDef(qM);r.type===YC&&(e=new FL(e,null,r.field,t.getName("geojson_"+n++)))}return e}dependentFields(){var e;const t=(null!==(e=this.fields)&&void 0!==e?e:[]).filter(Z.I);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${$D(this.fields)}`}assemble(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}class zL extends bR{constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}clone(){return new zL(null,this.projection,CD(this.fields),CD(this.as))}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[["longitude","latitude"],["longitude2","latitude2"]]){const r=n.map(e=>{const n=nT(t.encoding[e]);return Fz(n)?n.field:Tz(n)?{expr:""+n.datum}:Bz(n)?{expr:""+n.value}:void 0}),i="longitude2"===n[0]?"2":"";(r[0]||r[1])&&(e=new zL(e,t.projectionName(),r,[t.getName("x"+i),t.getName("y"+i)]))}return e}dependentFields(){return new Set(this.fields.filter(Z.I))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${$D(this.fields)} ${$D(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class TL extends bR{constructor(e,t){super(e),this.transform=t}clone(){return new TL(null,CD(this.transform))}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:r}=e;return{signal:`sequence(${[t,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(e,t){return new TL(e,t)}static makeFromEncoding(e,t){const n=t.encoding,r=n.x,i=n.y;if(Fz(r)&&Fz(i)){const o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;const a=r.impute?i:i.impute?r:void 0,{method:s,value:u,frame:l,keyvals:c}=o.impute,f=RT(t.mark,n);return new TL(e,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:a.field},s?{method:s}:{}),void 0!==u?{value:u}:{}),l?{frame:l}:{}),void 0!==c?{keyvals:c}:{}),f.length?{groupby:f}:{}))}return null}hash(){return"Impute "+$D(this.transform)}assemble(){const{impute:e,key:t,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,s=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:e,key:t},n?{keyvals:(u=n,void 0!==(null==u?void 0:u.stop)?this.processSequence(n):n)}:{}),{method:"value"}),i?{groupby:i}:{}),{value:r&&"value"!==r?null:o});var u;if(r&&"value"!==r){return[s,Object.assign({type:"window",as:[`imputed_${e}_value`],ops:[r],fields:[e],frame:a,ignorePeers:!1},i?{groupby:i}:{}),{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]}return[s]}}class $L extends bR{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=CD(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:t.on,null!==(i=o[1])&&void 0!==i?i:t.loess]}clone(){return new $L(null,CD(this.transform))}dependentFields(){var e;return new Set([this.transform.loess,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"LoessTransform "+$D(this.transform)}assemble(){const e=this.transform,{loess:t,on:n}=e,r=bD(e,["loess","on"]);return Object.assign({type:"loess",x:n,y:t},r)}}class NL extends bR{constructor(e,t,n){super(e),this.transform=t,this.secondary=n}clone(){return new NL(null,CD(this.transform),this.secondary)}static make(e,t,n,r){const i=t.component.data.sources,{from:o}=n;let a=null;if(function(e){return"data"in e}(o)){let e=JL(o.data,i);e||(e=new wB(o.data),i.push(e));const n=t.getName("lookup_"+r);a=new yR(e,n,jN.Lookup,t.component.data.outputNodeRefCounts),t.component.data.outputNodes[n]=a}else if(function(e){return"selection"in e}(o)){const e=o.selection;if(n=Object.assign({as:e},n),a=t.getSelectionComponent(QD(e),e).materialized,!a)throw new Error(`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`)}return new NL(e,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?Object(Z.i)(this.transform.as):this.transform.from.fields)}hash(){return"Lookup "+$D({transform:this.transform,secondary:this.secondary})}assemble(){let e;if(this.transform.from.fields)e=Object.assign({values:this.transform.from.fields},this.transform.as?{as:Object(Z.i)(this.transform.as)}:{});else{let t=this.transform.as;Object(Z.I)(t)||(aC('If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.'),t="_lookup"),e={as:[t]}}return Object.assign(Object.assign({type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup]},e),this.transform.default?{default:this.transform.default}:{})}}class RL extends bR{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=CD(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"prob",null!==(i=o[1])&&void 0!==i?i:"value"]}clone(){return new RL(null,CD(this.transform))}dependentFields(){var e;return new Set([this.transform.quantile,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"QuantileTransform "+$D(this.transform)}assemble(){const e=this.transform,{quantile:t}=e,n=bD(e,["quantile"]);return Object.assign({type:"quantile",field:t},n)}}class PL extends bR{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=CD(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:t.on,null!==(i=o[1])&&void 0!==i?i:t.regression]}clone(){return new PL(null,CD(this.transform))}dependentFields(){var e;return new Set([this.transform.regression,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"RegressionTransform "+$D(this.transform)}assemble(){const e=this.transform,{regression:t,on:n}=e,r=bD(e,["regression","on"]);return Object.assign({type:"regression",x:n,y:t},r)}}class BL extends bR{constructor(e,t){super(e),this.transform=t}clone(){return new BL(null,CD(this.transform))}addDimensions(e){var t;this.transform.groupby=UD((null!==(t=this.transform.groupby)&&void 0!==t?t:[]).concat(e),e=>e)}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}hash(){return"PivotTransform "+$D(this.transform)}assemble(){const{pivot:e,value:t,groupby:n,limit:r,op:i}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:e,value:t},void 0!==r?{limit:r}:{}),void 0!==i?{op:i}:{}),void 0!==n?{groupby:n}:{})}}class LL extends bR{constructor(e,t){super(e),this.transform=t}clone(){return new LL(null,CD(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return"SampleTransform "+$D(this.transform)}assemble(){return{type:"sample",size:this.transform.sample}}}function IL(e){let t=0;return function n(r,i){var o;if(r instanceof wB&&!r.isGenerator&&!bN(r.data)){e.push(i);i={name:null,source:i.name,transform:[]}}if(r instanceof vB&&(r.parent instanceof wB&&!i.source?(i.format=Object.assign(Object.assign({},null!==(o=i.format)&&void 0!==o?o:{}),{parse:r.assembleFormatParse()}),i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof gB){i.name||(i.name="data_"+t++),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source;for(const t of r.assemble())e.push(t)}else{if((r instanceof _B||r instanceof OB||r instanceof ML||r instanceof QR||r instanceof gP||r instanceof zL||r instanceof FL||r instanceof pB||r instanceof NL||r instanceof UB||r instanceof LB||r instanceof CL||r instanceof SL||r instanceof DL||r instanceof $L||r instanceof RL||r instanceof PL||r instanceof xB||r instanceof LL||r instanceof BL)&&i.transform.push(r.assemble()),(r instanceof dB||r instanceof vR||r instanceof TL||r instanceof IB)&&i.transform.push(...r.assemble()),r instanceof yR)if(i.source&&0===i.transform.length)r.setSource(i.source);else if(r.parent instanceof yR)r.setSource(i.name);else if(i.name||(i.name="data_"+t++),r.setSource(i.name),1===r.numChildren()){e.push(i);i={name:null,source:i.name,transform:[]}}switch(r.numChildren()){case 0:r instanceof yR&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name="data_"+t++);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(const e of r.children){n(e,{name:null,source:o,transform:[]})}break}}}}}function UL(e,t){var n;const{facet:r,config:i,child:o,component:a}=e;if(e.channelHasField(t)){const s=r[t],u=yP("title",null,i,t);let l=Kz(s,i,{allowDisabling:!0,includeDefault:void 0===u||!!u});o.component.layoutHeaders[t].title&&(l=Object(Z.B)(l)?l.join(", "):l,l+=" / "+o.component.layoutHeaders[t].title,o.component.layoutHeaders[t].title=null);const c=yP("labelOrient",s,i,t),f=cM((null!==(n=s.header)&&void 0!==n?n:{}).labels,i.header.labels,!0),d=RD(["bottom","right"],c)?"footer":"header";a.layoutHeaders[t]={title:l,facetFieldDef:s,[d]:"facet"===t?[]:[qL(e,t,f)]}}}function qL(e,t,n){const r="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function WL(e,t){var n;const{child:r}=e;if(r.component.axes[t]){const{layoutHeaders:o,resolve:a}=e.component;if(a.axis[t]=BP(a,t),"shared"===a.axis[t]){const a="x"===t?"column":"row",s=o[a];for(const o of r.component.axes[t]){const t="top"===(i=o.get("orient"))||"left"===i||wC(i)?"header":"footer";s[t]=null!==(n=s[t])&&void 0!==n?n:[qL(e,a,!1)];const r=iP(o,"main",e.config,{header:!0});r&&s[t][0].axes.push(r),o.mainExtracted=!0}}}var i}function YL(e){for(const t of e.children)t.parseLayoutSize()}function HL(e,t){const n=NP(t),r=mS(n),i=e.component.resolve,o=e.component.layoutSize;let a;for(const t of e.children){const e=t.component.layoutSize.getWithExplicit(n),o=i.scale[r];if("independent"===o&&"step"===e.value){a=void 0;break}if(a){if("independent"===o&&a.value!==e.value){a=void 0;break}a=gN(a,e,n,"")}else a=e}if(a){for(const r of e.children)e.renameSignal(r.getName(n),e.getName(t)),r.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,a)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function GL(e,t){const n="width"===t?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){const e=i.get("type"),n=i.get("range");if(gF(e)){const e=w$(r.view,t);return jC(n)||y$(e)?"step":e}return _$(r.view,t)}if(e.hasProjection||"arc"===e.mark)return _$(r.view,t);{const e=w$(r.view,t);return y$(e)?e.step:e}}function VL(e,t,n){return Yz(t,Object.assign({suffix:"by_"+Yz(e)},null!=n?n:{}))}class XL extends AL{constructor(e,t,n,r){super(e,"facet",t,n,r,e.resolve),this.child=mI(e.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!Oz(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=XD(e),n={};for(const r of t){if(!RD([$M,NM],r)){aC(HS(r,"facet"));break}const t=e[r];if(void 0===t.field){aC(YS(t,r));break}n[r]=this.initFacetFieldDef(t,r)}return n}initFacetFieldDef(e,t){const{header:n}=e,r=oT(bD(e,["header"]),t);return n&&(r.header=kF(n)),r}channelHasField(e){return!!this.facet[e]}fieldDef(e){return this.facet[e]}parseData(){this.component.data=KL(this),this.child.parseData()}parseLayoutSize(){YL(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(e){for(const t of KM)UL(e,t);WL(e,"x"),WL(e,"y")}(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){var e,t,n;const r={};for(const i of KM)for(const o of _P){const a=this.component.layoutHeaders[i],s=a[o],{facetFieldDef:u}=a;if(u){const t=yP("titleOrient",u.header,this.config,i);if(RD(["right","bottom"],t)){const n=bP(i,t);r.titleAnchor=null!==(e=r.titleAnchor)&&void 0!==e?e:{},r.titleAnchor[n]="end"}}if(null==s?void 0:s[0]){const e="row"===i?"height":"width",s="header"===o?"headerBand":"footerBand";"facet"===i||this.child.component.layoutSize.get(e)||(r[s]=null!==(t=r[s])&&void 0!==t?t:{},r[s][i]=.5),a.title&&(r.offset=null!==(n=r.offset)&&void 0!==n?n:{},r.offset["row"===i?"rowTitle":"columnTitle"]=10)}}return r}assembleDefaultLayout(){const{column:e,row:t}=this.facet,n=e?this.columnDistinctSignal():t?1:void 0;let r="all";return(t||"independent"!==this.component.resolve.scale.x)&&(e||"independent"!==this.component.resolve.scale.y)||(r="none"),Object.assign(Object.assign(Object.assign({},this.getHeaderLayoutMixins()),n?{columns:n}:{}),{bounds:"full",align:r})}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof XL)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroup(e){return this.parent&&this.parent instanceof XL?Object.assign(Object.assign({},this.channelHasField("column")?{encode:{update:{columns:{field:Yz(this.facet.column,{prefix:"distinct"})}}}}:{}),super.assembleGroup(e)):super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],n=[];if(this.child instanceof XL){if(this.child.channelHasField("column")){const r=Yz(this.child.facet.column);e.push(r),t.push("distinct"),n.push("distinct_"+r)}}else for(const r of dS){const i=this.child.component.scales[r];if(i&&!i.merged){const o=i.get("type"),a=i.get("range");if(gF(o)&&jC(a)){const i=iL(oL(this.child,r));i?(e.push(i),t.push("distinct"),n.push("distinct_"+i)):aC(NS(r))}}}return{fields:e,ops:t,as:n}}assembleFacet(){const{name:e,data:t}=this.component.data.facetRoot,{row:n,column:r}=this.facet,{fields:i,ops:o,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const e of KM){const t=this.facet[e];if(t){s.push(Yz(t));const{bin:u,sort:l}=t;if(AS(u)&&s.push(Yz(t,{binSuffix:"end"})),xz(l)){const{field:e,op:s=mz}=l,u=VL(t,l);n&&r?(i.push(u),o.push("max"),a.push(u)):(i.push(e),o.push(s),a.push(u))}else if(Object(Z.B)(l)){const n=mP(t,e);i.push(n),o.push("max"),a.push(n)}}}const u=!!n&&!!r;return Object.assign({name:e,data:t,groupby:s},u||i.length>0?{aggregate:Object.assign(Object.assign({},u?{cross:u}:{}),i.length?{fields:i,ops:o,as:a}:{})}:{})}facetSortFields(e){const{facet:t}=this,n=t[e];return n?xz(n.sort)?[VL(n,n.sort,{expr:"datum"})]:Object(Z.B)(n.sort)?[mP(n,e,{expr:"datum"})]:[Yz(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(xz(e)?e.order:!Object(Z.B)(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){var e;const{facet:t,config:n}=this;if(t.facet)return AP(t.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const i of xP)if(t[i]){const o=yP("labelOrient",null===(e=t[i])||void 0===e?void 0:e.header,n,i);if(RD(r[i],o))return AP(t[i],i,n)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=IL(t);for(const t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||e.assembleTitle(),i=e.assembleGroupStyle();return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},r?{title:r}:{}),i?{style:i}:{}),{from:{facet:this.assembleFacet()},sort:{field:KM.map(e=>this.facetSortFields(e)).flat(),order:KM.map(e=>this.facetSortOrder(e)).flat()}}),t.length>0?{data:t}:{}),n?{encode:{update:n}}:{}),e.assembleGroup(function(e,t){if(e.component.selection&&XD(e.component.selection).length){const n=Object(Z.ab)(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Kj("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return RR(t)}(this,[])))]}getMapping(){return this.facet}}function JL(e,t){var n,r,i,o;for(const a of t){const t=a.data;if(e.name&&a.hasName()&&e.name!==a.dataName)continue;const s=null===(n=e.format)||void 0===n?void 0:n.mesh,u=null===(r=t.format)||void 0===r?void 0:r.feature;if(s&&u)continue;const l=null===(i=e.format)||void 0===i?void 0:i.feature;if((l||u)&&l!==u)continue;const c=null===(o=t.format)||void 0===o?void 0:o.mesh;if(!s&&!c||s===c)if(yN(e)&&yN(t)){if(SD(e.values,t.values))return a}else if(bN(e)&&bN(t)){if(e.url===t.url)return a}else if(vN(e)&&e.name===a.dataName)return a}return null}function KL(e){var t,n,r,i,o,a,s,u,l,c;let f=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new wB({values:[]});return t.push(e),e}const n=JL(e.data,t);if(n)return xN(e.data)||(n.data.format=LD({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new wB(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources);const{outputNodes:d,outputNodeRefCounts:h}=e.component.data,p=e.parent?e.parent.component.data.ancestorParse.clone():new mN,g=e.data;xN(g)?(_N(g)?f=new OB(f,g.sequence):wN(g)&&(f=new _B(f,g.graticule)),p.parseNothing=!0):null===(null===(t=null==g?void 0:g.format)||void 0===t?void 0:t.parse)&&(p.parseNothing=!0),f=null!==(n=vB.makeExplicit(f,e,p))&&void 0!==n?n:f,f=new xB(f);const m=e.parent&&kL(e.parent);(OL(e)||wL(e))&&m&&(f=null!==(r=dB.makeFromEncoding(f,e))&&void 0!==r?r:f),e.transforms.length>0&&(f=function(e,t,n){var r,i;let o=0;for(const a of t.transforms){let s,u=void 0;if(NN(a))s=e=new gP(e,a),u="derived";else if(kN(a)){const i=bB(a);s=e=null!==(r=vB.makeWithAncestors(e,{},i,n))&&void 0!==r?r:e,e=new QR(e,t,a.filter)}else if(RN(a))s=e=dB.makeFromTransform(e,a,t),u="number";else if(BN(a)){u="date";void 0===n.getWithExplicit(a.field).value&&(e=new vB(e,{[a.field]:u}),n.set(a.field,u,!1)),s=e=vR.makeFromTransform(e,a)}else if(LN(a))s=e=pB.makeFromTransform(e,a),u="number",KR(t)&&(e=new xB(e));else if(EN(a))s=e=NL.make(e,t,a,o++),u="derived";else if(zN(a))s=e=new UB(e,a),u="number";else if(TN(a))s=e=new LB(e,a),u="number";else if(IN(a))s=e=IB.makeFromTransform(e,a),u="derived";else if(UN(a))s=e=new CL(e,a),u="derived";else if($N(a))s=e=new SL(e,a),u="derived";else if(AN(a))s=e=new BL(e,a),u="derived";else if(FN(a))e=new LL(e,a);else if(PN(a))s=e=TL.makeFromTransform(e,a),u="derived";else if(DN(a))s=e=new DL(e,a),u="derived";else if(MN(a))s=e=new RL(e,a),u="derived";else if(SN(a))s=e=new PL(e,a),u="derived";else{if(!CN(a)){aC(`Ignoring an invalid transform: ${TD(a)}.`);continue}s=e=new $L(e,a),u="derived"}if(s&&void 0!==u)for(const e of null!==(i=s.producedFields())&&void 0!==i?i:[])n.set(e,u,!1)}return e}(f,e,p));const b=function(e){const t={};if(OL(e)&&e.component.selection)for(const n of XD(e.component.selection)){const r=e.component.selection[n];for(const e of r.project.items)!e.channel&&lM(e.field)>1&&(t[e.field]="flatten")}return t}(e),y=yB(e);f=null!==(i=vB.makeWithAncestors(f,{},Object.assign(Object.assign({},b),y),p))&&void 0!==i?i:f,OL(e)&&(f=FL.parseAll(f,e),f=zL.parseAll(f,e)),(OL(e)||wL(e))&&(m||(f=null!==(o=dB.makeFromEncoding(f,e))&&void 0!==o?o:f),f=null!==(a=vR.makeFromEncoding(f,e))&&void 0!==a?a:f,f=gP.parseAllForSortIndex(f,e));const v=e.getDataName(jN.Raw),x=new yR(f,v,jN.Raw,h);if(d[v]=x,f=x,OL(e)){const t=pB.makeFromEncoding(f,e);t&&(f=t,KR(e)&&(f=new xB(f))),f=null!==(s=TL.makeFromEncoding(f,e))&&void 0!==s?s:f,f=null!==(u=IB.makeFromEncoding(f,e))&&void 0!==u?u:f}OL(e)&&(f=null!==(l=ML.make(f,e))&&void 0!==l?l:f);const _=e.getDataName(jN.Main),O=new yR(f,_,jN.Main,h);d[_]=O,f=O,OL(e)&&function(e,t){XR(e,n=>{const r=n.name,i=e.getName("lookup_"+r);e.component.data.outputNodes[i]=n.materialized=new yR(new QR(t,e,{selection:r}),i,jN.Lookup,e.component.data.outputNodeRefCounts)})}(e,O);let w=null;if(wL(e)){const t=e.getName("facet");f=null!==(c=function(e,t){const{row:n,column:r}=t;if(n&&r){let t=null;for(const i of[n,r])if(xz(i.sort)){const{field:n,op:r=mz}=i.sort;e=t=new LB(e,{joinaggregate:[{op:r,field:n,as:VL(i,i.sort,{forAs:!0})}],groupby:[Yz(i)]})}return t}return null}(f,e.facet))&&void 0!==c?c:f,w=new gB(f,e,t,O.getSource()),d[t]=w}return Object.assign(Object.assign({},e.component.data),{outputNodes:d,outputNodeRefCounts:h,raw:x,main:O,facetRoot:w,ancestorParse:p})}class ZL extends EL{constructor(e,t,n,r){var i,o,a,s;super(e,"concat",t,n,r,e.resolve),"shared"!==(null===(o=null===(i=e.resolve)||void 0===i?void 0:i.axis)||void 0===o?void 0:o.x)&&"shared"!==(null===(s=null===(a=e.resolve)||void 0===a?void 0:a.axis)||void 0===s?void 0:s.y)||aC("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(e).map((e,t)=>mI(e,this,this.getName("concat_"+t),void 0,r))}parseData(){this.component.data=KL(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of XD(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return m$(e)?e.vconcat:b$(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){YL(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";HL(e,t),HL(e,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){const e=FP(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleMarks(){return this.children.map(e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:e.getName("group")},t?{title:t}:{}),n?{style:n}:{}),r?{encode:{update:r}}:{}),e.assembleGroup())})}assembleDefaultLayout(){const e=this.layout.columns;return Object.assign(Object.assign({},null!=e?{columns:e}:{}),{bounds:"full",align:"each"})}}const QL=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},OM),{labelExpr:1,encode:1}),eI=XD(QL);class tI extends cN{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new tI(CD(this.explicit),CD(this.implicit),this.mainExtracted)}hasAxisPart(e){return"axis"===e||("grid"===e||"title"===e?!!this.get(e):!(!1===(t=this.get(e))||null===t));var t}hasOrientSignalRef(){return wC(this.explicit.orient)}}const nI={bottom:"top",top:"bottom",left:"right",right:"left"};function rI(e,t){if(!e)return t.map(e=>e.clone());{if(e.length!==t.length)return;const n=e.length;for(let r=0;r{switch(n){case"title":return DT(e,t);case"gridScale":return{explicit:e.explicit,value:cM(e.value,t.value)}}return pN(e,t,n,"axis")});e.setWithExplicit(n,r)}return e}function oI(e,t,n,r,i){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(wC(n.labelAngle)?n.labelAngle:mM(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===pP(r,i))return!0}return e===n[t]}const aI=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function sI(e,t){var n,r,i;let o=t.axis(e);const a=new tI,s=nT(t.encoding[e]),{mark:u,config:l}=t,c=(null==o?void 0:o.orient)||(null===(n=l["x"===e?"axisX":"axisY"])||void 0===n?void 0:n.orient)||(null===(r=l.axis)||void 0===r?void 0:r.orient)||function(e){return"x"===e?"bottom":"left"}(e),f=t.getScaleComponent(e).get("type"),d=sP(e,f,c,t.config),h=void 0!==o?!o:lP("disable",l.style,null==o?void 0:o.style,d).configValue;if(a.set("disable",h,void 0!==o),h)return a;o=o||{};const p=function(e,t,n,r,i){const o=null==t?void 0:t.labelAngle;if(void 0!==o)return wC(o)?o:mM(o);{const{configValue:o}=lP("labelAngle",r,null==t?void 0:t.style,i);return void 0!==o?mM(o):"x"!==n||!RD([WC,UC],e.type)||Fz(e)&&e.timeUnit?void 0:270}}(s,o,e,l.style,d),g={fieldOrDatumDef:s,axis:o,channel:e,model:t,scaleType:f,orient:c,labelAngle:p,mark:u,config:l};for(const n of eI){const r=n in cP?cP[n](g):jM(n)?o[n]:void 0,i=void 0!==r,s=oI(r,n,o,t,e);if(i&&s)a.set(n,r,s);else{const{configValue:e,configFrom:t}=jM(n)&&"values"!==n?lP(n,l.style,o.style,d):{},u=void 0!==e;i&&!u?a.set(n,r,s):("vgAxisConfig"!==t||aI.has(n)&&u||vM(e)||wC(e))&&a.set(n,e,!1)}}const m=null!==(i=o.encoding)&&void 0!==i?i:{},b=xM.reduce((n,r)=>{var i;if(!a.hasAxisPart(r))return n;const o=RP(null!==(i=m[r])&&void 0!==i?i:{},t),s="labels"===r?function(e,t,n){var r;const{encoding:i,config:o}=e,a=null!==(r=nT(i[t]))&&void 0!==r?r:nT(i[sS(t)]),s=e.axis(t)||{},{format:u,formatType:l}=s;return oz(l)?Object.assign({text:lz({fieldOrDatumDef:a,field:"datum.value",format:u,formatType:l,config:o})},n):n}(t,e,o):o;return void 0===s||VD(s)||(n[r]={update:s}),n},{});return VD(b)||a.set("encode",b,!!o.encoding||void 0!==o.labelAngle),a}function uI(e,t,n){const r=kF(e),i=_T("orient",r,n);if(r.orient=function(e,t,n){switch(e){case FF:case PF:case BF:case $F:case zF:case SF:return}const{x:r,y:i,x2:o,y2:a}=t;switch(e){case MF:if(Fz(r)&&(DS(r.bin)||Fz(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Fz(i)&&(DS(i.bin)||Fz(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o&&(Fz(r)&&r.type===IC&&!AS(r.bin)||Nz(r)))return"horizontal";if(!a&&(Fz(i)&&i.type===IC&&!AS(i.bin)||Nz(i)))return"vertical"}case TF:if(o&&(!Fz(r)||!DS(r.bin))&&a&&(!Fz(i)||!DS(i.bin)))return;case DF:if(a)return Fz(i)&&DS(i.bin)?"horizontal":"vertical";if(o)return Fz(r)&&DS(r.bin)?"vertical":"horizontal";if(e===TF){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case CF:case NF:{const t=$z(r),o=$z(i);if(t&&!o)return"tick"!==e?"horizontal":"vertical";if(!t&&o)return"tick"!==e?"vertical":"horizontal";if(t&&o){const t=r,o=i,a=t.type===qC,s=o.type===qC;return a&&!s?"tick"!==e?"vertical":"horizontal":!a&&s?"tick"!==e?"horizontal":"vertical":!t.aggregate&&o.aggregate?"tick"!==e?"vertical":"horizontal":t.aggregate&&!o.aggregate?"tick"!==e?"horizontal":"vertical":n||"vertical"}return n||void 0}}return"vertical"}(r.type,t,i),void 0!==i&&i!==r.orient&&aC(`Specified orient "${r.orient}" overridden with "${i}".`),"bar"===r.type&&r.orient){const e=_T("cornerRadiusEnd",r,n);if(void 0!==e){const n="horizontal"===r.orient&&t.x2||"vertical"===r.orient&&t.y2?["cornerRadius"]:VF[r.orient];for(const t of n)r[t]=e;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}void 0===_T("opacity",r,n)&&(r.opacity=function(e,t){if(RD([FF,NF,PF,BF],e)&&!FT(t))return.7;return}(r.type,t));return void 0===_T("cursor",r,n)&&(r.cursor=function(e,t,n){if(t.href||e.href||_T("href",e,n))return"pointer";return e.cursor}(r,t,n)),r}function lI(e,t){const{config:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),QN("x",e,{defaultPos:"mid"})),QN("y",e,{defaultPos:"mid"})),JN("size",e)),JN("angle",e)),function(e,t,n){if(n)return{shape:{value:n}};return JN("shape",e)}(e,0,t))}function cI(e){var t;const{config:n,markDef:r}=e,{orient:i}=r,o="horizontal"===i?"width":"height",a=e.getScaleComponent("horizontal"===i?"x":"y"),s=null!==(t=_T("size",r,n,{vgChannel:o}))&&void 0!==t?t:n.tick.bandSize;if(void 0!==s)return s;{const e=a?a.get("range"):void 0;if(e&&jC(e)&&Object(Z.F)(e.step))return 3*e.step/4;return 3*O$(n.view,o)/4}}const fI={arc:{vgMark:"arc",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),QN("x",e,{defaultPos:"mid"})),QN("y",e,{defaultPos:"mid"})),sR(e,"radius","arc")),sR(e,"theta","arc"))},area:{vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},dR(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),iR("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient})),iR("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient})),pR(e))},bar:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},dR(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),sR(e,"x","bar")),sR(e,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:e=>lI(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>Object.assign({},dR(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[Object.assign({type:"geoshape",projection:e.projectionName()},n&&Fz(n)&&n.type===YC?{field:Yz(n,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},dR(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),sR(e,"x","image")),sR(e,"y","image")),WN(e,"url"))},line:{vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),QN("x",e,{defaultPos:"mid"})),QN("y",e,{defaultPos:"mid"})),JN("size",e,{vgChannel:"strokeWidth"})),pR(e))},point:{vgMark:"symbol",encodeEntry:e=>lI(e)},rect:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},dR(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),sR(e,"x","rect")),sR(e,"y","rect"))},rule:{vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},dR(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),iR("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n})),iR("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n})),JN("size",e,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:e=>lI(e,"square")},text:{vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),QN("x",e,{defaultPos:"mid"})),QN("y",e,{defaultPos:"mid"})),WN(e)),JN("size",e,{vgChannel:"fontSize"})),JN("angle",e)),gR("align",function(e,t,n){if(void 0===_T("align",e,n))return"center";return}(e.markDef,0,t))),gR("baseline",function(e,t,n){if(void 0===_T("baseline",e,n))return"middle";return}(e.markDef,0,t))),QN("radius",e,{defaultPos:null,isMidPoint:!0})),QN("theta",e,{defaultPos:null,isMidPoint:!0}))}},tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,r=n.orient,i="horizontal"===r?"width":"height",o="horizontal"===r?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),QN("x",e,{defaultPos:"mid",vgChannel:"xc"})),QN("y",e,{defaultPos:"mid",vgChannel:"yc"})),JN("size",e,{defaultValue:cI(e),vgChannel:i})),{[o]:bT(_T("thickness",n,t))})}},trail:{vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),QN("x",e,{defaultPos:"mid"})),QN("y",e,{defaultPos:"mid"})),JN("size",e)),pR(e))}};function dI(e){if(RD([CF,DF,RF],e.mark)){const t=RT(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:"faceted_path_"+e.requestDataName(jN.Main),data:e.requestDataName(jN.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:hI(e,{fromPrefix:"faceted_path_"})}]}(e,t)}else if(RD([MF],e.mark)){const t=DC.some(t=>_T(t,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=hI(e,{fromPrefix:"stack_group_"}),n=e.scaleName(e.stack.fieldChannel),r=(t={})=>e.vgField(e.stack.fieldChannel,t),i=(e,t)=>`${e}(${[r({prefix:"min",suffix:"start",expr:t}),r({prefix:"max",suffix:"start",expr:t}),r({prefix:"min",suffix:"end",expr:t}),r({prefix:"max",suffix:"end",expr:t})].map(e=>`scale('${n}',${e})`).join(",")})`;let o,a;"x"===e.stack.fieldChannel?(o=Object.assign(Object.assign({},FD(t.encode.update,["y","yc","y2","height",...DC])),{x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}}),a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update=Object.assign(Object.assign({},zD(t.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(o=Object.assign(Object.assign({},FD(t.encode.update,["x","xc","x2","width"])),{y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}}),a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update=Object.assign(Object.assign({},zD(t.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const n of DC){const r=OT(n,e.markDef,e.config);t.encode.update[n]?(o[n]=t.encode.update[n],delete t.encode.update[n]):r&&(o[n]=bT(r)),r&&(t.encode.update[n]={value:0})}const s=e.fieldDef(e.stack.groupbyChannel),u=Yz(s)?[Yz(s)]:[];((null==s?void 0:s.bin)||(null==s?void 0:s.timeUnit))&&u.push(Yz(s,{binSuffix:"end"}));o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((n,r)=>{if(t.encode.update[r])return Object.assign(Object.assign({},n),{[r]:t.encode.update[r]});{const t=OT(r,e.markDef,e.config);return void 0!==t?Object.assign(Object.assign({},n),{[r]:bT(t)}):n}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0});return[{type:"group",from:{facet:{data:e.requestDataName(jN.Main),name:"stack_group_"+e.requestDataName(jN.Main),groupby:u,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}(e)}return hI(e)}function hI(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,a=cM(r.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(t&&t.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),s=xT(r),u=i.key,l=function(e){const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,a=t.order;if(!(!Object(Z.B)(a)&&Bz(a)&&ND(a.value)||!a&&ND(_T("order",i,o)))){if((Object(Z.B)(a)||Fz(a))&&!n)return kT(a,{expr:"datum"});if(IF(r)){const n="horizontal"===i.orient?"y":"x",r=t[n];if(Fz(r)){const t=r.sort;if(Object(Z.B)(t))return{field:Yz(r,{prefix:n,suffix:"sort_index",expr:"datum"})};if(xz(t))return{field:Yz({aggregate:FT(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})};if(vz(t)){return{field:Yz(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}}return null===t?void 0:{field:Yz(r,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}}}else;}}(e),c=function(e){if(!e.component.selection)return null;const t=XD(e.component.selection).length;let n=t,r=e.parent;for(;r&&0===n;)n=XD(r.component.selection).length,r=r.parent;return n?{interactive:t>0||!!e.encoding.tooltip}:null}(e),f=_T("aria",r,o),d=fI[n].postEncodingTransform?fI[n].postEncodingTransform(e):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName("marks"),type:fI[n].vgMark},a?{clip:!0}:{}),s?{style:s}:{}),u?{key:u.field}:{}),l?{sort:l}:{}),c||{}),!1===f?{aria:f}:{}),{from:{data:t.fromPrefix+e.requestDataName(jN.Main)},encode:{update:fI[n].encodeEntry(e)}}),d?{transform:d}:{})]}class pI extends AL{constructor(e,t,n,r={},i){super(e,"unit",t,n,i,void 0,v$(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[];const o=WF(e.mark)?Object.assign({},e.mark):{type:e.mark},a=o.type;void 0===o.filled&&(o.filled=function(e,t,{graticule:n}){if(n)return!1;const r=OT("filled",e,t),i=e.type;return cM(r,i!==FF&&i!==CF&&i!==TF)}(o,i,{graticule:e.data&&wN(e.data)}));const s=this.encoding=TT(e.encoding||{},a,o.filled,i);this.markDef=uI(o,s,i),this.size=function({encoding:e,size:t}){for(const n of dS){const r=uS(n);y$(t[r])&&$z(e[n])&&(delete t[r],aC(QS(r)))}return t}({encoding:s,size:v$(e)?Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{}):r}),this.stack=U$(a,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=e.selection}get hasProjection(){const{encoding:e}=this,t=this.mark===LF,n=e&&GM.some(t=>Rz(e[t]));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return xS.reduce((e,n)=>{var r;const i=nT(t[n]);return i&&(e[n]=this.initScale(null!==(r=i.scale)&&void 0!==r?r:{})),e},{})}initScale(e){const{domain:t,range:n}=e,r=kF(e);return Object(Z.B)(t)&&(r.domain=t.map(gT)),Object(Z.B)(n)&&(r.range=n.map(gT)),r}initAxes(e){return dS.reduce((t,n)=>{const r=e[n];if(Rz(r)||"x"===n&&Rz(e.x2)||"y"===n&&Rz(e.y2)){const e=Rz(r)?r.axis:void 0;t[n]=e?this.initAxis(Object.assign({},e)):e}return t},{})}initAxis(e){const t=XD(e),n={};for(const r of t){const t=e[r];n[r]=vM(t)?pT(t):gT(t)}return n}initLegends(e){return yS.reduce((t,n)=>{const r=nT(e[n]);if(r&&function(e){switch(e){case LM:case IM:case UM:case"size":case qM:case"opacity":case"strokeWidth":case"strokeDash":return!0;case"fillOpacity":case"strokeOpacity":case"angle":return!1}}(n)){const e=r.legend;t[n]=e?kF(e):e}return t},{})}parseData(){this.component.data=KL(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const r of dS){const i=uS(r);if(t[i]){const e=t[i];n.layoutSize.set(i,y$(e)?"step":e,!0)}else{const t=GL(e,i);n.layoutSize.set(i,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,t){var n;const r={},i=e.config.selection;for(const o of XD(null!=t?t:{})){const a=CD(t[o]),s=bD(i[a.type],["fields","encodings"]);for(const e in s)"encodings"===e&&a.fields||"fields"===e&&a.encodings||("mark"===e&&(a[e]=Object.assign(Object.assign({},s[e]),a[e])),void 0!==a[e]&&!0!==a[e]||(a[e]=null!==(n=s[e])&&void 0!==n?n:a[e]));const u=QD(o),l=r[u]=Object.assign(Object.assign({},a),{name:u,events:Object(Z.I)(a.on)?Kj(a.on,"scope"):CD(a.on)});TR(l,n=>{n.has(l)&&n.parse&&n.parse(e,l,a,t[o])})}return r}(this,this.selection)}parseMarkGroup(){this.component.mark=dI(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,dS.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[sI(n,e)]),t),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;if(XR(e,(r,i)=>{const o=r.name,a=Object(Z.ab)(o+WR);if(0===t.filter(e=>e.name===o).length){const e="global"===r.resolve?"union":r.resolve,n="multi"===r.type?", true)":")";t.push({name:r.name,update:`${GR}(${a}, ${Object(Z.ab)(e)}${n}`})}n=!0,i.topLevelSignals&&(t=i.topLevelSignals(e,r,t)),TR(r,n=>{n.topLevelSignals&&(t=n.topLevelSignals(e,r,t))})}),n){0===t.filter(e=>"unit"===e.name).length&&t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]})}return RR(t)}(this,e)}assembleSignals(){return[...oP(this),...(e=this,t=[],XR(e,(n,r)=>{const i=n.name;let o=r.modifyExpr(e,n);t.push(...r.signals(e,n)),TR(n,r=>{r.signals&&(t=r.signals(e,n,t)),r.modifyExpr&&(o=r.modifyExpr(e,n,o))}),t.push({name:i+HR,on:[{events:{signal:n.name+YR},update:`modify(${Object(Z.ab)(n.name+WR)}, ${o})`}]})}),RR(t))];var e,t}assembleSelectionData(e){return function(e,t){const n=[...t];return XR(e,t=>{const r={name:t.name+WR};if(t.init){const n=t.project.items.map(e=>bD(e,["signals"])),i=t.init.map(e=>$R(e,!1));r.values="interval"===t.type?[{unit:JR(e,{escape:!1}),fields:n,values:i}]:i.map(t=>({unit:JR(e,{escape:!1}),fields:n,values:t}))}n.filter(e=>e.name===t.name+WR).length||n.push(r)}),n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return FP(this)}assembleMarks(){var e;let t=null!==(e=this.component.mark)&&void 0!==e?e:[];return this.parent&&kL(this.parent)||(t=NR(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return CT(this.encoding,e)}fieldDef(e){return tT(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return Pz(t)?t:null}}class gI extends EL{constructor(e,t,n,r,i){super(e,"layer",t,n,i,e.resolve,e.view);const o=Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{});this.children=e.layer.map((e,t)=>{if(R$(e))return new gI(e,this,this.getName("layer_"+t),o,i);if(MT(e))return new pI(e,this,this.getName("layer_"+t),o,i);throw new Error(FS(e))})}parseData(){this.component.data=KL(this);for(const e of this.children)e.parseData()}parseLayoutSize(){var e;YL(e=this),HL(e,"width"),HL(e,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of XD(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){var t;const{axes:n,resolve:r}=e.component,i={top:0,bottom:0,right:0,left:0};for(const t of e.children){t.parseAxesAndHeaders();for(const i of XD(t.component.axes))r.axis[i]=BP(e.component.resolve,i),"shared"===r.axis[i]&&(n[i]=rI(n[i],t.component.axes[i]),n[i]||(r.axis[i]="independent",delete n[i]))}for(const o of dS){for(const a of e.children)if(a.component.axes[o]){if("independent"===r.axis[o]){n[o]=(null!==(t=n[o])&&void 0!==t?t:[]).concat(a.component.axes[o]);for(const e of a.component.axes[o]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!wC(t)){if(i[t]>0&&!n){const n=nI[t];i[t]>i[n]&&e.set("orient",n,!1)}i[t]++}}}delete a.component.axes[o]}if("independent"===r.axis[o]&&n[o]&&n[o].length>1)for(const e of n[o])e.get("grid")&&!e.explicit.grid&&(e.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleSignals()),oP(this))}assembleLayoutSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleLayoutSignals()),FP(this))}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)OL(n)&&(t=NR(n,t));return t}(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,t)=>e.concat(t.assembleLegends()),rB(this))}}function mI(e,t,n,r,i){if(jz(e))return new XL(e,t,n,i);if(R$(e))return new gI(e,t,n,r,i);if(MT(e))return new pI(e,t,n,r,i);if(function(e){return m$(e)||b$(e)||g$(e)}(e))return new ZL(e,t,n,i);throw new Error(FS(e))}function bI(e,t={}){var n;t.logger&&(n=t.logger,oC=n),t.fieldTitle&&Jz(t.fieldTitle);try{const n=C$(Object(Z.O)(t.config,e.config)),r=oN(e,n),i=mI(r,null,"",void 0,n);i.parse(),function(e,t){YB(e.sources);let n=0,r=0;for(let r=0;r<5&&GB(e,t,!0);r++)n++;e.sources.map(qB);for(let n=0;n<5&&GB(e,t,!1);n++)r++;YB(e.sources),5===Math.max(n,r)&&aC("Maximum optimization runs(5) reached.")}(i.component.data,i);return{spec:function(e,t,n={},r){const i=e.config?$$(e.config):void 0,o=[].concat(e.assembleSelectionData([]),function(e,t){var n,r;const i=[],o=IL(i);let a=0;for(const t of e.sources){t.hasName()||(t.dataName="source_"+a++);const e=t.assemble();o(t,e)}for(const e of i)0===e.transform.length&&delete e.transform;let s=0;for(const[e,t]of i.entries())0!==(null!==(n=t.transform)&&void 0!==n?n:[]).length||t.source||i.splice(s++,0,i.splice(e,1)[0]);for(const t of i)for(const n of null!==(r=t.transform)&&void 0!==r?r:[])"lookup"===n.type&&(n.from=e.outputNodes[n.from].getSource());for(const e of i)e.name in t&&(e.values=t[e.name]);return i}(e.component.data,n)),a=e.assembleProjections(),s=e.assembleTitle(),u=e.assembleGroupStyle(),l=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter(e=>"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1));const{params:f}=t,d=bD(t,["params"]);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},e.description?{description:e.description}:{}),d),s?{title:s}:{}),u?{style:u}:{}),l?{encode:{update:l}}:{}),{data:o}),a.length>0?{projections:a}:{}),e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...f$(f)])),i?{config:i}:{}),r?{usermeta:r}:{})}(i,function(e,t,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");void 0===t?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):Object(Z.I)(t)&&(t={type:t});if(i&&o&&(a=t.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)aC($S()),t.type="pad";else if("step"===i||"step"===o){const e="step"===i?"width":"height";aC($S(mS(e)));const n="width"===e?"height":"width";t.type=function(e){return e?"fit-"+mS(e):"fit"}(n)}var a;return Object.assign(Object.assign(Object.assign({},1===XD(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t}),lN(n,!1)),lN(e,!0))}(e,r.autosize,n,i),e.datasets,e.usermeta),normalized:r}}finally{t.logger&&(oC=iC),t.fieldTitle&&Jz(Vz)}}var yI=function(e){const[t,n]=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}};const vI={background:"#333",title:{color:"#fff"},style:{"guide-label":{fill:"#fff"},"guide-title":{fill:"#fff"}},axis:{domainColor:"#fff",gridColor:"#888",tickColor:"#fff"}},xI={background:"#fff",arc:{fill:"#4572a7"},area:{fill:"#4572a7"},line:{stroke:"#4572a7",strokeWidth:2},path:{stroke:"#4572a7"},rect:{fill:"#4572a7"},shape:{stroke:"#4572a7"},symbol:{fill:"#4572a7",strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},_I={arc:{fill:"#30a2da"},area:{fill:"#30a2da"},axis:{domainColor:"#cbcbcb",grid:!0,gridColor:"#cbcbcb",gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:"#cbcbcb",tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:"#f0f0f0",group:{fill:"#f0f0f0"},legend:{labelColor:"#333",labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:"#333",titleFontSize:14,titlePadding:10},line:{stroke:"#30a2da",strokeWidth:2},path:{stroke:"#30a2da",strokeWidth:.5},rect:{fill:"#30a2da"},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:"#30a2da"},bar:{binSpacing:2,fill:"#30a2da",stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},OI={group:{fill:"#e5e5e5"},arc:{fill:"#000"},area:{fill:"#000"},line:{stroke:"#000"},path:{stroke:"#000"},rect:{fill:"#000"},shape:{stroke:"#000"},symbol:{fill:"#000",size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},wI="Benton Gothic Bold, sans-serif",jI={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},kI={background:"#ffffff",title:{anchor:"start",color:"#000000",font:wI,fontSize:22,fontWeight:"normal"},arc:{fill:"#82c6df"},area:{fill:"#82c6df"},line:{stroke:"#82c6df",strokeWidth:2},path:{stroke:"#82c6df"},rect:{fill:"#82c6df"},shape:{stroke:"#82c6df"},symbol:{fill:"#82c6df",size:30},axis:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,labelFontWeight:"normal",titleFont:wI,titleFontSize:13,titleFontWeight:"normal"},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,symbolType:"square",titleFont:wI,titleFontSize:13,titleFontWeight:"normal"},range:{category:jI["category-6"],diverging:jI["fireandice-6"],heatmap:jI["fire-7"],ordinal:jI["fire-7"],ramp:jI["fire-7"]}},EI={background:"#f9f9f9",arc:{fill:"#ab5787"},area:{fill:"#ab5787"},line:{stroke:"#ab5787"},path:{stroke:"#ab5787"},rect:{fill:"#ab5787"},shape:{stroke:"#ab5787"},symbol:{fill:"#ab5787",size:30},axis:{domainColor:"#979797",domainWidth:.5,gridWidth:.2,labelColor:"#979797",tickColor:"#979797",tickWidth:.2,titleColor:"#979797"},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},AI={background:"#fff",arc:{fill:"#3e5c69"},area:{fill:"#3e5c69"},line:{stroke:"#3e5c69"},path:{stroke:"#3e5c69"},rect:{fill:"#3e5c69"},shape:{stroke:"#3e5c69"},symbol:{fill:"#3e5c69"},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},DI={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},MI={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:"Lato"},axisX:{domain:!0,domainColor:"#000000",domainWidth:1,grid:!1,labelFontSize:12,labelFont:"Lato",labelAngle:0,tickColor:"#000000",tickSize:5,titleFontSize:12,titlePadding:10,titleFont:"Lato"},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:"Lato",labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:"Lato",titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:"Lato",symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:"Lato",orient:"right",offset:10},view:{stroke:"transparent"},range:{category:DI["six-groups-cat-1"],diverging:DI["diverging-colors"],heatmap:DI["diverging-colors"],ordinal:DI["six-groups-seq"],ramp:DI["shades-blue"]},area:{fill:"#1696d2"},rect:{fill:"#1696d2"},line:{color:"#1696d2",stroke:"#1696d2",strokeWidth:5},trail:{color:"#1696d2",stroke:"#1696d2",strokeWidth:0,size:1},path:{stroke:"#1696d2",strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:"#1696d2",fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:"#1696d2",stroke:null}},arc:{fill:"#1696d2"},shape:{stroke:"#1696d2"},symbol:{fill:"#1696d2",size:30}},SI={arc:{fill:"#3366CC"},area:{fill:"#3366CC"},path:{stroke:"#3366CC"},rect:{fill:"#3366CC"},shape:{stroke:"#3366CC"},symbol:{stroke:"#3366CC"},circle:{fill:"#3366CC"},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:"Arial, sans-serif",fontSize:12},"guide-title":{font:"Arial, sans-serif",fontSize:12},"group-title":{font:"Arial, sans-serif",fontSize:12}},title:{font:"Arial, sans-serif",fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:"#ccc",tickColor:"#ccc",domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},CI="2.9.1";var FI="#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black; }\n #vg-tooltip-element.visible {\n visibility: visible; }\n #vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px; }\n #vg-tooltip-element img {\n max-width: 200px;\n max-height: 200px; }\n #vg-tooltip-element table {\n border-spacing: 0; }\n #vg-tooltip-element table tr {\n border: none; }\n #vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px; }\n #vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px; }\n #vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left; }\n #vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white; }\n #vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf; }\n";const zI="vg-tooltip-element",TI={offsetX:10,offsetY:10,id:zI,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&").replace(/t(Object(Z.I)(e)?e:NI(e,n))).join(", ")}]`;if(Object(Z.G)(e)){let r="";const i=e,{title:o,image:a}=i,s= +var I=new WeakMap,U=function(t){this.observers=new Map,this.obj=t},q=function(t,e){this.callback=t,this.observer=e};function W(t,e){e.unobserve()}function Y(t,e){var n,r=function(t){return I.get(t)}(t);if(r){var i=function(t,e){return t.observers.get(e)}(r,e);n=i&&i.observer}else r=new U(t),I.set(t,r);if(n)return n;if(n={},r.value=j(t),e){n.callback=e,n.next=null;var o=function(){H(n)},a=function(){clearTimeout(n.next),n.next=setTimeout(o)};"undefined"!=typeof window&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return n.patches=[],n.object=t,n.unobserve=function(){H(n),clearTimeout(n.next),function(t,e){t.observers.delete(e.callback)}(r,n),"undefined"!=typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(e,new q(e,n)),n}function H(t,e){void 0===e&&(e=!1);var n=I.get(t.object);G(n.value,t.object,t.patches,"",e),t.patches.length&&N(n.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function G(t,e,n,r,i){if(e!==t){"function"==typeof e.toJSON&&(e=e.toJSON());for(var o=w(e),a=w(t),s=!1,u=a.length-1;u>=0;u--){var l=t[f=a[u]];if(!O(e,f)||void 0===e[f]&&void 0!==l&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+E(f),value:j(l)}),n.push({op:"remove",path:r+"/"+E(f)}),s=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}),!0);else{var c=e[f];"object"==typeof l&&null!=l&&"object"==typeof c&&null!=c?G(l,c,n,r+"/"+E(f),i):l!==c&&(!0,i&&n.push({op:"test",path:r+"/"+E(f),value:j(l)}),n.push({op:"replace",path:r+"/"+E(f),value:j(c)}))}}if(s||o.length!=a.length)for(u=0;u{const i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=t=>{const i=e(t);if(r[i]){r[i]=0;const e=n.indexOf(t);e>=0&&n.splice(e,1)}return n},n}async function nt(t,e){try{await e(t)}catch(e){t.error(e)}}const rt=Symbol("vega_id");let it=1;function ot(t){return!(!t||!at(t))}function at(t){return t[rt]}function st(t,e){return t[rt]=e,t}function ut(t){const e=t===Object(t)?t:{data:t};return at(e)?e:st(e,it++)}function lt(t){return ct(t,ut({}))}function ct(t,e){for(const n in t)e[n]=t[n];return e}function ft(t,e){return st(e,at(t))}function dt(t,e){return t?e?(n,r)=>t(n,r)||at(e(n))-at(e(r)):(e,n)=>t(e,n)||at(e)-at(n):null}function ht(t){return t&&t.constructor===pt}function pt(){const t=[],e=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:pt,insert(e){const n=Object(Z.i)(e),r=n.length;for(let e=0;e{p(t)&&(l[at(t)]=-1)});for(f=0,d=t.length;f0&&(b(g,p,h.value),s.modifies(p));for(f=0,d=i.length;f{p(t)&&l[at(t)]>0&&b(t,h.field,h.value)}),s.modifies(h.field);if(a)s.mod=e.length||r.length?u.filter(t=>l[at(t)]>0):u.slice();else for(m in c)s.mod.push(c[m]);return(o||null==o&&(e.length||r.length))&&s.clean(!0),s}}}function gt(){Object.defineProperty(this,"_:mod:_",{writable:!0,value:{}})}gt.prototype={set(t,e,n,r){const i=this,o=i[t],a=i["_:mod:_"];return null!=e&&e>=0?(o[e]!==n||r)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||r)&&(i[t]=n,a[t]=Object(Z.B)(n)?1+n.length:-1),i},modified(t,e){const n=this["_:mod:_"];if(!arguments.length){for(const t in n)if(n[t])return!0;return!1}if(Object(Z.B)(t)){for(let e=0;e=0?e+1{a instanceof yt?(a!==this&&(e&&a.targets().add(this),o.push(a)),i.push({op:a,name:t,index:n})):r.set(t,n,a)};for(a in t)if(s=t[a],"pulse"===a)Object(Z.i)(s).forEach(t=>{t instanceof yt?t!==this&&(t.targets().add(this),o.push(t)):Object(Z.o)("Pulse parameters must be operator instances.")}),this.source=s;else if(Object(Z.B)(s))for(r.set(a,-1,Array(u=s.length)),l=0;l{const n=Date.now();return n-e>t?(e=n,1):0})},debounce(t){const e=Ot();return this.targets().add(Ot(null,null,Object(Z.n)(t,t=>{const n=t.dataflow;e.receive(t),n&&n.run&&n.run()}))),e},between(t,e){let n=!1;return t.targets().add(Ot(null,null,()=>n=!0)),e.targets().add(Ot(null,null,()=>n=!1)),this.filter(()=>n)},detach(){}};const wt={skip:!0};function jt(t,e,n,r,i,o){const a=Object(Z.p)({},o,wt);let s,u;Object(Z.E)(n)||(n=Object(Z.m)(n)),void 0===r?s=e=>t.touch(n(e)):Object(Z.E)(r)?(u=new yt(null,r,i,!1),s=e=>{u.evaluate(e);const r=n(e),i=u.value;ht(i)?t.pulse(r,i,o):t.update(r,i,a)}):s=e=>t.update(n(e),r,a),e.apply(s)}function kt(t,e,n,r,i,o){if(void 0===r)e.targets().add(n);else{const a=o||{},s=new yt(null,function(t,e){return e=Object(Z.E)(e)?e:Object(Z.m)(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}(n,r),i,!1);s.modified(a.force),s.rank=e.rank,e.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),t.connect(n,[s]))}}const Et={};function At(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Dt(t,e){const n=[];return Object(Z.jb)(t,e,t=>n.push(t)),n}function Mt(t,e){const n={};return t.visit(e,t=>{n[at(t)]=1}),t=>n[at(t)]?null:t}function St(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}function Ct(t,e,n,r){const i=this,o=n.length;let a=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(let t=0;te[t]=!0):e[t]=!0,this},modified(t,e){const n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?Object(Z.B)(t)?t.some(t=>n[t]):n[t]:!!n)},filter(t,e){const n=this;return 1&t&&(n.addF=St(n.addF,e)),2&t&&(n.remF=St(n.remF,e)),4&t&&(n.modF=St(n.modF,e)),16&t&&(n.srcF=St(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=Dt(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=Dt(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=Dt(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,r=e;if(16&t)return Object(Z.jb)(n.source,n.srcF,r),n;1&t&&Object(Z.jb)(n.add,n.addF,r),2&t&&Object(Z.jb)(n.rem,n.remF,r),4&t&&Object(Z.jb)(n.mod,n.modF,r);const i=n.source;if(8&t&&i){const t=n.add.length+n.mod.length;t===i.length||(t?Object(Z.jb)(i,Mt(n,5),r):Object(Z.jb)(i,n.srcF,r))}return n}},Object(Z.z)(Ct,At,{fork(t){const e=new At(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,t=>e.add.push(t)),t&e.REM&&this.visit(e.REM,t=>e.rem.push(t)),t&e.MOD&&this.visit(e.MOD,t=>e.mod.push(t))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?Object(Z.B)(t)?t.some(t=>n[t]):n[t]:0},filter(){Object(Z.o)("MultiPulse does not support filtering.")},materialize(){Object(Z.o)("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;oe=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),$t(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let r;return e.length?(r=e[0],e[0]=n,function(t,e,n){const r=e,i=t.length,o=t[e];let a,s=1+(e<<1);for(;s=0&&(s=a),t[e]=t[s],s=1+((e=s)<<1);t[e]=o,$t(t,r,e,n)}(e,0,t)):r=n,r}}}function $t(t,e,n,r){let i,o;const a=t[n];for(;n>e&&(o=n-1>>1,i=t[o],r(a,i)<0);)t[n]=i,n=o;return t[n]=a}function Nt(){this.logger(Object(Z.L)()),this.logLevel(Z.b),this._clock=0,this._rank=0,this._locale=Object(tt.a)();try{this._loader=Object(Q.e)()}catch(t){}this._touched=et(Z.x),this._input={},this._pulse=null,this._heap=Tt((t,e)=>t.qrank-e.qrank),this._postrun=[]}function Rt(t){return function(){return this._log[t].apply(this,arguments)}}function Pt(t,e){yt.call(this,t,null,e)}Nt.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:Rt("error"),warn:Rt("warn"),info:Rt("info"),debug:Rt("debug"),logLevel:Rt("level"),cleanThreshold:1e4,add:function(t,e,n,r){let i,o=1;return t instanceof yt?i=t:t&&t.prototype instanceof yt?i=new t:Object(Z.E)(t)?i=new yt(null,t):(o=0,i=new yt(t,e)),this.rank(i),o&&(r=n,n=e),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(t,e){const n=t.rank,r=e.length;for(let i=0;i=0;)e.push(n=r[i]),n===t&&Object(Z.o)("Cycle detected in dataflow graph.")},pulse:function(t,e,n){this.touch(t,n||zt);const r=new At(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this},touch:function(t,e){const n=e||zt;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},update:function(t,e,n){const r=n||zt;return(t.set(e)||r.force)&&this.touch(t,r),this},changeset:pt,ingest:function(t,e,n){return e=this.parse(e,n),this.pulse(t,this.changeset().insert(e))},parse:function(t,e){const n=this.locale();return Object(Q.f)(t,e,n.timeParse,n.utcParse)},preload:async function(t,e,n){const r=this,i=r._pending||function(t){let e;const n=new Promise(t=>e=t);return n.requests=0,n.done=()=>{0==--n.requests&&(t._pending=null,e(t))},t._pending=n}(r);i.requests+=1;const o=await r.request(e,n);return r.pulse(t,r.changeset().remove(Z.hb).insert(o.data||[])),i.done(),o},request:async function(t,e){const n=this;let r,i=0;try{r=await n.loader().load(t,{context:"dataflow",response:Object(Q.g)(e&&e.type)});try{r=n.parse(r,e)}catch(e){i=-2,n.warn("Data ingestion failed",t,e)}}catch(e){i=-1,n.warn("Loading failed",t,e)}return{data:r,status:i}},events:function(t,e,n,r){const i=this,o=Ot(n,r),a=function(t){t.dataflow=i;try{o.receive(t)}catch(t){i.error(t)}finally{i.run()}};let s;s="string"==typeof t&&"undefined"!=typeof document?document.querySelectorAll(t):Object(Z.i)(t);const u=s.length;for(let t=0;tr._enqueue(t,!0)),r._touched=et(Z.x);let a,s,u,l=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(s=a.run(r._getPulse(a,t)),s.then?s=await s:s.async&&(i.push(s.async),s=Et),s!==Et&&a._targets&&a._targets.forEach(t=>r._enqueue(t)),++l):r._enqueue(a,!0)}catch(t){r._heap.clear(),u=t}if(r._input={},r._pulse=null,r.debug("Pulse ".concat(o,": ").concat(l," operators")),u&&(r._postrun=[],r.error(u)),r._postrun.length){const t=r._postrun.sort((t,e)=>e.priority-t.priority);r._postrun=[];for(let e=0;er.runAsync(null,()=>{t.forEach(t=>{try{t(r)}catch(t){r.error(t)}})})),r},run:function(t,e,n){return this._pulse?Ft(this):(this.evaluate(t,e,n),this)},runAsync:async function(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running},runAfter:function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(t){this.error(t)}},_enqueue:function(t,e){const n=t.stampt.pulse),e):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==Et&&(t.source=e.source);return t}(this._pulse,n&&n.pulse)}},Object(Z.z)(Pt,yt,{run(t){if(t.stampthis.pulse=t):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const Bt={};function Lt(t){const e=It(t);return e&&e.Definition||null}function It(t){return t=t&&t.toLowerCase(),Object(Z.w)(Bt,t)?Bt[t]:null}var Ut=n(21);function qt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n=i)&&(n=i)}return n}function Wt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Yt(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}var Ht=function(t){return null===t?NaN:+t};function Gt(t,e,n){if(r=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n))).length){if((e=+e)<=0||r<2)return Wt(t);if(e>=1)return qt(t);var r,i=(r-1)*e,o=Math.floor(i),a=qt(function t(e,n,r=0,i=e.length-1,o=Ut.a){for(;i>r;){if(i-r>600){const a=i-r+1,s=n-r+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-s*l/a+c)),Math.min(i,Math.floor(n+(a-s)*l/a+c)),o)}const a=e[n];let s=r,u=i;for(Yt(e,r,n),o(e[i],a)>0&&Yt(e,r,i);s0;)--u}0===o(e[r],a)?Yt(e,r,u):(++u,Yt(e,u,i)),u<=n&&(r=u+1),n<=u&&(i=u-1)}return e}(t,o).subarray(0,o+1));return a+(Wt(t.subarray(o+1))-a)*(i-o)}}function Vt(t,e,n=Ht){if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}var Xt=function(t,e){return Gt(t,.5,e)};function*Jt(t,e){if(null==e)for(let e of t)null!=e&&""!==e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)r=e(r,++n,t),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function Kt(t,e,n){const r=Float64Array.from(Jt(t,n));return r.sort(Ut.a),e.map(t=>Vt(r,t))}function Zt(t,e){return Kt(t,[.25,.5,.75],e)}function Qt(t,e){const n=t.length,r=function(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}(t,e),i=Zt(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function te(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o,a,s,u,l,c,f=t.extent[0],d=t.extent[1];const h=t.span||d-f||Math.abs(f)||1;if(t.step)o=t.step;else if(t.steps){for(u=h/e,l=0,c=t.steps.length;le;)o*=n;for(l=0,c=i.length;l=s&&h/u<=e&&(o=u)}u=Math.log(o);const p=u>=0?0:1+~~(-u/r),g=Math.pow(n,-p-1);return(t.nice||void 0===t.nice)&&(u=Math.floor(f/o+g)*o,f=ft);const i=t.length,o=new Float64Array(i);let a,s=0,u=1,l=r(t[0]),c=l,f=l+e;for(;u=f){for(c=(l+c)/2;s>1);ia;)t[i--]=t[o]}o=a,a=r}return t}(o,e+e/4):o}function oe(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}}function ae(t,e){let n,r,i;null==e&&(e=t,t=0);const o={min(t){return arguments.length?(n=t||0,i=r-n,o):n},max(t){return arguments.length?(r=t||0,i=r-n,o):r},sample:()=>n+Math.floor(i*ee()),pdf:t=>t===Math.floor(t)&&t>=n&&t=r?1:(e-n+1)/i},icdf:t=>t>=0&&t<=1?n-1+Math.floor(t*i):NaN};return o.min(t).max(e)}const se=Math.sqrt(2*Math.PI),ue=Math.SQRT2;let le=NaN;function ce(t,e){t=t||0,e=null==e?1:e;let n,r,i=0,o=0;if(le==le)i=le,le=NaN;else{do{i=2*ee()-1,o=2*ee()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,le=o*r}return t+i*e}function fe(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*se)}function de(t,e,n){const r=(t-(e=e||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const t=Math.exp(-i*i/2);let e;i<7.07106781186547?(e=.0352624965998911*i+.700383064443688,e=e*i+6.37396220353165,e=e*i+33.912866078383,e=e*i+112.079291497871,e=e*i+221.213596169931,e=e*i+220.206867912376,o=t*e,e=.0883883476483184*i+1.75566716318264,e=e*i+16.064177579207,e=e*i+86.7807322029461,e=e*i+296.564248779674,e=e*i+637.333633378831,e=e*i+793.826512519948,e=e*i+440.413735824752,o/=e):(e=i+.65,e=i+4/e,e=i+3/e,e=i+2/e,e=i+1/e,o=t/e/2.506628274631)}return r>0?1-o:o}function he(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*ue*function(t){let e,n=-Math.log((1-t)*(1+t));n<6.25?(n-=3.125,e=-364441206401782e-35,e=e*n-16850591381820166e-35,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=e*n-1333171662854621e-31,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=e*n-4054566272975207e-29,e=e*n-8151934197605472e-29,e=26335093153082323e-28+e*n,e=e*n-12975133253453532e-27,e=e*n-5415412054294628e-26,e=1.0512122733215323e-9+e*n,e=e*n-4.112633980346984e-9,e=e*n-2.9070369957882005e-8,e=4.2347877827932404e-7+e*n,e=e*n-13654692000834679e-22,e=e*n-13882523362786469e-21,e=.00018673420803405714+e*n,e=e*n-.000740702534166267,e=e*n-.006033670871430149,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=2.2137376921775787e-9,e=9.075656193888539e-8+e*n,e=e*n-2.7517406297064545e-7,e=1.8239629214389228e-8+e*n,e=15027403968909828e-22+e*n,e=e*n-4013867526981546e-21,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=e*n-47318229009055734e-21,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=e*n-.0003550375203628475,e=.0009532893797373805+e*n,e=e*n-.0016882755560235047,e=.002491442096107851+e*n,e=e*n-.003751208507569241,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=e*n-2.555641816996525e-10,e=1.5076572693500548e-9+e*n,e=e*n-3.789465440126737e-9,e=7.61570120807834e-9+e*n,e=e*n-1.496002662714924e-8,e=2.914795345090108e-8+e*n,e=e*n-6.771199775845234e-8,e=2.2900482228026655e-7+e*n,e=e*n-9.9298272942317e-7,e=4526062597223154e-21+e*n,e=e*n-1968177810553167e-20,e=7599527703001776e-20+e*n,e=e*n-.00021503011930044477,e=e*n-.00013871931833623122,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0;return e*t}(2*t-1)}function pe(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>ce(n,r),pdf:t=>fe(t,n,r),cdf:t=>de(t,n,r),icdf:t=>he(t,n,r)};return i.mean(t).stdev(e)}function ge(t,e){const n=pe();let r=0;const i={data(n){return arguments.length?(t=n,r=n?n.length:0,i.bandwidth(e)):t},bandwidth(n){return arguments.length?(!(e=n)&&t&&(e=Qt(t)),i):e},sample:()=>t[~~(ee()*r)]+e*n.sample(),pdf(i){let o=0,a=0;for(;ame(n,r),pdf:t=>be(t,n,r),cdf:t=>ye(t,n,r),icdf:t=>ve(t,n,r)};return i.mean(t).stdev(e)}function _e(t,e){let n,r=0;const i={weights(t){return arguments.length?(n=function(t){const e=[];let n,i=0;for(n=0;n=e&&t<=n?1/(n-e):0}function je(t,e,n){return null==n&&(n=null==e?1:e,e=0),tn?1:(t-e)/(n-e)}function ke(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function Ee(t,e){let n,r;const i={min(t){return arguments.length?(n=t||0,i):n},max(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Oe(n,r),pdf:t=>we(t,n,r),cdf:t=>je(t,n,r),icdf:t=>ke(t,n,r)};return null==e&&(e=null==t?1:t,t=0),i.min(t).max(e)}function Ae(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function De(t,e,n,r){t=t.filter(t=>{let r=e(t),i=n(t);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i}),r&&t.sort((t,n)=>e(t)-e(n));const i=t.length,o=new Float64Array(i),a=new Float64Array(i);let s,u,l,c=0,f=0,d=0;for(l of t)o[c]=s=+e(l),a[c]=u=+n(l),++c,f+=(s-f)/c,d+=(u-d)/c;for(c=0;c=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function Se(t,e,n,r,i){let o=0,a=0;return Me(t,e,n,(t,e)=>{const n=e-i(t),s=e-r;o+=n*n,a+=s*s}),1-o/a}function Ce(t,e,n){let r=0,i=0,o=0,a=0,s=0;Me(t,e,n,(t,e)=>{++s,r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s});const u=Ae(r,i,o,a),l=t=>u[0]+u[1]*t;return{coef:u,predict:l,rSquared:Se(t,e,n,i,l)}}function Fe(t,e,n){let r=0,i=0,o=0,a=0,s=0;Me(t,e,n,(t,e)=>{++s,t=Math.log(t),r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s});const u=Ae(r,i,o,a),l=t=>u[0]+u[1]*Math.log(t);return{coef:u,predict:l,rSquared:Se(t,e,n,i,l)}}function ze(t,e,n){const[r,i,o,a]=De(t,e,n);let s,u,l,c=0,f=0,d=0,h=0,p=0;Me(t,e,n,(t,e)=>{s=r[p++],u=Math.log(e),l=s*e,c+=(e*u-c)/p,f+=(l-f)/p,d+=(l*u-d)/p,h+=(s*l-h)/p});const[g,m]=Ae(f/a,c/a,d/a,h/a),b=t=>Math.exp(g+m*(t-o));return{coef:[Math.exp(g-m*o),m],predict:b,rSquared:Se(t,e,n,a,b)}}function Te(t,e,n){let r=0,i=0,o=0,a=0,s=0,u=0;Me(t,e,n,(t,e)=>{const n=Math.log(t),l=Math.log(e);++u,r+=(n-r)/u,i+=(l-i)/u,o+=(n*l-o)/u,a+=(n*n-a)/u,s+=(e-s)/u});const l=Ae(r,i,o,a),c=t=>l[0]*Math.pow(t,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Se(t,e,n,s,c)}}function $e(t,e,n){const[r,i,o,a]=De(t,e,n),s=r.length;let u,l,c,f,d=0,h=0,p=0,g=0,m=0;for(u=0;uv*(t-=o)*t+x*t+_+a;return{coef:[_-x*o+v*o*o+a,x-2*v*o,v],predict:O,rSquared:Se(t,e,n,a,O)}}function Ne(t,e,n,r){if(1===r)return Ce(t,e,n);if(2===r)return $e(t,e,n);const[i,o,a,s]=De(t,e,n),u=i.length,l=[],c=[],f=r+1;let d,h,p,g,m;for(d=0;dMath.abs(t[r][a])&&(a=i);for(o=r;o=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(s=0,o=i+1;o{t-=a;let e=s+b[0]+b[1]*t+b[2]*t*t;for(d=3;d=0;--o)for(s=e[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}function Pe(t,e,n,r){const[i,o,a,s]=De(t,e,n,!0),u=i.length,l=Math.max(2,~~(r*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let t=-1;++t<=2;){const e=[0,l-1];for(let t=0;ti[a]-n?r:a;let u=0,l=0,h=0,p=0,g=0;const m=1/Math.abs(i[s]-n||1);for(let t=r;t<=a;++t){const e=i[t],r=o[t],a=Be(Math.abs(n-e)*m)*d[t],s=e*a;u+=a,l+=s,h+=r*a,p+=r*s,g+=e*s}const[b,y]=Ae(l/u,h/u,p/u,g/u);c[t]=b+y*n,f[t]=Math.abs(o[t]-c[t]),Le(i,t+1,e)}if(2===t)break;const n=Xt(f);if(Math.abs(n)<1e-12)break;for(let t,e,r=0;r=1?1e-12:(e=1-t*t)*e}return function(t,e,n,r){const i=t.length,o=[];let a,s=0,u=0,l=[];for(;s=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}const Ie=.1*Math.PI/180;function Ue(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],o=e[0],a=e[1],s=a-o,u=s/r,l=[i(o)],c=[];if(n===r){for(let t=1;t0;)c.push(i(o+t/n*s));let f=l[0],d=c[c.length-1];for(;d;){const t=i((f[0]+d[0])/2);t[0]-f[0]>=u&&qe(f,t,d)>Ie?c.push(t):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function qe(t,e,n){const r=Math.atan2(n[1]-t[1],n[0]-t[0]),i=Math.atan2(e[1]-t[1],e[0]-t[0]);return Math.abs(r-i)}var We=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r{const n=e.length;let r=1,i=String(e[0](t));for(;r{},Je={init:Xe,add:Xe,rem:Xe,idx:0},Ke={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.sum,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||void 0===t.max)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3}},Ze=Object.keys(Ke);function Qe(t,e){return Ke[t](e)}function tn(t,e){return t.idx-e.idx}function en(){this.valid=0,this.missing=0,this._ops.forEach(t=>t.init(this))}function nn(t,e){null!=t&&""!==t?t==t&&(++this.valid,this._ops.forEach(n=>n.add(this,t,e))):++this.missing}function rn(t,e){null!=t&&""!==t?t==t&&(--this.valid,this._ops.forEach(n=>n.rem(this,t,e))):--this.missing}function on(t){return this._out.forEach(e=>t[e.out]=e.value(this)),t}function an(t,e){const n=e||Z.y,r=function(t){const e={};t.forEach(t=>e[t.name]=t);const n=t=>{t.req&&t.req.forEach(t=>{e[t]||n(e[t]=Ke[t]())})};return t.forEach(n),Object.values(e).sort(tn)}(t),i=t.slice().sort(tn);function o(t){this._ops=r,this._out=i,this.cell=t,this.init()}return o.prototype.init=en,o.prototype.add=nn,o.prototype.rem=rn,o.prototype.set=on,o.prototype.get=n,o.fields=t.map(t=>t.out),o}function sn(t){this._key=t?Object(Z.u)(t):at,this.reset()}Ze.forEach(t=>{Ke[t]=function(t,e){return n=>Object(Z.p)({name:t,out:n||t},Je,e)}(t,Ke[t])});const un=sn.prototype;function ln(t){Pt.call(this,null,t),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}un.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},un.add=function(t){this._add.push(t)},un.rem=function(t){this._rem.push(t)},un.values=function(){if(this._get=null,0===this._rem.length)return this._add;const t=this._add,e=this._rem,n=this._key,r=t.length,i=e.length,o=Array(r-i),a={};let s,u,l;for(s=0;s=0;)r=t(e[i])+"",Object(Z.w)(n,r)||(n[r]=1,++o);return o},un.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=Object(Z.r)(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},un.argmin=function(t){return this.extent(t)[0]||{}},un.argmax=function(t){return this.extent(t)[1]||{}},un.min=function(t){const e=this.extent(t)[0];return null!=e?t(e):void 0},un.max=function(t){const e=this.extent(t)[1];return null!=e?t(e):void 0},un.quartile=function(t){return this._get===t&&this._q||(this._q=Zt(this.values(),t),this._get=t),this._q},un.q1=function(t){return this.quartile(t)[0]},un.q2=function(t){return this.quartile(t)[1]},un.q3=function(t){return this.quartile(t)[2]},un.ci=function(t){return this._get===t&&this._ci||(this._ci=re(this.values(),1e3,.05,t),this._get=t),this._ci},un.ci0=function(t){return this.ci(t)[0]},un.ci1=function(t){return this.ci(t)[1]},ln.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Ze},{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"}]},Object(Z.z)(ln,Pt,{transform(t,e){const n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(t):{},e.visit(e.SOURCE,t=>n.add(t))):(n.value=n.value||n.init(t),e.visit(e.REM,t=>n.rem(t)),e.visit(e.ADD,t=>n.add(t))),r.modifies(n._outputs),n._drop=!1!==t.drop,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const t=this,e=t.value,n=t._dnames,r=n.map(()=>({})),i=n.length;function o(t){let e,o,a,s;for(e in t)for(a=t[e].tuple,o=0;o{const e=Object(Z.h)(t);return i(t),n.push(e),e}),this.cellkey=t.key?t.key:Ge(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=t.fields||[null],a=t.ops||["count"],s=t.as||[],u=o.length,l={};let c,f,d,h,p,g;for(u!==a.length&&Object(Z.o)("Unmatched number of fields and aggregate ops."),g=0;gan(t,t.field)),{}},cellkey:Ge(),cell(t,e){let n=this.value[t];return n?0===n.num&&this._drop&&n.stampo.push(t),remove:t=>a[r(t)]=++s,size:()=>i.length,data:(t,e)=>(s&&(i=i.filter(t=>!a[r(t)]),a={},s=0),e&&t&&i.sort(t),o.length&&(i=t?Object(Z.N)(t,i,o.sort(t)):i.concat(o),o=[]),i)}}function dn(t){Pt.call(this,[],t)}function hn(t){yt.call(this,null,pn,t)}function pn(t){return this.value&&!t.modified()?this.value:Object(Z.l)(t.fields,t.orders)}function gn(t){Pt.call(this,null,t)}function mn(t){Pt.call(this,null,t)}cn.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},Object(Z.z)(cn,Pt,{transform(t,e){const n=!1!==t.interval,r=this._bins(t),i=r.start,o=r.step,a=t.as||["bin0","bin1"],s=a[0],u=a[1];let l;return l=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified(Object(Z.g)(t.field))?e.ADD_MOD:e.ADD,e.visit(l,n?t=>{const e=r(t);t[s]=e,t[u]=null==e?null:i+o*(1+(e-i)/o)}:t=>t[s]=r(t)),e.modifies(n?a:s)},_bins(t){if(this.value&&!t.modified())return this.value;const e=t.field,n=te(t),r=n.step;let i,o,a=n.start,s=a+Math.ceil((n.stop-a)/r)*r;null!=(i=t.anchor)&&(o=i-(a+r*Math.floor((i-a)/r)),a+=o,s+=o);const u=function(t){let n=Object(Z.db)(e(t));return null==n?null:ns?1/0:(n=Math.max(a,Math.min(n,s-r)),a+r*Math.floor(1e-14+(n-a)/r))};return u.start=a,u.stop=n.stop,u.step=r,this.value=Object(Z.f)(u,Object(Z.g)(e),t.name||"bin_"+Object(Z.h)(e))}}),dn.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},Object(Z.z)(dn,Pt,{transform(t,e){const n=e.fork(e.ALL),r=fn(at,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(dt(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}}),Object(Z.z)(hn,yt),gn.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"]}]},Object(Z.z)(gn,Pt,{transform(t,e){const n=e=>n=>{for(var r,i=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(s(n),t.case,o)||[],u=0,l=i.length;ui[t]=1+(i[t]||0)),c=n(t=>i[t]-=1);return r?e.visit(e.SOURCE,l):(e.visit(e.ADD,l),e.visit(e.REM,c)),this._finish(e,u)},_parameterCheck(t,e){let n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,r=this._tuples||(this._tuples={}),i=e[0],o=e[1],a=t.fork(t.NO_SOURCE|t.NO_FIELDS);let s,u,l;for(s in n)u=r[s],l=n[s]||0,!u&&l?(r[s]=u=ut({}),u[i]=s,u[o]=l,a.add.push(u)):0===l?(u&&a.rem.push(u),n[s]=null,r[s]=null):u[o]!==l&&(u[o]=l,a.mod.push(u));return a.modifies(e)}}),mn.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},Object(Z.z)(mn,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.as||["a","b"],i=r[0],o=r[1],a=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=e.materialize(e.SOURCE).source,n.add=this.value=function(t,e,n,r){for(var i,o,a=[],s={},u=t.length,l=0;le[n]||Object(Z.h)(t)):null}function On(t,e,n){const r=[],i=t=>t(u);let o,a,s,u,l,c;if(null==e)r.push(t.map(n));else for(o={},a=0,s=t.length;at(e,n))):"function"==typeof i[r]&&i[r](e[r]);return i}(t.distribution,function(t){return()=>t.materialize(t.SOURCE).source}(e)),i=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let a=t.method||"pdf";"pdf"!==a&&"cdf"!==a&&Object(Z.o)("Invalid density method: "+a),t.extent||r.data||Object(Z.o)("Missing density extent parameter."),a=r[a];const s=t.as||["value","density"],u=Ue(a,t.extent||Object(Z.q)(r.data()),i,o).map(t=>{const e={};return e[s[0]]=t[0],e[s[1]]=t[1],ut(e)});this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});function wn(t){Pt.call(this,null,t)}wn.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function jn(t){yt.call(this,null,kn,t),this.modified(!0)}function kn(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:Object(Z.f)(n=>e(n,t),Object(Z.g)(e),Object(Z.h)(e))}function En(t){Pt.call(this,[void 0,void 0],t)}function An(t,e){yt.call(this,t),this.parent=e,this.count=0}function Dn(t){Pt.call(this,{},t),this._keys=Object(Z.t)();const e=this._targets=[];e.active=0,e.forEach=t=>{for(let n=0,r=e.active;nObject(Z.u)(t)):Object(Z.u)(t.name,t.as)}function Cn(t){Pt.call(this,Object(Z.t)(),t)}function Fn(t){Pt.call(this,[],t)}function zn(t){Pt.call(this,[],t)}function Tn(t){Pt.call(this,null,t)}function $n(t){Pt.call(this,[],t)}Object(Z.z)(wn,Pt,{transform(t,e){if(this.value&&!t.modified()&&!e.changed())return e;const n=e.materialize(e.SOURCE).source,r=On(e.source,t.groupby,Z.y),i=t.smooth||!1,o=t.field,a=t.step||((t,e)=>Object(Z.Y)(Object(Z.q)(t,e))/30)(n,o),s=dt((t,e)=>o(t)-o(e)),u=t.as||"bin",l=r.length;let c,f=1/0,d=-1/0,h=0;for(;hd&&(d=e),t[++c][u]=e}return this.value={start:f,stop:d,step:a},e.reflow(!0).modifies(u)}}),Object(Z.z)(jn,yt),En.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Object(Z.z)(En,Pt,{transform(t,e){const n=this.value,r=t.field,i=e.changed()||e.modified(r.fields)||t.modified("field");let o=n[0],a=n[1];if((i||null==o)&&(o=1/0,a=-1/0),e.visit(i?e.SOURCE:e.ADD,t=>{const e=Object(Z.db)(r(t));null!=e&&(ea&&(a=e))}),!Number.isFinite(o)||!Number.isFinite(a)){let t=Object(Z.h)(r);t&&(t=' for field "'.concat(t,'"')),e.dataflow.warn("Infinite extent".concat(t,": [").concat(o,", ").concat(a,"]")),o=a=void 0}this.value=[o,a]}}),Object(Z.z)(An,yt,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}}),Object(Z.z)(Dn,Pt,{activate(t){this._targets[this._targets.active++]=t},subflow(t,e,n,r){const i=this.value;let o,a,s=Object(Z.w)(i,t)&&i[t];return s?s.value.stampthis.subflow(t,i,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,t=>{const e=at(t),n=o.get(e);void 0!==n&&(o.delete(e),s(n).rem(t))}),e.visit(e.ADD,t=>{const e=r(t);o.set(at(t),e),s(e).add(t)}),a||e.modified(r.fields)?e.visit(e.MOD,t=>{const e=at(t),n=o.get(e),i=r(t);n===i?s(i).mod(t):(o.set(e,i),s(n).rem(t),s(i).add(t))}):e.changed(e.MOD)&&e.visit(e.MOD,t=>{s(o.get(at(t))).mod(t)}),a&&e.visit(e.REFLOW,t=>{const e=at(t),n=o.get(e),i=r(t);n!==i&&(o.set(e,i),s(n).rem(t),s(i).add(t))}),e.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}}),Object(Z.z)(Mn,yt),Cn.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Object(Z.z)(Cn,Pt,{transform(t,e){const n=e.dataflow,r=this.value,i=e.fork(),o=i.add,a=i.rem,s=i.mod,u=t.expr;let l=!0;function c(e){const n=at(e),i=u(e,t),c=r.get(n);i&&c?(r.delete(n),o.push(e)):i||c?l&&i&&!c&&s.push(e):(r.set(n,1),a.push(e))}return e.visit(e.REM,t=>{const e=at(t);r.has(e)?r.delete(e):a.push(t)}),e.visit(e.ADD,e=>{u(e,t)?o.push(e):r.set(at(e),1)}),e.visit(e.MOD,c),t.modified()&&(l=!1,e.visit(e.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),Fn.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}]},Object(Z.z)(Fn,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=_n(r,t.as||[]),o=t.index||null,a=i.length;return n.rem=this.value,e.visit(e.SOURCE,t=>{const e=r.map(e=>e(t)),s=e.reduce((t,e)=>Math.max(t,e.length),0);let u,l,c,f=0;for(;f{for(let e,o=0;oe[r]=n(e,t))}}),Object(Z.z)($n,Pt,{transform(t,e){const n=e.fork(e.ALL),r=t.generator;let i,o,a,s=this.value,u=t.size-s.length;if(u>0){for(i=[];--u>=0;)i.push(a=ut(r(t))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=s.slice(0,-u),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-u);return n.source=this.value=s,n}});const Nn={value:"value",median:Xt,mean:function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:Wt,max:qt},Rn=[];function Pn(t){Pt.call(this,[],t)}function Bn(t){ln.call(this,t)}function Ln(t){Pt.call(this,null,t)}function In(t){yt.call(this,null,Un,t)}function Un(t){return this.value&&!t.modified()?this.value:Object(Z.J)(t.fields,t.flat)}function qn(t){Pt.call(this,[],t),this._pending=null}function Wn(t,e,n){n.forEach(ut);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r.rem.length&&r.clean(!0),r}function Yn(t){Pt.call(this,{},t)}function Hn(t){yt.call(this,null,Gn,t)}function Gn(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let r,i,o=1/0,a=-1/0;for(r=0;ra&&(a=i[1]);return[o,a]}function Vn(t){yt.call(this,null,Xn,t)}function Xn(t){return this.value&&!t.modified()?this.value:t.values.reduce((t,e)=>t.concat(e),[])}function Jn(t){Pt.call(this,null,t)}function Kn(t){ln.call(this,t)}function Zn(t){Dn.call(this,t)}function Qn(t){Pt.call(this,null,t)}function tr(t){Pt.call(this,null,t)}function er(t){Pt.call(this,null,t)}Pn.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}]},Object(Z.z)(Pn,Pt,{transform(t,e){var n,r,i,o,a,s,u,l,c,f,d=e.fork(e.ALL),h=function(t){var e,n=t.method||Nn.value;if(null!=Nn[n])return n===Nn.value?(e=void 0!==t.value?t.value:0,()=>e):Nn[n];Object(Z.o)("Unrecognized imputation method: "+n)}(t),p=function(t){const e=t.field;return t=>t?e(t):NaN}(t),g=Object(Z.h)(t.field),m=Object(Z.h)(t.key),b=(t.groupby||[]).map(Z.h),y=function(t,e,n,r){var i,o,a,s,u,l,c,f,d=t=>t(f),h=[],p=r?r.slice():[],g={},m={};for(p.forEach((t,e)=>g[t]=e+1),s=0,c=t.length;sn.add(t))):(i=n.value=n.value||this.init(t),e.visit(e.REM,t=>n.rem(t)),e.visit(e.ADD,t=>n.add(t))),n.changes(),e.visit(e.SOURCE,t=>{Object(Z.p)(t,i[n.cellkey(t)].tuple)}),e.reflow(r).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,r;for(n=0,r=this._alen;n{const n=ge(e,a)[s],r=t.counts?e.length:1;Ue(n,c||Object(Z.q)(e),f,d).forEach(t=>{const n={};for(let t=0;t(this._pending=Object(Z.i)(t.data),t=>t.touch(this)))}}return n.request(t.url,t.format).then(t=>Wn(this,e,Object(Z.i)(t.data)))}}),Yn.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},Object(Z.z)(Yn,Pt,{transform(t,e){const n=t.fields,r=t.index,i=t.values,o=null==t.default?null:t.default,a=t.modified(),s=n.length;let u,l,c,f=a?e.SOURCE:e.ADD,d=e,h=t.as;return i?(l=i.length,s>1&&!h&&Object(Z.o)('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*l&&Object(Z.o)('The "as" parameter has too few output field names.'),h=h||i.map(Z.h),u=function(t){for(var e,a,u=0,c=0;ue.modified(t.fields)),f|=c?e.MOD:0),e.visit(f,u),d.modifies(h)}}),Object(Z.z)(Hn,yt),Object(Z.z)(Vn,yt),Object(Z.z)(Jn,Pt,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),Kn.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Ze,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},Object(Z.z)(Kn,ln,{_transform:ln.prototype.transform,transform(t,e){return this._transform(function(t,e){const n=t.field,r=t.value,i=("count"===t.op?"__count__":t.op)||"sum",o=Object(Z.g)(n).concat(Object(Z.g)(r)),a=function(t,e,n){const r={},i=[];return n.visit(n.SOURCE,e=>{const n=t(e);r[n]||(r[n]=1,i.push(n))}),i.sort(Z.j),e?i.slice(0,e):i}(n,t.limit||0,e);e.changed()&&t.set("__pivot__",null,null,!0);return{key:t.key,groupby:t.groupby,ops:a.map(()=>i),fields:a.map(t=>function(t,e,n,r){return Object(Z.f)(r=>e(r)===t?n(r):NaN,r,t+"")}(t,n,r,o)),as:a.map(t=>t+""),modified:t.modified.bind(t)}}(t,e),e)}}),Object(Z.z)(Zn,Dn,{transform(t,e){const n=t.subflow,r=t.field,i=t=>this.subflow(at(t),n,e,t);return(t.modified("field")||r&&e.modified(Object(Z.g)(r)))&&Object(Z.o)("PreFacet does not support field modification."),this.initTargets(),r?(e.visit(e.MOD,t=>{const e=i(t);r(t).forEach(t=>e.mod(t))}),e.visit(e.ADD,t=>{const e=i(t);r(t).forEach(t=>e.add(ut(t)))}),e.visit(e.REM,t=>{const e=i(t);r(t).forEach(t=>e.rem(t))})):(e.visit(e.MOD,t=>i(t).mod(t)),e.visit(e.ADD,t=>i(t).add(t)),e.visit(e.REM,t=>i(t).rem(t))),e.clean()&&e.runAfter(()=>this.clean()),e}}),Qn.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},Object(Z.z)(Qn,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=_n(t.fields,t.as||[]),o=r?(t,e)=>function(t,e,n,r){for(let i=0,o=n.length;i{const e=at(t);n.rem.push(a[e]),a[e]=null}),e.visit(e.ADD,t=>{const e=o(t,ut({}));a[at(t)]=e,n.add.push(e)}),e.visit(e.MOD,t=>{n.mod.push(o(t,a[at(t)]))}),n}}),Object(Z.z)(tr,Pt,{transform(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}}),er.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function nr(t){Pt.call(this,null,t)}function rr(t){Pt.call(this,[],t),this.count=0}function ir(t){Pt.call(this,null,t)}function or(t){Pt.call(this,null,t),this.modified(!0)}function ar(t){Pt.call(this,null,t)}Object(Z.z)(er,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return n.source=this.value,n;const i=On(e.materialize(e.SOURCE).source,t.groupby,t.field),o=(t.groupby||[]).map(Z.h),a=[],s=t.step||.01,u=t.probs||We(s/2,1-1e-14,s),l=u.length;return i.forEach(t=>{const e=Kt(t,u);for(let n=0;n{const e=at(t);n.rem.push(r[e]),r[e]=null}),e.visit(e.ADD,t=>{const e=lt(t);r[at(t)]=e,n.add.push(e)}),e.visit(e.MOD,t=>{const e=r[at(t)];for(const r in t)e[r]=t[r],n.modifies(r);n.mod.push(e)})),n}}),rr.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},Object(Z.z)(rr,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.modified("size"),i=t.size,o=this.value.reduce((t,e)=>(t[at(e)]=1,t),{});let a=this.value,s=this.count,u=0;function l(t){let e,r;a.length=u&&(e=a[r],o[at(e)]&&n.rem.push(e),a[r]=t)),++s}if(e.rem.length&&(e.visit(e.REM,t=>{const e=at(t);o[e]&&(o[e]=-1,n.rem.push(t)),--s}),a=a.filter(t=>-1!==o[at(t)])),(e.rem.length||r)&&a.length{o[at(t)]||l(t)}),u=-1),r&&a.length>i){const t=a.length-i;for(let e=0;e{o[at(t)]&&n.mod.push(t)}),e.add.length&&e.visit(e.ADD,l),(e.add.length||u<0)&&(n.add=a.filter(t=>!o[at(t)])),this.count=s,this.value=n.source=a,n}}),ir.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},Object(Z.z)(ir,Pt,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=We(t.start,t.stop,t.step||1).map(t=>{const e={};return e[r]=t,ut(e)}),n.add=e.add.concat(this.value),n}}),Object(Z.z)(or,Pt,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});const sr=["unit0","unit1"];function ur(t){Pt.call(this,Object(Z.t)(),t)}function lr(t){Pt.call(this,null,t)}ar.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:He.j,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:sr}]},Object(Z.z)(ar,Pt,{transform(t,e){const n=t.field,r=!1!==t.interval,i="utc"===t.timezone,o=this._floor(t,e),a=(i?He.v:He.p)(o.unit).offset,s=t.as||sr,u=s[0],l=s[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=e.ADD;return(t.modified()||e.modified(Object(Z.g)(n)))&&(h=(e=e.reflow(!0)).SOURCE,f=1/0,d=-1/0),e.visit(h,t=>{const e=n(t);let i,s;null==e?(t[u]=null,r&&(t[l]=null)):(t[u]=i=s=o(e),r&&(t[l]=s=a(i,c)),id&&(d=s))}),o.start=f,o.stop=d,e.modifies(r?s:u)},_floor(t,e){const n="utc"===t.timezone,{units:r,step:i}=t.units?{units:t.units,step:t.step||1}:Object(He.n)({extent:t.extent||Object(Z.q)(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=Object(He.t)(r),a=this.value||{},s=(n?He.u:He.o)(o,i);return s.unit=Object(Z.V)(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}}),Object(Z.z)(ur,Pt,{transform(t,e){const n=e.dataflow,r=t.field,i=this.value,o=t=>i.set(r(t),t);let a=!0;return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,t=>i.delete(r(t))),e.visit(e.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()}}),Object(Z.z)(lr,Pt,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(dt(t.sort)):e.source).map(t.field))}});const cr={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){const t=cr.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,r=e.compare;let i=e.index;if(t0||Object(Z.o)("ntile num must be greater than zero.");const n=cr.cume_dist(),r=n.next;return{init:n.init,next:t=>Math.ceil(e*r(t))}},lag:function(t,e){return e=+e||1,{next:n=>{const r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const r=n.index+e,i=n.data;return rt(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return(e=+e)>0||Object(Z.o)("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(e-1);return re=null,next:n=>{const r=t(n.data[n.index]);return null!=r?e=r:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:r=>{const i=r.data;return r.index<=n?e:(n=function(t,e,n){for(let r=e.length;ns[t]=1)}d(t.sort),e.forEach((t,e)=>{const s=n[e],h=Object(Z.h)(s),p=Ve(t,h,i[e]);if(d(s),o.push(p),Object(Z.w)(cr,t))a.push(function(t,e,n,r){const i=cr[t](e,n);return{init:i.init||Z.lb,update:function(t,e){e[r]=i.next(t)}}}(t,n[e],r[e],p));else{if(null==s&&"count"!==t&&Object(Z.o)("Null aggregate field specified."),"count"===t)return void l.push(p);f=!1;let e=u[h];e||(e=u[h]=[],e.field=s,c.push(e)),e.push(Qe(t,p))}}),(l.length||c.length)&&(this.cell=function(t,e,n){t=t.map(t=>an(t,t.field));const r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),a=0;a0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),rt.init()),this.cell&&this.cell.init()},hr.update=function(t,e){const n=this.cell,r=this.windows,i=t.data,o=r&&r.length;let a;if(n){for(a=t.p0;athis.group(i(t));let a=this.state;a&&!n||(a=this.state=new dr(t)),n||e.modified(a.inputs)?(this.value={},e.visit(e.SOURCE,t=>o(t).add(t))):(e.visit(e.REM,t=>o(t).remove(t)),e.visit(e.ADD,t=>o(t).add(t)));for(let e=0,n=this._mlen;e0)for(var r,i=t[0],o=e[0],a=t[n]-i,s=e[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*a),this._beta*e[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var jr=function t(e){function n(t){return 1===e?new vr(t):new wr(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function kr(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Er(t,e){this._context=t,this._k=(1-e)/6}Er.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:kr(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:kr(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ar=function t(e){function n(t){return new Er(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Dr(t,e){this._context=t,this._k=(1-e)/6}Dr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:kr(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Mr=function t(e){function n(t){return new Dr(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Sr(t,e){this._context=t,this._k=(1-e)/6}Sr.prototype={areaStart:xr,areaEnd:xr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:kr(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Cr=function t(e){function n(t){return new Sr(t,e)}return n.tension=function(e){return t(+e)},n}(0),Fr=Math.abs,zr=Math.atan2,Tr=Math.cos,$r=Math.max,Nr=Math.min,Rr=Math.sin,Pr=Math.sqrt,Br=Math.PI,Lr=Br/2,Ir=2*Br;function Ur(t){return t>1?0:t<-1?Br:Math.acos(t)}function qr(t){return t>=1?Lr:t<=-1?-Lr:Math.asin(t)}function Wr(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>1e-12){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>1e-12){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Yr(t,e){this._context=t,this._alpha=e}Yr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Wr(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Hr=function t(e){function n(t){return e?new Yr(t,e):new Er(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Gr(t,e){this._context=t,this._alpha=e}Gr.prototype={areaStart:xr,areaEnd:xr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Wr(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Vr=function t(e){function n(t){return e?new Gr(t,e):new Sr(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Xr(t,e){this._context=t,this._alpha=e}Xr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wr(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Jr=function t(e){function n(t){return e?new Xr(t,e):new Dr(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Kr(t){this._context=t}Kr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Zr=function(t){return new Kr(t)};function Qr(t){this._context=t}Qr.prototype={areaStart:xr,areaEnd:xr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function ti(t){return t<0?-1:1}function ei(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(ti(o)+ti(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function ni(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ri(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function ii(t){this._context=t}function oi(t){this._context=new ai(t)}function ai(t){this._context=t}function si(t){this._context=t}function ui(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};const ci=Math.PI,fi=2*ci,di=fi-1e-6;function hi(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pi(){return new hi}hi.prototype=pi.prototype={constructor:hi,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-t,u=r-e,l=o-t,c=a-e,f=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>1e-6)if(Math.abs(c*s-u*l)>1e-6&&i){var d=n-o,h=r-a,p=s*s+u*u,g=d*d+h*h,m=Math.sqrt(p),b=Math.sqrt(f),y=i*Math.tan((ci-Math.acos((p+f-g)/(2*m*b)))/2),v=y/b,x=y/m;Math.abs(v-1)>1e-6&&(this._+="L"+(t+v*l)+","+(e+v*c)),this._+="A"+i+","+i+",0,0,"+ +(c*d>l*h)+","+(this._x1=t+x*s)+","+(this._y1=e+x*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+a,l=e+s,c=1^o,f=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+l:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+u+","+l),n&&(f<0&&(f=f%fi+fi),f>di?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=u)+","+(this._y1=l):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=ci)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var gi=pi,mi=function(t){return function(){return t}};function bi(t){return t.innerRadius}function yi(t){return t.outerRadius}function vi(t){return t.startAngle}function xi(t){return t.endAngle}function _i(t){return t&&t.padAngle}function Oi(t,e,n,r,i,o,a,s){var u=n-t,l=r-e,c=a-i,f=s-o,d=f*u-c*l;if(!(d*d<1e-12))return[t+(d=(c*(e-o)-f*(t-i))/d)*u,e+d*l]}function wi(t,e,n,r,i,o,a){var s=t-n,u=e-r,l=(a?o:-o)/Pr(s*s+u*u),c=l*u,f=-l*s,d=t+c,h=e+f,p=n+c,g=r+f,m=(d+p)/2,b=(h+g)/2,y=p-d,v=g-h,x=y*y+v*v,_=i-o,O=d*g-p*h,w=(v<0?-1:1)*Pr($r(0,_*_*x-O*O)),j=(O*v-y*w)/x,k=(-O*y-v*w)/x,E=(O*v+y*w)/x,A=(-O*y+v*w)/x,D=j-m,M=k-b,S=E-m,C=A-b;return D*D+M*M>S*S+C*C&&(j=E,k=A),{cx:j,cy:k,x01:-c,y01:-f,x11:j*(i/_-1),y11:k*(i/_-1)}}Array.prototype.slice;var ji=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)};function ki(t){return t[0]}function Ei(t){return t[1]}var Ai=function(t,e){var n=mi(!0),r=null,i=Zr,o=null;function a(a){var s,u,l,c=(a=ji(a)).length,f=!1;for(null==r&&(o=i(l=gi())),s=0;s<=c;++s)!(s=c;--f)s.point(m[f],b[f]);s.lineEnd(),s.areaEnd()}g&&(m[l]=+t(d,l,u),b[l]=+e(d,l,u),s.point(r?+r(d,l,u):m[l],n?+n(d,l,u):b[l]))}if(h)return s=null,h+""||null}function l(){return Ai().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?ki:mi(+t),e="function"==typeof e?e:mi(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?Ei:mi(+n),u.x=function(e){return arguments.length?(t="function"==typeof e?e:mi(+e),r=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:mi(+e),u):t},u.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:mi(+t),u):r},u.y=function(t){return arguments.length?(e="function"==typeof t?t:mi(+t),n=null,u):e},u.y0=function(t){return arguments.length?(e="function"==typeof t?t:mi(+t),u):e},u.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:mi(+t),u):n},u.lineX0=u.lineY0=function(){return l().x(t).y(e)},u.lineY1=function(){return l().x(t).y(n)},u.lineX1=function(){return l().x(r).y(e)},u.defined=function(t){return arguments.length?(i="function"==typeof t?t:mi(!!t),u):i},u.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),u):a},u.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),u):o},u},Mi={draw:function(t,e){var n=Math.sqrt(e/Br);t.moveTo(n,0),t.arc(0,0,n,0,Ir)}},Si=(Math.sqrt(1/3),Math.sin(Br/10)/Math.sin(7*Br/10));Math.sin(Ir/10),Math.cos(Ir/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12);function Ci(t,e){if("undefined"!=typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=t,n.height=e,n}return null}const Fi=()=>"undefined"!=typeof Image?Image:null,zi=Object(Ye.a)(Ut.a),Ti=zi.right,$i=zi.left;Object(Ye.a)(Ht).center;var Ni=Ti;function Ri(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Pi(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const Bi=Symbol("implicit");function Li(){var t=new Map,e=[],n=[],r=Bi;function i(i){var o=i+"",a=t.get(o);if(!a){if(r!==Bi)return r;t.set(o,a=e.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Map;for(const r of n){const n=r+"";t.has(n)||t.set(n,e.push(r))}return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Li(e,n).unknown(r)},Ri.apply(i,arguments),i}var Ii=n(51),Ui=n(27),qi=n(104),Wi=n(64),Yi=n(105),Hi=n(106);function Gi(t,e,n,r){var i,o=Object(Ii.c)(t,e,n);switch((r=Object(Ui.a)(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=Object(qi.a)(o,a))||(r.precision=i),Object(Wi.b)(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Object(Yi.a)(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Object(Hi.a)(o))||(r.precision=i-2*("%"===r.type))}return Object(Wi.a)(r)}var Vi=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function Xi(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ji(){}var Ki="\\s*([+-]?\\d+)\\s*",Zi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",to=/^#([0-9a-f]{3,8})$/,eo=new RegExp("^rgb\\("+[Ki,Ki,Ki]+"\\)$"),no=new RegExp("^rgb\\("+[Qi,Qi,Qi]+"\\)$"),ro=new RegExp("^rgba\\("+[Ki,Ki,Ki,Zi]+"\\)$"),io=new RegExp("^rgba\\("+[Qi,Qi,Qi,Zi]+"\\)$"),oo=new RegExp("^hsl\\("+[Zi,Qi,Qi]+"\\)$"),ao=new RegExp("^hsla\\("+[Zi,Qi,Qi,Zi]+"\\)$"),so={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function uo(){return this.rgb().formatHex()}function lo(){return this.rgb().formatRgb()}function co(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=to.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?fo(e):3===n?new mo(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ho(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ho(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=eo.exec(t))?new mo(e[1],e[2],e[3],1):(e=no.exec(t))?new mo(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ro.exec(t))?ho(e[1],e[2],e[3],e[4]):(e=io.exec(t))?ho(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=oo.exec(t))?xo(e[1],e[2]/100,e[3]/100,1):(e=ao.exec(t))?xo(e[1],e[2]/100,e[3]/100,e[4]):so.hasOwnProperty(t)?fo(so[t]):"transparent"===t?new mo(NaN,NaN,NaN,0):null}function fo(t){return new mo(t>>16&255,t>>8&255,255&t,1)}function ho(t,e,n,r){return r<=0&&(t=e=n=NaN),new mo(t,e,n,r)}function po(t){return t instanceof Ji||(t=co(t)),t?new mo((t=t.rgb()).r,t.g,t.b,t.opacity):new mo}function go(t,e,n,r){return 1===arguments.length?po(t):new mo(t,e,n,null==r?1:r)}function mo(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function bo(){return"#"+vo(this.r)+vo(this.g)+vo(this.b)}function yo(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function vo(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function xo(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new wo(t,e,n,r)}function _o(t){if(t instanceof wo)return new wo(t.h,t.s,t.l,t.opacity);if(t instanceof Ji||(t=co(t)),!t)return new wo;if(t instanceof wo)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&u<1?0:a,new wo(a,s,u,t.opacity)}function Oo(t,e,n,r){return 1===arguments.length?_o(t):new wo(t,e,n,null==r?1:r)}function wo(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function jo(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function ko(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}Vi(Ji,co,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:uo,formatHex:uo,formatHsl:function(){return _o(this).formatHsl()},formatRgb:lo,toString:lo}),Vi(mo,go,Xi(Ji,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new mo(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new mo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bo,formatHex:bo,formatRgb:yo,toString:yo})),Vi(wo,Oo,Xi(Ji,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new wo(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new wo(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new mo(jo(t>=240?t-240:t+120,i,r),jo(t,i,r),jo(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Eo=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r()=>t;function Mo(t,e){return function(n){return t+n*e}}function So(t,e){var n=e-t;return n?Mo(t,n>180||n<-180?n-360*Math.round(n/360):n):Do(isNaN(t)?e:t)}function Co(t){return 1==(t=+t)?Fo:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Do(isNaN(e)?n:e)}}function Fo(t,e){var n=e-t;return n?Mo(t,n):Do(isNaN(t)?e:t)}var zo=function t(e){var n=Co(e);function r(t,e){var r=n((t=go(t)).r,(e=go(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Fo(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function To(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;no&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Uo(n,r)})),o=Yo.lastIndex;return oe&&(n=t,t=e,e=n),l=function(n){return Math.max(t,Math.min(e,n))}),r=u>2?ta:Qo,i=o=null,f}function f(e){return isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(l(e)))}return f.invert=function(n){return l(e((o||(o=r(s,a.map(t),Uo)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,Xo),c()):a.slice()},f.range=function(t){return arguments.length?(s=Array.from(t),c()):s.slice()},f.rangeRound=function(t){return s=Array.from(t),u=Vo,c()},f.clamp=function(t){return arguments.length?(l=!!t||Ko,c()):l!==Ko},f.interpolate=function(t){return arguments.length?(u=t,c()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,c()}}function ra(){return na()(Ko,Ko)}function ia(t){var e=t.domain;return t.ticks=function(t){var n=e();return Object(Ii.a)(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Gi(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,s=o.length-1,u=o[a],l=o[s],c=10;for(l0;){if((i=Object(Ii.b)(u,l,n))===r)return o[a]=u,o[s]=l,e(o);if(i>0)u=Math.floor(u/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,l=Math.floor(l*i)/i}r=i}return t},t}function oa(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;d<=h;++d)for(c=1,l=n(d);cu)break;g.push(f)}}else for(;d<=h;++d)for(c=o-1,l=n(d);c>=1;--c)if(!((f=l*c)u)break;g.push(f)}2*g.length180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Uo(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Uo(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Uo(t,n)},{i:s-2,x:Uo(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n6/29*(6/29)*(6/29)?Math.pow(t,1/3):t/(6/29*3*(6/29))+4/29}function ds(t){return t>6/29?t*t*t:6/29*3*(6/29)*(t-4/29)}function hs(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ps(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function gs(t){if(t instanceof bs)return new bs(t.h,t.c,t.l,t.opacity);if(t instanceof cs||(t=us(t)),0===t.a&&0===t.b)return new bs(NaN,00?r:1:0}const Ns="log",Rs="time",Ps="utc",Bs="continuous";function Ls(){const t=Li().unknown(void 0),e=t.domain,n=t.range;let r,i,o=[0,1],a=!1,s=0,u=0,l=.5;function c(){const t=e().length,c=o[1]h+r*t);return n(c?p.reverse():p)}return delete t.unknown,t.domain=function(t){return arguments.length?(e(t),c()):e()},t.range=function(t){return arguments.length?(o=[+t[0],+t[1]],c()):o.slice()},t.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,c()},t.bandwidth=function(){return i},t.step=function(){return r},t.round=function(t){return arguments.length?(a=!!t,c()):a},t.padding=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),s=u,c()):s},t.paddingInner=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),c()):s},t.paddingOuter=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),c()):u},t.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),c()):l},t.invertRange=function(t){if(null==t[0]||null==t[1])return;const r=o[1]o[1-r])?void 0:(u=Math.max(0,Ti(a,f)-1),l=f===d?u:Ti(a,d)-1,f-a[u]>i+1e-10&&++u,r&&(c=u,u=s-l,l=s-c),u>l?void 0:e().slice(u,l+1))},t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n},t.copy=function(){return Ls().domain(e()).range(o).round(a).paddingInner(s).paddingOuter(u).align(l)},c()}var Is=Array.prototype.map;function Us(t){return Is.call(t,Z.db)}const qs=Array.prototype.slice;const Ws={};function Ys(t,e,n){const r=function(){const n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){let n,r=e[0],i=e[1];return i=s&&n[o]<=u&&(l<0&&(l=o),r=o);if(!(l<0))return s=t.invertExtent(n[l]),u=t.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}}(n):void 0),n.type=t,n};return r.metadata=Object(Z.eb)(Object(Z.i)(n)),r}function Hs(t,e,n){return arguments.length>1?(Ws[t]=Ys(t,e,n),this):Gs(t)?Ws[t]:void 0}function Gs(t){return Object(Z.w)(Ws,t)}function Vs(t,e){const n=Ws[t];return n&&n.metadata[e]}function Xs(t){return Vs(t,Bs)}function Js(t){return Vs(t,"discrete")}function Ks(t){return Vs(t,"discretizing")}function Zs(t){return Vs(t,Ns)}function Qs(t){return Vs(t,"interpolating")}function tu(t){return Vs(t,"quantile")}Hs("identity",(function t(e){var n;function r(t){return isNaN(t=+t)?n:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,Xo),r):e.slice()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,Xo):[0,1],ia(r)})),Hs("linear",(function t(){var e=ra();return e.copy=function(){return ea(e,t())},Ri.apply(e,arguments),ia(e)}),Bs),Hs(Ns,(function t(){var e=da(na()).domain([1,10]);return e.copy=function(){return ea(e,t()).base(e.base())},Ri.apply(e,arguments),e}),[Bs,Ns]),Hs("pow",ba,Bs),Hs("sqrt",(function(){return ba.apply(null,arguments).exponent(.5)}),Bs),Hs("symlog",(function t(){var e=xa(na());return e.copy=function(){return ea(e,t()).constant(e.constant())},Ri.apply(e,arguments)}),Bs),Hs(Rs,(function(){return Ri.apply(Fa(_a.a,Oa.a,wa.b,ja.a,ka.a,Ea.a,Aa.a,Da.a,Ma.a).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Bs,"temporal"]),Hs(Ps,(function(){return Ri.apply(Fa(za.a,Ta.a,$a.b,Na.a,Ra.a,Pa.a,Aa.a,Da.a,Ma.c).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Bs,"temporal"]),Hs("sequential",Ia,[Bs,"interpolating"]),Hs("".concat("sequential","-").concat("linear"),Ia,[Bs,"interpolating"]),Hs("".concat("sequential","-").concat(Ns),(function t(){var e=da(Ba()).domain([1,10]);return e.copy=function(){return La(e,t()).base(e.base())},Pi.apply(e,arguments)}),[Bs,"interpolating",Ns]),Hs("".concat("sequential","-").concat("pow"),Ua,[Bs,"interpolating"]),Hs("".concat("sequential","-").concat("sqrt"),(function(){return Ua.apply(null,arguments).exponent(.5)}),[Bs,"interpolating"]),Hs("".concat("sequential","-").concat("symlog"),(function t(){var e=xa(Ba());return e.copy=function(){return La(e,t()).constant(e.constant())},Pi.apply(e,arguments)}),[Bs,"interpolating"]),Hs("".concat("diverging","-").concat("linear"),(function t(){var e=ia(Wa()(Ko));return e.copy=function(){return La(e,t())},Pi.apply(e,arguments)}),[Bs,"interpolating"]),Hs("".concat("diverging","-").concat(Ns),(function t(){var e=da(Wa()).domain([.1,1,10]);return e.copy=function(){return La(e,t()).base(e.base())},Pi.apply(e,arguments)}),[Bs,"interpolating",Ns]),Hs("".concat("diverging","-").concat("pow"),Ya,[Bs,"interpolating"]),Hs("".concat("diverging","-").concat("sqrt"),(function(){return Ya.apply(null,arguments).exponent(.5)}),[Bs,"interpolating"]),Hs("".concat("diverging","-").concat("symlog"),(function t(){var e=xa(Wa());return e.copy=function(){return La(e,t()).constant(e.constant())},Pi.apply(e,arguments)}),[Bs,"interpolating"]),Hs("quantile",(function t(){var e,n=[],r=[],i=[];function o(){var t=0,e=Math.max(1,r.length);for(i=new Array(e-1);++t0?i[e-1]:n[0],e=i?[o[i-1],r]:[o[e-1],o[e]]},s.unknown=function(t){return arguments.length?(e=t,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return t().domain([n,r]).range(a).unknown(e)},Ri.apply(ia(s),arguments)}),"discretizing"),Hs("threshold",(function t(){var e,n=[.5],r=[0,1],i=1;function o(t){return t<=t?r[Ni(n,t,0,i)]:e}return o.domain=function(t){return arguments.length?(n=Array.from(t),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(n).range(r).unknown(e)},Ri.apply(o,arguments)}),"discretizing"),Hs("bin-ordinal",(function t(){let e=[],n=[];function r(t){return null==t||t!=t?void 0:n[(Ni(e,t)-1)%n.length]}return r.domain=function(t){return arguments.length?(e=Us(t),r):e.slice()},r.range=function(t){return arguments.length?(n=qs.call(t),r):n.slice()},r.tickFormat=function(t,n){return Gi(e[0],Object(Z.V)(e),null==t?10:t,n)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r}),["discrete","discretizing"]),Hs("ordinal",Li,"discrete"),Hs("band",Ls,"discrete"),Hs("point",(function(){return function t(e){const n=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return t(n())},e}(Ls().paddingInner(1))}),"discrete");const eu=["clamp","base","constant","exponent"];function nu(t,e){const n=e[0],r=Object(Z.V)(e)-n;return function(e){return t(n+e*r)}}function ru(t,e,n){return qa(au(e||"rgb",n),t)}function iu(t,e){const n=new Array(e),r=e+1;for(let i=0;it[e]?a[e](t[e]()):0),a):Object(Z.m)(.5)}function au(t,e){const n=a[function(t){return"interpolate"+t.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function su(t){const e=t.length/6|0,n=new Array(e);for(let r=0;r1?(lu[t]=e,this):lu[t]}uu({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"},su),uu({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"},t=>ru(su(t)));const fu=t=>Object(Z.B)(t)?t.map(t=>String(t)):String(t),du=(t,e)=>t[1]-e[1],hu=(t,e)=>e[1]-t[1];function pu(t,e,n){let r;return Object(Z.F)(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),null!=n&&(e=Math.min(e,Math.floor(Object(Z.Y)(t.domain())/n||1)))),Object(Z.G)(e)&&(r=e.step,e=e.interval),Object(Z.I)(e)&&(e=t.type===Rs?Object(He.p)(e):t.type==Ps?Object(He.v)(e):Object(Z.o)("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function gu(t,e,n){let r=t.range(),i=r[0],o=Object(Z.V)(r),a=du;if(i>o&&(r=o,o=i,i=r,a=hu),i=Math.floor(i),o=Math.ceil(o),e=e.map(e=>[e,t(e)]).filter(t=>i<=t[1]&&t[1]<=o).sort(a).map(t=>t[0]),n>0&&e.length>1){const t=[e[0],Object(Z.V)(e)];for(;e.length>n&&e.length>=3;)e=e.filter((t,e)=>!(e%2));e.length<3&&(e=t)}return e}function mu(t,e){return t.bins?gu(t,t.bins):t.ticks?t.ticks(e):t.domain()}function bu(t,e,n,r,i,o){const a=e.type;let s=fu;if(a===Rs||i===Rs)s=t.timeFormat(r);else if(a===Ps||i===Ps)s=t.utcFormat(r);else if(Zs(a)){const i=t.formatFloat(r);if(o||e.bins)s=i;else{const t=yu(e,n,!1);s=e=>t(e)?i(e):""}}else if(e.tickFormat){const i=e.domain();s=t.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=t.format(r));return s}function yu(t,e,n){const r=mu(t,e),i=t.base(),o=Math.log(i),a=Math.max(1,i*e/r.length),s=t=>{let e=t/Math.pow(i,Math.round(Math.log(t)/o));return e*i1?r[1]-r[0]:r[0];for(o=1;ovu[t.type]||t.bins)(e)?wu(s):"discrete"===r?ku(s):Eu(s)}const wu=t=>(e,n,r)=>{const i=ju(r[n+1],ju(r.max,1/0)),o=Au(e,t),a=Au(i,t);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},ju=(t,e)=>null!=t?t:e,ku=t=>(e,n)=>n?t(e):null,Eu=t=>e=>t(e),Au=(t,e)=>Number.isFinite(t)?e(t):null;function Du(t,e,n,r){const i=r||e.type;return Object(Z.I)(n)&&Vs(i,"temporal")&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==Rs?n||i!==Ps?Ou(t,e,5,null,n,r,!0):t.utcFormat("%A, %d %B %Y, %X UTC"):t.timeFormat("%A, %d %B %Y, %X")}function Mu(t,e,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=Du(t,e,n.format,n.formatType);if(Ks(e.type)){const t=_u(e).slice(1).map(i),n=t.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(t.join(", "))}if(Js(e.type)){const t=e.domain(),n=t.length,o=n>r?t.slice(0,r-2).map(i).join(", ")+", ending with "+t.slice(-1).map(i):t.map(i).join(", ");return"".concat(n," value").concat(1===n?"":"s",": ").concat(o)}{const t=e.domain();return"values from ".concat(i(t[0])," to ").concat(i(Object(Z.V)(t)))}}let Su=0;function Cu(t){return t&&t.gradient}function Fu(t,e,n){const r=t.gradient;let i=t.id,o="radial"===r?"p_":"";return i||(i=t.id="gradient_"+Su++,"radial"===r?(t.x1=zu(t.x1,.5),t.y1=zu(t.y1,.5),t.r1=zu(t.r1,0),t.x2=zu(t.x2,.5),t.y2=zu(t.y2,.5),t.r2=zu(t.r2,.5),o="p_"):(t.x1=zu(t.x1,0),t.y1=zu(t.y1,0),t.x2=zu(t.x2,1),t.y2=zu(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function zu(t,e){return null!=t?t:e}function Tu(t,e){var n,r=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:r,stop:function(t,e){return r.push({offset:t,color:e}),n}}}const $u={basis:{curve:function(t){return new vr(t)}},"basis-closed":{curve:function(t){return new _r(t)}},"basis-open":{curve:function(t){return new Or(t)}},bundle:{curve:jr,tension:"beta",value:.85},cardinal:{curve:Ar,tension:"tension",value:0},"cardinal-open":{curve:Mr,tension:"tension",value:0},"cardinal-closed":{curve:Cr,tension:"tension",value:0},"catmull-rom":{curve:Hr,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Vr,tension:"alpha",value:.5},"catmull-rom-open":{curve:Jr,tension:"alpha",value:.5},linear:{curve:Zr},"linear-closed":{curve:function(t){return new Qr(t)}},monotone:{horizontal:function(t){return new oi(t)},vertical:function(t){return new ii(t)}},natural:{curve:function(t){return new si(t)}},step:{curve:function(t){return new li(t,.5)}},"step-after":{curve:function(t){return new li(t,1)}},"step-before":{curve:function(t){return new li(t,0)}}};function Nu(t,e,n){var r=Object(Z.w)($u,t)&&$u[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const Ru={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},Pu=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];function Bu(t){const e=[];let n,r,i,o,a,s,u,l,c,f;const d=t.slice().replace(Pu[0],"###$1").split(Pu[1]).slice(1);for(u=0,c=d.length;us){const t=i.length;for(l=1,e.push([a].concat(i.slice(l,l+=s))),a="M"===a?"L":"m"===a?"l":a;l1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,b=f/n,y=-f/r,v=d/r,x=m*s+b*u,_=y*s+v*u,O=m*t+b*e,w=y*t+v*e,j=(O-x)*(O-x)+(w-_)*(w-_);let k=1/j-.25;k<0&&(k=0);let E=Math.sqrt(k);o==i&&(E=-E);const A=.5*(x+O)-E*(w-_),D=.5*(_+w)+E*(O-x),M=Math.atan2(_-D,x-A),S=Math.atan2(w-D,O-A);let C=S-M;C<0&&1===o?C+=Uu:C>0&&0===o&&(C-=Uu);const F=Math.ceil(Math.abs(C/(Iu+.001))),z=[];for(let t=0;t+t}function sl(t,e,n){return Math.max(e,Math.min(t,n))}function ul(){var t=nl,e=rl,n=il,r=ol,i=al(0),o=i,a=i,s=i,u=null;function l(l,c,f){var d,h=null!=c?c:+t.call(this,l),p=null!=f?f:+e.call(this,l),g=+n.call(this,l),m=+r.call(this,l),b=Math.min(g,m)/2,y=sl(+i.call(this,l),0,b),v=sl(+o.call(this,l),0,b),x=sl(+a.call(this,l),0,b),_=sl(+s.call(this,l),0,b);if(u||(u=d=gi()),y<=0&&v<=0&&x<=0&&_<=0)u.rect(h,p,g,m);else{var O=h+g,w=p+m;u.moveTo(h+y,p),u.lineTo(O-v,p),u.bezierCurveTo(O-.448084975506*v,p,O,p+.448084975506*v,O,p+v),u.lineTo(O,w-_),u.bezierCurveTo(O,w-.448084975506*_,O-.448084975506*_,w,O-_,w),u.lineTo(h+x,w),u.bezierCurveTo(h+.448084975506*x,w,h,w-.448084975506*x,h,w-x),u.lineTo(h,p+y),u.bezierCurveTo(h,p+.448084975506*y,h+.448084975506*y,p,h+y,p),u.closePath()}if(d)return u=null,d+""||null}return l.x=function(e){return arguments.length?(t=al(e),l):t},l.y=function(t){return arguments.length?(e=al(t),l):e},l.width=function(t){return arguments.length?(n=al(t),l):n},l.height=function(t){return arguments.length?(r=al(t),l):r},l.cornerRadius=function(t,e,n,r){return arguments.length?(i=al(t),o=null!=e?al(e):i,s=null!=n?al(n):i,a=null!=r?al(r):o,l):i},l.context=function(t){return arguments.length?(u=null==t?null:t,l):u},l}function ll(){var t,e,n,r,i,o,a,s,u=null;function l(t,e,n){const r=n/2;if(i){var l=a-e,c=t-o;if(l||c){var f=Math.sqrt(l*l+c*c),d=(l/=f)*s,h=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(o-d,a-h),u.lineTo(t-l*r,e-c*r),u.arc(t,e,r,p-Math.PI,p),u.lineTo(o+d,a+h),u.arc(o,a,s,p,p+Math.PI)}else u.arc(t,e,r,0,Uu);u.closePath()}else i=1;o=t,a=e,s=r}function c(o){var a,s,c,f=o.length,d=!1;for(null==u&&(u=c=gi()),a=0;a<=f;++a)!(at.x||0,dl=t=>t.y||0,hl=t=>!(!1===t.defined),pl=function(){var t=bi,e=yi,n=mi(0),r=null,i=vi,o=xi,a=_i,s=null;function u(){var u,l,c=+t.apply(this,arguments),f=+e.apply(this,arguments),d=i.apply(this,arguments)-Lr,h=o.apply(this,arguments)-Lr,p=Fr(h-d),g=h>d;if(s||(s=u=gi()),f1e-12)if(p>Ir-1e-12)s.moveTo(f*Tr(d),f*Rr(d)),s.arc(0,0,f,d,h,!g),c>1e-12&&(s.moveTo(c*Tr(h),c*Rr(h)),s.arc(0,0,c,h,d,g));else{var m,b,y=d,v=h,x=d,_=h,O=p,w=p,j=a.apply(this,arguments)/2,k=j>1e-12&&(r?+r.apply(this,arguments):Pr(c*c+f*f)),E=Nr(Fr(f-c)/2,+n.apply(this,arguments)),A=E,D=E;if(k>1e-12){var M=qr(k/c*Rr(j)),S=qr(k/f*Rr(j));(O-=2*M)>1e-12?(x+=M*=g?1:-1,_-=M):(O=0,x=_=(d+h)/2),(w-=2*S)>1e-12?(y+=S*=g?1:-1,v-=S):(w=0,y=v=(d+h)/2)}var C=f*Tr(y),F=f*Rr(y),z=c*Tr(_),T=c*Rr(_);if(E>1e-12){var $,N=f*Tr(v),R=f*Rr(v),P=c*Tr(x),B=c*Rr(x);if(p1e-12?D>1e-12?(m=wi(P,B,C,F,f,D,g),b=wi(N,R,z,T,f,D,g),s.moveTo(m.cx+m.x01,m.cy+m.y01),D1e-12&&O>1e-12?A>1e-12?(m=wi(z,T,N,R,c,-A,g),b=wi(C,F,P,B,c,-A,g),s.lineTo(m.cx+m.x01,m.cy+m.y01),At.startAngle||0).endAngle(t=>t.endAngle||0).padAngle(t=>t.padAngle||0).innerRadius(t=>t.innerRadius||0).outerRadius(t=>t.outerRadius||0).cornerRadius(t=>t.cornerRadius||0),gl=Di().x(fl).y1(dl).y0(t=>(t.y||0)+(t.height||0)).defined(hl),ml=Di().y(dl).x1(fl).x0(t=>(t.x||0)+(t.width||0)).defined(hl),bl=Ai().x(fl).y(dl).defined(hl),yl=ul().x(fl).y(dl).width(t=>t.width||0).height(t=>t.height||0).cornerRadius(t=>cl(t.cornerRadiusTopLeft,t.cornerRadius)||0,t=>cl(t.cornerRadiusTopRight,t.cornerRadius)||0,t=>cl(t.cornerRadiusBottomRight,t.cornerRadius)||0,t=>cl(t.cornerRadiusBottomLeft,t.cornerRadius)||0),vl=function(t,e){var n=null;function r(){var r;if(n||(n=r=gi()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return t="function"==typeof t?t:mi(t||Mi),e="function"==typeof e?e:mi(void 0===e?64:+e),r.type=function(e){return arguments.length?(t="function"==typeof e?e:mi(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:mi(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type(t=>tl(t.shape||"circle")).size(t=>cl(t.size,64)),xl=ll().x(fl).y(dl).defined(hl).size(t=>t.size||1);function _l(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function Ol(t,e,n,r){return yl.context(t)(e,n,r)}var wl=1;function jl(){wl=1}function kl(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+wl++),a=i.clipping[o]||(i.clipping[o]={id:o});return Object(Z.E)(r)?a.path=r(null):_l(n)?a.path=Ol(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function El(t){this.clear(),t&&this.union(t)}function Al(t){this.mark=t,this.bounds=this.bounds||new El}function Dl(t){Al.call(this,t),this.items=this.items||[]}function Ml(t){this._pending=0,this._loader=t||Object(Q.e)()}function Sl(t){t._pending+=1}function Cl(t){t._pending-=1}function Fl(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const r=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(r+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,r):0))}return t}El.prototype={clone(){return new El(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,r){return nthis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){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(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const r=this.rotatedPoints(t,e,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(t,e,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(t),u=Math.sin(t),l=e-e*s+n*u,c=n-e*u-n*s;return[s*r-u*i+l,u*r+s*i+c,s*r-u*a+l,u*r+s*a+c,s*o-u*i+l,u*o+s*i+c,s*o-u*a+l,u*o+s*a+c]},union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)},contains(t,e){return!(tthis.x2||ethis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},Object(Z.z)(Dl,Al),Ml.prototype={pending(){return this._pending},sanitizeURL(t){const e=this;return Sl(e),e._loader.sanitize(t,{context:"href"}).then(t=>(Cl(e),t)).catch(()=>(Cl(e),null))},loadImage(t){const e=this,n=Fi();return Sl(e),e._loader.sanitize(t,{context:"image"}).then(t=>{const r=t.href;if(!r||!n)throw{url:r};const i=new n,o=Object(Z.w)(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>Cl(e),i.onerror=()=>Cl(e),i.src=r,i}).catch(t=>(Cl(e),{complete:!1,width:0,height:0,src:t&&t.url||""}))},ready(){const t=this;return new Promise(e=>{!function n(r){t.pending()?setTimeout(()=>{n(!0)},10):e(r)}(!1)})}};const zl=Uu-1e-8;let Tl,$l,Nl,Rl,Pl,Bl,Ll,Il;const Ul=(t,e)=>Tl.add(t,e),ql=(t,e)=>Ul($l=t,Nl=e),Wl=t=>Ul(t,Tl.y1),Yl=t=>Ul(Tl.x1,t),Hl=(t,e)=>Pl*t+Ll*e,Gl=(t,e)=>Bl*t+Il*e,Vl=(t,e)=>Ul(Hl(t,e),Gl(t,e)),Xl=(t,e)=>ql(Hl(t,e),Gl(t,e));function Jl(t,e){return Tl=t,e?(Rl=e*Lu,Pl=Il=Math.cos(Rl),Bl=Math.sin(Rl),Ll=-Bl):(Pl=Il=1,Rl=Bl=Ll=0),Kl}const Kl={beginPath(){},closePath(){},moveTo:Xl,lineTo:Xl,rect(t,e,n,r){Rl?(Vl(t+n,e),Vl(t+n,e+r),Vl(t,e+r),Xl(t,e)):(Ul(t+n,e+r),ql(t,e))},quadraticCurveTo(t,e,n,r){const i=Hl(t,e),o=Gl(t,e),a=Hl(n,r),s=Gl(n,r);Zl($l,i,a,Wl),Zl(Nl,o,s,Yl),ql(a,s)},bezierCurveTo(t,e,n,r,i,o){const a=Hl(t,e),s=Gl(t,e),u=Hl(n,r),l=Gl(n,r),c=Hl(i,o),f=Gl(i,o);Ql($l,a,u,c,Wl),Ql(Nl,s,l,f,Yl),ql(c,f)},arc(t,e,n,r,i,o){if(r+=Rl,i+=Rl,$l=n*Math.cos(i)+t,Nl=n*Math.sin(i)+e,Math.abs(i-r)>zl)Ul(t-n,e-n),Ul(t+n,e+n);else{const a=r=>Ul(n*Math.cos(r)+t,n*Math.sin(r)+e);let s,u;if(a(r),a(i),i!==r)if((r%=Uu)<0&&(r+=Uu),(i%=Uu)<0&&(i+=Uu),ii;++u,s-=Iu)a(s);else for(s=r-r%Iu+Iu,u=0;u<4&&s1e-14?(u=a*a+s*o,u>=0&&(u=Math.sqrt(u),l=(-a+u)/o,c=(-a-u)/o)):l=.5*s/a,0m)return!1;h>g&&(g=h)}else if(f>0){if(h0&&(t.globalAlpha=n,t.fillStyle=fc(t,e,e.fill),!0)}var hc=[];function pc(t,e,n){var r=null!=(r=e.strokeWidth)?r:1;return!(r<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=fc(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||hc),t.lineDashOffset=e.strokeDashOffset||0),!0))}function gc(t,e){return t.zindex-e.zindex||t.index-e.index}function mc(t){if(!t.zdirty)return t.zitems;var e,n,r,i=t.items,o=[];for(n=0,r=i.length;n=0;)if(n=e(i[r]))return n;if(i===o)for(r=(i=t.items).length;--r>=0;)if(!i[r].zindex&&(n=e(i[r])))return n;return null}function vc(t){return function(e,n,r){bc(n,n=>{r&&!r.intersects(n.bounds)||xc(t,e,n,n)})}}function xc(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(uc(e,n),n.fill&&dc(e,n,i)&&e.fill(),n.stroke&&pc(e,n,i)&&e.stroke()))}function _c(t){return t=t||Z.hb,function(e,n,r,i,o,a){return r*=e.pixelRatio,i*=e.pixelRatio,yc(n,n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return t(e,n,r,i,o,a)?n:void 0})}}function Oc(t,e){return function(n,r,i,o){var a,s,u=Array.isArray(r)?r[0]:r,l=null==e?u.fill:e,c=u.stroke&&n.isPointInStroke;return c&&(a=u.strokeWidth,s=u.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!t(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function wc(t){return _c(Oc(t))}function jc(t,e){return"translate("+t+","+e+")"}function kc(t){return"rotate("+t+")"}function Ec(t){return jc(t.x||0,t.y||0)}function Ac(t,e,n){function r(t,n){var r=n.x||0,i=n.y||0,o=n.angle||0;t.translate(r,i),o&&t.rotate(o*=Lu),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return jc(t.x||0,t.y||0)+(t.angle?" "+kc(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e(Jl(t,n.angle),n),Fl(t,n).translate(n.x||0,n.y||0)},draw:vc(r),pick:wc(r),isect:n||rc(r)}}var Dc=Ac("arc",(function(t,e){return pl.context(t)(e)}));function Mc(t,e,n){function r(t,n){t.beginPath(),e(t,n)}const i=Oc(r);return{type:t,tag:"path",nested:!0,attr:function(t,n){var r=n.mark.items;r.length&&t("d",e(null,r))},bound:function(t,n){var r=n.items;return 0===r.length?t:(e(Jl(t),r),Fl(t,r[0]))},draw:(o=r,function(t,e,n){!e.items.length||n&&!n.intersects(e.bounds)||xc(o,t,e.items[0],e.items)}),pick:function(t,e,n,r,o,a){var s=e.items,u=e.bounds;return!s||!s.length||u&&!u.contains(o,a)?null:(n*=t.pixelRatio,r*=t.pixelRatio,i(t,s,n,r)?s[0]:null)},isect:ic,tip:n};var o}var Sc=Mc("area",(function(t,e){const n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?ml:gl).curve(Nu(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",a=t.length,s=1/0;--a>=0;)!1!==t[a].defined&&(r=Math.abs(t[a][o]-i)).5&&e<1.5?.5-Math.abs(e-1):0}function zc(t,e){const n=Fc(e);t("d",Ol(null,e,n,n))}function Tc(t,e,n,r){const i=Fc(e);t.beginPath(),Ol(t,e,(n||0)+i,(r||0)+i)}const $c=Oc(Tc),Nc=Oc(Tc,!1),Rc=Oc(Tc,!0);var Pc={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",Ec(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,r=n.length;for(let e=0;e{const r=e.x||0,i=e.y||0,o=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(Tc(t,e,r,i),uc(t,e),e.fill&&dc(t,e,a)&&t.fill(),e.stroke&&!o&&pc(t,e,a)&&t.stroke()),t.save(),t.translate(r,i),e.clip&&Cc(t,e),n&&n.translate(-r,-i),bc(e,e=>{this.draw(t,e,n)}),n&&n.translate(r,i),t.restore(),o&&e.stroke&&a&&(Tc(t,e,r,i),uc(t,e),pc(t,e,a)&&t.stroke())})},pick:function(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;const a=n*t.pixelRatio,s=r*t.pixelRatio;return yc(e,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(i,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(ih||op))return;if(t.save(),t.translate(c,f),c=i-c,f=o-f,g&&_l(u)&&!Rc(t,u,a,s))return t.restore(),null;const m=u.strokeForeground,b=!1!==e.interactive;return b&&m&&u.stroke&&Nc(t,u,a,s)?(t.restore(),u):(l=yc(u,t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,c,f)?this.pick(t,n,r,c,f):null),!l&&b&&(u.fill||!m&&u.stroke)&&$c(t,u,a,s)&&(l=u),t.restore(),l||null)})},isect:oc,content:function(t,e,n){t("clip-path",e.clip?kl(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),zc(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?zc(t,e):t("d","")}},Bc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Lc(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(e=>{t.image=e,t.image.url=t.url})),n}function Ic(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function Uc(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function qc(t,e){return"center"===t?e/2:"right"===t?e:0}function Wc(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var Yc={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const r=Lc(e,n),i=Ic(e,r),o=Uc(e,r),a=(e.x||0)-qc(e.align,i),s=(e.y||0)-Wc(e.baseline,o);t("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",Bc["xmlns:xlink"],"xlink:href"),t("transform",jc(a,s)),t("width",i),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,r=Ic(e,n),i=Uc(e,n),o=(e.x||0)-qc(e.align,r),a=(e.y||0)-Wc(e.baseline,i);return t.set(o,a,o+r,a+i)},draw:function(t,e,n){bc(e,e=>{if(n&&!n.intersects(e.bounds))return;const r=Lc(e,this);let i,o,a,s,u=Ic(e,r),l=Uc(e,r),c=(e.x||0)-qc(e.align,u),f=(e.y||0)-Wc(e.baseline,l);!1!==e.aspect&&(o=r.width/r.height,a=e.width/e.height,o==o&&a==a&&o!==a&&(a=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(r=t[o].y-e[1])*r{if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&Kc(t,e,r)&&(uc(t,e),t.stroke())}})},pick:_c((function(t,e,n,r){return!!t.isPointInStroke&&(Kc(t,e,1)&&t.isPointInStroke(n,r))})),isect:ac},Qc=Ac("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),tf=Ac("symbol",(function(t,e){return vl.context(t)(e)}),ic);const ef=Object(Z.M)();var nf={height:lf,measureWidth:sf,estimateWidth:of,width:of,canvas:rf};function rf(t){nf.width=t&&ec?sf:of}function of(t,e){return af(hf(t,e),lf(t))}function af(t,e){return~~(.8*t.length*e)}function sf(t,e){return lf(t)<=0||!(e=hf(t,e))?0:uf(e,gf(t))}function uf(t,e){const n="(".concat(e,") ").concat(t);let r=ef.get(n);return void 0===r&&(ec.font=e,r=ec.measureText(t).width,ef.set(n,r)),r}function lf(t){return null!=t.fontSize?+t.fontSize||0:11}function cf(t){return null!=t.lineHeight?t.lineHeight:lf(t)+2}function ff(t){return e=t.lineBreak&&t.text&&!Object(Z.B)(t.text)?t.text.split(t.lineBreak):t.text,Object(Z.B)(e)?e.length>1?e:e[0]:e;var e}function df(t){const e=ff(t);return(Object(Z.B)(e)?e.length-1:0)*cf(t)}function hf(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,r=function(t){if(nf.width===sf){const e=gf(t);return t=>uf(t,e)}{const e=lf(t);return t=>af(t,e)}}(t);if(r(e)>>1,r(e.slice(i))>n?s=i+1:u=i;return o+e.slice(s)}for(;s>>1),r(e.slice(0,i))Math.max(t,nf.width(e,n)),0)):r=nf.width(e,f),"center"===o?l-=r/2:"right"===o&&(l-=r),t.set(l+=s,c+=u,l+r,c+i),e.angle&&!n)t.rotate(e.angle*Lu,s,u);else if(2===n)return t.rotatedPoints(e.angle*Lu,s,u);return t}var _f={arc:Dc,area:Sc,group:Pc,image:Yc,line:Hc,path:Vc,rect:Jc,rule:Zc,shape:Qc,symbol:tf,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+mf(e),o=vf(e),a=o.x1,s=o.y1,u=e.angle||0;t("text-anchor",bf[e.align]||"start"),u?(n=jc(a,s)+" "+kc(u),(r||i)&&(n+=" "+jc(r,i))):n=jc(a+r,s+i),t("transform",n)},bound:xf,draw:function(t,e,n){bc(e,e=>{var r,i,o,a,s,u,l,c=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===c||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=gf(e),t.textAlign=e.align||"left",i=(r=vf(e)).x1,o=r.y1,e.angle&&(t.save(),t.translate(i,o),t.rotate(e.angle*Lu),i=o=0),i+=e.dx||0,o+=(e.dy||0)+mf(e),u=ff(e),uc(t,e),Object(Z.B)(u))for(s=cf(e),a=0;a=0;)if(!1!==t[i].defined&&(n=t[i].x-e[0])*n+(r=t[i].y-e[1])*r<(n=t[i].size||1)*n)return t[i];return null}))};function Of(t,e,n){var r=_f[t.mark.marktype],i=e||r.bound;return r.nested&&(t=t.mark),i(t.bounds||(t.bounds=new El),t,n)}var wf={mark:null};function jf(t,e,n){var r,i,o,a,s=_f[t.marktype],u=s.bound,l=t.items,c=l&&l.length;if(s.nested)return c?o=l[0]:(wf.mark=t,o=wf),a=Of(o,u,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new El,c)for(r=0,i=l.length;re;)t.removeChild(n[--r]);return t}function Tf(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function $f(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function Nf(t,e){this._active=null,this._handlers={},this._loader=t||Object(Q.e)(),this._tooltip=e||Rf}function Rf(t,e,n,r){t.element().setAttribute("title",r||"")}function Pf(t){this._el=null,this._bgcolor=null,this._loader=new Ml(t)}Df.prototype={toJSON(t){return Ef(this.root,t||0)},mark(t,e,n){const r=Mf(t,e=e||this.root.items[0]);return e.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},Nf.prototype={initialize(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},scene(t){return arguments.length?(this._scene=t,this):this._scene},on(){},off(){},_handlerIndex(t,e,n){for(let r=t?t.length:0;--r>=0;)if(t[r].type===e&&(!n||t[r].handler===n))return r;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push(...e[this.eventName(t)]);else for(const t in e)n.push(...e[t]);return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then(e=>{const n=new MouseEvent(t.type,t),r=Sf(null,"a");for(const t in e)r.setAttribute(t,e[t]);r.dispatchEvent(n)}).catch(()=>{})},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,r){var i,o,a=t&&t.mark;if(a&&(i=_f[a.marktype]).tip){for((o=$f(e,n))[0]-=r[0],o[1]-=r[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=i.tip(a.items,o)}return t}(e,t,this.canvas(),this._origin);const r=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,r)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),r=this._origin,i=t.bounds,o=i.width(),a=i.height();let s=i.x1+r[0]+n.left,u=i.y1+r[1]+n.top;for(;t.mark&&(t=t.mark.group);)s+=t.x||0,u+=t.y||0;return{x:s,y:u,width:o,height:a,left:s,top:u,right:s+o,bottom:u+a}}},Pf.prototype={initialize(t,e,n,r,i){return this._el=t,this.resize(e,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},resize(t,e,n,r){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(t){const e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},_render(){},renderAsync(t){const e=this.render(t);return this._ready?this._ready.then(()=>e):Promise.resolve(e)},_load(t,e){var n=this,r=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then(e=>{e&&t(),n._ready=null})}return r},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const Bf="dragleave",Lf="mousedown",If="mousemove",Uf="mouseout",qf="click",Wf=["keydown","keypress","keyup","dragenter",Bf,"dragover",Lf,"mouseup",If,Uf,"mouseover",qf,"dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],Yf=If,Hf=Uf,Gf=qf;function Vf(t,e){Nf.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}function Xf(t,e){(t=>"touchstart"===t||"touchmove"===t||"touchend"===t?["touchstart","touchmove","touchend"]:[t])(e).forEach(e=>function(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n)))}(t,e))}function Jf(t,e,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||this.fire(n,r),this._active=o,this.fire(e,r)),this.fire(t,r)}}function Kf(t){return function(e){this.fire(t,e),this._active=null}}Object(Z.z)(Vf,Nf,{initialize(t,e,n){return this._canvas=t&&Cf(t,"canvas"),[qf,Lf,If,Uf,Bf].forEach(t=>Xf(this,t)),Nf.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:Wf,DOMMouseScroll(t){this.fire("mousewheel",t)},mousemove:Jf(If,"mouseover",Uf),dragover:Jf("dragover","dragenter",Bf),mouseout:Kf(Uf),dragleave:Kf(Bf),mousedown(t){this._down=this._active,this.fire(Lf,t)},click(t){this._down===this._active&&(this.fire(qf,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},touchmove(t){this.fire("touchmove",t,!0)},touchend(t){this.fire("touchend",t,!0),this._touch=null},fire(t,e,n){const r=n?this._touch:this._active,i=this._handlers[t];if(e.vegaType=t,t===Gf&&r&&r.href?this.handleHref(e,r,r.href):t!==Yf&&t!==Hf||this.handleTooltip(e,r,t!==Hf),i)for(let t=0,n=i.length;t=0&&r.splice(i,1),this},pickEvent(t){const e=$f(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,r,i){const o=this.context();return _f[t.marktype].pick.call(this,o,t,e,n,r,i)}});var Zf="undefined"!=typeof window&&window.devicePixelRatio||1;function Qf(t){Pf.call(this,t),this._options={},this._redraw=!1,this._dirty=new El,this._tempb=new El}const td=Pf.prototype;function ed(t,e){Nf.call(this,t,e);const n=this;n._hrefHandler=nd(n,(t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)}),n._tooltipHandler=nd(n,(t,e)=>{n.handleTooltip(t,e,t.type!==Hf)})}Object(Z.z)(Qf,Pf,{initialize(t,e,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Ci(1,1,this._options.type),t&&this._canvas&&(zf(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),td.initialize.call(this,t,e,n,r,i)},resize(t,e,n,r){if(td.resize.call(this,t,e,n,r),this._canvas)!function(t,e,n,r,i,o){const a="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,s=t.getContext("2d"),u=a?Zf:i;t.width=e*u,t.height=n*u;for(const t in o)s[t]=o[t];a&&1!==u&&(t.style.width=e+"px",t.style.height=n+"px"),s.pixelRatio=u,s.setTransform(u,0,0,u,u*r[0],u*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||Object(Z.o)("CanvasRenderer is missing a valid canvas or context"),t.scale(this._scale,this._scale),t.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(t){const e=this._tempb.clear().union(t.bounds);let n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)},_render(t){const e=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,a=(s=n,u=r,l=i,(new El).set(0,0,u,l).translate(-s[0],-s[1]));var s,u,l;e.save();const c=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,a.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(e,t,c),e.restore(),o.clear(),this},draw(t,e,n){const r=_f[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),Object(Z.E)(n)?(t.beginPath(),n(t),t.clip()):Cc(t,e.group)}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},clear(t,e,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(t,e,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,r))}});const nd=(t,e)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)};Object(Z.z)(ed,Nf,{initialize(t,e,n){let r=this._svg;return r&&(r.removeEventListener(Gf,this._hrefHandler),r.removeEventListener(Yf,this._tooltipHandler),r.removeEventListener(Hf,this._tooltipHandler)),this._svg=r=t&&Cf(t,"svg"),r&&(r.addEventListener(Gf,this._hrefHandler),r.addEventListener(Yf,this._tooltipHandler),r.addEventListener(Hf,this._tooltipHandler)),Nf.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[n],t,e)<0){const i={type:t,handler:e,listener:nd(this,e)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const rd=(t,e,n)=>({role:t,"aria-roledescription":e,"aria-label":n||void 0}),id=Object(Z.eb)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),od={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,r=e.title?cd(t):null,i=t.context,o=i.scales[e.scale].value,a=i.dataflow.locale(),s=o.type;return"".concat("left"===n||"right"===n?"Y":"X","-axis")+(r?" titled '".concat(r,"'"):"")+" for a ".concat(Js(s)?"discrete":s," scale")+" with ".concat(Mu(a,o,t))}},legend:{desc:"legend",caption:function(t){const e=t.datum,n=e.title?cd(t):null,r="".concat(e.type||""," legend").trim(),i=e.scales,o=Object.keys(i),a=t.context,s=a.scales[i[o[0]]].value,u=a.dataflow.locale();return l=r,(l.length?l[0].toUpperCase()+l.slice(1):l)+(n?" titled '".concat(n,"'"):"")+" for ".concat(function(t){return(t=t.map(t=>t+("fill"===t||"stroke"===t?" color":""))).length<2?t[0]:t.slice(0,-1).join(", ")+" and "+Object(Z.V)(t)}(o))+" with ".concat(Mu(u,s,t));var l}},"title-text":{desc:"title",caption:t=>"Title text '".concat(ld(t),"'")},"title-subtitle":{desc:"subtitle",caption:t=>"Subtitle text '".concat(ld(t),"'")}},ad={ariaRole:"role",ariaRoleDescription:"aria-roledescription",description:"aria-label"};function sd(t,e){const n=!1===e.aria;if(t("aria-hidden",n||void 0),n||null==e.description)for(const e in ad)t(ad[e],void 0);else{const n=e.mark.marktype;t("aria-label",e.description),t("role",e.ariaRole||("group"===n?"graphics-object":"graphics-symbol")),t("aria-roledescription",e.ariaRoleDescription||"".concat(n," mark"))}}function ud(t){return!1===t.aria?{"aria-hidden":!0}:id[t.role]?null:od[t.role]?function(t,e){try{const n=t.items[0],r=e.caption||(()=>"");return rd(e.role||"graphics-symbol",e.desc,n.description||r(n))}catch(t){return null}}(t,od[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some(t=>null!=t.description&&!1!==t.aria);return rd(n?"graphics-object":"graphics-symbol","".concat(e," mark container"),t.description)}(t)}function ld(t){return Object(Z.i)(t.text).join(" ")}function cd(t){try{return Object(Z.i)(Object(Z.V)(t.items).items[0].text).join(" ")}catch(t){return null}}const fd=t=>(t+"").replace(/&/g,"&").replace(//g,">");function dd(){let t="",e="",n="";const r=[],i=()=>e=n="",o=(t,n)=>(null!=n&&(e+=" ".concat(t,'="').concat(fd(n).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," "),'"')),a),a={open(s,...u){(o=>{e&&(t+="".concat(e,">").concat(n),i()),r.push(o)})(s),e="<"+s;for(const t of u)for(const e in t)o(e,t[e]);return a},close(){const o=r.pop();return t+=e?e+(n?">".concat(n,""):"/>"):""),i(),a},attr:o,text:t=>(n+=fd(t),a),toString:()=>t};return a}const hd=t=>function t(e,n){if(e.open(n.tagName),n.hasAttributes()){const t=n.attributes,r=t.length;for(let n=0;n1&&t.previousSibling!=e}(a,n))&&e.insertBefore(a,n?n.nextSibling:e.firstChild),a}Object(Z.z)(bd,Pf,{initialize(t,e,n,r,i){return this._defs={},this._clearDefs(),t&&(this._svg=Ff(t,0,"svg",md),Dd(this._svg,Bc),this._svg.setAttribute("class","marks"),zf(t,1),this._root=Ff(this._svg,0,"g",md),Dd(this._root,gd),zf(this._svg,1)),this.background(this._bgcolor),yd.initialize.call(this,t,e,n,r,i)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),yd.background.apply(this,arguments)},resize(t,e,n,r){return yd.resize.call(this,t,e,n,r),this._svg&&(Dd(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(){return this._svg},svg(){const t=this._svg,e=this._bgcolor;if(!t)return null;let n;e&&(t.removeAttribute("style"),n=Ff(t,0,"rect",md),Dd(n,{width:this._width,height:this._height,fill:e}));const r=hd(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),r},_render(t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t),zf(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},isDirty(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const e=++this._dirtyID;let n,r,i,o,a,s,u;for(a=0,s=t.length;a{t.dirty=e})),r.zdirty||(n.exit?(o.nested&&r.items.length?(u=r.items[0],u._svg&&this._update(o,u._svg,u)):n._svg&&(u=n._svg.parentNode,u&&u.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==e&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,vd(n,e)),n._update=e)));return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;const r=this._svg,i=_f[e.marktype],o=!1===e.interactive?"none":null,a="g"===i.tag;let s=null,u=0;const l=Od(e,t,n,"g",r);l.setAttribute("class",Tf(e));const c=ud(e);for(const t in c)Md(l,t,c[t]);a||Md(l,"pointer-events",o),Md(l,"clip-path",e.clip?kl(this,e,e.group):null);const f=t=>{const e=this.isDirty(t),n=Od(t,l,s,i.tag,r);e&&(this._update(i,n,t),a&&function(t,e,n){e=e.lastChild.previousSibling;let r,i=0;bc(n,n=>{r=t.mark(e,n,r),++i}),zf(e,1+i)}(this,n,t)),s=n,++u};return i.nested?e.items.length&&f(e.items[0]):bc(e,f),zf(l,u),l},_update(t,e,n){wd=e,jd=e.__values__,sd(Ed,n),t.attr(Ed,n,this);const r=kd[t.type];r&&r.call(this,t,e,n),wd&&this.style(wd,n)},style(t,e){if(null!=e)for(const n in pd){let r="font"===n?pf(e):e[n];if(r===jd[n])continue;const i=pd[n];null==r?t.removeAttribute(i):(Cu(r)&&(r=Fu(r,this._defs.gradient,Sd())),t.setAttribute(i,r+"")),jd[n]=r}},defs(){const t=this._svg,e=this._defs;let n=e.el,r=0;for(const i in e.gradient)n||(e.el=n=Ff(t,1,"defs",md)),r=xd(n,e.gradient[i],r);for(const i in e.clipping)n||(e.el=n=Ff(t,1,"defs",md)),r=_d(n,e.clipping[i],r);n&&(0===r?(t.removeChild(n),e.el=null):zf(n,r))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let wd=null,jd=null;const kd={group(t,e,n){const r=wd=e.childNodes[2];jd=r.__values__,t.foreground(Ed,n,this),jd=e.__values__,wd=e.childNodes[1],t.content(Ed,n,this);const i=wd=e.childNodes[0];t.background(Ed,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==jd.events&&(Md(r,"pointer-events",o),Md(i,"pointer-events",o),jd.events=o),n.strokeForeground&&n.stroke){const t=n.fill;Md(r,"display",null),this.style(i,n),Md(i,"stroke",null),t&&(n.fill=null),jd=r.__values__,this.style(r,n),t&&(n.fill=t),wd=null}else Md(r,"display","none")},image(t,e,n){!1===n.smooth?(Ad(e,"image-rendering","optimizeSpeed"),Ad(e,"image-rendering","pixelated")):Ad(e,"image-rendering",null)},text(t,e,n){const r=ff(n);let i,o,a,s;Object(Z.B)(r)?(o=r.map(t=>hf(n,t)),i=o.join("\n"),i!==jd.text&&(zf(e,0),a=e.ownerDocument,s=cf(n),o.forEach((t,r)=>{const i=Sf(a,"tspan",md);i.__data__=n,i.textContent=t,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),e.appendChild(i)}),jd.text=i)):(o=hf(n,r),o!==jd.text&&(e.textContent=o,jd.text=o)),Md(e,"font-family",pf(n)),Md(e,"font-size",lf(n)+"px"),Md(e,"font-style",n.fontStyle),Md(e,"font-variant",n.fontVariant),Md(e,"font-weight",n.fontWeight)}};function Ed(t,e,n){e!==jd[t]&&(n?function(t,e,n,r){null!=n?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}(wd,t,e,n):Md(wd,t,e),jd[t]=e)}function Ad(t,e,n){n!==jd[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),jd[e]=n)}function Dd(t,e){for(const n in e)Md(t,n,e[n])}function Md(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function Sd(){let t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function Cd(t){Pf.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}Object(Z.z)(Cd,Pf,{svg(){return this._text},_render(t){const e=dd();e.open("svg",Object(Z.p)({},Bc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&e.open("rect",{width:this._width,height:this._height,fill:n}).close(),e.open("g",gd,{transform:"translate("+this._origin+")"}),this.mark(e,t),e.close(),this.defs(e),this._text=e.close()+"",this},mark(t,e){const n=_f[e.marktype],r=n.tag,i=[sd,n.attr];t.open("g",{class:Tf(e),"clip-path":e.clip?kl(this,e,e.group):null},ud(e),{"pointer-events":"g"!==r&&!1===e.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&t.open("a",a),t.open(r,this.attr(e,o,i,"g"!==r?r:null)),"text"===r){const e=ff(o);if(Object(Z.B)(e)){const n={x:0,dy:cf(o)};for(let r=0;rthis.mark(t,e)),t.close(),r&&a?(i&&(o.fill=null),o.stroke=a,t.open("path",this.attr(e,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):t.open("path",this.attr(e,o,n.foreground,"bgfore")).close()}t.close(),a&&t.close()};return n.nested?e.items&&e.items.length&&o(e.items[0]):bc(e,o),t.close()},href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e])return n;this.sanitizeURL(e).then(t=>{t["xlink:href"]=t.href,t.href=null,(this._hrefs||(this._hrefs={}))[e]=t})}return null},attr(t,e,n,r){const i={},o=(t,e,n,r)=>{i[r||t]=e};return Array.isArray(n)?n.forEach(t=>t(o,e,this)):n(o,e,this),r&&function(t,e,n,r,i){if(null==e)return t;"bgrect"===r&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===r&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===r&&!1===e.smooth&&(t.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===r&&(t["font-family"]=pf(e),t["font-size"]=lf(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const n in pd){let r=e[n];const o=pd[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(Cu(r)&&(r=Fu(r,i.gradient,"")),t[o]=r)}}(i,e,t,r,this._defs),i},defs(t){const e=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(e).length+Object.keys(n).length){t.open("defs");for(const n in e){const r=e[n],i=r.stops;"radial"===r.gradient?(t.open("pattern",{id:"p_"+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),t.close(),t.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):t.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let e=0;e1?(zd[t]=e,this):zd[t]}function $d(t,e,n){const r=[],i=(new El).union(e),o=t.marktype;return o?Nd(t,i,n,r):"group"===o?Rd(t,i,n,r):Object(Z.o)("Intersect scene must be mark node or group item.")}function Nd(t,e,n,r){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const i=t.items,o=t.marktype,a=i.length;let s=0;if("group"===o)for(;s=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(n=i[r],!Id(t[n],e[n],n))return!1;return typeof t==typeof e}(t,e):t==e)}function Ud(t,e){return Id(Bu(t),Bu(e))}function qd(){jl(),Su=0}const Wd="top",Yd="left",Hd="right",Gd="end",Vd="row";function Xd(t){Pt.call(this,null,t)}function Jd(t,e,n){return e(t.bounds.clear(),t,n)}Object(Z.z)(Xd,Pt,{transform(t,e){const n=e.dataflow,r=t.mark,i=r.marktype,o=_f[i],a=o.bound;let s,u=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),u=Jd(r,a),r.items.forEach(t=>{t.bounds.clear().union(u)});else if("group"===i||t.modified())switch(e.visit(e.MOD,t=>n.dirty(t)),u.clear(),r.items.forEach(t=>u.union(Jd(t,a))),r.role){case"axis":case"legend":case"title":e.reflow()}else s=e.changed(e.REM),e.visit(e.ADD,t=>{u.union(Jd(t,a))}),e.visit(e.MOD,t=>{s=s||u.alignsWith(t.bounds),n.dirty(t),u.union(Jd(t,a))}),s&&(u.clear(),r.items.forEach(t=>u.union(t.bounds)));return Ld(r),e.modifies("bounds")}});function Kd(t){Pt.call(this,0,t)}function Zd(t){Pt.call(this,null,t)}function Qd(t){Pt.call(this,null,t)}Kd.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},Object(Z.z)(Kd,Pt,{transform(t,e){const n=(i=e.dataflow)._signals[":vega_identifier:"]||(i._signals[":vega_identifier:"]=i.add(0)),r=t.as;var i;let o=n.value;return e.visit(e.ADD,t=>t[r]=t[r]||++o),n.set(this.value=o),e}}),Object(Z.z)(Zd,Pt,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,function(t){const e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const r="group"===n.marktype?Dl:Al;return e.visit(e.ADD,t=>r.call(t,n)),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});const th={parity:t=>t.filter((t,e)=>e%2?t.opacity=0:1),greedy:(t,e)=>{let n;return t.filter((t,r)=>r&&eh(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1))}},eh=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),nh=(t,e)=>{for(var n,r=1,i=t.length,o=t[0].bounds;r{const e=t.bounds;return e.width()>1&&e.height()>1},ih=t=>(t.forEach(t=>t.opacity=1),t),oh=(t,e)=>t.reflow(e.modified()).modifies("opacity");function ah(t){Pt.call(this,null,t)}Object(Z.z)(Qd,Pt,{transform(t,e){const n=th[t.method]||th.parity,r=t.separation||0;let i,o,a=e.materialize(e.SOURCE).source;if(!a||!a.length)return;if(!t.method)return t.modified("method")&&(ih(a),e=oh(e,t)),e;if(a=a.filter(rh),!a.length)return;if(t.sort&&(a=a.slice().sort(t.sort)),i=ih(a),e=oh(e,t),i.length>=3&&nh(i,r)){do{i=n(i,r)}while(i.length>=3&&nh(i,r));i.length<3&&!Object(Z.V)(a).opacity&&(i.length>1&&(Object(Z.V)(i).opacity=0),Object(Z.V)(a).opacity=1)}var s,u,l,c,f;t.boundScale&&t.boundTolerance>=0&&(s=t.boundScale,u=t.boundOrient,l=+t.boundTolerance,c=s.range(),f=new El,u===Wd||"bottom"===u?f.set(c[0],-1/0,c[1],1/0):f.set(-1/0,c[0],1/0,c[1]),f.expand(l||1),o=t=>f.encloses(t.bounds),a.forEach(t=>{o(t)||(t.opacity=0)}));const d=i[0].mark.bounds.clear();return a.forEach(t=>{t.opacity&&d.union(t.bounds)}),e}}),Object(Z.z)(ah,Pt,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,t=>n.dirty(t)),e.fields&&e.fields.zindex){const t=e.source&&e.source[0];t&&(t.mark.zdirty=!0)}}});const sh=new El;function uh(t,e,n){return t[e]===n?0:(t[e]=n,1)}function lh(t){var e=t.items[0].orient;return e===Yd||e===Hd}function ch(t,e,n,r){var i,o,a=e.items[0],s=a.datum,u=null!=a.translate?a.translate:.5,l=a.orient,c=function(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,g=a.maxExtent,m=s.title&&a.items[c[2]].items[0],b=a.titlePadding,y=a.bounds,v=m&&df(m),x=0,_=0;switch(sh.clear().union(y),y.clear(),(i=c[0])>-1&&y.union(a.items[i].bounds),(i=c[1])>-1&&y.union(a.items[i].bounds),l){case Wd:x=h||0,_=-d,o=Math.max(p,Math.min(g,-y.y1)),y.add(0,-o).add(f,0),m&&fh(t,m,o,b,v,0,-1,y);break;case Yd:x=-d,_=h||0,o=Math.max(p,Math.min(g,-y.x1)),y.add(-o,0).add(0,f),m&&fh(t,m,o,b,v,1,-1,y);break;case Hd:x=n+d,_=h||0,o=Math.max(p,Math.min(g,y.x2)),y.add(0,0).add(o,f),m&&fh(t,m,o,b,v,1,1,y);break;case"bottom":x=h||0,_=r+d,o=Math.max(p,Math.min(g,y.y2)),y.add(0,0).add(f,o),m&&fh(t,m,o,b,0,0,1,y);break;default:x=a.x,_=a.y}return Fl(y.translate(x,_),a),uh(a,"x",x+u)|uh(a,"y",_+u)&&(a.bounds=sh,t.dirty(a),a.bounds=y,t.dirty(a)),a.mark.bounds.clear().union(y)}function fh(t,e,n,r,i,o,a,s){const u=e.bounds;if(e.auto){const s=a*(n+i+r);let l=0,c=0;t.dirty(e),o?l=(e.x||0)-(e.x=s):c=(e.y||0)-(e.y=s),e.mark.bounds.clear().union(u.translate(-l,-c)),t.dirty(e)}s.union(u)}const dh=(t,e)=>Math.floor(Math.min(t,e)),hh=(t,e)=>Math.ceil(Math.max(t,e));function ph(t){return(new El).set(0,0,t.width||0,t.height||0)}function gh(t){const e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function mh(t,e,n){const r=Object(Z.G)(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function bh(t){return t<0?Math.ceil(-t):0}function yh(t,e,n){var r,i,o,a,s,u,l,c,f,d,h,p=!n.nodirty,g="flush"===n.bounds?ph:gh,m=sh.set(0,0,0,0),b=mh(n.align,"column"),y=mh(n.align,Vd),v=mh(n.padding,"column"),x=mh(n.padding,Vd),_=n.columns||e.length,O=_<=0?1:Math.ceil(e.length/_),w=e.length,j=Array(w),k=Array(_),E=0,A=Array(w),D=Array(O),M=0,S=Array(w),C=Array(w),F=Array(w);for(i=0;i<_;++i)k[i]=0;for(i=0;i1)for(i=0;i0&&(S[i]+=f/2);if(y&&mh(n.center,Vd)&&1!==_)for(i=0;i0&&(C[i]+=d/2);for(i=0;ii&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),j+=o,g=0,b=e.length;g=0&&null==(x=n[m]);m-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),O=j):(_=j,O=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),y.union(v.bounds.translate(_-(v.x||0),O-(v.y||0))),v.x=_,v.y=O,t.dirty(v),k=a(k,y[l])}return k}function Oh(t,e,n,r,i,o){if(e){t.dirty(e);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.height()),e.bounds.translate(a-(e.x||0),s-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=a,e.y=s,t.dirty(e)}}function wh(t,e,n,r,i,o,a){const s=function(t,e){const n=t[e]||{};return(e,r)=>null!=n[e]?n[e]:null!=t[e]?t[e]:r}(n,e),u=function(t,e){let n=-1/0;return t.forEach(t=>{null!=t.offset&&(n=Math.max(n,t.offset))}),n>-1/0?n:e}(t,s("offset",0)),l=s("anchor","start"),c=l===Gd?1:"middle"===l?.5:0,f={align:"each",bounds:s("bounds","flush"),columns:"vertical"===s("direction")?1:t.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(e){case Yd:f.anchor={x:Math.floor(r.x1)-u,column:Gd,y:c*(a||r.height()+2*r.y1),row:l};break;case Hd:f.anchor={x:Math.ceil(r.x2)+u,y:c*(a||r.height()+2*r.y1),row:l};break;case Wd:f.anchor={y:Math.floor(i.y1)-u,row:Gd,x:c*(o||i.width()+2*i.x1),column:l};break;case"bottom":f.anchor={y:Math.ceil(i.y2)+u,x:c*(o||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:u,y:u};break;case"top-right":f.anchor={x:o-u,y:u,column:Gd};break;case"bottom-left":f.anchor={x:u,y:a-u,row:Gd};break;case"bottom-right":f.anchor={x:o-u,y:a-u,column:Gd,row:Gd}}return f}function jh(t,e){var n,r,i=e.items[0],o=i.datum,a=i.orient,s=i.bounds,u=i.x,l=i.y;return i._bounds?i._bounds.clear().union(s):i._bounds=s.clone(),s.clear(),function(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(e.datum.title){var a=e.items[1].items[0],s=a.anchor,u=e.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case Yd:i+=Math.ceil(a.bounds.width())+u;break;case Hd:case"bottom":break;default:o+=a.bounds.height()+u}switch((i||o)&&Eh(t,n,i,o),a.orient){case Yd:c+=kh(e,n,a,s,1,1);break;case Hd:l+=kh(e,n,a,Gd,0,0)+u,c+=kh(e,n,a,s,1,1);break;case"bottom":l+=kh(e,n,a,s,0,0),c+=kh(e,n,a,Gd,-1,0,1)+u;break;default:l+=kh(e,n,a,s,0,0)}(l||c)&&Eh(t,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(Eh(t,n,-l,0),Eh(t,a,-l,0))}else(i||o)&&Eh(t,n,i,o)}(t,i,i.items[0].items[0]),s=function(t,e){return t.items.forEach(t=>e.union(t.bounds)),e.x1=t.padding,e.y1=t.padding,e}(i,s),n=2*i.padding,r=2*i.padding,s.empty()||(n=Math.ceil(s.width()+n),r=Math.ceil(s.height()+r)),"symbol"===o.type&&function(t){const e=t.reduce((t,e)=>(t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t),{});t.forEach(t=>{t.width=e[t.column],t.height=t.bounds.y2-t.y})}(i.items[0].items[0].items[0].items),"none"!==a&&(i.x=u=0,i.y=l=0),i.width=n,i.height=r,Fl(s.set(u,l,u+n,l+r),i),i.mark.bounds.clear().union(s),i}function kh(t,e,n,r,i,o,a){const s="symbol"!==t.datum.type,u=n.datum.vgrad,l=(!s||!o&&u||a?e:e.items[0]).bounds[i?"y2":"x2"]-t.padding,c=u&&o?l:0,f=u&&o?0:l,d=i<=0?0:df(n);return Math.round("start"===r?c:r===Gd?f-d:.5*(l-d))}function Eh(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function Ah(t){Pt.call(this,null,t)}function Dh(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function Mh(t){Pt.call(this,null,t)}function Sh(t){Pt.call(this,null,t)}function Ch(){return ut({})}function Fh(t){Pt.call(this,null,t)}function zh(t){Pt.call(this,[],t)}Object(Z.z)(Ah,Pt,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach(e=>{t.layout&&function(t,e,n){var r,i,o,a,s,u,l,c=function(t){var e,n,r=t.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o{"none"!==(o=t.orient||Hd)&&(e[o]||(e[o]=[])).push(t)});for(const r in e){const i=e[r];yh(t,i,wh(i,r,n.legends,d,h,l,c))}p.forEach(e=>{const r=e.bounds;if(r.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=r,t.dirty(e)),n.autosize&&"fit"===n.autosize.type)switch(e.orient){case Yd:case Hd:f.add(r.x1,0).add(r.x2,0);break;case Wd:case"bottom":f.add(0,r.y1).add(0,r.y2)}else f.union(r)})}f.union(d).union(h),r&&f.union(function(t,e,n,r,i){var o,a=e.items[0],s=a.frame,u=a.orient,l=a.anchor,c=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=u===Yd||u===Hd?r:n,g=0,m=0,b=0,y=0,v=0;if("group"!==s?u===Yd?(g=i.y2,p=i.y1):u===Hd?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):u===Yd&&(g=r,p=0),o="start"===l?g:l===Gd?p:(g+p)/2,h&&h.text){switch(u){case Wd:case"bottom":v=d.bounds.height()+f;break;case Yd:y=d.bounds.width()+f;break;case Hd:y=-d.bounds.width()-f}sh.clear().union(h.bounds),sh.translate(y-(h.x||0),v-(h.y||0)),uh(h,"x",y)|uh(h,"y",v)&&(t.dirty(h),h.bounds.clear().union(sh),h.mark.bounds.clear().union(sh),t.dirty(h)),sh.clear().union(h.bounds)}else sh.clear();switch(sh.union(d.bounds),u){case Wd:m=o,b=i.y1-sh.height()-c;break;case Yd:m=i.x1-sh.width()-c,b=o;break;case Hd:m=i.x2+sh.width()+c,b=o;break;case"bottom":m=o,b=i.y2+c;break;default:m=a.x,b=a.y}return uh(a,"x",m)|uh(a,"y",b)&&(sh.translate(m,b),t.dirty(a),a.bounds.clear().union(sh),e.bounds.clear().union(sh),t.dirty(a)),a.bounds}(t,r,l,c,f));e.clip&&f.set(0,0,e.width||0,e.height||0);!function(t,e,n,r){const i=r.autosize||{},o=i.type;if(t._autosize<1||!o)return;let a=t._width,s=t._height,u=Math.max(0,e.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if("padding"===i.contains){const e=t.padding();a-=e.left+e.right,s-=e.top+e.bottom}"none"===o?(l=0,f=0,u=a,c=s):"fit"===o?(u=Math.max(0,a-l-d),c=Math.max(0,s-f-h)):"fit-x"===o?(u=Math.max(0,a-l-d),s=c+f+h):"fit-y"===o?(a=u+l+d,c=Math.max(0,s-f-h)):"pad"===o&&(a=u+l+d,s=c+f+h);t._resizeView(a,s,u,c,[l,f],i.resize)}(t,e,f,n)}(n,e,t)}),(r=t.mark.group)&&"legend-entry"!==r.mark.role?e.reflow():e;var r}}),Object(Z.z)(Mh,Pt,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.scale,a=pu(o,null==t.count?t.values?t.values.length:10:t.count,t.minstep),s=t.format||bu(n,o,a,t.formatSpecifier,t.formatType,!!t.values),u=t.values?gu(o,t.values,a):mu(o,a);return i&&(r.rem=i),i=u.map((t,e)=>ut({index:e/(u.length-1||1),value:t,label:s(t)})),t.extra&&i.length&&i.push(ut({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),Object(Z.z)(Sh,Pt,{transform(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||Ch,o=t.key||at,a=this.value;return Object(Z.B)(r.encode)&&(r.encode=null),a&&(t.modified("key")||e.modified(o))&&Object(Z.o)("DataJoin does not support modified key function or fields."),a||(e=e.addAll(),this.value=a=function(t){const e=Object(Z.t)().test(t=>t.exit);return e.lookup=n=>e.get(t(n)),e}(o)),e.visit(e.ADD,t=>{const e=o(t);let n=a.get(e);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(t),a.set(e,n),r.add.push(n)),n.datum=t,n.exit=!1}),e.visit(e.MOD,t=>{const e=o(t),n=a.get(e);n&&(n.datum=t,r.mod.push(n))}),e.visit(e.REM,t=>{const e=o(t),n=a.get(e);t!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)}),e.changed(e.ADD_MOD)&&r.modifies("datum"),(e.clean()||t.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),Object(Z.z)(Fh,Pt,{transform(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if(Object(Z.B)(o)){if(!n.changed()&&!o.every(t=>i[t]))return e.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=i.update||Z.s,u=i.enter||Z.s,l=i.exit||Z.s,c=(o&&!a?i[o]:s)||Z.s;if(e.changed(e.ADD)&&(e.visit(e.ADD,e=>{u(e,t),s(e,t)}),n.modifies(u.output),n.modifies(s.output),c!==Z.s&&c!==s&&(e.visit(e.ADD,e=>{c(e,t)}),n.modifies(c.output))),e.changed(e.REM)&&l!==Z.s&&(e.visit(e.REM,e=>{l(e,t)}),n.modifies(l.output)),a||c!==Z.s){const i=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(i,e=>{const i=u(e,t)||r;(c(e,t)||i)&&n.mod.push(e)}),n.mod.length&&n.modifies(u.output)):e.visit(i,e=>{(c(e,t)||r)&&n.mod.push(e)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:e.StopPropagation}}),Object(Z.z)(zh,Pt,{transform(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,r,i,o,a,s=e.dataflow.locale(),u=e.fork(e.NO_SOURCE|e.NO_FIELDS),l=this.value,c=t.type||"symbol",f=t.scale,d=+t.limit,h=pu(f,null==t.count?5:t.count,t.minstep),p=!!t.values||"symbol"===c,g=t.format||Ou(s,f,h,c,t.formatSpecifier,t.formatType,p),m=t.values||_u(f,h);return l&&(u.rem=l),"symbol"===c?(d&&m.length>d?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=m.slice(0,d-1),a=!0):l=m,Object(Z.E)(i=t.size)?(t.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce((e,n)=>Math.max(e,i(n,t)),0)):i=Object(Z.m)(o=i||8),l=l.map((e,n)=>ut({index:n,label:g(e,n,l),value:e,offset:o,size:i(e,t)})),a&&(a=m[l.length],l.push(ut({index:l.length,label:"…".concat(m.length-l.length," entries"),value:a,offset:o,size:i(a,t)})))):"gradient"===c?(n=f.domain(),r=ou(f,n[0],Object(Z.V)(n)),m.length<3&&!t.values&&n[0]!==Object(Z.V)(n)&&(m=[n[0],Object(Z.V)(n)]),l=m.map((t,e)=>ut({index:e,label:g(t,e,m),value:t,perc:r(t)}))):(i=m.length-1,r=function(t){const e=t.domain(),n=e.length-1;let r=+e[0],i=+Object(Z.V)(e),o=i-r;if("threshold"===t.type){const t=n?o/n:.1;r-=t,i+=t,o=i-r}return t=>(t-r)/o}(f),l=m.map((t,e)=>ut({index:e,label:g(t,e,m),value:t,perc:e?r(t):0,perc2:e===i?1:r(m[e+1])}))),u.source=l,u.add=l,this.value=l,u}});const Th=t=>t.source.x,$h=t=>t.source.y,Nh=t=>t.target.x,Rh=t=>t.target.y;function Ph(t){Pt.call(this,{},t)}Ph.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"}]},Object(Z.z)(Ph,Pt,{transform(t,e){var n=t.sourceX||Th,r=t.sourceY||$h,i=t.targetX||Nh,o=t.targetY||Rh,a=t.as||"path",s=t.orient||"vertical",u=t.shape||"line",l=Uh.get(u+"-"+s)||Uh.get(u);return l||Object(Z.o)("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,t=>{t[a]=l(n(t),r(t),i(t),o(t))}),e.reflow(t.modified()).modifies(a)}});const Bh=(t,e,n,r)=>"M"+t+","+e+"L"+n+","+r,Lh=(t,e,n,r)=>{var i=n-t,o=r-e,a=Math.sqrt(i*i+o*o)/2;return"M"+t+","+e+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},Ih=(t,e,n,r)=>{const i=n-t,o=r-e,a=.2*(i+o),s=.2*(o-i);return"M"+t+","+e+"C"+(t+a)+","+(e+s)+" "+(n+s)+","+(r-a)+" "+n+","+r},Uh=Object(Z.t)({line:Bh,"line-radial":(t,e,n,r)=>Bh(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),arc:Lh,"arc-radial":(t,e,n,r)=>Lh(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),curve:Ih,"curve-radial":(t,e,n,r)=>Ih(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(t,e,n,r)=>"M"+t+","+e+"V"+r+"H"+n,"orthogonal-vertical":(t,e,n,r)=>"M"+t+","+e+"H"+n+"V"+r,"orthogonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n);return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+((Math.abs(n-t)>Math.PI?n<=t:n>t)?1:0)+" "+e*a+","+e*s+"L"+r*a+","+r*s},"diagonal-horizontal":(t,e,n,r)=>{const i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(t,e,n,r)=>{const i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n),u=(e+r)/2;return"M"+e*i+","+e*o+"C"+u*i+","+u*o+" "+u*a+","+u*s+" "+r*a+","+r*s}});function qh(t){Pt.call(this,null,t)}qh.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"]}]},Object(Z.z)(qh,Pt,{transform(t,e){var n,r,i,o=t.as||["startAngle","endAngle"],a=o[0],s=o[1],u=t.field||Z.P,l=t.startAngle||0,c=null!=t.endAngle?t.endAngle:2*Math.PI,f=e.source,d=f.map(u),h=d.length,p=l,g=(c-l)/Dh(d),m=We(h);for(t.sort&&m.sort((t,e)=>d[t]-d[e]),n=0;nt+(e<0?-1:e>0?1:0),0))!==e.length&&n.warn("Log scale domain includes zero: "+Object(Z.ab)(e)));return e}function Vh(t,e,n){return Object(Z.E)(t)&&(e||n)?nu(t,Xh(e||[0,1],n)):t}function Xh(t,e){return e?t.slice().reverse():t}function Jh(t){Pt.call(this,null,t)}Object(Z.z)(Hh,Pt,{transform(t,e){var n=e.dataflow,r=this.value,i=function(t){var e,n=t.type,r="";if("sequential"===n)return"sequential-linear";(function(t){const e=t.type;return Xs(e)&&e!==Rs&&e!==Ps&&(t.scheme||t.range&&t.range.length&&t.range.every(Z.I))})(t)&&(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0,r=2===e?"sequential-":3===e?"diverging-":"");return(r+n||"linear").toLowerCase()}(t);for(i in r&&i===r.type||(this.value=r=Hs(i)()),t)if(!Yh[i]){if("padding"===i&&Wh(r.type))continue;Object(Z.E)(r[i])?r[i](t[i]):n.warn("Unsupported scale property: "+i)}return function(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){"band"!==t&&"point"!==t&&Object(Z.o)("Only band and point scales support rangeStep.");var r=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,i="point"===t?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*$s(n,i,r)]}(r,e,n);else if(e.scheme&&(o=function(t,e,n){var r,i,o=e.schemeExtent;Object(Z.B)(e.scheme)?i=ru(e.scheme,e.interpolate,e.interpolateGamma):(r=e.scheme.toLowerCase(),(i=cu(r))||Object(Z.o)("Unrecognized scheme name: ".concat(e.scheme)));return n="threshold"===t?n+1:"bin-ordinal"===t?n-1:"quantile"===t||"quantize"===t?+e.schemeCount||5:n,Qs(t)?Vh(i,o,e.reverse):Object(Z.E)(i)?iu(Vh(i,o),n):"ordinal"===t?i:i.slice(0,n)}(r,e,n),Object(Z.E)(o))){if(t.interpolator)return t.interpolator(o);Object(Z.o)("Scale type ".concat(r," does not support interpolating color schemes."))}if(o&&Qs(r))return t.interpolator(ru(Xh(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(au(e.interpolate,e.interpolateGamma)):Object(Z.E)(t.round)?t.round(i):Object(Z.E)(t.rangeRound)&&t.interpolate(i?Vo:Go);o&&t.range(Xh(o,e.reverse))}(r,t,function(t,e,n){let r=e.bins;if(r&&!Object(Z.B)(r)){const e=t.domain(),n=e[0],i=Object(Z.V)(e),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||Object(Z.o)("Scale bins parameter missing step property."),ai&&(s=o*Math.floor(i/o)),r=We(a,s+o/2,o)}r?t.bins=r:t.bins&&delete t.bins;"bin-ordinal"===t.type&&(r?e.domain||e.domainRaw||(t.domain(r),n=r.length):t.bins=t.domain());return n}(r,t,function(t,e,n){const r=function(t,e,n){return e?(t.domain(Gh(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(r>-1)return r;var i,o,a=e.domain,s=t.type,u=e.zero||void 0===e.zero&&function(t){const e=t.type;return!t.bins&&("linear"===e||"pow"===e||"sqrt"===e)}(t);if(!a)return 0;Wh(s)&&e.padding&&a[0]!==Object(Z.V)(a)&&(a=function(t,e,n,r,i,o){var a=Math.abs(Object(Z.V)(n)-n[0]),s=a/(a-2*r),u=t===Ns?Object(Z.nb)(e,null,s):"sqrt"===t?Object(Z.ob)(e,null,s,.5):"pow"===t?Object(Z.ob)(e,null,s,i||1):"symlog"===t?Object(Z.pb)(e,null,s,o||1):Object(Z.mb)(e,null,s);return(e=e.slice())[0]=u[0],e[e.length-1]=u[1],e}(s,a,e.range,e.padding,e.exponent,e.constant));if((u||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(i=(a=a.slice()).length-1||1,u&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=e.domainMin&&(a[0]=e.domainMin),null!=e.domainMax&&(a[i]=e.domainMax),null!=e.domainMid)){const t=(o=e.domainMid)>a[i]?i+1:ot(u);if(null==e)h.push(t.slice());else for(i={},o=0,a=t.length;od&&(d=f),n&&c.sort(n)}return h.max=d,h}(e.source,t.groupby,l,c),r=0,i=n.length,o=n.max;rt;function rp(t,e){t&&op.hasOwnProperty(t.type)&&op[t.type](t,e)}var ip={Feature:function(t,e){rp(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}var cp=Math.PI,fp=cp/2,dp=cp/4,hp=2*cp,pp=180/cp,gp=cp/180,mp=Math.abs,bp=Math.atan,yp=Math.atan2,vp=Math.cos,xp=Math.ceil,_p=Math.exp,Op=(Math.floor,Math.hypot),wp=Math.log,jp=Math.pow,kp=Math.sin,Ep=Math.sign||function(t){return t>0?1:t<0?-1:0},Ap=Math.sqrt,Dp=Math.tan;function Mp(t){return t>1?0:t<-1?cp:Math.acos(t)}function Sp(t){return t>1?fp:t<-1?-fp:Math.asin(t)}function Cp(){}var Fp,zp,Tp,$p,Np=new lp,Rp=new lp,Pp={point:Cp,lineStart:Cp,lineEnd:Cp,polygonStart:function(){Pp.lineStart=Bp,Pp.lineEnd=Up},polygonEnd:function(){Pp.lineStart=Pp.lineEnd=Pp.point=Cp,Np.add(mp(Rp)),Rp=new lp},result:function(){var t=Np/2;return Np=new lp,t}};function Bp(){Pp.point=Lp}function Lp(t,e){Pp.point=Ip,Fp=Tp=t,zp=$p=e}function Ip(t,e){Rp.add($p*t-Tp*e),Tp=t,$p=e}function Up(){Ip(Fp,zp)}var qp=Pp,Wp=1/0,Yp=Wp,Hp=-Wp,Gp=Hp;var Vp,Xp,Jp,Kp,Zp={point:function(t,e){tHp&&(Hp=t);eGp&&(Gp=e)},lineStart:Cp,lineEnd:Cp,polygonStart:Cp,polygonEnd:Cp,result:function(){var t=[[Wp,Yp],[Hp,Gp]];return Hp=Gp=-(Yp=Wp=1/0),t}},Qp=0,tg=0,eg=0,ng=0,rg=0,ig=0,og=0,ag=0,sg=0,ug={point:lg,lineStart:cg,lineEnd:hg,polygonStart:function(){ug.lineStart=pg,ug.lineEnd=gg},polygonEnd:function(){ug.point=lg,ug.lineStart=cg,ug.lineEnd=hg},result:function(){var t=sg?[og/sg,ag/sg]:ig?[ng/ig,rg/ig]:eg?[Qp/eg,tg/eg]:[NaN,NaN];return Qp=tg=eg=ng=rg=ig=og=ag=sg=0,t}};function lg(t,e){Qp+=t,tg+=e,++eg}function cg(){ug.point=fg}function fg(t,e){ug.point=dg,lg(Jp=t,Kp=e)}function dg(t,e){var n=t-Jp,r=e-Kp,i=Ap(n*n+r*r);ng+=i*(Jp+t)/2,rg+=i*(Kp+e)/2,ig+=i,lg(Jp=t,Kp=e)}function hg(){ug.point=lg}function pg(){ug.point=mg}function gg(){bg(Vp,Xp)}function mg(t,e){ug.point=bg,lg(Vp=Jp=t,Xp=Kp=e)}function bg(t,e){var n=t-Jp,r=e-Kp,i=Ap(n*n+r*r);ng+=i*(Jp+t)/2,rg+=i*(Kp+e)/2,ig+=i,og+=(i=Kp*t-Jp*e)*(Jp+t),ag+=i*(Kp+e),sg+=3*i,lg(Jp=t,Kp=e)}var yg=ug;function vg(t){this._context=t}vg.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,hp)}},result:Cp};var xg,_g,Og,wg,jg,kg=new lp,Eg={point:Cp,lineStart:function(){Eg.point=Ag},lineEnd:function(){xg&&Dg(_g,Og),Eg.point=Cp},polygonStart:function(){xg=!0},polygonEnd:function(){xg=null},result:function(){var t=+kg;return kg=new lp,t}};function Ag(t,e){Eg.point=Dg,_g=wg=t,Og=jg=e}function Dg(t,e){wg-=t,jg-=e,kg.add(Ap(wg*wg+jg*jg)),wg=t,jg=e}var Mg=Eg;function Sg(){this._string=[]}function Cg(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Sg.prototype={_radius:4.5,_circle:Cg(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Cg(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var Fg=function(t,e){var n,r,i=4.5;function o(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),up(t,n(r))),r.result()}return o.area=function(t){return up(t,n(qp)),qp.result()},o.measure=function(t){return up(t,n(Mg)),Mg.result()},o.bounds=function(t){return up(t,n(Zp)),Zp.result()},o.centroid=function(t){return up(t,n(yg)),yg.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,np):(t=e).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(e=null,new Sg):new vg(e=t),"function"!=typeof i&&r.pointRadius(i),o):e},o.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(e)},zg=function(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:Cp,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},Tg=function(t,e){return mp(t[0]-e[0])<1e-6&&mp(t[1]-e[1])<1e-6};function $g(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var Ng=function(t,e,n,r,i){var o,a,s=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(Tg(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o=0;--o)i.point((c=l[o])[0],c[1]);else r(d.x,d.p.x,-1,i);d=d.p}l=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}};function Rg(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,E=k*j,A=E>cp,D=m*O;if(u.add(yp(D*k*kp(E),b*w+D*vp(E))),a+=A?j+k*hp:j,A^p>=n^x>=n){var M=Ig(Bg(h),Bg(v));Wg(M);var S=Ig(o,M);Wg(S);var C=(A^j>=0?-1:1)*Sp(S[2]);(r>C||r===C&&(M[0]||M[1]))&&(s+=A^j>=0?1:-1)}}return(a<-1e-6||a<1e-6&&u<-1e-12)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),Ng(a,Xg,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(e,n){t(e,n)&&i.point(e,n)}function p(t,e){u.point(t,e)}function g(){d.point=p,u.lineStart()}function m(){d.point=h,u.lineEnd()}function b(t,e){s.push([t,e]),c.point(t,e)}function y(){c.lineStart(),s=[]}function v(){b(s[0][0],s[0][1]),c.lineEnd();var t,e,n,r,u=c.clean(),d=l.result(),h=d.length;if(s.pop(),o.push(s),s=null,h)if(1&u){if((e=(n=d[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&u&&d.push(d.pop().concat(d.shift())),a.push(d.filter(Vg))}return d}};function Vg(t){return t.length>1}function Xg(t,e){return((t=t.x)[0]<0?t[1]-fp-1e-6:fp-t[1])-((e=e.x)[0]<0?e[1]-fp-1e-6:fp-e[1])}var Jg=Gg((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?cp:-cp,u=mp(o-n);mp(u-cp)<1e-6?(t.point(n,r=(r+a)/2>0?fp:-fp),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=cp&&(mp(n-i)<1e-6&&(n-=1e-6*i),mp(o-s)<1e-6&&(o-=1e-6*s),r=function(t,e,n,r){var i,o,a=kp(t-n);return mp(a)>1e-6?bp((kp(e)*(o=vp(r))*kp(n)-kp(r)*(i=vp(e))*kp(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*fp,r.point(-cp,i),r.point(0,i),r.point(cp,i),r.point(cp,0),r.point(cp,-i),r.point(0,-i),r.point(-cp,-i),r.point(-cp,0),r.point(-cp,i);else if(mp(t[0]-e[0])>1e-6){var o=t[0]cp?t+Math.round(-t/hp)*hp:t,e]}function Qg(t,e,n){return(t%=hp)?e||n?Kg(em(t),nm(e,n)):em(t):e||n?nm(e,n):Zg}function tm(t){return function(e,n){return[(e+=t)>cp?e-hp:e<-cp?e+hp:e,n]}}function em(t){var e=tm(t);return e.invert=tm(-t),e}function nm(t,e){var n=vp(t),r=kp(t),i=vp(e),o=kp(e);function a(t,e){var a=vp(e),s=vp(t)*a,u=kp(t)*a,l=kp(e),c=l*n+s*r;return[yp(u*i-c*o,s*n-l*r),Sp(c*i+u*o)]}return a.invert=function(t,e){var a=vp(e),s=vp(t)*a,u=kp(t)*a,l=kp(e),c=l*i-u*o;return[yp(u*i+l*o,s*n+c*r),Sp(c*n-s*r)]},a}Zg.invert=Zg;function rm(t,e,n,r,i,o){if(n){var a=vp(e),s=kp(e),u=r*n;null==i?(i=e+r*hp,o=e-u/2):(i=im(a,i),o=im(a,o),(r>0?io)&&(i+=r*hp));for(var l,c=i;r>0?c>o:c0,i=mp(e)>1e-6;function o(t,n){return vp(t)*vp(n)>e}function a(t,n,r){var i=[1,0,0],o=Ig(Bg(t),Bg(n)),a=Lg(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var l=e*a/u,c=-e*s/u,f=Ig(i,o),d=qg(i,l);Ug(d,qg(o,c));var h=f,p=Lg(d,h),g=Lg(h,h),m=p*p-g*(Lg(d,d)-1);if(!(m<0)){var b=Ap(m),y=qg(h,(-p-b)/g);if(Ug(y,d),y=Pg(y),!r)return y;var v,x=t[0],_=n[0],O=t[1],w=n[1];_0^y[1]<(mp(y[0]-x)<1e-6?O:w):O<=y[1]&&y[1]<=w:j>cp^(x<=y[0]&&y[0]<=_)){var E=qg(h,(-p+b)/g);return Ug(E,d),[y,Pg(E)]}}}function s(e,n){var i=r?t:cp-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Gg(o,(function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(f,d){var h,p=[f,d],g=o(f,d),m=r?g?0:s(f,d):g?s(f+(f<0?cp:-cp),d):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(h=a(e,p))||Tg(e,h)||Tg(p,h))&&(p[2]=1),g!==u)c=0,g?(t.lineStart(),h=a(p,e),t.point(h[0],h[1])):(h=a(e,p),t.point(h[0],h[1],2),t.lineEnd()),e=h;else if(i&&e&&r^g){var b;m&n||!(b=a(p,e,!0))||(c=0,r?(t.lineStart(),t.point(b[0][0],b[0][1]),t.point(b[1][0],b[1][1]),t.lineEnd()):(t.point(b[1][0],b[1][1]),t.lineEnd(),t.lineStart(),t.point(b[0][0],b[0][1],3)))}!g||e&&Tg(e,p)||t.point(p[0],p[1]),e=p,u=g,n=m},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(e,r,i,o){rm(o,t,n,i,e,r)}),r?[0,-t]:[-cp,t-cp])};function am(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,l){var c=0,f=0;if(null==i||(c=a(i,s))!==(f=a(o,s))||u(i,o)<0^s>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return mp(r[0]-t)<1e-6?i>0?0:3:mp(r[0]-n)<1e-6?i>0?2:1:mp(r[1]-e)<1e-6?i>0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var u,l,c,f,d,h,p,g,m,b,y,v=a,x=zg(),_={point:O,lineStart:function(){_.point=w,l&&l.push(c=[]);b=!0,m=!1,p=g=NaN},lineEnd:function(){u&&(w(f,d),h&&m&&x.rejoin(),u.push(x.result()));_.point=O,m&&v.lineEnd()},polygonStart:function(){v=x,u=[],l=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;nr&&(d-o)*(r-a)>(h-a)*(t-o)&&++e:h<=r&&(d-o)*(r-a)<(h-a)*(t-o)&&--e;return e}(),n=y&&e,i=(u=Hg(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Ng(u,s,e,o,a),a.polygonEnd());v=a,u=l=c=null}};function O(t,e){i(t,e)&&v.point(t,e)}function w(o,a){var s=i(o,a);if(l&&c.push([o,a]),b)f=o,d=a,h=s,b=!1,s&&(v.lineStart(),v.point(o,a));else if(s&&m)v.point(o,a);else{var u=[p=Math.max(-1e9,Math.min(1e9,p)),g=Math.max(-1e9,Math.min(1e9,g))],x=[o=Math.max(-1e9,Math.min(1e9,o)),a=Math.max(-1e9,Math.min(1e9,a))];!function(t,e,n,r,i,o){var a,s=t[0],u=t[1],l=0,c=1,f=e[0]-s,d=e[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a0)){if(a/=d,d<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>l&&(l=a)}else if(d>0){if(a0&&(t[0]=s+l*f,t[1]=u+l*d),c<1&&(e[0]=s+c*f,e[1]=u+c*d),!0}}}}}(u,x,t,e,n,r)?s&&(v.lineStart(),v.point(o,a),y=!1):(m||(v.lineStart(),v.point(u[0],u[1])),v.point(x[0],x[1]),s||v.lineEnd(),y=!1)}p=o,g=a,m=s}return _}}function sm(t){return function(e){var n=new um;for(var r in t)n[r]=t[r];return n.stream=e,n}}function um(){}function lm(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),up(n,t.stream(Zp)),e(Zp.result()),null!=r&&t.clipExtent(r),t}function cm(t,e,n){return lm(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function fm(t,e,n){return cm(t,[[0,0],e],n)}function dm(t,e,n){return lm(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function hm(t,e,n){return lm(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}um.prototype={constructor:um,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var pm=vp(30*gp),gm=function(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,l,c,f,d,h,p,g,m){var b=l-r,y=c-i,v=b*b+y*y;if(v>4*e&&g--){var x=a+d,_=s+h,O=u+p,w=Ap(x*x+_*_+O*O),j=Sp(O/=w),k=mp(mp(O)-1)<1e-6||mp(o-f)<1e-6?(o+f)/2:yp(_,x),E=t(k,j),A=E[0],D=E[1],M=A-r,S=D-i,C=y*M-b*S;(C*C/v>e||mp((b*M+y*S)/v-.5)>.3||a*d+s*h+u*p2?t[2]%360*gp:0,M()):[m*pp,b*pp,y*pp]},A.angle=function(t){return arguments.length?(v=t%360*gp,M()):v*pp},A.reflectX=function(t){return arguments.length?(x=t?-1:1,M()):x<0},A.reflectY=function(t){return arguments.length?(_=t?-1:1,M()):_<0},A.precision=function(t){return arguments.length?(a=gm(s,E=t*t),S()):Ap(E)},A.fitExtent=function(t,e){return cm(A,t,e)},A.fitSize=function(t,e){return fm(A,t,e)},A.fitWidth=function(t,e){return dm(A,t,e)},A.fitHeight=function(t,e){return hm(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&D,M()}}function xm(t){var e=0,n=cp/3,r=vm(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*gp,n=t[1]*gp):[e*pp,n*pp]},i}function _m(t,e){var n=kp(t),r=(n+kp(e))/2;if(mp(r)<1e-6)return function(t){var e=vp(t);function n(t,n){return[t*e,kp(n)/e]}return n.invert=function(t,n){return[t/e,Sp(n*e)]},n}(t);var i=1+n*(2*r-n),o=Ap(i)/r;function a(t,e){var n=Ap(i-2*r*kp(e))/r;return[n*kp(t*=r),o-n*vp(t)]}return a.invert=function(t,e){var n=o-e,a=yp(t,mp(n))*Ep(n);return n*r<0&&(a-=cp*Ep(t)*Ep(n)),[a/r,Sp((i-(t*t+n*n)*r*r)/(2*r))]},a}var Om=function(){return xm(_m).scale(155.424).center([0,33.6442])},wm=function(){return Om().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};function jm(t){return function(e,n){var r=vp(e),i=vp(n),o=t(r*i);return o===1/0?[2,0]:[o*i*kp(e),o*kp(n)]}}function km(t){return function(e,n){var r=Ap(e*e+n*n),i=t(r),o=kp(i),a=vp(i);return[yp(e*o,r*a),Sp(r&&n*o/r)]}}var Em=jm((function(t){return Ap(2/(1+t))}));Em.invert=km((function(t){return 2*Sp(t/2)}));var Am=jm((function(t){return(t=Mp(t))&&t/kp(t)}));Am.invert=km((function(t){return t}));function Dm(t,e){return[t,wp(Dp((fp+e)/2))]}Dm.invert=function(t,e){return[t,2*bp(_p(e))-fp]};function Mm(t){var e,n,r,i=ym(t),o=i.center,a=i.scale,s=i.translate,u=i.clipExtent,l=null;function c(){var o=cp*a(),s=i(function(t){function e(e){return(e=t(e[0]*gp,e[1]*gp))[0]*=pp,e[1]*=pp,e}return t=Qg(t[0]*gp,t[1]*gp,t.length>2?t[2]*gp:0),e.invert=function(e){return(e=t.invert(e[0]*gp,e[1]*gp))[0]*=pp,e[1]*=pp,e},e}(i.rotate()).invert([0,0]));return u(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===Dm?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),c()):a()},i.translate=function(t){return arguments.length?(s(t),c()):s()},i.center=function(t){return arguments.length?(o(t),c()):o()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),c()):null==l?null:[[l,e],[n,r]]},c()}function Sm(t){return Dp((fp+t)/2)}function Cm(t,e){var n=vp(t),r=t===e?kp(t):wp(n/vp(e))/wp(Sm(e)/Sm(t)),i=n*jp(Sm(t),r)/r;if(!r)return Dm;function o(t,e){i>0?e<1e-6-fp&&(e=1e-6-fp):e>fp-1e-6&&(e=fp-1e-6);var n=i/jp(Sm(e),r);return[n*kp(r*t),i-n*vp(r*t)]}return o.invert=function(t,e){var n=i-e,o=Ep(r)*Ap(t*t+n*n),a=yp(t,mp(n))*Ep(n);return n*r<0&&(a-=cp*Ep(t)*Ep(n)),[a/r,2*bp(jp(i/o,1/r))-fp]},o}function Fm(t,e){return[t,e]}Fm.invert=Fm;function zm(t,e){var n=vp(t),r=t===e?kp(t):(n-vp(e))/(e-t),i=n/r+t;if(mp(r)<1e-6)return Fm;function o(t,e){var n=i-e,o=r*t;return[n*kp(o),i-n*vp(o)]}return o.invert=function(t,e){var n=i-e,o=yp(t,mp(n))*Ep(n);return n*r<0&&(o-=cp*Ep(t)*Ep(n)),[o/r,i-Ep(r)*Ap(t*t+n*n)]},o}var Tm=1.340264,$m=-.081106,Nm=893e-6,Rm=.003796,Pm=Ap(3)/2;function Bm(t,e){var n=Sp(Pm*kp(e)),r=n*n,i=r*r*r;return[t*vp(n)/(Pm*(Tm+3*$m*r+i*(7*Nm+9*Rm*r))),n*(Tm+$m*r+i*(Nm+Rm*r))]}Bm.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(Tm+$m*i+o*(Nm+Rm*i))-e)/(Tm+3*$m*i+o*(7*Nm+9*Rm*i)))*r)*i*i,!(mp(n)<1e-12));++a);return[Pm*t*(Tm+3*$m*i+o*(7*Nm+9*Rm*i))/vp(r),Sp(kp(r)/Pm)]};function Lm(t,e){var n=vp(e),r=vp(t)*n;return[n*kp(t)/r,kp(e)/r]}Lm.invert=km(bp);function Im(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}Im.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(mp(n)>1e-6&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};function Um(t,e){return[vp(e)*kp(t),kp(e)]}Um.invert=km(Sp);function qm(t,e){var n=vp(e),r=1+vp(t)*n;return[n*kp(t)/r,kp(e)/r]}qm.invert=km((function(t){return 2*bp(t)}));function Wm(t,e){return[wp(Dp((fp+e)/2)),-t]}Wm.invert=function(t,e){return[-e,2*bp(_p(t))-fp]};var Ym=Math.abs,Hm=(Math.atan,Math.atan2,Math.ceil,Math.cos),Gm=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),Vm=(Math.tan,Math.PI),Xm=Vm/2,Jm=(Math.SQRT1_2,Zm(2));Zm(Vm);function Km(t){return t>1?Xm:t<-1?-Xm:Math.asin(t)}function Zm(t){return t>0?Math.sqrt(t):0}function Qm(t,e){var n,r=t*Gm(e),i=30;do{e-=n=(e+Gm(e)-r)/(1+Hm(e))}while(Ym(n)>1e-6&&--i>0);return e/2}var tb=function(t,e,n){function r(r,i){return[t*r*Hm(i=Qm(n,i)),e*Gm(i)]}return r.invert=function(r,i){return i=Km(i/e),[r/(t*Hm(i)),Km((2*i+Gm(2*i))/n)]},r}(Jm/Xm,Jm,Vm);const eb=Fg(),nb=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function rb(t,e){return function n(){const r=e();return r.type=t,r.path=Fg().projection(r),r.copy=r.copy||function(){const t=n();return nb.forEach(e=>{r[e]&&t[e](r[e]())}),t.path.pointRadius(r.path.pointRadius()),t},r}}function ib(t,e){if(!t||"string"!=typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(ab[t]=rb(t,e),this):ab[t]||null}function ob(t){return t&&t.path||eb}const ab={albers:wm,albersusa:function(){var t,e,n,r,i,o,a=wm(),s=Om().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=Om().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function c(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function f(){return t=e=null,c}return c.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},c.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),s.stream(n),u.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(const t in ab)ib(t,ab[t]);function sb(t,e,n){var r=We(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function ub(t,e,n){var r=We(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function lb(){var t,e,n,r,i,o,a,s,u,l,c,f,d=10,h=d,p=90,g=360,m=2.5;function b(){return{type:"MultiLineString",coordinates:y()}}function y(){return We(xp(r/p)*p,n,p).map(c).concat(We(xp(s/g)*g,a,g).map(f)).concat(We(xp(e/d)*d,t,d).filter((function(t){return mp(t%p)>1e-6})).map(u)).concat(We(xp(o/h)*h,i,h).filter((function(t){return mp(t%g)>1e-6})).map(l))}return b.lines=function(){return y().map((function(t){return{type:"LineString",coordinates:t}}))},b.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.extentMajor(t).extentMinor(t):b.extentMinor()},b.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),b.precision(m)):[[r,s],[n,a]]},b.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),b.precision(m)):[[e,o],[t,i]]},b.step=function(t){return arguments.length?b.stepMajor(t).stepMinor(t):b.stepMinor()},b.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],b):[p,g]},b.stepMinor=function(t){return arguments.length?(d=+t[0],h=+t[1],b):[d,h]},b.precision=function(d){return arguments.length?(m=+d,u=sb(o,i,90),l=ub(e,t,m),c=sb(s,a,90),f=ub(r,n,m),b):m},b.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function cb(){}const fb=[[],[[[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 db(){var t=1,e=1,n=a;function r(t,e){return e.map(e=>i(t,e))}function i(r,i){var a=[],s=[];return function(n,r,i){var a,s,u,l,c,f,d=new Array,h=new Array;a=s=-1,l=n[0]>=r,fb[l<<1].forEach(p);for(;++a=r,fb[u|l<<1].forEach(p);fb[l<<0].forEach(p);for(;++s=r,c=n[s*t]>=r,fb[l<<1|c<<2].forEach(p);++a=r,f=c,c=n[s*t+a+1]>=r,fb[u|l<<1|c<<2|f<<3].forEach(p);fb[l|c<<3].forEach(p)}a=-1,c=n[s*t]>=r,fb[c<<2].forEach(p);for(;++a=r,fb[c<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+s],u=[t[1][0]+a,t[1][1]+s],l=o(r),c=o(u);(e=h[l])?(n=d[c])?(delete h[e.end],delete d[n.start],e===n?(e.ring.push(u),i(e.ring)):d[e.start]=h[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[e.end],e.ring.push(u),h[e.end=c]=e):(e=d[c])?(n=h[l])?(delete d[e.start],delete h[n.end],e===n?(e.ring.push(u),i(e.ring)):d[n.start]=h[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(r),d[e.start=l]=e):d[l]=h[c]={start:l,end:c,ring:[r,u]}}fb[c<<3].forEach(p)}(r,i,t=>{n(t,r,i),function(t){var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];for(;++e0?a.push([t]):s.push(t)}),s.forEach(t=>{for(var e,n=0,r=a.length;n{var o,a=n[0],s=n[1],u=0|a,l=0|s,c=r[l*t+u];a>0&&a0&&s=0&&o>=0||Object(Z.o)("invalid size"),t=i,e=o,r},r.smooth=function(t){return arguments.length?(n=t?a:cb,r):n===a},r}function hb(t,e){for(var n,r=-1,i=e.length;++rr!=h>r&&n<(d-l)*(r-c)/(h-c)+l&&(i=-i)}return i}function gb(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function mb(t,e,n){return function(r){var i=Object(Z.q)(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=e?Object(Ii.c)(o,a,t):s/(t+1);return We(u,a,u)}}function bb(t){Pt.call(this,null,t)}function yb(t,e,n,r,i){const o=t.x1||0,a=t.y1||0,s=e*n<0;function u(t){t.forEach(l)}function l(t){s&&t.reverse(),t.forEach(c)}function c(t){t[0]=(t[0]-o)*e+r,t[1]=(t[1]-a)*n+i}return function(t){return t.coordinates.forEach(u),t}}function vb(t,e,n){const r=t>=0?t:Qt(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function xb(t){return Object(Z.E)(t)?t:Object(Z.m)(+t)}function _b(){var t=t=>t[0],e=t=>t[1],n=Z.P,r=[-1,-1],i=960,o=500,a=2;function s(s,u){const l=vb(r[0],s,t)>>a,c=vb(r[1],s,e)>>a,f=l?l+2:0,d=c?c+2:0,h=2*f+(i>>a),p=2*d+(o>>a),g=new Float32Array(h*p),m=new Float32Array(h*p);let b=g;s.forEach(r=>{const i=f+(+t(r)>>a),o=d+(+e(r)>>a);i>=0&&i=0&&o0&&c>0?(Ob(h,p,g,m,l),wb(h,p,m,g,c),Ob(h,p,g,m,l),wb(h,p,m,g,c),Ob(h,p,g,m,l),wb(h,p,m,g,c)):l>0?(Ob(h,p,g,m,l),Ob(h,p,m,g,l),Ob(h,p,g,m,l),b=m):c>0&&(wb(h,p,g,m,c),wb(h,p,m,g,c),wb(h,p,g,m,c),b=m);const y=u?Math.pow(2,-2*a):1/Dh(b);for(let t=0,e=h*p;t>a),y2:d+(o>>a)}}return s.x=function(e){return arguments.length?(t=xb(e),s):t},s.y=function(t){return arguments.length?(e=xb(t),s):e},s.weight=function(t){return arguments.length?(n=xb(t),s):n},s.size=function(t){if(!arguments.length)return[i,o];var e=+t[0],n=+t[1];return e>=0&&n>=0||Object(Z.o)("invalid size"),i=e,o=n,s},s.cellSize=function(t){return arguments.length?((t=+t)>=1||Object(Z.o)("invalid cell size"),a=Math.floor(Math.log(t)/Math.LN2),s):1<=i&&(e>=o&&(s-=n[e-o+a*t]),r[e-i+a*t]=s/Math.min(e+1,t-1+o-e,o))}function wb(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a=i&&(s>=o&&(u-=n[a+(s-o)*t]),r[a+(s-i)*t]=u/Math.min(s+1,e-1+o-s,o))}function jb(t){Pt.call(this,null,t)}bb.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"}]},Object(Z.z)(bb,Pt,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||Z.y,o=db().smooth(!1!==t.smooth),a=t.thresholds||function(t,e,n){const r=mb(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(t.map(t=>qt(e(t).values)))}(r,i,t),s=null===t.as?null:t.as||"contour",u=[];return r.forEach(e=>{const n=i(e),r=o.size([n.width,n.height])(n.values,Object(Z.B)(a)?a:a(n.values));!function(t,e,n,r){let i=r.scale||e.scale,o=r.translate||e.translate;Object(Z.E)(i)&&(i=i(n,r));Object(Z.E)(o)&&(o=o(n,r));if((1===i||null==i)&&!o)return;const a=(Object(Z.F)(i)?i:i[0])||1,s=(Object(Z.F)(i)?i:i[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;t.forEach(yb(e,a,s,u,l))}(r,n,e,t),r.forEach(t=>{u.push(ct(e,ut(null!=s?{[s]:t}:t)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}}),jb.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"}]};const kb=["x","y","weight","size","cellSize","bandwidth"];function Eb(t,e){return kb.forEach(n=>null!=e[n]?t[n](e[n]):0),t}function Ab(t){Pt.call(this,null,t)}Object(Z.z)(jb,Pt,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=function(t,e){var n,r,i,o,a,s,u=[],l=t=>t(o);if(null==e)u.push(t);else for(n={},r=0,i=t.length;rut(function(t,e){for(let n=0;nr.push(u(t))),a&&s&&(e.visit(l,t=>{var e=a(t),n=s(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&i.push([e,n])}),r=r.concat({type:"Feature",geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:"FeatureCollection",features:r}}}),Mb.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},Object(Z.z)(Mb,Pt,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||Z.y,o=t.as||"path",a=n.SOURCE;!r||t.modified()?(this.value=r=ob(t.projection),n.materialize().reflow()):a=i===Z.y||e.modified(i.fields)?n.ADD_MOD:n.ADD;const s=function(t,e){const n=t.pointRadius();t.context(null),null!=e&&t.pointRadius(e);return n}(r,t.pointRadius);return n.visit(a,t=>t[o]=r(i(t))),r.pointRadius(s),n.modifies(o)}}),Sb.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},Object(Z.z)(Sb,Pt,{transform(t,e){var n,r=t.projection,i=t.fields[0],o=t.fields[1],a=t.as||["x","y"],s=a[0],u=a[1];function l(t){const e=r([i(t),o(t)]);e?(t[s]=e[0],t[u]=e[1]):(t[s]=void 0,t[u]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,l):(n=e.modified(i.fields)||e.modified(o.fields),e.visit(n?e.ADD_MOD:e.ADD,l)),e.modifies(a)}}),Cb.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},Object(Z.z)(Cb,Pt,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return r&&!t.modified()||(this.value=r=function(t,e,n){const r=null==n?n=>t(e(n)):r=>{var i=t.pointRadius(),o=t.pointRadius(n)(e(r));return t.pointRadius(i),o};return r.context=e=>(t.context(e),r),r}(ob(t.projection),t.field||Object(Z.u)("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,t=>t[i]=r),n.modifies(i)}}),Fb.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},Object(Z.z)(Fb,Pt,{transform(t,e){var n,r=this.value,i=this.generator;if(!r.length||t.modified())for(const e in t)Object(Z.E)(i[e])&&i[e](t[e]);return n=i(),r.length?e.mod.push(ft(r[0],n)):e.add.push(ut(n)),r[0]=n,e}}),zb.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},Object(Z.z)(zb,Pt,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r="shared"===t.resolve,i=t.field||Z.y,o=function(t,e){let n;Object(Z.E)(t)?(n=n=>t(n,e),n.dep=Tb(t)):t?n=Object(Z.m)(t):(n=t=>t.$value/t.$max||0,n.dep=!0);return n}(t.opacity,t),a=function(t,e){let n;Object(Z.E)(t)?(n=n=>go(t(n,e)),n.dep=Tb(t)):n=Object(Z.m)(go(t||"#888"));return n}(t.color,t),s=t.as||"image",u={$x:0,$y:0,$value:0,$max:r?qt(n.map(t=>qt(i(t).values))):0};return n.forEach(t=>{const e=i(t),n=Object(Z.p)({},t,u);r||(n.$max=qt(e.values||[])),t[s]=function(t,e,n,r){const i=t.width,o=t.height,a=t.x1||0,s=t.y1||0,u=t.x2||i,l=t.y2||o,c=t.values,f=c?t=>c[t]:Z.lb,d=Ci(u-a,l-s),h=d.getContext("2d"),p=h.getImageData(0,0,u-a,l-s),g=p.data;for(let t=s,o=0;t{null!=t[e]&&Nb(n,e,t[e])})):nb.forEach(e=>{t.modified(e)&&Nb(n,e,t[e])}),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){const n=function(t){return 1===(t=Object(Z.i)(t)).length?t[0]:{type:"FeatureCollection",features:t.reduce((t,e)=>t.concat(function(t){return"FeatureCollection"===t.type?t.features:Object(Z.i)(t).filter(t=>null!=t).map(t=>"Feature"===t.type?t:{type:"Feature",geometry:t})}(e)),[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function Rb(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,l,c,f,d,h=t._root,p={data:r},g=t._x0,m=t._y0,b=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((l=e>=(o=(g+b)/2))?g=o:b=o,(c=n>=(a=(m+y)/2))?m=a:y=a,i=h,!(h=h[f=c<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,h.data),u=+t._y.call(null,h.data),e===s&&n===u)return p.next=h,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(g+b)/2))?g=o:b=o,(c=n>=(a=(m+y)/2))?m=a:y=a}while((f=c<<1|l)==(d=(u>=a)<<1|s>=o));return i[d]=h,i[f]=p,t}var Pb=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function Bb(t){return t[0]}function Lb(t){return t[1]}function Ib(t,e,n){var r=new Ub(null==e?Bb:e,null==n?Lb:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Ub(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function qb(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Wb=Ib.prototype=Ub.prototype;Wb.copy=function(){var t,e,n=new Ub(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=qb(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=qb(e));return n},Wb.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Rb(this.cover(e,n),e,n,t)},Wb.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),if&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;nt||t>=i||r>e||e>=o;)switch(s=(ed||(o=u.y0)>h||(a=u.x1)=b)<<1|t>=m)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var y=t-+this._x.call(null,g.data),v=e-+this._y.call(null,g.data),x=y*y+v*v;if(x=(s=(p+m)/2))?p=s:m=s,(c=a>=(u=(g+b)/2))?g=u:b=u,e=h,!(h=h[f=c<<1|l]))return this;if(!h.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,d=f)}for(;h.data!==t;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},Wb.removeAll=function(t){for(var e=0,n=t.length;e{}};function Jb(){for(var t,e=0,n=arguments.length,r={};e=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Qb(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),o=0;o=0&&e._call.call(null,t),e=e._next;--iy}()}finally{iy=0,function(){var t,e,n=ey,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ey=e);ny=t,yy(r)}(),uy=0}}function by(){var t=cy.now(),e=t-sy;e>1e3&&(ly-=e,sy=t)}function yy(t){iy||(oy&&(oy=clearTimeout(oy)),t-uy>24?(t<1/0&&(oy=setTimeout(my,t-cy.now()-ly)),ay&&(ay=clearInterval(ay))):(ay||(sy=cy.now(),ay=setInterval(by,1e3)),iy=1,fy(my)))}py.prototype=gy.prototype={constructor:py,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?dy():+n)+(null==e?0:+e),this._next||ny===this||(ny?ny._next=this:ey=this,ny=this),this._call=t,this._time=n,yy()},stop:function(){this._call&&(this._call=null,this._time=1/0,yy())}};function vy(t){return t.x}function xy(t){return t.y}var _y=Math.PI*(3-Math.sqrt(5));function Oy(t){return t.index}function wy(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}const jy={center:function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;il+p||oc+p||au.index){var g=l-s.x-s.vx,m=c-s.y-s.vy,b=g*g+m*m;bt.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=Hb(n))*f),0===d&&(p+=(d=Hb(n))*d),p[s(t,e,r),t]));for(a=0,i=new Array(l);ae(t,n):e)}function zy(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}Dy.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:Ay}]},Object(Z.z)(Dy,Pt,{transform(t,e){var n,r,i=this.value,o=e.changed(e.ADD_REM),a=t.modified(ky),s=t.iterations||300;if(i?(o&&(e.modifies("index"),i.nodes(e.source)),(a||e.changed(e.MOD))&&My(i,t,0,e)):(this.value=i=function(t,e){const n=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=gy(f),l=ry("tick","end"),c=function(){let t=1;return()=>(t=(1664525*t+1013904223)%4294967296)/4294967296}();function f(){d(),l.call("tick",e),n1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l1?(l.on(t,n),e):l.on(t)}}}(t),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),My(n,e,!0).on("end",()=>o=!0)}(e.source,t),i.on("tick",(n=e.dataflow,r=this,()=>n.touch(r).run())),t.static||(o=!0,i.tick()),e.modifies("index")),a||o||t.modified(Ey)||e.changed()&&t.restart)if(i.alpha(Math.max(i.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/s)),t.static)for(i.stop();--s>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return e.StopPropagation;return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let t,e=this._argops,s=0,u=e.length;s=0;--o)u.push(r=i[o]=new By(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Py)}function $y(t){return t.children}function Ny(t){return Array.isArray(t)?t[1]:null}function Ry(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Py(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function By(t){this.data=t,this.depth=this.height=0,this.parent=null}By.prototype=Ty.prototype={constructor:By,count:function(){return this.eachAfter(zy)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],u=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Ty(this).eachBefore(Ry)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n0&&n*n>r*r+i*i}function Wy(t,e){for(var n=0;n(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=t.x-r*s-o*u,n.y=t.y-r*u+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*s-o*u,n.y=e.y+r*u+o*s)):(n.x=e.x+n.r,n.y=e.y)}function Xy(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Jy(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function Ky(t){this._=t,this.next=null,this.previous=null}function Zy(t){if(!(o=(e=t,t="object"==typeof e&&"length"in e?e:Array.from(e)).length))return 0;var e,n,r,i,o,a,s,u,l,c,f,d;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;Vy(r,n,i=t[2]),n=new Ky(n),r=new Ky(r),i=new Ky(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(u=3;u0)throw new Error("cycle");return o}return n.id=function(e){return arguments.length?(t=tv(e),n):t},n.parentId=function(t){return arguments.length?(e=tv(t),n):e},n};function pv(t,e){return t.parent===e.parent?1:2}function gv(t){var e=t.children;return e?e[0]:t.t}function mv(t){var e=t.children;return e?e[e.length-1]:t.t}function bv(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function yv(t,e,n){return t.a.parent===e.parent?t.a:n}function vv(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}vv.prototype=Object.create(By.prototype);function xv(t,e){return t.parent===e.parent?1:2}function _v(t,e){return t+e.x}function Ov(t,e){return Math.max(t,e.y)}var wv=function(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,l=t.value&&(i-n)/t.value;++sd&&(d=s),m=c*c*g,(h=Math.max(d/m,m/f))>p){c-=s;break}p=h}b.push(a={value:c,dice:u1?e:1)},n}(jv),Av=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,u,l,c,f=-1,d=a.length,h=t.value;++f1?e:1)},n}(jv);function Dv(t,e,n){const r={};return t.each(t=>{const i=t.data;n(i)&&(r[e(i)]=t)}),t.lookup=r,t}function Mv(t){Pt.call(this,null,t)}Mv.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const Sv=t=>t.values;function Cv(){const t=[],e={entries:e=>function e(n,r){if(++r>t.length)return n;const i=[];for(const t in n)i.push({key:t,values:e(n[t],r)});return i}(function e(n,r){if(r>=t.length)return n;const i=n.length,o=t[r++],a={},s={};let u,l,c,f=-1;for(;++f(t.push(n),e)};return e}function Fv(t){Pt.call(this,null,t)}Object(Z.z)(Mv,Pt,{transform(t,e){e.source||Object(Z.o)("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each(t=>{t.children&&ot(t.data)&&i.rem.push(t.data)}),this.value=o=Ty({values:Object(Z.i)(t.keys).reduce((t,e)=>(t.key(e),t),Cv()).entries(i.source)},Sv),n&&o.each(t=>{t.children&&(t=ut(t.data),i.add.push(t),i.source.push(t))}),Dv(o,at,at)),i.source.root=o,i}});const zv=(t,e)=>t.parent===e.parent?1:2;Object(Z.z)(Fv,Pt,{transform(t,e){e.source&&e.source.root||Object(Z.o)(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(dt(t.sort,t=>t.data)),function(t,e,n){for(let r,i=0,o=e.length;ifunction(t,e,n){const r=t.data,i=e.length-1;for(let o=0;o=0;--i)s.push(n=e.children[i]=new vv(r[i],i)),n.parent=e;return(a.parent=new vv(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var l=i,c=i,f=i;i.eachBefore((function(t){t.xc.x&&(c=t),t.depth>f.depth&&(f=t)}));var d=l===c?1:t(l,c)/2,h=d-l.x,p=e/(c.x+d+h),g=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+h)*p,t.y=t.depth*g}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,u=o.parent.children[0],l=o.m,c=a.m,f=s.m,d=u.m;s=mv(s),o=gv(o),s&&o;)u=gv(u),(a=mv(a)).a=e,(i=s.z+f-o.z-l+t(s._,o._))>0&&(bv(yv(s,e,r),e,i),l+=i,c+=i),f+=s.m,l+=o.m,d+=u.m,c+=a.m;s&&!mv(a)&&(a.t=s,a.m+=f-c),o&&!gv(u)&&(u.t=o,u.m+=l-d,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},cluster:function(){var t=xv,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(_v,0)/t.length}(n),e.y=function(t){return 1+t.reduce(Ov,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=s.x-t(s,u)/2,c=u.x+t(u,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(c-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}},Lv=["x","y","depth","children"];function Iv(t){Fv.call(this,t)}function Uv(t){Pt.call(this,[],t)}Iv.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:Lv.length,default:Lv}]},Object(Z.z)(Iv,Fv,{layout(t){const e=t||"tidy";if(Object(Z.w)(Bv,e))return Bv[e]();Object(Z.o)("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:Lv}),Uv.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},Object(Z.z)(Uv,Pt,{transform(t,e){const n=this.value,r=e.source&&e.source.root,i=e.fork(e.NO_SOURCE),o={};return r||Object(Z.o)("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(i.rem=n,e.visit(e.SOURCE,t=>o[at(t)]=1),r.each(t=>{const e=t.data,n=t.parent&&t.parent.data;n&&o[at(e)]&&o[at(n)]&&i.add.push(ut({source:n,target:e}))}),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,t=>o[at(t)]=1),n.forEach(t=>{(o[at(t.source)]||o[at(t.target)])&&i.mod.push(t)})),i}});const qv={binary:function(t,e,n,r,i){var o,a,s=t.children,u=s.length,l=new Array(u+1);for(l[0]=a=o=0;o=n-1){var c=s[e];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=u)}var f=l[e],d=r/2+f,h=e+1,p=n-1;for(;h>>1;l[g]u-o){var y=r?(i*b+a*m)/r:a;t(e,h,m,i,o,y,u),t(h,n,b,y,o,a,u)}else{var v=r?(o*b+u*m)/r:u;t(e,h,m,i,o,a,v),t(h,n,b,i,v,a,u)}}(0,u,t.value,e,n,r,i)},dice:uv,slice:wv,slicedice:function(t,e,n,r,i){(1&t.depth?wv:uv)(t,e,n,r,i)},squarify:Ev,resquarify:Av},Wv=["x0","y0","x1","y1","depth","children"];function Yv(t){Fv.call(this,t)}Yv.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Wv.length,default:Wv}]},Object(Z.z)(Yv,Fv,{layout(){const t=function(){var t=Ev,e=!1,n=1,r=1,i=[0],o=ev,a=ev,s=ev,u=ev,l=ev;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(sv),t}function f(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,f=e.x1-n,d=e.y1-n;f{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{Object(Z.w)(qv,e)?t.tile(qv[e]):Object(Z.o)("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Wv});function Hv(t,e,n,r){const i=t.width,o=t.height,a=n||r,s=Ci(i,o).getContext("2d");e.forEach(t=>function t(e,n,r){if(!n.length)return;const i=n[0].mark.marktype;"group"===i?n.forEach(n=>{n.items.forEach(n=>t(e,n.items,r))}):_f[i].draw(e,{items:r?n.map(Gv):n})}(s,t,a));const u=new Uint32Array(s.getImageData(0,0,i,o).data.buffer),l=t.bitmap(),c=a&&t.bitmap();let f,d,h,p,g;for(d=0;d~~((t+n)/r);return a.invert=t=>t*r-n,a.bitmap=()=>function(t,e){const n=new Uint32Array(~~((t*e+32)/32));function r(t,e){n[t]|=e}function i(t,e){n[t]&=e}return{array:n,get:(e,r)=>{const i=r*t+e;return n[i>>>5]&1<<(31&i)},set:(e,n)=>{const i=n*t+e;r(i>>>5,1<<(31&i))},clear:(e,n)=>{const r=n*t+e;i(r>>>5,~(1<<(31&r)))},getRange:(e,r,i,o)=>{let a,s,u,l,c=o;for(;c>=r;--c)if(a=c*t+e,s=c*t+i,u=a>>>5,l=s>>>5,u===l){if(n[u]&Vv[31&a]&Xv[1+(31&s)])return!0}else{if(n[u]&Vv[31&a])return!0;if(n[l]&Xv[1+(31&s)])return!0;for(let t=u+1;t{let a,s,u,l,c;for(;n<=o;++n)if(a=n*t+e,s=n*t+i,u=a>>>5,l=s>>>5,u===l)r(u,Vv[31&a]&Xv[1+(31&s)]);else for(r(u,Vv[31&a]),r(l,Xv[1+(31&s)]),c=u+1;c{let a,s,u,l,c;for(;n<=o;++n)if(a=n*t+e,s=n*t+r,u=a>>>5,l=s>>>5,u===l)i(u,Xv[31&a]|Vv[1+(31&s)]);else for(i(u,Xv[31&a]),i(l,Vv[1+(31&s)]),c=u+1;cn<0||r<0||o>=e||i>=t}}(i,o),a.ratio=r,a.padding=n,a.width=t,a.height=e,a}function Kv(t,e,n,r,i,o){let a=n/2;return t-a<0||t+a>i||e-(a=r/2)<0||e+a>o}function Zv(t,e,n,r,i,o,a,s){const u=i*o/(2*r),l=t(e-u),c=t(e+u),f=t(n-(o/=2)),d=t(n+o);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||s&&s.getRange(l,f,c,d)}const Qv=[-1,-1,1,1],tx=[-1,1,-1,1];const ex=["right","center","left"],nx=["bottom","middle","top"];function rx(t,e,n,r,i,o,a,s,u,l,c,f){return!(i.outOfBounds(t,n,e,r)||(f&&o?o.getRange(t,n,e,r)||!function(t,e,n,r,i){return i[0]<=t&&n<=i[2]&&i[3]<=e&&r<=i[5]}(a,u,s,l,c):i.getRange(t,n,e,r)))}const ix={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},ox={naive:function(t,e,n,r){const i=t.width,o=t.height;return function(t){const e=t.datum.datum.items[r].items,n=e.length,a=t.datum.fontSize,s=nf.width(t.datum,t.datum.text);let u,l,c,f,d,h,p,g=0;for(let r=0;r=g&&(g=p,t.x=d,t.y=h);return d=s/2,h=a/2,u=t.x-d,l=t.x+d,c=t.y-h,f=t.y+h,t.align="center",u<0&&l<=i?t.align="left":0<=u&&i=1;)d=(h+p)/2,Zv(t,c,f,l,u,d,a,s)?p=d:h=d;if(h>r)return[c,f,h,!0]}}return function(e){const s=e.datum.datum.items[r].items,l=s.length,c=e.datum.fontSize,f=nf.width(e.datum,e.datum.text);let d,h,p,g,m,b,y,v,x,_,O,w,j,k,E,A,D,M=n?c:0,S=!1,C=!1,F=0;for(let r=0;rh&&(D=d,d=h,h=D),p>g&&(D=p,p=g,g=D),x=t(d),O=t(h),_=~~((x+O)/2),w=t(p),k=t(g),j=~~((w+k)/2),y=_;y>=x;--y)for(v=j;v>=w;--v)A=u(y,v,M,f,c),A&&([e.x,e.y,M,S]=A);for(y=_;y<=O;++y)for(v=j;v<=k;++v)A=u(y,v,M,f,c),A&&([e.x,e.y,M,S]=A);S||n||(E=Math.abs(h-d+g-p),m=(d+h)/2,b=(p+g)/2,E>=F&&!Kv(m,b,f,c,i,o)&&!Zv(t,m,b,c,f,c,a,null)&&(F=E,e.x=m,e.y=b,C=!0))}return!(!S&&!C)&&(m=f/2,b=c/2,a.setRange(t(e.x-m),t(e.y-b),t(e.x+m),t(e.y+b)),e.align="center",e.baseline="middle",!0)}},floodfill:function(t,e,n,r){const i=t.width,o=t.height,a=e[0],s=e[1],u=t.bitmap();return function(e){const l=e.datum.datum.items[r].items,c=l.length,f=e.datum.fontSize,d=nf.width(e.datum,e.datum.text),h=[];let p,g,m,b,y,v,x,_,O,w,j,k,E=n?f:0,A=!1,D=!1,M=0;for(let r=0;r=1;)j=(O+w)/2,Zv(t,y,v,f,d,j,a,s)?w=j:O=j;O>E&&(e.x=y,e.y=v,E=O,A=!0)}}A||n||(k=Math.abs(g-p+b-m),y=(p+g)/2,v=(m+b)/2,k>=M&&!Kv(y,v,d,f,i,o)&&!Zv(t,y,v,f,d,f,a,null)&&(M=k,e.x=y,e.y=v,D=!0))}return!(!A&&!D)&&(y=d/2,v=f/2,a.setRange(t(e.x-y),t(e.y-v),t(e.x+y),t(e.y+v)),e.align="center",e.baseline="middle",!0)}}};function ax(t,e,n,r,i,o,a,s,u,l,c){if(!t.length)return t;const f=Math.max(r.length,i.length),d=function(t,e){const n=new Float64Array(e),r=t.length;for(let e=0;e[t.x,t.x,t.x,t.y,t.y,t.y];return t?"line"===t||"area"===t?t=>i(t.datum):"line"===e?t=>{const e=t.datum.items[r].items;return i(e.length?e["start"===n?0:e.length-1]:{x:NaN,y:NaN})}:t=>{const e=t.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}:i}(p,g,s,u),y=Jv(e[0],e[1],l),v=m&&"naive"===c;var x;const _=t.map(t=>({datum:t,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:b(t)}));let O;if(!v){n&&_.sort((t,e)=>n(t.datum,e.datum));let e=!1;for(let t=0;tt.datum)].concat(o)),O=o.length?Hv(y,o,e,m):function(t,e){const n=t.bitmap();return(e||[]).forEach(e=>n.set(t(e.boundary[0]),t(e.boundary[3]))),[n,void 0]}(y,a&&_)}const w=m?ox[c](y,O,a,u):function(t,e,n,r){const i=t.width,o=t.height,a=e[0],s=e[1],u=r.length;return function(e){const l=e.boundary,c=e.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>o)return!1;let f,d,h,p,g,m,b,y,v,x,_,O,w,j,k,E=0;for(let i=0;i>>2&3)-1,h=0===f&&0===d||r[i]<0,p=f&&d?Math.SQRT1_2:1,g=r[i]<0?-1:1,m=l[1+f]+r[i]*f*p,_=l[4+d]+g*c*d/2+r[i]*d*p,y=_-c/2,v=_+c/2,O=t(m),j=t(y),k=t(v),!E){if(!rx(O,O,j,k,a,s,m,m,y,v,l,h))continue;E=nf.width(e.datum,e.datum.text)}if(x=m+g*E*f/2,m=x-E/2,b=x+E/2,O=t(m),w=t(b),rx(O,w,j,k,a,s,m,b,y,v,l,h))return e.x=f?f*g<0?b:m:x,e.y=d?d*g<0?v:y:_,e.align=ex[f*g+1],e.baseline=nx[d*g+1],a.setRange(O,j,w,k),!0}return!1}}(y,O,h,d);return _.forEach(t=>t.opacity=+w(t)),_}const sx=["x","y","opacity","align","baseline"],ux=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function lx(t){Pt.call(this,null,t)}function cx(t,e){var n,r,i,o,a,s,u=[],l=function(t){return t(o)};if(null==e)u.push(t);else for(n={},r=0,i=t.length;r{const e=t.datum;e[r[0]]=t.x,e[r[1]]=t.y,e[r[2]]=t.opacity,e[r[3]]=t.align,e[r[4]]=t.baseline}),e.reflow(n).modifies(r)}}),fx.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},Object(Z.z)(fx,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=cx(e.materialize(e.SOURCE).source,t.groupby),i=(t.groupby||[]).map(Z.h),o=i.length,a=t.as||[Object(Z.h)(t.x),Object(Z.h)(t.y)],s=[];r.forEach(e=>{Pe(e,t.x,t.y,t.bandwidth||.3).forEach(t=>{const n={};for(let t=0;t"poly"===t?e:"quad"===t?2:1)(o,a),u=t.as||[Object(Z.h)(t.x),Object(Z.h)(t.y)],l=dx[o],c=[];let f=t.extent;Object(Z.w)(dx,o)||Object(Z.o)("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),r.forEach(n=>{if(n.length<=s)return void e.dataflow.warn("Skipping regression with more parameters than data points.");const r=l(n,t.x,t.y,a);if(t.params)return void c.push(ut({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const d=f||Object(Z.q)(n,t.x),h=t=>{const e={};for(let t=0;th([t,r.predict(t)])):Ue(r.predict,d,25,200).forEach(h)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const px=Math.pow(2,-52),gx=new Uint32Array(512);class mx{static from(t,e=jx,n=kx){const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,s=1/0,u=-1/0,l=-1/0;for(let e=0;eu&&(u=n),r>l&&(l=r),this._ids[e]=e}const c=(a+u)/2,f=(s+l)/2;let d,h,p,g=1/0;for(let e=0;e0&&(h=e,g=n)}let y=t[2*h],v=t[2*h+1],x=1/0;for(let e=0;er&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(vx(m,b,y,v,_,O)){const t=h,e=y,n=v;h=p,y=_,v=O,p=t,_=e,O=n}const w=function(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u);return{x:t+(l*c-s*f)*d,y:e+(a*f-u*c)*d}}(m,b,y,v,_,O);this._cx=w.x,this._cy=w.y;for(let e=0;e0&&Math.abs(l-o)<=px&&Math.abs(c-a)<=px)continue;if(o=l,a=c,u===d||u===h||u===p)continue;let f=0;for(let t=0,e=this._hashKey(l,c);t0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,-1===a){if(0===i)break;t=gx[--i];continue}const u=a-a%3,l=s+(t+1)%3,c=u+(a+2)%3,f=e[o],d=e[t],h=e[l],p=e[c];if(xx(r[2*f],r[2*f+1],r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1])){e[t]=p,e[a]=f;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,c);const s=u+(a+1)%3;i=33306690738754716e-32*Math.abs(a+s)?a-s:0}function vx(t,e,n,r,i,o){return(yx(i,o,t,e,n,r)||yx(t,e,n,r,i,o)||yx(n,r,i,o,t,e))<0}function xx(t,e,n,r,i,o,a,s){const u=t-a,l=e-s,c=n-a,f=r-s,d=i-a,h=o-s,p=c*c+f*f,g=d*d+h*h;return u*(f*g-p*h)-l*(c*g-p*d)+(u*u+l*l)*(c*h-f*d)<0}function _x(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u),h=(l*c-s*f)*d,p=(a*f-u*c)*d;return h*h+p*p}function Ox(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],o=e[r];let a=i-1;for(;a>=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=n+1,o=r;wx(t,n+r>>1,i),e[t[n]]>e[t[r]]&&wx(t,n,r),e[t[i]]>e[t[r]]&&wx(t,i,r),e[t[n]]>e[t[i]]&&wx(t,n,i);const a=t[i],s=e[a];for(;;){do{i++}while(e[t[i]]s);if(o=o-n?(Ox(t,e,i,r),Ox(t,e,n,o-1)):(Ox(t,e,n,o-1),Ox(t,e,i,r))}}function wx(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function jx(t){return t[0]}function kx(t){return t[1]}class Ex{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>1e-6||Math.abs(this._y1-i)>1e-6)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Ax{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class Dx{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let e,r,o=0,a=0,s=n.length;o1;)i-=2;for(let t=2;t4)for(let t=0;t0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)this.xmax?2:0)|(ethis.ymax?8:0)}}const Mx=2*Math.PI,Sx=Math.pow;function Cx(t){return t[0]}function Fx(t){return t[1]}function zx(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class Tx{static from(t,e=Cx,n=Fx,r){return new Tx("length"in t?function(t,e,n,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},(t,e)=>e).sort((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]);const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],this.triangles[1]=r[1],this.triangles[2]=r[1],o[r[0]]=1,2===r.length&&(o[r[1]]=0))}voronoi(t){return new Dx(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[t]||!u.length)return(t+1)%(u.length>>1);let l=t,c=Sx(e-u[2*t],2)+Sx(n-u[2*t+1],2);const f=r[t];let d=f;do{let r=s[d];const f=Sx(e-u[2*r],2)+Sx(n-u[2*r+1],2);if(f=h));)if(e.x=f+i,e.y=d+o,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>s[0]||e.y+e.y1>s[1]||n&&Ix(e,t,s[0])||n&&(l=n,!((a=e).x+a.x1>l[0].x&&a.x+a.x0l[0].y&&a.y+a.y0>5,x=s[0]>>5,_=e.x-(v<<4),O=127&_,w=32-O,j=e.y1-e.y0,k=(e.y+e.y0)*x+(_>>5),E=0;E>>O:0);k+=x}return e.sprite=null,!0}return!1}return f.layout=function(){for(var u=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=2048/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(Ci()),f=function(t){var e=[],n=-1;for(;++n>5)*s[1]),h=null,p=l.length,g=-1,m=[],b=l.map(s=>({text:t(s),font:e(s),style:r(s),weight:i(s),rotate:o(s),size:~~(n(s)+1e-14),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s})).sort((t,e)=>e.size-t.size);++g>1,y.y=s[1]*(c()+.5)>>1,Lx(u,y,b,g),y.hasText&&d(f,y,h)&&(m.push(y),h?Ux(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-=s[0]>>1,y.y-=s[1]>>1)}return m},f.words=function(t){return arguments.length?(l=t,f):l},f.size=function(t){return arguments.length?(s=[+t[0],+t[1]],f):s},f.font=function(t){return arguments.length?(e=Wx(t),f):e},f.fontStyle=function(t){return arguments.length?(r=Wx(t),f):r},f.fontWeight=function(t){return arguments.length?(i=Wx(t),f):i},f.rotate=function(t){return arguments.length?(o=Wx(t),f):o},f.text=function(e){return arguments.length?(t=Wx(e),f):t},f.spiral=function(t){return arguments.length?(u=Yx[t]||t,f):u},f.fontSize=function(t){return arguments.length?(n=Wx(t),f):n},f.padding=function(t){return arguments.length?(a=Wx(t),f):a},f.random=function(t){return arguments.length?(c=t,f):c},f}function Lx(t,e,n,r){if(!e.sprite){var i=t.context,o=t.ratio;i.clearRect(0,0,2048/o,2048/o);var a,s,u,l,c,f=0,d=0,h=0,p=n.length;for(--r;++r>5<<5,u=~~Math.max(Math.abs(y+v),Math.abs(y-v))}else a=a+31>>5<<5;if(u>h&&(h=u),f+a>=2048&&(f=0,d+=h,h=0),d+u>=2048)break;i.translate((f+(a>>1))/o,(d+(u>>1))/o),e.rotate&&i.rotate(e.rotate*Px),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=a,e.height=u,e.xoff=f,e.yoff=d,e.x1=a>>1,e.y1=u>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,f+=a}for(var _=i.getImageData(0,0,2048/o,2048/o).data,O=[];--r>=0;)if((e=n[r]).hasText){for(s=(a=e.width)>>5,u=e.y1-e.y0,l=0;l>5),E=_[2048*(d+c)+(f+l)<<2]?1<<31-l%32:0;O[k]|=E,w|=E}w?j=c:(e.y0++,u--,c--,d++)}e.y1=e.y0+j,e.sprite=O.slice(0,(e.y1-e.y0)*s)}}}function Ix(t,e,n){n>>=5;for(var r,i=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,u=32-s,l=t.y1-t.y0,c=(t.y+t.y0)*n+(a>>5),f=0;f>>s:0))&e[c+d])return!0;c+=n}return!1}function Ux(t,e){var n=t[0],r=t[1];e.x+e.x0r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function qx(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function Wx(t){return"function"==typeof t?t:function(){return t}}var Yx={archimedean:qx,rectangular:function(t){var e=4*t[0]/t[1],n=0,r=0;return function(t){var i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};const Hx=["x","y","font","fontSize","fontStyle","fontWeight","angle"],Gx=["text","font","rotate","fontSize","fontStyle","fontWeight"];function Vx(t){Pt.call(this,Bx(),t)}Vx.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:Hx}]},Object(Z.z)(Vx,Pt,{transform(t,e){!t.size||t.size[0]&&t.size[1]||Object(Z.o)("Wordcloud size dimensions must be non-zero.");const n=t.modified();if(!(n||e.changed(e.ADD_REM)||Gx.some((function(n){const r=t[n];return Object(Z.E)(r)&&e.modified(r.fields)}))))return;const r=e.materialize(e.SOURCE).source,i=this.value,o=t.as||Hx;let a,s=t.fontSize||14;if(Object(Z.E)(s)?a=t.fontSizeRange:s=Object(Z.m)(s),a){const t=s,e=Hs("sqrt")().domain(Object(Z.q)(r,t)).range(a);s=n=>e(t(n))}r.forEach(t=>{t[o[0]]=NaN,t[o[1]]=NaN,t[o[3]]=0});const u=i.words(r).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(s).random(ee).layout(),l=i.size(),c=l[0]>>1,f=l[1]>>1,d=u.length;for(let t,e,n=0;nnew Uint8Array(t),Jx=t=>new Uint16Array(t),Kx=t=>new Uint32Array(t);function Zx(t,e,n){const r=(e<257?Xx:e<65537?Jx:Kx)(t);return n&&r.set(n),r}function Qx(t,e,n){const r=1<{const r=t[e],i=t[n];return ri?1:0}),function(t,e){return Array.from(e,e=>t[e])}(t,e)}(d,u),a)l=e,c=t,e=Array(a+s),t=Kx(a+s),function(t,e,n,r,i,o,a,s,u){let l,c=0,f=0;for(l=0;c0)for(f=0;ft,size:()=>n}}function e_(t){Pt.call(this,function(){let t=8,e=[],n=Kx(0),r=Zx(0,t),i=Zx(0,t);return{data:()=>e,seen:()=>{return t=n,r=e.length,n=t.length>=r?t:((i=i||new t.constructor(r)).set(t),i);var t,r,i},add(t){for(let n,r=0,i=e.length,o=t.length;re.length,curr:()=>r,prev:()=>i,reset:t=>i[t]=r[t],all:()=>t<257?255:t<65537?65535:4294967295,set(t,e){r[t]|=e},clear(t,e){r[t]&=~e},resize(e,n){(e>r.length||n>t)&&(t=Math.max(n,t),r=Zx(e,t,r),i=Zx(e,t))}}}(),t),this._indices=null,this._dims=null}function n_(t){Pt.call(this,null,t)}e_.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}}]},Object(Z.z)(e_,Pt,{transform(t,e){return this._dims?t.modified("fields")||t.fields.some(t=>e.modified(t.fields))?this.reinit(t,e):this.eval(t,e):this.init(t,e)},init(t,e){const n=t.fields,r=t.query,i=this._indices={},o=this._dims=[],a=r.length;let s,u,l=0;for(;l{const t=i.remove(e,n);for(const e in r)r[e].reindex(t)})},update(t,e,n){const r=this._dims,i=t.query,o=e.stamp,a=r.length;let s,u,l=0;for(n.filters=0,u=0;uh)for(m=h,b=Math.min(f,p);mp)for(m=Math.max(f,p),b=d;mc)for(h=c,p=Math.min(u,f);hf)for(h=Math.max(u,f),p=l;hs[t]&n?null:a[t];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,t=>{const e=s[t]&n;return!e&&e^u[t]&n?a[t]:null}),o.filter(o.REM,t=>{const e=s[t]&n;return e&&!(e^e^u[t]&n)?a[t]:null})):(o.filter(o.ADD,l),o.filter(o.REM,t=>(s[t]&n)===i?a[t]:null)),o.filter(o.SOURCE,t=>l(t._index))}});function r_(t){this.type=t}var i_,o_,a_,s_,u_;r_.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=function(t){switch(t.type){case"ArrayExpression":return t.elements;case"BinaryExpression":case"LogicalExpression":return[t.left,t.right];case"CallExpression":return[t.callee].concat(t.arguments);case"ConditionalExpression":return[t.test,t.consequent,t.alternate];case"MemberExpression":return[t.object,t.property];case"ObjectExpression":return t.properties;case"Property":return[t.key,t.value];case"UnaryExpression":return[t.argument];case"Identifier":case"Literal":case"RawCode":default:return[]}}(this),n=0,r=e.length;n",i_[3]="Identifier",i_[4]="Keyword",i_[5]="Null",i_[6]="Numeric",i_[7]="Punctuator",i_[8]="String",i_[9]="RegularExpression";var l_="ILLEGAL",c_=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]"),f_=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 d_(t,e){if(!t)throw new Error("ASSERT: "+e)}function h_(t){return t>=48&&t<=57}function p_(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function g_(t){return"01234567".indexOf(t)>=0}function m_(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function b_(t){return 10===t||13===t||8232===t||8233===t}function y_(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&c_.test(String.fromCharCode(t))}function v_(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&f_.test(String.fromCharCode(t))}const x_={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 __(){for(;a_1114111||"}"!==t)&&P_({},"Unexpected token %0",l_),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function j_(){var t,e;for(t=o_.charCodeAt(a_++),e=String.fromCharCode(t),92===t&&(117!==o_.charCodeAt(a_)&&P_({},"Unexpected token %0",l_),++a_,(t=O_("u"))&&"\\"!==t&&y_(t.charCodeAt(0))||P_({},"Unexpected token %0",l_),e=t);a_>>="===(r=o_.substr(a_,4))?{type:7,value:r,start:i,end:a_+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:a_+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:7,value:e,start:i,end:a_+=2}:"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:i,end:++a_}:void P_({},"Unexpected token %0",l_)}function A_(){var t,e,n;if(d_(h_((n=o_[a_]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=a_,t="","."!==n){if(t=o_[a_++],n=o_[a_],"0"===t){if("x"===n||"X"===n)return++a_,function(t){let e="";for(;a_=0&&P_({},"Invalid regular expression",n),{value:n,literal:e}}(),r=function(t,e){let n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(t,e)=>{if(parseInt(e,16)<=1114111)return"x";P_({},"Invalid regular expression")}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(t){P_({},"Invalid regular expression")}try{return new RegExp(t,e)}catch(t){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:a_}}function M_(){if(__(),a_>=s_)return{type:2,start:a_,end:a_};const t=o_.charCodeAt(a_);return y_(t)?k_():40===t||41===t||59===t?E_():39===t||34===t?function(){var t,e,n,r,i="",o=!1;for(d_("'"===(t=o_[a_])||'"'===t,"String literal must starts with a quote"),e=a_,++a_;a_=0&&a_(d_(e":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function eO(){var t,e;return t=function(){var t,e,n,r,i,o,a,s,u,l;if(t=u_,u=Q_(),0===(i=tO(r=u_)))return u;for(r.prec=i,S_(),e=[t,u_],o=[u,r,a=Q_()];(i=tO(u_))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),e.pop(),n=F_(s,u,a),o.push(n);(r=S_()).prec=i,o.push(r),e.push(u_),n=Q_(),o.push(n)}for(n=o[l=o.length-1],e.pop();l>1;)e.pop(),n=F_(o[l-1].value,o[l-2],n),l-=2;return n}(),I_("?")&&(S_(),e=eO(),L_(":"),t=function(t,e,n){const r=new r_("ConditionalExpression");return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,eO())),t}function nO(){const t=eO();if(I_(","))throw new Error("Disabled.");return t}function rO(t){a_=0,s_=(o_=t).length,u_=null,C_();const e=nO();if(2!==u_.type)throw new Error("Unexpect token after expression.");return e}var iO={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 oO(t){function e(e,n,r){return i=>function(e,n,r,i){let o=t(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}const n="new Date";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(e){e.length<3&&Object(Z.o)("Missing arguments to clamp function."),e.length>3&&Object(Z.o)("Too many arguments to clamp function.");const n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),join:e("join",null),indexof:e("indexOf",null),lastindexof:e("lastIndexOf",null),slice:e("slice",null),reverse:function(e){return"("+t(e[0])+").slice().reverse()"},parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase","String",0),lower:e("toLowerCase","String",0),substring:e("substring","String"),split:e("split","String"),replace:e("replace","String"),trim:e("trim","String",0),regexp:"RegExp",test:e("test","RegExp"),if:function(e){e.length<3&&Object(Z.o)("Missing arguments to if function."),e.length>3&&Object(Z.o)("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}var aO,sO,uO,lO,cO,fO=new lp,dO=new lp,hO={point:Cp,lineStart:Cp,lineEnd:Cp,polygonStart:function(){fO=new lp,hO.lineStart=pO,hO.lineEnd=gO},polygonEnd:function(){var t=+fO;dO.add(t<0?hp+t:t),this.lineStart=this.lineEnd=this.point=Cp},sphere:function(){dO.add(hp)}};function pO(){hO.point=mO}function gO(){bO(aO,sO)}function mO(t,e){hO.point=bO,aO=t,sO=e,uO=t*=gp,lO=vp(e=(e*=gp)/2+dp),cO=kp(e)}function bO(t,e){var n=(t*=gp)-uO,r=n>=0?1:-1,i=r*n,o=vp(e=(e*=gp)/2+dp),a=kp(e),s=cO*a,u=lO*o+s*vp(i),l=s*r*kp(i);fO.add(yp(l,u)),uO=t,lO=o,cO=a}var yO,vO,xO,_O,OO,wO,jO,kO,EO,AO,DO,MO={point:SO,lineStart:FO,lineEnd:zO,polygonStart:function(){MO.point=TO,MO.lineStart=$O,MO.lineEnd=NO,EO=new lp,hO.polygonStart()},polygonEnd:function(){hO.polygonEnd(),MO.point=SO,MO.lineStart=FO,MO.lineEnd=zO,fO<0?(yO=-(xO=180),vO=-(_O=90)):EO>1e-6?_O=90:EO<-1e-6&&(vO=-90),DO[0]=yO,DO[1]=xO},sphere:function(){yO=-(xO=180),vO=-(_O=90)}};function SO(t,e){AO.push(DO=[yO=t,xO=t]),e_O&&(_O=e)}function CO(t,e){var n=Bg([t*gp,e*gp]);if(kO){var r=Ig(kO,n),i=Ig([r[1],-r[0],0],r);Wg(i),i=Pg(i);var o,a=t-OO,s=a>0?1:-1,u=i[0]*pp*s,l=mp(a)>180;l^(s*OO_O&&(_O=o):l^(s*OO<(u=(u+360)%360-180)&&u_O&&(_O=e)),l?tRO(yO,xO)&&(xO=t):RO(t,xO)>RO(yO,xO)&&(yO=t):xO>=yO?(txO&&(xO=t)):t>OO?RO(yO,t)>RO(yO,xO)&&(xO=t):RO(t,xO)>RO(yO,xO)&&(yO=t)}else AO.push(DO=[yO=t,xO=t]);e_O&&(_O=e),kO=n,OO=t}function FO(){MO.point=CO}function zO(){DO[0]=yO,DO[1]=xO,MO.point=SO,kO=null}function TO(t,e){if(kO){var n=t-OO;EO.add(mp(n)>180?n+(n>0?360:-360):n)}else wO=t,jO=e;hO.point(t,e),CO(t,e)}function $O(){hO.lineStart()}function NO(){TO(wO,jO),hO.lineEnd(),mp(EO)>1e-6&&(yO=-(xO=180)),DO[0]=yO,DO[1]=xO,kO=null}function RO(t,e){return(e-=t)<0?e+360:e}function PO(t,e){return t[0]-e[0]}function BO(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:ee.indexOf(t)>=0):e},R_union:function(t,e){var n=Object(Z.db)(e[0]),r=Object(Z.db)(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]r&&(n=e[1],r=e[0]),t.length?rr&&(t[1]=r),t):[n,r]}};function gw(t,e,n,r){"Literal"!==e[0].type&&Object(Z.o)("First argument to selection functions must be a string literal.");const i=e[0].value,o=":"+i;"intersect"!==(e.length>=2&&Object(Z.V)(e).value)||Object(Z.w)(r,"@unit")||(r["@unit"]=n.getData(i).indataRef(n,"unit")),Object(Z.w)(r,o)||(r[o]=n.getData(i).tuplesRef())}function mw(t){const e=this.context.data[t];return e?e.values.value:[]}const bw=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},yw=bw("format"),vw=bw("timeFormat"),xw=bw("utcFormat"),_w=bw("timeParse"),Ow=bw("utcParse"),ww=new Date(2e3,0,1);function jw(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(ww.setYear(2e3),ww.setMonth(t),ww.setDate(e),vw.call(this,ww,n)):""}function kw(t,e,n,r){"Literal"!==e[0].type&&Object(Z.o)("First argument to data functions must be a string literal.");const i=e[0].value,o=":"+i;if(!Object(Z.w)(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(t){}}function Ew(t,e,n,r){if("Literal"===e[0].type)Aw(n,r,e[0].value);else for(t in n.scales)Aw(n,r,t)}function Aw(t,e,n){const r="%"+n;if(!Object(Z.w)(e,r))try{e[r]=t.scaleRef(n)}catch(t){}}function Dw(t,e){let n;return Object(Z.E)(t)?t:Object(Z.I)(t)?(n=e.scales[t])&&n.value:void 0}function Mw(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,n._bandwidth=Ew,n._range=Ew,n._scale=Ew;const r=e=>"_["+("Literal"===e.type?Object(Z.ab)("%"+e.value):Object(Z.ab)("%")+"+"+t(e))+"]";return{_bandwidth:t=>"this.__bandwidth(".concat(r(t[0]),")"),_range:t=>"".concat(r(t[0]),".range()"),_scale:e=>"".concat(r(e[0]),"(").concat(t(e[1]),")")}}function Sw(t,e){return function(n,r,i){if(n){const e=Dw(n,(i||this).context);return e&&e.path[t](r)}return e(r)}}const Cw=Sw("area",(function(t){return dO=new lp,up(t,hO),2*dO})),Fw=Sw("bounds",(function(t){var e,n,r,i,o,a,s;if(_O=xO=-(yO=vO=1/0),AO=[],up(t,MO),n=AO.length){for(AO.sort(PO),e=1,o=[r=AO[0]];eRO(r[0],r[1])&&(r[1]=i[1]),RO(i[0],r[1])>RO(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(s=RO(r[1],i[0]))>a&&(a=s,yO=i[0],xO=r[1])}return AO=DO=null,yO===1/0||vO===1/0?[[NaN,NaN],[NaN,NaN]]:[[yO,vO],[xO,_O]]})),zw=Sw("centroid",(function(t){LO=IO=UO=qO=WO=YO=HO=GO=0,VO=new lp,XO=new lp,JO=new lp,up(t,nw);var e=+VO,n=+XO,r=+JO,i=Op(e,n,r);return i<1e-12&&(e=YO,n=HO,r=GO,IO<1e-6&&(e=UO,n=qO,r=WO),(i=Op(e,n,r))<1e-12)?[NaN,NaN]:[yp(n,e)*pp,Sp(r/i)*pp]}));function Tw(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}function $w(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Nw(t){const e=go(t);return.2126*$w(e.r)+.7152*$w(e.g)+.0722*$w(e.b)}function Rw(t,e){return t===e||t!=t&&e!=e||(Object(Z.B)(t)?!(!Object(Z.B)(e)||t.length!==e.length)&&function(t,e){for(let n=0,r=t.length;nPw(t,e)}const Lw=t=>t.data;function Iw(t,e){const n=mw.call(e,t);return n.root&&n.root.lookup||{}}const Uw=()=>"undefined"!=typeof window&&window||null;const qw={random:()=>ee(),cumulativeNormal:de,cumulativeLogNormal:ye,cumulativeUniform:je,densityNormal:fe,densityLogNormal:be,densityUniform:we,quantileNormal:he,quantileLogNormal:ve,quantileUniform:ke,sampleNormal:ce,sampleLogNormal:me,sampleUniform:Oe,isArray:Z.B,isBoolean:Z.C,isDate:Z.D,isDefined:t=>void 0!==t,isNumber:Z.F,isObject:Z.G,isRegExp:Z.H,isString:Z.I,isTuple:ot,isValid:t=>null!=t&&t==t,toBoolean:Z.bb,toDate:Z.cb,toNumber:Z.db,toString:Z.fb,flush:Z.v,lerp:Z.K,merge:function(){const t=[].slice.call(arguments);return t.unshift({}),Object(Z.p)(...t)},pad:Z.Q,peek:Z.V,span:Z.Y,inrange:Z.A,truncate:Z.gb,rgb:go,lab:ls,hcl:ms,hsl:Oo,luminance:Nw,contrast:function(t,e){const n=Nw(t),r=Nw(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:We,format:yw,utcFormat:xw,utcParse:Ow,utcOffset:He.w,utcSequence:He.x,timeFormat:vw,timeParse:_w,timeOffset:He.q,timeSequence:He.r,timeUnitSpecifier:He.s,monthFormat:function(t){return jw.call(this,t,1,"%B")},monthAbbrevFormat:function(t){return jw.call(this,t,1,"%b")},dayFormat:function(t){return jw.call(this,0,2+t,"%A")},dayAbbrevFormat:function(t){return jw.call(this,0,2+t,"%a")},quarter:Z.W,utcquarter:Z.ib,week:He.A,utcweek:He.z,dayofyear:He.m,utcdayofyear:He.y,warn:function(){return Tw(this.context.dataflow,"warn",arguments)},info:function(){return Tw(this.context.dataflow,"info",arguments)},debug:function(){return Tw(this.context.dataflow,"debug",arguments)},extent:Z.q,inScope:function(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:function(t,e,n){if(!t)return[];const[r,i]=t,o=(new El).set(r[0],r[1],i[0],i[1]);return $d(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=Object(Z.i)(t.marktype),r=Object(Z.i)(t.markname);e=t=>(!n.length||n.some(e=>t.marktype===e))&&(!r.length||r.some(e=>t.name===e))}return e}(e))},clampRange:Z.k,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){const t=Uw();return t?t.screen:{}},containerSize:function(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){const t=Uw();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return $s(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(Z.hb).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?Ju(n,e=e||Bu(t)):t}},panLinear:Z.R,panLog:Z.S,panPow:Z.T,panSymlog:Z.U,zoomLinear:Z.mb,zoomLog:Z.nb,zoomPow:Z.ob,zoomSymlog:Z.pb,encode:function(t,e,n){if(t){const n=this.context.dataflow,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,o){const a=this.context.dataflow,s=this.context.data[t],u=s.input,l=a.stamp();let c,f,d=s.changes;if(!1===a._trigger||!(u.value.length||e||r))return 0;if((!d||d.stamp{s.modified=!0,a.pulse(u,d).run()},!0,1)),n&&(c=!0===n?Z.hb:Object(Z.B)(n)||ot(n)?n:Bw(n),d.remove(c)),e&&d.insert(e),r&&(c=Bw(r),u.value.some(c)?d.remove(c):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1}},Ww=["view","item","group","xy","x","y"],Yw={},Hw={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_[".concat(Object(Z.ab)("$"+t),"]"),functions:function(t){const e=oO(t);Ww.forEach(t=>e[t]="event.vega."+t);for(const t in qw)e[t]="this."+t;return Object(Z.p)(e,Mw(t,qw,Yw)),e},constants:iO,visitors:Yw},Gw=function(t){const e=(t=t||{}).allowed?Object(Z.eb)(t.allowed):{},n=t.forbidden?Object(Z.eb)(t.forbidden):{},r=t.constants||iO,i=(t.functions||oO)(f),o=t.globalvar,a=t.fieldvar,s=Object(Z.E)(o)?o:t=>"".concat(o,'["').concat(t,'"]');let u={},l={},c=0;function f(t){if(Object(Z.I)(t))return t;const e=d[t.type];return null==e&&Object(Z.o)("Unsupported type: "+t.type),e(t)}const d={Literal:t=>t.raw,Identifier:t=>{const i=t.name;return c>0?i:Object(Z.w)(n,i)?Object(Z.o)("Illegal identifier: "+i):Object(Z.w)(r,i)?r[i]:Object(Z.w)(e,i)?i:(u[i]=1,s(i))},MemberExpression:t=>{const e=!t.computed,n=f(t.object);e&&(c+=1);const r=f(t.property);return n===a&&(l[function(t){const e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(r)]=1),e&&(c-=1),n+(e?"."+r:"["+r+"]")},CallExpression:t=>{"Identifier"!==t.callee.type&&Object(Z.o)("Illegal callee type: "+t.callee.type);const e=t.callee.name,n=t.arguments,r=Object(Z.w)(i,e)&&i[e];return r||Object(Z.o)("Unrecognized function: "+e),Object(Z.E)(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(f).join(",")+"]",BinaryExpression:t=>"("+f(t.left)+t.operator+f(t.right)+")",UnaryExpression:t=>"("+t.operator+f(t.argument)+")",ConditionalExpression:t=>"("+f(t.test)+"?"+f(t.consequent)+":"+f(t.alternate)+")",LogicalExpression:t=>"("+f(t.left)+t.operator+f(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(f).join(",")+"}",Property:t=>{c+=1;const e=f(t.key);return c-=1,e+":"+f(t.value)}};function h(t){const e={code:f(t),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},e}return h.functions=i,h.constants=r,h}(Hw);function Vw(t,e,n){return 1===arguments.length?qw[t]:(qw[t]=e,n&&(Yw[t]=n),Gw&&(Gw.functions[t]="this."+t),this)}function Xw(t,e){const n={};let r;try{r=rO(t=Object(Z.I)(t)?t:Object(Z.ab)(t)+"")}catch(e){Object(Z.o)("Expression parse error: "+t)}r.visit(t=>{if("CallExpression"!==t.type)return;const r=t.callee.name,i=Hw.visitors[r];i&&i(r,t.arguments,e,n)});const i=Gw(r);return i.globals.forEach(t=>{const r="$"+t;!Object(Z.w)(n,r)&&e.getSignal(t)&&(n[r]=e.signalRef(t))}),{$expr:Object(Z.p)({code:i.code},e.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}Vw("bandwidth",(function(t,e){const n=Dw(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),Ew),Vw("copy",(function(t,e){const n=Dw(t,(e||this).context);return n?n.copy():void 0}),Ew),Vw("domain",(function(t,e){const n=Dw(t,(e||this).context);return n?n.domain():[]}),Ew),Vw("range",(function(t,e){const n=Dw(t,(e||this).context);return n&&n.range?n.range():[]}),Ew),Vw("invert",(function(t,e,n){const r=Dw(t,(n||this).context);return r?Object(Z.B)(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0}),Ew),Vw("scale",(function(t,e,n){const r=Dw(t,(n||this).context);return r?r(e):void 0}),Ew),Vw("gradient",(function(t,e,n,r,i){t=Dw(t,(i||this).context);const o=Tu(e,n);let a=t.domain(),s=a[0],u=Object(Z.V)(a),l=Z.y;return u-s?l=ou(t,s,u):t=(t.interpolator?Hs("sequential")().interpolator(t.interpolator()):Hs("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,u=1]),t.ticks&&(a=t.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==Object(Z.V)(a)&&a.push(u)),a.forEach(e=>o.stop(l(e),t(e))),o}),Ew),Vw("geoArea",Cw,Ew),Vw("geoBounds",Fw,Ew),Vw("geoCentroid",zw,Ew),Vw("geoShape",(function(t,e,n){const r=Dw(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}),Ew),Vw("indata",(function(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(t,e,n,r){"Literal"!==e[0].type&&Object(Z.o)("First argument to indata must be a string literal."),"Literal"!==e[1].type&&Object(Z.o)("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,a="@"+o;Object(Z.w)(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),Vw("data",mw,kw),Vw("treePath",(function(t,e,n){const r=Iw(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(Lw):void 0}),kw),Vw("treeAncestors",(function(t,e){const n=Iw(t,this)[e];return n?n.ancestors().map(Lw):void 0}),kw),Vw("vlSelectionTest",(function(t,e,n){for(var r,i,o,a,s,u=this.context.data[t],l=u?u.values.value:[],c=u?u["index:unit"]&&u["index:unit"].value:void 0,f="intersect"===n,d=l.length,h=0;h(t[i[n].field]=e,t),{}))}return e=e||"union",Object.keys(m).forEach(t=>{m[t]=Object.keys(m[t]).map(e=>m[t][e]).reduce((n,r)=>void 0===n?r:pw[y[t]+"_"+e](n,r))}),g=Object.keys(b),n&&g.length&&(m.vlMulti="union"===e?{or:g.reduce((t,e)=>(t.push(...b[e]),t),[])}:{and:g.map(t=>({or:b[t]}))}),m}),gw);const Jw=Object(Z.eb)(["rule"]),Kw=Object(Z.eb)(["group","image","rect"]);function Zw(t){return(t+"").toLowerCase()}function Qw(t,e,n){";"!==n[n.length-1]&&(n="return("+n+");");const r=Function(...e.concat(n));return t&&t.functions?r.bind(t.functions):r}var tj={operator:(t,e)=>Qw(t,["_"],e.code),parameter:(t,e)=>Qw(t,["datum","_"],e.code),event:(t,e)=>Qw(t,["event"],e.code),handler:(t,e)=>Qw(t,["_","event"],"var datum=event.item&&event.item.datum;return ".concat(e.code,";")),encode:(t,e)=>{const{marktype:n,channels:r}=e;let i="var o=item,datum=o.datum,m=0,$;";for(const t in r){const e="o["+Object(Z.ab)(t)+"]";i+="$=".concat(r[t].code,";if(").concat(e,"!==$)").concat(e,"=$,m=1;")}return i+=function(t,e){let n="";return Jw[e]||(t.x2&&(t.x?(Kw[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(Kw[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),i+="return m;",Qw(t,["item","_"],i)},codegen:{get(t){const e="[".concat(t.map(Z.ab).join("]["),"]"),n=Function("_","return _".concat(e,";"));return n.path=e,n},comparator(t,e){let n;const r=Function("a","b","var u, v; return "+t.map((t,r)=>{const i=e[r];let o,a;return t.path?(o="a".concat(t.path),a="b".concat(t.path)):((n=n||{})["f"+r]=t,o="this.f".concat(r,"(a)"),a="this.f".concat(r,"(b)")),function(t,e,n,r){return"((u = ".concat(t,") < (v = ").concat(e,") || u == null) && v != null ? ").concat(n,"\n : (u > 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," : ")}(o,a,-i,i)}).join("")+"0;");return n?r.bind(n):r}}};function ej(t,e,n){if(!t||!Object(Z.G)(t))return t;for(let r,i=0,o=nj.length;it&&t.$tupleid?at:t);return e.fn[n]||(e.fn[n]=Object(Z.l)(r,t.$order,e.expr.codegen))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){const n=t.$subflow;return function(t,r,i){const o=e.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(i),a.detachSubflow=()=>e.detach(o),a}}},{key:"$tupleid",parse:function(){return at}}];const rj={skip:!0};function ij(t,e,n,r){return new oj(t,e,n,r)}function oj(t,e,n,r){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=r||tj,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function aj(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}oj.prototype=aj.prototype={fork(){const t=new aj(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter(e=>e!==t);const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,r=n.dataflow,i=t.value;if(n.set(t.id,e),"collect"===Zw(t.type)&&i&&(i.$ingest?r.ingest(e,i.$ingest,i.$format):i.$request?r.preload(e,i.$request,i.$format):r.pulse(e,r.changeset().insert(i))),t.root&&(n.root=e),t.parent){let i=n.get(t.parent.$ref);i?(r.connect(i,[e]),e.targets().add(i)):(n.unresolved=n.unresolved||[]).push(()=>{i=n.get(t.parent.$ref),r.connect(i,[e]),e.targets().add(i)})}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const r in t.data){const i=n.data[r]||(n.data[r]={});t.data[r].forEach(t=>i[t]=e)}},resolve(){return(this.unresolved||[]).forEach(t=>t()),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[Zw(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:function(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach(t=>e.parseOperator(t)),n.forEach(t=>e.parseOperatorParameters(t)),(t.streams||[]).forEach(t=>e.parseStream(t)),(t.updates||[]).forEach(t=>e.parseUpdate(t)),e.resolve()},parseOperator:function(t){const e=this;"operator"!==Zw(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?e.operatorExpression(t.update):null)},parseOperatorParameters:function(t){const e=this;if(t.params){const n=e.get(t.id);n||Object(Z.o)("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}},parseParameters:function(t,e){e=e||{};const n=this;for(const r in t){const i=t[r];e[r]=Object(Z.B)(i)?i.map(t=>ej(t,n,e)):ej(i,n,e)}return e},parseStream:function(t){var e,n=this,r=null!=t.filter?n.eventExpression(t.filter):void 0,i=null!=t.stream?n.get(t.stream):void 0;t.source?i=n.events(t.source,t.type,r):t.merge&&(i=(e=t.merge.map(t=>n.get(t)))[0].merge.apply(e[0],e.slice(1))),t.between&&(e=t.between.map(t=>n.get(t)),i=i.between(e[0],e[1])),t.filter&&(i=i.filter(r)),null!=t.throttle&&(i=i.throttle(+t.throttle)),null!=t.debounce&&(i=i.debounce(+t.debounce)),null==i&&Object(Z.o)("Invalid stream definition: "+JSON.stringify(t)),t.consume&&i.consume(!0),n.stream(t,i)},parseUpdate:function(t){var e,n=Object(Z.G)(n=t.source)?n.$ref:n,r=this.get(n),i=t.update,o=void 0;r||Object(Z.o)("Source not defined: "+t.source),e=t.target&&t.target.$expr?this.eventExpression(t.target.$expr):this.get(t.target),i&&i.$expr&&(i.$params&&(o=this.parseParameters(i.$params)),i=this.handlerExpression(i.$expr)),this.update(t,r,e,i,o)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach(n=>{const i=e.signals[n];t.signals(n,i)&&(r[n]=i.value)})}if(t.data){var i=n.data={};Object.keys(e.data).forEach(n=>{const r=e.data[n];t.data(n,r)&&(i[n]=r.input.value)})}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map(e=>e.getState(t))),n},setState:function(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach(t=>{n.update(e.signals[t],i[t],rj)}),Object.keys(r||{}).forEach(t=>{n.pulse(e.data[t].input,n.changeset().remove(Z.hb).insert(r[t]))}),(t.subcontext||[]).forEach((t,n)=>{const r=e.subcontext[n];r&&r.setState(t)})}};function sj(t,e){t&&(null==e?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}function uj(t,e){const n=t.globalCursor()?"undefined"!=typeof document&&document.body:t.container();if(n)return null==e?n.style.removeProperty("cursor"):n.style.cursor=e}function lj(t,e){var n=t._runtime.data;return Object(Z.w)(n,e)||Object(Z.o)("Unrecognized data set: "+e),n[e]}function cj(t,e){ht(e)||Object(Z.o)("Second argument to changes must be a changeset.");const n=lj(this,t);return n.modified=!0,this.pulse(n.input,e)}function fj(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function dj(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function hj(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function pj(t,e,n){var r,i,o=t._renderer,a=o&&o.canvas();return a&&(i=hj(t),(r=$f(e.changedTouches?e.changedTouches[0]:e,a))[0]-=i[0],r[1]-=i[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){const r=e?"group"===e.mark.marktype?e:e.mark.group:null;function i(t){var n,i=r;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(t){if(!t)return n;Object(Z.I)(t)&&(t=i(t));const e=n.slice();for(;t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}return{view:Object(Z.m)(t),item:Object(Z.m)(e||{}),group:i,xy:o,x:function(t){return o(t)[0]},y:function(t){return o(t)[1]}}}(t,n,r),e}const gj={trap:!1};function mj(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return!(!1===r||Object(Z.G)(r)&&!r[n])||(t.warn("Blocked ".concat(e," ").concat(n," event listener.")),!1)}function bj(t){return t.item}function yj(t){return t.item.mark.source}function vj(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function xj(t,e,n){const r=document.createElement(t);for(const t in e)r.setAttribute(t,e[t]);return null!=n&&(r.textContent=n),r}function _j(t,e,n){if(!e)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:e=>{e!==t.signal(r.signal)&&t.runAsync(null,()=>{i.source=!0,t.signal(r.signal,e)})}},r.debounce&&(i.update=Object(Z.n)(r.debounce,i.update))),function(t,e,n,r){const i=xj("div",{class:"vega-bind"}),o="radio"===n.input?i:i.appendChild(xj("label"));o.appendChild(xj("span",{class:"vega-bind-name"},n.name||n.signal)),e.appendChild(i);let a=Oj;switch(n.input){case"checkbox":a=wj;break;case"select":a=jj;break;case"radio":a=kj;break;case"range":a=Ej}a(t,o,n,r)}(i,e,r,t.signal(r.signal)),i.active||(t.on(t._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(t.signal(r.signal))}),i.active=!0),i}function Oj(t,e,n,r){const i=xj("input");for(const t in n)"signal"!==t&&"element"!==t&&i.setAttribute("input"===t?"type":t,n[t]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",()=>t.update(i.value)),t.elements=[i],t.set=t=>i.value=t}function wj(t,e,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=xj("input",i);e.appendChild(o),o.addEventListener("change",()=>t.update(o.checked)),t.elements=[o],t.set=t=>o.checked=!!t||null}function jj(t,e,n,r){const i=xj("select",{name:n.signal}),o=n.labels||[];n.options.forEach((t,e)=>{const n={value:t};Aj(t,r)&&(n.selected=!0),i.appendChild(xj("option",n,(o[e]||t)+""))}),e.appendChild(i),i.addEventListener("change",()=>{t.update(n.options[i.selectedIndex])}),t.elements=[i],t.set=t=>{for(let e=0,r=n.options.length;e{const s={type:"radio",name:n.signal,value:e};Aj(e,r)&&(s.checked=!0);const u=xj("input",s);u.addEventListener("change",()=>t.update(e));const l=xj("label",{},(o[a]||e)+"");return l.prepend(u),i.appendChild(l),u}),t.set=e=>{const n=t.elements,r=n.length;for(let t=0;t{u.textContent=s.value,t.update(+s.value)};s.addEventListener("input",l),s.addEventListener("change",l),t.elements=[s],t.set=t=>{s.value=t,u.textContent=t}}function Aj(t,e){return t===e||t+""==e+""}function Dj(t,e,n,r,i,o){return(e=e||new r(t.loader())).initialize(n,fj(t),dj(t),hj(t),i,o).background(t.background())}function Mj(t,e){return e?function(){try{e.apply(this,arguments)}catch(e){t.error(e)}}:null}function Sj(t,e){if("string"==typeof e){if("undefined"==typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e)try{e.innerHTML=""}catch(n){e=null,t.error(n)}return e}const Cj=t=>+t||0;function Fj(t){return Object(Z.G)(t)?{top:Cj(t.top),bottom:Cj(t.bottom),left:Cj(t.left),right:Cj(t.right)}:(t=>({top:t,bottom:t,left:t,right:t}))(Cj(t))}async function zj(t,e,n,r){const i=Td(e),o=i&&i.headless;return o||Object(Z.o)("Unrecognized renderer type: "+e),await t.runAsync(),Dj(t,null,null,o,n,r).renderAsync(t._scenegraph.root)}var Tj={skip:!0};function $j(t,e){var n=t.autosize(),r=t.padding();return e-(n&&"padding"===n.contains?r.left+r.right:0)}function Nj(t,e){var n=t.autosize(),r=t.padding();return e-(n&&"padding"===n.contains?r.top+r.bottom:0)}function Rj(t,e){return e.modified&&Object(Z.B)(e.input.value)&&t.indexOf("_:vega:_")}function Pj(t,e){return!("parent"===t||e instanceof Bt.proxy)}function Bj(t,e,n,r){const i=t.element();i&&i.setAttribute("title",function(t){return null==t?"":Object(Z.B)(t)?Lj(t):Object(Z.G)(t)&&!Object(Z.D)(t)?(e=t,Object.keys(e).map(t=>{const n=e[t];return t+": "+(Object(Z.B)(n)?Lj(n):Ij(n))}).join("\n")):t+"";var e}(r))}function Lj(t){return"["+t.map(Ij).join(", ")+"]"}function Ij(t){return Object(Z.B)(t)?"[…]":Object(Z.G)(t)&&!Object(Z.D)(t)?"{…}":t}function Uj(t,e){const n=this;if(e=e||{},Nt.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),null!=e.logLevel&&n.logLevel(e.logLevel),e.locale||t.locale){const r=Object(Z.p)({},t.locale,e.locale);n.locale(Object(tt.b)(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||Fd.Canvas,n._scenegraph=new Df;const r=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||Bj,n._redraw=!0,n._handler=(new Vf).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(t){const e=Object(Z.p)({defaults:{}},t),n=(t,e)=>{e.forEach(e=>{Object(Z.B)(t[e])&&(t[e]=Object(Z.eb)(t[e]))})};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=function(t,e,n){return ij(t,Bt,qw,n).parse(e)}(n,t,e.expr);n._runtime=i,n._signals=i.signals,n._bind=(t.bindings||[]).map(t=>({state:null,param:Object(Z.p)({},t)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=$j(n,n._width),n._viewHeight=Nj(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(t){var e=t._signals,n=e.width,r=e.height,i=e.padding;function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,e=>{t._width=e.size,t._viewWidth=$j(t,e.size),o()},{size:n}),t._resizeHeight=t.add(null,e=>{t._height=e.size,t._viewHeight=Nj(t,e.size),o()},{size:r});const a=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(n),function(t){t.add(null,e=>(t._background=e.bg,t._resize=1,e.bg),{bg:t._signals.background})}(n),function(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:"default",item:null}));t.on(t.events("view","mousemove"),e,(t,n)=>{const r=e.value,i=r?Object(Z.I)(r)?r:r.user:"default",o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}}),t.add(null,(function(e){let n=e.cursor,r=this.value;return Object(Z.I)(n)||(r=n.item,n=n.user),uj(t,n&&"default"!==n?n:r||n),r}),{cursor:e})}(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind)}function qj(t,e){return Object(Z.w)(t._signals,e)?t._signals[e]:Object(Z.o)("Unrecognized signal name: "+Object(Z.ab)(e))}function Wj(t,e){const n=(t._targets||[]).filter(t=>t._update&&t._update.handler===e);return n.length?n[0]:null}function Yj(t,e,n,r){let i=Wj(n,r);return i||(i=Mj(t,()=>r(e,n.value)),i.handler=r,t.on(n,null,i)),t}function Hj(t,e,n){const r=Wj(e,n);return r&&e._targets.remove(r),t}Object(Z.z)(Uj,Nt,{async evaluate(t,e,n){if(await Nt.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,i=hj(r=this),o=fj(r),a=dj(r),r._renderer.background(r.background()),r._renderer.resize(o,a,i),r._handler.origin(i),r._resizeListeners.forEach(t=>{try{t(o,a)}catch(t){r.error(t)}})),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(t){this.error(t)}var r,i,o,a;return n&&nt(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=null!=t?t+"":null;return e!==this._desc&&sj(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const r=qj(this,t);return 1===arguments.length?r.value:this.update(r,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",Fj(t)):Fj(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(Td(t)||Object(Z.o)("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(Nt.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(qj(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(t,e,n,r,i,o){this.runAfter(a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal("width",n,Tj),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal("height",r,Tj),a._resizeHeight.skip(!0)),a._viewWidth!==t&&(a._resize=1,a._viewWidth=t),a._viewHeight!==e&&(a._resize=1,a._viewHeight=e),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter(t=>t.resize())},!1,1)},addEventListener(t,e,n){let r=e;return n&&!1===n.trap||(r=Mj(this,e),r.raw=e),this._handler.on(t,r),this},removeEventListener(t,e){for(var n,r,i=this._handler.handlers(t),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,t===r&&(e===n||e===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return Yj(this,t,qj(this,t),e)},removeSignalListener(t,e){return Hj(this,qj(this,t),e)},addDataListener(t,e){return Yj(this,t,lj(this,t).values,e)},removeDataListener(t,e){return Hj(this,lj(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=uj(this,null);this._globalCursor=!!t,e&&uj(this,e)}return this}return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:function(t,e){this._timers.push(function(t,e,n){var r=new py,i=e;return null==e?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(t,e,n){e=+e,n=null==n?dy():+n,r._restart((function o(a){a+=i,r._restart(o,i+=e,n),t(a)}),e,n)},r.restart(t,e,n),r)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},events:function(t,e,n){var r,i=this,o=new _t(n),a=function(n,r){i.runAsync(null,()=>{"view"===t&&function(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[e]:i?!i[e]:t.preventDefault()))}(i,e)&&n.preventDefault(),o.receive(pj(i,n,r))})};if("timer"===t)mj(i,"timer",e)&&i.timer(a,e);else if("view"===t)mj(i,"view",e)&&i.addEventListener(e,a,gj);else if("window"===t?mj(i,"window",e)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&mj(i,"selector",e)&&(r=document.querySelectorAll(t)),r){for(var s=0,u=r.length;s=0;)i[t].stop();for(t=o.length;--t>=0;)for(e=(n=o[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},hover:function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",bj),yj,vj(t)),this.on(this.events("view","mouseout",bj),yj,vj(e)),this},data:function(t,e){return arguments.length<2?lj(this,t).values.value:cj.call(this,t,pt().remove(Z.hb).insert(e))},change:cj,insert:function(t,e){return cj.call(this,t,pt().insert(e))},remove:function(t,e){return cj.call(this,t,pt().remove(e))},scale:function(t){var e=this._runtime.scales;return Object(Z.w)(e,t)||Object(Z.o)("Unrecognized scale or projection: "+t),e[t].value},initialize:function(t,e){const n=this,r=n._renderType,i=n._eventConfig.bind,o=Td(r);t=n._el=t?Sj(n,t):null,function(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),sj(e,t.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||Vf,s=t?o.renderer:o.headless;return n._renderer=s?Dj(n,n._renderer,t,s):null,n._handler=function(t,e,n,r){const i=new r(t.loader(),Mj(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,hj(t),t);return e&&e.handlers().forEach(t=>{i.on(t.type,t.handler)}),i}(n,n._handler,t,a),n._redraw=!0,t&&"none"!==i&&(e=e?n._elBind=Sj(n,e):t.appendChild(xj("form",{class:"vega-bindings"})),n._bind.forEach(t=>{t.param.element&&"container"!==i&&(t.element=Sj(n,t.param.element))}),n._bind.forEach(t=>{_j(n,t.element||e,t)})),n},toImageURL:async function(t,e){t!==Fd.Canvas&&t!==Fd.SVG&&t!==Fd.PNG&&Object(Z.o)("Unrecognized image type: "+t);const n=await zj(this,t,e);return t===Fd.SVG?function(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(t,e){return(await zj(this,Fd.Canvas,t,e)).canvas()},toSVG:async function(t){return(await zj(this,Fd.SVG,t)).svg()},getState:function(t){return this._runtime.getState(t||{data:Rj,signals:Pj,recurse:!0})},setState:function(t){return this.runAsync(null,e=>{e._trigger=!1,e._runtime.setState(t)},t=>{t._trigger=!0}),this}});const Gj=/[[\]{}]/,Vj={"*":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};let Xj,Jj;function Kj(t,e,n){return Xj=e||"view",Jj=n||Vj,Qj(t.trim()).map(tk)}function Zj(t,e,n,r,i){const o=t.length;let a,s=0;for(;e=0?--s:r&&r.indexOf(a)>=0&&++s}return e}function Qj(t){const e=[],n=t.length;let r=0,i=0;for(;i"!==(t=t.slice(r+1).trim())[0])throw"Expected '>' after between selector: "+t;n=n.map(tk);const i=tk(t.slice(1).trim());if(i.between)return{between:n,stream:i};i.between=n;return i}(t):function(t){const e={source:Xj},n=[];let r,i,o=[0,0],a=0,s=0,u=t.length,l=0;if("}"===t[u-1]){if(l=t.lastIndexOf("{"),!(l>=0))throw"Unmatched right brace: "+t;try{o=function(t){const e=t.split(",");if(!t.length||e.length>2)throw t;return e.map(e=>{const n=+e;if(n!=n)throw t;return n})}(t.substring(l+1,u-1))}catch(e){throw"Invalid throttle specification: "+t}t=t.slice(0,l).trim(),u=t.length,l=0}if(!u)throw t;"@"===t[0]&&(a=++l);r=Zj(t,l,":"),r1?(e.type=n[1],a?e.markname=n[0].slice(1):(c=n[0],Jj[c]?e.marktype=n[0]:e.source=n[0])):e.type=n[0];var c;"!"===e.type.slice(-1)&&(e.consume=!0,e.type=e.type.slice(0,-1));null!=i&&(e.filter=i);o[0]&&(e.throttle=o[0]);o[1]&&(e.debounce=o[1]);return e}(t)}function ek(t){return Object(Z.G)(t)?t:{type:t||"pad"}}const nk=t=>+t||0;function rk(t){return Object(Z.G)(t)?t.signal?t:{top:nk(t.top),bottom:nk(t.bottom),left:nk(t.left),right:nk(t.right)}:{top:e=nk(t),bottom:e,left:e,right:e};var e}const ik=t=>Object(Z.G)(t)&&!Object(Z.B)(t)?Object(Z.p)({},t):{value:t};function ok(t,e,n,r){if(null!=n){return Object(Z.G)(n)&&!Object(Z.B)(n)||Object(Z.B)(n)&&n.length&&Object(Z.G)(n[0])?t.update[e]=n:t[r||"enter"][e]={value:n},1}return 0}function ak(t,e,n){for(const n in e)ok(t,n,e[n]);for(const e in n)ok(t,e,n[e],"update")}function sk(t,e,n){for(const r in e)n&&Object(Z.w)(n,r)||(t[r]=Object(Z.p)(t[r]||{},e[r]));return t}function uk(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}function lk(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const ck=t=>Object(Z.I)(t)?Object(Z.ab)(t):t.signal?"(".concat(t.signal,")"):pk(t);function fk(t){if(null!=t.gradient)return function(t){const e=[t.start,t.stop,t.count].map(t=>null==t?null:Object(Z.ab)(t));for(;e.length&&null==Object(Z.V)(e);)e.pop();return e.unshift(ck(t.gradient)),"gradient(".concat(e.join(","),")")}(t);let e=t.signal?"(".concat(t.signal,")"):t.color?function(t){return t.c?dk("hcl",t.h,t.c,t.l):t.h||t.s?dk("hsl",t.h,t.s,t.l):t.l||t.a?dk("lab",t.l,t.a,t.b):t.r||t.g||t.b?dk("rgb",t.r,t.g,t.b):null}(t.color):null!=t.field?pk(t.field):void 0!==t.value?Object(Z.ab)(t.value):void 0;return null!=t.scale&&(e=function(t,e){const n=ck(t.scale);null!=t.range?e="lerp(_range(".concat(n,"), ").concat(+t.range,")"):(void 0!==e&&(e="_scale(".concat(n,", ").concat(e,")")),t.band&&(e=(e?e+"+":"")+"_bandwidth(".concat(n,")")+(1==+t.band?"":"*"+hk(t.band)),t.extra&&(e="(datum.extra ? _scale(".concat(n,", datum.extra.value) : ").concat(e,")"))),null==e&&(e="0"));return e}(t,e)),void 0===e&&(e=null),null!=t.exponent&&(e="pow(".concat(e,",").concat(hk(t.exponent),")")),null!=t.mult&&(e+="*".concat(hk(t.mult))),null!=t.offset&&(e+="+".concat(hk(t.offset))),t.round&&(e="round(".concat(e,")")),e}const dk=(t,e,n,r)=>"(".concat(t,"(").concat([e,n,r].map(fk).join(","),")+'')");function hk(t){return Object(Z.G)(t)?"("+fk(t)+")":t}function pk(t){return function t(e){let n,r,i;if(e.signal)n="datum",i=e.signal;else if(e.group||e.parent){for(r=Math.max(1,e.level||1),n="item";r-- >0;)n+=".mark.group";e.parent?(i=e.parent,n+=".datum"):i=e.group}else e.datum?(n="datum",i=e.datum):Object(Z.o)("Invalid field reference: "+Object(Z.ab)(e));e.signal||(i=Object(Z.I)(i)?Object(Z.Z)(i).map(Z.ab).join("]["):t(i));return n+"["+i+"]"}(Object(Z.G)(t)?t:{datum:t})}function gk(t,e,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},t=function(t,e,n,r,i){const o={},a={};let s,u,l,c;for(u in u="lineBreak","text"!==e||null==i[u]||uk(u,t)||lk(o,u,i[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c="frame"===n?i.group:"mark"===n?Object(Z.p)({},i.mark,i[e]):null,c)l=uk(u,t)||("fill"===u||"stroke"===u)&&(uk("fill",t)||uk("stroke",t)),l||lk(o,u,c[u]);for(u in Object(Z.i)(r).forEach(e=>{const n=i.style&&i.style[e];for(const e in n)uk(e,t)||lk(o,e,n[e])}),t=Object(Z.p)({},t),o)c=o[u],c.signal?(s=s||{})[u]=c:a[u]=c;return t.enter=Object(Z.p)(a,t.enter),s&&(t.update=Object(Z.p)(s,t.update)),t}(t,e,n,r,i.config);for(const n in t)a[n]=mk(t[n],e,o,i);return o}function mk(t,e,n,r){const i={},o={};for(const e in t)null!=t[e]&&(i[e]=bk((a=t[e],Object(Z.B)(a)?function(t){let e="";return t.forEach(t=>{const n=fk(t);e+=t.test?"(".concat(t.test,")?").concat(n,":"):n}),":"===Object(Z.V)(e)&&(e+="null"),e}(a):fk(a)),r,n,o));var a;return{$expr:{marktype:e,channels:i},$fields:Object.keys(o),$output:Object.keys(t)}}function bk(t,e,n,r){const i=Xw(t,e);return i.$fields.forEach(t=>r[t]=1),Object(Z.p)(n,i.$params),i.$expr}const yk=["value","update","init","react","bind"];function vk(t,e){Object(Z.o)(t+' for "outer" push: '+Object(Z.ab)(e))}function xk(t,e){const n=t.name;if("outer"===t.push)e.signals[n]||vk("No prior signal definition",n),yk.forEach(e=>{void 0!==t[e]&&vk("Invalid property ",e)});else{const r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function _k(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function Ok(t,e,n,r){return new _k(t,e,n,r)}function wk(t,e){return Ok("operator",t,e)}function jk(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function kk(t,e){return e?{$field:t,$name:e}:{$field:t}}const Ek=kk("key");function Ak(t,e){return{$compare:t,$order:e}}function Dk(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}function Mk(t){return t&&t.signal}function Sk(t){if(Mk(t))return!0;if(Object(Z.G)(t))for(const e in t)if(Sk(t[e]))return!0;return!1}function Ck(t,e){return null!=t?t:e}function Fk(t){return t&&t.signal||t}function zk(t,e){return(t.merge?Tk:t.stream?$k:t.type?Nk:Object(Z.o)("Invalid stream specification: "+Object(Z.ab)(t)))(t,e)}function Tk(t,e){const n=Rk({merge:t.merge.map(t=>zk(t,e))},t,e);return e.addStream(n).id}function $k(t,e){const n=Rk({stream:zk(t.stream,e)},t,e);return e.addStream(n).id}function Nk(t,e){let n;var r;"timer"===t.type?(n=e.event("timer",t.throttle),t={between:t.between,filter:t.filter}):n=e.event("scope"===(r=t.source)?"view":r||"view",t.type);const i=Rk({stream:n},t,e);return 1===Object.keys(i).length?n:e.addStream(i).id}function Rk(t,e,n){let r=e.between;return r&&(2!==r.length&&Object(Z.o)('Stream "between" parameter must have 2 entries: '+Object(Z.ab)(e)),t.between=[zk(r[0],n),zk(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(function(t,e,n){const r="event.item";return r+(t&&"*"!==t?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),"scope"===e.source&&r.push("inScope(event.item)"),r.length&&(t.filter=Xw("("+r.join(")&&(")+")",n).$expr),null!=(r=e.throttle)&&(t.throttle=+r),null!=(r=e.debounce)&&(t.debounce=+r),e.consume&&(t.consume=!0),t}const Pk={code:"_.$value",ast:{type:"Identifier",value:"value"}};function Bk(t,e,n){const r=t.encode,i={target:n};let o=t.events,a=t.update,s=[];o||Object(Z.o)("Signal update missing events specification."),Object(Z.I)(o)&&(o=Kj(o,e.isSubscope()?"scope":"view")),o=Object(Z.i)(o).filter(t=>t.signal||t.scale?(s.push(t),0):1),s.length>1&&(s=[Lk(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&Object(Z.o)("Signal encode and update are mutually exclusive."),a="encode(item(),"+Object(Z.ab)(r)+")"),i.update=Object(Z.I)(a)?Xw(a,e):null!=a.expr?Xw(a.expr,e):null!=a.value?a.value:null!=a.signal?{$expr:Pk,$params:{$value:e.signalRef(a.signal)}}:Object(Z.o)("Invalid signal update specification."),t.force&&(i.options={force:!0}),s.forEach(t=>e.addUpdate(Object(Z.p)(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):zk(t,e)}}(t,e),i)))}function Lk(t){return{signal:"["+t.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}const Ik=t=>(e,n,r)=>Ok(t,n,e||void 0,r),Uk=Ik("aggregate"),qk=Ik("axisticks"),Wk=Ik("bound"),Yk=Ik("collect"),Hk=Ik("compare"),Gk=Ik("datajoin"),Vk=Ik("encode"),Xk=Ik("expression"),Jk=Ik("facet"),Kk=Ik("field"),Zk=Ik("key"),Qk=Ik("legendentries"),tE=Ik("load"),eE=Ik("mark"),nE=Ik("multiextent"),rE=Ik("multivalues"),iE=Ik("overlap"),oE=Ik("params"),aE=Ik("prefacet"),sE=Ik("projection"),uE=Ik("proxy"),lE=Ik("relay"),cE=Ik("render"),fE=Ik("scale"),dE=Ik("sieve"),hE=Ik("sortitems"),pE=Ik("viewlayout"),gE=Ik("values");let mE=0;const bE={min:"min",max:"max",count:"sum"};function yE(t,e){const n=e.getScale(t.name).params;let r;var i;for(r in n.domain=OE(t.domain,t,e),null!=t.range&&(n.range=function t(e,n,r){const i=n.config.range;let o=e.range;if(o.signal)return n.signalRef(o.signal);if(Object(Z.I)(o)){if(i&&Object(Z.w)(i,o))return e=Object(Z.p)({},e,{range:i[o]}),t(e,n,r);"width"===o?o=[0,{signal:"width"}]:"height"===o?o=Js(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Object(Z.o)("Unrecognized scale range value: "+Object(Z.ab)(o))}else{if(o.scheme)return r.scheme=Object(Z.B)(o.scheme)?xE(o.scheme,n):vE(o.scheme,n),o.extent&&(r.schemeExtent=xE(o.extent,n)),void(o.count&&(r.schemeCount=vE(o.count,n)));if(o.step)return void(r.rangeStep=vE(o.step,n));if(Js(e.type)&&!Object(Z.B)(o))return OE(o,e,n);Object(Z.B)(o)||Object(Z.o)("Unsupported range type: "+Object(Z.ab)(o))}return o.map(t=>(Object(Z.B)(t)?xE:vE)(t,n))}(t,e,n)),null!=t.interpolate&&function(t,e){e.interpolate=vE(t.type||t),null!=t.gamma&&(e.interpolateGamma=vE(t.gamma))}(t.interpolate,n),null!=t.nice&&(n.nice=(i=t.nice,Object(Z.G)(i)?{interval:vE(i.interval),step:vE(i.step)}:vE(i))),null!=t.bins&&(n.bins=function(t,e){return t.signal||Object(Z.B)(t)?xE(t,e):e.objectProperty(t)}(t.bins,e)),t)Object(Z.w)(n,r)||"name"===r||(n[r]=vE(t[r],e))}function vE(t,e){return Object(Z.G)(t)?t.signal?e.signalRef(t.signal):Object(Z.o)("Unsupported object: "+Object(Z.ab)(t)):t}function xE(t,e){return t.signal?e.signalRef(t.signal):t.map(t=>vE(t,e))}function _E(t){Object(Z.o)("Can not find data set: "+Object(Z.ab)(t))}function OE(t,e,n){if(t)return t.signal?n.signalRef(t.signal):(Object(Z.B)(t)?wE:t.fields?kE:jE)(t,e,n);null==e.domainMin&&null==e.domainMax||Object(Z.o)("No scale domain defined for domainMin/domainMax to override.")}function wE(t,e,n){return t.map(t=>vE(t,n))}function jE(t,e,n){const r=n.getData(t.data);return r||_E(t.data),Js(e.type)?r.valuesRef(n,t.field,AE(t.sort,!1)):tu(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function kE(t,e,n){const r=t.data,i=t.fields.reduce((t,e)=>(e=Object(Z.I)(e)?{data:r,field:e}:Object(Z.B)(e)||e.signal?function(t,e){const n="_:vega:_"+mE++,r=Yk({});if(Object(Z.B)(t))r.value={$ingest:t};else if(t.signal){const i="setdata("+Object(Z.ab)(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,dE({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t),[]);return(Js(e.type)?EE:tu(e.type)?DE:ME)(t,n,i)}function EE(t,e,n){const r=AE(t.sort,!0);let i,o;const a=n.map(t=>{const n=e.getData(t.data);return n||_E(t.data),n.countsRef(e,t.field,r)}),s={groupby:Ek,pulse:a};r&&(i=r.op||"count",o=r.field?Dk(i,r.field):"count",s.ops=[bE[i]],s.fields=[e.fieldRef(o)],s.as=[o]),i=e.add(Uk(s));const u=e.add(Yk({pulse:jk(i)}));return o=e.add(gE({field:Ek,sort:e.sortRef(r),pulse:jk(u)})),jk(o)}function AE(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!bE[t.op]&&Object(Z.o)("Multiple domain scales can not be sorted using "+t.op):Object(Z.o)("No field provided for sort aggregate op: "+t.op):Object(Z.G)(t)?t.field="key":t={field:"key"}),t}function DE(t,e,n){const r=n.map(t=>{const n=e.getData(t.data);return n||_E(t.data),n.domainRef(e,t.field)});return jk(e.add(rE({values:r})))}function ME(t,e,n){const r=n.map(t=>{const n=e.getData(t.data);return n||_E(t.data),n.extentRef(e,t.field)});return jk(e.add(nE({extents:r})))}function SE(t,e,n){return Object(Z.B)(t)?t.map(t=>SE(t,e,n)):Object(Z.G)(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:Object(Z.o)("Unsupported parameter object: "+Object(Z.ab)(t)):t}const CE="value",FE=["size","shape","fill","stroke","strokeWidth","strokeDash","opacity"],zE={name:1,style:1,interactive:1},TE={value:0},$E={value:1};function NE(t){return t.type="group",t.interactive=t.interactive||!1,t}function RE(t,e){const n=(n,r)=>Ck(t[n],Ck(e[n],r));return n.isVertical=n=>"vertical"===Ck(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>Ck(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>Ck(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>Ck(t.columns,Ck(e.columns,+n.isVertical(!0))),n}function PE(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function BE(t,e,n){return"item.anchor === '".concat("start","' ? ").concat(t," : item.anchor === '").concat("end","' ? ").concat(e," : ").concat(n)}const LE=BE(Object(Z.ab)("left"),Object(Z.ab)("right"),Object(Z.ab)("center"));function IE(t,e){return e?t?Object(Z.G)(t)?Object.assign({},t,{offset:IE(t.offset,e)}):{value:t,offset:e}:e:t}function UE(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=sk(t.encode,e,zE)):t.interactive=!1,t}function qE(t,e,n,r){const i=RE(t,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let u,l,c,f,d;o?(l=[0,1],c=[0,0],f=a,d=s):(l=[0,0],c=[1,0],f=s,d=a);const h={enter:u={opacity:TE,x:TE,y:TE,width:ik(f),height:ik(d)},update:Object(Z.p)({},u,{opacity:$E,fill:{gradient:e,start:l,stop:c}}),exit:{opacity:TE}};return ak(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),UE({type:"rect",role:"legend-gradient",encode:h},r)}function WE(t,e,n,r,i){const o=RE(t,n),a=o.isVertical(),s=o.gradientThickness(),u=o.gradientLength();let l,c,f,d,h="";a?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:TE,fill:{scale:e,field:CE}};p[l]={signal:h+"datum.perc",mult:u},p[c]=TE,p[f]={signal:h+"datum.perc2",mult:u},p[d]=ik(s);const g={enter:p,update:Object(Z.p)({},p,{opacity:$E}),exit:{opacity:TE}};return ak(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),UE({type:"rect",role:"legend-band",key:CE,from:i,encode:g},r)}const YE="datum.".concat("perc",'<=0?"').concat("left",'":datum.').concat("perc",'>=1?"').concat("right",'":"').concat("center",'"'),HE="datum.".concat("perc",'<=0?"').concat("bottom",'":datum.').concat("perc",'>=1?"').concat("top",'":"').concat("middle",'"');function GE(t,e,n,r){const i=RE(t,e),o=i.isVertical(),a=ik(i.gradientThickness()),s=i.gradientLength();let u,l,c,f,d=i("labelOverlap"),h="";const p={enter:u={opacity:TE},update:l={opacity:$E,text:{field:"label"}},exit:{opacity:TE}};return ak(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:Ck(t.labelLimit,e.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=l.baseline={signal:HE},c="y",f="x",h="1-"):(u.align=l.align={signal:YE},u.baseline={value:"top"},c="x",f="y"),u[c]=l[c]={signal:h+"datum.perc",mult:s},u[f]=l[f]=a,a.offset=Ck(t.labelOffset,e.gradientLabelOffset)||0,d=d?{separation:i("labelSeparation"),method:d,order:"datum.index"}:void 0,UE({type:"text",role:"legend-label",style:"guide-label",key:CE,from:r,encode:p,overlap:d},n)}function VE(t,e,n,r,i){const o=RE(t,e),a=n.entries,s=!(!a||!a.interactive),u=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d="(".concat(i,") ? datum.").concat("offset"," : datum.").concat("size"),h=l?ik(l):{field:"size"},p="datum.".concat("index"),g="max(1, ".concat(i,")");let m,b,y,v,x;h.mult=.5,m={enter:b={opacity:TE,x:{signal:d,mult:.5,offset:c},y:h},update:y={opacity:$E,x:b.x,y:b.y},exit:{opacity:TE}};let _=null,O=null;t.fill||(_=e.symbolBaseFillColor,O=e.symbolBaseStrokeColor),ak(m,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",O),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),FE.forEach(e=>{t[e]&&(y[e]=b[e]={scale:t[e],field:CE})});const w=UE({type:"symbol",role:"legend-symbol",key:CE,from:f,clip:!!l||void 0,encode:m},n.symbols),j=ik(c);j.offset=o("labelOffset"),m={enter:b={opacity:TE,x:{signal:d,offset:j},y:h},update:y={opacity:$E,text:{field:"label"},x:b.x,y:b.y},exit:{opacity:TE}},ak(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const k=UE({type:"text",role:"legend-label",style:"guide-label",key:CE,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:TE,height:l?ik(l):TE,opacity:TE},exit:{opacity:TE},update:y={opacity:$E,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(v="ceil(item.mark.items.length / ".concat(g,")"),y.row.signal="".concat(p,"%").concat(v),y.column.signal="floor(".concat(p," / ").concat(v,")"),x={field:["row",p]}):(y.row.signal="floor(".concat(p," / ").concat(g,")"),y.column.signal="".concat(p," % ").concat(g),x={field:p}),y.column.signal="(".concat(i,")?").concat(y.column.signal,":").concat(p),NE({role:"scope",from:r={facet:{data:r,name:"value",groupby:"index"}},encode:sk(m,a,zE),marks:[w,k],name:u,interactive:s,sort:x})}const XE='item.orient === "left"',JE='item.orient === "right"',KE="(".concat(XE," || ").concat(JE,")"),ZE="datum.vgrad && ".concat(KE),QE=BE('"top"','"bottom"','"middle"'),tA=BE('"right"','"left"','"center"'),eA="datum.vgrad && ".concat(JE," ? (").concat(tA,") : (").concat(KE," && !(datum.vgrad && ").concat(XE,')) ? "left" : ').concat(LE),nA="item._anchor || (".concat(KE,' ? "middle" : "start")'),rA="".concat(ZE," ? (").concat(XE," ? -90 : 90) : 0"),iA="".concat(KE," ? (datum.vgrad ? (").concat(JE,' ? "bottom" : "top") : ').concat(QE,') : "top"');function oA(t,e){let n;return Object(Z.G)(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+aA(t.path)+")":t.sphere&&(n="geoShape("+aA(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function aA(t){return Object(Z.G)(t)&&t.signal?t.signal:Object(Z.ab)(t)}function sA(t){const e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?"group"===t.type?"scope":e||"mark":e}function uA(t){return{marktype:t.type,name:t.name||void 0,role:t.role||sA(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function lA(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t}function cA(t,e){const n=Lt(t.type);n||Object(Z.o)("Unrecognized transform type: "+Object(Z.ab)(t.type));const r=Ok(n.type.toLowerCase(),null,fA(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function fA(t,e,n){const r={},i=t.params.length;for(let o=0;opA(t,e,n))):pA(t,r,n)}(t,e,n):"projection"===r?n.projectionRef(e[t.name]):t.array&&!Mk(i)?i.map(e=>hA(t,e,n)):hA(t,i,n):void(t.required&&Object(Z.o)("Missing required "+Object(Z.ab)(e.type)+" parameter: "+Object(Z.ab)(t.name)))}function hA(t,e,n){const r=t.type;if(Mk(e))return yA(r)?Object(Z.o)("Expression references can not be signals."):vA(r)?n.fieldRef(e):xA(r)?n.compareRef(e):n.signalRef(e.signal);{const i=t.expr||vA(r);return i&&gA(e)?n.exprRef(e.expr,e.as):i&&mA(e)?kk(e.field,e.as):yA(r)?Xw(e,n):bA(r)?jk(n.getData(e).values):vA(r)?kk(e):xA(r)?n.compareRef(e):e}}function pA(t,e,n){const r=t.params.length;let i;for(let n=0;nt&&t.expr,mA=t=>t&&t.field,bA=t=>"data"===t,yA=t=>"expr"===t,vA=t=>"field"===t,xA=t=>"compare"===t;function _A(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:jk(e.getData(t.data).output)}function OA(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}function wA(t){return Object(Z.I)(t)?t:null}function jA(t,e,n){const r=Dk(n.op,n.field);let i;if(e.ops){for(let t=0,n=e.as.length;tnull==t?"null":t).join(",")+"),0)",e);u.update=l.$expr,u.params=l.$params}function AA(t,e){const n=sA(t),r="group"===t.type,i=t.from&&t.from.facet,o=t.overlap;let a,s,u,l,c,f,d,h=t.layout||"scope"===n||"frame"===n;const p="mark"===n||h||i,g=function(t,e,n){let r,i,o,a,s;return t?(r=t.facet)&&(e||Object(Z.o)("Only group marks can be faceted."),null!=r.field?a=s=_A(r,n):(t.data?s=jk(n.getData(t.data).aggregate):(o=cA(Object(Z.p)({type:"aggregate",groupby:Object(Z.i)(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=_A(r,n),a=s=jk(n.add(o))),i=n.keyRef(r.groupby,!0))):a=jk(n.add(Yk(null,[{}]))),a||(a=_A(t,n)),{key:i,pulse:a,parent:s}}(t.from,r,e);s=e.add(Gk({key:g.key||(t.key?kk(t.key):void 0),pulse:g.pulse,clean:!r}));const m=jk(s);s=u=e.add(Yk({pulse:m})),s=e.add(eE({markdef:uA(t),interactive:lA(t.interactive,e),clip:oA(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:jk(s)}));const b=jk(s);s=l=e.add(Vk(gk(t.encode,t.type,n,t.style,e,{mod:!1,pulse:b}))),s.params.parent=e.encode(),t.transform&&t.transform.forEach(t=>{const n=cA(t,e),r=n.metadata;(r.generates||r.changes)&&Object(Z.o)("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),n.params.pulse=jk(s),e.add(s=n)}),t.sort&&(s=e.add(hE({sort:e.compareRef(t.sort),pulse:jk(s)})));const y=jk(s);(i||h)&&(h=e.add(pE({layout:e.objectProperty(t.layout),legends:e.legends,mark:b,pulse:y})),f=jk(h));const v=e.add(Wk({mark:b,pulse:f||y}));d=jk(v),r&&(p&&(a=e.operators,a.pop(),h&&a.pop()),e.pushState(y,f||d,m),i?function(t,e,n){const r=t.from.facet,i=r.name,o=_A(r,e);let a;r.name||Object(Z.o)("Facet must have a name: "+Object(Z.ab)(r)),r.data||Object(Z.o)("Facet must reference a data set: "+Object(Z.ab)(r)),r.field?a=e.add(aE({field:e.fieldRef(r.field),pulse:o})):r.groupby?a=e.add(Jk({key:e.keyRef(r.groupby),group:jk(e.proxy(n.parent)),pulse:o})):Object(Z.o)("Facet must specify groupby or field: "+Object(Z.ab)(r));const s=e.fork(),u=s.add(Yk()),l=s.add(dE({pulse:jk(u)}));s.addData(i,new OA(s,u,u,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(t).toRuntime()}}(t,e,g):p?function(t,e,n){const r=e.add(aE({pulse:n.pulse})),i=e.fork();i.add(dE()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(t).toRuntime()}}(t,e,g):e.parse(t),e.popState(),p&&(h&&a.push(h),a.push(v))),o&&(d=function(t,e,n){const r=t.method,i=t.bound,o=t.separation,a={separation:Mk(o)?n.signalRef(o.signal):o,method:Mk(r)?n.signalRef(r.signal):r,pulse:e};t.order&&(a.sort=n.compareRef({field:t.order}));if(i){const t=i.tolerance;a.boundTolerance=Mk(t)?n.signalRef(t.signal):+t,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return jk(n.add(iE(a)))}(o,d,e));const x=e.add(cE({pulse:d})),_=e.add(dE({pulse:jk(x)},void 0,e.parent()));null!=t.name&&(c=t.name,e.addData(c,new OA(e,u,x,_)),t.on&&t.on.forEach(t=>{(t.insert||t.remove||t.toggle)&&Object(Z.o)("Marks only support modify triggers."),EA(t,e,c)}))}function DA(t,e){const n=e.config.legend,r=t.encode||{},i=RE(t,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,u=o.style,l={};let c,f,d,h=0;FE.forEach(e=>t[e]?(l[e]=t[e],h=h||t[e]):0),h||Object(Z.o)("Missing valid scale for legend.");const p=function(t,e){let n=t.type||"symbol";t.type||1!==function(t){return FE.reduce((e,n)=>e+(t[n]?1:0),0)}(t)||!t.fill&&!t.stroke||(n=Xs(e)?"gradient":Ks(e)?"discrete":"symbol");return"gradient"!==n?n:Ks(e)?"discrete":"gradient"}(t,e.scaleType(h)),g={title:null!=t.title,scales:l,type:p,vgrad:"symbol"!==p&&i.isVertical()},m=jk(e.add(Yk(null,[g]))),b=jk(e.add(Qk(f={type:p,scale:e.scaleRef(h),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return"gradient"===p?(d=[qE(t,h,n,r.gradient),GE(t,n,r.labels,b)],f.count=f.count||e.signalRef("max(2,2*floor((".concat(Fk(i.gradientLength()),")/100))"))):"discrete"===p?d=[WE(t,h,n,r.gradient,b),GE(t,n,r.labels,b)]:(c=function(t,e){const n=RE(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,n),d=[VE(t,n,r,b,Fk(c.columns))],f.size=function(t,e,n){const r=Fk(SA("size",t,n)),i=Fk(SA("strokeWidth",t,n)),o=Fk(function(t,e,n){return PE("fontSize",t)||function(t,e,n){const r=e.config.style[n];return r&&r[t]}("fontSize",e,n)}(n[1].encode,e,"guide-label"));return Xw("max(ceil(sqrt(".concat(r,")+").concat(i,"),").concat(o,")"),e)}(t,e,d[0].marks)),d=[NE({role:"legend-entry",from:m,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:s})],g.title&&d.push(function(t,e,n,r){const i=RE(t,e),o={enter:{opacity:TE},update:{opacity:$E,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:TE}};return ak(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:nA},angle:{signal:rA},align:{signal:eA},baseline:{signal:iA},text:t.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),UE({type:"text",role:"legend-title",style:"guide-title",from:r,encode:o},n)}(t,n,r.title,m)),AA(NE({role:"legend",from:m,encode:sk(MA(i,t,n),o,zE),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:u}),e)}function MA(t,e,n){const r={enter:{},update:{}};return ak(r,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),r}function SA(t,e,n){return e[t]?'scale("'.concat(e[t],'",datum)'):PE(t,n[0].encode)}OA.fromEntries=function(t,e){const n=e.length,r=e[n-1],i=e[n-2];let o=e[0],a=null,s=1;for(o&&"load"===o.type&&(o=e[1]),t.add(e[0]);s{n.push(cA(t,e))}),t.on&&t.on.forEach(n=>{EA(n,e,t.name)}),e.addDataPipeline(t.name,function(t,e,n){const r=[];let i,o,a,s,u,l=null,c=!1,f=!1;t.values?Sk(t.values)||Sk(t.format)?(r.push(NA(e,t)),r.push(l=$A())):r.push(l=$A({$ingest:t.values,$format:t.format})):t.url?Sk(t.url)||Sk(t.format)?(r.push(NA(e,t)),r.push(l=$A())):r.push(l=$A({$request:t.url,$format:t.format})):t.source&&(l=i=Object(Z.i)(t.source).map(t=>jk(e.getData(t).output)),r.push(null));for(o=0,a=n.length;o"bottom"===t||"top"===t,PA=(t,e,n)=>Mk(t)?WA(t.signal,e,n):"left"===t||"top"===t?e:n,BA=(t,e,n)=>Mk(t)?UA(t.signal,e,n):RA(t)?e:n,LA=(t,e,n)=>Mk(t)?qA(t.signal,e,n):RA(t)?n:e,IA=(t,e,n)=>Mk(t)?YA(t.signal,e,n):"top"===t?{value:e}:{value:n},UA=(t,e,n)=>GA("".concat(t," === '").concat("top","' || ").concat(t," === '").concat("bottom","'"),e,n),qA=(t,e,n)=>GA("".concat(t," !== '").concat("top","' && ").concat(t," !== '").concat("bottom","'"),e,n),WA=(t,e,n)=>XA("".concat(t," === '").concat("left","' || ").concat(t," === '").concat("top","'"),e,n),YA=(t,e,n)=>XA("".concat(t," === '").concat("top","'"),e,n),HA=(t,e,n)=>XA("".concat(t," === '").concat("right","'"),e,n),GA=(t,e,n)=>(e=null!=e?ik(e):e,n=null!=n?ik(n):n,VA(e)&&VA(n)?(e=e?e.signal||Object(Z.ab)(e.value):null,n=n?n.signal||Object(Z.ab)(n.value):null,{signal:"".concat(t," ? (").concat(e,") : (").concat(n,")")}):[Object(Z.p)({test:t},e)].concat(n||[])),VA=t=>null==t||1===Object.keys(t).length,XA=(t,e,n)=>({signal:"".concat(t," ? (").concat(JA(e),") : (").concat(JA(n),")")}),JA=t=>Mk(t)?t.signal:null==t?null:Object(Z.ab)(t),KA=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function ZA(t,e,n,r){let i;if(e&&Object(Z.w)(e,t))return e[t];if(Object(Z.w)(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=t[5].toLowerCase()+t.slice(6)}return r["guide-title"][i]}if(t.startsWith("label")){switch(t){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=t[5].toLowerCase()+t.slice(6)}return r["guide-label"][i]}return null}function QA(t){const e={};for(const n of t)if(n)for(const t in n)e[t]=1;return Object.keys(e)}function tD(t,e){return{scale:t.scale,range:e}}function eD(t,e,n,r,i){const o=RE(t,e),a=t.orient,s=t.gridScale,u=PA(a,1,-1),l=function(t,e){if(1===e);else if(Object(Z.G)(t)){let n=t=Object(Z.p)({},t);for(;null!=n.mult;){if(!Object(Z.G)(n.mult))return n.mult=Mk(e)?{signal:"(".concat(n.mult,") * (").concat(e.signal,")")}:n.mult*e,t;n=n.mult=Object(Z.p)({},n.mult)}n.mult=e}else t=Mk(e)?{signal:"(".concat(e.signal,") * (").concat(t||0,")")}:e*(t||0);return t}(t.offset,u);let c,f,d;const h={enter:c={opacity:TE},update:d={opacity:$E},exit:f={opacity:TE}};ak(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:CE,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=BA(a,{signal:"height"},{signal:"width"}),m=s?{scale:s,range:0,mult:u,offset:l}:{value:0,offset:l},b=s?{scale:s,range:1,mult:u,offset:l}:Object(Z.p)(g,{mult:u,offset:l});return c.x=d.x=BA(a,p,m),c.y=d.y=LA(a,p,m),c.x2=d.x2=LA(a,b),c.y2=d.y2=BA(a,b),f.x=BA(a,p),f.y=LA(a,p),UE({type:"rule",role:"axis-grid",key:CE,from:r,encode:h},n)}function nD(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function rD(t,e,n,r,i,o){const a=RE(t,e),s=t.orient,u=t.scale,l=PA(s,-1,1),c=Fk(a("labelFlush")),f=Fk(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,g=0===c||!!c;const m=ik(i);m.mult=l,m.offset=ik(a("labelPadding")||0),m.offset.mult=l;const b={scale:u,field:CE,band:.5,offset:IE(o.offset,a("labelOffset"))},y=BA(s,g?nD(u,c,'"left"','"right"','"center"'):{value:"center"},((t,e,n)=>Mk(t)?HA(t.signal,e,n):"right"===t?{value:e}:{value:n})(s,"left","right")),v=BA(s,IA(s,"bottom","top"),g?nD(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=nD(u,c,"-(".concat(f,")"),f,0);g=g&&f;const _={opacity:TE,x:BA(s,b,m),y:LA(s,b,m)},O={enter:_,update:p={opacity:$E,text:{field:"label"},x:_.x,y:_.y,align:y,baseline:v},exit:{opacity:TE,x:_.x,y:_.y}};ak(O,{dx:!d&&g?BA(s,x):null,dy:!h&&g?LA(s,x):null}),ak(O,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const w=a("labelBound");let j=a("labelOverlap");return j=j||w?{separation:a("labelSeparation"),method:j,order:"datum.index",bound:w?{scale:u,orient:s,tolerance:w}:null}:void 0,p.align!==y&&(p.align=KA(p.align,y)),p.baseline!==v&&(p.baseline=KA(p.baseline,v)),UE({type:"text",role:"axis-label",style:"guide-label",key:CE,from:r,encode:O,overlap:j},n)}function iD(t,e,n,r){const i=RE(t,e),o=t.orient,a=PA(o,-1,1);let s,u;const l={enter:s={opacity:TE,anchor:ik(i("titleAnchor",null)),align:{signal:LE}},update:u=Object(Z.p)({},s,{opacity:$E,text:ik(t.title)}),exit:{opacity:TE}},c={signal:'lerp(range("'.concat(t.scale,'"), ').concat(BE(0,1,.5),")")};return u.x=BA(o,c),u.y=LA(o,c),s.angle=BA(o,TE,((t,e)=>0===e?0:Mk(t)?{signal:"(".concat(t.signal,") * ").concat(e)}:{value:t*e})(a,90)),s.baseline=BA(o,IA(o,"bottom","top"),{value:"bottom"}),u.angle=s.angle,u.baseline=s.baseline,ak(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(t,e,n,r){const i=(t,e)=>null!=t?(n.update[e]=KA(ik(t),n.update[e]),!1):!uk(e,r),o=i(t("titleX"),"x"),a=i(t("titleY"),"y");n.enter.auto=a===o?ik(a):BA(e,ik(a),ik(o))}(i,o,l,n),l.update.align=KA(l.update.align,s.align),l.update.angle=KA(l.update.angle,s.angle),l.update.baseline=KA(l.update.baseline,s.baseline),UE({type:"text",role:"axis-title",style:"guide-title",from:r,encode:l},n)}function oD(t,e){const n=function(t,e){var n,r,i,o,a,s,u,l,c=e.config,f=c.style,d=c.axis,h="band"===e.scaleType(t.scale)&&c.axisBand,p=t.orient;if(Mk(p)){const t=QA([c.axisX,c.axisY]),e=QA([c.axisTop,c.axisBottom,c.axisLeft,c.axisRight]);for(i of(n={},t))n[i]=BA(p,ZA(i,c.axisX,d,f),ZA(i,c.axisY,d,f));for(i of(r={},e))r[i]=(o=p.signal,a=ZA(i,c.axisTop,d,f),s=ZA(i,c.axisBottom,d,f),u=ZA(i,c.axisLeft,d,f),l=ZA(i,c.axisRight,d,f),{signal:(null!=u?"".concat(o," === '").concat("left","' ? (").concat(JA(u),") : "):"")+(null!=s?"".concat(o," === '").concat("bottom","' ? (").concat(JA(s),") : "):"")+(null!=l?"".concat(o," === '").concat("right","' ? (").concat(JA(l),") : "):"")+(null!=a?"".concat(o," === '").concat("top","' ? (").concat(JA(a),") : "):"")+"(null)"})}else n="top"===p||"bottom"===p?c.axisX:c.axisY,r=c["axis"+p[0].toUpperCase()+p.slice(1)];return n||r||h?Object(Z.p)({},d,n,r,h):d}(t,e),r=t.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,u=RE(t,n),l=function(t){const e=t("tickBand");let n,r,i=t("tickOffset");return e?e.signal?(n={signal:"(".concat(e.signal,") === 'extent' ? 1 : 0.5")},r={signal:"(".concat(e.signal,") === 'extent'")},Object(Z.G)(i)||(i={signal:"(".concat(e.signal,") === 'extent' ? 0 : ").concat(i)})):"extent"===e?(n=1,r=!0,i=0):(n=.5,r=!1):(n=t("bandPosition"),r=t("tickExtra")),{extra:r,band:n,offset:i}}(u),c={scale:t.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:null!=t.title},f=jk(e.add(Yk({},[c]))),d=jk(e.add(qk({scale:e.scaleRef(t.scale),extra:e.property(l.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),h=[];let p;return c.grid&&h.push(eD(t,n,r.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(function(t,e,n,r,i,o){const a=RE(t,e),s=t.orient,u=PA(s,-1,1);let l,c,f;const d={enter:l={opacity:TE},update:f={opacity:$E},exit:c={opacity:TE}};ak(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=ik(i);h.mult=u;const p={scale:t.scale,field:CE,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=BA(s,TE,p),f.y2=l.y2=BA(s,h),c.x=BA(s,p),f.x=l.x=LA(s,TE,p),f.x2=l.x2=LA(s,h),c.y=LA(s,p),UE({type:"rule",role:"axis-tick",key:CE,from:r,encode:d},n)}(t,n,r.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(rD(t,n,r.labels,d,p,l))),c.domain&&h.push(function(t,e,n,r){const i=RE(t,e),o=t.orient;let a,s;const u={enter:a={opacity:TE},update:s={opacity:$E},exit:{opacity:TE}};ak(u,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=tD(t,0),c=tD(t,1);return a.x=s.x=BA(o,l,TE),a.x2=s.x2=BA(o,c),a.y=s.y=LA(o,l,TE),a.y2=s.y2=LA(o,c),UE({type:"rule",role:"axis-domain",from:r,encode:u},n)}(t,n,r.domain,f)),c.title&&h.push(iD(t,n,r.title,f)),AA(NE({role:"axis",from:f,encode:sk(aD(u,t),i,zE),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:a,style:s}),e)}function aD(t,e){const n={enter:{},update:{}};return ak(n,{orient:t("orient"),offset:t("offset")||0,position:Ck(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:'abs(span(range("'.concat(e.scale,'")))')},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function sD(t,e,n){const r=Object(Z.i)(t.signals),i=Object(Z.i)(t.scales);return n||r.forEach(t=>xk(t,e)),Object(Z.i)(t.projections).forEach(t=>function(t,e){const n=e.config.projection||{},r={};for(const n in t)"name"!==n&&(r[n]=SE(t[n],n,e));for(const t in n)null==r[t]&&(r[t]=SE(n[t],t,e));e.addProjection(t.name,r)}(t,e)),i.forEach(t=>function(t,e){const n=t.type||"linear";Gs(n)||Object(Z.o)("Unrecognized scale type: "+Object(Z.ab)(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e)),Object(Z.i)(t.data).forEach(t=>TA(t,e)),i.forEach(t=>yE(t,e)),(n||r).forEach(t=>function(t,e){const n=e.getSignal(t.name);let r=t.update;t.init&&(r?Object(Z.o)("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=Xw(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach(t=>Bk(t,e,n.id))}(t,e)),Object(Z.i)(t.axes).forEach(t=>oD(t,e)),Object(Z.i)(t.marks).forEach(t=>AA(t,e)),Object(Z.i)(t.legends).forEach(t=>DA(t,e)),t.title&&FA(t.title,e),e.parseLambdas(),e}function uD(t,e){const n=e.config,r=jk(e.root=e.add(wk())),i=function(t,e){const n=n=>Ck(t[n],e[n]),r=[lD("background",n("background")),lD("autosize",ek(n("autosize"))),lD("padding",rk(n("padding"))),lD("width",n("width")||0),lD("height",n("height")||0)],i=r.reduce((t,e)=>(t[e.name]=e,t),{}),o={};return Object(Z.i)(t.signals).forEach(t=>{Object(Z.w)(i,t.name)?t=Object(Z.p)(i[t.name],t):r.push(t),o[t.name]=t}),Object(Z.i)(e.signals).forEach(t=>{Object(Z.w)(o,t.name)||Object(Z.w)(i,t.name)||r.push(t)}),r}(t,n);i.forEach(t=>xk(t,e)),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(Yk()),a=e.add(Vk(gk((t=>sk({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t))(t.encode),"group","frame",t.style,e,{pulse:jk(o)}))),s=e.add(pE({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:r,pulse:jk(a)}));e.operators.pop(),e.pushState(jk(a),jk(s),null),sD(t,e,i),e.operators.push(s);let u=e.add(Wk({mark:r,pulse:jk(s)}));return u=e.add(cE({pulse:jk(u)})),u=e.add(dE({pulse:jk(u)})),e.addData("root",new OA(e,o,o,u)),e}function lD(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function cD(t,e){this.config=t||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function fD(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}function dD(t){return(Object(Z.B)(t)?hD:pD)(t)}function hD(t){const e=t.length;let n="[";for(let r=0;r0?",":"")+(Object(Z.G)(e)?e.signal||dD(e):Object(Z.ab)(e))}return n+"]"}function pD(t){let e,n,r="{",i=0;for(e in t)n=t[e],r+=(++i>1?",":"")+Object(Z.ab)(e)+":"+(Object(Z.G)(n)?n.signal||dD(n):Object(Z.ab)(n));return r+"}"}function gD(t,e,n){return Object(Z.G)(t)||Object(Z.o)("Input Vega specification must be an object."),uD(t,new cD(e=Object(Z.O)({description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:"#4c78a8"},area:{fill:"#4c78a8"},image:null,line:{stroke:"#4c78a8",strokeWidth:2},path:{stroke:"#4c78a8"},rect:{fill:"#4c78a8"},rule:{stroke:"#000"},shape:{stroke:"#4c78a8"},symbol:{fill:"#4c78a8",size:64},text:{fill:"#000",font:"sans-serif",fontSize:11},trail:{fill:"#4c78a8",size:2},style:{"guide-label":{fill:"#000",font:"sans-serif",fontSize:10},"guide-title":{fill:"#000",font:"sans-serif",fontSize:11,fontWeight:"bold"},"group-title":{fill:"#000",font:"sans-serif",fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:"#000",font:"sans-serif",fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:"#ddd"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:"#888",grid:!1,gridWidth:1,gridColor:"#ddd",labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:"#888",tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:"#ddd",gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:"#888",titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}},e,t.config),n)).toRuntime()}cD.prototype=fD.prototype={parse(t){return sD(t,this)},fork(){return new fD(this)},isSubscope(){return this._subid>0},toRuntime(){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(){return(this._subid?this._subid+":":0)+this._id++},add(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach(e=>{e.$ref=t.id}),t.refs=null),t},proxy(t){const e=t instanceof _k?jk(t):t;return this.add(uE({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){let r,i;t&&(r=t.data||(t.data={}),i=r[e]||(r[e]=[]),i.push(n))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const r in e.index)n(e.index[r],t,"index:"+r)}return this},pushState(t,e,n){this._encode.push(jk(this.add(dE({pulse:t})))),this._parent.push(e),this._lookup.push(n?jk(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Object(Z.V)(this._parent)},encode(){return Object(Z.V)(this._encode)},lookup(){return Object(Z.V)(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if(Object(Z.I)(t))return kk(t,e);t.signal||Object(Z.o)("Unsupported field reference: "+Object(Z.ab)(t));const n=t.signal;let r=this.field[n];if(!r){const t={name:this.signalRef(n)};e&&(t.as=e),this.field[n]=r=jk(this.add(Kk(t)))}return r},compareRef(t){let e=!1;const n=t=>Mk(t)?(e=!0,this.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(e=!0,this.exprRef(t.expr)):t,r=Object(Z.i)(t.field).map(n),i=Object(Z.i)(t.order).map(n);return e?jk(this.add(Hk({fields:r,orders:i}))):Ak(r,i)},keyRef(t,e){let n=!1;const r=this.signals;return t=Object(Z.i)(t).map(t=>Mk(t)?(n=!0,jk(r[t.signal])):t),n?jk(this.add(Zk({fields:t,flat:e}))):function(t,e){const n={$key:t};return e&&(n.$flat=!0),n}(t,e)},sortRef(t){if(!t)return t;const e=Dk(t.op,t.field),n=t.order||"ascending";return n.signal?jk(this.add(Hk({fields:e,orders:this.signalRef(n.signal)}))):Ak(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},hasOwnSignal(t){return Object(Z.w)(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&Object(Z.o)("Duplicate signal name: "+Object(Z.ab)(t));const n=e instanceof _k?e:this.add(wk(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||Object(Z.o)("Unrecognized signal name: "+Object(Z.ab)(t)),this.signals[t]},signalRef(t){return this.signals[t]?jk(this.signals[t]):(Object(Z.w)(this.lambdas,t)||(this.lambdas[t]=this.add(wk(null))),jk(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;eMD(t,e))}:ED(t)?{or:t.or.map(t=>MD(t,e))}:e(t)}const SD=OD.a,CD=xD.a;function FD(t,e){const n={};for(const r of e)Object(Z.w)(t,r)&&(n[r]=t[r]);return n}function zD(t,e){const n=Object.assign({},t);for(const t of e)delete n[t];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(t=>jD()(t)).join(",")})`};const TD=jD.a;function $D(t){if(Object(Z.F)(t))return t;const e=Object(Z.I)(t)?t:jD()(t);if(e.length<250)return e;let n=0;for(let t=0;t-1}function PD(t,e){let n=0;for(const[r,i]of t.entries())if(e(i,r,n++))return!0;return!1}function BD(t,e){let n=0;for(const[r,i]of t.entries())if(!e(i,r,n++))return!1;return!0}function LD(t,...e){for(const n of e)ID(t,null!=n?n:{});return t}function ID(t,e){for(const n of XD(e))Object(Z.kb)(t,n,e[n],!0)}function UD(t,e){const n=[],r={};let i;for(const o of t)i=e(o),i in r||(r[i]=1,n.push(o));return n}function qD(t,e){const n=XD(t),r=XD(e);if(n.length!==r.length)return!1;for(const r of n)if(t[r]!==e[r])return!1;return!0}function WD(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function YD(t,e){for(const n of t)if(e.has(n))return!0;return!1}function HD(t){const e=new Set;for(const n of t){const t=Object(Z.Z)(n).map((t,e)=>0===e?t:`[${t}]`),r=t.map((e,n)=>t.slice(0,n+1).join(""));for(const t of r)e.add(t)}return e}function GD(t,e){return void 0===t||void 0===e||YD(HD(t),HD(e))}function VD(t){return 0===XD(t).length}const XD=Object.keys,JD=Object.values,KD=Object.entries;function ZD(t){return!0===t||!1===t}function QD(t){const e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function tM(t,e){return DD(t)?"!("+tM(t.not,e)+")":AD(t)?"("+t.and.map(t=>tM(t,e)).join(") && (")+")":ED(t)?"("+t.or.map(t=>tM(t,e)).join(") || (")+")":e(t)}function eM(t,e){if(0===e.length)return!0;const n=e.shift();return n in t&&eM(t[n],e)&&delete t[n],VD(t)}function nM(t){return t.charAt(0).toUpperCase()+t.substr(1)}function rM(t,e="datum"){const n=Object(Z.Z)(t),r=[];for(let t=1;t<=n.length;t++){const i=`[${n.slice(0,t).map(Z.ab).join("][")}]`;r.push(`${e}${i}`)}return r.join(" && ")}function iM(t,e="datum"){return`${e}[${Object(Z.ab)(Object(Z.Z)(t).join("."))}]`}function oM(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function aM(t){return""+Object(Z.Z)(t).map(oM).join("\\.")}function sM(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function uM(t){return""+Object(Z.Z)(t).join(".")}function lM(t){return t?Object(Z.Z)(t).length:0}function cM(...t){for(const e of t)if(void 0!==e)return e}let fM=42;function dM(t){const e=++fM;return t?String(t)+e:e}function hM(){fM=42}function pM(t){return gM(t)?t:"__"+t}function gM(t){return 0===t.indexOf("__")}function mM(t){if(void 0!==t)return(t%360+360)%360}function bM(t){return!!Object(Z.F)(t)||!isNaN(t)&&!isNaN(parseFloat(t))}const yM={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function vM(t){return t&&t.condition}const xM=["domain","grid","labels","ticks","title"],_M={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},OM={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},wM=Object.assign(Object.assign({},OM),{style:1,labelExpr:1,encoding:1});function jM(t){return!!wM[t]}const kM=XD({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1}),EM={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},AM={count:1,min:1,max:1};function DM(t){return!!t&&!!t.argmin}function MM(t){return!!t&&!!t.argmax}function SM(t){return Object(Z.I)(t)&&!!EM[t]}const CM=["count","valid","missing","distinct"];function FM(t){return Object(Z.I)(t)&&RD(CM,t)}const zM=["count","sum","distinct","valid","missing"],TM=Object(Z.eb)(["mean","average","median","q1","q3","min","max"]),$M="row",NM="column",RM="radius",PM="theta",BM="theta2",LM="color",IM="fill",UM="stroke",qM="shape",WM={theta:1,theta2:1,radius:1,radius2:1};function YM(t){return t in WM}const HM={longitude:1,longitude2:1,latitude:1,latitude2:1};const GM=XD(HM),VM=Object.assign(Object.assign(Object.assign(Object.assign({},{x:1,y:1,x2:1,y2:1}),WM),HM),{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1});function XM(t){return t===LM||t===IM||t===UM}const JM={row:1,column:1,facet:1},KM=XD(JM),ZM=Object.assign(Object.assign({},VM),JM),QM=XD(ZM),tS=bD(ZM,["order","detail","tooltip"]),eS=bD(tS,["row","column","facet"]);function nS(t){return!!ZM[t]}const rS=["x2","y2","latitude2","longitude2",BM,"radius2"];function iS(t){return oS(t)!==t}function oS(t){switch(t){case"x2":return"x";case"y2":return"y";case"latitude2":return"latitude";case"longitude2":return"longitude";case BM:return PM;case"radius2":return RM}return t}function aS(t){if(YM(t))switch(t){case PM:return"startAngle";case BM:return"endAngle";case RM:return"outerRadius";case"radius2":return"innerRadius"}return t}function sS(t){switch(t){case"x":return"x2";case"y":return"y2";case"latitude":return"latitude2";case"longitude":return"longitude2";case PM:return BM;case RM:return"radius2"}}function uS(t){switch(t){case"x":case"x2":return"width";case"y":case"y2":return"height"}}const lS=bD(VM,["x","y","x2","y2","latitude","longitude","latitude2","longitude2","theta","theta2","radius","radius2"]),cS=XD(lS),fS={x:1,y:1},dS=XD(fS);function hS(t){return t in fS}const pS={theta:1,radius:1},gS=XD(pS);function mS(t){return"width"===t?"x":"y"}const bS=bD(lS,["text","tooltip","href","url","description","detail","key","order"]),yS=XD(bS);const vS=Object.assign(Object.assign(Object.assign({},fS),pS),bS),xS=XD(vS);function _S(t){return!!vS[t]}function OS(t,e){return function(t){switch(t){case LM:case IM:case UM:case"description":case"detail":case"key":case"tooltip":case"href":case"order":case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"facet":case $M:case NM:return wS;case"x":case"y":case"latitude":case"longitude":return jS;case"x2":case"y2":case"latitude2":case"longitude2":return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case"size":return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case"strokeDash":return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case qM:return{point:"always",geoshape:"always"};case"text":return{text:"always"};case"angle":return{point:"always",square:"always",text:"always"};case"url":return{image:"always"};case PM:case RM:return{text:"always",arc:"always"};case BM:case"radius2":return{arc:"always"}}}(t)[e]}const wS={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},jS=bD(wS,["geoshape"]);function kS(t){switch(t){case"x":case"y":case PM:case RM:case"size":case"angle":case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case"x2":case"y2":case BM:case"radius2":return;case"facet":case $M:case NM:case qM:case"strokeDash":case"text":case"tooltip":case"href":case"url":case"description":return"discrete";case LM:case IM:case UM:return"flexible";case"latitude":case"longitude":case"latitude2":case"longitude2":case"detail":case"key":case"order":return}}function ES(t){return Object(Z.C)(t)&&(t=aT(t,void 0)),"bin"+XD(t).map(e=>SS(t[e])?QD(`_${e}_${KD(t[e])}`):QD(`_${e}_${t[e]}`)).join("")}function AS(t){return!0===t||MS(t)&&!t.binned}function DS(t){return"binned"===t||MS(t)&&!0===t.binned}function MS(t){return Object(Z.G)(t)}function SS(t){return null==t?void 0:t.selection}function CS(t){switch(t){case $M:case NM:case"size":case LM:case IM:case UM:case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case qM:return 6;case"strokeDash":return 4;default:return 10}}function FS(t){return`Invalid specification ${JSON.stringify(t)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}function zS(t){return("width"==t?"Width":"Height")+' "container" only works for single views and layered views.'}function TS(t){return`${"width"==t?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==t?"x":"y"}".`}function $S(t){return t?`Dropping "fit-${t}" because spec has discrete ${uS(t)}.`:'Dropping "fit" because spec has discrete size.'}function NS(t){return`Unknown field for ${t}. Cannot calculate view size.`}function RS(t){return`Cannot project a selection on encoding channel "${t}", which has no field.`}function PS(t,e){return`Cannot project a selection on encoding channel "${t}" as it uses an aggregate function ("${e}").`}function BS(t){return`Selection not supported for ${t} yet.`}function LS(t){return`The "columns" property cannot be used when "${t}" has nested row/column.`}function IS(t,e,n){return`An ancestor parsed field "${t}" as ${n} but a child wants to parse the field as ${e}.`}function US(t){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${t} are dropped.`}function qS(t){return`Invalid field type "${t}".`}function WS(t,e){const{fill:n,stroke:r}=e;return`Dropping color ${t} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function YS(t,e){return`Dropping ${TD(t)} from channel "${e}" since it does not contain any data field, datum, value, or signal.`}function HS(t,e,n){return`${t} dropped as it is incompatible with "${e}"${n?" when "+n:""}.`}function GS(t){return t+" encoding should be discrete (ordinal / nominal / binned)."}function VS(t,e){return`Using discrete channel "${t}" to encode "${e}" field can be misleading as it does not encode ${"ordinal"===e?"order":"magnitude"}.`}function XS(t){return`Using unaggregated domain with raw field has no effect (${TD(t)}).`}function JS(t){return`Unaggregated domain not applicable for "${t}" since it produces values outside the origin domain of the source data.`}function KS(t){return`Unaggregated domain is currently unsupported for log scale (${TD(t)}).`}function ZS(t,e,n){return`${n}-scale's "${e}" is dropped as it does not work with ${t} scale.`}function QS(t){return`The step for "${t}" is dropped because the ${"width"===t?"x":"y"} is continuous.`}const tC="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function eC(t,e){return`Invalid ${t}: ${TD(e)}.`}function nC(t){return`1D error band does not support ${t}.`}function rC(t){return`Channel ${t} is required for "binned" bin.`}const iC=Object(Z.L)(Z.e);let oC=iC;function aC(...t){oC.warn(...t)}function sC(t){if(t&&Object(Z.G)(t))for(const e of gC)if(e in t)return!0;return!1}const uC=["january","february","march","april","may","june","july","august","september","october","november","december"],lC=uC.map(t=>t.substr(0,3)),cC=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],fC=cC.map(t=>t.substr(0,3));function dC(t,e){const n=[];if(e&&void 0!==t.day&&XD(t).length>1&&(aC(function(t){return`Dropping day from datetime ${TD(t)} as day cannot be combined with other units.`}(t)),delete(t=CD(t)).day),void 0!==t.year?n.push(t.year):n.push(2012),void 0!==t.month){const r=e?function(t){if(bM(t)&&(t=+t),Object(Z.F)(t))return t-1;{const e=t.toLowerCase(),n=uC.indexOf(e);if(-1!==n)return n;const r=e.substr(0,3),i=lC.indexOf(r);if(-1!==i)return i;throw new Error(eC("month",t))}}(t.month):t.month;n.push(r)}else if(void 0!==t.quarter){const r=e?function(t){if(bM(t)&&(t=+t),Object(Z.F)(t))return t>4&&aC(eC("quarter",t)),t-1;throw new Error(eC("quarter",t))}(t.quarter):t.quarter;n.push(Object(Z.F)(r)?3*r:r+"*3")}else n.push(0);if(void 0!==t.date)n.push(t.date);else if(void 0!==t.day){const r=e?function(t){if(bM(t)&&(t=+t),Object(Z.F)(t))return t%7;{const e=t.toLowerCase(),n=cC.indexOf(e);if(-1!==n)return n;const r=e.substr(0,3),i=fC.indexOf(r);if(-1!==i)return i;throw new Error(eC("day",t))}}(t.day):t.day;n.push(Object(Z.F)(r)?r+1:r+"+1")}else n.push(1);for(const e of["hours","minutes","seconds","milliseconds"]){const r=t[e];n.push(void 0===r?0:r)}return n}function hC(t){const e=dC(t,!0).join(", ");return t.utc?`utc(${e})`:`datetime(${e})`}const pC={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},gC=XD(pC);function mC(t){return t.startsWith("utc")}const bC={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function yC(t){const e=[];for(const n of gC)vC(t,n)&&e.push(n);return e}function vC(t,e){const n=t.indexOf(e);return!(n<0)&&(!(n>0&&"seconds"===e&&"i"===t.charAt(n-1))&&(!(t.length>n+3&&"day"===e&&"o"===t.charAt(n+3))&&!(n>0&&"year"===e&&"f"===t.charAt(n-1))))}function xC(t,e,{end:n}={end:!1}){const r=rM(e),i=mC(t)?"utc":"";let o;const a={};for(const e of gC)vC(t,e)&&(a[e]="quarter"===(s=e)?`(${i}quarter(${r})-1)`:`${i}${s}(${r})`,o=e);var s;return n&&(a[o]+="+1"),function(t){const e=dC(t,!1).join(", ");return t.utc?`utc(${e})`:`datetime(${e})`}(a)}function _C(t){if(!t)return;const e=yC(t);return`timeUnitSpecifier(${jD()(e)}, ${jD()(bC)})`}function OC(t){if(!t)return;let e;return Object(Z.I)(t)?e={unit:t}:Object(Z.G)(t)&&(e=Object.assign(Object.assign({},t),t.unit?{unit:t.unit}:{})),mC(e.unit)&&(e.utc=!0,e.unit=e.unit.substr(3)),e}function wC(t){return t&&!!t.signal}function jC(t){return!!t.step}function kC(t){return!Object(Z.B)(t)&&("field"in t&&"data"in t)}const EC=XD({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),AC={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},DC=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function MC(t){return t&&!!t.field&&void 0!==t.equal}function SC(t){return t&&!!t.field&&void 0!==t.lt}function CC(t){return t&&!!t.field&&void 0!==t.lte}function FC(t){return t&&!!t.field&&void 0!==t.gt}function zC(t){return t&&!!t.field&&void 0!==t.gte}function TC(t){if(t&&t.field){if(Object(Z.B)(t.range)&&2===t.range.length)return!0;if(wC(t.range))return!0}return!1}function $C(t){return t&&!!t.field&&(Object(Z.B)(t.oneOf)||Object(Z.B)(t.in))}function NC(t){return $C(t)||MC(t)||TC(t)||SC(t)||FC(t)||CC(t)||zC(t)}function RC(t,e){return lT(t,{timeUnit:e,wrapTime:!0})}function PC(t,e=!0){var n;const{field:r}=t,i=null===(n=OC(t.timeUnit))||void 0===n?void 0:n.unit,o=i?"time("+xC(i,r)+")":Yz(t,{expr:"datum"});if(MC(t))return o+"==="+RC(t.equal,i);if(SC(t)){return`${o}<${RC(t.lt,i)}`}if(FC(t)){return`${o}>${RC(t.gt,i)}`}if(CC(t)){return`${o}<=${RC(t.lte,i)}`}if(zC(t)){return`${o}>=${RC(t.gte,i)}`}if($C(t))return`indexof([${function(t,e){return t.map(t=>RC(t,e))}(t.oneOf,i).join(",")}], ${o}) !== -1`;if(function(t){return t&&!!t.field&&void 0!==t.valid}(t))return BC(o,t.valid);if(TC(t)){const{range:n}=t,r=wC(n)?{signal:n.signal+"[0]"}:n[0],a=wC(n)?{signal:n.signal+"[1]"}:n[1];if(null!==r&&null!==a&&e)return"inrange("+o+", ["+RC(r,i)+", "+RC(a,i)+"])";const s=[];return null!==r&&s.push(`${o} >= ${RC(r,i)}`),null!==a&&s.push(`${o} <= ${RC(a,i)}`),s.length>0?s.join(" && "):"true"}throw new Error("Invalid field predicate: "+JSON.stringify(t))}function BC(t,e=!0){return e?`isValid(${t}) && isFinite(+${t})`:`!isValid(${t}) || !isFinite(+${t})`}function LC(t){var e;return NC(t)&&t.timeUnit?Object.assign(Object.assign({},t),{timeUnit:null===(e=OC(t.timeUnit))||void 0===e?void 0:e.unit}):t}const IC="quantitative",UC="ordinal",qC="temporal",WC="nominal",YC="geojson";const HC="linear",GC="log",VC="pow",XC="sqrt",JC="symlog",KC="time",ZC="utc",QC="quantile",tF="quantize",eF="threshold",nF="point",rF="band",iF={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function oF(t,e){const n=iF[t],r=iF[e];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}const aF={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function sF(t){return aF[t]}const uF=["linear","log","pow","sqrt","symlog","time","utc"],lF=Object(Z.eb)(uF),cF=Object(Z.eb)(["linear","log","pow","sqrt","symlog"]);const fF=Object(Z.eb)(["quantile","quantize","threshold"]),dF=uF.concat(["quantile","quantize","threshold","sequential","identity"]),hF=Object(Z.eb)(dF),pF=Object(Z.eb)(["ordinal","bin-ordinal","point","band"]);function gF(t){return t in pF}function mF(t){return t in hF}function bF(t){return t in lF}function yF(t){return t in fF}function vF(t){return null==t?void 0:t.selection}const xF=bD({type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},["type","domain","range","rangeMax","rangeMin","scheme"]),_F=XD(xF);function OF(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!RD(["point","band","identity"],t);case"bins":return!RD(["point","band","identity","ordinal"],t);case"round":return bF(t)||"band"===t||"point"===t;case"padding":case"rangeMin":case"rangeMax":return bF(t)||RD(["point","band"],t);case"paddingOuter":case"align":return RD(["point","band"],t);case"paddingInner":return"band"===t;case"domainMax":case"domainMid":case"domainMin":case"clamp":return bF(t);case"nice":return bF(t)||"quantize"===t||"threshold"===t;case"exponent":return"pow"===t;case"base":return"log"===t;case"constant":return"symlog"===t;case"zero":return mF(t)&&!RD(["log","time","utc","threshold","quantile"],t)}}function wF(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return XM(t)?void 0:`Cannot use the scale property "${t}" with non-color channel.`;case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function jF(t){return t&&!!t.expr}function kF(t){const e=XD(t||{}),n={};for(const r of e)n[r]=gT(t[r]);return n}const EF={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},AF=EF.arc,DF=EF.area,MF=EF.bar,SF=EF.image,CF=EF.line,FF=EF.point,zF=EF.rect,TF=EF.rule,$F=EF.text,NF=EF.tick,RF=EF.trail,PF=EF.circle,BF=EF.square,LF=EF.geoshape;function IF(t){return RD(["line","area","trail"],t)}function UF(t){return RD(["rect","bar","image","arc"],t)}const qF=XD(EF);function WF(t){return t.type}Object(Z.eb)(qF);const YF=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],HF=XD({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBand:1,timeUnitBandPosition:1}),GF=XD({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1}),VF={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},XF={binSpacing:1,continuousBandSize:5,timeUnitBandPosition:.5},JF={binSpacing:0,continuousBandSize:5,timeUnitBandPosition:.5};function KF(t){const{channel:e,channelDef:n,markDef:r,scale:i,config:o}=t,a=rz(t);return Fz(n)&&!FM(n.aggregate)&&i&&bF(i.get("type"))&&!1===i.get("zero")?ZF({fieldDef:n,channel:e,markDef:r,ref:a,config:o}):a}function ZF({fieldDef:t,channel:e,markDef:n,ref:r,config:i}){if(IF(n.type))return r;return null===_T("invalid",n,i)?r:[QF(t,e),r]}function QF(t,e){const n=tz(t,!0),r="y"===oS(e)?{field:{group:"height"}}:{value:0};return Object.assign({test:n},r)}function tz(t,e=!0){return BC(Object(Z.I)(t)?t:Yz(t,{expr:"datum"}),!e)}function ez(t,e,n,r){const i={};if(e&&(i.scale=e),Tz(t)){const{datum:e}=t;sC(e)?i.signal=hC(e):wC(e)?i.signal=e.signal:jF(e)?i.signal=e.expr:i.value=e}else i.field=Yz(t,n);if(r){const{offset:t,band:e}=r;t&&(i.offset=t),e&&(i.band=e)}return i}function nz({scaleName:t,fieldOrDatumDef:e,fieldOrDatumDef2:n,offset:r,startSuffix:i,band:o=.5}){const a=0QD(`${"unit"===t?"":`_${t}_`}${r[t]}`)).join(""):(n?"utc":"")+"timeunit"+XD(r).map(t=>QD(`_${t}_${r[t]}`)).join("")}(f),s=(!RD(["range","mid"],e.binSuffix)&&e.binSuffix||"")+(null!==(i=e.suffix)&&void 0!==i?i:""))}a&&(o=o?`${a}_${o}`:a)}return s&&(o=`${o}_${s}`),a&&(o=`${a}_${o}`),e.forAs?uM(o):e.expr?iM(o,e.expr)+u:aM(o)+u}function Hz(t){switch(t.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return Fz(t)&&!!t.bin;case"temporal":return!1}throw new Error(qS(t.type))}function Gz(t){return!Hz(t)}const Vz=(t,e)=>{switch(e.fieldTitle){case"plain":return t.field;case"functional":return function(t){const{aggregate:e,bin:n,timeUnit:r,field:i}=t;if(MM(e))return`${i} for argmax(${e.argmax})`;if(DM(e))return`${i} for argmin(${e.argmin})`;const o=OC(r),a=e||(null==o?void 0:o.unit)||(null==o?void 0:o.maxbins)&&"timeunit"||AS(n)&&"bin";return a?a.toUpperCase()+"("+i+")":i}(t);default:return function(t,e){var n;const{field:r,bin:i,timeUnit:o,aggregate:a}=t;if("count"===a)return e.countTitle;if(AS(i))return r+" (binned)";if(o){const t=null===(n=OC(o))||void 0===n?void 0:n.unit;if(t)return`${r} (${yC(t).join("-")})`}else if(a)return MM(a)?`${r} for max ${a.argmax}`:DM(a)?`${r} for min ${a.argmin}`:`${nM(a)} of ${r}`;return r}(t,e)}};let Xz=Vz;function Jz(t){Xz=t}function Kz(t,e,{allowDisabling:n,includeDefault:r=!0}){var i,o;const a=null===(i=Zz(t))||void 0===i?void 0:i.title;if(!Fz(t))return a;const s=t,u=r?Qz(s,e):void 0;return n?cM(a,s.title,u):null!==(o=null!=a?a:s.title)&&void 0!==o?o:u}function Zz(t){return Iz(t)&&t.axis?t.axis:Uz(t)&&t.legend?t.legend:wz(t)&&t.header?t.header:void 0}function Qz(t,e){return Xz(t,e)}function tT(t){var e;if(qz(t)){const{format:e,formatType:n}=t;return{format:e,formatType:n}}{const n=null!==(e=Zz(t))&&void 0!==e?e:{},{format:r,formatType:i}=n;return{format:r,formatType:i}}}function eT(t){return Fz(t)?t:Sz(t)?t.condition:void 0}function nT(t){return Rz(t)?t:Cz(t)?t.condition:void 0}function rT(t,e,n,r={}){if(Object(Z.I)(t)||Object(Z.F)(t)||Object(Z.C)(t)){return aC(function(t,e,n){return`Channel ${t} is a ${e}. Converted to {value: ${TD(n)}}.`}(e,Object(Z.I)(t)?"string":Object(Z.F)(t)?"number":"boolean",t)),{value:t}}return Rz(t)?iT(t,e,n,r):Cz(t)?Object.assign(Object.assign({},t),{condition:iT(t.condition,e,n,r)}):t}function iT(t,e,n,r){if(qz(t)){const{format:i,formatType:o}=t,a=bD(t,["format","formatType"]);if(oz(o)&&!n.customFormatTypes)return aC(US(e)),iT(a,e,n,r)}else{const i=Iz(t)?"axis":Uz(t)?"legend":wz(t)?"header":null;if(i&&t[i]){const o=t[i],{format:a,formatType:s}=o,u=bD(o,["format","formatType"]);if(oz(s)&&!n.customFormatTypes)return aC(US(e)),iT(Object.assign(Object.assign({},t),{[i]:u}),e,n,r)}}return Fz(t)?oT(t,e,r):function(t){let e=t.type;if(e)return t;const{datum:n}=t;return e=Object(Z.F)(n)?"quantitative":Object(Z.I)(n)?"nominal":sC(n)?"temporal":void 0,Object.assign(Object.assign({},t),{type:e})}(t)}function oT(t,e,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:a}=t,s=Object.assign({},t);if(n||!r||SM(r)||MM(r)||DM(r)||(aC(function(t){return`Invalid aggregation operator "${t}".`}(r)),delete s.aggregate),i&&(s.timeUnit=OC(i)),a&&(s.field=""+a),AS(o)&&(s.bin=aT(o,e)),DS(o)&&!hS(e)&&aC(function(t){return`Channel ${t} should not be used with "binned" bin.`}(e)),Pz(s)){const{type:t}=s,e=function(t){if(t)switch(t=t.toLowerCase()){case"q":case IC:return"quantitative";case"t":case qC:return"temporal";case"o":case UC:return"ordinal";case"n":case WC:return"nominal";case YC:return"geojson"}}(t);t!==e&&(s.type=e),"quantitative"!==t&&FM(r)&&(aC(function(t,e){return`Invalid field type "${t}" for aggregate: "${e}", using "quantitative" instead.`}(t,r)),s.type="quantitative")}else if(!iS(e)){const t=function(t,e){var n;switch(e){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Ez(t)&&Object(Z.B)(t.sort))return"ordinal";const{aggregate:r,bin:i,timeUnit:o}=t;if(o)return"temporal";if(i||r&&!MM(r)&&!DM(r))return"quantitative";if(Lz(t)&&(null===(n=t.scale)||void 0===n?void 0:n.type))switch(iF[t.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,e);s.type=t}if(Pz(s)){const{compatible:t,warning:n}=function(t,e){const n=t.type;if("geojson"===n&&"shape"!==e)return{compatible:!1,warning:`Channel ${e} should not be used with a geojson data.`};switch(e){case $M:case NM:case"facet":return Gz(t)?{compatible:!1,warning:GS(e)}:sT;case"x":case"y":case LM:case IM:case UM:case"text":case"detail":case"key":case"tooltip":case"href":case"url":case"angle":case PM:case RM:case"description":return sT;case"longitude":case"longitude2":case"latitude":case"latitude2":return n!==IC?{compatible:!1,warning:`Channel ${e} should be used with a quantitative field only, not ${t.type} field.`}:sT;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case BM:case"radius2":case"x2":case"y2":return"nominal"!==n||t.sort?sT:{compatible:!1,warning:`Channel ${e} should not be used with an unsorted discrete field.`};case"strokeDash":return RD(["ordinal","nominal"],t.type)?sT:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case qM:return RD(["ordinal","nominal","geojson"],t.type)?sT:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return"nominal"!==t.type||"sort"in t?sT:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,e)||{};!1===t&&aC(n)}if(Ez(s)&&Object(Z.I)(s.sort)){const{sort:t}=s;if(yz(t))return Object.assign(Object.assign({},s),{sort:{encoding:t}});const e=t.substr(1);if("-"===t.charAt(0)&&yz(e))return Object.assign(Object.assign({},s),{sort:{encoding:e,order:"descending"}})}if(wz(s)){const{header:t}=s,{orient:e}=t,n=bD(t,["orient"]);if(e)return Object.assign(Object.assign({},s),{header:Object.assign(Object.assign({},n),{labelOrient:t.labelOrient||e,titleOrient:t.titleOrient||e})})}return s}function aT(t,e){return Object(Z.C)(t)?{maxbins:CS(e)}:"binned"===t?{binned:!0}:t.maxbins||t.step?t:Object.assign(Object.assign({},t),{maxbins:CS(e)})}const sT={compatible:!0};function uT(t){const{formatType:e}=tT(t);return"time"===e||!e&&((n=t)&&("temporal"===n.type||Fz(n)&&!!n.timeUnit));var n}function lT(t,{timeUnit:e,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var o;const a=e&&(null===(o=OC(e))||void 0===o?void 0:o.unit);let s,u=a||"temporal"===n;return jF(t)?s=t.expr:wC(t)?s=t.signal:sC(t)?(u=!0,s=hC(t)):(Object(Z.I)(t)||Object(Z.F)(t))&&u&&(s=`datetime(${JSON.stringify(t)})`,function(t){return!!pC[t]}(a)&&(Object(Z.F)(t)&&t<1e4||Object(Z.I)(t)&&isNaN(Date.parse(t)))&&(s=hC({[a]:t}))),s?r&&u?`time(${s})`:s:i?void 0:JSON.stringify(t)}function cT(t,e){const{type:n}=t;return e.map(e=>{const r=lT(e,{timeUnit:Fz(t)?t.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:e})}function fT(t,e){return AS(t.bin)?_S(e)&&RD(["ordinal","nominal"],t.type):(console.warn("Only call this method for binned field defs."),!1)}function dT(t){const{anchor:e,frame:n,offset:r,orient:i,color:o,subtitleColor:a,subtitleFont:s,subtitleFontSize:u,subtitleFontStyle:l,subtitleFontWeight:c,subtitleLineHeight:f,subtitlePadding:d}=t,h=bD(t,["anchor","frame","offset","orient","color","subtitleColor","subtitleFont","subtitleFontSize","subtitleFontStyle","subtitleFontWeight","subtitleLineHeight","subtitlePadding"]),p=Object.assign(Object.assign({},h),o?{fill:o}:{}),g=Object.assign(Object.assign(Object.assign(Object.assign({},e?{anchor:e}:{}),n?{frame:n}:{}),r?{offset:r}:{}),i?{orient:i}:{}),m=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a?{subtitleColor:a}:{}),s?{subtitleFont:s}:{}),u?{subtitleFontSize:u}:{}),l?{subtitleFontStyle:l}:{}),c?{subtitleFontWeight:c}:{}),f?{subtitleLineHeight:f}:{}),d?{subtitlePadding:d}:{});return{titleMarkConfig:p,subtitleMarkConfig:FD(p,["align","baseline","dx","dy","limit"]),nonMark:g,subtitle:m}}function hT(t){return Object(Z.I)(t)||Object(Z.B)(t)&&Object(Z.I)(t[0])}function pT(t){const e=Object(Z.B)(t.condition)?t.condition.map(mT):mT(t.condition);return Object.assign(Object.assign({},gT(t)),{condition:e})}function gT(t){if(jF(t)){const{expr:e}=t,n=bD(t,["expr"]);return Object.assign({signal:e},n)}return t}function mT(t){if(jF(t)){const{expr:e}=t,n=bD(t,["expr"]);return Object.assign({signal:e},n)}return t}function bT(t){if(jF(t)){const{expr:e}=t,n=bD(t,["expr"]);return Object.assign({signal:e},n)}return wC(t)?t:void 0!==t?{value:t}:void 0}function yT(t){return wC(t)?t.signal:Object(Z.ab)(t.value)}function vT(t){return wC(t)?t.signal:null==t?null:Object(Z.ab)(t)}function xT(t){var e;return[].concat(t.type,null!==(e=t.style)&&void 0!==e?e:[])}function _T(t,e,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&void 0!==e[i]?e[i]:void 0!==e[t]?e[t]:!o||i&&i!==t?OT(t,e,n,r):void 0}function OT(t,e,n,{vgChannel:r}={}){return cM(r?wT(t,e,n.style):void 0,wT(t,e,n.style),r?n[e.type][r]:void 0,n[e.type][t],r?n.mark[r]:n.mark[t])}function wT(t,e,n){return jT(t,xT(e),n)}function jT(t,e,n){let r;e=Object(Z.i)(e);for(const i of e){const e=n[i];e&&void 0!==e[t]&&(r=e[t])}return r}function kT(t,e){return Object(Z.i)(t).reduce((t,n)=>{var r;return t.field.push(Yz(n,e)),t.order.push(null!==(r=n.sort)&&void 0!==r?r:"ascending"),t},{field:[],order:[]})}function ET(t,e){const n=[...t];return e.forEach(t=>{for(const e of n)if(SD(e,t))return;n.push(t)}),n}function AT(t,e){return SD(t,e)||!e?t:t?[...Object(Z.i)(t),...Object(Z.i)(e)].join(", "):e}function DT(t,e){const n=t.value,r=e.value;if(null==n||null===r)return{explicit:t.explicit,value:null};if((hT(n)||wC(n))&&(hT(r)||wC(r)))return{explicit:t.explicit,value:AT(n,r)};if(hT(n)||wC(n))return{explicit:t.explicit,value:n};if(hT(r)||wC(r))return{explicit:t.explicit,value:r};if(!(hT(n)||wC(n)||hT(r)||wC(r)))return{explicit:t.explicit,value:ET(n,r)};throw new Error("It should never reach here")}function MT(t){return"mark"in t}class ST{constructor(t,e){this.name=t,this.run=e}hasMatchingType(t){return!!MT(t)&&(WF(e=t.mark)?e.type:e)===this.name;var e}}function CT(t,e){const n=t&&t[e];return!!n&&(Object(Z.B)(n)?PD(n,t=>!!t.field):Fz(n)||Sz(n))}function FT(t){return PD(QM,e=>{if(CT(t,e)){const n=t[e];if(Object(Z.B)(n))return PD(n,t=>!!t.aggregate);{const t=eT(n);return t&&!!t.aggregate}}return!1})}function zT(t,e){const n=[],r=[],i=[],o=[],a={};return NT(t,(s,u)=>{if(Fz(s)){const{field:l,aggregate:c,bin:f,timeUnit:d}=s,h=bD(s,["field","aggregate","bin","timeUnit"]);if(c||d||f){const t=Zz(s),p=t&&t.title;let g=Yz(s,{forAs:!0});const m=Object.assign(Object.assign(Object.assign({},p?[]:{title:Kz(s,e,{allowDisabling:!0})}),h),{field:g});if(c){let t;if(MM(c)?(t="argmax",g=Yz({op:"argmax",field:c.argmax},{forAs:!0}),m.field=`${g}.${l}`):DM(c)?(t="argmin",g=Yz({op:"argmin",field:c.argmin},{forAs:!0}),m.field=`${g}.${l}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(t=c),t){const e={op:t,as:g};l&&(e.field=l),o.push(e)}}else if(n.push(g),Pz(s)&&AS(f)){if(r.push({bin:f,field:l,as:g}),n.push(Yz(s,{binSuffix:"end"})),fT(s,u)&&n.push(Yz(s,{binSuffix:"range"})),hS(u)){const t={field:g+"_end"};a[u+"2"]=t}m.bin="binned",iS(u)||(m.type=IC)}else if(d){i.push({timeUnit:d,field:l,as:g});const t=Pz(s)&&s.type!==qC&&"time";t&&("text"===u||"tooltip"===u?m.formatType=t:!function(t){return!!lS[t]}(u)?hS(u)&&(m.axis=Object.assign({formatType:t},m.axis)):m.legend=Object.assign({formatType:t},m.legend))}a[u]=m}else n.push(l),a[u]=t[u]}else a[u]=t[u]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function TT(t,e,n,r){return XD(t).reduce((i,o)=>{if(!nS(o))return aC(function(t){return`${t}-encoding is dropped as ${t} is not a valid encoding channel.`}(o)),i;const a=t[o];if("angle"!==o||"arc"!==e||t.theta||(aC("Arc marks uses theta channel rather than angle, replacing angle with theta."),o=PM),!function(t,e,n){const r=OS(e,n);if(!r)return!1;if("binned"===r){const n=t["x2"===e?"x":"y"];return!!(Fz(n)&&Fz(t[e])&&DS(n.bin))}return!0}(t,o,e))return aC(HS(o,e)),i;if("size"===o&&"line"===e){const e=eT(t[o]);if(null==e?void 0:e.aggregate)return aC("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead."),i}if(o===LM&&(n?"fill"in t:"stroke"in t))return aC(WS("encoding",{fill:"fill"in t,stroke:"stroke"in t})),i;if("detail"===o||"order"===o&&!Object(Z.B)(a)&&!Bz(a)||"tooltip"===o&&Object(Z.B)(a))a&&(i[o]=Object(Z.i)(a).reduce((t,e)=>(Fz(e)?t.push(oT(e,o)):aC(YS(e,o)),t),[]));else{if("tooltip"===o&&null===a)i[o]=null;else if(!(Fz(a)||Tz(a)||Bz(a)||Mz(a)||wC(a)))return aC(YS(a,o)),i;i[o]=rT(a,o,r)}return i},{})}function $T(t,e){const n={};for(const r of XD(t)){const i=rT(t[r],r,e,{compositeMark:!0});n[r]=i}return n}function NT(t,e,n){if(t)for(const r of XD(t)){const i=t[r];if(Object(Z.B)(i))for(const t of i)e.call(n,t,r);else e.call(n,i,r)}}function RT(t,e){return XD(e).reduce((n,r)=>{switch(r){case"x":case"y":case"href":case"description":case"url":case"x2":case"y2":case PM:case BM:case RM:case"radius2":case"latitude":case"longitude":case"latitude2":case"longitude2":case"text":case qM:case"angle":case"tooltip":return n;case"order":if("line"===t||"trail"===t)return n;case"detail":case"key":{const t=e[r];if(Object(Z.B)(t)||Fz(t))for(const e of Object(Z.i)(t))e.aggregate||n.push(Yz(e,{}));return n}case"size":if("trail"===t)return n;case LM:case IM:case UM:case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeDash":case"strokeWidth":{const t=eT(e[r]);return t&&!t.aggregate&&n.push(Yz(t,{})),n}}},[])}function PT(t,e,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...t.map(({fieldPrefix:t,titlePrefix:n})=>{const i=r?" of "+BT(e):"";return{field:t+e.field,type:e.type,title:wC(n)?{signal:n+`"${escape(i)}"`}:n+i}}),...UD(function(t){const e=[];for(const n of XD(t))if(CT(t,n)){const r=t[n],i=Object(Z.i)(r);for(const t of i)Fz(t)?e.push(t):Sz(t)&&e.push(t.condition)}return e}(n).map(Wz),$D)]}}function BT(t){const{title:e,field:n}=t;return cM(e,n)}function LT(t,e,n,r,i){const{scale:o,axis:a}=n;return({partName:s,mark:u,positionPrefix:l,endPositionPrefix:c,extraEncoding:f={}})=>{const d=BT(n);return IT(t,s,i,{mark:u,encoding:Object.assign(Object.assign(Object.assign({[e]:Object.assign(Object.assign(Object.assign({field:l+"_"+n.field,type:n.type},void 0!==d?{title:d}:{}),void 0!==o?{scale:o}:{}),void 0!==a?{axis:a}:{})},Object(Z.I)(c)?{[e+"2"]:{field:c+"_"+n.field}}:{}),r),f)})}}function IT(t,e,n,r){const{clip:i,color:o,opacity:a}=t,s=t.type;return t[e]||void 0===t[e]&&n[e]?[Object.assign(Object.assign({},r),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[e]),i?{clip:i}:{}),o?{color:o}:{}),a?{opacity:a}:{}),WF(r.mark)?r.mark:{type:r.mark}),{style:`${s}-${e}`}),Object(Z.C)(t[e])?{}:t[e])})]:[]}function UT(t,e,n){const{encoding:r}=t,i="vertical"===e?"y":"x",o=r[i],a=r[i+"2"],s=r[i+"Error"],u=r[i+"Error2"];return{continuousAxisChannelDef:qT(o,n),continuousAxisChannelDef2:qT(a,n),continuousAxisChannelDefError:qT(s,n),continuousAxisChannelDefError2:qT(u,n),continuousAxis:i}}function qT(t,e){if(t&&t.aggregate){const{aggregate:n}=t,r=bD(t,["aggregate"]);return n!==e&&aC(function(t,e){return`Continuous axis should not have customized aggregation function ${t}; ${e} already agregates the axis.`}(n,e)),r}return t}function WT(t,e){const{mark:n,encoding:r}=t,{x:i,y:o}=r;if(WF(n)&&n.orient)return n.orient;if($z(i)){if($z(o)){const t=Fz(i)&&i.aggregate,n=Fz(o)&&o.aggregate;if(t||n!==e){if(n||t!==e){if(t===e&&n===e)throw new Error("Both x and y cannot have aggregate");return uT(o)&&!uT(i)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if($z(o))return"vertical";throw new Error(`Need a valid continuous axis for ${e}s`)}const YT=new ST("boxplot",GT);function HT(t){return Object(Z.F)(t)?"tukey":t}function GT(t,{config:e}){var n,r;t=Object.assign(Object.assign({},t),{encoding:$T(t.encoding,e)});const{mark:i,encoding:o,selection:a,projection:s}=t,u=bD(t,["mark","encoding","selection","projection"]),l=WF(i)?i:{type:i};a&&aC(BS("boxplot"));const c=null!==(n=l.extent)&&void 0!==n?n:e.boxplot.extent,f=_T("size",l,e),d=HT(c),{bins:h,timeUnits:p,transform:g,continuousAxisChannelDef:m,continuousAxis:b,groupby:y,aggregate:v,encodingWithoutContinuousAxis:x,ticksOrient:_,boxOrient:O,customTooltipWithoutAggregatedField:w}=function(t,e,n){const r=WT(t,"boxplot"),{continuousAxisChannelDef:i,continuousAxis:o}=UT(t,r,"boxplot"),a=i.field,s=HT(e),u=[...VT(a),{op:"median",field:a,as:"mid_box_"+a},{op:"min",field:a,as:("min-max"===s?"lower_whisker_":"min_")+a},{op:"max",field:a,as:("min-max"===s?"upper_whisker_":"max_")+a}],l="min-max"===s||"tukey"===s?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:"iqr_"+a},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${e}, datum["max_${a}"])`,as:"upper_whisker_"+a},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${e}, datum["min_${a}"])`,as:"lower_whisker_"+a}],c=t.encoding,f=o,d=(c[f],bD(c,["symbol"==typeof f?f:f+""])),{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=function(t){const{tooltip:e}=t,n=bD(t,["tooltip"]);if(!e)return{filteredEncoding:n};let r,i;if(Object(Z.B)(e)){for(const t of e)t.aggregate?(r||(r=[]),r.push(t)):(i||(i=[]),i.push(t));r&&(n.tooltip=r)}else e.aggregate?n.tooltip=e:i=e;return Object(Z.B)(i)&&1===i.length&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}(d),{bins:g,timeUnits:m,aggregate:b,groupby:y,encoding:v}=zT(p,n),x="vertical"===r?"horizontal":"vertical",_=r,O=[...g,...m,{aggregate:[...b,...u],groupby:y},...l];return{bins:g,timeUnits:m,transform:O,groupby:y,aggregate:b,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:h}}(t,c,e),{color:j,size:k}=x,E=bD(x,["color","size"]),A=t=>LT(l,b,m,t,e.boxplot),D=A(E),M=A(x),S=A(Object.assign(Object.assign({},E),k?{size:k}:{})),C=PT([{fieldPrefix:"min-max"===d?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===d?"lower_whisker_":"min_",titlePrefix:"Min"}],m,x),F={type:"tick",color:"black",opacity:1,orient:_,invalid:null,aria:!1},z="min-max"===d?C:PT([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,x),T=[...D({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:z}),...D({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:z}),...D({partName:"ticks",mark:F,positionPrefix:"lower_whisker",extraEncoding:z}),...D({partName:"ticks",mark:F,positionPrefix:"upper_whisker",extraEncoding:z})],$=[..."tukey"!==d?T:[],...M({partName:"box",mark:Object.assign(Object.assign({type:"bar"},f?{size:f}:{}),{orient:O,invalid:null,ariaRoleDescription:"box"}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:C}),...S({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},Object(Z.G)(e.boxplot.median)&&e.boxplot.median.color?{color:e.boxplot.median.color}:{}),f?{size:f}:{}),{orient:_,aria:!1}),positionPrefix:"mid_box",extraEncoding:C})];if("min-max"===d)return Object.assign(Object.assign({},u),{transform:(null!==(r=u.transform)&&void 0!==r?r:[]).concat(g),layer:$});const N=`datum["lower_box_${m.field}"]`,R=`datum["upper_box_${m.field}"]`,P=`(${R} - ${N})`,B=`${N} - ${c} * ${P}`,L=`${R} + ${c} * ${P}`,I=`datum["${m.field}"]`,U={joinaggregate:VT(m.field),groupby:y},q={transform:[{filter:`(${B} <= ${I}) && (${I} <= ${L})`},{aggregate:[{op:"min",field:m.field,as:"lower_whisker_"+m.field},{op:"max",field:m.field,as:"upper_whisker_"+m.field},{op:"min",field:"lower_box_"+m.field,as:"lower_box_"+m.field},{op:"max",field:"upper_box_"+m.field,as:"upper_box_"+m.field},...v],groupby:y}],layer:T},W=bD(E,["tooltip"]),{scale:Y,axis:H}=m,G=BT(m),V=zD(H,["title"]),X=IT(l,"outliers",e.boxplot,{transform:[{filter:`(${I} < ${B}) || (${I} > ${L})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[b]:Object.assign(Object.assign(Object.assign({field:m.field,type:m.type},void 0!==G?{title:G}:{}),void 0!==Y?{scale:Y}:{}),VD(V)?{}:{axis:V})},W),j?{color:j}:{}),w?{tooltip:w}:{})})[0];let J;const K=[...h,...p,U];return X?J={transform:K,layer:[X,q]}:(J=q,J.transform.unshift(...K)),Object.assign(Object.assign({},u),{layer:[J,{transform:g,layer:$}]})}function VT(t){return[{op:"q1",field:t,as:"lower_box_"+t},{op:"q3",field:t,as:"upper_box_"+t}]}const XT=new ST("errorbar",JT);function JT(t,{config:e}){t=Object.assign(Object.assign({},t),{encoding:$T(t.encoding,e)});const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:a,markDef:s,outerSpec:u,tooltipEncoding:l}=ZT(t,"errorbar",e);delete o.size;const c=LT(s,i,r,o,e.errorbar),f=s.thickness,d=s.size,h=Object.assign(Object.assign({type:"tick",orient:a,aria:!1},void 0!==f?{thickness:f}:{}),void 0!==d?{size:d}:{}),p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:Object.assign({type:"rule",ariaRoleDescription:"errorbar"},void 0!==f?{size:f}:{}),positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return Object.assign(Object.assign(Object.assign({},u),{transform:n}),p.length>1?{layer:p}:Object.assign({},p[0]))}function KT(t,e){const{encoding:n}=t;if(function(t){return(Rz(t.x)||Rz(t.y))&&!Rz(t.x2)&&!Rz(t.y2)&&!Rz(t.xError)&&!Rz(t.xError2)&&!Rz(t.yError)&&!Rz(t.yError2)}(n))return{orient:WT(t,e),inputType:"raw"};const r=function(t){return Rz(t.x2)||Rz(t.y2)}(n),i=function(t){return Rz(t.xError)||Rz(t.xError2)||Rz(t.yError)||Rz(t.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error(e+" cannot be both type aggregated-upper-lower and aggregated-error");const t=n.x2,r=n.y2;if(Rz(t)&&Rz(r))throw new Error(e+" cannot have both x2 and y2");if(Rz(t)){if($z(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in "+e)}if(Rz(r)){if($z(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error("Both y and y2 have to be quantitative in "+e)}throw new Error("No ranged axis")}{const t=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(Rz(r)&&!Rz(t))throw new Error(e+" cannot have xError2 without xError");if(Rz(s)&&!Rz(i))throw new Error(e+" cannot have yError2 without yError");if(Rz(t)&&Rz(i))throw new Error(e+" cannot have both xError and yError with both are quantiative");if(Rz(t)){if($z(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Rz(i)){if($z(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function ZT(t,e,n){var r;const{mark:i,encoding:o,selection:a,projection:s}=t,u=bD(t,["mark","encoding","selection","projection"]),l=WF(i)?i:{type:i};a&&aC(BS(e));const{orient:c,inputType:f}=KT(t,e),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:g,continuousAxis:m}=UT(t,c,e),{errorBarSpecificAggregate:b,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:x}=function(t,e,n,r,i,o,a,s){let u=[],l=[];const c=e.field;let f,d=!1;if("raw"===o){const e=t.center?t.center:t.extent?"iqr"===t.extent?"median":"mean":s.errorbar.center,n=t.extent?t.extent:"mean"===e?"stderr":"iqr";if("median"===e!=("iqr"===n)&&aC(function(t,e,n){return`${t} is not usually used with ${e} for ${n}.`}(e,n,a)),"stderr"===n||"stdev"===n)u=[{op:n,field:c,as:"extent_"+c},{op:e,field:c,as:"center_"+c}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:"upper_"+c},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:"lower_"+c}],f=[{fieldPrefix:"center_",titlePrefix:nM(e)},{fieldPrefix:"upper_",titlePrefix:QT(e,n,"+")},{fieldPrefix:"lower_",titlePrefix:QT(e,n,"-")}],d=!0;else{let t,e,r;"ci"===n?(t="mean",e="ci0",r="ci1"):(t="median",e="q1",r="q3"),u=[{op:e,field:c,as:"lower_"+c},{op:r,field:c,as:"upper_"+c},{op:t,field:c,as:"center_"+c}],f=[{fieldPrefix:"upper_",titlePrefix:Kz({field:c,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Kz({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Kz({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&aC((h=t.center,`${(p=t.extent)?"extent ":""}${p&&h?"and ":""}${h?"center ":""}${p&&h?"are ":"is "}not needed when data are aggregated.`)),"aggregated-upper-lower"===o?(f=[],l=[{calculate:`datum["${n.field}"]`,as:"upper_"+c},{calculate:`datum["${c}"]`,as:"lower_"+c}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${r.field}"]`,as:"upper_"+c}],i?l.push({calculate:`datum["${c}"] + datum["${i.field}"]`,as:"lower_"+c}):l.push({calculate:`datum["${c}"] - datum["${r.field}"]`,as:"lower_"+c}));for(const t of l)f.push({fieldPrefix:t.as.substring(0,6),titlePrefix:sM(sM(t.calculate,'datum["',""),'"]',"")})}var h,p;return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,d,h,p,g,f,e,n),_=o,O=m,w=(_[O],"x"===m?"x2":"y2"),j=(_[w],"x"===m?"xError":"yError"),k=(_[j],"x"===m?"xError2":"yError2"),E=(_[k],bD(_,["symbol"==typeof O?O:O+"","symbol"==typeof w?w:w+"","symbol"==typeof j?j:j+"","symbol"==typeof k?k:k+""])),{bins:A,timeUnits:D,aggregate:M,groupby:S,encoding:C}=zT(E,n),F=[...M,...b],z="raw"!==f?[]:S,T=PT(v,d,C,x);return{transform:[...null!==(r=u.transform)&&void 0!==r?r:[],...A,...D,...0===F.length?[]:[{aggregate:F,groupby:z}],...y],groupby:z,continuousAxisChannelDef:d,continuousAxis:m,encodingWithoutContinuousAxis:C,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:l,outerSpec:u,tooltipEncoding:T}}function QT(t,e,n){return nM(t)+" "+n+" "+e}const t$=new ST("errorband",e$);function e$(t,{config:e}){t=Object.assign(Object.assign({},t),{encoding:$T(t.encoding,e)});const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=ZT(t,"errorband",e),l=a,c=LT(l,i,r,o,e.errorband),f=void 0!==t.encoding.x&&void 0!==t.encoding.y;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p=Object.assign(Object.assign({},l.interpolate?{interpolate:l.interpolate}:{}),l.tension&&l.interpolate?{tension:l.tension}:{});return f?(d=Object.assign(Object.assign(Object.assign({},d),p),{ariaRoleDescription:"errorband"}),h=Object.assign(Object.assign(Object.assign({},h),p),{aria:!1})):l.interpolate?aC(nC("interpolate")):l.tension&&aC(nC("tension")),Object.assign(Object.assign({},s),{transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]})}const n$={};function r$(t,e,n){const r=new ST(t,e);n$[t]={normalizer:r,parts:n}}r$("boxplot",GT,["box","median","outliers","rule","ticks"]),r$("errorbar",JT,["ticks","rule"]),r$("errorband",e$,["band","borders"]);const i$=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],o$={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},a$={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},s$=XD(o$),u$=XD(a$),l$=XD({header:1,headerRow:1,headerColumn:1,headerFacet:1}),c$=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"];function f$(t){const e=[];for(const n of t||[]){const{expr:t,bind:r}=n,i=bD(n,["expr","bind"]);if(r&&t){const n=Object.assign(Object.assign({},i),{bind:r,init:t});e.push(n)}else{const n=Object.assign(Object.assign(Object.assign({},i),t?{update:t}:{}),r?{bind:r}:{});e.push(n)}}return e}const d$={single:{on:"click",fields:["_vgsid_"],resolve:"global",empty:"all",clear:"dblclick"},multi:{on:"click",fields:["_vgsid_"],toggle:"event.shiftKey",resolve:"global",empty:"all",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function h$(t){return!(!t||"legend"!==t&&!t.legend)}function p$(t){return h$(t)&&Object(Z.G)(t)}function g$(t){return"concat"in t}function m$(t){return"vconcat"in t}function b$(t){return"hconcat"in t}function y$(t){return Object(Z.G)(t)&&void 0!==t.step}function v$(t){return t.view||t.width||t.height}const x$=XD({align:1,bounds:1,center:1,columns:1,spacing:1});function _$(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t["width"===e?"continuousWidth":"continuousHeight"]}function O$(t,e){const n=w$(t,e);return y$(n)?n.step:j$}function w$(t,e){var n;return cM(null!==(n=t[e])&&void 0!==n?n:t["width"===e?"discreteWidth":"discreteHeight"],{step:t.step})}const j$=20,k$={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:j$},mark:{color:"#4c78a8",invalid:"filter",timeUnitBand:1},arc:{},area:{},bar:XF,circle:{},geoshape:{},image:{},line:{},point:{},rect:JF,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:d$,style:{},title:{},facet:{spacing:20},concat:{spacing:20}},E$=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],A$={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},D$={blue:E$[0],orange:E$[1],red:E$[2],teal:E$[3],green:E$[4],yellow:E$[5],purple:E$[6],pink:E$[7],brown:E$[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function M$(t){const e=XD(t||{}),n={};for(const r of e){const e=t[r];n[r]=vM(e)?pT(e):gT(e)}return n}const S$=[...GF,...kM,...l$,"background","padding","legend","lineBreak","scale","style","title","view"];function C$(t={}){const{color:e,font:n,fontSize:r}=t,i=bD(t,["color","font","fontSize"]),o=Object(Z.O)({},k$,n?function(t){return{text:{font:t},style:{"guide-label":{font:t},"guide-title":{font:t},"group-title":{font:t},"group-subtitle":{font:t}}}}(n):{},e?function(t={}){return{signals:[{name:"color",value:Object(Z.G)(t)?Object.assign(Object.assign({},D$),t):D$}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}(e):{},r?function(t){return{signals:[{name:"fontSize",value:Object(Z.G)(t)?Object.assign(Object.assign({},A$),t):A$}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}(r):{},i||{}),a=zD(o,S$);for(const t of["background","lineBreak","padding"])o[t]&&(a[t]=gT(o[t]));for(const t of GF)o[t]&&(a[t]=kF(o[t]));for(const t of kM)o[t]&&(a[t]=M$(o[t]));for(const t of l$)o[t]&&(a[t]=kF(o[t]));return o.legend&&(a.legend=kF(o.legend)),o.scale&&(a.scale=kF(o.scale)),o.style&&(a.style=function(t){const e=XD(t),n={};for(const r of e)n[r]=M$(t[r]);return n}(o.style)),o.title&&(a.title=kF(o.title)),o.view&&(a.view=kF(o.view)),a}const F$=["view",...qF],z$=["color","fontSize","background","padding","facet","concat","numberFormat","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],T$=Object.assign({view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"]},{area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]});function $$(t){t=CD(t);for(const e of z$)delete t[e];if(t.axis)for(const e in t.axis)vM(t.axis[e])&&delete t.axis[e];if(t.legend)for(const e of i$)delete t.legend[e];if(t.mark){for(const e of HF)delete t.mark[e];t.mark.tooltip&&Object(Z.G)(t.mark.tooltip)&&delete t.mark.tooltip}t.params&&(t.signals=(t.signals||[]).concat(f$(t.params)),delete t.params);for(const e of F$){for(const n of HF)delete t[e][n];const n=T$[e];if(n)for(const r of n)delete t[e][r];N$(t,e)}for(const e of XD(n$))delete t[e];!function(t){const{titleMarkConfig:e,subtitleMarkConfig:n,subtitle:r}=dT(t.title);VD(e)||(t.style["group-title"]=Object.assign(Object.assign({},t.style["group-title"]),e));VD(n)||(t.style["group-subtitle"]=Object.assign(Object.assign({},t.style["group-subtitle"]),n));VD(r)?delete t.title:t.title=r}(t);for(const e in t)Object(Z.G)(t[e])&&VD(t[e])&&delete t[e];return VD(t)?void 0:t}function N$(t,e,n,r){const i=r?t[e][r]:t[e];"view"===e&&(n="cell");const o=Object.assign(Object.assign({},i),t.style[null!=n?n:e]);VD(o)||(t.style[null!=n?n:e]=o),r||delete t[e]}function R$(t){return"layer"in t}const P$={zero:1,center:1,normalize:1};const B$=new Set([AF,MF,DF,TF,FF,PF,BF,CF,$F,NF]),L$=new Set([MF,DF,AF]);function I$(t,e){var n,r;const i="x"===e?"y":"radius",o=t[e],a=t[i];if(Fz(o)&&Fz(a))if("quantitative"===zz(o)&&"quantitative"===zz(a)){if(o.stack)return e;if(a.stack)return i;const t=Fz(o)&&!!o.aggregate;if(t!==(Fz(a)&&!!a.aggregate))return t?e:i;{const t=null===(n=o.scale)||void 0===n?void 0:n.type,s=null===(r=a.scale)||void 0===r?void 0:r.type;if(t&&"linear"!==t)return i;if(s&&"linear"!==s)return e}}else{if("quantitative"===zz(o))return e;if("quantitative"===zz(a))return i}else{if("quantitative"===zz(o))return e;if("quantitative"===zz(a))return i}}function U$(t,e,n={}){const r=WF(t)?t.type:t;if(!B$.has(r))return null;const i=I$(e,"x")||I$(e,"theta");if(!i)return null;const o=e[i],a=Fz(o)?Yz(o,{}):void 0;let s=function(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(i),u=e[s],l=Fz(u)?Yz(u,{}):void 0;l===a&&(l=void 0,u=void 0,s=void 0);const c=cS.reduce((t,n)=>{if("tooltip"!==n&&CT(e,n)){const r=e[n];for(const e of Object(Z.i)(r)){const r=eT(e);if(r.aggregate)continue;const i=Yz(r,{});i&&i===l||t.push({channel:n,fieldDef:r})}}return t},[]);let f;if(void 0!==o.stack?f=Object(Z.C)(o.stack)?o.stack?"zero":null:o.stack:c.length>0&&L$.has(r)&&(f="zero"),!f||!(f in P$))return null;var d;if(FT(e)&&0===c.length)return null;if(o.scale&&o.scale.type&&o.scale.type!==HC){if(n.disallowNonLinearStack)return null;aC(`Cannot stack non-linear scale (${o.scale.type}).`)}return Rz(e[sS(i)])?(void 0!==o.stack&&aC(`Cannot stack "${d=i}" if there is already "${d}2".`),null):(Fz(o)&&o.aggregate&&!RD(zM,o.aggregate)&&aC(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannel:u?s:void 0,groupbyField:l,fieldChannel:i,impute:null!==o.impute&&IF(r),stackBy:c,offset:f})}function q$(t){const e=bD(t,["point","line"]);return XD(e).length>1?e:e.type}function W$(t){for(const e of["line","area","rule","trail"])t[e]&&(t=Object.assign(Object.assign({},t),{[e]:zD(t[e],["point","line"])}));return t}function Y$(t,e={},n){return"transparent"===t.point?{opacity:0}:t.point?Object(Z.G)(t.point)?t.point:{}:void 0!==t.point?null:e.point||n.shape?Object(Z.G)(e.point)?e.point:{}:void 0}function H$(t,e={}){return t.line?!0===t.line?{}:t.line:void 0!==t.line?null:e.line?!0===e.line?{}:e.line:void 0}class G${constructor(){this.name="path-overlay"}hasMatchingType(t,e){if(MT(t)){const{mark:n,encoding:r}=t,i=WF(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!Y$(i,e[i.type],r);case"area":return!!Y$(i,e[i.type],r)||!!H$(i,e[i.type])}}return!1}run(t,e,n){const{config:r}=e,{selection:i,projection:o,mark:a,encoding:s}=t,u=bD(t,["selection","projection","mark","encoding"]),l=$T(s,r),c=WF(a)?a:{type:a},f=Y$(c,r[c.type],l),d="area"===c.type&&H$(c,r[c.type]),h=[Object.assign(Object.assign({},i?{selection:i}:{}),{mark:q$(Object.assign(Object.assign({},"area"===c.type&&void 0===c.opacity&&void 0===c.fillOpacity?{opacity:.7}:{}),c)),encoding:zD(l,["shape"])})],p=U$(c,l);let g=l;if(p){const{fieldChannel:t,offset:e}=p;g=Object.assign(Object.assign({},l),{[t]:Object.assign(Object.assign({},l[t]),e?{stack:e}:{})})}return d&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"line"},FD(c,["clip","interpolate","tension","tooltip"])),d),encoding:g})),f&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},FD(c,["clip","tooltip"])),f),encoding:g})),n(Object.assign(Object.assign({},u),{layer:h}),Object.assign(Object.assign({},e),{config:W$(r)}))}}class V${constructor(){this.name="RangeStep"}hasMatchingType(t){var e;if(MT(t)&&t.encoding)for(const n of dS){const r=t.encoding[n];if(r&&Rz(r)&&(null===(e=null==r?void 0:r.scale)||void 0===e?void 0:e.rangeStep))return!0}return!1}run(t){var e;const n={};let r=Object.assign({},t.encoding);for(const t of dS){const i=uS(t),o=r[t];if(o&&Rz(o)&&(null===(e=null==o?void 0:o.scale)||void 0===e?void 0:e.rangeStep)){const{scale:e}=o,a=bD(o,["scale"]),s=bD(e,["rangeStep"]);n[i]={step:e.rangeStep},aC('Scale\'s "rangeStep" is deprecated and will be removed in Vega-Lite 5.0. Please use "width"/"height": {"step": ...} instead. See https://vega.github.io/vega-lite/docs/size.html.'),r=Object.assign(Object.assign({},r),{[t]:Object.assign(Object.assign({},a),VD(s)?{}:{scale:s})})}}return Object.assign(Object.assign(Object.assign({},n),t),{encoding:r})}}function X$(t,e){return e?Oz(t)?eN(t,e):Z$(t,e):t}function J$(t,e){return e?eN(t,e):t}function K$(t,e,n){const r=e[t];return(i=r)&&!Object(Z.I)(i)&&"repeat"in i?r.repeat in n?Object.assign(Object.assign({},e),{[t]:n[r.repeat]}):void aC(function(t){return`Unknown repeated value "${t}".`}(r.repeat)):e;var i}function Z$(t,e){if(void 0!==(t=K$("field",t,e))){if(null===t)return null;if(Ez(t)&&xz(t.sort)){const n=K$("field",t.sort,e);t=Object.assign(Object.assign({},t),n?{sort:n}:{})}return t}}function Q$(t,e){if(Fz(t))return Z$(t,e);{const n=K$("datum",t,e);return n===t||n.type||(n.type="nominal"),n}}function tN(t,e){if(!Rz(t)){if(Cz(t)){const n=Q$(t.condition,e);if(n)return Object.assign(Object.assign({},t),{condition:n});return bD(t,["condition"])}return t}{const n=Q$(t,e);if(n)return n;if(Mz(t))return{condition:t.condition}}}function eN(t,e){const n={};for(const r in t)if(Object(Z.w)(t,r)){const i=t[r];if(Object(Z.B)(i))n[r]=i.map(t=>tN(t,e)).filter(t=>t);else{const t=tN(i,e);void 0!==t&&(n[r]=t)}}return n}class nN{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(MT(t)){const{encoding:e,mark:n}=t;if("line"===n)for(const t of rS){const n=e[oS(t)];if(e[t]&&(Fz(n)&&!DS(n.bin)||Tz(n)))return!0}}return!1}run(t,e,n){const{encoding:r}=t;var i,o;return aC((i=!!r.x2,o=!!r.y2,`Line mark is for continuous lines and thus cannot be used with ${i&&o?"x2 and y2":i?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n(Object.assign(Object.assign({},t),{mark:"rule"}),e)}}function rN({parentEncoding:t,encoding:e={},layer:n}){let r={};if(t){const i=new Set([...XD(t),...XD(e)]);for(const o of i){const i=e[o],a=t[o];if(Rz(i)){const t=Object.assign(Object.assign({},a),i);r[o]=t}else Cz(i)?r[o]=Object.assign(Object.assign({},i),{condition:Object.assign(Object.assign({},a),i.condition)}):i||null===i?r[o]=i:(n||Bz(a)||wC(a)||Rz(a)||Object(Z.B)(a))&&(r[o]=a)}}else r=e;return!r||VD(r)?void 0:r}function iN(t){const{parentProjection:e,projection:n}=t;return e&&n&&aC(function(t){const{parentProjection:e,projection:n}=t;return`Layer's shared projection ${TD(e)} is overridden by a child projection ${TD(n)}.`}({parentProjection:e,projection:n})),null!=n?n:e}function oN(t,e){void 0===e&&(e=C$(t.config));const n=function(t,e={}){return aN.map(t,{config:e})}(t,e),{width:r,height:i}=t,o=function(t,e,n){let{width:r,height:i}=e;const o=MT(t)||R$(t),a={};o?"container"==r&&"container"==i?(a.type="fit",a.contains="padding"):"container"==r?(a.type="fit-x",a.contains="padding"):"container"==i&&(a.type="fit-y",a.contains="padding"):("container"==r&&(aC(zS("width")),r=void 0),"container"==i&&(aC(zS("height")),i=void 0));const s=Object.assign(Object.assign(Object.assign({type:"pad"},a),n?sN(n.autosize):{}),sN(t.autosize));"fit"!==s.type||o||(aC('Autosize "fit" only works for single views and layered views.'),s.type="pad");"container"==r&&"fit"!=s.type&&"fit-x"!=s.type&&aC(TS("width"));"container"==i&&"fit"!=s.type&&"fit-y"!=s.type&&aC(TS("height"));if(SD(s,{type:"pad"}))return;return s}(n,{width:r,height:i,autosize:t.autosize},e);return Object.assign(Object.assign({},n),o?{autosize:o}:{})}const aN=new class extends class{map(t,e){return jz(t)?this.mapFacet(t,e):function(t){return"repeat"in t}(t)?this.mapRepeat(t,e):b$(t)?this.mapHConcat(t,e):m$(t)?this.mapVConcat(t,e):g$(t)?this.mapConcat(t,e):this.mapLayerOrUnit(t,e)}mapLayerOrUnit(t,e){if(R$(t))return this.mapLayer(t,e);if(MT(t))return this.mapUnit(t,e);throw new Error(FS(t))}mapLayer(t,e){return Object.assign(Object.assign({},t),{layer:t.layer.map(t=>this.mapLayerOrUnit(t,e))})}mapHConcat(t,e){return Object.assign(Object.assign({},t),{hconcat:t.hconcat.map(t=>this.map(t,e))})}mapVConcat(t,e){return Object.assign(Object.assign({},t),{vconcat:t.vconcat.map(t=>this.map(t,e))})}mapConcat(t,e){const{concat:n}=t,r=bD(t,["concat"]);return Object.assign(Object.assign({},r),{concat:n.map(t=>this.map(t,e))})}mapFacet(t,e){return Object.assign(Object.assign({},t),{spec:this.map(t.spec,e)})}mapRepeat(t,e){return Object.assign(Object.assign({},t),{spec:this.map(t.spec,e)})}}{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[YT,XT,t$,new G$,new nN,new V$]}map(t,e){if(MT(t)){const n=CT(t.encoding,$M),r=CT(t.encoding,NM),i=CT(t.encoding,"facet");if(n||r||i)return this.mapFacetedUnit(t,e)}return super.map(t,e)}mapUnit(t,e){const{parentEncoding:n,parentProjection:r}=e,i=J$(t.encoding,e.repeater),o=Object.assign(Object.assign({},t),i?{encoding:i}:{});if(n||r)return this.mapUnitWithParentEncodingOrProjection(o,e);const a=this.mapLayerOrUnit.bind(this);for(const t of this.nonFacetUnitNormalizers)if(t.hasMatchingType(o,e.config))return t.run(o,e,a);return o}mapRepeat(t,e){return function(t){return!Object(Z.B)(t.repeat)&&t.repeat.layer}(t)?this.mapLayerRepeat(t,e):this.mapNonLayerRepeat(t,e)}mapLayerRepeat(t,e){const{repeat:n,spec:r}=t,i=bD(t,["repeat","spec"]),{row:o,column:a,layer:s}=n,{repeater:u={},repeaterPrefix:l=""}=e;return o||a?this.mapRepeat(Object.assign(Object.assign({},t),{repeat:Object.assign(Object.assign({},o?{row:o}:{}),a?{column:a}:{}),spec:{repeat:{layer:s},spec:r}}),e):Object.assign(Object.assign({},i),{layer:s.map(t=>{const n=Object.assign(Object.assign({},u),{layer:t}),i=(r.name||"")+l+"child__layer_"+QD(t),o=this.mapLayerOrUnit(r,Object.assign(Object.assign({},e),{repeater:n,repeaterPrefix:i}));return o.name=i,o})})}mapNonLayerRepeat(t,e){var n;const{repeat:r,spec:i,data:o}=t,a=bD(t,["repeat","spec","data"]);!Object(Z.B)(r)&&t.columns&&(t=zD(t,["columns"]),aC(LS("repeat")));const s=[],{repeater:u={},repeaterPrefix:l=""}=e,c=!Object(Z.B)(r)&&r.row||[u?u.row:null],f=!Object(Z.B)(r)&&r.column||[u?u.column:null],d=Object(Z.B)(r)&&r||[u?u.repeat:null];for(const t of d)for(const n of c)for(const o of f){const a={repeat:t,row:n,column:o,layer:u.layer},c=(i.name||"")+l+"child__"+(Object(Z.B)(r)?""+QD(t):(r.row?"row_"+QD(n):"")+(r.column?"column_"+QD(o):"")),f=this.map(i,Object.assign(Object.assign({},e),{repeater:a,repeaterPrefix:c}));f.name=c,s.push(zD(f,["data"]))}const h=Object(Z.B)(r)?t.columns:r.column?r.column.length:1;return Object.assign(Object.assign({data:null!==(n=i.data)&&void 0!==n?n:o,align:"all"},a),{columns:h,concat:s})}mapFacet(t,e){const{facet:n}=t;return Oz(n)&&t.columns&&(t=zD(t,["columns"]),aC(LS("facet"))),super.mapFacet(t,e)}mapUnitWithParentEncodingOrProjection(t,e){const{encoding:n,projection:r}=t,{parentEncoding:i,parentProjection:o,config:a}=e,s=iN({parentProjection:o,projection:r}),u=rN({parentEncoding:i,encoding:J$(n,e.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},t),s?{projection:s}:{}),u?{encoding:u}:{}),{config:a})}mapFacetedUnit(t,e){const n=t.encoding,{row:r,column:i,facet:o}=n,a=bD(n,["row","column","facet"]),{mark:s,width:u,projection:l,height:c,view:f,selection:d,encoding:h}=t,p=bD(t,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},e),b=J$(a,e.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},p),m),{facet:g,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u?{width:u}:{}),c?{height:c}:{}),f?{view:f}:{}),l?{projection:l}:{}),{mark:s,encoding:b}),d?{selection:d}:{})}),e)}getFacetMappingAndLayout(t,e){var n;const{row:r,column:i,facet:o}=t;if(r||i){o&&aC(`Facet encoding dropped as ${(a=[...r?[$M]:[],...i?[NM]:[]]).join(" and ")} ${a.length>1?"are":"is"} also specified.`);const e={},s={};for(const r of[$M,NM]){const i=t[r];if(i){const t=bD(i,["align","center","spacing","columns"]);e[r]=t;for(const t of["align","center","spacing"])void 0!==i[t]&&(s[t]=null!==(n=s[t])&&void 0!==n?n:{},s[t][r]=i[t])}}return{facetMapping:e,layout:s}}{const{align:t,center:n,spacing:r,columns:i}=o;return{facetMapping:X$(bD(o,["align","center","spacing","columns"]),e.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},t?{align:t}:{}),n?{center:n}:{}),r?{spacing:r}:{}),i?{columns:i}:{})}}var a}mapLayer(t,e){var{parentEncoding:n,parentProjection:r}=e,i=bD(e,["parentEncoding","parentProjection"]);const{encoding:o,projection:a}=t,s=bD(t,["encoding","projection"]),u=Object.assign(Object.assign({},i),{parentEncoding:rN({parentEncoding:n,encoding:o,layer:!0}),parentProjection:iN({parentProjection:r,projection:a})});return super.mapLayer(s,u)}};function sN(t){return Object(Z.I)(t)?{type:t}:null!=t?t:{}}const uN=["background","padding"];function lN(t,e){const n={};for(const e of uN)t&&void 0!==t[e]&&(n[e]=gT(t[e]));return e&&(n.params=t.params),n}class cN{constructor(t={},e={}){this.explicit=t,this.implicit=e}clone(){return new cN(CD(this.explicit),CD(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(t){return cM(this.explicit[t],this.implicit[t])}getWithExplicit(t){return void 0!==this.explicit[t]?{explicit:!0,value:this.explicit[t]}:void 0!==this.implicit[t]?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,e){void 0!==e.value&&this.set(t,e.value,e.explicit)}set(t,e,n){return delete this[n?"implicit":"explicit"][t],this[n?"explicit":"implicit"][t]=e,this}copyKeyFromSplit(t,e){void 0!==e.explicit[t]?this.set(t,e.explicit[t],!0):void 0!==e.implicit[t]&&this.set(t,e.implicit[t],!1)}copyKeyFromObject(t,e){void 0!==e[t]&&this.set(t,e[t],!0)}copyAll(t){for(const e of XD(t.combine())){const n=t.getWithExplicit(e);this.setWithExplicit(e,n)}}}function fN(t){return{explicit:!0,value:t}}function dN(t){return{explicit:!1,value:t}}function hN(t){return(e,n,r,i)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:pN(e,n,r,i)}}function pN(t,e,n,r){return t.explicit&&e.explicit&&aC(function(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${TD(n)} and ${TD(r)}). Using ${TD(n)}.`}(n,r,t.value,e.value)),t}function gN(t,e,n,r,i=pN){return void 0===t||void 0===t.value?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:SD(t.value,e.value)?t:i(t,e,n,r)}class mN extends cN{constructor(t={},e={},n=!1){super(t,e),this.explicit=t,this.implicit=e,this.parseNothing=n}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function bN(t){return"url"in t}function yN(t){return"values"in t}function vN(t){return"name"in t&&!bN(t)&&!yN(t)&&!xN(t)}function xN(t){return t&&(_N(t)||ON(t)||wN(t))}function _N(t){return"sequence"in t}function ON(t){return"sphere"in t}function wN(t){return"graticule"in t}var jN;function kN(t){return"filter"in t}function EN(t){return"lookup"in t}function AN(t){return"pivot"in t}function DN(t){return"density"in t}function MN(t){return"quantile"in t}function SN(t){return"regression"in t}function CN(t){return"loess"in t}function FN(t){return"sample"in t}function zN(t){return"window"in t}function TN(t){return"joinaggregate"in t}function $N(t){return"flatten"in t}function NN(t){return"calculate"in t}function RN(t){return"bin"in t}function PN(t){return"impute"in t}function BN(t){return"timeUnit"in t}function LN(t){return"aggregate"in t}function IN(t){return"stack"in t}function UN(t){return"fold"in t}function qN(t,e,n,r){const i=Mz(e)&&e.condition,o=r(e);if(i){return{[n]:[...Object(Z.i)(i).map(e=>{const n=r(e),i=function(t){return t.selection}(e)?tP(t,e.selection):nP(t,e.test);return Object.assign({test:i},n)}),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function WN(t,e="text"){const n=t.encoding[e];return qN(t,n,e,e=>YN(e,t.config))}function YN(t,e,n="datum"){if(t){if(Bz(t))return bT(t.value);if(Rz(t)){const{format:r,formatType:i}=tT(t);return sz({fieldOrDatumDef:t,format:r,formatType:i,expr:n,config:e})}}}function HN(t,e={}){const{encoding:n,markDef:r,config:i,stack:o}=t,a=n.tooltip;if(Object(Z.B)(a))return{tooltip:VN({tooltip:a},o,i,e)};{const s=e.reactiveGeom?"datum.datum":"datum";return qN(t,a,"tooltip",t=>{const a=YN(t,i,s);if(a)return a;if(null===t)return;let u=_T("tooltip",r,i);return!0===u&&(u={content:"encoding"}),Object(Z.I)(u)?{value:u}:Object(Z.G)(u)?wC(u)?u:"encoding"===u.content?VN(n,o,i,e):{signal:s}:void 0})}}function GN(t,e,n,{reactiveGeom:r}={}){const i={},o=r?"datum.datum":"datum",a=[];function s(r,s){const u=oS(s),l=Pz(r)?r:Object.assign(Object.assign({},r),{type:t[u].type}),c=l.title||Qz(l,n),f=Object(Z.i)(c).join(", ");let d;if(hS(s)){const r="x"===s?"x2":"y2",a=eT(t[r]);if(DS(l.bin)&&a){const t=Yz(l,{expr:o}),e=Yz(a,{expr:o}),{format:s,formatType:u}=tT(l);d=gz(t,e,s,u,n),i[r]=!0}else if(e&&e.fieldChannel===s&&"normalize"===e.offset){const{format:t,formatType:e}=tT(l);d=sz({fieldOrDatumDef:l,format:t,formatType:e,expr:o,config:n,normalizeStack:!0}).signal}}d=null!=d?d:YN(l,n,o).signal,a.push({channel:s,key:f,value:d})}NT(t,(t,e)=>{Fz(t)?s(t,e):Sz(t)&&s(t.condition,e)});const u={};for(const{channel:t,key:e,value:n}of a)i[t]||u[e]||(u[e]=n);return u}function VN(t,e,n,{reactiveGeom:r}={}){const i=GN(t,e,n,{reactiveGeom:r}),o=KD(i).map(([t,e])=>`"${t}": ${e}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function XN(t){const{markDef:e,config:n}=t,r=_T("aria",e,n);return!1===r?{}:Object.assign(Object.assign(Object.assign({},r?{aria:r}:{}),function(t){const{mark:e,markDef:n,config:r}=t;if(!1===r.aria)return{};const i=_T("ariaRoleDescription",n,r);if(null!=i)return{ariaRoleDescription:{value:i}};return e in AC?{}:{ariaRoleDescription:{value:e}}}(t)),function(t){const{encoding:e,markDef:n,config:r,stack:i}=t,o=e.description;if(o)return qN(t,o,"description",e=>YN(e,t.config));const a=_T("description",n,r);if(null!=a)return{description:bT(a)};if(!1===r.aria)return{};const s=GN(e,i,r);if(VD(s))return;return{description:{signal:KD(s).map(([t,e],n)=>`"${n>0?"; ":""}${t}: " + (${e})`).join(" + ")}}}(t))}function JN(t,e,n={}){const{markDef:r,encoding:i,config:o}=e,{vgChannel:a}=n;let{defaultRef:s,defaultValue:u}=n;void 0===s&&(u=null!=u?u:_T(t,r,o,{vgChannel:a,ignoreVgConfig:!0}),void 0!==u&&(s=bT(u)));const l=i[t];return qN(e,l,null!=a?a:t,n=>rz({channel:t,channelDef:n,markDef:r,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t),stack:null,defaultRef:s}))}function KN(t,e={filled:void 0}){var n,r,i,o;const{markDef:a,encoding:s,config:u}=t,{type:l}=a,c=null!==(n=e.filled)&&void 0!==n?n:_T("filled",a,u),f=RD(["bar","point","circle","square","geoshape"],l)?"transparent":void 0,d=null!==(i=null!==(r=_T(!0===c?"color":void 0,a,u,{vgChannel:"fill"}))&&void 0!==r?r:u.mark[!0===c&&"color"])&&void 0!==i?i:f,h=null!==(o=_T(!1===c?"color":void 0,a,u,{vgChannel:"stroke"}))&&void 0!==o?o:u.mark[!1===c&&"color"],p=c?"fill":"stroke",g=Object.assign(Object.assign({},d?{fill:bT(d)}:{}),h?{stroke:bT(h)}:{});return a.color&&(c?a.fill:a.stroke)&&aC(WS("property",{fill:"fill"in a,stroke:"stroke"in a})),Object.assign(Object.assign(Object.assign(Object.assign({},g),JN("color",t,{vgChannel:p,defaultValue:c?d:h})),JN("fill",t,{defaultValue:s.fill?d:void 0})),JN("stroke",t,{defaultValue:s.stroke?h:void 0}))}function ZN(t,e){const n=e[function(t){switch(t){case"x":return"xOffset";case"y":return"yOffset";case"x2":return"x2Offset";case"y2":return"y2Offset";case PM:return"thetaOffset";case RM:return"radiusOffset";case BM:return"theta2Offset";case"radius2":return"radius2Offset"}}(t)];if(n)return n}function QN(t,e,{defaultPos:n,vgChannel:r,isMidPoint:i}){const{encoding:o,markDef:a,config:s,stack:u}=e,l=o[t],c=o[sS(t)],f=e.scaleName(t),d=e.getScaleComponent(t),h=ZN(t,a),p=tR({model:e,defaultPos:n,channel:t,scaleName:f,scale:d}),g=!l&&hS(t)&&(o.latitude||o.longitude)?{field:e.getName(t)}:function(t){const{channel:e,channelDef:n,isMidPoint:r,scaleName:i,stack:o,offset:a,markDef:s,config:u}=t;if(Rz(n)&&o&&e===o.fieldChannel){if(Fz(n)){const t=Az({channel:e,fieldDef:n,isMidPoint:r,markDef:s,stack:o,config:u});if(void 0!==t)return nz({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",band:t,offset:a})}return ez(n,i,{suffix:"end"},{offset:a})}return KF(t)}({channel:t,channelDef:l,channel2Def:c,markDef:a,config:s,isMidPoint:i,scaleName:f,scale:d,stack:u,offset:h,defaultRef:p});return g?{[r||t]:g}:void 0}function tR({model:t,defaultPos:e,channel:n,scaleName:r,scale:i}){const{markDef:o,config:a}=t;return()=>{const s=oS(n),u=aS(n),l=_T(n,o,a,{vgChannel:u});if(void 0!==l)return iz(n,l);switch(e){case"zeroOrMin":case"zeroOrMax":if(r){const t=i.get("type");if(RD([GC,KC,ZC],t));else if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===e)return"y"===s?{field:{group:"height"}}:{value:0};switch(s){case"radius":return{signal:`min(${t.width.signal},${t.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":{const e=t[uS(n)];return Object.assign(Object.assign({},e),{mult:.5})}}}}!function(t){t[t.Raw=0]="Raw",t[t.Main=1]="Main",t[t.Row=2]="Row",t[t.Column=3]="Column",t[t.Lookup=4]="Lookup"}(jN||(jN={}));const eR={left:"x",center:"xc",right:"x2"},nR={top:"y",middle:"yc",bottom:"y2"};function rR(t,e,n,r="middle"){if("radius"===t||"theta"===t)return aS(t);const i="x"===t?"align":"baseline",o=_T(i,e,n);let a;return wC(o)?(aC(function(t){return`The ${t} for range marks cannot be an expression`}(i)),a=void 0):a=o,"x"===t?eR[a||("top"===r?"left":"center")]:nR[a||r]}function iR(t,e,{defaultPos:n,defaultPos2:r,range:i}){return i?oR(t,e,{defaultPos:n,defaultPos2:r}):QN(t,e,{defaultPos:n})}function oR(t,e,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=e,a=sS(t),s=uS(t),u=function(t,e,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=t,u=oS(n),l=uS(n),c=aS(n),f=r[u],d=t.scaleName(u),h=t.getScaleComponent(u),p=ZN(n in r||n in o?n:u,t.markDef);if(!f&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude))return{[c]:{field:t.getName(n)}};const g=function({channel:t,channelDef:e,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l}){if(Rz(e)&&s&&t.charAt(0)===s.fieldChannel.charAt(0))return ez(e,o,{suffix:"start"},{offset:u});return KF({channel:t,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:u,defaultRef:l})}({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});if(void 0!==g)return{[c]:g};return aR(n,o)||aR(n,{[n]:wT(n,o,s.style),[l]:wT(l,o,s.style)})||aR(n,s[i])||aR(n,s.mark)||{[c]:tR({model:t,defaultPos:e,channel:n,scaleName:d,scale:h})()}}(e,r,a),l=u[s]?rR(t,i,o):aS(t);return Object.assign(Object.assign({},QN(t,e,{defaultPos:n,vgChannel:l})),u)}function aR(t,e){const n=uS(t),r=aS(t);return void 0!==e[r]?{[r]:iz(t,e[r])}:void 0!==e[t]?{[r]:iz(t,e[t])}:e[n]?{[n]:iz(t,e[n])}:void 0}function sR(t,e,n){var r,i,o,a;const{config:s,encoding:u,markDef:l,stack:c}=t,f=sS(e),d=uS(e),h=u[e],p=u[f],g=t.getScaleComponent(e),m=g?g.get("type"):void 0,b=t.scaleName(e),y=l.orient,v=null!==(i=null!==(r=u[d])&&void 0!==r?r:u.size)&&void 0!==i?i:_T("size",l,s,{vgChannel:d}),x="bar"===n&&("x"===e?"vertical"===y:"horizontal"===y);if(Fz(h)&&(AS(h.bin)||DS(h.bin)||h.timeUnit&&!p)&&!v&&!gF(m)){const n=Az({channel:e,fieldDef:h,stack:c,markDef:l,config:s}),r=null===(o=t.component.axes[e])||void 0===o?void 0:o[0];return function({fieldDef:t,fieldDef2:e,channel:n,band:r,scaleName:i,markDef:o,spacing:a=0,axisTranslate:s,reverse:u,config:l}){const c=sS(n),f=aS(n),d=aS(c),h=ZN(n,o);if(AS(t.bin)||t.timeUnit)return{[d]:cR({channel:n,fieldDef:t,scaleName:i,markDef:o,band:(1-r)/2,offset:lR(c,a,u,s,h),config:l}),[f]:cR({channel:n,fieldDef:t,scaleName:i,markDef:o,band:1-(1-r)/2,offset:lR(n,a,u,s,h),config:l})};if(DS(t.bin)){const r=ez(t,i,{},{offset:lR(c,a,u,s,h)});if(Fz(e))return{[d]:r,[f]:ez(e,i,{},{offset:lR(n,a,u,s,h)})};if(MS(t.bin)&&t.bin.step)return{[d]:r,[f]:{signal:`scale("${i}", ${Yz(t,{expr:"datum"})} + ${t.bin.step})`,offset:lR(n,a,u,s,h)}}}return void aC(rC(c))}({fieldDef:h,fieldDef2:p,channel:e,markDef:l,scaleName:b,band:n,axisTranslate:null!==(a=null==r?void 0:r.get("translate"))&&void 0!==a?a:.5,spacing:hS(e)?_T("binSpacing",l,s):void 0,reverse:g.get("reverse"),config:s})}return(Rz(h)&&gF(m)||x)&&!p?function(t,e,n,r){var i;const{markDef:o,encoding:a,config:s,stack:u}=r,l=o.orient,c=r.scaleName(n),f=r.getScaleComponent(n),d=uS(n),h=sS(n),p="horizontal"===l&&"y"===n||"vertical"===l&&"x"===n,g=_T(p?"size":d,o,s,{vgChannel:d});let m;(a.size||void 0!==g)&&(p?m=JN("size",r,{vgChannel:d,defaultValue:g}):aC(function(t){return`Cannot apply size to non-oriented mark "${t}".`}(o.type)));const b=null!==(i=Rz(e)?Az({channel:n,fieldDef:e,markDef:o,stack:u,config:s}):void 0)&&void 0!==i?i:1;m=m||{[d]:uR(t,d,c,f,s,b)};const y="band"!==(null==f?void 0:f.get("type"))||!("band"in m[d]),v=rR(n,o,s,y?"middle":"top"),x=ZN(n,o),_=KF({channel:n,channelDef:e,markDef:o,config:s,scaleName:c,scale:f,stack:u,offset:x,defaultRef:tR({model:r,defaultPos:"mid",channel:n,scaleName:c,scale:f}),band:y?.5:(1-b)/2});if(d)return Object.assign({[v]:_},m);{const t=aS(h),e=m[d],n=x?Object.assign(Object.assign({},e),{offset:x}):e;return{[v]:_,[t]:Object(Z.B)(_)?[_[0],Object.assign(Object.assign({},_[1]),{offset:n})]:Object.assign(Object.assign({},_),{offset:n})}}}(n,h,e,t):oR(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function uR(t,e,n,r,i,o){if(r){const e=r.get("type");if("point"===e||"band"===e){if(void 0!==i[t].discreteBandSize)return{value:i[t].discreteBandSize};if(e===nF){const t=r.get("range");return jC(t)&&Object(Z.F)(t.step)?{value:t.step-2}:{value:j$-2}}return{scale:n,band:o}}return{value:i[t].continuousBandSize}}const a=O$(i.view,e),s=cM(i[t].discreteBandSize,a-2);return void 0!==s?{value:s}:void 0}function lR(t,e,n,r,i){if(YM(t))return 0;const o="x"===t||"y2"===t?-e/2:e/2;if(wC(n)||wC(i)||wC(r)){const t=vT(n),e=vT(i),a=vT(r);return{signal:(a?a+" + ":"")+(t?`(${t} ? -1 : 1) * `:"")+(e?`(${e} + ${o})`:o)}}return i=i||0,r+(n?-i-o:+i+o)}function cR({channel:t,fieldDef:e,scaleName:n,markDef:r,band:i,offset:o,config:a}){return ZF({fieldDef:e,channel:t,markDef:r,ref:nz({scaleName:n,fieldOrDatumDef:e,band:i,offset:o}),config:a})}const fR=new Set(["aria"]);function dR(t,e){const{fill:n,stroke:r}="include"===e.color?KN(t):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function(t,e){return EC.reduce((n,r)=>(fR.has(r)||void 0===t[r]||"ignore"===e[r]||(n[r]=bT(t[r])),n),{})}(t.markDef,e)),hR(t,"fill",n)),hR(t,"stroke",r)),JN("opacity",t)),JN("fillOpacity",t)),JN("strokeOpacity",t)),JN("strokeWidth",t)),JN("strokeDash",t)),function(t){const{encoding:e,mark:n}=t,r=e.order;return!IF(n)&&Bz(r)?qN(t,r,"zindex",t=>bT(t.value)):{}}(t)),HN(t)),WN(t,"href")),XN(t))}function hR(t,e,n){const{config:r,mark:i,markDef:o}=t;if("hide"===_T("invalid",o,r)&&n&&!IF(i)){const r=function(t,{invalid:e=!1,channels:n}){const r=n.reduce((e,n)=>{const r=t.getScaleComponent(n);if(r){const i=r.get("type"),o=t.vgField(n,{expr:"datum"});o&&mF(i)&&(e[o]=!0)}return e},{}),i=XD(r);if(i.length>0){const t=e?"||":"&&";return i.map(t=>tz(t,e)).join(` ${t} `)}return}(t,{invalid:!0,channels:xS});if(r)return{[e]:[{test:r,value:null},...Object(Z.i)(n)]}}return n?{[e]:n}:{}}function pR(t){const{config:e,markDef:n}=t;if(_T("invalid",n,e)){const e=function(t,{invalid:e=!1,channels:n}){const r=n.reduce((e,n)=>{const r=t.getScaleComponent(n);if(r){const i=r.get("type"),o=t.vgField(n,{expr:"datum"});o&&mF(i)&&(e[o]=!0)}return e},{}),i=XD(r);if(i.length>0){const t=e?"||":"&&";return i.map(t=>tz(t,e)).join(` ${t} `)}return}(t,{channels:dS});if(e)return{defined:{signal:e}}}return{}}function gR(t,e){if(void 0!==e)return{[t]:bT(e)}}const mR={has:t=>"interval"!==t.type&&t.nearest,parse:(t,e)=>{if(e.events)for(const n of e.events)n.markname=t.getName("voronoi")},marks:(t,e,n)=>{const{x:r,y:i}=e.project.hasChannel,o=t.mark;if(IF(o))return aC(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:t.getName("voronoi"),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},HN(t,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let s=0,u=!1;return n.forEach((e,n)=>{var r;const i=null!==(r=e.name)&&void 0!==r?r:"";i===t.component.mark[0].name?s=n:i.indexOf("voronoi")>=0&&(u=!0)}),u||n.splice(s+1,0,a),n}};class bR{constructor(t,e){this.debugName=e,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,e){this._children.indexOf(t)>-1?aC("Attempt to add the same child twice."):void 0!==e?this._children.splice(e,0,t):this._children.push(t)}removeChild(t){const e=this._children.indexOf(t);return this._children.splice(e,1),e}remove(){let t=this._parent.removeChild(this);for(const e of this._children)e._parent=this._parent,this._parent.addChild(e,t++)}insertAsParentOf(t){const e=t.parent;e.removeChild(this),this.parent=e,t.parent=this}swapWithParent(){const t=this._parent,e=t.parent;for(const e of this._children)e.parent=t;this._children=[],t.removeChild(this),t.parent.removeChild(t),this.parent=e,t.parent=this}}class yR extends bR{constructor(t,e,n,r){super(t,e),this.type=n,this.refCounts=r,this._source=this._name=e,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const t=new this.constructor;return t.debugName="clone_"+this.debugName,t._source=this._source,t._name="clone_"+this._name,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash="Output "+dM()),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}class vR extends bR{constructor(t,e){super(t),this.formula=e}clone(){return new vR(null,CD(this.formula))}static makeFromEncoding(t,e){const n=e.reduceFieldDef((t,n,r)=>{const{field:i,timeUnit:o}=n,a=OL(e)?e.encoding[sS(r)]:void 0,s=OL(e)&&Dz(r,n,a,e.stack,e.markDef,e.config);if(o){const e=Yz(n,{forAs:!0});t[$D({as:e,field:i,timeUnit:o})]=Object.assign({as:e,field:i,timeUnit:o},s?{band:!0}:{})}return t},{});return VD(n)?null:new vR(t,n)}static makeFromTransform(t,e){const n=Object.assign({},e),{timeUnit:r}=n,i=bD(n,["timeUnit"]),o=OC(r),a=Object.assign(Object.assign({},i),{timeUnit:o});return new vR(t,{[$D(a)]:a})}merge(t){this.formula=Object.assign({},this.formula);for(const e in t.formula)this.formula[e]&&!t.formula[e].band||(this.formula[e]=t.formula[e]);for(const e of t.children)t.removeChild(e),e.parent=this;t.remove()}removeFormulas(t){const e={};for(const[n,r]of KD(this.formula))t.has(r.as)||(e[n]=r);this.formula=e}producedFields(){return new Set(JD(this.formula).map(t=>t.as))}dependentFields(){return new Set(JD(this.formula).map(t=>t.field))}hash(){return"TimeUnit "+$D(this.formula)}assemble(){const t=[];for(const e of JD(this.formula)){const{field:n,as:r,timeUnit:i}=e,o=OC(i),{unit:a,utc:s}=o,u=bD(o,["unit","utc"]);t.push(Object.assign(Object.assign(Object.assign(Object.assign({field:aM(n),type:"timeunit"},a?{units:yC(a)}:{}),s?{timezone:"utc"}:{}),u),{as:[r,r+"_end"]}))}return t}}class xR{constructor(...t){this.items=t,this.hasChannel={},this.hasField={}}}const _R={has:t=>"single"===t.type&&"global"===t.resolve&&t.bind&&"scales"!==t.bind&&!h$(t.bind),parse:(t,e,n,r)=>{r.on||delete e.events,r.clear||delete e.clear},topLevelSignals:(t,e,n)=>{const r=e.name,i=e.project,o=e.bind,a=e.init&&e.init[0],s=mR.has(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((t,i)=>{var u,l;const c=QD(`${r}_${t.field}`);n.filter(t=>t.name===c).length||n.unshift(Object.assign(Object.assign({name:c},a?{init:$R(a[i])}:{value:null}),{on:e.events?[{events:e.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${Object(Z.ab)(t.field)}] : null`}]:[],bind:null!==(l=null!==(u=o[t.field])&&void 0!==u?u:o[t.channel])&&void 0!==l?l:o}))}),n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.filter(t=>t.name===r+YR)[0],a=r+"_tuple_fields",s=i.items.map(t=>QD(`${r}_${t.field}`)),u=s.map(t=>t+" !== null").join(" && ");return s.length&&(o.update=`${u} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},OR={has:t=>"multi"===t.type&&!!t.toggle,signals:(t,e,n)=>n.concat({name:e.name+"_toggle",value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+YR,r=e.name+"_toggle";return`${r} ? null : ${n}, `+("global"===e.resolve?r+" ? null : true, ":`${r} ? null : {unit: ${JR(t)}}, `)+`${r} ? ${n} : null`}},wR={has:t=>void 0!==t.clear&&!1!==t.clear,parse:(t,e,n)=>{n.clear&&(e.clear=Object(Z.I)(n.clear)?Kj(n.clear,"scope"):n.clear)},topLevelSignals:(t,e,n)=>{if(_R.has(e))for(const t of e.project.items){const r=n.findIndex(n=>n.name===QD(`${e.name}_${t.field}`));-1!==r&&n[r].on.push({events:e.clear,update:"null"})}return n},signals:(t,e,n)=>{function r(t,r){-1!==t&&n[t].on&&n[t].on.push({events:e.clear,update:r})}if("interval"===e.type)for(const t of e.project.items){const e=n.findIndex(e=>e.name===t.signals.visual);if(r(e,"[0, 0]"),-1===e){r(n.findIndex(e=>e.name===t.signals.data),"null")}}else{let t=n.findIndex(t=>t.name===e.name+YR);r(t,"null"),OR.has(e)&&(t=n.findIndex(t=>t.name===e.name+"_toggle"),r(t,"false"))}return n}},jR={has:t=>"interval"===t.type&&"global"===t.resolve&&t.bind&&"scales"===t.bind,parse:(t,e)=>{const n=e.scales=[];for(const r of e.project.items){const i=r.channel;if(!_S(i))continue;const o=t.getScaleComponent(i),a=o?o.get("type"):void 0;if(!o||!mF(a)){aC("Scale bindings are currently only supported for scales with unbinned, continuous domains.");continue}const s={selection:e.name,field:r.field};o.set("selectionExtent",s,!0),n.push(r)}},topLevelSignals:(t,e,n)=>{const r=e.scales.filter(t=>0===n.filter(e=>e.name===t.signals.data).length);if(!t.parent||ER(t)||0===r.length)return n;const i=n.filter(t=>t.name===e.name)[0];let o=i.update;if(o.indexOf(GR)>=0)i.update=`{${r.map(t=>`${Object(Z.ab)(t.field)}: ${t.signals.data}`).join(", ")}}`;else{for(const t of r){const e=`${Object(Z.ab)(t.field)}: ${t.signals.data}`;o.indexOf(e)<0&&(o=`${o.substring(0,o.length-1)}, ${e}}`)}i.update=o}return n.concat(r.map(t=>({name:t.signals.data})))},signals:(t,e,n)=>{if(t.parent&&!ER(t))for(const t of e.scales){const e=n.filter(e=>e.name===t.signals.data)[0];e.push="outer",delete e.value,delete e.update}return n}};function kR(t,e){return`domain(${Object(Z.ab)(t.scaleName(e))})`}function ER(t){var e;return t.parent&&kL(t.parent)&&(null!==(e=!t.parent.parent)&&void 0!==e?e:ER(t.parent.parent))}const AR={has:t=>{const e="global"===t.resolve&&t.bind&&h$(t.bind),n=1===t.project.items.length&&"_vgsid_"!==t.project.items[0].field;return e&&!n&&aC("Legend bindings are only supported for selections over an individual field or encoding channel."),e&&n},parse:(t,e,n,r)=>{var i;if(r.on||delete e.events,r.clear||delete e.clear,r.on||r.clear){const t='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of e.events)n.filter=Object(Z.i)(null!==(i=n.filter)&&void 0!==i?i:[]),n.filter.indexOf(t)<0&&n.filter.push(t)}const o=p$(e.bind)?e.bind.legend:"click",a=Object(Z.I)(o)?Kj(o,"view"):Object(Z.i)(o);e.bind={legend:{merge:a}}},topLevelSignals:(t,e,n)=>{const r=e.name,i=p$(e.bind)&&e.bind.legend,o=t=>e=>{const n=CD(e);return n.markname=t,n};for(const t of e.project.items){if(!t.hasLegend)continue;const a=QD(t.field)+"_legend",s=`${r}_${a}`;if(0===n.filter(t=>t.name===s).length){const t=i.merge.map(o(a+"_symbols")).concat(i.merge.map(o(a+"_labels"))).concat(i.merge.map(o(a+"_entries")));n.unshift(Object.assign(Object.assign({name:s},e.init?{}:{value:null}),{on:[{events:t,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:"!event.item || !datum ? null : "+s,force:!0}]}))}}return n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find(t=>t.name===r+YR),a=r+"_tuple_fields",s=i.items.filter(t=>t.hasLegend).map(t=>QD(`${r}_${QD(t.field)}_legend`)),u=`${s.map(t=>t+" !== null").join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;e.events&&s.length>0?o.on.push({events:s.map(t=>({signal:t})),update:u}):s.length>0&&(o.update=u,delete o.value,delete o.on);const l=n.find(t=>t.name===r+"_toggle"),c=p$(e.bind)&&e.bind.legend;return l&&(e.events?l.on.push(Object.assign(Object.assign({},l.on[0]),{events:c})):l.on[0].events=c),n}};const DR="_translate_delta",MR={has:t=>"interval"===t.type&&t.translate,signals:(t,e,n)=>{const r=e.name,i=jR.has(e),o=r+"_translate_anchor",{x:a,y:s}=e.project.hasChannel;let u=Kj(e.translate,"scope");return i||(u=u.map(t=>(t.between[0].markname=r+PR,t))),n.push({name:o,value:{},on:[{events:u.map(t=>t.between[0]),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(i?kR(t,"x"):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(i?kR(t,"y"):`slice(${s.signals.visual})`):"")+"}"}]},{name:r+DR,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&SR(t,e,a,"width",n),void 0!==s&&SR(t,e,s,"height",n),n}};function SR(t,e,n,r,i){var o;const a=e.name,s=a+"_translate_anchor",u=a+DR,l=n.channel,c=jR.has(e),f=i.filter(t=>t.name===n.signals[c?"data":"visual"])[0],d=t.getSizeSignalRef(r).signal,h=t.getScaleComponent(l),p=h.get("type"),g=`${s}.extent_${l}`,m=`${c?"log"===p?"panLog":"pow"===p?"panPow":"panLinear":"panLinear"}(${g}, ${`${c&&"x"===l?"-":""}${u}.${l} / `+(c?""+d:`span(${g})`)}`+(c&&"pow"===p?", "+(null!==(o=h.get("exponent"))&&void 0!==o?o:1):"")+")";f.on.push({events:{signal:u},update:c?m:`clampRange(${m}, 0, ${d})`})}const CR={has:t=>"interval"===t.type&&t.zoom,signals:(t,e,n)=>{const r=e.name,i=jR.has(e),o=r+"_zoom_delta",{x:a,y:s}=e.project.hasChannel,u=Object(Z.ab)(t.scaleName("x")),l=Object(Z.ab)(t.scaleName("y"));let c=Kj(e.zoom,"scope");return i||(c=c.map(t=>(t.markname=r+PR,t))),n.push({name:r+"_zoom_anchor",on:[{events:c,update:i?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(t=>!!t).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&FR(t,e,a,"width",n),void 0!==s&&FR(t,e,s,"height",n),n}};function FR(t,e,n,r,i){var o;const a=e.name,s=n.channel,u=jR.has(e),l=i.filter(t=>t.name===n.signals[u?"data":"visual"])[0],c=t.getSizeSignalRef(r).signal,f=t.getScaleComponent(s),d=f.get("type"),h=u?kR(t,s):l.name,p=a+"_zoom_delta",g=`${u?"log"===d?"zoomLog":"pow"===d?"zoomPow":"zoomLinear":"zoomLinear"}(${h}, ${`${a}_zoom_anchor.${s}`}, ${p}`+(u&&"pow"===d?", "+(null!==(o=f.get("exponent"))&&void 0!==o?o:1):"")+")";l.on.push({events:{signal:p},update:u?g:`clampRange(${g}, 0, ${c})`})}const zR=[{has:()=>!0,parse:(t,e,n)=>{var r,i,o;const a=e.name,s=null!==(r=e.project)&&void 0!==r?r:e.project=new xR,u={},l={},c=new Set,f=(t,e)=>{const n="visual"===e?t.channel:t.field;let r=QD(`${a}_${n}`);for(let t=1;c.has(r);t++)r=QD(`${a}_${n}_${t}`);return c.add(r),{[e]:r}};if(!n.fields&&!n.encodings){const e=t.config.selection[n.type];if(n.init)for(const t of Object(Z.i)(n.init))for(const r of XD(t))eS[r]?(n.encodings||(n.encodings=[])).push(r):"interval"===n.type?(aC('Interval selections should be initialized using "x" and/or "y" keys.'),n.encodings=e.encodings):(n.fields||(n.fields=[])).push(r);else n.encodings=e.encodings,n.fields=e.fields}for(const t of null!==(i=n.fields)&&void 0!==i?i:[]){const e={type:"E",field:t};e.signals=Object.assign({},f(e,"data")),s.items.push(e),s.hasField[t]=e}for(const r of null!==(o=n.encodings)&&void 0!==o?o:[]){const n=t.fieldDef(r);if(n){let i=n.field;if(n.aggregate){aC(PS(r,n.aggregate));continue}if(!i){aC(RS(r));continue}if(n.timeUnit){i=t.vgField(r);const e={timeUnit:n.timeUnit,as:i,field:n.field};l[$D(e)]=e}if(!u[i]){let o="E";if("interval"===e.type){mF(t.getScaleComponent(r).get("type"))&&(o="R")}else n.bin&&(o="R-RE");const a={field:i,channel:r,type:o};a.signals=Object.assign(Object.assign({},f(a,"data")),f(a,"visual")),s.items.push(u[i]=a),s.hasField[i]=s.hasChannel[r]=u[i]}}else aC(RS(r))}if(n.init){const t=t=>s.items.map(e=>void 0!==t[e.channel]?t[e.channel]:t[e.field]);if("interval"===n.type)e.init=t(n.init);else{const r=Object(Z.i)(n.init);e.init=r.map(t)}}VD(l)||(s.timeUnit=new vR(null,l))},signals:(t,e,n)=>{const r=e.name+"_tuple_fields";return n.filter(t=>t.name===r).length>0?n:n.concat({name:r,value:e.project.items.map(t=>{const e=bD(t,["signals","hasLegend"]);return e.field=aM(e.field),e})})}},OR,jR,AR,MR,CR,_R,mR,wR];function TR(t,e){for(const n of zR)n.has(t)&&e(n)}function $R(t,e=!0,n=Z.y){if(Object(Z.B)(t)){const r=t.map(t=>$R(t,e,n));return e?`[${r.join(", ")}]`:r}return sC(t)?n(e?hC(t):function(t){const e=dC(t,!0);return t.utc?+new Date(Date.UTC(...e)):+new Date(...e)}(t)):e?n(JSON.stringify(t)):t}function NR(t,e){return XR(t,(n,r)=>{e=r.marks?r.marks(t,n,e):e,TR(n,r=>{r.marks&&(e=r.marks(t,n,e))})}),e}function RR(t){return t.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const PR="_brush",BR={signals:(t,e)=>{const n=e.name,r=n+"_tuple_fields",i=jR.has(e),o=[],a=[],s=[];if(e.translate&&!i){const t="!event.item || event.item.mark.name !== "+Object(Z.ab)(n+PR);LR(e,(e,n)=>{var r;const i=Object(Z.i)(null!==(r=n.between[0].filter)&&void 0!==r?r:n.between[0].filter=[]);return i.indexOf(t)<0&&i.push(t),e})}e.project.items.forEach((n,r)=>{const i=n.channel;if("x"!==i&&"y"!==i)return void aC("Interval selections only support x and y encoding channels.");const u=e.init?e.init[r]:null,l=function(t,e,n,r){const i=n.channel,o=n.signals.visual,a=n.signals.data,s=jR.has(e),u=Object(Z.ab)(t.scaleName(i)),l=t.getScaleComponent(i),c=l?l.get("type"):void 0,f=t=>`scale(${u}, ${t})`,d=t.getSizeSignalRef("x"===i?"width":"height").signal,h=i+"(unit)",p=LR(e,(t,e)=>[...t,{events:e.between[0],update:`[${h}, ${h}]`},{events:e,update:`[${o}[0], clamp(${h}, 0, ${d})]`}]);return p.push({events:{signal:e.name+"_scale_trigger"},update:mF(c)?`[${f(a+"[0]")}, ${f(a+"[1]")}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:$R(r,!0,f)}:{value:[]}),{on:p}),Object.assign(Object.assign({name:a},r?{init:$R(r)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${u}, ${o})`}]})]}(t,e,n,u),c=n.signals.data,f=n.signals.visual,d=Object(Z.ab)(t.scaleName(i)),h=mF(t.getScaleComponent(i).get("type"))?"+":"";o.push(...l),a.push(c),s.push({scaleName:t.scaleName(i),expr:`(!isArray(${c}) || (${h}invert(${d}, ${f})[0] === ${h}${c}[0] && ${h}invert(${d}, ${f})[1] === ${h}${c}[1]))`})}),i||o.push({name:n+"_scale_trigger",value:{},on:[{events:s.map(t=>({scale:t.scaleName})),update:s.map(t=>t.expr).join(" && ")+` ? ${n+"_scale_trigger"} : {}`}]});const u=e.init,l=`unit: ${JR(t)}, fields: ${r}, values`;return o.concat(Object.assign(Object.assign({name:n+YR},u?{init:`{${l}: ${$R(u)}}`}:{}),{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+` ? {${l}: [${a}]} : null`}]}))},modifyExpr:(t,e)=>e.name+YR+", "+("global"===e.resolve?"true":`{unit: ${JR(t)}}`),marks:(t,e,n)=>{const r=e.name,{x:i,y:o}=e.project.hasChannel,a=i&&i.signals.visual,s=o&&o.signals.visual,u=`data(${Object(Z.ab)(e.name+WR)})`;if(jR.has(e))return n;const l={x:void 0!==i?{signal:a+"[0]"}:{value:0},y:void 0!==o?{signal:s+"[0]"}:{value:0},x2:void 0!==i?{signal:a+"[1]"}:{field:{group:"width"}},y2:void 0!==o?{signal:s+"[1]"}:{field:{group:"height"}}};if("global"===e.resolve)for(const e of XD(l))l[e]=[Object.assign({test:`${u}.length && ${u}[0].unit === ${JR(t)}`},l[e]),{value:0}];const c=e.mark,{fill:f,fillOpacity:d,cursor:h}=c,p=bD(c,["fill","fillOpacity","cursor"]),g=XD(p).reduce((t,e)=>(t[e]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter(t=>t).join(" && "),value:p[e]},{value:null}],t),{});return[{name:r+PR+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:f},fillOpacity:{value:d}},update:l}},...n,{name:r+PR,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},h?{cursor:{value:h}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},l),g)}}]}};function LR(t,e){return t.events.reduce((t,n)=>n.between?e(t,n):(aC(n+" is not an ordered event stream for interval selections."),t),[])}function IR(t,e){const n=e.name,r=n+"_tuple_fields",i=e.project,o="(item().isVoronoi ? datum.datum : datum)",a=i.items.map(e=>{const n=t.fieldDef(e.channel);return n&&n.bin?`[${o}[${Object(Z.ab)(t.vgField(e.channel,{}))}], ${o}[${Object(Z.ab)(t.vgField(e.channel,{binSuffix:"end"}))}]]`:`${o}[${Object(Z.ab)(e.field)}]`}).join(", "),s=`unit: ${JR(t)}, fields: ${r}, values`,u=e.events;return[{name:n+YR,on:u?[{events:u,update:`datum && item().mark.marktype !== 'group' ? {${s}: [${a}]} : null`,force:!0}]:[]}]}const UR={signals:IR,modifyExpr:(t,e)=>e.name+YR+", "+("global"===e.resolve?"null":`{unit: ${JR(t)}}`)},qR={signals:IR,modifyExpr:(t,e)=>e.name+YR+", "+("global"===e.resolve?"true":`{unit: ${JR(t)}}`)},WR="_store",YR="_tuple",HR="_modify",GR="vlSelectionResolve",VR={single:qR,multi:UR,interval:BR};function XR(t,e){const n=t.component.selection;if(n)for(const t of JD(n)){if(!0===e(t,VR[t.type]))break}}function JR(t,{escape:e}={escape:!0}){let n=e?Object(Z.ab)(t.name):t.name;const r=function(t){let e=t.parent;for(;e&&!wL(e);)e=e.parent;return e}(t);if(r){const{facet:t}=r;for(const e of KM)t[e]&&(n+=` + '__facet_${e}_' + (facet[${Object(Z.ab)(r.vgField(e))}])`)}return n}function KR(t){let e=!1;return XR(t,t=>{e=e||t.project.items.some(t=>"_vgsid_"===t.field)}),e}function ZR(t){const e=rO(t),n=new Set;return e.visit(t=>{"MemberExpression"===t.type&&function t(e){return"MemberExpression"===e.object.type?t(e.object):"datum"===e.object.name}(t)&&n.add(function t(e){const n=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(n.push(...t(e.object)),n.push(...t(e.property))),n)}(t).slice(1).join("."))}),n}class QR extends bR{constructor(t,e,n){super(t),this.model=e,this.filter=n,this.expr=nP(this.model,this.filter,this),this._dependentFields=ZR(this.expr)}clone(){return new QR(null,this.model,CD(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter "+this.expr}}function tP(t,e,n,r="datum"){const i=[];const o=tM(e,(function(e){const o=QD(e),a=t.getSelectionComponent(o,e),s=Object(Z.ab)(o+WR);if(a.project.timeUnit){const e=null!=n?n:t.component.data.raw,r=a.project.timeUnit.clone();e.parent?r.insertAsParentOf(e):e.parent=r}return"none"!==a.empty&&i.push(s),`vlSelectionTest(${s}, ${r}`+("global"===a.resolve?")":`, ${Object(Z.ab)(a.resolve)})`)}));return(i.length?"!("+i.map(t=>`length(data(${t}))`).join(" || ")+") || ":"")+`(${o})`}function eP(t,e){const n=e.encoding;let r=e.field;if(n||r){if(n&&!r){const i=t.project.items.filter(t=>t.channel===n);!i.length||i.length>1?(r=t.project.items[0].field,aC((i.length?"Multiple ":"No ")+`matching ${Object(Z.ab)(n)} encoding found for selection ${Object(Z.ab)(e.selection)}. `+`Using "field": ${Object(Z.ab)(r)}.`)):r=i[0].field}}else r=t.project.items[0].field,t.project.items.length>1&&aC(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${Object(Z.ab)(r)}.`);return`${t.name}[${Object(Z.ab)(r)}]`}function nP(t,e,n){return tM(e,e=>Object(Z.I)(e)?e:function(t){return null==t?void 0:t.selection}(e)?tP(t,e.selection,n):PC(e))}function rP(t,e,n,r){var i,o,a;t.encode=null!==(i=t.encode)&&void 0!==i?i:{},t.encode[e]=null!==(o=t.encode[e])&&void 0!==o?o:{},t.encode[e].update=null!==(a=t.encode[e].update)&&void 0!==a?a:{},t.encode[e].update[n]=r}function iP(t,e,n,r={header:!1}){var i,o;const a=t.combine(),{disable:s,orient:u,scale:l,labelExpr:c,title:f,zindex:d}=a,h=bD(a,["disable","orient","scale","labelExpr","title","zindex"]);if(!s){for(const t in h){const n=_M[t],r=h[t];if(n&&n!==e&&"both"!==n)delete h[t];else if(vM(r)){const{condition:e}=r,n=bD(r,["condition"]),i=Object(Z.i)(e),o=yM[t];if(o){const{vgProp:e,part:r}=o;rP(h,r,e,[...i.map(t=>{const{test:e}=t,n=bD(t,["test"]);return Object.assign({test:nP(null,e)},n)}),n]),delete h[t]}else if(null===o){const e={signal:i.map(t=>{const{test:e}=t,n=bD(t,["test"]);return`${nP(null,e)} ? ${yT(n)} : `}).join("")+yT(n)};h[t]=e}}else if(wC(r)){const e=yM[t];if(e){const{vgProp:n,part:i}=e;rP(h,i,n,r),delete h[t]}}}if("grid"===e){if(!h.grid)return;if(h.encode){const{grid:t}=h.encode;h.encode=Object.assign({},t?{grid:t}:{}),VD(h.encode)&&delete h.encode}return Object.assign(Object.assign({scale:l,orient:u},h),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:cM(d,0)})}{if(!r.header&&t.mainExtracted)return;if(void 0!==c){let t=c;(null===(o=null===(i=h.encode)||void 0===i?void 0:i.labels)||void 0===o?void 0:o.update)&&wC(h.encode.labels.update.text)&&(t=sM(c,"datum.label",h.encode.labels.update.text.signal)),rP(h,"labels","text",{signal:t})}if(null===h.labelAlign&&delete h.labelAlign,h.encode){for(const e of xM)t.hasAxisPart(e)||delete h.encode[e];VD(h.encode)&&delete h.encode}const e=function(t,e){if(t)return Object(Z.B)(t)&&!hT(t)?t.map(t=>Qz(t,e)).join(", "):t}(f,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:l,orient:u,grid:!1},e?{title:e}:{}),h),!1===n.aria?{aria:!1}:{}),{zindex:cM(d,0)})}}}function oP(t){const{axes:e}=t.component,n=[];for(const r of dS)if(e[r])for(const i of e[r])if(!i.get("disable")&&!i.get("gridScale")){const e="x"===r?"height":"width",i=t.getSizeSignalRef(e).signal;e!==i&&n.push({name:e,update:i})}return n}function aP(t,e,n,r){return Object.assign.apply(null,[{},...t.map(t=>{if("axisOrient"===t){const t="x"===n?"bottom":"left",i=e["x"===n?"axisBottom":"axisLeft"]||{},o=e["x"===n?"axisTop":"axisRight"]||{},a=new Set([...XD(i),...XD(o)]),s={};for(const e of a.values())s[e]={signal:`${r.signal} === "${t}" ? ${vT(i[e])} : ${vT(o[e])}`};return s}return e[t]})])}function sP(t,e,n,r){const i="band"===e?["axisDiscrete","axisBand"]:"point"===e?["axisDiscrete","axisPoint"]:e in cF?["axisQuantitative"]:"time"===e||"utc"===e?["axisTemporal"]:[];const o="x"===t?"axisX":"axisY",a=wC(n)?"axisOrient":"axis"+nM(n),s=[...i,...i.map(t=>o+t.substr(4))],u=["axis",a,o];return{vlOnlyAxisConfig:aP(s,r,t,n),vgAxisConfig:aP(u,r,t,n),axisConfigStyle:uP([...u,...s],r)}}function uP(t,e){var n;const r=[{}];for(const i of t){let t=null===(n=e[i])||void 0===n?void 0:n.style;if(t){t=Object(Z.i)(t);for(const n of t)r.push(e.style[n])}}return Object.assign.apply(null,r)}function lP(t,e,n,r={}){var i;const o=jT(t,n,e);if(void 0!==o)return{configFrom:"style",configValue:o};for(const e of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==(null===(i=r[e])||void 0===i?void 0:i[t]))return{configFrom:e,configValue:r[e][t]};return{}}const cP={scale:({model:t,channel:e})=>t.scaleName(e),format:({fieldOrDatumDef:t,config:e,axis:n})=>{const{format:r,formatType:i}=n;return cz(t,t.type,r,i,e,!0)},formatType:({axis:t,fieldOrDatumDef:e,scaleType:n})=>{const{formatType:r}=t;return fz(r,e,n)},grid:({fieldOrDatumDef:t,axis:e,scaleType:n})=>{var r;return(!Fz(t)||!DS(t.bin))&&(null!==(r=e.grid)&&void 0!==r?r:function(t,e){return!gF(t)&&Fz(e)&&!AS(null==e?void 0:e.bin)}(n,t))},gridScale:({model:t,channel:e})=>function(t,e){const n="x"===e?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n);return}(t,e),labelAlign:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelAlign||hP(e,n,r),labelAngle:({labelAngle:t})=>t,labelBaseline:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelBaseline||dP(e,n,r),labelFlush:({axis:t,fieldOrDatumDef:e,channel:n})=>{var r;return null!==(r=t.labelFlush)&&void 0!==r?r:function(t,e){if("x"===e&&RD(["quantitative","temporal"],t))return!0;return}(e.type,n)},labelOverlap:({axis:t,fieldOrDatumDef:e,scaleType:n})=>{var r;return null!==(r=t.labelOverlap)&&void 0!==r?r:function(t,e,n,r){if(n&&!Object(Z.G)(r)||"nominal"!==t&&"ordinal"!==t)return"log"!==e||"greedy";return}(e.type,n,Fz(e)&&!!e.timeUnit,Fz(e)?e.sort:void 0)},orient:({orient:t})=>t,tickCount:({channel:t,model:e,axis:n,fieldOrDatumDef:r,scaleType:i})=>{var o;const a="x"===t?"width":"y"===t?"height":void 0,s=a?e.getSizeSignalRef(a):void 0;return null!==(o=n.tickCount)&&void 0!==o?o:function({fieldOrDatumDef:t,scaleType:e,size:n,values:r}){var i;if(!r&&!gF(e)&&"log"!==e){if(Fz(t)){if(AS(t.bin))return{signal:`ceil(${n.signal}/10)`};if(t.timeUnit&&RD(["month","hours","day","quarter"],null===(i=OC(t.timeUnit))||void 0===i?void 0:i.unit))return}return{signal:`ceil(${n.signal}/40)`}}return}({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},title:({axis:t,model:e,channel:n})=>{if(void 0!==t.title)return t.title;const r=pP(e,n);if(void 0!==r)return r;const i=e.typedFieldDef(n),o="x"===n?"x2":"y2",a=e.fieldDef(o);return ET(i?[kz(i)]:[],Fz(a)?[kz(a)]:[])},values:({axis:t,fieldOrDatumDef:e})=>function(t,e){const n=t.values;if(Object(Z.B)(n))return cT(e,n);if(wC(n))return n;return}(t,e),zindex:({axis:t,fieldOrDatumDef:e,mark:n})=>{var r;return null!==(r=t.zindex)&&void 0!==r?r:function(t,e){if("rect"===t&&Hz(e))return 1;return 0}(n,e)}};function fP(t){return`(((${t.signal} % 360) + 360) % 360)`}function dP(t,e,n,r){if(void 0!==t){if("x"===n){if(wC(t)){const n=fP(t);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${wC(e)?`(${e.signal} === "top")`:"top"===e} ? "bottom" : "top"`}}if(45{if(Lz(e)&&_z(e.sort)){const{field:r,timeUnit:i}=e,o=e.sort,a=o.map((t,e)=>`${PC({field:r,timeUnit:i,equal:t})} ? ${e} : `).join("")+o.length;t=new gP(t,{calculate:a,as:mP(e,n,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return"Calculate "+$D(this.transform)}}function mP(t,e,n){return Yz(t,Object.assign({prefix:e,suffix:"sort_index"},null!=n?n:{}))}function bP(t,e){return RD(["top","bottom"],e)?"column":RD(["left","right"],e)||"row"===t?"row":"column"}function yP(t,e,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return cM((e||{})[t],i[t],n.header[t])}function vP(t,e,n,r){const i={};for(const o of t){const t=yP(o,e||{},n,r);void 0!==t&&(i[o]=t)}return i}const xP=["row","column"],_P=["header","footer"];function OP(t,e){const n=t.component.layoutHeaders[e].title,r=t.config?t.config:void 0,i=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=vP(["titleAnchor","titleAngle","titleOrient"],i.header,r,e),u=bP(e,s),l=mM(a);return{name:e+"-title",type:"group",role:u+"-title",title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===e?{orient:"left"}:{}),{style:"guide-title"}),jP(l,u)),wP(u,l,o)),CP(r,i,e,s$,o$))}}function wP(t,e,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=hP(e,"row"===t?"left":"top","row"===t?"y":"x");return r?{align:r}:{}}function jP(t,e){const n=dP(t,"row"===e?"left":"top","row"===e?"y":"x",!0);return n?{baseline:n}:{}}function kP(t,e){const n=t.component.layoutHeaders[e],r=[];for(const i of _P)if(n[i])for(const o of n[i]){const a=DP(t,e,i,n,o);null!=a&&r.push(a)}return r}function EP(t,e){var n;const{sort:r}=t;return xz(r)?{field:Yz(r,{expr:"datum"}),order:null!==(n=r.order)&&void 0!==n?n:"ascending"}:Object(Z.B)(r)?{field:mP(t,e,{expr:"datum"}),order:"ascending"}:{field:Yz(t,{expr:"datum"}),order:null!=r?r:"ascending"}}function AP(t,e,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=vP(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,n,e),l=sz({fieldOrDatumDef:t,format:r,formatType:i,expr:"parent",config:n}).signal,c=bP(e,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:u?sM(sM(u,"datum.label",l),"datum.value",Yz(t,{expr:"parent"})):l}},"row"===e?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),jP(o,c)),wP(c,o,a)),CP(n,t,e,u$,a$))}function DP(t,e,n,r,i){if(i){let o=null;const{facetFieldDef:a}=r,s=t.config?t.config:void 0;if(a&&i.labels){const{labelOrient:t}=vP(["labelOrient"],a.header,s,e);("row"===e&&!RD(["top","bottom"],t)||"column"===e&&!RD(["left","right"],t))&&(o=AP(a,e,s))}const u=wL(t)&&!Oz(t.facet),l=i.axes,c=(null==l?void 0:l.length)>0;if(o||c){const s="row"===e?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:t.getName(`${e}_${n}`),type:"group",role:`${e}-${n}`},r.facetFieldDef?{from:{data:t.getName(e+"_domain")},sort:EP(a,e)}:{}),c&&u?{from:{data:t.getName("facet_domain_"+e)}}:{}),o?{title:o}:{}),i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{}),c?{axes:l}:{})}}return null}const MP={column:{start:0,end:1},row:{start:1,end:0}};function SP(t,e){return MP[e][t]}function CP(t,e,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=yP(a,null==e?void 0:e.header,t,n);void 0!==r&&(o[i[a]]=r)}return o}function FP(t){return[...zP(t,"width"),...zP(t,"height"),...zP(t,"childWidth"),...zP(t,"childHeight")]}function zP(t,e){const n="width"===e?"x":"y",r=t.component.layoutSize.get(e);if(!r||"merged"===r)return[];const i=t.getSizeSignalRef(e).signal;if("step"===r){const e=t.getScaleComponent(n);if(e){const r=e.get("type"),o=e.get("range");if(gF(r)&&jC(o)){const r=t.scaleName(n);if(wL(t.parent)){if("independent"===t.parent.component.resolve.scale[n])return[TP(r,o)]}return[TP(r,o),{name:i,update:$P(r,e,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==r){const e=i.endsWith("width"),n=e?"containerSize()[0]":"containerSize()[1]",r=`isFinite(${n}) ? ${n} : ${_$(t.config.view,e?"width":"height")}`;return[{name:i,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:i,value:r}]}function TP(t,e){return{name:t+"_step",value:e.step}}function $P(t,e,n){const r=e.get("type"),i=e.get("padding"),o=cM(e.get("paddingOuter"),i);let a=e.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,`bandspace(${n}, ${vT(a)}, ${vT(o)}) * ${t}_step`}function NP(t){return"childWidth"===t?"width":"childHeight"===t?"height":t}function RP(t,e){return XD(t).reduce((n,r)=>{const i=t[r];return Object.assign(Object.assign({},n),qN(e,i,r,t=>bT(t.value)))},{})}function PP(t,e){if(kL(e)||wL(e))return"shared";if(jL(e))return hS(t)?"independent":"shared";throw new Error("invalid model type for resolve")}function BP(t,e){const n=t.scale[e],r=hS(e)?"axis":"legend";return"independent"===n?("shared"===t[r][e]&&aC(function(t){return`Setting the scale to be independent for "${t}" means we also have to set the guide (axis or legend) to be independent.`}(e)),"independent"):t[r][e]||"shared"}const LP=Object.assign(Object.assign({},{aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1}),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),IP=XD(LP);class UP extends cN{}const qP={symbols:function(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i,legendType:o}){var a,s,u,l,c,f,d,h;if("symbol"!==o)return;const{markDef:p,encoding:g,config:m,mark:b}=n,y=p.filled&&"trail"!==b;let v=Object.assign(Object.assign({},function(t,e,n){for(const r of n){const n=OT(r,e.markDef,e.config);void 0!==n&&(t[r]=bT(n))}return t}({},n,YF)),KN(n,{filled:y}));const x=null!==(a=i.get("symbolOpacity"))&&void 0!==a?a:m.legend.symbolOpacity,_=null!==(s=i.get("symbolFillColor"))&&void 0!==s?s:m.legend.symbolFillColor,O=null!==(u=i.get("symbolStrokeColor"))&&void 0!==u?u:m.legend.symbolStrokeColor,w=void 0===x?null!==(l=WP(g.opacity))&&void 0!==l?l:p.opacity:void 0;if(v.fill)if("fill"===r||y&&r===LM)delete v.fill;else if(v.fill.field)_?delete v.fill:(v.fill=bT(null!==(c=m.legend.symbolBaseFillColor)&&void 0!==c?c:"black"),v.fillOpacity=bT(null!=w?w:1));else if(Object(Z.B)(v.fill)){const t=null!==(h=null!==(d=YP(null!==(f=g.fill)&&void 0!==f?f:g.color))&&void 0!==d?d:p.fill)&&void 0!==h?h:y&&p.color;t&&(v.fill=bT(t))}if(v.stroke)if("stroke"===r||!y&&r===LM)delete v.stroke;else if(v.stroke.field||O)delete v.stroke;else if(Object(Z.B)(v.stroke)){const t=cM(YP(g.stroke||g.color),p.stroke,y?p.color:void 0);t&&(v.stroke={value:t})}if("opacity"!==r){const t=Fz(e)&&GP(n,i,e);t?v.opacity=[Object.assign({test:t},bT(null!=w?w:1)),bT(m.legend.unselectedOpacity)]:w&&(v.opacity=bT(w))}return v=Object.assign(Object.assign({},v),t),VD(v)?void 0:v},gradient:function(t,{model:e,legendType:n,legendCmpt:r}){var i;if("gradient"!==n)return;const{config:o,markDef:a,encoding:s}=e;let u={};const l=void 0===(null!==(i=r.get("gradientOpacity"))&&void 0!==i?i:o.legend.gradientOpacity)?WP(s.opacity)||a.opacity:void 0;l&&(u.opacity=bT(l));return u=Object.assign(Object.assign({},u),t),VD(u)?void 0:u},labels:function(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},a=n.config,s=Fz(e)?GP(n,i,e):void 0,u=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o,f=oz(c)?lz({fieldOrDatumDef:e,field:"datum.value",format:l,formatType:c,config:a}):void 0,d=Object.assign(Object.assign(Object.assign({},u?{opacity:u}:{}),f?{text:f}:{}),t);return VD(d)?void 0:d},entries:function(t,{legendCmpt:e}){const n=e.get("selections");return(null==n?void 0:n.length)?Object.assign(Object.assign({},t),{fill:{value:"transparent"}}):t}};function WP(t){return HP(t,(t,e)=>Math.max(t,e.value))}function YP(t){return HP(t,(t,e)=>cM(t,e.value))}function HP(t,e){return function(t){const e=t&&t.condition;return!!e&&(Object(Z.B)(e)||Bz(e))}(t)?Object(Z.i)(t.condition).reduce(e,t.value):Bz(t)?t.value:void 0}function GP(t,e,n){const r=e.get("selections");if(!(null==r?void 0:r.length))return;const i=Object(Z.ab)(n.field);return r.map(t=>`(!length(data(${Object(Z.ab)(QD(t)+WR)})) || (${t}[${i}] && indexof(${t}[${i}], datum.value) >= 0))`).join(" || ")}const VP={direction:({direction:t})=>t,format:({fieldOrDatumDef:t,legend:e,config:n})=>{const{format:r,formatType:i}=e;return cz(t,t.type,r,i,n,!1)},formatType:({legend:t,fieldOrDatumDef:e,scaleType:n})=>{const{formatType:r}=t;return fz(r,e,n)},gradientLength:t=>{var e,n;const{legend:r,legendConfig:i}=t;return null!==(n=null!==(e=r.gradientLength)&&void 0!==e?e:i.gradientLength)&&void 0!==n?n:function({legendConfig:t,model:e,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:u}=t;if(bF(i))return"horizontal"===n?"top"===r||"bottom"===r?KP(e,"width",a,o):a:KP(e,"height",u,s);return}(t)},labelOverlap:({legend:t,legendConfig:e,scaleType:n})=>{var r,i;return null!==(i=null!==(r=t.labelOverlap)&&void 0!==r?r:e.labelOverlap)&&void 0!==i?i:function(t){if(RD(["quantile","threshold","log"],t))return"greedy";return}(n)},symbolType:({legend:t,markDef:e,channel:n,encoding:r})=>{var i;return null!==(i=t.symbolType)&&void 0!==i?i:function(t,e,n,r){var i;if("shape"!==e){const t=null!==(i=YP(n))&&void 0!==i?i:r;if(t)return t}switch(t){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(e.type,n,r.shape,e.shape)},title:({fieldOrDatumDef:t,config:e})=>Kz(t,e,{allowDisabling:!0}),type:({legendType:t,scaleType:e,channel:n})=>{if(XM(n)&&bF(e)){if("gradient"===t)return}else if("symbol"===t)return;return t},values:({fieldOrDatumDef:t,legend:e})=>function(t,e){const n=t.values;if(Object(Z.B)(n))return cT(e,n);if(wC(n))return n;return}(e,t)};function XP(t){const{legend:e}=t;return cM(e.type,function({channel:t,timeUnit:e,scaleType:n}){if(XM(t)){if(RD(["quarter","month","day"],e))return"symbol";if(bF(n))return"gradient"}return"symbol"}(t))}function JP({legendConfig:t,legendType:e,orient:n,legend:r}){var i,o;return null!==(o=null!==(i=r.direction)&&void 0!==i?i:t[e?"gradientDirection":"symbolDirection"])&&void 0!==o?o:function(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===e?"horizontal":void 0}}(n,e)}function KP(t,e,n,r){return{signal:`clamp(${t.getSizeSignalRef(e).signal}, ${n}, ${r})`}}function ZP(t){const e=OL(t)?function(t){const{encoding:e}=t,n={};for(const r of[LM,...c$]){const i=nT(e[r]);i&&t.getScaleComponent(r)&&(r===qM&&Fz(i)&&i.type===YC||(n[r]=tB(t,r)))}return n}(t):function(t){const{legends:e,resolve:n}=t.component;for(const r of t.children){ZP(r);for(const i of XD(r.component.legends))n.legend[i]=BP(t.component.resolve,i),"shared"===n.legend[i]&&(e[i]=eB(e[i],r.component.legends[i]),e[i]||(n.legend[i]="independent",delete e[i]))}for(const r of XD(e))for(const e of t.children)e.component.legends[r]&&"shared"===n.legend[r]&&delete e.component.legends[r];return e}(t);return t.component.legends=e,e}function QP(t,e,n,r){switch(e){case"disable":return void 0!==n;case"values":return!!(null==n?void 0:n.values);case"title":if("title"===e&&t===(null==r?void 0:r.title))return!0}return t===(n||{})[e]}function tB(t,e){var n,r,i;let o=t.legend(e);const{markDef:a,encoding:s,config:u}=t,l=u.legend,c=new UP({},function(t,e){const n=t.scaleName(e);if("trail"===t.mark){if("color"===e)return{stroke:n};if("size"===e)return{strokeWidth:n}}return"color"===e?t.markDef.filled?{fill:n}:{stroke:n}:{[e]:n}}(t,e));!function(t,e,n){var r;const i=null===(r=t.fieldDef(e))||void 0===r?void 0:r.field;XR(t,t=>{var r,o;const a=null!==(r=t.project.hasField[i])&&void 0!==r?r:t.project.hasChannel[e];if(a&&AR.has(t)){const e=null!==(o=n.get("selections"))&&void 0!==o?o:[];e.push(t.name),n.set("selections",e,!1),a.hasLegend=!0}})}(t,e,c);const f=void 0!==o?!o:l.disable;if(c.set("disable",f,void 0!==o),f)return c;o=o||{};const d=t.getScaleComponent(e).get("type"),h=nT(s[e]),p=Fz(h)?null===(n=OC(h.timeUnit))||void 0===n?void 0:n.unit:void 0,g=o.orient||u.legend.orient||"right",m=XP({legend:o,channel:e,timeUnit:p,scaleType:d}),b={legend:o,channel:e,model:t,markDef:a,encoding:s,fieldOrDatumDef:h,legendConfig:l,config:u,scaleType:d,orient:g,legendType:m,direction:JP({legend:o,legendType:m,orient:g,legendConfig:l})};for(const n of IP){if("gradient"===m&&n.startsWith("symbol")||"symbol"===m&&n.startsWith("gradient"))continue;const r=n in VP?VP[n](b):o[n];if(void 0!==r){const i=QP(r,n,o,t.fieldDef(e));(i||void 0===u.legend[n])&&c.set(n,r,i)}}const y=null!==(r=null==o?void 0:o.encoding)&&void 0!==r?r:{},v=c.get("selections"),x={},_={fieldOrDatumDef:h,model:t,channel:e,legendCmpt:c,legendType:m};for(const e of["labels","legend","title","symbols","gradient","entries"]){const n=RP(null!==(i=y[e])&&void 0!==i?i:{},t),r=e in qP?qP[e](n,_):n;void 0===r||VD(r)||(x[e]=Object.assign(Object.assign(Object.assign({},(null==v?void 0:v.length)&&Fz(h)?{name:`${QD(h.field)}_legend_${e}`}:{}),(null==v?void 0:v.length)?{interactive:!!v}:{}),{update:r}))}return VD(x)||c.set("encode",x,!!(null==o?void 0:o.encoding)),c}function eB(t,e){var n,r,i,o;if(!t)return e.clone();const a=t.getWithExplicit("orient"),s=e.getWithExplicit("orient");if(a.explicit&&s.explicit&&a.value!==s.value)return;let u=!1;for(const n of IP){const r=gN(t.getWithExplicit(n),e.getWithExplicit(n),n,"legend",(t,e)=>{switch(n){case"symbolType":return nB(t,e);case"title":return DT(t,e);case"type":return u=!0,dN("symbol")}return pN(t,e,n,"legend")});t.setWithExplicit(n,r)}return u&&((null===(r=null===(n=t.implicit)||void 0===n?void 0:n.encode)||void 0===r?void 0:r.gradient)&&eM(t.implicit,["encode","gradient"]),(null===(o=null===(i=t.explicit)||void 0===i?void 0:i.encode)||void 0===o?void 0:o.gradient)&&eM(t.explicit,["encode","gradient"])),t}function nB(t,e){return"circle"===e.value?e:t}function rB(t){const e=t.component.legends,n={};for(const r of XD(e)){const i=t.getScaleComponent(r),o=TD(i.get("domains"));if(n[o])for(const t of n[o]){eB(t,e[r])||n[o].push(e[r])}else n[o]=[e[r].clone()]}return JD(n).flat().map(e=>function(t,e){var n,r,i;const o=t.combine(),{disable:a,labelExpr:s,selections:u}=o,l=bD(o,["disable","labelExpr","selections"]);if(a)return;!1===e.aria&&null==l.aria&&(l.aria=!1);if(null===(n=l.encode)||void 0===n?void 0:n.symbols){const t=l.encode.symbols.update;!t.fill||"transparent"===t.fill.value||t.stroke||l.stroke||(t.stroke={value:"transparent"});for(const e of c$)l[e]&&delete t[e]}l.title||delete l.title;if(void 0!==s){let t=s;(null===(i=null===(r=l.encode)||void 0===r?void 0:r.labels)||void 0===i?void 0:i.update)&&wC(l.encode.labels.update.text)&&(t=sM(s,"datum.label",l.encode.labels.update.text.signal)),function(t,e,n,r){var i,o,a;t.encode=null!==(i=t.encode)&&void 0!==i?i:{},t.encode[e]=null!==(o=t.encode[e])&&void 0!==o?o:{},t.encode[e].update=null!==(a=t.encode[e].update)&&void 0!==a?a:{},t.encode[e].update[n]=r}(l,"labels","text",{signal:t})}return l}(e,t.config)).filter(t=>void 0!==t)}function iB(t){return kL(t)||jL(t)?function(t){return t.children.reduce((t,e)=>t.concat(e.assembleProjections()),oB(t))}(t):oB(t)}function oB(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:r}=n;if(e.data){const i={signal:`[${e.size.map(t=>t.signal).join(", ")}]`},o=e.data.reduce((e,n)=>{const r=wC(n)?n.signal:`data('${t.lookupDataSource(n)}')`;return RD(e,r)||e.push(r),e},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]}},n)]}return[Object.assign(Object.assign({name:r},{translate:{signal:"[width / 2, height / 2]"}}),n)]}const aB=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class sB extends cN{constructor(t,e,n,r){super(Object.assign({},e),{name:t}),this.specifiedProjection=e,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function uB(t){t.component.projection=OL(t)?function(t){var e;if(t.hasProjection){const n=t.specifiedProjection,r=!(n&&(null!=n.scale||null!=n.translate)),i=r?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,o=r?function(t){const e=[],{encoding:n}=t;for(const r of[["longitude","latitude"],["longitude2","latitude2"]])(nT(n[r[0]])||nT(n[r[1]]))&&e.push({signal:t.getName("geojson_"+e.length)});t.channelHasField(qM)&&t.typedFieldDef(qM).type===YC&&e.push({signal:t.getName("geojson_"+e.length)});0===e.length&&e.push(t.requestDataName(jN.Main));return e}(t):void 0;return new sB(t.projectionName(!0),Object.assign(Object.assign({},null!==(e=t.config.projection)&&void 0!==e?e:{}),null!=n?n:{}),i,o)}return}(t):function(t){if(0===t.children.length)return;let e;for(const e of t.children)uB(e);const n=BD(t.children,t=>{const n=t.component.projection;if(n){if(e){const t=function(t,e){const n=BD(aB,n=>!Object(Z.w)(t.explicit,n)&&!Object(Z.w)(e.explicit,n)||!(!Object(Z.w)(t.explicit,n)||!Object(Z.w)(e.explicit,n)||TD(t.get(n))!==TD(e.get(n))));if(TD(t.size)===TD(e.size)){if(n)return t;if(TD(t.explicit)===TD({}))return e;if(TD(e.explicit)===TD({}))return t}return null}(e,n);return t&&(e=t),!!t}return e=n,!0}return!0});if(e&&n){const n=t.projectionName(!0),r=new sB(n,e.specifiedProjection,e.size,CD(e.data));for(const e of t.children){const t=e.component.projection;t&&(t.isFit&&r.data.push(...e.component.projection.data),e.renameProjection(t.get("name"),n),t.merged=!0)}return r}return}(t)}function lB(t,e){return`${ES(t)}_${e}`}function cB(t,e,n){var r;const i=lB(null!==(r=aT(n,void 0))&&void 0!==r?r:{},e);return t.getName(i+"_bins")}function fB(t,e,n){let r,i;r=function(t){return"as"in t}(t)?Object(Z.I)(t.as)?[t.as,t.as+"_end"]:[t.as[0],t.as[1]]:[Yz(t,{forAs:!0}),Yz(t,{binSuffix:"end",forAs:!0})];const o=Object.assign({},aT(e,void 0)),a=lB(o,t.field),{signal:s,extentSignal:u}=function(t,e){return{signal:t.getName(e+"_bins"),extentSignal:t.getName(e+"_extent")}}(n,a);if(SS(o.extent)){const t=o.extent,e=t.selection;i=eP(n.getSelectionComponent(QD(e),e),t),delete o.extent}return{key:a,binComponent:Object.assign(Object.assign(Object.assign({bin:o,field:t.field,as:[r]},s?{signal:s}:{}),u?{extentSignal:u}:{}),i?{span:i}:{})}}class dB extends bR{constructor(t,e){super(t),this.bins=e}clone(){return new dB(null,CD(this.bins))}static makeFromEncoding(t,e){const n=e.reduceFieldDef((t,n,r)=>{if(Pz(n)&&AS(n.bin)){const{key:i,binComponent:o}=fB(n,n.bin,e);t[i]=Object.assign(Object.assign(Object.assign({},o),t[i]),function(t,e,n,r){var i,o;if(fT(e,n)){const a=OL(t)&&null!==(o=null!==(i=t.axis(n))&&void 0!==i?i:t.legend(n))&&void 0!==o?o:{},s=Yz(e,{expr:"datum"}),u=Yz(e,{expr:"datum",binSuffix:"end"});return{formulaAs:Yz(e,{binSuffix:"range",forAs:!0}),formula:gz(s,u,a.format,a.formatType,r)}}return{}}(e,n,r,e.config))}return t},{});return VD(n)?null:new dB(t,n)}static makeFromTransform(t,e,n){const{key:r,binComponent:i}=fB(e,e.bin,n);return new dB(t,{[r]:i})}merge(t,e){for(const n of XD(t.bins))n in this.bins?(e(t.bins[n].signal,this.bins[n].signal),this.bins[n].as=UD([...this.bins[n].as,...t.bins[n].as],$D)):this.bins[n]=t.bins[n];for(const e of t.children)t.removeChild(e),e.parent=this;t.remove()}producedFields(){return new Set(JD(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(JD(this.bins).map(t=>t.field))}hash(){return"Bin "+$D(this.bins)}assemble(){return JD(this.bins).flatMap(t=>{const e=[],[n,...r]=t.as,i=t.bin,{extent:o}=i,a=bD(i,["extent"]),s=Object.assign(Object.assign(Object.assign({type:"bin",field:aM(t.field),as:n,signal:t.signal},SS(o)?{extent:null}:{extent:o}),t.span?{span:{signal:`span(${t.span})`}}:{}),a);!o&&t.extentSignal&&(e.push({type:"extent",field:aM(t.field),signal:t.extentSignal}),s.extent={signal:t.extentSignal}),e.push(s);for(const t of r)for(let r=0;r<2;r++)e.push({type:"formula",expr:Yz({field:n[r]},{expr:"datum"}),as:t[r]});return t.formula&&e.push({type:"formula",expr:t.formula,as:t.formulaAs}),e})}}function hB(t,e,n,r){const i=OL(r)?r.encoding[sS(e)]:void 0;if(Pz(n)&&OL(r)&&Dz(e,n,i,r.stack,r.markDef,r.config))t.add(Yz(n,{})),t.add(Yz(n,{suffix:"end"})),n.bin&&fT(n,e)&&t.add(Yz(n,{binSuffix:"range"}));else if(e in HM){const n=function(t){switch(t){case"latitude":return"y";case"latitude2":return"y2";case"longitude":return"x";case"longitude2":return"x2"}}(e);t.add(r.getName(n))}else t.add(Yz(n));return t}class pB extends bR{constructor(t,e,n){super(t),this.dimensions=e,this.measures=n}clone(){return new pB(null,new Set(this.dimensions),CD(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(t,e){let n=!1;e.forEachFieldDef(t=>{t.aggregate&&(n=!0)});const r={},i=new Set;return n?(e.forEachFieldDef((t,n)=>{var o,a,s,u;const{aggregate:l,field:c}=t;if(l)if("count"===l)r["*"]=null!==(o=r["*"])&&void 0!==o?o:{},r["*"].count=new Set([Yz(t,{forAs:!0})]);else{if(DM(l)||MM(l)){const t=DM(l)?"argmin":"argmax",e=l[t];r[e]=null!==(a=r[e])&&void 0!==a?a:{},r[e][t]=new Set([Yz({op:t,field:e},{forAs:!0})])}else r[c]=null!==(s=r[c])&&void 0!==s?s:{},r[c][l]=new Set([Yz(t,{forAs:!0})]);_S(n)&&"unaggregated"===e.scaleDomain(n)&&(r[c]=null!==(u=r[c])&&void 0!==u?u:{},r[c].min=new Set([Yz({field:c,aggregate:"min"},{forAs:!0})]),r[c].max=new Set([Yz({field:c,aggregate:"max"},{forAs:!0})]))}else hB(i,n,t,e)}),i.size+XD(r).length===0?null:new pB(t,i,r)):null}static makeFromTransform(t,e){var n,r,i;const o=new Set,a={};for(const t of e.aggregate){const{op:e,field:i,as:o}=t;e&&("count"===e?(a["*"]=null!==(n=a["*"])&&void 0!==n?n:{},a["*"].count=new Set([o||Yz(t,{forAs:!0})])):(a[i]=null!==(r=a[i])&&void 0!==r?r:{},a[i][e]=new Set([o||Yz(t,{forAs:!0})])))}for(const t of null!==(i=e.groupby)&&void 0!==i?i:[])o.add(t);return o.size+XD(a).length===0?null:new pB(t,o,a)}merge(t){return WD(this.dimensions,t.dimensions)?(function(t,e){var n;for(const r of XD(e)){const i=e[r];for(const e of XD(i))r in t?t[r][e]=new Set([...null!==(n=t[r][e])&&void 0!==n?n:[],...i[e]]):t[r]={[e]:i[e]}}}(this.measures,t.measures),!0):(function(...t){oC.debug(...t)}("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...XD(this.measures)])}producedFields(){const t=new Set;for(const e of XD(this.measures))for(const n of XD(this.measures[e])){const r=this.measures[e][n];0===r.size?t.add(`${n}_${e}`):r.forEach(t.add,t)}return t}hash(){return"Aggregate "+$D({dimensions:this.dimensions,measures:this.measures})}assemble(){const t=[],e=[],n=[];for(const r of XD(this.measures))for(const i of XD(this.measures[r]))for(const o of this.measures[r][i])n.push(o),t.push(i),e.push("*"===r?null:aM(r));return{type:"aggregate",groupby:[...this.dimensions].map(aM),ops:t,fields:e,as:n}}}class gB extends bR{constructor(t,e,n,r){super(t),this.model=e,this.name=n,this.data=r;for(const t of KM){const n=e.facet[t];if(n){const{bin:r,sort:i}=n;this[t]=Object.assign({name:e.getName(t+"_domain"),fields:[Yz(n),...AS(r)?[Yz(n,{binSuffix:"end"})]:[]]},xz(i)?{sortField:i}:Object(Z.B)(i)?{sortIndexField:mP(n,t)}:{})}}this.childModel=e.child}hash(){let t="Facet";for(const e of KM)this[e]&&(t+=` ${e.charAt(0)}:${$D(this[e])}`);return t}get fields(){var t;const e=[];for(const n of KM)(null===(t=this[n])||void 0===t?void 0:t.fields)&&e.push(...this[n].fields);return e}dependentFields(){const t=new Set(this.fields);for(const e of KM)this[e]&&(this[e].sortField&&t.add(this[e].sortField.field),this[e].sortIndexField&&t.add(this[e].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const e of dS){const n=this.childModel.component.scales[e];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(gF(r)&&jC(i)){const n=iL(oL(this.childModel,e));n?t[e]=n:aC(NS(e))}}}return t}assembleRowColumnHeaderData(t,e,n){const r={row:"y",column:"x"}[t],i=[],o=[],a=[];n&&n[r]&&(e?(i.push("distinct_"+n[r]),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push("distinct_"+n[r]));const{sortField:s,sortIndexField:u}=this[t];if(s){const{op:t=mz,field:e}=s;i.push(e),o.push(t),a.push(Yz(s,{forAs:!0}))}else u&&(i.push(u),o.push("max"),a.push(u));return{name:this[t].name,source:null!=e?e:this.data,transform:[Object.assign({type:"aggregate",groupby:this[t].fields},i.length?{fields:i,ops:o,as:a}:{})]}}assembleFacetHeaderData(t){var e,n;const{columns:r}=this.model.layout,{layoutHeaders:i}=this.model.component,o=[],a={};for(const t of xP){for(const r of _P){const o=null!==(e=i[t]&&i[t][r])&&void 0!==e?e:[];for(const e of o)if((null===(n=e.axes)||void 0===n?void 0:n.length)>0){a[t]=!0;break}}if(a[t]){const e=`length(data("${this.facet.name}"))`,n="row"===t?r?{signal:`ceil(${e} / ${r})`}:1:r?{signal:`min(${e}, ${r})`}:{signal:e};o.push({name:`${this.facet.name}_${t}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:s,column:u}=a;return(s||u)&&o.unshift(this.assembleRowColumnHeaderData("facet",null,t)),o}assemble(){var t,e;const n=[];let r=null;const i=this.getChildIndependentFieldsWithStep(),{column:o,row:a,facet:s}=this;if(o&&a&&(i.x||i.y)){r=`cross_${this.column.name}_${this.row.name}`;const o=[].concat(null!==(t=i.x)&&void 0!==t?t:[],null!==(e=i.y)&&void 0!==e?e:[]),a=o.map(()=>"distinct");n.push({name:r,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:o,ops:a}]})}for(const t of[NM,$M])this[t]&&n.push(this.assembleRowColumnHeaderData(t,r,i));if(s){const t=this.assembleFacetHeaderData(i);t&&n.push(...t)}return n}}function mB(t){return"'"===t[0]&&"'"===t[t.length-1]||'"'===t[0]&&'"'===t[t.length-1]?t.slice(1,-1):t}function bB(t){const e={};return function t(e,n){if(DD(e))t(e.not,n);else if(AD(e))for(const r of e.and)t(r,n);else if(ED(e))for(const r of e.or)t(r,n);else n(e)}(t.filter,t=>{var n;if(NC(t)){let r=null;MC(t)?r=gT(t.equal):CC(t)?r=gT(t.lte):SC(t)?r=gT(t.lt):FC(t)?r=gT(t.gt):zC(t)?r=gT(t.gte):TC(t)?r=t.range[0]:$C(t)&&(r=(null!==(n=t.oneOf)&&void 0!==n?n:t.in)[0]),r&&(sC(r)?e[t.field]="date":Object(Z.F)(r)?e[t.field]="number":Object(Z.I)(r)&&(e[t.field]="string")),t.timeUnit&&(e[t.field]="date")}}),e}function yB(t){const e={};function n(t){var n;uT(t)?e[t.field]="date":"quantitative"===t.type&&(n=t.aggregate,Object(Z.I)(n)&&RD(["min","max"],n))?e[t.field]="number":lM(t.field)>1?t.field in e||(e[t.field]="flatten"):Lz(t)&&xz(t.sort)&&lM(t.sort.field)>1&&(t.sort.field in e||(e[t.sort.field]="flatten"))}if((OL(t)||wL(t))&&t.forEachFieldDef((e,r)=>{if(Pz(e))n(e);else{const i=oS(r),o=t.fieldDef(i);n(Object.assign(Object.assign({},e),{type:o.type}))}}),OL(t)){const{mark:n,markDef:r,encoding:i}=t;if(IF(n)&&!t.encoding.order){const t=i["horizontal"===r.orient?"y":"x"];Fz(t)&&"quantitative"===t.type&&!(t.field in e)&&(e[t.field]="number")}}return e}class vB extends bR{constructor(t,e){super(t),this._parse=e}clone(){return new vB(null,CD(this._parse))}hash(){return"Parse "+$D(this._parse)}static makeExplicit(t,e,n){let r={};const i=e.data;return!xN(i)&&i&&i.format&&i.format.parse&&(r=i.format.parse),this.makeWithAncestors(t,r,{},n)}static makeWithAncestors(t,e,n,r){for(const t of XD(n)){const e=r.getWithExplicit(t);void 0!==e.value&&(e.explicit||e.value===n[t]||"derived"===e.value||"flatten"===n[t]?delete n[t]:aC(IS(t,n[t],e.value)))}for(const t of XD(e)){const n=r.get(t);void 0!==n&&(n===e[t]?delete e[t]:aC(IS(t,e[t],n)))}const i=new cN(e,n);r.copyAll(i);const o={};for(const t of XD(i.combine())){const e=i.get(t);null!==e&&(o[t]=e)}return 0===XD(o).length||r.parseNothing?null:new vB(t,o)}get parse(){return this._parse}merge(t){this._parse=Object.assign(Object.assign({},this._parse),t.parse),t.remove()}assembleFormatParse(){const t={};for(const e of XD(this._parse)){const n=this._parse[e];1===lM(e)&&(t[e]=n)}return t}producedFields(){return new Set(XD(this._parse))}dependentFields(){return new Set(XD(this._parse))}assembleTransforms(t=!1){return XD(this._parse).filter(e=>!t||lM(e)>1).map(t=>{const e=function(t,e){const n=rM(t);if("number"===e)return`toNumber(${n})`;if("boolean"===e)return`toBoolean(${n})`;if("string"===e)return`toString(${n})`;if("date"===e)return`toDate(${n})`;if("flatten"===e)return n;if(0===e.indexOf("date:")){return`timeParse(${n},'${mB(e.slice(5,e.length))}')`}if(0===e.indexOf("utc:")){return`utcParse(${n},'${mB(e.slice(4,e.length))}')`}return aC(`Unrecognized parse "${e}".`),null}(t,this._parse[t]);if(!e)return null;return{type:"formula",expr:e,as:uM(t)}}).filter(t=>null!==t)}}class xB extends bR{clone(){return new xB(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set(["_vgsid_"])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:"_vgsid_"}}}class _B extends bR{constructor(t,e){super(t),this.params=e}clone(){return new _B(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return"Graticule "+$D(this.params)}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class OB extends bR{constructor(t,e){super(t),this.params=e}clone(){return new OB(null,this.params)}dependentFields(){return new Set}producedFields(){var t;return new Set([null!==(t=this.params.as)&&void 0!==t?t:"data"])}hash(){return"Hash "+$D(this.params)}assemble(){return Object.assign({type:"sequence"},this.params)}}class wB extends bR{constructor(t){let e;if(super(null),xN(t=null!=t?t:{name:"source"})||(e=t.format?Object.assign({},zD(t.format,["parse"])):{}),yN(t))this._data={values:t.values};else if(bN(t)){if(this._data={url:t.url},!e.type){let n=/(?:\.([^.]+))?$/.exec(t.url)[1];RD(["json","csv","tsv","dsv","topojson"],n)||(n="json"),e.type=n}}else ON(t)?this._data={values:[{type:"Sphere"}]}:(vN(t)||xN(t))&&(this._data={});this._generator=xN(t),t.name&&(this._name=t.name),e&&!VD(e)&&(this._data.format=e)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}var jB;function kB(t){return t instanceof wB||t instanceof _B||t instanceof OB}class EB{constructor(){jB.set(this,void 0),yD(this,jB,!1)}setModified(){yD(this,jB,!0)}get modifiedFlag(){return function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}(this,jB)}}jB=new WeakMap;class AB extends EB{getNodeDepths(t,e,n){n.set(t,e);for(const r of t.children)this.getNodeDepths(r,e+1,n);return n}optimize(t){const e=[...this.getNodeDepths(t,0,new Map).entries()].sort((t,e)=>e[1]-t[1]);for(const t of e)this.run(t[0]);return this.modifiedFlag}}class DB extends EB{optimize(t){this.run(t);for(const e of t.children)this.optimize(e);return this.modifiedFlag}}class MB extends DB{mergeNodes(t,e){const n=e.shift();for(const r of e)t.removeChild(r),r.parent=n,r.remove()}run(t){const e=t.children.map(t=>t.hash()),n={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(t,n[e]))}}class SB extends DB{constructor(t){super(),this.requiresSelectionId=t&&KR(t)}run(t){t instanceof xB&&(this.requiresSelectionId&&(kB(t.parent)||t.parent instanceof pB||t.parent instanceof vB)||(this.setModified(),t.remove()))}}class CB extends EB{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,e){let n=new Set;t instanceof vR&&(n=t.producedFields(),YD(n,e)&&(this.setModified(),t.removeFormulas(e),0===t.producedFields.length&&t.remove()));for(const r of t.children)this.run(r,new Set([...e,...n]))}}class FB extends DB{constructor(){super()}run(t){t instanceof yR&&!t.isRequired()&&(this.setModified(),t.remove())}}class zB extends AB{run(t){if(!(kB(t)||t.numChildren()>1))for(const e of t.children)if(e instanceof vB)if(t instanceof vB)this.setModified(),t.merge(e);else{if(GD(t.producedFields(),e.dependentFields()))continue;this.setModified(),e.swapWithParent()}}}class TB extends AB{run(t){const e=[...t.children],n=t.children.filter(t=>t instanceof vB);if(t.numChildren()>1&&n.length>=1){const r={},i=new Set;for(const t of n){const e=t.parse;for(const t of XD(e))t in r?r[t]!==e[t]&&i.add(t):r[t]=e[t]}for(const t of i)delete r[t];if(!VD(r)){this.setModified();const n=new vB(t,r);for(const i of e){if(i instanceof vB)for(const t of XD(r))delete i.parse[t];t.removeChild(i),i.parent=n,i instanceof vB&&0===XD(i.parse).length&&i.remove()}}}}}class $B extends AB{run(t){t instanceof yR||t.numChildren()>0||t instanceof gB||(this.setModified(),t.remove())}}class NB extends AB{run(t){const e=t.children.filter(t=>t instanceof vR),n=e.pop();for(const t of e)this.setModified(),n.merge(t)}}class RB extends AB{run(t){const e=t.children.filter(t=>t instanceof pB),n={};for(const t of e){const e=$D(t.groupBy);e in n||(n[e]=[]),n[e].push(t)}for(const e of XD(n)){const r=n[e];if(r.length>1){const e=r.pop();for(const n of r)e.merge(n)&&(t.removeChild(n),n.parent=e,n.remove(),this.setModified())}}}}class PB extends AB{constructor(t){super(),this.model=t}run(t){const e=!(kB(t)||t instanceof QR||t instanceof vB||t instanceof xB),n=[],r=[];for(const i of t.children)i instanceof dB&&(e&&!GD(t.producedFields(),i.dependentFields())?n.push(i):r.push(i));if(n.length>0){const e=n.pop();for(const t of n)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof dB?t.merge(e,this.model.renameSignal.bind(this.model)):e.swapWithParent()}if(r.length>1){const t=r.pop();for(const e of r)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified()}}}class BB extends AB{run(t){const e=[...t.children];if(!PD(e,t=>t instanceof yR)||t.numChildren()<=1)return;const n=[];let r;for(const i of e)if(i instanceof yR){let e=i;for(;1===e.numChildren();){const[t]=e.children;if(!(t instanceof yR))break;e=t}n.push(...e.children),r?(t.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=e,this.setModified()):r=e}else n.push(i);if(n.length){this.setModified();for(const t of n)t.parent.removeChild(t),t.parent=r}}}class LB extends bR{constructor(t,e){super(t),this.transform=e}clone(){return new LB(null,CD(this.transform))}addDimensions(t){this.transform.groupby=UD(this.transform.groupby.concat(t),t=>t)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(t=>t.field).filter(t=>void 0!==t).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){var e;return null!==(e=t.as)&&void 0!==e?e:Yz(t)}hash(){return"JoinAggregateTransform "+$D(this.transform)}assemble(){const t=[],e=[],n=[];for(const r of this.transform.joinaggregate)e.push(r.op),n.push(this.getDefaultName(r)),t.push(void 0===r.field?null:r.field);const r=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:e,fields:t},void 0!==r?{groupby:r}:{})}}class IB extends bR{constructor(t,e){super(t),this._stack=e}clone(){return new IB(null,CD(this._stack))}static makeFromTransform(t,e){const{stack:n,groupby:r,as:i,offset:o="zero"}=e,a=[],s=[];if(void 0!==e.sort)for(const t of e.sort)a.push(t.field),s.push(cM(t.order,"ascending"));const u={field:a,order:s};let l;return l=function(t){return Object(Z.B)(t)&&t.every(t=>Object(Z.I)(t))&&t.length>1}(i)?i:Object(Z.I)(i)?[i,i+"_end"]:[e.stack+"_start",e.stack+"_end"],new IB(t,{stackField:n,groupby:r,offset:o,sort:u,facetby:[],as:l})}static makeFromEncoding(t,e){const n=e.stack,{encoding:r}=e;if(!n)return null;const{groupbyChannel:i,fieldChannel:o,offset:a,impute:s}=n;let u;if(i){u=eT(r[i])}const l=function(t){return t.stack.stackBy.reduce((t,e)=>{const n=Yz(e.fieldDef);return n&&t.push(n),t},[])}(e),c=e.encoding.order;let f;return f=Object(Z.B)(c)||Fz(c)?kT(c):l.reduce((t,e)=>(t.field.push(e),t.order.push("y"===o?"descending":"ascending"),t),{field:[],order:[]}),new IB(t,{dimensionFieldDef:u,stackField:e.vgField(o),facetby:[],stackby:l,sort:f,offset:a,impute:s,as:[e.vgField(o,{suffix:"start",forAs:!0}),e.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return"Stack "+$D(this._stack)}getGroupbyFields(){const{dimensionFieldDef:t,impute:e,groupby:n}=this._stack;return t?t.bin?e?[Yz(t,{binSuffix:"mid"})]:[Yz(t,{}),Yz(t,{binSuffix:"end"})]:[Yz(t)]:null!=n?n:[]}assemble(){const t=[],{facetby:e,dimensionFieldDef:n,stackField:r,stackby:i,sort:o,offset:a,impute:s,as:u}=this._stack;if(s&&n){const{band:o=.5,bin:a}=n;a&&t.push({type:"formula",expr:o+"*"+Yz(n,{expr:"datum"})+`+${1-o}*`+Yz(n,{expr:"datum",binSuffix:"end"}),as:Yz(n,{binSuffix:"mid",forAs:!0})}),t.push({type:"impute",field:r,groupby:[...i,...e],key:Yz(n,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...e],field:r,sort:o,as:u,offset:a}),t}}class UB extends bR{constructor(t,e){super(t),this.transform=e}clone(){return new UB(null,CD(this.transform))}addDimensions(t){this.transform.groupby=UD(this.transform.groupby.concat(t),t=>t)}dependentFields(){var t,e;const n=new Set;return(null!==(t=this.transform.groupby)&&void 0!==t?t:[]).forEach(n.add,n),(null!==(e=this.transform.sort)&&void 0!==e?e:[]).forEach(t=>n.add(t.field)),this.transform.window.map(t=>t.field).filter(t=>void 0!==t).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){var e;return null!==(e=t.as)&&void 0!==e?e:Yz(t)}hash(){return"WindowTransform "+$D(this.transform)}assemble(){var t;const e=[],n=[],r=[],i=[];for(const t of this.transform.window)n.push(t.op),r.push(this.getDefaultName(t)),i.push(void 0===t.param?null:t.param),e.push(void 0===t.field?null:t.field);const o=this.transform.frame,a=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&n.every(t=>SM(t)))return Object.assign({type:"joinaggregate",as:r,ops:n,fields:e},void 0!==a?{groupby:a}:{});const s=[],u=[];if(void 0!==this.transform.sort)for(const e of this.transform.sort)s.push(e.field),u.push(null!==(t=e.order)&&void 0!==t?t:"ascending");const l={field:s,order:u},c=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:i,as:r,ops:n,fields:e,sort:l},void 0!==c?{ignorePeers:c}:{}),void 0!==a?{groupby:a}:{}),void 0!==o?{frame:o}:{})}}function qB(t){if(t instanceof gB)if(1!==t.numChildren()||t.children[0]instanceof yR){const n=t.model.component.data.main;!function t(e){if(e instanceof yR&&e.type===jN.Main&&1===e.numChildren()){const n=e.children[0];n instanceof gB||(n.swapWithParent(),t(e))}}(n);const r=(e=t,function t(n){if(!(n instanceof gB)){const r=n.clone();if(r instanceof yR){const t=WB+r.getSource();r.setSource(t),e.model.component.data.outputNodes[t]=r}else(r instanceof pB||r instanceof IB||r instanceof UB||r instanceof LB)&&r.addDimensions(e.fields);for(const e of n.children.flatMap(t))e.parent=r;return[r]}return n.children.flatMap(t)}),i=t.children.map(r).flat();for(const t of i)t.parent=n}else{const e=t.children[0];(e instanceof pB||e instanceof IB||e instanceof UB||e instanceof LB)&&e.addDimensions(t.fields),e.swapWithParent(),qB(t)}else t.children.map(qB);var e}const WB="scale_";function YB(t){for(const e of t){for(const t of e.children)if(t.parent!==e)return!1;if(!YB(e.children))return!1}return!0}function HB(t,e){let n=!1;for(const r of e)n=t.optimize(r)||n;return n}function GB(t,e,n){let r=t.sources,i=!1;return i=HB(new FB,r)||i,i=HB(new SB(e),r)||i,r=r.filter(t=>t.numChildren()>0),i=HB(new $B,r)||i,r=r.filter(t=>t.numChildren()>0),n||(i=HB(new zB,r)||i,i=HB(new PB(e),r)||i,i=HB(new CB,r)||i,i=HB(new TB,r)||i,i=HB(new RB,r)||i,i=HB(new NB,r)||i,i=HB(new MB,r)||i,i=HB(new BB,r)||i),t.sources=r,i}class VB{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,e){return new VB(()=>t(e))}}function XB(t){OL(t)?function(t){const e=t.component.scales;for(const n of XD(e)){const r=JB(t,n);if(e[n].setWithExplicit("domains",r),tL(t,n),t.component.data.isFaceted){let e=t;for(;!wL(e)&&e.parent;)e=e.parent;if("shared"===e.component.resolve.scale[n])for(const t of r.value)kC(t)&&(t.data=WB+t.data.replace(WB,""))}}}(t):function(t){for(const e of t.children)XB(e);const e=t.component.scales;for(const n of XD(e)){let r,i=null;for(const e of t.children){const t=e.component.scales[n];if(t){r=void 0===r?t.getWithExplicit("domains"):gN(r,t.getWithExplicit("domains"),"domains","scale",nL);const e=t.get("selectionExtent");i&&e&&i.selection!==e.selection&&aC("The same selection must be used to override scale domains in a layered view."),i=e}}e[n].setWithExplicit("domains",r),i&&e[n].set("selectionExtent",i,!0)}}(t)}function JB(t,e){const n=t.getScaleComponent(e).get("type"),{encoding:r}=t,i=function(t,e,n,r){if("unaggregated"===t){const{valid:t,reason:r}=eL(e,n);if(!t)return void aC(r)}else if(void 0===t&&r.useUnaggregatedDomain){const{valid:t}=eL(e,n);if(t)return"unaggregated"}return t}(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return i!==t.scaleDomain(e)&&(t.specifiedScales[e]=Object.assign(Object.assign({},t.specifiedScales[e]),{domain:i})),"x"===e&&nT(r.x2)?nT(r.x)?gN(ZB(n,i,t,"x"),ZB(n,i,t,"x2"),"domain","scale",nL):ZB(n,i,t,"x2"):"y"===e&&nT(r.y2)?nT(r.y)?gN(ZB(n,i,t,"y"),ZB(n,i,t,"y2"),"domain","scale",nL):ZB(n,i,t,"y2"):ZB(n,i,t,e)}function KB(t,e,n){var r;const i=null===(r=OC(n))||void 0===r?void 0:r.unit;return"temporal"===e||i?function(t,e,n){return t.map(t=>({signal:`{data: ${lT(t,{timeUnit:n,type:e})}}`}))}(t,e,i):[t]}function ZB(t,e,n,r){const{encoding:i}=n,o=nT(i[r]),{type:a}=o,s=o.timeUnit;if(function(t){return t&&t.unionWith}(e)){const i=ZB(t,void 0,n,r),o=KB(e.unionWith,a,s);return fN([...i.value,...o])}if(wC(e))return fN([e]);if(e&&"unaggregated"!==e&&!vF(e))return fN(KB(e,a,s));const u=n.stack;if(u&&r===u.fieldChannel){if("normalize"===u.offset)return dN([[0,1]]);const t=n.requestDataName(jN.Main);return dN([{data:t,field:n.vgField(r,{suffix:"start"})},{data:t,field:n.vgField(r,{suffix:"end"})}])}const l=_S(r)&&Fz(o)?function(t,e,n){if(!gF(n))return;const r=t.fieldDef(e),i=r.sort;if(_z(i))return{op:"min",field:mP(r,e),order:"ascending"};const{stack:o}=t,a=o?[...o.groupbyField?[o.groupbyField]:[],...o.stackBy.map(t=>t.fieldDef.field)]:void 0;if(xz(i)){const t=o&&!RD(a,i.field);return QB(i,t)}if(vz(i)){const{encoding:e,order:n}=i,r=t.fieldDef(e),{aggregate:s,field:u}=r,l=o&&!RD(a,u);if(DM(s)||MM(s))return QB({field:Yz(r),order:n},l);if(SM(s)||!s)return QB({op:s,field:u,order:n},l)}else{if("descending"===i)return{op:"min",field:t.vgField(e),order:"descending"};if(RD(["ascending",void 0],i))return!0}return}(n,r,t):void 0;if(Tz(o)){return dN(KB([o.datum],a,s))}const c=o;if("unaggregated"===e){const t=n.requestDataName(jN.Main),{field:e}=o;return dN([{data:t,field:Yz({field:e,aggregate:"min"})},{data:t,field:Yz({field:e,aggregate:"max"})}])}if(AS(c.bin)){if(gF(t))return dN("bin-ordinal"===t?[]:[{data:ZD(l)?n.requestDataName(jN.Main):n.requestDataName(jN.Raw),field:n.vgField(r,fT(c,r)?{binSuffix:"range"}:{}),sort:!0!==l&&Object(Z.G)(l)?l:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:t}=c;if(AS(t)){const e=cB(n,c.field,t);return dN([new VB(()=>{const t=n.getSignalName(e);return`[${t}.start, ${t}.stop]`})])}return dN([{data:n.requestDataName(jN.Main),field:n.vgField(r,{})}])}}if(c.timeUnit&&RD(["time","utc"],t)&&Dz(r,c,OL(n)?n.encoding[sS(r)]:void 0,n.stack,n.markDef,n.config)){const t=n.requestDataName(jN.Main);return dN([{data:t,field:n.vgField(r)},{data:t,field:n.vgField(r,{suffix:"end"})}])}return dN(l?[{data:ZD(l)?n.requestDataName(jN.Main):n.requestDataName(jN.Raw),field:n.vgField(r),sort:l}]:[{data:n.requestDataName(jN.Main),field:n.vgField(r)}])}function QB(t,e){const{op:n,field:r,order:i}=t;return Object.assign(Object.assign({op:null!=n?n:e?"sum":mz},r?{field:aM(r)}:{}),i?{order:i}:{})}function tL(t,e){var n;const r=t.component.scales[e],i=t.specifiedScales[e].domain,o=null===(n=t.fieldDef(e))||void 0===n?void 0:n.bin,a=vF(i)&&i,s=MS(o)&&SS(o.extent)&&o.extent;(a||s)&&r.set("selectionExtent",null!=a?a:s,!0)}function eL(t,e){const{aggregate:n,type:r}=t;return n?Object(Z.I)(n)&&!TM[n]?{valid:!1,reason:JS(n)}:"quantitative"===r&&"log"===e?{valid:!1,reason:KS(t)}:{valid:!0}:{valid:!1,reason:XS(t)}}function nL(t,e,n,r){return t.explicit&&e.explicit&&aC(function(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${TD(n)} and ${TD(r)}). Using the union of the two domains.`}(n,r,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function rL(t){const e=UD(t.map(t=>{if(kC(t)){return bD(t,["sort"])}return t}),$D),n=UD(t.map(t=>{if(kC(t)){const e=t.sort;return void 0===e||ZD(e)||("op"in e&&"count"===e.op&&delete e.field,"ascending"===e.order&&delete e.order),e}}).filter(t=>void 0!==t),$D);if(0===e.length)return;if(1===e.length){const e=t[0];if(kC(e)&&n.length>0){let t=n[0];if(n.length>1)aC(tC),t=!0;else if(Object(Z.G)(t)&&"field"in t){const n=t.field;e.field===n&&(t=!t.order||{order:t.order})}return Object.assign(Object.assign({},e),{sort:t})}return e}const r=UD(n.map(t=>ZD(t)||!("op"in t)||Object(Z.I)(t.op)&&t.op in AM?t:(aC(function(t){return`Dropping sort property ${TD(t)} as unioned domains only support boolean or op "count", "min", and "max".`}(t)),!0)),$D);let i;1===r.length?i=r[0]:r.length>1&&(aC(tC),i=!0);const o=UD(t.map(t=>kC(t)?t.data:null),t=>t);if(1===o.length&&null!==o[0]){return Object.assign({data:o[0],fields:e.map(t=>t.field)},i?{sort:i}:{})}return Object.assign({fields:e},i?{sort:i}:{})}function iL(t){if(kC(t)&&Object(Z.I)(t.field))return t.field;if(function(t){return!Object(Z.B)(t)&&("fields"in t&&!("data"in t))}(t)){let e;for(const n of t.fields)if(kC(n)&&Object(Z.I)(n.field))if(e){if(e!==n.field)return aC("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),e}else e=n.field;return aC("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),e}if(function(t){return!Object(Z.B)(t)&&("fields"in t&&"data"in t)}(t)){aC("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const e=t.fields[0];return Object(Z.I)(e)?e:void 0}}function oL(t,e){return rL(t.component.scales[e].get("domains").map(e=>(kC(e)&&(e.data=t.lookupDataSource(e.data)),e)))}function aL(t){return XD(t.component.scales).reduce((e,n)=>{const r=t.component.scales[n];if(r.merged)return e;const i=r.combine(),{name:o,type:a,selectionExtent:s,domains:u,range:l,reverse:c}=i,f=bD(i,["name","type","selectionExtent","domains","range","reverse"]),d=function(t,e,n,r){if(hS(n)){if(jC(t))return{step:{signal:e+"_step"}}}else if(Object(Z.G)(t)&&kC(t))return Object.assign(Object.assign({},t),{data:r.lookupDataSource(t.data)});return t}(i.range,o,n,t);let h;s&&(h=function(t,e){const n=e.selection;return{signal:eP(t.getSelectionComponent(n,QD(n)),e)}}(t,s));const p=oL(t,n);return e.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:o,type:a},p?{domain:p}:{}),h?{domainRaw:h}:{}),{range:d}),void 0!==c?{reverse:c}:{}),f)),e},[])}class sL extends cN{constructor(t,e){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",e)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||PD(this.get("domains"),t=>Object(Z.B)(t)&&2===t.length&&t[0]<=0&&t[1]>=0)}}const uL=["range","scheme"];function lL(t){return"x"===t?"width":"y"===t?"height":void 0}function cL(t,e){const n=t.fieldDef(e);if(n&&n.bin&&AS(n.bin)){const r=cB(t,n.field,n.bin),i=lL(e),o=t.getName(i);return new VB(()=>{const e=t.getSignalName(r),n=`(${e}.stop - ${e}.start) / ${e}.step`;return`${t.getSignalName(o)} / (${n})`})}}function fL(t,e){const n=e.specifiedScales[t],{size:r}=e,i=e.getScaleComponent(t).get("type");for(const r of uL)if(void 0!==n[r]){const o=OF(i,r),a=wF(t,r);if(o)if(a)aC(a);else switch(r){case"range":{const r=n.range;if(Object(Z.B)(r)){if(hS(t))return fN(r.map(t=>{if("width"===t||"height"===t){const n=e.getName(t),r=e.getSignalName.bind(e);return VB.fromName(r,n)}return t}))}else if(Object(Z.G)(r))return fN({data:e.requestDataName(jN.Main),field:r.field,sort:{op:"min",field:e.vgField(t)}});return fN(r)}case"scheme":return fN(dL(n[r]))}else aC(ZS(i,r,t))}if("x"===t||"y"===t){const e="x"===t?"width":"height",n=r[e];if(y$(n)){if(gF(i))return fN({step:n.step});aC(QS(e))}}const{rangeMin:o,rangeMax:a}=n,s=function(t,e){const{size:n,config:r,mark:i,encoding:o}=e,a=e.getSignalName.bind(e),{type:s}=nT(o[t]),u=e.getScaleComponent(t).get("type"),{domain:l,domainMid:c}=e.specifiedScales[t];switch(t){case"x":case"y":{if(RD(["point","band"],u))if("x"!==t||n.width){if("y"===t&&!n.height){const t=w$(r.view,"height");if(y$(t))return t}}else{const t=w$(r.view,"width");if(y$(t))return t}const i=lL(t),o=e.getName(i);return"y"===t&&mF(u)?[VB.fromName(a,o),0]:[0,VB.fromName(a,o)]}case"size":{const o=e.component.scales[t].get("zero"),a=function t(e,n,r){if(n)return wC(n)?{signal:`${n.signal} ? 0 : ${t(e,!1,r)}`}:0;switch(e){case"bar":case"tick":return r.scale.minBandSize;case"line":case"trail":case"rule":return r.scale.minStrokeWidth;case"text":return r.scale.minFontSize;case"point":case"square":case"circle":return r.scale.minSize}throw new Error(HS("size",e))}(i,o,r),s=function(t,e,n,r){const i={x:cL(n,"x"),y:cL(n,"y")};switch(t){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const t=hL(e,i,r.view);return Object(Z.F)(t)?t-1:new VB(()=>t.signal+" - 1")}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const t=hL(e,i,r.view);return Object(Z.F)(t)?Math.pow(.95*t,2):new VB(()=>`pow(0.95 * ${t.signal}, 2)`)}}throw new Error(HS("size",t))}(i,n,e,r);return yF(u)?function(t,e,n){const r=()=>{const r=vT(e),i=vT(t),o=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${o}, ${o})`};return wC(e)?new VB(r):{signal:r()}}(a,s,function(t,e,n,r){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return void 0!==n&&Object(Z.B)(n)?n.length+1:(aC(function(t){return`Domain for ${t} is required for threshold scale.`}(r)),3)}}(u,r,l,t)):[a,s]}case PM:return[0,2*Math.PI];case"angle":return[0,360];case RM:return[0,new VB(()=>`min(${e.getSignalName("width")},${e.getSignalName("height")})/2`)];case"strokeWidth":return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case"strokeDash":return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case qM:return"symbol";case LM:case IM:case UM:return"ordinal"===u?"nominal"===s?"category":"ordinal":void 0!==c?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case"opacity":case"fillOpacity":case"strokeOpacity":return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error("Scale range undefined for channel "+t)}(t,e);return(void 0!==o||void 0!==a)&&OF(i,"rangeMin")&&Object(Z.B)(s)&&2===s.length?fN([null!=o?o:s[0],null!=a?a:s[1]]):dN(s)}function dL(t){return function(t){return!Object(Z.I)(t)&&!!t.name}(t)?Object.assign({scheme:t.name},zD(t,["name"])):{scheme:t}}function hL(t,e,n){const r=y$(t.width)?t.width.step:O$(n,"width"),i=y$(t.height)?t.height.step:O$(n,"height");return e.x||e.y?new VB(()=>`min(${[e.x?e.x.signal:r,e.y?e.y.signal:i].join(", ")})`):Math.min(r,i)}function pL(t,e){OL(t)?function(t,e){const n=t.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=t;for(const s of XD(n)){const u=a[s],l=n[s],c=t.getScaleComponent(s),f=nT(i[s]),d=u[e],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=OF(h,e),b=wF(s,e);if(void 0!==d&&(m?b&&aC(b):aC(ZS(h,e,s))),m&&void 0===b)if(void 0!==d){const t=f.timeUnit,n=f.type;switch(e){case"domainMax":case"domainMin":sC(u[e])||"temporal"===n||t?l.set(e,{signal:lT(u[e],{type:n,timeUnit:t})},!0):l.set(e,u[e],!0);break;default:l.copyKeyFromObject(e,u)}}else{const n=e in gL?gL[e]({model:t,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,markDef:o,config:r}):r.scale[e];void 0!==n&&l.set(e,n,!1)}}}(t,e):bL(t,e)}const gL={bins:({model:t,fieldOrDatumDef:e})=>Fz(e)?function(t,e){const n=e.bin;if(AS(n)){const r=cB(t,e.field,n);return new VB(()=>t.getSignalName(r))}if(DS(n)&&MS(n)&&void 0!==n.step)return{step:n.step};return}(t,e):void 0,interpolate:({channel:t,fieldOrDatumDef:e})=>function(t,e){if(RD([LM,IM,UM],t)&&"nominal"!==e)return"hcl";return}(t,e.type),nice:({scaleType:t,channel:e,fieldOrDatumDef:n})=>function(t,e,n){var r;if((null===(r=eT(n))||void 0===r?void 0:r.bin)||RD([KC,ZC],t))return;return e in fS||void 0}(t,e,n),padding:({channel:t,scaleType:e,fieldOrDatumDef:n,markDef:r,config:i})=>function(t,e,n,r,i,o){if(t in fS){if(bF(e)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:e,orient:a}=i;if("bar"===e&&(!Fz(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===t||"horizontal"===a&&"y"===t))return o.continuousBandSize}if(e===nF)return n.pointPadding}return}(t,e,i.scale,n,r,i.bar),paddingInner:({scalePadding:t,channel:e,markDef:n,config:r})=>function(t,e,n,r){if(void 0!==t)return;if(e in fS){const{bandPaddingInner:t,barBandPaddingInner:e,rectBandPaddingInner:i}=r;return cM(t,"bar"===n?e:i)}return}(t,e,n.type,r.scale),paddingOuter:({scalePadding:t,channel:e,scaleType:n,markDef:r,scalePaddingInner:i,config:o})=>function(t,e,n,r,i,o){if(void 0!==t)return;if(e in fS&&n===rF){const{bandPaddingOuter:t}=o;return cM(t,wC(i)?{signal:i.signal+"/2"}:i/2)}return}(t,e,n,r.type,i,o.scale),reverse:({fieldOrDatumDef:t,scaleType:e,channel:n,config:r})=>function(t,e,n,r){if("x"===n&&void 0!==r.xReverse)return mF(t)&&"descending"===e?wC(r.xReverse)?{signal:"!"+r.xReverse.signal}:!r.xReverse:r.xReverse;if(mF(t)&&"descending"===e)return!0;return}(e,Fz(t)?t.sort:void 0,n,r.scale),zero:({channel:t,fieldOrDatumDef:e,domain:n,markDef:r,scaleType:i})=>function(t,e,n,r,i){if(n&&"unaggregated"!==n&&mF(i)){if(Object(Z.B)(n)){const t=n[0],e=n[n.length-1];if(t<=0&&e>=0)return!0}return!1}if("size"===t&&"quantitative"===e.type&&!yF(i))return!0;if((!Fz(e)||!e.bin)&&RD([...dS,...gS],t)){const{orient:e,type:n}=r;return!RD(["bar","area","line","trail"],n)||!("horizontal"===e&&"y"===t||"vertical"===e&&"x"===t)}return!1}(t,e,n,r,i)};function mL(t){OL(t)?function(t){const e=t.component.scales;for(const n of xS){const r=e[n];if(!r)continue;const i=fL(n,t);r.setWithExplicit("range",i)}}(t):bL(t,"range")}function bL(t,e){const n=t.component.scales;for(const n of t.children)"range"===e?mL(n):pL(n,e);for(const r of XD(n)){let i;for(const n of t.children){const t=n.component.scales[r];if(t){i=gN(i,t.getWithExplicit(e),e,"scale",hN((t,n)=>{switch(e){case"range":return t.step&&n.step?t.step-n.step:0}return 0}))}}n[r].setWithExplicit(e,i)}}function yL(t,e,n,r){const i=function(t,e,n){var r;switch(e.type){case"nominal":case"ordinal":if(XM(t)||"discrete"===kS(t))return"shape"===t&&"ordinal"===e.type&&aC(VS(t,"ordinal")),"ordinal";if(t in fS){if(RD(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&t in pS)return"band";return void 0!==e.band||Iz(e)&&(null===(r=e.axis)||void 0===r?void 0:r.tickBand)?"band":"point";case"temporal":return XM(t)?"time":"discrete"===kS(t)?(aC(VS(t,"temporal")),"ordinal"):Fz(e)&&e.timeUnit&&OC(e.timeUnit).utc?"utc":"time";case"quantitative":return XM(t)?Fz(e)&&AS(e.bin)?"bin-ordinal":"linear":"discrete"===kS(t)?(aC(VS(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(qS(e.type))}(e,n,r),{type:o}=t;return _S(e)?void 0!==o?function(t,e){if(!_S(t))return!1;switch(t){case"x":case"y":case PM:case RM:return bF(e)||RD(["band","point"],e);case"size":case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case"angle":return bF(e)||yF(e)||RD(["band","point","ordinal"],e);case LM:case IM:case UM:return"band"!==e;case"strokeDash":return"ordinal"===e||yF(e);case qM:return"ordinal"===e}}(e,o)?Fz(n)&&(a=o,s=n.type,!(RD([UC,WC],s)?void 0===a||gF(a):s===qC?RD([KC,ZC,void 0],a):s!==IC||RD([GC,VC,XC,JC,QC,tF,eF,HC,void 0],a)))?(aC(function(t,e){return`FieldDef does not work with "${t}" scale. We are using "${e}" scale instead.`}(o,i)),i):o:(aC(function(t,e,n){return`Channel "${t}" does not work with "${e}" scale. We are using "${n}" scale instead.`}(e,o,i)),i):i:null;var a,s}function vL(t){OL(t)?t.component.scales=function(t){const{encoding:e,mark:n}=t;return xS.reduce((r,i)=>{const o=nT(e[i]);if(o&&n===LF&&i===qM&&o.type===YC)return r;let a=o&&o.scale;if(o&&null!==a&&!1!==a){a=null!=a?a:{};const e=yL(a,i,o,n);r[i]=new sL(t.scaleName(i+"",!0),{value:e,explicit:a.type===e})}return r},{})}(t):t.component.scales=function(t){var e;const n=t.component.scales={},r={},i=t.component.resolve;for(const n of t.children){vL(n);for(const o of XD(n.component.scales))if(i.scale[o]=null!==(e=i.scale[o])&&void 0!==e?e:PP(o,t),"shared"===i.scale[o]){const t=r[o],e=n.component.scales[o].getWithExplicit("type");t?oF(t.value,e.value)?r[o]=gN(t,e,"type","scale",xL):(i.scale[o]="independent",delete r[o]):r[o]=e}}for(const e of XD(r)){const i=t.scaleName(e,!0),o=r[e];n[e]=new sL(i,o);for(const n of t.children){const t=n.component.scales[e];t&&(n.renameScale(t.get("name"),i),t.merged=!0)}}return n}(t)}const xL=hN((t,e)=>sF(t)-sF(e));class _L{constructor(){this.nameMap={}}rename(t,e){this.nameMap[t]=e}has(t){return void 0!==this.nameMap[t]}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function OL(t){return"unit"===(null==t?void 0:t.type)}function wL(t){return"facet"===(null==t?void 0:t.type)}function jL(t){return"concat"===(null==t?void 0:t.type)}function kL(t){return"layer"===(null==t?void 0:t.type)}class EL{constructor(t,e,n,r,i,o,a){var s,u;this.type=e,this.parent=n,this.config=i,this.children=[],this.correctDataNames=t=>(t.from&&t.from.data&&(t.from.data=this.lookupDataSource(t.from.data)),t.from&&t.from.facet&&t.from.facet.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t),this.parent=n,this.config=i,this.view=kF(a),this.name=null!==(s=t.name)&&void 0!==s?s:r,this.title=hT(t.title)?{text:t.title}:t.title?this.initTitle(t.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new _L,this.projectionNameMap=n?n.projectionNameMap:new _L,this.signalNameMap=n?n.signalNameMap:new _L,this.data=t.data,this.description=t.description,this.transforms=(null!==(u=t.transform)&&void 0!==u?u:[]).map(t=>kN(t)?{filter:MD(t.filter,LC)}:t),this.layout="layer"===e||"unit"===e?{}:function(t,e,n){var r,i;const o=n[e],a={},{spacing:s,columns:u}=o;void 0!==s&&(a.spacing=s),void 0!==u&&(jz(t)&&!Oz(t.facet)||g$(t))&&(a.columns=u),m$(t)&&(a.columns=1);for(const e of x$)if(void 0!==t[e])if("spacing"===e){const n=t[e];a[e]=Object(Z.F)(n)?n:{row:null!==(r=n.row)&&void 0!==r?r:s,column:null!==(i=n.column)&&void 0!==i?i:s}}else a[e]=t[e];return a}(t,e,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:jz(t)||n&&n.component.data.isFaceted&&void 0===t.data},layoutSize:new cN,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?CD(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}initTitle(t){const e=XD(t),n={text:gT(t.text)};for(const r of e)n[r]=gT(t[r]);return n}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(t,{ignoreRange:e}={}){vL(t),XB(t);for(const e of _F)pL(t,e);e||mL(t)}(this)}parseProjection(){uB(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){ZP(this)}assembleGroupStyle(){var t,e;if("unit"===this.type||"layer"===this.type)return null!==(e=null===(t=this.view)||void 0===t?void 0:t.style)&&void 0!==e?e:"cell"}assembleEncodeFromView(t){const e=bD(t,["style"]),n={};for(const t of XD(e)){const r=e[t];void 0!==r&&(n[t]=bT(r))}return n}assembleGroupEncodeEntry(t){let e={};return this.view&&(e=this.assembleEncodeFromView(this.view)),t||(this.description&&(e.description=bT(this.description)),"unit"!==this.type&&"layer"!==this.type)?VD(e)?void 0:e:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!=e?e:{})}assembleLayout(){if(!this.layout)return;const t=this.layout,{spacing:e}=t,n=bD(t,["spacing"]),{component:r,config:i}=this,o=function(t,e){const n={};for(const r of KM){const i=t[r];if(null==i?void 0:i.facetFieldDef){const{titleAnchor:t,titleOrient:o}=vP(["titleAnchor","titleOrient"],i.facetFieldDef.header,e,r),a=bP(r,o),s=SP(t,a);void 0!==s&&(n[a]=s)}}return VD(n)?void 0:n}(r.layoutHeaders,i);return Object.assign(Object.assign(Object.assign({padding:e},this.assembleDefaultLayout()),n),o?{titleBand:o}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let e=[];for(const n of KM)t[n].title&&e.push(OP(this,n));for(const t of xP)e=e.concat(kP(this,t));return e}assembleAxes(){return function(t,e){const{x:n=[],y:r=[]}=t;return[...n.map(t=>iP(t,"grid",e)),...r.map(t=>iP(t,"grid",e)),...n.map(t=>iP(t,"main",e)),...r.map(t=>iP(t,"main",e))].filter(t=>t)}(this.component.axes,this.config)}assembleLegends(){return rB(this)}assembleProjections(){return iB(this)}assembleTitle(){var t,e,n;const r=null!==(t=this.title)&&void 0!==t?t:{},{encoding:i}=r,o=bD(r,["encoding"]),a=Object.assign(Object.assign(Object.assign({},dT(this.config.title).nonMark),o),i?{encode:{update:i}}:{});if(a.text)return RD(["unit","layer"],this.type)?RD(["middle",void 0],a.anchor)&&(a.frame=null!==(e=a.frame)&&void 0!==e?e:"group"):a.anchor=null!==(n=a.anchor)&&void 0!==n?n:"start",VD(a)?void 0:a}assembleGroup(t=[]){const e={};(t=t.concat(this.assembleSignals())).length>0&&(e.signals=t);const n=this.assembleLayout();n&&(e.layout=n),e.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||wL(this.parent)?function t(e){return kL(e)||jL(e)?e.children.reduce((e,n)=>e.concat(t(n)),aL(e)):aL(e)}(this):[];r.length>0&&(e.scales=r);const i=this.assembleAxes();i.length>0&&(e.axes=i);const o=this.assembleLegends();return o.length>0&&(e.legends=o),e}getName(t){return QD((this.name?this.name+"_":"")+t)}getDataName(t){return this.getName(jN[t].toLowerCase())}requestDataName(t){const e=this.getDataName(t),n=this.component.data.outputNodeRefCounts;return n[e]=(n[e]||0)+1,e}getSizeSignalRef(t){if(wL(this.parent)){const e=mS(NP(t)),n=this.component.scales[e];if(n&&!n.merged){const t=n.get("type"),r=n.get("range");if(gF(t)&&jC(r)){const t=n.get("name"),r=iL(oL(this,e));if(r){return{signal:$P(t,n,Yz({aggregate:"distinct",field:r},{expr:"datum"}))}}return aC(NS(e)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const e=this.component.data.outputNodes[t];return e?e.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,e){this.signalNameMap.rename(t,e)}renameScale(t,e){this.scaleNameMap.rename(t,e)}renameProjection(t,e){this.projectionNameMap.rename(t,e)}scaleName(t,e){return e?this.getName(t):nS(t)&&_S(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t))?this.scaleNameMap.get(this.getName(t)):void 0}projectionName(t){return t?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const e=this.component.scales[t];return e&&!e.merged?e:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,e){let n=this.component.selection[t];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(t,e)),!n)throw new Error(`Cannot find a selection named "${e}".`);return n}hasAxisOrientSignalRef(){var t,e;return(null===(t=this.component.axes.x)||void 0===t?void 0:t.some(t=>t.hasOrientSignalRef()))||(null===(e=this.component.axes.y)||void 0===e?void 0:e.some(t=>t.hasOrientSignalRef()))}}class AL extends EL{vgField(t,e={}){const n=this.fieldDef(t);if(n)return Yz(n,e)}reduceFieldDef(t,e){return function(t,e,n,r){return t?XD(t).reduce((n,i)=>{const o=t[i];return Object(Z.B)(o)?o.reduce((t,n)=>e.call(r,t,n,i),n):e.call(r,n,o,i)},n):n}(this.getMapping(),(e,n,r)=>{const i=eT(n);return i?t(e,i,r):e},e)}forEachFieldDef(t,e){NT(this.getMapping(),(e,n)=>{const r=eT(e);r&&t(r,n)},e)}}class DL extends bR{constructor(t,e){var n,r,i;super(t),this.transform=e,this.transform=CD(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"value",null!==(i=o[1])&&void 0!==i?i:"density"]}clone(){return new DL(null,CD(this.transform))}dependentFields(){var t;return new Set([this.transform.density,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"DensityTransform "+$D(this.transform)}assemble(){const t=this.transform,{density:e}=t,n=bD(t,["density"]);return Object.assign({type:"kde",field:e},n)}}class ML extends bR{constructor(t,e){super(t),this.filter=e}clone(){return new ML(null,Object.assign({},this.filter))}static make(t,e){const{config:n,mark:r,markDef:i}=e;if("filter"!==_T("invalid",i,n))return null;const o=e.reduceFieldDef((t,n,i)=>{const o=_S(i)&&e.getScaleComponent(i);if(o){mF(o.get("type"))&&"count"!==n.aggregate&&!IF(r)&&(t[n.field]=n)}return t},{});return XD(o).length?new ML(t,o):null}dependentFields(){return new Set(XD(this.filter))}producedFields(){return new Set}hash(){return"FilterInvalid "+$D(this.filter)}assemble(){const t=XD(this.filter).reduce((t,e)=>{const n=this.filter[e],r=Yz(n,{expr:"datum"});return null!==n&&("temporal"===n.type?t.push(`(isDate(${r}) || (isValid(${r}) && isFinite(+${r})))`):"quantitative"===n.type&&(t.push(`isValid(${r})`),t.push(`isFinite(+${r})`))),t},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class SL extends bR{constructor(t,e){super(t),this.transform=e,this.transform=CD(e);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map((t,e)=>{var n;return null!==(n=r[e])&&void 0!==n?n:t})}clone(){return new SL(this.parent,CD(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return"FlattenTransform "+$D(this.transform)}assemble(){const{flatten:t,as:e}=this.transform;return{type:"flatten",fields:t,as:e}}}class CL extends bR{constructor(t,e){var n,r,i;super(t),this.transform=e,this.transform=CD(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"key",null!==(i=o[1])&&void 0!==i?i:"value"]}clone(){return new CL(null,CD(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return"FoldTransform "+$D(this.transform)}assemble(){const{fold:t,as:e}=this.transform;return{type:"fold",fields:t,as:e}}}class FL extends bR{constructor(t,e,n,r){super(t),this.fields=e,this.geojson=n,this.signal=r}clone(){return new FL(null,CD(this.fields),this.geojson,this.signal)}static parseAll(t,e){if(e.component.projection&&!e.component.projection.isFit)return t;let n=0;for(const r of[["longitude","latitude"],["longitude2","latitude2"]]){const i=r.map(t=>{const n=nT(e.encoding[t]);return Fz(n)?n.field:Tz(n)?{expr:""+n.datum}:Bz(n)?{expr:""+n.value}:void 0});(i[0]||i[1])&&(t=new FL(t,i,null,e.getName("geojson_"+n++)))}if(e.channelHasField(qM)){const r=e.typedFieldDef(qM);r.type===YC&&(t=new FL(t,null,r.field,e.getName("geojson_"+n++)))}return t}dependentFields(){var t;const e=(null!==(t=this.fields)&&void 0!==t?t:[]).filter(Z.I);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${$D(this.fields)}`}assemble(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}class zL extends bR{constructor(t,e,n,r){super(t),this.projection=e,this.fields=n,this.as=r}clone(){return new zL(null,this.projection,CD(this.fields),CD(this.as))}static parseAll(t,e){if(!e.projectionName())return t;for(const n of[["longitude","latitude"],["longitude2","latitude2"]]){const r=n.map(t=>{const n=nT(e.encoding[t]);return Fz(n)?n.field:Tz(n)?{expr:""+n.datum}:Bz(n)?{expr:""+n.value}:void 0}),i="longitude2"===n[0]?"2":"";(r[0]||r[1])&&(t=new zL(t,e.projectionName(),r,[e.getName("x"+i),e.getName("y"+i)]))}return t}dependentFields(){return new Set(this.fields.filter(Z.I))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${$D(this.fields)} ${$D(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class TL extends bR{constructor(t,e){super(t),this.transform=e}clone(){return new TL(null,CD(this.transform))}dependentFields(){var t;return new Set([this.transform.impute,this.transform.key,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:e=0,stop:n,step:r}=t;return{signal:`sequence(${[e,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,e){return new TL(t,e)}static makeFromEncoding(t,e){const n=e.encoding,r=n.x,i=n.y;if(Fz(r)&&Fz(i)){const o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;const a=r.impute?i:i.impute?r:void 0,{method:s,value:u,frame:l,keyvals:c}=o.impute,f=RT(e.mark,n);return new TL(t,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:a.field},s?{method:s}:{}),void 0!==u?{value:u}:{}),l?{frame:l}:{}),void 0!==c?{keyvals:c}:{}),f.length?{groupby:f}:{}))}return null}hash(){return"Impute "+$D(this.transform)}assemble(){const{impute:t,key:e,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,s=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:t,key:e},n?{keyvals:(u=n,void 0!==(null==u?void 0:u.stop)?this.processSequence(n):n)}:{}),{method:"value"}),i?{groupby:i}:{}),{value:r&&"value"!==r?null:o});var u;if(r&&"value"!==r){return[s,Object.assign({type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1},i?{groupby:i}:{}),{type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t}]}return[s]}}class $L extends bR{constructor(t,e){var n,r,i;super(t),this.transform=e,this.transform=CD(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:e.on,null!==(i=o[1])&&void 0!==i?i:e.loess]}clone(){return new $L(null,CD(this.transform))}dependentFields(){var t;return new Set([this.transform.loess,this.transform.on,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"LoessTransform "+$D(this.transform)}assemble(){const t=this.transform,{loess:e,on:n}=t,r=bD(t,["loess","on"]);return Object.assign({type:"loess",x:n,y:e},r)}}class NL extends bR{constructor(t,e,n){super(t),this.transform=e,this.secondary=n}clone(){return new NL(null,CD(this.transform),this.secondary)}static make(t,e,n,r){const i=e.component.data.sources,{from:o}=n;let a=null;if(function(t){return"data"in t}(o)){let t=JL(o.data,i);t||(t=new wB(o.data),i.push(t));const n=e.getName("lookup_"+r);a=new yR(t,n,jN.Lookup,e.component.data.outputNodeRefCounts),e.component.data.outputNodes[n]=a}else if(function(t){return"selection"in t}(o)){const t=o.selection;if(n=Object.assign({as:t},n),a=e.getSelectionComponent(QD(t),t).materialized,!a)throw new Error(`Cannot define and lookup the "${t}" selection in the same view. Try moving the lookup into a second, layered view?`)}return new NL(t,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?Object(Z.i)(this.transform.as):this.transform.from.fields)}hash(){return"Lookup "+$D({transform:this.transform,secondary:this.secondary})}assemble(){let t;if(this.transform.from.fields)t=Object.assign({values:this.transform.from.fields},this.transform.as?{as:Object(Z.i)(this.transform.as)}:{});else{let e=this.transform.as;Object(Z.I)(e)||(aC('If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.'),e="_lookup"),t={as:[e]}}return Object.assign(Object.assign({type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup]},t),this.transform.default?{default:this.transform.default}:{})}}class RL extends bR{constructor(t,e){var n,r,i;super(t),this.transform=e,this.transform=CD(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"prob",null!==(i=o[1])&&void 0!==i?i:"value"]}clone(){return new RL(null,CD(this.transform))}dependentFields(){var t;return new Set([this.transform.quantile,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"QuantileTransform "+$D(this.transform)}assemble(){const t=this.transform,{quantile:e}=t,n=bD(t,["quantile"]);return Object.assign({type:"quantile",field:e},n)}}class PL extends bR{constructor(t,e){var n,r,i;super(t),this.transform=e,this.transform=CD(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:e.on,null!==(i=o[1])&&void 0!==i?i:e.regression]}clone(){return new PL(null,CD(this.transform))}dependentFields(){var t;return new Set([this.transform.regression,this.transform.on,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"RegressionTransform "+$D(this.transform)}assemble(){const t=this.transform,{regression:e,on:n}=t,r=bD(t,["regression","on"]);return Object.assign({type:"regression",x:n,y:e},r)}}class BL extends bR{constructor(t,e){super(t),this.transform=e}clone(){return new BL(null,CD(this.transform))}addDimensions(t){var e;this.transform.groupby=UD((null!==(e=this.transform.groupby)&&void 0!==e?e:[]).concat(t),t=>t)}producedFields(){}dependentFields(){var t;return new Set([this.transform.pivot,this.transform.value,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}hash(){return"PivotTransform "+$D(this.transform)}assemble(){const{pivot:t,value:e,groupby:n,limit:r,op:i}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:t,value:e},void 0!==r?{limit:r}:{}),void 0!==i?{op:i}:{}),void 0!==n?{groupby:n}:{})}}class LL extends bR{constructor(t,e){super(t),this.transform=e}clone(){return new LL(null,CD(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return"SampleTransform "+$D(this.transform)}assemble(){return{type:"sample",size:this.transform.sample}}}function IL(t){let e=0;return function n(r,i){var o;if(r instanceof wB&&!r.isGenerator&&!bN(r.data)){t.push(i);i={name:null,source:i.name,transform:[]}}if(r instanceof vB&&(r.parent instanceof wB&&!i.source?(i.format=Object.assign(Object.assign({},null!==(o=i.format)&&void 0!==o?o:{}),{parse:r.assembleFormatParse()}),i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof gB){i.name||(i.name="data_"+e++),!i.source||i.transform.length>0?(t.push(i),r.data=i.name):r.data=i.source;for(const e of r.assemble())t.push(e)}else{if((r instanceof _B||r instanceof OB||r instanceof ML||r instanceof QR||r instanceof gP||r instanceof zL||r instanceof FL||r instanceof pB||r instanceof NL||r instanceof UB||r instanceof LB||r instanceof CL||r instanceof SL||r instanceof DL||r instanceof $L||r instanceof RL||r instanceof PL||r instanceof xB||r instanceof LL||r instanceof BL)&&i.transform.push(r.assemble()),(r instanceof dB||r instanceof vR||r instanceof TL||r instanceof IB)&&i.transform.push(...r.assemble()),r instanceof yR)if(i.source&&0===i.transform.length)r.setSource(i.source);else if(r.parent instanceof yR)r.setSource(i.name);else if(i.name||(i.name="data_"+e++),r.setSource(i.name),1===r.numChildren()){t.push(i);i={name:null,source:i.name,transform:[]}}switch(r.numChildren()){case 0:r instanceof yR&&(!i.source||i.transform.length>0)&&t.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name="data_"+e++);let o=i.name;!i.source||i.transform.length>0?t.push(i):o=i.source;for(const t of r.children){n(t,{name:null,source:o,transform:[]})}break}}}}}function UL(t,e){var n;const{facet:r,config:i,child:o,component:a}=t;if(t.channelHasField(e)){const s=r[e],u=yP("title",null,i,e);let l=Kz(s,i,{allowDisabling:!0,includeDefault:void 0===u||!!u});o.component.layoutHeaders[e].title&&(l=Object(Z.B)(l)?l.join(", "):l,l+=" / "+o.component.layoutHeaders[e].title,o.component.layoutHeaders[e].title=null);const c=yP("labelOrient",s,i,e),f=cM((null!==(n=s.header)&&void 0!==n?n:{}).labels,i.header.labels,!0),d=RD(["bottom","right"],c)?"footer":"header";a.layoutHeaders[e]={title:l,facetFieldDef:s,[d]:"facet"===e?[]:[qL(t,e,f)]}}}function qL(t,e,n){const r="row"===e?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(r)?t.child.getSizeSignalRef(r):void 0,axes:[]}}function WL(t,e){var n;const{child:r}=t;if(r.component.axes[e]){const{layoutHeaders:o,resolve:a}=t.component;if(a.axis[e]=BP(a,e),"shared"===a.axis[e]){const a="x"===e?"column":"row",s=o[a];for(const o of r.component.axes[e]){const e="top"===(i=o.get("orient"))||"left"===i||wC(i)?"header":"footer";s[e]=null!==(n=s[e])&&void 0!==n?n:[qL(t,a,!1)];const r=iP(o,"main",t.config,{header:!0});r&&s[e][0].axes.push(r),o.mainExtracted=!0}}}var i}function YL(t){for(const e of t.children)e.parseLayoutSize()}function HL(t,e){const n=NP(e),r=mS(n),i=t.component.resolve,o=t.component.layoutSize;let a;for(const e of t.children){const t=e.component.layoutSize.getWithExplicit(n),o=i.scale[r];if("independent"===o&&"step"===t.value){a=void 0;break}if(a){if("independent"===o&&a.value!==t.value){a=void 0;break}a=gN(a,t,n,"")}else a=t}if(a){for(const r of t.children)t.renameSignal(r.getName(n),t.getName(e)),r.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(e,a)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function GL(t,e){const n="width"===e?"x":"y",r=t.config,i=t.getScaleComponent(n);if(i){const t=i.get("type"),n=i.get("range");if(gF(t)){const t=w$(r.view,e);return jC(n)||y$(t)?"step":t}return _$(r.view,e)}if(t.hasProjection||"arc"===t.mark)return _$(r.view,e);{const t=w$(r.view,e);return y$(t)?t.step:t}}function VL(t,e,n){return Yz(e,Object.assign({suffix:"by_"+Yz(t)},null!=n?n:{}))}class XL extends AL{constructor(t,e,n,r){super(t,"facet",e,n,r,t.resolve),this.child=mI(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Oz(t))return{facet:this.initFacetFieldDef(t,"facet")};const e=XD(t),n={};for(const r of e){if(!RD([$M,NM],r)){aC(HS(r,"facet"));break}const e=t[r];if(void 0===e.field){aC(YS(e,r));break}n[r]=this.initFacetFieldDef(e,r)}return n}initFacetFieldDef(t,e){const{header:n}=t,r=oT(bD(t,["header"]),e);return n&&(r.header=kF(n)),r}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=KL(this),this.child.parseData()}parseLayoutSize(){YL(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(t){for(const e of KM)UL(t,e);WL(t,"x"),WL(t,"y")}(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){var t,e,n;const r={};for(const i of KM)for(const o of _P){const a=this.component.layoutHeaders[i],s=a[o],{facetFieldDef:u}=a;if(u){const e=yP("titleOrient",u.header,this.config,i);if(RD(["right","bottom"],e)){const n=bP(i,e);r.titleAnchor=null!==(t=r.titleAnchor)&&void 0!==t?t:{},r.titleAnchor[n]="end"}}if(null==s?void 0:s[0]){const t="row"===i?"height":"width",s="header"===o?"headerBand":"footerBand";"facet"===i||this.child.component.layoutSize.get(t)||(r[s]=null!==(e=r[s])&&void 0!==e?e:{},r[s][i]=.5),a.title&&(r.offset=null!==(n=r.offset)&&void 0!==n?n:{},r.offset["row"===i?"rowTitle":"columnTitle"]=10)}}return r}assembleDefaultLayout(){const{column:t,row:e}=this.facet,n=t?this.columnDistinctSignal():e?1:void 0;let r="all";return(e||"independent"!==this.component.resolve.scale.x)&&(t||"independent"!==this.component.resolve.scale.y)||(r="none"),Object.assign(Object.assign(Object.assign({},this.getHeaderLayoutMixins()),n?{columns:n}:{}),{bounds:"full",align:r})}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof XL)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroup(t){return this.parent&&this.parent instanceof XL?Object.assign(Object.assign({},this.channelHasField("column")?{encode:{update:{columns:{field:Yz(this.facet.column,{prefix:"distinct"})}}}}:{}),super.assembleGroup(t)):super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],e=[],n=[];if(this.child instanceof XL){if(this.child.channelHasField("column")){const r=Yz(this.child.facet.column);t.push(r),e.push("distinct"),n.push("distinct_"+r)}}else for(const r of dS){const i=this.child.component.scales[r];if(i&&!i.merged){const o=i.get("type"),a=i.get("range");if(gF(o)&&jC(a)){const i=iL(oL(this.child,r));i?(t.push(i),e.push("distinct"),n.push("distinct_"+i)):aC(NS(r))}}}return{fields:t,ops:e,as:n}}assembleFacet(){const{name:t,data:e}=this.component.data.facetRoot,{row:n,column:r}=this.facet,{fields:i,ops:o,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const t of KM){const e=this.facet[t];if(e){s.push(Yz(e));const{bin:u,sort:l}=e;if(AS(u)&&s.push(Yz(e,{binSuffix:"end"})),xz(l)){const{field:t,op:s=mz}=l,u=VL(e,l);n&&r?(i.push(u),o.push("max"),a.push(u)):(i.push(t),o.push(s),a.push(u))}else if(Object(Z.B)(l)){const n=mP(e,t);i.push(n),o.push("max"),a.push(n)}}}const u=!!n&&!!r;return Object.assign({name:t,data:e,groupby:s},u||i.length>0?{aggregate:Object.assign(Object.assign({},u?{cross:u}:{}),i.length?{fields:i,ops:o,as:a}:{})}:{})}facetSortFields(t){const{facet:e}=this,n=e[t];return n?xz(n.sort)?[VL(n,n.sort,{expr:"datum"})]:Object(Z.B)(n.sort)?[mP(n,t,{expr:"datum"})]:[Yz(n,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:e}=this,n=e[t];if(n){const{sort:t}=n;return[(xz(t)?t.order:!Object(Z.B)(t)&&t)||"ascending"]}return[]}assembleLabelTitle(){var t;const{facet:e,config:n}=this;if(e.facet)return AP(e.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const i of xP)if(e[i]){const o=yP("labelOrient",null===(t=e[i])||void 0===t?void 0:t.header,n,i);if(RD(r[i],o))return AP(e[i],i,n)}}assembleMarks(){const{child:t}=this,e=function(t){const e=[],n=IL(e);for(const e of t.children)n(e,{source:t.name,name:null,transform:[]});return e}(this.component.data.facetRoot),n=t.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||t.assembleTitle(),i=t.assembleGroupStyle();return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},r?{title:r}:{}),i?{style:i}:{}),{from:{facet:this.assembleFacet()},sort:{field:KM.map(t=>this.facetSortFields(t)).flat(),order:KM.map(t=>this.facetSortOrder(t)).flat()}}),e.length>0?{data:e}:{}),n?{encode:{update:n}}:{}),t.assembleGroup(function(t,e){if(t.component.selection&&XD(t.component.selection).length){const n=Object(Z.ab)(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:Kj("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return RR(e)}(this,[])))]}getMapping(){return this.facet}}function JL(t,e){var n,r,i,o;for(const a of e){const e=a.data;if(t.name&&a.hasName()&&t.name!==a.dataName)continue;const s=null===(n=t.format)||void 0===n?void 0:n.mesh,u=null===(r=e.format)||void 0===r?void 0:r.feature;if(s&&u)continue;const l=null===(i=t.format)||void 0===i?void 0:i.feature;if((l||u)&&l!==u)continue;const c=null===(o=e.format)||void 0===o?void 0:o.mesh;if(!s&&!c||s===c)if(yN(t)&&yN(e)){if(SD(t.values,e.values))return a}else if(bN(t)&&bN(e)){if(t.url===e.url)return a}else if(vN(t)&&t.name===a.dataName)return a}return null}function KL(t){var e,n,r,i,o,a,s,u,l,c;let f=function(t,e){if(t.data||!t.parent){if(null===t.data){const t=new wB({values:[]});return e.push(t),t}const n=JL(t.data,e);if(n)return xN(t.data)||(n.data.format=LD({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const n=new wB(t.data);return e.push(n),n}}return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}(t,t.component.data.sources);const{outputNodes:d,outputNodeRefCounts:h}=t.component.data,p=t.parent?t.parent.component.data.ancestorParse.clone():new mN,g=t.data;xN(g)?(_N(g)?f=new OB(f,g.sequence):wN(g)&&(f=new _B(f,g.graticule)),p.parseNothing=!0):null===(null===(e=null==g?void 0:g.format)||void 0===e?void 0:e.parse)&&(p.parseNothing=!0),f=null!==(n=vB.makeExplicit(f,t,p))&&void 0!==n?n:f,f=new xB(f);const m=t.parent&&kL(t.parent);(OL(t)||wL(t))&&m&&(f=null!==(r=dB.makeFromEncoding(f,t))&&void 0!==r?r:f),t.transforms.length>0&&(f=function(t,e,n){var r,i;let o=0;for(const a of e.transforms){let s,u=void 0;if(NN(a))s=t=new gP(t,a),u="derived";else if(kN(a)){const i=bB(a);s=t=null!==(r=vB.makeWithAncestors(t,{},i,n))&&void 0!==r?r:t,t=new QR(t,e,a.filter)}else if(RN(a))s=t=dB.makeFromTransform(t,a,e),u="number";else if(BN(a)){u="date";void 0===n.getWithExplicit(a.field).value&&(t=new vB(t,{[a.field]:u}),n.set(a.field,u,!1)),s=t=vR.makeFromTransform(t,a)}else if(LN(a))s=t=pB.makeFromTransform(t,a),u="number",KR(e)&&(t=new xB(t));else if(EN(a))s=t=NL.make(t,e,a,o++),u="derived";else if(zN(a))s=t=new UB(t,a),u="number";else if(TN(a))s=t=new LB(t,a),u="number";else if(IN(a))s=t=IB.makeFromTransform(t,a),u="derived";else if(UN(a))s=t=new CL(t,a),u="derived";else if($N(a))s=t=new SL(t,a),u="derived";else if(AN(a))s=t=new BL(t,a),u="derived";else if(FN(a))t=new LL(t,a);else if(PN(a))s=t=TL.makeFromTransform(t,a),u="derived";else if(DN(a))s=t=new DL(t,a),u="derived";else if(MN(a))s=t=new RL(t,a),u="derived";else if(SN(a))s=t=new PL(t,a),u="derived";else{if(!CN(a)){aC(`Ignoring an invalid transform: ${TD(a)}.`);continue}s=t=new $L(t,a),u="derived"}if(s&&void 0!==u)for(const t of null!==(i=s.producedFields())&&void 0!==i?i:[])n.set(t,u,!1)}return t}(f,t,p));const b=function(t){const e={};if(OL(t)&&t.component.selection)for(const n of XD(t.component.selection)){const r=t.component.selection[n];for(const t of r.project.items)!t.channel&&lM(t.field)>1&&(e[t.field]="flatten")}return e}(t),y=yB(t);f=null!==(i=vB.makeWithAncestors(f,{},Object.assign(Object.assign({},b),y),p))&&void 0!==i?i:f,OL(t)&&(f=FL.parseAll(f,t),f=zL.parseAll(f,t)),(OL(t)||wL(t))&&(m||(f=null!==(o=dB.makeFromEncoding(f,t))&&void 0!==o?o:f),f=null!==(a=vR.makeFromEncoding(f,t))&&void 0!==a?a:f,f=gP.parseAllForSortIndex(f,t));const v=t.getDataName(jN.Raw),x=new yR(f,v,jN.Raw,h);if(d[v]=x,f=x,OL(t)){const e=pB.makeFromEncoding(f,t);e&&(f=e,KR(t)&&(f=new xB(f))),f=null!==(s=TL.makeFromEncoding(f,t))&&void 0!==s?s:f,f=null!==(u=IB.makeFromEncoding(f,t))&&void 0!==u?u:f}OL(t)&&(f=null!==(l=ML.make(f,t))&&void 0!==l?l:f);const _=t.getDataName(jN.Main),O=new yR(f,_,jN.Main,h);d[_]=O,f=O,OL(t)&&function(t,e){XR(t,n=>{const r=n.name,i=t.getName("lookup_"+r);t.component.data.outputNodes[i]=n.materialized=new yR(new QR(e,t,{selection:r}),i,jN.Lookup,t.component.data.outputNodeRefCounts)})}(t,O);let w=null;if(wL(t)){const e=t.getName("facet");f=null!==(c=function(t,e){const{row:n,column:r}=e;if(n&&r){let e=null;for(const i of[n,r])if(xz(i.sort)){const{field:n,op:r=mz}=i.sort;t=e=new LB(t,{joinaggregate:[{op:r,field:n,as:VL(i,i.sort,{forAs:!0})}],groupby:[Yz(i)]})}return e}return null}(f,t.facet))&&void 0!==c?c:f,w=new gB(f,t,e,O.getSource()),d[e]=w}return Object.assign(Object.assign({},t.component.data),{outputNodes:d,outputNodeRefCounts:h,raw:x,main:O,facetRoot:w,ancestorParse:p})}class ZL extends EL{constructor(t,e,n,r){var i,o,a,s;super(t,"concat",e,n,r,t.resolve),"shared"!==(null===(o=null===(i=t.resolve)||void 0===i?void 0:i.axis)||void 0===o?void 0:o.x)&&"shared"!==(null===(s=null===(a=t.resolve)||void 0===a?void 0:a.axis)||void 0===s?void 0:s.y)||aC("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(t).map((t,e)=>mI(t,this,this.getName("concat_"+e),void 0,r))}parseData(){this.component.data=KL(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of XD(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return m$(t)?t.vconcat:b$(t)?t.hconcat:t.concat}parseLayoutSize(){!function(t){YL(t);const e=1===t.layout.columns?"width":"childWidth",n=void 0===t.layout.columns?"height":"childHeight";HL(t,e),HL(t,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((t,e)=>e.assembleSelectionTopLevelSignals(t),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=FP(this);for(const e of this.children)t.push(...e.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((t,e)=>e.assembleSelectionData(t),t)}assembleMarks(){return this.children.map(t=>{const e=t.assembleTitle(),n=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:t.getName("group")},e?{title:e}:{}),n?{style:n}:{}),r?{encode:{update:r}}:{}),t.assembleGroup())})}assembleDefaultLayout(){const t=this.layout.columns;return Object.assign(Object.assign({},null!=t?{columns:t}:{}),{bounds:"full",align:"each"})}}const QL=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},OM),{labelExpr:1,encode:1}),tI=XD(QL);class eI extends cN{constructor(t={},e={},n=!1){super(),this.explicit=t,this.implicit=e,this.mainExtracted=n}clone(){return new eI(CD(this.explicit),CD(this.implicit),this.mainExtracted)}hasAxisPart(t){return"axis"===t||("grid"===t||"title"===t?!!this.get(t):!(!1===(e=this.get(t))||null===e));var e}hasOrientSignalRef(){return wC(this.explicit.orient)}}const nI={bottom:"top",top:"bottom",left:"right",right:"left"};function rI(t,e){if(!t)return e.map(t=>t.clone());{if(t.length!==e.length)return;const n=t.length;for(let r=0;r{switch(n){case"title":return DT(t,e);case"gridScale":return{explicit:t.explicit,value:cM(t.value,e.value)}}return pN(t,e,n,"axis")});t.setWithExplicit(n,r)}return t}function oI(t,e,n,r,i){if("disable"===e)return void 0!==n;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(wC(n.labelAngle)?n.labelAngle:mM(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===pP(r,i))return!0}return t===n[e]}const aI=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function sI(t,e){var n,r,i;let o=e.axis(t);const a=new eI,s=nT(e.encoding[t]),{mark:u,config:l}=e,c=(null==o?void 0:o.orient)||(null===(n=l["x"===t?"axisX":"axisY"])||void 0===n?void 0:n.orient)||(null===(r=l.axis)||void 0===r?void 0:r.orient)||function(t){return"x"===t?"bottom":"left"}(t),f=e.getScaleComponent(t).get("type"),d=sP(t,f,c,e.config),h=void 0!==o?!o:lP("disable",l.style,null==o?void 0:o.style,d).configValue;if(a.set("disable",h,void 0!==o),h)return a;o=o||{};const p=function(t,e,n,r,i){const o=null==e?void 0:e.labelAngle;if(void 0!==o)return wC(o)?o:mM(o);{const{configValue:o}=lP("labelAngle",r,null==e?void 0:e.style,i);return void 0!==o?mM(o):"x"!==n||!RD([WC,UC],t.type)||Fz(t)&&t.timeUnit?void 0:270}}(s,o,t,l.style,d),g={fieldOrDatumDef:s,axis:o,channel:t,model:e,scaleType:f,orient:c,labelAngle:p,mark:u,config:l};for(const n of tI){const r=n in cP?cP[n](g):jM(n)?o[n]:void 0,i=void 0!==r,s=oI(r,n,o,e,t);if(i&&s)a.set(n,r,s);else{const{configValue:t,configFrom:e}=jM(n)&&"values"!==n?lP(n,l.style,o.style,d):{},u=void 0!==t;i&&!u?a.set(n,r,s):("vgAxisConfig"!==e||aI.has(n)&&u||vM(t)||wC(t))&&a.set(n,t,!1)}}const m=null!==(i=o.encoding)&&void 0!==i?i:{},b=xM.reduce((n,r)=>{var i;if(!a.hasAxisPart(r))return n;const o=RP(null!==(i=m[r])&&void 0!==i?i:{},e),s="labels"===r?function(t,e,n){var r;const{encoding:i,config:o}=t,a=null!==(r=nT(i[e]))&&void 0!==r?r:nT(i[sS(e)]),s=t.axis(e)||{},{format:u,formatType:l}=s;return oz(l)?Object.assign({text:lz({fieldOrDatumDef:a,field:"datum.value",format:u,formatType:l,config:o})},n):n}(e,t,o):o;return void 0===s||VD(s)||(n[r]={update:s}),n},{});return VD(b)||a.set("encode",b,!!o.encoding||void 0!==o.labelAngle),a}function uI(t,e,n){const r=kF(t),i=_T("orient",r,n);if(r.orient=function(t,e,n){switch(t){case FF:case PF:case BF:case $F:case zF:case SF:return}const{x:r,y:i,x2:o,y2:a}=e;switch(t){case MF:if(Fz(r)&&(DS(r.bin)||Fz(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Fz(i)&&(DS(i.bin)||Fz(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o&&(Fz(r)&&r.type===IC&&!AS(r.bin)||Nz(r)))return"horizontal";if(!a&&(Fz(i)&&i.type===IC&&!AS(i.bin)||Nz(i)))return"vertical"}case TF:if(o&&(!Fz(r)||!DS(r.bin))&&a&&(!Fz(i)||!DS(i.bin)))return;case DF:if(a)return Fz(i)&&DS(i.bin)?"horizontal":"vertical";if(o)return Fz(r)&&DS(r.bin)?"vertical":"horizontal";if(t===TF){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case CF:case NF:{const e=$z(r),o=$z(i);if(e&&!o)return"tick"!==t?"horizontal":"vertical";if(!e&&o)return"tick"!==t?"vertical":"horizontal";if(e&&o){const e=r,o=i,a=e.type===qC,s=o.type===qC;return a&&!s?"tick"!==t?"vertical":"horizontal":!a&&s?"tick"!==t?"horizontal":"vertical":!e.aggregate&&o.aggregate?"tick"!==t?"vertical":"horizontal":e.aggregate&&!o.aggregate?"tick"!==t?"horizontal":"vertical":n||"vertical"}return n||void 0}}return"vertical"}(r.type,e,i),void 0!==i&&i!==r.orient&&aC(`Specified orient "${r.orient}" overridden with "${i}".`),"bar"===r.type&&r.orient){const t=_T("cornerRadiusEnd",r,n);if(void 0!==t){const n="horizontal"===r.orient&&e.x2||"vertical"===r.orient&&e.y2?["cornerRadius"]:VF[r.orient];for(const e of n)r[e]=t;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}void 0===_T("opacity",r,n)&&(r.opacity=function(t,e){if(RD([FF,NF,PF,BF],t)&&!FT(e))return.7;return}(r.type,e));return void 0===_T("cursor",r,n)&&(r.cursor=function(t,e,n){if(e.href||t.href||_T("href",t,n))return"pointer";return t.cursor}(r,e,n)),r}function lI(t,e){const{config:n}=t;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),QN("x",t,{defaultPos:"mid"})),QN("y",t,{defaultPos:"mid"})),JN("size",t)),JN("angle",t)),function(t,e,n){if(n)return{shape:{value:n}};return JN("shape",t)}(t,0,e))}function cI(t){var e;const{config:n,markDef:r}=t,{orient:i}=r,o="horizontal"===i?"width":"height",a=t.getScaleComponent("horizontal"===i?"x":"y"),s=null!==(e=_T("size",r,n,{vgChannel:o}))&&void 0!==e?e:n.tick.bandSize;if(void 0!==s)return s;{const t=a?a.get("range"):void 0;if(t&&jC(t)&&Object(Z.F)(t.step))return 3*t.step/4;return 3*O$(n.view,o)/4}}const fI={arc:{vgMark:"arc",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),QN("x",t,{defaultPos:"mid"})),QN("y",t,{defaultPos:"mid"})),sR(t,"radius","arc")),sR(t,"theta","arc"))},area:{vgMark:"area",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),iR("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===t.markDef.orient})),iR("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===t.markDef.orient})),pR(t))},bar:{vgMark:"rect",encodeEntry:t=>Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),sR(t,"x","bar")),sR(t,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:t=>lI(t,"circle")},geoshape:{vgMark:"shape",encodeEntry:t=>Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:t=>{const{encoding:e}=t,n=e.shape;return[Object.assign({type:"geoshape",projection:t.projectionName()},n&&Fz(n)&&n.type===YC?{field:Yz(n,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),sR(t,"x","image")),sR(t,"y","image")),WN(t,"url"))},line:{vgMark:"line",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),QN("x",t,{defaultPos:"mid"})),QN("y",t,{defaultPos:"mid"})),JN("size",t,{vgChannel:"strokeWidth"})),pR(t))},point:{vgMark:"symbol",encodeEntry:t=>lI(t)},rect:{vgMark:"rect",encodeEntry:t=>Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),sR(t,"x","rect")),sR(t,"y","rect"))},rule:{vgMark:"rule",encodeEntry:t=>{const{markDef:e}=t,n=e.orient;return t.encoding.x||t.encoding.y||t.encoding.latitude||t.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),iR("x",t,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n})),iR("y",t,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n})),JN("size",t,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:t=>lI(t,"square")},text:{vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n}=t;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),QN("x",t,{defaultPos:"mid"})),QN("y",t,{defaultPos:"mid"})),WN(t)),JN("size",t,{vgChannel:"fontSize"})),JN("angle",t)),gR("align",function(t,e,n){if(void 0===_T("align",t,n))return"center";return}(t.markDef,0,e))),gR("baseline",function(t,e,n){if(void 0===_T("baseline",t,n))return"middle";return}(t.markDef,0,e))),QN("radius",t,{defaultPos:null,isMidPoint:!0})),QN("theta",t,{defaultPos:null,isMidPoint:!0}))}},tick:{vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n}=t,r=n.orient,i="horizontal"===r?"width":"height",o="horizontal"===r?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),QN("x",t,{defaultPos:"mid",vgChannel:"xc"})),QN("y",t,{defaultPos:"mid",vgChannel:"yc"})),JN("size",t,{defaultValue:cI(t),vgChannel:i})),{[o]:bT(_T("thickness",n,e))})}},trail:{vgMark:"trail",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),QN("x",t,{defaultPos:"mid"})),QN("y",t,{defaultPos:"mid"})),JN("size",t)),pR(t))}};function dI(t){if(RD([CF,DF,RF],t.mark)){const e=RT(t.mark,t.encoding);if(e.length>0)return function(t,e){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:"faceted_path_"+t.requestDataName(jN.Main),data:t.requestDataName(jN.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:hI(t,{fromPrefix:"faceted_path_"})}]}(t,e)}else if(RD([MF],t.mark)){const e=DC.some(e=>_T(e,t.markDef,t.config));if(t.stack&&!t.fieldDef("size")&&e)return function(t){const[e]=hI(t,{fromPrefix:"stack_group_"}),n=t.scaleName(t.stack.fieldChannel),r=(e={})=>t.vgField(t.stack.fieldChannel,e),i=(t,e)=>`${t}(${[r({prefix:"min",suffix:"start",expr:e}),r({prefix:"max",suffix:"start",expr:e}),r({prefix:"min",suffix:"end",expr:e}),r({prefix:"max",suffix:"end",expr:e})].map(t=>`scale('${n}',${t})`).join(",")})`;let o,a;"x"===t.stack.fieldChannel?(o=Object.assign(Object.assign({},FD(e.encode.update,["y","yc","y2","height",...DC])),{x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}}),a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},e.encode.update=Object.assign(Object.assign({},zD(e.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(o=Object.assign(Object.assign({},FD(e.encode.update,["x","xc","x2","width"])),{y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}}),a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},e.encode.update=Object.assign(Object.assign({},zD(e.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const n of DC){const r=OT(n,t.markDef,t.config);e.encode.update[n]?(o[n]=e.encode.update[n],delete e.encode.update[n]):r&&(o[n]=bT(r)),r&&(e.encode.update[n]={value:0})}const s=t.fieldDef(t.stack.groupbyChannel),u=Yz(s)?[Yz(s)]:[];((null==s?void 0:s.bin)||(null==s?void 0:s.timeUnit))&&u.push(Yz(s,{binSuffix:"end"}));o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((n,r)=>{if(e.encode.update[r])return Object.assign(Object.assign({},n),{[r]:e.encode.update[r]});{const e=OT(r,t.markDef,t.config);return void 0!==e?Object.assign(Object.assign({},n),{[r]:bT(e)}):n}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0});return[{type:"group",from:{facet:{data:t.requestDataName(jN.Main),name:"stack_group_"+t.requestDataName(jN.Main),groupby:u,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[e]}]}]}(t)}return hI(t)}function hI(t,e={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=t,a=cM(r.clip,function(t){const e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return!!(e&&e.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(t),function(t){const e=t.component.projection;return!(!e||e.isFit)||void 0}(t)),s=xT(r),u=i.key,l=function(t){const{encoding:e,stack:n,mark:r,markDef:i,config:o}=t,a=e.order;if(!(!Object(Z.B)(a)&&Bz(a)&&ND(a.value)||!a&&ND(_T("order",i,o)))){if((Object(Z.B)(a)||Fz(a))&&!n)return kT(a,{expr:"datum"});if(IF(r)){const n="horizontal"===i.orient?"y":"x",r=e[n];if(Fz(r)){const e=r.sort;if(Object(Z.B)(e))return{field:Yz(r,{prefix:n,suffix:"sort_index",expr:"datum"})};if(xz(e))return{field:Yz({aggregate:FT(t.encoding)?e.op:void 0,field:e.field},{expr:"datum"})};if(vz(e)){return{field:Yz(t.fieldDef(e.encoding),{expr:"datum"}),order:e.order}}return null===e?void 0:{field:Yz(r,{binSuffix:t.stack&&t.stack.impute?"mid":void 0,expr:"datum"})}}}else;}}(t),c=function(t){if(!t.component.selection)return null;const e=XD(t.component.selection).length;let n=e,r=t.parent;for(;r&&0===n;)n=XD(r.component.selection).length,r=r.parent;return n?{interactive:e>0||!!t.encoding.tooltip}:null}(t),f=_T("aria",r,o),d=fI[n].postEncodingTransform?fI[n].postEncodingTransform(t):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:t.getName("marks"),type:fI[n].vgMark},a?{clip:!0}:{}),s?{style:s}:{}),u?{key:u.field}:{}),l?{sort:l}:{}),c||{}),!1===f?{aria:f}:{}),{from:{data:e.fromPrefix+t.requestDataName(jN.Main)},encode:{update:fI[n].encodeEntry(t)}}),d?{transform:d}:{})]}class pI extends AL{constructor(t,e,n,r={},i){super(t,"unit",e,n,i,void 0,v$(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[];const o=WF(t.mark)?Object.assign({},t.mark):{type:t.mark},a=o.type;void 0===o.filled&&(o.filled=function(t,e,{graticule:n}){if(n)return!1;const r=OT("filled",t,e),i=t.type;return cM(r,i!==FF&&i!==CF&&i!==TF)}(o,i,{graticule:t.data&&wN(t.data)}));const s=this.encoding=TT(t.encoding||{},a,o.filled,i);this.markDef=uI(o,s,i),this.size=function({encoding:t,size:e}){for(const n of dS){const r=uS(n);y$(e[r])&&$z(t[n])&&(delete e[r],aC(QS(r)))}return e}({encoding:s,size:v$(t)?Object.assign(Object.assign(Object.assign({},r),t.width?{width:t.width}:{}),t.height?{height:t.height}:{}):r}),this.stack=U$(a,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=t.projection,this.selection=t.selection}get hasProjection(){const{encoding:t}=this,e=this.mark===LF,n=t&&GM.some(e=>Rz(t[e]));return e||n}scaleDomain(t){const e=this.specifiedScales[t];return e?e.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,e){return xS.reduce((t,n)=>{var r;const i=nT(e[n]);return i&&(t[n]=this.initScale(null!==(r=i.scale)&&void 0!==r?r:{})),t},{})}initScale(t){const{domain:e,range:n}=t,r=kF(t);return Object(Z.B)(e)&&(r.domain=e.map(gT)),Object(Z.B)(n)&&(r.range=n.map(gT)),r}initAxes(t){return dS.reduce((e,n)=>{const r=t[n];if(Rz(r)||"x"===n&&Rz(t.x2)||"y"===n&&Rz(t.y2)){const t=Rz(r)?r.axis:void 0;e[n]=t?this.initAxis(Object.assign({},t)):t}return e},{})}initAxis(t){const e=XD(t),n={};for(const r of e){const e=t[r];n[r]=vM(e)?pT(e):gT(e)}return n}initLegends(t){return yS.reduce((e,n)=>{const r=nT(t[n]);if(r&&function(t){switch(t){case LM:case IM:case UM:case"size":case qM:case"opacity":case"strokeWidth":case"strokeDash":return!0;case"fillOpacity":case"strokeOpacity":case"angle":return!1}}(n)){const t=r.legend;e[n]=t?kF(t):t}return e},{})}parseData(){this.component.data=KL(this)}parseLayoutSize(){!function(t){const{size:e,component:n}=t;for(const r of dS){const i=uS(r);if(e[i]){const t=e[i];n.layoutSize.set(i,y$(t)?"step":t,!0)}else{const e=GL(t,i);n.layoutSize.set(i,e,!1)}}}(this)}parseSelections(){this.component.selection=function(t,e){var n;const r={},i=t.config.selection;for(const o of XD(null!=e?e:{})){const a=CD(e[o]),s=bD(i[a.type],["fields","encodings"]);for(const t in s)"encodings"===t&&a.fields||"fields"===t&&a.encodings||("mark"===t&&(a[t]=Object.assign(Object.assign({},s[t]),a[t])),void 0!==a[t]&&!0!==a[t]||(a[t]=null!==(n=s[t])&&void 0!==n?n:a[t]));const u=QD(o),l=r[u]=Object.assign(Object.assign({},a),{name:u,events:Object(Z.I)(a.on)?Kj(a.on,"scope"):CD(a.on)});TR(l,n=>{n.has(l)&&n.parse&&n.parse(t,l,a,e[o])})}return r}(this,this.selection)}parseMarkGroup(){this.component.mark=dI(this)}parseAxesAndHeaders(){var t;this.component.axes=(t=this,dS.reduce((e,n)=>(t.component.scales[n]&&(e[n]=[sI(n,t)]),e),{}))}assembleSelectionTopLevelSignals(t){return function(t,e){let n=!1;if(XR(t,(r,i)=>{const o=r.name,a=Object(Z.ab)(o+WR);if(0===e.filter(t=>t.name===o).length){const t="global"===r.resolve?"union":r.resolve,n="multi"===r.type?", true)":")";e.push({name:r.name,update:`${GR}(${a}, ${Object(Z.ab)(t)}${n}`})}n=!0,i.topLevelSignals&&(e=i.topLevelSignals(t,r,e)),TR(r,n=>{n.topLevelSignals&&(e=n.topLevelSignals(t,r,e))})}),n){0===e.filter(t=>"unit"===t.name).length&&e.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]})}return RR(e)}(this,t)}assembleSignals(){return[...oP(this),...(t=this,e=[],XR(t,(n,r)=>{const i=n.name;let o=r.modifyExpr(t,n);e.push(...r.signals(t,n)),TR(n,r=>{r.signals&&(e=r.signals(t,n,e)),r.modifyExpr&&(o=r.modifyExpr(t,n,o))}),e.push({name:i+HR,on:[{events:{signal:n.name+YR},update:`modify(${Object(Z.ab)(n.name+WR)}, ${o})`}]})}),RR(e))];var t,e}assembleSelectionData(t){return function(t,e){const n=[...e];return XR(t,e=>{const r={name:e.name+WR};if(e.init){const n=e.project.items.map(t=>bD(t,["signals"])),i=e.init.map(t=>$R(t,!1));r.values="interval"===e.type?[{unit:JR(t,{escape:!1}),fields:n,values:i}]:i.map(e=>({unit:JR(t,{escape:!1}),fields:n,values:e}))}n.filter(t=>t.name===e.name+WR).length||n.push(r)}),n}(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return FP(this)}assembleMarks(){var t;let e=null!==(t=this.component.mark)&&void 0!==t?t:[];return this.parent&&kL(this.parent)||(e=NR(this,e)),e.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return CT(this.encoding,t)}fieldDef(t){return eT(this.encoding[t])}typedFieldDef(t){const e=this.fieldDef(t);return Pz(e)?e:null}}class gI extends EL{constructor(t,e,n,r,i){super(t,"layer",e,n,i,t.resolve,t.view);const o=Object.assign(Object.assign(Object.assign({},r),t.width?{width:t.width}:{}),t.height?{height:t.height}:{});this.children=t.layer.map((t,e)=>{if(R$(t))return new gI(t,this,this.getName("layer_"+e),o,i);if(MT(t))return new pI(t,this,this.getName("layer_"+e),o,i);throw new Error(FS(t))})}parseData(){this.component.data=KL(this);for(const t of this.children)t.parseData()}parseLayoutSize(){var t;YL(t=this),HL(t,"width"),HL(t,"height")}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of XD(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){!function(t){var e;const{axes:n,resolve:r}=t.component,i={top:0,bottom:0,right:0,left:0};for(const e of t.children){e.parseAxesAndHeaders();for(const i of XD(e.component.axes))r.axis[i]=BP(t.component.resolve,i),"shared"===r.axis[i]&&(n[i]=rI(n[i],e.component.axes[i]),n[i]||(r.axis[i]="independent",delete n[i]))}for(const o of dS){for(const a of t.children)if(a.component.axes[o]){if("independent"===r.axis[o]){n[o]=(null!==(e=n[o])&&void 0!==e?e:[]).concat(a.component.axes[o]);for(const t of a.component.axes[o]){const{value:e,explicit:n}=t.getWithExplicit("orient");if(!wC(e)){if(i[e]>0&&!n){const n=nI[e];i[e]>i[n]&&t.set("orient",n,!1)}i[e]++}}}delete a.component.axes[o]}if("independent"===r.axis[o]&&n[o]&&n[o].length>1)for(const t of n[o])t.get("grid")&&!t.explicit.grid&&(t.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((t,e)=>e.assembleSelectionTopLevelSignals(t),t)}assembleSignals(){return this.children.reduce((t,e)=>t.concat(e.assembleSignals()),oP(this))}assembleLayoutSignals(){return this.children.reduce((t,e)=>t.concat(e.assembleLayoutSignals()),FP(this))}assembleSelectionData(t){return this.children.reduce((t,e)=>e.assembleSelectionData(t),t)}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const e of this.children)if(t=e.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return function(t,e){for(const n of t.children)OL(n)&&(e=NR(n,e));return e}(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,e)=>t.concat(e.assembleLegends()),rB(this))}}function mI(t,e,n,r,i){if(jz(t))return new XL(t,e,n,i);if(R$(t))return new gI(t,e,n,r,i);if(MT(t))return new pI(t,e,n,r,i);if(function(t){return m$(t)||b$(t)||g$(t)}(t))return new ZL(t,e,n,i);throw new Error(FS(t))}function bI(t,e={}){var n;e.logger&&(n=e.logger,oC=n),e.fieldTitle&&Jz(e.fieldTitle);try{const n=C$(Object(Z.O)(e.config,t.config)),r=oN(t,n),i=mI(r,null,"",void 0,n);i.parse(),function(t,e){YB(t.sources);let n=0,r=0;for(let r=0;r<5&&GB(t,e,!0);r++)n++;t.sources.map(qB);for(let n=0;n<5&&GB(t,e,!1);n++)r++;YB(t.sources),5===Math.max(n,r)&&aC("Maximum optimization runs(5) reached.")}(i.component.data,i);return{spec:function(t,e,n={},r){const i=t.config?$$(t.config):void 0,o=[].concat(t.assembleSelectionData([]),function(t,e){var n,r;const i=[],o=IL(i);let a=0;for(const e of t.sources){e.hasName()||(e.dataName="source_"+a++);const t=e.assemble();o(e,t)}for(const t of i)0===t.transform.length&&delete t.transform;let s=0;for(const[t,e]of i.entries())0!==(null!==(n=e.transform)&&void 0!==n?n:[]).length||e.source||i.splice(s++,0,i.splice(t,1)[0]);for(const e of i)for(const n of null!==(r=e.transform)&&void 0!==r?r:[])"lookup"===n.type&&(n.from=t.outputNodes[n.from].getSource());for(const t of i)t.name in e&&(t.values=e[t.name]);return i}(t.component.data,n)),a=t.assembleProjections(),s=t.assembleTitle(),u=t.assembleGroupStyle(),l=t.assembleGroupEncodeEntry(!0);let c=t.assembleLayoutSignals();c=c.filter(t=>"width"!==t.name&&"height"!==t.name||void 0===t.value||(e[t.name]=+t.value,!1));const{params:f}=e,d=bD(e,["params"]);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},t.description?{description:t.description}:{}),d),s?{title:s}:{}),u?{style:u}:{}),l?{encode:{update:l}}:{}),{data:o}),a.length>0?{projections:a}:{}),t.assembleGroup([...c,...t.assembleSelectionTopLevelSignals([]),...f$(f)])),i?{config:i}:{}),r?{usermeta:r}:{})}(i,function(t,e,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");void 0===e?(e={type:"pad"},r.hasAxisOrientSignalRef()&&(e.resize=!0)):Object(Z.I)(e)&&(e={type:e});if(i&&o&&(a=e.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)aC($S()),e.type="pad";else if("step"===i||"step"===o){const t="step"===i?"width":"height";aC($S(mS(t)));const n="width"===t?"height":"width";e.type=function(t){return t?"fit-"+mS(t):"fit"}(n)}var a;return Object.assign(Object.assign(Object.assign({},1===XD(e).length&&e.type?"pad"===e.type?{}:{autosize:e.type}:{autosize:e}),lN(n,!1)),lN(t,!0))}(t,r.autosize,n,i),t.datasets,t.usermeta),normalized:r}}finally{e.logger&&(oC=iC),e.fieldTitle&&Jz(Vz)}}var yI=function(t){const[e,n]=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e,version:n}};const vI={background:"#333",title:{color:"#fff"},style:{"guide-label":{fill:"#fff"},"guide-title":{fill:"#fff"}},axis:{domainColor:"#fff",gridColor:"#888",tickColor:"#fff"}},xI={background:"#fff",arc:{fill:"#4572a7"},area:{fill:"#4572a7"},line:{stroke:"#4572a7",strokeWidth:2},path:{stroke:"#4572a7"},rect:{fill:"#4572a7"},shape:{stroke:"#4572a7"},symbol:{fill:"#4572a7",strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},_I={arc:{fill:"#30a2da"},area:{fill:"#30a2da"},axis:{domainColor:"#cbcbcb",grid:!0,gridColor:"#cbcbcb",gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:"#cbcbcb",tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:"#f0f0f0",group:{fill:"#f0f0f0"},legend:{labelColor:"#333",labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:"#333",titleFontSize:14,titlePadding:10},line:{stroke:"#30a2da",strokeWidth:2},path:{stroke:"#30a2da",strokeWidth:.5},rect:{fill:"#30a2da"},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:"#30a2da"},bar:{binSpacing:2,fill:"#30a2da",stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},OI={group:{fill:"#e5e5e5"},arc:{fill:"#000"},area:{fill:"#000"},line:{stroke:"#000"},path:{stroke:"#000"},rect:{fill:"#000"},shape:{stroke:"#000"},symbol:{fill:"#000",size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},wI="Benton Gothic Bold, sans-serif",jI={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},kI={background:"#ffffff",title:{anchor:"start",color:"#000000",font:wI,fontSize:22,fontWeight:"normal"},arc:{fill:"#82c6df"},area:{fill:"#82c6df"},line:{stroke:"#82c6df",strokeWidth:2},path:{stroke:"#82c6df"},rect:{fill:"#82c6df"},shape:{stroke:"#82c6df"},symbol:{fill:"#82c6df",size:30},axis:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,labelFontWeight:"normal",titleFont:wI,titleFontSize:13,titleFontWeight:"normal"},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,symbolType:"square",titleFont:wI,titleFontSize:13,titleFontWeight:"normal"},range:{category:jI["category-6"],diverging:jI["fireandice-6"],heatmap:jI["fire-7"],ordinal:jI["fire-7"],ramp:jI["fire-7"]}},EI={background:"#f9f9f9",arc:{fill:"#ab5787"},area:{fill:"#ab5787"},line:{stroke:"#ab5787"},path:{stroke:"#ab5787"},rect:{fill:"#ab5787"},shape:{stroke:"#ab5787"},symbol:{fill:"#ab5787",size:30},axis:{domainColor:"#979797",domainWidth:.5,gridWidth:.2,labelColor:"#979797",tickColor:"#979797",tickWidth:.2,titleColor:"#979797"},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},AI={background:"#fff",arc:{fill:"#3e5c69"},area:{fill:"#3e5c69"},line:{stroke:"#3e5c69"},path:{stroke:"#3e5c69"},rect:{fill:"#3e5c69"},shape:{stroke:"#3e5c69"},symbol:{fill:"#3e5c69"},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},DI={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},MI={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:"Lato"},axisX:{domain:!0,domainColor:"#000000",domainWidth:1,grid:!1,labelFontSize:12,labelFont:"Lato",labelAngle:0,tickColor:"#000000",tickSize:5,titleFontSize:12,titlePadding:10,titleFont:"Lato"},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:"Lato",labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:"Lato",titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:"Lato",symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:"Lato",orient:"right",offset:10},view:{stroke:"transparent"},range:{category:DI["six-groups-cat-1"],diverging:DI["diverging-colors"],heatmap:DI["diverging-colors"],ordinal:DI["six-groups-seq"],ramp:DI["shades-blue"]},area:{fill:"#1696d2"},rect:{fill:"#1696d2"},line:{color:"#1696d2",stroke:"#1696d2",strokeWidth:5},trail:{color:"#1696d2",stroke:"#1696d2",strokeWidth:0,size:1},path:{stroke:"#1696d2",strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:"#1696d2",fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:"#1696d2",stroke:null}},arc:{fill:"#1696d2"},shape:{stroke:"#1696d2"},symbol:{fill:"#1696d2",size:30}},SI={arc:{fill:"#3366CC"},area:{fill:"#3366CC"},path:{stroke:"#3366CC"},rect:{fill:"#3366CC"},shape:{stroke:"#3366CC"},symbol:{stroke:"#3366CC"},circle:{fill:"#3366CC"},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:"Arial, sans-serif",fontSize:12},"guide-title":{font:"Arial, sans-serif",fontSize:12},"group-title":{font:"Arial, sans-serif",fontSize:12}},title:{font:"Arial, sans-serif",fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:"#ccc",tickColor:"#ccc",domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},CI="2.9.1";var FI="#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black; }\n #vg-tooltip-element.visible {\n visibility: visible; }\n #vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px; }\n #vg-tooltip-element img {\n max-width: 200px;\n max-height: 200px; }\n #vg-tooltip-element table {\n border-spacing: 0; }\n #vg-tooltip-element table tr {\n border: none; }\n #vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px; }\n #vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px; }\n #vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left; }\n #vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white; }\n #vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf; }\n";const zI="vg-tooltip-element",TI={offsetX:10,offsetY:10,id:zI,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(t){return String(t).replace(/&/g,"&").replace(/e(Object(Z.I)(t)?t:NI(t,n))).join(", ")}]`;if(Object(Z.G)(t)){let r="";const i=t,{title:o,image:a}=i,s= /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -32,7 +32,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i${t(o)}`),a&&(r+=``);const u=Object.keys(s);if(u.length>0){r+="";for(const e of u){let i=s[e];void 0!==i&&(Object(Z.G)(i)&&(i=NI(i,n)),r+=``)}r+="
${t(e)}:${t(i)}
"}return r||"{}"}return t(e)}function NI(e,t){return JSON.stringify(e,function(e){const t=[];return function(n,r){if("object"!=typeof r||null===r)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}(t))}class RI{constructor(e){this.options=Object.assign(Object.assign({},TI),e);const t=this.options.id;if(this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return FI.toString().replace(zI,e)}(t);const n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}this.el=document.getElementById(t),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",t),this.el.classList.add("vg-tooltip"),document.body.appendChild(this.el))}tooltipHandler(e,t,n,r){if(null==r||""===r)return void this.el.classList.remove("visible",this.options.theme+"-theme");this.el.innerHTML=$I(r,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",this.options.theme+"-theme");const{x:i,y:o}=function(e,t,n,r){let i=e.clientX+n;i+t.width>window.innerWidth&&(i=+e.clientX-n-t.width);let o=e.clientY+r;return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.setAttribute("style",`top: ${o}px; left: ${i}px`)}} +function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i${e(o)}`),a&&(r+=``);const u=Object.keys(s);if(u.length>0){r+="";for(const t of u){let i=s[t];void 0!==i&&(Object(Z.G)(i)&&(i=NI(i,n)),r+=``)}r+="
${e(t)}:${e(i)}
"}return r||"{}"}return e(t)}function NI(t,e){return JSON.stringify(t,function(t){const e=[];return function(n,r){if("object"!=typeof r||null===r)return r;const i=e.indexOf(this)+1;return e.length=i,e.length>t?"[Object]":e.indexOf(r)>=0?"[Circular]":(e.push(r),r)}}(e))}class RI{constructor(t){this.options=Object.assign(Object.assign({},TI),t);const e=this.options.id;if(this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const t=document.createElement("style");t.setAttribute("id",this.options.styleId),t.innerHTML=function(t){if(!/^[A-Za-z]+[-:.\w]*$/.test(t))throw new Error("Invalid HTML ID");return FI.toString().replace(zI,t)}(e);const n=document.head;n.childNodes.length>0?n.insertBefore(t,n.childNodes[0]):n.appendChild(t)}this.el=document.getElementById(e),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",e),this.el.classList.add("vg-tooltip"),document.body.appendChild(this.el))}tooltipHandler(t,e,n,r){if(null==r||""===r)return void this.el.classList.remove("visible",this.options.theme+"-theme");this.el.innerHTML=$I(r,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",this.options.theme+"-theme");const{x:i,y:o}=function(t,e,n,r){let i=t.clientX+n;i+e.width>window.innerWidth&&(i=+t.clientX-n-e.width);let o=t.clientY+r;return o+e.height>window.innerHeight&&(o=+t.clientY-r-e.height),{x:i,y:o}}(e,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.setAttribute("style",`top: ${o}px; left: ${i}px`)}} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -47,4 +47,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -function PI(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}var BI,LI='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box; }\n .vega-embed.has-actions {\n padding-right: 38px; }\n .vega-embed details:not([open]) > :not(summary) {\n display: none !important; }\n .vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n outline: none;\n cursor: pointer;\n line-height: 0px; }\n .vega-embed summary::-webkit-details-marker {\n display: none; }\n .vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset; }\n .vega-embed summary svg {\n width: 14px;\n height: 14px; }\n .vega-embed details[open] summary {\n opacity: 0.7; }\n .vega-embed:hover summary,\n .vega-embed:focus summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease; }\n .vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left; }\n .vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none; }\n .vega-embed .vega-actions a:hover {\n background-color: #f7f7f9;\n color: black; }\n .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute; }\n .vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid #0000;\n border-bottom-color: #d9d9d9; }\n .vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid #0000;\n border-bottom-color: #fff; }\n .vega-embed .chart-wrapper {\n width: 100%;\n height: 100%; }\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: scroll;\n padding-right: 14px; }\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6); }\n to {\n opacity: 1;\n transform: scale(1); } }\n';function II(e,...t){for(const n of t)UI(e,n);return e}function UI(e,t){for(const n of Object.keys(t))Object(Z.kb)(e,n,t[n],!0)}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(!t||t<0?0:+t,e.length)===e});const qI=b;let WI=y;const YI="undefined"!=typeof window?window:void 0;void 0===WI&&(null===(BI=null==YI?void 0:YI.vl)||void 0===BI?void 0:BI.compile)&&(WI=YI.vl);const HI={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},GI={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},VI={vega:"Vega","vega-lite":"Vega-Lite"},XI={vega:qI.version,"vega-lite":WI?WI.version:"not available"},JI={vega:e=>e,"vega-lite":(e,t)=>WI.compile(e,{config:t}).spec};function KI(e,t,n,r){const i=`${t}
`,o=`
${n}`,a=window.open("");a.document.write(i+e+o),a.document.title=VI[r]+" JSON Source"}function ZI(e,t){var n;return PI(this,void 0,void 0,(function*(){const r=Object(Z.I)(e.config)?JSON.parse(yield t.load(e.config)):null!==(n=e.config)&&void 0!==n?n:{},i=Object(Z.I)(e.patch)?JSON.parse(yield t.load(e.patch)):e.patch;return Object.assign(Object.assign(Object.assign({},e),i?{patch:i}:{}),r?{config:r}:{})}))}var QI=function(e,t,n={}){var r,i,o;return PI(this,void 0,void 0,(function*(){const a=(s=n.loader)&&"load"in s?n.loader:qI.loader(n.loader);var s;const u=Object(Z.I)(t)?JSON.parse(yield a.load(t)):t,l=yield ZI(null!==(r=u.usermeta&&u.usermeta.embedOptions)&&void 0!==r?r:{},a),c=yield ZI(n,a),f=Object.assign(Object.assign({},II(c,l)),{config:Object(Z.O)(null!==(i=c.config)&&void 0!==i?i:{},null!==(o=l.config)&&void 0!==o?o:{})});return yield function(e,t,n={},r){var i,o,a,s,u,l;return PI(this,void 0,void 0,(function*(){const c=n.theme?Object(Z.O)(v[n.theme],null!==(i=n.config)&&void 0!==i?i:{}):n.config,f=Object(Z.C)(n.actions)?n.actions:II({},HI,null!==(o=n.actions)&&void 0!==o?o:{}),d=Object.assign(Object.assign({},GI),n.i18n),h=null!==(a=n.renderer)&&void 0!==a?a:"canvas",p=null!==(s=n.logLevel)&&void 0!==s?s:qI.Warn,g=null!==(u=n.downloadFileName)&&void 0!==u?u:"visualization",m="string"==typeof e?document.querySelector(e):e;if(!m)throw new Error(e+" does not exist");if(!1!==n.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:r}=function(e){var t;const n=e.getRootNode?e.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(t=document.head)&&void 0!==t?t:document.body}}(m);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?LI.toString():n.defaultStyle,r.appendChild(t)}}const b=function(e,t){var n;if(e.$schema){const r=yI(e.$schema);t&&t!==r.library&&console.warn(`The given visualization spec is written in ${VI[r.library]}, but mode argument sets ${null!==(n=VI[t])&&void 0!==n?n:t}.`);const i=r.library;return Object(K.satisfies)(XI[i],"^"+r.version.slice(1))||console.warn(`The input spec uses ${VI[i]} ${r.version}, but the current version of ${VI[i]} is v${XI[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":null!=t?t:"vega"}(t,n.mode);let y=JI[b](t,c);if("vega-lite"===b&&y.$schema){const e=yI(y.$schema);Object(K.satisfies)(XI.vega,"^"+e.version.slice(1))||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${XI.vega}.`)}m.classList.add("vega-embed"),f&&m.classList.add("has-actions"),m.innerHTML="";let x=m;if(f){const e=document.createElement("div");e.classList.add("chart-wrapper"),m.appendChild(e),x=e}const _=n.patch;_&&(y=_ instanceof Function?_(y):N(y,_,!0,!1).newDocument),n.formatLocale&&qI.formatLocale(n.formatLocale),n.timeFormatLocale&&qI.timeFormatLocale(n.timeFormatLocale);const{ast:O}=n,w=qI.parse(y,"vega-lite"===b?{}:c,{ast:O}),j=new qI.View(w,Object.assign({loader:r,logLevel:p,renderer:h},O?{expr:qI.expressionInterpreter}:{}));if(!1!==n.tooltip){let e;e="function"==typeof n.tooltip?n.tooltip:new RI(!0===n.tooltip?{}:n.tooltip).call,j.tooltip(e)}let k,{hover:E}=n;if(void 0===E&&(E="vega"===b),E){const{hoverSet:e,updateSet:t}="boolean"==typeof E?{}:E;j.hover(e,t)}if(n&&(null!=n.width&&j.width(n.width),null!=n.height&&j.height(n.height),null!=n.padding&&j.padding(n.padding)),yield j.initialize(x).runAsync(),!1!==f){let e=m;if(!1!==n.defaultStyle){const t=document.createElement("details");t.title=d.CLICK_TO_VIEW_ACTIONS,m.append(t),e=t;const n=document.createElement("summary");n.innerHTML='\n\n \n \n \n',t.append(n),k=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",k)}const r=document.createElement("div");if(e.append(r),r.classList.add("vega-actions"),!0===f||!1!==f.export)for(const e of["svg","png"])if(!0===f||!0===f.export||f.export[e]){const t=d[e.toUpperCase()+"_ACTION"],i=document.createElement("a");i.text=t,i.href="#",i.target="_blank",i.download=`${g}.${e}`,i.addEventListener("mousedown",(function(t){return PI(this,void 0,void 0,(function*(){t.preventDefault();const r=yield j.toImageURL(e,n.scaleFactor);this.href=r}))})),r.append(i)}if(!0===f||!1!==f.source){const e=document.createElement("a");e.text=d.SOURCE_ACTION,e.href="#",e.addEventListener("click",(function(e){var r,i;KI(J()(t),null!==(r=n.sourceHeader)&&void 0!==r?r:"",null!==(i=n.sourceFooter)&&void 0!==i?i:"",b),e.preventDefault()})),r.append(e)}if("vega-lite"===b&&(!0===f||!1!==f.compiled)){const e=document.createElement("a");e.text=d.COMPILED_ACTION,e.href="#",e.addEventListener("click",(function(e){var t,r;KI(J()(y),null!==(t=n.sourceHeader)&&void 0!==t?t:"",null!==(r=n.sourceFooter)&&void 0!==r?r:"","vega"),e.preventDefault()})),r.append(e)}if(!0===f||!1!==f.editor){const e=null!==(l=n.editorUrl)&&void 0!==l?l:"https://vega.github.io/editor/",i=document.createElement("a");i.text=d.EDITOR_ACTION,i.href="#",i.addEventListener("click",(function(n){!function(e,t,n){const r=e.open(t),{origin:i}=new URL(t);let o=40;e.addEventListener("message",(function t(n){n.source===r&&(o=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){o<=0||(r.postMessage(n,i),setTimeout(e,250),o-=1)}),250)}(window,e,{config:c,mode:b,renderer:h,spec:J()(t)}),n.preventDefault()})),r.append(i)}}return{view:j,spec:t,vgSpec:y,finalize:function(){k&&document.removeEventListener("click",k),j.finalize()}}}))}(e,u,f,a)}))},eU=n(2),tU=n(7),nU=n.n(tU);const rU={bin_type:{label:"Binning Type",section:" Values",type:"string",order:2,display:"radio",values:[{"Max Bins":{description:"Set a maximum number of bins",value:"bins"}},{Steps:{description:"Set an exact step size to use between bins. Step sizes that would create more than 50 bins are ignored.",value:"steps"}},{Breakpoints:{description:"An array of allowable step sizes to choose from.",value:"breakpoints"}}],default:"bins"},bin_style:{label:"Chart Type",section:" Values",type:"string",order:1,display:"select",default:"simple_hist",values:[{"Simple Histogram":"simple_hist"},{"Scatter Histogram":"binned_hist"}]},winsorization:{label:"Limit Outliers (Winsorize)",section:" Values",type:"boolean",order:7,default:!1},color_col:{type:"string",section:" Style",label:"Color",display:"color",display_size:"half",default:"#1A73E8",order:3},color_on_hover:{type:"string",section:" Style",label:"Color On Hover",display:"color",display_size:"half",default:"#338bff",order:4},x_axis_label_divider:{label:"X Axis -------------------------------------------------------",section:"Labels",type:"string",display:"divider",order:6},x_axis_override:{label:"X Axis Title Override",section:"Labels",type:"string",display:"text",default:"",order:7},x_grids:{label:"X Axis Gridlines",section:" Style",type:"boolean",display:"select",display_size:"half",default:!0},x_axis_title_font_size:{label:"X Axis Title Size",section:"Labels",type:"number",display:"text",default:16,display_size:"half",order:9},x_axis_label_font_size:{label:"X Axis Label Size",section:"Labels",type:"number",display:"text",default:12,display_size:"half",order:10},x_axis_label_angle:{label:"X Axis Label Angle",section:"Labels",type:"number",display:"range",default:0,order:11,min:0,max:90,step:1,display_size:"half"},x_label_separation:{label:"X Axis Label Density",section:"Labels",type:"number",display:"range",default:100,order:12,min:1,max:100,step:1,display_size:"half"},y_axis_label_divider:{label:"Y Axis -------------------------------------------------------",section:"Labels",type:"string",display:"divider",order:13},y_axis_override:{label:"Y Axis Title Override",section:"Labels",type:"string",display:"text",default:"",order:14},y_grids:{label:"Y Axis Gridlines",section:" Style",type:"boolean",display:"select",display_size:"half",order:15,default:!0},y_axis_title_font_size:{label:"Y Axis Title Size",section:"Labels",type:"number",display:"text",default:16,display_size:"half",order:16},y_axis_label_font_size:{label:"Y Axis Label Size",section:"Labels",type:"number",display:"text",default:12,display_size:"half",order:17},y_axis_label_angle:{label:"Y Axis Label Angle",section:"Labels",type:"number",display:"range",default:0,order:18,min:0,max:90,step:1,display_size:"half"},y_label_separation:{label:"Y Axis Label Density",section:"Labels",type:"number",display:"range",default:100,order:19,min:1,max:100,step:1,display_size:"half"},x_axis_value_format:{label:"X Axis Value Format",order:200,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"}};function iU(e,t,n){return[{title:""!==t?t:e.title,bin:n,field:n.binned?"label":e.lookerName.replace(".","_"),type:n.binned?"ordinal":"quantitative"},{title:"Count of Records",aggregate:"count",type:"quantitative",...!n.binned&&{aggregate:"count"},...n.binned&&{field:"count_x"}}]}var oU=function({dataProperties:e,config:t,maxX:n,width:r}){return{selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"X_HISTOGRAM",mark:{type:"bar",cursor:"pointer"},height:60,width:r,encoding:{x:{bin:{..."bins"===t.bin_type&&{maxbins:t.max_bins},..."steps"===t.bin_type&&{step:t.num_step_x<=Math.floor(n/200)?Math.floor(n/200):t.num_step_x},..."breakpoints"===t.bin_type&&{binned:!0}},field:"breakpoints"===t.bin_type?"bin_start_x":t.x,type:"quantitative",axis:{grid:t.x_grids,title:null,labels:!1,ticks:!1}},..."breakpoints"===t.bin_type&&{x2:{field:"bin_end_x"}},y:{..."breakpoints"!==t.bin_type&&{aggregate:"count"},..."breakpoints"===t.bin_type&&{field:"count_x"},type:"quantitative",title:"",axis:{labelColor:"#696969",titleColor:"#696969",grid:t.y_grids}},tooltip:iU(e[t.x],t.x_axis_override,{..."bins"===t.bin_type&&{maxbins:t.max_bins},..."steps"===t.bin_type&&{step:t.num_step_x<=Math.floor(n/200)?Math.floor(n/200):t.num_step_x},..."breakpoints"===t.bin_type&&{binned:!0}}),color:{condition:{selection:"highlight",value:t.color_on_hover},value:t.color_col}}}};var aU=({dataProperties:e,config:t,maxY:n,height:r})=>({selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"Y_HISTOGRAM",mark:{type:"bar",cursor:"pointer"},width:60,height:r,encoding:{y:{bin:{..."bins"===t.bin_type&&{maxbins:t.max_bins},..."steps"===t.bin_type&&{step:t.num_step_y<=Math.floor(n/200)?Math.floor(n/200):t.num_step_y},..."breakpoints"===t.bin_type&&{binned:!0}},field:"breakpoints"===t.bin_type?"bin_start_y":t.y,type:"quantitative",axis:{grid:t.y_grids,title:null,labels:!1,ticks:!1}},..."breakpoints"===t.bin_type&&{y2:{field:"bin_end_y"}},x:{..."breakpoints"!==t.bin_type&&{aggregate:"count"},..."breakpoints"===t.bin_type&&{field:"count_y"},type:"quantitative",title:"",axis:{labelColor:"#696969",titleColor:"#696969",grid:t.x_grids,title:null}},tooltip:iU(e[t.y],t.y_axis_override,{..."bins"===t.bin_type&&{maxbins:t.max_bins},..."steps"===t.bin_type&&{step:t.num_step_y<=Math.floor(n/200)?Math.floor(n/200):t.num_step_y},..."breakpoints"===t.bin_type&&{binned:!0}}),color:{condition:{selection:"highlight",value:t.color_on_hover},value:t.color_col}}}),sU=n(6);var uU=function({dataProperties:e,config:t,maxX:n,maxY:r,height:i,width:o,valFormatX:a,valFormatY:s}){return{selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"HEATMAP",mark:{zindex:-1,type:"rect",invalid:null,...t.heatmap_off&&{cursor:"pointer"},...!t.heatmap_off&&{fillOpacity:0}},height:i,width:o,encoding:{x:{...t.heatmap_off&&{bin:{..."bins"===t.bin_type&&{maxbins:t.max_bins},..."steps"===t.bin_type&&{step:t.num_step_x<=Math.floor(n/200)?Math.floor(n/200):t.num_step_x},..."breakpoints"===t.bin_type&&{binned:!0}}},field:"breakpoints"===t.bin_type?"bin_start_x":t.x,type:"quantitative",axis:{name:"xAxis",title:""===t.x_axis_override?e[t.x].title:t.x_axis_override,titleFontSize:t.x_axis_title_font_size,format:"d",labelFontSize:t.x_axis_label_font_size,grid:t.x_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-t.x_label_separation,labelOverlap:!0,labelColor:"#696969",labelAngle:-1*t.x_axis_label_angle,titleColor:"#696969",titlePadding:25+a.length}},..."breakpoints"===t.bin_type&&{x2:{field:"bin_end_x"}},y:{...t.heatmap_off&&{bin:{..."bins"===t.bin_type&&{maxbins:t.max_bins},..."steps"===t.bin_type&&{step:t.num_step_y<=Math.floor(r/200)?Math.floor(r/200):t.num_step_y},..."breakpoints"===t.bin_type&&{binned:!0}}},field:"breakpoints"===t.bin_type?"bin_start_y":t.y,type:"quantitative",axis:{title:""===t.y_axis_override?e[t.y].title:t.y_axis_override,titleFontSize:t.y_axis_title_font_size,format:"d",labelFontSize:t.y_axis_label_font_size,labelAngle:-1*t.y_axis_label_angle,grid:t.y_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-t.y_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25+3*s.length}},..."breakpoints"===t.bin_type&&{y2:{field:"bin_end_y"}},color:{aggregate:"count",type:"quantitative",legend:!!t.heatmap_off&&{orient:t.legend_orient,labelFontSize:t.legend_size,titleFontSize:t.legend_size,titleFontWeight:"normal",offset:t.y_hist?85:10,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}},opacity:{condition:{selection:"highlight",value:1},value:t.heatmap_opacity},...t.heatmap_off&&{tooltip:(()=>{let i=iU(e[t.x],t.x_axis_override,{..."bins"===t.bin_type&&{maxbins:t.max_bins},..."steps"===t.bin_type&&{step:t.num_step_x<=Math.floor(n/200)?Math.floor(n/200):t.num_step_x},..."breakpoints"===t.bin_type&&{binned:!0}}).concat(iU(e[t.y],t.y_axis_override,{..."bins"===t.bin_type&&{maxbins:t.max_bins},..."steps"===t.bin_type&&{step:t.num_step_y<=Math.floor(r/200)?Math.floor(r/200):t.num_step_y},..."breakpoints"===t.bin_type&&{binned:!0}}));return i=i.concat(i.splice(1,1)),i})()}}}};var lU=function({config:e,dataProperties:t,mainDimensions:n}){return{mark:{type:"text",align:"left",angle:e.point_labels_angle,dx:e.point_labels_x_offset,dy:e.point_labels_y_offset,fontSize:e.point_labels_font_size},encoding:{x:{field:e.x,type:"quantitative"},y:{field:e.y,type:"quantitative"},text:{field:t._filterlabels?"_filterlabels":n[0]}}}};function cU({config:e,tooltipFields:t,dataProperties:n,width:r,height:i,mainDimensions:o}){const a=function({config:e,tooltipFields:t,width:n,height:r}){return{name:"SCATTERPLOT",mark:{color:e.color_col,cursor:"pointer",type:"circle",opacity:e.point_opacity,zindex:2,size:100},height:r,width:n,encoding:{tooltip:t,x:{field:e.x,type:"quantitative"},y:{field:e.y,type:"quantitative"}}}}({config:e,dataProperties:n,tooltipFields:t,width:r,height:i});return e.layer_points&&""!==e.size&&void 0!==e.size&&function(e,t,n){e.encoding.size={field:t.size,type:"quantitative",title:n[t.size].title,legend:{orient:t.legend_orient,format:"d",labelFontSize:t.legend_size,titleFontWeight:"normal",offset:t.y_hist?85:10,titleFontSize:t.legend_size,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}}}(a,e,n),e.layer_points&&void 0!==o[1]&&function(e,t,n,r){e.encoding.color={scale:{scheme:t.point_group_colors},field:r[1],legend:{type:"symbol",offset:t.y_hist?85:10,title:n[r[1]].title,type:"symbol",orient:t.legend_orient,labelFontSize:t.legend_size,titleFontWeight:"normal",titleFontSize:t.legend_size,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}}}(a,e,n,o),a}var fU=n(9);var dU=function({axis:e,config:t,data:n,min:r,max:i}){const o=Object(fU.a)(t[`reference_line_${e}_p`],t[e],n);return{name:"refLine"+e,mark:{type:"rule"},encoding:{x:{datum:"x"===e?o:r},y:{datum:"x"===e?r:o},x2:{datum:"x"===e?o:i},y2:{datum:"x"===e?i:o},color:{value:"red"},size:{value:t[`reference_line_${e}_width`]},strokeDash:{value:[4,4]}}}};var hU=function({layers:e,data:t,config:n,tooltipFields:r,dataProperties:i,width:o,height:a,mainDimensions:s,minX:u,minY:l,maxX:c,maxY:f}){n.layer_points&&e.push(cU({config:n,tooltipFields:r,dataProperties:i,width:o,height:a,mainDimensions:s})),n.layer_points&&n.point_labels&&e.push(lU({config:n,dataProperties:i,mainDimensions:s})),n.reference_line_x&&e.push(dU({axis:"x",min:l,max:f,config:n,data:t})),n.reference_line_y&&e.push(dU({axis:"y",min:u,max:c,config:n,data:t}))};var pU=function({data:e,dataProperties:t,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={vconcat:[oU({dataProperties:t,config:n,maxX:r,width:u}),{spacing:15,bounds:"flush",hconcat:[{name:"BOUNDING_BOX",layer:[uU({dataProperties:t,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]},aU({dataProperties:t,config:n,maxY:o,height:s})]}],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.vconcat[1].hconcat[0].layer;return hU({layers:p,data:e,dataProperties:t,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var gU=function({data:e,dataProperties:t,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={name:"BOUNDING_BOX",layer:[uU({dataProperties:t,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})],config:{range:{heatmap:{scheme:n.color_scheme}}}};return hU({layers:h.layer,data:e,dataProperties:t,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var mU=function({data:e,dataProperties:t,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={vconcat:[oU({dataProperties:t,config:n,maxX:r,width:u}),{name:"BOUNDING_BOX",layer:[uU({dataProperties:t,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]}],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.vconcat[1].layer;return hU({layers:p,data:e,dataProperties:t,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var bU=function({data:e,dataProperties:t,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={hconcat:[{name:"BOUNDING_BOX",layer:[uU({dataProperties:t,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]},aU({dataProperties:t,config:n,maxY:o,height:s})],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.hconcat[0].layer;return hU({layers:p,data:e,dataProperties:t,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var yU=function(e){return e.config.x_hist&&e.config.y_hist?pU(e):e.config.x_hist?mU(e):e.config.y_hist?bU(e):gU(e)};function vU(e,t,n,r,i,o,a,s){a.clearErrors();let{dataProperties:u,myData:l}=Object(fU.d)(e,r);const c=t.clientWidth,f=t.clientHeight,d=Math.max(...l.map(e=>e[n.x])),h=Math.min(...l.map(e=>e[n.x])),p=Math.max(...l.map(e=>e[n.y])),g=Math.min(...l.map(e=>e[n.y])),m=r.fields.dimension_like.map(e=>e.name.replace(".","_")),b=function(e,t,n,r,i,o){var a={};a.options=Object.assign({},t),a.measures=[],a.dimensions=[],a.masterList=[],a.options.bin_type.values.length>2&&a.options.bin_type.values.pop();var s,u,l,c,f=1,d=1;e.fields.dimension_like.forEach((function(e){if("_filterlabels"!==e.name&&(e.is_numeric||"tier"===e.type)){var t={},n=e.name.replace(".","_");void 0!==e.label_short?t[e.label_short]=n:t[e.label]=n,1==f?s=n:2==f&&(u=n),a.masterList.push(t),a.dimensions.push(t),f+=1}})),e.fields.measure_like.forEach((function(e){if("_filterlabels"!==e.name){var t={},n=e.name.replace(".","_");void 0!==e.label_short?(t[e.label_short]=n,a.measures.push(t)):(t[e.label]=n,"yesno"==e.type?a.dimensions.push(t):a.measures.push(t)),1==d?l=n:2==d&&(c=n),a.masterList.push(t),d+=1}})),void 0===l&&(l=s),void 0===c&&(c=u),"steps"===n.bin_type?(a.options.num_step_x={label:"Step Size (X)",section:" Values",type:"number",order:5,display:"text",default:Math.floor(r/10),display_size:"half"},a.options.num_step_y={label:"Step Size (Y)",section:" Values",type:"number",order:6,display:"text",default:Math.floor(i/10),display_size:"half"}):"bins"===n.bin_type?a.options.max_bins={label:"Max number of Bins",section:" Values",type:"string",order:4,default:"10"}:"breakpoints"===n.bin_type&&(a.options.breakpointsX={label:"Breakpoints (X)",section:" Values",type:"string",placeholder:"Comma seperated breakpoints (100, 200, 300)",order:4},a.options.breakpointsY={label:"Breakpoints (Y)",section:" Values",type:"string",placeholder:"Comma seperated breakpoints (100, 200, 300)",order:5}),n.winsorization&&(a.options.percentile={label:"Percentiles",section:" Values",type:"string",order:7,display:"select",display_size:"half",default:"1_99",values:[{"1% - 99%":"1_99"},{"5% - 95%":"5_95"}]}),a.options.x={label:"X Axis",section:" Values",type:"string",display:"select",order:1,values:a.measures,default:l},a.options.y={label:"Y Axis",section:" Values",type:"string",display:"select",order:1,values:a.measures,default:c},a.options.heatmap_off={label:"Heatmap",section:" Values",type:"boolean",order:10,display:"select",display_size:"half",default:!0},a.options.x_hist={label:"X Histogram",section:" Values",type:"boolean",display_size:"half",order:11,default:!0},a.options.y_hist={label:"Y Histogram",section:" Values",type:"boolean",display_size:"half",order:11,default:!0},a.options.layer_points={label:"Points",section:" Values",type:"boolean",display_size:"half",order:11,display:"select",default:!0};var h=a.measures.length>2?a.measures[2]:"",p=a.measures.concat([{None:""}]);return a.options.size={label:"Size Points By",section:" Values",type:"string",order:12,display:"select",values:p,default:h[Object.keys(h)[0]]},a.options.color_scheme={label:"Heatmap Color Scheme",section:" Style",type:"array",display:"colors",order:1,default:["#7FCDAE","#7ED09C","#7DD389","#85D67C","#9AD97B","#B1DB7A","#CADF79","#E2DF78","#E5C877","#E7AF75","#EB9474","#EE7772"]},o&&(a.options.point_group_colors={label:"Point Groups Colors",section:" Style",type:"array",display:"colors",order:2,default:["#7FCDAE","#7ED09C","#7DD389","#85D67C","#9AD97B","#B1DB7A","#CADF79","#E2DF78","#E5C877","#E7AF75","#EB9474","#EE7772"]}),a.options.heatmap_opacity={label:"Heatmap Opacity",section:" Style",type:"number",display:"range",min:0,max:1,step:.05,default:.8,order:1},a.options.point_opacity={label:"Point Opacity",section:" Style",type:"number",display:"range",min:0,max:1,step:.05,default:.8,order:6},a.options.legend_orient={label:"Legend Position",section:"Labels",type:"string",display:"select",order:6,values:[{Left:"left"},{Right:"right"},{Top:"top"},{Bottom:"bottom"}],display_size:"half",default:"right"},a.options.legend_size={label:"Legend Font Size",section:"Labels",type:"number",display:"text",default:16,display_size:"half",order:5},a.options.y_axis_value_format={label:"Y Axis Value Format",order:201,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"},a.options.points_legend_value_format={label:"Point Value Format",order:202,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"},a.options.point_labels_divider={label:"Point Labels ---------------------------------------------",section:"Labels",type:"string",display:"divider",order:1e3,default:!1},a.options.point_labels={label:"Scatterplot Point Labels",section:"Labels",type:"boolean",order:1001,default:!1},a.options.point_labels_x_offset={label:"Point Label X Offset",section:"Labels",type:"number",display:"range",display_size:"half",default:0,order:1002,min:-50,max:50,step:1},a.options.point_labels_y_offset={label:"Point Label Y Offset",section:"Labels",type:"number",display:"range",display_size:"half",order:1003,default:0,min:-50,max:50,step:1},a.options.point_labels_angle={label:"Point Label Angle",section:"Labels",type:"number",display:"range",display_size:"half",order:1004,default:0,min:-90,max:90,step:1},a.options.point_labels_font_size={label:"Point Label Font Size",section:"Labels",type:"number",display:"text",display_size:"half",default:"12",order:1005},a.options.reference_line_divider={label:"Reference Lines ----------------------------------------",order:1006,section:"Labels",type:"string",display:"divder"},a.options.reference_line_x={label:"X Axis",order:1007,section:"Labels",type:"boolean",display_size:"half"},a.options.reference_line_y={label:"Y Axis",order:1008,section:"Labels",type:"boolean",display_size:"half"},a.options.reference_line_x_p={label:"X Axis Percentile",placeholder:"Value from 0 to 100",order:1009,section:"Labels",type:"number",display_size:"half",default:50},a.options.reference_line_y_p={label:"Y Axis Percentile",placeholder:"Value from 0 to 100",order:1010,section:"Labels",type:"number",display_size:"half",default:50},a.options.reference_line_x_width={label:"X Axis Stroke",order:1011,section:"Labels",type:"number",display_size:"half",default:3},a.options.reference_line_y_width={label:"Y Axis Stroke",order:1012,section:"Labels",type:"number",display_size:"half",default:3},a}(r,rU,n,d,p,void 0!==m[1]).options;if(a.trigger("registerOptions",b),"breakpoints"===n.bin_type&&a.addError({title:"Breakpoints Currently not supported for Scatter Histogram"}),null==u[n.x]||null==u[n.y])return;const y=u[n.x].valueFormat,v=u[n.y].valueFormat,x=n.x_axis_value_format,_=n.y_axis_value_format;let O=""!==x?x:y;null==O&&(O="#,##0");let w,j=""!==_?_:v;if(null==j&&(j="#,##0"),n.size){const e=u[n.size].valueFormat,t=n.points_legend_value_format;w=""!==t?t:e,null==w&&(w="#,##0")}n.winsorization&&(l=Object(fU.e)(l,n.x,n.percentile),l=Object(fU.e)(l,n.y,n.percentile));const k=function(e,t,n){let r=[];for(let t in e)if("_filterlabels"!==t&&("nominal"===e[t].dtype||t===n.x||t===n.y||t===n.size)){let i={};i.field=t,i.type=e[t].dtype,i.title=(t=>{switch(t){case n.x:return""!==n.x_axis_override?n.x_axis_override:e[t].title;case n.y:return""!==n.y_axis_override?n.y_axis_override:e[t].title;default:return e[t].title}})(t),r.push(i)}let i=[n.x,n.y];n.size&&i.push(n.size),r.sort((e,t)=>i.indexOf(e.field)-i.indexOf(t.field));for(let e=0;e{Object(sU.d)(i,n,m,O,j,w)};s("#my-vega",E,{actions:!1,renderer:"svg",tooltip:{theme:"custom"}}).then(({spec:e,view:t})=>{Object(sU.b)(),A(),i.print?o():(t.addEventListener("wheel",A,{passive:!0}),t.addEventListener("mousedown",A,{passive:!0}),t.addEventListener("mouseup",A,{passive:!0}),t.addEventListener("drag",A,{passive:!0}),t.addEventListener("mousemove",(e,t)=>{!function(e,t,n,r,i,o){if(void 0===t||void 0===n||0===n.fillOpacity||"breakpoints"===t.bin_type)return;const a=e=>e.replace(/\u2013|\u2014|\u2212/g,"-"),s=r=>{let i=""!==t[r+"_axis_override"]?t[r+"_axis_override"]:e[t[r].replace(".","_")].title;return n.tooltip[i].split(" ")},u=r=>{let i="size"!==r&&""!==t[r+"_axis_override"]?t[r+"_axis_override"]:e[t[r].replace(".","_")].title;return Number(a(n.tooltip[i]))},l=(e,t)=>{let n="x"===e?r:i;return[nU.a.format(n,Number(a(t[0]))),nU.a.format(n,Number(a(t[2])))]};if("X_HISTOGRAM_marks"===n.mark.name){let[e,t]=l("x",s("x"));eU.a("td.value").text(e+" - "+t)}if("Y_HISTOGRAM_marks"===n.mark.name){let[e,t]=l("y",s("y"));eU.a("td.value").text(e+" - "+t)}if("HEATMAP_marks"===n.mark.name){let[e,n]=l("x",s("x")),[r,i]=l("y",s("y"));eU.b("td.value").each((function(o,a){0===a?eU.a(this).text(e+" - "+n):1===a&&t.x!==t.y&&eU.a(this).text(r+" - "+i)}))}if("SCATTERPLOT_marks"===n.mark.name){let e=0;eU.b("td.value").each((function(n,a){0===a?eU.a(this).text(nU.a.format(r,u("x"))):1===a?t.x!==t.y?eU.a(this).text(nU.a.format(i,u("y"))):t.size&&(eU.a(this).text(nU.a.format(o,u("size"))),e=1):2===a&&!e&&t.size&&t.x!==t.size&&t.y!==t.size&&eU.a(this).text(nU.a.format(o,u("size")))}))}}(u,n,t,O,j,w)}),void 0!==m[1]&&n.size&&(n.x_hist||n.y_hist)&&Object(sU.c)(n.legend_orient),t.addEventListener("click",(function(e,t){if(!(void 0===t||void 0===t.datum||Object.keys(t.datum).length<=1||0===t.fillOpacity))if(i.crossfilterEnabled&&"rect"!==t.mark.marktype){let n={[u[m[0]].lookerName]:{value:t.datum[m[0]]}};LookerCharts.Utils.toggleCrossfilter({row:n,event:e})}else{var o=t.datum.links;if(Object.keys(t.datum)[0].startsWith("bin_")){let e=[];for(let t of r.fields.dimension_like.concat(r.fields.measure_like))e.push(t.name);const i=u[n.x].lookerName,a=u[n.y].lookerName,s=Object.keys(t.datum).filter(e=>e.includes(n.x)),c=Object.keys(t.datum).filter(e=>e.includes(n.y));let f=l[0].links;if(f.length<1)o=[];else{f=f.filter(e=>e.url.includes("/explore/"))[0].url.split("?")[0];let n=`${f}?fields=${e.join(",")}`;if(s.length>0&&(n+=`&f[${i}]=[${t.datum[s[0]]}, ${t.datum[s[1]]})`),c.length>0&&(n+=`&f[${a}]=[${t.datum[c[0]]}, ${t.datum[c[1]]})`),void 0!==r.applied_filters){let e=r.applied_filters;for(let t in e)n+=`&f[${e[t].field.name}]=${e[t].value}`}o=[{label:`Show ${t.datum.__count} Records`,type:"drill",type_label:"Drill into Records",url:n}]}}LookerCharts.Utils.openDrillMenu({links:o,event:e})}})))})}function xU(e,t,n,r,i,o,a,s){a.clearErrors();let{dataProperties:u,myData:l}=Object(fU.d)(e,r);const c=r.fields.measure_like[0].name.replace(".","_"),f=r.fields.dimensions[0].name.replace(".","_"),d=Math.max(...l.map(e=>e[c])),h=Object.assign({},rU);h.bin_type.values.length<3&&(h.bin_type.values[h.bin_type.values.length]={Breakpoints:{description:"An array of allowable step sizes to choose from.",value:"breakpoints"}}),"bins"===n.bin_type?h.max_bins={label:"Max number of Bins",section:" Values",type:"string",order:4,display:"text",default:"10"}:"steps"===n.bin_type?h.step_size={label:"Step Size",section:" Values",type:"number",order:4,display:"text",default:Math.floor(d/10)}:(h.breakpoint_array={label:"Breakpoints",section:" Values",order:4,type:"string",default:`min, ${Math.floor(d/5)}, ${Math.floor(d/4)}, ${Math.floor(d/3)}, ${Math.floor(d/2)}, max`},h.breakpoint_ordinal={label:"Use Equal Sized Columns (Ordinal Bins)",order:4,section:" Values",type:"boolean",display:"select",default:!1}),n.winsorization&&(h.percentile={label:"Percentiles",section:" Values",type:"string",order:7,display:"select",display_size:"half",default:"1_99",values:[{"1% - 99%":"1_99"},{"5% - 95%":"5_95"}]}),a.trigger("registerOptions",h),n.winsorization&&(l=Object(fU.e)(l,c,n.percentile));const p=u[c].valueFormat,g=n.x_axis_value_format;let m=""!==g?g:p;null==m&&(m="#,##0");let b=[];"breakpoints"===n.bin_type&&(b=Object(fU.c)(l,c,n.breakpoint_array,m,"x"));var y,v,x;s("#my-vega",{$schema:"https://vega.github.io/schema/vega-lite/v4.json",config:{view:{stroke:"transparent"}},data:{values:"breakpoints"===n.bin_type?b:l},width:.9*t.clientWidth,height:.8*t.clientHeight,padding:20,selection:{highlight:{type:"single",empty:"none",on:"mouseover"}},mark:{type:"bar",cursor:"pointer"},encoding:{x:{type:n.breakpoint_ordinal?"ordinal":"quantitative",...n.breakpoint_ordinal&&{sort:["order"]},...!n.breakpoint_ordinal&&{bin:{..."bins"===n.bin_type&&{maxbins:n.max_bins},..."steps"===n.bin_type&&{step:n.step_size<=Math.floor(d/200)?Math.floor(d/200):n.step_size},..."breakpoints"===n.bin_type&&{binned:!0}}},field:"breakpoints"===n.bin_type?n.breakpoint_ordinal?"label":"bin_start_x":c,axis:{title:""===n.x_axis_override?u[c].title:n.x_axis_override,titleFontSize:n.x_axis_title_font_size,labelFontSize:n.x_axis_label_font_size,labelAngle:-1*n.x_axis_label_angle,format:"d",grid:n.x_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-n.x_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25}},..."breakpoints"===n.bin_type&&!1===n.breakpoint_ordinal&&{x2:{field:"bin_end_x"}},y:{type:"quantitative",..."breakpoints"!==n.bin_type&&{aggregate:"count"},..."breakpoints"===n.bin_type&&{field:"count_x"},axis:{title:""===n.y_axis_override?"Count of "+u[f].title:n.y_axis_override,titleFontSize:n.y_axis_title_font_size,labelFontSize:n.y_axis_label_font_size,labelAngle:-1*n.y_axis_label_angle,grid:n.y_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-n.y_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25}},color:{condition:{selection:"highlight",value:n.color_on_hover},value:n.color_col},tooltip:(y=u[c],v=n.x_axis_override,x={..."bins"===n.bin_type&&{maxbins:n.max_bins},..."steps"===n.bin_type&&{step:n.step_size},..."breakpoints"===n.bin_type&&{binned:!0}},[{title:""!==v?v:y.title,bin:x,field:x.binned?"label":y.lookerName.replace(".","_"),type:x.binned?"ordinal":"quantitative"},{title:"Count of Records",type:"quantitative",...!x.binned&&{aggregate:"count"},...x.binned&&{field:"count_x"}}])}},{actions:!1,renderer:"svg",tooltip:{theme:"custom"}}).then(({spec:e,view:t})=>{Object(sU.b)(),Object(sU.e)(n,"simple",m),i.print?o():(t.addEventListener("mousemove",(e,t)=>{!function(e,t,n,r,i){if(void 0===t||void 0===r||"transparent"===r.stroke||"breakpoints"===t.bin_type)return;const o=e=>e.replace(/\u2013|\u2014|\u2212/g,"-");let[a,s]=(u=(r=>{let i=""!==t.x_axis_override?t.x_axis_override:e[n].title;return r.tooltip[i].split(" ")})(r),[nU.a.format(i,Number(o(u[0]))),nU.a.format(i,Number(o(u[2])))]);var u;eU.a("td.value").text(a+" - "+s)}(u,n,c,t,m)}),t.addEventListener("click",(function(e,t){if(void 0===t.datum)return;const i=u[c].lookerName,o="breakpoints"===n.bin_type?["bin_start_x","bin_end_x"]:Object.keys(t.datum).filter(e=>e.includes(c));let a=t.datum.links,s=l[0].links,f=[];for(let e of r.fields.dimension_like.concat(r.fields.measure_like))f.push(e.name);if(s.length<1)a=[];else{s=s.filter(e=>e.url.includes("/explore/"))[0].url.split("?")[0];let e=`${s}?fields=${f.join(",")}`;if(e+=`&f[${i}]=[${t.datum[o[0]]}, ${t.datum[o[1]]})`,void 0!==r.applied_filters){let t=r.applied_filters;for(let n in t)e+=`&f[${t[n].field.name}]=${t[n].value}`}a=[{label:`Show ${"breakpoints"===n.bin_type?t.datum.count_x:t.datum.__count} Records`,type:"drill",type_label:"Drill into Records",url:e}]}LookerCharts.Utils.openDrillMenu({links:a,event:e})})))})}n(96);looker.plugins.visualizations.add({options:rU,create:function(e,t){e.appendChild(document.createElement("div")).setAttribute("id","my-vega")},updateAsync:function(e,t,n,r,i,o){if(0===e.length)return this.addError({title:"No Results"}),void o();if("binned_hist"===n.bin_style){if(!Object(fU.b)(this,r,{min_pivots:0,max_pivots:0,min_dimensions:1,max_dimensions:void 0,min_measures:2,max_measures:void 0}))return;vU(e,t,n,r,i,o,this,QI)}else{if(!Object(fU.b)(this,r,{min_pivots:0,max_pivots:0,min_dimensions:1,max_dimensions:void 0,min_measures:1,max_measures:void 0}))return;xU(e,t,n,r,i,o,this,QI)}}})},function(e,t,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*i.d-e.getMinutes()*i.c)}),(function(e,t){e.setTime(+e+t*i.b)}),(function(e,t){return(t-e)/i.b}),(function(e){return e.getHours()}));t.a=o;o.range},function(e,t,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*i.d)}),(function(e,t){e.setTime(+e+t*i.c)}),(function(e,t){return(t-e)/i.c}),(function(e){return e.getMinutes()}));t.a=o;o.range},function(e,t,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*i.b)}),(function(e,t){return(t-e)/i.b}),(function(e){return e.getUTCHours()}));t.a=o;o.range},function(e,t,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*i.c)}),(function(e,t){return(t-e)/i.c}),(function(e){return e.getUTCMinutes()}));t.a=o;o.range},function(e,t,n){"use strict";var r=n(15);t.a=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Object(r.a)(t)/3)))-Object(r.a)(Math.abs(e)))}},function(e,t,n){"use strict";var r=n(15);t.a=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Object(r.a)(t)-Object(r.a)(e))+1}},function(e,t,n){"use strict";var r=n(15);t.a=function(e){return Math.max(0,-Object(r.a)(Math.abs(e)))}},function(e,t,n){"use strict";var r={},i={};function o(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function a(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function s(e,t){var n=e+"",r=n.length;return r9999?"+"+s(t,6):s(t,4))+"-"+s(e.getUTCMonth()+1,2)+"-"+s(e.getUTCDate(),2)+(o?"T"+s(n,2)+":"+s(r,2)+":"+s(i,2)+"."+s(o,3)+"Z":i?"T"+s(n,2)+":"+s(r,2)+":"+s(i,2)+"Z":r||n?"T"+s(n,2)+":"+s(r,2)+"Z":"")}t.a=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function s(e,t){var o,a=[],s=e.length,u=0,l=0,c=s<=0,f=!1;function d(){if(c)return i;if(f)return f=!1,r;var t,o,a=u;if(34===e.charCodeAt(a)){for(;u++=s?c=!0:10===(o=e.charCodeAt(u++))?f=!0:13===o&&(f=!0,10===e.charCodeAt(u)&&++u),e.slice(a+1,t-1).replace(/""/g,'"')}for(;ut,"vega-lite":(t,e)=>WI.compile(t,{config:e}).spec};function KI(t,e,n,r){const i=`${e}
`,o=`
${n}`,a=window.open("");a.document.write(i+t+o),a.document.title=VI[r]+" JSON Source"}function ZI(t,e){var n;return PI(this,void 0,void 0,(function*(){const r=Object(Z.I)(t.config)?JSON.parse(yield e.load(t.config)):null!==(n=t.config)&&void 0!==n?n:{},i=Object(Z.I)(t.patch)?JSON.parse(yield e.load(t.patch)):t.patch;return Object.assign(Object.assign(Object.assign({},t),i?{patch:i}:{}),r?{config:r}:{})}))}var QI=function(t,e,n={}){var r,i,o;return PI(this,void 0,void 0,(function*(){const a=(s=n.loader)&&"load"in s?n.loader:qI.loader(n.loader);var s;const u=Object(Z.I)(e)?JSON.parse(yield a.load(e)):e,l=yield ZI(null!==(r=u.usermeta&&u.usermeta.embedOptions)&&void 0!==r?r:{},a),c=yield ZI(n,a),f=Object.assign(Object.assign({},II(c,l)),{config:Object(Z.O)(null!==(i=c.config)&&void 0!==i?i:{},null!==(o=l.config)&&void 0!==o?o:{})});return yield function(t,e,n={},r){var i,o,a,s,u,l;return PI(this,void 0,void 0,(function*(){const c=n.theme?Object(Z.O)(v[n.theme],null!==(i=n.config)&&void 0!==i?i:{}):n.config,f=Object(Z.C)(n.actions)?n.actions:II({},HI,null!==(o=n.actions)&&void 0!==o?o:{}),d=Object.assign(Object.assign({},GI),n.i18n),h=null!==(a=n.renderer)&&void 0!==a?a:"canvas",p=null!==(s=n.logLevel)&&void 0!==s?s:qI.Warn,g=null!==(u=n.downloadFileName)&&void 0!==u?u:"visualization",m="string"==typeof t?document.querySelector(t):t;if(!m)throw new Error(t+" does not exist");if(!1!==n.defaultStyle){const t="vega-embed-style",{root:e,rootContainer:r}=function(t){var e;const n=t.getRootNode?t.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(e=document.head)&&void 0!==e?e:document.body}}(m);if(!e.getElementById(t)){const e=document.createElement("style");e.id=t,e.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?LI.toString():n.defaultStyle,r.appendChild(e)}}const b=function(t,e){var n;if(t.$schema){const r=yI(t.$schema);e&&e!==r.library&&console.warn(`The given visualization spec is written in ${VI[r.library]}, but mode argument sets ${null!==(n=VI[e])&&void 0!==n?n:e}.`);const i=r.library;return Object(K.satisfies)(XI[i],"^"+r.version.slice(1))||console.warn(`The input spec uses ${VI[i]} ${r.version}, but the current version of ${VI[i]} is v${XI[i]}.`),i}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":null!=e?e:"vega"}(e,n.mode);let y=JI[b](e,c);if("vega-lite"===b&&y.$schema){const t=yI(y.$schema);Object(K.satisfies)(XI.vega,"^"+t.version.slice(1))||console.warn(`The compiled spec uses Vega ${t.version}, but current version is v${XI.vega}.`)}m.classList.add("vega-embed"),f&&m.classList.add("has-actions"),m.innerHTML="";let x=m;if(f){const t=document.createElement("div");t.classList.add("chart-wrapper"),m.appendChild(t),x=t}const _=n.patch;_&&(y=_ instanceof Function?_(y):N(y,_,!0,!1).newDocument),n.formatLocale&&qI.formatLocale(n.formatLocale),n.timeFormatLocale&&qI.timeFormatLocale(n.timeFormatLocale);const{ast:O}=n,w=qI.parse(y,"vega-lite"===b?{}:c,{ast:O}),j=new qI.View(w,Object.assign({loader:r,logLevel:p,renderer:h},O?{expr:qI.expressionInterpreter}:{}));if(!1!==n.tooltip){let t;t="function"==typeof n.tooltip?n.tooltip:new RI(!0===n.tooltip?{}:n.tooltip).call,j.tooltip(t)}let k,{hover:E}=n;if(void 0===E&&(E="vega"===b),E){const{hoverSet:t,updateSet:e}="boolean"==typeof E?{}:E;j.hover(t,e)}if(n&&(null!=n.width&&j.width(n.width),null!=n.height&&j.height(n.height),null!=n.padding&&j.padding(n.padding)),yield j.initialize(x).runAsync(),!1!==f){let t=m;if(!1!==n.defaultStyle){const e=document.createElement("details");e.title=d.CLICK_TO_VIEW_ACTIONS,m.append(e),t=e;const n=document.createElement("summary");n.innerHTML='\n\n \n \n \n',e.append(n),k=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",k)}const r=document.createElement("div");if(t.append(r),r.classList.add("vega-actions"),!0===f||!1!==f.export)for(const t of["svg","png"])if(!0===f||!0===f.export||f.export[t]){const e=d[t.toUpperCase()+"_ACTION"],i=document.createElement("a");i.text=e,i.href="#",i.target="_blank",i.download=`${g}.${t}`,i.addEventListener("mousedown",(function(e){return PI(this,void 0,void 0,(function*(){e.preventDefault();const r=yield j.toImageURL(t,n.scaleFactor);this.href=r}))})),r.append(i)}if(!0===f||!1!==f.source){const t=document.createElement("a");t.text=d.SOURCE_ACTION,t.href="#",t.addEventListener("click",(function(t){var r,i;KI(J()(e),null!==(r=n.sourceHeader)&&void 0!==r?r:"",null!==(i=n.sourceFooter)&&void 0!==i?i:"",b),t.preventDefault()})),r.append(t)}if("vega-lite"===b&&(!0===f||!1!==f.compiled)){const t=document.createElement("a");t.text=d.COMPILED_ACTION,t.href="#",t.addEventListener("click",(function(t){var e,r;KI(J()(y),null!==(e=n.sourceHeader)&&void 0!==e?e:"",null!==(r=n.sourceFooter)&&void 0!==r?r:"","vega"),t.preventDefault()})),r.append(t)}if(!0===f||!1!==f.editor){const t=null!==(l=n.editorUrl)&&void 0!==l?l:"https://vega.github.io/editor/",i=document.createElement("a");i.text=d.EDITOR_ACTION,i.href="#",i.addEventListener("click",(function(n){!function(t,e,n){const r=t.open(e),{origin:i}=new URL(e);let o=40;t.addEventListener("message",(function e(n){n.source===r&&(o=0,t.removeEventListener("message",e,!1))}),!1),setTimeout((function t(){o<=0||(r.postMessage(n,i),setTimeout(t,250),o-=1)}),250)}(window,t,{config:c,mode:b,renderer:h,spec:J()(e)}),n.preventDefault()})),r.append(i)}}return{view:j,spec:e,vgSpec:y,finalize:function(){k&&document.removeEventListener("click",k),j.finalize()}}}))}(t,u,f,a)}))},tU=n(2),eU=n(7),nU=n.n(eU);const rU={bin_type:{label:"Binning Type",section:" Values",type:"string",order:2,display:"select",values:[{"Max Bins":"bins"},{Steps:"steps"},{Breakpoints:"breakpoints"}],default:"bins"},bin_style:{label:"Chart Type",section:" Values",type:"string",order:1,display:"select",default:"simple_hist",values:[{"Simple Histogram":"simple_hist"},{"Scatter Histogram":"binned_hist"}]},winsorization:{label:"Limit Outliers (Winsorize)",section:" Values",type:"boolean",order:7,default:!1},color_col:{type:"string",section:" Style",label:"Color",display:"color",display_size:"half",default:"#1A73E8",order:3},color_on_hover:{type:"string",section:" Style",label:"Color On Hover",display:"color",display_size:"half",default:"#338bff",order:4},x_axis_label_divider:{label:"X Axis -------------------------------------------------------",section:"Labels",type:"string",display:"divider",order:6},x_axis_override:{label:"X Axis Title Override",section:"Labels",type:"string",display:"text",default:"",order:7},x_grids:{label:"X Axis Gridlines",section:" Style",type:"boolean",display:"select",display_size:"half",default:!0},x_axis_title_font_size:{label:"X Axis Title Size",section:"Labels",type:"number",display:"text",default:16,display_size:"half",order:9},x_axis_label_font_size:{label:"X Axis Label Size",section:"Labels",type:"number",display:"text",default:12,display_size:"half",order:10},x_axis_label_angle:{label:"X Axis Label Angle",section:"Labels",type:"number",display:"range",default:0,order:11,min:0,max:90,step:1,display_size:"half"},x_label_separation:{label:"X Axis Label Density",section:"Labels",type:"number",display:"range",default:100,order:12,min:1,max:100,step:1,display_size:"half"},y_axis_label_divider:{label:"Y Axis -------------------------------------------------------",section:"Labels",type:"string",display:"divider",order:13},y_axis_override:{label:"Y Axis Title Override",section:"Labels",type:"string",display:"text",default:"",order:14},y_grids:{label:"Y Axis Gridlines",section:" Style",type:"boolean",display:"select",display_size:"half",order:15,default:!0},y_axis_title_font_size:{label:"Y Axis Title Size",section:"Labels",type:"number",display:"text",default:16,display_size:"half",order:16},y_axis_label_font_size:{label:"Y Axis Label Size",section:"Labels",type:"number",display:"text",default:12,display_size:"half",order:17},y_axis_label_angle:{label:"Y Axis Label Angle",section:"Labels",type:"number",display:"range",default:0,order:18,min:0,max:90,step:1,display_size:"half"},y_label_separation:{label:"Y Axis Label Density",section:"Labels",type:"number",display:"range",default:100,order:19,min:1,max:100,step:1,display_size:"half"},x_axis_value_format:{label:"X Axis Value Format",order:200,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"}};function iU(t,e,n){return[{title:""!==e?e:t.title,bin:n,field:n.binned?"label":t.lookerName.replace(".","_"),type:n.binned?"ordinal":"quantitative"},{title:"Count of Records",aggregate:"count",type:"quantitative",...!n.binned&&{aggregate:"count"},...n.binned&&{field:"count_x"}}]}var oU=function({dataProperties:t,config:e,maxX:n,width:r}){return{selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"X_HISTOGRAM",mark:{type:"bar",cursor:"pointer"},height:60,width:r,encoding:{x:{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}},field:"breakpoints"===e.bin_type?"bin_start_x":e.x,type:"quantitative",axis:{grid:e.x_grids,title:null,labels:!1,ticks:!1}},..."breakpoints"===e.bin_type&&{x2:{field:"bin_end_x"}},y:{..."breakpoints"!==e.bin_type&&{aggregate:"count"},..."breakpoints"===e.bin_type&&{field:"count_x"},type:"quantitative",title:"",axis:{labelColor:"#696969",titleColor:"#696969",grid:e.y_grids}},tooltip:iU(t[e.x],e.x_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}),color:{condition:{selection:"highlight",value:e.color_on_hover},value:e.color_col}}}};var aU=({dataProperties:t,config:e,maxY:n,height:r})=>({selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"Y_HISTOGRAM",mark:{type:"bar",cursor:"pointer"},width:60,height:r,encoding:{y:{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(n/200)?Math.floor(n/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}},field:"breakpoints"===e.bin_type?"bin_start_y":e.y,type:"quantitative",axis:{grid:e.y_grids,title:null,labels:!1,ticks:!1}},..."breakpoints"===e.bin_type&&{y2:{field:"bin_end_y"}},x:{..."breakpoints"!==e.bin_type&&{aggregate:"count"},..."breakpoints"===e.bin_type&&{field:"count_y"},type:"quantitative",title:"",axis:{labelColor:"#696969",titleColor:"#696969",grid:e.x_grids,title:null}},tooltip:iU(t[e.y],e.y_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(n/200)?Math.floor(n/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}),color:{condition:{selection:"highlight",value:e.color_on_hover},value:e.color_col}}}),sU=n(6);var uU=function({dataProperties:t,config:e,maxX:n,maxY:r,height:i,width:o,valFormatX:a,valFormatY:s}){return{selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"HEATMAP",mark:{zindex:-1,type:"rect",invalid:null,...e.heatmap_off&&{cursor:"pointer"},...!e.heatmap_off&&{fillOpacity:0}},height:i,width:o,encoding:{x:{...e.heatmap_off&&{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}},field:"breakpoints"===e.bin_type?"bin_start_x":e.x,type:"quantitative",axis:{name:"xAxis",title:""===e.x_axis_override?t[e.x].title:e.x_axis_override,titleFontSize:e.x_axis_title_font_size,format:"d",labelFontSize:e.x_axis_label_font_size,grid:e.x_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-e.x_label_separation,labelOverlap:!0,labelColor:"#696969",labelAngle:-1*e.x_axis_label_angle,titleColor:"#696969",titlePadding:25+a.length}},..."breakpoints"===e.bin_type&&{x2:{field:"bin_end_x"}},y:{...e.heatmap_off&&{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(r/200)?Math.floor(r/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}},field:"breakpoints"===e.bin_type?"bin_start_y":e.y,type:"quantitative",axis:{title:""===e.y_axis_override?t[e.y].title:e.y_axis_override,titleFontSize:e.y_axis_title_font_size,format:"d",labelFontSize:e.y_axis_label_font_size,labelAngle:-1*e.y_axis_label_angle,grid:e.y_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-e.y_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25+3*s.length}},..."breakpoints"===e.bin_type&&{y2:{field:"bin_end_y"}},color:{aggregate:"count",type:"quantitative",legend:!!e.heatmap_off&&{orient:e.legend_orient,labelFontSize:e.legend_size,titleFontSize:e.legend_size,titleFontWeight:"normal",offset:e.y_hist?85:10,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}},opacity:{condition:{selection:"highlight",value:1},value:e.heatmap_opacity},...e.heatmap_off&&{tooltip:(()=>{let i=iU(t[e.x],e.x_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}).concat(iU(t[e.y],e.y_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(r/200)?Math.floor(r/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}));return i=i.concat(i.splice(1,1)),i})()}}}};var lU=function({config:t,dataProperties:e,mainDimensions:n}){return{mark:{type:"text",align:"left",angle:t.point_labels_angle,dx:t.point_labels_x_offset,dy:t.point_labels_y_offset,fontSize:t.point_labels_font_size},encoding:{x:{field:t.x,type:"quantitative"},y:{field:t.y,type:"quantitative"},text:{field:e._filterlabels?"_filterlabels":n[0]}}}};function cU({config:t,tooltipFields:e,dataProperties:n,width:r,height:i,mainDimensions:o}){const a=function({config:t,tooltipFields:e,width:n,height:r}){return{name:"SCATTERPLOT",mark:{color:t.color_col,cursor:"pointer",type:"circle",opacity:t.point_opacity,zindex:2,size:100},height:r,width:n,encoding:{tooltip:e,x:{field:t.x,type:"quantitative"},y:{field:t.y,type:"quantitative"}}}}({config:t,dataProperties:n,tooltipFields:e,width:r,height:i});return t.layer_points&&""!==t.size&&void 0!==t.size&&function(t,e,n){t.encoding.size={field:e.size,type:"quantitative",title:n[e.size].title,legend:{orient:e.legend_orient,format:"d",labelFontSize:e.legend_size,titleFontWeight:"normal",offset:e.y_hist?85:10,titleFontSize:e.legend_size,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}}}(a,t,n),t.layer_points&&void 0!==o[1]&&function(t,e,n,r){t.encoding.color={scale:{scheme:e.point_group_colors},field:r[1],legend:{type:"symbol",offset:e.y_hist?85:10,title:n[r[1]].title,type:"symbol",orient:e.legend_orient,labelFontSize:e.legend_size,titleFontWeight:"normal",titleFontSize:e.legend_size,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}}}(a,t,n,o),a}var fU=n(9);var dU=function({axis:t,config:e,data:n,min:r,max:i}){const o=Object(fU.a)(e[`reference_line_${t}_p`],e[t],n);return{name:"refLine"+t,mark:{type:"rule"},encoding:{x:{datum:"x"===t?o:r},y:{datum:"x"===t?r:o},x2:{datum:"x"===t?o:i},y2:{datum:"x"===t?i:o},color:{value:"red"},size:{value:e[`reference_line_${t}_width`]},strokeDash:{value:[4,4]}}}};var hU=function({layers:t,data:e,config:n,tooltipFields:r,dataProperties:i,width:o,height:a,mainDimensions:s,minX:u,minY:l,maxX:c,maxY:f}){n.layer_points&&t.push(cU({config:n,tooltipFields:r,dataProperties:i,width:o,height:a,mainDimensions:s})),n.layer_points&&n.point_labels&&t.push(lU({config:n,dataProperties:i,mainDimensions:s})),n.reference_line_x&&t.push(dU({axis:"x",min:l,max:f,config:n,data:e})),n.reference_line_y&&t.push(dU({axis:"y",min:u,max:c,config:n,data:e}))};var pU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={vconcat:[oU({dataProperties:e,config:n,maxX:r,width:u}),{spacing:15,bounds:"flush",hconcat:[{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]},aU({dataProperties:e,config:n,maxY:o,height:s})]}],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.vconcat[1].hconcat[0].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var gU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})],config:{range:{heatmap:{scheme:n.color_scheme}}}};return hU({layers:h.layer,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var mU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={vconcat:[oU({dataProperties:e,config:n,maxX:r,width:u}),{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]}],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.vconcat[1].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var bU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={hconcat:[{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]},aU({dataProperties:e,config:n,maxY:o,height:s})],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.hconcat[0].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var yU=function(t){return t.config.x_hist&&t.config.y_hist?pU(t):t.config.x_hist?mU(t):t.config.y_hist?bU(t):gU(t)};function vU(t,e,n,r,i,o,a,s){a.clearErrors();let{dataProperties:u,myData:l}=Object(fU.d)(t,r);const c=e.clientWidth,f=e.clientHeight,d=Math.max(...l.map(t=>t[n.x])),h=Math.min(...l.map(t=>t[n.x])),p=Math.max(...l.map(t=>t[n.y])),g=Math.min(...l.map(t=>t[n.y])),m=r.fields.dimension_like.map(t=>t.name.replace(".","_")),b=function(t,e,n,r,i,o){var a={};a.options=Object.assign({},e),a.measures=[],a.dimensions=[],a.masterList=[],a.options.bin_type.values.length>2&&a.options.bin_type.values.pop();var s,u,l,c,f=1,d=1;t.fields.dimension_like.forEach((function(t){if("_filterlabels"!==t.name&&(t.is_numeric||"tier"===t.type)){var e={},n=t.name.replace(".","_");void 0!==t.label_short?e[t.label_short]=n:e[t.label]=n,1==f?s=n:2==f&&(u=n),a.masterList.push(e),a.dimensions.push(e),f+=1}})),t.fields.measure_like.forEach((function(t){if("_filterlabels"!==t.name){var e={},n=t.name.replace(".","_");void 0!==t.label_short?(e[t.label_short]=n,a.measures.push(e)):(e[t.label]=n,"yesno"==t.type?a.dimensions.push(e):a.measures.push(e)),1==d?l=n:2==d&&(c=n),a.masterList.push(e),d+=1}})),void 0===l&&(l=s),void 0===c&&(c=u),"steps"===n.bin_type?(a.options.num_step_x={label:"Step Size (X)",section:" Values",type:"number",order:5,display:"text",default:Math.floor(r/10),display_size:"half"},a.options.num_step_y={label:"Step Size (Y)",section:" Values",type:"number",order:6,display:"text",default:Math.floor(i/10),display_size:"half"}):"bins"===n.bin_type?a.options.max_bins={label:"Max number of Bins",section:" Values",type:"string",order:4,default:"10"}:"breakpoints"===n.bin_type&&(a.options.breakpointsX={label:"Breakpoints (X)",section:" Values",type:"string",placeholder:"Comma seperated breakpoints (100, 200, 300)",order:4},a.options.breakpointsY={label:"Breakpoints (Y)",section:" Values",type:"string",placeholder:"Comma seperated breakpoints (100, 200, 300)",order:5}),n.winsorization&&(a.options.percentile={label:"Percentiles",section:" Values",type:"string",order:7,display:"select",display_size:"half",default:"1_99",values:[{"1% - 99%":"1_99"},{"5% - 95%":"5_95"}]}),a.options.x={label:"X Axis",section:" Values",type:"string",display:"select",order:1,values:a.measures,default:l},a.options.y={label:"Y Axis",section:" Values",type:"string",display:"select",order:1,values:a.measures,default:c},a.options.heatmap_off={label:"Heatmap",section:" Values",type:"boolean",order:10,display:"select",display_size:"half",default:!0},a.options.x_hist={label:"X Histogram",section:" Values",type:"boolean",display_size:"half",order:11,default:!0},a.options.y_hist={label:"Y Histogram",section:" Values",type:"boolean",display_size:"half",order:11,default:!0},a.options.layer_points={label:"Points",section:" Values",type:"boolean",display_size:"half",order:11,display:"select",default:!0};var h=a.measures.length>2?a.measures[2]:"",p=a.measures.concat([{None:""}]);return a.options.size={label:"Size Points By",section:" Values",type:"string",order:12,display:"select",values:p,default:h[Object.keys(h)[0]]},a.options.color_scheme={label:"Heatmap Color Scheme",section:" Style",type:"array",display:"colors",order:1,default:["#7FCDAE","#7ED09C","#7DD389","#85D67C","#9AD97B","#B1DB7A","#CADF79","#E2DF78","#E5C877","#E7AF75","#EB9474","#EE7772"]},o&&(a.options.point_group_colors={label:"Point Groups Colors",section:" Style",type:"array",display:"colors",order:2,default:["#7FCDAE","#7ED09C","#7DD389","#85D67C","#9AD97B","#B1DB7A","#CADF79","#E2DF78","#E5C877","#E7AF75","#EB9474","#EE7772"]}),a.options.heatmap_opacity={label:"Heatmap Opacity",section:" Style",type:"number",display:"range",min:0,max:1,step:.05,default:.8,order:1},a.options.point_opacity={label:"Point Opacity",section:" Style",type:"number",display:"range",min:0,max:1,step:.05,default:.8,order:6},a.options.legend_orient={label:"Legend Position",section:"Labels",type:"string",display:"select",order:6,values:[{Left:"left"},{Right:"right"},{Top:"top"},{Bottom:"bottom"}],display_size:"half",default:"right"},a.options.legend_size={label:"Legend Font Size",section:"Labels",type:"number",display:"text",default:16,display_size:"half",order:5},a.options.y_axis_value_format={label:"Y Axis Value Format",order:201,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"},a.options.points_legend_value_format={label:"Point Value Format",order:202,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"},a.options.point_labels_divider={label:"Point Labels ---------------------------------------------",section:"Labels",type:"string",display:"divider",order:1e3,default:!1},a.options.point_labels={label:"Scatterplot Point Labels",section:"Labels",type:"boolean",order:1001,default:!1},a.options.point_labels_x_offset={label:"Point Label X Offset",section:"Labels",type:"number",display:"range",display_size:"half",default:0,order:1002,min:-50,max:50,step:1},a.options.point_labels_y_offset={label:"Point Label Y Offset",section:"Labels",type:"number",display:"range",display_size:"half",order:1003,default:0,min:-50,max:50,step:1},a.options.point_labels_angle={label:"Point Label Angle",section:"Labels",type:"number",display:"range",display_size:"half",order:1004,default:0,min:-90,max:90,step:1},a.options.point_labels_font_size={label:"Point Label Font Size",section:"Labels",type:"number",display:"text",display_size:"half",default:"12",order:1005},a.options.reference_line_divider={label:"Reference Lines ----------------------------------------",order:1006,section:"Labels",type:"string",display:"divder"},a.options.reference_line_x={label:"X Axis",order:1007,section:"Labels",type:"boolean",display_size:"half"},a.options.reference_line_y={label:"Y Axis",order:1008,section:"Labels",type:"boolean",display_size:"half"},a.options.reference_line_x_p={label:"X Axis Percentile",placeholder:"Value from 0 to 100",order:1009,section:"Labels",type:"number",display_size:"half",default:50},a.options.reference_line_y_p={label:"Y Axis Percentile",placeholder:"Value from 0 to 100",order:1010,section:"Labels",type:"number",display_size:"half",default:50},a.options.reference_line_x_width={label:"X Axis Stroke",order:1011,section:"Labels",type:"number",display_size:"half",default:3},a.options.reference_line_y_width={label:"Y Axis Stroke",order:1012,section:"Labels",type:"number",display_size:"half",default:3},a}(r,rU,n,d,p,void 0!==m[1]).options;if(a.trigger("registerOptions",b),"breakpoints"===n.bin_type&&a.addError({title:"Breakpoints Currently not supported for Scatter Histogram"}),null==u[n.x]||null==u[n.y])return;const y=u[n.x].valueFormat,v=u[n.y].valueFormat,x=n.x_axis_value_format,_=n.y_axis_value_format;let O=""!==x?x:y;null==O&&(O="#,##0");let w,j=""!==_?_:v;if(null==j&&(j="#,##0"),n.size){const t=u[n.size].valueFormat,e=n.points_legend_value_format;w=""!==e?e:t,null==w&&(w="#,##0")}n.winsorization&&(l=Object(fU.e)(l,n.x,n.percentile),l=Object(fU.e)(l,n.y,n.percentile));const k=function(t,e,n){let r=[];for(let e in t)if("_filterlabels"!==e&&("nominal"===t[e].dtype||e===n.x||e===n.y||e===n.size)){let i={};i.field=e,i.type=t[e].dtype,i.title=(e=>{switch(e){case n.x:return""!==n.x_axis_override?n.x_axis_override:t[e].title;case n.y:return""!==n.y_axis_override?n.y_axis_override:t[e].title;default:return t[e].title}})(e),r.push(i)}let i=[n.x,n.y];n.size&&i.push(n.size),r.sort((t,e)=>i.indexOf(t.field)-i.indexOf(e.field));for(let t=0;t{Object(sU.d)(i,n,m,O,j,w)};s("#my-vega",E,{actions:!1,renderer:"svg",tooltip:{theme:"custom"}}).then(({spec:t,view:e})=>{Object(sU.b)(),A(),i.print?o():(e.addEventListener("wheel",A,{passive:!0}),e.addEventListener("mousedown",A,{passive:!0}),e.addEventListener("mouseup",A,{passive:!0}),e.addEventListener("drag",A,{passive:!0}),e.addEventListener("mousemove",(t,e)=>{!function(t,e,n,r,i,o){if(void 0===e||void 0===n||0===n.fillOpacity||"breakpoints"===e.bin_type)return;const a=t=>t.replace(/\u2013|\u2014|\u2212/g,"-"),s=r=>{let i=""!==e[r+"_axis_override"]?e[r+"_axis_override"]:t[e[r].replace(".","_")].title;return n.tooltip[i].split(" ")},u=r=>{let i="size"!==r&&""!==e[r+"_axis_override"]?e[r+"_axis_override"]:t[e[r].replace(".","_")].title;return Number(a(n.tooltip[i]))},l=(t,e)=>{let n="x"===t?r:i;return[nU.a.format(n,Number(a(e[0]))),nU.a.format(n,Number(a(e[2])))]};if("X_HISTOGRAM_marks"===n.mark.name){let[t,e]=l("x",s("x"));tU.a("td.value").text(t+" - "+e)}if("Y_HISTOGRAM_marks"===n.mark.name){let[t,e]=l("y",s("y"));tU.a("td.value").text(t+" - "+e)}if("HEATMAP_marks"===n.mark.name){let[t,n]=l("x",s("x")),[r,i]=l("y",s("y"));tU.b("td.value").each((function(o,a){0===a?tU.a(this).text(t+" - "+n):1===a&&e.x!==e.y&&tU.a(this).text(r+" - "+i)}))}if("SCATTERPLOT_marks"===n.mark.name){let t=0;tU.b("td.value").each((function(n,a){0===a?tU.a(this).text(nU.a.format(r,u("x"))):1===a?e.x!==e.y?tU.a(this).text(nU.a.format(i,u("y"))):e.size&&(tU.a(this).text(nU.a.format(o,u("size"))),t=1):2===a&&!t&&e.size&&e.x!==e.size&&e.y!==e.size&&tU.a(this).text(nU.a.format(o,u("size")))}))}}(u,n,e,O,j,w)}),void 0!==m[1]&&n.size&&(n.x_hist||n.y_hist)&&Object(sU.c)(n.legend_orient),e.addEventListener("click",(function(t,e){if(!(void 0===e||void 0===e.datum||Object.keys(e.datum).length<=1||0===e.fillOpacity))if(i.crossfilterEnabled&&"rect"!==e.mark.marktype){let n={[u[m[0]].lookerName]:{value:e.datum[m[0]]}};LookerCharts.Utils.toggleCrossfilter({row:n,event:t})}else{var o=e.datum.links;if(Object.keys(e.datum)[0].startsWith("bin_")){let t=[];for(let e of r.fields.dimension_like.concat(r.fields.measure_like))t.push(e.name);const i=u[n.x].lookerName,a=u[n.y].lookerName,s=Object.keys(e.datum).filter(t=>t.includes(n.x)),c=Object.keys(e.datum).filter(t=>t.includes(n.y));let f=l[0].links;if(f.length<1)o=[];else{f=f.filter(t=>t.url.includes("/explore/"))[0].url.split("?")[0];let n=`${f}?fields=${t.join(",")}`;if(s.length>0&&(n+=`&f[${i}]=[${e.datum[s[0]]}, ${e.datum[s[1]]})`),c.length>0&&(n+=`&f[${a}]=[${e.datum[c[0]]}, ${e.datum[c[1]]})`),void 0!==r.applied_filters){let t=r.applied_filters;for(let e in t)n+=`&f[${t[e].field.name}]=${t[e].value}`}o=[{label:`Show ${e.datum.__count} Records`,type:"drill",type_label:"Drill into Records",url:n}]}}LookerCharts.Utils.openDrillMenu({links:o,event:t})}})))})}function xU(t,e,n,r,i,o,a,s){a.clearErrors();let{dataProperties:u,myData:l}=Object(fU.d)(t,r);const c=r.fields.measure_like[0].name.replace(".","_"),f=r.fields.dimensions[0].name.replace(".","_"),d=Math.max(...l.map(t=>t[c])),h=Object.assign({},rU);h.bin_type.values.length<3&&(h.bin_type.values[h.bin_type.values.length]={Breakpoints:{description:"An array of allowable step sizes to choose from.",value:"breakpoints"}}),"bins"===n.bin_type?h.max_bins={label:"Max number of Bins",section:" Values",type:"string",order:4,display:"text",default:"10"}:"steps"===n.bin_type?h.step_size={label:"Step Size",section:" Values",type:"number",order:4,display:"text",default:Math.floor(d/10)}:(h.breakpoint_array={label:"Breakpoints",section:" Values",order:4,type:"string",default:`min, ${Math.floor(d/5)}, ${Math.floor(d/4)}, ${Math.floor(d/3)}, ${Math.floor(d/2)}, max`},h.breakpoint_ordinal={label:"Use Equal Sized Columns (Ordinal Bins)",order:4,section:" Values",type:"boolean",display:"select",default:!1}),n.winsorization&&(h.percentile={label:"Percentiles",section:" Values",type:"string",order:7,display:"select",display_size:"half",default:"1_99",values:[{"1% - 99%":"1_99"},{"5% - 95%":"5_95"}]}),a.trigger("registerOptions",h),n.winsorization&&(l=Object(fU.e)(l,c,n.percentile));const p=u[c].valueFormat,g=n.x_axis_value_format;let m=""!==g?g:p;null==m&&(m="#,##0");let b=[];"breakpoints"===n.bin_type&&(b=Object(fU.c)(l,c,n.breakpoint_array,m,"x"));var y,v,x;s("#my-vega",{$schema:"https://vega.github.io/schema/vega-lite/v4.json",config:{view:{stroke:"transparent"}},data:{values:"breakpoints"===n.bin_type?b:l},width:.9*e.clientWidth,height:.8*e.clientHeight,padding:20,selection:{highlight:{type:"single",empty:"none",on:"mouseover"}},mark:{type:"bar",cursor:"pointer"},encoding:{x:{type:n.breakpoint_ordinal?"ordinal":"quantitative",...n.breakpoint_ordinal&&{sort:["order"]},...!n.breakpoint_ordinal&&{bin:{..."bins"===n.bin_type&&{maxbins:n.max_bins},..."steps"===n.bin_type&&{step:n.step_size<=Math.floor(d/200)?Math.floor(d/200):n.step_size},..."breakpoints"===n.bin_type&&{binned:!0}}},field:"breakpoints"===n.bin_type?n.breakpoint_ordinal?"label":"bin_start_x":c,axis:{title:""===n.x_axis_override?u[c].title:n.x_axis_override,titleFontSize:n.x_axis_title_font_size,labelFontSize:n.x_axis_label_font_size,labelAngle:-1*n.x_axis_label_angle,format:"d",grid:n.x_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-n.x_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25}},..."breakpoints"===n.bin_type&&!1===n.breakpoint_ordinal&&{x2:{field:"bin_end_x"}},y:{type:"quantitative",..."breakpoints"!==n.bin_type&&{aggregate:"count"},..."breakpoints"===n.bin_type&&{field:"count_x"},axis:{title:""===n.y_axis_override?"Count of "+u[f].title:n.y_axis_override,titleFontSize:n.y_axis_title_font_size,labelFontSize:n.y_axis_label_font_size,labelAngle:-1*n.y_axis_label_angle,grid:n.y_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-n.y_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25}},color:{condition:{selection:"highlight",value:n.color_on_hover},value:n.color_col},tooltip:(y=u[c],v=n.x_axis_override,x={..."bins"===n.bin_type&&{maxbins:n.max_bins},..."steps"===n.bin_type&&{step:n.step_size},..."breakpoints"===n.bin_type&&{binned:!0}},[{title:""!==v?v:y.title,bin:x,field:x.binned?"label":y.lookerName.replace(".","_"),type:x.binned?"ordinal":"quantitative"},{title:"Count of Records",type:"quantitative",...!x.binned&&{aggregate:"count"},...x.binned&&{field:"count_x"}}])}},{actions:!1,renderer:"svg",tooltip:{theme:"custom"}}).then(({spec:t,view:e})=>{Object(sU.b)(),Object(sU.e)(n,"simple",m),i.print?o():(e.addEventListener("mousemove",(t,e)=>{!function(t,e,n,r,i){if(void 0===e||void 0===r||"transparent"===r.stroke||"breakpoints"===e.bin_type)return;const o=t=>t.replace(/\u2013|\u2014|\u2212/g,"-");let[a,s]=(u=(r=>{let i=""!==e.x_axis_override?e.x_axis_override:t[n].title;return r.tooltip[i].split(" ")})(r),[nU.a.format(i,Number(o(u[0]))),nU.a.format(i,Number(o(u[2])))]);var u;tU.a("td.value").text(a+" - "+s)}(u,n,c,e,m)}),e.addEventListener("click",(function(t,e){if(void 0===e.datum)return;const i=u[c].lookerName,o="breakpoints"===n.bin_type?["bin_start_x","bin_end_x"]:Object.keys(e.datum).filter(t=>t.includes(c));let a=e.datum.links,s=l[0].links,f=[];for(let t of r.fields.dimension_like.concat(r.fields.measure_like))f.push(t.name);if(s.length<1)a=[];else{s=s.filter(t=>t.url.includes("/explore/"))[0].url.split("?")[0];let t=`${s}?fields=${f.join(",")}`;if(t+=`&f[${i}]=[${e.datum[o[0]]}, ${e.datum[o[1]]})`,void 0!==r.applied_filters){let e=r.applied_filters;for(let n in e)t+=`&f[${e[n].field.name}]=${e[n].value}`}a=[{label:`Show ${"breakpoints"===n.bin_type?e.datum.count_x:e.datum.__count} Records`,type:"drill",type_label:"Drill into Records",url:t}]}LookerCharts.Utils.openDrillMenu({links:a,event:t})})))})}n(96);looker.plugins.visualizations.add({options:rU,create:function(t,e){t.appendChild(document.createElement("div")).setAttribute("id","my-vega")},updateAsync:function(t,e,n,r,i,o){if(0===t.length)return this.addError({title:"No Results"}),void o();if("binned_hist"===n.bin_style){if(!Object(fU.b)(this,r,{min_pivots:0,max_pivots:0,min_dimensions:1,max_dimensions:void 0,min_measures:2,max_measures:void 0}))return;vU(t,e,n,r,i,o,this,QI)}else{if(!Object(fU.b)(this,r,{min_pivots:0,max_pivots:0,min_dimensions:1,max_dimensions:void 0,min_measures:1,max_measures:void 0}))return;xU(t,e,n,r,i,o,this,QI)}o()}})},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*i.d-t.getMinutes()*i.c)}),(function(t,e){t.setTime(+t+e*i.b)}),(function(t,e){return(e-t)/i.b}),(function(t){return t.getHours()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*i.d)}),(function(t,e){t.setTime(+t+e*i.c)}),(function(t,e){return(e-t)/i.c}),(function(t){return t.getMinutes()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*i.b)}),(function(t,e){return(e-t)/i.b}),(function(t){return t.getUTCHours()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*i.c)}),(function(t,e){return(e-t)/i.c}),(function(t){return t.getUTCMinutes()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(15);e.a=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Object(r.a)(e)/3)))-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r=n(15);e.a=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Object(r.a)(e)-Object(r.a)(t))+1}},function(t,e,n){"use strict";var r=n(15);e.a=function(t){return Math.max(0,-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r={},i={};function o(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function a(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function s(t,e){var n=t+"",r=n.length;return r9999?"+"+s(e,6):s(e,4))+"-"+s(t.getUTCMonth()+1,2)+"-"+s(t.getUTCDate(),2)+(o?"T"+s(n,2)+":"+s(r,2)+":"+s(i,2)+"."+s(o,3)+"Z":i?"T"+s(n,2)+":"+s(r,2)+":"+s(i,2)+"Z":r||n?"T"+s(n,2)+":"+s(r,2)+"Z":"")}e.a=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function s(t,e){var o,a=[],s=t.length,u=0,l=0,c=s<=0,f=!1;function d(){if(c)return i;if(f)return f=!1,r;var e,o,a=u;if(34===t.charCodeAt(a)){for(;u++=s?c=!0:10===(o=t.charCodeAt(u++))?f=!0:13===o&&(f=!0,10===t.charCodeAt(u)&&++u),t.slice(a+1,e-1).replace(/""/g,'"')}for(;u