"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[497],{50497:function(e,r,t){t.r(r),t.d(r,{default:function(){return h}});var n=t(67294),i=t(24468),o=t(45697),u=t.n(o);function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(null,arguments)}function f(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?f(Object(t),!0).forEach(function(r){!function(e,r,t){var n;(r="symbol"==typeof(n=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(r,"string"))?n:n+"")in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t}(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var l=["type","width","height","series","options","chartRef"];function p(e){return e&&"object"===a(e)&&!Array.isArray(e)}function y(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WeakSet;if(e===r)return!0;if("object"!==a(e)||null===e||"object"!==a(r)||null===r)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);var n=Object.keys(e),i=Object.keys(r);if(n.length!==i.length)return!1;for(var o=0;o<n.length;o++){var u=n[o];if(!i.includes(u)||!y(e[u],r[u],t))return!1}return!0}var b=["type","series","options","width","height","chartRef"];function h(e){var r=e.type,t=void 0===r?"line":r,o=e.width,u=void 0===o?"100%":o,f=e.height,a=void 0===f?"auto":f,h=e.series,d=e.options,v=e.chartRef,O=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(r.includes(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.includes(t)||({}).propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,l),g=(0,n.useRef)(null),j=(0,n.useRef)(null),m=(0,n.useRef)(null),w=v||m,P=function(){return function e(r,t){var n=s({},r);return p(r)&&p(t)&&Object.keys(t).forEach(function(i){p(t[i])?n[i]=i in r?e(r[i],t[i]):t[i]:n[i]=t[i]}),n}(d,{chart:{type:t,height:a,width:u},series:h})};(0,n.useEffect)(function(){return w.current=new i.default(g.current,P()),w.current.render(),j.current=d,function(){w.current&&"function"==typeof w.current.destroy&&w.current.destroy()}},[]),(0,n.useEffect)(function(){if(w.current&&w.current.w){var e=!y(w.current.w.config.series,h),r=!y(j.current,d)||a!==w.current.opts.chart.height||u!==w.current.opts.chart.width;(e||r)&&(e?r?w.current.updateOptions(P()):w.current.updateSeries(h):w.current.updateOptions(P())),j.current=d}},[d,h,a,u]);var S,E=(S=s({},O),b.forEach(function(e){delete S[e]}),S);return n.createElement("div",c({ref:g},E))}h.propTypes={type:u().string.isRequired,series:u().array.isRequired,options:u().object.isRequired,width:u().oneOfType([u().string,u().number]),height:u().oneOfType([u().string,u().number]),chartRef:u().shape({current:u().any})}}}]);