// https://cdnjs.cloudflare.com/ajax/libs/vega-embed/3.0.0-rc7/vega-embed.min.js

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).vegaEmbed=e()}}(function(){return function e(t,n,r){function i(u,a){if(!n[u]){if(!t[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(o)return o(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[u]={exports:{}};t[u][0].call(l.exports,function(e){var n=t[u][1][e];return i(n||e)},l,l.exports,e,t,n,r)}return n[u].exports}for(var o="function"==typeof require&&require,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(e,t,n){!function(e,r){"object"==typeof n?t.exports=r():e.compareVersions=r()}(this,function(){function e(e){var t=e.replace(/^v/,"").split("."),n=t.splice(0,2);return n.push(t.join(".")),n}function t(e){return isNaN(Number(e))?e:Number(e)}function n(e){if("string"!=typeof e)throw new TypeError("Invalid argument expected string");if(!r.test(e))throw new Error("Invalid argument not valid semver")}var r=/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,i=/-([0-9A-Za-z-.]+)/;return function(r,o){[r,o].forEach(n);for(var u=e(r),a=e(o),s=0;s<3;s++){var c=parseInt(u[s]||0,10),l=parseInt(a[s]||0,10);if(c>l)return 1;if(l>c)return-1}if([u[2],a[2]].every(i.test.bind(i))){var f=i.exec(u[2])[1].split(".").map(t),h=i.exec(a[2])[1].split(".").map(t);for(s=0;s<Math.max(f.length,h.length);s++){if(void 0===f[s]||"string"==typeof h[s]&&"number"==typeof f[s])return-1;if(void 0===h[s]||"string"==typeof f[s]&&"number"==typeof h[s])return 1;if(f[s]>h[s])return 1;if(h[s]>f[s])return-1}}else if([u[2],a[2]].some(i.test.bind(i)))return i.test(u[2])?-1:1;return 0}})},{}],2:[function(e,t,n){!function(e,r){r("object"==typeof n&&void 0!==t?n:e.d3=e.d3||{})}(this,function(e){"use strict";function t(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===K&&t.documentElement.namespaceURI===K?t.createElement(e):t.createElementNS(n,e)}}function n(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function r(){return new i}function i(){this._="@"+(++ne).toString(36)}function o(e,t,n){return e=u(e,t,n),function(t){var n=t.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||e.call(this,t)}}function u(t,n,r){return function(i){var o=e.event;e.event=i;try{t.call(this,this.__data__,n,r)}finally{e.event=o}}}function a(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function s(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,o=t.length;r<o;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?t.length=i:delete this.__on}}}function c(e,t,n){var r=ae.hasOwnProperty(e.type)?o:u;return function(i,o,u){var a,s=this.__on,c=r(t,o,u);if(s)for(var l=0,f=s.length;l<f;++l)if((a=s[l]).type===e.type&&a.name===e.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=c,a.capture=n),void(a.value=t);this.addEventListener(e.type,c,n),a={type:e.type,name:e.name,value:t,listener:c,capture:n},s?s.push(a):this.__on=[a]}}function l(){}function f(){return[]}function h(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function p(e,t,n,r,i,o){for(var u,a=0,s=t.length,c=o.length;a<c;++a)(u=t[a])?(u.__data__=o[a],r[a]=u):n[a]=new h(e,o[a]);for(;a<s;++a)(u=t[a])&&(i[a]=u)}function d(e,t,n,r,i,o,u){var a,s,c,l={},f=t.length,p=o.length,d=new Array(f);for(a=0;a<f;++a)(s=t[a])&&(d[a]=c=de+u.call(s,s.__data__,a,t),c in l?i[a]=s:l[c]=s);for(a=0;a<p;++a)(s=l[c=de+u.call(e,o[a],a,o)])?(r[a]=s,s.__data__=o[a],l[c]=null):n[a]=new h(e,o[a]);for(a=0;a<f;++a)(s=t[a])&&l[d[a]]===s&&(i[a]=s)}function v(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function g(e){return function(){this.removeAttribute(e)}}function m(e){return function(){this.removeAttributeNS(e.space,e.local)}}function y(e,t){return function(){this.setAttribute(e,t)}}function _(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function w(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function b(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function x(e){return function(){this.style.removeProperty(e)}}function A(e,t,n){return function(){this.style.setProperty(e,t,n)}}function S(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function E(e,t){return e.style.getPropertyValue(t)||ve(e).getComputedStyle(e,null).getPropertyValue(t)}function N(e){return function(){delete this[e]}}function P(e,t){return function(){this[e]=t}}function O(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function L(e){return e.trim().split(/^|\s+/)}function M(e){return e.classList||new T(e)}function T(e){this._node=e,this._names=L(e.getAttribute("class")||"")}function j(e,t){for(var n=M(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function C(e,t){for(var n=M(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function V(e){return function(){j(this,e)}}function q(e){return function(){C(this,e)}}function D(e,t){return function(){(t.apply(this,arguments)?j:C)(this,e)}}function z(){this.textContent=""}function B(e){return function(){this.textContent=e}}function I(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function U(){this.innerHTML=""}function $(e){return function(){this.innerHTML=e}}function k(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function R(){this.nextSibling&&this.parentNode.appendChild(this)}function H(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function J(){return null}function G(){var e=this.parentNode;e&&e.removeChild(this)}function X(e,t,n){var r=ve(e),i=r.CustomEvent;"function"==typeof i?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function F(e,t){return function(){return X(this,e,t)}}function Y(e,t){return function(){return X(this,e,t.apply(this,arguments))}}function W(e,t){this._groups=e,this._parents=t}function Z(){return new W([[document.documentElement]],ge)}var K="http://www.w3.org/1999/xhtml",Q={svg:"http://www.w3.org/2000/svg",xhtml:K,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},ee=function(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Q.hasOwnProperty(t)?{space:Q[t],local:e}:e},te=function(e){var r=ee(e);return(r.local?n:t)(r)},ne=0;i.prototype=r.prototype={constructor:i,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};var re=function(e){return function(){return this.matches(e)}};if("undefined"!=typeof document){var ie=document.documentElement;if(!ie.matches){var oe=ie.webkitMatchesSelector||ie.msMatchesSelector||ie.mozMatchesSelector||ie.oMatchesSelector;re=function(e){return function(){return oe.call(this,e)}}}}var ue=re,ae={};e.event=null,"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(ae={mouseenter:"mouseover",mouseleave:"mouseout"}));var se=function(){for(var t,n=e.event;t=n.sourceEvent;)n=t;return n},ce=function(e,t){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]},le=function(e){return null==e?l:function(){return this.querySelector(e)}},fe=function(e){return null==e?f:function(){return this.querySelectorAll(e)}},he=function(e){return new Array(e.length)};h.prototype={constructor:h,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var pe=function(e){return function(){return e}},de="$",ve=function(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView};T.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var ge=[null];W.prototype=Z.prototype={constructor:W,select:function(e){"function"!=typeof e&&(e=le(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o,u,a=t[i],s=a.length,c=r[i]=new Array(s),l=0;l<s;++l)(o=a[l])&&(u=e.call(o,o.__data__,l,a))&&("__data__"in o&&(u.__data__=o.__data__),c[l]=u);return new W(r,this._parents)},selectAll:function(e){"function"!=typeof e&&(e=fe(e));for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var u,a=t[o],s=a.length,c=0;c<s;++c)(u=a[c])&&(r.push(e.call(u,u.__data__,c,a)),i.push(u));return new W(r,i)},filter:function(e){"function"!=typeof e&&(e=ue(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o,u=t[i],a=u.length,s=r[i]=[],c=0;c<a;++c)(o=u[c])&&e.call(o,o.__data__,c,u)&&s.push(o);return new W(r,this._parents)},data:function(e,t){if(!e)return v=new Array(this.size()),c=-1,this.each(function(e){v[++c]=e}),v;var n=t?d:p,r=this._parents,i=this._groups;"function"!=typeof e&&(e=pe(e));for(var o=i.length,u=new Array(o),a=new Array(o),s=new Array(o),c=0;c<o;++c){var l=r[c],f=i[c],h=f.length,v=e.call(l,l&&l.__data__,c,r),g=v.length,m=a[c]=new Array(g),y=u[c]=new Array(g);n(l,f,m,y,s[c]=new Array(h),v,t);for(var _,w,b=0,x=0;b<g;++b)if(_=m[b]){for(b>=x&&(x=b+1);!(w=y[x])&&++x<g;);_._next=w||null}}return u=new W(u,r),u._enter=a,u._exit=s,u},enter:function(){return new W(this._enter||this._groups.map(he),this._parents)},exit:function(){return new W(this._exit||this._groups.map(he),this._parents)},merge:function(e){for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,c=t[a],l=n[a],f=c.length,h=u[a]=new Array(f),p=0;p<f;++p)(s=c[p]||l[p])&&(h[p]=s);for(;a<r;++a)u[a]=t[a];return new W(u,this._parents)},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,i=e[t],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(e){e||(e=v);for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i){for(var o,u=t[i],a=u.length,s=r[i]=new Array(a),c=0;c<a;++c)(o=u[c])&&(s[c]=o);s.sort(function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n})}return new W(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){var e=new Array(this.size()),t=-1;return this.each(function(){e[++t]=this}),e},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null},size:function(){var e=0;return this.each(function(){++e}),e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i,o=t[n],u=0,a=o.length;u<a;++u)(i=o[u])&&e.call(i,i.__data__,u,o);return this},attr:function(e,t){var n=ee(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?m:g:"function"==typeof t?n.local?b:w:n.local?_:y)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?x:"function"==typeof t?S:A)(e,t,null==n?"":n)):E(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?N:"function"==typeof t?O:P)(e,t)):this.node()[e]},classed:function(e,t){var n=L(e+"");if(arguments.length<2){for(var r=M(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof t?D:t?V:q)(n,t))},text:function(e){return arguments.length?this.each(null==e?z:("function"==typeof e?I:B)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?U:("function"==typeof e?k:$)(e)):this.node().innerHTML},raise:function(){return this.each(R)},lower:function(){return this.each(H)},append:function(e){var t="function"==typeof e?e:te(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:te(e),r=null==t?J:"function"==typeof t?t:le(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(G)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,i,o=a(e+""),u=o.length;if(!(arguments.length<2)){for(l=t?c:s,null==n&&(n=!1),r=0;r<u;++r)this.each(l(o[r],t,n));return this}var l=this.node().__on;if(l)for(var f,h=0,p=l.length;h<p;++h)for(r=0,f=l[h];r<u;++r)if((i=o[r]).type===f.type&&i.name===f.name)return f.value},dispatch:function(e,t){return this.each(("function"==typeof t?Y:F)(e,t))}};e.creator=te,e.local=r,e.matcher=ue,e.mouse=function(e){var t=se();return t.changedTouches&&(t=t.changedTouches[0]),ce(e,t)},e.namespace=ee,e.namespaces=Q,e.select=function(e){return"string"==typeof e?new W([[document.querySelector(e)]],[document.documentElement]):new W([[e]],ge)},e.selectAll=function(e){return"string"==typeof e?new W([document.querySelectorAll(e)],[document.documentElement]):new W([null==e?[]:e],ge)},e.selection=Z,e.selector=le,e.selectorAll=fe,e.style=E,e.touch=function(e,t,n){arguments.length<3&&(n=t,t=se().changedTouches);for(var r,i=0,o=t?t.length:0;i<o;++i)if((r=t[i]).identifier===n)return ce(e,r);return null},e.touches=function(e,t){null==t&&(t=se().touches);for(var n=0,r=t?t.length:0,i=new Array(r);n<r;++n)i[n]=ce(e,t[n]);return i},e.window=ve,e.customEvent=function(t,n,r,i){var o=e.event;t.sourceEvent=e.event,e.event=t;try{return n.apply(r,i)}finally{e.event=o}},Object.defineProperty(e,"__esModule",{value:!0})})},{}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){var t=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t[0],version:t[1]}}},{}],4:[function(e,t,n){(function(t){"use strict";function r(e,t,a){try{var s=void 0===(a=a||{}).actions||a.actions,d=a.loader||n.vega.loader(),v=a.renderer||"canvas",g=a.logLevel||n.vega.Warn;if(n.vega.isString(t))return d.load(t).then(function(t){return r(e,JSON.parse(t),a)}).catch(Promise.reject);var m=a.config;if(n.vega.isString(m))return d.load(m).then(function(n){return a.config=JSON.parse(n),r(e,t,a)}).catch(Promise.reject);var y,_=void 0;t.$schema?(_=c.default(t.$schema),a.mode&&a.mode!==_.library&&console.warn("The given visualization spec is written in "+f[_.library]+", but mode argument sets "+f[a.mode]+"."),y=_.library,o(_.version,h[y])>0&&console.warn("The input spec uses "+y+" "+_.version+", but the current version of "+f[y]+" is "+h[y]+".")):y=a.mode||"vega";var w=p[y](t);"vega-lite"===y&&w.$schema&&(_=c.default(w.$schema),o(_.version,h.vega)>0&&console.warn("The compiled spec uses Vega "+_.version+", but current version is "+h.vega+"."));var b=u.select(e).classed("vega-embed",!0).html("");a.onBeforeParse&&(w=a.onBeforeParse(w));var x=n.vega.parse(w,a.config),A=new n.vega.View(x,{loader:d,logLevel:g,renderer:v}).initialize(e);if("vega-lite"!==y&&A.hover(),a&&(a.width&&A.width(a.width),a.height&&A.height(a.height),a.padding&&A.padding(a.padding)),A.run(),!1!==s){var S=b.append("div").attr("class","vega-actions");if(!0===s||!1!==s.export){var E="canvas"===v?"png":"svg";S.append("a").text("Export as "+E.toUpperCase()).attr("href","#").attr("target","_blank").attr("download",(t.name||"vega")+"."+E).on("mousedown",function(){var e=this;A.toImageURL(E).then(function(t){e.href=t}).catch(function(e){throw e}),u.event.preventDefault()})}if(!0!==s&&!1===s.source||S.append("a").text("View Source").attr("href","#").on("click",function(){i(JSON.stringify(t,null,2),a.sourceHeader||"",a.sourceFooter||""),u.event.preventDefault()}),!0===s||!1!==s.editor){var N=a.editorUrl||"https://vega.github.io/editor/";S.append("a").text("Open in Vega Editor").attr("href","#").on("click",function(){l.post(window,N,{mode:y,spec:JSON.stringify(t,null,2)}),u.event.preventDefault()})}}return Promise.resolve({view:A,spec:t})}catch(e){return Promise.reject(e)}}function i(e,t,n){var r="<html><head>"+t+"</head>' + '<body><pre><code class=\"json\">",i="</code></pre>"+n+"</body></html>",o=window.open("");o.document.write(r+e+i),o.document.title="Vega JSON Source"}Object.defineProperty(n,"__esModule",{value:!0});var o=e("compare-versions"),u=e("d3-selection"),a="undefined"!=typeof window?window.vega:void 0!==t?t.vega:null,s="undefined"!=typeof window?window.vl:void 0!==t?t.vl:null,c=e("vega-schema-url-parser");n.vega=a,n.vl=s;var l=e("./post"),f={vega:"Vega","vega-lite":"Vega-Lite"},h={vega:n.vega.version,"vega-lite":n.vl?n.vl.version:"not available"},p={vega:function(e){return e},"vega-lite":function(e){return n.vl.compile(e).spec}};n.default=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./post":6,"compare-versions":1,"d3-selection":2,"vega-schema-url-parser":3}],5:[function(e,t,n){(function(n){"use strict";var r="undefined"!=typeof window?window.vega:void 0!==n?n.vega:null,i="undefined"!=typeof window?window.vl:void 0!==n?n.vl:null,o=e("./embed"),u=o.default;u.default=o.default,u.vega=r,u.vl=i,t.exports=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./embed":4}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.post=function(e,t,n){function r(t){t.source===o&&(a=0,e.removeEventListener("message",r,!1))}function i(){a<=0||(o.postMessage(n,"*"),setTimeout(i,u),a-=1)}var o=e.open(t),u=250,a=~~(1e4/u);e.addEventListener("message",r,!1),setTimeout(i,u)}},{}]},{},[5])(5)});