. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AnonSec Shell
AnonSec Shell
Server IP : 87.98.249.37  /  Your IP : 216.73.216.208   [ Reverse IP ]
Web Server : Microsoft-IIS/10.0
System : Windows NT NS3076740 10.0 build 17763 (Windows Server 2019) AMD64
User : IWPD_292(growel19p) ( 0)
PHP Version : 8.3.12
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Inetpub/vhosts/growel.com/httpdocs/blog/wp-content/plugins/firebox/media/admin/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : C:/Inetpub/vhosts/growel.com/httpdocs/blog/wp-content/plugins/firebox/media/admin/js/analytics.js
/*! For license information please see analytics.js.LICENSE.txt */
(()=>{var e={386:function(e,t,n){var r,a,i;function o(e){return o="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},o(e)}i=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",a="minute",i="hour",l="day",s="week",c="month",u="quarter",f="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},y=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},g={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),a=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(a,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),a=t.clone().add(r,c),i=n-a<0,o=t.clone().add(r+(i?-1:1),c);return+(-(r+(n-a)/(i?a-o:o-a))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:f,w:s,d:l,D:d,h:i,m:a,s:r,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",x={};x[b]=m;var _="$isDayjsObject",w=function(e){return e instanceof j||!(!e||!e[_])},k=function e(t,n,r){var a;if(!t)return b;if("string"==typeof t){var i=t.toLowerCase();x[i]&&(a=i),n&&(x[i]=n,a=i);var o=t.split("-");if(!a&&o.length>1)return e(o[0])}else{var l=t.name;x[l]=t,a=l}return!r&&a&&(b=a),a||!r&&b},S=function(e,t){if(w(e))return e.clone();var n="object"==o(t)?t:{};return n.date=e,n.args=arguments,new j(n)},O=g;O.l=k,O.i=w,O.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var j=function(){function o(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[_]=!0}var m=o.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(O.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var a=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===h)},m.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},m.isAfter=function(e,t){return S(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<S(e)},m.$g=function(e,t,n){return O.u(e)?this[t]:this.set(n,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var n=this,o=!!O.u(t)||t,u=O.p(e),h=function(e,t){var r=O.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return o?r:r.endOf(l)},p=function(e,t){return O.w(n.toDate()[e].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},v=this.$W,m=this.$M,y=this.$D,g="set"+(this.$u?"UTC":"");switch(u){case f:return o?h(1,0):h(31,11);case c:return o?h(1,m):h(0,m+1);case s:var b=this.$locale().weekStart||0,x=(v<b?v+7:v)-b;return h(o?y-x:y+(6-x),m);case l:case d:return p(g+"Hours",0);case i:return p(g+"Minutes",1);case a:return p(g+"Seconds",2);case r:return p(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,t){var o,s=O.p(e),u="set"+(this.$u?"UTC":""),h=(o={},o[l]=u+"Date",o[d]=u+"Date",o[c]=u+"Month",o[f]=u+"FullYear",o[i]=u+"Hours",o[a]=u+"Minutes",o[r]=u+"Seconds",o[n]=u+"Milliseconds",o)[s],p=s===l?this.$D+(t-this.$W):t;if(s===c||s===f){var v=this.clone().set(d,1);v.$d[h](p),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[O.p(e)]()},m.add=function(n,o){var u,d=this;n=Number(n);var h=O.p(o),p=function(e){var t=S(d);return O.w(t.date(t.date()+Math.round(e*n)),d)};if(h===c)return this.set(c,this.$M+n);if(h===f)return this.set(f,this.$y+n);if(h===l)return p(1);if(h===s)return p(7);var v=(u={},u[a]=e,u[i]=t,u[r]=1e3,u)[h]||1,m=this.$d.getTime()+n*v;return O.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=e||"YYYY-MM-DDTHH:mm:ssZ",a=O.z(this),i=this.$H,o=this.$m,l=this.$M,s=n.weekdays,c=n.months,u=n.meridiem,f=function(e,n,a,i){return e&&(e[n]||e(t,r))||a[n].slice(0,i)},d=function(e){return O.s(i%12||12,e,"0")},p=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(v,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return O.s(t.$y,4,"0");case"M":return l+1;case"MM":return O.s(l+1,2,"0");case"MMM":return f(n.monthsShort,l,c,3);case"MMMM":return f(c,l);case"D":return t.$D;case"DD":return O.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return f(n.weekdaysMin,t.$W,s,2);case"ddd":return f(n.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(i);case"HH":return O.s(i,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return p(i,o,!0);case"A":return p(i,o,!1);case"m":return String(o);case"mm":return O.s(o,2,"0");case"s":return String(t.$s);case"ss":return O.s(t.$s,2,"0");case"SSS":return O.s(t.$ms,3,"0");case"Z":return a}return null}(e)||a.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(n,o,d){var h,p=this,v=O.p(o),m=S(n),y=(m.utcOffset()-this.utcOffset())*e,g=this-m,b=function(){return O.m(p,m)};switch(v){case f:h=b()/12;break;case c:h=b();break;case u:h=b()/3;break;case s:h=(g-y)/6048e5;break;case l:h=(g-y)/864e5;break;case i:h=g/t;break;case a:h=g/e;break;case r:h=g/1e3;break;default:h=g}return d?h:O.a(h)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return x[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=k(e,t,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},o}(),E=j.prototype;return S.prototype=E,[["$ms",n],["$s",r],["$m",a],["$H",i],["$W",l],["$M",c],["$y",f],["$D",d]].forEach((function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,j,S),e.$i=!0),S},S.locale=k,S.isDayjs=w,S.unix=function(e){return S(1e3*e)},S.en=x[b],S.Ls=x,S.p={},S},"object"==o(t)?e.exports=i():void 0===(a="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=a)},828:function(e,t,n){var r,a,i;function o(e){return o="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},o(e)}i=function(){"use strict";return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)}}},"object"==o(t)?e.exports=i():void 0===(a="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=a)},932:function(e,t,n){var r,a,i;function o(e){return o="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},o(e)}i=function(){"use strict";return function(e,t){t.prototype.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)}}},"object"==o(t)?e.exports=i():void 0===(a="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=a)},480:(e,t,n)=>{"use strict";var r=n(69),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?o:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=o;var c=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var a=h(n);a&&a!==p&&e(t,a,r)}var o=u(n);f&&(o=o.concat(f(n)));for(var l=s(t),v=s(n),m=0;m<o.length;++m){var y=o[m];if(!(i[y]||r&&r[y]||v&&v[y]||l&&l[y])){var g=d(n,y);try{c(t,y,g)}catch(e){}}}}return t}},995:(e,t)=>{"use strict";function n(e){return n="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},n(e)}var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,_=r?Symbol.for("react.scope"):60119;function w(e){if("object"===n(e)&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case f:case d:case o:case s:case l:case p:return e;default:switch(e=e&&e.$$typeof){case u:case h:case y:case m:case c:return e;default:return t}}case i:return t}}}function k(e){return w(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=c,t.Element=a,t.ForwardRef=h,t.Fragment=o,t.Lazy=y,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=l,t.Suspense=p,t.isAsyncMode=function(e){return k(e)||w(e)===f},t.isConcurrentMode=k,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===c},t.isElement=function(e){return"object"===n(e)&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===y},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===l},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===l||e===p||e===v||"object"===n(e)&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===c||e.$$typeof===u||e.$$typeof===h||e.$$typeof===b||e.$$typeof===x||e.$$typeof===_||e.$$typeof===g)},t.typeOf=w},69:(e,t,n)=>{"use strict";e.exports=n(995)},769:(e,t,n)=>{"use strict";var r=n(533);t.s=r.createRoot,r.hydrateRoot},533:e=>{"use strict";e.exports=ReactDOM}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=React;var t=n.n(e),r=n(769);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=function(e,t){switch(t.type){case"SET_CAMPAIGN":case"SET_CAMPAIGN_DATA":return i(i({},e),{},{campaign:t.payload});case"SET_DATE_PERIOD":var n=i(i({},e),{},{date_period:t.payload});return"custom"!==t.payload&&(n.custom_date_period=[null,null]),n;case"SET_CUSTOM_DATE_PERIOD":return i(i({},e),{},{custom_date_period:t.payload});case"CLEAR_SELECTED_CAMPAIGN":return i(i({},e),{},{selected_campaign:null,campaign:null});case"SET_SELECTED_CAMPAIGN":return i(i({},e),{},{selected_campaign:t.payload});default:throw Error("Unknown action: "+t.type)}},s=t().createContext(),c=t().createContext(),u=function(){return(0,e.useContext)(s)},f=function(){return(0,e.useContext)(c)};function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",n=(0,e.useState)(null),r=d(n,2),a=r[0],i=r[1],o=(0,e.useState)(!0),l=d(o,2),s=l[0],c=l[1];return(0,e.useEffect)((function(){var e="undefined"!=typeof window&&window.wp&&window.wp.hooks?window.wp.hooks:null,t=function(){try{var t=null==e?void 0:e.applyFilters("firebox.revenue.type","locked"),n=null==e?void 0:e.applyFilters("firebox.revenue.components",null);if(!n)return i(null),void c(!1);i("pro"===t?{Clicks:n.Clicks,Revenue:n.Revenue,SalesFunnel:n.SalesFunnel,ClickThroughRevenue:n.ClickThroughRevenue,ViewThroughRevenue:n.ViewThroughRevenue,CompactRevenueROI:n.CompactRevenueROI,type:"pro"}:{Clicks:n.ClicksLocked,Revenue:n.RevenueLocked,SalesFunnel:n.SalesFunnelLocked,ClickThroughRevenue:n.ClickThroughRevenueLocked,ViewThroughRevenue:n.ViewThroughRevenueLocked,CompactRevenueROI:n.CompactRevenueROILocked,type:"locked"})}finally{c(!1)}};return t(),e&&e.addAction("firebox.revenue.ready","firebox/analytics",t,10),function(){e&&e.removeAction("firebox.revenue.ready","firebox/analytics")}}),[t]),{components:a,loading:s}};function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const m=function(t){var n=t._title,r=void 0===n?fbox_admin_js_object.langs.OVERVIEW:n,a=t.call_to_action,i=void 0===a||a,o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(r),2),l=o[0],s=o[1],c=u().campaign,f=p(),d=f.components,h=f.loading;return(0,e.useEffect)((function(){s(null!=c&&c.post_title?c.post_title:r)}),[c]),React.createElement("div",{className:"flex items-center justify-between gap-1 flex-wrap"},React.createElement("h1",{className:"mb-0 text-default text-[32px] dark:text-white truncate md:max-w-[800px] fp-admin-page-title"},l),React.createElement("div",{className:"flex items-center gap-4"},!h&&(null==d?void 0:d.CompactRevenueROI)&&React.createElement(d.CompactRevenueROI,null),c?null:i&&React.createElement("a",{href:"#",className:"fpf-open-library-modal rounded bg-accent text-sm text-white no-underline px-2 py-1 flex items-center justify-center gap-1 hover:bg-accent-hover"},React.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("mask",{id:"mask0_498_1527",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},React.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),React.createElement("g",{mask:"url(#mask0_498_1527)"},React.createElement("path",{d:"M11.25 16.75H12.75V12.75H16.75V11.25H12.75V7.25H11.25V11.25H7.25V12.75H11.25V16.75ZM12.0016 21.5C10.6877 21.5 9.45268 21.2506 8.29655 20.752C7.1404 20.2533 6.13472 19.5765 5.2795 18.7217C4.42427 17.8669 3.74721 16.8616 3.24833 15.706C2.74944 14.5504 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45268 3.248 8.29655C3.74667 7.1404 4.42342 6.13472 5.27825 5.2795C6.1331 4.42427 7.13834 3.74721 8.29398 3.24833C9.44959 2.74944 10.6844 2.5 11.9983 2.5C13.3122 2.5 14.5473 2.74933 15.7034 3.248C16.8596 3.74667 17.8652 4.42342 18.7205 5.27825C19.5757 6.1331 20.2527 7.13834 20.7516 8.29398C21.2505 9.44959 21.5 10.6844 21.5 11.9983C21.5 13.3122 21.2506 14.5473 20.752 15.7034C20.2533 16.8596 19.5765 17.8652 18.7217 18.7205C17.8669 19.5757 16.8616 20.2527 15.706 20.7516C14.5504 21.2505 13.3156 21.5 12.0016 21.5ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76664 19.225 7.87498 17.675 6.32498C16.125 4.77498 14.2333 3.99998 12 3.99998C9.76664 3.99998 7.87498 4.77498 6.32498 6.32498C4.77498 7.87498 3.99998 9.76664 3.99998 12C3.99998 14.2333 4.77498 16.125 6.32498 17.675C7.87498 19.225 9.76664 20 12 20Z",fill:"white"}))),fbox_admin_js_object.langs.NEW_CAMPAIGN)))};var y=n(386),g=n.n(y),b=n(932),x=n.n(b),_=n(828),w=n.n(_),k=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),S=Math.abs,O=String.fromCharCode,j=Object.assign;function E(e){return e.trim()}function A(e,t,n){return e.replace(t,n)}function C(e,t){return e.indexOf(t)}function D(e,t){return 0|e.charCodeAt(t)}function P(e,t,n){return e.slice(t,n)}function M(e){return e.length}function R(e){return e.length}function I(e,t){return t.push(e),e}var L=1,N=1,T=0,F=0,z=0,H="";function V(e,t,n,r,a,i,o){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:L,column:N,length:o,return:""}}function W(e,t){return j(V("",null,null,"",null,null,0),e,{length:-e.length},t)}function $(){return z=F>0?D(H,--F):0,N--,10===z&&(N=1,L--),z}function B(){return z=F<T?D(H,F++):0,N++,10===z&&(N=1,L++),z}function Y(){return D(H,F)}function U(){return F}function G(e,t){return P(H,e,t)}function q(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Z(e){return L=N=1,T=M(H=e),F=0,[]}function K(e){return H="",e}function X(e){return E(G(F-1,ee(91===e?e+2:40===e?e+1:e)))}function J(e){for(;(z=Y())&&z<33;)B();return q(e)>2||q(z)>3?"":" "}function Q(e,t){for(;--t&&B()&&!(z<48||z>102||z>57&&z<65||z>70&&z<97););return G(e,U()+(t<6&&32==Y()&&32==B()))}function ee(e){for(;B();)switch(z){case e:return F;case 34:case 39:34!==e&&39!==e&&ee(z);break;case 40:41===e&&ee(e);break;case 92:B()}return F}function te(e,t){for(;B()&&e+z!==57&&(e+z!==84||47!==Y()););return"/*"+G(t,F-1)+"*"+O(47===e?e:B())}function ne(e){for(;!q(Y());)B();return G(e,F)}var re="-ms-",ae="-webkit-",ie="comm",oe="rule",le="decl",se="@keyframes";function ce(e,t){for(var n="",r=R(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function ue(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case le:return e.return=e.return||e.value;case ie:return"";case se:return e.return=e.value+"{"+ce(e.children,r)+"}";case oe:e.value=e.props.join(",")}return M(n=ce(e.children,r))?e.return=e.value+"{"+n+"}":""}function fe(e){return function(t){t.root||(t=t.return)&&e(t)}}function de(e){return K(he("",null,null,null,[""],e=Z(e),0,[0],e))}function he(e,t,n,r,a,i,o,l,s){for(var c=0,u=0,f=o,d=0,h=0,p=0,v=1,m=1,y=1,g=0,b="",x=a,_=i,w=r,k=b;m;)switch(p=g,g=B()){case 40:if(108!=p&&58==D(k,f-1)){-1!=C(k+=A(X(g),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:k+=X(g);break;case 9:case 10:case 13:case 32:k+=J(p);break;case 92:k+=Q(U()-1,7);continue;case 47:switch(Y()){case 42:case 47:I(ve(te(B(),U()),t,n),s);break;default:k+="/"}break;case 123*v:l[c++]=M(k)*y;case 125*v:case 59:case 0:switch(g){case 0:case 125:m=0;case 59+u:-1==y&&(k=A(k,/\f/g,"")),h>0&&M(k)-f&&I(h>32?me(k+";",r,n,f-1):me(A(k," ","")+";",r,n,f-2),s);break;case 59:k+=";";default:if(I(w=pe(k,t,n,c,u,a,l,b,x=[],_=[],f),i),123===g)if(0===u)he(k,t,w,w,x,i,f,l,_);else switch(99===d&&110===D(k,3)?100:d){case 100:case 108:case 109:case 115:he(e,w,w,r&&I(pe(e,w,w,0,0,a,l,b,a,x=[],f),_),a,_,f,l,r?x:_);break;default:he(k,w,w,w,[""],_,0,l,_)}}c=u=h=0,v=y=1,b=k="",f=o;break;case 58:f=1+M(k),h=p;default:if(v<1)if(123==g)--v;else if(125==g&&0==v++&&125==$())continue;switch(k+=O(g),g*v){case 38:y=u>0?1:(k+="\f",-1);break;case 44:l[c++]=(M(k)-1)*y,y=1;break;case 64:45===Y()&&(k+=X(B())),d=Y(),u=f=M(b=k+=ne(U())),g++;break;case 45:45===p&&2==M(k)&&(v=0)}}return i}function pe(e,t,n,r,a,i,o,l,s,c,u){for(var f=a-1,d=0===a?i:[""],h=R(d),p=0,v=0,m=0;p<r;++p)for(var y=0,g=P(e,f+1,f=S(v=o[p])),b=e;y<h;++y)(b=E(v>0?d[y]+" "+g:A(g,/&\f/g,d[y])))&&(s[m++]=b);return V(e,t,n,0===a?oe:l,s,c,u)}function ve(e,t,n){return V(e,t,n,ie,O(z),P(e,2,-2),0)}function me(e,t,n,r){return V(e,t,n,le,P(e,0,r),P(e,r+1,-1),r)}var ye=function(e,t,n){for(var r=0,a=0;r=a,a=Y(),38===r&&12===a&&(t[n]=1),!q(a);)B();return G(e,F)},ge=new WeakMap,be=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ge.get(n))&&!r){ge.set(e,!0);for(var a=[],i=function(e,t){return K(function(e,t){var n=-1,r=44;do{switch(q(r)){case 0:38===r&&12===Y()&&(t[n]=1),e[n]+=ye(F-1,t,n);break;case 2:e[n]+=X(r);break;case 4:if(44===r){e[++n]=58===Y()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=O(r)}}while(r=B());return e}(Z(e),t))}(t,a),o=n.props,l=0,s=0;l<i.length;l++)for(var c=0;c<o.length;c++,s++)e.props[s]=a[l]?i[l].replace(/&\f/g,o[c]):o[c]+" "+i[l]}}},xe=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function _e(e,t){switch(function(e,t){return 45^D(e,0)?(((t<<2^D(e,0))<<2^D(e,1))<<2^D(e,2))<<2^D(e,3):0}(e,t)){case 5103:return"-webkit-print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ae+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ae+e+"-moz-"+e+re+e+e;case 6828:case 4268:return ae+e+re+e+e;case 6165:return ae+e+re+"flex-"+e+e;case 5187:return ae+e+A(e,/(\w+).+(:[^]+)/,"-webkit-box-$1$2-ms-flex-$1$2")+e;case 5443:return ae+e+re+"flex-item-"+A(e,/flex-|-self/,"")+e;case 4675:return ae+e+re+"flex-line-pack"+A(e,/align-content|flex-|-self/,"")+e;case 5548:return ae+e+re+A(e,"shrink","negative")+e;case 5292:return ae+e+re+A(e,"basis","preferred-size")+e;case 6060:return"-webkit-box-"+A(e,"-grow","")+ae+e+re+A(e,"grow","positive")+e;case 4554:return ae+A(e,/([^-])(transform)/g,"$1-webkit-$2")+e;case 6187:return A(A(A(e,/(zoom-|grab)/,"-webkit-$1"),/(image-set)/,"-webkit-$1"),e,"")+e;case 5495:case 3959:return A(e,/(image-set\([^]*)/,"-webkit-$1$`$1");case 4968:return A(A(e,/(.+:)(flex-)?(.*)/,"-webkit-box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+ae+e+e;case 4095:case 3583:case 4068:case 2532:return A(e,/(.+)-inline(.+)/,"-webkit-$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(M(e)-1-t>6)switch(D(e,t+1)){case 109:if(45!==D(e,t+4))break;case 102:return A(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1-moz-"+(108==D(e,t+3)?"$3":"$2-$3"))+e;case 115:return~C(e,"stretch")?_e(A(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==D(e,t+1))break;case 6444:switch(D(e,M(e)-3-(~C(e,"!important")&&10))){case 107:return A(e,":",":-webkit-")+e;case 101:return A(e,/(.+:)([^;!]+)(;|!.+)?/,"$1-webkit-"+(45===D(e,14)?"inline-":"")+"box$3$1-webkit-$2$3$1-ms-$2box$3")+e}break;case 5936:switch(D(e,t+11)){case 114:return ae+e+re+A(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ae+e+re+A(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ae+e+re+A(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ae+e+re+e+e}return e}var we=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case le:e.return=_e(e.value,e.length);break;case se:return ce([W(e,{value:A(e.value,"@","@-webkit-")})],r);case oe:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return ce([W(e,{props:[A(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ce([W(e,{props:[A(t,/:(plac\w+)/,":-webkit-input-$1")]}),W(e,{props:[A(t,/:(plac\w+)/,":-moz-$1")]}),W(e,{props:[A(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}return""}))}}],ke=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,a,i=e.stylisPlugins||we,o={},l=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)o[t[n]]=!0;l.push(e)}));var s,c,u,f=[be,xe],d=[ue,fe((function(e){s.insert(e)}))],h=(c=f.concat(i,d),u=R(c),function(e,t,n,r){for(var a="",i=0;i<u;i++)a+=c[i](e,t,n,r)||"";return a});a=function(e,t,n,r){s=n,ce(de(e?e+"{"+t.styles+"}":t.styles),h),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new k({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:a};return p.sheet.hydrate(l),p},Se={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Oe(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}function je(e){return je="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},je(e)}var Ee=/[A-Z]|^ms/g,Ae=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ce=function(e){return 45===e.charCodeAt(1)},De=function(e){return null!=e&&"boolean"!=typeof e},Pe=Oe((function(e){return Ce(e)?e:e.replace(Ee,"-$&").toLowerCase()})),Me=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ae,(function(e,t,n){return Ie={name:t,styles:n,next:Ie},t}))}return 1===Se[e]||Ce(e)||"number"!=typeof t||0===t?t:t+"px"};function Re(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(je(n)){case"boolean":return"";case"object":if(1===n.anim)return Ie={name:n.name,styles:n.styles,next:Ie},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Ie={name:r.name,styles:r.styles,next:Ie},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=Re(e,t,n[a])+";";else for(var i in n){var o=n[i];if("object"!==je(o))null!=t&&void 0!==t[o]?r+=i+"{"+t[o]+"}":De(o)&&(r+=Pe(i)+":"+Me(i,o)+";");else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var l=Re(e,t,o);switch(i){case"animation":case"animationName":r+=Pe(i)+":"+l+";";break;default:r+=i+"{"+l+"}"}}else for(var s=0;s<o.length;s++)De(o[s])&&(r+=Pe(i)+":"+Me(i,o[s])+";")}return r}(e,t,n);case"function":if(void 0!==e){var a=Ie,i=n(e);return Ie=a,Re(e,t,i)}}if(null==t)return n;var o=t[n];return void 0!==o?o:n}var Ie,Le=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Ne=function(e,t,n){if(1===e.length&&"object"===je(e[0])&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,a="";Ie=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,a+=Re(n,t,i)):a+=i[0];for(var o=1;o<e.length;o++)a+=Re(n,t,e[o]),r&&(a+=i[o]);Le.lastIndex=0;for(var l,s="";null!==(l=Le.exec(a));)s+="-"+l[1];var c=function(e){for(var t,n=0,r=0,a=e.length;a>=4;++r,a-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(a){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(a)+s;return{name:c,styles:a,next:Ie}};!!e.useInsertionEffect&&e.useInsertionEffect||e.useLayoutEffect,e.createContext("undefined"!=typeof HTMLElement?ke({key:"css"}):null).Provider;var Te=function(e,t,n){!function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)}(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}};n(480);var Fe={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function He(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ve=Object.defineProperty,We=Object.getOwnPropertySymbols,$e=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable,Ye=function(e,t,n){return t in e?Ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ue=function(e,t){for(var n in t||(t={}))$e.call(t,n)&&Ye(e,n,t[n]);if(We){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return He(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?He(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(We(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Be.call(t,n)&&Ye(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function Ge(e){return function(t){return"number"==typeof e.primaryShade?e.primaryShade:e.primaryShade[t||e.colorScheme]}}function qe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ze(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ke(e){var t=Ge(e);return function(n,r){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("string"==typeof n&&n.includes(".")){var o=n.split("."),l=qe(o,2),s=l[0],c=l[1],u=parseInt(c,10);if(s in e.colors&&u>=0&&u<10)return e.colors[s]["number"!=typeof r||i?u:r]}var f="number"==typeof r?r:t();return n in e.colors?e.colors[n][f]:a?e.colors[e.primaryColor][f]:n}}function Xe(e){for(var t="",n=1;n<e.length-1;n+=1)t+="".concat(e[n]," ").concat(n/(e.length-1)*100,"%, ");return"".concat(e[0]," 0%, ").concat(t).concat(e[e.length-1]," 100%")}function Je(e){var t=Ke(e),n=Ge(e);return function(r){var a={from:(null==r?void 0:r.from)||e.defaultGradient.from,to:(null==r?void 0:r.to)||e.defaultGradient.to,deg:(null==r?void 0:r.deg)||e.defaultGradient.deg};return"linear-gradient(".concat(a.deg,"deg, ").concat(t(a.from,n(),!1)," 0%, ").concat(t(a.to,n(),!1)," 100%)")}}function Qe(e){return function(t){if("number"==typeof t)return"".concat(t/16).concat(e);if("string"==typeof t){var n=t.replace("px","");if(!Number.isNaN(Number(n)))return"".concat(Number(n)/16).concat(e)}return t}}var et=Qe("rem"),tt=Qe("em");function nt(e){var t=e.size,n=e.sizes,r=e.units;return t in n?n[t]:"number"==typeof t?"em"===r?tt(t):et(t):t||n.md}function rt(e){return"number"==typeof e?e:"string"==typeof e&&e.includes("rem")?16*Number(e.replace("rem","")):"string"==typeof e&&e.includes("em")?16*Number(e.replace("em","")):Number(e)}function at(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function it(e){return function(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}(e)?function(e){var t=e.replace("#","");if(3===t.length){var n=t.split("");t=[n[0],n[0],n[1],n[1],n[2],n[2]].join("")}var r=parseInt(t,16);return{r:r>>16&255,g:r>>8&255,b:255&r,a:1}}(e):e.startsWith("rgb")?function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return at(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?at(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.replace(/[^0-9,.]/g,"").split(",").map(Number),4);return{r:t[0],g:t[1],b:t[2],a:t[3]||1}}(e):{r:0,g:0,b:0,a:1}}function ot(e,t){if("string"!=typeof e||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(--"))return e;var n=it(e),r=n.r,a=n.g,i=n.b;return"rgba(".concat(r,", ").concat(a,", ").concat(i,", ").concat(t,")")}function lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var st={fontStyles:function(e){return function(){return{fontFamily:e.fontFamily||"sans-serif"}}},themeColor:Ke,focusStyles:function(e){return function(t){var n;return ze(n={WebkitTapHighlightColor:"transparent"},t||"&:focus",Ue({},"always"===e.focusRing||"auto"===e.focusRing?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e))),ze(n,t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)",Ue({},"auto"===e.focusRing||"never"===e.focusRing?e.focusRingStyles.resetStyles(e):null)),n}},linearGradient:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"linear-gradient(".concat(e,"deg, ").concat(Xe(n),")")},radialGradient:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"radial-gradient(circle, ".concat(Xe(t),")")},smallerThan:function(e){return function(t){return"@media (max-width: ".concat(tt(rt(nt({size:t,sizes:e.breakpoints}))-1),")")}},largerThan:function(e){return function(t){return"@media (min-width: ".concat(tt(rt(nt({size:t,sizes:e.breakpoints}))),")")}},rgba:ot,cover:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{position:"absolute",top:et(e),right:et(e),left:et(e),bottom:et(e)}},darken:function(e,t){if("string"==typeof e&&e.startsWith("var(--"))return e;var n=it(e),r=n.r,a=n.g,i=n.b,o=n.a,l=1-t,s=function(e){return Math.round(e*l)};return"rgba(".concat(s(r),", ").concat(s(a),", ").concat(s(i),", ").concat(o,")")},lighten:function(e,t){if("string"==typeof e&&e.startsWith("var(--"))return e;var n=it(e),r=n.r,a=n.g,i=n.b,o=n.a,l=function(e){return Math.round(e+(255-e)*t)};return"rgba(".concat(l(r),", ").concat(l(a),", ").concat(l(i),", ").concat(o,")")},radius:function(e){return function(t){if("number"==typeof t)return et(t);var n="number"==typeof e.defaultRadius?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||n}},variant:function(e){var t=Ke(e),n=Ge(e),r=Je(e);return function(a){var i=a.variant,o=a.color,l=a.gradient,s=a.primaryFallback,c=function(e,t){if("string"==typeof e&&e.includes(".")){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split("."),2),r=n[0],a=n[1],i=parseInt(a,10);if(r in t.colors&&i>=0&&i<10)return{isSplittedColor:!0,key:r,shade:i}}return{isSplittedColor:!1}}(o,e);switch(i){case"light":return{border:"transparent",background:ot(t(o,"dark"===e.colorScheme?8:0,s,!1),"dark"===e.colorScheme?.2:1),color:"dark"===o?"dark"===e.colorScheme?e.colors.dark[0]:e.colors.dark[9]:t(o,"dark"===e.colorScheme?2:n("light")),hover:ot(t(o,"dark"===e.colorScheme?7:1,s,!1),"dark"===e.colorScheme?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:"dark"===o?"dark"===e.colorScheme?e.colors.dark[0]:e.colors.dark[9]:t(o,"dark"===e.colorScheme?2:n("light")),hover:ot(t(o,"dark"===e.colorScheme?8:0,s,!1),"dark"===e.colorScheme?.2:1)};case"outline":return{border:t(o,"dark"===e.colorScheme?5:n("light")),background:"transparent",color:t(o,"dark"===e.colorScheme?5:n("light")),hover:"dark"===e.colorScheme?ot(t(o,5,s,!1),.05):ot(t(o,0,s,!1),.35)};case"default":return{border:"dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[4],background:"dark"===e.colorScheme?e.colors.dark[6]:e.white,color:"dark"===e.colorScheme?e.white:e.black,hover:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]};case"white":return{border:"transparent",background:e.white,color:t(o,n()),hover:null};case"transparent":return{border:"transparent",color:"dark"===o?"dark"===e.colorScheme?e.colors.dark[0]:e.colors.dark[9]:t(o,"dark"===e.colorScheme?2:n("light")),background:"transparent",hover:null};case"gradient":return{background:r(l),color:e.white,border:"transparent",hover:null};default:var u=n(),f=c.isSplittedColor?c.shade:u,d=c.isSplittedColor?c.key:o;return{border:"transparent",background:t(d,f,s),color:e.white,hover:t(d,9===f?8:f+1)}}}},primaryShade:Ge,hover:function(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}},gradient:Je,primaryColor:function(e){return function(t){var n=Ge(e)(t);return e.colors[e.primaryColor][n]}},placeholderStyles:function(e){return function(){return{userSelect:"none",color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[5]}}},dimmed:function(e){return function(){return"dark"===e.colorScheme?e.colors.dark[2]:e.colors.gray[6]}}};function ct(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ut=Object.defineProperty,ft=Object.defineProperties,dt=Object.getOwnPropertyDescriptors,ht=Object.getOwnPropertySymbols,pt=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable,mt=function(e,t,n){return t in e?ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};function yt(e){return yt="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},yt(e)}Object.keys(Fe);var gt,bt,xt,_t=(bt=function(e,t){for(var n in t||(t={}))pt.call(t,n)&&mt(e,n,t[n]);if(ht){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ct(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ct(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(ht(t));try{for(a.s();!(r=a.n()).done;)n=r.value,vt.call(t,n)&&mt(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({},gt={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:Fe,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1)",sm:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 0.625rem 0.9375rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.4375rem 0.4375rem -0.3125rem",md:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.25rem 1.5625rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.625rem 0.625rem -0.3125rem",lg:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.75rem 1.4375rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 0.75rem 0.75rem -0.4375rem",xl:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"},fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},radius:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"2rem"},spacing:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:"2.125rem",lineHeight:1.3,fontWeight:void 0},h2:{fontSize:"1.625rem",lineHeight:1.35,fontWeight:void 0},h3:{fontSize:"1.375rem",lineHeight:1.4,fontWeight:void 0},h4:{fontSize:"1.125rem",lineHeight:1.45,fontWeight:void 0},h5:{fontSize:"1rem",lineHeight:1.5,fontWeight:void 0},h6:{fontSize:"0.875rem",lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(0.0625rem)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:function(e){return{outlineOffset:"0.125rem",outline:"0.125rem solid ".concat(e.colors[e.primaryColor]["dark"===e.colorScheme?7:5])}},resetStyles:function(){return{outline:"none"}},inputStyles:function(e){return{outline:"none",borderColor:e.colors[e.primaryColor]["object"===yt(e.primaryShade)?e.primaryShade[e.colorScheme]:e.primaryShade]}}}}),xt={fn:{fontStyles:st.fontStyles(gt),themeColor:st.themeColor(gt),focusStyles:st.focusStyles(gt),largerThan:st.largerThan(gt),smallerThan:st.smallerThan(gt),radialGradient:st.radialGradient,linearGradient:st.linearGradient,gradient:st.gradient(gt),rgba:st.rgba,cover:st.cover,lighten:st.lighten,darken:st.darken,primaryShade:st.primaryShade(gt),radius:st.radius(gt),variant:st.variant(gt),hover:st.hover,primaryColor:st.primaryColor(gt),placeholderStyles:st.placeholderStyles(gt),dimmed:st.dimmed(gt)}},ft(bt,dt(xt)));function wt(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,"".concat(et(1)," dotted ButtonText");var St=Object.defineProperty,Ot=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,At=function(e,t,n){return t in e?St(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ct=function(e,t){for(var n in t||(t={}))jt.call(t,n)&&At(e,n,t[n]);if(Ot){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return kt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(Ot(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Et.call(t,n)&&At(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Dt=(0,e.createContext)({theme:_t});function Pt(){var t;return(null==(t=(0,e.useContext)(Dt))?void 0:t.theme)||_t}function Mt(){var t;return null==(t=(0,e.useContext)(Dt))?void 0:t.emotionCache}function Rt(e,t,n){var r,a=Pt(),i=null==(r=a.components[e])?void 0:r.defaultProps,o="function"==typeof i?i(a):i;return Ct(Ct(Ct({},t),o),wt(n))}function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lt(t){var n=t.value,r=t.defaultValue,a=t.finalValue,i=t.onChange,o=void 0===i?function(){}:i,l=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return It(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?It(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(void 0!==r?r:a),2),s=l[0],c=l[1];return void 0!==n?[n,o,!0]:[s,function(e){c(e),null==o||o(e)},!1]}function Nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Tt=function(e){return"range"===e?[null,null]:"multiple"===e?[]:null};function Ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zt(e,t){var n=function(e){return function(e){if(Array.isArray(e))return Ft(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ft(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t).sort((function(e,t){return e.getTime()-t.getTime()}));return g()(n[0]).startOf("day").subtract(1,"ms").isBefore(e)&&g()(n[1]).endOf("day").add(1,"ms").isAfter(e)}function Ht(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||Vt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vt(e,t){if(e){if("string"==typeof e)return Wt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wt(e,t):void 0}}function Wt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $t(t){var n=t.type,r=t.level,a=t.value,i=t.defaultValue,o=t.onChange,l=t.allowSingleDateInRange,s=t.allowDeselect,c=t.onMouseLeave,u=function(t){var n=t.type,r=t.value,a=t.defaultValue,i=t.onChange,o=(0,e.useRef)(n),l=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Nt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Lt({value:r,defaultValue:a,onChange:i,finalValue:Tt(n)}),2),s=l[0],c=l[1],u=s;return o.current!==n&&(o.current=n,void 0===r&&c(u=void 0!==a?a:Tt(n))),[u,c]}({type:n,value:a,defaultValue:i,onChange:o}),f=Ht(u,2),d=f[0],h=f[1],p=Ht((0,e.useState)("range"===n&&d[0]&&!d[1]?d[0]:null),2),v=p[0],m=p[1],y=Ht((0,e.useState)(null),2),b=y[0],x=y[1],_=function(e){return v instanceof Date&&b instanceof Date?zt(e,[b,v]):d[0]instanceof Date&&d[1]instanceof Date&&zt(e,d)},w=function(e){return d[0]instanceof Date&&!!g()(e).isSame(d[0],r)&&!(b&&g()(b).isBefore(d[0]))},k=function(e){return d[1]instanceof Date?g()(e).isSame(d[1],r):!!(d[0]instanceof Date&&b)&&g()(b).isBefore(d[0])&&g()(e).isSame(d[0],r)};return{onDateChange:function(e){if("range"===n){if(v instanceof Date&&!d[1]){if(g()(e).isSame(v,r)&&!l)return m(null),x(null),void h([null,null]);var t=[e,v];return t.sort((function(e,t){return e.getTime()-t.getTime()})),h(t),x(null),void m(null)}return d[0]&&!d[1]&&g()(e).isSame(d[0],r)&&!l?(m(null),x(null),void h([null,null])):(h([e,null]),x(null),void m(e))}"multiple"!==n?d&&s&&g()(e).isSame(d,r)?h(null):h(e):d.some((function(t){return g()(t).isSame(e,r)}))?h(d.filter((function(t){return!g()(t).isSame(e,r)}))):h([].concat(function(e){return function(e){if(Array.isArray(e))return Wt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Vt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(d),[e]))},onRootMouseLeave:"range"===n?function(e){null==c||c(e),x(null)}:c,onHoveredDateChange:"range"===n&&v?x:function(){},getControlProps:function(e){if("range"===n)return{selected:d.some((function(t){return t&&g()(t).isSame(e,r)})),inRange:_(e),firstInRange:w(e),lastInRange:k(e),"data-autofocus":!!d[0]&&g()(d[0]).isSame(e,r)||void 0};if("multiple"===n)return{selected:d.some((function(t){return t&&g()(t).isSame(e,r)})),"data-autofocus":!!d[0]&&g()(d[0]).isSame(e,r)||void 0};var t=g()(d).isSame(e,r);return{selected:t,"data-autofocus":t||void 0}},_value:d,setValue:h}}function Bt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Yt=Object.getOwnPropertySymbols,Ut=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable;function qt(e){var t=e,n=t.m,r=t.mx,a=t.my,i=t.mt,o=t.mb,l=t.ml,s=t.mr,c=t.p,u=t.px,f=t.py,d=t.pt,h=t.pb,p=t.pl,v=t.pr,m=t.bg,y=t.c,g=t.opacity,b=t.ff,x=t.fz,_=t.fw,w=t.lts,k=t.ta,S=t.lh,O=t.fs,j=t.tt,E=t.td,A=t.w,C=t.miw,D=t.maw,P=t.h,M=t.mih,R=t.mah,I=t.bgsz,L=t.bgp,N=t.bgr,T=t.bga,F=t.pos,z=t.top,H=t.left,V=t.bottom,W=t.right,$=t.inset,B=t.display,Y=function(e,t){var n={};for(var r in e)Ut.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Yt){var a,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Bt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(Yt(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Gt.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:wt({m:n,mx:r,my:a,mt:i,mb:o,ml:l,mr:s,p:c,px:u,py:f,pt:d,pb:h,pl:p,pr:v,bg:m,c:y,opacity:g,ff:b,fz:x,fw:_,lts:w,ta:k,lh:S,fs:O,tt:j,td:E,w:A,miw:C,maw:D,h:P,mih:M,mah:R,bgsz:I,bgp:L,bgr:N,bga:T,pos:F,top:z,left:H,bottom:V,right:W,inset:$,display:B}),rest:Y}}function Zt(e){return Zt="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},Zt(e)}function Kt(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"===Zt(e))if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Kt(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Xt(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Kt(e))&&(r&&(r+=" "),r+=t);return r}function Jt(e){return function(e){if(Array.isArray(e))return Qt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Qt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var en=ke({key:"mantine",prepend:!0});function tn(e,t){if(e){if("string"==typeof e)return nn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nn(e,t):void 0}}function nn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rn=Object.defineProperty,an=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,ln=Object.prototype.propertyIsEnumerable,sn=function(e,t,n){return t in e?rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};function cn(e){var t;if(1!==e.length)return{args:e,ref:t};var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||tn(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,1)[0];if(!(n instanceof Object))return{args:e,ref:t};if(!("ref"in n))return{args:e,ref:t};t=n.ref;var r=function(e,t){for(var n in t||(t={}))on.call(t,n)&&sn(e,n,t[n]);if(an){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=tn(e))){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(an(t));try{for(a.s();!(r=a.n()).done;)n=r.value,ln.call(t,n)&&sn(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({},n);return delete r.ref,{args:[r],ref:t}}var un=function(){function e(e,t,n){var r=[],a=function(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}(e,r,n);return r.length<2?n:a+t(r)}return{cssFactory:function(t){var n=t.cache,r=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=cn(t),i=a.ref,o=a.args,l=Ne(o,n.registered);return Te(n,l,!1),"".concat(n.key,"-").concat(l.name).concat(void 0===i?"":" ".concat(i))};return{css:r,cx:function(){for(var t=arguments.length,a=new Array(t),i=0;i<t;i++)a[i]=arguments[i];return e(n.registered,r,Xt(a))}}}}}().cssFactory;function fn(){var t,n,r,a=Mt()||en;return t=function(){return un({cache:a})},n=[a],(!(r=(0,e.useRef)()).current||n.length!==r.current.prevDeps.length||r.current.prevDeps.map((function(e,t){return e===n[t]})).indexOf(!1)>=0)&&(r.current={v:t(),prevDeps:Jt(n)}),r.current.v}function dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hn(e){return hn="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},hn(e)}function pn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vn(e){var t=e.value,n=e.theme,r=e.getValue,a=e.property;if(null!=t){if("object"===hn(t)){var i=function(e,t){var n=Object.keys(e).filter((function(e){return"base"!==e})).sort((function(e,n){return rt(nt({size:e,sizes:t.breakpoints}))-rt(nt({size:n,sizes:t.breakpoints}))}));return"base"in e?["base"].concat(function(e){return function(e){if(Array.isArray(e))return pn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return pn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n)):n}(t,n).reduce((function(e,i){if("base"===i&&void 0!==t.base){var o=r(t.base,n);return Array.isArray(a)?(a.forEach((function(t){e[t]=o})),e):(e[a]=o,e)}var l=r(t[i],n);return Array.isArray(a)?(e[n.fn.largerThan(i)]={},a.forEach((function(t){e[n.fn.largerThan(i)][t]=l})),e):(e[n.fn.largerThan(i)]=dn({},a,l),e)}),{});return i}var o=r(t,n);return Array.isArray(a)?a.reduce((function(e,t){return e[t]=o,e}),{}):dn({},a,o)}}var mn=["-xs","-sm","-md","-lg","-xl"],yn={identity:function(e){return e},color:function(e,t){return"dimmed"===e?"dark"===t.colorScheme?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background},size:function(e){return et(e)},fontSize:function(e,t){return nt({size:e,sizes:t.fontSizes})},spacing:function(e,t){return mn.includes(e)?"calc(".concat(nt({size:e.replace("-",""),sizes:t.spacing})," * -1)"):nt({size:e,sizes:t.spacing})}},gn={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"}};function bn(e){return bn="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},bn(e)}function xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _n=Object.defineProperty,wn=Object.getOwnPropertySymbols,kn=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable,On=function(e,t,n){return t in e?_n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},jn=function(e,t){for(var n in t||(t={}))kn.call(t,n)&&On(e,n,t[n]);if(wn){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return xn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(wn(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Sn.call(t,n)&&On(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function En(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gn,r=Object.keys(n).reduce((function(r,a){return a in e&&void 0!==e[a]&&r.push(vn({value:e[a],getValue:yn[n[a].type],property:n[a].property,theme:t})),r}),[]);return r.reduce((function(e,t){return Object.keys(t).forEach((function(n){"object"===bn(t[n])&&null!==t[n]?e[n]=n in e?jn(jn({},e[n]),t[n]):t[n]:e[n]=t[n]})),e}),{})}function An(e,t){return"function"==typeof e?e(t):e}function Cn(e,t,n){var r=Pt(),a=fn(),i=a.css,o=a.cx;return Array.isArray(e)?o(n,i(En(t,r)),e.map((function(e){return i(An(e,r))}))):o(n,i(An(e,r)),i(En(t,r)))}function Dn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Pn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Pn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Mn=Object.defineProperty,Rn=Object.getOwnPropertySymbols,In=Object.prototype.hasOwnProperty,Ln=Object.prototype.propertyIsEnumerable,Nn=function(e,t,n){return t in e?Mn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Tn=(0,e.forwardRef)((function(e,n){var r=e,a=r.className,i=r.component,o=r.style,l=r.sx,s=qt(function(e,t){var n={};for(var r in e)In.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Rn){var a,i=Dn(Rn(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Ln.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","component","style","sx"])),c=s.systemStyles,u=s.rest,f=i||"div";return t().createElement(f,function(e,t){for(var n in t||(t={}))In.call(t,n)&&Nn(e,n,t[n]);if(Rn){var r,a=Dn(Rn(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ln.call(t,n)&&Nn(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({ref:n,className:Cn(l,c,a),style:o},u))}));Tn.displayName="@mantine/core/Box";var Fn=Tn;function zn(e,t){return e?"month"===e?0:"year"===e?1:2:t}function Hn(e,t,n){return a=zn(e,0),i=zn(t,0),o=zn(n,2),0===(r=Math.min(Math.max(a,i),o))?"month":1===r?"year":"decade";var r,a,i,o}function Vn(e){var t=e.cx,n=e.classes,r=e.context,a=e.classNames,i=e.name,o=e.cache,l=r.reduce((function(e,t){return Object.keys(t.classNames).forEach((function(n){"string"!=typeof e[n]?e[n]="".concat(t.classNames[n]):e[n]="".concat(e[n]," ").concat(t.classNames[n])})),e}),{});return Object.keys(n).reduce((function(e,r){return e[r]=t(n[r],l[r],null!=a&&a[r],Array.isArray(i)?i.filter(Boolean).map((function(e){return"".concat((null==o?void 0:o.key)||"mantine","-").concat(e,"-").concat(r)})).join(" "):i?"".concat((null==o?void 0:o.key)||"mantine","-").concat(i,"-").concat(r):null),e}),{})}function Wn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $n=Object.defineProperty,Bn=Object.getOwnPropertySymbols,Yn=Object.prototype.hasOwnProperty,Un=Object.prototype.propertyIsEnumerable,Gn=function(e,t,n){return t in e?$n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},qn=function(e,t){for(var n in t||(t={}))Yn.call(t,n)&&Gn(e,n,t[n]);if(Bn){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Wn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(Bn(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Un.call(t,n)&&Gn(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function Zn(e,t){return t&&Object.keys(t).forEach((function(n){e[n]?e[n]=qn(qn({},e[n]),t[n]):e[n]=qn({},t[n])})),e}function Kn(e,t,n,r){var a=function(e){return"function"==typeof e?e(t,n||{},r):e||{}};return Array.isArray(e)?e.map((function(e){return a(e.styles)})).reduce((function(e,t){return Zn(e,t)}),{}):a(e)}function Xn(e){var t="function"==typeof e?e:function(){return e};return function(e,n){var r=Pt(),a=function(e){var t=Pt(),n=function(e){var n,r,a,i;return{styles:(null==(n=t.components[e])?void 0:n.styles)||{},classNames:(null==(r=t.components[e])?void 0:r.classNames)||{},variants:null==(a=t.components[e])?void 0:a.variants,sizes:null==(i=t.components[e])?void 0:i.sizes}};return Array.isArray(e)?e.map(n):[n(e)]}(null==n?void 0:n.name),i=Mt(),o={variant:null==n?void 0:n.variant,size:null==n?void 0:n.size},l=fn(),s=l.css,c=l.cx,u=t(r,e,o),f=Kn(null==n?void 0:n.styles,r,e,o),d=Kn(a,r,e,o),h=function(e){var t=e.theme,n=e.params,r=e.variant,a=e.size;return e.ctx.reduce((function(e,i){return i.variants&&r in i.variants&&Zn(e,i.variants[r](t,n,{variant:r,size:a})),i.sizes&&a in i.sizes&&Zn(e,i.sizes[a](t,n,{variant:r,size:a})),e}),{})}({ctx:a,theme:r,params:e,variant:null==n?void 0:n.variant,size:null==n?void 0:n.size}),p=Object.fromEntries(Object.keys(u).map((function(e){return[e,c(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},s(u[e]),!(null==n?void 0:n.unstyled)),s(h[e]),s(d[e]),s(f[e]))]})));return{classes:Vn({cx:c,classes:p,context:a,classNames:null==n?void 0:n.classNames,name:null==n?void 0:n.name,cache:i}),cx:c,theme:r}}}const Jn=Xn((function(){return{calendar:{}}}));var Qn=Xn((function(e,t,n){return{monthLevelGroup:{display:"flex","& [data-month-level]:not(:last-of-type)":{marginRight:nt({size:n.size,sizes:e.spacing})}}}}));const er=Qn,tr=Xn((function(e){return{monthLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}}));Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var nr={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–"},rr=(0,e.createContext)(nr);function ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ir=Object.defineProperty,or=Object.defineProperties,lr=Object.getOwnPropertyDescriptors,sr=Object.getOwnPropertySymbols,cr=Object.prototype.hasOwnProperty,ur=Object.prototype.propertyIsEnumerable,fr=function(e,t,n){return t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};function dr(){var t,n=(0,e.useContext)(rr),r=(0,e.useCallback)((function(e){return e||n.locale}),[n.locale]),a=(0,e.useCallback)((function(e){return"number"==typeof e?e:n.firstDayOfWeek}),[n.firstDayOfWeek]),i=(0,e.useCallback)((function(e){return Array.isArray(e)?e:n.weekendDays}),[n.weekendDays]),o=(0,e.useCallback)((function(e){return"string"==typeof e?e:n.labelSeparator}),[n.labelSeparator]);return t=function(e,t){for(var n in t||(t={}))cr.call(t,n)&&fr(e,n,t[n]);if(sr){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ar(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ar(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(sr(t));try{for(a.s();!(r=a.n()).done;)n=r.value,ur.call(t,n)&&fr(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({},n),or(t,lr({getLocale:r,getFirstDayOfWeek:a,getWeekendDays:i,getLabelSeparator:o}))}function hr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var pr=Object.defineProperty,vr=Object.defineProperties,mr=Object.getOwnPropertyDescriptors,yr=Object.getOwnPropertySymbols,gr=Object.prototype.hasOwnProperty,br=Object.prototype.propertyIsEnumerable,xr=function(e,t,n){return t in e?pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},_r=function(e,t){for(var n in t||(t={}))gr.call(t,n)&&xr(e,n,t[n]);if(yr){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return hr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(yr(t));try{for(a.s();!(r=a.n()).done;)n=r.value,br.call(t,n)&&xr(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};const wr=Xn((function(e){return{root:(t=_r(_r({},e.fn.focusStyles()),e.fn.fontStyles()),n={cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:"dark"===e.colorScheme?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"},vr(t,mr(n)))};var t,n}));function kr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Sr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Sr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Or=Object.defineProperty,jr=Object.getOwnPropertySymbols,Er=Object.prototype.hasOwnProperty,Ar=Object.prototype.propertyIsEnumerable,Cr=function(e,t,n){return t in e?Or(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Dr=(0,e.forwardRef)((function(e,n){var r=Rt("UnstyledButton",{},e),a=r.className,i=r.component,o=void 0===i?"button":i,l=r.unstyled,s=r.variant,c=function(e,t){var n={};for(var r in e)Er.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&jr){var a,i=kr(jr(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Ar.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","component","unstyled","variant"]),u=wr(null,{name:"UnstyledButton",unstyled:l,variant:s}),f=u.classes,d=u.cx;return t().createElement(Fn,function(e,t){for(var n in t||(t={}))Er.call(t,n)&&Cr(e,n,t[n]);if(jr){var r,a=kr(jr(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ar.call(t,n)&&Cr(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({component:o,ref:n,className:d(f.root,a),type:"button"===o?"button":void 0},c))}));Dr.displayName="@mantine/core/UnstyledButton";var Pr=Dr;function Mr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Rr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ir=Object.defineProperty,Lr=Object.getOwnPropertySymbols,Nr=Object.prototype.hasOwnProperty,Tr=Object.prototype.propertyIsEnumerable,Fr=function(e,t,n){return t in e?Ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},zr=function(e,t){for(var n in t||(t={}))Nr.call(t,n)&&Fr(e,n,t[n]);if(Lr){var r,a=Mr(Lr(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Tr.call(t,n)&&Fr(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function Hr(e){var n=e,r=n.style,a=function(e,t){var n={};for(var r in e)Nr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Lr){var a,i=Mr(Lr(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Tr.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(n,["style"]);return t().createElement("svg",zr({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:zr({width:et(16),height:et(16)},r)},a),t().createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function Vr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Wr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Wr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $r=Object.defineProperty,Br=Object.defineProperties,Yr=Object.getOwnPropertyDescriptors,Ur=Object.getOwnPropertySymbols,Gr=Object.prototype.hasOwnProperty,qr=Object.prototype.propertyIsEnumerable,Zr=function(e,t,n){return t in e?$r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Kr=function(e,t){for(var n in t||(t={}))Gr.call(t,n)&&Zr(e,n,t[n]);if(Ur){var r,a=Vr(Ur(t));try{for(a.s();!(r=a.n()).done;)n=r.value,qr.call(t,n)&&Zr(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Xr=function(e,t){return Br(e,Yr(t))};function Jr(e){var n=e,r=n.direction,a=n.style,i=function(e,t){var n={};for(var r in e)Gr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ur){var a,i=Vr(Ur(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&qr.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(n,["direction","style"]),o=Pt();return t().createElement(Hr,Xr(Kr({},i),{style:Xr(Kr({},a),{transform:"next"===r&&"ltr"===o.dir||"previous"===r&&"rtl"===o.dir?"rotate(270deg)":"rotate(90deg)"})}))}function Qr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Jr.displayName="@mantine/dates/Chevron";var ea=Object.defineProperty,ta=Object.defineProperties,na=Object.getOwnPropertyDescriptors,ra=Object.getOwnPropertySymbols,aa=Object.prototype.hasOwnProperty,ia=Object.prototype.propertyIsEnumerable,oa=function(e,t,n){return t in e?ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},la=function(e,t){for(var n in t||(t={}))aa.call(t,n)&&oa(e,n,t[n]);if(ra){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Qr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(ra(t));try{for(a.s();!(r=a.n()).done;)n=r.value,ia.call(t,n)&&oa(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},sa=function(e,t){return ta(e,na(t))},ca={xs:et(30),sm:et(36),md:et(42),lg:et(48),xl:et(54)},ua=Xn((function(e,t,n){var r=t.radius,a=t.isStatic,i=n.size,o=e.fn.variant({variant:"filled"}),l=e.fn.variant({variant:"light"});return{day:sa(la({width:nt({size:i,sizes:ca}),height:nt({size:i,sizes:ca}),fontSize:nt({size:i,sizes:e.fontSizes}),display:"inline-flex",justifyContent:"center",alignItems:"center",userSelect:a?void 0:"none",cursor:a?"default":"pointer",borderRadius:e.fn.radius(r)},a?null:e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":a?void 0:e.activeStyles,"&[data-disabled]":sa(la({color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[4],cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}}),"&[data-weekend]":{color:e.colors.red[e.fn.primaryShade()]},"&[data-outside]":{color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[4]},"&[data-in-range]":la({backgroundColor:l.background,borderRadius:0},a?null:e.fn.hover({backgroundColor:l.hover})),"&[data-first-in-range]":{borderTopLeftRadius:e.radius.sm,borderBottomLeftRadius:e.radius.sm},"&[data-last-in-range]":{borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm},"&[data-selected]":la({color:o.color,backgroundColor:o.background},a?null:e.fn.hover({backgroundColor:o.hover})),"&[data-hidden]":{display:"none"}})}}));const fa=ua;function da(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ha=Object.defineProperty,pa=Object.defineProperties,va=Object.getOwnPropertyDescriptors,ma=Object.getOwnPropertySymbols,ya=Object.prototype.hasOwnProperty,ga=Object.prototype.propertyIsEnumerable,ba=function(e,t,n){return t in e?ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},xa=function(e,t){for(var n in t||(t={}))ya.call(t,n)&&ba(e,n,t[n]);if(ma){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return da(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?da(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(ma(t));try{for(a.s();!(r=a.n()).done;)n=r.value,ga.call(t,n)&&ba(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},_a=function(e,t){return pa(e,va(t))},wa=Xn((function(e,t,n){var r=n.size,a=nt({size:r,sizes:ca});return{calendarHeaderControlIcon:{},calendarHeader:{display:"flex",maxWidth:"calc(".concat(a," * 7 + ").concat(et(7),")")},calendarHeaderControl:_a(xa({width:a,height:a,borderRadius:e.fn.radius(),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none"},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-disabled]":_a(xa({opacity:.2,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})}),calendarHeaderLevel:_a(xa({height:a,borderRadius:e.fn.radius(),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",flex:1,fontSize:nt({size:r,sizes:e.fontSizes}),fontWeight:500,textTransform:"capitalize"},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-static]":_a(xa({cursor:"default",userSelect:"unset"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}}));const ka=wa;function Sa(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Oa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Oa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ja=Object.defineProperty,Ea=Object.getOwnPropertySymbols,Aa=Object.prototype.hasOwnProperty,Ca=Object.prototype.propertyIsEnumerable,Da=function(e,t,n){return t in e?ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Pa={nextDisabled:!1,previousDisabled:!1,hasNextLevel:!0,withNext:!0,withPrevious:!0,size:"sm"},Ma=(0,e.forwardRef)((function(e,n){var r=Rt("CalendarHeader",Pa,e),a=r.className,i=r.nextIcon,o=r.previousIcon,l=r.nextLabel,s=r.previousLabel,c=r.onNext,u=r.onPrevious,f=r.onLevelClick,d=r.label,h=r.classNames,p=r.styles,v=r.unstyled,m=r.nextDisabled,y=r.previousDisabled,g=r.hasNextLevel,b=r.levelControlAriaLabel,x=r.withNext,_=r.withPrevious,w=r.__staticSelector,k=r.__preventFocus,S=r.__stopPropagation,O=r.size,j=r.variant,E=function(e,t){var n={};for(var r in e)Aa.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ea){var a,i=Sa(Ea(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Ca.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","label","classNames","styles","unstyled","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","__staticSelector","__preventFocus","__stopPropagation","size","variant"]),A=ka(null,{name:["CalendarHeader",w],classNames:h,styles:p,unstyled:v,size:O,variant:j}),C=A.classes,D=A.cx,P=k?function(e){return e.preventDefault()}:void 0;return t().createElement(Fn,function(e,t){for(var n in t||(t={}))Aa.call(t,n)&&Da(e,n,t[n]);if(Ea){var r,a=Sa(Ea(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ca.call(t,n)&&Da(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:D(C.calendarHeader,a),ref:n},E),_&&t().createElement(Pr,{className:C.calendarHeaderControl,"data-previous":!0,"aria-label":s,onClick:u,unstyled:v,onMouseDown:P,disabled:y,"data-disabled":y||void 0,tabIndex:k?-1:0,"data-mantine-stop-propagation":S||void 0},o||t().createElement(Jr,{className:C.calendarHeaderControlIcon,direction:"previous","data-previous":!0})),t().createElement(Pr,{component:g?"button":"div",className:C.calendarHeaderLevel,onClick:g?f:void 0,unstyled:v,onMouseDown:g?P:void 0,disabled:!g,"data-static":!g||void 0,"aria-label":b,tabIndex:k||!g?-1:0,"data-mantine-stop-propagation":S||void 0},d),x&&t().createElement(Pr,{className:C.calendarHeaderControl,"data-next":!0,"aria-label":l,onClick:c,unstyled:v,onMouseDown:P,disabled:m,"data-disabled":m||void 0,tabIndex:k?-1:0,"data-mantine-stop-propagation":S||void 0},i||t().createElement(Jr,{className:C.calendarHeaderControlIcon,direction:"next","data-next":!0})))}));function Ra(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=new Date(e);n.getDay()!==t;)n.setDate(n.getDate()-1);return n}function Ia(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=new Date(e),r=0===t?6:t-1;n.getDay()!==r;)n.setDate(n.getDate()+1);return n}function La(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function Na(e,t){return!(t instanceof Date)||g()(e).isBefore(g()(t).add(1,"day"),"day")}function Ta(e,t){return!(t instanceof Date)||g()(e).isAfter(g()(t).subtract(1,"day"),"day")}function Fa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Ma.displayName="@mantine/dates/CalendarHeader";var za=Object.defineProperty,Ha=Object.defineProperties,Va=Object.getOwnPropertyDescriptors,Wa=Object.getOwnPropertySymbols,$a=Object.prototype.hasOwnProperty,Ba=Object.prototype.propertyIsEnumerable,Ya=function(e,t,n){return t in e?za(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ua=function(e,t){for(var n in t||(t={}))$a.call(t,n)&&Ya(e,n,t[n]);if(Wa){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Fa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(Wa(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ba.call(t,n)&&Ya(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};const Ga=Xn((function(e){return{monthThead:{},monthRow:{},monthTbody:{},monthCell:{padding:0,"&[data-with-spacing]":{padding:et(.5)}},month:(t=Ua({},e.fn.fontStyles()),n={borderCollapse:"collapse",tableLayout:"fixed","& *":{boxSizing:"border-box"}},Ha(t,Va(n)))};var t,n}));function qa(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Za(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Za(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Za(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ka=Object.defineProperty,Xa=Object.getOwnPropertySymbols,Ja=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,ei=function(e,t,n){return t in e?Ka(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ti={tabIndex:0,size:"sm"},ni=(0,e.forwardRef)((function(e,n){var r=Rt("Day",ti,e),a=r.className,i=r.date,o=r.radius,l=r.disabled,s=r.styles,c=r.classNames,u=r.unstyled,f=r.__staticSelector,d=r.weekend,h=r.outside,p=r.selected,v=r.renderDay,m=r.inRange,y=r.firstInRange,b=r.lastInRange,x=r.hidden,_=r.static,w=r.variant,k=r.size,S=function(e,t){var n={};for(var r in e)Ja.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Xa){var a,i=qa(Xa(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Qa.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","date","radius","disabled","styles","classNames","unstyled","__staticSelector","weekend","outside","selected","renderDay","inRange","firstInRange","lastInRange","hidden","static","variant","size"]),O=fa({radius:o,isStatic:_},{name:["Day",f],classNames:c,styles:s,unstyled:u,variant:w,size:k}),j=O.classes,E=O.cx;return t().createElement(Pr,function(e,t){for(var n in t||(t={}))Ja.call(t,n)&&ei(e,n,t[n]);if(Xa){var r,a=qa(Xa(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Qa.call(t,n)&&ei(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({component:_?"div":"button",ref:n,className:E(j.day,a),disabled:l,"data-today":g()(i).isSame(new Date,"day")||void 0,"data-hidden":x||void 0,"data-disabled":l||void 0,"data-weekend":!l&&!h&&d||void 0,"data-outside":!l&&h||void 0,"data-selected":!l&&p||void 0,"data-in-range":m&&!l||void 0,"data-first-in-range":y&&!l||void 0,"data-last-in-range":b&&!l||void 0,unstyled:u},S),(null==v?void 0:v(i))||i.getDate())}));ni.displayName="@mantine/dates/Day";var ri=Xn((function(e,t,n){var r=n.size;return{weekdaysRow:{},weekday:{color:"dark"===e.colorScheme?e.colors.dark[1]:e.colors.gray[5],fontWeight:400,fontSize:nt({size:r,sizes:e.fontSizes}),textTransform:"capitalize",paddingBottom:"calc(".concat(nt({size:r,sizes:e.spacing})," / 2)")}}}));const ai=ri;function ii(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return oi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function oi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var li=Object.defineProperty,si=Object.getOwnPropertySymbols,ci=Object.prototype.hasOwnProperty,ui=Object.prototype.propertyIsEnumerable,fi=function(e,t,n){return t in e?li(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},di={weekdayFormat:"dd",cellComponent:"th",size:"sm"},hi=(0,e.forwardRef)((function(e,n){var r=Rt("WeekdaysRow",di,e),a=r.className,i=r.locale,o=r.firstDayOfWeek,l=r.weekdayFormat,s=r.cellComponent,c=r.__staticSelector,u=r.classNames,f=r.styles,d=r.unstyled,h=r.variant,p=r.size,v=function(e,t){var n={};for(var r in e)ci.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&si){var a,i=ii(si(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&ui.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","locale","firstDayOfWeek","weekdayFormat","cellComponent","__staticSelector","classNames","styles","unstyled","variant","size"]),m=dr(),y=ai(null,{name:["WeekdaysRow",c],classNames:u,styles:f,unstyled:d,variant:h,size:p}),b=y.classes,x=y.cx,_=function(e){for(var t=e.locale,n=e.format,r=void 0===n?"dd":n,a=e.firstDayOfWeek,i=void 0===a?1:a,o=g()().day(i),l=[],s=0;s<7;s+=1)"string"==typeof r?l.push(g()(o).add(s,"days").locale(t).format(r)):l.push(r(g()(o).add(s,"days").toDate()));return l}({locale:m.getLocale(i),format:l,firstDayOfWeek:m.getFirstDayOfWeek(o)}).map((function(e,n){return t().createElement(s,{key:n,className:b.weekday},e)}));return t().createElement(Fn,function(e,t){for(var n in t||(t={}))ci.call(t,n)&&fi(e,n,t[n]);if(si){var r,a=ii(si(t));try{for(a.s();!(r=a.n()).done;)n=r.value,ui.call(t,n)&&fi(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({component:"tr",ref:n,className:x(b.weekdaysRow,a)},v),_)}));function pi(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return vi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function vi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}hi.displayName="@mantine/dates/WeekdaysRow";var mi=Object.defineProperty,yi=Object.defineProperties,gi=Object.getOwnPropertyDescriptors,bi=Object.getOwnPropertySymbols,xi=Object.prototype.hasOwnProperty,_i=Object.prototype.propertyIsEnumerable,wi=function(e,t,n){return t in e?mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ki=function(e,t){for(var n in t||(t={}))xi.call(t,n)&&wi(e,n,t[n]);if(bi){var r,a=pi(bi(t));try{for(a.s();!(r=a.n()).done;)n=r.value,_i.call(t,n)&&wi(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Si=function(e,t){return yi(e,gi(t))},Oi={size:"sm",withCellSpacing:!0},ji=(0,e.forwardRef)((function(e,n){var r=Rt("Month",Oi,e),a=r.className,i=r.classNames,o=r.styles,l=r.unstyled,s=r.__staticSelector,c=r.locale,u=r.firstDayOfWeek,f=r.weekdayFormat,d=r.month,h=r.weekendDays,p=r.getDayProps,v=r.excludeDate,m=r.minDate,y=r.maxDate,b=r.renderDay,x=r.hideOutsideDates,_=r.hideWeekdays,w=r.getDayAriaLabel,k=r.static,S=r.__getDayRef,O=r.__onDayKeyDown,j=r.__onDayClick,E=r.__onDayMouseEnter,A=r.__preventFocus,C=r.__stopPropagation,D=r.withCellSpacing,P=r.size,M=r.variant,R=function(e,t){var n={};for(var r in e)xi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&bi){var a,i=pi(bi(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&_i.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","classNames","styles","unstyled","__staticSelector","locale","firstDayOfWeek","weekdayFormat","month","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","static","__getDayRef","__onDayKeyDown","__onDayClick","__onDayMouseEnter","__preventFocus","__stopPropagation","withCellSpacing","size","variant"]),I=dr(),L=Ga(null,{name:["Month",s],classNames:i,styles:o,unstyled:l,variant:M,size:P}),N=L.classes,T=L.cx,F={__staticSelector:s||"Month",classNames:i,styles:o,unstyled:l,variant:M,size:P},z=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getMonth(),r=new Date(e.getFullYear(),n,1),a=Ia(new Date(e.getFullYear(),e.getMonth()+1,0),t),i=Ra(r,t),o=[];i<=a;){for(var l=[],s=0;s<7;s+=1)l.push(new Date(i)),i.setDate(i.getDate()+1);o.push(l)}return o}(d,I.getFirstDayOfWeek(u)),H=function(e,t,n,r,a,i,o){var l=e.flat().filter((function(e){var l;return Na(e,n)&&Ta(e,t)&&!(null==a?void 0:a(e))&&!(null==(l=null==r?void 0:r(e))?void 0:l.disabled)&&(!i||La(e,o))})),s=l.find((function(e){var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected}));return s||l.find((function(e){return g()().isSame(e,"date")}))||l[0]}(z,m,y,p,v,x,d),V=z.map((function(e,n){var r=e.map((function(e,r){var a=!La(e,d),i=(null==w?void 0:w(e))||g()(e).locale(c||I.locale).format("D MMMM YYYY"),o=null==p?void 0:p(e),l=g()(e).isSame(H,"date");return t().createElement("td",{key:e.toString(),className:N.monthCell,"data-with-spacing":D||void 0},t().createElement(ni,Si(ki(Si(ki({},F),{"data-mantine-stop-propagation":C||void 0,renderDay:b,date:e,weekend:I.getWeekendDays(h).includes(e.getDay()),outside:a,hidden:!!x&&a,"aria-label":i,static:k,disabled:(null==v?void 0:v(e))||!Na(e,y)||!Ta(e,m),ref:function(e){return null==S?void 0:S(n,r,e)}}),o),{onKeyDown:function(t){var a;null==(a=null==o?void 0:o.onKeyDown)||a.call(o,t),null==O||O(t,{rowIndex:n,cellIndex:r,date:e})},onMouseEnter:function(t){var n;null==(n=null==o?void 0:o.onMouseEnter)||n.call(o,t),null==E||E(t,e)},onClick:function(t){var n;null==(n=null==o?void 0:o.onClick)||n.call(o,t),null==j||j(t,e)},onMouseDown:function(e){var t;null==(t=null==o?void 0:o.onMouseDown)||t.call(o,e),A&&e.preventDefault()},tabIndex:A||!l?-1:0})))}));return t().createElement("tr",{key:n,className:N.monthRow},r)}));return t().createElement(Fn,ki({component:"table",className:T(N.month,a),ref:n},R),!_&&t().createElement("thead",{className:N.monthThead},t().createElement(hi,Si(ki({},F),{locale:c,firstDayOfWeek:u,weekdayFormat:f}))),t().createElement("tbody",{className:N.monthTbody},V))}));function Ei(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ai(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ai(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Ai(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}ji.displayName="@mantine/dates/Month";var Ci=Object.defineProperty,Di=Object.getOwnPropertySymbols,Pi=Object.prototype.hasOwnProperty,Mi=Object.prototype.propertyIsEnumerable,Ri=function(e,t,n){return t in e?Ci(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ii=function(e,t){for(var n in t||(t={}))Pi.call(t,n)&&Ri(e,n,t[n]);if(Di){var r,a=Ei(Di(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Mi.call(t,n)&&Ri(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Li={monthLabelFormat:"MMMM YYYY"},Ni=(0,e.forwardRef)((function(e,n){var r=Rt("MonthLevel",Li,e),a=r.month,i=r.locale,o=r.firstDayOfWeek,l=r.weekdayFormat,s=r.weekendDays,c=r.getDayProps,u=r.excludeDate,f=r.minDate,d=r.maxDate,h=r.renderDay,p=r.hideOutsideDates,v=r.hideWeekdays,m=r.getDayAriaLabel,y=r.__getDayRef,b=r.__onDayKeyDown,x=r.__onDayClick,_=r.__onDayMouseEnter,w=r.withCellSpacing,k=r.__preventFocus,S=r.__stopPropagation,O=r.nextIcon,j=r.previousIcon,E=r.nextLabel,A=r.previousLabel,C=r.onNext,D=r.onPrevious,P=r.onLevelClick,M=r.nextDisabled,R=r.previousDisabled,I=r.hasNextLevel,L=r.levelControlAriaLabel,N=r.withNext,T=r.withPrevious,F=r.className,z=r.monthLabelFormat,H=r.classNames,V=r.styles,W=r.unstyled,$=r.__staticSelector,B=r.size,Y=r.variant,U=r.static,G=function(e,t){var n={};for(var r in e)Pi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Di){var a,i=Ei(Di(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Mi.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["month","locale","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","__getDayRef","__onDayKeyDown","__onDayClick","__onDayMouseEnter","withCellSpacing","__preventFocus","__stopPropagation","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","className","monthLabelFormat","classNames","styles","unstyled","__staticSelector","size","variant","static"]),q=tr(null,{name:["MonthLevel",$],classNames:H,styles:V,unstyled:W,variant:Y,size:B}),Z=q.classes,K=q.cx,X=dr(),J={__staticSelector:$||"MonthLevel",classNames:H,styles:V,unstyled:W,variant:Y,size:B},Q="boolean"==typeof M?M:!!d&&!g()(a).endOf("month").isBefore(d),ee="boolean"==typeof R?R:!!f&&!g()(a).startOf("month").isAfter(f);return t().createElement(Fn,Ii({className:K(Z.monthLevel,F),"data-month-level":!0,ref:n},G),t().createElement(Ma,Ii({label:"function"==typeof z?z(a):g()(a).locale(i||X.locale).format(z),className:Z.calendarHeader,__preventFocus:k,__stopPropagation:S,nextIcon:O,previousIcon:j,nextLabel:E,previousLabel:A,onNext:C,onPrevious:D,onLevelClick:P,nextDisabled:Q,previousDisabled:ee,hasNextLevel:I,levelControlAriaLabel:L,withNext:N,withPrevious:T},J)),t().createElement(ji,Ii({month:a,locale:i,firstDayOfWeek:o,weekdayFormat:l,weekendDays:s,getDayProps:c,excludeDate:u,minDate:f,maxDate:d,renderDay:h,hideOutsideDates:p,hideWeekdays:v,getDayAriaLabel:m,__getDayRef:y,__onDayKeyDown:b,__onDayClick:x,__onDayMouseEnter:_,__preventFocus:k,__stopPropagation:S,static:U,withCellSpacing:w},J)))}));function Ti(e){var t,n,r=e.controlsRef,a=e.direction,i=e.levelIndex,o=e.rowIndex,l=e.cellIndex,s=e.size,c=function(e){var t=e.levelIndex,n=e.rowIndex,r=e.cellIndex,a=e.size;switch(e.direction){case"up":return 0===t&&0===n?null:0===n?{levelIndex:t-1,rowIndex:r<=a[t-1][a[t-1].length-1]-1?a[t-1].length-1:a[t-1].length-2,cellIndex:r}:{levelIndex:t,rowIndex:n-1,cellIndex:r};case"down":return n===a[t].length-1||n===a[t].length-2&&r>=a[t][a[t].length-1]?{levelIndex:t+1,rowIndex:0,cellIndex:r}:{levelIndex:t,rowIndex:n+1,cellIndex:r};case"left":return 0===t&&0===n&&0===r?null:0===n&&0===r?{levelIndex:t-1,rowIndex:a[t-1].length-1,cellIndex:a[t-1][a[t-1].length-1]-1}:0===r?{levelIndex:t,rowIndex:n-1,cellIndex:a[t][n-1]-1}:{levelIndex:t,rowIndex:n,cellIndex:r-1};case"right":return n===a[t].length-1&&r===a[t][n]-1?{levelIndex:t+1,rowIndex:0,cellIndex:0}:r===a[t][n]-1?{levelIndex:t,rowIndex:n+1,cellIndex:0}:{levelIndex:t,rowIndex:n,cellIndex:r+1};default:return{levelIndex:t,rowIndex:n,cellIndex:r}}}({direction:a,size:s,rowIndex:o,cellIndex:l,levelIndex:i});if(c){var u=null==(n=null==(t=r.current[c.levelIndex])?void 0:t[c.rowIndex])?void 0:n[c.cellIndex];u&&(u.disabled||u.getAttribute("data-hidden")||u.getAttribute("data-outside")?Ti({controlsRef:r,direction:a,levelIndex:c.levelIndex,cellIndex:c.cellIndex,rowIndex:c.rowIndex,size:s}):u.focus())}}function Fi(e){var t=e.controlsRef,n=e.levelIndex,r=e.rowIndex,a=e.cellIndex,i=e.event,o=function(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}(i.key);if(o){i.preventDefault();var l=function(e){return e.current.map((function(e){return e.map((function(e){return e.length}))}))}(t);Ti({controlsRef:t,direction:o,levelIndex:n,rowIndex:r,cellIndex:a,size:l})}}function zi(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Hi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Hi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Ni.displayName="@mantine/dates/MonthLevel";var Vi=Object.defineProperty,Wi=Object.getOwnPropertySymbols,$i=Object.prototype.hasOwnProperty,Bi=Object.prototype.propertyIsEnumerable,Yi=function(e,t,n){return t in e?Vi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ui={numberOfColumns:1},Gi=(0,e.forwardRef)((function(n,r){var a=Rt("MonthLevelGroup",Ui,n),i=a.month,o=a.locale,l=a.firstDayOfWeek,s=a.weekdayFormat,c=a.weekendDays,u=a.getDayProps,f=a.excludeDate,d=a.minDate,h=a.maxDate,p=a.renderDay,v=a.hideOutsideDates,m=a.hideWeekdays,y=a.getDayAriaLabel,b=a.__onDayClick,x=a.__onDayMouseEnter,_=a.withCellSpacing,w=a.__preventFocus,k=a.nextIcon,S=a.previousIcon,O=a.nextLabel,j=a.previousLabel,E=a.onNext,A=a.onPrevious,C=a.onLevelClick,D=a.nextDisabled,P=a.previousDisabled,M=a.hasNextLevel,R=a.className,I=a.classNames,L=a.styles,N=a.unstyled,T=a.numberOfColumns,F=a.levelControlAriaLabel,z=a.monthLabelFormat,H=a.__staticSelector,V=a.__stopPropagation,W=a.size,$=a.variant,B=a.static,Y=function(e,t){var n={};for(var r in e)$i.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Wi){var a,i=zi(Wi(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Bi.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(a,["month","locale","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","__onDayClick","__onDayMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","className","classNames","styles","unstyled","numberOfColumns","levelControlAriaLabel","monthLabelFormat","__staticSelector","__stopPropagation","size","variant","static"]),U=er(null,{name:["MonthLevelGroup",H],classNames:I,styles:L,unstyled:N,variant:$,size:W}),G=U.classes,q=U.cx,Z=(0,e.useRef)([]),K=Array(T).fill(0).map((function(e,n){var r=g()(i).add(n,"months").toDate();return t().createElement(Ni,{key:n,month:r,withNext:n===T-1,withPrevious:0===n,monthLabelFormat:z,__stopPropagation:V,__onDayClick:b,__onDayMouseEnter:x,__onDayKeyDown:function(e,t){return Fi({levelIndex:n,rowIndex:t.rowIndex,cellIndex:t.cellIndex,event:e,controlsRef:Z})},__getDayRef:function(e,t,r){Array.isArray(Z.current[n])||(Z.current[n]=[]),Array.isArray(Z.current[n][e])||(Z.current[n][e]=[]),Z.current[n][e][t]=r},levelControlAriaLabel:"function"==typeof F?F(r):F,locale:o,firstDayOfWeek:l,weekdayFormat:s,weekendDays:c,getDayProps:u,excludeDate:f,minDate:d,maxDate:h,renderDay:p,hideOutsideDates:v,hideWeekdays:m,getDayAriaLabel:y,__preventFocus:w,nextIcon:k,previousIcon:S,nextLabel:O,previousLabel:j,onNext:E,onPrevious:A,onLevelClick:C,nextDisabled:D,previousDisabled:P,hasNextLevel:M,classNames:I,styles:L,unstyled:N,__staticSelector:H||"MonthLevelGroup",size:W,variant:$,static:B,withCellSpacing:_})}));return t().createElement(Fn,function(e,t){for(var n in t||(t={}))$i.call(t,n)&&Yi(e,n,t[n]);if(Wi){var r,a=zi(Wi(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Bi.call(t,n)&&Yi(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:q(G.monthLevelGroup,R),ref:r},Y),K)}));Gi.displayName="@mantine/dates/MonthLevelGroup";var qi=Xn((function(e,t,n){return{yearLevelGroup:{display:"flex","& [data-year-level]:not(:last-of-type)":{marginRight:nt({size:n.size,sizes:e.spacing})}}}}));const Zi=qi,Ki=Xn((function(e){return{yearLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}}));function Xi(e,t,n){return!!((t||n)&&(t&&g()(e).isBefore(t,"month")||n&&g()(e).isAfter(n,"month")))}const Ji=Xn((function(){return{monthsList:{borderCollapse:"collapse",borderWidth:0,cursor:"pointer"},monthsListCell:{padding:0,"&[data-with-spacing]":{padding:et(.5)}},monthsListRow:{}}}));function Qi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var eo=Object.defineProperty,to=Object.defineProperties,no=Object.getOwnPropertyDescriptors,ro=Object.getOwnPropertySymbols,ao=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable,oo=function(e,t,n){return t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},lo=function(e,t){for(var n in t||(t={}))ao.call(t,n)&&oo(e,n,t[n]);if(ro){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Qi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(ro(t));try{for(a.s();!(r=a.n()).done;)n=r.value,io.call(t,n)&&oo(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},so=function(e,t){return to(e,no(t))},co=Xn((function(e,t,n){var r=n.size,a=e.fn.variant({variant:"filled"}),i=e.fn.variant({variant:"light"});return{pickerControl:so(lo({fontSize:nt({size:r,sizes:e.fontSizes}),height:nt({size:r,sizes:ca}),width:"calc((".concat(nt({size:r,sizes:ca})," * 7) / 3 + ").concat(et(1.5),")"),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",borderRadius:e.fn.radius()},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-in-range]":lo({backgroundColor:i.background,borderRadius:0},e.fn.hover({backgroundColor:i.hover})),"&[data-first-in-range]":{borderRadius:0,borderTopLeftRadius:e.radius.sm,borderBottomLeftRadius:e.radius.sm},"&[data-last-in-range]":{borderRadius:0,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm},"&[data-last-in-range][data-first-in-range]":{borderRadius:e.radius.sm},"&[data-selected]":lo({color:a.color,backgroundColor:a.background},e.fn.hover({backgroundColor:a.hover})),"&[data-disabled]":so(lo({color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[4],cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}}));const uo=co;function fo(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ho(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ho(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function ho(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var po=Object.defineProperty,vo=Object.getOwnPropertySymbols,mo=Object.prototype.hasOwnProperty,yo=Object.prototype.propertyIsEnumerable,go=function(e,t,n){return t in e?po(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},bo={size:"sm"},xo=(0,e.forwardRef)((function(e,n){var r=Rt("PickerControl",bo,e),a=r.className,i=r.children,o=r.disabled,l=r.selected,s=r.classNames,c=r.styles,u=r.unstyled,f=r.firstInRange,d=r.lastInRange,h=r.inRange,p=r.__staticSelector,v=r.size,m=r.variant,y=function(e,t){var n={};for(var r in e)mo.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&vo){var a,i=fo(vo(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&yo.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","children","disabled","selected","classNames","styles","unstyled","firstInRange","lastInRange","inRange","__staticSelector","size","variant"]),g=uo(null,{name:["PickerControl",p],classNames:s,styles:c,unstyled:u,variant:m,size:v}),b=g.classes,x=g.cx;return t().createElement(Pr,function(e,t){for(var n in t||(t={}))mo.call(t,n)&&go(e,n,t[n]);if(vo){var r,a=fo(vo(t));try{for(a.s();!(r=a.n()).done;)n=r.value,yo.call(t,n)&&go(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:x(b.pickerControl,a),ref:n,unstyled:u,"data-picker-control":!0,"data-selected":l&&!o||void 0,"data-disabled":o||void 0,"data-in-range":h&&!o&&!l||void 0,"data-first-in-range":f&&!o||void 0,"data-last-in-range":d&&!o||void 0,disabled:o},y),i)}));function _o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return wo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function wo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}xo.displayName="@mantine/dates/PickerControl";var ko=Object.defineProperty,So=Object.defineProperties,Oo=Object.getOwnPropertyDescriptors,jo=Object.getOwnPropertySymbols,Eo=Object.prototype.hasOwnProperty,Ao=Object.prototype.propertyIsEnumerable,Co=function(e,t,n){return t in e?ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Do=function(e,t){for(var n in t||(t={}))Eo.call(t,n)&&Co(e,n,t[n]);if(jo){var r,a=_o(jo(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ao.call(t,n)&&Co(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Po={monthsListFormat:"MMM",size:"sm",withCellSpacing:!0},Mo=(0,e.forwardRef)((function(e,n){var r=Rt("MonthsList",Po,e),a=r.year,i=r.className,o=r.monthsListFormat,l=r.locale,s=r.minDate,c=r.maxDate,u=r.getMonthControlProps,f=r.classNames,d=r.styles,h=r.unstyled,p=r.__staticSelector,v=r.__getControlRef,m=r.__onControlKeyDown,y=r.__onControlClick,b=r.__onControlMouseEnter,x=r.__preventFocus,_=r.size,w=r.variant,k=r.__stopPropagation,S=r.withCellSpacing,O=function(e,t){var n={};for(var r in e)Eo.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&jo){var a,i=_o(jo(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Ao.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["year","className","monthsListFormat","locale","minDate","maxDate","getMonthControlProps","classNames","styles","unstyled","__staticSelector","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","__preventFocus","size","variant","__stopPropagation","withCellSpacing"]),j=Ji(null,{name:["MonthsList",p],classNames:f,styles:d,unstyled:h,variant:w,size:_}),E=j.classes,A=j.cx,C=dr(),D=function(e){for(var t=g()(e).startOf("year").toDate(),n=[[],[],[],[]],r=0,a=0;a<4;a+=1)for(var i=0;i<3;i+=1)n[a].push(g()(t).add(r,"months").toDate()),r+=1;return n}(a),P=function(e,t,n,r){var a=e.flat().filter((function(e){var a;return!Xi(e,t,n)&&!(null==(a=null==r?void 0:r(e))?void 0:a.disabled)})),i=a.find((function(e){var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected}));return i||a.find((function(e){return g()().isSame(e,"month")}))||a[0]}(D,s,c,u),M=D.map((function(e,n){var r=e.map((function(e,r){var a,i=null==u?void 0:u(e),O=g()(e).isSame(P,"month");return t().createElement("td",{key:r,className:E.monthsListCell,"data-with-spacing":S||void 0},t().createElement(xo,(a=Do({variant:w,size:_,classNames:f,styles:d,unstyled:h,__staticSelector:p||"MonthsList","data-mantine-stop-propagation":k||void 0,disabled:Xi(e,s,c),ref:function(e){return null==v?void 0:v(n,r,e)}},i),So(a,Oo({onKeyDown:function(t){var a;null==(a=null==i?void 0:i.onKeyDown)||a.call(i,t),null==m||m(t,{rowIndex:n,cellIndex:r,date:e})},onClick:function(t){var n;null==(n=null==i?void 0:i.onClick)||n.call(i,t),null==y||y(t,e)},onMouseEnter:function(t){var n;null==(n=null==i?void 0:i.onMouseEnter)||n.call(i,t),null==b||b(t,e)},onMouseDown:function(e){var t;null==(t=null==i?void 0:i.onMouseDown)||t.call(i,e),x&&e.preventDefault()},tabIndex:x||!O?-1:0}))),g()(e).locale(C.getLocale(l)).format(o)))}));return t().createElement("tr",{key:n,className:E.monthsListRow},r)}));return t().createElement(Fn,Do({component:"table",ref:n,className:A(E.monthsList,i)},O),t().createElement("tbody",null,M))}));function Ro(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Io(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Io(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Io(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Mo.displayName="@mantine/dates/MonthsList";var Lo=Object.defineProperty,No=Object.getOwnPropertySymbols,To=Object.prototype.hasOwnProperty,Fo=Object.prototype.propertyIsEnumerable,zo=function(e,t,n){return t in e?Lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ho=function(e,t){for(var n in t||(t={}))To.call(t,n)&&zo(e,n,t[n]);if(No){var r,a=Ro(No(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Fo.call(t,n)&&zo(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Vo={yearLabelFormat:"YYYY",size:"sm"},Wo=(0,e.forwardRef)((function(e,n){var r=Rt("YearLevel",Vo,e),a=r.year,i=r.locale,o=r.minDate,l=r.maxDate,s=r.monthsListFormat,c=r.getMonthControlProps,u=r.__getControlRef,f=r.__onControlKeyDown,d=r.__onControlClick,h=r.__onControlMouseEnter,p=r.withCellSpacing,v=r.__preventFocus,m=r.nextIcon,y=r.previousIcon,b=r.nextLabel,x=r.previousLabel,_=r.onNext,w=r.onPrevious,k=r.onLevelClick,S=r.nextDisabled,O=r.previousDisabled,j=r.hasNextLevel,E=r.levelControlAriaLabel,A=r.withNext,C=r.withPrevious,D=r.className,P=r.yearLabelFormat,M=r.classNames,R=r.styles,I=r.unstyled,L=r.__staticSelector,N=r.__stopPropagation,T=r.size,F=r.variant,z=function(e,t){var n={};for(var r in e)To.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&No){var a,i=Ro(No(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Fo.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["year","locale","minDate","maxDate","monthsListFormat","getMonthControlProps","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","className","yearLabelFormat","classNames","styles","unstyled","__staticSelector","__stopPropagation","size","variant"]),H=Ki(null,{name:["YearLevel",L],classNames:M,styles:R,unstyled:I,size:T,variant:F}),V=H.classes,W=H.cx,$=dr(),B={__staticSelector:L||"YearLevel",classNames:M,styles:R,unstyled:I,size:T,variant:F},Y="boolean"==typeof S?S:!!l&&!g()(a).endOf("year").isBefore(l),U="boolean"==typeof O?O:!!o&&!g()(a).startOf("year").isAfter(o);return t().createElement(Fn,Ho({className:W(V.yearLevel,D),"data-year-level":!0,ref:n},z),t().createElement(Ma,Ho({label:"function"==typeof P?P(a):g()(a).locale(i||$.locale).format(P),className:V.calendarHeader,__preventFocus:v,__stopPropagation:N,nextIcon:m,previousIcon:y,nextLabel:b,previousLabel:x,onNext:_,onPrevious:w,onLevelClick:k,nextDisabled:Y,previousDisabled:U,hasNextLevel:j,levelControlAriaLabel:E,withNext:A,withPrevious:C},B)),t().createElement(Mo,Ho({year:a,locale:i,minDate:o,maxDate:l,monthsListFormat:s,getMonthControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:d,__onControlMouseEnter:h,__preventFocus:v,__stopPropagation:N,withCellSpacing:p},B)))}));function $o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Bo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Bo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Wo.displayName="@mantine/dates/YearLevel";var Yo=Object.defineProperty,Uo=Object.getOwnPropertySymbols,Go=Object.prototype.hasOwnProperty,qo=Object.prototype.propertyIsEnumerable,Zo=function(e,t,n){return t in e?Yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ko={numberOfColumns:1,size:"sm"},Xo=(0,e.forwardRef)((function(n,r){var a=Rt("YearLevelGroup",Ko,n),i=a.year,o=a.locale,l=a.minDate,s=a.maxDate,c=a.monthsListFormat,u=a.getMonthControlProps,f=a.__onControlClick,d=a.__onControlMouseEnter,h=a.withCellSpacing,p=a.__preventFocus,v=a.nextIcon,m=a.previousIcon,y=a.nextLabel,b=a.previousLabel,x=a.onNext,_=a.onPrevious,w=a.onLevelClick,k=a.nextDisabled,S=a.previousDisabled,O=a.hasNextLevel,j=a.className,E=a.classNames,A=a.styles,C=a.unstyled,D=a.__staticSelector,P=a.__stopPropagation,M=a.numberOfColumns,R=a.levelControlAriaLabel,I=a.yearLabelFormat,L=a.variant,N=a.size,T=function(e,t){var n={};for(var r in e)Go.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Uo){var a,i=$o(Uo(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&qo.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(a,["year","locale","minDate","maxDate","monthsListFormat","getMonthControlProps","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","className","classNames","styles","unstyled","__staticSelector","__stopPropagation","numberOfColumns","levelControlAriaLabel","yearLabelFormat","variant","size"]),F=Zi(null,{name:["YearLevelGroup",D],styles:A,classNames:E,unstyled:C,variant:L,size:N}),z=F.classes,H=F.cx,V=(0,e.useRef)([]),W=Array(M).fill(0).map((function(e,n){var r=g()(i).add(n,"years").toDate();return t().createElement(Wo,{key:n,variant:L,size:N,monthsListFormat:c,year:r,withNext:n===M-1,withPrevious:0===n,yearLabelFormat:I,__stopPropagation:P,__onControlClick:f,__onControlMouseEnter:d,__onControlKeyDown:function(e,t){return Fi({levelIndex:n,rowIndex:t.rowIndex,cellIndex:t.cellIndex,event:e,controlsRef:V})},__getControlRef:function(e,t,r){Array.isArray(V.current[n])||(V.current[n]=[]),Array.isArray(V.current[n][e])||(V.current[n][e]=[]),V.current[n][e][t]=r},levelControlAriaLabel:"function"==typeof R?R(r):R,locale:o,minDate:l,maxDate:s,__preventFocus:p,nextIcon:v,previousIcon:m,nextLabel:y,previousLabel:b,onNext:x,onPrevious:_,onLevelClick:w,nextDisabled:k,previousDisabled:S,hasNextLevel:O,getMonthControlProps:u,classNames:E,styles:A,unstyled:C,__staticSelector:D||"YearLevelGroup",withCellSpacing:h})}));return t().createElement(Fn,function(e,t){for(var n in t||(t={}))Go.call(t,n)&&Zo(e,n,t[n]);if(Uo){var r,a=$o(Uo(t));try{for(a.s();!(r=a.n()).done;)n=r.value,qo.call(t,n)&&Zo(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:H(z.yearLevelGroup,j),ref:r},T),W)}));Xo.displayName="@mantine/dates/YearLevelGroup";const Jo=Xn((function(e){return{decadeLevelGroup:{display:"flex",gap:e.spacing.md}}}));function Qo(e){for(var t=e.getFullYear(),n=t-t%10,r=0,a=[[],[],[],[]],i=0;i<4;i+=1)for(var o=3===i?1:3,l=0;l<o;l+=1)a[i].push(new Date(n+r,0)),r+=1;return a}const el=Xn((function(e){return{decadeLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}}));function tl(e,t,n){return!!((t||n)&&(t&&g()(e).isBefore(t,"year")||n&&g()(e).isAfter(n,"year")))}const nl=Xn((function(){return{yearsList:{borderCollapse:"collapse",borderWidth:0},yearsListCell:{padding:0,"&[data-with-spacing]":{padding:et(.5)}},yearsListRow:{}}}));function rl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return al(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?al(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function al(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var il=Object.defineProperty,ol=Object.defineProperties,ll=Object.getOwnPropertyDescriptors,sl=Object.getOwnPropertySymbols,cl=Object.prototype.hasOwnProperty,ul=Object.prototype.propertyIsEnumerable,fl=function(e,t,n){return t in e?il(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},dl=function(e,t){for(var n in t||(t={}))cl.call(t,n)&&fl(e,n,t[n]);if(sl){var r,a=rl(sl(t));try{for(a.s();!(r=a.n()).done;)n=r.value,ul.call(t,n)&&fl(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},hl={yearsListFormat:"YYYY",size:"sm",withCellSpacing:!0},pl=(0,e.forwardRef)((function(e,n){var r=Rt("YearsList",hl,e),a=r.decade,i=r.className,o=r.yearsListFormat,l=r.locale,s=r.minDate,c=r.maxDate,u=r.getYearControlProps,f=r.classNames,d=r.styles,h=r.unstyled,p=r.__staticSelector,v=r.__getControlRef,m=r.__onControlKeyDown,y=r.__onControlClick,b=r.__onControlMouseEnter,x=r.__preventFocus,_=r.__stopPropagation,w=r.size,k=r.variant,S=r.withCellSpacing,O=function(e,t){var n={};for(var r in e)cl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&sl){var a,i=rl(sl(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&ul.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["decade","className","yearsListFormat","locale","minDate","maxDate","getYearControlProps","classNames","styles","unstyled","__staticSelector","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","__preventFocus","__stopPropagation","size","variant","withCellSpacing"]),j=nl(null,{name:["YearsList",p],classNames:f,styles:d,unstyled:h,variant:k,size:w}),E=j.classes,A=j.cx,C=dr(),D=Qo(a),P=function(e,t,n,r){var a=e.flat().filter((function(e){var a;return!tl(e,t,n)&&!(null==(a=null==r?void 0:r(e))?void 0:a.disabled)})),i=a.find((function(e){var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected}));return i||a.find((function(e){return g()().isSame(e,"year")}))||a[0]}(D,s,c,u),M=D.map((function(e,n){var r=e.map((function(e,r){var a,i=null==u?void 0:u(e),O=g()(e).isSame(P,"year");return t().createElement("td",{key:r,className:E.yearsListCell,"data-with-spacing":S||void 0},t().createElement(xo,(a=dl({size:w,variant:k,classNames:f,styles:d,unstyled:h,__staticSelector:p||"YearsList","data-mantine-stop-propagation":_||void 0,disabled:tl(e,s,c),ref:function(e){return null==v?void 0:v(n,r,e)}},i),ol(a,ll({onKeyDown:function(t){var a;null==(a=null==i?void 0:i.onKeyDown)||a.call(i,t),null==m||m(t,{rowIndex:n,cellIndex:r,date:e})},onClick:function(t){var n;null==(n=null==i?void 0:i.onClick)||n.call(i,t),null==y||y(t,e)},onMouseEnter:function(t){var n;null==(n=null==i?void 0:i.onMouseEnter)||n.call(i,t),null==b||b(t,e)},onMouseDown:function(e){var t;null==(t=null==i?void 0:i.onMouseDown)||t.call(i,e),x&&e.preventDefault()},tabIndex:x||!O?-1:0}))),g()(e).locale(C.getLocale(l)).format(o)))}));return t().createElement("tr",{key:n,className:E.yearsListRow},r)}));return t().createElement(Fn,dl({component:"table",ref:n,className:A(E.yearsList,i)},O),t().createElement("tbody",null,M))}));function vl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ml(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function ml(e,t){if(e){if("string"==typeof e)return yl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yl(e,t):void 0}}function yl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}pl.displayName="@mantine/dates/YearsList";var gl=Object.defineProperty,bl=Object.getOwnPropertySymbols,xl=Object.prototype.hasOwnProperty,_l=Object.prototype.propertyIsEnumerable,wl=function(e,t,n){return t in e?gl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},kl=function(e,t){for(var n in t||(t={}))xl.call(t,n)&&wl(e,n,t[n]);if(bl){var r,a=vl(bl(t));try{for(a.s();!(r=a.n()).done;)n=r.value,_l.call(t,n)&&wl(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Sl={decadeLabelFormat:"YYYY"},Ol=(0,e.forwardRef)((function(e,n){var r=Rt("DecadeLevel",Sl,e),a=r.decade,i=r.locale,o=r.minDate,l=r.maxDate,s=r.yearsListFormat,c=r.getYearControlProps,u=r.__getControlRef,f=r.__onControlKeyDown,d=r.__onControlClick,h=r.__onControlMouseEnter,p=r.withCellSpacing,v=r.__preventFocus,m=r.nextIcon,y=r.previousIcon,b=r.nextLabel,x=r.previousLabel,_=r.onNext,w=r.onPrevious,k=r.nextDisabled,S=r.previousDisabled,O=r.levelControlAriaLabel,j=r.withNext,E=r.withPrevious,A=r.className,C=r.decadeLabelFormat,D=r.classNames,P=r.styles,M=r.unstyled,R=r.__staticSelector,I=r.__stopPropagation,L=r.variant,N=r.size,T=function(e,t){var n={};for(var r in e)xl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&bl){var a,i=vl(bl(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&_l.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["decade","locale","minDate","maxDate","yearsListFormat","getYearControlProps","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","nextDisabled","previousDisabled","levelControlAriaLabel","withNext","withPrevious","className","decadeLabelFormat","classNames","styles","unstyled","__staticSelector","__stopPropagation","variant","size"]),F=el(null,{name:["DecadeLevel",R],classNames:D,styles:P,unstyled:M,variant:L,size:N}),z=F.classes,H=F.cx,V=dr(),W=function(e){var t=Qo(e);return[t[0][0],t[3][0]]}(a),$=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||ml(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(W,2),B=$[0],Y=$[1],U={__staticSelector:R||"DecadeLevel",classNames:D,styles:P,unstyled:M,variant:L,size:N},G="boolean"==typeof k?k:!!l&&!g()(Y).endOf("year").isBefore(l),q="boolean"==typeof S?S:!!o&&!g()(B).startOf("year").isAfter(o),Z=function(e,t){return g()(e).locale(i||V.locale).format(t)};return t().createElement(Fn,kl({className:H(z.decadeLevel,A),"data-decade-level":!0,ref:n},T),t().createElement(Ma,kl({label:"function"==typeof C?C(B,Y):"".concat(Z(B,C)," – ").concat(Z(Y,C)),className:z.calendarHeader,__preventFocus:v,__stopPropagation:I,nextIcon:m,previousIcon:y,nextLabel:b,previousLabel:x,onNext:_,onPrevious:w,nextDisabled:G,previousDisabled:q,hasNextLevel:!1,levelControlAriaLabel:O,withNext:j,withPrevious:E},U)),t().createElement(pl,kl({decade:a,locale:i,minDate:o,maxDate:l,yearsListFormat:s,getYearControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:d,__onControlMouseEnter:h,__preventFocus:v,__stopPropagation:I,withCellSpacing:p},U)))}));function jl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return El(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?El(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function El(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Ol.displayName="@mantine/dates/DecadeLevel";var Al=Object.defineProperty,Cl=Object.getOwnPropertySymbols,Dl=Object.prototype.hasOwnProperty,Pl=Object.prototype.propertyIsEnumerable,Ml=function(e,t,n){return t in e?Al(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Rl={numberOfColumns:1},Il=(0,e.forwardRef)((function(n,r){var a=Rt("DecadeLevelGroup",Rl,n),i=a.decade,o=a.locale,l=a.minDate,s=a.maxDate,c=a.yearsListFormat,u=a.getYearControlProps,f=a.__onControlClick,d=a.__onControlMouseEnter,h=a.withCellSpacing,p=a.__preventFocus,v=a.nextIcon,m=a.previousIcon,y=a.nextLabel,b=a.previousLabel,x=a.onNext,_=a.onPrevious,w=a.nextDisabled,k=a.previousDisabled,S=a.className,O=a.classNames,j=a.styles,E=a.unstyled,A=a.__staticSelector,C=a.__stopPropagation,D=a.numberOfColumns,P=a.levelControlAriaLabel,M=a.decadeLabelFormat,R=a.variant,I=a.size,L=function(e,t){var n={};for(var r in e)Dl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Cl){var a,i=jl(Cl(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Pl.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(a,["decade","locale","minDate","maxDate","yearsListFormat","getYearControlProps","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","nextDisabled","previousDisabled","className","classNames","styles","unstyled","__staticSelector","__stopPropagation","numberOfColumns","levelControlAriaLabel","decadeLabelFormat","variant","size"]),N=Jo(null,{name:["DecadeLevelGroup",A],styles:j,classNames:O,unstyled:E,variant:R,size:I}),T=N.classes,F=N.cx,z=(0,e.useRef)([]),H=Array(D).fill(0).map((function(e,n){var r=g()(i).add(10*n,"years").toDate();return t().createElement(Ol,{key:n,variant:R,size:I,yearsListFormat:c,decade:r,withNext:n===D-1,withPrevious:0===n,decadeLabelFormat:M,__onControlClick:f,__onControlMouseEnter:d,__onControlKeyDown:function(e,t){return Fi({levelIndex:n,rowIndex:t.rowIndex,cellIndex:t.cellIndex,event:e,controlsRef:z})},__getControlRef:function(e,t,r){Array.isArray(z.current[n])||(z.current[n]=[]),Array.isArray(z.current[n][e])||(z.current[n][e]=[]),z.current[n][e][t]=r},levelControlAriaLabel:"function"==typeof P?P(r):P,locale:o,minDate:l,maxDate:s,__preventFocus:p,__stopPropagation:C,nextIcon:v,previousIcon:m,nextLabel:y,previousLabel:b,onNext:x,onPrevious:_,nextDisabled:w,previousDisabled:k,getYearControlProps:u,__staticSelector:A||"DecadeLevelGroup",classNames:O,styles:j,unstyled:E,withCellSpacing:h})}));return t().createElement(Fn,function(e,t){for(var n in t||(t={}))Dl.call(t,n)&&Ml(e,n,t[n]);if(Cl){var r,a=jl(Cl(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Pl.call(t,n)&&Ml(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:F(T.decadeLevelGroup,S),ref:r},L),H)}));function Ll(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||Tl(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Tl(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Tl(e,t){if(e){if("string"==typeof e)return Fl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fl(e,t):void 0}}function Fl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Il.displayName="@mantine/dates/DecadeLevelGroup";var zl=Object.defineProperty,Hl=Object.getOwnPropertySymbols,Vl=Object.prototype.hasOwnProperty,Wl=Object.prototype.propertyIsEnumerable,$l=function(e,t,n){return t in e?zl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Bl=function(e,t){for(var n in t||(t={}))Vl.call(t,n)&&$l(e,n,t[n]);if(Hl){var r,a=Nl(Hl(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Wl.call(t,n)&&$l(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Yl={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0},Ul=(0,e.forwardRef)((function(e,n){var r=Rt("Calendar",Yl,e),a=r.maxLevel,i=r.minLevel,o=r.defaultLevel,l=r.level,s=r.onLevelChange,c=r.date,u=r.defaultDate,f=r.onDateChange,d=r.numberOfColumns,h=r.columnsToScroll,p=r.ariaLabels,v=r.onYearSelect,m=r.onMonthSelect,y=r.onYearMouseEnter,b=r.onMonthMouseEnter,x=r.__updateDateOnYearSelect,_=r.__updateDateOnMonthSelect,w=r.firstDayOfWeek,k=r.weekdayFormat,S=r.weekendDays,O=r.getDayProps,j=r.excludeDate,E=r.renderDay,A=r.hideOutsideDates,C=r.hideWeekdays,D=r.getDayAriaLabel,P=r.monthLabelFormat,M=r.nextIcon,R=r.previousIcon,I=r.__onDayClick,L=r.__onDayMouseEnter,N=r.withCellSpacing,T=r.monthsListFormat,F=r.getMonthControlProps,z=r.yearLabelFormat,H=r.yearsListFormat,V=r.getYearControlProps,W=r.decadeLabelFormat,$=r.minDate,B=r.maxDate,Y=r.locale,U=r.className,G=r.classNames,q=r.styles,Z=r.__staticSelector,K=r.unstyled,X=r.variant,J=r.size,Q=r.__preventFocus,ee=r.__stopPropagation,te=r.onNextDecade,ne=r.onPreviousDecade,re=r.onNextYear,ae=r.onPreviousYear,ie=r.onNextMonth,oe=r.onPreviousMonth,le=r.static,se=function(e,t){var n={};for(var r in e)Vl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Hl){var a,i=Nl(Hl(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Wl.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["maxLevel","minLevel","defaultLevel","level","onLevelChange","date","defaultDate","onDateChange","numberOfColumns","columnsToScroll","ariaLabels","onYearSelect","onMonthSelect","onYearMouseEnter","onMonthMouseEnter","__updateDateOnYearSelect","__updateDateOnMonthSelect","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","monthLabelFormat","nextIcon","previousIcon","__onDayClick","__onDayMouseEnter","withCellSpacing","monthsListFormat","getMonthControlProps","yearLabelFormat","yearsListFormat","getYearControlProps","decadeLabelFormat","minDate","maxDate","locale","className","classNames","styles","__staticSelector","unstyled","variant","size","__preventFocus","__stopPropagation","onNextDecade","onPreviousDecade","onNextYear","onPreviousYear","onNextMonth","onPreviousMonth","static"]),ce=Jn(null,{name:["Calendar",Z],classNames:G,styles:q,unstyled:K,variant:X,size:J}),ue=ce.classes,fe=ce.cx,de=Ll(Lt({value:l?Hn(l,i,a):void 0,defaultValue:o?Hn(o,i,a):void 0,finalValue:Hn(void 0,i,a),onChange:s}),2),he=de[0],pe=de[1],ve=Ll(Lt({value:c,defaultValue:u,finalValue:null,onChange:f}),2),me=ve[0],ye=ve[1],ge={__staticSelector:Z||"Calendar",styles:q,classNames:G,unstyled:K,variant:X,size:J},be=h||d||1,xe=me||new Date;return t().createElement(Fn,Bl({className:fe(ue.calendar,U),ref:n},se),"month"===he&&t().createElement(Gi,Bl({month:xe,minDate:$,maxDate:B,firstDayOfWeek:w,weekdayFormat:k,weekendDays:S,getDayProps:O,excludeDate:j,renderDay:E,hideOutsideDates:A,hideWeekdays:C,getDayAriaLabel:D,onNext:function(){var e=g()(xe).add(be,"month").toDate();null==ie||ie(e),ye(e)},onPrevious:function(){var e=g()(xe).subtract(be,"month").toDate();null==oe||oe(e),ye(e)},hasNextLevel:"month"!==a,onLevelClick:function(){return pe("year")},numberOfColumns:d,locale:Y,levelControlAriaLabel:null==p?void 0:p.monthLevelControl,nextLabel:null==p?void 0:p.nextMonth,nextIcon:M,previousLabel:null==p?void 0:p.previousMonth,previousIcon:R,monthLabelFormat:P,__onDayClick:I,__onDayMouseEnter:L,__preventFocus:Q,__stopPropagation:ee,static:le,withCellSpacing:N},ge)),"year"===he&&t().createElement(Xo,Bl({year:xe,numberOfColumns:d,minDate:$,maxDate:B,monthsListFormat:T,getMonthControlProps:F,locale:Y,onNext:function(){var e=g()(xe).add(be,"year").toDate();null==re||re(e),ye(e)},onPrevious:function(){var e=g()(xe).subtract(be,"year").toDate();null==ae||ae(e),ye(e)},hasNextLevel:"month"!==a&&"year"!==a,onLevelClick:function(){return pe("decade")},levelControlAriaLabel:null==p?void 0:p.yearLevelControl,nextLabel:null==p?void 0:p.nextYear,nextIcon:M,previousLabel:null==p?void 0:p.previousYear,previousIcon:R,yearLabelFormat:z,__onControlMouseEnter:b,__onControlClick:function(e,t){_&&ye(t),pe(Hn("month",i,a)),null==m||m(t)},__preventFocus:Q,__stopPropagation:ee,withCellSpacing:N},ge)),"decade"===he&&t().createElement(Il,Bl({decade:xe,minDate:$,maxDate:B,yearsListFormat:H,getYearControlProps:V,locale:Y,onNext:function(){var e=g()(xe).add(10*be,"year").toDate();null==te||te(e),ye(e)},onPrevious:function(){var e=g()(xe).subtract(10*be,"year").toDate();null==ne||ne(e),ye(e)},numberOfColumns:d,nextLabel:null==p?void 0:p.nextDecade,nextIcon:M,previousLabel:null==p?void 0:p.previousDecade,previousIcon:R,decadeLabelFormat:W,__onControlMouseEnter:y,__onControlClick:function(e,t){x&&ye(t),pe(Hn("year",i,a)),null==v||v(t)},__preventFocus:Q,__stopPropagation:ee,withCellSpacing:N},ge)))}));function Gl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ql(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ql(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function ql(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Ul.displayName="@mantine/dates/Calendar";var Zl=Object.defineProperty,Kl=Object.getOwnPropertySymbols,Xl=Object.prototype.hasOwnProperty,Jl=Object.prototype.propertyIsEnumerable,Ql=function(e,t,n){return t in e?Zl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},es=function(e,t){for(var n in t||(t={}))Xl.call(t,n)&&Ql(e,n,t[n]);if(Kl){var r,a=Gl(Kl(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Jl.call(t,n)&&Ql(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},ts={type:"default",numberOfColumns:1},ns=(0,e.forwardRef)((function(e,n){var r=Rt("DatePicker",ts,e),a=r.type,i=r.defaultValue,o=r.value,l=r.onChange,s=r.__staticSelector,c=r.getDayProps,u=r.allowSingleDateInRange,f=r.allowDeselect,d=r.onMouseLeave,h=r.numberOfColumns,p=function(e,t){var n={};for(var r in e)Xl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Kl){var a,i=Gl(Kl(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Jl.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["type","defaultValue","value","onChange","__staticSelector","getDayProps","allowSingleDateInRange","allowDeselect","onMouseLeave","numberOfColumns"]),v=$t({type:a,level:"day",allowDeselect:f,allowSingleDateInRange:u,value:o,defaultValue:i,onChange:l,onMouseLeave:d}),m=v.onDateChange,y=v.onRootMouseLeave,g=v.onHoveredDateChange,b=v.getControlProps;return t().createElement(Ul,es({ref:n,minLevel:"month",__staticSelector:s||"DatePicker",onMouseLeave:y,hideOutsideDates:1!==h,numberOfColumns:h,__onDayMouseEnter:function(e,t){return g(t)},__onDayClick:function(e,t){return m(t)},getDayProps:function(e){return es(es({},b(e)),null==c?void 0:c(e))}},p))}));function rs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return as(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?as(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function as(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}ns.displayName="@mantine/dates/DatePicker";var is=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];(0,e.useEffect)((function(){var e=new IntersectionObserver((function(n){rs(n,1)[0].isIntersecting&&(t(),e.disconnect())}),{rootMargin:"0px 0px 0px 0px"});return e.observe(n.current),function(){return e.disconnect()}}),r)},os=function(t,n){(0,e.useEffect)((function(){function e(e){t.current&&t.current instanceof HTMLElement&&!t.current.contains(e.target)&&n()}return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[t,n])};const ls=function(e){var t=e.className,n=void 0===t?"":t;return React.createElement("svg",{className:"min-w-[24px]".concat(n?" "+n:""),width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("mask",{id:"mask0_406_27403",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},React.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),React.createElement("g",{mask:"url(#mask0_406_27403)"},React.createElement("path",{d:"M12 14.6538L7.59619 10.25H16.4038L12 14.6538Z",fill:"currentColor"})))};var ss=function(e,t){var n=null,r=null;switch(e){case"today":(n=new Date).setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"last_7_days":(n=new Date).setDate(n.getDate()-6),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"last_4_weeks":(n=new Date).setDate(n.getDate()-27),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"last_6_months":(n=new Date).setMonth(n.getMonth()-6),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"last_12_months":(n=new Date).setMonth(n.getMonth()-12),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"month_to_date":(n=new Date).setDate(1),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"quarter_to_date":var a=new Date,i=Math.floor(a.getMonth()/3);(n=new Date(a.getFullYear(),3*i,1)).setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"year_to_date":(n=new Date).setMonth(0,1),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"custom":t&&2===t.length&&t[0]&&t[1]&&t[0]instanceof Date&&t[1]instanceof Date?((n=new Date(t[0])).setHours(0,0,0,0),(r=new Date(t[1])).setHours(23,59,59,999)):(console.warn("Invalid custom date period, falling back to last 7 days"),(n=new Date).setDate(n.getDate()-6),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999));break;default:return{startDate:null,endDate:null}}return{startDate:n,endDate:r}};const cs=function(e,t){var n,r=ss(e,t),a=r.startDate,i=r.endDate;return a&&i?{start_date:(n=a,n.getFullYear()+"/"+(n.getMonth()+1)+"/"+n.getDate()+" 00:00:00"),end_date:function(e){return e.getFullYear()+"/"+(e.getMonth()+1)+"/"+e.getDate()+" 23:59:59"}(i)}:{start_date:null,end_date:null}};function us(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fs(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}g().extend(x()),g().extend(w());var ds=[{key:"today",label:fbox_admin_js_object.langs.TODAY},{key:"last_7_days",label:fbox_admin_js_object.langs.LAST_7_DAYS},{key:"last_4_weeks",label:fbox_admin_js_object.langs.LAST_4_WEEKS},{key:"last_6_months",label:fbox_admin_js_object.langs.LAST_6_MONTHS},{key:"last_12_months",label:fbox_admin_js_object.langs.LAST_12_MONTHS},{key:"month_to_date",label:fbox_admin_js_object.langs.MONTH_TO_DATE},{key:"quarter_to_date",label:fbox_admin_js_object.langs.QUARTER_TO_DATE},{key:"year_to_date",label:fbox_admin_js_object.langs.YEAR_TO_DATE}],hs=(0,e.memo)((function(n){var r=n.theme,a=n.date_period,i=n.custom_date_period,o=n.onSelectDatePeriod,l=n.onSelectCustomDatePeriod,s=us((0,e.useState)(!1),2),c=s[0],u=s[1],f=us((0,e.useState)([null,null]),2),d=f[0],h=f[1],p=us((0,e.useState)(a),2),v=p[0],m=p[1],y=us((0,e.useState)([null,null]),2),b=y[0],x=y[1],_=us((0,e.useState)(a),2),w=_[0],k=_[1],S=(0,e.useRef)();os(S,(function(){u(!1),O()}));var O=function(){k(v),x(d)},j=function(){if(w!==v)return!0;if("custom"===w){if(!(b[0]&&b[1]&&d[0]&&d[1]))return!1;var e=g()(b[0]),t=g()(b[1]),n=g()(d[0]),r=g()(d[1]);return!e.isSame(n,"day")||!t.isSame(r,"day")}return!1};(0,e.useEffect)((function(){if("custom"===a&&i&&2===i.length)if(i[0]&&i[1]){var e=[new Date(i[0]),new Date(i[1])];h(e),x(e)}else{var t=E("last_7_days");h(t),x(t),m("last_7_days"),k("last_7_days")}else{var n=E(a);h(n),x(n)}m(a),k(a)}),[a,i]);var E=function(e){var t=ss(e,null);return[t.startDate,t.endDate]};return t().createElement("div",{ref:S,className:"relative"},t().createElement("button",{onClick:function(){return c?u(!1):(u(!0),void O())},className:"flex items-center cursor-pointer gap-[4px] bg-transparent border-none p-0 text-gray-700 dark:text-gray-300"},t().createElement("span",null,function(){if("custom"===a&&i&&2===i.length&&i[0]&&i[1]){var e=g()(i[0]),t=g()(i[1]);return e.isSame(t,"day")?e.format("MMM D, YYYY"):"".concat(e.format("MMM D, YYYY")," - ").concat(t.format("MMM D, YYYY"))}var n=ds.find((function(e){return e.key===a}));return n?n.label:"Last 7 days"}()),t().createElement(ls,{className:c?"rotate-180":""})),c&&t().createElement("div",{className:"absolute top-full left-0 mt-1 bg-white dark:bg-[#343d43] border border-gray-200 dark:border-[#626f78] rounded-md shadow-lg z-50 p-3 w-[710px]"},t().createElement("div",{className:"flex gap-3"},t().createElement("div",{className:"min-w-[120px] flex flex-col gap-2"},ds.map((function(e){return t().createElement("button",{key:e.key,onClick:function(){return function(e){if(k(e),"custom"!==e){var t=E(e);x(t)}}(e.key)},className:"\n                                        w-full text-left cursor-pointer text-sm transition-colors border-none p-0 bg-transparent rounded\n                                        ".concat(w===e.key?"text-accent dark:text-dark-accent font-medium":"text-gray-700 dark:text-gray-100","\n                                    ")},e.label)}))),t().createElement("div",{className:"flex-1"},t().createElement("div",{className:"flex items-center justify-between mb-4"},t().createElement("div",{className:"flex items-center gap-4"},t().createElement("div",{className:"flex items-center gap-2"},t().createElement("span",{className:"text-sm text-gray-600 dark:text-gray-400"},"Start"),t().createElement("div",{className:"px-3 py-1 bg-gray-100 dark:bg-[#626f78] text-gray-900 dark:text-gray-100 rounded text-sm min-w-[100px] text-center"},b[0]?g()(b[0]).format("DD/MM/YYYY"):g()().format("DD/MM/YYYY"))),t().createElement("div",{className:"flex items-center gap-2"},t().createElement("span",{className:"text-sm text-gray-600 dark:text-gray-300"},"End"),t().createElement("div",{className:"px-3 py-1 bg-gray-100 dark:bg-[#626f78] text-gray-900 dark:text-gray-100 rounded text-sm min-w-[100px] text-center"},b[1]?g()(b[1]).format("DD/MM/YYYY"):g()().format("DD/MM/YYYY"))))),t().createElement("div",{className:"mb-4"},t().createElement(ns,{type:"range",value:b,onChange:function(e){x(e),k("custom")},allowSingleDateInRange:!0,numberOfColumns:2,getDayProps:function(e){var t=new Date;if(t.setHours(23,59,59,999),e>t)return{disabled:!0};var n=new Date;n.setHours(0,0,0,0);var a=new Date(e);return a.setHours(0,0,0,0),a.getTime()===n.getTime()?{style:{backgroundColor:"dark"===r?"rgb(75, 85, 99)":"rgb(229, 231, 235)",fontWeight:"500"}}:{}},firstDayOfWeek:1,styles:{calendar:{width:"100%"},calendarBase:{width:"100%"},monthsListControl:{color:"dark"===r?"#d1d5db":"inherit","&:hover":{backgroundColor:"dark"===r?"#626f78":"rgb(243, 244, 246)"}},yearLevelGroup:{gap:"1rem"},month:{width:"250px"},monthThead:{color:"dark"===r?"#9ca3af":"rgb(107, 114, 128)"},calendarHeaderLevel:{color:"dark"===r?"#d1d5db":"inherit",fontWeight:"500","&:hover":{backgroundColor:"dark"===r?"#626f78":"rgb(243, 244, 246)"}},calendarHeaderControl:{color:"dark"===r?"#d1d5db":"inherit","&:hover":{backgroundColor:"dark"===r?"#626f78":"rgb(243, 244, 246)"}},calendarHeaderControlIcon:{color:"dark"===r?"#d1d5db":"inherit"},day:{color:"dark"===r?"#d1d5db":"inherit",borderRadius:"50%","&:hover":{backgroundColor:"dark"===r?"#626f78":"rgb(243, 244, 246)"},"&[data-selected]":{backgroundColor:"rgb(37, 99, 235)",color:"white","&:hover":{backgroundColor:"rgb(29, 78, 216)"},"&[data-weekend]":{color:"#fff"},"&[data-last-in-range]":{backgroundColor:"rgb(37, 99, 235) !important",color:"white"}},"&[data-in-range]":{backgroundColor:"dark"===r?"rgb(30, 64, 175)":"rgb(219, 234, 254)",color:"dark"===r?"#d1d5db":"inherit",borderRadius:"50%"},"&[data-first-in-range]":{backgroundColor:"rgb(37, 99, 235)",color:"white"},"&[data-last-in-range]":{backgroundColor:"rgb(37, 99, 235)",color:"white"},"&[data-disabled]":{color:"dark"===r?"rgba(209, 213, 219, 0.4)":"rgba(107, 114, 128, 0.4)",backgroundColor:"transparent"},"&[data-weekend]":{color:"dark"===r?"rgb(209, 213, 219)":"inherit"}}}})),t().createElement("div",{className:"flex justify-end gap-2"},t().createElement("button",{onClick:function(){if(m(w),h(b),"custom"!==w)o(w),localStorage.setItem("firebox_analytics_date_period",w),localStorage.removeItem("firebox_analytics_custom_date_period");else if(b[0]&&b[1]&&b[0]instanceof Date&&b[1]instanceof Date){var e=[b[0],b[1]];l(e),o("custom"),localStorage.setItem("firebox_analytics_date_period","custom"),localStorage.setItem("firebox_analytics_custom_date_period",JSON.stringify(e))}else o("last_7_days"),localStorage.setItem("firebox_analytics_date_period","last_7_days"),localStorage.removeItem("firebox_analytics_custom_date_period");u(!1)},disabled:!j(),className:"\n                                        px-3 py-1 text-sm rounded transition-colors border-none\n                                        ".concat(j()?"bg-accent text-white hover:bg-dark-accent-hover cursor-pointer":"bg-gray-300 dark:bg-gray-600 text-gray-500 dark:text-gray-400 cursor-not-allowed opacity-50 pointer-events-none","\n                                    ")},"Apply"))))))}));const ps=hs;function vs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ms(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ms(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ms(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ys=(0,e.memo)((function(n){var r=n.selected_campaign,a=n.onSelectCampaign,i=vs((0,e.useState)(!1),2),o=i[0],l=i[1],s=vs((0,e.useState)(null),2),c=s[0],u=s[1],f=vs((0,e.useState)(""),2),d=f[0],h=f[1],p=vs((0,e.useState)(fbox_admin_js_object.langs.ALL_CAMPAIGNS),2),v=p[0],m=p[1],y=(0,e.useMemo)((function(){return d?null==c?void 0:c.filter((function(e){return e.label.toLowerCase().includes(d.toLowerCase())})):c}),[c,d]),g=(0,e.useRef)("Filters_CampaignsDropdown");if(os(g,(function(){l(!1)})),(0,e.useEffect)((function(){if(null===c){var e=new IntersectionObserver((function(t){if(vs(t,1)[0].isIntersecting){var n=new FormData;n.append("nonce",fpf_js_object.nonce),n.append("action","firebox_analytics_get_dropdown_campaigns"),fetch(fpf_js_object.ajax_url,{method:"POST",body:n}).then((function(e){return e.json()})).then((function(e){u(e)})),e.disconnect()}}),{rootMargin:"0px 0px 0px 0px"});e.observe(g.current)}}),[]),(0,e.useEffect)((function(){var e,t=fbox_admin_js_object.langs.ALL_CAMPAIGNS;c&&null!=c&&c.length&&(t=null===r?fbox_admin_js_object.langs.ALL_CAMPAIGNS:(null===(e=c.filter((function(e){return parseInt(e.id)===parseInt(r)}))[0])||void 0===e?void 0:e.label)||fbox_admin_js_object.langs.ALL_CAMPAIGNS),m(t)}),[c,r]),null==c||!c.permission_denied)return t().createElement("div",{ref:g,className:"relative"},t().createElement("div",{className:"leading-[24px] max-w-[400px] text-default dark:text-white min-h-[24px] min-w-[120px]"},null===c?t().createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}):(null==c?void 0:c.length)>0&&t().createElement("div",{className:"flex items-center gap-1 justify-end"},t().createElement("div",{className:"flex items-center cursor-pointer truncate",onClick:function(){l((function(e){return!e}))}},t().createElement("div",{className:"truncate",title:v},v),t().createElement(ls,{className:o?"rotate-180":""})),null!==r&&t().createElement("button",{type:"button",onClick:function(e){var t;null==e||null===(t=e.stopPropagation)||void 0===t||t.call(e),a(null),l(!1)},className:"inline-flex items-center cursor-pointer shrink-0 p-0 bg-transparent border-0 hover:text-accent dark:hover:text-accent",title:fbox_admin_js_object.langs.CLEAR_SELECTED_CAMPAIGN||fbox_admin_js_object.langs.VIEW_ALL_ANALYTICS,"aria-label":fbox_admin_js_object.langs.CLEAR_SELECTED_CAMPAIGN||fbox_admin_js_object.langs.VIEW_ALL_ANALYTICS},t().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24","aria-hidden":"true"},t().createElement("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"2"}),t().createElement("path",{d:"M9 9l6 6M15 9l-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}))))),c&&(null==c?void 0:c.length)>0&&o&&t().createElement("div",{className:"flex flex-col bg-white dark:bg-[#343d43] text-sm text-default hover:text-black w-[400px] absolute right-0 top-full z-20 rounded shadow-box"},t().createElement("div",{className:"flex flex-col sticky top-0 bg-white dark:bg-[#343d43] rounded-tl rounded-tr border border-solid border-grey-3 dark:border-[#626f78] border-r-0 border-l-0 border-t-0"},t().createElement("input",{autoFocus:!0,onChange:function(e){return h(e.target.value)},value:d,className:"border border-solid dark:bg-[#626f78] dark:placeholder:text-grey-4 dark:text-white border-grey-3 focus:border-grey-1 m-1 px-2 py-[11px] pr-6 rounded-[27px] shadow-none outline-none dark:border-none",placeholder:fbox_admin_js_object.langs.SEARCH_DOTS}),!d&&t().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"absolute dark:text-white right-3 top-1/2 -translate-y-1/2",width:"24",height:"24",viewBox:"0 -960 960 960"},t().createElement("path",{d:"M781.692-136.924 530.461-388.155q-30 24.769-69 38.769t-80.692 14q-102.55 0-173.582-71.014t-71.032-173.537q0-102.524 71.014-173.601 71.014-71.076 173.538-71.076 102.523 0 173.6 71.032T625.384-580q0 42.846-14.385 81.846-14.385 39-38.385 67.846l251.231 251.231-42.153 42.153Zm-400.923-258.46q77.308 0 130.962-53.654Q565.385-502.692 565.385-580q0-77.308-53.654-130.962-53.654-53.654-130.962-53.654-77.308 0-130.962 53.654Q196.154-657.308 196.154-580q0 77.308 53.653 130.962 53.654 53.654 130.962 53.654Z",fill:"currentColor"})),d&&t().createElement("svg",{onClick:function(){return h("")},xmlns:"http://www.w3.org/2000/svg",className:"absolute cursor-pointer dark:text-white right-3 top-1/2 -translate-y-1/2",width:"24",height:"24",viewBox:"0 -960 960 960"},t().createElement("path",{d:"M256-213.847 213.847-256l224-224-224-224L256-746.153l224 224 224-224L746.153-704l-224 224 224 224L704-213.847l-224-224-224 224Z",fill:"currentColor"}))),t().createElement("ul",{className:"m-0 h-[200px] overflow-y-auto overscroll-contain"},y.length>0?t().createElement(t().Fragment,null,Object.keys(y).map((function(e,n){return t().createElement("li",{key:n,onClick:function(){return t=y[e].id,a(t),void l(!1);var t},className:"p-1 m-0 hover:cursor-pointer ".concat(r===y[e].id?" pointer-events-none bg-pale-blue text-black dark:bg-pale-blue":"hover:bg-pale-blue dark:hover:bg-[#6b7a84] text-default hover:text-black dark:text-grey-3 dark:hover:text-white")},y[e].label)}))):t().createElement("li",{className:"pointer-events-none dark:text-grey-3 p-4 text-center m-0 h-full flex items-center justify-center"},fbox_admin_js_object.langs.NO_CAMPAIGNS_FOUND))))}));const gs=ys;function bs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var xs=function e(t,n){function r(e,r,a){if("undefined"!=typeof document){"number"==typeof(a=bs({},n,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var o in a)a[o]&&(i+="; "+o,!0!==a[o]&&(i+="="+a[o].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},a=0;a<n.length;a++){var i=n[a].split("="),o=i.slice(1).join("=");try{var l=decodeURIComponent(i[0]);if(r[l]=t.read(o,l),e===l)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",bs({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,bs({},this.attributes,t))},withConverter:function(t){return e(bs({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function _s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ws(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_s(Object(n),!0).forEach((function(t){ks(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ks(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Os=function(e,t){var n=new Map;return null!=t&&t.length&&t.forEach((function(e){n.set(e.label,parseFloat(e.total))})),e.map((function(e){return{date:e,total:(null==n?void 0:n.get(e))||"0.00"}}))},js=function(e,t){var n,r=new Map,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ss(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ss(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(t);try{for(a.s();!(n=a.n()).done;){var i=n.value;r.set(i.label,parseFloat(i.total))}}catch(e){a.e(e)}finally{a.f()}return e.map((function(e){return{date:e,total:r.get(e)||0}}))},Es={views:{label:fbox_admin_js_object.langs.VIEWS,colorClass:"text-metric-views",color:"#5383EC"},conversions:{label:fbox_admin_js_object.langs.CONVERSIONS,colorClass:"text-metric-conversions",color:"#dfa1b7"},conversionrate:{label:fbox_admin_js_object.langs.CONVERSION_RATE,colorClass:"text-metric-conversion-rate",color:"#8B5CF6",suffix:"%"}},As=function(){return"undefined"!=typeof window&&window.wp&&window.wp.hooks?window.wp.hooks:null},Cs=ws({},function(){var e=As();return e?e.applyFilters("firebox.performance.metrics",Es):Es}()),Ds=As();Ds&&Ds.addAction("firebox.revenue.ready","firebox/performance-metrics",(function(){var e=As(),t=e?e.applyFilters("firebox.performance.metrics",Es):Es;Cs=ws({},t)}),10);var Ps=function(){return"dark"===(xs.get("fireplugins_theme")||"light")?"dark":"light"},Ms=function(){return React.createElement("div",{className:"flex flex-col gap-2"},React.createElement("div",{className:"flex gap-[4px] flex-wrap justify-between"},React.createElement("div",{className:"animate-pulse h-2 w-[100px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-2 w-[100px] bg-slate-200 dark:bg-slate-700 rounded"})),React.createElement("div",{className:"flex flex-col gap-5 justify-between h-[320px] w-full"},React.createElement("div",{className:"animate-pulse h-1 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-1 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-1 bg-slate-200 dark:bg-slate-700 rounded"})))},Rs={list:fbox_admin_js_object.langs.DAILY,weekly:fbox_admin_js_object.langs.WEEKLY,monthly:fbox_admin_js_object.langs.MONTHLY};function Is(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Ls=function(n){var r=n.showCampaignDropdown,a=void 0===r||r,i=f(),o=u(),l=o.date_period,s=o.custom_date_period,c=o.selected_campaign,d=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Is(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Is(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(Ps()),2),h=d[0],p=d[1];(0,e.useEffect)((function(){var e=function(){p(Ps())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var v=(0,e.useCallback)((function(e){i({type:"SET_DATE_PERIOD",payload:e})}),[]),m=(0,e.useCallback)((function(e){i({type:"SET_CAMPAIGN_DATA",payload:null}),i({type:"SET_SELECTED_CAMPAIGN",payload:e})}),[]),y=(0,e.useCallback)((function(e){i({type:"SET_CUSTOM_DATE_PERIOD",payload:e})}),[]);return t().createElement("div",{className:"flex items-center text-base justify-between gap-2 flex-wrap"},t().createElement(ps,{theme:h,date_period:l,custom_date_period:s,onSelectDatePeriod:v,onSelectCustomDatePeriod:y}),a&&t().createElement(gs,{selected_campaign:c,onSelectCampaign:m}))};function Ns(e){return Ns="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},Ns(e)}function Ts(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zs(e){return e+.5|0}var Hs=function(e,t,n){return Math.max(Math.min(e,n),t)};function Vs(e){return Hs(zs(2.55*e),0,255)}function Ws(e){return Hs(zs(255*e),0,255)}function $s(e){return Hs(zs(e/2.55)/100,0,1)}function Bs(e){return Hs(zs(100*e),0,100)}var Ys,Us,Gs={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},qs=function(e){if(Array.isArray(e))return Fs(e)}(Ys="0123456789ABCDEF")||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(Ys)||Fs(Ys,Us)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),Zs=function(e){return qs[15&e]},Ks=function(e){return qs[(240&e)>>4]+qs[15&e]},Xs=function(e){return(240&e)>>4==(15&e)};var Js=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Qs(e,t,n){var r=t*Math.min(n,1-n),a=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t+e/30)%12;return n-r*Math.max(Math.min(a-3,9-a,1),-1)};return[a(0),a(8),a(4)]}function ec(e,t,n){var r=function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(r+e/60)%6;return n-n*t*Math.max(Math.min(a,4-a,1),0)};return[r(5),r(3),r(1)]}function tc(e,t,n){var r,a=Qs(e,1,.5);for(t+n>1&&(t*=r=1/(t+n),n*=r),r=0;r<3;r++)a[r]*=1-t-n,a[r]+=t;return a}function nc(e){var t,n,r,a=e.r/255,i=e.g/255,o=e.b/255,l=Math.max(a,i,o),s=Math.min(a,i,o),c=(l+s)/2;return l!==s&&(r=l-s,n=c>.5?r/(2-l-s):r/(l+s),t=function(e,t,n,r,a){return e===a?(t-n)/r+(t<n?6:0):t===a?(n-e)/r+2:(e-t)/r+4}(a,i,o,r,l),t=60*t+.5),[0|t,n||0,c]}function rc(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Ws)}function ac(e,t,n){return rc(Qs,e,t,n)}function ic(e){return(e%360+360)%360}var oc,lc={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"},sc={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"};var cc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,uc=function(e){return e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055},fc=function(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)};function dc(e,t,n){if(e){var r=nc(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,0===t?360:1)),r=ac(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function hc(e,t){return e?Object.assign(t||{},e):e}function pc(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Ws(e[3]))):(t=hc(e,{r:0,g:0,b:0,a:1})).a=Ws(t.a),t}function vc(e){return"r"===e.charAt(0)?function(e){var t,n,r,a=cc.exec(e),i=255;if(a){if(a[7]!==t){var o=+a[7];i=a[8]?Vs(o):Hs(255*o,0,255)}return t=+a[1],n=+a[3],r=+a[5],{r:t=255&(a[2]?Vs(t):Hs(t,0,255)),g:n=255&(a[4]?Vs(n):Hs(n,0,255)),b:r=255&(a[6]?Vs(r):Hs(r,0,255)),a:i}}}(e):function(e){var t,n=Js.exec(e),r=255;if(n){n[5]!==t&&(r=n[6]?Vs(+n[5]):Ws(+n[5]));var a=ic(+n[2]),i=+n[3]/100,o=+n[4]/100;return{r:(t="hwb"===n[1]?function(e,t,n){return rc(tc,e,t,n)}(a,i,o):"hsv"===n[1]?function(e,t,n){return rc(ec,e,t,n)}(a,i,o):ac(a,i,o))[0],g:t[1],b:t[2],a:r}}}(e)}var mc=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t instanceof e)return t;var n,r,a,i,o=Ns(t);"object"===o?n=pc(t):"string"===o&&(i=(r=t).length,"#"===r[0]&&(4===i||5===i?a={r:255&17*Gs[r[1]],g:255&17*Gs[r[2]],b:255&17*Gs[r[3]],a:5===i?17*Gs[r[4]]:255}:7!==i&&9!==i||(a={r:Gs[r[1]]<<4|Gs[r[2]],g:Gs[r[3]]<<4|Gs[r[4]],b:Gs[r[5]]<<4|Gs[r[6]],a:9===i?Gs[r[7]]<<4|Gs[r[8]]:255})),n=a||function(e){oc||((oc=function(){var e,t,n,r,a,i={},o=Object.keys(sc),l=Object.keys(lc);for(e=0;e<o.length;e++){for(r=a=o[e],t=0;t<l.length;t++)n=l[t],a=a.replace(n,lc[n]);n=parseInt(sc[r],16),i[a]=[n>>16&255,n>>8&255,255&n]}return i}()).transparent=[0,0,0,0]);var t=oc[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}(t)||vc(t)),this._rgb=n,this._valid=!!n}var t,n;return t=e,(n=[{key:"valid",get:function(){return this._valid}},{key:"rgb",get:function(){var e=hc(this._rgb);return e&&(e.a=$s(e.a)),e},set:function(e){this._rgb=pc(e)}},{key:"rgbString",value:function(){return this._valid?(e=this._rgb)&&(e.a<255?"rgba(".concat(e.r,", ").concat(e.g,", ").concat(e.b,", ").concat($s(e.a),")"):"rgb(".concat(e.r,", ").concat(e.g,", ").concat(e.b,")")):void 0;var e}},{key:"hexString",value:function(){return this._valid?(e=this._rgb,t=function(e){return Xs(e.r)&&Xs(e.g)&&Xs(e.b)&&Xs(e.a)}(e)?Zs:Ks,e?"#"+t(e.r)+t(e.g)+t(e.b)+function(e,t){return e<255?t(e):""}(e.a,t):void 0):void 0;var e,t}},{key:"hslString",value:function(){return this._valid?function(e){if(e){var t=nc(e),n=t[0],r=Bs(t[1]),a=Bs(t[2]);return e.a<255?"hsla(".concat(n,", ").concat(r,"%, ").concat(a,"%, ").concat($s(e.a),")"):"hsl(".concat(n,", ").concat(r,"%, ").concat(a,"%)")}}(this._rgb):void 0}},{key:"mix",value:function(e,t){if(e){var n,r=this.rgb,a=e.rgb,i=t===n?.5:t,o=2*i-1,l=r.a-a.a,s=((o*l==-1?o:(o+l)/(1+o*l))+1)/2;n=1-s,r.r=255&s*r.r+n*a.r+.5,r.g=255&s*r.g+n*a.g+.5,r.b=255&s*r.b+n*a.b+.5,r.a=i*r.a+(1-i)*a.a,this.rgb=r}return this}},{key:"interpolate",value:function(e,t){return e&&(this._rgb=function(e,t,n){var r=fc($s(e.r)),a=fc($s(e.g)),i=fc($s(e.b));return{r:Ws(uc(r+n*(fc($s(t.r))-r))),g:Ws(uc(a+n*(fc($s(t.g))-a))),b:Ws(uc(i+n*(fc($s(t.b))-i))),a:e.a+n*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}},{key:"clone",value:function(){return new e(this.rgb)}},{key:"alpha",value:function(e){return this._rgb.a=Ws(e),this}},{key:"clearer",value:function(e){return this._rgb.a*=1-e,this}},{key:"greyscale",value:function(){var e=this._rgb,t=zs(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}},{key:"opaquer",value:function(e){return this._rgb.a*=1+e,this}},{key:"negate",value:function(){var e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}},{key:"lighten",value:function(e){return dc(this._rgb,2,e),this}},{key:"darken",value:function(e){return dc(this._rgb,2,-e),this}},{key:"saturate",value:function(e){return dc(this._rgb,1,e),this}},{key:"desaturate",value:function(e){return dc(this._rgb,1,-e),this}},{key:"rotate",value:function(e){return function(e,t){var n=nc(e);n[0]=ic(n[0]+t),n=ac(n),e.r=n[0],e.g=n[1],e.b=n[2]}(this._rgb,e),this}}])&&Ts(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function yc(e){return function(e){if(Array.isArray(e))return kc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||wc(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xc(e){return xc="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},xc(e)}function _c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=wc(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function wc(e,t){if(e){if("string"==typeof e)return kc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kc(e,t):void 0}}function kc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sc(){}var Oc,jc=(Oc=0,function(){return Oc++});function Ec(e){return null==e}function Ac(e){if(Array.isArray&&Array.isArray(e))return!0;var t=Object.prototype.toString.call(e);return"[object"===t.slice(0,7)&&"Array]"===t.slice(-6)}function Cc(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function Dc(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)}function Pc(e,t){return Dc(e)?e:t}function Mc(e,t){return void 0===e?t:e}var Rc=function(e,t){return"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e};function Ic(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)}function Lc(e,t,n,r){var a,i,o;if(Ac(e))if(i=e.length,r)for(a=i-1;a>=0;a--)t.call(n,e[a],a);else for(a=0;a<i;a++)t.call(n,e[a],a);else if(Cc(e))for(i=(o=Object.keys(e)).length,a=0;a<i;a++)t.call(n,e[o[a]],o[a])}function Nc(e,t){var n,r,a,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(a=e[n],i=t[n],a.datasetIndex!==i.datasetIndex||a.index!==i.index)return!1;return!0}function Tc(e){if(Ac(e))return e.map(Tc);if(Cc(e)){for(var t=Object.create(null),n=Object.keys(e),r=n.length,a=0;a<r;++a)t[n[a]]=Tc(e[n[a]]);return t}return e}function Fc(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function zc(e,t,n,r){if(Fc(e)){var a=t[e],i=n[e];Cc(a)&&Cc(i)?Hc(a,i,r):t[e]=Tc(i)}}function Hc(e,t,n){var r=Ac(t)?t:[t],a=r.length;if(!Cc(e))return e;for(var i,o=(n=n||{}).merger||zc,l=0;l<a;++l)if(Cc(i=r[l]))for(var s=Object.keys(i),c=0,u=s.length;c<u;++c)o(s[c],e,i,n);return e}function Vc(e,t){return Hc(e,t,{merger:Wc})}function Wc(e,t,n){if(Fc(e)){var r=t[e],a=n[e];Cc(r)&&Cc(a)?Vc(r,a):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Tc(a))}}var $c={"":function(e){return e},x:function(e){return e.x},y:function(e){return e.y}};function Bc(e,t){return($c[t]||($c[t]=function(e){var t=function(e){var t,n=[],r="",a=_c(e.split("."));try{for(a.s();!(t=a.n()).done;)(r+=t.value).endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="")}catch(e){a.e(e)}finally{a.f()}return n}(e);return function(e){var n,r=_c(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(""===a)break;e=e&&e[a]}}catch(e){r.e(e)}finally{r.f()}return e}}(t)))(e)}function Yc(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Uc=function(e){return void 0!==e},Gc=function(e){return"function"==typeof e},qc=function(e,t){if(e.size!==t.size)return!1;var n,r=_c(e);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(!t.has(a))return!1}}catch(e){r.e(e)}finally{r.f()}return!0},Zc=Math.PI,Kc=2*Zc,Xc=Kc+Zc,Jc=Number.POSITIVE_INFINITY,Qc=Zc/180,eu=Zc/2,tu=Zc/4,nu=2*Zc/3,ru=Math.log10,au=Math.sign;function iu(e,t,n){return Math.abs(e-t)<n}function ou(e){var t=Math.round(e);e=iu(e,t,e/1e3)?t:e;var n=Math.pow(10,Math.floor(ru(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function lu(e){return!isNaN(parseFloat(e))&&isFinite(e)}function su(e,t,n){var r,a,i;for(r=0,a=e.length;r<a;r++)i=e[r][n],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function cu(e){return e*(Zc/180)}function uu(e){return e*(180/Zc)}function fu(e){if(Dc(e)){for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}}function du(e,t){var n=t.x-e.x,r=t.y-e.y,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n);return i<-.5*Zc&&(i+=Kc),{angle:i,distance:a}}function hu(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function pu(e,t){return(e-t+Xc)%Kc-Zc}function vu(e){return(e%Kc+Kc)%Kc}function mu(e,t,n,r){var a=vu(e),i=vu(t),o=vu(n),l=vu(i-a),s=vu(o-a),c=vu(a-i),u=vu(a-o);return a===i||a===o||r&&i===o||l>s&&c<u}function yu(e,t,n){return Math.max(t,Math.min(n,e))}function gu(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-6;return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function bu(e,t,n){n=n||function(n){return e[n]<t};for(var r,a=e.length-1,i=0;a-i>1;)n(r=i+a>>1)?i=r:a=r;return{lo:i,hi:a}}var xu=function(e,t,n,r){return bu(e,n,r?function(r){var a=e[r][t];return a<n||a===n&&e[r+1][t]===n}:function(r){return e[r][t]<n})},_u=function(e,t,n){return bu(e,n,(function(r){return e[r][t]>=n}))},wu=["push","pop","shift","splice","unshift"];function ku(e,t){var n=e._chartjs;if(n){var r=n.listeners,a=r.indexOf(t);-1!==a&&r.splice(a,1),r.length>0||(wu.forEach((function(t){delete e[t]})),delete e._chartjs)}}function Su(e){var t=new Set(e);return t.size===e.length?e:Array.from(t)}var Ou="undefined"==typeof window?function(e){return e()}:window.requestAnimationFrame;function ju(e,t){var n=[],r=!1;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];n=i,r||(r=!0,Ou.call(window,(function(){r=!1,e.apply(t,n)})))}}var Eu=function(e){return"start"===e?"left":"end"===e?"right":"center"},Au=function(e,t,n){return"start"===e?t:"end"===e?n:(t+n)/2};function Cu(e,t,n){var r=t.length,a=0,i=r;if(e._sorted){var o=e.iScale,l=e._parsed,s=o.axis,c=o.getUserBounds(),u=c.min,f=c.max,d=c.minDefined,h=c.maxDefined;d&&(a=yu(Math.min(xu(l,s,u).lo,n?r:xu(t,s,o.getPixelForValue(u)).lo),0,r-1)),i=h?yu(Math.max(xu(l,o.axis,f,!0).hi+1,n?0:xu(t,s,o.getPixelForValue(f),!0).hi+1),a,r)-a:r-a}return{start:a,count:i}}function Du(e){var t=e.xScale,n=e.yScale,r=e._scaleRanges,a={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=a,!0;var i=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,a),i}var Pu=function(e){return 0===e||1===e},Mu=function(e,t,n){return-Math.pow(2,10*(e-=1))*Math.sin((e-t)*Kc/n)},Ru=function(e,t,n){return Math.pow(2,-10*e)*Math.sin((e-t)*Kc/n)+1},Iu={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return-e*(e-2)},easeInOutQuad:function(e){return(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1)},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return(e-=1)*e*e+1},easeInOutCubic:function(e){return(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return-((e-=1)*e*e*e-1)},easeInOutQuart:function(e){return(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return(e-=1)*e*e*e*e+1},easeInOutQuint:function(e){return(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},easeInSine:function(e){return 1-Math.cos(e*eu)},easeOutSine:function(e){return Math.sin(e*eu)},easeInOutSine:function(e){return-.5*(Math.cos(Zc*e)-1)},easeInExpo:function(e){return 0===e?0:Math.pow(2,10*(e-1))},easeOutExpo:function(e){return 1===e?1:1-Math.pow(2,-10*e)},easeInOutExpo:function(e){return Pu(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1)))},easeInCirc:function(e){return e>=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){return Pu(e)?e:Mu(e,.075,.3)},easeOutElastic:function(e){return Pu(e)?e:Ru(e,.075,.3)},easeInOutElastic:function(e){var t=.1125;return Pu(e)?e:e<.5?.5*Mu(2*e,t,.45):.5+.5*Ru(2*e-1,t,.45)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-Iu.easeOutBounce(1-e)},easeOutBounce:function(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*Iu.easeInBounce(2*e):.5*Iu.easeOutBounce(2*e-1)+.5}};function Lu(e){if(e&&"object"===xc(e)){var t=e.toString();return"[object CanvasPattern]"===t||"[object CanvasGradient]"===t}return!1}function Nu(e){return Lu(e)?e:new mc(e)}function Tu(e){return Lu(e)?e:new mc(e).saturate(.5).darken(.1).hexString()}var Fu=["x","y","borderWidth","radius","tension"],zu=["color","borderColor","backgroundColor"],Hu=new Map;function Vu(e,t,n){return function(e,t){t=t||{};var n=e+JSON.stringify(t),r=Hu.get(n);return r||(r=new Intl.NumberFormat(e,t),Hu.set(n,r)),r}(t,n).format(e)}var Wu={values:function(e){return Ac(e)?e:""+e},numeric:function(e,t,n){if(0===e)return"0";var r,a=this.chart.options.locale,i=e;if(n.length>1){var o=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(o<1e-4||o>1e15)&&(r="scientific"),i=function(e,t){var n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}(e,n)}var l=ru(Math.abs(i)),s=isNaN(l)?1:Math.max(Math.min(-1*Math.floor(l),20),0),c={notation:r,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Vu(e,a,c)},logarithmic:function(e,t,n){if(0===e)return"0";var r=n[t].significand||e/Math.pow(10,Math.floor(ru(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Wu.numeric.call(this,e,t,n):""}},$u={formatters:Wu},Bu=Object.create(null),Yu=Object.create(null);function Uu(e,t){if(!t)return e;for(var n=t.split("."),r=0,a=n.length;r<a;++r){var i=n[r];e=e[i]||(e[i]=Object.create(null))}return e}function Gu(e,t,n){return"string"==typeof t?Hc(Uu(e,t),n):Hc(Uu(e,""),t)}var qu=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,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=function(e){return e.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=function(e,t){return Tu(t.backgroundColor)},this.hoverBorderColor=function(e,t){return Tu(t.borderColor)},this.hoverColor=function(e,t){return Tu(t.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(n)}var t,n;return t=e,(n=[{key:"set",value:function(e,t){return Gu(this,e,t)}},{key:"get",value:function(e){return Uu(this,e)}},{key:"describe",value:function(e,t){return Gu(Yu,e,t)}},{key:"override",value:function(e,t){return Gu(Bu,e,t)}},{key:"route",value:function(e,t,n,r){var a,i=Uu(this,e),o=Uu(this,n),l="_"+t;Object.defineProperties(i,(gc(a={},l,{value:i[t],writable:!0}),gc(a,t,{enumerable:!0,get:function(){var e=this[l],t=o[r];return Cc(e)?Object.assign({},t,e):Mc(e,t)},set:function(e){this[l]=e}}),a))}},{key:"apply",value:function(e){var t=this;e.forEach((function(e){return e(t)}))}}])&&bc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Zu=new qu({_scriptable:function(e){return!e.startsWith("on")},_indexable:function(e){return"events"!==e},hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:function(e){return"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}}),e.set("animations",{colors:{type:"color",properties:zu},numbers:{type:"number",properties:Fu}}),e.describe("animations",{_fallback:"animation"}),e.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:function(e){return 0|e}}}}})},function(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:function(e,t){return t.lineWidth},tickColor:function(e,t){return t.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:$u.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:function(e){return!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e},_indexable:function(e){return"borderDash"!==e&&"tickBorderDash"!==e&&"dash"!==e}}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:function(e){return"backdropPadding"!==e&&"callback"!==e},_indexable:function(e){return"backdropPadding"!==e}})}]);function Ku(e,t,n,r,a){var i=t[a];return i||(i=t[a]=e.measureText(a).width,n.push(a)),i>r&&(r=i),r}function Xu(e,t,n,r){var a=(r=r||{}).data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(a=r.data={},i=r.garbageCollect=[],r.font=t),e.save(),e.font=t;var o,l,s,c,u,f=0,d=n.length;for(o=0;o<d;o++)if(null==(c=n[o])||Ac(c)){if(Ac(c))for(l=0,s=c.length;l<s;l++)null==(u=c[l])||Ac(u)||(f=Ku(e,a,i,f,u))}else f=Ku(e,a,i,f,c);e.restore();var h=i.length/2;if(h>n.length){for(o=0;o<h;o++)delete a[i[o]];i.splice(0,h)}return f}function Ju(e,t,n){var r=e.currentDevicePixelRatio,a=0!==n?Math.max(n/2,.5):0;return Math.round((t-a)*r)/r+a}function Qu(e,t){(t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function ef(e,t,n,r){tf(e,t,n,r,null)}function tf(e,t,n,r,a){var i,o,l,s,c,u,f,d,h=t.pointStyle,p=t.rotation,v=t.radius,m=(p||0)*Qc;if(h&&"object"===xc(h)&&("[object HTMLImageElement]"===(i=h.toString())||"[object HTMLCanvasElement]"===i))return e.save(),e.translate(n,r),e.rotate(m),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),void e.restore();if(!(isNaN(v)||v<=0)){switch(e.beginPath(),h){default:a?e.ellipse(n,r,a/2,v,0,0,Kc):e.arc(n,r,v,0,Kc),e.closePath();break;case"triangle":u=a?a/2:v,e.moveTo(n+Math.sin(m)*u,r-Math.cos(m)*v),m+=nu,e.lineTo(n+Math.sin(m)*u,r-Math.cos(m)*v),m+=nu,e.lineTo(n+Math.sin(m)*u,r-Math.cos(m)*v),e.closePath();break;case"rectRounded":s=v-(c=.516*v),o=Math.cos(m+tu)*s,f=Math.cos(m+tu)*(a?a/2-c:s),l=Math.sin(m+tu)*s,d=Math.sin(m+tu)*(a?a/2-c:s),e.arc(n-f,r-l,c,m-Zc,m-eu),e.arc(n+d,r-o,c,m-eu,m),e.arc(n+f,r+l,c,m,m+eu),e.arc(n-d,r+o,c,m+eu,m+Zc),e.closePath();break;case"rect":if(!p){s=Math.SQRT1_2*v,u=a?a/2:s,e.rect(n-u,r-s,2*u,2*s);break}m+=tu;case"rectRot":f=Math.cos(m)*(a?a/2:v),o=Math.cos(m)*v,l=Math.sin(m)*v,d=Math.sin(m)*(a?a/2:v),e.moveTo(n-f,r-l),e.lineTo(n+d,r-o),e.lineTo(n+f,r+l),e.lineTo(n-d,r+o),e.closePath();break;case"crossRot":m+=tu;case"cross":f=Math.cos(m)*(a?a/2:v),o=Math.cos(m)*v,l=Math.sin(m)*v,d=Math.sin(m)*(a?a/2:v),e.moveTo(n-f,r-l),e.lineTo(n+f,r+l),e.moveTo(n+d,r-o),e.lineTo(n-d,r+o);break;case"star":f=Math.cos(m)*(a?a/2:v),o=Math.cos(m)*v,l=Math.sin(m)*v,d=Math.sin(m)*(a?a/2:v),e.moveTo(n-f,r-l),e.lineTo(n+f,r+l),e.moveTo(n+d,r-o),e.lineTo(n-d,r+o),m+=tu,f=Math.cos(m)*(a?a/2:v),o=Math.cos(m)*v,l=Math.sin(m)*v,d=Math.sin(m)*(a?a/2:v),e.moveTo(n-f,r-l),e.lineTo(n+f,r+l),e.moveTo(n+d,r-o),e.lineTo(n-d,r+o);break;case"line":o=a?a/2:Math.cos(m)*v,l=Math.sin(m)*v,e.moveTo(n-o,r-l),e.lineTo(n+o,r+l);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(m)*(a?a/2:v),r+Math.sin(m)*v);break;case!1:e.closePath()}e.fill(),t.borderWidth>0&&e.stroke()}}function nf(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function rf(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function af(e){e.restore()}function of(e,t,n,r,a){if(!t)return e.lineTo(n.x,n.y);if("middle"===a){var i=(t.x+n.x)/2;e.lineTo(i,t.y),e.lineTo(i,n.y)}else"after"===a!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function lf(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function sf(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Ec(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function cf(e,t,n,r,a){if(a.strikethrough||a.underline){var i=e.measureText(r),o=t-i.actualBoundingBoxLeft,l=t+i.actualBoundingBoxRight,s=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=a.strikethrough?(s+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=a.decorationWidth||2,e.moveTo(o,u),e.lineTo(l,u),e.stroke()}}function uf(e,t){var n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function ff(e,t,n,r,a){var i,o,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=Ac(t)?t:[t],c=l.strokeWidth>0&&""!==l.strokeColor;for(e.save(),e.font=a.string,sf(e,l),i=0;i<s.length;++i)o=s[i],l.backdrop&&uf(e,l.backdrop),c&&(l.strokeColor&&(e.strokeStyle=l.strokeColor),Ec(l.strokeWidth)||(e.lineWidth=l.strokeWidth),e.strokeText(o,n,r,l.maxWidth)),e.fillText(o,n,r,l.maxWidth),cf(e,n,r,o,l),r+=Number(a.lineHeight);e.restore()}function df(e,t){var n=t.x,r=t.y,a=t.w,i=t.h,o=t.radius;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*Zc,Zc,!0),e.lineTo(n,r+i-o.bottomLeft),e.arc(n+o.bottomLeft,r+i-o.bottomLeft,o.bottomLeft,Zc,eu,!0),e.lineTo(n+a-o.bottomRight,r+i),e.arc(n+a-o.bottomRight,r+i-o.bottomRight,o.bottomRight,eu,0,!0),e.lineTo(n+a,r+o.topRight),e.arc(n+a-o.topRight,r+o.topRight,o.topRight,0,-eu,!0),e.lineTo(n+o.topLeft,r)}var hf=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,pf=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function vf(e,t){var n=(""+e).match(hf);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e}function mf(e,t){var n,r={},a=Cc(t),i=a?Object.keys(t):t,o=Cc(e)?a?function(n){return Mc(e[n],e[t[n]])}:function(t){return e[t]}:function(){return e},l=_c(i);try{for(l.s();!(n=l.n()).done;){var s=n.value;r[s]=+o(s)||0}}catch(e){l.e(e)}finally{l.f()}return r}function yf(e){return mf(e,{top:"y",right:"x",bottom:"y",left:"x"})}function gf(e){return mf(e,["topLeft","topRight","bottomLeft","bottomRight"])}function bf(e){var t=yf(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function xf(e,t){e=e||{},t=t||Zu.font;var n=Mc(e.size,t.size);"string"==typeof n&&(n=parseInt(n,10));var r=Mc(e.style,t.style);r&&!(""+r).match(pf)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);var a={family:Mc(e.family,t.family),lineHeight:vf(Mc(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Mc(e.weight,t.weight),string:""};return a.string=function(e){return!e||Ec(e.size)||Ec(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(a),a}function _f(e,t,n,r){var a,i,o,l=!0;for(a=0,i=e.length;a<i;++a)if(void 0!==(o=e[a])&&(void 0!==t&&"function"==typeof o&&(o=o(t),l=!1),void 0!==n&&Ac(o)&&(o=o[n%o.length],l=!1),void 0!==o))return r&&!l&&(r.cacheable=!1),o}function wf(e,t){return Object.assign(Object.create(e),t)}function kf(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[""],r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return e[0]},o=r||e;void 0===a&&(a=Lf("_fallback",e));var l=(gc(t={},Symbol.toStringTag,"Object"),gc(t,"_cacheable",!0),gc(t,"_scopes",e),gc(t,"_rootScopes",o),gc(t,"_fallback",a),gc(t,"_getTarget",i),gc(t,"override",(function(t){return kf([t].concat(yc(e)),n,o,a)})),t);return new Proxy(l,{deleteProperty:function(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get:function(t,r){return Af(t,r,(function(){return If(r,n,e,t)}))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf:function(){return Reflect.getPrototypeOf(e[0])},has:function(e,t){return Nf(e).includes(t)},ownKeys:function(e){return Nf(e)},set:function(e,t,n){var r=e._storage||(e._storage=i());return e[t]=r[t]=n,delete e._keys,!0}})}function Sf(e,t,n,r){var a={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Of(e,r),setContext:function(t){return Sf(e,t,n,r)},override:function(a){return Sf(e.override(a),t,n,r)}};return new Proxy(a,{deleteProperty:function(t,n){return delete t[n],delete e[n],!0},get:function(e,t,n){return Af(e,t,(function(){return function(e,t,n){var r=e._proxy,a=e._context,i=e._subProxy,o=e._descriptors,l=r[t];return Gc(l)&&o.isScriptable(t)&&(l=function(e,t,n,r){var a=n._proxy,i=n._context,o=n._subProxy,l=n._stack;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);var s=t(i,o||r);return l.delete(e),Ef(e,s)&&(s=Mf(a._scopes,a,e,s)),s}(t,l,e,n)),Ac(l)&&l.length&&(l=function(e,t,n,r){var a=n._proxy,i=n._context,o=n._subProxy,l=n._descriptors;if(void 0!==i.index&&r(e))return t[i.index%t.length];if(Cc(t[0])){var s=t,c=a._scopes.filter((function(e){return e!==s}));t=[];var u,f=_c(s);try{for(f.s();!(u=f.n()).done;){var d=Mf(c,a,e,u.value);t.push(Sf(d,i,o&&o[e],l))}}catch(e){f.e(e)}finally{f.f()}}return t}(t,l,e,o.isIndexable)),Ef(t,l)&&(l=Sf(l,a,i&&i[t],o)),l}(e,t,n)}))},getOwnPropertyDescriptor:function(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf:function(){return Reflect.getPrototypeOf(e)},has:function(t,n){return Reflect.has(e,n)},ownKeys:function(){return Reflect.ownKeys(e)},set:function(t,n,r){return e[n]=r,delete t[n],!0}})}function Of(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scriptable:!0,indexable:!0},n=e._scriptable,r=void 0===n?t.scriptable:n,a=e._indexable,i=void 0===a?t.indexable:a,o=e._allKeys,l=void 0===o?t.allKeys:o;return{allKeys:l,scriptable:r,indexable:i,isScriptable:Gc(r)?r:function(){return r},isIndexable:Gc(i)?i:function(){return i}}}var jf=function(e,t){return e?e+Yc(t):t},Ef=function(e,t){return Cc(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object)};function Af(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];var r=n();return e[t]=r,r}function Cf(e,t,n){return Gc(e)?e(t,n):e}var Df=function(e,t){return!0===e?t:"string"==typeof e?Bc(t,e):void 0};function Pf(e,t,n,r,a){var i,o=_c(t);try{for(o.s();!(i=o.n()).done;){var l=i.value,s=Df(n,l);if(s){e.add(s);var c=Cf(s._fallback,n,a);if(void 0!==c&&c!==n&&c!==r)return c}else if(!1===s&&void 0!==r&&n!==r)return null}}catch(e){o.e(e)}finally{o.f()}return!1}function Mf(e,t,n,r){var a=t._rootScopes,i=Cf(t._fallback,n,r),o=[].concat(yc(e),yc(a)),l=new Set;l.add(r);var s=Rf(l,o,n,i||n,r);return null!==s&&(void 0===i||i===n||null!==(s=Rf(l,o,i,s,r)))&&kf(Array.from(l),[""],a,i,(function(){return function(e,t,n){var r=e._getTarget();t in r||(r[t]={});var a=r[t];return Ac(a)&&Cc(n)?n:a||{}}(t,n,r)}))}function Rf(e,t,n,r,a){for(;n;)n=Pf(e,t,n,r,a);return n}function If(e,t,n,r){var a,i,o=_c(t);try{for(o.s();!(i=o.n()).done;){var l=i.value;if(void 0!==(a=Lf(jf(l,e),n)))return Ef(e,a)?Mf(n,r,e,a):a}}catch(e){o.e(e)}finally{o.f()}}function Lf(e,t){var n,r=_c(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a){var i=a[e];if(void 0!==i)return i}}}catch(e){r.e(e)}finally{r.f()}}function Nf(e){var t=e._keys;return t||(t=e._keys=function(e){var t,n=new Set,r=_c(e);try{for(r.s();!(t=r.n()).done;){var a,i=t.value,o=_c(Object.keys(i).filter((function(e){return!e.startsWith("_")})));try{for(o.s();!(a=o.n()).done;){var l=a.value;n.add(l)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){r.e(e)}finally{r.f()}return Array.from(n)}(e._scopes)),t}function Tf(e,t,n,r){var a,i,o,l,s=e.iScale,c=this._parsing.key,u=void 0===c?"r":c,f=new Array(r);for(a=0,i=r;a<i;++a)l=t[o=a+n],f[a]={r:s.parse(Bc(l,u),o)};return f}var Ff=Number.EPSILON||1e-14,zf=function(e,t){return t<e.length&&!e[t].skip&&e[t]},Hf=function(e){return"x"===e?"y":"x"};function Vf(e,t,n,r){var a=e.skip?t:e,i=t,o=n.skip?t:n,l=hu(i,a),s=hu(o,i),c=l/(l+s),u=s/(l+s),f=r*(c=isNaN(c)?0:c),d=r*(u=isNaN(u)?0:u);return{previous:{x:i.x-f*(o.x-a.x),y:i.y-f*(o.y-a.y)},next:{x:i.x+d*(o.x-a.x),y:i.y+d*(o.y-a.y)}}}function Wf(e,t,n){for(var r,a,i,o,l,s=e.length,c=zf(e,0),u=0;u<s-1;++u)l=c,c=zf(e,u+1),l&&c&&(iu(t[u],0,Ff)?n[u]=n[u+1]=0:(r=n[u]/t[u],a=n[u+1]/t[u],(o=Math.pow(r,2)+Math.pow(a,2))<=9||(i=3/Math.sqrt(o),n[u]=r*i*t[u],n[u+1]=a*i*t[u])))}function $f(e,t){for(var n,r,a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x",o=Hf(i),l=e.length,s=zf(e,0),c=0;c<l;++c)if(r=a,a=s,s=zf(e,c+1),a){var u=a[i],f=a[o];r&&(n=(u-r[i])/3,a["cp1".concat(i)]=u-n,a["cp1".concat(o)]=f-n*t[c]),s&&(n=(s[i]-u)/3,a["cp2".concat(i)]=u+n,a["cp2".concat(o)]=f+n*t[c])}}function Bf(e,t,n){return Math.max(Math.min(e,n),t)}function Yf(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Uf(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function Gf(e,t,n){var r;return"string"==typeof e?(r=parseInt(e,10),-1!==e.indexOf("%")&&(r=r/100*t.parentNode[n])):r=e,r}var qf=function(e){return e.ownerDocument.defaultView.getComputedStyle(e,null)},Zf=["top","right","bottom","left"];function Kf(e,t,n){var r={};n=n?"-"+n:"";for(var a=0;a<4;a++){var i=Zf[a];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}function Xf(e,t){if("native"in e)return e;var n=t.canvas,r=t.currentDevicePixelRatio,a=qf(n),i="border-box"===a.boxSizing,o=Kf(a,"padding"),l=Kf(a,"border","width"),s=function(e,t){var n,r,a=e.touches,i=a&&a.length?a[0]:e,o=i.offsetX,l=i.offsetY,s=!1;if(function(e,t,n){return(e>0||t>0)&&(!n||!n.shadowRoot)}(o,l,e.target))n=o,r=l;else{var c=t.getBoundingClientRect();n=i.clientX-c.left,r=i.clientY-c.top,s=!0}return{x:n,y:r,box:s}}(e,n),c=s.x,u=s.y,f=s.box,d=o.left+(f&&l.left),h=o.top+(f&&l.top),p=t.width,v=t.height;return i&&(p-=o.width+l.width,v-=o.height+l.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((u-h)/v*n.height/r)}}var Jf=function(e){return Math.round(10*e)/10};function Qf(e,t,n){var r=t||1,a=Math.floor(e.height*r),i=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);var o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height="".concat(e.height,"px"),o.style.width="".concat(e.width,"px")),(e.currentDevicePixelRatio!==r||o.height!==a||o.width!==i)&&(e.currentDevicePixelRatio=r,o.height=a,o.width=i,e.ctx.setTransform(r,0,0,r,0,0),!0)}var ed=function(){var e=!1;try{var t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function td(e,t){var n=function(e,t){return qf(e).getPropertyValue(t)}(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function nd(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function rd(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:"middle"===r?n<.5?e.y:t.y:"after"===r?n<1?e.y:t.y:n>0?t.y:e.y}}function ad(e,t,n,r){var a={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},o=nd(e,a,n),l=nd(a,i,n),s=nd(i,t,n),c=nd(o,l,n),u=nd(l,s,n);return nd(c,u,n)}function id(e,t,n){return e?function(e,t){return{x:function(n){return e+e+t-n},setWidth:function(e){t=e},textAlign:function(e){return"center"===e?e:"right"===e?"left":"right"},xPlus:function(e,t){return e-t},leftForLtr:function(e,t){return e-t}}}(t,n):{x:function(e){return e},setWidth:function(e){},textAlign:function(e){return e},xPlus:function(e,t){return e+t},leftForLtr:function(e,t){return e}}}function od(e,t){var n,r;"ltr"!==t&&"rtl"!==t||(r=[(n=e.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function ld(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function sd(e){return"angle"===e?{between:mu,compare:pu,normalize:vu}:{between:gu,compare:function(e,t){return e-t},normalize:function(e){return e}}}function cd(e){var t=e.start,n=e.end,r=e.count;return{start:t%r,end:n%r,loop:e.loop&&(n-t+1)%r==0,style:e.style}}function ud(e,t,n){if(!n)return[e];for(var r,a,i,o=n.property,l=n.start,s=n.end,c=t.length,u=sd(o),f=u.compare,d=u.between,h=u.normalize,p=function(e,t,n){var r,a,i=n.property,o=n.start,l=n.end,s=sd(i),c=s.between,u=s.normalize,f=t.length,d=e.start,h=e.end,p=e.loop;if(p){for(d+=f,h+=f,r=0,a=f;r<a&&c(u(t[d%f][i]),o,l);++r)d--,h--;d%=f,h%=f}return h<d&&(h+=f),{start:d,end:h,loop:p,style:e.style}}(e,t,n),v=p.start,m=p.end,y=p.loop,g=p.style,b=[],x=!1,_=null,w=v,k=v;w<=m;++w)(a=t[w%c]).skip||(r=h(a[o]))!==i&&(x=d(r,l,s),null===_&&(x||d(l,i,r)&&0!==f(l,i))&&(_=0===f(r,l)?w:k),null!==_&&(!x||0===f(s,r)||d(s,i,r))&&(b.push(cd({start:_,end:w,loop:y,count:c,style:g})),_=null),k=w,i=r);return null!==_&&b.push(cd({start:_,end:m,loop:y,count:c,style:g})),b}function fd(e,t){for(var n=[],r=e.segments,a=0;a<r.length;a++){var i=ud(r[a],e.points,t);i.length&&n.push.apply(n,yc(i))}return n}function dd(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function hd(e,t){if(!t)return!1;var n=[],r=function(e,t){return Lu(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function pd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pd(Object(n),!0).forEach((function(t){Od(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function md(){return md="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=yd(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},md.apply(this,arguments)}function yd(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=kd(e)););return e}function gd(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bd(e,t)}function bd(e,t){return bd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bd(e,t)}function xd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=kd(e);if(t){var a=kd(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return _d(this,n)}}function _d(e,t){if(t&&("object"===Ed(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wd(e)}function wd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kd(e){return kd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kd(e)}function Sd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||Cd(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Od(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jd(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Cd(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Ed(e){return Ed="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},Ed(e)}function Ad(e){return function(e){if(Array.isArray(e))return Dd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Cd(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cd(e,t){if(e){if("string"==typeof e)return Dd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dd(e,t):void 0}}function Dd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Pd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Md(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rd(e,t,n){return t&&Md(e.prototype,t),n&&Md(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var Id=new(function(){function e(){Pd(this,e),this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}return Rd(e,[{key:"_notify",value:function(e,t,n,r){var a=t.listeners[r],i=t.duration;a.forEach((function(r){return r({chart:e,initial:t.initial,numSteps:i,currentStep:Math.min(n-t.start,i)})}))}},{key:"_refresh",value:function(){var e=this;this._request||(this._running=!0,this._request=Ou.call(window,(function(){e._update(),e._request=null,e._running&&e._refresh()})))}},{key:"_update",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now(),n=0;this._charts.forEach((function(r,a){if(r.running&&r.items.length){for(var i,o=r.items,l=o.length-1,s=!1;l>=0;--l)(i=o[l])._active?(i._total>r.duration&&(r.duration=i._total),i.tick(t),s=!0):(o[l]=o[o.length-1],o.pop());s&&(a.draw(),e._notify(a,r,t,"progress")),o.length||(r.running=!1,e._notify(a,r,t,"complete"),r.initial=!1),n+=o.length}})),this._lastDate=t,0===n&&(this._running=!1)}},{key:"_getAnims",value:function(e){var t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}},{key:"listen",value:function(e,t,n){this._getAnims(e).listeners[t].push(n)}},{key:"add",value:function(e,t){var n;t&&t.length&&(n=this._getAnims(e).items).push.apply(n,Ad(t))}},{key:"has",value:function(e){return this._getAnims(e).items.length>0}},{key:"start",value:function(e){var t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((function(e,t){return Math.max(e,t._duration)}),0),this._refresh())}},{key:"running",value:function(e){if(!this._running)return!1;var t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}},{key:"stop",value:function(e){var t=this._charts.get(e);if(t&&t.items.length){for(var n=t.items,r=n.length-1;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}}},{key:"remove",value:function(e){return this._charts.delete(e)}}]),e}()),Ld="transparent",Nd={boolean:function(e,t,n){return n>.5?t:e},color:function(e,t,n){var r=Nu(e||Ld),a=r.valid&&Nu(t||Ld);return a&&a.valid?a.mix(r,n).hexString():t},number:function(e,t,n){return e+(t-e)*n}},Td=function(){function e(t,n,r,a){Pd(this,e);var i=n[r];a=_f([t.to,a,i,t.from]);var o=_f([t.from,i,a]);this._active=!0,this._fn=t.fn||Nd[t.type||Ed(o)],this._easing=Iu[t.easing]||Iu.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=a,this._promises=void 0}return Rd(e,[{key:"active",value:function(){return this._active}},{key:"update",value:function(e,t,n){if(this._active){this._notify(!1);var r=this._target[this._prop],a=n-this._start,i=this._duration-a;this._start=n,this._duration=Math.floor(Math.max(i,e.duration)),this._total+=a,this._loop=!!e.loop,this._to=_f([e.to,t,r,e.from]),this._from=_f([e.from,r,t])}}},{key:"cancel",value:function(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}},{key:"tick",value:function(e){var t,n=e-this._start,r=this._duration,a=this._prop,i=this._from,o=this._loop,l=this._to;if(this._active=i!==l&&(o||n<r),!this._active)return this._target[a]=l,void this._notify(!0);n<0?this._target[a]=i:(t=n/r%2,t=o&&t>1?2-t:t,t=this._easing(Math.min(1,Math.max(0,t))),this._target[a]=this._fn(i,l,t))}},{key:"wait",value:function(){var e=this._promises||(this._promises=[]);return new Promise((function(t,n){e.push({res:t,rej:n})}))}},{key:"_notify",value:function(e){for(var t=e?"res":"rej",n=this._promises||[],r=0;r<n.length;r++)n[r][t]()}}]),e}(),Fd=function(){function e(t,n){Pd(this,e),this._chart=t,this._properties=new Map,this.configure(n)}return Rd(e,[{key:"configure",value:function(e){if(Cc(e)){var t=Object.keys(Zu.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach((function(r){var a=e[r];if(Cc(a)){var i,o={},l=jd(t);try{for(l.s();!(i=l.n()).done;){var s=i.value;o[s]=a[s]}}catch(e){l.e(e)}finally{l.f()}(Ac(a.properties)&&a.properties||[r]).forEach((function(e){e!==r&&n.has(e)||n.set(e,o)}))}}))}}},{key:"_animateOptions",value:function(e,t){var n=t.options,r=function(e,t){if(t){var n=e.options;if(n)return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n;e.options=t}}(e,n);if(!r)return[];var a=this._createAnimations(r,n);return n.$shared&&function(e,t){for(var n=[],r=Object.keys(t),a=0;a<r.length;a++){var i=e[r[a]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}(e.options.$animations,n).then((function(){e.options=n}),(function(){})),a}},{key:"_createAnimations",value:function(e,t){var n,r=this._properties,a=[],i=e.$animations||(e.$animations={}),o=Object.keys(t),l=Date.now();for(n=o.length-1;n>=0;--n){var s=o[n];if("$"!==s.charAt(0))if("options"!==s){var c=t[s],u=i[s],f=r.get(s);if(u){if(f&&u.active()){u.update(f,c,l);continue}u.cancel()}f&&f.duration?(i[s]=u=new Td(f,e,s,c),a.push(u)):e[s]=c}else a.push.apply(a,Ad(this._animateOptions(e,t)))}return a}},{key:"update",value:function(e,t){if(0!==this._properties.size){var n=this._createAnimations(e,t);return n.length?(Id.add(this._chart,n),!0):void 0}Object.assign(e,t)}}]),e}();function zd(e,t){var n=e&&e.options||{},r=n.reverse,a=void 0===n.min?t:0,i=void 0===n.max?t:0;return{start:r?i:a,end:r?a:i}}function Hd(e,t){var n,r,a=[],i=e._getSortedDatasetMetas(t);for(n=0,r=i.length;n<r;++n)a.push(i[n].index);return a}function Vd(e,t,n){var r,a,i,o,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=e.keys,c="single"===l.mode;if(null!==t){for(r=0,a=s.length;r<a;++r){if((i=+s[r])===n){if(l.all)continue;break}Dc(o=e.values[i])&&(c||0===t||au(t)===au(o))&&(t+=o)}return t}}function Wd(e,t){var n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function $d(e,t,n){var r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Bd(e,t,n,r){var a,i=jd(t.getMatchingVisibleMetas(r).reverse());try{for(i.s();!(a=i.n()).done;){var o=a.value,l=e[o.index];if(n&&l>0||!n&&l<0)return o.index}}catch(e){i.e(e)}finally{i.f()}return null}function Yd(e,t){for(var n,r=e.chart,a=e._cachedMeta,i=r._stacks||(r._stacks={}),o=a.iScale,l=a.vScale,s=a.index,c=o.axis,u=l.axis,f=function(e,t,n){return"".concat(e.id,".").concat(t.id,".").concat(n.stack||n.type)}(o,l,a),d=t.length,h=0;h<d;++h){var p=t[h],v=p[c],m=p[u];(n=(p._stacks||(p._stacks={}))[u]=$d(i,f,v))[s]=m,n._top=Bd(n,l,!0,a.type),n._bottom=Bd(n,l,!1,a.type),(n._visualValues||(n._visualValues={}))[s]=m}}function Ud(e,t){var n=e.scales;return Object.keys(n).filter((function(e){return n[e].axis===t})).shift()}function Gd(e,t){var n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){var a,i=jd(t=t||e._parsed);try{for(i.s();!(a=i.n()).done;){var o=a.value._stacks;if(!o||void 0===o[r]||void 0===o[r][n])return;delete o[r][n],void 0!==o[r]._visualValues&&void 0!==o[r]._visualValues[n]&&delete o[r]._visualValues[n]}}catch(e){i.e(e)}finally{i.f()}}}var qd=function(e){return"reset"===e||"none"===e},Zd=function(e,t){return t?e:Object.assign({},e)},Kd=function(){function e(t,n){Pd(this,e),this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=(this instanceof e?this.constructor:void 0).datasetElementType,this.dataElementType=(this instanceof e?this.constructor:void 0).dataElementType,this.initialize()}return Rd(e,[{key:"initialize",value:function(){var e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Wd(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}},{key:"updateIndex",value:function(e){this.index!==e&&Gd(this._cachedMeta),this.index=e}},{key:"linkScales",value:function(){var e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=function(e,t,n,r){return"x"===e?t:"r"===e?r:n},a=t.xAxisID=Mc(n.xAxisID,Ud(e,"x")),i=t.yAxisID=Mc(n.yAxisID,Ud(e,"y")),o=t.rAxisID=Mc(n.rAxisID,Ud(e,"r")),l=t.indexAxis,s=t.iAxisID=r(l,a,i,o),c=t.vAxisID=r(l,i,a,o);t.xScale=this.getScaleForId(a),t.yScale=this.getScaleForId(i),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(s),t.vScale=this.getScaleForId(c)}},{key:"getDataset",value:function(){return this.chart.data.datasets[this.index]}},{key:"getMeta",value:function(){return this.chart.getDatasetMeta(this.index)}},{key:"getScaleForId",value:function(e){return this.chart.scales[e]}},{key:"_getOtherScale",value:function(e){var t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}},{key:"reset",value:function(){this._update("reset")}},{key:"_destroy",value:function(){var e=this._cachedMeta;this._data&&ku(this._data,this),e._stacked&&Gd(e)}},{key:"_dataCheck",value:function(){var e,t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Cc(n))this._data=function(e){var t,n,r,a=Object.keys(e),i=new Array(a.length);for(t=0,n=a.length;t<n;++t)r=a[t],i[t]={x:r,y:e[r]};return i}(n);else if(r!==n){if(r){ku(r,this);var a=this._cachedMeta;Gd(a),a._parsed=[]}n&&Object.isExtensible(n)&&(this,(e=n)._chartjs?e._chartjs.listeners.push(this):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),wu.forEach((function(t){var n="_onData"+Yc(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){for(var t=arguments.length,a=new Array(t),i=0;i<t;i++)a[i]=arguments[i];var o=r.apply(this,a);return e._chartjs.listeners.forEach((function(e){"function"==typeof e[n]&&e[n].apply(e,a)})),o}})})))),this._syncList=[],this._data=n}}},{key:"addElements",value:function(){var e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}},{key:"buildOrUpdateElements",value:function(e){var t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();var a=t._stacked;t._stacked=Wd(t.vScale,t),t.stack!==n.stack&&(r=!0,Gd(t),t.stack=n.stack),this._resyncElements(e),(r||a!==t._stacked)&&Yd(this,t._parsed)}},{key:"configure",value:function(){var e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}},{key:"parse",value:function(e,t){var n,r,a,i=this._cachedMeta,o=this._data,l=i.iScale,s=i._stacked,c=l.axis,u=0===e&&t===o.length||i._sorted,f=e>0&&i._parsed[e-1];if(!1===this._parsing)i._parsed=o,i._sorted=!0,a=o;else{for(a=Ac(o[e])?this.parseArrayData(i,o,e,t):Cc(o[e])?this.parseObjectData(i,o,e,t):this.parsePrimitiveData(i,o,e,t),n=0;n<t;++n)i._parsed[n+e]=r=a[n],u&&((null===r[c]||f&&r[c]<f[c])&&(u=!1),f=r);i._sorted=u}s&&Yd(this,a)}},{key:"parsePrimitiveData",value:function(e,t,n,r){var a,i,o,l=e.iScale,s=e.vScale,c=l.axis,u=s.axis,f=l.getLabels(),d=l===s,h=new Array(r);for(a=0,i=r;a<i;++a){var p;o=a+n,h[a]=(Od(p={},c,d||l.parse(f[o],o)),Od(p,u,s.parse(t[o],o)),p)}return h}},{key:"parseArrayData",value:function(e,t,n,r){var a,i,o,l,s=e.xScale,c=e.yScale,u=new Array(r);for(a=0,i=r;a<i;++a)l=t[o=a+n],u[a]={x:s.parse(l[0],o),y:c.parse(l[1],o)};return u}},{key:"parseObjectData",value:function(e,t,n,r){var a,i,o,l,s=e.xScale,c=e.yScale,u=this._parsing,f=u.xAxisKey,d=void 0===f?"x":f,h=u.yAxisKey,p=void 0===h?"y":h,v=new Array(r);for(a=0,i=r;a<i;++a)l=t[o=a+n],v[a]={x:s.parse(Bc(l,d),o),y:c.parse(Bc(l,p),o)};return v}},{key:"getParsed",value:function(e){return this._cachedMeta._parsed[e]}},{key:"getDataElement",value:function(e){return this._cachedMeta.data[e]}},{key:"applyStack",value:function(e,t,n){var r=this.chart,a=this._cachedMeta,i=t[e.axis];return Vd({keys:Hd(r,!0),values:t._stacks[e.axis]._visualValues},i,a.index,{mode:n})}},{key:"updateRangeFromParsed",value:function(e,t,n,r){var a=n[t.axis],i=null===a?NaN:a,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,i=Vd(r,a,this._cachedMeta.index)),e.min=Math.min(e.min,i),e.max=Math.max(e.max,i)}},{key:"getMinMax",value:function(e,t){var n,r,a=this._cachedMeta,i=a._parsed,o=a._sorted&&e===a.iScale,l=i.length,s=this._getOtherScale(e),c=function(e,t,n){return e&&!t.hidden&&t._stacked&&{keys:Hd(n,!0),values:null}}(t,a,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},f=function(e){var t=e.getUserBounds(),n=t.min,r=t.max,a=t.minDefined,i=t.maxDefined;return{min:a?n:Number.NEGATIVE_INFINITY,max:i?r:Number.POSITIVE_INFINITY}}(s),d=f.min,h=f.max;function p(){var t=(r=i[n])[s.axis];return!Dc(r[e.axis])||d>t||h<t}for(n=0;n<l&&(p()||(this.updateRangeFromParsed(u,e,r,c),!o));++n);if(o)for(n=l-1;n>=0;--n)if(!p()){this.updateRangeFromParsed(u,e,r,c);break}return u}},{key:"getAllParsedValues",value:function(e){var t,n,r,a=this._cachedMeta._parsed,i=[];for(t=0,n=a.length;t<n;++t)Dc(r=a[t][e.axis])&&i.push(r);return i}},{key:"getMaxOverflow",value:function(){return!1}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=t.iScale,r=t.vScale,a=this.getParsed(e);return{label:n?""+n.getLabelForValue(a[n.axis]):"",value:r?""+r.getLabelForValue(a[r.axis]):""}}},{key:"_update",value:function(e){var t,n,r,a,i,o=this._cachedMeta;this.update(e||"default"),o._clip=(Cc(t=Mc(this.options.clip,function(e,t,n){if(!1===n)return!1;var r=zd(e,n),a=zd(t,n);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}(o.xScale,o.yScale,this.getMaxOverflow())))?(n=t.top,r=t.right,a=t.bottom,i=t.left):n=r=a=i=t,{top:n,right:r,bottom:a,left:i,disabled:!1===t})}},{key:"update",value:function(e){}},{key:"draw",value:function(){var e,t=this._ctx,n=this.chart,r=this._cachedMeta,a=r.data||[],i=n.chartArea,o=[],l=this._drawStart||0,s=this._drawCount||a.length-l,c=this.options.drawActiveElementsOnTop;for(r.dataset&&r.dataset.draw(t,i,l,s),e=l;e<l+s;++e){var u=a[e];u.hidden||(u.active&&c?o.push(u):u.draw(t,i))}for(e=0;e<o.length;++e)o[e].draw(t,i)}},{key:"getStyle",value:function(e,t){var n=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}},{key:"getContext",value:function(e,t,n){var r,a=this.getDataset();if(e>=0&&e<this._cachedMeta.data.length){var i=this._cachedMeta.data[e];r=i.$context||(i.$context=function(e,t,n){return wf(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}(this.getContext(),e,i)),r.parsed=this.getParsed(e),r.raw=a.data[e],r.index=r.dataIndex=e}else r=this.$context||(this.$context=function(e,t){return wf(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),r.dataset=a,r.index=r.datasetIndex=this.index;return r.active=!!t,r.mode=n,r}},{key:"resolveDatasetElementOptions",value:function(e){return this._resolveElementOptions(this.datasetElementType.id,e)}},{key:"resolveDataElementOptions",value:function(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}},{key:"_resolveElementOptions",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",r=arguments.length>2?arguments[2]:void 0,a="active"===n,i=this._cachedDataOpts,o=e+"-"+n,l=i[o],s=this.enableOptionSharing&&Uc(r);if(l)return Zd(l,s);var c=this.chart.config,u=c.datasetElementScopeKeys(this._type,e),f=a?["".concat(e,"Hover"),"hover",e,""]:[e,""],d=c.getOptionScopes(this.getDataset(),u),h=Object.keys(Zu.elements[e]),p=function(){return t.getContext(r,a,n)},v=c.resolveNamedOptions(d,h,p,f);return v.$shared&&(v.$shared=s,i[o]=Object.freeze(Zd(v,s))),v}},{key:"_resolveAnimations",value:function(e,t,n){var r,a=this.chart,i=this._cachedDataOpts,o="animation-".concat(t),l=i[o];if(l)return l;if(!1!==a.options.animation){var s=this.chart.config,c=s.datasetAnimationScopeKeys(this._type,t),u=s.getOptionScopes(this.getDataset(),c);r=s.createResolver(u,this.getContext(e,n,t))}var f=new Fd(a,r&&r.animations);return r&&r._cacheable&&(i[o]=Object.freeze(f)),f}},{key:"getSharedOptions",value:function(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}},{key:"includeOptions",value:function(e,t){return!t||qd(e)||this.chart._animationsDisabled}},{key:"_getSharedOptions",value:function(e,t){var n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,a=this.getSharedOptions(n),i=this.includeOptions(t,a)||a!==r;return this.updateSharedOptions(a,t,n),{sharedOptions:a,includeOptions:i}}},{key:"updateElement",value:function(e,t,n,r){qd(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}},{key:"updateSharedOptions",value:function(e,t,n){e&&!qd(t)&&this._resolveAnimations(void 0,t).update(e,n)}},{key:"_setStyle",value:function(e,t,n,r){e.active=r;var a=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(a)||a})}},{key:"removeHoverStyle",value:function(e,t,n){this._setStyle(e,n,"active",!1)}},{key:"setHoverStyle",value:function(e,t,n){this._setStyle(e,n,"active",!0)}},{key:"_removeDatasetHoverStyle",value:function(){var e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}},{key:"_setDatasetHoverStyle",value:function(){var e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}},{key:"_resyncElements",value:function(e){var t,n=this._data,r=this._cachedMeta.data,a=jd(this._syncList);try{for(a.s();!(t=a.n()).done;){var i=Sd(t.value,3),o=i[0],l=i[1],s=i[2];this[o](l,s)}}catch(e){a.e(e)}finally{a.f()}this._syncList=[];var c=r.length,u=n.length,f=Math.min(u,c);f&&this.parse(0,f),u>c?this._insertElements(c,u-c,e):u<c&&this._removeElements(u,c-u)}},{key:"_insertElements",value:function(e,t){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this._cachedMeta,i=a.data,o=e+t,l=function(e){for(e.length+=t,n=e.length-1;n>=o;n--)e[n]=e[n-t]};for(l(i),n=e;n<o;++n)i[n]=new this.dataElementType;this._parsing&&l(a._parsed),this.parse(e,t),r&&this.updateElements(i,e,t,"reset")}},{key:"updateElements",value:function(e,t,n,r){}},{key:"_removeElements",value:function(e,t){var n=this._cachedMeta;if(this._parsing){var r=n._parsed.splice(e,t);n._stacked&&Gd(n,r)}n.data.splice(e,t)}},{key:"_sync",value:function(e){if(this._parsing)this._syncList.push(e);else{var t=Sd(e,3),n=t[0],r=t[1],a=t[2];this[n](r,a)}this.chart._dataChanges.push([this.index].concat(Ad(e)))}},{key:"_onDataPush",value:function(){var e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}},{key:"_onDataPop",value:function(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}},{key:"_onDataShift",value:function(){this._sync(["_removeElements",0,1])}},{key:"_onDataSplice",value:function(e,t){t&&this._sync(["_removeElements",e,t]);var n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}},{key:"_onDataUnshift",value:function(){this._sync(["_insertElements",0,arguments.length])}}]),e}();function Xd(e){var t,n,r,a,i=e.iScale,o=function(e,t){if(!e._cache.$bar){for(var n=e.getMatchingVisibleMetas(t),r=[],a=0,i=n.length;a<i;a++)r=r.concat(n[a].controller.getAllParsedValues(e));e._cache.$bar=Su(r.sort((function(e,t){return e-t})))}return e._cache.$bar}(i,e.type),l=i._length,s=function(){32767!==r&&-32768!==r&&(Uc(a)&&(l=Math.min(l,Math.abs(r-a)||l)),a=r)};for(t=0,n=o.length;t<n;++t)r=i.getPixelForValue(o[t]),s();for(a=void 0,t=0,n=i.ticks.length;t<n;++t)r=i.getPixelForTick(t),s();return l}function Jd(e,t,n,r){return Ac(e)?function(e,t,n,r){var a=n.parse(e[0],r),i=n.parse(e[1],r),o=Math.min(a,i),l=Math.max(a,i),s=o,c=l;Math.abs(o)>Math.abs(l)&&(s=l,c=o),t[n.axis]=c,t._custom={barStart:s,barEnd:c,start:a,end:i,min:o,max:l}}(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Qd(e,t,n,r){var a,i,o,l,s=e.iScale,c=e.vScale,u=s.getLabels(),f=s===c,d=[];for(a=n,i=n+r;a<i;++a)l=t[a],(o={})[s.axis]=f||s.parse(u[a],a),d.push(Jd(l,o,c,a));return d}function eh(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function th(e,t,n,r){var a=t.borderSkipped,i={};if(a)if(!0!==a){var o=function(e){var t,n,r,a,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(a="end",i="start"):(a="start",i="end"),{start:n,end:r,reverse:t,top:a,bottom:i}}(e),l=o.start,s=o.end,c=o.reverse,u=o.top,f=o.bottom;"middle"===a&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?a=u:(n._bottom||0)===r?a=f:(i[nh(f,l,s,c)]=!0,a=u)),i[nh(a,l,s,c)]=!0,e.borderSkipped=i}else e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};else e.borderSkipped=i}function nh(e,t,n,r){var a,i,o;return r?(o=n,e=rh(e=(a=e)===(i=t)?o:a===o?i:a,n,t)):e=rh(e,t,n),e}function rh(e,t,n){return"start"===e?t:"end"===e?n:e}function ah(e,t,n){var r=t.inflateAmount;e.inflateAmount="auto"===r?1===n?.33:0:r}Od(Kd,"defaults",{}),Od(Kd,"datasetElementType",null),Od(Kd,"dataElementType",null);var ih=function(e){gd(n,e);var t=xd(n);function n(){return Pd(this,n),t.apply(this,arguments)}return Rd(n,[{key:"parsePrimitiveData",value:function(e,t,n,r){return Qd(e,t,n,r)}},{key:"parseArrayData",value:function(e,t,n,r){return Qd(e,t,n,r)}},{key:"parseObjectData",value:function(e,t,n,r){var a,i,o,l,s=e.iScale,c=e.vScale,u=this._parsing,f=u.xAxisKey,d=void 0===f?"x":f,h=u.yAxisKey,p=void 0===h?"y":h,v="x"===s.axis?d:p,m="x"===c.axis?d:p,y=[];for(a=n,i=n+r;a<i;++a)l=t[a],(o={})[s.axis]=s.parse(Bc(l,v),a),y.push(Jd(Bc(l,m),o,c,a));return y}},{key:"updateRangeFromParsed",value:function(e,t,r,a){md(kd(n.prototype),"updateRangeFromParsed",this).call(this,e,t,r,a);var i=r._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}},{key:"getMaxOverflow",value:function(){return 0}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=t.iScale,r=t.vScale,a=this.getParsed(e),i=a._custom,o=eh(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(a[r.axis]);return{label:""+n.getLabelForValue(a[n.axis]),value:o}}},{key:"initialize",value:function(){this.enableOptionSharing=!0,md(kd(n.prototype),"initialize",this).call(this),this._cachedMeta.stack=this.getDataset().stack}},{key:"update",value:function(e){var t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}},{key:"updateElements",value:function(e,t,n,r){for(var a="reset"===r,i=this.index,o=this._cachedMeta.vScale,l=o.getBasePixel(),s=o.isHorizontal(),c=this._getRuler(),u=this._getSharedOptions(t,r),f=u.sharedOptions,d=u.includeOptions,h=t;h<t+n;h++){var p=this.getParsed(h),v=a||Ec(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),m=this._calculateBarIndexPixels(h,c),y=(p._stacks||{})[o.axis],g={horizontal:s,base:v.base,enableBorderRadius:!y||eh(p._custom)||i===y._top||i===y._bottom,x:s?v.head:m.center,y:s?m.center:v.head,height:s?m.size:Math.abs(v.size),width:s?Math.abs(v.size):m.size};d&&(g.options=f||this.resolveDataElementOptions(h,e[h].active?"active":r));var b=g.options||e[h].options;th(g,b,y,i),ah(g,b,c.ratio),this.updateElement(e[h],h,g,r)}}},{key:"_getStacks",value:function(e,t){var n,r=this._cachedMeta.iScale,a=r.getMatchingVisibleMetas(this._type).filter((function(e){return e.controller.options.grouped})),i=r.options.stacked,o=[],l=function(e){var n=e.controller.getParsed(t),r=n&&n[e.vScale.axis];if(Ec(r)||isNaN(r))return!0},s=jd(a);try{for(s.s();!(n=s.n()).done;){var c=n.value;if((void 0===t||!l(c))&&((!1===i||-1===o.indexOf(c.stack)||void 0===i&&void 0===c.stack)&&o.push(c.stack),c.index===e))break}}catch(e){s.e(e)}finally{s.f()}return o.length||o.push(void 0),o}},{key:"_getStackCount",value:function(e){return this._getStacks(void 0,e).length}},{key:"_getStackIndex",value:function(e,t,n){var r=this._getStacks(e,n),a=void 0!==t?r.indexOf(t):-1;return-1===a?r.length-1:a}},{key:"_getRuler",value:function(){var e,t,n=this.options,r=this._cachedMeta,a=r.iScale,i=[];for(e=0,t=r.data.length;e<t;++e)i.push(a.getPixelForValue(this.getParsed(e)[a.axis],e));var o=n.barThickness;return{min:o||Xd(r),pixels:i,start:a._startPixel,end:a._endPixel,stackCount:this._getStackCount(),scale:a,grouped:n.grouped,ratio:o?1:n.categoryPercentage*n.barPercentage}}},{key:"_calculateBarValuePixels",value:function(e){var t,n,r=this._cachedMeta,a=r.vScale,i=r._stacked,o=r.index,l=this.options,s=l.base,c=l.minBarLength,u=s||0,f=this.getParsed(e),d=f._custom,h=eh(d),p=f[a.axis],v=0,m=i?this.applyStack(a,f,i):p;m!==p&&(v=m-p,m=p),h&&(p=d.barStart,m=d.barEnd-d.barStart,0!==p&&au(p)!==au(d.barEnd)&&(v=0),v+=p);var y=Ec(s)||h?v:s,g=a.getPixelForValue(y);if(n=(t=this.chart.getDataVisibility(e)?a.getPixelForValue(v+m):g)-g,Math.abs(n)<c){n=function(e,t,n){return 0!==e?au(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}(n,a,u)*c,p===u&&(g-=n/2);var b=a.getPixelForDecimal(0),x=a.getPixelForDecimal(1),_=Math.min(b,x),w=Math.max(b,x);t=(g=Math.max(Math.min(g,w),_))+n,i&&!h&&(f._stacks[a.axis]._visualValues[o]=a.getValueForPixel(t)-a.getValueForPixel(g))}if(g===a.getPixelForValue(u)){var k=au(n)*a.getLineWidthForValue(u)/2;g+=k,n-=k}return{size:n,base:g,head:t,center:t+n/2}}},{key:"_calculateBarIndexPixels",value:function(e,t){var n,r,a=t.scale,i=this.options,o=i.skipNull,l=Mc(i.maxBarThickness,1/0);if(t.grouped){var s=o?this._getStackCount(e):t.stackCount,c="flex"===i.barThickness?function(e,t,n,r){var a=t.pixels,i=a[e],o=e>0?a[e-1]:null,l=e<a.length-1?a[e+1]:null,s=n.categoryPercentage;null===o&&(o=i-(null===l?t.end-t.start:l-i)),null===l&&(l=i+i-o);var c=i-(i-Math.min(o,l))/2*s;return{chunk:Math.abs(l-o)/2*s/r,ratio:n.barPercentage,start:c}}(e,t,i,s):function(e,t,n,r){var a,i,o=n.barThickness;return Ec(o)?(a=t.min*n.categoryPercentage,i=n.barPercentage):(a=o*r,i=1),{chunk:a/r,ratio:i,start:t.pixels[e]-a/2}}(e,t,i,s),u=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);n=c.start+c.chunk*u+c.chunk/2,r=Math.min(l,c.chunk*c.ratio)}else n=a.getPixelForValue(this.getParsed(e)[a.axis],e),r=Math.min(l,t.min*t.ratio);return{base:n-r/2,head:n+r/2,center:n,size:r}}},{key:"draw",value:function(){for(var e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length,a=0;a<r;++a)null!==this.getParsed(a)[t.axis]&&n[a].draw(this._ctx)}}]),n}(Kd);Od(ih,"id","bar"),Od(ih,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Od(ih,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});var oh=function(e){gd(n,e);var t=xd(n);function n(){return Pd(this,n),t.apply(this,arguments)}return Rd(n,[{key:"initialize",value:function(){this.enableOptionSharing=!0,md(kd(n.prototype),"initialize",this).call(this)}},{key:"parsePrimitiveData",value:function(e,t,r,a){for(var i=md(kd(n.prototype),"parsePrimitiveData",this).call(this,e,t,r,a),o=0;o<i.length;o++)i[o]._custom=this.resolveDataElementOptions(o+r).radius;return i}},{key:"parseArrayData",value:function(e,t,r,a){for(var i=md(kd(n.prototype),"parseArrayData",this).call(this,e,t,r,a),o=0;o<i.length;o++){var l=t[r+o];i[o]._custom=Mc(l[2],this.resolveDataElementOptions(o+r).radius)}return i}},{key:"parseObjectData",value:function(e,t,r,a){for(var i=md(kd(n.prototype),"parseObjectData",this).call(this,e,t,r,a),o=0;o<i.length;o++){var l=t[r+o];i[o]._custom=Mc(l&&l.r&&+l.r,this.resolveDataElementOptions(o+r).radius)}return i}},{key:"getMaxOverflow",value:function(){for(var e=this._cachedMeta.data,t=0,n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart.data.labels||[],r=t.xScale,a=t.yScale,i=this.getParsed(e),o=r.getLabelForValue(i.x),l=a.getLabelForValue(i.y),s=i._custom;return{label:n[e]||"",value:"("+o+", "+l+(s?", "+s:"")+")"}}},{key:"update",value:function(e){var t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}},{key:"updateElements",value:function(e,t,n,r){for(var a="reset"===r,i=this._cachedMeta,o=i.iScale,l=i.vScale,s=this._getSharedOptions(t,r),c=s.sharedOptions,u=s.includeOptions,f=o.axis,d=l.axis,h=t;h<t+n;h++){var p=e[h],v=!a&&this.getParsed(h),m={},y=m[f]=a?o.getPixelForDecimal(.5):o.getPixelForValue(v[f]),g=m[d]=a?l.getBasePixel():l.getPixelForValue(v[d]);m.skip=isNaN(y)||isNaN(g),u&&(m.options=c||this.resolveDataElementOptions(h,p.active?"active":r),a&&(m.options.radius=0)),this.updateElement(p,h,m,r)}}},{key:"resolveDataElementOptions",value:function(e,t){var r=this.getParsed(e),a=md(kd(n.prototype),"resolveDataElementOptions",this).call(this,e,t);a.$shared&&(a=Object.assign({},a,{$shared:!1}));var i=a.radius;return"active"!==t&&(a.radius=0),a.radius+=Mc(r&&r._custom,i),a}}]),n}(Kd);Od(oh,"id","bubble"),Od(oh,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Od(oh,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});var lh=function(e){gd(n,e);var t=xd(n);function n(e,r){var a;return Pd(this,n),(a=t.call(this,e,r)).enableOptionSharing=!0,a.innerRadius=void 0,a.outerRadius=void 0,a.offsetX=void 0,a.offsetY=void 0,a}return Rd(n,[{key:"linkScales",value:function(){}},{key:"parse",value:function(e,t){var n=this.getDataset().data,r=this._cachedMeta;if(!1===this._parsing)r._parsed=n;else{var a,i,o=function(e){return+n[e]};if(Cc(n[e])){var l=this._parsing.key,s=void 0===l?"value":l;o=function(e){return+Bc(n[e],s)}}for(a=e,i=e+t;a<i;++a)r._parsed[a]=o(a)}}},{key:"_getRotation",value:function(){return cu(this.options.rotation-90)}},{key:"_getCircumference",value:function(){return cu(this.options.circumference)}},{key:"_getRotationExtents",value:function(){for(var e=Kc,t=-Kc,n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){var r=this.chart.getDatasetMeta(n).controller,a=r._getRotation(),i=r._getCircumference();e=Math.min(e,a),t=Math.max(t,a+i)}return{rotation:e,circumference:t-e}}},{key:"update",value:function(e){var t,n,r=this.chart.chartArea,a=this._cachedMeta,i=a.data,o=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-o)/2,0),s=Math.min((n=l,"string"==typeof(t=this.options.cutout)&&t.endsWith("%")?parseFloat(t)/100:+t/n),1),c=this._getRingWeight(this.index),u=this._getRotationExtents(),f=u.circumference,d=function(e,t,n){var r=1,a=1,i=0,o=0;if(t<Kc){var l=e,s=l+t,c=Math.cos(l),u=Math.sin(l),f=Math.cos(s),d=Math.sin(s),h=function(e,t,r){return mu(e,l,s,!0)?1:Math.max(t,t*n,r,r*n)},p=function(e,t,r){return mu(e,l,s,!0)?-1:Math.min(t,t*n,r,r*n)},v=h(0,c,f),m=h(eu,u,d),y=p(Zc,c,f),g=p(Zc+eu,u,d);r=(v-y)/2,a=(m-g)/2,i=-(v+y)/2,o=-(m+g)/2}return{ratioX:r,ratioY:a,offsetX:i,offsetY:o}}(u.rotation,f,s),h=d.ratioX,p=d.ratioY,v=d.offsetX,m=d.offsetY,y=(r.width-o)/h,g=(r.height-o)/p,b=Math.max(Math.min(y,g)/2,0),x=Rc(this.options.radius,b),_=(x-Math.max(x*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=v*x,this.offsetY=m*x,a.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(i,0,i.length,e)}},{key:"_circumference",value:function(e,t){var n=this.options,r=this._cachedMeta,a=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||null===r._parsed[e]||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*a/Kc)}},{key:"updateElements",value:function(e,t,n,r){var a,i="reset"===r,o=this.chart,l=o.chartArea,s=o.options.animation,c=(l.left+l.right)/2,u=(l.top+l.bottom)/2,f=i&&s.animateScale,d=f?0:this.innerRadius,h=f?0:this.outerRadius,p=this._getSharedOptions(t,r),v=p.sharedOptions,m=p.includeOptions,y=this._getRotation();for(a=0;a<t;++a)y+=this._circumference(a,i);for(a=t;a<t+n;++a){var g=this._circumference(a,i),b=e[a],x={x:c+this.offsetX,y:u+this.offsetY,startAngle:y,endAngle:y+g,circumference:g,outerRadius:h,innerRadius:d};m&&(x.options=v||this.resolveDataElementOptions(a,b.active?"active":r)),y+=g,this.updateElement(b,a,x,r)}}},{key:"calculateTotal",value:function(){var e,t=this._cachedMeta,n=t.data,r=0;for(e=0;e<n.length;e++){var a=t._parsed[e];null===a||isNaN(a)||!this.chart.getDataVisibility(e)||n[e].hidden||(r+=Math.abs(a))}return r}},{key:"calculateCircumference",value:function(e){var t=this._cachedMeta.total;return t>0&&!isNaN(e)?Kc*(Math.abs(e)/t):0}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart,r=n.data.labels||[],a=Vu(t._parsed[e],n.options.locale);return{label:r[e]||"",value:a}}},{key:"getMaxBorderWidth",value:function(e){var t,n,r,a,i,o=0,l=this.chart;if(!e)for(t=0,n=l.data.datasets.length;t<n;++t)if(l.isDatasetVisible(t)){e=(r=l.getDatasetMeta(t)).data,a=r.controller;break}if(!e)return 0;for(t=0,n=e.length;t<n;++t)"inner"!==(i=a.resolveDataElementOptions(t)).borderAlign&&(o=Math.max(o,i.borderWidth||0,i.hoverBorderWidth||0));return o}},{key:"getMaxOffset",value:function(e){for(var t=0,n=0,r=e.length;n<r;++n){var a=this.resolveDataElementOptions(n);t=Math.max(t,a.offset||0,a.hoverOffset||0)}return t}},{key:"_getRingWeightOffset",value:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}},{key:"_getRingWeight",value:function(e){return Math.max(Mc(this.chart.data.datasets[e].weight,1),0)}},{key:"_getVisibleDatasetWeightTotal",value:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}]),n}(Kd);Od(lh,"id","doughnut"),Od(lh,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Od(lh,"descriptors",{_scriptable:function(e){return"spacing"!==e},_indexable:function(e){return"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}}),Od(lh,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels:function(e){var t=e.data;if(t.labels.length&&t.datasets.length){var n=e.legend.options.labels,r=n.pointStyle,a=n.color;return t.labels.map((function(t,n){var i=e.getDatasetMeta(0).controller.getStyle(n);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:a,lineWidth:i.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(n),index:n}}))}return[]}},onClick:function(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}});var sh=function(e){gd(n,e);var t=xd(n);function n(){return Pd(this,n),t.apply(this,arguments)}return Rd(n,[{key:"initialize",value:function(){this.enableOptionSharing=!0,this.supportsDecimation=!0,md(kd(n.prototype),"initialize",this).call(this)}},{key:"update",value:function(e){var t=this._cachedMeta,n=t.dataset,r=t.data,a=void 0===r?[]:r,i=t._dataset,o=this.chart._animationsDisabled,l=Cu(t,a,o),s=l.start,c=l.count;this._drawStart=s,this._drawCount=c,Du(t)&&(s=0,c=a.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=a;var u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:u},e),this.updateElements(a,s,c,e)}},{key:"updateElements",value:function(e,t,n,r){for(var a="reset"===r,i=this._cachedMeta,o=i.iScale,l=i.vScale,s=i._stacked,c=i._dataset,u=this._getSharedOptions(t,r),f=u.sharedOptions,d=u.includeOptions,h=o.axis,p=l.axis,v=this.options,m=v.spanGaps,y=v.segment,g=lu(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||"none"===r,x=t+n,_=e.length,w=t>0&&this.getParsed(t-1),k=0;k<_;++k){var S=e[k],O=b?S:{};if(k<t||k>=x)O.skip=!0;else{var j=this.getParsed(k),E=Ec(j[p]),A=O[h]=o.getPixelForValue(j[h],k),C=O[p]=a||E?l.getBasePixel():l.getPixelForValue(s?this.applyStack(l,j,s):j[p],k);O.skip=isNaN(A)||isNaN(C)||E,O.stop=k>0&&Math.abs(j[h]-w[h])>g,y&&(O.parsed=j,O.raw=c.data[k]),d&&(O.options=f||this.resolveDataElementOptions(k,S.active?"active":r)),b||this.updateElement(S,k,O,r),w=j}}}},{key:"getMaxOverflow",value:function(){var e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;var a=r[0].size(this.resolveDataElementOptions(0)),i=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,a,i)/2}},{key:"draw",value:function(){var e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),md(kd(n.prototype),"draw",this).call(this)}}]),n}(Kd);Od(sh,"id","line"),Od(sh,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Od(sh,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});var ch=function(e){gd(n,e);var t=xd(n);function n(e,r){var a;return Pd(this,n),(a=t.call(this,e,r)).innerRadius=void 0,a.outerRadius=void 0,a}return Rd(n,[{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart,r=n.data.labels||[],a=Vu(t._parsed[e].r,n.options.locale);return{label:r[e]||"",value:a}}},{key:"parseObjectData",value:function(e,t,n,r){return Tf.bind(this)(e,t,n,r)}},{key:"update",value:function(e){var t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}},{key:"getMinMax",value:function(){var e=this,t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((function(t,r){var a=e.getParsed(r).r;!isNaN(a)&&e.chart.getDataVisibility(r)&&(a<n.min&&(n.min=a),a>n.max&&(n.max=a))})),n}},{key:"_updateRadius",value:function(){var e=this.chart,t=e.chartArea,n=e.options,r=Math.min(t.right-t.left,t.bottom-t.top),a=Math.max(r/2,0),i=(a-Math.max(n.cutoutPercentage?a/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=a-i*this.index,this.innerRadius=this.outerRadius-i}},{key:"updateElements",value:function(e,t,n,r){var a,i="reset"===r,o=this.chart,l=o.options.animation,s=this._cachedMeta.rScale,c=s.xCenter,u=s.yCenter,f=s.getIndexAngle(0)-.5*Zc,d=f,h=360/this.countVisibleElements();for(a=0;a<t;++a)d+=this._computeAngle(a,r,h);for(a=t;a<t+n;a++){var p=e[a],v=d,m=d+this._computeAngle(a,r,h),y=o.getDataVisibility(a)?s.getDistanceFromCenterForValue(this.getParsed(a).r):0;d=m,i&&(l.animateScale&&(y=0),l.animateRotate&&(v=m=f));var g={x:c,y:u,innerRadius:0,outerRadius:y,startAngle:v,endAngle:m,options:this.resolveDataElementOptions(a,p.active?"active":r)};this.updateElement(p,a,g,r)}}},{key:"countVisibleElements",value:function(){var e=this,t=this._cachedMeta,n=0;return t.data.forEach((function(t,r){!isNaN(e.getParsed(r).r)&&e.chart.getDataVisibility(r)&&n++})),n}},{key:"_computeAngle",value:function(e,t,n){return this.chart.getDataVisibility(e)?cu(this.resolveDataElementOptions(e,t).angle||n):0}}]),n}(Kd);Od(ch,"id","polarArea"),Od(ch,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Od(ch,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels:function(e){var t=e.data;if(t.labels.length&&t.datasets.length){var n=e.legend.options.labels,r=n.pointStyle,a=n.color;return t.labels.map((function(t,n){var i=e.getDatasetMeta(0).controller.getStyle(n);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:a,lineWidth:i.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(n),index:n}}))}return[]}},onClick:function(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});var uh=function(e){gd(n,e);var t=xd(n);function n(){return Pd(this,n),t.apply(this,arguments)}return Rd(n)}(lh);Od(uh,"id","pie"),Od(uh,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});var fh=function(e){gd(n,e);var t=xd(n);function n(){return Pd(this,n),t.apply(this,arguments)}return Rd(n,[{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(n[t.axis])}}},{key:"parseObjectData",value:function(e,t,n,r){return Tf.bind(this)(e,t,n,r)}},{key:"update",value:function(e){var t=this._cachedMeta,n=t.dataset,r=t.data||[],a=t.iScale.getLabels();if(n.points=r,"resize"!==e){var i=this.resolveDatasetElementOptions(e);this.options.showLine||(i.borderWidth=0);var o={_loop:!0,_fullLoop:a.length===r.length,options:i};this.updateElement(n,void 0,o,e)}this.updateElements(r,0,r.length,e)}},{key:"updateElements",value:function(e,t,n,r){for(var a=this._cachedMeta.rScale,i="reset"===r,o=t;o<t+n;o++){var l=e[o],s=this.resolveDataElementOptions(o,l.active?"active":r),c=a.getPointPositionForValue(o,this.getParsed(o).r),u=i?a.xCenter:c.x,f=i?a.yCenter:c.y,d={x:u,y:f,angle:c.angle,skip:isNaN(u)||isNaN(f),options:s};this.updateElement(l,o,d,r)}}}]),n}(Kd);Od(fh,"id","radar"),Od(fh,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Od(fh,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});var dh=function(e){gd(n,e);var t=xd(n);function n(){return Pd(this,n),t.apply(this,arguments)}return Rd(n,[{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart.data.labels||[],r=t.xScale,a=t.yScale,i=this.getParsed(e),o=r.getLabelForValue(i.x),l=a.getLabelForValue(i.y);return{label:n[e]||"",value:"("+o+", "+l+")"}}},{key:"update",value:function(e){var t=this._cachedMeta,n=t.data,r=void 0===n?[]:n,a=this.chart._animationsDisabled,i=Cu(t,r,a),o=i.start,l=i.count;if(this._drawStart=o,this._drawCount=l,Du(t)&&(o=0,l=r.length),this.options.showLine){this.datasetElementType||this.addElements();var s=t.dataset,c=t._dataset;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!c._decimated,s.points=r;var u=this.resolveDatasetElementOptions(e);u.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:u},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(r,o,l,e)}},{key:"addElements",value:function(){var e=this.options.showLine;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),md(kd(n.prototype),"addElements",this).call(this)}},{key:"updateElements",value:function(e,t,n,r){for(var a="reset"===r,i=this._cachedMeta,o=i.iScale,l=i.vScale,s=i._stacked,c=i._dataset,u=this.resolveDataElementOptions(t,r),f=this.getSharedOptions(u),d=this.includeOptions(r,f),h=o.axis,p=l.axis,v=this.options,m=v.spanGaps,y=v.segment,g=lu(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||"none"===r,x=t>0&&this.getParsed(t-1),_=t;_<t+n;++_){var w=e[_],k=this.getParsed(_),S=b?w:{},O=Ec(k[p]),j=S[h]=o.getPixelForValue(k[h],_),E=S[p]=a||O?l.getBasePixel():l.getPixelForValue(s?this.applyStack(l,k,s):k[p],_);S.skip=isNaN(j)||isNaN(E)||O,S.stop=_>0&&Math.abs(k[h]-x[h])>g,y&&(S.parsed=k,S.raw=c.data[_]),d&&(S.options=f||this.resolveDataElementOptions(_,w.active?"active":r)),b||this.updateElement(w,_,S,r),x=k}this.updateSharedOptions(f,r,u)}},{key:"getMaxOverflow",value:function(){var e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){for(var n=0,r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}var a=e.dataset,i=a.options&&a.options.borderWidth||0;if(!t.length)return i;var o=t[0].size(this.resolveDataElementOptions(0)),l=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(i,o,l)/2}}]),n}(Kd);function hh(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Od(dh,"id","scatter"),Od(dh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Od(dh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var ph={_date:function(){function e(t){Pd(this,e),Od(this,"options",void 0),this.options=t||{}}return Rd(e,[{key:"init",value:function(){}},{key:"formats",value:function(){return hh()}},{key:"parse",value:function(){return hh()}},{key:"format",value:function(){return hh()}},{key:"add",value:function(){return hh()}},{key:"diff",value:function(){return hh()}},{key:"startOf",value:function(){return hh()}},{key:"endOf",value:function(){return hh()}}],[{key:"override",value:function(t){Object.assign(e.prototype,t)}}]),e}()};function vh(e,t,n,r){var a=e.controller,i=e.data,o=e._sorted,l=a._cachedMeta.iScale;if(l&&t===l.axis&&"r"!==t&&o&&i.length){var s=l._reversePixels?_u:xu;if(!r)return s(i,t,n);if(a._sharedOptions){var c=i[0],u="function"==typeof c.getRange&&c.getRange(t);if(u){var f=s(i,t,n-u),d=s(i,t,n+u);return{lo:f.lo,hi:d.hi}}}}return{lo:0,hi:i.length-1}}function mh(e,t,n,r,a){for(var i=e.getSortedVisibleDatasetMetas(),o=n[t],l=0,s=i.length;l<s;++l)for(var c=i[l],u=c.index,f=c.data,d=vh(i[l],t,o,a),h=d.lo,p=d.hi,v=h;v<=p;++v){var m=f[v];m.skip||r(m,u,v)}}function yh(e,t,n,r,a){var i=[];return a||e.isPointInArea(t)?(mh(e,n,t,(function(n,o,l){(a||nf(n,e.chartArea,0))&&n.inRange(t.x,t.y,r)&&i.push({element:n,datasetIndex:o,index:l})}),!0),i):i}function gh(e,t,n,r,a,i){return i||e.isPointInArea(t)?"r"!==n||r?function(e,t,n,r,a,i){var o=[],l=function(e){var t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,r){var a=t?Math.abs(e.x-r.x):0,i=n?Math.abs(e.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(i,2))}}(n),s=Number.POSITIVE_INFINITY;return mh(e,n,t,(function(n,c,u){var f=n.inRange(t.x,t.y,a);if(!r||f){var d=n.getCenterPoint(a);if(i||e.isPointInArea(d)||f){var h=l(t,d);h<s?(o=[{element:n,datasetIndex:c,index:u}],s=h):h===s&&o.push({element:n,datasetIndex:c,index:u})}}})),o}(e,t,n,r,a,i):function(e,t,n,r){var a=[];return mh(e,n,t,(function(e,n,i){var o=e.getProps(["startAngle","endAngle"],r),l=o.startAngle,s=o.endAngle;mu(du(e,{x:t.x,y:t.y}).angle,l,s)&&a.push({element:e,datasetIndex:n,index:i})})),a}(e,t,n,a):[]}function bh(e,t,n,r,a){var i=[],o="x"===n?"inXRange":"inYRange",l=!1;return mh(e,n,t,(function(e,r,s){e[o](t[n],a)&&(i.push({element:e,datasetIndex:r,index:s}),l=l||e.inRange(t.x,t.y,a))})),r&&!l?[]:i}var xh={evaluateInteractionItems:mh,modes:{index:function(e,t,n,r){var a=Xf(t,e),i=n.axis||"x",o=n.includeInvisible||!1,l=n.intersect?yh(e,a,i,r,o):gh(e,a,i,!1,r,o),s=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach((function(e){var t=l[0].index,n=e.data[t];n&&!n.skip&&s.push({element:n,datasetIndex:e.index,index:t})})),s):[]},dataset:function(e,t,n,r){var a=Xf(t,e),i=n.axis||"xy",o=n.includeInvisible||!1,l=n.intersect?yh(e,a,i,r,o):gh(e,a,i,!1,r,o);if(l.length>0){var s=l[0].datasetIndex,c=e.getDatasetMeta(s).data;l=[];for(var u=0;u<c.length;++u)l.push({element:c[u],datasetIndex:s,index:u})}return l},point:function(e,t,n,r){return yh(e,Xf(t,e),n.axis||"xy",r,n.includeInvisible||!1)},nearest:function(e,t,n,r){var a=Xf(t,e),i=n.axis||"xy",o=n.includeInvisible||!1;return gh(e,a,i,n.intersect,r,o)},x:function(e,t,n,r){return bh(e,Xf(t,e),"x",n.intersect,r)},y:function(e,t,n,r){return bh(e,Xf(t,e),"y",n.intersect,r)}}},_h=["left","top","right","bottom"];function wh(e,t){return e.filter((function(e){return e.pos===t}))}function kh(e,t){return e.filter((function(e){return-1===_h.indexOf(e.pos)&&e.box.axis===t}))}function Sh(e,t){return e.sort((function(e,n){var r=t?n:e,a=t?e:n;return r.weight===a.weight?r.index-a.index:r.weight-a.weight}))}function Oh(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function jh(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Eh(e,t,n,r){var a=n.pos,i=n.box,o=e.maxPadding;if(!Cc(a)){n.size&&(e[a]-=n.size);var l=r[n.stack]||{size:0,count:1};l.size=Math.max(l.size,n.horizontal?i.height:i.width),n.size=l.size/l.count,e[a]+=n.size}i.getPadding&&jh(o,i.getPadding());var s=Math.max(0,t.outerWidth-Oh(o,e,"left","right")),c=Math.max(0,t.outerHeight-Oh(o,e,"top","bottom")),u=s!==e.w,f=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:u,other:f}:{same:f,other:u}}function Ah(e,t){var n=t.maxPadding;return function(e){var r={left:0,top:0,right:0,bottom:0};return e.forEach((function(e){r[e]=Math.max(t[e],n[e])})),r}(e?["left","right"]:["top","bottom"])}function Ch(e,t,n,r){var a,i,o,l,s,c,u=[];for(a=0,i=e.length,s=0;a<i;++a){(l=(o=e[a]).box).update(o.width||t.w,o.height||t.h,Ah(o.horizontal,t));var f=Eh(t,n,o,r),d=f.same,h=f.other;s|=d&&u.length,c=c||h,l.fullSize||u.push(o)}return s&&Ch(u,t,n,r)||c}function Dh(e,t,n,r,a){e.top=n,e.left=t,e.right=t+r,e.bottom=n+a,e.width=r,e.height=a}function Ph(e,t,n,r){var a,i=n.padding,o=t.x,l=t.y,s=jd(e);try{for(s.s();!(a=s.n()).done;){var c=a.value,u=c.box,f=r[c.stack]||{count:1,placed:0,weight:1},d=c.stackWeight/f.weight||1;if(c.horizontal){var h=t.w*d,p=f.size||u.height;Uc(f.start)&&(l=f.start),u.fullSize?Dh(u,i.left,l,n.outerWidth-i.right-i.left,p):Dh(u,t.left+f.placed,l,h,p),f.start=l,f.placed+=h,l=u.bottom}else{var v=t.h*d,m=f.size||u.width;Uc(f.start)&&(o=f.start),u.fullSize?Dh(u,o,i.top,m,n.outerHeight-i.bottom-i.top):Dh(u,o,t.top+f.placed,m,v),f.start=o,f.placed+=v,o=u.right}}}catch(e){s.e(e)}finally{s.f()}t.x=o,t.y=l}var Mh=function(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw:function(e){t.draw(e)}}]},e.boxes.push(t)},Rh=function(e,t){var n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},Ih=function(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},Lh=function(e,t,n,r){if(e){var a=bf(e.options.layout.padding),i=Math.max(t-a.width,0),o=Math.max(n-a.height,0),l=function(e){var t=function(e){var t,n,r,a,i,o,l=[];for(t=0,n=(e||[]).length;t<n;++t){var s=r=e[t];a=s.position;var c=s.options;i=c.stack;var u=c.stackWeight;o=void 0===u?1:u,l.push({index:t,box:r,pos:a,horizontal:r.isHorizontal(),weight:r.weight,stack:i&&a+i,stackWeight:o})}return l}(e),n=Sh(t.filter((function(e){return e.box.fullSize})),!0),r=Sh(wh(t,"left"),!0),a=Sh(wh(t,"right")),i=Sh(wh(t,"top"),!0),o=Sh(wh(t,"bottom")),l=kh(t,"x"),s=kh(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:a.concat(s).concat(o).concat(l),chartArea:wh(t,"chartArea"),vertical:r.concat(a).concat(s),horizontal:i.concat(o).concat(l)}}(e.boxes),s=l.vertical,c=l.horizontal;Lc(e.boxes,(function(e){"function"==typeof e.beforeLayout&&e.beforeLayout()}));var u=s.reduce((function(e,t){return t.box.options&&!1===t.box.options.display?e:e+1}),0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:a,availableWidth:i,availableHeight:o,vBoxMaxWidth:i/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},a);jh(d,bf(r));var h=Object.assign({maxPadding:d,w:i,h:o,x:a.left,y:a.top},a),p=function(e,t){var n,r,a,i=function(e){var t,n={},r=jd(e);try{for(r.s();!(t=r.n()).done;){var a=t.value,i=a.stack,o=a.pos,l=a.stackWeight;if(i&&_h.includes(o)){var s=n[i]||(n[i]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=l}}}catch(e){r.e(e)}finally{r.f()}return n}(e),o=t.vBoxMaxWidth,l=t.hBoxMaxHeight;for(n=0,r=e.length;n<r;++n){var s=(a=e[n]).box.fullSize,c=i[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*o:s&&t.availableWidth,a.height=l):(a.width=o,a.height=u?u*l:s&&t.availableHeight)}return i}(s.concat(c),f);Ch(l.fullSize,h,f,p),Ch(s,h,f,p),Ch(c,h,f,p)&&Ch(s,h,f,p),function(e){var t=e.maxPadding;function n(n){var r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(h),Ph(l.leftAndTop,h,f,p),h.x+=h.w,h.y+=h.h,Ph(l.rightAndBottom,h,f,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Lc(l.chartArea,(function(t){var n=t.box;Object.assign(n,e.chartArea),n.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})}))}},Nh=function(){function e(){Pd(this,e)}return Rd(e,[{key:"acquireContext",value:function(e,t){}},{key:"releaseContext",value:function(e){return!1}},{key:"addEventListener",value:function(e,t,n){}},{key:"removeEventListener",value:function(e,t,n){}},{key:"getDevicePixelRatio",value:function(){return 1}},{key:"getMaximumSize",value:function(e,t,n,r){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}},{key:"isAttached",value:function(e){return!0}},{key:"updateConfig",value:function(e){}}]),e}(),Th=function(e){gd(n,e);var t=xd(n);function n(){return Pd(this,n),t.apply(this,arguments)}return Rd(n,[{key:"acquireContext",value:function(e){return e&&e.getContext&&e.getContext("2d")||null}},{key:"updateConfig",value:function(e){e.options.animation=!1}}]),n}(Nh),Fh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},zh=function(e){return null===e||""===e},Hh=!!ed&&{passive:!0};function Vh(e,t,n){e.canvas.removeEventListener(t,n,Hh)}function Wh(e,t){var n,r=jd(e);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a===t||a.contains(t))return!0}}catch(e){r.e(e)}finally{r.f()}}function $h(e,t,n){var r=e.canvas,a=new MutationObserver((function(e){var t,a=!1,i=jd(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;a=(a=a||Wh(o.addedNodes,r))&&!Wh(o.removedNodes,r)}}catch(e){i.e(e)}finally{i.f()}a&&n()}));return a.observe(document,{childList:!0,subtree:!0}),a}function Bh(e,t,n){var r=e.canvas,a=new MutationObserver((function(e){var t,a=!1,i=jd(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;a=(a=a||Wh(o.removedNodes,r))&&!Wh(o.addedNodes,r)}}catch(e){i.e(e)}finally{i.f()}a&&n()}));return a.observe(document,{childList:!0,subtree:!0}),a}var Yh=new Map,Uh=0;function Gh(){var e=window.devicePixelRatio;e!==Uh&&(Uh=e,Yh.forEach((function(t,n){n.currentDevicePixelRatio!==e&&t()})))}function qh(e,t,n){var r=e.canvas,a=r&&Uf(r);if(a){var i=ju((function(e,t){var r=a.clientWidth;n(e,t),r<a.clientWidth&&n()}),window),o=new ResizeObserver((function(e){var t=e[0],n=t.contentRect.width,r=t.contentRect.height;0===n&&0===r||i(n,r)}));return o.observe(a),function(e,t){Yh.size||window.addEventListener("resize",Gh),Yh.set(e,t)}(e,i),o}}function Zh(e,t,n){n&&n.disconnect(),"resize"===t&&function(e){Yh.delete(e),Yh.size||window.removeEventListener("resize",Gh)}(e)}function Kh(e,t,n){var r=e.canvas,a=ju((function(t){null!==e.ctx&&n(function(e,t){var n=Fh[e.type]||e.type,r=Xf(e,t),a=r.x,i=r.y;return{type:n,chart:t,native:e,x:void 0!==a?a:null,y:void 0!==i?i:null}}(t,e))}),e);return function(e,t,n){e.addEventListener(t,n,Hh)}(r,t,a),a}var Xh=function(e){gd(n,e);var t=xd(n);function n(){return Pd(this,n),t.apply(this,arguments)}return Rd(n,[{key:"acquireContext",value:function(e,t){var n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(function(e,t){var n=e.style,r=e.getAttribute("height"),a=e.getAttribute("width");if(e.$chartjs={initial:{height:r,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",zh(a)){var i=td(e,"width");void 0!==i&&(e.width=i)}if(zh(r))if(""===e.style.height)e.height=e.width/(t||2);else{var o=td(e,"height");void 0!==o&&(e.height=o)}}(e,t),n):null}},{key:"releaseContext",value:function(e){var t=e.canvas;if(!t.$chartjs)return!1;var n=t.$chartjs.initial;["height","width"].forEach((function(e){var r=n[e];Ec(r)?t.removeAttribute(e):t.setAttribute(e,r)}));var r=n.style||{};return Object.keys(r).forEach((function(e){t.style[e]=r[e]})),t.width=t.width,delete t.$chartjs,!0}},{key:"addEventListener",value:function(e,t,n){this.removeEventListener(e,t);var r=e.$proxies||(e.$proxies={}),a={attach:$h,detach:Bh,resize:qh}[t]||Kh;r[t]=a(e,t,n)}},{key:"removeEventListener",value:function(e,t){var n=e.$proxies||(e.$proxies={}),r=n[t];r&&(({attach:Zh,detach:Zh,resize:Zh}[t]||Vh)(e,t,r),n[t]=void 0)}},{key:"getDevicePixelRatio",value:function(){return window.devicePixelRatio}},{key:"getMaximumSize",value:function(e,t,n,r){return function(e,t,n,r){var a=qf(e),i=Kf(a,"margin"),o=Gf(a.maxWidth,e,"clientWidth")||Jc,l=Gf(a.maxHeight,e,"clientHeight")||Jc,s=function(e,t,n){var r,a;if(void 0===t||void 0===n){var i=Uf(e);if(i){var o=i.getBoundingClientRect(),l=qf(i),s=Kf(l,"border","width"),c=Kf(l,"padding");t=o.width-c.width-s.width,n=o.height-c.height-s.height,r=Gf(l.maxWidth,i,"clientWidth"),a=Gf(l.maxHeight,i,"clientHeight")}else t=e.clientWidth,n=e.clientHeight}return{width:t,height:n,maxWidth:r||Jc,maxHeight:a||Jc}}(e,t,n),c=s.width,u=s.height;if("content-box"===a.boxSizing){var f=Kf(a,"border","width"),d=Kf(a,"padding");c-=d.width+f.width,u-=d.height+f.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=Jf(Math.min(c,o,s.maxWidth)),u=Jf(Math.min(u,l,s.maxHeight)),c&&!u&&(u=Jf(c/2)),(void 0!==t||void 0!==n)&&r&&s.height&&u>s.height&&(u=s.height,c=Jf(Math.floor(u*r))),{width:c,height:u}}(e,t,n,r)}},{key:"isAttached",value:function(e){var t=Uf(e);return!(!t||!t.isConnected)}}]),n}(Nh),Jh=function(){function e(){Pd(this,e),Od(this,"x",void 0),Od(this,"y",void 0),Od(this,"active",!1),Od(this,"options",void 0),Od(this,"$animations",void 0)}return Rd(e,[{key:"tooltipPosition",value:function(e){var t=this.getProps(["x","y"],e);return{x:t.x,y:t.y}}},{key:"hasValue",value:function(){return lu(this.x)&&lu(this.y)}},{key:"getProps",value:function(e,t){var n=this,r=this.$animations;if(!t||!r)return this;var a={};return e.forEach((function(e){a[e]=r[e]&&r[e].active()?r[e]._to:n[e]})),a}}]),e}();function Qh(e,t,n,r,a){var i,o,l,s=Mc(r,0),c=Math.min(Mc(a,e.length),e.length),u=0;for(n=Math.ceil(n),a&&(n=(i=a-r)/Math.floor(i/n)),l=s;l<0;)u++,l=Math.round(s+u*n);for(o=Math.max(s,0);o<c;o++)o===l&&(t.push(e[o]),u++,l=Math.round(s+u*n))}Od(Jh,"defaults",{}),Od(Jh,"defaultRoutes",void 0);var ep=function(e,t,n){return"top"===t||"left"===t?e[t]+n:e[t]-n},tp=function(e,t){return Math.min(t||e,e)};function np(e,t){for(var n=[],r=e.length/t,a=e.length,i=0;i<a;i+=r)n.push(e[Math.floor(i)]);return n}function rp(e,t,n){var r,a=e.ticks.length,i=Math.min(t,a-1),o=e._startPixel,l=e._endPixel,s=1e-6,c=e.getPixelForTick(i);if(!(n&&(r=1===a?Math.max(c-o,l-c):0===t?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,(c+=i<t?r:-r)<o-s||c>l+s)))return c}function ap(e){return e.drawTicks?e.tickLength:0}function ip(e,t){if(!e.display)return 0;var n=xf(e.font,t),r=bf(e.padding);return(Ac(e.text)?e.text.length:1)*n.lineHeight+r.height}function op(e,t,n){var r=Eu(e);return(n&&"right"!==t||!n&&"right"===t)&&(r=function(e){return"left"===e?"right":"right"===e?"left":e}(r)),r}var lp=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this)).id=e.id,r.type=e.type,r.options=void 0,r.ctx=e.ctx,r.chart=e.chart,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.width=void 0,r.height=void 0,r._margins={left:0,right:0,top:0,bottom:0},r.maxWidth=void 0,r.maxHeight=void 0,r.paddingTop=void 0,r.paddingBottom=void 0,r.paddingLeft=void 0,r.paddingRight=void 0,r.axis=void 0,r.labelRotation=void 0,r.min=void 0,r.max=void 0,r._range=void 0,r.ticks=[],r._gridLineItems=null,r._labelItems=null,r._labelSizes=null,r._length=0,r._maxLength=0,r._longestTextCache={},r._startPixel=void 0,r._endPixel=void 0,r._reversePixels=!1,r._userMax=void 0,r._userMin=void 0,r._suggestedMax=void 0,r._suggestedMin=void 0,r._ticksLength=0,r._borderValue=0,r._cache={},r._dataLimitsCached=!1,r.$context=void 0,r}return Rd(n,[{key:"init",value:function(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}},{key:"parse",value:function(e,t){return e}},{key:"getUserBounds",value:function(){var e=this._userMin,t=this._userMax,n=this._suggestedMin,r=this._suggestedMax;return e=Pc(e,Number.POSITIVE_INFINITY),t=Pc(t,Number.NEGATIVE_INFINITY),n=Pc(n,Number.POSITIVE_INFINITY),r=Pc(r,Number.NEGATIVE_INFINITY),{min:Pc(e,n),max:Pc(t,r),minDefined:Dc(e),maxDefined:Dc(t)}}},{key:"getMinMax",value:function(e){var t,n=this.getUserBounds(),r=n.min,a=n.max,i=n.minDefined,o=n.maxDefined;if(i&&o)return{min:r,max:a};for(var l=this.getMatchingVisibleMetas(),s=0,c=l.length;s<c;++s)t=l[s].controller.getMinMax(this,e),i||(r=Math.min(r,t.min)),o||(a=Math.max(a,t.max));return{min:Pc(r=o&&r>a?a:r,Pc(a=i&&r>a?r:a,r)),max:Pc(a,Pc(r,a))}}},{key:"getPadding",value:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}},{key:"getTicks",value:function(){return this.ticks}},{key:"getLabels",value:function(){var e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}},{key:"getLabelItems",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.chart.chartArea,t=this._labelItems||(this._labelItems=this._computeLabelItems(e));return t}},{key:"beforeLayout",value:function(){this._cache={},this._dataLimitsCached=!1}},{key:"beforeUpdate",value:function(){Ic(this.options.beforeUpdate,[this])}},{key:"update",value:function(e,t,n){var r=this.options,a=r.beginAtZero,i=r.grace,o=r.ticks,l=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(e,t,n){var r=e.min,a=e.max,i=Rc(t,(a-r)/2),o=function(e,t){return n&&0===e?0:e+t};return{min:o(r,-Math.abs(i)),max:o(a,i)}}(this,i,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();var s=l<this.ticks.length;this._convertTicksToLabels(s?np(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(e,t){var n=e.options.ticks,r=function(e){var t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),a=e._maxLength/n;return Math.floor(Math.min(r,a))}(e),a=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?function(e){var t,n,r=[];for(t=0,n=e.length;t<n;t++)e[t].major&&r.push(t);return r}(t):[],o=i.length,l=i[0],s=i[o-1],c=[];if(o>a)return function(e,t,n,r){var a,i=0,o=n[0];for(r=Math.ceil(r),a=0;a<e.length;a++)a===o&&(t.push(e[a]),o=n[++i*r])}(t,c,i,o/a),c;var u=function(e,t,n){var r=function(e){var t,n,r=e.length;if(r<2)return!1;for(n=e[0],t=1;t<r;++t)if(e[t]-e[t-1]!==n)return!1;return n}(e),a=t.length/n;if(!r)return Math.max(a,1);for(var i=function(e){var t,n=[],r=Math.sqrt(e);for(t=1;t<r;t++)e%t==0&&(n.push(t),n.push(e/t));return r===(0|r)&&n.push(r),n.sort((function(e,t){return e-t})).pop(),n}(r),o=0,l=i.length-1;o<l;o++){var s=i[o];if(s>a)return s}return Math.max(a,1)}(i,t,a);if(o>0){var f,d,h=o>1?Math.round((s-l)/(o-1)):null;for(Qh(t,c,u,Ec(h)?0:l-h,l),f=0,d=o-1;f<d;f++)Qh(t,c,u,i[f],i[f+1]);return Qh(t,c,u,s,Ec(h)?t.length:s+h),c}return Qh(t,c,u),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}},{key:"configure",value:function(){var e,t,n=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,n=!n),this._startPixel=e,this._endPixel=t,this._reversePixels=n,this._length=t-e,this._alignToPixels=this.options.alignToPixels}},{key:"afterUpdate",value:function(){Ic(this.options.afterUpdate,[this])}},{key:"beforeSetDimensions",value:function(){Ic(this.options.beforeSetDimensions,[this])}},{key:"setDimensions",value:function(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}},{key:"afterSetDimensions",value:function(){Ic(this.options.afterSetDimensions,[this])}},{key:"_callHooks",value:function(e){this.chart.notifyPlugins(e,this.getContext()),Ic(this.options[e],[this])}},{key:"beforeDataLimits",value:function(){this._callHooks("beforeDataLimits")}},{key:"determineDataLimits",value:function(){}},{key:"afterDataLimits",value:function(){this._callHooks("afterDataLimits")}},{key:"beforeBuildTicks",value:function(){this._callHooks("beforeBuildTicks")}},{key:"buildTicks",value:function(){return[]}},{key:"afterBuildTicks",value:function(){this._callHooks("afterBuildTicks")}},{key:"beforeTickToLabelConversion",value:function(){Ic(this.options.beforeTickToLabelConversion,[this])}},{key:"generateTickLabels",value:function(e){var t,n,r,a=this.options.ticks;for(t=0,n=e.length;t<n;t++)(r=e[t]).label=Ic(a.callback,[r.value,t,e],this)}},{key:"afterTickToLabelConversion",value:function(){Ic(this.options.afterTickToLabelConversion,[this])}},{key:"beforeCalculateLabelRotation",value:function(){Ic(this.options.beforeCalculateLabelRotation,[this])}},{key:"calculateLabelRotation",value:function(){var e,t,n,r=this.options,a=r.ticks,i=tp(this.ticks.length,r.ticks.maxTicksLimit),o=a.minRotation||0,l=a.maxRotation,s=o;if(!this._isVisible()||!a.display||o>=l||i<=1||!this.isHorizontal())this.labelRotation=o;else{var c=this._getLabelSizes(),u=c.widest.width,f=c.highest.height,d=yu(this.chart.width-u,0,this.maxWidth);u+6>(e=r.offset?this.maxWidth/i:d/(i-1))&&(e=d/(i-(r.offset?.5:1)),t=this.maxHeight-ap(r.grid)-a.padding-ip(r.title,this.chart.options.font),n=Math.sqrt(u*u+f*f),s=uu(Math.min(Math.asin(yu((c.highest.height+6)/e,-1,1)),Math.asin(yu(t/n,-1,1))-Math.asin(yu(f/n,-1,1)))),s=Math.max(o,Math.min(l,s))),this.labelRotation=s}}},{key:"afterCalculateLabelRotation",value:function(){Ic(this.options.afterCalculateLabelRotation,[this])}},{key:"afterAutoSkip",value:function(){}},{key:"beforeFit",value:function(){Ic(this.options.beforeFit,[this])}},{key:"fit",value:function(){var e={width:0,height:0},t=this.chart,n=this.options,r=n.ticks,a=n.title,i=n.grid,o=this._isVisible(),l=this.isHorizontal();if(o){var s=ip(a,t.options.font);if(l?(e.width=this.maxWidth,e.height=ap(i)+s):(e.height=this.maxHeight,e.width=ap(i)+s),r.display&&this.ticks.length){var c=this._getLabelSizes(),u=c.first,f=c.last,d=c.widest,h=c.highest,p=2*r.padding,v=cu(this.labelRotation),m=Math.cos(v),y=Math.sin(v);if(l){var g=r.mirror?0:y*d.width+m*h.height;e.height=Math.min(this.maxHeight,e.height+g+p)}else{var b=r.mirror?0:m*d.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+b+p)}this._calculatePadding(u,f,y,m)}}this._handleMargins(),l?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}},{key:"_calculatePadding",value:function(e,t,n,r){var a=this.options,i=a.ticks,o=i.align,l=i.padding,s=a.position,c=0!==this.labelRotation,u="top"!==s&&"x"===this.axis;if(this.isHorizontal()){var f=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),h=0,p=0;c?u?(h=r*e.width,p=n*t.height):(h=n*e.height,p=r*t.width):"start"===o?p=t.width:"end"===o?h=e.width:"inner"!==o&&(h=e.width/2,p=t.width/2),this.paddingLeft=Math.max((h-f+l)*this.width/(this.width-f),0),this.paddingRight=Math.max((p-d+l)*this.width/(this.width-d),0)}else{var v=t.height/2,m=e.height/2;"start"===o?(v=0,m=e.height):"end"===o&&(v=t.height,m=0),this.paddingTop=v+l,this.paddingBottom=m+l}}},{key:"_handleMargins",value:function(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}},{key:"afterFit",value:function(){Ic(this.options.afterFit,[this])}},{key:"isHorizontal",value:function(){var e=this.options,t=e.axis,n=e.position;return"top"===n||"bottom"===n||"x"===t}},{key:"isFullSize",value:function(){return this.options.fullSize}},{key:"_convertTicksToLabels",value:function(e){var t,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,n=e.length;t<n;t++)Ec(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}},{key:"_getLabelSizes",value:function(){var e=this._labelSizes;if(!e){var t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=np(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}},{key:"_computeLabelSizes",value:function(e,t,n){var r,a,i,o,l,s,c,u,f,d,h,p=this.ctx,v=this._longestTextCache,m=[],y=[],g=Math.floor(t/tp(t,n)),b=0,x=0;for(r=0;r<t;r+=g){if(o=e[r].label,l=this._resolveTickFontOptions(r),p.font=s=l.string,c=v[s]=v[s]||{data:{},gc:[]},u=l.lineHeight,f=d=0,Ec(o)||Ac(o)){if(Ac(o))for(a=0,i=o.length;a<i;++a)Ec(h=o[a])||Ac(h)||(f=Ku(p,c.data,c.gc,f,h),d+=u)}else f=Ku(p,c.data,c.gc,f,o),d=u;m.push(f),y.push(d),b=Math.max(f,b),x=Math.max(d,x)}!function(e,t){Lc(e,(function(e){var n,r=e.gc,a=r.length/2;if(a>t){for(n=0;n<a;++n)delete e.data[r[n]];r.splice(0,a)}}))}(v,t);var _=m.indexOf(b),w=y.indexOf(x),k=function(e){return{width:m[e]||0,height:y[e]||0}};return{first:k(0),last:k(t-1),widest:k(_),highest:k(w),widths:m,heights:y}}},{key:"getLabelForValue",value:function(e){return e}},{key:"getPixelForValue",value:function(e,t){return NaN}},{key:"getValueForPixel",value:function(e){}},{key:"getPixelForTick",value:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}},{key:"getPixelForDecimal",value:function(e){this._reversePixels&&(e=1-e);var t=this._startPixel+e*this._length;return yu(this._alignToPixels?Ju(this.chart,t,0):t,-32768,32767)}},{key:"getDecimalForPixel",value:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}},{key:"getBasePixel",value:function(){return this.getPixelForValue(this.getBaseValue())}},{key:"getBaseValue",value:function(){var e=this.min,t=this.max;return e<0&&t<0?t:e>0&&t>0?e:0}},{key:"getContext",value:function(e){var t=this.ticks||[];if(e>=0&&e<t.length){var n=t[e];return n.$context||(n.$context=function(e,t,n){return wf(e,{tick:n,index:t,type:"tick"})}(this.getContext(),e,n))}return this.$context||(this.$context=wf(this.chart.getContext(),{scale:this,type:"scale"}))}},{key:"_tickSize",value:function(){var e=this.options.ticks,t=cu(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),a=this._getLabelSizes(),i=e.autoSkipPadding||0,o=a?a.widest.width+i:0,l=a?a.highest.height+i:0;return this.isHorizontal()?l*n>o*r?o/n:l/r:l*r<o*n?l/n:o/r}},{key:"_isVisible",value:function(){var e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}},{key:"_computeGridLineItems",value:function(e){var t,n,r,a,i,o,l,s,c,u,f,d,h=this.axis,p=this.chart,v=this.options,m=v.grid,y=v.position,g=v.border,b=m.offset,x=this.isHorizontal(),_=this.ticks.length+(b?1:0),w=ap(m),k=[],S=g.setContext(this.getContext()),O=S.display?S.width:0,j=O/2,E=function(e){return Ju(p,e,O)};if("top"===y)t=E(this.bottom),o=this.bottom-w,s=t-j,u=E(e.top)+j,d=e.bottom;else if("bottom"===y)t=E(this.top),u=e.top,d=E(e.bottom)-j,o=t+j,s=this.top+w;else if("left"===y)t=E(this.right),i=this.right-w,l=t-j,c=E(e.left)+j,f=e.right;else if("right"===y)t=E(this.left),c=e.left,f=E(e.right)-j,i=t+j,l=this.left+w;else if("x"===h){if("center"===y)t=E((e.top+e.bottom)/2+.5);else if(Cc(y)){var A=Object.keys(y)[0],C=y[A];t=E(this.chart.scales[A].getPixelForValue(C))}u=e.top,d=e.bottom,s=(o=t+j)+w}else if("y"===h){if("center"===y)t=E((e.left+e.right)/2);else if(Cc(y)){var D=Object.keys(y)[0],P=y[D];t=E(this.chart.scales[D].getPixelForValue(P))}l=(i=t-j)-w,c=e.left,f=e.right}var M=Mc(v.ticks.maxTicksLimit,_),R=Math.max(1,Math.ceil(_/M));for(n=0;n<_;n+=R){var I=this.getContext(n),L=m.setContext(I),N=g.setContext(I),T=L.lineWidth,F=L.color,z=N.dash||[],H=N.dashOffset,V=L.tickWidth,W=L.tickColor,$=L.tickBorderDash||[],B=L.tickBorderDashOffset;void 0!==(r=rp(this,n,b))&&(a=Ju(p,r,T),x?i=l=c=f=a:o=s=u=d=a,k.push({tx1:i,ty1:o,tx2:l,ty2:s,x1:c,y1:u,x2:f,y2:d,width:T,color:F,borderDash:z,borderDashOffset:H,tickWidth:V,tickColor:W,tickBorderDash:$,tickBorderDashOffset:B}))}return this._ticksLength=_,this._borderValue=t,k}},{key:"_computeLabelItems",value:function(e){var t,n,r,a,i,o,l,s,c,u,f,d=this.axis,h=this.options,p=h.position,v=h.ticks,m=this.isHorizontal(),y=this.ticks,g=v.align,b=v.crossAlign,x=v.padding,_=v.mirror,w=ap(h.grid),k=w+x,S=_?-x:k,O=-cu(this.labelRotation),j=[],E="middle";if("top"===p)i=this.bottom-S,o=this._getXAxisLabelAlignment();else if("bottom"===p)i=this.top+S,o=this._getXAxisLabelAlignment();else if("left"===p){var A=this._getYAxisLabelAlignment(w);o=A.textAlign,a=A.x}else if("right"===p){var C=this._getYAxisLabelAlignment(w);o=C.textAlign,a=C.x}else if("x"===d){if("center"===p)i=(e.top+e.bottom)/2+k;else if(Cc(p)){var D=Object.keys(p)[0],P=p[D];i=this.chart.scales[D].getPixelForValue(P)+k}o=this._getXAxisLabelAlignment()}else if("y"===d){if("center"===p)a=(e.left+e.right)/2-k;else if(Cc(p)){var M=Object.keys(p)[0],R=p[M];a=this.chart.scales[M].getPixelForValue(R)}o=this._getYAxisLabelAlignment(w).textAlign}"y"===d&&("start"===g?E="top":"end"===g&&(E="bottom"));var I=this._getLabelSizes();for(t=0,n=y.length;t<n;++t){r=y[t].label;var L=v.setContext(this.getContext(t));l=this.getPixelForTick(t)+v.labelOffset,c=(s=this._resolveTickFontOptions(t)).lineHeight;var N=(u=Ac(r)?r.length:1)/2,T=L.color,F=L.textStrokeColor,z=L.textStrokeWidth,H=o;m?(a=l,"inner"===o&&(H=t===n-1?this.options.reverse?"left":"right":0===t?this.options.reverse?"right":"left":"center"),f="top"===p?"near"===b||0!==O?-u*c+c/2:"center"===b?-I.highest.height/2-N*c+c:-I.highest.height+c/2:"near"===b||0!==O?c/2:"center"===b?I.highest.height/2-N*c:I.highest.height-u*c,_&&(f*=-1),0===O||L.showLabelBackdrop||(a+=c/2*Math.sin(O))):(i=l,f=(1-u)*c/2);var V=void 0;if(L.showLabelBackdrop){var W=bf(L.backdropPadding),$=I.heights[t],B=I.widths[t],Y=f-W.top,U=0-W.left;switch(E){case"middle":Y-=$/2;break;case"bottom":Y-=$}switch(o){case"center":U-=B/2;break;case"right":U-=B}V={left:U,top:Y,width:B+W.width,height:$+W.height,color:L.backdropColor}}j.push({label:r,font:s,textOffset:f,options:{rotation:O,color:T,strokeColor:F,strokeWidth:z,textAlign:H,textBaseline:E,translation:[a,i],backdrop:V}})}return j}},{key:"_getXAxisLabelAlignment",value:function(){var e=this.options,t=e.position,n=e.ticks;if(-cu(this.labelRotation))return"top"===t?"left":"right";var r="center";return"start"===n.align?r="left":"end"===n.align?r="right":"inner"===n.align&&(r="inner"),r}},{key:"_getYAxisLabelAlignment",value:function(e){var t,n,r=this.options,a=r.position,i=r.ticks,o=i.crossAlign,l=i.mirror,s=i.padding,c=e+s,u=this._getLabelSizes().widest.width;return"left"===a?l?(n=this.right+s,"near"===o?t="left":"center"===o?(t="center",n+=u/2):(t="right",n+=u)):(n=this.right-c,"near"===o?t="right":"center"===o?(t="center",n-=u/2):(t="left",n=this.left)):"right"===a?l?(n=this.left+s,"near"===o?t="right":"center"===o?(t="center",n-=u/2):(t="left",n-=u)):(n=this.left+c,"near"===o?t="left":"center"===o?(t="center",n+=u/2):(t="right",n=this.right)):t="right",{textAlign:t,x:n}}},{key:"_computeLabelArea",value:function(){if(!this.options.ticks.mirror){var e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}}},{key:"drawBackground",value:function(){var e=this.ctx,t=this.options.backgroundColor,n=this.left,r=this.top,a=this.width,i=this.height;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,a,i),e.restore())}},{key:"getLineWidthForValue",value:function(e){var t=this.options.grid;if(!this._isVisible()||!t.display)return 0;var n=this.ticks.findIndex((function(t){return t.value===e}));return n>=0?t.setContext(this.getContext(n)).lineWidth:0}},{key:"drawGrid",value:function(e){var t,n,r=this.options.grid,a=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e)),o=function(e,t,n){n.width&&n.color&&(a.save(),a.lineWidth=n.width,a.strokeStyle=n.color,a.setLineDash(n.borderDash||[]),a.lineDashOffset=n.borderDashOffset,a.beginPath(),a.moveTo(e.x,e.y),a.lineTo(t.x,t.y),a.stroke(),a.restore())};if(r.display)for(t=0,n=i.length;t<n;++t){var l=i[t];r.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),r.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}},{key:"drawBorder",value:function(){var e=this.chart,t=this.ctx,n=this.options,r=n.border,a=n.grid,i=r.setContext(this.getContext()),o=r.display?i.width:0;if(o){var l,s,c,u,f=a.setContext(this.getContext(0)).lineWidth,d=this._borderValue;this.isHorizontal()?(l=Ju(e,this.left,o)-o/2,s=Ju(e,this.right,f)+f/2,c=u=d):(c=Ju(e,this.top,o)-o/2,u=Ju(e,this.bottom,f)+f/2,l=s=d),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(l,c),t.lineTo(s,u),t.stroke(),t.restore()}}},{key:"drawLabels",value:function(e){if(this.options.ticks.display){var t=this.ctx,n=this._computeLabelArea();n&&rf(t,n);var r,a=jd(this.getLabelItems(e));try{for(a.s();!(r=a.n()).done;){var i=r.value,o=i.options,l=i.font;ff(t,i.label,0,i.textOffset,l,o)}}catch(e){a.e(e)}finally{a.f()}n&&af(t)}}},{key:"drawTitle",value:function(){var e=this.ctx,t=this.options,n=t.position,r=t.title,a=t.reverse;if(r.display){var i=xf(r.font),o=bf(r.padding),l=r.align,s=i.lineHeight/2;"bottom"===n||"center"===n||Cc(n)?(s+=o.bottom,Ac(r.text)&&(s+=i.lineHeight*(r.text.length-1))):s+=o.top;var c=function(e,t,n,r){var a,i,o,l=e.top,s=e.left,c=e.bottom,u=e.right,f=e.chart,d=f.chartArea,h=f.scales,p=0,v=c-l,m=u-s;if(e.isHorizontal()){if(i=Au(r,s,u),Cc(n)){var y=Object.keys(n)[0],g=n[y];o=h[y].getPixelForValue(g)+v-t}else o="center"===n?(d.bottom+d.top)/2+v-t:ep(e,n,t);a=u-s}else{if(Cc(n)){var b=Object.keys(n)[0],x=n[b];i=h[b].getPixelForValue(x)-m+t}else i="center"===n?(d.left+d.right)/2-m+t:ep(e,n,t);o=Au(r,c,l),p="left"===n?-eu:eu}return{titleX:i,titleY:o,maxWidth:a,rotation:p}}(this,s,n,l),u=c.titleX,f=c.titleY,d=c.maxWidth,h=c.rotation;ff(e,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:h,textAlign:op(l,n,a),textBaseline:"middle",translation:[u,f]})}}},{key:"draw",value:function(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}},{key:"_layers",value:function(){var e=this,t=this.options,r=t.ticks&&t.ticks.z||0,a=Mc(t.grid&&t.grid.z,-1),i=Mc(t.border&&t.border.z,0);return this._isVisible()&&this.draw===n.prototype.draw?[{z:a,draw:function(t){e.drawBackground(),e.drawGrid(t),e.drawTitle()}},{z:i,draw:function(){e.drawBorder()}},{z:r,draw:function(t){e.drawLabels(t)}}]:[{z:r,draw:function(t){e.draw(t)}}]}},{key:"getMatchingVisibleMetas",value:function(e){var t,n,r=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",i=[];for(t=0,n=r.length;t<n;++t){var o=r[t];o[a]!==this.id||e&&o.type!==e||i.push(o)}return i}},{key:"_resolveTickFontOptions",value:function(e){return xf(this.options.ticks.setContext(this.getContext(e)).font)}},{key:"_maxDigits",value:function(){var e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}]),n}(Jh),sp=function(){function e(t,n,r){Pd(this,e),this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}return Rd(e,[{key:"isForType",value:function(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}},{key:"register",value:function(e){var t,n=Object.getPrototypeOf(e);(function(e){return"id"in e&&"defaults"in e})(n)&&(t=this.register(n));var r=this.items,a=e.id,i=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+e);return a in r||(r[a]=e,function(e,t,n){var r=Hc(Object.create(null),[n?Zu.get(n):{},Zu.get(t),e.defaults]);Zu.set(t,r),e.defaultRoutes&&function(e,t){Object.keys(t).forEach((function(n){var r=n.split("."),a=r.pop(),i=[e].concat(r).join("."),o=t[n].split("."),l=o.pop(),s=o.join(".");Zu.route(i,a,s,l)}))}(t,e.defaultRoutes),e.descriptors&&Zu.describe(t,e.descriptors)}(e,i,t),this.override&&Zu.override(e.id,e.overrides)),i}},{key:"get",value:function(e){return this.items[e]}},{key:"unregister",value:function(e){var t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in Zu[r]&&(delete Zu[r][n],this.override&&delete Bu[n])}}]),e}(),cp=function(){function e(){Pd(this,e),this.controllers=new sp(Kd,"datasets",!0),this.elements=new sp(Jh,"elements"),this.plugins=new sp(Object,"plugins"),this.scales=new sp(lp,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}return Rd(e,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t)}},{key:"remove",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t)}},{key:"addControllers",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.controllers)}},{key:"addElements",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.elements)}},{key:"addPlugins",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.plugins)}},{key:"addScales",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.scales)}},{key:"getController",value:function(e){return this._get(e,this.controllers,"controller")}},{key:"getElement",value:function(e){return this._get(e,this.elements,"element")}},{key:"getPlugin",value:function(e){return this._get(e,this.plugins,"plugin")}},{key:"getScale",value:function(e){return this._get(e,this.scales,"scale")}},{key:"removeControllers",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.controllers)}},{key:"removeElements",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.elements)}},{key:"removePlugins",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.plugins)}},{key:"removeScales",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.scales)}},{key:"_each",value:function(e,t,n){var r=this;Ad(t).forEach((function(t){var a=n||r._getRegistryForType(t);n||a.isForType(t)||a===r.plugins&&t.id?r._exec(e,a,t):Lc(t,(function(t){var a=n||r._getRegistryForType(t);r._exec(e,a,t)}))}))}},{key:"_exec",value:function(e,t,n){var r=Yc(e);Ic(n["before"+r],[],n),t[e](n),Ic(n["after"+r],[],n)}},{key:"_getRegistryForType",value:function(e){for(var t=0;t<this._typedRegistries.length;t++){var n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}},{key:"_get",value:function(e,t,n){var r=t.get(e);if(void 0===r)throw new Error('"'+e+'" is not a registered '+n+".");return r}}]),e}(),up=new cp,fp=function(){function e(){Pd(this,e),this._init=[]}return Rd(e,[{key:"notify",value:function(e,t,n,r){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));var a=r?this._descriptors(e).filter(r):this._descriptors(e),i=this._notify(a,e,t,n);return"afterDestroy"===t&&(this._notify(a,e,"stop"),this._notify(this._init,e,"uninstall")),i}},{key:"_notify",value:function(e,t,n,r){r=r||{};var a,i=jd(e);try{for(i.s();!(a=i.n()).done;){var o=a.value,l=o.plugin;if(!1===Ic(l[n],[t,r,o.options],l)&&r.cancelable)return!1}}catch(e){i.e(e)}finally{i.f()}return!0}},{key:"invalidate",value:function(){Ec(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}},{key:"_descriptors",value:function(e){if(this._cache)return this._cache;var t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}},{key:"_createDescriptors",value:function(e,t){var n=e&&e.config,r=Mc(n.options&&n.options.plugins,{}),a=function(e){for(var t={},n=[],r=Object.keys(up.plugins.items),a=0;a<r.length;a++)n.push(up.getPlugin(r[a]));for(var i=e.plugins||[],o=0;o<i.length;o++){var l=i[o];-1===n.indexOf(l)&&(n.push(l),t[l.id]=!0)}return{plugins:n,localIds:t}}(n);return!1!==r||t?function(e,t,n,r){var a,i=t.plugins,o=t.localIds,l=[],s=e.getContext(),c=jd(i);try{for(c.s();!(a=c.n()).done;){var u=a.value,f=u.id,d=dp(n[f],r);null!==d&&l.push({plugin:u,options:hp(e.config,{plugin:u,local:o[f]},d,s)})}}catch(e){c.e(e)}finally{c.f()}return l}(e,a,r,t):[]}},{key:"_notifyStateChanges",value:function(e){var t=this._oldCache||[],n=this._cache,r=function(e,t){return e.filter((function(e){return!t.some((function(t){return e.plugin.id===t.plugin.id}))}))};this._notify(r(t,n),e,"stop"),this._notify(r(n,t),e,"start")}}]),e}();function dp(e,t){return t||!1!==e?!0===e?{}:e:null}function hp(e,t,n,r){var a=t.plugin,i=t.local,o=e.pluginScopeKeys(a),l=e.getOptionScopes(n,o);return i&&a.defaults&&l.push(a.defaults),e.createResolver(l,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function pp(e,t){var n=Zu.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function vp(e){if("x"===e||"y"===e||"r"===e)return e}function mp(e){return"top"===e||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0}function yp(e){if(vp(e))return e;for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=0,i=n;a<i.length;a++){var o=i[a],l=o.axis||mp(o.position)||e.length>1&&vp(e[0].toLowerCase());if(l)return l}throw new Error("Cannot determine type of '".concat(e,"' axis. Please provide 'axis' or 'position' option."))}function gp(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function bp(e){var t=e.options||(e.options={});t.plugins=Mc(t.plugins,{}),t.scales=function(e,t){var n=Bu[e.type]||{scales:{}},r=t.scales||{},a=pp(e.type,t),i=Object.create(null);return Object.keys(r).forEach((function(t){var o=r[t];if(!Cc(o))return console.error("Invalid scale configuration for scale: ".concat(t));if(o._proxy)return console.warn("Ignoring resolver passed as options for scale: ".concat(t));var l=yp(t,o,function(e,t){if(t.data&&t.data.datasets){var n=t.data.datasets.filter((function(t){return t.xAxisID===e||t.yAxisID===e}));if(n.length)return gp(e,"x",n[0])||gp(e,"y",n[0])}return{}}(t,e),Zu.scales[o.type]),s=function(e,t){return e===t?"_index_":"_value_"}(l,a),c=n.scales||{};i[t]=Vc(Object.create(null),[{axis:l},o,c[l],c[s]])})),e.data.datasets.forEach((function(n){var a=n.type||e.type,o=n.indexAxis||pp(a,t),l=(Bu[a]||{}).scales||{};Object.keys(l).forEach((function(e){var t=function(e,t){var n=e;return"_index_"===e?n=t:"_value_"===e&&(n="x"===t?"y":"x"),n}(e,o),a=n[t+"AxisID"]||t;i[a]=i[a]||Object.create(null),Vc(i[a],[{axis:t},r[a],l[e]])}))})),Object.keys(i).forEach((function(e){var t=i[e];Vc(t,[Zu.scales[t.type],Zu.scale])})),i}(e,t)}function xp(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}var _p=new Map,kp=new Set;function Sp(e,t){var n=_p.get(e);return n||(n=t(),_p.set(e,n),kp.add(n)),n}var Op=function(e,t,n){var r=Bc(t,n);void 0!==r&&e.add(r)},jp=function(){function e(t){Pd(this,e),this._config=function(e){return(e=e||{}).data=xp(e.data),bp(e),e}(t),this._scopeCache=new Map,this._resolverCache=new Map}return Rd(e,[{key:"platform",get:function(){return this._config.platform}},{key:"type",get:function(){return this._config.type},set:function(e){this._config.type=e}},{key:"data",get:function(){return this._config.data},set:function(e){this._config.data=xp(e)}},{key:"options",get:function(){return this._config.options},set:function(e){this._config.options=e}},{key:"plugins",get:function(){return this._config.plugins}},{key:"update",value:function(){var e=this._config;this.clearCache(),bp(e)}},{key:"clearCache",value:function(){this._scopeCache.clear(),this._resolverCache.clear()}},{key:"datasetScopeKeys",value:function(e){return Sp(e,(function(){return[["datasets.".concat(e),""]]}))}},{key:"datasetAnimationScopeKeys",value:function(e,t){return Sp("".concat(e,".transition.").concat(t),(function(){return[["datasets.".concat(e,".transitions.").concat(t),"transitions.".concat(t)],["datasets.".concat(e),""]]}))}},{key:"datasetElementScopeKeys",value:function(e,t){return Sp("".concat(e,"-").concat(t),(function(){return[["datasets.".concat(e,".elements.").concat(t),"datasets.".concat(e),"elements.".concat(t),""]]}))}},{key:"pluginScopeKeys",value:function(e){var t=e.id,n=this.type;return Sp("".concat(n,"-plugin-").concat(t),(function(){return[["plugins.".concat(t)].concat(Ad(e.additionalOptionScopes||[]))]}))}},{key:"_cachedScopes",value:function(e,t){var n=this._scopeCache,r=n.get(e);return r&&!t||(r=new Map,n.set(e,r)),r}},{key:"getOptionScopes",value:function(e,t,n){var r=this.options,a=this.type,i=this._cachedScopes(e,n),o=i.get(t);if(o)return o;var l=new Set;t.forEach((function(t){e&&(l.add(e),t.forEach((function(t){return Op(l,e,t)}))),t.forEach((function(e){return Op(l,r,e)})),t.forEach((function(e){return Op(l,Bu[a]||{},e)})),t.forEach((function(e){return Op(l,Zu,e)})),t.forEach((function(e){return Op(l,Yu,e)}))}));var s=Array.from(l);return 0===s.length&&s.push(Object.create(null)),kp.has(t)&&i.set(t,s),s}},{key:"chartOptionScopes",value:function(){var e=this.options,t=this.type;return[e,Bu[t]||{},Zu.datasets[t]||{},{type:t},Zu,Yu]}},{key:"resolveNamedOptions",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[""],a={$shared:!0},i=Ep(this._resolverCache,e,r),o=i.resolver,l=i.subPrefixes,s=o;if(Cp(o,t)){a.$shared=!1,n=Gc(n)?n():n;var c=this.createResolver(e,n,l);s=Sf(o,n,c)}var u,f=jd(t);try{for(f.s();!(u=f.n()).done;){var d=u.value;a[d]=s[d]}}catch(e){f.e(e)}finally{f.f()}return a}},{key:"createResolver",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],r=arguments.length>3?arguments[3]:void 0,a=Ep(this._resolverCache,e,n),i=a.resolver;return Cc(t)?Sf(i,t,void 0,r):i}}]),e}();function Ep(e,t,n){var r=e.get(t);r||(r=new Map,e.set(t,r));var a=n.join(),i=r.get(a);return i||(i={resolver:kf(t,n),subPrefixes:n.filter((function(e){return!e.toLowerCase().includes("hover")}))},r.set(a,i)),i}var Ap=function(e){return Cc(e)&&Object.getOwnPropertyNames(e).reduce((function(t,n){return t||Gc(e[n])}),!1)};function Cp(e,t){var n,r=Of(e),a=r.isScriptable,i=r.isIndexable,o=jd(t);try{for(o.s();!(n=o.n()).done;){var l=n.value,s=a(l),c=i(l),u=(c||s)&&e[l];if(s&&(Gc(u)||Ap(u))||c&&Ac(u))return!0}}catch(e){o.e(e)}finally{o.f()}return!1}var Dp=["top","bottom","left","right","chartArea"];function Pp(e,t){return"top"===e||"bottom"===e||-1===Dp.indexOf(e)&&"x"===t}function Mp(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Rp(e){var t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ic(n&&n.onComplete,[e],t)}function Ip(e){var t=e.chart,n=t.options.animation;Ic(n&&n.onProgress,[e],t)}function Lp(e){return Yf()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Np={},Tp=function(e){var t=Lp(e);return Object.values(Np).filter((function(e){return e.canvas===t})).pop()};function Fp(e,t,n){for(var r=0,a=Object.keys(e);r<a.length;r++){var i=a[r],o=+i;if(o>=t){var l=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=l)}}}function zp(e,t,n){return e.options.clip?e[n]:t[n]}var Hp=function(){function e(t,n){var r=this;Pd(this,e);var a=this.config=new jp(n),i=Lp(t),o=Tp(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");var l=a.createResolver(a.chartOptionScopes(),this.getContext());this.platform=new(a.platform||function(e){return!Yf()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?Th:Xh}(i)),this.platform.updateConfig(a);var s,c,u,f=this.platform.acquireContext(i,l.aspectRatio),d=f&&f.canvas,h=d&&d.height,p=d&&d.width;this.id=jc(),this.ctx=f,this.canvas=d,this.width=p,this.height=h,this._options=l,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new fp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(s=function(e){return r.update(e)},c=l.resizeDelay||0,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c?(clearTimeout(u),u=setTimeout(s,c,t)):s.apply(this,t),c}),this._dataChanges=[],Np[this.id]=this,f&&d?(Id.listen(this,"complete",Rp),Id.listen(this,"progress",Ip),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}return Rd(e,[{key:"aspectRatio",get:function(){var e=this.options,t=e.aspectRatio,n=e.maintainAspectRatio,r=this.width,a=this.height,i=this._aspectRatio;return Ec(t)?n&&i?i:a?r/a:null:t}},{key:"data",get:function(){return this.config.data},set:function(e){this.config.data=e}},{key:"options",get:function(){return this._options},set:function(e){this.config.options=e}},{key:"registry",get:function(){return up}},{key:"_initialize",value:function(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}},{key:"clear",value:function(){return Qu(this.canvas,this.ctx),this}},{key:"stop",value:function(){return Id.stop(this),this}},{key:"resize",value:function(e,t){Id.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}},{key:"_resize",value:function(e,t){var n=this.options,r=this.canvas,a=n.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,e,t,a),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Qf(this,o,!0)&&(this.notifyPlugins("resize",{size:i}),Ic(n.onResize,[this,i],this),this.attached&&this._doResize(l)&&this.render())}},{key:"ensureScalesHaveIDs",value:function(){Lc(this.options.scales||{},(function(e,t){e.id=t}))}},{key:"buildOrUpdateScales",value:function(){var e=this,t=this.options,n=t.scales,r=this.scales,a=Object.keys(r).reduce((function(e,t){return e[t]=!1,e}),{}),i=[];n&&(i=i.concat(Object.keys(n).map((function(e){var t=n[e],r=yp(e,t),a="r"===r,i="x"===r;return{options:t,dposition:a?"chartArea":i?"bottom":"left",dtype:a?"radialLinear":i?"category":"linear"}})))),Lc(i,(function(n){var i=n.options,o=i.id,l=yp(o,i),s=Mc(i.type,n.dtype);void 0!==i.position&&Pp(i.position,l)===Pp(n.dposition)||(i.position=n.dposition),a[o]=!0;var c=null;o in r&&r[o].type===s?c=r[o]:(c=new(up.getScale(s))({id:o,type:s,ctx:e.ctx,chart:e}),r[c.id]=c),c.init(i,t)})),Lc(a,(function(e,t){e||delete r[t]})),Lc(r,(function(t){Ih(0,t,t.options),Mh(e,t)}))}},{key:"_updateMetasets",value:function(){var e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((function(e,t){return e.index-t.index})),n>t){for(var r=t;r<n;++r)this._destroyDatasetMeta(r);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(Mp("order","index"))}},{key:"_removeUnreferencedMetasets",value:function(){var e=this,t=this._metasets,n=this.data.datasets;t.length>n.length&&delete this._stacks,t.forEach((function(t,r){0===n.filter((function(e){return e===t._dataset})).length&&e._destroyDatasetMeta(r)}))}},{key:"buildOrUpdateControllers",value:function(){var e,t,n=[],r=this.data.datasets;for(this._removeUnreferencedMetasets(),e=0,t=r.length;e<t;e++){var a=r[e],i=this.getDatasetMeta(e),o=a.type||this.config.type;if(i.type&&i.type!==o&&(this._destroyDatasetMeta(e),i=this.getDatasetMeta(e)),i.type=o,i.indexAxis=a.indexAxis||pp(o,this.options),i.order=a.order||0,i.index=e,i.label=""+a.label,i.visible=this.isDatasetVisible(e),i.controller)i.controller.updateIndex(e),i.controller.linkScales();else{var l=up.getController(o),s=Zu.datasets[o],c=s.datasetElementType,u=s.dataElementType;Object.assign(l,{dataElementType:up.getElement(u),datasetElementType:c&&up.getElement(c)}),i.controller=new l(this,e),n.push(i.controller)}}return this._updateMetasets(),n}},{key:"_resetElements",value:function(){var e=this;Lc(this.data.datasets,(function(t,n){e.getDatasetMeta(n).controller.reset()}),this)}},{key:"reset",value:function(){this._resetElements(),this.notifyPlugins("reset")}},{key:"update",value:function(e){var t=this.config;t.update();var n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1!==this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})){var a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");for(var i=0,o=0,l=this.data.datasets.length;o<l;o++){var s=this.getDatasetMeta(o).controller,c=!r&&-1===a.indexOf(s);s.buildOrUpdateElements(c),i=Math.max(+s.getMaxOverflow(),i)}i=this._minPadding=n.layout.autoPadding?i:0,this._updateLayout(i),r||Lc(a,(function(e){e.reset()})),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Mp("z","_idx"));var u=this._active,f=this._lastEvent;f?this._eventHandler(f,!0):u.length&&this._updateHoverStyles(u,u,!0),this.render()}}},{key:"_updateScales",value:function(){var e=this;Lc(this.scales,(function(t){Rh(e,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}},{key:"_checkEventBindings",value:function(){var e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);qc(t,n)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}},{key:"_updateHiddenIndices",value:function(){var e,t=this._hiddenIndices,n=jd(this._getUniformDataChanges()||[]);try{for(n.s();!(e=n.n()).done;){var r=e.value,a=r.method,i=r.start,o=r.count;Fp(t,i,"_removeElements"===a?-o:o)}}catch(e){n.e(e)}finally{n.f()}}},{key:"_getUniformDataChanges",value:function(){var e=this._dataChanges;if(e&&e.length){this._dataChanges=[];for(var t=this.data.datasets.length,n=function(t){return new Set(e.filter((function(e){return e[0]===t})).map((function(e,t){return t+","+e.splice(1).join(",")})))},r=n(0),a=1;a<t;a++)if(!qc(r,n(a)))return;return Array.from(r).map((function(e){return e.split(",")})).map((function(e){return{method:e[1],start:+e[2],count:+e[3]}}))}}},{key:"_updateLayout",value:function(e){var t=this;if(!1!==this.notifyPlugins("beforeLayout",{cancelable:!0})){Lh(this,this.width,this.height,e);var n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Lc(this.boxes,(function(e){var n;r&&"chartArea"===e.position||(e.configure&&e.configure(),(n=t._layers).push.apply(n,Ad(e._layers())))}),this),this._layers.forEach((function(e,t){e._idx=t})),this.notifyPlugins("afterLayout")}}},{key:"_updateDatasets",value:function(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(var t=0,n=this.data.datasets.length;t<n;++t)this.getDatasetMeta(t).controller.configure();for(var r=0,a=this.data.datasets.length;r<a;++r)this._updateDataset(r,Gc(e)?e({datasetIndex:r}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}},{key:"_updateDataset",value:function(e,t){var n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",r)&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}},{key:"render",value:function(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Id.has(this)?this.attached&&!Id.running(this)&&Id.start(this):(this.draw(),Rp({chart:this})))}},{key:"draw",value:function(){var e;if(this._resizeBeforeDraw){var t=this._resizeBeforeDraw,n=t.width,r=t.height;this._resize(n,r),this._resizeBeforeDraw=null}if(this.clear(),!(this.width<=0||this.height<=0)&&!1!==this.notifyPlugins("beforeDraw",{cancelable:!0})){var a=this._layers;for(e=0;e<a.length&&a[e].z<=0;++e)a[e].draw(this.chartArea);for(this._drawDatasets();e<a.length;++e)a[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}}},{key:"_getSortedDatasetMetas",value:function(e){var t,n,r=this._sortedMetasets,a=[];for(t=0,n=r.length;t<n;++t){var i=r[t];e&&!i.visible||a.push(i)}return a}},{key:"getSortedVisibleDatasetMetas",value:function(){return this._getSortedDatasetMetas(!0)}},{key:"_drawDatasets",value:function(){if(!1!==this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})){for(var e=this.getSortedVisibleDatasetMetas(),t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}}},{key:"_drawDataset",value:function(e){var t=this.ctx,n=e._clip,r=!n.disabled,a=function(e,t){var n=e.xScale,r=e.yScale;return n&&r?{left:zp(n,t,"left"),right:zp(n,t,"right"),top:zp(r,t,"top"),bottom:zp(r,t,"bottom")}:t}(e,this.chartArea),i={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(r&&rf(t,{left:!1===n.left?0:a.left-n.left,right:!1===n.right?this.width:a.right+n.right,top:!1===n.top?0:a.top-n.top,bottom:!1===n.bottom?this.height:a.bottom+n.bottom}),e.controller.draw(),r&&af(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}},{key:"isPointInArea",value:function(e){return nf(e,this.chartArea,this._minPadding)}},{key:"getElementsAtEventForMode",value:function(e,t,n,r){var a=xh.modes[t];return"function"==typeof a?a(this,e,n,r):[]}},{key:"getDatasetMeta",value:function(e){var t=this.data.datasets[e],n=this._metasets,r=n.filter((function(e){return e&&e._dataset===t})).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}},{key:"getContext",value:function(){return this.$context||(this.$context=wf(null,{chart:this,type:"chart"}))}},{key:"getVisibleDatasetCount",value:function(){return this.getSortedVisibleDatasetMetas().length}},{key:"isDatasetVisible",value:function(e){var t=this.data.datasets[e];if(!t)return!1;var n=this.getDatasetMeta(e);return"boolean"==typeof n.hidden?!n.hidden:!t.hidden}},{key:"setDatasetVisibility",value:function(e,t){this.getDatasetMeta(e).hidden=!t}},{key:"toggleDataVisibility",value:function(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}},{key:"getDataVisibility",value:function(e){return!this._hiddenIndices[e]}},{key:"_updateVisibility",value:function(e,t,n){var r=n?"show":"hide",a=this.getDatasetMeta(e),i=a.controller._resolveAnimations(void 0,r);Uc(t)?(a.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),i.update(a,{visible:n}),this.update((function(t){return t.datasetIndex===e?r:void 0})))}},{key:"hide",value:function(e,t){this._updateVisibility(e,t,!1)}},{key:"show",value:function(e,t){this._updateVisibility(e,t,!0)}},{key:"_destroyDatasetMeta",value:function(e){var t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}},{key:"_stop",value:function(){var e,t;for(this.stop(),Id.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}},{key:"destroy",value:function(){this.notifyPlugins("beforeDestroy");var e=this.canvas,t=this.ctx;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Qu(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Np[this.id],this.notifyPlugins("afterDestroy")}},{key:"toBase64Image",value:function(){var e;return(e=this.canvas).toDataURL.apply(e,arguments)}},{key:"bindEvents",value:function(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}},{key:"bindUserEvents",value:function(){var e=this,t=this._listeners,n=this.platform,r=function(t,n,r){t.offsetX=n,t.offsetY=r,e._eventHandler(t)};Lc(this.options.events,(function(a){return function(r,a){n.addEventListener(e,r,a),t[r]=a}(a,r)}))}},{key:"bindResponsiveEvents",value:function(){var e=this;this._responsiveListeners||(this._responsiveListeners={});var t,n=this._responsiveListeners,r=this.platform,a=function(t,a){r.addEventListener(e,t,a),n[t]=a},i=function(t,a){n[t]&&(r.removeEventListener(e,t,a),delete n[t])},o=function(t,n){e.canvas&&e.resize(t,n)},l=function n(){i("attach",n),e.attached=!0,e.resize(),a("resize",o),a("detach",t)};t=function(){e.attached=!1,i("resize",o),e._stop(),e._resize(0,0),a("attach",l)},r.isAttached(this.canvas)?l():t()}},{key:"unbindEvents",value:function(){var e=this;Lc(this._listeners,(function(t,n){e.platform.removeEventListener(e,n,t)})),this._listeners={},Lc(this._responsiveListeners,(function(t,n){e.platform.removeEventListener(e,n,t)})),this._responsiveListeners=void 0}},{key:"updateHoverStyle",value:function(e,t,n){var r,a,i,o=n?"set":"remove";for("dataset"===t&&this.getDatasetMeta(e[0].datasetIndex).controller["_"+o+"DatasetHoverStyle"](),a=0,i=e.length;a<i;++a){var l=(r=e[a])&&this.getDatasetMeta(r.datasetIndex).controller;l&&l[o+"HoverStyle"](r.element,r.datasetIndex,r.index)}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(e){var t=this,n=this._active||[],r=e.map((function(e){var n=e.datasetIndex,r=e.index,a=t.getDatasetMeta(n);if(!a)throw new Error("No dataset found at index "+n);return{datasetIndex:n,element:a.data[r],index:r}}));!Nc(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}},{key:"notifyPlugins",value:function(e,t,n){return this._plugins.notify(this,e,t,n)}},{key:"isPluginEnabled",value:function(e){return 1===this._plugins._cache.filter((function(t){return t.plugin.id===e})).length}},{key:"_updateHoverStyles",value:function(e,t,n){var r=this.options.hover,a=function(e,t){return e.filter((function(e){return!t.some((function(t){return e.datasetIndex===t.datasetIndex&&e.index===t.index}))}))},i=a(t,e),o=n?e:a(e,t);i.length&&this.updateHoverStyle(i,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}},{key:"_eventHandler",value:function(e,t){var n=this,r={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},a=function(t){return(t.options.events||n.options.events).includes(e.native.type)};if(!1!==this.notifyPlugins("beforeEvent",r,a)){var i=this._handleEvent(e,t,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(i||r.changed)&&this.render(),this}}},{key:"_handleEvent",value:function(e,t,n){var r=this._active,a=void 0===r?[]:r,i=this.options,o=t,l=this._getActiveElements(e,a,n,o),s=function(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}(e),c=function(e,t,n,r){return n&&"mouseout"!==e.type?r?t:e:null}(e,this._lastEvent,n,s);n&&(this._lastEvent=null,Ic(i.onHover,[e,l,this],this),s&&Ic(i.onClick,[e,l,this],this));var u=!Nc(l,a);return(u||t)&&(this._active=l,this._updateHoverStyles(l,a,t)),this._lastEvent=c,u}},{key:"_getActiveElements",value:function(e,t,n,r){if("mouseout"===e.type)return[];if(!n)return t;var a=this.options.hover;return this.getElementsAtEventForMode(e,a.mode,a,r)}}],[{key:"register",value:function(){up.add.apply(up,arguments),Vp()}},{key:"unregister",value:function(){up.remove.apply(up,arguments),Vp()}}]),e}();function Vp(){return Lc(Hp.instances,(function(e){return e._plugins.invalidate()}))}function Wp(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function $p(e,t,n,r,a,i){var o=t.x,l=t.y,s=t.startAngle,c=t.pixelMargin,u=t.innerRadius,f=Math.max(t.outerRadius+r+n-c,0),d=u>0?u+r+n+c:0,h=0,p=a-s;if(r){var v=((u>0?u-r:0)+(f>0?f-r:0))/2;h=(p-(0!==v?p*v/(v+r):p))/2}var m=(p-Math.max(.001,p*f-n/Zc)/f)/2,y=s+m+h,g=a-m-h,b=function(e,t,n,r){var a=mf(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),i=(n-t)/2,o=Math.min(i,r*t/2),l=function(e){var t=(n-Math.min(i,e))*r/2;return yu(e,0,Math.min(i,t))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:yu(a.innerStart,0,o),innerEnd:yu(a.innerEnd,0,o)}}(t,d,f,g-y),x=b.outerStart,_=b.outerEnd,w=b.innerStart,k=b.innerEnd,S=f-x,O=f-_,j=y+x/S,E=g-_/O,A=d+w,C=d+k,D=y+w/A,P=g-k/C;if(e.beginPath(),i){var M=(j+E)/2;if(e.arc(o,l,f,j,M),e.arc(o,l,f,M,E),_>0){var R=Wp(O,E,o,l);e.arc(R.x,R.y,_,E,g+eu)}var I=Wp(C,g,o,l);if(e.lineTo(I.x,I.y),k>0){var L=Wp(C,P,o,l);e.arc(L.x,L.y,k,g+eu,P+Math.PI)}var N=(g-k/d+(y+w/d))/2;if(e.arc(o,l,d,g-k/d,N,!0),e.arc(o,l,d,N,y+w/d,!0),w>0){var T=Wp(A,D,o,l);e.arc(T.x,T.y,w,D+Math.PI,y-eu)}var F=Wp(S,y,o,l);if(e.lineTo(F.x,F.y),x>0){var z=Wp(S,j,o,l);e.arc(z.x,z.y,x,y-eu,j)}}else{e.moveTo(o,l);var H=Math.cos(j)*f+o,V=Math.sin(j)*f+l;e.lineTo(H,V);var W=Math.cos(E)*f+o,$=Math.sin(E)*f+l;e.lineTo(W,$)}e.closePath()}Od(Hp,"defaults",Zu),Od(Hp,"instances",Np),Od(Hp,"overrides",Bu),Od(Hp,"registry",up),Od(Hp,"version","4.4.0"),Od(Hp,"getChart",Tp);var Bp=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),Od(wd(r=t.call(this)),"circumference",void 0),Od(wd(r),"endAngle",void 0),Od(wd(r),"fullCircles",void 0),Od(wd(r),"innerRadius",void 0),Od(wd(r),"outerRadius",void 0),Od(wd(r),"pixelMargin",void 0),Od(wd(r),"startAngle",void 0),r.options=void 0,r.circumference=void 0,r.startAngle=void 0,r.endAngle=void 0,r.innerRadius=void 0,r.outerRadius=void 0,r.pixelMargin=0,r.fullCircles=0,e&&Object.assign(wd(r),e),r}return Rd(n,[{key:"inRange",value:function(e,t,n){var r=du(this.getProps(["x","y"],n),{x:e,y:t}),a=r.angle,i=r.distance,o=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),l=o.startAngle,s=o.endAngle,c=o.innerRadius,u=o.outerRadius,f=o.circumference,d=(this.options.spacing+this.options.borderWidth)/2,h=Mc(f,s-l)>=Kc||mu(a,l,s),p=gu(i,c+d,u+d);return h&&p}},{key:"getCenterPoint",value:function(e){var t=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),n=t.x,r=t.y,a=t.startAngle,i=t.endAngle,o=t.innerRadius,l=t.outerRadius,s=this.options,c=s.offset,u=(a+i)/2,f=(o+l+s.spacing+c)/2;return{x:n+Math.cos(u)*f,y:r+Math.sin(u)*f}}},{key:"tooltipPosition",value:function(e){return this.getCenterPoint(e)}},{key:"draw",value:function(e){var t=this.options,n=this.circumference,r=(t.offset||0)/4,a=(t.spacing||0)/2,i=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=n>Kc?Math.floor(n/Kc):0,!(0===n||this.innerRadius<0||this.outerRadius<0)){e.save();var o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);var l=r*(1-Math.sin(Math.min(Zc,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,function(e,t,n,r,a){var i=t.fullCircles,o=t.startAngle,l=t.circumference,s=t.endAngle;if(i){$p(e,t,n,r,s,a);for(var c=0;c<i;++c)e.fill();isNaN(l)||(s=o+(l%Kc||Kc))}$p(e,t,n,r,s,a),e.fill()}(e,this,l,a,i),function(e,t,n,r,a){var i=t.fullCircles,o=t.startAngle,l=t.circumference,s=t.options,c=s.borderWidth,u=s.borderJoinStyle,f=s.borderDash,d=s.borderDashOffset,h="inner"===s.borderAlign;if(c){e.setLineDash(f||[]),e.lineDashOffset=d,h?(e.lineWidth=2*c,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");var p=t.endAngle;if(i){$p(e,t,n,r,p,a);for(var v=0;v<i;++v)e.stroke();isNaN(l)||(p=o+(l%Kc||Kc))}h&&function(e,t,n){var r=t.startAngle,a=t.pixelMargin,i=t.x,o=t.y,l=t.outerRadius,s=t.innerRadius,c=a/l;e.beginPath(),e.arc(i,o,l,r-c,n+c),s>a?(c=a/s,e.arc(i,o,s,n+c,r-c,!0)):e.arc(i,o,a,n+eu,r-eu),e.closePath(),e.clip()}(e,t,p),i||($p(e,t,n,r,p,a),e.stroke())}}(e,this,l,a,i),e.restore()}}}]),n}(Jh);function Yp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;e.lineCap=Mc(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Mc(n.borderDash,t.borderDash)),e.lineDashOffset=Mc(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Mc(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Mc(n.borderWidth,t.borderWidth),e.strokeStyle=Mc(n.borderColor,t.borderColor)}function Up(e,t,n){e.lineTo(n.x,n.y)}function Gp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.length,a=n.start,i=void 0===a?0:a,o=n.end,l=void 0===o?r-1:o,s=t.start,c=t.end,u=Math.max(i,s),f=Math.min(l,c),d=i<s&&l<s||i>c&&l>c;return{count:r,start:u,loop:t.loop,ilen:f<u&&!d?r+f-u:f-u}}function qp(e,t,n,r){var a,i,o,l=t.points,s=t.options,c=Gp(l,n,r),u=c.count,f=c.start,d=c.loop,h=c.ilen,p=function(e){return e.stepped?of:e.tension||"monotone"===e.cubicInterpolationMode?lf:Up}(s),v=r||{},m=v.move,y=void 0===m||m,g=v.reverse;for(a=0;a<=h;++a)(i=l[(f+(g?h-a:a))%u]).skip||(y?(e.moveTo(i.x,i.y),y=!1):p(e,o,i,g,s.stepped),o=i);return d&&p(e,o,i=l[(f+(g?h:0))%u],g,s.stepped),!!d}function Zp(e,t,n,r){var a,i,o,l,s,c,u=t.points,f=Gp(u,n,r),d=f.count,h=f.start,p=f.ilen,v=r||{},m=v.move,y=void 0===m||m,g=v.reverse,b=0,x=0,_=function(e){return(h+(g?p-e:e))%d},w=function(){l!==s&&(e.lineTo(b,s),e.lineTo(b,l),e.lineTo(b,c))};for(y&&(i=u[_(0)],e.moveTo(i.x,i.y)),a=0;a<=p;++a)if(!(i=u[_(a)]).skip){var k=i.x,S=i.y,O=0|k;O===o?(S<l?l=S:S>s&&(s=S),b=(x*b+k)/++x):(w(),e.lineTo(k,S),o=O,x=0,l=s=S),c=S}w()}function Kp(e){var t=e.options,n=t.borderDash&&t.borderDash.length;return e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||n?qp:Zp}Od(Bp,"id","arc"),Od(Bp,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Od(Bp,"defaultRoutes",{backgroundColor:"backgroundColor"}),Od(Bp,"descriptors",{_scriptable:!0,_indexable:function(e){return"borderDash"!==e}});var Xp="function"==typeof Path2D;var Jp=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this)).animated=!0,r.options=void 0,r._chart=void 0,r._loop=void 0,r._fullLoop=void 0,r._path=void 0,r._points=void 0,r._segments=void 0,r._decimated=!1,r._pointsUpdated=!1,r._datasetIndex=void 0,e&&Object.assign(wd(r),e),r}return Rd(n,[{key:"updateControlPoints",value:function(e,t){var n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){var r=n.spanGaps?this._loop:this._fullLoop;(function(e,t,n,r,a){var i,o,l,s;if(t.spanGaps&&(e=e.filter((function(e){return!e.skip}))),"monotone"===t.cubicInterpolationMode)!function(e){var t,n,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",i=Hf(a),o=e.length,l=Array(o).fill(0),s=Array(o),c=zf(e,0);for(t=0;t<o;++t)if(n=r,r=c,c=zf(e,t+1),r){if(c){var u=c[a]-r[a];l[t]=0!==u?(c[i]-r[i])/u:0}s[t]=n?c?au(l[t-1])!==au(l[t])?0:(l[t-1]+l[t])/2:l[t-1]:l[t]}Wf(e,l,s),$f(e,s,a)}(e,a);else{var c=r?e[e.length-1]:e[0];for(i=0,o=e.length;i<o;++i)s=Vf(c,l=e[i],e[Math.min(i+1,o-(r?0:1))%o],t.tension),l.cp1x=s.previous.x,l.cp1y=s.previous.y,l.cp2x=s.next.x,l.cp2y=s.next.y,c=l}t.capBezierPoints&&function(e,t){var n,r,a,i,o,l=nf(e[0],t);for(n=0,r=e.length;n<r;++n)o=i,i=l,l=n<r-1&&nf(e[n+1],t),i&&(a=e[n],o&&(a.cp1x=Bf(a.cp1x,t.left,t.right),a.cp1y=Bf(a.cp1y,t.top,t.bottom)),l&&(a.cp2x=Bf(a.cp2x,t.left,t.right),a.cp2y=Bf(a.cp2y,t.top,t.bottom)))}(e,n)})(this._points,n,e,r,t),this._pointsUpdated=!0}}},{key:"points",get:function(){return this._points},set:function(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}},{key:"segments",get:function(){return this._segments||(this._segments=function(e,t){var n=e.points,r=e.options.spanGaps,a=n.length;if(!a)return[];var i=!!e._loop,o=function(e,t,n,r){var a=0,i=t-1;if(n&&!r)for(;a<t&&!e[a].skip;)a++;for(;a<t&&e[a].skip;)a++;for(a%=t,n&&(i+=a);i>a&&e[i%t].skip;)i--;return{start:a,end:i%=t}}(n,a,i,r),l=o.start,s=o.end;return function(e,t,n,r){return r&&r.setContext&&n?function(e,t,n,r){var a=e._chart.getContext(),i=dd(e.options),o=e._datasetIndex,l=e.options.spanGaps,s=n.length,c=[],u=i,f=t[0].start,d=f;function h(e,t,r,a){var i=l?-1:1;if(e!==t){for(e+=s;n[e%s].skip;)e-=i;for(;n[t%s].skip;)t+=i;e%s!=t%s&&(c.push({start:e%s,end:t%s,loop:r,style:a}),u=a,f=t%s)}}var p,v=_c(t);try{for(v.s();!(p=v.n()).done;){var m=p.value;f=l?f:m.start;var y=n[f%s],g=void 0;for(d=f+1;d<=m.end;d++){var b=n[d%s];hd(g=dd(r.setContext(wf(a,{type:"segment",p0:y,p1:b,p0DataIndex:(d-1)%s,p1DataIndex:d%s,datasetIndex:o}))),u)&&h(f,d-1,m.loop,u),y=b,u=g}f<d-1&&h(f,d-1,m.loop,u)}}catch(e){v.e(e)}finally{v.f()}return c}(e,t,n,r):t}(e,!0===r?[{start:l,end:s,loop:i}]:function(e,t,n,r){var a,i=e.length,o=[],l=t,s=e[t];for(a=t+1;a<=n;++a){var c=e[a%i];c.skip||c.stop?s.skip||(r=!1,o.push({start:t%i,end:(a-1)%i,loop:r}),t=l=c.stop?a:null):(l=a,s.skip&&(t=a)),s=c}return null!==l&&o.push({start:t%i,end:l%i,loop:r}),o}(n,l,s<l?s+a:s,!!e._fullLoop&&0===l&&s===a-1),n,t)}(this,this.options.segment))}},{key:"first",value:function(){var e=this.segments,t=this.points;return e.length&&t[e[0].start]}},{key:"last",value:function(){var e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}},{key:"interpolate",value:function(e,t){var n=this.options,r=e[t],a=this.points,i=fd(this,{property:t,start:r,end:r});if(i.length){var o,l,s=[],c=function(e){return e.stepped?rd:e.tension||"monotone"===e.cubicInterpolationMode?ad:nd}(n);for(o=0,l=i.length;o<l;++o){var u=i[o],f=u.start,d=u.end,h=a[f],p=a[d];if(h!==p){var v=c(h,p,Math.abs((r-h[t])/(p[t]-h[t])),n.stepped);v[t]=e[t],s.push(v)}else s.push(h)}return 1===s.length?s[0]:s}}},{key:"pathSegment",value:function(e,t,n){return Kp(this)(e,this,t,n)}},{key:"path",value:function(e,t,n){var r=this.segments,a=Kp(this),i=this._loop;t=t||0,n=n||this.points.length-t;var o,l=jd(r);try{for(l.s();!(o=l.n()).done;)i&=a(e,this,o.value,{start:t,end:t+n-1})}catch(e){l.e(e)}finally{l.f()}return!!i}},{key:"draw",value:function(e,t,n,r){var a=this.options||{};(this.points||[]).length&&a.borderWidth&&(e.save(),function(e,t,n,r){Xp&&!t.options.segment?function(e,t,n,r){var a=t._path;a||(a=t._path=new Path2D,t.path(a,n,r)&&a.closePath()),Yp(e,t.options),e.stroke(a)}(e,t,n,r):function(e,t,n,r){var a,i=t.segments,o=t.options,l=Kp(t),s=jd(i);try{for(s.s();!(a=s.n()).done;){var c=a.value;Yp(e,o,c.style),e.beginPath(),l(e,t,c,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}}catch(e){s.e(e)}finally{s.f()}}(e,t,n,r)}(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}]),n}(Jh);function Qp(e,t,n,r){var a=e.options,i=e.getProps([n],r)[n];return Math.abs(t-i)<a.radius+a.hitRadius}Od(Jp,"id","line"),Od(Jp,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Od(Jp,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Od(Jp,"descriptors",{_scriptable:!0,_indexable:function(e){return"borderDash"!==e&&"fill"!==e}});var ev=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),Od(wd(r=t.call(this)),"parsed",void 0),Od(wd(r),"skip",void 0),Od(wd(r),"stop",void 0),r.options=void 0,r.parsed=void 0,r.skip=void 0,r.stop=void 0,e&&Object.assign(wd(r),e),r}return Rd(n,[{key:"inRange",value:function(e,t,n){var r=this.options,a=this.getProps(["x","y"],n),i=a.x,o=a.y;return Math.pow(e-i,2)+Math.pow(t-o,2)<Math.pow(r.hitRadius+r.radius,2)}},{key:"inXRange",value:function(e,t){return Qp(this,e,"x",t)}},{key:"inYRange",value:function(e,t){return Qp(this,e,"y",t)}},{key:"getCenterPoint",value:function(e){var t=this.getProps(["x","y"],e);return{x:t.x,y:t.y}}},{key:"size",value:function(e){var t=(e=e||this.options||{}).radius||0;return 2*((t=Math.max(t,t&&e.hoverRadius||0))+(t&&e.borderWidth||0))}},{key:"draw",value:function(e,t){var n=this.options;this.skip||n.radius<.1||!nf(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,ef(e,n,this.x,this.y))}},{key:"getRange",value:function(){var e=this.options||{};return e.radius+e.hitRadius}}]),n}(Jh);function tv(e,t){var n,r,a,i,o,l=e.getProps(["x","y","base","width","height"],t),s=l.x,c=l.y,u=l.base,f=l.width,d=l.height;return e.horizontal?(o=d/2,n=Math.min(s,u),r=Math.max(s,u),a=c-o,i=c+o):(n=s-(o=f/2),r=s+o,a=Math.min(c,u),i=Math.max(c,u)),{left:n,top:a,right:r,bottom:i}}function nv(e,t,n,r){return e?0:yu(t,n,r)}function rv(e,t,n,r){var a=null===t,i=null===n,o=e&&!(a&&i)&&tv(e,r);return o&&(a||gu(t,o.left,o.right))&&(i||gu(n,o.top,o.bottom))}function av(e,t){e.rect(t.x,t.y,t.w,t.h)}function iv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.x!==n.x?-t:0,a=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-a;return{x:e.x+r,y:e.y+a,w:e.w+i,h:e.h+o,radius:e.radius}}Od(ev,"id","point"),Od(ev,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Od(ev,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var ov=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this)).options=void 0,r.horizontal=void 0,r.base=void 0,r.width=void 0,r.height=void 0,r.inflateAmount=void 0,e&&Object.assign(wd(r),e),r}return Rd(n,[{key:"draw",value:function(e){var t,n,r,a,i,o,l=this.inflateAmount,s=this.options,c=s.borderColor,u=s.backgroundColor,f=(n=tv(t=this),r=n.right-n.left,a=n.bottom-n.top,i=function(e,t,n){var r=e.options.borderWidth,a=e.borderSkipped,i=yf(r);return{t:nv(a.top,i.top,0,n),r:nv(a.right,i.right,0,t),b:nv(a.bottom,i.bottom,0,n),l:nv(a.left,i.left,0,t)}}(t,r/2,a/2),o=function(e,t,n){var r=e.getProps(["enableBorderRadius"]).enableBorderRadius,a=e.options.borderRadius,i=gf(a),o=Math.min(t,n),l=e.borderSkipped,s=r||Cc(a);return{topLeft:nv(!s||l.top||l.left,i.topLeft,0,o),topRight:nv(!s||l.top||l.right,i.topRight,0,o),bottomLeft:nv(!s||l.bottom||l.left,i.bottomLeft,0,o),bottomRight:nv(!s||l.bottom||l.right,i.bottomRight,0,o)}}(t,r/2,a/2),{outer:{x:n.left,y:n.top,w:r,h:a,radius:o},inner:{x:n.left+i.l,y:n.top+i.t,w:r-i.l-i.r,h:a-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}),d=f.inner,h=f.outer,p=function(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}(h.radius)?df:av;e.save(),h.w===d.w&&h.h===d.h||(e.beginPath(),p(e,iv(h,l,d)),e.clip(),p(e,iv(d,-l,h)),e.fillStyle=c,e.fill("evenodd")),e.beginPath(),p(e,iv(d,l)),e.fillStyle=u,e.fill(),e.restore()}},{key:"inRange",value:function(e,t,n){return rv(this,e,t,n)}},{key:"inXRange",value:function(e,t){return rv(this,e,null,t)}},{key:"inYRange",value:function(e,t){return rv(this,null,e,t)}},{key:"getCenterPoint",value:function(e){var t=this.getProps(["x","y","base","horizontal"],e),n=t.x,r=t.y,a=t.base,i=t.horizontal;return{x:i?(n+a)/2:n,y:i?r:(r+a)/2}}},{key:"getRange",value:function(e){return"x"===e?this.width/2:this.height/2}}]),n}(Jh);function lv(e,t,n,r){if(!r){var a=t[e],i=n[e];return"angle"===e&&(a=vu(a),i=vu(i)),{property:e,start:a,end:i}}}function sv(e,t,n){for(;t>e;t--){var r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function cv(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function uv(e,t){var n=[],r=!1;return Ac(e)?(r=!0,n=e):n=function(e,t){var n=e||{},r=n.x,a=void 0===r?null:r,i=n.y,o=void 0===i?null:i,l=t.points,s=[];return t.segments.forEach((function(e){var t=e.start,n=e.end;n=sv(t,n,l);var r=l[t],i=l[n];null!==o?(s.push({x:r.x,y:o}),s.push({x:i.x,y:o})):null!==a&&(s.push({x:a,y:r.y}),s.push({x:a,y:i.y}))})),s}(e,t),n.length?new Jp({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function fv(e){return e&&!1!==e.fill}function dv(e,t,n){var r,a=e[t].fill,i=[t];if(!n)return a;for(;!1!==a&&-1===i.indexOf(a);){if(!Dc(a))return a;if(!(r=e[a]))return!1;if(r.visible)return a;i.push(a),a=r.fill}return!1}function hv(e,t,n){var r=function(e){var t=e.options,n=t.fill,r=Mc(n&&n.target,n);return void 0===r&&(r=!!t.backgroundColor),!1!==r&&null!==r&&(!0===r?"origin":r)}(e);if(Cc(r))return!isNaN(r.value)&&r;var a=parseFloat(r);return Dc(a)&&Math.floor(a)===a?function(e,t,n,r){return"-"!==e&&"+"!==e||(n=t+n),!(n===t||n<0||n>=r)&&n}(r[0],t,a,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function pv(e,t,n){for(var r=[],a=0;a<n.length;a++){var i=vv(n[a],t,"x"),o=i.first,l=i.last,s=i.point;if(!(!s||o&&l))if(o)r.unshift(s);else if(e.push(s),!l)break}e.push.apply(e,r)}function vv(e,t,n){var r=e.interpolate(t,n);if(!r)return{};for(var a=r[n],i=e.segments,o=e.points,l=!1,s=!1,c=0;c<i.length;c++){var u=i[c],f=o[u.start][n],d=o[u.end][n];if(gu(a,f,d)){l=a===f,s=a===d;break}}return{first:l,last:s,point:r}}Od(ov,"id","bar"),Od(ov,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Od(ov,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var mv=function(){function e(t){Pd(this,e),this.x=t.x,this.y=t.y,this.radius=t.radius}return Rd(e,[{key:"pathSegment",value:function(e,t,n){var r=this.x,a=this.y,i=this.radius;return t=t||{start:0,end:Kc},e.arc(r,a,i,t.end,t.start,!0),!n.bounds}},{key:"interpolate",value:function(e){var t=this.x,n=this.y,r=this.radius,a=e.angle;return{x:t+Math.cos(a)*r,y:n+Math.sin(a)*r,angle:a}}}]),e}();function yv(e,t,n){var r=function(e){var t=e.chart,n=e.fill,r=e.line;if(Dc(n))return function(e,t){var n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}(t,n);if("stack"===n)return function(e){var t=e.scale,n=e.index,r=e.line,a=[],i=r.segments,o=r.points,l=function(e,t){for(var n=[],r=e.getMatchingVisibleMetas("line"),a=0;a<r.length;a++){var i=r[a];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}(t,n);l.push(uv({x:null,y:t.bottom},r));for(var s=0;s<i.length;s++)for(var c=i[s],u=c.start;u<=c.end;u++)pv(a,o[u],l);return new Jp({points:a,options:{}})}(e);if("shape"===n)return!0;var a=function(e){return(e.scale||{}).getPointPositionForValue?function(e){var t=e.scale,n=e.fill,r=t.options,a=t.getLabels().length,i=r.reverse?t.max:t.min,o=function(e,t,n){return"start"===e?n:"end"===e?t.options.reverse?t.min:t.max:Cc(e)?e.value:t.getBaseValue()}(n,t,i),l=[];if(r.grid.circular){var s=t.getPointPositionForValue(0,i);return new mv({x:s.x,y:s.y,radius:t.getDistanceFromCenterForValue(o)})}for(var c=0;c<a;++c)l.push(t.getPointPositionForValue(c,o));return l}(e):function(e){var t=e.scale,n=void 0===t?{}:t,r=function(e,t){var n=null;return"start"===e?n=t.bottom:"end"===e?n=t.top:Cc(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}(e.fill,n);if(Dc(r)){var a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}(e)}(e);return a instanceof mv?a:uv(a,r)}(t),a=t.line,i=t.scale,o=t.axis,l=a.options,s=l.fill,c=l.backgroundColor,u=s||{},f=u.above,d=void 0===f?c:f,h=u.below,p=void 0===h?c:h;r&&a.points.length&&(rf(e,n),function(e,t){var n=t.line,r=t.target,a=t.above,i=t.below,o=t.area,l=t.scale,s=n._loop?"angle":t.axis;e.save(),"x"===s&&i!==a&&(gv(e,r,o.top),bv(e,{line:n,target:r,color:a,scale:l,property:s}),e.restore(),e.save(),gv(e,r,o.bottom)),bv(e,{line:n,target:r,color:i,scale:l,property:s}),e.restore()}(e,{line:a,target:r,above:d,below:p,area:n,scale:i,axis:o}),af(e))}function gv(e,t,n){var r=t.segments,a=t.points,i=!0,o=!1;e.beginPath();var l,s=jd(r);try{for(s.s();!(l=s.n()).done;){var c=l.value,u=c.start,f=c.end,d=a[u],h=a[sv(u,f,a)];i?(e.moveTo(d.x,d.y),i=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.y)),(o=!!t.pathSegment(e,c,{move:o}))?e.closePath():e.lineTo(h.x,n)}}catch(e){s.e(e)}finally{s.f()}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function bv(e,t){var n,r=t.line,a=t.target,i=t.property,o=t.color,l=t.scale,s=function(e,t,n){var r,a=e.segments,i=e.points,o=t.points,l=[],s=jd(a);try{for(s.s();!(r=s.n()).done;){var c=r.value,u=c.start,f=c.end;f=sv(u,f,i);var d=lv(n,i[u],i[f],c.loop);if(t.segments){var h,p=jd(fd(t,d));try{for(p.s();!(h=p.n()).done;){var v,m=h.value,y=lv(n,o[m.start],o[m.end],m.loop),g=jd(ud(c,i,y));try{for(g.s();!(v=g.n()).done;){var b=v.value;l.push({source:b,target:m,start:Od({},n,cv(d,y,"start",Math.max)),end:Od({},n,cv(d,y,"end",Math.min))})}}catch(e){g.e(e)}finally{g.f()}}}catch(e){p.e(e)}finally{p.f()}}else l.push({source:c,target:d,start:i[u],end:i[f]})}}catch(e){s.e(e)}finally{s.f()}return l}(r,a,i),c=jd(s);try{for(c.s();!(n=c.n()).done;){var u=n.value,f=u.source,d=u.target,h=u.start,p=u.end,v=f.style,m=(v=void 0===v?{}:v).backgroundColor,y=void 0===m?o:m,g=!0!==a;e.save(),e.fillStyle=y,xv(e,l,g&&lv(i,h,p)),e.beginPath();var b=!!r.pathSegment(e,f),x=void 0;if(g){b?e.closePath():_v(e,a,p,i);var _=!!a.pathSegment(e,d,{move:b,reverse:!0});(x=b&&_)||_v(e,a,h,i)}e.closePath(),e.fill(x?"evenodd":"nonzero"),e.restore()}}catch(e){c.e(e)}finally{c.f()}}function xv(e,t,n){var r=t.chart.chartArea,a=r.top,i=r.bottom,o=n||{},l=o.property,s=o.start,c=o.end;"x"===l&&(e.beginPath(),e.rect(s,a,c-s,i-a),e.clip())}function _v(e,t,n,r){var a=t.interpolate(n,r);a&&e.lineTo(a.x,a.y)}var wv={id:"filler",afterDatasetsUpdate:function(e,t,n){var r,a,i,o,l=(e.data.datasets||[]).length,s=[];for(a=0;a<l;++a)o=null,(i=(r=e.getDatasetMeta(a)).dataset)&&i.options&&i instanceof Jp&&(o={visible:e.isDatasetVisible(a),index:a,fill:hv(i,a,l),chart:e,axis:r.controller.options.indexAxis,scale:r.vScale,line:i}),r.$filler=o,s.push(o);for(a=0;a<l;++a)(o=s[a])&&!1!==o.fill&&(o.fill=dv(s,a,n.propagate))},beforeDraw:function(e,t,n){for(var r="beforeDraw"===n.drawTime,a=e.getSortedVisibleDatasetMetas(),i=e.chartArea,o=a.length-1;o>=0;--o){var l=a[o].$filler;l&&(l.line.updateControlPoints(i,l.axis),r&&l.fill&&yv(e.ctx,l,i))}},beforeDatasetsDraw:function(e,t,n){if("beforeDatasetsDraw"===n.drawTime)for(var r=e.getSortedVisibleDatasetMetas(),a=r.length-1;a>=0;--a){var i=r[a].$filler;fv(i)&&yv(e.ctx,i,e.chartArea)}},beforeDatasetDraw:function(e,t,n){var r=t.meta.$filler;fv(r)&&"beforeDatasetDraw"===n.drawTime&&yv(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},kv=function(e,t){var n=e.boxHeight,r=void 0===n?t:n,a=e.boxWidth,i=void 0===a?t:a;return e.usePointStyle&&(r=Math.min(r,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:r,itemHeight:Math.max(t,r)}},Sv=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this))._added=!1,r.legendHitBoxes=[],r._hoveredItem=null,r.doughnutMode=!1,r.chart=e.chart,r.options=e.options,r.ctx=e.ctx,r.legendItems=void 0,r.columnSizes=void 0,r.lineWidths=void 0,r.maxHeight=void 0,r.maxWidth=void 0,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.height=void 0,r.width=void 0,r._margins=void 0,r.position=void 0,r.weight=void 0,r.fullSize=void 0,r}return Rd(n,[{key:"update",value:function(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}},{key:"setDimensions",value:function(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}},{key:"buildLabels",value:function(){var e=this,t=this.options.labels||{},n=Ic(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter((function(n){return t.filter(n,e.chart.data)}))),t.sort&&(n=n.sort((function(n,r){return t.sort(n,r,e.chart.data)}))),this.options.reverse&&n.reverse(),this.legendItems=n}},{key:"fit",value:function(){var e=this.options,t=this.ctx;if(e.display){var n,r,a=e.labels,i=xf(a.font),o=i.size,l=this._computeTitleHeight(),s=kv(a,o),c=s.boxWidth,u=s.itemHeight;t.font=i.string,this.isHorizontal()?(n=this.maxWidth,r=this._fitRows(l,o,c,u)+10):(r=this.maxHeight,n=this._fitCols(l,i,c,u)+10),this.width=Math.min(n,e.maxWidth||this.maxWidth),this.height=Math.min(r,e.maxHeight||this.maxHeight)}else this.width=this.height=0}},{key:"_fitRows",value:function(e,t,n,r){var a=this.ctx,i=this.maxWidth,o=this.options.labels.padding,l=this.legendHitBoxes=[],s=this.lineWidths=[0],c=r+o,u=e;a.textAlign="left",a.textBaseline="middle";var f=-1,d=-c;return this.legendItems.forEach((function(e,h){var p=n+t/2+a.measureText(e.text).width;(0===h||s[s.length-1]+p+2*o>i)&&(u+=c,s[s.length-(h>0?0:1)]=0,d+=c,f++),l[h]={left:0,top:d,row:f,width:p,height:r},s[s.length-1]+=p+o})),u}},{key:"_fitCols",value:function(e,t,n,r){var a=this.ctx,i=this.maxHeight,o=this.options.labels.padding,l=this.legendHitBoxes=[],s=this.columnSizes=[],c=i-e,u=o,f=0,d=0,h=0,p=0;return this.legendItems.forEach((function(e,i){var v=function(e,t,n,r,a){var i=function(e,t,n,r){var a=e.text;return a&&"string"!=typeof a&&(a=a.reduce((function(e,t){return e.length>t.length?e:t}))),t+n.size/2+r.measureText(a).width}(r,e,t,n),o=function(e,t,n){var r=e;return"string"!=typeof t.text&&(r=Ov(t,n)),r}(a,r,t.lineHeight);return{itemWidth:i,itemHeight:o}}(n,t,a,e,r),m=v.itemWidth,y=v.itemHeight;i>0&&d+y+2*o>c&&(u+=f+o,s.push({width:f,height:d}),h+=f+o,p++,f=d=0),l[i]={left:h,top:d,col:p,width:m,height:y},f=Math.max(f,m),d+=y+o})),u+=f,s.push({width:f,height:d}),u}},{key:"adjustHitBoxes",value:function(){if(this.options.display){var e=this._computeTitleHeight(),t=this.legendHitBoxes,n=this.options,r=n.align,a=n.labels.padding,i=id(n.rtl,this.left,this.width);if(this.isHorizontal()){var o,l=0,s=Au(r,this.left+a,this.right-this.lineWidths[l]),c=jd(t);try{for(c.s();!(o=c.n()).done;){var u=o.value;l!==u.row&&(l=u.row,s=Au(r,this.left+a,this.right-this.lineWidths[l])),u.top+=this.top+e+a,u.left=i.leftForLtr(i.x(s),u.width),s+=u.width+a}}catch(e){c.e(e)}finally{c.f()}}else{var f,d=0,h=Au(r,this.top+e+a,this.bottom-this.columnSizes[d].height),p=jd(t);try{for(p.s();!(f=p.n()).done;){var v=f.value;v.col!==d&&(d=v.col,h=Au(r,this.top+e+a,this.bottom-this.columnSizes[d].height)),v.top=h,v.left+=this.left+a,v.left=i.leftForLtr(i.x(v.left),v.width),h+=v.height+a}}catch(e){p.e(e)}finally{p.f()}}}}},{key:"isHorizontal",value:function(){return"top"===this.options.position||"bottom"===this.options.position}},{key:"draw",value:function(){if(this.options.display){var e=this.ctx;rf(e,this),this._draw(),af(e)}}},{key:"_draw",value:function(){var e,t=this,n=this.options,r=this.columnSizes,a=this.lineWidths,i=this.ctx,o=n.align,l=n.labels,s=Zu.color,c=id(n.rtl,this.left,this.width),u=xf(l.font),f=l.padding,d=u.size,h=d/2;this.drawTitle(),i.textAlign=c.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;var p=kv(l,d),v=p.boxWidth,m=p.boxHeight,y=p.itemHeight,g=this.isHorizontal(),b=this._computeTitleHeight();e=g?{x:Au(o,this.left+f,this.right-a[0]),y:this.top+f+b,line:0}:{x:this.left+f,y:Au(o,this.top+b+f,this.bottom-r[0].height),line:0},od(this.ctx,n.textDirection);var x=y+f;this.legendItems.forEach((function(p,_){i.strokeStyle=p.fontColor,i.fillStyle=p.fontColor;var w=i.measureText(p.text).width,k=c.textAlign(p.textAlign||(p.textAlign=l.textAlign)),S=v+h+w,O=e.x,j=e.y;if(c.setWidth(t.width),g?_>0&&O+S+f>t.right&&(j=e.y+=x,e.line++,O=e.x=Au(o,t.left+f,t.right-a[e.line])):_>0&&j+x>t.bottom&&(O=e.x=O+r[e.line].width+f,e.line++,j=e.y=Au(o,t.top+b+f,t.bottom-r[e.line].height)),function(e,t,n){if(!(isNaN(v)||v<=0||isNaN(m)||m<0)){i.save();var r=Mc(n.lineWidth,1);if(i.fillStyle=Mc(n.fillStyle,s),i.lineCap=Mc(n.lineCap,"butt"),i.lineDashOffset=Mc(n.lineDashOffset,0),i.lineJoin=Mc(n.lineJoin,"miter"),i.lineWidth=r,i.strokeStyle=Mc(n.strokeStyle,s),i.setLineDash(Mc(n.lineDash,[])),l.usePointStyle){var a={radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},o=c.xPlus(e,v/2);tf(i,a,o,t+h,l.pointStyleWidth&&v)}else{var u=t+Math.max((d-m)/2,0),f=c.leftForLtr(e,v),p=gf(n.borderRadius);i.beginPath(),Object.values(p).some((function(e){return 0!==e}))?df(i,{x:f,y:u,w:v,h:m,radius:p}):i.rect(f,u,v,m),i.fill(),0!==r&&i.stroke()}i.restore()}}(c.x(O),j,p),O=function(e,t,n,r){return e===(r?"left":"right")?n:"center"===e?(t+n)/2:t}(k,O+v+h,g?O+S:t.right,n.rtl),function(e,t,n){ff(i,n.text,e,t+y/2,u,{strikethrough:n.hidden,textAlign:c.textAlign(n.textAlign)})}(c.x(O),j,p),g)e.x+=S+f;else if("string"!=typeof p.text){var E=u.lineHeight;e.y+=Ov(p,E)+f}else e.y+=x})),ld(this.ctx,n.textDirection)}},{key:"drawTitle",value:function(){var e=this.options,t=e.title,n=xf(t.font),r=bf(t.padding);if(t.display){var a,i=id(e.rtl,this.left,this.width),o=this.ctx,l=t.position,s=n.size/2,c=r.top+s,u=this.left,f=this.width;if(this.isHorizontal())f=Math.max.apply(Math,Ad(this.lineWidths)),a=this.top+c,u=Au(e.align,u,this.right-f);else{var d=this.columnSizes.reduce((function(e,t){return Math.max(e,t.height)}),0);a=c+Au(e.align,this.top,this.bottom-d-e.labels.padding-this._computeTitleHeight())}var h=Au(l,u,u+f);o.textAlign=i.textAlign(Eu(l)),o.textBaseline="middle",o.strokeStyle=t.color,o.fillStyle=t.color,o.font=n.string,ff(o,t.text,h,a,n)}}},{key:"_computeTitleHeight",value:function(){var e=this.options.title,t=xf(e.font),n=bf(e.padding);return e.display?t.lineHeight+n.height:0}},{key:"_getLegendItemAt",value:function(e,t){var n,r,a;if(gu(e,this.left,this.right)&&gu(t,this.top,this.bottom))for(a=this.legendHitBoxes,n=0;n<a.length;++n)if(gu(e,(r=a[n]).left,r.left+r.width)&&gu(t,r.top,r.top+r.height))return this.legendItems[n];return null}},{key:"handleEvent",value:function(e){var t=this.options;if(function(e,t){return!("mousemove"!==e&&"mouseout"!==e||!t.onHover&&!t.onLeave)||!(!t.onClick||"click"!==e&&"mouseup"!==e)}(e.type,t)){var n,r,a=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){var i=this._hoveredItem,o=(r=a,null!==(n=i)&&null!==r&&n.datasetIndex===r.datasetIndex&&n.index===r.index);i&&!o&&Ic(t.onLeave,[e,i,this],this),this._hoveredItem=a,a&&!o&&Ic(t.onHover,[e,a,this],this)}else a&&Ic(t.onClick,[e,a,this],this)}}}]),n}(Jh);function Ov(e,t){return t*(e.text?e.text.length:0)}var jv={id:"legend",_element:Sv,start:function(e,t,n){var r=e.legend=new Sv({ctx:e.ctx,options:n,chart:e});Ih(0,r,n),Mh(e,r)},stop:function(e){Rh(e,e.legend),delete e.legend},beforeUpdate:function(e,t,n){var r=e.legend;Ih(0,r,n),r.options=n},afterUpdate:function(e){var t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent:function(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick:function(e,t,n){var r=t.datasetIndex,a=n.chart;a.isDatasetVisible(r)?(a.hide(r),t.hidden=!0):(a.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:function(e){return e.chart.options.color},boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.legend.options.labels,r=n.usePointStyle,a=n.pointStyle,i=n.textAlign,o=n.color,l=n.useBorderRadius,s=n.borderRadius;return e._getSortedDatasetMetas().map((function(e){var n=e.controller.getStyle(r?0:void 0),c=bf(n.borderWidth);return{text:t[e.index].label,fillStyle:n.backgroundColor,fontColor:o,hidden:!e.visible,lineCap:n.borderCapStyle,lineDash:n.borderDash,lineDashOffset:n.borderDashOffset,lineJoin:n.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:n.borderColor,pointStyle:a||n.pointStyle,rotation:n.rotation,textAlign:i||n.textAlign,borderRadius:l&&(s||n.borderRadius),datasetIndex:e.index}}),this)}},title:{color:function(e){return e.chart.options.color},display:!1,position:"center",text:""}},descriptors:{_scriptable:function(e){return!e.startsWith("on")},labels:{_scriptable:function(e){return!["generateLabels","filter","sort"].includes(e)}}}},Ev=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this)).chart=e.chart,r.options=e.options,r.ctx=e.ctx,r._padding=void 0,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.width=void 0,r.height=void 0,r.position=void 0,r.weight=void 0,r.fullSize=void 0,r}return Rd(n,[{key:"update",value:function(e,t){var n=this.options;if(this.left=0,this.top=0,n.display){this.width=this.right=e,this.height=this.bottom=t;var r=Ac(n.text)?n.text.length:1;this._padding=bf(n.padding);var a=r*xf(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}else this.width=this.height=this.right=this.bottom=0}},{key:"isHorizontal",value:function(){var e=this.options.position;return"top"===e||"bottom"===e}},{key:"_drawArgs",value:function(e){var t,n,r,a=this.top,i=this.left,o=this.bottom,l=this.right,s=this.options,c=s.align,u=0;return this.isHorizontal()?(n=Au(c,i,l),r=a+e,t=l-i):("left"===s.position?(n=i+e,r=Au(c,o,a),u=-.5*Zc):(n=l-e,r=Au(c,a,o),u=.5*Zc),t=o-a),{titleX:n,titleY:r,maxWidth:t,rotation:u}}},{key:"draw",value:function(){var e=this.ctx,t=this.options;if(t.display){var n=xf(t.font),r=n.lineHeight/2+this._padding.top,a=this._drawArgs(r),i=a.titleX,o=a.titleY,l=a.maxWidth,s=a.rotation;ff(e,t.text,0,0,n,{color:t.color,maxWidth:l,rotation:s,textAlign:Eu(t.align),textBaseline:"middle",translation:[i,o]})}}}]),n}(Jh),Av={id:"title",_element:Ev,start:function(e,t,n){!function(e,t){var n=new Ev({ctx:e.ctx,options:t,chart:e});Ih(0,n,t),Mh(e,n),e.titleBlock=n}(e,n)},stop:function(e){var t=e.titleBlock;Rh(e,t),delete e.titleBlock},beforeUpdate:function(e,t,n){var r=e.titleBlock;Ih(0,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Cv=(new WeakMap,{average:function(e){if(!e.length)return!1;var t,n,r=0,a=0,i=0;for(t=0,n=e.length;t<n;++t){var o=e[t].element;if(o&&o.hasValue()){var l=o.tooltipPosition();r+=l.x,a+=l.y,++i}}return{x:r/i,y:a/i}},nearest:function(e,t){if(!e.length)return!1;var n,r,a,i=t.x,o=t.y,l=Number.POSITIVE_INFINITY;for(n=0,r=e.length;n<r;++n){var s=e[n].element;if(s&&s.hasValue()){var c=hu(t,s.getCenterPoint());c<l&&(l=c,a=s)}}if(a){var u=a.tooltipPosition();i=u.x,o=u.y}return{x:i,y:o}}});function Dv(e,t){return t&&(Ac(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Pv(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Mv(e,t){var n=t.element,r=t.datasetIndex,a=t.index,i=e.getDatasetMeta(r).controller,o=i.getLabelAndValue(a),l=o.label,s=o.value;return{chart:e,label:l,parsed:i.getParsed(a),raw:e.data.datasets[r].data[a],formattedValue:s,dataset:i.getDataset(),dataIndex:a,datasetIndex:r,element:n}}function Rv(e,t){var n=e.chart.ctx,r=e.body,a=e.footer,i=e.title,o=t.boxWidth,l=t.boxHeight,s=xf(t.bodyFont),c=xf(t.titleFont),u=xf(t.footerFont),f=i.length,d=a.length,h=r.length,p=bf(t.padding),v=p.height,m=0,y=r.reduce((function(e,t){return e+t.before.length+t.lines.length+t.after.length}),0);y+=e.beforeBody.length+e.afterBody.length,f&&(v+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),y&&(v+=h*(t.displayColors?Math.max(l,s.lineHeight):s.lineHeight)+(y-h)*s.lineHeight+(y-1)*t.bodySpacing),d&&(v+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);var g=0,b=function(e){m=Math.max(m,n.measureText(e).width+g)};return n.save(),n.font=c.string,Lc(e.title,b),n.font=s.string,Lc(e.beforeBody.concat(e.afterBody),b),g=t.displayColors?o+2+t.boxPadding:0,Lc(r,(function(e){Lc(e.before,b),Lc(e.lines,b),Lc(e.after,b)})),g=0,n.font=u.string,Lc(e.footer,b),n.restore(),{width:m+=p.width,height:v}}function Iv(e,t,n,r){var a=n.x,i=n.width,o=e.width,l=e.chartArea,s=l.left,c=l.right,u="center";return"center"===r?u=a<=(s+c)/2?"left":"right":a<=i/2?u="left":a>=o-i/2&&(u="right"),function(e,t,n,r){var a=r.x,i=r.width,o=n.caretSize+n.caretPadding;return"left"===e&&a+i+o>t.width||"right"===e&&a-i-o<0||void 0}(u,e,t,n)&&(u="center"),u}function Lv(e,t,n){var r=n.yAlign||t.yAlign||function(e,t){var n=t.y,r=t.height;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}(e,n);return{xAlign:n.xAlign||t.xAlign||Iv(e,t,n,r),yAlign:r}}function Nv(e,t,n,r){var a=e.caretSize,i=e.caretPadding,o=e.cornerRadius,l=n.xAlign,s=n.yAlign,c=a+i,u=gf(o),f=u.topLeft,d=u.topRight,h=u.bottomLeft,p=u.bottomRight,v=function(e,t){var n=e.x,r=e.width;return"right"===t?n-=r:"center"===t&&(n-=r/2),n}(t,l),m=function(e,t,n){var r=e.y,a=e.height;return"top"===t?r+=n:r-="bottom"===t?a+n:a/2,r}(t,s,c);return"center"===s?"left"===l?v+=c:"right"===l&&(v-=c):"left"===l?v-=Math.max(f,h)+a:"right"===l&&(v+=Math.max(d,p)+a),{x:yu(v,0,r.width-t.width),y:yu(m,0,r.height-t.height)}}function Tv(e,t,n){var r=bf(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-r.right:e.x+r.left}function Fv(e){return Dv([],Pv(e))}function zv(e,t){var n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var Hv={beforeTitle:Sc,title:function(e){if(e.length>0){var t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Sc,beforeBody:Sc,beforeLabel:Sc,label:function(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;var t=e.dataset.label||"";t&&(t+=": ");var n=e.formattedValue;return Ec(n)||(t+=n),t},labelColor:function(e){var t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor:function(){return this.options.bodyColor},labelPointStyle:function(e){var t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Sc,afterBody:Sc,beforeFooter:Sc,footer:Sc,afterFooter:Sc};function Vv(e,t,n,r){var a=e[t].call(n,r);return void 0===a?Hv[t].call(n,r):a}var Wv=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this)).opacity=0,r._active=[],r._eventPosition=void 0,r._size=void 0,r._cachedAnimations=void 0,r._tooltipItems=[],r.$animations=void 0,r.$context=void 0,r.chart=e.chart,r.options=e.options,r.dataPoints=void 0,r.title=void 0,r.beforeBody=void 0,r.body=void 0,r.afterBody=void 0,r.footer=void 0,r.xAlign=void 0,r.yAlign=void 0,r.x=void 0,r.y=void 0,r.height=void 0,r.width=void 0,r.caretX=void 0,r.caretY=void 0,r.labelColors=void 0,r.labelPointStyles=void 0,r.labelTextColors=void 0,r}return Rd(n,[{key:"initialize",value:function(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}},{key:"_resolveAnimations",value:function(){var e=this._cachedAnimations;if(e)return e;var t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,a=new Fd(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}},{key:"getContext",value:function(){return this.$context||(this.$context=(this,wf(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}},{key:"getTitle",value:function(e,t){var n=t.callbacks,r=Vv(n,"beforeTitle",this,e),a=Vv(n,"title",this,e),i=Vv(n,"afterTitle",this,e),o=[];return o=Dv(o,Pv(r)),o=Dv(o,Pv(a)),Dv(o,Pv(i))}},{key:"getBeforeBody",value:function(e,t){return Fv(Vv(t.callbacks,"beforeBody",this,e))}},{key:"getBody",value:function(e,t){var n=this,r=t.callbacks,a=[];return Lc(e,(function(e){var t={before:[],lines:[],after:[]},i=zv(r,e);Dv(t.before,Pv(Vv(i,"beforeLabel",n,e))),Dv(t.lines,Vv(i,"label",n,e)),Dv(t.after,Pv(Vv(i,"afterLabel",n,e))),a.push(t)})),a}},{key:"getAfterBody",value:function(e,t){return Fv(Vv(t.callbacks,"afterBody",this,e))}},{key:"getFooter",value:function(e,t){var n=t.callbacks,r=Vv(n,"beforeFooter",this,e),a=Vv(n,"footer",this,e),i=Vv(n,"afterFooter",this,e),o=[];return o=Dv(o,Pv(r)),o=Dv(o,Pv(a)),Dv(o,Pv(i))}},{key:"_createItems",value:function(e){var t,n,r=this,a=this._active,i=this.chart.data,o=[],l=[],s=[],c=[];for(t=0,n=a.length;t<n;++t)c.push(Mv(this.chart,a[t]));return e.filter&&(c=c.filter((function(t,n,r){return e.filter(t,n,r,i)}))),e.itemSort&&(c=c.sort((function(t,n){return e.itemSort(t,n,i)}))),Lc(c,(function(t){var n=zv(e.callbacks,t);o.push(Vv(n,"labelColor",r,t)),l.push(Vv(n,"labelPointStyle",r,t)),s.push(Vv(n,"labelTextColor",r,t))})),this.labelColors=o,this.labelPointStyles=l,this.labelTextColors=s,this.dataPoints=c,c}},{key:"update",value:function(e,t){var n,r=this.options.setContext(this.getContext()),a=this._active,i=[];if(a.length){var o=Cv[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);var l=this._size=Rv(this,r),s=Object.assign({},o,l),c=Lv(this.chart,r,s),u=Nv(r,s,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,n={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=i,this.$context=void 0,n&&this._resolveAnimations().update(this,n),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:t})}},{key:"drawCaret",value:function(e,t,n,r){var a=this.getCaretPosition(e,n,r);t.lineTo(a.x1,a.y1),t.lineTo(a.x2,a.y2),t.lineTo(a.x3,a.y3)}},{key:"getCaretPosition",value:function(e,t,n){var r,a,i,o,l,s,c=this.xAlign,u=this.yAlign,f=n.caretSize,d=gf(n.cornerRadius),h=d.topLeft,p=d.topRight,v=d.bottomLeft,m=d.bottomRight,y=e.x,g=e.y,b=t.width,x=t.height;return"center"===u?(l=g+x/2,"left"===c?(a=(r=y)-f,o=l+f,s=l-f):(a=(r=y+b)+f,o=l-f,s=l+f),i=r):(a="left"===c?y+Math.max(h,v)+f:"right"===c?y+b-Math.max(p,m)-f:this.caretX,"top"===u?(l=(o=g)-f,r=a-f,i=a+f):(l=(o=g+x)+f,r=a+f,i=a-f),s=o),{x1:r,x2:a,x3:i,y1:o,y2:l,y3:s}}},{key:"drawTitle",value:function(e,t,n){var r,a,i,o=this.title,l=o.length;if(l){var s=id(n.rtl,this.x,this.width);for(e.x=Tv(this,n.titleAlign,n),t.textAlign=s.textAlign(n.titleAlign),t.textBaseline="middle",r=xf(n.titleFont),a=n.titleSpacing,t.fillStyle=n.titleColor,t.font=r.string,i=0;i<l;++i)t.fillText(o[i],s.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+a,i+1===l&&(e.y+=n.titleMarginBottom-a)}}},{key:"_drawColorBox",value:function(e,t,n,r,a){var i=this.labelColors[n],o=this.labelPointStyles[n],l=a.boxHeight,s=a.boxWidth,c=xf(a.bodyFont),u=Tv(this,"left",a),f=r.x(u),d=l<c.lineHeight?(c.lineHeight-l)/2:0,h=t.y+d;if(a.usePointStyle){var p={radius:Math.min(s,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},v=r.leftForLtr(f,s)+s/2,m=h+l/2;e.strokeStyle=a.multiKeyBackground,e.fillStyle=a.multiKeyBackground,ef(e,p,v,m),e.strokeStyle=i.borderColor,e.fillStyle=i.backgroundColor,ef(e,p,v,m)}else{e.lineWidth=Cc(i.borderWidth)?Math.max.apply(Math,Ad(Object.values(i.borderWidth))):i.borderWidth||1,e.strokeStyle=i.borderColor,e.setLineDash(i.borderDash||[]),e.lineDashOffset=i.borderDashOffset||0;var y=r.leftForLtr(f,s),g=r.leftForLtr(r.xPlus(f,1),s-2),b=gf(i.borderRadius);Object.values(b).some((function(e){return 0!==e}))?(e.beginPath(),e.fillStyle=a.multiKeyBackground,df(e,{x:y,y:h,w:s,h:l,radius:b}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),df(e,{x:g,y:h+1,w:s-2,h:l-2,radius:b}),e.fill()):(e.fillStyle=a.multiKeyBackground,e.fillRect(y,h,s,l),e.strokeRect(y,h,s,l),e.fillStyle=i.backgroundColor,e.fillRect(g,h+1,s-2,l-2))}e.fillStyle=this.labelTextColors[n]}},{key:"drawBody",value:function(e,t,n){var r,a,i,o,l,s,c,u=this.body,f=n.bodySpacing,d=n.bodyAlign,h=n.displayColors,p=n.boxHeight,v=n.boxWidth,m=n.boxPadding,y=xf(n.bodyFont),g=y.lineHeight,b=0,x=id(n.rtl,this.x,this.width),_=function(n){t.fillText(n,x.x(e.x+b),e.y+g/2),e.y+=g+f},w=x.textAlign(d);for(t.textAlign=d,t.textBaseline="middle",t.font=y.string,e.x=Tv(this,w,n),t.fillStyle=n.bodyColor,Lc(this.beforeBody,_),b=h&&"right"!==w?"center"===d?v/2+m:v+2+m:0,o=0,s=u.length;o<s;++o){for(r=u[o],a=this.labelTextColors[o],t.fillStyle=a,Lc(r.before,_),i=r.lines,h&&i.length&&(this._drawColorBox(t,e,o,x,n),g=Math.max(y.lineHeight,p)),l=0,c=i.length;l<c;++l)_(i[l]),g=y.lineHeight;Lc(r.after,_)}b=0,g=y.lineHeight,Lc(this.afterBody,_),e.y-=f}},{key:"drawFooter",value:function(e,t,n){var r,a,i=this.footer,o=i.length;if(o){var l=id(n.rtl,this.x,this.width);for(e.x=Tv(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=l.textAlign(n.footerAlign),t.textBaseline="middle",r=xf(n.footerFont),t.fillStyle=n.footerColor,t.font=r.string,a=0;a<o;++a)t.fillText(i[a],l.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+n.footerSpacing}}},{key:"drawBackground",value:function(e,t,n,r){var a=this.xAlign,i=this.yAlign,o=e.x,l=e.y,s=n.width,c=n.height,u=gf(r.cornerRadius),f=u.topLeft,d=u.topRight,h=u.bottomLeft,p=u.bottomRight;t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(o+f,l),"top"===i&&this.drawCaret(e,t,n,r),t.lineTo(o+s-d,l),t.quadraticCurveTo(o+s,l,o+s,l+d),"center"===i&&"right"===a&&this.drawCaret(e,t,n,r),t.lineTo(o+s,l+c-p),t.quadraticCurveTo(o+s,l+c,o+s-p,l+c),"bottom"===i&&this.drawCaret(e,t,n,r),t.lineTo(o+h,l+c),t.quadraticCurveTo(o,l+c,o,l+c-h),"center"===i&&"left"===a&&this.drawCaret(e,t,n,r),t.lineTo(o,l+f),t.quadraticCurveTo(o,l,o+f,l),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}},{key:"_updateAnimationTarget",value:function(e){var t=this.chart,n=this.$animations,r=n&&n.x,a=n&&n.y;if(r||a){var i=Cv[e.position].call(this,this._active,this._eventPosition);if(!i)return;var o=this._size=Rv(this,e),l=Object.assign({},i,this._size),s=Lv(t,e,l),c=Nv(e,l,s,t);r._to===c.x&&a._to===c.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,c))}}},{key:"_willRender",value:function(){return!!this.opacity}},{key:"draw",value:function(e){var t=this.options.setContext(this.getContext()),n=this.opacity;if(n){this._updateAnimationTarget(t);var r={width:this.width,height:this.height},a={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;var i=bf(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(a,e,r,t),od(e,t.textDirection),a.y+=i.top,this.drawTitle(a,e,t),this.drawBody(a,e,t),this.drawFooter(a,e,t),ld(e,t.textDirection),e.restore())}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(e,t){var n=this,r=this._active,a=e.map((function(e){var t=e.datasetIndex,r=e.index,a=n.chart.getDatasetMeta(t);if(!a)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:a.data[r],index:r}})),i=!Nc(r,a),o=this._positionChanged(a,t);(i||o)&&(this._active=a,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}},{key:"handleEvent",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;var r=this.options,a=this._active||[],i=this._getActiveElements(e,a,t,n),o=this._positionChanged(i,e),l=t||!Nc(i,a)||o;return l&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),l}},{key:"_getActiveElements",value:function(e,t,n,r){var a=this.options;if("mouseout"===e.type)return[];if(!r)return t;var i=this.chart.getElementsAtEventForMode(e,a.mode,a,n);return a.reverse&&i.reverse(),i}},{key:"_positionChanged",value:function(e,t){var n=this.caretX,r=this.caretY,a=this.options,i=Cv[a.position].call(this,e,t);return!1!==i&&(n!==i.x||r!==i.y)}}]),n}(Jh);Od(Wv,"positioners",Cv);var $v={id:"tooltip",_element:Wv,positioners:Cv,afterInit:function(e,t,n){n&&(e.tooltip=new Wv({chart:e,options:n}))},beforeUpdate:function(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset:function(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw:function(e){var t=e.tooltip;if(t&&t._willRender()){var n={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",vd(vd({},n),{},{cancelable:!0})))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent:function(e,t){if(e.tooltip){var n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:function(e,t){return t.bodyFont.size},boxWidth:function(e,t){return t.bodyFont.size},multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Hv},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:function(e){return"filter"!==e&&"itemSort"!==e&&"external"!==e},_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Bv(e){var t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var Yv=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this,e))._startValue=void 0,r._valueRange=0,r._addedLabels=[],r}return Rd(n,[{key:"init",value:function(e){var t=this._addedLabels;if(t.length){var r,a=this.getLabels(),i=jd(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,l=o.index,s=o.label;a[l]===s&&a.splice(l,1)}}catch(e){i.e(e)}finally{i.f()}this._addedLabels=[]}md(kd(n.prototype),"init",this).call(this,e)}},{key:"parse",value:function(e,t){if(Ec(e))return null;var n=this.getLabels();return function(e,t){return null===e?null:yu(Math.round(e),0,t)}(t=isFinite(t)&&n[t]===e?t:function(e,t,n,r){var a=e.indexOf(t);return-1===a?function(e,t,n,r){return"string"==typeof t?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n}(e,t,n,r):a!==e.lastIndexOf(t)?n:a}(n,e,Mc(t,e),this._addedLabels),n.length-1)}},{key:"determineDataLimits",value:function(){var e=this.getUserBounds(),t=e.minDefined,n=e.maxDefined,r=this.getMinMax(!0),a=r.min,i=r.max;"ticks"===this.options.bounds&&(t||(a=0),n||(i=this.getLabels().length-1)),this.min=a,this.max=i}},{key:"buildTicks",value:function(){var e=this.min,t=this.max,n=this.options.offset,r=[],a=this.getLabels();a=0===e&&t===a.length-1?a:a.slice(e,t+1),this._valueRange=Math.max(a.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(var i=e;i<=t;i++)r.push({value:i});return r}},{key:"getLabelForValue",value:function(e){return Bv.call(this,e)}},{key:"configure",value:function(){md(kd(n.prototype),"configure",this).call(this),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}},{key:"getPixelForValue",value:function(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}},{key:"getPixelForTick",value:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}},{key:"getValueForPixel",value:function(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}},{key:"getBasePixel",value:function(){return this.bottom}}]),n}(lp);function Uv(e,t,n){var r=n.horizontal,a=cu(n.minRotation),i=(r?Math.sin(a):Math.cos(a))||.001,o=.75*t*(""+e).length;return Math.min(t/i,o)}Od(Yv,"id","category"),Od(Yv,"defaults",{ticks:{callback:Bv}});var Gv=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this,e)).start=void 0,r.end=void 0,r._startValue=void 0,r._endValue=void 0,r._valueRange=0,r}return Rd(n,[{key:"parse",value:function(e,t){return Ec(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}},{key:"handleTickRangeOptions",value:function(){var e=this.options.beginAtZero,t=this.getUserBounds(),n=t.minDefined,r=t.maxDefined,a=this.min,i=this.max,o=function(e){return a=n?a:e},l=function(e){return i=r?i:e};if(e){var s=au(a),c=au(i);s<0&&c<0?l(0):s>0&&c>0&&o(0)}if(a===i){var u=0===i?1:Math.abs(.05*i);l(i+u),e||o(a-u)}this.min=a,this.max=i}},{key:"getTickLimit",value:function(){var e,t=this.options.ticks,n=t.maxTicksLimit,r=t.stepSize;return r?(e=Math.ceil(this.max/r)-Math.floor(this.min/r)+1)>1e3&&(console.warn("scales.".concat(this.id,".ticks.stepSize: ").concat(r," would result generating up to ").concat(e," ticks. Limiting to 1000.")),e=1e3):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}},{key:"computeTickLimit",value:function(){return Number.POSITIVE_INFINITY}},{key:"buildTicks",value:function(){var e=this.options,t=e.ticks,n=this.getTickLimit(),r=function(e,t){var n,r,a,i,o,l,s,c=[],u=e.bounds,f=e.step,d=e.min,h=e.max,p=e.precision,v=e.count,m=e.maxTicks,y=e.maxDigits,g=e.includeBounds,b=f||1,x=m-1,_=t.min,w=t.max,k=!Ec(d),S=!Ec(h),O=!Ec(v),j=(w-_)/(y+1),E=ou((w-_)/x/b)*b;if(E<1e-14&&!k&&!S)return[{value:_},{value:w}];(i=Math.ceil(w/E)-Math.floor(_/E))>x&&(E=ou(i*E/x/b)*b),Ec(p)||(n=Math.pow(10,p),E=Math.ceil(E*n)/n),"ticks"===u?(r=Math.floor(_/E)*E,a=Math.ceil(w/E)*E):(r=_,a=w),k&&S&&f&&(o=(h-d)/f,l=E/1e3,(s=Math.round(o))-l<=o&&s+l>=o)?(E=(h-d)/(i=Math.round(Math.min((h-d)/E,m))),r=d,a=h):O?E=((a=S?h:a)-(r=k?d:r))/(i=v-1):i=iu(i=(a-r)/E,Math.round(i),E/1e3)?Math.round(i):Math.ceil(i);var A=Math.max(fu(E),fu(r));n=Math.pow(10,Ec(p)?A:p),r=Math.round(r*n)/n,a=Math.round(a*n)/n;var C=0;for(k&&(g&&r!==d?(c.push({value:d}),r<d&&C++,iu(Math.round((r+C*E)*n)/n,d,Uv(d,j,e))&&C++):r<d&&C++);C<i;++C){var D=Math.round((r+C*E)*n)/n;if(S&&D>h)break;c.push({value:D})}return S&&g&&a!==h?c.length&&iu(c[c.length-1].value,h,Uv(h,j,e))?c[c.length-1].value=h:c.push({value:h}):S&&a!==h||c.push({value:a}),c}({maxTicks:n=Math.max(2,n),bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&su(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}},{key:"configure",value:function(){var e=this.ticks,t=this.min,r=this.max;if(md(kd(n.prototype),"configure",this).call(this),this.options.offset&&e.length){var a=(r-t)/Math.max(e.length-1,1)/2;t-=a,r+=a}this._startValue=t,this._endValue=r,this._valueRange=r-t}},{key:"getLabelForValue",value:function(e){return Vu(e,this.chart.options.locale,this.options.ticks.format)}}]),n}(lp),qv=function(e){gd(n,e);var t=xd(n);function n(){return Pd(this,n),t.apply(this,arguments)}return Rd(n,[{key:"determineDataLimits",value:function(){var e=this.getMinMax(!0),t=e.min,n=e.max;this.min=Dc(t)?t:0,this.max=Dc(n)?n:1,this.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){var e=this.isHorizontal(),t=e?this.width:this.height,n=cu(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,a.lineHeight/r))}},{key:"getPixelForValue",value:function(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}},{key:"getValueForPixel",value:function(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}]),n}(Gv);Od(qv,"id","linear"),Od(qv,"defaults",{ticks:{callback:$u.formatters.numeric}});var Zv=function(e){return Math.floor(ru(e))},Kv=function(e,t){return Math.pow(10,Zv(e)+t)};function Xv(e){return 1==e/Math.pow(10,Zv(e))}function Jv(e,t,n){var r=Math.pow(10,n),a=Math.floor(e/r);return Math.ceil(t/r)-a}var Qv=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this,e)).start=void 0,r.end=void 0,r._startValue=void 0,r._valueRange=0,r}return Rd(n,[{key:"parse",value:function(e,t){var n=Gv.prototype.parse.apply(this,[e,t]);if(0!==n)return Dc(n)&&n>0?n:null;this._zero=!0}},{key:"determineDataLimits",value:function(){var e=this.getMinMax(!0),t=e.min,n=e.max;this.min=Dc(t)?Math.max(0,t):null,this.max=Dc(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Dc(this._userMin)&&(this.min=t===Kv(this.min,0)?Kv(this.min,-1):Kv(this.min,0)),this.handleTickRangeOptions()}},{key:"handleTickRangeOptions",value:function(){var e=this.getUserBounds(),t=e.minDefined,n=e.maxDefined,r=this.min,a=this.max,i=function(e){return r=t?r:e},o=function(e){return a=n?a:e};r===a&&(r<=0?(i(1),o(10)):(i(Kv(r,-1)),o(Kv(a,1)))),r<=0&&i(Kv(a,-1)),a<=0&&o(Kv(r,1)),this.min=r,this.max=a}},{key:"buildTicks",value:function(){var e=this.options,t=function(e,t){var n=t.min,r=t.max;n=Pc(e.min,n);for(var a=[],i=Zv(n),o=function(e,t){for(var n=Zv(t-e);Jv(e,t,n)>10;)n++;for(;Jv(e,t,n)<10;)n--;return Math.min(n,Zv(e))}(n,r),l=o<0?Math.pow(10,Math.abs(o)):1,s=Math.pow(10,o),c=i>o?Math.pow(10,i):0,u=Math.round((n-c)*l)/l,f=Math.floor((n-c)/s/10)*s*10,d=Math.floor((u-f)/Math.pow(10,o)),h=Pc(e.min,Math.round((c+f+d*Math.pow(10,o))*l)/l);h<r;)a.push({value:h,major:Xv(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(d=2,l=++o>=0?1:l),h=Math.round((c+f+d*Math.pow(10,o))*l)/l;var p=Pc(e.max,h);return a.push({value:p,major:Xv(p),significand:d}),a}({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&su(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}},{key:"getLabelForValue",value:function(e){return void 0===e?"0":Vu(e,this.chart.options.locale,this.options.ticks.format)}},{key:"configure",value:function(){var e=this.min;md(kd(n.prototype),"configure",this).call(this),this._startValue=ru(e),this._valueRange=ru(this.max)-ru(e)}},{key:"getPixelForValue",value:function(e){return void 0!==e&&0!==e||(e=this.min),null===e||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(ru(e)-this._startValue)/this._valueRange)}},{key:"getValueForPixel",value:function(e){var t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}]),n}(lp);function em(e){var t=e.ticks;if(t.display&&e.display){var n=bf(t.backdropPadding);return Mc(t.font&&t.font.size,Zu.font.size)+n.height}return 0}function tm(e,t,n,r,a){return e===r||e===a?{start:t-n/2,end:t+n/2}:e<r||e>a?{start:t-n,end:t}:{start:t,end:t+n}}function nm(e,t,n,r,a){var i=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),l=0,s=0;r.start<t.l?(l=(t.l-r.start)/i,e.l=Math.min(e.l,t.l-l)):r.end>t.r&&(l=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+l)),a.start<t.t?(s=(t.t-a.start)/o,e.t=Math.min(e.t,t.t-s)):a.end>t.b&&(s=(a.end-t.b)/o,e.b=Math.max(e.b,t.b+s))}function rm(e,t,n){var r,a,i,o=e.drawingArea,l=n.extra,s=n.additionalAngle,c=n.padding,u=n.size,f=e.getPointPosition(t,o+l+c,s),d=Math.round(uu(vu(f.angle+eu))),h=function(e,t,n){return 90===n||270===n?e-=t/2:(n>270||n<90)&&(e-=t),e}(f.y,u.h,d),p=function(e){return 0===e||180===e?"center":e<180?"left":"right"}(d),v=(r=f.x,a=u.w,"right"===(i=p)?r-=a:"center"===i&&(r-=a/2),r);return{visible:!0,x:f.x,y:h,textAlign:p,left:v,top:h,right:v+u.w,bottom:h+u.h}}function am(e,t){if(!t)return!0;var n=e.left,r=e.top,a=e.right,i=e.bottom;return!(nf({x:n,y:r},t)||nf({x:n,y:i},t)||nf({x:a,y:r},t)||nf({x:a,y:i},t))}function im(e,t,n){var r=n.left,a=n.top,i=n.right,o=n.bottom,l=t.backdropColor;if(!Ec(l)){var s=gf(t.borderRadius),c=bf(t.backdropPadding);e.fillStyle=l;var u=r-c.left,f=a-c.top,d=i-r+c.width,h=o-a+c.height;Object.values(s).some((function(e){return 0!==e}))?(e.beginPath(),df(e,{x:u,y:f,w:d,h,radius:s}),e.fill()):e.fillRect(u,f,d,h)}}function om(e,t,n,r){var a=e.ctx;if(n)a.arc(e.xCenter,e.yCenter,t,0,Kc);else{var i=e.getPointPosition(0,t);a.moveTo(i.x,i.y);for(var o=1;o<r;o++)i=e.getPointPosition(o,t),a.lineTo(i.x,i.y)}}Od(Qv,"id","logarithmic"),Od(Qv,"defaults",{ticks:{callback:$u.formatters.logarithmic,major:{enabled:!0}}});var lm=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this,e)).xCenter=void 0,r.yCenter=void 0,r.drawingArea=void 0,r._pointLabels=[],r._pointLabelItems=[],r}return Rd(n,[{key:"setDimensions",value:function(){var e=this._padding=bf(em(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}},{key:"determineDataLimits",value:function(){var e=this.getMinMax(!1),t=e.min,n=e.max;this.min=Dc(t)&&!isNaN(t)?t:0,this.max=Dc(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){return Math.ceil(this.drawingArea/em(this.options))}},{key:"generateTickLabels",value:function(e){var t=this;Gv.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((function(e,n){var r=Ic(t.options.pointLabels.callback,[e,n],t);return r||0===r?r:""})).filter((function(e,n){return t.chart.getDataVisibility(n)}))}},{key:"fit",value:function(){var e=this.options;e.display&&e.pointLabels.display?function(e){for(var t,n,r,a={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},i=Object.assign({},a),o=[],l=[],s=e._pointLabels.length,c=e.options.pointLabels,u=c.centerPointLabels?Zc/s:0,f=0;f<s;f++){var d=c.setContext(e.getPointLabelContext(f));l[f]=d.padding;var h=e.getPointPosition(f,e.drawingArea+l[f],u),p=xf(d.font),v=(t=e.ctx,n=p,r=Ac(r=e._pointLabels[f])?r:[r],{w:Xu(t,n.string,r),h:r.length*n.lineHeight});o[f]=v;var m=vu(e.getIndexAngle(f)+u),y=Math.round(uu(m));nm(i,a,m,tm(y,h.x,v.w,0,180),tm(y,h.y,v.h,90,270))}e.setCenterPoint(a.l-i.l,i.r-a.r,a.t-i.t,i.b-a.b),e._pointLabelItems=function(e,t,n){for(var r,a=[],i=e._pointLabels.length,o=e.options,l=o.pointLabels,s=l.centerPointLabels,c=l.display,u={extra:em(o)/2,additionalAngle:s?Zc/i:0},f=0;f<i;f++){u.padding=n[f],u.size=t[f];var d=rm(e,f,u);a.push(d),"auto"===c&&(d.visible=am(d,r),d.visible&&(r=d))}return a}(e,o,l)}(this):this.setCenterPoint(0,0,0,0)}},{key:"setCenterPoint",value:function(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}},{key:"getIndexAngle",value:function(e){return vu(e*(Kc/(this._pointLabels.length||1))+cu(this.options.startAngle||0))}},{key:"getDistanceFromCenterForValue",value:function(e){if(Ec(e))return NaN;var t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}},{key:"getValueForDistanceFromCenter",value:function(e){if(Ec(e))return NaN;var t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}},{key:"getPointLabelContext",value:function(e){var t=this._pointLabels||[];if(e>=0&&e<t.length){var n=t[e];return function(e,t,n){return wf(e,{label:n,index:t,type:"pointLabel"})}(this.getContext(),e,n)}}},{key:"getPointPosition",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getIndexAngle(e)-eu+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}},{key:"getPointPositionForValue",value:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}},{key:"getBasePosition",value:function(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}},{key:"getPointLabelPosition",value:function(e){var t=this._pointLabelItems[e];return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}},{key:"drawBackground",value:function(){var e=this.options,t=e.backgroundColor,n=e.grid.circular;if(t){var r=this.ctx;r.save(),r.beginPath(),om(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}},{key:"drawGrid",value:function(){var e,t,n,r=this,a=this.ctx,i=this.options,o=i.angleLines,l=i.grid,s=i.border,c=this._pointLabels.length;if(i.pointLabels.display&&function(e,t){for(var n=e.ctx,r=e.options.pointLabels,a=t-1;a>=0;a--){var i=e._pointLabelItems[a];if(i.visible){var o=r.setContext(e.getPointLabelContext(a));im(n,o,i);var l=xf(o.font),s=i.x,c=i.y,u=i.textAlign;ff(n,e._pointLabels[a],s,c+l.lineHeight/2,l,{color:o.color,textAlign:u,textBaseline:"middle"})}}}(this,c),l.display&&this.ticks.forEach((function(e,n){if(0!==n){t=r.getDistanceFromCenterForValue(e.value);var a=r.getContext(n),i=l.setContext(a),o=s.setContext(a);!function(e,t,n,r,a){var i=e.ctx,o=t.circular,l=t.color,s=t.lineWidth;!o&&!r||!l||!s||n<0||(i.save(),i.strokeStyle=l,i.lineWidth=s,i.setLineDash(a.dash),i.lineDashOffset=a.dashOffset,i.beginPath(),om(e,n,o,r),i.closePath(),i.stroke(),i.restore())}(r,i,t,c,o)}})),o.display){for(a.save(),e=c-1;e>=0;e--){var u=o.setContext(this.getPointLabelContext(e)),f=u.color,d=u.lineWidth;d&&f&&(a.lineWidth=d,a.strokeStyle=f,a.setLineDash(u.borderDash),a.lineDashOffset=u.borderDashOffset,t=this.getDistanceFromCenterForValue(i.ticks.reverse?this.min:this.max),n=this.getPointPosition(e,t),a.beginPath(),a.moveTo(this.xCenter,this.yCenter),a.lineTo(n.x,n.y),a.stroke())}a.restore()}}},{key:"drawBorder",value:function(){}},{key:"drawLabels",value:function(){var e=this,t=this.ctx,n=this.options,r=n.ticks;if(r.display){var a,i,o=this.getIndexAngle(0);t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((function(o,l){if(0!==l||n.reverse){var s=r.setContext(e.getContext(l)),c=xf(s.font);if(a=e.getDistanceFromCenterForValue(e.ticks[l].value),s.showLabelBackdrop){t.font=c.string,i=t.measureText(o.label).width,t.fillStyle=s.backdropColor;var u=bf(s.backdropPadding);t.fillRect(-i/2-u.left,-a-c.size/2-u.top,i+u.width,c.size+u.height)}ff(t,o.label,0,-a,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}})),t.restore()}}},{key:"drawTitle",value:function(){}}]),n}(Gv);Od(lm,"id","radialLinear"),Od(lm,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:$u.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:function(e){return e},padding:5,centerPointLabels:!1}}),Od(lm,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Od(lm,"descriptors",{angleLines:{_fallback:"grid"}});var sm={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},cm=Object.keys(sm);function um(e,t){return e-t}function fm(e,t){if(Ec(t))return null;var n=e._adapter,r=e._parseOpts,a=r.parser,i=r.round,o=r.isoWeekday,l=t;return"function"==typeof a&&(l=a(l)),Dc(l)||(l="string"==typeof a?n.parse(l,a):n.parse(l)),null===l?null:(i&&(l="week"!==i||!lu(o)&&!0!==o?n.startOf(l,i):n.startOf(l,"isoWeek",o)),+l)}function dm(e,t,n,r){for(var a=cm.length,i=cm.indexOf(e);i<a-1;++i){var o=sm[cm[i]],l=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(l*o.size))<=r)return cm[i]}return cm[a-1]}function hm(e,t,n){if(n){if(n.length){var r=bu(n,t),a=r.lo,i=r.hi;e[n[a]>=t?n[a]:n[i]]=!0}}else e[t]=!0}function pm(e,t,n){var r,a,i=[],o={},l=t.length;for(r=0;r<l;++r)o[a=t[r]]=r,i.push({value:a,major:!1});return 0!==l&&n?function(e,t,n,r){var a,i,o=e._adapter,l=+o.startOf(t[0].value,r),s=t[t.length-1].value;for(a=l;a<=s;a=+o.add(a,1,r))(i=n[a])>=0&&(t[i].major=!0);return t}(e,i,o,n):i}var vm=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this,e))._cache={data:[],labels:[],all:[]},r._unit="day",r._majorUnit=void 0,r._offsets={},r._normalized=!1,r._parseOpts=void 0,r}return Rd(n,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.time||(e.time={}),a=this._adapter=new ph._date(e.adapters.date);a.init(t),Vc(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},md(kd(n.prototype),"init",this).call(this,e),this._normalized=t.normalized}},{key:"parse",value:function(e,t){return void 0===e?null:fm(this,e)}},{key:"beforeLayout",value:function(){md(kd(n.prototype),"beforeLayout",this).call(this),this._cache={data:[],labels:[],all:[]}}},{key:"determineDataLimits",value:function(){var e=this.options,t=this._adapter,n=e.time.unit||"day",r=this.getUserBounds(),a=r.min,i=r.max,o=r.minDefined,l=r.maxDefined;function s(e){o||isNaN(e.min)||(a=Math.min(a,e.min)),l||isNaN(e.max)||(i=Math.max(i,e.max))}o&&l||(s(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||s(this.getMinMax(!1))),a=Dc(a)&&!isNaN(a)?a:+t.startOf(Date.now(),n),i=Dc(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(a,i-1),this.max=Math.max(a+1,i)}},{key:"_getLabelBounds",value:function(){var e=this.getLabelTimestamps(),t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}},{key:"buildTicks",value:function(){var e=this.options,t=e.time,n=e.ticks,r="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);var a=this.min,i=function(e,t,n){for(var r=0,a=e.length;r<a&&e[r]<t;)r++;for(;a>r&&e[a-1]>n;)a--;return r>0||a<e.length?e.slice(r,a):e}(r,a,this.max);return this._unit=t.unit||(n.autoSkip?dm(t.minUnit,this.min,this.max,this._getLabelCapacity(a)):function(e,t,n,r,a){for(var i=cm.length-1;i>=cm.indexOf(n);i--){var o=cm[i];if(sm[o].common&&e._adapter.diff(a,r,o)>=t-1)return o}return cm[n?cm.indexOf(n):0]}(this,i.length,t.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(e){for(var t=cm.indexOf(e)+1,n=cm.length;t<n;++t)if(sm[cm[t]].common)return cm[t]}(this._unit):void 0,this.initOffsets(r),e.reverse&&i.reverse(),pm(this,i,this._majorUnit)}},{key:"afterAutoSkip",value:function(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((function(e){return+e.value})))}},{key:"initOffsets",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=0,a=0;this.options.offset&&n.length&&(e=this.getDecimalForValue(n[0]),r=1===n.length?1-e:(this.getDecimalForValue(n[1])-e)/2,t=this.getDecimalForValue(n[n.length-1]),a=1===n.length?t:(t-this.getDecimalForValue(n[n.length-2]))/2);var i=n.length<3?.5:.25;r=yu(r,0,i),a=yu(a,0,i),this._offsets={start:r,end:a,factor:1/(r+1+a)}}},{key:"_generate",value:function(){var e,t,n=this._adapter,r=this.min,a=this.max,i=this.options,o=i.time,l=o.unit||dm(o.minUnit,r,a,this._getLabelCapacity(r)),s=Mc(i.ticks.stepSize,1),c="week"===l&&o.isoWeekday,u=lu(c)||!0===c,f={},d=r;if(u&&(d=+n.startOf(d,"isoWeek",c)),d=+n.startOf(d,u?"day":l),n.diff(a,r,l)>1e5*s)throw new Error(r+" and "+a+" are too far apart with stepSize of "+s+" "+l);var h="data"===i.ticks.source&&this.getDataTimestamps();for(e=d,t=0;e<a;e=+n.add(e,s,l),t++)hm(f,e,h);return e!==a&&"ticks"!==i.bounds&&1!==t||hm(f,e,h),Object.keys(f).sort(um).map((function(e){return+e}))}},{key:"getLabelForValue",value:function(e){var t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}},{key:"format",value:function(e,t){var n=this.options.time.displayFormats,r=this._unit,a=t||n[r];return this._adapter.format(e,a)}},{key:"_tickFormatFunction",value:function(e,t,n,r){var a=this.options,i=a.ticks.callback;if(i)return Ic(i,[e,t,n],this);var o=a.time.displayFormats,l=this._unit,s=this._majorUnit,c=l&&o[l],u=s&&o[s],f=n[t],d=s&&u&&f&&f.major;return this._adapter.format(e,r||(d?u:c))}},{key:"generateTickLabels",value:function(e){var t,n,r;for(t=0,n=e.length;t<n;++t)(r=e[t]).label=this._tickFormatFunction(r.value,t,e)}},{key:"getDecimalForValue",value:function(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}},{key:"getPixelForValue",value:function(e){var t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}},{key:"getValueForPixel",value:function(e){var t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}},{key:"_getLabelSize",value:function(e){var t=this.options.ticks,n=this.ctx.measureText(e).width,r=cu(this.isHorizontal()?t.maxRotation:t.minRotation),a=Math.cos(r),i=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:n*a+o*i,h:n*i+o*a}}},{key:"_getLabelCapacity",value:function(e){var t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,a=this._tickFormatFunction(e,0,pm(this,[e],this._majorUnit),r),i=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return o>0?o:1}},{key:"getDataTimestamps",value:function(){var e,t,n=this._cache.data||[];if(n.length)return n;var r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,t=r.length;e<t;++e)n=n.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}},{key:"getLabelTimestamps",value:function(){var e,t,n=this._cache.labels||[];if(n.length)return n;var r=this.getLabels();for(e=0,t=r.length;e<t;++e)n.push(fm(this,r[e]));return this._cache.labels=this._normalized?n:this.normalize(n)}},{key:"normalize",value:function(e){return Su(e.sort(um))}}]),n}(lp);function mm(e,t,n){var r,a,i,o,l=0,s=e.length-1;if(n){if(t>=e[l].pos&&t<=e[s].pos){var c=xu(e,"pos",t);l=c.lo,s=c.hi}var u=e[l];r=u.pos,i=u.time;var f=e[s];a=f.pos,o=f.time}else{if(t>=e[l].time&&t<=e[s].time){var d=xu(e,"time",t);l=d.lo,s=d.hi}var h=e[l];r=h.time,i=h.pos;var p=e[s];a=p.time,o=p.pos}var v=a-r;return v?i+(o-i)*(t-r)/v:i}Od(vm,"id","time"),Od(vm,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});var ym=function(e){gd(n,e);var t=xd(n);function n(e){var r;return Pd(this,n),(r=t.call(this,e))._table=[],r._minPos=void 0,r._tableRange=void 0,r}return Rd(n,[{key:"initOffsets",value:function(){var e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=mm(t,this.min),this._tableRange=mm(t,this.max)-this._minPos,md(kd(n.prototype),"initOffsets",this).call(this,e)}},{key:"buildLookupTable",value:function(e){var t,n,r,a,i,o=this.min,l=this.max,s=[],c=[];for(t=0,n=e.length;t<n;++t)(a=e[t])>=o&&a<=l&&s.push(a);if(s.length<2)return[{time:o,pos:0},{time:l,pos:1}];for(t=0,n=s.length;t<n;++t)i=s[t+1],r=s[t-1],a=s[t],Math.round((i+r)/2)!==a&&c.push({time:a,pos:t/(n-1)});return c}},{key:"_generate",value:function(){var e=this.min,t=this.max,r=md(kd(n.prototype),"getDataTimestamps",this).call(this);return r.includes(e)&&r.length||r.splice(0,0,e),r.includes(t)&&1!==r.length||r.push(t),r.sort((function(e,t){return e-t}))}},{key:"_getTimestampsForTable",value:function(){var e=this._cache.all||[];if(e.length)return e;var t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,this._cache.all=e}},{key:"getDecimalForValue",value:function(e){return(mm(this._table,e)-this._minPos)/this._tableRange}},{key:"getValueForPixel",value:function(e){var t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return mm(this._table,n*this._tableRange+this._minPos,!0)}}]),n}(vm);Od(ym,"id","timeseries"),Od(ym,"defaults",vm.defaults);var gm=["height","width","redraw","datasetIdKey","type","data","options","plugins","fallbackContent","updateMode"];function bm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bm(Object(n),!0).forEach((function(t){_m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wm="label";function km(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function Sm(e,t){e.labels=t}function Om(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wm,r=[];e.datasets=t.map((function(t){var a=e.datasets.find((function(e){return e[n]===t[n]}));return a&&t.data&&!r.includes(a)?(r.push(a),Object.assign(a,t),a):xm({},t)}))}function jm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wm,n={labels:[],datasets:[]};return Sm(n,e.labels),Om(n,e.datasets,t),n}function Em(t,n){var r=t.height,a=void 0===r?150:r,i=t.width,o=void 0===i?300:i,l=t.redraw,s=void 0!==l&&l,c=t.datasetIdKey,u=t.type,f=t.data,d=t.options,h=t.plugins,p=void 0===h?[]:h,v=t.fallbackContent,m=t.updateMode,y=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,gm),g=(0,e.useRef)(null),b=(0,e.useRef)(),x=function(){g.current&&(b.current=new Hp(g.current,{type:u,data:jm(f,c),options:d&&xm({},d),plugins:p}),km(n,b.current))},_=function(){km(n,null),b.current&&(b.current.destroy(),b.current=null)};return(0,e.useEffect)((function(){!s&&b.current&&d&&function(e,t){var n=e.options;n&&t&&Object.assign(n,t)}(b.current,d)}),[s,d]),(0,e.useEffect)((function(){!s&&b.current&&Sm(b.current.config.data,f.labels)}),[s,f.labels]),(0,e.useEffect)((function(){!s&&b.current&&f.datasets&&Om(b.current.config.data,f.datasets,c)}),[s,f.datasets]),(0,e.useEffect)((function(){b.current&&(s?(_(),setTimeout(x)):b.current.update(m))}),[s,d,f.labels,f.datasets,m]),(0,e.useEffect)((function(){b.current&&(_(),setTimeout(x))}),[u]),(0,e.useEffect)((function(){return x(),function(){return _()}}),[]),e.createElement("canvas",Object.assign({ref:g,role:"img",height:a,width:o},y),v)}var Am=(0,e.forwardRef)(Em);function Cm(t,n){return Hp.register(n),(0,e.forwardRef)((function(n,r){return e.createElement(Am,Object.assign({},n,{ref:r,type:t}))}))}var Dm=Cm("line",sh),Pm=Cm("bar",ih),Mm=Cm("pie",uh);const Rm=function(e){var t=e.selectedChartMetrics;return React.createElement(React.Fragment,null,React.createElement("div",{className:"flex h-[19px] justify-between items-center text-[12px] text-grey-1"},t.length>0&&t.length<3&&React.createElement("span",null,Cs[t[0]].label),t.length>1&&t.length<3&&React.createElement("span",null,Cs[t[1]].label)))};var Im=function(e){var t,n=e.num,r=e.decimalPoints,a=void 0===r||r,i=e.showSuffix,o=void 0===i||i,l=e.forceDecimalPlaces,s=void 0!==l&&l,c=["","k","m"],u=0;for(n=null==n?0:n;n>=1e3&&u<c.length-1;)n/=1e3,u++;t=s?2:a?n%1==0?0:1:0;var f=n.toFixed(t);return s||(f=f.replace(/\.0+$/,"")),f+(o?c[u]:"")},Lm=function(e,t){return e=parseFloat(e)||0,0!==(t=parseFloat(t)||0)?parseInt(((e-t)/t*100).toFixed(0)):e>0?1/0:0},Nm=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e===1/0)return"∞";var n=Im({num:e});return n+(t?"%":"")};function Tm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tm(Object(n),!0).forEach((function(t){zm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Vm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vm(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Hp.register(Yv,qv,ev,Jp,ov,ih,sh,Av,$v,jv,wv);var Wm=(0,e.memo)((function(n){var r=n.charts,a=n.selectedChartMetrics,i=Hm((0,e.useState)({selectedMetricsTotalPoints:0,labels:[],datasets:[]}),2),o=i[0],l=i[1],s=Hm((0,e.useState)(!1),2),c=s[0],u=s[1],f=Hm((0,e.useState)(Ps()),2),d=f[0],h=f[1];(0,e.useEffect)((function(){var e=0,t=[];a.map((function(n,i){var o;if(null===(o=Cs[n])||void 0===o||!o.locked){var l=(null==r?void 0:r.data[n])||[],s=l.map((function(e){return e.total}));l.map((function(t){e+=parseFloat(t.total)}));var c={label:n,data:s,borderColor:Cs[n].color,fill:!0,borderWidth:2,pointHoverRadius:5,backgroundColor:function(e){var t=e.chart.ctx.createLinearGradient(0,0,0,400),r=Cs[n].color.replace("#",""),a=parseInt(r.substr(0,2),16),i=parseInt(r.substr(2,2),16),o=parseInt(r.substr(4,2),16);return t.addColorStop(0,"rgba(".concat(a,", ").concat(i,", ").concat(o,", 0.2)")),t.addColorStop(1,"rgba(255, 255, 255, 0)"),t},spanGaps:!0};"revenue"===n?(c.type="bar",c.backgroundColor="#deb77b",c.borderColor=Cs[n].color,c.borderWidth=0,c.fill=!1,c.order=1,c.barThickness=25,c.borderRadius={topLeft:6,topRight:6,bottomLeft:0,bottomRight:0},c.borderSkipped=!1,delete c.backgroundColor,c.backgroundColor="#deb77b"):c.order=2,a.length<=2&&(c.yAxisID="chart-y-axis-"+(i+1)),t.push(c)}})),l({selectedMetricsTotalPoints:e,labels:p(r.labels),datasets:t})}),[r,a]);var p=function(e){return e.map((function(e,t){return e.includes(":")?e:"list"===(null==r?void 0:r.filter)?g()(e).format("DD/MM/YYYY"):"weekly"===(null==r?void 0:r.filter)?g()(e).format("DD/MM/YY"):"monthly"===(null==r?void 0:r.filter)?g()(e).format("MMM YYYY"):g()(e).format("DD/MM/YYYY")}))};(0,e.useEffect)((function(){var e=function(){h(Ps())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var v=function(){var e={x:{ticks:{maxTicksLimit:10,color:"dark"===d?"#fff":"#41495B"},grid:{offset:!0,display:!0,drawBorder:!1,drawOnChartArea:!1,drawTicks:!1,tickLength:0,borderColor:"#d1d2db",color:"#d1d2db"}}},t=null;if(a.length>2)t={y:{border:{display:!1},ticks:{display:!1,beginAtZero:!0,maxTicksLimit:5},grid:{display:!0,drawBorder:!1,showGridLines:!1,drawOnChartArea:!0,borderDashOffset:25,borderColor:"#d1d2db",borderWidth:0,color:"#d1d2db"}}};else{var n={},r={position:"left",display:!0,axis:"y",border:{display:!1},min:0,ticks:{display:!0,beginAtZero:!0,maxTicksLimit:5,color:"dark"===d?"#fff":"#41495B"},title:{display:!1},grid:{display:!0,drawBorder:!1,showGridLines:!1,drawOnChartArea:!0,borderDashOffset:25,borderColor:"#d1d2db",borderWidth:0,color:"#d1d2db"}};1===a.length&&(n["chart-y-axis-1"]=r),2===a.length&&(n["chart-y-axis-1"]=r,n["chart-y-axis-2"]={position:"right",display:!0,axis:"y",border:{display:!1},min:0,ticks:{display:!0,beginAtZero:!0,maxTicksLimit:5,color:"dark"===d?"#fff":"#41495B"},title:{display:!1},grid:{display:!0,drawBorder:!1,showGridLines:!1,drawOnChartArea:!1,borderDashOffset:25,borderColor:"#d1d2db",borderWidth:0,color:"#d1d2db"}}),t=n}return Fm(Fm({},e),t)};(0,e.useEffect)((function(){u(v())}),[]),(0,e.useEffect)((function(){u(v())}),[d,a]);var m={maintainAspectRatio:!1,scales:c,elements:{line:{tension:.3},point:{radius:0}},interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!1},filler:{propagate:!1},tooltip:{backgroundColor:"#343d43",padding:16,titleColor:"#999",bodyFont:{size:14},callbacks:{title:function(e){var t=r.labels[e[0].dataIndex];return t.includes(":")?t:"list"===(null==r?void 0:r.filter)?g()(t).format("dddd, MMM D"):"weekly"===(null==r?void 0:r.filter)?g()(t).format("DD MMM YY")+" "+fbox_admin_js_object.langs.TO+" "+g()(t).add(6,"day").format("DD MMM YY"):t},label:function(e){var t,n,r,a=parseFloat(e.raw),i=e.dataset.label;if(null!==(t=Cs[i])&&void 0!==t&&t.locked)return"";var o=Cs[i].label;"conversionrate"===i&&(a=Im({num:a,decimalPoints:!0})),a=0!==a?a.toLocaleString("en-US"):a;var l=(null===(n=Cs[i])||void 0===n?void 0:n.suffix)||"",s=(null===(r=Cs[i])||void 0===r?void 0:r.prefix)||"";return s?a=s+a:l&&(a+=l)," "+a+" "+o},afterLabel:function(e){var t,n=e.dataset.label;if("revenue"===n&&(null===(t=Cs[n])||void 0===t||!t.locked)&&r.revenue_breakdown){var a,i=(null===(a=fbox_admin_js_object)||void 0===a?void 0:a.revenue_attribution_currency)||"$",o=r.labels[e.dataIndex],l=r.revenue_breakdown[o];if(l){var s=l.view_through_revenue,c=l.conversion_through_revenue,u=[];if(s>0){var f=s.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});u.push("View-Through: ".concat(i).concat(f))}if(c>0){var d=c.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});u.push("Conversion-Through: ".concat(i).concat(d))}return u}}return[]}}}}};return t().createElement("div",{className:"flex flex-col gap-2 flex-grow justify-between"},0===o.labels.length?t().createElement(Ms,null):t().createElement(t().Fragment,null,t().createElement("div",null,t().createElement(Rm,{selectedChartMetrics:a}),t().createElement("div",{className:"relative"},t().createElement("div",null,t().createElement(Am,{type:"line",data:o,options:m,plugins:[{afterDatasetsDraw:function(e){var t,n,r;if(null!=e&&null!==(t=e.tooltip)&&void 0!==t&&t._active&&null!=e&&null!==(n=e.tooltip)&&void 0!==n&&null!==(r=n._active)&&void 0!==r&&r.length){var a=e.scales["chart-y-axis-1"]?"chart-y-axis-1":"y",i=e.tooltip._active[0],o=e.ctx,l=i.element.x,s=e.scales[a].top,c=e.scales[a].bottom;o.save(),o.beginPath(),o.moveTo(l,s),o.lineTo(l,c),o.setLineDash([1,1]),o.lineWidth=2,o.strokeStyle="#a1a1a1",o.stroke(),o.restore()}}}],key:Date.now(),style:{maxWidth:"100%"},height:336})),0===o.selectedMetricsTotalPoints&&t().createElement("div",{className:"w-full flex flex-col items-center gap-2 justify-center absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 dark:text-white"},t().createElement("svg",{width:"81",height:"80",viewBox:"0 0 81 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t().createElement("circle",{cx:"41.5",cy:"40",r:"36",fill:"#D1D4F4"}),t().createElement("path",{opacity:"0.2",fillRule:"evenodd",clipRule:"evenodd",d:"M27.0432 7.01953C40.1252 7.54876 50.5683 18.3215 50.5683 31.5333C50.5683 37.589 48.3743 43.1323 44.7379 47.4116L46.8613 49.5349C47.9768 49.001 49.354 49.1962 50.2782 50.1204L66.2755 66.1177C64.3226 67.9708 62.1621 69.6072 59.8324 70.9883L44.6213 55.7772C43.6983 54.8541 43.5025 53.4792 44.0339 52.3645L41.9092 50.2398C37.6304 53.8746 32.0884 56.0675 26.0342 56.0675C17.7197 56.0675 10.3712 51.9315 5.93383 45.6047C5.64824 43.7781 5.5 41.9059 5.5 39.9992C5.5 38.3617 5.60933 36.7497 5.82108 35.1702C7.53793 44.7761 15.9346 52.0675 26.0342 52.0675C37.3749 52.0675 46.5683 42.874 46.5683 31.5333C46.5683 20.1926 37.3749 10.9992 26.0342 10.9992C23.2676 10.9992 20.6289 11.5463 18.2202 12.5382C20.8611 10.2972 23.8294 8.43036 27.0432 7.01953Z",fill:"#41495B"}),t().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.9373 43.4396C41.7184 42.6586 42.9847 42.6586 43.7658 43.4396L57.9079 57.5817C58.689 58.3628 58.689 59.6291 57.9079 60.4102C57.1269 61.1912 55.8605 61.1912 55.0795 60.4101L40.9373 46.268C40.1563 45.487 40.1563 44.2206 40.9373 43.4396Z",fill:"#41495B"}),t().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M61.6675 69.8244L44.6209 52.7777C43.4493 51.6061 43.4493 49.7067 44.6209 48.5351L46.0351 47.1209C47.2067 45.9493 49.1061 45.9493 50.2777 47.1209L67.7705 64.6136C65.939 66.5676 63.892 68.3172 61.6675 69.8244Z",fill:"#F5CE81"}),t().createElement("path",{d:"M48.5683 28.5342C48.5683 40.9794 38.4794 51.0683 26.0342 51.0683C13.5889 51.0683 3.5 40.9794 3.5 28.5342C3.5 16.0889 13.5889 6 26.0342 6C38.4794 6 48.5683 16.0889 48.5683 28.5342Z",fill:"#F4F5FE"}),t().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.0342 8C14.6935 8 5.5 17.1935 5.5 28.5342C5.5 39.8749 14.6935 49.0683 26.0342 49.0683C37.3749 49.0683 46.5683 39.8749 46.5683 28.5342C46.5683 17.1935 37.3749 8 26.0342 8ZM1.5 28.5342C1.5 14.9843 12.4843 4 26.0342 4C39.584 4 50.5683 14.9843 50.5683 28.5342C50.5683 42.084 39.584 53.0683 26.0342 53.0683C12.4843 53.0683 1.5 42.084 1.5 28.5342Z",fill:"#050931"}),t().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26 14C17.9919 14 11.5 20.4919 11.5 28.5C11.5 29.6046 10.6046 30.5 9.5 30.5C8.39543 30.5 7.5 29.6046 7.5 28.5C7.5 18.2827 15.7827 10 26 10C27.1046 10 28 10.8954 28 12C28 13.1046 27.1046 14 26 14Z",fill:"white"})),t().createElement("div",null,fbox_admin_js_object.langs.NO," ",a.map((function(e){return Cs[e].label})).join(", ")," ",fbox_admin_js_object.langs.DATA_AVAILABLE,"."))))))}));const $m=Wm;var Bm=(0,e.memo)((function(t){var n=t.isLoading,r=t.filter,a=t.performanceChartFiltersItems,i=t.showChartFiltersDropdown,o=t.setShowChartFiltersDropdown,l=t.toggleIsOpen,s=t.selectFilter,c=(0,e.useRef)("Performance_dropdownRef");return os(c,(function(){o(!1)})),(Object.keys(a).length>0||i)&&!n&&React.createElement("div",{className:"relative dark:text-grey-3",ref:c},React.createElement("span",{className:"inline-flex items-center cursor-pointer hover:text-black dark:hover:text-white",onClick:l},Rs[r],React.createElement(ls,{className:i?"rotate-180":""})),i&&React.createElement("div",{className:"absolute z-20 top-full text-base right-0 rounded-[4px] shadow-box bg-white dark:bg-[#343d43] flex flex-col"},Object.keys(a).map((function(e,t){return React.createElement("div",{key:t,className:"p-1 pr-2 cursor-pointer ".concat(r===e?"pointer-events-none bg-pale-blue dark:bg-white dark:text-black":"bg-white hover:bg-pale-blue dark:bg-transparent dark:hover:bg-pale-blue dark:hover:text-black"),onClick:function(){return s(e)}},a[e])}))))}));const Ym=Bm;var Um=function(e){return e||"__all_templates__"},Gm=(0,e.memo)((function(e){var t=e.children,n=e.fontSize,r=void 0===n?"text-[12px]":n,a=e.size,i=void 0===a?"w-[150px]":a,o=e.textAlign,l=void 0===o?"text-center":o,s=e.padding,c=void 0===s?"p-1":s,u=e.top,f=void 0===u?"top-[calc(100%+8px)]":u,d=e.className,h=void 0===d?"":d;return React.createElement("div",{className:"absolute opacity-0 -z-10 pointer-events-none ".concat(f," group-hover:opacity-100 group-hover:z-30 group-hover:pointer-events-auto shadow-lg ").concat(l," bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 ").concat(c," rounded text-gray-800 dark:text-white ").concat(r," ").concat(i).concat(""!==h?" "+h:" left-1/2 translate-x-[-50%]")},t)}));const qm=Gm;function Zm(){return Zm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zm.apply(this,arguments)}function Km(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Xm=function(n){var r,a,i=n.upgradePlan,o=void 0===i?"":i,l=n.feature,s=void 0===l?"":l,c=n.className,u=void 0===c?"":c,f=n.label,d=void 0===f?"":f,h=n.size,p=void 0===h?"text-[12px]":h,v=n.showLabel,m=void 0!==v&&v,y=n.iconSize,g=void 0===y?10:y,b=n.disableHoverReveal,x=void 0!==b&&b,_=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Km(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Km(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(!1),2),w=_[0],k=_[1],S="fpf-modal-opener inline-flex cursor-pointer items-center gap-0 rounded-full border border-amber-200 bg-amber-50 px-1.5 py-0.5 font-medium leading-none text-amber-700 z-10 ".concat(p),O=u?"".concat(S," ").concat(u):"relative ".concat(S),j="Available in ".concat(o," plan"),E={"data-fpf-modal":"#fireboxUpgradeToPlan","data-fpf-modal-item":s,"data-current-plan":(null===(r=fbox_admin_js_object)||void 0===r?void 0:r.license_plan)||(null===(a=fbox_admin_js_object)||void 0===a?void 0:a.license_type)||"basic","data-upgrade-plan":o};return t().createElement("span",Zm({className:O,"aria-label":"Locked • ".concat(j),title:j},E,{onMouseEnter:function(){return k(!0)},onMouseLeave:function(){return k(!1)}}),t().createElement("svg",{width:g,height:g,viewBox:"0 0 24 24",className:"fill-current","aria-hidden":"true",focusable:"false"},t().createElement("path",{d:"M6 10V8a6 6 0 1112 0v2h1a1 1 0 011 1v9a1 1 0 01-1 1H5a1 1 0 01-1-1v-9a1 1 0 011-1h1zm2 0h8V8a4 4 0 10-8 0v2z"})),d||o?m?t().createElement("span",{className:"pl-1"},d||o):t().createElement("span",{className:"overflow-hidden whitespace-nowrap transition-all duration-200 ease-out ".concat(!x&&w?"pl-1 max-w-[10rem] opacity-100":"pl-0 max-w-0 opacity-0")},d||o):null)},Jm=function(e){var t,n,r,a=e.slug,i=e.lockedPlan,o=e.numberClass,l=e.label,s=e.value,c=e.previousPeriodValue,u=e.prefix,f=void 0===u?"":u,d=e.suffix,h=void 0===d?"":d,p=e.formatSuffix,v=e.decimalPoints,m=void 0===v||v,y=e.tooltipMessage,g=e.showCheckbox,b=void 0!==g&&g,x=e.isSelected,_=void 0!==x&&x,w=e.onToggle,k=e.isClickable,S=void 0!==k&&k,O=function(){return React.createElement(React.Fragment,null,Im({num:s,showSuffix:p,decimalPoints:m}),null!=h?h:"")},j=(t=parseFloat(s)||0,0===(n=parseFloat(c)||0)?t>0?100:null:(t-n)/n*100);return React.createElement("div",{className:"flex flex-col"},React.createElement("div",{className:"flex items-center gap-[4px] relative".concat(S?" cursor-pointer":""),onClick:S?w:void 0},b&&React.createElement("div",{className:"".concat(S?"":"opacity-50 cursor-not-allowed")},React.createElement("div",{className:"w-[16px] h-[16px] flex-shrink-0 border border-solid rounded flex items-center justify-center transition-all ".concat(_?"".concat(function(){var e="";switch(a){case"views":e="bg-metric-views";break;case"clicks":e="bg-metric-clicks";break;case"conversions":e="bg-metric-conversions";break;case"conversionrate":e="bg-metric-conversion-rate";break;case"revenue":e="bg-metric-revenue"}return e}()," border-transparent"):"bg-white dark:bg-dark-1 border-gray-400 hover:border-gray-700")},_&&React.createElement("svg",{width:"10",height:"7",viewBox:"0 0 12 9",fill:"none",className:"text-white"},React.createElement("path",{d:"M1 4.5L4 7.5L11 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))),React.createElement("span",{className:"flex gap-[4px] text-sm text-gray-700 dark:text-gray-200 relative"},React.createElement("span",{className:"group/metriclabel"},l,y&&React.createElement("div",{className:"cursor-default",onClick:function(e){return!i&&e.stopPropagation()},onMouseDown:function(e){return!i&&e.stopPropagation()},onMouseUp:function(e){return!i&&e.stopPropagation()}},React.createElement(qm,{size:"w-[300px]",fontSize:"text-[14px]",textAlign:"text-left",padding:"p-2",top:"top-full",className:"left-0 right-auto translate-x-0 hidden group-hover/metriclabel:flex flex-col"},y))),i&&React.createElement(Xm,{feature:l,upgradePlan:i,disableHoverReveal:!0}))),React.createElement("div",{className:"font-bold mt-1 text-gray-900 dark:text-white".concat(o?" "+o:""),style:{fontSize:"26px",lineHeight:"1.2"},title:(r=new Intl.NumberFormat("en-US",{style:"decimal",minimumFractionDigits:m?2:0,maximumFractionDigits:m?2:0}).format(s||0),(null!=f?f:"")+r+(null!=h?h:""))},null!=e&&e.formatNumberLayout?e.formatNumberLayout({num:s,suffix:h,showSuffix:p,decimalPoints:m,defaultLayout:O}):O()),null!==j&&React.createElement("div",{className:"flex items-center gap-[4px] font-medium ".concat(j>=0?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),style:{fontSize:"12px"}},React.createElement("span",null,j>=0?"+":"",j.toFixed(1),"%"),j>=0?React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",class:"w-[12px] h-[12px] text-green-500 dark:text-green-600 rotate-180","stroke-width":"2"},React.createElement("path",{"fill-rule":"evenodd",d:"M8 2a.75.75 0 0 1 .75.75v8.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.22 3.22V2.75A.75.75 0 0 1 8 2Z","clip-rule":"evenodd"})):React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",class:"w-[12px] h-[12px] text-red-500 dark:text-red-700 ","stroke-width":"2"},React.createElement("path",{"fill-rule":"evenodd",d:"M8 2a.75.75 0 0 1 .75.75v8.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.22 3.22V2.75A.75.75 0 0 1 8 2Z","clip-rule":"evenodd"}))))};var Qm=["overall"];function ey(){return ey=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ey.apply(this,arguments)}var ty=(0,e.memo)((function(e){var t=e.overall,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,Qm);return React.createElement(Jm,ey({label:fbox_admin_js_object.langs.VIEWS,value:t.current.views||0,previousPeriodValue:t.previous.views||0,tooltipMessage:React.createElement(React.Fragment,null,React.createElement("div",null,fbox_admin_js_object.langs.VIEWS_TOOLTIP_DESC),React.createElement("div",{className:"mt-1"},React.createElement("a",{href:"https://www.fireplugins.com/docs/analytics/analytics/?utm_source=source&utm_campaign=firebox-".concat("lite"===fbox_admin_js_object.license_type?"free":"pro","&utm_content=misc&utm_medium=analytics-views#Views"),target:"_blank",className:"text-[#888] no-underline font-semibold hover:text-dark-1 dark:hover:text-white"},fbox_admin_js_object.langs.READ_MORE.toUpperCase()))),slug:"views"},n))}));const ny=ty;var ry=["overall"];function ay(){return ay=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ay.apply(this,arguments)}var iy=(0,e.memo)((function(e){var t=e.overall,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,ry);return React.createElement(Jm,ay({label:fbox_admin_js_object.langs.CONVERSIONS,value:t.current.conversions||0,previousPeriodValue:t.previous.conversions||0,tooltipMessage:React.createElement(React.Fragment,null,React.createElement("div",null,fbox_admin_js_object.langs.CONVERSIONS_TOOLTIP_DESC),React.createElement("div",{className:"mt-1"},React.createElement("a",{href:"https://www.fireplugins.com/docs/analytics/analytics/?utm_source=source&utm_campaign=firebox-".concat("lite"===fbox_admin_js_object.license_type?"free":"pro","&utm_content=misc&utm_medium=analytics-conversions#Conversions"),target:"_blank",className:"text-[#888] no-underline font-semibold hover:text-dark-1 dark:hover:text-white"},fbox_admin_js_object.langs.READ_MORE.toUpperCase()))),slug:"conversions"},n))}));const oy=iy;var ly=["overall"];function sy(){return sy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sy.apply(this,arguments)}var cy=(0,e.memo)((function(e){var t=e.overall,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,ly);return React.createElement(Jm,sy({label:"CVR",value:t.current.conversionrate||fbox_admin_js_object.langs["N/A"],previousPeriodValue:t.previous.conversionrate||0,formatNumberLayout:function(e){var t,n,r,a=e.num;return e.suffix,e.showSuffix,e.decimalPoints,e.defaultLayout,a===fbox_admin_js_object.langs["N/A"]?fbox_admin_js_object.langs["N/A"]:(n=Im({num:t=a,showSuffix:!1,decimalPoints:!0})+"%",r=Im({num:t,showSuffix:!1,decimalPoints:!0})+"%",React.createElement("span",{title:r},n))},suffix:"%",formatSuffix:!1,tooltipMessage:React.createElement(React.Fragment,null,React.createElement("div",null,fbox_admin_js_object.langs.CONVERSION_RATE_TOOLTIP_DESC),React.createElement("div",{className:"mt-1"},React.createElement("a",{href:"https://www.fireplugins.com/docs/analytics/analytics/?utm_source=source&utm_campaign=firebox-".concat("lite"===fbox_admin_js_object.license_type?"free":"pro","&utm_content=misc&utm_medium=analytics-conversion-rate#Conversion-Rate"),target:"_blank",className:"text-[#888] no-underline font-semibold hover:text-dark-1 dark:hover:text-white"},fbox_admin_js_object.langs.READ_MORE.toUpperCase()))),slug:"conversionrate"},n))}));const uy=cy;function fy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fy(Object(n),!0).forEach((function(t){hy(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function py(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||vy(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vy(e,t){if(e){if("string"==typeof e)return my(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?my(e,t):void 0}}function my(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var yy={labels:[],data:{views:[],clicks:[],conversions:[],conversionrate:[],revenue:[]},days_between:null};const gy=function(){var n,r,a,i,o=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},l=py((0,e.useState)([]),2),s=l[0],c=l[1],f=py((0,e.useState)(!0),2),d=f[0],h=f[1],v=py((0,e.useState)(!1),2),m=v[0],y=v[1],g=py((0,e.useState)(!1),2),b=g[0],x=g[1],_=py((0,e.useState)(Rs),2),w=_[0],k=_[1],S=py((0,e.useState)(!1),2),O=S[0],j=S[1],E=py((0,e.useState)("list"),2),A=E[0],C=E[1],D=py((0,e.useState)((null==o?void 0:o.performanceFilters)||["views"]),2),P=D[0],M=D[1],R=py((0,e.useState)(yy),2),I=R[0],L=R[1],N=py((0,e.useState)({current:{},previous:{}}),2),T=N[0],F=N[1],z=p(),H=z.components,V=(z.loading,t().createRef()),W=u(),$=W.date_period,B=W.custom_date_period,Y=W.selected_campaign,U=["views","clicks","conversions","conversionrate","revenue"],G=function(){var e,t,n=cs($,B),r=n.start_date,a=n.end_date,i=Math.round((Date.parse(a)-Date.parse(r))/864e5);if(i<30?(k([]),C("list")):k(i<90?{list:fbox_admin_js_object.langs.DAILY,weekly:fbox_admin_js_object.langs.WEEKLY}:Rs),!["today","custom"].includes($)&&null!=s&&null!==(e=s[Um(Y)])&&void 0!==e&&null!==(t=e[$])&&void 0!==t&&t[A]){var o=s[Um(Y)][$][A];return L(o.chartData),F(o.overallData),x(!1),void h(!1)}var l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_charts_data"),l.append("start_date",r),l.append("end_date",a),l.append("selected_campaign",Y),l.append("filter",A);var u=new FormData;u.append("nonce",fpf_js_object.nonce),u.append("action","firebox_analytics_stats"),u.append("date_period",$),u.append("start_date",r),u.append("end_date",a),u.append("selected_campaign",Y),Promise.all([fetch(fpf_js_object.ajax_url,{method:"POST",body:l}).then((function(e){return e.json()})),fetch(fpf_js_object.ajax_url,{method:"POST",body:u}).then((function(e){return e.json()}))]).then((function(e){var t=py(e,2),n=t[0],r=t[1],a=n,o=r;Object.keys(a.data).map((function(e){a.data[e]=1===i?js(a.labels,a.data[e]):Os(a.labels,a.data[e])})),a.filter=A,L(a),F(o),x(!1),h(!1),["today","custom"].includes($)||c((function(e){var t,n=Um(Y);return dy(dy({},e),{},hy({},n,dy(dy({},e[n]),{},hy({},$,dy(dy({},null===(t=e[n])||void 0===t?void 0:t[$]),{},hy({},A,{chartData:a,overallData:o}))))))}))}))};is((function(){G(),y(!0)}),V),(0,e.useEffect)((function(){m&&(h(!0),G())}),[Y,A]),(0,e.useEffect)((function(){m&&"custom"===$&&(2===B.length&&(null===B[0]||null===B[1])||(h(!0),G()))}),[B]),(0,e.useEffect)((function(){m&&"custom"!==$&&(h(!0),G())}),[$]);var q,Z=(0,e.useCallback)((function(e){if(U.includes(e)){var t=function(e){return function(e){if(Array.isArray(e))return my(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||vy(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(P),n=t.indexOf(e);-1!==n?t.splice(n,1):t.push(e);var r=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};r.performanceFilters=t,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(r)),0!==t.length&&M(t)}}),[P,U]),K=(0,e.useCallback)((function(){j((function(e){return!e}))}),[]),X=(0,e.useCallback)((function(e){j(!1),x(!0),C(e)}),[A]),J=(0,e.useCallback)((function(e){U.includes(e)&&Z(e)}),[Z,U]);return t().createElement("div",{ref:V,className:"relative group flex flex-col gap-3 bg-white dark:bg-dark-1 rounded p-3 h-auto"},t().createElement("div",{className:"flex flex-wrap items-start divide-solid"},(q=function(){var e,n;if(d&&(null==s||null===(e=s[Um(Y)])||void 0===e||null===(n=e[$])||void 0===n||!n[A]))return t().createElement("div",{className:"flex flex-wrap gap-3"},Array.from({length:7},(function(e,n){return t().createElement("div",{key:"skeleton-".concat(n),className:"flex flex-col gap-1"},t().createElement("div",{className:"flex items-center gap-[4px]"},t().createElement("div",{className:"animate-pulse h-[16px] w-[16px] bg-slate-200 dark:bg-slate-700 rounded-sm"}),t().createElement("div",{className:"animate-pulse h-[16px] w-16 bg-slate-200 dark:bg-slate-700 rounded"})),t().createElement("div",{className:"animate-pulse h-3 w-12 bg-slate-200 dark:bg-slate-700 rounded"}),t().createElement("div",{className:"animate-pulse h-2 w-8 bg-slate-200 dark:bg-slate-700 rounded"}))})));var r=[];return r.push(t().createElement(ny,{key:"views",overall:T,showCheckbox:!0,isSelected:P.includes("views"),onToggle:function(){return J("views")},isClickable:!0})),null!=H&&H.Revenue&&r.push(t().createElement(H.Revenue,{key:"revenue",overall:T,showCheckbox:!0,isSelected:P.includes("revenue"),onToggle:function(){return J("revenue")}})),null!=H&&H.Clicks&&r.push(t().createElement(H.Clicks,{key:"clicks",overall:T,showCheckbox:!0,isSelected:P.includes("clicks"),onToggle:function(){return J("clicks")}})),r.push(t().createElement(oy,{key:"conversions",overall:T,showCheckbox:!0,isSelected:P.includes("conversions"),onToggle:function(){return J("conversions")},isClickable:!0})),r.push(t().createElement(uy,{key:"conversionrate",overall:T,showCheckbox:!0,isSelected:P.includes("conversionrate"),onToggle:function(){return J("conversionrate")},isClickable:!0})),null!=H&&H.ViewThroughRevenue&&r.push(t().createElement(H.ViewThroughRevenue,{key:"view_through_revenue",overall:T})),null!=H&&H.ClickThroughRevenue&&r.push(t().createElement(H.ClickThroughRevenue,{key:"conversion_through_revenue",overall:T})),r.map((function(e,n){return t().createElement("div",{key:n,className:"".concat(n>0?"pl-3 ml-3 border-l border-t-0 border-r-0 border-b-0 border-gray-200 dark:border-gray-600":"")},e)}))}(),q)),t().createElement("div",{className:"flex flex-col gap-3"},t().createElement(Ym,{isLoading:d,filter:A,performanceChartFiltersItems:w,showChartFiltersDropdown:O,setShowChartFiltersDropdown:j,toggleIsOpen:K,selectFilter:X}),(!d||null!=s&&null!==(n=s[Um(Y)])&&void 0!==n&&null!==(r=n[$])&&void 0!==r&&r[A])&&(!b||null!=s&&null!==(a=s[Um(Y)])&&void 0!==a&&null!==(i=a[$])&&void 0!==i&&i[A])?t().createElement($m,{charts:I,selectedChartMetrics:P}):t().createElement(Ms,null)))};function by(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xy(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _y=(0,e.createContext)(),wy=function(n){var r=n.children,a=by((0,e.useState)({current:{views:null,conversions:null,conversionrate:null,revenue:null,view_through_revenue:null,conversion_through_revenue:null},previous:{views:null,conversions:null,conversionrate:null,revenue:null,view_through_revenue:null,conversion_through_revenue:null}}),2),i=a[0],o=a[1],l=by((0,e.useState)(!0),2),s=l[0],c=l[1];return t().createElement(_y.Provider,{value:{overallData:i,setOverallData:o,isLoading:s,setIsLoading:c}},r)};const ky=(0,e.memo)((function(){var e=u().campaign;return React.createElement("div",{className:"group relative bg-white dark:bg-dark-1 rounded p-3 flex flex-col gap-3 dark:text-white"},React.createElement("div",{className:"flex gap-1 justify-between"},React.createElement("h2",{className:"text-[20px] text-default dark:text-white"},fbox_admin_js_object.langs.CAMPAIGN_INFO),e&&React.createElement("a",{href:fbox_admin_js_object.campaigns_item_edit_url.replace("{{ID}}",e.ID),className:"inline-flex text-base items-center gap-1 underline text-accent hover:text-accent-hover dark:text-grey-1 dark:hover:text-white"},fbox_admin_js_object.langs.EDIT_CAMPAIGN)),!1===e?React.createElement("div",{className:"flex flex-grow items-center justify-center text-sm text-default dark:text-grey-1"},fbox_admin_js_object.langs.NO_DATA_AVAILABLE):null===e?React.createElement("div",{className:"flex flex-col gap-2"},React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"})):React.createElement("div",{className:"grid grid-rows-6 flex-grow max-h-[256px] gap-2"},React.createElement("div",{className:"flex justify-between items-center gap-1"},React.createElement("span",null,fbox_admin_js_object.langs.STATUS,":"),React.createElement("span",{className:"".concat("publish"===e.post_status?"text-custom-green font-bold":"text-grey-1")},"publish"===e.post_status?fbox_admin_js_object.langs.ACTIVE:fbox_admin_js_object.langs.DISABLED)),React.createElement("div",{className:"flex justify-between items-center gap-1"},React.createElement("span",null,fbox_admin_js_object.langs.CREATED,":"),React.createElement("span",null,g()(e.post_date).format("ddd. D MMM YYYY, HH:mm"))),React.createElement("div",{className:"flex justify-between items-center gap-1"},React.createElement("span",null,fbox_admin_js_object.langs.LAST_VIEWED,":"),React.createElement("span",null,null!=e&&e.last_date_viewed?g()(e.last_date_viewed).format("ddd. D MMM YYYY, HH:mm"):fbox_admin_js_object.langs["N/A"])),React.createElement("div",{className:"flex justify-between items-center gap-1"},React.createElement("span",null,fbox_admin_js_object.langs.ID,":"),React.createElement("span",null,e.ID))))})),Sy=function(){return React.createElement("div",{className:"flex gap-1 flex-grow flex-wrap-reverse overflow-hidden"},React.createElement("div",{className:"animate-pulse w-2 h-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-4 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-0 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-1/2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-6 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-5 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-0 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-4 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-4 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-0 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-1/2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-6 bg-slate-200 dark:bg-slate-700 rounded"}))};function Oy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Hp.register(Yv,qv,ov,Av,$v,jv);var jy=(0,e.memo)((function(t){var n=t.labels,r=t.data,a=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Oy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oy(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(Ps()),2),i=a[0],o=a[1];(0,e.useEffect)((function(){var e=function(){o(Ps())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var l={maintainAspectRatio:!1,scales:{x:{ticks:{color:"dark"===i?"#fff":"#41495B",maxTicksLimit:9},grid:{drawBorder:!1,display:!1},border:{display:!1}},y:{ticks:{maxTicksLimit:5,display:!1,beginAtZero:!0},grid:{color:"dark"===i?"#E1E1E1":"#d1d2db",drawBorder:!1,display:!0},border:{display:!1}}},interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!1},tooltip:{backgroundColor:"#343d43",padding:16,titleColor:"#999",bodyFont:{size:14},callbacks:{label:function(e){var t=parseFloat(e.raw),n=Cs.views.label;return" "+(t=0!==t?t.toLocaleString("en-US"):t)+" "+n}}}}},s={labels:n,datasets:[{data:r,borderRadius:8,backgroundColor:"#5383EC"}]},c=(null==r?void 0:r.reduce((function(e,t){return e+t}),0))||0;return React.createElement(React.Fragment,null,null!==r?React.createElement("div",{className:"relative"},React.createElement(Pm,{options:l,data:s,key:Date.now(),height:256}),0===c&&React.createElement("div",{className:"absolute z-10 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-center text-default dark:text-white text-sm"},fbox_admin_js_object.langs.NO_DATA_AVAILABLE)):React.createElement(Sy,null))}));const Ey=jy;function Ay(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cy=(0,e.memo)((function(t){var n=t.isLoading,r=void 0!==n&&n,a=t.filter,i=t.setFilterHandler,o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ay(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ay(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(!1),2),l=o[0],s=o[1],c=(0,e.useRef)("Filters_PopularViewTimes");os(c,(function(){s(!1)}));var u={all_days:fbox_admin_js_object.langs.ALL_DAYS,monday:fbox_admin_js_object.langs.MONDAY,tuesday:fbox_admin_js_object.langs.TUESDAY,wednesday:fbox_admin_js_object.langs.WEDNESDAY,thursday:fbox_admin_js_object.langs.THURSDAY,friday:fbox_admin_js_object.langs.FRIDAY,saturday:fbox_admin_js_object.langs.SATURDAY,sunday:fbox_admin_js_object.langs.SUNDAY};return React.createElement("div",{ref:c,className:"relative dark:text-grey-3".concat(r?" pointer-events-none opacity-50":""),onClick:function(){return s(!l)}},React.createElement("div",{className:"inline-flex items-center cursor-pointer hover:text-black dark:hover:text-white text-black dark:text-white"},u[a],React.createElement(ls,null)),l&&React.createElement("div",{className:"absolute z-20 text-base top-full right-0 rounded-[4px] shadow-box bg-white dark:bg-[#343d43] flex flex-col"},Object.keys(u).map((function(e,t){return React.createElement("div",{key:t,onClick:function(){return i(e)},className:"p-1 pr-2 cursor-pointer ".concat(a===e?"pointer-events-none bg-pale-blue dark:bg-white dark:text-black":"bg-white hover:bg-pale-blue dark:bg-transparent dark:hover:bg-pale-blue dark:hover:text-black")},u[e])}))))}));const Dy=Cy,Py=function(e){var t=e.className,n=void 0===t?"":t;return React.createElement("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24"},React.createElement("path",{d:"M252.309-100.001q-29.923 0-51.115-21.193-21.193-21.192-21.193-51.115v-375.382q0-29.923 21.193-51.115 21.192-21.193 51.115-21.193h47.692v-80q0-74.922 52.538-127.46Q405.078-879.997 480-879.997t127.461 52.538q52.538 52.538 52.538 127.46v80h47.692q29.923 0 51.115 21.193 21.193 21.192 21.193 51.115v375.382q0 29.923-21.193 51.115-21.192 21.193-51.115 21.193H252.309Zm0-59.999h455.382q5.385 0 8.847-3.462 3.462-3.462 3.462-8.847v-375.382q0-5.385-3.462-8.847-3.462-3.462-8.847-3.462H252.309q-5.385 0-8.847 3.462-3.462 3.462-3.462 8.847v375.382q0 5.385 3.462 8.847 3.462 3.462 8.847 3.462ZM480-290.001q29.154 0 49.576-20.423 20.423-20.422 20.423-49.576t-20.423-49.576Q509.154-429.999 480-429.999t-49.576 20.423Q410.001-389.154 410.001-360t20.423 49.576q20.422 20.423 49.576 20.423ZM360-619.999h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80ZM240-160v-400 400Z",fill:"currentColor"}))},My=function(e){var t=e.className,n=void 0===t?"":t;return React.createElement("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24"},React.createElement("path",{d:"M252.309-619.999H600v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85h-59.999q0-74.922 52.538-127.46Q405.078-879.997 480-879.997t127.461 52.538q52.538 52.538 52.538 127.46v80h47.692q29.923 0 51.115 21.193 21.193 21.192 21.193 51.115v375.382q0 29.923-21.193 51.115-21.192 21.193-51.115 21.193H252.309q-29.923 0-51.115-21.193-21.193-21.192-21.193-51.115v-375.382q0-29.923 21.193-51.115 21.192-21.193 51.115-21.193Zm0 459.999h455.382q5.385 0 8.847-3.462 3.462-3.462 3.462-8.847v-375.382q0-5.385-3.462-8.847-3.462-3.462-8.847-3.462H252.309q-5.385 0-8.847 3.462-3.462 3.462-3.462 8.847v375.382q0 5.385 3.462 8.847 3.462 3.462 8.847 3.462ZM480-290.001q29.154 0 49.576-20.423 20.423-20.422 20.423-49.576t-20.423-49.576Q509.154-429.999 480-429.999t-49.576 20.423Q410.001-389.154 410.001-360t20.423 49.576q20.422 20.423 49.576 20.423ZM240-160v-400 400Z",fill:"currentColor"}))},Ry=function(e){var t=e.label,n=e.type,r=void 0===n?"":n,a=e.currentPlan,i=void 0===a?fbox_admin_js_object.license_plan:a,o=e.upgradePlan,l=void 0===o?fbox_admin_js_object.langs.PRO:o,s=e.className,c=void 0===s?"":s,u="text-grey-1 hover:text-custom-red",f="fpfUpgradeToPro";return"upgrade"===r&&(u="bg-custom-red hover:bg-custom-red-dark text-white py-1.5 px-3 font-bold flex rounded",f="fireboxUpgradeToPlan"),React.createElement("a",{href:"#",className:"group/icon shadow-none outline-none inline-flex items-center justify-center gap-1 no-underline ".concat(u," fpf-modal-opener").concat(c?" "+c:""),"data-fpf-modal":"#".concat(f),"data-fpf-modal-item":t,"data-current-plan":i[0].toUpperCase()+i.slice(1),"data-upgrade-plan":l},wp.i18n.sprintf(fbox_admin_js_object.langs.UPGRADE_TO_X,l),React.createElement(Py,{className:"inline-flex group-hover/icon:hidden","aria-hidden":"true"}),React.createElement(My,{className:"hidden group-hover/icon:inline-flex","aria-hidden":"true"}))};function Iy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ly(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Iy(Object(n),!0).forEach((function(t){Ny(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ny(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ty(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Fy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fy(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const zy=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Ty((0,e.useState)([]),2),r=n[0],a=n[1],i=Ty((0,e.useState)(!1),2),o=i[0],l=i[1],s=Ty((0,e.useState)(!1),2),c=s[0],f=s[1],d=Ty((0,e.useState)(null),2),h=d[0],p=d[1],v=Ty((0,e.useState)((null==t?void 0:t.viewHoursFilter)||"all_days"),2),m=v[0],y=v[1],g=Ty((0,e.useState)(function(){for(var e=[],t=0;t<=23;t++){var n=t.toString().padStart(2,"0");e.push("".concat(n,":00"))}return e}()),2),b=g[0],x=(g[1],Ty((0,e.useState)(0),2)),_=x[0],w=x[1],k=u(),S=k.date_period,O=k.custom_date_period,j=k.selected_campaign,E=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.viewHoursFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),y(e)}),[m]),A=function(e){var t,n;if(!["today","custom"].includes(S)&&null!=r&&null!==(t=r[Um(j)])&&void 0!==t&&null!==(n=t[S])&&void 0!==n&&n[m])return p(r[Um(j)][S][m]),l(!1),void(e&&e());var i=cs(S,O),o=i.start_date,s=i.end_date,c=Math.round((Date.parse(s)-Date.parse(o))/864e5);w(c);var u=new FormData;if(u.append("nonce",fpf_js_object.nonce),u.append("action","firebox_analytics_get_popular_view_items"),u.append("start_date",o),u.append("end_date",s),u.append("campaign",j),"all_days"!==m){var f=!1;switch(m){case"monday":f=0;break;case"tuesday":f=1;break;case"wednesday":f=2;break;case"thursday":f=3;break;case"friday":f=4;break;case"saturday":f=5;break;case"sunday":f=6}(f||0===f)&&u.append("weekday",f)}fetch(fpf_js_object.ajax_url,{method:"POST",body:u}).then((function(e){return e.json()})).then((function(t){var n=t;if(null==t||!t.pro){var r=js(b,t);n=(null==r?void 0:r.map((function(e){return e.total})))||[]}p(n),l(!1),["today","custom"].includes(S)||a((function(e){var t;return Ly(Ly({},e),{},Ny({},Um(j),Ly(Ly({},e[Um(j)]),{},Ny({},S,Ly(Ly({},null===(t=e[Um(j)])||void 0===t?void 0:t[S]),{},Ny({},m,n))))))})),l(!1),e&&e()}))},C=React.createRef();return is((function(){A(),f(!0)}),C),(0,e.useEffect)((function(){c&&(null!=h&&h.pro||(l(!0),A()))}),[j,m]),(0,e.useEffect)((function(){c&&"custom"===S&&(2===O.length&&(null===O[0]||null===O[1])||null!=h&&h.pro||(l(!0),A()))}),[O]),(0,e.useEffect)((function(){c&&"custom"!==S&&(null!=h&&h.pro||(l(!0),A()))}),[S]),React.createElement("div",{className:"relative flex flex-col gap-3 justify-between bg-white dark:bg-dark-1 rounded p-3",ref:C},React.createElement("div",{className:"flex gap-3 justify-between items-center"},React.createElement("h2",{className:"text-[20px] text-default dark:text-white"},fbox_admin_js_object.langs.VIEW_HOURS),!(null!=h&&h.pro)&&null!==h&&_>1&&React.createElement(Dy,{isLoading:o,filter:m,setFilterHandler:E})),null!=h&&h.pro?React.createElement(Ry,{label:fbox_admin_js_object.langs.VIEW_HOURS,className:"flex-grow"}):null!==h&&o&&c?React.createElement(Sy,null):React.createElement(Ey,{labels:b,data:h}))};function Hy(e,t){if(e){if("string"==typeof e)return Vy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vy(e,t):void 0}}function Vy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Hp.register(Bp,$v,jv);const Wy=function(t){var n=t.labelIsEvent,r=void 0!==n&&n,a=t.metricConfig,i=t.data,o=t.showPieLegends,l=function(e){return function(e){if(Array.isArray(e))return Vy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Hy(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(i);l=l.splice(0,30);var s=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||Hy(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(Ps()),2),c=s[0],u=s[1],f=l.map((function(e){return e.label})),d=["#83D2FF","#FF83CD","#B983FF","#FFB983","#83FFB9"];(0,e.useEffect)((function(){var e=function(){u(Ps())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var h={labels:f,datasets:[{data:l.map((function(e){return e.total})),backgroundColor:d}]},p={maintainAspectRatio:!1,plugins:{legend:{display:o,labels:{usePointStyle:!0,color:"dark"===c?"#fff":"#41495B"},position:"bottom"},tooltip:{backgroundColor:"#343d43",padding:16,titleColor:"#999",bodyFont:{size:14},callbacks:{label:function(e){var t=Im({num:parseFloat(e.raw),decimalPoints:(null==a?void 0:a.decimalPoints)||!1,forceDecimalPlaces:(null==a?void 0:a.forceDecimalPlaces)||!1}),n=r?e.label:(null==a?void 0:a.label)||"";t=0!==t?t.toLocaleString("en-US"):t;var i=(null==a?void 0:a.suffix)||"",o=(null==a?void 0:a.prefix)||"";return o?t=o+t:i&&(t+=i)," "+t+" "+n}}}}};return React.createElement(Mm,{className:"self-center",data:h,options:p,width:210,height:210,key:Date.now()})},$y=function(e){var t=e.labelLayout,n=void 0===t?null:t,r=e.data,a=e.metricConfig;return r.map((function(e,t){var r,i,o=e.label||fbox_admin_js_object.langs["N/A"],l=null!=e&&e.full_label?e.full_label:o,s=parseFloat(e.total)||0,c=null!==(r=null==a?void 0:a.suffix)&&void 0!==r?r:"",u=null!==(i=null==a?void 0:a.prefix)&&void 0!==i?i:"",f="";null!=a&&a.showTitleWithSuffix&&(f=Im({num:s})+c);var d=Im({num:s,decimalPoints:(null==a?void 0:a.decimalPoints)||!1,forceDecimalPlaces:(null==a?void 0:a.forceDecimalPlaces)||!1}),h=d;return u?h=u+d:c&&(h=d+c),React.createElement("div",{key:t,className:"flex items-center justify-between gap-2"},n?n(e):React.createElement("div",{className:"truncate",title:l},o),React.createElement("div",{className:"font-bold ".concat((null==a?void 0:a.colorClass)||""),title:f},h))}))};function By(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Yy=function(t){var n=t.metricConfig,r=t.data,a=t.height,i=void 0===a?220:a,o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return By(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?By(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(Ps()),2),l=o[0],s=o[1],c=r.map((function(e){return e.label})),u=r.map((function(e){return e.total}));(0,e.useEffect)((function(){var e=function(){s(Ps())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var f={maintainAspectRatio:!1,barThickness:25,scales:{x:{ticks:{color:"dark"===l?"#fff":"#41495B",maxTicksLimit:7},grid:{drawBorder:!1,display:!1},border:{display:!1}},y:{ticks:{maxTicksLimit:4,display:!1,beginAtZero:!0},grid:{color:"dark"===l?"#E1E1E1":"#d1d2db",drawBorder:!1,display:!0},border:{display:!1}}},interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!1},tooltip:{backgroundColor:"#343d43",padding:16,titleColor:"#999",bodyFont:{size:14},callbacks:{label:function(e){var t=Im({num:parseFloat(e.raw),decimalPoints:(null==n?void 0:n.decimalPoints)||!1,forceDecimalPlaces:(null==n?void 0:n.forceDecimalPlaces)||!1}),r=(null==n?void 0:n.label)||"",a=(null==n?void 0:n.suffix)||"",i=(null==n?void 0:n.prefix)||"";return t=0!==t?t.toLocaleString("en-US"):t,i?t=i+t:a&&(t+=a)," "+t+" "+r}}}}},d={labels:c,datasets:[{data:u,borderRadius:8,backgroundColor:"#5383EC"}]},h=(null==r?void 0:r.reduce((function(e,t){return e+t}),0))||0;return React.createElement("div",{className:"relative"},React.createElement(Pm,{options:f,data:d,key:Date.now(),height:i}),0===h&&React.createElement("div",{className:"absolute z-10 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-center text-default dark:text-white text-sm"},fbox_admin_js_object.langs.NO_DATA_AVAILABLE))};function Uy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uy(Object(n),!0).forEach((function(t){qy(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Zy=(0,e.memo)((function(e){var t,n,r,a,i=e.labelIsEvent,o=void 0!==i&&i,l=e.labelLayout,s=e.label,c=e.showMetricLabel,u=void 0===c||c,f=e.data,d=e.filter,h=e.chartType,p=e.showPieLegends,v=void 0===p||p,m=(null===(t=f[d])||void 0===t||null===(n=t.map((function(e){return parseFloat(e.total)})))||void 0===n?void 0:n.reduce((function(e,t){return e+t}),0))||0,y=Gy(Gy({},Cs[d]),{},{decimalPoints:"conversionrate"===d||"revenue"===d,forceDecimalPlaces:"revenue"===d,showTitleWithSuffix:"conversionrate"===d});return React.createElement("div",{className:"flex flex-col gap-3 flex-grow max-h-[256px]"},"list"===h||u?React.createElement("div",{className:"flex gap-3 text-xs text-grey-1 ".concat("pie"===h?"justify-center":"justify-between")},"list"===h&&React.createElement("div",null,s),u&&React.createElement("div",{className:"list"!==h?"flex flex-grow justify-center":""},null==Cs||null===(r=Cs[d])||void 0===r?void 0:r.label)):"",!m||m<0?React.createElement("div",{className:"text-center py-5 text-sm dark:text-grey-1 flex items-center justify-center flex-grow"},fbox_admin_js_object.langs.NO_DATA_AVAILABLE):"pie"===h?React.createElement("div",null,React.createElement(Wy,{metricConfig:y,data:f[d],labelIsEvent:o,showPieLegends:v})):"bar"===h?React.createElement(Yy,{metricConfig:y,data:f[d]}):React.createElement("div",{className:"fpframework-custom-scrollbar"},React.createElement("div",{className:"flex flex-col gap-[20px] flex-grow dark:text-white overscroll-contain"},React.createElement($y,{labelLayout:l,data:f[d],metricConfig:y}),30===(null===(a=f[d])||void 0===a?void 0:a.length)&&React.createElement("div",{className:"text-sm text-center text-gray-400 dark:text-grey-1"},fbox_admin_js_object.langs.SHOWING_TOP_30_RESULTS))))}));const Ky=Zy,Xy=function(){return React.createElement("svg",{className:"hover:text-black dark:text-white",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("mask",{id:"mask0_511_3087",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},React.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),React.createElement("g",{mask:"url(#mask0_511_3087)"},React.createElement("path",{d:"M9.69245 21.5L9.31168 18.4538C9.04373 18.3641 8.76905 18.2384 8.48763 18.0769C8.20621 17.9153 7.9546 17.7422 7.7328 17.5576L4.91165 18.7499L2.604 14.75L5.04438 12.9058C5.0213 12.757 5.00495 12.6077 4.99533 12.4577C4.98571 12.3077 4.9809 12.1583 4.9809 12.0096C4.9809 11.8673 4.98571 11.7227 4.99533 11.5759C5.00495 11.4291 5.0213 11.2686 5.04438 11.0942L2.604 9.24998L4.91165 5.26925L7.72318 6.45195C7.96421 6.26092 8.22159 6.08623 8.4953 5.9279C8.76904 5.76955 9.03795 5.6423 9.30205 5.54615L9.69245 2.5H14.3078L14.6885 5.55578C14.9885 5.66474 15.26 5.79198 15.503 5.9375C15.7459 6.08302 15.9911 6.2545 16.2386 6.45195L19.0886 5.26925L21.3962 9.24998L18.9174 11.123C18.9533 11.2846 18.9728 11.4355 18.976 11.5759C18.9792 11.7163 18.9808 11.8577 18.9808 12C18.9808 12.1359 18.9776 12.274 18.9712 12.4144C18.9648 12.5548 18.9417 12.7154 18.902 12.8962L21.3616 14.75L19.0539 18.7499L16.2386 17.548C15.9911 17.7455 15.7386 17.9201 15.4809 18.0721C15.2232 18.224 14.959 18.348 14.6885 18.4442L14.3078 21.5H9.69245ZM12.0116 15C12.8437 15 13.5517 14.708 14.1357 14.124C14.7196 13.54 15.0116 12.832 15.0116 12C15.0116 11.1679 14.7196 10.4599 14.1357 9.87595C13.5517 9.29198 12.8437 9 12.0116 9C11.1693 9 10.4588 9.29198 9.87993 9.87595C9.3011 10.4599 9.01168 11.1679 9.01168 12C9.01168 12.832 9.3011 13.54 9.87993 14.124C10.4588 14.708 11.1693 15 12.0116 15ZM12.0116 13.5C11.595 13.5 11.2408 13.3541 10.9491 13.0625C10.6575 12.7708 10.5116 12.4166 10.5116 12C10.5116 11.5833 10.6575 11.2291 10.9491 10.9375C11.2408 10.6458 11.595 10.5 12.0116 10.5C12.4283 10.5 12.7825 10.6458 13.0741 10.9375C13.3658 11.2291 13.5116 11.5833 13.5116 12C13.5116 12.4166 13.3658 12.7708 13.0741 13.0625C12.7825 13.3541 12.4283 13.5 12.0116 13.5ZM11.0001 20H12.9655L13.3251 17.3211C13.8354 17.1878 14.3017 16.9984 14.7241 16.7529C15.1466 16.5074 15.5539 16.1917 15.9463 15.8058L18.4309 16.85L19.4155 15.15L17.2463 13.5154C17.3296 13.2564 17.3863 13.0025 17.4165 12.7538C17.4466 12.5051 17.4616 12.2538 17.4616 12C17.4616 11.7397 17.4466 11.4884 17.4165 11.2461C17.3863 11.0038 17.3296 10.7564 17.2463 10.5038L19.4347 8.84998L18.4501 7.14998L15.9366 8.2096C15.602 7.8519 15.2011 7.53588 14.7338 7.26153C14.2664 6.98716 13.7937 6.79293 13.3155 6.67883L13.0001 3.99998H11.0155L10.6847 6.6692C10.1745 6.78972 9.7033 6.97433 9.27125 7.22305C8.8392 7.47177 8.42703 7.79228 8.03473 8.1846L5.5501 7.14998L4.56548 8.84998L6.7251 10.4596C6.64177 10.6968 6.58344 10.9436 6.5501 11.2C6.51677 11.4564 6.5001 11.7263 6.5001 12.0096C6.5001 12.2699 6.51677 12.525 6.5501 12.775C6.58344 13.025 6.63856 13.2718 6.71548 13.5154L4.56548 15.15L5.5501 16.85L8.0251 15.8C8.40459 16.1897 8.81035 16.509 9.2424 16.7577C9.67445 17.0064 10.152 17.1974 10.6751 17.3308L11.0001 20Z",fill:"currentColor"})))};var Jy=["feature","upgradePlan","currentPlan","className","as","dataAttrs","children"];function Qy(){return Qy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qy.apply(this,arguments)}function eg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eg(Object(n),!0).forEach((function(t){ng(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ng(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rg=function(e){var n,r,a,i,o=e.feature,l=e.upgradePlan,s=e.currentPlan,c=e.className,u=void 0===c?"":c,f=e.as,d=void 0===f?"div":f,h=e.dataAttrs,p=e.children,v=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,Jy),m=l||(null===globalThis||void 0===globalThis||null===(n=globalThis.fbox_admin_js_object)||void 0===n||null===(r=n.langs)||void 0===r?void 0:r.PRO)||"Pro",y=tg(tg({},{"data-fpf-modal":"#fireboxUpgradeToPlan","data-fpf-modal-item":o,"data-current-plan":s||(null===globalThis||void 0===globalThis||null===(a=globalThis.fbox_admin_js_object)||void 0===a?void 0:a.license_plan)||(null===globalThis||void 0===globalThis||null===(i=globalThis.fbox_admin_js_object)||void 0===i?void 0:i.license_type)||"basic","data-upgrade-plan":m}),h||{});return t().createElement(d,Qy({className:"fpf-modal-opener ".concat(u)},y,v),p)};function ag(){return ag=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ag.apply(this,arguments)}function ig(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const og=function(t){var n=t.filter,r=t.setFilterHandler,a=t.chartType,i=t.setChartTypeHandler,o=t.chartsFilterable,l=void 0===o||o,s=t.excludeMetrics,c=void 0===s?[]:s,u=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ig(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ig(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(!1),2),f=u[0],d=u[1],h={list:"List",pie:"Pie"},p=(0,e.useRef)("Filters_CountriesSettings");return os(p,(function(){d(!1)})),React.createElement("div",{className:"relative inline-flex",ref:p},React.createElement("div",{onClick:function(){return d(!f)},className:"cursor-pointer inline-flex".concat(f?" text-black":"")},React.createElement(Xy,null)),f&&React.createElement("div",{className:"absolute z-20 text-base top-full w-[150px] right-0 rounded shadow-box bg-white dark:bg-[#343d43] flex flex-col"},React.createElement("div",{className:"flex flex-col text-default cursor-pointer"},Object.keys(Cs).map((function(e,t){var a,i,o,l;if(c.includes(e))return null;var s=!(null===(a=Cs[e])||void 0===a||!a.locked),u="".concat(0===t?"rounded-tl rounded-tr ":"","p-1 text-default ").concat(s?"cursor-pointer opacity-80 hover:opacity-100":"hover:bg-pale-blue dark:hover:bg-[#6b7a84] hover:text-black dark:hover:text-white"),f=e===n?"bg-pale-blue text-black dark:text-black".concat(s?"":" pointer-events-none"):"dark:text-grey-3",h="".concat(u," ").concat(f),p=s?rg:"div",v=s?{feature:(null===(i=Cs[e])||void 0===i?void 0:i.label)||e}:{};return React.createElement(p,ag({key:t,className:h},v,{onClick:function(){if(s)return d(!1);!function(e){r(e),d(!1)}(e)}}),React.createElement("div",{className:"flex items-center justify-between gap-2"},React.createElement("span",null,Cs[e].label),s&&React.createElement(Xm,{feature:Cs[e].label,upgradePlan:null===(o=fbox_admin_js_object)||void 0===o||null===(l=o.langs)||void 0===l?void 0:l.PRO,size:"text-base",iconSize:14,showLabel:!1})))}))),l&&React.createElement("div",{className:"p-[10px] border border-b-0 border-l-0 border-r-0 border-solid border-grey-3"},React.createElement("div",{className:"flex justify-between border border-solid border-grey-3 rounded-2xl bg-grey-4 p-[1px] gap-[2px]"},Object.keys(h).map((function(e,t){return React.createElement("div",{key:t,className:"".concat(a===e?"bg-accent text-white pointer-events-none":"text-grey-1 dark:text-gray-600 hover:bg-pale-blue hover:text:black"," rounded-2xl cursor-pointer px-2 py-[4px]"),onClick:function(){return function(e){i(e),d(!1)}(e)}},h[e])}))))))},lg=function(e){var t=e.chartType,n=void 0===t?"list":t;return React.createElement("div",{className:"flex flex-col gap-1 flex-grow"},"list"===n&&React.createElement("div",{className:"flex justify-between gap-3"},React.createElement("div",{className:"animate-pulse h-1 w-[50px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-1 w-[50px] bg-slate-200 dark:bg-slate-700 rounded"})),"bar"===n&&React.createElement("div",{className:"flex gap-3 flex-grow items-end"},React.createElement("div",{className:"animate-pulse w-8 h-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-5 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-1 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-1/2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-6 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-2 bg-slate-200 dark:bg-slate-700 rounded"})),"bar"!==n&&React.createElement("div",{className:"flex flex-col gap-2"},"list"===n?React.createElement(React.Fragment,null,React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"})):React.createElement("div",{className:"animate-pulse w-[256px] h-[256px] bg-slate-200 dark:bg-slate-700 self-center rounded-full"})))};var sg=(0,e.memo)((function(e){var t=e.labelIsEvent,n=void 0!==t&&t,r=e.boxRef,a=e.labelLayout,i=e.label,o=e.showMetricLabel,l=void 0===o||o,s=e.isLoading,c=e.data,u=e.filter,f=e.setFilterHandler,d=e.chartType,h=e.setChartTypeHandler,p=e.chartsFilterable,v=e.showFiltersDropdown,m=void 0===v||v,y=e.showPieLegends,g=void 0===y||y,b=e.excludeMetrics,x=void 0===b?[]:b;return React.createElement("div",{ref:r,className:"relative bg-white dark:bg-dark-1 rounded flex flex-col gap-3 p-3 h-[356px]"},React.createElement("div",{className:"flex gap-1 justify-between"},React.createElement("h2",{className:"text-[20px] text-default dark:text-white"},i),!(null!=c&&c.pro)&&null!==c&&m&&!s&&React.createElement(og,{excludeMetrics:x,filter:u,setFilterHandler:f,chartType:d,setChartTypeHandler:h,chartsFilterable:p})),null===c?React.createElement(lg,{chartType:d}):null!=c&&c.pro?React.createElement(Ry,{label:i,className:"flex-grow"}):s?React.createElement(lg,{chartType:d}):React.createElement(Ky,{showMetricLabel:l,labelIsEvent:n,labelLayout:a,label:i,data:c,filter:u,chartType:d,showPieLegends:g}))}));const cg=sg;function ug(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fg=React.createElement("svg",{width:"16",height:"16",className:"rounded-full",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M8.00141 16C6.89494 16 5.85491 15.79 4.88132 15.3701C3.90772 14.9502 3.06082 14.3803 2.34064 13.6604C1.62044 12.9405 1.05028 12.094 0.63017 11.1208C0.210057 10.1477 0 9.10788 0 8.00141C0 6.89494 0.209966 5.85491 0.629896 4.88132C1.04983 3.90772 1.61972 3.06082 2.33958 2.34064C3.05946 1.62044 3.90598 1.05028 4.87915 0.630171C5.8523 0.210058 6.89212 0 7.99859 0C9.10506 0 10.1451 0.209966 11.1187 0.629897C12.0923 1.04983 12.9392 1.61972 13.6594 2.33959C14.3796 3.05946 14.9497 3.90598 15.3698 4.87915C15.7899 5.8523 16 6.89212 16 7.99859C16 9.10506 15.79 10.1451 15.3701 11.1187C14.9502 12.0923 14.3803 12.9392 13.6604 13.6594C12.9405 14.3796 12.094 14.9497 11.1208 15.3698C10.1477 15.7899 9.10788 16 8.00141 16ZM7.15789 14.6948V13.0526C6.69473 13.0526 6.29824 12.8877 5.96842 12.5579C5.63859 12.2281 5.47368 11.8316 5.47368 11.3684V10.5263L1.43156 6.48421C1.38946 6.73684 1.35086 6.98947 1.31577 7.2421C1.28068 7.49474 1.26314 7.74737 1.26314 8C1.26314 9.69825 1.82104 11.186 2.93683 12.4632C4.05262 13.7404 5.45964 14.4842 7.15789 14.6948ZM12.9684 12.5474C13.2491 12.2386 13.5018 11.9053 13.7263 11.5474C13.9509 11.1895 14.1369 10.8176 14.2842 10.4316C14.4316 10.0456 14.5439 9.64913 14.6211 9.24211C14.6983 8.83509 14.7369 8.42105 14.7369 8C14.7369 6.62049 14.3557 5.36062 13.5935 4.22041C12.8313 3.08021 11.8089 2.25748 10.5263 1.75222V2.10525C10.5263 2.56841 10.3614 2.9649 10.0316 3.29472C9.70176 3.62455 9.30527 3.78946 8.84211 3.78946H7.15789V5.47368C7.15789 5.71227 7.07719 5.91228 6.91579 6.07368C6.75438 6.23508 6.55438 6.31578 6.31578 6.31578H4.63157V8H9.68421C9.92281 8 10.1228 8.0807 10.2842 8.24211C10.4456 8.40351 10.5263 8.60351 10.5263 8.84211V11.3684H11.3684C11.7333 11.3684 12.0632 11.4772 12.3579 11.6947C12.6526 11.9123 12.8562 12.1965 12.9684 12.5474Z",fill:"currentColor"}));const dg=function(t){var n=t.url,r=t.width,a=void 0===r?16:r,i=t.height,o=void 0===i?16:i,l=t.className,s=void 0===l?"":l,c=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ug(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ug(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(!1),2),u=c[0],f=c[1],d=function(e){try{var t=new URL(e),n=t.hostname.replace(/^www\./,"");return"".concat(t.protocol,"//").concat(n)}catch(e){return!1}}(n);return!d||u?fg:React.createElement("img",{src:"".concat(d,"/favicon.ico"),onError:function(e){e.target.onerror=null,f(!0)},alt:"Favicon",width:a,height:o,className:s})};function hg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hg(Object(n),!0).forEach((function(t){vg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return yg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const gg=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=mg((0,e.useState)([]),2),r=n[0],a=n[1],i=mg((0,e.useState)(!1),2),o=i[0],l=i[1],s=mg((0,e.useState)(!1),2),c=s[0],f=s[1],d=mg((0,e.useState)((null==t?void 0:t.referrersFilter)||"views"),2),h=d[0],p=d[1],v=mg((0,e.useState)("list"),2),m=v[0],y=v[1],g=mg((0,e.useState)(null),2),b=g[0],x=g[1],_=u(),w=_.date_period,k=_.custom_date_period,S=_.selected_campaign,O=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.referrersFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),p(e)}),[h]),j=(0,e.useCallback)((function(e){y(e)}),[m]),E=function(e){var t;if(!["today","custom"].includes(w)&&null!=r&&null!==(t=r[Um(S)])&&void 0!==t&&t[w])return x(r[Um(S)][w]),void f(!1);var n=cs(w,k),i=n.start_date,o=n.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","referrers"),l.append("campaign",S),fetch(fpf_js_object.ajax_url,{method:"POST",body:l}).then((function(e){return e.json()})).then((function(t){x(t),f(!1),["today","custom"].includes(w)||a((function(e){return pg(pg({},e),{},vg({},Um(S),pg(pg({},e[Um(S)]),{},vg({},w,t))))})),e&&e()}))},A=React.createRef();return is((function(){E(),l(!0)}),A,[w,k,S]),(0,e.useEffect)((function(){o&&(null!=b&&b.pro||(f(!0),E()))}),[S]),(0,e.useEffect)((function(){o&&"custom"===w&&(2===k.length&&(null===k[0]||null===k[1])||null!=b&&b.pro||(f(!0),E()))}),[k]),(0,e.useEffect)((function(){o&&"custom"!==w&&(null!=b&&b.pro||(f(!0),E()))}),[w]),React.createElement(cg,{boxRef:A,labelLayout:function(e){var t=e.label||fbox_admin_js_object.langs["N/A"],n=null!=e&&e.full_label?e.full_label:t;return React.createElement("div",{className:"inline-flex items-center gap-[12px] truncate"},React.createElement(dg,{url:n,height:16}),React.createElement("div",{className:"truncate",title:n},t))},label:fbox_admin_js_object.langs.REFERRERS,isLoading:null!==b&&c&&o,data:b,filter:h,setFilterHandler:O,chartType:m,setChartTypeHandler:j,chartsFilterable:!1})},bg=function(){return React.createElement("div",{className:"flex flex-col gap-1"},React.createElement("div",{className:"flex justify-between gap-3"},React.createElement("div",{className:"animate-pulse h-1 w-[50px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"flex gap-1"},React.createElement("div",{className:"animate-pulse h-1 w-[50px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-1 w-[50px] bg-slate-200 dark:bg-slate-700 rounded"}))),React.createElement("div",{className:"flex flex-col gap-2"},React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"})))};function xg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xg(Object(n),!0).forEach((function(t){wg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Sg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Og=function(){var t=kg((0,e.useState)([]),2),n=t[0],r=t[1],a=kg((0,e.useState)(!1),2),i=a[0],o=a[1],l=kg((0,e.useState)(!1),2),s=l[0],c=l[1],f=kg((0,e.useState)(null),2),d=f[0],h=f[1],p=u(),v=p.date_period,m=p.custom_date_period,y=function(e){if(!["today","custom"].includes(v)&&null!=n&&n[v])return h(n[v]),void c(!1);var t=cs(v,m),a=t.start_date,i=t.end_date,o=new FormData;o.append("nonce",fpf_js_object.nonce),o.append("action","firebox_analytics_get_conversions_data"),o.append("start_date",a),o.append("end_date",i),fetch(fpf_js_object.ajax_url,{method:"POST",body:o}).then((function(e){return e.json()})).then((function(t){h(t),["today","custom"].includes(v)||r((function(e){return _g(_g({},e),{},wg({},v,t))})),c(!1),e&&e()}))};(0,e.useEffect)((function(){i&&"custom"===v&&(2===m.length&&(null===m[0]||null===m[1])||null!=d&&d.pro||(c(!0),y()))}),[m]),(0,e.useEffect)((function(){i&&"custom"!==v&&(null!=d&&d.pro||(c(!0),y()))}),[v]);var g=(0,e.useRef)();return is((function(){y(),o(!0)}),g,[v,m]),React.createElement("div",{ref:g,className:"relative bg-white dark:bg-dark-1 rounded flex flex-col gap-3 p-3 h-[356px]"},React.createElement("h2",{className:"text-[20px] text-default dark:text-white"},fbox_admin_js_object.langs.CONVERSIONS),null!=d&&d.pro?React.createElement(Ry,{label:fbox_admin_js_object.langs.CONVERSIONS,className:"flex-grow"}):null===d||s?React.createElement(bg,null):React.createElement("div",{className:"flex flex-col gap-3 flex-grow max-h-[256px]"},React.createElement("div",{className:"flex gap-1 text-xs justify-between text-grey-1"},React.createElement("div",null,fbox_admin_js_object.langs.CAMPAIGN),React.createElement("div",{className:"inline-flex items-center gap-3"},React.createElement("div",{className:"w-[67px]"},fbox_admin_js_object.langs.CONVERSIONS),React.createElement("div",{className:"w-[88px]"},fbox_admin_js_object.langs.CONVERSION_RATE))),React.createElement("div",{className:"fpframework-custom-scrollbar h-full"},React.createElement("div",{className:"flex flex-col gap-[20px] flex-grow dark:text-white overscroll-contain h-full"},d.length>0?React.createElement(React.Fragment,null,d.map((function(e,t){var n=e.title||fbox_admin_js_object.langs["N/A"],r=parseFloat(e.conversions)||0,a=parseFloat(e.conversionrate)||0;return React.createElement("div",{key:t,className:"flex items-center justify-between gap-2"},React.createElement("a",{href:fbox_admin_js_object.campaigns_item_analytics_url.replace("{{ID}}",e.id),title:n,className:"truncate no-underline text-default hover:text-accent dark:text-white dark:hover:text-grey-3 shadow-none outline-none"},n),React.createElement("div",{className:"inline-flex items-center gap-3 text-right"},React.createElement("div",{className:"font-bold ".concat(Cs.conversions.colorClass," w-[67px]")},Im({num:r}),Cs.conversions.suffix||""),React.createElement("div",{className:"font-bold ".concat(Cs.conversionrate.colorClass," w-[88px]")},Im({num:a,decimalPoints:!0}),Cs.conversionrate.suffix||"")))})),30===(null==d?void 0:d.length)&&React.createElement("div",{className:"text-sm text-center text-gray-400 dark:text-grey-1"},fbox_admin_js_object.langs.SHOWING_TOP_30_RESULTS)):React.createElement("div",{className:"text-center py-5 text-sm dark:text-grey-1 flex items-center justify-center flex-grow"},fbox_admin_js_object.langs.NO_DATA_AVAILABLE)))))};function jg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Eg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jg(Object(n),!0).forEach((function(t){Ag(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ag(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Dg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Pg=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Cg((0,e.useState)([]),2),r=n[0],a=n[1],i=Cg((0,e.useState)(!1),2),o=i[0],l=i[1],s=Cg((0,e.useState)(!1),2),c=s[0],f=s[1],d=Cg((0,e.useState)((null==t?void 0:t.countriesFilter)||"views"),2),h=d[0],p=d[1],v=Cg((0,e.useState)("list"),2),m=v[0],y=(v[1],Cg((0,e.useState)(null),2)),g=y[0],b=y[1],x=u(),_=x.date_period,w=x.custom_date_period,k=x.selected_campaign,S=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.countriesFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),p(e)}),[h]),O=function(e){var t;if(!["today","custom"].includes(_)&&null!=r&&null!==(t=r[Um(k)])&&void 0!==t&&t[_])return b(r[Um(k)][_]),void f(!1);var n=cs(_,w),i=n.start_date,o=n.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","countries"),l.append("campaign",k),fetch(fpf_js_object.ajax_url,{method:"POST",body:l}).then((function(e){return e.json()})).then((function(t){b(t),f(!1),["today","custom"].includes(_)||a((function(e){return Eg(Eg({},e),{},Ag({},Um(k),Eg(Eg({},e[Um(k)]),{},Ag({},_,t))))})),e&&e()}))},j=React.createRef();return is((function(){O(),l(!0)}),j,[_,w,k]),(0,e.useEffect)((function(){o&&(null!=g&&g.pro||(f(!0),O()))}),[k]),(0,e.useEffect)((function(){o&&"custom"===_&&(2===w.length&&(null===w[0]||null===w[1])||null!=g&&g.pro||(f(!0),O()))}),[w]),(0,e.useEffect)((function(){o&&"custom"!==_&&(null!=g&&g.pro||(f(!0),O()))}),[_]),React.createElement(cg,{boxRef:j,labelLayout:function(e){return React.createElement("div",{className:"inline-flex items-center gap-1"},(null==e?void 0:e.code)&&React.createElement("img",{width:24,src:fbox_admin_js_object.flags_url.replace("{{FLAG}}",e.code.toLowerCase()),alt:e.label+" "+fbox_admin_js_object.langs.FLAG}),e.label||fbox_admin_js_object.langs["N/A"])},label:fbox_admin_js_object.langs.COUNTRIES,isLoading:null!==g&&c&&o,data:g,filter:h,setFilterHandler:S,chartType:m,chartsFilterable:!1})};function Mg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mg(Object(n),!0).forEach((function(t){Ig(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ig(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ng(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ng(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ng(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Tg=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Lg((0,e.useState)([]),2),r=n[0],a=n[1],i=Lg((0,e.useState)(!1),2),o=i[0],l=i[1],s=Lg((0,e.useState)(!1),2),c=s[0],f=s[1],d=Lg((0,e.useState)((null==t?void 0:t.devicesFilter)||"views"),2),h=d[0],p=d[1],v=Lg((0,e.useState)(null),2),m=v[0],y=v[1],g=u(),b=g.date_period,x=g.custom_date_period,_=g.selected_campaign,w=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.devicesFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),p(e)}),[h]),k=function(e){var t;if(!["today","custom"].includes(b)&&null!=r&&null!==(t=r[Um(_)])&&void 0!==t&&t[b])return y(r[Um(_)][b]),void f(!1);var n=cs(b,x),i=n.start_date,o=n.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","devices"),l.append("campaign",_),fetch(fpf_js_object.ajax_url,{method:"POST",body:l}).then((function(e){return e.json()})).then((function(t){y(t),f(!1),["today","custom"].includes(b)||a((function(e){return Rg(Rg({},e),{},Ig({},Um(_),Rg(Rg({},e[Um(_)]),{},Ig({},b,t))))})),e&&e()}))},S=React.createRef();return is((function(){k(),l(!0)}),S,[b,x,_]),(0,e.useEffect)((function(){o&&(null!=m&&m.pro||(f(!0),k()))}),[_]),(0,e.useEffect)((function(){o&&"custom"===b&&(2===x.length&&(null===x[0]||null===x[1])||null!=m&&m.pro||(f(!0),k()))}),[x]),(0,e.useEffect)((function(){o&&"custom"!==b&&(null!=m&&m.pro||(f(!0),k()))}),[b]),React.createElement(cg,{boxRef:S,label:fbox_admin_js_object.langs.DEVICES,isLoading:null!==m&&c&&o,data:m,filter:h,setFilterHandler:w,chartType:"pie",chartsFilterable:!1})};function Fg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fg(Object(n),!0).forEach((function(t){Hg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Wg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const $g=function(){var t=Vg((0,e.useState)([]),2),n=t[0],r=t[1],a=Vg((0,e.useState)(!1),2),i=a[0],o=a[1],l=Vg((0,e.useState)(!1),2),s=l[0],c=l[1],f=Vg((0,e.useState)(null),2),d=f[0],h=f[1],p=u(),v=p.date_period,m=p.custom_date_period,y=p.selected_campaign,g=function(e){var t;if(!["today","custom"].includes(v)&&null!=n&&null!==(t=n[Um(y)])&&void 0!==t&&t[v])return h(n[Um(y)][v]),void c(!1);var a=cs(v,m),i=a.start_date,o=a.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","events"),l.append("campaign",y),fetch(fpf_js_object.ajax_url,{method:"POST",body:l}).then((function(e){return e.json()})).then((function(t){h(t),c(!1),["today","custom"].includes(v)||r((function(e){return zg(zg({},e),{},Hg({},Um(y),zg(zg({},e[Um(y)]),{},Hg({},v,t))))})),e&&e()}))},b=React.createRef();return is((function(){g(),o(!0)}),b,[v,m,y]),(0,e.useEffect)((function(){i&&(null!=d&&d.pro||(c(!0),g()))}),[y]),(0,e.useEffect)((function(){i&&"custom"===v&&(2===m.length&&(null===m[0]||null===m[1])||null!=d&&d.pro||(c(!0),g()))}),[m]),(0,e.useEffect)((function(){i&&"custom"!==v&&(null!=d&&d.pro||(c(!0),g()))}),[v]),React.createElement(cg,{boxRef:b,label:fbox_admin_js_object.langs.EVENTS,labelIsEvent:!0,isLoading:null!==d&&s&&i,data:d,filter:"views",chartType:"pie",chartsFilterable:!1,showFiltersDropdown:!1})};function Bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bg(Object(n),!0).forEach((function(t){Ug(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ug(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return qg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Zg=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Gg((0,e.useState)([]),2),r=n[0],a=n[1],i=Gg((0,e.useState)(!1),2),o=i[0],l=i[1],s=Gg((0,e.useState)(!1),2),c=s[0],f=s[1],d=Gg((0,e.useState)((null==t?void 0:t.pathsFilter)||"views"),2),h=d[0],p=d[1],v=Gg((0,e.useState)("list"),2),m=v[0],y=v[1],g=Gg((0,e.useState)(null),2),b=g[0],x=g[1],_=u(),w=_.date_period,k=_.custom_date_period,S=_.selected_campaign,O=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.pathsFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),p(e)}),[h]),j=(0,e.useCallback)((function(e){y(e)}),[m]),E=function(e){var t;if(!["today","custom"].includes(w)&&null!=r&&null!==(t=r[Um(S)])&&void 0!==t&&t[w])return x(r[Um(S)][w]),void f(!1);var n=cs(w,k),i=n.start_date,o=n.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","pages"),l.append("campaign",S),fetch(fpf_js_object.ajax_url,{method:"POST",body:l}).then((function(e){return e.json()})).then((function(t){x(t),f(!1),["today","custom"].includes(w)||a((function(e){return Yg(Yg({},e),{},Ug({},Um(S),Yg(Yg({},e[Um(S)]),{},Ug({},w,t))))})),e&&e()}))},A=React.createRef();return is((function(){E(),l(!0)}),A,[w,k,S]),(0,e.useEffect)((function(){o&&(null!=b&&b.pro||(f(!0),E()))}),[S]),(0,e.useEffect)((function(){o&&"custom"===w&&(2===k.length&&(null===k[0]||null===k[1])||null!=b&&b.pro||(f(!0),E()))}),[k]),(0,e.useEffect)((function(){o&&"custom"!==w&&(null!=b&&b.pro||(f(!0),E()))}),[w]),React.createElement(cg,{boxRef:A,label:fbox_admin_js_object.langs.PATHS,isLoading:null!==b&&c&&o,data:b,filter:h,setFilterHandler:O,chartType:m,setChartTypeHandler:j,chartsFilterable:!1})};function Kg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kg(Object(n),!0).forEach((function(t){Jg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eb(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const tb=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Qg((0,e.useState)([]),2),r=n[0],a=n[1],i=Qg((0,e.useState)(!1),2),o=i[0],l=i[1],s=Qg((0,e.useState)(!1),2),c=s[0],f=s[1],d=Qg((0,e.useState)((null==t?void 0:t.topCampaignsFilter)||"views"),2),h=d[0],p=d[1],v=Qg((0,e.useState)(null),2),m=v[0],y=v[1],g=u(),b=g.date_period,x=g.custom_date_period,_=g.selected_campaign,w=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.topCampaignsFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),p(e)}),[h]),k=function(e){var t;if(!["today","custom"].includes(b)&&null!=r&&null!==(t=r[Um(_)])&&void 0!==t&&t[b])return y(r[Um(_)][b]),void f(!1);var n=cs(b,x),i=n.start_date,o=n.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","top_campaign"),fetch(fpf_js_object.ajax_url,{method:"POST",body:l}).then((function(e){return e.json()})).then((function(t){y(t),["today","custom"].includes(b)||a((function(e){return Xg(Xg({},e),{},Jg({},Um(_),Xg(Xg({},e[Um(_)]),{},Jg({},b,t))))})),f(!1),e&&e()}))},S=React.createRef();return is((function(){k(),l(!0)}),S,[b,x]),(0,e.useEffect)((function(){o&&(null!=m&&m.pro||(f(!0),k()))}),[_]),(0,e.useEffect)((function(){o&&"custom"===b&&(2===x.length&&(null===x[0]||null===x[1])||null!=m&&m.pro||(f(!0),k()))}),[x]),(0,e.useEffect)((function(){o&&"custom"!==b&&(null!=m&&m.pro||(f(!0),k()))}),[b]),React.createElement(cg,{boxRef:S,labelLayout:function(e){var t=e.label||fbox_admin_js_object.langs["N/A"],n=null!=e&&e.full_label?e.full_label:t;return React.createElement(React.Fragment,null,null!=e&&e.link?React.createElement("a",{href:e.link,className:"truncate no-underline text-default hover:text-accent dark:text-white dark:hover:text-grey-3 shadow-none outline-none",title:n},t):React.createElement("div",{className:"truncate",title:n},t))},label:fbox_admin_js_object.langs.TOP_CAMPAIGNS,isLoading:null!==m&&c&&o,data:m,filter:h,setFilterHandler:w,chartType:"list",chartsFilterable:!1})},nb=function(e){var t=e.currentValue,n=e.previousValue,r=e.includePercentSign,a=void 0===r||r,i=e.showArrow,o=void 0===i||i,l=e.className,s=void 0===l?"":l,c=e.title,u=void 0===c?null:c,f=e.children,d=void 0===f?null:f,h=e.layout,p=void 0===h?"horizontal":h,v=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Lm(e,t),a=Nm(r,n);return{raw:r,formatted:a,isPositive:r>0,hasChange:0!==r}}(t,n,a);if(!v.hasChange)return null;var m=u||fbox_admin_js_object.langs.PERCENTAGE_DIFFERENCE_AGAINST_PREVIOUS_PERIOD,y=React.createElement("div",{className:"inline-flex items-center gap-[4px] leading-none"},React.createElement("span",{className:"text-[12px] font-bold ".concat(v.isPositive?"text-custom-green":"text-custom-red")},v.formatted),o&&(v.isPositive?React.createElement("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M0.596191 5.2495L4.99999 0.845703L9.40379 5.2495H0.596191Z",fill:"#0F9D58"})):React.createElement("svg",{width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M4.49999 5.1538L0.0961914 0.75H8.90379L4.49999 5.1538Z",fill:"#DB4437"}))));return"vertical"===p&&d?React.createElement("div",{className:s,title:m},y,d):React.createElement("div",{className:"inline-flex items-center gap-[4px] leading-none ".concat(s),title:m},React.createElement("span",{className:"text-[12px] font-bold ".concat(v.isPositive?"text-custom-green":"text-custom-red")},v.formatted),o&&(v.isPositive?React.createElement("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M0.596191 5.2495L4.99999 0.845703L9.40379 5.2495H0.596191Z",fill:"#0F9D58"})):React.createElement("svg",{width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M4.49999 5.1538L0.0961914 0.75H8.90379L4.49999 5.1538Z",fill:"#DB4437"}))))};Hp.register(Yv,qv,ev,Jp,Av,$v,jv,wv);const rb=function(e){var t=e.labels,n=e.data,r=e.metricKey,a={labels:t,datasets:[{label:Cs[r],data:n,borderColor:Cs[r].color,fill:!0,borderWidth:1,pointHoverRadius:0,backgroundColor:function(e){var t=e.chart.ctx.createLinearGradient(0,0,0,40);return t.addColorStop(0,Cs[r].color),t.addColorStop(1,"rgba(255, 255, 255, 0)"),t},spanGaps:!0}]};return React.createElement(Dm,{data:a,options:{maintainAspectRatio:!1,scales:{x:{ticks:{display:!1},grid:{drawBorder:!1,display:!1},border:{display:!1}},y:{ticks:{display:!1,beginAtZero:!0},grid:{drawBorder:!1,display:!1},border:{display:!1}}},elements:{line:{tension:.3},point:{radius:0}},plugins:{tooltip:{enabled:!1},legend:{display:!1},filler:{propagate:!1}}},key:Date.now(),height:40})};var ab=(0,e.memo)((function(e){var t=e.data;return React.createElement("div",{className:"grid gap-3 grid-cols-3 grid-rows-2 flex-grow"},Object.keys(t.data).map((function(e,n){var r,a,i,o,l,s,c,u,f=Cs[e].label,d=t.data[e].title||"",h=(null===(r=t.data[e])||void 0===r?void 0:r.currentTotal)||0,p=(null===(a=t.data[e])||void 0===a?void 0:a.previousTotal)||0,v=(null===(i=t.data[e])||void 0===i||null===(o=i.data)||void 0===o?void 0:o.map((function(e){return e.total})))||[],m=null!==(l=null===(s=Cs[e])||void 0===s?void 0:s.suffix)&&void 0!==l?l:"",y=null!==(c=null===(u=Cs[e])||void 0===u?void 0:u.prefix)&&void 0!==c?c:"",g="";"conversionrate"===e&&(g=Im({num:h})+m);var b=Im({num:h,decimalPoints:"conversionrate"===e||"revenue"===e,forceDecimalPlaces:"revenue"===e}),x=b;return y?x=y+b:m&&(x=b+m),React.createElement("div",{className:"flex flex-col gap-[4px]".concat(n>=3?" justify-end":""),key:n},React.createElement("div",{className:"text-xs text-grey-1"},f),React.createElement("div",{className:"truncate dark:text-white",title:d},d||fbox_admin_js_object.langs["N/A"]),React.createElement("div",{className:"flex gap-1 dark:text-white items-center"},d&&React.createElement("span",{className:"font-bold text-[20px]",title:g},x),React.createElement(nb,{currentValue:h,previousValue:p,includePercentSign:!0})),v.length>0&&React.createElement("div",null,React.createElement(rb,{metricKey:e,labels:t.labels,data:v})),v.length<=0&&React.createElement("div",{className:"text-xs text-grey-1 h-5 flex items-center"},fbox_admin_js_object.langs.NO_CAMPAIGN_DATA_FOUND))})))}));const ib=ab;function ob(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const lb=function(){return React.createElement("div",{className:"grid gap-4 grid-cols-3 grid-rows-2 flex-grow"},function(e){return function(e){if(Array.isArray(e))return ob(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ob(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ob(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Array(5).keys()).map((function(e,t){return React.createElement("div",{key:t},React.createElement("div",{className:"animate-pulse mb-1 h-1 w-1/2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-2 w-2/3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse mt-1 mb-1 h-2 w-[100px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-5 w-full bg-slate-200 dark:bg-slate-700 rounded"}))})))};function sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sb(Object(n),!0).forEach((function(t){ub(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ub(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return db(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?db(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function db(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const hb=function(){var t=React.createRef(),n=fb((0,e.useState)([]),2),r=n[0],a=n[1],i=fb((0,e.useState)(!1),2),o=i[0],l=i[1],s=fb((0,e.useState)(!1),2),c=s[0],f=s[1],d=u(),h=d.date_period,p=d.custom_date_period,v=fb((0,e.useState)(null),2),m=v[0],y=v[1],g=function(e){if(!["today","custom"].includes(h)&&null!=r&&r[h])return y(r[h]),l(!1),void(e&&e());var t=cs(h,p),n=t.start_date,i=t.end_date,o=Math.round((Date.parse(i)-Date.parse(n))/864e5),s=new FormData;s.append("nonce",fpf_js_object.nonce),s.append("action","firebox_analytics_most_popular_campaigns"),s.append("start_date",n),s.append("end_date",i),fetch(fpf_js_object.ajax_url,{method:"POST",body:s}).then((function(e){return e.json()})).then((function(t){var n=t;null!=n&&n.data&&Object.keys(n.data).map((function(e,t){var r,a;null!==(r=n.data[e])&&void 0!==r&&null!==(a=r.data)&&void 0!==a&&a.length&&(n.data[e].data=1===o?js(n.labels,n.data[e].data):Os(n.labels,n.data[e].data))})),["today","custom"].includes(h)||a((function(e){return cb(cb({},e),{},ub({},h,n))})),y(n),l(!1),e&&e()}))};return is((function(){g(),f(!0)}),t,[h,p]),(0,e.useEffect)((function(){c&&"custom"===h&&(2===p.length&&(null===p[0]||null===p[1])||null!=m&&m.pro||(l(!0),g()))}),[p]),(0,e.useEffect)((function(){c&&"custom"!==h&&(null!=m&&m.pro||(l(!0),g()))}),[h]),React.createElement("div",{className:"relative flex flex-col gap-3 justify-between bg-white dark:bg-dark-1 rounded p-3",ref:t},React.createElement("h2",{className:"text-[20px] text-default dark:text-white"},fbox_admin_js_object.langs.MOST_POPULAR_CAMPAIGNS),null!=m&&m.pro?React.createElement(Ry,{label:fbox_admin_js_object.langs.MOST_POPULAR_CAMPAIGNS,className:"flex-grow"}):null!=m&&m.labels&&0!==m.labels.length?o?React.createElement(lb,null):React.createElement(ib,{data:m}):React.createElement(lb,null))};function pb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pb(Object(n),!0).forEach((function(t){mb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gb(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const bb=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=yb((0,e.useState)([]),2),r=n[0],a=n[1],i=yb((0,e.useState)(!1),2),o=i[0],l=i[1],s=yb((0,e.useState)(!1),2),c=s[0],f=s[1],d=yb((0,e.useState)((null==t?void 0:t.dayOfTheWeekFilter)||"views"),2),h=d[0],p=d[1],v=yb((0,e.useState)([fbox_admin_js_object.langs.MONDAY,fbox_admin_js_object.langs.TUESDAY,fbox_admin_js_object.langs.WEDNESDAY,fbox_admin_js_object.langs.THURSDAY,fbox_admin_js_object.langs.FRIDAY,fbox_admin_js_object.langs.SATURDAY,fbox_admin_js_object.langs.SUNDAY]),2),m=v[0],y=(v[1],yb((0,e.useState)(null),2)),g=y[0],b=y[1],x=u(),_=x.date_period,w=x.custom_date_period,k=x.selected_campaign,S=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.dayOfTheWeekFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),p(e)}),[h]),O=function(e){var t;if(!["today","custom"].includes(_)&&null!=r&&null!==(t=r[Um(k)])&&void 0!==t&&t[_])return b(r[Um(k)][_]),l(!1),void(e&&e());var n=cs(_,w),i=n.start_date,o=n.end_date,s=new FormData;s.append("nonce",fpf_js_object.nonce),s.append("action","firebox_analytics_get_day_of_the_week"),s.append("start_date",i),s.append("end_date",o),s.append("campaign",k),fetch(fpf_js_object.ajax_url,{method:"POST",body:s}).then((function(e){return e.json()})).then((function(t){var n=t;null!=t&&t.pro||Object.keys(n).map((function(e){n[e]=function(e,t){var n=new Map;return null!=t&&t.length&&t.forEach((function(e){n.set(e.label,parseFloat(e.total))})),e.map((function(e){return{label:e,total:(null==n?void 0:n.get(e))||"0.00"}}))}(m,n[e])})),b(n),l(!1),["today","custom"].includes(_)||a((function(e){return vb(vb({},e),{},mb({},Um(k),vb(vb({},e[Um(k)]),{},mb({},_,n))))})),l(!1),e&&e()}))},j=React.createRef();return is((function(){O(),f(!0)}),j,[_,w,k]),(0,e.useEffect)((function(){c&&(null!=g&&g.pro||(l(!0),O()))}),[k]),(0,e.useEffect)((function(){c&&"custom"===_&&(2===w.length&&(null===w[0]||null===w[1])||null!=g&&g.pro||(l(!0),O()))}),[w]),(0,e.useEffect)((function(){c&&"custom"!==_&&(null!=g&&g.pro||(l(!0),O()))}),[_]),React.createElement(cg,{boxRef:j,label:fbox_admin_js_object.langs.DAY_OF_THE_WEEK,isLoading:null!==g&&o&&c,data:g,filter:h,setFilterHandler:S,chartType:"bar",chartsFilterable:!1})};function xb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xb(Object(n),!0).forEach((function(t){wb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Sb=function(){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return kb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kb(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)([]),2),n=t[0],r=t[1],a=u(),i=a.selected_campaign,o=a.date_period,l=a.custom_date_period,s=p(),c=s.components,d=s.loading,h=f(),v=cs(o,l),m=v.start_date,y=v.end_date,g=Math.round((Date.parse(y)-Date.parse(m))/864e5);return(0,e.useEffect)((function(){if(null!==i){if(n[i])return void h({type:"SET_CAMPAIGN",payload:n[i]});!function(e,t){var a=new FormData;a.append("nonce",fpf_js_object.nonce),a.append("action","firebox_analytics_get_campaign"),a.append("campaign",e),fetch(fpf_js_object.ajax_url,{method:"POST",body:a}).then((function(e){return e.json()})).then((function(e){!function(e){var t,a=!(null==e||null===(t=e.campaign)||void 0===t||!t.ID)&&e.campaign;r(_b(_b({},n),{},wb({},i,a))),h({type:"SET_CAMPAIGN",payload:a})}(e)}))}(i)}}),[i]),React.createElement(e.Fragment,null,!d&&(null==c?void 0:c.SalesFunnel)&&React.createElement(c.SalesFunnel,{date_period:o,custom_date_period:l,selected_campaign:i}),React.createElement("div",{className:"grid gap-5 grid-cols-1 lg:grid-cols-2 grid-rows-4"},i?React.createElement(ky,null):React.createElement(hb,null),React.createElement(zy,null),g>1&&React.createElement(bb,null),!i&&React.createElement(tb,null),React.createElement(Pg,null),React.createElement(gg,null),React.createElement(Tg,null),React.createElement(Zg,null),React.createElement($g,null),!i&&React.createElement(Og,null)))};function Ob(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jb,Eb=localStorage.getItem("firebox_analytics_date_period")||"month_to_date",Ab={yesterday:"today",last_30_days:"last_4_weeks",last_week:"last_7_days",last_month:"month_to_date"}[jb=Eb]||jb;Ab!==Eb&&localStorage.setItem("firebox_analytics_date_period",Ab);var Cb=localStorage.getItem("firebox_analytics_custom_date_period"),Db=[];if(Cb)try{var Pb=JSON.parse(Cb);Pb&&Array.isArray(Pb)&&2===Pb.length&&Pb[0]&&Pb[1]&&(Db=Pb.map((function(e){return new Date(e)})))}catch(e){console.warn("Invalid custom date period in localStorage, ignoring"),localStorage.removeItem("firebox_analytics_custom_date_period")}var Mb={campaign:null,date_period:Ab,custom_date_period:Db,selected_campaign:new URLSearchParams(window.location.search).get("campaign")||null},Rb=function(t){var n=t.children,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ob(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ob(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useReducer)(l,Mb),2),a=r[0],i=r[1];return React.createElement(s.Provider,{value:a},React.createElement(c.Provider,{value:i},n))};function Ib(){return React.createElement(React.Fragment,null,React.createElement(Rb,null,React.createElement(wy,null,React.createElement(m,{_title:fbox_admin_js_object.langs.ANALYTICS,call_to_action:!1}),React.createElement(Ls,null),React.createElement(gy,null),React.createElement(Sb,null))))}(0,r.s)(document.querySelector("#fpf-firebox-analytics")).render(React.createElement(Ib,null))})()})();

Anon7 - 2022
AnonSec Team