diff --git a/css/widget.css b/css/widget.css index ae9ea0e..7a27de8 100644 --- a/css/widget.css +++ b/css/widget.css @@ -156,7 +156,15 @@ input[type=text], select { #intentBtn{ position: absolute; top: 5px; - right: 59px; + right: 57px; + font-size: 20px; + padding: 5px; +} + +#fullScreenBtn{ + position: absolute; + top: 7px; + right: 84px; font-size: 20px; padding: 5px; } @@ -563,3 +571,24 @@ button.card:focus { all: revert; height: 212px; } + +.modal-content-custom { + width: 70%!important; + max-width: none!important; +} + +.display-linebreak { + white-space: pre-line; +} + +.button-container-1 { + padding: 5px; + position: relative; + left: 12%; +} + +.button-container-2 { + padding: 5px; + position: relative; + left: 12%; +} diff --git a/luxwidget/nbextension/static/extension.js b/luxwidget/nbextension/static/extension.js index 40d0f61..3a8039c 100644 --- a/luxwidget/nbextension/static/extension.js +++ b/luxwidget/nbextension/static/extension.js @@ -1,17 +1,26 @@ // Entry point for the notebook bundle containing custom model definitions. -// -define(function() { - "use strict"; - window['requirejs'].config({ - map: { - '*': { - 'luxwidget': 'nbextensions/luxwidget/index', - }, - } - }); - // Export the required load_ipython_extension function +define([ + 'base/js/namespace' +], function( + Jupyter +) { + function load_ipython_extension() { + "use strict"; + + // TODO: Looking to disable shortcuts here but not working yet + // Jupyter.keyboard_manager.disable(); + + window['requirejs'].config({ + map: { + '*': { + 'luxwidget': 'nbextensions/luxwidget/index', + }, + } + }); + } + return { - load_ipython_extension : function() {} + load_ipython_extension: load_ipython_extension }; -}); \ No newline at end of file +}); diff --git a/luxwidget/nbextension/static/index.js b/luxwidget/nbextension/static/index.js index fe63976..a2b01ef 100644 --- a/luxwidget/nbextension/static/index.js +++ b/luxwidget/nbextension/static/index.js @@ -1,16 +1,16 @@ -define(["@jupyter-widgets/base"],(function(e){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=78)}([function(e,t,n){"use strict";e.exports=n(87)},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){var r; +define(["@jupyter-widgets/base"],(function(e){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=83)}([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 E})),n.d(t,"b",(function(){return x})),n.d(t,"c",(function(){return O})),n.d(t,"d",(function(){return y})),n.d(t,"e",(function(){return w})),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 X})),n.d(t,"j",(function(){return ee})),n.d(t,"k",(function(){return J})),n.d(t,"l",(function(){return Z})),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 v})),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 me})),n.d(t,"B",(function(){return _})),n.d(t,"C",(function(){return ge})),n.d(t,"D",(function(){return ve})),n.d(t,"E",(function(){return Q})),n.d(t,"F",(function(){return be})),n.d(t,"G",(function(){return ye})),n.d(t,"H",(function(){return k})),n.d(t,"I",(function(){return xe})),n.d(t,"J",(function(){return we})),n.d(t,"K",(function(){return Oe})),n.d(t,"L",(function(){return Ee})),n.d(t,"M",(function(){return C})),n.d(t,"N",(function(){return Ce})),n.d(t,"O",(function(){return _e})),n.d(t,"P",(function(){return S})),n.d(t,"Q",(function(){return m})),n.d(t,"R",(function(){return Ae})),n.d(t,"S",(function(){return z})),n.d(t,"T",(function(){return I})),n.d(t,"U",(function(){return U})),n.d(t,"V",(function(){return $})),n.d(t,"W",(function(){return F})),n.d(t,"X",(function(){return Y})),n.d(t,"Y",(function(){return ke})),n.d(t,"Z",(function(){return Se})),n.d(t,"ab",(function(){return c})),n.d(t,"bb",(function(){return je})),n.d(t,"cb",(function(){return De})),n.d(t,"db",(function(){return Te})),n.d(t,"eb",(function(){return T})),n.d(t,"fb",(function(){return Ne})),n.d(t,"gb",(function(){return Me})),n.d(t,"hb",(function(){return Pe})),n.d(t,"ib",(function(){return g})),n.d(t,"jb",(function(){return K})),n.d(t,"kb",(function(){return Be})),n.d(t,"lb",(function(){return j})),n.d(t,"mb",(function(){return p})),n.d(t,"nb",(function(){return H})),n.d(t,"ob",(function(){return q})),n.d(t,"pb",(function(){return V})),n.d(t,"qb",(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"),m=r(()=>1,[],"one"),g=r(()=>!0,[],"true"),v=r(()=>!1,[],"false");function b(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}const y=0,x=1,w=2,O=3,E=4;function C(e,t){let n=e||y;return{level(e){return arguments.length?(n=+e,this):n},error(){return n>=x&&b(t||"error","ERROR",arguments),this},warn(){return n>=w&&b(t||"warn","WARN",arguments),this},info(){return n>=O&&b(t||"log","INFO",arguments),this},debug(){return n>=E&&b(t||"log","DEBUG",arguments),this}}}var _=Array.isArray;function k(e){return e===Object(e)}const A=e=>"__proto__"!==e;function S(...e){return e.reduce((e,t)=>{for(const n in t)if("signals"===n)e.signals=D(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;j(e,n,t[n],r)}return e},{})}function j(e,t,n,r){if(!A(t))return;let i,o;if(k(n)&&!_(n))for(i in o=k(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?j(o,i,n[i]):A(i)&&(o[i]=n[i]);else e[t]=n}function D(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 F(e){return e[e.length-1]}function T(e){return null==e||""===e?null:+e}const M=e=>t=>e*Math.exp(t),N=e=>t=>Math.log(e*t),P=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),B=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,L=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function R(e,t,n,r){const i=n(e[0]),o=n(F(e)),a=(o-i)*t;return[r(i-a),r(o-a)]}function z(e,t){return R(e,t,T,h)}function I(e,t){var n=Math.sign(e[0]);return R(e,t,N(n),M(n))}function U(e,t,n){return R(e,t,L(n),L(1/n))}function $(e,t,n){return R(e,t,P(n),B(n))}function W(e,t,n,r,i){const o=r(e[0]),a=r(F(e)),s=null!=t?r(t):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function H(e,t,n){return W(e,t,n,T,h)}function q(e,t,n){const r=Math.sign(e[0]);return W(e,t,n,N(r),M(r))}function V(e,t,n,r){return W(e,t,n,L(r),L(1/r))}function G(e,t,n,r){return W(e,t,n,P(r),B(r))}function Y(e){return 1+~~(new Date(e).getMonth()/3)}function K(e){return 1+~~(new Date(e).getUTCMonth()/3)}function X(e){return null!=e?_(e)?e:[e]:[]}function J(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 Q(e){return"function"==typeof e}function Z(e,t,n){n=n||{},t=X(t)||[];const i=[],a=[],s={},u=n.comparator||te;return X(e).forEach((e,r)=>{null!=e&&(i.push("descending"===t[r]?-1:1),a.push(e=Q(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=F(e);la&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=e:oe.replace(/\\(.)/g,"$1")):X(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 _e(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 Ae(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 Se(e){return e&&F(e)-e[0]||0}function je(e){return _(e)?"["+e.map(je)+"]":k(e)||we(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function De(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e}const Fe=e=>ye(e)||ve(e)?e:Date.parse(e);function Te(e,t){return t=t||Fe,null==e||""===e?null:t(e)}function Me(e){return null==e||""===e?null:e+""}function Ne(e){const t={},n=e.length;for(let r=0;r=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){var r; /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},function(e,t,n){"use strict";function r(e,t,n){return e.fields=t||[],e.fname=n,e}function i(e){return 1===e.length?o(e[0]):a(e)}n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return v})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return f})),n.d(t,"g",(function(){return p})),n.d(t,"h",(function(){return y})),n.d(t,"i",(function(){return d})),n.d(t,"j",(function(){return b})),n.d(t,"k",(function(){return x})),n.d(t,"l",(function(){return E})),n.d(t,"m",(function(){return h})),n.d(t,"n",(function(){return _}));const o=e=>function(t){return t[e]},a=e=>{const t=e.length;return function(n){for(let r=0;rr&&c(),s=r=i+1):"]"===o&&(s||u("Access path missing open bracket: "+e),s>0&&c(),s=0,r=i+1):i>r?c():r=i+1}return s&&u("Access path missing closing bracket: "+e),a&&u("Access path missing closing quote: "+e),i>r&&(i++,c()),t}function l(e,t,n){const o=s(e);return e=1===o.length?o[0]:e,r((n&&n.get||i)(o),[e],t||e)}l("id");const c=r(e=>e,[],"identity");r(()=>0,[],"zero"),r(()=>1,[],"one"),r(()=>!0,[],"true"),r(()=>!1,[],"false");var f=Array.isArray;function d(e){return e===Object(e)}function h(e){return null==e||""===e?null:+e}function p(e){return"function"==typeof e}function m(e){for(let t,n,r=1,i=arguments.length;rfunction(e){return"number"==typeof e}(e)||function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e:Date.parse(e);function E(e,t){return t=t||w,null==e||""===e?null:t(e)}function _(e){return null==e||""===e?null:e+""}},function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(88)},,,function(e,t,n){"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<+~=|^:(),"'`\s])/g,v="undefined"!=typeof CSS&&CSS.escape,y=function(e){return v?v(e):e.replace(g,"\\$1")},b=function(){function e(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var o=null==i||!1===i,a=e in this.style;if(o&&!a&&!r)return this;var u=o&&a;if(u?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var s=this.options.sheet;return s&&s.attached,this},e}(),x=function(e){function t(t,n,r){var i;(i=e.call(this,t,n,r)||this).selectorText=void 0,i.id=void 0,i.renderable=void 0;var o=r.selector,a=r.scoped,s=r.sheet,l=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=l(Object(u.a)(Object(u.a)(i)),s),i.selectorText="."+y(i.id)),i}Object(a.a)(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!=typeof n?e[t]=n:Array.isArray(n)&&(e[t]=h(n))}return e},n.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(r.a)({},e,{allowEmpty:!0}):e;return m(this.selectorText,this.style,n)},Object(o.a)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function(){return this.selectorText}}]),t}(b),w={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new x(e,t,n)}},E={indent:1,children:!0},_=/@([\w-]+)/,A=function(){function e(e,t,n){this.type="conditional",this.at=void 0,this.key=void 0,this.query=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.query=n.name;var i=e.match(_);for(var o in this.at=i?i[1]:"unknown",this.options=n,this.rules=new Y(Object(r.a)({},n,{parent:this})),t)this.rules.add(o,t[o]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.toString=function(e){if(void 0===e&&(e=E),null==e.indent&&(e.indent=E.indent),null==e.children&&(e.children=E.children),!1===e.children)return this.query+" {}";var t=this.rules.toString(e);return t?this.query+" {\n"+t+"\n}":""},e}(),k=/@media|@supports\s+/,C={onCreateRule:function(e,t,n){return k.test(e)?new A(e,t,n):null}},O={indent:1,children:!0},S=/@keyframes\s+([\w-]+)/,D=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var i=e.match(S);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,u=n.generateId;for(var s in this.id=!1===o?this.name:y(u(this,a)),this.rules=new Y(Object(r.a)({},n,{parent:this})),t)this.rules.add(s,t[s],Object(r.a)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){if(void 0===e&&(e=O),null==e.indent&&(e.indent=O.indent),null==e.children&&(e.children=O.children),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},e}(),F=/@keyframes\s+/,j=/\$([\w-]+)/g,T=function(e,t){return"string"==typeof e?e.replace(j,(function(e,n){return n in t?t[n]:e})):e},N=function(e,t,n){var r=e[t],i=T(r,n);i!==r&&(e[t]=i)},M={onCreateRule:function(e,t,n){return"string"==typeof e&&F.test(e)?new D(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&N(e,"animation-name",n.keyframes),"animation"in e&&N(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return T(e,r.keyframes);default:return e}}},B=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i=this.index)t.push(e);else for(var r=0;rn)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=Object(s.a)(t,["attached"]),i="",o=0;o0){var n=function(e,t){for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=function(e){for(var t=ue(),n=0;nr)&&(n=r);try{if("insertRule"in e)e.insertRule(t,n);else if("appendRule"in e){e.appendRule(t)}}catch(e){return!1}return e.cssRules[n]},fe=function(){function e(e){this.getPropertyValue=re,this.setProperty=ie,this.removeProperty=oe,this.setSelector=ae,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,e&&J.add(e),this.sheet=e;var t,n=this.sheet?this.sheet.options:{},r=n.media,i=n.meta,o=n.element;this.element=o||((t=document.createElement("style")).textContent="\n",t),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),i&&this.element.setAttribute("data-meta",i);var a=le();a&&this.element.setAttribute("nonce",a)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=se(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"==typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling)}else ue().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){var e=this.element.parentNode;e&&e.removeChild(this.element)},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(91)},,function(e,t,n){"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<+~=|^:(),"'`\s])/g,v="undefined"!=typeof CSS&&CSS.escape,b=function(e){return v?v(e):e.replace(g,"\\$1")},y=function(){function e(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var o=null==i||!1===i,a=e in this.style;if(o&&!a&&!r)return this;var s=o&&a;if(s?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var u=this.options.sheet;return u&&u.attached,this},e}(),x=function(e){function t(t,n,r){var i;(i=e.call(this,t,n,r)||this).selectorText=void 0,i.id=void 0,i.renderable=void 0;var o=r.selector,a=r.scoped,u=r.sheet,l=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=l(Object(s.a)(Object(s.a)(i)),u),i.selectorText="."+b(i.id)),i}Object(a.a)(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!=typeof n?e[t]=n:Array.isArray(n)&&(e[t]=h(n))}return e},n.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(r.a)({},e,{allowEmpty:!0}):e;return m(this.selectorText,this.style,n)},Object(o.a)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function(){return this.selectorText}}]),t}(y),w={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new x(e,t,n)}},O={indent:1,children:!0},E=/@([\w-]+)/,C=function(){function e(e,t,n){this.type="conditional",this.at=void 0,this.key=void 0,this.query=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.query=n.name;var i=e.match(E);for(var o in this.at=i?i[1]:"unknown",this.options=n,this.rules=new G(Object(r.a)({},n,{parent:this})),t)this.rules.add(o,t[o]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.toString=function(e){if(void 0===e&&(e=O),null==e.indent&&(e.indent=O.indent),null==e.children&&(e.children=O.children),!1===e.children)return this.query+" {}";var t=this.rules.toString(e);return t?this.query+" {\n"+t+"\n}":""},e}(),_=/@media|@supports\s+/,k={onCreateRule:function(e,t,n){return _.test(e)?new C(e,t,n):null}},A={indent:1,children:!0},S=/@keyframes\s+([\w-]+)/,j=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var i=e.match(S);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,s=n.generateId;for(var u in this.id=!1===o?this.name:b(s(this,a)),this.rules=new G(Object(r.a)({},n,{parent:this})),t)this.rules.add(u,t[u],Object(r.a)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){if(void 0===e&&(e=A),null==e.indent&&(e.indent=A.indent),null==e.children&&(e.children=A.children),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},e}(),D=/@keyframes\s+/,F=/\$([\w-]+)/g,T=function(e,t){return"string"==typeof e?e.replace(F,(function(e,n){return n in t?t[n]:e})):e},M=function(e,t,n){var r=e[t],i=T(r,n);i!==r&&(e[t]=i)},N={onCreateRule:function(e,t,n){return"string"==typeof e&&D.test(e)?new j(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&M(e,"animation-name",n.keyframes),"animation"in e&&M(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return T(e,r.keyframes);default:return e}}},P=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i=this.index)t.push(e);else for(var r=0;rn)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=Object(u.a)(t,["attached"]),i="",o=0;o0){var n=function(e,t){for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=function(e){for(var t=se(),n=0;nr)&&(n=r);try{if("insertRule"in e)e.insertRule(t,n);else if("appendRule"in e){e.appendRule(t)}}catch(e){return!1}return e.cssRules[n]},fe=function(){function e(e){this.getPropertyValue=re,this.setProperty=ie,this.removeProperty=oe,this.setSelector=ae,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,e&&J.add(e),this.sheet=e;var t,n=this.sheet?this.sheet.options:{},r=n.media,i=n.meta,o=n.element;this.element=o||((t=document.createElement("style")).textContent="\n",t),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),i&&this.element.setAttribute("data-meta",i);var a=le();a&&this.element.setAttribute("nonce",a)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=ue(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"==typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling)}else se().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){var e=this.element.parentNode;e&&e.removeChild(this.element)},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function o(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}function a(e){if(0===e.indexOf("#"))return e;var t=s(e).values;return"#".concat(t.map((function(e){return 1===(t=e.toString(16)).length?"0".concat(t):t;var t})).join(""))}function u(e){var t=(e=s(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},u="rgb",c=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(u+="a",c.push(t[3])),l({type:u,values:c})}function s(e){if(e.type)return e;if("#"===e.charAt(0))return s(o(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)}))}}function l(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function c(e,t){var n=f(e),r=f(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function f(e){var t="hsl"===(e=s(e)).type?s(u(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return f(e)>.5?p(e,t):m(e,t)}function h(e,t){return e=s(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,l(e)}function p(e,t){if(e=s(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return l(e)}function m(e,t){if(e=s(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return l(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n(18);function o(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(i.a)(e,n),Object(i.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(1),i=n(5),o=n(0),a=n.n(o),u=(n(4),n(29)),s=n.n(u),l=n(133);function c(e){var t=e.theme,n=e.name,r=e.props;if(!t||!t.props||!t.props[n])return r;var i,o=t.props[n];for(i in o)void 0===r[i]&&(r[i]=o[i]);return r}var f=n(110),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=t.defaultTheme,u=t.withTheme,d=void 0!==u&&u,h=t.name,p=Object(i.a)(t,["defaultTheme","withTheme","name"]);var m=h,g=Object(l.a)(e,Object(r.a)({defaultTheme:o,Component:n,name:h||n.displayName,classNamePrefix:m},p)),v=a.a.forwardRef((function(e,t){e.classes;var u,s=e.innerRef,l=Object(i.a)(e,["classes","innerRef"]),p=g(Object(r.a)(Object(r.a)({},n.defaultProps),e)),m=l;return("string"==typeof h||d)&&(u=Object(f.a)()||o,h&&(m=c({theme:u,name:h,props:l})),d&&!m.theme&&(m.theme=u)),a.a.createElement(n,Object(r.a)({ref:s||t,classes:p},m))}));return s()(v,n),v}},h=n(17);t.a=function(e,t){return d(e,Object(r.a)({defaultTheme:h.a},t))}},function(e,t,n){"use strict";var r=n(28),i=Object(r.a)();t.a=i},function(e,t,n){"use strict";function r(e,t){"function"==typeof e?e(t):e&&(e.current=t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(69);function i(e){if("string"!=typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},,,function(e,t,n){"use strict";e.exports=function(e,t,n,r,i,o,a,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,u],c=0;(s=new Error(t.replace(/%s/g,(function(){return l[c++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},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;n0?r:e)-l/100).concat(o,")")},between:d,only:function(e){return d(e,e)},width:function(e){return n[e]}},c)}function l(e,t,n){var i;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(a.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,e.up("sm"),{minHeight:64}),i)},n)}var c=n(69),f={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},h={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},m={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},g={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},v={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},y={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},b=n(13),x={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:d[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:f.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function E(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(b.i)(e.main,i):"dark"===t&&(e.dark=Object(b.a)(e.main,o)))}function _(e){var t=e.primary,n=void 0===t?{light:h[300],main:h[500],dark:h[700]}:t,r=e.secondary,u=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,s=e.error,l=void 0===s?{light:m[300],main:m[500],dark:m[700]}:s,_=e.warning,A=void 0===_?{light:g[300],main:g[500],dark:g[700]}:_,k=e.info,C=void 0===k?{light:v[300],main:v[500],dark:v[700]}:k,O=e.success,S=void 0===O?{light:y[300],main:y[500],dark:y[700]}:O,D=e.type,F=void 0===D?"light":D,j=e.contrastThreshold,T=void 0===j?3:j,N=e.tonalOffset,M=void 0===N?.2:N,B=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function P(e){return Object(b.e)(e,w.text.primary)>=T?w.text.primary:x.text.primary}var R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(a.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(c.a)(4,t));if("string"!=typeof e.main)throw new Error(Object(c.a)(5,JSON.stringify(e.main)));return E(e,"light",n,M),E(e,"dark",r,M),e.contrastText||(e.contrastText=P(e.main)),e},z={dark:w,light:x};return Object(o.a)(Object(a.a)({common:f,type:F,primary:R(n),secondary:R(u,"A400","A200","A700"),error:R(l),warning:R(A),info:R(C),success:R(S),grey:d,contrastThreshold:T,getContrastText:P,augmentColor:R,tonalOffset:M},z[F]),B)}function A(e){return Math.round(1e5*e)/1e5}var k={textTransform:"uppercase"};function C(e,t){var n="function"==typeof t?t(e):t,r=n.fontFamily,u=void 0===r?'"Roboto", "Helvetica", "Arial", sans-serif':r,s=n.fontSize,l=void 0===s?14:s,c=n.fontWeightLight,f=void 0===c?300:c,d=n.fontWeightRegular,h=void 0===d?400:d,p=n.fontWeightMedium,m=void 0===p?500:p,g=n.fontWeightBold,v=void 0===g?700:g,y=n.htmlFontSize,b=void 0===y?16:y,x=n.allVariants,w=n.pxToRem,E=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var _=l/14,C=w||function(e){return"".concat(e/b*_,"rem")},O=function(e,t,n,r,i){return Object(a.a)({fontFamily:u,fontWeight:e,fontSize:C(t),lineHeight:n},'"Roboto", "Helvetica", "Arial", sans-serif'===u?{letterSpacing:"".concat(A(r/t),"em")}:{},i,x)},S={h1:O(f,96,1.167,-1.5),h2:O(f,60,1.2,-.5),h3:O(h,48,1.167,0),h4:O(h,34,1.235,.25),h5:O(h,24,1.334,0),h6:O(m,20,1.6,.15),subtitle1:O(h,16,1.75,.15),subtitle2:O(m,14,1.57,.1),body1:O(h,16,1.5,.15),body2:O(h,14,1.43,.15),button:O(m,14,1.75,.4,k),caption:O(h,12,1.66,.4),overline:O(h,12,2.66,1,k)};return Object(o.a)(Object(a.a)({htmlFontSize:b,pxToRem:C,round:A,fontFamily:u,fontSize:l,fontWeightLight:f,fontWeightRegular:h,fontWeightMedium:m,fontWeightBold:v},S),E,{clone:!1})}function O(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var S=["none",O(0,2,1,-1,0,1,1,0,0,1,3,0),O(0,3,1,-2,0,2,2,0,0,1,5,0),O(0,3,3,-2,0,3,4,0,0,1,8,0),O(0,2,4,-1,0,4,5,0,0,1,10,0),O(0,3,5,-1,0,5,8,0,0,1,14,0),O(0,3,5,-1,0,6,10,0,0,1,18,0),O(0,4,5,-2,0,7,10,1,0,2,16,1),O(0,5,5,-3,0,8,10,1,0,3,14,2),O(0,5,6,-3,0,9,12,1,0,3,16,2),O(0,6,6,-3,0,10,14,1,0,4,18,3),O(0,6,7,-4,0,11,15,1,0,4,20,3),O(0,7,8,-4,0,12,17,2,0,5,22,4),O(0,7,8,-4,0,13,19,2,0,5,24,4),O(0,7,9,-4,0,14,21,2,0,5,26,4),O(0,8,9,-5,0,15,22,2,0,6,28,5),O(0,8,10,-5,0,16,24,2,0,6,30,5),O(0,8,11,-5,0,17,26,2,0,6,32,5),O(0,9,11,-5,0,18,28,2,0,7,34,6),O(0,9,12,-6,0,19,29,2,0,7,36,6),O(0,10,13,-6,0,20,31,3,0,8,38,7),O(0,10,13,-6,0,21,33,3,0,8,40,7),O(0,10,14,-6,0,22,35,3,0,8,42,7),O(0,11,14,-7,0,23,36,3,0,9,44,8),O(0,11,15,-7,0,24,38,3,0,9,46,8)],D={borderRadius:4},F=n(30),j=(n(44),n(33));n(4);var T=function(e,t){return t?Object(o.a)(e,t,{clone:!1}):e},N={xs:0,sm:600,md:960,lg:1280,xl:1920},M={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(N[e],"px)")}};var B,P,R={m:"margin",p:"padding"},z={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},L={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},I=(B=function(e){if(e.length>2){if(!L[e])return[e];e=L[e]}var t=e.split(""),n=Object(F.a)(t,2),r=n[0],i=n[1],o=R[r],a=z[i]||"";return Array.isArray(a)?a.map((function(e){return o+e})):[o+a]},P={},function(e){return void 0===P[e]&&(P[e]=B(e)),P[e]}),U=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function $(e){var t=e.spacing||8;return"number"==typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"==typeof t?t:function(){}}function q(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"==typeof t)return t;var n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:"-".concat(n)}(t,n),e}),{})}}function W(e){var t=$(e.theme);return Object.keys(e).map((function(n){if(-1===U.indexOf(n))return null;var r=q(I(n),t),i=e[n];return function(e,t,n){if(Array.isArray(t)){var r=e.theme.breakpoints||M;return t.reduce((function(e,i,o){return e[r.up(r.keys[o])]=n(t[o]),e}),{})}if("object"===Object(j.a)(t)){var i=e.theme.breakpoints||M;return Object.keys(t).reduce((function(e,r){return e[i.up(r)]=n(t[r]),e}),{})}return n(t)}(e,i,r)})).reduce(T,{})}W.propTypes={},W.filterProps=U;function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=$({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,a=void 0===r?{}:r,u=e.palette,c=void 0===u?{}:u,f=e.spacing,d=e.typography,h=void 0===d?{}:d,p=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),m=_(c),g=s(n),v=H(f),y=Object(o.a)({breakpoints:g,direction:"ltr",mixins:l(g,v,a),overrides:{},palette:m,props:{},shadows:S,typography:C(m,h),spacing:v,shape:D,transitions:V.a,zIndex:Y},p),b=arguments.length,x=new Array(b>1?b-1:0),w=1;w>",u=o||n;if(null==t[n])return new Error("The "+i+" `"+u+"` is required to make `"+a+"` accessible for users of assistive technologies such as screen readers.");for(var s=arguments.length,l=Array(s>5?s-5:0),c=5;c0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,u=void 0===n?o.standard:n,s=t.easing,l=void 0===s?i.easeInOut:s,c=t.delay,f=void 0===c?0:c;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof u?u:a(u)," ").concat(l," ").concat("string"==typeof f?f:a(f))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){"use strict";(function(e){ + */ge()},function(e,t,n){"use strict";n.d(t,"g",(function(){return o})),n.d(t,"k",(function(){return a})),n.d(t,"h",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"j",(function(){return l})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return f})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return p})),n.d(t,"i",(function(){return m}));var r=n(74);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function o(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}function a(e){if(0===e.indexOf("#"))return e;var t=u(e).values;return"#".concat(t.map((function(e){return 1===(t=e.toString(16)).length?"0".concat(t):t;var t})).join(""))}function s(e){var t=(e=u(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},s="rgb",c=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",c.push(t[3])),l({type:s,values:c})}function u(e){if(e.type)return e;if("#"===e.charAt(0))return u(o(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)}))}}function l(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function c(e,t){var n=f(e),r=f(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function f(e){var t="hsl"===(e=u(e)).type?u(s(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return f(e)>.5?p(e,t):m(e,t)}function h(e,t){return e=u(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,l(e)}function p(e,t){if(e=u(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return l(e)}function m(e,t){if(e=u(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return l(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(1),i=n(18);function o(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(i.a)(e,n),Object(i.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(2),i=n(6),o=n(1),a=n.n(o),s=(n(5),n(29)),u=n.n(s),l=n(145);function c(e){var t=e.theme,n=e.name,r=e.props;if(!t||!t.props||!t.props[n])return r;var i,o=t.props[n];for(i in o)void 0===r[i]&&(r[i]=o[i]);return r}var f=n(121),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=t.defaultTheme,s=t.withTheme,d=void 0!==s&&s,h=t.name,p=Object(i.a)(t,["defaultTheme","withTheme","name"]);var m=h,g=Object(l.a)(e,Object(r.a)({defaultTheme:o,Component:n,name:h||n.displayName,classNamePrefix:m},p)),v=a.a.forwardRef((function(e,t){e.classes;var s,u=e.innerRef,l=Object(i.a)(e,["classes","innerRef"]),p=g(Object(r.a)(Object(r.a)({},n.defaultProps),e)),m=l;return("string"==typeof h||d)&&(s=Object(f.a)()||o,h&&(m=c({theme:s,name:h,props:l})),d&&!m.theme&&(m.theme=s)),a.a.createElement(n,Object(r.a)({ref:u||t,classes:p},m))}));return u()(v,n),v}},h=n(17);t.a=function(e,t){return d(e,Object(r.a)({defaultTheme:h.a},t))}},function(e,t,n){"use strict";var r=n(28),i=Object(r.a)();t.a=i},function(e,t,n){"use strict";function r(e,t){"function"==typeof e?e(t):e&&(e.current=t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(74);function i(e){if("string"!=typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},,,function(e,t,n){"use strict";e.exports=function(e,t,n,r,i,o,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,s],c=0;(u=new Error(t.replace(/%s/g,(function(){return l[c++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},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;n0?r:e)-l/100).concat(o,")")},between:d,only:function(e){return d(e,e)},width:function(e){return n[e]}},c)}function l(e,t,n){var i;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(a.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,e.up("sm"),{minHeight:64}),i)},n)}var c=n(74),f={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},h={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},m={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},g={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},v={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},b={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},y=n(13),x={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:d[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:f.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function O(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(y.i)(e.main,i):"dark"===t&&(e.dark=Object(y.a)(e.main,o)))}function E(e){var t=e.primary,n=void 0===t?{light:h[300],main:h[500],dark:h[700]}:t,r=e.secondary,s=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,u=e.error,l=void 0===u?{light:m[300],main:m[500],dark:m[700]}:u,E=e.warning,C=void 0===E?{light:g[300],main:g[500],dark:g[700]}:E,_=e.info,k=void 0===_?{light:v[300],main:v[500],dark:v[700]}:_,A=e.success,S=void 0===A?{light:b[300],main:b[500],dark:b[700]}:A,j=e.type,D=void 0===j?"light":j,F=e.contrastThreshold,T=void 0===F?3:F,M=e.tonalOffset,N=void 0===M?.2:M,P=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function B(e){return Object(y.e)(e,w.text.primary)>=T?w.text.primary:x.text.primary}var L=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(a.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(c.a)(4,t));if("string"!=typeof e.main)throw new Error(Object(c.a)(5,JSON.stringify(e.main)));return O(e,"light",n,N),O(e,"dark",r,N),e.contrastText||(e.contrastText=B(e.main)),e},R={dark:w,light:x};return Object(o.a)(Object(a.a)({common:f,type:D,primary:L(n),secondary:L(s,"A400","A200","A700"),error:L(l),warning:L(C),info:L(k),success:L(S),grey:d,contrastThreshold:T,getContrastText:B,augmentColor:L,tonalOffset:N},R[D]),P)}function C(e){return Math.round(1e5*e)/1e5}var _={textTransform:"uppercase"};function k(e,t){var n="function"==typeof t?t(e):t,r=n.fontFamily,s=void 0===r?'"Roboto", "Helvetica", "Arial", sans-serif':r,u=n.fontSize,l=void 0===u?14:u,c=n.fontWeightLight,f=void 0===c?300:c,d=n.fontWeightRegular,h=void 0===d?400:d,p=n.fontWeightMedium,m=void 0===p?500:p,g=n.fontWeightBold,v=void 0===g?700:g,b=n.htmlFontSize,y=void 0===b?16:b,x=n.allVariants,w=n.pxToRem,O=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var E=l/14,k=w||function(e){return"".concat(e/y*E,"rem")},A=function(e,t,n,r,i){return Object(a.a)({fontFamily:s,fontWeight:e,fontSize:k(t),lineHeight:n},'"Roboto", "Helvetica", "Arial", sans-serif'===s?{letterSpacing:"".concat(C(r/t),"em")}:{},i,x)},S={h1:A(f,96,1.167,-1.5),h2:A(f,60,1.2,-.5),h3:A(h,48,1.167,0),h4:A(h,34,1.235,.25),h5:A(h,24,1.334,0),h6:A(m,20,1.6,.15),subtitle1:A(h,16,1.75,.15),subtitle2:A(m,14,1.57,.1),body1:A(h,16,1.5,.15),body2:A(h,14,1.43,.15),button:A(m,14,1.75,.4,_),caption:A(h,12,1.66,.4),overline:A(h,12,2.66,1,_)};return Object(o.a)(Object(a.a)({htmlFontSize:y,pxToRem:k,round:C,fontFamily:s,fontSize:l,fontWeightLight:f,fontWeightRegular:h,fontWeightMedium:m,fontWeightBold:v},S),O,{clone:!1})}function A(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var S=["none",A(0,2,1,-1,0,1,1,0,0,1,3,0),A(0,3,1,-2,0,2,2,0,0,1,5,0),A(0,3,3,-2,0,3,4,0,0,1,8,0),A(0,2,4,-1,0,4,5,0,0,1,10,0),A(0,3,5,-1,0,5,8,0,0,1,14,0),A(0,3,5,-1,0,6,10,0,0,1,18,0),A(0,4,5,-2,0,7,10,1,0,2,16,1),A(0,5,5,-3,0,8,10,1,0,3,14,2),A(0,5,6,-3,0,9,12,1,0,3,16,2),A(0,6,6,-3,0,10,14,1,0,4,18,3),A(0,6,7,-4,0,11,15,1,0,4,20,3),A(0,7,8,-4,0,12,17,2,0,5,22,4),A(0,7,8,-4,0,13,19,2,0,5,24,4),A(0,7,9,-4,0,14,21,2,0,5,26,4),A(0,8,9,-5,0,15,22,2,0,6,28,5),A(0,8,10,-5,0,16,24,2,0,6,30,5),A(0,8,11,-5,0,17,26,2,0,6,32,5),A(0,9,11,-5,0,18,28,2,0,7,34,6),A(0,9,12,-6,0,19,29,2,0,7,36,6),A(0,10,13,-6,0,20,31,3,0,8,38,7),A(0,10,13,-6,0,21,33,3,0,8,40,7),A(0,10,14,-6,0,22,35,3,0,8,42,7),A(0,11,14,-7,0,23,36,3,0,9,44,8),A(0,11,15,-7,0,24,38,3,0,9,46,8)],j={borderRadius:4},D=n(30),F=(n(31),n(37));n(5);var T=function(e,t){return t?Object(o.a)(e,t,{clone:!1}):e},M={xs:0,sm:600,md:960,lg:1280,xl:1920},N={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(M[e],"px)")}};var P,B,L={m:"margin",p:"padding"},R={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},z={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},I=(P=function(e){if(e.length>2){if(!z[e])return[e];e=z[e]}var t=e.split(""),n=Object(D.a)(t,2),r=n[0],i=n[1],o=L[r],a=R[i]||"";return Array.isArray(a)?a.map((function(e){return o+e})):[o+a]},B={},function(e){return void 0===B[e]&&(B[e]=P(e)),B[e]}),U=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function $(e){var t=e.spacing||8;return"number"==typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"==typeof t?t:function(){}}function W(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"==typeof t)return t;var n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:"-".concat(n)}(t,n),e}),{})}}function H(e){var t=$(e.theme);return Object.keys(e).map((function(n){if(-1===U.indexOf(n))return null;var r=W(I(n),t),i=e[n];return function(e,t,n){if(Array.isArray(t)){var r=e.theme.breakpoints||N;return t.reduce((function(e,i,o){return e[r.up(r.keys[o])]=n(t[o]),e}),{})}if("object"===Object(F.a)(t)){var i=e.theme.breakpoints||N;return Object.keys(t).reduce((function(e,r){return e[i.up(r)]=n(t[r]),e}),{})}return n(t)}(e,i,r)})).reduce(T,{})}H.propTypes={},H.filterProps=U;function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=$({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,a=void 0===r?{}:r,s=e.palette,c=void 0===s?{}:s,f=e.spacing,d=e.typography,h=void 0===d?{}:d,p=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),m=E(c),g=u(n),v=q(f),b=Object(o.a)({breakpoints:g,direction:"ltr",mixins:l(g,v,a),overrides:{},palette:m,props:{},shadows:S,typography:k(m,h),spacing:v,shape:j,transitions:V.a,zIndex:G},p),y=arguments.length,x=new Array(y>1?y-1:0),w=1;w2),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=m||/Mac/.test(t),y=/\bCrOS\b/.test(e),x=/win/i.test(t),w=f&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,u=!0);var O=b&&(l||f&&(null==w||w<12.11)),E=n||a&&s>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _,k=function(e,t){var n=e.className,r=C(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function A(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function S(e,t){return A(e).appendChild(t)}function j(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(P=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};function I(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var V=[""];function G(e){for(;V.length<=e;)V.push(Y(V)+" ");return V[e]}function Y(e){return e[e.length-1]}function K(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Z(e))||t.test(e):Z(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var ae=null;function se(e,t,n){var r;ae=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ae=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ae=i)}return null!=r?r:ae}var ue=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var u="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var l,c=a.length,f=[],d=0;d-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function pe(e,t){var n=de(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function be(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){he(this,e,t)}}function ye(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function we(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Oe(e){ye(e),xe(e)}function Ee(e){return e.target||e.srcElement}function Ce(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var _e,ke,Ae=function(){if(a&&s<9)return!1;var e=j("div");return"draggable"in e||"dragDrop"in e}();function Se(e){if(null==_e){var t=j("span","​");S(e,j("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(_e=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=_e?j("span","​"):j("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function je(e){if(null!=ke)return ke;var t=S(e,document.createTextNode("AخA")),n=_(t,0,1).getBoundingClientRect(),r=_(t,1,2).getBoundingClientRect();return A(e),!(!n||n.left==n.right)&&(ke=r.right-n.right<3)}var De,Fe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Te=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Me="oncopy"in(De=j("div"))||(De.setAttribute("oncopy","return;"),"function"==typeof De.oncopy),Ne=null,Pe={},Be={};function Le(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pe[e]=t}function Re(e){if("string"==typeof e&&Be.hasOwnProperty(e))e=Be[e];else if(e&&"string"==typeof e.name&&Be.hasOwnProperty(e.name)){var t=Be[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Re("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Re("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function ze(e,t){t=Re(t);var n=Pe[t.name];if(!n)return ze(e,"text/plain");var r=n(e,t);if(Ie.hasOwnProperty(t.name)){var i=Ie[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Ie={};function Ue(e,t){L(t,Ie.hasOwnProperty(e)?Ie[e]:Ie[e]={})}function $e(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function We(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function He(e,t,n){return!e.startState||e.startState(t,n)}var qe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ve(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?et(n,Ve(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ve(e,t.line).text.length)}function ut(e,t){for(var n=[],r=0;r=this.string.length},qe.prototype.sol=function(){return this.pos==this.lineStart},qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qe.prototype.next=function(){if(this.post},qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},qe.prototype.skipToEnd=function(){this.pos=this.string.length},qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},qe.prototype.backUp=function(e){this.pos-=e},qe.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var lt=function(e,t){this.state=e,this.lookAhead=t},ct=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,n,r){var i=[e.state.modeGen],o={};xt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],u=1,l=0;n.state=!0,xt(e,t.text,s.mode,n,(function(e,t){for(var n=u;le&&i.splice(u,1,e,i[u+1],r),u+=2,l=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,u-n,e,"overlay "+t),u=n+2;else for(;ne.options.maxHighlightLength&&$e(e.doc.mode,r.state),o=ft(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ht(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ct(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var u=Ve(o,s-1),l=u.stateAfter;if(l&&(!n||s+(l instanceof lt?l.lookAhead:0)<=o.modeFrontier))return s;var c=R(u.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}(e,t,n),a=o>r.first&&Ve(r,o-1).stateAfter,s=a?ct.fromSaved(r,a,o):new ct(r,He(r.mode),o);return r.iter(o,t,(function(n){pt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,n){return t instanceof lt?new ct(e,$e(e.mode,t.state),n,t.lookAhead):new ct(e,$e(e.mode,t),n)},ct.prototype.save=function(e){var t=!1!==e?$e(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new lt(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function bt(e,t,n,r){var i,o,a=e.doc,s=a.mode,u=Ve(a,(t=st(a,t)).line),l=ht(e,t.line,n),c=new qe(u.text,e.options.tabSize,l);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(s=!1,a&&pt(e,t,r,f.pos),f.pos=t.length,u=null):u=yt(gt(n,f,r.state,d),o),d){var h=d[0].name;h&&(u="m-"+(u?h+" "+u:h))}if(!s||c!=u){for(;l=t:o.to>t);(r||(r=[])).push(new Et(a,o.from,s?null:o.to))}}return r}(n,i,a),u=function(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var y=0;yt)&&(!n||Tt(n,o.marker)<0)&&(n=o.marker)}return n}function Lt(e,t,n,r,i){var o=Ve(e,t),a=Ot&&o.markedSpans;if(a)for(var s=0;s=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?tt(l.to,n)>=0:tt(l.to,n)>0)||c>=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?tt(l.from,r)<=0:tt(l.from,r)<0)))return!0}}}function Rt(e){for(var t;t=Nt(e);)e=t.find(-1,!0).line;return e}function zt(e,t){var n=Ve(e,t),r=Rt(n);return n==r?t:Xe(r)}function It(e,t){if(t>e.lastLine())return t;var n,r=Ve(e,t);if(!Ut(e,r))return t;for(;n=Pt(r);)r=n.find(1,!0).line;return Xe(r)+1}function Ut(e,t){var n=Ot&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Vt=function(e,t,n){this.text=e,jt(this,t),this.height=n?n(this):1};function Gt(e){e.parent=null,St(e)}Vt.prototype.lineNo=function(){return Xe(this)},be(Vt);var Yt={},Kt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Kt:Yt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Jt(e,t){var n=D("span",null,null,u?"padding-right: .1px":null),r={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Zt,je(e.display.measure)&&(a=le(o,e.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[],nn(o,r,dt(e,o,t!=e.display.externalMeasured&&Xe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=N(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=N(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Se(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return pe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=N(r.pre.className,r.textClass||"")),r}function Qt(e){var t=j("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Zt(e,t,n,r,i,o,u){if(t){var l,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;il&&f.from<=l);d++);if(f.to>=c)return e(n,r,i,o,a,s,u);e(n,r.slice(0,f.to-l),i,o,null,s,u),o=null,r=r.slice(f.to-l),l=f.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,u,l,c,f,d,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){u=l=c=s="",d=null,f=null,v=1/0;for(var b=[],y=void 0,x=0;xp||O.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,l=""),O.className&&(u+=" "+O.className),O.css&&(s=(s?s+";":"")+O.css),O.startStyle&&w.from==p&&(c+=" "+O.startStyle),O.endStyle&&w.to==v&&(y||(y=[])).push(O.endStyle,w.to),O.title&&((d||(d={})).title=O.title),O.attributes)for(var E in O.attributes)(d||(d={}))[E]=O.attributes[E];O.collapsed&&(!f||Tt(f.marker,O)<0)&&(f=w)}else w.from>p&&v>w.from&&(v=w.from)}if(y)for(var C=0;C=h)break;for(var k=Math.min(h,v);;){if(g){var A=p+g.length;if(!f){var S=A>k?g.slice(0,k-p):g;t.addToken(t,S,a?a+u:u,c,p+S.length==v?l:"",s,d)}if(A>=k){g=g.slice(k-p),p=k;break}p=A,c=""}g=i.slice(o,o=n[m++]),a=Xt(n[m++],t.cm.options)}}else for(var j=1;jn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Dn(e,t,n,r){return Mn(e,Tn(e,t),n,r)}function Fn(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&o.push((u.bottom+l.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Bn(t.map,n,r),u=o.node,l=o.start,c=o.end,f=o.collapse;if(3==u.nodeType){for(var d=0;d<4;d++){for(;l&&re(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+c1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var h;l>0&&(f=r="right"),i=e.options.lineWrapping&&(h=u.getClientRects()).length>1?h["right"==r?h.length-1:0]:u.getBoundingClientRect()}if(a&&s<9&&!l&&(!i||!i.left&&!i.right)){var p=u.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+ir(e.display),top:p.top,bottom:p.bottom}:Pn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,b=t.view.measure.heights,y=0;yt)&&(i=(o=u-s)-1,t>=u&&(a="right")),null!=i){if(r=e[l+2],s==u&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[2+(l-=3)],a="left";if("right"==n&&i==u-s)for(;l=0&&(n=e[i]).left==n.right;i--);return n}function Rn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(u=r.text.length,l="before"):u<=0&&(u=0,l="after"),!s)return a("before"==l?u-1:u,"before"==l);function c(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var f=se(s,u,l),d=ae,h=c(u,f,"before"==l);return null!=d&&(h.other=c(u,d,"before"!=l)),h}function Yn(e,t){var n=0;t=st(e.doc,t),e.options.lineWrapping||(n=ir(e.display)*t.ch);var r=Ve(e.doc,t.line),i=Wt(r)+En(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Kn(e,t,n,r,i){var o=et(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Xn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Kn(r.first,0,null,-1,-1);var i=Je(r,n),o=r.first+r.size-1;if(i>o)return Kn(r.first+r.size-1,Ve(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Ve(r,i);;){var s=er(e,a,i,t,n),u=Bt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!u)return s;var l=u.find(1);if(l.line==i)return l;a=Ve(r,i=l.line)}}function Jn(e,t,n,r){r-=Wn(t);var i=t.text.length,o=oe((function(t){return Mn(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=oe((function(t){return Mn(e,n,t).top>r}),o,i)}}function Qn(e,t,n,r){return n||(n=Tn(e,t)),Jn(e,t,n,Hn(e,t,Mn(e,n,r),"line").top)}function Zn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=Wt(t);var o=Tn(e,t),a=Wn(t),s=0,u=t.text.length,l=!0,c=le(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?nr:tr)(e,t,n,o,c,r,i);s=(l=1!=f.level)?f.from:f.to-1,u=l?f.to:f.from-1}var d,h,p=null,m=null,g=oe((function(t){var n=Mn(e,o,t);return n.top+=a,n.bottom+=a,!!Zn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)}),s,u),v=!1;if(m){var b=r-m.left=x.bottom?1:0}return Kn(n,g=ie(t.text,g,1),h,v,r-d)}function tr(e,t,n,r,i,o,a){var s=oe((function(s){var u=i[s],l=1!=u.level;return Zn(Gn(e,et(n,l?u.to:u.from,l?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),u=i[s];if(s>0){var l=1!=u.level,c=Gn(e,et(n,l?u.from:u.to,l?"after":"before"),"line",t,r);Zn(c,o,a,!0)&&c.top>a&&(u=i[s-1])}return u}function nr(e,t,n,r,i,o,a){var s=Jn(e,t,r,a),u=s.begin,l=s.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var c=null,f=null,d=0;d=l||h.to<=u)){var p=Mn(e,r,1!=h.level?Math.min(l,h.to)-1:Math.max(u,h.from)).right,m=pm)&&(c=h,f=m)}}return c||(c=i[i.length-1]),c.froml&&(c={from:c.from,to:l,level:c.level}),c}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Nn){Nn=j("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(j("br"));Nn.appendChild(document.createTextNode("x"))}S(e.measure,Nn);var n=Nn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),A(e.measure),n||1}function ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=j("span","xxxxxxxxxx"),n=j("pre",[t],"CodeMirror-line-like");S(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function or(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:ar(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sr(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(i){if(Ut(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(u=Ve(e.doc,l.line).text).length==l.ch){var c=R(u,u.length,e.options.tabSize)-u.length;l=et(l.line,Math.max(0,Math.round((o-_n(e.display).left)/ir(e.display))-c))}return l}function cr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ot&&zt(e.doc,t)i.viewFrom?hr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)hr(e);else if(t<=i.viewFrom){var o=pr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):hr(e)}else if(n>=i.viewTo){var a=pr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):hr(e)}else{var s=pr(e,t,t,-1),u=pr(e,n,n+r,1);s&&u?(i.view=i.view.slice(0,s.index).concat(on(e,s.lineN,u.lineN)).concat(i.view.slice(u.index)),i.viewTo+=r):hr(e)}var l=i.externalMeasured;l&&(n=i.lineN&&t=r.viewTo)){var o=r.view[cr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==I(a,n)&&a.push(n)}}}function hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pr(e,t,n,r){var i,o=cr(e,t),a=e.display.view;if(!Ot||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,u=0;u0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;zt(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function mr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().linet||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?d:r,(function(e,t,i,f){var g="ltr"==i,v=h(e,g?"left":"right"),b=h(t-1,g?"right":"left"),y=null==n&&0==e,x=null==r&&t==d,w=0==f,O=!m||f==m.length-1;if(b.top-v.top<=3){var E=(l?x:y)&&O,C=(l?y:x)&&w?s:(g?v:b).left,_=E?u:(g?b:v).right;c(C,v.top,_-C,v.bottom)}else{var k,A,S,j;g?(k=l&&y&&w?s:v.left,A=l?u:p(e,i,"before"),S=l?s:p(t,i,"after"),j=l&&x&&O?u:b.right):(k=l?p(e,i,"before"):s,A=!l&&y&&w?u:v.right,S=!l&&x&&O?s:b.left,j=l?p(t,i,"after"):u),c(k,v.top,A-k,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||_r(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Or(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Cr(e))}function Er(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&_r(e))}),100)}function Cr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(pe(e,"focus",e,t),e.state.focused=!0,M(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),wr(e))}function _r(e,t){e.state.delayingBlurEvent||(e.state.focused&&(pe(e,"blur",e,t),e.state.focused=!1,k(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function kr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||d<-.005)&&(Ke(i.line,u),Ar(i.line),i.rest))for(var h=0;he.display.sizerWidth){var p=Math.ceil(l/ir(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Ar(e){if(e.widgets)for(var t=0;t=a&&(o=Je(t,Wt(Ve(t,u))-e.wrapper.clientHeight),a=u)}return{from:o,to:Math.max(a,o+1)}}function jr(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Sn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Cn(n),u=t.tops-r;if(t.topi+o){var c=Math.min(t.top,(l?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-f,h=An(e)-n.gutters.offsetWidth,p=t.right-t.left>h;return p&&(t.right=t.left+h),t.left<10?a.scrollLeft=0:t.lefth+d-3&&(a.scrollLeft=t.right+(p?0:10)-h),a}function Dr(e,t){null!=t&&(Mr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Fr(e){Mr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Tr(e,t,n){null==t&&null==n||Mr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Mr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Nr(e,Yn(e,t.from),Yn(e,t.to),t.margin))}function Nr(e,t,n,r){var i=jr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Tr(e,i.scrollLeft,i.scrollTop)}function Pr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||ui(e,{top:t}),Br(e,t,!0),n&&ui(e),ri(e,100))}function Br(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Lr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,fi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Rr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Cn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+kn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var zr=function(e,t,n){this.cm=n;var r=this.vert=j("div",[j("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=j("div",[j("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),fe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),fe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},zr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zr.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},zr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},zr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ir=function(){};function Ur(e,t){t||(t=Rr(e));var n=e.display.barWidth,r=e.display.barHeight;$r(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&kr(e),$r(e,Rr(e)),n=e.display.barWidth,r=e.display.barHeight}function $r(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Ir.prototype.update=function(){return{bottom:0,right:0}},Ir.prototype.setScrollLeft=function(){},Ir.prototype.setScrollTop=function(){},Ir.prototype.clear=function(){};var Wr={native:zr,null:Ir};function Hr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&k(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Wr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Lr(e,t):Pr(e,t)}),e),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)}var qr=0;function Vr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qr},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function Gr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Kr(e){e.updatedDisplay=e.mustUpdate&&ai(e.cm,e.update)}function Xr(e){var t=e.cm,n=t.display;e.updatedDisplay&&kr(t),e.barMeasure=Rr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Dn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+kn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-An(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Jr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=j("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-En(e.display))+"px;\n height: "+(t.bottom-t.top+kn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Gn(e,t),u=n&&n!=t?Gn(e,n):s,l=jr(e,i={left:Math.min(s.left,u.left),top:Math.min(s.top,u.top)-r,right:Math.max(s.left,u.left),bottom:Math.max(s.bottom,u.bottom)+r}),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=l.scrollTop&&(Pr(e,l.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=l.scrollLeft&&(Lr(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}(t,st(r,e.scrollToPos.from),st(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ht(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?$e(t.mode,r.state):null,u=ft(e,o,r,!0);s&&(r.state=s),o.styles=u.styles;var l=o.styleClasses,c=u.classes;c?o.styleClasses=c:l&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||l!=c&&(!l||!c||l.bgClass!=c.bgClass||l.textClass!=c.textClass),d=0;!f&&dn)return ri(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Zr(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mr(e))return!1;di(e)&&(hr(e),t.dims=or(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Ot&&(o=zt(e.doc,o),a=It(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,cr(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Wt(Ve(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=mr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=T();if(!t||!F(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&F(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return l>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return u&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var l=r.view,c=r.viewFrom,f=0;f-1&&(h=!1),cn(e,d,c,n)),h&&(A(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Ze(e.options,c)))),a=d.node.nextSibling}else{var p=vn(e,d,c,n);o.insertBefore(p,a)}c+=d.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=T()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&F(document.body,e.anchorNode)&&F(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),A(n.cursorDiv),A(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ri(e,400)),n.updateLineNumbers=null,!0}function si(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=An(e))r&&(t.visible=Sr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Cn(e.display)-Sn(e),n.top)}),t.visible=Sr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ai(e,t))break;kr(e);var i=Rr(e);gr(e),Ur(e,i),ci(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ui(e,t){var n=new oi(e,t);if(ai(e,n)){kr(e),si(e,n);var r=Rr(e);gr(e),Ur(e,r),ci(e,r),n.finish()}}function li(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ci(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+kn(e)+"px"}function fi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ar(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;as.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&l||o&&c){if(o&&b&&u)e:for(var d=t.target,h=a.view;d!=s;d=d.parentNode)for(var p=0;p=0&&tt(e,r.to())<=0)return n}return-1};var Ei=function(e,t){this.anchor=e,this.head=t};function Ci(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=I(t,i);for(var o=1;o0:u>=0){var l=ot(s.from(),a.from()),c=it(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new Ei(f?c:l,f?l:c))}}return new Oi(t,n)}function _i(e,t){return new Oi([new Ei(e,t||e)],0)}function ki(e){return e.text?et(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ai(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return ki(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=ki(t).ch-t.to.ch),et(n,r)}function Si(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}un(e,"change",e,t)}function Ni(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;as-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(zi(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(i,i.lastOp==r)))a=Y(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=ki(t):o.changes.push(Ri(e,t));else{var u=Y(i.done);for(u&&u.ranges||$i(e.sel,i.done),o={changes:[Ri(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||pe(e,"historyAdded")}function Ui(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Y(i.done),t))?i.done[i.done.length-1]=t:$i(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&zi(i.undone)}function $i(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Wi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Hi(e){if(!e)return null;for(var t,n=0;n-1&&(Y(s)[f]=l[f],delete l[f])}}}return r}function Gi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=tt(t,i)<0;o!=tt(n,i)<0?(i=t,t=n):o!=tt(t,n)<0&&(t=n)}return new Ei(i,t)}return new Ei(n||t,t)}function Yi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Zi(e,new Oi([Gi(e.sel.primary(),t,n,i)],0),r)}function Ki(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(pe(u,"beforeCursorEnter"),u.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!u.atomic)continue;if(n){var f=u.find(r<0?1:-1),d=void 0;if((r<0?c:l)&&(f=ao(e,f,-r,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(d=tt(f,n))&&(r<0?d<0:d>0))return io(e,f,t,r,i)}var h=u.find(r<0?-1:1);return(r<0?l:c)&&(h=ao(e,h,r,h.line==t.line?o:null)),h?io(e,h,t,r,i):null}}return t}function oo(e,t,n,r,i){var o=r||1,a=io(e,t,n,o,i)||!i&&io(e,t,n,o,!0)||io(e,t,n,-o,i)||!i&&io(e,t,n,-o,!0);return a||(e.cantEdit=!0,et(e.first,0))}function ao(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:n>0&&t.ch==(r||Ve(e,t.line)).text.length?t.line0)){var c=[u,1],f=tt(l.from,s.from),d=tt(l.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&c.push({from:l.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&c.push({from:s.to,to:l.to}),i.splice.apply(i,c),u+=c.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)co(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else co(e,t)}}function co(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Si(e,t);Ii(e,t,n,e.cm?e.cm.curOp.id:NaN),po(e,t,n,kt(e,t));var r=[];Ni(e,(function(e,n){n||-1!=I(r,e.history)||(bo(e.history,t),r.push(e.history)),po(e,t,null,kt(e,t))}))}}function fo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,u="undo"==t?o.undone:o.done,l=0;l=0;--h){var p=d(h);if(p)return p.v}}}}function ho(e,t){if(0!=t&&(e.first+=t,e.sel=new Oi(K(e.sel.ranges,(function(e){return new Ei(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){fr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:et(o,Ve(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ge(e,t.from,t.to),n||(n=Si(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,u=o.line;e.options.lineWrapping||(u=Xe(Rt(Ve(r,o.line))),r.iter(u,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ge(e),Mi(r,t,n,sr(e)),e.options.lineWrapping||(r.iter(u,o.line+t.text.length,(function(e){var t=Ht(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Ve(e,r).stateAfter;if(i&&(!(i instanceof lt)||r+i.lookAhead1||!(this.children[0]instanceof xo))){var s=[];this.collapse(s),this.children=[new xo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Lt(e,t.line,t,n,o)||t.line!=n.line&&Lt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ot=!0}o.addToHistory&&Ii(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,u=t.line,l=e.cm;if(e.iter(u,n.line+1,(function(e){l&&o.collapsed&&!l.options.lineWrapping&&Rt(e)==l.display.maxLine&&(s=!0),o.collapsed&&u!=t.line&&Ke(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Et(o,u==t.line?t.ch:null,u==n.line?n.ch:null)),++u})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Ut(e,t)&&Ke(t,0)})),o.clearOnEnter&&fe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(wt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Co,o.atomic=!0),l){if(s&&(l.curOp.updateMaxLine=!0),o.collapsed)fr(l,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)dr(l,c,"text");o.atomic&&no(l.doc),un(l,"markerAdded",l,o)}return o}_o.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Vr(e),ve(this,"clear")){var n=this.find();n&&un(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&fr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&un(e,"markerCleared",e,this,r,i),t&&Gr(e),this.parent&&this.parent.clear()}},_o.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;u--)lo(this,r[u]);s?Qi(this,s):this.cm&&Fr(this.cm)})),undo:ni((function(){fo(this,"undo")})),redo:ni((function(){fo(this,"redo")})),undoSelection:ni((function(){fo(this,"undo",!0)})),redoSelection:ni((function(){fo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=st(this,e),t=st(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=u.to||null==u.from&&i!=e.line||null!=u.from&&i==t.line&&u.from>=t.ch||n&&!n(u.marker)||r.push(u.marker.parent||u.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),st(this,et(n,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),eo(t.doc,_i(n,n)),d)for(var h=0;h=0;t--)mo(e.doc,"",r[t].from,r[t].to,"+delete");Fr(e)}))}function Qo(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Zo(e,t,n){var r=Qo(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function ea(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=le(n,t.doc.direction);if(o){var a,s=i<0?Y(o):o[0],u=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var l=Tn(t,n);a=i<0?n.text.length-1:0;var c=Mn(t,l,a).top;a=oe((function(e){return Mn(t,l,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==u&&(a=Qo(n,a,1))}else a=i<0?s.to:s.from;return new et(r,a,u)}}return new et(r,i<0?n.text.length:0,i<0?"before":"after")}Wo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Wo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Wo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Wo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Wo.default=b?Wo.macDefault:Wo.pcDefault;var ta={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return Jo(e,(function(t){if(t.empty()){var n=Ve(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new et(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Ve(e.doc,i.line-1).text;a&&(i=new et(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(i.line-1,a.length-1),i,"+transpose"))}n.push(new Ei(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Zr(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(tt((i=l.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,l=ei(e,(function(t){u&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Er(e)),he(i.wrapper.ownerDocument,"mouseup",l),he(i.wrapper.ownerDocument,"mousemove",c),he(i.scroller,"dragstart",f),he(i.scroller,"drop",l),o||(ye(t),r.addNew||Yi(e.doc,n,null,null,r.extend),u&&!d||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return o=!0};u&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,fe(i.wrapper.ownerDocument,"mouseup",l),fe(i.wrapper.ownerDocument,"mousemove",c),fe(i.scroller,"dragstart",f),fe(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}(e,r,t,o):function(e,t,n,r){a&&Er(e);var i=e.display,o=e.doc;ye(t);var s,u,l=o.sel,c=l.ranges;if(r.addNew&&!r.extend?(u=o.sel.contains(n),s=u>-1?c[u]:new Ei(n,n)):(s=o.sel.primary(),u=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new Ei(n,n)),n=lr(e,t,!0,!0),u=-1;else{var f=va(e,n,r.unit);s=r.extend?Gi(s,f.anchor,f.head,r.extend):f}r.addNew?-1==u?(u=c.length,Zi(o,Ci(e,c.concat([s]),u),{scroll:!1,origin:"*mouse"})):c.length>1&&c[u].empty()&&"char"==r.unit&&!r.extend?(Zi(o,Ci(e,c.slice(0,u).concat(c.slice(u+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Xi(o,u,s,W):(u=0,Zi(o,new Oi([s],0),W),l=o.sel);var d=n;function h(t){if(0!=tt(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,c=R(Ve(o,n.line).text,n.ch,a),f=R(Ve(o,t.line).text,t.ch,a),h=Math.min(c,f),p=Math.max(c,f),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Ve(o,m).text,b=q(v,h,a);h==p?i.push(new Ei(et(m,b),et(m,b))):v.length>b&&i.push(new Ei(et(m,b),et(m,q(v,p,a))))}i.length||i.push(new Ei(n,n)),Zi(o,Ci(e,l.ranges.slice(0,u).concat(i),u),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,x=s,w=va(e,t,r.unit),O=x.anchor;tt(w.anchor,O)>0?(y=w.head,O=ot(x.from(),w.anchor)):(y=w.anchor,O=it(x.to(),w.head));var E=l.ranges.slice(0);E[u]=function(e,t){var n=t.anchor,r=t.head,i=Ve(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var o=le(i);if(!o)return t;var a=se(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var u,l=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==l||l==o.length)return t;if(r.line!=n.line)u=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=se(o,r.ch,r.sticky),f=c-a||(r.ch-n.ch)*(1==s.level?-1:1);u=c==l-1||c==l?f<0:f>0}var d=o[l+(u?-1:0)],h=u==(1==d.level),p=h?d.from:d.to,m=h?"after":"before";return n.ch==p&&n.sticky==m?t:new Ei(new et(n.line,p,m),r)}(e,new Ei(st(o,O),y)),Zi(o,Ci(e,E,u),W)}}var p=i.wrapper.getBoundingClientRect(),m=0;function g(t){e.state.selectingText=!1,m=1/0,t&&(ye(t),i.input.focus()),he(i.wrapper.ownerDocument,"mousemove",v),he(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var v=ei(e,(function(t){0!==t.buttons&&Ce(t)?function t(n){var a=++m,s=lr(e,n,!0,"rectangle"==r.unit);if(s)if(0!=tt(s,d)){e.curOp.focus=T(),h(s);var u=Sr(i,o);(s.line>=u.to||s.linep.bottom?20:0;l&&setTimeout(ei(e,(function(){m==a&&(i.scroller.scrollTop+=l,t(n))})),50)}}(t):g(t)})),b=ei(e,g);e.state.selectingText=b,fe(i.wrapper.ownerDocument,"mousemove",v),fe(i.wrapper.ownerDocument,"mouseup",b)}(e,r,t,o)}(t,r,o,e):Ee(e)==n.scroller&&ye(e):2==i?(r&&Yi(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(E?t.display.input.onContextMenu(e):Er(t)))}}function va(e,t,n){if("char"==n)return new Ei(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Ei(et(t.line,0),st(e.doc,et(t.line+1,0)));var r=n(e,t);return new Ei(r.from,r.to)}function ba(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ye(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!ve(e,n))return we(t);o-=s.top-a.viewOffset;for(var u=0;u=i)return pe(e,n,e,Je(e.doc,o),e.display.gutterSpecs[u].className,t),we(t)}}function ya(e,t){return ba(e,t,"gutterClick",!0)}function xa(e,t){On(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ba(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||E||e.display.input.onContextMenu(t)}function wa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),In(e)}ma.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var Oa={toString:function(){return"CodeMirror.Init"}},Ea={},Ca={};function _a(e,t,n){if(!t!=!(n&&n!=Oa)){var r=e.display.dragFunctions,i=t?fe:he;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function ka(e){e.options.lineWrapping?(M(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(k(e.display.wrapper,"CodeMirror-wrap"),qt(e)),ur(e),fr(e),In(e),setTimeout((function(){return Ur(e)}),100)}function Aa(e,t){var n=this;if(!(this instanceof Aa))return new Aa(e,t);this.options=t=t?L(t):{},L(Ea,t,!1);var r=t.value;"string"==typeof r?r=new Fo(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Aa.inputStyles[t.inputStyle](this),o=this.display=new gi(e,r,i,t);for(var l in o.wrapper.CodeMirror=this,wa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Hr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new z,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;fe(t.scroller,"mousedown",ei(e,ga)),fe(t.scroller,"dblclick",a&&s<11?ei(e,(function(t){if(!me(e,t)){var n=lr(e,t);if(n&&!ya(e,t)&&!On(e.display,t)){ye(t);var r=e.findWordAt(n);Yi(e.doc,r.anchor,r.head)}}})):function(t){return me(e,t)||ye(t)}),fe(t.scroller,"contextmenu",(function(t){return xa(e,t)})),fe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||xa(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}fe(t.scroller,"touchstart",(function(i){if(!me(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!ya(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!On(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new Ei(s,s):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(s):new Ei(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),ye(n)}i()})),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Pr(e,t.scroller.scrollTop),Lr(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return wi(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return wi(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||Oe(t)},over:function(t){me(e,t)||(function(e,t){var n=lr(e,t);if(n){var r=document.createDocumentFragment();br(e,n,r),e.display.dragCursor||(e.display.dragCursor=j("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),S(e.display.dragCursor,r)}}(e,t),Oe(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-To<100))Oe(t);else if(!me(e,t)&&!On(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=j("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}(e,t)},drop:ei(e,Mo),leave:function(t){me(e,t)||No(e)}};var u=t.input.getField();fe(u,"keyup",(function(t){return fa.call(e,t)})),fe(u,"keydown",ei(e,ca)),fe(u,"keypress",ei(e,da)),fe(u,"focus",(function(t){return Cr(e,t)})),fe(u,"blur",(function(t){return _r(e,t)}))}(this),Lo(),Vr(this),this.curOp.forceUpdate=!0,Pi(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Cr(n)}),20):_r(this),Ca)Ca.hasOwnProperty(l)&&Ca[l](this,t[l],Oa);di(this),t.finishInit&&t.finishInit(this);for(var c=0;c150)){if(!r)return;n="prev"}}else l=0,n="not";"prev"==n?l=t>o.first?R(Ve(o,t-1).text,null,a):0:"add"==n?l=u+e.options.indentUnit:"subtract"==n?l=u-e.options.indentUnit:"number"==typeof n&&(l=u+n),l=Math.max(0,l);var f="",d=0;if(e.options.indentWithTabs)for(var h=Math.floor(l/a);h;--h)d+=a,f+="\t";if(da,u=Fe(t),l=null;if(s&&r.ranges.length>1)if(Da&&Da.text.join("\n")==t){if(r.ranges.length%Da.text.length==0){l=[];for(var c=0;c=0;d--){var h=r.ranges[d],p=h.from(),m=h.to();h.empty()&&(n&&n>0?p=et(p.line,p.ch-n):e.state.overwrite&&!s?m=et(m.line,Math.min(Ve(o,m.line).text.length,m.ch+Y(u).length)):s&&Da&&Da.lineWise&&Da.text.join("\n")==u.join("\n")&&(p=m=et(p.line,0)));var g={from:p,to:m,text:l?l[d%l.length]:u,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};lo(e.doc,g),un(e,"inputRead",e,g)}t&&!s&&Na(e,t),Fr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ma(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Zr(t,(function(){return Ta(t,n,0,null,"paste")})),!0}function Na(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=ja(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ve(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=ja(e,i.head.line,"smart"));a&&un(e,"electricInput",e,i.head.line)}}}function Pa(e){for(var t=[],n=[],r=0;r0?0:-1));if(isNaN(c))a=null;else{var f=n>0?c>=55296&&c<56320:c>=56320&&c<57343;a=new et(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(f?2:1))),-n)}}else a=i?function(e,t,n,r){var i=le(t,e.doc.direction);if(!i)return Zo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=se(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&d>=c.begin)){var h=f?"before":"after";return new et(n.line,d,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new et(n.line,u(e,1),"before"):new et(n.line,e,"after")};e>=0&&e0==(1!=a.level),l=s?r.begin:u(r.end,-1);if(a.from<=l&&l0?c.end:u(c.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,l(g)))?null:m}(e.cm,s,t,n):Zo(s,t,n);if(null==a){if(o||(l=t.line+u)=e.first+e.size||(t=new et(l,t.ch,t.sticky),!(s=Ve(e,l))))return!1;t=ea(i,e.cm,s,t.line,u)}else t=a;return!0}if("char"==r||"codepoint"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var c=null,f="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||l(!h);h=!1){var p=s.text.charAt(t.ch)||"\n",m=ee(p,d)?"w":f&&"\n"==p?"n":!f||/\s/.test(p)?null:"p";if(!f||h||m||(m="s"),c&&c!=m){n<0&&(n=1,l(),t.sticky="after");break}if(m&&(c=m),n>0&&!l(!h))break}var g=oo(e,t,o,a,!0);return nt(o,g)&&(g.hitSide=!0),g}function za(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var u=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(u-.5*rr(e.display),3);i=(n>0?t.bottom:t.top)+n*l}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Xn(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ia=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ua(e,t){var n=Fn(e,t.line);if(!n||n.hidden)return null;var r=Ve(e.doc,t.line),i=jn(n,r,t.line),o=le(r,e.doc.direction),a="left";o&&(a=se(o,t.ch)%2?"right":"left");var s=Bn(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function $a(e,t){return t&&(e.bad=!0),e}function Wa(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return $a(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i=t.display.viewTo||o.line=t.display.viewFrom&&Ua(t,i)||{node:u[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(a=et(a.line-1,Ve(r.doc,a.line-1).length)),s.ch==Ve(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=cr(r,a.line))?(t=Xe(i.view[0].line),n=i.view[0].node):(t=Xe(i.view[e].line),n=i.view[e-1].node.nextSibling);var u,l,c=cr(r,s.line);if(c==i.view.length-1?(u=i.viewTo-1,l=i.lineDiv.lastChild):(u=Xe(i.view[c+1].line)-1,l=i.view[c+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),u=!1;function l(){a&&(o+=s,u&&(o+=s),a=u=!1)}function c(e){e&&(l(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void c(n);var o,d=t.getAttribute("cm-marker");if(d){var h=e.findMarks(et(r,0),et(i+1,0),(g=+d,function(e){return e.id==g}));return void(h.length&&(o=h[0].find(0))&&c(Ge(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&l();for(var m=0;m1&&d.length>1;)if(Y(f)==Y(d))f.pop(),d.pop(),u--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var h=0,p=0,m=f[0],g=d[0],v=Math.min(m.length,g.length);ha.ch&&b.charCodeAt(b.length-p-1)==y.charCodeAt(y.length-p-1);)h--,p++;f[f.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(h).replace(/\u200b+$/,"");var w=et(t,h),O=et(u,d.length?Y(d).length-p:0);return f.length>1||f[0]||tt(w,O)?(mo(r.doc,f,w,O,"+input"),!0):void 0},Ia.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ia.prototype.reset=function(){this.forceCompositionEnd()},Ia.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ia.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ia.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Zr(this.cm,(function(){return fr(e.cm)}))},Ia.prototype.setUneditable=function(e){e.contentEditable="false"},Ia.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,Ta)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ia.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ia.prototype.onContextMenu=function(){},Ia.prototype.resetPosition=function(){},Ia.prototype.needsContentAttribute=!0;var qa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};qa.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!me(r,e)){if(r.somethingSelected())Fa({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Pa(r);Fa({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,$):(n.prevInput="",i.value=t.text.join("\n"),P(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),fe(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),fe(i,"paste",(function(e){me(r,e)||Ma(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),fe(i,"cut",o),fe(i,"copy",o),fe(e.scroller,"paste",(function(t){if(!On(e,t)&&!me(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),fe(e.lineSpace,"selectstart",(function(t){On(e,t)||ye(t)})),fe(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},qa.prototype.createField=function(e){this.wrapper=La(),this.textarea=this.wrapper.firstChild},qa.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vr(e);if(e.options.moveInputWithCursor){var i=Gn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},qa.prototype.showSelection=function(e){var t=this.cm.display;S(t.cursorDiv,e.cursors),S(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qa.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},qa.prototype.getField=function(){return this.textarea},qa.prototype.supportsTouch=function(){return!1},qa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||T()!=this.textarea))try{this.textarea.focus()}catch(e){}},qa.prototype.blur=function(){this.textarea.blur()},qa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qa.prototype.receivedFocus=function(){this.slowPoll()},qa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},qa.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},qa.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Te(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var u=0,l=Math.min(r.length,i.length);u1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},qa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qa.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},qa.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=lr(n,e),l=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ei(n,Zi)(n.doc,_i(o),$);var c,d=i.style.cssText,h=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",u&&(c=window.scrollY),r.input.focus(),u&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&g(),E){Oe(e);var m=function(){he(window,"mouseup",m),setTimeout(v,20)};fe(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=d,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),null!=i.selectionStart)){(!a||a&&s<9)&&g();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ei(n,so)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},qa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},qa.prototype.setUneditable=function(){},qa.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Oa&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Oa,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Di(e)}),!0),n("indentUnit",2,Di,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Fi(e),In(e),fr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(et(r,o))}r++}));for(var i=n.length-1;i>=0;i--)mo(e.doc,t,n[i],et(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Oa&&e.refresh()})),n("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){wa(e),mi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Xo(t),i=n!=Oa&&Xo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,ka,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=hi(t,e.options.lineNumbers),mi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ar(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Ur(e)}),!0),n("scrollbarStyle","native",(function(e){Hr(e),Ur(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=hi(e.options.gutters,t),mi(e)}),!0),n("firstLineNumber",1,mi,!0),n("lineNumberFormatter",(function(e){return e}),mi,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(_r(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,_a),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Fi,!0),n("addModeClass",!1,Fi,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Fi,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Aa),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ei(this,t[e])(this,n,i),pe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(ja(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Fr(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var u=s;u0&&Xi(this.doc,r,new Ei(o,l[r].to()),$)}}})),getTokenAt:function(e,t){return bt(this,e,t)},getLineTokens:function(e,t){return bt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,n=dt(this,Ve(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=Ve(this.doc,e)}else r=e;return Hn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Wt(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,s,u=this.display,l=(e=Gn(this,st(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),u.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var f=Math.max(u.wrapper.clientHeight,this.doc.height),d=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(l=e.bottom),c+t.offsetWidth>d&&(c=d-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(c=u.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(u.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(o=this,a={left:c,top:l,right:c+t.offsetWidth,bottom:l+t.offsetHeight},null!=(s=jr(o,a)).scrollTop&&Pr(o,s.scrollTop),null!=s.scrollLeft&&Lr(o,s.scrollLeft))},triggerOnKeyDown:ti(ca),triggerOnKeyPress:ti(da),triggerOnKeyUp:fa,triggerOnMouseDown:ti(ga),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:ti((function(e){Na(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=st(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&ur(this),pe(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Pi(this,e),In(this),this.display.input.reset(),Tr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,un(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},be(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Aa);var Va="iter insert remove copy getEditor constructor".split(" ");for(var Ga in Fo.prototype)Fo.prototype.hasOwnProperty(Ga)&&I(Va,Ga)<0&&(Aa.prototype[Ga]=function(e){return function(){return e.apply(this.doc,arguments)}}(Fo.prototype[Ga]));return be(Fo),Aa.inputStyles={textarea:qa,contenteditable:Ia},Aa.defineMode=function(e){Aa.defaults.mode||"null"==e||(Aa.defaults.mode=e),Le.apply(this,arguments)},Aa.defineMIME=function(e,t){Be[e]=t},Aa.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Aa.defineMIME("text/plain","null"),Aa.defineExtension=function(e,t){Aa.prototype[e]=t},Aa.defineDocExtension=function(e,t){Fo.prototype[e]=t},Aa.fromTextArea=function(e,t){if((t=t?L(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=T();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(he(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Aa((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=he,e.on=fe,e.wheelEventPixels=xi,e.Doc=Fo,e.splitLines=Fe,e.countColumn=R,e.findColumn=q,e.isWordChar=Z,e.Pass=U,e.signal=pe,e.Line=Vt,e.changeEnd=ki,e.scrollbarModel=Wr,e.Pos=et,e.cmpPos=tt,e.modes=Pe,e.mimeModes=Be,e.resolveMode=Re,e.getMode=ze,e.modeExtensions=Ie,e.extendMode=Ue,e.copyState=$e,e.startState=He,e.innerMode=We,e.commands=ta,e.keyMap=Wo,e.keyName=Ko,e.isModifierKey=Go,e.lookupKey=Vo,e.normalizeKeyMap=qo,e.StringStream=qe,e.SharedTextMarker=Ao,e.TextMarker=_o,e.LineWidget=Oo,e.e_preventDefault=ye,e.e_stopPropagation=xe,e.e_stop=Oe,e.addClass=M,e.contains=F,e.rmClass=k,e.keyNames=zo}(Aa),Aa.version="5.60.0",Aa}()},function(e,t,n){"use strict";t.a=function(e,t){}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n>",s=o||n;if(null==t[n])return new Error("The "+i+" `"+s+"` is required to make `"+a+"` accessible for users of assistive technologies such as screen readers.");for(var u=arguments.length,l=Array(u>5?u-5:0),c=5;c0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?o.standard:n,u=t.easing,l=void 0===u?i.easeInOut:u,c=t.delay,f=void 0===c?0:c;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof s?s:a(s)," ").concat(l," ").concat("string"==typeof f?f:a(f))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){"use strict";(function(e){ /**! * @fileOverview Kickass library to create and place poppers near their reference elements. * @version 1.16.0 @@ -35,12 +35,24 @@ define(["@jupyter-widgets/base"],(function(e){return function(e){var t={};functi * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -var n="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,r=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}();var i=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function o(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function u(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function s(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:s(u(e))}function l(e){return e&&e.referenceNode?e.referenceNode:e}var c=n&&!(!window.MSInputMethodContext||!document.documentMode),f=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?c:10===e?f:c||f}function h(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?h(n):n:e?e.ownerDocument.documentElement:document.documentElement}function p(e){return null!==e.parentNode?p(e.parentNode):e}function m(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a,u,s=o.commonAncestorContainer;if(e!==s&&t!==s||r.contains(i))return"BODY"===(u=(a=s).nodeName)||"HTML"!==u&&h(a.firstElementChild)!==a?h(s):s;var l=p(e);return l.host?m(l.host,t):m(e,p(t).host)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=g(t,"top"),i=g(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function y(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+r+"Width"],10)}function b(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function x(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:b("Height",t,n,r),width:b("Width",t,n,r)}}var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},E=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=d(10),i="HTML"===t.nodeName,o=C(e),u=C(t),l=s(e),c=a(t),f=parseFloat(c.borderTopWidth,10),h=parseFloat(c.borderLeftWidth,10);n&&i&&(u.top=Math.max(u.top,0),u.left=Math.max(u.left,0));var p=k({top:o.top-u.top-f,left:o.left-u.left-h,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!r&&i){var m=parseFloat(c.marginTop,10),g=parseFloat(c.marginLeft,10);p.top-=f-m,p.bottom-=f-m,p.left-=h-g,p.right-=h-g,p.marginTop=m,p.marginLeft=g}return(r&&!n?t.contains(l):t===l&&"BODY"!==l.nodeName)&&(p=v(p,t)),p}function S(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=O(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:g(n),u=t?0:g(n,"left"),s={top:a-r.top+r.marginTop,left:u-r.left+r.marginLeft,width:i,height:o};return k(s)}function D(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===a(e,"position"))return!0;var n=u(e);return!!n&&D(n)}function F(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function j(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?F(e):m(e,l(t));if("viewport"===r)o=S(a,i);else{var c=void 0;"scrollParent"===r?"BODY"===(c=s(u(t))).nodeName&&(c=e.ownerDocument.documentElement):c="window"===r?e.ownerDocument.documentElement:r;var f=O(c,a,i);if("HTML"!==c.nodeName||D(a))o=f;else{var d=x(e.ownerDocument),h=d.height,p=d.width;o.top+=f.top-f.marginTop,o.bottom=h+f.top,o.left+=f.left-f.marginLeft,o.right=p+f.left}}var g="number"==typeof(n=n||0);return o.left+=g?n:n.left||0,o.top+=g?n:n.top||0,o.right-=g?n:n.right||0,o.bottom-=g?n:n.bottom||0,o}function T(e){return e.width*e.height}function N(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=j(n,r,o,i),u={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},s=Object.keys(u).map((function(e){return A({key:e},u[e],{area:T(u[e])})})).sort((function(e,t){return t.area-e.area})),l=s.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),c=l.length>0?l[0].key:s[0].key,f=e.split("-")[1];return c+(f?"-"+f:"")}function M(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?F(t):m(t,l(n));return O(n,i,r)}function B(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function P(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function R(e,t,n){n=n.split("-")[0];var r=B(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",u=o?"left":"top",s=o?"height":"width",l=o?"width":"height";return i[a]=t[a]+t[s]/2-r[s]/2,i[u]=n===u?t[u]-r[l]:t[P(u)],i}function z(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function L(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=z(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&o(n)&&(t.offsets.popper=k(t.offsets.popper),t.offsets.reference=k(t.offsets.reference),t=n(t,e))})),t}function I(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=M(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=N(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=R(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=L(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function U(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function $(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=Z.indexOf(e),r=Z.slice(n+1).concat(Z.slice(0,n));return t?r.reverse():r}var te="flip",ne="clockwise",re="counterclockwise";function ie(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),u=a.indexOf(z(a,(function(e){return-1!==e.search(/,|\s/)})));a[u]&&-1===a[u].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var s=/\s*,\s*|\s+/,l=-1!==u?[a.slice(0,u).concat([a[u].split(s)[0]]),[a[u].split(s)[1]].concat(a.slice(u+1))]:[a];return(l=l.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){var u=void 0;switch(a){case"%p":u=n;break;case"%":case"%r":default:u=r}return k(u)[t]/100*o}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}(e,i,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){G(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var oe={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,u=-1!==["bottom","top"].indexOf(n),s=u?"left":"top",l=u?"width":"height",c={start:_({},s,o[s]),end:_({},s,o[s]+o[l]-a[l])};e.offsets.popper=A({},a,c[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,u=r.split("-")[0],s=void 0;return s=G(+n)?[+n,0]:ie(n,o,a,u),"left"===u?(o.top+=s[0],o.left-=s[1]):"right"===u?(o.top+=s[0],o.left+=s[1]):"top"===u?(o.left+=s[0],o.top-=s[1]):"bottom"===u&&(o.left+=s[0],o.top+=s[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||h(e.instance.popper);e.instance.reference===n&&(n=h(n));var r=$("transform"),i=e.instance.popper.style,o=i.top,a=i.left,u=i[r];i.top="",i.left="",i[r]="";var s=j(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=u,t.boundaries=s;var l=t.priority,c=e.offsets.popper,f={primary:function(e){var n=c[e];return c[e]s[e]&&!t.escapeWithReference&&(r=Math.min(c[n],s[e]-("right"===e?c.width:c.height))),_({},n,r)}};return l.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";c=A({},c,f[t](e))})),e.offsets.popper=c,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),u=a?"right":"bottom",s=a?"left":"top",l=a?"width":"height";return n[u]o(r[u])&&(e.offsets.popper[s]=o(r[u])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!J(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,u=o.popper,s=o.reference,l=-1!==["left","right"].indexOf(i),c=l?"height":"width",f=l?"Top":"Left",d=f.toLowerCase(),h=l?"left":"top",p=l?"bottom":"right",m=B(r)[c];s[p]-mu[p]&&(e.offsets.popper[d]+=s[d]+m-u[p]),e.offsets.popper=k(e.offsets.popper);var g=s[d]+s[c]/2-m/2,v=a(e.instance.popper),y=parseFloat(v["margin"+f],10),b=parseFloat(v["border"+f+"Width"],10),x=g-e.offsets.popper[d]-y-b;return x=Math.max(Math.min(u[c]-m,x),0),e.arrowElement=r,e.offsets.arrow=(_(n={},d,Math.round(x)),_(n,h,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(U(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=j(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=P(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case te:a=[r,i];break;case ne:a=ee(r);break;case re:a=ee(r,!0);break;default:a=t.behavior}return a.forEach((function(u,s){if(r!==u||a.length===s+1)return e;r=e.placement.split("-")[0],i=P(r);var l=e.offsets.popper,c=e.offsets.reference,f=Math.floor,d="left"===r&&f(l.right)>f(c.left)||"right"===r&&f(l.left)f(c.top)||"bottom"===r&&f(l.top)f(n.right),m=f(l.top)f(n.bottom),v="left"===r&&h||"right"===r&&p||"top"===r&&m||"bottom"===r&&g,y=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(y&&"start"===o&&h||y&&"end"===o&&p||!y&&"start"===o&&m||!y&&"end"===o&&g),x=!!t.flipVariationsByContent&&(y&&"start"===o&&p||y&&"end"===o&&h||!y&&"start"===o&&g||!y&&"end"===o&&m),w=b||x;(d||v||w)&&(e.flipped=!0,(d||v)&&(r=a[s+1]),w&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=A({},e.offsets.popper,R(e.instance.popper,e.offsets.reference,e.placement)),e=L(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),u=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(u?i[a?"width":"height"]:0),e.placement=P(t),e.offsets.popper=k(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!J(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=z(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};w(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=i(this.update.bind(this)),this.options=A({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(A({},e.Defaults.modifiers,a.modifiers)).forEach((function(t){r.options.modifiers[t]=A({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return A({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&o(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var u=this.options.eventsEnabled;u&&this.enableEventListeners(),this.state.eventsEnabled=u}return E(e,[{key:"update",value:function(){return I.call(this)}},{key:"destroy",value:function(){return q.call(this)}},{key:"enableEventListeners",value:function(){return V.call(this)}},{key:"disableEventListeners",value:function(){return Y.call(this)}}]),e}();ae.Utils=("undefined"!=typeof window?window:e).PopperUtils,ae.placements=Q,ae.Defaults=oe,t.a=ae}).call(this,n(36))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i}));var r=n(6);function i(t,n){const i=n&&n.property?Object(r.c)(n.property):r.e;return!Object(r.i)(t)||(o=t,"function"==typeof e&&Object(r.g)(e.isBuffer)&&e.isBuffer(o))?i(JSON.parse(t)):function(e,t){!Object(r.f)(e)&&Object(r.h)(e)&&(e=[...e]);return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(i(t),n);var o}i.responseType="json"}).call(this,n(59).Buffer)},function(e,t,n){"use strict";var r=n(0),i=n.n(r).a.createContext(null);t.a=i},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for;t.a=r?Symbol.for("mui.nested"):"__THEME_NESTED__"},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(0),i=n(8),o=!0,a=!1,u=null,s={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function l(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function c(){o=!1}function f(){"hidden"===this.visibilityState&&a&&(o=!0)}function d(e){var t,n,r,i=e.target;try{return i.matches(":focus-visible")}catch(e){}return o||(n=(t=i).type,!("INPUT"!==(r=t.tagName)||!s[n]||t.readOnly)||"TEXTAREA"===r&&!t.readOnly||!!t.isContentEditable)}function h(){a=!0,window.clearTimeout(u),u=window.setTimeout((function(){a=!1}),100)}function p(){return{isFocusVisible:d,onBlurVisible:h,ref:r.useCallback((function(e){var t,n=i.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",l,!0),t.addEventListener("mousedown",c,!0),t.addEventListener("pointerdown",c,!0),t.addEventListener("touchstart",c,!0),t.addEventListener("visibilitychange",f,!0))}),[])}}},function(e,t,n){"use strict";function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0)return[v,n+c.join(",\n"+m),s].join("\n"+a)}return y}(e,"",0)}},,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dispatchLogEvent=void 0,t.dispatchLogEvent=function(e,t){var n=new CustomEvent("LOG",{detail:{action:e,param:t}});document.dispatchEvent(n)}},function(e,t,n){(function(n){var r;t=e.exports=d,r="object"==typeof n&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],a=t.src=[],u=t.tokens={},s=0;function l(e){u[e]=s++}l("NUMERICIDENTIFIER"),a[u.NUMERICIDENTIFIER]="0|[1-9]\\d*",l("NUMERICIDENTIFIERLOOSE"),a[u.NUMERICIDENTIFIERLOOSE]="[0-9]+",l("NONNUMERICIDENTIFIER"),a[u.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",l("MAINVERSION"),a[u.MAINVERSION]="("+a[u.NUMERICIDENTIFIER]+")\\.("+a[u.NUMERICIDENTIFIER]+")\\.("+a[u.NUMERICIDENTIFIER]+")",l("MAINVERSIONLOOSE"),a[u.MAINVERSIONLOOSE]="("+a[u.NUMERICIDENTIFIERLOOSE]+")\\.("+a[u.NUMERICIDENTIFIERLOOSE]+")\\.("+a[u.NUMERICIDENTIFIERLOOSE]+")",l("PRERELEASEIDENTIFIER"),a[u.PRERELEASEIDENTIFIER]="(?:"+a[u.NUMERICIDENTIFIER]+"|"+a[u.NONNUMERICIDENTIFIER]+")",l("PRERELEASEIDENTIFIERLOOSE"),a[u.PRERELEASEIDENTIFIERLOOSE]="(?:"+a[u.NUMERICIDENTIFIERLOOSE]+"|"+a[u.NONNUMERICIDENTIFIER]+")",l("PRERELEASE"),a[u.PRERELEASE]="(?:-("+a[u.PRERELEASEIDENTIFIER]+"(?:\\."+a[u.PRERELEASEIDENTIFIER]+")*))",l("PRERELEASELOOSE"),a[u.PRERELEASELOOSE]="(?:-?("+a[u.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+a[u.PRERELEASEIDENTIFIERLOOSE]+")*))",l("BUILDIDENTIFIER"),a[u.BUILDIDENTIFIER]="[0-9A-Za-z-]+",l("BUILD"),a[u.BUILD]="(?:\\+("+a[u.BUILDIDENTIFIER]+"(?:\\."+a[u.BUILDIDENTIFIER]+")*))",l("FULL"),l("FULLPLAIN"),a[u.FULLPLAIN]="v?"+a[u.MAINVERSION]+a[u.PRERELEASE]+"?"+a[u.BUILD]+"?",a[u.FULL]="^"+a[u.FULLPLAIN]+"$",l("LOOSEPLAIN"),a[u.LOOSEPLAIN]="[v=\\s]*"+a[u.MAINVERSIONLOOSE]+a[u.PRERELEASELOOSE]+"?"+a[u.BUILD]+"?",l("LOOSE"),a[u.LOOSE]="^"+a[u.LOOSEPLAIN]+"$",l("GTLT"),a[u.GTLT]="((?:<|>)?=?)",l("XRANGEIDENTIFIERLOOSE"),a[u.XRANGEIDENTIFIERLOOSE]=a[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",l("XRANGEIDENTIFIER"),a[u.XRANGEIDENTIFIER]=a[u.NUMERICIDENTIFIER]+"|x|X|\\*",l("XRANGEPLAIN"),a[u.XRANGEPLAIN]="[v=\\s]*("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:"+a[u.PRERELEASE]+")?"+a[u.BUILD]+"?)?)?",l("XRANGEPLAINLOOSE"),a[u.XRANGEPLAINLOOSE]="[v=\\s]*("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:"+a[u.PRERELEASELOOSE]+")?"+a[u.BUILD]+"?)?)?",l("XRANGE"),a[u.XRANGE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAIN]+"$",l("XRANGELOOSE"),a[u.XRANGELOOSE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAINLOOSE]+"$",l("COERCE"),a[u.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",l("COERCERTL"),o[u.COERCERTL]=new RegExp(a[u.COERCE],"g"),l("LONETILDE"),a[u.LONETILDE]="(?:~>?)",l("TILDETRIM"),a[u.TILDETRIM]="(\\s*)"+a[u.LONETILDE]+"\\s+",o[u.TILDETRIM]=new RegExp(a[u.TILDETRIM],"g");l("TILDE"),a[u.TILDE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAIN]+"$",l("TILDELOOSE"),a[u.TILDELOOSE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAINLOOSE]+"$",l("LONECARET"),a[u.LONECARET]="(?:\\^)",l("CARETTRIM"),a[u.CARETTRIM]="(\\s*)"+a[u.LONECARET]+"\\s+",o[u.CARETTRIM]=new RegExp(a[u.CARETTRIM],"g");l("CARET"),a[u.CARET]="^"+a[u.LONECARET]+a[u.XRANGEPLAIN]+"$",l("CARETLOOSE"),a[u.CARETLOOSE]="^"+a[u.LONECARET]+a[u.XRANGEPLAINLOOSE]+"$",l("COMPARATORLOOSE"),a[u.COMPARATORLOOSE]="^"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+")$|^$",l("COMPARATOR"),a[u.COMPARATOR]="^"+a[u.GTLT]+"\\s*("+a[u.FULLPLAIN]+")$|^$",l("COMPARATORTRIM"),a[u.COMPARATORTRIM]="(\\s*)"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+"|"+a[u.XRANGEPLAIN]+")",o[u.COMPARATORTRIM]=new RegExp(a[u.COMPARATORTRIM],"g");l("HYPHENRANGE"),a[u.HYPHENRANGE]="^\\s*("+a[u.XRANGEPLAIN]+")\\s+-\\s+("+a[u.XRANGEPLAIN]+")\\s*$",l("HYPHENRANGELOOSE"),a[u.HYPHENRANGELOOSE]="^\\s*("+a[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[u.XRANGEPLAINLOOSE]+")\\s*$",l("STAR"),a[u.STAR]="(<|>)?=?\\s*\\*";for(var c=0;c256)return null;if(!(t.loose?o[u.LOOSE]:o[u.FULL]).test(e))return null;try{return new d(e,t)}catch(e){return null}}function d(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof d){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof d))return new d(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var n=e.trim().match(t.loose?o[u.LOOSE]:o[u.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>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&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},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new d(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(y(e,t))return null;var n=f(e),r=f(t),i="";if(n.prerelease.length||r.prerelease.length){i="pre";var o="prerelease"}for(var a in n)if(("major"===a||"minor"===a||"patch"===a)&&n[a]!==r[a])return i+a;return o},t.compareIdentifiers=p;var h=/^[0-9]+$/;function p(e,t){var n=h.test(e),r=h.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function v(e,t,n){return m(e,t,n)<0}function y(e,t,n){return 0===m(e,t,n)}function b(e,t,n){return 0!==m(e,t,n)}function x(e,t,n){return m(e,t,n)>=0}function w(e,t,n){return m(e,t,n)<=0}function E(e,t,n,r){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 y(e,n,r);case"!=":return b(e,n,r);case">":return g(e,n,r);case">=":return x(e,n,r);case"<":return v(e,n,r);case"<=":return w(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function _(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof _){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof _))return new _(e,t);r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===A?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return p(t,e)},t.major=function(e,t){return new d(e,t).major},t.minor=function(e,t){return new d(e,t).minor},t.patch=function(e,t){return new d(e,t).patch},t.compare=m,t.compareLoose=function(e,t){return m(e,t,!0)},t.compareBuild=function(e,t,n){var r=new d(e,n),i=new d(t,n);return r.compare(i)||r.compareBuild(i)},t.rcompare=function(e,t,n){return m(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compareBuild(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.compareBuild(r,e,n)}))},t.gt=g,t.lt=v,t.eq=y,t.neq=b,t.gte=x,t.lte=w,t.cmp=E,t.Comparator=_;var A={};function k(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof k)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new k(e.raw,t);if(e instanceof _)return new k(e.value,t);if(!(this instanceof k))return new k(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function C(e,t){for(var n=!0,r=e.slice(),i=r.pop();n&&r.length;)n=r.every((function(e){return i.intersects(e,t)})),i=r.pop();return n}function O(e){return!e||"x"===e.toLowerCase()||"*"===e}function S(e,t,n,r,i,o,a,u,s,l,c,f,d){return((t=O(n)?"":O(r)?">="+n+".0.0":O(i)?">="+n+"."+r+".0":">="+t)+" "+(u=O(s)?"":O(l)?"<"+(+s+1)+".0.0":O(c)?"<"+s+"."+(+l+1)+".0":f?"<="+s+"."+l+"."+c+"-"+f:"<="+u)).trim()}function D(e,t,n){for(var i=0;i0){var o=e[i].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}function F(e,t,n){try{t=new k(t,n)}catch(e){return!1}return t.test(e)}function j(e,t,n,r){var i,o,a,u,s;switch(e=new d(e,r),t=new k(t,r),n){case">":i=g,o=w,a=v,u=">",s=">=";break;case"<":i=v,o=x,a=g,u="<",s="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(F(e,t,r))return!1;for(var l=0;l=0.0.0")),f=f||e,h=h||e,i(e.semver,f.semver,r)?f=e:a(e.semver,h.semver,r)&&(h=e)})),f.operator===u||f.operator===s)return!1;if((!h.operator||h.operator===u)&&o(e,h.semver))return!1;if(h.operator===s&&a(e,h.semver))return!1}return!0}_.prototype.parse=function(e){var t=this.options.loose?o[u.COMPARATORLOOSE]:o[u.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 d(n[2],this.options.loose):this.semver=A},_.prototype.toString=function(){return this.value},_.prototype.test=function(e){if(r("Comparator.test",e,this.options.loose),this.semver===A||e===A)return!0;if("string"==typeof e)try{e=new d(e,this.options)}catch(e){return!1}return E(e,this.operator,this.semver,this.options)},_.prototype.intersects=function(e,t){if(!(e instanceof _))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(n=new k(e.value,t),F(this.value,n,t));if(""===e.operator)return""===e.value||(n=new k(this.value,t),F(e.semver,n,t));var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==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=E(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=E(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||o&&a||u||s},t.Range=k,k.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},k.prototype.toString=function(){return this.range},k.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var n=t?o[u.HYPHENRANGELOOSE]:o[u.HYPHENRANGE];e=e.replace(n,S),r("hyphen replace",e),e=e.replace(o[u.COMPARATORTRIM],"$1$2$3"),r("comparator trim",e,o[u.COMPARATORTRIM]),e=(e=(e=e.replace(o[u.TILDETRIM],"$1~")).replace(o[u.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=t?o[u.COMPARATORLOOSE]:o[u.COMPARATOR],a=e.split(" ").map((function(e){return function(e,t){return r("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){r("caret",e,t);var n=t.loose?o[u.CARETLOOSE]:o[u.CARET];return e.replace(n,(function(t,n,i,o,a){var u;return r("caret",e,t,n,i,o,a),O(n)?u="":O(i)?u=">="+n+".0.0 <"+(+n+1)+".0.0":O(o)?u="0"===n?">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":">="+n+"."+i+".0 <"+(+n+1)+".0.0":a?(r("replaceCaret pr",a),u="0"===n?"0"===i?">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+"-"+a+" <"+(+n+1)+".0.0"):(r("no pr"),u="0"===n?"0"===i?">="+n+"."+i+"."+o+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+" <"+(+n+1)+".0.0"),r("caret return",u),u}))}(e,t)})).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var n=t.loose?o[u.TILDELOOSE]:o[u.TILDE];return e.replace(n,(function(t,n,i,o,a){var u;return r("tilde",e,t,n,i,o,a),O(n)?u="":O(i)?u=">="+n+".0.0 <"+(+n+1)+".0.0":O(o)?u=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":a?(r("replaceTilde pr",a),u=">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+(+i+1)+".0"):u=">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0",r("tilde return",u),u}))}(e,t)})).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var n=t.loose?o[u.XRANGELOOSE]:o[u.XRANGE];return e.replace(n,(function(n,i,o,a,u,s){r("xRange",e,n,i,o,a,u,s);var l=O(o),c=l||O(a),f=c||O(u),d=f;return"="===i&&d&&(i=""),s=t.includePrerelease?"-0":"",l?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&d?(c&&(a=0),u=0,">"===i?(i=">=",c?(o=+o+1,a=0,u=0):(a=+a+1,u=0)):"<="===i&&(i="<",c?o=+o+1:a=+a+1),n=i+o+"."+a+"."+u+s):c?n=">="+o+".0.0"+s+" <"+(+o+1)+".0.0"+s:f&&(n=">="+o+"."+a+".0"+s+" <"+o+"."+(+a+1)+".0"+s),r("xRange return",n),n}))}(e,t)})).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(o[u.STAR],"")}(e,t),r("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(a=a.filter((function(e){return!!e.match(i)}))),a=a.map((function(e){return new _(e,this.options)}),this)},k.prototype.intersects=function(e,t){if(!(e instanceof k))throw new TypeError("a Range is required");return this.set.some((function(n){return C(n,t)&&e.set.some((function(e){return C(e,t)&&n.every((function(n){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new k(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},k.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new d(e,this.options)}catch(e){return!1}for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!g(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(n&&e.test(n))return n;return null},t.validRange=function(e,t){try{return new k(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return j(e,t,"<",n)},t.gtr=function(e,t,n){return j(e,t,">",n)},t.outside=j,t.prerelease=function(e,t){var n=f(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new k(e,n),t=new k(t,n),e.intersects(t)},t.coerce=function(e,t){if(e instanceof d)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var n=null;if((t=t||{}).rtl){for(var r;(r=o[u.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),o[u.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;o[u.COERCERTL].lastIndex=-1}else n=e.match(o[u.COERCE]);if(null===n)return null;return f(n[2]+"."+(n[3]||"0")+"."+(n[4]||"0"),t)}}).call(this,n(96))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t[0],version:t[1]}}},,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MODULE_NAME=t.MODULE_VERSION=void 0;const r=n(80);t.MODULE_VERSION=r.version,t.MODULE_NAME=r.name},function(e,t,n){"use strict"; +var n="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,r=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}();var i=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function o(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function s(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function u(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:u(s(e))}function l(e){return e&&e.referenceNode?e.referenceNode:e}var c=n&&!(!window.MSInputMethodContext||!document.documentMode),f=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?c:10===e?f:c||f}function h(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?h(n):n:e?e.ownerDocument.documentElement:document.documentElement}function p(e){return null!==e.parentNode?p(e.parentNode):e}function m(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a,s,u=o.commonAncestorContainer;if(e!==u&&t!==u||r.contains(i))return"BODY"===(s=(a=u).nodeName)||"HTML"!==s&&h(a.firstElementChild)!==a?h(u):u;var l=p(e);return l.host?m(l.host,t):m(e,p(t).host)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=g(t,"top"),i=g(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function b(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+r+"Width"],10)}function y(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function x(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:y("Height",t,n,r),width:y("Width",t,n,r)}}var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},O=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=d(10),i="HTML"===t.nodeName,o=k(e),s=k(t),l=u(e),c=a(t),f=parseFloat(c.borderTopWidth,10),h=parseFloat(c.borderLeftWidth,10);n&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=_({top:o.top-s.top-f,left:o.left-s.left-h,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!r&&i){var m=parseFloat(c.marginTop,10),g=parseFloat(c.marginLeft,10);p.top-=f-m,p.bottom-=f-m,p.left-=h-g,p.right-=h-g,p.marginTop=m,p.marginLeft=g}return(r&&!n?t.contains(l):t===l&&"BODY"!==l.nodeName)&&(p=v(p,t)),p}function S(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=A(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:g(n),s=t?0:g(n,"left"),u={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o};return _(u)}function j(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===a(e,"position"))return!0;var n=s(e);return!!n&&j(n)}function D(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function F(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?D(e):m(e,l(t));if("viewport"===r)o=S(a,i);else{var c=void 0;"scrollParent"===r?"BODY"===(c=u(s(t))).nodeName&&(c=e.ownerDocument.documentElement):c="window"===r?e.ownerDocument.documentElement:r;var f=A(c,a,i);if("HTML"!==c.nodeName||j(a))o=f;else{var d=x(e.ownerDocument),h=d.height,p=d.width;o.top+=f.top-f.marginTop,o.bottom=h+f.top,o.left+=f.left-f.marginLeft,o.right=p+f.left}}var g="number"==typeof(n=n||0);return o.left+=g?n:n.left||0,o.top+=g?n:n.top||0,o.right-=g?n:n.right||0,o.bottom-=g?n:n.bottom||0,o}function T(e){return e.width*e.height}function M(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=F(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},u=Object.keys(s).map((function(e){return C({key:e},s[e],{area:T(s[e])})})).sort((function(e,t){return t.area-e.area})),l=u.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),c=l.length>0?l[0].key:u[0].key,f=e.split("-")[1];return c+(f?"-"+f:"")}function N(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?D(t):m(t,l(n));return A(n,i,r)}function P(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function B(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function L(e,t,n){n=n.split("-")[0];var r=P(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",u=o?"height":"width",l=o?"width":"height";return i[a]=t[a]+t[u]/2-r[u]/2,i[s]=n===s?t[s]-r[l]:t[B(s)],i}function R(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function z(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=R(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&o(n)&&(t.offsets.popper=_(t.offsets.popper),t.offsets.reference=_(t.offsets.reference),t=n(t,e))})),t}function I(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=N(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=M(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=L(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=z(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function U(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function $(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=Z.indexOf(e),r=Z.slice(n+1).concat(Z.slice(0,n));return t?r.reverse():r}var te="flip",ne="clockwise",re="counterclockwise";function ie(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf(R(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,l=-1!==s?[a.slice(0,s).concat([a[s].split(u)[0]]),[a[s].split(u)[1]].concat(a.slice(s+1))]:[a];return(l=l.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return _(s)[t]/100*o}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}(e,i,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){Y(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var oe={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),u=s?"left":"top",l=s?"width":"height",c={start:E({},u,o[u]),end:E({},u,o[u]+o[l]-a[l])};e.offsets.popper=C({},a,c[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],u=void 0;return u=Y(+n)?[+n,0]:ie(n,o,a,s),"left"===s?(o.top+=u[0],o.left-=u[1]):"right"===s?(o.top+=u[0],o.left+=u[1]):"top"===s?(o.left+=u[0],o.top-=u[1]):"bottom"===s&&(o.left+=u[0],o.top+=u[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||h(e.instance.popper);e.instance.reference===n&&(n=h(n));var r=$("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var u=F(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=u;var l=t.priority,c=e.offsets.popper,f={primary:function(e){var n=c[e];return c[e]u[e]&&!t.escapeWithReference&&(r=Math.min(c[n],u[e]-("right"===e?c.width:c.height))),E({},n,r)}};return l.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";c=C({},c,f[t](e))})),e.offsets.popper=c,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",u=a?"left":"top",l=a?"width":"height";return n[s]o(r[s])&&(e.offsets.popper[u]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!J(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,s=o.popper,u=o.reference,l=-1!==["left","right"].indexOf(i),c=l?"height":"width",f=l?"Top":"Left",d=f.toLowerCase(),h=l?"left":"top",p=l?"bottom":"right",m=P(r)[c];u[p]-ms[p]&&(e.offsets.popper[d]+=u[d]+m-s[p]),e.offsets.popper=_(e.offsets.popper);var g=u[d]+u[c]/2-m/2,v=a(e.instance.popper),b=parseFloat(v["margin"+f],10),y=parseFloat(v["border"+f+"Width"],10),x=g-e.offsets.popper[d]-b-y;return x=Math.max(Math.min(s[c]-m,x),0),e.arrowElement=r,e.offsets.arrow=(E(n={},d,Math.round(x)),E(n,h,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(U(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=F(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=B(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case te:a=[r,i];break;case ne:a=ee(r);break;case re:a=ee(r,!0);break;default:a=t.behavior}return a.forEach((function(s,u){if(r!==s||a.length===u+1)return e;r=e.placement.split("-")[0],i=B(r);var l=e.offsets.popper,c=e.offsets.reference,f=Math.floor,d="left"===r&&f(l.right)>f(c.left)||"right"===r&&f(l.left)f(c.top)||"bottom"===r&&f(l.top)f(n.right),m=f(l.top)f(n.bottom),v="left"===r&&h||"right"===r&&p||"top"===r&&m||"bottom"===r&&g,b=-1!==["top","bottom"].indexOf(r),y=!!t.flipVariations&&(b&&"start"===o&&h||b&&"end"===o&&p||!b&&"start"===o&&m||!b&&"end"===o&&g),x=!!t.flipVariationsByContent&&(b&&"start"===o&&p||b&&"end"===o&&h||!b&&"start"===o&&g||!b&&"end"===o&&m),w=y||x;(d||v||w)&&(e.flipped=!0,(d||v)&&(r=a[u+1]),w&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=C({},e.offsets.popper,L(e.instance.popper,e.offsets.reference,e.placement)),e=z(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),e.placement=B(t),e.offsets.popper=_(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!J(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=R(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};w(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=i(this.update.bind(this)),this.options=C({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(C({},e.Defaults.modifiers,a.modifiers)).forEach((function(t){r.options.modifiers[t]=C({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return C({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&o(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return O(e,[{key:"update",value:function(){return I.call(this)}},{key:"destroy",value:function(){return W.call(this)}},{key:"enableEventListeners",value:function(){return V.call(this)}},{key:"disableEventListeners",value:function(){return G.call(this)}}]),e}();ae.Utils=("undefined"!=typeof window?window:e).PopperUtils,ae.placements=Q,ae.Defaults=oe,t.a=ae}).call(this,n(34))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i}));var r=n(0);function i(t,n){const i=n&&n.property?Object(r.u)(n.property):r.y;return!Object(r.H)(t)||(o=t,"function"==typeof e&&Object(r.E)(e.isBuffer)&&e.isBuffer(o))?i(JSON.parse(t)):function(e,t){!Object(r.B)(e)&&Object(r.F)(e)&&(e=[...e]);return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(i(t),n);var o}i.responseType="json"}).call(this,n(64).Buffer)},function(e,t,n){"use strict";var r=n(1),i=n.n(r).a.createContext(null);t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(38);function i(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for;t.a=r?Symbol.for("mui.nested"):"__THEME_NESTED__"},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(1),i=n(8),o=!0,a=!1,s=null,u={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function l(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function c(){o=!1}function f(){"hidden"===this.visibilityState&&a&&(o=!0)}function d(e){var t,n,r,i=e.target;try{return i.matches(":focus-visible")}catch(e){}return o||(n=(t=i).type,!("INPUT"!==(r=t.tagName)||!u[n]||t.readOnly)||"TEXTAREA"===r&&!t.readOnly||!!t.isContentEditable)}function h(){a=!0,window.clearTimeout(s),s=window.setTimeout((function(){a=!1}),100)}function p(){return{isFocusVisible:d,onBlurVisible:h,ref:r.useCallback((function(e){var t,n=i.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",l,!0),t.addEventListener("mousedown",c,!0),t.addEventListener("pointerdown",c,!0),t.addEventListener("touchstart",c,!0),t.addEventListener("visibilitychange",f,!0))}),[])}}},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,m,g,v,b,y;if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===(b=JSON.stringify(t,o)))return b;if(p=i-a.length-s,b.length<=p&&(g=b.replace(r,(function(e,t){return t||e+" "}))).length<=p)return g;if(null!=o&&(t=JSON.parse(b),o=void 0),"object"==typeof t&&null!==t){if(m=a+n,c=[],l=0,Array.isArray(t))for(v="[",u="]",p=t.length;l0)return[v,n+c.join(",\n"+m),u].join("\n"+a)}return b}(e,"",0)}},,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dispatchLogEvent=void 0,t.dispatchLogEvent=function(e,t){var n=new CustomEvent("LOG",{detail:{action:e,param:t}});document.dispatchEvent(n)}},function(e,t,n){"use strict";n.r(t),n.d(t,"Vega",(function(){return QK})),n.d(t,"VegaLite",(function(){return eX})),n.d(t,"createClassFromSpec",(function(){return nX}));var r={};n.r(r),n.d(r,"JsonPatchError",(function(){return B})),n.d(r,"deepClone",(function(){return L})),n.d(r,"getValueByPointer",(function(){return I})),n.d(r,"applyOperation",(function(){return U})),n.d(r,"applyPatch",(function(){return $})),n.d(r,"applyReducer",(function(){return W})),n.d(r,"validator",(function(){return H})),n.d(r,"validate",(function(){return q})),n.d(r,"_areEquals",(function(){return V}));var i={};n.r(i),n.d(i,"unobserve",(function(){return X})),n.d(i,"observe",(function(){return J})),n.d(i,"generate",(function(){return Q})),n.d(i,"compare",(function(){return ee}));var o={};n.r(o),n.d(o,"aggregate",(function(){return is})),n.d(o,"bin",(function(){return os})),n.d(o,"collect",(function(){return ss})),n.d(o,"compare",(function(){return us})),n.d(o,"countpattern",(function(){return cs})),n.d(o,"cross",(function(){return fs})),n.d(o,"density",(function(){return hs})),n.d(o,"dotbin",(function(){return bs})),n.d(o,"expression",(function(){return ys})),n.d(o,"extent",(function(){return ws})),n.d(o,"facet",(function(){return Es})),n.d(o,"field",(function(){return Cs})),n.d(o,"filter",(function(){return ks})),n.d(o,"flatten",(function(){return As})),n.d(o,"fold",(function(){return Ss})),n.d(o,"formula",(function(){return js})),n.d(o,"generate",(function(){return Ds})),n.d(o,"impute",(function(){return Ms})),n.d(o,"joinaggregate",(function(){return Ns})),n.d(o,"kde",(function(){return Ps})),n.d(o,"key",(function(){return Bs})),n.d(o,"load",(function(){return Rs})),n.d(o,"lookup",(function(){return Is})),n.d(o,"multiextent",(function(){return Us})),n.d(o,"multivalues",(function(){return Ws})),n.d(o,"params",(function(){return qs})),n.d(o,"pivot",(function(){return Vs})),n.d(o,"prefacet",(function(){return Gs})),n.d(o,"project",(function(){return Ys})),n.d(o,"proxy",(function(){return Ks})),n.d(o,"quantile",(function(){return Xs})),n.d(o,"relay",(function(){return Js})),n.d(o,"sample",(function(){return Qs})),n.d(o,"sequence",(function(){return Zs})),n.d(o,"sieve",(function(){return eu})),n.d(o,"subflow",(function(){return Os})),n.d(o,"timeunit",(function(){return tu})),n.d(o,"tupleindex",(function(){return ru})),n.d(o,"values",(function(){return iu})),n.d(o,"window",(function(){return lu}));var a={};n.r(a),n.d(a,"interpolate",(function(){return Pc})),n.d(a,"interpolateArray",(function(){return Ac})),n.d(a,"interpolateBasis",(function(){return pc})),n.d(a,"interpolateBasisClosed",(function(){return mc})),n.d(a,"interpolateDate",(function(){return jc})),n.d(a,"interpolateDiscrete",(function(){return wf})),n.d(a,"interpolateHue",(function(){return Of})),n.d(a,"interpolateNumber",(function(){return Dc})),n.d(a,"interpolateNumberArray",(function(){return _c})),n.d(a,"interpolateObject",(function(){return Fc})),n.d(a,"interpolateRound",(function(){return Bc})),n.d(a,"interpolateString",(function(){return Nc})),n.d(a,"interpolateTransformCss",(function(){return Af})),n.d(a,"interpolateTransformSvg",(function(){return Sf})),n.d(a,"interpolateZoom",(function(){return Df})),n.d(a,"interpolateRgb",(function(){return wc})),n.d(a,"interpolateRgbBasis",(function(){return Ec})),n.d(a,"interpolateRgbBasisClosed",(function(){return Cc})),n.d(a,"interpolateHsl",(function(){return Tf})),n.d(a,"interpolateHslLong",(function(){return Mf})),n.d(a,"interpolateLab",(function(){return Gf})),n.d(a,"interpolateHcl",(function(){return Kf})),n.d(a,"interpolateHclLong",(function(){return Xf})),n.d(a,"interpolateCubehelix",(function(){return ad})),n.d(a,"interpolateCubehelixLong",(function(){return sd})),n.d(a,"piecewise",(function(){return vf})),n.d(a,"quantize",(function(){return ud}));var s={};n.r(s),n.d(s,"bound",(function(){return Ov})),n.d(s,"identifier",(function(){return Cv})),n.d(s,"mark",(function(){return _v})),n.d(s,"overlap",(function(){return kv})),n.d(s,"render",(function(){return Mv})),n.d(s,"viewlayout",(function(){return eb}));var u={};n.r(u),n.d(u,"axisticks",(function(){return nb})),n.d(u,"datajoin",(function(){return rb})),n.d(u,"encode",(function(){return ob})),n.d(u,"legendentries",(function(){return ab})),n.d(u,"linkpath",(function(){return fb})),n.d(u,"pie",(function(){return gb})),n.d(u,"scale",(function(){return yb})),n.d(u,"sortitems",(function(){return Eb})),n.d(u,"stack",(function(){return _b}));var l={};n.r(l),n.d(l,"contour",(function(){return eO})),n.d(l,"geojson",(function(){return tO})),n.d(l,"geopath",(function(){return nO})),n.d(l,"geopoint",(function(){return rO})),n.d(l,"geoshape",(function(){return iO})),n.d(l,"graticule",(function(){return oO})),n.d(l,"heatmap",(function(){return aO})),n.d(l,"isocontour",(function(){return Hw})),n.d(l,"kde2d",(function(){return Jw})),n.d(l,"projection",(function(){return uO}));var c={};n.r(c),n.d(c,"force",(function(){return tE}));var f={};n.r(f),n.d(f,"nest",(function(){return nC})),n.d(f,"pack",(function(){return uC})),n.d(f,"partition",(function(){return cC})),n.d(f,"stratify",(function(){return fC})),n.d(f,"tree",(function(){return pC})),n.d(f,"treelinks",(function(){return mC})),n.d(f,"treemap",(function(){return bC}));var d={};n.r(d),n.d(d,"label",(function(){return BC}));var h={};n.r(h),n.d(h,"loess",(function(){return RC})),n.d(h,"regression",(function(){return IC}));var p={};n.r(p),n.d(p,"voronoi",(function(){return u_}));var m={};n.r(m),n.d(m,"wordcloud",(function(){return w_}));var g={};n.r(g),n.d(g,"crossfilter",(function(){return S_})),n.d(g,"resolvefilter",(function(){return j_}));var v={};n.r(v),n.d(v,"Debug",(function(){return ie.a})),n.d(v,"Error",(function(){return ie.b})),n.d(v,"Info",(function(){return ie.c})),n.d(v,"None",(function(){return ie.d})),n.d(v,"Warn",(function(){return ie.e})),n.d(v,"accessor",(function(){return ie.f})),n.d(v,"accessorFields",(function(){return ie.g})),n.d(v,"accessorName",(function(){return ie.h})),n.d(v,"array",(function(){return ie.i})),n.d(v,"ascending",(function(){return ie.j})),n.d(v,"clampRange",(function(){return ie.k})),n.d(v,"compare",(function(){return ie.l})),n.d(v,"constant",(function(){return ie.m})),n.d(v,"debounce",(function(){return ie.n})),n.d(v,"error",(function(){return ie.o})),n.d(v,"extend",(function(){return ie.p})),n.d(v,"extent",(function(){return ie.q})),n.d(v,"extentIndex",(function(){return ie.r})),n.d(v,"falsy",(function(){return ie.s})),n.d(v,"fastmap",(function(){return ie.t})),n.d(v,"field",(function(){return ie.u})),n.d(v,"flush",(function(){return ie.v})),n.d(v,"hasOwnProperty",(function(){return ie.w})),n.d(v,"id",(function(){return ie.x})),n.d(v,"identity",(function(){return ie.y})),n.d(v,"inherits",(function(){return ie.z})),n.d(v,"inrange",(function(){return ie.A})),n.d(v,"isArray",(function(){return ie.B})),n.d(v,"isBoolean",(function(){return ie.C})),n.d(v,"isDate",(function(){return ie.D})),n.d(v,"isFunction",(function(){return ie.E})),n.d(v,"isIterable",(function(){return ie.F})),n.d(v,"isNumber",(function(){return ie.G})),n.d(v,"isObject",(function(){return ie.H})),n.d(v,"isRegExp",(function(){return ie.I})),n.d(v,"isString",(function(){return ie.J})),n.d(v,"key",(function(){return ie.K})),n.d(v,"lerp",(function(){return ie.L})),n.d(v,"logger",(function(){return ie.M})),n.d(v,"lruCache",(function(){return ie.N})),n.d(v,"merge",(function(){return ie.O})),n.d(v,"mergeConfig",(function(){return ie.P})),n.d(v,"one",(function(){return ie.Q})),n.d(v,"pad",(function(){return ie.R})),n.d(v,"panLinear",(function(){return ie.S})),n.d(v,"panLog",(function(){return ie.T})),n.d(v,"panPow",(function(){return ie.U})),n.d(v,"panSymlog",(function(){return ie.V})),n.d(v,"peek",(function(){return ie.W})),n.d(v,"quarter",(function(){return ie.X})),n.d(v,"repeat",(function(){return ie.Y})),n.d(v,"span",(function(){return ie.Z})),n.d(v,"splitAccessPath",(function(){return ie.ab})),n.d(v,"stringValue",(function(){return ie.bb})),n.d(v,"toBoolean",(function(){return ie.cb})),n.d(v,"toDate",(function(){return ie.db})),n.d(v,"toNumber",(function(){return ie.eb})),n.d(v,"toSet",(function(){return ie.fb})),n.d(v,"toString",(function(){return ie.gb})),n.d(v,"truncate",(function(){return ie.hb})),n.d(v,"truthy",(function(){return ie.ib})),n.d(v,"utcquarter",(function(){return ie.jb})),n.d(v,"visitArray",(function(){return ie.kb})),n.d(v,"writeConfig",(function(){return ie.lb})),n.d(v,"zero",(function(){return ie.mb})),n.d(v,"zoomLinear",(function(){return ie.nb})),n.d(v,"zoomLog",(function(){return ie.ob})),n.d(v,"zoomPow",(function(){return ie.pb})),n.d(v,"zoomSymlog",(function(){return ie.qb})),n.d(v,"Dataflow",(function(){return Po})),n.d(v,"EventStream",(function(){return xo})),n.d(v,"MultiPulse",(function(){return Do})),n.d(v,"Operator",(function(){return vo})),n.d(v,"Parameters",(function(){return po})),n.d(v,"Pulse",(function(){return ko})),n.d(v,"Transform",(function(){return Lo})),n.d(v,"changeset",(function(){return ho})),n.d(v,"definition",(function(){return zo})),n.d(v,"ingest",(function(){return ao})),n.d(v,"isTuple",(function(){return ro})),n.d(v,"transform",(function(){return Io})),n.d(v,"transforms",(function(){return Ro})),n.d(v,"tupleid",(function(){return io})),n.d(v,"bandwidthNRD",(function(){return Jo})),n.d(v,"bin",(function(){return Qo})),n.d(v,"bootstrapCI",(function(){return ta})),n.d(v,"cumulativeLogNormal",(function(){return ga})),n.d(v,"cumulativeNormal",(function(){return ca})),n.d(v,"cumulativeUniform",(function(){return Oa})),n.d(v,"densityLogNormal",(function(){return ma})),n.d(v,"densityNormal",(function(){return la})),n.d(v,"densityUniform",(function(){return wa})),n.d(v,"dotbin",(function(){return na})),n.d(v,"quantileLogNormal",(function(){return va})),n.d(v,"quantileNormal",(function(){return fa})),n.d(v,"quantileUniform",(function(){return Ea})),n.d(v,"quantiles",(function(){return Ko})),n.d(v,"quartiles",(function(){return Xo})),n.d(v,"random",(function(){return Zo})),n.d(v,"randomInteger",(function(){return ia})),n.d(v,"randomKDE",(function(){return ha})),n.d(v,"randomLCG",(function(){return ra})),n.d(v,"randomLogNormal",(function(){return ba})),n.d(v,"randomMixture",(function(){return ya})),n.d(v,"randomNormal",(function(){return da})),n.d(v,"randomUniform",(function(){return Ca})),n.d(v,"regressionExp",(function(){return Fa})),n.d(v,"regressionLinear",(function(){return ja})),n.d(v,"regressionLoess",(function(){return Ba})),n.d(v,"regressionLog",(function(){return Da})),n.d(v,"regressionPoly",(function(){return Na})),n.d(v,"regressionPow",(function(){return Ta})),n.d(v,"regressionQuad",(function(){return Ma})),n.d(v,"sampleCurve",(function(){return Ia})),n.d(v,"sampleLogNormal",(function(){return pa})),n.d(v,"sampleNormal",(function(){return ua})),n.d(v,"sampleUniform",(function(){return xa})),n.d(v,"setRandom",(function(){return ea})),n.d(v,"DATE",(function(){return cn})),n.d(v,"DAY",(function(){return fn})),n.d(v,"DAYOFYEAR",(function(){return dn})),n.d(v,"HOURS",(function(){return hn})),n.d(v,"MILLISECONDS",(function(){return gn})),n.d(v,"MINUTES",(function(){return pn})),n.d(v,"MONTH",(function(){return un})),n.d(v,"QUARTER",(function(){return sn})),n.d(v,"SECONDS",(function(){return mn})),n.d(v,"TIME_UNITS",(function(){return vn})),n.d(v,"WEEK",(function(){return ln})),n.d(v,"YEAR",(function(){return an})),n.d(v,"dayofyear",(function(){return Cn})),n.d(v,"timeBin",(function(){return ur})),n.d(v,"timeFloor",(function(){return In})),n.d(v,"timeInterval",(function(){return Vn})),n.d(v,"timeOffset",(function(){return Kn})),n.d(v,"timeSequence",(function(){return Qn})),n.d(v,"timeUnitSpecifier",(function(){return wn})),n.d(v,"timeUnits",(function(){return yn})),n.d(v,"utcFloor",(function(){return Wn})),n.d(v,"utcInterval",(function(){return Gn})),n.d(v,"utcOffset",(function(){return Xn})),n.d(v,"utcSequence",(function(){return Zn})),n.d(v,"utcdayofyear",(function(){return Dn})),n.d(v,"utcweek",(function(){return Fn})),n.d(v,"week",(function(){return _n})),n.d(v,"loader",(function(){return Qi})),n.d(v,"read",(function(){return Ji})),n.d(v,"inferType",(function(){return be})),n.d(v,"inferTypes",(function(){return ye})),n.d(v,"typeParsers",(function(){return me})),n.d(v,"format",(function(){return Ue})),n.d(v,"formats",(function(){return $e})),n.d(v,"responseType",(function(){return We})),n.d(v,"Bounds",(function(){return ep})),n.d(v,"CanvasHandler",(function(){return wg})),n.d(v,"CanvasRenderer",(function(){return kg})),n.d(v,"Gradient",(function(){return uh})),n.d(v,"GroupItem",(function(){return np})),n.d(v,"Handler",(function(){return lg})),n.d(v,"Item",(function(){return tp})),n.d(v,"Marks",(function(){return Ym})),n.d(v,"RenderType",(function(){return ov})),n.d(v,"Renderer",(function(){return fg})),n.d(v,"ResourceLoader",(function(){return rp})),n.d(v,"SVGHandler",(function(){return Sg})),n.d(v,"SVGRenderer",(function(){return Hg})),n.d(v,"SVGStringRenderer",(function(){return iv})),n.d(v,"Scenegraph",(function(){return tg})),n.d(v,"boundClip",(function(){return hv})),n.d(v,"boundContext",(function(){return Cp})),n.d(v,"boundItem",(function(){return Km})),n.d(v,"boundMark",(function(){return Jm})),n.d(v,"boundStroke",(function(){return ap})),n.d(v,"domChild",(function(){return og})),n.d(v,"domClear",(function(){return ag})),n.d(v,"domCreate",(function(){return rg})),n.d(v,"domFind",(function(){return ig})),n.d(v,"font",(function(){return $m})),n.d(v,"fontFamily",(function(){return Um})),n.d(v,"fontSize",(function(){return Bm})),n.d(v,"intersect",(function(){return uv})),n.d(v,"intersectBoxLine",(function(){return Pp})),n.d(v,"intersectPath",(function(){return Fp})),n.d(v,"intersectPoint",(function(){return Tp})),n.d(v,"intersectRule",(function(){return Np})),n.d(v,"lineHeight",(function(){return Lm})),n.d(v,"markup",(function(){return zg})),n.d(v,"multiLineOffset",(function(){return zm})),n.d(v,"pathCurves",(function(){return ch})),n.d(v,"pathEqual",(function(){return mv})),n.d(v,"pathParse",(function(){return hh})),n.d(v,"pathRectangle",(function(){return Bh})),n.d(v,"pathRender",(function(){return Ch})),n.d(v,"pathSymbols",(function(){return Sh})),n.d(v,"pathTrail",(function(){return Lh})),n.d(v,"point",(function(){return ug})),n.d(v,"renderModule",(function(){return sv})),n.d(v,"resetSVGClipId",(function(){return Qh})),n.d(v,"resetSVGDefIds",(function(){return gv})),n.d(v,"sceneEqual",(function(){return pv})),n.d(v,"sceneFromJSON",(function(){return eg})),n.d(v,"scenePickVisit",(function(){return Vp})),n.d(v,"sceneToJSON",(function(){return Zm})),n.d(v,"sceneVisit",(function(){return qp})),n.d(v,"sceneZOrder",(function(){return Hp})),n.d(v,"serializeXML",(function(){return Ig})),n.d(v,"textMetrics",(function(){return Dm})),n.d(v,"interpolate",(function(){return Nd})),n.d(v,"interpolateColors",(function(){return Fd})),n.d(v,"interpolateRange",(function(){return Dd})),n.d(v,"quantizeInterpolator",(function(){return Td})),n.d(v,"scale",(function(){return xd})),n.d(v,"scheme",(function(){return Rd})),n.d(v,"projection",(function(){return Fw})),n.d(v,"View",(function(){return bj})),n.d(v,"defaultLocale",(function(){return Ki})),n.d(v,"formatLocale",(function(){return Ui})),n.d(v,"locale",(function(){return Yi})),n.d(v,"resetDefaultLocale",(function(){return Xi})),n.d(v,"timeFormatLocale",(function(){return Vi})),n.d(v,"expressionFunction",(function(){return CS})),n.d(v,"parse",(function(){return qT})),n.d(v,"runtimeContext",(function(){return NS})),n.d(v,"version",(function(){return VT}));var b={};n.r(b),n.d(b,"invalidSpec",(function(){return NP})),n.d(b,"FIT_NON_SINGLE",(function(){return PP})),n.d(b,"containerSizeNonSingle",(function(){return BP})),n.d(b,"containerSizeNotCompatibleWithAutosize",(function(){return LP})),n.d(b,"droppingFit",(function(){return RP})),n.d(b,"unknownField",(function(){return zP})),n.d(b,"cannotProjectOnChannelWithoutField",(function(){return IP})),n.d(b,"cannotProjectAggregate",(function(){return UP})),n.d(b,"nearestNotSupportForContinuous",(function(){return $P})),n.d(b,"selectionNotSupported",(function(){return WP})),n.d(b,"selectionNotFound",(function(){return HP})),n.d(b,"SCALE_BINDINGS_CONTINUOUS",(function(){return qP})),n.d(b,"LEGEND_BINDINGS_MUST_HAVE_PROJECTION",(function(){return VP})),n.d(b,"noSameUnitLookup",(function(){return GP})),n.d(b,"NEEDS_SAME_SELECTION",(function(){return YP})),n.d(b,"INTERVAL_INITIALIZED_WITH_X_Y",(function(){return KP})),n.d(b,"noSuchRepeatedValue",(function(){return XP})),n.d(b,"columnsNotSupportByRowCol",(function(){return JP})),n.d(b,"CONCAT_CANNOT_SHARE_AXIS",(function(){return QP})),n.d(b,"unrecognizedParse",(function(){return ZP})),n.d(b,"differentParse",(function(){return eB})),n.d(b,"ADD_SAME_CHILD_TWICE",(function(){return tB})),n.d(b,"invalidTransformIgnored",(function(){return nB})),n.d(b,"NO_FIELDS_NEEDS_AS",(function(){return rB})),n.d(b,"customFormatTypeNotAllowed",(function(){return iB})),n.d(b,"projectionOverridden",(function(){return oB})),n.d(b,"REPLACE_ANGLE_WITH_THETA",(function(){return aB})),n.d(b,"primitiveChannelDef",(function(){return sB})),n.d(b,"invalidFieldType",(function(){return uB})),n.d(b,"invalidFieldTypeForCountAggregate",(function(){return lB})),n.d(b,"invalidAggregate",(function(){return cB})),n.d(b,"missingFieldType",(function(){return fB})),n.d(b,"droppingColor",(function(){return dB})),n.d(b,"emptyFieldDef",(function(){return hB})),n.d(b,"latLongDeprecated",(function(){return pB})),n.d(b,"LINE_WITH_VARYING_SIZE",(function(){return mB})),n.d(b,"incompatibleChannel",(function(){return gB})),n.d(b,"invalidEncodingChannel",(function(){return vB})),n.d(b,"facetChannelShouldBeDiscrete",(function(){return bB})),n.d(b,"facetChannelDropped",(function(){return yB})),n.d(b,"discreteChannelCannotEncode",(function(){return xB})),n.d(b,"rangeMarkAlignmentCannotBeExpression",(function(){return wB})),n.d(b,"lineWithRange",(function(){return OB})),n.d(b,"orientOverridden",(function(){return EB})),n.d(b,"CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN",(function(){return CB})),n.d(b,"RANGE_STEP_DEPRECATED",(function(){return _B})),n.d(b,"cannotUseScalePropertyWithNonColor",(function(){return kB})),n.d(b,"unaggregateDomainHasNoEffectForRawField",(function(){return AB})),n.d(b,"unaggregateDomainWithNonSharedDomainOp",(function(){return SB})),n.d(b,"unaggregatedDomainWithLogScale",(function(){return jB})),n.d(b,"cannotApplySizeToNonOrientedMark",(function(){return DB})),n.d(b,"scaleTypeNotWorkWithChannel",(function(){return FB})),n.d(b,"scaleTypeNotWorkWithFieldDef",(function(){return TB})),n.d(b,"scalePropertyNotWorkWithScaleType",(function(){return MB})),n.d(b,"scaleTypeNotWorkWithMark",(function(){return NB})),n.d(b,"stepDropped",(function(){return PB})),n.d(b,"mergeConflictingProperty",(function(){return BB})),n.d(b,"mergeConflictingDomainProperty",(function(){return LB})),n.d(b,"independentScaleMeansIndependentGuide",(function(){return RB})),n.d(b,"domainSortDropped",(function(){return zB})),n.d(b,"MORE_THAN_ONE_SORT",(function(){return IB})),n.d(b,"FACETED_INDEPENDENT_DIFFERENT_SOURCES",(function(){return UB})),n.d(b,"FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES",(function(){return $B})),n.d(b,"FACETED_INDEPENDENT_SAME_SOURCE",(function(){return WB})),n.d(b,"INVALID_CHANNEL_FOR_AXIS",(function(){return HB})),n.d(b,"cannotStackRangedMark",(function(){return qB})),n.d(b,"cannotStackNonLinearScale",(function(){return VB})),n.d(b,"stackNonSummativeAggregate",(function(){return GB})),n.d(b,"invalidTimeUnit",(function(){return YB})),n.d(b,"droppedDay",(function(){return KB})),n.d(b,"errorBarCenterAndExtentAreNotNeeded",(function(){return XB})),n.d(b,"errorBarCenterIsUsedWithWrongExtent",(function(){return JB})),n.d(b,"errorBarContinuousAxisHasCustomizedAggregate",(function(){return QB})),n.d(b,"errorBand1DNotSupport",(function(){return ZB})),n.d(b,"channelRequiredForBinned",(function(){return eL})),n.d(b,"channelShouldNotBeUsedForBinned",(function(){return tL})),n.d(b,"domainRequiredForThresholdScale",(function(){return nL}));var y={};n.r(y),n.d(y,"compile",(function(){return aK})),n.d(y,"deepEqual",(function(){return iM})),n.d(y,"duplicate",(function(){return oM})),n.d(y,"pick",(function(){return aM})),n.d(y,"omit",(function(){return sM})),n.d(y,"stringify",(function(){return uM})),n.d(y,"hash",(function(){return lM})),n.d(y,"isNullOrFalse",(function(){return cM})),n.d(y,"contains",(function(){return fM})),n.d(y,"some",(function(){return dM})),n.d(y,"every",(function(){return hM})),n.d(y,"mergeDeep",(function(){return pM})),n.d(y,"unique",(function(){return gM})),n.d(y,"isEqual",(function(){return vM})),n.d(y,"setEqual",(function(){return bM})),n.d(y,"hasIntersection",(function(){return yM})),n.d(y,"prefixGenerator",(function(){return xM})),n.d(y,"fieldIntersection",(function(){return wM})),n.d(y,"isEmpty",(function(){return OM})),n.d(y,"keys",(function(){return EM})),n.d(y,"vals",(function(){return CM})),n.d(y,"entries",(function(){return _M})),n.d(y,"isBoolean",(function(){return kM})),n.d(y,"varName",(function(){return AM})),n.d(y,"logicalExpr",(function(){return SM})),n.d(y,"deleteNestedProperty",(function(){return jM})),n.d(y,"titleCase",(function(){return DM})),n.d(y,"accessPathWithDatum",(function(){return FM})),n.d(y,"flatAccessWithDatum",(function(){return TM})),n.d(y,"replacePathInField",(function(){return NM})),n.d(y,"replaceAll",(function(){return PM})),n.d(y,"removePathFromField",(function(){return BM})),n.d(y,"accessPathDepth",(function(){return LM})),n.d(y,"getFirstDefined",(function(){return RM})),n.d(y,"uniqueId",(function(){return IM})),n.d(y,"resetIdCounter",(function(){return UM})),n.d(y,"internalField",(function(){return $M})),n.d(y,"isInternalField",(function(){return WM})),n.d(y,"normalizeAngle",(function(){return HM})),n.d(y,"isNumeric",(function(){return qM})),n.d(y,"normalize",(function(){return D$})),n.d(y,"version",(function(){return GT.a}));var x={};n.r(x),n.d(x,"dark",(function(){return cK})),n.d(x,"excel",(function(){return fK})),n.d(x,"fivethirtyeight",(function(){return dK})),n.d(x,"ggplot2",(function(){return hK})),n.d(x,"latimes",(function(){return gK})),n.d(x,"quartz",(function(){return vK})),n.d(x,"vox",(function(){return bK})),n.d(x,"urbaninstitute",(function(){return xK})),n.d(x,"version",(function(){return wK}));var w=n(5),O=n.n(w),E=n(1),C=n.n(E);function _(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){e.done?i(e.value):new n((function(t){t(e.value)})).then(a,s)}u((r=r.apply(e,t||[])).next())}))} +/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017 Joachim Wester + * MIT license + */ +var k=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)}}(),A=Object.prototype.hasOwnProperty;function S(e,t){return A.call(e,t)}function j(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&t<=57))return!1;n++}return!0}function T(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function M(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function N(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 P=function(e){function t(t,n,r,i,o){var a=this.constructor,s=e.call(this,N(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=N(t,{name:n,index:r,operation:i,tree:o}),s}return k(t,e),t}(Error),B=P,L=D,R={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=I(n,this.path);r&&(r=D(r));var i=U(n,{op:"remove",path:this.from}).removed;return U(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=I(n,this.from);return U(n,{op:"add",path:this.path,value:D(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:V(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},z={add:function(e,t,n){return F(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:R.move,copy:R.copy,test:R.test,_get:R._get};function I(e,t){if(""==t)return e;var n={op:"_get",path:t};return U(e,n),n.value}function U(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):H(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=I(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=V(e,t.value),!1===a.test)throw new B("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 B("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return a}r||(e=D(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:H;;){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&&!F(d))throw new B("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);F(d)&&(d=~~d)}if(l>=c){if(n&&"add"===t.op&&d>u.length)throw new B("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 B("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(d&&-1!=d.indexOf("~")&&(d=M(d)),l>=c){if(!1===(a=R[t.op].call(t,u,d,e)).test)throw new B("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}u=u[d]}}function $(e,t,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),n&&!Array.isArray(t))throw new B("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(e=D(e));for(var o=new Array(t.length),a=0,s=t.length;a0)throw new B('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 B("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 B("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;n0&&(e.patches=[],e.callback&&e.callback(r)),r}function Z(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=j(t),a=j(e),s=!1,u=a.length-1;u>=0;u--){var l=e[f=a[u]];if(!S(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+"/"+T(f),value:D(l)}),n.push({op:"remove",path:r+"/"+T(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?Z(l,c,n,r+"/"+T(f),i):l!==c&&(!0,i&&n.push({op:"test",path:r+"/"+T(f),value:D(l)}),n.push({op:"replace",path:r+"/"+T(f),value:D(c)}))}}if(s||o.length!=a.length)for(u=0;unew Promise((n,r)=>{e.readFile(t,(e,t)=>{e?r(e):n(t)})}):fe}async function fe(){Object(ie.o)("No file system access.")}function de(e){return e?async function(t,n){const r=Object(ie.p)({},this.options.http,n),i=n&&n.response,o=await e(t,r);return o.ok?Object(ie.E)(o[i])?o[i]():o.text():Object(ie.o)(o.status+""+o.statusText)}:he}async function he(){Object(ie.o)("No HTTP fetch method available.")}const pe=e=>!(Number.isNaN(+e)||e instanceof Date),me={boolean:ie.cb,integer:ie.eb,number:ie.eb,date:ie.db,string:ie.gb,unknown:ie.y},ge=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>pe(e)&&Number.isInteger(+e),pe,e=>!Number.isNaN(Date.parse(e))],ve=["boolean","integer","number","date"];function be(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=ge.length,i=ge.map((e,t)=>t+1);for(let a,s,u=0,l=0;u0===e?t:e,0)-1]}function ye(e,t){return t.reduce((t,n)=>(t[n]=be(e,n),t),{})}var xe={},we={};function Oe(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function Ee(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 Ce(e,t){var n=e+"",r=n.length;return r9999?"+"+Ce(t,6):Ce(t,4))+"-"+Ce(e.getUTCMonth()+1,2)+"-"+Ce(e.getUTCDate(),2)+(o?"T"+Ce(n,2)+":"+Ce(r,2)+":"+Ce(i,2)+"."+Ce(o,3)+"Z":i?"T"+Ce(n,2)+":"+Ce(r,2)+":"+Ce(i,2)+"Z":r||n?"T"+Ce(n,2)+":"+Ce(r,2)+"Z":"")}var ke=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,i=[],o=e.length,a=0,s=0,u=o<=0,l=!1;function c(){if(u)return we;if(l)return l=!1,xe;var t,r,i=a;if(34===e.charCodeAt(i)){for(;a++=o?u=!0:10===(r=e.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===e.charCodeAt(a)&&++a),e.slice(i+1,t-1).replace(/""/g,'"')}for(;a1)r=Re(e,t,n);else for(i=0,r=new Array(o=e.arcs.length);ie!==t,exterior:(e,t)=>e===t};function Ie(e,t){let n,r,i,o;return e=Object(je.a)(e,t),t&&t.feature?(n=Te,i=t.feature):t&&t.mesh?(n=Be,i=t.mesh,o=ze[t.filter]):Object(ie.o)("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):Object(ie.o)("Invalid TopoJSON object: "+i),r&&r.features||[r]}Ie.responseType="json";const Ue={dsv:Se,csv:Ae(","),tsv:Ae("\t"),json:je.a,topojson:Ie};function $e(e,t){return arguments.length>1?(Ue[e]=t,this):Object(ie.w)(Ue,e)?Ue[e]:null}function We(e){const t=$e(e);return t&&t.responseType||"text"}var He=Math.sqrt(50),qe=Math.sqrt(10),Ve=Math.sqrt(2),Ge=function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s=0?(o>=He?10:o>=qe?5:o>=Ve?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=He?10:o>=qe?5:o>=Ve?2:1)}function Ke(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=He?i*=10:o>=qe?i*=5:o>=Ve&&(i*=2),t=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Je(e){if(!(t=Xe.exec(e)))throw new Error("invalid format: "+e);var t;return new Qe({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 Qe(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+""}Je.prototype=Qe.prototype,Qe.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 Ze(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)]}var et,tt,nt,rt,it=function(e){return(e=Ze(Math.abs(e)))?e[1]:NaN},ot=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(it(t)/3)))-it(Math.abs(e)))},at=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,it(t)-it(e))+1},st=function(e){return Math.max(0,-it(Math.abs(e)))},ut=function(e,t){var n=Ze(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},lt={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},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)=>ut(100*e,t),r:ut,s:function(e,t){var n=Ze(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(et=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Ze(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)},ct=function(e){return e},ft=Array.prototype.map,dt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],ht=function(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?ct:(t=ft.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)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?ct:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(ft.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=Je(e)).fill,n=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,m=e.comma,g=e.precision,v=e.trim,b=e.type;"n"===b?(m=!0,b="g"):lt[b]||(void 0===g&&(g=12),v=!0,b="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var y="$"===d?i:"#"===d&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",x="$"===d?o:/[%p]/.test(b)?u:"",w=lt[b],O=/[defgprs%]/.test(b);function E(e){var i,o,u,d=y,E=x;if("c"===b)E=w(e)+E,e="";else{var C=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:w(Math.abs(e),g),v&&(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)),C&&0==+e&&"+"!==f&&(C=!1),d=(C?"("===f?f:l:"-"===f||"("===f?"":f)+d,E=("s"===b?dt[8+et/3]:"")+E+(C&&"("===f?")":""),O)for(i=-1,o=e.length;++i(u=e.charCodeAt(i))||u>57){E=(46===u?a+e.slice(i+1):e.slice(i))+E,e=e.slice(0,i);break}}m&&!h&&(e=r(e,1/0));var _=d.length+e.length+E.length,k=_>1)+d+e+E+k.slice(_);break;default:e=k+d+e+E}return s(e)}return g=void 0===g?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),E.toString=function(){return e+""},E}return{format:f,formatPrefix:function(e,t){var n=f(((e=Je(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(it(t)/3))),i=Math.pow(10,-r),o=dt[8+r/3];return function(e){return n(i*e)+o}}}};tt=ht({thousands:",",grouping:[3],currency:["$",""]}),nt=tt.format,rt=tt.formatPrefix;var pt=new Date,mt=new Date;function gt(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a=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&&(i.count=function(t,r){return pt.setTime(+t),mt.setTime(+r),e(pt),e(mt),Math.floor(n(pt,mt))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var vt=gt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5,e=>e.getDate()-1),bt=vt;vt.range;function yt(e){return gt((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-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var xt=yt(0),wt=yt(1),Ot=yt(2),Et=yt(3),Ct=yt(4),_t=yt(5),kt=yt(6),At=(xt.range,wt.range,Ot.range,Et.range,Ct.range,_t.range,kt.range,gt((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}))),St=At;At.range;function jt(e){return gt((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)/6048e5}))}var Dt=jt(0),Ft=jt(1),Tt=jt(2),Mt=jt(3),Nt=jt(4),Pt=jt(5),Bt=jt(6),Lt=(Dt.range,Ft.range,Tt.range,Mt.range,Nt.range,Pt.range,Bt.range,gt((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()})));Lt.every=function(e){return isFinite(e=Math.floor(e))&&e>0?gt((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};var Rt=Lt,zt=(Lt.range,gt((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}))),It=zt,Ut=(zt.range,gt((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()}))),$t=Ut,Wt=(Ut.range,gt((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()}))),Ht=Wt,qt=(Wt.range,gt((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}))),Vt=qt,Gt=(qt.range,gt((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e})));Gt.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?gt((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):Gt:null};var Yt=Gt,Kt=(Gt.range,gt((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()})));Kt.every=function(e){return isFinite(e=Math.floor(e))&&e>0?gt((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};var Xt=Kt,Jt=(Kt.range,gt((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()}))),Qt=Jt,Zt=(Jt.range,gt((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()}))),en=Zt,tn=(Zt.range,gt((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()}))),nn=tn,rn=(tn.range,function(e,t){return et?1:e>=t?0:NaN}),on=function(e){let t=e,n=e;function r(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)=>rn(e(t),n)}(e)),{left:r,center:function(e,n,i,o){null==i&&(i=0),null==o&&(o=e.length);const a=r(e,n,i,o-1);return a>i&&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}}};const an="year",sn="quarter",un="month",ln="week",cn="date",fn="day",dn="dayofyear",hn="hours",pn="minutes",mn="seconds",gn="milliseconds",vn=[an,sn,un,ln,cn,fn,dn,hn,pn,mn,gn],bn=vn.reduce((e,t,n)=>(e[t]=1+n,e),{});function yn(e){const t=Object(ie.i)(e).slice(),n={};t.length||Object(ie.o)("Missing time unit."),t.forEach(e=>{Object(ie.w)(bn,e)?n[e]=1:Object(ie.o)("Invalid time unit: ".concat(e,"."))});return(n[ln]||n[fn]?1:0)+(n[sn]||n[un]||n[cn]?1:0)+(n[dn]?1:0)>1&&Object(ie.o)("Incompatible time units: ".concat(e)),t.sort((e,t)=>bn[e]-bn[t]),t}const xn={[an]:"%Y ",[sn]:"Q%q ",[un]:"%b ",[cn]:"%d ",[ln]:"W%U ",[fn]:"%a ",[dn]:"%j ",[hn]:"%H:00",[pn]:"00:%M",[mn]:":%S",[gn]:".%L",["".concat(an,"-").concat(un)]:"%Y-%m ",["".concat(an,"-").concat(un,"-").concat(cn)]:"%Y-%m-%d ",["".concat(hn,"-").concat(pn)]:"%H:%M"};function wn(e,t){const n=Object(ie.p)({},xn,t),r=yn(e),i=r.length;let o,a,s="",u=0;for(u=0;uu;--o)if(a=r.slice(u,o).join("-"),null!=n[a]){s+=n[a],u=o;break}return s.trim()}const On=new Date;function En(e){return On.setFullYear(e),On.setMonth(0),On.setDate(1),On.setHours(0,0,0,0),On}function Cn(e){return kn(new Date(e))}function _n(e){return An(new Date(e))}function kn(e){return bt.count(En(e.getFullYear())-1,e)}function An(e){return xt.count(En(e.getFullYear())-1,e)}function Sn(e){return En(e).getDay()}function jn(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 Dn(e){return Tn(new Date(e))}function Fn(e){return Mn(new Date(e))}function Tn(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return St.count(t-1,e)}function Mn(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Dt.count(t-1,e)}function Nn(e){return On.setTime(Date.UTC(e,0,1)),On.getUTCDay()}function Pn(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 Bn(e,t,n,r,i){const o=t||1,a=Object(ie.W)(e),s=(e,t,i)=>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[i=i||e],r[i],e===a&&o,t),u=new Date,l=Object(ie.fb)(e),c=l[an]?s(an):Object(ie.m)(2012),f=l[un]?s(un):l[sn]?s(sn):ie.mb,d=l[ln]&&l[fn]?s(fn,1,ln+fn):l[ln]?s(ln,1):l[fn]?s(fn,1):l[cn]?s(cn,1):l[dn]?s(dn,1):ie.Q,h=l[hn]?s(hn):ie.mb,p=l[pn]?s(pn):ie.mb,m=l[mn]?s(mn):ie.mb,g=l[gn]?s(gn):ie.mb;return function(e){u.setTime(+e);const t=c(u);return i(t,f(u),d(u,t),h(u),p(u),m(u),g(u))}}function Ln(e,t,n){return t+7*e-(n+6)%7}const Rn={[an]:e=>e.getFullYear(),[sn]:e=>Math.floor(e.getMonth()/3),[un]:e=>e.getMonth(),[cn]:e=>e.getDate(),[hn]:e=>e.getHours(),[pn]:e=>e.getMinutes(),[mn]:e=>e.getSeconds(),[gn]:e=>e.getMilliseconds(),[dn]:e=>kn(e),[ln]:e=>An(e),[ln+fn]:(e,t)=>Ln(An(e),e.getDay(),Sn(t)),[fn]:(e,t)=>Ln(1,e.getDay(),Sn(t))},zn={[sn]:e=>3*e,[ln]:(e,t)=>Ln(e,0,Sn(t))};function In(e,t){return Bn(e,t||1,Rn,zn,jn)}const Un={[an]:e=>e.getUTCFullYear(),[sn]:e=>Math.floor(e.getUTCMonth()/3),[un]:e=>e.getUTCMonth(),[cn]:e=>e.getUTCDate(),[hn]:e=>e.getUTCHours(),[pn]:e=>e.getUTCMinutes(),[mn]:e=>e.getUTCSeconds(),[gn]:e=>e.getUTCMilliseconds(),[dn]:e=>Tn(e),[ln]:e=>Mn(e),[fn]:(e,t)=>Ln(1,e.getUTCDay(),Nn(t)),[ln+fn]:(e,t)=>Ln(Mn(e),e.getUTCDay(),Nn(t))},$n={[sn]:e=>3*e,[ln]:(e,t)=>Ln(e,0,Nn(t))};function Wn(e,t){return Bn(e,t||1,Un,$n,Pn)}const Hn={[an]:Rt,[sn]:It.every(3),[un]:It,[ln]:xt,[cn]:bt,[fn]:bt,[dn]:bt,[hn]:$t,[pn]:Ht,[mn]:Vt,[gn]:Yt},qn={[an]:Xt,[sn]:Qt.every(3),[un]:Qt,[ln]:Dt,[cn]:St,[fn]:St,[dn]:St,[hn]:en,[pn]:nn,[mn]:Vt,[gn]:Yt};function Vn(e){return Hn[e]}function Gn(e){return qn[e]}function Yn(e,t,n){return e?e.offset(t,n):void 0}function Kn(e,t,n){return Yn(Vn(e),t,n)}function Xn(e,t,n){return Yn(Gn(e),t,n)}function Jn(e,t,n,r){return e?e.range(t,n,r):void 0}function Qn(e,t,n,r){return Jn(Vn(e),t,n,r)}function Zn(e,t,n,r){return Jn(Gn(e),t,n,r)}const er=[an,un,cn,hn,pn,mn,gn],tr=er.slice(0,-1),nr=tr.slice(0,-1),rr=nr.slice(0,-1),ir=rr.slice(0,-1),or=[an,un],ar=[an],sr=[[tr,1,1e3],[tr,5,5e3],[tr,15,15e3],[tr,30,3e4],[nr,1,6e4],[nr,5,3e5],[nr,15,9e5],[nr,30,18e5],[rr,1,36e5],[rr,3,108e5],[rr,6,216e5],[rr,12,432e5],[ir,1,864e5],[[an,ln],1,6048e5],[or,1,2592e6],[or,3,7776e6],[ar,1,31536e6]];function ur(e){const t=e.extent,n=e.maxbins||40,r=Math.abs(Object(ie.Z)(t))/n;let i,o,a=on(e=>e[2]).right(sr,r);return a===sr.length?(i=ar,o=Ke(t[0]/31536e6,t[1]/31536e6,n)):a?(a=sr[r/sr[a-1][2]=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Mi,s:Ni,S:ei,u:ti,U:ni,V:ii,w:oi,W:ai,x:null,X:null,y:si,Y:li,Z:fi,"%":Ti},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:di,e:di,f:vi,g:Si,G:Di,H:hi,I:pi,j:mi,L:gi,m:bi,M:yi,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Mi,s:Ni,S:xi,u:wi,U:Oi,V:Ci,w:_i,W:ki,x:null,X:null,y:Ai,Y:ji,Z:Fi,"%":Ti},w={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return C(e,t,n,r)},d:Br,e:Br,f:$r,g:Tr,G:Fr,H:Rr,I:Rr,j:Lr,L:Ur,m:Pr,M:zr,p:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:Nr,Q:Hr,s:qr,S:Ir,u:Ar,U:Sr,V:jr,w:kr,W:Dr,x:function(e,t,r){return C(e,n,t,r)},X:function(e,t,n){return C(e,r,t,n)},y:Tr,Y:Fr,Z:Mr,"%":Wr};function O(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 o||(o.w=1),"Z"in o?(i=(r=cr(fr(o.y,0,1))).getUTCDay(),r=i>4||0===i?Ft.ceil(r):Ft(r),r=St.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=lr(fr(o.y,0,1))).getDay(),r=i>4||0===i?wt.ceil(r):wt(r),r=bt.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?cr(fr(o.y,0,1)).getUTCDay():lr(fr(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,cr(o)):lr(o)}}function C(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=w[i in br?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return y.x=O(n,y),y.X=O(r,y),y.c=O(t,y),x.x=O(n,x),x.X=O(r,x),x.c=O(t,x),{format:function(e){var t=O(e+="",y);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=O(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e+="",!0);return t.toString=function(){return e},t}}}var hr,pr,mr,gr,vr,br={"-":"",_:" ",0:"0"},yr=/^\s*\d+/,xr=/^%/,wr=/[\\^$*+?|[\]().{}]/g;function Or(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[e.toLowerCase(),t]))}function kr(e,t,n){var r=yr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ar(e,t,n){var r=yr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Sr(e,t,n){var r=yr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function jr(e,t,n){var r=yr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Dr(e,t,n){var r=yr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Fr(e,t,n){var r=yr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Tr(e,t,n){var r=yr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Mr(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 Nr(e,t,n){var r=yr.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Pr(e,t,n){var r=yr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Br(e,t,n){var r=yr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Lr(e,t,n){var r=yr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Rr(e,t,n){var r=yr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function zr(e,t,n){var r=yr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ir(e,t,n){var r=yr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Ur(e,t,n){var r=yr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function $r(e,t,n){var r=yr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Wr(e,t,n){var r=xr.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Hr(e,t,n){var r=yr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function qr(e,t,n){var r=yr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Vr(e,t){return Or(e.getDate(),t,2)}function Gr(e,t){return Or(e.getHours(),t,2)}function Yr(e,t){return Or(e.getHours()%12||12,t,2)}function Kr(e,t){return Or(1+bt.count(Rt(e),e),t,3)}function Xr(e,t){return Or(e.getMilliseconds(),t,3)}function Jr(e,t){return Xr(e,t)+"000"}function Qr(e,t){return Or(e.getMonth()+1,t,2)}function Zr(e,t){return Or(e.getMinutes(),t,2)}function ei(e,t){return Or(e.getSeconds(),t,2)}function ti(e){var t=e.getDay();return 0===t?7:t}function ni(e,t){return Or(xt.count(Rt(e)-1,e),t,2)}function ri(e){var t=e.getDay();return t>=4||0===t?Ct(e):Ct.ceil(e)}function ii(e,t){return e=ri(e),Or(Ct.count(Rt(e),e)+(4===Rt(e).getDay()),t,2)}function oi(e){return e.getDay()}function ai(e,t){return Or(wt.count(Rt(e)-1,e),t,2)}function si(e,t){return Or(e.getFullYear()%100,t,2)}function ui(e,t){return Or((e=ri(e)).getFullYear()%100,t,2)}function li(e,t){return Or(e.getFullYear()%1e4,t,4)}function ci(e,t){var n=e.getDay();return Or((e=n>=4||0===n?Ct(e):Ct.ceil(e)).getFullYear()%1e4,t,4)}function fi(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Or(t/60|0,"0",2)+Or(t%60,"0",2)}function di(e,t){return Or(e.getUTCDate(),t,2)}function hi(e,t){return Or(e.getUTCHours(),t,2)}function pi(e,t){return Or(e.getUTCHours()%12||12,t,2)}function mi(e,t){return Or(1+St.count(Xt(e),e),t,3)}function gi(e,t){return Or(e.getUTCMilliseconds(),t,3)}function vi(e,t){return gi(e,t)+"000"}function bi(e,t){return Or(e.getUTCMonth()+1,t,2)}function yi(e,t){return Or(e.getUTCMinutes(),t,2)}function xi(e,t){return Or(e.getUTCSeconds(),t,2)}function wi(e){var t=e.getUTCDay();return 0===t?7:t}function Oi(e,t){return Or(Dt.count(Xt(e)-1,e),t,2)}function Ei(e){var t=e.getUTCDay();return t>=4||0===t?Nt(e):Nt.ceil(e)}function Ci(e,t){return e=Ei(e),Or(Nt.count(Xt(e),e)+(4===Xt(e).getUTCDay()),t,2)}function _i(e){return e.getUTCDay()}function ki(e,t){return Or(Ft.count(Xt(e)-1,e),t,2)}function Ai(e,t){return Or(e.getUTCFullYear()%100,t,2)}function Si(e,t){return Or((e=Ei(e)).getUTCFullYear()%100,t,2)}function ji(e,t){return Or(e.getUTCFullYear()%1e4,t,4)}function Di(e,t){var n=e.getUTCDay();return Or((e=n>=4||0===n?Nt(e):Nt.ceil(e)).getUTCFullYear()%1e4,t,4)}function Fi(){return"+0000"}function Ti(){return"%"}function Mi(e){return+e}function Ni(e){return Math.floor(+e/1e3)}function Pi(e){const t={};return n=>t[n]||(t[n]=e(n))}function Bi(e){const t=Pi(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=Je(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return function(e,t){return n=>{const r=e(n),i=r.indexOf(t);if(i<0)return r;let o=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}(r,i);const a=oi;)if("0"!==r[o]){++o;break}return r.slice(0,o)+a}}(t(n),t(".1f")(1)[1])}return t(n)},formatSpan(e,r,i,o){o=Je(null==o?",f":o);const a=Ke(e,r,i),s=Math.max(Math.abs(e),Math.abs(r));let u;if(null==o.precision)switch(o.type){case"s":return isNaN(u=ot(a,s))||(o.precision=u),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(u=at(a,s))||(o.precision=u-("e"===o.type));break;case"f":case"%":isNaN(u=st(a))||(o.precision=u-2*("%"===o.type))}return t(o)}}}let Li,Ri;function zi(){return Li=Bi({format:nt,formatPrefix:rt})}function Ii(e){return Bi(ht(e))}function Ui(e){return arguments.length?Li=Ii(e):Li}function $i(e,t,n){n=n||{},Object(ie.H)(n)||Object(ie.o)("Invalid time multi-format specifier: ".concat(n));const r=t(mn),i=t(pn),o=t(hn),a=t(cn),s=t(ln),u=t(un),l=t(sn),c=t(an),f=e(n[gn]||".%L"),d=e(n[mn]||":%S"),h=e(n[pn]||"%I:%M"),p=e(n[hn]||"%I %p"),m=e(n[cn]||n[fn]||"%a %d"),g=e(n[ln]||"%b %d"),v=e(n[un]||"%B"),b=e(n[sn]||"%B"),y=e(n[an]||"%Y");return e=>(r(e)Object(ie.J)(e)?t(e):$i(t,Vn,e),utcFormat:e=>Object(ie.J)(e)?n(e):$i(n,Gn,e),timeParse:Pi(e.parse),utcParse:Pi(e.utcParse)}}function Hi(){return Ri=Wi({format:pr,parse:mr,utcFormat:gr,utcParse:vr})}function qi(e){return Wi(dr(e))}function Vi(e){return arguments.length?Ri=qi(e):Ri}!function(e){hr=dr(e),pr=hr.format,mr=hr.parse,gr=hr.utcFormat,vr=hr.utcParse}({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"]}),zi(),Hi();const Gi=(e,t)=>Object(ie.p)({},e,t);function Yi(e,t){const n=e?Ii(e):Ui(),r=t?qi(t):Vi();return Gi(n,r)}function Ki(e,t){const n=arguments.length;return n&&2!==n&&Object(ie.o)("defaultLocale expects either zero or two arguments."),n?Gi(Ui(e),Vi(t)):Gi(Ui(),Vi())}function Xi(){return zi(),Hi(),Ki()}var Ji=function(e,t,n,r){const i=$e((t=t||{}).type||"json");return i||Object(ie.o)("Unknown data format type: "+t.type),e=i(e,t),t.parse&&function(e,t,n,r){if(!e.length)return;const i=Vi();n=n||i.timeParse,r=r||i.utcParse;let o,a,s,u,l,c,f=e.columns||Object.keys(e[0]);"auto"===t&&(t=ye(e,f));f=Object.keys(t);const d=f.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(!me[i])throw Error("Illegal format pattern: "+e+":"+i);return me[i]});for(s=0,l=e.length,c=f.length;s({options:n||{},sanitize:le,load:ue,fileAccess:!!t,file:ce(t),http:de(e)})}("undefined"!=typeof fetch&&fetch,null);function Zi(e){const t=e||ie.y,n=[],r={};return n.add=e=>{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 eo(e,t){try{await t(e)}catch(t){e.error(t)}}const to=Symbol("vega_id");let no=1;function ro(e){return!(!e||!io(e))}function io(e){return e[to]}function oo(e,t){return e[to]=t,e}function ao(e){const t=e===Object(e)?e:{data:e};return io(t)?t:oo(t,no++)}function so(e){return uo(e,ao({}))}function uo(e,t){for(const n in e)t[n]=e[n];return t}function lo(e,t){return oo(t,io(e))}function co(e,t){return e?t?(n,r)=>e(n,r)||io(t(n))-io(t(r)):(t,n)=>e(t,n)||io(t)-io(n):null}function fo(e){return e&&e.constructor===ho}function ho(){const e=[],t=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:ho,insert(t){const n=Object(ie.i)(t),r=n.length;for(let t=0;t{p(e)&&(l[io(e)]=-1)});for(f=0,d=e.length;f0&&(v(m,p,h.value),s.modifies(p));for(f=0,d=i.length;f{p(e)&&l[io(e)]>0&&v(e,h.field,h.value)}),s.modifies(h.field);if(a)s.mod=t.length||r.length?u.filter(e=>l[io(e)]>0):u.slice();else for(g in c)s.mod.push(c[g]);return(o||null==o&&(t.length||r.length))&&s.clean(!0),s}}}function po(){Object.defineProperty(this,"_:mod:_",{writable:!0,value:{}})}po.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(ie.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(ie.B)(e)){for(let t=0;t=0?t+1{a instanceof vo?(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(ie.i)(s).forEach(e=>{e instanceof vo?e!==this&&(e.targets().add(this),o.push(e)):Object(ie.o)("Pulse parameters must be operator instances.")}),this.source=s;else if(Object(ie.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=wo();return this.targets().add(wo(null,null,Object(ie.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(wo(null,null,()=>n=!0)),t.targets().add(wo(null,null,()=>n=!1)),this.filter(()=>n)},detach(){}};const Oo={skip:!0};function Eo(e,t,n,r,i,o){const a=Object(ie.p)({},o,Oo);let s,u;Object(ie.E)(n)||(n=Object(ie.m)(n)),void 0===r?s=t=>e.touch(n(t)):Object(ie.E)(r)?(u=new vo(null,r,i,!1),s=t=>{u.evaluate(t);const r=n(t),i=u.value;fo(i)?e.pulse(r,i,o):e.update(r,i,a)}):s=t=>e.update(n(t),r,a),t.apply(s)}function Co(e,t,n,r,i,o){if(void 0===r)t.targets().add(n);else{const a=o||{},s=new vo(null,function(e,t){return t=Object(ie.E)(t)?t:Object(ie.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 _o={};function ko(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 Ao(e,t){const n=[];return Object(ie.kb)(e,t,e=>n.push(e)),n}function So(e,t){const n={};return e.visit(t,e=>{n[io(e)]=1}),e=>n[io(e)]?null:e}function jo(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}function Do(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(ie.B)(e)?e.some(e=>n[e]):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=jo(n.addF,t)),2&e&&(n.remF=jo(n.remF,t)),4&e&&(n.modF=jo(n.modF,t)),16&e&&(n.srcF=jo(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=Ao(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=Ao(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=Ao(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(ie.kb)(n.source,n.srcF,r),n;1&e&&Object(ie.kb)(n.add,n.addF,r),2&e&&Object(ie.kb)(n.rem,n.remF,r),4&e&&Object(ie.kb)(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(ie.kb)(i,So(n,5),r):Object(ie.kb)(i,n.srcF,r))}return n}},Object(ie.z)(Do,ko,{fork(e){const t=new ko(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(ie.B)(e)?e.some(e=>n[e]):n[e]:0},filter(){Object(ie.o)("MultiPulse does not support filtering.")},materialize(){Object(ie.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),No(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,No(e,r,t,n)}(t,0,e)):r=n,r}}}function No(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 Po(){this.logger(Object(ie.M)()),this.logLevel(ie.b),this._clock=0,this._rank=0,this._locale=Ki();try{this._loader=Qi()}catch(e){}this._touched=Zi(ie.x),this._input={},this._pulse=null,this._heap=Mo((e,t)=>e.qrank-t.qrank),this._postrun=[]}function Bo(e){return function(){return this._log[e].apply(this,arguments)}}function Lo(e,t){vo.call(this,e,null,t)}Po.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:Bo("error"),warn:Bo("warn"),info:Bo("info"),debug:Bo("debug"),logLevel:Bo("level"),cleanThreshold:1e4,add:function(e,t,n,r){let i,o=1;return e instanceof vo?i=e:e&&e.prototype instanceof vo?i=new e:Object(ie.E)(e)?i=new vo(null,e):(o=0,i=new vo(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(ie.o)("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||To);const r=new ko(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||To;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const r=n||To;return(e.set(t)||r.force)&&this.touch(e,r),this},changeset:ho,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 Ji(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(ie.ib).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:We(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=wo(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(ie.i)(e);const u=s.length;for(let e=0;er._enqueue(e,!0)),r._touched=Zi(ie.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=_o),s!==_o&&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?Fo(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!==_o&&(e.source=t.source);return e}(this._pulse,n&&n.pulse)}},Object(ie.z)(Lo,vo,{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 Ro={};function zo(e){const t=Io(e);return t&&t.Definition||null}function Io(e){return e=e&&e.toLowerCase(),Object(ie.w)(Ro,e)?Ro[e]:null}function Uo(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 $o(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 Wo(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}var Ho=function(e){return null===e?NaN:+e};function qo(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 $o(e);if(t>=1)return Uo(e);var r,i=(r-1)*t,o=Math.floor(i),a=Uo(function e(t,n,r=0,i=t.length-1,o=rn){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(Wo(t,r,n),o(t[i],a)>0&&Wo(t,r,i);s0;)--u}0===o(t[r],a)?Wo(t,r,u):(++u,Wo(t,u,i)),u<=n&&(r=u+1),n<=u&&(i=u-1)}return t}(e,o).subarray(0,o+1));return a+($o(e.subarray(o+1))-a)*(i-o)}}function Vo(e,t,n=Ho){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 Go=function(e,t){return qo(e,.5,t)};function*Yo(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 Ko(e,t,n){const r=Float64Array.from(Yo(e,n));return r.sort(rn),t.map(e=>Vo(r,e))}function Xo(e,t){return Ko(e,[.25,.5,.75],t)}function Jo(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=Xo(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 Qo(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),m=Math.pow(n,-p-1);return(e.nice||void 0===e.nice)&&(u=Math.floor(f/o+m)*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 ra(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function ia(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*Zo()),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 oa=Math.sqrt(2*Math.PI),aa=Math.SQRT2;let sa=NaN;function ua(e,t){e=e||0,t=null==t?1:t;let n,r,i=0,o=0;if(sa==sa)i=sa,sa=NaN;else{do{i=2*Zo()-1,o=2*Zo()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,sa=o*r}return e+i*t}function la(e,t,n){const r=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*oa)}function ca(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 fa(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*aa*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 da(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:()=>ua(n,r),pdf:e=>la(e,n,r),cdf:e=>ca(e,n,r),icdf:e=>fa(e,n,r)};return i.mean(e).stdev(t)}function ha(e,t){const n=da();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=Jo(e)),i):t},sample:()=>e[~~(Zo()*r)]+t*n.sample(),pdf(i){let o=0,a=0;for(;apa(n,r),pdf:e=>ma(e,n,r),cdf:e=>ga(e,n,r),icdf:e=>va(e,n,r)};return i.mean(e).stdev(t)}function ya(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 Oa(e,t,n){return null==n&&(n=null==t?1:t,t=0),en?1:(e-t)/(n-t)}function Ea(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function Ca(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:()=>xa(n,r),pdf:e=>wa(e,n,r),cdf:e=>Oa(e,n,r),icdf:e=>Ea(e,n,r)};return null==t&&(t=null==e?1:e,e=0),i.min(e).max(t)}function _a(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 ka(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 Sa(e,t,n,r,i){let o=0,a=0;return Aa(e,t,n,(e,t)=>{const n=t-i(e),s=t-r;o+=n*n,a+=s*s}),1-o/a}function ja(e,t,n){let r=0,i=0,o=0,a=0,s=0;Aa(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=_a(r,i,o,a),l=e=>u[0]+u[1]*e;return{coef:u,predict:l,rSquared:Sa(e,t,n,i,l)}}function Da(e,t,n){let r=0,i=0,o=0,a=0,s=0;Aa(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=_a(r,i,o,a),l=e=>u[0]+u[1]*Math.log(e);return{coef:u,predict:l,rSquared:Sa(e,t,n,i,l)}}function Fa(e,t,n){const[r,i,o,a]=ka(e,t,n);let s,u,l,c=0,f=0,d=0,h=0,p=0;Aa(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[m,g]=_a(f/a,c/a,d/a,h/a),v=e=>Math.exp(m+g*(e-o));return{coef:[Math.exp(m-g*o),g],predict:v,rSquared:Sa(e,t,n,a,v)}}function Ta(e,t,n){let r=0,i=0,o=0,a=0,s=0,u=0;Aa(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=_a(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:Sa(e,t,n,s,c)}}function Ma(e,t,n){const[r,i,o,a]=ka(e,t,n),s=r.length;let u,l,c,f,d=0,h=0,p=0,m=0,g=0;for(u=0;uy*(e-=o)*e+x*e+w+a;return{coef:[w-x*o+y*o*o+a,x-2*y*o,y],predict:O,rSquared:Sa(e,t,n,a,O)}}function Na(e,t,n,r){if(1===r)return ja(e,t,n);if(2===r)return Ma(e,t,n);const[i,o,a,s]=ka(e,t,n),u=i.length,l=[],c=[],f=r+1;let d,h,p,m,g;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+v[0]+v[1]*e+v[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 Ba(e,t,n,r){const[i,o,a,s]=ka(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,m=0;const g=1/Math.abs(i[s]-n||1);for(let e=r;e<=a;++e){const t=i[e],r=o[e],a=La(Math.abs(n-t)*g)*d[e],s=t*a;u+=a,l+=s,h+=r*a,p+=r*s,m+=t*s}const[v,b]=_a(l/u,h/u,p/u,m/u);c[e]=v+b*n,f[e]=Math.abs(o[e]-c[e]),Ra(i,e+1,t)}if(2===e)break;const n=Go(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 za=.1*Math.PI/180;function Ia(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&&Ua(f,e,d)>za?c.push(e):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function Ua(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 $a=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{},Va={init:qa,add:qa,rem:qa,idx:0},Ga={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}},Ya=Object.keys(Ga);function Ka(e,t){return Ga[e](t)}function Xa(e,t){return e.idx-t.idx}function Ja(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.init(this))}function Qa(e,t){null!=e&&""!==e?e==e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t))):++this.missing}function Za(e,t){null!=e&&""!==e?e==e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t))):--this.missing}function es(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function ts(e,t){const n=t||ie.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]=Ga[e]())})};return e.forEach(n),Object.values(t).sort(Xa)}(e),i=e.slice().sort(Xa);function o(e){this._ops=r,this._out=i,this.cell=e,this.init()}return o.prototype.init=Ja,o.prototype.add=Qa,o.prototype.rem=Za,o.prototype.set=es,o.prototype.get=n,o.fields=e.map(e=>e.out),o}function ns(e){this._key=e?Object(ie.u)(e):io,this.reset()}Ya.forEach(e=>{Ga[e]=function(e,t){return n=>Object(ie.p)({name:e,out:n||e},Va,t)}(e,Ga[e])});const rs=ns.prototype;function is(e){Lo.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}rs.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},rs.add=function(e){this._add.push(e)},rs.rem=function(e){this._rem.push(e)},rs.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(ie.w)(n,r)||(n[r]=1,++o);return o},rs.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=Object(ie.r)(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},rs.argmin=function(e){return this.extent(e)[0]||{}},rs.argmax=function(e){return this.extent(e)[1]||{}},rs.min=function(e){const t=this.extent(e)[0];return null!=t?e(t):void 0},rs.max=function(e){const t=this.extent(e)[1];return null!=t?e(t):void 0},rs.quartile=function(e){return this._get===e&&this._q||(this._q=Xo(this.values(),e),this._get=e),this._q},rs.q1=function(e){return this.quartile(e)[0]},rs.q2=function(e){return this.quartile(e)[1]},rs.q3=function(e){return this.quartile(e)[2]},rs.ci=function(e){return this._get===e&&this._ci||(this._ci=ta(this.values(),1e3,.05,e),this._get=e),this._ci},rs.ci0=function(e){return this.ci(e)[0]},rs.ci1=function(e){return this.ci(e)[1]},is.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Ya},{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(ie.z)(is,Lo,{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(ie.h)(e);return i(e),n.push(t),t}),this.cellkey=e.key?e.key:Wa(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,m;for(u!==a.length&&Object(ie.o)("Unmatched number of fields and aggregate ops."),m=0;mts(e,e.field)),{}},cellkey:Wa(),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(ie.O)(e,i,o.sort(e)):i.concat(o),o=[]),i)}}function ss(e){Lo.call(this,[],e)}function us(e){vo.call(this,null,ls,e)}function ls(e){return this.value&&!e.modified()?this.value:Object(ie.l)(e.fields,e.orders)}function cs(e){Lo.call(this,null,e)}function fs(e){Lo.call(this,null,e)}os.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(ie.z)(os,Lo,{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(ie.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=Qo(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(ie.eb)(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(ie.f)(u,Object(ie.g)(t),e.name||"bin_"+Object(ie.h)(t))}}),ss.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},Object(ie.z)(ss,Lo,{transform(e,t){const n=t.fork(t.ALL),r=as(io,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(co(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),Object(ie.z)(us,vo),cs.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(ie.z)(cs,Lo,{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=ao({}),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)}}),fs.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},Object(ie.z)(fs,Lo,{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(ie.h)(e)):null}function vs(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(ie.o)("Invalid density method: "+a),e.extent||r.data||Object(ie.o)("Missing density extent parameter."),a=r[a];const s=e.as||["value","density"],u=Ia(a,e.extent||Object(ie.q)(r.data()),i,o).map(e=>{const t={};return t[s[0]]=e[0],t[s[1]]=e[1],ao(t)});this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});function bs(e){Lo.call(this,null,e)}bs.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 ys(e){vo.call(this,null,xs,e),this.modified(!0)}function xs(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Object(ie.f)(n=>t(n,e),Object(ie.g)(t),Object(ie.h)(t))}function ws(e){Lo.call(this,[void 0,void 0],e)}function Os(e,t){vo.call(this,e),this.parent=t,this.count=0}function Es(e){Lo.call(this,{},e),this._keys=Object(ie.t)();const t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,r=t.active;nObject(ie.u)(e)):Object(ie.u)(e.name,e.as)}function ks(e){Lo.call(this,Object(ie.t)(),e)}function As(e){Lo.call(this,[],e)}function Ss(e){Lo.call(this,[],e)}function js(e){Lo.call(this,null,e)}function Ds(e){Lo.call(this,[],e)}Object(ie.z)(bs,Lo,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,r=vs(t.source,e.groupby,ie.y),i=e.smooth||!1,o=e.field,a=e.step||((e,t)=>Object(ie.Z)(Object(ie.q)(e,t))/30)(n,o),s=co((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(ie.z)(ys,vo),ws.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Object(ie.z)(ws,Lo,{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(ie.eb)(r(e));null!=t&&(ta&&(a=t))}),!Number.isFinite(o)||!Number.isFinite(a)){let e=Object(ie.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(ie.z)(Os,vo,{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(ie.z)(Es,Lo,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){const i=this.value;let o,a,s=Object(ie.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=io(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(io(e),t),s(t).add(e)}),a||t.modified(r.fields)?t.visit(t.MOD,e=>{const t=io(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(io(e))).mod(e)}),a&&t.visit(t.REFLOW,e=>{const t=io(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(ie.z)(Cs,vo),ks.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Object(ie.z)(ks,Lo,{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=io(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=io(e);r.has(t)?r.delete(t):a.push(e)}),t.visit(t.ADD,t=>{u(t,e)?o.push(t):r.set(io(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}}),As.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(ie.z)(As,Lo,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=gs(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(ie.z)(Ds,Lo,{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=ao(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 Fs={value:"value",median:Go,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:$o,max:Uo},Ts=[];function Ms(e){Lo.call(this,[],e)}function Ns(e){is.call(this,e)}function Ps(e){Lo.call(this,null,e)}function Bs(e){vo.call(this,null,Ls,e)}function Ls(e){return this.value&&!e.modified()?this.value:Object(ie.K)(e.fields,e.flat)}function Rs(e){Lo.call(this,[],e),this._pending=null}function zs(e,t,n){n.forEach(ao);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 Is(e){Lo.call(this,{},e)}function Us(e){vo.call(this,null,$s,e)}function $s(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 Ws(e){vo.call(this,null,Hs,e)}function Hs(e){return this.value&&!e.modified()?this.value:e.values.reduce((e,t)=>e.concat(t),[])}function qs(e){Lo.call(this,null,e)}function Vs(e){is.call(this,e)}function Gs(e){Es.call(this,e)}function Ys(e){Lo.call(this,null,e)}function Ks(e){Lo.call(this,null,e)}function Xs(e){Lo.call(this,null,e)}Ms.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(ie.z)(Ms,Lo,{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||Fs.value;if(null!=Fs[n])return n===Fs.value?(t=void 0!==e.value?e.value:0,()=>t):Fs[n];Object(ie.o)("Unrecognized imputation method: "+n)}(e),p=function(e){const t=e.field;return e=>e?t(e):NaN}(e),m=Object(ie.h)(e.field),g=Object(ie.h)(e.key),v=(e.groupby||[]).map(ie.h),b=function(e,t,n,r){var i,o,a,s,u,l,c,f,d=e=>e(f),h=[],p=r?r.slice():[],m={},g={};for(p.forEach((e,t)=>m[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(ie.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=ha(t,a)[s],r=e.counts?t.length:1;Ia(n,c||Object(ie.q)(t),f,d).forEach(e=>{const n={};for(let e=0;e(this._pending=Object(ie.i)(e.data),e=>e.touch(this)))}}return n.request(e.url,e.format).then(e=>zs(this,t,Object(ie.i)(e.data)))}}),Is.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(ie.z)(Is,Lo,{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(ie.o)('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*l&&Object(ie.o)('The "as" parameter has too few output field names.'),h=h||i.map(ie.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(ie.z)(Us,vo),Object(ie.z)(Ws,vo),Object(ie.z)(qs,Lo,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),Vs.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:Ya,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},Object(ie.z)(Vs,is,{_transform:is.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(ie.g)(n).concat(Object(ie.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(ie.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(ie.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(ie.z)(Gs,Es,{transform(e,t){const n=e.subflow,r=e.field,i=e=>this.subflow(io(e),n,t,e);return(e.modified("field")||r&&t.modified(Object(ie.g)(r)))&&Object(ie.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(ao(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}}),Ys.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},Object(ie.z)(Ys,Lo,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=gs(e.fields,e.as||[]),o=r?(e,t)=>function(e,t,n,r){for(let i=0,o=n.length;i{const t=io(e);n.rem.push(a[t]),a[t]=null}),t.visit(t.ADD,e=>{const t=o(e,ao({}));a[io(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{n.mod.push(o(e,a[io(e)]))}),n}}),Object(ie.z)(Ks,Lo,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),Xs.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 Js(e){Lo.call(this,null,e)}function Qs(e){Lo.call(this,[],e),this.count=0}function Zs(e){Lo.call(this,null,e)}function eu(e){Lo.call(this,null,e),this.modified(!0)}function tu(e){Lo.call(this,null,e)}Object(ie.z)(Xs,Lo,{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=vs(t.materialize(t.SOURCE).source,e.groupby,e.field),o=(e.groupby||[]).map(ie.h),a=[],s=e.step||.01,u=e.probs||$a(s/2,1-1e-14,s),l=u.length;return i.forEach(e=>{const t=Ko(e,u);for(let n=0;n{const t=io(e);n.rem.push(r[t]),r[t]=null}),t.visit(t.ADD,e=>{const t=so(e);r[io(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{const t=r[io(e)];for(const r in e)t[r]=e[r],n.modifies(r);n.mod.push(t)})),n}}),Qs.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},Object(ie.z)(Qs,Lo,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce((e,t)=>(e[io(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[io(t)]&&n.rem.push(t),a[r]=e)),++s}if(t.rem.length&&(t.visit(t.REM,e=>{const t=io(e);o[t]&&(o[t]=-1,n.rem.push(e)),--s}),a=a.filter(e=>-1!==o[io(e)])),(t.rem.length||r)&&a.length{o[io(e)]||l(e)}),u=-1),r&&a.length>i){const e=a.length-i;for(let t=0;t{o[io(e)]&&n.mod.push(e)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=a.filter(e=>!o[io(e)])),this.count=s,this.value=n.source=a,n}}),Zs.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(ie.z)(Zs,Lo,{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=$a(e.start,e.stop,e.step||1).map(e=>{const t={};return t[r]=e,ao(t)}),n.add=t.add.concat(this.value),n}}),Object(ie.z)(eu,Lo,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const nu=["unit0","unit1"];function ru(e){Lo.call(this,Object(ie.t)(),e)}function iu(e){Lo.call(this,null,e)}tu.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:vn,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:nu}]},Object(ie.z)(tu,Lo,{transform(e,t){const n=e.field,r=!1!==e.interval,i="utc"===e.timezone,o=this._floor(e,t),a=(i?Gn:Vn)(o.unit).offset,s=e.as||nu,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(ie.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}:ur({extent:e.extent||Object(ie.q)(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=yn(r),a=this.value||{},s=(n?Wn:In)(o,i);return s.unit=Object(ie.W)(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}}),Object(ie.z)(ru,Lo,{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(ie.z)(iu,Lo,{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(co(e.sort)):t.source).map(e.field))}});const ou={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=ou.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(ie.o)("ntile num must be greater than zero.");const n=ou.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(ie.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(ie.h)(s),p=Ha(e,h,i[t]);if(d(s),o.push(p),Object(ie.w)(ou,e))a.push(function(e,t,n,r){const i=ou[e](t,n);return{init:i.init||ie.mb,update:function(e,t){t[r]=i.next(e)}}}(e,n[t],r[t],p));else{if(null==s&&"count"!==e&&Object(ie.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(Ka(e,p))}}),(l.length||c.length)&&(this.cell=function(e,t,n){e=e.map(e=>ts(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()},uu.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 su(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 yu=function e(t){function n(e){return 1===t?new pu(e):new bu(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function xu(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 wu(e,t){this._context=e,this._k=(1-t)/6}wu.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:xu(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:xu(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 Ou=function e(t){function n(e){return new wu(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Eu(e,t){this._context=e,this._k=(1-t)/6}Eu.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:xu(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 Cu=function e(t){function n(e){return new Eu(e,t)}return n.tension=function(t){return e(+t)},n}(0);function _u(e,t){this._context=e,this._k=(1-t)/6}_u.prototype={areaStart:mu,areaEnd:mu,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:xu(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 ku=function e(t){function n(e){return new _u(e,t)}return n.tension=function(t){return e(+t)},n}(0),Au=Math.abs,Su=Math.atan2,ju=Math.cos,Du=Math.max,Fu=Math.min,Tu=Math.sin,Mu=Math.sqrt,Nu=Math.PI,Pu=Nu/2,Bu=2*Nu;function Lu(e){return e>1?0:e<-1?Nu:Math.acos(e)}function Ru(e){return e>=1?Pu:e<=-1?-Pu:Math.asin(e)}function zu(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 Iu(e,t){this._context=e,this._alpha=t}Iu.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:zu(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 Uu=function e(t){function n(e){return t?new Iu(e,t):new wu(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function $u(e,t){this._context=e,this._alpha=t}$u.prototype={areaStart:mu,areaEnd:mu,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:zu(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 Wu=function e(t){function n(e){return t?new $u(e,t):new _u(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Hu(e,t){this._context=e,this._alpha=t}Hu.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:zu(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 qu=function e(t){function n(e){return t?new Hu(e,t):new Eu(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Vu(e){this._context=e}Vu.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 Gu=function(e){return new Vu(e)};function Yu(e){this._context=e}Yu.prototype={areaStart:mu,areaEnd:mu,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 Ku(e){return e<0?-1:1}function Xu(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(Ku(o)+Ku(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Ju(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Qu(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 Zu(e){this._context=e}function el(e){this._context=new tl(e)}function tl(e){this._context=e}function nl(e){this._context=e}function rl(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 ol=Math.PI,al=2*ol,sl=al-1e-6;function ul(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ll(){return new ul}ul.prototype=ll.prototype={constructor:ul,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,m=d*d+h*h,g=Math.sqrt(p),v=Math.sqrt(f),b=i*Math.tan((ol-Math.acos((p+f-m)/(2*g*v)))/2),y=b/v,x=b/g;Math.abs(y-1)>1e-6&&(this._+="L"+(e+y*l)+","+(t+y*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%al+al),f>sl?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>=ol)+","+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 cl=ll,fl=function(e){return function(){return e}};function dl(e){return e.innerRadius}function hl(e){return e.outerRadius}function pl(e){return e.startAngle}function ml(e){return e.endAngle}function gl(e){return e&&e.padAngle}function vl(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 bl(e,t,n,r,i,o,a){var s=e-n,u=t-r,l=(a?o:-o)/Mu(s*s+u*u),c=l*u,f=-l*s,d=e+c,h=t+f,p=n+c,m=r+f,g=(d+p)/2,v=(h+m)/2,b=p-d,y=m-h,x=b*b+y*y,w=i-o,O=d*m-p*h,E=(y<0?-1:1)*Mu(Du(0,w*w*x-O*O)),C=(O*y-b*E)/x,_=(-O*b-y*E)/x,k=(O*y+b*E)/x,A=(-O*b+y*E)/x,S=C-g,j=_-v,D=k-g,F=A-v;return S*S+j*j>D*D+F*F&&(C=k,_=A),{cx:C,cy:_,x01:-c,y01:-f,x11:C*(i/w-1),y11:_*(i/w-1)}}Array.prototype.slice;var yl=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)};function xl(e){return e[0]}function wl(e){return e[1]}var Ol=function(e,t){var n=fl(!0),r=null,i=Gu,o=null;function a(a){var s,u,l,c=(a=yl(a)).length,f=!1;for(null==r&&(o=i(l=cl())),s=0;s<=c;++s)!(s=c;--f)s.point(g[f],v[f]);s.lineEnd(),s.areaEnd()}m&&(g[l]=+e(d,l,u),v[l]=+t(d,l,u),s.point(r?+r(d,l,u):g[l],n?+n(d,l,u):v[l]))}if(h)return s=null,h+""||null}function l(){return Ol().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?xl:fl(+e),t="function"==typeof t?t:fl(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?wl:fl(+n),u.x=function(t){return arguments.length?(e="function"==typeof t?t:fl(+t),r=null,u):e},u.x0=function(t){return arguments.length?(e="function"==typeof t?t:fl(+t),u):e},u.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:fl(+e),u):r},u.y=function(e){return arguments.length?(t="function"==typeof e?e:fl(+e),n=null,u):t},u.y0=function(e){return arguments.length?(t="function"==typeof e?e:fl(+e),u):t},u.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:fl(+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:fl(!!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},Cl={draw:function(e,t){var n=Math.sqrt(t/Nu);e.moveTo(n,0),e.arc(0,0,n,0,Bu)}},_l=(Math.sqrt(1/3),Math.sin(Nu/10)/Math.sin(7*Nu/10));Math.sin(Bu/10),Math.cos(Bu/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12);function kl(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 Al=()=>"undefined"!=typeof Image?Image:null,Sl=on(rn),jl=Sl.right,Dl=Sl.left;on(Ho).center;var Fl=jl;function Tl(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Ml(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 Nl=Symbol("implicit");function Pl(){var e=new Map,t=[],n=[],r=Nl;function i(i){var o=i+"",a=e.get(o);if(!a){if(r!==Nl)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 Pl(t,n).unknown(r)},Tl.apply(i,arguments),i}function Bl(e,t,n,r){var i,o=Ke(e,t,n);switch((r=Je(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=ot(o,a))||(r.precision=i),rt(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=at(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=st(o))||(r.precision=i-2*("%"===r.type))}return nt(r)}var Ll=function(e,t,n){e.prototype=t.prototype=n,n.constructor=e};function Rl(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function zl(){}var Il="\\s*([+-]?\\d+)\\s*",Ul="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",$l="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wl=/^#([0-9a-f]{3,8})$/,Hl=new RegExp("^rgb\\("+[Il,Il,Il]+"\\)$"),ql=new RegExp("^rgb\\("+[$l,$l,$l]+"\\)$"),Vl=new RegExp("^rgba\\("+[Il,Il,Il,Ul]+"\\)$"),Gl=new RegExp("^rgba\\("+[$l,$l,$l,Ul]+"\\)$"),Yl=new RegExp("^hsl\\("+[Ul,$l,$l]+"\\)$"),Kl=new RegExp("^hsla\\("+[Ul,$l,$l,Ul]+"\\)$"),Xl={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 Jl(){return this.rgb().formatHex()}function Ql(){return this.rgb().formatRgb()}function Zl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Wl.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ec(t):3===n?new ic(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?tc(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?tc(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=Hl.exec(e))?new ic(t[1],t[2],t[3],1):(t=ql.exec(e))?new ic(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Vl.exec(e))?tc(t[1],t[2],t[3],t[4]):(t=Gl.exec(e))?tc(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Yl.exec(e))?uc(t[1],t[2]/100,t[3]/100,1):(t=Kl.exec(e))?uc(t[1],t[2]/100,t[3]/100,t[4]):Xl.hasOwnProperty(e)?ec(Xl[e]):"transparent"===e?new ic(NaN,NaN,NaN,0):null}function ec(e){return new ic(e>>16&255,e>>8&255,255&e,1)}function tc(e,t,n,r){return r<=0&&(e=t=n=NaN),new ic(e,t,n,r)}function nc(e){return e instanceof zl||(e=Zl(e)),e?new ic((e=e.rgb()).r,e.g,e.b,e.opacity):new ic}function rc(e,t,n,r){return 1===arguments.length?nc(e):new ic(e,t,n,null==r?1:r)}function ic(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function oc(){return"#"+sc(this.r)+sc(this.g)+sc(this.b)}function ac(){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 sc(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function uc(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fc(e,t,n,r)}function lc(e){if(e instanceof fc)return new fc(e.h,e.s,e.l,e.opacity);if(e instanceof zl||(e=Zl(e)),!e)return new fc;if(e instanceof fc)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 fc(a,s,u,e.opacity)}function cc(e,t,n,r){return 1===arguments.length?lc(e):new fc(e,t,n,null==r?1:r)}function fc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function dc(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 hc(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}Ll(zl,Zl,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Jl,formatHex:Jl,formatHsl:function(){return lc(this).formatHsl()},formatRgb:Ql,toString:Ql}),Ll(ic,rc,Rl(zl,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new ic(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new ic(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:oc,formatHex:oc,formatRgb:ac,toString:ac})),Ll(fc,cc,Rl(zl,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new fc(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new fc(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 ic(dc(e>=240?e-240:e+120,i,r),dc(e,i,r),dc(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 pc=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 vc(e,t){return function(n){return e+n*t}}function bc(e,t){var n=t-e;return n?vc(e,n>180||n<-180?n-360*Math.round(n/360):n):gc(isNaN(e)?t:e)}function yc(e){return 1==(e=+e)?xc: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):gc(isNaN(t)?n:t)}}function xc(e,t){var n=t-e;return n?vc(e,n):gc(isNaN(e)?t:e)}var wc=function e(t){var n=yc(t);function r(e,t){var r=n((e=rc(e)).r,(t=rc(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=xc(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 Oc(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:Dc(n,r)})),o=Mc.lastIndex;return ot&&(n=e,e=t,t=n),l=function(n){return Math.max(e,Math.min(t,n))}),r=u>2?$c:Uc,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),Dc)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,Lc),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=Bc,c()},f.clamp=function(e){return arguments.length?(l=!!e||zc,c()):l!==zc},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 qc(){return Hc()(zc,zc)}function Vc(e){var t=e.domain;return e.ticks=function(e){var n=t();return Ge(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Bl(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=Ye(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 Gc(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;m.push(f)}}else for(;d<=h;++d)for(c=o-1,l=n(d);c>=1;--c)if(!((f=l*c)u)break;m.push(f)}2*m.length180?t+=360:t-e>180&&(e+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Dc(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:Dc(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:Dc(e,n)},{i:s-2,x:Dc(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 If(e){return e>6/29?e*e*e:6/29*3*(6/29)*(e-4/29)}function Uf(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function $f(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Wf(e){if(e instanceof qf)return new qf(e.h,e.c,e.l,e.opacity);if(e instanceof Rf||(e=Bf(e)),0===e.a&&0===e.b)return new qf(NaN,00?r:1:0}const cd="log",fd="time",dd="utc",hd="continuous";function pd(){const e=Pl().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,jl(a,f)-1),l=f===d?u:jl(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 pd().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(u).align(l)},c()}var md=Array.prototype.map;function gd(e){return md.call(e,ie.eb)}const vd=Array.prototype.slice;const bd={};function yd(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(ie.fb)(Object(ie.i)(n)),r}function xd(e,t,n){return arguments.length>1?(bd[e]=yd(e,t,n),this):wd(e)?bd[e]:void 0}function wd(e){return Object(ie.w)(bd,e)}function Od(e,t){const n=bd[e];return n&&n.metadata[t]}function Ed(e){return Od(e,hd)}function Cd(e){return Od(e,"discrete")}function _d(e){return Od(e,"discretizing")}function kd(e){return Od(e,cd)}function Ad(e){return Od(e,"interpolating")}function Sd(e){return Od(e,"quantile")}xd("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,Lc),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,Lc):[0,1],Vc(r)})),xd("linear",(function e(){var t=qc();return t.copy=function(){return Wc(t,e())},Tl.apply(t,arguments),Vc(t)}),hd),xd(cd,(function e(){var t=ef(Hc()).domain([1,10]);return t.copy=function(){return Wc(t,e()).base(t.base())},Tl.apply(t,arguments),t}),[hd,cd]),xd("pow",af,hd),xd("sqrt",(function(){return af.apply(null,arguments).exponent(.5)}),hd),xd("symlog",(function e(){var t=lf(Hc());return t.copy=function(){return Wc(t,e()).constant(t.constant())},Tl.apply(t,arguments)}),hd),xd(fd,(function(){return Tl.apply(df(Rt,It,xt,bt,$t,Ht,Vt,Yt,pr).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[hd,"temporal"]),xd(dd,(function(){return Tl.apply(df(Xt,Qt,Dt,St,en,nn,Vt,Yt,gr).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[hd,"temporal"]),xd("sequential",mf,[hd,"interpolating"]),xd("".concat("sequential","-").concat("linear"),mf,[hd,"interpolating"]),xd("".concat("sequential","-").concat(cd),(function e(){var t=ef(hf()).domain([1,10]);return t.copy=function(){return pf(t,e()).base(t.base())},Ml.apply(t,arguments)}),[hd,"interpolating",cd]),xd("".concat("sequential","-").concat("pow"),gf,[hd,"interpolating"]),xd("".concat("sequential","-").concat("sqrt"),(function(){return gf.apply(null,arguments).exponent(.5)}),[hd,"interpolating"]),xd("".concat("sequential","-").concat("symlog"),(function e(){var t=lf(hf());return t.copy=function(){return pf(t,e()).constant(t.constant())},Ml.apply(t,arguments)}),[hd,"interpolating"]),xd("".concat("diverging","-").concat("linear"),(function e(){var t=Vc(bf()(zc));return t.copy=function(){return pf(t,e())},Ml.apply(t,arguments)}),[hd,"interpolating"]),xd("".concat("diverging","-").concat(cd),(function e(){var t=ef(bf()).domain([.1,1,10]);return t.copy=function(){return pf(t,e()).base(t.base())},Ml.apply(t,arguments)}),[hd,"interpolating",cd]),xd("".concat("diverging","-").concat("pow"),yf,[hd,"interpolating"]),xd("".concat("diverging","-").concat("sqrt"),(function(){return yf.apply(null,arguments).exponent(.5)}),[hd,"interpolating"]),xd("".concat("diverging","-").concat("symlog"),(function e(){var t=lf(bf());return t.copy=function(){return pf(t,e()).constant(t.constant())},Ml.apply(t,arguments)}),[hd,"interpolating"]),xd("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)},Tl.apply(Vc(s),arguments)}),"discretizing"),xd("threshold",(function e(){var t,n=[.5],r=[0,1],i=1;function o(e){return e<=e?r[Fl(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)},Tl.apply(o,arguments)}),"discretizing"),xd("bin-ordinal",(function e(){let t=[],n=[];function r(e){return null==e||e!=e?void 0:n[(Fl(t,e)-1)%n.length]}return r.domain=function(e){return arguments.length?(t=gd(e),r):t.slice()},r.range=function(e){return arguments.length?(n=vd.call(e),r):n.slice()},r.tickFormat=function(e,n){return Bl(t[0],Object(ie.W)(t),null==e?10:e,n)},r.copy=function(){return e().domain(r.domain()).range(r.range())},r}),["discrete","discretizing"]),xd("ordinal",Pl,"discrete"),xd("band",pd,"discrete"),xd("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}(pd().paddingInner(1))}),"discrete");const jd=["clamp","base","constant","exponent"];function Dd(e,t){const n=t[0],r=Object(ie.W)(t)-n;return function(t){return e(n+t*r)}}function Fd(e,t,n){return vf(Nd(t||"rgb",n),e)}function Td(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[t]?a[t](e[t]()):0),a):Object(ie.m)(.5)}function Nd(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 Pd(e){const t=e.length/6|0,n=new Array(t);for(let r=0;r1?(Ld[e]=t,this):Ld[e]}Bd({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"},Pd),Bd({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=>Fd(Pd(e)));const zd=e=>Object(ie.B)(e)?e.map(e=>String(e)):String(e),Id=(e,t)=>e[1]-t[1],Ud=(e,t)=>t[1]-e[1];function $d(e,t,n){let r;return Object(ie.G)(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(Object(ie.Z)(e.domain())/n||1)))),Object(ie.H)(t)&&(r=t.step,t=t.interval),Object(ie.J)(t)&&(t=e.type===fd?Vn(t):e.type==dd?Gn(t):Object(ie.o)("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function Wd(e,t,n){let r=e.range(),i=r[0],o=Object(ie.W)(r),a=Id;if(i>o&&(r=o,o=i,i=r,a=Ud),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(ie.W)(t)];for(;t.length>n&&t.length>=3;)t=t.filter((e,t)=>!(t%2));t.length<3&&(t=e)}return t}function Hd(e,t){return e.bins?Wd(e,e.bins):e.ticks?e.ticks(t):e.domain()}function qd(e,t,n,r,i,o){const a=t.type;let s=zd;if(a===fd||i===fd)s=e.timeFormat(r);else if(a===dd||i===dd)s=e.utcFormat(r);else if(kd(a)){const i=e.formatFloat(r);if(o||t.bins)s=i;else{const e=Vd(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 Vd(e,t,n){const r=Hd(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;oGd[e.type]||e.bins)(t)?Jd(s):"discrete"===r?Zd(s):eh(s)}const Jd=e=>(t,n,r)=>{const i=Qd(r[n+1],Qd(r.max,1/0)),o=th(t,e),a=th(i,e);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},Qd=(e,t)=>null!=e?e:t,Zd=e=>(t,n)=>n?e(t):null,eh=e=>t=>e(t),th=(e,t)=>Number.isFinite(e)?t(e):null;function nh(e,t,n,r){const i=r||t.type;return Object(ie.J)(n)&&Od(i,"temporal")&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==fd?n||i!==dd?Xd(e,t,5,null,n,r,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function rh(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=nh(e,t,n.format,n.formatType);if(_d(t.type)){const e=Kd(t).slice(1).map(i),n=e.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(e.join(", "))}if(Cd(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(ie.W)(e)))}}let ih=0;function oh(e){return e&&e.gradient}function ah(e,t,n){const r=e.gradient;let i=e.id,o="radial"===r?"p_":"";return i||(i=e.id="gradient_"+ih++,"radial"===r?(e.x1=sh(e.x1,.5),e.y1=sh(e.y1,.5),e.r1=sh(e.r1,0),e.x2=sh(e.x2,.5),e.y2=sh(e.y2,.5),e.r2=sh(e.r2,.5),o="p_"):(e.x1=sh(e.x1,0),e.y1=sh(e.y1,0),e.x2=sh(e.x2,1),e.y2=sh(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function sh(e,t){return null!=e?e:t}function uh(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 lh={basis:{curve:function(e){return new pu(e)}},"basis-closed":{curve:function(e){return new gu(e)}},"basis-open":{curve:function(e){return new vu(e)}},bundle:{curve:yu,tension:"beta",value:.85},cardinal:{curve:Ou,tension:"tension",value:0},"cardinal-open":{curve:Cu,tension:"tension",value:0},"cardinal-closed":{curve:ku,tension:"tension",value:0},"catmull-rom":{curve:Uu,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Wu,tension:"alpha",value:.5},"catmull-rom-open":{curve:qu,tension:"alpha",value:.5},linear:{curve:Gu},"linear-closed":{curve:function(e){return new Yu(e)}},monotone:{horizontal:function(e){return new el(e)},vertical:function(e){return new Zu(e)}},natural:{curve:function(e){return new nl(e)}},step:{curve:function(e){return new il(e,.5)}},"step-after":{curve:function(e){return new il(e,1)}},"step-before":{curve:function(e){return new il(e,0)}}};function ch(e,t,n){var r=Object(ie.w)(lh,e)&&lh[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const fh={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},dh=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];function hh(e){const t=[];let n,r,i,o,a,s,u,l,c,f;const d=e.slice().replace(dh[0],"###$1").split(dh[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&&(m=Math.sqrt(m),n*=m,r*=m);const g=d/n,v=f/n,b=-f/r,y=d/r,x=g*s+v*u,w=b*s+y*u,O=g*e+v*t,E=b*e+y*t,C=(O-x)*(O-x)+(E-w)*(E-w);let _=1/C-.25;_<0&&(_=0);let k=Math.sqrt(_);o==i&&(k=-k);const A=.5*(x+O)-k*(E-w),S=.5*(w+E)+k*(O-x),j=Math.atan2(w-S,x-A),D=Math.atan2(E-S,O-A);let F=D-j;F<0&&1===o?F+=gh:F>0&&0===o&&(F-=gh);const T=Math.ceil(Math.abs(F/(mh+.001))),M=[];for(let e=0;e+e}function Ph(e,t,n){return Math.max(t,Math.min(e,n))}function Bh(){var e=Dh,t=Fh,n=Th,r=Mh,i=Nh(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),m=+n.call(this,l),g=+r.call(this,l),v=Math.min(m,g)/2,b=Ph(+i.call(this,l),0,v),y=Ph(+o.call(this,l),0,v),x=Ph(+a.call(this,l),0,v),w=Ph(+s.call(this,l),0,v);if(u||(u=d=cl()),b<=0&&y<=0&&x<=0&&w<=0)u.rect(h,p,m,g);else{var O=h+m,E=p+g;u.moveTo(h+b,p),u.lineTo(O-y,p),u.bezierCurveTo(O-.448084975506*y,p,O,p+.448084975506*y,O,p+y),u.lineTo(O,E-w),u.bezierCurveTo(O,E-.448084975506*w,O-.448084975506*w,E,O-w,E),u.lineTo(h+x,E),u.bezierCurveTo(h+.448084975506*x,E,h,E-.448084975506*x,h,E-x),u.lineTo(h,p+b),u.bezierCurveTo(h,p+.448084975506*b,h+.448084975506*b,p,h+b,p),u.closePath()}if(d)return u=null,d+""||null}return l.x=function(t){return arguments.length?(e=Nh(t),l):e},l.y=function(e){return arguments.length?(t=Nh(e),l):t},l.width=function(e){return arguments.length?(n=Nh(e),l):n},l.height=function(e){return arguments.length?(r=Nh(e),l):r},l.cornerRadius=function(e,t,n,r){return arguments.length?(i=Nh(e),o=null!=t?Nh(t):i,s=null!=n?Nh(n):i,a=null!=r?Nh(r):o,l):i},l.context=function(e){return arguments.length?(u=null==e?null:e,l):u},l}function Lh(){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,gh);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=cl()),a=0;a<=f;++a)!(ae.x||0,Ih=e=>e.y||0,Uh=e=>!(!1===e.defined),$h=function(){var e=dl,t=hl,n=fl(0),r=null,i=pl,o=ml,a=gl,s=null;function u(){var u,l,c=+e.apply(this,arguments),f=+t.apply(this,arguments),d=i.apply(this,arguments)-Pu,h=o.apply(this,arguments)-Pu,p=Au(h-d),m=h>d;if(s||(s=u=cl()),f1e-12)if(p>Bu-1e-12)s.moveTo(f*ju(d),f*Tu(d)),s.arc(0,0,f,d,h,!m),c>1e-12&&(s.moveTo(c*ju(h),c*Tu(h)),s.arc(0,0,c,h,d,m));else{var g,v,b=d,y=h,x=d,w=h,O=p,E=p,C=a.apply(this,arguments)/2,_=C>1e-12&&(r?+r.apply(this,arguments):Mu(c*c+f*f)),k=Fu(Au(f-c)/2,+n.apply(this,arguments)),A=k,S=k;if(_>1e-12){var j=Ru(_/c*Tu(C)),D=Ru(_/f*Tu(C));(O-=2*j)>1e-12?(x+=j*=m?1:-1,w-=j):(O=0,x=w=(d+h)/2),(E-=2*D)>1e-12?(b+=D*=m?1:-1,y-=D):(E=0,b=y=(d+h)/2)}var F=f*ju(b),T=f*Tu(b),M=c*ju(w),N=c*Tu(w);if(k>1e-12){var P,B=f*ju(y),L=f*Tu(y),R=c*ju(x),z=c*Tu(x);if(p1e-12?S>1e-12?(g=bl(R,z,F,T,f,S,m),v=bl(B,L,M,N,f,S,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),S1e-12&&O>1e-12?A>1e-12?(g=bl(M,N,B,L,c,-A,m),v=bl(F,T,R,z,c,-A,m),s.lineTo(g.cx+g.x01,g.cy+g.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),Wh=El().x(zh).y1(Ih).y0(e=>(e.y||0)+(e.height||0)).defined(Uh),Hh=El().y(Ih).x1(zh).x0(e=>(e.x||0)+(e.width||0)).defined(Uh),qh=Ol().x(zh).y(Ih).defined(Uh),Vh=Bh().x(zh).y(Ih).width(e=>e.width||0).height(e=>e.height||0).cornerRadius(e=>Rh(e.cornerRadiusTopLeft,e.cornerRadius)||0,e=>Rh(e.cornerRadiusTopRight,e.cornerRadius)||0,e=>Rh(e.cornerRadiusBottomRight,e.cornerRadius)||0,e=>Rh(e.cornerRadiusBottomLeft,e.cornerRadius)||0),Gh=function(e,t){var n=null;function r(){var r;if(n||(n=r=cl()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+""||null}return e="function"==typeof e?e:fl(e||Cl),t="function"==typeof t?t:fl(void 0===t?64:+t),r.type=function(t){return arguments.length?(e="function"==typeof t?t:fl(t),r):e},r.size=function(e){return arguments.length?(t="function"==typeof e?e:fl(+e),r):t},r.context=function(e){return arguments.length?(n=null==e?null:e,r):n},r}().type(e=>Sh(e.shape||"circle")).size(e=>Rh(e.size,64)),Yh=Lh().x(zh).y(Ih).defined(Uh).size(e=>e.size||1);function Kh(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Xh(e,t,n,r){return Vh.context(e)(t,n,r)}var Jh=1;function Qh(){Jh=1}function Zh(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+Jh++),a=i.clipping[o]||(i.clipping[o]={id:o});return Object(ie.E)(r)?a.path=r(null):Kh(n)?a.path=Xh(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function ep(e){this.clear(),e&&this.union(e)}function tp(e){this.mark=e,this.bounds=this.bounds||new ep}function np(e){tp.call(this,e),this.items=this.items||[]}function rp(e){this._pending=0,this._loader=e||Qi()}function ip(e){e._pending+=1}function op(e){e._pending-=1}function ap(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}ep.prototype={clone(){return new ep(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(ie.z)(np,tp),rp.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return ip(t),t._loader.sanitize(e,{context:"href"}).then(e=>(op(t),e)).catch(()=>(op(t),null))},loadImage(e){const t=this,n=Al();return ip(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(ie.w)(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>op(t),i.onerror=()=>op(t),i.src=r,i}).catch(e=>(op(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 sp=gh-1e-8;let up,lp,cp,fp,dp,hp,pp,mp;const gp=(e,t)=>up.add(e,t),vp=(e,t)=>gp(lp=e,cp=t),bp=e=>gp(e,up.y1),yp=e=>gp(up.x1,e),xp=(e,t)=>dp*e+pp*t,wp=(e,t)=>hp*e+mp*t,Op=(e,t)=>gp(xp(e,t),wp(e,t)),Ep=(e,t)=>vp(xp(e,t),wp(e,t));function Cp(e,t){return up=e,t?(fp=t*ph,dp=mp=Math.cos(fp),hp=Math.sin(fp),pp=-hp):(dp=mp=1,fp=hp=pp=0),_p}const _p={beginPath(){},closePath(){},moveTo:Ep,lineTo:Ep,rect(e,t,n,r){fp?(Op(e+n,t),Op(e+n,t+r),Op(e,t+r),Ep(e,t)):(gp(e+n,t+r),vp(e,t))},quadraticCurveTo(e,t,n,r){const i=xp(e,t),o=wp(e,t),a=xp(n,r),s=wp(n,r);kp(lp,i,a,bp),kp(cp,o,s,yp),vp(a,s)},bezierCurveTo(e,t,n,r,i,o){const a=xp(e,t),s=wp(e,t),u=xp(n,r),l=wp(n,r),c=xp(i,o),f=wp(i,o);Ap(lp,a,u,c,bp),Ap(cp,s,l,f,yp),vp(c,f)},arc(e,t,n,r,i,o){if(r+=fp,i+=fp,lp=n*Math.cos(i)+e,cp=n*Math.sin(i)+t,Math.abs(i-r)>sp)gp(e-n,t-n),gp(e+n,t+n);else{const a=r=>gp(n*Math.cos(r)+e,n*Math.sin(r)+t);let s,u;if(a(r),a(i),i!==r)if((r%=gh)<0&&(r+=gh),(i%=gh)<0&&(i+=gh),ii;++u,s-=mh)a(s);else for(s=r-r%mh+mh,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,0g)return!1;h>m&&(m=h)}else if(f>0){if(h0&&(e.globalAlpha=n,e.fillStyle=zp(e,t,t.fill),!0)}var Up=[];function $p(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=zp(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||Up),e.lineDashOffset=t.strokeDashOffset||0),!0))}function Wp(e,t){return e.zindex-t.zindex||e.index-t.index}function Hp(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 Gp(e){return function(t,n,r){qp(n,n=>{r&&!r.intersects(n.bounds)||Yp(e,t,n,n)})}}function Yp(e,t,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(e(t,r)||(Bp(t,n),n.fill&&Ip(t,n,i)&&t.fill(),n.stroke&&$p(t,n,i)&&t.stroke()))}function Kp(e){return e=e||ie.ib,function(t,n,r,i,o,a){return r*=t.pixelRatio,i*=t.pixelRatio,Vp(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 Xp(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 Jp(e){return Kp(Xp(e))}function Qp(e,t){return"translate("+e+","+t+")"}function Zp(e){return"rotate("+e+")"}function em(e){return Qp(e.x||0,e.y||0)}function tm(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*=ph),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 Qp(e.x||0,e.y||0)+(e.angle?" "+Zp(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(Cp(e,n.angle),n),ap(e,n).translate(n.x||0,n.y||0)},draw:Gp(r),pick:Jp(r),isect:n||Fp(r)}}var nm=tm("arc",(function(e,t){return $h.context(e)(t)}));function rm(e,t,n){function r(e,n){e.beginPath(),t(e,n)}const i=Xp(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(Cp(e),r),ap(e,r[0]))},draw:(o=r,function(e,t,n){!t.items.length||n&&!n.intersects(t.bounds)||Yp(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:Tp,tip:n};var o}var im=rm("area",(function(e,t){const n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Hh:Wh).curve(ch(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 sm(e,t){const n=am(t);e("d",Xh(null,t,n,n))}function um(e,t,n,r){const i=am(t);e.beginPath(),Xh(e,t,(n||0)+i,(r||0)+i)}const lm=Xp(um),cm=Xp(um,!1),fm=Xp(um,!0);var dm={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",em(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&&(um(e,t,r,i),Bp(e,t),t.fill&&Ip(e,t,a)&&e.fill(),t.stroke&&!o&&$p(e,t,a)&&e.stroke()),e.save(),e.translate(r,i),t.clip&&om(e,t),n&&n.translate(-r,-i),qp(t,t=>{this.draw(e,t,n)}),n&&n.translate(r,i),e.restore(),o&&t.stroke&&a&&(um(e,t,r,i),Bp(e,t),$p(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 Vp(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),m=u.clip;if(m&&(ih||op))return;if(e.save(),e.translate(c,f),c=i-c,f=o-f,m&&Kh(u)&&!fm(e,u,a,s))return e.restore(),null;const g=u.strokeForeground,v=!1!==t.interactive;return v&&g&&u.stroke&&cm(e,u,a,s)?(e.restore(),u):(l=Vp(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&&v&&(u.fill||!g&&u.stroke)&&lm(e,u,a,s)&&(l=u),e.restore(),l||null)})},isect:Mp,content:function(e,t,n){e("clip-path",t.clip?Zh(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),sm(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?sm(e,t):e("d","")}},hm={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function pm(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 mm(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 gm(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 vm(e,t){return"center"===e?t/2:"right"===e?t:0}function bm(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var ym={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const r=pm(t,n),i=mm(t,r),o=gm(t,r),a=(t.x||0)-vm(t.align,i),s=(t.y||0)-bm(t.baseline,o);e("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",hm["xmlns:xlink"],"xlink:href"),e("transform",Qp(a,s)),e("width",i),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,r=mm(t,n),i=gm(t,n),o=(t.x||0)-vm(t.align,r),a=(t.y||0)-bm(t.baseline,i);return e.set(o,a,o+r,a+i)},draw:function(e,t,n){qp(t,t=>{if(n&&!n.intersects(t.bounds))return;const r=pm(t,this);let i,o,a,s,u=mm(t,r),l=gm(t,r),c=(t.x||0)-vm(t.align,u),f=(t.y||0)-bm(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&&_m(e,t,r)&&(Bp(e,t),e.stroke())}})},pick:Kp((function(e,t,n,r){return!!e.isPointInStroke&&(_m(e,t,1)&&e.isPointInStroke(n,r))})),isect:Np},Am=tm("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),Sm=tm("symbol",(function(e,t){return Gh.context(e)(t)}),Tp);const jm=Object(ie.N)();var Dm={height:Bm,measureWidth:Nm,estimateWidth:Tm,width:Tm,canvas:Fm};function Fm(e){Dm.width=e&&jp?Nm:Tm}function Tm(e,t){return Mm(Im(e,t),Bm(e))}function Mm(e,t){return~~(.8*e.length*t)}function Nm(e,t){return Bm(e)<=0||!(t=Im(e,t))?0:Pm(t,$m(e))}function Pm(e,t){const n="(".concat(t,") ").concat(e);let r=jm.get(n);return void 0===r&&(jp.font=t,r=jp.measureText(e).width,jm.set(n,r)),r}function Bm(e){return null!=e.fontSize?+e.fontSize||0:11}function Lm(e){return null!=e.lineHeight?e.lineHeight:Bm(e)+2}function Rm(e){return t=e.lineBreak&&e.text&&!Object(ie.B)(e.text)?e.text.split(e.lineBreak):e.text,Object(ie.B)(t)?t.length>1?t:t[0]:t;var t}function zm(e){const t=Rm(e);return(Object(ie.B)(t)?t.length-1:0)*Lm(e)}function Im(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(Dm.width===Nm){const t=$m(e);return e=>Pm(e,t)}{const t=Bm(e);return e=>Mm(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,Dm.width(t,n)),0)):r=Dm.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*ph,s,u);else if(2===n)return e.rotatedPoints(t.angle*ph,s,u);return e}var Ym={arc:nm,area:im,group:dm,image:ym,line:xm,path:Om,rect:Cm,rule:km,shape:Am,symbol:Sm,text:{type:"text",tag:"text",nested:!1,attr:function(e,t){var n,r=t.dx||0,i=(t.dy||0)+Wm(t),o=Vm(t),a=o.x1,s=o.y1,u=t.angle||0;e("text-anchor",Hm[t.align]||"start"),u?(n=Qp(a,s)+" "+Zp(u),(r||i)&&(n+=" "+Qp(r,i))):n=Qp(a+r,s+i),e("transform",n)},bound:Gm,draw:function(e,t,n){qp(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=$m(t),e.textAlign=t.align||"left",i=(r=Vm(t)).x1,o=r.y1,t.angle&&(e.save(),e.translate(i,o),e.rotate(t.angle*ph),i=o=0),i+=t.dx||0,o+=(t.dy||0)+Wm(t),u=Rm(t),Bp(e,t),Object(ie.B)(u))for(s=Lm(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 Km(e,t,n){var r=Ym[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new ep),e,n)}var Xm={mark:null};function Jm(e,t,n){var r,i,o,a,s=Ym[e.marktype],u=s.bound,l=e.items,c=l&&l.length;if(s.nested)return c?o=l[0]:(Xm.mark=e,o=Xm),a=Km(o,u,n),t=t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new ep,c)for(r=0,i=l.length;rt;)e.removeChild(n[--r]);return e}function sg(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function ug(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function lg(e,t){this._active=null,this._handlers={},this._loader=e||Qi(),this._tooltip=t||cg}function cg(e,t,n,r){e.element().setAttribute("title",r||"")}function fg(e){this._el=null,this._bgcolor=null,this._loader=new rp(e)}tg.prototype={toJSON(e){return Zm(this.root,e||0)},mark(e,t,n){const r=ng(e,t=t||this.root.items[0]);return t.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},lg.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=rg(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=Ym[a.marktype]).tip){for((o=ug(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}}},fg.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 dg="dragleave",hg="mousedown",pg="mousemove",mg="mouseout",gg="click",vg=["keydown","keypress","keyup","dragenter",dg,"dragover",hg,"mouseup",pg,mg,"mouseover",gg,"dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],bg=pg,yg=mg,xg=gg;function wg(e,t){lg.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function Og(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 Eg(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 Cg(e){return function(t){this.fire(e,t),this._active=null}}Object(ie.z)(wg,lg,{initialize(e,t,n){return this._canvas=e&&ig(e,"canvas"),[gg,hg,pg,mg,dg].forEach(e=>Og(this,e)),lg.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:vg,DOMMouseScroll(e){this.fire("mousewheel",e)},mousemove:Eg(pg,"mouseover",mg),dragover:Eg("dragover","dragenter",dg),mouseout:Cg(mg),dragleave:Cg(dg),mousedown(e){this._down=this._active,this.fire(hg,e)},click(e){this._down===this._active&&(this.fire(gg,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===xg&&r&&r.href?this.handleHref(t,r,r.href):e!==bg&&e!==yg||this.handleTooltip(t,r,e!==yg),i)for(let e=0,n=i.length;e=0&&r.splice(i,1),this},pickEvent(e){const t=ug(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 Ym[e.marktype].pick.call(this,o,e,t,n,r,i)}});var _g="undefined"!=typeof window&&window.devicePixelRatio||1;function kg(e){fg.call(this,e),this._options={},this._redraw=!1,this._dirty=new ep,this._tempb=new ep}const Ag=fg.prototype;function Sg(e,t){lg.call(this,e,t);const n=this;n._hrefHandler=jg(n,(e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)}),n._tooltipHandler=jg(n,(e,t)=>{n.handleTooltip(e,t,e.type!==yg)})}Object(ie.z)(kg,fg,{initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:kl(1,1,this._options.type),e&&this._canvas&&(ag(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Ag.initialize.call(this,e,t,n,r,i)},resize(e,t,n,r){if(Ag.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?_g: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(ie.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 ep).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=Ym[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),Object(ie.E)(n)?(e.beginPath(),n(e),e.clip()):om(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 jg=(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(ie.z)(Sg,lg,{initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(xg,this._hrefHandler),r.removeEventListener(bg,this._tooltipHandler),r.removeEventListener(yg,this._tooltipHandler)),this._svg=r=e&&ig(e,"svg"),r&&(r.addEventListener(xg,this._hrefHandler),r.addEventListener(bg,this._tooltipHandler),r.addEventListener(yg,this._tooltipHandler)),lg.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:jg(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 Dg=(e,t,n)=>({role:e,"aria-roledescription":t,"aria-label":n||void 0}),Fg=Object(ie.fb)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Tg={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,r=t.title?Lg(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(Cd(s)?"discrete":s," scale")+" with ".concat(rh(a,o,e))}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?Lg(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(ie.W)(e)}(o))+" with ".concat(rh(u,s,e));var l}},"title-text":{desc:"title",caption:e=>"Title text '".concat(Bg(e),"'")},"title-subtitle":{desc:"subtitle",caption:e=>"Subtitle text '".concat(Bg(e),"'")}},Mg={ariaRole:"role",ariaRoleDescription:"aria-roledescription",description:"aria-label"};function Ng(e,t){const n=!1===t.aria;if(e("aria-hidden",n||void 0),n||null==t.description)for(const t in Mg)e(Mg[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 Pg(e){return!1===e.aria?{"aria-hidden":!0}:Fg[e.role]?null:Tg[e.role]?function(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return Dg(t.role||"graphics-symbol",t.desc,n.description||r(n))}catch(e){return null}}(e,Tg[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some(e=>null!=e.description&&!1!==e.aria);return Dg(n?"graphics-object":"graphics-symbol","".concat(t," mark container"),e.description)}(e)}function Bg(e){return Object(ie.i)(e.text).join(" ")}function Lg(e){try{return Object(ie.i)(Object(ie.W)(e.items).items[0].text).join(" ")}catch(e){return null}}const Rg=e=>(e+"").replace(/&/g,"&").replace(//g,">");function zg(){let e="",t="",n="";const r=[],i=()=>t=n="",o=(e,n)=>(null!=n&&(t+=" ".concat(e,'="').concat(Rg(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+=Rg(e),a),toString:()=>e};return a}const Ig=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(ie.z)(Hg,fg,{initialize(e,t,n,r,i){return this._defs={},this._clearDefs(),e&&(this._svg=og(e,0,"svg",Wg),tv(this._svg,hm),this._svg.setAttribute("class","marks"),ag(e,1),this._root=og(this._svg,0,"g",Wg),tv(this._root,$g),ag(this._svg,1)),this.background(this._bgcolor),qg.initialize.call(this,e,t,n,r,i)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),qg.background.apply(this,arguments)},resize(e,t,n,r){return qg.resize.call(this,e,t,n,r),this._svg&&(tv(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=og(e,0,"rect",Wg),tv(n,{width:this._width,height:this._height,fill:t}));const r=Ig(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),ag(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,Vg(n,t)),n._update=t)));return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const r=this._svg,i=Ym[t.marktype],o=!1===t.interactive?"none":null,a="g"===i.tag;let s=null,u=0;const l=Kg(t,e,n,"g",r);l.setAttribute("class",sg(t));const c=Pg(t);for(const e in c)nv(l,e,c[e]);a||nv(l,"pointer-events",o),nv(l,"clip-path",t.clip?Zh(this,t,t.group):null);const f=e=>{const t=this.isDirty(e),n=Kg(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;qp(n,n=>{r=e.mark(t,n,r),++i}),ag(t,1+i)}(this,n,e)),s=n,++u};return i.nested?t.items.length&&f(t.items[0]):qp(t,f),ag(l,u),l},_update(e,t,n){Xg=t,Jg=t.__values__,Ng(Zg,n),e.attr(Zg,n,this);const r=Qg[e.type];r&&r.call(this,e,t,n),Xg&&this.style(Xg,n)},style(e,t){if(null!=t)for(const n in Ug){let r="font"===n?Um(t):t[n];if(r===Jg[n])continue;const i=Ug[n];null==r?e.removeAttribute(i):(oh(r)&&(r=ah(r,this._defs.gradient,rv())),e.setAttribute(i,r+"")),Jg[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=og(e,1,"defs",Wg)),r=Gg(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=og(e,1,"defs",Wg)),r=Yg(n,t.clipping[i],r);n&&(0===r?(e.removeChild(n),t.el=null):ag(n,r))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});let Xg=null,Jg=null;const Qg={group(e,t,n){const r=Xg=t.childNodes[2];Jg=r.__values__,e.foreground(Zg,n,this),Jg=t.__values__,Xg=t.childNodes[1],e.content(Zg,n,this);const i=Xg=t.childNodes[0];e.background(Zg,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==Jg.events&&(nv(r,"pointer-events",o),nv(i,"pointer-events",o),Jg.events=o),n.strokeForeground&&n.stroke){const e=n.fill;nv(r,"display",null),this.style(i,n),nv(i,"stroke",null),e&&(n.fill=null),Jg=r.__values__,this.style(r,n),e&&(n.fill=e),Xg=null}else nv(r,"display","none")},image(e,t,n){!1===n.smooth?(ev(t,"image-rendering","optimizeSpeed"),ev(t,"image-rendering","pixelated")):ev(t,"image-rendering",null)},text(e,t,n){const r=Rm(n);let i,o,a,s;Object(ie.B)(r)?(o=r.map(e=>Im(n,e)),i=o.join("\n"),i!==Jg.text&&(ag(t,0),a=t.ownerDocument,s=Lm(n),o.forEach((e,r)=>{const i=rg(a,"tspan",Wg);i.__data__=n,i.textContent=e,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),t.appendChild(i)}),Jg.text=i)):(o=Im(n,r),o!==Jg.text&&(t.textContent=o,Jg.text=o)),nv(t,"font-family",Um(n)),nv(t,"font-size",Bm(n)+"px"),nv(t,"font-style",n.fontStyle),nv(t,"font-variant",n.fontVariant),nv(t,"font-weight",n.fontWeight)}};function Zg(e,t,n){t!==Jg[e]&&(n?function(e,t,n,r){null!=n?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}(Xg,e,t,n):nv(Xg,e,t),Jg[e]=t)}function ev(e,t,n){n!==Jg[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),Jg[t]=n)}function tv(e,t){for(const n in t)nv(e,n,t[n])}function nv(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function rv(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function iv(e){fg.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}Object(ie.z)(iv,fg,{svg(){return this._text},_render(e){const t=zg();t.open("svg",Object(ie.p)({},hm,{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",$g,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=Ym[t.marktype],r=n.tag,i=[Ng,n.attr];e.open("g",{class:sg(t),"clip-path":t.clip?Zh(this,t,t.group):null},Pg(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=Rm(o);if(Object(ie.B)(t)){const n={x:0,dy:Lm(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]):qp(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"]=Um(t),e["font-size"]=Bm(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const n in Ug){let r=t[n];const o=Ug[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(oh(r)&&(r=ah(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?(av[e]=t,this):av[e]}function uv(e,t,n){const r=[],i=(new ep).union(t),o=e.marktype;return o?lv(e,i,n,r):"group"===o?cv(e,i,n,r):Object(ie.o)("Intersect scene must be mark node or group item.")}function lv(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],!pv(e[n],t[n],n))return!1;return typeof e==typeof t}(e,t):e==t)}function mv(e,t){return pv(hh(e),hh(t))}function gv(){Qh(),ih=0}const vv="top",bv="left",yv="right",xv="end",wv="row";function Ov(e){Lo.call(this,null,e)}function Ev(e,t,n){return t(e.bounds.clear(),e,n)}Object(ie.z)(Ov,Lo,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=Ym[i],a=o.bound;let s,u=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),u=Ev(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(Ev(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(Ev(e,a))}),t.visit(t.MOD,e=>{s=s||u.alignsWith(e.bounds),n.dirty(e),u.union(Ev(e,a))}),s&&(u.clear(),r.items.forEach(e=>u.union(e.bounds)));return hv(r),t.modifies("bounds")}});function Cv(e){Lo.call(this,0,e)}function _v(e){Lo.call(this,null,e)}function kv(e){Lo.call(this,null,e)}Cv.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},Object(ie.z)(Cv,Lo,{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(ie.z)(_v,Lo,{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?np:tp;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 Av={parity:e=>e.filter((e,t)=>t%2?e.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((e,r)=>r&&Sv(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1))}},Sv=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),jv=(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},Fv=e=>(e.forEach(e=>e.opacity=1),e),Tv=(e,t)=>e.reflow(t.modified()).modifies("opacity");function Mv(e){Lo.call(this,null,e)}Object(ie.z)(kv,Lo,{transform(e,t){const n=Av[e.method]||Av.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")&&(Fv(a),t=Tv(t,e)),t;if(a=a.filter(Dv),!a.length)return;if(e.sort&&(a=a.slice().sort(e.sort)),i=Fv(a),t=Tv(t,e),i.length>=3&&jv(i,r)){do{i=n(i,r)}while(i.length>=3&&jv(i,r));i.length<3&&!Object(ie.W)(a).opacity&&(i.length>1&&(Object(ie.W)(i).opacity=0),Object(ie.W)(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 ep,u===vv||"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(ie.z)(Mv,Lo,{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 Nv=new ep;function Pv(e,t,n){return e[t]===n?0:(e[t]=n,1)}function Bv(e){var t=e.items[0].orient;return t===bv||t===yv}function Lv(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,m=a.maxExtent,g=s.title&&a.items[c[2]].items[0],v=a.titlePadding,b=a.bounds,y=g&&zm(g),x=0,w=0;switch(Nv.clear().union(b),b.clear(),(i=c[0])>-1&&b.union(a.items[i].bounds),(i=c[1])>-1&&b.union(a.items[i].bounds),l){case vv:x=h||0,w=-d,o=Math.max(p,Math.min(m,-b.y1)),b.add(0,-o).add(f,0),g&&Rv(e,g,o,v,y,0,-1,b);break;case bv:x=-d,w=h||0,o=Math.max(p,Math.min(m,-b.x1)),b.add(-o,0).add(0,f),g&&Rv(e,g,o,v,y,1,-1,b);break;case yv:x=n+d,w=h||0,o=Math.max(p,Math.min(m,b.x2)),b.add(0,0).add(o,f),g&&Rv(e,g,o,v,y,1,1,b);break;case"bottom":x=h||0,w=r+d,o=Math.max(p,Math.min(m,b.y2)),b.add(0,0).add(f,o),g&&Rv(e,g,o,v,0,0,1,b);break;default:x=a.x,w=a.y}return ap(b.translate(x,w),a),Pv(a,"x",x+u)|Pv(a,"y",w+u)&&(a.bounds=Nv,e.dirty(a),a.bounds=b,e.dirty(a)),a.mark.bounds.clear().union(b)}function Rv(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 zv=(e,t)=>Math.floor(Math.min(e,t)),Iv=(e,t)=>Math.ceil(Math.max(e,t));function Uv(e){return(new ep).set(0,0,e.width||0,e.height||0)}function $v(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function Wv(e,t,n){const r=Object(ie.H)(e)?e[t]:e;return null!=r?r:void 0!==n?n:0}function Hv(e){return e<0?Math.ceil(-e):0}function qv(e,t,n){var r,i,o,a,s,u,l,c,f,d,h,p=!n.nodirty,m="flush"===n.bounds?Uv:$v,g=Nv.set(0,0,0,0),v=Wv(n.align,"column"),b=Wv(n.align,wv),y=Wv(n.padding,"column"),x=Wv(n.padding,wv),w=n.columns||t.length,O=w<=0?1:Math.ceil(t.length/w),E=t.length,C=Array(E),_=Array(w),k=0,A=Array(E),S=Array(O),j=0,D=Array(E),F=Array(E),T=Array(E);for(i=0;i1)for(i=0;i0&&(D[i]+=f/2);if(b&&Wv(n.center,wv)&&1!==w)for(i=0;i0&&(F[i]+=d/2);for(i=0;ii&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),C+=o,m=0,v=t.length;m=0&&null==(x=n[g]);g-=d);s?(w=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),O=C):(w=C,O=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),b.union(y.bounds.translate(w-(y.x||0),O-(y.y||0))),y.x=w,y.y=O,e.dirty(y),_=a(_,b[l])}return _}function Kv(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 Xv(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===xv?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 bv:f.anchor={x:Math.floor(r.x1)-u,column:xv,y:c*(a||r.height()+2*r.y1),row:l};break;case yv:f.anchor={x:Math.ceil(r.x2)+u,y:c*(a||r.height()+2*r.y1),row:l};break;case vv:f.anchor={y:Math.floor(i.y1)-u,row:xv,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:xv};break;case"bottom-left":f.anchor={x:u,y:a-u,row:xv};break;case"bottom-right":f.anchor={x:o-u,y:a-u,column:xv,row:xv}}return f}function Jv(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 bv:i+=Math.ceil(a.bounds.width())+u;break;case yv:case"bottom":break;default:o+=a.bounds.height()+u}switch((i||o)&&Zv(e,n,i,o),a.orient){case bv:c+=Qv(t,n,a,s,1,1);break;case yv:l+=Qv(t,n,a,xv,0,0)+u,c+=Qv(t,n,a,s,1,1);break;case"bottom":l+=Qv(t,n,a,s,0,0),c+=Qv(t,n,a,xv,-1,0,1)+u;break;default:l+=Qv(t,n,a,s,0,0)}(l||c)&&Zv(e,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(Zv(e,n,-l,0),Zv(e,a,-l,0))}else(i||o)&&Zv(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,ap(s.set(u,l,u+n,l+r),i),i.mark.bounds.clear().union(s),i}function Qv(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:zm(n);return Math.round("start"===r?c:r===xv?f-d:.5*(l-d))}function Zv(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 eb(e){Lo.call(this,null,e)}function tb(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 nb(e){Lo.call(this,null,e)}function rb(e){Lo.call(this,null,e)}function ib(){return ao({})}function ob(e){Lo.call(this,null,e)}function ab(e){Lo.call(this,[],e)}Object(ie.z)(eb,Lo,{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||yv)&&(t[o]||(t[o]=[])).push(e)});for(const r in t){const i=t[r];qv(e,i,Xv(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 bv:case yv:f.add(r.x1,0).add(r.x2,0);break;case vv: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===bv||u===yv?r:n,m=0,g=0,v=0,b=0,y=0;if("group"!==s?u===bv?(m=i.y2,p=i.y1):u===yv?(m=i.y1,p=i.y2):(m=i.x1,p=i.x2):u===bv&&(m=r,p=0),o="start"===l?m:l===xv?p:(m+p)/2,h&&h.text){switch(u){case vv:case"bottom":y=d.bounds.height()+f;break;case bv:b=d.bounds.width()+f;break;case yv:b=-d.bounds.width()-f}Nv.clear().union(h.bounds),Nv.translate(b-(h.x||0),y-(h.y||0)),Pv(h,"x",b)|Pv(h,"y",y)&&(e.dirty(h),h.bounds.clear().union(Nv),h.mark.bounds.clear().union(Nv),e.dirty(h)),Nv.clear().union(h.bounds)}else Nv.clear();switch(Nv.union(d.bounds),u){case vv:g=o,v=i.y1-Nv.height()-c;break;case bv:g=i.x1-Nv.width()-c,v=o;break;case yv:g=i.x2+Nv.width()+c,v=o;break;case"bottom":g=o,v=i.y2+c;break;default:g=a.x,v=a.y}return Pv(a,"x",g)|Pv(a,"y",v)&&(Nv.translate(g,v),e.dirty(a),a.bounds.clear().union(Nv),t.bounds.clear().union(Nv),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(ie.z)(nb,Lo,{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=$d(o,null==e.count?e.values?e.values.length:10:e.count,e.minstep),s=e.format||qd(n,o,a,e.formatSpecifier,e.formatType,!!e.values),u=e.values?Wd(o,e.values,a):Hd(o,a);return i&&(r.rem=i),i=u.map((e,t)=>ao({index:t/(u.length-1||1),value:e,label:s(e)})),e.extra&&i.length&&i.push(ao({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),Object(ie.z)(rb,Lo,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||ib,o=e.key||io,a=this.value;return Object(ie.B)(r.encode)&&(r.encode=null),a&&(e.modified("key")||t.modified(o))&&Object(ie.o)("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function(e){const t=Object(ie.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(ie.z)(ob,Lo,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(Object(ie.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||ie.s,u=i.enter||ie.s,l=i.exit||ie.s,c=(o&&!a?i[o]:s)||ie.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!==ie.s&&c!==s&&(t.visit(t.ADD,t=>{c(t,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==ie.s&&(t.visit(t.REM,t=>{l(t,e)}),n.modifies(l.output)),a||c!==ie.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(ie.z)(ab,Lo,{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=$d(f,null==e.count?5:e.count,e.minstep),p=!!e.values||"symbol"===c,m=e.format||Xd(s,f,h,c,e.formatSpecifier,e.formatType,p),g=e.values||Kd(f,h);return l&&(u.rem=l),"symbol"===c?(d&&g.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=g.slice(0,d-1),a=!0):l=g,Object(ie.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(ie.m)(o=i||8),l=l.map((t,n)=>ao({index:n,label:m(t,n,l),value:t,offset:o,size:i(t,e)})),a&&(a=g[l.length],l.push(ao({index:l.length,label:"…".concat(g.length-l.length," entries"),value:a,offset:o,size:i(a,e)})))):"gradient"===c?(n=f.domain(),r=Md(f,n[0],Object(ie.W)(n)),g.length<3&&!e.values&&n[0]!==Object(ie.W)(n)&&(g=[n[0],Object(ie.W)(n)]),l=g.map((e,t)=>ao({index:t,label:m(e,t,g),value:e,perc:r(e)}))):(i=g.length-1,r=function(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+Object(ie.W)(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=g.map((e,t)=>ao({index:t,label:m(e,t,g),value:e,perc:t?r(e):0,perc2:t===i?1:r(g[t+1])}))),u.source=l,u.add=l,this.value=l,u}});const sb=e=>e.source.x,ub=e=>e.source.y,lb=e=>e.target.x,cb=e=>e.target.y;function fb(e){Lo.call(this,{},e)}fb.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(ie.z)(fb,Lo,{transform(e,t){var n=e.sourceX||sb,r=e.sourceY||ub,i=e.targetX||lb,o=e.targetY||cb,a=e.as||"path",s=e.orient||"vertical",u=e.shape||"line",l=mb.get(u+"-"+s)||mb.get(u);return l||Object(ie.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 db=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,hb=(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},pb=(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},mb=Object(ie.t)({line:db,"line-radial":(e,t,n,r)=>db(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),arc:hb,"arc-radial":(e,t,n,r)=>hb(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),curve:pb,"curve-radial":(e,t,n,r)=>pb(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 gb(e){Lo.call(this,null,e)}gb.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(ie.z)(gb,Lo,{transform(e,t){var n,r,i,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],u=e.field||ie.Q,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,m=(c-l)/tb(d),g=$a(h);for(e.sort&&g.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(ie.bb)(t)));return t}function wb(e,t,n){return Object(ie.E)(e)&&(t||n)?Dd(e,Ob(t||[0,1],n)):e}function Ob(e,t){return t?e.slice().reverse():e}function Eb(e){Lo.call(this,null,e)}Object(ie.z)(yb,Lo,{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 Ed(t)&&t!==fd&&t!==dd&&(e.scheme||e.range&&e.range.length&&e.range.every(ie.J))})(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=xd(i)()),e)if(!bb[i]){if("padding"===i&&vb(r.type))continue;Object(ie.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(ie.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*ld(n,i,r)]}(r,t,n);else if(t.scheme&&(o=function(e,t,n){var r,i,o=t.schemeExtent;Object(ie.B)(t.scheme)?i=Fd(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),(i=Rd(r))||Object(ie.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,Ad(e)?wb(i,o,t.reverse):Object(ie.E)(i)?Td(wb(i,o),n):"ordinal"===e?i:i.slice(0,n)}(r,t,n),Object(ie.E)(o))){if(e.interpolator)return e.interpolator(o);Object(ie.o)("Scale type ".concat(r," does not support interpolating color schemes."))}if(o&&Ad(r))return e.interpolator(Fd(Ob(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(Nd(t.interpolate,t.interpolateGamma)):Object(ie.E)(e.round)?e.round(i):Object(ie.E)(e.rangeRound)&&e.interpolate(i?Bc:Pc);o&&e.range(Ob(o,t.reverse))}(r,e,function(e,t,n){let r=t.bins;if(r&&!Object(ie.B)(r)){const t=e.domain(),n=t[0],i=Object(ie.W)(t),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||Object(ie.o)("Scale bins parameter missing step property."),ai&&(s=o*Math.floor(i/o)),r=$a(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(xb(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;vb(s)&&t.padding&&a[0]!==Object(ie.W)(a)&&(a=function(e,t,n,r,i,o){var a=Math.abs(Object(ie.W)(n)-n[0]),s=a/(a-2*r),u=e===cd?Object(ie.ob)(t,null,s):"sqrt"===e?Object(ie.pb)(t,null,s,.5):"pow"===e?Object(ie.pb)(t,null,s,i||1):"symlog"===e?Object(ie.qb)(t,null,s,o||1):Object(ie.nb)(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 Db(e,t){e&&Tb.hasOwnProperty(e.type)&&Tb[e.type](e,t)}var Fb={Feature:function(e,t){Db(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 Lb=Math.PI,Rb=Lb/2,zb=Lb/4,Ib=2*Lb,Ub=180/Lb,$b=Lb/180,Wb=Math.abs,Hb=Math.atan,qb=Math.atan2,Vb=Math.cos,Gb=Math.ceil,Yb=Math.exp,Kb=(Math.floor,Math.hypot),Xb=Math.log,Jb=Math.pow,Qb=Math.sin,Zb=Math.sign||function(e){return e>0?1:e<0?-1:0},ey=Math.sqrt,ty=Math.tan;function ny(e){return e>1?0:e<-1?Lb:Math.acos(e)}function ry(e){return e>1?Rb:e<-1?-Rb:Math.asin(e)}function iy(){}var oy,ay,sy,uy,ly=new Bb,cy=new Bb,fy={point:iy,lineStart:iy,lineEnd:iy,polygonStart:function(){fy.lineStart=dy,fy.lineEnd=my},polygonEnd:function(){fy.lineStart=fy.lineEnd=fy.point=iy,ly.add(Wb(cy)),cy=new Bb},result:function(){var e=ly/2;return ly=new Bb,e}};function dy(){fy.point=hy}function hy(e,t){fy.point=py,oy=sy=e,ay=uy=t}function py(e,t){cy.add(uy*e-sy*t),sy=e,uy=t}function my(){py(oy,ay)}var gy=fy,vy=1/0,by=vy,yy=-vy,xy=yy;var wy,Oy,Ey,Cy,_y={point:function(e,t){eyy&&(yy=e);txy&&(xy=t)},lineStart:iy,lineEnd:iy,polygonStart:iy,polygonEnd:iy,result:function(){var e=[[vy,by],[yy,xy]];return yy=xy=-(by=vy=1/0),e}},ky=0,Ay=0,Sy=0,jy=0,Dy=0,Fy=0,Ty=0,My=0,Ny=0,Py={point:By,lineStart:Ly,lineEnd:Iy,polygonStart:function(){Py.lineStart=Uy,Py.lineEnd=$y},polygonEnd:function(){Py.point=By,Py.lineStart=Ly,Py.lineEnd=Iy},result:function(){var e=Ny?[Ty/Ny,My/Ny]:Fy?[jy/Fy,Dy/Fy]:Sy?[ky/Sy,Ay/Sy]:[NaN,NaN];return ky=Ay=Sy=jy=Dy=Fy=Ty=My=Ny=0,e}};function By(e,t){ky+=e,Ay+=t,++Sy}function Ly(){Py.point=Ry}function Ry(e,t){Py.point=zy,By(Ey=e,Cy=t)}function zy(e,t){var n=e-Ey,r=t-Cy,i=ey(n*n+r*r);jy+=i*(Ey+e)/2,Dy+=i*(Cy+t)/2,Fy+=i,By(Ey=e,Cy=t)}function Iy(){Py.point=By}function Uy(){Py.point=Wy}function $y(){Hy(wy,Oy)}function Wy(e,t){Py.point=Hy,By(wy=Ey=e,Oy=Cy=t)}function Hy(e,t){var n=e-Ey,r=t-Cy,i=ey(n*n+r*r);jy+=i*(Ey+e)/2,Dy+=i*(Cy+t)/2,Fy+=i,Ty+=(i=Cy*e-Ey*t)*(Ey+e),My+=i*(Cy+t),Ny+=3*i,By(Ey=e,Cy=t)}var qy=Py;function Vy(e){this._context=e}Vy.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,Ib)}},result:iy};var Gy,Yy,Ky,Xy,Jy,Qy=new Bb,Zy={point:iy,lineStart:function(){Zy.point=ex},lineEnd:function(){Gy&&tx(Yy,Ky),Zy.point=iy},polygonStart:function(){Gy=!0},polygonEnd:function(){Gy=null},result:function(){var e=+Qy;return Qy=new Bb,e}};function ex(e,t){Zy.point=tx,Yy=Xy=e,Ky=Jy=t}function tx(e,t){Xy-=e,Jy-=t,Qy.add(ey(Xy*Xy+Jy*Jy)),Xy=e,Jy=t}var nx=Zy;function rx(){this._string=[]}function ix(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}rx.prototype={_radius:4.5,_circle:ix(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=ix(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 ox=function(e,t){var n,r,i=4.5;function o(e){return e&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),Pb(e,n(r))),r.result()}return o.area=function(e){return Pb(e,n(gy)),gy.result()},o.measure=function(e){return Pb(e,n(nx)),nx.result()},o.bounds=function(e){return Pb(e,n(_y)),_y.result()},o.centroid=function(e){return Pb(e,n(qy)),qy.result()},o.projection=function(t){return arguments.length?(n=null==t?(e=null,jb):(e=t).stream,o):e},o.context=function(e){return arguments.length?(r=null==e?(t=null,new rx):new Vy(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)},ax=function(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:iy,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}},sx=function(e,t){return Wb(e[0]-t[0])<1e-6&&Wb(e[1]-t[1])<1e-6};function ux(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 lx=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(sx(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 cx(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r=0?1:-1,k=_*C,A=k>Lb,S=g*O;if(u.add(qb(S*_*Qb(k),v*E+S*Vb(k))),a+=A?C+_*Ib:C,A^p>=n^x>=n){var j=px(dx(h),dx(y));vx(j);var D=px(o,j);vx(D);var F=(A^C>=0?-1:1)*ry(D[2]);(r>F||r===F&&(j[0]||j[1]))&&(s+=A^C>=0?1:-1)}}return(a<-1e-6||a<1e-6&&u<-1e-12)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),lx(a,Ox,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 m(){d.point=p,u.lineStart()}function g(){d.point=h,u.lineEnd()}function v(e,t){s.push([e,t]),c.point(e,t)}function b(){c.lineStart(),s=[]}function y(){v(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(wx))}return d}};function wx(e){return e.length>1}function Ox(e,t){return((e=e.x)[0]<0?e[1]-Rb-1e-6:Rb-e[1])-((t=t.x)[0]<0?t[1]-Rb-1e-6:Rb-t[1])}var Ex=xx((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?Lb:-Lb,u=Wb(o-n);Wb(u-Lb)<1e-6?(e.point(n,r=(r+a)/2>0?Rb:-Rb),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&u>=Lb&&(Wb(n-i)<1e-6&&(n-=1e-6*i),Wb(o-s)<1e-6&&(o-=1e-6*s),r=function(e,t,n,r){var i,o,a=Qb(e-n);return Wb(a)>1e-6?Hb((Qb(t)*(o=Vb(r))*Qb(n)-Qb(r)*(i=Vb(t))*Qb(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*Rb,r.point(-Lb,i),r.point(0,i),r.point(Lb,i),r.point(Lb,0),r.point(Lb,-i),r.point(0,-i),r.point(-Lb,-i),r.point(-Lb,0),r.point(-Lb,i);else if(Wb(e[0]-t[0])>1e-6){var o=e[0]Lb?e+Math.round(-e/Ib)*Ib:e,t]}function kx(e,t,n){return(e%=Ib)?t||n?Cx(Sx(e),jx(t,n)):Sx(e):t||n?jx(t,n):_x}function Ax(e){return function(t,n){return[(t+=e)>Lb?t-Ib:t<-Lb?t+Ib:t,n]}}function Sx(e){var t=Ax(e);return t.invert=Ax(-e),t}function jx(e,t){var n=Vb(e),r=Qb(e),i=Vb(t),o=Qb(t);function a(e,t){var a=Vb(t),s=Vb(e)*a,u=Qb(e)*a,l=Qb(t),c=l*n+s*r;return[qb(u*i-c*o,s*n-l*r),ry(c*i+u*o)]}return a.invert=function(e,t){var a=Vb(t),s=Vb(e)*a,u=Qb(e)*a,l=Qb(t),c=l*i-u*o;return[qb(u*i+l*o,s*n+c*r),ry(c*n-s*r)]},a}_x.invert=_x;function Dx(e,t,n,r,i,o){if(n){var a=Vb(t),s=Qb(t),u=r*n;null==i?(i=t+r*Ib,o=t-u/2):(i=Fx(a,i),o=Fx(a,o),(r>0?io)&&(i+=r*Ib));for(var l,c=i;r>0?c>o:c0,i=Wb(t)>1e-6;function o(e,n){return Vb(e)*Vb(n)>t}function a(e,n,r){var i=[1,0,0],o=px(dx(e),dx(n)),a=hx(o,o),s=o[0],u=a-s*s;if(!u)return!r&&e;var l=t*a/u,c=-t*s/u,f=px(i,o),d=gx(i,l);mx(d,gx(o,c));var h=f,p=hx(d,h),m=hx(h,h),g=p*p-m*(hx(d,d)-1);if(!(g<0)){var v=ey(g),b=gx(h,(-p-v)/m);if(mx(b,d),b=fx(b),!r)return b;var y,x=e[0],w=n[0],O=e[1],E=n[1];w0^b[1]<(Wb(b[0]-x)<1e-6?O:E):O<=b[1]&&b[1]<=E:C>Lb^(x<=b[0]&&b[0]<=w)){var k=gx(h,(-p+v)/m);return mx(k,d),[b,fx(k)]}}}function s(t,n){var i=r?e:Lb-e,o=0;return t<-i?o|=1:t>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return xx(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],m=o(f,d),g=r?m?0:s(f,d):m?s(f+(f<0?Lb:-Lb),d):0;if(!t&&(l=u=m)&&e.lineStart(),m!==u&&(!(h=a(t,p))||sx(t,h)||sx(p,h))&&(p[2]=1),m!==u)c=0,m?(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^m){var v;g&n||!(v=a(p,t,!0))||(c=0,r?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1],3)))}!m||t&&sx(t,p)||e.point(p[0],p[1]),t=p,u=m,n=g},lineEnd:function(){u&&e.lineEnd(),t=null},clean:function(){return c|(l&&u)<<1}}}),(function(t,r,i,o){Dx(o,e,n,i,t,r)}),r?[0,-e]:[-Lb,e-Lb])};function Mx(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 Wb(r[0]-e)<1e-6?i>0?0:3:Wb(r[0]-n)<1e-6?i>0?2:1:Wb(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,m,g,v,b,y=a,x=ax(),w={point:O,lineStart:function(){w.point=E,l&&l.push(c=[]);v=!0,g=!1,p=m=NaN},lineEnd:function(){u&&(E(f,d),h&&g&&x.rejoin(),u.push(x.result()));w.point=O,g&&y.lineEnd()},polygonStart:function(){y=x,u=[],l=[],b=!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=b&&t,i=(u=yx(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&lx(u,s,t,o,a),a.polygonEnd());y=a,u=l=c=null}};function O(e,t){i(e,t)&&y.point(e,t)}function E(o,a){var s=i(o,a);if(l&&c.push([o,a]),v)f=o,d=a,h=s,v=!1,s&&(y.lineStart(),y.point(o,a));else if(s&&g)y.point(o,a);else{var u=[p=Math.max(-1e9,Math.min(1e9,p)),m=Math.max(-1e9,Math.min(1e9,m))],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&&(y.lineStart(),y.point(o,a),b=!1):(g||(y.lineStart(),y.point(u[0],u[1])),y.point(x[0],x[1]),s||y.lineEnd(),b=!1)}p=o,m=a,g=s}return w}}function Nx(e){return function(t){var n=new Px;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Px(){}function Bx(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),Pb(n,e.stream(_y)),t(_y.result()),null!=r&&e.clipExtent(r),e}function Lx(e,t,n){return Bx(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 Rx(e,t,n){return Lx(e,[[0,0],t],n)}function zx(e,t,n){return Bx(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 Ix(e,t,n){return Bx(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)}Px.prototype={constructor:Px,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 Ux=Vb(30*$b),$x=function(e,t){return+t?function(e,t){function n(r,i,o,a,s,u,l,c,f,d,h,p,m,g){var v=l-r,b=c-i,y=v*v+b*b;if(y>4*t&&m--){var x=a+d,w=s+h,O=u+p,E=ey(x*x+w*w+O*O),C=ry(O/=E),_=Wb(Wb(O)-1)<1e-6||Wb(o-f)<1e-6?(o+f)/2:qb(w,x),k=e(_,C),A=k[0],S=k[1],j=A-r,D=S-i,F=b*j-v*D;(F*F/y>t||Wb((v*j+b*D)/y-.5)>.3||a*d+s*h+u*p2?e[2]%360*$b:0,j()):[g*Ub,v*Ub,b*Ub]},A.angle=function(e){return arguments.length?(y=e%360*$b,j()):y*Ub},A.reflectX=function(e){return arguments.length?(x=e?-1:1,j()):x<0},A.reflectY=function(e){return arguments.length?(w=e?-1:1,j()):w<0},A.precision=function(e){return arguments.length?(a=$x(s,k=e*e),D()):ey(k)},A.fitExtent=function(e,t){return Lx(A,e,t)},A.fitSize=function(e,t){return Rx(A,e,t)},A.fitWidth=function(e,t){return zx(A,e,t)},A.fitHeight=function(e,t){return Ix(A,e,t)},function(){return t=e.apply(this,arguments),A.invert=t.invert&&S,j()}}function Gx(e){var t=0,n=Lb/3,r=Vx(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*$b,n=e[1]*$b):[t*Ub,n*Ub]},i}function Yx(e,t){var n=Qb(e),r=(n+Qb(t))/2;if(Wb(r)<1e-6)return function(e){var t=Vb(e);function n(e,n){return[e*t,Qb(n)/t]}return n.invert=function(e,n){return[e/t,ry(n*t)]},n}(e);var i=1+n*(2*r-n),o=ey(i)/r;function a(e,t){var n=ey(i-2*r*Qb(t))/r;return[n*Qb(e*=r),o-n*Vb(e)]}return a.invert=function(e,t){var n=o-t,a=qb(e,Wb(n))*Zb(n);return n*r<0&&(a-=Lb*Zb(e)*Zb(n)),[a/r,ry((i-(e*e+n*n)*r*r)/(2*r))]},a}var Kx=function(){return Gx(Yx).scale(155.424).center([0,33.6442])},Xx=function(){return Kx().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};function Jx(e){return function(t,n){var r=Vb(t),i=Vb(n),o=e(r*i);return o===1/0?[2,0]:[o*i*Qb(t),o*Qb(n)]}}function Qx(e){return function(t,n){var r=ey(t*t+n*n),i=e(r),o=Qb(i),a=Vb(i);return[qb(t*o,r*a),ry(r&&n*o/r)]}}var Zx=Jx((function(e){return ey(2/(1+e))}));Zx.invert=Qx((function(e){return 2*ry(e/2)}));var ew=Jx((function(e){return(e=ny(e))&&e/Qb(e)}));ew.invert=Qx((function(e){return e}));function tw(e,t){return[e,Xb(ty((Rb+t)/2))]}tw.invert=function(e,t){return[e,2*Hb(Yb(t))-Rb]};function nw(e){var t,n,r,i=qx(e),o=i.center,a=i.scale,s=i.translate,u=i.clipExtent,l=null;function c(){var o=Lb*a(),s=i(function(e){function t(t){return(t=e(t[0]*$b,t[1]*$b))[0]*=Ub,t[1]*=Ub,t}return e=kx(e[0]*$b,e[1]*$b,e.length>2?e[2]*$b:0),t.invert=function(t){return(t=e.invert(t[0]*$b,t[1]*$b))[0]*=Ub,t[1]*=Ub,t},t}(i.rotate()).invert([0,0]));return u(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:e===tw?[[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 rw(e){return ty((Rb+e)/2)}function iw(e,t){var n=Vb(e),r=e===t?Qb(e):Xb(n/Vb(t))/Xb(rw(t)/rw(e)),i=n*Jb(rw(e),r)/r;if(!r)return tw;function o(e,t){i>0?t<1e-6-Rb&&(t=1e-6-Rb):t>Rb-1e-6&&(t=Rb-1e-6);var n=i/Jb(rw(t),r);return[n*Qb(r*e),i-n*Vb(r*e)]}return o.invert=function(e,t){var n=i-t,o=Zb(r)*ey(e*e+n*n),a=qb(e,Wb(n))*Zb(n);return n*r<0&&(a-=Lb*Zb(e)*Zb(n)),[a/r,2*Hb(Jb(i/o,1/r))-Rb]},o}function ow(e,t){return[e,t]}ow.invert=ow;function aw(e,t){var n=Vb(e),r=e===t?Qb(e):(n-Vb(t))/(t-e),i=n/r+e;if(Wb(r)<1e-6)return ow;function o(e,t){var n=i-t,o=r*e;return[n*Qb(o),i-n*Vb(o)]}return o.invert=function(e,t){var n=i-t,o=qb(e,Wb(n))*Zb(n);return n*r<0&&(o-=Lb*Zb(e)*Zb(n)),[o/r,i-Zb(r)*ey(e*e+n*n)]},o}var sw=1.340264,uw=-.081106,lw=893e-6,cw=.003796,fw=ey(3)/2;function dw(e,t){var n=ry(fw*Qb(t)),r=n*n,i=r*r*r;return[e*Vb(n)/(fw*(sw+3*uw*r+i*(7*lw+9*cw*r))),n*(sw+uw*r+i*(lw+cw*r))]}dw.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*(sw+uw*i+o*(lw+cw*i))-t)/(sw+3*uw*i+o*(7*lw+9*cw*i)))*r)*i*i,!(Wb(n)<1e-12));++a);return[fw*e*(sw+3*uw*i+o*(7*lw+9*cw*i))/Vb(r),ry(Qb(r)/fw)]};function hw(e,t){var n=Vb(t),r=Vb(e)*n;return[n*Qb(e)/r,Qb(t)/r]}hw.invert=Qx(Hb);function pw(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)))]}pw.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(Wb(n)>1e-6&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};function mw(e,t){return[Vb(t)*Qb(e),Qb(t)]}mw.invert=Qx(ry);function gw(e,t){var n=Vb(t),r=1+Vb(e)*n;return[n*Qb(e)/r,Qb(t)/r]}gw.invert=Qx((function(e){return 2*Hb(e)}));function vw(e,t){return[Xb(ty((Rb+t)/2)),-e]}vw.invert=function(e,t){return[-t,2*Hb(Yb(e))-Rb]};var bw=Math.abs,yw=(Math.atan,Math.atan2,Math.ceil,Math.cos),xw=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),ww=(Math.tan,Math.PI),Ow=ww/2,Ew=(Math.SQRT1_2,_w(2));_w(ww);function Cw(e){return e>1?Ow:e<-1?-Ow:Math.asin(e)}function _w(e){return e>0?Math.sqrt(e):0}function kw(e,t){var n,r=e*xw(t),i=30;do{t-=n=(t+xw(t)-r)/(1+yw(t))}while(bw(n)>1e-6&&--i>0);return t/2}var Aw=function(e,t,n){function r(r,i){return[e*r*yw(i=kw(n,i)),t*xw(i)]}return r.invert=function(r,i){return i=Cw(i/t),[r/(e*yw(i)),Cw((2*i+xw(2*i))/n)]},r}(Ew/Ow,Ew,ww);const Sw=ox(),jw=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Dw(e,t){return function n(){const r=t();return r.type=e,r.path=ox().projection(r),r.copy=r.copy||function(){const e=n();return jw.forEach(t=>{r[t]&&e[t](r[t]())}),e.path.pointRadius(r.path.pointRadius()),e},r}}function Fw(e,t){if(!e||"string"!=typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Mw[e]=Dw(e,t),this):Mw[e]||null}function Tw(e){return e&&e.path||Sw}const Mw={albers:Xx,albersusa:function(){var e,t,n,r,i,o,a=Xx(),s=Kx().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=Kx().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 Mw)Fw(e,Mw[e]);function Nw(e,t,n){var r=$a(e,t-1e-6,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function Pw(e,t,n){var r=$a(e,t-1e-6,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}function Bw(){var e,t,n,r,i,o,a,s,u,l,c,f,d=10,h=d,p=90,m=360,g=2.5;function v(){return{type:"MultiLineString",coordinates:b()}}function b(){return $a(Gb(r/p)*p,n,p).map(c).concat($a(Gb(s/m)*m,a,m).map(f)).concat($a(Gb(t/d)*d,e,d).filter((function(e){return Wb(e%p)>1e-6})).map(u)).concat($a(Gb(o/h)*h,i,h).filter((function(e){return Wb(e%m)>1e-6})).map(l))}return v.lines=function(){return b().map((function(e){return{type:"LineString",coordinates:e}}))},v.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(e){return arguments.length?v.extentMajor(e).extentMinor(e):v.extentMinor()},v.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),v.precision(g)):[[r,s],[n,a]]},v.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),v.precision(g)):[[t,o],[e,i]]},v.step=function(e){return arguments.length?v.stepMajor(e).stepMinor(e):v.stepMinor()},v.stepMajor=function(e){return arguments.length?(p=+e[0],m=+e[1],v):[p,m]},v.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],v):[d,h]},v.precision=function(d){return arguments.length?(g=+d,u=Nw(o,i,90),l=Pw(t,e,g),c=Nw(s,a,90),f=Pw(r,n,g),v):g},v.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Lw(){}const Rw=[[],[[[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 zw(){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,Rw[l<<1].forEach(p);for(;++a=r,Rw[u|l<<1].forEach(p);Rw[l<<0].forEach(p);for(;++s=r,c=n[s*e]>=r,Rw[l<<1|c<<2].forEach(p);++a=r,f=c,c=n[s*e+a+1]>=r,Rw[u|l<<1|c<<2|f<<3].forEach(p);Rw[l|c<<3].forEach(p)}a=-1,c=n[s*e]>=r,Rw[c<<2].forEach(p);for(;++a=r,Rw[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]}}Rw[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(ie.o)("invalid size"),e=i,t=o,r},r.smooth=function(e){return arguments.length?(n=e?a:Lw,r):n===a},r}function Iw(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 $w(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 Ww(e,t,n){return function(r){var i=Object(ie.q)(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=t?Ke(o,a,e):s/(e+1);return $a(o+u,a,u)}}function Hw(e){Lo.call(this,null,e)}function qw(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 Vw(e,t,n){const r=e>=0?e:Jo(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function Gw(e){return Object(ie.E)(e)?e:Object(ie.m)(+e)}function Yw(){var e=e=>e[0],t=e=>e[1],n=ie.Q,r=[-1,-1],i=960,o=500,a=2;function s(s,u){const l=Vw(r[0],s,e)>>a,c=Vw(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),m=new Float32Array(h*p),g=new Float32Array(h*p);let v=m;s.forEach(r=>{const i=f+(+e(r)>>a),o=d+(+t(r)>>a);i>=0&&i=0&&o0&&c>0?(Kw(h,p,m,g,l),Xw(h,p,g,m,c),Kw(h,p,m,g,l),Xw(h,p,g,m,c),Kw(h,p,m,g,l),Xw(h,p,g,m,c)):l>0?(Kw(h,p,m,g,l),Kw(h,p,g,m,l),Kw(h,p,m,g,l),v=g):c>0&&(Xw(h,p,m,g,c),Xw(h,p,g,m,c),Xw(h,p,m,g,c),v=g);const b=u?Math.pow(2,-2*a):1/tb(v);for(let e=0,t=h*p;e>a),y2:d+(o>>a)}}return s.x=function(t){return arguments.length?(e=Gw(t),s):e},s.y=function(e){return arguments.length?(t=Gw(e),s):t},s.weight=function(e){return arguments.length?(n=Gw(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(ie.o)("invalid size"),i=t,o=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||Object(ie.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 Xw(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 Jw(e){Lo.call(this,null,e)}Hw.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(ie.z)(Hw,Lo,{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||ie.y,o=zw().smooth(!1!==e.smooth),a=e.thresholds||function(e,t,n){const r=Ww(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(e.map(e=>Uo(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(ie.B)(a)?a:a(n.values));!function(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;Object(ie.E)(i)&&(i=i(n,r));Object(ie.E)(o)&&(o=o(n,r));if((1===i||null==i)&&!o)return;const a=(Object(ie.G)(i)?i:i[0])||1,s=(Object(ie.G)(i)?i:i[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(qw(t,a,s,u,l))}(r,n,t,e),r.forEach(e=>{u.push(uo(t,ao(null!=s?{[s]:e}:e)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}}),Jw.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 Qw=["x","y","weight","size","cellSize","bandwidth"];function Zw(e,t){return Qw.forEach(n=>null!=t[n]?e[n](t[n]):0),e}function eO(e){Lo.call(this,null,e)}Object(ie.z)(Jw,Lo,{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;rao(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}}}),nO.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(ie.z)(nO,Lo,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||ie.y,o=e.as||"path",a=n.SOURCE;!r||e.modified()?(this.value=r=Tw(e.projection),n.materialize().reflow()):a=i===ie.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)}}),rO.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(ie.z)(rO,Lo,{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)}}),iO.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(ie.z)(iO,Lo,{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}(Tw(e.projection),e.field||Object(ie.u)("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,e=>e[i]=r),n.modifies(i)}}),oO.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(ie.z)(oO,Lo,{transform(e,t){var n,r=this.value,i=this.generator;if(!r.length||e.modified())for(const t in e)Object(ie.E)(i[t])&&i[t](e[t]);return n=i(),r.length?t.mod.push(lo(r[0],n)):t.add.push(ao(n)),r[0]=n,t}}),aO.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(ie.z)(aO,Lo,{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||ie.y,o=function(e,t){let n;Object(ie.E)(e)?(n=n=>e(n,t),n.dep=sO(e)):e?n=Object(ie.m)(e):(n=e=>e.$value/e.$max||0,n.dep=!0);return n}(e.opacity,e),a=function(e,t){let n;Object(ie.E)(e)?(n=n=>rc(e(n,t)),n.dep=sO(e)):n=Object(ie.m)(rc(e||"#888"));return n}(e.color,e),s=e.as||"image",u={$x:0,$y:0,$value:0,$max:r?Uo(n.map(e=>Uo(i(e).values))):0};return n.forEach(e=>{const t=i(e),n=Object(ie.p)({},e,u);r||(n.$max=Uo(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]:ie.mb,d=kl(u-a,l-s),h=d.getContext("2d"),p=h.getImageData(0,0,u-a,l-s),m=p.data;for(let e=s,o=0;e{null!=e[t]&&lO(n,t,e[t])})):jw.forEach(t=>{e.modified(t)&&lO(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(ie.i)(e)).length?e[0]:{type:"FeatureCollection",features:e.reduce((e,t)=>e.concat(function(e){return"FeatureCollection"===e.type?e.features:Object(ie.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 cO(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},m=e._x0,g=e._y0,v=e._x1,b=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((l=t>=(o=(m+v)/2))?m=o:v=o,(c=n>=(a=(g+b)/2))?g=a:b=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=(m+v)/2))?m=o:v=o,(c=n>=(a=(g+b)/2))?g=a:b=a}while((f=c<<1|l)==(d=(u>=a)<<1|s>=o));return i[d]=h,i[f]=p,e}var fO=function(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i};function dO(e){return e[0]}function hO(e){return e[1]}function pO(e,t,n){var r=new mO(null==t?dO:t,null==n?hO:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function mO(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 gO(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var vO=pO.prototype=mO.prototype;vO.copy=function(){var e,t,n=new mO(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=gO(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]=gO(t));return n},vO.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return cO(this.cover(t,n),t,n,e)},vO.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)=v)<<1|e>=g)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var b=e-+this._x.call(null,m.data),y=t-+this._y.call(null,m.data),x=b*b+y*y;if(x=(s=(p+g)/2))?p=s:g=s,(c=a>=(u=(m+v)/2))?m=u:v=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)},vO.removeAll=function(e){for(var t=0,n=e.length;t{}};function EO(){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 kO(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;--FO}()}finally{FO=0,function(){var e,t,n=SO,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:SO=t);jO=e,qO(r)}(),PO=0}}function HO(){var e=LO.now(),t=e-NO;t>1e3&&(BO-=t,NO=e)}function qO(e){FO||(TO&&(TO=clearTimeout(TO)),e-PO>24?(e<1/0&&(TO=setTimeout(WO,e-LO.now()-BO)),MO&&(MO=clearInterval(MO))):(MO||(NO=LO.now(),MO=setInterval(HO,1e3)),FO=1,RO(WO)))}UO.prototype=$O.prototype={constructor:UO,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?zO():+n)+(null==t?0:+t),this._next||jO===this||(jO?jO._next=this:SO=this,jO=this),this._call=e,this._time=n,qO()},stop:function(){this._call&&(this._call=null,this._time=1/0,qO())}};function VO(e){return e.x}function GO(e){return e.y}var YO=Math.PI*(3-Math.sqrt(5));function KO(e){return e.index}function XO(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}const JO={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 m=l-s.x-s.vx,g=c-s.y-s.vy,v=m*m+g*g;ve.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=yO(n))*f),0===d&&(p+=(d=yO(n))*d),p[s(e,t,r),e]));for(a=0,i=new Array(l);at(e,n):t)}function aE(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}tE.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:eE}]},Object(ie.z)(tE,Lo,{transform(e,t){var n,r,i=this.value,o=t.changed(t.ADD_REM),a=e.modified(QO),s=e.iterations||300;if(i?(o&&(t.modifies("index"),i.nodes(t.source)),(a||t.changed(t.MOD))&&nE(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=$O(f),l=DO("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()),nE(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(ZO)||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 dE(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(fE)}function uE(e){return e.children}function lE(e){return Array.isArray(e)?e[1]:null}function cE(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function fE(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function dE(e){this.data=e,this.depth=this.height=0,this.parent=null}dE.prototype=sE.prototype={constructor:dE,count:function(){return this.eachAfter(aE)},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 sE(this).eachBefore(cE)},[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 vE(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 OE(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 EE(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 CE(e){this._=e,this.next=null,this.previous=null}function _E(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;wE(r,n,i=e[2]),n=new CE(n),r=new CE(r),i=new CE(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=AE(t),n):e},n.parentId=function(e){return arguments.length?(t=AE(e),n):t},n};function UE(e,t){return e.parent===t.parent?1:2}function $E(e){var t=e.children;return t?t[0]:e.t}function WE(e){var t=e.children;return t?t[t.length-1]:e.t}function HE(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 qE(e,t,n){return e.a.parent===t.parent?e.a:n}function VE(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}VE.prototype=Object.create(dE.prototype);function GE(e,t){return e.parent===t.parent?1:2}function YE(e,t){return e+t.x}function KE(e,t){return Math.max(e,t.y)}var XE=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),g=c*c*m,(h=Math.max(d/g,g/f))>p){c-=s;break}p=h}v.push(a={value:c,dice:u1?t:1)},n}(JE),eC=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}(JE);function tC(e,t,n){const r={};return e.each(e=>{const i=e.data;n(i)&&(r[t(i)]=e)}),e.lookup=r,e}function nC(e){Lo.call(this,null,e)}nC.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const rC=e=>e.values;function iC(){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 oC(e){Lo.call(this,null,e)}Object(ie.z)(nC,Lo,{transform(e,t){t.source||Object(ie.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&&ro(e.data)&&i.rem.push(e.data)}),this.value=o=sE({values:Object(ie.i)(e.keys).reduce((e,t)=>(e.key(t),e),iC()).entries(i.source)},rC),n&&o.each(e=>{e.children&&(e=ao(e.data),i.add.push(e),i.source.push(e))}),tC(o,io,io)),i.source.root=o,i}});const aC=(e,t)=>e.parent===t.parent?1:2;Object(ie.z)(oC,Lo,{transform(e,t){t.source&&t.source.root||Object(ie.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(co(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 VE(r[i],i)),n.parent=t;return(a.parent=new VE(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),m=n/(f.depth||1);i.eachBefore((function(e){e.x=(e.x+h)*p,e.y=e.depth*m}))}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=WE(s),o=$E(o),s&&o;)u=$E(u),(a=WE(a)).a=t,(i=s.z+f-o.z-l+e(s._,o._))>0&&(HE(qE(s,t,r),t,i),l+=i,c+=i),f+=s.m,l+=o.m,d+=u.m,c+=a.m;s&&!WE(a)&&(a.t=s,a.m+=f-c),o&&!$E(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=GE,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(YE,0)/e.length}(n),t.y=function(e){return 1+e.reduce(KE,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}},hC=["x","y","depth","children"];function pC(e){oC.call(this,e)}function mC(e){Lo.call(this,[],e)}pC.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:hC.length,default:hC}]},Object(ie.z)(pC,oC,{layout(e){const t=e||"tidy";if(Object(ie.w)(dC,t))return dC[t]();Object(ie.o)("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:hC}),mC.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},Object(ie.z)(mC,Lo,{transform(e,t){const n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||Object(ie.o)("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,e=>o[io(e)]=1),r.each(e=>{const t=e.data,n=e.parent&&e.parent.data;n&&o[io(t)]&&o[io(n)]&&i.add.push(ao({source:n,target:t}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,e=>o[io(e)]=1),n.forEach(e=>{(o[io(e.source)]||o[io(e.target)])&&i.mod.push(e)})),i}});const gC={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[m]u-o){var b=r?(i*v+a*g)/r:a;e(t,h,g,i,o,b,u),e(h,n,v,b,o,a,u)}else{var y=r?(o*v+u*g)/r:u;e(t,h,g,i,o,a,y),e(h,n,v,i,y,a,u)}}(0,u,e.value,t,n,r,i)},dice:PE,slice:XE,slicedice:function(e,t,n,r,i){(1&e.depth?XE:PE)(e,t,n,r,i)},squarify:ZE,resquarify:eC},vC=["x0","y0","x1","y1","depth","children"];function bC(e){oC.call(this,e)}bC.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:vC.length,default:vC}]},Object(ie.z)(bC,oC,{layout(){const e=function(){var e=ZE,t=!1,n=1,r=1,i=[0],o=SE,a=SE,s=SE,u=SE,l=SE;function c(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(f),i=[0],t&&e.eachBefore(NE),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(ie.w)(gC,t)?e.tile(gC[t]):Object(ie.o)("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:vC});function yC(e,t,n,r){const i=e.width,o=e.height,a=n||r,s=kl(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))}):Ym[i].draw(t,{items:r?n.map(xC):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,m;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]&wC[31&a]&OC[1+(31&s)])return!0}else{if(n[u]&wC[31&a])return!0;if(n[l]&OC[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,wC[31&a]&OC[1+(31&s)]);else for(r(u,wC[31&a]),r(l,OC[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,OC[31&a]|wC[1+(31&s)]);else for(i(u,OC[31&a]),i(l,wC[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 CC(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 _C(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 kC=[-1,-1,1,1],AC=[-1,1,-1,1];const SC=["right","center","left"],jC=["bottom","middle","top"];function DC(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 FC={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},TC={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=Dm.width(e.datum,e.datum.text);let u,l,c,f,d,h,p,m=0;for(let r=0;r=m&&(m=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,_C(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=Dm.width(t.datum,t.datum.text);let d,h,p,m,g,v,b,y,x,w,O,E,C,_,k,A,S,j=n?c:0,D=!1,F=!1,T=0;for(let r=0;rh&&(S=d,d=h,h=S),p>m&&(S=p,p=m,m=S),x=e(d),O=e(h),w=~~((x+O)/2),E=e(p),_=e(m),C=~~((E+_)/2),b=w;b>=x;--b)for(y=C;y>=E;--y)A=u(b,y,j,f,c),A&&([t.x,t.y,j,D]=A);for(b=w;b<=O;++b)for(y=C;y<=_;++y)A=u(b,y,j,f,c),A&&([t.x,t.y,j,D]=A);D||n||(k=Math.abs(h-d+m-p),g=(d+h)/2,v=(p+m)/2,k>=T&&!CC(g,v,f,c,i,o)&&!_C(e,g,v,c,f,c,a,null)&&(T=k,t.x=g,t.y=v,F=!0))}return!(!D&&!F)&&(g=f/2,v=c/2,a.setRange(e(t.x-g),e(t.y-v),e(t.x+g),e(t.y+v)),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=Dm.width(t.datum,t.datum.text),h=[];let p,m,g,v,b,y,x,w,O,E,C,_,k=n?f:0,A=!1,S=!1,j=0;for(let r=0;r=1;)C=(O+E)/2,_C(e,b,y,f,d,C,a,s)?E=C:O=C;O>k&&(t.x=b,t.y=y,k=O,A=!0)}}A||n||(_=Math.abs(m-p+v-g),b=(p+m)/2,y=(g+v)/2,_>=j&&!CC(b,y,d,f,i,o)&&!_C(e,b,y,f,d,f,a,null)&&(j=_,t.x=b,t.y=y,S=!0))}return!(!A&&!S)&&(b=d/2,y=f/2,a.setRange(e(t.x-b),e(t.y-y),e(t.x+b),e(t.y+y)),t.align="center",t.baseline="middle",!0)}}};function MC(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,m,s,u),b=EC(t[0],t[1],l),y=g&&"naive"===c;var x;const w=e.map(e=>({datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(e)}));let O;if(!y){n&&w.sort((e,t)=>n(e.datum,t.datum));let t=!1;for(let e=0;ee.datum)].concat(o)),O=o.length?yC(b,o,t,g):function(e,t){const n=e.bitmap();return(t||[]).forEach(t=>n.set(e(t.boundary[0]),e(t.boundary[3]))),[n,void 0]}(b,a&&w)}const E=g?TC[c](b,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,m,g,v,b,y,x,w,O,E,C,_,k=0;for(let i=0;i>>2&3)-1,h=0===f&&0===d||r[i]<0,p=f&&d?Math.SQRT1_2:1,m=r[i]<0?-1:1,g=l[1+f]+r[i]*f*p,w=l[4+d]+m*c*d/2+r[i]*d*p,b=w-c/2,y=w+c/2,O=e(g),C=e(b),_=e(y),!k){if(!DC(O,O,C,_,a,s,g,g,b,y,l,h))continue;k=Dm.width(t.datum,t.datum.text)}if(x=g+m*k*f/2,g=x-k/2,v=x+k/2,O=e(g),E=e(v),DC(O,E,C,_,a,s,g,v,b,y,l,h))return t.x=f?f*m<0?v:g:x,t.y=d?d*m<0?y:b:w,t.align=SC[f*m+1],t.baseline=jC[d*m+1],a.setRange(O,C,E,_),!0}return!1}}(b,O,h,d);return w.forEach(e=>e.opacity=+E(e)),w}const NC=["x","y","opacity","align","baseline"],PC=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function BC(e){Lo.call(this,null,e)}function LC(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)}}),RC.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(ie.z)(RC,Lo,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=LC(t.materialize(t.SOURCE).source,e.groupby),i=(e.groupby||[]).map(ie.h),o=i.length,a=e.as||[Object(ie.h)(e.x),Object(ie.h)(e.y)],s=[];r.forEach(t=>{Ba(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(ie.h)(e.x),Object(ie.h)(e.y)],l=zC[o],c=[];let f=e.extent;Object(ie.w)(zC,o)||Object(ie.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(ao({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const d=f||Object(ie.q)(n,e.x),h=e=>{const t={};for(let e=0;eh([e,r.predict(e)])):Ia(r.predict,d,25,200).forEach(h)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const UC=Math.pow(2,-52),$C=new Uint32Array(512);class WC{static from(e,t=JC,n=QC){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,m=1/0;for(let t=0;t0&&(h=t,m=n)}let b=e[2*h],y=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(VC(g,v,b,y,w,O)){const e=h,t=b,n=y;h=p,b=w,y=O,p=e,w=t,O=n}const E=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}}(g,v,b,y,w,O);this._cx=E.x,this._cy=E.y;for(let t=0;t0&&Math.abs(l-o)<=UC&&Math.abs(c-a)<=UC)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=$C[--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(GC(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<$C.length&&($C[i++]=s)}else{if(0===i)break;e=$C[--i]}}return o}_link(e,t){this._halfedges[e]=t,-1!==t&&(this._halfedges[t]=e)}_addTriangle(e,t,n,r,i,o){const a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=t,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}function HC(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function qC(e,t,n,r,i,o){const a=(r-t)*(i-e),s=(n-e)*(o-t);return Math.abs(a-s)>=33306690738754716e-32*Math.abs(a+s)?a-s:0}function VC(e,t,n,r,i,o){return(qC(i,o,e,t,n,r)||qC(e,t,n,r,i,o)||qC(n,r,i,o,e,t))<0}function GC(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,m=d*d+h*h;return u*(f*m-p*h)-l*(c*m-p*d)+(u*u+l*l)*(c*h-f*d)<0}function YC(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 KC(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;XC(e,n+r>>1,i),t[e[n]]>t[e[r]]&&XC(e,n,r),t[e[i]]>t[e[r]]&&XC(e,i,r),t[e[n]]>t[e[i]]&&XC(e,n,i);const a=e[i],s=t[a];for(;;){do{i++}while(t[e[i]]s);if(o=o-n?(KC(e,t,i,r),KC(e,t,n,o-1)):(KC(e,t,n,o-1),KC(e,t,i,r))}}function XC(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function JC(e){return e[0]}function QC(e){return e[1]}class ZC{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 e_{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 t_{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 n_=2*Math.PI,r_=Math.pow;function i_(e){return e[0]}function o_(e){return e[1]}function a_(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class s_{static from(e,t=i_,n=o_,r){return new s_("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 t_(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=r_(t-u[2*e],2)+r_(n-u[2*e+1],2);const f=r[e];let d=f;do{let r=s[d];const f=r_(t-u[2*r],2)+r_(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&&p_(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,w=t.x-(y<<4),O=127&w,E=32-O,C=t.y1-t.y0,_=(t.y+t.y0)*x+(w>>5),k=0;k>>O:0);_+=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}}(kl()),f=function(e){var t=[],n=-1;for(;++n>5)*s[1]),h=null,p=l.length,m=-1,g=[],v=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);++m>1,b.y=s[1]*(c()+.5)>>1,h_(u,b,v,m),b.hasText&&d(f,b,h)&&(g.push(b),h?m_(h,b):h=[{x:b.x+b.x0,y:b.y+b.y0},{x:b.x+b.x1,y:b.y+b.y1}],b.x-=s[0]>>1,b.y-=s[1]>>1)}return g},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=v_(e),f):t},f.fontStyle=function(e){return arguments.length?(r=v_(e),f):r},f.fontWeight=function(e){return arguments.length?(i=v_(e),f):i},f.rotate=function(e){return arguments.length?(o=v_(e),f):o},f.text=function(t){return arguments.length?(e=v_(t),f):e},f.spiral=function(e){return arguments.length?(u=b_[e]||e,f):u},f.fontSize=function(e){return arguments.length?(n=v_(e),f):n},f.padding=function(e){return arguments.length?(a=v_(e),f):a},f.random=function(e){return arguments.length?(c=e,f):c},f}function h_(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(b+y),Math.abs(b-y))}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*f_),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 w=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),k=w[2048*(d+c)+(f+l)<<2]?1<<31-l%32:0;O[_]|=k,E|=k}E?C=c:(t.y0++,u--,c--,d++)}t.y1=t.y0+C,t.sprite=O.slice(0,(t.y1-t.y0)*s)}}}function p_(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 m_(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 g_(e){var t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function v_(e){return"function"==typeof e?e:function(){return e}}var b_={archimedean:g_,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 y_=["x","y","font","fontSize","fontStyle","fontWeight","angle"],x_=["text","font","rotate","fontSize","fontStyle","fontWeight"];function w_(e){Lo.call(this,d_(),e)}w_.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:y_}]},Object(ie.z)(w_,Lo,{transform(e,t){!e.size||e.size[0]&&e.size[1]||Object(ie.o)("Wordcloud size dimensions must be non-zero.");const n=e.modified();if(!(n||t.changed(t.ADD_REM)||x_.some((function(n){const r=e[n];return Object(ie.E)(r)&&t.modified(r.fields)}))))return;const r=t.materialize(t.SOURCE).source,i=this.value,o=e.as||y_;let a,s=e.fontSize||14;if(Object(ie.E)(s)?a=e.fontSizeRange:s=Object(ie.m)(s),a){const e=s,t=xd("sqrt")().domain(Object(ie.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(Zo).layout(),l=i.size(),c=l[0]>>1,f=l[1]>>1,d=u.length;for(let e,t,n=0;nnew Uint8Array(e),E_=e=>new Uint16Array(e),C_=e=>new Uint32Array(e);function __(e,t,n){const r=(t<257?O_:t<65537?E_:C_)(e);return n&&r.set(n),r}function k_(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=C_(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 S_(e){Lo.call(this,function(){let e=8,t=[],n=C_(0),r=__(0,e),i=__(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=__(t,e,r),i=__(t,e))}}}(),e),this._indices=null,this._dims=null}function j_(e){Lo.call(this,null,e)}S_.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(ie.z)(S_,Lo,{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(g=h,v=Math.min(f,p);gp)for(g=Math.max(f,p),v=d;gc)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 D_(e){this.type=e}var F_,T_,M_,N_,P_;D_.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",F_[3]="Identifier",F_[4]="Keyword",F_[5]="Null",F_[6]="Numeric",F_[7]="Punctuator",F_[8]="String",F_[9]="RegularExpression";var B_="ILLEGAL",L_=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]"),R_=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 z_(e,t){if(!e)throw new Error("ASSERT: "+t)}function I_(e){return e>=48&&e<=57}function U_(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function $_(e){return"01234567".indexOf(e)>=0}function W_(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 H_(e){return 10===e||13===e||8232===e||8233===e}function q_(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&L_.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&&R_.test(String.fromCharCode(e))}const G_={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 Y_(){for(;M_1114111||"}"!==e)&&fk({},"Unexpected token %0",B_),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=T_.charCodeAt(M_++),t=String.fromCharCode(e),92===e&&(117!==T_.charCodeAt(M_)&&fk({},"Unexpected token %0",B_),++M_,(e=K_("u"))&&"\\"!==e&&q_(e.charCodeAt(0))||fk({},"Unexpected token %0",B_),t=e);M_>>="===(r=T_.substr(M_,4))?{type:7,value:r,start:i,end:M_+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:M_+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:7,value:t,start:i,end:M_+=2}:("//"===t&&fk({},"Unexpected token %0",B_),"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:i,end:++M_}:void fk({},"Unexpected token %0",B_))}function ek(){var e,t,n;if(z_(I_((n=T_[M_]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=M_,e="","."!==n){if(e=T_[M_++],n=T_[M_],"0"===e){if("x"===n||"X"===n)return++M_,function(e){let t="";for(;M_=0&&fk({},"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";fk({},"Invalid regular expression")}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){fk({},"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:M_}}function nk(){if(Y_(),M_>=N_)return{type:2,start:M_,end:M_};const e=T_.charCodeAt(M_);return q_(e)?Q_():40===e||41===e||59===e?Z_():39===e||34===e?function(){var e,t,n,r,i="",o=!1;for(z_("'"===(e=T_[M_])||'"'===e,"String literal must starts with a quote"),t=M_,++M_;M_=0&&M_(z_(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 Sk(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=P_,u=kk(),0===(i=Ak(r=P_)))return u;for(r.prec=i,rk(),t=[e,P_],o=[u,r,a=kk()];(i=Ak(P_))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=ok(s,u,a),o.push(n);(r=rk()).prec=i,o.push(r),t.push(P_),n=kk(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=ok(o[l-1].value,o[l-2],n),l-=2;return n}(),pk("?")&&(rk(),t=Sk(),hk(":"),e=function(e,t,n){const r=new D_("ConditionalExpression");return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,Sk())),e}function jk(){const e=Sk();if(pk(","))throw new Error("Disabled.");return e}var Dk={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 Fk(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(ie.o)("Missing arguments to clamp function."),t.length>3&&Object(ie.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),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase","String",0),lower:t("toLowerCase","String",0),substring:t("substring","String"),split:t("split","String"),trim:t("trim","String",0),regexp:"RegExp",test:t("test","RegExp"),if:function(t){t.length<3&&Object(ie.o)("Missing arguments to if function."),t.length>3&&Object(ie.o)("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}var Tk,Mk,Nk,Pk,Bk,Lk=new Bb,Rk=new Bb,zk={point:iy,lineStart:iy,lineEnd:iy,polygonStart:function(){Lk=new Bb,zk.lineStart=Ik,zk.lineEnd=Uk},polygonEnd:function(){var e=+Lk;Rk.add(e<0?Ib+e:e),this.lineStart=this.lineEnd=this.point=iy},sphere:function(){Rk.add(Ib)}};function Ik(){zk.point=$k}function Uk(){Wk(Tk,Mk)}function $k(e,t){zk.point=Wk,Tk=e,Mk=t,Nk=e*=$b,Pk=Vb(t=(t*=$b)/2+zb),Bk=Qb(t)}function Wk(e,t){var n=(e*=$b)-Nk,r=n>=0?1:-1,i=r*n,o=Vb(t=(t*=$b)/2+zb),a=Qb(t),s=Bk*a,u=Pk*o+s*Vb(i),l=s*r*Qb(i);Lk.add(qb(l,u)),Nk=e,Pk=o,Bk=a}var Hk,qk,Vk,Gk,Yk,Kk,Xk,Jk,Qk,Zk,eA,tA={point:nA,lineStart:iA,lineEnd:oA,polygonStart:function(){tA.point=aA,tA.lineStart=sA,tA.lineEnd=uA,Qk=new Bb,zk.polygonStart()},polygonEnd:function(){zk.polygonEnd(),tA.point=nA,tA.lineStart=iA,tA.lineEnd=oA,Lk<0?(Hk=-(Vk=180),qk=-(Gk=90)):Qk>1e-6?Gk=90:Qk<-1e-6&&(qk=-90),eA[0]=Hk,eA[1]=Vk},sphere:function(){Hk=-(Vk=180),qk=-(Gk=90)}};function nA(e,t){Zk.push(eA=[Hk=e,Vk=e]),tGk&&(Gk=t)}function rA(e,t){var n=dx([e*$b,t*$b]);if(Jk){var r=px(Jk,n),i=px([r[1],-r[0],0],r);vx(i),i=fx(i);var o,a=e-Yk,s=a>0?1:-1,u=i[0]*Ub*s,l=Wb(a)>180;l^(s*YkGk&&(Gk=o):l^(s*Yk<(u=(u+360)%360-180)&&uGk&&(Gk=t)),l?elA(Hk,Vk)&&(Vk=e):lA(e,Vk)>lA(Hk,Vk)&&(Hk=e):Vk>=Hk?(eVk&&(Vk=e)):e>Yk?lA(Hk,e)>lA(Hk,Vk)&&(Vk=e):lA(e,Vk)>lA(Hk,Vk)&&(Hk=e)}else Zk.push(eA=[Hk=e,Vk=e]);tGk&&(Gk=t),Jk=n,Yk=e}function iA(){tA.point=rA}function oA(){eA[0]=Hk,eA[1]=Vk,tA.point=nA,Jk=null}function aA(e,t){if(Jk){var n=e-Yk;Qk.add(Wb(n)>180?n+(n>0?360:-360):n)}else Kk=e,Xk=t;zk.point(e,t),rA(e,t)}function sA(){zk.lineStart()}function uA(){aA(Kk,Xk),zk.lineEnd(),Wb(Qk)>1e-6&&(Hk=-(Vk=180)),eA[0]=Hk,eA[1]=Vk,Jk=null}function lA(e,t){return(t-=e)<0?t+360:t}function cA(e,t){return e[0]-t[0]}function fA(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t",IA[3]="Identifier",IA[4]="Keyword",IA[5]="Null",IA[6]="Numeric",IA[7]="Punctuator",IA[8]="String",IA[9]="RegularExpression";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]"),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 UA(e,t){for(var n,r,i=t.fields,o=t.values,a=i.length,s=0;st.indexOf(e)>=0):t},R_union:function(e,t){var n=Object(ie.eb)(t[0]),r=Object(ie.eb)(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 WA(e,t,n,r){"Literal"!==t[0].type&&Object(ie.o)("First argument to selection functions must be a string literal.");const i=t[0].value,o=":"+i;"intersect"!==(t.length>=2&&Object(ie.W)(t).value)||Object(ie.w)(r,"@unit")||(r["@unit"]=n.getData(i).indataRef(n,"unit")),Object(ie.w)(r,o)||(r[o]=n.getData(i).tuplesRef())}function HA(e){const t=this.context.data[e];return t?t.values.value:[]}const qA=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},VA=qA("format"),GA=qA("timeFormat"),YA=qA("utcFormat"),KA=qA("timeParse"),XA=qA("utcParse"),JA=new Date(2e3,0,1);function QA(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(JA.setYear(2e3),JA.setMonth(e),JA.setDate(t),GA.call(this,JA,n)):""}function ZA(e,t,n,r){"Literal"!==t[0].type&&Object(ie.o)("First argument to data functions must be a string literal.");const i=t[0].value,o=":"+i;if(!Object(ie.w)(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(e){}}function eS(e,t,n,r){if("Literal"===t[0].type)tS(n,r,t[0].value);else for(e in n.scales)tS(n,r,e)}function tS(e,t,n){const r="%"+n;if(!Object(ie.w)(t,r))try{t[r]=e.scaleRef(n)}catch(e){}}function nS(e,t){let n;return Object(ie.E)(e)?e:Object(ie.J)(e)?(n=t.scales[e])&&n.value:void 0}function rS(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=eS,n._range=eS,n._scale=eS;const r=t=>"_["+("Literal"===t.type?Object(ie.bb)("%"+t.value):Object(ie.bb)("%")+"+"+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 iS(e,t){return function(n,r,i){if(n){const t=nS(n,(i||this).context);return t&&t.path[e](r)}return t(r)}}const oS=iS("area",(function(e){return Rk=new Bb,Pb(e,zk),2*Rk})),aS=iS("bounds",(function(e){var t,n,r,i,o,a,s;if(Gk=Vk=-(Hk=qk=1/0),Zk=[],Pb(e,tA),n=Zk.length){for(Zk.sort(cA),t=1,o=[r=Zk[0]];tlA(r[0],r[1])&&(r[1]=i[1]),lA(i[0],r[1])>lA(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=lA(r[1],i[0]))>a&&(a=s,Hk=i[0],Vk=r[1])}return Zk=eA=null,Hk===1/0||qk===1/0?[[NaN,NaN],[NaN,NaN]]:[[Hk,qk],[Vk,Gk]]})),sS=iS("centroid",(function(e){dA=hA=pA=mA=gA=vA=bA=yA=0,xA=new Bb,wA=new Bb,OA=new Bb,Pb(e,SA);var t=+xA,n=+wA,r=+OA,i=Kb(t,n,r);return i<1e-12&&(t=vA,n=bA,r=yA,hA<1e-6&&(t=pA,n=mA,r=gA),(i=Kb(t,n,r))<1e-12)?[NaN,NaN]:[qb(n,t)*Ub,ry(r/i)*Ub]}));function uS(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(t){e.warn(t)}return n[n.length-1]}function lS(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function cS(e){const t=rc(e);return.2126*lS(t.r)+.7152*lS(t.g)+.0722*lS(t.b)}function fS(e,t){return e===t||e!=e&&t!=t||(Object(ie.B)(e)?!(!Object(ie.B)(t)||e.length!==t.length)&&function(e,t){for(let n=0,r=e.length;ndS(e,t)}function pS(e){return Object(ie.B)(e)||ArrayBuffer.isView(e)?e:null}function mS(e){return pS(e)||(Object(ie.J)(e)?e:null)}const gS=e=>e.data;function vS(e,t){const n=HA.call(t,e);return n.root&&n.root.lookup||{}}const bS=()=>"undefined"!=typeof window&&window||null;const yS={random:()=>Zo(),cumulativeNormal:ca,cumulativeLogNormal:ga,cumulativeUniform:Oa,densityNormal:la,densityLogNormal:ma,densityUniform:wa,quantileNormal:fa,quantileLogNormal:va,quantileUniform:Ea,sampleNormal:ua,sampleLogNormal:pa,sampleUniform:xa,isArray:ie.B,isBoolean:ie.C,isDate:ie.D,isDefined:e=>void 0!==e,isNumber:ie.G,isObject:ie.H,isRegExp:ie.I,isString:ie.J,isTuple:ro,isValid:e=>null!=e&&e==e,toBoolean:ie.cb,toDate:ie.db,toNumber:ie.eb,toString:ie.gb,indexof:function(e,...t){return mS(e).indexOf(...t)},join:function(e,...t){return pS(e).join(...t)},lastindexof:function(e,...t){return mS(e).lastIndexOf(...t)},replace:function(e,t,n){return Object(ie.E)(n)&&Object(ie.o)("Function argument passed to replace."),String(e).replace(t,n)},reverse:function(e){return pS(e).slice().reverse()},slice:function(e,...t){return mS(e).slice(...t)},flush:ie.v,lerp:ie.L,merge:function(){const e=[].slice.call(arguments);return e.unshift({}),Object(ie.p)(...e)},pad:ie.R,peek:ie.W,span:ie.Z,inrange:ie.A,truncate:ie.hb,rgb:rc,lab:Lf,hcl:Hf,hsl:cc,luminance:cS,contrast:function(e,t){const n=cS(e),r=cS(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:$a,format:VA,utcFormat:YA,utcParse:XA,utcOffset:Xn,utcSequence:Zn,timeFormat:GA,timeParse:KA,timeOffset:Kn,timeSequence:Qn,timeUnitSpecifier:wn,monthFormat:function(e){return QA.call(this,e,1,"%B")},monthAbbrevFormat:function(e){return QA.call(this,e,1,"%b")},dayFormat:function(e){return QA.call(this,0,2+e,"%A")},dayAbbrevFormat:function(e){return QA.call(this,0,2+e,"%a")},quarter:ie.X,utcquarter:ie.jb,week:_n,utcweek:Fn,dayofyear:Cn,utcdayofyear:Dn,warn:function(){return uS(this.context.dataflow,"warn",arguments)},info:function(){return uS(this.context.dataflow,"info",arguments)},debug:function(){return uS(this.context.dataflow,"debug",arguments)},extent:ie.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 ep).set(r[0],r[1],i[0],i[1]);return uv(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=Object(ie.i)(e.marktype),r=Object(ie.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:ie.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=bS();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=bS();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return ld(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(ie.ib).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?Ch(n,t=t||hh(e)):e}},panLinear:ie.S,panLog:ie.T,panPow:ie.U,panSymlog:ie.V,zoomLinear:ie.nb,zoomLog:ie.ob,zoomPow:ie.pb,zoomSymlog:ie.qb,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?ie.ib:Object(ie.B)(n)||ro(n)?n:hS(n),d.remove(c)),t&&d.insert(t),r&&(c=hS(r),u.value.some(c)?d.remove(c):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1}},xS=["view","item","group","xy","x","y"],wS={},OS={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>"_[".concat(Object(ie.bb)("$"+e),"]"),functions:function(e){const t=Fk(e);xS.forEach(e=>t[e]="event.vega."+e);for(const e in yS)t[e]="this."+e;return Object(ie.p)(t,rS(e,yS,wS)),t},constants:Dk,visitors:wS},ES=function(e){const t=(e=e||{}).allowed?Object(ie.fb)(e.allowed):{},n=e.forbidden?Object(ie.fb)(e.forbidden):{},r=e.constants||Dk,i=(e.functions||Fk)(f),o=e.globalvar,a=e.fieldvar,s=Object(ie.E)(o)?o:e=>"".concat(o,'["').concat(e,'"]');let u={},l={},c=0;function f(e){if(Object(ie.J)(e))return e;const t=d[e.type];return null==t&&Object(ie.o)("Unsupported type: "+e.type),t(e)}const d={Literal:e=>e.raw,Identifier:e=>{const i=e.name;return c>0?i:Object(ie.w)(n,i)?Object(ie.o)("Illegal identifier: "+i):Object(ie.w)(r,i)?r[i]:Object(ie.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(ie.o)("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=Object(ie.w)(i,t)&&i[t];return r||Object(ie.o)("Unrecognized function: "+t),Object(ie.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}(OS);function CS(e,t,n){return 1===arguments.length?yS[e]:(yS[e]=t,n&&(wS[e]=n),ES&&(ES.functions[e]="this."+e),this)}function _S(e,t){const n={};let r;try{r=function(e){M_=0,N_=(T_=e).length,P_=null,ik();const t=jk();if(2!==P_.type)throw new Error("Unexpect token after expression.");return t}(e=Object(ie.J)(e)?e:Object(ie.bb)(e)+"")}catch(t){Object(ie.o)("Expression parse error: "+e)}r.visit(e=>{if("CallExpression"!==e.type)return;const r=e.callee.name,i=OS.visitors[r];i&&i(r,e.arguments,t,n)});const i=ES(r);return i.globals.forEach(e=>{const r="$"+e;!Object(ie.w)(n,r)&&t.getSignal(e)&&(n[r]=t.signalRef(e))}),{$expr:Object(ie.p)({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}CS("bandwidth",(function(e,t){const n=nS(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),eS),CS("copy",(function(e,t){const n=nS(e,(t||this).context);return n?n.copy():void 0}),eS),CS("domain",(function(e,t){const n=nS(e,(t||this).context);return n?n.domain():[]}),eS),CS("range",(function(e,t){const n=nS(e,(t||this).context);return n&&n.range?n.range():[]}),eS),CS("invert",(function(e,t,n){const r=nS(e,(n||this).context);return r?Object(ie.B)(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}),eS),CS("scale",(function(e,t,n){const r=nS(e,(n||this).context);return r?r(t):void 0}),eS),CS("gradient",(function(e,t,n,r,i){e=nS(e,(i||this).context);const o=uh(t,n);let a=e.domain(),s=a[0],u=Object(ie.W)(a),l=ie.y;return u-s?l=Md(e,s,u):e=(e.interpolator?xd("sequential")().interpolator(e.interpolator()):xd("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(ie.W)(a)&&a.push(u)),a.forEach(t=>o.stop(l(t),e(t))),o}),eS),CS("geoArea",oS,eS),CS("geoBounds",aS,eS),CS("geoCentroid",sS,eS),CS("geoShape",(function(e,t,n){const r=nS(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}}),eS),CS("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(ie.o)("First argument to indata must be a string literal."),"Literal"!==t[1].type&&Object(ie.o)("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,a="@"+o;Object(ie.w)(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),CS("data",HA,ZA),CS("treePath",(function(e,t,n){const r=vS(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(gS):void 0}),ZA),CS("treeAncestors",(function(e,t){const n=vS(e,this)[t];return n?n.ancestors().map(gS):void 0}),ZA),CS("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(g).forEach(e=>{g[e]=Object.keys(g[e]).map(t=>g[e][t]).reduce((n,r)=>void 0===n?r:$A[b[e]+"_"+t](n,r))}),m=Object.keys(v),n&&m.length&&(g.vlMulti="union"===t?{or:m.reduce((e,t)=>(e.push(...v[t]),e),[])}:{and:m.map(e=>({or:v[e]}))}),g}),WA);const kS=Object(ie.fb)(["rule"]),AS=Object(ie.fb)(["group","image","rect"]);function SS(e){return(e+"").toLowerCase()}function jS(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 DS={operator:(e,t)=>jS(e,["_"],t.code),parameter:(e,t)=>jS(e,["datum","_"],t.code),event:(e,t)=>jS(e,["event"],t.code),handler:(e,t)=>jS(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(ie.bb)(e)+"]";i+="$=".concat(r[e].code,";if(").concat(t,"!==$)").concat(t,"=$,m=1;")}return i+=function(e,t){let n="";return kS[t]||(e.x2&&(e.x?(AS[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?(AS[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;",jS(e,["item","_"],i)},codegen:{get(e){const t="[".concat(e.map(ie.bb).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 FS(e,t,n){if(!e||!Object(ie.H)(e))return e;for(let r,i=0,o=TS.length;ie&&e.$tupleid?io:e);return t.fn[n]||(t.fn[n]=Object(ie.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 io}}];const MS={skip:!0};function NS(e,t,n,r){return new PS(e,t,n,r)}function PS(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||DS,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function BS(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)}PS.prototype=BS.prototype={fork(){const e=new BS(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"===SS(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[SS(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"!==SS(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(ie.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(ie.B)(i)?i.map(e=>FS(e,n,t)):FS(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(ie.o)("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),n.stream(e,i)},parseUpdate:function(e){var t,n=Object(ie.H)(n=e.source)?n.$ref:n,r=this.get(n),i=e.update,o=void 0;r||Object(ie.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],MS)}),Object.keys(r||{}).forEach(e=>{n.pulse(t.data[e].input,n.changeset().remove(ie.ib).insert(r[e]))}),(e.subcontext||[]).forEach((e,n)=>{const r=t.subcontext[n];r&&r.setState(e)})}};function LS(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function RS(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 zS(e,t){var n=e._runtime.data;return Object(ie.w)(n,t)||Object(ie.o)("Unrecognized data set: "+t),n[t]}function IS(e,t){fo(t)||Object(ie.o)("Second argument to changes must be a changeset.");const n=zS(this,e);return n.modified=!0,this.pulse(n.input,t)}function US(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function $S(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function WS(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function HS(e,t,n){var r,i,o=e._renderer,a=o&&o.canvas();return a&&(i=WS(e),(r=ug(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(ie.J)(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(ie.m)(e),item:Object(ie.m)(t||{}),group:i,xy:o,x:e=>o(e)[0],y:e=>o(e)[1]}}(e,n,r),t}const qS={trap:!1};function VS(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return!(!1===r||Object(ie.H)(r)&&!r[n])||(e.warn("Blocked ".concat(t," ").concat(n," event listener.")),!1)}function GS(e){return e.item}function YS(e){return e.item.mark.source}function KS(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function XS(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 JS(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(ie.n)(r.debounce,i.update))),function(e,t,n,r){const i=XS("div",{class:"vega-bind"}),o="radio"===n.input?i:i.appendChild(XS("label"));o.appendChild(XS("span",{class:"vega-bind-name"},n.name||n.signal)),t.appendChild(i);let a=QS;switch(n.input){case"checkbox":a=ZS;break;case"select":a=ej;break;case"radio":a=tj;break;case"range":a=nj}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 QS(e,t,n,r){const i=XS("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 ZS(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=XS("input",i);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=e=>o.checked=!!e||null}function ej(e,t,n,r){const i=XS("select",{name:n.signal}),o=n.labels||[];n.options.forEach((e,t)=>{const n={value:e};rj(e,r)&&(n.selected=!0),i.appendChild(XS("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};rj(t,r)&&(s.checked=!0);const u=XS("input",s);u.addEventListener("change",()=>e.update(t));const l=XS("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 rj(e,t){return e===t||e+""==t+""}function ij(e,t,n,r,i,o){return(t=t||new r(e.loader())).initialize(n,US(e),$S(e),WS(e),i,o).background(e.background())}function oj(e,t){return t?function(){try{t.apply(this,arguments)}catch(t){e.error(t)}}:null}function aj(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 sj=e=>+e||0;function uj(e){return Object(ie.H)(e)?{top:sj(e.top),bottom:sj(e.bottom),left:sj(e.left),right:sj(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(sj(e))}async function lj(e,t,n,r){const i=sv(t),o=i&&i.headless;return o||Object(ie.o)("Unrecognized renderer type: "+t),await e.runAsync(),ij(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}var cj={skip:!0};function fj(e,t){var n=e.autosize(),r=e.padding();return t-(n&&"padding"===n.contains?r.left+r.right:0)}function dj(e,t){var n=e.autosize(),r=e.padding();return t-(n&&"padding"===n.contains?r.top+r.bottom:0)}function hj(e,t){return t.modified&&Object(ie.B)(t.input.value)&&e.indexOf("_:vega:_")}function pj(e,t){return!("parent"===e||t instanceof Ro.proxy)}function mj(e,t,n,r){const i=e.element();i&&i.setAttribute("title",function(e){return null==e?"":Object(ie.B)(e)?gj(e):Object(ie.H)(e)&&!Object(ie.D)(e)?(t=e,Object.keys(t).map(e=>{const n=t[e];return e+": "+(Object(ie.B)(n)?gj(n):vj(n))}).join("\n")):e+"";var t}(r))}function gj(e){return"["+e.map(vj).join(", ")+"]"}function vj(e){return Object(ie.B)(e)?"[…]":Object(ie.H)(e)&&!Object(ie.D)(e)?"{…}":e}function bj(e,t){const n=this;if(t=t||{},Po.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(ie.p)({},e.locale,t.locale);n.locale(Yi(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||ov.Canvas,n._scenegraph=new tg;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||mj,n._redraw=!0,n._handler=(new wg).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=Object(ie.p)({defaults:{}},e),n=(e,t)=>{t.forEach(t=>{Object(ie.B)(e[t])&&(e[t]=Object(ie.fb)(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 NS(e,Ro,yS,n).parse(t)}(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map(e=>({state:null,param:Object(ie.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=fj(n,n._width),n._viewHeight=dj(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=fj(e,t.size),o()},{size:n}),e._resizeHeight=e.add(null,t=>{e._height=t.size,e._viewHeight=dj(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(ie.J)(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(ie.J)(n)||(r=n.item,n=n.user),RS(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 yj(e,t){return Object(ie.w)(e._signals,t)?e._signals[t]:Object(ie.o)("Unrecognized signal name: "+Object(ie.bb)(t))}function xj(e,t){const n=(e._targets||[]).filter(e=>e._update&&e._update.handler===t);return n.length?n[0]:null}function wj(e,t,n,r){let i=xj(n,r);return i||(i=oj(e,()=>r(t,n.value)),i.handler=r,e.on(n,null,i)),e}function Oj(e,t,n){const r=xj(t,n);return r&&t._targets.remove(r),e}Object(ie.z)(bj,Po,{async evaluate(e,t,n){if(await Po.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,i=WS(r=this),o=US(r),a=$S(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&&eo(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&&LS(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=yj(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",uj(e)):uj(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?(sv(e)||Object(ie.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&&(Po.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(yj(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,cj),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal("height",r,cj),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=oj(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 wj(this,e,yj(this,e),t)},removeSignalListener(e,t){return Oj(this,yj(this,e),t)},addDataListener(e,t){return wj(this,e,zS(this,e).values,t)},removeDataListener(e,t){return Oj(this,zS(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=RS(this,null);this._globalCursor=!!e,t&&RS(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 UO,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?zO():+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 xo(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(HS(i,n,r))})};if("timer"===e)VS(i,"timer",t)&&i.timer(a,t);else if("view"===e)VS(i,"view",t)&&i.addEventListener(t,a,qS);else if("window"===e?VS(i,"window",t)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&VS(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",GS),YS,KS(e)),this.on(this.events("view","mouseout",GS),YS,KS(t)),this},data:function(e,t){return arguments.length<2?zS(this,e).values.value:IS.call(this,e,ho().remove(ie.ib).insert(t))},change:IS,insert:function(e,t){return IS.call(this,e,ho().insert(t))},remove:function(e,t){return IS.call(this,e,ho().remove(t))},scale:function(e){var t=this._runtime.scales;return Object(ie.w)(t,e)||Object(ie.o)("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=sv(r);e=n._el=e?aj(n,e):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),LS(t,e.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||wg,s=e?o.renderer:o.headless;return n._renderer=s?ij(n,n._renderer,e,s):null,n._handler=function(e,t,n,r){const i=new r(e.loader(),oj(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,WS(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=aj(n,t):e.appendChild(XS("form",{class:"vega-bindings"})),n._bind.forEach(e=>{e.param.element&&"container"!==i&&(e.element=aj(n,e.param.element))}),n._bind.forEach(e=>{JS(n,e.element||t,e)})),n},toImageURL:async function(e,t){e!==ov.Canvas&&e!==ov.SVG&&e!==ov.PNG&&Object(ie.o)("Unrecognized image type: "+e);const n=await lj(this,e,t);return e===ov.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 lj(this,ov.Canvas,e,t)).canvas()},toSVG:async function(e){return(await lj(this,ov.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:hj,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 Ej=/[[\]{}]/,Cj={"*":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 _j,kj;function Aj(e,t,n){return _j=t||"view",kj=n||Cj,jj(e.trim()).map(Dj)}function Sj(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 jj(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(Dj);const i=Dj(e.slice(1).trim());if(i.between)return{between:n,stream:i};i.between=n;return i}(e):function(e){const t={source:_j},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=Sj(e,l,":"),r1?(t.type=n[1],a?t.markname=n[0].slice(1):(c=n[0],kj[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 Fj(e){return Object(ie.H)(e)?e:{type:e||"pad"}}const Tj=e=>+e||0;function Mj(e){return Object(ie.H)(e)?e.signal?e:{top:Tj(e.top),bottom:Tj(e.bottom),left:Tj(e.left),right:Tj(e.right)}:{top:t=Tj(e),bottom:t,left:t,right:t};var t}const Nj=e=>Object(ie.H)(e)&&!Object(ie.B)(e)?Object(ie.p)({},e):{value:e};function Pj(e,t,n,r){if(null!=n){return Object(ie.H)(n)&&!Object(ie.B)(n)||Object(ie.B)(n)&&n.length&&Object(ie.H)(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1}return 0}function Bj(e,t,n){for(const n in t)Pj(e,n,t[n]);for(const t in n)Pj(e,t,n[t],"update")}function Lj(e,t,n){for(const r in t)n&&Object(ie.w)(n,r)||(e[r]=Object(ie.p)(e[r]||{},t[r]));return e}function Rj(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}function zj(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const Ij=e=>Object(ie.J)(e)?Object(ie.bb)(e):e.signal?"(".concat(e.signal,")"):Hj(e);function Uj(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map(e=>null==e?null:Object(ie.bb)(e));for(;t.length&&null==Object(ie.W)(t);)t.pop();return t.unshift(Ij(e.gradient)),"gradient(".concat(t.join(","),")")}(e);let t=e.signal?"(".concat(e.signal,")"):e.color?function(e){return e.c?$j("hcl",e.h,e.c,e.l):e.h||e.s?$j("hsl",e.h,e.s,e.l):e.l||e.a?$j("lab",e.l,e.a,e.b):e.r||e.g||e.b?$j("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?Hj(e.field):void 0!==e.value?Object(ie.bb)(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=Ij(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?"":"*"+Wj(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(Wj(e.exponent),")")),null!=e.mult&&(t+="*".concat(Wj(e.mult))),null!=e.offset&&(t+="+".concat(Wj(e.offset))),e.round&&(t="round(".concat(t,")")),t}const $j=(e,t,n,r)=>"(".concat(e,"(").concat([t,n,r].map(Uj).join(","),")+'')");function Wj(e){return Object(ie.H)(e)?"("+Uj(e)+")":e}function Hj(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(ie.o)("Invalid field reference: "+Object(ie.bb)(t));t.signal||(i=Object(ie.J)(i)?Object(ie.ab)(i).map(ie.bb).join("]["):e(i));return n+"["+i+"]"}(Object(ie.H)(e)?e:{datum:e})}function qj(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]||Rj(u,e)||zj(o,u,i[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c="frame"===n?i.group:"mark"===n?Object(ie.p)({},i.mark,i[t]):null,c)l=Rj(u,e)||("fill"===u||"stroke"===u)&&(Rj("fill",e)||Rj("stroke",e)),l||zj(o,u,c[u]);for(u in Object(ie.i)(r).forEach(t=>{const n=i.style&&i.style[t];for(const t in n)Rj(t,e)||zj(o,t,n[t])}),e=Object(ie.p)({},e),o)c=o[u],c.signal?(s=s||{})[u]=c:a[u]=c;return e.enter=Object(ie.p)(a,e.enter),s&&(e.update=Object(ie.p)(s,e.update)),e}(e,t,n,r,i.config);for(const n in e)a[n]=Vj(e[n],t,o,i);return o}function Vj(e,t,n,r){const i={},o={};for(const t in e)null!=e[t]&&(i[t]=Gj((a=e[t],Object(ie.B)(a)?function(e){let t="";return e.forEach(e=>{const n=Uj(e);t+=e.test?"(".concat(e.test,")?").concat(n,":"):n}),":"===Object(ie.W)(t)&&(t+="null"),t}(a):Uj(a)),r,n,o));var a;return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function Gj(e,t,n,r){const i=_S(e,t);return i.$fields.forEach(e=>r[e]=1),Object(ie.p)(n,i.$params),i.$expr}const Yj=["value","update","init","react","bind"];function Kj(e,t){Object(ie.o)(e+' for "outer" push: '+Object(ie.bb)(t))}function Xj(e,t){const n=e.name;if("outer"===e.push)t.signals[n]||Kj("No prior signal definition",n),Yj.forEach(t=>{void 0!==e[t]&&Kj("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 Jj(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function Qj(e,t,n,r){return new Jj(e,t,n,r)}function Zj(e,t){return Qj("operator",e,t)}function eD(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function tD(e,t){return t?{$field:e,$name:t}:{$field:e}}const nD=tD("key");function rD(e,t){return{$compare:e,$order:t}}function iD(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}function oD(e){return e&&e.signal}function aD(e){if(oD(e))return!0;if(Object(ie.H)(e))for(const t in e)if(aD(e[t]))return!0;return!1}function sD(e,t){return null!=e?e:t}function uD(e){return e&&e.signal||e}function lD(e,t){return(e.merge?cD:e.stream?fD:e.type?dD:Object(ie.o)("Invalid stream specification: "+Object(ie.bb)(e)))(e,t)}function cD(e,t){const n=hD({merge:e.merge.map(e=>lD(e,t))},e,t);return t.addStream(n).id}function fD(e,t){const n=hD({stream:lD(e.stream,t)},e,t);return t.addStream(n).id}function dD(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=hD({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function hD(e,t,n){let r=t.between;return r&&(2!==r.length&&Object(ie.o)('Stream "between" parameter must have 2 entries: '+Object(ie.bb)(t)),e.between=[lD(r[0],n),lD(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=_S("("+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 pD={code:"_.$value",ast:{type:"Identifier",value:"value"}};function mD(e,t,n){const r=e.encode,i={target:n};let o=e.events,a=e.update,s=[];o||Object(ie.o)("Signal update missing events specification."),Object(ie.J)(o)&&(o=Aj(o,t.isSubscope()?"scope":"view")),o=Object(ie.i)(o).filter(e=>e.signal||e.scale?(s.push(e),0):1),s.length>1&&(s=[gD(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&Object(ie.o)("Signal encode and update are mutually exclusive."),a="encode(item(),"+Object(ie.bb)(r)+")"),i.update=Object(ie.J)(a)?_S(a,t):null!=a.expr?_S(a.expr,t):null!=a.value?a.value:null!=a.signal?{$expr:pD,$params:{$value:t.signalRef(a.signal)}}:Object(ie.o)("Invalid signal update specification."),e.force&&(i.options={force:!0}),s.forEach(e=>t.addUpdate(Object(ie.p)(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):lD(e,t)}}(e,t),i)))}function gD(e){return{signal:"["+e.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}const vD=e=>(t,n,r)=>Qj(e,n,t||void 0,r),bD=vD("aggregate"),yD=vD("axisticks"),xD=vD("bound"),wD=vD("collect"),OD=vD("compare"),ED=vD("datajoin"),CD=vD("encode"),_D=vD("expression"),kD=vD("facet"),AD=vD("field"),SD=vD("key"),jD=vD("legendentries"),DD=vD("load"),FD=vD("mark"),TD=vD("multiextent"),MD=vD("multivalues"),ND=vD("overlap"),PD=vD("params"),BD=vD("prefacet"),LD=vD("projection"),RD=vD("proxy"),zD=vD("relay"),ID=vD("render"),UD=vD("scale"),$D=vD("sieve"),WD=vD("sortitems"),HD=vD("viewlayout"),qD=vD("values");let VD=0;const GD={min:"min",max:"max",count:"sum"};function YD(e,t){const n=t.getScale(e.name).params;let r;var i;for(r in n.domain=QD(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(ie.J)(o)){if(i&&Object(ie.w)(i,o))return t=Object(ie.p)({},t,{range:i[o]}),e(t,n,r);"width"===o?o=[0,{signal:"width"}]:"height"===o?o=Cd(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Object(ie.o)("Unrecognized scale range value: "+Object(ie.bb)(o))}else{if(o.scheme)return r.scheme=Object(ie.B)(o.scheme)?XD(o.scheme,n):KD(o.scheme,n),o.extent&&(r.schemeExtent=XD(o.extent,n)),void(o.count&&(r.schemeCount=KD(o.count,n)));if(o.step)return void(r.rangeStep=KD(o.step,n));if(Cd(t.type)&&!Object(ie.B)(o))return QD(o,t,n);Object(ie.B)(o)||Object(ie.o)("Unsupported range type: "+Object(ie.bb)(o))}return o.map(e=>(Object(ie.B)(e)?XD:KD)(e,n))}(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=KD(e.type||e),null!=e.gamma&&(t.interpolateGamma=KD(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=(i=e.nice,Object(ie.H)(i)?{interval:KD(i.interval),step:KD(i.step)}:KD(i))),null!=e.bins&&(n.bins=function(e,t){return e.signal||Object(ie.B)(e)?XD(e,t):t.objectProperty(e)}(e.bins,t)),e)Object(ie.w)(n,r)||"name"===r||(n[r]=KD(e[r],t))}function KD(e,t){return Object(ie.H)(e)?e.signal?t.signalRef(e.signal):Object(ie.o)("Unsupported object: "+Object(ie.bb)(e)):e}function XD(e,t){return e.signal?t.signalRef(e.signal):e.map(e=>KD(e,t))}function JD(e){Object(ie.o)("Can not find data set: "+Object(ie.bb)(e))}function QD(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(Object(ie.B)(e)?ZD:e.fields?tF:eF)(e,t,n);null==t.domainMin&&null==t.domainMax||Object(ie.o)("No scale domain defined for domainMin/domainMax to override.")}function ZD(e,t,n){return e.map(e=>KD(e,n))}function eF(e,t,n){const r=n.getData(e.data);return r||JD(e.data),Cd(t.type)?r.valuesRef(n,e.field,rF(e.sort,!1)):Sd(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function tF(e,t,n){const r=e.data,i=e.fields.reduce((e,t)=>(t=Object(ie.J)(t)?{data:r,field:t}:Object(ie.B)(t)||t.signal?function(e,t){const n="_:vega:_"+VD++,r=wD({});if(Object(ie.B)(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+Object(ie.bb)(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,$D({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e),[]);return(Cd(t.type)?nF:Sd(t.type)?iF:oF)(e,n,i)}function nF(e,t,n){const r=rF(e.sort,!0);let i,o;const a=n.map(e=>{const n=t.getData(e.data);return n||JD(e.data),n.countsRef(t,e.field,r)}),s={groupby:nD,pulse:a};r&&(i=r.op||"count",o=r.field?iD(i,r.field):"count",s.ops=[GD[i]],s.fields=[t.fieldRef(o)],s.as=[o]),i=t.add(bD(s));const u=t.add(wD({pulse:eD(i)}));return o=t.add(qD({field:nD,sort:t.sortRef(r),pulse:eD(u)})),eD(o)}function rF(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!GD[e.op]&&Object(ie.o)("Multiple domain scales can not be sorted using "+e.op):Object(ie.o)("No field provided for sort aggregate op: "+e.op):Object(ie.H)(e)?e.field="key":e={field:"key"}),e}function iF(e,t,n){const r=n.map(e=>{const n=t.getData(e.data);return n||JD(e.data),n.domainRef(t,e.field)});return eD(t.add(MD({values:r})))}function oF(e,t,n){const r=n.map(e=>{const n=t.getData(e.data);return n||JD(e.data),n.extentRef(t,e.field)});return eD(t.add(TD({extents:r})))}function aF(e,t,n){return Object(ie.B)(e)?e.map(e=>aF(e,t,n)):Object(ie.H)(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:Object(ie.o)("Unsupported parameter object: "+Object(ie.bb)(e)):e}const sF="value",uF=["size","shape","fill","stroke","strokeWidth","strokeDash","opacity"],lF={name:1,style:1,interactive:1},cF={value:0},fF={value:1};function dF(e){return e.type="group",e.interactive=e.interactive||!1,e}function hF(e,t){const n=(n,r)=>sD(e[n],sD(t[n],r));return n.isVertical=n=>"vertical"===sD(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>sD(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>sD(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>sD(e.columns,sD(t.columns,+n.isVertical(!0))),n}function pF(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 mF(e,t,n){return"item.anchor === '".concat("start","' ? ").concat(e," : item.anchor === '").concat("end","' ? ").concat(t," : ").concat(n)}const gF=mF(Object(ie.bb)("left"),Object(ie.bb)("right"),Object(ie.bb)("center"));function vF(e,t){return t?e?Object(ie.H)(e)?Object.assign({},e,{offset:vF(e.offset,t)}):{value:e,offset:t}:t:e}function bF(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Lj(e.encode,t,lF)):e.interactive=!1,e}function yF(e,t,n,r){const i=hF(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:cF,x:cF,y:cF,width:Nj(f),height:Nj(d)},update:Object(ie.p)({},u,{opacity:fF,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:cF}};return Bj(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),bF({type:"rect",role:"legend-gradient",encode:h},r)}function xF(e,t,n,r,i){const o=hF(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:cF,fill:{scale:t,field:sF}};p[l]={signal:h+"datum.perc",mult:u},p[c]=cF,p[f]={signal:h+"datum.perc2",mult:u},p[d]=Nj(s);const m={enter:p,update:Object(ie.p)({},p,{opacity:fF}),exit:{opacity:cF}};return Bj(m,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),bF({type:"rect",role:"legend-band",key:sF,from:i,encode:m},r)}const wF="datum.".concat("perc",'<=0?"').concat("left",'":datum.').concat("perc",'>=1?"').concat("right",'":"').concat("center",'"'),OF="datum.".concat("perc",'<=0?"').concat("bottom",'":datum.').concat("perc",'>=1?"').concat("top",'":"').concat("middle",'"');function EF(e,t,n,r){const i=hF(e,t),o=i.isVertical(),a=Nj(i.gradientThickness()),s=i.gradientLength();let u,l,c,f,d=i("labelOverlap"),h="";const p={enter:u={opacity:cF},update:l={opacity:fF,text:{field:"label"}},exit:{opacity:cF}};return Bj(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:sD(e.labelLimit,t.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=l.baseline={signal:OF},c="y",f="x",h="1-"):(u.align=l.align={signal:wF},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=sD(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:i("labelSeparation"),method:d,order:"datum.index"}:void 0,bF({type:"text",role:"legend-label",style:"guide-label",key:sF,from:r,encode:p,overlap:d},n)}function CF(e,t,n,r,i){const o=hF(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?Nj(l):{field:"size"},p="datum.".concat("index"),m="max(1, ".concat(i,")");let g,v,b,y,x;h.mult=.5,g={enter:v={opacity:cF,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:fF,x:v.x,y:v.y},exit:{opacity:cF}};let w=null,O=null;e.fill||(w=t.symbolBaseFillColor,O=t.symbolBaseStrokeColor),Bj(g,{fill:o("symbolFillColor",w),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",O),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),uF.forEach(t=>{e[t]&&(b[t]=v[t]={scale:e[t],field:sF})});const E=bF({type:"symbol",role:"legend-symbol",key:sF,from:f,clip:!!l||void 0,encode:g},n.symbols),C=Nj(c);C.offset=o("labelOffset"),g={enter:v={opacity:cF,x:{signal:d,offset:C},y:h},update:b={opacity:fF,text:{field:"label"},x:v.x,y:v.y},exit:{opacity:cF}},Bj(g,{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 _=bF({type:"text",role:"legend-label",style:"guide-label",key:sF,from:f,encode:g},n.labels);return g={enter:{noBound:{value:!l},width:cF,height:l?Nj(l):cF,opacity:cF},exit:{opacity:cF},update:b={opacity:fF,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(y="ceil(item.mark.items.length / ".concat(m,")"),b.row.signal="".concat(p,"%").concat(y),b.column.signal="floor(".concat(p," / ").concat(y,")"),x={field:["row",p]}):(b.row.signal="floor(".concat(p," / ").concat(m,")"),b.column.signal="".concat(p," % ").concat(m),x={field:p}),b.column.signal="(".concat(i,")?").concat(b.column.signal,":").concat(p),dF({role:"scope",from:r={facet:{data:r,name:"value",groupby:"index"}},encode:Lj(g,a,lF),marks:[E,_],name:u,interactive:s,sort:x})}const _F='item.orient === "left"',kF='item.orient === "right"',AF="(".concat(_F," || ").concat(kF,")"),SF="datum.vgrad && ".concat(AF),jF=mF('"top"','"bottom"','"middle"'),DF=mF('"right"','"left"','"center"'),FF="datum.vgrad && ".concat(kF," ? (").concat(DF,") : (").concat(AF," && !(datum.vgrad && ").concat(_F,')) ? "left" : ').concat(gF),TF="item._anchor || (".concat(AF,' ? "middle" : "start")'),MF="".concat(SF," ? (").concat(_F," ? -90 : 90) : 0"),NF="".concat(AF," ? (datum.vgrad ? (").concat(kF,' ? "bottom" : "top") : ').concat(jF,') : "top"');function PF(e,t){let n;return Object(ie.H)(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+BF(e.path)+")":e.sphere&&(n="geoShape("+BF(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function BF(e){return Object(ie.H)(e)&&e.signal?e.signal:Object(ie.bb)(e)}function LF(e){const t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")&&t.indexOf("title")?"group"===e.type?"scope":t||"mark":t}function RF(e){return{marktype:e.type,name:e.name||void 0,role:e.role||LF(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function zF(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function IF(e,t){const n=zo(e.type);n||Object(ie.o)("Unrecognized transform type: "+Object(ie.bb)(e.type));const r=Qj(n.type.toLowerCase(),null,UF(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function UF(e,t,n){const r={},i=e.params.length;for(let o=0;oHF(e,t,n))):HF(e,r,n)}(e,t,n):"projection"===r?n.projectionRef(t[e.name]):e.array&&!oD(i)?i.map(t=>WF(e,t,n)):WF(e,i,n):void(e.required&&Object(ie.o)("Missing required "+Object(ie.bb)(t.type)+" parameter: "+Object(ie.bb)(e.name)))}function WF(e,t,n){const r=e.type;if(oD(t))return YF(r)?Object(ie.o)("Expression references can not be signals."):KF(r)?n.fieldRef(t):XF(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||KF(r);return i&&qF(t)?n.exprRef(t.expr,t.as):i&&VF(t)?tD(t.field,t.as):YF(r)?_S(t,n):GF(r)?eD(n.getData(t).values):KF(r)?tD(t):XF(r)?n.compareRef(t):t}}function HF(e,t,n){const r=e.params.length;let i;for(let n=0;ne&&e.expr,VF=e=>e&&e.field,GF=e=>"data"===e,YF=e=>"expr"===e,KF=e=>"field"===e,XF=e=>"compare"===e;function JF(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:eD(t.getData(e.data).output)}function QF(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}function ZF(e){return Object(ie.J)(e)?e:null}function eT(e,t,n){const r=iD(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 rT(e,t){const n=LF(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,m=function(e,t,n){let r,i,o,a,s;return e?(r=e.facet)&&(t||Object(ie.o)("Only group marks can be faceted."),null!=r.field?a=s=JF(r,n):(e.data?s=eD(n.getData(e.data).aggregate):(o=IF(Object(ie.p)({type:"aggregate",groupby:Object(ie.i)(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=JF(r,n),a=s=eD(n.add(o))),i=n.keyRef(r.groupby,!0))):a=eD(n.add(wD(null,[{}]))),a||(a=JF(e,n)),{key:i,pulse:a,parent:s}}(e.from,r,t);s=t.add(ED({key:m.key||(e.key?tD(e.key):void 0),pulse:m.pulse,clean:!r}));const g=eD(s);s=u=t.add(wD({pulse:g})),s=t.add(FD({markdef:RF(e),interactive:zF(e.interactive,t),clip:PF(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:eD(s)}));const v=eD(s);s=l=t.add(CD(qj(e.encode,e.type,n,e.style,t,{mod:!1,pulse:v}))),s.params.parent=t.encode(),e.transform&&e.transform.forEach(e=>{const n=IF(e,t),r=n.metadata;(r.generates||r.changes)&&Object(ie.o)("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),n.params.pulse=eD(s),t.add(s=n)}),e.sort&&(s=t.add(WD({sort:t.compareRef(e.sort),pulse:eD(s)})));const b=eD(s);(i||h)&&(h=t.add(HD({layout:t.objectProperty(e.layout),legends:t.legends,mark:v,pulse:b})),f=eD(h));const y=t.add(xD({mark:v,pulse:f||b}));d=eD(y),r&&(p&&(a=t.operators,a.pop(),h&&a.pop()),t.pushState(b,f||d,g),i?function(e,t,n){const r=e.from.facet,i=r.name,o=JF(r,t);let a;r.name||Object(ie.o)("Facet must have a name: "+Object(ie.bb)(r)),r.data||Object(ie.o)("Facet must reference a data set: "+Object(ie.bb)(r)),r.field?a=t.add(BD({field:t.fieldRef(r.field),pulse:o})):r.groupby?a=t.add(kD({key:t.keyRef(r.groupby),group:eD(t.proxy(n.parent)),pulse:o})):Object(ie.o)("Facet must specify groupby or field: "+Object(ie.bb)(r));const s=t.fork(),u=s.add(wD()),l=s.add($D({pulse:eD(u)}));s.addData(i,new QF(s,u,u,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,t,m):p?function(e,t,n){const r=t.add(BD({pulse:n.pulse})),i=t.fork();i.add($D()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}(e,t,m):t.parse(e),t.popState(),p&&(h&&a.push(h),a.push(y))),o&&(d=function(e,t,n){const r=e.method,i=e.bound,o=e.separation,a={separation:oD(o)?n.signalRef(o.signal):o,method:oD(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=oD(e)?n.signalRef(e.signal):+e,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return eD(n.add(ND(a)))}(o,d,t));const x=t.add(ID({pulse:d})),w=t.add($D({pulse:eD(x)},void 0,t.parent()));null!=e.name&&(c=e.name,t.addData(c,new QF(t,u,x,w)),e.on&&e.on.forEach(e=>{(e.insert||e.remove||e.toggle)&&Object(ie.o)("Marks only support modify triggers."),nT(e,t,c)}))}function iT(e,t){const n=t.config.legend,r=e.encode||{},i=hF(e,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,u=o.style,l={};let c,f,d,h=0;uF.forEach(t=>e[t]?(l[t]=e[t],h=h||e[t]):0),h||Object(ie.o)("Missing valid scale for legend.");const p=function(e,t){let n=e.type||"symbol";e.type||1!==function(e){return uF.reduce((t,n)=>t+(e[n]?1:0),0)}(e)||!e.fill&&!e.stroke||(n=Ed(t)?"gradient":_d(t)?"discrete":"symbol");return"gradient"!==n?n:_d(t)?"discrete":"gradient"}(e,t.scaleType(h)),m={title:null!=e.title,scales:l,type:p,vgrad:"symbol"!==p&&i.isVertical()},g=eD(t.add(wD(null,[m]))),v=eD(t.add(jD(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=[yF(e,h,n,r.gradient),EF(e,n,r.labels,v)],f.count=f.count||t.signalRef("max(2,2*floor((".concat(uD(i.gradientLength()),")/100))"))):"discrete"===p?d=[xF(e,h,n,r.gradient,v),EF(e,n,r.labels,v)]:(c=function(e,t){const n=hF(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),d=[CF(e,n,r,v,uD(c.columns))],f.size=function(e,t,n){const r=uD(aT("size",e,n)),i=uD(aT("strokeWidth",e,n)),o=uD(function(e,t,n){return pF("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 _S("max(ceil(sqrt(".concat(r,")+").concat(i,"),").concat(o,")"),t)}(e,t,d[0].marks)),d=[dF({role:"legend-entry",from:g,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:s})],m.title&&d.push(function(e,t,n,r){const i=hF(e,t),o={enter:{opacity:cF},update:{opacity:fF,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:cF}};return Bj(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:TF},angle:{signal:MF},align:{signal:FF},baseline:{signal:NF},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")}),bF({type:"text",role:"legend-title",style:"guide-title",from:r,encode:o},n)}(e,n,r.title,g)),rT(dF({role:"legend",from:g,encode:Lj(oT(i,e,n),o,lF),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:u}),t)}function oT(e,t,n){const r={enter:{},update:{}};return Bj(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 aT(e,t,n){return t[e]?'scale("'.concat(t[e],'",datum)'):pF(e,n[0].encode)}QF.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(IF(e,t))}),e.on&&e.on.forEach(n=>{nT(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?aD(e.values)||aD(e.format)?(r.push(dT(t,e)),r.push(l=fT())):r.push(l=fT({$ingest:e.values,$format:e.format})):e.url?aD(e.url)||aD(e.format)?(r.push(dT(t,e)),r.push(l=fT())):r.push(l=fT({$request:e.url,$format:e.format})):e.source&&(l=i=Object(ie.i)(e.source).map(e=>eD(t.getData(e).output)),r.push(null));for(o=0,a=n.length;o"bottom"===e||"top"===e,pT=(e,t,n)=>oD(e)?xT(e.signal,t,n):"left"===e||"top"===e?t:n,mT=(e,t,n)=>oD(e)?bT(e.signal,t,n):hT(e)?t:n,gT=(e,t,n)=>oD(e)?yT(e.signal,t,n):hT(e)?n:t,vT=(e,t,n)=>oD(e)?wT(e.signal,t,n):"top"===e?{value:t}:{value:n},bT=(e,t,n)=>ET("".concat(e," === '").concat("top","' || ").concat(e," === '").concat("bottom","'"),t,n),yT=(e,t,n)=>ET("".concat(e," !== '").concat("top","' && ").concat(e," !== '").concat("bottom","'"),t,n),xT=(e,t,n)=>_T("".concat(e," === '").concat("left","' || ").concat(e," === '").concat("top","'"),t,n),wT=(e,t,n)=>_T("".concat(e," === '").concat("top","'"),t,n),OT=(e,t,n)=>_T("".concat(e," === '").concat("right","'"),t,n),ET=(e,t,n)=>(t=null!=t?Nj(t):t,n=null!=n?Nj(n):n,CT(t)&&CT(n)?(t=t?t.signal||Object(ie.bb)(t.value):null,n=n?n.signal||Object(ie.bb)(n.value):null,{signal:"".concat(e," ? (").concat(t,") : (").concat(n,")")}):[Object(ie.p)({test:e},t)].concat(n||[])),CT=e=>null==e||1===Object.keys(e).length,_T=(e,t,n)=>({signal:"".concat(e," ? (").concat(kT(t),") : (").concat(kT(n),")")}),kT=e=>oD(e)?e.signal:null==e?null:Object(ie.bb)(e),AT=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function ST(e,t,n,r){let i;if(t&&Object(ie.w)(t,e))return t[e];if(Object(ie.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 jT(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function DT(e,t){return{scale:e.scale,range:t}}function FT(e,t,n,r,i){const o=hF(e,t),a=e.orient,s=e.gridScale,u=pT(a,1,-1),l=function(e,t){if(1===t);else if(Object(ie.H)(e)){let n=e=Object(ie.p)({},e);for(;null!=n.mult;){if(!Object(ie.H)(n.mult))return n.mult=oD(t)?{signal:"(".concat(n.mult,") * (").concat(t.signal,")")}:n.mult*t,e;n=n.mult=Object(ie.p)({},n.mult)}n.mult=t}else e=oD(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:cF},update:d={opacity:fF},exit:f={opacity:cF}};Bj(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:sF,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},m=mT(a,{signal:"height"},{signal:"width"}),g=s?{scale:s,range:0,mult:u,offset:l}:{value:0,offset:l},v=s?{scale:s,range:1,mult:u,offset:l}:Object(ie.p)(m,{mult:u,offset:l});return c.x=d.x=mT(a,p,g),c.y=d.y=gT(a,p,g),c.x2=d.x2=gT(a,v),c.y2=d.y2=mT(a,v),f.x=mT(a,p),f.y=gT(a,p),bF({type:"rule",role:"axis-grid",key:sF,from:r,encode:h},n)}function TT(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function MT(e,t,n,r,i,o){const a=hF(e,t),s=e.orient,u=e.scale,l=pT(s,-1,1),c=uD(a("labelFlush")),f=uD(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,m=0===c||!!c;const g=Nj(i);g.mult=l,g.offset=Nj(a("labelPadding")||0),g.offset.mult=l;const v={scale:u,field:sF,band:.5,offset:vF(o.offset,a("labelOffset"))},b=mT(s,m?TT(u,c,'"left"','"right"','"center"'):{value:"center"},((e,t,n)=>oD(e)?OT(e.signal,t,n):"right"===e?{value:t}:{value:n})(s,"left","right")),y=mT(s,vT(s,"bottom","top"),m?TT(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=TT(u,c,"-(".concat(f,")"),f,0);m=m&&f;const w={opacity:cF,x:mT(s,v,g),y:gT(s,v,g)},O={enter:w,update:p={opacity:fF,text:{field:"label"},x:w.x,y:w.y,align:b,baseline:y},exit:{opacity:cF,x:w.x,y:w.y}};Bj(O,{dx:!d&&m?mT(s,x):null,dy:!h&&m?gT(s,x):null}),Bj(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 E=a("labelBound");let C=a("labelOverlap");return C=C||E?{separation:a("labelSeparation"),method:C,order:"datum.index",bound:E?{scale:u,orient:s,tolerance:E}:null}:void 0,p.align!==b&&(p.align=AT(p.align,b)),p.baseline!==y&&(p.baseline=AT(p.baseline,y)),bF({type:"text",role:"axis-label",style:"guide-label",key:sF,from:r,encode:O,overlap:C},n)}function NT(e,t,n,r){const i=hF(e,t),o=e.orient,a=pT(o,-1,1);let s,u;const l={enter:s={opacity:cF,anchor:Nj(i("titleAnchor",null)),align:{signal:gF}},update:u=Object(ie.p)({},s,{opacity:fF,text:Nj(e.title)}),exit:{opacity:cF}},c={signal:'lerp(range("'.concat(e.scale,'"), ').concat(mF(0,1,.5),")")};return u.x=mT(o,c),u.y=gT(o,c),s.angle=mT(o,cF,((e,t)=>0===t?0:oD(e)?{signal:"(".concat(e.signal,") * ").concat(t)}:{value:e*t})(a,90)),s.baseline=mT(o,vT(o,"bottom","top"),{value:"bottom"}),u.angle=s.angle,u.baseline=s.baseline,Bj(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]=AT(Nj(e),n.update[t]),!1):!Rj(t,r),o=i(e("titleX"),"x"),a=i(e("titleY"),"y");n.enter.auto=a===o?Nj(a):mT(t,Nj(a),Nj(o))}(i,o,l,n),l.update.align=AT(l.update.align,s.align),l.update.angle=AT(l.update.angle,s.angle),l.update.baseline=AT(l.update.baseline,s.baseline),bF({type:"text",role:"axis-title",style:"guide-title",from:r,encode:l},n)}function PT(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(oD(p)){const e=jT([c.axisX,c.axisY]),t=jT([c.axisTop,c.axisBottom,c.axisLeft,c.axisRight]);for(i of(n={},e))n[i]=mT(p,ST(i,c.axisX,d,f),ST(i,c.axisY,d,f));for(i of(r={},t))r[i]=(o=p.signal,a=ST(i,c.axisTop,d,f),s=ST(i,c.axisBottom,d,f),u=ST(i,c.axisLeft,d,f),l=ST(i,c.axisRight,d,f),{signal:(null!=u?"".concat(o," === '").concat("left","' ? (").concat(kT(u),") : "):"")+(null!=s?"".concat(o," === '").concat("bottom","' ? (").concat(kT(s),") : "):"")+(null!=l?"".concat(o," === '").concat("right","' ? (").concat(kT(l),") : "):"")+(null!=a?"".concat(o," === '").concat("top","' ? (").concat(kT(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(ie.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=hF(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(ie.H)(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=eD(t.add(wD({},[c]))),d=eD(t.add(yD({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(FT(e,n,r.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(function(e,t,n,r,i,o){const a=hF(e,t),s=e.orient,u=pT(s,-1,1);let l,c,f;const d={enter:l={opacity:cF},update:f={opacity:fF},exit:c={opacity:cF}};Bj(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=Nj(i);h.mult=u;const p={scale:e.scale,field:sF,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=mT(s,cF,p),f.y2=l.y2=mT(s,h),c.x=mT(s,p),f.x=l.x=gT(s,cF,p),f.x2=l.x2=gT(s,h),c.y=gT(s,p),bF({type:"rule",role:"axis-tick",key:sF,from:r,encode:d},n)}(e,n,r.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(MT(e,n,r.labels,d,p,l))),c.domain&&h.push(function(e,t,n,r){const i=hF(e,t),o=e.orient;let a,s;const u={enter:a={opacity:cF},update:s={opacity:fF},exit:{opacity:cF}};Bj(u,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=DT(e,0),c=DT(e,1);return a.x=s.x=mT(o,l,cF),a.x2=s.x2=mT(o,c),a.y=s.y=gT(o,l,cF),a.y2=s.y2=gT(o,c),bF({type:"rule",role:"axis-domain",from:r,encode:u},n)}(e,n,r.domain,f)),c.title&&h.push(NT(e,n,r.title,f)),rT(dF({role:"axis",from:f,encode:Lj(BT(u,e),i,lF),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:a,style:s}),t)}function BT(e,t){const n={enter:{},update:{}};return Bj(n,{orient:e("orient"),offset:e("offset")||0,position:sD(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 LT(e,t,n){const r=Object(ie.i)(e.signals),i=Object(ie.i)(e.scales);return n||r.forEach(e=>Xj(e,t)),Object(ie.i)(e.projections).forEach(e=>function(e,t){const n=t.config.projection||{},r={};for(const n in e)"name"!==n&&(r[n]=aF(e[n],n,t));for(const e in n)null==r[e]&&(r[e]=aF(n[e],e,t));t.addProjection(e.name,r)}(e,t)),i.forEach(e=>function(e,t){const n=e.type||"linear";wd(n)||Object(ie.o)("Unrecognized scale type: "+Object(ie.bb)(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t)),Object(ie.i)(e.data).forEach(e=>cT(e,t)),i.forEach(e=>YD(e,t)),(n||r).forEach(e=>function(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?Object(ie.o)("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=_S(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(e=>mD(e,t,n.id))}(e,t)),Object(ie.i)(e.axes).forEach(e=>PT(e,t)),Object(ie.i)(e.marks).forEach(e=>rT(e,t)),Object(ie.i)(e.legends).forEach(e=>iT(e,t)),e.title&&uT(e.title,t),t.parseLambdas(),t}function RT(e,t){const n=t.config,r=eD(t.root=t.add(Zj())),i=function(e,t){const n=n=>sD(e[n],t[n]),r=[zT("background",n("background")),zT("autosize",Fj(n("autosize"))),zT("padding",Mj(n("padding"))),zT("width",n("width")||0),zT("height",n("height")||0)],i=r.reduce((e,t)=>(e[t.name]=t,e),{}),o={};return Object(ie.i)(e.signals).forEach(e=>{Object(ie.w)(i,e.name)?e=Object(ie.p)(i[e.name],e):r.push(e),o[e.name]=e}),Object(ie.i)(t.signals).forEach(e=>{Object(ie.w)(o,e.name)||Object(ie.w)(i,e.name)||r.push(e)}),r}(e,n);i.forEach(e=>Xj(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(wD()),a=t.add(CD(qj((e=>Lj({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e))(e.encode),"group","frame",e.style,t,{pulse:eD(o)}))),s=t.add(HD({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:eD(a)}));t.operators.pop(),t.pushState(eD(a),eD(s),null),LT(e,t,i),t.operators.push(s);let u=t.add(xD({mark:r,pulse:eD(s)}));return u=t.add(ID({pulse:eD(u)})),u=t.add($D({pulse:eD(u)})),t.addData("root",new QF(t,o,o,u)),t}function zT(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function IT(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 UT(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 $T(e){return(Object(ie.B)(e)?WT:HT)(e)}function WT(e){const t=e.length;let n="[";for(let r=0;r0?",":"")+(Object(ie.H)(t)?t.signal||$T(t):Object(ie.bb)(t))}return n+"]"}function HT(e){let t,n,r="{",i=0;for(t in e)n=e[t],r+=(++i>1?",":"")+Object(ie.bb)(t)+":"+(Object(ie.H)(n)?n.signal||$T(n):Object(ie.bb)(n));return r+"}"}function qT(e,t,n){return Object(ie.H)(e)||Object(ie.o)("Input Vega specification must be an object."),RT(e,new IT(t=Object(ie.P)({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()}IT.prototype=UT.prototype={parse(e){return LT(e,this)},fork(){return new UT(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 Jj?eD(e):e;return this.add(RD({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(eD(this.add($D({pulse:e})))),this._parent.push(t),this._lookup.push(n?eD(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Object(ie.W)(this._parent)},encode(){return Object(ie.W)(this._encode)},lookup(){return Object(ie.W)(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Object(ie.J)(e))return tD(e,t);e.signal||Object(ie.o)("Unsupported field reference: "+Object(ie.bb)(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=eD(this.add(AD(e)))}return r},compareRef(e){let t=!1;const n=e=>oD(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,r=Object(ie.i)(e.field).map(n),i=Object(ie.i)(e.order).map(n);return t?eD(this.add(OD({fields:r,orders:i}))):rD(r,i)},keyRef(e,t){let n=!1;const r=this.signals;return e=Object(ie.i)(e).map(e=>oD(e)?(n=!0,eD(r[e.signal])):e),n?eD(this.add(SD({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=iD(e.op,e.field),n=e.order||"ascending";return n.signal?eD(this.add(OD({fields:t,orders:this.signalRef(n.signal)}))):rD(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(ie.w)(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&Object(ie.o)("Duplicate signal name: "+Object(ie.bb)(e));const n=t instanceof Jj?t:this.add(Zj(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||Object(ie.o)("Unrecognized signal name: "+Object(ie.bb)(e)),this.signals[e]},signalRef(e){return this.signals[e]?eD(this.signals[e]):(Object(ie.w)(this.lambdas,e)||(this.lambdas[e]=this.add(Zj(null))),eD(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;trM(e,t))}:eM(e)?{or:e.or.map(e=>rM(e,t))}:t(e)}const iM=JT.a,oM=KT.a;function aM(e,t){const n={};for(const r of t)Object(ie.w)(e,r)&&(n[r]=e[r]);return n}function sM(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=>ZT()(e)).join(",")})`};const uM=ZT.a;function lM(e){if(Object(ie.G)(e))return e;const t=Object(ie.J)(e)?e:ZT()(e);if(t.length<250)return t;let n=0;for(let e=0;e-1}function dM(e,t){let n=0;for(const[r,i]of e.entries())if(t(i,r,n++))return!0;return!1}function hM(e,t){let n=0;for(const[r,i]of e.entries())if(!t(i,r,n++))return!1;return!0}function pM(e,...t){for(const n of t)mM(e,null!=n?n:{});return e}function mM(e,t){for(const n of EM(t))Object(ie.lb)(e,n,t[n],!0)}function gM(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 vM(e,t){const n=EM(e),r=EM(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function bM(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function yM(e,t){for(const n of e)if(t.has(n))return!0;return!1}function xM(e){const t=new Set;for(const n of e){const e=Object(ie.ab)(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 wM(e,t){return void 0===e||void 0===t||yM(xM(e),xM(t))}function OM(e){return 0===EM(e).length}const EM=Object.keys,CM=Object.values,_M=Object.entries;function kM(e){return!0===e||!1===e}function AM(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function SM(e,t){return nM(e)?"!("+SM(e.not,t)+")":tM(e)?"("+e.and.map(e=>SM(e,t)).join(") && (")+")":eM(e)?"("+e.or.map(e=>SM(e,t)).join(") || (")+")":t(e)}function jM(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&jM(e[n],t)&&delete e[n],OM(e)}function DM(e){return e.charAt(0).toUpperCase()+e.substr(1)}function FM(e,t="datum"){const n=Object(ie.ab)(e),r=[];for(let e=1;e<=n.length;e++){const i=`[${n.slice(0,e).map(ie.bb).join("][")}]`;r.push(`${t}${i}`)}return r.join(" && ")}function TM(e,t="datum"){return`${t}[${Object(ie.bb)(Object(ie.ab)(e).join("."))}]`}function MM(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function NM(e){return""+Object(ie.ab)(e).map(MM).join("\\.")}function PM(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function BM(e){return""+Object(ie.ab)(e).join(".")}function LM(e){return e?Object(ie.ab)(e).length:0}function RM(...e){for(const t of e)if(void 0!==t)return t}let zM=42;function IM(e){const t=++zM;return e?String(e)+t:t}function UM(){zM=42}function $M(e){return WM(e)?e:"__"+e}function WM(e){return 0===e.indexOf("__")}function HM(e){if(void 0!==e)return(e%360+360)%360}function qM(e){return!!Object(ie.G)(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const VM={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 GM(e){return e&&e.condition}const YM=["domain","grid","labels","ticks","title"],KM={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"},XM={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},JM=Object.assign(Object.assign({},XM),{style:1,labelExpr:1,encoding:1});function QM(e){return!!JM[e]}EM(JM);const ZM=EM({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}),eN={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},tN={count:1,min:1,max:1};function nN(e){return!!e&&!!e.argmin}function rN(e){return!!e&&!!e.argmax}EM(eN);function iN(e){return Object(ie.J)(e)&&!!eN[e]}const oN=["count","valid","missing","distinct"];function aN(e){return Object(ie.J)(e)&&fM(oN,e)}const sN=["count","sum","distinct","valid","missing"],uN=Object(ie.fb)(["mean","average","median","q1","q3","min","max"]);var lN=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);iTP(e[t])?AM(`_${t}_${_M(e[t])}`):AM(`_${t}_${e[t]}`)).join("")}function jP(e){return!0===e||FP(e)&&!e.binned}function DP(e){return"binned"===e||FP(e)&&!0===e.binned}function FP(e){return Object(ie.H)(e)}function TP(e){return null==e?void 0:e.selection}function MP(e){switch(e){case cN:case fN:case"size":case mN:case gN:case vN:case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case bN:return 6;case"strokeDash":return 4;default:return 10}}function NP(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".`}const PP='Autosize "fit" only works for single views and layered views.';function BP(e){return("width"==e?"Width":"Height")+' "container" only works for single views and layered views.'}function LP(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function RP(e){return e?`Dropping "fit-${e}" because spec has discrete ${WN(e)}.`:'Dropping "fit" because spec has discrete size.'}function zP(e){return`Unknown field for ${e}. Cannot calculate view size.`}function IP(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function UP(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function $P(e){return`The "nearest" transform is not supported for ${e} marks.`}function WP(e){return`Selection not supported for ${e} yet.`}function HP(e){return`Cannot find a selection named "${e}".`}const qP="Scale bindings are currently only supported for scales with unbinned, continuous domains.",VP="Legend bindings are only supported for selections over an individual field or encoding channel.";function GP(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const YP="The same selection must be used to override scale domains in a layered view.",KP='Interval selections should be initialized using "x" and/or "y" keys.';function XP(e){return`Unknown repeated value "${e}".`}function JP(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const QP="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function ZP(e){return`Unrecognized parse "${e}".`}function eB(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const tB="Attempt to add the same child twice.";function nB(e){return`Ignoring an invalid transform: ${uM(e)}.`}const rB='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.';function iB(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function oB(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${uM(t)} is overridden by a child projection ${uM(n)}.`}const aB="Arc marks uses theta channel rather than angle, replacing angle with theta.";function sB(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${uM(n)}}.`}function uB(e){return`Invalid field type "${e}".`}function lB(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function cB(e){return`Invalid aggregation operator "${e}".`}function fB(e,t){return`Missing type for channel "${e}", using "${t}" instead.`}function dB(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 hB(e,t){return`Dropping ${uM(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function pB(e,t,n){return`${e}-encoding with type ${t} is deprecated. Replacing with ${n}-encoding.`}const mB="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function gB(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?" when "+n:""}.`}function vB(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function bB(e){return e+" encoding should be discrete (ordinal / nominal / binned)."}function yB(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function xB(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function wB(e){return`The ${e} for range marks cannot be an expression`}function OB(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function EB(e,t){return`Specified orient "${e}" overridden with "${t}".`}const CB="Custom domain scale cannot be unioned with default field-based domain.",_B='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.';function kB(e){return`Cannot use the scale property "${e}" with non-color channel.`}function AB(e){return`Using unaggregated domain with raw field has no effect (${uM(e)}).`}function SB(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function jB(e){return`Unaggregated domain is currently unsupported for log scale (${uM(e)}).`}function DB(e){return`Cannot apply size to non-oriented mark "${e}".`}function FB(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function TB(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function MB(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function NB(e,t){return`Scale type "${t}" does not work with mark "${e}".`}function PB(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}function BB(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${uM(n)} and ${uM(r)}). Using ${uM(n)}.`}function LB(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${uM(n)} and ${uM(r)}). Using the union of the two domains.`}function RB(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function zB(e){return`Dropping sort property ${uM(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const IB="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",UB="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.",$B="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.",WB="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.",HB="Invalid channel for axis.";function qB(e){return`Cannot stack "${e}" if there is already "${e}2".`}function VB(e){return`Cannot stack non-linear scale (${e}).`}function GB(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function YB(e,t){return`Invalid ${e}: ${uM(t)}.`}function KB(e){return`Dropping day from datetime ${uM(e)} as day cannot be combined with other units.`}function XB(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function JB(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function QB(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function ZB(e){return`1D error band does not support ${e}.`}function eL(e){return`Channel ${e} is required for "binned" bin.`}function tL(e){return`Channel ${e} should not be used with "binned" bin.`}function nL(e){return`Domain for ${e} is required for threshold scale.`}const rL=Object(ie.M)(ie.e);let iL=rL;function oL(){return iL=rL,iL}function aL(...e){iL.warn(...e)}function sL(e){if(e&&Object(ie.H)(e))for(const t of gL)if(t in e)return!0;return!1}new WeakMap;const uL=["january","february","march","april","may","june","july","august","september","october","november","december"],lL=uL.map(e=>e.substr(0,3)),cL=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],fL=cL.map(e=>e.substr(0,3));function dL(e,t){const n=[];if(t&&void 0!==e.day&&EM(e).length>1&&(aL(b.droppedDay(e)),delete(e=oM(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const r=t?function(e){if(qM(e)&&(e=+e),Object(ie.G)(e))return e-1;{const t=e.toLowerCase(),n=uL.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=lL.indexOf(r);if(-1!==i)return i;throw new Error(b.invalidTimeUnit("month",e))}}(e.month):e.month;n.push(r)}else if(void 0!==e.quarter){const r=t?function(e){if(qM(e)&&(e=+e),Object(ie.G)(e))return e>4&&aL(b.invalidTimeUnit("quarter",e)),e-1;throw new Error(b.invalidTimeUnit("quarter",e))}(e.quarter):e.quarter;n.push(Object(ie.G)(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(qM(e)&&(e=+e),Object(ie.G)(e))return e%7;{const t=e.toLowerCase(),n=cL.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=fL.indexOf(r);if(-1!==i)return i;throw new Error(b.invalidTimeUnit("day",e))}}(e.day):e.day;n.push(Object(ie.G)(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 hL(e){const t=dL(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}var pL=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);i0&&"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 wL(e,t,{end:n}={end:!1}){const r=FM(t),i=vL(e)?"utc":"";let o;const a={};for(const t of gL)xL(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=dL(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}function OL(e){if(!e)return;const t=yL(e);return`timeUnitSpecifier(${ZT()(t)}, ${ZT()(bL)})`}function EL(e){if(!e)return;let t;return Object(ie.J)(e)?t={unit:e}:Object(ie.H)(e)&&(t=Object.assign(Object.assign({},e),e.unit?{unit:e.unit}:{})),vL(t.unit)&&(t.utc=!0,t.unit=t.unit.substr(3)),t}function CL(e){return e&&!!e.signal}function _L(e){return!!e.step}function kL(e){return!Object(ie.B)(e)&&("field"in e&&"data"in e)}const AL=EM({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}),SL={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},jL=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function DL(e){return e&&!!e.field&&void 0!==e.equal}function FL(e){return e&&!!e.field&&void 0!==e.lt}function TL(e){return e&&!!e.field&&void 0!==e.lte}function ML(e){return e&&!!e.field&&void 0!==e.gt}function NL(e){return e&&!!e.field&&void 0!==e.gte}function PL(e){if(e&&e.field){if(Object(ie.B)(e.range)&&2===e.range.length)return!0;if(CL(e.range))return!0}return!1}function BL(e){return e&&!!e.field&&(Object(ie.B)(e.oneOf)||Object(ie.B)(e.in))}function LL(e){return BL(e)||DL(e)||PL(e)||FL(e)||ML(e)||TL(e)||NL(e)}function RL(e,t){return xI(e,{timeUnit:t,wrapTime:!0})}function zL(e,t=!0){var n;const{field:r}=e,i=null===(n=EL(e.timeUnit))||void 0===n?void 0:n.unit,o=i?"time("+wL(i,r)+")":nI(e,{expr:"datum"});if(DL(e))return o+"==="+RL(e.equal,i);if(FL(e)){return`${o}<${RL(e.lt,i)}`}if(ML(e)){return`${o}>${RL(e.gt,i)}`}if(TL(e)){return`${o}<=${RL(e.lte,i)}`}if(NL(e)){return`${o}>=${RL(e.gte,i)}`}if(BL(e))return`indexof([${function(e,t){return e.map(e=>RL(e,t))}(e.oneOf,i).join(",")}], ${o}) !== -1`;if(function(e){return e&&!!e.field&&void 0!==e.valid}(e))return IL(o,e.valid);if(PL(e)){const{range:n}=e,r=CL(n)?{signal:n.signal+"[0]"}:n[0],a=CL(n)?{signal:n.signal+"[1]"}:n[1];if(null!==r&&null!==a&&t)return"inrange("+o+", ["+RL(r,i)+", "+RL(a,i)+"])";const s=[];return null!==r&&s.push(`${o} >= ${RL(r,i)}`),null!==a&&s.push(`${o} <= ${RL(a,i)}`),s.length>0?s.join(" && "):"true"}throw new Error("Invalid field predicate: "+JSON.stringify(e))}function IL(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function UL(e){var t;return LL(e)&&e.timeUnit?Object.assign(Object.assign({},e),{timeUnit:null===(t=EL(e.timeUnit))||void 0===t?void 0:t.unit}):e}const $L={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};const WL=$L.quantitative,HL=$L.ordinal,qL=$L.temporal,VL=$L.nominal,GL=$L.geojson;EM($L);var YL=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);iAM(`${"unit"===e?"":`_${e}_`}${r[e]}`)).join(""):(n?"utc":"")+"timeunit"+EM(r).map(e=>AM(`_${e}_${r[e]}`)).join("")}(f),s=(!fM(["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?BM(o):t.expr?TM(o,t.expr)+u:NM(o)+u}function rI(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return Wz(e)&&!!e.bin;case"temporal":return!1}throw new Error(b.invalidFieldType(e.type))}function iI(e){return!rI(e)}const oI=(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(rN(t))return`${i} for argmax(${t.argmax})`;if(nN(t))return`${i} for argmin(${t.argmin})`;const o=EL(r),a=t||(null==o?void 0:o.unit)||(null==o?void 0:o.maxbins)&&"timeunit"||jP(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(jP(i))return r+" (binned)";if(o){const e=null===(n=EL(o))||void 0===n?void 0:n.unit;if(e)return`${r} (${yL(e).join("-")})`}else if(a)return rN(a)?`${r} for max ${a.argmax}`:nN(a)?`${r} for min ${a.argmin}`:`${DM(a)} of ${r}`;return r}(e,t)}};let aI=oI;function sI(e){aI=e}function uI(e,t,{allowDisabling:n,includeDefault:r=!0}){var i,o;const a=null===(i=lI(e))||void 0===i?void 0:i.title;if(!Wz(e))return a;const s=e,u=r?cI(s,t):void 0;return n?RM(a,s.title,u):null!==(o=null!=a?a:s.title)&&void 0!==o?o:u}function lI(e){return Qz(e)&&e.axis?e.axis:Zz(e)&&e.legend?e.legend:Mz(e)&&e.header?e.header:void 0}function cI(e,t){return aI(e,t)}function fI(e){var t;if(eI(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const n=null!==(t=lI(e))&&void 0!==t?t:{},{format:r,formatType:i}=n;return{format:r,formatType:i}}}function dI(e){return Wz(e)?e:Uz(e)?e.condition:void 0}function hI(e){return Yz(e)?e:$z(e)?e.condition:void 0}function pI(e,t,n,r={}){if(Object(ie.J)(e)||Object(ie.G)(e)||Object(ie.C)(e)){const n=Object(ie.J)(e)?"string":Object(ie.G)(e)?"number":"boolean";return aL(b.primitiveChannelDef(t,n,e)),{value:e}}return Yz(e)?mI(e,t,n,r):$z(e)?Object.assign(Object.assign({},e),{condition:mI(e.condition,t,n,r)}):e}function mI(e,t,n,r){if(eI(e)){const{format:i,formatType:o}=e,a=Pz(e,["format","formatType"]);if(mz(o)&&!n.customFormatTypes)return aL(b.customFormatTypeNotAllowed(t)),mI(a,t,n,r)}else{const i=Qz(e)?"axis":Zz(e)?"legend":Mz(e)?"header":null;if(i&&e[i]){const o=e[i],{format:a,formatType:s}=o,u=Pz(o,["format","formatType"]);if(mz(s)&&!n.customFormatTypes)return aL(b.customFormatTypeNotAllowed(t)),mI(Object.assign(Object.assign({},e),{[i]:u}),t,n,r)}}return Wz(e)?gI(e,t,r):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Object(ie.G)(n)?"quantitative":Object(ie.J)(n)?"nominal":sL(n)?"temporal":void 0,Object.assign(Object.assign({},e),{type:t})}(e)}function gI(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:a}=e,s=Object.assign({},e);if(n||!r||iN(r)||rN(r)||nN(r)||(aL(b.invalidAggregate(r)),delete s.aggregate),i&&(s.timeUnit=EL(i)),a&&(s.field=""+a),jP(o)&&(s.bin=vI(o,t)),DP(o)&&!aP(t)&&aL(b.channelShouldNotBeUsedForBinned(t)),Kz(s)){const{type:e}=s,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case WL:return"quantitative";case"t":case qL:return"temporal";case"o":case HL:return"ordinal";case"n":case VL:return"nominal";case GL:return"geojson"}}(e);e!==t&&(s.type=t),"quantitative"!==e&&aN(r)&&(aL(b.invalidFieldTypeForCountAggregate(e,r)),s.type="quantitative")}else if(!zN(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(Lz(e)&&Object(ie.B)(e.sort))return"ordinal";const{aggregate:r,bin:i,timeUnit:o}=e;if(o)return"temporal";if(i||r&&!rN(r)&&!nN(r))return"quantitative";if(Jz(e)&&(null===(n=e.scale)||void 0===n?void 0:n.type))switch(sR[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t);s.type=e}if(Kz(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 cN:case fN:case"facet":return iI(e)?{compatible:!1,warning:b.facetChannelShouldBeDiscrete(t)}:bI;case"x":case"y":case mN:case gN:case vN:case"text":case"detail":case"key":case"tooltip":case"href":case"url":case"angle":case hN:case dN:case"description":return bI;case"longitude":case"longitude2":case"latitude":case"latitude2":return n!==WL?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:bI;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case pN:case"radius2":case"x2":case"y2":return"nominal"!==n||e.sort?bI:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case"strokeDash":return fM(["ordinal","nominal"],e.type)?bI:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case bN:return fM(["ordinal","nominal","geojson"],e.type)?bI:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return"nominal"!==e.type||"sort"in e?bI:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,t)||{};!1===e&&aL(n)}if(Lz(s)&&Object(ie.J)(s.sort)){const{sort:e}=s;if(Sz(e))return Object.assign(Object.assign({},s),{sort:{encoding:e}});const t=e.substr(1);if("-"===e.charAt(0)&&Sz(t))return Object.assign(Object.assign({},s),{sort:{encoding:t,order:"descending"}})}if(Mz(s)){const{header:e}=s,{orient:t}=e,n=Pz(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 vI(e,t){return Object(ie.C)(e)?{maxbins:MP(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign(Object.assign({},e),{maxbins:MP(t)})}const bI={compatible:!0};function yI(e){const{formatType:t}=fI(e);return"time"===t||!t&&((n=e)&&("temporal"===n.type||Wz(n)&&!!n.timeUnit));var n}function xI(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var o;const a=t&&(null===(o=EL(t))||void 0===o?void 0:o.unit);let s,u=a||"temporal"===n;return NR(e)?s=e.expr:CL(e)?s=e.signal:sL(e)?(u=!0,s=hL(e)):(Object(ie.J)(e)||Object(ie.G)(e))&&u&&(s=`datetime(${JSON.stringify(e)})`,function(e){return!!mL[e]}(a)&&(Object(ie.G)(e)&&e<1e4||Object(ie.J)(e)&&isNaN(Date.parse(e)))&&(s=hL({[a]:e}))),s?r&&u?`time(${s})`:s:i?void 0:JSON.stringify(e)}function wI(e,t){const{type:n}=e;return t.map(t=>{const r=xI(t,{timeUnit:Wz(e)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:t})}function OI(e,t){return jP(e.bin)?OP(t)&&fM(["ordinal","nominal"],e.type):(console.warn("Only call this method for binned field defs."),!1)}var EI=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{var r;return e.field.push(nI(n,t)),e.order.push(null!==(r=n.sort)&&void 0!==r?r:"ascending"),e},{field:[],order:[]})}function zI(e,t){const n=[...e];return t.forEach(e=>{for(const t of n)if(iM(t,e))return;n.push(e)}),n}function II(e,t){return iM(e,t)||!t?e:e?[...Object(ie.i)(e),...Object(ie.i)(t)].join(", "):t}function UI(e,t){const n=e.value,r=t.value;if(null==n||null===r)return{explicit:e.explicit,value:null};if((_I(n)||CL(n))&&(_I(r)||CL(r)))return{explicit:e.explicit,value:II(n,r)};if(_I(n)||CL(n))return{explicit:e.explicit,value:n};if(_I(r)||CL(r))return{explicit:e.explicit,value:r};if(!(_I(n)||CL(n)||_I(r)||CL(r)))return{explicit:e.explicit,value:zI(n,r)};throw new Error("It should never reach here")}function $I(e){return"mark"in e}class WI{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!$I(e)&&(ez(t=e.mark)?t.type:t)===this.name;var t}}var HI=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!!e.field):Wz(n)||Uz(n))}function VI(e){return dM(SN,t=>{if(qI(e,t)){const n=e[t];if(Object(ie.B)(n))return dM(n,e=>!!e.aggregate);{const e=dI(n);return e&&!!e.aggregate}}return!1})}function GI(e,t){const n=[],r=[],i=[],o=[],a={};return XI(e,(s,u)=>{if(Wz(s)){const{field:l,aggregate:c,bin:f,timeUnit:d}=s,h=HI(s,["field","aggregate","bin","timeUnit"]);if(c||d||f){const e=lI(s),p=e&&e.title;let m=nI(s,{forAs:!0});const g=Object.assign(Object.assign(Object.assign({},p?[]:{title:uI(s,t,{allowDisabling:!0})}),h),{field:m});if(c){let e;if(rN(c)?(e="argmax",m=nI({op:"argmax",field:c.argmax},{forAs:!0}),g.field=`${m}.${l}`):nN(c)?(e="argmin",m=nI({op:"argmin",field:c.argmin},{forAs:!0}),g.field=`${m}.${l}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(e=c),e){const t={op:e,as:m};l&&(t.field=l),o.push(t)}}else if(n.push(m),Kz(s)&&jP(f)){if(r.push({bin:f,field:l,as:m}),n.push(nI(s,{binSuffix:"end"})),OI(s,u)&&n.push(nI(s,{binSuffix:"range"})),aP(u)){const e={field:m+"_end"};a[u+"2"]=e}g.bin="binned",zN(u)||(g.type=WL)}else if(d){i.push({timeUnit:d,field:l,as:m});const e=Kz(s)&&s.type!==qL&&"time";e&&("text"===u||"tooltip"===u?g.formatType=e:!function(e){return!!nP[e]}(u)?aP(u)&&(g.axis=Object.assign({formatType:e},g.axis)):g.legend=Object.assign({formatType:e},g.legend))}a[u]=g}else n.push(l),a[u]=e[u]}else a[u]=e[u]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function YI(e,t,n,r){return EM(e).reduce((i,o)=>{if(!LN(o))return aL(b.invalidEncodingChannel(o)),i;const a=e[o];if("angle"!==o||"arc"!==t||e.theta||(aL(b.REPLACE_ANGLE_WITH_THETA),o=hN),!function(e,t,n){const r=EP(t,n);if(!r)return!1;if("binned"===r){const n=e["x2"===t?"x":"y"];return!!(Wz(n)&&Wz(e[t])&&DP(n.bin))}return!0}(e,o,t))return aL(b.incompatibleChannel(o,t)),i;if("size"===o&&"line"===t){const t=dI(e[o]);if(null==t?void 0:t.aggregate)return aL(b.LINE_WITH_VARYING_SIZE),i}if(o===mN&&(n?"fill"in e:"stroke"in e))return aL(b.droppingColor("encoding",{fill:"fill"in e,stroke:"stroke"in e})),i;if("detail"===o||"order"===o&&!Object(ie.B)(a)&&!Xz(a)||"tooltip"===o&&Object(ie.B)(a))a&&(i[o]=Object(ie.i)(a).reduce((e,t)=>(Wz(t)?e.push(gI(t,o)):aL(b.emptyFieldDef(t,o)),e),[]));else{if("tooltip"===o&&null===a)i[o]=null;else if(!(Wz(a)||qz(a)||Xz(a)||Iz(a)||CL(a)))return aL(b.emptyFieldDef(a,o)),i;i[o]=pI(a,o,r)}return i},{})}function KI(e,t){const n={};for(const r of EM(e)){const i=pI(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function XI(e,t,n){if(e)for(const r of EM(e)){const i=e[r];if(Object(ie.B)(i))for(const e of i)t.call(n,e,r);else t.call(n,i,r)}}function JI(e,t){return EM(t).reduce((n,r)=>{switch(r){case"x":case"y":case"href":case"description":case"url":case"x2":case"y2":case hN:case pN:case dN:case"radius2":case"latitude":case"longitude":case"latitude2":case"longitude2":case"text":case bN: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(ie.B)(e)||Wz(e))for(const t of Object(ie.i)(e))t.aggregate||n.push(nI(t,{}));return n}case"size":if("trail"===e)return n;case mN:case gN:case vN:case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeDash":case"strokeWidth":{const e=dI(t[r]);return e&&!e.aggregate&&n.push(nI(e,{})),n}}},[])}var QI=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{const i=r?" of "+eU(t):"";return{field:e+t.field,type:t.type,title:CL(n)?{signal:n+`"${escape(i)}"`}:n+i}}),...gM(function(e){const t=[];for(const n of EM(e))if(qI(e,n)){const r=e[n],i=Object(ie.i)(r);for(const e of i)Wz(e)?t.push(e):Uz(e)&&t.push(e.condition)}return t}(n).map(tI),lM)]}}function eU(e){const{title:t,field:n}=e;return RM(t,n)}function tU(e,t,n,r,i){const{scale:o,axis:a}=n;return({partName:s,mark:u,positionPrefix:l,endPositionPrefix:c,extraEncoding:f={}})=>{const d=eU(n);return nU(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(ie.J)(c)?{[t+"2"]:{field:c+"_"+n.field}}:{}),r),f)})}}function nU(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}:{}),ez(r.mark)?r.mark:{type:r.mark}),{style:`${s}-${t}`}),Object(ie.C)(e[t])?{}:e[t])})]:[]}function rU(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:iU(o,n),continuousAxisChannelDef2:iU(a,n),continuousAxisChannelDefError:iU(s,n),continuousAxisChannelDefError2:iU(u,n),continuousAxis:i}}function iU(e,t){if(e&&e.aggregate){const{aggregate:n}=e,r=QI(e,["aggregate"]);return n!==t&&aL(b.errorBarContinuousAxisHasCustomizedAggregate(n,t)),r}return e}function oU(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(ez(n)&&n.orient)return n.orient;if(Vz(i)){if(Vz(o)){const e=Wz(i)&&i.aggregate,n=Wz(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 yI(o)&&!yI(i)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(Vz(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}var aU=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);itU(l,v,g,e,t.boxplot),j=S(A),D=S(w),F=S(Object.assign(Object.assign({},A),k?{size:k}:{})),T=ZI([{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"}],g,w),M={type:"tick",color:"black",opacity:1,orient:O,invalid:null,aria:!1},N="min-max"===d?T:ZI([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,w),P=[...j({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:N}),...j({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:N}),...j({partName:"ticks",mark:M,positionPrefix:"lower_whisker",extraEncoding:N}),...j({partName:"ticks",mark:M,positionPrefix:"upper_whisker",extraEncoding:N})],B=[..."tukey"!==d?P:[],...D({partName:"box",mark:Object.assign(Object.assign({type:"bar"},f?{size:f}:{}),{orient:E,invalid:null,ariaRoleDescription:"box"}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:T}),...F({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},Object(ie.H)(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),f?{size:f}:{}),{orient:O,aria:!1}),positionPrefix:"mid_box",extraEncoding:T})];if("min-max"===d)return Object.assign(Object.assign({},u),{transform:(null!==(r=u.transform)&&void 0!==r?r:[]).concat(m),layer:B});const L=`datum["lower_box_${g.field}"]`,R=`datum["upper_box_${g.field}"]`,z=`(${R} - ${L})`,I=`${L} - ${c} * ${z}`,U=`${R} + ${c} * ${z}`,$=`datum["${g.field}"]`,W={joinaggregate:cU(g.field),groupby:y},H={transform:[{filter:`(${I} <= ${$}) && (${$} <= ${U})`},{aggregate:[{op:"min",field:g.field,as:"lower_whisker_"+g.field},{op:"max",field:g.field,as:"upper_whisker_"+g.field},{op:"min",field:"lower_box_"+g.field,as:"lower_box_"+g.field},{op:"max",field:"upper_box_"+g.field,as:"upper_box_"+g.field},...x],groupby:y}],layer:P},{tooltip:q}=A,V=aU(A,["tooltip"]),{scale:G,axis:Y}=g,K=eU(g),X=sM(Y,["title"]),J=nU(l,"outliers",t.boxplot,{transform:[{filter:`(${$} < ${I}) || (${$} > ${U})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[v]:Object.assign(Object.assign(Object.assign({field:g.field,type:g.type},void 0!==K?{title:K}:{}),void 0!==G?{scale:G}:{}),OM(X)?{}:{axis:X})},V),_?{color:_}:{}),C?{tooltip:C}:{})})[0];let Q;const Z=[...h,...p,W];return J?Q={transform:Z,layer:[J,H]}:(Q=H,Q.transform.unshift(...Z)),Object.assign(Object.assign({},u),{layer:[Q,{transform:m,layer:B}]})}function cU(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}var fU=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);i1?{layer:p}:Object.assign({},p[0]))}function pU(e,t){const{encoding:n}=e;if(function(e){return(Yz(e.x)||Yz(e.y))&&!Yz(e.x2)&&!Yz(e.y2)&&!Yz(e.xError)&&!Yz(e.xError2)&&!Yz(e.yError)&&!Yz(e.yError2)}(n))return{orient:oU(e,t),inputType:"raw"};const r=function(e){return Yz(e.x2)||Yz(e.y2)}(n),i=function(e){return Yz(e.xError)||Yz(e.xError2)||Yz(e.yError)||Yz(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(Yz(e)&&Yz(r))throw new Error(t+" cannot have both x2 and y2");if(Yz(e)){if(Vz(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in "+t)}if(Yz(r)){if(Vz(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(Yz(r)&&!Yz(e))throw new Error(t+" cannot have xError2 without xError");if(Yz(s)&&!Yz(i))throw new Error(t+" cannot have yError2 without yError");if(Yz(e)&&Yz(i))throw new Error(t+" cannot have both xError and yError with both are quantiative");if(Yz(e)){if(Vz(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Yz(i)){if(Vz(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 mU(e,t,n){var r;const{mark:i,encoding:o,selection:a,projection:s}=e,u=fU(e,["mark","encoding","selection","projection"]),l=ez(i)?i:{type:i};a&&aL(b.selectionNotSupported(t));const{orient:c,inputType:f}=pU(e,t),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:m,continuousAxis:g}=rU(e,c,t),{errorBarSpecificAggregate:v,postAggregateCalculates:y,tooltipSummary:x,tooltipTitleWithFieldName:w}=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)&&aL(b.errorBarCenterIsUsedWithWrongExtent(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:DM(t)},{fieldPrefix:"upper_",titlePrefix:gU(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:gU(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:uI({field:c,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:uI({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:uI({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&aL(b.errorBarCenterAndExtentAreNotNeeded(e.center,e.extent)),"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:PM(PM(e.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,d,h,p,m,f,t,n),O=o,E=g,C=(O[E],"x"===g?"x2":"y2"),_=(O[C],"x"===g?"xError":"yError"),k=(O[_],"x"===g?"xError2":"yError2"),A=(O[k],fU(O,["symbol"==typeof E?E:E+"","symbol"==typeof C?C:C+"","symbol"==typeof _?_:_+"","symbol"==typeof k?k:k+""])),{bins:S,timeUnits:j,aggregate:D,groupby:F,encoding:T}=GI(A,n),M=[...D,...v],N="raw"!==f?[]:F,P=ZI(x,d,T,w);return{transform:[...null!==(r=u.transform)&&void 0!==r?r:[],...S,...j,...0===M.length?[]:[{aggregate:M,groupby:N}],...y],groupby:N,continuousAxisChannelDef:d,continuousAxis:g,encodingWithoutContinuousAxis:T,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:l,outerSpec:u,tooltipEncoding:P}}function gU(e,t,n){return DM(e)+" "+n+" "+t}const vU=new WI("errorband",bU);function bU(e,{config:t}){e=Object.assign(Object.assign({},e),{encoding:KI(e.encoding,t)});const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=mU(e,"errorband",t),l=a,c=tU(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?aL(b.errorBand1DNotSupport("interpolate")):l.tension&&aL(b.errorBand1DNotSupport("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 yU={};function xU(e,t,n){const r=new WI(e,t);yU[e]={normalizer:r,parts:n}}xU("boxplot",lU,["box","median","outliers","rule","ticks"]),xU("errorbar",hU,["ticks","rule"]),xU("errorband",bU,["band","borders"]);const wU=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],OU={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"},EU={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"},CU=EM(OU),_U=EM(EU),kU=EM({header:1,headerRow:1,headerColumn:1,headerFacet:1}),AU=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],SU={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};EM(SU);var jU=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 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 TU(e){return!(!e||"legend"!==e&&!e.legend)}function MU(e){return TU(e)&&Object(ie.H)(e)}function NU(e){return"concat"in e}function PU(e){return"vconcat"in e}function BU(e){return"hconcat"in e}function LU(e){return Object(ie.H)(e)&&void 0!==e.step}function RU(e){return e.view||e.width||e.height}const zU=EM({align:1,bounds:1,center:1,columns:1,spacing:1});var IU=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{if("tooltip"!==n&&qI(t,n)){const r=t[n];for(const t of Object(ie.i)(r)){const r=dI(t);if(r.aggregate)continue;const i=nI(r,{});i&&i===l||e.push({channel:n,fieldDef:r})}}return e},[]);let f;if(void 0!==o.stack?f=Object(ie.C)(o.stack)?o.stack?"zero":null:o.stack:c.length>0&&s$.has(r)&&(f="zero"),!f||!(f in o$))return null;if(VI(t)&&0===c.length)return null;if(o.scale&&o.scale.type&&o.scale.type!==KL){if(n.disallowNonLinearStack)return null;aL(b.cannotStackNonLinearScale(o.scale.type))}return Yz(t[$N(i)])?(void 0!==o.stack&&aL(b.cannotStackRangedMark(i)),null):(Wz(o)&&o.aggregate&&!fM(sN,o.aggregate)&&aL(b.stackNonSummativeAggregate(o.aggregate)),{groupbyChannel:u?s:void 0,groupbyField:l,fieldChannel:i,impute:null!==o.impute&&JR(r),stackBy:c,offset:f})}var c$=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);i1?r:r.type}function d$(e){for(const t of["line","area","rule","trail"])e[t]&&(e=Object.assign(Object.assign({},e),{[t]:sM(e[t],["point","line"])}));return e}function h$(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?Object(ie.H)(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?Object(ie.H)(t.point)?t.point:{}:void 0}function p$(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 m${constructor(){this.name="path-overlay"}hasMatchingType(e,t){if($I(e)){const{mark:n,encoding:r}=e,i=ez(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!h$(i,t[i.type],r);case"area":return!!h$(i,t[i.type],r)||!!p$(i,t[i.type])}}return!1}run(e,t,n){const{config:r}=t,{selection:i,projection:o,mark:a,encoding:s}=e,u=c$(e,["selection","projection","mark","encoding"]),l=KI(s,r),c=ez(a)?a:{type:a},f=h$(c,r[c.type],l),d="area"===c.type&&p$(c,r[c.type]),h=[Object.assign(Object.assign({},i?{selection:i}:{}),{mark:f$(Object.assign(Object.assign({},"area"===c.type&&void 0===c.opacity&&void 0===c.fillOpacity?{opacity:.7}:{}),c)),encoding:sM(l,["shape"])})],p=l$(c,l);let m=l;if(p){const{fieldChannel:e,offset:t}=p;m=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"},aM(c,["clip","interpolate","tension","tooltip"])),d),encoding:m})),f&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},aM(c,["clip","tooltip"])),f),encoding:m})),n(Object.assign(Object.assign({},u),{layer:h}),Object.assign(Object.assign({},t),{config:d$(r)}))}}var g$=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);iC$(e,t)).filter(e=>e);else{const e=C$(i,t);void 0!==e&&(n[r]=e)}}return n}class k${constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if($I(e)){const{encoding:t,mark:n}=e;if("line"===n)for(const e of RN){const n=t[IN(e)];if(t[e]&&(Wz(n)&&!DP(n.bin)||qz(n)))return!0}}return!1}run(e,t,n){const{encoding:r}=e;return aL(b.lineWithRange(!!r.x2,!!r.y2)),n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}var A$=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);ithis.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=i$(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=[sU,dU,vU,new m$,new k$,new v$]}map(e,t){if($I(e)){const n=qI(e.encoding,cN),r=qI(e.encoding,fN),i=qI(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=x$(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(ie.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=A$(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_"+AM(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=A$(e,["repeat","spec","data"]);!Object(ie.B)(r)&&e.columns&&(e=sM(e,["columns"]),aL(b.columnsNotSupportByRowCol("repeat")));const s=[],{repeater:u={},repeaterPrefix:l=""}=t,c=!Object(ie.B)(r)&&r.row||[u?u.row:null],f=!Object(ie.B)(r)&&r.column||[u?u.column:null],d=Object(ie.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(ie.B)(r)?""+AM(e):(r.row?"row_"+AM(n):"")+(r.column?"column_"+AM(o):"")),f=this.map(i,Object.assign(Object.assign({},t),{repeater:a,repeaterPrefix:c}));f.name=c,s.push(sM(f,["data"]))}const h=Object(ie.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 Tz(n)&&e.columns&&(e=sM(e,["columns"]),aL(b.columnsNotSupportByRowCol("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:o,config:a}=t,s=j$({parentProjection:o,projection:r}),u=S$({parentEncoding:i,encoding:x$(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=A$(n,["row","column","facet"]),{mark:s,width:u,projection:l,height:c,view:f,selection:d,encoding:h}=e,p=A$(e,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:m,layout:g}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},t),v=x$(a,t.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},p),g),{facet:m,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:v}),d?{selection:d}:{})}),t)}getFacetMappingAndLayout(e,t){var n;const{row:r,column:i,facet:o}=e;if(r||i){o&&aL(b.facetChannelDropped([...r?[cN]:[],...i?[fN]:[]]));const t={},a={};for(const r of[cN,fN]){const i=e[r];if(i){const{align:e,center:o,spacing:s,columns:u}=i,l=A$(i,["align","center","spacing","columns"]);t[r]=l;for(const e of["align","center","spacing"])void 0!==i[e]&&(a[e]=null!==(n=a[e])&&void 0!==n?n:{},a[e][r]=i[e])}}return{facetMapping:t,layout:a}}{const{align:e,center:n,spacing:r,columns:i}=o;return{facetMapping:y$(A$(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}:{})}}}mapLayer(e,t){var{parentEncoding:n,parentProjection:r}=t,i=A$(t,["parentEncoding","parentProjection"]);const{encoding:o,projection:a}=e,s=A$(e,["encoding","projection"]),u=Object.assign(Object.assign({},i),{parentEncoding:S$({parentEncoding:n,encoding:o,layer:!0}),parentProjection:j$({parentProjection:r,projection:a})});return super.mapLayer(s,u)}};function T$(e){return Object(ie.J)(e)?{type:e}:null!=e?e:{}}const M$=["background","padding"];function N$(e,t){const n={};for(const t of M$)e&&void 0!==e[t]&&(n[t]=SI(e[t]));return t&&(n.params=e.params),n}class P${constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new P$(oM(this.explicit),oM(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return RM(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 EM(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function B$(e){return{explicit:!0,value:e}}function L$(e){return{explicit:!1,value:e}}function R$(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:z$(t,n,r,i)}}function z$(e,t,n,r){return e.explicit&&t.explicit&&aL(b.mergeConflictingProperty(n,r,e.value,t.value)),e}function I$(e,t,n,r,i=z$){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:iM(e.value,t.value)?e:i(e,t,n,r)}class U$ extends P${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 $$(e){return"url"in e}function W$(e){return"values"in e}function H$(e){return"name"in e&&!$$(e)&&!W$(e)&&!q$(e)}function q$(e){return e&&(V$(e)||G$(e)||Y$(e))}function V$(e){return"sequence"in e}function G$(e){return"sphere"in e}function Y$(e){return"graticule"in e}var K$;function X$(e){return"filter"in e}function J$(e){return"lookup"in e}function Q$(e){return"pivot"in e}function Z$(e){return"density"in e}function eW(e){return"quantile"in e}function tW(e){return"regression"in e}function nW(e){return"loess"in e}function rW(e){return"sample"in e}function iW(e){return"window"in e}function oW(e){return"joinaggregate"in e}function aW(e){return"flatten"in e}function sW(e){return"calculate"in e}function uW(e){return"bin"in e}function lW(e){return"impute"in e}function cW(e){return"timeUnit"in e}function fW(e){return"aggregate"in e}function dW(e){return"stack"in e}function hW(e){return"fold"in e}function pW(e,t,n,r){const i=Iz(t)&&t.condition,o=r(t);if(i){return{[n]:[...Object(ie.i)(i).map(t=>{const n=r(t),i=function(e){return e.selection}(t)?jq(e,t.selection):Fq(e,t.test);return Object.assign({test:i},n)}),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function mW(e,t="text"){const n=e.encoding[t];return pW(e,n,t,t=>gW(t,e.config))}function gW(e,t,n="datum"){if(e){if(Xz(e))return DI(e.value);if(Yz(e)){const{format:r,formatType:i}=fI(e);return vz({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function vW(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,a=n.tooltip;if(Object(ie.B)(a))return{tooltip:yW({tooltip:a},o,i,t)};{const s=t.reactiveGeom?"datum.datum":"datum";return pW(e,a,"tooltip",e=>{const a=gW(e,i,s);if(a)return a;if(null===e)return;let u=NI("tooltip",r,i);return!0===u&&(u={content:"encoding"}),Object(ie.J)(u)?{value:u}:Object(ie.H)(u)?CL(u)?u:"encoding"===u.content?yW(n,o,i,t):{signal:s}:void 0})}}function bW(e,t,n,{reactiveGeom:r}={}){const i={},o=r?"datum.datum":"datum",a=[];function s(r,s){const u=IN(s),l=Kz(r)?r:Object.assign(Object.assign({},r),{type:e[u].type}),c=l.title||cI(l,n),f=Object(ie.i)(c).join(", ");let d;if(aP(s)){const r="x"===s?"x2":"y2",a=dI(e[r]);if(DP(l.bin)&&a){const e=nI(l,{expr:o}),t=nI(a,{expr:o}),{format:s,formatType:u}=fI(l);d=_z(e,t,s,u,n),i[r]=!0}else if(t&&t.fieldChannel===s&&"normalize"===t.offset){const{format:e,formatType:t}=fI(l);d=vz({fieldOrDatumDef:l,format:e,formatType:t,expr:o,config:n,normalizeStack:!0}).signal}}d=null!=d?d:gW(l,n,o).signal,a.push({channel:s,key:f,value:d})}XI(e,(e,t)=>{Wz(e)?s(e,t):Uz(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 yW(e,t,n,{reactiveGeom:r}={}){const i=bW(e,t,n,{reactiveGeom:r}),o=_M(i).map(([e,t])=>`"${e}": ${t}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function xW(e){const{markDef:t,config:n}=e,r=NI("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=NI("ariaRoleDescription",n,r);if(null!=i)return{ariaRoleDescription:{value:i}};return t in SL?{}:{ariaRoleDescription:{value:t}}}(e)),function(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return pW(e,o,"description",t=>gW(t,e.config));const a=NI("description",n,r);if(null!=a)return{description:DI(a)};if(!1===r.aria)return{};const s=bW(t,i,r);if(OM(s))return;return{description:{signal:_M(s).map(([e,t],n)=>`"${n>0?"; ":""}${e}: " + (${t})`).join(" + ")}}}(e))}function wW(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:NI(e,r,o,{vgChannel:a,ignoreVgConfig:!0}),void 0!==u&&(s=DI(u)));const l=i[e];return pW(t,l,null!=a?a:e,n=>hz({channel:e,channelDef:n,markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s}))}function OW(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:NI("filled",a,u),f=fM(["bar","point","circle","square","geoshape"],l)?"transparent":void 0,d=null!==(i=null!==(r=NI(!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=NI(!1===c?"color":void 0,a,u,{vgChannel:"stroke"}))&&void 0!==o?o:u.mark[!1===c&&"color"],p=c?"fill":"stroke",m=Object.assign(Object.assign({},d?{fill:DI(d)}:{}),h?{stroke:DI(h)}:{});return a.color&&(c?a.fill:a.stroke)&&aL(b.droppingColor("property",{fill:"fill"in a,stroke:"stroke"in a})),Object.assign(Object.assign(Object.assign(Object.assign({},m),wW("color",e,{vgChannel:p,defaultValue:c?d:h})),wW("fill",e,{defaultValue:s.fill?d:void 0})),wW("stroke",e,{defaultValue:s.stroke?h:void 0}))}function EW(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 hN:return"thetaOffset";case dN:return"radiusOffset";case pN:return"theta2Offset";case"radius2":return"radius2Offset"}}(e)];if(n)return n}function CW(e,t,{defaultPos:n,vgChannel:r,isMidPoint:i}){const{encoding:o,markDef:a,config:s,stack:u}=t,l=o[e],c=o[$N(e)],f=t.scaleName(e),d=t.getScaleComponent(e),h=EW(e,a),p=_W({model:t,defaultPos:n,channel:e,scaleName:f,scale:d}),m=!l&&aP(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(Yz(n)&&o&&t===o.fieldChannel){if(Wz(n)){const e=Rz({channel:t,fieldDef:n,isMidPoint:r,markDef:s,stack:o,config:u});if(void 0!==e)return dz({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",band:e,offset:a})}return fz(n,i,{suffix:"end"},{offset:a})}return sz(e)}({channel:e,channelDef:l,channel2Def:c,markDef:a,config:s,isMidPoint:i,scaleName:f,scale:d,stack:u,offset:h,defaultRef:p});return m?{[r||e]:m}:void 0}function _W({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:a}=e;return()=>{const s=IN(n),u=UN(n),l=NI(n,o,a,{vgChannel:u});if(void 0!==l)return pz(n,l);switch(t){case"zeroOrMin":case"zeroOrMax":if(r){const e=i.get("type");if(fM([XL,eR,tR],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[WN(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"}(K$||(K$={}));const kW={left:"x",center:"xc",right:"x2"},AW={top:"y",middle:"yc",bottom:"y2"};function SW(e,t,n,r="middle"){if("radius"===e||"theta"===e)return UN(e);const i="x"===e?"align":"baseline",o=NI(i,t,n);let a;return CL(o)?(aL(b.rangeMarkAlignmentCannotBeExpression(i)),a=void 0):a=o,"x"===e?kW[a||("top"===r?"left":"center")]:AW[a||r]}function jW(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?DW(e,t,{defaultPos:n,defaultPos2:r}):CW(e,t,{defaultPos:n})}function DW(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,a=$N(e),s=WN(e),u=function(e,t,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=e,u=IN(n),l=WN(n),c=UN(n),f=r[u],d=e.scaleName(u),h=e.getScaleComponent(u),p=EW(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 m=function({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l}){if(Yz(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0))return fz(t,o,{suffix:"start"},{offset:u});return sz({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!==m)return{[c]:m};return FW(n,o)||FW(n,{[n]:BI(n,o,s.style),[l]:BI(l,o,s.style)})||FW(n,s[i])||FW(n,s.mark)||{[c]:_W({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}(t,r,a),l=u[s]?SW(e,i,o):UN(e);return Object.assign(Object.assign({},CW(e,t,{defaultPos:n,vgChannel:l})),u)}function FW(e,t){const n=WN(e),r=UN(e);return void 0!==t[r]?{[r]:pz(e,t[r])}:void 0!==t[e]?{[r]:pz(e,t[e])}:t[n]?{[n]:pz(e,t[n])}:void 0}function TW(e,t,n){var r,i,o,a;const{config:s,encoding:u,markDef:l,stack:c}=e,f=$N(t),d=WN(t),h=u[t],p=u[f],m=e.getScaleComponent(t),g=m?m.get("type"):void 0,v=e.scaleName(t),y=l.orient,x=null!==(i=null!==(r=u[d])&&void 0!==r?r:u.size)&&void 0!==i?i:NI("size",l,s,{vgChannel:d}),w="bar"===n&&("x"===t?"vertical"===y:"horizontal"===y);if(Wz(h)&&(jP(h.bin)||DP(h.bin)||h.timeUnit&&!p)&&!x&&!bR(g)){const n=Rz({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=$N(n),f=UN(n),d=UN(c),h=EW(n,o);if(jP(e.bin)||e.timeUnit)return{[d]:PW({channel:n,fieldDef:e,scaleName:i,markDef:o,band:(1-r)/2,offset:NW(c,a,u,s,h),config:l}),[f]:PW({channel:n,fieldDef:e,scaleName:i,markDef:o,band:1-(1-r)/2,offset:NW(n,a,u,s,h),config:l})};if(DP(e.bin)){const r=fz(e,i,{},{offset:NW(c,a,u,s,h)});if(Wz(t))return{[d]:r,[f]:fz(t,i,{},{offset:NW(n,a,u,s,h)})};if(FP(e.bin)&&e.bin.step)return{[d]:r,[f]:{signal:`scale("${i}", ${nI(e,{expr:"datum"})} + ${e.bin.step})`,offset:NW(n,a,u,s,h)}}}return void aL(b.channelRequiredForBinned(c))}({fieldDef:h,fieldDef2:p,channel:t,markDef:l,scaleName:v,band:n,axisTranslate:null!==(a=null==r?void 0:r.get("translate"))&&void 0!==a?a:.5,spacing:aP(t)?NI("binSpacing",l,s):void 0,reverse:m.get("reverse"),config:s})}return(Yz(h)&&bR(g)||w)&&!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=WN(n),h=$N(n),p="horizontal"===l&&"y"===n||"vertical"===l&&"x"===n,m=NI(p?"size":d,o,s,{vgChannel:d});let g;(a.size||void 0!==m)&&(p?g=wW("size",r,{vgChannel:d,defaultValue:m}):aL(b.cannotApplySizeToNonOrientedMark(o.type)));const v=null!==(i=Yz(t)?Rz({channel:n,fieldDef:t,markDef:o,stack:u,config:s}):void 0)&&void 0!==i?i:1;g=g||{[d]:MW(e,d,c,f,s,v)};const y="band"!==(null==f?void 0:f.get("type"))||!("band"in g[d]),x=SW(n,o,s,y?"middle":"top"),w=EW(n,o),O=sz({channel:n,channelDef:t,markDef:o,config:s,scaleName:c,scale:f,stack:u,offset:w,defaultRef:_W({model:r,defaultPos:"mid",channel:n,scaleName:c,scale:f}),band:y?.5:(1-v)/2});if(d)return Object.assign({[x]:O},g);{const e=UN(h),t=g[d],n=w?Object.assign(Object.assign({},t),{offset:w}):t;return{[x]:O,[e]:Object(ie.B)(O)?[O[0],Object.assign(Object.assign({},O[1]),{offset:n})]:Object.assign(Object.assign({},O),{offset:n})}}}(n,h,t,e):DW(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function MW(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===oR){const e=r.get("range");return _L(e)&&Object(ie.G)(e.step)?{value:e.step-2}:{value:HU-2}}return{scale:n,band:o}}return{value:i[e].continuousBandSize}}const a=$U(i.view,t),s=RM(i[e].discreteBandSize,a-2);return void 0!==s?{value:s}:void 0}function NW(e,t,n,r,i){if(xN(e))return 0;const o="x"===e||"y2"===e?-t/2:t/2;if(CL(n)||CL(i)||CL(r)){const e=TI(n),t=TI(i),a=TI(r);return{signal:(a?a+" + ":"")+(e?`(${e} ? -1 : 1) * `:"")+(t?`(${t} + ${o})`:o)}}return i=i||0,r+(n?-i-o:+i+o)}function PW({channel:e,fieldDef:t,scaleName:n,markDef:r,band:i,offset:o,config:a}){return uz({fieldDef:t,channel:e,markDef:r,ref:dz({scaleName:n,fieldOrDatumDef:t,band:i,offset:o}),config:a})}const BW=new Set(["aria"]);function LW(e,t){const{fill:n,stroke:r}="include"===t.color?OW(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 AL.reduce((n,r)=>(BW.has(r)||void 0===e[r]||"ignore"===t[r]||(n[r]=DI(e[r])),n),{})}(e.markDef,t)),RW(e,"fill",n)),RW(e,"stroke",r)),wW("opacity",e)),wW("fillOpacity",e)),wW("strokeOpacity",e)),wW("strokeWidth",e)),wW("strokeDash",e)),function(e){const{encoding:t,mark:n}=e,r=t.order;return!JR(n)&&Xz(r)?pW(e,r,"zindex",e=>DI(e.value)):{}}(e)),vW(e)),mW(e,"href")),xW(e))}function RW(e,t,n){const{config:r,mark:i,markDef:o}=e;if("hide"===NI("invalid",o,r)&&n&&!JR(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&&yR(i)&&(t[o]=!0)}return t},{}),i=EM(r);if(i.length>0){const e=t?"||":"&&";return i.map(e=>cz(e,t)).join(` ${e} `)}return}(e,{invalid:!0,channels:wP});if(r)return{[t]:[{test:r,value:null},...Object(ie.i)(n)]}}return n?{[t]:n}:{}}function zW(e){const{config:t,markDef:n}=e;if(NI("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&&yR(i)&&(t[o]=!0)}return t},{}),i=EM(r);if(i.length>0){const e=t?"||":"&&";return i.map(e=>cz(e,t)).join(` ${e} `)}return}(e,{channels:oP});if(t)return{defined:{signal:t}}}return{}}function IW(e,t){if(void 0!==t)return{[e]:DI(t)}}var UW={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(JR(o))return aL(b.nearestNotSupportForContinuous(o)),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}},vW(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 $W{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?aL(b.ADD_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 WW extends $W{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 "+IM()),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}var HW=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{const{field:i,timeUnit:o}=n,a=iY(t)?t.encoding[$N(r)]:void 0,s=iY(t)&&zz(r,n,a,t.stack,t.markDef,t.config);if(o){const t=nI(n,{forAs:!0});e[lM({as:t,field:i,timeUnit:o})]=Object.assign({as:t,field:i,timeUnit:o},s?{band:!0}:{})}return e},{});return OM(n)?null:new qW(e,n)}static makeFromTransform(e,t){const n=Object.assign({},t),{timeUnit:r}=n,i=HW(n,["timeUnit"]),o=EL(r),a=Object.assign(Object.assign({},i),{timeUnit:o});return new qW(e,{[lM(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 _M(this.formula))e.has(r.as)||(t[n]=r);this.formula=t}producedFields(){return new Set(CM(this.formula).map(e=>e.as))}dependentFields(){return new Set(CM(this.formula).map(e=>e.field))}hash(){return"TimeUnit "+lM(this.formula)}assemble(){const e=[];for(const t of CM(this.formula)){const{field:n,as:r,timeUnit:i}=t,o=EL(i),{unit:a,utc:s}=o,u=HW(o,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:NM(n),type:"timeunit"},a?{units:yL(a)}:{}),s?{timezone:"utc"}:{}),u),{as:[r,r+"_end"]}))}return e}}var VW=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"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!TU(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=UW.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((e,i)=>{var u,l;const c=AM(`${r}_${e.field}`);n.filter(e=>e.name===c).length||n.unshift(Object.assign(Object.assign({name:c},a?{init:lH(a[i])}:{value:null}),{on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${Object(ie.bb)(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+xH)[0],a=r+"_tuple_fields",s=i.items.map(e=>AM(`${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}};var KW={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+xH,r=t.name+"_toggle";return`${r} ? null : ${n}, `+("global"===t.resolve?r+" ? null : true, ":`${r} ? null : {unit: ${_H(e)}}, `)+`${r} ? ${n} : null`}};const XW={has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=Object(ie.J)(n.clear)?Aj(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>{if(YW.has(t))for(const e of t.project.items){const r=n.findIndex(n=>n.name===AM(`${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+xH);r(e,"null"),KW.has(t)&&(e=n.findIndex(e=>e.name===t.name+"_toggle"),r(e,"false"))}return n}};var JW={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(!OP(i))continue;const o=e.getScaleComponent(i),a=o?o.get("type"):void 0;if(!o||!yR(a)){aL(b.SCALE_BINDINGS_CONTINUOUS);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||ZW(e)||0===r.length)return n;const i=n.filter(e=>e.name===t.name)[0];let o=i.update;if(o.indexOf(OH)>=0)i.update=`{${r.map(e=>`${Object(ie.bb)(e.field)}: ${e.signals.data}`).join(", ")}}`;else{for(const e of r){const t=`${Object(ie.bb)(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&&!ZW(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 QW(e,t){return`domain(${Object(ie.bb)(e.scaleName(t))})`}function ZW(e){var t;return e.parent&&sY(e.parent)&&(null!==(t=!e.parent.parent)&&void 0!==t?t:ZW(e.parent.parent))}const eH={has:e=>{const t="global"===e.resolve&&e.bind&&TU(e.bind),n=1===e.project.items.length&&"_vgsid_"!==e.project.items[0].field;return t&&!n&&aL(b.LEGEND_BINDINGS_MUST_HAVE_PROJECTION),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(ie.i)(null!==(i=n.filter)&&void 0!==i?i:[]),n.filter.indexOf(e)<0&&n.filter.push(e)}const o=MU(t.bind)?t.bind.legend:"click",a=Object(ie.J)(o)?Aj(o,"view"):Object(ie.i)(o);t.bind={legend:{merge:a}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=MU(t.bind)&&t.bind.legend,o=e=>t=>{const n=oM(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const a=AM(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+xH),a=r+"_tuple_fields",s=i.items.filter(e=>e.hasLegend).map(e=>AM(`${r}_${AM(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=MU(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 tH="_translate_delta",nH={has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const r=t.name,i=JW.has(t),o=r+"_translate_anchor",{x:a,y:s}=t.project.hasChannel;let u=Aj(t.translate,"scope");return i||(u=u.map(e=>(e.between[0].markname=r+hH,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?QW(e,"x"):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(i?QW(e,"y"):`slice(${s.signals.visual})`):"")+"}"}]},{name:r+tH,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&rH(e,t,a,"width",n),void 0!==s&&rH(e,t,s,"height",n),n}};function rH(e,t,n,r,i){var o;const a=t.name,s=a+"_translate_anchor",u=a+tH,l=n.channel,c=JW.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"),m=`${s}.extent_${l}`,g=`${c?"log"===p?"panLog":"pow"===p?"panPow":"panLinear":"panLinear"}(${m}, ${`${c&&"x"===l?"-":""}${u}.${l} / `+(c?""+d:`span(${m})`)}`+(c&&"pow"===p?", "+(null!==(o=h.get("exponent"))&&void 0!==o?o:1):"")+")";f.on.push({events:{signal:u},update:c?g:`clampRange(${g}, 0, ${d})`})}const iH={has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=JW.has(t),o=r+"_zoom_delta",{x:a,y:s}=t.project.hasChannel,u=Object(ie.bb)(e.scaleName("x")),l=Object(ie.bb)(e.scaleName("y"));let c=Aj(t.zoom,"scope");return i||(c=c.map(e=>(e.markname=r+hH,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&&oH(e,t,a,"width",n),void 0!==s&&oH(e,t,s,"height",n),n}};function oH(e,t,n,r,i){var o;const a=t.name,s=n.channel,u=JW.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?QW(e,s):l.name,p=a+"_zoom_delta",m=`${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?m:`clampRange(${m}, 0, ${c})`})}const aH=[{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 GW,u={},l={},c=new Set,f=(e,t)=>{const n="visual"===t?e.channel:e.field;let r=AM(`${a}_${n}`);for(let e=1;c.has(r);e++)r=AM(`${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(ie.i)(n.init))for(const r of EM(e))BN[r]?(n.encodings||(n.encodings=[])).push(r):"interval"===n.type?(aL(b.INTERVAL_INITIALIZED_WITH_X_Y),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){aL(b.cannotProjectAggregate(r,n.aggregate));continue}if(!i){aL(b.cannotProjectOnChannelWithoutField(r));continue}if(n.timeUnit){i=e.vgField(r);const t={timeUnit:n.timeUnit,as:i,field:n.field};l[lM(t)]=t}if(!u[i]){let o="E";if("interval"===t.type){yR(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 aL(b.cannotProjectOnChannelWithoutField(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(ie.i)(n.init);t.init=r.map(e)}}OM(l)||(s.timeUnit=new qW(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{signals:t,hasLegend:n}=e,r=VW(e,["signals","hasLegend"]);return r.field=NM(r.field),r})})}},KW,JW,eH,nH,iH,YW,UW,XW];function sH(e,t){for(const n of aH)n.has(e)&&t(n)}var uH=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);ilH(e,t,n));return t?`[${r.join(", ")}]`:r}return sL(e)?n(t?hL(e):function(e){const t=dL(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(JSON.stringify(e)):e}function cH(e,t){return CH(e,(n,r)=>{t=r.marks?r.marks(e,n,t):t,sH(n,r=>{r.marks&&(t=r.marks(e,n,t))})}),t}function fH(e){return e.map(e=>(e.on&&!e.on.length&&delete e.on,e))}var dH=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{const n=t.name,r=n+"_tuple_fields",i=JW.has(t),o=[],a=[],s=[];if(t.translate&&!i){const e="!event.item || event.item.mark.name !== "+Object(ie.bb)(n+hH);mH(t,(t,n)=>{var r;const i=Object(ie.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 aL("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=JW.has(t),u=Object(ie.bb)(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=mH(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:yR(c)?`[${f(a+"[0]")}, ${f(a+"[1]")}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:lH(r,!0,f)}:{value:[]}),{on:p}),Object.assign(Object.assign({name:a},r?{init:lH(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(ie.bb)(e.scaleName(i)),h=yR(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: ${_H(e)}, fields: ${r}, values`;return o.concat(Object.assign(Object.assign({name:n+xH},u?{init:`{${l}: ${lH(u)}}`}:{}),{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+` ? {${l}: [${a}]} : null`}]}))},modifyExpr:(e,t)=>t.name+xH+", "+("global"===t.resolve?"true":`{unit: ${_H(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(ie.bb)(t.name+yH)})`;if(JW.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 EM(l))l[t]=[Object.assign({test:`${u}.length && ${u}[0].unit === ${_H(e)}`},l[t]),{value:0}];const c=t.mark,{fill:f,fillOpacity:d,cursor:h}=c,p=dH(c,["fill","fillOpacity","cursor"]),m=EM(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+hH+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:f},fillOpacity:{value:d}},update:l}},...n,{name:r+hH,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},h?{cursor:{value:h}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},l),m)}}]}};function mH(e,t){return e.events.reduce((e,n)=>n.between?t(e,n):(aL(n+" is not an ordered event stream for interval selections."),e),[])}function gH(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(ie.bb)(e.vgField(t.channel,{}))}], ${o}[${Object(ie.bb)(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${o}[${Object(ie.bb)(t.field)}]`}).join(", "),s=`unit: ${_H(e)}, fields: ${r}, values`,u=t.events;return[{name:n+xH,on:u?[{events:u,update:`datum && item().mark.marktype !== 'group' ? {${s}: [${a}]} : null`,force:!0}]:[]}]}const vH={signals:gH,modifyExpr:(e,t)=>t.name+xH+", "+("global"===t.resolve?"null":`{unit: ${_H(e)}}`)};const bH={signals:gH,modifyExpr:(e,t)=>t.name+xH+", "+("global"===t.resolve?"true":`{unit: ${_H(e)}}`)};const yH="_store",xH="_tuple",wH="_modify",OH="vlSelectionResolve",EH={single:bH,multi:vH,interval:pH};function CH(e,t){const n=e.component.selection;if(n)for(const e of CM(n)){if(!0===t(e,EH[e.type]))break}}function _H(e,{escape:t}={escape:!0}){let n=t?Object(ie.bb)(e.name):e.name;const r=function(e){let t=e.parent;for(;t&&!oY(t);)t=t.parent;return t}(e);if(r){const{facet:e}=r;for(const t of kN)e[t]&&(n+=` + '__facet_${t}_' + (facet[${Object(ie.bb)(r.vgField(t))}])`)}return n}function kH(e){let t=!1;return CH(e,e=>{t=t||e.project.items.some(e=>"_vgsid_"===e.field)}),t}function AH(e){this.type=e}var SH,jH,DH,FH,TH;AH.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",SH[3]="Identifier",SH[4]="Keyword",SH[5]="Null",SH[6]="Numeric",SH[7]="Punctuator",SH[8]="String",SH[9]="RegularExpression";var MH=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]"),NH=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 PH(e,t){if(!e)throw new Error("ASSERT: "+t)}function BH(e){return e>=48&&e<=57}function LH(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function RH(e){return"01234567".indexOf(e)>=0}function zH(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 IH(e){return 10===e||13===e||8232===e||8233===e}function UH(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&MH.test(String.fromCharCode(e))}function $H(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&NH.test(String.fromCharCode(e))}const WH={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 HH(){for(;DH1114111||"}"!==e)&&sq({},"Unexpected token %0","ILLEGAL"),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function GH(){var e,t;for(e=jH.charCodeAt(DH++),t=String.fromCharCode(e),92===e&&(117!==jH.charCodeAt(DH)&&sq({},"Unexpected token %0","ILLEGAL"),++DH,(e=qH("u"))&&"\\"!==e&&UH(e.charCodeAt(0))||sq({},"Unexpected token %0","ILLEGAL"),t=e);DH>>="===(r=jH.substr(DH,4))?{type:7,value:r,start:i,end:DH+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:DH+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:7,value:t,start:i,end:DH+=2}:("//"===t&&sq({},"Unexpected token %0","ILLEGAL"),"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:i,end:++DH}:void sq({},"Unexpected token %0","ILLEGAL"))}function XH(){var e,t,n;if(PH(BH((n=jH[DH]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=DH,e="","."!==n){if(e=jH[DH++],n=jH[DH],"0"===e){if("x"===n||"X"===n)return++DH,function(e){let t="";for(;DH=0&&sq({},"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";sq({},"Invalid regular expression")}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){sq({},"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:DH}}function QH(){if(HH(),DH>=FH)return{type:2,start:DH,end:DH};const e=jH.charCodeAt(DH);return UH(e)?YH():40===e||41===e||59===e?KH():39===e||34===e?function(){var e,t,n,r,i="",o=!1;for(PH("'"===(e=jH[DH])||'"'===e,"String literal must starts with a quote"),t=DH,++DH;DH=0&&DH(PH(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 Cq(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=TH,u=Oq(),0===(i=Eq(r=TH)))return u;for(r.prec=i,ZH(),t=[e,TH],o=[u,r,a=Oq()];(i=Eq(TH))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=tq(s,u,a),o.push(n);(r=ZH()).prec=i,o.push(r),t.push(TH),n=Oq(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=tq(o[l-1].value,o[l-2],n),l-=2;return n}(),cq("?")&&(ZH(),t=Cq(),lq(":"),e=function(e,t,n){const r=new AH("ConditionalExpression");return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,Cq())),e}function _q(){const e=Cq();if(cq(","))throw new Error("Disabled.");return e}function kq(e){const t=function(e){DH=0,FH=(jH=e).length,TH=null,eq();const t=_q();if(2!==TH.type)throw new Error("Unexpect token after expression.");return t}(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 Aq extends $W{constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=Fq(this.model,this.filter,this),this._dependentFields=kq(this.expr)}clone(){return new Aq(null,this.model,oM(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter "+this.expr}}var Sq=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`length(data(${e}))`).join(" || ")+") || ":"")+`(${o})`}function Dq(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,aL((i.length?"Multiple ":"No ")+`matching ${Object(ie.bb)(n)} encoding found for selection ${Object(ie.bb)(t.selection)}. `+`Using "field": ${Object(ie.bb)(r)}.`)):r=i[0].field}}else r=e.project.items[0].field,e.project.items.length>1&&aL(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${Object(ie.bb)(r)}.`);return`${e.name}[${Object(ie.bb)(r)}]`}function Fq(e,t,n){return SM(t,t=>Object(ie.J)(t)?t:function(e){return null==e?void 0:e.selection}(t)?jq(e,t.selection,n):zL(t))}var Tq=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{const{test:t}=e,n=Tq(e,["test"]);return Object.assign({test:Fq(null,t)},n)}),n]),delete h[e]}else if(null===o){const t={signal:i.map(e=>{const{test:t}=e,n=Tq(e,["test"]);return`${Fq(null,t)} ? ${FI(n)} : `}).join("")+FI(n)};h[e]=t}}else if(CL(r)){const t=VM[e];if(t){const{vgProp:n,part:i}=t;Mq(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}:{}),OM(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:RM(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)&&CL(h.encode.labels.update.text)&&(e=PM(c,"datum.label",h.encode.labels.update.text.signal)),Mq(h,"labels","text",{signal:e})}if(null===h.labelAlign&&delete h.labelAlign,h.encode){for(const t of YM)e.hasAxisPart(t)||delete h.encode[t];OM(h.encode)&&delete h.encode}const t=function(e,t){if(e)return Object(ie.B)(e)&&!_I(e)?e.map(e=>cI(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:RM(d,0)})}}}function Pq(e){const{axes:t}=e.component,n=[];for(const r of oP)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 Bq(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([...EM(i),...EM(o)]),s={};for(const t of a.values())s[t]={signal:`${r.signal} === "${e}" ? ${TI(i[t])} : ${TI(o[t])}`};return s}return t[e]})])}function Lq(e,t,n,r){const i="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:t in hR?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[];const o="x"===e?"axisX":"axisY",a=CL(n)?"axisOrient":"axis"+DM(n),s=[...i,...i.map(e=>o+e.substr(4))],u=["axis",a,o];return{vlOnlyAxisConfig:Bq(s,r,e,n),vgAxisConfig:Bq(u,r,e,n),axisConfigStyle:Rq([...u,...s],r)}}function Rq(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(ie.i)(e);for(const n of e)r.push(t.style[n])}}return Object.assign.apply(null,r)}function zq(e,t,n,r={}){var i;const o=LI(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 Iq={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{const{format:r,formatType:i}=n;return xz(e,e.type,r,i,t,!0)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return wz(r,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>{var r;return(!Wz(e)||!DP(e.bin))&&(null!==(r=t.grid)&&void 0!==r?r:function(e,t){return!bR(e)&&Wz(t)&&!jP(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||Wq(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||$q(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&&fM(["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(ie.H)(r)||"nominal"!==e&&"ordinal"!==e)return"log"!==t&&"symlog"!==t||"greedy";return}(t.type,n,Wz(t)&&!!t.timeUnit,Wz(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&&!bR(t)&&"log"!==t){if(Wz(e)){if(jP(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&fM(["month","hours","day","quarter"],null===(i=EL(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=Hq(t,n);if(void 0!==r)return r;const i=t.typedFieldDef(n),o="x"===n?"x2":"y2",a=t.fieldDef(o);return zI(i?[Bz(i)]:[],Wz(a)?[Bz(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function(e,t){const n=e.values;if(Object(ie.B)(n))return wI(t,n);if(CL(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&&rI(t))return 1;return 0}(n,t)}};function Uq(e){return`(((${e.signal} % 360) + 360) % 360)`}function $q(e,t,n,r){if(void 0!==e){if("x"===n){if(CL(e)){const n=Uq(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${CL(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45{if(Jz(t)&&Fz(t.sort)){const{field:r,timeUnit:i}=t,o=t.sort,a=o.map((e,t)=>`${zL({field:r,timeUnit:i,equal:e})} ? ${t} : `).join("")+o.length;e=new qq(e,{calculate:a,as:Vq(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 "+lM(this.transform)}}function Vq(e,t,n){return nI(e,Object.assign({prefix:t,suffix:"sort_index"},null!=n?n:{}))}function Gq(e,t){return fM(["top","bottom"],t)?"column":fM(["left","right"],t)||"row"===e?"row":"column"}function Yq(e,t,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return RM((t||{})[e],i[e],n.header[e])}function Kq(e,t,n,r){const i={};for(const o of e){const e=Yq(o,t||{},n,r);void 0!==e&&(i[o]=e)}return i}const Xq=["row","column"],Jq=["header","footer"];function Qq(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}=Kq(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),u=Gq(t,s),l=HM(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"}),eV(l,u)),Zq(u,l,o)),sV(r,i,t,CU,OU))}}function Zq(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=Wq(t,"row"===e?"left":"top","row"===e?"y":"x");return r?{align:r}:{}}function eV(e,t){const n=$q(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function tV(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of Jq)if(n[i])for(const o of n[i]){const a=iV(e,t,i,n,o);null!=a&&r.push(a)}return r}function nV(e,t){var n;const{sort:r}=e;return Dz(r)?{field:nI(r,{expr:"datum"}),order:null!==(n=r.order)&&void 0!==n?n:"ascending"}:Object(ie.B)(r)?{field:Vq(e,t,{expr:"datum"}),order:"ascending"}:{field:nI(e,{expr:"datum"}),order:null!=r?r:"ascending"}}function rV(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=Kq(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=vz({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,c=Gq(t,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:u?PM(PM(u,"datum.label",l),"datum.value",nI(e,{expr:"parent"})):l}},"row"===t?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),eV(o,c)),Zq(c,o,a)),sV(n,e,t,_U,EU))}function iV(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}=Kq(["labelOrient"],a.header,s,t);("row"===t&&!fM(["top","bottom"],e)||"column"===t&&!fM(["left","right"],e))&&(o=rV(a,t,s))}const u=oY(e)&&!Tz(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:nV(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 oV={column:{start:0,end:1},row:{start:1,end:0}};function aV(e,t){return oV[t][e]}function sV(e,t,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=Yq(a,null==t?void 0:t.header,e,n);void 0!==r&&(o[i[a]]=r)}return o}function uV(e){return[...lV(e,"width"),...lV(e,"height"),...lV(e,"childWidth"),...lV(e,"childHeight")]}function lV(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(bR(r)&&_L(o)){const r=e.scaleName(n);if(oY(e.parent)){if("independent"===e.parent.component.resolve.scale[n])return[cV(r,o)]}return[cV(r,o),{name:i,update:fV(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} : ${UU(e.config.view,t?"width":"height")}`;return[{name:i,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:i,value:r}]}function cV(e,t){return{name:e+"_step",value:t.step}}function fV(e,t,n){const r=t.get("type"),i=t.get("padding"),o=RM(t.get("paddingOuter"),i);let a=t.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,`bandspace(${n}, ${TI(a)}, ${TI(o)}) * ${e}_step`}function dV(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function hV(e,t){return EM(e).reduce((n,r)=>{const i=e[r];return Object.assign(Object.assign({},n),pW(t,i,r,e=>DI(e.value)))},{})}function pV(e,t){if(sY(t)||oY(t))return"shared";if(aY(t))return aP(e)?"independent":"shared";throw new Error("invalid model type for resolve")}function mV(e,t){const n=e.scale[t],r=aP(t)?"axis":"legend";return"independent"===n?("shared"===e[r][t]&&aL(b.independentScaleMeansIndependentGuide(t)),"independent"):e[r][t]||"shared"}const gV=Object.assign(Object.assign({},SU),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),vV=EM(gV);class bV extends P${}const yV={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:m,config:g,mark:v}=n,b=p.filled&&"trail"!==v;let y=Object.assign(Object.assign({},function(e,t,n){for(const r of n){const n=PI(r,t.markDef,t.config);void 0!==n&&(e[r]=DI(n))}return e}({},n,tz)),OW(n,{filled:b}));const x=null!==(a=i.get("symbolOpacity"))&&void 0!==a?a:g.legend.symbolOpacity,w=null!==(s=i.get("symbolFillColor"))&&void 0!==s?s:g.legend.symbolFillColor,O=null!==(u=i.get("symbolStrokeColor"))&&void 0!==u?u:g.legend.symbolStrokeColor,E=void 0===x?null!==(l=xV(m.opacity))&&void 0!==l?l:p.opacity:void 0;if(y.fill)if("fill"===r||b&&r===mN)delete y.fill;else if(y.fill.field)w?delete y.fill:(y.fill=DI(null!==(c=g.legend.symbolBaseFillColor)&&void 0!==c?c:"black"),y.fillOpacity=DI(null!=E?E:1));else if(Object(ie.B)(y.fill)){const e=null!==(h=null!==(d=wV(null!==(f=m.fill)&&void 0!==f?f:m.color))&&void 0!==d?d:p.fill)&&void 0!==h?h:b&&p.color;e&&(y.fill=DI(e))}if(y.stroke)if("stroke"===r||!b&&r===mN)delete y.stroke;else if(y.stroke.field||O)delete y.stroke;else if(Object(ie.B)(y.stroke)){const e=RM(wV(m.stroke||m.color),p.stroke,b?p.color:void 0);e&&(y.stroke={value:e})}if("opacity"!==r){const e=Wz(t)&&EV(n,i,t);e?y.opacity=[Object.assign({test:e},DI(null!=E?E:1)),DI(g.legend.unselectedOpacity)]:E&&(y.opacity=DI(E))}return y=Object.assign(Object.assign({},y),e),OM(y)?void 0:y},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)?xV(s.opacity)||a.opacity:void 0;l&&(u.opacity=DI(l));return u=Object.assign(Object.assign({},u),e),OM(u)?void 0:u},labels:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},a=n.config,s=Wz(t)?EV(n,i,t):void 0,u=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o,f=mz(c)?yz({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 OM(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 xV(e){return OV(e,(e,t)=>Math.max(e,t.value))}function wV(e){return OV(e,(e,t)=>RM(e,t.value))}function OV(e,t){return function(e){const t=e&&e.condition;return!!t&&(Object(ie.B)(t)||Xz(t))}(e)?Object(ie.i)(e.condition).reduce(t,e.value):Xz(e)?e.value:void 0}function EV(e,t,n){const r=t.get("selections");if(!(null==r?void 0:r.length))return;const i=Object(ie.bb)(n.field);return r.map(e=>`(!length(data(${Object(ie.bb)(AM(e)+yH)})) || (${e}[${i}] && indexof(${e}[${i}], datum.value) >= 0))`).join(" || ")}const CV={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return xz(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return wz(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(xR(i))return"horizontal"===n?"top"===r||"bottom"===r?AV(t,"width",a,o):a:AV(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(fM(["quantile","threshold","log","symlog"],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=wV(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})=>uI(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(CN(n)&&xR(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(ie.B)(n))return wI(t,n);if(CL(n))return n;return}(t,e)};function _V(e){const{legend:t}=e;return RM(t.type,function({channel:e,timeUnit:t,scaleType:n}){if(CN(e)){if(fM(["quarter","month","day"],t))return"symbol";if(xR(n))return"gradient"}return"symbol"}(e))}function kV({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 AV(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function SV(e){const t=iY(e)?function(e){const{encoding:t}=e,n={};for(const r of[mN,...AU]){const i=hI(t[r]);i&&e.getScaleComponent(r)&&(r===bN&&Wz(i)&&i.type===GL||(n[r]=DV(e,r)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){SV(r);for(const i of EM(r.component.legends))n.legend[i]=mV(e.component.resolve,i),"shared"===n.legend[i]&&(t[i]=FV(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of EM(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 jV(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 DV(e,t){var n,r,i;let o=e.legend(t);const{markDef:a,encoding:s,config:u}=e,l=u.legend,c=new bV({},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;CH(e,e=>{var r,o;const a=null!==(r=e.project.hasField[i])&&void 0!==r?r:e.project.hasChannel[t];if(a&&eH.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=hI(s[t]),p=Wz(h)?null===(n=EL(h.timeUnit))||void 0===n?void 0:n.unit:void 0,m=o.orient||u.legend.orient||"right",g=_V({legend:o,channel:t,timeUnit:p,scaleType:d}),v={legend:o,channel:t,model:e,markDef:a,encoding:s,fieldOrDatumDef:h,legendConfig:l,config:u,scaleType:d,orient:m,legendType:g,direction:kV({legend:o,legendType:g,orient:m,legendConfig:l})};for(const n of vV){if("gradient"===g&&n.startsWith("symbol")||"symbol"===g&&n.startsWith("gradient"))continue;const r=n in CV?CV[n](v):o[n];if(void 0!==r){const i=jV(r,n,o,e.fieldDef(t));(i||void 0===u.legend[n])&&c.set(n,r,i)}}const b=null!==(r=null==o?void 0:o.encoding)&&void 0!==r?r:{},y=c.get("selections"),x={},w={fieldOrDatumDef:h,model:e,channel:t,legendCmpt:c,legendType:g};for(const t of["labels","legend","title","symbols","gradient","entries"]){const n=hV(null!==(i=b[t])&&void 0!==i?i:{},e),r=t in yV?yV[t](n,w):n;void 0===r||OM(r)||(x[t]=Object.assign(Object.assign(Object.assign({},(null==y?void 0:y.length)&&Wz(h)?{name:`${AM(h.field)}_legend_${t}`}:{}),(null==y?void 0:y.length)?{interactive:!!y}:{}),{update:r}))}return OM(x)||c.set("encode",x,!!(null==o?void 0:o.encoding)),c}function FV(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 vV){const r=I$(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",(e,t)=>{switch(n){case"symbolType":return TV(e,t);case"title":return UI(e,t);case"type":return u=!0,L$("symbol")}return z$(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)&&jM(e.implicit,["encode","gradient"]),(null===(o=null===(i=e.explicit)||void 0===i?void 0:i.encode)||void 0===o?void 0:o.gradient)&&jM(e.explicit,["encode","gradient"])),e}function TV(e,t){return"circle"===t.value?t:e}var MV=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);ifunction(e,t){var n,r,i;const o=e.combine(),{disable:a,labelExpr:s,selections:u}=o,l=MV(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 AU)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)&&CL(l.encode.labels.update.text)&&(e=PM(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 PV(e){return sY(e)||aY(e)?function(e){return e.children.reduce((e,t)=>e.concat(t.assembleProjections()),BV(e))}(e):BV(e)}function BV(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=CL(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return fM(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 LV=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class RV extends P${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 zV(e){e.component.projection=iY(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"]])(hI(n[r[0]])||hI(n[r[1]]))&&t.push({signal:e.getName("geojson_"+t.length)});e.channelHasField(bN)&&e.typedFieldDef(bN).type===GL&&t.push({signal:e.getName("geojson_"+t.length)});0===t.length&&t.push(e.requestDataName(K$.Main));return t}(e):void 0;return new RV(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)zV(t);const n=hM(e.children,e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=hM(LV,n=>!Object(ie.w)(e.explicit,n)&&!Object(ie.w)(t.explicit,n)||!(!Object(ie.w)(e.explicit,n)||!Object(ie.w)(t.explicit,n)||uM(e.get(n))!==uM(t.get(n))));if(uM(e.size)===uM(t.size)){if(n)return e;if(uM(e.explicit)===uM({}))return t;if(uM(t.explicit)===uM({}))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 RV(n,t.specifiedProjection,t.size,oM(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)}var IV=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{if(Kz(n)&&jP(n.bin)){const{key:i,binComponent:o}=WV(n,n.bin,t);e[i]=Object.assign(Object.assign(Object.assign({},o),e[i]),function(e,t,n,r){var i,o;if(OI(t,n)){const a=iY(e)&&null!==(o=null!==(i=e.axis(n))&&void 0!==i?i:e.legend(n))&&void 0!==o?o:{},s=nI(t,{expr:"datum"}),u=nI(t,{expr:"datum",binSuffix:"end"});return{formulaAs:nI(t,{binSuffix:"range",forAs:!0}),formula:_z(s,u,a.format,a.formatType,r)}}return{}}(t,n,r,t.config))}return e},{});return OM(n)?null:new HV(e,n)}static makeFromTransform(e,t,n){const{key:r,binComponent:i}=WV(t,t.bin,n);return new HV(e,{[r]:i})}merge(e,t){for(const n of EM(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=gM([...this.bins[n].as,...e.bins[n].as],lM)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(CM(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(CM(this.bins).map(e=>e.field))}hash(){return"Bin "+lM(this.bins)}assemble(){return CM(this.bins).flatMap(e=>{const t=[],[n,...r]=e.as,i=e.bin,{extent:o}=i,a=IV(i,["extent"]),s=Object.assign(Object.assign(Object.assign({type:"bin",field:NM(e.field),as:n,signal:e.signal},TP(o)?{extent:null}:{extent:o}),e.span?{span:{signal:`span(${e.span})`}}:{}),a);!o&&e.extentSignal&&(t.push({type:"extent",field:NM(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:nI({field:n[r]},{expr:"datum"}),as:e[r]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t})}}function qV(e,t,n,r){const i=iY(r)?r.encoding[$N(t)]:void 0;if(Kz(n)&&iY(r)&&zz(t,n,i,r.stack,r.markDef,r.config))e.add(nI(n,{})),e.add(nI(n,{suffix:"end"})),n.bin&&OI(n,t)&&e.add(nI(n,{binSuffix:"range"}));else if(t in wN){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(nI(n));return e}class VV extends $W{constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}clone(){return new VV(null,new Set(this.dimensions),oM(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([nI(e,{forAs:!0})]);else{if(nN(l)||rN(l)){const e=nN(l)?"argmin":"argmax",t=l[e];r[t]=null!==(a=r[t])&&void 0!==a?a:{},r[t][e]=new Set([nI({op:e,field:t},{forAs:!0})])}else r[c]=null!==(s=r[c])&&void 0!==s?s:{},r[c][l]=new Set([nI(e,{forAs:!0})]);OP(n)&&"unaggregated"===t.scaleDomain(n)&&(r[c]=null!==(u=r[c])&&void 0!==u?u:{},r[c].min=new Set([nI({field:c,aggregate:"min"},{forAs:!0})]),r[c].max=new Set([nI({field:c,aggregate:"max"},{forAs:!0})]))}else qV(i,n,e,t)}),i.size+EM(r).length===0?null:new VV(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||nI(e,{forAs:!0})])):(a[i]=null!==(r=a[i])&&void 0!==r?r:{},a[i][t]=new Set([o||nI(e,{forAs:!0})])))}for(const e of null!==(i=t.groupby)&&void 0!==i?i:[])o.add(e);return o.size+EM(a).length===0?null:new VV(e,o,a)}merge(e){return bM(this.dimensions,e.dimensions)?(function(e,t){var n;for(const r of EM(t)){const i=t[r];for(const t of EM(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){iL.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...EM(this.measures)])}producedFields(){const e=new Set;for(const t of EM(this.measures))for(const n of EM(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 "+lM({dimensions:this.dimensions,measures:this.measures})}assemble(){const e=[],t=[],n=[];for(const r of EM(this.measures))for(const i of EM(this.measures[r]))for(const o of this.measures[r][i])n.push(o),e.push(i),t.push("*"===r?null:NM(r));return{type:"aggregate",groupby:[...this.dimensions].map(NM),ops:e,fields:t,as:n}}}class GV extends $W{constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(const e of kN){const n=t.facet[e];if(n){const{bin:r,sort:i}=n;this[e]=Object.assign({name:t.getName(e+"_domain"),fields:[nI(n),...jP(r)?[nI(n,{binSuffix:"end"})]:[]]},Dz(i)?{sortField:i}:Object(ie.B)(i)?{sortIndexField:Vq(n,e)}:{})}}this.childModel=t.child}hash(){let e="Facet";for(const t of kN)this[t]&&(e+=` ${t.charAt(0)}:${lM(this[t])}`);return e}get fields(){var e;const t=[];for(const n of kN)(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 kN)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 oP){const n=this.childModel.component.scales[t];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(bR(r)&&_L(i)){const n=RG(zG(this.childModel,t));n?e[t]=n:aL(b.unknownField(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=kz,field:t}=s;i.push(t),o.push(e),a.push(nI(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 Xq){for(const r of Jq){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[fN,cN])this[e]&&n.push(this.assembleRowColumnHeaderData(e,r,i));if(s){const e=this.assembleFacetHeaderData(i);e&&n.push(...e)}return n}}function YV(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function KV(e){const t={};return function e(t,n){if(nM(t))e(t.not,n);else if(tM(t))for(const r of t.and)e(r,n);else if(eM(t))for(const r of t.or)e(r,n);else n(t)}(e.filter,e=>{var n;if(LL(e)){let r=null;DL(e)?r=SI(e.equal):TL(e)?r=SI(e.lte):FL(e)?r=SI(e.lt):ML(e)?r=SI(e.gt):NL(e)?r=SI(e.gte):PL(e)?r=e.range[0]:BL(e)&&(r=(null!==(n=e.oneOf)&&void 0!==n?n:e.in)[0]),r&&(sL(r)?t[e.field]="date":Object(ie.G)(r)?t[e.field]="number":Object(ie.J)(r)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}}),t}function XV(e){const t={};function n(e){var n;yI(e)?t[e.field]="date":"quantitative"===e.type&&(n=e.aggregate,Object(ie.J)(n)&&fM(["min","max"],n))?t[e.field]="number":LM(e.field)>1?e.field in t||(t[e.field]="flatten"):Jz(e)&&Dz(e.sort)&&LM(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((iY(e)||oY(e))&&e.forEachFieldDef((t,r)=>{if(Kz(t))n(t);else{const i=IN(r),o=e.fieldDef(i);n(Object.assign(Object.assign({},t),{type:o.type}))}}),iY(e)){const{mark:n,markDef:r,encoding:i}=e;if(JR(n)&&!e.encoding.order){const e=i["horizontal"===r.orient?"y":"x"];Wz(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}class JV extends $W{constructor(e,t){super(e),this._parse=t}clone(){return new JV(null,oM(this._parse))}hash(){return"Parse "+lM(this._parse)}static makeExplicit(e,t,n){let r={};const i=t.data;return!q$(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 EM(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]:aL(b.differentParse(e,n[e],t.value)))}for(const e of EM(t)){const n=r.get(e);void 0!==n&&(n===t[e]?delete t[e]:aL(b.differentParse(e,t[e],n)))}const i=new P$(t,n);r.copyAll(i);const o={};for(const e of EM(i.combine())){const t=i.get(e);null!==t&&(o[e]=t)}return 0===EM(o).length||r.parseNothing?null:new JV(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 EM(this._parse)){const n=this._parse[t];1===LM(t)&&(e[t]=n)}return e}producedFields(){return new Set(EM(this._parse))}dependentFields(){return new Set(EM(this._parse))}assembleTransforms(e=!1){return EM(this._parse).filter(t=>!e||LM(t)>1).map(e=>{const t=function(e,t){const n=FM(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},'${YV(t.slice(5,t.length))}')`}if(0===t.indexOf("utc:")){return`utcParse(${n},'${YV(t.slice(4,t.length))}')`}return aL(b.unrecognizedParse(t)),null}(e,this._parse[e]);if(!t)return null;return{type:"formula",expr:t,as:BM(e)}}).filter(e=>null!==e)}}class QV extends $W{clone(){return new QV(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set(["_vgsid_"])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:"_vgsid_"}}}class ZV extends $W{constructor(e,t){super(e),this.params=t}clone(){return new ZV(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return"Graticule "+lM(this.params)}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class eG extends $W{constructor(e,t){super(e),this.params=t}clone(){return new eG(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 "+lM(this.params)}assemble(){return Object.assign({type:"sequence"},this.params)}}class tG extends $W{constructor(e){let t;if(super(null),q$(e=null!=e?e:{name:"source"})||(t=e.format?Object.assign({},sM(e.format,["parse"])):{}),W$(e))this._data={values:e.values};else if($$(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];fM(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else G$(e)?this._data={values:[{type:"Sphere"}]}:(H$(e)||q$(e))&&(this._data={});this._generator=q$(e),e.name&&(this._name=e.name),t&&!OM(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 nG,rG=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n},iG=function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)};function oG(e){return e instanceof tG||e instanceof ZV||e instanceof eG}class aG{constructor(){nG.set(this,void 0),rG(this,nG,!1)}setModified(){rG(this,nG,!0)}get modifiedFlag(){return iG(this,nG)}}nG=new WeakMap;class sG extends aG{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 uG extends aG{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class lG extends uG{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 cG extends uG{constructor(e){super(),this.requiresSelectionId=e&&kH(e)}run(e){e instanceof QV&&(this.requiresSelectionId&&(oG(e.parent)||e.parent instanceof VV||e.parent instanceof JV)||(this.setModified(),e.remove()))}}class fG extends aG{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof qW&&(n=e.producedFields(),yM(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 dG extends uG{constructor(){super()}run(e){e instanceof WW&&!e.isRequired()&&(this.setModified(),e.remove())}}class hG extends sG{run(e){if(!(oG(e)||e.numChildren()>1))for(const t of e.children)if(t instanceof JV)if(e instanceof JV)this.setModified(),e.merge(t);else{if(wM(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class pG extends sG{run(e){const t=[...e.children],n=e.children.filter(e=>e instanceof JV);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 EM(t))e in r?r[e]!==t[e]&&i.add(e):r[e]=t[e]}for(const e of i)delete r[e];if(!OM(r)){this.setModified();const n=new JV(e,r);for(const i of t){if(i instanceof JV)for(const e of EM(r))delete i.parse[e];e.removeChild(i),i.parent=n,i instanceof JV&&0===EM(i.parse).length&&i.remove()}}}}}class mG extends sG{run(e){e instanceof WW||e.numChildren()>0||e instanceof GV||e instanceof tG||(this.setModified(),e.remove())}}class gG extends sG{run(e){const t=e.children.filter(e=>e instanceof qW),n=t.pop();for(const e of t)this.setModified(),n.merge(e)}}class vG extends sG{run(e){const t=e.children.filter(e=>e instanceof VV),n={};for(const e of t){const t=lM(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(const t of EM(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 bG extends sG{constructor(e){super(),this.model=e}run(e){const t=!(oG(e)||e instanceof Aq||e instanceof JV||e instanceof QV),n=[],r=[];for(const i of e.children)i instanceof HV&&(t&&!wM(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 HV?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 yG extends sG{run(e){const t=[...e.children];if(!dM(t,e=>e instanceof WW)||e.numChildren()<=1)return;const n=[];let r;for(const i of t)if(i instanceof WW){let t=i;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof WW))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 xG extends $W{constructor(e,t){super(e),this.transform=t}clone(){return new xG(null,oM(this.transform))}addDimensions(e){this.transform.groupby=gM(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:nI(e)}hash(){return"JoinAggregateTransform "+lM(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 wG extends $W{constructor(e,t){super(e),this._stack=t}clone(){return new wG(null,oM(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(RM(e.order,"ascending"));const u={field:a,order:s};let l;return l=function(e){return Object(ie.B)(e)&&e.every(e=>Object(ie.J)(e))&&e.length>1}(i)?i:Object(ie.J)(i)?[i,i+"_end"]:[t.stack+"_start",t.stack+"_end"],new wG(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=dI(r[i])}const l=function(e){return e.stack.stackBy.reduce((e,t)=>{const n=nI(t.fieldDef);return n&&e.push(n),e},[])}(t),c=t.encoding.order;let f;return f=Object(ie.B)(c)||Wz(c)?RI(c):l.reduce((e,t)=>(e.field.push(t),e.order.push("y"===o?"descending":"ascending"),e),{field:[],order:[]}),new wG(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 "+lM(this._stack)}getGroupbyFields(){const{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[nI(e,{binSuffix:"mid"})]:[nI(e,{}),nI(e,{binSuffix:"end"})]:[nI(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+"*"+nI(n,{expr:"datum"})+`+${1-o}*`+nI(n,{expr:"datum",binSuffix:"end"}),as:nI(n,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:r,groupby:[...i,...t],key:nI(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 OG extends $W{constructor(e,t){super(e),this.transform=t}clone(){return new OG(null,oM(this.transform))}addDimensions(e){this.transform.groupby=gM(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:nI(e)}hash(){return"WindowTransform "+lM(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=>iN(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 EG(e){if(e instanceof GV)if(1!==e.numChildren()||e.children[0]instanceof WW){const n=e.model.component.data.main;!function e(t){if(t instanceof WW&&t.type===K$.Main&&1===t.numChildren()){const n=t.children[0];n instanceof GV||(n.swapWithParent(),e(t))}}(n);const r=(t=e,function e(n){if(!(n instanceof GV)){const r=n.clone();if(r instanceof WW){const e=CG+r.getSource();r.setSource(e),t.model.component.data.outputNodes[e]=r}else(r instanceof VV||r instanceof wG||r instanceof OG||r instanceof xG)&&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 VV||t instanceof wG||t instanceof OG||t instanceof xG)&&t.addDimensions(e.fields),t.swapWithParent(),EG(e)}else e.children.map(EG);var t}const CG="scale_";function _G(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!_G(t.children))return!1}return!0}function kG(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function AG(e,t,n){let r=e.sources,i=!1;return i=kG(new dG,r)||i,i=kG(new cG(t),r)||i,r=r.filter(e=>e.numChildren()>0),i=kG(new mG,r)||i,r=r.filter(e=>e.numChildren()>0),n||(i=kG(new hG,r)||i,i=kG(new bG(t),r)||i,i=kG(new fG,r)||i,i=kG(new pG,r)||i,i=kG(new vG,r)||i,i=kG(new gG,r)||i,i=kG(new lG,r)||i,i=kG(new yG,r)||i),e.sources=r,i}class SG{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new SG(()=>e(t))}}var jG=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({signal:`{data: ${xI(e,{timeUnit:n,type:t})}}`}))}(e,t,i):[e]}function MG(e,t,n,r){const{encoding:i}=n,o=hI(i[r]),{type:a}=o,s=o.timeUnit;if(function(e){return e&&e.unionWith}(t)){const i=MG(e,void 0,n,r),o=TG(t.unionWith,a,s);return B$([...i.value,...o])}if(CL(t))return B$([t]);if(t&&"unaggregated"!==t&&!OR(t))return B$(TG(t,a,s));const u=n.stack;if(u&&r===u.fieldChannel){if("normalize"===u.offset)return L$([[0,1]]);const e=n.requestDataName(K$.Main);return L$([{data:e,field:n.vgField(r,{suffix:"start"})},{data:e,field:n.vgField(r,{suffix:"end"})}])}const l=OP(r)&&Wz(o)?function(e,t,n){if(!bR(n))return;const r=e.fieldDef(t),i=r.sort;if(Fz(i))return{op:"min",field:Vq(r,t),order:"ascending"};const{stack:o}=e,a=o?[...o.groupbyField?[o.groupbyField]:[],...o.stackBy.map(e=>e.fieldDef.field)]:void 0;if(Dz(i)){const e=o&&!fM(a,i.field);return NG(i,e)}if(jz(i)){const{encoding:t,order:n}=i,r=e.fieldDef(t),{aggregate:s,field:u}=r,l=o&&!fM(a,u);if(nN(s)||rN(s))return NG({field:nI(r),order:n},l);if(iN(s)||!s)return NG({op:s,field:u,order:n},l)}else{if("descending"===i)return{op:"min",field:e.vgField(t),order:"descending"};if(fM(["ascending",void 0],i))return!0}return}(n,r,e):void 0;if(qz(o)){return L$(TG([o.datum],a,s))}const c=o;if("unaggregated"===t){const e=n.requestDataName(K$.Main),{field:t}=o;return L$([{data:e,field:nI({field:t,aggregate:"min"})},{data:e,field:nI({field:t,aggregate:"max"})}])}if(jP(c.bin)){if(bR(e))return L$("bin-ordinal"===e?[]:[{data:kM(l)?n.requestDataName(K$.Main):n.requestDataName(K$.Raw),field:n.vgField(r,OI(c,r)?{binSuffix:"range"}:{}),sort:!0!==l&&Object(ie.H)(l)?l:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:e}=c;if(jP(e)){const t=$V(n,c.field,e);return L$([new SG(()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`})])}return L$([{data:n.requestDataName(K$.Main),field:n.vgField(r,{})}])}}if(c.timeUnit&&fM(["time","utc"],e)&&zz(r,c,iY(n)?n.encoding[$N(r)]:void 0,n.stack,n.markDef,n.config)){const e=n.requestDataName(K$.Main);return L$([{data:e,field:n.vgField(r)},{data:e,field:n.vgField(r,{suffix:"end"})}])}return L$(l?[{data:kM(l)?n.requestDataName(K$.Main):n.requestDataName(K$.Raw),field:n.vgField(r),sort:l}]:[{data:n.requestDataName(K$.Main),field:n.vgField(r)}])}function NG(e,t){const{op:n,field:r,order:i}=e;return Object.assign(Object.assign({op:null!=n?n:t?"sum":kz},r?{field:NM(r)}:{}),i?{order:i}:{})}function PG(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=OR(i)&&i,s=FP(o)&&TP(o.extent)&&o.extent;(a||s)&&r.set("selectionExtent",null!=a?a:s,!0)}function BG(e,t){const{aggregate:n,type:r}=e;return n?Object(ie.J)(n)&&!uN[n]?{valid:!1,reason:b.unaggregateDomainWithNonSharedDomainOp(n)}:"quantitative"===r&&"log"===t?{valid:!1,reason:b.unaggregatedDomainWithLogScale(e)}:{valid:!0}:{valid:!1,reason:b.unaggregateDomainHasNoEffectForRawField(e)}}function LG(e,t,n,r){return e.explicit&&t.explicit&&aL(b.mergeConflictingDomainProperty(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function RG(e){if(kL(e)&&Object(ie.J)(e.field))return e.field;if(function(e){return!Object(ie.B)(e)&&("fields"in e&&!("data"in e))}(e)){let t;for(const n of e.fields)if(kL(n)&&Object(ie.J)(n.field))if(t){if(t!==n.field)return aL(b.FACETED_INDEPENDENT_DIFFERENT_SOURCES),t}else t=n.field;return aL(b.FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES),t}if(function(e){return!Object(ie.B)(e)&&("fields"in e&&"data"in e)}(e)){aL(b.FACETED_INDEPENDENT_SAME_SOURCE);const t=e.fields[0];return Object(ie.J)(t)?t:void 0}}function zG(e,t){return function(e){const t=gM(e.map(e=>{if(kL(e)){const{sort:t}=e;return jG(e,["sort"])}return e}),lM),n=gM(e.map(e=>{if(kL(e)){const t=e.sort;return void 0===t||kM(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}}).filter(e=>void 0!==e),lM);if(0===t.length)return;if(1===t.length){const t=e[0];if(kL(t)&&n.length>0){let e=n[0];if(n.length>1)aL(b.MORE_THAN_ONE_SORT),e=!0;else if(Object(ie.H)(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=gM(n.map(e=>kM(e)||!("op"in e)||Object(ie.J)(e.op)&&e.op in tN?e:(aL(b.domainSortDropped(e)),!0)),lM);let i;1===r.length?i=r[0]:r.length>1&&(aL(b.MORE_THAN_ONE_SORT),i=!0);const o=gM(e.map(e=>kL(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}:{})}(e.component.scales[t].get("domains").map(t=>(kL(t)&&(t.data=e.lookupDataSource(t.data)),t)))}var IG=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{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=IG(i,["name","type","selectionExtent","domains","range","reverse"]),d=function(e,t,n,r){if(aP(n)){if(_L(e))return{step:{signal:t+"_step"}}}else if(Object(ie.H)(e)&&kL(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:Dq(e.getSelectionComponent(n,AM(n)),t)}}(e,s));const p=zG(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 $G extends P${constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||dM(this.get("domains"),e=>Object(ie.B)(e)&&2===e.length&&e[0]<=0&&e[1]>=0)}}const WG=["range","scheme"];function HG(e){return"x"===e?"width":"y"===e?"height":void 0}function qG(e,t){const n=e.fieldDef(t);if(n&&n.bin&&jP(n.bin)){const r=$V(e,n.field,n.bin),i=HG(t),o=e.getName(i);return new SG(()=>{const t=e.getSignalName(r),n=`(${t}.stop - ${t}.start) / ${t}.step`;return`${e.getSignalName(o)} / (${n})`})}}function VG(e,t){const n=t.specifiedScales[e],{size:r}=t,i=t.getScaleComponent(e).get("type");for(const r of WG)if(void 0!==n[r]){const o=TR(i,r),a=MR(e,r);if(o)if(a)aL(a);else switch(r){case"range":{const r=n.range;if(Object(ie.B)(r)){if(aP(e))return B$(r.map(e=>{if("width"===e||"height"===e){const n=t.getName(e),r=t.getSignalName.bind(t);return SG.fromName(r,n)}return e}))}else if(Object(ie.H)(r))return B$({data:t.requestDataName(K$.Main),field:r.field,sort:{op:"min",field:t.vgField(e)}});return B$(r)}case"scheme":return B$(GG(n[r]))}else aL(b.scalePropertyNotWorkWithScaleType(i,r,e))}if("x"===e||"y"===e){const t="x"===e?"width":"height",n=r[t];if(LU(n)){if(bR(i))return B$({step:n.step});aL(b.stepDropped(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}=hI(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case"x":case"y":{if(fM(["point","band"],u))if("x"!==e||n.width){if("y"===e&&!n.height){const e=WU(r.view,"height");if(LU(e))return e}}else{const e=WU(r.view,"width");if(LU(e))return e}const i=HG(e),o=t.getName(i);return"y"===e&&yR(u)?[SG.fromName(a,o),0]:[0,SG.fromName(a,o)]}case"size":{const o=t.component.scales[e].get("zero"),a=function e(t,n,r){if(n)return CL(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(b.incompatibleChannel("size",t))}(i,o,r),s=function(e,t,n,r){const i={x:qG(n,"x"),y:qG(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const e=YG(t,i,r.view);return Object(ie.G)(e)?e-1:new SG(()=>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=YG(t,i,r.view);return Object(ie.G)(e)?Math.pow(.95*e,2):new SG(()=>`pow(0.95 * ${e.signal}, 2)`)}}throw new Error(b.incompatibleChannel("size",e))}(i,n,t,r);return wR(u)?function(e,t,n){const r=()=>{const r=TI(t),i=TI(e),o=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${o}, ${o})`};return CL(t)?new SG(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(ie.B)(n)?n.length+1:(aL(b.domainRequiredForThresholdScale(r)),3)}}(u,r,l,e)):[a,s]}case hN:return[0,2*Math.PI];case"angle":return[0,360];case dN:return[0,new SG(()=>`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 bN:return"symbol";case mN:case gN:case vN: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)&&TR(i,"rangeMin")&&Object(ie.B)(s)&&2===s.length?B$([null!=o?o:s[0],null!=a?a:s[1]]):L$(s)}function GG(e){return function(e){return!Object(ie.J)(e)&&!!e.name}(e)?Object.assign({scheme:e.name},sM(e,["name"])):{scheme:e}}function YG(e,t,n){const r=LU(e.width)?e.width.step:$U(n,"width"),i=LU(e.height)?e.height.step:$U(n,"height");return t.x||t.y?new SG(()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`):Math.min(r,i)}function KG(e,t){iY(e)?function(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=e;for(const s of EM(n)){const u=a[s],l=n[s],c=e.getScaleComponent(s),f=hI(i[s]),d=u[t],h=c.get("type"),p=c.get("padding"),m=c.get("paddingInner"),g=TR(h,t),v=MR(s,t);if(void 0!==d&&(g?v&&aL(v):aL(b.scalePropertyNotWorkWithScaleType(h,t,s))),g&&void 0===v)if(void 0!==d){const e=f.timeUnit,n=f.type;switch(t){case"domainMax":case"domainMin":sL(u[t])||"temporal"===n||e?l.set(t,{signal:xI(u[t],{type:n,timeUnit:e})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const n=t in XG?XG[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:m,domain:u.domain,markDef:o,config:r}):r.scale[t];void 0!==n&&l.set(t,n,!1)}}}(e,t):QG(e,t)}const XG={bins:({model:e,fieldOrDatumDef:t})=>Wz(t)?function(e,t){const n=t.bin;if(jP(n)){const r=$V(e,t.field,n);return new SG(()=>e.getSignalName(r))}if(DP(n)&&FP(n)&&void 0!==n.step)return{step:n.step};return}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function(e,t){if(fM([mN,gN,vN],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=dI(n))||void 0===r?void 0:r.bin)||fM([eR,tR],e))return;return t in iP||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 iP){if(xR(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=i;if("bar"===t&&(!Wz(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===oR)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 iP){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:i}=r;return RM(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 iP&&n===aR){const{bandPaddingOuter:e}=o;return RM(e,CL(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 yR(e)&&"descending"===t?CL(r.xReverse)?{signal:"!"+r.xReverse.signal}:!r.xReverse:r.xReverse;if(yR(e)&&"descending"===t)return!0;return}(t,Wz(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&&yR(i)){if(Object(ie.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&&!wR(i))return!0;if((!Wz(t)||!t.bin)&&fM([...oP,...uP],e)){const{orient:t,type:n}=r;return!fM(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e)}return!1}(e,t,n,r,i)};function JG(e){iY(e)?function(e){const t=e.component.scales;for(const n of wP){const r=t[n];if(!r)continue;const i=VG(n,e);r.setWithExplicit("range",i)}}(e):QG(e,"range")}function QG(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?JG(n):KG(n,t);for(const r of EM(n)){let i;for(const n of e.children){const e=n.component.scales[r];if(e){i=I$(i,e.getWithExplicit(t),t,"scale",R$((e,n)=>{switch(t){case"range":return e.step&&n.step?e.step-n.step:0}return 0}))}}n[r].setWithExplicit(t,i)}}function ZG(e,t,n,r){const i=function(e,t,n){var r;switch(t.type){case"nominal":case"ordinal":if(CN(e)||"discrete"===AP(e))return"shape"===e&&"ordinal"===t.type&&aL(b.discreteChannelCannotEncode(e,"ordinal")),"ordinal";if(e in iP){if(fM(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&e in sP)return"band";return void 0!==t.band||Qz(t)&&(null===(r=t.axis)||void 0===r?void 0:r.tickBand)?"band":"point";case"temporal":return CN(e)?"time":"discrete"===AP(e)?(aL(b.discreteChannelCannotEncode(e,"temporal")),"ordinal"):Wz(t)&&t.timeUnit&&EL(t.timeUnit).utc?"utc":"time";case"quantitative":return CN(e)?Wz(t)&&jP(t.bin)?"bin-ordinal":"linear":"discrete"===AP(e)?(aL(b.discreteChannelCannotEncode(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(b.invalidFieldType(t.type))}(t,n,r),{type:o}=e;return OP(t)?void 0!==o?function(e,t){if(!OP(e))return!1;switch(e){case"x":case"y":case hN:case dN:return xR(t)||fM(["band","point"],t);case"size":case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case"angle":return xR(t)||wR(t)||fM(["band","point","ordinal"],t);case mN:case gN:case vN:return"band"!==t;case"strokeDash":return"ordinal"===t||wR(t);case bN:return"ordinal"===t}}(t,o)?Wz(n)&&(a=o,s=n.type,!(fM([HL,VL],s)?void 0===a||bR(a):s===qL?fM([eR,tR,void 0],a):s!==WL||fM([XL,JL,QL,ZL,nR,rR,iR,KL,void 0],a)))?(aL(b.scaleTypeNotWorkWithFieldDef(o,i)),i):o:(aL(b.scaleTypeNotWorkWithChannel(t,o,i)),i):i:null;var a,s}function eY(e){iY(e)?e.component.scales=function(e){const{encoding:t,mark:n}=e;return wP.reduce((r,i)=>{const o=hI(t[i]);if(o&&n===XR&&i===bN&&o.type===GL)return r;let a=o&&o.scale;if(o&&null!==a&&!1!==a){a=null!=a?a:{};const t=ZG(a,i,o,n);r[i]=new $G(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){eY(n);for(const o of EM(n.component.scales))if(i.scale[o]=null!==(t=i.scale[o])&&void 0!==t?t:pV(o,e),"shared"===i.scale[o]){const e=r[o],t=n.component.scales[o].getWithExplicit("type");e?uR(e.value,t.value)?r[o]=I$(e,t,"type","scale",tY):(i.scale[o]="independent",delete r[o]):r[o]=t}}for(const t of EM(r)){const i=e.scaleName(t,!0),o=r[t];n[t]=new $G(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 tY=R$((e,t)=>cR(e)-cR(t));var nY=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(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=PR(a),this.name=null!==(s=e.name)&&void 0!==s?s:r,this.title=_I(e.title)?{text:e.title}:e.title?this.initTitle(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new rY,this.projectionNameMap=n?n.projectionNameMap:new rY,this.signalNameMap=n?n.signalNameMap:new rY,this.data=e.data,this.description=e.description,this.transforms=(null!==(u=e.transform)&&void 0!==u?u:[]).map(e=>X$(e)?{filter:rM(e.filter,UL)}: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&&(Nz(e)&&!Tz(e.facet)||NU(e))&&(a.columns=u),PU(e)&&(a.columns=1);for(const t of zU)if(void 0!==e[t])if("spacing"===t){const n=e[t];a[t]=Object(ie.G)(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:Nz(e)||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new P$,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?oM(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}initTitle(e){const t=EM(e),n={text:SI(e.text)};for(const r of t)n[r]=SI(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}={}){eY(e),DG(e);for(const t of FR)KG(e,t);t||JG(e)}(this)}parseProjection(){zV(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){SV(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{style:t}=e,n=nY(e,["style"]),r={};for(const e of EM(n)){const t=n[e];void 0!==t&&(r[e]=DI(t))}return r}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=DI(this.description)),"unit"!==this.type&&"layer"!==this.type)?OM(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=nY(e,["spacing"]),{component:r,config:i}=this,o=function(e,t){const n={};for(const r of kN){const i=e[r];if(null==i?void 0:i.facetFieldDef){const{titleAnchor:e,titleOrient:o}=Kq(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=Gq(r,o),s=aV(e,a);void 0!==s&&(n[a]=s)}}return OM(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 kN)e[n].title&&t.push(Qq(this,n));for(const e of Xq)t=t.concat(tV(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:r=[]}=e;return[...n.map(e=>Nq(e,"grid",t)),...r.map(e=>Nq(e,"grid",t)),...n.map(e=>Nq(e,"main",t)),...r.map(e=>Nq(e,"main",t))].filter(e=>e)}(this.component.axes,this.config)}assembleLegends(){return NV(this)}assembleProjections(){return PV(this)}assembleTitle(){var e,t,n;const r=null!==(e=this.title)&&void 0!==e?e:{},{encoding:i}=r,o=nY(r,["encoding"]),a=Object.assign(Object.assign(Object.assign({},CI(this.config.title).nonMark),o),i?{encode:{update:i}}:{});if(a.text)return fM(["unit","layer"],this.type)?fM(["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",OM(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||oY(this.parent)?function e(t){return sY(t)||aY(t)?t.children.reduce((t,n)=>t.concat(e(n)),UG(t)):UG(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 AM((this.name?this.name+"_":"")+e)}getDataName(e){return this.getName(K$[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(oY(this.parent)){const t=lP(dV(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),r=n.get("range");if(bR(e)&&_L(r)){const e=n.get("name"),r=RG(zG(this,t));if(r){return{signal:fV(e,n,nI({aggregate:"distinct",field:r},{expr:"datum"}))}}return aL(b.unknownField(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):LN(e)&&OP(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(b.selectionNotFound(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 lY extends uY{vgField(e,t={}){const n=this.fieldDef(e);if(n)return nI(n,t)}reduceFieldDef(e,t){return function(e,t,n,r){return e?EM(e).reduce((n,i)=>{const o=e[i];return Object(ie.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=dI(n);return i?e(t,i,r):t},t)}forEachFieldDef(e,t){XI(this.getMapping(),(t,n)=>{const r=dI(t);r&&e(r,n)},t)}}var cY=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{const o=OP(i)&&t.getScaleComponent(i);if(o){yR(o.get("type"))&&"count"!==n.aggregate&&!JR(r)&&(e[n.field]=n)}return e},{});return EM(o).length?new dY(e,o):null}dependentFields(){return new Set(EM(this.filter))}producedFields(){return new Set}hash(){return"FilterInvalid "+lM(this.filter)}assemble(){const e=EM(this.filter).reduce((e,t)=>{const n=this.filter[t],r=nI(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 hY extends $W{constructor(e,t){super(e),this.transform=t,this.transform=oM(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 hY(this.parent,oM(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return"FlattenTransform "+lM(this.transform)}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class pY extends $W{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=oM(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 pY(null,oM(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return"FoldTransform "+lM(this.transform)}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class mY extends $W{constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}clone(){return new mY(null,oM(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=hI(t.encoding[e]);return Wz(n)?n.field:qz(n)?{expr:""+n.datum}:Xz(n)?{expr:""+n.value}:void 0});(i[0]||i[1])&&(e=new mY(e,i,null,t.getName("geojson_"+n++)))}if(t.channelHasField(bN)){const r=t.typedFieldDef(bN);r.type===GL&&(e=new mY(e,null,r.field,t.getName("geojson_"+n++)))}return e}dependentFields(){var e;const t=(null!==(e=this.fields)&&void 0!==e?e:[]).filter(ie.J);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${lM(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 gY extends $W{constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}clone(){return new gY(null,this.projection,oM(this.fields),oM(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=hI(t.encoding[e]);return Wz(n)?n.field:qz(n)?{expr:""+n.datum}:Xz(n)?{expr:""+n.value}:void 0}),i="longitude2"===n[0]?"2":"";(r[0]||r[1])&&(e=new gY(e,t.projectionName(),r,[t.getName("x"+i),t.getName("y"+i)]))}return e}dependentFields(){return new Set(this.fields.filter(ie.J))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${lM(this.fields)} ${lM(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class vY extends $W{constructor(e,t){super(e),this.transform=t}clone(){return new vY(null,oM(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 vY(e,t)}static makeFromEncoding(e,t){const n=t.encoding,r=n.x,i=n.y;if(Wz(r)&&Wz(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=JI(t.mark,n);return new vY(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 "+lM(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]}}var bY=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);ie)}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 "+lM(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 kY extends $W{constructor(e,t){super(e),this.transform=t}clone(){return new kY(null,oM(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return"SampleTransform "+lM(this.transform)}assemble(){return{type:"sample",size:this.transform.sample}}}function AY(e){let t=0;return function n(r,i){var o;if(r instanceof tG&&!r.isGenerator&&!$$(r.data)){e.push(i);i={name:null,source:i.name,transform:[]}}if(r instanceof JV&&(r.parent instanceof tG&&!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 GV){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 ZV||r instanceof eG||r instanceof dY||r instanceof Aq||r instanceof qq||r instanceof gY||r instanceof mY||r instanceof VV||r instanceof xY||r instanceof OG||r instanceof xG||r instanceof pY||r instanceof hY||r instanceof fY||r instanceof yY||r instanceof OY||r instanceof CY||r instanceof QV||r instanceof kY||r instanceof _Y)&&i.transform.push(r.assemble()),(r instanceof HV||r instanceof qW||r instanceof vY||r instanceof wG)&&i.transform.push(...r.assemble()),r instanceof WW)if(i.source&&0===i.transform.length)r.setSource(i.source);else if(r.parent instanceof WW)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 WW&&(!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 SY(e,t){var n;const{facet:r,config:i,child:o,component:a}=e;if(e.channelHasField(t)){const s=r[t],u=Yq("title",null,i,t);let l=uI(s,i,{allowDisabling:!0,includeDefault:void 0===u||!!u});o.component.layoutHeaders[t].title&&(l=Object(ie.B)(l)?l.join(", "):l,l+=" / "+o.component.layoutHeaders[t].title,o.component.layoutHeaders[t].title=null);const c=Yq("labelOrient",s,i,t),f=RM((null!==(n=s.header)&&void 0!==n?n:{}).labels,i.header.labels,!0),d=fM(["bottom","right"],c)?"footer":"header";a.layoutHeaders[t]={title:l,facetFieldDef:s,[d]:"facet"===t?[]:[jY(e,t,f)]}}}function jY(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 DY(e,t){var n;const{child:r}=e;if(r.component.axes[t]){const{layoutHeaders:o,resolve:a}=e.component;if(a.axis[t]=mV(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||CL(i)?"header":"footer";s[t]=null!==(n=s[t])&&void 0!==n?n:[jY(e,a,!1)];const r=Nq(o,"main",e.config,{header:!0});r&&s[t][0].axes.push(r),o.mainExtracted=!0}}}var i}function FY(e){TY(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";MY(e,t),MY(e,n)}function TY(e){for(const t of e.children)t.parseLayoutSize()}function MY(e,t){const n=dV(t),r=lP(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=I$(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 NY(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(bR(e)){const e=WU(r.view,t);return _L(n)||LU(e)?"step":e}return UU(r.view,t)}if(e.hasProjection||"arc"===e.mark)return UU(r.view,t);{const e=WU(r.view,t);return LU(e)?e.step:e}}var PY=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);i0?{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?Dz(n.sort)?[BY(n,n.sort,{expr:"datum"})]:Object(ie.B)(n.sort)?[Vq(n,e,{expr:"datum"})]:[nI(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(Dz(e)?e.order:!Object(ie.B)(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){var e;const{facet:t,config:n}=this;if(t.facet)return rV(t.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const i of Xq)if(t[i]){const o=Yq("labelOrient",null===(e=t[i])||void 0===e?void 0:e.header,n,i);if(fM(r[i],o))return rV(t[i],i,n)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=AY(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:kN.map(e=>this.facetSortFields(e)).flat(),order:kN.map(e=>this.facetSortOrder(e)).flat()}}),t.length>0?{data:t}:{}),n?{encode:{update:n}}:{}),e.assembleGroup(function(e,t){if(e.component.selection&&EM(e.component.selection).length){const n=Object(ie.bb)(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Aj("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return fH(t)}(this,[])))]}getMapping(){return this.facet}}function RY(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(W$(e)&&W$(t)){if(iM(e.values,t.values))return a}else if($$(e)&&$$(t)){if(e.url===t.url)return a}else if(H$(e)&&e.name===a.dataName)return a}return null}function zY(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 tG({values:[]});return t.push(e),e}const n=RY(e.data,t);if(n)return q$(e.data)||(n.data.format=pM({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new tG(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 U$,m=e.data;q$(m)?(V$(m)?f=new eG(f,m.sequence):Y$(m)&&(f=new ZV(f,m.graticule)),p.parseNothing=!0):null===(null===(t=null==m?void 0:m.format)||void 0===t?void 0:t.parse)&&(p.parseNothing=!0),f=null!==(n=JV.makeExplicit(f,e,p))&&void 0!==n?n:f,f=new QV(f);const g=e.parent&&sY(e.parent);(iY(e)||oY(e))&&g&&(f=null!==(r=HV.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(sW(a))s=e=new qq(e,a),u="derived";else if(X$(a)){const i=KV(a);s=e=null!==(r=JV.makeWithAncestors(e,{},i,n))&&void 0!==r?r:e,e=new Aq(e,t,a.filter)}else if(uW(a))s=e=HV.makeFromTransform(e,a,t),u="number";else if(cW(a)){u="date";void 0===n.getWithExplicit(a.field).value&&(e=new JV(e,{[a.field]:u}),n.set(a.field,u,!1)),s=e=qW.makeFromTransform(e,a)}else if(fW(a))s=e=VV.makeFromTransform(e,a),u="number",kH(t)&&(e=new QV(e));else if(J$(a))s=e=xY.make(e,t,a,o++),u="derived";else if(iW(a))s=e=new OG(e,a),u="number";else if(oW(a))s=e=new xG(e,a),u="number";else if(dW(a))s=e=wG.makeFromTransform(e,a),u="derived";else if(hW(a))s=e=new pY(e,a),u="derived";else if(aW(a))s=e=new hY(e,a),u="derived";else if(Q$(a))s=e=new _Y(e,a),u="derived";else if(rW(a))e=new kY(e,a);else if(lW(a))s=e=vY.makeFromTransform(e,a),u="derived";else if(Z$(a))s=e=new fY(e,a),u="derived";else if(eW(a))s=e=new OY(e,a),u="derived";else if(tW(a))s=e=new CY(e,a),u="derived";else{if(!nW(a)){aL(b.invalidTransformIgnored(a));continue}s=e=new yY(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 v=function(e){const t={};if(iY(e)&&e.component.selection)for(const n of EM(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=XV(e);f=null!==(i=JV.makeWithAncestors(f,{},Object.assign(Object.assign({},v),y),p))&&void 0!==i?i:f,iY(e)&&(f=mY.parseAll(f,e),f=gY.parseAll(f,e)),(iY(e)||oY(e))&&(g||(f=null!==(o=HV.makeFromEncoding(f,e))&&void 0!==o?o:f),f=null!==(a=qW.makeFromEncoding(f,e))&&void 0!==a?a:f,f=qq.parseAllForSortIndex(f,e));const x=e.getDataName(K$.Raw),w=new WW(f,x,K$.Raw,h);if(d[x]=w,f=w,iY(e)){const t=VV.makeFromEncoding(f,e);t&&(f=t,kH(e)&&(f=new QV(f))),f=null!==(s=vY.makeFromEncoding(f,e))&&void 0!==s?s:f,f=null!==(u=wG.makeFromEncoding(f,e))&&void 0!==u?u:f}iY(e)&&(f=null!==(l=dY.make(f,e))&&void 0!==l?l:f);const O=e.getDataName(K$.Main),E=new WW(f,O,K$.Main,h);d[O]=E,f=E,iY(e)&&function(e,t){CH(e,n=>{const r=n.name,i=e.getName("lookup_"+r);e.component.data.outputNodes[i]=n.materialized=new WW(new Aq(t,e,{selection:r}),i,K$.Lookup,e.component.data.outputNodeRefCounts)})}(e,E);let C=null;if(oY(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(Dz(i.sort)){const{field:n,op:r=kz}=i.sort;e=t=new xG(e,{joinaggregate:[{op:r,field:n,as:BY(i,i.sort,{forAs:!0})}],groupby:[nI(i)]})}return t}return null}(f,e.facet))&&void 0!==c?c:f,C=new GV(f,e,t,E.getSource()),d[t]=C}return Object.assign(Object.assign({},e.component.data),{outputNodes:d,outputNodeRefCounts:h,raw:w,main:E,facetRoot:C,ancestorParse:p})}class IY extends uY{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)||aL(b.CONCAT_CANNOT_SHARE_AXIS),this.children=this.getChildren(e).map((e,t)=>iK(e,this,this.getName("concat_"+t),void 0,r))}parseData(){this.component.data=zY(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 EM(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 PU(e)?e.vconcat:BU(e)?e.hconcat:e.concat}parseLayoutSize(){FY(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=uV(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 UY=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},XM),{labelExpr:1,encode:1}),$Y=EM(UY);class WY extends P${constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new WY(oM(this.explicit),oM(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 CL(this.explicit.orient)}}const HY={bottom:"top",top:"bottom",left:"right",right:"left"};function qY(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 UI(e,t);case"gridScale":return{explicit:e.explicit,value:RM(e.value,t.value)}}return z$(e,t,n,"axis")});e.setWithExplicit(n,r)}return e}function GY(e,t,n,r,i){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(CL(n.labelAngle)?n.labelAngle:HM(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===Hq(r,i))return!0}return e===n[t]}const YY=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function KY(e,t){var n,r,i;let o=t.axis(e);const a=new WY,s=hI(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=Lq(e,f,c,t.config),h=void 0!==o?!o:zq("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 CL(o)?o:HM(o);{const{configValue:o}=zq("labelAngle",r,null==t?void 0:t.style,i);return void 0!==o?HM(o):"x"!==n||!fM([VL,HL],e.type)||Wz(e)&&e.timeUnit?void 0:270}}(s,o,e,l.style,d),m={fieldOrDatumDef:s,axis:o,channel:e,model:t,scaleType:f,orient:c,labelAngle:p,mark:u,config:l};for(const n of $Y){const r=n in Iq?Iq[n](m):QM(n)?o[n]:void 0,i=void 0!==r,s=GY(r,n,o,t,e);if(i&&s)a.set(n,r,s);else{const{configValue:e,configFrom:t}=QM(n)&&"values"!==n?zq(n,l.style,o.style,d):{},u=void 0!==e;i&&!u?a.set(n,r,s):("vgAxisConfig"!==t||YY.has(n)&&u||GM(e)||CL(e))&&a.set(n,e,!1)}}const g=null!==(i=o.encoding)&&void 0!==i?i:{},v=YM.reduce((n,r)=>{var i;if(!a.hasAxisPart(r))return n;const o=hV(null!==(i=g[r])&&void 0!==i?i:{},t),s="labels"===r?function(e,t,n){var r;const{encoding:i,config:o}=e,a=null!==(r=hI(i[t]))&&void 0!==r?r:hI(i[$N(t)]),s=e.axis(t)||{},{format:u,formatType:l}=s;return mz(l)?Object.assign({text:yz({fieldOrDatumDef:a,field:"datum.value",format:u,formatType:l,config:o})},n):n}(t,e,o):o;return void 0===s||OM(s)||(n[r]={update:s}),n},{});return OM(v)||a.set("encode",v,!!o.encoding||void 0!==o.labelAngle),a}function XY(e,t,n){const r=PR(e),i=NI("orient",r,n);if(r.orient=function(e,t,n){switch(e){case $R:case YR:case KR:case qR:case WR:case IR:return}const{x:r,y:i,x2:o,y2:a}=t;switch(e){case zR:if(Wz(r)&&(DP(r.bin)||Wz(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Wz(i)&&(DP(i.bin)||Wz(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o&&(Wz(r)&&r.type===WL&&!jP(r.bin)||Gz(r)))return"horizontal";if(!a&&(Wz(i)&&i.type===WL&&!jP(i.bin)||Gz(i)))return"vertical"}case HR:if(o&&(!Wz(r)||!DP(r.bin))&&a&&(!Wz(i)||!DP(i.bin)))return;case RR:if(a)return Wz(i)&&DP(i.bin)?"horizontal":"vertical";if(o)return Wz(r)&&DP(r.bin)?"vertical":"horizontal";if(e===HR){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case UR:case VR:{const t=Vz(r),o=Vz(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===qL,s=o.type===qL;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&&aL(b.orientOverridden(r.orient,i)),"bar"===r.type&&r.orient){const e=NI("cornerRadiusEnd",r,n);if(void 0!==e){const n="horizontal"===r.orient&&t.x2||"vertical"===r.orient&&t.y2?["cornerRadius"]:iz[r.orient];for(const t of n)r[t]=e;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}void 0===NI("opacity",r,n)&&(r.opacity=function(e,t){if(fM([$R,VR,YR,KR],e)&&!VI(t))return.7;return}(r.type,t));return void 0===NI("cursor",r,n)&&(r.cursor=function(e,t,n){if(t.href||e.href||NI("href",e,n))return"pointer";return e.cursor}(r,t,n)),r}function JY(e,t){const{config:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},LW(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),CW("x",e,{defaultPos:"mid"})),CW("y",e,{defaultPos:"mid"})),wW("size",e)),wW("angle",e)),function(e,t,n){if(n)return{shape:{value:n}};return wW("shape",e)}(e,0,t))}function QY(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=NI("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&&_L(e)&&Object(ie.G)(e.step))return 3*e.step/4;return 3*$U(n.view,o)/4}}const ZY={arc:{vgMark:"arc",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},LW(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),CW("x",e,{defaultPos:"mid"})),CW("y",e,{defaultPos:"mid"})),TW(e,"radius","arc")),TW(e,"theta","arc"))},area:{vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},LW(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),jW("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient})),jW("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient})),zW(e))},bar:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},LW(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),TW(e,"x","bar")),TW(e,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:e=>JY(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>Object.assign({},LW(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&&Wz(n)&&n.type===GL?{field:nI(n,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},LW(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),TW(e,"x","image")),TW(e,"y","image")),mW(e,"url"))},line:{vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},LW(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),CW("x",e,{defaultPos:"mid"})),CW("y",e,{defaultPos:"mid"})),wW("size",e,{vgChannel:"strokeWidth"})),zW(e))},point:{vgMark:"symbol",encodeEntry:e=>JY(e)},rect:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},LW(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),TW(e,"x","rect")),TW(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({},LW(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),jW("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n})),jW("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n})),wW("size",e,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:e=>JY(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({},LW(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),CW("x",e,{defaultPos:"mid"})),CW("y",e,{defaultPos:"mid"})),mW(e)),wW("size",e,{vgChannel:"fontSize"})),wW("angle",e)),IW("align",function(e,t,n){if(void 0===NI("align",e,n))return"center";return}(e.markDef,0,t))),IW("baseline",function(e,t,n){if(void 0===NI("baseline",e,n))return"middle";return}(e.markDef,0,t))),CW("radius",e,{defaultPos:null,isMidPoint:!0})),CW("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({},LW(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),CW("x",e,{defaultPos:"mid",vgChannel:"xc"})),CW("y",e,{defaultPos:"mid",vgChannel:"yc"})),wW("size",e,{defaultValue:QY(e),vgChannel:i})),{[o]:DI(NI("thickness",n,t))})}},trail:{vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},LW(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),CW("x",e,{defaultPos:"mid"})),CW("y",e,{defaultPos:"mid"})),wW("size",e)),zW(e))}};function eK(e){if(fM([UR,RR,GR],e.mark)){const t=JI(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(K$.Main),data:e.requestDataName(K$.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:tK(e,{fromPrefix:"faceted_path_"})}]}(e,t)}else if(fM([zR],e.mark)){const t=jL.some(t=>NI(t,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=tK(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({},aM(t.encode.update,["y","yc","y2","height",...jL])),{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({},sM(t.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(o=Object.assign(Object.assign({},aM(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({},sM(t.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const n of jL){const r=PI(n,e.markDef,e.config);t.encode.update[n]?(o[n]=t.encode.update[n],delete t.encode.update[n]):r&&(o[n]=DI(r)),r&&(t.encode.update[n]={value:0})}const s=e.fieldDef(e.stack.groupbyChannel),u=nI(s)?[nI(s)]:[];((null==s?void 0:s.bin)||(null==s?void 0:s.timeUnit))&&u.push(nI(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=PI(r,e.markDef,e.config);return void 0!==t?Object.assign(Object.assign({},n),{[r]:DI(t)}):n}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0});return[{type:"group",from:{facet:{data:e.requestDataName(K$.Main),name:"stack_group_"+e.requestDataName(K$.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 tK(e)}function tK(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,a=RM(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=MI(r),u=i.key,l=function(e){const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,a=t.order;if(!(!Object(ie.B)(a)&&Xz(a)&&cM(a.value)||!a&&cM(NI("order",i,o)))){if((Object(ie.B)(a)||Wz(a))&&!n)return RI(a,{expr:"datum"});if(JR(r)){const n="horizontal"===i.orient?"y":"x",r=t[n];if(Wz(r)){const t=r.sort;if(Object(ie.B)(t))return{field:nI(r,{prefix:n,suffix:"sort_index",expr:"datum"})};if(Dz(t))return{field:nI({aggregate:VI(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})};if(jz(t)){return{field:nI(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}}return null===t?void 0:{field:nI(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=EM(e.component.selection).length;let n=t,r=e.parent;for(;r&&0===n;)n=EM(r.component.selection).length,r=r.parent;return n?{interactive:t>0||!!e.encoding.tooltip}:null}(e),f=NI("aria",r,o),d=ZY[n].postEncodingTransform?ZY[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:ZY[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(K$.Main)},encode:{update:ZY[n].encodeEntry(e)}}),d?{transform:d}:{})]}class nK extends lY{constructor(e,t,n,r={},i){super(e,"unit",t,n,i,void 0,RU(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[];const o=ez(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=PI("filled",e,t),i=e.type;return RM(r,i!==$R&&i!==UR&&i!==HR)}(o,i,{graticule:e.data&&Y$(e.data)}));const s=this.encoding=YI(e.encoding||{},a,o.filled,i);this.markDef=XY(o,s,i),this.size=function({encoding:e,size:t}){for(const n of oP){const r=WN(n);LU(t[r])&&Vz(e[n])&&(delete t[r],aL(b.stepDropped(r)))}return t}({encoding:s,size:RU(e)?Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{}):r}),this.stack=l$(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===XR,n=e&&ON.some(t=>Yz(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 wP.reduce((e,n)=>{var r;const i=hI(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=PR(e);return Object(ie.B)(t)&&(r.domain=t.map(SI)),Object(ie.B)(n)&&(r.range=n.map(SI)),r}initAxes(e){return oP.reduce((t,n)=>{const r=e[n];if(Yz(r)||"x"===n&&Yz(e.x2)||"y"===n&&Yz(e.y2)){const e=Yz(r)?r.axis:void 0;t[n]=e?this.initAxis(Object.assign({},e)):e}return t},{})}initAxis(e){const t=EM(e),n={};for(const r of t){const t=e[r];n[r]=GM(t)?AI(t):SI(t)}return n}initLegends(e){return yP.reduce((t,n)=>{const r=hI(e[n]);if(r&&function(e){switch(e){case mN:case gN:case vN:case"size":case bN:case"opacity":case"strokeWidth":case"strokeDash":return!0;case"fillOpacity":case"strokeOpacity":case"angle":return!1}}(n)){const e=r.legend;t[n]=e?PR(e):e}return t},{})}parseData(){this.component.data=zY(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const r of oP){const i=WN(r);if(t[i]){const e=t[i];n.layoutSize.set(i,LU(e)?"step":e,!0)}else{const t=NY(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 EM(null!=t?t:{})){const a=oM(t[o]),s=i[a.type],{fields:u,encodings:l}=s,c=Sq(s,["fields","encodings"]);for(const e in c)"encodings"===e&&a.fields||"fields"===e&&a.encodings||("mark"===e&&(a[e]=Object.assign(Object.assign({},c[e]),a[e])),void 0!==a[e]&&!0!==a[e]||(a[e]=null!==(n=c[e])&&void 0!==n?n:a[e]));const f=AM(o),d=r[f]=Object.assign(Object.assign({},a),{name:f,events:Object(ie.J)(a.on)?Aj(a.on,"scope"):oM(a.on)});sH(d,n=>{n.has(d)&&n.parse&&n.parse(e,d,a,t[o])})}return r}(this,this.selection)}parseMarkGroup(){this.component.mark=eK(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,oP.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[KY(n,e)]),t),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;if(CH(e,(r,i)=>{const o=r.name,a=Object(ie.bb)(o+yH);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:`${OH}(${a}, ${Object(ie.bb)(e)}${n}`})}n=!0,i.topLevelSignals&&(t=i.topLevelSignals(e,r,t)),sH(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 fH(t)}(this,e)}assembleSignals(){return[...Pq(this),...(e=this,t=[],CH(e,(n,r)=>{const i=n.name;let o=r.modifyExpr(e,n);t.push(...r.signals(e,n)),sH(n,r=>{r.signals&&(t=r.signals(e,n,t)),r.modifyExpr&&(o=r.modifyExpr(e,n,o))}),t.push({name:i+wH,on:[{events:{signal:n.name+xH},update:`modify(${Object(ie.bb)(n.name+yH)}, ${o})`}]})}),fH(t))];var e,t}assembleSelectionData(e){return function(e,t){const n=[...t];return CH(e,t=>{const r={name:t.name+yH};if(t.init){const n=t.project.items.map(e=>{const{signals:t}=e;return uH(e,["signals"])}),i=t.init.map(e=>lH(e,!1));r.values="interval"===t.type?[{unit:_H(e,{escape:!1}),fields:n,values:i}]:i.map(t=>({unit:_H(e,{escape:!1}),fields:n,values:t}))}n.filter(e=>e.name===t.name+yH).length||n.push(r)}),n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return uV(this)}assembleMarks(){var e;let t=null!==(e=this.component.mark)&&void 0!==e?e:[];return this.parent&&sY(this.parent)||(t=cH(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return qI(this.encoding,e)}fieldDef(e){return dI(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return Kz(t)?t:null}}class rK extends uY{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 rK(e,this,this.getName("layer_"+t),o,i);if($I(e))return new nK(e,this,this.getName("layer_"+t),o,i);throw new Error(b.invalidSpec(e))})}parseData(){this.component.data=zY(this);for(const e of this.children)e.parseData()}parseLayoutSize(){var e;TY(e=this),MY(e,"width"),MY(e,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of EM(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 EM(t.component.axes))r.axis[i]=mV(e.component.resolve,i),"shared"===r.axis[i]&&(n[i]=qY(n[i],t.component.axes[i]),n[i]||(r.axis[i]="independent",delete n[i]))}for(const o of oP){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(!CL(t)){if(i[t]>0&&!n){const n=HY[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()),Pq(this))}assembleLayoutSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleLayoutSignals()),uV(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)iY(n)&&(t=cH(n,t));return t}(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,t)=>e.concat(t.assembleLegends()),NV(this))}}function iK(e,t,n,r,i){if(Nz(e))return new LY(e,t,n,i);if(r$(e))return new rK(e,t,n,r,i);if($I(e))return new nK(e,t,n,r,i);if(function(e){return PU(e)||BU(e)||NU(e)}(e))return new IY(e,t,n,i);throw new Error(b.invalidSpec(e))}var oK=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"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1));const{params:f}=t,d=oK(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([]),...DU(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(ie.J)(t)&&(t={type:t});if(i&&o&&(a=t.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)aL(b.droppingFit()),t.type="pad";else if("step"===i||"step"===o){const e="step"===i?"width":"height";aL(b.droppingFit(lP(e)));const n="width"===e?"height":"width";t.type=function(e){return e?"fit-"+lP(e):"fit"}(n)}var a;return Object.assign(Object.assign(Object.assign({},1===EM(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t}),N$(n,!1)),N$(e,!0))}(e,r.autosize,n,i),e.datasets,e.usermeta),normalized:r}}finally{t.logger&&oL(),t.fieldTitle&&sI(oI)}}var sK=n(55),uK=n.n(sK),lK=n(71);var cK={background:"#333",title:{color:"#fff"},style:{"guide-label":{fill:"#fff"},"guide-title":{fill:"#fff"}},axis:{domainColor:"#fff",gridColor:"#888",tickColor:"#fff"}};var fK={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"]}};var dK={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"},style:{bar:{binSpacing:2,fill:"#30a2da",stroke:null}},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}};var hK={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"]}};const pK="Benton Gothic Bold, sans-serif",mK={"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"]};var gK={background:"#ffffff",title:{anchor:"start",color:"#000000",font:pK,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:pK,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:pK,titleFontSize:13,titleFontWeight:"normal"},range:{category:mK["category-6"],diverging:mK["fireandice-6"],heatmap:mK["fire-7"],ordinal:mK["fire-7"],ramp:mK["fire-7"]}};var vK={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"]}};var bK={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"]}};const yK={"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"]};var xK={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:yK["six-groups-cat-1"],diverging:yK["diverging-colors"],heatmap:yK["diverging-colors"],ordinal:yK["six-groups-seq"],ramp:yK["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}};const wK=lK.version;var OK=n(72),EK="#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 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 CK="vg-tooltip-element",_K={offsetX:10,offsetY:10,id:CK,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&").replace(/e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}(t))}class SK{constructor(e){this.options=Object.assign(Object.assign({},_K),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 EK.toString().replace(CK,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=function(e,t,n){if(Object(ie.B)(e))return`[${e.map(e=>t(Object(ie.J)(e)?e:AK(e,n))).join(", ")}]`;if(Object(ie.H)(e)){let r="";const i=e,{title:o}=i,a=kK(i,["title"]);o&&(r+=`

${t(o)}

`);const s=Object.keys(a);if(s.length>0){r+="";for(const e of s){let i=a[e];void 0!==i&&(Object(ie.H)(i)&&(i=AK(i,n)),r+=``)}r+="
${t(e)}:${t(i)}
"}return r||"{}"}return t(e)}(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`)}}OK.version;var jK='.vega-embed {\n position: relative;\n display: inline-block; }\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 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 .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\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 DK(e,...t){for(const n of t)FK(e,n);return e}function FK(e,t){for(const n of Object.keys(t))Object(ie.lb)(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 TK=v;let MK=y;const NK=window;void 0===MK&&NK.vl&&NK.vl.compile&&(MK=NK.vl);const PK={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},BK={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"},LK={vega:"Vega","vega-lite":"Vega-Lite"},RK={vega:TK.version,"vega-lite":MK?MK.version:"not available"},zK={vega:e=>e,"vega-lite":(e,t)=>MK.compile(e,{config:t}).spec};function IK(e,t,n,r){const i=`${t}
`,o=`
${n}`,a=window.open("");a.document.write(i+e+o),a.document.title=LK[r]+" JSON Source"}function UK(e,t,n={}){var r,i,o;return _(this,void 0,void 0,(function*(){const a=(s=n.loader)&&"load"in s?n.loader:TK.loader(n.loader);var s;const u=Object(ie.J)(t)?JSON.parse(yield a.load(t)):t,l=yield $K((r=u.usermeta&&u.usermeta.embedOptions,null!=r?r:{}),a),c=yield $K(n,a),f=Object.assign(Object.assign({},DK(c,l)),{config:Object(ie.P)((i=c.config,null!=i?i:{}),(o=l.config,null!=o?o:{}))});return yield function(e,t,n={},r){var i,o,a,s,u,l;return _(this,void 0,void 0,(function*(){const c=n.theme?Object(ie.P)(x[n.theme],null!=(i=n.config)?i:{}):n.config,f=Object(ie.C)(n.actions)?n.actions:DK({},PK,null!=(o=n.actions)?o:{}),d=Object.assign(Object.assign({},BK),n.i18n),h=null!=(a=n.renderer)?a:"canvas",p=null!=(s=n.logLevel)?s:TK.Warn,m=null!=(u=n.downloadFileName)?u:"visualization";if(!1!==n.defaultStyle){const e="vega-embed-style";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?jK.toString():n.defaultStyle,document.head.appendChild(t)}}const g=function(e,t){var n;if(e.$schema){const r=uK()(e.$schema);t&&t!==r.library&&console.warn(`The given visualization spec is written in ${LK[r.library]}, but mode argument sets ${n=LK[t],null!=n?n:t}.`);const i=r.library;return Object(re.satisfies)(RK[i],"^"+r.version.slice(1))||console.warn(`The input spec uses ${LK[i]} ${r.version}, but the current version of ${LK[i]} is v${RK[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 v=zK[g](t,c);if("vega-lite"===g&&v.$schema){const e=uK()(v.$schema);Object(re.satisfies)(RK.vega,"^"+e.version.slice(1))||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${RK.vega}.`)}const b="string"==typeof e?document.querySelector(e):e;if(!b)throw Error("${el} does not exist");b.classList.add("vega-embed"),f&&b.classList.add("has-actions"),b.innerHTML="";const y=n.patch;y&&(v=y instanceof Function?y(v):$(v,y,!0,!1).newDocument),n.formatLocale&&TK.formatLocale(n.formatLocale),n.timeFormatLocale&&TK.timeFormatLocale(n.timeFormatLocale);const w=TK.parse(v,"vega-lite"===g?{}:c),O=new TK.View(w,{loader:r,logLevel:p,renderer:h});if(!1!==n.tooltip){let e;e="function"==typeof n.tooltip?n.tooltip:new SK(!0===n.tooltip?{}:n.tooltip).call,O.tooltip(e)}let E,{hover:C}=n;if(void 0===C&&(C="vega"===g),C){const{hoverSet:e,updateSet:t}="boolean"==typeof C?{}:C;O.hover(e,t)}if(n&&(n.width&&O.width(n.width),n.height&&O.height(n.height),n.padding&&O.padding(n.padding)),yield O.initialize(e).runAsync(),!1!==f){let e=b;if(!1!==n.defaultStyle){const t=document.createElement("details");t.title=d.CLICK_TO_VIEW_ACTIONS,b.append(t),e=t;const n=document.createElement("summary");n.innerHTML='\n\n \n \n \n',t.append(n),E=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",E)}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=`${m}.${e}`,i.addEventListener("mousedown",(function(t){O.toImageURL(e,n.scaleFactor).then(e=>{this.href=e}).catch(e=>{throw e}),t.preventDefault()})),r.append(i)}if(!0===f||!1!==f.source){const e=document.createElement("a");e.text=d.SOURCE_ACTION,e.href="#",e.addEventListener("mousedown",(function(e){var r,i;IK(ne()(t),null!=(r=n.sourceHeader)?r:"",null!=(i=n.sourceFooter)?i:"",g),e.preventDefault()})),r.append(e)}if("vega-lite"===g&&(!0===f||!1!==f.compiled)){const e=document.createElement("a");e.text=d.COMPILED_ACTION,e.href="#",e.addEventListener("mousedown",(function(e){var t,r;IK(ne()(v),null!=(t=n.sourceHeader)?t:"",null!=(r=n.sourceFooter)?r:"","vega"),e.preventDefault()})),r.append(e)}if(!0===f||!1!==f.editor){const e=null!=(l=n.editorUrl)?l:"https://vega.github.io/editor/",i=document.createElement("a");i.text=d.EDITOR_ACTION,i.href="#",i.addEventListener("mousedown",(function(n){!function(e,t,n){const r=e.open(t);let i=40;e.addEventListener("message",(function t(n){n.source===r&&(i=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){i<=0||(r.postMessage(n,"*"),setTimeout(e,250),i-=1)}),250)}(window,e,{config:c,mode:g,renderer:h,spec:ne()(t)}),n.preventDefault()})),r.append(i)}}return{view:O,spec:t,vgSpec:v,finalize:function(){E&&document.removeEventListener("click",E),O.finalize()}}}))}(e,u,f,a)}))}function $K(e,t){var n;return _(this,void 0,void 0,(function*(){const r=Object(ie.J)(e.config)?JSON.parse(yield t.load(e.config)):null!=(n=e.config)?n:{},i=Object(ie.J)(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 WK={};function HK(e,t){void 0===e&&(e=WK),void 0===t&&(t=WK);var n=Object.keys(e),r=Object.keys(t);return e===t||n.length===r.length&&n.every((function(n){return e[n]===t[n]}))}var qK=function(){};function VK(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GK(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var YK=function(e){function t(){for(var t,n=arguments.length,r=Array(n),i=0;i>",e)}})),0)?=?)",l("XRANGEIDENTIFIERLOOSE"),a[s.XRANGEIDENTIFIERLOOSE]=a[s.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",l("XRANGEIDENTIFIER"),a[s.XRANGEIDENTIFIER]=a[s.NUMERICIDENTIFIER]+"|x|X|\\*",l("XRANGEPLAIN"),a[s.XRANGEPLAIN]="[v=\\s]*("+a[s.XRANGEIDENTIFIER]+")(?:\\.("+a[s.XRANGEIDENTIFIER]+")(?:\\.("+a[s.XRANGEIDENTIFIER]+")(?:"+a[s.PRERELEASE]+")?"+a[s.BUILD]+"?)?)?",l("XRANGEPLAINLOOSE"),a[s.XRANGEPLAINLOOSE]="[v=\\s]*("+a[s.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[s.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[s.XRANGEIDENTIFIERLOOSE]+")(?:"+a[s.PRERELEASELOOSE]+")?"+a[s.BUILD]+"?)?)?",l("XRANGE"),a[s.XRANGE]="^"+a[s.GTLT]+"\\s*"+a[s.XRANGEPLAIN]+"$",l("XRANGELOOSE"),a[s.XRANGELOOSE]="^"+a[s.GTLT]+"\\s*"+a[s.XRANGEPLAINLOOSE]+"$",l("COERCE"),a[s.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",l("COERCERTL"),o[s.COERCERTL]=new RegExp(a[s.COERCE],"g"),l("LONETILDE"),a[s.LONETILDE]="(?:~>?)",l("TILDETRIM"),a[s.TILDETRIM]="(\\s*)"+a[s.LONETILDE]+"\\s+",o[s.TILDETRIM]=new RegExp(a[s.TILDETRIM],"g");l("TILDE"),a[s.TILDE]="^"+a[s.LONETILDE]+a[s.XRANGEPLAIN]+"$",l("TILDELOOSE"),a[s.TILDELOOSE]="^"+a[s.LONETILDE]+a[s.XRANGEPLAINLOOSE]+"$",l("LONECARET"),a[s.LONECARET]="(?:\\^)",l("CARETTRIM"),a[s.CARETTRIM]="(\\s*)"+a[s.LONECARET]+"\\s+",o[s.CARETTRIM]=new RegExp(a[s.CARETTRIM],"g");l("CARET"),a[s.CARET]="^"+a[s.LONECARET]+a[s.XRANGEPLAIN]+"$",l("CARETLOOSE"),a[s.CARETLOOSE]="^"+a[s.LONECARET]+a[s.XRANGEPLAINLOOSE]+"$",l("COMPARATORLOOSE"),a[s.COMPARATORLOOSE]="^"+a[s.GTLT]+"\\s*("+a[s.LOOSEPLAIN]+")$|^$",l("COMPARATOR"),a[s.COMPARATOR]="^"+a[s.GTLT]+"\\s*("+a[s.FULLPLAIN]+")$|^$",l("COMPARATORTRIM"),a[s.COMPARATORTRIM]="(\\s*)"+a[s.GTLT]+"\\s*("+a[s.LOOSEPLAIN]+"|"+a[s.XRANGEPLAIN]+")",o[s.COMPARATORTRIM]=new RegExp(a[s.COMPARATORTRIM],"g");l("HYPHENRANGE"),a[s.HYPHENRANGE]="^\\s*("+a[s.XRANGEPLAIN]+")\\s+-\\s+("+a[s.XRANGEPLAIN]+")\\s*$",l("HYPHENRANGELOOSE"),a[s.HYPHENRANGELOOSE]="^\\s*("+a[s.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[s.XRANGEPLAINLOOSE]+")\\s*$",l("STAR"),a[s.STAR]="(<|>)?=?\\s*\\*";for(var c=0;c256)return null;if(!(t.loose?o[s.LOOSE]:o[s.FULL]).test(e))return null;try{return new d(e,t)}catch(e){return null}}function d(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof d){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof d))return new d(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var n=e.trim().match(t.loose?o[s.LOOSE]:o[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>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&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},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new d(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(b(e,t))return null;var n=f(e),r=f(t),i="";if(n.prerelease.length||r.prerelease.length){i="pre";var o="prerelease"}for(var a in n)if(("major"===a||"minor"===a||"patch"===a)&&n[a]!==r[a])return i+a;return o},t.compareIdentifiers=p;var h=/^[0-9]+$/;function p(e,t){var n=h.test(e),r=h.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function v(e,t,n){return m(e,t,n)<0}function b(e,t,n){return 0===m(e,t,n)}function y(e,t,n){return 0!==m(e,t,n)}function x(e,t,n){return m(e,t,n)>=0}function w(e,t,n){return m(e,t,n)<=0}function O(e,t,n,r){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 b(e,n,r);case"!=":return y(e,n,r);case">":return g(e,n,r);case">=":return x(e,n,r);case"<":return v(e,n,r);case"<=":return w(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function E(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof E){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof E))return new E(e,t);r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===C?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return p(t,e)},t.major=function(e,t){return new d(e,t).major},t.minor=function(e,t){return new d(e,t).minor},t.patch=function(e,t){return new d(e,t).patch},t.compare=m,t.compareLoose=function(e,t){return m(e,t,!0)},t.compareBuild=function(e,t,n){var r=new d(e,n),i=new d(t,n);return r.compare(i)||r.compareBuild(i)},t.rcompare=function(e,t,n){return m(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compareBuild(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.compareBuild(r,e,n)}))},t.gt=g,t.lt=v,t.eq=b,t.neq=y,t.gte=x,t.lte=w,t.cmp=O,t.Comparator=E;var C={};function _(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof _)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new _(e.raw,t);if(e instanceof E)return new _(e.value,t);if(!(this instanceof _))return new _(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function k(e,t){for(var n=!0,r=e.slice(),i=r.pop();n&&r.length;)n=r.every((function(e){return i.intersects(e,t)})),i=r.pop();return n}function A(e){return!e||"x"===e.toLowerCase()||"*"===e}function S(e,t,n,r,i,o,a,s,u,l,c,f,d){return((t=A(n)?"":A(r)?">="+n+".0.0":A(i)?">="+n+"."+r+".0":">="+t)+" "+(s=A(u)?"":A(l)?"<"+(+u+1)+".0.0":A(c)?"<"+u+"."+(+l+1)+".0":f?"<="+u+"."+l+"."+c+"-"+f:"<="+s)).trim()}function j(e,t,n){for(var i=0;i0){var o=e[i].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}function D(e,t,n){try{t=new _(t,n)}catch(e){return!1}return t.test(e)}function F(e,t,n,r){var i,o,a,s,u;switch(e=new d(e,r),t=new _(t,r),n){case">":i=g,o=w,a=v,s=">",u=">=";break;case"<":i=v,o=x,a=g,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(D(e,t,r))return!1;for(var l=0;l=0.0.0")),f=f||e,h=h||e,i(e.semver,f.semver,r)?f=e:a(e.semver,h.semver,r)&&(h=e)})),f.operator===s||f.operator===u)return!1;if((!h.operator||h.operator===s)&&o(e,h.semver))return!1;if(h.operator===u&&a(e,h.semver))return!1}return!0}E.prototype.parse=function(e){var t=this.options.loose?o[s.COMPARATORLOOSE]:o[s.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 d(n[2],this.options.loose):this.semver=C},E.prototype.toString=function(){return this.value},E.prototype.test=function(e){if(r("Comparator.test",e,this.options.loose),this.semver===C||e===C)return!0;if("string"==typeof e)try{e=new d(e,this.options)}catch(e){return!1}return O(e,this.operator,this.semver,this.options)},E.prototype.intersects=function(e,t){if(!(e instanceof E))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(n=new _(e.value,t),D(this.value,n,t));if(""===e.operator)return""===e.value||(n=new _(this.value,t),D(e.semver,n,t));var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=O(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=O(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||o&&a||s||u},t.Range=_,_.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},_.prototype.toString=function(){return this.range},_.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var n=t?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];e=e.replace(n,S),r("hyphen replace",e),e=e.replace(o[s.COMPARATORTRIM],"$1$2$3"),r("comparator trim",e,o[s.COMPARATORTRIM]),e=(e=(e=e.replace(o[s.TILDETRIM],"$1~")).replace(o[s.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=t?o[s.COMPARATORLOOSE]:o[s.COMPARATOR],a=e.split(" ").map((function(e){return function(e,t){return r("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){r("caret",e,t);var n=t.loose?o[s.CARETLOOSE]:o[s.CARET];return e.replace(n,(function(t,n,i,o,a){var s;return r("caret",e,t,n,i,o,a),A(n)?s="":A(i)?s=">="+n+".0.0 <"+(+n+1)+".0.0":A(o)?s="0"===n?">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":">="+n+"."+i+".0 <"+(+n+1)+".0.0":a?(r("replaceCaret pr",a),s="0"===n?"0"===i?">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+"-"+a+" <"+(+n+1)+".0.0"):(r("no pr"),s="0"===n?"0"===i?">="+n+"."+i+"."+o+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+" <"+(+n+1)+".0.0"),r("caret return",s),s}))}(e,t)})).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var n=t.loose?o[s.TILDELOOSE]:o[s.TILDE];return e.replace(n,(function(t,n,i,o,a){var s;return r("tilde",e,t,n,i,o,a),A(n)?s="":A(i)?s=">="+n+".0.0 <"+(+n+1)+".0.0":A(o)?s=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":a?(r("replaceTilde pr",a),s=">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+(+i+1)+".0"):s=">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0",r("tilde return",s),s}))}(e,t)})).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var n=t.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return e.replace(n,(function(n,i,o,a,s,u){r("xRange",e,n,i,o,a,s,u);var l=A(o),c=l||A(a),f=c||A(s),d=f;return"="===i&&d&&(i=""),u=t.includePrerelease?"-0":"",l?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&d?(c&&(a=0),s=0,">"===i?(i=">=",c?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===i&&(i="<",c?o=+o+1:a=+a+1),n=i+o+"."+a+"."+s+u):c?n=">="+o+".0.0"+u+" <"+(+o+1)+".0.0"+u:f&&(n=">="+o+"."+a+".0"+u+" <"+o+"."+(+a+1)+".0"+u),r("xRange return",n),n}))}(e,t)})).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(o[s.STAR],"")}(e,t),r("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(a=a.filter((function(e){return!!e.match(i)}))),a=a.map((function(e){return new E(e,this.options)}),this)},_.prototype.intersects=function(e,t){if(!(e instanceof _))throw new TypeError("a Range is required");return this.set.some((function(n){return k(n,t)&&e.set.some((function(e){return k(e,t)&&n.every((function(n){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new _(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},_.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new d(e,this.options)}catch(e){return!1}for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!g(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(n&&e.test(n))return n;return null},t.validRange=function(e,t){try{return new _(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return F(e,t,"<",n)},t.gtr=function(e,t,n){return F(e,t,">",n)},t.outside=F,t.prerelease=function(e,t){var n=f(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new _(e,n),t=new _(t,n),e.intersects(t)},t.coerce=function(e,t){if(e instanceof d)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var n=null;if((t=t||{}).rtl){for(var r;(r=o[s.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),o[s.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;o[s.COERCERTL].lastIndex=-1}else n=e.match(o[s.COERCE]);if(null===n)return null;return f(n[2]+"."+(n[3]||"0")+"."+(n[4]||"0"),t)}}).call(this,n(98))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t[0],version:t[1]}}},,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MODULE_NAME=t.MODULE_VERSION=void 0;const r=n(85);t.MODULE_VERSION=r.version,t.MODULE_NAME=r.name},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(a=r,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(u," */")),o=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot).concat(e," */")}));return[n].concat(o).concat([i]).join("\n")}var a,s,u;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r=0;r @@ -48,26 +60,14 @@ object-assign * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(){var o="Expected a function",a="__lodash_placeholder__",u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],s="[object Arguments]",l="[object Array]",c="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",g="[object Number]",v="[object Object]",y="[object RegExp]",b="[object Set]",x="[object String]",w="[object Symbol]",E="[object WeakMap]",_="[object ArrayBuffer]",A="[object DataView]",k="[object Float32Array]",C="[object Float64Array]",O="[object Int8Array]",S="[object Int16Array]",D="[object Int32Array]",F="[object Uint8Array]",j="[object Uint16Array]",T="[object Uint32Array]",N=/\b__p \+= '';/g,M=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,R=/[&<>"']/g,z=RegExp(P.source),L=RegExp(R.source),I=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(V.source),G=/^\s+|\s+$/g,X=/^\s+/,K=/\s+$/,J=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Q=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,ie=/^[-+]0x[0-9a-f]+$/i,oe=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,ue=/^0o[0-7]+$/i,se=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ce=/($^)/,fe=/['\n\r\u2028\u2029\\]/g,de="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",he="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="[\\ud800-\\udfff]",me="["+he+"]",ge="["+de+"]",ve="\\d+",ye="[\\u2700-\\u27bf]",be="[a-z\\xdf-\\xf6\\xf8-\\xff]",xe="[^\\ud800-\\udfff"+he+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",we="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",ke="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ce="(?:"+be+"|"+xe+")",Oe="(?:"+ke+"|"+xe+")",Se="(?:"+ge+"|"+we+")"+"?",De="[\\ufe0e\\ufe0f]?"+Se+("(?:\\u200d(?:"+[Ee,_e,Ae].join("|")+")[\\ufe0e\\ufe0f]?"+Se+")*"),Fe="(?:"+[ye,_e,Ae].join("|")+")"+De,je="(?:"+[Ee+ge+"?",ge,_e,Ae,pe].join("|")+")",Te=RegExp("['’]","g"),Ne=RegExp(ge,"g"),Me=RegExp(we+"(?="+we+")|"+je+De,"g"),Be=RegExp([ke+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[me,ke,"$"].join("|")+")",Oe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[me,ke+Ce,"$"].join("|")+")",ke+"?"+Ce+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ke+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ve,Fe].join("|"),"g"),Pe=RegExp("[\\u200d\\ud800-\\udfff"+de+"\\ufe0e\\ufe0f]"),Re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ze=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Le=-1,Ie={};Ie[k]=Ie[C]=Ie[O]=Ie[S]=Ie[D]=Ie[F]=Ie["[object Uint8ClampedArray]"]=Ie[j]=Ie[T]=!0,Ie[s]=Ie[l]=Ie[_]=Ie[c]=Ie[A]=Ie[f]=Ie[d]=Ie[h]=Ie[m]=Ie[g]=Ie[v]=Ie[y]=Ie[b]=Ie[x]=Ie[E]=!1;var Ue={};Ue[s]=Ue[l]=Ue[_]=Ue[A]=Ue[c]=Ue[f]=Ue[k]=Ue[C]=Ue[O]=Ue[S]=Ue[D]=Ue[m]=Ue[g]=Ue[v]=Ue[y]=Ue[b]=Ue[x]=Ue[w]=Ue[F]=Ue["[object Uint8ClampedArray]"]=Ue[j]=Ue[T]=!0,Ue[d]=Ue[h]=Ue[E]=!1;var $e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qe=parseFloat,We=parseInt,He="object"==typeof e&&e&&e.Object===Object&&e,Ve="object"==typeof self&&self&&self.Object===Object&&self,Ye=He||Ve||Function("return this")(),Ge=t&&!t.nodeType&&t,Xe=Ge&&"object"==typeof r&&r&&!r.nodeType&&r,Ke=Xe&&Xe.exports===Ge,Je=Ke&&He.process,Qe=function(){try{var e=Xe&&Xe.require&&Xe.require("util").types;return e||Je&&Je.binding&&Je.binding("util")}catch(e){}}(),Ze=Qe&&Qe.isArrayBuffer,et=Qe&&Qe.isDate,tt=Qe&&Qe.isMap,nt=Qe&&Qe.isRegExp,rt=Qe&&Qe.isSet,it=Qe&&Qe.isTypedArray;function ot(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function at(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function dt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Mt(e,t){for(var n=e.length;n--&&wt(t,e[n],0)>-1;);return n}function Bt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Pt=Ct({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rt=Ct({"&":"&","<":"<",">":">",'"':""","'":"'"});function zt(e){return"\\"+$e[e]}function Lt(e){return Pe.test(e)}function It(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Ut(e,t){return function(n){return e(t(n))}}function $t(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var Gt=function e(t){var n,r=(t=null==t?Ye:Gt.defaults(Ye.Object(),t,Gt.pick(Ye,ze))).Array,i=t.Date,de=t.Error,he=t.Function,pe=t.Math,me=t.Object,ge=t.RegExp,ve=t.String,ye=t.TypeError,be=r.prototype,xe=he.prototype,we=me.prototype,Ee=t["__core-js_shared__"],_e=xe.toString,Ae=we.hasOwnProperty,ke=0,Ce=(n=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Oe=we.toString,Se=_e.call(me),De=Ye._,Fe=ge("^"+_e.call(Ae).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=Ke?t.Buffer:void 0,Me=t.Symbol,Pe=t.Uint8Array,$e=je?je.allocUnsafe:void 0,He=Ut(me.getPrototypeOf,me),Ve=me.create,Ge=we.propertyIsEnumerable,Xe=be.splice,Je=Me?Me.isConcatSpreadable:void 0,Qe=Me?Me.iterator:void 0,yt=Me?Me.toStringTag:void 0,Ct=function(){try{var e=Zi(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Xt=t.clearTimeout!==Ye.clearTimeout&&t.clearTimeout,Kt=i&&i.now!==Ye.Date.now&&i.now,Jt=t.setTimeout!==Ye.setTimeout&&t.setTimeout,Qt=pe.ceil,Zt=pe.floor,en=me.getOwnPropertySymbols,tn=je?je.isBuffer:void 0,nn=t.isFinite,rn=be.join,on=Ut(me.keys,me),an=pe.max,un=pe.min,sn=i.now,ln=t.parseInt,cn=pe.random,fn=be.reverse,dn=Zi(t,"DataView"),hn=Zi(t,"Map"),pn=Zi(t,"Promise"),mn=Zi(t,"Set"),gn=Zi(t,"WeakMap"),vn=Zi(me,"create"),yn=gn&&new gn,bn={},xn=Oo(dn),wn=Oo(hn),En=Oo(pn),_n=Oo(mn),An=Oo(gn),kn=Me?Me.prototype:void 0,Cn=kn?kn.valueOf:void 0,On=kn?kn.toString:void 0;function Sn(e){if(Wa(e)&&!Na(e)&&!(e instanceof Tn)){if(e instanceof jn)return e;if(Ae.call(e,"__wrapped__"))return So(e)}return new jn(e)}var Dn=function(){function e(){}return function(t){if(!qa(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Fn(){}function jn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Tn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Nn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Kn(e,t,n,r,i,o){var a,u=1&t,l=2&t,d=4&t;if(n&&(a=i?n(e,r,i,o):n(e)),void 0!==a)return a;if(!qa(e))return e;var E=Na(e);if(E){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Ae.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!u)return vi(e,a)}else{var N=no(e),M=N==h||N==p;if(Ra(e))return fi(e,u);if(N==v||N==s||M&&!i){if(a=l||M?{}:io(e),!u)return l?function(e,t){return yi(e,to(e),t)}(e,function(e,t){return e&&yi(t,wu(t),e)}(a,e)):function(e,t){return yi(e,eo(e),t)}(e,Vn(a,e))}else{if(!Ue[N])return i?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case _:return di(e);case c:case f:return new r(+e);case A:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case k:case C:case O:case S:case D:case F:case"[object Uint8ClampedArray]":case j:case T:return hi(e,n);case m:return new r;case g:case x:return new r(e);case y:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new r;case w:return i=e,Cn?me(Cn.call(i)):{}}var i}(e,N,u)}}o||(o=new Rn);var B=o.get(e);if(B)return B;o.set(e,a),Xa(e)?e.forEach((function(r){a.add(Kn(r,t,n,r,e,o))})):Ha(e)&&e.forEach((function(r,i){a.set(i,Kn(r,t,n,i,e,o))}));var P=E?void 0:(d?l?Vi:Hi:l?wu:xu)(e);return ut(P||e,(function(r,i){P&&(r=e[i=r]),qn(a,i,Kn(r,t,n,i,e,o))})),a}function Jn(e,t,n){var r=n.length;if(null==e)return!r;for(e=me(e);r--;){var i=n[r],o=t[i],a=e[i];if(void 0===a&&!(i in e)||!o(a))return!1}return!0}function Qn(e,t,n){if("function"!=typeof e)throw new ye(o);return xo((function(){e.apply(void 0,n)}),t)}function Zn(e,t,n,r){var i=-1,o=ft,a=!0,u=e.length,s=[],l=t.length;if(!u)return s;n&&(t=ht(t,Ft(n))),r?(o=dt,a=!1):t.length>=200&&(o=Tt,a=!1,t=new Pn(t));e:for(;++i-1},Mn.prototype.set=function(e,t){var n=this.__data__,r=Wn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Bn.prototype.clear=function(){this.size=0,this.__data__={hash:new Nn,map:new(hn||Mn),string:new Nn}},Bn.prototype.delete=function(e){var t=Ji(this,e).delete(e);return this.size-=t?1:0,t},Bn.prototype.get=function(e){return Ji(this,e).get(e)},Bn.prototype.has=function(e){return Ji(this,e).has(e)},Bn.prototype.set=function(e,t){var n=Ji(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Pn.prototype.add=Pn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Pn.prototype.has=function(e){return this.__data__.has(e)},Rn.prototype.clear=function(){this.__data__=new Mn,this.size=0},Rn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Rn.prototype.get=function(e){return this.__data__.get(e)},Rn.prototype.has=function(e){return this.__data__.has(e)},Rn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Mn){var r=n.__data__;if(!hn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Bn(r)}return n.set(e,t),this.size=n.size,this};var er=wi(sr),tr=wi(lr,!0);function nr(e,t){var n=!0;return er(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function rr(e,t,n){for(var r=-1,i=e.length;++r0&&n(u)?t>1?or(u,t-1,n,r,i):pt(i,u):r||(i[i.length]=u)}return i}var ar=Ei(),ur=Ei(!0);function sr(e,t){return e&&ar(e,t,xu)}function lr(e,t){return e&&ur(e,t,xu)}function cr(e,t){return ct(t,(function(t){return Ia(e[t])}))}function fr(e,t){for(var n=0,r=(t=ui(t,e)).length;null!=e&&nt}function mr(e,t){return null!=e&&Ae.call(e,t)}function gr(e,t){return null!=e&&t in me(e)}function vr(e,t,n){for(var i=n?dt:ft,o=e[0].length,a=e.length,u=a,s=r(a),l=1/0,c=[];u--;){var f=e[u];u&&t&&(f=ht(f,Ft(t))),l=un(f.length,l),s[u]=!n&&(t||o>=120&&f.length>=120)?new Pn(u&&f):void 0}f=e[0];var d=-1,h=s[0];e:for(;++d=u)return s;var l=n[r];return s*("desc"==l?-1:1)}}return e.index-t.index}(e,t,n)}))}function Nr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)u!==e&&Xe.call(u,s,1),Xe.call(e,s,1);return e}function Br(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;ao(i)?Xe.call(e,i,1):Zr(e,i)}}return e}function Pr(e,t){return e+Zt(cn()*(t-e+1))}function Rr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function zr(e,t){return wo(mo(e,t,Vu),e+"")}function Lr(e){return Ln(Du(e))}function Ir(e,t){var n=Du(e);return Ao(n,Xn(t,0,n.length))}function Ur(e,t,n,r){if(!qa(e))return e;for(var i=-1,o=(t=ui(t,e)).length,a=o-1,u=e;null!=u&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i>>1,a=e[o];null!==a&&!Ja(a)&&(n?a<=t:a=200){var l=t?null:Ri(e);if(l)return qt(l);a=!1,i=Tt,s=new Pn}else s=t?[]:u;e:for(;++r=r?e:Hr(e,t,n)}var ci=Xt||function(e){return Ye.clearTimeout(e)};function fi(e,t){if(t)return e.slice();var n=e.length,r=$e?$e(n):new e.constructor(n);return e.copy(r),r}function di(e){var t=new e.constructor(e.byteLength);return new Pe(t).set(new Pe(e)),t}function hi(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function pi(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=Ja(e),a=void 0!==t,u=null===t,s=t==t,l=Ja(t);if(!u&&!l&&!o&&e>t||o&&a&&s&&!u&&!l||r&&a&&s||!n&&s||!i)return 1;if(!r&&!o&&!l&&e1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&uo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++r-1?i[o?t[a]:a]:void 0}}function Oi(e){return Wi((function(t){var n=t.length,r=n,i=jn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new ye(o);if(i&&!u&&"wrapper"==Gi(a))var u=new jn([],!0)}for(r=u?r:n;++r1&&b.reverse(),f&&lu))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var f=-1,d=!0,h=2&n?new Pn:void 0;for(o.set(e,t),o.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(J,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return ut(u,(function(n){var r="_."+n[0];t&n[1]&&!ft(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(Q);return t?t[1].split(Z):[]}(r),n)))}function _o(e){var t=0,n=0;return function(){var r=sn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ao(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Go(e,n)}));function ta(e){var t=Sn(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var ra=Wi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Gn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Tn&&ao(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new jn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)}));var ia=bi((function(e,t,n){Ae.call(e,n)?++e[n]:Yn(e,n,1)}));var oa=Ci(To),aa=Ci(No);function ua(e,t){return(Na(e)?ut:er)(e,Ki(t,3))}function sa(e,t){return(Na(e)?st:tr)(e,Ki(t,3))}var la=bi((function(e,t,n){Ae.call(e,n)?e[n].push(t):Yn(e,n,[t])}));var ca=zr((function(e,t,n){var i=-1,o="function"==typeof t,a=Ba(e)?r(e.length):[];return er(e,(function(e){a[++i]=o?ot(t,e,n):yr(e,t,n)})),a})),fa=bi((function(e,t,n){Yn(e,n,t)}));function da(e,t){return(Na(e)?ht:Or)(e,Ki(t,3))}var ha=bi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var pa=zr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&uo(e,t[0],t[1])?t=[]:n>2&&uo(t[0],t[1],t[2])&&(t=[t[0]]),Tr(e,or(t,1),[])})),ma=Kt||function(){return Ye.Date.now()};function ga(e,t,n){return t=n?void 0:t,Li(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function va(e,t){var n;if("function"!=typeof t)throw new ye(o);return e=ru(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ya=zr((function(e,t,n){var r=1;if(n.length){var i=$t(n,Xi(ya));r|=32}return Li(e,r,t,n,i)})),ba=zr((function(e,t,n){var r=3;if(n.length){var i=$t(n,Xi(ba));r|=32}return Li(t,r,e,n,i)}));function xa(e,t,n){var r,i,a,u,s,l,c=0,f=!1,d=!1,h=!0;if("function"!=typeof e)throw new ye(o);function p(t){var n=r,o=i;return r=i=void 0,c=t,u=e.apply(o,n)}function m(e){return c=e,s=xo(v,t),f?p(e):u}function g(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=a}function v(){var e=ma();if(g(e))return y(e);s=xo(v,function(e){var n=t-(e-l);return d?un(n,a-(e-c)):n}(e))}function y(e){return s=void 0,h&&r?p(e):(r=i=void 0,u)}function b(){var e=ma(),n=g(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return m(l);if(d)return ci(s),s=xo(v,t),p(l)}return void 0===s&&(s=xo(v,t)),u}return t=ou(t)||0,qa(n)&&(f=!!n.leading,a=(d="maxWait"in n)?an(ou(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),b.cancel=function(){void 0!==s&&ci(s),c=0,r=l=i=s=void 0},b.flush=function(){return void 0===s?u:y(ma())},b}var wa=zr((function(e,t){return Qn(e,1,t)})),Ea=zr((function(e,t,n){return Qn(e,ou(t)||0,n)}));function _a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ye(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(_a.Cache||Bn),n}function Aa(e){if("function"!=typeof e)throw new ye(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}_a.Cache=Bn;var ka=si((function(e,t){var n=(t=1==t.length&&Na(t[0])?ht(t[0],Ft(Ki())):ht(or(t,1),Ft(Ki()))).length;return zr((function(r){for(var i=-1,o=un(r.length,n);++i=t})),Ta=br(function(){return arguments}())?br:function(e){return Wa(e)&&Ae.call(e,"callee")&&!Ge.call(e,"callee")},Na=r.isArray,Ma=Ze?Ft(Ze):function(e){return Wa(e)&&hr(e)==_};function Ba(e){return null!=e&&$a(e.length)&&!Ia(e)}function Pa(e){return Wa(e)&&Ba(e)}var Ra=tn||os,za=et?Ft(et):function(e){return Wa(e)&&hr(e)==f};function La(e){if(!Wa(e))return!1;var t=hr(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ya(e)}function Ia(e){if(!qa(e))return!1;var t=hr(e);return t==h||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ua(e){return"number"==typeof e&&e==ru(e)}function $a(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Wa(e){return null!=e&&"object"==typeof e}var Ha=tt?Ft(tt):function(e){return Wa(e)&&no(e)==m};function Va(e){return"number"==typeof e||Wa(e)&&hr(e)==g}function Ya(e){if(!Wa(e)||hr(e)!=v)return!1;var t=He(e);if(null===t)return!0;var n=Ae.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_e.call(n)==Se}var Ga=nt?Ft(nt):function(e){return Wa(e)&&hr(e)==y};var Xa=rt?Ft(rt):function(e){return Wa(e)&&no(e)==b};function Ka(e){return"string"==typeof e||!Na(e)&&Wa(e)&&hr(e)==x}function Ja(e){return"symbol"==typeof e||Wa(e)&&hr(e)==w}var Qa=it?Ft(it):function(e){return Wa(e)&&$a(e.length)&&!!Ie[hr(e)]};var Za=Mi(Cr),eu=Mi((function(e,t){return e<=t}));function tu(e){if(!e)return[];if(Ba(e))return Ka(e)?Vt(e):vi(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=no(e);return(t==m?It:t==b?qt:Du)(e)}function nu(e){return e?(e=ou(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ru(e){var t=nu(e),n=t%1;return t==t?n?t-n:t:0}function iu(e){return e?Xn(ru(e),0,4294967295):0}function ou(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(G,"");var n=oe.test(e);return n||ue.test(e)?We(e.slice(2),n?2:8):ie.test(e)?NaN:+e}function au(e){return yi(e,wu(e))}function uu(e){return null==e?"":Jr(e)}var su=xi((function(e,t){if(fo(t)||Ba(t))yi(t,xu(t),e);else for(var n in t)Ae.call(t,n)&&qn(e,n,t[n])})),lu=xi((function(e,t){yi(t,wu(t),e)})),cu=xi((function(e,t,n,r){yi(t,wu(t),e,r)})),fu=xi((function(e,t,n,r){yi(t,xu(t),e,r)})),du=Wi(Gn);var hu=zr((function(e,t){e=me(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&uo(t[0],t[1],i)&&(r=1);++n1),t})),yi(e,Vi(e),n),r&&(n=Kn(n,7,$i));for(var i=t.length;i--;)Zr(n,t[i]);return n}));var ku=Wi((function(e,t){return null==e?{}:function(e,t){return Nr(e,t,(function(t,n){return gu(e,n)}))}(e,t)}));function Cu(e,t){if(null==e)return{};var n=ht(Vi(e),(function(e){return[e]}));return t=Ki(t),Nr(e,n,(function(e,n){return t(e,n[0])}))}var Ou=zi(xu),Su=zi(wu);function Du(e){return null==e?[]:jt(e,xu(e))}var Fu=Ai((function(e,t,n){return t=t.toLowerCase(),e+(n?ju(t):t)}));function ju(e){return Lu(uu(e).toLowerCase())}function Tu(e){return(e=uu(e))&&e.replace(le,Pt).replace(Ne,"")}var Nu=Ai((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Mu=Ai((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Bu=_i("toLowerCase");var Pu=Ai((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ru=Ai((function(e,t,n){return e+(n?" ":"")+Lu(t)}));var zu=Ai((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Lu=_i("toUpperCase");function Iu(e,t,n){return e=uu(e),void 0===(t=n?void 0:t)?function(e){return Re.test(e)}(e)?function(e){return e.match(Be)||[]}(e):function(e){return e.match(ee)||[]}(e):e.match(t)||[]}var Uu=zr((function(e,t){try{return ot(e,void 0,t)}catch(e){return La(e)?e:new de(e)}})),$u=Wi((function(e,t){return ut(t,(function(t){t=Co(t),Yn(e,t,ya(e[t],e))})),e}));function qu(e){return function(){return e}}var Wu=Oi(),Hu=Oi(!0);function Vu(e){return e}function Yu(e){return _r("function"==typeof e?e:Kn(e,1))}var Gu=zr((function(e,t){return function(n){return yr(n,e,t)}})),Xu=zr((function(e,t){return function(n){return yr(e,n,t)}}));function Ku(e,t,n){var r=xu(t),i=cr(t,r);null!=n||qa(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=cr(t,xu(t)));var o=!(qa(n)&&"chain"in n&&!n.chain),a=Ia(e);return ut(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=vi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,pt([this.value()],arguments))})})),e}function Ju(){}var Qu=ji(ht),Zu=ji(lt),es=ji(vt);function ts(e){return so(e)?kt(Co(e)):function(e){return function(t){return fr(t,e)}}(e)}var ns=Ni(),rs=Ni(!0);function is(){return[]}function os(){return!1}var as=Fi((function(e,t){return e+t}),0),us=Pi("ceil"),ss=Fi((function(e,t){return e/t}),1),ls=Pi("floor");var cs,fs=Fi((function(e,t){return e*t}),1),ds=Pi("round"),hs=Fi((function(e,t){return e-t}),0);return Sn.after=function(e,t){if("function"!=typeof t)throw new ye(o);return e=ru(e),function(){if(--e<1)return t.apply(this,arguments)}},Sn.ary=ga,Sn.assign=su,Sn.assignIn=lu,Sn.assignInWith=cu,Sn.assignWith=fu,Sn.at=du,Sn.before=va,Sn.bind=ya,Sn.bindAll=$u,Sn.bindKey=ba,Sn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Na(e)?e:[e]},Sn.chain=ta,Sn.chunk=function(e,t,n){t=(n?uo(e,t,n):void 0===t)?1:an(ru(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,u=r(Qt(i/t));oi?0:i+n),(r=void 0===r||r>i?i:ru(r))<0&&(r+=i),r=n>r?0:iu(r);n>>0)?(e=uu(e))&&("string"==typeof t||null!=t&&!Ga(t))&&!(t=Jr(t))&&Lt(e)?li(Vt(e),0,n):e.split(t,n):[]},Sn.spread=function(e,t){if("function"!=typeof e)throw new ye(o);return t=null==t?0:an(ru(t),0),zr((function(n){var r=n[t],i=li(n,0,t);return r&&pt(i,r),ot(e,this,i)}))},Sn.tail=function(e){var t=null==e?0:e.length;return t?Hr(e,1,t):[]},Sn.take=function(e,t,n){return e&&e.length?Hr(e,0,(t=n||void 0===t?1:ru(t))<0?0:t):[]},Sn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Hr(e,(t=r-(t=n||void 0===t?1:ru(t)))<0?0:t,r):[]},Sn.takeRightWhile=function(e,t){return e&&e.length?ti(e,Ki(t,3),!1,!0):[]},Sn.takeWhile=function(e,t){return e&&e.length?ti(e,Ki(t,3)):[]},Sn.tap=function(e,t){return t(e),e},Sn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new ye(o);return qa(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),xa(e,t,{leading:r,maxWait:t,trailing:i})},Sn.thru=na,Sn.toArray=tu,Sn.toPairs=Ou,Sn.toPairsIn=Su,Sn.toPath=function(e){return Na(e)?ht(e,Co):Ja(e)?[e]:vi(ko(uu(e)))},Sn.toPlainObject=au,Sn.transform=function(e,t,n){var r=Na(e),i=r||Ra(e)||Qa(e);if(t=Ki(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:qa(e)&&Ia(o)?Dn(He(e)):{}}return(i?ut:sr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Sn.unary=function(e){return ga(e,1)},Sn.union=Wo,Sn.unionBy=Ho,Sn.unionWith=Vo,Sn.uniq=function(e){return e&&e.length?Qr(e):[]},Sn.uniqBy=function(e,t){return e&&e.length?Qr(e,Ki(t,2)):[]},Sn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qr(e,void 0,t):[]},Sn.unset=function(e,t){return null==e||Zr(e,t)},Sn.unzip=Yo,Sn.unzipWith=Go,Sn.update=function(e,t,n){return null==e?e:ei(e,t,ai(n))},Sn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:ei(e,t,ai(n),r)},Sn.values=Du,Sn.valuesIn=function(e){return null==e?[]:jt(e,wu(e))},Sn.without=Xo,Sn.words=Iu,Sn.wrap=function(e,t){return Ca(ai(t),e)},Sn.xor=Ko,Sn.xorBy=Jo,Sn.xorWith=Qo,Sn.zip=Zo,Sn.zipObject=function(e,t){return ii(e||[],t||[],qn)},Sn.zipObjectDeep=function(e,t){return ii(e||[],t||[],Ur)},Sn.zipWith=ea,Sn.entries=Ou,Sn.entriesIn=Su,Sn.extend=lu,Sn.extendWith=cu,Ku(Sn,Sn),Sn.add=as,Sn.attempt=Uu,Sn.camelCase=Fu,Sn.capitalize=ju,Sn.ceil=us,Sn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ou(n))==n?n:0),void 0!==t&&(t=(t=ou(t))==t?t:0),Xn(ou(e),t,n)},Sn.clone=function(e){return Kn(e,4)},Sn.cloneDeep=function(e){return Kn(e,5)},Sn.cloneDeepWith=function(e,t){return Kn(e,5,t="function"==typeof t?t:void 0)},Sn.cloneWith=function(e,t){return Kn(e,4,t="function"==typeof t?t:void 0)},Sn.conformsTo=function(e,t){return null==t||Jn(e,t,xu(t))},Sn.deburr=Tu,Sn.defaultTo=function(e,t){return null==e||e!=e?t:e},Sn.divide=ss,Sn.endsWith=function(e,t,n){e=uu(e),t=Jr(t);var r=e.length,i=n=void 0===n?r:Xn(ru(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Sn.eq=Da,Sn.escape=function(e){return(e=uu(e))&&L.test(e)?e.replace(R,Rt):e},Sn.escapeRegExp=function(e){return(e=uu(e))&&Y.test(e)?e.replace(V,"\\$&"):e},Sn.every=function(e,t,n){var r=Na(e)?lt:nr;return n&&uo(e,t,n)&&(t=void 0),r(e,Ki(t,3))},Sn.find=oa,Sn.findIndex=To,Sn.findKey=function(e,t){return bt(e,Ki(t,3),sr)},Sn.findLast=aa,Sn.findLastIndex=No,Sn.findLastKey=function(e,t){return bt(e,Ki(t,3),lr)},Sn.floor=ls,Sn.forEach=ua,Sn.forEachRight=sa,Sn.forIn=function(e,t){return null==e?e:ar(e,Ki(t,3),wu)},Sn.forInRight=function(e,t){return null==e?e:ur(e,Ki(t,3),wu)},Sn.forOwn=function(e,t){return e&&sr(e,Ki(t,3))},Sn.forOwnRight=function(e,t){return e&&lr(e,Ki(t,3))},Sn.get=mu,Sn.gt=Fa,Sn.gte=ja,Sn.has=function(e,t){return null!=e&&ro(e,t,mr)},Sn.hasIn=gu,Sn.head=Bo,Sn.identity=Vu,Sn.includes=function(e,t,n,r){e=Ba(e)?e:Du(e),n=n&&!r?ru(n):0;var i=e.length;return n<0&&(n=an(i+n,0)),Ka(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&wt(e,t,n)>-1},Sn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ru(n);return i<0&&(i=an(r+i,0)),wt(e,t,i)},Sn.inRange=function(e,t,n){return t=nu(t),void 0===n?(n=t,t=0):n=nu(n),function(e,t,n){return e>=un(t,n)&&e=-9007199254740991&&e<=9007199254740991},Sn.isSet=Xa,Sn.isString=Ka,Sn.isSymbol=Ja,Sn.isTypedArray=Qa,Sn.isUndefined=function(e){return void 0===e},Sn.isWeakMap=function(e){return Wa(e)&&no(e)==E},Sn.isWeakSet=function(e){return Wa(e)&&"[object WeakSet]"==hr(e)},Sn.join=function(e,t){return null==e?"":rn.call(e,t)},Sn.kebabCase=Nu,Sn.last=Lo,Sn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=ru(n))<0?an(r+i,0):un(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):xt(e,_t,i,!0)},Sn.lowerCase=Mu,Sn.lowerFirst=Bu,Sn.lt=Za,Sn.lte=eu,Sn.max=function(e){return e&&e.length?rr(e,Vu,pr):void 0},Sn.maxBy=function(e,t){return e&&e.length?rr(e,Ki(t,2),pr):void 0},Sn.mean=function(e){return At(e,Vu)},Sn.meanBy=function(e,t){return At(e,Ki(t,2))},Sn.min=function(e){return e&&e.length?rr(e,Vu,Cr):void 0},Sn.minBy=function(e,t){return e&&e.length?rr(e,Ki(t,2),Cr):void 0},Sn.stubArray=is,Sn.stubFalse=os,Sn.stubObject=function(){return{}},Sn.stubString=function(){return""},Sn.stubTrue=function(){return!0},Sn.multiply=fs,Sn.nth=function(e,t){return e&&e.length?jr(e,ru(t)):void 0},Sn.noConflict=function(){return Ye._===this&&(Ye._=De),this},Sn.noop=Ju,Sn.now=ma,Sn.pad=function(e,t,n){e=uu(e);var r=(t=ru(t))?Ht(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ti(Zt(i),n)+e+Ti(Qt(i),n)},Sn.padEnd=function(e,t,n){e=uu(e);var r=(t=ru(t))?Ht(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var i=cn();return un(e+i*(t-e+qe("1e-"+((i+"").length-1))),t)}return Pr(e,t)},Sn.reduce=function(e,t,n){var r=Na(e)?mt:Ot,i=arguments.length<3;return r(e,Ki(t,4),n,i,er)},Sn.reduceRight=function(e,t,n){var r=Na(e)?gt:Ot,i=arguments.length<3;return r(e,Ki(t,4),n,i,tr)},Sn.repeat=function(e,t,n){return t=(n?uo(e,t,n):void 0===t)?1:ru(t),Rr(uu(e),t)},Sn.replace=function(){var e=arguments,t=uu(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Sn.result=function(e,t,n){var r=-1,i=(t=ui(t,e)).length;for(i||(i=1,e=void 0);++r9007199254740991)return[];var n=4294967295,r=un(e,4294967295);e-=4294967295;for(var i=Dt(r,t=Ki(t));++n=o)return e;var u=n-Ht(r);if(u<1)return r;var s=a?li(a,0,u).join(""):e.slice(0,u);if(void 0===i)return s+r;if(a&&(u+=s.length-u),Ga(i)){if(e.slice(u).search(i)){var l,c=s;for(i.global||(i=ge(i.source,uu(re.exec(i))+"g")),i.lastIndex=0;l=i.exec(c);)var f=l.index;s=s.slice(0,void 0===f?u:f)}}else if(e.indexOf(Jr(i),u)!=u){var d=s.lastIndexOf(i);d>-1&&(s=s.slice(0,d))}return s+r},Sn.unescape=function(e){return(e=uu(e))&&z.test(e)?e.replace(P,Yt):e},Sn.uniqueId=function(e){var t=++ke;return uu(e)+t},Sn.upperCase=zu,Sn.upperFirst=Lu,Sn.each=ua,Sn.eachRight=sa,Sn.first=Bo,Ku(Sn,(cs={},sr(Sn,(function(e,t){Ae.call(Sn.prototype,t)||(cs[t]=e)})),cs),{chain:!1}),Sn.VERSION="4.17.19",ut(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Sn[e].placeholder=Sn})),ut(["drop","take"],(function(e,t){Tn.prototype[e]=function(n){n=void 0===n?1:an(ru(n),0);var r=this.__filtered__&&!t?new Tn(this):this.clone();return r.__filtered__?r.__takeCount__=un(n,r.__takeCount__):r.__views__.push({size:un(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},Tn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),ut(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Tn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ki(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),ut(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Tn.prototype[e]=function(){return this[n](1).value()[0]}})),ut(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Tn.prototype[e]=function(){return this.__filtered__?new Tn(this):this[n](1)}})),Tn.prototype.compact=function(){return this.filter(Vu)},Tn.prototype.find=function(e){return this.filter(e).head()},Tn.prototype.findLast=function(e){return this.reverse().find(e)},Tn.prototype.invokeMap=zr((function(e,t){return"function"==typeof e?new Tn(this):this.map((function(n){return yr(n,e,t)}))})),Tn.prototype.reject=function(e){return this.filter(Aa(Ki(e)))},Tn.prototype.slice=function(e,t){e=ru(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Tn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ru(t))<0?n.dropRight(-t):n.take(t-e)),n)},Tn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Tn.prototype.toArray=function(){return this.take(4294967295)},sr(Tn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Sn[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);i&&(Sn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,u=t instanceof Tn,s=a[0],l=u||Na(t),c=function(e){var t=i.apply(Sn,pt([e],a));return r&&f?t[0]:t};l&&n&&"function"==typeof s&&1!=s.length&&(u=l=!1);var f=this.__chain__,d=!!this.__actions__.length,h=o&&!f,p=u&&!d;if(!o&&l){t=p?t:new Tn(this);var m=e.apply(t,a);return m.__actions__.push({func:na,args:[c],thisArg:void 0}),new jn(m,f)}return h&&p?e.apply(this,a):(m=this.thru(c),h?r?m.value()[0]:m.value():m)})})),ut(["pop","push","shift","sort","splice","unshift"],(function(e){var t=be[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Sn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Na(i)?i:[],e)}return this[n]((function(n){return t.apply(Na(n)?n:[],e)}))}})),sr(Tn.prototype,(function(e,t){var n=Sn[t];if(n){var r=n.name+"";Ae.call(bn,r)||(bn[r]=[]),bn[r].push({name:t,func:n})}})),bn[Si(void 0,2).name]=[{name:"wrapper",func:void 0}],Tn.prototype.clone=function(){var e=new Tn(this.__wrapped__);return e.__actions__=vi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=vi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=vi(this.__views__),e},Tn.prototype.reverse=function(){if(this.__filtered__){var e=new Tn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Tn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Na(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Sn.prototype.plant=function(e){for(var t,n=this;n instanceof Fn;){var r=So(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Sn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Tn){var t=e;return this.__actions__.length&&(t=new Tn(this)),(t=t.reverse()).__actions__.push({func:na,args:[qo],thisArg:void 0}),new jn(t,this.__chain__)}return this.thru(qo)},Sn.prototype.toJSON=Sn.prototype.valueOf=Sn.prototype.value=function(){return ni(this.__wrapped__,this.__actions__)},Sn.prototype.first=Sn.prototype.head,Qe&&(Sn.prototype[Qe]=function(){return this}),Sn}();Ye._=Gt,void 0===(i=function(){return Gt}.call(t,n,t,r))||(r.exports=i)}).call(this)}).call(this,n(36),n(91)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n"']/g,R=RegExp(B.source),z=RegExp(L.source),I=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,G=RegExp(V.source),Y=/^\s+|\s+$/g,K=/^\s+/,X=/\s+$/,J=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Q=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,ie=/^[-+]0x[0-9a-f]+$/i,oe=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,se=/^0o[0-7]+$/i,ue=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ce=/($^)/,fe=/['\n\r\u2028\u2029\\]/g,de="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",he="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="[\\ud800-\\udfff]",me="["+he+"]",ge="["+de+"]",ve="\\d+",be="[\\u2700-\\u27bf]",ye="[a-z\\xdf-\\xf6\\xf8-\\xff]",xe="[^\\ud800-\\udfff"+he+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",we="\\ud83c[\\udffb-\\udfff]",Oe="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",Ce="[\\ud800-\\udbff][\\udc00-\\udfff]",_e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ke="(?:"+ye+"|"+xe+")",Ae="(?:"+_e+"|"+xe+")",Se="(?:"+ge+"|"+we+")"+"?",je="[\\ufe0e\\ufe0f]?"+Se+("(?:\\u200d(?:"+[Oe,Ee,Ce].join("|")+")[\\ufe0e\\ufe0f]?"+Se+")*"),De="(?:"+[be,Ee,Ce].join("|")+")"+je,Fe="(?:"+[Oe+ge+"?",ge,Ee,Ce,pe].join("|")+")",Te=RegExp("['’]","g"),Me=RegExp(ge,"g"),Ne=RegExp(we+"(?="+we+")|"+Fe+je,"g"),Pe=RegExp([_e+"?"+ye+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[me,_e,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[me,_e+ke,"$"].join("|")+")",_e+"?"+ke+"+(?:['’](?:d|ll|m|re|s|t|ve))?",_e+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ve,De].join("|"),"g"),Be=RegExp("[\\u200d\\ud800-\\udfff"+de+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ze=-1,Ie={};Ie[_]=Ie[k]=Ie[A]=Ie[S]=Ie[j]=Ie[D]=Ie["[object Uint8ClampedArray]"]=Ie[F]=Ie[T]=!0,Ie[u]=Ie[l]=Ie[E]=Ie[c]=Ie[C]=Ie[f]=Ie[d]=Ie[h]=Ie[m]=Ie[g]=Ie[v]=Ie[b]=Ie[y]=Ie[x]=Ie[O]=!1;var Ue={};Ue[u]=Ue[l]=Ue[E]=Ue[C]=Ue[c]=Ue[f]=Ue[_]=Ue[k]=Ue[A]=Ue[S]=Ue[j]=Ue[m]=Ue[g]=Ue[v]=Ue[b]=Ue[y]=Ue[x]=Ue[w]=Ue[D]=Ue["[object Uint8ClampedArray]"]=Ue[F]=Ue[T]=!0,Ue[d]=Ue[h]=Ue[O]=!1;var $e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},We=parseFloat,He=parseInt,qe="object"==typeof e&&e&&e.Object===Object&&e,Ve="object"==typeof self&&self&&self.Object===Object&&self,Ge=qe||Ve||Function("return this")(),Ye=t&&!t.nodeType&&t,Ke=Ye&&"object"==typeof r&&r&&!r.nodeType&&r,Xe=Ke&&Ke.exports===Ye,Je=Xe&&qe.process,Qe=function(){try{var e=Ke&&Ke.require&&Ke.require("util").types;return e||Je&&Je.binding&&Je.binding("util")}catch(e){}}(),Ze=Qe&&Qe.isArrayBuffer,et=Qe&&Qe.isDate,tt=Qe&&Qe.isMap,nt=Qe&&Qe.isRegExp,rt=Qe&&Qe.isSet,it=Qe&&Qe.isTypedArray;function ot(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function at(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function dt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Nt(e,t){for(var n=e.length;n--&&wt(t,e[n],0)>-1;);return n}function Pt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Bt=kt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Lt=kt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Rt(e){return"\\"+$e[e]}function zt(e){return Be.test(e)}function It(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Ut(e,t){return function(n){return e(t(n))}}function $t(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var Yt=function e(t){var n,r=(t=null==t?Ge:Yt.defaults(Ge.Object(),t,Yt.pick(Ge,Re))).Array,i=t.Date,de=t.Error,he=t.Function,pe=t.Math,me=t.Object,ge=t.RegExp,ve=t.String,be=t.TypeError,ye=r.prototype,xe=he.prototype,we=me.prototype,Oe=t["__core-js_shared__"],Ee=xe.toString,Ce=we.hasOwnProperty,_e=0,ke=(n=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ae=we.toString,Se=Ee.call(me),je=Ge._,De=ge("^"+Ee.call(Ce).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=Xe?t.Buffer:void 0,Ne=t.Symbol,Be=t.Uint8Array,$e=Fe?Fe.allocUnsafe:void 0,qe=Ut(me.getPrototypeOf,me),Ve=me.create,Ye=we.propertyIsEnumerable,Ke=ye.splice,Je=Ne?Ne.isConcatSpreadable:void 0,Qe=Ne?Ne.iterator:void 0,bt=Ne?Ne.toStringTag:void 0,kt=function(){try{var e=Zi(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==Ge.clearTimeout&&t.clearTimeout,Xt=i&&i.now!==Ge.Date.now&&i.now,Jt=t.setTimeout!==Ge.setTimeout&&t.setTimeout,Qt=pe.ceil,Zt=pe.floor,en=me.getOwnPropertySymbols,tn=Fe?Fe.isBuffer:void 0,nn=t.isFinite,rn=ye.join,on=Ut(me.keys,me),an=pe.max,sn=pe.min,un=i.now,ln=t.parseInt,cn=pe.random,fn=ye.reverse,dn=Zi(t,"DataView"),hn=Zi(t,"Map"),pn=Zi(t,"Promise"),mn=Zi(t,"Set"),gn=Zi(t,"WeakMap"),vn=Zi(me,"create"),bn=gn&&new gn,yn={},xn=Ao(dn),wn=Ao(hn),On=Ao(pn),En=Ao(mn),Cn=Ao(gn),_n=Ne?Ne.prototype:void 0,kn=_n?_n.valueOf:void 0,An=_n?_n.toString:void 0;function Sn(e){if(Ha(e)&&!Ma(e)&&!(e instanceof Tn)){if(e instanceof Fn)return e;if(Ce.call(e,"__wrapped__"))return So(e)}return new Fn(e)}var jn=function(){function e(){}return function(t){if(!Wa(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Dn(){}function Fn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Tn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Mn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Xn(e,t,n,r,i,o){var a,s=1&t,l=2&t,d=4&t;if(n&&(a=i?n(e,r,i,o):n(e)),void 0!==a)return a;if(!Wa(e))return e;var O=Ma(e);if(O){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Ce.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!s)return vi(e,a)}else{var M=no(e),N=M==h||M==p;if(La(e))return fi(e,s);if(M==v||M==u||N&&!i){if(a=l||N?{}:io(e),!s)return l?function(e,t){return bi(e,to(e),t)}(e,function(e,t){return e&&bi(t,ws(t),e)}(a,e)):function(e,t){return bi(e,eo(e),t)}(e,Vn(a,e))}else{if(!Ue[M])return i?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case E:return di(e);case c:case f:return new r(+e);case C:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case _:case k:case A:case S:case j:case D:case"[object Uint8ClampedArray]":case F:case T:return hi(e,n);case m:return new r;case g:case x:return new r(e);case b:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case y:return new r;case w:return i=e,kn?me(kn.call(i)):{}}var i}(e,M,s)}}o||(o=new Ln);var P=o.get(e);if(P)return P;o.set(e,a),Ka(e)?e.forEach((function(r){a.add(Xn(r,t,n,r,e,o))})):qa(e)&&e.forEach((function(r,i){a.set(i,Xn(r,t,n,i,e,o))}));var B=O?void 0:(d?l?Vi:qi:l?ws:xs)(e);return st(B||e,(function(r,i){B&&(r=e[i=r]),Wn(a,i,Xn(r,t,n,i,e,o))})),a}function Jn(e,t,n){var r=n.length;if(null==e)return!r;for(e=me(e);r--;){var i=n[r],o=t[i],a=e[i];if(void 0===a&&!(i in e)||!o(a))return!1}return!0}function Qn(e,t,n){if("function"!=typeof e)throw new be(o);return xo((function(){e.apply(void 0,n)}),t)}function Zn(e,t,n,r){var i=-1,o=ft,a=!0,s=e.length,u=[],l=t.length;if(!s)return u;n&&(t=ht(t,Dt(n))),r?(o=dt,a=!1):t.length>=200&&(o=Tt,a=!1,t=new Bn(t));e:for(;++i-1},Nn.prototype.set=function(e,t){var n=this.__data__,r=Hn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new Mn,map:new(hn||Nn),string:new Mn}},Pn.prototype.delete=function(e){var t=Ji(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Ji(this,e).get(e)},Pn.prototype.has=function(e){return Ji(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Ji(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Bn.prototype.add=Bn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Bn.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.clear=function(){this.__data__=new Nn,this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ln.prototype.get=function(e){return this.__data__.get(e)},Ln.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Nn){var r=n.__data__;if(!hn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(r)}return n.set(e,t),this.size=n.size,this};var er=wi(ur),tr=wi(lr,!0);function nr(e,t){var n=!0;return er(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function rr(e,t,n){for(var r=-1,i=e.length;++r0&&n(s)?t>1?or(s,t-1,n,r,i):pt(i,s):r||(i[i.length]=s)}return i}var ar=Oi(),sr=Oi(!0);function ur(e,t){return e&&ar(e,t,xs)}function lr(e,t){return e&&sr(e,t,xs)}function cr(e,t){return ct(t,(function(t){return Ia(e[t])}))}function fr(e,t){for(var n=0,r=(t=si(t,e)).length;null!=e&&nt}function mr(e,t){return null!=e&&Ce.call(e,t)}function gr(e,t){return null!=e&&t in me(e)}function vr(e,t,n){for(var i=n?dt:ft,o=e[0].length,a=e.length,s=a,u=r(a),l=1/0,c=[];s--;){var f=e[s];s&&t&&(f=ht(f,Dt(t))),l=sn(f.length,l),u[s]=!n&&(t||o>=120&&f.length>=120)?new Bn(s&&f):void 0}f=e[0];var d=-1,h=u[0];e:for(;++d=s)return u;var l=n[r];return u*("desc"==l?-1:1)}}return e.index-t.index}(e,t,n)}))}function Mr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&Ke.call(s,u,1),Ke.call(e,u,1);return e}function Pr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;ao(i)?Ke.call(e,i,1):Zr(e,i)}}return e}function Br(e,t){return e+Zt(cn()*(t-e+1))}function Lr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Rr(e,t){return wo(mo(e,t,Vs),e+"")}function zr(e){return zn(js(e))}function Ir(e,t){var n=js(e);return Co(n,Kn(t,0,n.length))}function Ur(e,t,n,r){if(!Wa(e))return e;for(var i=-1,o=(t=si(t,e)).length,a=o-1,s=e;null!=s&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i>>1,a=e[o];null!==a&&!Ja(a)&&(n?a<=t:a=200){var l=t?null:Li(e);if(l)return Wt(l);a=!1,i=Tt,u=new Bn}else u=t?[]:s;e:for(;++r=r?e:qr(e,t,n)}var ci=Kt||function(e){return Ge.clearTimeout(e)};function fi(e,t){if(t)return e.slice();var n=e.length,r=$e?$e(n):new e.constructor(n);return e.copy(r),r}function di(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function hi(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function pi(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=Ja(e),a=void 0!==t,s=null===t,u=t==t,l=Ja(t);if(!s&&!l&&!o&&e>t||o&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!l&&e1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&so(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++r-1?i[o?t[a]:a]:void 0}}function Ai(e){return Hi((function(t){var n=t.length,r=n,i=Fn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new be(o);if(i&&!s&&"wrapper"==Yi(a))var s=new Fn([],!0)}for(r=s?r:n;++r1&&y.reverse(),f&&ls))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var f=-1,d=!0,h=2&n?new Bn:void 0;for(o.set(e,t),o.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(J,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return st(s,(function(n){var r="_."+n[0];t&n[1]&&!ft(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(Q);return t?t[1].split(Z):[]}(r),n)))}function Eo(e){var t=0,n=0;return function(){var r=un(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Co(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Yo(e,n)}));function ta(e){var t=Sn(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var ra=Hi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Yn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Tn&&ao(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new Fn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)}));var ia=yi((function(e,t,n){Ce.call(e,n)?++e[n]:Gn(e,n,1)}));var oa=ki(To),aa=ki(Mo);function sa(e,t){return(Ma(e)?st:er)(e,Xi(t,3))}function ua(e,t){return(Ma(e)?ut:tr)(e,Xi(t,3))}var la=yi((function(e,t,n){Ce.call(e,n)?e[n].push(t):Gn(e,n,[t])}));var ca=Rr((function(e,t,n){var i=-1,o="function"==typeof t,a=Pa(e)?r(e.length):[];return er(e,(function(e){a[++i]=o?ot(t,e,n):br(e,t,n)})),a})),fa=yi((function(e,t,n){Gn(e,n,t)}));function da(e,t){return(Ma(e)?ht:Ar)(e,Xi(t,3))}var ha=yi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var pa=Rr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&so(e,t[0],t[1])?t=[]:n>2&&so(t[0],t[1],t[2])&&(t=[t[0]]),Tr(e,or(t,1),[])})),ma=Xt||function(){return Ge.Date.now()};function ga(e,t,n){return t=n?void 0:t,zi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function va(e,t){var n;if("function"!=typeof t)throw new be(o);return e=rs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ba=Rr((function(e,t,n){var r=1;if(n.length){var i=$t(n,Ki(ba));r|=32}return zi(e,r,t,n,i)})),ya=Rr((function(e,t,n){var r=3;if(n.length){var i=$t(n,Ki(ya));r|=32}return zi(t,r,e,n,i)}));function xa(e,t,n){var r,i,a,s,u,l,c=0,f=!1,d=!1,h=!0;if("function"!=typeof e)throw new be(o);function p(t){var n=r,o=i;return r=i=void 0,c=t,s=e.apply(o,n)}function m(e){return c=e,u=xo(v,t),f?p(e):s}function g(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=a}function v(){var e=ma();if(g(e))return b(e);u=xo(v,function(e){var n=t-(e-l);return d?sn(n,a-(e-c)):n}(e))}function b(e){return u=void 0,h&&r?p(e):(r=i=void 0,s)}function y(){var e=ma(),n=g(e);if(r=arguments,i=this,l=e,n){if(void 0===u)return m(l);if(d)return ci(u),u=xo(v,t),p(l)}return void 0===u&&(u=xo(v,t)),s}return t=os(t)||0,Wa(n)&&(f=!!n.leading,a=(d="maxWait"in n)?an(os(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==u&&ci(u),c=0,r=l=i=u=void 0},y.flush=function(){return void 0===u?s:b(ma())},y}var wa=Rr((function(e,t){return Qn(e,1,t)})),Oa=Rr((function(e,t,n){return Qn(e,os(t)||0,n)}));function Ea(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new be(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ea.Cache||Pn),n}function Ca(e){if("function"!=typeof e)throw new be(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ea.Cache=Pn;var _a=ui((function(e,t){var n=(t=1==t.length&&Ma(t[0])?ht(t[0],Dt(Xi())):ht(or(t,1),Dt(Xi()))).length;return Rr((function(r){for(var i=-1,o=sn(r.length,n);++i=t})),Ta=yr(function(){return arguments}())?yr:function(e){return Ha(e)&&Ce.call(e,"callee")&&!Ye.call(e,"callee")},Ma=r.isArray,Na=Ze?Dt(Ze):function(e){return Ha(e)&&hr(e)==E};function Pa(e){return null!=e&&$a(e.length)&&!Ia(e)}function Ba(e){return Ha(e)&&Pa(e)}var La=tn||ou,Ra=et?Dt(et):function(e){return Ha(e)&&hr(e)==f};function za(e){if(!Ha(e))return!1;var t=hr(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ga(e)}function Ia(e){if(!Wa(e))return!1;var t=hr(e);return t==h||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ua(e){return"number"==typeof e&&e==rs(e)}function $a(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Wa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ha(e){return null!=e&&"object"==typeof e}var qa=tt?Dt(tt):function(e){return Ha(e)&&no(e)==m};function Va(e){return"number"==typeof e||Ha(e)&&hr(e)==g}function Ga(e){if(!Ha(e)||hr(e)!=v)return!1;var t=qe(e);if(null===t)return!0;var n=Ce.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ee.call(n)==Se}var Ya=nt?Dt(nt):function(e){return Ha(e)&&hr(e)==b};var Ka=rt?Dt(rt):function(e){return Ha(e)&&no(e)==y};function Xa(e){return"string"==typeof e||!Ma(e)&&Ha(e)&&hr(e)==x}function Ja(e){return"symbol"==typeof e||Ha(e)&&hr(e)==w}var Qa=it?Dt(it):function(e){return Ha(e)&&$a(e.length)&&!!Ie[hr(e)]};var Za=Ni(kr),es=Ni((function(e,t){return e<=t}));function ts(e){if(!e)return[];if(Pa(e))return Xa(e)?Vt(e):vi(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=no(e);return(t==m?It:t==y?Wt:js)(e)}function ns(e){return e?(e=os(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function rs(e){var t=ns(e),n=t%1;return t==t?n?t-n:t:0}function is(e){return e?Kn(rs(e),0,4294967295):0}function os(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(Wa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Wa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Y,"");var n=oe.test(e);return n||se.test(e)?He(e.slice(2),n?2:8):ie.test(e)?NaN:+e}function as(e){return bi(e,ws(e))}function ss(e){return null==e?"":Jr(e)}var us=xi((function(e,t){if(fo(t)||Pa(t))bi(t,xs(t),e);else for(var n in t)Ce.call(t,n)&&Wn(e,n,t[n])})),ls=xi((function(e,t){bi(t,ws(t),e)})),cs=xi((function(e,t,n,r){bi(t,ws(t),e,r)})),fs=xi((function(e,t,n,r){bi(t,xs(t),e,r)})),ds=Hi(Yn);var hs=Rr((function(e,t){e=me(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&so(t[0],t[1],i)&&(r=1);++n1),t})),bi(e,Vi(e),n),r&&(n=Xn(n,7,$i));for(var i=t.length;i--;)Zr(n,t[i]);return n}));var _s=Hi((function(e,t){return null==e?{}:function(e,t){return Mr(e,t,(function(t,n){return gs(e,n)}))}(e,t)}));function ks(e,t){if(null==e)return{};var n=ht(Vi(e),(function(e){return[e]}));return t=Xi(t),Mr(e,n,(function(e,n){return t(e,n[0])}))}var As=Ri(xs),Ss=Ri(ws);function js(e){return null==e?[]:Ft(e,xs(e))}var Ds=Ci((function(e,t,n){return t=t.toLowerCase(),e+(n?Fs(t):t)}));function Fs(e){return zs(ss(e).toLowerCase())}function Ts(e){return(e=ss(e))&&e.replace(le,Bt).replace(Me,"")}var Ms=Ci((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ns=Ci((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ps=Ei("toLowerCase");var Bs=Ci((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ls=Ci((function(e,t,n){return e+(n?" ":"")+zs(t)}));var Rs=Ci((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),zs=Ei("toUpperCase");function Is(e,t,n){return e=ss(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(Pe)||[]}(e):function(e){return e.match(ee)||[]}(e):e.match(t)||[]}var Us=Rr((function(e,t){try{return ot(e,void 0,t)}catch(e){return za(e)?e:new de(e)}})),$s=Hi((function(e,t){return st(t,(function(t){t=ko(t),Gn(e,t,ba(e[t],e))})),e}));function Ws(e){return function(){return e}}var Hs=Ai(),qs=Ai(!0);function Vs(e){return e}function Gs(e){return Er("function"==typeof e?e:Xn(e,1))}var Ys=Rr((function(e,t){return function(n){return br(n,e,t)}})),Ks=Rr((function(e,t){return function(n){return br(e,n,t)}}));function Xs(e,t,n){var r=xs(t),i=cr(t,r);null!=n||Wa(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=cr(t,xs(t)));var o=!(Wa(n)&&"chain"in n&&!n.chain),a=Ia(e);return st(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=vi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,pt([this.value()],arguments))})})),e}function Js(){}var Qs=Fi(ht),Zs=Fi(lt),eu=Fi(vt);function tu(e){return uo(e)?_t(ko(e)):function(e){return function(t){return fr(t,e)}}(e)}var nu=Mi(),ru=Mi(!0);function iu(){return[]}function ou(){return!1}var au=Di((function(e,t){return e+t}),0),su=Bi("ceil"),uu=Di((function(e,t){return e/t}),1),lu=Bi("floor");var cu,fu=Di((function(e,t){return e*t}),1),du=Bi("round"),hu=Di((function(e,t){return e-t}),0);return Sn.after=function(e,t){if("function"!=typeof t)throw new be(o);return e=rs(e),function(){if(--e<1)return t.apply(this,arguments)}},Sn.ary=ga,Sn.assign=us,Sn.assignIn=ls,Sn.assignInWith=cs,Sn.assignWith=fs,Sn.at=ds,Sn.before=va,Sn.bind=ba,Sn.bindAll=$s,Sn.bindKey=ya,Sn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ma(e)?e:[e]},Sn.chain=ta,Sn.chunk=function(e,t,n){t=(n?so(e,t,n):void 0===t)?1:an(rs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=r(Qt(i/t));oi?0:i+n),(r=void 0===r||r>i?i:rs(r))<0&&(r+=i),r=n>r?0:is(r);n>>0)?(e=ss(e))&&("string"==typeof t||null!=t&&!Ya(t))&&!(t=Jr(t))&&zt(e)?li(Vt(e),0,n):e.split(t,n):[]},Sn.spread=function(e,t){if("function"!=typeof e)throw new be(o);return t=null==t?0:an(rs(t),0),Rr((function(n){var r=n[t],i=li(n,0,t);return r&&pt(i,r),ot(e,this,i)}))},Sn.tail=function(e){var t=null==e?0:e.length;return t?qr(e,1,t):[]},Sn.take=function(e,t,n){return e&&e.length?qr(e,0,(t=n||void 0===t?1:rs(t))<0?0:t):[]},Sn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?qr(e,(t=r-(t=n||void 0===t?1:rs(t)))<0?0:t,r):[]},Sn.takeRightWhile=function(e,t){return e&&e.length?ti(e,Xi(t,3),!1,!0):[]},Sn.takeWhile=function(e,t){return e&&e.length?ti(e,Xi(t,3)):[]},Sn.tap=function(e,t){return t(e),e},Sn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new be(o);return Wa(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),xa(e,t,{leading:r,maxWait:t,trailing:i})},Sn.thru=na,Sn.toArray=ts,Sn.toPairs=As,Sn.toPairsIn=Ss,Sn.toPath=function(e){return Ma(e)?ht(e,ko):Ja(e)?[e]:vi(_o(ss(e)))},Sn.toPlainObject=as,Sn.transform=function(e,t,n){var r=Ma(e),i=r||La(e)||Qa(e);if(t=Xi(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Wa(e)&&Ia(o)?jn(qe(e)):{}}return(i?st:ur)(e,(function(e,r,i){return t(n,e,r,i)})),n},Sn.unary=function(e){return ga(e,1)},Sn.union=Ho,Sn.unionBy=qo,Sn.unionWith=Vo,Sn.uniq=function(e){return e&&e.length?Qr(e):[]},Sn.uniqBy=function(e,t){return e&&e.length?Qr(e,Xi(t,2)):[]},Sn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qr(e,void 0,t):[]},Sn.unset=function(e,t){return null==e||Zr(e,t)},Sn.unzip=Go,Sn.unzipWith=Yo,Sn.update=function(e,t,n){return null==e?e:ei(e,t,ai(n))},Sn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:ei(e,t,ai(n),r)},Sn.values=js,Sn.valuesIn=function(e){return null==e?[]:Ft(e,ws(e))},Sn.without=Ko,Sn.words=Is,Sn.wrap=function(e,t){return ka(ai(t),e)},Sn.xor=Xo,Sn.xorBy=Jo,Sn.xorWith=Qo,Sn.zip=Zo,Sn.zipObject=function(e,t){return ii(e||[],t||[],Wn)},Sn.zipObjectDeep=function(e,t){return ii(e||[],t||[],Ur)},Sn.zipWith=ea,Sn.entries=As,Sn.entriesIn=Ss,Sn.extend=ls,Sn.extendWith=cs,Xs(Sn,Sn),Sn.add=au,Sn.attempt=Us,Sn.camelCase=Ds,Sn.capitalize=Fs,Sn.ceil=su,Sn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=os(n))==n?n:0),void 0!==t&&(t=(t=os(t))==t?t:0),Kn(os(e),t,n)},Sn.clone=function(e){return Xn(e,4)},Sn.cloneDeep=function(e){return Xn(e,5)},Sn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Sn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Sn.conformsTo=function(e,t){return null==t||Jn(e,t,xs(t))},Sn.deburr=Ts,Sn.defaultTo=function(e,t){return null==e||e!=e?t:e},Sn.divide=uu,Sn.endsWith=function(e,t,n){e=ss(e),t=Jr(t);var r=e.length,i=n=void 0===n?r:Kn(rs(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Sn.eq=ja,Sn.escape=function(e){return(e=ss(e))&&z.test(e)?e.replace(L,Lt):e},Sn.escapeRegExp=function(e){return(e=ss(e))&&G.test(e)?e.replace(V,"\\$&"):e},Sn.every=function(e,t,n){var r=Ma(e)?lt:nr;return n&&so(e,t,n)&&(t=void 0),r(e,Xi(t,3))},Sn.find=oa,Sn.findIndex=To,Sn.findKey=function(e,t){return yt(e,Xi(t,3),ur)},Sn.findLast=aa,Sn.findLastIndex=Mo,Sn.findLastKey=function(e,t){return yt(e,Xi(t,3),lr)},Sn.floor=lu,Sn.forEach=sa,Sn.forEachRight=ua,Sn.forIn=function(e,t){return null==e?e:ar(e,Xi(t,3),ws)},Sn.forInRight=function(e,t){return null==e?e:sr(e,Xi(t,3),ws)},Sn.forOwn=function(e,t){return e&&ur(e,Xi(t,3))},Sn.forOwnRight=function(e,t){return e&&lr(e,Xi(t,3))},Sn.get=ms,Sn.gt=Da,Sn.gte=Fa,Sn.has=function(e,t){return null!=e&&ro(e,t,mr)},Sn.hasIn=gs,Sn.head=Po,Sn.identity=Vs,Sn.includes=function(e,t,n,r){e=Pa(e)?e:js(e),n=n&&!r?rs(n):0;var i=e.length;return n<0&&(n=an(i+n,0)),Xa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&wt(e,t,n)>-1},Sn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:rs(n);return i<0&&(i=an(r+i,0)),wt(e,t,i)},Sn.inRange=function(e,t,n){return t=ns(t),void 0===n?(n=t,t=0):n=ns(n),function(e,t,n){return e>=sn(t,n)&&e=-9007199254740991&&e<=9007199254740991},Sn.isSet=Ka,Sn.isString=Xa,Sn.isSymbol=Ja,Sn.isTypedArray=Qa,Sn.isUndefined=function(e){return void 0===e},Sn.isWeakMap=function(e){return Ha(e)&&no(e)==O},Sn.isWeakSet=function(e){return Ha(e)&&"[object WeakSet]"==hr(e)},Sn.join=function(e,t){return null==e?"":rn.call(e,t)},Sn.kebabCase=Ms,Sn.last=zo,Sn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=rs(n))<0?an(r+i,0):sn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):xt(e,Et,i,!0)},Sn.lowerCase=Ns,Sn.lowerFirst=Ps,Sn.lt=Za,Sn.lte=es,Sn.max=function(e){return e&&e.length?rr(e,Vs,pr):void 0},Sn.maxBy=function(e,t){return e&&e.length?rr(e,Xi(t,2),pr):void 0},Sn.mean=function(e){return Ct(e,Vs)},Sn.meanBy=function(e,t){return Ct(e,Xi(t,2))},Sn.min=function(e){return e&&e.length?rr(e,Vs,kr):void 0},Sn.minBy=function(e,t){return e&&e.length?rr(e,Xi(t,2),kr):void 0},Sn.stubArray=iu,Sn.stubFalse=ou,Sn.stubObject=function(){return{}},Sn.stubString=function(){return""},Sn.stubTrue=function(){return!0},Sn.multiply=fu,Sn.nth=function(e,t){return e&&e.length?Fr(e,rs(t)):void 0},Sn.noConflict=function(){return Ge._===this&&(Ge._=je),this},Sn.noop=Js,Sn.now=ma,Sn.pad=function(e,t,n){e=ss(e);var r=(t=rs(t))?qt(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ti(Zt(i),n)+e+Ti(Qt(i),n)},Sn.padEnd=function(e,t,n){e=ss(e);var r=(t=rs(t))?qt(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var i=cn();return sn(e+i*(t-e+We("1e-"+((i+"").length-1))),t)}return Br(e,t)},Sn.reduce=function(e,t,n){var r=Ma(e)?mt:At,i=arguments.length<3;return r(e,Xi(t,4),n,i,er)},Sn.reduceRight=function(e,t,n){var r=Ma(e)?gt:At,i=arguments.length<3;return r(e,Xi(t,4),n,i,tr)},Sn.repeat=function(e,t,n){return t=(n?so(e,t,n):void 0===t)?1:rs(t),Lr(ss(e),t)},Sn.replace=function(){var e=arguments,t=ss(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Sn.result=function(e,t,n){var r=-1,i=(t=si(t,e)).length;for(i||(i=1,e=void 0);++r9007199254740991)return[];var n=4294967295,r=sn(e,4294967295);e-=4294967295;for(var i=jt(r,t=Xi(t));++n=o)return e;var s=n-qt(r);if(s<1)return r;var u=a?li(a,0,s).join(""):e.slice(0,s);if(void 0===i)return u+r;if(a&&(s+=u.length-s),Ya(i)){if(e.slice(s).search(i)){var l,c=u;for(i.global||(i=ge(i.source,ss(re.exec(i))+"g")),i.lastIndex=0;l=i.exec(c);)var f=l.index;u=u.slice(0,void 0===f?s:f)}}else if(e.indexOf(Jr(i),s)!=s){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+r},Sn.unescape=function(e){return(e=ss(e))&&R.test(e)?e.replace(B,Gt):e},Sn.uniqueId=function(e){var t=++_e;return ss(e)+t},Sn.upperCase=Rs,Sn.upperFirst=zs,Sn.each=sa,Sn.eachRight=ua,Sn.first=Po,Xs(Sn,(cu={},ur(Sn,(function(e,t){Ce.call(Sn.prototype,t)||(cu[t]=e)})),cu),{chain:!1}),Sn.VERSION="4.17.19",st(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Sn[e].placeholder=Sn})),st(["drop","take"],(function(e,t){Tn.prototype[e]=function(n){n=void 0===n?1:an(rs(n),0);var r=this.__filtered__&&!t?new Tn(this):this.clone();return r.__filtered__?r.__takeCount__=sn(n,r.__takeCount__):r.__views__.push({size:sn(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},Tn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),st(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Tn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Xi(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),st(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Tn.prototype[e]=function(){return this[n](1).value()[0]}})),st(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Tn.prototype[e]=function(){return this.__filtered__?new Tn(this):this[n](1)}})),Tn.prototype.compact=function(){return this.filter(Vs)},Tn.prototype.find=function(e){return this.filter(e).head()},Tn.prototype.findLast=function(e){return this.reverse().find(e)},Tn.prototype.invokeMap=Rr((function(e,t){return"function"==typeof e?new Tn(this):this.map((function(n){return br(n,e,t)}))})),Tn.prototype.reject=function(e){return this.filter(Ca(Xi(e)))},Tn.prototype.slice=function(e,t){e=rs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Tn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=rs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Tn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Tn.prototype.toArray=function(){return this.take(4294967295)},ur(Tn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Sn[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);i&&(Sn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,s=t instanceof Tn,u=a[0],l=s||Ma(t),c=function(e){var t=i.apply(Sn,pt([e],a));return r&&f?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(s=l=!1);var f=this.__chain__,d=!!this.__actions__.length,h=o&&!f,p=s&&!d;if(!o&&l){t=p?t:new Tn(this);var m=e.apply(t,a);return m.__actions__.push({func:na,args:[c],thisArg:void 0}),new Fn(m,f)}return h&&p?e.apply(this,a):(m=this.thru(c),h?r?m.value()[0]:m.value():m)})})),st(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ye[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Sn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ma(i)?i:[],e)}return this[n]((function(n){return t.apply(Ma(n)?n:[],e)}))}})),ur(Tn.prototype,(function(e,t){var n=Sn[t];if(n){var r=n.name+"";Ce.call(yn,r)||(yn[r]=[]),yn[r].push({name:t,func:n})}})),yn[Si(void 0,2).name]=[{name:"wrapper",func:void 0}],Tn.prototype.clone=function(){var e=new Tn(this.__wrapped__);return e.__actions__=vi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=vi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=vi(this.__views__),e},Tn.prototype.reverse=function(){if(this.__filtered__){var e=new Tn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Tn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ma(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Sn.prototype.plant=function(e){for(var t,n=this;n instanceof Dn;){var r=So(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Sn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Tn){var t=e;return this.__actions__.length&&(t=new Tn(this)),(t=t.reverse()).__actions__.push({func:na,args:[Wo],thisArg:void 0}),new Fn(t,this.__chain__)}return this.thru(Wo)},Sn.prototype.toJSON=Sn.prototype.valueOf=Sn.prototype.value=function(){return ni(this.__wrapped__,this.__actions__)},Sn.prototype.first=Sn.prototype.head,Qe&&(Sn.prototype[Qe]=function(){return this}),Sn}();Ge._=Yt,void 0===(i=function(){return Yt}.call(t,n,t,r))||(r.exports=i)}).call(this)}).call(this,n(34),n(94)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n * @license MIT */ -var r=n(97),i=n(98),o=n(99);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(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(s.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 I(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return I(e).length;t=(""+t).toLowerCase(),r=!0}}function m(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 D(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return S(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(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=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,s.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,u=e.length,s=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,u/=2,s/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;ou&&(n=u-s),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 C(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]))&&(s=(31&l)<<6|63&o)>127&&(c=s);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(s=(15&l)<<12|(63&o)<<6|63&a)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:o=e[i+1],a=e[i+2],u=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(s=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(c=s)}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+=" ... ")),""},s.prototype.compare=function(e,t,n,r,i){if(!s.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),u=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 b(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(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 T(e,t,n,r,i,o){if(!s.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 N(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 M(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 B(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 P(e,t,n,r,o){return o||B(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function R(e,t,n,r,o){return o||B(e,0,n,8),i.write(e,t,n,r,52,8),n+8}s.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},s.prototype.readUInt8=function(e,t){return t||j(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||j(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||j(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||j(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||j(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},s.prototype.readInt8=function(e,t){return t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||j(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||j(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||j(e,4,this.length),i.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||j(e,4,this.length),i.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||j(e,8,this.length),i.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||j(e,8,this.length),i.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||T(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},s.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);T(this,e,t,n,i-1,-i)}var o=0,a=1,u=0;for(this[t]=255&e;++o>0)-u&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);T(this,e,t,n,i-1,-i)}var o=n-1,a=1,u=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===u&&0!==this[t+o+1]&&(u=1),this[t+o]=(e/a>>0)-u&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},s.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||!s.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 U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(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(36))},function(e,t,n){"use strict";n.r(t),n.d(t,"Vega",(function(){return w2})),n.d(t,"VegaLite",(function(){return _2})),n.d(t,"createClassFromSpec",(function(){return k2}));var r={};n.r(r),n.d(r,"JsonPatchError",(function(){return z})),n.d(r,"deepClone",(function(){return L})),n.d(r,"getValueByPointer",(function(){return $})),n.d(r,"applyOperation",(function(){return q})),n.d(r,"applyPatch",(function(){return W})),n.d(r,"applyReducer",(function(){return H})),n.d(r,"validator",(function(){return V})),n.d(r,"validate",(function(){return Y})),n.d(r,"_areEquals",(function(){return G}));var i={};n.r(i),n.d(i,"unobserve",(function(){return Q})),n.d(i,"observe",(function(){return Z})),n.d(i,"generate",(function(){return ee})),n.d(i,"compare",(function(){return ne}));var o={};n.r(o),n.d(o,"aggregate",(function(){return uc})),n.d(o,"bin",(function(){return sc})),n.d(o,"collect",(function(){return cc})),n.d(o,"compare",(function(){return fc})),n.d(o,"countpattern",(function(){return hc})),n.d(o,"cross",(function(){return pc})),n.d(o,"density",(function(){return gc})),n.d(o,"dotbin",(function(){return wc})),n.d(o,"expression",(function(){return _c})),n.d(o,"extent",(function(){return kc})),n.d(o,"facet",(function(){return Oc})),n.d(o,"field",(function(){return Sc})),n.d(o,"filter",(function(){return Fc})),n.d(o,"flatten",(function(){return jc})),n.d(o,"fold",(function(){return Tc})),n.d(o,"formula",(function(){return Nc})),n.d(o,"generate",(function(){return Mc})),n.d(o,"impute",(function(){return Rc})),n.d(o,"joinaggregate",(function(){return zc})),n.d(o,"kde",(function(){return Lc})),n.d(o,"key",(function(){return Ic})),n.d(o,"load",(function(){return $c})),n.d(o,"lookup",(function(){return Wc})),n.d(o,"multiextent",(function(){return Hc})),n.d(o,"multivalues",(function(){return Yc})),n.d(o,"params",(function(){return Xc})),n.d(o,"pivot",(function(){return Kc})),n.d(o,"prefacet",(function(){return Jc})),n.d(o,"project",(function(){return Qc})),n.d(o,"proxy",(function(){return Zc})),n.d(o,"quantile",(function(){return ef})),n.d(o,"relay",(function(){return tf})),n.d(o,"sample",(function(){return nf})),n.d(o,"sequence",(function(){return rf})),n.d(o,"sieve",(function(){return of})),n.d(o,"subflow",(function(){return Cc})),n.d(o,"timeunit",(function(){return af})),n.d(o,"tupleindex",(function(){return sf})),n.d(o,"values",(function(){return lf})),n.d(o,"window",(function(){return pf}));var a={};n.r(a),n.d(a,"interpolate",(function(){return wp})),n.d(a,"interpolateArray",(function(){return hp})),n.d(a,"interpolateBasis",(function(){return ep})),n.d(a,"interpolateBasisClosed",(function(){return tp})),n.d(a,"interpolateDate",(function(){return mp})),n.d(a,"interpolateDiscrete",(function(){return am})),n.d(a,"interpolateHue",(function(){return um})),n.d(a,"interpolateNumber",(function(){return gp})),n.d(a,"interpolateNumberArray",(function(){return fp})),n.d(a,"interpolateObject",(function(){return vp})),n.d(a,"interpolateRound",(function(){return Ep})),n.d(a,"interpolateString",(function(){return xp})),n.d(a,"interpolateTransformCss",(function(){return dm})),n.d(a,"interpolateTransformSvg",(function(){return hm})),n.d(a,"interpolateZoom",(function(){return mm})),n.d(a,"interpolateRgb",(function(){return up})),n.d(a,"interpolateRgbBasis",(function(){return lp})),n.d(a,"interpolateRgbBasisClosed",(function(){return cp})),n.d(a,"interpolateHsl",(function(){return vm})),n.d(a,"interpolateHslLong",(function(){return ym})),n.d(a,"interpolateLab",(function(){return Tm})),n.d(a,"interpolateHcl",(function(){return Mm})),n.d(a,"interpolateHclLong",(function(){return Bm})),n.d(a,"interpolateCubehelix",(function(){return Hm})),n.d(a,"interpolateCubehelixLong",(function(){return Vm})),n.d(a,"piecewise",(function(){return nm})),n.d(a,"quantize",(function(){return Ym}));var u={};n.r(u),n.d(u,"bound",(function(){return gw})),n.d(u,"identifier",(function(){return yw})),n.d(u,"mark",(function(){return bw})),n.d(u,"overlap",(function(){return xw})),n.d(u,"render",(function(){return Ow})),n.d(u,"viewlayout",(function(){return Gw}));var s={};n.r(s),n.d(s,"axisticks",(function(){return kE})),n.d(s,"datajoin",(function(){return CE})),n.d(s,"encode",(function(){return SE})),n.d(s,"legendentries",(function(){return DE})),n.d(s,"linkpath",(function(){return ME})),n.d(s,"pie",(function(){return LE})),n.d(s,"scale",(function(){return $E})),n.d(s,"sortitems",(function(){return VE})),n.d(s,"stack",(function(){return GE}));var l={};n.r(l),n.d(l,"contour",(function(){return $C})),n.d(l,"geojson",(function(){return qC})),n.d(l,"geopath",(function(){return WC})),n.d(l,"geopoint",(function(){return HC})),n.d(l,"geoshape",(function(){return VC})),n.d(l,"graticule",(function(){return YC})),n.d(l,"heatmap",(function(){return GC})),n.d(l,"isocontour",(function(){return TC})),n.d(l,"kde2d",(function(){return LC})),n.d(l,"projection",(function(){return KC}));var c={};n.r(c),n.d(c,"force",(function(){return nS}));var f={};n.r(f),n.d(f,"nest",(function(){return vD})),n.d(f,"pack",(function(){return _D})),n.d(f,"partition",(function(){return kD})),n.d(f,"stratify",(function(){return CD})),n.d(f,"tree",(function(){return DD})),n.d(f,"treelinks",(function(){return FD})),n.d(f,"treemap",(function(){return ND}));var d={};n.r(d),n.d(d,"label",(function(){return uF}));var h={};n.r(h),n.d(h,"loess",(function(){return xF})),n.d(h,"regression",(function(){return EF}));var p={};n.r(p),n.d(p,"voronoi",(function(){return JF}));var m={};n.r(m),n.d(m,"wordcloud",(function(){return yj}));var g={};n.r(g),n.d(g,"crossfilter",(function(){return Nj})),n.d(g,"resolvefilter",(function(){return Mj}));var v={};n.r(v),n.d(v,"Debug",(function(){return Ce})),n.d(v,"Error",(function(){return _e})),n.d(v,"Info",(function(){return ke})),n.d(v,"None",(function(){return Ee})),n.d(v,"Warn",(function(){return Ae})),n.d(v,"accessor",(function(){return ae})),n.d(v,"accessorFields",(function(){return se})),n.d(v,"accessorName",(function(){return ue})),n.d(v,"array",(function(){return Ze})),n.d(v,"ascending",(function(){return rt})),n.d(v,"clampRange",(function(){return et})),n.d(v,"compare",(function(){return nt})),n.d(v,"constant",(function(){return ut})),n.d(v,"debounce",(function(){return st})),n.d(v,"error",(function(){return de})),n.d(v,"extend",(function(){return lt})),n.d(v,"extent",(function(){return ct})),n.d(v,"extentIndex",(function(){return ft})),n.d(v,"falsy",(function(){return xe})),n.d(v,"fastmap",(function(){return mt})),n.d(v,"field",(function(){return pe})),n.d(v,"flush",(function(){return gt})),n.d(v,"hasOwnProperty",(function(){return ht})),n.d(v,"id",(function(){return me})),n.d(v,"identity",(function(){return ge})),n.d(v,"inherits",(function(){return vt})),n.d(v,"inrange",(function(){return yt})),n.d(v,"isArray",(function(){return Se})),n.d(v,"isBoolean",(function(){return bt})),n.d(v,"isDate",(function(){return xt})),n.d(v,"isFunction",(function(){return tt})),n.d(v,"isIterable",(function(){return wt})),n.d(v,"isNumber",(function(){return Et})),n.d(v,"isObject",(function(){return De})),n.d(v,"isRegExp",(function(){return _t})),n.d(v,"isString",(function(){return At})),n.d(v,"key",(function(){return kt})),n.d(v,"lerp",(function(){return Ct})),n.d(v,"logger",(function(){return Oe})),n.d(v,"lruCache",(function(){return Ot})),n.d(v,"merge",(function(){return St})),n.d(v,"mergeConfig",(function(){return je})),n.d(v,"one",(function(){return ye})),n.d(v,"pad",(function(){return Ft})),n.d(v,"panLinear",(function(){return $e})),n.d(v,"panLog",(function(){return qe})),n.d(v,"panPow",(function(){return We})),n.d(v,"panSymlog",(function(){return He})),n.d(v,"peek",(function(){return Me})),n.d(v,"quarter",(function(){return Je})),n.d(v,"repeat",(function(){return Dt})),n.d(v,"span",(function(){return jt})),n.d(v,"splitAccessPath",(function(){return he})),n.d(v,"stringValue",(function(){return Tt})),n.d(v,"toBoolean",(function(){return Nt})),n.d(v,"toDate",(function(){return Bt})),n.d(v,"toNumber",(function(){return Be})),n.d(v,"toSet",(function(){return Rt})),n.d(v,"toString",(function(){return Pt})),n.d(v,"truncate",(function(){return zt})),n.d(v,"truthy",(function(){return be})),n.d(v,"utcquarter",(function(){return Qe})),n.d(v,"visitArray",(function(){return Lt})),n.d(v,"writeConfig",(function(){return Te})),n.d(v,"zero",(function(){return ve})),n.d(v,"zoomLinear",(function(){return Ye})),n.d(v,"zoomLog",(function(){return Ge})),n.d(v,"zoomPow",(function(){return Xe})),n.d(v,"zoomSymlog",(function(){return Ke})),n.d(v,"Dataflow",(function(){return ls})),n.d(v,"EventStream",(function(){return Gu})),n.d(v,"MultiPulse",(function(){return is})),n.d(v,"Operator",(function(){return Hu})),n.d(v,"Parameters",(function(){return $u})),n.d(v,"Pulse",(function(){return es})),n.d(v,"Transform",(function(){return fs})),n.d(v,"changeset",(function(){return Uu})),n.d(v,"definition",(function(){return hs})),n.d(v,"ingest",(function(){return Bu})),n.d(v,"isTuple",(function(){return Tu})),n.d(v,"transform",(function(){return ps})),n.d(v,"transforms",(function(){return ds})),n.d(v,"tupleid",(function(){return Nu})),n.d(v,"bandwidthNRD",(function(){return el})),n.d(v,"bin",(function(){return tl})),n.d(v,"bootstrapCI",(function(){return il})),n.d(v,"cumulativeLogNormal",(function(){return bl})),n.d(v,"cumulativeNormal",(function(){return hl})),n.d(v,"cumulativeUniform",(function(){return kl})),n.d(v,"densityLogNormal",(function(){return yl})),n.d(v,"densityNormal",(function(){return dl})),n.d(v,"densityUniform",(function(){return Al})),n.d(v,"dotbin",(function(){return ol})),n.d(v,"quantileLogNormal",(function(){return xl})),n.d(v,"quantileNormal",(function(){return pl})),n.d(v,"quantileUniform",(function(){return Cl})),n.d(v,"quantiles",(function(){return Qs})),n.d(v,"quartiles",(function(){return Zs})),n.d(v,"random",(function(){return nl})),n.d(v,"randomInteger",(function(){return ul})),n.d(v,"randomKDE",(function(){return gl})),n.d(v,"randomLCG",(function(){return al})),n.d(v,"randomLogNormal",(function(){return wl})),n.d(v,"randomMixture",(function(){return El})),n.d(v,"randomNormal",(function(){return ml})),n.d(v,"randomUniform",(function(){return Ol})),n.d(v,"regressionExp",(function(){return Ml})),n.d(v,"regressionLinear",(function(){return Tl})),n.d(v,"regressionLoess",(function(){return Ll})),n.d(v,"regressionLog",(function(){return Nl})),n.d(v,"regressionPoly",(function(){return Rl})),n.d(v,"regressionPow",(function(){return Bl})),n.d(v,"regressionQuad",(function(){return Pl})),n.d(v,"sampleCurve",(function(){return ql})),n.d(v,"sampleLogNormal",(function(){return vl})),n.d(v,"sampleNormal",(function(){return fl})),n.d(v,"sampleUniform",(function(){return _l})),n.d(v,"setRandom",(function(){return rl})),n.d(v,"DATE",(function(){return Si})),n.d(v,"DAY",(function(){return Di})),n.d(v,"DAYOFYEAR",(function(){return Fi})),n.d(v,"HOURS",(function(){return ji})),n.d(v,"MILLISECONDS",(function(){return Mi})),n.d(v,"MINUTES",(function(){return Ti})),n.d(v,"MONTH",(function(){return Ci})),n.d(v,"QUARTER",(function(){return ki})),n.d(v,"SECONDS",(function(){return Ni})),n.d(v,"TIME_UNITS",(function(){return Bi})),n.d(v,"WEEK",(function(){return Oi})),n.d(v,"YEAR",(function(){return Ai})),n.d(v,"dayofyear",(function(){return $i})),n.d(v,"timeBin",(function(){return Oo})),n.d(v,"timeFloor",(function(){return io})),n.d(v,"timeInterval",(function(){return co})),n.d(v,"timeOffset",(function(){return po})),n.d(v,"timeSequence",(function(){return vo})),n.d(v,"timeUnitSpecifier",(function(){return Li})),n.d(v,"timeUnits",(function(){return Ri})),n.d(v,"utcFloor",(function(){return uo})),n.d(v,"utcInterval",(function(){return fo})),n.d(v,"utcOffset",(function(){return mo})),n.d(v,"utcSequence",(function(){return yo})),n.d(v,"utcdayofyear",(function(){return Gi})),n.d(v,"utcweek",(function(){return Xi})),n.d(v,"week",(function(){return qi})),n.d(v,"loader",(function(){return Ou})),n.d(v,"read",(function(){return Cu})),n.d(v,"inferType",(function(){return wn})),n.d(v,"inferTypes",(function(){return En})),n.d(v,"typeParsers",(function(){return yn})),n.d(v,"format",(function(){return Wn})),n.d(v,"formats",(function(){return Hn})),n.d(v,"responseType",(function(){return Vn})),n.d(v,"Bounds",(function(){return Lv})),n.d(v,"CanvasHandler",(function(){return ox})),n.d(v,"CanvasRenderer",(function(){return cx})),n.d(v,"Gradient",(function(){return Yg})),n.d(v,"GroupItem",(function(){return Uv})),n.d(v,"Handler",(function(){return Gb})),n.d(v,"Item",(function(){return Iv})),n.d(v,"Marks",(function(){return Nb})),n.d(v,"RenderType",(function(){return qx})),n.d(v,"Renderer",(function(){return Kb})),n.d(v,"ResourceLoader",(function(){return $v})),n.d(v,"SVGHandler",(function(){return dx})),n.d(v,"SVGRenderer",(function(){return Sx})),n.d(v,"SVGStringRenderer",(function(){return $x})),n.d(v,"Scenegraph",(function(){return Ib})),n.d(v,"boundClip",(function(){return Jx})),n.d(v,"boundContext",(function(){return ly})),n.d(v,"boundItem",(function(){return Mb})),n.d(v,"boundMark",(function(){return Pb})),n.d(v,"boundStroke",(function(){return Hv})),n.d(v,"domChild",(function(){return Wb})),n.d(v,"domClear",(function(){return Hb})),n.d(v,"domCreate",(function(){return $b})),n.d(v,"domFind",(function(){return qb})),n.d(v,"font",(function(){return Ob})),n.d(v,"fontFamily",(function(){return Cb})),n.d(v,"fontSize",(function(){return wb})),n.d(v,"intersect",(function(){return Vx})),n.d(v,"intersectBoxLine",(function(){return xy})),n.d(v,"intersectPath",(function(){return gy})),n.d(v,"intersectPoint",(function(){return vy})),n.d(v,"intersectRule",(function(){return by})),n.d(v,"lineHeight",(function(){return Eb})),n.d(v,"markup",(function(){return _x})),n.d(v,"multiLineOffset",(function(){return Ab})),n.d(v,"pathCurves",(function(){return Xg})),n.d(v,"pathEqual",(function(){return Zx})),n.d(v,"pathParse",(function(){return Qg})),n.d(v,"pathRectangle",(function(){return wv})),n.d(v,"pathRender",(function(){return lv})),n.d(v,"pathSymbols",(function(){return hv})),n.d(v,"pathTrail",(function(){return Ev})),n.d(v,"point",(function(){return Yb})),n.d(v,"renderModule",(function(){return Hx})),n.d(v,"resetSVGClipId",(function(){return Rv})),n.d(v,"resetSVGDefIds",(function(){return ew})),n.d(v,"sceneEqual",(function(){return Qx})),n.d(v,"sceneFromJSON",(function(){return Lb})),n.d(v,"scenePickVisit",(function(){return jy})),n.d(v,"sceneToJSON",(function(){return zb})),n.d(v,"sceneVisit",(function(){return Fy})),n.d(v,"sceneZOrder",(function(){return Dy})),n.d(v,"serializeXML",(function(){return Ax})),n.d(v,"textMetrics",(function(){return mb})),n.d(v,"interpolate",(function(){return bg})),n.d(v,"interpolateColors",(function(){return gg})),n.d(v,"interpolateRange",(function(){return mg})),n.d(v,"quantizeInterpolator",(function(){return vg})),n.d(v,"scale",(function(){return og})),n.d(v,"scheme",(function(){return _g})),n.d(v,"projection",(function(){return bC})),n.d(v,"View",(function(){return eR})),n.d(v,"defaultLocale",(function(){return Au})),n.d(v,"formatLocale",(function(){return gu})),n.d(v,"locale",(function(){return _u})),n.d(v,"resetDefaultLocale",(function(){return ku})),n.d(v,"timeFormatLocale",(function(){return wu})),n.d(v,"expressionFunction",(function(){return IB})),n.d(v,"parse",(function(){return HI})),n.d(v,"runtimeContext",(function(){return gP})),n.d(v,"version",(function(){return VI}));var y={};n.r(y),n.d(y,"invalidSpec",(function(){return Pq})),n.d(y,"FIT_NON_SINGLE",(function(){return Rq})),n.d(y,"containerSizeNonSingle",(function(){return zq})),n.d(y,"containerSizeNotCompatibleWithAutosize",(function(){return Lq})),n.d(y,"droppingFit",(function(){return Iq})),n.d(y,"cannotProjectOnChannelWithoutField",(function(){return Uq})),n.d(y,"cannotProjectAggregate",(function(){return $q})),n.d(y,"nearestNotSupportForContinuous",(function(){return qq})),n.d(y,"selectionNotSupported",(function(){return Wq})),n.d(y,"selectionNotFound",(function(){return Hq})),n.d(y,"SCALE_BINDINGS_CONTINUOUS",(function(){return Vq})),n.d(y,"LEGEND_BINDINGS_PROJECT_LENGTH",(function(){return Yq})),n.d(y,"noSameUnitLookup",(function(){return Gq})),n.d(y,"noSuchRepeatedValue",(function(){return Xq})),n.d(y,"columnsNotSupportByRowCol",(function(){return Kq})),n.d(y,"CONCAT_CANNOT_SHARE_AXIS",(function(){return Jq})),n.d(y,"REPEAT_CANNOT_SHARE_AXIS",(function(){return Qq})),n.d(y,"unrecognizedParse",(function(){return Zq})),n.d(y,"differentParse",(function(){return eW})),n.d(y,"invalidTransformIgnored",(function(){return tW})),n.d(y,"NO_FIELDS_NEEDS_AS",(function(){return nW})),n.d(y,"encodingOverridden",(function(){return rW})),n.d(y,"projectionOverridden",(function(){return iW})),n.d(y,"primitiveChannelDef",(function(){return oW})),n.d(y,"invalidFieldType",(function(){return aW})),n.d(y,"nonZeroScaleUsedWithLengthMark",(function(){return uW})),n.d(y,"invalidFieldTypeForCountAggregate",(function(){return sW})),n.d(y,"invalidAggregate",(function(){return lW})),n.d(y,"missingFieldType",(function(){return cW})),n.d(y,"droppingColor",(function(){return fW})),n.d(y,"emptyFieldDef",(function(){return dW})),n.d(y,"latLongDeprecated",(function(){return hW})),n.d(y,"LINE_WITH_VARYING_SIZE",(function(){return pW})),n.d(y,"incompatibleChannel",(function(){return mW})),n.d(y,"invalidEncodingChannel",(function(){return gW})),n.d(y,"facetChannelShouldBeDiscrete",(function(){return vW})),n.d(y,"facetChannelDropped",(function(){return yW})),n.d(y,"discreteChannelCannotEncode",(function(){return bW})),n.d(y,"lineWithRange",(function(){return xW})),n.d(y,"orientOverridden",(function(){return wW})),n.d(y,"CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN",(function(){return EW})),n.d(y,"RANGE_STEP_DEPRECATED",(function(){return _W})),n.d(y,"cannotUseScalePropertyWithNonColor",(function(){return AW})),n.d(y,"unaggregateDomainHasNoEffectForRawField",(function(){return kW})),n.d(y,"unaggregateDomainWithNonSharedDomainOp",(function(){return CW})),n.d(y,"unaggregatedDomainWithLogScale",(function(){return OW})),n.d(y,"cannotApplySizeToNonOrientedMark",(function(){return SW})),n.d(y,"scaleTypeNotWorkWithChannel",(function(){return DW})),n.d(y,"scaleTypeNotWorkWithFieldDef",(function(){return FW})),n.d(y,"scalePropertyNotWorkWithScaleType",(function(){return jW})),n.d(y,"scaleTypeNotWorkWithMark",(function(){return TW})),n.d(y,"stepDropped",(function(){return NW})),n.d(y,"mergeConflictingProperty",(function(){return MW})),n.d(y,"mergeConflictingDomainProperty",(function(){return BW})),n.d(y,"independentScaleMeansIndependentGuide",(function(){return PW})),n.d(y,"domainSortDropped",(function(){return RW})),n.d(y,"UNABLE_TO_MERGE_DOMAINS",(function(){return zW})),n.d(y,"MORE_THAN_ONE_SORT",(function(){return LW})),n.d(y,"INVALID_CHANNEL_FOR_AXIS",(function(){return IW})),n.d(y,"cannotStackRangedMark",(function(){return UW})),n.d(y,"cannotStackNonLinearScale",(function(){return $W})),n.d(y,"stackNonSummativeAggregate",(function(){return qW})),n.d(y,"invalidTimeUnit",(function(){return WW})),n.d(y,"dayReplacedWithDate",(function(){return HW})),n.d(y,"droppedDay",(function(){return VW})),n.d(y,"errorBarCenterAndExtentAreNotNeeded",(function(){return YW})),n.d(y,"errorBarCenterIsUsedWithWrongExtent",(function(){return GW})),n.d(y,"errorBarContinuousAxisHasCustomizedAggregate",(function(){return XW})),n.d(y,"errorBarCenterIsNotNeeded",(function(){return KW})),n.d(y,"errorBand1DNotSupport",(function(){return JW})),n.d(y,"channelRequiredForBinned",(function(){return QW})),n.d(y,"domainRequiredForThresholdScale",(function(){return ZW}));var b={};n.r(b),n.d(b,"symbols",(function(){return VQ})),n.d(b,"gradient",(function(){return YQ})),n.d(b,"labels",(function(){return GQ})),n.d(b,"entries",(function(){return XQ})),n.d(b,"getFirstConditionValue",(function(){return JQ}));var x={};n.r(x),n.d(x,"compile",(function(){return C1})),n.d(x,"extractTransforms",(function(){return S1})),n.d(x,"normalize",(function(){return RG})),n.d(x,"version",(function(){return D1}));var w={};n.r(w),n.d(w,"dark",(function(){return N1})),n.d(w,"excel",(function(){return M1})),n.d(w,"fivethirtyeight",(function(){return B1})),n.d(w,"ggplot2",(function(){return P1})),n.d(w,"latimes",(function(){return L1})),n.d(w,"quartz",(function(){return I1})),n.d(w,"vox",(function(){return U1})),n.d(w,"urbaninstitute",(function(){return q1})),n.d(w,"version",(function(){return W1}));var E=n(4),_=n.n(E),A=n(0),k=n.n(A);function C(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=48&&t<=57))return!1;n++}return!0}function M(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function B(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function P(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 R=function(e){function t(t,n,r,i,o){var a=this.constructor,u=e.call(this,P(t,{name:n,index:r,operation:i,tree:o}))||this;return u.name=n,u.index=r,u.operation=i,u.tree=o,Object.setPrototypeOf(u,a.prototype),u.message=P(t,{name:n,index:r,operation:i,tree:o}),u}return S(t,e),t}(Error),z=R,L=T,I={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=$(n,this.path);r&&(r=T(r));var i=q(n,{op:"remove",path:this.from}).removed;return q(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=$(n,this.from);return q(n,{op:"add",path:this.path,value:T(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:G(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},U={add:function(e,t,n){return N(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:I.move,copy:I.copy,test:I.test,_get:I._get};function $(e,t){if(""==t)return e;var n={op:"_get",path:t};return q(e,n),n.value}function q(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):V(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=$(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=G(e,t.value),!1===a.test)throw new z("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 z("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return a}r||(e=T(e));var u=(t.path||"").split("/"),s=e,l=1,c=u.length,f=void 0,d=void 0,h=void 0;for(h="function"==typeof n?n:V;;){if(d=u[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===s[d]?f=u.slice(0,l).join("/"):l==c-1&&(f=t.path),void 0!==f&&h(t,0,e,f)),l++,Array.isArray(s)){if("-"===d)d=s.length;else{if(n&&!N(d))throw new z("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);N(d)&&(d=~~d)}if(l>=c){if(n&&"add"===t.op&&d>s.length)throw new z("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=U[t.op].call(t,s,d,e)).test)throw new z("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(d&&-1!=d.indexOf("~")&&(d=B(d)),l>=c){if(!1===(a=I[t.op].call(t,s,d,e)).test)throw new z("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}s=s[d]}}function W(e,t,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),n&&!Array.isArray(t))throw new z("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(e=T(e));for(var o=new Array(t.length),a=0,u=t.length;a0)throw new z('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 z("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 z("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;n0&&(e.patches=[],e.callback&&e.callback(r)),r}function te(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=j(t),a=j(e),u=!1,s=a.length-1;s>=0;s--){var l=e[f=a[s]];if(!F(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+"/"+M(f),value:T(l)}),n.push({op:"remove",path:r+"/"+M(f)}),u=!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?te(l,c,n,r+"/"+M(f),i):l!==c&&(!0,i&&n.push({op:"test",path:r+"/"+M(f),value:T(l)}),n.push({op:"replace",path:r+"/"+M(f),value:T(c)}))}}if(u||o.length!=a.length)for(s=0;sfunction(t){return t[e]},fe=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||de("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&de("Access path missing closing bracket: "+e),a&&de("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function pe(e,t,n){const r=he(e);return e=1===r.length?r[0]:e,ae((n&&n.get||le)(r),[e],t||e)}const me=pe("id"),ge=ae(e=>e,[],"identity"),ve=ae(()=>0,[],"zero"),ye=ae(()=>1,[],"one"),be=ae(()=>!0,[],"true"),xe=ae(()=>!1,[],"false");function we(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}const Ee=0,_e=1,Ae=2,ke=3,Ce=4;function Oe(e,t){let n=e||Ee;return{level(e){return arguments.length?(n=+e,this):n},error(){return n>=_e&&we(t||"error","ERROR",arguments),this},warn(){return n>=Ae&&we(t||"warn","WARN",arguments),this},info(){return n>=ke&&we(t||"log","INFO",arguments),this},debug(){return n>=Ce&&we(t||"log","DEBUG",arguments),this}}}var Se=Array.isArray;function De(e){return e===Object(e)}const Fe=e=>"__proto__"!==e;function je(...e){return e.reduce((e,t)=>{for(const n in t)if("signals"===n)e.signals=Ne(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;Te(e,n,t[n],r)}return e},{})}function Te(e,t,n,r){if(!Fe(t))return;let i,o;if(De(n)&&!Se(n))for(i in o=De(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?Te(o,i,n[i]):Fe(i)&&(o[i]=n[i]);else e[t]=n}function Ne(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 Me(e){return e[e.length-1]}function Be(e){return null==e||""===e?null:+e}const Pe=e=>t=>e*Math.exp(t),Re=e=>t=>Math.log(e*t),ze=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Le=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Ie=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Ue(e,t,n,r){const i=n(e[0]),o=n(Me(e)),a=(o-i)*t;return[r(i-a),r(o-a)]}function $e(e,t){return Ue(e,t,Be,ge)}function qe(e,t){var n=Math.sign(e[0]);return Ue(e,t,Re(n),Pe(n))}function We(e,t,n){return Ue(e,t,Ie(n),Ie(1/n))}function He(e,t,n){return Ue(e,t,ze(n),Le(n))}function Ve(e,t,n,r,i){const o=r(e[0]),a=r(Me(e)),u=null!=t?r(t):(o+a)/2;return[i(u+(o-u)*n),i(u+(a-u)*n)]}function Ye(e,t,n){return Ve(e,t,n,Be,ge)}function Ge(e,t,n){const r=Math.sign(e[0]);return Ve(e,t,n,Re(r),Pe(r))}function Xe(e,t,n,r){return Ve(e,t,n,Ie(r),Ie(1/r))}function Ke(e,t,n,r){return Ve(e,t,n,ze(r),Le(r))}function Je(e){return 1+~~(new Date(e).getMonth()/3)}function Qe(e){return 1+~~(new Date(e).getUTCMonth()/3)}function Ze(e){return null!=e?Se(e)?e:[e]:[]}function et(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 tt(e){return"function"==typeof e}function nt(e,t,n){n=n||{},t=Ze(t)||[];const r=[],i=[],o={},a=n.comparator||it;return Ze(e).forEach((e,a)=>{null!=e&&(r.push("descending"===t[a]?-1:1),i.push(e=tt(e)?e:pe(e,null,n)),(se(e)||[]).forEach(e=>o[e]=1))}),0===i.length?null:ae(a(i,r),Object.keys(o))}const rt=(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),it=(e,t)=>1===e.length?ot(e[0],t[0]):at(e,t,e.length),ot=(e,t)=>function(n,r){return rt(e(n),e(r))*t},at=(e,t,n)=>(t.push(0),function(r,i){let o,a=0,u=-1;for(;0===a&&++ue}function st(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(t(r),n=null),e)}}function lt(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 ft(e,t){const n=e.length;let r,i,o,a,u,s=-1;if(null==t){for(;++s=i){r=o=i;break}if(s===n)return[-1,-1];for(a=u=s;++si&&(r=i,a=s),o=i){r=o=i;break}if(s===n)return[-1,-1];for(a=u=s;++si&&(r=i,a=s),or(e)?n[e]:void 0,set(e,t){return r(e)||(++i.size,n[e]===pt&&--i.empty),n[e]=t,this},delete(e){return r(e)&&(--i.size,++i.empty,n[e]=pt),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===pt||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 gt(e,t,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let u,s=e[0],l=Me(e);la&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=e:oe.replace(/\\(.)/g,"$1")):Ze(e));const r=e&&e.length,i=n&&n.get||le,o=e=>i(t?[e]:he(e));let a;if(r)if(1===r){const t=o(e[0]);a=function(e){return""+t(e)}}else{const t=e.map(o);a=function(e){let n=""+t[0](e),i=0;for(;++i{t={},n={},r=0},o=(i,o)=>(++r>e&&(n=t,t={},r=1),t[i]=o);return i(),{clear:i,has:e=>ht(t,e)||ht(n,e),get:e=>ht(t,e)?t[e]:ht(n,e)?o(e,n[e]):void 0,set:(e,n)=>ht(t,e)?t[e]=n:o(e,n)}}function St(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 u=0,s=0,l=0;for(;u0?n[s++]:t[u++];for(;u=0;)n+=e;return n}function Ft(e,t,n,r){const i=n||" ",o=e+"",a=t-o.length;return a<=0?o:"left"===r?Dt(i,a)+o:"center"===r?Dt(i,~~(a/2))+o+Dt(i,Math.ceil(a/2)):o+Dt(i,a)}function jt(e){return e&&Me(e)-e[0]||0}function Tt(e){return Se(e)?"["+e.map(Tt)+"]":De(e)||At(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Nt(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e}const Mt=e=>Et(e)||xt(e)?e:Date.parse(e);function Bt(e,t){return t=t||Mt,null==e||""===e?null:t(e)}function Pt(e){return null==e||""===e?null:e+""}function Rt(e){const t={},n=e.length;for(let r=0;rfunction(t){return t[e]},qt=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||Wt("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&Wt("Access path missing closing bracket: "+e),a&&Wt("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function Vt(e,t,n){const r=Ht(e);return e=1===r.length?r[0]:e,It((n&&n.get||Ut)(r),[e],t||e)}const Yt=Vt("id"),Gt=It(e=>e,[],"identity"),Xt=(It(()=>0,[],"zero"),It(()=>1,[],"one"),It(()=>!0,[],"true"));It(()=>!1,[],"false");function Kt(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}var Jt=Array.isArray;function Qt(e){return null!=e?Jt(e)?e:[e]:[]}function Zt(e){return"function"==typeof e}function en(e){return Zt(e)?e:()=>e}function tn(e){for(let t,n,r=1,i=arguments.length;rnew Promise((n,r)=>{e.readFile(t,(e,t)=>{e?r(e):n(t)})}):pn}async function pn(){Object(un.a)("No file system access.")}function mn(e){return e?async function(t,n){const r=Object(un.b)({},this.options.http,n),i=n&&n.response,o=await e(t,r);return o.ok?Object(un.g)(o[i])?o[i]():o.text():Object(un.a)(o.status+""+o.statusText)}:gn}async function gn(){Object(un.a)("No HTTP fetch method available.")}const vn=e=>!(Number.isNaN(+e)||e instanceof Date),yn={boolean:un.k,integer:un.m,number:un.m,date:un.l,string:un.n,unknown:un.e},bn=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>vn(e)&&Number.isInteger(+e),vn,e=>!Number.isNaN(Date.parse(e))],xn=["boolean","integer","number","date"];function wn(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=bn.length,i=bn.map((e,t)=>t+1);for(let a,u,s=0,l=0;s0===e?t:e,0)-1]}function En(e,t){return t.reduce((t,n)=>(t[n]=wn(e,n),t),{})}var _n={},An={};function kn(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function Cn(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 On(e,t){var n=e+"",r=n.length;return r9999?"+"+On(t,6):On(t,4))+"-"+On(e.getUTCMonth()+1,2)+"-"+On(e.getUTCDate(),2)+(o?"T"+On(n,2)+":"+On(r,2)+":"+On(i,2)+"."+On(o,3)+"Z":i?"T"+On(n,2)+":"+On(r,2)+":"+On(i,2)+"Z":r||n?"T"+On(n,2)+":"+On(r,2)+"Z":"")}var Dn=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,i=[],o=e.length,a=0,u=0,s=o<=0,l=!1;function c(){if(s)return An;if(l)return l=!1,_n;var t,r,i=a;if(34===e.charCodeAt(i)){for(;a++=o?s=!0:10===(r=e.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===e.charCodeAt(a)&&++a),e.slice(i+1,t-1).replace(/""/g,'"')}for(;a1)r=Un(e,t,n);else for(i=0,r=new Array(o=e.arcs.length);ie!==t,exterior:(e,t)=>e===t};function qn(e,t){let n,r,i,o;return e=Object(Tn.a)(e,t),t&&t.feature?(n=Bn,i=t.feature):t&&t.mesh?(n=Ln,i=t.mesh,o=$n[t.filter]):Object(un.a)("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):Object(un.a)("Invalid TopoJSON object: "+i),r&&r.features||[r]}qn.responseType="json";const Wn={dsv:jn,csv:Fn(","),tsv:Fn("\t"),json:Tn.a,topojson:qn};function Hn(e,t){return arguments.length>1?(Wn[e]=t,this):Object(un.d)(Wn,e)?Wn[e]:null}function Vn(e){const t=Hn(e);return t&&t.responseType||"text"}var Yn=Math.sqrt(50),Gn=Math.sqrt(10),Xn=Math.sqrt(2),Kn=function(e,t,n){var r,i,o,a,u=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++u=0?(o>=Yn?10:o>=Gn?5:o>=Xn?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Yn?10:o>=Gn?5:o>=Xn?2:1)}function Qn(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Yn?i*=10:o>=Gn?i*=5:o>=Xn&&(i*=2),t=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function er(e){if(!(t=Zn.exec(e)))throw new Error("invalid format: "+e);var t;return new tr({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 tr(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+""}er.prototype=tr.prototype,tr.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 nr(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)]}var rr,ir,or,ar,ur=function(e){return(e=nr(Math.abs(e)))?e[1]:NaN},sr=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ur(t)/3)))-ur(Math.abs(e)))},lr=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ur(t)-ur(e))+1},cr=function(e){return Math.max(0,-ur(Math.abs(e)))},fr=function(e,t){var n=nr(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},dr={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},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)=>fr(100*e,t),r:fr,s:function(e,t){var n=nr(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(rr=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+nr(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)},hr=function(e){return e},pr=Array.prototype.map,mr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],gr=function(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?hr:(t=pr.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),o.push(e.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",u=void 0===e.numerals?hr:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(pr.call(e.numerals,String)),s=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=er(e)).fill,n=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,m=e.comma,g=e.precision,v=e.trim,y=e.type;"n"===y?(m=!0,y="g"):dr[y]||(void 0===g&&(g=12),v=!0,y="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===d?o:/[%p]/.test(y)?s:"",w=dr[y],E=/[defgprs%]/.test(y);function _(e){var i,o,s,d=b,_=x;if("c"===y)_=w(e)+_,e="";else{var A=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:w(Math.abs(e),g),v&&(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)),A&&0==+e&&"+"!==f&&(A=!1),d=(A?"("===f?f:l:"-"===f||"("===f?"":f)+d,_=("s"===y?mr[8+rr/3]:"")+_+(A&&"("===f?")":""),E)for(i=-1,o=e.length;++i(s=e.charCodeAt(i))||s>57){_=(46===s?a+e.slice(i+1):e.slice(i))+_,e=e.slice(0,i);break}}m&&!h&&(e=r(e,1/0));var k=d.length+e.length+_.length,C=k>1)+d+e+_+C.slice(k);break;default:e=C+d+e+_}return u(e)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),_.toString=function(){return e+""},_}return{format:f,formatPrefix:function(e,t){var n=f(((e=er(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(ur(t)/3))),i=Math.pow(10,-r),o=mr[8+r/3];return function(e){return n(i*e)+o}}}};function vr(e,t,n){return e.fields=t||[],e.fname=n,e}function yr(e){return 1===e.length?br(e[0]):xr(e)}ir=gr({thousands:",",grouping:[3],currency:["$",""]}),or=ir.format,ar=ir.formatPrefix;const br=e=>function(t){return t[e]},xr=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||wr("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&wr("Access path missing closing bracket: "+e),a&&wr("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function _r(e,t,n){const r=Er(e);return e=1===r.length?r[0]:e,vr((n&&n.get||yr)(r),[e],t||e)}_r("id"),vr(e=>e,[],"identity");const Ar=vr(()=>0,[],"zero"),kr=vr(()=>1,[],"one");vr(()=>!0,[],"true"),vr(()=>!1,[],"false");var Cr=Array.isArray;function Or(e){return e[e.length-1]}function Sr(e){return null!=e?Cr(e)?e:[e]:[]}function Dr(e){return"function"==typeof e}function Fr(e){for(let t,n,r=1,i=arguments.length;r0))return u;do{u.push(a=new Date(+n)),t(n,o),e(n)}while(a=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&&(i.count=function(t,r){return Nr.setTime(+t),Mr.setTime(+r),e(Nr),e(Mr),Math.floor(n(Nr,Mr))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Pr=Br(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5,e=>e.getDate()-1),Rr=Pr;Pr.range;function zr(e){return Br((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-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var Lr=zr(0),Ir=zr(1),Ur=zr(2),$r=zr(3),qr=zr(4),Wr=zr(5),Hr=zr(6),Vr=(Lr.range,Ir.range,Ur.range,$r.range,qr.range,Wr.range,Hr.range,Br((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}))),Yr=Vr;Vr.range;function Gr(e){return Br((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)/6048e5}))}var Xr=Gr(0),Kr=Gr(1),Jr=Gr(2),Qr=Gr(3),Zr=Gr(4),ei=Gr(5),ti=Gr(6),ni=(Xr.range,Kr.range,Jr.range,Qr.range,Zr.range,ei.range,ti.range,Br((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()})));ni.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Br((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};var ri=ni,ii=(ni.range,Br((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}))),oi=ii,ai=(ii.range,Br((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()}))),ui=ai,si=(ai.range,Br((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()}))),li=si,ci=(si.range,Br((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}))),fi=ci,di=(ci.range,Br((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e})));di.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?Br((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):di:null};var hi=di,pi=(di.range,Br((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()})));pi.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Br((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};var mi=pi,gi=(pi.range,Br((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()}))),vi=gi,yi=(gi.range,Br((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()}))),bi=yi,xi=(yi.range,Br((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()}))),wi=xi,Ei=(xi.range,function(e,t){return et?1:e>=t?0:NaN}),_i=function(e){let t=e,n=e;function r(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)=>Ei(e(t),n)}(e)),{left:r,center:function(e,n,i,o){null==i&&(i=0),null==o&&(o=e.length);const a=r(e,n,i,o-1);return a>i&&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}}};const Ai="year",ki="quarter",Ci="month",Oi="week",Si="date",Di="day",Fi="dayofyear",ji="hours",Ti="minutes",Ni="seconds",Mi="milliseconds",Bi=[Ai,ki,Ci,Oi,Si,Di,Fi,ji,Ti,Ni,Mi],Pi=Bi.reduce((e,t,n)=>(e[t]=1+n,e),{});function Ri(e){const t=Sr(e).slice(),n={};t.length||wr("Missing time unit."),t.forEach(e=>{Tr(Pi,e)?n[e]=1:wr("Invalid time unit: ".concat(e,"."))});return(n[Oi]||n[Di]?1:0)+(n[ki]||n[Ci]||n[Si]?1:0)+(n[Fi]?1:0)>1&&wr("Incompatible time units: ".concat(e)),t.sort((e,t)=>Pi[e]-Pi[t]),t}const zi={[Ai]:"%Y ",[ki]:"Q%q ",[Ci]:"%b ",[Si]:"%d ",[Oi]:"W%U ",[Di]:"%a ",[Fi]:"%j ",[ji]:"%H:00",[Ti]:"00:%M",[Ni]:":%S",[Mi]:".%L",["".concat(Ai,"-").concat(Ci)]:"%Y-%m ",["".concat(Ai,"-").concat(Ci,"-").concat(Si)]:"%Y-%m-%d ",["".concat(ji,"-").concat(Ti)]:"%H:%M"};function Li(e,t){const n=Fr({},zi,t),r=Ri(e),i=r.length;let o,a,u="",s=0;for(s=0;ss;--o)if(a=r.slice(s,o).join("-"),null!=n[a]){u+=n[a],s=o;break}return u.trim()}const Ii=new Date;function Ui(e){return Ii.setFullYear(e),Ii.setMonth(0),Ii.setDate(1),Ii.setHours(0,0,0,0),Ii}function $i(e){return Wi(new Date(e))}function qi(e){return Hi(new Date(e))}function Wi(e){return Rr.count(Ui(e.getFullYear())-1,e)}function Hi(e){return Lr.count(Ui(e.getFullYear())-1,e)}function Vi(e){return Ui(e).getDay()}function Yi(e,t,n,r,i,o,a){if(0<=e&&e<100){const u=new Date(-1,t,n,r,i,o,a);return u.setFullYear(e),u}return new Date(e,t,n,r,i,o,a)}function Gi(e){return Ki(new Date(e))}function Xi(e){return Ji(new Date(e))}function Ki(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Yr.count(t-1,e)}function Ji(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Xr.count(t-1,e)}function Qi(e){return Ii.setTime(Date.UTC(e,0,1)),Ii.getUTCDay()}function Zi(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 eo(e,t,n,r,i){const o=t||1,a=Or(e),u=(e,t,i)=>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[i=i||e],r[i],e===a&&o,t),s=new Date,l=function(e){const t={},n=e.length;for(let r=0;re}(2012),f=l[Ci]?u(Ci):l[ki]?u(ki):Ar,d=l[Oi]&&l[Di]?u(Di,1,Oi+Di):l[Oi]?u(Oi,1):l[Di]?u(Di,1):l[Si]?u(Si,1):l[Fi]?u(Fi,1):kr,h=l[ji]?u(ji):Ar,p=l[Ti]?u(Ti):Ar,m=l[Ni]?u(Ni):Ar,g=l[Mi]?u(Mi):Ar;return function(e){s.setTime(+e);const t=c(s);return i(t,f(s),d(s,t),h(s),p(s),m(s),g(s))}}function to(e,t,n){return t+7*e-(n+6)%7}const no={[Ai]:e=>e.getFullYear(),[ki]:e=>Math.floor(e.getMonth()/3),[Ci]:e=>e.getMonth(),[Si]:e=>e.getDate(),[ji]:e=>e.getHours(),[Ti]:e=>e.getMinutes(),[Ni]:e=>e.getSeconds(),[Mi]:e=>e.getMilliseconds(),[Fi]:e=>Wi(e),[Oi]:e=>Hi(e),[Oi+Di]:(e,t)=>to(Hi(e),e.getDay(),Vi(t)),[Di]:(e,t)=>to(1,e.getDay(),Vi(t))},ro={[ki]:e=>3*e,[Oi]:(e,t)=>to(e,0,Vi(t))};function io(e,t){return eo(e,t||1,no,ro,Yi)}const oo={[Ai]:e=>e.getUTCFullYear(),[ki]:e=>Math.floor(e.getUTCMonth()/3),[Ci]:e=>e.getUTCMonth(),[Si]:e=>e.getUTCDate(),[ji]:e=>e.getUTCHours(),[Ti]:e=>e.getUTCMinutes(),[Ni]:e=>e.getUTCSeconds(),[Mi]:e=>e.getUTCMilliseconds(),[Fi]:e=>Ki(e),[Oi]:e=>Ji(e),[Di]:(e,t)=>to(1,e.getUTCDay(),Qi(t)),[Oi+Di]:(e,t)=>to(Ji(e),e.getUTCDay(),Qi(t))},ao={[ki]:e=>3*e,[Oi]:(e,t)=>to(e,0,Qi(t))};function uo(e,t){return eo(e,t||1,oo,ao,Zi)}const so={[Ai]:ri,[ki]:oi.every(3),[Ci]:oi,[Oi]:Lr,[Si]:Rr,[Di]:Rr,[Fi]:Rr,[ji]:ui,[Ti]:li,[Ni]:fi,[Mi]:hi},lo={[Ai]:mi,[ki]:vi.every(3),[Ci]:vi,[Oi]:Xr,[Si]:Yr,[Di]:Yr,[Fi]:Yr,[ji]:bi,[Ti]:wi,[Ni]:fi,[Mi]:hi};function co(e){return so[e]}function fo(e){return lo[e]}function ho(e,t,n){return e?e.offset(t,n):void 0}function po(e,t,n){return ho(co(e),t,n)}function mo(e,t,n){return ho(fo(e),t,n)}function go(e,t,n,r){return e?e.range(t,n,r):void 0}function vo(e,t,n,r){return go(co(e),t,n,r)}function yo(e,t,n,r){return go(fo(e),t,n,r)}const bo=[Ai,Ci,Si,ji,Ti,Ni,Mi],xo=bo.slice(0,-1),wo=xo.slice(0,-1),Eo=wo.slice(0,-1),_o=Eo.slice(0,-1),Ao=[Ai,Ci],ko=[Ai],Co=[[xo,1,1e3],[xo,5,5e3],[xo,15,15e3],[xo,30,3e4],[wo,1,6e4],[wo,5,3e5],[wo,15,9e5],[wo,30,18e5],[Eo,1,36e5],[Eo,3,108e5],[Eo,6,216e5],[Eo,12,432e5],[_o,1,864e5],[[Ai,Oi],1,6048e5],[Ao,1,2592e6],[Ao,3,7776e6],[ko,1,31536e6]];function Oo(e){const t=e.extent,n=e.maxbins||40,r=Math.abs((i=t)&&Or(i)-i[0]||0)/n;var i;let o,a,u=_i(e=>e[2]).right(Co,r);return u===Co.length?(o=ko,a=Qn(t[0]/31536e6,t[1]/31536e6,n)):u?(u=Co[r/Co[u-1][2]function(t){return t[e]},jo=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||To("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&To("Access path missing closing bracket: "+e),a&&To("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function Mo(e,t,n){const r=No(e);return e=1===r.length?r[0]:e,So((n&&n.get||Do)(r),[e],t||e)}Mo("id"),So(e=>e,[],"identity"),So(()=>0,[],"zero"),So(()=>1,[],"one"),So(()=>!0,[],"true"),So(()=>!1,[],"false");Array.isArray;function Bo(e){return e===Object(e)}function Po(e){for(let t,n,r=1,i=arguments.length;r=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:su,s:lu,S:Da,u:Fa,U:ja,V:Na,w:Ma,W:Ba,x:null,X:null,y:Pa,Y:za,Z:Ia,"%":uu},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return u[e.getUTCMonth()]},c:null,d:Ua,e:Ua,f:Va,g:ru,G:ou,H:$a,I:qa,j:Wa,L:Ha,m:Ya,M:Ga,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:su,s:lu,S:Xa,u:Ka,U:Ja,V:Za,w:eu,W:tu,x:null,X:null,y:nu,Y:iu,Z:au,"%":uu},w={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return A(e,t,n,r)},d:fa,e:fa,f:va,g:ua,G:aa,H:ha,I:ha,j:da,L:ga,m:ca,M:pa,p:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:la,Q:ba,s:xa,S:ma,u:na,U:ra,V:ia,w:ta,W:oa,x:function(e,t,r){return A(e,n,t,r)},X:function(e,t,n){return A(e,r,t,n)},y:ua,Y:aa,Z:sa,"%":ya};function E(e,t){return function(n){var r,i,o,a=[],u=-1,s=0,l=e.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Lo(Io(o.y,0,1))).getUTCDay(),r=i>4||0===i?Kr.ceil(r):Kr(r),r=Yr.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=zo(Io(o.y,0,1))).getDay(),r=i>4||0===i?Ir.ceil(r):Ir(r),r=Rr.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Lo(Io(o.y,0,1)).getUTCDay():zo(Io(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Lo(o)):zo(o)}}function A(e,t,n,r){for(var i,o,a=0,u=t.length,s=n.length;a=s)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in Yo?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=E(n,b),b.X=E(r,b),b.c=E(t,b),x.x=E(n,x),x.X=E(r,x),x.c=E(t,x),{format:function(e){var t=E(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=_(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=E(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=_(e+="",!0);return t.toString=function(){return e},t}}}var $o,qo,Wo,Ho,Vo,Yo={"-":"",_:" ",0:"0"},Go=/^\s*\d+/,Xo=/^%/,Ko=/[\\^$*+?|[\]().{}]/g;function Jo(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[e.toLowerCase(),t]))}function ta(e,t,n){var r=Go.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function na(e,t,n){var r=Go.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function ra(e,t,n){var r=Go.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ia(e,t,n){var r=Go.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function oa(e,t,n){var r=Go.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function aa(e,t,n){var r=Go.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ua(e,t,n){var r=Go.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function sa(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 la(e,t,n){var r=Go.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function ca(e,t,n){var r=Go.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function fa(e,t,n){var r=Go.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function da(e,t,n){var r=Go.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ha(e,t,n){var r=Go.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function pa(e,t,n){var r=Go.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ma(e,t,n){var r=Go.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ga(e,t,n){var r=Go.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function va(e,t,n){var r=Go.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function ya(e,t,n){var r=Xo.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function ba(e,t,n){var r=Go.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function xa(e,t,n){var r=Go.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function wa(e,t){return Jo(e.getDate(),t,2)}function Ea(e,t){return Jo(e.getHours(),t,2)}function _a(e,t){return Jo(e.getHours()%12||12,t,2)}function Aa(e,t){return Jo(1+Rr.count(ri(e),e),t,3)}function ka(e,t){return Jo(e.getMilliseconds(),t,3)}function Ca(e,t){return ka(e,t)+"000"}function Oa(e,t){return Jo(e.getMonth()+1,t,2)}function Sa(e,t){return Jo(e.getMinutes(),t,2)}function Da(e,t){return Jo(e.getSeconds(),t,2)}function Fa(e){var t=e.getDay();return 0===t?7:t}function ja(e,t){return Jo(Lr.count(ri(e)-1,e),t,2)}function Ta(e){var t=e.getDay();return t>=4||0===t?qr(e):qr.ceil(e)}function Na(e,t){return e=Ta(e),Jo(qr.count(ri(e),e)+(4===ri(e).getDay()),t,2)}function Ma(e){return e.getDay()}function Ba(e,t){return Jo(Ir.count(ri(e)-1,e),t,2)}function Pa(e,t){return Jo(e.getFullYear()%100,t,2)}function Ra(e,t){return Jo((e=Ta(e)).getFullYear()%100,t,2)}function za(e,t){return Jo(e.getFullYear()%1e4,t,4)}function La(e,t){var n=e.getDay();return Jo((e=n>=4||0===n?qr(e):qr.ceil(e)).getFullYear()%1e4,t,4)}function Ia(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Jo(t/60|0,"0",2)+Jo(t%60,"0",2)}function Ua(e,t){return Jo(e.getUTCDate(),t,2)}function $a(e,t){return Jo(e.getUTCHours(),t,2)}function qa(e,t){return Jo(e.getUTCHours()%12||12,t,2)}function Wa(e,t){return Jo(1+Yr.count(mi(e),e),t,3)}function Ha(e,t){return Jo(e.getUTCMilliseconds(),t,3)}function Va(e,t){return Ha(e,t)+"000"}function Ya(e,t){return Jo(e.getUTCMonth()+1,t,2)}function Ga(e,t){return Jo(e.getUTCMinutes(),t,2)}function Xa(e,t){return Jo(e.getUTCSeconds(),t,2)}function Ka(e){var t=e.getUTCDay();return 0===t?7:t}function Ja(e,t){return Jo(Xr.count(mi(e)-1,e),t,2)}function Qa(e){var t=e.getUTCDay();return t>=4||0===t?Zr(e):Zr.ceil(e)}function Za(e,t){return e=Qa(e),Jo(Zr.count(mi(e),e)+(4===mi(e).getUTCDay()),t,2)}function eu(e){return e.getUTCDay()}function tu(e,t){return Jo(Kr.count(mi(e)-1,e),t,2)}function nu(e,t){return Jo(e.getUTCFullYear()%100,t,2)}function ru(e,t){return Jo((e=Qa(e)).getUTCFullYear()%100,t,2)}function iu(e,t){return Jo(e.getUTCFullYear()%1e4,t,4)}function ou(e,t){var n=e.getUTCDay();return Jo((e=n>=4||0===n?Zr(e):Zr.ceil(e)).getUTCFullYear()%1e4,t,4)}function au(){return"+0000"}function uu(){return"%"}function su(e){return+e}function lu(e){return Math.floor(+e/1e3)}function cu(e){const t={};return n=>t[n]||(t[n]=e(n))}function fu(e){const t=cu(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=er(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return function(e,t){return n=>{const r=e(n),i=r.indexOf(t);if(i<0)return r;let o=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}(r,i);const a=oi;)if("0"!==r[o]){++o;break}return r.slice(0,o)+a}}(t(n),t(".1f")(1)[1])}return t(n)},formatSpan(e,r,i,o){o=er(null==o?",f":o);const a=Qn(e,r,i),u=Math.max(Math.abs(e),Math.abs(r));let s;if(null==o.precision)switch(o.type){case"s":return isNaN(s=sr(a,u))||(o.precision=s),n(o,u);case"":case"e":case"g":case"p":case"r":isNaN(s=lr(a,u))||(o.precision=s-("e"===o.type));break;case"f":case"%":isNaN(s=cr(a))||(o.precision=s-2*("%"===o.type))}return t(o)}}}let du,hu;function pu(){return du=fu({format:or,formatPrefix:ar})}function mu(e){return fu(gr(e))}function gu(e){return arguments.length?du=mu(e):du}function vu(e,t,n){Bo(n=n||{})||To("Invalid time multi-format specifier: ".concat(n));const r=t(Ni),i=t(Ti),o=t(ji),a=t(Si),u=t(Oi),s=t(Ci),l=t(ki),c=t(Ai),f=e(n[Mi]||".%L"),d=e(n[Ni]||":%S"),h=e(n[Ti]||"%I:%M"),p=e(n[ji]||"%I %p"),m=e(n[Si]||n[Di]||"%a %d"),g=e(n[Oi]||"%b %d"),v=e(n[Ci]||"%B"),y=e(n[ki]||"%B"),b=e(n[Ai]||"%Y");return e=>(r(e)Ro(e)?t(e):vu(t,co,e),utcFormat:e=>Ro(e)?n(e):vu(n,fo,e),timeParse:cu(e.parse),utcParse:cu(e.utcParse)}}function bu(){return hu=yu({format:qo,parse:Wo,utcFormat:Ho,utcParse:Vo})}function xu(e){return yu(Uo(e))}function wu(e){return arguments.length?hu=xu(e):hu}!function(e){$o=Uo(e),qo=$o.format,Wo=$o.parse,Ho=$o.utcFormat,Vo=$o.utcParse}({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"]}),pu(),bu();const Eu=(e,t)=>Po({},e,t);function _u(e,t){const n=e?mu(e):gu(),r=t?xu(t):wu();return Eu(n,r)}function Au(e,t){const n=arguments.length;return n&&2!==n&&To("defaultLocale expects either zero or two arguments."),n?Eu(gu(e),wu(t)):Eu(gu(),wu())}function ku(){return pu(),bu(),Au()}var Cu=function(e,t,n,r){const i=Hn((t=t||{}).type||"json");return i||Object(un.a)("Unknown data format type: "+t.type),e=i(e,t),t.parse&&function(e,t,n,r){if(!e.length)return;const i=wu();n=n||i.timeParse,r=r||i.utcParse;let o,a,u,s,l,c,f=e.columns||Object.keys(e[0]);"auto"===t&&(t=En(e,f));f=Object.keys(t);const d=f.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(!yn[i])throw Error("Illegal format pattern: "+e+":"+i);return yn[i]});for(u=0,l=e.length,c=f.length;u({options:n||{},sanitize:dn,load:fn,fileAccess:!!t,file:hn(t),http:mn(e)})}("undefined"!=typeof fetch&&fetch,null);function Su(e){const t=e||Gt,n=[],r={};return n.add=e=>{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 Du(e,t){try{await t(e)}catch(t){e.error(t)}}const Fu=Symbol("vega_id");let ju=1;function Tu(e){return!(!e||!Nu(e))}function Nu(e){return e[Fu]}function Mu(e,t){return e[Fu]=t,e}function Bu(e){const t=e===Object(e)?e:{data:e};return Nu(t)?t:Mu(t,ju++)}function Pu(e){return Ru(e,Bu({}))}function Ru(e,t){for(const n in e)t[n]=e[n];return t}function zu(e,t){return Mu(t,Nu(e))}function Lu(e,t){return e?t?(n,r)=>e(n,r)||Nu(t(n))-Nu(t(r)):(t,n)=>e(t,n)||Nu(t)-Nu(n):null}function Iu(e){return e&&e.constructor===Uu}function Uu(){const e=[],t=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:Uu,insert(t){const n=Qt(t),r=n.length;for(let t=0;t{p(e)&&(l[Nu(e)]=-1)});for(f=0,d=e.length;f0&&(v(m,p,h.value),u.modifies(p));for(f=0,d=i.length;f{p(e)&&l[Nu(e)]>0&&v(e,h.field,h.value)}),u.modifies(h.field);if(a)u.mod=t.length||r.length?s.filter(e=>l[Nu(e)]>0):s.slice();else for(g in c)u.mod.push(c[g]);return(o||null==o&&(t.length||r.length))&&u.clean(!0),u}}}function $u(){Object.defineProperty(this,"_:mod:_",{writable:!0,value:{}})}$u.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]=Jt(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(Jt(e)){for(let t=0;t=0?t+1{a instanceof Hu?(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(u=e[a],"pulse"===a)Qt(u).forEach(e=>{e instanceof Hu?e!==this&&(e.targets().add(this),o.push(e)):Wt("Pulse parameters must be operator instances.")}),this.source=u;else if(Jt(u))for(r.set(a,-1,Array(s=u.length)),l=0;l{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Xu();return this.targets().add(Xu(null,null,function(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(t(r),n=null),e)}}(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(Xu(null,null,()=>n=!0)),t.targets().add(Xu(null,null,()=>n=!1)),this.filter(()=>n)},detach(){}};const Ku={skip:!0};function Ju(e,t,n,r,i,o){const a=tn({},o,Ku);let u,s;Zt(n)||(n=en(n)),void 0===r?u=t=>e.touch(n(t)):Zt(r)?(s=new Hu(null,r,i,!1),u=t=>{s.evaluate(t);const r=n(t),i=s.value;Iu(i)?e.pulse(r,i,o):e.update(r,i,a)}):u=t=>e.update(n(t),r,a),t.apply(u)}function Qu(e,t,n,r,i,o){if(void 0===r)t.targets().add(n);else{const a=o||{},u=new Hu(null,function(e,t){return t=Zt(t)?t:en(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);u.modified(a.force),u.rank=t.rank,t.targets().add(u),n&&(u.skip(!0),u.value=n.value,u.targets().add(n),e.connect(n,[u]))}}const Zu={};function es(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 ts(e,t){const n=[];return an(e,t,e=>n.push(e)),n}function ns(e,t){const n={};return e.visit(t,e=>{n[Nu(e)]=1}),e=>n[Nu(e)]?null:e}function rs(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}function is(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?Jt(e)?e.some(e=>n[e]):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=rs(n.addF,t)),2&e&&(n.remF=rs(n.remF,t)),4&e&&(n.modF=rs(n.modF,t)),16&e&&(n.srcF=rs(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=ts(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=ts(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=ts(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 an(n.source,n.srcF,r),n;1&e&&an(n.add,n.addF,r),2&e&&an(n.rem,n.remF,r),4&e&&an(n.mod,n.modF,r);const i=n.source;if(8&e&&i){const e=n.add.length+n.mod.length;e===i.length||an(i,e?ns(n,5):n.srcF,r)}return n}},on(is,es,{fork(e){const t=new es(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?Jt(e)?e.some(e=>n[e]):n[e]:0},filter(){Wt("MultiPulse does not support filtering.")},materialize(){Wt("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),ss(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,u=1+(t<<1);for(;u=0&&(u=a),e[t]=e[u],u=1+((t=u)<<1);e[t]=o,ss(e,r,t,n)}(t,0,e)):r=n,r}}}function ss(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 ls(){this.logger(function(e,t){let n=e||0;return{level(e){return arguments.length?(n=+e,this):n},error(){return n>=1&&Kt(t||"error","ERROR",arguments),this},warn(){return n>=2&&Kt(t||"warn","WARN",arguments),this},info(){return n>=3&&Kt(t||"log","INFO",arguments),this},debug(){return n>=4&&Kt(t||"log","DEBUG",arguments),this}}}()),this.logLevel(1),this._clock=0,this._rank=0,this._locale=Au();try{this._loader=Ou()}catch(e){}this._touched=Su(Yt),this._input={},this._pulse=null,this._heap=us((e,t)=>e.qrank-t.qrank),this._postrun=[]}function cs(e){return function(){return this._log[e].apply(this,arguments)}}function fs(e,t){Hu.call(this,e,null,t)}ls.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:cs("error"),warn:cs("warn"),info:cs("info"),debug:cs("debug"),logLevel:cs("level"),cleanThreshold:1e4,add:function(e,t,n,r){let i,o=1;return e instanceof Hu?i=e:e&&e.prototype instanceof Hu?i=new e:Zt(e)?i=new Hu(null,e):(o=0,i=new Hu(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&&Wt("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||as);const r=new es(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||as;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const r=n||as;return(e.set(t)||r.force)&&this.touch(e,r),this},changeset:Uu,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 Cu(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(Xt).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:Vn(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=Xu(n,r),a=function(e){e.dataflow=i;try{o.receive(e)}catch(e){i.error(e)}finally{i.run()}};let u;u="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):Qt(e);const s=u.length;for(let e=0;er._enqueue(e,!0)),r._touched=Su(Yt);let a,u,s,l=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(u=a.run(r._getPulse(a,e)),u.then?u=await u:u.async&&(i.push(u.async),u=Zu),u!==Zu&&a._targets&&a._targets.forEach(e=>r._enqueue(e)),++l):r._enqueue(a,!0)}catch(e){r._heap.clear(),s=e}if(r._input={},r._pulse=null,r.debug("Pulse ".concat(o,": ").concat(l," operators")),s&&(r._postrun=[],r.error(s)),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?os(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!==Zu&&(e.source=t.source);return e}(this._pulse,n&&n.pulse)}},on(fs,Hu,{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 ds={};function hs(e){const t=ps(e);return t&&t.Definition||null}function ps(e){return e=e&&e.toLowerCase(),rn(ds,e)?ds[e]:null}function ms(e,t,n){return e.fields=t||[],e.fname=n,e}function gs(e){return null==e?null:e.fname}function vs(e){return null==e?null:e.fields}function ys(e){return 1===e.length?bs(e[0]):xs(e)}const bs=e=>function(t){return t[e]},xs=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||ws("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&ws("Access path missing closing bracket: "+e),a&&ws("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function _s(e,t,n){const r=Es(e);return e=1===r.length?r[0]:e,ms((n&&n.get||ys)(r),[e],t||e)}_s("id");const As=ms(e=>e,[],"identity"),ks=ms(()=>0,[],"zero"),Cs=(ms(()=>1,[],"one"),ms(()=>!0,[],"true"));ms(()=>!1,[],"false");var Os=Array.isArray;function Ss(e){return e[e.length-1]}function Ds(e){return null==e||""===e?null:+e}function Fs(e){return null!=e?Os(e)?e:[e]:[]}function js(e){return"function"==typeof e}const Ts=(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),Ns=(e,t)=>1===e.length?Ms(e[0],t[0]):Bs(e,t,e.length),Ms=(e,t)=>function(n,r){return Ts(e(n),e(r))*t},Bs=(e,t,n)=>(t.push(0),function(r,i){let o,a=0,u=-1;for(;0===a&&++ue}function Rs(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]}const Ls=Object.prototype.hasOwnProperty;function Is(e,t){return Ls.call(e,t)}const Us={};function $s(e){let t,n={};function r(e){return Is(n,e)&&n[e]!==Us}const i={size:0,empty:0,object:n,has:r,get:e=>r(e)?n[e]:void 0,set(e,t){return r(e)||(++i.size,n[e]===Us&&--i.empty),n[e]=t,this},delete(e){return r(e)&&(--i.size,++i.empty,n[e]=Us),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===Us||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 qs(e,t,n){const r=e.prototype=Object.create(t.prototype);return r.constructor=e,Rs(r,n)}function Ws(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 Hs(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 Vs(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}var Ys=function(e){return null===e?NaN:+e};function Gs(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 Hs(e);if(t>=1)return Ws(e);var r,i=(r-1)*t,o=Math.floor(i),a=Ws(function e(t,n,r=0,i=t.length-1,o=Ei){for(;i>r;){if(i-r>600){const a=i-r+1,u=n-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(u-a/2<0?-1:1);e(t,n,Math.max(r,Math.floor(n-u*l/a+c)),Math.min(i,Math.floor(n+(a-u)*l/a+c)),o)}const a=t[n];let u=r,s=i;for(Vs(t,r,n),o(t[i],a)>0&&Vs(t,r,i);u0;)--s}0===o(t[r],a)?Vs(t,r,s):(++s,Vs(t,s,i)),s<=n&&(r=s+1),n<=s&&(i=s-1)}return t}(e,o).subarray(0,o+1));return a+(Hs(e.subarray(o+1))-a)*(i-o)}}function Xs(e,t,n=Ys){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 Ks=function(e,t){return Gs(e,.5,t)};function*Js(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 Qs(e,t,n){const r=Float64Array.from(Js(e,n));return r.sort(Ei),t.map(e=>Xs(r,e))}function Zs(e,t){return Qs(e,[.25,.5,.75],t)}function el(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 u of e)null!=(u=t(u,++a,e))&&(u=+u)>=u&&(n=u-i,i+=n/++r,o+=n*(u-i))}if(r>1)return o/(r-1)}(e,t);return n?Math.sqrt(n):n}(e,t),i=Zs(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 tl(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o,a,u,s,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(s=h/t,l=0,c=e.steps.length;lt;)o*=n;for(l=0,c=i.length;l=u&&h/s<=t&&(o=s)}s=Math.log(o);const p=s>=0?0:1+~~(-s/r),m=Math.pow(n,-p-1);return(e.nice||void 0===e.nice)&&(s=Math.floor(f/o+m)*o,f=fe);const i=e.length,o=new Float64Array(i);let a,u=0,s=1,l=r(e[0]),c=l,f=l+t;for(;s=f){for(c=(l+c)/2;u>1);ia;)e[i--]=e[o]}o=a,a=r}return e}(o,t+t/4):o}function al(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function ul(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*nl()),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 sl=Math.sqrt(2*Math.PI),ll=Math.SQRT2;let cl=NaN;function fl(e,t){e=e||0,t=null==t?1:t;let n,r,i=0,o=0;if(cl==cl)i=cl,cl=NaN;else{do{i=2*nl()-1,o=2*nl()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,cl=o*r}return e+i*t}function dl(e,t,n){const r=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*sl)}function hl(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 pl(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*ll*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 ml(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:()=>fl(n,r),pdf:e=>dl(e,n,r),cdf:e=>hl(e,n,r),icdf:e=>pl(e,n,r)};return i.mean(e).stdev(t)}function gl(e,t){const n=ml();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=el(e)),i):t},sample:()=>e[~~(nl()*r)]+t*n.sample(),pdf(i){let o=0,a=0;for(;avl(n,r),pdf:e=>yl(e,n,r),cdf:e=>bl(e,n,r),icdf:e=>xl(e,n,r)};return i.mean(e).stdev(t)}function El(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 kl(e,t,n){return null==n&&(n=null==t?1:t,t=0),en?1:(e-t)/(n-t)}function Cl(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function Ol(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:()=>_l(n,r),pdf:e=>Al(e,n,r),cdf:e=>kl(e,n,r),icdf:e=>Cl(e,n,r)};return null==t&&(t=null==e?1:e,e=0),i.min(e).max(t)}function Sl(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 Dl(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 u,s,l,c=0,f=0,d=0;for(l of e)o[c]=u=+t(l),a[c]=s=+n(l),++c,f+=(u-f)/c,d+=(s-d)/c;for(c=0;c=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function jl(e,t,n,r,i){let o=0,a=0;return Fl(e,t,n,(e,t)=>{const n=t-i(e),u=t-r;o+=n*n,a+=u*u}),1-o/a}function Tl(e,t,n){let r=0,i=0,o=0,a=0,u=0;Fl(e,t,n,(e,t)=>{++u,r+=(e-r)/u,i+=(t-i)/u,o+=(e*t-o)/u,a+=(e*e-a)/u});const s=Sl(r,i,o,a),l=e=>s[0]+s[1]*e;return{coef:s,predict:l,rSquared:jl(e,t,n,i,l)}}function Nl(e,t,n){let r=0,i=0,o=0,a=0,u=0;Fl(e,t,n,(e,t)=>{++u,e=Math.log(e),r+=(e-r)/u,i+=(t-i)/u,o+=(e*t-o)/u,a+=(e*e-a)/u});const s=Sl(r,i,o,a),l=e=>s[0]+s[1]*Math.log(e);return{coef:s,predict:l,rSquared:jl(e,t,n,i,l)}}function Ml(e,t,n){const[r,i,o,a]=Dl(e,t,n);let u,s,l,c=0,f=0,d=0,h=0,p=0;Fl(e,t,n,(e,t)=>{u=r[p++],s=Math.log(t),l=u*t,c+=(t*s-c)/p,f+=(l-f)/p,d+=(l*s-d)/p,h+=(u*l-h)/p});const[m,g]=Sl(f/a,c/a,d/a,h/a),v=e=>Math.exp(m+g*(e-o));return{coef:[Math.exp(m-g*o),g],predict:v,rSquared:jl(e,t,n,a,v)}}function Bl(e,t,n){let r=0,i=0,o=0,a=0,u=0,s=0;Fl(e,t,n,(e,t)=>{const n=Math.log(e),l=Math.log(t);++s,r+=(n-r)/s,i+=(l-i)/s,o+=(n*l-o)/s,a+=(n*n-a)/s,u+=(t-u)/s});const l=Sl(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:jl(e,t,n,u,c)}}function Pl(e,t,n){const[r,i,o,a]=Dl(e,t,n),u=r.length;let s,l,c,f,d=0,h=0,p=0,m=0,g=0;for(s=0;sb*(e-=o)*e+x*e+w+a;return{coef:[w-x*o+b*o*o+a,x-2*b*o,b],predict:E,rSquared:jl(e,t,n,a,E)}}function Rl(e,t,n,r){if(1===r)return Tl(e,t,n);if(2===r)return Pl(e,t,n);const[i,o,a,u]=Dl(e,t,n),s=i.length,l=[],c=[],f=r+1;let d,h,p,m,g;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(u=0,o=i+1;o{e-=a;let t=u+v[0]+v[1]*e+v[2]*e*e;for(d=3;d=0;--o)for(u=t[o],s=1,i[o]+=u,a=1;a<=o;++a)s*=(o+1-a)/a,i[o-a]+=u*Math.pow(n,a)*s;return i[0]+=r,i}function Ll(e,t,n,r){const[i,o,a,u]=Dl(e,t,n,!0),s=i.length,l=Math.max(2,~~(r*s)),c=new Float64Array(s),f=new Float64Array(s),d=new Float64Array(s).fill(1);for(let e=-1;++e<=2;){const t=[0,l-1];for(let e=0;ei[a]-n?r:a;let s=0,l=0,h=0,p=0,m=0;const g=1/Math.abs(i[u]-n||1);for(let e=r;e<=a;++e){const t=i[e],r=o[e],a=Il(Math.abs(n-t)*g)*d[e],u=t*a;s+=a,l+=u,h+=r*a,p+=r*u,m+=t*u}const[v,y]=Sl(l/s,h/s,p/s,m/s);c[e]=v+y*n,f[e]=Math.abs(o[e]-c[e]),Ul(i,e+1,t)}if(2===e)break;const n=Ks(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,u=0,s=0,l=[];for(;u=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}const $l=.1*Math.PI/180;function ql(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],u=a-o,s=u/r,l=[i(o)],c=[];if(n===r){for(let e=1;e0;)c.push(i(o+e/n*u));let f=l[0],d=c[c.length-1];for(;d;){const e=i((f[0]+d[0])/2);e[0]-f[0]>=s&&Wl(f,e,d)>$l?c.push(e):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function Wl(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 Hl=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{},Xl={init:Gl,add:Gl,rem:Gl,idx:0},Kl={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}},Jl=Object.keys(Kl);function Ql(e,t){return Kl[e](t)}function Zl(e,t){return e.idx-t.idx}function ec(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.init(this))}function tc(e,t){null!=e&&""!==e?e==e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t))):++this.missing}function nc(e,t){null!=e&&""!==e?e==e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t))):--this.missing}function rc(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function ic(e,t){const n=t||As,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]=Kl[e]())})};return e.forEach(n),Object.values(t).sort(Zl)}(e),i=e.slice().sort(Zl);function o(e){this._ops=r,this._out=i,this.cell=e,this.init()}return o.prototype.init=ec,o.prototype.add=tc,o.prototype.rem=nc,o.prototype.set=rc,o.prototype.get=n,o.fields=e.map(e=>e.out),o}function oc(e){this._key=e?_s(e):Nu,this.reset()}Jl.forEach(e=>{Kl[e]=function(e,t){return n=>Rs({name:e,out:n||e},Xl,t)}(e,Kl[e])});const ac=oc.prototype;function uc(e){fs.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}ac.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},ac.add=function(e){this._add.push(e)},ac.rem=function(e){this._rem.push(e)},ac.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 u,s,l;for(u=0;u=0;)r=e(t[i])+"",Is(n,r)||(n[r]=1,++o);return o},ac.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=function(e,t){const n=e.length;let r,i,o,a,u,s=-1;if(null==t){for(;++s=i){r=o=i;break}if(s===n)return[-1,-1];for(a=u=s;++si&&(r=i,a=s),o=i){r=o=i;break}if(s===n)return[-1,-1];for(a=u=s;++si&&(r=i,a=s),on.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,u;for(t in e)for(a=e[t].tuple,o=0;o{const t=gs(e);return i(e),n.push(t),t}),this.cellkey=e.key?e.key:Vl(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],a=e.ops||["count"],u=e.as||[],s=o.length,l={};let c,f,d,h,p,m;for(s!==a.length&&ws("Unmatched number of fields and aggregate ops."),m=0;mic(e,e.field)),{}},cellkey:Vl(),cell(e,t){let n=this.value[e];return n?0===n.num&&this._drop&&n.stampo.push(e),remove:e=>a[r(e)]=++u,size:()=>i.length,data:(e,t)=>(u&&(i=i.filter(e=>!a[r(e)]),a={},u=0),t&&e&&i.sort(e),o.length&&(i=e?function(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 u=0,s=0,l=0;for(;u0?n[s++]:t[u++];for(;u{null!=e&&(r.push("descending"===t[a]?-1:1),i.push(e=js(e)?e:_s(e,null,n)),(vs(e)||[]).forEach(e=>o[e]=1))}),0===i.length?null:ms(a(i,r),Object.keys(o))}(e.fields,e.orders)}function hc(e){fs.call(this,null,e)}function pc(e){fs.call(this,null,e)}sc.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"]}]},qs(sc,fs,{transform(e,t){const n=!1!==e.interval,r=this._bins(e),i=r.start,o=r.step,a=e.as||["bin0","bin1"],u=a[0],s=a[1];let l;return l=e.modified()?(t=t.reflow(!0)).SOURCE:t.modified(vs(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?e=>{const t=r(e);e[u]=t,e[s]=null==t?null:i+o*(1+(t-i)/o)}:e=>e[u]=r(e)),t.modifies(n?a:u)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=tl(e),r=n.step;let i,o,a=n.start,u=a+Math.ceil((n.stop-a)/r)*r;null!=(i=e.anchor)&&(o=i-(a+r*Math.floor((i-a)/r)),a+=o,u+=o);const s=function(e){let n=Ds(t(e));return null==n?null:nu?1/0:(n=Math.max(a,Math.min(n,u-r)),a+r*Math.floor(1e-14+(n-a)/r))};return s.start=a,s.stop=n.stop,s.step=r,this.value=ms(s,vs(t),e.name||"bin_"+gs(t))}}),cc.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},qs(cc,fs,{transform(e,t){const n=t.fork(t.ALL),r=lc(Nu,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(Lu(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),qs(fc,Hu),hc.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"]}]},qs(hc,fs,{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)}(u(n),e.case,o)||[],s=0,l=i.length;si[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,s)},_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 u,s,l;for(u in n)s=r[u],l=n[u]||0,!s&&l?(r[u]=s=Bu({}),s[i]=u,s[o]=l,a.add.push(s)):0===l?(s&&a.rem.push(s),n[u]=null,r[u]=null):s[o]!==l&&(s[o]=l,a.mod.push(s));return a.modifies(t)}}),pc.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},qs(pc,fs,{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 u=this.value;return a?(u&&(n.rem=u),u=t.materialize(t.SOURCE).source,n.add=this.value=function(e,t,n,r){for(var i,o,a=[],u={},s=e.length,l=0;lt[n]||gs(e)):null}function xc(e,t,n){const r=[],i=e=>e(s);let o,a,u,s,l,c;if(null==t)r.push(e.map(n));else for(o={},a=0,u=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&&ws("Invalid density method: "+a),e.extent||r.data||ws("Missing density extent parameter."),a=r[a];const u=e.as||["value","density"],s=ql(a,e.extent||zs(r.data()),i,o).map(e=>{const t={};return t[u[0]]=e[0],t[u[1]]=e[1],Bu(t)});this.value&&(n.rem=this.value),this.value=n.add=n.source=s}return n}});function wc(e){fs.call(this,null,e)}wc.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"}]};const Ec=(e,t)=>{return((n=zs(e,t))&&Ss(n)-n[0]||0)/30;var n};function _c(e){Hu.call(this,null,Ac,e),this.modified(!0)}function Ac(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:ms(n=>t(n,e),vs(t),gs(t))}function kc(e){fs.call(this,[void 0,void 0],e)}function Cc(e,t){Hu.call(this,e),this.parent=t,this.count=0}function Oc(e){fs.call(this,{},e),this._keys=$s();const t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,r=t.active;n_s(e)):_s(e.name,e.as)}function Fc(e){fs.call(this,$s(),e)}function jc(e){fs.call(this,[],e)}function Tc(e){fs.call(this,[],e)}function Nc(e){fs.call(this,null,e)}function Mc(e){fs.call(this,[],e)}qs(wc,fs,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,r=xc(t.source,e.groupby,As),i=e.smooth||!1,o=e.field,a=e.step||Ec(n,o),u=Lu((e,t)=>o(e)-o(t)),s=e.as||"bin",l=r.length;let c,f=1/0,d=-1/0,h=0;for(;hd&&(d=t),e[++c][s]=t}return this.value={start:f,stop:d,step:a},t.reflow(!0).modifies(s)}}),qs(_c,Hu),kc.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},qs(kc,fs,{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=Ds(r(e));null!=t&&(ta&&(a=t))}),!Number.isFinite(o)||!Number.isFinite(a)){let e=gs(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]}}),qs(Cc,Hu,{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}}),qs(Oc,fs,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){const i=this.value;let o,a,u=Is(i,e)&&i[e];return u?u.value.stampthis.subflow(e,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,e=>{const t=Nu(e),n=o.get(t);void 0!==n&&(o.delete(t),u(n).rem(e))}),t.visit(t.ADD,e=>{const t=r(e);o.set(Nu(e),t),u(t).add(e)}),a||t.modified(r.fields)?t.visit(t.MOD,e=>{const t=Nu(e),n=o.get(t),i=r(e);n===i?u(i).mod(e):(o.set(t,i),u(n).rem(e),u(i).add(e))}):t.changed(t.MOD)&&t.visit(t.MOD,e=>{u(o.get(Nu(e))).mod(e)}),a&&t.visit(t.REFLOW,e=>{const t=Nu(e),n=o.get(t),i=r(e);n!==i&&(o.set(t,i),u(n).rem(e),u(i).add(e))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}}),qs(Sc,Hu),Fc.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},qs(Fc,fs,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,a=i.rem,u=i.mod,s=e.expr;let l=!0;function c(t){const n=Nu(t),i=s(t,e),c=r.get(n);i&&c?(r.delete(n),o.push(t)):i||c?l&&i&&!c&&u.push(t):(r.set(n,1),a.push(t))}return t.visit(t.REM,e=>{const t=Nu(e);r.has(t)?r.delete(t):a.push(e)}),t.visit(t.ADD,t=>{s(t,e)?o.push(t):r.set(Nu(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}}),jc.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}]},qs(jc,fs,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=bc(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)),u=t.reduce((e,t)=>Math.max(e,t.length),0);let s,l,c,f=0;for(;f{for(let t,o=0;ot[r]=n(t,e))}}),qs(Mc,fs,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i,o,a,u=this.value,s=e.size-u.length;if(s>0){for(i=[];--s>=0;)i.push(a=Bu(r(e))),u.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=u.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,u=u.slice(-s);return n.source=this.value=u,n}});const Bc={value:"value",median:Ks,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:Hs,max:Ws},Pc=[];function Rc(e){fs.call(this,[],e)}function zc(e){uc.call(this,e)}function Lc(e){fs.call(this,null,e)}function Ic(e){Hu.call(this,null,Uc,e)}function Uc(e){return this.value&&!e.modified()?this.value:function(e,t,n){e&&(e=t?Fs(e).map(e=>e.replace(/\\(.)/g,"$1")):Fs(e));const r=e&&e.length,i=n&&n.get||ys,o=e=>i(t?[e]:Es(e));let a;if(r)if(1===r){const t=o(e[0]);a=function(e){return""+t(e)}}else{const t=e.map(o);a=function(e){let n=""+t[0](e),i=0;for(;++ia&&(a=i[1]);return[o,a]}function Yc(e){Hu.call(this,null,Gc,e)}function Gc(e){return this.value&&!e.modified()?this.value:e.values.reduce((e,t)=>e.concat(t),[])}function Xc(e){fs.call(this,null,e)}function Kc(e){uc.call(this,e)}function Jc(e){Oc.call(this,e)}function Qc(e){fs.call(this,null,e)}function Zc(e){fs.call(this,null,e)}function ef(e){fs.call(this,null,e)}Rc.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}]},qs(Rc,fs,{transform(e,t){var n,r,i,o,a,u,s,l,c,f,d=t.fork(t.ALL),h=function(e){var t,n=e.method||Bc.value;if(null!=Bc[n])return n===Bc.value?(t=void 0!==e.value?e.value:0,()=>t):Bc[n];ws("Unrecognized imputation method: "+n)}(e),p=function(e){const t=e.field;return e=>e?t(e):NaN}(e),m=gs(e.field),g=gs(e.key),v=(e.groupby||[]).map(gs),y=function(e,t,n,r){var i,o,a,u,s,l,c,f,d=e=>e(f),h=[],p=r?r.slice():[],m={},g={};for(p.forEach((e,t)=>m[e]=t+1),u=0,c=e.length;un.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=>{Rs(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=gl(t,a)[u],r=e.counts?t.length:1;ql(n,c||zs(t),f,d).forEach(e=>{const n={};for(let e=0;e(this._pending=Fs(e.data),e=>e.touch(this)))}}return n.request(e.url,e.format).then(e=>qc(this,t,Fs(e.data)))}}),Wc.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}]},qs(Wc,fs,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=null==e.default?null:e.default,a=e.modified(),u=n.length;let s,l,c,f=a?t.SOURCE:t.ADD,d=t,h=e.as;return i?(l=i.length,u>1&&!h&&ws('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==u*l&&ws('The "as" parameter has too few output field names.'),h=h||i.map(gs),s=function(e){for(var t,a,s=0,c=0;st.modified(e.fields)),f|=c?t.MOD:0),t.visit(f,s),d.modifies(h)}}),qs(Hc,Hu),qs(Yc,Hu),qs(Xc,fs,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),Kc.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:Jl,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},qs(Kc,uc,{_transform:uc.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=vs(n).concat(vs(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(Ts),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 ms(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)}}),qs(Jc,Oc,{transform(e,t){const n=e.subflow,r=e.field,i=e=>this.subflow(Nu(e),n,t,e);return(e.modified("field")||r&&t.modified(vs(r)))&&ws("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(Bu(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}}),Qc.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},qs(Qc,fs,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=bc(e.fields,e.as||[]),o=r?(e,t)=>function(e,t,n,r){for(let i=0,o=n.length;i{const t=Nu(e);n.rem.push(a[t]),a[t]=null}),t.visit(t.ADD,e=>{const t=o(e,Bu({}));a[Nu(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{n.mod.push(o(e,a[Nu(e)]))}),n}}),qs(Zc,fs,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),ef.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 tf(e){fs.call(this,null,e)}function nf(e){fs.call(this,[],e),this.count=0}function rf(e){fs.call(this,null,e)}function of(e){fs.call(this,null,e),this.modified(!0)}function af(e){fs.call(this,null,e)}qs(ef,fs,{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=xc(t.materialize(t.SOURCE).source,e.groupby,e.field),o=(e.groupby||[]).map(gs),a=[],u=e.step||.01,s=e.probs||Hl(u/2,1-1e-14,u),l=s.length;return i.forEach(e=>{const t=Qs(e,s);for(let n=0;n{const t=Nu(e);n.rem.push(r[t]),r[t]=null}),t.visit(t.ADD,e=>{const t=Pu(e);r[Nu(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{const t=r[Nu(e)];for(const r in e)t[r]=e[r],n.modifies(r);n.mod.push(t)})),n}}),nf.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},qs(nf,fs,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce((e,t)=>(e[Nu(t)]=1,e),{});let a=this.value,u=this.count,s=0;function l(e){let t,r;a.length=s&&(t=a[r],o[Nu(t)]&&n.rem.push(t),a[r]=e)),++u}if(t.rem.length&&(t.visit(t.REM,e=>{const t=Nu(e);o[t]&&(o[t]=-1,n.rem.push(e)),--u}),a=a.filter(e=>-1!==o[Nu(e)])),(t.rem.length||r)&&a.length{o[Nu(e)]||l(e)}),s=-1),r&&a.length>i){const e=a.length-i;for(let t=0;t{o[Nu(e)]&&n.mod.push(e)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||s<0)&&(n.add=a.filter(e=>!o[Nu(e)])),this.count=u,this.value=n.source=a,n}}),rf.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"}]},qs(rf,fs,{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=Hl(e.start,e.stop,e.step||1).map(e=>{const t={};return t[r]=e,Bu(t)}),n.add=t.add.concat(this.value),n}}),qs(of,fs,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const uf=["unit0","unit1"];function sf(e){fs.call(this,$s(),e)}function lf(e){fs.call(this,null,e)}af.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Bi,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:uf}]},qs(af,fs,{transform(e,t){const n=e.field,r=!1!==e.interval,i="utc"===e.timezone,o=this._floor(e,t),a=(i?fo:co)(o.unit).offset,u=e.as||uf,s=u[0],l=u[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.modified(vs(n)))&&(h=(t=t.reflow(!0)).SOURCE,f=1/0,d=-1/0),t.visit(h,e=>{const t=n(e);let i,u;null==t?(e[s]=null,r&&(e[l]=null)):(e[s]=i=u=o(t),r&&(e[l]=u=a(i,c)),id&&(d=u))}),o.start=f,o.stop=d,t.modifies(r?u:s)},_floor(e,t){const n="utc"===e.timezone,{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:Oo({extent:e.extent||zs(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Ri(r),a=this.value||{},u=(n?uo:io)(o,i);return u.unit=Ss(o),u.units=o,u.step=i,u.start=a.start,u.stop=a.stop,this.value=u}}),qs(sf,fs,{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()}}),qs(lf,fs,{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(Lu(e.sort)):t.source).map(e.field))}});const cf={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=cf.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||ws("ntile num must be greater than zero.");const n=cf.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||ws("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;nu[e]=1)}d(e.sort),t.forEach((e,t)=>{const u=n[t],h=gs(u),p=Yl(e,h,i[t]);if(d(u),o.push(p),Is(cf,e))a.push(function(e,t,n,r){const i=cf[e](t,n);return{init:i.init||ks,update:function(e,t){t[r]=i.next(e)}}}(e,n[t],r[t],p));else{if(null==u&&"count"!==e&&ws("Null aggregate field specified."),"count"===e)return void l.push(p);f=!1;let t=s[h];t||(t=s[h]=[],t.field=u,c.push(t)),t.push(Ql(e,p))}}),(l.length||c.length)&&(this.cell=function(e,t,n){e=e.map(e=>ic(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()},hf.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 df(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;tfunction(t){return t[e]},wf=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||Ef("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&Ef("Access path missing closing bracket: "+e),a&&Ef("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function Af(e,t,n){const r=_f(e);return e=1===r.length?r[0]:e,yf((n&&n.get||bf)(r),[e],t||e)}Af("id"),yf(e=>e,[],"identity"),yf(()=>0,[],"zero"),yf(()=>1,[],"one");const kf=yf(()=>!0,[],"true");yf(()=>!1,[],"false");var Cf=Array.isArray;function Of(e){return e===Object(e)}function Sf(e){return e[e.length-1]}function Df(e){return null!=e?Cf(e)?e:[e]:[]}function Ff(e){return"function"==typeof e}function jf(e){for(let t,n,r=1,i=arguments.length;r0)for(var r,i=e[0],o=t[0],a=e[n]-i,u=t[n]-o,s=-1;++s<=n;)r=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(i+r*a),this._beta*t[s]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var $f=function e(t){function n(e){return 1===t?new Rf(e):new Uf(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function qf(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 Wf(e,t){this._context=e,this._k=(1-t)/6}Wf.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:qf(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:qf(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 Hf=function e(t){function n(e){return new Wf(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Vf(e,t){this._context=e,this._k=(1-t)/6}Vf.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:qf(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 Yf=function e(t){function n(e){return new Vf(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Gf(e,t){this._context=e,this._k=(1-t)/6}Gf.prototype={areaStart:zf,areaEnd:zf,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:qf(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 Xf=function e(t){function n(e){return new Gf(e,t)}return n.tension=function(t){return e(+t)},n}(0),Kf=Math.abs,Jf=Math.atan2,Qf=Math.cos,Zf=Math.max,ed=Math.min,td=Math.sin,nd=Math.sqrt,rd=Math.PI,id=rd/2,od=2*rd;function ad(e){return e>1?0:e<-1?rd:Math.acos(e)}function ud(e){return e>=1?id:e<=-1?-id:Math.asin(e)}function sd(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>1e-12){var u=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,s=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*u-e._x0*e._l12_2a+e._x2*e._l01_2a)/s,i=(i*u-e._y0*e._l12_2a+e._y2*e._l01_2a)/s}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 ld(e,t){this._context=e,this._alpha=t}ld.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:sd(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 cd=function e(t){function n(e){return t?new ld(e,t):new Wf(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function fd(e,t){this._context=e,this._alpha=t}fd.prototype={areaStart:zf,areaEnd:zf,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:sd(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 dd=function e(t){function n(e){return t?new fd(e,t):new Gf(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function hd(e,t){this._context=e,this._alpha=t}hd.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:sd(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 pd=function e(t){function n(e){return t?new hd(e,t):new Vf(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function md(e){this._context=e}md.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 gd=function(e){return new md(e)};function vd(e){this._context=e}vd.prototype={areaStart:zf,areaEnd:zf,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 yd(e){return e<0?-1:1}function bd(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),u=(o*i+a*r)/(r+i);return(yd(o)+yd(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function xd(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function wd(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,u=(o-r)/3;e._context.bezierCurveTo(r+u,i+u*t,o-u,a-u*n,o,a)}function Ed(e){this._context=e}function _d(e){this._context=new Ad(e)}function Ad(e){this._context=e}function kd(e){this._context=e}function Cd(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 Sd=Math.PI,Dd=2*Sd,Fd=Dd-1e-6;function jd(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Td(){return new jd}jd.prototype=Td.prototype={constructor:jd,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,u=n-e,s=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*u-s*l)>1e-6&&i){var d=n-o,h=r-a,p=u*u+s*s,m=d*d+h*h,g=Math.sqrt(p),v=Math.sqrt(f),y=i*Math.tan((Sd-Math.acos((p+f-m)/(2*g*v)))/2),b=y/v,x=y/g;Math.abs(b-1)>1e-6&&(this._+="L"+(e+b*l)+","+(t+b*c)),this._+="A"+i+","+i+",0,0,"+ +(c*d>l*h)+","+(this._x1=e+x*u)+","+(this._y1=t+x*s)}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),u=n*Math.sin(r),s=e+a,l=t+u,c=1^o,f=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+l:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+s+","+l),n&&(f<0&&(f=f%Dd+Dd),f>Fd?this._+="A"+n+","+n+",0,1,"+c+","+(e-a)+","+(t-u)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=l):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=Sd)+","+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 Nd=Td,Md=function(e){return function(){return e}};function Bd(e){return e.innerRadius}function Pd(e){return e.outerRadius}function Rd(e){return e.startAngle}function zd(e){return e.endAngle}function Ld(e){return e&&e.padAngle}function Id(e,t,n,r,i,o,a,u){var s=n-e,l=r-t,c=a-i,f=u-o,d=f*s-c*l;if(!(d*d<1e-12))return[e+(d=(c*(t-o)-f*(e-i))/d)*s,t+d*l]}function Ud(e,t,n,r,i,o,a){var u=e-n,s=t-r,l=(a?o:-o)/nd(u*u+s*s),c=l*s,f=-l*u,d=e+c,h=t+f,p=n+c,m=r+f,g=(d+p)/2,v=(h+m)/2,y=p-d,b=m-h,x=y*y+b*b,w=i-o,E=d*m-p*h,_=(b<0?-1:1)*nd(Zf(0,w*w*x-E*E)),A=(E*b-y*_)/x,k=(-E*y-b*_)/x,C=(E*b+y*_)/x,O=(-E*y+b*_)/x,S=A-g,D=k-v,F=C-g,j=O-v;return S*S+D*D>F*F+j*j&&(A=C,k=O),{cx:A,cy:k,x01:-c,y01:-f,x11:A*(i/w-1),y11:k*(i/w-1)}}Array.prototype.slice;var $d=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)};function qd(e){return e[0]}function Wd(e){return e[1]}var Hd=function(e,t){var n=Md(!0),r=null,i=gd,o=null;function a(a){var u,s,l,c=(a=$d(a)).length,f=!1;for(null==r&&(o=i(l=Nd())),u=0;u<=c;++u)!(u=c;--f)u.point(g[f],v[f]);u.lineEnd(),u.areaEnd()}m&&(g[l]=+e(d,l,s),v[l]=+t(d,l,s),u.point(r?+r(d,l,s):g[l],n?+n(d,l,s):v[l]))}if(h)return u=null,h+""||null}function l(){return Hd().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?qd:Md(+e),t="function"==typeof t?t:Md(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?Wd:Md(+n),s.x=function(t){return arguments.length?(e="function"==typeof t?t:Md(+t),r=null,s):e},s.x0=function(t){return arguments.length?(e="function"==typeof t?t:Md(+t),s):e},s.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:Md(+e),s):r},s.y=function(e){return arguments.length?(t="function"==typeof e?e:Md(+e),n=null,s):t},s.y0=function(e){return arguments.length?(t="function"==typeof e?e:Md(+e),s):t},s.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:Md(+e),s):n},s.lineX0=s.lineY0=function(){return l().x(e).y(t)},s.lineY1=function(){return l().x(e).y(n)},s.lineX1=function(){return l().x(r).y(t)},s.defined=function(e){return arguments.length?(i="function"==typeof e?e:Md(!!e),s):i},s.curve=function(e){return arguments.length?(a=e,null!=o&&(u=a(o)),s):a},s.context=function(e){return arguments.length?(null==e?o=u=null:u=a(o=e),s):o},s},Yd={draw:function(e,t){var n=Math.sqrt(t/rd);e.moveTo(n,0),e.arc(0,0,n,0,od)}},Gd=(Math.sqrt(1/3),Math.sin(rd/10)/Math.sin(7*rd/10));Math.sin(od/10),Math.cos(od/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12);function Xd(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 Kd=()=>"undefined"!=typeof Image?Image:null;function Jd(e,t,n){return e.fields=t||[],e.fname=n,e}function Qd(e){return 1===e.length?Zd(e[0]):eh(e)}const Zd=e=>function(t){return t[e]},eh=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||th("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&th("Access path missing closing bracket: "+e),a&&th("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function rh(e,t,n){const r=nh(e);return e=1===r.length?r[0]:e,Jd((n&&n.get||Qd)(r),[e],t||e)}rh("id"),Jd(e=>e,[],"identity"),Jd(()=>0,[],"zero"),Jd(()=>1,[],"one"),Jd(()=>!0,[],"true"),Jd(()=>!1,[],"false");var ih=Array.isArray;function oh(e){return e===Object(e)}function ah(e){return e[e.length-1]}function uh(e){return null==e||""===e?null:+e}function sh(e){return null!=e?ih(e)?e:[e]:[]}function lh(e){return"function"==typeof e}const ch=Object.prototype.hasOwnProperty;function fh(e,t){return ch.call(e,t)}function dh(e){return"number"==typeof e}function hh(e){return"string"==typeof e}const ph=_i(Ei),mh=ph.right,gh=ph.left;_i(Ys).center;var vh=mh;function yh(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function bh(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 xh=Symbol("implicit");function wh(){var e=new Map,t=[],n=[],r=xh;function i(i){var o=i+"",a=e.get(o);if(!a){if(r!==xh)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 wh(t,n).unknown(r)},yh.apply(i,arguments),i}function Eh(e,t,n,r){var i,o=Qn(e,t,n);switch((r=er(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=sr(o,a))||(r.precision=i),ar(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=lr(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=cr(o))||(r.precision=i-2*("%"===r.type))}return or(r)}var _h=function(e,t,n){e.prototype=t.prototype=n,n.constructor=e};function Ah(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function kh(){}var Ch="\\s*([+-]?\\d+)\\s*",Oh="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Sh="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Dh=/^#([0-9a-f]{3,8})$/,Fh=new RegExp("^rgb\\("+[Ch,Ch,Ch]+"\\)$"),jh=new RegExp("^rgb\\("+[Sh,Sh,Sh]+"\\)$"),Th=new RegExp("^rgba\\("+[Ch,Ch,Ch,Oh]+"\\)$"),Nh=new RegExp("^rgba\\("+[Sh,Sh,Sh,Oh]+"\\)$"),Mh=new RegExp("^hsl\\("+[Oh,Sh,Sh]+"\\)$"),Bh=new RegExp("^hsla\\("+[Oh,Sh,Sh,Oh]+"\\)$"),Ph={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 Rh(){return this.rgb().formatHex()}function zh(){return this.rgb().formatRgb()}function Lh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Dh.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ih(t):3===n?new Wh(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Uh(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Uh(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=Fh.exec(e))?new Wh(t[1],t[2],t[3],1):(t=jh.exec(e))?new Wh(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Th.exec(e))?Uh(t[1],t[2],t[3],t[4]):(t=Nh.exec(e))?Uh(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Mh.exec(e))?Gh(t[1],t[2]/100,t[3]/100,1):(t=Bh.exec(e))?Gh(t[1],t[2]/100,t[3]/100,t[4]):Ph.hasOwnProperty(e)?Ih(Ph[e]):"transparent"===e?new Wh(NaN,NaN,NaN,0):null}function Ih(e){return new Wh(e>>16&255,e>>8&255,255&e,1)}function Uh(e,t,n,r){return r<=0&&(e=t=n=NaN),new Wh(e,t,n,r)}function $h(e){return e instanceof kh||(e=Lh(e)),e?new Wh((e=e.rgb()).r,e.g,e.b,e.opacity):new Wh}function qh(e,t,n,r){return 1===arguments.length?$h(e):new Wh(e,t,n,null==r?1:r)}function Wh(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Hh(){return"#"+Yh(this.r)+Yh(this.g)+Yh(this.b)}function Vh(){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 Yh(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Gh(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Jh(e,t,n,r)}function Xh(e){if(e instanceof Jh)return new Jh(e.h,e.s,e.l,e.opacity);if(e instanceof kh||(e=Lh(e)),!e)return new Jh;if(e instanceof Jh)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,u=o-i,s=(o+i)/2;return u?(a=t===o?(n-r)/u+6*(n0&&s<1?0:a,new Jh(a,u,s,e.opacity)}function Kh(e,t,n,r){return 1===arguments.length?Xh(e):new Jh(e,t,n,null==r?1:r)}function Jh(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Qh(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 Zh(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}_h(kh,Lh,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Rh,formatHex:Rh,formatHsl:function(){return Xh(this).formatHsl()},formatRgb:zh,toString:zh}),_h(Wh,qh,Ah(kh,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Wh(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Wh(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:Hh,formatHex:Hh,formatRgb:Vh,toString:Vh})),_h(Jh,Kh,Ah(kh,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Jh(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Jh(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 Wh(Qh(e>=240?e-240:e+120,i,r),Qh(e,i,r),Qh(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 ep=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,u=r()=>e;function rp(e,t){return function(n){return e+n*t}}function ip(e,t){var n=t-e;return n?rp(e,n>180||n<-180?n-360*Math.round(n/360):n):np(isNaN(e)?t:e)}function op(e){return 1==(e=+e)?ap: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):np(isNaN(t)?n:t)}}function ap(e,t){var n=t-e;return n?rp(e,n):np(isNaN(e)?t:e)}var up=function e(t){var n=op(t);function r(e,t){var r=n((e=qh(e)).r,(t=qh(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=ap(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 sp(e){return function(t){var n,r,i=t.length,o=new Array(i),a=new Array(i),u=new Array(i);for(n=0;no&&(i=t.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:gp(n,r)})),o=bp.lastIndex;return ot&&(n=e,e=t,t=n),l=function(n){return Math.max(e,Math.min(t,n))}),r=s>2?Sp:Op,i=o=null,f}function f(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),u,s)))(e(l(t)))}return f.invert=function(n){return l(t((o||(o=r(u,a.map(e),gp)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,_p),c()):a.slice()},f.range=function(e){return arguments.length?(u=Array.from(e),c()):u.slice()},f.rangeRound=function(e){return u=Array.from(e),s=Ep,c()},f.clamp=function(e){return arguments.length?(l=!!e||kp,c()):l!==kp},f.interpolate=function(e){return arguments.length?(s=e,c()):s},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,r){return e=n,t=r,c()}}function jp(){return Fp()(kp,kp)}function Tp(e){var t=e.domain;return e.ticks=function(e){var n=t();return Kn(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Eh(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,u=o.length-1,s=o[a],l=o[u],c=10;for(l0;){if((i=Jn(s,l,n))===r)return o[a]=s,o[u]=l,t(o);if(i>0)s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i}r=i}return e},e}function Np(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);cs)break;m.push(f)}}else for(;d<=h;++d)for(c=o-1,l=n(d);c>=1;--c)if(!((f=l*c)s)break;m.push(f)}2*m.length180?t+=360:t-e>180&&(e+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:gp(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(o.rotate,a.rotate,u,s),function(e,t,n,o){e!==t?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:gp(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(o.skewX,a.skewX,u,s),function(e,t,n,r,o,a){if(e!==n||t!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:gp(e,n)},{i:u-2,x:gp(t,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(e){for(var t,n=-1,r=s.length;++n6/29*(6/29)*(6/29)?Math.pow(e,1/3):e/(6/29*3*(6/29))+4/29}function km(e){return e>6/29?e*e*e:6/29*3*(6/29)*(e-4/29)}function Cm(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Om(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Sm(e){if(e instanceof Fm)return new Fm(e.h,e.c,e.l,e.opacity);if(e instanceof _m||(e=wm(e)),0===e.a&&0===e.b)return new Fm(NaN,00?r:1:0}const Xm="log",Km="time",Jm="utc",Qm="continuous";function Zm(){const e=wh().unknown(void 0),t=e.domain,n=e.range;let r,i,o=[0,1],a=!1,u=0,s=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?(s=Math.max(0,Math.min(1,e)),u=s,c()):u},e.paddingInner=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.paddingOuter=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),c()):s},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:(s=Math.max(0,mh(a,f)-1),l=f===d?s:mh(a,d)-1,f-a[s]>i+1e-10&&++s,r&&(c=s,s=u-l,l=u-c),s>l?void 0:t().slice(s,l+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return Zm().domain(t()).range(o).round(a).paddingInner(u).paddingOuter(s).align(l)},c()}var eg=Array.prototype.map;function tg(e){return eg.call(e,uh)}const ng=Array.prototype.slice;const rg={};function ig(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=u&&n[o]<=s&&(l<0&&(l=o),r=o);if(!(l<0))return u=e.invertExtent(n[l]),s=e.invertExtent(n[r]),[void 0===u[0]?u[1]:u[0],void 0===s[1]?s[0]:s[1]]}}(n):void 0),n.type=e,n};return r.metadata=function(e){const t={},n=e.length;for(let r=0;r1?(rg[e]=ig(e,t,n),this):ag(e)?rg[e]:void 0}function ag(e){return fh(rg,e)}function ug(e,t){const n=rg[e];return n&&n.metadata[t]}function sg(e){return ug(e,Qm)}function lg(e){return ug(e,"discrete")}function cg(e){return ug(e,"discretizing")}function fg(e){return ug(e,Xm)}function dg(e){return ug(e,"interpolating")}function hg(e){return ug(e,"quantile")}og("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,_p),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,_p):[0,1],Tp(r)})),og("linear",(function e(){var t=jp();return t.copy=function(){return Dp(t,e())},yh.apply(t,arguments),Tp(t)}),Qm),og(Xm,(function e(){var t=Ip(Fp()).domain([1,10]);return t.copy=function(){return Dp(t,e()).base(t.base())},yh.apply(t,arguments),t}),[Qm,Xm]),og("pow",Hp,Qm),og("sqrt",(function(){return Hp.apply(null,arguments).exponent(.5)}),Qm),og("symlog",(function e(){var t=Gp(Fp());return t.copy=function(){return Dp(t,e()).constant(t.constant())},yh.apply(t,arguments)}),Qm),og(Km,(function(){return yh.apply(Jp(ri,oi,Lr,Rr,ui,li,fi,hi,qo).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Qm,"temporal"]),og(Jm,(function(){return yh.apply(Jp(mi,vi,Xr,Yr,bi,wi,fi,hi,Ho).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Qm,"temporal"]),og("sequential",em,[Qm,"interpolating"]),og("".concat("sequential","-").concat("linear"),em,[Qm,"interpolating"]),og("".concat("sequential","-").concat(Xm),(function e(){var t=Ip(Qp()).domain([1,10]);return t.copy=function(){return Zp(t,e()).base(t.base())},bh.apply(t,arguments)}),[Qm,"interpolating",Xm]),og("".concat("sequential","-").concat("pow"),tm,[Qm,"interpolating"]),og("".concat("sequential","-").concat("sqrt"),(function(){return tm.apply(null,arguments).exponent(.5)}),[Qm,"interpolating"]),og("".concat("sequential","-").concat("symlog"),(function e(){var t=Gp(Qp());return t.copy=function(){return Zp(t,e()).constant(t.constant())},bh.apply(t,arguments)}),[Qm,"interpolating"]),og("".concat("diverging","-").concat("linear"),(function e(){var t=Tp(rm()(kp));return t.copy=function(){return Zp(t,e())},bh.apply(t,arguments)}),[Qm,"interpolating"]),og("".concat("diverging","-").concat(Xm),(function e(){var t=Ip(rm()).domain([.1,1,10]);return t.copy=function(){return Zp(t,e()).base(t.base())},bh.apply(t,arguments)}),[Qm,"interpolating",Xm]),og("".concat("diverging","-").concat("pow"),im,[Qm,"interpolating"]),og("".concat("diverging","-").concat("sqrt"),(function(){return im.apply(null,arguments).exponent(.5)}),[Qm,"interpolating"]),og("".concat("diverging","-").concat("symlog"),(function e(){var t=Gp(rm());return t.copy=function(){return Zp(t,e()).constant(t.constant())},bh.apply(t,arguments)}),[Qm,"interpolating"]),og("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]]},u.unknown=function(e){return arguments.length?(t=e,u):u},u.thresholds=function(){return o.slice()},u.copy=function(){return e().domain([n,r]).range(a).unknown(t)},yh.apply(Tp(u),arguments)}),"discretizing"),og("threshold",(function e(){var t,n=[.5],r=[0,1],i=1;function o(e){return e<=e?r[vh(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)},yh.apply(o,arguments)}),"discretizing"),og("bin-ordinal",(function e(){let t=[],n=[];function r(e){return null==e||e!=e?void 0:n[(vh(t,e)-1)%n.length]}return r.domain=function(e){return arguments.length?(t=tg(e),r):t.slice()},r.range=function(e){return arguments.length?(n=ng.call(e),r):n.slice()},r.tickFormat=function(e,n){return Eh(t[0],ah(t),null==e?10:e,n)},r.copy=function(){return e().domain(r.domain()).range(r.range())},r}),["discrete","discretizing"]),og("ordinal",wh,"discrete"),og("band",Zm,"discrete"),og("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}(Zm().paddingInner(1))}),"discrete");const pg=["clamp","base","constant","exponent"];function mg(e,t){const n=t[0],r=ah(t)-n;return function(t){return e(n+t*r)}}function gg(e,t,n){return nm(bg(t||"rgb",n),e)}function vg(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[t]?a[t](e[t]()):0),a):lh(u=.5)?u:()=>u;var u}function bg(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 xg(e){const t=e.length/6|0,n=new Array(t);for(let r=0;r1?(Eg[e]=t,this):Eg[e]}wg({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"},xg),wg({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=>gg(xg(e)));const Ag=e=>ih(e)?e.map(e=>String(e)):String(e),kg=(e,t)=>e[1]-t[1],Cg=(e,t)=>t[1]-e[1];function Og(e,t,n){let r;var i;return dh(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(((i=e.domain())&&ah(i)-i[0]||0)/n||1)))),oh(t)&&(r=t.step,t=t.interval),hh(t)&&(t=e.type===Km?co(t):e.type==Jm?fo(t):th("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function Sg(e,t,n){let r=e.range(),i=r[0],o=ah(r),a=kg;if(i>o&&(r=o,o=i,i=r,a=Cg),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],ah(t)];for(;t.length>n&&t.length>=3;)t=t.filter((e,t)=>!(t%2));t.length<3&&(t=e)}return t}function Dg(e,t){return e.bins?Sg(e,e.bins):e.ticks?e.ticks(t):e.domain()}function Fg(e,t,n,r,i,o){const a=t.type;let u=Ag;if(a===Km||i===Km)u=e.timeFormat(r);else if(a===Jm||i===Jm)u=e.utcFormat(r);else if(fg(a)){const i=e.formatFloat(r);if(o||t.bins)u=i;else{const e=jg(t,n,!1);u=t=>e(t)?i(t):""}}else if(t.tickFormat){const i=t.domain();u=e.formatSpan(i[0],i[i.length-1],n,r)}else r&&(u=e.format(r));return u}function jg(e,t,n){const r=Dg(e,t),i=e.base(),o=Math.log(i),a=Math.max(1,i*t/r.length),u=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;oTg[e.type]||e.bins)(t)?Pg(u):"discrete"===r?zg(u):Lg(u)}const Pg=e=>(t,n,r)=>{const i=Rg(r[n+1],Rg(r.max,1/0)),o=Ig(t,e),a=Ig(i,e);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},Rg=(e,t)=>null!=e?e:t,zg=e=>(t,n)=>n?e(t):null,Lg=e=>t=>e(t),Ig=(e,t)=>Number.isFinite(e)?t(e):null;function Ug(e,t,n,r){const i=r||t.type;return hh(n)&&ug(i,"temporal")&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==Km?n||i!==Jm?Bg(e,t,5,null,n,r,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function $g(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=Ug(e,t,n.format,n.formatType);if(cg(t.type)){const e=Mg(t).slice(1).map(i),n=e.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(e.join(", "))}if(lg(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(ah(e)))}}let qg=0;function Wg(e){return e&&e.gradient}function Hg(e,t,n){const r=e.gradient;let i=e.id,o="radial"===r?"p_":"";return i||(i=e.id="gradient_"+qg++,"radial"===r?(e.x1=Vg(e.x1,.5),e.y1=Vg(e.y1,.5),e.r1=Vg(e.r1,0),e.x2=Vg(e.x2,.5),e.y2=Vg(e.y2,.5),e.r2=Vg(e.r2,.5),o="p_"):(e.x1=Vg(e.x1,0),e.y1=Vg(e.y1,0),e.x2=Vg(e.x2,1),e.y2=Vg(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function Vg(e,t){return null!=e?e:t}function Yg(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 Gg={basis:{curve:function(e){return new Rf(e)}},"basis-closed":{curve:function(e){return new Lf(e)}},"basis-open":{curve:function(e){return new If(e)}},bundle:{curve:$f,tension:"beta",value:.85},cardinal:{curve:Hf,tension:"tension",value:0},"cardinal-open":{curve:Yf,tension:"tension",value:0},"cardinal-closed":{curve:Xf,tension:"tension",value:0},"catmull-rom":{curve:cd,tension:"alpha",value:.5},"catmull-rom-closed":{curve:dd,tension:"alpha",value:.5},"catmull-rom-open":{curve:pd,tension:"alpha",value:.5},linear:{curve:gd},"linear-closed":{curve:function(e){return new vd(e)}},monotone:{horizontal:function(e){return new _d(e)},vertical:function(e){return new Ed(e)}},natural:{curve:function(e){return new kd(e)}},step:{curve:function(e){return new Od(e,.5)}},"step-after":{curve:function(e){return new Od(e,1)}},"step-before":{curve:function(e){return new Od(e,0)}}};function Xg(e,t,n){var r=Nf(Gg,e)&&Gg[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const Kg={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},Jg=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];function Qg(e){const t=[];let n,r,i,o,a,u,s,l,c,f;const d=e.slice().replace(Jg[0],"###$1").split(Jg[1]).slice(1);for(s=0,c=d.length;su){const e=i.length;for(l=1,t.push([a].concat(i.slice(l,l+=u))),a="M"===a?"L":"m"===a?"l":a;l1&&(m=Math.sqrt(m),n*=m,r*=m);const g=d/n,v=f/n,y=-f/r,b=d/r,x=g*u+v*s,w=y*u+b*s,E=g*e+v*t,_=y*e+b*t,A=(E-x)*(E-x)+(_-w)*(_-w);let k=1/A-.25;k<0&&(k=0);let C=Math.sqrt(k);o==i&&(C=-C);const O=.5*(x+E)-C*(_-w),S=.5*(w+_)+C*(E-x),D=Math.atan2(w-S,x-O),F=Math.atan2(_-S,E-O);let j=F-D;j<0&&1===o?j+=tv:j>0&&0===o&&(j-=tv);const T=Math.ceil(Math.abs(j/(ev+.001))),N=[];for(let e=0;e+e}function xv(e,t,n){return Math.max(t,Math.min(e,n))}function wv(){var e=mv,t=gv,n=vv,r=yv,i=bv(0),o=i,a=i,u=i,s=null;function l(l,c,f){var d,h=null!=c?c:+e.call(this,l),p=null!=f?f:+t.call(this,l),m=+n.call(this,l),g=+r.call(this,l),v=Math.min(m,g)/2,y=xv(+i.call(this,l),0,v),b=xv(+o.call(this,l),0,v),x=xv(+a.call(this,l),0,v),w=xv(+u.call(this,l),0,v);if(s||(s=d=Nd()),y<=0&&b<=0&&x<=0&&w<=0)s.rect(h,p,m,g);else{var E=h+m,_=p+g;s.moveTo(h+y,p),s.lineTo(E-b,p),s.bezierCurveTo(E-.448084975506*b,p,E,p+.448084975506*b,E,p+b),s.lineTo(E,_-w),s.bezierCurveTo(E,_-.448084975506*w,E-.448084975506*w,_,E-w,_),s.lineTo(h+x,_),s.bezierCurveTo(h+.448084975506*x,_,h,_-.448084975506*x,h,_-x),s.lineTo(h,p+y),s.bezierCurveTo(h,p+.448084975506*y,h+.448084975506*y,p,h+y,p),s.closePath()}if(d)return s=null,d+""||null}return l.x=function(t){return arguments.length?(e=bv(t),l):e},l.y=function(e){return arguments.length?(t=bv(e),l):t},l.width=function(e){return arguments.length?(n=bv(e),l):n},l.height=function(e){return arguments.length?(r=bv(e),l):r},l.cornerRadius=function(e,t,n,r){return arguments.length?(i=bv(e),o=null!=t?bv(t):i,u=null!=n?bv(n):i,a=null!=r?bv(r):o,l):i},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function Ev(){var e,t,n,r,i,o,a,u,s=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)*u,h=(c/=f)*u,p=Math.atan2(c,l);s.moveTo(o-d,a-h),s.lineTo(e-l*r,t-c*r),s.arc(e,t,r,p-Math.PI,p),s.lineTo(o+d,a+h),s.arc(o,a,u,p,p+Math.PI)}else s.arc(e,t,r,0,tv);s.closePath()}else i=1;o=e,a=t,u=r}function c(o){var a,u,c,f=o.length,d=!1;for(null==s&&(s=c=Nd()),a=0;a<=f;++a)!(ae.x||0,kv=e=>e.y||0,Cv=e=>!(!1===e.defined),Ov=function(){var e=Bd,t=Pd,n=Md(0),r=null,i=Rd,o=zd,a=Ld,u=null;function s(){var s,l,c=+e.apply(this,arguments),f=+t.apply(this,arguments),d=i.apply(this,arguments)-id,h=o.apply(this,arguments)-id,p=Kf(h-d),m=h>d;if(u||(u=s=Nd()),f1e-12)if(p>od-1e-12)u.moveTo(f*Qf(d),f*td(d)),u.arc(0,0,f,d,h,!m),c>1e-12&&(u.moveTo(c*Qf(h),c*td(h)),u.arc(0,0,c,h,d,m));else{var g,v,y=d,b=h,x=d,w=h,E=p,_=p,A=a.apply(this,arguments)/2,k=A>1e-12&&(r?+r.apply(this,arguments):nd(c*c+f*f)),C=ed(Kf(f-c)/2,+n.apply(this,arguments)),O=C,S=C;if(k>1e-12){var D=ud(k/c*td(A)),F=ud(k/f*td(A));(E-=2*D)>1e-12?(x+=D*=m?1:-1,w-=D):(E=0,x=w=(d+h)/2),(_-=2*F)>1e-12?(y+=F*=m?1:-1,b-=F):(_=0,y=b=(d+h)/2)}var j=f*Qf(y),T=f*td(y),N=c*Qf(w),M=c*td(w);if(C>1e-12){var B,P=f*Qf(b),R=f*td(b),z=c*Qf(x),L=c*td(x);if(p1e-12?S>1e-12?(g=Ud(z,L,j,T,f,S,m),v=Ud(P,R,N,M,f,S,m),u.moveTo(g.cx+g.x01,g.cy+g.y01),S1e-12&&E>1e-12?O>1e-12?(g=Ud(N,M,P,R,c,-O,m),v=Ud(j,T,z,L,c,-O,m),u.lineTo(g.cx+g.x01,g.cy+g.y01),Oe.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),Sv=Vd().x(Av).y1(kv).y0(e=>(e.y||0)+(e.height||0)).defined(Cv),Dv=Vd().y(kv).x1(Av).x0(e=>(e.x||0)+(e.width||0)).defined(Cv),Fv=Hd().x(Av).y(kv).defined(Cv),jv=wv().x(Av).y(kv).width(e=>e.width||0).height(e=>e.height||0).cornerRadius(e=>_v(e.cornerRadiusTopLeft,e.cornerRadius)||0,e=>_v(e.cornerRadiusTopRight,e.cornerRadius)||0,e=>_v(e.cornerRadiusBottomRight,e.cornerRadius)||0,e=>_v(e.cornerRadiusBottomLeft,e.cornerRadius)||0),Tv=function(e,t){var n=null;function r(){var r;if(n||(n=r=Nd()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+""||null}return e="function"==typeof e?e:Md(e||Yd),t="function"==typeof t?t:Md(void 0===t?64:+t),r.type=function(t){return arguments.length?(e="function"==typeof t?t:Md(t),r):e},r.size=function(e){return arguments.length?(t="function"==typeof e?e:Md(+e),r):t},r.context=function(e){return arguments.length?(n=null==e?null:e,r):n},r}().type(e=>hv(e.shape||"circle")).size(e=>_v(e.size,64)),Nv=Ev().x(Av).y(kv).defined(Cv).size(e=>e.size||1);function Mv(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Bv(e,t,n,r){return jv.context(e)(t,n,r)}var Pv=1;function Rv(){Pv=1}function zv(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+Pv++),a=i.clipping[o]||(i.clipping[o]={id:o});return Ff(r)?a.path=r(null):Mv(n)?a.path=Bv(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function Lv(e){this.clear(),e&&this.union(e)}function Iv(e){this.mark=e,this.bounds=this.bounds||new Lv}function Uv(e){Iv.call(this,e),this.items=this.items||[]}function $v(e){this._pending=0,this._loader=e||Ou()}function qv(e){e._pending+=1}function Wv(e){e._pending-=1}function Hv(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}Lv.prototype={clone(){return new Lv(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,u=Math.cos(e),s=Math.sin(e),l=t-t*u+n*s,c=n-t*s-n*u;return[u*r-s*i+l,s*r+u*i+c,u*r-s*a+l,s*r+u*a+c,u*o-s*i+l,s*o+u*i+c,u*o-s*a+l,s*o+u*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}},Mf(Uv,Iv),$v.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return qv(t),t._loader.sanitize(e,{context:"href"}).then(e=>(Wv(t),e)).catch(()=>(Wv(t),null))},loadImage(e){const t=this,n=Kd();return qv(t),t._loader.sanitize(e,{context:"image"}).then(e=>{const r=e.href;if(!r||!n)throw{url:r};const i=new n,o=Nf(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>Wv(t),i.onerror=()=>Wv(t),i.src=r,i}).catch(e=>(Wv(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 Vv=tv-1e-8;let Yv,Gv,Xv,Kv,Jv,Qv,Zv,ey;const ty=(e,t)=>Yv.add(e,t),ny=(e,t)=>ty(Gv=e,Xv=t),ry=e=>ty(e,Yv.y1),iy=e=>ty(Yv.x1,e),oy=(e,t)=>Jv*e+Zv*t,ay=(e,t)=>Qv*e+ey*t,uy=(e,t)=>ty(oy(e,t),ay(e,t)),sy=(e,t)=>ny(oy(e,t),ay(e,t));function ly(e,t){return Yv=e,t?(Kv=t*Zg,Jv=ey=Math.cos(Kv),Qv=Math.sin(Kv),Zv=-Qv):(Jv=ey=1,Kv=Qv=Zv=0),cy}const cy={beginPath(){},closePath(){},moveTo:sy,lineTo:sy,rect(e,t,n,r){Kv?(uy(e+n,t),uy(e+n,t+r),uy(e,t+r),sy(e,t)):(ty(e+n,t+r),ny(e,t))},quadraticCurveTo(e,t,n,r){const i=oy(e,t),o=ay(e,t),a=oy(n,r),u=ay(n,r);fy(Gv,i,a,ry),fy(Xv,o,u,iy),ny(a,u)},bezierCurveTo(e,t,n,r,i,o){const a=oy(e,t),u=ay(e,t),s=oy(n,r),l=ay(n,r),c=oy(i,o),f=ay(i,o);dy(Gv,a,s,c,ry),dy(Xv,u,l,f,iy),ny(c,f)},arc(e,t,n,r,i,o){if(r+=Kv,i+=Kv,Gv=n*Math.cos(i)+e,Xv=n*Math.sin(i)+t,Math.abs(i-r)>Vv)ty(e-n,t-n),ty(e+n,t+n);else{const a=r=>ty(n*Math.cos(r)+e,n*Math.sin(r)+t);let u,s;if(a(r),a(i),i!==r)if((r%=tv)<0&&(r+=tv),(i%=tv)<0&&(i+=tv),ii;++s,u-=ev)a(u);else for(u=r-r%ev+ev,s=0;s<4&&u1e-14?(s=a*a+u*o,s>=0&&(s=Math.sqrt(s),l=(-a+s)/o,c=(-a-s)/o)):l=.5*u/a,0g)return!1;h>m&&(m=h)}else if(f>0){if(h0&&(e.globalAlpha=n,e.fillStyle=Ay(e,t,t.fill),!0)}var Cy=[];function Oy(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=Ay(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||Cy),e.lineDashOffset=t.strokeDashOffset||0),!0))}function Sy(e,t){return e.zindex-t.zindex||e.index-t.index}function Dy(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 Ty(e){return function(t,n,r){Fy(n,n=>{r&&!r.intersects(n.bounds)||Ny(e,t,n,n)})}}function Ny(e,t,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(e(t,r)||(wy(t,n),n.fill&&ky(t,n,i)&&t.fill(),n.stroke&&Oy(t,n,i)&&t.stroke()))}function My(e){return e=e||kf,function(t,n,r,i,o,a){return r*=t.pixelRatio,i*=t.pixelRatio,jy(n,n=>{const u=n.bounds;if((!u||u.contains(o,a))&&u)return e(t,n,r,i,o,a)?n:void 0})}}function By(e,t){return function(n,r,i,o){var a,u,s=Array.isArray(r)?r[0]:r,l=null==t?s.fill:t,c=s.stroke&&n.isPointInStroke;return c&&(a=s.strokeWidth,u=s.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=u?u:"butt"),!e(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function Py(e){return My(By(e))}function Ry(e,t){return"translate("+e+","+t+")"}function zy(e){return"rotate("+e+")"}function Ly(e){return Ry(e.x||0,e.y||0)}function Iy(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*=Zg),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 Ry(e.x||0,e.y||0)+(e.angle?" "+zy(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(ly(e,n.angle),n),Hv(e,n).translate(n.x||0,n.y||0)},draw:Ty(r),pick:Py(r),isect:n||gy(r)}}var Uy=Iy("arc",(function(e,t){return Ov.context(e)(t)}));function $y(e,t,n){function r(e,n){e.beginPath(),t(e,n)}const i=By(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(ly(e),r),Hv(e,r[0]))},draw:(o=r,function(e,t,n){!t.items.length||n&&!n.intersects(t.bounds)||Ny(o,e,t.items[0],t.items)}),pick:function(e,t,n,r,o,a){var u=t.items,s=t.bounds;return!u||!u.length||s&&!s.contains(o,a)?null:(n*=e.pixelRatio,r*=e.pixelRatio,i(e,u,n,r)?u[0]:null)},isect:vy,tip:n};var o}var qy=$y("area",(function(e,t){const n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Dv:Sv).curve(Xg(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,u=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 Vy(e,t){const n=Hy(t);e("d",Bv(null,t,n,n))}function Yy(e,t,n,r){const i=Hy(t);e.beginPath(),Bv(e,t,(n||0)+i,(r||0)+i)}const Gy=By(Yy),Xy=By(Yy,!1),Ky=By(Yy,!0);var Jy={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",Ly(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&&(Yy(e,t,r,i),wy(e,t),t.fill&&ky(e,t,a)&&e.fill(),t.stroke&&!o&&Oy(e,t,a)&&e.stroke()),e.save(),e.translate(r,i),t.clip&&Wy(e,t),n&&n.translate(-r,-i),Fy(t,t=>{this.draw(e,t,n)}),n&&n.translate(r,i),e.restore(),o&&t.stroke&&a&&(Yy(e,t,r,i),wy(e,t),Oy(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,u=r*e.pixelRatio;return jy(t,s=>{let l,c,f;const d=s.bounds;if(d&&!d.contains(i,o))return;c=s.x||0,f=s.y||0;const h=c+(s.width||0),p=f+(s.height||0),m=s.clip;if(m&&(ih||op))return;if(e.save(),e.translate(c,f),c=i-c,f=o-f,m&&Mv(s)&&!Ky(e,s,a,u))return e.restore(),null;const g=s.strokeForeground,v=!1!==t.interactive;return v&&g&&s.stroke&&Xy(e,s,a,u)?(e.restore(),s):(l=jy(s,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&&v&&(s.fill||!g&&s.stroke)&&Gy(e,s,a,u)&&(l=s),e.restore(),l||null)})},isect:yy,content:function(e,t,n){e("clip-path",t.clip?zv(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),Vy(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?Vy(e,t):e("d","")}},Qy={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Zy(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 eb(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 tb(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 nb(e,t){return"center"===e?t/2:"right"===e?t:0}function rb(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var ib={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const r=Zy(t,n),i=eb(t,r),o=tb(t,r),a=(t.x||0)-nb(t.align,i),u=(t.y||0)-rb(t.baseline,o);e("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",Qy["xmlns:xlink"],"xlink:href"),e("transform",Ry(a,u)),e("width",i),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,r=eb(t,n),i=tb(t,n),o=(t.x||0)-nb(t.align,r),a=(t.y||0)-rb(t.baseline,i);return e.set(o,a,o+r,a+i)},draw:function(e,t,n){Fy(t,t=>{if(n&&!n.intersects(t.bounds))return;const r=Zy(t,this);let i,o,a,u,s=eb(t,r),l=tb(t,r),c=(t.x||0)-nb(t.align,s),f=(t.y||0)-rb(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&&cb(e,t,r)&&(wy(e,t),e.stroke())}})},pick:My((function(e,t,n,r){return!!e.isPointInStroke&&(cb(e,t,1)&&e.isPointInStroke(n,r))})),isect:by},db=Iy("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),hb=Iy("symbol",(function(e,t){return Tv.context(e)(t)}),vy);const pb=function(e){let t,n,r;e=+e||1e4;const i=()=>{t={},n={},r=0},o=(i,o)=>(++r>e&&(n=t,t={},r=1),t[i]=o);return i(),{clear:i,has:e=>Nf(t,e)||Nf(n,e),get:e=>Nf(t,e)?t[e]:Nf(n,e)?o(e,n[e]):void 0,set:(e,n)=>Nf(t,e)?t[e]=n:o(e,n)}}();var mb={height:wb,measureWidth:bb,estimateWidth:vb,width:vb,canvas:gb};function gb(e){mb.width=e&&py?bb:vb}function vb(e,t){return yb(kb(e,t),wb(e))}function yb(e,t){return~~(.8*e.length*t)}function bb(e,t){return wb(e)<=0||!(t=kb(e,t))?0:xb(t,Ob(e))}function xb(e,t){const n="(".concat(t,") ").concat(e);let r=pb.get(n);return void 0===r&&(py.font=t,r=py.measureText(e).width,pb.set(n,r)),r}function wb(e){return null!=e.fontSize?+e.fontSize||0:11}function Eb(e){return null!=e.lineHeight?e.lineHeight:wb(e)+2}function _b(e){return t=e.lineBreak&&e.text&&!Cf(e.text)?e.text.split(e.lineBreak):e.text,Cf(t)?t.length>1?t:t[0]:t;var t}function Ab(e){const t=_b(e);return(Cf(t)?t.length-1:0)*Eb(e)}function kb(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(mb.width===bb){const t=Ob(e);return e=>xb(e,t)}{const t=wb(e);return e=>yb(e,t)}}(e);if(r(t)>>1,r(t.slice(i))>n?u=i+1:s=i;return o+t.slice(u)}for(;u>>1),r(t.slice(0,i))Math.max(e,mb.width(t,n)),0)):r=mb.width(t,f),"center"===o?l-=r/2:"right"===o&&(l-=r),e.set(l+=u,c+=s,l+r,c+i),t.angle&&!n)e.rotate(t.angle*Zg,u,s);else if(2===n)return e.rotatedPoints(t.angle*Zg,u,s);return e}var Nb={arc:Uy,area:qy,group:Jy,image:ib,line:ob,path:ub,rect:lb,rule:fb,shape:db,symbol:hb,text:{type:"text",tag:"text",nested:!1,attr:function(e,t){var n,r=t.dx||0,i=(t.dy||0)+Sb(t),o=jb(t),a=o.x1,u=o.y1,s=t.angle||0;e("text-anchor",Db[t.align]||"start"),s?(n=Ry(a,u)+" "+zy(s),(r||i)&&(n+=" "+Ry(r,i))):n=Ry(a+r,u+i),e("transform",n)},bound:Tb,draw:function(e,t,n){Fy(t,t=>{var r,i,o,a,u,s,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=Ob(t),e.textAlign=t.align||"left",i=(r=jb(t)).x1,o=r.y1,t.angle&&(e.save(),e.translate(i,o),e.rotate(t.angle*Zg),i=o=0),i+=t.dx||0,o+=(t.dy||0)+Sb(t),s=_b(t),wy(e,t),Cf(s))for(u=Eb(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 Mb(e,t,n){var r=Nb[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new Lv),e,n)}var Bb={mark:null};function Pb(e,t,n){var r,i,o,a,u=Nb[e.marktype],s=u.bound,l=e.items,c=l&&l.length;if(u.nested)return c?o=l[0]:(Bb.mark=e,o=Bb),a=Mb(o,s,n),t=t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new Lv,c)for(r=0,i=l.length;rt;)e.removeChild(n[--r]);return e}function Vb(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Yb(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function Gb(e,t){this._active=null,this._handlers={},this._loader=e||Ou(),this._tooltip=t||Xb}function Xb(e,t,n,r){e.element().setAttribute("title",r||"")}function Kb(e){this._el=null,this._bgcolor=null,this._loader=new $v(e)}Ib.prototype={toJSON(e){return zb(this.root,e||0)},mark(e,t,n){const r=Ub(e,t=t||this.root.items[0]);return t.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},Gb.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=$b(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=Nb[a.marktype]).tip){for((o=Yb(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 u=i.x1+r[0]+n.left,s=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)u+=e.x||0,s+=e.y||0;return{x:u,y:s,width:o,height:a,left:u,top:s,right:u+o,bottom:s+a}}},Kb.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 Jb="dragleave",Qb="mousedown",Zb="mousemove",ex="mouseout",tx="click",nx=Zb,rx=ex,ix=tx;function ox(e,t){Gb.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function ax(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 ux(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 sx(e){return function(t){this.fire(e,t),this._active=null}}Mf(ox,Gb,{initialize(e,t,n){return this._canvas=e&&qb(e,"canvas"),[tx,Qb,Zb,ex,Jb].forEach(e=>ax(this,e)),Gb.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:["keydown","keypress","keyup","dragenter",Jb,"dragover",Qb,"mouseup",Zb,ex,"mouseover",tx,"dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],DOMMouseScroll(e){this.fire("mousewheel",e)},mousemove:ux(Zb,"mouseover",ex),dragover:ux("dragover","dragenter",Jb),mouseout:sx(ex),dragleave:sx(Jb),mousedown(e){this._down=this._active,this.fire(Qb,e)},click(e){this._down===this._active&&(this.fire(tx,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===ix&&r&&r.href?this.handleHref(t,r,r.href):e!==nx&&e!==rx||this.handleTooltip(t,r,e!==rx),i)for(let e=0,n=i.length;e=0&&r.splice(i,1),this},pickEvent(e){const t=Yb(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 Nb[e.marktype].pick.call(this,o,e,t,n,r,i)}});var lx="undefined"!=typeof window&&window.devicePixelRatio||1;function cx(e){Kb.call(this,e),this._options={},this._redraw=!1,this._dirty=new Lv,this._tempb=new Lv}const fx=Kb.prototype;function dx(e,t){Gb.call(this,e,t);const n=this;n._hrefHandler=hx(n,(e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)}),n._tooltipHandler=hx(n,(e,t)=>{n.handleTooltip(e,t,e.type!==rx)})}Mf(cx,Kb,{initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Xd(1,1,this._options.type),e&&this._canvas&&(Hb(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),fx.initialize.call(this,e,t,n,r,i)},resize(e,t,n,r){if(fx.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,u=e.getContext("2d"),s=a?lx:i;e.width=t*s,e.height=n*s;for(const e in o)u[e]=o[e];a&&1!==s&&(e.style.width=t+"px",e.style.height=n+"px"),u.pixelRatio=s,u.setTransform(s,0,0,s,s*r[0],s*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||Ef("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=(u=n,s=r,l=i,(new Lv).set(0,0,s,l).translate(-u[0],-u[1]));var u,s,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=Nb[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),Ff(n)?(e.beginPath(),n(e),e.clip()):Wy(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 hx=(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)};Mf(dx,Gb,{initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(ix,this._hrefHandler),r.removeEventListener(nx,this._tooltipHandler),r.removeEventListener(rx,this._tooltipHandler)),this._svg=r=e&&qb(e,"svg"),r&&(r.addEventListener(ix,this._hrefHandler),r.addEventListener(nx,this._tooltipHandler),r.addEventListener(rx,this._tooltipHandler)),Gb.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:hx(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 px=(e,t,n)=>({role:e,"aria-roledescription":t,"aria-label":n||void 0}),mx=function(e){const t={},n=e.length;for(let r=0;re+("fill"===e||"stroke"===e?" color":""))).length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Sf(e)}(o))+" with ".concat($g(s,u,e));var l}},"title-text":{desc:"title",caption:e=>"Title text '".concat(xx(e),"'")},"title-subtitle":{desc:"subtitle",caption:e=>"Subtitle text '".concat(xx(e),"'")}},vx={ariaRole:"role",ariaRoleDescription:"aria-roledescription",description:"aria-label"};function yx(e,t){const n=!1===t.aria;if(e("aria-hidden",n||void 0),n||null==t.description)for(const t in vx)e(vx[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 bx(e){return!1===e.aria?{"aria-hidden":!0}:mx[e.role]?null:gx[e.role]?function(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return px(t.role||"graphics-symbol",t.desc,n.description||r(n))}catch(e){return null}}(e,gx[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some(e=>null!=e.description&&!1!==e.aria);return px(n?"graphics-object":"graphics-symbol","".concat(t," mark container"),e.description)}(e)}function xx(e){return Df(e.text).join(" ")}function wx(e){try{return Df(Sf(e.items).items[0].text).join(" ")}catch(e){return null}}const Ex=e=>(e+"").replace(/&/g,"&").replace(//g,">");function _x(){let e="",t="",n="";const r=[],i=()=>t=n="",o=(e,n)=>(null!=n&&(t+=" ".concat(e,'="').concat(Ex(n).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," "),'"')),a),a={open(u,...s){(o=>{t&&(e+="".concat(t,">").concat(n),i()),r.push(o)})(u),t="<"+u;for(const e of s)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+=Ex(e),a),toString:()=>e};return a}const Ax=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}Mf(Sx,Kb,{initialize(e,t,n,r,i){return this._defs={},this._clearDefs(),e&&(this._svg=Wb(e,0,"svg",Ox),Lx(this._svg,Qy),this._svg.setAttribute("class","marks"),Hb(e,1),this._root=Wb(this._svg,0,"g",Ox),Lx(this._root,Cx),Hb(this._svg,1)),this.background(this._bgcolor),Dx.initialize.call(this,e,t,n,r,i)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),Dx.background.apply(this,arguments)},resize(e,t,n,r){return Dx.resize.call(this,e,t,n,r),this._svg&&(Lx(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=Wb(e,0,"rect",Ox),Lx(n,{width:this._width,height:this._height,fill:t}));const r=Ax(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),Hb(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,u,s;for(a=0,u=e.length;a{e.dirty=t})),r.zdirty||(n.exit?(o.nested&&r.items.length?(s=r.items[0],s._svg&&this._update(o,s._svg,s)):n._svg&&(s=n._svg.parentNode,s&&s.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,Fx(n,t)),n._update=t)));return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const r=this._svg,i=Nb[t.marktype],o=!1===t.interactive?"none":null,a="g"===i.tag;let u=null,s=0;const l=Nx(t,e,n,"g",r);l.setAttribute("class",Vb(t));const c=bx(t);for(const e in c)Ix(l,e,c[e]);a||Ix(l,"pointer-events",o),Ix(l,"clip-path",t.clip?zv(this,t,t.group):null);const f=e=>{const t=this.isDirty(e),n=Nx(e,l,u,i.tag,r);t&&(this._update(i,n,e),a&&function(e,t,n){t=t.lastChild.previousSibling;let r,i=0;Fy(n,n=>{r=e.mark(t,n,r),++i}),Hb(t,1+i)}(this,n,e)),u=n,++s};return i.nested?t.items.length&&f(t.items[0]):Fy(t,f),Hb(l,s),l},_update(e,t,n){Mx=t,Bx=t.__values__,yx(Rx,n),e.attr(Rx,n,this);const r=Px[e.type];r&&r.call(this,e,t,n),Mx&&this.style(Mx,n)},style(e,t){if(null!=t)for(const n in kx){let r="font"===n?Cb(t):t[n];if(r===Bx[n])continue;const i=kx[n];null==r?e.removeAttribute(i):(Wg(r)&&(r=Hg(r,this._defs.gradient,Ux())),e.setAttribute(i,r+"")),Bx[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=Wb(e,1,"defs",Ox)),r=jx(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=Wb(e,1,"defs",Ox)),r=Tx(n,t.clipping[i],r);n&&(0===r?(e.removeChild(n),t.el=null):Hb(n,r))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});let Mx=null,Bx=null;const Px={group(e,t,n){const r=Mx=t.childNodes[2];Bx=r.__values__,e.foreground(Rx,n,this),Bx=t.__values__,Mx=t.childNodes[1],e.content(Rx,n,this);const i=Mx=t.childNodes[0];e.background(Rx,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==Bx.events&&(Ix(r,"pointer-events",o),Ix(i,"pointer-events",o),Bx.events=o),n.strokeForeground&&n.stroke){const e=n.fill;Ix(r,"display",null),this.style(i,n),Ix(i,"stroke",null),e&&(n.fill=null),Bx=r.__values__,this.style(r,n),e&&(n.fill=e),Mx=null}else Ix(r,"display","none")},image(e,t,n){!1===n.smooth?(zx(t,"image-rendering","optimizeSpeed"),zx(t,"image-rendering","pixelated")):zx(t,"image-rendering",null)},text(e,t,n){const r=_b(n);let i,o,a,u;Cf(r)?(o=r.map(e=>kb(n,e)),i=o.join("\n"),i!==Bx.text&&(Hb(t,0),a=t.ownerDocument,u=Eb(n),o.forEach((e,r)=>{const i=$b(a,"tspan",Ox);i.__data__=n,i.textContent=e,r&&(i.setAttribute("x",0),i.setAttribute("dy",u)),t.appendChild(i)}),Bx.text=i)):(o=kb(n,r),o!==Bx.text&&(t.textContent=o,Bx.text=o)),Ix(t,"font-family",Cb(n)),Ix(t,"font-size",wb(n)+"px"),Ix(t,"font-style",n.fontStyle),Ix(t,"font-variant",n.fontVariant),Ix(t,"font-weight",n.fontWeight)}};function Rx(e,t,n){t!==Bx[e]&&(n?function(e,t,n,r){null!=n?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}(Mx,e,t,n):Ix(Mx,e,t),Bx[e]=t)}function zx(e,t,n){n!==Bx[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),Bx[t]=n)}function Lx(e,t){for(const n in t)Ix(e,n,t[n])}function Ix(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function Ux(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function $x(e){Kb.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}Mf($x,Kb,{svg(){return this._text},_render(e){const t=_x();t.open("svg",jf({},Qy,{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",Cx,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=Nb[t.marktype],r=n.tag,i=[yx,n.attr];e.open("g",{class:Vb(t),"clip-path":t.clip?zv(this,t,t.group):null},bx(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=_b(o);if(Cf(t)){const n={x:0,dy:Eb(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]):Fy(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"]=Cb(t),e["font-size"]=wb(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const n in kx){let r=t[n];const o=kx[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(Wg(r)&&(r=Hg(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?(Wx[e]=t,this):Wx[e]}function Vx(e,t,n){const r=[],i=(new Lv).union(t),o=e.marktype;return o?Yx(e,i,n,r):"group"===o?Gx(e,i,n,r):Ef("Intersect scene must be mark node or group item.")}function Yx(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 u=0;if("group"===o)for(;u=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(n=i[r],!Qx(e[n],t[n],n))return!1;return typeof e==typeof t}(e,t):e==t)}function Zx(e,t){return Qx(Qg(e),Qg(t))}function ew(){Rv(),qg=0}function tw(e,t,n){return e.fields=t||[],e.fname=n,e}function nw(e){return 1===e.length?rw(e[0]):iw(e)}const rw=e=>function(t){return t[e]},iw=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||ow("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&ow("Access path missing closing bracket: "+e),a&&ow("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function uw(e,t,n){const r=aw(e);return e=1===r.length?r[0]:e,tw((n&&n.get||nw)(r),[e],t||e)}uw("id"),tw(e=>e,[],"identity"),tw(()=>0,[],"zero"),tw(()=>1,[],"one"),tw(()=>!0,[],"true"),tw(()=>!1,[],"false");Array.isArray;function sw(e){return e===Object(e)}function lw(e){return e[e.length-1]}Object.prototype.hasOwnProperty;function cw(e,t,n){const r=e.prototype=Object.create(t.prototype);return r.constructor=e,function(e){for(let t,n,r=1,i=arguments.length;r{e.bounds.clear().union(s)});else if("group"===i||e.modified())switch(t.visit(t.MOD,e=>n.dirty(e)),s.clear(),r.items.forEach(e=>s.union(vw(e,a))),r.role){case"axis":case"legend":case"title":t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,e=>{s.union(vw(e,a))}),t.visit(t.MOD,e=>{u=u||s.alignsWith(e.bounds),n.dirty(e),s.union(vw(e,a))}),u&&(s.clear(),r.items.forEach(e=>s.union(e.bounds)));return Jx(r),t.modifies("bounds")}});function yw(e){fs.call(this,0,e)}function bw(e){fs.call(this,null,e)}function xw(e){fs.call(this,null,e)}yw.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},cw(yw,fs,{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}}),cw(bw,fs,{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?Uv:Iv;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 ww={parity:e=>e.filter((e,t)=>t%2?e.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((e,r)=>r&&Ew(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1))}},Ew=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),_w=(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},kw=e=>(e.forEach(e=>e.opacity=1),e),Cw=(e,t)=>e.reflow(t.modified()).modifies("opacity");function Ow(e){fs.call(this,null,e)}cw(xw,fs,{transform(e,t){const n=ww[e.method]||ww.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")&&(kw(a),t=Cw(t,e)),t;if(a=a.filter(Aw),!a.length)return;if(e.sort&&(a=a.slice().sort(e.sort)),i=kw(a),t=Cw(t,e),i.length>=3&&_w(i,r)){do{i=n(i,r)}while(i.length>=3&&_w(i,r));i.length<3&&!lw(a).opacity&&(i.length>1&&(lw(i).opacity=0),lw(a).opacity=1)}var u,s,l,c,f;e.boundScale&&e.boundTolerance>=0&&(u=e.boundScale,s=e.boundOrient,l=+e.boundTolerance,c=u.range(),f=new Lv,s===fw||"bottom"===s?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}}),cw(Ow,fs,{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 Sw=new Lv;function Dw(e,t,n){return e[t]===n?0:(e[t]=n,1)}function Fw(e){var t=e.items[0].orient;return t===dw||t===hw}function jw(e,t,n,r){var i,o,a=t.items[0],u=a.datum,s=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]}(u),f=a.range,d=a.offset,h=a.position,p=a.minExtent,m=a.maxExtent,g=u.title&&a.items[c[2]].items[0],v=a.titlePadding,y=a.bounds,b=g&&Ab(g),x=0,w=0;switch(Sw.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 fw:x=h||0,w=-d,o=Math.max(p,Math.min(m,-y.y1)),y.add(0,-o).add(f,0),g&&Tw(e,g,o,v,b,0,-1,y);break;case dw:x=-d,w=h||0,o=Math.max(p,Math.min(m,-y.x1)),y.add(-o,0).add(0,f),g&&Tw(e,g,o,v,b,1,-1,y);break;case hw:x=n+d,w=h||0,o=Math.max(p,Math.min(m,y.x2)),y.add(0,0).add(o,f),g&&Tw(e,g,o,v,b,1,1,y);break;case"bottom":x=h||0,w=r+d,o=Math.max(p,Math.min(m,y.y2)),y.add(0,0).add(f,o),g&&Tw(e,g,o,v,0,0,1,y);break;default:x=a.x,w=a.y}return Hv(y.translate(x,w),a),Dw(a,"x",x+s)|Dw(a,"y",w+s)&&(a.bounds=Sw,e.dirty(a),a.bounds=y,e.dirty(a)),a.mark.bounds.clear().union(y)}function Tw(e,t,n,r,i,o,a,u){const s=t.bounds;if(t.auto){const u=a*(n+i+r);let l=0,c=0;e.dirty(t),o?l=(t.x||0)-(t.x=u):c=(t.y||0)-(t.y=u),t.mark.bounds.clear().union(s.translate(-l,-c)),e.dirty(t)}u.union(s)}const Nw=(e,t)=>Math.floor(Math.min(e,t)),Mw=(e,t)=>Math.ceil(Math.max(e,t));function Bw(e){return(new Lv).set(0,0,e.width||0,e.height||0)}function Pw(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function Rw(e,t,n){const r=sw(e)?e[t]:e;return null!=r?r:void 0!==n?n:0}function zw(e){return e<0?Math.ceil(-e):0}function Lw(e,t,n){var r,i,o,a,u,s,l,c,f,d,h,p=!n.nodirty,m="flush"===n.bounds?Bw:Pw,g=Sw.set(0,0,0,0),v=Rw(n.align,"column"),y=Rw(n.align,mw),b=Rw(n.padding,"column"),x=Rw(n.padding,mw),w=n.columns||t.length,E=w<=0?1:Math.ceil(t.length/w),_=t.length,A=Array(_),k=Array(w),C=0,O=Array(_),S=Array(E),D=0,F=Array(_),j=Array(_),T=Array(_);for(i=0;i1)for(i=0;i<_;++i)(f=(u="all"===v?C:k[i%w])-T[i].x2-t[i].x-F[i])>0&&(F[i]+=f/2);if(y&&Rw(n.center,mw)&&1!==w)for(i=0;i<_;++i)(d=(u="all"===y?D:S[~~(i/w)])-T[i].y2-t[i].y-j[i])>0&&(j[i]+=d/2);for(i=0;i<_;++i)g.union(T[i].translate(F[i],j[i]));switch(f=Rw(n.anchor,"x"),d=Rw(n.anchor,"y"),Rw(n.anchor,"column")){case pw:f-=g.width();break;case"middle":f-=g.width()/2}switch(Rw(n.anchor,mw)){case pw:d-=g.height();break;case"middle":d-=g.height()/2}for(f=Math.round(f),d=Math.round(d),g.clear(),i=0;i<_;++i)t[i].mark.bounds.clear();for(i=0;i<_;++i)(s=t[i]).x+=F[i]+=f,s.y+=j[i]+=d,g.union(s.mark.bounds.union(s.bounds.translate(F[i],j[i]))),p&&e.dirty(s);return g}function Iw(e,t){return"x1"===t?e.x||0:"y1"===t?e.y||0:"x2"===t?(e.x||0)+(e.width||0):"y2"===t?(e.y||0)+(e.height||0):void 0}function Uw(e,t){return e.bounds[t]}function $w(e,t,n,r,i,o,a,u,s,l,c,f,d,h){var p,m,g,v,y,b,x,w,E,_=n.length,A=0,k=0;if(!_)return A;for(p=c;p<_;p+=f)n[p]&&(A=a(A,s(n[p],l)));if(!t.length)return A;for(t.length>i&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),A+=o,m=0,v=t.length;m=0&&null==(x=n[g]);g-=d);u?(w=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),E=A):(w=A,E=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),y.union(b.bounds.translate(w-(b.x||0),E-(b.y||0))),b.x=w,b.y=E,e.dirty(b),k=a(k,y[l])}return k}function qw(e,t,n,r,i,o){if(t){e.dirty(t);var a=n,u=n;r?a=Math.round(i.x1+o*i.width()):u=Math.round(i.y1+o*i.height()),t.bounds.translate(a-(t.x||0),u-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=u,e.dirty(t)}}function Ww(e,t,n,r,i,o,a){const u=function(e,t){const n=e[t]||{};return(t,r)=>null!=n[t]?n[t]:null!=e[t]?e[t]:r}(n,t),s=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,u("offset",0)),l=u("anchor","start"),c=l===pw?1:"middle"===l?.5:0,f={align:"each",bounds:u("bounds","flush"),columns:"vertical"===u("direction")?1:e.length,padding:u("margin",8),center:u("center"),nodirty:!0};switch(t){case dw:f.anchor={x:Math.floor(r.x1)-s,column:pw,y:c*(a||r.height()+2*r.y1),row:l};break;case hw:f.anchor={x:Math.ceil(r.x2)+s,y:c*(a||r.height()+2*r.y1),row:l};break;case fw:f.anchor={y:Math.floor(i.y1)-s,row:pw,x:c*(o||i.width()+2*i.x1),column:l};break;case"bottom":f.anchor={y:Math.ceil(i.y2)+s,x:c*(o||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:s,y:s};break;case"top-right":f.anchor={x:o-s,y:s,column:pw};break;case"bottom-left":f.anchor={x:s,y:a-s,row:pw};break;case"bottom-right":f.anchor={x:o-s,y:a-s,column:pw,row:pw}}return f}function Hw(e,t){var n,r,i=t.items[0],o=i.datum,a=i.orient,u=i.bounds,s=i.x,l=i.y;return i._bounds?i._bounds.clear().union(u):i._bounds=u.clone(),u.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],u=a.anchor,s=t.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case dw:i+=Math.ceil(a.bounds.width())+s;break;case hw:case"bottom":break;default:o+=a.bounds.height()+s}switch((i||o)&&Yw(e,n,i,o),a.orient){case dw:c+=Vw(t,n,a,u,1,1);break;case hw:l+=Vw(t,n,a,pw,0,0)+s,c+=Vw(t,n,a,u,1,1);break;case"bottom":l+=Vw(t,n,a,u,0,0),c+=Vw(t,n,a,pw,-1,0,1)+s;break;default:l+=Vw(t,n,a,u,0,0)}(l||c)&&Yw(e,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(Yw(e,n,-l,0),Yw(e,a,-l,0))}else(i||o)&&Yw(e,n,i,o)}(e,i,i.items[0].items[0]),u=function(e,t){return e.items.forEach(e=>t.union(e.bounds)),t.x1=e.padding,t.y1=e.padding,t}(i,u),n=2*i.padding,r=2*i.padding,u.empty()||(n=Math.ceil(u.width()+n),r=Math.ceil(u.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=s=0,i.y=l=0),i.width=n,i.height=r,Hv(u.set(s,l,s+n,l+r),i),i.mark.bounds.clear().union(u),i}function Vw(e,t,n,r,i,o,a){const u="symbol"!==e.datum.type,s=n.datum.vgrad,l=(!u||!o&&s||a?t:t.items[0]).bounds[i?"y2":"x2"]-e.padding,c=s&&o?l:0,f=s&&o?0:l,d=i<=0?0:Ab(n);return Math.round("start"===r?c:r===pw?f-d:.5*(l-d))}function Yw(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 Gw(e){fs.call(this,null,e)}function Xw(e,t,n){return e.fields=t||[],e.fname=n,e}function Kw(e){return 1===e.length?Jw(e[0]):Qw(e)}cw(Gw,fs,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(t=>{e.layout&&function(e,t,n){var r,i,o,a,u,s,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||hw)&&(t[o]||(t[o]=[])).push(e)});for(const r in t){const i=t[r];Lw(e,i,Ww(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 dw:case hw:f.add(r.x1,0).add(r.x2,0);break;case fw: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],u=a.frame,s=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=s===dw||s===hw?r:n,m=0,g=0,v=0,y=0,b=0;if("group"!==u?s===dw?(m=i.y2,p=i.y1):s===hw?(m=i.y1,p=i.y2):(m=i.x1,p=i.x2):s===dw&&(m=r,p=0),o="start"===l?m:l===pw?p:(m+p)/2,h&&h.text){switch(s){case fw:case"bottom":b=d.bounds.height()+f;break;case dw:y=d.bounds.width()+f;break;case hw:y=-d.bounds.width()-f}Sw.clear().union(h.bounds),Sw.translate(y-(h.x||0),b-(h.y||0)),Dw(h,"x",y)|Dw(h,"y",b)&&(e.dirty(h),h.bounds.clear().union(Sw),h.mark.bounds.clear().union(Sw),e.dirty(h)),Sw.clear().union(h.bounds)}else Sw.clear();switch(Sw.union(d.bounds),s){case fw:g=o,v=i.y1-Sw.height()-c;break;case dw:g=i.x1-Sw.width()-c,v=o;break;case hw:g=i.x2+Sw.width()+c,v=o;break;case"bottom":g=o,v=i.y2+c;break;default:g=a.x,v=a.y}return Dw(a,"x",g)|Dw(a,"y",v)&&(Sw.translate(g,v),e.dirty(a),a.bounds.clear().union(Sw),t.bounds.clear().union(Sw),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,u=e._height,s=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-s)),h=Math.max(0,Math.ceil(n.y2-c));if("padding"===i.contains){const t=e.padding();a-=t.left+t.right,u-=t.top+t.bottom}"none"===o?(l=0,f=0,s=a,c=u):"fit"===o?(s=Math.max(0,a-l-d),c=Math.max(0,u-f-h)):"fit-x"===o?(s=Math.max(0,a-l-d),u=c+f+h):"fit-y"===o?(a=s+l+d,c=Math.max(0,u-f-h)):"pad"===o&&(a=s+l+d,u=c+f+h);e._resizeView(a,u,s,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}});const Jw=e=>function(t){return t[e]},Qw=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||Zw("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&Zw("Access path missing closing bracket: "+e),a&&Zw("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function tE(e,t,n){const r=eE(e);return e=1===r.length?r[0]:e,Xw((n&&n.get||Kw)(r),[e],t||e)}tE("id");const nE=Xw(e=>e,[],"identity"),rE=(Xw(()=>0,[],"zero"),Xw(()=>1,[],"one")),iE=(Xw(()=>!0,[],"true"),Xw(()=>!1,[],"false"));var oE=Array.isArray;function aE(e){return e===Object(e)}function uE(e){return e[e.length-1]}function sE(e){return null==e||""===e?null:+e}const lE=e=>t=>e*Math.exp(t),cE=e=>t=>Math.log(e*t),fE=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),dE=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,hE=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function pE(e,t,n,r,i){const o=r(e[0]),a=r(uE(e)),u=null!=t?r(t):(o+a)/2;return[i(u+(o-u)*n),i(u+(a-u)*n)]}function mE(e,t,n,r){return pE(e,t,n,hE(r),hE(1/r))}function gE(e){return"function"==typeof e}const vE=Object.prototype.hasOwnProperty;function yE(e,t){return vE.call(e,t)}const bE={};function xE(e){let t,n={};function r(e){return yE(n,e)&&n[e]!==bE}const i={size:0,empty:0,object:n,has:r,get:e=>r(e)?n[e]:void 0,set(e,t){return r(e)||(++i.size,n[e]===bE&&--i.empty),n[e]=t,this},delete(e){return r(e)&&(--i.size,++i.empty,n[e]=bE),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===bE||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 wE(e,t,n){const r=e.prototype=Object.create(t.prototype);return r.constructor=e,function(e){for(let t,n,r=1,i=arguments.length;rBu({index:t/(s.length-1||1),value:e,label:u(e)})),e.extra&&i.length&&i.push(Bu({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),wE(CE,fs,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||OE,o=e.key||Nu,a=this.value;return oE(r.encode)&&(r.encode=null),a&&(e.modified("key")||t.modified(o))&&Zw("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function(e){const t=xE().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}}),wE(SE,fs,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(oE(o)){if(!n.changed()&&!o.every(e=>i[e]))return t.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,u=i.update||iE,s=i.enter||iE,l=i.exit||iE,c=(o&&!a?i[o]:u)||iE;if(t.changed(t.ADD)&&(t.visit(t.ADD,t=>{s(t,e),u(t,e)}),n.modifies(s.output),n.modifies(u.output),c!==iE&&c!==u&&(t.visit(t.ADD,t=>{c(t,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==iE&&(t.visit(t.REM,t=>{l(t,e)}),n.modifies(l.output)),a||c!==iE){const i=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(i,t=>{const i=s(t,e)||r;(c(t,e)||i)&&n.mod.push(t)}),n.mod.length&&n.modifies(s.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}}),wE(DE,fs,{transform(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,r,i,o,a,u=t.dataflow.locale(),s=t.fork(t.NO_SOURCE|t.NO_FIELDS),l=this.value,c=e.type||"symbol",f=e.scale,d=+e.limit,h=Og(f,null==e.count?5:e.count,e.minstep),p=!!e.values||"symbol"===c,m=e.format||Bg(u,f,h,c,e.formatSpecifier,e.formatType,p),g=e.values||Mg(f,h);return l&&(s.rem=l),"symbol"===c?(d&&g.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=g.slice(0,d-1),a=!0):l=g,gE(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=function(e){return gE(e)?e:()=>e}(o=i||8),l=l.map((t,n)=>Bu({index:n,label:m(t,n,l),value:t,offset:o,size:i(t,e)})),a&&(a=g[l.length],l.push(Bu({index:l.length,label:"…".concat(g.length-l.length," entries"),value:a,offset:o,size:i(a,e)})))):"gradient"===c?(n=f.domain(),r=yg(f,n[0],uE(n)),g.length<3&&!e.values&&n[0]!==uE(n)&&(g=[n[0],uE(n)]),l=g.map((e,t)=>Bu({index:t,label:m(e,t,g),value:e,perc:r(e)}))):(i=g.length-1,r=function(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+ah(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=g.map((e,t)=>Bu({index:t,label:m(e,t,g),value:e,perc:t?r(e):0,perc2:t===i?1:r(g[t+1])}))),s.source=l,s.add=l,this.value=l,s}});const FE=e=>e.source.x,jE=e=>e.source.y,TE=e=>e.target.x,NE=e=>e.target.y;function ME(e){fs.call(this,{},e)}ME.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"}]},wE(ME,fs,{transform(e,t){var n=e.sourceX||FE,r=e.sourceY||jE,i=e.targetX||TE,o=e.targetY||NE,a=e.as||"path",u=e.orient||"vertical",s=e.shape||"line",l=zE.get(s+"-"+u)||zE.get(s);return l||Zw("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 BE=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,PE=(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},RE=(e,t,n,r)=>{const i=n-e,o=r-t,a=.2*(i+o),u=.2*(o-i);return"M"+e+","+t+"C"+(e+a)+","+(t+u)+" "+(n+u)+","+(r-a)+" "+n+","+r},zE=xE({line:BE,"line-radial":(e,t,n,r)=>BE(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),arc:PE,"arc-radial":(e,t,n,r)=>PE(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),curve:RE,"curve-radial":(e,t,n,r)=>RE(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),u=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*u+"L"+r*a+","+r*u},"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),u=Math.sin(n),s=(t+r)/2;return"M"+t*i+","+t*o+"C"+s*i+","+s*o+" "+s*a+","+s*u+" "+r*a+","+r*u}});function LE(e){fs.call(this,null,e)}LE.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"]}]},wE(LE,fs,{transform(e,t){var n,r,i,o=e.as||["startAngle","endAngle"],a=o[0],u=o[1],s=e.field||rE,l=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,f=t.source,d=f.map(s),h=d.length,p=l,m=(c-l)/AE(d),g=Hl(h);for(e.sort&&g.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: "+_E(t)));return t}function WE(e,t,n){return gE(e)&&(t||n)?mg(e,HE(t||[0,1],n)):e}function HE(e,t){return t?e.slice().reverse():e}function VE(e){fs.call(this,null,e)}wE($E,fs,{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 sg(t)&&t!==Km&&t!==Jm&&(e.scheme||e.range&&e.range.length&&e.range.every(EE))})(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=og(i)()),e)if(!UE[i]){if("padding"===i&&IE(r.type))continue;gE(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&&Zw("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*Gm(n,i,r)]}(r,t,n);else if(t.scheme&&(o=function(e,t,n){var r,i,o=t.schemeExtent;oE(t.scheme)?i=gg(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),(i=_g(r))||Zw("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,dg(e)?WE(i,o,t.reverse):gE(i)?vg(WE(i,o),n):"ordinal"===e?i:i.slice(0,n)}(r,t,n),gE(o))){if(e.interpolator)return e.interpolator(o);Zw("Scale type ".concat(r," does not support interpolating color schemes."))}if(o&&dg(r))return e.interpolator(gg(HE(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(bg(t.interpolate,t.interpolateGamma)):gE(e.round)?e.round(i):gE(e.rangeRound)&&e.interpolate(i?Ep:wp);o&&e.range(HE(o,t.reverse))}(r,e,function(e,t,n){let r=t.bins;if(r&&!oE(r)){const t=e.domain(),n=t[0],i=uE(t),o=r.step;let a=null==r.start?n:r.start,u=null==r.stop?i:r.stop;o||Zw("Scale bins parameter missing step property."),ai&&(u=o*Math.floor(i/o)),r=Hl(a,u+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(qE(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(r>-1)return r;var i,o,a=t.domain,u=e.type,s=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;IE(u)&&t.padding&&a[0]!==uE(a)&&(a=function(e,t,n,r,i,o){var a=Math.abs(uE(n)-n[0]),u=a/(a-2*r),s=e===Xm?function(e,t,n){const r=Math.sign(e[0]);return pE(e,t,n,cE(r),lE(r))}(t,null,u):"sqrt"===e?mE(t,null,u,.5):"pow"===e?mE(t,null,u,i||1):"symlog"===e?function(e,t,n,r){return pE(e,t,n,fE(r),dE(r))}(t,null,u,o||1):function(e,t,n){return pE(e,t,n,sE,nE)}(t,null,u);return(t=t.slice())[0]=s[0],t[t.length-1]=s[1],t}(u,a,t.range,t.padding,t.exponent,t.constant));if((s||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(i=(a=a.slice()).length-1||1,s&&(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(s);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;rfunction(t){return t[e]},r_=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||i_("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&i_("Access path missing closing bracket: "+e),a&&i_("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function a_(e,t,n){const r=o_(e);return e=1===r.length?r[0]:e,QE((n&&n.get||t_)(r),[e],t||e)}a_("id");const u_=QE(e=>e,[],"identity"),s_=QE(()=>0,[],"zero"),l_=QE(()=>1,[],"one");QE(()=>!0,[],"true"),QE(()=>!1,[],"false");var c_=Array.isArray;function f_(e){return null!=e?c_(e)?e:[e]:[]}function d_(e){return"function"==typeof e}function h_(e){return d_(e)?e:()=>e}function p_(e){for(let t,n,r=1,i=arguments.length;re;function y_(e,t){e&&x_.hasOwnProperty(e.type)&&x_[e.type](e,t)}var b_={Feature:function(e,t){y_(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 k_=Math.PI,C_=k_/2,O_=k_/4,S_=2*k_,D_=180/k_,F_=k_/180,j_=Math.abs,T_=Math.atan,N_=Math.atan2,M_=Math.cos,B_=Math.ceil,P_=Math.exp,R_=(Math.floor,Math.hypot),z_=Math.log,L_=Math.pow,I_=Math.sin,U_=Math.sign||function(e){return e>0?1:e<0?-1:0},$_=Math.sqrt,q_=Math.tan;function W_(e){return e>1?0:e<-1?k_:Math.acos(e)}function H_(e){return e>1?C_:e<-1?-C_:Math.asin(e)}function V_(){}var Y_,G_,X_,K_,J_=new A_,Q_=new A_,Z_={point:V_,lineStart:V_,lineEnd:V_,polygonStart:function(){Z_.lineStart=eA,Z_.lineEnd=rA},polygonEnd:function(){Z_.lineStart=Z_.lineEnd=Z_.point=V_,J_.add(j_(Q_)),Q_=new A_},result:function(){var e=J_/2;return J_=new A_,e}};function eA(){Z_.point=tA}function tA(e,t){Z_.point=nA,Y_=X_=e,G_=K_=t}function nA(e,t){Q_.add(K_*e-X_*t),X_=e,K_=t}function rA(){nA(Y_,G_)}var iA=Z_,oA=1/0,aA=oA,uA=-oA,sA=uA;var lA,cA,fA,dA,hA={point:function(e,t){euA&&(uA=e);tsA&&(sA=t)},lineStart:V_,lineEnd:V_,polygonStart:V_,polygonEnd:V_,result:function(){var e=[[oA,aA],[uA,sA]];return uA=sA=-(aA=oA=1/0),e}},pA=0,mA=0,gA=0,vA=0,yA=0,bA=0,xA=0,wA=0,EA=0,_A={point:AA,lineStart:kA,lineEnd:SA,polygonStart:function(){_A.lineStart=DA,_A.lineEnd=FA},polygonEnd:function(){_A.point=AA,_A.lineStart=kA,_A.lineEnd=SA},result:function(){var e=EA?[xA/EA,wA/EA]:bA?[vA/bA,yA/bA]:gA?[pA/gA,mA/gA]:[NaN,NaN];return pA=mA=gA=vA=yA=bA=xA=wA=EA=0,e}};function AA(e,t){pA+=e,mA+=t,++gA}function kA(){_A.point=CA}function CA(e,t){_A.point=OA,AA(fA=e,dA=t)}function OA(e,t){var n=e-fA,r=t-dA,i=$_(n*n+r*r);vA+=i*(fA+e)/2,yA+=i*(dA+t)/2,bA+=i,AA(fA=e,dA=t)}function SA(){_A.point=AA}function DA(){_A.point=jA}function FA(){TA(lA,cA)}function jA(e,t){_A.point=TA,AA(lA=fA=e,cA=dA=t)}function TA(e,t){var n=e-fA,r=t-dA,i=$_(n*n+r*r);vA+=i*(fA+e)/2,yA+=i*(dA+t)/2,bA+=i,xA+=(i=dA*e-fA*t)*(fA+e),wA+=i*(dA+t),EA+=3*i,AA(fA=e,dA=t)}var NA=_A;function MA(e){this._context=e}MA.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,S_)}},result:V_};var BA,PA,RA,zA,LA,IA=new A_,UA={point:V_,lineStart:function(){UA.point=$A},lineEnd:function(){BA&&qA(PA,RA),UA.point=V_},polygonStart:function(){BA=!0},polygonEnd:function(){BA=null},result:function(){var e=+IA;return IA=new A_,e}};function $A(e,t){UA.point=qA,PA=zA=e,RA=LA=t}function qA(e,t){zA-=e,LA-=t,IA.add($_(zA*zA+LA*LA)),zA=e,LA=t}var WA=UA;function HA(){this._string=[]}function VA(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}HA.prototype={_radius:4.5,_circle:VA(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=VA(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 YA=function(e,t){var n,r,i=4.5;function o(e){return e&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),__(e,n(r))),r.result()}return o.area=function(e){return __(e,n(iA)),iA.result()},o.measure=function(e){return __(e,n(WA)),WA.result()},o.bounds=function(e){return __(e,n(hA)),hA.result()},o.centroid=function(e){return __(e,n(NA)),NA.result()},o.projection=function(t){return arguments.length?(n=null==t?(e=null,v_):(e=t).stream,o):e},o.context=function(e){return arguments.length?(r=null==e?(t=null,new HA):new MA(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)},GA=function(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:V_,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}},XA=function(e,t){return j_(e[0]-t[0])<1e-6&&j_(e[1]-t[1])<1e-6};function KA(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 JA=function(e,t,n,r,i){var o,a,u=[],s=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,n,r=e[0],a=e[t];if(XA(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 QA(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r=0?1:-1,C=k*A,O=C>k_,S=g*E;if(s.add(N_(S*k*I_(C),v*_+S*M_(C))),a+=O?A+k*S_:A,O^p>=n^x>=n){var D=nk(ek(h),ek(b));ok(D);var F=nk(o,D);ok(F);var j=(O^A>=0?-1:1)*H_(F[2]);(r>j||r===j&&(D[0]||D[1]))&&(u+=O^A>=0?1:-1)}}return(a<-1e-6||a<1e-6&&s<-1e-12)^1&u}(o,r);a.length?(f||(i.polygonStart(),f=!0),JA(a,ck,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){s.point(e,t)}function m(){d.point=p,s.lineStart()}function g(){d.point=h,s.lineEnd()}function v(e,t){u.push([e,t]),c.point(e,t)}function y(){c.lineStart(),u=[]}function b(){v(u[0][0],u[0][1]),c.lineEnd();var e,t,n,r,s=c.clean(),d=l.result(),h=d.length;if(u.pop(),o.push(u),u=null,h)if(1&s){if((t=(n=d[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),e=0;e1&&2&s&&d.push(d.pop().concat(d.shift())),a.push(d.filter(lk))}return d}};function lk(e){return e.length>1}function ck(e,t){return((e=e.x)[0]<0?e[1]-C_-1e-6:C_-e[1])-((t=t.x)[0]<0?t[1]-C_-1e-6:C_-t[1])}var fk=sk((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 u=o>0?k_:-k_,s=j_(o-n);j_(s-k_)<1e-6?(e.point(n,r=(r+a)/2>0?C_:-C_),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(u,r),e.point(o,r),t=0):i!==u&&s>=k_&&(j_(n-i)<1e-6&&(n-=1e-6*i),j_(o-u)<1e-6&&(o-=1e-6*u),r=function(e,t,n,r){var i,o,a=I_(e-n);return j_(a)>1e-6?T_((I_(t)*(o=M_(r))*I_(n)-I_(r)*(i=M_(t))*I_(e))/(i*o*a)):(t+r)/2}(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(u,r),t=0),e.point(n=o,r=a),i=u},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*C_,r.point(-k_,i),r.point(0,i),r.point(k_,i),r.point(k_,0),r.point(k_,-i),r.point(0,-i),r.point(-k_,-i),r.point(-k_,0),r.point(-k_,i);else if(j_(e[0]-t[0])>1e-6){var o=e[0]k_?e+Math.round(-e/S_)*S_:e,t]}function pk(e,t,n){return(e%=S_)?t||n?dk(gk(e),vk(t,n)):gk(e):t||n?vk(t,n):hk}function mk(e){return function(t,n){return[(t+=e)>k_?t-S_:t<-k_?t+S_:t,n]}}function gk(e){var t=mk(e);return t.invert=mk(-e),t}function vk(e,t){var n=M_(e),r=I_(e),i=M_(t),o=I_(t);function a(e,t){var a=M_(t),u=M_(e)*a,s=I_(e)*a,l=I_(t),c=l*n+u*r;return[N_(s*i-c*o,u*n-l*r),H_(c*i+s*o)]}return a.invert=function(e,t){var a=M_(t),u=M_(e)*a,s=I_(e)*a,l=I_(t),c=l*i-s*o;return[N_(s*i+l*o,u*n+c*r),H_(c*n-u*r)]},a}hk.invert=hk;function yk(e,t,n,r,i,o){if(n){var a=M_(t),u=I_(t),s=r*n;null==i?(i=t+r*S_,o=t-s/2):(i=bk(a,i),o=bk(a,o),(r>0?io)&&(i+=r*S_));for(var l,c=i;r>0?c>o:c0,i=j_(t)>1e-6;function o(e,n){return M_(e)*M_(n)>t}function a(e,n,r){var i=[1,0,0],o=nk(ek(e),ek(n)),a=tk(o,o),u=o[0],s=a-u*u;if(!s)return!r&&e;var l=t*a/s,c=-t*u/s,f=nk(i,o),d=ik(i,l);rk(d,ik(o,c));var h=f,p=tk(d,h),m=tk(h,h),g=p*p-m*(tk(d,d)-1);if(!(g<0)){var v=$_(g),y=ik(h,(-p-v)/m);if(rk(y,d),y=ZA(y),!r)return y;var b,x=e[0],w=n[0],E=e[1],_=n[1];w0^y[1]<(j_(y[0]-x)<1e-6?E:_):E<=y[1]&&y[1]<=_:A>k_^(x<=y[0]&&y[0]<=w)){var C=ik(h,(-p+v)/m);return rk(C,d),[y,ZA(C)]}}}function u(t,n){var i=r?e:k_-e,o=0;return t<-i?o|=1:t>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return sk(o,(function(e){var t,n,s,l,c;return{lineStart:function(){l=s=!1,c=1},point:function(f,d){var h,p=[f,d],m=o(f,d),g=r?m?0:u(f,d):m?u(f+(f<0?k_:-k_),d):0;if(!t&&(l=s=m)&&e.lineStart(),m!==s&&(!(h=a(t,p))||XA(t,h)||XA(p,h))&&(p[2]=1),m!==s)c=0,m?(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^m){var v;g&n||!(v=a(p,t,!0))||(c=0,r?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1],3)))}!m||t&&XA(t,p)||e.point(p[0],p[1]),t=p,s=m,n=g},lineEnd:function(){s&&e.lineEnd(),t=null},clean:function(){return c|(l&&s)<<1}}}),(function(t,r,i,o){yk(o,e,n,i,t,r)}),r?[0,-e]:[-k_,e-k_])};function wk(e,t,n,r){function i(i,o){return e<=i&&i<=n&&t<=o&&o<=r}function o(i,o,u,l){var c=0,f=0;if(null==i||(c=a(i,u))!==(f=a(o,u))||s(i,o)<0^u>0)do{l.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+u+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return j_(r[0]-e)<1e-6?i>0?0:3:j_(r[0]-n)<1e-6?i>0?2:1:j_(r[1]-t)<1e-6?i>0?1:0:i>0?3:2}function u(e,t){return s(e.x,t.x)}function s(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 s,l,c,f,d,h,p,m,g,v,y,b=a,x=GA(),w={point:E,lineStart:function(){w.point=_,l&&l.push(c=[]);v=!0,g=!1,p=m=NaN},lineEnd:function(){s&&(_(f,d),h&&g&&x.rejoin(),s.push(x.result()));w.point=E,g&&b.lineEnd()},polygonStart:function(){b=x,s=[],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=(s=uk(s)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&JA(s,u,t,o,a),a.polygonEnd());b=a,s=l=c=null}};function E(e,t){i(e,t)&&b.point(e,t)}function _(o,a){var u=i(o,a);if(l&&c.push([o,a]),v)f=o,d=a,h=u,v=!1,u&&(b.lineStart(),b.point(o,a));else if(u&&g)b.point(o,a);else{var s=[p=Math.max(-1e9,Math.min(1e9,p)),m=Math.max(-1e9,Math.min(1e9,m))],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,u=e[0],s=e[1],l=0,c=1,f=t[0]-u,d=t[1]-s;if(a=n-u,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-u,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-s,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>l&&(l=a)}else if(d>0){if(a0&&(e[0]=u+l*f,e[1]=s+l*d),c<1&&(t[0]=u+c*f,t[1]=s+c*d),!0}}}}}(s,x,e,t,n,r)?u&&(b.lineStart(),b.point(o,a),y=!1):(g||(b.lineStart(),b.point(s[0],s[1])),b.point(x[0],x[1]),u||b.lineEnd(),y=!1)}p=o,m=a,g=u}return w}}function Ek(e){return function(t){var n=new _k;for(var r in e)n[r]=e[r];return n.stream=t,n}}function _k(){}function Ak(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),__(n,e.stream(hA)),t(hA.result()),null!=r&&e.clipExtent(r),e}function kk(e,t,n){return Ak(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,u=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,u])}),n)}function Ck(e,t,n){return kk(e,[[0,0],t],n)}function Ok(e,t,n){return Ak(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 Sk(e,t,n){return Ak(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)}_k.prototype={constructor:_k,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 Dk=M_(30*F_),Fk=function(e,t){return+t?function(e,t){function n(r,i,o,a,u,s,l,c,f,d,h,p,m,g){var v=l-r,y=c-i,b=v*v+y*y;if(b>4*t&&m--){var x=a+d,w=u+h,E=s+p,_=$_(x*x+w*w+E*E),A=H_(E/=_),k=j_(j_(E)-1)<1e-6||j_(o-f)<1e-6?(o+f)/2:N_(w,x),C=e(k,A),O=C[0],S=C[1],D=O-r,F=S-i,j=y*D-v*F;(j*j/b>t||j_((v*D+y*F)/b-.5)>.3||a*d+u*h+s*p2?e[2]%360*F_:0,D()):[g*D_,v*D_,y*D_]},O.angle=function(e){return arguments.length?(b=e%360*F_,D()):b*D_},O.reflectX=function(e){return arguments.length?(x=e?-1:1,D()):x<0},O.reflectY=function(e){return arguments.length?(w=e?-1:1,D()):w<0},O.precision=function(e){return arguments.length?(a=Fk(u,C=e*e),F()):$_(C)},O.fitExtent=function(e,t){return kk(O,e,t)},O.fitSize=function(e,t){return Ck(O,e,t)},O.fitWidth=function(e,t){return Ok(O,e,t)},O.fitHeight=function(e,t){return Sk(O,e,t)},function(){return t=e.apply(this,arguments),O.invert=t.invert&&S,D()}}function Bk(e){var t=0,n=k_/3,r=Mk(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*F_,n=e[1]*F_):[t*D_,n*D_]},i}function Pk(e,t){var n=I_(e),r=(n+I_(t))/2;if(j_(r)<1e-6)return function(e){var t=M_(e);function n(e,n){return[e*t,I_(n)/t]}return n.invert=function(e,n){return[e/t,H_(n*t)]},n}(e);var i=1+n*(2*r-n),o=$_(i)/r;function a(e,t){var n=$_(i-2*r*I_(t))/r;return[n*I_(e*=r),o-n*M_(e)]}return a.invert=function(e,t){var n=o-t,a=N_(e,j_(n))*U_(n);return n*r<0&&(a-=k_*U_(e)*U_(n)),[a/r,H_((i-(e*e+n*n)*r*r)/(2*r))]},a}var Rk=function(){return Bk(Pk).scale(155.424).center([0,33.6442])},zk=function(){return Rk().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};function Lk(e){return function(t,n){var r=M_(t),i=M_(n),o=e(r*i);return o===1/0?[2,0]:[o*i*I_(t),o*I_(n)]}}function Ik(e){return function(t,n){var r=$_(t*t+n*n),i=e(r),o=I_(i),a=M_(i);return[N_(t*o,r*a),H_(r&&n*o/r)]}}var Uk=Lk((function(e){return $_(2/(1+e))}));Uk.invert=Ik((function(e){return 2*H_(e/2)}));var $k=Lk((function(e){return(e=W_(e))&&e/I_(e)}));$k.invert=Ik((function(e){return e}));function qk(e,t){return[e,z_(q_((C_+t)/2))]}qk.invert=function(e,t){return[e,2*T_(P_(t))-C_]};function Wk(e){var t,n,r,i=Nk(e),o=i.center,a=i.scale,u=i.translate,s=i.clipExtent,l=null;function c(){var o=k_*a(),u=i(function(e){function t(t){return(t=e(t[0]*F_,t[1]*F_))[0]*=D_,t[1]*=D_,t}return e=pk(e[0]*F_,e[1]*F_,e.length>2?e[2]*F_:0),t.invert=function(t){return(t=e.invert(t[0]*F_,t[1]*F_))[0]*=D_,t[1]*=D_,t},t}(i.rotate()).invert([0,0]));return s(null==l?[[u[0]-o,u[1]-o],[u[0]+o,u[1]+o]]:e===qk?[[Math.max(u[0]-o,l),t],[Math.min(u[0]+o,n),r]]:[[l,Math.max(u[1]-o,t)],[n,Math.min(u[1]+o,r)]])}return i.scale=function(e){return arguments.length?(a(e),c()):a()},i.translate=function(e){return arguments.length?(u(e),c()):u()},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 Hk(e){return q_((C_+e)/2)}function Vk(e,t){var n=M_(e),r=e===t?I_(e):z_(n/M_(t))/z_(Hk(t)/Hk(e)),i=n*L_(Hk(e),r)/r;if(!r)return qk;function o(e,t){i>0?t<1e-6-C_&&(t=1e-6-C_):t>C_-1e-6&&(t=C_-1e-6);var n=i/L_(Hk(t),r);return[n*I_(r*e),i-n*M_(r*e)]}return o.invert=function(e,t){var n=i-t,o=U_(r)*$_(e*e+n*n),a=N_(e,j_(n))*U_(n);return n*r<0&&(a-=k_*U_(e)*U_(n)),[a/r,2*T_(L_(i/o,1/r))-C_]},o}function Yk(e,t){return[e,t]}Yk.invert=Yk;function Gk(e,t){var n=M_(e),r=e===t?I_(e):(n-M_(t))/(t-e),i=n/r+e;if(j_(r)<1e-6)return Yk;function o(e,t){var n=i-t,o=r*e;return[n*I_(o),i-n*M_(o)]}return o.invert=function(e,t){var n=i-t,o=N_(e,j_(n))*U_(n);return n*r<0&&(o-=k_*U_(e)*U_(n)),[o/r,i-U_(r)*$_(e*e+n*n)]},o}var Xk=1.340264,Kk=-.081106,Jk=893e-6,Qk=.003796,Zk=$_(3)/2;function eC(e,t){var n=H_(Zk*I_(t)),r=n*n,i=r*r*r;return[e*M_(n)/(Zk*(Xk+3*Kk*r+i*(7*Jk+9*Qk*r))),n*(Xk+Kk*r+i*(Jk+Qk*r))]}eC.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*(Xk+Kk*i+o*(Jk+Qk*i))-t)/(Xk+3*Kk*i+o*(7*Jk+9*Qk*i)))*r)*i*i,!(j_(n)<1e-12));++a);return[Zk*e*(Xk+3*Kk*i+o*(7*Jk+9*Qk*i))/M_(r),H_(I_(r)/Zk)]};function tC(e,t){var n=M_(t),r=M_(e)*n;return[n*I_(e)/r,I_(t)/r]}tC.invert=Ik(T_);function nC(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)))]}nC.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(j_(n)>1e-6&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};function rC(e,t){return[M_(t)*I_(e),I_(t)]}rC.invert=Ik(H_);function iC(e,t){var n=M_(t),r=1+M_(e)*n;return[n*I_(e)/r,I_(t)/r]}iC.invert=Ik((function(e){return 2*T_(e)}));function oC(e,t){return[z_(q_((C_+t)/2)),-e]}oC.invert=function(e,t){return[-t,2*T_(P_(e))-C_]};var aC=Math.abs,uC=(Math.atan,Math.atan2,Math.ceil,Math.cos),sC=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),lC=(Math.tan,Math.PI),cC=lC/2,fC=(Math.SQRT1_2,hC(2));hC(lC);function dC(e){return e>1?cC:e<-1?-cC:Math.asin(e)}function hC(e){return e>0?Math.sqrt(e):0}function pC(e,t){var n,r=e*sC(t),i=30;do{t-=n=(t+sC(t)-r)/(1+uC(t))}while(aC(n)>1e-6&&--i>0);return t/2}var mC=function(e,t,n){function r(r,i){return[e*r*uC(i=pC(n,i)),t*sC(i)]}return r.invert=function(r,i){return i=dC(i/t),[r/(e*uC(i)),dC((2*i+sC(2*i))/n)]},r}(fC/cC,fC,lC);const gC=YA(),vC=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function yC(e,t){return function n(){const r=t();return r.type=e,r.path=YA().projection(r),r.copy=r.copy||function(){const e=n();return vC.forEach(t=>{r[t]&&e[t](r[t]())}),e.path.pointRadius(r.path.pointRadius()),e},r}}function bC(e,t){if(!e||"string"!=typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(wC[e]=yC(e,t),this):wC[e]||null}function xC(e){return e&&e.path||gC}const wC={albers:zk,albersusa:function(){var e,t,n,r,i,o,a=zk(),u=Rk().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=Rk().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?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:a).invert(e)},c.stream=function(n){return e&&t===n?e:(r=[a.stream(t=n),u.stream(n),s.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 wC)bC(e,wC[e]);function EC(e,t,n){var r=Hl(e,t-1e-6,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function _C(e,t,n){var r=Hl(e,t-1e-6,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}function AC(){var e,t,n,r,i,o,a,u,s,l,c,f,d=10,h=d,p=90,m=360,g=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return Hl(B_(r/p)*p,n,p).map(c).concat(Hl(B_(u/m)*m,a,m).map(f)).concat(Hl(B_(t/d)*d,e,d).filter((function(e){return j_(e%p)>1e-6})).map(s)).concat(Hl(B_(o/h)*h,i,h).filter((function(e){return j_(e%m)>1e-6})).map(l))}return v.lines=function(){return y().map((function(e){return{type:"LineString",coordinates:e}}))},v.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(u).reverse().slice(1))]}},v.extent=function(e){return arguments.length?v.extentMajor(e).extentMinor(e):v.extentMinor()},v.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],u=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),u>a&&(e=u,u=a,a=e),v.precision(g)):[[r,u],[n,a]]},v.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),v.precision(g)):[[t,o],[e,i]]},v.step=function(e){return arguments.length?v.stepMajor(e).stepMinor(e):v.stepMinor()},v.stepMajor=function(e){return arguments.length?(p=+e[0],m=+e[1],v):[p,m]},v.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],v):[d,h]},v.precision=function(d){return arguments.length?(g=+d,s=EC(o,i,90),l=_C(t,e,g),c=EC(u,a,90),f=_C(r,n,g),v):g},v.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function kC(){}const CC=[[],[[[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 OC(){var e=1,t=1,n=a;function r(e,t){return t.map(t=>i(e,t))}function i(r,i){var a=[],u=[];return function(n,r,i){var a,u,s,l,c,f,d=new Array,h=new Array;a=u=-1,l=n[0]>=r,CC[l<<1].forEach(p);for(;++a=r,CC[s|l<<1].forEach(p);CC[l<<0].forEach(p);for(;++u=r,c=n[u*e]>=r,CC[l<<1|c<<2].forEach(p);++a=r,f=c,c=n[u*e+a+1]>=r,CC[s|l<<1|c<<2|f<<3].forEach(p);CC[l|c<<3].forEach(p)}a=-1,c=n[u*e]>=r,CC[c<<2].forEach(p);for(;++a=r,CC[c<<2|f<<3].forEach(p);function p(e){var t,n,r=[e[0][0]+a,e[0][1]+u],s=[e[1][0]+a,e[1][1]+u],l=o(r),c=o(s);(t=h[l])?(n=d[c])?(delete h[t.end],delete d[n.start],t===n?(t.ring.push(s),i(t.ring)):d[t.start]=h[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete h[t.end],t.ring.push(s),h[t.end=c]=t):(t=d[c])?(n=h[l])?(delete d[t.start],delete h[n.end],t===n?(t.ring.push(s),i(t.ring)):d[n.start]=h[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete d[t.start],t.ring.unshift(r),d[t.start=l]=t):d[l]=h[c]={start:l,end:c,ring:[r,s]}}CC[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]):u.push(e)}),u.forEach(e=>{for(var t,n=0,r=a.length;n{var o,a=n[0],u=n[1],s=0|a,l=0|u,c=r[l*e+s];a>0&&a0&&u=0&&o>=0||i_("invalid size"),e=i,t=o,r},r.smooth=function(e){return arguments.length?(n=e?a:kC,r):n===a},r}function SC(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 FC(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 jC(e,t,n){return function(r){var i=function(e,t){let n,r,i,o,a=0;if(e&&(n=e.length))if(null==t){for(r=e[a];ao&&(o=r))}else{for(r=t(e[a]);ao&&(o=r))}return[i,o]}(r),o=n?Math.min(i[0],0):i[0],a=i[1],u=a-o,s=t?Qn(o,a,e):u/(e+1);return Hl(o+s,a,s)}}function TC(e){fs.call(this,null,e)}function NC(e,t,n,r,i){const o=e.x1||0,a=e.y1||0,u=t*n<0;function s(e){e.forEach(l)}function l(e){u&&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(s),e}}function MC(e,t,n){const r=e>=0?e:el(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function BC(e){return d_(e)?e:h_(+e)}function PC(){var e=e=>e[0],t=e=>e[1],n=l_,r=[-1,-1],i=960,o=500,a=2;function u(u,s){const l=MC(r[0],u,e)>>a,c=MC(r[1],u,t)>>a,f=l?l+2:0,d=c?c+2:0,h=2*f+(i>>a),p=2*d+(o>>a),m=new Float32Array(h*p),g=new Float32Array(h*p);let v=m;u.forEach(r=>{const i=f+(+e(r)>>a),o=d+(+t(r)>>a);i>=0&&i=0&&o0&&c>0?(RC(h,p,m,g,l),zC(h,p,g,m,c),RC(h,p,m,g,l),zC(h,p,g,m,c),RC(h,p,m,g,l),zC(h,p,g,m,c)):l>0?(RC(h,p,m,g,l),RC(h,p,g,m,l),RC(h,p,m,g,l),v=g):c>0&&(zC(h,p,m,g,c),zC(h,p,g,m,c),zC(h,p,m,g,c),v=g);const y=s?Math.pow(2,-2*a):1/AE(v);for(let e=0,t=h*p;e>a),y2:d+(o>>a)}}return u.x=function(t){return arguments.length?(e=BC(t),u):e},u.y=function(e){return arguments.length?(t=BC(e),u):t},u.weight=function(e){return arguments.length?(n=BC(e),u):n},u.size=function(e){if(!arguments.length)return[i,o];var t=+e[0],n=+e[1];return t>=0&&n>=0||i_("invalid size"),i=t,o=n,u},u.cellSize=function(e){return arguments.length?((e=+e)>=1||i_("invalid cell size"),a=Math.floor(Math.log(e)/Math.LN2),u):1<=i&&(t>=o&&(u-=n[t-o+a*e]),r[t-i+a*e]=u/Math.min(t+1,e-1+o-t,o))}function zC(e,t,n,r,i){const o=1+(i<<1);for(let a=0;a=i&&(u>=o&&(s-=n[a+(u-o)*e]),r[a+(u-i)*e]=s/Math.min(u+1,t-1+o-u,o))}function LC(e){fs.call(this,null,e)}TC.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"}]},m_(TC,fs,{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||u_,o=OC().smooth(!1!==e.smooth),a=e.thresholds||function(e,t,n){const r=jC(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(e.map(e=>Ws(t(e).values)))}(r,i,e),u=null===e.as?null:e.as||"contour",s=[];return r.forEach(t=>{const n=i(t),r=o.size([n.width,n.height])(n.values,c_(a)?a:a(n.values));!function(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;d_(i)&&(i=i(n,r));d_(o)&&(o=o(n,r));if((1===i||null==i)&&!o)return;const a=(g_(i)?i:i[0])||1,u=(g_(i)?i:i[1])||1,s=o&&o[0]||0,l=o&&o[1]||0;e.forEach(NC(t,a,u,s,l))}(r,n,t,e),r.forEach(e=>{s.push(Ru(t,Bu(null!=u?{[u]:e}:e)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=s,n}}),LC.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 IC=["x","y","weight","size","cellSize","bandwidth"];function UC(e,t){return IC.forEach(n=>null!=t[n]?e[n](t[n]):0),e}function $C(e){fs.call(this,null,e)}m_(LC,fs,{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,u,s=[],l=e=>e(o);if(null==t)s.push(e);else for(n={},r=0,i=e.length;rBu(function(e,t){for(let n=0;nr.push(s(e))),a&&u&&(t.visit(l,e=>{var t=a(e),n=u(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}}}),WC.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"}]},m_(WC,fs,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||u_,o=e.as||"path",a=n.SOURCE;!r||e.modified()?(this.value=r=xC(e.projection),n.materialize().reflow()):a=i===u_||t.modified(i.fields)?n.ADD_MOD:n.ADD;const u=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(u),n.modifies(o)}}),HC.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"]}]},m_(HC,fs,{transform(e,t){var n,r=e.projection,i=e.fields[0],o=e.fields[1],a=e.as||["x","y"],u=a[0],s=a[1];function l(e){const t=r([i(e),o(e)]);t?(e[u]=t[0],e[s]=t[1]):(e[u]=void 0,e[s]=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)}}),VC.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"}]},m_(VC,fs,{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}(xC(e.projection),e.field||a_("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,e=>e[i]=r),n.modifies(i)}}),YC.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}]},m_(YC,fs,{transform(e,t){var n,r=this.value,i=this.generator;if(!r.length||e.modified())for(const t in e)d_(i[t])&&i[t](e[t]);return n=i(),r.length?t.mod.push(zu(r[0],n)):t.add.push(Bu(n)),r[0]=n,t}}),GC.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"}]},m_(GC,fs,{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||u_,o=function(e,t){let n;d_(e)?(n=n=>e(n,t),n.dep=XC(e)):e?n=h_(e):(n=e=>e.$value/e.$max||0,n.dep=!0);return n}(e.opacity,e),a=function(e,t){let n;d_(e)?(n=n=>qh(e(n,t)),n.dep=XC(e)):n=h_(qh(e||"#888"));return n}(e.color,e),u=e.as||"image",s={$x:0,$y:0,$value:0,$max:r?Ws(n.map(e=>Ws(i(e).values))):0};return n.forEach(e=>{const t=i(e),n=p_({},e,s);r||(n.$max=Ws(t.values||[])),e[u]=function(e,t,n,r){const i=e.width,o=e.height,a=e.x1||0,u=e.y1||0,s=e.x2||i,l=e.y2||o,c=e.values,f=c?e=>c[e]:s_,d=Xd(s-a,l-u),h=d.getContext("2d"),p=h.getImageData(0,0,s-a,l-u),m=p.data;for(let e=u,o=0;e{null!=e[t]&&JC(n,t,e[t])})):vC.forEach(t=>{e.modified(t)&&JC(n,t,e[t])}),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return 1===(e=f_(e)).length?e[0]:{type:"FeatureCollection",features:e.reduce((e,t)=>e.concat(function(e){return"FeatureCollection"===e.type?e.features:f_(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)}});const tO=e=>function(t){return t[e]},nO=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||rO("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&rO("Access path missing closing bracket: "+e),a&&rO("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function oO(e,t,n){const r=iO(e);return e=1===r.length?r[0]:e,QC((n&&n.get||eO)(r),[e],t||e)}oO("id"),QC(e=>e,[],"identity"),QC(()=>0,[],"zero"),QC(()=>1,[],"one"),QC(()=>!0,[],"true"),QC(()=>!1,[],"false");var aO=Array.isArray;function uO(e){return null!=e?aO(e)?e:[e]:[]}function sO(e){return"function"==typeof e}const lO=Object.prototype.hasOwnProperty;function cO(e,t){return lO.call(e,t)}function fO(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o,a,u,s,l,c,f,d,h=e._root,p={data:r},m=e._x0,g=e._y0,v=e._x1,y=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((l=t>=(o=(m+v)/2))?m=o:v=o,(c=n>=(a=(g+y)/2))?g=a:y=a,i=h,!(h=h[f=c<<1|l]))return i[f]=p,e;if(u=+e._x.call(null,h.data),s=+e._y.call(null,h.data),t===u&&n===s)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=(m+v)/2))?m=o:v=o,(c=n>=(a=(g+y)/2))?g=a:y=a}while((f=c<<1|l)==(d=(s>=a)<<1|u>=o));return i[d]=h,i[f]=p,e}var dO=function(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i};function hO(e){return e[0]}function pO(e){return e[1]}function mO(e,t,n){var r=new gO(null==t?hO:t,null==n?pO:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function gO(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 vO(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var yO=mO.prototype=gO.prototype;yO.copy=function(){var e,t,n=new gO(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=vO(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]=vO(t));return n},yO.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return fO(this.cover(t,n),t,n,e)},yO.addAll=function(e){var t,n,r,i,o=e.length,a=new Array(o),u=new Array(o),s=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),if&&(f=i));if(s>c||l>f)return this;for(this.cover(s,l).cover(c,f),n=0;ne||e>=i||r>t||t>=o;)switch(u=(td||(o=s.y0)>h||(a=s.x1)=v)<<1|e>=g)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=s)}else{var y=e-+this._x.call(null,m.data),b=t-+this._y.call(null,m.data),x=y*y+b*b;if(x=(u=(p+g)/2))?p=u:g=u,(c=a>=(s=(m+v)/2))?m=s:v=s,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)},yO.removeAll=function(e){for(var t=0,n=e.length;t{}};function AO(){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 OO(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;--TO}()}finally{TO=0,function(){var e,t,n=DO,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:DO=t);FO=e,VO(r)}(),PO=0}}function HO(){var e=zO.now(),t=e-BO;t>1e3&&(RO-=t,BO=e)}function VO(e){TO||(NO&&(NO=clearTimeout(NO)),e-PO>24?(e<1/0&&(NO=setTimeout(WO,e-zO.now()-RO)),MO&&(MO=clearInterval(MO))):(MO||(BO=zO.now(),MO=setInterval(HO,1e3)),TO=1,LO(WO)))}$O.prototype=qO.prototype={constructor:$O,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?IO():+n)+(null==t?0:+t),this._next||FO===this||(FO?FO._next=this:DO=this,FO=this),this._call=e,this._time=n,VO()},stop:function(){this._call&&(this._call=null,this._time=1/0,VO())}};function YO(e){return e.x}function GO(e){return e.y}var XO=Math.PI*(3-Math.sqrt(5));function KO(e){return e.index}function JO(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}const QO={center:function(e,t){var n,r=1;function i(){var i,o,a=n.length,u=0,s=0;for(i=0;il+p||oc+p||as.index){var m=l-u.x-u.vx,g=c-u.y-u.vy,v=m*m+g*g;ve.r&&(e.r=e[t].r)}function s(){if(t){var r,i,o=t.length;for(n=new Array(o),r=0;r=u)){(e.data!==t||e.next)&&(0===f&&(p+=(f=xO(n))*f),0===d&&(p+=(d=xO(n))*d),p[u(e,t,r),e]));for(a=0,i=new Array(l);at(e,n):t)}function uS(e,t,n){return e.fields=t||[],e.fname=n,e}function sS(e){return 1===e.length?lS(e[0]):cS(e)}nS.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:tS}]},function(e,t,n){const r=e.prototype=Object.create(t.prototype);r.constructor=e,function(e){for(let t,n,r=1,i=arguments.length;r(e=(1664525*e+1013904223)%4294967296)/4294967296}();function f(){d(),l.call("tick",t),n1?(null==n?u.delete(e):u.set(e,p(n)),t):u.get(e)},find:function(t,n,r){var i,o,a,u,s,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()),rS(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(eS)||t.changed()&&e.restart)if(i.alpha(Math.max(i.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/u)),e.static)for(i.stop();--u>=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,u=0,s=t.length;ufunction(t){return t[e]},cS=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||fS("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&fS("Access path missing closing bracket: "+e),a&&fS("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function hS(e,t,n){const r=dS(e);return e=1===r.length?r[0]:e,uS((n&&n.get||sS)(r),[e],t||e)}hS("id"),uS(e=>e,[],"identity"),uS(()=>0,[],"zero");const pS=uS(()=>1,[],"one"),mS=uS(()=>!0,[],"true");uS(()=>!1,[],"false");var gS=Array.isArray;function vS(e){return null!=e?gS(e)?e:[e]:[]}const yS=Object.prototype.hasOwnProperty;function bS(e,t){return yS.call(e,t)}function xS(e,t,n){const r=e.prototype=Object.create(t.prototype);return r.constructor=e,function(e){for(let t,n,r=1,i=arguments.length;r=0;)t+=n[r].value;else t=1;e.value=t}function ES(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=AS)):void 0===t&&(t=_S);for(var n,r,i,o,a,u=new OS(e),s=[u];n=s.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)s.push(r=i[o]=new OS(i[o])),r.parent=n,r.depth=n.depth+1;return u.eachBefore(CS)}function _S(e){return e.children}function AS(e){return Array.isArray(e)?e[1]:null}function kS(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function CS(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function OS(e){this.data=e,this.depth=this.height=0,this.parent=null}OS.prototype=ES.prototype={constructor:OS,count:function(){return this.eachAfter(wS)},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],u=[],s=-1;o=a.pop();)if(u.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 ES(this).eachBefore(kS)},[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 TS(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*u-o*s,n.y=e.y-r*s+o*u):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=t.x+r*u-o*s,n.y=t.y+r*s+o*u)):(n.x=t.x+n.r,n.y=t.y)}function RS(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 zS(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 LS(e){this._=e,this.next=null,this.previous=null}function IS(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,u,s,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;PS(r,n,i=e[2]),n=new LS(n),r=new LS(r),i=new LS(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(s=3;s0)throw new Error("cycle");return o}return n.id=function(t){return arguments.length?(e=$S(t),n):e},n.parentId=function(e){return arguments.length?(t=$S(e),n):t},n};function nD(e,t){return e.parent===t.parent?1:2}function rD(e){var t=e.children;return t?t[0]:e.t}function iD(e){var t=e.children;return t?t[t.length-1]:e.t}function oD(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 aD(e,t,n){return e.a.parent===t.parent?e.a:n}function uD(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}uD.prototype=Object.create(OS.prototype);function sD(e,t){return e.parent===t.parent?1:2}function lD(e,t){return e+t.x}function cD(e,t){return Math.max(e,t.y)}var fD=function(e,t,n,r,i){for(var o,a=e.children,u=-1,s=a.length,l=e.value&&(i-n)/e.value;++ud&&(d=u),g=c*c*m,(h=Math.max(d/g,g/f))>p){c-=u;break}p=h}v.push(a={value:c,dice:s1?t:1)},n}(dD),mD=function e(t){function n(e,n,r,i,o){if((a=e._squarify)&&a.ratio===t)for(var a,u,s,l,c,f=-1,d=a.length,h=e.value;++f1?t:1)},n}(dD);function gD(e,t,n){const r={};return e.each(e=>{const i=e.data;n(i)&&(r[t(i)]=e)}),e.lookup=r,e}function vD(e){fs.call(this,null,e)}vD.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const yD=e=>e.values;function bD(){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={},u={};let s,l,c,f=-1;for(;++f(e.push(n),t)};return t}function xD(e){fs.call(this,null,e)}xS(vD,fs,{transform(e,t){t.source||fS("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&&Tu(e.data)&&i.rem.push(e.data)}),this.value=o=ES({values:vS(e.keys).reduce((e,t)=>(e.key(t),e),bD()).entries(i.source)},yD),n&&o.each(e=>{e.children&&(e=Bu(e.data),i.add.push(e),i.source.push(e))}),gD(o,Nu,Nu)),i.source.root=o,i}});const wD=(e,t)=>e.parent===t.parent?1:2;xS(xD,fs,{transform(e,t){t.source&&t.source.root||fS(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(Lu(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)u.push(n=t.children[i]=new uD(r[i],i)),n.parent=t;return(a.parent=new uD(null,0)).children=[a],a}(i);if(s.eachAfter(o),s.parent.m=-s.z,s.eachBefore(a),r)i.eachBefore(u);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),m=n/(f.depth||1);i.eachBefore((function(e){e.x=(e.x+h)*p,e.y=e.depth*m}))}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,u=n,s=o.parent.children[0],l=o.m,c=a.m,f=u.m,d=s.m;u=iD(u),o=rD(o),u&&o;)s=rD(s),(a=iD(a)).a=t,(i=u.z+f-o.z-l+e(u._,o._))>0&&(oD(aD(u,t,r),t,i),l+=i,c+=i),f+=u.m,l+=o.m,d+=s.m,c+=a.m;u&&!iD(a)&&(a.t=u,a.m+=f-c),o&&!rD(s)&&(s.t=o,s.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 u(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=sD,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(lD,0)/e.length}(n),t.y=function(e){return 1+e.reduce(cD,0)}(n)):(t.x=o?a+=e(t,o):0,t.y=0,o=t)}));var u=function(e){for(var t;t=e.children;)e=t[0];return e}(i),s=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(i),l=u.x-e(u,s)/2,c=s.x+e(s,u)/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}},SD=["x","y","depth","children"];function DD(e){xD.call(this,e)}function FD(e){fs.call(this,[],e)}DD.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:SD.length,default:SD}]},xS(DD,xD,{layout(e){const t=e||"tidy";if(bS(OD,t))return OD[t]();fS("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:SD}),FD.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},xS(FD,fs,{transform(e,t){const n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||fS("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,e=>o[Nu(e)]=1),r.each(e=>{const t=e.data,n=e.parent&&e.parent.data;n&&o[Nu(t)]&&o[Nu(n)]&&i.add.push(Bu({source:n,target:t}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,e=>o[Nu(e)]=1),n.forEach(e=>{(o[Nu(e.source)]||o[Nu(e.target)])&&i.mod.push(e)})),i}});const jD={binary:function(e,t,n,r,i){var o,a,u=e.children,s=u.length,l=new Array(s+1);for(l[0]=a=o=0;o=n-1){var c=u[t];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=s)}var f=l[t],d=r/2+f,h=t+1,p=n-1;for(;h>>1;l[m]s-o){var y=r?(i*v+a*g)/r:a;e(t,h,g,i,o,y,s),e(h,n,v,y,o,a,s)}else{var b=r?(o*v+s*g)/r:s;e(t,h,g,i,o,a,b),e(h,n,v,i,b,a,s)}}(0,s,e.value,t,n,r,i)},dice:KS,slice:fD,slicedice:function(e,t,n,r,i){(1&e.depth?fD:KS)(e,t,n,r,i)},squarify:pD,resquarify:mD},TD=["x0","y0","x1","y1","depth","children"];function ND(e){xD.call(this,e)}function MD(e,t,n){return e.fields=t||[],e.fname=n,e}function BD(e){return 1===e.length?PD(e[0]):RD(e)}ND.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:TD.length,default:TD}]},xS(ND,xD,{layout(){const e=function(){var e=pD,t=!1,n=1,r=1,i=[0],o=qS,a=qS,u=qS,s=qS,l=qS;function c(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(f),i=[0],t&&e.eachBefore(XS),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=>{bS(jD,t)?e.tile(jD[t]):fS("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:TD});const PD=e=>function(t){return t[e]},RD=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||zD("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&zD("Access path missing closing bracket: "+e),a&&zD("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function ID(e,t,n){const r=LD(e);return e=1===r.length?r[0]:e,MD((n&&n.get||BD)(r),[e],t||e)}ID("id"),MD(e=>e,[],"identity"),MD(()=>0,[],"zero"),MD(()=>1,[],"one"),MD(()=>!0,[],"true"),MD(()=>!1,[],"false");var UD=Array.isArray;function $D(e){return null!=e?UD(e)?e:[e]:[]}function qD(e){return"function"==typeof e}Object.prototype.hasOwnProperty;function WD(e,t,n,r){const i=e.width,o=e.height,a=n||r,u=Xd(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))}):Nb[i].draw(t,{items:r?n.map(HD):n})}(u,e,a));const s=new Uint32Array(u.getImageData(0,0,i,o).data.buffer),l=e.bitmap(),c=a&&e.bitmap();let f,d,h,p,m;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,u,s,l,c=o;for(;c>=r;--c)if(a=c*e+t,u=c*e+i,s=a>>>5,l=u>>>5,s===l){if(n[s]&VD[31&a]&YD[1+(31&u)])return!0}else{if(n[s]&VD[31&a])return!0;if(n[l]&YD[1+(31&u)])return!0;for(let e=s+1;e{let a,u,s,l,c;for(;n<=o;++n)if(a=n*e+t,u=n*e+i,s=a>>>5,l=u>>>5,s===l)r(s,VD[31&a]&YD[1+(31&u)]);else for(r(s,VD[31&a]),r(l,YD[1+(31&u)]),c=s+1;c{let a,u,s,l,c;for(;n<=o;++n)if(a=n*e+t,u=n*e+r,s=a>>>5,l=u>>>5,s===l)i(s,YD[31&a]|VD[1+(31&u)]);else for(i(s,YD[31&a]),i(l,VD[1+(31&u)]),c=s+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 XD(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 KD(e,t,n,r,i,o,a,u){const s=i*o/(2*r),l=e(t-s),c=e(t+s),f=e(n-(o/=2)),d=e(n+o);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||u&&u.getRange(l,f,c,d)}const JD=[-1,-1,1,1],QD=[-1,1,-1,1];const ZD=["right","center","left"],eF=["bottom","middle","top"];function tF(e,t,n,r,i,o,a,u,s,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,s,u,l,c):i.getRange(e,n,t,r)))}const nF={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},rF={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,u=mb.width(e.datum,e.datum.text);let s,l,c,f,d,h,p,m=0;for(let r=0;r=m&&(m=p,e.x=d,e.y=h);return d=u/2,h=a/2,s=e.x-d,l=e.x+d,c=e.y-h,f=e.y+h,e.align="center",s<0&&l<=i?e.align="left":0<=s&&i=1;)d=(h+p)/2,KD(e,c,f,l,s,d,a,u)?p=d:h=d;if(h>r)return[c,f,h,!0]}}return function(t){const u=t.datum.datum.items[r].items,l=u.length,c=t.datum.fontSize,f=mb.width(t.datum,t.datum.text);let d,h,p,m,g,v,y,b,x,w,E,_,A,k,C,O,S,D=n?c:0,F=!1,j=!1,T=0;for(let r=0;rh&&(S=d,d=h,h=S),p>m&&(S=p,p=m,m=S),x=e(d),E=e(h),w=~~((x+E)/2),_=e(p),k=e(m),A=~~((_+k)/2),y=w;y>=x;--y)for(b=A;b>=_;--b)O=s(y,b,D,f,c),O&&([t.x,t.y,D,F]=O);for(y=w;y<=E;++y)for(b=A;b<=k;++b)O=s(y,b,D,f,c),O&&([t.x,t.y,D,F]=O);F||n||(C=Math.abs(h-d+m-p),g=(d+h)/2,v=(p+m)/2,C>=T&&!XD(g,v,f,c,i,o)&&!KD(e,g,v,c,f,c,a,null)&&(T=C,t.x=g,t.y=v,j=!0))}return!(!F&&!j)&&(g=f/2,v=c/2,a.setRange(e(t.x-g),e(t.y-v),e(t.x+g),e(t.y+v)),t.align="center",t.baseline="middle",!0)}},floodfill:function(e,t,n,r){const i=e.width,o=e.height,a=t[0],u=t[1],s=e.bitmap();return function(t){const l=t.datum.datum.items[r].items,c=l.length,f=t.datum.fontSize,d=mb.width(t.datum,t.datum.text),h=[];let p,m,g,v,y,b,x,w,E,_,A,k,C=n?f:0,O=!1,S=!1,D=0;for(let r=0;r=1;)A=(E+_)/2,KD(e,y,b,f,d,A,a,u)?_=A:E=A;E>C&&(t.x=y,t.y=b,C=E,O=!0)}}O||n||(k=Math.abs(m-p+v-g),y=(p+m)/2,b=(g+v)/2,k>=D&&!XD(y,b,d,f,i,o)&&!KD(e,y,b,f,d,f,a,null)&&(D=k,t.x=y,t.y=b,S=!0))}return!(!O&&!S)&&(y=d/2,b=f/2,a.setRange(e(t.x-y),e(t.y-b),e(t.x+y),e(t.y+b)),t.align="center",t.baseline="middle",!0)}}};function iF(e,t,n,r,i,o,a,u,s,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,m,u,s),y=GD(t[0],t[1],l),b=g&&"naive"===c;var x;const w=e.map(e=>({datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(e)}));let E;if(!b){n&&w.sort((e,t)=>n(e.datum,t.datum));let t=!1;for(let e=0;ee.datum)].concat(o)),E=o.length?WD(y,o,t,g):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&&w)}const _=g?rF[c](y,E,a,s):function(e,t,n,r){const i=e.width,o=e.height,a=t[0],u=t[1],s=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,m,g,v,y,b,x,w,E,_,A,k,C=0;for(let i=0;i>>2&3)-1,h=0===f&&0===d||r[i]<0,p=f&&d?Math.SQRT1_2:1,m=r[i]<0?-1:1,g=l[1+f]+r[i]*f*p,w=l[4+d]+m*c*d/2+r[i]*d*p,y=w-c/2,b=w+c/2,E=e(g),A=e(y),k=e(b),!C){if(!tF(E,E,A,k,a,u,g,g,y,b,l,h))continue;C=mb.width(t.datum,t.datum.text)}if(x=g+m*C*f/2,g=x-C/2,v=x+C/2,E=e(g),_=e(v),tF(E,_,A,k,a,u,g,v,y,b,l,h))return t.x=f?f*m<0?v:g:x,t.y=d?d*m<0?b:y:w,t.align=ZD[f*m+1],t.baseline=eF[d*m+1],a.setRange(E,A,_,k),!0}return!1}}(y,E,h,d);return w.forEach(e=>e.opacity=+_(e)),w}const oF=["x","y","opacity","align","baseline"],aF=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function uF(e){fs.call(this,null,e)}function sF(e,t,n){return e.fields=t||[],e.fname=n,e}function lF(e){return null==e?null:e.fname}function cF(e){return 1===e.length?fF(e[0]):dF(e)}uF.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:aF},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:oF.length,default:oF}]},function(e,t,n){const r=e.prototype=Object.create(t.prototype);r.constructor=e,function(e){for(let t,n,r=1,i=arguments.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)}});const fF=e=>function(t){return t[e]},dF=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||hF("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&hF("Access path missing closing bracket: "+e),a&&hF("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function mF(e,t,n){const r=pF(e);return e=1===r.length?r[0]:e,sF((n&&n.get||cF)(r),[e],t||e)}mF("id"),sF(e=>e,[],"identity"),sF(()=>0,[],"zero"),sF(()=>1,[],"one"),sF(()=>!0,[],"true"),sF(()=>!1,[],"false");Array.isArray;const gF=Object.prototype.hasOwnProperty;function vF(e,t){return gF.call(e,t)}function yF(e,t,n){const r=e.prototype=Object.create(t.prototype);return r.constructor=e,function(e){for(let t,n,r=1,i=arguments.length;r{Ll(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),s=e.as||[lF(e.x),lF(e.y)],l=wF[o],c=[];let f=e.extent;vF(wF,o)||hF("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<=u)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(Bu({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const d=f||function(e,t){let n,r,i,o,a=0;if(e&&(n=e.length))if(null==t){for(r=e[a];ao&&(o=r))}else{for(r=t(e[a]);ao&&(o=r))}return[i,o]}(n,e.x),h=e=>{const t={};for(let e=0;eh([e,r.predict(e)])):ql(r.predict,d,25,200).forEach(h)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const kF=e=>function(t){return t[e]},CF=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||OF("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&OF("Access path missing closing bracket: "+e),a&&OF("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function DF(e,t,n){const r=SF(e);return e=1===r.length?r[0]:e,_F((n&&n.get||AF)(r),[e],t||e)}DF("id"),_F(e=>e,[],"identity"),_F(()=>0,[],"zero"),_F(()=>1,[],"one"),_F(()=>!0,[],"true"),_F(()=>!1,[],"false");Array.isArray;Object.prototype.hasOwnProperty;const FF=Math.pow(2,-52),jF=new Uint32Array(512);class TF{static from(e,t=IF,n=UF){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,u=1/0,s=-1/0,l=-1/0;for(let t=0;ts&&(s=n),r>l&&(l=r),this._ids[t]=t}const c=(a+s)/2,f=(u+l)/2;let d,h,p,m=1/0;for(let t=0;t0&&(h=t,m=n)}let y=e[2*h],b=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(BF(g,v,y,b,w,E)){const e=h,t=y,n=b;h=p,y=w,b=E,p=e,w=t,E=n}const _=function(e,t,n,r,i,o){const a=n-e,u=r-t,s=i-e,l=o-t,c=a*a+u*u,f=s*s+l*l,d=.5/(a*l-u*s);return{x:e+(l*c-u*f)*d,y:t+(a*f-s*c)*d}}(g,v,y,b,w,E);this._cx=_.x,this._cy=_.y;for(let t=0;t0&&Math.abs(l-o)<=FF&&Math.abs(c-a)<=FF)continue;if(o=l,a=c,s===d||s===h||s===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],u=e-e%3;if(o=u+(e+2)%3,-1===a){if(0===i)break;e=jF[--i];continue}const s=a-a%3,l=u+(e+1)%3,c=s+(a+2)%3,f=t[o],d=t[e],h=t[l],p=t[c];if(PF(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 u=s+(a+1)%3;i=33306690738754716e-32*Math.abs(a+u)?a-u:0}function BF(e,t,n,r,i,o){return(MF(i,o,e,t,n,r)||MF(e,t,n,r,i,o)||MF(n,r,i,o,e,t))<0}function PF(e,t,n,r,i,o,a,u){const s=e-a,l=t-u,c=n-a,f=r-u,d=i-a,h=o-u,p=c*c+f*f,m=d*d+h*h;return s*(f*m-p*h)-l*(c*m-p*d)+(s*s+l*l)*(c*h-f*d)<0}function RF(e,t,n,r,i,o){const a=n-e,u=r-t,s=i-e,l=o-t,c=a*a+u*u,f=s*s+l*l,d=.5/(a*l-u*s),h=(l*c-u*f)*d,p=(a*f-s*c)*d;return h*h+p*p}function zF(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;LF(e,n+r>>1,i),t[e[n]]>t[e[r]]&&LF(e,n,r),t[e[i]]>t[e[r]]&&LF(e,i,r),t[e[n]]>t[e[i]]&&LF(e,n,i);const a=e[i],u=t[a];for(;;){do{i++}while(t[e[i]]u);if(o=o-n?(zF(e,t,i,r),zF(e,t,n,o-1)):(zF(e,t,n,o-1),zF(e,t,i,r))}}function LF(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function IF(e){return e[0]}function UF(e){return e[1]}class $F{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 qF{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 WF{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,u=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 HF=2*Math.PI,VF=Math.pow;function YF(e){return e[0]}function GF(e){return e[1]}function XF(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class KF{static from(e,t=YF,n=GF,r){return new KF("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 WF(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:u,points:s}=this;if(-1===r[e]||!s.length)return(e+1)%(s.length>>1);let l=e,c=VF(t-s[2*e],2)+VF(n-s[2*e+1],2);const f=r[e];let d=f;do{let r=u[d];const f=VF(t-s[2*r],2)+VF(n-s[2*r+1],2);if(ffunction(t){return t[e]},rj=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||ij("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&ij("Access path missing closing bracket: "+e),a&&ij("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function aj(e,t,n){const r=oj(e);return e=1===r.length?r[0]:e,ej((n&&n.get||tj)(r),[e],t||e)}aj("id"),ej(e=>e,[],"identity"),ej(()=>0,[],"zero"),ej(()=>1,[],"one"),ej(()=>!0,[],"true"),ej(()=>!1,[],"false");Array.isArray;function uj(e){return"function"==typeof e}Object.prototype.hasOwnProperty;var sj=Math.PI/180;function lj(){var e,t,n,r,i,o,a,u=[256,256],s=hj,l=[],c=Math.random,f={};function d(e,t,n){for(var r,i,o,a,l,f=t.x,d=t.y,h=Math.sqrt(u[0]*u[0]+u[1]*u[1]),p=s(u),m=c()<.5?1:-1,g=-m;(r=p(g+=m))&&(i=~~r[0],o=~~r[1],!(Math.min(Math.abs(i),Math.abs(o))>=h));)if(t.x=f+i,t.y=d+o,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>u[0]||t.y+t.y1>u[1]||n&&fj(t,e,u[0])||n&&(l=n,!((a=t).x+a.x1>l[0].x&&a.x+a.x0l[0].y&&a.y+a.y0>5,x=u[0]>>5,w=t.x-(b<<4),E=127&w,_=32-E,A=t.y1-t.y0,k=(t.y+t.y0)*x+(w>>5),C=0;C>>E:0);k+=x}return t.sprite=null,!0}return!1}return f.layout=function(){for(var s=function(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=2048/t,e.height=2048/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(Xd()),f=function(e){var t=[],n=-1;for(;++n>5)*u[1]),h=null,p=l.length,m=-1,g=[],v=l.map(u=>({text:e(u),font:t(u),style:r(u),weight:i(u),rotate:o(u),size:~~(n(u)+1e-14),padding:a(u),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:u})).sort((e,t)=>t.size-e.size);++m>1,y.y=u[1]*(c()+.5)>>1,cj(s,y,v,m),y.hasText&&d(f,y,h)&&(g.push(y),h?dj(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-=u[0]>>1,y.y-=u[1]>>1)}return g},f.words=function(e){return arguments.length?(l=e,f):l},f.size=function(e){return arguments.length?(u=[+e[0],+e[1]],f):u},f.font=function(e){return arguments.length?(t=pj(e),f):t},f.fontStyle=function(e){return arguments.length?(r=pj(e),f):r},f.fontWeight=function(e){return arguments.length?(i=pj(e),f):i},f.rotate=function(e){return arguments.length?(o=pj(e),f):o},f.text=function(t){return arguments.length?(e=pj(t),f):e},f.spiral=function(e){return arguments.length?(s=mj[e]||e,f):s},f.fontSize=function(e){return arguments.length?(n=pj(e),f):n},f.padding=function(e){return arguments.length?(a=pj(e),f):a},f.random=function(e){return arguments.length?(c=e,f):c},f}function cj(e,t,n,r){if(!t.sprite){var i=e.context,o=e.ratio;i.clearRect(0,0,2048/o,2048/o);var a,u,s,l,c,f=0,d=0,h=0,p=n.length;for(--r;++r>5<<5,s=~~Math.max(Math.abs(y+b),Math.abs(y-b))}else a=a+31>>5<<5;if(s>h&&(h=s),f+a>=2048&&(f=0,d+=h,h=0),d+s>=2048)break;i.translate((f+(a>>1))/o,(d+(s>>1))/o),t.rotate&&i.rotate(t.rotate*sj),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=s,t.xoff=f,t.yoff=d,t.x1=a>>1,t.y1=s>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,f+=a}for(var w=i.getImageData(0,0,2048/o,2048/o).data,E=[];--r>=0;)if((t=n[r]).hasText){for(u=(a=t.width)>>5,s=t.y1-t.y0,l=0;l>5),C=w[2048*(d+c)+(f+l)<<2]?1<<31-l%32:0;E[k]|=C,_|=C}_?A=c:(t.y0++,s--,c--,d++)}t.y1=t.y0+A,t.sprite=E.slice(0,(t.y1-t.y0)*u)}}}function fj(e,t,n){n>>=5;for(var r,i=e.sprite,o=e.width>>5,a=e.x-(o<<4),u=127&a,s=32-u,l=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),f=0;f>>u:0))&t[c+d])return!0;c+=n}return!1}function dj(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 hj(e){var t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function pj(e){return"function"==typeof e?e:function(){return e}}var mj={archimedean:hj,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 gj=["x","y","font","fontSize","fontStyle","fontWeight","angle"],vj=["text","font","rotate","fontSize","fontStyle","fontWeight"];function yj(e){fs.call(this,lj(),e)}yj.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:gj}]},function(e,t,n){const r=e.prototype=Object.create(t.prototype);r.constructor=e,function(e){for(let t,n,r=1,i=arguments.length;re}(u),a){const e=u,t=og("sqrt")().domain(function(e,t){let n,r,i,o,a=0;if(e&&(n=e.length))if(null==t){for(r=e[a];ao&&(o=r))}else{for(r=t(e[a]);ao&&(o=r))}return[i,o]}(r,e)).range(a);u=n=>t(e(n))}r.forEach(e=>{e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0});const s=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(u).random(nl).layout(),l=i.size(),c=l[0]>>1,f=l[1]>>1,d=s.length;for(let e,t,n=0;nfunction(t){return t[e]},Ej=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||_j("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&_j("Access path missing closing bracket: "+e),a&&_j("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function kj(e,t,n){const r=Aj(e);return e=1===r.length?r[0]:e,bj((n&&n.get||xj)(r),[e],t||e)}kj("id"),bj(e=>e,[],"identity"),bj(()=>0,[],"zero"),bj(()=>1,[],"one"),bj(()=>!0,[],"true"),bj(()=>!1,[],"false");Array.isArray;Object.prototype.hasOwnProperty;function Cj(e,t,n){const r=e.prototype=Object.create(t.prototype);return r.constructor=e,function(e){for(let t,n,r=1,i=arguments.length;rnew Uint8Array(e),Sj=e=>new Uint16Array(e),Dj=e=>new Uint32Array(e);function Fj(e,t,n){const r=(t<257?Oj:t<65537?Sj:Dj)(e);return n&&r.set(n),r}function jj(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,s),a)l=t,c=e,t=Array(a+u),e=Dj(a+u),function(e,t,n,r,i,o,a,u,s){let l,c=0,f=0;for(l=0;c0)for(f=0;fe,size:()=>n}}function Nj(e){fs.call(this,function(){let e=8,t=[],n=Dj(0),r=Fj(0,e),i=Fj(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=Fj(t,e,r),i=Fj(t,e))}}}(),e),this._indices=null,this._dims=null}function Mj(e){fs.call(this,null,e)}function Bj(e,t,n){return e.fields=t||[],e.fname=n,e}function Pj(e){return 1===e.length?Rj(e[0]):zj(e)}Nj.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}}]},Cj(Nj,fs,{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 u,s,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 u,s,l=0;for(n.filters=0,s=0;sh)for(g=h,v=Math.min(f,p);gp)for(g=Math.max(f,p),v=d;gc)for(h=c,p=Math.min(s,f);hf)for(h=Math.max(s,f),p=l;hu[e]&n?null:a[e];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,e=>{const t=u[e]&n;return!t&&t^s[e]&n?a[e]:null}),o.filter(o.REM,e=>{const t=u[e]&n;return t&&!(t^t^s[e]&n)?a[e]:null})):(o.filter(o.ADD,l),o.filter(o.REM,e=>(u[e]&n)===i?a[e]:null)),o.filter(o.SOURCE,e=>l(e._index))}});const Rj=e=>function(t){return t[e]},zj=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||Lj("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&Lj("Access path missing closing bracket: "+e),a&&Lj("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function Uj(e,t,n){const r=Ij(e);return e=1===r.length?r[0]:e,Bj((n&&n.get||Pj)(r),[e],t||e)}Uj("id"),Bj(e=>e,[],"identity"),Bj(()=>0,[],"zero"),Bj(()=>1,[],"one");const $j=Bj(()=>!0,[],"true");Bj(()=>!1,[],"false");var qj=Array.isArray;function Wj(e){return e===Object(e)}function Hj(e){return"function"==typeof e}function Vj(e){return Hj(e)?e:()=>e}function Yj(e){for(let t,n,r=1,i=arguments.length;rfunction(t){return t[e]},nT=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||rT("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&rT("Access path missing closing bracket: "+e),a&&rT("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function oT(e,t,n){const r=iT(e);return e=1===r.length?r[0]:e,Zj((n&&n.get||eT)(r),[e],t||e)}oT("id");const aT=Zj(e=>e,[],"identity"),uT=(Zj(()=>0,[],"zero"),Zj(()=>1,[],"one"),Zj(()=>!0,[],"true"));Zj(()=>!1,[],"false");var sT=Array.isArray;function lT(e){return e===Object(e)}function cT(e){return e[e.length-1]}function fT(e){return null==e||""===e?null:+e}const dT=e=>t=>e*Math.exp(t),hT=e=>t=>Math.log(e*t),pT=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),mT=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,gT=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function vT(e,t,n,r){const i=n(e[0]),o=n(cT(e)),a=(o-i)*t;return[r(i-a),r(o-a)]}function yT(e,t,n,r,i){const o=r(e[0]),a=r(cT(e)),u=null!=t?r(t):(o+a)/2;return[i(u+(o-u)*n),i(u+(a-u)*n)]}function bT(e){return null!=e?sT(e)?e:[e]:[]}function xT(e){return"function"==typeof e}function wT(e){for(let t,n,r=1,i=arguments.length;r=0;)n+=e;return n}function ST(e){return sT(e)?"["+e.map(ST)+"]":lT(e)||CT(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}const DT=e=>kT(e)||AT(e)?e:Date.parse(e);function FT(e){const t={},n=e.length;for(let r=0;r",TT[3]="Identifier",TT[4]="Keyword",TT[5]="Null",TT[6]="Numeric",TT[7]="Punctuator",TT[8]="String",TT[9]="RegularExpression";var RT="ILLEGAL",zT=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]"),LT=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 IT(e,t){if(!e)throw new Error("ASSERT: "+t)}function UT(e){return e>=48&&e<=57}function $T(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function qT(e){return"01234567".indexOf(e)>=0}function WT(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 HT(e){return 10===e||13===e||8232===e||8233===e}function VT(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&zT.test(String.fromCharCode(e))}function YT(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&<.test(String.fromCharCode(e))}const GT={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 XT(){for(;MT1114111||"}"!==e)&&dN({},"Unexpected token %0",RT),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function QT(){var e,t;for(e=NT.charCodeAt(MT++),t=String.fromCharCode(e),92===e&&(117!==NT.charCodeAt(MT)&&dN({},"Unexpected token %0",RT),++MT,(e=KT("u"))&&"\\"!==e&&VT(e.charCodeAt(0))||dN({},"Unexpected token %0",RT),t=e);MT>>="===(r=NT.substr(MT,4))?{type:7,value:r,start:i,end:MT+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:MT+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:7,value:t,start:i,end:MT+=2}:("//"===t&&dN({},"Unexpected token %0",RT),"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:i,end:++MT}:void dN({},"Unexpected token %0",RT))}function tN(){var e,t,n;if(IT(UT((n=NT[MT]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=MT,e="","."!==n){if(e=NT[MT++],n=NT[MT],"0"===e){if("x"===n||"X"===n)return++MT,function(e){let t="";for(;MT=0&&dN({},"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";dN({},"Invalid regular expression")}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){dN({},"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:MT}}function rN(){if(XT(),MT>=BT)return{type:2,start:MT,end:MT};const e=NT.charCodeAt(MT);return VT(e)?ZT():40===e||41===e||59===e?eN():39===e||34===e?function(){var e,t,n,r,i="",o=!1;for(IT("'"===(e=NT[MT])||'"'===e,"String literal must starts with a quote"),t=MT,++MT;MT=0&&MT(IT(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 DN(){var e,t;return e=function(){var e,t,n,r,i,o,a,u,s,l;if(e=PT,s=ON(),0===(i=SN(r=PT)))return s;for(r.prec=i,iN(),t=[e,PT],o=[s,r,a=ON()];(i=SN(PT))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),u=o.pop().value,s=o.pop(),t.pop(),n=aN(u,s,a),o.push(n);(r=iN()).prec=i,o.push(r),t.push(PT),n=ON(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=aN(o[l-1].value,o[l-2],n),l-=2;return n}(),mN("?")&&(iN(),t=DN(),pN(":"),e=function(e,t,n){const r=new jT("ConditionalExpression");return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,DN())),e}function FN(){const e=DN();if(mN(","))throw new Error("Disabled.");return e}var jN={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 TN(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&&rT("Missing arguments to clamp function."),t.length>3&&rT("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),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase","String",0),lower:t("toLowerCase","String",0),substring:t("substring","String"),split:t("split","String"),trim:t("trim","String",0),regexp:"RegExp",test:t("test","RegExp"),if:function(t){t.length<3&&rT("Missing arguments to if function."),t.length>3&&rT("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}var NN,MN,BN,PN,RN,zN=new A_,LN=new A_,IN={point:V_,lineStart:V_,lineEnd:V_,polygonStart:function(){zN=new A_,IN.lineStart=UN,IN.lineEnd=$N},polygonEnd:function(){var e=+zN;LN.add(e<0?S_+e:e),this.lineStart=this.lineEnd=this.point=V_},sphere:function(){LN.add(S_)}};function UN(){IN.point=qN}function $N(){WN(NN,MN)}function qN(e,t){IN.point=WN,NN=e,MN=t,BN=e*=F_,PN=M_(t=(t*=F_)/2+O_),RN=I_(t)}function WN(e,t){var n=(e*=F_)-BN,r=n>=0?1:-1,i=r*n,o=M_(t=(t*=F_)/2+O_),a=I_(t),u=RN*a,s=PN*o+u*M_(i),l=u*r*I_(i);zN.add(N_(l,s)),BN=e,PN=o,RN=a}var HN,VN,YN,GN,XN,KN,JN,QN,ZN,eM,tM,nM={point:rM,lineStart:oM,lineEnd:aM,polygonStart:function(){nM.point=uM,nM.lineStart=sM,nM.lineEnd=lM,ZN=new A_,IN.polygonStart()},polygonEnd:function(){IN.polygonEnd(),nM.point=rM,nM.lineStart=oM,nM.lineEnd=aM,zN<0?(HN=-(YN=180),VN=-(GN=90)):ZN>1e-6?GN=90:ZN<-1e-6&&(VN=-90),tM[0]=HN,tM[1]=YN},sphere:function(){HN=-(YN=180),VN=-(GN=90)}};function rM(e,t){eM.push(tM=[HN=e,YN=e]),tGN&&(GN=t)}function iM(e,t){var n=ek([e*F_,t*F_]);if(QN){var r=nk(QN,n),i=nk([r[1],-r[0],0],r);ok(i),i=ZA(i);var o,a=e-XN,u=a>0?1:-1,s=i[0]*D_*u,l=j_(a)>180;l^(u*XNGN&&(GN=o):l^(u*XN<(s=(s+360)%360-180)&&sGN&&(GN=t)),l?ecM(HN,YN)&&(YN=e):cM(e,YN)>cM(HN,YN)&&(HN=e):YN>=HN?(eYN&&(YN=e)):e>XN?cM(HN,e)>cM(HN,YN)&&(YN=e):cM(e,YN)>cM(HN,YN)&&(HN=e)}else eM.push(tM=[HN=e,YN=e]);tGN&&(GN=t),QN=n,XN=e}function oM(){nM.point=iM}function aM(){tM[0]=HN,tM[1]=YN,nM.point=rM,QN=null}function uM(e,t){if(QN){var n=e-XN;ZN.add(j_(n)>180?n+(n>0?360:-360):n)}else KN=e,JN=t;IN.point(e,t),iM(e,t)}function sM(){IN.lineStart()}function lM(){uM(KN,JN),IN.lineEnd(),j_(ZN)>1e-6&&(HN=-(YN=180)),tM[0]=HN,tM[1]=YN,QN=null}function cM(e,t){return(t-=e)<0?t+360:t}function fM(e,t){return e[0]-t[0]}function dM(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tfunction(t){return t[e]},qM=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||WM("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&WM("Access path missing closing bracket: "+e),a&&WM("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function VM(e,t,n){const r=HM(e);return e=1===r.length?r[0]:e,IM((n&&n.get||UM)(r),[e],t||e)}VM("id"),IM(e=>e,[],"identity"),IM(()=>0,[],"zero"),IM(()=>1,[],"one"),IM(()=>!0,[],"true"),IM(()=>!1,[],"false");var YM=Array.isArray;function GM(e){return e[e.length-1]}function XM(e){return null==e||""===e?null:+e}function KM(e){return null!=e?YM(e)?e:[e]:[]}const JM=Object.prototype.hasOwnProperty;function QM(e,t){return JM.call(e,t)}function ZM(e,t,n,r){let i,o=t[0],a=t[t.length-1];return o>a&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=e:o",nB[3]="Identifier",nB[4]="Keyword",nB[5]="Null",nB[6]="Numeric",nB[7]="Punctuator",nB[8]="String",nB[9]="RegularExpression";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]"),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 rB(e,t){for(var n,r,i=t.fields,o=t.values,a=i.length,u=0;ut.indexOf(e)>=0):t},R_union:function(e,t){var n=XM(t[0]),r=XM(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 oB(e,t,n,r){"Literal"!==t[0].type&&WM("First argument to selection functions must be a string literal.");const i=t[0].value,o=":"+i;"intersect"!==(t.length>=2&&GM(t).value)||QM(r,"@unit")||(r["@unit"]=n.getData(i).indataRef(n,"unit")),QM(r,o)||(r[o]=n.getData(i).tuplesRef())}function aB(e){const t=this.context.data[e];return t?t.values.value:[]}const uB=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},sB=uB("format"),lB=uB("timeFormat"),cB=uB("utcFormat"),fB=uB("timeParse"),dB=uB("utcParse"),hB=new Date(2e3,0,1);function pB(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(hB.setYear(2e3),hB.setMonth(e),hB.setDate(t),lB.call(this,hB,n)):""}function mB(e,t,n,r){"Literal"!==t[0].type&&rT("First argument to data functions must be a string literal.");const i=t[0].value,o=":"+i;if(!_T(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(e){}}function gB(e,t,n,r){if("Literal"===t[0].type)vB(n,r,t[0].value);else for(e in n.scales)vB(n,r,e)}function vB(e,t,n){const r="%"+n;if(!_T(t,r))try{t[r]=e.scaleRef(n)}catch(e){}}function yB(e,t){let n;return xT(e)?e:CT(e)?(n=t.scales[e])&&n.value:void 0}function bB(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=gB,n._range=gB,n._scale=gB;const r=t=>"_["+("Literal"===t.type?ST("%"+t.value):ST("%")+"+"+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 xB(e,t){return function(n,r,i){if(n){const t=yB(n,(i||this).context);return t&&t.path[e](r)}return t(r)}}const wB=xB("area",(function(e){return LN=new A_,__(e,IN),2*LN})),EB=xB("bounds",(function(e){var t,n,r,i,o,a,u;if(GN=YN=-(HN=VN=1/0),eM=[],__(e,nM),n=eM.length){for(eM.sort(fM),t=1,o=[r=eM[0]];tcM(r[0],r[1])&&(r[1]=i[1]),cM(i[0],r[1])>cM(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],(u=cM(r[1],i[0]))>a&&(a=u,HN=i[0],YN=r[1])}return eM=tM=null,HN===1/0||VN===1/0?[[NaN,NaN],[NaN,NaN]]:[[HN,VN],[YN,GN]]})),_B=xB("centroid",(function(e){hM=pM=mM=gM=vM=yM=bM=xM=0,wM=new A_,EM=new A_,_M=new A_,__(e,DM);var t=+wM,n=+EM,r=+_M,i=R_(t,n,r);return i<1e-12&&(t=yM,n=bM,r=xM,pM<1e-6&&(t=mM,n=gM,r=vM),(i=R_(t,n,r))<1e-12)?[NaN,NaN]:[N_(n,t)*D_,H_(r/i)*D_]}));function AB(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(t){e.warn(t)}return n[n.length-1]}function kB(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function CB(e){const t=qh(e);return.2126*kB(t.r)+.7152*kB(t.g)+.0722*kB(t.b)}function OB(e,t){return e===t||e!=e&&t!=t||(sT(e)?!(!sT(t)||e.length!==t.length)&&function(e,t){for(let n=0,r=e.length;nSB(e,t)}function FB(e){return sT(e)||ArrayBuffer.isView(e)?e:null}function jB(e){return FB(e)||(CT(e)?e:null)}const TB=e=>e.data;function NB(e,t){const n=aB.call(t,e);return n.root&&n.root.lookup||{}}const MB=()=>"undefined"!=typeof window&&window||null;const BB={random:()=>nl(),cumulativeNormal:hl,cumulativeLogNormal:bl,cumulativeUniform:kl,densityNormal:dl,densityLogNormal:yl,densityUniform:Al,quantileNormal:pl,quantileLogNormal:xl,quantileUniform:Cl,sampleNormal:fl,sampleLogNormal:vl,sampleUniform:_l,isArray:sT,isBoolean:function(e){return"boolean"==typeof e},isDate:AT,isDefined:e=>void 0!==e,isNumber:kT,isObject:lT,isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},isString:CT,isTuple:Tu,isValid:e=>null!=e&&e==e,toBoolean:function(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e},toDate:function(e,t){return t=t||DT,null==e||""===e?null:t(e)},toNumber:fT,toString:function(e){return null==e||""===e?null:e+""},indexof:function(e,...t){return jB(e).indexOf(...t)},join:function(e,...t){return FB(e).join(...t)},lastindexof:function(e,...t){return jB(e).lastIndexOf(...t)},replace:function(e,t,n){return xT(n)&&rT("Function argument passed to replace."),String(e).replace(t,n)},reverse:function(e){return FB(e).slice().reverse()},slice:function(e,...t){return jB(e).slice(...t)},flush:function(e,t,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let u,s=e[0],l=cT(e);la&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=e:oo&&(o=r))}else{for(r=t(e[a]);ao&&(o=r))}return[i,o]},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 Lv).set(r[0],r[1],i[0],i[1]);return Vx(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=bT(e.marktype),r=bT(e.markname);t=e=>(!n.length||n.some(t=>e.marktype===t))&&(!r.length||r.some(t=>e.name===t))}return t}(t))},clampRange:function(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]},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=MB();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=MB();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return Gm(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(uT).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?lv(n,t=t||Qg(e)):e}},panLinear:function(e,t){return vT(e,t,fT,aT)},panLog:function(e,t){var n=Math.sign(e[0]);return vT(e,t,hT(n),dT(n))},panPow:function(e,t,n){return vT(e,t,gT(n),gT(1/n))},panSymlog:function(e,t,n){return vT(e,t,pT(n),mT(n))},zoomLinear:function(e,t,n){return yT(e,t,n,fT,aT)},zoomLog:function(e,t,n){const r=Math.sign(e[0]);return yT(e,t,n,hT(r),dT(r))},zoomPow:function(e,t,n,r){return yT(e,t,n,gT(r),gT(1/r))},zoomSymlog:function(e,t,n,r){return yT(e,t,n,pT(r),mT(r))},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,u=this.context.data[e],s=u.input,l=a.stamp();let c,f,d=u.changes;if(!1===a._trigger||!(s.value.length||t||r))return 0;if((!d||d.stamp{u.modified=!0,a.pulse(s,d).run()},!0,1)),n&&(c=!0===n?uT:sT(n)||Tu(n)?n:DB(n),d.remove(c)),t&&d.insert(t),r&&(c=DB(r),s.value.some(c)?d.remove(c):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1}},PB=["view","item","group","xy","x","y"],RB={},zB={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>"_[".concat(ST("$"+e),"]"),functions:function(e){const t=TN(e);PB.forEach(e=>t[e]="event.vega."+e);for(const e in BB)t[e]="this."+e;return wT(t,bB(e,BB,RB)),t},constants:jN,visitors:RB},LB=function(e){const t=(e=e||{}).allowed?FT(e.allowed):{},n=e.forbidden?FT(e.forbidden):{},r=e.constants||jN,i=(e.functions||TN)(f),o=e.globalvar,a=e.fieldvar,u=xT(o)?o:e=>"".concat(o,'["').concat(e,'"]');let s={},l={},c=0;function f(e){if(CT(e))return e;const t=d[e.type];return null==t&&rT("Unsupported type: "+e.type),t(e)}const d={Literal:e=>e.raw,Identifier:e=>{const i=e.name;return c>0?i:_T(n,i)?rT("Illegal identifier: "+i):_T(r,i)?r[i]:_T(t,i)?i:(s[i]=1,u(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&&rT("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=_T(i,t)&&i[t];return r||rT("Unrecognized function: "+t),xT(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(s),fields:Object.keys(l)};return s={},l={},t}return h.functions=i,h.constants=r,h}(zB);function IB(e,t,n){return 1===arguments.length?BB[e]:(BB[e]=t,n&&(RB[e]=n),LB&&(LB.functions[e]="this."+e),this)}function UB(e,t){const n={};let r;try{r=function(e){MT=0,BT=(NT=e).length,PT=null,oN();const t=FN();if(2!==PT.type)throw new Error("Unexpect token after expression.");return t}(e=CT(e)?e:ST(e)+"")}catch(t){rT("Expression parse error: "+e)}r.visit(e=>{if("CallExpression"!==e.type)return;const r=e.callee.name,i=zB.visitors[r];i&&i(r,e.arguments,t,n)});const i=LB(r);return i.globals.forEach(e=>{const r="$"+e;!_T(n,r)&&t.getSignal(e)&&(n[r]=t.signalRef(e))}),{$expr:wT({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}function $B(e,t,n){return e.fields=t||[],e.fname=n,e}function qB(e){return 1===e.length?WB(e[0]):HB(e)}IB("bandwidth",(function(e,t){const n=yB(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),gB),IB("copy",(function(e,t){const n=yB(e,(t||this).context);return n?n.copy():void 0}),gB),IB("domain",(function(e,t){const n=yB(e,(t||this).context);return n?n.domain():[]}),gB),IB("range",(function(e,t){const n=yB(e,(t||this).context);return n&&n.range?n.range():[]}),gB),IB("invert",(function(e,t,n){const r=yB(e,(n||this).context);return r?sT(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}),gB),IB("scale",(function(e,t,n){const r=yB(e,(n||this).context);return r?r(t):void 0}),gB),IB("gradient",(function(e,t,n,r,i){e=yB(e,(i||this).context);const o=Yg(t,n);let a=e.domain(),u=a[0],s=cT(a),l=aT;return s-u?l=yg(e,u,s):e=(e.interpolator?og("sequential")().interpolator(e.interpolator()):og("linear")().interpolate(e.interpolate()).range(e.range())).domain([u=0,s=1]),e.ticks&&(a=e.ticks(+r||15),u!==a[0]&&a.unshift(u),s!==cT(a)&&a.push(s)),a.forEach(t=>o.stop(l(t),e(t))),o}),gB),IB("geoArea",wB,gB),IB("geoBounds",EB,gB),IB("geoCentroid",_B,gB),IB("geoShape",(function(e,t,n){const r=yB(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}}),gB),IB("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&&rT("First argument to indata must be a string literal."),"Literal"!==t[1].type&&rT("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,a="@"+o;_T(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),IB("data",aB,mB),IB("treePath",(function(e,t,n){const r=NB(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(TB):void 0}),mB),IB("treeAncestors",(function(e,t){const n=NB(e,this)[t];return n?n.ancestors().map(TB):void 0}),mB),IB("vlSelectionTest",(function(e,t,n){for(var r,i,o,a,u,s=this.context.data[e],l=s?s.values.value:[],c=s?s["index:unit"]&&s["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(g).forEach(e=>{g[e]=Object.keys(g[e]).map(t=>g[e][t]).reduce((n,r)=>void 0===n?r:iB[y[e]+"_"+t](n,r))}),m=Object.keys(v),n&&m.length&&(g.vlMulti="union"===t?{or:m.reduce((e,t)=>(e.push(...v[t]),e),[])}:{and:m.map(e=>({or:v[e]}))}),g}),oB);const WB=e=>function(t){return t[e]},HB=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||VB("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&VB("Access path missing closing bracket: "+e),a&&VB("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function GB(e,t,n){const r=YB(e);return e=1===r.length?r[0]:e,$B((n&&n.get||qB)(r),[e],t||e)}GB("id"),$B(e=>e,[],"identity"),$B(()=>0,[],"zero"),$B(()=>1,[],"one");const XB=$B(()=>!0,[],"true");$B(()=>!1,[],"false");var KB=Array.isArray;function JB(e){return e===Object(e)}function QB(e){return null!=e?KB(e)?e:[e]:[]}function ZB(e){return"function"==typeof e}const eP=(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),tP=(e,t)=>1===e.length?nP(e[0],t[0]):rP(e,t,e.length),nP=(e,t)=>function(n,r){return eP(e(n),e(r))*t},rP=(e,t,n)=>(t.push(0),function(r,i){let o,a=0,u=-1;for(;0===a&&++ufP(e,["_"],t.code),parameter:(e,t)=>fP(e,["datum","_"],t.code),event:(e,t)=>fP(e,["event"],t.code),handler:(e,t)=>fP(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["+aP(e)+"]";i+="$=".concat(r[e].code,";if(").concat(t,"!==$)").concat(t,"=$,m=1;")}return i+=function(e,t){let n="";return sP[t]||(e.x2&&(e.x?(lP[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?(lP[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;",fP(e,["item","_"],i)},codegen:{get(e){const t="[".concat(e.map(aP).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 hP(e,t,n){if(!e||!JB(e))return e;for(let r,i=0,o=pP.length;ie.replace(/\\(.)/g,"$1")):QB(e));const r=e&&e.length,i=n&&n.get||qB,o=e=>i(t?[e]:YB(e));let a;if(r)if(1===r){const t=o(e[0]);a=function(e){return""+t(e)}}else{const t=e.map(o);a=function(e){let n=""+t[0](e),i=0;for(;++ie&&e.$tupleid?Nu:e);return t.fn[n]||(t.fn[n]=function(e,t,n){n=n||{},t=QB(t)||[];const r=[],i=[],o={},a=n.comparator||tP;return QB(e).forEach((e,a)=>{var u;null!=e&&(r.push("descending"===t[a]?-1:1),i.push(e=ZB(e)?e:GB(e,null,n)),(u=e,(null==u?null:u.fields)||[]).forEach(e=>o[e]=1))}),0===i.length?null:$B(a(i,r),Object.keys(o))}(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),u=o.signals.parent;return u&&u.set(i),a.detachSubflow=()=>t.detach(o),a}}},{key:"$tupleid",parse:function(){return Nu}}];const mP={skip:!0};function gP(e,t,n,r){return new vP(e,t,n,r)}function vP(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||dP,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function yP(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)}vP.prototype=yP.prototype={fork(){const e=new yP(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"===cP(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[cP(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"!==cP(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||VB("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]=KB(i)?i.map(e=>hP(e,n,t)):hP(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&&VB("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),n.stream(e,i)},parseUpdate:function(e){var t,n=JB(n=e.source)?n.$ref:n,r=this.get(n),i=e.update,o=void 0;r||VB("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],mP)}),Object.keys(r||{}).forEach(e=>{n.pulse(t.data[e].input,n.changeset().remove(XB).insert(r[e]))}),(e.subcontext||[]).forEach((e,n)=>{const r=t.subcontext[n];r&&r.setState(e)})}};function bP(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function xP(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 wP(e,t){var n=e._runtime.data;return Xj(n,t)||Lj("Unrecognized data set: "+t),n[t]}function EP(e,t){Iu(t)||Lj("Second argument to changes must be a changeset.");const n=wP(this,e);return n.modified=!0,this.pulse(n.input,t)}function _P(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function AP(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function kP(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function CP(e,t,n){var r,i,o=e._renderer,a=o&&o.canvas();return a&&(i=kP(e),(r=Yb(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;Jj(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:Vj(e),item:Vj(t||{}),group:i,xy:o,x:e=>o(e)[0],y:e=>o(e)[1]}}(e,n,r),t}const OP={trap:!1};function SP(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return!(!1===r||Wj(r)&&!r[n])||(e.warn("Blocked ".concat(t," ").concat(n," event listener.")),!1)}function DP(e){return e.item}function FP(e){return e.item.mark.source}function jP(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function TP(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 NP(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=function(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(t(r),n=null),e)}}(r.debounce,i.update))),function(e,t,n,r){const i=TP("div",{class:"vega-bind"}),o="radio"===n.input?i:i.appendChild(TP("label"));o.appendChild(TP("span",{class:"vega-bind-name"},n.name||n.signal)),t.appendChild(i);let a=MP;switch(n.input){case"checkbox":a=BP;break;case"select":a=PP;break;case"radio":a=RP;break;case"range":a=zP}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 MP(e,t,n,r){const i=TP("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 BP(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=TP("input",i);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=e=>o.checked=!!e||null}function PP(e,t,n,r){const i=TP("select",{name:n.signal}),o=n.labels||[];n.options.forEach((e,t)=>{const n={value:e};LP(e,r)&&(n.selected=!0),i.appendChild(TP("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 u={type:"radio",name:n.signal,value:t};LP(t,r)&&(u.checked=!0);const s=TP("input",u);s.addEventListener("change",()=>e.update(t));const l=TP("label",{},(o[a]||t)+"");return l.prepend(s),i.appendChild(l),s}),e.set=t=>{const n=e.elements,r=n.length;for(let e=0;e{s.textContent=u.value,e.update(+u.value)};u.addEventListener("input",l),u.addEventListener("change",l),e.elements=[u],e.set=e=>{u.value=e,s.textContent=e}}function LP(e,t){return e===t||e+""==t+""}function IP(e,t,n,r,i,o){return(t=t||new r(e.loader())).initialize(n,_P(e),AP(e),kP(e),i,o).background(e.background())}function UP(e,t){return t?function(){try{t.apply(this,arguments)}catch(t){e.error(t)}}:null}function $P(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 qP=e=>+e||0;function WP(e){return Wj(e)?{top:qP(e.top),bottom:qP(e.bottom),left:qP(e.left),right:qP(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(qP(e))}async function HP(e,t,n,r){const i=Hx(t),o=i&&i.headless;return o||Lj("Unrecognized renderer type: "+t),await e.runAsync(),IP(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}var VP={skip:!0};function YP(e,t){var n=e.autosize(),r=e.padding();return t-(n&&"padding"===n.contains?r.left+r.right:0)}function GP(e,t){var n=e.autosize(),r=e.padding();return t-(n&&"padding"===n.contains?r.top+r.bottom:0)}function XP(e,t){return t.modified&&qj(t.input.value)&&e.indexOf("_:vega:_")}function KP(e,t){return!("parent"===e||t instanceof ds.proxy)}function JP(e,t,n,r){const i=e.element();i&&i.setAttribute("title",function(e){return null==e?"":qj(e)?QP(e):Wj(e)&&!Kj(e)?(t=e,Object.keys(t).map(e=>{const n=t[e];return e+": "+(qj(n)?QP(n):ZP(n))}).join("\n")):e+"";var t}(r))}function QP(e){return"["+e.map(ZP).join(", ")+"]"}function ZP(e){return qj(e)?"[…]":Wj(e)&&!Kj(e)?"{…}":e}function eR(e,t){const n=this;if(t=t||{},ls.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=Yj({},e.locale,t.locale);n.locale(_u(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||qx.Canvas,n._scenegraph=new Ib;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||JP,n._redraw=!0,n._handler=(new ox).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=Yj({defaults:{}},e),n=(e,t)=>{t.forEach(t=>{qj(e[t])&&(e[t]=function(e){const t={},n=e.length;for(let r=0;r({state:null,param:Yj({},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=YP(n,n._width),n._viewHeight=GP(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=YP(e,t.size),o()},{size:n}),e._resizeHeight=e.add(null,t=>{e._height=t.size,e._viewHeight=GP(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?Jj(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 Jj(n)||(r=n.item,n=n.user),xP(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 tR(e,t){return Xj(e._signals,t)?e._signals[t]:Lj("Unrecognized signal name: "+Qj(t))}function nR(e,t){const n=(e._targets||[]).filter(e=>e._update&&e._update.handler===t);return n.length?n[0]:null}function rR(e,t,n,r){let i=nR(n,r);return i||(i=UP(e,()=>r(t,n.value)),i.handler=r,e.on(n,null,i)),e}function iR(e,t,n){const r=nR(t,n);return r&&t._targets.remove(r),e}function oR(e,t,n){return e.fields=t||[],e.fname=n,e}function aR(e){return 1===e.length?uR(e[0]):sR(e)}!function(e,t,n){const r=e.prototype=Object.create(t.prototype);r.constructor=e,Yj(r,n)}(eR,ls,{async evaluate(e,t,n){if(await ls.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,i=kP(r=this),o=_P(r),a=AP(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&&Du(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&&bP(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=tR(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",WP(e)):WP(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?(Hx(e)||Lj("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&&(ls.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(tR(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 u=0;a._autosize=0,a.width()!==n&&(u=1,a.signal("width",n,VP),a._resizeWidth.skip(!0)),a.height()!==r&&(u=1,a.signal("height",r,VP),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),u&&a.run("enter"),o&&a.runAfter(e=>e.resize())},!1,1)},addEventListener(e,t,n){let r=t;return n&&!1===n.trap||(r=UP(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 rR(this,e,tR(this,e),t)},removeSignalListener(e,t){return iR(this,tR(this,e),t)},addDataListener(e,t){return rR(this,e,wP(this,e).values,t)},removeDataListener(e,t){return iR(this,wP(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=xP(this,null);this._globalCursor=!!e,t&&xP(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 $O,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?IO():+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 Gu(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(CP(i,n,r))})};if("timer"===e)SP(i,"timer",t)&&i.timer(a,t);else if("view"===e)SP(i,"view",t)&&i.addEventListener(t,a,OP);else if("window"===e?SP(i,"window",t)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&SP(i,"selector",t)&&(r=document.querySelectorAll(e)),r){for(var u=0,s=r.length;u=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",DP),FP,jP(e)),this.on(this.events("view","mouseout",DP),FP,jP(t)),this},data:function(e,t){return arguments.length<2?wP(this,e).values.value:EP.call(this,e,Uu().remove($j).insert(t))},change:EP,insert:function(e,t){return EP.call(this,e,Uu().insert(t))},remove:function(e,t){return EP.call(this,e,Uu().remove(t))},scale:function(e){var t=this._runtime.scales;return Xj(t,e)||Lj("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=Hx(r);e=n._el=e?$P(n,e):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),bP(t,e.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||ox,u=e?o.renderer:o.headless;return n._renderer=u?IP(n,n._renderer,e,u):null,n._handler=function(e,t,n,r){const i=new r(e.loader(),UP(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,kP(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=$P(n,t):e.appendChild(TP("form",{class:"vega-bindings"})),n._bind.forEach(e=>{e.param.element&&"container"!==i&&(e.element=$P(n,e.param.element))}),n._bind.forEach(e=>{NP(n,e.element||t,e)})),n},toImageURL:async function(e,t){e!==qx.Canvas&&e!==qx.SVG&&e!==qx.PNG&&Lj("Unrecognized image type: "+e);const n=await HP(this,e,t);return e===qx.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 HP(this,qx.Canvas,e,t)).canvas()},toSVG:async function(e){return(await HP(this,qx.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:XP,signals:KP,recurse:!0})},setState:function(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},e=>{e._trigger=!0}),this}});const uR=e=>function(t){return t[e]},sR=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),u=r=i+1):"]"===o&&(u||lR("Access path missing open bracket: "+e),u>0&&l(),u=0,r=i+1):i>r?l():r=i+1}return u&&lR("Access path missing closing bracket: "+e),a&&lR("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function fR(e,t,n){const r=cR(e);return e=1===r.length?r[0]:e,oR((n&&n.get||aR)(r),[e],t||e)}fR("id"),oR(e=>e,[],"identity"),oR(()=>0,[],"zero"),oR(()=>1,[],"one"),oR(()=>!0,[],"true"),oR(()=>!1,[],"false");var dR=Array.isArray;function hR(e){return e===Object(e)}const pR=e=>"__proto__"!==e;function mR(e,t,n,r){if(!pR(t))return;let i,o;if(hR(n)&&!dR(n))for(i in o=hR(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?mR(o,i,n[i]):pR(i)&&(o[i]=n[i]);else e[t]=n}function gR(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 vR(e){return e[e.length-1]}function yR(e){return null!=e?dR(e)?e:[e]:[]}function bR(e){for(let t,n,r=1,i=arguments.length;r=0?--u:r&&r.indexOf(a)>=0&&++u}return t}function DR(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(FR);const i=FR(e.slice(1).trim());if(i.between)return{between:n,stream:i};i.between=n;return i}(e):function(e){const t={source:CR},n=[];let r,i,o=[0,0],a=0,u=0,s=e.length,l=0;if("}"===e[s-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,s-1))}catch(t){throw"Invalid throttle specification: "+e}e=e.slice(0,l).trim(),s=e.length,l=0}if(!s)throw e;"@"===e[0]&&(a=++l);r=SR(e,l,":"),r1?(t.type=n[1],a?t.markname=n[0].slice(1):(c=n[0],OR[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 jR(e){return hR(e)?e:{type:e||"pad"}}const TR=e=>+e||0;function NR(e){return hR(e)?e.signal?e:{top:TR(e.top),bottom:TR(e.bottom),left:TR(e.left),right:TR(e.right)}:{top:t=TR(e),bottom:t,left:t,right:t};var t}const MR=e=>hR(e)&&!dR(e)?bR({},e):{value:e};function BR(e,t,n,r){if(null!=n){return hR(n)&&!dR(n)||dR(n)&&n.length&&hR(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1}return 0}function PR(e,t,n){for(const n in t)BR(e,n,t[n]);for(const t in n)BR(e,t,n[t],"update")}function RR(e,t,n){for(const r in t)n&&wR(n,r)||(e[r]=bR(e[r]||{},t[r]));return e}function zR(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}function LR(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const IR=e=>ER(e)?_R(e):e.signal?"(".concat(e.signal,")"):WR(e);function UR(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map(e=>null==e?null:_R(e));for(;t.length&&null==vR(t);)t.pop();return t.unshift(IR(e.gradient)),"gradient(".concat(t.join(","),")")}(e);let t=e.signal?"(".concat(e.signal,")"):e.color?function(e){return e.c?$R("hcl",e.h,e.c,e.l):e.h||e.s?$R("hsl",e.h,e.s,e.l):e.l||e.a?$R("lab",e.l,e.a,e.b):e.r||e.g||e.b?$R("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?WR(e.field):void 0!==e.value?_R(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=IR(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?"":"*"+qR(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(qR(e.exponent),")")),null!=e.mult&&(t+="*".concat(qR(e.mult))),null!=e.offset&&(t+="+".concat(qR(e.offset))),e.round&&(t="round(".concat(t,")")),t}const $R=(e,t,n,r)=>"(".concat(e,"(").concat([t,n,r].map(UR).join(","),")+'')");function qR(e){return hR(e)?"("+UR(e)+")":e}function WR(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):lR("Invalid field reference: "+_R(t));t.signal||(i=ER(i)?cR(i).map(_R).join("]["):e(i));return n+"["+i+"]"}(hR(e)?e:{datum:e})}function HR(e,t,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},e=function(e,t,n,r,i){const o={},a={};let u,s,l,c;for(s in s="lineBreak","text"!==t||null==i[s]||zR(s,e)||LR(o,s,i[s]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c="frame"===n?i.group:"mark"===n?bR({},i.mark,i[t]):null,c)l=zR(s,e)||("fill"===s||"stroke"===s)&&(zR("fill",e)||zR("stroke",e)),l||LR(o,s,c[s]);for(s in yR(r).forEach(t=>{const n=i.style&&i.style[t];for(const t in n)zR(t,e)||LR(o,t,n[t])}),e=bR({},e),o)c=o[s],c.signal?(u=u||{})[s]=c:a[s]=c;return e.enter=bR(a,e.enter),u&&(e.update=bR(u,e.update)),e}(e,t,n,r,i.config);for(const n in e)a[n]=VR(e[n],t,o,i);return o}function VR(e,t,n,r){const i={},o={};for(const t in e)null!=e[t]&&(i[t]=YR((a=e[t],dR(a)?function(e){let t="";return e.forEach(e=>{const n=UR(e);t+=e.test?"(".concat(e.test,")?").concat(n,":"):n}),":"===vR(t)&&(t+="null"),t}(a):UR(a)),r,n,o));var a;return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function YR(e,t,n,r){const i=UB(e,t);return i.$fields.forEach(e=>r[e]=1),bR(n,i.$params),i.$expr}const GR=["value","update","init","react","bind"];function XR(e,t){lR(e+' for "outer" push: '+_R(t))}function KR(e,t){const n=e.name;if("outer"===e.push)t.signals[n]||XR("No prior signal definition",n),GR.forEach(t=>{void 0!==e[t]&&XR("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 JR(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function QR(e,t,n,r){return new JR(e,t,n,r)}function ZR(e,t){return QR("operator",e,t)}function ez(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function tz(e,t){return t?{$field:e,$name:t}:{$field:e}}const nz=tz("key");function rz(e,t){return{$compare:e,$order:t}}function iz(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}function oz(e){return e&&e.signal}function az(e){if(oz(e))return!0;if(hR(e))for(const t in e)if(az(e[t]))return!0;return!1}function uz(e,t){return null!=e?e:t}function sz(e){return e&&e.signal||e}function lz(e,t){return(e.merge?cz:e.stream?fz:e.type?dz:lR("Invalid stream specification: "+_R(e)))(e,t)}function cz(e,t){const n=hz({merge:e.merge.map(e=>lz(e,t))},e,t);return t.addStream(n).id}function fz(e,t){const n=hz({stream:lz(e.stream,t)},e,t);return t.addStream(n).id}function dz(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=hz({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function hz(e,t,n){let r=t.between;return r&&(2!==r.length&&lR('Stream "between" parameter must have 2 entries: '+_R(t)),e.between=[lz(r[0],n),lz(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=UB("("+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 pz={code:"_.$value",ast:{type:"Identifier",value:"value"}};function mz(e,t,n){const r=e.encode,i={target:n};let o=e.events,a=e.update,u=[];var s,l,c;o||lR("Signal update missing events specification."),ER(o)&&(s=o,l=t.isSubscope()?"scope":"view",CR=l||"view",OR=c||kR,o=DR(s.trim()).map(FR)),o=yR(o).filter(e=>e.signal||e.scale?(u.push(e),0):1),u.length>1&&(u=[gz(u)]),o.length&&u.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&lR("Signal encode and update are mutually exclusive."),a="encode(item(),"+_R(r)+")"),i.update=ER(a)?UB(a,t):null!=a.expr?UB(a.expr,t):null!=a.value?a.value:null!=a.signal?{$expr:pz,$params:{$value:t.signalRef(a.signal)}}:lR("Invalid signal update specification."),e.force&&(i.options={force:!0}),u.forEach(e=>t.addUpdate(bR(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):lz(e,t)}}(e,t),i)))}function gz(e){return{signal:"["+e.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}const vz=e=>(t,n,r)=>QR(e,n,t||void 0,r),yz=vz("aggregate"),bz=vz("axisticks"),xz=vz("bound"),wz=vz("collect"),Ez=vz("compare"),_z=vz("datajoin"),Az=vz("encode"),kz=vz("expression"),Cz=vz("facet"),Oz=vz("field"),Sz=vz("key"),Dz=vz("legendentries"),Fz=vz("load"),jz=vz("mark"),Tz=vz("multiextent"),Nz=vz("multivalues"),Mz=vz("overlap"),Bz=vz("params"),Pz=vz("prefacet"),Rz=vz("projection"),zz=vz("proxy"),Lz=vz("relay"),Iz=vz("render"),Uz=vz("scale"),$z=vz("sieve"),qz=vz("sortitems"),Wz=vz("viewlayout"),Hz=vz("values");let Vz=0;const Yz={min:"min",max:"max",count:"sum"};function Gz(e,t){const n=t.getScale(e.name).params;let r;var i;for(r in n.domain=Qz(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(ER(o)){if(i&&wR(i,o))return t=bR({},t,{range:i[o]}),e(t,n,r);"width"===o?o=[0,{signal:"width"}]:"height"===o?o=lg(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:lR("Unrecognized scale range value: "+_R(o))}else{if(o.scheme)return r.scheme=dR(o.scheme)?Kz(o.scheme,n):Xz(o.scheme,n),o.extent&&(r.schemeExtent=Kz(o.extent,n)),void(o.count&&(r.schemeCount=Xz(o.count,n)));if(o.step)return void(r.rangeStep=Xz(o.step,n));if(lg(t.type)&&!dR(o))return Qz(o,t,n);dR(o)||lR("Unsupported range type: "+_R(o))}return o.map(e=>(dR(e)?Kz:Xz)(e,n))}(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=Xz(e.type||e),null!=e.gamma&&(t.interpolateGamma=Xz(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=hR(i=e.nice)?{interval:Xz(i.interval),step:Xz(i.step)}:Xz(i)),null!=e.bins&&(n.bins=function(e,t){return e.signal||dR(e)?Kz(e,t):t.objectProperty(e)}(e.bins,t)),e)wR(n,r)||"name"===r||(n[r]=Xz(e[r],t))}function Xz(e,t){return hR(e)?e.signal?t.signalRef(e.signal):lR("Unsupported object: "+_R(e)):e}function Kz(e,t){return e.signal?t.signalRef(e.signal):e.map(e=>Xz(e,t))}function Jz(e){lR("Can not find data set: "+_R(e))}function Qz(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(dR(e)?Zz:e.fields?tL:eL)(e,t,n);null==t.domainMin&&null==t.domainMax||lR("No scale domain defined for domainMin/domainMax to override.")}function Zz(e,t,n){return e.map(e=>Xz(e,n))}function eL(e,t,n){const r=n.getData(e.data);return r||Jz(e.data),lg(t.type)?r.valuesRef(n,e.field,rL(e.sort,!1)):hg(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function tL(e,t,n){const r=e.data,i=e.fields.reduce((e,t)=>(t=ER(t)?{data:r,field:t}:dR(t)||t.signal?function(e,t){const n="_:vega:_"+Vz++,r=wz({});if(dR(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+_R(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,$z({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e),[]);return(lg(t.type)?nL:hg(t.type)?iL:oL)(e,n,i)}function nL(e,t,n){const r=rL(e.sort,!0);let i,o;const a=n.map(e=>{const n=t.getData(e.data);return n||Jz(e.data),n.countsRef(t,e.field,r)}),u={groupby:nz,pulse:a};r&&(i=r.op||"count",o=r.field?iz(i,r.field):"count",u.ops=[Yz[i]],u.fields=[t.fieldRef(o)],u.as=[o]),i=t.add(yz(u));const s=t.add(wz({pulse:ez(i)}));return o=t.add(Hz({field:nz,sort:t.sortRef(r),pulse:ez(s)})),ez(o)}function rL(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!Yz[e.op]&&lR("Multiple domain scales can not be sorted using "+e.op):lR("No field provided for sort aggregate op: "+e.op):hR(e)?e.field="key":e={field:"key"}),e}function iL(e,t,n){const r=n.map(e=>{const n=t.getData(e.data);return n||Jz(e.data),n.domainRef(t,e.field)});return ez(t.add(Nz({values:r})))}function oL(e,t,n){const r=n.map(e=>{const n=t.getData(e.data);return n||Jz(e.data),n.extentRef(t,e.field)});return ez(t.add(Tz({extents:r})))}function aL(e,t,n){return dR(e)?e.map(e=>aL(e,t,n)):hR(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:lR("Unsupported parameter object: "+_R(e)):e}const uL="value",sL=["size","shape","fill","stroke","strokeWidth","strokeDash","opacity"],lL={name:1,style:1,interactive:1},cL={value:0},fL={value:1};function dL(e){return e.type="group",e.interactive=e.interactive||!1,e}function hL(e,t){const n=(n,r)=>uz(e[n],uz(t[n],r));return n.isVertical=n=>"vertical"===uz(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>uz(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>uz(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>uz(e.columns,uz(t.columns,+n.isVertical(!0))),n}function pL(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 mL(e,t,n){return"item.anchor === '".concat("start","' ? ").concat(e," : item.anchor === '").concat("end","' ? ").concat(t," : ").concat(n)}const gL=mL(_R("left"),_R("right"),_R("center"));function vL(e,t){return t?e?hR(e)?Object.assign({},e,{offset:vL(e.offset,t)}):{value:e,offset:t}:t:e}function yL(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=RR(e.encode,t,lL)):e.interactive=!1,e}function bL(e,t,n,r){const i=hL(e,n),o=i.isVertical(),a=i.gradientThickness(),u=i.gradientLength();let s,l,c,f,d;o?(l=[0,1],c=[0,0],f=a,d=u):(l=[0,0],c=[1,0],f=u,d=a);const h={enter:s={opacity:cL,x:cL,y:cL,width:MR(f),height:MR(d)},update:bR({},s,{opacity:fL,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:cL}};return PR(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),yL({type:"rect",role:"legend-gradient",encode:h},r)}function xL(e,t,n,r,i){const o=hL(e,n),a=o.isVertical(),u=o.gradientThickness(),s=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:cL,fill:{scale:t,field:uL}};p[l]={signal:h+"datum.perc",mult:s},p[c]=cL,p[f]={signal:h+"datum.perc2",mult:s},p[d]=MR(u);const m={enter:p,update:bR({},p,{opacity:fL}),exit:{opacity:cL}};return PR(m,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),yL({type:"rect",role:"legend-band",key:uL,from:i,encode:m},r)}const wL="datum.".concat("perc",'<=0?"').concat("left",'":datum.').concat("perc",'>=1?"').concat("right",'":"').concat("center",'"'),EL="datum.".concat("perc",'<=0?"').concat("bottom",'":datum.').concat("perc",'>=1?"').concat("top",'":"').concat("middle",'"');function _L(e,t,n,r){const i=hL(e,t),o=i.isVertical(),a=MR(i.gradientThickness()),u=i.gradientLength();let s,l,c,f,d=i("labelOverlap"),h="";const p={enter:s={opacity:cL},update:l={opacity:fL,text:{field:"label"}},exit:{opacity:cL}};return PR(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:uz(e.labelLimit,t.gradientLabelLimit)}),o?(s.align={value:"left"},s.baseline=l.baseline={signal:EL},c="y",f="x",h="1-"):(s.align=l.align={signal:wL},s.baseline={value:"top"},c="x",f="y"),s[c]=l[c]={signal:h+"datum.perc",mult:u},s[f]=l[f]=a,a.offset=uz(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:i("labelSeparation"),method:d,order:"datum.index"}:void 0,yL({type:"text",role:"legend-label",style:"guide-label",key:uL,from:r,encode:p,overlap:d},n)}function AL(e,t,n,r,i){const o=hL(e,t),a=n.entries,u=!(!a||!a.interactive),s=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?MR(l):{field:"size"},p="datum.".concat("index"),m="max(1, ".concat(i,")");let g,v,y,b,x;h.mult=.5,g={enter:v={opacity:cL,x:{signal:d,mult:.5,offset:c},y:h},update:y={opacity:fL,x:v.x,y:v.y},exit:{opacity:cL}};let w=null,E=null;e.fill||(w=t.symbolBaseFillColor,E=t.symbolBaseStrokeColor),PR(g,{fill:o("symbolFillColor",w),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",E),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),sL.forEach(t=>{e[t]&&(y[t]=v[t]={scale:e[t],field:uL})});const _=yL({type:"symbol",role:"legend-symbol",key:uL,from:f,clip:!!l||void 0,encode:g},n.symbols),A=MR(c);A.offset=o("labelOffset"),g={enter:v={opacity:cL,x:{signal:d,offset:A},y:h},update:y={opacity:fL,text:{field:"label"},x:v.x,y:v.y},exit:{opacity:cL}},PR(g,{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=yL({type:"text",role:"legend-label",style:"guide-label",key:uL,from:f,encode:g},n.labels);return g={enter:{noBound:{value:!l},width:cL,height:l?MR(l):cL,opacity:cL},exit:{opacity:cL},update:y={opacity:fL,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b="ceil(item.mark.items.length / ".concat(m,")"),y.row.signal="".concat(p,"%").concat(b),y.column.signal="floor(".concat(p," / ").concat(b,")"),x={field:["row",p]}):(y.row.signal="floor(".concat(p," / ").concat(m,")"),y.column.signal="".concat(p," % ").concat(m),x={field:p}),y.column.signal="(".concat(i,")?").concat(y.column.signal,":").concat(p),dL({role:"scope",from:r={facet:{data:r,name:"value",groupby:"index"}},encode:RR(g,a,lL),marks:[_,k],name:s,interactive:u,sort:x})}const kL='item.orient === "left"',CL='item.orient === "right"',OL="(".concat(kL," || ").concat(CL,")"),SL="datum.vgrad && ".concat(OL),DL=mL('"top"','"bottom"','"middle"'),FL=mL('"right"','"left"','"center"'),jL="datum.vgrad && ".concat(CL," ? (").concat(FL,") : (").concat(OL," && !(datum.vgrad && ").concat(kL,')) ? "left" : ').concat(gL),TL="item._anchor || (".concat(OL,' ? "middle" : "start")'),NL="".concat(SL," ? (").concat(kL," ? -90 : 90) : 0"),ML="".concat(OL," ? (datum.vgrad ? (").concat(CL,' ? "bottom" : "top") : ').concat(DL,') : "top"');function BL(e,t){let n;return hR(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+PL(e.path)+")":e.sphere&&(n="geoShape("+PL(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function PL(e){return hR(e)&&e.signal?e.signal:_R(e)}function RL(e){const t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")&&t.indexOf("title")?"group"===e.type?"scope":t||"mark":t}function zL(e){return{marktype:e.type,name:e.name||void 0,role:e.role||RL(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function LL(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function IL(e,t){const n=hs(e.type);n||lR("Unrecognized transform type: "+_R(e.type));const r=QR(n.type.toLowerCase(),null,UL(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function UL(e,t,n){const r={},i=e.params.length;for(let o=0;oWL(e,t,n))):WL(e,r,n)}(e,t,n):"projection"===r?n.projectionRef(t[e.name]):e.array&&!oz(i)?i.map(t=>qL(e,t,n)):qL(e,i,n):void(e.required&&lR("Missing required "+_R(t.type)+" parameter: "+_R(e.name)))}function qL(e,t,n){const r=e.type;if(oz(t))return GL(r)?lR("Expression references can not be signals."):XL(r)?n.fieldRef(t):KL(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||XL(r);return i&&HL(t)?n.exprRef(t.expr,t.as):i&&VL(t)?tz(t.field,t.as):GL(r)?UB(t,n):YL(r)?ez(n.getData(t).values):XL(r)?tz(t):KL(r)?n.compareRef(t):t}}function WL(e,t,n){const r=e.params.length;let i;for(let n=0;ne&&e.expr,VL=e=>e&&e.field,YL=e=>"data"===e,GL=e=>"expr"===e,XL=e=>"field"===e,KL=e=>"compare"===e;function JL(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:ez(t.getData(e.data).output)}function QL(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}function ZL(e){return ER(e)?e:null}function eI(e,t,n){const r=iz(n.op,n.field);let i;if(t.ops){for(let e=0,n=t.as.length;enull==e?"null":e).join(",")+"),0)",t);s.update=l.$expr,s.params=l.$params}function rI(e,t){const n=RL(e),r="group"===e.type,i=e.from&&e.from.facet,o=e.overlap;let a,u,s,l,c,f,d,h=e.layout||"scope"===n||"frame"===n;const p="mark"===n||h||i,m=function(e,t,n){let r,i,o,a,u;return e?(r=e.facet)&&(t||lR("Only group marks can be faceted."),null!=r.field?a=u=JL(r,n):(e.data?u=ez(n.getData(e.data).aggregate):(o=IL(bR({type:"aggregate",groupby:yR(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=JL(r,n),a=u=ez(n.add(o))),i=n.keyRef(r.groupby,!0))):a=ez(n.add(wz(null,[{}]))),a||(a=JL(e,n)),{key:i,pulse:a,parent:u}}(e.from,r,t);u=t.add(_z({key:m.key||(e.key?tz(e.key):void 0),pulse:m.pulse,clean:!r}));const g=ez(u);u=s=t.add(wz({pulse:g})),u=t.add(jz({markdef:zL(e),interactive:LL(e.interactive,t),clip:BL(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:ez(u)}));const v=ez(u);u=l=t.add(Az(HR(e.encode,e.type,n,e.style,t,{mod:!1,pulse:v}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(e=>{const n=IL(e,t),r=n.metadata;(r.generates||r.changes)&&lR("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),n.params.pulse=ez(u),t.add(u=n)}),e.sort&&(u=t.add(qz({sort:t.compareRef(e.sort),pulse:ez(u)})));const y=ez(u);(i||h)&&(h=t.add(Wz({layout:t.objectProperty(e.layout),legends:t.legends,mark:v,pulse:y})),f=ez(h));const b=t.add(xz({mark:v,pulse:f||y}));d=ez(b),r&&(p&&(a=t.operators,a.pop(),h&&a.pop()),t.pushState(y,f||d,g),i?function(e,t,n){const r=e.from.facet,i=r.name,o=JL(r,t);let a;r.name||lR("Facet must have a name: "+_R(r)),r.data||lR("Facet must reference a data set: "+_R(r)),r.field?a=t.add(Pz({field:t.fieldRef(r.field),pulse:o})):r.groupby?a=t.add(Cz({key:t.keyRef(r.groupby),group:ez(t.proxy(n.parent)),pulse:o})):lR("Facet must specify groupby or field: "+_R(r));const u=t.fork(),s=u.add(wz()),l=u.add($z({pulse:ez(s)}));u.addData(i,new QL(u,s,s,l)),u.addSignal("parent",null),a.params.subflow={$subflow:u.parse(e).toRuntime()}}(e,t,m):p?function(e,t,n){const r=t.add(Pz({pulse:n.pulse})),i=t.fork();i.add($z()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}(e,t,m):t.parse(e),t.popState(),p&&(h&&a.push(h),a.push(b))),o&&(d=function(e,t,n){const r=e.method,i=e.bound,o=e.separation,a={separation:oz(o)?n.signalRef(o.signal):o,method:oz(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=oz(e)?n.signalRef(e.signal):+e,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return ez(n.add(Mz(a)))}(o,d,t));const x=t.add(Iz({pulse:d})),w=t.add($z({pulse:ez(x)},void 0,t.parent()));null!=e.name&&(c=e.name,t.addData(c,new QL(t,s,x,w)),e.on&&e.on.forEach(e=>{(e.insert||e.remove||e.toggle)&&lR("Marks only support modify triggers."),nI(e,t,c)}))}function iI(e,t){const n=t.config.legend,r=e.encode||{},i=hL(e,n),o=r.legend||{},a=o.name||void 0,u=o.interactive,s=o.style,l={};let c,f,d,h=0;sL.forEach(t=>e[t]?(l[t]=e[t],h=h||e[t]):0),h||lR("Missing valid scale for legend.");const p=function(e,t){let n=e.type||"symbol";e.type||1!==function(e){return sL.reduce((t,n)=>t+(e[n]?1:0),0)}(e)||!e.fill&&!e.stroke||(n=sg(t)?"gradient":cg(t)?"discrete":"symbol");return"gradient"!==n?n:cg(t)?"discrete":"gradient"}(e,t.scaleType(h)),m={title:null!=e.title,scales:l,type:p,vgrad:"symbol"!==p&&i.isVertical()},g=ez(t.add(wz(null,[m]))),v=ez(t.add(Dz(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=[bL(e,h,n,r.gradient),_L(e,n,r.labels,v)],f.count=f.count||t.signalRef("max(2,2*floor((".concat(sz(i.gradientLength()),")/100))"))):"discrete"===p?d=[xL(e,h,n,r.gradient,v),_L(e,n,r.labels,v)]:(c=function(e,t){const n=hL(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),d=[AL(e,n,r,v,sz(c.columns))],f.size=function(e,t,n){const r=sz(aI("size",e,n)),i=sz(aI("strokeWidth",e,n)),o=sz(function(e,t,n){return pL("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 UB("max(ceil(sqrt(".concat(r,")+").concat(i,"),").concat(o,")"),t)}(e,t,d[0].marks)),d=[dL({role:"legend-entry",from:g,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:u})],m.title&&d.push(function(e,t,n,r){const i=hL(e,t),o={enter:{opacity:cL},update:{opacity:fL,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:cL}};return PR(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:TL},angle:{signal:NL},align:{signal:jL},baseline:{signal:ML},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")}),yL({type:"text",role:"legend-title",style:"guide-title",from:r,encode:o},n)}(e,n,r.title,g)),rI(dL({role:"legend",from:g,encode:RR(oI(i,e,n),o,lL),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:u,style:s}),t)}function oI(e,t,n){const r={enter:{},update:{}};return PR(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 aI(e,t,n){return t[e]?'scale("'.concat(t[e],'",datum)'):pL(e,n[0].encode)}QL.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],a=null,u=1;for(o&&"load"===o.type&&(o=t[1]),e.add(t[0]);u{n.push(IL(e,t))}),e.on&&e.on.forEach(n=>{nI(n,t,e.name)}),t.addDataPipeline(e.name,function(e,t,n){const r=[];let i,o,a,u,s,l=null,c=!1,f=!1;e.values?az(e.values)||az(e.format)?(r.push(dI(t,e)),r.push(l=fI())):r.push(l=fI({$ingest:e.values,$format:e.format})):e.url?az(e.url)||az(e.format)?(r.push(dI(t,e)),r.push(l=fI())):r.push(l=fI({$request:e.url,$format:e.format})):e.source&&(l=i=yR(e.source).map(e=>ez(t.getData(e).output)),r.push(null));for(o=0,a=n.length;o"bottom"===e||"top"===e,pI=(e,t,n)=>oz(e)?xI(e.signal,t,n):"left"===e||"top"===e?t:n,mI=(e,t,n)=>oz(e)?yI(e.signal,t,n):hI(e)?t:n,gI=(e,t,n)=>oz(e)?bI(e.signal,t,n):hI(e)?n:t,vI=(e,t,n)=>oz(e)?wI(e.signal,t,n):"top"===e?{value:t}:{value:n},yI=(e,t,n)=>_I("".concat(e," === '").concat("top","' || ").concat(e," === '").concat("bottom","'"),t,n),bI=(e,t,n)=>_I("".concat(e," !== '").concat("top","' && ").concat(e," !== '").concat("bottom","'"),t,n),xI=(e,t,n)=>kI("".concat(e," === '").concat("left","' || ").concat(e," === '").concat("top","'"),t,n),wI=(e,t,n)=>kI("".concat(e," === '").concat("top","'"),t,n),EI=(e,t,n)=>kI("".concat(e," === '").concat("right","'"),t,n),_I=(e,t,n)=>(t=null!=t?MR(t):t,n=null!=n?MR(n):n,AI(t)&&AI(n)?(t=t?t.signal||_R(t.value):null,n=n?n.signal||_R(n.value):null,{signal:"".concat(e," ? (").concat(t,") : (").concat(n,")")}):[bR({test:e},t)].concat(n||[])),AI=e=>null==e||1===Object.keys(e).length,kI=(e,t,n)=>({signal:"".concat(e," ? (").concat(CI(t),") : (").concat(CI(n),")")}),CI=e=>oz(e)?e.signal:null==e?null:_R(e),OI=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function SI(e,t,n,r){let i;if(t&&wR(t,e))return t[e];if(wR(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 DI(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function FI(e,t){return{scale:e.scale,range:t}}function jI(e,t,n,r,i){const o=hL(e,t),a=e.orient,u=e.gridScale,s=pI(a,1,-1),l=function(e,t){if(1===t);else if(hR(e)){let n=e=bR({},e);for(;null!=n.mult;){if(!hR(n.mult))return n.mult=oz(t)?{signal:"(".concat(n.mult,") * (").concat(t.signal,")")}:n.mult*t,e;n=n.mult=bR({},n.mult)}n.mult=t}else e=oz(t)?{signal:"(".concat(t.signal,") * (").concat(e||0,")")}:t*(e||0);return e}(e.offset,s);let c,f,d;const h={enter:c={opacity:cL},update:d={opacity:fL},exit:f={opacity:cL}};PR(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:uL,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},m=mI(a,{signal:"height"},{signal:"width"}),g=u?{scale:u,range:0,mult:s,offset:l}:{value:0,offset:l},v=u?{scale:u,range:1,mult:s,offset:l}:bR(m,{mult:s,offset:l});return c.x=d.x=mI(a,p,g),c.y=d.y=gI(a,p,g),c.x2=d.x2=gI(a,v),c.y2=d.y2=mI(a,v),f.x=mI(a,p),f.y=gI(a,p),yL({type:"rule",role:"axis-grid",key:uL,from:r,encode:h},n)}function TI(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function NI(e,t,n,r,i,o){const a=hL(e,t),u=e.orient,s=e.scale,l=pI(u,-1,1),c=sz(a("labelFlush")),f=sz(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,m=0===c||!!c;const g=MR(i);g.mult=l,g.offset=MR(a("labelPadding")||0),g.offset.mult=l;const v={scale:s,field:uL,band:.5,offset:vL(o.offset,a("labelOffset"))},y=mI(u,m?TI(s,c,'"left"','"right"','"center"'):{value:"center"},((e,t,n)=>oz(e)?EI(e.signal,t,n):"right"===e?{value:t}:{value:n})(u,"left","right")),b=mI(u,vI(u,"bottom","top"),m?TI(s,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=TI(s,c,"-(".concat(f,")"),f,0);m=m&&f;const w={opacity:cL,x:mI(u,v,g),y:gI(u,v,g)},E={enter:w,update:p={opacity:fL,text:{field:"label"},x:w.x,y:w.y,align:y,baseline:b},exit:{opacity:cL,x:w.x,y:w.y}};PR(E,{dx:!d&&m?mI(u,x):null,dy:!h&&m?gI(u,x):null}),PR(E,{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 _=a("labelBound");let A=a("labelOverlap");return A=A||_?{separation:a("labelSeparation"),method:A,order:"datum.index",bound:_?{scale:s,orient:u,tolerance:_}:null}:void 0,p.align!==y&&(p.align=OI(p.align,y)),p.baseline!==b&&(p.baseline=OI(p.baseline,b)),yL({type:"text",role:"axis-label",style:"guide-label",key:uL,from:r,encode:E,overlap:A},n)}function MI(e,t,n,r){const i=hL(e,t),o=e.orient,a=pI(o,-1,1);let u,s;const l={enter:u={opacity:cL,anchor:MR(i("titleAnchor",null)),align:{signal:gL}},update:s=bR({},u,{opacity:fL,text:MR(e.title)}),exit:{opacity:cL}},c={signal:'lerp(range("'.concat(e.scale,'"), ').concat(mL(0,1,.5),")")};return s.x=mI(o,c),s.y=gI(o,c),u.angle=mI(o,cL,((e,t)=>0===t?0:oz(e)?{signal:"(".concat(e.signal,") * ").concat(t)}:{value:e*t})(a,90)),u.baseline=mI(o,vI(o,"bottom","top"),{value:"bottom"}),s.angle=u.angle,s.baseline=u.baseline,PR(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]=OI(MR(e),n.update[t]),!1):!zR(t,r),o=i(e("titleX"),"x"),a=i(e("titleY"),"y");n.enter.auto=a===o?MR(a):mI(t,MR(a),MR(o))}(i,o,l,n),l.update.align=OI(l.update.align,u.align),l.update.angle=OI(l.update.angle,u.angle),l.update.baseline=OI(l.update.baseline,u.baseline),yL({type:"text",role:"axis-title",style:"guide-title",from:r,encode:l},n)}function BI(e,t){const n=function(e,t){var n,r,i,o,a,u,s,l,c=t.config,f=c.style,d=c.axis,h="band"===t.scaleType(e.scale)&&c.axisBand,p=e.orient;if(oz(p)){const e=DI([c.axisX,c.axisY]),t=DI([c.axisTop,c.axisBottom,c.axisLeft,c.axisRight]);for(i of(n={},e))n[i]=mI(p,SI(i,c.axisX,d,f),SI(i,c.axisY,d,f));for(i of(r={},t))r[i]=(o=p.signal,a=SI(i,c.axisTop,d,f),u=SI(i,c.axisBottom,d,f),s=SI(i,c.axisLeft,d,f),l=SI(i,c.axisRight,d,f),{signal:(null!=s?"".concat(o," === '").concat("left","' ? (").concat(CI(s),") : "):"")+(null!=u?"".concat(o," === '").concat("bottom","' ? (").concat(CI(u),") : "):"")+(null!=l?"".concat(o," === '").concat("right","' ? (").concat(CI(l),") : "):"")+(null!=a?"".concat(o," === '").concat("top","' ? (").concat(CI(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?bR({},d,n,r,h):d}(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,u=i.style,s=hL(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'")},hR(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}}(s),c={scale:e.scale,ticks:!!s("ticks"),labels:!!s("labels"),grid:!!s("grid"),domain:!!s("domain"),title:null!=e.title},f=ez(t.add(wz({},[c]))),d=ez(t.add(bz({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(jI(e,n,r.grid,d,l)),c.ticks&&(p=s("tickSize"),h.push(function(e,t,n,r,i,o){const a=hL(e,t),u=e.orient,s=pI(u,-1,1);let l,c,f;const d={enter:l={opacity:cL},update:f={opacity:fL},exit:c={opacity:cL}};PR(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=MR(i);h.mult=s;const p={scale:e.scale,field:uL,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=mI(u,cL,p),f.y2=l.y2=mI(u,h),c.x=mI(u,p),f.x=l.x=gI(u,cL,p),f.x2=l.x2=gI(u,h),c.y=gI(u,p),yL({type:"rule",role:"axis-tick",key:uL,from:r,encode:d},n)}(e,n,r.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(NI(e,n,r.labels,d,p,l))),c.domain&&h.push(function(e,t,n,r){const i=hL(e,t),o=e.orient;let a,u;const s={enter:a={opacity:cL},update:u={opacity:fL},exit:{opacity:cL}};PR(s,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=FI(e,0),c=FI(e,1);return a.x=u.x=mI(o,l,cL),a.x2=u.x2=mI(o,c),a.y=u.y=gI(o,l,cL),a.y2=u.y2=gI(o,c),yL({type:"rule",role:"axis-domain",from:r,encode:s},n)}(e,n,r.domain,f)),c.title&&h.push(MI(e,n,r.title,f)),rI(dL({role:"axis",from:f,encode:RR(PI(s,e),i,lL),marks:h,aria:s("aria"),description:s("description"),zindex:s("zindex"),name:o,interactive:a,style:u}),t)}function PI(e,t){const n={enter:{},update:{}};return PR(n,{orient:e("orient"),offset:e("offset")||0,position:uz(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 RI(e,t,n){const r=yR(e.signals),i=yR(e.scales);return n||r.forEach(e=>KR(e,t)),yR(e.projections).forEach(e=>function(e,t){const n=t.config.projection||{},r={};for(const n in e)"name"!==n&&(r[n]=aL(e[n],n,t));for(const e in n)null==r[e]&&(r[e]=aL(n[e],e,t));t.addProjection(e.name,r)}(e,t)),i.forEach(e=>function(e,t){const n=e.type||"linear";ag(n)||lR("Unrecognized scale type: "+_R(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t)),yR(e.data).forEach(e=>cI(e,t)),i.forEach(e=>Gz(e,t)),(n||r).forEach(e=>function(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?lR("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=UB(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(e=>mz(e,t,n.id))}(e,t)),yR(e.axes).forEach(e=>BI(e,t)),yR(e.marks).forEach(e=>rI(e,t)),yR(e.legends).forEach(e=>iI(e,t)),e.title&&sI(e.title,t),t.parseLambdas(),t}function zI(e,t){const n=t.config,r=ez(t.root=t.add(ZR())),i=function(e,t){const n=n=>uz(e[n],t[n]),r=[LI("background",n("background")),LI("autosize",jR(n("autosize"))),LI("padding",NR(n("padding"))),LI("width",n("width")||0),LI("height",n("height")||0)],i=r.reduce((e,t)=>(e[t.name]=t,e),{}),o={};return yR(e.signals).forEach(e=>{wR(i,e.name)?e=bR(i[e.name],e):r.push(e),o[e.name]=e}),yR(t.signals).forEach(e=>{wR(o,e.name)||wR(i,e.name)||r.push(e)}),r}(e,n);i.forEach(e=>KR(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(wz()),a=t.add(Az(HR((e=>RR({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e))(e.encode),"group","frame",e.style,t,{pulse:ez(o)}))),u=t.add(Wz({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:ez(a)}));t.operators.pop(),t.pushState(ez(a),ez(u),null),RI(e,t,i),t.operators.push(u);let s=t.add(xz({mark:r,pulse:ez(u)}));return s=t.add(Iz({pulse:ez(s)})),s=t.add($z({pulse:ez(s)})),t.addData("root",new QL(t,o,o,s)),t}function LI(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function II(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 UI(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 $I(e){return(dR(e)?qI:WI)(e)}function qI(e){const t=e.length;let n="[";for(let r=0;r0?",":"")+(hR(t)?t.signal||$I(t):_R(t))}return n+"]"}function WI(e){let t,n,r="{",i=0;for(t in e)n=e[t],r+=(++i>1?",":"")+_R(t)+":"+(hR(n)?n.signal||$I(n):_R(n));return r+"}"}function HI(e,t,n){return hR(e)||lR("Input Vega specification must be an object."),zI(e,new II(t=function(...e){return e.reduce((e,t)=>{for(const n in t)if("signals"===n)e.signals=gR(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;mR(e,n,t[n],r)}return e},{})}({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()}II.prototype=UI.prototype={parse(e){return RI(e,this)},fork(){return new UI(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 JR?ez(e):e;return this.add(zz({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(ez(this.add($z({pulse:e})))),this._parent.push(t),this._lookup.push(n?ez(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return vR(this._parent)},encode(){return vR(this._encode)},lookup(){return vR(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(ER(e))return tz(e,t);e.signal||lR("Unsupported field reference: "+_R(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=ez(this.add(Oz(e)))}return r},compareRef(e){let t=!1;const n=e=>oz(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,r=yR(e.field).map(n),i=yR(e.order).map(n);return t?ez(this.add(Ez({fields:r,orders:i}))):rz(r,i)},keyRef(e,t){let n=!1;const r=this.signals;return e=yR(e).map(e=>oz(e)?(n=!0,ez(r[e.signal])):e),n?ez(this.add(Sz({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=iz(e.op,e.field),n=e.order||"ascending";return n.signal?ez(this.add(Ez({fields:t,orders:this.signalRef(n.signal)}))):rz(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 wR(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&lR("Duplicate signal name: "+_R(e));const n=t instanceof JR?t:this.add(ZR(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||lR("Unrecognized signal name: "+_R(e)),this.signals[e]},signalRef(e){return this.signals[e]?ez(this.signals[e]):(wR(this.lambdas,e)||(this.lambdas[e]=this.add(ZR(null))),ez(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;tt&&l(),a=t=n+1):"]"===r&&(a||XI("Access path missing open bracket: "+e),a>0&&l(),a=0,t=n+1):n>t?l():t=n+1}return a&&XI("Access path missing closing bracket: "+e),o&&XI("Access path missing closing quote: "+e),n>t&&(n++,l()),i},JI=Array.isArray,QI=function(e){return e===Object(e)},ZI=function(e){return"string"==typeof e};function eU(e){return JI(e)?"["+e.map(eU)+"]":QI(e)||ZI(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}var tU,nU,rU,iU,oU=[],aU=(rU=KI(tU="id"),iU="return _["+rU.map(eU).join("][")+"];",GI(Function("_",iU),[tU=1===rU.length?rU[0]:tU],nU||tU),GI((function(e){return e}),oU,"identity"));GI((function(){return 0}),oU,"zero"),GI((function(){return 1}),oU,"one"),GI((function(){return!0}),oU,"true"),GI((function(){return!1}),oU,"false");function uU(e,t,n){var r=[t].concat([].slice.call(n));console[e].apply(console,r)}function sU(...e){return e.reduce((e,t)=>{for(var n in t)if("signals"===n)e.signals=cU(e.signals,t.signals);else{var r="legend"===n?{layout:1}:"style"===n||null;lU(e,n,t[n],r)}return e},{})}function lU(e,t,n,r){var i,o;if(QI(n)&&!JI(n))for(i in o=QI(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?lU(o,i,n[i]):o[i]=n[i];else e[t]=n}function cU(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}var fU=function(e){return null!=e?JI(e)?e:[e]:[]},dU=function(e){return"function"==typeof e};const hU=Object.prototype.hasOwnProperty;var pU=function(e,t){return hU.call(e,t)},mU=function(e){return"boolean"==typeof e},gU=function(e){return"number"==typeof e};var vU=function(e){for(var t={},n=0,r=e.length;nOU(e,t))}:AU(e)?{or:e.or.map(e=>OU(e,t))}:t(e)}const SU=wU.a,DU=bU.a;function FU(e,t){const n={};for(const r of t)pU(e,r)&&(n[r]=e[r]);return n}function jU(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=>_U()(e)).join(",")})`};const TU=_U.a;function NU(e){if(gU(e))return e;const t=ZI(e)?e:_U()(e);if(t.length<250)return t;let n=0;for(let e=0;e-1}function PU(e,t){let n=0;for(const[r,i]of e.entries())if(t(i,r,n++))return!0;return!1}function RU(e,t){let n=0;for(const[r,i]of e.entries())if(!t(i,r,n++))return!1;return!0}function zU(e,t){for(const n of Object.keys(t))lU(e,n,t[n],!0)}function LU(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 IU(e,t){for(const n of e)if(t.has(n))return!0;return!1}function UU(e){const t=new Set;for(const n of e){const e=KI(n).map((e,t)=>0===t?e:`[${e}]`);e.map((t,n)=>e.slice(0,n+1).join("")).forEach(e=>t.add(e))}return t}function $U(e,t){return void 0===e||void 0===t||IU(UU(e),UU(t))}const qU=Object.keys;function WU(e){const t=[];for(const n in e)pU(e,n)&&t.push(e[n]);return t}function HU(e){return!0===e||!1===e}function VU(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function YU(e,t){return CU(e)?"!("+YU(e.not,t)+")":kU(e)?"("+e.and.map(e=>YU(e,t)).join(") && (")+")":AU(e)?"("+e.or.map(e=>YU(e,t)).join(") || (")+")":t(e)}function GU(e,t){if(0===t.length)return!0;const n=t.shift();return GU(e[n],t)&&delete e[n],0===qU(e).length}function XU(e){return e.charAt(0).toUpperCase()+e.substr(1)}function KU(e,t="datum"){const n=KI(e),r=[];for(let e=1;e<=n.length;e++){const i=`[${n.slice(0,e).map(eU).join("][")}]`;r.push(`${t}${i}`)}return r.join(" && ")}function JU(e){return""+KI(e).map(e=>QU(e,".","\\.")).join("\\.")}function QU(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function ZU(e){return""+KI(e).join(".")}function e$(e){return e?KI(e).length:0}function t$(...e){for(const t of e)if(void 0!==t)return t}let n$=42;function r$(e){const t=++n$;return e?String(e)+t:t}function i$(e){return(e%360+360)%360}const o$={area:1,bar:1,image:1,line:1,point:1,text:1,tick:1,trail:1,rect:1,geoshape:1,rule:1,circle:1,square:1};function a$(e){return BU(["line","area","trail"],e)}function u$(e){return BU(["rect","bar","image"],e)}const s$=qU(o$);function l$(e){return e.type}vU(s$);const c$=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],f$=["filled","color","tooltip","invalid","timeUnitBandPosition","timeUnitBand"],d$={binSpacing:1,continuousBandSize:5,timeUnitBandPosition:.5},h$={binSpacing:0,continuousBandSize:5,timeUnitBandPosition:.5};function p$(e){return!!e.mark}class m${constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!p$(e)&&(l$(t=e.mark)?t.type:t)===this.name;var t}}const g$={argmax:1,argmin:1,average:1,count:1,distinct: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},v$={count:1,min:1,max:1};function y$(e){return!!e&&!!e.argmin}function b$(e){return!!e&&!!e.argmax}qU(g$);function x$(e){return ZI(e)&&!!g$[e]}const w$=["count","valid","missing","distinct"];function E$(e){return ZI(e)&&BU(w$,e)}const _$=["count","sum","distinct","valid","missing"],A$=vU(["mean","average","median","q1","q3","min","max"]),k$="row",C$="x",O$="y",S$="color",D$="fill",F$="stroke",j$="shape",T$="size",N$="opacity",M$="fillOpacity",B$="strokeOpacity",P$="strokeWidth",R$={x:1,y:1,x2:1,y2:1};const z$={longitude:1,longitude2:1,latitude:1,latitude2:1};const L$=qU(z$),I$=Object.assign(Object.assign(Object.assign({},R$),z$),{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,size:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1});function U$(e){return"color"===e||"fill"===e||"stroke"===e}const $$={row:1,column:1,facet:1},q$=qU($$),W$=Object.assign(Object.assign({},I$),$$),H$=qU(W$),{order:V$,detail:Y$,tooltip:G$}=W$,X$=C(W$,["order","detail","tooltip"]),{row:K$,column:J$,facet:Q$}=X$,Z$=C(X$,["row","column","facet"]);qU(X$),qU(Z$);function eq(e){return!!W$[e]}const tq=["x2","y2","latitude2","longitude2"];function nq(e){return rq(e)!==e}function rq(e){switch(e){case"x2":return"x";case"y2":return"y";case"latitude2":return"latitude";case"longitude2":return"longitude"}return e}function iq(e){switch(e){case"x":return"x2";case"y":return"y2";case"latitude":return"latitude2";case"longitude":return"longitude2"}}qU(I$);const{x:oq,y:aq,x2:uq,y2:sq,latitude:lq,longitude:cq,latitude2:fq,longitude2:dq}=I$,hq=C(I$,["x","y","x2","y2","latitude","longitude","latitude2","longitude2"]),pq=qU(hq),mq={x:1,y:1},gq=qU(mq);function vq(e){return"x"===e?"width":"height"}function yq(e){return"width"===e?"x":"y"}const{text:bq,tooltip:xq,href:wq,url:Eq,detail:_q,key:Aq,order:kq}=hq,Cq=C(hq,["text","tooltip","href","url","detail","key","order"]),Oq=qU(Cq);const Sq=Object.assign(Object.assign({},mq),Cq),Dq=qU(Sq);function Fq(e){return!!Sq[e]}function jq(e,t){return function(e){switch(e){case S$:case D$:case F$:case"detail":case"key":case"tooltip":case"href":case"order":case N$:case M$:case B$:case P$:case"facet":case k$:case"column":return Tq;case C$:case O$:case"latitude":case"longitude":return Mq;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 T$:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case j$:return{point:"always",geoshape:"always"};case"text":return{text:"always"};case"url":return{image:"always"}}}(e)[t]}const Tq={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"},{geoshape:Nq}=Tq,Mq=C(Tq,["geoshape"]);function Bq(e){switch(e){case C$:case O$:case T$:case P$:case N$:case M$:case B$:case"x2":case"y2":return;case"facet":case k$:case"column":case j$:case"text":case"tooltip":case"href":case"url":return"discrete";case S$:case D$:case F$:return"flexible";case"latitude":case"longitude":case"latitude2":case"longitude2":case"detail":case"key":case"order":return}}function Pq(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".`}const Rq='Autosize "fit" only works for single views and layered views.';function zq(e){return("width"==e?"Width":"Height")+' "container" only works for single views and layered views.'}function Lq(e){return("width"==e?"Width":"Height")+' "container" only works well with autosize "fit" or "fit-x".'}function Iq(e){return e?`Dropping "fit-${e}" because spec has discrete ${vq(e)}.`:'Dropping "fit" because spec has discrete size.'}function Uq(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function $q(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function qq(e){return`The "nearest" transform is not supported for ${e} marks.`}function Wq(e){return`Selection not supported for ${e} yet.`}function Hq(e){return`Cannot find a selection named "${e}".`}const Vq="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Yq="Legend bindings are only supported for selections over an individual field or encoding channel.";function Gq(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}function Xq(e){return`Unknown repeated value "${e}".`}function Kq(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Jq="Axes cannot be shared in concatenated views yet (https://github.com/vega/vega-lite/issues/2415).",Qq="Axes cannot be shared in repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Zq(e){return`Unrecognized parse "${e}".`}function eW(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function tW(e){return`Ignoring an invalid transform: ${TU(e)}.`}const nW='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.';function rW(e){return`Layer's shared ${e.join(",")} channel ${1===e.length?"is":"are"} overriden.`}function iW(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${TU(t)} is overridden by a child projection ${TU(n)}.`}function oW(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${TU(n)}}.`}function aW(e){return`Invalid field type "${e}".`}function uW(e,t,n){return`A ${n.scaleType?n.scaleType+" scale":n.zeroFalse?"scale with zero=false":"scale with custom domain that excludes zero"} is used to encode ${e}'s ${t}. This can be misleading as the ${"x"===t?"width":"height"} of the ${e} can be arbitrary based on the scale domain. You may want to use point mark instead.`}function sW(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function lW(e){return`Invalid aggregation operator "${e}".`}function cW(e,t){return`Missing type for channel "${e}", using "${t}" instead.`}function fW(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 dW(e,t){return`Dropping ${TU(e)} from channel "${t}" since it does not contain data field or value.`}function hW(e,t,n){return`${e}-encoding with type ${t} is deprecated. Replacing with ${n}-encoding.`}const pW="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function mW(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?" when "+n:""}.`}function gW(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function vW(e){return e+" encoding should be discrete (ordinal / nominal / binned)."}function yW(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function bW(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function xW(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function wW(e,t){return`Specified orient "${e}" overridden with "${t}".`}const EW="Custom domain scale cannot be unioned with default field-based domain.",_W='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.';function AW(e){return`Cannot use the scale property "${e}" with non-color channel.`}function kW(e){return`Using unaggregated domain with raw field has no effect (${TU(e)}).`}function CW(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function OW(e){return`Unaggregated domain is currently unsupported for log scale (${TU(e)}).`}function SW(e){return`Cannot apply size to non-oriented mark "${e}".`}function DW(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function FW(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function jW(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function TW(e,t){return`Scale type "${t}" does not work with mark "${e}".`}function NW(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}function MW(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${TU(n)} and ${TU(r)}). Using ${TU(n)}.`}function BW(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${TU(n)} and ${TU(r)}). Using the union of the two domains.`}function PW(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function RW(e){return`Dropping sort property ${TU(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const zW="Unable to merge domains.",LW="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",IW="Invalid channel for axis.";function UW(e){return`Cannot stack "${e}" if there is already "${e}2".`}function $W(e){return`Cannot stack non-linear scale (${e}).`}function qW(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function WW(e,t){return`Invalid ${e}: ${TU(t)}.`}function HW(e){return`Time unit "${e}" is not supported. We are replacing it with ${QU(e,"day","date")}.`}function VW(e){return`Dropping day from datetime ${TU(e)} as day cannot be combined with other units.`}function YW(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function GW(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function XW(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function KW(e,t){return`Center is not needed to be specified in ${t} when extent is ${e}.`}function JW(e){return`1D error band does not support ${e}.`}function QW(e){return`Channel ${e} is required for "binned" bin.`}function ZW(e){return`Domain for ${e} is required for threshold scale.`}const eH=y,tH=(rH=2||0,{level:function(e){return arguments.length?(rH=+e,this):rH},error:function(){return rH>=1&&uU(nH||"error","ERROR",arguments),this},warn:function(){return rH>=2&&uU(nH||"warn","WARN",arguments),this},info:function(){return rH>=3&&uU(nH||"log","INFO",arguments),this},debug:function(){return rH>=4&&uU(nH||"log","DEBUG",arguments),this}});var nH,rH;let iH=tH;function oH(){return iH=tH,iH}function aH(...e){iH.warn(...e)}function uH(e){return!!(e&&(e.year||e.quarter||e.month||e.date||e.day||e.hours||e.minutes||e.seconds||e.milliseconds))}const sH=["january","february","march","april","may","june","july","august","september","october","november","december"],lH=sH.map(e=>e.substr(0,3)),cH=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],fH=cH.map(e=>e.substr(0,3));function dH(e,t=!1,n=!1){const r=[];if(t&&void 0!==e.day&&qU(e).length>1&&(aH(eH.droppedDay(e)),delete(e=DU(e)).day),void 0!==e.year?r.push(e.year):void 0!==e.day?r.push(2006):r.push(0),void 0!==e.month){const n=t?function(e){if(gU(e))return(e-1).toString();{const t=e.toLowerCase(),n=sH.indexOf(t);if(-1!==n)return n+"";const r=t.substr(0,3),i=lH.indexOf(r);if(-1!==i)return i+"";throw new Error(eH.invalidTimeUnit("month",e))}}(e.month):e.month;r.push(n)}else if(void 0!==e.quarter){const n=t?function(e){if(gU(e))return e>4&&aH(eH.invalidTimeUnit("quarter",e)),(e-1).toString();throw new Error(eH.invalidTimeUnit("quarter",e))}(e.quarter):e.quarter;r.push(n+"*3")}else r.push(0);if(void 0!==e.date)r.push(e.date);else if(void 0!==e.day){const n=t?function(e){if(gU(e))return e%7+"";{const t=e.toLowerCase(),n=cH.indexOf(t);if(-1!==n)return n+"";const r=t.substr(0,3),i=fH.indexOf(r);if(-1!==i)return i+"";throw new Error(eH.invalidTimeUnit("day",e))}}(e.day):e.day;r.push(n+"+1")}else r.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const n=e[t];r.push(void 0===n?0:n)}const i=r.join(", ");return n?e.utc?new Function(`return +new Date(Date.UTC(${i}))`)():new Function(`return +new Date(${i})`)():e.utc?`utc(${i})`:`datetime(${i})`}var hH;!function(e){e.YEAR="year",e.MONTH="month",e.DAY="day",e.DATE="date",e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds",e.MILLISECONDS="milliseconds",e.YEARMONTH="yearmonth",e.YEARMONTHDATE="yearmonthdate",e.YEARMONTHDATEHOURS="yearmonthdatehours",e.YEARMONTHDATEHOURSMINUTES="yearmonthdatehoursminutes",e.YEARMONTHDATEHOURSMINUTESSECONDS="yearmonthdatehoursminutesseconds",e.MONTHDATE="monthdate",e.MONTHDATEHOURS="monthdatehours",e.HOURSMINUTES="hoursminutes",e.HOURSMINUTESSECONDS="hoursminutesseconds",e.MINUTESSECONDS="minutesseconds",e.SECONDSMILLISECONDS="secondsmilliseconds",e.QUARTER="quarter",e.YEARQUARTER="yearquarter",e.QUARTERMONTH="quartermonth",e.YEARQUARTERMONTH="yearquartermonth",e.UTCYEAR="utcyear",e.UTCMONTH="utcmonth",e.UTCDAY="utcday",e.UTCDATE="utcdate",e.UTCHOURS="utchours",e.UTCMINUTES="utcminutes",e.UTCSECONDS="utcseconds",e.UTCMILLISECONDS="utcmilliseconds",e.UTCYEARMONTH="utcyearmonth",e.UTCYEARMONTHDATE="utcyearmonthdate",e.UTCYEARMONTHDATEHOURS="utcyearmonthdatehours",e.UTCYEARMONTHDATEHOURSMINUTES="utcyearmonthdatehoursminutes",e.UTCYEARMONTHDATEHOURSMINUTESSECONDS="utcyearmonthdatehoursminutesseconds",e.UTCMONTHDATE="utcmonthdate",e.UTCMONTHDATEHOURS="utcmonthdatehours",e.UTCHOURSMINUTES="utchoursminutes",e.UTCHOURSMINUTESSECONDS="utchoursminutesseconds",e.UTCMINUTESSECONDS="utcminutesseconds",e.UTCSECONDSMILLISECONDS="utcsecondsmilliseconds",e.UTCQUARTER="utcquarter",e.UTCYEARQUARTER="utcyearquarter",e.UTCQUARTERMONTH="utcquartermonth",e.UTCYEARQUARTERMONTH="utcyearquartermonth"}(hH||(hH={}));const pH={year:1,quarter:1,month:1,day:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},mH=qU(pH);const gH={utcyear:1,utcquarter:1,utcmonth:1,utcday:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1};const vH={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcquartermonth:1,utcmonthdate:1,utcmonthdatehours:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1},yH=Object.assign(Object.assign({},gH),vH);const bH=Object.assign(Object.assign(Object.assign(Object.assign({},pH),gH),{yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,quartermonth:1,monthdate:1,monthdatehours:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1}),vH),xH=(qU(bH),{"year-month":"%b %Y ","year-month-date":"%b %d, %Y "});function wH(e){return mH.reduce((t,n)=>EH(e,n)?[...t,n]:t,[])}function EH(e,t){const n=e.indexOf(t);return n>-1&&(t!==hH.SECONDS||0===n||"i"!==e.charAt(n-1))}function _H(e,t,{end:n}={end:!1}){const r=KU(t),i=yH[e]?"utc":"";let o;const a=mH.reduce((t,n)=>{var a;return EH(e,n)&&(t[n]=(a=n)===hH.QUARTER?`(${i}quarter(${r})-1)`:`${i}${a}(${r})`,o=n),t},{});return n&&(a[o]+="+1"),dH(a)}function AH(e,t,n){if(!e)return;const r=function(e){if(!e)return;const t=wH(e);return`timeUnitSpecifier(${_U()(t)}, ${_U()(xH)})`}(e);return n?`utcFormat(${t}, ${r})`:`timeFormat(${t}, ${r})`}function kH(e){return"day"!==e&&e.indexOf("day")>=0?(aH(eH.dayReplacedWithDate(e)),QU(e,"day","date")):e}function CH(e){return e&&!!e.field&&void 0!==e.equal}function OH(e){return e&&!!e.field&&void 0!==e.lt}function SH(e){return e&&!!e.field&&void 0!==e.lte}function DH(e){return e&&!!e.field&&void 0!==e.gt}function FH(e){return e&&!!e.field&&void 0!==e.gte}function jH(e){return!!(e&&e.field&&JI(e.range)&&2===e.range.length)}function TH(e){return e&&!!e.field&&(JI(e.oneOf)||JI(e.in))}function NH(e){return TH(e)||CH(e)||jH(e)||OH(e)||DH(e)||SH(e)||FH(e)}function MH(e,t){return pY(e,{timeUnit:t,time:!0})}function BH(e,t=!0){const{field:n,timeUnit:r}=e,i=r?"time("+_H(r,n)+")":JV(e,{expr:"datum"});if(CH(e))return i+"==="+MH(e.equal,r);if(OH(e)){return`${i}<${MH(e.lt,r)}`}if(DH(e)){return`${i}>${MH(e.gt,r)}`}if(SH(e)){return`${i}<=${MH(e.lte,r)}`}if(FH(e)){return`${i}>=${MH(e.gte,r)}`}if(TH(e))return`indexof([${function(e,t){return e.map(e=>MH(e,t))}(e.oneOf,r).join(",")}], ${i}) !== -1`;if(function(e){return e&&!!e.field&&void 0!==e.valid}(e))return PH(i,e.valid);if(jH(e)){const n=e.range[0],o=e.range[1];if(null!==n&&null!==o&&t)return"inrange("+i+", ["+MH(n,r)+", "+MH(o,r)+"])";const a=[];return null!==n&&a.push(`${i} >= ${MH(n,r)}`),null!==o&&a.push(`${i} <= ${MH(o,r)}`),a.length>0?a.join(" && "):"true"}throw new Error("Invalid field predicate: "+JSON.stringify(e))}function PH(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function RH(e){return NH(e)&&e.timeUnit?Object.assign(Object.assign({},e),{timeUnit:kH(e.timeUnit)}):e}const zH={quantitative:1,ordinal:1,temporal:1,nominal:1,geojson:1};var LH;!function(e){e.LINEAR="linear",e.LOG="log",e.POW="pow",e.SQRT="sqrt",e.SYMLOG="symlog",e.TIME="time",e.UTC="utc",e.QUANTILE="quantile",e.QUANTIZE="quantize",e.THRESHOLD="threshold",e.BIN_ORDINAL="bin-ordinal",e.ORDINAL="ordinal",e.POINT="point",e.BAND="band"}(LH||(LH={}));const IH={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"},UH=qU(IH);function $H(e,t){const n=IH[e],r=IH[t];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}const qH={linear:0,log:1,pow:1,sqrt:1,symlog:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function WH(e){return qH[e]}const HH=["linear","log","pow","sqrt","symlog","time","utc"],VH=vU(HH),YH=vU(["quantile","quantize","threshold"]),GH=HH.concat(["quantile","quantize","threshold"]),XH=vU(GH),KH=vU(["ordinal","bin-ordinal","point","band"]);function JH(e){return e in KH}function QH(e){return e in XH}function ZH(e){return e in VH}function eV(e){return e in YH}function tV(e){var t;return null===(t=e)||void 0===t?void 0:t.selection}const nV={type:1,domain:1,align:1,range: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:rV,domain:iV,range:oV,scheme:aV}=(qU(nV),nV),uV=C(nV,["type","domain","range","scheme"]),sV=qU(uV);!function(){var e;const t={};for(const n of H$)for(const r of qU(zH))for(const i of UH){const o=hV(n,r);dV(n,i)&&fV(i,r)&&(t[o]=null!=(e=t[o])?e:[],t[o].push(i))}}();function lV(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!BU(["point","band","identity"],e);case"bins":return!BU(["point","band","identity","ordinal"],e);case"round":return ZH(e)||"band"===e||"point"===e;case"padding":return ZH(e)||BU(["point","band"],e);case"paddingOuter":case"align":return BU(["point","band"],e);case"paddingInner":return"band"===e;case"clamp":return ZH(e);case"nice":return ZH(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return QH(e)&&!BU(["log","time","utc","threshold","quantile"],e)}}function cV(e,t){switch(t){case"interpolate":case"scheme":return U$(e)?void 0:eH.cannotUseScalePropertyWithNonColor(e);case"align":case"type":case"bins":case"domain":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"reverse":case"round":case"clamp":case"zero":return}}function fV(e,t){return BU(["ordinal","nominal"],t)?void 0===e||JH(e):"temporal"===t?BU([LH.TIME,LH.UTC,void 0],e):"quantitative"!==t||BU([LH.LOG,LH.POW,LH.SQRT,LH.SYMLOG,LH.QUANTILE,LH.QUANTIZE,LH.THRESHOLD,LH.LINEAR,void 0],e)}function dV(e,t){switch(e){case C$:case O$:return ZH(t)||BU(["band","point"],t);case T$:case P$:case N$:case M$:case B$:return ZH(t)||eV(t)||BU(["band","point"],t);case S$:case D$:case F$:return"band"!==t;case j$:return"ordinal"===t}return!1}function hV(e,t){return e+"_"+t}function pV(e){const{anchor:t,frame:n,offset:r,orient:i,color:o}=e,a=C(e,["anchor","frame","offset","orient","color"]);return{mark:Object.assign(Object.assign({},a),o?{fill:o}:{}),nonMark:Object.assign(Object.assign(Object.assign(Object.assign({},t?{anchor:t}:{}),n?{frame:n}:{}),r?{offset:r}:{}),i?{orient:i}:{})}}function mV(e){return ZI(e)||JI(e)&&ZI(e[0])}function gV(e){var t;return[].concat(e.type,null!=(t=e.style)?t:[])}function vV(e,t,n){return t$(t[e],yV(e,t,n))}function yV(e,t,n,{vgChannel:r}={}){return t$(r?bV(e,t,n.style):void 0,bV(e,t,n.style),r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function bV(e,t,n){const r=gV(t);let i;for(const t of r){const r=n[t],o=e;r&&void 0!==r[o]&&(i=r[o])}return i}function xV(e,t,n,r){if(hY(e)){const i=GV(e)&&e.scale&&e.scale.type===LH.UTC;return{signal:kV(JV(e,{expr:n}),e.timeUnit,t,r.timeFormat,i,!0)}}{const i=wV(e,t,r);if(yY(e.bin)){return{signal:AV(JV(e,{expr:n}),JV(e,{expr:n,binSuffix:"end"}),i,r)}}return"quantitative"===e.type||i?{signal:""+EV(JV(e,{expr:n,binSuffix:"range"}),i)}:{signal:"''+"+JV(e,{expr:n})}}}function wV(e,t,n){return t||("quantitative"===e.type?n.numberFormat:void 0)}function EV(e,t){return`format(${e}, "${t||""}")`}function _V(e,t,n){return EV(e,null!=t?t:n.numberFormat)}function AV(e,t,n,r){return`${PH(e,!1)} ? "null" : ${_V(e,n,r)} + " – " + ${_V(t,n,r)}`}function kV(e,t,n,r,i,o=!1){return!t||n?(n=null!=n?n:r)||o?`${i?"utc":"time"}Format(${e}, '${n}')`:void 0:AH(t,e,i)}function CV(e,t){return fU(e).reduce((e,n)=>{var r;return e.field.push(JV(n,t)),e.order.push(null!=(r=n.sort)?r:"ascending"),e},{field:[],order:[]})}function OV(e,t){const n=[...e];return t.forEach(e=>{for(const t of n)if(SU(t,e))return;n.push(e)}),n}function SV(e,t){return SU(e,t)||!t?e:e?[...fU(e),...fU(t)].join(", "):t}function DV(e,t){const n=e.value,r=t.value;if(null==n||null===r)return{explicit:e.explicit,value:null};if(mV(n)&&mV(r))return{explicit:e.explicit,value:SV(n,r)};if(!mV(n)&&!mV(r))return{explicit:e.explicit,value:OV(n,r)};throw new Error("It should never reach here")}const FV="mean",jV={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function TV(e){return!!jV[e]}function NV(e){return!!e&&!!e.encoding}function MV(e){return!(!e||"count"!==e.op&&!e.field)}function BV(e){return!!e&&JI(e)}function PV(e){return!!e.row||!!e.column}function RV(e){return void 0!==e.facet}function zV(e){const{field:t,timeUnit:n,bin:r,aggregate:i}=e;return Object.assign(Object.assign(Object.assign(Object.assign({},n?{timeUnit:n}:{}),r?{bin:r}:{}),i?{aggregate:i}:{}),{field:t})}function LV(e){return HV(e)&&!!e.sort}function IV(e,t,n,r,i,{isMidPoint:o}={}){const{timeUnit:a,bin:u}=t;if(BU(["x","y"],e)){if(XV(t)&&void 0!==t.band)return t.band;if(a&&!n)return o?yV("timeUnitBandPosition",r,i):u$(r.type)?yV("timeUnitBand",r,i):0;if(yY(u))return u$(r.type)&&!o?1:.5}}function UV(e,t,n,r,i){return!!(yY(t.bin)||t.timeUnit&&HV(t)&&"temporal"===t.type)&&!!IV(e,t,n,r,i)}function $V(e){return!!e&&!!e.condition}function qV(e){return!!e&&!!e.condition&&!JI(e.condition)&&WV(e.condition)}function WV(e){return!(!e||!e.field&&"count"!==e.aggregate)}function HV(e){return!!e&&(!!e.field&&!!e.type||"count"===e.aggregate)}function VV(e){return WV(e)&&ZI(e.field)}function YV(e){return e&&"value"in e&&void 0!==e.value}function GV(e){return!(!e||!e.scale&&!e.sort)}function XV(e){return!(!e||!e.axis&&!e.stack&&!e.impute&&void 0===e.band)}function KV(e){return!!e&&!!e.format}function JV(e,t={}){var n,r,i;let o=e.field;const a=t.prefix;let u=t.suffix,s="";if(function(e){return"count"===e.aggregate}(e))o=function(e){return function(e){return 0===e.indexOf("__")}(e)?e:"__"+e}("count");else{let a;if(!t.nofn)if(function(e){return!!e.op}(e))a=e.op;else{const{bin:l,aggregate:c,timeUnit:f}=e;yY(l)?(a=vY(l),u=(null!=(n=t.binSuffix)?n:"")+(null!=(r=t.suffix)?r:"")):c?b$(c)?(s="."+o,o="argmax_"+c.argmax):y$(c)?(s="."+o,o="argmin_"+c.argmin):a=String(c):f&&(a=String(f),u=(!BU(["range","mid"],t.binSuffix)&&t.binSuffix||"")+(null!=(i=t.suffix)?i:""))}a&&(o=o?`${a}_${o}`:a)}return u&&(o=`${o}_${u}`),a&&(o=`${a}_${o}`),t.forAs?o:t.expr?function(e,t="datum"){return`${t}[${eU(KI(e).join("."))}]`}(o,t.expr)+s:JU(o)+s}function QV(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return!!e.bin;case"temporal":return!1}throw new Error(eH.invalidFieldType(e.type))}function ZV(e){return!QV(e)}const eY=(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(b$(t))return`${i} for argmax(${t.argmax})`;if(y$(t))return`${i} for argmin(${t.argmin})`;const o=t||r||yY(n)&&"bin";return o?o.toUpperCase()+"("+i+")":i}(e);default:return function(e,t){const{field:n,bin:r,timeUnit:i,aggregate:o}=e;if("count"===o)return t.countTitle;if(yY(r))return n+" (binned)";if(i){return`${n} (${wH(i).join("-")})`}return o?b$(o)?`${n} for max ${o.argmax}`:y$(o)?`${n} for min ${o.argmin}`:`${XU(o)} of ${n}`:n}(e,t)}};let tY=eY;function nY(e){tY=e}function rY(e,t,{allowDisabling:n,includeDefault:r=!0}){var i,o;const a=(null!=(i=iY(e))?i:{}).title,u=r?oY(e,t):void 0;return n?t$(a,e.title,u):null!=(o=null!=a?a:e.title)?o:u}function iY(e){return XV(e)&&e.axis?e.axis:(t=e)&&t.legend&&e.legend?e.legend:function(e){return!!e&&!!e.header}(e)&&e.header?e.header:void 0;var t}function oY(e,t){return tY(e,t)}function aY(e){var t;if(KV(e)&&e.format)return e.format;return(null!=(t=iY(e))?t:{}).format}function uY(e){return WV(e)?e:qV(e)?e.condition:void 0}function sY(e){return WV(e)?e:qV(e)?e.condition:void 0}function lY(e,t){if(ZI(e)||gU(e)||mU(e)){const n=ZI(e)?"string":gU(e)?"number":"boolean";return aH(eH.primitiveChannelDef(t,n,e)),{value:e}}return WV(e)?cY(e,t):qV(e)?Object.assign(Object.assign({},e),{condition:cY(e.condition,t)}):e}function cY(e,t){const{aggregate:n,timeUnit:r,bin:i,field:o}=e,a=Object.assign({},e);if(!n||x$(n)||b$(n)||y$(n)||(aH(eH.invalidAggregate(n)),delete a.aggregate),r&&(a.timeUnit=kH(r)),o&&(a.field=""+o),yY(i)&&(a.bin=fY(i,t)),bY(i)&&!BU(gq,t)&&aH(`Channel ${t} should not be used with "binned" bin`),HV(a)){const{type:e}=a,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case"quantitative":return"quantitative";case"t":case"temporal":return"temporal";case"o":case"ordinal":return"ordinal";case"n":case"nominal":return"nominal";case"geojson":return"geojson"}}(e);e!==t&&(a.type=t),"quantitative"!==e&&E$(n)&&(aH(eH.invalidFieldTypeForCountAggregate(e,n)),a.type="quantitative")}else if(!nq(t)){const e=function(e,t){if(e.timeUnit)return"temporal";if(yY(e.bin))return"quantitative";switch(Bq(t)){case"continuous":return"quantitative";case"discrete":case"flexible":return"nominal";default:return"quantitative"}}(a,t);aH(eH.missingFieldType(t,e)),a.type=e}if(HV(a)){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"row":case"column":case"facet":return ZV(e)?{compatible:!1,warning:eH.facetChannelShouldBeDiscrete(t)}:dY;case"x":case"y":case"color":case"fill":case"stroke":case"text":case"detail":case"key":case"tooltip":case"href":case"url":return dY;case"longitude":case"longitude2":case"latitude":case"latitude2":return"quantitative"!==n?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:dY;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case"x2":case"y2":return"nominal"!==n||e.sort?dY:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case"shape":return BU(["ordinal","nominal","geojson"],e.type)?dY:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return"nominal"!==e.type||"sort"in e?dY:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}throw new Error("channelCompatability not implemented for channel "+t)}(a,t);e||aH(n)}if(LV(a)&&ZI(a.sort)){const{sort:e}=a;if(TV(e))return Object.assign(Object.assign({},a),{sort:{encoding:e}});const t=e.substr(1);if("-"===e.charAt(0)&&TV(t))return Object.assign(Object.assign({},a),{sort:{encoding:t,order:"descending"}})}return a}function fY(e,t){return mU(e)?{maxbins:EY(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign(Object.assign({},e),{maxbins:EY(t)})}const dY={compatible:!0};function hY(e){const t=iY(e),n=t&&t.formatType||KV(e)&&e.formatType;return"time"===n||!n&&function(e){return"temporal"===e.type||!!e.timeUnit}(e)}function pY(e,{timeUnit:t,type:n,time:r,undefinedIfExprNotRequired:i}){let o;var a;return uH(e)?o=dH(e,!0):(ZI(e)||gU(e))&&(t||"temporal"===n)&&(o=function(e){return!!pH[e]}(t)?dH({[t]:e},!0):function(e){return!!gH[e]}(t)?pY(e,{timeUnit:(a=t,a.substr(3))}):`datetime(${JSON.stringify(e)})`),o?r?`time(${o})`:o:i?void 0:JSON.stringify(e)}function mY(e,t){const{timeUnit:n,type:r}=e;return t.map(e=>{const t=pY(e,{timeUnit:n,type:r,undefinedIfExprNotRequired:!0});return void 0!==t?{signal:t}:e})}function gY(e,t){return yY(e.bin)?Fq(t)&&BU(["ordinal","nominal"],e.type):(console.warn("Only use this method with binned field defs"),!1)}function vY(e){return mU(e)&&(e=fY(e,void 0)),"bin"+qU(e).map(t=>wY(e[t])?VU(`_${t}_${Object.entries(e[t])}`):VU(`_${t}_${e[t]}`)).join("")}function yY(e){return!0===e||xY(e)&&!e.binned}function bY(e){return"binned"===e||xY(e)&&!0===e.binned}function xY(e){return QI(e)}function wY(e){var t;return null===(t=e)||void 0===t?void 0:t.selection}function EY(e){switch(e){case k$:case"column":case T$:case S$:case D$:case F$:case P$:case N$:case M$:case B$:case j$:return 6;default:return 10}}function _Y(e,t){const n=e&&e[t];return!!n&&(JI(n)?PU(n,e=>!!e.field):WV(n)||qV(n))}function AY(e){return PU(H$,t=>{if(_Y(e,t)){const n=e[t];if(JI(n))return PU(n,e=>!!e.aggregate);{const e=uY(n);return e&&!!e.aggregate}}return!1})}function kY(e,t){const n=[],r=[],i=[],o=[],a={};return SY(e,(u,s)=>{if(WV(u)){const{field:l,aggregate:c,timeUnit:f,bin:d}=u,h=C(u,["field","aggregate","timeUnit","bin"]);if(c||f||d){const e=iY(u),p=e&&e.title;let m=JV(u,{forAs:!0});const g=Object.assign(Object.assign(Object.assign({},p?[]:{title:rY(u,t,{allowDisabling:!0})}),h),{field:m}),v="x"===s||"y"===s;if(c){let e;if(b$(c)?(e="argmax",m=JV({op:"argmax",field:c.argmax},{forAs:!0}),g.field=`${m}.${l}`):y$(c)?(e="argmin",m=JV({op:"argmin",field:c.argmin},{forAs:!0}),g.field=`${m}.${l}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(e=c),e){const t={op:e,as:m};l&&(t.field=l),o.push(t)}}else if(n.push(m),HV(u)&&yY(d)){if(r.push({bin:d,field:l,as:m}),n.push(JV(u,{binSuffix:"end"})),gY(u,s)&&n.push(JV(u,{binSuffix:"range"})),v){const e={field:m+"_end"};a[s+"2"]=e}g.bin="binned",nq(s)||(g.type="quantitative")}else if(f){i.push({timeUnit:f,field:l,as:m});const e=HV(u)&&"temporal"!==u.type&&"time";e&&("text"===s||"tooltip"===s?g.formatType=e:!function(e){return!!hq[e]}(s)?v&&(g.axis=Object.assign({formatType:e},g.axis)):g.legend=Object.assign({formatType:e},g.legend))}a[s]=g}else n.push(l),a[s]=e[s]}else a[s]=e[s]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function CY(e,t){const n=t.type;return qU(e).reduce((r,i)=>{var o;if(!eq(i))return aH(eH.invalidEncodingChannel(i)),r;if(!function(e,t,n){const r=jq(t,n);if(!r)return!1;if("binned"===r){const n=e["x2"===t?"x":"y"];return!!(WV(n)&&WV(e[t])&&bY(n.bin))}return!0}(e,i,n))return aH(eH.incompatibleChannel(i,n)),r;if("size"===i&&"line"===n){if(null===(o=sY(e[i]))||void 0===o?void 0:o.aggregate)return aH(eH.LINE_WITH_VARYING_SIZE),r}if("color"===i&&(t.filled?"fill"in e:"stroke"in e))return aH(eH.droppingColor("encoding",{fill:"fill"in e,stroke:"stroke"in e})),r;const a=e[i];if("detail"===i||"order"===i&&!JI(a)&&!YV(a)||"tooltip"===i&&JI(a))a&&(r[i]=(JI(a)?a:[a]).reduce((e,t)=>(WV(t)?e.push(cY(t,i)):aH(eH.emptyFieldDef(t,i)),e),[]));else{if("tooltip"===i&&null===a)r[i]=null;else if(!WV(a)&&!YV(a)&&!$V(a))return aH(eH.emptyFieldDef(a,i)),r;r[i]=lY(a,i)}return r},{})}function OY(e){const t=[];for(const n of qU(e))if(_Y(e,n)){const r=e[n],i=JI(r)?r:[r];for(const e of i)WV(e)?t.push(e):qV(e)&&t.push(e.condition)}return t}function SY(e,t,n){if(e)for(const r of qU(e)){const i=e[r];JI(i)?i.forEach(e=>{t.call(n,e,r)}):t.call(n,i,r)}}function DY(e,t,n,r){return e?qU(e).reduce((n,i)=>{const o=e[i];return JI(o)?o.reduce((e,n)=>t.call(r,e,n,i),n):t.call(r,n,o,i)},n):n}function FY(e,t){return qU(t).reduce((n,r)=>{switch(r){case"x":case"y":case"href":case"url":case"x2":case"y2":case"latitude":case"longitude":case"latitude2":case"longitude2":case"text":case"shape":case"tooltip":return n;case"order":if("line"===e||"trail"===e)return n;case"detail":case"key":{const e=t[r];return(JI(e)||WV(e))&&(JI(e)?e:[e]).forEach(e=>{e.aggregate||n.push(JV(e,{}))}),n}case"size":if("trail"===e)return n;case"color":case"fill":case"stroke":case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":{const e=sY(t[r]);return e&&!e.aggregate&&n.push(JV(e,{})),n}}},[])}function jY(e,t,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...e.map(({fieldPrefix:e,titlePrefix:n})=>({field:e+t.field,type:t.type,title:n+(r?" of "+t.field:"")})),...OY(n)]}}function TY(e){const{axis:t,title:n,field:r}=e;return t&&void 0!==t.title?void 0:t$(n,r)}function NY(e,t,n,r,i){const{scale:o,axis:a}=n;return({partName:u,mark:s,positionPrefix:l,endPositionPrefix:c,extraEncoding:f={}})=>{const d=TY(n);return MY(e,u,i,{mark:s,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}:{})},ZI(c)?{[t+"2"]:{field:c+"_"+n.field,type:n.type}}:{}),r),f)})}}function MY(e,t,n,r){const{clip:i,color:o,opacity:a}=e,u=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}:{}),l$(r.mark)?r.mark:{type:r.mark}),{style:`${u}-${t}`}),mU(e[t])?{}:e[t])})]:[]}function BY(e,t,n){const{encoding:r}=e,i="vertical"===t?"y":"x",o=r[i],a=r[i+"2"],u=r[i+"Error"],s=r[i+"Error2"];return{continuousAxisChannelDef:PY(o,n),continuousAxisChannelDef2:PY(a,n),continuousAxisChannelDefError:PY(u,n),continuousAxisChannelDefError2:PY(s,n),continuousAxis:i}}function PY(e,t){if(e&&e.aggregate){const{aggregate:n}=e,r=C(e,["aggregate"]);return n!==t&&aH(eH.errorBarContinuousAxisHasCustomizedAggregate(n,t)),r}return e}function RY(e,t){const{mark:n,encoding:r}=e;if(WV(r.x)&&ZV(r.x)){if(WV(r.y)&&ZV(r.y)){if(void 0===r.x.aggregate&&r.y.aggregate===t)return"vertical";if(void 0===r.y.aggregate&&r.x.aggregate===t)return"horizontal";if(r.x.aggregate===t&&r.y.aggregate===t)throw new Error("Both x and y cannot have aggregate");return l$(n)&&n.orient?n.orient:"vertical"}return"horizontal"}if(WV(r.y)&&ZV(r.y))return"vertical";throw new Error("Need a valid continuous axis for "+t+"s")}const zY=qU({box:1,median:1,outliers:1,rule:1,ticks:1}),LY=new m$("boxplot",UY);function IY(e){return gU(e)?"tukey":e}function UY(e,{config:t}){var n,r;const{mark:i,encoding:o,selection:a,projection:u}=e,s=C(e,["mark","encoding","selection","projection"]),l=l$(i)?i:{type:i};a&&aH(eH.selectionNotSupported("boxplot"));const c=null!=(n=l.extent)?n:t.boxplot.extent,f=t$(l.size,t.boxplot.size),d=IY(c),{transform:h,continuousAxisChannelDef:p,continuousAxis:m,groupby:g,aggregate:v,encodingWithoutContinuousAxis:y,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:w}=function(e,t,n){const r=RY(e,"boxplot"),{continuousAxisChannelDef:i,continuousAxis:o}=BY(e,r,"boxplot"),a=i.field,u=IY(t),s=[...$Y(a),{op:"median",field:a,as:"mid_box_"+a},{op:"min",field:a,as:("min-max"===u?"lower_whisker_":"min_")+a},{op:"max",field:a,as:("min-max"===u?"upper_whisker_":"max_")+a}],l="min-max"===u||"tukey"===u?[]:[{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],C(c,["symbol"==typeof f?f:f+""])),{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=function(e){const{tooltip:t}=e,n=C(e,["tooltip"]);if(!t)return{filteredEncoding:e};let r,i;return JI(t)?(t.forEach(e=>{e.aggregate?(r||(r=[]),r.push(e)):(i||(i=[]),i.push(e))}),r&&(n.tooltip=r)):t.aggregate?n.tooltip=t:i=t,JI(i)&&1===i.length&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}(d),{bins:m,timeUnits:g,aggregate:v,groupby:y,encoding:b}=kY(p,n),x="vertical"===r?"horizontal":"vertical",w=r;return{transform:[...m,...g,{aggregate:[...v,...s],groupby:y},...l],groupby:y,aggregate:v,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:b,ticksOrient:x,boxOrient:w,customTooltipWithoutAggregatedField:h}}(e,c,t),{color:E,size:_}=y,A=C(y,["color","size"]),k=e=>NY(l,m,p,e,t.boxplot),O=k(A),S=k(y),D=k(Object.assign(Object.assign({},A),_?{size:_}:{})),F=jY([{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"}],p,y),j={type:"tick",color:"black",opacity:1,orient:b,invalid:null},T="min-max"===d?F:jY([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],p,y),N=[...O({partName:"rule",mark:{type:"rule",invalid:null},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:T}),...O({partName:"rule",mark:{type:"rule",invalid:null},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:T}),...O({partName:"ticks",mark:j,positionPrefix:"lower_whisker",extraEncoding:T}),...O({partName:"ticks",mark:j,positionPrefix:"upper_whisker",extraEncoding:T})],M=[..."tukey"!==d?N:[],...S({partName:"box",mark:Object.assign(Object.assign({type:"bar"},f?{size:f}:{}),{orient:x,invalid:null}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:F}),...D({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},QI(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),f?{size:f}:{}),{orient:b}),positionPrefix:"mid_box",extraEncoding:F})];let B;if("min-max"!==d){const e=`datum["lower_box_${p.field}"]`,n=`datum["upper_box_${p.field}"]`,r=`(${n} - ${e})`,i=`${e} - ${c} * ${r}`,o=`${n} + ${c} * ${r}`,a=`datum["${p.field}"]`,u={joinaggregate:$Y(p.field),groupby:g};let s=void 0;"tukey"===d&&(s={transform:[{filter:`(${i} <= ${a}) && (${a} <= ${o})`},{aggregate:[{op:"min",field:p.field,as:"lower_whisker_"+p.field},{op:"max",field:p.field,as:"upper_whisker_"+p.field},{op:"min",field:"lower_box_"+p.field,as:"lower_box_"+p.field},{op:"max",field:"upper_box_"+p.field,as:"upper_box_"+p.field},...v],groupby:g}],layer:N});const{tooltip:f}=A,h=C(A,["tooltip"]),{scale:y,axis:b}=p,x=TY(p),E=MY(l,"outliers",t.boxplot,{transform:[{filter:`(${a} < ${i}) || (${a} > ${o})`}],mark:"point",encoding:Object.assign(Object.assign({[m]:Object.assign(Object.assign(Object.assign({field:p.field,type:p.type},void 0!==x?{title:x}:{}),void 0!==y?{scale:y}:{}),void 0!==b?{axis:b}:{})},h),w?{tooltip:w}:{})})[0];E&&s?B={transform:[u],layer:[E,s]}:E?(B=E,B.transform.unshift(u)):s&&(B=s,B.transform.unshift(u))}return B?Object.assign(Object.assign({},s),{layer:[B,{transform:h,layer:M}]}):Object.assign(Object.assign({},s),{transform:(r=s.transform,null!=r?r:[]).concat(h),layer:M})}function $Y(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}const qY=qU({ticks:1,rule:1}),WY=new m$("errorbar",HY);function HY(e,{config:t}){const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:a,markDef:u,outerSpec:s,tooltipEncoding:l}=YY(e,"errorbar",t),c=NY(u,i,r,o,t.errorbar),f={type:"tick",orient:a};return Object.assign(Object.assign({},s),{transform:n,layer:[...c({partName:"ticks",mark:f,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:f,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:"rule",positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})]})}function VY(e,t){const{encoding:n}=e;if(function(e){return(WV(e.x)||WV(e.y))&&!WV(e.x2)&&!WV(e.y2)&&!WV(e.xError)&&!WV(e.xError2)&&!WV(e.yError)&&!WV(e.yError2)}(n))return{orient:RY(e,t),inputType:"raw"};const r=function(e){return WV(e.x2)||WV(e.y2)}(n),i=function(e){return WV(e.xError)||WV(e.xError2)||WV(e.yError)||WV(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(WV(e)&&WV(r))throw new Error(t+" cannot have both x2 and y2");if(WV(e)){if(WV(o)&&ZV(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in "+t)}if(WV(r)){if(WV(a)&&ZV(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,u=n.yError2;if(WV(r)&&!WV(e))throw new Error(t+" cannot have xError2 without xError");if(WV(u)&&!WV(i))throw new Error(t+" cannot have yError2 without yError");if(WV(e)&&WV(i))throw new Error(t+" cannot have both xError and yError with both are quantiative");if(WV(e)){if(WV(o)&&ZV(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(WV(i)){if(WV(a)&&ZV(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 YY(e,t,n){var r;const{mark:i,encoding:o,selection:a,projection:u}=e,s=C(e,["mark","encoding","selection","projection"]),l=l$(i)?i:{type:i};a&&aH(eH.selectionNotSupported(t));const{orient:c,inputType:f}=VY(e,t),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:m,continuousAxis:g}=BY(e,c,t),{errorBarSpecificAggregate:v,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:x}=function(e,t,n,r,i,o,a,u){let s=[],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":u.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&aH(eH.errorBarCenterIsUsedWithWrongExtent(t,n,a)),"stderr"===n||"stdev"===n)s=[{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:XU(t)},{fieldPrefix:"upper_",titlePrefix:GY(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:GY(t,n,"-")}],d=!0;else{let t,r,i;e.center&&e.extent&&aH(eH.errorBarCenterIsNotNeeded(e.extent,a)),"ci"===n?(t="mean",r="ci0",i="ci1"):(t="median",r="q1",i="q3"),s=[{op:r,field:c,as:"lower_"+c},{op:i,field:c,as:"upper_"+c},{op:t,field:c,as:"center_"+c}],f=[{fieldPrefix:"upper_",titlePrefix:rY({field:c,aggregate:i,type:"quantitative"},u,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:rY({field:c,aggregate:r,type:"quantitative"},u,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:rY({field:c,aggregate:t,type:"quantitative"},u,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&aH(eH.errorBarCenterAndExtentAreNotNeeded(e.center,e.extent)),"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:QU(QU(e.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:s,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,d,h,p,m,f,t,n),w=g,E=(o[w],"x"===g?"x2":"y2"),_=(o[E],"x"===g?"xError":"yError"),A=(o[_],"x"===g?"xError2":"yError2"),k=(o[A],C(o,["symbol"==typeof w?w:w+"","symbol"==typeof E?E:E+"","symbol"==typeof _?_:_+"","symbol"==typeof A?A:A+""])),{bins:O,timeUnits:S,aggregate:D,groupby:F,encoding:j}=kY(k,n),T=[...D,...v],N="raw"!==f?[]:F,M=jY(b,d,j,x);return{transform:[...(r=s.transform,null!=r?r:[]),...O,...S,...0===T.length?[]:[{aggregate:T,groupby:N}],...y],groupby:N,continuousAxisChannelDef:d,continuousAxis:g,encodingWithoutContinuousAxis:j,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:l,outerSpec:s,tooltipEncoding:M}}function GY(e,t,n){return XU(e)+" "+n+" "+t}const XY=qU({band:1,borders:1}),KY=new m$("errorband",JY);function JY(e,{config:t}){const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:u,tooltipEncoding:s}=YY(e,"errorband",t),l=a,c=NY(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?{interpolate:l.tension}:{});return f?(d=Object.assign(Object.assign({},d),p),h=Object.assign(Object.assign({},h),p)):l.interpolate?aH(eH.errorBand1DNotSupport("interpolate")):l.tension&&aH(eH.errorBand1DNotSupport("tension")),Object.assign(Object.assign({},u),{transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:s}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:s}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:s})]})}const QY={};function ZY(e,t,n){const r=new m$(e,t);QY[e]={normalizer:r,parts:n}}ZY("boxplot",UY,zY),ZY("errorbar",HY,qY),ZY("errorband",JY,XY);const eG=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],tG={clipHeight:1,columnPadding:1,columns:1,cornerRadius: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},nG=(qU(tG),{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 rG(e){return!(!e||"legend"!==e&&!e.legend)}function iG(e){return rG(e)&&QI(e)}function oG(e){return void 0!==e.concat}function aG(e){return void 0!==e.vconcat}function uG(e){return void 0!==e.hconcat}function sG(e){return void 0!==e.repeat}function lG(e){return QI(e)&&void 0!==e.step}const cG=qU({align:1,bounds:1,center:1,columns:1,spacing:1});function fG(e,t){var n;return null!=(n=e[t])?n:e["width"===t?"continuousWidth":"continuousHeight"]}function dG(e,t){const n=hG(e,t);return lG(n)?n.step:pG}function hG(e,t){var n;return t$(null!=(n=e[t])?n:e["width"===t?"discreteWidth":"discreteHeight"],{step:e.step})}const pG=20;const mG={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:pG},mark:{color:"#4c78a8",invalid:"filter",timeUnitBand:1},area:{},bar:d$,circle:{},geoshape:{},image:{},line:{},point:{},rect:h$,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:{},axis:{},axisX:{},axisY:{},axisLeft:{},axisRight:{},axisTop:{},axisBottom:{},axisBand:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:nG,style:{},title:{},facet:{spacing:20},repeat:{spacing:20},concat:{spacing:20}};function gG(e){return sU({},mG,e)}const vG=["view",...s$],yG=["background","padding","facet","concat","repeat","numberFormat","timeFormat","countTitle","header","scale","selection","overlay"],bG=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 xG(e){e=DU(e);for(const t of yG)delete e[t];if(e.legend)for(const t of eG)delete e.legend[t];if(e.mark)for(const t of f$)delete e.mark[t];for(const t of vG){for(const n of f$)delete e[t][n];const n=bG[t];if(n)for(const r of n)delete e[t][r];wG(e,t)}for(const t of qU(QY))delete e[t];wG(e,"title","group-title");for(const t in e)QI(e[t])&&0===qU(e[t]).length&&delete e[t];return qU(e).length>0?e:void 0}function wG(e,t,n,r){const i="title"===t?pV(e.title).mark:r?e[t][r]:e[t];"view"===t&&(n="cell");const o=Object.assign(Object.assign({},i),e.style[t]);qU(o).length>0&&(e.style[null!=n?n:t]=o),r||delete e[t]}function EG(e){return void 0!==e.layer}class _G{map(e,t){return RV(e)?this.mapFacet(e,t):sG(e)?this.mapRepeat(e,t):uG(e)?this.mapHConcat(e,t):aG(e)?this.mapVConcat(e,t):oG(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(EG(e))return this.mapLayer(e,t);if(p$(e))return this.mapUnit(e,t);throw new Error(eH.invalidSpec(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=C(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)})}}const AG={zero:1,center:1,normalize:1};const kG=["bar","area","rule","point","circle","square","line","text","tick"],CG=["bar","area"];function OG(e,t,n={}){const r=l$(e)?e.type:e;if(!BU(kG,r))return null;const i=function(e){const t=e.x,n=e.y;if(WV(t)&&WV(n))if("quantitative"===t.type&&"quantitative"===n.type){if(t.stack)return"x";if(n.stack)return"y";if(!!t.aggregate!=!!n.aggregate)return t.aggregate?"x":"y"}else{if("quantitative"===t.type)return"x";if("quantitative"===n.type)return"y"}else{if(WV(t)&&"quantitative"===t.type)return"x";if(WV(n)&&"quantitative"===n.type)return"y"}}(t);if(!i)return null;const o=t[i],a=VV(o)?JV(o,{}):void 0,u="x"===i?"y":"x",s=t[u],l=VV(s)?JV(s,{}):void 0,c=pq.reduce((e,n)=>{if("tooltip"!==n&&_Y(t,n)){const r=t[n];(JI(r)?r:[r]).forEach(t=>{const r=sY(t);if(r.aggregate)return;const i=VV(r)?JV(r,{}):void 0;(!i||i!==l&&i!==a)&&e.push({channel:n,fieldDef:r})})}return e},[]);let f;if(void 0!==o.stack?f=mU(o.stack)?o.stack?"zero":null:o.stack:c.length>0&&BU(CG,r)&&(f="zero"),!f||!AG[f])return null;if(AY(t)&&0===c.length)return null;if(o.scale&&o.scale.type&&o.scale.type!==LH.LINEAR){if(n.disallowNonLinearStack)return null;aH(eH.cannotStackNonLinearScale(o.scale.type))}return _Y(t,i===C$?"x2":"y2")?(void 0!==o.stack&&aH(eH.cannotStackRangedMark(i)),null):(o.aggregate&&!BU(_$,o.aggregate)&&aH(eH.stackNonSummativeAggregate(o.aggregate)),{groupbyChannel:s?u:void 0,fieldChannel:i,impute:null!==o.impute&&a$(r),stackBy:c,offset:f})}function SG(e){const{point:t,line:n}=e,r=C(e,["point","line"]);return qU(r).length>1?r:r.type}function DG(e){for(const t of["line","area","rule","trail"])e[t]&&(e=Object.assign(Object.assign({},e),{[t]:jU(e[t],["point","line"])}));return e}function FG(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?QI(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?QI(t.point)?t.point:{}:void 0}function jG(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 TG{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(p$(e)){const{mark:n,encoding:r}=e,i=l$(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!FG(i,t[i.type],r);case"area":return!!FG(i,t[i.type],r)||!!jG(i,t[i.type])}}return!1}run(e,t,n){const{config:r}=t,{selection:i,projection:o,encoding:a,mark:u}=e,s=C(e,["selection","projection","encoding","mark"]),l=l$(u)?u:{type:u},c=FG(l,r[l.type],a),f="area"===l.type&&jG(l,r[l.type]),d=[Object.assign(Object.assign({},i?{selection:i}:{}),{mark:SG(Object.assign(Object.assign({},l),"area"===l.type?{opacity:.7}:{})),encoding:jU(a,["shape"])})],h=OG(l,a);let p=a;if(h){const{fieldChannel:e,offset:t}=h;p=Object.assign(Object.assign({},a),{[e]:Object.assign(Object.assign({},a[e]),t?{stack:t}:{})})}return f&&d.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"line"},FU(l,["clip","interpolate","tension","tooltip"])),f),encoding:p})),c&&d.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},FU(l,["clip","tooltip"])),c),encoding:p})),n(Object.assign(Object.assign({},s),{layer:d}),Object.assign(Object.assign({},t),{config:DG(r)}))}}class NG{constructor(){this.name="RangeStep"}hasMatchingType(e){var t,n;if(p$(e)&&e.encoding)for(const r of gq){const i=e.encoding[r];if(i&&WV(i)&&(null===(n=null===(t=i)||void 0===t?void 0:t.scale)||void 0===n?void 0:n.rangeStep))return!0}return!1}run(e){var t,n;const r={};let i=Object.assign({},e.encoding);for(const e of gq){const o=vq(e),a=i[e];if(a&&WV(a)&&(null===(n=null===(t=a)||void 0===t?void 0:t.scale)||void 0===n?void 0:n.rangeStep)){const{scale:t}=a,n=C(a,["scale"]),u=t,{rangeStep:s}=u,l=C(u,["rangeStep"]);r[o]={step:t.rangeStep},aH(eH.RANGE_STEP_DEPRECATED),i=Object.assign(Object.assign({},i),{[e]:Object.assign(Object.assign({},n),qU(l).length>0?{scale:l}:{})})}}return Object.assign(Object.assign(Object.assign({},r),e),{encoding:i})}}class MG{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(p$(e)){const{encoding:t,mark:n}=e;if("line"===n)for(const e of tq){const n=t[rq(e)];if(t[e]&&WV(n)&&!bY(n.bin))return!0}}return!1}run(e,t,n){const{encoding:r}=e;return aH(eH.lineWithRange(!!r.x2,!!r.y2)),n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}function BG(e){const{parentEncoding:t,encoding:n}=e;if(t&&n){const e=qU(t).reduce((e,t)=>(n[t]&&e.push(t),e),[]);e.length>0&&aH(eH.encodingOverridden(e))}const r=Object.assign(Object.assign({},null!=t?t:{}),null!=n?n:{});return qU(r).length>0?r:void 0}function PG(e){const{parentProjection:t,projection:n}=e;return t&&n&&aH(eH.projectionOverridden({parentProjection:t,projection:n})),null!=n?n:t}function RG(e,t){void 0===t&&(t=gG(e.config));const n=function(e,t={}){return zG.map(e,{config:t})}(e,t),{width:r,height:i}=e,o=function(e,t,n){let{width:r,height:i}=t;const o=p$(e)||EG(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&&(aH(eH.containerSizeNonSingle("width")),r=void 0),"container"==i&&(aH(eH.containerSizeNonSingle("height")),i=void 0));const u=Object.assign(Object.assign(Object.assign({type:"pad"},a),n?LG(n.autosize):{}),LG(e.autosize));"fit"!==u.type||o||(aH(eH.FIT_NON_SINGLE),u.type="pad");"container"==r&&"fit"!=u.type&&"fit-x"!=u.type&&aH(eH.containerSizeNotCompatibleWithAutosize("width"));"container"==i&&"fit"!=u.type&&"fit-y"!=u.type&&aH(eH.containerSizeNotCompatibleWithAutosize("height"));if(SU(u,{type:"pad"}))return;return u}(n,{width:r,height:i,autosize:e.autosize},t);return Object.assign(Object.assign({},n),o?{autosize:o}:{})}const zG=new class extends _G{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[LY,WY,KY,new TG,new MG,new NG]}map(e,t){if(p$(e)){const n=_Y(e.encoding,k$),r=_Y(e.encoding,"column"),i=_Y(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;if(n||r)return this.mapUnitWithParentEncodingOrProjection(e,t);const i=this.mapLayerOrUnit.bind(this);for(const n of this.nonFacetUnitNormalizers)if(n.hasMatchingType(e,t.config))return n.run(e,t,i);return e}mapRepeat(e,t){const{repeat:n}=e;return!JI(n)&&e.columns&&(e=jU(e,["columns"]),aH(eH.columnsNotSupportByRowCol("repeat"))),Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapFacet(e,t){const{facet:n}=e;return PV(n)&&e.columns&&(e=jU(e,["columns"]),aH(eH.columnsNotSupportByRowCol("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:o,config:a}=t,u=PG({parentProjection:o,projection:r}),s=BG({parentEncoding:i,encoding:n});return this.mapUnit(Object.assign(Object.assign(Object.assign({},e),u?{projection:u}:{}),s?{encoding:s}:{}),{config:a})}mapFacetedUnit(e,t){const n=e.encoding,{row:r,column:i,facet:o}=n,a=C(n,["row","column","facet"]),{mark:u,width:s,projection:l,height:c,selection:f,encoding:d}=e,h=C(e,["mark","width","projection","height","selection","encoding"]),{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o});return this.mapFacet(Object.assign(Object.assign(Object.assign({},h),m),{facet:p,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},l?{projection:l}:{}),{mark:u}),s?{width:s}:{}),c?{height:c}:{}),{encoding:a}),f?{selection:f}:{})}),t)}getFacetMappingAndLayout(e){var t;const{row:n,column:r,facet:i}=e;if(n||r){i&&aH(eH.facetChannelDropped([...n?[k$]:[],...r?["column"]:[]]));const o={},a={};for(const n of[k$,"column"]){const r=e[n];if(r){const{align:e,center:i,spacing:u,columns:s}=r,l=C(r,["align","center","spacing","columns"]);o[n]=l;for(const e of["align","center","spacing"])void 0!==r[e]&&(a[e]=null!=(t=a[e])?t:{},a[e][n]=r[e])}}return{facetMapping:o,layout:a}}{const{align:e,center:t,spacing:n,columns:r}=i;return{facetMapping:C(i,["align","center","spacing","columns"]),layout:Object.assign(Object.assign(Object.assign(Object.assign({},e?{align:e}:{}),t?{center:t}:{}),n?{spacing:n}:{}),r?{columns:r}:{})}}}mapLayer(e,t){var{parentEncoding:n,parentProjection:r}=t,i=C(t,["parentEncoding","parentProjection"]);const{encoding:o,projection:a}=e,u=C(e,["encoding","projection"]),s=Object.assign(Object.assign({},i),{parentEncoding:BG({parentEncoding:n,encoding:o}),parentProjection:PG({parentProjection:r,projection:a})});return super.mapLayer(u,s)}};function LG(e){return ZI(e)?{type:e}:null!=e?e:{}}const IG=["background","padding"];function UG(e){return IG.reduce((t,n)=>(e&&void 0!==e[n]&&(t[n]=e[n]),t),{})}function $G(e){return!!e.url}function qG(e){return!!e.values}function WG(e){return!(!e.name||$G(e)||qG(e)||HG(e))}function HG(e){return e&&(VG(e)||YG(e)||GG(e))}function VG(e){return!!e.sequence}function YG(e){return!!e.sphere}function GG(e){return!!e.graticule}const XG="main";function KG(e){return void 0!==e.filter}function JG(e){return void 0!==e.lookup}function QG(e){return void 0!==e.pivot}function ZG(e){return void 0!==e.density}function eX(e){return void 0!==e.quantile}function tX(e){return void 0!==e.regression}function nX(e){return void 0!==e.loess}function rX(e){return void 0!==e.sample}function iX(e){return void 0!==e.window}function oX(e){return void 0!==e.joinaggregate}function aX(e){return void 0!==e.flatten}function uX(e){return void 0!==e.calculate}function sX(e){return!!e.bin}function lX(e){return void 0!==e.impute}function cX(e){return void 0!==e.timeUnit}function fX(e){return void 0!==e.aggregate}function dX(e){return void 0!==e.stack}function hX(e){return void 0!==e.fold}function pX(e){return!!e.signal}function mX(e){return!!e.step}function gX(e){return!JI(e)&&("field"in e&&"data"in e)}const vX=qU({opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeMiterLimit: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,x:1,y:1,x2:1,y2:1,width:1,height:1,aspect:1}),yX=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"],bX={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"},gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDash"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDash"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickWidth:{part:"ticks",vgProp:"strokeWidth"}};const xX=["domain","grid","labels","ticks","title"],wX={grid:"grid",gridColor:"grid",gridDash:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",domain:"main",domainColor:"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",labelFontWeight:"main",labelLimit:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",maxExtent:"main",minExtent:"main",offset:"main",position:"main",tickColor:"main",tickExtra:"main",tickOffset:"both",tickOpacity:"main",tickRound:"main",ticks:"main",tickSize:"main",title:"main",titleAlign:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",tickWidth:"both",tickCount:"both",values:"both",scale:"both",zindex:"both"},EX={orient:1,bandPosition:1,domain:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid: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,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand: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,values:1,translate:1,zindex:1},_X=Object.assign(Object.assign({},EX),{labelExpr:1,encoding:1});qU(_X);var AX,kX,CX=function(e,t,n){return AX=t||OX,kX=n||DX,jX(e.trim()).map(TX)},OX="view",SX=/[[\]{}]/,DX={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};function FX(e,t,n,r,i){for(var o,a=0,u=e.length;t=0?--a:r&&r.indexOf(o)>=0&&++a}return t}function jX(e){for(var t=[],n=0,r=e.length,i=0;i"!==(e=e.slice(i+1).trim())[0])throw"Expected '>' after between selector: "+e;if(t=t.map(TX),(n=TX(e.slice(1).trim())).between)return{between:t,stream:n};n.between=t;return n}(e):function(e){var t,n,r={source:AX},i=[],o=[0,0],a=0,u=0,s=e.length,l=0;if("}"===e[s-1]){if(!((l=e.lastIndexOf("{"))>=0))throw"Unmatched right brace: "+e;try{o=function(e){var t=e.split(",");if(!e.length||t.length>2)throw e;return t.map((function(t){var n=+t;if(n!=n)throw e;return n}))}(e.substring(l+1,s-1))}catch(t){throw"Invalid throttle specification: "+e}e=e.slice(0,l).trim(),s=e.length,l=0}if(!s)throw e;"@"===e[0]&&(a=++l);(t=FX(e,l,":"))1?(r.type=i[1],a?r.markname=i[0].slice(1):(c=i[0],kX[c]?r.marktype=i[0]:r.source=i[0])):r.type=i[0];var c;"!"===r.type.slice(-1)&&(r.consume=!0,r.type=r.type.slice(0,-1));null!=n&&(r.filter=n);o[0]&&(r.throttle=o[0]);o[1]&&(r.debounce=o[1]);return r}(e)}function NX(e,t,n,r){const i=t&&t.condition,o=r(t);if(i){return{[n]:[...fU(i).map(t=>{const n=r(t),i=function(e){return e.selection}(t)?GJ(e,t.selection):KJ(e,t.test);return Object.assign({test:i},n)}),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function MX(e){const{channel:t,channelDef:n,markDef:r,scale:i}=e,o=IX(e);return WV(n)&&!E$(n.aggregate)&&i&&ZH(i.get("type"))&&!1===i.get("zero")?BX({fieldDef:n,channel:t,markDef:r,ref:o}):o}function BX({fieldDef:e,channel:t,markDef:n,ref:r}){return a$(n.type)?r:[PX(e,t),r]}function PX(e,t){const n=RX(e,!0),r="x"===rq(t)?{value:0}:{field:{group:"height"}};return Object.assign({test:n},r)}function RX(e,t=!0){return PH(ZI(e)?e:JV(e,{expr:"datum"}),!t)}function zX(e,t,n,r){const i=Object.assign(Object.assign({},t?{scale:t}:{}),{field:JV(e,n)});if(r){const{offset:e,band:t}=r;return Object.assign(Object.assign(Object.assign({},i),e?{offset:e}:{}),t?{band:t}:{})}return i}function LX({scaleName:e,fieldDef:t,fieldDef2:n,offset:r,startSuffix:i,band:o=.5}){const a=0IX({channel:e,channelDef:n,markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:u}))}function qX(e){const{markDef:t,encoding:n,config:r}=e,{filled:i,type:o}=t,a={fill:yV("fill",t,r),stroke:yV("stroke",t,r),color:yV("color",t,r)},u=BU(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,s=t$(t.fill,!0===i?t.color:void 0,a.fill,!0===i?a.color:void 0,u),l=t$(t.stroke,!1===i?t.color:void 0,a.stroke,!1===i?a.color:void 0),c=i?"fill":"stroke",f=Object.assign(Object.assign({},s?{fill:{value:s}}:{}),l?{stroke:{value:l}}:{});return t.color&&(i?t.fill:t.stroke)&&aH(eH.droppingColor("property",{fill:"fill"in t,stroke:"stroke"in t})),Object.assign(Object.assign(Object.assign(Object.assign({},f),$X("color",e,{vgChannel:c,defaultValue:i?s:l})),$X("fill",e,{defaultValue:n.fill?s:void 0})),$X("stroke",e,{defaultValue:n.stroke?l:void 0}))}function WX(e,t="text"){const n=e.encoding[t];return NX(e,n,t,t=>HX(t,e.config))}function HX(e,t,n="datum"){if(e){if(YV(e))return{value:e.value};if(HV(e))return xV(e,aY(e),n,t)}}function VX(e,t={}){const{encoding:n,markDef:r,config:i}=e,o=n.tooltip;return JI(o)?{tooltip:YX({tooltip:o},i,t)}:NX(e,o,"tooltip",o=>{const a=HX(o,e.config,t.reactiveGeom?"datum.datum":"datum");if(a)return a;if(null===o)return;let u=t$(r.tooltip,yV("tooltip",r,i));return!0===u&&(u={content:"encoding"}),ZI(u)?{value:u}:QI(u)?"encoding"===u.content?YX(n,i,t):{signal:"datum"}:void 0})}function YX(e,t,{reactiveGeom:n}={}){const r=[],i={},o={},a=n?"datum.datum":"datum",u=[];function s(n,r){const i=rq(r),s=HV(n)?n:Object.assign(Object.assign({},n),{type:e[i].type}),l=fU(rY(s,t,{allowDisabling:!1})).join(", ");let c=HX(s,t,a).signal;if("x"===r||"y"===r){const n="x"===r?"x2":"y2",i=uY(e[n]);if(bY(s.bin)&&i){c=AV(JV(s,{expr:a}),JV(i,{expr:a}),aY(s),t),o[n]=!0}}u.push({channel:r,key:l,value:c})}SY(e,(e,t)=>{WV(e)?s(e,t):qV(e)&&s(e.condition,t)});for(const{channel:e,key:t,value:n}of u)o[e]||i[t]||(r.push(`${eU(t)}: ${n}`),i[t]=!0);return r.length>0?{signal:`{${r.join(", ")}}`}:void 0}function GX(e,t){const n=t[e+"Offset"];if(n)return n}function XX(e,t,{defaultPos:n,vgChannel:r}){const{encoding:i,mark:o,markDef:a,config:u,stack:s}=t,l=i[e],c=i[e===C$?"x2":"y2"],f=t.scaleName(e),d=t.getScaleComponent(e),h=GX(e,t.markDef),p=KX({model:t,markDef:a,config:u,defaultPos:n,channel:e,scaleName:f,scale:d,mark:o,checkBarAreaWithoutZero:!c});return{[null!=r?r:e]:l||!i.latitude&&!i.longitude?function(e){const{channel:t,channelDef:n,scaleName:r,stack:i,offset:o}=e;if(WV(n)&&i&&t===i.fieldChannel)return XV(n)&&void 0!==n.band?LX({scaleName:r,fieldDef:n,startSuffix:"start",band:n.band,offset:0}):zX(n,r,{suffix:"end"},{offset:o});return MX(e)}({channel:e,channelDef:l,channel2Def:c,markDef:a,config:u,scaleName:f,scale:d,stack:s,offset:h,defaultRef:p}):{field:t.getName(e)}}}function KX({model:e,markDef:t,config:n,defaultPos:r,channel:i,scaleName:o,scale:a,mark:u,checkBarAreaWithoutZero:s}){return()=>{const l=rq(i),c=t$(t[i],yV(i,t,n));if(void 0!==c)return UX(i,c);if("zeroOrMin"===r||"zeroOrMax"===r){if(o){const e=a.get("type");if(BU([LH.LOG,LH.TIME,LH.UTC],e))!s||"bar"!==u&&"area"!==u||aH(eH.nonZeroScaleUsedWithLengthMark(u,l,{scaleType:e}));else{if(a.domainDefinitelyIncludesZero())return{scale:o,value:0};!s||"bar"!==u&&"area"!==u||aH(eH.nonZeroScaleUsedWithLengthMark(u,l,{zeroFalse:!1===a.explicit.zero}))}}return"zeroOrMin"===r?"x"===l?{value:0}:{field:{group:"height"}}:"x"===l?{field:{group:"width"}}:{value:0}}{const t=e["x"===l?"width":"height"];return Object.assign(Object.assign({},t),{mult:.5})}}}const JX={left:"x",center:"xc",right:"x2"},QX={top:"y",middle:"yc",bottom:"y2"};function ZX(e,t,n){const r="x"===e?"align":"baseline",i=t$(t[r],yV(r,t,n));return"x"===e?JX[null!=i?i:"center"]:QX[null!=i?i:"middle"]}function eK(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?tK(e,t,{defaultPos:n,defaultPos2:r}):XX(e,t,{defaultPos:n})}function tK(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,a="x"===e?"width":"height",u=function(e,t,n){const{encoding:r,mark:i,markDef:o,stack:a,config:u}=e,s="x2"===n?"x":"y",l="x2"===n?"width":"height",c=r[s],f=e.scaleName(s),d=e.getScaleComponent(s),h=GX(n,e.markDef);if(!c&&(r.latitude||r.longitude))return{[n]:{field:e.getName(n)}};const p=function({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:u,offset:s,defaultRef:l}){if(WV(t)&&u&&e.charAt(0)===u.fieldChannel.charAt(0))return zX(t,o,{suffix:"start"},{offset:s});return MX({channel:e,channelDef:n,scaleName:o,scale:a,stack:u,markDef:r,config:i,offset:s,defaultRef:l})}({channel:n,channelDef:c,channel2Def:r[n],markDef:o,config:u,scaleName:f,scale:d,stack:a,offset:h,defaultRef:void 0});if(void 0!==p)return{[n]:p};const m=KX({model:e,markDef:o,config:u,defaultPos:t,channel:n,scaleName:f,scale:d,mark:i,checkBarAreaWithoutZero:!r[n]})();return t$(nK(n,o),nK(n,{[n]:bV(n,o,u.style),[l]:bV(l,o,u.style)}),nK(n,u[i]),nK(n,u.mark),{[n]:m})}(t,r,"x"===e?"x2":"y2"),s=u[a]?ZX(e,i,o):e;return Object.assign(Object.assign({},XX(e,t,{defaultPos:n,vgChannel:s})),u)}function nK(e,t){const n="x2"===e?"width":"height";return t[e]?{[e]:UX(e,t[e])}:t[n]?{[n]:{value:t[n]}}:void 0}function rK(e,t,n){var r,i,o,a;const{config:u,encoding:s,markDef:l}=e,c="x"===t?"x2":"y2",f="x"===t?"width":"height",d=s[t],h=s[c],p=e.getScaleComponent(t),m=p?p.get("type"):void 0,g=e.scaleName(t),v=l.orient,y=null!=(a=null!=(o=null!=(i=null!=(r=s[f])?r:s.size)?i:l[f])?o:l.size)?a:yV("size",l,u,{vgChannel:f}),b="x"===t?"vertical"===v:"horizontal"===v;if(WV(d)&&(yY(d.bin)||bY(d.bin)||d.timeUnit&&!h)&&!y&&!JH(m)){return function({fieldDef:e,fieldDef2:t,channel:n,band:r,scaleName:i,markDef:o,spacing:a=0,reverse:u}){const s={x:u?a:0,x2:u?0:a,y:u?0:a,y2:u?a:0},l=n===C$?"x2":"y2";return yY(e.bin)||e.timeUnit?{[l]:aK({channel:n,fieldDef:e,scaleName:i,markDef:o,band:(1-r)/2,offset:s[n+"2"]}),[n]:aK({channel:n,fieldDef:e,scaleName:i,markDef:o,band:1-(1-r)/2,offset:s[n]})}:bY(e.bin)&&WV(t)?{[l]:zX(e,i,{},{offset:s[n+"2"]}),[n]:zX(t,i,{},{offset:s[n]})}:void aH(eH.channelRequiredForBinned(l))}({fieldDef:d,fieldDef2:h,channel:t,markDef:l,scaleName:g,band:IV(t,d,void 0,l,u),spacing:t$(l.binSpacing,u[n].binSpacing),reverse:p.get("reverse")})}if((WV(d)&&JH(m)||b)&&!h){if(WV(d)&&m===LH.BAND){return function(e,t,n,r){var i;const o=n.scaleName(t),a="x"===t?"width":"height",{markDef:u,encoding:s,config:l}=n,c={[ZX(t,u,l)]:zX(e,o,{},{band:.5})};if(s.size||null!==u.size&&void 0!==u.size){if(u.orient){if(sY(s.size)||YV(s.size))return Object.assign(Object.assign({},c),$X("size",n,{vgChannel:a}));if(void 0!==u.size)return Object.assign(Object.assign({},c),{[a]:{value:u.size}})}else aH(eH.cannotApplySizeToNonOrientedMark(u.type))}if(void 0!==(null===(i=r)||void 0===i?void 0:i.value))return Object.assign(Object.assign({},c),{[a]:r});const{band:f=1}=e;return{[t]:zX(e,o,{binSuffix:"range"},{band:(1-f)/2}),[a]:null!=r?r:oK(o,f)}}(d,t,e,iK(n,l,f,g,p,u,XV(d)?d.band:void 0))}return function(e,t,n){const r="x"===e?"xc":"yc",i="x"===e?"width":"height";return Object.assign(Object.assign({},XX(e,t,{defaultPos:"mid",vgChannel:r})),$X("size",t,{defaultRef:n,vgChannel:i}))}(t,e,iK(n,l,f,g,p,u))}return tK(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function iK(e,t,n,r,i,o,a){const u=t$(t[n],t.size,yV("size",t,o,{vgChannel:n}));if(void 0!==u)return{value:u};if(i){const t=i.get("type");if("point"===t||"band"===t){if(void 0!==o[e].discreteBandSize)return{value:o[e].discreteBandSize};if(t===LH.POINT){const e=i.get("range");return mX(e)&&gU(e.step)?{value:e.step-2}:{value:pG-2}}return oK(r,a)}return{value:o[e].continuousBandSize}}const s=dG(o.view,n);return{value:t$(o[e].discreteBandSize,s-2)}}function oK(e,t=!0){return{scale:e,band:t}}function aK({channel:e,fieldDef:t,scaleName:n,markDef:r,band:i,offset:o}){return BX({fieldDef:t,channel:e,markDef:r,ref:LX({scaleName:n,fieldDef:t,band:i,offset:o})})}function uK(e,t){const{fill:n,stroke:r}="include"===t.color?qX(e):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function(e,t){return vX.reduce((n,r)=>(void 0!==e[r]&&"ignore"!==t[r]&&(n[r]={value:e[r]}),n),{})}(e.markDef,t)),sK(e,"fill",n)),sK(e,"stroke",r)),$X("opacity",e)),$X("fillOpacity",e)),$X("strokeOpacity",e)),$X("strokeWidth",e)),VX(e)),WX(e,"href"))}function sK(e,t,n){const{config:r,mark:i,markDef:o}=e;if("hide"===vV("invalid",o,r)&&n&&!a$(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&&QH(i)&&(t[o]=!0)}return t},{}),i=qU(r);if(i.length>0){const e=t?"||":"&&";return i.map(e=>RX(e,t)).join(` ${e} `)}return}(e,{invalid:!0,channels:Dq});if(r)return{[t]:[{test:r,value:null},...fU(n)]}}return n?{[t]:n}:{}}function lK(e){const{config:t,markDef:n}=e;if(vV("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&&QH(i)&&(t[o]=!0)}return t},{}),i=qU(r);if(i.length>0){const e=t?"||":"&&";return i.map(e=>RX(e,t)).join(` ${e} `)}return}(e,{channels:["x","y"]});if(t)return{defined:{signal:t}}}return{}}function cK(e,t){if(void 0!==t)return{[e]:{value:t}}}var fK={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(a$(o))return aH(eH.nearestNotSupportForContinuous(o)),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}},VX(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 u=0,s=!1;return n.forEach((t,n)=>{var r;const i=null!=(r=t.name)?r:"";i===e.component.mark[0].name?u=n:i.indexOf("voronoi")>=0&&(s=!0)}),s||n.splice(u+1,0,a),n}};class dK{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?console.warn("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 hK extends dK{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 "+r$()),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}class pK extends dK{constructor(e,t){super(e),this.formula=t}clone(){return new pK(null,DU(this.formula))}static makeFromEncoding(e,t){const n=t.reduceFieldDef((e,n,r)=>{const{timeUnit:i,field:o}=n,a=x0(t)?t.encoding[iq(r)]:void 0,u=x0(t)&&UV(r,n,a,t.markDef,t.config);if(i){const t=JV(n,{forAs:!0});e[NU({as:t,timeUnit:i,field:o})]=Object.assign({as:t,timeUnit:i,field:o},u?{band:!0}:{})}return e},{});return 0===qU(n).length?null:new pK(e,n)}static makeFromTransform(e,t){const n=Object.assign({},t);return new pK(e,{[NU(n)]:n})}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()}producedFields(){return new Set(WU(this.formula).map(e=>e.as))}dependentFields(){return new Set(WU(this.formula).map(e=>e.field))}hash(){return"TimeUnit "+NU(this.formula)}assemble(){const e=[];for(const t of WU(this.formula)){const{timeUnit:n,field:r,as:i}=t;e.push({field:r,type:"timeunit",units:wH(n),as:[i,i+"_end"]})}return e}}class mK{constructor(...e){this.items=e,this.hasChannel={},this.hasField={}}}var gK={has:e=>"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!rG(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],u=fK.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((e,i)=>{var s,l;const c=VU(`${r}_${e.field}`);n.filter(e=>e.name===c).length||n.unshift(Object.assign(Object.assign({name:c},a?{init:FK(a[i])}:{value:null}),{on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${u}[${eU(e.field)}] : null`}]:[],bind:(s=o[e.field],l=null!=s?s:o[e.channel],null!=l?l:o)}))}),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter(e=>e.name===r+IK)[0],a=r+"_tuple_fields",u=i.items.map(e=>VU(`${r}_${e.field}`)),s=u.map(e=>e+" !== null").join(" && ");return u.length&&(o.update=`${s} ? {fields: ${a}, values: [${u.join(", ")}]} : null`),delete o.value,delete o.on,n}};var vK={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+IK,r=t.name+"_toggle";return`${r} ? null : ${n}, `+("global"===t.resolve?r+" ? null : true, ":`${r} ? null : {unit: ${HK(e)}}, `)+`${r} ? ${n} : null`}};const yK={has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=ZI(n.clear)?CX(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>(gK.has(t)&&t.project.items.forEach(e=>{const r=n.findIndex(n=>n.name===VU(`${t.name}_${e.field}`));-1!==r&&n[r].on.push({events:t.clear,update:"null"})}),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)t.project.items.forEach(e=>{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+IK);r(e,"null"),vK.has(t)&&(e=n.findIndex(e=>e.name===t.name+"_toggle"),r(e,"false"))}return n}};var bK={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(!Fq(i))continue;const o=e.getScaleComponent(i),a=o?o.get("type"):void 0;if(!o||!QH(a)){aH(eH.SCALE_BINDINGS_CONTINUOUS);continue}const u={selection:t.name,field:r.field};if(o.set("selectionExtent",u,!0),n.push(r),e.repeater&&e.repeater.row===e.repeater.column){e.getScaleComponent(i===C$?O$:C$).set("selectionExtent",u,!0)}}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter(e=>0===n.filter(t=>t.name===e.signals.data).length);if(!e.parent||wK(e)||0===r.length)return n;const i=n.filter(e=>e.name===t.name)[0];let o=i.update;if(o.indexOf($K)>=0)i.update=`{${r.map(e=>`${eU(e.field)}: ${e.signals.data}`).join(", ")}}`;else{for(const e of r){const t=`${eU(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&&!wK(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 xK(e,t){return`domain(${eU(e.scaleName(t))})`}function wK(e){var t;return e.parent&&A0(e.parent)&&(null!=(t=!e.parent.parent)?t:wK(e.parent.parent))}const EK={has:e=>{const t="global"===e.resolve&&e.bind&&rG(e.bind),n=1===e.project.items.length&&"_vgsid_"!==e.project.items[0].field;return t&&!n&&aH(eH.LEGEND_BINDINGS_PROJECT_LENGTH),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=fU(null!=(i=n.filter)?i:[]),n.filter.indexOf(e)<0&&n.filter.push(e)}const o=iG(t.bind)?t.bind.legend:"click",a=ZI(o)?CX(o,"view"):fU(o);t.bind={legend:{merge:a}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=iG(t.bind)&&t.bind.legend,o=e=>t=>{const n=DU(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const a=e.field+"_legend",u=`${r}_${a}`;if(0===n.filter(e=>e.name===u).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:u},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 : "+u,force:!0}]}))}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find(e=>e.name===r+IK),a=r+"_tuple_fields",u=i.items.filter(e=>e.hasLegend).map(e=>VU(`${r}_${e.field}_legend`)),s=`${u.map(e=>e+" !== null").join(" && ")} ? {fields: ${a}, values: [${u.join(", ")}]} : null`;t.events&&u.length>0?o.on.push({events:u.map(e=>({signal:e})),update:s}):u.length>0&&(o.update=s,delete o.value,delete o.on);const l=n.find(e=>e.name===r+"_toggle"),c=iG(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 _K="_translate_delta",AK={has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const r=t.name,i=bK.has(t),o=r+"_translate_anchor",{x:a,y:u}=t.project.hasChannel;let s=CX(t.translate,"scope");return i||(s=s.map(e=>(e.between[0].markname=r+NK,e))),n.push({name:o,value:{},on:[{events:s.map(e=>e.between[0]),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(i?xK(e,C$):`slice(${a.signals.visual})`):"")+(void 0!==u?", extent_y: "+(i?xK(e,O$):`slice(${u.signals.visual})`):"")+"}"}]},{name:r+_K,value:{},on:[{events:s,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&kK(e,t,a,"width",n),void 0!==u&&kK(e,t,u,"height",n),n}};function kK(e,t,n,r,i){var o;const a=t.name,u=a+"_translate_anchor",s=a+_K,l=n.channel,c=bK.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"),m=`${u}.extent_${l}`,g=`${c?"log"===p?"panLog":"pow"===p?"panPow":"panLinear":"panLinear"}(${m}, ${`${c&&l===C$?"-":""}${s}.${l} / `+(c?""+d:`span(${m})`)}`+(c&&"pow"===p?", "+(null!=(o=h.get("exponent"))?o:1):"")+")";f.on.push({events:{signal:s},update:c?g:`clampRange(${g}, 0, ${d})`})}const CK={has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=bK.has(t),o=r+"_zoom_delta",{x:a,y:u}=t.project.hasChannel,s=eU(e.scaleName(C$)),l=eU(e.scaleName(O$));let c=CX(t.zoom,"scope");return i||(c=c.map(e=>(e.markname=r+NK,e))),n.push({name:r+"_zoom_anchor",on:[{events:c,update:i?"{"+[s?`x: invert(${s}, 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&&OK(e,t,a,"width",n),void 0!==u&&OK(e,t,u,"height",n),n}};function OK(e,t,n,r,i){var o;const a=t.name,u=n.channel,s=bK.has(t),l=i.filter(e=>e.name===n.signals[s?"data":"visual"])[0],c=e.getSizeSignalRef(r).signal,f=e.getScaleComponent(u),d=f.get("type"),h=s?xK(e,u):l.name,p=a+"_zoom_delta",m=`${s?"log"===d?"zoomLog":"pow"===d?"zoomPow":"zoomLinear":"zoomLinear"}(${h}, ${`${a}_zoom_anchor.${u}`}, ${p}`+(s&&"pow"===d?", "+(null!=(o=f.get("exponent"))?o:1):"")+")";l.on.push({events:{signal:p},update:s?m:`clampRange(${m}, 0, ${c})`})}const SK=[{has:()=>!0,parse:(e,t,n)=>{var r,i,o;const a=t.name,u=null!=(r=t.project)?r:t.project=new mK,s={},l={},c=new Set,f=(e,t)=>{const n="visual"===t?e.channel:e.field;let r=VU(`${a}_${n}`);for(let e=1;c.has(r);e++)r=VU(`${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 fU(n.init))for(const r of qU(e))Z$[r]?(n.encodings||(n.encodings=[])).push(r):"interval"===n.type?(aH('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)?i:[]){const t={type:"E",field:e};t.signals=Object.assign({},f(t,"data")),u.items.push(t),u.hasField[e]=t}for(const r of null!=(o=n.encodings)?o:[]){const n=e.fieldDef(r);if(n){let i=n.field;if(n.aggregate){aH(eH.cannotProjectAggregate(r,n.aggregate));continue}if(!i){aH(eH.cannotProjectOnChannelWithoutField(r));continue}if(n.timeUnit){i=e.vgField(r);const t={as:i,field:n.field,timeUnit:n.timeUnit};l[NU(t)]=t}if(!s[i]){let o="E";if("interval"===t.type){QH(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")),u.items.push(s[i]=a),u.hasField[i]=u.hasChannel[r]=s[i]}}else aH(eH.cannotProjectOnChannelWithoutField(r))}if(n.init){const e=e=>u.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=JI(n.init)?n.init:[n.init];t.init=r.map(e)}}qU(l).length>0&&(u.timeUnit=new pK(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{signals:t,hasLegend:n}=e,r=C(e,["signals","hasLegend"]),i=DU(r);return i.field=JU(i.field),i})})}},vK,bK,EK,AK,CK,gK,fK,yK];function DK(e,t){for(const n of SK)n.has(e)&&t(n)}function FK(e,t=!0,n=aU){if(JI(e)){const r=e.map(e=>FK(e,t,n));return t?`[${r.join(", ")}]`:r}return uH(e)?n(dH(e,!1,!t)):t?n(JSON.stringify(e)):e}function jK(e,t){return WK(e,(n,r)=>{t=r.marks?r.marks(e,n,t):t,DK(n,r=>{r.marks&&(t=r.marks(e,n,t))})}),t}function TK(e){return e.map(e=>(e.on&&!e.on.length&&delete e.on,e))}const NK="_brush",MK={signals:(e,t)=>{const n=t.name,r=n+"_tuple_fields",i=bK.has(t),o=[],a=[],u=[];if(t.translate&&!i){const e="!event.item || event.item.mark.name !== "+eU(n+NK);BK(t,(t,n)=>{var r;const i=fU(null!=(r=n.between[0].filter)?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(i!==C$&&i!==O$)return void aH("Interval selections only support x and y encoding channels.");const s=t.init?t.init[r]:null,l=function(e,t,n,r){const i=n.channel,o=n.signals.visual,a=n.signals.data,u=bK.has(t),s=eU(e.scaleName(i)),l=e.getScaleComponent(i),c=l?l.get("type"):void 0,f=e=>`scale(${s}, ${e})`,d=e.getSizeSignalRef(i===C$?"width":"height").signal,h=i+"(unit)",p=BK(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:QH(c)?`[${f(a+"[0]")}, ${f(a+"[1]")}]`:"[0, 0]"}),u?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:FK(r,!0,f)}:{value:[]}),{on:p}),Object.assign(Object.assign({name:a},r?{init:FK(r)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${s}, ${o})`}]})]}(e,t,n,s),c=n.signals.data,f=n.signals.visual,d=eU(e.scaleName(i)),h=QH(e.getScaleComponent(i).get("type"))?"+":"";o.push(...l),a.push(c),u.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:u.map(e=>({scale:e.scaleName})),update:u.map(e=>e.expr).join(" && ")+` ? ${n+"_scale_trigger"} : {}`}]});const s=t.init,l=`unit: ${HK(e)}, fields: ${r}, values`;return o.concat(Object.assign(Object.assign({name:n+IK},s?{init:`{${l}: ${FK(s)}}`}:{}),{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+` ? {${l}: [${a}]} : null`}]}))},modifyExpr:(e,t)=>t.name+IK+", "+("global"===t.resolve?"true":`{unit: ${HK(e)}}`),marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,a=i&&i.signals.visual,u=o&&o.signals.visual,s=`data(${eU(t.name+LK)})`;if(bK.has(t))return n;const l={x:void 0!==i?{signal:a+"[0]"}:{value:0},y:void 0!==o?{signal:u+"[0]"}:{value:0},x2:void 0!==i?{signal:a+"[1]"}:{field:{group:"width"}},y2:void 0!==o?{signal:u+"[1]"}:{field:{group:"height"}}};if("global"===t.resolve)for(const t of qU(l))l[t]=[Object.assign({test:`${s}.length && ${s}[0].unit === ${HK(e)}`},l[t]),{value:0}];const c=t.mark,{fill:f,fillOpacity:d}=c,h=C(c,["fill","fillOpacity"]),p=qU(h).reduce((e,t)=>(e[t]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${u}[0] !== ${u}[1]`].filter(e=>e).join(" && "),value:h[t]},{value:null}],e),{});return[{name:r+NK+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:f},fillOpacity:{value:d}},update:l}},...n,{name:r+NK,type:"rect",clip:!0,encode:{enter:{fill:{value:"transparent"}},update:Object.assign(Object.assign({},l),p)}}]}};function BK(e,t){return e.events.reduce((e,n)=>n.between?t(e,n):(aH(n+" is not an ordered event stream for interval selections."),e),[])}function PK(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}[${eU(e.vgField(t.channel,{}))}], ${o}[${eU(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${o}[${eU(t.field)}]`}).join(", "),u=`unit: ${HK(e)}, fields: ${r}, values`,s=t.events;return[{name:n+IK,on:s?[{events:s,update:`datum && item().mark.marktype !== 'group' ? {${u}: [${a}]} : null`,force:!0}]:[]}]}const RK={signals:PK,modifyExpr:(e,t)=>t.name+IK+", "+("global"===t.resolve?"null":`{unit: ${HK(e)}}`)};const zK={signals:PK,modifyExpr:(e,t)=>t.name+IK+", "+("global"===t.resolve?"true":`{unit: ${HK(e)}}`)};const LK="_store",IK="_tuple",UK="_modify",$K="vlSelectionResolve",qK={single:zK,multi:RK,interval:MK};function WK(e,t){const n=e.component.selection;if(n)for(const e in n)if(pU(n,e)){const r=n[e];if(!0===t(r,qK[r.type]))break}}function HK(e,{escape:t}={escape:!0}){let n=t?eU(e.name):e.name;const r=function(e){let t=e.parent;for(;t&&!w0(t);)t=t.parent;return t}(e);if(r){const{facet:e}=r;for(const t of q$)e[t]&&(n+=` + '__facet_${t}_' + (facet[${eU(r.vgField(t))}])`)}return n}function VK(e){let t=!1;return WK(e,e=>{t=t||e.project.items.some(e=>"_vgsid_"===e.field)}),t}var YK,GK,XK,KK,JK;function QK(e){this.type=e}QK.prototype.visit=function(e){var t,n,r;if(e(this))return 1;for(n=0,r=(t=function(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case"CallExpression":var t=e.arguments.slice();return t.unshift(e.callee),t;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)).length;n",YK[3]="Identifier",YK[4]="Keyword",YK[5]="Null",YK[6]="Numeric",YK[7]="Punctuator",YK[8]="String",YK[9]="RegularExpression";var ZK=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]"),eJ=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 tJ(e,t){if(!e)throw new Error("ASSERT: "+t)}function nJ(e){return e>=48&&e<=57}function rJ(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function iJ(e){return"01234567".indexOf(e)>=0}function oJ(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 aJ(e){return 10===e||13===e||8232===e||8233===e}function uJ(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&ZK.test(String.fromCharCode(e))}function sJ(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&eJ.test(String.fromCharCode(e))}var lJ={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 cJ(){for(var e;XK1114111||"}"!==e)&&OJ({},"Unexpected token %0","ILLEGAL"),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function hJ(){var e,t;for(e=GK.charCodeAt(XK++),t=String.fromCharCode(e),92===e&&(117!==GK.charCodeAt(XK)&&OJ({},"Unexpected token %0","ILLEGAL"),++XK,(e=fJ("u"))&&"\\"!==e&&uJ(e.charCodeAt(0))||OJ({},"Unexpected token %0","ILLEGAL"),t=e);XK>>="===(r=GK.substr(XK,4))?{type:7,value:r,start:i,end:XK+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:XK+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:7,value:t,start:i,end:XK+=2}:"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:i,end:++XK}:void OJ({},"Unexpected token %0","ILLEGAL")}function gJ(){var e,t,n;if(tJ(nJ((n=GK[XK]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=XK,e="","."!==n){if(e=GK[XK++],n=GK[XK],"0"===e){if("x"===n||"X"===n)return++XK,function(e){for(var t="";XK=0&&OJ({},"Invalid regular expression",n),{value:n,literal:t}}(),r=function(e,t){var n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(function(e,t){if(parseInt(t,16)<=1114111)return"x";OJ({},"Invalid regular expression")})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){OJ({},"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:XK}}function yJ(){var e;return cJ(),XK>=KK?{type:2,start:XK,end:XK}:uJ(e=GK.charCodeAt(XK))?pJ():40===e||41===e||59===e?mJ():39===e||34===e?function(){var e,t,n,r,i="",o=!1;for(tJ("'"===(e=GK[XK])||'"'===e,"String literal must starts with a quote"),t=XK,++XK;XK=0&&XK":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 WJ(){var e,t;return e=function(){var e,t,n,r,i,o,a,u,s,l;if(e=JK,s=$J(),0===(i=qJ(r=JK)))return s;for(r.prec=i,bJ(),t=[e,JK],o=[s,r,a=$J()];(i=qJ(JK))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),u=o.pop().value,s=o.pop(),t.pop(),n=wJ(u,s,a),o.push(n);(r=bJ()).prec=i,o.push(r),t.push(JK),n=$J(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=wJ(o[l-1].value,o[l-2],n),l-=2;return n}(),FJ("?")&&(bJ(),t=WJ(),DJ(":"),e=function(e,t,n){var r=new QK("ConditionalExpression");return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,WJ())),e}function HJ(){var e=WJ();if(FJ(","))throw new Error("Disabled.");return e}function VJ(e){const t=function(e){XK=0,KK=(GK=e).length,JK=null,xJ();var t=HJ();if(2!==JK.type)throw new Error("Unexpect token after expression.");return t}(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 YJ extends dK{constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=KJ(this.model,this.filter,this),this._dependentFields=VJ(this.expr)}clone(){return new YJ(null,this.model,DU(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter "+this.expr}}function GJ(e,t,n,r="datum"){const i=[];const o=YU(t,(function(t){const o=VU(t),a=e.getSelectionComponent(o,t),u=eU(o+LK);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(u),`vlSelectionTest(${u}, ${r}`+("global"===a.resolve?")":`, ${eU(a.resolve)})`)}));return(i.length?"!("+i.map(e=>`length(data(${e}))`).join(" || ")+") || ":"")+`(${o})`}function XJ(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,aH((i.length?"Multiple ":"No ")+`matching ${eU(n)} encoding found for selection ${eU(t.selection)}. `+`Using "field": ${eU(r)}.`)):r=i[0].field}}else r=e.project.items[0].field,e.project.items.length>1&&aH(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${eU(r)}.`);return`${e.name}[${eU(r)}]`}function KJ(e,t,n){return YU(t,t=>ZI(t)?t:function(e){var t;return null===(t=e)||void 0===t?void 0:t.selection}(t)?GJ(e,t.selection,n):BH(t))}function JJ(e,t,n,r){var i,o,a;e.encode=null!=(i=e.encode)?i:{},e.encode[t]=null!=(o=e.encode[t])?o:{},e.encode[t].update=null!=(a=e.encode[t].update)?a:{},e.encode[t].update[n]=r}function QJ(e,t,n,r={header:!1}){var i,o;const a=e.combine(),{orient:u,scale:s,labelExpr:l,title:c,zindex:f}=a,d=C(a,["orient","scale","labelExpr","title","zindex"]);if(qU(d).forEach(e=>{const n=wX[e],r=d[e];if(n&&n!==t&&"both"!==n)delete d[e];else if(r.condition){const{vgProp:t,part:n}=bX[e],{condition:i,value:o}=r,a=[...(JI(i)?i:[i]).map(e=>{const{value:t,test:n}=e;return{test:KJ(null,n),value:t}}),{value:o}];JJ(d,n,t,a),delete d[e]}}),"grid"===t){if(!d.grid)return;if(d.encode){const{grid:e}=d.encode;d.encode=Object.assign({},e?{grid:e}:{}),0===qU(d.encode).length&&delete d.encode}return Object.assign(Object.assign({scale:s,orient:u},d),{domain:!1,labels:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:t$(f,0)})}{if(!r.header&&e.mainExtracted)return;if(void 0!==l){let e=l;(null===(o=null===(i=d.encode)||void 0===i?void 0:i.labels)||void 0===o?void 0:o.update)&&pX(d.encode.labels.update.text)&&(e=QU(l,"datum.label",d.encode.labels.update.text.signal)),JJ(d,"labels","text",{signal:e})}if(d.encode){for(const t of xX)e.hasAxisPart(t)||delete d.encode[t];0===qU(d.encode).length&&delete d.encode}const t=function(e,t){if(e)return mV(e)?e:e.map(e=>oY(e,t)).join(", ")}(c,n);return Object.assign(Object.assign(Object.assign({scale:s,orient:u,grid:!1},t?{title:t}:{}),d),{zindex:t$(f,0)})}}function ZJ(e){const{axes:t}=e.component;for(const n of gq)if(t[n])for(const r of t[n])if(!r.get("gridScale")){const t="x"===n?"height":"width";return[{name:t,update:e.getSizeSignalRef(t).signal}]}return[]}const eQ={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"},tQ={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelLimit:"limit",labelOrient:"orient",labelPadding:"offset"},nQ=qU(eQ),rQ=qU(tQ);function iQ(e,t,n,r,i){var o;const a=[..."band"===i?["axisBand"]:[],"x"===n?"axisX":"axisY",...r?["axis"+r.substr(0,1).toUpperCase()+r.substr(1)]:[],"axis"];for(const n of a)if(void 0!==(null===(o=t[n])||void 0===o?void 0:o[e]))return t[n][e]}function oQ(e,t){if(void 0!==e)return e=i$(e),"top"===t||"bottom"===t?e<=45||315<=e?"top"===t?"bottom":"top":135<=e&&e<=225?"top"===t?"top":"bottom":"middle":e<=45||315<=e||135<=e&&e<=225?"middle":45<=e&&e<=135?"left"===t?"top":"bottom":"left"===t?"bottom":"top"}function aQ(e,t){if(void 0!==e)return e=i$(e),"top"===t||"bottom"===t?e%180==0?"center":0{if(GV(t)&&BV(t.sort)){const{field:r,timeUnit:i}=t,o=t.sort,a=o.map((e,t)=>`${BH({field:r,timeUnit:i,equal:e})} ? ${t} : `).join("")+o.length;e=new sQ(e,{calculate:a,as:lQ(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 "+NU(this.transform)}}function lQ(e,t,n){return JV(e,Object.assign({prefix:t,suffix:"sort_index"},null!=n?n:{}))}function cQ(e,t){return BU(["top","bottom"],t)?"column":BU(["left","right"],t)||"row"===e?"row":"column"}function fQ(e,t,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return t$(t&&t.header?t.header[e]:void 0,i[e],n.header[e])}function dQ(e,t,n,r){const i={};for(const o of e){const e=fQ(o,t,n,r);void 0!==e&&(i[o]=e)}return i}const hQ=["row","column"],pQ=["header","footer"];function mQ(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:u}=dQ(["titleAnchor","titleAngle","titleOrient"],i,r,t),s=cQ(t,u);return{name:t+"-title",type:"group",role:s+"-title",title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===t?{orient:"left"}:{}),{style:"guide-title"}),vQ(a,s)),gQ(s,a,o)),AQ(r,i,t,nQ,eQ))}}function gQ(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=aQ(t,"row"===e?"left":"top");return r?{align:r}:{}}function vQ(e,t){const n=oQ(e,"row"===t?"left":"top");return n?{baseline:n}:{}}function yQ(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of pQ)if(n[i])for(const o of n[i])r.push(wQ(e,t,i,n,o));return r}function bQ(e,t){var n;const{sort:r}=e;return MV(r)?{field:JV(r,{expr:"datum"}),order:(n=r.order,null!=n?n:"ascending")}:JI(r)?{field:lQ(e,t,{expr:"datum"}),order:"ascending"}:{field:JV(e,{expr:"datum"}),order:null!=r?r:"ascending"}}function xQ(e,t,n){const{format:r,labelAngle:i,labelAnchor:o,labelOrient:a,labelExpr:u}=dQ(["format","labelAngle","labelAnchor","labelOrient","labelExpr"],e,n,t),s=xV(e,r,"parent",n).signal,l=cQ(t,a);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:u?QU(QU(u,"datum.label",s),"datum.value",JV(e,{expr:"parent"})):s}},"row"===t?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),vQ(i,l)),gQ(l,i,o)),AQ(n,e,t,rQ,tQ))}function wQ(e,t,n,r,i){var o;if(i){let a=null;const{facetFieldDef:u}=r,s=e.config?e.config:void 0;if(u&&i.labels){const{labelOrient:e}=dQ(["labelOrient"],u,s,t);("row"===t&&!BU(["top","bottom"],e)||"column"===t&&!BU(["left","right"],e))&&(a=xQ(u,t,s))}const l=w0(e)&&!PV(e.facet),c=i.axes,f=(null===(o=c)||void 0===o?void 0:o.length)>0;if(a||f){const o="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:bQ(u,t)}:{}),f&&l?{from:{data:e.getName("facet_domain_"+t)}}:{}),a?{title:a}:{}),i.sizeSignal?{encode:{update:{[o]:i.sizeSignal}}}:{}),f?{axes:c}:{})}}return null}const EQ={column:{start:0,end:1},row:{start:1,end:0}};function _Q(e,t){return EQ[t][e]}function AQ(e,t,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=fQ(a,t,e,n);void 0!==r&&(o[i[a]]=r)}return o}function kQ(e){return[...CQ(e,"width"),...CQ(e,"height")]}function CQ(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(JH(r)&&mX(o)){const r=e.scaleName(n);if(w0(e.parent)){if("independent"===e.parent.component.resolve.scale[n])return[OQ(r,o)]}return[OQ(r,o),{name:i,update:SQ(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} : ${fG(e.config.view,t?"width":"height")}`;return[{name:i,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:i,value:r}]}function OQ(e,t){return{name:e+"_step",value:t.step}}function SQ(e,t,n){const r=t.get("type"),i=t.get("padding"),o=t$(t.get("paddingOuter"),i);let a=t.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,`bandspace(${n}, ${a}, ${o}) * ${e}_step`}function DQ(e,t){return qU(e).reduce((n,r)=>{const i=e[r];return Object.assign(Object.assign({},n),NX(t,i,r,e=>({value:e.value})))},{})}function FQ(e,t){if(A0(t)||w0(t))return"shared";if(_0(t)||E0(t))return BU(gq,e)?"independent":"shared";throw new Error("invalid model type for resolve")}function jQ(e,t){const n=e.scale[t],r=BU(gq,t)?"axis":"legend";return"independent"===n?("shared"===e[r][t]&&aH(eH.independentScaleMeansIndependentGuide(t)),"independent"):e[r][t]||"shared"}class TQ{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new TQ(DU(this.explicit),DU(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return t$(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 qU(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function NQ(e){return{explicit:!0,value:e}}function MQ(e){return{explicit:!1,value:e}}function BQ(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:PQ(t,n,r,i)}}function PQ(e,t,n,r){return e.explicit&&t.explicit&&aH(eH.mergeConflictingProperty(n,r,e.value,t.value)),e}function RQ(e,t,n,r,i=PQ){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:SU(e.value,t.value)?e:i(e,t,n,r)}const zQ=Object.assign(Object.assign({},tG),{labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),LQ=qU(zQ);class IQ extends TQ{}function UQ(e){const{legend:t}=e;return t$(t.type,$Q(e))}function $Q({channel:e,timeUnit:t,scaleType:n,alwaysReturn:r}){if(U$(e)){if(BU(["quarter","month","day"],t))return"symbol";if(ZH(n))return r?"gradient":void 0}return r?"symbol":void 0}function qQ({legend:e,legendConfig:t,timeUnit:n,channel:r,scaleType:i}){const o=t$(e.orient,t.orient,"right"),a=UQ({legend:e,channel:r,timeUnit:n,scaleType:i,alwaysReturn:!0});return t$(e.direction,t[a?"gradientDirection":"symbolDirection"],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}}(o,a))}function WQ(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function HQ(e,t,n){const r=t.getScaleComponent(n).get("type");return t$(e.get("type"),$Q({channel:n,scaleType:r,alwaysReturn:!0}))}function VQ(e,t,n,r,i){var o,a,u,s,l;if("symbol"!==HQ(i,n,r))return;let c=Object.assign(Object.assign({},function(e,t,n){for(const r of n){const n=yV(r,t.markDef,t.config);void 0!==n&&(e[r]={value:n})}return e}({},n,c$)),qX(n));const{markDef:f,encoding:d,config:h}=n,p=f.filled,m=null!=(o=KQ(d.opacity))?o:f.opacity,g=ZQ(n,i,e);if(c.fill)if("fill"===r||p&&r===S$)delete c.fill;else if(c.fill.field)i.get("symbolFillColor")?delete c.fill:(c.fill={value:(a=h.legend.symbolBaseFillColor,null!=a?a:"black")},c.fillOpacity={value:null!=m?m:1});else if(JI(c.fill)){const e=null!=(l=null!=(s=JQ(null!=(u=d.fill)?u:d.color))?s:f.fill)?l:p&&f.color;e&&(c.fill={value:e})}if(c.stroke)if("stroke"===r||!p&&r===S$)delete c.stroke;else if(c.stroke.field)delete c.stroke;else if(JI(c.stroke)){const e=t$(JQ(d.stroke||d.color),f.stroke,p?f.color:void 0);e&&(c.stroke={value:e})}return r!==N$&&(g?c.opacity=[{test:g,value:null!=m?m:1},{value:h.legend.unselectedOpacity}]:m&&(c.opacity={value:m})),c=Object.assign(Object.assign({},c),t),qU(c).length>0?c:void 0}function YQ(e,t,n,r,i){if("gradient"!==HQ(i,n,r))return;let o={};const a=KQ(n.encoding.opacity)||n.markDef.opacity;return a&&(o.opacity={value:a}),o=Object.assign(Object.assign({},o),t),qU(o).length>0?o:void 0}function GQ(e,t,n,r,i){const o=n.legend(r),a=n.config,u=ZQ(n,i,e);let s={};if(hY(e)){const i=n.getScaleComponent(r).get("type")===LH.UTC,u=kV("datum.value",e.timeUnit,o.format,a.timeFormat,i);t=Object.assign(Object.assign({},u?{text:{signal:u}}:{}),t)}return u&&(t.opacity=[{test:u,value:1},{value:a.legend.unselectedOpacity}]),s=Object.assign(Object.assign({},s),t),qU(s).length>0?s:void 0}function XQ(e,t,n,r,i){var o;return(null===(o=i.get("selections"))||void 0===o?void 0:o.length)?{fill:{value:"transparent"}}:void 0}function KQ(e){return QQ(e,(e,t)=>Math.max(e,t.value))}function JQ(e){return QQ(e,(e,t)=>t$(e,t.value))}function QQ(e,t){return function(e){return!!e&&!!e.condition&&(JI(e.condition)||YV(e.condition))}(e)?(JI(e.condition)?e.condition:[e.condition]).reduce(t,e.value):YV(e)?e.value:void 0}function ZQ(e,t,n){var r;const i=t.get("selections");if(!(null===(r=i)||void 0===r?void 0:r.length))return;const o=eU(n.field);return i.map(e=>`(!length(data(${eU(VU(e)+LK)})) || (${e}[${o}] && indexof(${e}[${o}], datum.value) >= 0))`).join(" || ")}function eZ(e){x0(e)?e.component.legends=function(e){const{encoding:t}=e;return[S$,D$,F$,P$,T$,j$,N$,M$,B$].reduce((n,r)=>{const i=t[r];return!e.legend(r)||!e.getScaleComponent(r)||WV(i)&&r===j$&&"geojson"===i.type||(n[r]=function(e,t){var n;const r=e.fieldDef(t),i=e.legend(t),o=new IQ({},function(e,t){const n=e.scaleName(S$);if("color"===t)return e.markDef.filled?{fill:n}:{stroke:n};return{[t]:e.scaleName(t)}}(e,t));!function(e,t,n){const r=e.fieldDef(t).field;WK(e,e=>{var i,o;const a=null!=(i=e.project.hasField[r])?i:e.project.hasChannel[t];if(a&&EK.has(e)){const t=null!=(o=n.get("selections"))?o:[];t.push(e.name),n.set("selections",t,!1),a.hasLegend=!0}})}(e,t,o);for(const n of LQ){const a=nZ(n,i,t,e);if(void 0!==a){const t=tZ(a,n,i,r);(t||void 0===e.config.legend[n])&&o.set(n,a,t)}}const a=null!==(n=i.encoding)&&void 0!==n?n:{},u=o.get("selections"),s=["labels","legend","title","symbols","gradient","entries"].reduce((n,i)=>{var s,l,c;const f=DQ(null!=(s=a[i])?s:{},e),d=b[i]?b[i](r,f,e,t,o):f;return void 0!==d&&qU(d).length>0&&(n[i]=Object.assign(Object.assign(Object.assign({},(null===(l=u)||void 0===l?void 0:l.length)?{name:`${r.field}_legend_${i}`}:{}),(null===(c=u)||void 0===c?void 0:c.length)?{interactive:!!u}:{}),{update:d})),n},{});qU(s).length>0&&o.set("encode",s,!!i.encoding);return o}(e,r)),n},{})}(e):e.component.legends=function(e){const{legends:t,resolve:n}=e.component;for(const r of e.children)eZ(r),qU(r.component.legends).forEach(i=>{n.legend[i]=jQ(e.component.resolve,i),"shared"===n.legend[i]&&(t[i]=rZ(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))});return qU(t).forEach(t=>{for(const r of e.children)r.component.legends[t]&&"shared"===n.legend[t]&&delete r.component.legends[t]}),t}(e)}function tZ(e,t,n,r){switch(t){case"values":return!!n.values;case"title":if("title"===t&&e===r.title)return!0}return e===n[t]}function nZ(e,t,n,r){const{encoding:i,mark:o}=r,a=sY(i[n]),u=r.config.legend,{timeUnit:s}=a,l=r.getScaleComponent(n).get("type");switch(e){case"direction":return qQ({legend:t,legendConfig:u,timeUnit:s,channel:n,scaleType:l});case"format":if(hY(a))return;return wV(a,t.format,r.config);case"formatType":if(hY(a))return;return t.formatType;case"gradientLength":return t$(t.gradientLength,u.gradientLength,function({legend:e,legendConfig:t,model:n,channel:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:u,gradientVerticalMinLength:s}=t;if("horizontal"===qQ({legend:e,legendConfig:t,channel:r,scaleType:i})){const r=t$(e.orient,t.orient);return"top"===r||"bottom"===r?WQ(n,"width",a,o):a}return WQ(n,"height",s,u)}({model:r,legend:t,legendConfig:u,channel:n,scaleType:l}));case"labelOverlap":return t$(t.labelOverlap,function(e){if(BU(["quantile","threshold","log"],e))return"greedy"}(l));case"symbolType":return t$(t.symbolType,function(e,t,n,r){var i;if("shape"!==t){const e=null!=(i=JQ(n))?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"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(o,n,i.shape,r.markDef.shape));case"title":return rY(a,r.config,{allowDisabling:!0})||void 0;case"type":return UQ({legend:t,channel:n,timeUnit:s,scaleType:l,alwaysReturn:!1});case"values":return function(e,t){const n=e.values;if(n)return mY(t,n)}(t,a)}return t[e]}function rZ(e,t){var n,r,i,o,a,u;if(!e)return t.clone();const s=e.getWithExplicit("orient"),l=t.getWithExplicit("orient");if(s.explicit&&l.explicit&&s.value!==l.value)return;let c=!1;for(const n of LQ){const r=RQ(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",(e,t)=>{switch(n){case"symbolType":return iZ(e,t);case"title":return DV(e,t);case"type":return c=!0,MQ("symbol")}return PQ(e,t,n,"legend")});e.setWithExplicit(n,r)}return c&&((null==(i=null===(r=null===(n=e.implicit)||void 0===n?void 0:n.encode)||void 0===r?void 0:r.gradient)||i)&&GU(e.implicit,["encode","gradient"]),(null==(u=null===(a=null===(o=e.explicit)||void 0===o?void 0:o.encode)||void 0===a?void 0:a.gradient)||u)&&GU(e.explicit,["encode","gradient"])),e}function iZ(e,t){return"circle"===t.value?t:e}function oZ(e){const t=e.component.legends,n={};for(const r of qU(t)){const i=e.getScaleComponent(r),o=TU(i.get("domains"));if(n[o])for(const e of n[o]){rZ(e,t[r])||n[o].push(t[r])}else n[o]=[t[r].clone()]}return WU(n).flat().map(e=>{var t,n,r,i;const o=e.combine(),{labelExpr:a,selections:u}=o,s=C(o,["labelExpr","selections"]);if(null===(t=s.encode)||void 0===t?void 0:t.symbols){const e=s.encode.symbols.update;!e.fill||"transparent"===e.fill.value||e.stroke||s.stroke||(e.stroke={value:"transparent"}),s.fill&&delete e.fill}if(void 0!==a){let e=a;(null===(i=null===(r=null===(n=s.encode)||void 0===n?void 0:n.labels)||void 0===r?void 0:r.update)||void 0===i?void 0:i.text)&&pX(s.encode.labels.update.text)&&(e=QU(a,"datum.label",s.encode.labels.update.text.signal)),function(e,t,n,r){var i,o,a;e.encode=null!=(i=e.encode)?i:{},e.encode[t]=null!=(o=e.encode[t])?o:{},e.encode[t].update=null!=(a=e.encode[t].update)?a:{},e.encode[t].update[n]=r}(s,"labels","text",{signal:e})}return s})}function aZ(e){return A0(e)||_0(e)||E0(e)?function(e){return e.children.reduce((e,t)=>e.concat(t.assembleProjections()),uZ(e))}(e):uZ(e)}function uZ(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n,i=C(n,["name"]);if(t.data){const n={signal:`[${t.size.map(e=>e.signal).join(", ")}]`},o=t.data.reduce((t,n)=>{const r=pX(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return BU(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:n,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]}},i)]}return[Object.assign(Object.assign({name:r},{translate:{signal:"[width / 2, height / 2]"}}),i)]}const sZ=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class lZ extends TQ{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 cZ(e){e.component.projection=x0(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=[];for(const n of[["longitude","latitude"],["longitude2","latitude2"]])(e.channelHasField(n[0])||e.channelHasField(n[1]))&&t.push({signal:e.getName("geojson_"+t.length)});e.channelHasField(j$)&&"geojson"===e.fieldDef(j$).type&&t.push({signal:e.getName("geojson_"+t.length)});0===t.length&&t.push(e.requestDataName(XG));return t}(e):void 0;return new lZ(e.projectionName(!0),Object.assign(Object.assign({},null!=(t=e.config.projection)?t:{}),null!=n?n:{}),i,o)}return}(e):function(e){if(0===e.children.length)return;let t;e.children.forEach(e=>cZ(e));const n=RU(e.children,e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=RU(sZ,n=>!pU(e.explicit,n)&&!pU(t.explicit,n)||!(!pU(e.explicit,n)||!pU(t.explicit,n)||TU(e.get(n))!==TU(t.get(n))));if(TU(e.size)===TU(t.size)){if(n)return e;if(TU(e.explicit)===TU({}))return t;if(TU(t.explicit)===TU({}))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 lZ(n,t.specifiedProjection,t.size,DU(t.data));return e.children.forEach(e=>{const t=e.component.projection;t&&(t.isFit&&r.data.push(...e.component.projection.data),e.renameProjection(t.get("name"),n),t.merged=!0)}),r}return}(e)}function fZ(e,t){return`${vY(e)}_${t}`}function dZ(e,t,n){var r;const i=fZ(null!=(r=fY(n,void 0))?r:{},t);return e.getName(i+"_bins")}function hZ(e,t,n){let r,i;r=function(e){return"as"in e}(e)?ZI(e.as)?[e.as,e.as+"_end"]:[e.as[0],e.as[1]]:[JV(e,{forAs:!0}),JV(e,{binSuffix:"end",forAs:!0})];const o=Object.assign({},fY(t,void 0)),a=fZ(o,e.field),{signal:u,extentSignal:s}=function(e,t){return{signal:e.getName(t+"_bins"),extentSignal:e.getName(t+"_extent")}}(n,a);if(wY(o.extent)){const e=o.extent,t=e.selection;i=XJ(n.getSelectionComponent(VU(t),t),e),delete o.extent}return{key:a,binComponent:Object.assign(Object.assign(Object.assign({bin:o,field:e.field,as:[r]},u?{signal:u}:{}),s?{extentSignal:s}:{}),i?{span:i}:{})}}class pZ extends dK{constructor(e,t){super(e),this.bins=t}clone(){return new pZ(null,DU(this.bins))}static makeFromEncoding(e,t){const n=t.reduceFieldDef((e,n,r)=>{if(HV(n)&&yY(n.bin)){const{key:i,binComponent:o}=hZ(n,n.bin,t);e[i]=Object.assign(Object.assign(Object.assign({},o),e[i]),function(e,t,n,r){var i,o;if(gY(t,n)){const a=x0(e)?null!=(o=null!=(i=e.axis(n))?i:e.legend(n))?o:{}:{},u=JV(t,{expr:"datum"}),s=JV(t,{expr:"datum",binSuffix:"end"});return{formulaAs:JV(t,{binSuffix:"range",forAs:!0}),formula:AV(u,s,a.format,r)}}return{}}(t,n,r,t.config))}return e},{});return 0===qU(n).length?null:new pZ(e,n)}static makeFromTransform(e,t,n){const{key:r,binComponent:i}=hZ(t,t.bin,n);return new pZ(e,{[r]:i})}merge(e,t){for(const n of qU(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=LU([...this.bins[n].as,...e.bins[n].as],NU)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(WU(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(WU(this.bins).map(e=>e.field))}hash(){return"Bin "+NU(this.bins)}assemble(){return WU(this.bins).flatMap(e=>{const t=[],[n,...r]=e.as,i=e.bin,{extent:o}=i,a=C(i,["extent"]),u=Object.assign(Object.assign(Object.assign({type:"bin",field:JU(e.field),as:n,signal:e.signal},wY(o)?{extent:null}:{extent:o}),e.span?{span:{signal:`span(${e.span})`}}:{}),a);!o&&e.extentSignal&&(t.push({type:"extent",field:JU(e.field),signal:e.extentSignal}),u.extent={signal:e.extentSignal}),t.push(u);for(const e of r)for(let r=0;r<2;r++)t.push({type:"formula",expr:JV({field:n[r]},{expr:"datum"}),as:e[r]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t})}}class mZ extends dK{constructor(e){let t;if(super(null),HG(e=null!=e?e:{name:"source"})||(t=e.format?Object.assign({},jU(e.format,["parse"])):{}),qG(e))this._data={values:e.values};else if($G(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];BU(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else YG(e)?this._data={values:[{type:"Sphere"}]}:(WG(e)||HG(e))&&(this._data={});this._generator=HG(e),e.name&&(this._name=e.name),t&&qU(t).length>0&&(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:[]})}}function gZ(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return console.error("Dataflow graph is inconsistent.",t,e),!1;if(!gZ(t.children))return!1}return!0}class vZ extends dK{constructor(e,t){super(e),this.params=t}clone(){return new vZ(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return"Graticule "+NU(this.params)}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class yZ extends dK{constructor(e,t){super(e),this.params=t}clone(){return new yZ(null,this.params)}dependentFields(){return new Set}producedFields(){var e;return new Set([(e=this.params.as,null!=e?e:"data")])}hash(){return"Hash "+NU(this.params)}assemble(){return Object.assign({type:"sequence"},this.params)}}function bZ(e){return e instanceof mZ||e instanceof vZ||e instanceof yZ}class xZ{constructor(){this._mutated=!1}setMutated(){this._mutated=!0}get mutatedFlag(){return this._mutated}}class wZ extends xZ{constructor(){super(),this._continue=!1}setContinue(){this._continue=!0}get continueFlag(){return this._continue}get flags(){return{continueFlag:this.continueFlag,mutatedFlag:this.mutatedFlag}}set flags({continueFlag:e,mutatedFlag:t}){e&&this.setContinue(),t&&this.setMutated()}reset(){}optimizeNextFromLeaves(e){if(bZ(e))return!1;const t=e.parent,{continueFlag:n}=this.run(e);return n&&this.optimizeNextFromLeaves(t),this.mutatedFlag}}class EZ extends xZ{}function _Z(e,t,n,r){const i=x0(r)?r.encoding[iq(t)]:void 0;if(HV(n)&&x0(r)&&UV(t,n,i,r.markDef,r.config))e.add(JV(n,{})),e.add(JV(n,{suffix:"end"})),gY(n,t)&&e.add(JV(n,{binSuffix:"range"}));else if(t in z$){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(JV(n));return e}class AZ extends dK{constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}clone(){return new AZ(null,new Set(this.dimensions),DU(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,u,s;const{aggregate:l,field:c}=e;if(l)if("count"===l)r["*"]=null!=(o=r["*"])?o:{},r["*"].count=new Set([JV(e,{forAs:!0})]);else{if(y$(l)||b$(l)){const e=y$(l)?"argmin":"argmax",t=l[e];r[t]=null!=(a=r[t])?a:{},r[t][e]=new Set([JV({op:e,field:t},{forAs:!0})])}else r[c]=null!=(u=r[c])?u:{},r[c][l]=new Set([JV(e,{forAs:!0})]);Fq(n)&&"unaggregated"===t.scaleDomain(n)&&(r[c]=null!=(s=r[c])?s:{},r[c].min=new Set([JV({field:c,aggregate:"min"},{forAs:!0})]),r[c].max=new Set([JV({field:c,aggregate:"max"},{forAs:!0})]))}else _Z(i,n,e,t)}),i.size+qU(r).length===0?null:new AZ(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["*"])?n:{},a["*"].count=new Set([o||JV(e,{forAs:!0})])):(a[i]=null!=(r=a[i])?r:{},a[i][t]=new Set([o||JV(e,{forAs:!0})])))}for(const e of null!=(i=t.groupby)?i:[])o.add(e);return o.size+qU(a).length===0?null:new AZ(e,o,a)}merge(e){return function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(this.dimensions,e.dimensions)?(function(e,t){var n;for(const r of qU(t)){const i=t[r];for(const t of qU(i))r in e?e[r][t]=new Set([...(n=e[r][t],null!=n?n:[]),...i[t]]):e[r]={[t]:i[t]}}}(this.measures,e.measures),!0):(function(...e){iH.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...qU(this.measures)])}producedFields(){const e=new Set;for(const t of qU(this.measures))for(const n of qU(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 "+NU({dimensions:this.dimensions,measures:this.measures})}assemble(){const e=[],t=[],n=[];for(const r of qU(this.measures))for(const i of qU(this.measures[r]))for(const o of this.measures[r][i])n.push(o),e.push(i),t.push("*"===r?null:JU(r));return{type:"aggregate",groupby:[...this.dimensions],ops:e,fields:t,as:n}}}class kZ extends dK{constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(const e of q$){const n=t.facet[e];if(n){const{bin:r,sort:i}=n;this[e]=Object.assign({name:t.getName(e+"_domain"),fields:[JV(n),...yY(r)?[JV(n,{binSuffix:"end"})]:[]]},MV(i)?{sortField:i}:JI(i)?{sortIndexField:lQ(n,e)}:{})}}this.childModel=t.child}hash(){let e="Facet";for(const t of q$)this[t]&&(e+=` ${t.charAt(0)}:${NU(this[t])}`);return e}get fields(){var e;const t=[];for(const n of q$)(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 q$)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["x","y"]){const n=this.childModel.component.scales[t];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(JH(r)&&mX(i)){const n=r0(i0(this.childModel,t));n?e[t]=n:aH(`Unknown field for ${t}. Cannot calculate view size.`)}}}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:u,sortIndexField:s}=this[e];if(u){const{op:e=FV,field:t}=u;i.push(t),o.push(e),a.push(JV(u,{forAs:!0}))}else s&&(i.push(s),o.push("max"),a.push(s));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 hQ){for(const r of pQ){const o=null!=(t=i[e]&&i[e][r])?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:u,column:s}=a;return(u||s)&&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:u}=this;if(o&&a&&(i.x||i.y)){r=`cross_${this.column.name}_${this.row.name}`;const o=[].concat(null!=(e=i.x)?e:[],null!=(t=i.y)?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["column",k$])this[e]&&n.push(this.assembleRowColumnHeaderData(e,r,i));if(u){const e=this.assembleFacetHeaderData(i);e&&n.push(...e)}return n}}function CZ(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function OZ(e){const t={};return function e(t,n){if(CU(t))e(t.not,n);else if(kU(t))for(const r of t.and)e(r,n);else if(AU(t))for(const r of t.or)e(r,n);else n(t)}(e.filter,e=>{var n;if(NH(e)){let r=null;CH(e)?r=e.equal:jH(e)?r=e.range[0]:TH(e)&&(r=(n=e.oneOf,null!=n?n:e.in)[0]),r&&(uH(r)?t[e.field]="date":gU(r)?t[e.field]="number":ZI(r)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}}),t}function SZ(e){const t={};function n(e){var n;hY(e)?t[e.field]="date":"quantitative"===e.type&&(n=e.aggregate,ZI(n)&&BU(["min","max"],n))?t[e.field]="number":e$(e.field)>1?e.field in t||(t[e.field]="flatten"):GV(e)&&MV(e.sort)&&e$(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((x0(e)||w0(e))&&e.forEachFieldDef((t,r)=>{if(HV(t))n(t);else{const i=rq(r),o=e.fieldDef(i);n(Object.assign(Object.assign({},t),{type:o.type}))}}),x0(e)){const{mark:n,markDef:r,encoding:i}=e;if(a$(n)&&!e.encoding.order){const e=i["horizontal"===r.orient?"y":"x"];WV(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}class DZ extends dK{constructor(e,t){super(e),this._parse=t}clone(){return new DZ(null,DU(this._parse))}hash(){return"Parse "+NU(this._parse)}static makeExplicit(e,t,n){let r={};const i=t.data;return!HG(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 qU(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]:aH(eH.differentParse(e,n[e],t.value)))}for(const e of qU(t)){const n=r.get(e);void 0!==n&&(n===t[e]?delete t[e]:aH(eH.differentParse(e,t[e],n)))}const i=new TQ(t,n);r.copyAll(i);const o={};for(const e of qU(i.combine())){const t=i.get(e);null!==t&&(o[e]=t)}return 0===qU(o).length||r.parseNothing?null:new DZ(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 qU(this._parse)){const n=this._parse[t];1===e$(t)&&(e[t]=n)}return e}producedFields(){return new Set(qU(this._parse))}dependentFields(){return new Set(qU(this._parse))}assembleTransforms(e=!1){return qU(this._parse).filter(t=>!e||e$(t)>1).map(e=>{const t=function(e,t){const n=KU(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},'${CZ(t.slice(5,t.length))}')`}if(0===t.indexOf("utc:")){return`utcParse(${n},'${CZ(t.slice(4,t.length))}')`}return aH(eH.unrecognizedParse(t)),null}(e,this._parse[e]);if(!t)return null;return{type:"formula",expr:t,as:ZU(e)}}).filter(e=>null!==e)}}class FZ extends dK{constructor(e,t){super(e),this.transform=t}clone(){return new FZ(null,DU(this.transform))}addDimensions(e){this.transform.groupby=LU(this.transform.groupby.concat(e),e=>e)}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t=>e.add(t)),this.transform.joinaggregate.map(e=>e.field).filter(e=>void 0!==e).forEach(t=>e.add(t)),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!=(t=e.as)?t:JV(e)}hash(){return"JoinAggregateTransform "+NU(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 jZ extends dK{constructor(e,t){super(e),this._stack=t}clone(){return new jZ(null,DU(this._stack))}static makeFromTransform(e,t){const{stack:n,groupby:r,as:i,offset:o="zero"}=t,a=[],u=[];if(void 0!==t.sort)for(const e of t.sort)a.push(e.field),u.push(t$(e.order,"ascending"));const s={field:a,order:u};let l;return l=function(e){return JI(e)&&e.every(e=>ZI(e))&&e.length>1}(i)?i:ZI(i)?[i,i+"_end"]:[t.stack+"_start",t.stack+"_end"],new jZ(e,{stackField:n,groupby:r,offset:o,sort:s,facetby:[],as:l})}static makeFromEncoding(e,t){const n=t.stack,{encoding:r}=t;if(!n)return null;let i;if(n.groupbyChannel){i=sY(r[n.groupbyChannel])}const o=function(e){return e.stack.stackBy.reduce((e,t)=>{const n=JV(t.fieldDef);return n&&e.push(n),e},[])}(t),a=t.encoding.order;let u;return u=JI(a)||WV(a)?CV(a):o.reduce((e,t)=>(e.field.push(t),e.order.push("descending"),e),{field:[],order:[]}),new jZ(e,{dimensionFieldDef:i,stackField:t.vgField(n.fieldChannel),facetby:[],stackby:o,sort:u,offset:n.offset,impute:n.impute,as:[t.vgField(n.fieldChannel,{suffix:"start",forAs:!0}),t.vgField(n.fieldChannel,{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(t=>e.add(t)),this._stack.facetby.forEach(t=>e.add(t)),this._stack.sort.field.forEach(t=>e.add(t)),e}producedFields(){return new Set(this._stack.as)}hash(){return"Stack "+NU(this._stack)}getGroupbyFields(){const{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[JV(e,{binSuffix:"mid"})]:[JV(e,{}),JV(e,{binSuffix:"end"})]:[JV(e)]:null!=n?n:[]}assemble(){const e=[],{facetby:t,dimensionFieldDef:n,stackField:r,stackby:i,sort:o,offset:a,impute:u,as:s}=this._stack;if(u&&n){const{band:o=.5,bin:a}=n;a&&e.push({type:"formula",expr:o+"*"+JV(n,{expr:"datum"})+`+${1-o}*`+JV(n,{expr:"datum",binSuffix:"end"}),as:JV(n,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:r,groupby:[...i,...t],key:JV(n,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:r,sort:o,as:s,offset:a}),e}}class TZ extends dK{constructor(e,t){super(e),this.transform=t}clone(){return new TZ(null,DU(this.transform))}addDimensions(e){this.transform.groupby=LU(this.transform.groupby.concat(e),e=>e)}dependentFields(){var e,t;const n=new Set;return(e=this.transform.groupby,null!=e?e:[]).forEach(e=>n.add(e)),(t=this.transform.sort,null!=t?t:[]).forEach(e=>n.add(e.field)),this.transform.window.map(e=>e.field).filter(e=>void 0!==e).forEach(e=>n.add(e)),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!=(t=e.as)?t:JV(e)}hash(){return"WindowTransform "+NU(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=>x$(e)))return Object.assign({type:"joinaggregate",as:r,ops:n,fields:t},void 0!==a?{groupby:a}:{});const u=[],s=[];if(void 0!==this.transform.sort)for(const t of this.transform.sort)u.push(t.field),s.push(null!=(e=t.order)?e:"ascending");const l={field:u,order:s},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}:{})}}class NZ extends dK{clone(){return new NZ(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set(["_vgsid_"])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:"_vgsid_"}}}class MZ extends wZ{run(e){const t=e.parent;if(e instanceof DZ){if(bZ(t))return this.flags;if(t.numChildren()>1)return this.setContinue(),this.flags;if(t instanceof DZ)this.setMutated(),t.merge(e);else{if($U(t.producedFields(),e.dependentFields()))return this.setContinue(),this.flags;this.setMutated(),e.swapWithParent()}}return this.setContinue(),this.flags}}class BZ extends EZ{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.setMutated(),this.mergeNodes(e,n[t]));for(const t of e.children)this.run(t);return this.mutatedFlag}}class PZ extends wZ{run(e){return e instanceof hK||e.numChildren()>0||e instanceof kZ||(this.setMutated(),e.remove()),this.flags}}class RZ extends wZ{constructor(){super(...arguments),this.fields=new Set,this.prev=null}run(e){if(this.setContinue(),e instanceof pK){const t=e.producedFields();IU(t,this.fields)?(this.setMutated(),this.prev.remove()):this.fields=new Set([...this.fields,...t]),this.prev=e}return this.flags}reset(){this.fields.clear()}}class zZ extends wZ{run(e){this.setContinue();const t=e.parent.children.filter(e=>e instanceof pK),n=t.pop();for(const e of t)this.setMutated(),n.merge(e);return this.flags}}function LZ(e){if(e instanceof kZ)if(1!==e.numChildren()||e.children[0]instanceof hK){const n=e.model.component.data.main;!function e(t){if(t instanceof hK&&t.type===XG&&1===t.numChildren()){const n=t.children[0];n instanceof kZ||(n.swapWithParent(),e(t))}}(n);const r=(t=e,function e(n){if(!(n instanceof kZ)){const r=n.clone();if(r instanceof hK){const e=VZ+r.getSource();r.setSource(e),t.model.component.data.outputNodes[e]=r}else(r instanceof AZ||r instanceof jZ||r instanceof TZ||r instanceof FZ)&&r.addDimensions(t.fields);return n.children.flatMap(e).forEach(e=>e.parent=r),[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 AZ||t instanceof jZ||t instanceof TZ||t instanceof FZ)&&t.addDimensions(e.fields),t.swapWithParent(),LZ(e)}else e.children.map(LZ);var t}class IZ extends EZ{constructor(){super()}run(e){e instanceof hK&&!e.isRequired()&&(this.setMutated(),e.remove());for(const t of e.children)this.run(t);return this.mutatedFlag}}class UZ extends EZ{constructor(e){super(),this.requiresSelectionId=e&&VK(e)}run(e){e instanceof NZ&&(this.requiresSelectionId&&(bZ(e.parent)||e.parent instanceof AZ||e.parent instanceof DZ)||(this.setMutated(),e.remove()));for(const t of e.children)this.run(t);return this.mutatedFlag}}class $Z extends wZ{run(e){const t=e.parent,n=[...t.children],r=t.children.filter(e=>e instanceof DZ);if(t.numChildren()>1&&r.length>=1){const e={},i=new Set;for(const t of r){const n=t.parse;for(const t of qU(n))t in e?e[t]!==n[t]&&i.add(t):e[t]=n[t]}for(const t of i)delete e[t];if(0!==qU(e).length){this.setMutated();const r=new DZ(t,e);for(const i of n){if(i instanceof DZ)for(const t of qU(e))delete i.parse[t];t.removeChild(i),i.parent=r,i instanceof DZ&&0===qU(i.parse).length&&i.remove()}}}return this.setContinue(),this.flags}}class qZ extends wZ{run(e){const t=e.parent,n=t.children.filter(e=>e instanceof AZ),r={};for(const e of n){const t=NU(e.groupBy);t in r||(r[t]=[]),r[t].push(e)}for(const e of qU(r)){const n=r[e];if(n.length>1){const e=n.pop();for(const r of n)e.merge(r)&&(t.removeChild(r),r.parent=e,r.remove(),this.setMutated())}}return this.setContinue(),this.flags}}class WZ extends wZ{constructor(e){super(),this.model=e}run(e){const t=e.parent,n=!(bZ(t)||t instanceof YJ||t instanceof DZ||t instanceof NZ),r=[],i=[];for(const e of t.children)e instanceof pZ&&(n&&!$U(t.producedFields(),e.dependentFields())?r.push(e):i.push(e));if(r.length>0){const e=r.pop();for(const t of r)e.merge(t,this.model.renameSignal.bind(this.model));this.setMutated(),t instanceof pZ?t.merge(e,this.model.renameSignal.bind(this.model)):e.swapWithParent()}if(i.length>1){const e=i.pop();for(const t of i)e.merge(t,this.model.renameSignal.bind(this.model));this.setMutated()}return this.setContinue(),this.flags}}class HZ extends wZ{run(e){const t=e.parent,n=[...t.children];if(!PU(n,e=>e instanceof hK)||t.numChildren()<=1)return this.setContinue(),this.flags;const r=[];let i;for(const e of n)if(e instanceof hK){let n=e;for(;1===n.numChildren();){const e=n.children[0];if(!(e instanceof hK))break;n=e}r.push(...n.children),i?(t.removeChild(e),e.parent=i.parent,i.parent.removeChild(i),i.parent=n,this.setMutated()):i=n}else r.push(e);if(r.length){this.setMutated();for(const e of r)e.parent.removeChild(e),e.parent=i}return this.setContinue(),this.flags}}const VZ="scale_";function YZ(e){const t=[];return e.forEach((function e(n){0===n.numChildren()?t.push(n):n.children.forEach(e)})),t}function GZ(e){return e}function XZ(e,t){return t.map(t=>{if(e instanceof wZ){const n=e.optimizeNextFromLeaves(t);return e.reset(),n}return e.run(t)}).some(GZ)}function KZ(e,t){let n=e.sources;const r=new Set;return r.add(XZ(new IZ,n)),r.add(XZ(new UZ(t),n)),n=n.filter(e=>e.numChildren()>0),r.add(XZ(new PZ,YZ(n))),n=n.filter(e=>e.numChildren()>0),r.add(XZ(new MZ,YZ(n))),r.add(XZ(new WZ(t),YZ(n))),r.add(XZ(new RZ,YZ(n))),r.add(XZ(new $Z,YZ(n))),r.add(XZ(new qZ,YZ(n))),r.add(XZ(new zZ,YZ(n))),r.add(XZ(new BZ,n)),r.add(XZ(new HZ,YZ(n))),e.sources=n,r.has(!0)}class JZ{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new JZ(()=>e(t))}}function QZ(e){x0(e)?function(e){const t=e.component.scales;qU(t).forEach(n=>{const r=function(e,t){const n=e.getScaleComponent(t).get("type"),r=function(e,t,n,r){if("unaggregated"===e){const{valid:e,reason:r}=t0(t,n);if(!e)return void aH(r)}else if(void 0===e&&r.useUnaggregatedDomain){const{valid:e}=t0(t,n);if(e)return"unaggregated"}return e}(e.scaleDomain(t),e.fieldDef(t),n,e.config.scale);r!==e.scaleDomain(t)&&(e.specifiedScales[t]=Object.assign(Object.assign({},e.specifiedScales[t]),{domain:r}));if("x"===t&&e.channelHasField("x2"))return e.channelHasField("x")?RQ(ZZ(n,r,e,"x"),ZZ(n,r,e,"x2"),"domain","scale",n0):ZZ(n,r,e,"x2");if("y"===t&&e.channelHasField("y2"))return e.channelHasField("y")?RQ(ZZ(n,r,e,"y"),ZZ(n,r,e,"y2"),"domain","scale",n0):ZZ(n,r,e,"y2");return ZZ(n,r,e,t)}(e,n);if(t[n].setWithExplicit("domains",r),function(e,t){const n=e.component.scales[t],r=e.specifiedScales[t].domain,i=e.fieldDef(t).bin,o=tV(r)&&r,a=xY(i)&&wY(i.extent)&&i.extent;(o||a)&&n.set("selectionExtent",null!=o?o:a,!0)}(e,n),e.component.data.isFaceted){let t=e;for(;!w0(t)&&t.parent;)t=t.parent;if("shared"===t.component.resolve.scale[n])for(const e of r.value)gX(e)&&(e.data=VZ+e.data.replace(VZ,""))}})}(e):function(e){for(const t of e.children)QZ(t);const t=e.component.scales;qU(t).forEach(n=>{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"):RQ(r,e.getWithExplicit("domains"),"domains","scale",n0);const t=e.get("selectionExtent");i&&t&&i.selection!==t.selection&&aH("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 ZZ(e,t,n,r){const i=n.fieldDef(r);if(t&&"unaggregated"!==t&&!tV(t)){const{type:e,timeUnit:n}=i;return NQ("temporal"===e||n?function(e,t,n){return e.map(e=>({signal:`{data: ${pY(e,{timeUnit:n,type:t})}}`}))}(t,e,n):[t])}const o=n.stack;if(o&&r===o.fieldChannel){if("normalize"===o.offset)return MQ([[0,1]]);const e=n.requestDataName(XG);return MQ([{data:e,field:n.vgField(r,{suffix:"start"})},{data:e,field:n.vgField(r,{suffix:"end"})}])}const a=Fq(r)?function(e,t,n){if(!JH(n))return;const r=e.fieldDef(t),i=r.sort;if(BV(i))return{op:"min",field:lQ(r,t),order:"ascending"};const o=null!==e.stack;if(MV(i))return e0(i,o);if(NV(i)){const{encoding:t,order:n}=i,r=e.fieldDef(t),{aggregate:a,field:u}=r;if(y$(a)||b$(a))return e0({field:JV(r),order:n},o);if(x$(a)||!a)return e0({op:a,field:u,order:n},o)}else{if("descending"===i)return{op:"min",field:e.vgField(t),order:"descending"};if(BU(["ascending",void 0],i))return!0}return}(n,r,e):void 0;if("unaggregated"===t){const e=n.requestDataName(XG),{field:t}=i;return MQ([{data:e,field:JV({field:t,aggregate:"min"})},{data:e,field:JV({field:t,aggregate:"max"})}])}if(yY(i.bin)){if(JH(e))return MQ("bin-ordinal"===e?[]:[{data:HU(a)?n.requestDataName(XG):n.requestDataName("raw"),field:n.vgField(r,gY(i,r)?{binSuffix:"range"}:{}),sort:!0!==a&&QI(a)?a:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:e}=i;if(yY(e)){const t=dZ(n,i.field,e);return MQ([new JZ(()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`})])}return MQ([{data:n.requestDataName(XG),field:n.vgField(r,{})}])}}if(i.timeUnit&&BU(["time","utc"],e)&&UV(r,i,x0(n)?n.encoding[iq(r)]:void 0,n.markDef,n.config)){const e=n.requestDataName(XG);return MQ([{data:e,field:n.vgField(r)},{data:e,field:n.vgField(r,{suffix:"end"})}])}return MQ(a?[{data:HU(a)?n.requestDataName(XG):n.requestDataName("raw"),field:n.vgField(r),sort:a}]:[{data:n.requestDataName(XG),field:n.vgField(r)}])}function e0(e,t){const{op:n,field:r,order:i}=e;return Object.assign(Object.assign({op:null!=n?n:t?"sum":FV},r?{field:JU(r)}:{}),i?{order:i}:{})}function t0(e,t){const{aggregate:n,type:r}=e;return n?ZI(n)&&!A$[n]?{valid:!1,reason:eH.unaggregateDomainWithNonSharedDomainOp(n)}:"quantitative"===r&&"log"===t?{valid:!1,reason:eH.unaggregatedDomainWithLogScale(e)}:{valid:!0}:{valid:!1,reason:eH.unaggregateDomainHasNoEffectForRawField(e)}}function n0(e,t,n,r){return e.explicit&&t.explicit&&aH(eH.mergeConflictingDomainProperty(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function r0(e){if(gX(e)&&ZI(e.field))return e.field;if(function(e){return!JI(e)&&("fields"in e&&!("data"in e))}(e)){let t;for(const n of e.fields)if(gX(n)&&ZI(n.field))if(t){if(t!==n.field)return aH("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 aH("Detected faceted independent scales that union domain of identical fields from different source detected. We will assume that this is the same field from a different fork of the same data source. However, if this is not case, the result view size maybe incorrect."),t}if(function(e){return!JI(e)&&("fields"in e&&"data"in e)}(e)){aH("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 ZI(t)?t:void 0}}function i0(e,t){return function(e){const t=LU(e.map(e=>{if(gX(e)){const{sort:t}=e;return C(e,["sort"])}return e}),NU),n=LU(e.map(e=>{if(gX(e)){const t=e.sort;return void 0===t||HU(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}}).filter(e=>void 0!==e),NU);if(0===t.length)return;if(1===t.length){const t=e[0];if(gX(t)&&n.length>0){let e=n[0];return n.length>1&&(aH(eH.MORE_THAN_ONE_SORT),e=!0),Object.assign(Object.assign({},t),{sort:e})}return t}const r=LU(n.map(e=>HU(e)||!("op"in e)||e.op in v$?e:(aH(eH.domainSortDropped(e)),!0)),NU);let i;1===r.length?i=r[0]:r.length>1&&(aH(eH.MORE_THAN_ONE_SORT),i=!0);const o=LU(e.map(e=>gX(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}:{})}(e.component.scales[t].get("domains").map(t=>(gX(t)&&(t.data=e.lookupDataSource(t.data)),t)))}function o0(e){return qU(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:u,domains:s,range:l}=i,c=C(i,["name","type","selectionExtent","domains","range"]),f=function(e,t,n){if(("x"===n||"y"===n)&&mX(e))return{step:{signal:t+"_step"}};return e}(i.range,o,n);let d;u&&(d=function(e,t){const n=t.selection;return{signal:XJ(e.getSelectionComponent(n,VU(n)),t)}}(e,u));const h=i0(e,n);return t.push(Object.assign(Object.assign(Object.assign(Object.assign({name:o,type:a},h?{domain:h}:{}),d?{domainRaw:d}:{}),{range:f}),c)),t},[])}class a0 extends TQ{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||PU(this.get("domains"),e=>JI(e)&&2===e.length&&e[0]<=0&&e[1]>=0)}}const u0=["range","scheme"];function s0(e){return"x"===e?"width":"y"===e?"height":void 0}function l0(e){const t=e.component.scales;Dq.forEach(n=>{const r=t[n];if(!r)return;const i=function(e,t){const n=t.specifiedScales[e],{size:r}=t,i=t.getScaleComponent(e).get("type");for(const t of u0)if(void 0!==n[t]){const r=lV(i,t),o=cV(e,t);if(r)if(o)aH(o);else switch(t){case"range":return NQ(n[t]);case"scheme":return NQ(f0(n[t]))}else aH(eH.scalePropertyNotWorkWithScaleType(i,t,e))}if(e===C$||e===O$){const t=e===C$?"width":"height",n=r[t];if(lG(n)){if(JH(i))return NQ({step:n.step});aH(eH.stepDropped(t))}}return MQ(function(e,t){const{size:n,config:r,mark:i}=t,o=t.getSignalName.bind(t),{type:a}=t.fieldDef(e),u=t.getScaleComponent(e).get("type"),{domain:s}=t.specifiedScales[e];switch(e){case C$:case O$:{if(BU(["point","band"],u))if(e!==C$||n.width){if(e===O$&&!n.height){const e=hG(r.view,"height");if(lG(e))return e}}else{const e=hG(r.view,"width");if(lG(e))return e}const i=s0(e),a=t.getName(i);return e===O$&&QH(u)?[JZ.fromName(o,a),0]:[0,JZ.fromName(o,a)]}case T$:{const o=t.component.scales[e].get("zero"),a=function(e,t,n){if(t)return 0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(eH.incompatibleChannel("size",e))}(i,o,r),l=function(e,t,n,r){const i={x:c0(n,"x"),y:c0(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const e=d0(t,i,r.view);return gU(e)?e-1:new JZ(()=>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=d0(t,i,r.view);return gU(e)?Math.pow(.95*e,2):new JZ(()=>`pow(0.95 * ${e.signal}, 2)`)}}throw new Error(eH.incompatibleChannel("size",e))}(i,n,t,r);return eV(u)?function(e,t,n){const r=()=>{const r=`(${pX(t)?t.signal:t} - ${e}) / (${n} - 1)`;return`sequence(${e}, ${t} + ${r}, ${r})`};return pX(t)?new JZ(r):{signal:r()}}(a,l,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&&JI(n)?n.length+1:(aH(eH.domainRequiredForThresholdScale(r)),3)}}(u,r,s,e)):[a,l]}case P$:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case j$:return"symbol";case S$:case D$:case F$:return"ordinal"===u?"nominal"===a?"category":"ordinal":"rect"===i||"geoshape"===i?"heatmap":"ramp";case N$:case M$:case B$:return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error("Scale range undefined for channel "+e)}(e,t))}(n,e);r.setWithExplicit("range",i)})}function c0(e,t){const n=e.fieldDef(t);if(n&&n.bin&&yY(n.bin)){const r=dZ(e,n.field,n.bin),i=s0(t),o=e.getName(i);return new JZ(()=>{const t=e.getSignalName(r),n=`(${t}.stop - ${t}.start) / ${t}.step`;return`${e.getSignalName(o)} / (${n})`})}}function f0(e){return function(e){return!ZI(e)&&!!e.name}(e)?Object.assign({scheme:e.name},jU(e,["name"])):{scheme:e}}function d0(e,t,n){const r=lG(e.width)?e.width.step:dG(n,"width"),i=lG(e.height)?e.height.step:dG(n,"height");return t.x||t.y?new JZ(()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`):Math.min(r,i)}function h0(e,t){x0(e)?function(e,t){const n=e.component.scales;qU(n).forEach(r=>{const i=e.specifiedScales[r],o=n[r],a=e.getScaleComponent(r),u=e.fieldDef(r),s=e.config,l=i[t],c=a.get("type"),f=lV(c,t),d=cV(r,t);if(void 0!==l&&(f?d&&aH(d):aH(eH.scalePropertyNotWorkWithScaleType(c,t,r))),f&&void 0===d)if(void 0!==l)o.copyKeyFromObject(t,i);else{const n=function(e,t,n,r,i,o,a,u,s,l){const c=l.scale,{type:f,sort:d}=r;switch(e){case"bins":return function(e,t){const n=t.bin;if(yY(n)){const r=dZ(e,t.field,n);return new JZ(()=>e.getSignalName(r))}if(bY(n)&&xY(n)&&void 0!==n.step)return{step:n.step};return}(t,r);case"interpolate":return function(e,t){if(BU([S$,D$,F$],e)&&"nominal"!==t)return"hcl";return}(n,f);case"nice":return function(e,t,n){if(n.bin||BU([LH.TIME,LH.UTC],e))return;return!!BU([C$,O$],t)||void 0}(i,n,r);case"padding":return function(e,t,n,r,i,o){if(BU([C$,O$],e)){if(ZH(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=i;if("bar"===t&&!r.bin&&!r.timeUnit&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===LH.POINT)return n.pointPadding}return}(n,i,c,r,s,l.bar);case"paddingInner":return function(e,t,n,r){if(void 0!==e)return;if(BU([C$,O$],t)){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:i}=r;return t$(e,"bar"===n?t:i)}return}(o,n,s.type,c);case"paddingOuter":return function(e,t,n,r,i,o){if(void 0!==e)return;if(BU([C$,O$],t)&&n===LH.BAND){const{bandPaddingOuter:e}=o;return t$(e,i/2)}return}(o,n,i,s.type,a,c);case"reverse":return function(e,t){if(QH(e)&&"descending"===t)return!0;return}(i,d);case"zero":return function(e,t,n,r,i){if(n&&"unaggregated"!==n&&QH(i)){if(JI(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&&!eV(i))return!0;if(!t.bin&&BU([C$,O$],e)){const{orient:t,type:n}=r;return!BU(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e)}return!1}(n,r,u,s,i)}return c[e]}(t,e,r,u,a.get("type"),a.get("padding"),a.get("paddingInner"),i.domain,e.markDef,s);void 0!==n&&o.set(t,n,!1)}})}(e,t):m0(e,t)}function p0(e){x0(e)?l0(e):m0(e,"range")}function m0(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?p0(n):h0(n,t);qU(n).forEach(r=>{let i;for(const n of e.children){const e=n.component.scales[r];if(e){i=RQ(i,e.getWithExplicit(t),t,"scale",BQ((e,n)=>{switch(t){case"range":return e.step&&n.step?e.step-n.step:0}return 0}))}}n[r].setWithExplicit(t,i)})}function g0(e,t,n,r){const i=function(e,t,n){switch(t.type){case"nominal":case"ordinal":return U$(e)||"discrete"===Bq(e)?("shape"===e&&"ordinal"===t.type&&aH(eH.discreteChannelCannotEncode(e,"ordinal")),"ordinal"):BU(["x","y"],e)&&BU(["rect","bar","image","rule"],n)?"band":"point";case"temporal":return U$(e)?"time":"discrete"===Bq(e)?(aH(eH.discreteChannelCannotEncode(e,"temporal")),"ordinal"):"time";case"quantitative":return U$(e)?yY(t.bin)?"bin-ordinal":"linear":"discrete"===Bq(e)?(aH(eH.discreteChannelCannotEncode(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(eH.invalidFieldType(t.type))}(t,n,r),{type:o}=e;return Fq(t)?void 0!==o?dV(t,o)?fV(o,n.type)?o:(aH(eH.scaleTypeNotWorkWithFieldDef(o,i)),i):(aH(eH.scaleTypeNotWorkWithChannel(t,o,i)),i):i:null}function v0(e){x0(e)?e.component.scales=function(e){const{encoding:t,mark:n}=e;return Dq.reduce((r,i)=>{let o,a;const u=t[i];if(WV(u)&&"geoshape"===n&&i===j$&&"geojson"===u.type)return r;if(WV(u)?(o=u,a=u.scale):qV(u)&&(o=u.condition,a=u.condition.scale),o&&null!==a&&!1!==a){a=null!=a?a:{};const t=g0(a,i,o,n);r[i]=new a0(e.scaleName(i+"",!0),{value:t,explicit:a.type===t})}return r},{})}(e):e.component.scales=function(e){const t=e.component.scales={},n={},r=e.component.resolve;for(const t of e.children)v0(t),qU(t.component.scales).forEach(i=>{var o;if(r.scale[i]=null!=(o=r.scale[i])?o:FQ(i,e),"shared"===r.scale[i]){const e=n[i],o=t.component.scales[i].getWithExplicit("type");e?$H(e.value,o.value)?n[i]=RQ(e,o,"type","scale",y0):(r.scale[i]="independent",delete n[i]):n[i]=o}});for(const r of qU(n)){const i=e.scaleName(r,!0),o=n[r];t[r]=new a0(i,o);for(const t of e.children){const e=t.component.scales[r];e&&(t.renameScale(e.get("name"),i),e.merged=!0)}}return t}(e)}const y0=BQ((e,t)=>WH(e)-WH(t));class b0{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 x0(e){var t;return"unit"===(null===(t=e)||void 0===t?void 0:t.type)}function w0(e){var t;return"facet"===(null===(t=e)||void 0===t?void 0:t.type)}function E0(e){var t;return"repeat"===(null===(t=e)||void 0===t?void 0:t.type)}function _0(e){var t;return"concat"===(null===(t=e)||void 0===t?void 0:t.type)}function A0(e){var t;return"layer"===(null===(t=e)||void 0===t?void 0:t.type)}class k0{constructor(e,t,n,r,i,o,a,u){var s,l;this.type=t,this.parent=n,this.config=i,this.repeater=o,this.view=u,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.repeater=o,this.name=null!=(s=e.name)?s:r,this.title=mV(e.title)?{text:e.title}:e.title,this.scaleNameMap=n?n.scaleNameMap:new b0,this.projectionNameMap=n?n.projectionNameMap:new b0,this.signalNameMap=n?n.signalNameMap:new b0,this.data=e.data,this.description=e.description,this.transforms=(l=e.transform,(null!=l?l:[]).map(e=>KG(e)?{filter:OU(e.filter,RH)}:e)),this.layout=p$(e)||EG(e)?{}:function(e,t,n){var r,i;const o=n[t],a={},{spacing:u,columns:s}=o;void 0!==u&&(a.spacing=u),void 0!==s&&(RV(e)&&!PV(e.facet)||sG(e)&&JI(e.repeat)||oG(e))&&(a.columns=s);for(const t of cG)if(void 0!==e[t])if("spacing"===t){const n=e[t];a[t]=gU(n)?n:{row:(r=n.row,null!=r?r:u),column:(i=n.column,null!=i?i:u)}}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:RV(e)||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new TQ,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},a?DU(a):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}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}={}){v0(e),QZ(e);for(const t of sV)h0(e,t);t||p0(e)}(this)}parseProjection(){cZ(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){eZ(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)?t:"cell"}assembleEncodeFromView(e){const{style:t}=e,n=C(e,["style"]),r={};for(const e in n)if(pU(n,e)){const t=n[e];void 0!==t&&(r[e]={value:t})}return r}assembleGroupEncodeEntry(e){let t=void 0;return this.view&&(t=this.assembleEncodeFromView(this.view)),e||"unit"!==this.type&&"layer"!==this.type?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=C(e,["spacing"]),{component:r,config:i}=this,o=function(e,t){var n;const r={};for(const i of q$){const o=e[i];if(null===(n=o)||void 0===n?void 0:n.facetFieldDef){const{titleAnchor:e,titleOrient:n}=dQ(["titleAnchor","titleOrient"],o.facetFieldDef,t,i),a=cQ(i,n),u=_Q(e,a);void 0!==u&&(r[a]=u)}}return qU(r).length>0?r:void 0}(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 q$)e[n].title&&t.push(mQ(this,n));for(const e of hQ)t=t.concat(yQ(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:r=[]}=e;return[...n.map(e=>QJ(e,"grid",t)),...r.map(e=>QJ(e,"grid",t)),...n.map(e=>QJ(e,"main",t)),...r.map(e=>QJ(e,"main",t))].filter(e=>e)}(this.component.axes,this.config)}assembleLegends(){return oZ(this)}assembleProjections(){return aZ(this)}assembleTitle(){var e,t,n;const r=null!=(e=this.title)?e:{},{encoding:i}=r,o=C(r,["encoding"]),a=Object.assign(Object.assign(Object.assign({},pV(this.config.title).nonMark),o),i?{encode:{update:i}}:{});if(a.text)return BU(["unit","layer"],this.type)?BU(["middle",void 0],a.anchor)&&(a.frame=null!=(t=a.frame)?t:"group"):a.anchor=null!=(n=a.anchor)?n:"start",qU(a).length>0?a:void 0}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||w0(this.parent)?function e(t){return A0(t)||_0(t)||E0(t)?t.children.reduce((t,n)=>t.concat(e(n)),o0(t)):o0(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}hasDescendantWithFieldOnChannel(e){for(const t of this.children)if(x0(t)){if(t.channelHasField(e))return!0}else if(t.hasDescendantWithFieldOnChannel(e))return!0;return!1}getName(e){return VU((this.name?this.name+"_":"")+e)}requestDataName(e){var t;const n=this.getName(e),r=this.component.data.outputNodeRefCounts;return r[n]=(null!=(t=r[n])?t:0)+1,n}getSizeSignalRef(e){if(w0(this.parent)){const t=yq(e),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),r=n.get("range");if(JH(e)&&mX(r)){const e=n.get("name"),r=r0(i0(this,t));if(r){return{signal:SQ(e,n,JV({aggregate:"distinct",field:r},{expr:"datum"}))}}return aH(`Unknown field for ${t}. Cannot calculate view size.`),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):eq(e)&&Fq(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(eH.selectionNotFound(t));return n}}class C0 extends k0{vgField(e,t={}){const n=this.fieldDef(e);if(n)return JV(n,t)}reduceFieldDef(e,t){return DY(this.getMapping(),(t,n,r)=>{const i=uY(n);return i?e(t,i,r):t},t)}forEachFieldDef(e,t){SY(this.getMapping(),(t,n)=>{const r=uY(t);r&&e(r,n)},t)}}class O0 extends dK{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=DU(t);const o=null!=(n=this.transform.as)?n:[void 0,void 0];this.transform.as=[(r=o[0],null!=r?r:"value"),(i=o[1],null!=i?i:"density")]}clone(){return new O0(null,DU(this.transform))}dependentFields(){var e;return new Set([this.transform.density,...(e=this.transform.groupby,null!=e?e:[])])}producedFields(){return new Set(this.transform.as)}hash(){return"DensityTransform "+NU(this.transform)}assemble(){const e=this.transform,{density:t}=e,n=C(e,["density"]);return Object.assign({type:"kde",field:t},n)}}class S0 extends dK{constructor(e,t){super(e),this.filter=t}clone(){return new S0(null,Object.assign({},this.filter))}static make(e,t){const{config:n,mark:r,markDef:i}=t;if("filter"!==vV("invalid",i,n))return null;const o=t.reduceFieldDef((e,n,i)=>{const o=Fq(i)&&t.getScaleComponent(i);if(o){!QH(o.get("type"))||n.aggregate||a$(r)||(e[n.field]=n)}return e},{});return qU(o).length?new S0(e,o):null}dependentFields(){return new Set(qU(this.filter))}producedFields(){return new Set}hash(){return"FilterInvalid "+NU(this.filter)}assemble(){const e=qU(this.filter).reduce((e,t)=>{const n=this.filter[t],r=JV(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 D0 extends dK{constructor(e,t){super(e),this.transform=t,this.transform=DU(t);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map((e,t)=>{var n;return null!=(n=r[t])?n:e})}clone(){return new D0(this.parent,DU(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return"FlattenTransform "+NU(this.transform)}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class F0 extends dK{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=DU(t);const o=null!=(n=this.transform.as)?n:[void 0,void 0];this.transform.as=[(r=o[0],null!=r?r:"key"),(i=o[1],null!=i?i:"value")]}clone(){return new F0(null,DU(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return"FoldTransform "+NU(this.transform)}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class j0 extends dK{constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}clone(){return new j0(null,DU(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=>t.channelHasField(e)?t.fieldDef(e).field:YV(t.encoding[e])?{expr:t.encoding[e].value+""}:void 0);(i[0]||i[1])&&(e=new j0(e,i,null,t.getName("geojson_"+n++)))}if(t.channelHasField(j$)){const r=t.fieldDef(j$);"geojson"===r.type&&(e=new j0(e,null,r.field,t.getName("geojson_"+n++)))}return e}dependentFields(){var e;const t=(e=this.fields,null!=e?e:[]).filter(ZI);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${NU(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 T0 extends dK{constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}clone(){return new T0(null,this.projection,DU(this.fields),DU(this.as))}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[["longitude","latitude"],["longitude2","latitude2"]]){const r=n.map(e=>t.channelHasField(e)?t.fieldDef(e).field:YV(t.encoding[e])?{expr:t.encoding[e].value+""}:void 0),i="longitude2"===n[0]?"2":"";(r[0]||r[1])&&(e=new T0(e,t.projectionName(),r,[t.getName("x"+i),t.getName("y"+i)]))}return e}dependentFields(){return new Set(this.fields.filter(ZI))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${NU(this.fields)} ${NU(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class N0 extends dK{constructor(e,t){super(e),this.transform=t}clone(){return new N0(null,DU(this.transform))}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...(e=this.transform.groupby,null!=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 N0(e,t)}static makeFromEncoding(e,t){const n=t.encoding,r=n.x,i=n.y;if(WV(r)&&WV(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:u,value:s,frame:l,keyvals:c}=o.impute,f=FY(t.mark,n);return new N0(e,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:a.field},u?{method:u}:{}),void 0!==s?{value:s}:{}),l?{frame:l}:{}),void 0!==c?{keyvals:c}:{}),f.length?{groupby:f}:{}))}return null}hash(){return"Impute "+NU(this.transform)}assemble(){const{impute:e,key:t,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,u=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:e,key:t},n?{keyvals:(s=n,void 0!==(null===(l=s)||void 0===l?void 0:l.stop)?this.processSequence(n):n)}:{}),{method:"value"}),i?{groupby:i}:{}),{value:null});var s,l;let c;if(r&&"value"!==r){c=[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}]}else{c=[{type:"formula",expr:`datum.${e} === null ? ${o} : datum.${e}`,as:e}]}return[u,...c]}}class M0 extends TQ{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}}class B0 extends dK{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=DU(t);const o=null!=(n=this.transform.as)?n:[void 0,void 0];this.transform.as=[(r=o[0],null!=r?r:t.on),(i=o[1],null!=i?i:t.loess)]}clone(){return new B0(null,DU(this.transform))}dependentFields(){var e;return new Set([this.transform.loess,this.transform.on,...(e=this.transform.groupby,null!=e?e:[])])}producedFields(){return new Set(this.transform.as)}hash(){return"LoessTransform "+NU(this.transform)}assemble(){const e=this.transform,{loess:t,on:n}=e,r=C(e,["loess","on"]);return Object.assign({type:"loess",x:n,y:t},r)}}class P0 extends dK{constructor(e,t,n){super(e),this.transform=t,this.secondary=n}clone(){return new P0(null,DU(this.transform),this.secondary)}static make(e,t,n,r){var i;const o=t.component.data.sources,{from:a}=n;let u=null;if(function(e){return void 0!==e.data}(a)){let e=r1(a.data,o);e||(e=new mZ(a.data),o.push(e));const n=t.getName("lookup_"+r);u=new hK(e,n,"lookup",t.component.data.outputNodeRefCounts),t.component.data.outputNodes[n]=u}else if(function(e){return void 0!==e.selection}(a)){const e=a.selection;if(n.as=null!=(i=n.as)?i:e,u=t.getSelectionComponent(VU(e),e).materialized,!u)throw new Error(eH.noSameUnitLookup(e))}return new P0(e,n,u.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?fU(this.transform.as):this.transform.from.fields)}hash(){return"Lookup "+NU({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:fU(this.transform.as)}:{});else{let t=this.transform.as;ZI(t)||(aH(eH.NO_FIELDS_NEEDS_AS),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 R0 extends dK{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=DU(t);const o=null!=(n=this.transform.as)?n:[void 0,void 0];this.transform.as=[(r=o[0],null!=r?r:"prob"),(i=o[1],null!=i?i:"value")]}clone(){return new R0(null,DU(this.transform))}dependentFields(){var e;return new Set([this.transform.quantile,...(e=this.transform.groupby,null!=e?e:[])])}producedFields(){return new Set(this.transform.as)}hash(){return"QuantileTransform "+NU(this.transform)}assemble(){const e=this.transform,{quantile:t}=e,n=C(e,["quantile"]);return Object.assign({type:"quantile",field:t},n)}}class z0 extends dK{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=DU(t);const o=null!=(n=this.transform.as)?n:[void 0,void 0];this.transform.as=[(r=o[0],null!=r?r:t.on),(i=o[1],null!=i?i:t.regression)]}clone(){return new z0(null,DU(this.transform))}dependentFields(){var e;return new Set([this.transform.regression,this.transform.on,...(e=this.transform.groupby,null!=e?e:[])])}producedFields(){return new Set(this.transform.as)}hash(){return"RegressionTransform "+NU(this.transform)}assemble(){const e=this.transform,{regression:t,on:n}=e,r=C(e,["regression","on"]);return Object.assign({type:"regression",x:n,y:t},r)}}class L0 extends dK{constructor(e,t){super(e),this.transform=t}clone(){return new L0(null,DU(this.transform))}addDimensions(e){var t;this.transform.groupby=LU((t=this.transform.groupby,null!=t?t:[]).concat(e),e=>e)}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...(e=this.transform.groupby,null!=e?e:[])])}hash(){return"PivotTransform "+NU(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 I0 extends dK{constructor(e,t){super(e),this.transform=t}clone(){return new I0(null,DU(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return"SampleTransform "+NU(this.transform)}assemble(){return{type:"sample",size:this.transform.sample}}}function U0(e){let t=0;return function n(r,i){var o;if(r instanceof mZ&&!r.isGenerator&&!$G(r.data)){e.push(i);i={name:null,source:i.name,transform:[]}}if(r instanceof DZ&&(r.parent instanceof mZ&&!i.source?(i.format=Object.assign(Object.assign({},null!=(o=i.format)?o:{}),{parse:r.assembleFormatParse()}),i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof kZ)return i.name||(i.name="data_"+t++),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source,void r.assemble().forEach(t=>e.push(t));if((r instanceof vZ||r instanceof yZ||r instanceof S0||r instanceof YJ||r instanceof sQ||r instanceof T0||r instanceof j0||r instanceof AZ||r instanceof P0||r instanceof TZ||r instanceof FZ||r instanceof F0||r instanceof D0||r instanceof O0||r instanceof B0||r instanceof R0||r instanceof z0||r instanceof NZ||r instanceof I0||r instanceof L0)&&i.transform.push(r.assemble()),(r instanceof pZ||r instanceof pK||r instanceof N0||r instanceof jZ)&&i.transform.push(...r.assemble()),r instanceof hK)if(i.source&&0===i.transform.length)r.setSource(i.source);else if(r.parent instanceof hK)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 hK&&(!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,r.children.forEach(e=>{n(e,{name:null,source:o,transform:[]})});break}}}}function $0(e,t){var n;if(e.channelHasField(t)){const r=e.facet[t],i=fQ("title",null,e.config,t);let o=rY(r,e.config,{allowDisabling:!0,includeDefault:void 0===i||!!i});e.child.component.layoutHeaders[t].title&&(o=JI(o)?o.join(", "):o,o+=" / "+e.child.component.layoutHeaders[t].title,e.child.component.layoutHeaders[t].title=null);const a=fQ("labelOrient",r,e.config,t),u=t$((null!=(n=r.header)?n:{}).labels,!0),s=BU(["bottom","right"],a)?"footer":"header";e.component.layoutHeaders[t]={title:o,facetFieldDef:r,[s]:"facet"===t?[]:[q0(e,t,u)]}}}function q0(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 W0(e,t){var n;const{child:r}=e;if(r.component.axes[t]){const{layoutHeaders:o,resolve:a}=e.component;if(a.axis[t]=jQ(a,t),"shared"===a.axis[t]){const a="x"===t?"column":"row",u=o[a];for(const o of r.component.axes[t]){const t="top"===(i=o.get("orient"))||"left"===i?"header":"footer";u[t]=null!=(n=u[t])?n:[q0(e,a,!1)];const r=QJ(o,"main",e.config,{header:!0});u[t][0].axes.push(r),o.mainExtracted=!0}}}var i}function H0(e){G0(e);const t=e.component.layoutSize;t.setWithExplicit("width",X0(e,"width")),t.setWithExplicit("height",X0(e,"height"))}const V0=H0,Y0={vconcat:"width",hconcat:"height"};function G0(e){for(const t of e.children)t.parseLayoutSize()}function X0(e,t){const n="width"===t?"x":"y",r=e.component.resolve;let i;for(const o of e.children){const e=o.component.layoutSize.getWithExplicit(t),a=r.scale[n];if("independent"===a&&"step"===e.value){i=void 0;break}if(i){if("independent"===a&&i.value!==e.value){i=void 0;break}i=RQ(i,e,t,"")}else i=e}if(i){for(const n of e.children)e.renameSignal(n.getName(t),e.getName(t)),n.component.layoutSize.set(t,"merged",!1);return i}return{explicit:!1,value:void 0}}function K0(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(JH(e)){const e=hG(r.view,t);return mX(n)||lG(e)?"step":e}return fG(r.view,t)}if(e.hasProjection)return fG(r.view,t);{const e=hG(r.view,t);return lG(e)?e.step:e}}function J0(e,t){return function(e){return e&&!ZI(e)&&"repeat"in e}(e.field)?e.field.repeat in t?Object.assign(Object.assign({},e),{field:t[e.field.repeat]}):void aH(eH.noSuchRepeatedValue(e.field.repeat)):e}function Q0(e,t){if(void 0!==(e=J0(e,t))){if(null===e)return null;if(LV(e)&&MV(e.sort)){const n=J0(e.sort,t);e=Object.assign(Object.assign({},e),n?{sort:n}:{})}return e}}function Z0(e,t){if(!WV(e)){if(qV(e)){const n=Q0(e.condition,t);if(n)return Object.assign(Object.assign({},e),{condition:n});{const{condition:t}=e;return C(e,["condition"])}}return e}{const n=Q0(e,t);if(n)return n;if($V(e))return{condition:e.condition}}}function e1(e,t){const n={};for(const r in e)if(pU(e,r)){const i=e[r];if(JI(i))n[r]=i.map(e=>Z0(e,t)).filter(e=>e);else{const e=Z0(i,t);void 0!==e&&(n[r]=e)}}return n}function t1(e,t,n){return JV(t,Object.assign({suffix:"by_"+JV(e)},null!=n?n:{}))}class n1 extends C0{constructor(e,t,n,r,i){super(e,"facet",t,n,i,r,e.resolve),this.child=k1(e.spec,this,this.getName("child"),void 0,r,i),this.children=[this.child];const o=function(e,t){return PV(e)?e1(e,t):Q0(e,t)}(e.facet,r);this.facet=this.initFacet(o)}initFacet(e){return PV(e)?DY(e,(e,t,n)=>BU([k$,"column"],n)?void 0===t.field?(aH(eH.emptyFieldDef(t,n)),e):(e[n]=lY(t,n),e):(aH(eH.incompatibleChannel(n,"facet")),e),{}):{facet:lY(e,"facet")}}channelHasField(e){return!!this.facet[e]}fieldDef(e){return this.facet[e]}parseData(){this.component.data=o1(this),this.child.parseData()}parseLayoutSize(){G0(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 q$)$0(e,t);W0(e,"x"),W0(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,r;const i={};for(const o of q$)for(const a of pQ){const u=this.component.layoutHeaders[o],s=u[a],{facetFieldDef:l}=u;if(l){const t=fQ("titleOrient",l,this.config,o);if(BU(["right","bottom"],t)){const n=cQ(o,t);i.titleAnchor=null!=(e=i.titleAnchor)?e:{},i.titleAnchor[n]="end"}}if(null===(t=s)||void 0===t?void 0:t[0]){const e="row"===o?"height":"width",t="header"===a?"headerBand":"footerBand";"facet"===o||this.child.component.layoutSize.get(e)||(i[t]=null!=(n=i[t])?n:{},i[t][o]=.5),u.title&&(i.offset=null!=(r=i.offset)?r:{},i.offset["row"===o?"rowTitle":"columnTitle"]=10)}}return i}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 n1)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroup(e){return this.parent&&this.parent instanceof n1?Object.assign(Object.assign({},this.channelHasField("column")?{encode:{update:{columns:{field:JV(this.facet.column,{prefix:"distinct"})}}}}:{}),super.assembleGroup(e)):super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],n=[];if(this.child instanceof n1){if(this.child.channelHasField("column")){const r=JV(this.child.facet.column);e.push(r),t.push("distinct"),n.push("distinct_"+r)}}else for(const r of["x","y"]){const i=this.child.component.scales[r];if(i&&!i.merged){const o=i.get("type"),a=i.get("range");if(JH(o)&&mX(a)){const i=r0(i0(this.child,r));i?(e.push(i),t.push("distinct"),n.push("distinct_"+i)):aH(`Unknown field for ${r}. Cannot calculate view size.`)}}}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(),u=[];for(const e of q$){const t=this.facet[e];if(t){u.push(JV(t));const{bin:s,sort:l}=t;if(yY(s)&&u.push(JV(t,{binSuffix:"end"})),MV(l)){const{field:e,op:u=FV}=l,s=t1(t,l);n&&r?(i.push(s),o.push("max"),a.push(s)):(i.push(e),o.push(u),a.push(s))}else if(JI(l)){const n=lQ(t,e);i.push(n),o.push("max"),a.push(n)}}}const s=!!n&&!!r;return Object.assign({name:e,data:t,groupby:u},s||i.length>0?{aggregate:Object.assign(Object.assign({},s?{cross:s}:{}),i.length?{fields:i,ops:o,as:a}:{})}:{})}facetSortFields(e){const{facet:t}=this,n=t[e];return n?MV(n.sort)?[t1(n,n.sort,{expr:"datum"})]:JI(n.sort)?[lQ(n,e,{expr:"datum"})]:[JV(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(MV(e)?e.order:!JI(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){const{facet:e,config:t}=this;if(e.facet)return xQ(e.facet,"facet",t);const n={row:["top","bottom"],column:["left","right"]};for(const r of hQ)if(e[r]){const i=fQ("labelOrient",e[r],t,r);if(BU(n[r],i))return xQ(e[r],r,t)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=U0(t);return e.children.forEach(t=>n(t,{source:e.name,name:null,transform:[]})),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:q$.map(e=>this.facetSortFields(e)).flat(),order:q$.map(e=>this.facetSortOrder(e)).flat()}}),t.length>0?{data:t}:{}),n?{encode:{update:n}}:{}),e.assembleGroup(function(e,t){if(e.component.selection&&qU(e.component.selection).length){const n=eU(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:CX("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return TK(t)}(this,[])))]}getMapping(){return this.facet}}function r1(e,t){var n,r,i,o,a,u,s,l,c,f;for(const d of t){const t=d.data;if((!e.name||!d.hasName()||e.name===d.dataName)&&!((null===(n=e.format)||void 0===n?void 0:n.mesh)&&(null===(r=t.format)||void 0===r?void 0:r.feature)||((null===(i=e.format)||void 0===i?void 0:i.feature)||(null===(o=t.format)||void 0===o?void 0:o.feature))&&(null===(a=e.format)||void 0===a?void 0:a.feature)!==(null===(u=t.format)||void 0===u?void 0:u.feature)||((null===(s=e.format)||void 0===s?void 0:s.mesh)||(null===(l=t.format)||void 0===l?void 0:l.mesh))&&(null===(c=e.format)||void 0===c?void 0:c.mesh)!==(null===(f=t.format)||void 0===f?void 0:f.mesh)))if(qG(e)&&qG(t)){if(SU(e.values,t.values))return d}else if($G(e)&&$G(t)){if(e.url===t.url)return d}else if(WG(e)&&e.name===d.dataName)return d}return null}function i1(e,t){if(e.data||!e.parent){if(null===e.data){const e=new mZ([]);return t.push(e),e}const n=r1(e.data,t);if(n)return HG(e.data)||(n.data.format=function(e,...t){for(const n of t)zU(e,null!=n?n:{});return e}({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new mZ(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function o1(e){var t,n,r,i,o,a,u,s,l,c,f;let d=i1(e,e.component.data.sources);const{outputNodes:h,outputNodeRefCounts:p}=e.component.data,m=e.parent?e.parent.component.data.ancestorParse.clone():new M0,g=e.data;HG(g)?(VG(g)?d=new yZ(d,g.sequence):GG(g)&&(d=new vZ(d,g.graticule)),m.parseNothing=!0):null===(null===(n=null===(t=g)||void 0===t?void 0:t.format)||void 0===n?void 0:n.parse)&&(m.parseNothing=!0),d=null!=(r=DZ.makeExplicit(d,e,m))?r:d,d=new NZ(d);const v=e.parent&&A0(e.parent);(x0(e)||w0(e))&&v&&(d=null!=(i=pZ.makeFromEncoding(d,e))?i:d),e.transforms.length>0&&(d=function(e,t,n){var r,i;let o=0;for(const a of t.transforms){let u,s=void 0;if(uX(a))u=e=new sQ(e,a),s="derived";else if(KG(a)){const i=OZ(a);u=e=null!=(r=DZ.makeWithAncestors(e,{},i,n))?r:e,e=new YJ(e,t,a.filter)}else if(sX(a))u=e=pZ.makeFromTransform(e,a,t),s="number";else if(cX(a)){s="date";void 0===n.getWithExplicit(a.field).value&&(e=new DZ(e,{[a.field]:s}),n.set(a.field,s,!1)),u=e=pK.makeFromTransform(e,a)}else if(fX(a))u=e=AZ.makeFromTransform(e,a),s="number",VK(t)&&(e=new NZ(e));else if(JG(a))u=e=P0.make(e,t,a,o++),s="derived";else if(iX(a))u=e=new TZ(e,a),s="number";else if(oX(a))u=e=new FZ(e,a),s="number";else if(dX(a))u=e=jZ.makeFromTransform(e,a),s="derived";else if(hX(a))u=e=new F0(e,a),s="derived";else if(aX(a))u=e=new D0(e,a),s="derived";else if(QG(a))u=e=new L0(e,a),s="derived";else if(rX(a))e=new I0(e,a);else if(lX(a))u=e=N0.makeFromTransform(e,a),s="derived";else if(ZG(a))u=e=new O0(e,a),s="derived";else if(eX(a))u=e=new R0(e,a),s="derived";else if(tX(a))u=e=new z0(e,a),s="derived";else{if(!nX(a)){aH(eH.invalidTransformIgnored(a));continue}u=e=new B0(e,a),s="derived"}if(u&&void 0!==s)for(const e of null!=(i=u.producedFields())?i:[])n.set(e,s,!1)}return e}(d,e,m));const y=function(e){const t={};if(x0(e)&&e.component.selection)for(const n of qU(e.component.selection)){const r=e.component.selection[n];for(const e of r.project.items)!e.channel&&e$(e.field)>1&&(t[e.field]="flatten")}return t}(e),b=SZ(e);d=null!=(o=DZ.makeWithAncestors(d,{},Object.assign(Object.assign({},y),b),m))?o:d,x0(e)&&(d=j0.parseAll(d,e),d=T0.parseAll(d,e)),(x0(e)||w0(e))&&(v||(d=null!=(a=pZ.makeFromEncoding(d,e))?a:d),d=null!=(u=pK.makeFromEncoding(d,e))?u:d,d=sQ.parseAllForSortIndex(d,e));const x=e.getName("raw"),w=new hK(d,x,"raw",p);if(h[x]=w,d=w,x0(e)){const t=AZ.makeFromEncoding(d,e);t&&(d=t,VK(e)&&(d=new NZ(d))),d=null!=(s=N0.makeFromEncoding(d,e))?s:d,d=null!=(l=jZ.makeFromEncoding(d,e))?l:d}x0(e)&&(d=null!=(c=S0.make(d,e))?c:d);const E=e.getName(XG),_=new hK(d,E,XG,p);h[E]=_,d=_,x0(e)&&function(e,t){WK(e,n=>{const r=n.name,i=e.getName("lookup_"+r);e.component.data.outputNodes[i]=n.materialized=new hK(new YJ(t,e,{selection:r}),i,"lookup",e.component.data.outputNodeRefCounts)})}(e,_);let A=null;if(w0(e)){const t=e.getName("facet");d=sQ.parseAllForSortIndex(d,e),d=null!=(f=function(e,t){const{row:n,column:r}=t;if(n&&r){let t=null;for(const i of[n,r])if(MV(i.sort)){const{field:n,op:r=FV}=i.sort;e=t=new FZ(e,{joinaggregate:[{op:r,field:n,as:t1(i,i.sort,{forAs:!0})}],groupby:[JV(i)]})}return t}return null}(d,e.facet))?f:d,A=new kZ(d,e,t,_.getSource()),h[t]=A,d=A}return Object.assign(Object.assign({},e.component.data),{outputNodes:h,outputNodeRefCounts:p,raw:w,main:_,facetRoot:A,ancestorParse:m})}class a1 extends k0{constructor(e,t,n,r,i,o,a){super(e,t,n,r,i,o,a)}parseData(){this.component.data=o1(this),this.children.forEach(e=>{e.parseData()})}parseSelections(){this.component.selection={};for(const e of this.children)e.parseSelections(),qU(e.component.selection).forEach(t=>{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()}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){return this.children.reduce((e,t)=>[...e,...t.assembleLayoutSignals()],kQ(this))}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())})}}class u1 extends a1{constructor(e,t,n,r,i){var o,a,u,s;super(e,"concat",t,n,i,r,e.resolve),"shared"!==(null===(a=null===(o=e.resolve)||void 0===o?void 0:o.axis)||void 0===a?void 0:a.x)&&"shared"!==(null===(s=null===(u=e.resolve)||void 0===u?void 0:u.axis)||void 0===s?void 0:s.y)||aH(eH.CONCAT_CANNOT_SHARE_AXIS),this.concatType=aG(e)?"vconcat":uG(e)?"hconcat":"concat",this.children=this.getChildren(e).map((e,t)=>k1(e,this,this.getName("concat_"+t),void 0,r,i))}getChildren(e){return aG(e)?e.vconcat:uG(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){G0(e);const t=e.component.layoutSize,n=Y0[e.concatType];n&&t.setWithExplicit(n,X0(e,n))}(this)}parseAxisGroup(){return null}assembleDefaultLayout(){return Object.assign(Object.assign({},"vconcat"===this.concatType?{columns:1}:{}),{bounds:"full",align:"each"})}}const s1=Object.assign(Object.assign({gridScale:1,scale:1},EX),{labelExpr:1,encode:1}),l1=qU(s1);class c1 extends TQ{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new c1(DU(this.explicit),DU(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}}const f1={bottom:"top",top:"bottom",left:"right",right:"left"};function d1(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 DV(e,t);case"gridScale":return{explicit:e.explicit,value:t$(e.value,t.value)}}return PQ(e,t,n,"axis")});e.setWithExplicit(n,r)}return e}function p1(e,t){const n="x"===t?"x2":"y2",r=e.fieldDef(t),i=e.fieldDef(n),o=r?r.title:void 0,a=i?i.title:void 0;return o&&a?SV(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}function m1(e,t){var n;const r=t.axis(e),i=new c1;l1.forEach(n=>{const o=function(e,t,n,r){const i=r.fieldDef(n),o=function(e,t,n,r){if(void 0!==t.labelAngle)return i$(t.labelAngle);{const t=iQ("labelAngle",e.config,n,uQ(n),e.getScaleComponent(n).get("type"));return void 0!==t?i$(t):n===C$&&BU(["nominal","ordinal"],r.type)?270:void 0}}(r,t,n,i),a=t$(t.orient,uQ(n)),{mark:u,config:s}=r;switch(e){case"scale":return r.scaleName(n);case"gridScale":return function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}(r,n);case"format":if(hY(i))return;return wV(i,t.format,s);case"formatType":if(hY(i))return;return t.formatType;case"grid":if(bY(r.fieldDef(n).bin))return!1;{const e=r.getScaleComponent(n).get("type");return t$(t.grid,function(e,t){return!JH(e)&&!yY(t.bin)}(e,i))}case"labelAlign":return t$(t.labelAlign,aQ(o,a));case"labelAngle":return o;case"labelBaseline":return t$(t.labelBaseline,oQ(o,a));case"labelFlush":return t$(t.labelFlush,function(e,t){if("x"===t&&BU(["quantitative","temporal"],e.type))return!0}(i,n));case"labelOverlap":{const e=r.getScaleComponent(n).get("type");return t$(t.labelOverlap,function(e,t){if("nominal"!==e.type)return"log"!==t||"greedy"}(i,e))}case"orient":return a;case"tickCount":{const e=r.getScaleComponent(n).get("type"),o="x"===n?"width":"y"===n?"height":void 0,a=o?r.getSizeSignalRef(o):void 0;return t$(t.tickCount,function({fieldDef:e,scaleType:t,size:n}){if(!JH(t)&&"log"!==t&&!BU(["month","hours","day","quarter"],e.timeUnit))return yY(e.bin)?{signal:`ceil(${n.signal}/10)`}:{signal:`ceil(${n.signal}/40)`}}({fieldDef:i,scaleType:e,size:a}))}case"title":{const e="x"===n?"x2":"y2",o=r.fieldDef(e);return t$(t.title,p1(r,n),OV([zV(i)],o?[zV(o)]:[]))}case"values":return function(e,t,n){const r=e.values;if(r)return mY(n,r)}(t,0,i);case"zindex":return t$(t.zindex,function(e,t){return"rect"===e&&QV(t)?1:0}(u,i))}return l=e,_X[l]?t[e]:void 0;var l}(n,r,e,t);if(void 0!==o){const a=function(e,t,n,r,i){switch(t){case"titleAngle":case"labelAngle":return e===i$(n[t]);case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===p1(r,i))return!0}return e===n[t]}(o,n,r,t,e),u=iQ(n,t.config,e,i.get("orient"),t.getScaleComponent(e).get("type"));a||void 0===u?i.set(n,o,a):BU(["grid","orient"],n)&&u&&i.set(n,u,!1)}});const o=null!=(n=r.encoding)?n:{},a=xX.reduce((n,r)=>{var a;if(!i.hasAxisPart(r))return n;const u=DQ(null!=(a=o[r])?a:{},t),s="labels"===r?function(e,t,n){var r;const i=null!=(r=e.fieldDef(t))?r:"x"===t?e.fieldDef("x2"):"y"===t?e.fieldDef("y2"):void 0,o=e.axis(t);let a={};if(hY(i)){const n=e.getScaleComponent(t).get("type")===LH.UTC,r=kV("datum.value",i.timeUnit,o.format,null,n);r&&(a.text={signal:r})}return a=Object.assign(Object.assign({},a),n),0===qU(a).length?void 0:a}(t,e,u):u;return void 0!==s&&qU(s).length>0&&(n[r]={update:s}),n},{});return qU(a).length>0&&i.set("encode",a,!!r.encoding||void 0!==r.labelAngle),i}function g1(e,t,n,{graticule:r}){var i,o;const a=l$(e)?Object.assign({},e):{type:e},u=null!=(i=a.orient)?i:yV("orient",a,n);a.orient=function(e,t,n){switch(e){case"point":case"circle":case"square":case"text":case"rect":case"image":return}const{x:r,y:i,x2:o,y2:a}=t;switch(e){case"bar":if(WV(r)&&(bY(r.bin)||WV(i)&&i.aggregate&&!r.aggregate))return"vertical";if(WV(i)&&(bY(i.bin)||WV(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o&&WV(r)&&"quantitative"===r.type&&!yY(r.bin))return"horizontal";if(!a&&WV(i)&&"quantitative"===i.type&&!yY(i.bin))return"vertical"}case"rule":if(o&&a)return;case"area":if(a)return WV(i)&&bY(i.bin)?"horizontal":"vertical";if(o)return WV(r)&&bY(r.bin)?"vertical":"horizontal";if("rule"===e){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case"line":case"tick":{const t=WV(r)&&ZV(r),o=WV(i)&&ZV(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="temporal"===t.type,u="temporal"===o.type;return a&&!u?"tick"!==e?"vertical":"horizontal":!a&&u?"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"}(a.type,t,u),void 0!==u&&u!==a.orient&&aH(eH.orientOverridden(a.orient,u));void 0===t$(a.opacity,yV("opacity",a,n))&&(a.opacity=function(e,t){if(BU(["point","tick","circle","square"],e)&&!AY(t))return.7;return}(a.type,t));void 0===a.filled&&(a.filled=!r&&function(e,t){const n=yV("filled",e,t),r=e.type;return t$(n,"point"!==r&&"line"!==r&&"rule"!==r)}(a,n));return void 0===(null!=(o=a.cursor)?o:yV("cursor",a,n))&&(a.cursor=function(e,t,n){if(t.href||e.href||yV("href",e,n))return"pointer";return e.cursor}(a,t,n)),a}function v1(e,t){const{config:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},uK(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore"})),XX("x",e,{defaultPos:"mid"})),XX("y",e,{defaultPos:"mid"})),$X("size",e)),function(e,t,n){if(n)return{shape:{value:n}};return $X("shape",e)}(e,0,t))}function y1(e){const{config:t,markDef:n}=e,{orient:r}=n,i="horizontal"===r?"width":"height",o=e.getScaleComponent("horizontal"===r?"x":"y"),a=t$(n[i],n.size,yV("size",n,t,{vgChannel:i}),t.tick.bandSize);if(void 0!==a)return a;{const e=o?o.get("range"):void 0;if(e&&mX(e)&&gU(e.step))return 3*e.step/4;return 3*dG(t.view,i)/4}}const b1={area:{vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},uK(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore"})),eK("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient})),eK("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient})),lK(e))},bar:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},uK(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore"})),rK(e,"x","bar")),rK(e,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:e=>v1(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>Object.assign({},uK(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore"})),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[Object.assign({type:"geoshape",projection:e.projectionName()},n&&WV(n)&&"geojson"===n.type?{field:JV(n,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},uK(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore"})),rK(e,"x","image")),rK(e,"y","image")),WX(e,"url"))},line:{vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},uK(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore"})),XX("x",e,{defaultPos:"mid"})),XX("y",e,{defaultPos:"mid"})),$X("size",e,{vgChannel:"strokeWidth"})),lK(e))},point:{vgMark:"symbol",encodeEntry:e=>v1(e)},rect:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},uK(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore"})),rK(e,"x","rect")),rK(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({},uK(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore"})),eK("x",e,{defaultPos:"horizontal"===n?"zeroOrMin":"mid",defaultPos2:"zeroOrMax",range:"vertical"!==n})),eK("y",e,{defaultPos:"vertical"===n?"zeroOrMin":"mid",defaultPos2:"zeroOrMax",range:"horizontal"!==n})),$X("size",e,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:e=>v1(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({},uK(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore"})),XX("x",e,{defaultPos:"mid"})),XX("y",e,{defaultPos:"mid"})),WX(e)),$X("size",e,{vgChannel:"fontSize"})),cK("align",function(e,t,n){var r;if(void 0===(null!==(r=e.align)&&void 0!==r?r:yV("align",e,n)))return"center";return}(e.markDef,0,t))),cK("baseline",function(e,t,n){var r;if(void 0===(null!==(r=e.baseline)&&void 0!==r?r:yV("baseline",e,n)))return"middle";return}(e.markDef,0,t)))}},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({},uK(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore"})),XX("x",e,{defaultPos:"mid",vgChannel:"xc"})),XX("y",e,{defaultPos:"mid",vgChannel:"yc"})),$X("size",e,{defaultValue:y1(e),vgChannel:i})),{[o]:{value:t$(n.thickness,t.tick.thickness)}})}},trail:{vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},uK(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore"})),XX("x",e,{defaultPos:"mid"})),XX("y",e,{defaultPos:"mid"})),$X("size",e)),lK(e))}};function x1(e){return BU(["line","area","trail"],e.mark)?function(e){const t=FY(e.mark,e.encoding),n=w1(e,{fromPrefix:t.length>0?"faceted_path_":""});return t.length>0?[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:"faceted_path_"+e.requestDataName(XG),data:e.requestDataName(XG),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:n}]:n}(e):BU(["bar"],e.mark)?function(e){var t;const n=yX.some(t=>e.markDef[t]||yV(t,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&n){const[n]=w1(e,{fromPrefix:"stack_group_"}),r=e.scaleName(e.stack.fieldChannel),i=(t={})=>e.vgField(e.stack.fieldChannel,t),o=(e,t)=>`${e}(${[i({prefix:"min",suffix:"start",expr:t}),i({prefix:"max",suffix:"start",expr:t}),i({prefix:"min",suffix:"end",expr:t}),i({prefix:"max",suffix:"end",expr:t})].map(e=>`scale('${r}',${e})`).join(",")})`;let a,u;"x"===e.stack.fieldChannel?(a=Object.assign(Object.assign({},FU(n.encode.update,["y","yc","y2","height",...yX])),{x:{signal:o("min","datum")},x2:{signal:o("max","datum")},clip:{value:!0}}),u={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},n.encode.update=Object.assign(Object.assign({},jU(n.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(a=Object.assign(Object.assign({},FU(n.encode.update,["x","xc","x2","width"])),{y:{signal:o("min","datum")},y2:{signal:o("max","datum")},clip:{value:!0}}),u={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},n.encode.update=Object.assign(Object.assign({},jU(n.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const t of yX){const r=yV(t,e.markDef,e.config);n.encode.update[t]?(a[t]=n.encode.update[t],delete n.encode.update[t]):r&&(a[t]={value:r}),r&&(n.encode.update[t]={value:0})}const s=e.vgField(e.stack.groupbyChannel)?[e.vgField(e.stack.groupbyChannel)]:[];(null===(t=e.fieldDef(e.stack.groupbyChannel))||void 0===t?void 0:t.bin)&&s.push(e.vgField(e.stack.groupbyChannel,{binSuffix:"end"}));return a=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((t,r)=>{if(n.encode.update[r])return Object.assign(Object.assign({},t),{[r]:n.encode.update[r]});{const n=yV(r,e.markDef,e.config);return void 0!==n?Object.assign(Object.assign({},t),{[r]:{value:n}}):t}},a),a.stroke&&(a.strokeForeground={value:!0},a.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(XG),name:"stack_group_"+e.requestDataName(XG),groupby:s,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:a},marks:[{type:"group",encode:{update:u},marks:[n]}]}]}return w1(e)}(e):w1(e)}function w1(e,t={fromPrefix:""}){const n=e.mark,r=t$(e.markDef.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)),i=gV(e.markDef),o=e.encoding.key,a=function(e){const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,a=t.order;if(!(!JI(a)&&YV(a)&&MU(a.value)||!a&&MU(i.order)||MU(yV("order",i,o)))){if((JI(a)||WV(a))&&!n)return CV(a,{expr:"datum"});if(a$(r)){const n="horizontal"===i.orient?"y":"x",r=t[n];if(WV(r)){const t=r.sort;if(JI(t))return{field:JV(r,{prefix:n,suffix:"sort_index",expr:"datum"})};if(MV(t))return{field:JV({aggregate:AY(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})};if(NV(t)){return{field:JV(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}}return{field:JV(r,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}}}else;}}(e),u=function(e){if(!e.component.selection)return null;const t=qU(e.component.selection).length;let n=t,r=e.parent;for(;r&&0===n;)n=qU(r.component.selection).length,r=r.parent;return n?{interactive:t>0}:null}(e),s=b1[n].postEncodingTransform?b1[n].postEncodingTransform(e):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName("marks"),type:b1[n].vgMark},r?{clip:!0}:{}),i?{style:i}:{}),o?{key:o.field}:{}),a?{sort:a}:{}),u||{}),{from:{data:t.fromPrefix+e.requestDataName(XG)},encode:{update:b1[n].encodeEntry(e)}}),s?{transform:s}:{})]}class E1 extends C0{constructor(e,t,n,r={},i,o){var a;super(e,"unit",t,n,o,i,void 0,e.view),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[];const u=l$(e.mark)?e.mark.type:e.mark,s=function(e,t){return e1(e,t)}(null!=(a=e.encoding)?a:{},i);this.markDef=g1(e.mark,s,o,{graticule:e.data&&GG(e.data)});const l=this.encoding=CY(s,this.markDef);this.size=function({encoding:e,size:t}){for(const n of gq){const r=vq(n),i=uY(e[n]);lG(t[r])&&i&&ZV(i)&&(delete t[r],aH(eH.stepDropped(r)))}return t}({encoding:l,size:Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{})}),this.stack=OG(u,l),this.specifiedScales=this.initScales(u,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegend(l),this.specifiedProjection=e.projection,this.selection=e.selection}get hasProjection(){const{encoding:e}=this,t="geoshape"===this.mark,n=e&&L$.some(t=>WV(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 Dq.reduce((e,n)=>{let r,i;const o=t[n];return WV(o)?(r=o,i=o.scale):qV(o)&&(r=o.condition,i=o.condition.scale),r&&(e[n]=null!=i?i:{}),e},{})}initAxes(e){return[C$,O$].reduce((t,n)=>{const r=e[n];if(WV(r)||n===C$&&WV(e.x2)||n===O$&&WV(e.y2)){const e=WV(r)?r.axis:null;null!==e&&(t[n]=Object.assign({},e))}return t},{})}initLegend(e){return Oq.reduce((t,n)=>{const r=e[n];if(r){const e=WV(r)?r.legend:qV(r)?r.condition.legend:null;null!==e&&!1!==e&&function(e){switch(e){case S$:case D$:case F$:case T$:case j$:case N$:case P$:return!0;case M$:case B$:return!1}}(n)&&(t[n]=Object.assign({},e))}return t},{})}parseData(){this.component.data=o1(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const r of gq){const i=vq(r);if(t[i]){const e=t[i];n.layoutSize.set(i,lG(e)?"step":e,!0)}else{const t=K0(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 in t){if(!pU(t,o))continue;const a=DU(t[o]),u=i[a.type],{fields:s,encodings:l}=u,c=C(u,["fields","encodings"]);for(const e in c)"encodings"===e&&a.fields||"fields"===e&&a.encodings||("mark"===e&&(a[e]=Object.assign(Object.assign({},c[e]),a[e])),void 0!==a[e]&&!0!==a[e]||(a[e]=null!=(n=c[e])?n:a[e]));const f=VU(o),d=r[f]=Object.assign(Object.assign({},a),{name:f,events:ZI(a.on)?CX(a.on,"scope"):DU(a.on)});DK(d,n=>{n.has(d)&&n.parse&&n.parse(e,d,a,t[o])})}return r}(this,this.selection)}parseMarkGroup(){this.component.mark=x1(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,gq.reduce((t,n)=>(e.component.scales[n]&&e.axis(n)&&(t[n]=[m1(n,e)]),t),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;if(WK(e,(r,i)=>{const o=r.name,a=eU(o+LK);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:`${$K}(${a}, ${eU(e)}${n}`})}n=!0,i.topLevelSignals&&(t=i.topLevelSignals(e,r,t)),DK(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 TK(t)}(this,e)}assembleSignals(){return[...ZJ(this),...(e=this,t=[],WK(e,(n,r)=>{const i=n.name;let o=r.modifyExpr(e,n);t.push(...r.signals(e,n)),DK(n,r=>{r.signals&&(t=r.signals(e,n,t)),r.modifyExpr&&(o=r.modifyExpr(e,n,o))}),t.push({name:i+UK,on:[{events:{signal:n.name+IK},update:`modify(${eU(n.name+LK)}, ${o})`}]})}),TK(t))];var e,t}assembleSelectionData(e){return function(e,t){const n=[...t];return WK(e,t=>{const r={name:t.name+LK};if(t.init){const n=t.project.items.map(e=>{const{signals:t}=e;return C(e,["signals"])}),i=t.init.map(e=>FK(e,!1));r.values="interval"===t.type?[{unit:HK(e,{escape:!1}),fields:n,values:i}]:i.map(t=>({unit:HK(e,{escape:!1}),fields:n,values:t}))}n.filter(e=>e.name===t.name+LK).length||n.push(r)}),n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return kQ(this)}assembleMarks(){var e;let t=null!=(e=this.component.mark)?e:[];return this.parent&&A0(this.parent)||(t=jK(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return _Y(this.encoding,e)}fieldDef(e){return sY(this.encoding[e])}}class _1 extends k0{constructor(e,t,n,r,i,o){super(e,"layer",t,n,o,i,e.resolve,e.view);const a=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(EG(e))return new _1(e,this,this.getName("layer_"+t),a,i,o);if(p$(e))return new E1(e,this,this.getName("layer_"+t),a,i,o);throw new Error(eH.invalidSpec(e))})}parseData(){this.component.data=o1(this);for(const e of this.children)e.parseData()}parseLayoutSize(){H0(this)}parseSelections(){this.component.selection={};for(const e of this.children)e.parseSelections(),qU(e.component.selection).forEach(t=>{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 qU(t.component.axes))r.axis[i]=jQ(e.component.resolve,i),"shared"===r.axis[i]&&(n[i]=d1(n[i],t.component.axes[i]),n[i]||(r.axis[i]="independent",delete n[i]))}for(const o of[C$,O$]){for(const a of e.children)if(a.component.axes[o]){if("independent"===r.axis[o]){n[o]=(t=n[o],null!=t?t:[]).concat(a.component.axes[o]);for(const e of a.component.axes[o]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(i[t]>0&&!n){const n=f1[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()),ZJ(this))}assembleLayoutSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleLayoutSignals()),kQ(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)x0(n)&&(t=jK(n,t));return t}(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,t)=>e.concat(t.assembleLegends()),oZ(this))}}class A1 extends a1{constructor(e,t,n,r,i){super(e,"repeat",t,n,i,r,e.resolve),e.resolve&&e.resolve.axis&&("shared"===e.resolve.axis.x||"shared"===e.resolve.axis.y)&&aH(eH.REPEAT_CANNOT_SHARE_AXIS),this.repeat=e.repeat,this.children=this._initChildren(e,this.repeat,r,i)}_initChildren(e,t,n,r){const i=[],o=!JI(t)&&t.row||[n?n.row:null],a=!JI(t)&&t.column||[n?n.column:null],u=JI(t)&&t||[n?n.repeat:null];for(const t of u)for(const n of o)for(const o of a){const a=(t?"__repeat_repeat_"+t:"")+(n?"__repeat_row_"+n:"")+(o?"__repeat_column_"+o:""),u={repeat:t,row:n,column:o};i.push(k1(e.spec,this,this.getName("child"+a),void 0,u,r))}return i}parseLayoutSize(){V0(this)}assembleDefaultLayout(){const{repeat:e}=this,t=JI(e)?void 0:e.column?e.column.length:1;return Object.assign(Object.assign({},t?{columns:t}:{}),{bounds:"full",align:"all"})}}function k1(e,t,n,r,i,o){if(RV(e))return new n1(e,t,n,i,o);if(EG(e))return new _1(e,t,n,r,i,o);if(p$(e))return new E1(e,t,n,r,i,o);if(sG(e))return new A1(e,t,n,i,o);if(function(e){return aG(e)||uG(e)||oG(e)}(e))return new u1(e,t,n,i,o);throw new Error(eH.invalidSpec(e))}function C1(e,t={}){var n;t.logger&&(n=t.logger,iH=n),t.fieldTitle&&nY(t.fieldTitle);try{const n=gG(sU({},t.config,e.config)),r=RG(e,n),i=k1(r,null,"",void 0,void 0,n);i.parse(),function(e,t){gZ(e.sources);let n=0,r=0;for(let r=0;r<5&&KZ(e,t);r++)n++;e.sources.map(LZ);for(let n=0;n<5&&KZ(e,t);n++)r++;gZ(e.sources),5===Math.max(n,r)&&aH("Maximum optimization runs(5) reached.")}(i.component.data,i);return{spec:function(e,t,n={},r){const i=e.config?xG(e.config):void 0,o=[].concat(e.assembleSelectionData([]),function(e,t){var n,r;const i=[],o=U0(i);let a=0;e.sources.forEach(e=>{e.hasName()||(e.dataName="source_"+a++);const t=e.assemble();o(e,t)}),i.forEach(e=>{0===e.transform.length&&delete e.transform});let u=0;for(const[e,t]of i.entries())0!==(n=t.transform,null!=n?n:[]).length||t.source||i.splice(u++,0,i.splice(e,1)[0]);for(const t of i)for(const n of null!=(r=t.transform)?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(),u=e.assembleTitle(),s=e.assembleGroupStyle(),l=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();return c=c.filter(e=>"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)),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}:{}),t),u?{title:u}:{}),s?{style:s}:{}),l?{encode:{update:l}}:{}),{data:o}),a.length>0?{projections:a}:{}),e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([])])),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"}:ZI(t)&&(t={type:t});if(i&&o&&(a=t.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)aH(eH.droppingFit()),t.type="pad";else if("step"===i||"step"===o){const e="step"===i?"width":"height";aH(eH.droppingFit(yq(e)));const n="width"===e?"height":"width";t.type=function(e){return e?"fit-"+yq(e):"fit"}(n)}var a;return Object.assign(Object.assign(Object.assign({},1===qU(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t}),UG(n)),UG(e))}(e,r.autosize,n,i),e.datasets,e.usermeta),normalized:r}}finally{t.logger&&oH(),t.fieldTitle&&nY(eY)}}const O1=new class extends _G{mapUnit(e,{config:t}){if(e.encoding){const{encoding:n,transform:r}=e,{bins:i,timeUnits:o,aggregate:a,groupby:u,encoding:s}=kY(n,t),l=[...r||[],...i,...o,...0===a.length?[]:[{aggregate:a,groupby:u}]];return Object.assign(Object.assign(Object.assign({},e),l.length>0?{transform:l}:{}),{encoding:s})}return e}};function S1(e,t){return O1.map(e,{config:t})}const D1=YI.version;var F1=n(51),j1=n.n(F1),T1=n(66);var N1={background:"#333",title:{color:"#fff"},style:{"guide-label":{fill:"#fff"},"guide-title":{fill:"#fff"}},axis:{domainColor:"#fff",gridColor:"#888",tickColor:"#fff"}};var M1={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"]}};var B1={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"},style:{bar:{binSpacing:2,fill:"#30a2da",stroke:null}},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}};var P1={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"]}};const R1="Benton Gothic Bold, sans-serif",z1={"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"]};var L1={background:"#ffffff",title:{anchor:"start",color:"#000000",font:R1,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:R1,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:R1,titleFontSize:13,titleFontWeight:"normal"},range:{category:z1["category-6"],diverging:z1["fireandice-6"],heatmap:z1["fire-7"],ordinal:z1["fire-7"],ramp:z1["fire-7"]}};var I1={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"]}};var U1={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"]}};const $1={"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"]};var q1={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:$1["six-groups-cat-1"],diverging:$1["diverging-colors"],heatmap:$1["diverging-colors"],ordinal:$1["six-groups-seq"],ramp:$1["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}};const W1=T1.version;var H1=n(67),V1="#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 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 Y1="vg-tooltip-element",G1={offsetX:10,offsetY:10,id:Y1,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&").replace(/e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}(t))}class J1{constructor(e){this.options=Object.assign(Object.assign({},G1),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 V1.toString().replace(Y1,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=function(e,t,n){if(JI(e))return`[${e.map(e=>t(ZI(e)?e:K1(e,n))).join(", ")}]`;if(QI(e)){let r="";const i=e,{title:o}=i,a=X1(i,["title"]);o&&(r+=`

${t(o)}

`);const u=Object.keys(a);if(u.length>0){r+="";for(const e of u){let i=a[e];void 0!==i&&(QI(i)&&(i=K1(i,n)),r+=``)}r+="
${t(e)}:${t(i)}
"}return r||"{}"}return t(e)}(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`)}}H1.version;var Q1='.vega-embed {\n position: relative;\n display: inline-block; }\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 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 .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\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 Z1(e,...t){for(const n of t)e2(e,n);return e}function e2(e,t){for(const n of Object.keys(t))Te(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 t2=v;let n2=x;const r2=window;void 0===n2&&r2.vl&&r2.vl.compile&&(n2=r2.vl);const i2={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},o2={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"},a2={vega:"Vega","vega-lite":"Vega-Lite"},u2={vega:t2.version,"vega-lite":n2?n2.version:"not available"},s2={vega:e=>e,"vega-lite":(e,t)=>n2.compile(e,{config:t}).spec};function l2(e,t,n,r){const i=`${t}
`,o=`
${n}`,a=window.open("");a.document.write(i+e+o),a.document.title=a2[r]+" JSON Source"}function c2(e,t,n={}){var r,i,o;return O(this,void 0,void 0,(function*(){const a=(u=n.loader)&&"load"in u?n.loader:t2.loader(n.loader);var u;const s=ZI(t)?JSON.parse(yield a.load(t)):t,l=yield f2((r=s.usermeta&&s.usermeta.embedOptions,null!=r?r:{}),a),c=yield f2(n,a),f=Object.assign(Object.assign({},Z1(c,l)),{config:sU((i=c.config,null!=i?i:{}),(o=l.config,null!=o?o:{}))});return yield function(e,t,n={},r){var i,o,a,u,s,l;return O(this,void 0,void 0,(function*(){const c=n.theme?sU(w[n.theme],null!=(i=n.config)?i:{}):n.config,f=mU(n.actions)?n.actions:Z1({},i2,null!=(o=n.actions)?o:{}),d=Object.assign(Object.assign({},o2),n.i18n),h=null!=(a=n.renderer)?a:"canvas",p=null!=(u=n.logLevel)?u:t2.Warn,m=null!=(s=n.downloadFileName)?s:"visualization";if(!1!==n.defaultStyle){const e="vega-embed-style";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?Q1.toString():n.defaultStyle,document.head.appendChild(t)}}const g=function(e,t){var n;if(e.$schema){const r=j1()(e.$schema);t&&t!==r.library&&console.warn(`The given visualization spec is written in ${a2[r.library]}, but mode argument sets ${n=a2[t],null!=n?n:t}.`);const i=r.library;return Object(oe.satisfies)(u2[i],"^"+r.version.slice(1))||console.warn(`The input spec uses ${a2[i]} ${r.version}, but the current version of ${a2[i]} is v${u2[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 v=s2[g](t,c);if("vega-lite"===g&&v.$schema){const e=j1()(v.$schema);Object(oe.satisfies)(u2.vega,"^"+e.version.slice(1))||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${u2.vega}.`)}const y="string"==typeof e?document.querySelector(e):e;if(!y)throw Error("${el} does not exist");y.classList.add("vega-embed"),f&&y.classList.add("has-actions"),y.innerHTML="";const b=n.patch;b&&(v=b instanceof Function?b(v):W(v,b,!0,!1).newDocument),n.formatLocale&&t2.formatLocale(n.formatLocale),n.timeFormatLocale&&t2.timeFormatLocale(n.timeFormatLocale);const x=t2.parse(v,"vega-lite"===g?{}:c),E=new t2.View(x,{loader:r,logLevel:p,renderer:h});if(!1!==n.tooltip){let e;e="function"==typeof n.tooltip?n.tooltip:new J1(!0===n.tooltip?{}:n.tooltip).call,E.tooltip(e)}let _,{hover:A}=n;if(void 0===A&&(A="vega"===g),A){const{hoverSet:e,updateSet:t}="boolean"==typeof A?{}:A;E.hover(e,t)}if(n&&(n.width&&E.width(n.width),n.height&&E.height(n.height),n.padding&&E.padding(n.padding)),yield E.initialize(e).runAsync(),!1!==f){let e=y;if(!1!==n.defaultStyle){const t=document.createElement("details");t.title=d.CLICK_TO_VIEW_ACTIONS,y.append(t),e=t;const n=document.createElement("summary");n.innerHTML='\n\n \n \n \n',t.append(n),_=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",_)}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=`${m}.${e}`,i.addEventListener("mousedown",(function(t){E.toImageURL(e,n.scaleFactor).then(e=>{this.href=e}).catch(e=>{throw e}),t.preventDefault()})),r.append(i)}if(!0===f||!1!==f.source){const e=document.createElement("a");e.text=d.SOURCE_ACTION,e.href="#",e.addEventListener("mousedown",(function(e){var r,i;l2(ie()(t),null!=(r=n.sourceHeader)?r:"",null!=(i=n.sourceFooter)?i:"",g),e.preventDefault()})),r.append(e)}if("vega-lite"===g&&(!0===f||!1!==f.compiled)){const e=document.createElement("a");e.text=d.COMPILED_ACTION,e.href="#",e.addEventListener("mousedown",(function(e){var t,r;l2(ie()(v),null!=(t=n.sourceHeader)?t:"",null!=(r=n.sourceFooter)?r:"","vega"),e.preventDefault()})),r.append(e)}if(!0===f||!1!==f.editor){const e=null!=(l=n.editorUrl)?l:"https://vega.github.io/editor/",i=document.createElement("a");i.text=d.EDITOR_ACTION,i.href="#",i.addEventListener("mousedown",(function(n){!function(e,t,n){const r=e.open(t);let i=40;e.addEventListener("message",(function t(n){n.source===r&&(i=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){i<=0||(r.postMessage(n,"*"),setTimeout(e,250),i-=1)}),250)}(window,e,{config:c,mode:g,renderer:h,spec:ie()(t)}),n.preventDefault()})),r.append(i)}}return{view:E,spec:t,vgSpec:v,finalize:function(){_&&document.removeEventListener("click",_),E.finalize()}}}))}(e,s,f,a)}))}function f2(e,t){var n;return O(this,void 0,void 0,(function*(){const r=ZI(e.config)?JSON.parse(yield t.load(e.config)):null!=(n=e.config)?n:{},i=ZI(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 d2={};function h2(e,t){void 0===e&&(e=d2),void 0===t&&(t=d2);var n=Object.keys(e),r=Object.keys(t);return e===t||n.length===r.length&&n.every((function(n){return e[n]===t[n]}))}var p2=function(){};function m2(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g2(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v2=function(e){function t(){for(var t,n=arguments.length,r=Array(n),i=0;i>",e)}})),01?t-1:0),i=1;ift(t.props.children)-1){if(!r)return;i=0}t.select(i,e,"next")}},t.handlePrev=function(e){if(!t._isSliding){var n=t.props,r=n.wrap,i=n.activeIndex-1;if(i<0){if(!r)return;i=ft(t.props.children)-1}t.select(i,e,"prev")}},t}Object(g.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.cycle()},t.getDerivedStateFromProps=function(e,t){var n=t.activeIndex;if(e.activeIndex!==n){var r=ft(e.children)-1,i=Math.max(0,Math.min(e.activeIndex,r));return{direction:0===i&&n>=r||n<=i?"next":"prev",previousActiveIndex:n,activeIndex:i}}return null},n.componentDidUpdate=function(e,t){var n=this,r=this.props,i=r.bsPrefix,o=r.slide,u=r.onSlideEnd;if(o&&this.state.activeIndex!==t.activeIndex&&!this._isSliding){var s,l,c=this.state,f=c.activeIndex,d=c.direction;"next"===d?(s=i+"-item-next",l=i+"-item-left"):"prev"===d&&(s=i+"-item-prev",l=i+"-item-right"),this._isSliding=!0,this.pause(),this.safeSetState({prevClasses:"active",currentClasses:s},(function(){var e=n.carousel.current.children[f];ue(e),n.safeSetState({prevClasses:a()("active",l),currentClasses:a()(s,l)},(function(){return X(e,(function(){n.safeSetState({prevClasses:"",currentClasses:"active"},n.handleSlideEnd),u&&u()}))}))}))}},n.componentWillUnmount=function(){clearTimeout(this.timeout),this.isUnmounted=!0},n.safeSetState=function(e,t){var n=this;this.isUnmounted||this.setState(e,(function(){return!n.isUnmounted&&t()}))},n.pause=function(){this._isPaused=!0,clearInterval(this._interval),this._interval=null},n.cycle=function(){this._isPaused=!1,clearInterval(this._interval),this._interval=null,this.props.interval&&!this._isPaused&&(this._interval=setInterval(document.visibilityState?this.handleNextWhenVisible:this.handleNext,this.props.interval))},n.to=function(e,t){var n=this.props.children;e<0||e>ft(n)-1||(this._isSliding?this._pendingIndex=e:this.select(e,t))},n.select=function(e,t,n){var r=this;clearTimeout(this.selectThrottle),t&&t.persist&&t.persist(),this.selectThrottle=setTimeout((function(){clearTimeout(r.timeout);var i=r.props,o=i.activeIndex,a=i.onSelect;e===o||r._isSliding||r.isUnmounted||a(e,n||(e1?a-1:0),s=1;s *"},qt.Menu=Rt,qt.Toggle=Ut;var Wt=qt,Ht=s.a.createContext(null),Vt={as:Te,disabled:!1},Yt=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.children,c=e.eventKey,f=e.disabled,d=e.href,h=e.onClick,p=e.onSelect,m=e.active,g=e.as,v=Object(i.a)(e,["bsPrefix","className","children","eventKey","disabled","href","onClick","onSelect","active","as"]),y=A(n,"dropdown-item"),b=Object(u.useContext)(D),x=(Object(u.useContext)(Ht)||{}).activeKey,w=S(c,d),E=null==m&&null!=w?S(x)===w:m,_=ye((function(e){f||(h&&h(e),b&&b(w,e),p&&p(w,e))}));return s.a.createElement(g,Object(r.a)({},v,{ref:t,href:d,disabled:f,className:a()(o,y,E&&"active",f&&"disabled"),onClick:_}),l)}));Yt.displayName="DropdownItem",Yt.defaultProps=Vt;var Gt=Yt,Xt=function(e){return e&&"function"!=typeof e?function(t){e.current=t}:e};var Kt=function(e,t){return Object(u.useMemo)((function(){return function(e,t){var n=Xt(e),r=Xt(t);return function(e){n&&n(e),r&&r(e)}}(e,t)}),[e,t])},Jt=s.a.createContext(null);function Qt(e,t){return e}var Zt=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.alignRight,c=e.rootCloseEvent,f=e.flip,d=e.popperConfig,h=e.show,p=e.as,m=void 0===p?"div":p,g=Object(i.a)(e,["bsPrefix","className","alignRight","rootCloseEvent","flip","popperConfig","show","as"]),v=Object(u.useContext)(Jt),y=A(n,"dropdown-menu"),b=Mt({flip:f,popperConfig:d,rootCloseEvent:c,show:h,alignEnd:l,usePopper:!v}),x=b.hasShown,w=b.placement,E=b.show,_=b.alignEnd,k=b.close,C=b.props;if(C.ref=Kt(C.ref,Qt(t)),!x)return null;"string"!=typeof m&&(C.show=E,C.close=k,C.alignRight=_);var O=g.style;return w&&(O=Object(r.a)({},O,{},C.style),g["x-placement"]=w),s.a.createElement(m,Object(r.a)({},g,C,{style:O,className:a()(o,y,E&&"show",_&&y+"-right")}))}));Zt.displayName="DropdownMenu",Zt.defaultProps={alignRight:!1,flip:!0};var en=Zt,tn=(n(37),s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.split,u=e.className,l=e.children,c=e.childBsPrefix,f=e.as,d=void 0===f?He:f,h=Object(i.a)(e,["bsPrefix","split","className","children","childBsPrefix","as"]),p=A(n,"dropdown-toggle");void 0!==c&&(h.bsPrefix=c);var m=zt(),g=m[0],v=m[1].toggle;return g.ref=Kt(g.ref,Qt(t)),s.a.createElement(d,Object(r.a)({onClick:v,className:a()(u,p,o&&p+"-split")},g,h),l)})));tn.displayName="DropdownToggle";var nn=tn,rn=s.a.forwardRef((function(e,t){var n=m(e,{show:"onToggle"}),o=n.bsPrefix,l=n.drop,c=n.show,f=n.className,d=n.alignRight,h=n.onSelect,p=n.onToggle,g=n.focusFirstItemOnShow,v=n.as,y=void 0===v?"div":v,b=(n.navbar,Object(i.a)(n,["bsPrefix","drop","show","className","alignRight","onSelect","onToggle","focusFirstItemOnShow","as","navbar"])),x=Object(u.useContext)(D),w=A(o,"dropdown"),E=ye((function(e,t,n){void 0===n&&(n=t.type),t.currentTarget===document&&(n="rootClose"),p(e,t,{source:n})})),_=ye((function(e,t){x&&x(e,t),h&&h(e,t),E(!1,t,"select")}));return s.a.createElement(D.Provider,{value:_},s.a.createElement(Wt,{drop:l,show:c,alignEnd:d,onToggle:E,focusFirstItemOnShow:g,itemSelector:"."+w+"-item:not(.disabled):not(:disabled)"},(function(e){var n=e.props;return s.a.createElement(y,Object(r.a)({},b,n,{ref:t,className:a()(f,c&&"show",(!l||"down"===l)&&w,"up"===l&&"dropup","right"===l&&"dropright","left"===l&&"dropleft")}))})))}));rn.displayName="Dropdown",rn.defaultProps={navbar:!1},rn.Toggle=nn,rn.Menu=en,rn.Item=Gt,rn.Header=we("dropdown-header",{defaultProps:{role:"heading"}}),rn.Divider=we("dropdown-divider",{defaultProps:{role:"separator"}});var on=rn,an={id:J.a.any,href:J.a.string,onClick:J.a.func,title:J.a.node.isRequired,disabled:J.a.bool,menuRole:J.a.string,rootCloseEvent:J.a.string,bsPrefix:J.a.string,variant:J.a.string,size:J.a.string},un=s.a.forwardRef((function(e,t){var n=e.title,o=e.children,a=e.bsPrefix,u=e.rootCloseEvent,l=e.variant,c=e.size,f=e.menuRole,d=e.disabled,h=e.href,p=e.id,m=Object(i.a)(e,["title","children","bsPrefix","rootCloseEvent","variant","size","menuRole","disabled","href","id"]);return s.a.createElement(on,Object(r.a)({ref:t},m),s.a.createElement(on.Toggle,{id:p,href:h,size:c,variant:l,disabled:d,childBsPrefix:a},n),s.a.createElement(on.Menu,{role:f,rootCloseEvent:u},o))}));un.displayName="DropdownButton",un.propTypes=an;var sn=un,ln=(n(57),{type:J.a.string.isRequired,as:J.a.elementType}),cn=s.a.forwardRef((function(e,t){var n=e.as,o=void 0===n?"div":n,u=e.className,l=e.type,c=Object(i.a)(e,["as","className","type"]);return s.a.createElement(o,Object(r.a)({},c,{ref:t,className:a()(u,l&&l+"-feedback")}))}));cn.displayName="Feedback",cn.propTypes=ln,cn.defaultProps={type:"valid"};var fn=cn,dn=s.a.createContext({controlId:void 0}),hn=s.a.forwardRef((function(e,t){var n=e.id,o=e.bsPrefix,l=e.bsCustomPrefix,c=e.className,f=e.isValid,d=e.isInvalid,h=e.isStatic,p=e.as,m=void 0===p?"input":p,g=Object(i.a)(e,["id","bsPrefix","bsCustomPrefix","className","isValid","isInvalid","isStatic","as"]),v=Object(u.useContext)(dn),y=v.controlId;return o=v.custom?A(l,"custom-control-input"):A(o,"form-check-input"),s.a.createElement(m,Object(r.a)({},g,{ref:t,id:n||y,className:a()(c,o,f&&"is-valid",d&&"is-invalid",h&&"position-static")}))}));hn.displayName="FormCheckInput",hn.defaultProps={type:"checkbox"};var pn=hn,mn=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.bsCustomPrefix,l=e.className,c=e.htmlFor,f=Object(i.a)(e,["bsPrefix","bsCustomPrefix","className","htmlFor"]),d=Object(u.useContext)(dn),h=d.controlId;return n=d.custom?A(o,"custom-control-label"):A(n,"form-check-label"),s.a.createElement("label",Object(r.a)({},f,{ref:t,htmlFor:c||h,className:a()(l,n)}))}));mn.displayName="FormCheckLabel";var gn=mn,vn=s.a.forwardRef((function(e,t){var n=e.id,o=e.bsPrefix,l=e.bsCustomPrefix,c=e.inline,f=e.disabled,d=e.isValid,h=e.isInvalid,p=e.feedback,m=e.className,g=e.style,v=e.title,y=e.type,b=e.label,x=e.children,w=e.custom,E=e.as,_=void 0===E?"input":E,k=Object(i.a)(e,["id","bsPrefix","bsCustomPrefix","inline","disabled","isValid","isInvalid","feedback","className","style","title","type","label","children","custom","as"]),C="switch"===y||w;o=C?A(l,"custom-control"):A(o,"form-check");var O=Object(u.useContext)(dn).controlId,S=Object(u.useMemo)((function(){return{controlId:n||O,custom:C}}),[O,C,n]),D=null!=b&&!1!==b&&!x,F=s.a.createElement(pn,Object(r.a)({},k,{type:"switch"===y?"checkbox":y,ref:t,isValid:d,isInvalid:h,isStatic:!D,disabled:f,as:_}));return s.a.createElement(dn.Provider,{value:S},s.a.createElement("div",{style:g,className:a()(m,o,C&&"custom-"+y,c&&o+"-inline")},x||s.a.createElement(s.a.Fragment,null,F,D&&s.a.createElement(gn,{title:v},b),(d||h)&&s.a.createElement(fn,{type:d?"valid":"invalid"},p))))}));vn.displayName="FormCheck",vn.defaultProps={type:"checkbox",inline:!1,disabled:!1,isValid:!1,isInvalid:!1,title:""},vn.Input=pn,vn.Label=gn;var yn=vn,bn=s.a.forwardRef((function(e,t){var n,o,l=e.bsPrefix,c=e.type,f=e.size,d=e.id,h=e.className,p=e.isValid,m=e.isInvalid,g=e.plaintext,v=e.readOnly,y=e.as,b=void 0===y?"input":y,x=Object(i.a)(e,["bsPrefix","type","size","id","className","isValid","isInvalid","plaintext","readOnly","as"]),w=Object(u.useContext)(dn).controlId;if(l=A(l,"form-control"),g)(o={})[l+"-plaintext"]=!0,n=o;else if("file"===c){var E;(E={})[l+"-file"]=!0,n=E}else{var _;(_={})[l]=!0,_[l+"-"+f]=f,n=_}return s.a.createElement(b,Object(r.a)({},x,{type:c,ref:t,readOnly:v,id:d||w,className:a()(h,n,p&&"is-valid",m&&"is-invalid")}))}));bn.displayName="FormControl",bn.Feedback=fn;var xn=bn,wn=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.children,c=e.controlId,f=e.as,d=void 0===f?"div":f,h=Object(i.a)(e,["bsPrefix","className","children","controlId","as"]);n=A(n,"form-group");var p=Object(u.useMemo)((function(){return{controlId:c}}),[c]);return s.a.createElement(dn.Provider,{value:p},s.a.createElement(d,Object(r.a)({},h,{ref:t,className:a()(o,n)}),l))}));wn.displayName="FormGroup";var En=wn,_n=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.column,l=e.srOnly,c=e.className,f=e.htmlFor,d=Object(i.a)(e,["bsPrefix","column","srOnly","className","htmlFor"]),h=Object(u.useContext)(dn).controlId;n=A(n,"form-label");var p=a()(c,n,l&&"sr-only",o&&"col-form-label");return f=f||h,o?s.a.createElement(bt,Object(r.a)({as:"label",className:p,htmlFor:f},d)):s.a.createElement("label",Object(r.a)({ref:t,className:p,htmlFor:f},d))}));_n.displayName="FormLabel",_n.defaultProps={column:!1,srOnly:!1};var An=_n,kn=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,u=e.as,l=void 0===u?"small":u,c=e.muted,f=Object(i.a)(e,["bsPrefix","className","as","muted"]);return n=A(n,"form-text"),s.a.createElement(l,Object(r.a)({},f,{ref:t,className:a()(o,n,c&&"text-muted")}))}));kn.displayName="FormText";var Cn=kn,On=s.a.forwardRef((function(e,t){return s.a.createElement(yn,Object(r.a)({},e,{ref:t,type:"switch"}))}));On.displayName="Switch",On.Input=yn.Input,On.Label=yn.Label;var Sn=On,Dn=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.inline,u=e.className,l=e.validated,c=e.as,f=void 0===c?"form":c,d=Object(i.a)(e,["bsPrefix","inline","className","validated","as"]);return n=A(n,"form"),s.a.createElement(f,Object(r.a)({},d,{ref:t,className:a()(u,l&&"was-validated",o&&n+"-inline")}))}));Dn.displayName="Form",Dn.defaultProps={inline:!1},Dn.Row=we("form-row"),Dn.Group=En,Dn.Control=xn,Dn.Check=yn,Dn.Switch=Sn,Dn.Label=An,Dn.Text=Cn;var Fn=Dn,jn=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.fluid,u=e.as,l=void 0===u?"div":u,c=e.className,f=Object(i.a)(e,["bsPrefix","fluid","as","className"]),d=A(n,"container");return s.a.createElement(l,Object(r.a)({ref:t},f,{className:a()(c,o?d+"-fluid":d)}))}));jn.displayName="Container",jn.defaultProps={fluid:!1};var Tn=jn,Nn=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,u=e.fluid,l=e.rounded,c=e.roundedCircle,f=e.thumbnail,d=Object(i.a)(e,["bsPrefix","className","fluid","rounded","roundedCircle","thumbnail"]);n=A(n,"img");var h=a()(u&&n+"-fluid",l&&"rounded",c&&"rounded-circle",f&&n+"-thumbnail");return s.a.createElement("img",Object(r.a)({ref:t},d,{className:a()(o,h)}))}));Nn.displayName="Image",Nn.defaultProps={fluid:!1,rounded:!1,roundedCircle:!1,thumbnail:!1};var Mn=Nn,Bn={bsPrefix:J.a.string,fluid:J.a.bool,rounded:J.a.bool,roundedCircle:J.a.bool,thumbnail:J.a.bool},Pn=s.a.forwardRef((function(e,t){var n=e.className,o=Object(i.a)(e,["className"]);return s.a.createElement(Mn,Object(r.a)({ref:t},o,{className:a()(n,"figure-img")}))}));Pn.displayName="FigureImage",Pn.propTypes=Bn,Pn.defaultProps={fluid:!0};var Rn=Pn,zn=we("figure-caption",{Component:"figcaption"}),Ln=we("figure",{Component:"figure"});Ln.Image=Rn,Ln.Caption=zn;var In=Ln,Un=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.size,u=e.className,l=e.as,c=void 0===l?"div":l,f=Object(i.a)(e,["bsPrefix","size","className","as"]);return n=A(n,"input-group"),s.a.createElement(c,Object(r.a)({ref:t},f,{className:a()(u,n,o&&n+"-"+o)}))})),$n=we("input-group-append"),qn=we("input-group-prepend"),Wn=we("input-group-text",{Component:"span"});Un.displayName="InputGroup",Un.Text=Wn,Un.Radio=function(e){return s.a.createElement(Wn,null,s.a.createElement("input",Object(r.a)({type:"radio"},e)))},Un.Checkbox=function(e){return s.a.createElement(Wn,null,s.a.createElement("input",Object(r.a)({type:"checkbox"},e)))},Un.Append=$n,Un.Prepend=qn;var Hn=Un,Vn=s.a.forwardRef((function(e,t){var n,o=e.as,u=void 0===o?"div":o,l=e.className,c=e.fluid,f=e.bsPrefix,d=Object(i.a)(e,["as","className","fluid","bsPrefix"]),h=((n={})[f=A(f,"jumbotron")]=!0,n[f+"-fluid"]=c,n);return s.a.createElement(u,Object(r.a)({ref:t},d,{className:a()(l,h)}))}));Vn.defaultProps={fluid:!1},Vn.displayName="Jumbotron";var Yn=Vn,Gn=s.a.createContext(null),Xn=function(){},Kn=s.a.forwardRef((function(e,t){var n,o,a=e.as,l=void 0===a?"ul":a,c=e.onSelect,f=e.activeKey,d=e.role,h=e.onKeyDown,p=Object(i.a)(e,["as","onSelect","activeKey","role","onKeyDown"]),m=_t(),g=Object(u.useRef)(!1),v=Object(u.useContext)(D),y=Object(u.useContext)(Gn);y&&(d=d||"tablist",f=y.activeKey,n=y.getControlledId,o=y.getControllerId);var b=Object(u.useRef)(null),x=function(e){if(!b.current)return null;var t=wt(b.current,"[data-rb-event-key]:not(.disabled)"),n=b.current.querySelector(".active"),r=t.indexOf(n);if(-1===r)return null;var i=r+e;return i>=t.length&&(i=0),i<0&&(i=t.length-1),t[i]},w=function(e,t){null!=e&&(c&&c(e,t),v&&v(e,t))};Object(u.useEffect)((function(){if(b.current&&g.current){var e=b.current.querySelector("[data-rb-event-key].active");e&&e.focus()}g.current=!1}));var E=Kt(t,b);return s.a.createElement(D.Provider,{value:w},s.a.createElement(Ht.Provider,{value:{role:d,activeKey:S(f),getControlledId:n||Xn,getControllerId:o||Xn}},s.a.createElement(l,Object(r.a)({},p,{onKeyDown:function(e){var t;switch(h&&h(e),e.key){case"ArrowLeft":case"ArrowUp":t=x(-1);break;case"ArrowRight":case"ArrowDown":t=x(1);break;default:return}t&&(e.preventDefault(),w(t.dataset.rbEventKey,e),g.current=!0,m())},ref:E,role:d}))))})),Jn=s.a.forwardRef((function(e,t){var n=e.active,o=e.className,l=e.tabIndex,c=e.eventKey,f=e.onSelect,d=e.onClick,h=e.as,p=Object(i.a)(e,["active","className","tabIndex","eventKey","onSelect","onClick","as"]),m=S(c,p.href),g=Object(u.useContext)(D),v=Object(u.useContext)(Ht),y=n;v&&(p.role||"tablist"!==v.role||(p.role="tab"),p["data-rb-event-key"]=m,p.id=v.getControllerId(m),p["aria-controls"]=v.getControlledId(m),y=null==n&&null!=m?v.activeKey===m:n),"tab"===p.role&&(p.tabIndex=y?l:-1,p["aria-selected"]=y);var b=ye((function(e){d&&d(e),null!=m&&(f&&f(m,e),g&&g(m,e))}));return s.a.createElement(h,Object(r.a)({},p,{ref:t,onClick:b,className:a()(o,y&&"active")}))}));Jn.defaultProps={disabled:!1};var Qn=Jn,Zn=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.active,l=e.disabled,c=e.className,f=e.variant,d=e.action,h=e.as,p=e.eventKey,m=e.onClick,g=Object(i.a)(e,["bsPrefix","active","disabled","className","variant","action","as","eventKey","onClick"]);n=A(n,"list-group-item");var v=Object(u.useCallback)((function(e){if(l)return e.preventDefault(),void e.stopPropagation();m&&m(e)}),[l,m]);return s.a.createElement(Qn,Object(r.a)({ref:t},g,{eventKey:S(p,g.href),as:h||(d?g.href?"a":"button":"div"),onClick:v,className:a()(c,n,o&&"active",l&&"disabled",f&&n+"-"+f,d&&n+"-action")}))}));Zn.defaultProps={variant:null,active:!1,disabled:!1},Zn.displayName="ListGroupItem";var er=Zn,tr=s.a.forwardRef((function(e,t){var n,o=m(e,{activeKey:"onSelect"}),u=o.className,l=o.bsPrefix,c=o.variant,f=o.horizontal,d=o.as,h=void 0===d?"div":d,p=Object(i.a)(o,["className","bsPrefix","variant","horizontal","as"]);return l=A(l,"list-group"),n=f?!0===f?"horizontal":"horizontal-"+f:null,s.a.createElement(Kn,Object(r.a)({ref:t},p,{as:h,className:a()(u,l,c&&l+"-"+c,n&&l+"-"+n)}))}));tr.defaultProps={variant:null,horizontal:null},tr.displayName="ListGroup",tr.Item=er;var nr=tr,rr=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,u=e.as,l=void 0===u?"div":u,c=Object(i.a)(e,["bsPrefix","className","as"]),f=A(n,"media");return s.a.createElement(l,Object(r.a)({},c,{ref:t,className:a()(o,f)}))}));rr.displayName="Media",rr.Body=we("media-body");var ir,or=rr;function ar(e){if((!ir&&0!==ir||e)&&I){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),ir=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return ir}var ur=n(19);function sr(e){void 0===e&&(e=N());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(t){return e.body}}function lr(e,t){e.classList?e.classList.add(t):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function cr(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function fr(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=cr(e.className,t):e.setAttribute("class",cr(e.className&&e.className.baseVal||"",t))}function dr(e){return"window"in e&&e.window===e?e:"nodeType"in(t=e)&&t.nodeType===document.DOCUMENT_NODE&&e.defaultView||!1;var t}function hr(e){var t;return dr(e)||(t=e)&&"body"===t.tagName.toLowerCase()?function(e){var t=N(e),n=dr(t);return t.body.clientWidthe.clientHeight}var pr=["template","script","style"],mr=function(e,t,n){t=[].concat(t),[].forEach.call(e.children,(function(e){var r,i,o;-1===t.indexOf(e)&&(i=(r=e).nodeType,o=r.tagName,1===i&&-1===pr.indexOf(o.toLowerCase()))&&n(e)}))};function gr(e,t){t&&(e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden"))}var vr=function(){function e(e){var t=void 0===e?{}:e,n=t.hideSiblingNodes,r=void 0===n||n,i=t.handleContainerOverflow,o=void 0===i||i;this.hideSiblingNodes=r,this.handleContainerOverflow=o,this.modals=[],this.containers=[],this.data=[],this.scrollbarSize=ar()}var t=e.prototype;return t.isContainerOverflowing=function(e){var t=this.data[this.containerIndexFromModal(e)];return t&&t.overflowing},t.containerIndexFromModal=function(e){return t=this.data,n=function(t){return-1!==t.modals.indexOf(e)},r=-1,t.some((function(e,t){return!!n(e,t)&&(r=t,!0)})),r;var t,n,r},t.setContainerStyle=function(e,t){var n={overflow:"hidden"};e.style={overflow:t.style.overflow,paddingRight:t.style.paddingRight},e.overflowing&&(n.paddingRight=parseInt(L(t,"paddingRight")||0,10)+this.scrollbarSize+"px"),L(t,n)},t.removeContainerStyle=function(e,t){var n=e.style;Object.keys(n).forEach((function(e){t.style[e]=n[e]}))},t.add=function(e,t,n){var r=this.modals.indexOf(e),i=this.containers.indexOf(t);if(-1!==r)return r;if(r=this.modals.length,this.modals.push(e),this.hideSiblingNodes&&function(e,t){var n=t.dialog,r=t.backdrop;mr(e,[n,r],(function(e){return gr(!0,e)}))}(t,e),-1!==i)return this.data[i].modals.push(e),r;var o={modals:[e],classes:n?n.split(/\s+/):[],overflowing:hr(t)};return this.handleContainerOverflow&&this.setContainerStyle(o,t),o.classes.forEach(lr.bind(null,t)),this.containers.push(t),this.data.push(o),r},t.remove=function(e){var t=this.modals.indexOf(e);if(-1!==t){var n=this.containerIndexFromModal(e),r=this.data[n],i=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.classes.forEach(fr.bind(null,i)),this.handleContainerOverflow&&this.removeContainerStyle(r,i),this.hideSiblingNodes&&function(e,t){var n=t.dialog,r=t.backdrop;mr(e,[n,r],(function(e){return gr(!1,e)}))}(i,e),this.containers.splice(n,1),this.data.splice(n,1);else if(this.hideSiblingNodes){var o=r.modals[r.modals.length-1],a=o.backdrop;gr(!1,o.dialog),gr(!1,a)}}},t.isTopModal=function(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e},e}(),yr=function(e){return N(Z.a.findDOMNode(e))},br=function(e){if("undefined"!=typeof document)return null==e?N().body:("function"==typeof e&&(e=e()),e&&e.current&&(e=e.current),e&&e.nodeType?e:null)};function xr(e,t){var n=Object(u.useState)((function(){return br(e)})),r=n[0],i=n[1];if(!r){var o=br(e);o&&i(o)}return Object(u.useEffect)((function(){t&&r&&t(r)}),[t,r]),Object(u.useEffect)((function(){var t=br(e);t!==r&&i(t)}),[e,r]),r}var wr=new vr;var Er=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o1?r-1:0),o=1;o1?r-1:0),o=1;oN(e).documentElement.clientHeight;this.setState({style:{paddingRight:t&&!n?ar():void 0,paddingLeft:!t&&n?ar():void 0}})}},n.render=function(){var e=this.props,t=e.bsPrefix,n=e.className,o=e.style,u=e.dialogClassName,l=e.children,c=e.dialogAs,f=e.show,d=e.animation,h=e.backdrop,p=e.keyboard,m=e.manager,g=e.onEscapeKeyDown,v=e.onShow,y=e.onHide,b=e.container,x=e.autoFocus,w=e.enforceFocus,E=e.restoreFocus,_=e.onEntered,A=e.onExit,k=e.onExiting,C=(e.onExited,e.onEntering,e.onEnter,e.onEntering,e.backdropClassName,Object(i.a)(e,["bsPrefix","className","style","dialogClassName","children","dialogAs","show","animation","backdrop","keyboard","manager","onEscapeKeyDown","onShow","onHide","container","autoFocus","enforceFocus","restoreFocus","onEntered","onExit","onExiting","onExited","onEntering","onEnter","onEntering","backdropClassName"])),O=!0===h?this.handleClick:null,S=Object(r.a)({},o,{},this.state.style);return d||(S.display="block"),s.a.createElement(Tr.Provider,{value:this.modalContext},s.a.createElement(Cr,{show:f,backdrop:h,container:b,keyboard:p,autoFocus:x,enforceFocus:w,restoreFocus:E,onEscapeKeyDown:g,onShow:v,onHide:y,onEntered:_,onExit:A,onExiting:k,manager:m,ref:this.setModalRef,style:S,className:a()(n,t),containerClassName:t+"-open",transition:d?Ir:void 0,backdropTransition:d?Ur:void 0,renderBackdrop:this.renderBackdrop,onClick:O,onMouseUp:this.handleMouseUp,onEnter:this.handleEnter,onEntering:this.handleEntering,onExited:this.handleExited},s.a.createElement(c,Object(r.a)({},C,{onMouseDown:this.handleDialogMouseDown,className:u}),l)))},t}(s.a.Component);$r.defaultProps=Lr;var qr=k($r,"modal");qr.Body=jr,qr.Header=Rr,qr.Title=zr,qr.Footer=Br,qr.Dialog=Mr,qr.TRANSITION_DURATION=300,qr.BACKDROP_TRANSITION_DURATION=150;var Wr=qr,Hr=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,u=e.children,l=e.as,c=void 0===l?"div":l,f=Object(i.a)(e,["bsPrefix","className","children","as"]);return n=A(n,"nav-item"),s.a.createElement(c,Object(r.a)({},f,{ref:t,className:a()(o,n)}),u)}));Hr.displayName="NavItem";var Vr=Hr,Yr={disabled:!1,as:Te},Gr=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.disabled,u=e.className,l=e.href,c=e.eventKey,f=e.onSelect,d=e.as,h=Object(i.a)(e,["bsPrefix","disabled","className","href","eventKey","onSelect","as"]);return n=A(n,"nav-link"),s.a.createElement(Qn,Object(r.a)({},h,{href:l,ref:t,eventKey:c,as:d,disabled:o,onSelect:f,className:a()(u,n,o&&"disabled")}))}));Gr.displayName="NavLink",Gr.defaultProps=Yr;var Xr=Gr,Kr=s.a.forwardRef((function(e,t){var n,o,l,c=m(e,{activeKey:"onSelect"}),f=c.as,d=void 0===f?"div":f,h=c.bsPrefix,p=c.variant,g=c.fill,v=c.justify,y=c.navbar,b=c.className,x=c.children,w=c.activeKey,E=Object(i.a)(c,["as","bsPrefix","variant","fill","justify","navbar","className","children","activeKey"]);h=A(h,"nav");var _=Object(u.useContext)(Jt),k=Object(u.useContext)(Ke);return _?(o=_.bsPrefix,y=null==y||y):k&&(l=k.cardHeaderBsPrefix),s.a.createElement(Kn,Object(r.a)({as:d,ref:t,activeKey:w,className:a()(b,(n={},n[h]=!y,n[o+"-nav"]=y,n[l+"-"+p]=!!l,n[h+"-"+p]=!!p,n[h+"-fill"]=g,n[h+"-justified"]=v,n))},E),x)}));Kr.displayName="Nav",Kr.defaultProps={justify:!1,fill:!1},Kr.Item=Vr,Kr.Link=Xr;var Jr=Kr,Qr=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,u=e.as,l=Object(i.a)(e,["bsPrefix","className","as"]);n=A(n,"navbar-brand");var c=u||(l.href?"a":"span");return s.a.createElement(c,Object(r.a)({},l,{ref:t,className:a()(o,n)}))}));Qr.displayName="NavbarBrand";var Zr=Qr,ei=s.a.forwardRef((function(e,t){var n=e.children,o=e.bsPrefix,a=Object(i.a)(e,["children","bsPrefix"]);return o=A(o,"navbar-collapse"),s.a.createElement(Jt.Consumer,null,(function(e){return s.a.createElement(de,Object(r.a)({in:!(!e||!e.expanded)},a),s.a.createElement("div",{ref:t,className:o},n))}))}));ei.displayName="NavbarCollapse";var ti=ei,ni=s.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.children,c=e.label,f=e.as,d=void 0===f?"button":f,h=e.onClick,p=Object(i.a)(e,["bsPrefix","className","children","label","as","onClick"]);n=A(n,"navbar-toggler");var m=Object(u.useContext)(Jt)||{},g=m.onToggle,v=m.expanded,y=ye((function(e){h&&h(e),g&&g()}));return"button"===d&&(p.type="button"),s.a.createElement(d,Object(r.a)({},p,{ref:t,onClick:y,"aria-label":c,className:a()(o,n,!v&&"collapsed")}),l||s.a.createElement("span",{className:n+"-icon"}))}));ni.displayName="NavbarToggle",ni.defaultProps={label:"Toggle navigation"};var ri=ni,ii=s.a.forwardRef((function(e,t){var n=m(e,{expanded:"onToggle"}),o=n.bsPrefix,l=n.expand,c=n.variant,f=n.bg,d=n.fixed,h=n.sticky,p=n.className,g=n.children,v=n.as,y=void 0===v?"nav":v,b=n.expanded,x=n.onToggle,w=n.onSelect,E=n.collapseOnSelect,_=Object(i.a)(n,["bsPrefix","expand","variant","bg","fixed","sticky","className","children","as","expanded","onToggle","onSelect","collapseOnSelect"]);o=A(o,"navbar");var k=Object(u.useCallback)((function(){w&&w.apply(void 0,arguments),E&&b&&x(!1)}),[w,E,b,x]);void 0===_.role&&"nav"!==y&&(_.role="navigation");var C=o+"-expand";"string"==typeof l&&(C=C+"-"+l);var O=Object(u.useMemo)((function(){return{onToggle:function(){return x(!b)},bsPrefix:o,expanded:b}}),[o,b,x]);return s.a.createElement(Jt.Provider,{value:O},s.a.createElement(D.Provider,{value:k},s.a.createElement(y,Object(r.a)({ref:t},_,{className:a()(p,o,l&&C,c&&o+"-"+c,f&&"bg-"+f,h&&"sticky-"+h,d&&"fixed-"+d)}),g)))}));ii.defaultProps={expand:!0,variant:"light",collapseOnSelect:!1},ii.displayName="Navbar",ii.Brand=Zr,ii.Toggle=ri,ii.Collapse=ti,ii.Text=we("navbar-text",{Component:"span"});var oi=ii,ai={id:J.a.any,onClick:J.a.func,title:J.a.node.isRequired,disabled:J.a.bool,active:J.a.bool,menuRole:J.a.string,rootCloseEvent:J.a.string,bsPrefix:J.a.string},ui=s.a.forwardRef((function(e,t){var n=e.id,o=e.title,a=e.children,u=e.bsPrefix,l=e.rootCloseEvent,c=e.menuRole,f=e.disabled,d=e.active,h=Object(i.a)(e,["id","title","children","bsPrefix","rootCloseEvent","menuRole","disabled","active"]);return s.a.createElement(on,Object(r.a)({ref:t},h,{as:Vr}),s.a.createElement(on.Toggle,{id:n,eventKey:null,active:d,disabled:f,childBsPrefix:u,as:Xr},o),s.a.createElement(on.Menu,{role:c,rootCloseEvent:l},a))}));ui.displayName="NavDropdown",ui.propTypes=ai,ui.Item=on.Item,ui.Divider=on.Divider,ui.Header=on.Header;var si=ui,li=s.a.forwardRef((function(e,t){var n=e.flip,o=e.placement,a=e.containerPadding,l=e.popperConfig,c=void 0===l?{}:l,f=e.transition,d=Et(),h=d[0],p=d[1],m=Et(),g=m[0],v=m[1],y=Kt(p,t),b=xr(e.container),x=xr(e.target),w=Object(u.useState)(!e.show),E=w[0],_=w[1],A=c.modifiers,k=void 0===A?{}:A,C=St(x,h,Object(r.a)({},c,{placement:o||"bottom",enableEvents:e.show,modifiers:Object(r.a)({},k,{preventOverflow:Object(r.a)({padding:a||5},k.preventOverflow),arrow:Object(r.a)({},k.arrow,{enabled:!!g,element:g}),flip:Object(r.a)({enabled:!!n},k.preventOverflow)})})),O=C.styles,S=C.arrowStyles,D=Object(i.a)(C,["styles","arrowStyles"]);e.show?E&&_(!1):e.transition||E||_(!0);var F=e.show||f&&!E;if(Nt(h,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!F)return null;var j=e.children(Object(r.a)({},D,{show:e.show,props:{style:O,ref:y},arrowProps:{style:S,ref:v}}));if(f){var T=e.onExit,N=e.onExiting,M=e.onEnter,B=e.onEntering,P=e.onEntered;j=s.a.createElement(f,{in:e.show,appear:!0,onExit:T,onExiting:N,onExited:function(){_(!0),e.onExited&&e.onExited.apply(e,arguments)},onEnter:M,onEntering:B,onEntered:P},j)}return b?Z.a.createPortal(j,b):null}));li.displayName="Overlay",li.propTypes={show:J.a.bool,placement:J.a.oneOf(kt.a.placements),target:J.a.any,container:J.a.any,flip:J.a.bool,children:J.a.func.isRequired,containerPadding:J.a.number,popperConfig:J.a.object,rootClose:J.a.bool,rootCloseEvent:J.a.oneOf(["click","mousedown"]),rootCloseDisabled:J.a.bool,onHide:function(e){var t=J.a.func;e.rootClose&&(t=t.isRequired);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/","renameschema":"scripts/rename-schema.sh","presite":"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh","site":"pushd site && bundle exec jekyll serve -I -l && popd","tsc:src":"tsc -b src/tsconfig.src.json","tsc:site":"tsc -b site/tsconfig.site.json","prettierbase":"prettier \'**/*.{md,css,yml}\'","eslintbase":"eslint --ext .ts .","format":"yarn eslintbase --fix && yarn prettierbase --write","lint":"yarn eslintbase && yarn prettierbase --check","test":"jest test/ && yarn lint && yarn schema && jest examples/ && yarn test:runtime","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles jest test-runtime/","test:runtime:generate":"yarn build:only && rm -Rf test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime","watch:build":"yarn build:only && concurrently --kill-others -n Typescript,Rollup \'yarn tsc:src -w\' \'rollup -c -w\'","watch:site":"concurrently --kill-others -n Typescript,Rollup \'yarn tsc:site -w\' \'rollup -c site/rollup.config.js -w\'","watch:test":"jest --watch"},"repository":{"type":"git","url":"https://github.com/vega/vega-lite.git"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/vega-lite/issues"},"devDependencies":{"@commitlint/cli":"^8.2.0","@commitlint/config-conventional":"^8.2.0","@types/chai":"^4.2.6","@types/d3":"^5.7.2","@types/highlight.js":"^9.12.3","@types/jest":"^24.0.23","@types/jest-environment-puppeteer":"^4.3.1","@types/mkdirp":"^0.5.2","@types/puppeteer":"^2.0.0","@typescript-eslint/eslint-plugin":"^2.10.0","@typescript-eslint/parser":"^2.10.0","ajv":"^6.10.2","chai":"^4.2.0","cheerio":"^1.0.0-rc.2","codecov":"^3.6.1","concurrently":"^5.0.0","d3":"^5.14.2","eslint":"^6.7.2","eslint-config-prettier":"^6.7.0","eslint-plugin-prettier":"^3.1.1","gh-pages":"^2.1.1","highlight.js":"^9.16.2","http-server":"^0.12.0","husky":"^3.1.0","jest":"^24.9.0","jest-puppeteer":"^4.3.0","lint-staged":"^9.5.0","mkdirp":"^0.5.1","prettier":"^1.19.1","puppeteer":"^2.0.0","rollup":"^1.27.8","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-terser":"^5.1.2","svg2png-many":"^0.0.7","terser":"^4.4.2","ts-jest":"^24.2.0","ts-json-schema-generator":"^0.57.0","typescript":"~3.7.3","vega-cli":"^5.9.0","vega-datasets":"^1.28.0","vega-embed":"^6.2.0","vega-tooltip":"^0.19.1","yaml-front-matter":"^4.0.0"},"dependencies":{"@types/clone":"~0.1.30","@types/fast-json-stable-stringify":"^2.0.0","array-flat-polyfill":"^1.0.1","clone":"~2.1.2","fast-deep-equal":"~3.1.1","fast-json-stable-stringify":"~2.0.0","json-stringify-pretty-compact":"~2.0.0","tslib":"~1.10.0","vega-event-selector":"~2.0.2","vega-expression":"~2.6.3","vega-typings":"~0.12.0","vega-util":"~1.12.1","yargs":"~15.0.2"},"peerDependencies":{"vega":"^5.9.0"},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"lint-staged":{"*.ts":["eslint --fix","git add"],"*.{md,css,yml}":["prettier --write","git add"]},"jest":{"preset":"jest-puppeteer","transform":{"^.+\\\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"],"testPathIgnorePatterns":["/node_modules","/build","/_site","/src"],"coverageDirectory":"./coverage/","collectCoverage":false}}')},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,s,l,c,f){"object"==typeof s&&(l=s.depth,c=s.prototype,f=s.includeNonEnumerable,s=s.circular);var d=[],h=[],p=void 0!==t;return void 0===s&&(s=!0),void 0===l&&(l=1/0),function a(l,m){if(null===l)return null;if(0===m)return l;var g,v;if("object"!=typeof l)return l;if(e(l,n))g=new n;else if(e(l,r))g=new r;else if(e(l,i))g=new i((function(e,t){l.then((function(t){e(a(t,m-1))}),(function(e){t(a(e,m-1))}))}));else if(o.__isArray(l))g=[];else if(o.__isRegExp(l))g=new RegExp(l.source,u(l)),l.lastIndex&&(g.lastIndex=l.lastIndex);else if(o.__isDate(l))g=new Date(l.getTime());else{if(p&&t.isBuffer(l))return g=t.allocUnsafe?t.allocUnsafe(l.length):new t(l.length),l.copy(g),g;e(l,Error)?g=Object.create(l):void 0===c?(v=Object.getPrototypeOf(l),g=Object.create(v)):(g=Object.create(c),v=c)}if(s){var y=d.indexOf(l);if(-1!=y)return h[y];d.push(l),h.push(g)}for(var b in e(l,n)&&l.forEach((function(e,t){var n=a(t,m-1),r=a(e,m-1);g.set(n,r)})),e(l,r)&&l.forEach((function(e){var t=a(e,m-1);g.add(t)})),l){var x;v&&(x=Object.getOwnPropertyDescriptor(v,b)),x&&null==x.set||(g[b]=a(l[b],m-1))}if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(l);for(b=0;b build/vega-themes.min.js","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples","prepublishOnly":"yarn clean && yarn build","preversion":"yarn lint","serve":"browser-sync start -s -f build examples --serveStatic examples","start":"yarn build && concurrently --kill-others -n Server,Typescript,Rollup \'yarn serve\' \'tsc -w\' \'rollup -c -w\'"},"devDependencies":{"browser-sync":"^2.26.7","concurrently":"^5.0.0","gh-pages":"^2.1.1","rollup":"^1.27.8","rollup-plugin-json":"^4.0.0","terser":"^4.4.2","typescript":"~3.7.3","vega":"^5.9.0","vega-lite":"^4.0.0","vega-lite-dev-config":"^0.3.1"},"peerDependencies":{"vega":"*","vega-lite":"*"},"beemo":{"module":"vega-lite-dev-config","drivers":["prettier","eslint"]}}')},function(e){e.exports=JSON.parse('{"name":"vega-tooltip","version":"0.19.1","description":"A tooltip plugin for Vega-Lite and Vega visualizations.","main":"build/vega-tooltip.js","module":"build/src/index.js","unpkg":"build/vega-tooltip.min.js","jsdelivr":"build/vega-tooltip.min.js","typings":"build/src/index.d.ts","repository":{"type":"git","url":"https://github.com/vega/vega-tooltip.git"},"keywords":["vega-lite","vega","tooltip"],"author":{"name":"UW Interactive Data Lab","url":"https://idl.cs.washington.edu"},"collaborators":["Dominik Moritz","Sira Horradarn","Zening Qu","Kanit Wongsuphasawat","Yuri Astrakhan","Jeffrey Heer"],"license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/vega-tooltip/issues"},"homepage":"https://github.com/vega/vega-tooltip#readme","scripts":{"prepare":"beemo create-config --silent","tsc:src":"tsc -b tsconfig.src.json","build":"yarn tsc:src && rollup -c","clean":"rm -rf build examples/data && rm -f src/style.ts","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && yarn copy:build && gh-pages -d examples && yarn clean","prettierbase":"beemo prettier \'examples/*.{html,scss,css}\'","eslintbase":"beemo eslint \'{src,test,types}/**/*.ts\'","format":"yarn eslintbase --fix && yarn prettierbase --write","lint":"yarn eslintbase && yarn prettierbase --check","postbuild":"terser build/vega-tooltip.js -c -m -o build/vega-tooltip.min.js","prebuild":"mkdir -p build && yarn copy:data && ./build-style.sh","prepublishOnly":"yarn clean && yarn build","preversion":"yarn lint","start":"yarn build && concurrently --kill-others -n Server,Typescript,Rollup \'browser-sync start -s -f build examples --serveStatic examples\' \'yarn tsc:src -w\' \'rollup -c -w\'","pretest":"./build-style.sh","test":"jest"},"devDependencies":{"@types/jest":"^24.0.18","browser-sync":"^2.26.7","concurrently":"^4.1.2","gh-pages":"^2.1.1","jest":"^24.9.0","node-sass":"^4.12.0","path":"^0.12.7","rollup":"^1.20.3","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-resolve":"^5.2.0","terser":"^4.2.1","ts-jest":"^24.0.2","typescript":"^3.6.2","vega-datasets":"^1.25.0","vega-lite-dev-config":"^0.2.5","vega-typings":"^0.8.1"},"dependencies":{"vega-util":"^1.11.1"},"beemo":{"module":"vega-lite-dev-config","drivers":["prettier","eslint"]},"jest":{"testURL":"http://localhost/","transform":{"^.+\\\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"],"testPathIgnorePatterns":["node_modules","/build","src"]}}')},function(e,t,n){"use strict";(function(e){ +var r=n(99),i=n(100),o=n(101);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 I(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return I(e).length;t=(""+t).toLowerCase(),r=!0}}function m(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 j(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return S(this,t,n);case"base64":return _(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(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:b(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):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(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 _(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(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 y(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return O(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(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 T(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 M(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 N(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 P(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 B(e,t,n,r,o){return o||P(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return o||P(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||F(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||F(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||F(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||F(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||F(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||F(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||F(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||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||F(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||F(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||F(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||F(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||F(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||F(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||F(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||F(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)||T(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||T(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||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||T(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):N(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||T(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):N(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);T(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);T(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||T(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||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||T(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):N(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||T(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):N(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(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 U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(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(34))},function(e){e.exports=JSON.parse('{"a":"4.17.0"}')},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(1));class o extends i.default.Component{render(){var e="selectable "+(this.props.selected?"selected":"");return i.default.createElement("div",{className:"card",style:{display:"inline-block"}},i.default.createElement("div",{className:e,onClick:this.props.onClick},this.props.children,i.default.createElement("div",{className:"check"},i.default.createElement("span",{className:"checkmark"},"✔"))))}}t.default=o},function(e,t,n){"use strict";n.r(t),n.d(t,"Accordion",(function(){return ge})),n.d(t,"AccordionToggle",(function(){return T})),n.d(t,"useAccordionToggle",(function(){return F})),n.d(t,"AccordionCollapse",(function(){return pe})),n.d(t,"Alert",(function(){return Le})),n.d(t,"Badge",(function(){return ze})),n.d(t,"Breadcrumb",(function(){return We})),n.d(t,"BreadcrumbItem",(function(){return Ue})),n.d(t,"Button",(function(){return qe})),n.d(t,"ButtonGroup",(function(){return Ge})),n.d(t,"ButtonToolbar",(function(){return Ke})),n.d(t,"Card",(function(){return rt})),n.d(t,"CardColumns",(function(){return it})),n.d(t,"CardDeck",(function(){return ot})),n.d(t,"CardImg",(function(){return Qe})),n.d(t,"CardGroup",(function(){return at})),n.d(t,"Carousel",(function(){return mt})),n.d(t,"CarouselItem",(function(){return ut})),n.d(t,"CloseButton",(function(){return je})),n.d(t,"Col",(function(){return yt})),n.d(t,"Collapse",(function(){return de})),n.d(t,"Dropdown",(function(){return on})),n.d(t,"DropdownButton",(function(){return un})),n.d(t,"DropdownItem",(function(){return Yt})),n.d(t,"Fade",(function(){return ke})),n.d(t,"Form",(function(){return Dn})),n.d(t,"FormControl",(function(){return xn})),n.d(t,"FormCheck",(function(){return bn})),n.d(t,"Switch",(function(){return Sn})),n.d(t,"FormGroup",(function(){return On})),n.d(t,"FormLabel",(function(){return Cn})),n.d(t,"FormText",(function(){return kn})),n.d(t,"Container",(function(){return Tn})),n.d(t,"Image",(function(){return Nn})),n.d(t,"Figure",(function(){return In})),n.d(t,"InputGroup",(function(){return qn})),n.d(t,"Jumbotron",(function(){return Gn})),n.d(t,"ListGroup",(function(){return nr})),n.d(t,"ListGroupItem",(function(){return er})),n.d(t,"Media",(function(){return or})),n.d(t,"Modal",(function(){return Hr})),n.d(t,"ModalBody",(function(){return Fr})),n.d(t,"ModalDialog",(function(){return Nr})),n.d(t,"ModalFooter",(function(){return Pr})),n.d(t,"ModalTitle",(function(){return Rr})),n.d(t,"Nav",(function(){return Jr})),n.d(t,"Navbar",(function(){return oi})),n.d(t,"NavbarBrand",(function(){return Zr})),n.d(t,"NavDropdown",(function(){return ui})),n.d(t,"NavItem",(function(){return Vr})),n.d(t,"Overlay",(function(){return hi})),n.d(t,"OverlayTrigger",(function(){return vi})),n.d(t,"PageItem",(function(){return yi})),n.d(t,"Pagination",(function(){return Ai})),n.d(t,"Popover",(function(){return Fi})),n.d(t,"PopoverContent",(function(){return ji})),n.d(t,"PopoverTitle",(function(){return Si})),n.d(t,"ProgressBar",(function(){return Pi})),n.d(t,"ResponsiveEmbed",(function(){return Li})),n.d(t,"Row",(function(){return zi})),n.d(t,"SafeAnchor",(function(){return Te})),n.d(t,"Spinner",(function(){return Ui})),n.d(t,"SplitButton",(function(){return Hi})),n.d(t,"Tab",(function(){return Xi})),n.d(t,"TabContainer",(function(){return qi})),n.d(t,"TabContent",(function(){return Vi})),n.d(t,"Table",(function(){return Ji})),n.d(t,"TabPane",(function(){return Yi})),n.d(t,"Tabs",(function(){return eo})),n.d(t,"ThemeProvider",(function(){return k})),n.d(t,"ToggleButton",(function(){return ro})),n.d(t,"ToggleButtonGroup",(function(){return oo})),n.d(t,"Tooltip",(function(){return so})),n.d(t,"Toast",(function(){return vo})),n.d(t,"ToastBody",(function(){return po})),n.d(t,"ToastHeader",(function(){return ho}));var r=n(2),i=n(3),o=n(4),a=n.n(o),s=n(1),u=n.n(s),l=n(23),c=n.n(l),f=function(){};function d(e,t){return void 0!==e[t]}function h(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}function p(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function m(e,t){return Object.keys(t).reduce((function(n,o){var a,u=n,l=u[h(o)],c=u[o],f=Object(i.a)(u,[h(o),o].map(p)),d=t[o],m=function(e,t,n){var r=Object(s.useRef)(void 0!==e),i=Object(s.useState)(t),o=i[0],a=i[1],u=void 0!==e,l=r.current;return r.current=u,!u&&l&&o!==t&&a(t),[u?e:o,Object(s.useCallback)((function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;ift(t.props.children)-1){if(!r)return;i=0}t.select(i,e,"next")}},t.handlePrev=function(e){if(!t._isSliding){var n=t.props,r=n.wrap,i=n.activeIndex-1;if(i<0){if(!r)return;i=ft(t.props.children)-1}t.select(i,e,"prev")}},t}Object(g.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.cycle()},t.getDerivedStateFromProps=function(e,t){var n=t.activeIndex;if(e.activeIndex!==n){var r=ft(e.children)-1,i=Math.max(0,Math.min(e.activeIndex,r));return{direction:0===i&&n>=r||n<=i?"next":"prev",previousActiveIndex:n,activeIndex:i}}return null},n.componentDidUpdate=function(e,t){var n=this,r=this.props,i=r.bsPrefix,o=r.slide,s=r.onSlideEnd;if(o&&this.state.activeIndex!==t.activeIndex&&!this._isSliding){var u,l,c=this.state,f=c.activeIndex,d=c.direction;"next"===d?(u=i+"-item-next",l=i+"-item-left"):"prev"===d&&(u=i+"-item-prev",l=i+"-item-right"),this._isSliding=!0,this.pause(),this.safeSetState({prevClasses:"active",currentClasses:u},(function(){var e=n.carousel.current.children[f];se(e),n.safeSetState({prevClasses:a()("active",l),currentClasses:a()(u,l)},(function(){return K(e,(function(){n.safeSetState({prevClasses:"",currentClasses:"active"},n.handleSlideEnd),s&&s()}))}))}))}},n.componentWillUnmount=function(){clearTimeout(this.timeout),this.isUnmounted=!0},n.safeSetState=function(e,t){var n=this;this.isUnmounted||this.setState(e,(function(){return!n.isUnmounted&&t()}))},n.pause=function(){this._isPaused=!0,clearInterval(this._interval),this._interval=null},n.cycle=function(){this._isPaused=!1,clearInterval(this._interval),this._interval=null,this.props.interval&&!this._isPaused&&(this._interval=setInterval(document.visibilityState?this.handleNextWhenVisible:this.handleNext,this.props.interval))},n.to=function(e,t){var n=this.props.children;e<0||e>ft(n)-1||(this._isSliding?this._pendingIndex=e:this.select(e,t))},n.select=function(e,t,n){var r=this;clearTimeout(this.selectThrottle),t&&t.persist&&t.persist(),this.selectThrottle=setTimeout((function(){clearTimeout(r.timeout);var i=r.props,o=i.activeIndex,a=i.onSelect;e===o||r._isSliding||r.isUnmounted||a(e,n||(e1?a-1:0),u=1;u *"},Wt.Menu=Lt,Wt.Toggle=Ut;var Ht=Wt,qt=u.a.createContext(null),Vt={as:Te,disabled:!1},Gt=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.children,c=e.eventKey,f=e.disabled,d=e.href,h=e.onClick,p=e.onSelect,m=e.active,g=e.as,v=Object(i.a)(e,["bsPrefix","className","children","eventKey","disabled","href","onClick","onSelect","active","as"]),b=C(n,"dropdown-item"),y=Object(s.useContext)(j),x=(Object(s.useContext)(qt)||{}).activeKey,w=S(c,d),O=null==m&&null!=w?S(x)===w:m,E=be((function(e){f||(h&&h(e),y&&y(w,e),p&&p(w,e))}));return u.a.createElement(g,Object(r.a)({},v,{ref:t,href:d,disabled:f,className:a()(o,b,O&&"active",f&&"disabled"),onClick:E}),l)}));Gt.displayName="DropdownItem",Gt.defaultProps=Vt;var Yt=Gt,Kt=function(e){return e&&"function"!=typeof e?function(t){e.current=t}:e};var Xt=function(e,t){return Object(s.useMemo)((function(){return function(e,t){var n=Kt(e),r=Kt(t);return function(e){n&&n(e),r&&r(e)}}(e,t)}),[e,t])},Jt=u.a.createContext(null);function Qt(e,t){return e}var Zt=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.alignRight,c=e.rootCloseEvent,f=e.flip,d=e.popperConfig,h=e.show,p=e.as,m=void 0===p?"div":p,g=Object(i.a)(e,["bsPrefix","className","alignRight","rootCloseEvent","flip","popperConfig","show","as"]),v=Object(s.useContext)(Jt),b=C(n,"dropdown-menu"),y=Nt({flip:f,popperConfig:d,rootCloseEvent:c,show:h,alignEnd:l,usePopper:!v}),x=y.hasShown,w=y.placement,O=y.show,E=y.alignEnd,_=y.close,k=y.props;if(k.ref=Xt(k.ref,Qt(t)),!x)return null;"string"!=typeof m&&(k.show=O,k.close=_,k.alignRight=E);var A=g.style;return w&&(A=Object(r.a)({},A,{},k.style),g["x-placement"]=w),u.a.createElement(m,Object(r.a)({},g,k,{style:A,className:a()(o,b,O&&"show",E&&b+"-right")}))}));Zt.displayName="DropdownMenu",Zt.defaultProps={alignRight:!1,flip:!0};var en=Zt,tn=(n(40),u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.split,s=e.className,l=e.children,c=e.childBsPrefix,f=e.as,d=void 0===f?qe:f,h=Object(i.a)(e,["bsPrefix","split","className","children","childBsPrefix","as"]),p=C(n,"dropdown-toggle");void 0!==c&&(h.bsPrefix=c);var m=Rt(),g=m[0],v=m[1].toggle;return g.ref=Xt(g.ref,Qt(t)),u.a.createElement(d,Object(r.a)({onClick:v,className:a()(s,p,o&&p+"-split")},g,h),l)})));tn.displayName="DropdownToggle";var nn=tn,rn=u.a.forwardRef((function(e,t){var n=m(e,{show:"onToggle"}),o=n.bsPrefix,l=n.drop,c=n.show,f=n.className,d=n.alignRight,h=n.onSelect,p=n.onToggle,g=n.focusFirstItemOnShow,v=n.as,b=void 0===v?"div":v,y=(n.navbar,Object(i.a)(n,["bsPrefix","drop","show","className","alignRight","onSelect","onToggle","focusFirstItemOnShow","as","navbar"])),x=Object(s.useContext)(j),w=C(o,"dropdown"),O=be((function(e,t,n){void 0===n&&(n=t.type),t.currentTarget===document&&(n="rootClose"),p(e,t,{source:n})})),E=be((function(e,t){x&&x(e,t),h&&h(e,t),O(!1,t,"select")}));return u.a.createElement(j.Provider,{value:E},u.a.createElement(Ht,{drop:l,show:c,alignEnd:d,onToggle:O,focusFirstItemOnShow:g,itemSelector:"."+w+"-item:not(.disabled):not(:disabled)"},(function(e){var n=e.props;return u.a.createElement(b,Object(r.a)({},y,n,{ref:t,className:a()(f,c&&"show",(!l||"down"===l)&&w,"up"===l&&"dropup","right"===l&&"dropright","left"===l&&"dropleft")}))})))}));rn.displayName="Dropdown",rn.defaultProps={navbar:!1},rn.Toggle=nn,rn.Menu=en,rn.Item=Yt,rn.Header=we("dropdown-header",{defaultProps:{role:"heading"}}),rn.Divider=we("dropdown-divider",{defaultProps:{role:"separator"}});var on=rn,an={id:J.a.any,href:J.a.string,onClick:J.a.func,title:J.a.node.isRequired,disabled:J.a.bool,menuRole:J.a.string,rootCloseEvent:J.a.string,bsPrefix:J.a.string,variant:J.a.string,size:J.a.string},sn=u.a.forwardRef((function(e,t){var n=e.title,o=e.children,a=e.bsPrefix,s=e.rootCloseEvent,l=e.variant,c=e.size,f=e.menuRole,d=e.disabled,h=e.href,p=e.id,m=Object(i.a)(e,["title","children","bsPrefix","rootCloseEvent","variant","size","menuRole","disabled","href","id"]);return u.a.createElement(on,Object(r.a)({ref:t},m),u.a.createElement(on.Toggle,{id:p,href:h,size:c,variant:l,disabled:d,childBsPrefix:a},n),u.a.createElement(on.Menu,{role:f,rootCloseEvent:s},o))}));sn.displayName="DropdownButton",sn.propTypes=an;var un=sn,ln=(n(63),{type:J.a.string.isRequired,as:J.a.elementType}),cn=u.a.forwardRef((function(e,t){var n=e.as,o=void 0===n?"div":n,s=e.className,l=e.type,c=Object(i.a)(e,["as","className","type"]);return u.a.createElement(o,Object(r.a)({},c,{ref:t,className:a()(s,l&&l+"-feedback")}))}));cn.displayName="Feedback",cn.propTypes=ln,cn.defaultProps={type:"valid"};var fn=cn,dn=u.a.createContext({controlId:void 0}),hn=u.a.forwardRef((function(e,t){var n=e.id,o=e.bsPrefix,l=e.bsCustomPrefix,c=e.className,f=e.isValid,d=e.isInvalid,h=e.isStatic,p=e.as,m=void 0===p?"input":p,g=Object(i.a)(e,["id","bsPrefix","bsCustomPrefix","className","isValid","isInvalid","isStatic","as"]),v=Object(s.useContext)(dn),b=v.controlId;return o=v.custom?C(l,"custom-control-input"):C(o,"form-check-input"),u.a.createElement(m,Object(r.a)({},g,{ref:t,id:n||b,className:a()(c,o,f&&"is-valid",d&&"is-invalid",h&&"position-static")}))}));hn.displayName="FormCheckInput",hn.defaultProps={type:"checkbox"};var pn=hn,mn=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.bsCustomPrefix,l=e.className,c=e.htmlFor,f=Object(i.a)(e,["bsPrefix","bsCustomPrefix","className","htmlFor"]),d=Object(s.useContext)(dn),h=d.controlId;return n=d.custom?C(o,"custom-control-label"):C(n,"form-check-label"),u.a.createElement("label",Object(r.a)({},f,{ref:t,htmlFor:c||h,className:a()(l,n)}))}));mn.displayName="FormCheckLabel";var gn=mn,vn=u.a.forwardRef((function(e,t){var n=e.id,o=e.bsPrefix,l=e.bsCustomPrefix,c=e.inline,f=e.disabled,d=e.isValid,h=e.isInvalid,p=e.feedback,m=e.className,g=e.style,v=e.title,b=e.type,y=e.label,x=e.children,w=e.custom,O=e.as,E=void 0===O?"input":O,_=Object(i.a)(e,["id","bsPrefix","bsCustomPrefix","inline","disabled","isValid","isInvalid","feedback","className","style","title","type","label","children","custom","as"]),k="switch"===b||w;o=k?C(l,"custom-control"):C(o,"form-check");var A=Object(s.useContext)(dn).controlId,S=Object(s.useMemo)((function(){return{controlId:n||A,custom:k}}),[A,k,n]),j=null!=y&&!1!==y&&!x,D=u.a.createElement(pn,Object(r.a)({},_,{type:"switch"===b?"checkbox":b,ref:t,isValid:d,isInvalid:h,isStatic:!j,disabled:f,as:E}));return u.a.createElement(dn.Provider,{value:S},u.a.createElement("div",{style:g,className:a()(m,o,k&&"custom-"+b,c&&o+"-inline")},x||u.a.createElement(u.a.Fragment,null,D,j&&u.a.createElement(gn,{title:v},y),(d||h)&&u.a.createElement(fn,{type:d?"valid":"invalid"},p))))}));vn.displayName="FormCheck",vn.defaultProps={type:"checkbox",inline:!1,disabled:!1,isValid:!1,isInvalid:!1,title:""},vn.Input=pn,vn.Label=gn;var bn=vn,yn=u.a.forwardRef((function(e,t){var n,o,l=e.bsPrefix,c=e.type,f=e.size,d=e.id,h=e.className,p=e.isValid,m=e.isInvalid,g=e.plaintext,v=e.readOnly,b=e.as,y=void 0===b?"input":b,x=Object(i.a)(e,["bsPrefix","type","size","id","className","isValid","isInvalid","plaintext","readOnly","as"]),w=Object(s.useContext)(dn).controlId;if(l=C(l,"form-control"),g)(o={})[l+"-plaintext"]=!0,n=o;else if("file"===c){var O;(O={})[l+"-file"]=!0,n=O}else{var E;(E={})[l]=!0,E[l+"-"+f]=f,n=E}return u.a.createElement(y,Object(r.a)({},x,{type:c,ref:t,readOnly:v,id:d||w,className:a()(h,n,p&&"is-valid",m&&"is-invalid")}))}));yn.displayName="FormControl",yn.Feedback=fn;var xn=yn,wn=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.children,c=e.controlId,f=e.as,d=void 0===f?"div":f,h=Object(i.a)(e,["bsPrefix","className","children","controlId","as"]);n=C(n,"form-group");var p=Object(s.useMemo)((function(){return{controlId:c}}),[c]);return u.a.createElement(dn.Provider,{value:p},u.a.createElement(d,Object(r.a)({},h,{ref:t,className:a()(o,n)}),l))}));wn.displayName="FormGroup";var On=wn,En=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.column,l=e.srOnly,c=e.className,f=e.htmlFor,d=Object(i.a)(e,["bsPrefix","column","srOnly","className","htmlFor"]),h=Object(s.useContext)(dn).controlId;n=C(n,"form-label");var p=a()(c,n,l&&"sr-only",o&&"col-form-label");return f=f||h,o?u.a.createElement(yt,Object(r.a)({as:"label",className:p,htmlFor:f},d)):u.a.createElement("label",Object(r.a)({ref:t,className:p,htmlFor:f},d))}));En.displayName="FormLabel",En.defaultProps={column:!1,srOnly:!1};var Cn=En,_n=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,s=e.as,l=void 0===s?"small":s,c=e.muted,f=Object(i.a)(e,["bsPrefix","className","as","muted"]);return n=C(n,"form-text"),u.a.createElement(l,Object(r.a)({},f,{ref:t,className:a()(o,n,c&&"text-muted")}))}));_n.displayName="FormText";var kn=_n,An=u.a.forwardRef((function(e,t){return u.a.createElement(bn,Object(r.a)({},e,{ref:t,type:"switch"}))}));An.displayName="Switch",An.Input=bn.Input,An.Label=bn.Label;var Sn=An,jn=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.inline,s=e.className,l=e.validated,c=e.as,f=void 0===c?"form":c,d=Object(i.a)(e,["bsPrefix","inline","className","validated","as"]);return n=C(n,"form"),u.a.createElement(f,Object(r.a)({},d,{ref:t,className:a()(s,l&&"was-validated",o&&n+"-inline")}))}));jn.displayName="Form",jn.defaultProps={inline:!1},jn.Row=we("form-row"),jn.Group=On,jn.Control=xn,jn.Check=bn,jn.Switch=Sn,jn.Label=Cn,jn.Text=kn;var Dn=jn,Fn=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.fluid,s=e.as,l=void 0===s?"div":s,c=e.className,f=Object(i.a)(e,["bsPrefix","fluid","as","className"]),d=C(n,"container");return u.a.createElement(l,Object(r.a)({ref:t},f,{className:a()(c,o?d+"-fluid":d)}))}));Fn.displayName="Container",Fn.defaultProps={fluid:!1};var Tn=Fn,Mn=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,s=e.fluid,l=e.rounded,c=e.roundedCircle,f=e.thumbnail,d=Object(i.a)(e,["bsPrefix","className","fluid","rounded","roundedCircle","thumbnail"]);n=C(n,"img");var h=a()(s&&n+"-fluid",l&&"rounded",c&&"rounded-circle",f&&n+"-thumbnail");return u.a.createElement("img",Object(r.a)({ref:t},d,{className:a()(o,h)}))}));Mn.displayName="Image",Mn.defaultProps={fluid:!1,rounded:!1,roundedCircle:!1,thumbnail:!1};var Nn=Mn,Pn={bsPrefix:J.a.string,fluid:J.a.bool,rounded:J.a.bool,roundedCircle:J.a.bool,thumbnail:J.a.bool},Bn=u.a.forwardRef((function(e,t){var n=e.className,o=Object(i.a)(e,["className"]);return u.a.createElement(Nn,Object(r.a)({ref:t},o,{className:a()(n,"figure-img")}))}));Bn.displayName="FigureImage",Bn.propTypes=Pn,Bn.defaultProps={fluid:!0};var Ln=Bn,Rn=we("figure-caption",{Component:"figcaption"}),zn=we("figure",{Component:"figure"});zn.Image=Ln,zn.Caption=Rn;var In=zn,Un=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.size,s=e.className,l=e.as,c=void 0===l?"div":l,f=Object(i.a)(e,["bsPrefix","size","className","as"]);return n=C(n,"input-group"),u.a.createElement(c,Object(r.a)({ref:t},f,{className:a()(s,n,o&&n+"-"+o)}))})),$n=we("input-group-append"),Wn=we("input-group-prepend"),Hn=we("input-group-text",{Component:"span"});Un.displayName="InputGroup",Un.Text=Hn,Un.Radio=function(e){return u.a.createElement(Hn,null,u.a.createElement("input",Object(r.a)({type:"radio"},e)))},Un.Checkbox=function(e){return u.a.createElement(Hn,null,u.a.createElement("input",Object(r.a)({type:"checkbox"},e)))},Un.Append=$n,Un.Prepend=Wn;var qn=Un,Vn=u.a.forwardRef((function(e,t){var n,o=e.as,s=void 0===o?"div":o,l=e.className,c=e.fluid,f=e.bsPrefix,d=Object(i.a)(e,["as","className","fluid","bsPrefix"]),h=((n={})[f=C(f,"jumbotron")]=!0,n[f+"-fluid"]=c,n);return u.a.createElement(s,Object(r.a)({ref:t},d,{className:a()(l,h)}))}));Vn.defaultProps={fluid:!1},Vn.displayName="Jumbotron";var Gn=Vn,Yn=u.a.createContext(null),Kn=function(){},Xn=u.a.forwardRef((function(e,t){var n,o,a=e.as,l=void 0===a?"ul":a,c=e.onSelect,f=e.activeKey,d=e.role,h=e.onKeyDown,p=Object(i.a)(e,["as","onSelect","activeKey","role","onKeyDown"]),m=Et(),g=Object(s.useRef)(!1),v=Object(s.useContext)(j),b=Object(s.useContext)(Yn);b&&(d=d||"tablist",f=b.activeKey,n=b.getControlledId,o=b.getControllerId);var y=Object(s.useRef)(null),x=function(e){if(!y.current)return null;var t=wt(y.current,"[data-rb-event-key]:not(.disabled)"),n=y.current.querySelector(".active"),r=t.indexOf(n);if(-1===r)return null;var i=r+e;return i>=t.length&&(i=0),i<0&&(i=t.length-1),t[i]},w=function(e,t){null!=e&&(c&&c(e,t),v&&v(e,t))};Object(s.useEffect)((function(){if(y.current&&g.current){var e=y.current.querySelector("[data-rb-event-key].active");e&&e.focus()}g.current=!1}));var O=Xt(t,y);return u.a.createElement(j.Provider,{value:w},u.a.createElement(qt.Provider,{value:{role:d,activeKey:S(f),getControlledId:n||Kn,getControllerId:o||Kn}},u.a.createElement(l,Object(r.a)({},p,{onKeyDown:function(e){var t;switch(h&&h(e),e.key){case"ArrowLeft":case"ArrowUp":t=x(-1);break;case"ArrowRight":case"ArrowDown":t=x(1);break;default:return}t&&(e.preventDefault(),w(t.dataset.rbEventKey,e),g.current=!0,m())},ref:O,role:d}))))})),Jn=u.a.forwardRef((function(e,t){var n=e.active,o=e.className,l=e.tabIndex,c=e.eventKey,f=e.onSelect,d=e.onClick,h=e.as,p=Object(i.a)(e,["active","className","tabIndex","eventKey","onSelect","onClick","as"]),m=S(c,p.href),g=Object(s.useContext)(j),v=Object(s.useContext)(qt),b=n;v&&(p.role||"tablist"!==v.role||(p.role="tab"),p["data-rb-event-key"]=m,p.id=v.getControllerId(m),p["aria-controls"]=v.getControlledId(m),b=null==n&&null!=m?v.activeKey===m:n),"tab"===p.role&&(p.tabIndex=b?l:-1,p["aria-selected"]=b);var y=be((function(e){d&&d(e),null!=m&&(f&&f(m,e),g&&g(m,e))}));return u.a.createElement(h,Object(r.a)({},p,{ref:t,onClick:y,className:a()(o,b&&"active")}))}));Jn.defaultProps={disabled:!1};var Qn=Jn,Zn=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.active,l=e.disabled,c=e.className,f=e.variant,d=e.action,h=e.as,p=e.eventKey,m=e.onClick,g=Object(i.a)(e,["bsPrefix","active","disabled","className","variant","action","as","eventKey","onClick"]);n=C(n,"list-group-item");var v=Object(s.useCallback)((function(e){if(l)return e.preventDefault(),void e.stopPropagation();m&&m(e)}),[l,m]);return u.a.createElement(Qn,Object(r.a)({ref:t},g,{eventKey:S(p,g.href),as:h||(d?g.href?"a":"button":"div"),onClick:v,className:a()(c,n,o&&"active",l&&"disabled",f&&n+"-"+f,d&&n+"-action")}))}));Zn.defaultProps={variant:null,active:!1,disabled:!1},Zn.displayName="ListGroupItem";var er=Zn,tr=u.a.forwardRef((function(e,t){var n,o=m(e,{activeKey:"onSelect"}),s=o.className,l=o.bsPrefix,c=o.variant,f=o.horizontal,d=o.as,h=void 0===d?"div":d,p=Object(i.a)(o,["className","bsPrefix","variant","horizontal","as"]);return l=C(l,"list-group"),n=f?!0===f?"horizontal":"horizontal-"+f:null,u.a.createElement(Xn,Object(r.a)({ref:t},p,{as:h,className:a()(s,l,c&&l+"-"+c,n&&l+"-"+n)}))}));tr.defaultProps={variant:null,horizontal:null},tr.displayName="ListGroup",tr.Item=er;var nr=tr,rr=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,s=e.as,l=void 0===s?"div":s,c=Object(i.a)(e,["bsPrefix","className","as"]),f=C(n,"media");return u.a.createElement(l,Object(r.a)({},c,{ref:t,className:a()(o,f)}))}));rr.displayName="Media",rr.Body=we("media-body");var ir,or=rr;function ar(e){if((!ir&&0!==ir||e)&&I){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),ir=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return ir}var sr=n(19);function ur(e){void 0===e&&(e=M());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(t){return e.body}}function lr(e,t){e.classList?e.classList.add(t):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function cr(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function fr(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=cr(e.className,t):e.setAttribute("class",cr(e.className&&e.className.baseVal||"",t))}function dr(e){return"window"in e&&e.window===e?e:"nodeType"in(t=e)&&t.nodeType===document.DOCUMENT_NODE&&e.defaultView||!1;var t}function hr(e){var t;return dr(e)||(t=e)&&"body"===t.tagName.toLowerCase()?function(e){var t=M(e),n=dr(t);return t.body.clientWidthe.clientHeight}var pr=["template","script","style"],mr=function(e,t,n){t=[].concat(t),[].forEach.call(e.children,(function(e){var r,i,o;-1===t.indexOf(e)&&(i=(r=e).nodeType,o=r.tagName,1===i&&-1===pr.indexOf(o.toLowerCase()))&&n(e)}))};function gr(e,t){t&&(e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden"))}var vr=function(){function e(e){var t=void 0===e?{}:e,n=t.hideSiblingNodes,r=void 0===n||n,i=t.handleContainerOverflow,o=void 0===i||i;this.hideSiblingNodes=r,this.handleContainerOverflow=o,this.modals=[],this.containers=[],this.data=[],this.scrollbarSize=ar()}var t=e.prototype;return t.isContainerOverflowing=function(e){var t=this.data[this.containerIndexFromModal(e)];return t&&t.overflowing},t.containerIndexFromModal=function(e){return t=this.data,n=function(t){return-1!==t.modals.indexOf(e)},r=-1,t.some((function(e,t){return!!n(e,t)&&(r=t,!0)})),r;var t,n,r},t.setContainerStyle=function(e,t){var n={overflow:"hidden"};e.style={overflow:t.style.overflow,paddingRight:t.style.paddingRight},e.overflowing&&(n.paddingRight=parseInt(z(t,"paddingRight")||0,10)+this.scrollbarSize+"px"),z(t,n)},t.removeContainerStyle=function(e,t){var n=e.style;Object.keys(n).forEach((function(e){t.style[e]=n[e]}))},t.add=function(e,t,n){var r=this.modals.indexOf(e),i=this.containers.indexOf(t);if(-1!==r)return r;if(r=this.modals.length,this.modals.push(e),this.hideSiblingNodes&&function(e,t){var n=t.dialog,r=t.backdrop;mr(e,[n,r],(function(e){return gr(!0,e)}))}(t,e),-1!==i)return this.data[i].modals.push(e),r;var o={modals:[e],classes:n?n.split(/\s+/):[],overflowing:hr(t)};return this.handleContainerOverflow&&this.setContainerStyle(o,t),o.classes.forEach(lr.bind(null,t)),this.containers.push(t),this.data.push(o),r},t.remove=function(e){var t=this.modals.indexOf(e);if(-1!==t){var n=this.containerIndexFromModal(e),r=this.data[n],i=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.classes.forEach(fr.bind(null,i)),this.handleContainerOverflow&&this.removeContainerStyle(r,i),this.hideSiblingNodes&&function(e,t){var n=t.dialog,r=t.backdrop;mr(e,[n,r],(function(e){return gr(!1,e)}))}(i,e),this.containers.splice(n,1),this.data.splice(n,1);else if(this.hideSiblingNodes){var o=r.modals[r.modals.length-1],a=o.backdrop;gr(!1,o.dialog),gr(!1,a)}}},t.isTopModal=function(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e},e}(),br=function(e){return M(Z.a.findDOMNode(e))},yr=function(e){if("undefined"!=typeof document)return null==e?M().body:("function"==typeof e&&(e=e()),e&&e.current&&(e=e.current),e&&e.nodeType?e:null)};function xr(e,t){var n=Object(s.useState)((function(){return yr(e)})),r=n[0],i=n[1];if(!r){var o=yr(e);o&&i(o)}return Object(s.useEffect)((function(){t&&r&&t(r)}),[t,r]),Object(s.useEffect)((function(){var t=yr(e);t!==r&&i(t)}),[e,r]),r}var wr=new vr;var Or=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o1?r-1:0),o=1;o1?r-1:0),o=1;oM(e).documentElement.clientHeight;this.setState({style:{paddingRight:t&&!n?ar():void 0,paddingLeft:!t&&n?ar():void 0}})}},n.render=function(){var e=this.props,t=e.bsPrefix,n=e.className,o=e.style,s=e.dialogClassName,l=e.children,c=e.dialogAs,f=e.show,d=e.animation,h=e.backdrop,p=e.keyboard,m=e.manager,g=e.onEscapeKeyDown,v=e.onShow,b=e.onHide,y=e.container,x=e.autoFocus,w=e.enforceFocus,O=e.restoreFocus,E=e.onEntered,C=e.onExit,_=e.onExiting,k=(e.onExited,e.onEntering,e.onEnter,e.onEntering,e.backdropClassName,Object(i.a)(e,["bsPrefix","className","style","dialogClassName","children","dialogAs","show","animation","backdrop","keyboard","manager","onEscapeKeyDown","onShow","onHide","container","autoFocus","enforceFocus","restoreFocus","onEntered","onExit","onExiting","onExited","onEntering","onEnter","onEntering","backdropClassName"])),A=!0===h?this.handleClick:null,S=Object(r.a)({},o,{},this.state.style);return d||(S.display="block"),u.a.createElement(Tr.Provider,{value:this.modalContext},u.a.createElement(kr,{show:f,backdrop:h,container:y,keyboard:p,autoFocus:x,enforceFocus:w,restoreFocus:O,onEscapeKeyDown:g,onShow:v,onHide:b,onEntered:E,onExit:C,onExiting:_,manager:m,ref:this.setModalRef,style:S,className:a()(n,t),containerClassName:t+"-open",transition:d?Ir:void 0,backdropTransition:d?Ur:void 0,renderBackdrop:this.renderBackdrop,onClick:A,onMouseUp:this.handleMouseUp,onEnter:this.handleEnter,onEntering:this.handleEntering,onExited:this.handleExited},u.a.createElement(c,Object(r.a)({},k,{onMouseDown:this.handleDialogMouseDown,className:s}),l)))},t}(u.a.Component);$r.defaultProps=zr;var Wr=_($r,"modal");Wr.Body=Fr,Wr.Header=Lr,Wr.Title=Rr,Wr.Footer=Pr,Wr.Dialog=Nr,Wr.TRANSITION_DURATION=300,Wr.BACKDROP_TRANSITION_DURATION=150;var Hr=Wr,qr=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,s=e.children,l=e.as,c=void 0===l?"div":l,f=Object(i.a)(e,["bsPrefix","className","children","as"]);return n=C(n,"nav-item"),u.a.createElement(c,Object(r.a)({},f,{ref:t,className:a()(o,n)}),s)}));qr.displayName="NavItem";var Vr=qr,Gr={disabled:!1,as:Te},Yr=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.disabled,s=e.className,l=e.href,c=e.eventKey,f=e.onSelect,d=e.as,h=Object(i.a)(e,["bsPrefix","disabled","className","href","eventKey","onSelect","as"]);return n=C(n,"nav-link"),u.a.createElement(Qn,Object(r.a)({},h,{href:l,ref:t,eventKey:c,as:d,disabled:o,onSelect:f,className:a()(s,n,o&&"disabled")}))}));Yr.displayName="NavLink",Yr.defaultProps=Gr;var Kr=Yr,Xr=u.a.forwardRef((function(e,t){var n,o,l,c=m(e,{activeKey:"onSelect"}),f=c.as,d=void 0===f?"div":f,h=c.bsPrefix,p=c.variant,g=c.fill,v=c.justify,b=c.navbar,y=c.className,x=c.children,w=c.activeKey,O=Object(i.a)(c,["as","bsPrefix","variant","fill","justify","navbar","className","children","activeKey"]);h=C(h,"nav");var E=Object(s.useContext)(Jt),_=Object(s.useContext)(Xe);return E?(o=E.bsPrefix,b=null==b||b):_&&(l=_.cardHeaderBsPrefix),u.a.createElement(Xn,Object(r.a)({as:d,ref:t,activeKey:w,className:a()(y,(n={},n[h]=!b,n[o+"-nav"]=b,n[l+"-"+p]=!!l,n[h+"-"+p]=!!p,n[h+"-fill"]=g,n[h+"-justified"]=v,n))},O),x)}));Xr.displayName="Nav",Xr.defaultProps={justify:!1,fill:!1},Xr.Item=Vr,Xr.Link=Kr;var Jr=Xr,Qr=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,s=e.as,l=Object(i.a)(e,["bsPrefix","className","as"]);n=C(n,"navbar-brand");var c=s||(l.href?"a":"span");return u.a.createElement(c,Object(r.a)({},l,{ref:t,className:a()(o,n)}))}));Qr.displayName="NavbarBrand";var Zr=Qr,ei=u.a.forwardRef((function(e,t){var n=e.children,o=e.bsPrefix,a=Object(i.a)(e,["children","bsPrefix"]);return o=C(o,"navbar-collapse"),u.a.createElement(Jt.Consumer,null,(function(e){return u.a.createElement(de,Object(r.a)({in:!(!e||!e.expanded)},a),u.a.createElement("div",{ref:t,className:o},n))}))}));ei.displayName="NavbarCollapse";var ti=ei,ni=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.children,c=e.label,f=e.as,d=void 0===f?"button":f,h=e.onClick,p=Object(i.a)(e,["bsPrefix","className","children","label","as","onClick"]);n=C(n,"navbar-toggler");var m=Object(s.useContext)(Jt)||{},g=m.onToggle,v=m.expanded,b=be((function(e){h&&h(e),g&&g()}));return"button"===d&&(p.type="button"),u.a.createElement(d,Object(r.a)({},p,{ref:t,onClick:b,"aria-label":c,className:a()(o,n,!v&&"collapsed")}),l||u.a.createElement("span",{className:n+"-icon"}))}));ni.displayName="NavbarToggle",ni.defaultProps={label:"Toggle navigation"};var ri=ni,ii=u.a.forwardRef((function(e,t){var n=m(e,{expanded:"onToggle"}),o=n.bsPrefix,l=n.expand,c=n.variant,f=n.bg,d=n.fixed,h=n.sticky,p=n.className,g=n.children,v=n.as,b=void 0===v?"nav":v,y=n.expanded,x=n.onToggle,w=n.onSelect,O=n.collapseOnSelect,E=Object(i.a)(n,["bsPrefix","expand","variant","bg","fixed","sticky","className","children","as","expanded","onToggle","onSelect","collapseOnSelect"]);o=C(o,"navbar");var _=Object(s.useCallback)((function(){w&&w.apply(void 0,arguments),O&&y&&x(!1)}),[w,O,y,x]);void 0===E.role&&"nav"!==b&&(E.role="navigation");var k=o+"-expand";"string"==typeof l&&(k=k+"-"+l);var A=Object(s.useMemo)((function(){return{onToggle:function(){return x(!y)},bsPrefix:o,expanded:y}}),[o,y,x]);return u.a.createElement(Jt.Provider,{value:A},u.a.createElement(j.Provider,{value:_},u.a.createElement(b,Object(r.a)({ref:t},E,{className:a()(p,o,l&&k,c&&o+"-"+c,f&&"bg-"+f,h&&"sticky-"+h,d&&"fixed-"+d)}),g)))}));ii.defaultProps={expand:!0,variant:"light",collapseOnSelect:!1},ii.displayName="Navbar",ii.Brand=Zr,ii.Toggle=ri,ii.Collapse=ti,ii.Text=we("navbar-text",{Component:"span"});var oi=ii,ai={id:J.a.any,onClick:J.a.func,title:J.a.node.isRequired,disabled:J.a.bool,active:J.a.bool,menuRole:J.a.string,rootCloseEvent:J.a.string,bsPrefix:J.a.string},si=u.a.forwardRef((function(e,t){var n=e.id,o=e.title,a=e.children,s=e.bsPrefix,l=e.rootCloseEvent,c=e.menuRole,f=e.disabled,d=e.active,h=Object(i.a)(e,["id","title","children","bsPrefix","rootCloseEvent","menuRole","disabled","active"]);return u.a.createElement(on,Object(r.a)({ref:t},h,{as:Vr}),u.a.createElement(on.Toggle,{id:n,eventKey:null,active:d,disabled:f,childBsPrefix:s,as:Kr},o),u.a.createElement(on.Menu,{role:c,rootCloseEvent:l},a))}));si.displayName="NavDropdown",si.propTypes=ai,si.Item=on.Item,si.Divider=on.Divider,si.Header=on.Header;var ui=si,li=u.a.forwardRef((function(e,t){var n=e.flip,o=e.placement,a=e.containerPadding,l=e.popperConfig,c=void 0===l?{}:l,f=e.transition,d=Ot(),h=d[0],p=d[1],m=Ot(),g=m[0],v=m[1],b=Xt(p,t),y=xr(e.container),x=xr(e.target),w=Object(s.useState)(!e.show),O=w[0],E=w[1],C=c.modifiers,_=void 0===C?{}:C,k=St(x,h,Object(r.a)({},c,{placement:o||"bottom",enableEvents:e.show,modifiers:Object(r.a)({},_,{preventOverflow:Object(r.a)({padding:a||5},_.preventOverflow),arrow:Object(r.a)({},_.arrow,{enabled:!!g,element:g}),flip:Object(r.a)({enabled:!!n},_.preventOverflow)})})),A=k.styles,S=k.arrowStyles,j=Object(i.a)(k,["styles","arrowStyles"]);e.show?O&&E(!1):e.transition||O||E(!0);var D=e.show||f&&!O;if(Mt(h,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!D)return null;var F=e.children(Object(r.a)({},j,{show:e.show,props:{style:A,ref:b},arrowProps:{style:S,ref:v}}));if(f){var T=e.onExit,M=e.onExiting,N=e.onEnter,P=e.onEntering,B=e.onEntered;F=u.a.createElement(f,{in:e.show,appear:!0,onExit:T,onExiting:M,onExited:function(){E(!0),e.onExited&&e.onExited.apply(e,arguments)},onEnter:N,onEntering:P,onEntered:B},F)}return y?Z.a.createPortal(F,y):null}));li.displayName="Overlay",li.propTypes={show:J.a.bool,placement:J.a.oneOf(_t.a.placements),target:J.a.any,container:J.a.any,flip:J.a.bool,children:J.a.func.isRequired,containerPadding:J.a.number,popperConfig:J.a.object,rootClose:J.a.bool,rootCloseEvent:J.a.oneOf(["click","mousedown"]),rootCloseDisabled:J.a.bool,onHide:function(e){var t=J.a.func;e.rootClose&&(t=t.isRequired);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i build/vega-themes.min.js","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples","prepublishOnly":"yarn clean && yarn build","preversion":"yarn lint","serve":"browser-sync start -s -f build examples --serveStatic examples","start":"yarn build && concurrently --kill-others -n Server,Typescript,Rollup \'yarn serve\' \'tsc -w\' \'rollup -c -w\'"},"devDependencies":{"browser-sync":"^2.26.7","concurrently":"^5.0.0","gh-pages":"^2.1.1","rollup":"^1.27.8","rollup-plugin-json":"^4.0.0","terser":"^4.4.2","typescript":"~3.7.3","vega":"^5.9.0","vega-lite":"^4.0.0","vega-lite-dev-config":"^0.3.1"},"peerDependencies":{"vega":"*","vega-lite":"*"},"beemo":{"module":"vega-lite-dev-config","drivers":["prettier","eslint"]}}')},function(e){e.exports=JSON.parse('{"name":"vega-tooltip","version":"0.19.1","description":"A tooltip plugin for Vega-Lite and Vega visualizations.","main":"build/vega-tooltip.js","module":"build/src/index.js","unpkg":"build/vega-tooltip.min.js","jsdelivr":"build/vega-tooltip.min.js","typings":"build/src/index.d.ts","repository":{"type":"git","url":"https://github.com/vega/vega-tooltip.git"},"keywords":["vega-lite","vega","tooltip"],"author":{"name":"UW Interactive Data Lab","url":"https://idl.cs.washington.edu"},"collaborators":["Dominik Moritz","Sira Horradarn","Zening Qu","Kanit Wongsuphasawat","Yuri Astrakhan","Jeffrey Heer"],"license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/vega-tooltip/issues"},"homepage":"https://github.com/vega/vega-tooltip#readme","scripts":{"prepare":"beemo create-config --silent","tsc:src":"tsc -b tsconfig.src.json","build":"yarn tsc:src && rollup -c","clean":"rm -rf build examples/data && rm -f src/style.ts","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && yarn copy:build && gh-pages -d examples && yarn clean","prettierbase":"beemo prettier \'examples/*.{html,scss,css}\'","eslintbase":"beemo eslint \'{src,test,types}/**/*.ts\'","format":"yarn eslintbase --fix && yarn prettierbase --write","lint":"yarn eslintbase && yarn prettierbase --check","postbuild":"terser build/vega-tooltip.js -c -m -o build/vega-tooltip.min.js","prebuild":"mkdir -p build && yarn copy:data && ./build-style.sh","prepublishOnly":"yarn clean && yarn build","preversion":"yarn lint","start":"yarn build && concurrently --kill-others -n Server,Typescript,Rollup \'browser-sync start -s -f build examples --serveStatic examples\' \'yarn tsc:src -w\' \'rollup -c -w\'","pretest":"./build-style.sh","test":"jest"},"devDependencies":{"@types/jest":"^24.0.18","browser-sync":"^2.26.7","concurrently":"^4.1.2","gh-pages":"^2.1.1","jest":"^24.9.0","node-sass":"^4.12.0","path":"^0.12.7","rollup":"^1.20.3","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-resolve":"^5.2.0","terser":"^4.2.1","ts-jest":"^24.0.2","typescript":"^3.6.2","vega-datasets":"^1.25.0","vega-lite-dev-config":"^0.2.5","vega-typings":"^0.8.1"},"dependencies":{"vega-util":"^1.11.1"},"beemo":{"module":"vega-lite-dev-config","drivers":["prettier","eslint"]},"jest":{"testURL":"http://localhost/","transform":{"^.+\\\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"],"testPathIgnorePatterns":["node_modules","/build","src"]}}')},function(e,t,n){"use strict";(function(e){ /**! * @fileOverview Kickass library to create and place poppers near their reference elements. * @version 1.16.1-lts @@ -92,7 +92,7 @@ var X=new WeakMap,K=function(e){this.observers=new Map,this.obj=e},J=function(e, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -var n="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,r=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}();var i=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function o(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function u(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function s(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:s(u(e))}function l(e){return e&&e.referenceNode?e.referenceNode:e}var c=n&&!(!window.MSInputMethodContext||!document.documentMode),f=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?c:10===e?f:c||f}function h(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?h(n):n:e?e.ownerDocument.documentElement:document.documentElement}function p(e){return null!==e.parentNode?p(e.parentNode):e}function m(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a,u,s=o.commonAncestorContainer;if(e!==s&&t!==s||r.contains(i))return"BODY"===(u=(a=s).nodeName)||"HTML"!==u&&h(a.firstElementChild)!==a?h(s):s;var l=p(e);return l.host?m(l.host,t):m(e,p(t).host)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=g(t,"top"),i=g(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function y(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function b(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function x(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:b("Height",t,n,r),width:b("Width",t,n,r)}}var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},E=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=d(10),i="HTML"===t.nodeName,o=C(e),u=C(t),l=s(e),c=a(t),f=parseFloat(c.borderTopWidth),h=parseFloat(c.borderLeftWidth);n&&i&&(u.top=Math.max(u.top,0),u.left=Math.max(u.left,0));var p=k({top:o.top-u.top-f,left:o.left-u.left-h,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!r&&i){var m=parseFloat(c.marginTop),g=parseFloat(c.marginLeft);p.top-=f-m,p.bottom-=f-m,p.left-=h-g,p.right-=h-g,p.marginTop=m,p.marginLeft=g}return(r&&!n?t.contains(l):t===l&&"BODY"!==l.nodeName)&&(p=v(p,t)),p}function S(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=O(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:g(n),u=t?0:g(n,"left"),s={top:a-r.top+r.marginTop,left:u-r.left+r.marginLeft,width:i,height:o};return k(s)}function D(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===a(e,"position"))return!0;var n=u(e);return!!n&&D(n)}function F(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function j(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?F(e):m(e,l(t));if("viewport"===r)o=S(a,i);else{var c=void 0;"scrollParent"===r?"BODY"===(c=s(u(t))).nodeName&&(c=e.ownerDocument.documentElement):c="window"===r?e.ownerDocument.documentElement:r;var f=O(c,a,i);if("HTML"!==c.nodeName||D(a))o=f;else{var d=x(e.ownerDocument),h=d.height,p=d.width;o.top+=f.top-f.marginTop,o.bottom=h+f.top,o.left+=f.left-f.marginLeft,o.right=p+f.left}}var g="number"==typeof(n=n||0);return o.left+=g?n:n.left||0,o.top+=g?n:n.top||0,o.right-=g?n:n.right||0,o.bottom-=g?n:n.bottom||0,o}function T(e){return e.width*e.height}function N(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=j(n,r,o,i),u={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},s=Object.keys(u).map((function(e){return A({key:e},u[e],{area:T(u[e])})})).sort((function(e,t){return t.area-e.area})),l=s.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),c=l.length>0?l[0].key:s[0].key,f=e.split("-")[1];return c+(f?"-"+f:"")}function M(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?F(t):m(t,l(n));return O(n,i,r)}function B(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function P(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function R(e,t,n){n=n.split("-")[0];var r=B(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",u=o?"left":"top",s=o?"height":"width",l=o?"width":"height";return i[a]=t[a]+t[s]/2-r[s]/2,i[u]=n===u?t[u]-r[l]:t[P(u)],i}function z(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function L(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=z(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&o(n)&&(t.offsets.popper=k(t.offsets.popper),t.offsets.reference=k(t.offsets.reference),t=n(t,e))})),t}function I(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=M(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=N(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=R(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=L(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function U(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function $(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=Z.indexOf(e),r=Z.slice(n+1).concat(Z.slice(0,n));return t?r.reverse():r}var te="flip",ne="clockwise",re="counterclockwise";function ie(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),u=a.indexOf(z(a,(function(e){return-1!==e.search(/,|\s/)})));a[u]&&-1===a[u].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var s=/\s*,\s*|\s+/,l=-1!==u?[a.slice(0,u).concat([a[u].split(s)[0]]),[a[u].split(s)[1]].concat(a.slice(u+1))]:[a];return(l=l.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){var u=void 0;switch(a){case"%p":u=n;break;case"%":case"%r":default:u=r}return k(u)[t]/100*o}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}(e,i,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){G(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var oe={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,u=-1!==["bottom","top"].indexOf(n),s=u?"left":"top",l=u?"width":"height",c={start:_({},s,o[s]),end:_({},s,o[s]+o[l]-a[l])};e.offsets.popper=A({},a,c[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,u=r.split("-")[0],s=void 0;return s=G(+n)?[+n,0]:ie(n,o,a,u),"left"===u?(o.top+=s[0],o.left-=s[1]):"right"===u?(o.top+=s[0],o.left+=s[1]):"top"===u?(o.left+=s[0],o.top-=s[1]):"bottom"===u&&(o.left+=s[0],o.top+=s[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||h(e.instance.popper);e.instance.reference===n&&(n=h(n));var r=$("transform"),i=e.instance.popper.style,o=i.top,a=i.left,u=i[r];i.top="",i.left="",i[r]="";var s=j(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=u,t.boundaries=s;var l=t.priority,c=e.offsets.popper,f={primary:function(e){var n=c[e];return c[e]s[e]&&!t.escapeWithReference&&(r=Math.min(c[n],s[e]-("right"===e?c.width:c.height))),_({},n,r)}};return l.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";c=A({},c,f[t](e))})),e.offsets.popper=c,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),u=a?"right":"bottom",s=a?"left":"top",l=a?"width":"height";return n[u]o(r[u])&&(e.offsets.popper[s]=o(r[u])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!J(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,u=o.popper,s=o.reference,l=-1!==["left","right"].indexOf(i),c=l?"height":"width",f=l?"Top":"Left",d=f.toLowerCase(),h=l?"left":"top",p=l?"bottom":"right",m=B(r)[c];s[p]-mu[p]&&(e.offsets.popper[d]+=s[d]+m-u[p]),e.offsets.popper=k(e.offsets.popper);var g=s[d]+s[c]/2-m/2,v=a(e.instance.popper),y=parseFloat(v["margin"+f]),b=parseFloat(v["border"+f+"Width"]),x=g-e.offsets.popper[d]-y-b;return x=Math.max(Math.min(u[c]-m,x),0),e.arrowElement=r,e.offsets.arrow=(_(n={},d,Math.round(x)),_(n,h,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(U(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=j(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=P(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case te:a=[r,i];break;case ne:a=ee(r);break;case re:a=ee(r,!0);break;default:a=t.behavior}return a.forEach((function(u,s){if(r!==u||a.length===s+1)return e;r=e.placement.split("-")[0],i=P(r);var l=e.offsets.popper,c=e.offsets.reference,f=Math.floor,d="left"===r&&f(l.right)>f(c.left)||"right"===r&&f(l.left)f(c.top)||"bottom"===r&&f(l.top)f(n.right),m=f(l.top)f(n.bottom),v="left"===r&&h||"right"===r&&p||"top"===r&&m||"bottom"===r&&g,y=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(y&&"start"===o&&h||y&&"end"===o&&p||!y&&"start"===o&&m||!y&&"end"===o&&g),x=!!t.flipVariationsByContent&&(y&&"start"===o&&p||y&&"end"===o&&h||!y&&"start"===o&&g||!y&&"end"===o&&m),w=b||x;(d||v||w)&&(e.flipped=!0,(d||v)&&(r=a[s+1]),w&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=A({},e.offsets.popper,R(e.instance.popper,e.offsets.reference,e.placement)),e=L(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),u=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(u?i[a?"width":"height"]:0),e.placement=P(t),e.offsets.popper=k(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!J(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=z(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};w(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=i(this.update.bind(this)),this.options=A({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(A({},e.Defaults.modifiers,a.modifiers)).forEach((function(t){r.options.modifiers[t]=A({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return A({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&o(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var u=this.options.eventsEnabled;u&&this.enableEventListeners(),this.state.eventsEnabled=u}return E(e,[{key:"update",value:function(){return I.call(this)}},{key:"destroy",value:function(){return q.call(this)}},{key:"enableEventListeners",value:function(){return V.call(this)}},{key:"disableEventListeners",value:function(){return Y.call(this)}}]),e}();ae.Utils=("undefined"!=typeof window?window:e).PopperUtils,ae.placements=Q,ae.Defaults=oe,t.a=ae}).call(this,n(36))},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1){var i=ge[e];if(!Array.isArray(i))return W+ee(i)in t&&H+i;if(!r)return!1;for(var o=0;ot?1:-1:e.length-t.length};return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r={},i=Object.keys(t).sort(e),o=0;o{this.setState({currentVisSelected:e},()=>{-1==e?this.onListChanged(-1,null):this.onListChanged(-2,null)})};for(var t=0;t0))return"";e=this.props.model.get("recommendations")[0].action}var t="";for(var n of this.props.model.get("recommendations"))n.action===e&&(t=n.long_description);return t}handleSelect(e){e&&m.dispatchLogEvent("switchTab",e);var t=this.generateDescription(e);this.setState({activeTab:e,longDescription:t})}onListChanged(e,t){var n={};for(var r of(this.state.selectedRec[e]=t,Object.keys(this.state.selectedRec)))if(r in this.state.recommendations){var i=this.state.recommendations[r].action;this.state.selectedRec[r].length>0&&(n[i]=this.state.selectedRec[r])}else-1==this.state.currentVisSelected&&(n.currentVis=this.state.currentVis);this.setState({_selectedVisIdxs:n})}exportSelection(){m.dispatchLogEvent("exportBtnClick",this.state._selectedVisIdxs),this.setState(e=>({showAlert:!0})),setTimeout(()=>{this.setState(e=>({showAlert:!1}))},6e4),e.model.set("_selectedVisIdxs",this.state._selectedVisIdxs),e.model.save()}deleteSelection(){m.dispatchLogEvent("deleteBtnClick",this.state._selectedVisIdxs);var t=this.state._selectedVisIdxs;for(var n of this.state.recommendations)if(this.state._selectedVisIdxs[n.action]){let e=0;for(var r of this.state._selectedVisIdxs[n.action])n.vspec.splice(r-e,1),e++}this.setState({selectedRec:{},_selectedVisIdxs:{},deletedIndices:t});for(var i=0;il.createElement(d.Tab,{eventKey:e.action,title:e.action},l.createElement(h.default,{key:"no refresh",ref:this.chartComponents[t],title:e.action,description:e.description,multiple:!0,maxSelectable:10,onChange:this.onListChanged.bind(this,t),graphSpec:e.vspec,currentVisShow:!f.default.isEmpty(this.props.model.get("current_vis"))})))}generateNoRecsWarning(){if(""!=this.state.message)return l.createElement("div",{id:"no-recs-footer",style:{display:"flex"}},l.createElement("div",{id:"no-recs",className:"fa fa-exclamation-triangle"}),l.createElement("div",null,l.createElement("p",{className:"warnMsgText",dangerouslySetInnerHTML:{__html:this.state.message.replace(/<[^>]+>/g,"")}})))}render(){var e=Object.keys(this.state._selectedVisIdxs).length>0,t=1==Object.keys(this.state._selectedVisIdxs).length&&1==Object.values(this.state._selectedVisIdxs)[0].length;return 0==this.state.recommendations.length?l.createElement("div",{id:"oneViewWidgetContainer",style:{flexDirection:"column"}},l.createElement("div",{style:{display:"flex",flexDirection:"row"}},l.createElement(p.default,{intent:this.state.intent,currentVisSpec:this.state.currentVis,numRecommendations:this.state.recommendations.length,onChange:this.handleCurrentVisSelect})),l.createElement(g.default,{buttonsEnabled:e,deleteSelection:this.deleteSelection,exportSelection:this.exportSelection,setIntent:this.setIntent,closeExportInfo:this.closeExportInfo,tabItems:this.state.tabItems,showAlert:this.state.showAlert,intentEnabled:t}),this.generateNoRecsWarning()):this.state.recommendations.length>0?l.createElement("div",{id:"widgetContainer",style:{flexDirection:"column"}},l.createElement("div",{style:{display:"flex",flexDirection:"row"}},l.createElement(p.default,{intent:this.state.intent,currentVisSpec:this.state.currentVis,numRecommendations:this.state.recommendations.length,onChange:this.handleCurrentVisSelect}),l.createElement("div",{id:"tabBanner"},l.createElement("p",{className:"title-description",style:{visibility:f.default.isEmpty(this.state.currentVis)?"hidden":"visible"}},"You might be interested in..."),l.createElement(d.Tabs,{activeKey:this.state.activeTab,id:"tabBannerList",onSelect:this.handleSelect,className:f.default.isEmpty(this.state.currentVis)?"":"tabBannerPadding"},this.state.tabItems))),l.createElement(g.default,{buttonsEnabled:e,deleteSelection:this.deleteSelection,exportSelection:this.exportSelection,setIntent:this.setIntent,closeExportInfo:this.closeExportInfo,tabItems:this.state.tabItems,showAlert:this.state.showAlert,intentEnabled:t}),l.createElement(y.default,{message:this.state.longDescription,toggleInfoPanel:this.toggleInfoPanel,openInfo:this.state.openInfo}),l.createElement(v.default,{message:this.state.message,toggleWarningPanel:this.toggleWarningPanel,openWarning:this.state.openWarning})):void 0}}const n=document.createElement("div"),r=l.createElement(t,e);c.render(r,n),e.el.append(n),m.dispatchLogEvent("initWidget","")}}t.LuxWidgetView=x},function(t,n){t.exports=e},function(e,t,n){var r=n(84);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};n(86)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(t=n(85)(!1)).push([e.i,".jp-OutputArea-output {\n height: auto;\n overflow: auto;\n user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n -ms-user-select: text;\n width: 90%;\n padding-bottom: 4px;\n}\n\n#widgetContainer{\n /* height: 315px; */\n width:100%;\n display:inline-flex;\n}\n\n#oneViewWidgetContainer {\n width:100%;\n display:inline-flex;\n}\ninput[type=text], select {\n width: 100%;\n padding: 12px 20px;\n margin: 8px 0;\n display: inline-block;\n border: 1px solid #ccc;\n border-radius: 4px;\n box-sizing: border-box;\n}\n#mult-graph-container{\n display: inline-flex;\n}\n.recommendationStaticContentOuter{\n scroll-snap-align: start;\n /* border: 0.5px solid #bcbdbd; */\n overflow-x: auto;\n overflow-y: hidden;\n display: inline-block;\n text-align: left;\n /* padding-left: 20px; */\n /* padding-top: 10px; */\n /* height: 100%; */\n box-sizing: border-box;\n width: 100%;\n position: relative;\n}\n.recommendationContentOuter{\n /* overflow: scroll; */\n /* Prevents unneccesary x-scroll for specified facet */\n /* width: 100%; */\n /*height: 225px;*/\n display: flex;\n /* display: inline-block;*/\n margin-left: 10px;\n text-align: left;\n}\n.vega-embed {\n position: relative;\n display: inline-block;\n /* padding-right: 38px; */\n flex: 1 0 auto;\n padding-right: 10px !important;\n}\n/* .vega-embed:hover{\n border: solid 1px;\n border-color: rgba(0, 0, 0, 0.4);\n box-shadow: 5px 5px 5px 0px rgba(0,0,0,0.5);\n cursor: pointer;\n} */\n.vega-embed:checked{\n border: solid 1px;\n border-color: blue;\n}\n.recommendationContentInner{\n /*width: auto;\n max-width: 150%;*/\n /*display: inline-block;*/\n /*margin-left: 8px;*/\n text-align: left;\n display: flex;\n flex-wrap: nowrap;\n align-items: flex-end;\n /* overflow-x: auto; */\n overflow-x: initial;\n padding-right: 50px;\n /*height: 280px;*/\n /* width: max-content;\n overflow-x: auto; */\n /* height: 100px; */\n}\n\n.toolDiv{\n position: relative;\n top: -20px;\n left: -5px;\n}\n.fa {\n color:gray;\n}\n.fa:hover{\n color:black;\n}\n\n.graph-container{\n height: 250px;\n max-height: 270px;\n margin: 10px 0px 5px 5px;\n padding: 0px 0px 0px 0px;\n}\n#mainVizTitle{\n font-size: 20px;\n display: inline-block;\n left: 10%;\n top: 0px;\n position: absolute;\n}\n#mainVizContainer{\n padding: 10px 0px 0px 0px;\n border: 0.5px solid #bcbdbd;\n overflow-y: auto;\n}\n\n#mainVizInnerContainer{\n margin-top: 50px;\n}\n\n#placeHolderVizContainer{\n min-height: 100%;\n min-width: 1px;\n}\n#tabBanner{\n border: 0.5px solid #bcbdbd;\n width: auto;\n overflow: hidden;\n flex: 1;\n}\n#exportBtn{\n position: absolute;\n /* bottom: 90%; */\n /* left: 97%; */\n top: 5px;\n right: 5px;\n font-size: 20px;\n padding: 5px;\n}\n\n#deleteBtn{\n position: absolute;\n top: 5px;\n right: 33px;\n font-size: 20px;\n padding: 5px;\n}\n\n#intentBtn{\n position: absolute;\n top: 5px;\n right: 59px;\n font-size: 20px;\n padding: 5px;\n}\n\n#alertBox{\n position: absolute;\n left: 23%;\n width: 54%;\n bottom: 6%;\n padding: 5px 30px 5px 10px;\n}\n\n/* \n JupyterLab does support bootstrap, so need to add bootstrap css\n https://gist.github.com/EvanHerman/315952ebf371cb83ee9db6c54499933d\n*/\n\n.alert {\n padding: 15px;\n margin-bottom: 20px;\n border: 1px solid transparent;\n border-radius: 4px;\n}\n\n.alert-dismissable .close,\n.alert-dismissible .close {\n position: relative;\n top: -2px;\n right: -21px;\n color: inherit;\n}\n\n.alert-dismissable,\n.alert-dismissible {\n padding-right: 35px;\n}\n\nbutton.close {\n padding: 0;\n cursor: pointer;\n background: transparent;\n border: 0;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.close {\n float: right;\n font-size: 19.5px;\n font-weight: bold;\n line-height: 1;\n color: #000;\n text-shadow: 0 1px 0 #fff;\n filter: alpha(opacity=20);\n opacity: 0.2;\n}\n\n.alert-info {\n background-color: #d9edf7;\n border-color: #bce8f1;\n color: #31708f;\n}\n\n/* canvas{\n width: 229px;\n height: 245px;\n} */\n/* Override .fade default to show tab*/\n.fade {\n opacity:1;\n}\n/* Copied from bootstrap.css */\n.nav {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n padding-left: 0;\n margin-bottom: 0;\n list-style: none;\n}\n\n.nav-link {\n display: block;\n padding: 0.5rem 1rem;\n}\n\n.nav-link:hover, .nav-link:focus {\n text-decoration: none;\n}\n\n.nav-link.disabled {\n color: #6c757d;\n pointer-events: none;\n cursor: default;\n}\n\n.nav-tabs {\n border-bottom: 1px solid #dee2e6;\n}\n\n.tabBannerPadding {\n padding-left: 210px;\n}\n\n.nav-tabs .nav-item {\n margin-bottom: -1px;\n}\n\n.nav-tabs .nav-link {\n border: 1px solid transparent;\n border-top-left-radius: 0.25rem;\n border-top-right-radius: 0.25rem;\n}\n\n.nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus {\n border-color: #e9ecef #e9ecef #dee2e6;\n}\n\n.nav-tabs .nav-link.disabled {\n color: #6c757d;\n background-color: transparent;\n border-color: transparent;\n}\n\n.nav-tabs .nav-link.active,\n.nav-tabs .nav-item.show .nav-link {\n color: #495057;\n background-color: #fff;\n border-color: #dee2e6 #dee2e6 #fff;\n font-weight: 500;\n}\n\n.nav-tabs .dropdown-menu {\n margin-top: -1px;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n\n.nav-pills .nav-link {\n border-radius: 0.25rem;\n}\n\n.nav-pills .nav-link.active,\n.nav-pills .show > .nav-link {\n color: #fff;\n background-color: #007bff;\n}\n\n.nav-fill .nav-item {\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n text-align: center;\n}\n\n.nav-justified .nav-item {\n -ms-flex-preferred-size: 0;\n flex-basis: 0;\n -ms-flex-positive: 1;\n flex-grow: 1;\n text-align: center;\n}\n\n.tab-content > .tab-pane {\n display: none;\n}\n\n.tab-content > .active {\n display: block;\n}\n/* Selectable Card React Component CSS */\n/* Card */\n.card {\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n background: #fff;\n margin: 20px 10px;\n cursor: pointer;\n}\n.card:hover {\n box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);\n}\n/* Selectable */\n.card .selectable {\n position: relative;\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n border: 4px solid transparent;\n}\n.card .selectable .check {\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n width: 20px;\n height: 20px;\n}\n.card .selectable .check:before {\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n content: '';\n border: 20px solid;\n border-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\n z-index: -1;\n}\n.card .selectable .check .checkmark {\n display: block;\n font: 20px sans-serif;\n line-height: 20px;\n text-align: center;\n color: transparent;\n}\n.card .selectable.selected {\n border-color: #4ad;\n}\n.card .selectable.selected .check:before {\n border-color: #4ad #4ad rgba(0, 0, 255, 0) rgba(255, 0, 0, 0);\n}\n.card .selectable.selected .check .checkmark {\n color: #fff;\n}\n.content {\n padding: 24px;\n}\n.content .title, .content .description {\n margin: 0;\n padding: 4px;\n}\n.column {\n float: left;\n width: 50%;\n}\n.column > .title {\n text-align: center;\n}\nbutton.card {\n display: block;\n cursor: pointer;\n width: 180px;\n margin: 20px auto;\n text-align: center;\n padding: 16px;\n border-color: transparent;\n border-radius: 10px;\n background: #4ad !important;\n color: #fff;\n text-transform: uppercase;\n font-weight: bold;\n outline: none;\n}\nbutton.card:focus {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n}\n.title-description{\n line-height: 2;\n font-weight: 500;\n margin-left: 15px;\n margin-bottom: -27px;\n color: rgb(0, 0, 0);\n margin-top: 5px;\n}\n.text-description {\n line-height: 2.5;\n margin-left: 15px;\n margin-bottom: -25px;\n color: rgb(80, 80, 80);\n margin-top: 5px;\n}\n.warning-footer {\n padding: 10px;\n border: 0.5px solid #bcbdbd;\n background-color: lightyellow;\n display: flex;\n flex-direction: row;\n border-top: 0px;\n}\n.info-footer {\n padding: 10px;\n border: 0.5px solid #bcbdbd;\n background-color: rgb(206, 228, 255);\n display: flex;\n flex-direction: row;\n border-top: 0px;\n position: relative;\n}\n#no-recs-footer {\n padding: 10px;\n border: 0.5px solid #bcbdbd;\n background-color: lightyellow;\n display: flex;\n flex-direction: row;\n position: relative;\n}\n#no-recs {\n color: #ffbc00;\n pointer-events: none;\n position: relative;\n top: 5px;\n left: px;\n font-size: 25px;\n padding: 5px;\n}\n#no-recs-text {\n color: rgb(80, 80, 80);\n font-size: 20px;\n margin-top: 5px;\n margin-left: 5px;\n margin-right: 30px;\n}\n#scroll-indicator {\n margin-right: 10px;\n margin-top: 5px;\n text-align: right;\n color: rgb(80, 80, 80);\n font-weight: 700;\n z-index: 0;\n position: relative;\n margin-bottom: 15px;\n}\n#scroll-indicator-background {\n z-index: 0;\n position: relative;\n background-color: rgba(250, 250, 250, 0.8);\n /* width: 210px; */\n height: 25px;\n float: right;\n margin-top: -26px;\n}\n/* This forces the toggle button to overlap with widget.Output (main widget). This may leak to other .widget-button if there are non-Lux widgets in the notebook. */\n/* .widget-button{ \n position: absolute;\n z-index: 999;\n border-radius: 5px;\n} */\n\n#first-arrow{\n margin-left: 25px;\n opacity: 50%;\n}\n\n#second-arrow{\n margin-left: -4px;\n}\n\n.highlight-intent{\n font-weight: 500;\n background: aliceblue;\n display: inline;\n /* display: inline-table;\n text-align: left; */\n}\n.highlight-descriptor{\n font-weight: 500;\n background: #fffee1;\n display: inline;\n /* display: inline-table;\n text-align: left; */\n}\n#intent_str {\n margin-top: 5px;\n font-weight: 500;\n max-width:100px\n}\n\n#warnBtn{\n color: #ffbc00;\n position: absolute;\n top: 5px;\n right: 88px;\n font-size: 20px;\n padding: 5px;\n}\n#warnBtn:hover{\n color:black;\n}\n.warnMsgText{\n color: rgb(80, 80, 80);\n margin-top: 5px;\n margin-left: 5px;\n margin-right: 30px;\n}\n#infoBtn{\n position: absolute;\n top: 45px;\n right: 5px;\n font-size: 20px;\n padding: 5px;\n}\n.infoMsgText{\n color: rgb(80, 80, 80);\n margin-top: 5px;\n margin-left: 30px;\n margin-right: 30px;\n}\n\n#cur-img {\n all: revert;\n height: 218px;\n}\n\n#gal-img {\n all: revert;\n height: 212px;\n}\n",""]),e.exports=t},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(a=r,u=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(u),"/*# ".concat(s," */")),o=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot).concat(e," */")}));return[n].concat(o).concat([i]).join("\n")}var a,u,s;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r=0;r=0)return 1;return 0}();var i=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function o(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function s(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function u(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:u(s(e))}function l(e){return e&&e.referenceNode?e.referenceNode:e}var c=n&&!(!window.MSInputMethodContext||!document.documentMode),f=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?c:10===e?f:c||f}function h(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?h(n):n:e?e.ownerDocument.documentElement:document.documentElement}function p(e){return null!==e.parentNode?p(e.parentNode):e}function m(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a,s,u=o.commonAncestorContainer;if(e!==u&&t!==u||r.contains(i))return"BODY"===(s=(a=u).nodeName)||"HTML"!==s&&h(a.firstElementChild)!==a?h(u):u;var l=p(e);return l.host?m(l.host,t):m(e,p(t).host)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=g(t,"top"),i=g(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function b(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function y(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function x(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:y("Height",t,n,r),width:y("Width",t,n,r)}}var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},O=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=d(10),i="HTML"===t.nodeName,o=k(e),s=k(t),l=u(e),c=a(t),f=parseFloat(c.borderTopWidth),h=parseFloat(c.borderLeftWidth);n&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=_({top:o.top-s.top-f,left:o.left-s.left-h,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!r&&i){var m=parseFloat(c.marginTop),g=parseFloat(c.marginLeft);p.top-=f-m,p.bottom-=f-m,p.left-=h-g,p.right-=h-g,p.marginTop=m,p.marginLeft=g}return(r&&!n?t.contains(l):t===l&&"BODY"!==l.nodeName)&&(p=v(p,t)),p}function S(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=A(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:g(n),s=t?0:g(n,"left"),u={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o};return _(u)}function j(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===a(e,"position"))return!0;var n=s(e);return!!n&&j(n)}function D(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function F(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?D(e):m(e,l(t));if("viewport"===r)o=S(a,i);else{var c=void 0;"scrollParent"===r?"BODY"===(c=u(s(t))).nodeName&&(c=e.ownerDocument.documentElement):c="window"===r?e.ownerDocument.documentElement:r;var f=A(c,a,i);if("HTML"!==c.nodeName||j(a))o=f;else{var d=x(e.ownerDocument),h=d.height,p=d.width;o.top+=f.top-f.marginTop,o.bottom=h+f.top,o.left+=f.left-f.marginLeft,o.right=p+f.left}}var g="number"==typeof(n=n||0);return o.left+=g?n:n.left||0,o.top+=g?n:n.top||0,o.right-=g?n:n.right||0,o.bottom-=g?n:n.bottom||0,o}function T(e){return e.width*e.height}function M(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=F(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},u=Object.keys(s).map((function(e){return C({key:e},s[e],{area:T(s[e])})})).sort((function(e,t){return t.area-e.area})),l=u.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),c=l.length>0?l[0].key:u[0].key,f=e.split("-")[1];return c+(f?"-"+f:"")}function N(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?D(t):m(t,l(n));return A(n,i,r)}function P(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function B(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function L(e,t,n){n=n.split("-")[0];var r=P(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",u=o?"height":"width",l=o?"width":"height";return i[a]=t[a]+t[u]/2-r[u]/2,i[s]=n===s?t[s]-r[l]:t[B(s)],i}function R(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function z(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=R(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&o(n)&&(t.offsets.popper=_(t.offsets.popper),t.offsets.reference=_(t.offsets.reference),t=n(t,e))})),t}function I(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=N(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=M(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=L(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=z(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function U(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function $(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=Z.indexOf(e),r=Z.slice(n+1).concat(Z.slice(0,n));return t?r.reverse():r}var te="flip",ne="clockwise",re="counterclockwise";function ie(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf(R(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,l=-1!==s?[a.slice(0,s).concat([a[s].split(u)[0]]),[a[s].split(u)[1]].concat(a.slice(s+1))]:[a];return(l=l.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return _(s)[t]/100*o}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}(e,i,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){Y(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var oe={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),u=s?"left":"top",l=s?"width":"height",c={start:E({},u,o[u]),end:E({},u,o[u]+o[l]-a[l])};e.offsets.popper=C({},a,c[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],u=void 0;return u=Y(+n)?[+n,0]:ie(n,o,a,s),"left"===s?(o.top+=u[0],o.left-=u[1]):"right"===s?(o.top+=u[0],o.left+=u[1]):"top"===s?(o.left+=u[0],o.top-=u[1]):"bottom"===s&&(o.left+=u[0],o.top+=u[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||h(e.instance.popper);e.instance.reference===n&&(n=h(n));var r=$("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var u=F(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=u;var l=t.priority,c=e.offsets.popper,f={primary:function(e){var n=c[e];return c[e]u[e]&&!t.escapeWithReference&&(r=Math.min(c[n],u[e]-("right"===e?c.width:c.height))),E({},n,r)}};return l.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";c=C({},c,f[t](e))})),e.offsets.popper=c,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",u=a?"left":"top",l=a?"width":"height";return n[s]o(r[s])&&(e.offsets.popper[u]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!J(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,s=o.popper,u=o.reference,l=-1!==["left","right"].indexOf(i),c=l?"height":"width",f=l?"Top":"Left",d=f.toLowerCase(),h=l?"left":"top",p=l?"bottom":"right",m=P(r)[c];u[p]-ms[p]&&(e.offsets.popper[d]+=u[d]+m-s[p]),e.offsets.popper=_(e.offsets.popper);var g=u[d]+u[c]/2-m/2,v=a(e.instance.popper),b=parseFloat(v["margin"+f]),y=parseFloat(v["border"+f+"Width"]),x=g-e.offsets.popper[d]-b-y;return x=Math.max(Math.min(s[c]-m,x),0),e.arrowElement=r,e.offsets.arrow=(E(n={},d,Math.round(x)),E(n,h,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(U(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=F(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=B(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case te:a=[r,i];break;case ne:a=ee(r);break;case re:a=ee(r,!0);break;default:a=t.behavior}return a.forEach((function(s,u){if(r!==s||a.length===u+1)return e;r=e.placement.split("-")[0],i=B(r);var l=e.offsets.popper,c=e.offsets.reference,f=Math.floor,d="left"===r&&f(l.right)>f(c.left)||"right"===r&&f(l.left)f(c.top)||"bottom"===r&&f(l.top)f(n.right),m=f(l.top)f(n.bottom),v="left"===r&&h||"right"===r&&p||"top"===r&&m||"bottom"===r&&g,b=-1!==["top","bottom"].indexOf(r),y=!!t.flipVariations&&(b&&"start"===o&&h||b&&"end"===o&&p||!b&&"start"===o&&m||!b&&"end"===o&&g),x=!!t.flipVariationsByContent&&(b&&"start"===o&&p||b&&"end"===o&&h||!b&&"start"===o&&g||!b&&"end"===o&&m),w=y||x;(d||v||w)&&(e.flipped=!0,(d||v)&&(r=a[u+1]),w&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=C({},e.offsets.popper,L(e.instance.popper,e.offsets.reference,e.placement)),e=z(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),e.placement=B(t),e.offsets.popper=_(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!J(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=R(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};w(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=i(this.update.bind(this)),this.options=C({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(C({},e.Defaults.modifiers,a.modifiers)).forEach((function(t){r.options.modifiers[t]=C({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return C({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&o(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return O(e,[{key:"update",value:function(){return I.call(this)}},{key:"destroy",value:function(){return W.call(this)}},{key:"enableEventListeners",value:function(){return V.call(this)}},{key:"disableEventListeners",value:function(){return G.call(this)}}]),e}();ae.Utils=("undefined"!=typeof window?window:e).PopperUtils,ae.placements=Q,ae.Defaults=oe,t.a=ae}).call(this,n(34))},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n-1){var i=me[e];if(!Array.isArray(i))return W+Z(i)in t&&H+i;if(!r)return!1;for(var o=0;ot?1:-1:e.length-t.length};return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r={},i=Object.keys(t).sort(e),o=0;o{this.setState({currentVisSelected:e},()=>{-1==e?this.onListChanged(-1,null):this.onListChanged(-2,null)})};for(var t=0;t0))return"";e=this.props.model.get("recommendations")[0].action}var t="";for(var n of this.props.model.get("recommendations"))n.action===e&&(t=n.long_description);return t}handleSelect(e){e&&v.dispatchLogEvent("switchTab",e);var t=this.generateDescription(e);this.setState({activeTab:e,longDescription:t})}onListChanged(e,t){var n={};for(var r of(this.state.selectedRec[e]=t,Object.keys(this.state.selectedRec)))if(r in this.state.recommendations){var i=this.state.recommendations[r].action;this.state.selectedRec[r].length>0&&(n[i]=this.state.selectedRec[r])}else-1==this.state.currentVisSelected&&(n.currentVis=this.state.currentVis);this.setState({_selectedVisIdxs:n})}exportSelection(){v.dispatchLogEvent("exportBtnClick",this.state._selectedVisIdxs),this.setState(e=>({showAlert:!0})),setTimeout(()=>{this.setState(e=>({showAlert:!1}))},6e4),e.model.set("_selectedVisIdxs",this.state._selectedVisIdxs),e.model.save()}deleteSelection(){v.dispatchLogEvent("deleteBtnClick",this.state._selectedVisIdxs);var t=this.state._selectedVisIdxs;for(var n of this.state.recommendations)if(this.state._selectedVisIdxs[n.action]){let e=0;for(var r of this.state._selectedVisIdxs[n.action])n.vspec.splice(r-e,1),e++}this.setState({selectedRec:{},_selectedVisIdxs:{},deletedIndices:t});for(var i=0;il.createElement(d.Tab,{eventKey:e.action,title:e.action},l.createElement(m.default,{key:"no refresh",ref:this.chartComponents[t],title:e.action,description:e.description,multiple:!0,maxSelectable:10,onChange:this.onListChanged.bind(this,t),graphSpec:e.vspec,currentVisShow:!f.default.isEmpty(this.props.model.get("current_vis"))})))}generateNoRecsWarning(){if(""!=this.state.message)return l.createElement("div",{id:"no-recs-footer",style:{display:"flex"}},l.createElement("div",{id:"no-recs",className:"fa fa-exclamation-triangle"}),l.createElement("div",null,l.createElement("p",{className:"warnMsgText",dangerouslySetInnerHTML:{__html:this.state.message.replace(/<[^>]+>/g,"")}})))}toggleFullScreen(){if(this.state.openFullScreen)v.dispatchLogEvent("closeFullScreen",this.state._selectedVisIdxs),this.setState({openFullScreen:!1});else{for(var t of this.state.recommendations)if(this.state._selectedVisIdxs[t.action]){var n=this.state._selectedVisIdxs[t.action][0];this.setState({graphSpec:t.vspec[n]}),e.model.set("selectedFullScreenIndex",this.state._selectedVisIdxs),e.model.save();break}v.dispatchLogEvent("openFullScreen",this.state._selectedVisIdxs),setTimeout(()=>{this.setState(t=>({openFullScreen:!0,graphCodeHTML:e.model.get("visGraphCode"),styleCodeHTML:e.model.get("visStyleCode")})),e.model.set("visGraphSpec",this.state.graphSpec)},1e3)}}rerunFullScreen(){this.setState({fullScreenLoading:!0,codeError:!1});var t=this.state.graphCodeHTML,n=this.state.styleCodeHTML;if(e.model.get("visGraphCode")===t&&e.model.get("visStyleCode")===n);else{var r=this.state.graphSpec;e.model.set("visGraphCode",t),e.model.set("visStyleCode",n),e.model.save(),setTimeout(()=>{try{r=JSON.parse(e.model.get("visGraphSpec"))}catch(t){this.setState({codeError:!0,graphSpec:e.model.get("visGraphSpec")})}this.setState(e=>({graphSpec:r,fullScreenLoading:!1}))},1e3)}}applyStyleFullScreen(){var t=this.state.styleCodeHTML;e.model.get("configPlottingStyle")===t||(e.model.set("configPlottingStyle",t),e.model.save()),this.toggleFullScreen()}render(){var e=Object.keys(this.state._selectedVisIdxs).length>0,t=1==Object.keys(this.state._selectedVisIdxs).length,n=1==Object.keys(this.state._selectedVisIdxs).length&&1==Object.values(this.state._selectedVisIdxs)[0].length;return 0==this.state.recommendations.length?l.createElement("div",{id:"oneViewWidgetContainer",style:{flexDirection:"column"}},l.createElement("div",{style:{display:"flex",flexDirection:"row"}},l.createElement(g.default,{intent:this.state.intent,currentVisSpec:this.state.currentVis,numRecommendations:this.state.recommendations.length,onChange:this.handleCurrentVisSelect})),l.createElement(b.default,{buttonsEnabled:e,deleteSelection:this.deleteSelection,exportSelection:this.exportSelection,setIntent:this.setIntent,fullScreen:this.toggleFullScreen,closeExportInfo:this.closeExportInfo,tabItems:this.state.tabItems,showAlert:this.state.showAlert,intentEnabled:n,fullScreenEnabled:t}),this.generateNoRecsWarning()):this.state.recommendations.length>0?l.createElement("div",{id:"widgetContainer",style:{flexDirection:"column"}},l.createElement("div",{style:{display:"flex",flexDirection:"row"}},l.createElement(g.default,{intent:this.state.intent,currentVisSpec:this.state.currentVis,numRecommendations:this.state.recommendations.length,onChange:this.handleCurrentVisSelect}),l.createElement("div",{id:"tabBanner"},l.createElement("p",{className:"title-description",style:{visibility:f.default.isEmpty(this.state.currentVis)?"hidden":"visible"}},"You might be interested in..."),l.createElement(d.Tabs,{activeKey:this.state.activeTab,id:"tabBannerList",onSelect:this.handleSelect,className:f.default.isEmpty(this.state.currentVis)?"":"tabBannerPadding"},this.state.tabItems))),l.createElement(b.default,{buttonsEnabled:e,deleteSelection:this.deleteSelection,exportSelection:this.exportSelection,setIntent:this.setIntent,fullScreen:this.toggleFullScreen,closeExportInfo:this.closeExportInfo,tabItems:this.state.tabItems,showAlert:this.state.showAlert,intentEnabled:n,fullScreenEnabled:t}),l.createElement(x.default,{message:this.state.longDescription,toggleInfoPanel:this.toggleInfoPanel,openInfo:this.state.openInfo}),l.createElement(y.default,{message:this.state.message,toggleWarningPanel:this.toggleWarningPanel,openWarning:this.state.openWarning}),l.createElement(d.Modal,{show:this.state.openFullScreen,onHide:()=>this.toggleFullScreen(),dialogClassName:"modal-content-custom","aria-labelledby":"contained-modal-title-vcenter"},l.createElement(d.Modal.Header,{closeButton:!0},l.createElement(d.Modal.Title,{id:"contained-modal-title-vcenter"},"Chart Full Screen View")),l.createElement(d.Modal.Body,null,l.createElement(p.default,{container:!0,spacing:3},l.createElement(p.default,{item:!0,xs:6},l.createElement("div",null," ",l.createElement("h4",null,"Visualization Editor")," "),l.createElement(w.UnControlled,{value:this.state.graphCodeHTML,onChange:(e,t,n)=>{this.setState({graphCodeHTML:n})},editorDidMount:(e,[t])=>{this.setState({graphCodeHTML:this.state.graphCodeHTML+" "})},autoCursor:!1,options:{theme:"eclipse",keyMap:"sublime",mode:"python"}}),l.createElement("div",null," ",l.createElement("h4",null,"Style Editor")," "),l.createElement(w.UnControlled,{value:this.state.styleCodeHTML,onChange:(e,t,n)=>{this.setState({styleCodeHTML:n})},editorDidMount:(e,[t])=>{this.setState({styleCodeHTML:this.state.styleCodeHTML+" "})},autoCursor:!1,options:{theme:"eclipse",keyMap:"sublime",mode:"python"}})),l.createElement(p.default,{item:!0,xs:6,justify:"flex-start",alignItems:"flex-end"},l.createElement("div",null," ",this.state.codeError?l.createElement("div",null,"problems"):l.createElement(h.VegaLite,{spec:this.state.graphSpec,padding:{left:10,top:5,right:5,bottom:5},height:300,width:320,actions:!1})),l.createElement("div",null,l.createElement("span",{className:"button-container-1"},l.createElement(d.Button,{variant:"primary",onClick:this.state.fullScreenLoading?null:this.rerunFullScreen,disabled:this.state.fullScreenLoading},"Update Graph")),l.createElement("span",{className:"button-container-2"},l.createElement(d.Button,{variant:"secondary",onClick:this.applyStyleFullScreen},"Update Widget Plotting Style")))))))):void 0}}const n=document.createElement("div"),r=l.createElement(t,e);c.render(r,n),e.el.append(n),v.dispatchLogEvent("initWidget","")}}t.LuxWidgetView=E},function(t,n){t.exports=e},function(e,t,n){var r=n(89);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};n(60)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(t=n(59)(!1)).push([e.i,".jp-OutputArea-output {\n height: auto;\n overflow: auto;\n user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n -ms-user-select: text;\n width: 90%;\n padding-bottom: 4px;\n}\n\n#widgetContainer{\n /* height: 315px; */\n width:100%;\n display:inline-flex;\n}\n\n#oneViewWidgetContainer {\n width:100%;\n display:inline-flex;\n}\ninput[type=text], select {\n width: 100%;\n padding: 12px 20px;\n margin: 8px 0;\n display: inline-block;\n border: 1px solid #ccc;\n border-radius: 4px;\n box-sizing: border-box;\n}\n#mult-graph-container{\n display: inline-flex;\n}\n.recommendationStaticContentOuter{\n scroll-snap-align: start;\n /* border: 0.5px solid #bcbdbd; */\n overflow-x: auto;\n overflow-y: hidden;\n display: inline-block;\n text-align: left;\n /* padding-left: 20px; */\n /* padding-top: 10px; */\n /* height: 100%; */\n box-sizing: border-box;\n width: 100%;\n position: relative;\n}\n.recommendationContentOuter{\n /* overflow: scroll; */\n /* Prevents unneccesary x-scroll for specified facet */\n /* width: 100%; */\n /*height: 225px;*/\n display: flex;\n /* display: inline-block;*/\n margin-left: 10px;\n text-align: left;\n}\n.vega-embed {\n position: relative;\n display: inline-block;\n /* padding-right: 38px; */\n flex: 1 0 auto;\n padding-right: 10px !important;\n}\n/* .vega-embed:hover{\n border: solid 1px;\n border-color: rgba(0, 0, 0, 0.4);\n box-shadow: 5px 5px 5px 0px rgba(0,0,0,0.5);\n cursor: pointer;\n} */\n.vega-embed:checked{\n border: solid 1px;\n border-color: blue;\n}\n.recommendationContentInner{\n /*width: auto;\n max-width: 150%;*/\n /*display: inline-block;*/\n /*margin-left: 8px;*/\n text-align: left;\n display: flex;\n flex-wrap: nowrap;\n align-items: flex-end;\n /* overflow-x: auto; */\n overflow-x: initial;\n padding-right: 50px;\n /*height: 280px;*/\n /* width: max-content;\n overflow-x: auto; */\n /* height: 100px; */\n}\n\n.toolDiv{\n position: relative;\n top: -20px;\n left: -5px;\n}\n.fa {\n color:gray;\n}\n.fa:hover{\n color:black;\n}\n\n.graph-container{\n height: 250px;\n max-height: 270px;\n margin: 10px 0px 5px 5px;\n padding: 0px 0px 0px 0px;\n}\n#mainVizTitle{\n font-size: 20px;\n display: inline-block;\n left: 10%;\n top: 0px;\n position: absolute;\n}\n#mainVizContainer{\n padding: 10px 0px 0px 0px;\n border: 0.5px solid #bcbdbd;\n overflow-y: auto;\n}\n\n#mainVizInnerContainer{\n margin-top: 50px;\n}\n\n#placeHolderVizContainer{\n min-height: 100%;\n min-width: 1px;\n}\n#tabBanner{\n border: 0.5px solid #bcbdbd;\n width: auto;\n overflow: hidden;\n flex: 1;\n}\n#exportBtn{\n position: absolute;\n /* bottom: 90%; */\n /* left: 97%; */\n top: 5px;\n right: 5px;\n font-size: 20px;\n padding: 5px;\n}\n\n#deleteBtn{\n position: absolute;\n top: 5px;\n right: 33px;\n font-size: 20px;\n padding: 5px;\n}\n\n#intentBtn{\n position: absolute;\n top: 5px;\n right: 57px;\n font-size: 20px;\n padding: 5px;\n}\n\n#fullScreenBtn{\n position: absolute;\n top: 7px;\n right: 84px;\n font-size: 20px;\n padding: 5px;\n}\n\n#alertBox{\n position: absolute;\n left: 23%;\n width: 54%;\n bottom: 6%;\n padding: 5px 30px 5px 10px;\n}\n\n/* \n JupyterLab does support bootstrap, so need to add bootstrap css\n https://gist.github.com/EvanHerman/315952ebf371cb83ee9db6c54499933d\n*/\n\n.alert {\n padding: 15px;\n margin-bottom: 20px;\n border: 1px solid transparent;\n border-radius: 4px;\n}\n\n.alert-dismissable .close,\n.alert-dismissible .close {\n position: relative;\n top: -2px;\n right: -21px;\n color: inherit;\n}\n\n.alert-dismissable,\n.alert-dismissible {\n padding-right: 35px;\n}\n\nbutton.close {\n padding: 0;\n cursor: pointer;\n background: transparent;\n border: 0;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.close {\n float: right;\n font-size: 19.5px;\n font-weight: bold;\n line-height: 1;\n color: #000;\n text-shadow: 0 1px 0 #fff;\n filter: alpha(opacity=20);\n opacity: 0.2;\n}\n\n.alert-info {\n background-color: #d9edf7;\n border-color: #bce8f1;\n color: #31708f;\n}\n\n/* canvas{\n width: 229px;\n height: 245px;\n} */\n/* Override .fade default to show tab*/\n.fade {\n opacity:1;\n}\n/* Copied from bootstrap.css */\n.nav {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n padding-left: 0;\n margin-bottom: 0;\n list-style: none;\n}\n\n.nav-link {\n display: block;\n padding: 0.5rem 1rem;\n}\n\n.nav-link:hover, .nav-link:focus {\n text-decoration: none;\n}\n\n.nav-link.disabled {\n color: #6c757d;\n pointer-events: none;\n cursor: default;\n}\n\n.nav-tabs {\n border-bottom: 1px solid #dee2e6;\n}\n\n.tabBannerPadding {\n padding-left: 210px;\n}\n\n.nav-tabs .nav-item {\n margin-bottom: -1px;\n}\n\n.nav-tabs .nav-link {\n border: 1px solid transparent;\n border-top-left-radius: 0.25rem;\n border-top-right-radius: 0.25rem;\n}\n\n.nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus {\n border-color: #e9ecef #e9ecef #dee2e6;\n}\n\n.nav-tabs .nav-link.disabled {\n color: #6c757d;\n background-color: transparent;\n border-color: transparent;\n}\n\n.nav-tabs .nav-link.active,\n.nav-tabs .nav-item.show .nav-link {\n color: #495057;\n background-color: #fff;\n border-color: #dee2e6 #dee2e6 #fff;\n font-weight: 500;\n}\n\n.nav-tabs .dropdown-menu {\n margin-top: -1px;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n\n.nav-pills .nav-link {\n border-radius: 0.25rem;\n}\n\n.nav-pills .nav-link.active,\n.nav-pills .show > .nav-link {\n color: #fff;\n background-color: #007bff;\n}\n\n.nav-fill .nav-item {\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n text-align: center;\n}\n\n.nav-justified .nav-item {\n -ms-flex-preferred-size: 0;\n flex-basis: 0;\n -ms-flex-positive: 1;\n flex-grow: 1;\n text-align: center;\n}\n\n.tab-content > .tab-pane {\n display: none;\n}\n\n.tab-content > .active {\n display: block;\n}\n/* Selectable Card React Component CSS */\n/* Card */\n.card {\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n background: #fff;\n margin: 20px 10px;\n cursor: pointer;\n}\n.card:hover {\n box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);\n}\n/* Selectable */\n.card .selectable {\n position: relative;\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n border: 4px solid transparent;\n}\n.card .selectable .check {\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n width: 20px;\n height: 20px;\n}\n.card .selectable .check:before {\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n content: '';\n border: 20px solid;\n border-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\n z-index: -1;\n}\n.card .selectable .check .checkmark {\n display: block;\n font: 20px sans-serif;\n line-height: 20px;\n text-align: center;\n color: transparent;\n}\n.card .selectable.selected {\n border-color: #4ad;\n}\n.card .selectable.selected .check:before {\n border-color: #4ad #4ad rgba(0, 0, 255, 0) rgba(255, 0, 0, 0);\n}\n.card .selectable.selected .check .checkmark {\n color: #fff;\n}\n.content {\n padding: 24px;\n}\n.content .title, .content .description {\n margin: 0;\n padding: 4px;\n}\n.column {\n float: left;\n width: 50%;\n}\n.column > .title {\n text-align: center;\n}\nbutton.card {\n display: block;\n cursor: pointer;\n width: 180px;\n margin: 20px auto;\n text-align: center;\n padding: 16px;\n border-color: transparent;\n border-radius: 10px;\n background: #4ad !important;\n color: #fff;\n text-transform: uppercase;\n font-weight: bold;\n outline: none;\n}\nbutton.card:focus {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n}\n.title-description{\n line-height: 2;\n font-weight: 500;\n margin-left: 15px;\n margin-bottom: -27px;\n color: rgb(0, 0, 0);\n margin-top: 5px;\n}\n.text-description {\n line-height: 2.5;\n margin-left: 15px;\n margin-bottom: -25px;\n color: rgb(80, 80, 80);\n margin-top: 5px;\n}\n.warning-footer {\n padding: 10px;\n border: 0.5px solid #bcbdbd;\n background-color: lightyellow;\n display: flex;\n flex-direction: row;\n border-top: 0px;\n}\n.info-footer {\n padding: 10px;\n border: 0.5px solid #bcbdbd;\n background-color: rgb(206, 228, 255);\n display: flex;\n flex-direction: row;\n border-top: 0px;\n position: relative;\n}\n#no-recs-footer {\n padding: 10px;\n border: 0.5px solid #bcbdbd;\n background-color: lightyellow;\n display: flex;\n flex-direction: row;\n position: relative;\n}\n#no-recs {\n color: #ffbc00;\n pointer-events: none;\n position: relative;\n top: 5px;\n left: px;\n font-size: 25px;\n padding: 5px;\n}\n#no-recs-text {\n color: rgb(80, 80, 80);\n font-size: 20px;\n margin-top: 5px;\n margin-left: 5px;\n margin-right: 30px;\n}\n#scroll-indicator {\n margin-right: 10px;\n margin-top: 5px;\n text-align: right;\n color: rgb(80, 80, 80);\n font-weight: 700;\n z-index: 0;\n position: relative;\n margin-bottom: 15px;\n}\n#scroll-indicator-background {\n z-index: 0;\n position: relative;\n background-color: rgba(250, 250, 250, 0.8);\n /* width: 210px; */\n height: 25px;\n float: right;\n margin-top: -26px;\n}\n/* This forces the toggle button to overlap with widget.Output (main widget). This may leak to other .widget-button if there are non-Lux widgets in the notebook. */\n/* .widget-button{ \n position: absolute;\n z-index: 999;\n border-radius: 5px;\n} */\n\n#first-arrow{\n margin-left: 25px;\n opacity: 50%;\n}\n\n#second-arrow{\n margin-left: -4px;\n}\n\n.highlight-intent{\n font-weight: 500;\n background: aliceblue;\n display: inline;\n /* display: inline-table;\n text-align: left; */\n}\n.highlight-descriptor{\n font-weight: 500;\n background: #fffee1;\n display: inline;\n /* display: inline-table;\n text-align: left; */\n}\n#intent_str {\n margin-top: 5px;\n font-weight: 500;\n max-width:100px\n}\n\n#warnBtn{\n color: #ffbc00;\n position: absolute;\n top: 5px;\n right: 88px;\n font-size: 20px;\n padding: 5px;\n}\n#warnBtn:hover{\n color:black;\n}\n.warnMsgText{\n color: rgb(80, 80, 80);\n margin-top: 5px;\n margin-left: 5px;\n margin-right: 30px;\n}\n#infoBtn{\n position: absolute;\n top: 45px;\n right: 5px;\n font-size: 20px;\n padding: 5px;\n}\n.infoMsgText{\n color: rgb(80, 80, 80);\n margin-top: 5px;\n margin-left: 30px;\n margin-right: 30px;\n}\n\n#cur-img {\n all: revert;\n height: 218px;\n}\n\n#gal-img {\n all: revert;\n height: 212px;\n}\n\n.modal-content-custom {\n width: 70%!important;\n max-width: none!important;\n} \n\n.display-linebreak {\n white-space: pre-line;\n}\n\n.button-container-1 {\n padding: 5px;\n position: relative;\n left: 12%;\n}\n\n.button-container-2 {\n padding: 5px;\n position: relative;\n left: 12%;\n}\n",""]),e.exports=t},function(e,t,n){"use strict"; /** @license React v16.12.0 * react.production.min.js * @@ -100,7 +100,7 @@ var n="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r=n(55),i="function"==typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,a=i?Symbol.for("react.portal"):60106,u=i?Symbol.for("react.fragment"):60107,s=i?Symbol.for("react.strict_mode"):60108,l=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,f=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.forward_ref"):60112,h=i?Symbol.for("react.suspense"):60113;i&&Symbol.for("react.suspense_list");var p=i?Symbol.for("react.memo"):60115,m=i?Symbol.for("react.lazy"):60116;i&&Symbol.for("react.fundamental"),i&&Symbol.for("react.responder"),i&&Symbol.for("react.scope");var g="function"==typeof Symbol&&Symbol.iterator;function v(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nj.length&&j.push(e)}function M(e,t,n){return null==e?0:function e(t,n,r,i){var u=typeof t;"undefined"!==u&&"boolean"!==u||(t=null);var s=!1;if(null===t)s=!0;else switch(u){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case o:case a:s=!0}}if(s)return r(i,t,""===n?"."+B(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;lF.length&&F.push(e)}function N(e,t,n){return null==e?0:function e(t,n,r,i){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var u=!1;if(null===t)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case o:case a:u=!0}}if(u)return r(i,t,""===n?"."+P(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;l