UNPKG

react-chartjs-3

Version:
2 lines (1 loc) 26.2 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("chart.js")):"function"==typeof define&&define.amd?define(["exports","react","chart.js"],e):e(t.ReactChartjs2={},t.React,t.Chart)}(this,function(t,r,c){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r,c=c&&c.hasOwnProperty("default")?c.default:c;var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function o(t,e){return t(e={exports:{}},e.exports),e.exports}var a=o(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,l=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116;function d(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case n:switch(t=t.type){case f:case p:case a:case c:case i:case h:return t;default:switch(t=t&&t.$$typeof){case s:case l:case u:return t;default:return e}}case y:case v:case o:return e}}}function b(t){return d(t)===p}e.typeOf=d,e.AsyncMode=f,e.ConcurrentMode=p,e.ContextConsumer=s,e.ContextProvider=u,e.Element=n,e.ForwardRef=l,e.Fragment=a,e.Lazy=y,e.Memo=v,e.Portal=o,e.Profiler=c,e.StrictMode=i,e.Suspense=h,e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===a||t===p||t===c||t===i||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===y||t.$$typeof===v||t.$$typeof===u||t.$$typeof===s||t.$$typeof===l)},e.isAsyncMode=function(t){return b(t)||d(t)===f},e.isConcurrentMode=b,e.isContextConsumer=function(t){return d(t)===s},e.isContextProvider=function(t){return d(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===n},e.isForwardRef=function(t){return d(t)===l},e.isFragment=function(t){return d(t)===a},e.isLazy=function(t){return d(t)===y},e.isMemo=function(t){return d(t)===v},e.isPortal=function(t){return d(t)===o},e.isProfiler=function(t){return d(t)===c},e.isStrictMode=function(t){return d(t)===i},e.isSuspense=function(t){return d(t)===h}});n(a),n(o(function(t,e){}));o(function(t){t.exports=a});var i=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return;var n={};"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),Object.keys(Object.assign({},n)).join("")}catch(t){return}})(),Function.call.bind(Object.prototype.hasOwnProperty);function f(){}function p(){}p.resetWarningCache=f;var l=o(function(t){t.exports=function(){function t(t,e,r,n,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var i=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 i.name="Invariant Violation",i}}function e(){return t}var r={array:t.isRequired=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:p,resetWarningCache:f};return r.PropTypes=r}()});var h=function(t,e){return t===e||t!=t&&e!=e};var v=function(t,e){for(var r=t.length;r--;)if(h(t[r][0],e))return r;return-1},y=Array.prototype.splice;var d=function(t){var e=this.__data__,r=v(e,t);return 0<=r&&(r==e.length-1?e.pop():y.call(e,r,1),--this.size,!0)};var b=function(t){var e=this.__data__,r=v(e,t);return r<0?void 0:e[r][1]};var _=function(t){return-1<v(this.__data__,t)};var g=function(t,e){var r=this.__data__,n=v(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function m(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}m.prototype.clear=function(){this.__data__=[],this.size=0},m.prototype.delete=d,m.prototype.get=b,m.prototype.has=_,m.prototype.set=g;var j=m;var O=function(){this.__data__=new j,this.size=0};var w=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var P=function(t){return this.__data__.get(t)};var E=function(t){return this.__data__.has(t)},A="object"==typeof e&&e&&e.Object===Object&&e,S="object"==typeof self&&self&&self.Object===Object&&self,C=A||S||Function("return this")(),I=C.Symbol,z=Object.prototype,k=z.hasOwnProperty,x=z.toString,$=I?I.toStringTag:void 0;var D=function(t){var e=k.call(t,$),r=t[$];try{var n=!(t[$]=void 0)}catch(t){}var o=x.call(t);return n&&(e?t[$]=r:delete t[$]),o},T=Object.prototype.toString;var M=function(t){return T.call(t)},R=I?I.toStringTag:void 0;var F=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":R&&R in Object(t)?D(t):M(t)};var B=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var L,U=function(t){if(!B(t))return!1;var e=F(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},q=C["__core-js_shared__"],K=(L=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"";var W=function(t){return!!K&&K in t},N=Function.prototype.toString;var V=function(t){if(null!=t){try{return N.call(t)}catch(t){}try{return t+""}catch(t){}}return""},H=/^\[object .+?Constructor\]$/,G=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Y=function(t){return!(!B(t)||W(t))&&(U(t)?G:H).test(V(t))};var J=function(t,e){return null==t?void 0:t[e]};var Q=function(t,e){var r=J(t,e);return Y(r)?r:void 0},X=Q(C,"Map"),Z=Q(Object,"create");var tt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},et=Object.prototype.hasOwnProperty;var rt=function(t){var e=this.__data__;if(Z){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return et.call(e,t)?e[t]:void 0},nt=Object.prototype.hasOwnProperty;var ot=function(t){var e=this.__data__;return Z?void 0!==e[t]:nt.call(e,t)};var at=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Z&&void 0===e?"__lodash_hash_undefined__":e,this};function it(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}it.prototype.clear=function(){this.__data__=Z?Z(null):{},this.size=0},it.prototype.delete=tt,it.prototype.get=rt,it.prototype.has=ot,it.prototype.set=at;var ct=it;var ut=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var st=function(t,e){var r=t.__data__;return ut(e)?r["string"==typeof e?"string":"hash"]:r.map};var ft=function(t){var e=st(this,t).delete(t);return this.size-=e?1:0,e};var pt=function(t){return st(this,t).get(t)};var lt=function(t){return st(this,t).has(t)};var ht=function(t,e){var r=st(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function vt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}vt.prototype.clear=function(){this.size=0,this.__data__={hash:new ct,map:new(X||j),string:new ct}},vt.prototype.delete=ft,vt.prototype.get=pt,vt.prototype.has=lt,vt.prototype.set=ht;var yt=vt;var dt=function(t,e){var r=this.__data__;if(r instanceof j){var n=r.__data__;if(!X||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new yt(n)}return r.set(t,e),this.size=r.size,this};function bt(t){var e=this.__data__=new j(t);this.size=e.size}bt.prototype.clear=O,bt.prototype.delete=w,bt.prototype.get=P,bt.prototype.has=E,bt.prototype.set=dt;var _t=bt;var gt=function(t){return this.__data__.has(t)};function mt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new yt;++e<r;)this.add(t[e])}mt.prototype.add=mt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},mt.prototype.has=gt;var jt=mt;var Ot=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var wt=function(t,e){return t.has(e)};var Pt=function(t,e,r,n,o,a){var i=1&r,c=t.length,u=e.length;if(!(c==u||i&&c<u))return!1;var s=a.get(t);if(s&&a.get(e))return s==e;var f=-1,p=!0,l=2&r?new jt:void 0;for(a.set(t,e),a.set(e,t);++f<c;){var h=t[f],v=e[f];if(n)var y=i?n(v,h,f,e,t,a):n(h,v,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(l){if(!Ot(e,function(t,e){if(!wt(l,e)&&(h===t||o(h,t,r,n,a)))return l.push(e)})){p=!1;break}}else if(h!==v&&!o(h,v,r,n,a)){p=!1;break}}return a.delete(t),a.delete(e),p},Et=C.Uint8Array;var At=function(t){var r=-1,n=Array(t.size);return t.forEach(function(t,e){n[++r]=[e,t]}),n};var St=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r},Ct=I?I.prototype:void 0,It=Ct?Ct.valueOf:void 0;var zt=function(t,e,r,n,o,a,i){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!a(new Et(t),new Et(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return h(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var c=At;case"[object Set]":if(c||(c=St),t.size!=e.size&&!(1&n))return!1;var u=i.get(t);if(u)return u==e;n|=2,i.set(t,e);var s=Pt(c(t),c(e),n,o,a,i);return i.delete(t),s;case"[object Symbol]":if(It)return It.call(t)==It.call(e)}return!1};var kt=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t},xt=Array.isArray;var $t=function(t,e,r){var n=e(t);return xt(t)?n:kt(n,r(t))};var Dt=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,a=[];++r<n;){var i=t[r];e(i,r,t)&&(a[o++]=i)}return a};var Tt=Object.prototype.propertyIsEnumerable,Mt=Object.getOwnPropertySymbols,Rt=Mt?function(e){return null==e?[]:Dt(Mt(e=Object(e)),function(t){return Tt.call(e,t)})}:function(){return[]};var Ft=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var Bt=function(t){return null!=t&&"object"==typeof t};var Lt=function(t){return Bt(t)&&"[object Arguments]"==F(t)},Ut=Object.prototype,qt=Ut.hasOwnProperty,Kt=Ut.propertyIsEnumerable,Wt=Lt(function(){return arguments}())?Lt:function(t){return Bt(t)&&qt.call(t,"callee")&&!Kt.call(t,"callee")};var Nt=function(){return!1},Vt=o(function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?C.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||Nt}),Ht=/^(?:0|[1-9]\d*)$/;var Gt=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Ht.test(t))&&-1<t&&t%1==0&&t<e};var Yt=function(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991},Jt={};Jt["[object Float32Array]"]=Jt["[object Float64Array]"]=Jt["[object Int8Array]"]=Jt["[object Int16Array]"]=Jt["[object Int32Array]"]=Jt["[object Uint8Array]"]=Jt["[object Uint8ClampedArray]"]=Jt["[object Uint16Array]"]=Jt["[object Uint32Array]"]=!0,Jt["[object Arguments]"]=Jt["[object Array]"]=Jt["[object ArrayBuffer]"]=Jt["[object Boolean]"]=Jt["[object DataView]"]=Jt["[object Date]"]=Jt["[object Error]"]=Jt["[object Function]"]=Jt["[object Map]"]=Jt["[object Number]"]=Jt["[object Object]"]=Jt["[object RegExp]"]=Jt["[object Set]"]=Jt["[object String]"]=Jt["[object WeakMap]"]=!1;var Qt=function(t){return Bt(t)&&Yt(t.length)&&!!Jt[F(t)]};var Xt=function(e){return function(t){return e(t)}},Zt=o(function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&A.process,a=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a}),te=Zt&&Zt.isTypedArray,ee=te?Xt(te):Qt,re=Object.prototype.hasOwnProperty;var ne=function(t,e){var r=xt(t),n=!r&&Wt(t),o=!r&&!n&&Vt(t),a=!r&&!n&&!o&&ee(t),i=r||n||o||a,c=i?Ft(t.length,String):[],u=c.length;for(var s in t)!e&&!re.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Gt(s,u))||c.push(s);return c},oe=Object.prototype;var ae=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||oe)};var ie=function(e,r){return function(t){return e(r(t))}}(Object.keys,Object),ce=Object.prototype.hasOwnProperty;var ue=function(t){if(!ae(t))return ie(t);var e=[];for(var r in Object(t))ce.call(t,r)&&"constructor"!=r&&e.push(r);return e};var se=function(t){return null!=t&&Yt(t.length)&&!U(t)};var fe=function(t){return se(t)?ne(t):ue(t)};var pe=function(t){return $t(t,fe,Rt)},le=Object.prototype.hasOwnProperty;var he=function(t,e,r,n,o,a){var i=1&r,c=pe(t),u=c.length;if(u!=pe(e).length&&!i)return!1;for(var s=u;s--;){var f=c[s];if(!(i?f in e:le.call(e,f)))return!1}var p=a.get(t);if(p&&a.get(e))return p==e;var l=!0;a.set(t,e),a.set(e,t);for(var h=i;++s<u;){var v=t[f=c[s]],y=e[f];if(n)var d=i?n(y,v,f,e,t,a):n(v,y,f,t,e,a);if(!(void 0===d?v===y||o(v,y,r,n,a):d)){l=!1;break}h||(h="constructor"==f)}if(l&&!h){var b=t.constructor,_=e.constructor;b!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(l=!1)}return a.delete(t),a.delete(e),l},ve=Q(C,"DataView"),ye=Q(C,"Promise"),de=Q(C,"Set"),be=Q(C,"WeakMap"),_e="[object Map]",ge="[object Promise]",me="[object Set]",je="[object WeakMap]",Oe="[object DataView]",we=V(ve),Pe=V(X),Ee=V(ye),Ae=V(de),Se=V(be),Ce=F;(ve&&Ce(new ve(new ArrayBuffer(1)))!=Oe||X&&Ce(new X)!=_e||ye&&Ce(ye.resolve())!=ge||de&&Ce(new de)!=me||be&&Ce(new be)!=je)&&(Ce=function(t){var e=F(t),r="[object Object]"==e?t.constructor:void 0,n=r?V(r):"";if(n)switch(n){case we:return Oe;case Pe:return _e;case Ee:return ge;case Ae:return me;case Se:return je}return e});var Ie=Ce,ze="[object Arguments]",ke="[object Array]",xe="[object Object]",$e=Object.prototype.hasOwnProperty;var De=function(t,e,r,n,o,a){var i=xt(t),c=xt(e),u=i?ke:Ie(t),s=c?ke:Ie(e),f=(u=u==ze?xe:u)==xe,p=(s=s==ze?xe:s)==xe,l=u==s;if(l&&Vt(t)){if(!Vt(e))return!1;f=!(i=!0)}if(l&&!f)return a||(a=new _t),i||ee(t)?Pt(t,e,r,n,o,a):zt(t,e,u,r,n,o,a);if(!(1&r)){var h=f&&$e.call(t,"__wrapped__"),v=p&&$e.call(e,"__wrapped__");if(h||v){var y=h?t.value():t,d=v?e.value():e;return a||(a=new _t),o(y,d,r,n,a)}}return!!l&&(a||(a=new _t),he(t,e,r,n,o,a))};var Te=function t(e,r,n,o,a){return e===r||(null==e||null==r||!Bt(e)&&!Bt(r)?e!=e&&r!=r:De(e,r,n,o,t,a))};var Me=function(t,e){return Te(t,e)},Re=function(){try{var t=Q(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Fe=function(t,e,r){"__proto__"==e&&Re?Re(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var Be=function(t,e,r,n){for(var o=-1,a=null==t?0:t.length;++o<a;){var i=t[o];e(n,i,r(i),t)}return n};var Le=function(u){return function(t,e,r){for(var n=-1,o=Object(t),a=r(t),i=a.length;i--;){var c=a[u?i:++n];if(!1===e(o[c],c,o))break}return t}}();var Ue=function(a,i){return function(t,e){if(null==t)return t;if(!se(t))return a(t,e);for(var r=t.length,n=i?r:-1,o=Object(t);(i?n--:++n<r)&&!1!==e(o[n],n,o););return t}}(function(t,e){return t&&Le(t,e,fe)});var qe=function(t,n,o,a){return Ue(t,function(t,e,r){n(a,t,o(t),r)}),a};var Ke=function(t,e,r,n){var o=r.length,a=o,i=!n;if(null==t)return!a;for(t=Object(t);o--;){var c=r[o];if(i&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<a;){var u=(c=r[o])[0],s=t[u],f=c[1];if(i&&c[2]){if(void 0===s&&!(u in t))return!1}else{var p=new _t;if(n)var l=n(s,f,u,t,e,p);if(!(void 0===l?Te(f,s,3,n,p):l))return!1}}return!0};var We=function(t){return t==t&&!B(t)};var Ne=function(t){for(var e=fe(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,We(o)]}return e};var Ve=function(e,r){return function(t){return null!=t&&t[e]===r&&(void 0!==r||e in Object(t))}};var He=function(e){var r=Ne(e);return 1==r.length&&r[0][2]?Ve(r[0][0],r[0][1]):function(t){return t===e||Ke(t,e,r)}};var Ge=function(t){return"symbol"==typeof t||Bt(t)&&"[object Symbol]"==F(t)},Ye=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Je=/^\w*$/;var Qe=function(t,e){if(xt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Ge(t))||Je.test(t)||!Ye.test(t)||null!=e&&t in Object(e)},Xe="Expected a function";function Ze(o,a){if("function"!=typeof o||null!=a&&"function"!=typeof a)throw new TypeError(Xe);var i=function(){var t=arguments,e=a?a.apply(this,t):t[0],r=i.cache;if(r.has(e))return r.get(e);var n=o.apply(this,t);return i.cache=r.set(e,n)||r,n};return i.cache=new(Ze.Cache||yt),i}Ze.Cache=yt;var tr=Ze;var er=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rr=/\\(\\)?/g,nr=function(t){var e=tr(t,function(t){return 500===r.size&&r.clear(),t}),r=e.cache;return e}(function(t){var o=[];return 46==t.charCodeAt(0)&&o.push(""),t.replace(er,function(t,e,r,n){o.push(r?n.replace(rr,"$1"):e||t)}),o});var or=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},ar=1/0,ir=I?I.prototype:void 0,cr=ir?ir.toString:void 0;var ur=function t(e){if("string"==typeof e)return e;if(xt(e))return or(e,t)+"";if(Ge(e))return cr?cr.call(e):"";var r=e+"";return"0"==r&&1/e==-ar?"-0":r};var sr=function(t){return null==t?"":ur(t)};var fr=function(t,e){return xt(t)?t:Qe(t,e)?[t]:nr(sr(t))};var pr=function(t){if("string"==typeof t||Ge(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var lr=function(t,e){for(var r=0,n=(e=fr(e,t)).length;null!=t&&r<n;)t=t[pr(e[r++])];return r&&r==n?t:void 0};var hr=function(t,e,r){var n=null==t?void 0:lr(t,e);return void 0===n?r:n};var vr=function(t,e){return null!=t&&e in Object(t)};var yr=function(t,e,r){for(var n=-1,o=(e=fr(e,t)).length,a=!1;++n<o;){var i=pr(e[n]);if(!(a=null!=t&&r(t,i)))break;t=t[i]}return a||++n!=o?a:!!(o=null==t?0:t.length)&&Yt(o)&&Gt(i,o)&&(xt(t)||Wt(t))};var dr=function(t,e){return null!=t&&yr(t,e,vr)};var br=function(r,n){return Qe(r)&&We(n)?Ve(pr(r),n):function(t){var e=hr(t,r);return void 0===e&&e===n?dr(t,r):Te(n,e,3)}};var _r=function(t){return t};var gr=function(e){return function(t){return null==t?void 0:t[e]}};var mr=function(e){return function(t){return lr(t,e)}};var jr=function(t){return Qe(t)?gr(pr(t)):mr(t)};var Or=function(t){return"function"==typeof t?t:null==t?_r:"object"==typeof t?xt(t)?br(t[0],t[1]):He(t):jr(t)};var wr=function(o,a){return function(t,e){var r=xt(t)?Be:qe,n=a?a():{};return r(t,o,Or(e,2),n)}}(function(t,e,r){Fe(t,r,e)}),Pr=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Er=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ar=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},Sr=function(t,e){var r={};for(var n in t)e.indexOf(n)<0&&Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},Cr=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},Ir="undefined"!=typeof process&&process.env&&"production",zr=function(o){function u(){var t,c;Pr(this,u);for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=c=Cr(this,o.call.apply(o,[this].concat(r)))).handleOnClick=function(t){var e=c.chartInstance,r=c.props,n=r.getDatasetAtEvent,o=r.getElementAtEvent,a=r.getElementsAtEvent,i=r.onElementsClick;n&&n(e.getDatasetAtEvent(t),t),o&&o(e.getElementAtEvent(t),t),a&&a(e.getElementsAtEvent(t),t),i&&i(e.getElementsAtEvent(t),t)},c.ref=function(t){c.element=t},Cr(c,t)}return Ar(u,o),u.prototype.componentWillMount=function(){this.chartInstance=void 0},u.prototype.componentDidMount=function(){this.renderChart()},u.prototype.componentDidUpdate=function(){if(this.props.redraw)return this.chartInstance.destroy(),void this.renderChart();this.updateChart()},u.prototype.shouldComponentUpdate=function(t){var e=this.props,r=e.options,n=e.plugins;if(!0===t.redraw)return!0;if(e.height!==t.height||e.width!==t.width)return!0;if(e.type!==t.type)return!0;if(!Me(e.legend,t.legend))return!0;if(!Me(r,t.options))return!0;var o=this.transformDataProp(t);return!Me(this.shadowDataProp,o)||!Me(n,t.plugins)},u.prototype.componentWillUnmount=function(){this.chartInstance.destroy()},u.prototype.transformDataProp=function(t){var e=t.data;return"function"!=typeof e?e:e(this.element)},u.prototype.memoizeDataProps=function(){if(this.props.data){var t=this.transformDataProp(this.props);return this.shadowDataProp=Er({},t,{datasets:t.datasets&&t.datasets.map(function(t){return Er({},t)})}),t}},u.prototype.checkDatasets=function(t){if("production"!==Ir&&"prod"!==Ir&&1<t.length&&!(this.props.datasetKeyProvider!==u.getLabelAsKey)){var e=!1;t.forEach(function(t){t.label||(e=!0)}),e&&console.error('[react-chartjs-3] Warning: Each dataset needs a unique key. By default, the "label" property on each dataset is used. Alternatively, you may provide a "datasetKeyProvider" as a prop that returns a unique key.')}},u.prototype.updateChart=function(){var e=this,t=this.props.options,r=this.memoizeDataProps(this.props);if(this.chartInstance){t&&(this.chartInstance.options=c.helpers.configMerge(this.chartInstance.options,t));var n=this.chartInstance.config.data&&this.chartInstance.config.data.datasets||[],o=r.datasets||[];this.checkDatasets(n);var a=wr(n,this.props.datasetKeyProvider);this.chartInstance.config.data.datasets=o.map(function(r){var n=a[e.props.datasetKeyProvider(r)];if(n&&r.data&&n.type===r.type){n.data.splice(r.data.length),r.data.forEach(function(t,e){n.data[e]=r.data[e]});var t=Sr(r,["data"]);return Er({},n,t)}return r});var i=Sr(r,["datasets"]);this.chartInstance.config.data=Er({},this.chartInstance.config.data,i),this.chartInstance.update()}},u.prototype.renderChart=function(){var t=this.props,e=t.options,r=t.legend,n=t.type,o=t.plugins,a=this.element,i=this.memoizeDataProps();void 0===r||Me(u.defaultProps.legend,r)||(e.legend=r),this.chartInstance=new c(a,{type:n,data:i,options:e,plugins:o})},u.prototype.render=function(){var t=this.props;return r.createElement("canvas",{ref:this.ref,height:t.height,width:t.width,id:t.id,onClick:this.handleOnClick})},u}(r.Component);zr.getLabelAsKey=function(t){return t.label},zr.propTypes={data:l.oneOfType([l.object,l.func]).isRequired,getDatasetAtEvent:l.func,getElementAtEvent:l.func,getElementsAtEvent:l.func,height:l.number,legend:l.object,onElementsClick:l.func,options:l.object,plugins:l.arrayOf(l.object),redraw:l.bool,type:function(t,e,r){if(!c.controllers[t[e]])return Error("Invalid chart type `"+t[e]+"` supplied to `"+r+"`.")},width:l.number,datasetKeyProvider:l.func},zr.defaultProps={legend:{display:!0,position:"bottom"},type:"doughnut",height:150,width:300,redraw:!1,options:{},datasetKeyProvider:zr.getLabelAsKey};var kr=function(t){function e(){return Pr(this,e),Cr(this,t.apply(this,arguments))}return Ar(e,t),e.prototype.render=function(){var e=this;return r.createElement(zr,Er({},this.props,{ref:function(t){return e.chartInstance=t&&t.chartInstance},type:"doughnut"}))},e}(r.Component),xr=function(t){function e(){return Pr(this,e),Cr(this,t.apply(this,arguments))}return Ar(e,t),e.prototype.render=function(){var e=this;return r.createElement(zr,Er({},this.props,{ref:function(t){return e.chartInstance=t&&t.chartInstance},type:"pie"}))},e}(r.Component),$r=function(t){function e(){return Pr(this,e),Cr(this,t.apply(this,arguments))}return Ar(e,t),e.prototype.render=function(){var e=this;return r.createElement(zr,Er({},this.props,{ref:function(t){return e.chartInstance=t&&t.chartInstance},type:"line"}))},e}(r.Component),Dr=function(t){function e(){return Pr(this,e),Cr(this,t.apply(this,arguments))}return Ar(e,t),e.prototype.render=function(){var e=this;return r.createElement(zr,Er({},this.props,{ref:function(t){return e.chartInstance=t&&t.chartInstance},type:"bar"}))},e}(r.Component),Tr=function(t){function e(){return Pr(this,e),Cr(this,t.apply(this,arguments))}return Ar(e,t),e.prototype.render=function(){var e=this;return r.createElement(zr,Er({},this.props,{ref:function(t){return e.chartInstance=t&&t.chartInstance},type:"horizontalBar"}))},e}(r.Component),Mr=function(t){function e(){return Pr(this,e),Cr(this,t.apply(this,arguments))}return Ar(e,t),e.prototype.render=function(){var e=this;return r.createElement(zr,Er({},this.props,{ref:function(t){return e.chartInstance=t&&t.chartInstance},type:"radar"}))},e}(r.Component),Rr=function(t){function e(){return Pr(this,e),Cr(this,t.apply(this,arguments))}return Ar(e,t),e.prototype.render=function(){var e=this;return r.createElement(zr,Er({},this.props,{ref:function(t){return e.chartInstance=t&&t.chartInstance},type:"polarArea"}))},e}(r.Component),Fr=function(t){function e(){return Pr(this,e),Cr(this,t.apply(this,arguments))}return Ar(e,t),e.prototype.render=function(){var e=this;return r.createElement(zr,Er({},this.props,{ref:function(t){return e.chartInstance=t&&t.chartInstance},type:"bubble"}))},e}(r.Component),Br=function(t){function e(){return Pr(this,e),Cr(this,t.apply(this,arguments))}return Ar(e,t),e.prototype.render=function(){var e=this;return r.createElement(zr,Er({},this.props,{ref:function(t){return e.chartInstance=t&&t.chartInstance},type:"scatter"}))},e}(r.Component),Lr=c.defaults;t.default=zr,t.Doughnut=kr,t.Pie=xr,t.Line=$r,t.Bar=Dr,t.HorizontalBar=Tr,t.Radar=Mr,t.Polar=Rr,t.Bubble=Fr,t.Scatter=Br,t.defaults=Lr,t.Chart=c,Object.defineProperty(t,"__esModule",{value:!0})});