22 lines
112 KiB
JavaScript
Vendored
22 lines
112 KiB
JavaScript
Vendored
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2563],{97183:function(t,e,n){"use strict";var r=n(2897),o=n(7293),a=r.ZP;a.Header=r.h4,a.Footer=r.$_,a.Content=r.VY,a.Sider=o.Z,e.Z=a},26303:function(t,e,n){"use strict";n.d(e,{Z:function(){return C}});var r=n(4942),o=n(87462),a=n(71002),i=n(94184),s=n.n(i),l=n(67294),c=n(53124),u=n(98423),f=function(t){var e,n,a=t.prefixCls,i=t.className,c=t.style,u=t.size,f=t.shape,p=s()((e={},(0,r.Z)(e,"".concat(a,"-lg"),"large"===u),(0,r.Z)(e,"".concat(a,"-sm"),"small"===u),e)),h=s()((n={},(0,r.Z)(n,"".concat(a,"-circle"),"circle"===f),(0,r.Z)(n,"".concat(a,"-square"),"square"===f),(0,r.Z)(n,"".concat(a,"-round"),"round"===f),n)),d=l.useMemo(function(){return"number"==typeof u?{width:u,height:u,lineHeight:"".concat(u,"px")}:{}},[u]);return l.createElement("span",{className:s()(a,p,h,i),style:(0,o.Z)((0,o.Z)({},d),c)})},p=n(1413),h={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},d=n(42135),g=function(t,e){return l.createElement(d.Z,(0,p.Z)((0,p.Z)({},t),{},{ref:e,icon:h}))};g.displayName="DotChartOutlined";var y=l.forwardRef(g),m=n(74902),b=function(t){var e=function(e){var n=t.width,r=t.rows;return Array.isArray(n)?n[e]:(void 0===r?2:r)-1===e?n:void 0},n=t.prefixCls,r=t.className,o=t.style,a=t.rows,i=(0,m.Z)(Array(a)).map(function(t,n){return l.createElement("li",{key:n,style:{width:e(n)}})});return l.createElement("ul",{className:s()(n,r),style:o},i)},v=function(t){var e=t.prefixCls,n=t.className,r=t.width,a=t.style;return l.createElement("h3",{className:s()(e,n),style:(0,o.Z)({width:r},a)})};function x(t){return t&&"object"===(0,a.Z)(t)?t:{}}var w=function(t){var e=t.prefixCls,n=t.loading,a=t.className,i=t.style,u=t.children,p=t.avatar,h=void 0!==p&&p,d=t.title,g=void 0===d||d,y=t.paragraph,m=void 0===y||y,w=t.active,C=t.round,M=l.useContext(c.E_),_=M.getPrefixCls,k=M.direction,z=_("skeleton",e);if(n||!("loading"in t)){var A=!!h,O=!!g,S=!!m;if(A){var T=(0,o.Z)((0,o.Z)({prefixCls:"".concat(z,"-avatar")},O&&!S?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),x(h));D=l.createElement("div",{className:"".concat(z,"-header")},l.createElement(f,(0,o.Z)({},T)))}if(O||S){if(O){var E,D,j,L,N,P=(0,o.Z)((0,o.Z)({prefixCls:"".concat(z,"-title")},!A&&S?{width:"38%"}:A&&S?{width:"50%"}:{}),x(g));L=l.createElement(v,(0,o.Z)({},P))}if(S){var F,R=(0,o.Z)((0,o.Z)({prefixCls:"".concat(z,"-paragraph")},(F={},A&&O||(F.width="61%"),!A&&O?F.rows=3:F.rows=2,F)),x(m));N=l.createElement(b,(0,o.Z)({},R))}j=l.createElement("div",{className:"".concat(z,"-content")},L,N)}var B=s()(z,(E={},(0,r.Z)(E,"".concat(z,"-with-avatar"),A),(0,r.Z)(E,"".concat(z,"-active"),w),(0,r.Z)(E,"".concat(z,"-rtl"),"rtl"===k),(0,r.Z)(E,"".concat(z,"-round"),C),E),a);return l.createElement("div",{className:B,style:i},D,j)}return void 0!==u?u:null};w.Button=function(t){var e,n=t.prefixCls,a=t.className,i=t.active,p=t.block,h=t.size,d=(0,l.useContext(c.E_).getPrefixCls)("skeleton",n),g=(0,u.Z)(t,["prefixCls"]),y=s()(d,"".concat(d,"-element"),(e={},(0,r.Z)(e,"".concat(d,"-active"),i),(0,r.Z)(e,"".concat(d,"-block"),void 0!==p&&p),e),a);return l.createElement("div",{className:y},l.createElement(f,(0,o.Z)({prefixCls:"".concat(d,"-button"),size:void 0===h?"default":h},g)))},w.Avatar=function(t){var e=t.prefixCls,n=t.className,a=t.active,i=t.shape,p=t.size,h=(0,l.useContext(c.E_).getPrefixCls)("skeleton",e),d=(0,u.Z)(t,["prefixCls","className"]),g=s()(h,"".concat(h,"-element"),(0,r.Z)({},"".concat(h,"-active"),a),n);return l.createElement("div",{className:g},l.createElement(f,(0,o.Z)({prefixCls:"".concat(h,"-avatar"),shape:void 0===i?"circle":i,size:void 0===p?"default":p},d)))},w.Input=function(t){var e,n=t.prefixCls,a=t.className,i=t.active,p=t.block,h=t.size,d=(0,l.useContext(c.E_).getPrefixCls)("skeleton",n),g=(0,u.Z)(t,["prefixCls"]),y=s()(d,"".concat(d,"-element"),(e={},(0,r.Z)(e,"".concat(d,"-active"),i),(0,r.Z)(e,"".concat(d,"-block"),p),e),a);return l.createElement("div",{className:y},l.createElement(f,(0,o.Z)({prefixCls:"".concat(d,"-input"),size:void 0===h?"default":h},g)))},w.Image=function(t){var e=t.prefixCls,n=t.className,o=t.style,a=t.active,i=(0,l.useContext(c.E_).getPrefixCls)("skeleton",e),u=s()(i,"".concat(i,"-element"),(0,r.Z)({},"".concat(i,"-active"),a),n);return l.createElement("div",{className:u},l.createElement("div",{className:s()("".concat(i,"-image"),n),style:o},l.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:"".concat(i,"-image-svg")},l.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:"".concat(i,"-image-path")}))))},w.Node=function(t){var e=t.prefixCls,n=t.className,o=t.style,a=t.active,i=t.children,u=(0,l.useContext(c.E_).getPrefixCls)("skeleton",e),f=s()(u,"".concat(u,"-element"),(0,r.Z)({},"".concat(u,"-active"),a),n),p=null!=i?i:l.createElement(y,null);return l.createElement("div",{className:f},l.createElement("div",{className:s()("".concat(u,"-image"),n),style:o},p))};var C=w},62705:function(t,e,n){var r=n(55639).Symbol;t.exports=r},44239:function(t,e,n){var r=n(62705),o=n(89607),a=n(2333),i=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":i&&i in Object(t)?o(t):a(t)}},27561:function(t,e,n){var r=n(67990),o=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(o,""):t}},31957:function(t,e,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},89607:function(t,e,n){var r=n(62705),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=a.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=i.call(t);return r&&(e?t[s]=n:delete t[s]),o}},2333:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},55639:function(t,e,n){var r=n(31957),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();t.exports=a},67990:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},13218:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},37005:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},33448:function(t,e,n){var r=n(44239),o=n(37005);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},14841:function(t,e,n){var r=n(27561),o=n(13218),a=n(33448),i=0/0,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(a(t))return i;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=l.test(t);return n||c.test(t)?u(t.slice(2),n?2:8):s.test(t)?i:+t}},9008:function(t,e,n){t.exports=n(83121)},11163:function(t,e,n){t.exports=n(80880)},92703:function(t,e,n){"use strict";var r=n(50414);function o(){}function a(){}a.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,a,i){if(i!==r){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},45697:function(t,e,n){t.exports=n(92703)()},50414:function(t){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},60727:function(t,e,n){"use strict";n.d(e,{wW:function(){return c}});var r=n(67294),o=n(85845),a=n.n(o),i=1,s=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.newChartType=function(t){var e=t.data,n={};for(var r in t)t.hasOwnProperty(r)&&"data"!==r&&"id"!==r&&"height"!==r&&"width"!==r&&(n[r]=t[r]);this.element&&(this.chart?this.chart.updateData(e,n):this.chart=new t.chartType(this.element,e,n))},e.prototype.componentDidMount=function(){this.newChartType(this.props)},e.prototype.componentDidUpdate=function(){this.newChartType(this.props)},e.prototype.componentWillUnmount=function(){this.chart&&(this.chart.destroy(),this.chart=void 0)},e.prototype.render=function(){var t=this,e=this.props,n={height:e.height||"300px",lineHeight:e.height||"300px",width:e.width||"100%",textAlign:"center",color:"#999",fontSize:"14px",fontFamily:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif"};this.chartId=e.id||this.chartId||"chart-"+i++;var o=void 0!==e.loading?e.loading:"Loading...";if("string"!=typeof o)throw Error("loading must be a string");return r.createElement("div",{id:this.chartId,style:n,ref:function(e){return t.element=e}},o)},e}(r.Component),l=function(t){var e=function(e){var n=e.innerRef,o=/*!
|
|
* React Chartkick
|
|
* Create beautiful JavaScript charts with one line of React
|
|
* https://github.com/ankane/react-chartkick
|
|
* v0.5.3
|
|
* MIT License
|
|
*/function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}(e,["innerRef"]);return o.chartType=t,o.ref=n,r.createElement(s,o)};return e.displayName=t.name,e},c=l(a().LineChart);l(a().PieChart),l(a().ColumnChart),l(a().BarChart),l(a().AreaChart),l(a().ScatterChart),l(a().GeoChart),l(a().Timeline)},85845:function(t){t.exports=function(){"use strict";function t(t){return"[object Array]"===Object.prototype.toString.call(t)}function e(t){return t instanceof Function}function n(t){return"[object Object]"===Object.prototype.toString.call(t)&&!e(t)&&t instanceof Object}function r(e,o){var a;for(a in o)"__proto__"!==a&&(n(o[a])||t(o[a])?(n(o[a])&&!n(e[a])&&(e[a]={}),t(o[a])&&!t(e[a])&&(e[a]=[]),r(e[a],o[a])):void 0!==o[a]&&(e[a]=o[a]))}function o(t,e){var n={};return r(n,t),r(n,e),n}var a=/^(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)$/i;function i(t){return""+t}function s(t){return parseFloat(t)}function l(t){var e,n,r,o;if("object"!=typeof t){if("number"==typeof t)t=new Date(1e3*t);else{if(e=(t=""+t).match(a))return n=parseInt(e[1],10),r=parseInt(e[3],10)-1,o=parseInt(e[5],10),new Date(n,r,o);var i=t.replace(/ /,"T").replace(" ","").replace("UTC","Z");t=new Date(Date.parse(i)||t)}}return t}function c(e){if(!t(e)){var n,r=[];for(n in e)e.hasOwnProperty(n)&&r.push([n,e[n]]);e=r}return e}function u(t,e,n,r,a,i,s,l){return function(c,u,f){var p=c.data,h=o({},t);return h=o(h,f||{}),(c.singleSeriesFormat||"legend"in u)&&e(h,u.legend,c.singleSeriesFormat),u.title&&n(h,u.title),"min"in u?r(h,u.min):!function(t){var e,n,r;for(e=0;e<t.length;e++)for(n=0,r=t[e].data;n<r.length;n++)if(r[n][1]<0)return!0;return!1}(p)&&r(h,0),u.max&&a(h,u.max),"stacked"in u&&i(h,u.stacked),u.colors&&(h.colors=u.colors),u.xtitle&&s(h,u.xtitle),u.ytitle&&l(h,u.ytitle),h=o(h,u.library||{})}}function f(t,e){return t[0].getTime()-e[0].getTime()}function p(t,e){return t[0]-e[0]}function h(t,e){return t-e}function d(t){return 0===t.getMilliseconds()&&0===t.getSeconds()}function g(t){return d(t)&&0===t.getMinutes()}function y(t){return g(t)&&0===t.getHours()}function m(t){return y(t)&&1===t.getDate()}function b(t){return!isNaN(l(t))&&(""+t).length>=6}function v(t){return"number"==typeof t}var x=["bytes","KB","MB","GB","TB","PB","EB"];function w(t,e,n,r){t=t||"",n.prefix&&(e<0&&(e*=-1,t+="-"),t+=n.prefix);var o=n.suffix||"",a=n.precision,i=n.round;if(n.byteScale){var s,l=r?n.byteScale:e;l>=0x1000000000000000?(e/=0x1000000000000000,s=6):l>=0x4000000000000?(e/=0x4000000000000,s=5):l>=1099511627776?(e/=1099511627776,s=4):l>=1073741824?(e/=1073741824,s=3):l>=1048576?(e/=1048576,s=2):l>=1024?(e/=1024,s=1):s=0,void 0===a&&void 0===i&&(e>=1023.5&&s<x.length-1&&(e=1,s+=1),a=e>=1e3?4:3),o=" "+x[s]}if(void 0!==a&&void 0!==i)throw Error("Use either round or precision, not both");if(!r&&(void 0===a||(e=e.toPrecision(a),n.zeros||(e=parseFloat(e))),void 0!==i)){if(i<0){var c=Math.pow(10,-1*i);e=parseInt((1*e/c).toFixed(0))*c}else e=e.toFixed(i),n.zeros||(e=parseFloat(e))}if(n.thousands||n.decimal){var u=(e=""+e).split(".");e=u[0],n.thousands&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousands)),u.length>1&&(e+=(n.decimal||".")+u[1])}return t+e+o}function C(t,e,n){return n in e?e[n]:n in t.options?t.options[n]:null}var M={maintainAspectRatio:!1,animation:!1,plugins:{legend:{},tooltip:{displayColors:!1,callbacks:{}},title:{font:{size:20},color:"#333"}},interaction:{}},_={scales:{y:{ticks:{maxTicksLimit:4},title:{font:{size:16},color:"#333"},grid:{}},x:{grid:{drawOnChartArea:!1},title:{font:{size:16},color:"#333"},time:{},ticks:{}}}},k=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#651067"],z=function(t,e,n){void 0!==e?(t.plugins.legend.display=!!e,e&&!0!==e&&(t.plugins.legend.position=e)):n&&(t.plugins.legend.display=!1)},A=function(t,e){t.plugins.title.display=!0,t.plugins.title.text=e},O=function(t,e){null!==e&&(t.scales.x.min=s(e))},S=function(t,e){t.scales.x.max=s(e)},T=function(t,e){t.scales.x.stacked=!!e,t.scales.y.stacked=!!e},E=function(t,e){t.scales.x.title.display=!0,t.scales.x.title.text=e},D=function(t,e){t.scales.y.title.display=!0,t.scales.y.title.text=e},j=function(t,e){var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?"rgba("+parseInt(n[1],16)+", "+parseInt(n[2],16)+", "+parseInt(n[3],16)+", "+e+")":t},L=function(t){return null!=t},N=function(t,e,n){var r=Math.ceil(t.element.offsetWidth/4/e.labels.length);r>25?r=25:r<10&&(r=10),n.scales.x.ticks.callback||(n.scales.x.ticks.callback=function(t){return(t=""+this.getLabelForValue(t)).length>r?t.substring(0,r-2)+"...":t})},P=function(e,n,r){var o={prefix:e.options.prefix,suffix:e.options.suffix,thousands:e.options.thousands,decimal:e.options.decimal,precision:e.options.precision,round:e.options.round,zeros:e.options.zeros};if(e.options.bytes){var a=e.data;"pie"===r&&(a=[{data:a}]);for(var i=0,s=0;s<a.length;s++)for(var l=a[s],c=0;c<l.data.length;c++)l.data[c][1]>i&&(i=l.data[c][1]);for(var u=1;i>=1024;)u*=1024,i/=1024;o.byteScale=u}if("pie"!==r){var f=n.scales.y;"bar"===r&&(f=n.scales.x),o.byteScale&&(f.ticks.stepSize||(f.ticks.stepSize=o.byteScale/2),f.ticks.maxTicksLimit||(f.ticks.maxTicksLimit=4)),f.ticks.callback||(f.ticks.callback=function(t){return w("",t,o,!0)})}if(!n.plugins.tooltip.callbacks.label){if("scatter"===r)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";return e&&(e+=": "),e+"("+t.label+", "+t.formattedValue+")"};else if("bubble"===r)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";e&&(e+=": ");var n=t.raw;return e+"("+n.x+", "+n.y+", "+n.v+")"};else if("pie"===r)n.plugins.tooltip.callbacks.label=function(e){var n=e.label;return t(n)?(n=n.slice(),n[0]+=": "):n+=": ",w(n,e.parsed,o)};else{var p="bar"===r?"x":"y";n.plugins.tooltip.callbacks.label=function(t){if(null!==t.parsed[p]){var e=t.dataset.label||"";return e&&(e+=": "),w(e,t.parsed[p],o)}}}}},F=u(o(M,_),z,A,function(t,e){null!==e&&(t.scales.y.min=s(e))},function(t,e){t.scales.y.max=s(e)},T,E,D),R=function(e,n,r){var a=[],i=[],c=e.options.colors||k,u=!0,f=!0,p=!0,b=!0,v=!0,x=!0,w=e.data,M=0;if("bubble"===r)for(var _=0;_<w.length;_++)for(var z=w[_],A=0;A<z.data.length;A++)z.data[A][2]>M&&(M=z.data[A][2]);var O,S,T,E,D,N,P=[],F=[];if("bar"===r||"column"===r||"number"!==e.xtype&&"bubble"!==e.xtype){var R,B,I,H,W,Z=[];for(S=0;S<w.length;S++)for(T=0,E=w[S];T<E.data.length;T++)D=E.data[T],P[N="datetime"==e.xtype?D[0].getTime():D[0]]||(P[N]=Array(w.length)),P[N][S]=s(D[1]),-1===Z.indexOf(N)&&Z.push(N);for(("datetime"===e.xtype||"number"===e.xtype)&&Z.sort(h),T=0;T<w.length;T++)F.push([]);for(W=0;W<Z.length;W++)for((S=Z[W],"datetime"===e.xtype)?(H=new Date(s(S)),u=u&&y(H),O||(O=H.getDay()),f=f&&(R=H,B=O,y(R)&&R.getDay()===B),p=p&&m(H),b=b&&m(I=H)&&0===I.getMonth(),v=v&&g(H),x=x&&d(H)):H=S,i.push(H),T=0;T<w.length;T++)F[T].push(void 0===P[S][T]?null:P[S][T])}else for(var V=0;V<w.length;V++){for(var U=w[V],Y=[],q=0;q<U.data.length;q++){var Q={x:s(U.data[q][0]),y:s(U.data[q][1])};"bubble"===r&&(Q.r=20*s(U.data[q][2])/M,Q.v=U.data[q][2]),Y.push(Q)}F.push(Y)}for(S=0;S<w.length;S++){if(E=w[S],e.options.colors&&e.singleSeriesFormat&&("bar"===r||"column"===r)&&!E.color&&t(e.options.colors)&&!t(e.options.colors[0])){tt=c,te=[];for(var $=0;$<c.length;$++)te[$]=j(tt[$],.5)}else tt=E.color||c[S],te="line"!==r?j(tt,.5):tt;var X={label:E.name||"",data:F[S],fill:"area"===r,borderColor:tt,backgroundColor:te,borderWidth:2},G="line"===r||"area"===r||"scatter"===r||"bubble"===r;G&&(X.pointBackgroundColor=tt,X.pointHoverBackgroundColor=tt,X.pointHitRadius=50),"bubble"===r&&(X.pointBackgroundColor=te,X.pointHoverBackgroundColor=te,X.pointHoverBorderWidth=2),E.stack&&(X.stack=E.stack),!1===C(e,E,"curve")?X.tension=0:G&&(X.tension=.4),!1===C(e,E,"points")&&(X.pointRadius=0,X.pointHoverRadius=0),X=o(X,e.options.dataset||{}),X=o(X,E.library||{}),X=o(X,E.dataset||{}),a.push(X)}var J=e.options.xmin,K=e.options.xmax;if("datetime"===e.xtype?(L(J)&&(n.scales.x.min=l(J).getTime()),L(K)&&(n.scales.x.max=l(K).getTime())):"number"===e.xtype&&(L(J)&&(n.scales.x.min=J),L(K)&&(n.scales.x.max=K)),"datetime"===e.xtype&&0===i.length&&(L(J)&&i.push(l(J)),L(K)&&i.push(l(K)),u=!1,f=!1,p=!1,b=!1,v=!1,x=!1),"datetime"===e.xtype&&i.length>0){var tt,te,tn,tr=(L(J)?l(J):i[0]).getTime(),to=(L(K)?l(K):i[0]).getTime();for(S=1;S<i.length;S++){var ta=i[S].getTime();ta<tr&&(tr=ta),ta>to&&(to=ta)}var ti=(to-tr)/864e5;if(!n.scales.x.time.unit&&(b||ti>3650?(n.scales.x.time.unit="year",tn=365):p||ti>300?(n.scales.x.time.unit="month",tn=30):u||ti>10?(n.scales.x.time.unit="day",tn=1):v||ti>.5?(n.scales.x.time.displayFormats={hour:"MMM d, h a"},n.scales.x.time.unit="hour",tn=1/24):x&&(n.scales.x.time.displayFormats={minute:"h:mm a"},n.scales.x.time.unit="minute",tn=1/24/60),tn&&ti>0)){var ts=e.element.offsetWidth;if(ts>0){var tl=Math.ceil(ti/tn/(ts/100));f&&1===tn&&(tl=7*Math.ceil(tl/7)),n.scales.x.time.stepSize=tl}}!n.scales.x.time.tooltipFormat&&(u?n.scales.x.time.tooltipFormat="PP":v?n.scales.x.time.tooltipFormat="MMM d, h a":x&&(n.scales.x.time.tooltipFormat="h:mm a"))}return{labels:i,datasets:a}},B=function(t){this.name="chartjs",this.library=t};B.prototype.renderLineChart=function(t,e){var n={};!t.options.max&&function(t){var e,n,r;for(e=0;e<t.length;e++)for(n=0,r=t[e].data;n<r.length;n++)if(0!=r[n][1])return!1;return!0}(t.data)&&(n.max=1);var r=F(t,o(n,t.options));P(t,r,e);var a=R(t,r,e||"line");"number"===t.xtype?(r.scales.x.type=r.scales.x.type||"linear",r.scales.x.position=r.scales.x.position||"bottom"):r.scales.x.type="string"===t.xtype?"category":"time",this.drawChart(t,"line",a,r)},B.prototype.renderPieChart=function(t){var e=o({},M);t.options.donut&&(e.cutout="50%"),"legend"in t.options&&z(e,t.options.legend),t.options.title&&A(e,t.options.title),e=o(e,t.options.library||{}),P(t,e,"pie");for(var n=[],r=[],a=0;a<t.data.length;a++){var i=t.data[a];n.push(i[0]),r.push(i[1])}var s={data:r,backgroundColor:t.options.colors||k},l={labels:n,datasets:[s=o(s,t.options.dataset||{})]};this.drawChart(t,"pie",l,e)},B.prototype.renderColumnChart=function(t,e){if("bar"===e){var n,r=o(M,_);r.indexAxis="y",r.scales.x.grid.drawOnChartArea=!0,r.scales.y.grid.drawOnChartArea=!1,delete r.scales.y.ticks.maxTicksLimit,n=u(r,z,A,O,S,T,E,D)(t,t.options)}else n=F(t,t.options);P(t,n,e);var a=R(t,n,"column");"bar"!==e&&N(t,a,n),this.drawChart(t,"bar",a,n)},B.prototype.renderAreaChart=function(t){this.renderLineChart(t,"area")},B.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},B.prototype.renderScatterChart=function(t,e){e=e||"scatter";var n=F(t,t.options);P(t,n,e),"showLine"in n||(n.showLine=!1);var r=R(t,n,e);n.scales.x.type=n.scales.x.type||"linear",n.scales.x.position=n.scales.x.position||"bottom","mode"in n.interaction||(n.interaction.mode="nearest"),this.drawChart(t,e,r,n)},B.prototype.renderBubbleChart=function(t){this.renderScatterChart(t,"bubble")},B.prototype.destroy=function(t){t.chart&&t.chart.destroy()},B.prototype.drawChart=function(t,e,n,r){if(this.destroy(t),!t.destroyed){var o={type:e,data:n,options:r};t.options.code&&window.console.log("new Chart(ctx, "+JSON.stringify(o)+");"),t.element.innerHTML="<canvas></canvas>";var a=t.element.getElementsByTagName("CANVAS")[0];t.chart=new this.library(a,o)}};var I={chart:{},xAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},title:{text:null},credits:{enabled:!1},legend:{borderWidth:0},tooltip:{style:{fontSize:"12px"}},plotOptions:{areaspline:{},area:{},series:{marker:{}}},time:{useUTC:!1}},H=function(t,e,n){void 0!==e?(t.legend.enabled=!!e,e&&!0!==e&&("top"===e||"bottom"===e?t.legend.verticalAlign=e:(t.legend.layout="vertical",t.legend.verticalAlign="middle",t.legend.align=e))):n&&(t.legend.enabled=!1)},W=function(t,e){t.title.text=e},Z=u(I,H,W,function(t,e){t.yAxis.min=e},function(t,e){t.yAxis.max=e},function(t,e){var n=e?!0===e?"normal":e:null;t.plotOptions.series.stacking=n,t.plotOptions.area.stacking=n,t.plotOptions.areaspline.stacking=n},function(t,e){t.xAxis.title.text=e},function(t,e){t.yAxis.title.text=e}),V=function(e,n,r){var o={prefix:e.options.prefix,suffix:e.options.suffix,thousands:e.options.thousands,decimal:e.options.decimal,precision:e.options.precision,round:e.options.round,zeros:e.options.zeros};"pie"===r||t(n.yAxis)||n.yAxis.labels.formatter||(n.yAxis.labels.formatter=function(){return w("",this.value,o)}),n.tooltip.pointFormatter||n.tooltip.pointFormat||(n.tooltip.pointFormatter=function(){return'<span style="color:'+this.color+'">●</span> '+w(this.series.name+": <b>",this.y,o)+"</b><br/>"})},U=function(t){this.name="highcharts",this.library=t};U.prototype.renderLineChart=function(t,e){var n={};"areaspline"===(e=e||"spline")&&(n={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===t.options.curve&&("areaspline"===e?e="area":"spline"===e&&(e="line"));var r,o,a,i=Z(t,t.options,n);"number"===t.xtype?i.xAxis.type=i.xAxis.type||"linear":i.xAxis.type="string"===t.xtype?"category":"datetime",i.chart.type||(i.chart.type=e),V(t,i,e);var s=t.data;for(o=0;o<s.length;o++){if(s[o].name=s[o].name||"Value",r=s[o].data,"datetime"===t.xtype)for(a=0;a<r.length;a++)r[a][0]=r[a][0].getTime();s[o].marker={symbol:"circle"},!1===t.options.points&&(s[o].marker.enabled=!1)}this.drawChart(t,s,i)},U.prototype.renderScatterChart=function(t){var e=Z(t,t.options,{});e.chart.type="scatter",this.drawChart(t,t.data,e)},U.prototype.renderPieChart=function(t){var e=o(I,{});t.options.colors&&(e.colors=t.options.colors),t.options.donut&&(e.plotOptions={pie:{innerSize:"50%"}}),"legend"in t.options&&H(e,t.options.legend),t.options.title&&W(e,t.options.title);var n=o(e,t.options.library||{});V(t,n,"pie");var r=[{type:"pie",name:t.options.label||"Value",data:t.data}];this.drawChart(t,r,n)},U.prototype.renderColumnChart=function(t,e){e=e||"column";var n,r,o,a,i=t.data,s=Z(t,t.options),l=[],c=[];for(s.chart.type=e,V(t,s,e),n=0;n<i.length;n++)for(r=0,o=i[n];r<o.data.length;r++)l[(a=o.data[r])[0]]||(l[a[0]]=Array(i.length),c.push(a[0])),l[a[0]][n]=a[1];"number"===t.xtype&&c.sort(h),s.xAxis.categories=c;var u,f=[];for(n=0;n<i.length;n++){for(r=0,a=[];r<c.length;r++)a.push(l[c[r]][n]||0);u={name:i[n].name||"Value",data:a},i[n].stack&&(u.stack=i[n].stack),f.push(u)}this.drawChart(t,f,s)},U.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},U.prototype.renderAreaChart=function(t){this.renderLineChart(t,"areaspline")},U.prototype.destroy=function(t){t.chart&&t.chart.destroy()},U.prototype.drawChart=function(t,e,n){this.destroy(t),t.destroyed||(n.chart.renderTo=t.element.id,n.series=e,t.options.code&&window.console.log("new Highcharts.Chart("+JSON.stringify(n)+");"),t.chart=new this.library.Chart(n))};var Y={},q=[],Q={chartArea:{},fontName:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",pointSize:6,legend:{textStyle:{fontSize:12,color:"#444"},alignment:"center",position:"right"},curveType:"function",hAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},gridlines:{color:"transparent"},baselineColor:"#ccc",viewWindow:{}},vAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},baselineColor:"#ccc",viewWindow:{}},tooltip:{textStyle:{color:"#666",fontSize:12}}},$=function(t,e,n){void 0!==e?t.legend.position=e?!0===e?"right":e:"none":n&&(t.legend.position="none")},X=function(t,e){t.title=e,t.titleTextStyle={color:"#333",fontSize:"20px"}},G=function(t,e){t.hAxis.viewWindow.min=e},J=function(t,e){t.hAxis.viewWindow.max=e},K=function(t,e){t.isStacked=!!e&&e},tt=function(t,e){t.hAxis.title=e,t.hAxis.titleTextStyle.italic=!1},te=function(t,e){t.vAxis.title=e,t.vAxis.titleTextStyle.italic=!1},tn=u(Q,$,X,function(t,e){t.vAxis.viewWindow.min=e},function(t,e){t.vAxis.viewWindow.max=e},K,tt,te),tr=function(t){window.attachEvent?window.attachEvent("onresize",t):window.addEventListener&&window.addEventListener("resize",t,!0),t()},to=function(t){this.name="google",this.library=t};function ta(t,e){var n,r,o;for(n=0;n<t.length;n++)for(r=0,o=c(t[n].data);r<o.length;r++)if(!e(o[r][0]))return!1;return!0}function ti(e,n,r){var o,a,u=e.options,h=e.rawData;for(e.singleSeriesFormat=!t(h)||"object"!=typeof h[0]||t(h[0]),e.singleSeriesFormat&&(h=[{name:u.label,data:h}]),h=function(t){var e,n,r=[];for(e=0;e<t.length;e++){var o={};for(n in t[e])t[e].hasOwnProperty(n)&&(o[n]=t[e][n]);r.push(o)}return r}(h),a=0;a<h.length;a++)h[a].data=c(h[a].data);for(a=0,e.xtype=n||(u.discrete?"string":tl(o=h)?(u.xmin||u.xmax)&&(!u.xmin||b(u.xmin))&&(!u.xmax||b(u.xmax))?"datetime":"number":ta(o,v)?"number":!r&&ta(o,b)?"datetime":"string");a<h.length;a++)h[a].data=function(t,e){var n,r,o=[];if(r="number"===e?s:"datetime"===e?l:i,"bubble"===e)for(n=0;n<t.length;n++)o.push([s(t[n][0]),s(t[n][1]),s(t[n][2])]);else for(n=0;n<t.length;n++)o.push([r(t[n][0]),s(t[n][1])]);return"datetime"===e?o.sort(f):"number"===e&&o.sort(p),o}(h[a].data,e.xtype);return h}function ts(t){var e,n=c(t.rawData);for(e=0;e<n.length;e++)n[e]=[""+n[e][0],s(n[e][1])];return n}function tl(t,e){if("PieChart"===e||"GeoChart"===e||"Timeline"===e)return 0===t.length;for(var n=0;n<t.length;n++)if(t[n].data.length>0)return!1;return!0}function tc(t,e,n){if(t.addEventListener)return t.addEventListener(e,n,!1),n;var r=function(){return n.call(t,window.event)};return t.attachEvent("on"+e,r),r}function tu(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)}function tf(t,e){if(t===e)return!1;for(;e&&e!==t;)e=e.parentNode;return e===t}to.prototype.renderLineChart=function(t){var e=this;this.waitForLoaded(t,function(){var n={};!1===t.options.curve&&(n.curveType="none"),!1===t.options.points&&(n.pointSize=0);var r=tn(t,t.options,n),o=e.createDataTable(t.data,t.xtype);e.drawChart(t,"LineChart",o,r)})},to.prototype.renderPieChart=function(t){var e=this;this.waitForLoaded(t,function(){var n={chartArea:{top:"10%",height:"80%"},legend:{}};t.options.colors&&(n.colors=t.options.colors),t.options.donut&&(n.pieHole=.5),"legend"in t.options&&$(n,t.options.legend),t.options.title&&X(n,t.options.title);var r=o(o(Q,n),t.options.library||{}),a=new e.library.visualization.DataTable;a.addColumn("string",""),a.addColumn("number","Value"),a.addRows(t.data),e.drawChart(t,"PieChart",a,r)})},to.prototype.renderColumnChart=function(t){var e=this;this.waitForLoaded(t,function(){var n=tn(t,t.options),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"ColumnChart",r,n)})},to.prototype.renderBarChart=function(t){var e=this;this.waitForLoaded(t,function(){var n=u(Q,$,X,G,J,K,tt,te)(t,t.options,{hAxis:{gridlines:{color:"#ccc"}}}),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"BarChart",r,n)})},to.prototype.renderAreaChart=function(t){var e=this;this.waitForLoaded(t,function(){var n=tn(t,t.options,{isStacked:!0,pointSize:0,areaOpacity:.5}),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"AreaChart",r,n)})},to.prototype.renderGeoChart=function(t){var e=this;this.waitForLoaded(t,"geochart",function(){var n=o(o(Q,{legend:"none",colorAxis:{colors:t.options.colors||["#f6c7b6","#ce502d"]}}),t.options.library||{}),r=new e.library.visualization.DataTable;r.addColumn("string",""),r.addColumn("number",t.options.label||"Value"),r.addRows(t.data),e.drawChart(t,"GeoChart",r,n)})},to.prototype.renderScatterChart=function(t){var e=this;this.waitForLoaded(t,function(){var n,r,o,a,i=tn(t,t.options,{}),s=t.data,l=[];for(n=0;n<s.length;n++)for(r=0,s[n].name=s[n].name||"Value",a=s[n].data;r<a.length;r++){var c=Array(s.length+1);c[0]=a[r][0],c[n+1]=a[r][1],l.push(c)}for((o=new e.library.visualization.DataTable).addColumn("number",""),n=0;n<s.length;n++)o.addColumn("number",s[n].name);o.addRows(l),e.drawChart(t,"ScatterChart",o,i)})},to.prototype.renderTimeline=function(t){var e=this;this.waitForLoaded(t,"timeline",function(){var n={legend:"none"};t.options.colors&&(n.colors=t.options.colors);var r=o(o(Q,n),t.options.library||{}),a=new e.library.visualization.DataTable;a.addColumn({type:"string",id:"Name"}),a.addColumn({type:"date",id:"Start"}),a.addColumn({type:"date",id:"End"}),a.addRows(t.data),t.element.style.lineHeight="normal",e.drawChart(t,"Timeline",a,r)})},to.prototype.destroy=function(t){t.chart&&t.chart.clearChart()},to.prototype.drawChart=function(t,e,n,r){this.destroy(t),t.destroyed||(t.options.code&&window.console.log("var data = new google.visualization.DataTable("+n.toJSON()+");\nvar chart = new google.visualization."+e+"(element);\nchart.draw(data, "+JSON.stringify(r)+");"),t.chart=new this.library.visualization[e](t.element),tr(function(){t.chart.draw(n,r)}))},to.prototype.waitForLoaded=function(t,e,n){var r=this;if(n||(n=e,e="corechart"),q.push({pack:e,callback:n}),Y[e])this.runCallbacks();else{Y[e]=!0;var o={packages:[e],callback:function(){r.runCallbacks()}},a=t.__config();a.language&&(o.language=a.language),"geochart"===e&&a.mapsApiKey&&(o.mapsApiKey=a.mapsApiKey),this.library.charts.load("current",o)}},to.prototype.runCallbacks=function(){for(var t,e=0;e<q.length;e++)t=q[e],this.library.visualization&&("corechart"===t.pack&&this.library.visualization.LineChart||"timeline"===t.pack&&this.library.visualization.Timeline||"geochart"===t.pack&&this.library.visualization.GeoChart)&&(t.callback(),q.splice(e,1),e--)},to.prototype.createDataTable=function(t,e){var n,r,o,a,i,l,c=[],u=[];for(r=0;r<t.length;r++)for(o=0,a=t[r],t[r].name=t[r].name||"Value";o<a.data.length;o++)i=a.data[o],c[l="datetime"===e?i[0].getTime():i[0]]||(c[l]=Array(t.length),u.push(l)),c[l][r]=s(i[1]);var h=[],d=!0;for(o=0;o<u.length;o++)r=u[o],"datetime"===e?(n=new Date(s(r)),d=d&&y(n)):n="number"===e?s(r):r,h.push([n].concat(c[r]));if("datetime"===e)h.sort(f);else if("number"===e){for(h.sort(p),r=0;r<h.length;r++)h[r][0]=""+h[r][0];e="string"}var g=new this.library.visualization.DataTable;for(e="datetime"===e&&d?"date":e,g.addColumn(e,""),r=0;r<t.length;r++)g.addColumn("number",t[r].name);return g.addRows(h),g};var tp=[],th=0;function td(){if(th<4){var t,e,n,r=tp.shift();r&&(th++,t=r[0],e=r[1],n=r[2],function(t,e,n){var r=window.jQuery||window.Zepto||window.$;if(r&&r.ajax)r.ajax({dataType:"json",url:t,success:e,error:n,complete:tg});else{var o=new XMLHttpRequest;o.open("GET",t,!0),o.setRequestHeader("Content-Type","application/json"),o.onload=function(){tg(),200===o.status?e(JSON.parse(o.responseText),o.statusText,o):n(o,"error",o.statusText)},o.send()}}(t,e,function(t,e,r){n("string"==typeof r?r:r.message)}),td())}}function tg(){th--,td()}var ty={},tm=[];function tb(t,e){document.body.innerText?t.innerText=e:t.textContent=e}function tv(t,e,n){n||(e="Error Loading Chart: "+e),tb(t,e),t.style.color="#ff0000"}function tx(t){try{t.__render()}catch(e){throw tv(t.element,e.message),e}}function tw(t,e,n){if(n&&t.options.loading&&("string"==typeof e||"function"==typeof e)&&tb(t.element,t.options.loading),"string"==typeof e)tp.push([e,function(e){t.rawData=e,tx(t)},function(e){tv(t.element,e)}]),td();else if("function"==typeof e)try{e(function(e){t.rawData=e,tx(t)},function(e){tv(t.element,e,!0)})}catch(e){tv(t.element,e,!0)}else t.rawData=e,tx(t)}function tC(t){var n=new(function(t){if(t){if("Highcharts"===t.product)return U;if(t.charts)return to;if(e(t))return B}throw Error("Unknown adapter")}(t))(t);-1===tm.indexOf(n)&&tm.push(n)}var tM=function(t,e,n){var r;if("string"==typeof t&&(r=t,!(t=document.getElementById(t))))throw Error("No element with id "+r);this.element=t,this.options=o(t_.options,n||{}),this.dataSource=e,t_.charts[t.id]=this,tw(this,e,!0),this.options.refresh&&this.startRefresh()};tM.prototype.getElement=function(){return this.element},tM.prototype.getDataSource=function(){return this.dataSource},tM.prototype.getData=function(){return this.data},tM.prototype.getOptions=function(){return this.options},tM.prototype.getChartObject=function(){return this.chart},tM.prototype.getAdapter=function(){return this.adapter},tM.prototype.updateData=function(t,e){this.dataSource=t,e&&this.__updateOptions(e),tw(this,t,!0)},tM.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()},tM.prototype.redraw=function(){tw(this,this.rawData)},tM.prototype.refreshData=function(){if("string"==typeof this.dataSource){var t=-1===this.dataSource.indexOf("?")?"?":"&";tw(this,this.dataSource+t+"_="+new Date().getTime())}else"function"==typeof this.dataSource&&tw(this,this.dataSource)},tM.prototype.startRefresh=function(){var t=this,e=this.options.refresh;if(e&&"string"!=typeof this.dataSource&&"function"!=typeof this.dataSource)throw Error("Data source must be a URL or callback for refresh");if(!this.intervalId){if(e)this.intervalId=setInterval(function(){t.refreshData()},1e3*e);else throw Error("No refresh interval")}},tM.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},tM.prototype.toImage=function(t){if("chartjs"===this.adapter){if(!t||!t.background||"transparent"===t.background)return this.chart.toBase64Image();var e=this.chart.canvas,n=this.chart.ctx,r=document.createElement("canvas"),o=r.getContext("2d");return r.width=n.canvas.width,r.height=n.canvas.height,o.fillStyle=t.background,o.fillRect(0,0,r.width,r.height),o.drawImage(e,0,0),r.toDataURL("image/png")}throw Error("Feature only available for Chart.js")},tM.prototype.destroy=function(){this.destroyed=!0,this.stopRefresh(),this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&tu(this.element,"mouseover",this.__enterEvent),this.__leaveEvent&&tu(this.element,"mouseout",this.__leaveEvent)},tM.prototype.__updateOptions=function(t){var e=t.refresh&&t.refresh!==this.options.refresh;this.options=o(t_.options,t),e&&(this.stopRefresh(),this.startRefresh())},tM.prototype.__render=function(){this.data=this.__processData(),function(t,n){if(tl(n.data,t)){var r,o,a,i,s,l=n.options.empty||n.options.messages&&n.options.messages.empty||"No data";tb(n.element,l)}else(function(t,n){var r,o,a,i;for(a="render"+t,i=n.options.adapter,("Chart"in window)&&tC(window.Chart),("Highcharts"in window)&&tC(window.Highcharts),window.google&&window.google.charts&&tC(window.google),r=0;r<tm.length;r++)if(o=tm[r],(!i||i===o.name)&&e(o[a]))return n.adapter=o.name,n.__adapterObject=o,o[a](n);if(tm.length>0)throw Error("No charting library found for "+t);throw Error("No charting libraries found - be sure to include one before your charts")})(t,n),n.options.download&&!n.__downloadAttached&&"chartjs"===n.adapter&&(o=(r=n).element,a=document.createElement("a"),!0===(i=r.options.download)?i={}:"string"==typeof i&&(i={filename:i}),a.download=i.filename||"chart.png",a.style.position="absolute",a.style.top="20px",a.style.right="20px",a.style.zIndex=1e3,a.style.lineHeight="20px",a.target="_blank",(s=document.createElement("img")).alt="Download",s.style.border="none",s.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==",a.appendChild(s),o.style.position="relative",r.__downloadAttached=!0,r.__enterEvent=tc(o,"mouseover",function(t){var e=t.relatedTarget;e&&(e===this||tf(this,e))||!r.options.download||(a.href=r.toImage(i),o.appendChild(a))}),r.__leaveEvent=tc(o,"mouseout",function(t){var e=t.relatedTarget;e&&(e===this||tf(this,e))||!a.parentNode||a.parentNode.removeChild(a)}))}(this.__chartName(),this)},tM.prototype.__config=function(){return ty};var t_={LineChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ti(this)},e.prototype.__chartName=function(){return"LineChart"},e}(tM),PieChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ts(this)},e.prototype.__chartName=function(){return"PieChart"},e}(tM),ColumnChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ti(this,null,!0)},e.prototype.__chartName=function(){return"ColumnChart"},e}(tM),BarChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ti(this,null,!0)},e.prototype.__chartName=function(){return"BarChart"},e}(tM),AreaChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ti(this)},e.prototype.__chartName=function(){return"AreaChart"},e}(tM),GeoChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ts(this)},e.prototype.__chartName=function(){return"GeoChart"},e}(tM),ScatterChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ti(this,"number")},e.prototype.__chartName=function(){return"ScatterChart"},e}(tM),BubbleChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ti(this,"bubble")},e.prototype.__chartName=function(){return"BubbleChart"},e}(tM),Timeline:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){var t,e=this.rawData;for(t=0;t<e.length;t++)e[t][1]=l(e[t][1]),e[t][2]=l(e[t][2]);return e},e.prototype.__chartName=function(){return"Timeline"},e}(tM),charts:{},configure:function(t){for(var e in t)t.hasOwnProperty(e)&&(ty[e]=t[e])},setDefaultOptions:function(t){t_.options=t},eachChart:function(t){for(var e in t_.charts)t_.charts.hasOwnProperty(e)&&t(t_.charts[e])},destroyAll:function(){for(var t in t_.charts)t_.charts.hasOwnProperty(t)&&(t_.charts[t].destroy(),delete t_.charts[t])},config:ty,options:{},adapters:tm,addAdapter:tC,use:function(t){return tC(t),t_}};return"undefined"==typeof window||window.Chartkick||(window.Chartkick=t_,document.addEventListener("turbolinks:before-render",function(){!1!==ty.autoDestroy&&t_.destroyAll()}),document.addEventListener("turbo:before-render",function(){!1!==ty.autoDestroy&&t_.destroyAll()}),setTimeout(function(){window.dispatchEvent(new Event("chartkick:load"))},0)),t_.default=t_,t_}()},9085:function(t,e,n){"use strict";var r=n(23148);r.kL.register(...r.zX),e.ZP=r.kL},9676:function(t,e,n){"use strict";let r,o;/*!
|
|
* @kurkle/color v0.3.2
|
|
* https://github.com/kurkle/color#readme
|
|
* (c) 2023 Jukka Kurkela
|
|
* Released under the MIT License
|
|
*/function a(t){return t+.5|0}n.d(e,{$:function(){return ef},A:function(){return tN},B:function(){return tL},C:function(){return ec},D:function(){return tk},E:function(){return eC},F:function(){return U},G:function(){return eJ},H:function(){return tf},I:function(){return eV},J:function(){return e1},K:function(){return e0},L:function(){return tW},M:function(){return eZ},N:function(){return tb},O:function(){return I},P:function(){return ti},Q:function(){return V},R:function(){return ek},S:function(){return tT},T:function(){return ts},U:function(){return tM},V:function(){return er},W:function(){return tE},X:function(){return ea},Y:function(){return eu},Z:function(){return ed},_:function(){return tI},a:function(){return e_},a0:function(){return eM},a1:function(){return tV},a2:function(){return tU},a3:function(){return t8},a4:function(){return X},a5:function(){return te},a6:function(){return t9},a7:function(){return tr},a8:function(){return function t(e,n,r,o){let a={_cacheable:!1,_proxy:e,_context:n,_subProxy:r,_stack:new Set,_descriptors:eO(e,o),setContext:n=>t(e,n,r,o),override:a=>t(e.override(a),n,r,o)};return new Proxy(a,{deleteProperty:(t,n)=>(delete t[n],delete e[n],!0),get:(e,n,r)=>eE(e,n,()=>(function(e,n,r){let{_proxy:o,_context:a,_subProxy:i,_descriptors:s}=e,l=o[n];return tr(l)&&s.isScriptable(n)&&(l=function(t,e,n,r){let{_proxy:o,_context:a,_subProxy:i,_stack:s}=n;if(s.has(t))throw Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);return s.add(t),e=e(a,i||r),s.delete(t),eT(t,e)&&(e=ej(o._scopes,o,t,e)),e}(n,l,e,r)),F(l)&&l.length&&(l=function(e,n,r,o){let{_proxy:a,_context:i,_subProxy:s,_descriptors:l}=r;if(tn(i.index)&&o(e))n=n[i.index%n.length];else if(R(n[0])){let r=n,o=a._scopes.filter(t=>t!==r);for(let c of(n=[],r)){let r=ej(o,a,e,c);n.push(t(r,i,s&&s[e],l))}}return n}(n,l,e,s.isIndexable)),eT(n,l)&&(l=t(l,a,i&&i[n],s)),l})(e,n,r)),getOwnPropertyDescriptor:(t,n)=>t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n),getPrototypeOf:()=>Reflect.getPrototypeOf(e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),set:(t,n,r)=>(e[n]=r,delete t[n],!0)})}},a9:function(){return eA},aA:function(){return e6},aB:function(){return tY},aC:function(){return e7},aD:function(){return el},aE:function(){return tz},aF:function(){return L},aG:function(){return tw},aH:function(){return tm},aI:function(){return tx},aJ:function(){return ty},aK:function(){return t_},aL:function(){return t7},aM:function(){return td},aN:function(){return eo},aO:function(){return tP},aP:function(){return tj},aa:function(){return eO},ab:function(){return G},ac:function(){return N},ad:function(){return tZ},ae:function(){return eK},af:function(){return ei},ag:function(){return to},ah:function(){return Y},ai:function(){return ta},aj:function(){return tD},ak:function(){return ev},al:function(){return eW},am:function(){return nn},an:function(){return ne},ao:function(){return e5},ap:function(){return e4},aq:function(){return e2},ar:function(){return ep},as:function(){return eh},at:function(){return es},au:function(){return eg},av:function(){return ex},aw:function(){return ew},ax:function(){return nt},ay:function(){return tO},az:function(){return e3},b:function(){return F},c:function(){return t0},d:function(){return en},e:function(){return tJ},f:function(){return tt},g:function(){return B},h:function(){return tn},i:function(){return R},j:function(){return ez},k:function(){return P},l:function(){return tR},m:function(){return W},n:function(){return Z},o:function(){return t3},p:function(){return tS},q:function(){return tq},r:function(){return tH},s:function(){return tg},t:function(){return tC},u:function(){return tB},v:function(){return H},w:function(){return tQ},x:function(){return tv},y:function(){return eF},z:function(){return eX}});let i=(t,e,n)=>Math.max(Math.min(t,n),e);function s(t){return i(a(2.55*t),0,255)}function l(t){return i(a(255*t),0,255)}function c(t){return i(a(t/2.55)/100,0,1)}function u(t){return i(a(100*t),0,100)}let f={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},p=[..."0123456789ABCDEF"],h=t=>p[15&t],d=t=>p[(240&t)>>4]+p[15&t],g=t=>(240&t)>>4==(15&t),y=t=>g(t.r)&&g(t.g)&&g(t.b)&&g(t.a),m=(t,e)=>t<255?e(t):"",b=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function v(t,e,n){let r=e*Math.min(n,1-n),o=(e,o=(e+t/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[o(0),o(8),o(4)]}function x(t,e,n){let r=(r,o=(r+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function w(t,e,n){let r;let o=v(t,1,.5);for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)o[r]*=1-e-n,o[r]+=e;return o}function C(t){let e,n,r;let o=t.r/255,a=t.g/255,i=t.b/255,s=Math.max(o,a,i),l=Math.min(o,a,i),c=(s+l)/2;return s!==l&&(r=s-l,n=c>.5?r/(2-s-l):r/(s+l),e=60*(e=o===s?(a-i)/r+(a<i?6:0):a===s?(i-o)/r+2:(o-a)/r+4)+.5),[0|e,n||0,c]}function M(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(l)}function _(t){return(t%360+360)%360}let k={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},z={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"},A=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,O=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,S=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function T(t,e,n){if(t){let r=C(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,0===e?360:1)),r=M(v,r,void 0,void 0),t.r=r[0],t.g=r[1],t.b=r[2]}}function E(t,e){return t?Object.assign(e||{},t):t}function D(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=l(t[3]))):(e=E(t,{r:0,g:0,b:0,a:1})).a=l(e.a),e}class j{constructor(t){let e;if(t instanceof j)return t;let n=typeof t;if("object"===n)e=D(t);else if("string"===n){var o,a;a=t.length,"#"===t[0]&&(4===a||5===a?o={r:255&17*f[t[1]],g:255&17*f[t[2]],b:255&17*f[t[3]],a:5===a?17*f[t[4]]:255}:(7===a||9===a)&&(o={r:f[t[1]]<<4|f[t[2]],g:f[t[3]]<<4|f[t[4]],b:f[t[5]]<<4|f[t[6]],a:9===a?f[t[7]]<<4|f[t[8]]:255})),e=o||function(t){r||((r=function(){let t,e,n,r,o;let a={},i=Object.keys(z),s=Object.keys(k);for(t=0;t<i.length;t++){for(e=0,r=o=i[t];e<s.length;e++)n=s[e],o=o.replace(n,k[n]);n=parseInt(z[r],16),a[o]=[n>>16&255,n>>8&255,255&n]}return a}()).transparent=[0,0,0,0]);let e=r[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||("r"===t.charAt(0)?function(t){let e,n,r;let o=A.exec(t),a=255;if(o){if(o[7]!==e){let t=+o[7];a=o[8]?s(t):i(255*t,0,255)}return e=+o[1],n=+o[3],r=+o[5],{r:e=255&(o[2]?s(e):i(e,0,255)),g:n=255&(o[4]?s(n):i(n,0,255)),b:r=255&(o[6]?s(r):i(r,0,255)),a:a}}}(t):function(t){let e;let n=b.exec(t),r=255;if(!n)return;n[5]!==e&&(r=n[6]?s(+n[5]):l(+n[5]));let o=_(+n[2]),a=+n[3]/100,i=+n[4]/100;return{r:(e="hwb"===n[1]?M(w,o,a,i):"hsv"===n[1]?M(x,o,a,i):M(v,o,a,i))[0],g:e[1],b:e[2],a:r}}(t))}this._rgb=e,this._valid=!!e}get valid(){return this._valid}get rgb(){var t=E(this._rgb);return t&&(t.a=c(t.a)),t}set rgb(t){this._rgb=D(t)}rgbString(){var t;return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${c(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0}hexString(){var t,e;return this._valid?(e=y(t=this._rgb)?h:d,t?"#"+e(t.r)+e(t.g)+e(t.b)+m(t.a,e):void 0):void 0}hslString(){return this._valid?function(t){if(!t)return;let e=C(t),n=e[0],r=u(e[1]),o=u(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${o}%, ${c(t.a)})`:`hsl(${n}, ${r}%, ${o}%)`}(this._rgb):void 0}mix(t,e){if(t){let n;let r=this.rgb,o=t.rgb,a=e===n?.5:e,i=2*a-1,s=r.a-o.a,l=((i*s==-1?i:(i+s)/(1+i*s))+1)/2;n=1-l,r.r=255&l*r.r+n*o.r+.5,r.g=255&l*r.g+n*o.g+.5,r.b=255&l*r.b+n*o.b+.5,r.a=a*r.a+(1-a)*o.a,this.rgb=r}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,n){let r=S(c(t.r)),o=S(c(t.g)),a=S(c(t.b));return{r:l(O(r+n*(S(c(e.r))-r))),g:l(O(o+n*(S(c(e.g))-o))),b:l(O(a+n*(S(c(e.b))-a))),a:t.a+n*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new j(this.rgb)}alpha(t){return this._rgb.a=l(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=a(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return T(this._rgb,2,t),this}darken(t){return T(this._rgb,2,-t),this}saturate(t){return T(this._rgb,1,t),this}desaturate(t){return T(this._rgb,1,-t),this}rotate(t){var e,n;return(n=C(e=this._rgb))[0]=_(n[0]+t),n=M(v,n,void 0,void 0),e.r=n[0],e.g=n[1],e.b=n[2],this}}/*!
|
|
* Chart.js v4.2.0
|
|
* https://www.chartjs.org
|
|
* (c) 2023 Chart.js Contributors
|
|
* Released under the MIT License
|
|
*/function L(){}let N=(o=0,()=>o++);function P(t){return null==t}function F(t){if(Array.isArray&&Array.isArray(t))return!0;let e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function R(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function B(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function I(t,e){return B(t)?t:e}function H(t,e){return void 0===t?e:t}let W=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,Z=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function V(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function U(t,e,n,r){let o,a,i;if(F(t)){if(a=t.length,r)for(o=a-1;o>=0;o--)e.call(n,t[o],o);else for(o=0;o<a;o++)e.call(n,t[o],o)}else if(R(t))for(o=0,a=(i=Object.keys(t)).length;o<a;o++)e.call(n,t[i[o]],i[o])}function Y(t,e){let n,r,o,a;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(o=t[n],a=e[n],o.datasetIndex!==a.datasetIndex||o.index!==a.index)return!1;return!0}function q(t){if(F(t))return t.map(q);if(R(t)){let e=Object.create(null),n=Object.keys(t),r=n.length,o=0;for(;o<r;++o)e[n[o]]=q(t[n[o]]);return e}return t}function Q(t){return -1===["__proto__","prototype","constructor"].indexOf(t)}function $(t,e,n,r){if(!Q(t))return;let o=e[t],a=n[t];R(o)&&R(a)?X(o,a,r):e[t]=q(a)}function X(t,e,n){let r;let o=F(e)?e:[e],a=o.length;if(!R(t))return t;n=n||{};let i=n.merger||$;for(let e=0;e<a;++e){if(!R(r=o[e]))continue;let a=Object.keys(r);for(let e=0,o=a.length;e<o;++e)i(a[e],t,r,n)}return t}function G(t,e){return X(t,e,{merger:J})}function J(t,e,n){if(!Q(t))return;let r=e[t],o=n[t];R(r)&&R(o)?G(r,o):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=q(o))}let K={"":t=>t,x:t=>t.x,y:t=>t.y};function tt(t,e){let n=K[e]||(K[e]=function(t){let e=function(t){let e=t.split("."),n=[],r="";for(let t of e)(r+=t).endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}(t);return t=>{for(let n of e){if(""===n)break;t=t&&t[n]}return t}}(e));return n(t)}function te(t){return t.charAt(0).toUpperCase()+t.slice(1)}let tn=t=>void 0!==t,tr=t=>"function"==typeof t,to=(t,e)=>{if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0};function ta(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}let ti=Math.PI,ts=2*ti,tl=ts+ti,tc=Number.POSITIVE_INFINITY,tu=ti/180,tf=ti/2,tp=ti/4,th=2*ti/3,td=Math.log10,tg=Math.sign;function ty(t,e,n){return Math.abs(t-e)<n}function tm(t){let e=Math.round(t);t=ty(t,e,t/1e3)?e:t;let n=Math.pow(10,Math.floor(td(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function tb(t){let e;let n=[],r=Math.sqrt(t);for(e=1;e<r;e++)t%e==0&&(n.push(e),n.push(t/e));return r===(0|r)&&n.push(r),n.sort((t,e)=>t-e).pop(),n}function tv(t){return!isNaN(parseFloat(t))&&isFinite(t)}function tx(t,e){let n=Math.round(t);return n-e<=t&&n+e>=t}function tw(t,e,n){let r,o,a;for(r=0,o=t.length;r<o;r++)isNaN(a=t[r][n])||(e.min=Math.min(e.min,a),e.max=Math.max(e.max,a))}function tC(t){return t*(ti/180)}function tM(t){return t*(180/ti)}function t_(t){if(!B(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function tk(t,e){let n=e.x-t.x,r=e.y-t.y,o=Math.atan2(r,n);return o<-.5*ti&&(o+=ts),{angle:o,distance:Math.sqrt(n*n+r*r)}}function tz(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function tA(t,e){return(t-e+tl)%ts-ti}function tO(t){return(t%ts+ts)%ts}function tS(t,e,n,r){let o=tO(t),a=tO(e),i=tO(n),s=tO(a-o),l=tO(i-o),c=tO(o-a),u=tO(o-i);return o===a||o===i||r&&a===i||s>l&&c<u}function tT(t,e,n){return Math.max(e,Math.min(n,t))}function tE(t){return tT(t,-32768,32767)}function tD(t,e,n,r=1e-6){return t>=Math.min(e,n)-r&&t<=Math.max(e,n)+r}function tj(t,e,n){let r;n=n||(n=>t[n]<e);let o=t.length-1,a=0;for(;o-a>1;)n(r=a+o>>1)?a=r:o=r;return{lo:a,hi:o}}let tL=(t,e,n,r)=>tj(t,n,r?r=>{let o=t[r][e];return o<n||o===n&&t[r+1][e]===n}:r=>t[r][e]<n),tN=(t,e,n)=>tj(t,n,r=>t[r][e]>=n);function tP(t,e,n){let r=0,o=t.length;for(;r<o&&t[r]<e;)r++;for(;o>r&&t[o-1]>n;)o--;return r>0||o<t.length?t.slice(r,o):t}let tF=["push","pop","shift","splice","unshift"];function tR(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),tF.forEach(e=>{let n="_onData"+te(e),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){let o=r.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[n]&&t[n](...e)}),o}})})}function tB(t,e){let n=t._chartjs;if(!n)return;let r=n.listeners,o=r.indexOf(e);-1!==o&&r.splice(o,1),r.length>0||(tF.forEach(e=>{delete t[e]}),delete t._chartjs)}function tI(t){let e,n;let r=new Set;for(e=0,n=t.length;e<n;++e)r.add(t[e]);return r.size===n?t:Array.from(r)}let tH="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function tW(t,e){let n=[],r=!1;return function(...o){n=o,r||(r=!0,tH.call(window,()=>{r=!1,t.apply(e,n)}))}}function tZ(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}let tV=t=>"start"===t?"left":"end"===t?"right":"center",tU=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2,tY=(t,e,n,r)=>t===(r?"left":"right")?n:"center"===t?(e+n)/2:e;function tq(t,e,n){let r=e.length,o=0,a=r;if(t._sorted){let{iScale:i,_parsed:s}=t,l=i.axis,{min:c,max:u,minDefined:f,maxDefined:p}=i.getUserBounds();f&&(o=tT(Math.min(tL(s,i.axis,c).lo,n?r:tL(e,l,i.getPixelForValue(c)).lo),0,r-1)),a=p?tT(Math.max(tL(s,i.axis,u,!0).hi+1,n?0:tL(e,l,i.getPixelForValue(u),!0).hi+1),o,r)-o:r-o}return{start:o,count:a}}function tQ(t){let{xScale:e,yScale:n,_scaleRanges:r}=t,o={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!r)return t._scaleRanges=o,!0;let a=r.xmin!==e.min||r.xmax!==e.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,o),a}let t$=t=>0===t||1===t,tX=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*ts/n)),tG=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*ts/n)+1,tJ={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*tf)+1,easeOutSine:t=>Math.sin(t*tf),easeInOutSine:t=>-.5*(Math.cos(ti*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>t$(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(-Math.pow(2,-10*(2*t-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>t$(t)?t:tX(t,.075,.3),easeOutElastic:t=>t$(t)?t:tG(t,.075,.3),easeInOutElastic:t=>t$(t)?t:t<.5?.5*tX(2*t,.1125,.45):.5+.5*tG(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-tJ.easeOutBounce(1-t),easeOutBounce:t=>t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375,easeInOutBounce:t=>t<.5?.5*tJ.easeInBounce(2*t):.5*tJ.easeOutBounce(2*t-1)+.5};function tK(t){if(t&&"object"==typeof t){let e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function t0(t){return tK(t)?t:new j(t)}function t1(t){return tK(t)?t:new j(t).saturate(.5).darken(.1).hexString()}let t2=["x","y","borderWidth","radius","tension"],t5=["color","borderColor","backgroundColor"],t4=new Map;function t3(t,e,n){return(function(t,e){e=e||{};let n=t+JSON.stringify(e),r=t4.get(n);return r||(r=new Intl.NumberFormat(t,e),t4.set(n,r)),r})(e,n).format(t)}let t6={values:t=>F(t)?t:""+t,numeric(t,e,n){let r;if(0===t)return"0";let o=this.chart.options.locale,a=t;if(n.length>1){let e;let o=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(o<1e-4||o>1e15)&&(r="scientific"),Math.abs(e=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value)>=1&&t!==Math.floor(t)&&(e=t-Math.floor(t)),a=e}let i=td(Math.abs(a)),s=Math.max(Math.min(-1*Math.floor(i),20),0),l={notation:r,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),t3(t,o,l)},logarithmic(t,e,n){if(0===t)return"0";let r=n[e].significand||t/Math.pow(10,Math.floor(td(t)));return[1,2,3,5,10,15].includes(r)||e>.8*n.length?t6.numeric.call(this,t,e,n):""}};var t7={formatters:t6};let t8=Object.create(null),t9=Object.create(null);function et(t,e){if(!e)return t;let n=e.split(".");for(let e=0,r=n.length;e<r;++e){let r=n[e];t=t[r]||(t[r]=Object.create(null))}return t}function ee(t,e,n){return"string"==typeof e?X(et(t,e),n):X(et(t,""),e)}var en=new class{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>t1(e.backgroundColor),this.hoverBorderColor=(t,e)=>t1(e.borderColor),this.hoverColor=(t,e)=>t1(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return ee(this,t,e)}get(t){return et(this,t)}describe(t,e){return ee(t9,t,e)}override(t,e){return ee(t8,t,e)}route(t,e,n,r){let o=et(this,t),a=et(this,n),i="_"+e;Object.defineProperties(o,{[i]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){let t=this[i],e=a[r];return R(t)?Object.assign({},e,t):H(t,e)},set(t){this[i]=t}}})}apply(t){t.forEach(t=>t(this))}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:t5},numbers:{type:"number",properties:t2}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:t7.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function er(t,e,n,r,o){let a=e[o];return a||(a=e[o]=t.measureText(o).width,n.push(o)),a>r&&(r=a),r}function eo(t,e,n,r){let o,a,i,s,l;let c=(r=r||{}).data=r.data||{},u=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(c=r.data={},u=r.garbageCollect=[],r.font=e),t.save(),t.font=e;let f=0,p=n.length;for(o=0;o<p;o++)if(null!=(s=n[o])&&!0!==F(s))f=er(t,c,u,f,s);else if(F(s))for(a=0,i=s.length;a<i;a++)null==(l=s[a])||F(l)||(f=er(t,c,u,f,l));t.restore();let h=u.length/2;if(h>n.length){for(o=0;o<h;o++)delete c[u[o]];u.splice(0,h)}return f}function ea(t,e,n){let r=t.currentDevicePixelRatio,o=0!==n?Math.max(n/2,.5):0;return Math.round((e-o)*r)/r+o}function ei(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function es(t,e,n,r){el(t,e,n,r,null)}function el(t,e,n,r,o){let a,i,s,l,c,u,f,p;let h=e.pointStyle,d=e.rotation,g=e.radius,y=(d||0)*tu;if(h&&"object"==typeof h&&("[object HTMLImageElement]"===(a=h.toString())||"[object HTMLCanvasElement]"===a)){t.save(),t.translate(n,r),t.rotate(y),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),t.restore();return}if(!isNaN(g)&&!(g<=0)){switch(t.beginPath(),h){default:o?t.ellipse(n,r,o/2,g,0,0,ts):t.arc(n,r,g,0,ts),t.closePath();break;case"triangle":u=o?o/2:g,t.moveTo(n+Math.sin(y)*u,r-Math.cos(y)*g),y+=th,t.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*g),y+=th,t.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*g),t.closePath();break;case"rectRounded":c=.516*g,i=Math.cos(y+tp)*(l=g-c),f=Math.cos(y+tp)*(o?o/2-c:l),s=Math.sin(y+tp)*l,p=Math.sin(y+tp)*(o?o/2-c:l),t.arc(n-f,r-s,c,y-ti,y-tf),t.arc(n+p,r-i,c,y-tf,y),t.arc(n+f,r+s,c,y,y+tf),t.arc(n-p,r+i,c,y+tf,y+ti),t.closePath();break;case"rect":if(!d){l=Math.SQRT1_2*g,u=o?o/2:l,t.rect(n-u,r-l,2*u,2*l);break}y+=tp;case"rectRot":f=Math.cos(y)*(o?o/2:g),i=Math.cos(y)*g,s=Math.sin(y)*g,p=Math.sin(y)*(o?o/2:g),t.moveTo(n-f,r-s),t.lineTo(n+p,r-i),t.lineTo(n+f,r+s),t.lineTo(n-p,r+i),t.closePath();break;case"crossRot":y+=tp;case"cross":f=Math.cos(y)*(o?o/2:g),i=Math.cos(y)*g,s=Math.sin(y)*g,p=Math.sin(y)*(o?o/2:g),t.moveTo(n-f,r-s),t.lineTo(n+f,r+s),t.moveTo(n+p,r-i),t.lineTo(n-p,r+i);break;case"star":f=Math.cos(y)*(o?o/2:g),i=Math.cos(y)*g,s=Math.sin(y)*g,p=Math.sin(y)*(o?o/2:g),t.moveTo(n-f,r-s),t.lineTo(n+f,r+s),t.moveTo(n+p,r-i),t.lineTo(n-p,r+i),y+=tp,f=Math.cos(y)*(o?o/2:g),i=Math.cos(y)*g,s=Math.sin(y)*g,p=Math.sin(y)*(o?o/2:g),t.moveTo(n-f,r-s),t.lineTo(n+f,r+s),t.moveTo(n+p,r-i),t.lineTo(n-p,r+i);break;case"line":i=o?o/2:Math.cos(y)*g,s=Math.sin(y)*g,t.moveTo(n-i,r-s),t.lineTo(n+i,r+s);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(y)*(o?o/2:g),r+Math.sin(y)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function ec(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function eu(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function ef(t){t.restore()}function ep(t,e,n,r,o){if(!e)return t.lineTo(n.x,n.y);if("middle"===o){let r=(e.x+n.x)/2;t.lineTo(r,e.y),t.lineTo(r,n.y)}else"after"===o!=!!r?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function eh(t,e,n,r){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(r?e.cp1x:e.cp2x,r?e.cp1y:e.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function ed(t,e,n,r,o,a={}){var i;let s,l;let c=F(e)?e:[e],u=a.strokeWidth>0&&""!==a.strokeColor;for(t.save(),t.font=o.string,i=t,a.translation&&i.translate(a.translation[0],a.translation[1]),P(a.rotation)||i.rotate(a.rotation),a.color&&(i.fillStyle=a.color),a.textAlign&&(i.textAlign=a.textAlign),a.textBaseline&&(i.textBaseline=a.textBaseline),s=0;s<c.length;++s)l=c[s],a.backdrop&&function(t,e){let n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}(t,a.backdrop),u&&(a.strokeColor&&(t.strokeStyle=a.strokeColor),P(a.strokeWidth)||(t.lineWidth=a.strokeWidth),t.strokeText(l,n,r,a.maxWidth)),t.fillText(l,n,r,a.maxWidth),function(t,e,n,r,o){if(o.strikethrough||o.underline){let a=t.measureText(r),i=e-a.actualBoundingBoxLeft,s=e+a.actualBoundingBoxRight,l=n-a.actualBoundingBoxAscent,c=n+a.actualBoundingBoxDescent,u=o.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=o.decorationWidth||2,t.moveTo(i,u),t.lineTo(s,u),t.stroke()}}(t,n,r,l,a),r+=o.lineHeight;t.restore()}function eg(t,e){let{x:n,y:r,w:o,h:a,radius:i}=e;t.arc(n+i.topLeft,r+i.topLeft,i.topLeft,-tf,ti,!0),t.lineTo(n,r+a-i.bottomLeft),t.arc(n+i.bottomLeft,r+a-i.bottomLeft,i.bottomLeft,ti,tf,!0),t.lineTo(n+o-i.bottomRight,r+a),t.arc(n+o-i.bottomRight,r+a-i.bottomRight,i.bottomRight,tf,0,!0),t.lineTo(n+o,r+i.topRight),t.arc(n+o-i.topRight,r+i.topRight,i.topRight,0,-tf,!0),t.lineTo(n+i.topLeft,r)}let ey=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,em=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/,eb=t=>+t||0;function ev(t,e){let n={},r=R(e),o=r?Object.keys(e):e,a=R(t)?r?n=>H(t[n],t[e[n]]):e=>t[e]:()=>t;for(let t of o)n[t]=eb(a(t));return n}function ex(t){return ev(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ew(t){return ev(t,["topLeft","topRight","bottomLeft","bottomRight"])}function eC(t){let e=ex(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function eM(t,e){t=t||{},e=e||en.font;let n=H(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let r=H(t.style,e.style);r&&!(""+r).match(em)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);let o={family:H(t.family,e.family),lineHeight:function(t,e){let n=(""+t).match(ey);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}(H(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:H(t.weight,e.weight),string:""};return o.string=!o||P(o.size)||P(o.family)?null:(o.style?o.style+" ":"")+(o.weight?o.weight+" ":"")+o.size+"px "+o.family,o}function e_(t,e,n,r){let o,a,i,s=!0;for(o=0,a=t.length;o<a;++o)if(void 0!==(i=t[o])&&(void 0!==e&&"function"==typeof i&&(i=i(e),s=!1),void 0!==n&&F(i)&&(i=i[n%i.length],s=!1),void 0!==i))return r&&!s&&(r.cacheable=!1),i}function ek(t,e,n){let{min:r,max:o}=t,a=Z(e,(o-r)/2),i=(t,e)=>n&&0===t?0:t+e;return{min:i(r,-Math.abs(a)),max:i(o,a)}}function ez(t,e){return Object.assign(Object.create(t),e)}function eA(t,e=[""],n=t,r,o=()=>t[0]){tn(r)||(r=eN("_fallback",t));let a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:r,_getTarget:o,override:o=>eA([o,...t],e,n,r)};return new Proxy(a,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,r)=>eE(n,r,()=>(function(t,e,n,r){let o;for(let a of e)if(tn(o=eN(eS(a,t),n)))return eT(t,o)?ej(n,r,t,o):o})(r,e,t,n)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>eP(t).includes(e),ownKeys:t=>eP(t),set(t,e,n){let r=t._storage||(t._storage=o());return t[e]=r[e]=n,delete t._keys,!0}})}function eO(t,e={scriptable:!0,indexable:!0}){let{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:o=e.allKeys}=t;return{allKeys:o,scriptable:n,indexable:r,isScriptable:tr(n)?n:()=>n,isIndexable:tr(r)?r:()=>r}}let eS=(t,e)=>t?t+te(e):e,eT=(t,e)=>R(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function eE(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];let r=n();return t[e]=r,r}let eD=(t,e)=>!0===t?e:"string"==typeof t?tt(e,t):void 0;function ej(t,e,n,r){var o;let a=e._rootScopes,i=tr(o=e._fallback)?o(n,r):o,s=[...t,...a],l=new Set;l.add(r);let c=eL(l,s,n,i||n,r);return!(null===c||tn(i)&&i!==n&&null===(c=eL(l,s,i,c,r)))&&eA(Array.from(l),[""],a,i,()=>(function(t,e,n){let r=t._getTarget();e in r||(r[e]={});let o=r[e];return F(o)&&R(n)?n:o||{}})(e,n,r))}function eL(t,e,n,r,o){for(;n;)n=function(t,e,n,r,o){for(let i of e){let e=eD(n,i);if(e){var a;t.add(e);let i=tr(a=e._fallback)?a(n,o):a;if(tn(i)&&i!==n&&i!==r)return i}else if(!1===e&&tn(r)&&n!==r)return null}return!1}(t,e,n,r,o);return n}function eN(t,e){for(let n of e){if(!n)continue;let e=n[t];if(tn(e))return e}}function eP(t){let e=t._keys;return e||(e=t._keys=function(t){let e=new Set;for(let n of t)for(let t of Object.keys(n).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function eF(t,e,n,r){let o,a,i;let{iScale:s}=t,{key:l="r"}=this._parsing,c=Array(r);for(o=0;o<r;++o)i=e[a=o+n],c[o]={r:s.parse(tt(i,l),a)};return c}let eR=Number.EPSILON||1e-14,eB=(t,e)=>e<t.length&&!t[e].skip&&t[e],eI=t=>"x"===t?"y":"x";function eH(t,e,n){return Math.max(Math.min(t,n),e)}function eW(t,e,n,r,o){let a,i,s,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){let n,r,o;let a=eI(e),i=t.length,s=Array(i).fill(0),l=Array(i),c=eB(t,0);for(n=0;n<i;++n)if(r=o,o=c,c=eB(t,n+1),o){if(c){let t=c[e]-o[e];s[n]=0!==t?(c[a]-o[a])/t:0}l[n]=r?c?tg(s[n-1])!==tg(s[n])?0:(s[n-1]+s[n])/2:s[n-1]:s[n]}!function(t,e,n){let r,o,a,i,s;let l=t.length,c=eB(t,0);for(let u=0;u<l-1;++u)if(s=c,c=eB(t,u+1),s&&c){if(ty(e[u],0,eR)){n[u]=n[u+1]=0;continue}(i=Math.pow(r=n[u]/e[u],2)+Math.pow(o=n[u+1]/e[u],2))<=9||(a=3/Math.sqrt(i),n[u]=r*a*e[u],n[u+1]=o*a*e[u])}}(t,s,l),function(t,e,n="x"){let r,o,a;let i=eI(n),s=t.length,l=eB(t,0);for(let c=0;c<s;++c){if(o=a,a=l,l=eB(t,c+1),!a)continue;let s=a[n],u=a[i];o&&(r=(s-o[n])/3,a[`cp1${n}`]=s-r,a[`cp1${i}`]=u-r*e[c]),l&&(r=(l[n]-s)/3,a[`cp2${n}`]=s+r,a[`cp2${i}`]=u+r*e[c])}}(t,l,e)}(t,o);else{let n=r?t[t.length-1]:t[0];for(a=0,i=t.length;a<i;++a)l=function(t,e,n,r){let o=t.skip?e:t,a=n.skip?e:n,i=tz(e,o),s=tz(a,e),l=i/(i+s),c=s/(i+s);l=isNaN(l)?0:l,c=isNaN(c)?0:c;let u=r*l,f=r*c;return{previous:{x:e.x-u*(a.x-o.x),y:e.y-u*(a.y-o.y)},next:{x:e.x+f*(a.x-o.x),y:e.y+f*(a.y-o.y)}}}(n,s=t[a],t[Math.min(a+1,i-(r?0:1))%i],e.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,n=s}e.capBezierPoints&&function(t,e){let n,r,o,a,i;let s=ec(t[0],e);for(n=0,r=t.length;n<r;++n)i=a,a=s,s=n<r-1&&ec(t[n+1],e),a&&(o=t[n],i&&(o.cp1x=eH(o.cp1x,e.left,e.right),o.cp1y=eH(o.cp1y,e.top,e.bottom)),s&&(o.cp2x=eH(o.cp2x,e.left,e.right),o.cp2y=eH(o.cp2y,e.top,e.bottom)))}(t,n)}function eZ(){return"undefined"!=typeof window&&"undefined"!=typeof document}function eV(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function eU(t,e,n){let r;return"string"==typeof t?(r=parseInt(t,10),-1!==t.indexOf("%")&&(r=r/100*e.parentNode[n])):r=t,r}let eY=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),eq=["top","right","bottom","left"];function eQ(t,e,n){let r={};n=n?"-"+n:"";for(let o=0;o<4;o++){let a=eq[o];r[a]=parseFloat(t[e+"-"+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}let e$=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function eX(t,e){if("native"in t)return t;let{canvas:n,currentDevicePixelRatio:r}=e,o=eY(n),a="border-box"===o.boxSizing,i=eQ(o,"padding"),s=eQ(o,"border","width"),{x:l,y:c,box:u}=function(t,e){let n,r;let o=t.touches,a=o&&o.length?o[0]:t,{offsetX:i,offsetY:s}=a,l=!1;if(e$(i,s,t.target))n=i,r=s;else{let t=e.getBoundingClientRect();n=a.clientX-t.left,r=a.clientY-t.top,l=!0}return{x:n,y:r,box:l}}(t,n),f=i.left+(u&&s.left),p=i.top+(u&&s.top),{width:h,height:d}=e;return a&&(h-=i.width+s.width,d-=i.height+s.height),{x:Math.round((l-f)/h*n.width/r),y:Math.round((c-p)/d*n.height/r)}}let eG=t=>Math.round(10*t)/10;function eJ(t,e,n,r){let o=eY(t),a=eQ(o,"margin"),i=eU(o.maxWidth,t,"clientWidth")||tc,s=eU(o.maxHeight,t,"clientHeight")||tc,l=function(t,e,n){let r,o;if(void 0===e||void 0===n){let a=eV(t);if(a){let t=a.getBoundingClientRect(),i=eY(a),s=eQ(i,"border","width"),l=eQ(i,"padding");e=t.width-l.width-s.width,n=t.height-l.height-s.height,r=eU(i.maxWidth,a,"clientWidth"),o=eU(i.maxHeight,a,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:r||tc,maxHeight:o||tc}}(t,e,n),{width:c,height:u}=l;if("content-box"===o.boxSizing){let t=eQ(o,"border","width"),e=eQ(o,"padding");c-=e.width+t.width,u-=e.height+t.height}return c=Math.max(0,c-a.width),u=Math.max(0,r?c/r:u-a.height),c=eG(Math.min(c,i,l.maxWidth)),u=eG(Math.min(u,s,l.maxHeight)),c&&!u&&(u=eG(c/2)),(void 0!==e||void 0!==n)&&r&&l.height&&u>l.height&&(c=eG(Math.floor((u=l.height)*r))),{width:c,height:u}}function eK(t,e,n){let r=e||1,o=Math.floor(t.height*r),a=Math.floor(t.width*r);t.height=Math.floor(t.height),t.width=Math.floor(t.width);let i=t.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==r||i.height!==o||i.width!==a)&&(t.currentDevicePixelRatio=r,i.height=o,i.width=a,t.ctx.setTransform(r,0,0,r,0,0),!0)}let e0=function(){let t=!1;try{let e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function e1(t,e){let n=eY(t).getPropertyValue(e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function e2(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function e5(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:"middle"===r?n<.5?t.y:e.y:"after"===r?n<1?t.y:e.y:n>0?e.y:t.y}}function e4(t,e,n,r){let o={x:t.cp2x,y:t.cp2y},a={x:e.cp1x,y:e.cp1y},i=e2(t,o,n),s=e2(o,a,n),l=e2(a,e,n),c=e2(i,s,n),u=e2(s,l,n);return e2(c,u,n)}function e3(t,e,n){var r;return t?(r=n,{x:t=>e+e+r-t,setWidth(t){r=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function e6(t,e){let n,r;("ltr"===e||"rtl"===e)&&(r=[(n=t.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function e7(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function e8(t){return"angle"===t?{between:tS,compare:tA,normalize:tO}:{between:tD,compare:(t,e)=>t-e,normalize:t=>t}}function e9({start:t,end:e,count:n,loop:r,style:o}){return{start:t%n,end:e%n,loop:r&&(e-t+1)%n==0,style:o}}function nt(t,e,n){let r,o,a;if(!n)return[t];let{property:i,start:s,end:l}=n,c=e.length,{compare:u,between:f,normalize:p}=e8(i),{start:h,end:d,loop:g,style:y}=function(t,e,n){let r;let{property:o,start:a,end:i}=n,{between:s,normalize:l}=e8(o),c=e.length,{start:u,end:f,loop:p}=t;if(p){for(u+=c,f+=c,r=0;r<c&&s(l(e[u%c][o]),a,i);++r)u--,f--;u%=c,f%=c}return f<u&&(f+=c),{start:u,end:f,loop:p,style:t.style}}(t,e,n),m=[],b=!1,v=null,x=()=>f(s,a,r)&&0!==u(s,a),w=()=>0===u(l,r)||f(l,a,r),C=()=>b||x(),M=()=>!b||w();for(let t=h,n=h;t<=d;++t)(o=e[t%c]).skip||(r=p(o[i]))===a||(b=f(r,s,l),null===v&&C()&&(v=0===u(r,s)?t:n),null!==v&&M()&&(m.push(e9({start:v,end:t,loop:g,count:c,style:y})),v=null),n=t,a=r);return null!==v&&m.push(e9({start:v,end:d,loop:g,count:c,style:y})),m}function ne(t,e){let n=[],r=t.segments;for(let o=0;o<r.length;o++){let a=nt(r[o],t.points,e);a.length&&n.push(...a)}return n}function nn(t,e){let n=t.points,r=t.options.spanGaps,o=n.length;if(!o)return[];let a=!!t._loop,{start:i,end:s}=function(t,e,n,r){let o=0,a=e-1;if(n&&!r)for(;o<e&&!t[o].skip;)o++;for(;o<e&&t[o].skip;)o++;for(o%=e,n&&(a+=o);a>o&&t[a%e].skip;)a--;return a%=e,{start:o,end:a}}(n,o,a,r);if(!0===r)return nr(t,[{start:i,end:s,loop:a}],n,e);let l=!!t._fullLoop&&0===i&&s===o-1;return nr(t,function(t,e,n,r){let o;let a=t.length,i=[],s=e,l=t[e];for(o=e+1;o<=n;++o){let n=t[o%a];n.skip||n.stop?l.skip||(r=!1,i.push({start:e%a,end:(o-1)%a,loop:r}),e=s=n.stop?o:null):(s=o,l.skip&&(e=o)),l=n}return null!==s&&i.push({start:e%a,end:s%a,loop:r}),i}(n,i,s<i?s+o:s,l),n,e)}function nr(t,e,n,r){return r&&r.setContext&&n?function(t,e,n,r){let o=t._chart.getContext(),a=no(t.options),{_datasetIndex:i,options:{spanGaps:s}}=t,l=n.length,c=[],u=a,f=e[0].start,p=f;function h(t,e,r,o){let a=s?-1:1;if(t!==e){for(t+=l;n[t%l].skip;)t-=a;for(;n[e%l].skip;)e+=a;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:r,style:o}),u=o,f=e%l)}}for(let t of e){let e;let a=n[(f=s?f:t.start)%l];for(p=f+1;p<=t.end;p++){var d,g;let s=n[p%l];d=e=no(r.setContext(ez(o,{type:"segment",p0:a,p1:s,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:i}))),(g=u)&&JSON.stringify(d)!==JSON.stringify(g)&&h(f,p-1,t.loop,u),a=s,u=e}f<p-1&&h(f,p-1,t.loop,u)}return c}(t,e,n,r):e}function no(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}},86205:function(t,e,n){"use strict";/*!
|
|
* Chartkick.js v5.0.1
|
|
* Create beautiful charts with one line of JavaScript
|
|
* https://github.com/ankane/chartkick.js
|
|
* MIT License
|
|
*/function r(t){return"[object Array]"===Object.prototype.toString.call(t)}function o(t){return t instanceof Function}function a(t){return"[object Object]"===Object.prototype.toString.call(t)&&!o(t)&&t instanceof Object}function i(t,e){for(var n in e)"__proto__"!==n&&(a(e[n])||r(e[n])?(a(e[n])&&!a(t[n])&&(t[n]={}),r(e[n])&&!r(t[n])&&(t[n]=[]),i(t[n],e[n])):void 0!==e[n]&&(t[n]=e[n]))}function s(t,e){var n={};return i(n,t),i(n,e),n}n.d(e,{Z:function(){return ti}});var l=/^(\d\d\d\d)(?:-)?(\d\d)(?:-)?(\d\d)$/i;function c(t){return""+t}function u(t){return parseFloat(t)}function f(t){if(t instanceof Date)return t;if("number"==typeof t)return new Date(1e3*t);var e=""+t,n=e.match(l);if(n){var r=parseInt(n[1],10),o=parseInt(n[2],10)-1,a=parseInt(n[3],10);return new Date(r,o,a)}var i=e.replace(/ /,"T").replace(" ","").replace("UTC","Z");return new Date(Date.parse(i)||e)}function p(t){if(r(t))return t;var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push([n,t[n]]);return e}function h(t,e,n,r,o,a,i,l){return function(c,u,f){var p=c.data,h=s({},t);return h=s(h,f||{}),(c.singleSeriesFormat||"legend"in u)&&e(h,u.legend,c.singleSeriesFormat),u.title&&n(h,u.title),"min"in u?r(h,u.min):!function(t){for(var e=0;e<t.length;e++)for(var n=t[e].data,r=0;r<n.length;r++)if(n[r][1]<0)return!0;return!1}(p)&&r(h,0),u.max&&o(h,u.max),"stacked"in u&&a(h,u.stacked),u.colors&&(h.colors=u.colors),u.xtitle&&i(h,u.xtitle),u.ytitle&&l(h,u.ytitle),h=s(h,u.library||{})}}function d(t,e){return t[0].getTime()-e[0].getTime()}function g(t,e){return t[0]-e[0]}function y(t,e){return t-e}function m(t,e){for(var n=0;n<t.length;n++)if(!e(t[n]))return!1;return!0}function b(t,e){if(void 0===e&&(e=!1),0===t.length||!m(t,function(t){return 0===t.getMilliseconds()&&0===t.getSeconds()}))return null;if(!m(t,function(t){return 0===t.getMinutes()}))return"minute";if(!m(t,function(t){return 0===t.getHours()}))return"hour";if(e)return"day";if(!m(t,function(t){return 1===t.getDate()})){var n=t[0].getDay();return m(t,function(t){return t.getDay()===n})?"week":"day"}return m(t,function(t){return 0===t.getMonth()})?"year":"month"}function v(t){return!isNaN(f(t))&&(""+t).length>=6}function x(t){return"number"==typeof t}var w=["bytes","KB","MB","GB","TB","PB","EB"];function C(t,e,n,r){t=t||"",n.prefix&&(e<0&&(e*=-1,t+="-"),t+=n.prefix);var o=n.suffix||"",a=n.precision,i=n.round;if(n.byteScale){var s,l=e>=0;l||(e*=-1);var c=r?n.byteScale:e;c>=0x1000000000000000?(e/=0x1000000000000000,s=6):c>=0x4000000000000?(e/=0x4000000000000,s=5):c>=1099511627776?(e/=1099511627776,s=4):c>=1073741824?(e/=1073741824,s=3):c>=1048576?(e/=1048576,s=2):c>=1024?(e/=1024,s=1):s=0,void 0===a&&void 0===i&&(e>=1023.5&&s<w.length-1&&(e=1,s+=1),a=e>=1e3?4:3),o=" "+w[s],l||(e*=-1)}if(void 0!==a&&void 0!==i)throw Error("Use either round or precision, not both");if(!r&&(void 0===a||(e=e.toPrecision(a),n.zeros||(e=parseFloat(e))),void 0!==i)){if(i<0){var u=Math.pow(10,-1*i);e=parseInt((1*e/u).toFixed(0))*u}else e=e.toFixed(i),n.zeros||(e=parseFloat(e))}if(n.thousands||n.decimal){var f=(e=""+e).split(".");e=f[0],n.thousands&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousands)),f.length>1&&(e+=(n.decimal||".")+f[1])}return t+e+o}function M(t,e,n){return n in e?e[n]:n in t.options?t.options[n]:null}var _={maintainAspectRatio:!1,animation:!1,plugins:{legend:{},tooltip:{displayColors:!1,callbacks:{}},title:{font:{size:20},color:"#333"}},interaction:{}},k={scales:{y:{ticks:{maxTicksLimit:4},title:{font:{size:16},color:"#333"},grid:{}},x:{grid:{drawOnChartArea:!1},title:{font:{size:16},color:"#333"},time:{},ticks:{}}}},z=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#651067"];function A(t,e,n){void 0!==e?(t.plugins.legend.display=!!e,e&&!0!==e&&(t.plugins.legend.position=e)):n&&(t.plugins.legend.display=!1)}function O(t,e){t.plugins.title.display=!0,t.plugins.title.text=e}function S(t,e){null!==e&&(t.scales.x.min=u(e))}function T(t,e){t.scales.x.max=u(e)}function E(t,e){t.scales.x.stacked=!!e,t.scales.y.stacked=!!e}function D(t,e){t.scales.x.title.display=!0,t.scales.x.title.text=e}function j(t,e){t.scales.y.title.display=!0,t.scales.y.title.text=e}function L(t,e){var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?"rgba("+parseInt(n[1],16)+", "+parseInt(n[2],16)+", "+parseInt(n[3],16)+", "+e+")":t}function N(t){return null!=t}function P(t,e,n){var r={thousands:t.options.thousands,decimal:t.options.decimal},o=s({prefix:t.options.prefix,suffix:t.options.suffix,precision:t.options.precision,round:t.options.round,zeros:t.options.zeros},r);if(t.options.bytes){var a=t.data;"pie"===n&&(a=[{data:a}]),o.byteScale=function(t){for(var e=1,n=function(t){for(var e=0,n=0;n<t.length;n++)for(var r=t[n].data,o=0;o<r.length;o++){var a=Math.abs(r[o][1]);a>e&&(e=a)}return e}(t);n>=1024;)e*=1024,n/=1024;return e}(a)}if("pie"!==n){var i=e.scales.y;"bar"===n&&(i=e.scales.x),o.byteScale&&(i.ticks.stepSize||(i.ticks.stepSize=o.byteScale/2),i.ticks.maxTicksLimit||(i.ticks.maxTicksLimit=4)),i.ticks.callback||(i.ticks.callback=function(t){return C("",t,o,!0)}),"scatter"!==n&&"bubble"!==n||e.scales.x.ticks.callback||(e.scales.x.ticks.callback=function(t){return C("",t,r,!0)})}if(!e.plugins.tooltip.callbacks.label){if("scatter"===n)e.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";e&&(e+=": ");var n=t.parsed;return e+"("+C("",n.x,r)+", "+C("",n.y,o)+")"};else if("bubble"===n)e.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";e&&(e+=": ");var n=t.raw;return e+"("+C("",n.x,r)+", "+C("",n.y,o)+", "+C("",n.v,r)+")"};else if("pie"===n)e.plugins.tooltip.callbacks.label=function(t){return C("",t.parsed,o)};else{var l="bar"===n?"x":"y";e.plugins.tooltip.callbacks.label=function(t){if(null!==t.parsed[l]){var e=t.dataset.label||"";return e&&(e+=": "),C(e,t.parsed[l],o)}}}}"line"!==n&&"area"!==n||"number"!==t.xtype||(e.scales.x.ticks.callback||(e.scales.x.ticks.callback=function(t){return""+t}),e.plugins.tooltip.callbacks.title||(e.plugins.tooltip.callbacks.title=function(t){return""+t[0].parsed.x}))}var F=h(s(_,k),A,O,function(t,e){null!==e&&(t.scales.y.min=u(e))},function(t,e){t.scales.y.max=u(e)},E,D,j);function R(t,e,n){for(var o="bubble"===n?function(t){for(var e=t.data,n=[],r=function(t){for(var e=0,n=0;n<t.length;n++)for(var r=t[n].data,o=0;o<r.length;o++){var a=r[o][2];a>e&&(e=a)}return e}(e),o=0;o<e.length;o++){for(var a=e[o].data,i=[],s=0;s<a.length;s++){var l=a[s];i.push({x:l[0],y:l[1],r:20*l[2]/r,v:l[2]})}n.push(i)}return{labels:[],values:n}}(t):"number"===t.xtype&&"bar"!==n&&"column"!==n?function(t){for(var e=t.data,n=[],r=0;r<e.length;r++){var o=e[r].data;o.sort(g);for(var a=[],i=0;i<o.length;i++){var s=o[i];a.push({x:s[0],y:s[1]})}n.push(a)}return{labels:[],values:n}}(t):function(t){for(var e=t.data,n={},r=[],o=[],a=[],i=0;i<e.length;i++)for(var s=e[i].data,l=0;l<s.length;l++){var c=s[l],u="datetime"===t.xtype?c[0].getTime():c[0];n[u]||(n[u]=Array(e.length),r.push(u)),n[u][i]=c[1]}("datetime"===t.xtype||"number"===t.xtype)&&r.sort(y);for(var f=0;f<e.length;f++)a.push([]);for(var p=0;p<r.length;p++){var h=r[p],d="datetime"===t.xtype?new Date(h):h;o.push(d);for(var g=n[h],m=0;m<e.length;m++){var b=g[m];a[m].push(void 0===b?null:b)}}return{labels:o,values:a}}(t),a=o.labels,i=o.values,l=t.data,c=[],u=t.options.colors||z,p=0;p<l.length;p++){var h=l[p],d=void 0,m=void 0;if(t.options.colors&&t.singleSeriesFormat&&("bar"===n||"column"===n)&&!h.color&&r(t.options.colors)&&!r(t.options.colors[0])){d=u,m=[];for(var v=0;v<u.length;v++)m[v]=L(d[v],.5)}else d=h.color||u[p],m="line"!==n?L(d,.5):d;var x={label:h.name||"",data:i[p],fill:"area"===n,borderColor:d,backgroundColor:m,borderWidth:2},w="line"===n||"area"===n||"scatter"===n||"bubble"===n;w&&(x.pointBackgroundColor=d,x.pointHoverBackgroundColor=d,x.pointHitRadius=50),"bubble"===n&&(x.pointBackgroundColor=m,x.pointHoverBackgroundColor=m,x.pointHoverBorderWidth=2),h.stack&&(x.stack=h.stack),!1===M(t,h,"curve")?x.tension=0:w&&(x.tension=.4),!1===M(t,h,"points")&&(x.pointRadius=0,x.pointHoverRadius=0),x=s(x,t.options.dataset||{}),x=s(x,h.library||{}),x=s(x,h.dataset||{}),c.push(x)}var C=t.options.xmin,_=t.options.xmax;if("datetime"===t.xtype?(N(C)&&(e.scales.x.min=f(C).getTime()),N(_)&&(e.scales.x.max=f(_).getTime())):"number"===t.xtype&&(N(C)&&(e.scales.x.min=C),N(_)&&(e.scales.x.max=_)),"datetime"===t.xtype){var k=b(a);if(0===a.length&&(N(C)&&a.push(f(C)),N(_)&&a.push(f(_))),a.length>0){for(var A,O=(N(C)?f(C):a[0]).getTime(),S=(N(_)?f(_):a[0]).getTime(),T=1;T<a.length;T++){var E=a[T].getTime();E<O&&(O=E),E>S&&(S=E)}var D=(S-O)/864e5;if(!e.scales.x.time.unit&&("year"===k||D>3650?(e.scales.x.time.unit="year",A=365):"month"===k||D>300?(e.scales.x.time.unit="month",A=30):"week"===k||"day"===k||D>10?(e.scales.x.time.unit="day",A=1):"hour"===k||D>.5?(e.scales.x.time.displayFormats={hour:"MMM d, h a"},e.scales.x.time.unit="hour",A=1/24):"minute"===k&&(e.scales.x.time.displayFormats={minute:"h:mm a"},e.scales.x.time.unit="minute",A=1/24/60),A&&D>0)){var j=t.element.offsetWidth;if(j>0){var P=Math.ceil(D/A/(j/100));"week"===k&&1===A&&(P=7*Math.ceil(P/7)),e.scales.x.ticks.stepSize=P}}e.scales.x.time.tooltipFormat||("year"===k?e.scales.x.time.tooltipFormat="yyyy":"month"===k?e.scales.x.time.tooltipFormat="MMM yyyy":"week"===k||"day"===k?e.scales.x.time.tooltipFormat="PP":"hour"===k?e.scales.x.time.tooltipFormat="MMM d, h a":"minute"!==k||(e.scales.x.time.tooltipFormat="h:mm a"))}}return{labels:a,datasets:c}}var B=function(t){this.name="chartjs",this.library=t};B.prototype.renderLineChart=function(t,e){e||(e="line");var n=F(t,s({},t.options));P(t,n,e);var r=R(t,n,e);"number"===t.xtype?(n.scales.x.type=n.scales.x.type||"linear",n.scales.x.position=n.scales.x.position||"bottom"):n.scales.x.type="string"===t.xtype?"category":"time",this.drawChart(t,"line",r,n)},B.prototype.renderPieChart=function(t){var e=s({},_);t.options.donut&&(e.cutout="50%"),"legend"in t.options&&A(e,t.options.legend),t.options.title&&O(e,t.options.title),e=s(e,t.options.library||{}),P(t,e,"pie");for(var n=[],r=[],o=0;o<t.data.length;o++){var a=t.data[o];n.push(a[0]),r.push(a[1])}var i={data:r,backgroundColor:t.options.colors||z},l={labels:n,datasets:[i=s(i,t.options.dataset||{})]};this.drawChart(t,"pie",l,e)},B.prototype.renderColumnChart=function(t,e){if("bar"===e){var n,r,o,a=s(_,k);a.indexAxis="y",a.scales.x.grid.drawOnChartArea=!0,a.scales.y.grid.drawOnChartArea=!1,delete a.scales.y.ticks.maxTicksLimit,o=h(a,A,O,S,T,E,D,j)(t,t.options)}else o=F(t,t.options);P(t,o,e);var i=R(t,o,"column");"bar"!==e&&(n=o,(r=Math.ceil(t.element.offsetWidth/4/i.labels.length))>25?r=25:r<10&&(r=10),n.scales.x.ticks.callback||(n.scales.x.ticks.callback=function(t){return(t=""+this.getLabelForValue(t)).length>r?t.substring(0,r-2)+"...":t})),"mode"in o.interaction||(o.interaction.mode="index"),this.drawChart(t,"bar",i,o)},B.prototype.renderAreaChart=function(t){this.renderLineChart(t,"area")},B.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},B.prototype.renderScatterChart=function(t,e){e=e||"scatter";var n=F(t,t.options);P(t,n,e),"showLine"in n||(n.showLine=!1);var r=R(t,n,e);n.scales.x.type=n.scales.x.type||"linear",n.scales.x.position=n.scales.x.position||"bottom","mode"in n.interaction||(n.interaction.mode="nearest"),this.drawChart(t,e,r,n)},B.prototype.renderBubbleChart=function(t){this.renderScatterChart(t,"bubble")},B.prototype.destroy=function(t){t.chart&&t.chart.destroy()},B.prototype.drawChart=function(t,e,n,r){if(this.destroy(t),!t.destroyed){var o={type:e,data:n,options:r};t.options.code&&window.console.log("new Chart(ctx, "+JSON.stringify(o)+");"),t.element.innerHTML="<canvas></canvas>";var a=t.element.getElementsByTagName("CANVAS")[0];t.chart=new this.library(a,o)}};var I={chart:{},xAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},title:{text:null},credits:{enabled:!1},legend:{borderWidth:0},tooltip:{style:{fontSize:"12px"}},plotOptions:{areaspline:{},area:{},series:{marker:{}}},time:{useUTC:!1}};function H(t,e,n){void 0!==e?(t.legend.enabled=!!e,e&&!0!==e&&("top"===e||"bottom"===e?t.legend.verticalAlign=e:(t.legend.layout="vertical",t.legend.verticalAlign="middle",t.legend.align=e))):n&&(t.legend.enabled=!1)}function W(t,e){t.title.text=e}var Z=h(I,H,W,function(t,e){t.yAxis.min=e},function(t,e){t.yAxis.max=e},function(t,e){var n=e?!0===e?"normal":e:null;t.plotOptions.series.stacking=n,t.plotOptions.area.stacking=n,t.plotOptions.areaspline.stacking=n},function(t,e){t.xAxis.title.text=e},function(t,e){t.yAxis.title.text=e});function V(t,e,n){var o={prefix:t.options.prefix,suffix:t.options.suffix,thousands:t.options.thousands,decimal:t.options.decimal,precision:t.options.precision,round:t.options.round,zeros:t.options.zeros};"pie"===n||r(e.yAxis)||e.yAxis.labels.formatter||(e.yAxis.labels.formatter=function(){return C("",this.value,o)}),e.tooltip.pointFormatter||e.tooltip.pointFormat||(e.tooltip.pointFormatter=function(){return'<span style="color:'+this.color+'">●</span> '+C(this.series.name+": <b>",this.y,o)+"</b><br/>"})}var U=function(t){this.name="highcharts",this.library=t};U.prototype.renderLineChart=function(t,e){var n={};"areaspline"===(e=e||"spline")&&(n={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===t.options.curve&&("areaspline"===e?e="area":"spline"===e&&(e="line"));var r=Z(t,t.options,n);"number"===t.xtype?r.xAxis.type=r.xAxis.type||"linear":r.xAxis.type="string"===t.xtype?"category":"datetime",r.chart.type||(r.chart.type=e),V(t,r,e);for(var o=t.data,a=0;a<o.length;a++){o[a].name=o[a].name||"Value";var i=o[a].data;if("datetime"===t.xtype)for(var s=0;s<i.length;s++)i[s][0]=i[s][0].getTime();else"number"===t.xtype&&i.sort(g);o[a].marker={symbol:"circle"},!1===t.options.points&&(o[a].marker.enabled=!1)}this.drawChart(t,o,r)},U.prototype.renderScatterChart=function(t){var e=Z(t,t.options,{});e.chart.type="scatter",this.drawChart(t,t.data,e)},U.prototype.renderPieChart=function(t){var e=s(I,{});t.options.colors&&(e.colors=t.options.colors),t.options.donut&&(e.plotOptions={pie:{innerSize:"50%"}}),"legend"in t.options&&H(e,t.options.legend),t.options.title&&W(e,t.options.title);var n=s(e,t.options.library||{});V(t,n,"pie");var r=[{type:"pie",name:t.options.label||"Value",data:t.data}];this.drawChart(t,r,n)},U.prototype.renderColumnChart=function(t,e){e=e||"column";var n=t.data,r=Z(t,t.options),o=[],a=[];r.chart.type=e,V(t,r,e);for(var i=0;i<n.length;i++)for(var s=n[i],l=0;l<s.data.length;l++){var c=s.data[l];o[c[0]]||(o[c[0]]=Array(n.length),a.push(c[0])),o[c[0]][i]=c[1]}"number"===t.xtype&&a.sort(y),r.xAxis.categories=a;for(var u=[],f=0;f<n.length;f++){for(var p=[],h=0;h<a.length;h++)p.push(o[a[h]][f]||0);var d={name:n[f].name||"Value",data:p};n[f].stack&&(d.stack=n[f].stack),u.push(d)}this.drawChart(t,u,r)},U.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},U.prototype.renderAreaChart=function(t){this.renderLineChart(t,"areaspline")},U.prototype.destroy=function(t){t.chart&&t.chart.destroy()},U.prototype.drawChart=function(t,e,n){this.destroy(t),t.destroyed||(n.chart.renderTo=t.element.id,n.series=e,t.options.code&&window.console.log("new Highcharts.Chart("+JSON.stringify(n)+");"),t.chart=new this.library.Chart(n))};var Y={},q=[],Q={chartArea:{},fontName:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",pointSize:6,legend:{textStyle:{fontSize:12,color:"#444"},alignment:"center",position:"right"},curveType:"function",hAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},gridlines:{color:"transparent"},baselineColor:"#ccc",viewWindow:{}},vAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},baselineColor:"#ccc",viewWindow:{}},tooltip:{textStyle:{color:"#666",fontSize:12}}};function $(t,e,n){void 0!==e?t.legend.position=e?!0===e?"right":e:"none":n&&(t.legend.position="none")}function X(t,e){t.title=e,t.titleTextStyle={color:"#333",fontSize:"20px"}}function G(t,e){t.hAxis.viewWindow.min=e}function J(t,e){t.hAxis.viewWindow.max=e}function K(t,e){t.isStacked=e||!1}function tt(t,e){t.hAxis.title=e,t.hAxis.titleTextStyle.italic=!1}function te(t,e){t.vAxis.title=e,t.vAxis.titleTextStyle.italic=!1}var tn=h(Q,$,X,function(t,e){t.vAxis.viewWindow.min=e},function(t,e){t.vAxis.viewWindow.max=e},K,tt,te),tr=function(t){this.name="google",this.library=t};tr.prototype.renderLineChart=function(t){var e=this;this.waitForLoaded(t,function(){var n={};!1===t.options.curve&&(n.curveType="none"),!1===t.options.points&&(n.pointSize=0);var r=tn(t,t.options,n),o=e.createDataTable(t.data,t.xtype);e.drawChart(t,"LineChart",o,r)})},tr.prototype.renderPieChart=function(t){var e=this;this.waitForLoaded(t,function(){var n={chartArea:{top:"10%",height:"80%"},legend:{}};t.options.colors&&(n.colors=t.options.colors),t.options.donut&&(n.pieHole=.5),"legend"in t.options&&$(n,t.options.legend),t.options.title&&X(n,t.options.title);var r=s(s(Q,n),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn("string",""),o.addColumn("number","Value"),o.addRows(t.data),e.drawChart(t,"PieChart",o,r)})},tr.prototype.renderColumnChart=function(t){var e=this;this.waitForLoaded(t,function(){var n=tn(t,t.options),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"ColumnChart",r,n)})},tr.prototype.renderBarChart=function(t){var e=this;this.waitForLoaded(t,function(){var n=h(Q,$,X,G,J,K,tt,te)(t,t.options,{hAxis:{gridlines:{color:"#ccc"}}}),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"BarChart",r,n)})},tr.prototype.renderAreaChart=function(t){var e=this;this.waitForLoaded(t,function(){var n=tn(t,t.options,{isStacked:!0,pointSize:0,areaOpacity:.5}),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"AreaChart",r,n)})},tr.prototype.renderGeoChart=function(t){var e=this;this.waitForLoaded(t,"geochart",function(){var n=s(s(Q,{legend:"none",colorAxis:{colors:t.options.colors||["#f6c7b6","#ce502d"]}}),t.options.library||{}),r=new e.library.visualization.DataTable;r.addColumn("string",""),r.addColumn("number",t.options.label||"Value"),r.addRows(t.data),e.drawChart(t,"GeoChart",r,n)})},tr.prototype.renderScatterChart=function(t){var e=this;this.waitForLoaded(t,function(){for(var n=tn(t,t.options,{}),r=t.data,o=[],a=0;a<r.length;a++){r[a].name=r[a].name||"Value";for(var i=r[a].data,s=0;s<i.length;s++){var l=Array(r.length+1);l[0]=i[s][0],l[a+1]=i[s][1],o.push(l)}}var c=new e.library.visualization.DataTable;c.addColumn("number","");for(var u=0;u<r.length;u++)c.addColumn("number",r[u].name);c.addRows(o),e.drawChart(t,"ScatterChart",c,n)})},tr.prototype.renderTimeline=function(t){var e=this;this.waitForLoaded(t,"timeline",function(){var n={legend:"none"};t.options.colors&&(n.colors=t.options.colors);var r=s(s(Q,n),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn({type:"string",id:"Name"}),o.addColumn({type:"date",id:"Start"}),o.addColumn({type:"date",id:"End"}),o.addRows(t.data),t.element.style.lineHeight="normal",e.drawChart(t,"Timeline",o,r)})},tr.prototype.destroy=function(t){t.chart&&t.chart.clearChart()},tr.prototype.drawChart=function(t,e,n,r){var o;this.destroy(t),t.destroyed||(t.options.code&&window.console.log("var data = new google.visualization.DataTable("+n.toJSON()+");\nvar chart = new google.visualization."+e+"(element);\nchart.draw(data, "+JSON.stringify(r)+");"),t.chart=new this.library.visualization[e](t.element),o=function(){t.chart.draw(n,r)},window.attachEvent?window.attachEvent("onresize",o):window.addEventListener&&window.addEventListener("resize",o,!0),o())},tr.prototype.waitForLoaded=function(t,e,n){var r=this;if(n||(n=e,e="corechart"),q.push({pack:e,callback:n}),Y[e])this.runCallbacks();else{Y[e]=!0;var o={packages:[e],callback:function(){r.runCallbacks()}},a=t.__config();a.language&&(o.language=a.language),"geochart"===e&&a.mapsApiKey&&(o.mapsApiKey=a.mapsApiKey),this.library.charts.load("current",o)}},tr.prototype.runCallbacks=function(){for(var t=0;t<q.length;t++){var e=q[t];this.library.visualization&&("corechart"===e.pack&&this.library.visualization.LineChart||"timeline"===e.pack&&this.library.visualization.Timeline||"geochart"===e.pack&&this.library.visualization.GeoChart)&&(e.callback(),q.splice(t,1),t--)}},tr.prototype.createDataTable=function(t,e){for(var n,r=[],o=[],a=0;a<t.length;a++){var i=t[a];t[a].name=t[a].name||"Value";for(var s=0;s<i.data.length;s++){var l=i.data[s],c="datetime"===e?l[0].getTime():l[0];r[c]||(r[c]=Array(t.length),o.push(c)),r[c][a]=l[1]}}for(var u=[],f=[],p=0;p<o.length;p++){var h=o[p],y=void 0;"datetime"===e?(y=new Date(h),f.push(y)):y=h,u.push([y].concat(r[h]))}var m=!0;if("datetime"===e)u.sort(d),m="day"===(n=b(f,!0))||"week"===n||"month"===n||"year"===n;else if("number"===e){u.sort(g);for(var v=0;v<u.length;v++)u[v][0]=""+u[v][0];e="string"}var x=new this.library.visualization.DataTable;e="datetime"===e&&m?"date":e,x.addColumn(e,"");for(var w=0;w<t.length;w++)x.addColumn("number",t[w].name);return x.addRows(u),x};var to=[];function ta(t){for(var e=function(t){if(t){if("Highcharts"===t.product)return U;if(t.charts)return tr;if(o(t))return B}throw Error("Unknown adapter")}(t),n=0;n<to.length;n++)if(to[n].library===t)return;to.push(new e(t))}var ti={charts:{},configure:function(t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(ti.config[e]=t[e])},setDefaultOptions:function(t){ti.options=t},eachChart:function(t){for(var e in ti.charts)Object.prototype.hasOwnProperty.call(ti.charts,e)&&t(ti.charts[e])},destroyAll:function(){for(var t in ti.charts)Object.prototype.hasOwnProperty.call(ti.charts,t)&&(ti.charts[t].destroy(),delete ti.charts[t])},config:{},options:{},adapters:to,addAdapter:ta,use:function(t){return ta(t),ti}};function ts(t,e){for(var n=0;n<t.length;n++)for(var r=p(t[n].data),o=0;o<r.length;o++)if(!e(r[o][0]))return!1;return!0}function tl(t,e,n){var o,i=t.options,s=t.rawData;t.singleSeriesFormat=!r(s)||!a(s[0]),t.singleSeriesFormat&&(s=[{name:i.label,data:s}]),s=function(t){for(var e=[],n=0;n<t.length;n++){var r={};for(var o in t[n])Object.prototype.hasOwnProperty.call(t[n],o)&&(r[o]=t[n][o]);e.push(r)}return e}(s);for(var l=0;l<s.length;l++)s[l].data=p(s[l].data);t.xtype=e||(i.discrete?"string":tu(o=s)?(i.xmin||i.xmax)&&(!i.xmin||v(i.xmin))&&(!i.xmax||v(i.xmax))?"datetime":"number":ts(o,x)?"number":!n&&ts(o,v)?"datetime":"string");for(var h=0;h<s.length;h++)s[h].data=function(t,e){if("bubble"===e)return function(t){for(var e=[],n=0;n<t.length;n++)e.push([u(t[n][0]),u(t[n][1]),u(t[n][2])]);return e}(t);n="number"===e?u:"datetime"===e?f:c;for(var n,r=[],o=0;o<t.length;o++)r.push([n(t[o][0]),u(t[o][1])]);return r}(s[h].data,t.xtype);return s}function tc(t){for(var e=p(t.rawData),n=0;n<e.length;n++)e[n]=[""+e[n][0],u(e[n][1])];return e}function tu(t,e){if("PieChart"===e||"GeoChart"===e||"Timeline"===e)return 0===t.length;for(var n=0;n<t.length;n++)if(t[n].data.length>0)return!1;return!0}var tf=[],tp=0;function th(t,e){t.textContent=e}function td(t,e,n){n||(e="Error Loading Chart: "+e),th(t,e),t.style.color="#ff0000"}function tg(t){try{t.__render()}catch(e){throw td(t.element,e.message),e}}function ty(t,e,n){if(n&&t.options.loading&&("string"==typeof e||"function"==typeof e)&&th(t.element,t.options.loading),"string"==typeof e)tf.push([e,function(e){t.rawData=e,tg(t)},function(e){td(t.element,e)}]),function t(){if(tp<4){var e,n,r,o,a=tf.shift();a&&(tp++,e=a[0],n=a[1],r=a[2],(o=new XMLHttpRequest).open("GET",e,!0),o.setRequestHeader("Content-Type","application/json"),o.onload=function(){tp--,t(),200===o.status?n(JSON.parse(o.responseText)):r(o.statusText)},o.send(),t())}}();else if("function"==typeof e)try{e(function(e){t.rawData=e,tg(t)},function(e){td(t.element,e,!0)})}catch(e){td(t.element,e,!0)}else t.rawData=e,tg(t)}var tm=function(t,e,n){this.element=function(t){if("string"==typeof t){var e=t;if(!(t=document.getElementById(t)))throw Error("No element with id "+e)}return t}(t),this.options=s(ti.options,n||{}),this.dataSource=e,this.element.id&&(ti.charts[this.element.id]=this),ty(this,e,!0),this.options.refresh&&this.startRefresh()};tm.prototype.getElement=function(){return this.element},tm.prototype.getDataSource=function(){return this.dataSource},tm.prototype.getData=function(){return this.data},tm.prototype.getOptions=function(){return this.options},tm.prototype.getChartObject=function(){return this.chart},tm.prototype.getAdapter=function(){return this.adapter},tm.prototype.updateData=function(t,e){this.dataSource=t,e&&this.__updateOptions(e),ty(this,t,!0)},tm.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()},tm.prototype.redraw=function(){ty(this,this.rawData)},tm.prototype.refreshData=function(){if("string"==typeof this.dataSource){var t=-1===this.dataSource.indexOf("?")?"?":"&";ty(this,this.dataSource+t+"_="+new Date().getTime())}else"function"==typeof this.dataSource&&ty(this,this.dataSource)},tm.prototype.startRefresh=function(){var t=this,e=this.options.refresh;if(e&&"string"!=typeof this.dataSource&&"function"!=typeof this.dataSource)throw Error("Data source must be a URL or callback for refresh");if(!this.intervalId){if(e)this.intervalId=setInterval(function(){t.refreshData()},1e3*e);else throw Error("No refresh interval")}},tm.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},tm.prototype.toImage=function(t){if("chartjs"===this.adapter){if(!t||!t.background||"transparent"===t.background)return this.chart.toBase64Image();var e=this.chart.canvas,n=this.chart.ctx,r=document.createElement("canvas"),o=r.getContext("2d");return r.width=n.canvas.width,r.height=n.canvas.height,o.fillStyle=t.background,o.fillRect(0,0,r.width,r.height),o.drawImage(e,0,0),r.toDataURL("image/png")}throw Error("Feature only available for Chart.js")},tm.prototype.destroy=function(){this.destroyed=!0,this.stopRefresh(),this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&this.element.removeEventListener("mouseover",this.__enterEvent),this.__leaveEvent&&this.element.removeEventListener("mouseout",this.__leaveEvent)},tm.prototype.__updateOptions=function(t){var e=t.refresh&&t.refresh!==this.options.refresh;this.options=s(ti.options,t),e&&(this.stopRefresh(),this.startRefresh())},tm.prototype.__render=function(){this.data=this.__processData(),function(t,e){if(tu(e.data,t)){var n,r,a,i,s,l=e.options.empty||e.options.messages&&e.options.messages.empty||"No data";th(e.element,l)}else(function(t,e){var n="render"+t,r=e.options.adapter;"Chart"in window&&ta(window.Chart),"Highcharts"in window&&ta(window.Highcharts),window.google&&window.google.charts&&ta(window.google);for(var a=0;a<to.length;a++){var i=to[a];if((!r||r===i.name)&&o(i[n]))return e.adapter=i.name,e.__adapterObject=i,i[n](e)}if(to.length>0)throw Error("No charting library found for "+t);throw Error("No charting libraries found - be sure to include one before your charts")})(t,e),e.options.download&&!e.__downloadAttached&&"chartjs"===e.adapter&&(!0===(r=(n=e).options.download)?r={}:"string"==typeof r&&(r={filename:r}),(a=document.createElement("a")).download=r.filename||"chart.png",a.style.position="absolute",a.style.top="20px",a.style.right="20px",a.style.zIndex=1e3,a.style.lineHeight="20px",a.target="_blank",(i=document.createElement("img")).src="data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path fill="#CCCCCC" d="M344 240h-56L287.1 152c0-13.25-10.75-24-24-24h-16C234.7 128 223.1 138.8 223.1 152L224 240h-56c-9.531 0-18.16 5.656-22 14.38C142.2 263.1 143.9 273.3 150.4 280.3l88.75 96C243.7 381.2 250.1 384 256.8 384c7.781-.3125 13.25-2.875 17.75-7.844l87.25-96c6.406-7.031 8.031-17.19 4.188-25.88S353.5 240 344 240zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"/></svg>'),i.alt="Download",i.style.width="20px",i.style.height="20px",i.style.border="none",a.appendChild(i),(s=n.element).style.position="relative",n.__downloadAttached=!0,n.__enterEvent=s.addEventListener("mouseover",function(t){var e=t.relatedTarget;e&&(e===this||this.contains(e))||!n.options.download||(a.href=n.toImage(r),s.appendChild(a))}),n.__leaveEvent=s.addEventListener("mouseout",function(t){var e=t.relatedTarget;e&&(e===this||this.contains(e))||!a.parentNode||a.parentNode.removeChild(a)}))}(this.__chartName(),this)},tm.prototype.__config=function(){return ti.config};var tb=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return tl(this)},e.prototype.__chartName=function(){return"LineChart"},e}(tm),tv=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return tc(this)},e.prototype.__chartName=function(){return"PieChart"},e}(tm),tx=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return tl(this,null,!0)},e.prototype.__chartName=function(){return"ColumnChart"},e}(tm),tw=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return tl(this,null,!0)},e.prototype.__chartName=function(){return"BarChart"},e}(tm),tC=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return tl(this)},e.prototype.__chartName=function(){return"AreaChart"},e}(tm),tM=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return tc(this)},e.prototype.__chartName=function(){return"GeoChart"},e}(tm),t_=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return tl(this,"number")},e.prototype.__chartName=function(){return"ScatterChart"},e}(tm),tk=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return tl(this,"bubble")},e.prototype.__chartName=function(){return"BubbleChart"},e}(tm),tz=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){for(var t=this.rawData,e=0;e<t.length;e++)t[e][1]=f(t[e][1]),t[e][2]=f(t[e][2]);return t},e.prototype.__chartName=function(){return"Timeline"},e}(tm);ti.LineChart=tb,ti.PieChart=tv,ti.ColumnChart=tx,ti.BarChart=tw,ti.AreaChart=tC,ti.GeoChart=tM,ti.ScatterChart=t_,ti.BubbleChart=tk,ti.Timeline=tz,"undefined"==typeof window||window.Chartkick||(window.Chartkick=ti,document.addEventListener("turbolinks:before-render",function(){!1!==ti.config.autoDestroy&&ti.destroyAll()}),document.addEventListener("turbo:before-render",function(){!1!==ti.config.autoDestroy&&ti.destroyAll()}),setTimeout(function(){window.dispatchEvent(new Event("chartkick:load"))},0)),ti.default=ti}}]); |