dotfiles/vscode/.vscode/extensions/randomfractalsinc.vscode-data-preview-2.3.0/node_modules/d3fc/build/d3fc.min.js
Errol Sancaktar ff17c17e23 vscode
2024-06-14 09:31:58 -06:00

3 lines
88 KiB
JavaScript

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-array"),require("d3-scale"),require("d3-time"),require("d3-random"),require("d3-fetch"),require("d3-path"),require("d3-selection"),require("d3-shape"),require("d3-dispatch"),require("d3-brush")):"function"==typeof define&&define.amd?define(["exports","d3-array","d3-scale","d3-time","d3-random","d3-fetch","d3-path","d3-selection","d3-shape","d3-dispatch","d3-brush"],n):n(t.fc=t.fc||{},t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3)}(this,function(t,n,e,r,i,o,u,a,c,l,f){"use strict";function h(t){return t}function s(t){}function d(t){return"function"==typeof t?t:function(){return t}}function g(t){return"number"==typeof t&&isNaN(t)?void 0:t}function v(t,n){var e=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done);r=!0){var c=u.value,l=n.clampUp(c);l===n.clampDown(c)&&e.push(l)}}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return e}function m(t){var n=this;arguments.length||(t=e.scaleIdentity());var r=X(),i=function(n){var e=t.domain(),i=t.range(),o=r.distance(e[0],e[1]);return r.distance(e[0],n)/o*(i[1]-i[0])+i[0]};return i.invert=function(n){var e=t.domain(),i=t.range(),o=(n-i[0])/(i[1]-i[0]),u=r.distance(e[0],e[1]),a=o*u;return r.offset(e[0],a)},i.domain=function(){if(!arguments.length)return t.domain();var n=arguments.length<=0?void 0:arguments[0],e=r.clampUp(n[0]),o=r.clampDown(n[1]);return t.domain([e,o]),i},i.nice=function(){t.nice();var n=t.domain(),e=r.clampUp(n[0]),o=r.clampDown(n[1]);return t.domain([e,o]),i},i.ticks=function(){for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];return v(t.ticks.apply(n,i),r)},i.copy=function(){return m(t.copy()).discontinuityProvider(r.copy())},i.discontinuityProvider=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],i):r},_(i,t,T("range","rangeRound","interpolate","clamp","tickFormat")),i}function p(t){return"function"==typeof t?t:function(){return t}}function y(){var t=arguments;return function(n,e){for(var r=0,i=t.length;r<i;r++)if(null==t[r](n,e))return!1;return!0}}function x(){return Reflect.construct(HTMLElement,[],this.__proto__.constructor)}function w(){return Reflect.construct(HTMLElement,[],this.__proto__.constructor)}var b=function(t,n,e){var r=n[e];if("function"!=typeof r)throw new Error("Attempt to rebind "+e+" which isn't a function on the source object");return function(){for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];var u=r.apply(n,i);return u===n?t:u}},S=function(t,n){for(var e=arguments.length,r=Array(e>2?e-2:0),i=2;i<e;i++)r[i-2]=arguments[i];var o=!0,u=!1,a=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;t[f]=b(t,n,f)}}catch(t){u=!0,a=t}finally{try{!o&&l.return&&l.return()}finally{if(u)throw a}}return t},k=function(t){return function(n){return t.reduce(function(t,n){return t&&n(t)},n)}},_=function(t,n){for(var e=arguments.length,r=Array(e>2?e-2:0),i=2;i<e;i++)r[i-2]=arguments[i];var o=k(r),u=!0,a=!1,c=void 0;try{for(var l,f=Object.keys(n)[Symbol.iterator]();!(u=(l=f.next()).done);u=!0){var h=l.value,s=o(h);s&&(t[s]=b(t,n,h))}}catch(t){a=!0,c=t}finally{try{!u&&f.return&&f.return()}finally{if(a)throw c}}return t},A=function(t){return t.map(function(t){return"string"==typeof t?new RegExp("^"+t+"$"):t})},E=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return n=A(n),function(t){return n.every(function(n){return!n.test(t)})&&t}},T=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return n=A(n),function(t){return n.some(function(n){return n.test(t)})&&t}},z=function(t){return function(n){return t[n]}},D=function(t){return t[0].toUpperCase()+t.slice(1)},P=function(t){return function(n){return t+D(n)}},O=function(){var t=function(){return 10},n=s,e=h,r=function(t){return null!=t},i=function(i){var o=t.apply(this,arguments),u=i.slice(0,o).map(e);return i.map(function(t,i){return i>=o&&(u.shift(),u.push(e(t,i))),i<o-1||u.some(function(t){return!r(t)})?n(void 0,i):n(u,i)})};return i.period=function(){return arguments.length?(t=d(arguments.length<=0?void 0:arguments[0]),i):t},i.accumulator=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},i.defined=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],i):r},i.value=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],i):e},i},M=function(){var t=2,e=O().accumulator(function(e){var r=e&&n.deviation(e),i=e&&n.mean(e);return{average:i,upper:g(i+t*r),lower:g(i-t*r)}}),r=function(t){return e(t)};return r.multiplier=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],r):t},S(r,e,"period","value"),r},I=function(){var t=h,e=function(){return 9},r=function(t){var e=[];return function(r){var i=void 0;return e.length<t&&(null!=r?e.push(r):e=[]),e.length>=t&&(i=n.mean(e)),i}},i=function(n){var i=e.apply(this,arguments),o=2/(i+1),u=r(i),a=void 0;return n.map(function(n,e){var r=t(n,e);return a=void 0===a?u(r):r*o+(1-o)*a,g(a)})};return i.period=function(){return arguments.length?(e=d(arguments.length<=0?void 0:arguments[0]),i):e},i.value=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],i):t},i},C=function(){var t=h,e=I().period(12),r=I().period(26),i=I().period(9),o=function(o){e.value(t),r.value(t);var u=n.zip(e(o),r(o)).map(function(t){return void 0!==t[0]&&void 0!==t[1]?t[0]-t[1]:void 0}),a=i(u);return n.zip(u,a).map(function(t){return{macd:t[0],signal:t[1],divergence:void 0!==t[0]&&void 0!==t[1]?t[0]-t[1]:void 0}})};return o.value=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],o):t},_(o,e,z({period:"fastPeriod"})),_(o,r,z({period:"slowPeriod"})),_(o,i,z({period:"signalPeriod"})),o},V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L=function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")},R=function(){function t(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(n,e,r){return e&&t(n.prototype,e),r&&t(n,r),n}}(),B=function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)},j=function(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n},N=function(){function t(t,n){var e=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(e.push(u.value),!n||e.length!==n);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return e}return function(n,e){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return t(n,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),q=function(t){return Array.isArray(t)?t:Array.from(t)},Q=function(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n<t.length;n++)e[n]=t[n];return e}return Array.from(t)},F=function(){var t=O().period(14),e=function(t,n){return n+(t[t.length-1]-n)/t.length},r=function(t){var n=N(t,2),e=n[0],r=n[1];return e<r?0:e-r},i=function(t){var n=N(t,2),e=n[0],r=n[1];return e>r?0:r-e},o=function(t,r){return void 0!==r?e(t,r):n.mean(t)},u=function(){var t=void 0,e=void 0,u=void 0;return function(a){if(!a)return void(void 0!==t&&(t=NaN));if(void 0===t)return void(t=a[0]);var c=n.pairs([t].concat(Q(a)));return e=o(c.map(r),e),u=o(c.map(i),u),g(100-100/(1+(isNaN(t)?NaN:u/e)))}},a=function(n){var e=u();return t.accumulator(e),t(n)};return S(a,t,"period","value"),a},U=function(){var t=O().accumulator(function(t){return t&&n.mean(t)}),e=function(n){return t(n)};return S(e,t,"period","value"),e},G=function(){var t=function(t,n){return t.close},e=function(t,n){return t.high},r=function(t,n){return t.low},i=O().period(5).defined(function(n){return null!=t(n)&&null!=e(n)&&null!=r(n)}).accumulator(function(i){var o=i&&n.max(i,e),u=i&&n.min(i,r);return g(i&&100*(t(i[i.length-1])-u)/(o-u))}),o=U().period(3),u=function(t){var n=i(t),e=o(n);return n.map(function(t,n){return{k:t,d:e[n]}})};return u.closeValue=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],u):t},u.highValue=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],u):e},u.lowValue=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],u):r},_(u,i,z({period:"kPeriod"})),_(u,o,z({period:"dPeriod"})),u},H=function(){var t=function(t,n){return t.volume},n=function(t,n){return t.close},e=I().period(13),r=O().period(2).defined(function(e){return null!=n(e)&&null!=t(e)}).accumulator(function(e){return e&&g((n(e[1])-n(e[0]))*t(e[1]))}),i=function(t){var n=r(t);return e(n)};return i.volumeValue=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],i):t},i.closeValue=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},S(i,e,"period"),i},Y=function(){var t=.1,n=h,e=function(e){return e.map(function(e){return{lower:g(n(e)*(1-t)),upper:g(n(e)*(1+t))}})};return e.factor=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],e):t},e.value=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],e):n},e},W=function(){var t=function(t,n){return t.close},e=function(t,n){return t.high},r=function(t,n){return t.low},i=I().period(13),o=function(o){return i.value(t),n.zip(o,i(o)).map(function(t){return{bullPower:g(e(t[0])-t[1]),bearPower:g(r(t[0])-t[1])}})};return o.closeValue=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],o):t},o.highValue=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],o):e},o.lowValue=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],o):r},S(o,i,"period"),o},X=function(){var t={};return t.distance=function(t,n){return n-t},t.offset=function(t,n){return t instanceof Date?new Date(t.getTime()+n):t+n},t.clampUp=function(t){return t},t.clampDown=function(t){return t},t.copy=function(){return t},t},K=function(){var t={sunday:0,monday:1,saturday:6},n={},e=function(t){return 0===t.getDay()||6===t.getDay()};return n.clampDown=function(n){if(n&&e(n)){var i=r.timeDay.ceil(n);return i.getDay()===t.sunday?r.timeDay.offset(i,-1):i.getDay()===t.monday?r.timeDay.offset(i,-2):i}return n},n.clampUp=function(n){if(n&&e(n)){var i=r.timeDay.floor(n);return i.getDay()===t.saturday?r.timeDay.offset(i,2):i.getDay()===t.sunday?r.timeDay.offset(i,1):i}return n},n.distance=function(t,e){t=n.clampUp(t),e=n.clampDown(e);var i=r.timeSaturday.ceil(t);if(e<i)return e.getTime()-t.getTime();var o=i.getTime()-t.getTime(),u=r.timeSaturday.ceil(e),a=u.getTime()-e.getTime();return 432e6*Math.round((u.getTime()-i.getTime())/6048e5)+o-a},n.offset=function(t,i){var o=e(t)?n.clampUp(t):t;if(0===i)return o;var u=i<0,a=i>0,c=i,l=u?r.timeMonday.floor(o):r.timeSaturday.ceil(o);if(c-=l.getTime()-o.getTime(),u&&c>0||a&&c<0)return new Date(o.getTime()+i);o=u?l:r.timeDay.offset(l,2);var f=Math.floor(c/432e6);return o=r.timeDay.offset(o,7*f),c-=432e6*f,o=new Date(o.getTime()+c)},n.copy=function(){return n},n},J=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];var r=function(t,n){return t>n[0]&&t<n[1]},i=function(t,n){return t[0]>=n[0]&&t[1]<=n[1]},o={};o.distance=function(t,e){t=o.clampUp(t),e=o.clampDown(e);var r=n.filter(function(n){return i(n,[t,e])}),u=r.map(function(t){return t[1]-t[0]});return e-t-u.reduce(function(t,n){return t+n},0)};var u=function(t,n){return t instanceof Date?new Date(t.getTime()+n):t+n};return o.offset=function(t,e){if(e>0){var r=function(){for(var r=o.clampUp(t),i=e;i>0;){var a=n.filter(function(t){return t[0]>r}).sort(function(t,n){return t[0]-n[0]});if(a.length){var c=a[0],l=c[0]-r;l>i?(r=u(r,i),i=0):(r=c[1],i-=l)}else r=u(r,i),i=0}return{v:r}}();if("object"===(void 0===r?"undefined":V(r)))return r.v}else{var i=function(){for(var r=o.clampDown(t),i=e;i<0;){var a=n.filter(function(t){return t[1]<r}).sort(function(t,n){return n[0]-t[0]});if(a.length){var c=a[0],l=c[1]-r;l<i?(r=u(r,i),i=0):(r=c[0],i-=l)}else r=u(r,i),i=0}return{v:r}}();if("object"===(void 0===i?"undefined":V(i)))return i.v}},o.clampUp=function(t){return n.reduce(function(t,n){return r(t,n)?n[1]:t},t)},o.clampDown=function(t){return n.reduce(function(t,n){return r(t,n)?n[0]:t},t)},o.copy=function(){return o},o},Z=function(){var t=[function(t){return t}],e=[0,0],r="percent",i=null,o=[],u=function(u){var a=new Array(u.length),c=!0,l=!1,f=void 0;try{for(var h,s=t[Symbol.iterator]();!(c=(h=s.next()).done);c=!0)for(var d=h.value,g=0;g<u.length;g++){var v=d(u[g],g);Array.isArray(v)?a.push.apply(a,Q(v)):a.push(v)}}catch(t){l=!0,f=t}finally{try{!c&&s.return&&s.return()}finally{if(l)throw f}}var m=[n.min(a),n.max(a)];if(m[0]=null==m[0]?n.min(o):n.min([m[0]].concat(Q(o))),m[1]=null==m[1]?n.max(o):n.max([m[1]].concat(Q(o))),null!=i){var p=Math.max(Math.abs(m[1]-i),Math.abs(m[0]-i));m[0]=i-p,m[1]=i+p}switch(r){case"domain":m[0]-=e[0],m[1]+=e[1];break;case"percent":var y=m[1]-m[0];m[0]-=e[0]*y,m[1]+=e[1]*y;break;default:throw new Error("Unknown padUnit: "+r)}return m};return u.accessors=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],u):t},u.pad=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],u):e},u.padUnit=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],u):r},u.include=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],u):o},u.symmetricalAbout=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],u):i},u},$=function(){var t=[],n=[0,0],e="percent",r=null,i=[],o=Z(),u=function(t){return null!=t?t.valueOf():null},a=function(a){var c=t.map(function(t){return function(){var n=t.apply(void 0,arguments);return Array.isArray(n)?n.map(u):u(n)}});return o.accessors(c).pad(n).padUnit(e).symmetricalAbout(null!=r?r.valueOf():null).include(i.map(function(t){return t.valueOf()})),o(a).map(function(t){return new Date(t)})};return a.accessors=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],a):t},a.pad=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],a):n},a.padUnit=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],a):e},a.include=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],a):i},a.symmetricalAbout=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],a):r},a},tt=function(){var t=1,n=20,e=.1,r=.1,o=i.randomNormal(),u=function(){for(var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,u=t/n,a=[],c=0;c<n+1;c++){a.push(i);var l=o()*Math.sqrt(u)*r+(e-r*r/2)*u;i*=Math.exp(l)}return a};return u.period=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],u):t},u.steps=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],u):n},u.mu=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],u):e},u.sigma=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],u):r},u.random=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],u):o},u},nt=function(){var t=new Date,n=100,e=r.timeDay,o=1,u=r.timeYear,a=1,c=null,l=function(){var t=i.randomNormal(1,.1);return Math.ceil(1e3*t())},f=tt(),h=function(t){var n=u.offset(t,a)-t;return(e.offset(t,o)-t)/n},s=function(t,n){var e=h(t),r=f.period(e)(n),i={date:t,open:r[0],high:Math.max.apply(Math,r),low:Math.min.apply(Math,r),close:r[f.steps()]};return i.volume=l(i),i},d=function(r){var i=void 0,u=void 0,a=void 0;do{i=r?e.offset(r.date,o):new Date(t.getTime()),u=r?r.close:n,r=s(i,u),a=c&&!c(r)}while(a);return r},g=function(){var t=void 0,n={};return n.next=function(){var n=d(t);return t=n,n},n.take=function(t){return n.until(function(n,e){return!t||t<0||e===t})},n.until=function(n){for(var e=[],r=0,i=d(t),o=n&&!n(i,r);o;)e.push(i),t=i,i=d(t),r+=1,o=n&&!n(i,r);return e},n},v=function(t){return g().take(t)};if(v.stream=g,"function"!=typeof Symbol||"symbol"!==V(Symbol.iterator))throw new Error("d3fc-random-data depends on Symbol. Make sure that you load a polyfill in older browsers. See README.");return v[Symbol.iterator]=function(){var t=g();return{next:function(){return{value:t.next(),done:!1}}}},v.startDate=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],v):t},v.startPrice=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],v):n},v.interval=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],v):e},v.intervalStep=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],v):o},v.unitInterval=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],v):u},v.unitIntervalStep=function(){return arguments.length?(a=arguments.length<=0?void 0:arguments[0],v):a},v.filter=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],v):c},v.volume=function(){return arguments.length?(l=p(arguments.length<=0?void 0:arguments[0]),v):l},_(v,f),v},et=function(t){var n=t.date.getDay();return!(0===n||6===n)},rt=function(){var t="BTC-USD",n=null,e=null,r=null,i=function(){var i=[];null!=n&&i.push("start="+n.toISOString()),null!=e&&i.push("end="+e.toISOString()),null!=r&&i.push("granularity="+r);var u="https://api.gdax.com/products/"+t+"/candles?"+i.join("&");return o.json(u).then(function(t){return t.map(function(t){return{date:new Date(1e3*t[0]),open:t[3],high:t[2],low:t[1],close:t[4],volume:t[5]}})})};return i.product=function(n){return arguments.length?(t=n,i):t},i.start=function(t){return arguments.length?(n=t,i):n},i.end=function(t){return arguments.length?(e=t,i):e},i.granularity=function(t){return arguments.length?(r=t,i):r},i},it=function(){var t=10,e=function(e){return t<=1?e.map(function(t){return[t]}):n.range(0,Math.ceil(e.length/t)).map(function(n){return e.slice(n*t,(n+1)*t)})};return e.bucketSize=function(n){return arguments.length?(t=n,e):t},e},ot=function(){function t(t){var e=t.map(function(t){return[r(t),i(t)]});return n.range(1,e.length-1).map(function(t){var n=e[t-1],r=e[t],i=e[t+1];return.5*Math.abs((n[0]-i[0])*(r[1]-n[1])-(n[0]-r[0])*(i[1]-n[1]))})}var e=it(),r=function(t){return t},i=function(t){return t},o=function(r){if(e.bucketSize()>=r.length)return r;var i=t(r),o=e(i),u=e(r.slice(1,r.length-1)),a=u.map(function(t,e){var r=o[e],i=n.max(r);return t[r.indexOf(i)]});return[].concat([r[0]],a,[r[r.length-1]])};return S(o,e,"bucketSize"),o.x=function(t){return arguments.length?(r=t,o):r},o.y=function(t){return arguments.length?(i=t,o):i},o},ut=function(){var t=function(t){return t},e=function(t){return t},r=it(),i=function(i){if(r.bucketSize()>=i.length)return i;var o=r(i.slice(1,i.length-1)),u=i[0],a=i[i.length-1],c=[].concat([u],o,[a]),l=t(u),f=e(u),h=o.map(function(r,i){var o=n.mean(c[i+1],t),u=n.mean(c[i+1],e),a=r.map(function(n){return[t(n),e(n)]}),h=a.map(function(t){return.5*Math.abs((l-o)*(t[1]-f)-(l-t[0])*(u-f))}),s=h.indexOf(n.max(h)),d=a[s];return l=d[0],f=d[1],r[s]});return[].concat([i[0]],h,[i[i.length-1]])};return S(i,r,"bucketSize"),i.x=function(n){return arguments.length?(t=n,i):t},i.y=function(t){return arguments.length?(e=t,i):e},i},at=function(){var t=it(),e=function(t){return t},r=function(r){if(t.bucketSize()>r.length)return r;var i=n.extent(r,e),o=t(r.slice(1,r.length-1)),u=o.map(function(t,n){var r,o,u={},a=!0,c=t.map(e),l=c.filter(function(t){return t===i[0]||t===i[1]}).map(function(t){return c.indexOf(t)})[0];return void 0!==l?t[l]:(c.forEach(function(t,n){void 0===u[t]&&(u[t]=0),u[t]++,u[t]>u[r]||void 0===r?(r=t,o=n,a=!0):u[t]===u[r]&&(a=!1)}),a?t[o]:t[Math.floor(t.length/2)])});return[].concat([r[0]],u,[r[r.length-1]])};return S(r,t,"bucketSize"),r.value=function(t){return arguments.length?(e=t,r):e},r},ct=function(t){return"function"==typeof t?t:function(){return t}},lt=function(){var t=null,n=function(t){return t.date},e=function(t){return t.open},r=function(t){return t.high},i=function(t){return t.low},o=function(t){return t.close},a="vertical",c=ct(3),l=function(l){var f=t||u.path();return l.forEach(function(t,u){var l=n(t,u),h=e(t,u),s=r(t,u),d=i(t,u),g=o(t,u),v=c(t,u)/2;"vertical"===a?(f.moveTo(l,d),f.lineTo(l,s),f.moveTo(l,h),f.lineTo(l-v,h),f.moveTo(l,g),f.lineTo(l+v,g)):(f.moveTo(d,l),f.lineTo(s,l),f.moveTo(h,l),f.lineTo(h,l+v),f.moveTo(g,l),f.lineTo(g,l-v))}),t?null:f.toString()};return l.context=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],l):t},l.x=function(){return arguments.length?(n=ct(arguments.length<=0?void 0:arguments[0]),l):n},l.open=function(){return arguments.length?(e=ct(arguments.length<=0?void 0:arguments[0]),l):e},l.high=function(){return arguments.length?(r=ct(arguments.length<=0?void 0:arguments[0]),l):r},l.low=function(){return arguments.length?(i=ct(arguments.length<=0?void 0:arguments[0]),l):i},l.close=function(){return arguments.length?(o=ct(arguments.length<=0?void 0:arguments[0]),l):o},l.width=function(){return arguments.length?(c=ct(arguments.length<=0?void 0:arguments[0]),l):c},l.orient=function(){return arguments.length?(a=arguments.length<=0?void 0:arguments[0],l):a},l},ft=function(){var t=null,n=function(t){return t.x},e=function(t){return t.y},r="center",i="center",o=function(t){return t.height},a=ct(3),c=function(c,l){var f=t||u.path();return c.forEach(function(t,u){var c=n.call(this,t,l||u),h=e.call(this,t,l||u),s=o.call(this,t,l||u),d=a.call(this,t,l||u),g=void 0;switch(r){case"left":g=d;break;case"right":g=0;break;case"center":g=d/2;break;default:throw new Error("Invalid horizontal alignment "+r)}var v=void 0;switch(i){case"bottom":v=-s;break;case"top":v=0;break;case"center":v=s/2;break;default:throw new Error("Invalid vertical alignment "+i)}f.rect(c-g,h-v,d,s)},this),t?null:f.toString()};return c.context=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],c):t},c.x=function(){return arguments.length?(n=ct(arguments.length<=0?void 0:arguments[0]),c):n},c.y=function(){return arguments.length?(e=ct(arguments.length<=0?void 0:arguments[0]),c):e},c.width=function(){return arguments.length?(a=ct(arguments.length<=0?void 0:arguments[0]),c):a},c.horizontalAlign=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],c):r},c.height=function(){return arguments.length?(o=ct(arguments.length<=0?void 0:arguments[0]),c):o},c.verticalAlign=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],c):i},c},ht=function(){var t=null,n=function(t){return t.date},e=function(t){return t.open},r=function(t){return t.high},i=function(t){return t.low},o=function(t){return t.close},a=ct(3),c=function(c){var l=t||u.path();return c.forEach(function(t,u){var c=n(t,u),f=e(t,u),h=r(t,u),s=i(t,u),d=o(t,u),g=a(t,u),v=g/2;l.rect(c-v,f,g,d-f),l.moveTo(c,Math.min(d,f)),l.lineTo(c,h),l.moveTo(c,Math.max(d,f)),l.lineTo(c,s)}),t?null:l.toString()};return c.context=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],c):t},c.x=function(){return arguments.length?(n=ct(arguments.length<=0?void 0:arguments[0]),c):n},c.open=function(){return arguments.length?(e=ct(arguments.length<=0?void 0:arguments[0]),c):e},c.high=function(){return arguments.length?(r=ct(arguments.length<=0?void 0:arguments[0]),c):r},c.low=function(){return arguments.length?(i=ct(arguments.length<=0?void 0:arguments[0]),c):i},c.close=function(){return arguments.length?(o=ct(arguments.length<=0?void 0:arguments[0]),c):o},c.width=function(){return arguments.length?(a=ct(arguments.length<=0?void 0:arguments[0]),c):a},c},st=function(){var t=null,n=function(t){return t.value},e=function(t){return t.median},r=function(t){return t.upperQuartile},i=function(t){return t.lowerQuartile},o=function(t){return t.high},a=function(t){return t.low},c="vertical",l=ct(5),f=ct(.5),h=function(h){var s=t||u.path();return h.forEach(function(t,u){var h=n(t,u),d=l(t,u),g=d/2,v=d*f(t,u),m=v/2,p=o(t,u),y=r(t,u),x=e(t,u),w=i(t,u),b=a(t,u),S=w-y;"vertical"===c?(s.moveTo(h-m,p),s.lineTo(h+m,p),s.moveTo(h,p),s.lineTo(h,y),s.rect(h-g,y,d,S),s.moveTo(h-g,x),s.lineTo(h+g,x),s.moveTo(h,w),s.lineTo(h,b),s.moveTo(h-m,b),s.lineTo(h+m,b)):(s.moveTo(b,h-m),s.lineTo(b,h+m),s.moveTo(b,h),s.lineTo(w,h),s.rect(w,h-g,-S,d),s.moveTo(x,h-g),s.lineTo(x,h+g),s.moveTo(y,h),s.lineTo(p,h),s.moveTo(p,h-m),s.lineTo(p,h+m))}),t?null:s.toString()};return h.context=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],h):t},h.value=function(){return arguments.length?(n=ct(arguments.length<=0?void 0:arguments[0]),h):n},h.median=function(){return arguments.length?(e=ct(arguments.length<=0?void 0:arguments[0]),h):e},h.upperQuartile=function(){return arguments.length?(r=ct(arguments.length<=0?void 0:arguments[0]),h):r},h.lowerQuartile=function(){return arguments.length?(i=ct(arguments.length<=0?void 0:arguments[0]),h):i},h.high=function(){return arguments.length?(o=ct(arguments.length<=0?void 0:arguments[0]),h):o},h.low=function(){return arguments.length?(a=ct(arguments.length<=0?void 0:arguments[0]),h):a},h.width=function(){return arguments.length?(l=ct(arguments.length<=0?void 0:arguments[0]),h):l},h.orient=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],h):c},h.cap=function(){return arguments.length?(f=ct(arguments.length<=0?void 0:arguments[0]),h):f},h},dt=function(){var t=null,n=function(t){return t.x},e=function(t){return t.high},r=function(t){return t.low},i="vertical",o=ct(5),a=function(a){var c=t||u.path();return a.forEach(function(t,u){var a=n(t,u),l=o(t,u),f=l/2,h=e(t,u),s=r(t,u);"vertical"===i?(c.moveTo(a-f,h),c.lineTo(a+f,h),c.moveTo(a,h),c.lineTo(a,s),c.moveTo(a-f,s),c.lineTo(a+f,s)):(c.moveTo(s,a-f),c.lineTo(s,a+f),c.moveTo(s,a),c.lineTo(h,a),c.moveTo(h,a-f),c.lineTo(h,a+f))}),t?null:c.toString()};return a.context=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],a):t},a.value=function(){return arguments.length?(n=ct(arguments.length<=0?void 0:arguments[0]),a):n},a.high=function(){return arguments.length?(e=ct(arguments.length<=0?void 0:arguments[0]),a):e},a.low=function(){return arguments.length?(r=ct(arguments.length<=0?void 0:arguments[0]),a):r},a.width=function(){return arguments.length?(o=ct(arguments.length<=0?void 0:arguments[0]),a):o},a.orient=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],a):i},a},gt=function(t){return"function"==typeof t?t:function(){return t}},vt=function(t,n){t=t||"g";var e=function(t,n){return n},r=null,i=function(i,o){o=o||function(t){return t};var u=i.selection?i:null;u&&(i=i.selection());var a=i.selectAll(function(t,n,e){return Array.from(e[n].childNodes).filter(function(t){return 1===t.nodeType})}).filter(null==n?t:t+"."+n),c=a.data(o,e),l=c.enter().append(t).attr("class",n),f=c.exit();c=c.merge(l);var h=u||r;return h&&(c=c.transition(h).style("opacity",1),l.style("opacity",1e-6),f=f.transition(h).style("opacity",1e-6)),f.remove(),c.enter=function(){return l},c.exit=function(){return f},c};return i.element=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],i):t},i.className=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},i.key=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],i):e},i.transition=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],i):r},i},mt=function(t){var n=function(){},r=function(){return[0,0]},i=function(t,n){return[t.x,t.y]},o=t||function(t){return t},u=function(){},c=e.scaleIdentity(),l=e.scaleIdentity(),f=vt("g","label"),h=function(t){t.each(function(t,e,h){var s=f(a.select(h[e]),t).call(u),d=s.nodes(),g=d.map(function(t,n){var e=a.select(t).datum(),o=i(e,n,d),u=[c(o[0]),l(o[1])],f=r(e,n,d);return{hidden:!1,x:u[0],y:u[1],width:f[0],height:f[1]}}),v=o(g);s.attr("style",function(t,n){return"display:"+(v[n].hidden?"none":"inherit")}).attr("transform",function(t,n){return"translate("+v[n].x+", "+v[n].y+")"}).attr("layout-width",function(t,n){return v[n].width}).attr("layout-height",function(t,n){return v[n].height}).attr("anchor-x",function(t,n,e){return g[n].x-v[n].x}).attr("anchor-y",function(t,n,e){return g[n].y-v[n].y}),s.call(u),n(s,t,e)})};return _(h,f,T("key")),_(h,o),h.size=function(){return arguments.length?(r=gt(arguments.length<=0?void 0:arguments[0]),h):r},h.position=function(){return arguments.length?(i=gt(arguments.length<=0?void 0:arguments[0]),h):i},h.component=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],h):u},h.decorate=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],h):n},h.xScale=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],h):c},h.yScale=function(){return arguments.length?(l=arguments.length<=0?void 0:arguments[0],h):l},h},pt=function(t){var n=2,e=function(t){return t},r=vt("text"),i=vt("rect"),o=vt("circle"),u=function(t){t.each(function(t,u,c){var l=c[u],f=a.select(l),h=Number(l.getAttribute("layout-width")),s=Number(l.getAttribute("layout-height"));i(f,[t]).attr("width",h).attr("height",s);var d=Number(l.getAttribute("anchor-x")),g=Number(l.getAttribute("anchor-y"));o(f,[t]).attr("r",2).attr("cx",d).attr("cy",g);var v=r(f,[t]);v.enter().attr("dy","0.9em").attr("transform","translate("+n+", "+n+")"),v.text(e)})};return u.padding=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],u):n},u.value=function(){return arguments.length?(e=gt(arguments.length<=0?void 0:arguments[0]),u):e},u},yt=function(t,n){return!(t.x>=n.x+n.width||t.x+t.width<=n.x||t.y>=n.y+n.height||t.y+t.height<=n.y)},xt=function(t,n){if(yt(t,n)){var e=Math.max(t.x,n.x),r=Math.min(t.x+t.width,n.x+n.width),i=Math.max(t.y,n.y);return(r-e)*(Math.min(t.y+t.height,n.y+n.height)-i)}return 0},wt=function(t,e){return n.sum(t.map(function(n,r){return e===r?0:xt(t[e],n)}))},bt=function(t,n,e,r,i){return{x:t,y:n,width:e,height:r,location:i}},St=function(t){var n=t.x,e=t.y,r=t.width,i=t.height;return[bt(n,e,r,i,"bottom-right"),bt(n-r,e,r,i,"bottom-left"),bt(n-r,e-i,r,i,"top-left"),bt(n,e-i,r,i,"top-right"),bt(n,e-i/2,r,i,"middle-right"),bt(n-r/2,e,r,i,"bottom-center"),bt(n-r,e-i/2,r,i,"middle-left"),bt(n-r/2,e-i,r,i,"top-center")]},kt=function(t,n,e){return[].concat(Q(t.slice(0,n)),[e],Q(t.slice(n+1)))},_t=function(t,n){return t<n},At=function t(){var e=null,r=_t,i=function(){return 0},o=void 0,u=function(t,n){return e-i(o[n],n,o)+i(t,n,kt(o,n,t))},a=function a(c,l){e||(e=n.sum(o.map(function(t,n){return i(t,n,o)})));var f=u(c,l);return r(f,e)?t().locationScore(i).winningScore(r).score(f).rectangles(kt(o,l,c)):a};return a.rectangles=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],a):o},a.score=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],a):e},a.winningScore=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],a):r},a.locationScore=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],a):i},a},Et=function(){var t=void 0,n=function(n){return t?n.width*n.height-xt(n,t):0},e=function(t,e,r){return wt(r,e)+n(t)},r=function(t){var n=At().locationScore(e).rectangles(t);return t.forEach(function(t,e){St(t).forEach(function(t,r){n=n(t,e)})}),n.rectangles()};return r.bounds=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],
r):t},r},Tt=function(t){return t[zt(t)]},zt=function(t){return Math.floor(Math.random()*t.length)},Dt=function(){var t=1e3,n=1,e=void 0,r=function(t){switch(t.location){case"bottom-right":return 0;case"middle-right":case"bottom-center":return t.width*t.height/8}return t.width*t.height/4},i=function(t){return e?t.width*t.height-xt(t,e):0},o=function(t,n,e){return wt(e,n)+i(t)+r(t)},u=function(e){for(var r=t,i=function(t,n){return Math.exp((n-t)/r)>Math.random()},u=At().locationScore(o).winningScore(i).rectangles(e);r>0;){var a=zt(e);u=u(Tt(St(e[a])),a),r-=n}return u.rectangles()};return u.temperature=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],u):t},u.cooling=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],u):n},u.bounds=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],u):e},u},Pt=function(t,e){return t[n.scan(t,e)]},Ot=function(t){t=t||function(t){return t};var n=function(n){n=t(n);for(;;){if("break"===function(){var t=n.filter(function(t){return!t.hidden}),e=t.map(function(n,e){return[n,wt(t,e)]}),r=Pt(e,function(t,n){return n[1]-t[1]});if(!(r[1]>0))return"break";r[0].hidden=!0}())break}return n};return _(n,t),n},Mt=function(){var t=[0,0],n=function(n){return n.map(function(n,e){var r=n.x,i=n.y;return r+n.width>t[0]&&(r-=n.width),i+n.height>t[1]&&(i-=n.height),{height:n.height,width:n.width,x:r,y:i}})};return n.bounds=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],n):t},n},It=function(t){return"function"==typeof t?t:function(){return t}},Ct=function(t,n){switch(t){case"left":return n/2;case"right":return-n/2;default:return 0}},Vt=function(t){var n=Object.assign({},t),e=function(){};return Object.keys(n).forEach(function(t){e[t]=function(){return arguments.length?(n[t]=arguments.length<=0?void 0:arguments[0],e):n[t]}}),e},Lt=function(){var t=function(){return 0},n=function(t){return t.x},r=function(t){return t.y},i="center",o=function(){return 5},u="vertical",a=Vt({decorate:function(){},defined:function(e,i){return y(t,n,r)(e,i)},xScale:e.scaleIdentity(),yScale:e.scaleIdentity()});return a.values=function(e,c){var l=o(e,c),f=Ct(i,l),h=a.xScale(),s=a.yScale();if("vertical"===u){var d=s(r(e,c),c),g=s(t(e,c),c),v=h(n(e,c),c)+f;return{d:e,x:v,y:d,y0:g,width:l,height:d-g,origin:[v,d],baseOrigin:[v,g],transposedX:v,transposedY:d}}var m=h(r(e,c),c),p=h(t(e,c),c),y=s(n(e,c),c)+f;return{d:e,x:y,y:m,y0:p,width:l,height:m-p,origin:[m,y],baseOrigin:[p,y],transposedX:m,transposedY:y}},a.baseValue=function(){return arguments.length?(t=It(arguments.length<=0?void 0:arguments[0]),a):t},a.crossValue=function(){return arguments.length?(n=It(arguments.length<=0?void 0:arguments[0]),a):n},a.mainValue=function(){return arguments.length?(r=It(arguments.length<=0?void 0:arguments[0]),a):r},a.bandwidth=function(){return arguments.length?(o=It(arguments.length<=0?void 0:arguments[0]),a):o},a.align=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],a):i},a.orient=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],a):u},a},Rt={red:"#c60",green:"#6c0",black:"#000",gray:"#ddd",darkGray:"#999"},Bt=function(){var t=Lt(),n=c.line().x(function(n,e){return t.values(n,e).transposedX}).y(function(n,e){return t.values(n,e).transposedY}),e=vt("path","line"),r=function(r){r.selection&&e.transition(r),n.defined(t.defined()),r.each(function(r,i,o){var u=e(a.select(o[i]),[r]);u.enter().attr("fill","none").attr("stroke",Rt.black),u.attr("d",n),t.decorate()(u,r,i)})};return _(r,t,E("baseValue","bandwidth","align")),S(r,e,"key"),S(r,n,"curve"),r},jt=function(){var t=Lt(),n=c.line().x(function(n,e){return t.values(n,e).transposedX}).y(function(n,e){return t.values(n,e).transposedY}),e=function(e){var r=n.context();r.beginPath(),n.defined(t.defined())(e),r.strokeStyle=Rt.black,r.fillStyle="transparent",t.decorate()(r,e),r.fill(),r.stroke(),r.closePath()};return _(e,t,E("baseValue","bandwidth","align")),S(e,n,"curve","context"),e},Nt=function(){var t=c.symbol(),n=Lt(),e=vt("g","point"),r=function(t){return"translate("+t[0]+", "+t[1]+")"},i=function(i){i.selection&&e.transition(i),i.each(function(i,o,u){var c=i.filter(n.defined()),l=e(a.select(u[o]),c);l.enter().attr("transform",function(t,e){return r(n.values(t,e).origin)}).attr("fill",Rt.gray).attr("stroke",Rt.black).append("path"),l.attr("transform",function(t,e){return r(n.values(t,e).origin)}).select("path").attr("d",t),n.decorate()(l,i,o)})};return _(i,n,E("baseValue","bandwidth","align")),S(i,e,"key"),S(i,t,"type","size"),i},qt=function(){var t=c.symbol(),n=Lt(),e=function(e){var r=e.filter(n.defined()),i=t.context();r.forEach(function(e,r){i.save();var o=n.values(e,r);i.translate(o.origin[0],o.origin[1]),i.beginPath(),t(e,r),i.strokeStyle=Rt.black,i.fillStyle=Rt.gray,n.decorate()(i,e,r),i.fill(),i.stroke(),i.closePath(),i.restore()})};return _(e,n,E("baseValue","bandwidth","align")),S(e,t,"size","type","context"),e},Qt=function(){var t=ft().x(0).y(0),n=Lt(),e=vt("g","bar"),r=function(t){return"vertical"===n.orient()?t.height:t.width},i=function(t){return"vertical"===n.orient()?t.width:t.height},o=function(t){return"translate("+t[0]+", "+t[1]+")"},u=function(u){u.selection&&e.transition(u),u.each(function(u,c,l){var f=n.orient();if("vertical"!==f&&"horizontal"!==f)throw new Error("The bar series does not support an orientation of "+f);var h=u.filter(n.defined()),s=h.map(n.values);t.width(0).height(0),"vertical"===n.orient()?(t.verticalAlign("top"),t.horizontalAlign("center")):(t.horizontalAlign("right"),t.verticalAlign("center"));var d=e(a.select(l[c]),h);d.enter().attr("transform",function(t,n){return o(s[n].baseOrigin)}).attr("class","bar "+n.orient()).attr("fill",Rt.darkGray).append("path").attr("d",function(n,e){return i(t)(s[e].width),t([n])}),d.attr("transform",function(t,n){return o(s[n].origin)}).select("path").attr("d",function(n,e){return i(t)(s[e].width),r(t)(-s[e].height),t([n])}),n.decorate()(d,h,c)})};return _(u,n),S(u,e,"key"),u},Ft=function(){var t=Lt(),n=ft().x(0).y(0),e=function(n){return"vertical"===t.orient()?n.height:n.width},r=function(n){return"vertical"===t.orient()?n.width:n.height},i=function(i){var o=n.context(),u=i.filter(t.defined()),a=u.map(t.values);"vertical"===t.orient()?(n.verticalAlign("top"),n.horizontalAlign("center")):(n.horizontalAlign("right"),n.verticalAlign("center")),a.forEach(function(i,u){o.save(),o.beginPath(),o.translate(i.origin[0],i.origin[1]),e(n)(-i.height),r(n)(i.width),n([i]),o.fillStyle=Rt.darkGray,o.strokeStyle="transparent",t.decorate()(o,i.d,u),o.fill(),o.stroke(),o.closePath(),o.restore()})};return _(i,t),S(i,n,"context"),i},Ut=function(){var t=function(t){return t.high},n=function(t){return t.low},r=function(t){return t.cross},i="vertical",o="center",u=function(){return 5},a=Vt({decorate:function(){},defined:function(e,i){return y(n,t,r)(e,i)},xScale:e.scaleIdentity(),yScale:e.scaleIdentity()});return a.values=function(e,c){var l=u(e,c),f=Ct(o,l),h=a.xScale(),s=a.yScale();if("vertical"===i){var d=s(t(e,c));return{origin:[h(r(e,c))+f,d],high:0,low:s(n(e,c))-d,width:l}}var g=h(n(e,c));return{origin:[g,s(r(e,c))+f],high:h(t(e,c))-g,low:0,width:l}},a.orient=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],a):i},a.lowValue=function(){return arguments.length?(n=It(arguments.length<=0?void 0:arguments[0]),a):n},a.highValue=function(){return arguments.length?(t=It(arguments.length<=0?void 0:arguments[0]),a):t},a.crossValue=function(){return arguments.length?(r=It(arguments.length<=0?void 0:arguments[0]),a):r},a.bandwidth=function(){return arguments.length?(u=It(arguments.length<=0?void 0:arguments[0]),a):u},a.align=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],a):o},a},Gt=function(){var t=Ut(),n=vt("g","error-bar"),e=dt().value(0),r=function(t){return function(n){return t.selection?n.transition(t):n}},i=function(t){return"translate("+t.origin[0]+", "+t.origin[1]+")"},o=function(o){o.selection&&n.transition(o);var u=r(o);o.each(function(r,o,c){var l=r.filter(t.defined()),f=l.map(t.values),h=n(a.select(c[o]),l);h.enter().attr("stroke",Rt.black).attr("fill",Rt.gray).attr("transform",function(n,e){return i(t.values(n,e))+" scale(1e-6, 1)"}).append("path"),e.orient(t.orient()),h.each(function(t,n,r){var o=f[n];e.high(o.high).low(o.low).width(o.width),u(a.select(r[n])).attr("transform",i(o)+" scale(1)").select("path").attr("d",e([t]))}),t.decorate()(h,r,o)})};return _(o,t),S(o,n,"key"),o},Ht=function(){var t=Ut(),n=dt().value(0),e=function(e){var r=e.filter(t.defined()),i=n.context();n.orient(t.orient()),r.forEach(function(e,r){i.save();var o=t.values(e,r);i.translate(o.origin[0],o.origin[1]),i.beginPath(),n.high(o.high).width(o.width).low(o.low)([e]),i.strokeStyle=Rt.black,i.fillStyle=Rt.gray,t.decorate()(i,e,r),i.fill(),i.stroke(),i.closePath(),i.restore()})};return _(e,t),S(e,n,"context"),e},Yt=function(){var t=Lt(),n=c.area(),e=vt("path","area"),r=function(r){r.selection&&e.transition(r),n.defined(t.defined()),r.each(function(r,i,o){var u=r.map(t.values);n.x(function(t,n){return u[n].transposedX}).y(function(t,n){return u[n].transposedY});var c="vertical"===t.orient()?"y":"x";n[c+"0"](function(t,n){return u[n].y0}),n[c+"1"](function(t,n){return u[n].y});var l=e(a.select(o[i]),[r]);l.enter().attr("fill",Rt.gray),l.attr("d",n),t.decorate()(l,r,i)})};return _(r,t,E("bandwidth","align")),S(r,e,"key"),S(r,n,"curve"),r},Wt=function(){var t=Lt(),n=c.area(),e=function(e){var r=n.context();n.defined(t.defined());var i=e.map(t.values);n.x(function(t,n){return i[n].transposedX}).y(function(t,n){return i[n].transposedY});var o="vertical"===t.orient()?"y":"x";n[o+"0"](function(t,n){return i[n].y0}),n[o+"1"](function(t,n){return i[n].y}),r.beginPath(),n(e),r.fillStyle=Rt.gray,r.strokeStyle="transparent",t.decorate()(r,e),r.fill(),r.stroke(),r.closePath()};return _(e,t,E("bandwidth","align")),S(e,n,"curve","context"),e},Xt=function(){var t=void 0,n=function(t){return t.date},r=function(t){return t.open},i=function(t){return t.high},o=function(t){return t.low},u=function(t){return t.close},a=function(){return 5},c="center",l=function(e,r){return t.xScale()(n(e,r))};return t=Vt({decorate:function(){},defined:function(t,e){return y(n,r,o,i,u)(t,e)},xScale:e.scaleIdentity(),yScale:e.scaleIdentity()}),t.values=function(n,e){var f=u(n,e),h=r(n,e),s=a(n,e),d=Ct(c,s),g="";return f>h?g="up":f<h&&(g="down"),{cross:l(n,e)+d,open:t.yScale()(h),high:t.yScale()(i(n,e)),low:t.yScale()(o(n,e)),close:t.yScale()(f),width:s,direction:g}},t.crossValue=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],t):n},t.openValue=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],t):r},t.highValue=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],t):i},t.lowValue=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],t):o},t.yValue=t.closeValue=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],t):u},t.bandwidth=function(){return arguments.length?(a=It(arguments.length<=0?void 0:arguments[0]),t):a},t.align=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],t):c},t},Kt=function(t,n){var e=Xt(),r=vt("g",n),i=function(t){return"translate("+t.cross+", "+t.high+")"},o=function(t){return function(n){return t.selection?n.transition(t):n}},u=function(u){u.selection&&r.transition(u);var c=o(u);u.each(function(o,u,l){var f=o.filter(e.defined()),h=r(a.select(l[u]),f);h.enter().attr("transform",function(t,n){return i(e.values(t,n))+" scale(1e-6, 1)"}).append("path"),h.each(function(r,o,u){var l=e.values(r,o),f="up"===l.direction?Rt.green:Rt.red,h=c(a.select(u[o])).attr("class",n+" "+l.direction).attr("stroke",f).attr("fill",f).attr("transform",function(){return i(l)+" scale(1)"});t.x(0).width(l.width).open(function(){return l.open-l.high}).high(0).low(function(){return l.low-l.high}).close(function(){return l.close-l.high}),h.select("path").attr("d",t([r]))}),e.decorate()(h,o,u)})};return S(u,r,"key"),_(u,e),u},Jt=function(){return Kt(ht(),"candlestick")},Zt=function(t){var n=Xt(),e=function(e){var r=e.filter(n.defined()),i=t.context();r.forEach(function(e,r){i.save();var o=n.values(e,r);i.translate(o.cross,o.high),i.beginPath(),t.x(0).open(function(){return o.open-o.high}).width(o.width).high(0).low(function(){return o.low-o.high}).close(function(){return o.close-o.high})([e]);var u="up"===o.direction?Rt.green:Rt.red;i.strokeStyle=u,i.fillStyle=u,n.decorate()(i,e,r),i.fill(),i.stroke(),i.closePath(),i.restore()})};return S(e,t,"context"),_(e,n),e},$t=function(){return Zt(ht())},tn=function(){var t=function(t){return t.upperQuartile},n=function(t){return t.lowerQuartile},r=function(t){return t.high},i=function(t){return t.low},o=function(t){return t.value},u=function(t){return t.median},a="vertical",c="center",l=function(){return 5},f=Vt({decorate:function(){},defined:function(e,a){return y(i,r,n,t,o,u)(e,a)},xScale:e.scaleIdentity(),yScale:e.scaleIdentity()});return f.values=function(e,h){var s=l(e,h),d=Ct(c,s),g=f.xScale(),v=f.yScale();if("vertical"===a){var m=v(r(e,h));return{origin:[g(o(e,h))+d,m],high:0,upperQuartile:v(t(e,h))-m,median:v(u(e,h))-m,lowerQuartile:v(n(e,h))-m,low:v(i(e,h))-m,width:s}}var p=g(i(e,h));return{origin:[p,v(o(e,h))+d],high:g(r(e,h))-p,upperQuartile:g(t(e,h))-p,median:g(u(e,h))-p,lowerQuartile:g(n(e,h))-p,low:0,width:s}},f.orient=function(){return arguments.length?(a=arguments.length<=0?void 0:arguments[0],f):a},f.lowerQuartileValue=function(){return arguments.length?(n=It(arguments.length<=0?void 0:arguments[0]),f):n},f.upperQuartileValue=function(){return arguments.length?(t=It(arguments.length<=0?void 0:arguments[0]),f):t},f.lowValue=function(){return arguments.length?(i=It(arguments.length<=0?void 0:arguments[0]),f):i},f.highValue=function(){return arguments.length?(r=It(arguments.length<=0?void 0:arguments[0]),f):r},f.crossValue=function(){return arguments.length?(o=It(arguments.length<=0?void 0:arguments[0]),f):o},f.medianValue=function(){return arguments.length?(u=It(arguments.length<=0?void 0:arguments[0]),f):u},f.bandwidth=function(){return arguments.length?(l=It(arguments.length<=0?void 0:arguments[0]),f):l},f.align=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],f):c},f},nn=function(){var t=tn(),n=vt("g","box-plot"),e=st().value(0),r=function(t){return function(n){return t.selection?n.transition(t):n}},i=function(t){return"translate("+t.origin[0]+", "+t.origin[1]+")"},o=function(o){o.selection&&n.transition(o);var u=r(o);o.each(function(r,o,c){var l=r.filter(t.defined()),f=n(a.select(c[o]),l);f.enter().attr("stroke",Rt.black).attr("fill",Rt.gray).attr("transform",function(n,e){return i(t.values(n,e))+" scale(1e-6, 1)"}).append("path"),e.orient(t.orient()),f.each(function(n,r,o){var c=t.values(n,r);e.median(c.median).upperQuartile(c.upperQuartile).lowerQuartile(c.lowerQuartile).width(c.width).high(c.high).low(c.low),u(a.select(o[r])).attr("transform",i(c)).select("path").attr("d",e([n]))}),t.decorate()(f,r,o)})};return _(o,t),S(o,n,"key"),S(o,e,"cap"),o},en=function(){var t=tn(),n=st().value(0),e=function(e){var r=e.filter(t.defined()),i=n.context();n.orient(t.orient()),r.forEach(function(e,r){i.save();var o=t.values(e,r);i.translate(o.origin[0],o.origin[1]),i.beginPath(),n.median(o.median).upperQuartile(o.upperQuartile).lowerQuartile(o.lowerQuartile).high(o.high).width(o.width).low(o.low)([e]),i.fillStyle=Rt.gray,i.strokeStyle=Rt.black,t.decorate()(i,e,r),i.fill(),i.stroke(),i.closePath(),i.restore()})};return _(e,t),S(e,n,"cap","context"),e},rn=function(){return Kt(lt(),"ohlc")},on=function(){return Zt(lt())},un=function(){var t=[],n=function(t){return t},r=function(t,n){return n},i=Vt({decorate:function(){},xScale:e.scaleIdentity(),yScale:e.scaleIdentity()});return i.mapping=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},i.key=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],i):r},i.series=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],i):t},i},an=function(){var t=un(),n=vt("g"),e=vt("g","multi"),r=function(r){r.selection&&(e.transition(r),n.transition(r));var i=t.mapping(),o=t.series(),u=t.xScale(),c=t.yScale();r.each(function(r,l,f){var h=e(a.select(f[l]),o);h.each(function(t,e,l){t.xScale(u).yScale(c);var f=i(r,e,o);n(a.select(l[e]),[f]).call(t)}),(h.selection?h.selection():h).order(),t.decorate()(h,r,l)})};return _(r,t),S(r,e,"key"),r},cn=function(){var t=null,n=un(),e=function(e){var r=n.mapping(),i=n.series(),o=n.xScale(),u=n.yScale();i.forEach(function(a,c){var l=r(e,c,i);a.context(t).xScale(o).yScale(u);var f=void 0;a.decorate?(f=a.decorate(),a.decorate(function(t,r,i){n.decorate()(t,e,c),f(t,r,i)})):n.decorate()(t,e,c),a(l),f&&a.decorate(f)})};return e.context=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],e):t},_(e,n),e},ln=function(t){var r=function(){return 50},i="center",o=e.scaleBand(),u=Vt({decorate:function(){},xScale:e.scaleLinear(),yScale:e.scaleLinear()});return u.offsetScaleForDatum=function(t,e,u){var a=r(e,u),c=Ct(i,a),l=a/2;return o.domain(n.range(0,t.length)).range([-l+c,l+c])},u.bandwidth=function(){return arguments.length?(r=It(arguments.length<=0?void 0:arguments[0]),u):r},u.align=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],u):i},_(u,o,z({paddingInner:"paddingOuter"})),u},fn=function(t){var n=ln(),e=vt("g","grouped"),r=function(r){r.selection&&e.transition(r),r.each(function(r,i,o){var u=e(a.select(o[i]),r);u.enter().append("g"),u.select("g").each(function(e,i,o){var u=a.select(o[i]),c="horizontal"!==t.orient(),l=function(t,e){var o=n.offsetScaleForDatum(r,t,e);return(c?n.xScale():n.yScale())(t)+o(i)+o.bandwidth()/2};c?(t.xScale(l),t.yScale(n.yScale())):(t.yScale(l),t.xScale(n.xScale())),t.bandwidth&&t.bandwidth(function(t,e){return n.offsetScaleForDatum(r,t,e).bandwidth()}),t.decorate(function(t,e){return n.decorate()(t,e,i)}),u.call(t)})})};return _(r,t,E("decorate","xScale","yScale")),_(r,n,E("offsetScaleForDatum")),r},hn=function(t){var n=ln(),e=function(e){e.forEach(function(r,i){var o="horizontal"!==t.orient(),u=function(t,r){var u=n.offsetScaleForDatum(e,t,r);return(o?n.xScale():n.yScale())(t)+u(i)+u.bandwidth()/2};o?(t.xScale(u),t.yScale(n.yScale())):(t.yScale(u),t.xScale(n.xScale())),t.bandwidth&&t.bandwidth(function(t,r){return n.offsetScaleForDatum(e,t,r).bandwidth()}),t.decorate(function(t,e){return n.decorate()(t,e,i)}),t(r)})};return _(e,t,E("decorate","xScale","yScale")),_(e,n,E("offsetScaleForDatum")),e},sn=function(){var t="vertical",n=Bt(),e=an(),r=function(r){return r.each(function(r,i,o){"vertical"===t?e.series(r[0].map(function(t){return n})).mapping(function(t,n){return t.map(function(t){return t[n]})}):e.series(r.map(function(t){return n})).mapping(function(t,n){return t[n]}),a.select(o[i]).call(e)})};return r.series=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],r):n},r.orient=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],r):t},_(r,e,E("series","mapping")),r},dn=function(){var t="vertical",n=jt(),e=cn(),r=function(r){"vertical"===t?e.series(r[0].map(function(t){return n})).mapping(function(t,n){return t.map(function(t){return t[n]})}):e.series(r.map(function(t){return n})).mapping(function(t,n){return t[n]}),e(r)};return r.series=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],r):n},r.orient=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],r):t},_(r,e,E("series","mapping")),r},gn=function(t){return t.sort(n.ascending).filter(function(t,n,e){return-1===e.indexOf(t,n+1)})},vn=function(t){var e=.75,r=function(t){if(t.length<=1)return 10;t=gn(t);var r=n.pairs(t).map(function(t){return Math.abs(t[0]-t[1])}),i=n.min(r);return e*i},i=function(n,e,i){if(n.bandwidth)return n.bandwidth();var o,u=Array.isArray(e)?(o=[]).concat.apply(o,Q(e)):e,a=u.filter(t.defined()).map(i()).map(n);return r(a)},o=function(n){var e=function(n){if(t.xBandwidth&&t.yBandwidth)t.xBandwidth(i(t.xScale(),n,t.xValue)),t.yBandwidth(i(t.yScale(),n,t.yValue));else{var e=t.orient&&"horizontal"===t.orient()?t.yScale():t.xScale();t.bandwidth(i(e,n,t.crossValue))}};n instanceof a.selection?n.each(function(n,r,i){e(n),t(a.select(i[r]))}):(e(n),t(n))};return _(o,t),o.widthFraction=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],o):e},o},mn=function(){var t=function(t){return t.x},r=function(t){return t.y},i=function(t){return t.color},o=function(){return 5},u=function(){return 5},a=e.interpolateViridis,c=Vt({decorate:function(){},defined:function(n,e){return y(t,r,i)(n,e)},xScale:e.scaleIdentity(),yScale:e.scaleIdentity()});return c.pathGenerator=ft().x(0).y(0),c.colorScale=function(t){var r=t.map(i);return e.scaleLinear().domain([n.min(r),n.max(r)])},c.values=function(n,e){return{x:c.xScale()(t(n,e)),y:c.yScale()(r(n,e)),colorValue:i(n,e),width:u(n,e),height:o(n,e)}},c.xValue=function(){return arguments.length?(t=It(arguments.length<=0?void 0:arguments[0]),c):t},c.yValue=function(){return arguments.length?(r=It(arguments.length<=0?void 0:arguments[0]),c):r},c.colorValue=function(){return arguments.length?(i=It(arguments.length<=0?void 0:arguments[0]),c):i},c.colorInterpolate=function(){return arguments.length?(a=arguments.length<=0?void 0:arguments[0],c):a},c.xBandwidth=function(){return arguments.length?(u=It(arguments.length<=0?void 0:arguments[0]),c):u},c.yBandwidth=function(){return arguments.length?(o=It(arguments.length<=0?void 0:arguments[0]),c):o},_(c,c.pathGenerator,z({horizontalAlign:"xAlign",verticalAlign:"yAlign"})),c},pn=function(){var t=mn(),n=vt("g","box"),e=function(t){return"translate("+t.x+", "+t.y+")"},r=function(r){r.each(function(r,i,o){var u=r.filter(t.defined()),c=t.colorValue(),l=t.colorInterpolate(),f=t.colorScale(u),h=n(a.select(o[i]),u);h.enter().append("path").attr("stroke","transparent"),h.attr("transform",function(n,r){return e(t.values(n,r))}).select("path").attr("d",function(n,e){return t.pathGenerator.width(t.values(n,e).width).height(t.values(n,e).height)([n])}).attr("fill",function(t,n){return l(f(c(t,n)))}),t.decorate()(h,r,i)})};return _(r,t),r},yn=function(){var t=mn(),n=function(n){var e=n.filter(t.defined()),r=(t.colorValue(),t.colorInterpolate()),i=t.colorScale(e),o=t.pathGenerator.context();e.forEach(function(n,e){o.save(),o.beginPath();var u=t.values(n,e);o.translate(u.x,u.y),o.fillStyle=r(i(u.colorValue)),o.strokeStyle="transparent",t.pathGenerator.height(u.height).width(u.width)([n]),t.decorate()(o,n,e),o.fill(),o.stroke(),o.closePath(),o.restore()})};return S(n,t.pathGenerator,"context"),_(n,t),n},xn=function(t){return"function"==typeof t?t:function(){return t}},wn=function(){var t=e.scaleIdentity(),n=e.scaleIdentity(),r="horizontal",i=function(t){return t.from},o=function(t){return t.to},u=function(){},c=vt("g","annotation-band"),l=ft().horizontalAlign("center").verticalAlign("center").x(0).y(0),f=function(e){if(e.selection&&c.transition(e),"horizontal"!==r&&"vertical"!==r)throw new Error("Invalid orientation");var f="horizontal"===r,h=f?function(t,n){return"translate("+t+", "+n+")"}:function(t,n){return"translate("+n+", "+t+")"},s=f?t:n,d=f?n:t,g=s.range(),v=g[1]-g[0],m=f?"height":"width",p=f?"width":"height",y=function(){return h((g[1]+g[0])/2,(d(o.apply(void 0,arguments))+d(i.apply(void 0,arguments)))/2)};l[p](v),l[m](function(){return d(o.apply(void 0,arguments))-d(i.apply(void 0,arguments))}),e.each(function(t,n,e){var i=c(a.select(e[n]),t);i.enter().attr("transform",y).append("path").classed("band",!0),i.attr("class","annotation-band "+r).attr("transform",y).select("path").attr("d",function(t,n){return l([t],n)}),u(i,t,n)})};return f.xScale=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],f):t},f.yScale=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],f):n},f.orient=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],f):r},f.decorate=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],f):u},f.fromValue=function(){return arguments.length?(i=xn(arguments.length<=0?void 0:arguments[0]),f):i},f.toValue=function(){return arguments.length?(o=xn(arguments.length<=0?void 0:arguments[0]),f):o},f},bn=function(){var t=e.scaleIdentity(),n=e.scaleIdentity(),r="horizontal",i=function(t){return t.from},o=function(t){return t.to},u=function(){},a=ft().horizontalAlign("right").verticalAlign("top"),c=function(e){if("horizontal"!==r&&"vertical"!==r)throw new Error("Invalid orientation");var c=a.context(),l="horizontal"===r,f=l?t:n,h=l?n:t,s=f.range(),d=s[1]-s[0],g=l?"x":"y",v=l?"y":"x",m=l?"height":"width",p=l?"width":"height";e.forEach(function(t,n){c.save(),c.beginPath(),c.strokeStyle="transparent",a[v](h(i(t))),a[g](s[0]),a[p](d),a[m](h(o(t))-h(i(t))),u(c,t,n),a.context(c)([t],n),c.fill(),c.stroke(),c.closePath(),c.restore()})};return c.xScale=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],c):t},c.yScale=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],c):n},c.orient=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],c):r},c.decorate=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],c):u},c.fromValue=function(){return arguments.length?(i=xn(arguments.length<=0?void 0:arguments[0]),c):i},c.toValue=function(){return arguments.length?(o=xn(arguments.length<=0?void 0:arguments[0]),c):o},S(c,a,"context"),c},Sn=function(){var t=e.scaleIdentity(),n=e.scaleIdentity(),r=function(t){return t},i=r,o=function(){},u="horizontal",c=vt("g","annotation-line"),l=function(e){if(e.selection&&c.transition(e),"horizontal"!==u&&"vertical"!==u)throw new Error("Invalid orientation");var l="horizontal"===u,f=l?function(t,n){return"translate("+t+", "+n+")"}:function(t,n){return"translate("+n+", "+t+")"},h=l?"x2":"y2",s=l?t:n,d=l?n:t,g=l?"left-handle":"bottom-handle",v=l?"right-handle":"top-handle",m=l?"9":"0",p=l?"0":"9",y=l?"0.32em":"0.71em",x=l?"start":"middle",w=s.range(),b=function(){return f(w[0],d(r.apply(void 0,arguments)))},S=w[1]-w[0];e.each(function(t,n,e){var r=c(a.select(e[n]),t),l=r.enter().attr("transform",b).style("stroke","#bbb");l.append("line").attr(h,S),l.append("g").classed(g,!0).style("stroke","none"),l.append("g").classed(v,!0).style("stroke","none").attr("transform",f(S,0)).append("text").attr("text-anchor",x).attr("x",m).attr("y",p).attr("dy",y),r.attr("class","annotation-line "+u),r.attr("transform",b),r.select("line").attr(h,S),r.select("g."+v).attr("transform",f(S,0)),r.select("text").text(i),o(r,t,n)})};return l.xScale=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],l):t},l.yScale=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],l):n},l.value=function(){return arguments.length?(r=xn(arguments.length<=0?void 0:arguments[0]),l):r},l.label=function(){return arguments.length?(i=xn(arguments.length<=0?void 0:arguments[0]),l):i},l.decorate=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],l):o},l.orient=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],l):u},l},kn=function(){var t=function(t){return t.x},n=function(t){return t.y},r=e.scaleIdentity(),i=e.scaleIdentity(),o=function(){},u=vt("g","annotation-crosshair"),c=Nt(),l=Sn(),f=Sn().orient("vertical"),h=e.scaleIdentity(),s=e.scaleIdentity(),d=an().series([l,f,c]).xScale(h).yScale(s).mapping(function(t){return[t]}),g=function(e){e.selection&&u.transition(e),e.each(function(e,g,v){var m=u(a.select(v[g]),e);m.enter().style("pointer-events","none"),h.range(r.range()),s.range(i.range()),c.crossValue(t).mainValue(n),l.value(n),f.value(t),m.call(d),o(m,e,g)})};g.x=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],g):t},g.y=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],g):n},g.xScale=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],g):r},g.yScale=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],g):i},g.decorate=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],g):o};var v=T("label");return _(g,l,v,P("y")),_(g,f,v,P("x")),g},_n=function(){var t=e.scaleIdentity(),n=e.scaleIdentity(),r=function(t){return t},i=r,o=function(){},u="horizontal",a=c.line(),l=function(e){if("horizontal"!==u&&"vertical"!==u)throw new Error("Invalid orientation");var c="horizontal"===u,l=a.context(),f=c?t:n,h=c?n:t,s=f.domain(),d=c?9:0,g=c?0:9,v=c?"left":"center",m=c?"middle":"hanging";e.forEach(function(t,n){l.save(),l.beginPath(),l.strokeStyle="#bbb",l.fillStyle="#000",l.textAlign=v,l.textBaseline=m,o(l,t,n),a.context(l)(s.map(function(n){var e=[f(n),h(r(t))];return c?e:e.reverse()}));var e=c?f(s[1]):h(r(t)),u=c?h(r(t)):f(s[1]);l.fillText(i(t),e+d,u+g),l.fill(),l.stroke(),l.closePath(),l.restore()})};return l.xScale=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],l):t},l.yScale=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],l):n},l.value=function(){return arguments.length?(r=xn(arguments.length<=0?void 0:arguments[0]),l):r},l.label=function(){return arguments.length?(i=xn(arguments.length<=0?void 0:arguments[0]),l):i},l.decorate=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],l):o},l.orient=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],l):u},S(l,a,"context"),l},An=function(){var t=function(t){return t.x},n=function(t){return t.y},r=e.scaleIdentity(),i=e.scaleIdentity(),o=qt(),u=_n(),a=_n().orient("vertical"),c=e.scaleIdentity(),l=e.scaleIdentity(),f=cn().series([u,a,o]).xScale(c).yScale(l).mapping(function(t){return[t]}),h=function(e){e.forEach(function(e){c.range(r.range()),l.range(i.range()),o.crossValue(t).mainValue(n),u.value(n),a.value(t),f(e)})};h.x=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],h):t},h.y=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],h):n},h.xScale=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],h):r},h.yScale=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],h):i};var s=T("label","decorate");return _(h,u,s,P("y")),_(h,a,s,P("x")),S(h,o,"decorate"),S(h,f,"context"),h},En=function(){var t=e.scaleIdentity(),n=[10],r=null,i=function(){var e;return null!=r?r:t.ticks?(e=t).ticks.apply(e,Q(n)):t.domain()};return i.scale=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],i):t},i.ticks=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return n=e,i},i.tickArguments=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},i.tickValues=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],i):r},i},Tn=function(t){return t},zn=function(){var t=function(){},n=function(){},e=En(),r=En(),i=vt("line","gridline-y").key(Tn),o=vt("line","gridline-x").key(Tn),u=function(u){u.selection&&(i.transition(u),o.transition(u)),u.each(function(u,c,l){var f=l[c],h=a.select(l[c]),s=e.scale(),d=r.scale(),g=f.__x_scale__||s;f.__x_scale__=s.copy();var v=e(),m=i(h,v);m.enter().attr("x1",g).attr("x2",g).attr("y1",d.range()[0]).attr("y2",d.range()[1]),m.attr("x1",s).attr("x2",s).attr("y1",d.range()[0]).attr("y2",d.range()[1]).attr("stroke","#bbb"),m.exit().attr("x1",s).attr("x2",s),t(m,v,c);var p=f.__y_scale__||d;f.__y_scale__=d.copy();var y=r(),x=o(h,y);x.enter().attr("y1",p).attr("y2",p).attr("x1",s.range()[0]).attr("x2",s.range()[1]),x.attr("y1",d).attr("y2",d).attr("x1",s.range()[0]).attr("x2",s.range()[1]).attr("stroke","#bbb"),
x.exit().attr("y1",d).attr("y2",d),n(x,y,c)})};return u.yDecorate=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],u):n},u.xDecorate=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],u):t},_(u,i,z({key:"xKey"})),_(u,o,z({key:"yKey"})),_(u,e,P("x")),_(u,r,P("y")),u},Dn=function(){var t=function(){},n=function(){},e=En(),r=En(),i=c.line(),o=function(){var o=i.context(),u=e.scale(),a=r.scale();e().forEach(function(n,e){o.save(),o.beginPath(),o.strokeStyle="#bbb",o.fillStyle="transparent",t(o,n,e),i.context(o)(a.domain().map(function(t){return[u(n),a(t)]})),o.fill(),o.stroke(),o.closePath(),o.restore()}),r().forEach(function(t,e){o.save(),o.beginPath(),o.strokeStyle="#bbb",o.fillStyle="transparent",n(o,t,e),i.context(o)(u.domain().map(function(n){return[u(n),a(t)]})),o.fill(),o.stroke(),o.closePath(),o.restore()})};return o.yDecorate=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],o):n},o.xDecorate=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],o):t},_(o,e,P("x")),_(o,r,P("y")),S(o,i,"context"),o},Pn=function(t){return t},On=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[10],i=null,o=function(){},u=null,l=6,f=6,h=3,s=c.line(),d=vt("g","tick").key(Pn),g=vt("path","domain"),v=function(){return{offset:[0,f+h]}},m=function(){return{path:[[0,0],[0,f]]}},p=e.labelOffset||v,y=e.tickPath||m,x=function(t,n){var e=0;return t.bandwidth&&(e=t.bandwidth()/2,t.round()&&(e=Math.round(e))),function(r){return n(t(r)+e,0)}},w=function(t,n){return S()?"translate("+n+", "+t+")":"translate("+t+", "+n+")"},b=function(t){return S()?t.map(function(t){return[t[1],t[0]]}):t},S=function(){return"left"===t||"right"===t},k=function(t,e,r){return n[t]?n[t].apply(n,e):r},_=function(e){e.selection&&(d.transition(e),g.transition(e)),e.each(function(e,c,f){var h=f[c],v=a.select(h);h.__scale__||v.attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor","right"===t?"start":"left"===t?"end":"middle");var m=h.__scale__||n;h.__scale__=n.copy();var _=null==i?k("ticks",r,n.domain()):i,A=null==u?k("tickFormat",r,Pn):u,E="bottom"===t||"right"===t?1:-1,T=function(t){var n=N(t,2),e=n[0],r=n[1];return[e,E*r]},z=n.range(),D=b([[z[0],E*l],[z[0],0],[z[1],0],[z[1],E*l]]);g(v,[e]).attr("d",s(D)).attr("stroke","#000");var P=d(v,_),O=_.map(function(t,n){return p(t,n,_)}),M=_.map(function(t,n){return y(t,n,_)});P.enter().attr("transform",x(m,w)).append("path").attr("stroke","#000"),P.enter().append("text").attr("transform",function(t,n){return w.apply(void 0,Q(T(O[n].offset)))}).attr("fill","#000"),P.exit().attr("transform",x(n,w)),P.select("path").attr("visibility",function(t,n){return M[n].hidden&&"hidden"}).attr("d",function(t,n){return s(b(M[n].path.map(T)))}),P.select("text").attr("visibility",function(t,n){return O[n].hidden&&"hidden"}).attr("transform",function(t,n){return w.apply(void 0,Q(T(O[n].offset)))}).attr("dy",function(){var n="0em";return S()?n="0.32em":"bottom"===t&&(n="0.71em"),n}).text(A),P.attr("transform",x(n,w)),o(P,e,c)})};return _.tickFormat=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],_):u},_.tickSize=function(){return arguments.length?(f=l=Number(arguments.length<=0?void 0:arguments[0]),_):f},_.tickSizeInner=function(){return arguments.length?(f=Number(arguments.length<=0?void 0:arguments[0]),_):f},_.tickSizeOuter=function(){return arguments.length?(l=Number(arguments.length<=0?void 0:arguments[0]),_):l},_.tickPadding=function(){return arguments.length?(h=arguments.length<=0?void 0:arguments[0],_):h},_.decorate=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],_):o},_.scale=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],_):n},_.ticks=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return r=[].concat(n),_},_.tickArguments=function(){return arguments.length?(r=null==(arguments.length<=0?void 0:arguments[0])?[]:[].concat(Q(arguments.length<=0?void 0:arguments[0])),_):r.slice()},_.tickValues=function(){return arguments.length?(i=null==(arguments.length<=0?void 0:arguments[0])?[]:[].concat(Q(arguments.length<=0?void 0:arguments[0])),_):i.slice()},_.orient=function(){return t},_},Mn=function(t,n){var e=!1,r=function(t,r,o){var u=0,a=i.tickSizeInner()+i.tickPadding(),c=!1;if(e){var l=n(t),f=r<o.length-1?n(o[r+1]):n.range()[1];u=(f-l)/2,a=i.tickPadding(),c=r===o.length-1&&l===f}return{offset:[u,a],hidden:c}},i=On(t,n,{labelOffset:r}),o=function(t){return i(t)};return o.tickCenterLabel=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],o):e},_(o,i),o},In=function(t){return Mn("top",t)},Cn=function(t){return Mn("bottom",t)},Vn=function(t){return Mn("left",t)},Ln=function(t){return Mn("right",t)},Rn=function(t,n){var e=null,r=function(t,e,r){if(n.step)return n.step();var i=n(t);return e<r.length-1?n(r[e+1])/i:2*(n.range()[1]-i)},i=function(t,n,i){var o=0;return o=e?e(t,n):r(t,n,i)/2,{path:[[o,0],[o,u.tickSizeInner()]],hidden:n===i.length-1}},o=function(){return{offset:[0,u.tickPadding()]}},u=On(t,n,{labelOffset:o,tickPath:i}),a=function(t){u(t)};return a.tickOffset=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],a):e},_(a,u),a},Bn=function(t){return Rn("top",t)},jn=function(t){return Rn("bottom",t)},Nn=function(t){return Rn("left",t)},qn=function(t){return Rn("right",t)},Qn=function(t){return function(n){var e=t.ticks?t.ticks():t.domain(),r=n.append("text"),i=e.map(function(t){return r.text(t).node().getBBox()}),o=Math.max.apply(Math,Q(i.map(function(t){return t.height}))),u=Math.max.apply(Math,Q(i.map(function(t){return t.width})));return r.remove(),{maxHeight:o,maxWidth:u,labelCount:e.length}}},Fn=function(t){var n="auto",e=function(){},r=function(){return"left"===t.orient()||"right"===t.orient()},i=function(){return"top"===t.orient()||"left"===t.orient()?-1:1},o=function(){switch(t.orient()){case"top":case"right":return"start";default:return"end"}},u=function(e){var u=Qn(t.scale())(e),a=u.maxHeight,c=u.maxWidth,l=u.labelCount,f=l*c,h=void 0;if("auto"===n){var s=t.scale().range()[1];h=s<f?90*Math.min(1,(f/s-.8)/2):0}else h=n;return{rotate:r()?Math.floor(i()*(90-h)):Math.floor(-h),maxHeight:a,maxWidth:c,anchor:h?o():"middle"}},a=function(t){var n=u(t),e=n.rotate,o=n.maxHeight,a=n.anchor,c=t.select("text"),l=c.attr("transform"),f=i()*Math.floor(o/2),h=r()?"translate("+f+", 0)":"translate(0, "+f+")";c.style("text-anchor",a).attr("transform",l+" "+h+" rotate("+e+" 0 0)")},c=function(n){t(n)};return t.decorate(function(t){a(t),e(t)}),c.decorate=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],c):e},c.labelRotate=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],c):n},_(c,t,E("decorate")),c},Un=function(t){var n="auto",e=function(){},r=function(){return"left"===t.orient()||"right"===t.orient()},i=function(){return"top"===t.orient()||"left"===t.orient()?-1:1},o=function(e){var o=Qn(t.scale())(e),u=o.maxHeight,a=o.maxWidth,c=o.labelCount,l=t.scale().range()[1],f="auto"===n?Math.floor((r()?u:a)*c/l)+1:n,h=e.select("text"),s=h.attr("transform"),d=function(t){return r()?"translate("+t%f*a*i()+", 0)":"translate(0, "+t%f*u*i()+")"};h.attr("transform",function(t,n){return s+" "+d(n)})},u=function(n){return t(n)};return t.decorate(function(t){o(t),e(t)}),u.decorate=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],u):e},u.labelOffsetDepth=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],u):n},_(u,t,E("decorate")),u},Gn="__d3fc-elements__",Hn=function(t){return t[Gn]||{}},Yn=function(t,n){return void(t[Gn]=n)},Wn=function(t){return delete t[Gn]},Xn=function(t){return"D3FC-GROUP"===t.tagName?[t].concat(Q(t.querySelectorAll("d3fc-canvas, d3fc-group, d3fc-svg"))):[t]},Kn=function(t){var n=Hn(t),e=n.width,r=n.height,i=t.useDevicePixelRatio&&null!=global.devicePixelRatio?global.devicePixelRatio:1,o=t.clientWidth*i,u=t.clientHeight*i;Yn(t,{pixelRatio:i,width:o,height:u,resized:o!==e||u!==r})};if("function"!=typeof CustomEvent)throw new Error("d3fc-element depends on CustomEvent. Make sure that you load a polyfill in older browsers. See README.");var Jn=function(t){var n=Hn(t),e=new CustomEvent("measure",{detail:n});t.dispatchEvent(e)},Zn=function(t){var n=Hn(t),e=new CustomEvent("draw",{detail:n});t.dispatchEvent(e)},$n=function(t){var n=t.map(Xn).reduce(function(t,n){return t.concat(n)});n.forEach(Kn),n.forEach(Jn),n.forEach(Zn)},te=function(t){return Hn(t.ownerDocument).queue||[]},ne=function(t,n){var e=Hn(t.ownerDocument),r=e.requestId;null==r&&(r=requestAnimationFrame(function(){var n=te(t);$n(n),ee(t)})),Yn(t.ownerDocument,{queue:n,requestId:r})},ee=function(t){return Wn(t.ownerDocument)},re=function(t,n){var e=t;do{if(e.parentNode===n)return!0}while(e=e.parentNode);return!1},ie=function(t){var n=te(t);if(!(n.indexOf(t)>-1)&&!n.some(function(n){return re(t,n)})){var e=n.filter(function(n){return!re(n,t)});e.push(t),ne(t,e)}};if(Object.setPrototypeOf(x.prototype,HTMLElement.prototype),Object.setPrototypeOf(x,HTMLElement),"function"!=typeof HTMLElement)throw new Error("d3fc-element depends on Custom Elements (v1). Make sure that you load a polyfill in older browsers. See README.");var oe=function(t){null==t.__measureListener__&&(t.__measureListener__=function(n){return t.setMeasurements(n.detail)},t.addEventListener("measure",t.__measureListener__))},ue=function(t){null!=t.__measureListener__&&(t.removeEventListener("measure",t.__measureListener__),t.__measureListener__=null)},ae=function(t,n){return function(e){function r(){return L(this,r),j(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return B(r,e),R(r,[{key:"attributeChangedCallback",value:function(t){switch(t){case"use-device-pixel-ratio":this.requestRedraw()}}},{key:"connectedCallback",value:function(){0===this.childNodes.length&&this.appendChild(t()),oe(this)}},{key:"disconnectedCallback",value:function(){ue(this)}},{key:"setMeasurements",value:function(t){var e=t.width,r=t.height,i=q(this.childNodes),o=i[0];if(i.slice(1).length>0)throw new Error("A d3fc-svg/canvas element must only contain a single svg/canvas element.");n(o,{width:e,height:r})}},{key:"requestRedraw",value:function(){ie(this)}},{key:"useDevicePixelRatio",get:function(){return this.hasAttribute("use-device-pixel-ratio")&&"false"!==this.getAttribute("use-device-pixel-ratio")},set:function(t){t&&!this.useDevicePixelRatio?this.setAttribute("use-device-pixel-ratio",""):!t&&this.useDevicePixelRatio&&this.removeAttribute("use-device-pixel-ratio"),this.requestRedraw()}}],[{key:"observedAttributes",get:function(){return["use-device-pixel-ratio"]}}]),r}(x)},ce=ae(function(){return document.createElement("canvas")},function(t,n){var e=n.width,r=n.height;t.setAttribute("width",e),t.setAttribute("height",r)});Object.setPrototypeOf(w.prototype,HTMLElement.prototype),Object.setPrototypeOf(w,HTMLElement);var le=function(t){t.autoResize?fe(t):he(t)},fe=function(t){null==t.__autoResizeListener__&&(t.__autoResizeListener__=function(){return ie(t)},addEventListener("resize",t.__autoResizeListener__))},he=function(t){null!=t.__autoResizeListener__&&(removeEventListener("resize",t.__autoResizeListener__),t.__autoResizeListener__=null)},se=function(t){function n(){return L(this,n),j(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return B(n,t),R(n,[{key:"connectedCallback",value:function(){le(this)}},{key:"disconnectedCallback",value:function(){he(this)}},{key:"requestRedraw",value:function(){ie(this)}},{key:"attributeChangedCallback",value:function(t){switch(t){case"auto-resize":le(this)}}},{key:"autoResize",get:function(){return this.hasAttribute("auto-resize")&&"false"!==this.getAttribute("auto-resize")},set:function(t){t&&!this.autoResize?this.setAttribute("auto-resize",""):!t&&this.autoResize&&this.removeAttribute("auto-resize"),le(this)}}],[{key:"observedAttributes",get:function(){return["auto-resize"]}}]),n}(w),de=ae(function(){return document.createElementNS("http://www.w3.org/2000/svg","svg")},function(t,n){var e=n.width,r=n.height;t.setAttribute("viewBox","0 0 "+e+" "+r)}),ge="d3fc-canvas,d3fc-svg{position:relative;display:block}d3fc-canvas>canvas,d3fc-svg>svg{position:absolute;height:100%;width:100%}d3fc-svg>svg{overflow:visible}",ve=document.createElement("style");if(ve.setAttribute("type","text/css"),document.querySelector("head").appendChild(ve),ve.styleSheet?ve.styleSheet.cssText+=ge:ve.textContent+=ge,"object"!==("undefined"==typeof customElements?"undefined":V(customElements))||"function"!=typeof customElements.define)throw new Error("d3fc-element depends on Custom Elements (v1). Make sure that you load a polyfill in older browsers. See README.");customElements.define("d3fc-canvas",ce),customElements.define("d3fc-group",se),customElements.define("d3fc-svg",de);var me=function(){function t(){var t=a.mouse(this);e.call("point",this,[{x:t[0],y:t[1]}])}function n(){e.call("point",this,[])}var e=l.dispatch("point"),r=function(e){e.on("mouseenter.pointer",t).on("mousemove.pointer",t).on("mouseleave.pointer",n)};return S(r,e,"on"),r},pe=function(){var t="",n="vertical",e=function(t,n){return Number(t[n])},r=function(n){return Object.keys(n[0]).filter(function(n){return n!==t}).map(function(r){var i=n.filter(function(t){return t[r]}).map(function(n){var i=[n[t],e(n,r)];return i.data=n,i});return i.key=r,i})},i=function(n){return n.map(function(n){var r=Object.keys(n).filter(function(n){return n!==t}).map(function(t){var r=[t,e(n,t)];return r.data=n,r});return r.key=n[t],r})},o=function(t){return"vertical"===n?r(t):i(t)};return o.key=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],o):t},o.value=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],o):e},o.orient=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],o):n},o},ye=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];var r={},i=function(t){var n=!0,e=!1,i=void 0;try{for(var o,u=Object.keys(r)[Symbol.iterator]();!(n=(o=u.next()).done);n=!0){var a=o.value;t[a](r[a])}}catch(t){e=!0,i=t}finally{try{!n&&u.return&&u.return()}finally{if(e)throw i}}return t},o=!0,u=!1,a=void 0;try{for(var c,l=n[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;!function(t){i[t]=function(){return arguments.length?(r[t]=arguments.length<=0?void 0:arguments[0],i):r[t]}}(f)}}catch(t){u=!0,a=t}finally{try{!o&&l.return&&l.return()}finally{if(u)throw a}}return i},xe="d3fc-group.cartesian-chart{width:100%;height:100%;overflow:hidden;display:grid;display:-ms-grid;grid-template-columns:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);-ms-grid-columns:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);grid-template-rows:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);-ms-grid-rows:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);}\nd3fc-group.cartesian-chart>.top-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:3;-ms-grid-column:3;-ms-grid-row:1;-ms-grid-row:1;}\nd3fc-group.cartesian-chart>.top-axis{height:2em;grid-column:3;-ms-grid-column:3;grid-row:2;-ms-grid-row:2;}\nd3fc-group.cartesian-chart>.left-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:1;-ms-grid-column:1;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.left-axis{width:3em;grid-column:2;-ms-grid-column:2;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.plot-area{overflow:hidden;grid-column:3;-ms-grid-column:3;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.right-axis{width:3em;grid-column:4;-ms-grid-column:4;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.right-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:5;-ms-grid-column:5;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.bottom-axis{height:2em;grid-column:3;-ms-grid-column:3;grid-row:4;-ms-grid-row:4;}\nd3fc-group.cartesian-chart>.bottom-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:3;-ms-grid-column:3;grid-row:5;-ms-grid-row:5;}",we=document.createElement("style");we.setAttribute("type","text/css"),document.querySelector("head").appendChild(we),we.styleSheet?we.styleSheet.cssText+=xe:we.textContent+=xe;var be=function(t){return"function"==typeof t?t:function(){return t}},Se=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];var r=ke.apply(void 0,n),i=r.xScale,o=r.yScale,u=r.xAxis,c=r.yAxis,l=be(""),f=be(""),h=be(null),s=be(null),d=be("right"),g=be("bottom"),v=cn(),m=an(),p=ye("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),y=function(){},x=ye("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),w=function(){},b=function(){},S=vt("d3fc-group","cartesian-chart"),k=vt("d3fc-svg","x-axis").key(function(t){return t}),A=vt("d3fc-svg","y-axis").key(function(t){return t}),T=vt("div","x-label").key(function(t){return t}),z=vt("div","y-label").key(function(t){return t}),D=function(t){return function(n){return t.selection?n.transition(t):n}},O=function(t){var n=D(t);t.each(function(t,e,r){var _=S(a.select(r[e]),[t]);_.enter().attr("auto-resize","").html('<d3fc-svg class="plot-area"></d3fc-svg><d3fc-canvas class="plot-area"></d3fc-canvas>'),T(_,[g(t)]).attr("class",function(t){return"x-label "+t+"-label"}).text(l(t)),z(_,[d(t)]).attr("class",function(t){return"y-label "+t+"-label"}).text(f(t)),k(_,[g(t)]).attr("class",function(t){return"x-axis "+t+"-axis"}).style("height",h(t)).on("measure",function(t,n,e){var r=a.event.detail,o=r.width,u=r.height;"top"===t&&a.select(e[n]).select("svg").attr("viewBox","0 "+-u+" "+o+" "+u),i.range([0,o])}).on("draw",function(t,e,r){var o="top"===t?u.top(i):u.bottom(i);o.decorate(y),n(a.select(r[e])).select("svg").call(p(o))}),A(_,[d(t)]).attr("class",function(t){return"y-axis "+t+"-axis"}).style("width",s(t)).on("measure",function(t,n,e){var r=a.event.detail,i=r.width,u=r.height;"left"===t&&a.select(e[n]).select("svg").attr("viewBox",-i+" 0 "+i+" "+u),o.range([u,0])}).on("draw",function(t,e,r){var i="left"===t?c.left(o):c.right(o);i.decorate(w),n(a.select(r[e])).select("svg").call(x(i))}),_.select("d3fc-canvas.plot-area").on("draw",function(t,n,e){var r=a.select(e[n]).select("canvas").node();v.context(r.getContext("2d")).xScale(i).yScale(o),v(t)}),_.select("d3fc-svg.plot-area").on("draw",function(t,e,r){m.xScale(i).yScale(o),n(a.select(r[e])).select("svg").call(m)}),_.each(function(t,n,e){return e[n].requestRedraw()}),b(_,t,e)})},M=E(/range\w*/,/tickFormat/);return _(O,i,M,P("x")),_(O,o,M,P("y")),_(O,p,P("x")),_(O,x,P("y")),O.xOrient=function(){return arguments.length?(g=be(arguments.length<=0?void 0:arguments[0]),O):g},O.yOrient=function(){return arguments.length?(d=be(arguments.length<=0?void 0:arguments[0]),O):d},O.xDecorate=function(){return arguments.length?(y=arguments.length<=0?void 0:arguments[0],O):y},O.yDecorate=function(){return arguments.length?(w=arguments.length<=0?void 0:arguments[0],O):w},O.xLabel=function(){return arguments.length?(l=be(arguments.length<=0?void 0:arguments[0]),O):l},O.yLabel=function(){return arguments.length?(f=be(arguments.length<=0?void 0:arguments[0]),O):f},O.xAxisHeight=function(){return arguments.length?(h=be(arguments.length<=0?void 0:arguments[0]),O):h},O.yAxisWidth=function(){return arguments.length?(s=be(arguments.length<=0?void 0:arguments[0]),O):s},O.canvasPlotArea=function(){return arguments.length?(v=arguments.length<=0?void 0:arguments[0],O):v},O.svgPlotArea=function(){return arguments.length?(m=arguments.length<=0?void 0:arguments[0],O):m},O.decorate=function(){return arguments.length?(b=arguments.length<=0?void 0:arguments[0],O):b},O},ke=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var i={xScale:e.scaleIdentity(),yScale:e.scaleIdentity(),xAxis:{bottom:Cn,top:In},yAxis:{right:Ln,left:Vn}};return 1!==n.length||n[0].domain||n[0].range?Object.assign(i,{xScale:n[0]||i.xScale,yScale:n[1]||i.yScale}):Object.assign(i,n[0])},_e=function(t){return"function"==typeof t?t:function(){return t}},Ae=function(t,n){return function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];var o=_e(""),u=_e(""),a=n,c=function(){},l=Se.apply(void 0,r),f=function(n){t(l,a),l.decorate(function(t,n,e){t.enter().select(".x-label").style("height","1em").style("line-height","1em");var r=l.yOrient()(n);t.enter().append("div").attr("class","y-label-container").style("grid-column","left"===r?1:5).style("-ms-grid-column","left"===r?1:5).style("grid-row",3).style("-ms-grid-row",3).style("width","1em").style("display","flex").style("align-items","center").style("justify-content","center").append("div").attr("class","y-label").style("transform","rotate(-90deg)"),t.select(".y-label-container>.y-label").text(u),t.select(".top-label").style("margin-top","2em"),t.enter().append("div").attr("class","chart-label").style("grid-column",3).style("-ms-grid-column",3).style("grid-row",1).style("-ms-grid-row",1).style("height","2em").style("line-height","2em").style("text-align","center"),t.select(".chart-label").text(o(n)),c(t,n,e)}),n.call(l)};return _(f,l,T(/^x/,/^y/)),f.chartLabel=function(){return arguments.length?(o=_e(arguments.length<=0?void 0:arguments[0]),f):o},f.yLabel=function(){return arguments.length?(u=_e(arguments.length<=0?void 0:arguments[0]),f):u},f.plotArea=function(){return arguments.length?(a=arguments.length<=0?void 0:arguments[0],f):a},f.decorate=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],f):c},f}},Ee=Ae(function(t,n){return t.svgPlotArea(n)},Bt),Te=Ae(function(t,n){return t.canvasPlotArea(n)},jt),ze=function(t){switch(t){case"x":return f.brushX();case"y":return f.brushY();case"xy":return f.brush()}},De=function(t){return[t[1],t[0]]},Pe=function(t){var n=ze(t),r=l.dispatch("brush","start","end"),i=e.scaleIdentity(),o=e.scaleIdentity(),u=vt("g","brush"),c=function(n,e,r){switch(t){case"x":return n.map(e);case"y":return n.map(r);case"xy":return[[e(n[0][0]),r(n[0][1])],[e(n[1][0]),r(n[1][1])]]}},f=function(t){return c(t,e.scaleLinear().domain(i.range()).invert,e.scaleLinear().domain(De(o.range())).invert)},h=function(t){return c(t,e.scaleLinear().domain(i.range()),e.scaleLinear().domain(De(o.range())))},s=function(n){var r=e.scaleLinear().domain(i.domain());return"x"===t?n.map(r.invert):"xy"===t?[r.invert(n[0][0]),r.invert(n[1][0])]:void 0},d=function(n){var r=e.scaleLinear().domain(De(o.domain()));return"y"===t?[n[1],n[0]].map(r.invert):"xy"===t?[r.invert(n[1][1]),r.invert(n[0][1])]:void 0},g=function(t){if(!t.sourceEvent||"draw"!==t.sourceEvent.type)if(t.selection){var n=h(t.selection);r.call(t.type,{},{selection:n,xDomain:s(n),yDomain:d(n)})}else r.call(t.type,{},{})},v=function(t){t.each(function(t,e,r){n.extent([[i.range()[0],o.range()[1]],[i.range()[1],o.range()[0]]]),n.on("end",function(){return g(a.event)}).on("brush",function(){return g(a.event)}).on("start",function(){return g(a.event)}),u(a.select(r[e]),[t]).call(n).call(n.move,t?f(t):null)})};return v.xScale=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],v):i},v.yScale=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],v):o},S(v,r,"on"),S(v,n,"filter","handleSize"),v},Oe=function(){return Pe("x")},Me=function(){return Pe("y")},Ie=function(){return Pe("xy")};t.indicatorBollingerBands=M,t.indicatorExponentialMovingAverage=I,t.indicatorMacd=C,t.indicatorRelativeStrengthIndex=F,t.indicatorStochasticOscillator=G,t.indicatorForceIndex=H,t.indicatorEnvelope=Y,t.indicatorElderRay=W,t.indicatorMovingAverage=U,t.scaleDiscontinuous=m,t.discontinuitySkipWeekends=K,t.discontinuityIdentity=X,t.discontinuityRange=J,t.extentLinear=Z,t.extentTime=$,t.extentDate=$,t.randomFinancial=nt,t.randomGeometricBrownianMotion=tt,t.randomSkipWeekends=et,t.feedGdax=rt,t.bucket=it,t.largestTriangleOneBucket=ot,t.largestTriangleThreeBucket=ut,t.modeMedian=at,t.rebind=S,t.rebindAll=_,t.exclude=E,t.include=T,t.includeMap=z,t.prefix=P,t.shapeOhlc=lt,t.shapeBar=ft,t.shapeCandlestick=ht,t.shapeBoxPlot=st,t.shapeErrorBar=dt,t.layoutLabel=mt,t.layoutTextLabel=pt,t.layoutGreedy=Et,t.layoutAnnealing=Dt,t.layoutRemoveOverlaps=Ot,t.layoutBoundingBox=Mt,t.dataJoin=vt,t.effectivelyZero=1e-6,t.seriesSvgLine=Bt,t.seriesCanvasLine=jt,t.seriesSvgPoint=Nt,t.seriesCanvasPoint=qt,t.seriesSvgBar=Qt,t.seriesCanvasBar=Ft,t.seriesSvgErrorBar=Gt,t.seriesCanvasErrorBar=Ht,t.seriesSvgArea=Yt,t.seriesCanvasArea=Wt,t.seriesSvgCandlestick=Jt,t.seriesCanvasCandlestick=$t,t.seriesSvgBoxPlot=nn,t.seriesCanvasBoxPlot=en,t.seriesSvgOhlc=rn,t.seriesCanvasOhlc=on,t.seriesSvgMulti=an,t.seriesCanvasMulti=cn,t.seriesSvgGrouped=fn,t.seriesCanvasGrouped=hn,t.seriesSvgRepeat=sn,t.seriesCanvasRepeat=dn,t.autoBandwidth=vn,t.seriesSvgHeatmap=pn,t.seriesCanvasHeatmap=yn,t.annotationSvgBand=wn,t.annotationCanvasBand=bn,t.annotationSvgCrosshair=kn,t.annotationCanvasCrosshair=An,t.annotationSvgLine=Sn,t.annotationCanvasLine=_n,t.annotationSvgGridline=zn,t.annotationCanvasGridline=Dn,t.axisLabelRotate=Fn,t.axisLabelOffset=Un,t.axisTop=In,t.axisBottom=Cn,t.axisLeft=Vn,t.axisRight=Ln,t.axisOrdinalTop=Bn,t.axisOrdinalBottom=jn,t.axisOrdinalLeft=Nn,t.axisOrdinalRight=qn,t.pointer=me,t.group=pe,t.chartSvgCartesian=Ee,t.chartCanvasCartesian=Te,t.chartCartesian=Se,t.brushX=Oe,t.brushY=Me,t.brush=Ie,Object.defineProperty(t,"__esModule",{value:!0})});