| 2 |
(()=>{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 C||!(!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 C(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 C=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}(),j=C.prototype;return S.prototype=j,[["$ms",n],["$s",r],["$m",a],["$H",i],["$W",l],["$M",c],["$y",f],["$D",d]].forEach((function(e){j[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,C,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)},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){(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 h=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 d(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)?d(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,h=f();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),c?React.createElement("span",{onClick:function(){h({type:"CLEAR_SELECTED_CAMPAIGN"})},className:"text-sm cursor-pointer text-default flex items-center dark:text-grey-1 justify-center gap-1 hover:text-accent dark:hover:text-white"},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_869_9499",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_869_9499)"},React.createElement("path",{d:"M12 15.6442L13.0442 14.6L11.1942 12.75H15.75V11.25H11.1942L13.0442 9.39998L12 8.35578L8.35578 12L12 15.6442ZM12.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:"currentColor"}))),fbox_admin_js_object.langs.VIEW_ALL_ANALYTICS):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 p=n(386),v=n.n(p);function m(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 y(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)?y(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 y(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 g=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];(0,e.useEffect)((function(){var e=new IntersectionObserver((function(n){m(n,1)[0].isIntersecting&&(t(),e.disconnect())}),{rootMargin:"0px 0px 0px 0px"});return e.observe(n.current),function(){return e.disconnect()}}),r)},b=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])},x=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}(),_=Math.abs,w=String.fromCharCode,k=Object.assign;function S(e){return e.trim()}function O(e,t,n){return e.replace(t,n)}function C(e,t){return e.indexOf(t)}function j(e,t){return 0|e.charCodeAt(t)}function E(e,t,n){return e.slice(t,n)}function A(e){return e.length}function D(e){return e.length}function M(e,t){return t.push(e),e}var P=1,R=1,I=0,L=0,N=0,T="";function F(e,t,n,r,a,i,o){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:P,column:R,length:o,return:""}}function z(e,t){return k(F("",null,null,"",null,null,0),e,{length:-e.length},t)}function $(){return N=L>0?j(T,--L):0,R--,10===N&&(R=1,P--),N}function V(){return N=L<I?j(T,L++):0,R++,10===N&&(R=1,P++),N}function H(){return j(T,L)}function W(){return L}function B(e,t){return E(T,e,t)}function Y(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 U(e){return P=R=1,I=A(T=e),L=0,[]}function G(e){return T="",e}function Z(e){return S(B(L-1,X(91===e?e+2:40===e?e+1:e)))}function q(e){for(;(N=H())&&N<33;)V();return Y(e)>2||Y(N)>3?"":" "}function K(e,t){for(;--t&&V()&&!(N<48||N>102||N>57&&N<65||N>70&&N<97););return B(e,W()+(t<6&&32==H()&&32==V()))}function X(e){for(;V();)switch(N){case e:return L;case 34:case 39:34!==e&&39!==e&&X(N);break;case 40:41===e&&X(e);break;case 92:V()}return L}function J(e,t){for(;V()&&e+N!==57&&(e+N!==84||47!==H()););return"/*"+B(t,L-1)+"*"+w(47===e?e:V())}function Q(e){for(;!Y(H());)V();return B(e,L)}var ee="-ms-",te="-webkit-",ne="comm",re="rule",ae="decl",ie="@keyframes";function oe(e,t){for(var n="",r=D(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function le(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case ae:return e.return=e.return||e.value;case ne:return"";case ie:return e.return=e.value+"{"+oe(e.children,r)+"}";case re:e.value=e.props.join(",")}return A(n=oe(e.children,r))?e.return=e.value+"{"+n+"}":""}function se(e){return function(t){t.root||(t=t.return)&&e(t)}}function ce(e){return G(ue("",null,null,null,[""],e=U(e),0,[0],e))}function ue(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,k=r,S=b;m;)switch(p=g,g=V()){case 40:if(108!=p&&58==j(S,f-1)){-1!=C(S+=O(Z(g),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:S+=Z(g);break;case 9:case 10:case 13:case 32:S+=q(p);break;case 92:S+=K(W()-1,7);continue;case 47:switch(H()){case 42:case 47:M(de(J(V(),W()),t,n),s);break;default:S+="/"}break;case 123*v:l[c++]=A(S)*y;case 125*v:case 59:case 0:switch(g){case 0:case 125:m=0;case 59+u:-1==y&&(S=O(S,/\f/g,"")),h>0&&A(S)-f&&M(h>32?he(S+";",r,n,f-1):he(O(S," ","")+";",r,n,f-2),s);break;case 59:S+=";";default:if(M(k=fe(S,t,n,c,u,a,l,b,x=[],_=[],f),i),123===g)if(0===u)ue(S,t,k,k,x,i,f,l,_);else switch(99===d&&110===j(S,3)?100:d){case 100:case 108:case 109:case 115:ue(e,k,k,r&&M(fe(e,k,k,0,0,a,l,b,a,x=[],f),_),a,_,f,l,r?x:_);break;default:ue(S,k,k,k,[""],_,0,l,_)}}c=u=h=0,v=y=1,b=S="",f=o;break;case 58:f=1+A(S),h=p;default:if(v<1)if(123==g)--v;else if(125==g&&0==v++&&125==$())continue;switch(S+=w(g),g*v){case 38:y=u>0?1:(S+="\f",-1);break;case 44:l[c++]=(A(S)-1)*y,y=1;break;case 64:45===H()&&(S+=Z(V())),d=H(),u=f=A(b=S+=Q(W())),g++;break;case 45:45===p&&2==A(S)&&(v=0)}}return i}function fe(e,t,n,r,a,i,o,l,s,c,u){for(var f=a-1,d=0===a?i:[""],h=D(d),p=0,v=0,m=0;p<r;++p)for(var y=0,g=E(e,f+1,f=_(v=o[p])),b=e;y<h;++y)(b=S(v>0?d[y]+" "+g:O(g,/&\f/g,d[y])))&&(s[m++]=b);return F(e,t,n,0===a?re:l,s,c,u)}function de(e,t,n){return F(e,t,n,ne,w(N),E(e,2,-2),0)}function he(e,t,n,r){return F(e,t,n,ae,E(e,0,r),E(e,r+1,-1),r)}var pe=function(e,t,n){for(var r=0,a=0;r=a,a=H(),38===r&&12===a&&(t[n]=1),!Y(a);)V();return B(e,L)},ve=new WeakMap,me=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)||ve.get(n))&&!r){ve.set(e,!0);for(var a=[],i=function(e,t){return G(function(e,t){var n=-1,r=44;do{switch(Y(r)){case 0:38===r&&12===H()&&(t[n]=1),e[n]+=pe(L-1,t,n);break;case 2:e[n]+=Z(r);break;case 4:if(44===r){e[++n]=58===H()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=w(r)}}while(r=V());return e}(U(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]}}},ye=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function ge(e,t){switch(function(e,t){return 45^j(e,0)?(((t<<2^j(e,0))<<2^j(e,1))<<2^j(e,2))<<2^j(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 te+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return te+e+"-moz-"+e+ee+e+e;case 6828:case 4268:return te+e+ee+e+e;case 6165:return te+e+ee+"flex-"+e+e;case 5187:return te+e+O(e,/(\w+).+(:[^]+)/,"-webkit-box-$1$2-ms-flex-$1$2")+e;case 5443:return te+e+ee+"flex-item-"+O(e,/flex-|-self/,"")+e;case 4675:return te+e+ee+"flex-line-pack"+O(e,/align-content|flex-|-self/,"")+e;case 5548:return te+e+ee+O(e,"shrink","negative")+e;case 5292:return te+e+ee+O(e,"basis","preferred-size")+e;case 6060:return"-webkit-box-"+O(e,"-grow","")+te+e+ee+O(e,"grow","positive")+e;case 4554:return te+O(e,/([^-])(transform)/g,"$1-webkit-$2")+e;case 6187:return O(O(O(e,/(zoom-|grab)/,"-webkit-$1"),/(image-set)/,"-webkit-$1"),e,"")+e;case 5495:case 3959:return O(e,/(image-set\([^]*)/,"-webkit-$1$`$1");case 4968:return O(O(e,/(.+:)(flex-)?(.*)/,"-webkit-box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+te+e+e;case 4095:case 3583:case 4068:case 2532:return O(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(A(e)-1-t>6)switch(j(e,t+1)){case 109:if(45!==j(e,t+4))break;case 102:return O(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1-moz-"+(108==j(e,t+3)?"$3":"$2-$3"))+e;case 115:return~C(e,"stretch")?ge(O(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==j(e,t+1))break;case 6444:switch(j(e,A(e)-3-(~C(e,"!important")&&10))){case 107:return O(e,":",":-webkit-")+e;case 101:return O(e,/(.+:)([^;!]+)(;|!.+)?/,"$1-webkit-"+(45===j(e,14)?"inline-":"")+"box$3$1-webkit-$2$3$1-ms-$2box$3")+e}break;case 5936:switch(j(e,t+11)){case 114:return te+e+ee+O(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return te+e+ee+O(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return te+e+ee+O(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return te+e+ee+e+e}return e}var be=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case ae:e.return=ge(e.value,e.length);break;case ie:return oe([z(e,{value:O(e.value,"@","@-webkit-")})],r);case re: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 oe([z(e,{props:[O(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return oe([z(e,{props:[O(t,/:(plac\w+)/,":-webkit-input-$1")]}),z(e,{props:[O(t,/:(plac\w+)/,":-moz-$1")]}),z(e,{props:[O(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}return""}))}}],xe=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||be,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=[me,ye],d=[le,se((function(e){s.insert(e)}))],h=(c=f.concat(i,d),u=D(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,oe(ce(e?e+"{"+t.styles+"}":t.styles),h),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new x({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},_e={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 we(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}function ke(e){return ke="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},ke(e)}var Se=/[A-Z]|^ms/g,Oe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ce=function(e){return 45===e.charCodeAt(1)},je=function(e){return null!=e&&"boolean"!=typeof e},Ee=we((function(e){return Ce(e)?e:e.replace(Se,"-$&").toLowerCase()})),Ae=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Oe,(function(e,t,n){return Me={name:t,styles:n,next:Me},t}))}return 1===_e[e]||Ce(e)||"number"!=typeof t||0===t?t:t+"px"};function De(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(ke(n)){case"boolean":return"";case"object":if(1===n.anim)return Me={name:n.name,styles:n.styles,next:Me},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Me={name:r.name,styles:r.styles,next:Me},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+=De(e,t,n[a])+";";else for(var i in n){var o=n[i];if("object"!==ke(o))null!=t&&void 0!==t[o]?r+=i+"{"+t[o]+"}":je(o)&&(r+=Ee(i)+":"+Ae(i,o)+";");else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var l=De(e,t,o);switch(i){case"animation":case"animationName":r+=Ee(i)+":"+l+";";break;default:r+=i+"{"+l+"}"}}else for(var s=0;s<o.length;s++)je(o[s])&&(r+=Ee(i)+":"+Ae(i,o[s])+";")}return r}(e,t,n);case"function":if(void 0!==e){var a=Me,i=n(e);return Me=a,De(e,t,i)}}if(null==t)return n;var o=t[n];return void 0!==o?o:n}var Me,Pe=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Re=function(e,t,n){if(1===e.length&&"object"===ke(e[0])&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,a="";Me=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,a+=De(n,t,i)):a+=i[0];for(var o=1;o<e.length;o++)a+=De(n,t,e[o]),r&&(a+=i[o]);Pe.lastIndex=0;for(var l,s="";null!==(l=Pe.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:Me}};!!e.useInsertionEffect&&e.useInsertionEffect||e.useLayoutEffect,e.createContext("undefined"!=typeof HTMLElement?xe({key:"css"}):null).Provider,n(480);var Ie={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 Le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ne(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 Te=Object.defineProperty,Fe=Object.getOwnPropertySymbols,ze=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,Ve=function(e,t,n){return t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},He=function(e,t){for(var n in t||(t={}))ze.call(t,n)&&Ve(e,n,t[n]);if(Fe){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 Ne(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)?Ne(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}}}}(Fe(t));try{for(a.s();!(r=a.n()).done;)n=r.value,$e.call(t,n)&&Ve(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function We(e){return function(t){return"number"==typeof e.primaryShade?e.primaryShade:e.primaryShade[t||e.colorScheme]}}function Be(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 Ye(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)?Ye(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 Ye(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 Ue(e){var t=We(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=Be(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 Ge(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 Ze(e){var t=Ue(e),n=We(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 Ke=qe("rem"),Xe=qe("em");function Je(e){var t=e.size,n=e.sizes,r=e.units;return t in n?n[t]:"number"==typeof t?"em"===r?Xe(t):Ke(t):t||n.md}function Qe(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 et(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 tt(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 et(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)?et(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 nt(e,t){if("string"!=typeof e||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(--"))return e;var n=tt(e),r=n.r,a=n.g,i=n.b;return"rgba(".concat(r,", ").concat(a,", ").concat(i,", ").concat(t,")")}function rt(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 at={fontStyles:function(e){return function(){return{fontFamily:e.fontFamily||"sans-serif"}}},themeColor:Ue,focusStyles:function(e){return function(t){var n;return Le(n={WebkitTapHighlightColor:"transparent"},t||"&:focus",He({},"always"===e.focusRing||"auto"===e.focusRing?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e))),Le(n,t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)",He({},"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(Ge(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(Ge(t),")")},smallerThan:function(e){return function(t){return"@media (max-width: ".concat(Xe(Qe(Je({size:t,sizes:e.breakpoints}))-1),")")}},largerThan:function(e){return function(t){return"@media (min-width: ".concat(Xe(Qe(Je({size:t,sizes:e.breakpoints}))),")")}},rgba:nt,cover:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{position:"absolute",top:Ke(e),right:Ke(e),left:Ke(e),bottom:Ke(e)}},darken:function(e,t){if("string"==typeof e&&e.startsWith("var(--"))return e;var n=tt(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=tt(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 Ke(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=Ue(e),n=We(e),r=Ze(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 rt(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)?rt(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:nt(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:nt(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:nt(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?nt(t(o,5,s,!1),.05):nt(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:We,hover:function(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}},gradient:Ze,primaryColor:function(e){return function(t){var n=We(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 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}var ot=Object.defineProperty,lt=Object.defineProperties,st=Object.getOwnPropertyDescriptors,ct=Object.getOwnPropertySymbols,ut=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,dt=function(e,t,n){return t in e?ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};function ht(e){return ht="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},ht(e)}Object.keys(Ie);var pt,vt,mt,yt=(vt=function(e,t){for(var n in t||(t={}))ut.call(t,n)&&dt(e,n,t[n]);if(ct){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 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&&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}}}}(ct(t));try{for(a.s();!(r=a.n()).done;)n=r.value,ft.call(t,n)&&dt(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({},pt={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:Ie,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"===ht(e.primaryShade)?e.primaryShade[e.colorScheme]:e.primaryShade]}}}}),mt={fn:{fontStyles:at.fontStyles(pt),themeColor:at.themeColor(pt),focusStyles:at.focusStyles(pt),largerThan:at.largerThan(pt),smallerThan:at.smallerThan(pt),radialGradient:at.radialGradient,linearGradient:at.linearGradient,gradient:at.gradient(pt),rgba:at.rgba,cover:at.cover,lighten:at.lighten,darken:at.darken,primaryShade:at.primaryShade(pt),radius:at.radius(pt),variant:at.variant(pt),hover:at.hover,primaryColor:at.primaryColor(pt),placeholderStyles:at.placeholderStyles(pt),dimmed:at.dimmed(pt)}},lt(vt,st(mt)));function gt(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}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}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(Ke(1)," dotted ButtonText");var xt=Object.defineProperty,_t=Object.getOwnPropertySymbols,wt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,St=function(e,t,n){return t in e?xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ot=function(e,t){for(var n in t||(t={}))wt.call(t,n)&&St(e,n,t[n]);if(_t){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 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}}}}(_t(t));try{for(a.s();!(r=a.n()).done;)n=r.value,kt.call(t,n)&&St(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Ct=(0,e.createContext)({theme:yt});function jt(){var t;return(null==(t=(0,e.useContext)(Ct))?void 0:t.theme)||yt}function Et(){var t;return null==(t=(0,e.useContext)(Ct))?void 0:t.emotionCache}function At(e,t,n){var r,a=jt(),i=null==(r=a.components[e])?void 0:r.defaultProps,o="function"==typeof i?i(a):i;return Ot(Ot(Ot({},t),o),gt(n))}function Dt(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 Mt(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 Dt(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)?Dt(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 Pt(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 Rt=function(e){return"range"===e?[null,null]:"multiple"===e?[]:null};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(e,t){var n=function(e){return function(e){if(Array.isArray(e))return It(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 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)||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 v()(n[0]).startOf("day").subtract(1,"ms").isBefore(e)&&v()(n[1]).endOf("day").add(1,"ms").isAfter(e)}function Nt(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)||Tt(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 Tt(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}}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(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 Pt(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)?Pt(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.")}()}(Mt({value:r,defaultValue:a,onChange:i,finalValue:Rt(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:Rt(n))),[u,c]}({type:n,value:a,defaultValue:i,onChange:o}),f=Nt(u,2),d=f[0],h=f[1],p=Nt((0,e.useState)("range"===n&&d[0]&&!d[1]?d[0]:null),2),m=p[0],y=p[1],g=Nt((0,e.useState)(null),2),b=g[0],x=g[1],_=function(e){return m instanceof Date&&b instanceof Date?Lt(e,[b,m]):d[0]instanceof Date&&d[1]instanceof Date&&Lt(e,d)},w=function(e){return d[0]instanceof Date&&!!v()(e).isSame(d[0],r)&&!(b&&v()(b).isBefore(d[0]))},k=function(e){return d[1]instanceof Date?v()(e).isSame(d[1],r):!!(d[0]instanceof Date&&b)&&v()(b).isBefore(d[0])&&v()(e).isSame(d[0],r)};return{onDateChange:function(e){if("range"===n){if(m instanceof Date&&!d[1]){if(v()(e).isSame(m,r)&&!l)return y(null),x(null),void h([null,null]);var t=[e,m];return t.sort((function(e,t){return e.getTime()-t.getTime()})),h(t),x(null),void y(null)}return d[0]&&!d[1]&&v()(e).isSame(d[0],r)&&!l?(y(null),x(null),void h([null,null])):(h([e,null]),x(null),void y(e))}"multiple"!==n?d&&s&&v()(e).isSame(d,r)?h(null):h(e):d.some((function(t){return v()(t).isSame(e,r)}))?h(d.filter((function(t){return!v()(t).isSame(e,r)}))):h([].concat(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)||Tt(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&&m?x:function(){},getControlProps:function(e){if("range"===n)return{selected:d.some((function(t){return t&&v()(t).isSame(e,r)})),inRange:_(e),firstInRange:w(e),lastInRange:k(e),"data-autofocus":!!d[0]&&v()(d[0]).isSame(e,r)||void 0};if("multiple"===n)return{selected:d.some((function(t){return t&&v()(t).isSame(e,r)})),"data-autofocus":!!d[0]&&v()(d[0]).isSame(e,r)||void 0};var t=v()(d).isSame(e,r);return{selected:t,"data-autofocus":t||void 0}},_value:d,setValue:h}}function $t(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 Vt=Object.getOwnPropertySymbols,Ht=Object.prototype.hasOwnProperty,Wt=Object.prototype.propertyIsEnumerable;function Bt(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,C=t.tt,j=t.td,E=t.w,A=t.miw,D=t.maw,M=t.h,P=t.mih,R=t.mah,I=t.bgsz,L=t.bgp,N=t.bgr,T=t.bga,F=t.pos,z=t.top,$=t.left,V=t.bottom,H=t.right,W=t.inset,B=t.display,Y=function(e,t){var n={};for(var r in e)Ht.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Vt){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 $t(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)?$t(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}}}}(Vt(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Wt.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:gt({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:C,td:j,w:E,miw:A,maw:D,h:M,mih:P,mah:R,bgsz:I,bgp:L,bgr:N,bga:T,pos:F,top:z,left:$,bottom:V,right:H,inset:W,display:B}),rest:Y}}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)}function Ut(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"===Yt(e))if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Ut(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Gt(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Ut(e))&&(r&&(r+=" "),r+=t);return r}var Zt=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)}};function qt(e){return function(e){if(Array.isArray(e))return Kt(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 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)||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 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}var Xt=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}(),Jt=Math.abs,Qt=String.fromCharCode,en=Object.assign;function tn(e){return e.trim()}function nn(e,t,n){return e.replace(t,n)}function rn(e,t){return e.indexOf(t)}function an(e,t){return 0|e.charCodeAt(t)}function on(e,t,n){return e.slice(t,n)}function ln(e){return e.length}function sn(e){return e.length}function cn(e,t){return t.push(e),e}var un=1,fn=1,dn=0,hn=0,pn=0,vn="";function mn(e,t,n,r,a,i,o){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:un,column:fn,length:o,return:""}}function yn(e,t){return en(mn("",null,null,"",null,null,0),e,{length:-e.length},t)}function gn(){return pn=hn<dn?an(vn,hn++):0,fn++,10===pn&&(fn=1,un++),pn}function bn(){return an(vn,hn)}function xn(){return hn}function _n(e,t){return on(vn,e,t)}function wn(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 kn(e){return un=fn=1,dn=ln(vn=e),hn=0,[]}function Sn(e){return vn="",e}function On(e){return tn(_n(hn-1,En(91===e?e+2:40===e?e+1:e)))}function Cn(e){for(;(pn=bn())&&pn<33;)gn();return wn(e)>2||wn(pn)>3?"":" "}function jn(e,t){for(;--t&&gn()&&!(pn<48||pn>102||pn>57&&pn<65||pn>70&&pn<97););return _n(e,xn()+(t<6&&32==bn()&&32==gn()))}function En(e){for(;gn();)switch(pn){case e:return hn;case 34:case 39:34!==e&&39!==e&&En(pn);break;case 40:41===e&&En(e);break;case 92:gn()}return hn}function An(e,t){for(;gn()&&e+pn!==57&&(e+pn!==84||47!==bn()););return"/*"+_n(t,hn-1)+"*"+Qt(47===e?e:gn())}function Dn(e){for(;!wn(bn());)gn();return _n(e,hn)}var Mn="-ms-",Pn="-webkit-",Rn="comm",In="rule",Ln="decl",Nn="@keyframes";function Tn(e,t){for(var n="",r=sn(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function Fn(e,t,n,r){switch(e.type){case"@import":case Ln:return e.return=e.return||e.value;case Rn:return"";case Nn:return e.return=e.value+"{"+Tn(e.children,r)+"}";case In:e.value=e.props.join(",")}return ln(n=Tn(e.children,r))?e.return=e.value+"{"+n+"}":""}function zn(e){return function(t){t.root||(t=t.return)&&e(t)}}function $n(e){return Sn(Vn("",null,null,null,[""],e=kn(e),0,[0],e))}function Vn(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=gn()){case 40:if(108!=p&&58==an(k,f-1)){-1!=rn(k+=nn(On(g),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:k+=On(g);break;case 9:case 10:case 13:case 32:k+=Cn(p);break;case 92:k+=jn(xn()-1,7);continue;case 47:switch(bn()){case 42:case 47:cn(Wn(An(gn(),xn()),t,n),s);break;default:k+="/"}break;case 123*v:l[c++]=ln(k)*y;case 125*v:case 59:case 0:switch(g){case 0:case 125:m=0;case 59+u:h>0&&ln(k)-f&&cn(h>32?Bn(k+";",r,n,f-1):Bn(nn(k," ","")+";",r,n,f-2),s);break;case 59:k+=";";default:if(cn(w=Hn(k,t,n,c,u,a,l,b,x=[],_=[],f),i),123===g)if(0===u)Vn(k,t,w,w,x,i,f,l,_);else switch(99===d&&110===an(k,3)?100:d){case 100:case 109:case 115:Vn(e,w,w,r&&cn(Hn(e,w,w,0,0,a,l,b,a,x=[],f),_),a,_,f,l,r?x:_);break;default:Vn(k,w,w,w,[""],_,0,l,_)}}c=u=h=0,v=y=1,b=k="",f=o;break;case 58:f=1+ln(k),h=p;default:if(v<1)if(123==g)--v;else if(125==g&&0==v++&&125==(pn=hn>0?an(vn,--hn):0,fn--,10===pn&&(fn=1,un--),pn))continue;switch(k+=Qt(g),g*v){case 38:y=u>0?1:(k+="\f",-1);break;case 44:l[c++]=(ln(k)-1)*y,y=1;break;case 64:45===bn()&&(k+=On(gn())),d=bn(),u=f=ln(b=k+=Dn(xn())),g++;break;case 45:45===p&&2==ln(k)&&(v=0)}}return i}function Hn(e,t,n,r,a,i,o,l,s,c,u){for(var f=a-1,d=0===a?i:[""],h=sn(d),p=0,v=0,m=0;p<r;++p)for(var y=0,g=on(e,f+1,f=Jt(v=o[p])),b=e;y<h;++y)(b=tn(v>0?d[y]+" "+g:nn(g,/&\f/g,d[y])))&&(s[m++]=b);return mn(e,t,n,0===a?In:l,s,c,u)}function Wn(e,t,n){return mn(e,t,n,Rn,Qt(pn),on(e,2,-2),0)}function Bn(e,t,n,r){return mn(e,t,n,Ln,on(e,0,r),on(e,r+1,-1),r)}var Yn=function(e,t,n){for(var r=0,a=0;r=a,a=bn(),38===r&&12===a&&(t[n]=1),!wn(a);)gn();return _n(e,hn)},Un=new WeakMap,Gn=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)||Un.get(n))&&!r){Un.set(e,!0);for(var a=[],i=function(e,t){return Sn(function(e,t){var n=-1,r=44;do{switch(wn(r)){case 0:38===r&&12===bn()&&(t[n]=1),e[n]+=Yn(hn-1,t,n);break;case 2:e[n]+=On(r);break;case 4:if(44===r){e[++n]=58===bn()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Qt(r)}}while(r=gn());return e}(kn(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]}}},Zn=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function qn(e,t){switch(function(e,t){return 45^an(e,0)?(((t<<2^an(e,0))<<2^an(e,1))<<2^an(e,2))<<2^an(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 Pn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Pn+e+"-moz-"+e+Mn+e+e;case 6828:case 4268:return Pn+e+Mn+e+e;case 6165:return Pn+e+Mn+"flex-"+e+e;case 5187:return Pn+e+nn(e,/(\w+).+(:[^]+)/,"-webkit-box-$1$2-ms-flex-$1$2")+e;case 5443:return Pn+e+Mn+"flex-item-"+nn(e,/flex-|-self/,"")+e;case 4675:return Pn+e+Mn+"flex-line-pack"+nn(e,/align-content|flex-|-self/,"")+e;case 5548:return Pn+e+Mn+nn(e,"shrink","negative")+e;case 5292:return Pn+e+Mn+nn(e,"basis","preferred-size")+e;case 6060:return"-webkit-box-"+nn(e,"-grow","")+Pn+e+Mn+nn(e,"grow","positive")+e;case 4554:return Pn+nn(e,/([^-])(transform)/g,"$1-webkit-$2")+e;case 6187:return nn(nn(nn(e,/(zoom-|grab)/,"-webkit-$1"),/(image-set)/,"-webkit-$1"),e,"")+e;case 5495:case 3959:return nn(e,/(image-set\([^]*)/,"-webkit-$1$`$1");case 4968:return nn(nn(e,/(.+:)(flex-)?(.*)/,"-webkit-box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+Pn+e+e;case 4095:case 3583:case 4068:case 2532:return nn(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(ln(e)-1-t>6)switch(an(e,t+1)){case 109:if(45!==an(e,t+4))break;case 102:return nn(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1-moz-"+(108==an(e,t+3)?"$3":"$2-$3"))+e;case 115:return~rn(e,"stretch")?qn(nn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==an(e,t+1))break;case 6444:switch(an(e,ln(e)-3-(~rn(e,"!important")&&10))){case 107:return nn(e,":",":-webkit-")+e;case 101:return nn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1-webkit-"+(45===an(e,14)?"inline-":"")+"box$3$1-webkit-$2$3$1-ms-$2box$3")+e}break;case 5936:switch(an(e,t+11)){case 114:return Pn+e+Mn+nn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Pn+e+Mn+nn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Pn+e+Mn+nn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Pn+e+Mn+e+e}return e}var Kn=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ln:e.return=qn(e.value,e.length);break;case Nn:return Tn([yn(e,{value:nn(e.value,"@","@-webkit-")})],r);case In: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 Tn([yn(e,{props:[nn(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Tn([yn(e,{props:[nn(t,/:(plac\w+)/,":-webkit-input-$1")]}),yn(e,{props:[nn(t,/:(plac\w+)/,":-moz-$1")]}),yn(e,{props:[nn(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}return""}))}}];var Xn=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||Kn,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=[Gn,Zn],d=[Fn,zn((function(e){s.insert(e)}))],h=(c=f.concat(i,d),u=sn(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,Tn($n(e?e+"{"+t.styles+"}":t.styles),h),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new Xt({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}({key:"mantine",prepend:!0});function Jn(e,t){if(e){if("string"==typeof e)return Qn(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)?Qn(e,t):void 0}}function Qn(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 er=Object.defineProperty,tr=Object.getOwnPropertySymbols,nr=Object.prototype.hasOwnProperty,rr=Object.prototype.propertyIsEnumerable,ar=function(e,t,n){return t in e?er(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};function ir(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)||Jn(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={}))nr.call(t,n)&&ar(e,n,t[n]);if(tr){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Jn(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}}}}(tr(t));try{for(a.s();!(r=a.n()).done;)n=r.value,rr.call(t,n)&&ar(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({},n);return delete r.ref,{args:[r],ref:t}}var or=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=ir(t),i=a.ref,o=a.args,l=Re(o,n.registered);return Zt(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,Gt(a))}}}}}().cssFactory;function lr(){var t,n,r,a=Et()||Xn;return t=function(){return or({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:qt(n)}),r.current.v}function sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cr(e){return cr="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},cr(e)}function ur(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 fr(e){var t=e.value,n=e.theme,r=e.getValue,a=e.property;if(null!=t){if("object"===cr(t)){var i=function(e,t){var n=Object.keys(e).filter((function(e){return"base"!==e})).sort((function(e,n){return Qe(Je({size:e,sizes:t.breakpoints}))-Qe(Je({size:n,sizes:t.breakpoints}))}));return"base"in e?["base"].concat(function(e){return function(e){if(Array.isArray(e))return ur(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 ur(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)?ur(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)]=sr({},a,l),e)}),{});return i}var o=r(t,n);return Array.isArray(a)?a.reduce((function(e,t){return e[t]=o,e}),{}):sr({},a,o)}}var dr=["-xs","-sm","-md","-lg","-xl"],hr={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 Ke(e)},fontSize:function(e,t){return Je({size:e,sizes:t.fontSizes})},spacing:function(e,t){return dr.includes(e)?"calc(".concat(Je({size:e.replace("-",""),sizes:t.spacing})," * -1)"):Je({size:e,sizes:t.spacing})}},pr={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 vr(e){return vr="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},vr(e)}function mr(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 yr=Object.defineProperty,gr=Object.getOwnPropertySymbols,br=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,_r=function(e,t,n){return t in e?yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},wr=function(e,t){for(var n in t||(t={}))br.call(t,n)&&_r(e,n,t[n]);if(gr){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 mr(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)?mr(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}}}}(gr(t));try{for(a.s();!(r=a.n()).done;)n=r.value,xr.call(t,n)&&_r(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function kr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pr,r=Object.keys(n).reduce((function(r,a){return a in e&&void 0!==e[a]&&r.push(fr({value:e[a],getValue:hr[n[a].type],property:n[a].property,theme:t})),r}),[]);return r.reduce((function(e,t){return Object.keys(t).forEach((function(n){"object"===vr(t[n])&&null!==t[n]?e[n]=n in e?wr(wr({},e[n]),t[n]):t[n]:e[n]=t[n]})),e}),{})}function Sr(e,t){return"function"==typeof e?e(t):e}function Or(e,t,n){var r=jt(),a=lr(),i=a.css,o=a.cx;return Array.isArray(e)?o(n,i(kr(t,r)),e.map((function(e){return i(Sr(e,r))}))):o(n,i(Sr(e,r)),i(kr(t,r)))}function Cr(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 jr(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)?jr(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 jr(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 Er=Object.defineProperty,Ar=Object.getOwnPropertySymbols,Dr=Object.prototype.hasOwnProperty,Mr=Object.prototype.propertyIsEnumerable,Pr=function(e,t,n){return t in e?Er(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Rr=(0,e.forwardRef)((function(e,n){var r=e,a=r.className,i=r.component,o=r.style,l=r.sx,s=Bt(function(e,t){var n={};for(var r in e)Dr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ar){var a,i=Cr(Ar(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Mr.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={}))Dr.call(t,n)&&Pr(e,n,t[n]);if(Ar){var r,a=Cr(Ar(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Mr.call(t,n)&&Pr(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({ref:n,className:Or(l,c,a),style:o},u))}));Rr.displayName="@mantine/core/Box";var Ir=Rr;function Lr(e,t){return e?"month"===e?0:"year"===e?1:2:t}function Nr(e,t,n){return a=Lr(e,0),i=Lr(t,0),o=Lr(n,2),0===(r=Math.min(Math.max(a,i),o))?"month":1===r?"year":"decade";var r,a,i,o}function Tr(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 Fr(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 zr=Object.defineProperty,$r=Object.getOwnPropertySymbols,Vr=Object.prototype.hasOwnProperty,Hr=Object.prototype.propertyIsEnumerable,Wr=function(e,t,n){return t in e?zr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Br=function(e,t){for(var n in t||(t={}))Vr.call(t,n)&&Wr(e,n,t[n]);if($r){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 Fr(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)?Fr(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}}}}($r(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Hr.call(t,n)&&Wr(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function Yr(e,t){return t&&Object.keys(t).forEach((function(n){e[n]?e[n]=Br(Br({},e[n]),t[n]):e[n]=Br({},t[n])})),e}function Ur(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 Yr(e,t)}),{}):a(e)}function Gr(e){var t="function"==typeof e?e:function(){return e};return function(e,n){var r=jt(),a=function(e){var t=jt(),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=Et(),o={variant:null==n?void 0:n.variant,size:null==n?void 0:n.size},l=lr(),s=l.css,c=l.cx,u=t(r,e,o),f=Ur(null==n?void 0:n.styles,r,e,o),d=Ur(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&&Yr(e,i.variants[r](t,n,{variant:r,size:a})),i.sizes&&a in i.sizes&&Yr(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:Tr({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 Zr=Gr((function(){return{calendar:{}}}));var qr=Gr((function(e,t,n){return{monthLevelGroup:{display:"flex","& [data-month-level]:not(:last-of-type)":{marginRight:Je({size:n.size,sizes:e.spacing})}}}}));const Kr=qr,Xr=Gr((function(e){return{monthLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}}));Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var Jr={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–"},Qr=(0,e.createContext)(Jr);function ea(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 ta=Object.defineProperty,na=Object.defineProperties,ra=Object.getOwnPropertyDescriptors,aa=Object.getOwnPropertySymbols,ia=Object.prototype.hasOwnProperty,oa=Object.prototype.propertyIsEnumerable,la=function(e,t,n){return t in e?ta(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};function sa(){var t,n=(0,e.useContext)(Qr),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={}))ia.call(t,n)&&la(e,n,t[n]);if(aa){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 ea(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)?ea(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}}}}(aa(t));try{for(a.s();!(r=a.n()).done;)n=r.value,oa.call(t,n)&&la(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({},n),na(t,ra({getLocale:r,getFirstDayOfWeek:a,getWeekendDays:i,getLabelSeparator:o}))}function ca(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 ua=Object.defineProperty,fa=Object.defineProperties,da=Object.getOwnPropertyDescriptors,ha=Object.getOwnPropertySymbols,pa=Object.prototype.hasOwnProperty,va=Object.prototype.propertyIsEnumerable,ma=function(e,t,n){return t in e?ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ya=function(e,t){for(var n in t||(t={}))pa.call(t,n)&&ma(e,n,t[n]);if(ha){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 ca(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)?ca(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}}}}(ha(t));try{for(a.s();!(r=a.n()).done;)n=r.value,va.call(t,n)&&ma(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};const ga=Gr((function(e){return{root:(t=ya(ya({},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"},fa(t,da(n)))};var t,n}));function ba(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 xa(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)?xa(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 xa(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 _a=Object.defineProperty,wa=Object.getOwnPropertySymbols,ka=Object.prototype.hasOwnProperty,Sa=Object.prototype.propertyIsEnumerable,Oa=function(e,t,n){return t in e?_a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ca=(0,e.forwardRef)((function(e,n){var r=At("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)ka.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&wa){var a,i=ba(wa(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Sa.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","component","unstyled","variant"]),u=ga(null,{name:"UnstyledButton",unstyled:l,variant:s}),f=u.classes,d=u.cx;return t().createElement(Ir,function(e,t){for(var n in t||(t={}))ka.call(t,n)&&Oa(e,n,t[n]);if(wa){var r,a=ba(wa(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Sa.call(t,n)&&Oa(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))}));Ca.displayName="@mantine/core/UnstyledButton";var ja=Ca;function Ea(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 Aa(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)?Aa(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 Aa(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 Da=Object.defineProperty,Ma=Object.getOwnPropertySymbols,Pa=Object.prototype.hasOwnProperty,Ra=Object.prototype.propertyIsEnumerable,Ia=function(e,t,n){return t in e?Da(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},La=function(e,t){for(var n in t||(t={}))Pa.call(t,n)&&Ia(e,n,t[n]);if(Ma){var r,a=Ea(Ma(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ra.call(t,n)&&Ia(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function Na(e){var n=e,r=n.style,a=function(e,t){var n={};for(var r in e)Pa.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ma){var a,i=Ea(Ma(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Ra.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(n,["style"]);return t().createElement("svg",La({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:La({width:Ke(16),height:Ke(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 Ta(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}}}}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}var za=Object.defineProperty,$a=Object.defineProperties,Va=Object.getOwnPropertyDescriptors,Ha=Object.getOwnPropertySymbols,Wa=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={}))Wa.call(t,n)&&Ya(e,n,t[n]);if(Ha){var r,a=Ta(Ha(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},Ga=function(e,t){return $a(e,Va(t))};function Za(e){var n=e,r=n.direction,a=n.style,i=function(e,t){var n={};for(var r in e)Wa.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ha){var a,i=Ta(Ha(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Ba.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(n,["direction","style"]),o=jt();return t().createElement(Na,Ga(Ua({},i),{style:Ga(Ua({},a),{transform:"next"===r&&"ltr"===o.dir||"previous"===r&&"rtl"===o.dir?"rotate(270deg)":"rotate(90deg)"})}))}function qa(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}Za.displayName="@mantine/dates/Chevron";var Ka=Object.defineProperty,Xa=Object.defineProperties,Ja=Object.getOwnPropertyDescriptors,Qa=Object.getOwnPropertySymbols,ei=Object.prototype.hasOwnProperty,ti=Object.prototype.propertyIsEnumerable,ni=function(e,t,n){return t in e?Ka(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ri=function(e,t){for(var n in t||(t={}))ei.call(t,n)&&ni(e,n,t[n]);if(Qa){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 qa(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)?qa(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}}}}(Qa(t));try{for(a.s();!(r=a.n()).done;)n=r.value,ti.call(t,n)&&ni(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},ai=function(e,t){return Xa(e,Ja(t))},ii={xs:Ke(30),sm:Ke(36),md:Ke(42),lg:Ke(48),xl:Ke(54)},oi=Gr((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:ai(ri({width:Je({size:i,sizes:ii}),height:Je({size:i,sizes:ii}),fontSize:Je({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]":ai(ri({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]":ri({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]":ri({color:o.color,backgroundColor:o.background},a?null:e.fn.hover({backgroundColor:o.hover})),"&[data-hidden]":{display:"none"}})}}));const li=oi;function si(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 ci=Object.defineProperty,ui=Object.defineProperties,fi=Object.getOwnPropertyDescriptors,di=Object.getOwnPropertySymbols,hi=Object.prototype.hasOwnProperty,pi=Object.prototype.propertyIsEnumerable,vi=function(e,t,n){return t in e?ci(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},mi=function(e,t){for(var n in t||(t={}))hi.call(t,n)&&vi(e,n,t[n]);if(di){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 si(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)?si(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}}}}(di(t));try{for(a.s();!(r=a.n()).done;)n=r.value,pi.call(t,n)&&vi(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},yi=function(e,t){return ui(e,fi(t))},gi=Gr((function(e,t,n){var r=n.size,a=Je({size:r,sizes:ii});return{calendarHeaderControlIcon:{},calendarHeader:{display:"flex",maxWidth:"calc(".concat(a," * 7 + ").concat(Ke(7),")")},calendarHeaderControl:yi(mi({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]":yi(mi({opacity:.2,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})}),calendarHeaderLevel:yi(mi({height:a,borderRadius:e.fn.radius(),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",flex:1,fontSize:Je({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]":yi(mi({cursor:"default",userSelect:"unset"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}}));const bi=gi;function xi(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 _i(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)?_i(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 _i(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 wi=Object.defineProperty,ki=Object.getOwnPropertySymbols,Si=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable,Ci=function(e,t,n){return t in e?wi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ji={nextDisabled:!1,previousDisabled:!1,hasNextLevel:!0,withNext:!0,withPrevious:!0,size:"sm"},Ei=(0,e.forwardRef)((function(e,n){var r=At("CalendarHeader",ji,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,C=r.variant,j=function(e,t){var n={};for(var r in e)Si.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&ki){var a,i=xi(ki(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Oi.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"]),E=bi(null,{name:["CalendarHeader",w],classNames:h,styles:p,unstyled:v,size:O,variant:C}),A=E.classes,D=E.cx,M=k?function(e){return e.preventDefault()}:void 0;return t().createElement(Ir,function(e,t){for(var n in t||(t={}))Si.call(t,n)&&Ci(e,n,t[n]);if(ki){var r,a=xi(ki(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Oi.call(t,n)&&Ci(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:D(A.calendarHeader,a),ref:n},j),_&&t().createElement(ja,{className:A.calendarHeaderControl,"data-previous":!0,"aria-label":s,onClick:u,unstyled:v,onMouseDown:M,disabled:y,"data-disabled":y||void 0,tabIndex:k?-1:0,"data-mantine-stop-propagation":S||void 0},o||t().createElement(Za,{className:A.calendarHeaderControlIcon,direction:"previous","data-previous":!0})),t().createElement(ja,{component:g?"button":"div",className:A.calendarHeaderLevel,onClick:g?f:void 0,unstyled:v,onMouseDown:g?M: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(ja,{className:A.calendarHeaderControl,"data-next":!0,"aria-label":l,onClick:c,unstyled:v,onMouseDown:M,disabled:m,"data-disabled":m||void 0,tabIndex:k?-1:0,"data-mantine-stop-propagation":S||void 0},i||t().createElement(Za,{className:A.calendarHeaderControlIcon,direction:"next","data-next":!0})))}));function Ai(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 Di(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 Mi(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function Pi(e,t){return!(t instanceof Date)||v()(e).isBefore(v()(t).add(1,"day"),"day")}function Ri(e,t){return!(t instanceof Date)||v()(e).isAfter(v()(t).subtract(1,"day"),"day")}function Ii(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}Ei.displayName="@mantine/dates/CalendarHeader";var Li=Object.defineProperty,Ni=Object.defineProperties,Ti=Object.getOwnPropertyDescriptors,Fi=Object.getOwnPropertySymbols,zi=Object.prototype.hasOwnProperty,$i=Object.prototype.propertyIsEnumerable,Vi=function(e,t,n){return t in e?Li(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Hi=function(e,t){for(var n in t||(t={}))zi.call(t,n)&&Vi(e,n,t[n]);if(Fi){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 Ii(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)?Ii(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}}}}(Fi(t));try{for(a.s();!(r=a.n()).done;)n=r.value,$i.call(t,n)&&Vi(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};const Wi=Gr((function(e){return{monthThead:{},monthRow:{},monthTbody:{},monthCell:{padding:0,"&[data-with-spacing]":{padding:Ke(.5)}},month:(t=Hi({},e.fn.fontStyles()),n={borderCollapse:"collapse",tableLayout:"fixed","& *":{boxSizing:"border-box"}},Ni(t,Ti(n)))};var t,n}));function Bi(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 Yi(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)?Yi(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 Yi(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 Ui=Object.defineProperty,Gi=Object.getOwnPropertySymbols,Zi=Object.prototype.hasOwnProperty,qi=Object.prototype.propertyIsEnumerable,Ki=function(e,t,n){return t in e?Ui(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Xi={tabIndex:0,size:"sm"},Ji=(0,e.forwardRef)((function(e,n){var r=At("Day",Xi,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,m=r.renderDay,y=r.inRange,g=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)Zi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Gi){var a,i=Bi(Gi(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&qi.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=li({radius:o,isStatic:_},{name:["Day",f],classNames:c,styles:s,unstyled:u,variant:w,size:k}),C=O.classes,j=O.cx;return t().createElement(ja,function(e,t){for(var n in t||(t={}))Zi.call(t,n)&&Ki(e,n,t[n]);if(Gi){var r,a=Bi(Gi(t));try{for(a.s();!(r=a.n()).done;)n=r.value,qi.call(t,n)&&Ki(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({component:_?"div":"button",ref:n,className:j(C.day,a),disabled:l,"data-today":v()(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":y&&!l||void 0,"data-first-in-range":g&&!l||void 0,"data-last-in-range":b&&!l||void 0,unstyled:u},S),(null==m?void 0:m(i))||i.getDate())}));Ji.displayName="@mantine/dates/Day";var Qi=Gr((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:Je({size:r,sizes:e.fontSizes}),textTransform:"capitalize",paddingBottom:"calc(".concat(Je({size:r,sizes:e.spacing})," / 2)")}}}));const eo=Qi;function to(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 no(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)?no(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 no(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 ro=Object.defineProperty,ao=Object.getOwnPropertySymbols,io=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,lo=function(e,t,n){return t in e?ro(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},so={weekdayFormat:"dd",cellComponent:"th",size:"sm"},co=(0,e.forwardRef)((function(e,n){var r=At("WeekdaysRow",so,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,m=function(e,t){var n={};for(var r in e)io.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&ao){var a,i=to(ao(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&oo.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"]),y=sa(),g=eo(null,{name:["WeekdaysRow",c],classNames:u,styles:f,unstyled:d,variant:h,size:p}),b=g.classes,x=g.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=v()().day(i),l=[],s=0;s<7;s+=1)"string"==typeof r?l.push(v()(o).add(s,"days").locale(t).format(r)):l.push(r(v()(o).add(s,"days").toDate()));return l}({locale:y.getLocale(i),format:l,firstDayOfWeek:y.getFirstDayOfWeek(o)}).map((function(e,n){return t().createElement(s,{key:n,className:b.weekday},e)}));return t().createElement(Ir,function(e,t){for(var n in t||(t={}))io.call(t,n)&&lo(e,n,t[n]);if(ao){var r,a=to(ao(t));try{for(a.s();!(r=a.n()).done;)n=r.value,oo.call(t,n)&&lo(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({component:"tr",ref:n,className:x(b.weekdaysRow,a)},m),_)}));function uo(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 fo(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)?fo(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 fo(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}co.displayName="@mantine/dates/WeekdaysRow";var ho=Object.defineProperty,po=Object.defineProperties,vo=Object.getOwnPropertyDescriptors,mo=Object.getOwnPropertySymbols,yo=Object.prototype.hasOwnProperty,go=Object.prototype.propertyIsEnumerable,bo=function(e,t,n){return t in e?ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},xo=function(e,t){for(var n in t||(t={}))yo.call(t,n)&&bo(e,n,t[n]);if(mo){var r,a=uo(mo(t));try{for(a.s();!(r=a.n()).done;)n=r.value,go.call(t,n)&&bo(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},_o=function(e,t){return po(e,vo(t))},wo={size:"sm",withCellSpacing:!0},ko=(0,e.forwardRef)((function(e,n){var r=At("Month",wo,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,m=r.excludeDate,y=r.minDate,g=r.maxDate,b=r.renderDay,x=r.hideOutsideDates,_=r.hideWeekdays,w=r.getDayAriaLabel,k=r.static,S=r.__getDayRef,O=r.__onDayKeyDown,C=r.__onDayClick,j=r.__onDayMouseEnter,E=r.__preventFocus,A=r.__stopPropagation,D=r.withCellSpacing,M=r.size,P=r.variant,R=function(e,t){var n={};for(var r in e)yo.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&mo){var a,i=uo(mo(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&go.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=sa(),L=Wi(null,{name:["Month",s],classNames:i,styles:o,unstyled:l,variant:P,size:M}),N=L.classes,T=L.cx,F={__staticSelector:s||"Month",classNames:i,styles:o,unstyled:l,variant:P,size:M},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=Di(new Date(e.getFullYear(),e.getMonth()+1,0),t),i=Ai(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)),$=function(e,t,n,r,a,i,o){var l=e.flat().filter((function(e){var l;return Pi(e,n)&&Ri(e,t)&&!(null==a?void 0:a(e))&&!(null==(l=null==r?void 0:r(e))?void 0:l.disabled)&&(!i||Mi(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 v()().isSame(e,"date")}))||l[0]}(z,y,g,p,m,x,d),V=z.map((function(e,n){var r=e.map((function(e,r){var a=!Mi(e,d),i=(null==w?void 0:w(e))||v()(e).locale(c||I.locale).format("D MMMM YYYY"),o=null==p?void 0:p(e),l=v()(e).isSame($,"date");return t().createElement("td",{key:e.toString(),className:N.monthCell,"data-with-spacing":D||void 0},t().createElement(Ji,_o(xo(_o(xo({},F),{"data-mantine-stop-propagation":A||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==m?void 0:m(e))||!Pi(e,g)||!Ri(e,y),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==j||j(t,e)},onClick:function(t){var n;null==(n=null==o?void 0:o.onClick)||n.call(o,t),null==C||C(t,e)},onMouseDown:function(e){var t;null==(t=null==o?void 0:o.onMouseDown)||t.call(o,e),E&&e.preventDefault()},tabIndex:E||!l?-1:0})))}));return t().createElement("tr",{key:n,className:N.monthRow},r)}));return t().createElement(Ir,xo({component:"table",className:T(N.month,a),ref:n},R),!_&&t().createElement("thead",{className:N.monthThead},t().createElement(co,_o(xo({},F),{locale:c,firstDayOfWeek:u,weekdayFormat:f}))),t().createElement("tbody",{className:N.monthTbody},V))}));function So(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 Oo(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)?Oo(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 Oo(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}ko.displayName="@mantine/dates/Month";var Co=Object.defineProperty,jo=Object.getOwnPropertySymbols,Eo=Object.prototype.hasOwnProperty,Ao=Object.prototype.propertyIsEnumerable,Do=function(e,t,n){return t in e?Co(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Mo=function(e,t){for(var n in t||(t={}))Eo.call(t,n)&&Do(e,n,t[n]);if(jo){var r,a=So(jo(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ao.call(t,n)&&Do(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Po={monthLabelFormat:"MMMM YYYY"},Ro=(0,e.forwardRef)((function(e,n){var r=At("MonthLevel",Po,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,m=r.hideWeekdays,y=r.getDayAriaLabel,g=r.__getDayRef,b=r.__onDayKeyDown,x=r.__onDayClick,_=r.__onDayMouseEnter,w=r.withCellSpacing,k=r.__preventFocus,S=r.__stopPropagation,O=r.nextIcon,C=r.previousIcon,j=r.nextLabel,E=r.previousLabel,A=r.onNext,D=r.onPrevious,M=r.onLevelClick,P=r.nextDisabled,R=r.previousDisabled,I=r.hasNextLevel,L=r.levelControlAriaLabel,N=r.withNext,T=r.withPrevious,F=r.className,z=r.monthLabelFormat,$=r.classNames,V=r.styles,H=r.unstyled,W=r.__staticSelector,B=r.size,Y=r.variant,U=r.static,G=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=So(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,["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"]),Z=Xr(null,{name:["MonthLevel",W],classNames:$,styles:V,unstyled:H,variant:Y,size:B}),q=Z.classes,K=Z.cx,X=sa(),J={__staticSelector:W||"MonthLevel",classNames:$,styles:V,unstyled:H,variant:Y,size:B},Q="boolean"==typeof P?P:!!d&&!v()(a).endOf("month").isBefore(d),ee="boolean"==typeof R?R:!!f&&!v()(a).startOf("month").isAfter(f);return t().createElement(Ir,Mo({className:K(q.monthLevel,F),"data-month-level":!0,ref:n},G),t().createElement(Ei,Mo({label:"function"==typeof z?z(a):v()(a).locale(i||X.locale).format(z),className:q.calendarHeader,__preventFocus:k,__stopPropagation:S,nextIcon:O,previousIcon:C,nextLabel:j,previousLabel:E,onNext:A,onPrevious:D,onLevelClick:M,nextDisabled:Q,previousDisabled:ee,hasNextLevel:I,levelControlAriaLabel:L,withNext:N,withPrevious:T},J)),t().createElement(ko,Mo({month:a,locale:i,firstDayOfWeek:o,weekdayFormat:l,weekendDays:s,getDayProps:c,excludeDate:u,minDate:f,maxDate:d,renderDay:h,hideOutsideDates:p,hideWeekdays:m,getDayAriaLabel:y,__getDayRef:g,__onDayKeyDown:b,__onDayClick:x,__onDayMouseEnter:_,__preventFocus:k,__stopPropagation:S,static:U,withCellSpacing:w},J)))}));function Io(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")?Io({controlsRef:r,direction:a,levelIndex:c.levelIndex,cellIndex:c.cellIndex,rowIndex:c.rowIndex,size:s}):u.focus())}}function Lo(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);Io({controlsRef:t,direction:o,levelIndex:n,rowIndex:r,cellIndex:a,size:l})}}function No(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 To(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)?To(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 To(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}Ro.displayName="@mantine/dates/MonthLevel";var Fo=Object.defineProperty,zo=Object.getOwnPropertySymbols,$o=Object.prototype.hasOwnProperty,Vo=Object.prototype.propertyIsEnumerable,Ho=function(e,t,n){return t in e?Fo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Wo={numberOfColumns:1},Bo=(0,e.forwardRef)((function(n,r){var a=At("MonthLevelGroup",Wo,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,m=a.hideOutsideDates,y=a.hideWeekdays,g=a.getDayAriaLabel,b=a.__onDayClick,x=a.__onDayMouseEnter,_=a.withCellSpacing,w=a.__preventFocus,k=a.nextIcon,S=a.previousIcon,O=a.nextLabel,C=a.previousLabel,j=a.onNext,E=a.onPrevious,A=a.onLevelClick,D=a.nextDisabled,M=a.previousDisabled,P=a.hasNextLevel,R=a.className,I=a.classNames,L=a.styles,N=a.unstyled,T=a.numberOfColumns,F=a.levelControlAriaLabel,z=a.monthLabelFormat,$=a.__staticSelector,V=a.__stopPropagation,H=a.size,W=a.variant,B=a.static,Y=function(e,t){var n={};for(var r in e)$o.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&zo){var a,i=No(zo(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Vo.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=Kr(null,{name:["MonthLevelGroup",$],classNames:I,styles:L,unstyled:N,variant:W,size:H}),G=U.classes,Z=U.cx,q=(0,e.useRef)([]),K=Array(T).fill(0).map((function(e,n){var r=v()(i).add(n,"months").toDate();return t().createElement(Ro,{key:n,month:r,withNext:n===T-1,withPrevious:0===n,monthLabelFormat:z,__stopPropagation:V,__onDayClick:b,__onDayMouseEnter:x,__onDayKeyDown:function(e,t){return Lo({levelIndex:n,rowIndex:t.rowIndex,cellIndex:t.cellIndex,event:e,controlsRef:q})},__getDayRef:function(e,t,r){Array.isArray(q.current[n])||(q.current[n]=[]),Array.isArray(q.current[n][e])||(q.current[n][e]=[]),q.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:m,hideWeekdays:y,getDayAriaLabel:g,__preventFocus:w,nextIcon:k,previousIcon:S,nextLabel:O,previousLabel:C,onNext:j,onPrevious:E,onLevelClick:A,nextDisabled:D,previousDisabled:M,hasNextLevel:P,classNames:I,styles:L,unstyled:N,__staticSelector:$||"MonthLevelGroup",size:H,variant:W,static:B,withCellSpacing:_})}));return t().createElement(Ir,function(e,t){for(var n in t||(t={}))$o.call(t,n)&&Ho(e,n,t[n]);if(zo){var r,a=No(zo(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Vo.call(t,n)&&Ho(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:Z(G.monthLevelGroup,R),ref:r},Y),K)}));Bo.displayName="@mantine/dates/MonthLevelGroup";var Yo=Gr((function(e,t,n){return{yearLevelGroup:{display:"flex","& [data-year-level]:not(:last-of-type)":{marginRight:Je({size:n.size,sizes:e.spacing})}}}}));const Uo=Yo,Go=Gr((function(e){return{yearLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}}));function Zo(e,t,n){return!!((t||n)&&(t&&v()(e).isBefore(t,"month")||n&&v()(e).isAfter(n,"month")))}const qo=Gr((function(){return{monthsList:{borderCollapse:"collapse",borderWidth:0,cursor:"pointer"},monthsListCell:{padding:0,"&[data-with-spacing]":{padding:Ke(.5)}},monthsListRow:{}}}));function Ko(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 Xo=Object.defineProperty,Jo=Object.defineProperties,Qo=Object.getOwnPropertyDescriptors,el=Object.getOwnPropertySymbols,tl=Object.prototype.hasOwnProperty,nl=Object.prototype.propertyIsEnumerable,rl=function(e,t,n){return t in e?Xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},al=function(e,t){for(var n in t||(t={}))tl.call(t,n)&&rl(e,n,t[n]);if(el){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 Ko(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)?Ko(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}}}}(el(t));try{for(a.s();!(r=a.n()).done;)n=r.value,nl.call(t,n)&&rl(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},il=function(e,t){return Jo(e,Qo(t))},ol=Gr((function(e,t,n){var r=n.size,a=e.fn.variant({variant:"filled"}),i=e.fn.variant({variant:"light"});return{pickerControl:il(al({fontSize:Je({size:r,sizes:e.fontSizes}),height:Je({size:r,sizes:ii}),width:"calc((".concat(Je({size:r,sizes:ii})," * 7) / 3 + ").concat(Ke(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]":al({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]":al({color:a.color,backgroundColor:a.background},e.fn.hover({backgroundColor:a.hover})),"&[data-disabled]":il(al({color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[4],cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}}));const ll=ol;function sl(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 cl(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)?cl(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 cl(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 ul=Object.defineProperty,fl=Object.getOwnPropertySymbols,dl=Object.prototype.hasOwnProperty,hl=Object.prototype.propertyIsEnumerable,pl=function(e,t,n){return t in e?ul(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},vl={size:"sm"},ml=(0,e.forwardRef)((function(e,n){var r=At("PickerControl",vl,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)dl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&fl){var a,i=sl(fl(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&hl.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=ll(null,{name:["PickerControl",p],classNames:s,styles:c,unstyled:u,variant:m,size:v}),b=g.classes,x=g.cx;return t().createElement(ja,function(e,t){for(var n in t||(t={}))dl.call(t,n)&&pl(e,n,t[n]);if(fl){var r,a=sl(fl(t));try{for(a.s();!(r=a.n()).done;)n=r.value,hl.call(t,n)&&pl(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 yl(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 gl(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)?gl(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 gl(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}ml.displayName="@mantine/dates/PickerControl";var bl=Object.defineProperty,xl=Object.defineProperties,_l=Object.getOwnPropertyDescriptors,wl=Object.getOwnPropertySymbols,kl=Object.prototype.hasOwnProperty,Sl=Object.prototype.propertyIsEnumerable,Ol=function(e,t,n){return t in e?bl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Cl=function(e,t){for(var n in t||(t={}))kl.call(t,n)&&Ol(e,n,t[n]);if(wl){var r,a=yl(wl(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Sl.call(t,n)&&Ol(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},jl={monthsListFormat:"MMM",size:"sm",withCellSpacing:!0},El=(0,e.forwardRef)((function(e,n){var r=At("MonthsList",jl,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,m=r.__getControlRef,y=r.__onControlKeyDown,g=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)kl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&wl){var a,i=yl(wl(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Sl.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"]),C=qo(null,{name:["MonthsList",p],classNames:f,styles:d,unstyled:h,variant:w,size:_}),j=C.classes,E=C.cx,A=sa(),D=function(e){for(var t=v()(e).startOf("year").toDate(),n=[[],[],[],[]],r=0,a=0;a<4;a+=1)for(var i=0;i<3;i+=1)n[a].push(v()(t).add(r,"months").toDate()),r+=1;return n}(a),M=function(e,t,n,r){var a=e.flat().filter((function(e){var a;return!Zo(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 v()().isSame(e,"month")}))||a[0]}(D,s,c,u),P=D.map((function(e,n){var r=e.map((function(e,r){var a,i=null==u?void 0:u(e),O=v()(e).isSame(M,"month");return t().createElement("td",{key:r,className:j.monthsListCell,"data-with-spacing":S||void 0},t().createElement(ml,(a=Cl({variant:w,size:_,classNames:f,styles:d,unstyled:h,__staticSelector:p||"MonthsList","data-mantine-stop-propagation":k||void 0,disabled:Zo(e,s,c),ref:function(e){return null==m?void 0:m(n,r,e)}},i),xl(a,_l({onKeyDown:function(t){var a;null==(a=null==i?void 0:i.onKeyDown)||a.call(i,t),null==y||y(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==g||g(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}))),v()(e).locale(A.getLocale(l)).format(o)))}));return t().createElement("tr",{key:n,className:j.monthsListRow},r)}));return t().createElement(Ir,Cl({component:"table",ref:n,className:E(j.monthsList,i)},O),t().createElement("tbody",null,P))}));function Al(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 Dl(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)?Dl(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 Dl(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}El.displayName="@mantine/dates/MonthsList";var Ml=Object.defineProperty,Pl=Object.getOwnPropertySymbols,Rl=Object.prototype.hasOwnProperty,Il=Object.prototype.propertyIsEnumerable,Ll=function(e,t,n){return t in e?Ml(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Nl=function(e,t){for(var n in t||(t={}))Rl.call(t,n)&&Ll(e,n,t[n]);if(Pl){var r,a=Al(Pl(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Il.call(t,n)&&Ll(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Tl={yearLabelFormat:"YYYY",size:"sm"},Fl=(0,e.forwardRef)((function(e,n){var r=At("YearLevel",Tl,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,m=r.__preventFocus,y=r.nextIcon,g=r.previousIcon,b=r.nextLabel,x=r.previousLabel,_=r.onNext,w=r.onPrevious,k=r.onLevelClick,S=r.nextDisabled,O=r.previousDisabled,C=r.hasNextLevel,j=r.levelControlAriaLabel,E=r.withNext,A=r.withPrevious,D=r.className,M=r.yearLabelFormat,P=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)Rl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Pl){var a,i=Al(Pl(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Il.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"]),$=Go(null,{name:["YearLevel",L],classNames:P,styles:R,unstyled:I,size:T,variant:F}),V=$.classes,H=$.cx,W=sa(),B={__staticSelector:L||"YearLevel",classNames:P,styles:R,unstyled:I,size:T,variant:F},Y="boolean"==typeof S?S:!!l&&!v()(a).endOf("year").isBefore(l),U="boolean"==typeof O?O:!!o&&!v()(a).startOf("year").isAfter(o);return t().createElement(Ir,Nl({className:H(V.yearLevel,D),"data-year-level":!0,ref:n},z),t().createElement(Ei,Nl({label:"function"==typeof M?M(a):v()(a).locale(i||W.locale).format(M),className:V.calendarHeader,__preventFocus:m,__stopPropagation:N,nextIcon:y,previousIcon:g,nextLabel:b,previousLabel:x,onNext:_,onPrevious:w,onLevelClick:k,nextDisabled:Y,previousDisabled:U,hasNextLevel:C,levelControlAriaLabel:j,withNext:E,withPrevious:A},B)),t().createElement(El,Nl({year:a,locale:i,minDate:o,maxDate:l,monthsListFormat:s,getMonthControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:d,__onControlMouseEnter:h,__preventFocus:m,__stopPropagation:N,withCellSpacing:p},B)))}));function zl(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 $l(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)?$l(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 $l(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}Fl.displayName="@mantine/dates/YearLevel";var Vl=Object.defineProperty,Hl=Object.getOwnPropertySymbols,Wl=Object.prototype.hasOwnProperty,Bl=Object.prototype.propertyIsEnumerable,Yl=function(e,t,n){return t in e?Vl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ul={numberOfColumns:1,size:"sm"},Gl=(0,e.forwardRef)((function(n,r){var a=At("YearLevelGroup",Ul,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,m=a.nextIcon,y=a.previousIcon,g=a.nextLabel,b=a.previousLabel,x=a.onNext,_=a.onPrevious,w=a.onLevelClick,k=a.nextDisabled,S=a.previousDisabled,O=a.hasNextLevel,C=a.className,j=a.classNames,E=a.styles,A=a.unstyled,D=a.__staticSelector,M=a.__stopPropagation,P=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)Wl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Hl){var a,i=zl(Hl(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Bl.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=Uo(null,{name:["YearLevelGroup",D],styles:E,classNames:j,unstyled:A,variant:L,size:N}),z=F.classes,$=F.cx,V=(0,e.useRef)([]),H=Array(P).fill(0).map((function(e,n){var r=v()(i).add(n,"years").toDate();return t().createElement(Fl,{key:n,variant:L,size:N,monthsListFormat:c,year:r,withNext:n===P-1,withPrevious:0===n,yearLabelFormat:I,__stopPropagation:M,__onControlClick:f,__onControlMouseEnter:d,__onControlKeyDown:function(e,t){return Lo({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:m,previousIcon:y,nextLabel:g,previousLabel:b,onNext:x,onPrevious:_,onLevelClick:w,nextDisabled:k,previousDisabled:S,hasNextLevel:O,getMonthControlProps:u,classNames:j,styles:E,unstyled:A,__staticSelector:D||"YearLevelGroup",withCellSpacing:h})}));return t().createElement(Ir,function(e,t){for(var n in t||(t={}))Wl.call(t,n)&&Yl(e,n,t[n]);if(Hl){var r,a=zl(Hl(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Bl.call(t,n)&&Yl(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:$(z.yearLevelGroup,C),ref:r},T),H)}));Gl.displayName="@mantine/dates/YearLevelGroup";const Zl=Gr((function(e){return{decadeLevelGroup:{display:"flex",gap:e.spacing.md}}}));function ql(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 Kl=Gr((function(e){return{decadeLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}}));function Xl(e,t,n){return!!((t||n)&&(t&&v()(e).isBefore(t,"year")||n&&v()(e).isAfter(n,"year")))}const Jl=Gr((function(){return{yearsList:{borderCollapse:"collapse",borderWidth:0},yearsListCell:{padding:0,"&[data-with-spacing]":{padding:Ke(.5)}},yearsListRow:{}}}));function Ql(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 es(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)?es(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 es(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 ts=Object.defineProperty,ns=Object.defineProperties,rs=Object.getOwnPropertyDescriptors,as=Object.getOwnPropertySymbols,is=Object.prototype.hasOwnProperty,os=Object.prototype.propertyIsEnumerable,ls=function(e,t,n){return t in e?ts(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ss=function(e,t){for(var n in t||(t={}))is.call(t,n)&&ls(e,n,t[n]);if(as){var r,a=Ql(as(t));try{for(a.s();!(r=a.n()).done;)n=r.value,os.call(t,n)&&ls(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},cs={yearsListFormat:"YYYY",size:"sm",withCellSpacing:!0},us=(0,e.forwardRef)((function(e,n){var r=At("YearsList",cs,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,m=r.__getControlRef,y=r.__onControlKeyDown,g=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)is.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&as){var a,i=Ql(as(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&os.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"]),C=Jl(null,{name:["YearsList",p],classNames:f,styles:d,unstyled:h,variant:k,size:w}),j=C.classes,E=C.cx,A=sa(),D=ql(a),M=function(e,t,n,r){var a=e.flat().filter((function(e){var a;return!Xl(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 v()().isSame(e,"year")}))||a[0]}(D,s,c,u),P=D.map((function(e,n){var r=e.map((function(e,r){var a,i=null==u?void 0:u(e),O=v()(e).isSame(M,"year");return t().createElement("td",{key:r,className:j.yearsListCell,"data-with-spacing":S||void 0},t().createElement(ml,(a=ss({size:w,variant:k,classNames:f,styles:d,unstyled:h,__staticSelector:p||"YearsList","data-mantine-stop-propagation":_||void 0,disabled:Xl(e,s,c),ref:function(e){return null==m?void 0:m(n,r,e)}},i),ns(a,rs({onKeyDown:function(t){var a;null==(a=null==i?void 0:i.onKeyDown)||a.call(i,t),null==y||y(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==g||g(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}))),v()(e).locale(A.getLocale(l)).format(o)))}));return t().createElement("tr",{key:n,className:j.yearsListRow},r)}));return t().createElement(Ir,ss({component:"table",ref:n,className:E(j.yearsList,i)},O),t().createElement("tbody",null,P))}));function fs(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ds(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 ds(e,t){if(e){if("string"==typeof e)return hs(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)?hs(e,t):void 0}}function hs(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}us.displayName="@mantine/dates/YearsList";var ps=Object.defineProperty,vs=Object.getOwnPropertySymbols,ms=Object.prototype.hasOwnProperty,ys=Object.prototype.propertyIsEnumerable,gs=function(e,t,n){return t in e?ps(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},bs=function(e,t){for(var n in t||(t={}))ms.call(t,n)&&gs(e,n,t[n]);if(vs){var r,a=fs(vs(t));try{for(a.s();!(r=a.n()).done;)n=r.value,ys.call(t,n)&&gs(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},xs={decadeLabelFormat:"YYYY"},_s=(0,e.forwardRef)((function(e,n){var r=At("DecadeLevel",xs,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,m=r.__preventFocus,y=r.nextIcon,g=r.previousIcon,b=r.nextLabel,x=r.previousLabel,_=r.onNext,w=r.onPrevious,k=r.nextDisabled,S=r.previousDisabled,O=r.levelControlAriaLabel,C=r.withNext,j=r.withPrevious,E=r.className,A=r.decadeLabelFormat,D=r.classNames,M=r.styles,P=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)ms.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&vs){var a,i=fs(vs(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&ys.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=Kl(null,{name:["DecadeLevel",R],classNames:D,styles:M,unstyled:P,variant:L,size:N}),z=F.classes,$=F.cx,V=sa(),H=function(e){var t=ql(e);return[t[0][0],t[3][0]]}(a),W=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)||ds(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.")}()}(H,2),B=W[0],Y=W[1],U={__staticSelector:R||"DecadeLevel",classNames:D,styles:M,unstyled:P,variant:L,size:N},G="boolean"==typeof k?k:!!l&&!v()(Y).endOf("year").isBefore(l),Z="boolean"==typeof S?S:!!o&&!v()(B).startOf("year").isAfter(o),q=function(e,t){return v()(e).locale(i||V.locale).format(t)};return t().createElement(Ir,bs({className:$(z.decadeLevel,E),"data-decade-level":!0,ref:n},T),t().createElement(Ei,bs({label:"function"==typeof A?A(B,Y):"".concat(q(B,A)," – ").concat(q(Y,A)),className:z.calendarHeader,__preventFocus:m,__stopPropagation:I,nextIcon:y,previousIcon:g,nextLabel:b,previousLabel:x,onNext:_,onPrevious:w,nextDisabled:G,previousDisabled:Z,hasNextLevel:!1,levelControlAriaLabel:O,withNext:C,withPrevious:j},U)),t().createElement(us,bs({decade:a,locale:i,minDate:o,maxDate:l,yearsListFormat:s,getYearControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:d,__onControlMouseEnter:h,__preventFocus:m,__stopPropagation:I,withCellSpacing:p},U)))}));function ws(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 ks(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)?ks(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 ks(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}_s.displayName="@mantine/dates/DecadeLevel";var Ss=Object.defineProperty,Os=Object.getOwnPropertySymbols,Cs=Object.prototype.hasOwnProperty,js=Object.prototype.propertyIsEnumerable,Es=function(e,t,n){return t in e?Ss(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},As={numberOfColumns:1},Ds=(0,e.forwardRef)((function(n,r){var a=At("DecadeLevelGroup",As,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,m=a.nextIcon,y=a.previousIcon,g=a.nextLabel,b=a.previousLabel,x=a.onNext,_=a.onPrevious,w=a.nextDisabled,k=a.previousDisabled,S=a.className,O=a.classNames,C=a.styles,j=a.unstyled,E=a.__staticSelector,A=a.__stopPropagation,D=a.numberOfColumns,M=a.levelControlAriaLabel,P=a.decadeLabelFormat,R=a.variant,I=a.size,L=function(e,t){var n={};for(var r in e)Cs.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Os){var a,i=ws(Os(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&js.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=Zl(null,{name:["DecadeLevelGroup",E],styles:C,classNames:O,unstyled:j,variant:R,size:I}),T=N.classes,F=N.cx,z=(0,e.useRef)([]),$=Array(D).fill(0).map((function(e,n){var r=v()(i).add(10*n,"years").toDate();return t().createElement(_s,{key:n,variant:R,size:I,yearsListFormat:c,decade:r,withNext:n===D-1,withPrevious:0===n,decadeLabelFormat:P,__onControlClick:f,__onControlMouseEnter:d,__onControlKeyDown:function(e,t){return Lo({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 M?M(r):M,locale:o,minDate:l,maxDate:s,__preventFocus:p,__stopPropagation:A,nextIcon:m,previousIcon:y,nextLabel:g,previousLabel:b,onNext:x,onPrevious:_,nextDisabled:w,previousDisabled:k,getYearControlProps:u,__staticSelector:E||"DecadeLevelGroup",classNames:O,styles:C,unstyled:j,withCellSpacing:h})}));return t().createElement(Ir,function(e,t){for(var n in t||(t={}))Cs.call(t,n)&&Es(e,n,t[n]);if(Os){var r,a=ws(Os(t));try{for(a.s();!(r=a.n()).done;)n=r.value,js.call(t,n)&&Es(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:F(T.decadeLevelGroup,S),ref:r},L),$)}));function Ms(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)||Rs(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 Ps(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Rs(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 Rs(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}}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}Ds.displayName="@mantine/dates/DecadeLevelGroup";var Ls=Object.defineProperty,Ns=Object.getOwnPropertySymbols,Ts=Object.prototype.hasOwnProperty,Fs=Object.prototype.propertyIsEnumerable,zs=function(e,t,n){return t in e?Ls(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},$s=function(e,t){for(var n in t||(t={}))Ts.call(t,n)&&zs(e,n,t[n]);if(Ns){var r,a=Ps(Ns(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Fs.call(t,n)&&zs(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Vs={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0},Hs=(0,e.forwardRef)((function(e,n){var r=At("Calendar",Vs,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,m=r.onYearSelect,y=r.onMonthSelect,g=r.onYearMouseEnter,b=r.onMonthMouseEnter,x=r.__updateDateOnYearSelect,_=r.__updateDateOnMonthSelect,w=r.firstDayOfWeek,k=r.weekdayFormat,S=r.weekendDays,O=r.getDayProps,C=r.excludeDate,j=r.renderDay,E=r.hideOutsideDates,A=r.hideWeekdays,D=r.getDayAriaLabel,M=r.monthLabelFormat,P=r.nextIcon,R=r.previousIcon,I=r.__onDayClick,L=r.__onDayMouseEnter,N=r.withCellSpacing,T=r.monthsListFormat,F=r.getMonthControlProps,z=r.yearLabelFormat,$=r.yearsListFormat,V=r.getYearControlProps,H=r.decadeLabelFormat,W=r.minDate,B=r.maxDate,Y=r.locale,U=r.className,G=r.classNames,Z=r.styles,q=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)Ts.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ns){var a,i=Ps(Ns(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Fs.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=Zr(null,{name:["Calendar",q],classNames:G,styles:Z,unstyled:K,variant:X,size:J}),ue=ce.classes,fe=ce.cx,de=Ms(Mt({value:l?Nr(l,i,a):void 0,defaultValue:o?Nr(o,i,a):void 0,finalValue:Nr(void 0,i,a),onChange:s}),2),he=de[0],pe=de[1],ve=Ms(Mt({value:c,defaultValue:u,finalValue:null,onChange:f}),2),me=ve[0],ye=ve[1],ge={__staticSelector:q||"Calendar",styles:Z,classNames:G,unstyled:K,variant:X,size:J},be=h||d||1,xe=me||new Date;return t().createElement(Ir,$s({className:fe(ue.calendar,U),ref:n},se),"month"===he&&t().createElement(Bo,$s({month:xe,minDate:W,maxDate:B,firstDayOfWeek:w,weekdayFormat:k,weekendDays:S,getDayProps:O,excludeDate:C,renderDay:j,hideOutsideDates:E,hideWeekdays:A,getDayAriaLabel:D,onNext:function(){var e=v()(xe).add(be,"month").toDate();null==ie||ie(e),ye(e)},onPrevious:function(){var e=v()(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:P,previousLabel:null==p?void 0:p.previousMonth,previousIcon:R,monthLabelFormat:M,__onDayClick:I,__onDayMouseEnter:L,__preventFocus:Q,__stopPropagation:ee,static:le,withCellSpacing:N},ge)),"year"===he&&t().createElement(Gl,$s({year:xe,numberOfColumns:d,minDate:W,maxDate:B,monthsListFormat:T,getMonthControlProps:F,locale:Y,onNext:function(){var e=v()(xe).add(be,"year").toDate();null==re||re(e),ye(e)},onPrevious:function(){var e=v()(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:P,previousLabel:null==p?void 0:p.previousYear,previousIcon:R,yearLabelFormat:z,__onControlMouseEnter:b,__onControlClick:function(e,t){_&&ye(t),pe(Nr("month",i,a)),null==y||y(t)},__preventFocus:Q,__stopPropagation:ee,withCellSpacing:N},ge)),"decade"===he&&t().createElement(Ds,$s({decade:xe,minDate:W,maxDate:B,yearsListFormat:$,getYearControlProps:V,locale:Y,onNext:function(){var e=v()(xe).add(10*be,"year").toDate();null==te||te(e),ye(e)},onPrevious:function(){var e=v()(xe).subtract(10*be,"year").toDate();null==ne||ne(e),ye(e)},numberOfColumns:d,nextLabel:null==p?void 0:p.nextDecade,nextIcon:P,previousLabel:null==p?void 0:p.previousDecade,previousIcon:R,decadeLabelFormat:H,__onControlMouseEnter:g,__onControlClick:function(e,t){x&&ye(t),pe(Nr("year",i,a)),null==m||m(t)},__preventFocus:Q,__stopPropagation:ee,withCellSpacing:N},ge)))}));function Ws(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 Bs(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)?Bs(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 Bs(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}Hs.displayName="@mantine/dates/Calendar";var Ys=Object.defineProperty,Us=Object.getOwnPropertySymbols,Gs=Object.prototype.hasOwnProperty,Zs=Object.prototype.propertyIsEnumerable,qs=function(e,t,n){return t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ks=function(e,t){for(var n in t||(t={}))Gs.call(t,n)&&qs(e,n,t[n]);if(Us){var r,a=Ws(Us(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Zs.call(t,n)&&qs(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Xs={type:"default",numberOfColumns:1},Js=(0,e.forwardRef)((function(e,n){var r=At("DatePicker",Xs,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)Gs.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Us){var a,i=Ws(Us(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Zs.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=zt({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(Hs,Ks({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 Ks(Ks({},b(e)),null==c?void 0:c(e))}},p))}));Js.displayName="@mantine/dates/DatePicker";var Qs=(0,e.memo)((function(e){var t=e.theme,n=e.onSelectCustomDatePeriod,r=e.custom_date_period;return React.createElement("div",{className:"absolute -left-[120px] top-[calc(100%+4px)] bg-white rounded-md shadow-box z-20 p-2 w-[290px] dark:bg-[#343d43] dark:text-white"},React.createElement(Js,{styles:{calendarHeaderLevel:{"&":{color:"dark"===t?"rgb(221, 221, 221)":"inherit"},"&:hover":{color:"dark"===t?"#000":"inherit"}},calendarHeaderControlIcon:{"&":{color:"dark"===t?"rgb(221, 221, 221)":"inherit"},"&:hover":{color:"dark"===t?"#000":"inherit"}},pickerControl:{"&":{color:"dark"===t?"rgb(221, 221, 221)":"inherit"},"&:hover":{color:"dark"===t?"#000":"inherit"}},day:{"&":{color:"dark"===t?"#fff":"inherit"},"&:hover":{color:"dark"===t?"#000":"inherit"},"&[data-in-range], &[data-in-range]:hover":{color:"dark"===t?"#000":"inherit"},"&[data-first-in-range], &[data-first-in-range]:hover":{color:"#fff"},"&[data-last-in-range], &[data-last-in-range]:hover":{color:"#fff"},"&[data-disabled]":{color:"dark"===t?"rgba(255, 255, 255, 0.4)":"rgb(206, 212, 218)"}}},type:"range",value:r,allowSingleDateInRange:!0,weekendDays:[],getDayProps:function(e){var t=(new Date).getDate(),n=(new Date).getMonth(),r=(new Date).getFullYear();return e.getDate()>t&&e.getMonth()>=n&&e.getFullYear()>=r||e.getMonth()>n&&e.getFullYear()>=r||e.getFullYear()>r?{disabled:!0}:e.getDate()===t&&e.getMonth()===n&&e.getFullYear()===r?{style:{backgroundColor:"rgb(233, 233, 233)",color:"var(--mantine-color-white)"}}:{}},onChange:function(e){return n(e)}}))}));const ec=Qs;function tc(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 nc=(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=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 tc(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)?tc(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),c=s[0],u=s[1],f=(0,e.useRef)("Filters_Custom_Date_Selector");b(f,(function(){u(!1)}));var d={today:fbox_admin_js_object.langs.TODAY,yesterday:fbox_admin_js_object.langs.YESTERDAY,last_7_days:fbox_admin_js_object.langs.LAST_7_DAYS,last_30_days:fbox_admin_js_object.langs.LAST_30_DAYS,last_week:fbox_admin_js_object.langs.LAST_WEEK,last_month:fbox_admin_js_object.langs.LAST_MONTH,custom:fbox_admin_js_object.langs.CUSTOM},h=function(e){l(e),2===e.length&&null!==e[0]&&null!==e[1]&&(u(!1),o("custom"),localStorage.setItem("firebox_analytics_date_period","custom"),localStorage.setItem("firebox_analytics_custom_date_period",JSON.stringify(e)))},p=t().useRef();return t().createElement("div",{className:"flex gap-2 lg:gap-3 flex-wrap"},Object.keys(d).map((function(e,n){var l="custom"===e?f:p;return t().createElement("div",{ref:l,className:"relative shadow-none cursor-pointer hover:text-default dark:hover:text-white".concat(a===e&&"custom"!==e?" pointer-events-none":""," ").concat(a===e?"text-default dark:text-white underline underline-offset-4":"custom"===e&&c?" text-default dark:text-white":"text-grey-1"),key:n},t().createElement("div",{onClick:function(){var t;"custom"===(t=e)?u(!c):(o(t),u(!1),localStorage.setItem("firebox_analytics_date_period",t),localStorage.removeItem("firebox_analytics_custom_date_period"))}},"custom"===a&&e===a&&2===i.length&&null!==i[0]&&null!==i[1]?v()(i[0]).format("D MMM YYYY")+" - "+v()(i[1]).format("D MMM YYYY"):d[e]),"custom"===e&&c&&t().createElement(ec,{theme:r,onSelectCustomDatePeriod:h,custom_date_period:i}))})))}));const rc=nc,ac=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"})))};function ic(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 oc(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)?oc(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 oc(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 lc=(0,e.memo)((function(n){var r=n.selected_campaign,a=n.onSelectCampaign,i=ic((0,e.useState)(!1),2),o=i[0],l=i[1],s=ic((0,e.useState)(null),2),c=s[0],u=s[1],f=ic((0,e.useState)(""),2),d=f[0],h=f[1],p=ic((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");return b(g,(function(){l(!1)})),(0,e.useEffect)((function(){if(null===c){var e=new IntersectionObserver((function(t){if(ic(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]),t().createElement("div",{ref:g,className:"relative"},t().createElement("div",{className:"leading-[24px] max-w-[220px] 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 cursor-pointer truncate justify-end",onClick:function(){l((function(e){return!e}))}},t().createElement("div",{className:"truncate",title:v},v),t().createElement(ac,{className:o?"rotate-180":""}))),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 sc=lc;function cc(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 uc=function e(t,n){function r(e,r,a){if("undefined"!=typeof document){"number"==typeof(a=cc({},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,"",cc({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,cc({},this.attributes,t))},withConverter:function(t){return e(cc({},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 fc(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 dc=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"}}))},hc=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 fc(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)?fc(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}}))},pc={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:"#55A19D"},conversionrate:{label:fbox_admin_js_object.langs.CONVERSION_RATE,colorClass:"text-metric-conversion-rate",color:"#DAB440",suffix:"%"}},vc=function(){return"dark"===(uc.get("fireplugins_theme")||"light")?"dark":"light"},mc=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"})),React.createElement("div",{className:"flex flex-wrap gap-2"},React.createElement("div",{className:"animate-pulse h-3 w-[120px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 w-[120px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 w-[120px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 w-[120px] bg-slate-200 dark:bg-slate-700 rounded"})))},yc={list:fbox_admin_js_object.langs.DAILY,weekly:fbox_admin_js_object.langs.WEEKLY,monthly:fbox_admin_js_object.langs.MONTHLY};function gc(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 bc=function(){var n=f(),r=u(),a=r.date_period,i=r.custom_date_period,o=r.selected_campaign,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 gc(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)?gc(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)(vc()),2),s=l[0],c=l[1];(0,e.useEffect)((function(){var e=function(){c(vc())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var d=(0,e.useCallback)((function(e){n({type:"SET_DATE_PERIOD",payload:e})}),[]),h=(0,e.useCallback)((function(e){n({type:"SET_CAMPAIGN_DATA",payload:null}),n({type:"SET_SELECTED_CAMPAIGN",payload:e})}),[]),p=(0,e.useCallback)((function(e){n({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(rc,{theme:s,date_period:a,custom_date_period:i,onSelectDatePeriod:d,onSelectCustomDatePeriod:p}),t().createElement(sc,{selected_campaign:o,onSelectCampaign:h}))};var xc=function(e){var t=e.num,n=e.decimalPoints,r=void 0===n||n,a=e.showSuffix,i=void 0===a||a,o=["","k","m"],l=0;for(t=null==t?0:t;t>=1e3&&l<o.length-1;)t/=1e3,l++;var s=r?t%1==0?0:1:0;return t.toFixed(s).replace(/\.0+$/,"")+(i?o[l]:"")},_c=function(e,t){return e=parseFloat(e)||0,0!==(t=parseFloat(t)||0)?parseInt(((e-t)/t*100).toFixed(0)):0},wc=(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%+5px)]":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-box left-1/2 ").concat(l," translate-x-[-50%] bg-[#343d43] ").concat(c," rounded-[4px] text-white ").concat(r," ").concat(i," ").concat(""!==h?" "+h:"")},t,React.createElement("div",{className:"invisible absolute -top-[3px] left-1/2 translate-x-[-50%] h-1 w-1 bg-inherit before:visible before:absolute before:h-1 before:w-1 before:rotate-45 before:translate-x-[-50%] before:bg-inherit before:content-['']"}))}));const kc=wc,Sc=function(e){var t=e.icon,n=e.label,r=e.value,a=e.previousPeriodValue,i=e.suffix,o=e.formatSuffix,l=e.decimalPoints,s=void 0===l||l,c=e.tooltipMessage,u=_c(r,a),f=xc({num:u}),d=function(){return React.createElement(React.Fragment,null,xc({num:r,showSuffix:o,decimalPoints:s}),null!=i?i:"")};return React.createElement("div",{className:"relative group flex flex-col bg-white dark:bg-dark-1 px-[19px] py-2 rounded gap-[4px]"},React.createElement("div",{className:"flex items-center gap-[4px]"},t,React.createElement("div",{className:"text-lg dark:text-white"},n)),React.createElement("div",{className:"flex items-center gap-1 h-5"},React.createElement("div",{className:"text-[32px] font-bold leading-none dark:text-white"},null!=e&&e.formatNumberLayout?e.formatNumberLayout({num:r,suffix:i,showSuffix:o,decimalPoints:s,defaultLayout:d}):d()),0!=u&&React.createElement("div",{className:"inline-flex items-start flex-col gap-[4px]",title:fbox_admin_js_object.langs.PERCENTAGE_DIFFERENCE_AGAINST_PREVIOUS_PERIOD},React.createElement("div",{className:"inline-flex items-center gap-[4px] leading-none"},React.createElement("span",{className:"text-[12px] font-bold ".concat(u>0?"text-custom-green":"text-custom-red")},f,"%"),u>0?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"}))),React.createElement("span",{className:"text-[10px] text-grey-1 leading-none"},fbox_admin_js_object.langs.VS_PREVIOUS_PERIOD))),React.createElement(kc,{size:"w-[calc(100%+20px)]",fontSize:"text-[14px]",textAlign:"text-left",padding:"p-2",top:"top-full",className:"delay-500"},c))};var Oc=(0,e.memo)((function(e){var t=e.overall;return React.createElement(Sc,{icon: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_333_14881",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_333_14881)"},React.createElement("path",{d:"M12.0023 15.5769C13.1354 15.5769 14.0978 15.1803 14.8895 14.3871C15.6811 13.5939 16.077 12.6308 16.077 11.4977C16.077 10.3646 15.6804 9.40224 14.8872 8.61058C14.094 7.81891 13.1309 7.42308 11.9978 7.42308C10.8647 7.42308 9.90234 7.81966 9.11067 8.61282C8.31901 9.40601 7.92317 10.3692 7.92317 11.5023C7.92317 12.6353 8.31976 13.5977 9.11293 14.3894C9.90611 15.181 10.8692 15.5769 12.0023 15.5769ZM12.0001 14.2C11.2501 14.2 10.6126 13.9375 10.0876 13.4125C9.56258 12.8875 9.30007 12.25 9.30007 11.5C9.30007 10.75 9.56258 10.1125 10.0876 9.58748C10.6126 9.06248 11.2501 8.79998 12.0001 8.79998C12.7501 8.79998 13.3876 9.06248 13.9126 9.58748C14.4376 10.1125 14.7001 10.75 14.7001 11.5C14.7001 12.25 14.4376 12.8875 13.9126 13.4125C13.3876 13.9375 12.7501 14.2 12.0001 14.2ZM12.0014 18.5C9.70183 18.5 7.60651 17.8657 5.71547 16.5971C3.82446 15.3285 2.43216 13.6295 1.53857 11.5C2.43216 9.37049 3.82401 7.67146 5.71412 6.40288C7.60422 5.13429 9.69908 4.5 11.9987 4.5C14.2983 4.5 16.3936 5.13429 18.2847 6.40288C20.1757 7.67146 21.568 9.37049 22.4616 11.5C21.568 13.6295 20.1761 15.3285 18.286 16.5971C16.3959 17.8657 14.3011 18.5 12.0014 18.5ZM12.0001 17C13.8834 17 15.6126 16.5041 17.1876 15.5125C18.7626 14.5208 19.9667 13.1833 20.8001 11.5C19.9667 9.81664 18.7626 8.47914 17.1876 7.48748C15.6126 6.49581 13.8834 5.99998 12.0001 5.99998C10.1167 5.99998 8.38757 6.49581 6.81257 7.48748C5.23757 8.47914 4.03341 9.81664 3.20007 11.5C4.03341 13.1833 5.23757 14.5208 6.81257 15.5125C8.38757 16.5041 10.1167 17 12.0001 17Z",fill:"#5383EC"}))),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/firebox/analytics/#Views",target:"_blank",className:"text-[#888] no-underline font-semibold hover:text-white"},fbox_admin_js_object.langs.READ_MORE.toUpperCase())))})}));const Cc=Oc;var jc=(0,e.memo)((function(e){var t=e.overall;return React.createElement(Sc,{icon: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_308_3226",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_308_3226)"},React.createElement("path",{d:"M6.02308 17.2923C6.87308 16.6615 7.79903 16.1635 8.80095 15.7981C9.80287 15.4327 10.8692 15.25 12 15.25C13.1307 15.25 14.1971 15.4327 15.199 15.7981C16.2009 16.1635 17.1269 16.6615 17.9769 17.2923C18.5987 16.609 19.0913 15.8179 19.4548 14.9192C19.8182 14.0205 20 13.0474 20 12C20 9.78331 19.2208 7.89581 17.6625 6.33748C16.1041 4.77914 14.2166 3.99998 12 3.99998C9.78331 3.99998 7.89581 4.77914 6.33748 6.33748C4.77914 7.89581 3.99998 9.78331 3.99998 12C3.99998 13.0474 4.18171 14.0205 4.54518 14.9192C4.90864 15.8179 5.40128 16.609 6.02308 17.2923ZM12.0003 12.75C11.0873 12.75 10.3173 12.4366 9.69038 11.8099C9.06346 11.1831 8.75 10.4133 8.75 9.50028C8.75 8.58726 9.06336 7.81729 9.69008 7.19038C10.3168 6.56346 11.0867 6.25 11.9997 6.25C12.9127 6.25 13.6827 6.56336 14.3096 7.19008C14.9365 7.81681 15.25 8.58668 15.25 9.49968C15.25 10.4127 14.9366 11.1827 14.3099 11.8096C13.6831 12.4365 12.9133 12.75 12.0003 12.75ZM12 21.5C10.6807 21.5 9.44325 21.2519 8.2875 20.7557C7.13173 20.2596 6.12628 19.5839 5.27115 18.7288C4.41603 17.8737 3.7404 16.8682 3.24425 15.7125C2.74808 14.5567 2.5 13.3192 2.5 12C2.5 10.6807 2.74808 9.44325 3.24425 8.2875C3.7404 7.13173 4.41603 6.12628 5.27115 5.27115C6.12628 4.41603 7.13173 3.7404 8.2875 3.24425C9.44325 2.74808 10.6807 2.5 12 2.5C13.3192 2.5 14.5567 2.74808 15.7125 3.24425C16.8682 3.7404 17.8737 4.41603 18.7288 5.27115C19.5839 6.12628 20.2596 7.13173 20.7557 8.2875C21.2519 9.44325 21.5 10.6807 21.5 12C21.5 13.3192 21.2519 14.5567 20.7557 15.7125C20.2596 16.8682 19.5839 17.8737 18.7288 18.7288C17.8737 19.5839 16.8682 20.2596 15.7125 20.7557C14.5567 21.2519 13.3192 21.5 12 21.5ZM12 20C12.9025 20 13.7727 19.8548 14.6105 19.5644C15.4484 19.274 16.1923 18.8679 16.8423 18.3461C16.1923 17.8436 15.458 17.4519 14.6394 17.1711C13.8208 16.8903 12.941 16.75 12 16.75C11.0589 16.75 10.1775 16.8887 9.35573 17.1663C8.53393 17.4439 7.80123 17.8371 7.15765 18.3461C7.80765 18.8679 8.55157 19.274 9.3894 19.5644C10.2272 19.8548 11.0974 20 12 20ZM12 11.25C12.4974 11.25 12.9134 11.0827 13.2481 10.7481C13.5827 10.4134 13.75 9.99741 13.75 9.49998C13.75 9.00254 13.5827 8.58651 13.2481 8.25188C12.9134 7.91726 12.4974 7.74995 12 7.74995C11.5025 7.74995 11.0865 7.91726 10.7519 8.25188C10.4173 8.58651 10.25 9.00254 10.25 9.49998C10.25 9.99741 10.4173 10.4134 10.7519 10.7481C11.0865 11.0827 11.5025 11.25 12 11.25Z",fill:"#55A19D"}))),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/firebox/analytics/#Conversions",target:"_blank",className:"text-[#888] no-underline font-semibold hover:text-white"},fbox_admin_js_object.langs.READ_MORE.toUpperCase())))})}));const Ec=jc;var Ac=(0,e.memo)((function(e){var t=e.overall;return React.createElement(Sc,{icon:React.createElement("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("mask",{id:"mask0_308_3237",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"25",height:"24"},React.createElement("rect",{x:"0.5",width:"24",height:"24",fill:"#D9D9D9"})),React.createElement("g",{mask:"url(#mask0_308_3237)"},React.createElement("path",{d:"M19.5 20.75C18.8756 20.75 18.3195 20.5625 17.8317 20.1875C17.3439 19.8125 17.0224 19.3333 16.8673 18.75H11.5C10.4641 18.75 9.58011 18.3839 8.84808 17.6519C8.11603 16.9198 7.75 16.0359 7.75 15C7.75 13.9641 8.11603 13.0801 8.84808 12.3481C9.58011 11.616 10.4641 11.25 11.5 11.25H13.5C14.1187 11.25 14.6484 11.0295 15.0891 10.5885C15.5297 10.1475 15.75 9.61737 15.75 8.9981C15.75 8.37883 15.5297 7.84933 15.0891 7.40958C14.6484 6.96983 14.1187 6.74995 13.5 6.74995H8.13265C7.96727 7.33328 7.64323 7.81245 7.16055 8.18745C6.67785 8.56245 6.12433 8.74995 5.49998 8.74995C4.73609 8.74995 4.08679 8.4827 3.55208 7.9482C3.01736 7.4137 2.75 6.76467 2.75 6.0011C2.75 5.23753 3.01736 4.58813 3.55208 4.05288C4.08679 3.51763 4.73609 3.25 5.49998 3.25C6.12433 3.25 6.67785 3.4375 7.16055 3.8125C7.64323 4.1875 7.96727 4.66667 8.13265 5.25H13.5C14.5359 5.25 15.4198 5.61603 16.1519 6.34808C16.8839 7.08011 17.25 7.96408 17.25 8.99998C17.25 10.0359 16.8839 10.9198 16.1519 11.6519C15.4198 12.3839 14.5359 12.75 13.5 12.75H11.5C10.8812 12.75 10.3515 12.9705 9.9109 13.4115C9.47027 13.8525 9.24995 14.3826 9.24995 15.0019C9.24995 15.6211 9.47027 16.1506 9.9109 16.5904C10.3515 17.0301 10.8812 17.25 11.5 17.25H16.8673C17.0327 16.6667 17.3567 16.1875 17.8394 15.8125C18.3221 15.4375 18.8756 15.25 19.5 15.25C20.2639 15.25 20.9132 15.5173 21.4479 16.0518C21.9826 16.5863 22.25 17.2353 22.25 17.9989C22.25 18.7624 21.9826 19.4118 21.4479 19.9471C20.9132 20.4823 20.2639 20.75 19.5 20.75ZM5.49998 7.25C5.84741 7.25 6.14261 7.12853 6.38558 6.88558C6.62853 6.64261 6.75 6.34741 6.75 5.99998C6.75 5.65254 6.62853 5.35734 6.38558 5.11438C6.14261 4.87143 5.84741 4.74995 5.49998 4.74995C5.15254 4.74995 4.85734 4.87143 4.61438 5.11438C4.37143 5.35734 4.24995 5.65254 4.24995 5.99998C4.24995 6.34741 4.37143 6.64261 4.61438 6.88558C4.85734 7.12853 5.15254 7.25 5.49998 7.25Z",fill:"#DAB440"}))),label:fbox_admin_js_object.langs.CONVERSION_RATE,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=xc({num:t=a,showSuffix:!1,decimalPoints:!1})+"%",r=xc({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/firebox/analytics/#Conversion-Rate",target:"_blank",className:"text-[#888] no-underline font-semibold hover:text-white"},fbox_admin_js_object.langs.READ_MORE.toUpperCase())))})}));const Dc=Ac,Mc=function(e,t){var n,r,a,i=null,o=null,l=null,s=null;switch(e){case"today":i=(l=new Date).getFullYear()+"/"+(l.getMonth()+1)+"/"+l.getDate()+" 00:00:00",o=l.getFullYear()+"/"+(l.getMonth()+1)+"/"+l.getDate()+" 23:59:59";break;case"yesterday":(l=new Date).setDate(l.getDate()-1),i=l.getFullYear()+"/"+(l.getMonth()+1)+"/"+l.getDate()+" 00:00:00",o=l.getFullYear()+"/"+(l.getMonth()+1)+"/"+l.getDate()+" 23:59:59";break;case"last_7_days":(l=new Date).setDate(l.getDate()-6),i=l.getFullYear()+"/"+(l.getMonth()+1)+"/"+l.getDate()+" 00:00:00",(s=new Date).setDate(s.getDate()),o=s.getFullYear()+"/"+(s.getMonth()+1)+"/"+s.getDate()+" 23:59:59";break;case"last_30_days":(l=new Date).setDate(l.getDate()-29),i=l.getFullYear()+"/"+(l.getMonth()+1)+"/"+l.getDate()+" 00:00:00",(s=new Date).setDate(s.getDate()),o=s.getFullYear()+"/"+(s.getMonth()+1)+"/"+s.getDate()+" 23:59:59";break;case"last_week":var c=(n=new Date,r=new Date(n),(a=new Date(n)).setDate(n.getDate()-n.getDay()-6),r.setDate(n.getDate()-n.getDay()),{startOfWeek:a=a.getFullYear()+"/"+(a.getMonth()+1)+"/"+a.getDate()+" 00:00:00",endOfWeek:r=r.getFullYear()+"/"+(r.getMonth()+1)+"/"+r.getDate()+" 23:59:59"});i=c.startOfWeek,o=c.endOfWeek;break;case"last_month":var u=function(){var e=new Date,t=new Date(e.getFullYear(),e.getMonth(),0),n=new Date(e.getFullYear(),e.getMonth()-1,1);return{startOfMonth:n=n.getFullYear()+"/"+(n.getMonth()+1)+"/"+n.getDate()+" 00:00:00",endOfMonth:t=t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate()+" 23:59:59"}}();i=u.startOfMonth,o=u.endOfMonth;break;case"custom":2===t.length&&null!==t[0]&&null!==t[1]&&(i=t[0].getFullYear()+"/"+(t[0].getMonth()+1)+"/"+t[0].getDate()+" 00:00:00",o=t[1].getFullYear()+"/"+(t[1].getMonth()+1)+"/"+t[1].getDate()+" 23:59:59")}return{start_date:i,end_date:o}},Pc=function(){return React.createElement("div",{className:"animate-pulse relative group flex flex-col bg-white dark:bg-dark-1 px-[22px] py-2 rounded gap-[4px]"},React.createElement("div",{className:"h-[24px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"flex items-center gap-1 h-5"},React.createElement("div",{className:"w-[32px] h-[32px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"flex flex-col justify-between gap-[4px] flex-grow"},React.createElement("div",{className:"w-full h-[12px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"w-full h-[10px] bg-slate-200 dark:bg-slate-700 rounded"}))))};var Rc=function(e){return e||"__all_templates__"};function Ic(e){return Ic="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},Ic(e)}function Lc(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 Nc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lc(Object(n),!0).forEach((function(t){Tc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tc(e,t,n){var r;return r=function(e,t){if("object"!=Ic(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Ic(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==Ic(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fc(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return zc(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)?zc(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 zc(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 $c=function(){var n,r=Fc((0,e.useState)(!1),2),a=r[0],i=r[1],o=Fc((0,e.useState)(!0),2),l=o[0],s=o[1],c=Fc((0,e.useState)([]),2),f=c[0],d=c[1],h=Fc((0,e.useState)({current:{views:null,conversions:null,conversionrate:null},previous:{views:null,conversions:null,conversionrate:null}}),2),p=h[0],v=h[1],m=t().createRef(),y=u(),b=y.date_period,x=y.custom_date_period,_=y.selected_campaign,w=function(){var e;if(!["today","custom"].includes(b)&&null!=f&&null!==(e=f[Rc(_)])&&void 0!==e&&e[b])return v(f[Rc(_)][b]),void s(!1);var t=Mc(b,x),n=t.start_date,r=t.end_date,a=new FormData;a.append("nonce",fpf_js_object.nonce),a.append("action","firebox_analytics_stats"),a.append("date_period",b),a.append("start_date",n),a.append("end_date",r),a.append("selected_campaign",_),fetch(fpf_js_object.ajax_url,{method:"POST",body:a}).then((function(e){return e.json()})).then((function(e){v(e),s(!1),["today","custom"].includes(b)||d((function(t){return Nc(Nc({},t),{},Tc({},Rc(_),Nc(Nc({},t[Rc(_)]),{},Tc({},b,e))))}))}))};return g((function(){w(),i(!0)}),m),(0,e.useEffect)((function(){a&&(s(!0),w())}),[_]),(0,e.useEffect)((function(){a&&"custom"===b&&(2===x.length&&(null===x[0]||null===x[1])||(s(!0),w()))}),[x]),(0,e.useEffect)((function(){a&&"custom"!==b&&(s(!0),w())}),[b]),t().createElement("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-1 md:gap-2 lg:gap-4",ref:m},!l||null!=f&&null!==(n=f[Rc(_)])&&void 0!==n&&n[b]?t().createElement(t().Fragment,null,t().createElement(Cc,{overall:p}),t().createElement(Ec,{overall:p}),t().createElement(Dc,{overall:p})):t().createElement(t().Fragment,null,t().createElement(Pc,null),t().createElement(Pc,null),t().createElement(Pc,null)))};const Vc=t().memo($c);function Hc(e){return Hc="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},Hc(e)}function Wc(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 Bc(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 Yc(e){return e+.5|0}var Uc=function(e,t,n){return Math.max(Math.min(e,n),t)};function Gc(e){return Uc(Yc(2.55*e),0,255)}function Zc(e){return Uc(Yc(255*e),0,255)}function qc(e){return Uc(Yc(e/2.55)/100,0,1)}function Kc(e){return Uc(Yc(100*e),0,100)}var Xc,Jc,Qc={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},eu=function(e){if(Array.isArray(e))return Bc(e)}(Xc="0123456789ABCDEF")||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(Xc)||Bc(Xc,Jc)||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.")}(),tu=function(e){return eu[15&e]},nu=function(e){return eu[(240&e)>>4]+eu[15&e]},ru=function(e){return(240&e)>>4==(15&e)};var au=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function iu(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 ou(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 lu(e,t,n){var r,a=iu(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 su(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 cu(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Zc)}function uu(e,t,n){return cu(iu,e,t,n)}function fu(e){return(e%360+360)%360}var du,hu={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"},pu={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 vu=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,mu=function(e){return e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055},yu=function(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)};function gu(e,t,n){if(e){var r=su(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,0===t?360:1)),r=uu(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function bu(e,t){return e?Object.assign(t||{},e):e}function xu(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=Zc(e[3]))):(t=bu(e,{r:0,g:0,b:0,a:1})).a=Zc(t.a),t}function _u(e){return"r"===e.charAt(0)?function(e){var t,n,r,a=vu.exec(e),i=255;if(a){if(a[7]!==t){var o=+a[7];i=a[8]?Gc(o):Uc(255*o,0,255)}return t=+a[1],n=+a[3],r=+a[5],{r:t=255&(a[2]?Gc(t):Uc(t,0,255)),g:n=255&(a[4]?Gc(n):Uc(n,0,255)),b:r=255&(a[6]?Gc(r):Uc(r,0,255)),a:i}}}(e):function(e){var t,n=au.exec(e),r=255;if(n){n[5]!==t&&(r=n[6]?Gc(+n[5]):Zc(+n[5]));var a=fu(+n[2]),i=+n[3]/100,o=+n[4]/100;return{r:(t="hwb"===n[1]?function(e,t,n){return cu(lu,e,t,n)}(a,i,o):"hsv"===n[1]?function(e,t,n){return cu(ou,e,t,n)}(a,i,o):uu(a,i,o))[0],g:t[1],b:t[2],a:r}}}(e)}var wu=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=Hc(t);"object"===o?n=xu(t):"string"===o&&(i=(r=t).length,"#"===r[0]&&(4===i||5===i?a={r:255&17*Qc[r[1]],g:255&17*Qc[r[2]],b:255&17*Qc[r[3]],a:5===i?17*Qc[r[4]]:255}:7!==i&&9!==i||(a={r:Qc[r[1]]<<4|Qc[r[2]],g:Qc[r[3]]<<4|Qc[r[4]],b:Qc[r[5]]<<4|Qc[r[6]],a:9===i?Qc[r[7]]<<4|Qc[r[8]]:255})),n=a||function(e){du||((du=function(){var e,t,n,r,a,i={},o=Object.keys(pu),l=Object.keys(hu);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,hu[n]);n=parseInt(pu[r],16),i[a]=[n>>16&255,n>>8&255,255&n]}return i}()).transparent=[0,0,0,0]);var t=du[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}(t)||_u(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=bu(this._rgb);return e&&(e.a=qc(e.a)),e},set:function(e){this._rgb=xu(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(qc(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 ru(e.r)&&ru(e.g)&&ru(e.b)&&ru(e.a)}(e)?tu:nu,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=su(e),n=t[0],r=Kc(t[1]),a=Kc(t[2]);return e.a<255?"hsla(".concat(n,", ").concat(r,"%, ").concat(a,"%, ").concat(qc(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=yu(qc(e.r)),a=yu(qc(e.g)),i=yu(qc(e.b));return{r:Zc(mu(r+n*(yu(qc(t.r))-r))),g:Zc(mu(a+n*(yu(qc(t.g))-a))),b:Zc(mu(i+n*(yu(qc(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=Zc(e),this}},{key:"clearer",value:function(e){return this._rgb.a*=1-e,this}},{key:"greyscale",value:function(){var e=this._rgb,t=Yc(.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 gu(this._rgb,2,e),this}},{key:"darken",value:function(e){return gu(this._rgb,2,-e),this}},{key:"saturate",value:function(e){return gu(this._rgb,1,e),this}},{key:"desaturate",value:function(e){return gu(this._rgb,1,-e),this}},{key:"rotate",value:function(e){return function(e,t){var n=su(e);n[0]=fu(n[0]+t),n=uu(n),e.r=n[0],e.g=n[1],e.b=n[2]}(this._rgb,e),this}}])&&Wc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ku(e){return function(e){if(Array.isArray(e))return Au(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Eu(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 Su(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ou(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 Cu(e){return Cu="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},Cu(e)}function ju(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Eu(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 Eu(e,t){if(e){if("string"==typeof e)return Au(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)?Au(e,t):void 0}}function Au(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 Du(){}var Mu,Pu=(Mu=0,function(){return Mu++});function Ru(e){return null==e}function Iu(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 Lu(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function Nu(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)}function Tu(e,t){return Nu(e)?e:t}function Fu(e,t){return void 0===e?t:e}var zu=function(e,t){return"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e};function $u(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)}function Vu(e,t,n,r){var a,i,o;if(Iu(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(Lu(e))for(i=(o=Object.keys(e)).length,a=0;a<i;a++)t.call(n,e[o[a]],o[a])}function Hu(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 Wu(e){if(Iu(e))return e.map(Wu);if(Lu(e)){for(var t=Object.create(null),n=Object.keys(e),r=n.length,a=0;a<r;++a)t[n[a]]=Wu(e[n[a]]);return t}return e}function Bu(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function Yu(e,t,n,r){if(Bu(e)){var a=t[e],i=n[e];Lu(a)&&Lu(i)?Uu(a,i,r):t[e]=Wu(i)}}function Uu(e,t,n){var r=Iu(t)?t:[t],a=r.length;if(!Lu(e))return e;for(var i,o=(n=n||{}).merger||Yu,l=0;l<a;++l)if(Lu(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 Gu(e,t){return Uu(e,t,{merger:Zu})}function Zu(e,t,n){if(Bu(e)){var r=t[e],a=n[e];Lu(r)&&Lu(a)?Gu(r,a):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Wu(a))}}var qu={"":function(e){return e},x:function(e){return e.x},y:function(e){return e.y}};function Ku(e,t){return(qu[t]||(qu[t]=function(e){var t=function(e){var t,n=[],r="",a=ju(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=ju(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 Xu(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ju=function(e){return void 0!==e},Qu=function(e){return"function"==typeof e},ef=function(e,t){if(e.size!==t.size)return!1;var n,r=ju(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},tf=Math.PI,nf=2*tf,rf=nf+tf,af=Number.POSITIVE_INFINITY,of=tf/180,lf=tf/2,sf=tf/4,cf=2*tf/3,uf=Math.log10,ff=Math.sign;function df(e,t,n){return Math.abs(e-t)<n}function hf(e){var t=Math.round(e);e=df(e,t,e/1e3)?t:e;var n=Math.pow(10,Math.floor(uf(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function pf(e){return!isNaN(parseFloat(e))&&isFinite(e)}function vf(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 mf(e){return e*(tf/180)}function yf(e){return e*(180/tf)}function gf(e){if(Nu(e)){for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}}function bf(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*tf&&(i+=nf),{angle:i,distance:a}}function xf(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function _f(e,t){return(e-t+rf)%nf-tf}function wf(e){return(e%nf+nf)%nf}function kf(e,t,n,r){var a=wf(e),i=wf(t),o=wf(n),l=wf(i-a),s=wf(o-a),c=wf(a-i),u=wf(a-o);return a===i||a===o||r&&i===o||l>s&&c<u}function Sf(e,t,n){return Math.max(t,Math.min(n,e))}function Of(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 Cf(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 jf=function(e,t,n,r){return Cf(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})},Ef=function(e,t,n){return Cf(e,n,(function(r){return e[r][t]>=n}))},Af=["push","pop","shift","splice","unshift"];function Df(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||(Af.forEach((function(t){delete e[t]})),delete e._chartjs)}}function Mf(e){var t=new Set(e);return t.size===e.length?e:Array.from(t)}var Pf="undefined"==typeof window?function(e){return e()}:window.requestAnimationFrame;function Rf(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,Pf.call(window,(function(){r=!1,e.apply(t,n)})))}}var If=function(e){return"start"===e?"left":"end"===e?"right":"center"},Lf=function(e,t,n){return"start"===e?t:"end"===e?n:(t+n)/2};function Nf(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=Sf(Math.min(jf(l,s,u).lo,n?r:jf(t,s,o.getPixelForValue(u)).lo),0,r-1)),i=h?Sf(Math.max(jf(l,o.axis,f,!0).hi+1,n?0:jf(t,s,o.getPixelForValue(f),!0).hi+1),a,r)-a:r-a}return{start:a,count:i}}function Tf(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 Ff=function(e){return 0===e||1===e},zf=function(e,t,n){return-Math.pow(2,10*(e-=1))*Math.sin((e-t)*nf/n)},$f=function(e,t,n){return Math.pow(2,-10*e)*Math.sin((e-t)*nf/n)+1},Vf={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*lf)},easeOutSine:function(e){return Math.sin(e*lf)},easeInOutSine:function(e){return-.5*(Math.cos(tf*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 Ff(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 Ff(e)?e:zf(e,.075,.3)},easeOutElastic:function(e){return Ff(e)?e:$f(e,.075,.3)},easeInOutElastic:function(e){var t=.1125;return Ff(e)?e:e<.5?.5*zf(2*e,t,.45):.5+.5*$f(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-Vf.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*Vf.easeInBounce(2*e):.5*Vf.easeOutBounce(2*e-1)+.5}};function Hf(e){if(e&&"object"===Cu(e)){var t=e.toString();return"[object CanvasPattern]"===t||"[object CanvasGradient]"===t}return!1}function Wf(e){return Hf(e)?e:new wu(e)}function Bf(e){return Hf(e)?e:new wu(e).saturate(.5).darken(.1).hexString()}var Yf=["x","y","borderWidth","radius","tension"],Uf=["color","borderColor","backgroundColor"],Gf=new Map;function Zf(e,t,n){return function(e,t){t=t||{};var n=e+JSON.stringify(t),r=Gf.get(n);return r||(r=new Intl.NumberFormat(e,t),Gf.set(n,r)),r}(t,n).format(e)}var qf={values:function(e){return Iu(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=uf(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),Zf(e,a,c)},logarithmic:function(e,t,n){if(0===e)return"0";var r=n[t].significand||e/Math.pow(10,Math.floor(uf(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?qf.numeric.call(this,e,t,n):""}},Kf={formatters:qf},Xf=Object.create(null),Jf=Object.create(null);function Qf(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 ed(e,t,n){return"string"==typeof t?Uu(Qf(e,t),n):Uu(Qf(e,""),t)}var td=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 Bf(t.backgroundColor)},this.hoverBorderColor=function(e,t){return Bf(t.borderColor)},this.hoverColor=function(e,t){return Bf(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 ed(this,e,t)}},{key:"get",value:function(e){return Qf(this,e)}},{key:"describe",value:function(e,t){return ed(Jf,e,t)}},{key:"override",value:function(e,t){return ed(Xf,e,t)}},{key:"route",value:function(e,t,n,r){var a,i=Qf(this,e),o=Qf(this,n),l="_"+t;Object.defineProperties(i,(Su(a={},l,{value:i[t],writable:!0}),Su(a,t,{enumerable:!0,get:function(){var e=this[l],t=o[r];return Lu(e)?Object.assign({},t,e):Fu(e,t)},set:function(e){this[l]=e}}),a))}},{key:"apply",value:function(e){var t=this;e.forEach((function(e){return e(t)}))}}])&&Ou(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),nd=new td({_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:Uf},numbers:{type:"number",properties:Yf}}),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:Kf.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 rd(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 ad(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])||Iu(c)){if(Iu(c))for(l=0,s=c.length;l<s;l++)null==(u=c[l])||Iu(u)||(f=rd(e,a,i,f,u))}else f=rd(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 id(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 od(e,t){(t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function ld(e,t,n,r){sd(e,t,n,r,null)}function sd(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)*of;if(h&&"object"===Cu(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,nf):e.arc(n,r,v,0,nf),e.closePath();break;case"triangle":u=a?a/2:v,e.moveTo(n+Math.sin(m)*u,r-Math.cos(m)*v),m+=cf,e.lineTo(n+Math.sin(m)*u,r-Math.cos(m)*v),m+=cf,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+sf)*s,f=Math.cos(m+sf)*(a?a/2-c:s),l=Math.sin(m+sf)*s,d=Math.sin(m+sf)*(a?a/2-c:s),e.arc(n-f,r-l,c,m-tf,m-lf),e.arc(n+d,r-o,c,m-lf,m),e.arc(n+f,r+l,c,m,m+lf),e.arc(n-d,r+o,c,m+lf,m+tf),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+=sf;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+=sf;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+=sf,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 cd(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 ud(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function fd(e){e.restore()}function dd(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 hd(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 pd(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Ru(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 vd(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 md(e,t){var n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function yd(e,t,n,r,a){var i,o,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=Iu(t)?t:[t],c=l.strokeWidth>0&&""!==l.strokeColor;for(e.save(),e.font=a.string,pd(e,l),i=0;i<s.length;++i)o=s[i],l.backdrop&&md(e,l.backdrop),c&&(l.strokeColor&&(e.strokeStyle=l.strokeColor),Ru(l.strokeWidth)||(e.lineWidth=l.strokeWidth),e.strokeText(o,n,r,l.maxWidth)),e.fillText(o,n,r,l.maxWidth),vd(e,n,r,o,l),r+=Number(a.lineHeight);e.restore()}function gd(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*tf,tf,!0),e.lineTo(n,r+i-o.bottomLeft),e.arc(n+o.bottomLeft,r+i-o.bottomLeft,o.bottomLeft,tf,lf,!0),e.lineTo(n+a-o.bottomRight,r+i),e.arc(n+a-o.bottomRight,r+i-o.bottomRight,o.bottomRight,lf,0,!0),e.lineTo(n+a,r+o.topRight),e.arc(n+a-o.topRight,r+o.topRight,o.topRight,0,-lf,!0),e.lineTo(n+o.topLeft,r)}var bd=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,xd=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _d(e,t){var n=(""+e).match(bd);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 wd(e,t){var n,r={},a=Lu(t),i=a?Object.keys(t):t,o=Lu(e)?a?function(n){return Fu(e[n],e[t[n]])}:function(t){return e[t]}:function(){return e},l=ju(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 kd(e){return wd(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Sd(e){return wd(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Od(e){var t=kd(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Cd(e,t){e=e||{},t=t||nd.font;var n=Fu(e.size,t.size);"string"==typeof n&&(n=parseInt(n,10));var r=Fu(e.style,t.style);r&&!(""+r).match(xd)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);var a={family:Fu(e.family,t.family),lineHeight:_d(Fu(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Fu(e.weight,t.weight),string:""};return a.string=function(e){return!e||Ru(e.size)||Ru(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(a),a}function jd(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&&Iu(o)&&(o=o[n%o.length],l=!1),void 0!==o))return r&&!l&&(r.cacheable=!1),o}function Ed(e,t){return Object.assign(Object.create(e),t)}function Ad(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=Vd("_fallback",e));var l=(Su(t={},Symbol.toStringTag,"Object"),Su(t,"_cacheable",!0),Su(t,"_scopes",e),Su(t,"_rootScopes",o),Su(t,"_fallback",a),Su(t,"_getTarget",i),Su(t,"override",(function(t){return Ad([t].concat(ku(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 Id(t,r,(function(){return $d(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 Hd(e).includes(t)},ownKeys:function(e){return Hd(e)},set:function(e,t,n){var r=e._storage||(e._storage=i());return e[t]=r[t]=n,delete e._keys,!0}})}function Dd(e,t,n,r){var a={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Md(e,r),setContext:function(t){return Dd(e,t,n,r)},override:function(a){return Dd(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 Id(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 Qu(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),Rd(e,s)&&(s=Fd(a._scopes,a,e,s)),s}(t,l,e,n)),Iu(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(Lu(t[0])){var s=t,c=a._scopes.filter((function(e){return e!==s}));t=[];var u,f=ju(s);try{for(f.s();!(u=f.n()).done;){var d=Fd(c,a,e,u.value);t.push(Dd(d,i,o&&o[e],l))}}catch(e){f.e(e)}finally{f.f()}}return t}(t,l,e,o.isIndexable)),Rd(t,l)&&(l=Dd(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 Md(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:Qu(r)?r:function(){return r},isIndexable:Qu(i)?i:function(){return i}}}var Pd=function(e,t){return e?e+Xu(t):t},Rd=function(e,t){return Lu(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object)};function Id(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];var r=n();return e[t]=r,r}function Ld(e,t,n){return Qu(e)?e(t,n):e}var Nd=function(e,t){return!0===e?t:"string"==typeof e?Ku(t,e):void 0};function Td(e,t,n,r,a){var i,o=ju(t);try{for(o.s();!(i=o.n()).done;){var l=i.value,s=Nd(n,l);if(s){e.add(s);var c=Ld(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 Fd(e,t,n,r){var a=t._rootScopes,i=Ld(t._fallback,n,r),o=[].concat(ku(e),ku(a)),l=new Set;l.add(r);var s=zd(l,o,n,i||n,r);return null!==s&&(void 0===i||i===n||null!==(s=zd(l,o,i,s,r)))&&Ad(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 Iu(a)&&Lu(n)?n:a||{}}(t,n,r)}))}function zd(e,t,n,r,a){for(;n;)n=Td(e,t,n,r,a);return n}function $d(e,t,n,r){var a,i,o=ju(t);try{for(o.s();!(i=o.n()).done;){var l=i.value;if(void 0!==(a=Vd(Pd(l,e),n)))return Rd(e,a)?Fd(n,r,e,a):a}}catch(e){o.e(e)}finally{o.f()}}function Vd(e,t){var n,r=ju(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 Hd(e){var t=e._keys;return t||(t=e._keys=function(e){var t,n=new Set,r=ju(e);try{for(r.s();!(t=r.n()).done;){var a,i=t.value,o=ju(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 Wd(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(Ku(l,u),o)};return f}var Bd=Number.EPSILON||1e-14,Yd=function(e,t){return t<e.length&&!e[t].skip&&e[t]},Ud=function(e){return"x"===e?"y":"x"};function Gd(e,t,n,r){var a=e.skip?t:e,i=t,o=n.skip?t:n,l=xf(i,a),s=xf(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 Zd(e,t,n){for(var r,a,i,o,l,s=e.length,c=Yd(e,0),u=0;u<s-1;++u)l=c,c=Yd(e,u+1),l&&c&&(df(t[u],0,Bd)?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 qd(e,t){for(var n,r,a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x",o=Ud(i),l=e.length,s=Yd(e,0),c=0;c<l;++c)if(r=a,a=s,s=Yd(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 Kd(e,t,n){return Math.max(Math.min(e,n),t)}function Xd(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Jd(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function Qd(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 eh=function(e){return e.ownerDocument.defaultView.getComputedStyle(e,null)},th=["top","right","bottom","left"];function nh(e,t,n){var r={};n=n?"-"+n:"";for(var a=0;a<4;a++){var i=th[a];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}function rh(e,t){if("native"in e)return e;var n=t.canvas,r=t.currentDevicePixelRatio,a=eh(n),i="border-box"===a.boxSizing,o=nh(a,"padding"),l=nh(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 ah=function(e){return Math.round(10*e)/10};function ih(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 oh=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 lh(e,t){var n=function(e,t){return eh(e).getPropertyValue(t)}(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function sh(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function ch(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 uh(e,t,n,r){var a={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},o=sh(e,a,n),l=sh(a,i,n),s=sh(i,t,n),c=sh(o,l,n),u=sh(l,s,n);return sh(c,u,n)}function fh(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 dh(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 hh(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function ph(e){return"angle"===e?{between:kf,compare:_f,normalize:wf}:{between:Of,compare:function(e,t){return e-t},normalize:function(e){return e}}}function vh(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 mh(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=ph(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=ph(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(vh({start:_,end:w,loop:y,count:c,style:g})),_=null),k=w,i=r);return null!==_&&b.push(vh({start:_,end:m,loop:y,count:c,style:g})),b}function yh(e,t){for(var n=[],r=e.segments,a=0;a<r.length;a++){var i=mh(r[a],e.points,t);i.length&&n.push.apply(n,ku(i))}return n}function gh(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function bh(e,t){if(!t)return!1;var n=[],r=function(e,t){return Hf(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function xh(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 _h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xh(Object(n),!0).forEach((function(t){Mh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wh(){return wh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=kh(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},wh.apply(this,arguments)}function kh(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ah(e)););return e}function Sh(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&&Oh(e,t)}function Oh(e,t){return Oh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Oh(e,t)}function Ch(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=Ah(e);if(t){var a=Ah(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return jh(this,n)}}function jh(e,t){if(t&&("object"===Rh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Eh(e)}function Eh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ah(e){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ah(e)}function Dh(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)||Lh(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 Mh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ph(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Lh(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 Rh(e){return Rh="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},Rh(e)}function Ih(e){return function(e){if(Array.isArray(e))return Nh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Lh(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 Lh(e,t){if(e){if("string"==typeof e)return Nh(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)?Nh(e,t):void 0}}function Nh(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 Th(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fh(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 zh(e,t,n){return t&&Fh(e.prototype,t),n&&Fh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var $h=new(function(){function e(){Th(this,e),this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}return zh(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=Pf.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,Ih(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}()),Vh="transparent",Hh={boolean:function(e,t,n){return n>.5?t:e},color:function(e,t,n){var r=Wf(e||Vh),a=r.valid&&Wf(t||Vh);return a&&a.valid?a.mix(r,n).hexString():t},number:function(e,t,n){return e+(t-e)*n}},Wh=function(){function e(t,n,r,a){Th(this,e);var i=n[r];a=jd([t.to,a,i,t.from]);var o=jd([t.from,i,a]);this._active=!0,this._fn=t.fn||Hh[t.type||Rh(o)],this._easing=Vf[t.easing]||Vf.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 zh(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=jd([e.to,t,r,e.from]),this._from=jd([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}(),Bh=function(){function e(t,n){Th(this,e),this._chart=t,this._properties=new Map,this.configure(n)}return zh(e,[{key:"configure",value:function(e){if(Lu(e)){var t=Object.keys(nd.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach((function(r){var a=e[r];if(Lu(a)){var i,o={},l=Ph(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()}(Iu(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 Wh(f,e,s,c),a.push(u)):e[s]=c}else a.push.apply(a,Ih(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?($h.add(this._chart,n),!0):void 0}Object.assign(e,t)}}]),e}();function Yh(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 Uh(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 Gh(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}Nu(o=e.values[i])&&(c||0===t||ff(t)===ff(o))&&(t+=o)}return t}}function Zh(e,t){var n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function qh(e,t,n){var r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Kh(e,t,n,r){var a,i=Ph(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 Xh(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]=qh(i,f,v))[s]=m,n._top=Kh(n,l,!0,a.type),n._bottom=Kh(n,l,!1,a.type),(n._visualValues||(n._visualValues={}))[s]=m}}function Jh(e,t){var n=e.scales;return Object.keys(n).filter((function(e){return n[e].axis===t})).shift()}function Qh(e,t){var n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){var a,i=Ph(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 ep=function(e){return"reset"===e||"none"===e},tp=function(e,t){return t?e:Object.assign({},e)},np=function(){function e(t,n){Th(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 zh(e,[{key:"initialize",value:function(){var e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Zh(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&&Qh(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=Fu(n.xAxisID,Jh(e,"x")),i=t.yAxisID=Fu(n.yAxisID,Jh(e,"y")),o=t.rAxisID=Fu(n.rAxisID,Jh(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&&Df(this._data,this),e._stacked&&Qh(e)}},{key:"_dataCheck",value:function(){var e,t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Lu(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){Df(r,this);var a=this._cachedMeta;Qh(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]}}),Af.forEach((function(t){var n="_onData"+Xu(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=Zh(t.vScale,t),t.stack!==n.stack&&(r=!0,Qh(t),t.stack=n.stack),this._resyncElements(e),(r||a!==t._stacked)&&Xh(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=Iu(o[e])?this.parseArrayData(i,o,e,t):Lu(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&&Xh(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]=(Mh(p={},c,d||l.parse(f[o],o)),Mh(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(Ku(l,d),o),y:c.parse(Ku(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 Gh({keys:Uh(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=Gh(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:Uh(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!Nu(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)Nu(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=(Lu(t=Fu(this.options.clip,function(e,t,n){if(!1===n)return!1;var r=Yh(e,n),a=Yh(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 Ed(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 Ed(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&&Ju(r);if(l)return tp(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(nd.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(tp(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 Bh(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||ep(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){ep(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}},{key:"updateSharedOptions",value:function(e,t,n){e&&!ep(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=Ph(this._syncList);try{for(a.s();!(t=a.n()).done;){var i=Dh(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&&Qh(n,r)}n.data.splice(e,t)}},{key:"_sync",value:function(e){if(this._parsing)this._syncList.push(e);else{var t=Dh(e,3),n=t[0],r=t[1],a=t[2];this[n](r,a)}this.chart._dataChanges.push([this.index].concat(Ih(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 rp(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=Mf(r.sort((function(e,t){return e-t})))}return e._cache.$bar}(i,e.type),l=i._length,s=function(){32767!==r&&-32768!==r&&(Ju(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 ap(e,t,n,r){return Iu(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 ip(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(ap(l,o,c,a));return d}function op(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function lp(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[sp(f,l,s,c)]=!0,a=u)),i[sp(a,l,s,c)]=!0,e.borderSkipped=i}else e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};else e.borderSkipped=i}function sp(e,t,n,r){var a,i,o;return r?(o=n,e=cp(e=(a=e)===(i=t)?o:a===o?i:a,n,t)):e=cp(e,t,n),e}function cp(e,t,n){return"start"===e?t:"end"===e?n:e}function up(e,t,n){var r=t.inflateAmount;e.inflateAmount="auto"===r?1===n?.33:0:r}Mh(np,"defaults",{}),Mh(np,"datasetElementType",null),Mh(np,"dataElementType",null);var fp=function(e){Sh(n,e);var t=Ch(n);function n(){return Th(this,n),t.apply(this,arguments)}return zh(n,[{key:"parsePrimitiveData",value:function(e,t,n,r){return ip(e,t,n,r)}},{key:"parseArrayData",value:function(e,t,n,r){return ip(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(Ku(l,v),a),y.push(ap(Ku(l,m),o,c,a));return y}},{key:"updateRangeFromParsed",value:function(e,t,r,a){wh(Ah(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=op(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,wh(Ah(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||Ru(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||op(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;lp(g,b,y,i),up(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(Ru(r)||isNaN(r))return!0},s=Ph(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||rp(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=op(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&&ff(p)!==ff(d.barEnd)&&(v=0),v+=p);var y=Ru(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?ff(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=ff(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=Fu(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 Ru(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}(np);Mh(fp,"id","bar"),Mh(fp,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Mh(fp,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});var dp=function(e){Sh(n,e);var t=Ch(n);function n(){return Th(this,n),t.apply(this,arguments)}return zh(n,[{key:"initialize",value:function(){this.enableOptionSharing=!0,wh(Ah(n.prototype),"initialize",this).call(this)}},{key:"parsePrimitiveData",value:function(e,t,r,a){for(var i=wh(Ah(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=wh(Ah(n.prototype),"parseArrayData",this).call(this,e,t,r,a),o=0;o<i.length;o++){var l=t[r+o];i[o]._custom=Fu(l[2],this.resolveDataElementOptions(o+r).radius)}return i}},{key:"parseObjectData",value:function(e,t,r,a){for(var i=wh(Ah(n.prototype),"parseObjectData",this).call(this,e,t,r,a),o=0;o<i.length;o++){var l=t[r+o];i[o]._custom=Fu(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=wh(Ah(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+=Fu(r&&r._custom,i),a}}]),n}(np);Mh(dp,"id","bubble"),Mh(dp,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Mh(dp,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});var hp=function(e){Sh(n,e);var t=Ch(n);function n(e,r){var a;return Th(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 zh(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(Lu(n[e])){var l=this._parsing.key,s=void 0===l?"value":l;o=function(e){return+Ku(n[e],s)}}for(a=e,i=e+t;a<i;++a)r._parsed[a]=o(a)}}},{key:"_getRotation",value:function(){return mf(this.options.rotation-90)}},{key:"_getCircumference",value:function(){return mf(this.options.circumference)}},{key:"_getRotationExtents",value:function(){for(var e=nf,t=-nf,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<nf){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 kf(e,l,s,!0)?1:Math.max(t,t*n,r,r*n)},p=function(e,t,r){return kf(e,l,s,!0)?-1:Math.min(t,t*n,r,r*n)},v=h(0,c,f),m=h(lf,u,d),y=p(tf,c,f),g=p(tf+lf,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=zu(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/nf)}},{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)?nf*(Math.abs(e)/t):0}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart,r=n.data.labels||[],a=Zf(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(Fu(this.chart.data.datasets[e].weight,1),0)}},{key:"_getVisibleDatasetWeightTotal",value:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}]),n}(np);Mh(hp,"id","doughnut"),Mh(hp,"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"}),Mh(hp,"descriptors",{_scriptable:function(e){return"spacing"!==e},_indexable:function(e){return"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}}),Mh(hp,"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 pp=function(e){Sh(n,e);var t=Ch(n);function n(){return Th(this,n),t.apply(this,arguments)}return zh(n,[{key:"initialize",value:function(){this.enableOptionSharing=!0,this.supportsDecimation=!0,wh(Ah(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=Nf(t,a,o),s=l.start,c=l.count;this._drawStart=s,this._drawCount=c,Tf(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=pf(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 C=this.getParsed(k),j=Ru(C[p]),E=O[h]=o.getPixelForValue(C[h],k),A=O[p]=a||j?l.getBasePixel():l.getPixelForValue(s?this.applyStack(l,C,s):C[p],k);O.skip=isNaN(E)||isNaN(A)||j,O.stop=k>0&&Math.abs(C[h]-w[h])>g,y&&(O.parsed=C,O.raw=c.data[k]),d&&(O.options=f||this.resolveDataElementOptions(k,S.active?"active":r)),b||this.updateElement(S,k,O,r),w=C}}}},{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),wh(Ah(n.prototype),"draw",this).call(this)}}]),n}(np);Mh(pp,"id","line"),Mh(pp,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Mh(pp,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});var vp=function(e){Sh(n,e);var t=Ch(n);function n(e,r){var a;return Th(this,n),(a=t.call(this,e,r)).innerRadius=void 0,a.outerRadius=void 0,a}return zh(n,[{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart,r=n.data.labels||[],a=Zf(t._parsed[e].r,n.options.locale);return{label:r[e]||"",value:a}}},{key:"parseObjectData",value:function(e,t,n,r){return Wd.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*tf,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)?mf(this.resolveDataElementOptions(e,t).angle||n):0}}]),n}(np);Mh(vp,"id","polarArea"),Mh(vp,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Mh(vp,"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 mp=function(e){Sh(n,e);var t=Ch(n);function n(){return Th(this,n),t.apply(this,arguments)}return zh(n)}(hp);Mh(mp,"id","pie"),Mh(mp,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});var yp=function(e){Sh(n,e);var t=Ch(n);function n(){return Th(this,n),t.apply(this,arguments)}return zh(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 Wd.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}(np);Mh(yp,"id","radar"),Mh(yp,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Mh(yp,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});var gp=function(e){Sh(n,e);var t=Ch(n);function n(){return Th(this,n),t.apply(this,arguments)}return zh(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=Nf(t,r,a),o=i.start,l=i.count;if(this._drawStart=o,this._drawCount=l,Tf(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")),wh(Ah(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=pf(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=Ru(k[p]),C=S[h]=o.getPixelForValue(k[h],_),j=S[p]=a||O?l.getBasePixel():l.getPixelForValue(s?this.applyStack(l,k,s):k[p],_);S.skip=isNaN(C)||isNaN(j)||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}(np);function bp(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Mh(gp,"id","scatter"),Mh(gp,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Mh(gp,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var xp={_date:function(){function e(t){Th(this,e),Mh(this,"options",void 0),this.options=t||{}}return zh(e,[{key:"init",value:function(){}},{key:"formats",value:function(){return bp()}},{key:"parse",value:function(){return bp()}},{key:"format",value:function(){return bp()}},{key:"add",value:function(){return bp()}},{key:"diff",value:function(){return bp()}},{key:"startOf",value:function(){return bp()}},{key:"endOf",value:function(){return bp()}}],[{key:"override",value:function(t){Object.assign(e.prototype,t)}}]),e}()};function _p(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?Ef:jf;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 wp(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=_p(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 kp(e,t,n,r,a){var i=[];return a||e.isPointInArea(t)?(wp(e,n,t,(function(n,o,l){(a||cd(n,e.chartArea,0))&&n.inRange(t.x,t.y,r)&&i.push({element:n,datasetIndex:o,index:l})}),!0),i):i}function Sp(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 wp(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 wp(e,n,t,(function(e,n,i){var o=e.getProps(["startAngle","endAngle"],r),l=o.startAngle,s=o.endAngle;kf(bf(e,{x:t.x,y:t.y}).angle,l,s)&&a.push({element:e,datasetIndex:n,index:i})})),a}(e,t,n,a):[]}function Op(e,t,n,r,a){var i=[],o="x"===n?"inXRange":"inYRange",l=!1;return wp(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 Cp={evaluateInteractionItems:wp,modes:{index:function(e,t,n,r){var a=rh(t,e),i=n.axis||"x",o=n.includeInvisible||!1,l=n.intersect?kp(e,a,i,r,o):Sp(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=rh(t,e),i=n.axis||"xy",o=n.includeInvisible||!1,l=n.intersect?kp(e,a,i,r,o):Sp(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 kp(e,rh(t,e),n.axis||"xy",r,n.includeInvisible||!1)},nearest:function(e,t,n,r){var a=rh(t,e),i=n.axis||"xy",o=n.includeInvisible||!1;return Sp(e,a,i,n.intersect,r,o)},x:function(e,t,n,r){return Op(e,rh(t,e),"x",n.intersect,r)},y:function(e,t,n,r){return Op(e,rh(t,e),"y",n.intersect,r)}}},jp=["left","top","right","bottom"];function Ep(e,t){return e.filter((function(e){return e.pos===t}))}function Ap(e,t){return e.filter((function(e){return-1===jp.indexOf(e.pos)&&e.box.axis===t}))}function Dp(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 Mp(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Pp(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 Rp(e,t,n,r){var a=n.pos,i=n.box,o=e.maxPadding;if(!Lu(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&&Pp(o,i.getPadding());var s=Math.max(0,t.outerWidth-Mp(o,e,"left","right")),c=Math.max(0,t.outerHeight-Mp(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 Ip(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 Lp(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,Ip(o.horizontal,t));var f=Rp(t,n,o,r),d=f.same,h=f.other;s|=d&&u.length,c=c||h,l.fullSize||u.push(o)}return s&&Lp(u,t,n,r)||c}function Np(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 Tp(e,t,n,r){var a,i=n.padding,o=t.x,l=t.y,s=Ph(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;Ju(f.start)&&(l=f.start),u.fullSize?Np(u,i.left,l,n.outerWidth-i.right-i.left,p):Np(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;Ju(f.start)&&(o=f.start),u.fullSize?Np(u,o,i.top,m,n.outerHeight-i.bottom-i.top):Np(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 Fp=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)},zp=function(e,t){var n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},$p=function(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},Vp=function(e,t,n,r){if(e){var a=Od(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=Dp(t.filter((function(e){return e.box.fullSize})),!0),r=Dp(Ep(t,"left"),!0),a=Dp(Ep(t,"right")),i=Dp(Ep(t,"top"),!0),o=Dp(Ep(t,"bottom")),l=Ap(t,"x"),s=Ap(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:a.concat(s).concat(o).concat(l),chartArea:Ep(t,"chartArea"),vertical:r.concat(a).concat(s),horizontal:i.concat(o).concat(l)}}(e.boxes),s=l.vertical,c=l.horizontal;Vu(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);Pp(d,Od(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=Ph(e);try{for(r.s();!(t=r.n()).done;){var a=t.value,i=a.stack,o=a.pos,l=a.stackWeight;if(i&&jp.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);Lp(l.fullSize,h,f,p),Lp(s,h,f,p),Lp(c,h,f,p)&&Lp(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),Tp(l.leftAndTop,h,f,p),h.x+=h.w,h.y+=h.h,Tp(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},Vu(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})}))}},Hp=function(){function e(){Th(this,e)}return zh(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}(),Wp=function(e){Sh(n,e);var t=Ch(n);function n(){return Th(this,n),t.apply(this,arguments)}return zh(n,[{key:"acquireContext",value:function(e){return e&&e.getContext&&e.getContext("2d")||null}},{key:"updateConfig",value:function(e){e.options.animation=!1}}]),n}(Hp),Bp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Yp=function(e){return null===e||""===e},Up=!!oh&&{passive:!0};function Gp(e,t,n){e.canvas.removeEventListener(t,n,Up)}function Zp(e,t){var n,r=Ph(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 qp(e,t,n){var r=e.canvas,a=new MutationObserver((function(e){var t,a=!1,i=Ph(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;a=(a=a||Zp(o.addedNodes,r))&&!Zp(o.removedNodes,r)}}catch(e){i.e(e)}finally{i.f()}a&&n()}));return a.observe(document,{childList:!0,subtree:!0}),a}function Kp(e,t,n){var r=e.canvas,a=new MutationObserver((function(e){var t,a=!1,i=Ph(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;a=(a=a||Zp(o.removedNodes,r))&&!Zp(o.addedNodes,r)}}catch(e){i.e(e)}finally{i.f()}a&&n()}));return a.observe(document,{childList:!0,subtree:!0}),a}var Xp=new Map,Jp=0;function Qp(){var e=window.devicePixelRatio;e!==Jp&&(Jp=e,Xp.forEach((function(t,n){n.currentDevicePixelRatio!==e&&t()})))}function ev(e,t,n){var r=e.canvas,a=r&&Jd(r);if(a){var i=Rf((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){Xp.size||window.addEventListener("resize",Qp),Xp.set(e,t)}(e,i),o}}function tv(e,t,n){n&&n.disconnect(),"resize"===t&&function(e){Xp.delete(e),Xp.size||window.removeEventListener("resize",Qp)}(e)}function nv(e,t,n){var r=e.canvas,a=Rf((function(t){null!==e.ctx&&n(function(e,t){var n=Bp[e.type]||e.type,r=rh(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,Up)}(r,t,a),a}var rv=function(e){Sh(n,e);var t=Ch(n);function n(){return Th(this,n),t.apply(this,arguments)}return zh(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",Yp(a)){var i=lh(e,"width");void 0!==i&&(e.width=i)}if(Yp(r))if(""===e.style.height)e.height=e.width/(t||2);else{var o=lh(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];Ru(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:qp,detach:Kp,resize:ev}[t]||nv;r[t]=a(e,t,n)}},{key:"removeEventListener",value:function(e,t){var n=e.$proxies||(e.$proxies={}),r=n[t];r&&(({attach:tv,detach:tv,resize:tv}[t]||Gp)(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=eh(e),i=nh(a,"margin"),o=Qd(a.maxWidth,e,"clientWidth")||af,l=Qd(a.maxHeight,e,"clientHeight")||af,s=function(e,t,n){var r,a;if(void 0===t||void 0===n){var i=Jd(e);if(i){var o=i.getBoundingClientRect(),l=eh(i),s=nh(l,"border","width"),c=nh(l,"padding");t=o.width-c.width-s.width,n=o.height-c.height-s.height,r=Qd(l.maxWidth,i,"clientWidth"),a=Qd(l.maxHeight,i,"clientHeight")}else t=e.clientWidth,n=e.clientHeight}return{width:t,height:n,maxWidth:r||af,maxHeight:a||af}}(e,t,n),c=s.width,u=s.height;if("content-box"===a.boxSizing){var f=nh(a,"border","width"),d=nh(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=ah(Math.min(c,o,s.maxWidth)),u=ah(Math.min(u,l,s.maxHeight)),c&&!u&&(u=ah(c/2)),(void 0!==t||void 0!==n)&&r&&s.height&&u>s.height&&(u=s.height,c=ah(Math.floor(u*r))),{width:c,height:u}}(e,t,n,r)}},{key:"isAttached",value:function(e){var t=Jd(e);return!(!t||!t.isConnected)}}]),n}(Hp),av=function(){function e(){Th(this,e),Mh(this,"x",void 0),Mh(this,"y",void 0),Mh(this,"active",!1),Mh(this,"options",void 0),Mh(this,"$animations",void 0)}return zh(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 pf(this.x)&&pf(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 iv(e,t,n,r,a){var i,o,l,s=Fu(r,0),c=Math.min(Fu(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))}Mh(av,"defaults",{}),Mh(av,"defaultRoutes",void 0);var ov=function(e,t,n){return"top"===t||"left"===t?e[t]+n:e[t]-n},lv=function(e,t){return Math.min(t||e,e)};function sv(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 cv(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 uv(e){return e.drawTicks?e.tickLength:0}function fv(e,t){if(!e.display)return 0;var n=Cd(e.font,t),r=Od(e.padding);return(Iu(e.text)?e.text.length:1)*n.lineHeight+r.height}function dv(e,t,n){var r=If(e);return(n&&"right"!==t||!n&&"right"===t)&&(r=function(e){return"left"===e?"right":"right"===e?"left":e}(r)),r}var hv=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(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 zh(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=Tu(e,Number.POSITIVE_INFINITY),t=Tu(t,Number.NEGATIVE_INFINITY),n=Tu(n,Number.POSITIVE_INFINITY),r=Tu(r,Number.NEGATIVE_INFINITY),{min:Tu(e,n),max:Tu(t,r),minDefined:Nu(e),maxDefined:Nu(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:Tu(r=o&&r>a?a:r,Tu(a=i&&r>a?r:a,r)),max:Tu(a,Tu(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(){$u(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=zu(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?sv(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(iv(t,c,u,Ru(h)?0:l-h,l),f=0,d=o-1;f<d;f++)iv(t,c,u,i[f],i[f+1]);return iv(t,c,u,s,Ru(h)?t.length:s+h),c}return iv(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(){$u(this.options.afterUpdate,[this])}},{key:"beforeSetDimensions",value:function(){$u(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(){$u(this.options.afterSetDimensions,[this])}},{key:"_callHooks",value:function(e){this.chart.notifyPlugins(e,this.getContext()),$u(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(){$u(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=$u(a.callback,[r.value,t,e],this)}},{key:"afterTickToLabelConversion",value:function(){$u(this.options.afterTickToLabelConversion,[this])}},{key:"beforeCalculateLabelRotation",value:function(){$u(this.options.beforeCalculateLabelRotation,[this])}},{key:"calculateLabelRotation",value:function(){var e,t,n,r=this.options,a=r.ticks,i=lv(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=Sf(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-uv(r.grid)-a.padding-fv(r.title,this.chart.options.font),n=Math.sqrt(u*u+f*f),s=yf(Math.min(Math.asin(Sf((c.highest.height+6)/e,-1,1)),Math.asin(Sf(t/n,-1,1))-Math.asin(Sf(f/n,-1,1)))),s=Math.max(o,Math.min(l,s))),this.labelRotation=s}}},{key:"afterCalculateLabelRotation",value:function(){$u(this.options.afterCalculateLabelRotation,[this])}},{key:"afterAutoSkip",value:function(){}},{key:"beforeFit",value:function(){$u(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=fv(a,t.options.font);if(l?(e.width=this.maxWidth,e.height=uv(i)+s):(e.height=this.maxHeight,e.width=uv(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=mf(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(){$u(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++)Ru(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=sv(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/lv(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,Ru(o)||Iu(o)){if(Iu(o))for(a=0,i=o.length;a<i;++a)Ru(h=o[a])||Iu(h)||(f=rd(p,c.data,c.gc,f,h),d+=u)}else f=rd(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){Vu(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 Sf(this._alignToPixels?id(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 Ed(e,{tick:n,index:t,type:"tick"})}(this.getContext(),e,n))}return this.$context||(this.$context=Ed(this.chart.getContext(),{scale:this,type:"scale"}))}},{key:"_tickSize",value:function(){var e=this.options.ticks,t=mf(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=uv(m),k=[],S=g.setContext(this.getContext()),O=S.display?S.width:0,C=O/2,j=function(e){return id(p,e,O)};if("top"===y)t=j(this.bottom),o=this.bottom-w,s=t-C,u=j(e.top)+C,d=e.bottom;else if("bottom"===y)t=j(this.top),u=e.top,d=j(e.bottom)-C,o=t+C,s=this.top+w;else if("left"===y)t=j(this.right),i=this.right-w,l=t-C,c=j(e.left)+C,f=e.right;else if("right"===y)t=j(this.left),c=e.left,f=j(e.right)-C,i=t+C,l=this.left+w;else if("x"===h){if("center"===y)t=j((e.top+e.bottom)/2+.5);else if(Lu(y)){var E=Object.keys(y)[0],A=y[E];t=j(this.chart.scales[E].getPixelForValue(A))}u=e.top,d=e.bottom,s=(o=t+C)+w}else if("y"===h){if("center"===y)t=j((e.left+e.right)/2);else if(Lu(y)){var D=Object.keys(y)[0],M=y[D];t=j(this.chart.scales[D].getPixelForValue(M))}l=(i=t-C)-w,c=e.left,f=e.right}var P=Fu(v.ticks.maxTicksLimit,_),R=Math.max(1,Math.ceil(_/P));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||[],$=N.dashOffset,V=L.tickWidth,H=L.tickColor,W=L.tickBorderDash||[],B=L.tickBorderDashOffset;void 0!==(r=cv(this,n,b))&&(a=id(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:$,tickWidth:V,tickColor:H,tickBorderDash:W,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=uv(h.grid),k=w+x,S=_?-x:k,O=-mf(this.labelRotation),C=[],j="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 E=this._getYAxisLabelAlignment(w);o=E.textAlign,a=E.x}else if("right"===p){var A=this._getYAxisLabelAlignment(w);o=A.textAlign,a=A.x}else if("x"===d){if("center"===p)i=(e.top+e.bottom)/2+k;else if(Lu(p)){var D=Object.keys(p)[0],M=p[D];i=this.chart.scales[D].getPixelForValue(M)+k}o=this._getXAxisLabelAlignment()}else if("y"===d){if("center"===p)a=(e.left+e.right)/2-k;else if(Lu(p)){var P=Object.keys(p)[0],R=p[P];a=this.chart.scales[P].getPixelForValue(R)}o=this._getYAxisLabelAlignment(w).textAlign}"y"===d&&("start"===g?j="top":"end"===g&&(j="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=Iu(r)?r.length:1)/2,T=L.color,F=L.textStrokeColor,z=L.textStrokeWidth,$=o;m?(a=l,"inner"===o&&($=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 H=Od(L.backdropPadding),W=I.heights[t],B=I.widths[t],Y=f-H.top,U=0-H.left;switch(j){case"middle":Y-=W/2;break;case"bottom":Y-=W}switch(o){case"center":U-=B/2;break;case"right":U-=B}V={left:U,top:Y,width:B+H.width,height:W+H.height,color:L.backdropColor}}C.push({label:r,font:s,textOffset:f,options:{rotation:O,color:T,strokeColor:F,strokeWidth:z,textAlign:$,textBaseline:j,translation:[a,i],backdrop:V}})}return C}},{key:"_getXAxisLabelAlignment",value:function(){var e=this.options,t=e.position,n=e.ticks;if(-mf(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=id(e,this.left,o)-o/2,s=id(e,this.right,f)+f/2,c=u=d):(c=id(e,this.top,o)-o/2,u=id(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&&ud(t,n);var r,a=Ph(this.getLabelItems(e));try{for(a.s();!(r=a.n()).done;){var i=r.value,o=i.options,l=i.font;yd(t,i.label,0,i.textOffset,l,o)}}catch(e){a.e(e)}finally{a.f()}n&&fd(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=Cd(r.font),o=Od(r.padding),l=r.align,s=i.lineHeight/2;"bottom"===n||"center"===n||Lu(n)?(s+=o.bottom,Iu(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=Lf(r,s,u),Lu(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:ov(e,n,t);a=u-s}else{if(Lu(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:ov(e,n,t);o=Lf(r,c,l),p="left"===n?-lf:lf}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;yd(e,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:h,textAlign:dv(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=Fu(t.grid&&t.grid.z,-1),i=Fu(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 Cd(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}(av),pv=function(){function e(t,n,r){Th(this,e),this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}return zh(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=Uu(Object.create(null),[n?nd.get(n):{},nd.get(t),e.defaults]);nd.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(".");nd.route(i,a,s,l)}))}(t,e.defaultRoutes),e.descriptors&&nd.describe(t,e.descriptors)}(e,i,t),this.override&&nd.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 nd[r]&&(delete nd[r][n],this.override&&delete Xf[n])}}]),e}(),vv=function(){function e(){Th(this,e),this.controllers=new pv(np,"datasets",!0),this.elements=new pv(av,"elements"),this.plugins=new pv(Object,"plugins"),this.scales=new pv(hv,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}return zh(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;Ih(t).forEach((function(t){var a=n||r._getRegistryForType(t);n||a.isForType(t)||a===r.plugins&&t.id?r._exec(e,a,t):Vu(t,(function(t){var a=n||r._getRegistryForType(t);r._exec(e,a,t)}))}))}},{key:"_exec",value:function(e,t,n){var r=Xu(e);$u(n["before"+r],[],n),t[e](n),$u(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}(),mv=new vv,yv=function(){function e(){Th(this,e),this._init=[]}return zh(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=Ph(e);try{for(i.s();!(a=i.n()).done;){var o=a.value,l=o.plugin;if(!1===$u(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(){Ru(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=Fu(n.options&&n.options.plugins,{}),a=function(e){for(var t={},n=[],r=Object.keys(mv.plugins.items),a=0;a<r.length;a++)n.push(mv.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=Ph(i);try{for(c.s();!(a=c.n()).done;){var u=a.value,f=u.id,d=gv(n[f],r);null!==d&&l.push({plugin:u,options:bv(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 gv(e,t){return t||!1!==e?!0===e?{}:e:null}function bv(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 xv(e,t){var n=nd.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function _v(e){if("x"===e||"y"===e||"r"===e)return e}function wv(e){return"top"===e||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0}function kv(e){if(_v(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||wv(o.position)||e.length>1&&_v(e[0].toLowerCase());if(l)return l}throw new Error("Cannot determine type of '".concat(e,"' axis. Please provide 'axis' or 'position' option."))}function Sv(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Ov(e){var t=e.options||(e.options={});t.plugins=Fu(t.plugins,{}),t.scales=function(e,t){var n=Xf[e.type]||{scales:{}},r=t.scales||{},a=xv(e.type,t),i=Object.create(null);return Object.keys(r).forEach((function(t){var o=r[t];if(!Lu(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=kv(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 Sv(e,"x",n[0])||Sv(e,"y",n[0])}return{}}(t,e),nd.scales[o.type]),s=function(e,t){return e===t?"_index_":"_value_"}(l,a),c=n.scales||{};i[t]=Gu(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||xv(a,t),l=(Xf[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),Gu(i[a],[{axis:t},r[a],l[e]])}))})),Object.keys(i).forEach((function(e){var t=i[e];Gu(t,[nd.scales[t.type],nd.scale])})),i}(e,t)}function Cv(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}var jv=new Map,Ev=new Set;function Av(e,t){var n=jv.get(e);return n||(n=t(),jv.set(e,n),Ev.add(n)),n}var Dv=function(e,t,n){var r=Ku(t,n);void 0!==r&&e.add(r)},Mv=function(){function e(t){Th(this,e),this._config=function(e){return(e=e||{}).data=Cv(e.data),Ov(e),e}(t),this._scopeCache=new Map,this._resolverCache=new Map}return zh(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=Cv(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(),Ov(e)}},{key:"clearCache",value:function(){this._scopeCache.clear(),this._resolverCache.clear()}},{key:"datasetScopeKeys",value:function(e){return Av(e,(function(){return[["datasets.".concat(e),""]]}))}},{key:"datasetAnimationScopeKeys",value:function(e,t){return Av("".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 Av("".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 Av("".concat(n,"-plugin-").concat(t),(function(){return[["plugins.".concat(t)].concat(Ih(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 Dv(l,e,t)}))),t.forEach((function(e){return Dv(l,r,e)})),t.forEach((function(e){return Dv(l,Xf[a]||{},e)})),t.forEach((function(e){return Dv(l,nd,e)})),t.forEach((function(e){return Dv(l,Jf,e)}))}));var s=Array.from(l);return 0===s.length&&s.push(Object.create(null)),Ev.has(t)&&i.set(t,s),s}},{key:"chartOptionScopes",value:function(){var e=this.options,t=this.type;return[e,Xf[t]||{},nd.datasets[t]||{},{type:t},nd,Jf]}},{key:"resolveNamedOptions",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[""],a={$shared:!0},i=Pv(this._resolverCache,e,r),o=i.resolver,l=i.subPrefixes,s=o;if(Iv(o,t)){a.$shared=!1,n=Qu(n)?n():n;var c=this.createResolver(e,n,l);s=Dd(o,n,c)}var u,f=Ph(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=Pv(this._resolverCache,e,n),i=a.resolver;return Lu(t)?Dd(i,t,void 0,r):i}}]),e}();function Pv(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:Ad(t,n),subPrefixes:n.filter((function(e){return!e.toLowerCase().includes("hover")}))},r.set(a,i)),i}var Rv=function(e){return Lu(e)&&Object.getOwnPropertyNames(e).reduce((function(t,n){return t||Qu(e[n])}),!1)};function Iv(e,t){var n,r=Md(e),a=r.isScriptable,i=r.isIndexable,o=Ph(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&&(Qu(u)||Rv(u))||c&&Iu(u))return!0}}catch(e){o.e(e)}finally{o.f()}return!1}var Lv=["top","bottom","left","right","chartArea"];function Nv(e,t){return"top"===e||"bottom"===e||-1===Lv.indexOf(e)&&"x"===t}function Tv(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Fv(e){var t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),$u(n&&n.onComplete,[e],t)}function zv(e){var t=e.chart,n=t.options.animation;$u(n&&n.onProgress,[e],t)}function $v(e){return Xd()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Vv={},Hv=function(e){var t=$v(e);return Object.values(Vv).filter((function(e){return e.canvas===t})).pop()};function Wv(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 Bv(e,t,n){return e.options.clip?e[n]:t[n]}var Yv=function(){function e(t,n){var r=this;Th(this,e);var a=this.config=new Mv(n),i=$v(t),o=Hv(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!Xd()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?Wp:rv}(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=Pu(),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 yv,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=[],Vv[this.id]=this,f&&d?($h.listen(this,"complete",Fv),$h.listen(this,"progress",zv),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}return zh(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 Ru(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 mv}},{key:"_initialize",value:function(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ih(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}},{key:"clear",value:function(){return od(this.canvas,this.ctx),this}},{key:"stop",value:function(){return $h.stop(this),this}},{key:"resize",value:function(e,t){$h.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,ih(this,o,!0)&&(this.notifyPlugins("resize",{size:i}),$u(n.onResize,[this,i],this),this.attached&&this._doResize(l)&&this.render())}},{key:"ensureScalesHaveIDs",value:function(){Vu(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=kv(e,t),a="r"===r,i="x"===r;return{options:t,dposition:a?"chartArea":i?"bottom":"left",dtype:a?"radialLinear":i?"category":"linear"}})))),Vu(i,(function(n){var i=n.options,o=i.id,l=kv(o,i),s=Fu(i.type,n.dtype);void 0!==i.position&&Nv(i.position,l)===Nv(n.dposition)||(i.position=n.dposition),a[o]=!0;var c=null;o in r&&r[o].type===s?c=r[o]:(c=new(mv.getScale(s))({id:o,type:s,ctx:e.ctx,chart:e}),r[c.id]=c),c.init(i,t)})),Vu(a,(function(e,t){e||delete r[t]})),Vu(r,(function(t){$p(0,t,t.options),Fp(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(Tv("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||xv(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=mv.getController(o),s=nd.datasets[o],c=s.datasetElementType,u=s.dataElementType;Object.assign(l,{dataElementType:mv.getElement(u),datasetElementType:c&&mv.getElement(c)}),i.controller=new l(this,e),n.push(i.controller)}}return this._updateMetasets(),n}},{key:"_resetElements",value:function(){var e=this;Vu(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||Vu(a,(function(e){e.reset()})),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Tv("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;Vu(this.scales,(function(t){zp(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);ef(t,n)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}},{key:"_updateHiddenIndices",value:function(){var e,t=this._hiddenIndices,n=Ph(this._getUniformDataChanges()||[]);try{for(n.s();!(e=n.n()).done;){var r=e.value,a=r.method,i=r.start,o=r.count;Wv(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(!ef(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})){Vp(this,this.width,this.height,e);var n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Vu(this.boxes,(function(e){var n;r&&"chartArea"===e.position||(e.configure&&e.configure(),(n=t._layers).push.apply(n,Ih(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,Qu(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})&&($h.has(this)?this.attached&&!$h.running(this)&&$h.start(this):(this.draw(),Fv({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:Bv(n,t,"left"),right:Bv(n,t,"right"),top:Bv(r,t,"top"),bottom:Bv(r,t,"bottom")}:t}(e,this.chartArea),i={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(r&&ud(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&&fd(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}},{key:"isPointInArea",value:function(e){return cd(e,this.chartArea,this._minPadding)}},{key:"getElementsAtEventForMode",value:function(e,t,n,r){var a=Cp.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=Ed(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);Ju(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(),$h.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(),od(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Vv[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)};Vu(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;Vu(this._listeners,(function(t,n){e.platform.removeEventListener(e,n,t)})),this._listeners={},Vu(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}}));!Hu(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,$u(i.onHover,[e,l,this],this),s&&$u(i.onClick,[e,l,this],this));var u=!Hu(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(){mv.add.apply(mv,arguments),Uv()}},{key:"unregister",value:function(){mv.remove.apply(mv,arguments),Uv()}}]),e}();function Uv(){return Vu(Yv.instances,(function(e){return e._plugins.invalidate()}))}function Gv(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Zv(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/tf)/f)/2,y=s+m+h,g=a-m-h,b=function(e,t,n,r){var a=wd(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 Sf(e,0,Math.min(i,t))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:Sf(a.innerStart,0,o),innerEnd:Sf(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-_,C=y+x/S,j=g-_/O,E=d+w,A=d+k,D=y+w/E,M=g-k/A;if(e.beginPath(),i){var P=(C+j)/2;if(e.arc(o,l,f,C,P),e.arc(o,l,f,P,j),_>0){var R=Gv(O,j,o,l);e.arc(R.x,R.y,_,j,g+lf)}var I=Gv(A,g,o,l);if(e.lineTo(I.x,I.y),k>0){var L=Gv(A,M,o,l);e.arc(L.x,L.y,k,g+lf,M+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=Gv(E,D,o,l);e.arc(T.x,T.y,w,D+Math.PI,y-lf)}var F=Gv(S,y,o,l);if(e.lineTo(F.x,F.y),x>0){var z=Gv(S,C,o,l);e.arc(z.x,z.y,x,y-lf,C)}}else{e.moveTo(o,l);var $=Math.cos(C)*f+o,V=Math.sin(C)*f+l;e.lineTo($,V);var H=Math.cos(j)*f+o,W=Math.sin(j)*f+l;e.lineTo(H,W)}e.closePath()}Mh(Yv,"defaults",nd),Mh(Yv,"instances",Vv),Mh(Yv,"overrides",Xf),Mh(Yv,"registry",mv),Mh(Yv,"version","4.4.0"),Mh(Yv,"getChart",Hv);var qv=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(this,n),Mh(Eh(r=t.call(this)),"circumference",void 0),Mh(Eh(r),"endAngle",void 0),Mh(Eh(r),"fullCircles",void 0),Mh(Eh(r),"innerRadius",void 0),Mh(Eh(r),"outerRadius",void 0),Mh(Eh(r),"pixelMargin",void 0),Mh(Eh(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(Eh(r),e),r}return zh(n,[{key:"inRange",value:function(e,t,n){var r=bf(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=Fu(f,s-l)>=nf||kf(a,l,s),p=Of(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>nf?Math.floor(n/nf):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(tf,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){Zv(e,t,n,r,s,a);for(var c=0;c<i;++c)e.fill();isNaN(l)||(s=o+(l%nf||nf))}Zv(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){Zv(e,t,n,r,p,a);for(var v=0;v<i;++v)e.stroke();isNaN(l)||(p=o+(l%nf||nf))}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+lf,r-lf),e.closePath(),e.clip()}(e,t,p),i||(Zv(e,t,n,r,p,a),e.stroke())}}(e,this,l,a,i),e.restore()}}}]),n}(av);function Kv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;e.lineCap=Fu(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Fu(n.borderDash,t.borderDash)),e.lineDashOffset=Fu(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Fu(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Fu(n.borderWidth,t.borderWidth),e.strokeStyle=Fu(n.borderColor,t.borderColor)}function Xv(e,t,n){e.lineTo(n.x,n.y)}function Jv(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 Qv(e,t,n,r){var a,i,o,l=t.points,s=t.options,c=Jv(l,n,r),u=c.count,f=c.start,d=c.loop,h=c.ilen,p=function(e){return e.stepped?dd:e.tension||"monotone"===e.cubicInterpolationMode?hd:Xv}(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 em(e,t,n,r){var a,i,o,l,s,c,u=t.points,f=Jv(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 tm(e){var t=e.options,n=t.borderDash&&t.borderDash.length;return e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||n?Qv:em}Mh(qv,"id","arc"),Mh(qv,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Mh(qv,"defaultRoutes",{backgroundColor:"backgroundColor"}),Mh(qv,"descriptors",{_scriptable:!0,_indexable:function(e){return"borderDash"!==e}});var nm="function"==typeof Path2D;var rm=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(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(Eh(r),e),r}return zh(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=Ud(a),o=e.length,l=Array(o).fill(0),s=Array(o),c=Yd(e,0);for(t=0;t<o;++t)if(n=r,r=c,c=Yd(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?ff(l[t-1])!==ff(l[t])?0:(l[t-1]+l[t])/2:l[t-1]:l[t]}Zd(e,l,s),qd(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=Gd(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=cd(e[0],t);for(n=0,r=e.length;n<r;++n)o=i,i=l,l=n<r-1&&cd(e[n+1],t),i&&(a=e[n],o&&(a.cp1x=Kd(a.cp1x,t.left,t.right),a.cp1y=Kd(a.cp1y,t.top,t.bottom)),l&&(a.cp2x=Kd(a.cp2x,t.left,t.right),a.cp2y=Kd(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=gh(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=ju(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];bh(g=gh(r.setContext(Ed(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=yh(this,{property:t,start:r,end:r});if(i.length){var o,l,s=[],c=function(e){return e.stepped?ch:e.tension||"monotone"===e.cubicInterpolationMode?uh:sh}(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 tm(this)(e,this,t,n)}},{key:"path",value:function(e,t,n){var r=this.segments,a=tm(this),i=this._loop;t=t||0,n=n||this.points.length-t;var o,l=Ph(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){nm&&!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()),Kv(e,t.options),e.stroke(a)}(e,t,n,r):function(e,t,n,r){var a,i=t.segments,o=t.options,l=tm(t),s=Ph(i);try{for(s.s();!(a=s.n()).done;){var c=a.value;Kv(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}(av);function am(e,t,n,r){var a=e.options,i=e.getProps([n],r)[n];return Math.abs(t-i)<a.radius+a.hitRadius}Mh(rm,"id","line"),Mh(rm,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Mh(rm,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Mh(rm,"descriptors",{_scriptable:!0,_indexable:function(e){return"borderDash"!==e&&"fill"!==e}});var im=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(this,n),Mh(Eh(r=t.call(this)),"parsed",void 0),Mh(Eh(r),"skip",void 0),Mh(Eh(r),"stop",void 0),r.options=void 0,r.parsed=void 0,r.skip=void 0,r.stop=void 0,e&&Object.assign(Eh(r),e),r}return zh(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 am(this,e,"x",t)}},{key:"inYRange",value:function(e,t){return am(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||!cd(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,ld(e,n,this.x,this.y))}},{key:"getRange",value:function(){var e=this.options||{};return e.radius+e.hitRadius}}]),n}(av);function om(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 lm(e,t,n,r){return e?0:Sf(t,n,r)}function sm(e,t,n,r){var a=null===t,i=null===n,o=e&&!(a&&i)&&om(e,r);return o&&(a||Of(t,o.left,o.right))&&(i||Of(n,o.top,o.bottom))}function cm(e,t){e.rect(t.x,t.y,t.w,t.h)}function um(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}}Mh(im,"id","point"),Mh(im,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Mh(im,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var fm=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(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(Eh(r),e),r}return zh(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=om(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=kd(r);return{t:lm(a.top,i.top,0,n),r:lm(a.right,i.right,0,t),b:lm(a.bottom,i.bottom,0,n),l:lm(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=Sd(a),o=Math.min(t,n),l=e.borderSkipped,s=r||Lu(a);return{topLeft:lm(!s||l.top||l.left,i.topLeft,0,o),topRight:lm(!s||l.top||l.right,i.topRight,0,o),bottomLeft:lm(!s||l.bottom||l.left,i.bottomLeft,0,o),bottomRight:lm(!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)?gd:cm;e.save(),h.w===d.w&&h.h===d.h||(e.beginPath(),p(e,um(h,l,d)),e.clip(),p(e,um(d,-l,h)),e.fillStyle=c,e.fill("evenodd")),e.beginPath(),p(e,um(d,l)),e.fillStyle=u,e.fill(),e.restore()}},{key:"inRange",value:function(e,t,n){return sm(this,e,t,n)}},{key:"inXRange",value:function(e,t){return sm(this,e,null,t)}},{key:"inYRange",value:function(e,t){return sm(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}(av);function dm(e,t,n,r){if(!r){var a=t[e],i=n[e];return"angle"===e&&(a=wf(a),i=wf(i)),{property:e,start:a,end:i}}}function hm(e,t,n){for(;t>e;t--){var r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function pm(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function vm(e,t){var n=[],r=!1;return Iu(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=hm(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 rm({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function mm(e){return e&&!1!==e.fill}function ym(e,t,n){var r,a=e[t].fill,i=[t];if(!n)return a;for(;!1!==a&&-1===i.indexOf(a);){if(!Nu(a))return a;if(!(r=e[a]))return!1;if(r.visible)return a;i.push(a),a=r.fill}return!1}function gm(e,t,n){var r=function(e){var t=e.options,n=t.fill,r=Fu(n&&n.target,n);return void 0===r&&(r=!!t.backgroundColor),!1!==r&&null!==r&&(!0===r?"origin":r)}(e);if(Lu(r))return!isNaN(r.value)&&r;var a=parseFloat(r);return Nu(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 bm(e,t,n){for(var r=[],a=0;a<n.length;a++){var i=xm(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 xm(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(Of(a,f,d)){l=a===f,s=a===d;break}}return{first:l,last:s,point:r}}Mh(fm,"id","bar"),Mh(fm,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Mh(fm,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var _m=function(){function e(t){Th(this,e),this.x=t.x,this.y=t.y,this.radius=t.radius}return zh(e,[{key:"pathSegment",value:function(e,t,n){var r=this.x,a=this.y,i=this.radius;return t=t||{start:0,end:nf},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 wm(e,t,n){var r=function(e){var t=e.chart,n=e.fill,r=e.line;if(Nu(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(vm({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++)bm(a,o[u],l);return new rm({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:Lu(e)?e.value:t.getBaseValue()}(n,t,i),l=[];if(r.grid.circular){var s=t.getPointPositionForValue(0,i);return new _m({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:Lu(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}(e.fill,n);if(Nu(r)){var a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}(e)}(e);return a instanceof _m?a:vm(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&&(ud(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&&(km(e,r,o.top),Sm(e,{line:n,target:r,color:a,scale:l,property:s}),e.restore(),e.save(),km(e,r,o.bottom)),Sm(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}),fd(e))}function km(e,t,n){var r=t.segments,a=t.points,i=!0,o=!1;e.beginPath();var l,s=Ph(r);try{for(s.s();!(l=s.n()).done;){var c=l.value,u=c.start,f=c.end,d=a[u],h=a[hm(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 Sm(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=Ph(a);try{for(s.s();!(r=s.n()).done;){var c=r.value,u=c.start,f=c.end;f=hm(u,f,i);var d=dm(n,i[u],i[f],c.loop);if(t.segments){var h,p=Ph(yh(t,d));try{for(p.s();!(h=p.n()).done;){var v,m=h.value,y=dm(n,o[m.start],o[m.end],m.loop),g=Ph(mh(c,i,y));try{for(g.s();!(v=g.n()).done;){var b=v.value;l.push({source:b,target:m,start:Mh({},n,pm(d,y,"start",Math.max)),end:Mh({},n,pm(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=Ph(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,Om(e,l,g&&dm(i,h,p)),e.beginPath();var b=!!r.pathSegment(e,f),x=void 0;if(g){b?e.closePath():Cm(e,a,p,i);var _=!!a.pathSegment(e,d,{move:b,reverse:!0});(x=b&&_)||Cm(e,a,h,i)}e.closePath(),e.fill(x?"evenodd":"nonzero"),e.restore()}}catch(e){c.e(e)}finally{c.f()}}function Om(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 Cm(e,t,n,r){var a=t.interpolate(n,r);a&&e.lineTo(a.x,a.y)}var jm={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 rm&&(o={visible:e.isDatasetVisible(a),index:a,fill:gm(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=ym(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&&wm(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;mm(i)&&wm(e.ctx,i,e.chartArea)}},beforeDatasetDraw:function(e,t,n){var r=t.meta.$filler;mm(r)&&"beforeDatasetDraw"===n.drawTime&&wm(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Em=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)}},Am=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(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 zh(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=$u(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=Cd(a.font),o=i.size,l=this._computeTitleHeight(),s=Em(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=Dm(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=fh(n.rtl,this.left,this.width);if(this.isHorizontal()){var o,l=0,s=Lf(r,this.left+a,this.right-this.lineWidths[l]),c=Ph(t);try{for(c.s();!(o=c.n()).done;){var u=o.value;l!==u.row&&(l=u.row,s=Lf(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=Lf(r,this.top+e+a,this.bottom-this.columnSizes[d].height),p=Ph(t);try{for(p.s();!(f=p.n()).done;){var v=f.value;v.col!==d&&(d=v.col,h=Lf(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;ud(e,this),this._draw(),fd(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=nd.color,c=fh(n.rtl,this.left,this.width),u=Cd(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=Em(l,d),v=p.boxWidth,m=p.boxHeight,y=p.itemHeight,g=this.isHorizontal(),b=this._computeTitleHeight();e=g?{x:Lf(o,this.left+f,this.right-a[0]),y:this.top+f+b,line:0}:{x:this.left+f,y:Lf(o,this.top+b+f,this.bottom-r[0].height),line:0},dh(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,C=e.y;if(c.setWidth(t.width),g?_>0&&O+S+f>t.right&&(C=e.y+=x,e.line++,O=e.x=Lf(o,t.left+f,t.right-a[e.line])):_>0&&C+x>t.bottom&&(O=e.x=O+r[e.line].width+f,e.line++,C=e.y=Lf(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=Fu(n.lineWidth,1);if(i.fillStyle=Fu(n.fillStyle,s),i.lineCap=Fu(n.lineCap,"butt"),i.lineDashOffset=Fu(n.lineDashOffset,0),i.lineJoin=Fu(n.lineJoin,"miter"),i.lineWidth=r,i.strokeStyle=Fu(n.strokeStyle,s),i.setLineDash(Fu(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);sd(i,a,o,t+h,l.pointStyleWidth&&v)}else{var u=t+Math.max((d-m)/2,0),f=c.leftForLtr(e,v),p=Sd(n.borderRadius);i.beginPath(),Object.values(p).some((function(e){return 0!==e}))?gd(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),C,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){yd(i,n.text,e,t+y/2,u,{strikethrough:n.hidden,textAlign:c.textAlign(n.textAlign)})}(c.x(O),C,p),g)e.x+=S+f;else if("string"!=typeof p.text){var j=u.lineHeight;e.y+=Dm(p,j)+f}else e.y+=x})),hh(this.ctx,n.textDirection)}},{key:"drawTitle",value:function(){var e=this.options,t=e.title,n=Cd(t.font),r=Od(t.padding);if(t.display){var a,i=fh(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,Ih(this.lineWidths)),a=this.top+c,u=Lf(e.align,u,this.right-f);else{var d=this.columnSizes.reduce((function(e,t){return Math.max(e,t.height)}),0);a=c+Lf(e.align,this.top,this.bottom-d-e.labels.padding-this._computeTitleHeight())}var h=Lf(l,u,u+f);o.textAlign=i.textAlign(If(l)),o.textBaseline="middle",o.strokeStyle=t.color,o.fillStyle=t.color,o.font=n.string,yd(o,t.text,h,a,n)}}},{key:"_computeTitleHeight",value:function(){var e=this.options.title,t=Cd(e.font),n=Od(e.padding);return e.display?t.lineHeight+n.height:0}},{key:"_getLegendItemAt",value:function(e,t){var n,r,a;if(Of(e,this.left,this.right)&&Of(t,this.top,this.bottom))for(a=this.legendHitBoxes,n=0;n<a.length;++n)if(Of(e,(r=a[n]).left,r.left+r.width)&&Of(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&&$u(t.onLeave,[e,i,this],this),this._hoveredItem=a,a&&!o&&$u(t.onHover,[e,a,this],this)}else a&&$u(t.onClick,[e,a,this],this)}}}]),n}(av);function Dm(e,t){return t*(e.text?e.text.length:0)}var Mm={id:"legend",_element:Am,start:function(e,t,n){var r=e.legend=new Am({ctx:e.ctx,options:n,chart:e});$p(0,r,n),Fp(e,r)},stop:function(e){zp(e,e.legend),delete e.legend},beforeUpdate:function(e,t,n){var r=e.legend;$p(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=Od(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)}}}},Pm=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(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 zh(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=Iu(n.text)?n.text.length:1;this._padding=Od(n.padding);var a=r*Cd(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=Lf(c,i,l),r=a+e,t=l-i):("left"===s.position?(n=i+e,r=Lf(c,o,a),u=-.5*tf):(n=l-e,r=Lf(c,a,o),u=.5*tf),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=Cd(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;yd(e,t.text,0,0,n,{color:t.color,maxWidth:l,rotation:s,textAlign:If(t.align),textBaseline:"middle",translation:[i,o]})}}}]),n}(av),Rm={id:"title",_element:Pm,start:function(e,t,n){!function(e,t){var n=new Pm({ctx:e.ctx,options:t,chart:e});$p(0,n,t),Fp(e,n),e.titleBlock=n}(e,n)},stop:function(e){var t=e.titleBlock;zp(e,t),delete e.titleBlock},beforeUpdate:function(e,t,n){var r=e.titleBlock;$p(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}},Im=(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=xf(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 Lm(e,t){return t&&(Iu(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Nm(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Tm(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 Fm(e,t){var n=e.chart.ctx,r=e.body,a=e.footer,i=e.title,o=t.boxWidth,l=t.boxHeight,s=Cd(t.bodyFont),c=Cd(t.titleFont),u=Cd(t.footerFont),f=i.length,d=a.length,h=r.length,p=Od(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,Vu(e.title,b),n.font=s.string,Vu(e.beforeBody.concat(e.afterBody),b),g=t.displayColors?o+2+t.boxPadding:0,Vu(r,(function(e){Vu(e.before,b),Vu(e.lines,b),Vu(e.after,b)})),g=0,n.font=u.string,Vu(e.footer,b),n.restore(),{width:m+=p.width,height:v}}function zm(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 $m(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||zm(e,t,n,r),yAlign:r}}function Vm(e,t,n,r){var a=e.caretSize,i=e.caretPadding,o=e.cornerRadius,l=n.xAlign,s=n.yAlign,c=a+i,u=Sd(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:Sf(v,0,r.width-t.width),y:Sf(m,0,r.height-t.height)}}function Hm(e,t,n){var r=Od(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-r.right:e.x+r.left}function Wm(e){return Lm([],Nm(e))}function Bm(e,t){var n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var Ym={beforeTitle:Du,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:Du,beforeBody:Du,beforeLabel:Du,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 Ru(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:Du,afterBody:Du,beforeFooter:Du,footer:Du,afterFooter:Du};function Um(e,t,n,r){var a=e[t].call(n,r);return void 0===a?Ym[t].call(n,r):a}var Gm=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(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 zh(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 Bh(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}},{key:"getContext",value:function(){return this.$context||(this.$context=(this,Ed(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}},{key:"getTitle",value:function(e,t){var n=t.callbacks,r=Um(n,"beforeTitle",this,e),a=Um(n,"title",this,e),i=Um(n,"afterTitle",this,e),o=[];return o=Lm(o,Nm(r)),o=Lm(o,Nm(a)),Lm(o,Nm(i))}},{key:"getBeforeBody",value:function(e,t){return Wm(Um(t.callbacks,"beforeBody",this,e))}},{key:"getBody",value:function(e,t){var n=this,r=t.callbacks,a=[];return Vu(e,(function(e){var t={before:[],lines:[],after:[]},i=Bm(r,e);Lm(t.before,Nm(Um(i,"beforeLabel",n,e))),Lm(t.lines,Um(i,"label",n,e)),Lm(t.after,Nm(Um(i,"afterLabel",n,e))),a.push(t)})),a}},{key:"getAfterBody",value:function(e,t){return Wm(Um(t.callbacks,"afterBody",this,e))}},{key:"getFooter",value:function(e,t){var n=t.callbacks,r=Um(n,"beforeFooter",this,e),a=Um(n,"footer",this,e),i=Um(n,"afterFooter",this,e),o=[];return o=Lm(o,Nm(r)),o=Lm(o,Nm(a)),Lm(o,Nm(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(Tm(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)}))),Vu(c,(function(t){var n=Bm(e.callbacks,t);o.push(Um(n,"labelColor",r,t)),l.push(Um(n,"labelPointStyle",r,t)),s.push(Um(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=Im[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=Fm(this,r),s=Object.assign({},o,l),c=$m(this.chart,r,s),u=Vm(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=Sd(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=fh(n.rtl,this.x,this.width);for(e.x=Hm(this,n.titleAlign,n),t.textAlign=s.textAlign(n.titleAlign),t.textBaseline="middle",r=Cd(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=Cd(a.bodyFont),u=Hm(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,ld(e,p,v,m),e.strokeStyle=i.borderColor,e.fillStyle=i.backgroundColor,ld(e,p,v,m)}else{e.lineWidth=Lu(i.borderWidth)?Math.max.apply(Math,Ih(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=Sd(i.borderRadius);Object.values(b).some((function(e){return 0!==e}))?(e.beginPath(),e.fillStyle=a.multiKeyBackground,gd(e,{x:y,y:h,w:s,h:l,radius:b}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),gd(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=Cd(n.bodyFont),g=y.lineHeight,b=0,x=fh(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=Hm(this,w,n),t.fillStyle=n.bodyColor,Vu(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,Vu(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;Vu(r.after,_)}b=0,g=y.lineHeight,Vu(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=fh(n.rtl,this.x,this.width);for(e.x=Hm(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=l.textAlign(n.footerAlign),t.textBaseline="middle",r=Cd(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=Sd(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=Im[e.position].call(this,this._active,this._eventPosition);if(!i)return;var o=this._size=Fm(this,e),l=Object.assign({},i,this._size),s=$m(t,e,l),c=Vm(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=Od(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),dh(e,t.textDirection),a.y+=i.top,this.drawTitle(a,e,t),this.drawBody(a,e,t),this.drawFooter(a,e,t),hh(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=!Hu(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||!Hu(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=Im[a.position].call(this,e,t);return!1!==i&&(n!==i.x||r!==i.y)}}]),n}(av);Mh(Gm,"positioners",Im);var Zm={id:"tooltip",_element:Gm,positioners:Im,afterInit:function(e,t,n){n&&(e.tooltip=new Gm({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",_h(_h({},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:Ym},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 qm(e){var t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var Km=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(this,n),(r=t.call(this,e))._startValue=void 0,r._valueRange=0,r._addedLabels=[],r}return zh(n,[{key:"init",value:function(e){var t=this._addedLabels;if(t.length){var r,a=this.getLabels(),i=Ph(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=[]}wh(Ah(n.prototype),"init",this).call(this,e)}},{key:"parse",value:function(e,t){if(Ru(e))return null;var n=this.getLabels();return function(e,t){return null===e?null:Sf(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,Fu(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 qm.call(this,e)}},{key:"configure",value:function(){wh(Ah(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}(hv);function Xm(e,t,n){var r=n.horizontal,a=mf(n.minRotation),i=(r?Math.sin(a):Math.cos(a))||.001,o=.75*t*(""+e).length;return Math.min(t/i,o)}Mh(Km,"id","category"),Mh(Km,"defaults",{ticks:{callback:qm}});var Jm=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(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 zh(n,[{key:"parse",value:function(e,t){return Ru(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=ff(a),c=ff(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=!Ru(d),S=!Ru(h),O=!Ru(v),C=(w-_)/(y+1),j=hf((w-_)/x/b)*b;if(j<1e-14&&!k&&!S)return[{value:_},{value:w}];(i=Math.ceil(w/j)-Math.floor(_/j))>x&&(j=hf(i*j/x/b)*b),Ru(p)||(n=Math.pow(10,p),j=Math.ceil(j*n)/n),"ticks"===u?(r=Math.floor(_/j)*j,a=Math.ceil(w/j)*j):(r=_,a=w),k&&S&&f&&(o=(h-d)/f,l=j/1e3,(s=Math.round(o))-l<=o&&s+l>=o)?(j=(h-d)/(i=Math.round(Math.min((h-d)/j,m))),r=d,a=h):O?j=((a=S?h:a)-(r=k?d:r))/(i=v-1):i=df(i=(a-r)/j,Math.round(i),j/1e3)?Math.round(i):Math.ceil(i);var E=Math.max(gf(j),gf(r));n=Math.pow(10,Ru(p)?E:p),r=Math.round(r*n)/n,a=Math.round(a*n)/n;var A=0;for(k&&(g&&r!==d?(c.push({value:d}),r<d&&A++,df(Math.round((r+A*j)*n)/n,d,Xm(d,C,e))&&A++):r<d&&A++);A<i;++A){var D=Math.round((r+A*j)*n)/n;if(S&&D>h)break;c.push({value:D})}return S&&g&&a!==h?c.length&&df(c[c.length-1].value,h,Xm(h,C,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&&vf(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(wh(Ah(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 Zf(e,this.chart.options.locale,this.options.ticks.format)}}]),n}(hv),Qm=function(e){Sh(n,e);var t=Ch(n);function n(){return Th(this,n),t.apply(this,arguments)}return zh(n,[{key:"determineDataLimits",value:function(){var e=this.getMinMax(!0),t=e.min,n=e.max;this.min=Nu(t)?t:0,this.max=Nu(n)?n:1,this.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){var e=this.isHorizontal(),t=e?this.width:this.height,n=mf(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}(Jm);Mh(Qm,"id","linear"),Mh(Qm,"defaults",{ticks:{callback:Kf.formatters.numeric}});var ey=function(e){return Math.floor(uf(e))},ty=function(e,t){return Math.pow(10,ey(e)+t)};function ny(e){return 1==e/Math.pow(10,ey(e))}function ry(e,t,n){var r=Math.pow(10,n),a=Math.floor(e/r);return Math.ceil(t/r)-a}var ay=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(this,n),(r=t.call(this,e)).start=void 0,r.end=void 0,r._startValue=void 0,r._valueRange=0,r}return zh(n,[{key:"parse",value:function(e,t){var n=Jm.prototype.parse.apply(this,[e,t]);if(0!==n)return Nu(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=Nu(t)?Math.max(0,t):null,this.max=Nu(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Nu(this._userMin)&&(this.min=t===ty(this.min,0)?ty(this.min,-1):ty(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(ty(r,-1)),o(ty(a,1)))),r<=0&&i(ty(a,-1)),a<=0&&o(ty(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=Tu(e.min,n);for(var a=[],i=ey(n),o=function(e,t){for(var n=ey(t-e);ry(e,t,n)>10;)n++;for(;ry(e,t,n)<10;)n--;return Math.min(n,ey(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=Tu(e.min,Math.round((c+f+d*Math.pow(10,o))*l)/l);h<r;)a.push({value:h,major:ny(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=Tu(e.max,h);return a.push({value:p,major:ny(p),significand:d}),a}({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&vf(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":Zf(e,this.chart.options.locale,this.options.ticks.format)}},{key:"configure",value:function(){var e=this.min;wh(Ah(n.prototype),"configure",this).call(this),this._startValue=uf(e),this._valueRange=uf(this.max)-uf(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:(uf(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}(hv);function iy(e){var t=e.ticks;if(t.display&&e.display){var n=Od(t.backdropPadding);return Fu(t.font&&t.font.size,nd.font.size)+n.height}return 0}function oy(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 ly(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 sy(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(yf(wf(f.angle+lf))),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 cy(e,t){if(!t)return!0;var n=e.left,r=e.top,a=e.right,i=e.bottom;return!(cd({x:n,y:r},t)||cd({x:n,y:i},t)||cd({x:a,y:r},t)||cd({x:a,y:i},t))}function uy(e,t,n){var r=n.left,a=n.top,i=n.right,o=n.bottom,l=t.backdropColor;if(!Ru(l)){var s=Sd(t.borderRadius),c=Od(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(),gd(e,{x:u,y:f,w:d,h,radius:s}),e.fill()):e.fillRect(u,f,d,h)}}function fy(e,t,n,r){var a=e.ctx;if(n)a.arc(e.xCenter,e.yCenter,t,0,nf);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)}}Mh(ay,"id","logarithmic"),Mh(ay,"defaults",{ticks:{callback:Kf.formatters.logarithmic,major:{enabled:!0}}});var dy=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(this,n),(r=t.call(this,e)).xCenter=void 0,r.yCenter=void 0,r.drawingArea=void 0,r._pointLabels=[],r._pointLabelItems=[],r}return zh(n,[{key:"setDimensions",value:function(){var e=this._padding=Od(iy(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=Nu(t)&&!isNaN(t)?t:0,this.max=Nu(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){return Math.ceil(this.drawingArea/iy(this.options))}},{key:"generateTickLabels",value:function(e){var t=this;Jm.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((function(e,n){var r=$u(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?tf/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=Cd(d.font),v=(t=e.ctx,n=p,r=Iu(r=e._pointLabels[f])?r:[r],{w:ad(t,n.string,r),h:r.length*n.lineHeight});o[f]=v;var m=wf(e.getIndexAngle(f)+u),y=Math.round(yf(m));ly(i,a,m,oy(y,h.x,v.w,0,180),oy(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:iy(o)/2,additionalAngle:s?tf/i:0},f=0;f<i;f++){u.padding=n[f],u.size=t[f];var d=sy(e,f,u);a.push(d),"auto"===c&&(d.visible=cy(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 wf(e*(nf/(this._pointLabels.length||1))+mf(this.options.startAngle||0))}},{key:"getDistanceFromCenterForValue",value:function(e){if(Ru(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(Ru(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 Ed(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)-lf+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(),fy(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));uy(n,o,i);var l=Cd(o.font),s=i.x,c=i.y,u=i.textAlign;yd(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(),fy(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=Cd(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=Od(s.backdropPadding);t.fillRect(-i/2-u.left,-a-c.size/2-u.top,i+u.width,c.size+u.height)}yd(t,o.label,0,-a,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}})),t.restore()}}},{key:"drawTitle",value:function(){}}]),n}(Jm);Mh(dy,"id","radialLinear"),Mh(dy,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Kf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:function(e){return e},padding:5,centerPointLabels:!1}}),Mh(dy,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Mh(dy,"descriptors",{angleLines:{_fallback:"grid"}});var hy={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}},py=Object.keys(hy);function vy(e,t){return e-t}function my(e,t){if(Ru(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)),Nu(l)||(l="string"==typeof a?n.parse(l,a):n.parse(l)),null===l?null:(i&&(l="week"!==i||!pf(o)&&!0!==o?n.startOf(l,i):n.startOf(l,"isoWeek",o)),+l)}function yy(e,t,n,r){for(var a=py.length,i=py.indexOf(e);i<a-1;++i){var o=hy[py[i]],l=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(l*o.size))<=r)return py[i]}return py[a-1]}function gy(e,t,n){if(n){if(n.length){var r=Cf(n,t),a=r.lo,i=r.hi;e[n[a]>=t?n[a]:n[i]]=!0}}else e[t]=!0}function by(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 xy=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(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 zh(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 xp._date(e.adapters.date);a.init(t),Gu(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},wh(Ah(n.prototype),"init",this).call(this,e),this._normalized=t.normalized}},{key:"parse",value:function(e,t){return void 0===e?null:my(this,e)}},{key:"beforeLayout",value:function(){wh(Ah(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=Nu(a)&&!isNaN(a)?a:+t.startOf(Date.now(),n),i=Nu(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?yy(t.minUnit,this.min,this.max,this._getLabelCapacity(a)):function(e,t,n,r,a){for(var i=py.length-1;i>=py.indexOf(n);i--){var o=py[i];if(hy[o].common&&e._adapter.diff(a,r,o)>=t-1)return o}return py[n?py.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=py.indexOf(e)+1,n=py.length;t<n;++t)if(hy[py[t]].common)return py[t]}(this._unit):void 0,this.initOffsets(r),e.reverse&&i.reverse(),by(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=Sf(r,0,i),a=Sf(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||yy(o.minUnit,r,a,this._getLabelCapacity(r)),s=Fu(i.ticks.stepSize,1),c="week"===l&&o.isoWeekday,u=pf(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++)gy(f,e,h);return e!==a&&"ticks"!==i.bounds&&1!==t||gy(f,e,h),Object.keys(f).sort(vy).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 $u(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=mf(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,by(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(my(this,r[e]));return this._cache.labels=this._normalized?n:this.normalize(n)}},{key:"normalize",value:function(e){return Mf(e.sort(vy))}}]),n}(hv);function _y(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=jf(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=jf(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}Mh(xy,"id","time"),Mh(xy,"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 wy=function(e){Sh(n,e);var t=Ch(n);function n(e){var r;return Th(this,n),(r=t.call(this,e))._table=[],r._minPos=void 0,r._tableRange=void 0,r}return zh(n,[{key:"initOffsets",value:function(){var e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=_y(t,this.min),this._tableRange=_y(t,this.max)-this._minPos,wh(Ah(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=wh(Ah(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(_y(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 _y(this._table,n*this._tableRange+this._minPos,!0)}}]),n}(xy);Mh(wy,"id","timeseries"),Mh(wy,"defaults",xy.defaults);var ky=["height","width","redraw","datasetIdKey","type","data","options","plugins","fallbackContent","updateMode"];function Sy(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 Oy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sy(Object(n),!0).forEach((function(t){Cy(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jy="label";function Ey(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function Ay(e,t){e.labels=t}function Dy(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:jy,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):Oy({},t)}))}function My(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jy,n={labels:[],datasets:[]};return Ay(n,e.labels),Dy(n,e.datasets,t),n}function Py(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,ky),g=(0,e.useRef)(null),b=(0,e.useRef)(),x=function(){g.current&&(b.current=new Yv(g.current,{type:u,data:My(f,c),options:d&&Oy({},d),plugins:p}),Ey(n,b.current))},_=function(){Ey(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&&Ay(b.current.config.data,f.labels)}),[s,f.labels]),(0,e.useEffect)((function(){!s&&b.current&&f.datasets&&Dy(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 Ry=(0,e.forwardRef)(Py);function Iy(t,n){return Yv.register(n),(0,e.forwardRef)((function(n,r){return e.createElement(Ry,Object.assign({},n,{ref:r,type:t}))}))}var Ly=Iy("line",pp),Ny=Iy("bar",fp),Ty=Iy("pie",mp);const Fy=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,pc[t[0]].label),t.length>1&&t.length<3&&React.createElement("span",null,pc[t[1]].label)))},zy=function(e){var t=e.isDisabled,n=void 0!==t&&t,r=e.selectedChartMetrics,a=e.onToggleChartMetric,i={conversions:pc.conversions,conversionrate:pc.conversionrate,views:pc.views};return React.createElement("div",{className:"flex gap-1 md:gap-2 lg:gap-3 flex-wrap".concat(n?" pointer-events-none opacity-50":"")},Object.keys(i).map((function(e,t){var n=r.includes(e),i="",o="";return n&&(i=pc[e].colorClass,o=pc[e].color),React.createElement("div",{key:t,onClick:function(){return a(e)},className:"inline-flex cursor-pointer items-center justify-center gap-[4px] text-sm hover:opacity-90 ".concat(n?i:"text-grey-1")},n?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_333_14963",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_333_14963)"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.025 19.975C4.375 20.325 4.80257 20.5 5.3077 20.5H18.6923C19.1974 20.5 19.625 20.325 19.975 19.975C20.325 19.625 20.5 19.1974 20.5 18.6923V5.3077C20.5 4.80257 20.325 4.375 19.975 4.025C19.625 3.675 19.1974 3.5 18.6923 3.5H5.3077C4.80257 3.5 4.375 3.675 4.025 4.025C3.675 4.375 3.5 4.80257 3.5 5.3077V18.6923C3.5 19.1974 3.675 19.625 4.025 19.975ZM17.323 9.13097L10.6 15.854L6.69615 11.9502L7.74998 10.8964L10.6 13.7464L16.2692 8.07715L17.323 9.13097Z",fill:o}))):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_342_15751",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_342_15751)"},React.createElement("path",{d:"M5.3077 20.5C4.80257 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.3077C3.5 4.80257 3.675 4.375 4.025 4.025C4.375 3.675 4.80257 3.5 5.3077 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80257 20.5 5.3077V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.3077ZM5.3077 19H18.6923C18.7692 19 18.8397 18.9679 18.9038 18.9038C18.9679 18.8397 19 18.7692 19 18.6923V5.3077C19 5.23077 18.9679 5.16024 18.9038 5.09613C18.8397 5.03203 18.7692 4.99998 18.6923 4.99998H5.3077C5.23077 4.99998 5.16024 5.03203 5.09612 5.09613C5.03202 5.16024 4.99997 5.23077 4.99997 5.3077V18.6923C4.99997 18.7692 5.03202 18.8397 5.09612 18.9038C5.16024 18.9679 5.23077 19 5.3077 19Z",fill:"#999999"}))),pc[e].label)})))};function $y(e){return $y="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},$y(e)}function Vy(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 Hy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vy(Object(n),!0).forEach((function(t){Wy(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wy(e,t,n){var r;return r=function(e,t){if("object"!=$y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=$y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==$y(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Yy(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)?Yy(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 Yy(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}Yv.register(Km,Qm,im,rm,Rm,Zm,Mm,jm);var Uy=(0,e.memo)((function(n){var r=n.charts,a=n.selectedChartMetrics,i=n.onToggleChartMetric,o=function(e){var t=0;return Object.keys(pc).map((function(n,r){e[n].map((function(e){t+=parseFloat(e.total)}))})),t}(r.data),l=By((0,e.useState)({selectedMetricsTotalPoints:0,labels:[],datasets:[]}),2),s=l[0],c=l[1],u=By((0,e.useState)(!1),2),f=u[0],d=u[1],h=By((0,e.useState)(vc()),2),p=h[0],m=h[1];(0,e.useEffect)((function(){var e=0,t=[];a.map((function(n,i){var o=r.data[n].map((function(e){return e.total}));r.data[n].map((function(t){e+=parseFloat(t.total)}));var l={label:n,data:o,borderColor:pc[n].color,fill:!0,borderWidth:2,pointHoverRadius:5,backgroundColor:function(e){var t=e.chart.ctx.createLinearGradient(0,0,0,400);return t.addColorStop(0,pc[n].color),t.addColorStop(1,"rgba(255, 255, 255, 0)"),t},spanGaps:!0};a.length<=2&&(l.yAxisID="chart-y-axis-"+(i+1)),t.push(l)})),c({selectedMetricsTotalPoints:e,labels:y(r.labels),datasets:t})}),[r,a]);var y=function(e){return e.map((function(e,t){return e.includes(":")?e:"list"===(null==r?void 0:r.filter)?v()(e).format("DD/MM/YYYY"):"weekly"===(null==r?void 0:r.filter)?v()(e).format("DD/MM/YY"):"monthly"===(null==r?void 0:r.filter)?v()(e).format("MMM YYYY"):v()(e).format("DD/MM/YYYY")}))};(0,e.useEffect)((function(){var e=function(){m(vc())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var g=function(){var e={x:{ticks:{maxTicksLimit:10,color:"dark"===p?"#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"===p?"#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"===p?"#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 Hy(Hy({},e),t)};(0,e.useEffect)((function(){d(g())}),[]),(0,e.useEffect)((function(){d(g())}),[p,a]);var b={maintainAspectRatio:!1,scales:f,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)?v()(t).format("dddd, MMM D"):"weekly"===(null==r?void 0:r.filter)?v()(t).format("DD MMM YY")+" "+fbox_admin_js_object.langs.TO+" "+v()(t).add(6,"day").format("DD MMM YY"):t},label:function(e){var t=parseFloat(e.raw),n=e.dataset.label,r=pc[n].label;return"conversionrate"===n&&(t=xc({num:t,decimalPoints:!0})),t=0!==t?t.toLocaleString("en-US"):t,"conversionrate"===n&&(t+="%")," "+t+" "+r}}}}};return t().createElement("div",{className:"flex flex-col gap-2 flex-grow justify-between"},0===s.labels.length?t().createElement(mc,null):t().createElement(t().Fragment,null,t().createElement("div",null,t().createElement(Fy,{selectedChartMetrics:a}),t().createElement("div",{className:"relative"},t().createElement("div",null,t().createElement(Ly,{data:s,options:b,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===s.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 pc[e].label})).join(", ")," ",fbox_admin_js_object.langs.DATA_AVAILABLE,".")))),t().createElement(zy,{isDisabled:0===o,selectedChartMetrics:a,onToggleChartMetric:i})))}));const Gy=Uy;var Zy=(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 b(c,(function(){o(!1)})),React.createElement("div",{className:"flex justify-between gap-3 items-center"},React.createElement("h2",{className:"text-[20px] text-default dark:text-white"},fbox_admin_js_object.langs.PERFORMANCE),(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},yc[r],React.createElement(ac,{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 qy=Zy;function Ky(e){return Ky="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},Ky(e)}function Xy(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 Jy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xy(Object(n),!0).forEach((function(t){Qy(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qy(e,t,n){var r;return r=function(e,t){if("object"!=Ky(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Ky(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==Ky(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eg(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||tg(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 tg(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}}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}var rg={labels:[],data:{views:[],conversions:[],conversionrate:[]},days_between:null};const ag=function(){var n,r,a,i,o=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},l=eg((0,e.useState)([]),2),s=l[0],c=l[1],f=eg((0,e.useState)(!0),2),d=f[0],h=f[1],p=eg((0,e.useState)(!1),2),v=p[0],m=p[1],y=eg((0,e.useState)(!1),2),b=y[0],x=y[1],_=eg((0,e.useState)(yc),2),w=_[0],k=_[1],S=eg((0,e.useState)(!1),2),O=S[0],C=S[1],j=eg((0,e.useState)("list"),2),E=j[0],A=j[1],D=eg((0,e.useState)((null==o?void 0:o.performanceFilters)||["views"]),2),M=D[0],P=D[1],R=eg((0,e.useState)(rg),2),I=R[0],L=R[1],N=t().createRef(),T=u(),F=T.date_period,z=T.custom_date_period,$=T.selected_campaign,V=function(){var e,t,n=Mc(F,z),r=n.start_date,a=n.end_date,i=Math.round((Date.parse(a)-Date.parse(r))/864e5);if(i<30?(k([]),A("list")):k(i<90?{list:fbox_admin_js_object.langs.DAILY,weekly:fbox_admin_js_object.langs.WEEKLY}:yc),!["today","custom"].includes(F)&&null!=s&&null!==(e=s[Rc($)])&&void 0!==e&&null!==(t=e[F])&&void 0!==t&&t[E])return L(s[Rc($)][F][E]),x(!1),void h(!1);var o=new FormData;o.append("nonce",fpf_js_object.nonce),o.append("action","firebox_analytics_get_charts_data"),o.append("start_date",r),o.append("end_date",a),o.append("selected_campaign",$),o.append("filter",E),fetch(fpf_js_object.ajax_url,{method:"POST",body:o}).then((function(e){return e.json()})).then((function(e){var t=e;Object.keys(t.data).map((function(e){t.data[e]=1===i?hc(t.labels,t.data[e]):dc(t.labels,t.data[e])})),t.filter=E,L(t),x(!1),h(!1),["today","custom"].includes(F)||c((function(e){var n,r,a,i=Rc($);return Jy(Jy({},e),{},Qy({},i,Jy(Jy({},e[i]),{},Qy({},F,Jy(Jy({},null===(n=e[i])||void 0===n?void 0:n[F]),{},Qy({},E,Jy(Jy({},null===(r=e[i])||void 0===r||null===(a=r[F])||void 0===a?void 0:a[E]),t)))))))}))}))};g((function(){V(),m(!0)}),N),(0,e.useEffect)((function(){v&&(h(!0),V())}),[$,E]),(0,e.useEffect)((function(){v&&"custom"===F&&(2===z.length&&(null===z[0]||null===z[1])||(h(!0),V()))}),[z]),(0,e.useEffect)((function(){v&&"custom"!==F&&(h(!0),V())}),[F]);var H=(0,e.useCallback)((function(e){var t=function(e){return function(e){if(Array.isArray(e))return ng(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||tg(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.")}()}(M),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&&P(t)}),[M]),W=(0,e.useCallback)((function(){C((function(e){return!e}))}),[]),B=(0,e.useCallback)((function(e){C(!1),x(!0),A(e)}),[E]);return t().createElement("div",{ref:N,className:"relative group flex flex-col gap-3 bg-white dark:bg-dark-1 rounded p-3 h-auto lg:h-[495px]"},t().createElement(qy,{isLoading:d,filter:E,performanceChartFiltersItems:w,showChartFiltersDropdown:O,setShowChartFiltersDropdown:C,toggleIsOpen:W,selectFilter:B}),(!d||null!=s&&null!==(n=s[Rc($)])&&void 0!==n&&null!==(r=n[F])&&void 0!==r&&r[E])&&(!b||null!=s&&null!==(a=s[Rc($)])&&void 0!==a&&null!==(i=a[F])&&void 0!==i&&i[E])?t().createElement(Gy,{charts:I,selectedChartMetrics:M,onToggleChartMetric:H}):t().createElement(mc,null))};const ig=(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,v()(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?v()(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))))})),og=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 lg(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}Yv.register(Km,Qm,fm,Rm,Zm,Mm);var sg=(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 lg(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)?lg(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)(vc()),2),i=a[0],o=a[1];(0,e.useEffect)((function(){var e=function(){o(vc())};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=pc.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(Ny,{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(og,null))}));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=(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 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),l=o[0],s=o[1],c=(0,e.useRef)("Filters_PopularViewTimes");b(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(ac,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 dg=fg,hg=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"}))},pg=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"}))},vg=function(e){var t=e.label;return React.createElement("a",{href:"#",className:"group shadow-none outline-none flex-grow justify-center inline-flex items-center gap-1 no-underline text-grey-1 hover:text-custom-red fpf-modal-opener","data-fpf-modal":"#fpfUpgradeToPro","data-fpf-plugin":"FireBox","data-fpf-modal-item":t},fbox_admin_js_object.langs.UPGRADE_TO_PRO,React.createElement(hg,{className:"group-hover:hidden"}),React.createElement(pg,{className:"hidden group-hover:block"}))};function mg(e){return mg="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},mg(e)}function yg(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 gg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yg(Object(n),!0).forEach((function(t){bg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bg(e,t,n){var r;return r=function(e,t){if("object"!=mg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=mg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==mg(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xg(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _g(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)?_g(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 _g(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 wg=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=xg((0,e.useState)([]),2),r=n[0],a=n[1],i=xg((0,e.useState)(!1),2),o=i[0],l=i[1],s=xg((0,e.useState)(!1),2),c=s[0],f=s[1],d=xg((0,e.useState)(null),2),h=d[0],p=d[1],v=xg((0,e.useState)((null==t?void 0:t.viewHoursFilter)||"all_days"),2),m=v[0],y=v[1],b=xg((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),x=b[0],_=(b[1],xg((0,e.useState)(0),2)),w=_[0],k=_[1],S=u(),O=S.date_period,C=S.custom_date_period,j=S.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(O)&&null!=r&&null!==(t=r[Rc(j)])&&void 0!==t&&null!==(n=t[O])&&void 0!==n&&n[m])return p(r[Rc(j)][O][m]),l(!1),void(e&&e());var i=Mc(O,C),o=i.start_date,s=i.end_date,c=Math.round((Date.parse(s)-Date.parse(o))/864e5);k(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=hc(x,t);n=(null==r?void 0:r.map((function(e){return e.total})))||[]}p(n),l(!1),["today","custom"].includes(O)||a((function(e){var t;return gg(gg({},e),{},bg({},Rc(j),gg(gg({},e[Rc(j)]),{},bg({},O,gg(gg({},null===(t=e[Rc(j)])||void 0===t?void 0:t[O]),{},bg({},m,n))))))})),l(!1),e&&e()}))},D=React.createRef();return g((function(){A(),f(!0)}),D),(0,e.useEffect)((function(){c&&(null!=h&&h.pro||(l(!0),A()))}),[j,m]),(0,e.useEffect)((function(){c&&"custom"===O&&(2===C.length&&(null===C[0]||null===C[1])||null!=h&&h.pro||(l(!0),A()))}),[C]),(0,e.useEffect)((function(){c&&"custom"!==O&&(null!=h&&h.pro||(l(!0),A()))}),[O]),React.createElement("div",{className:"relative flex flex-col gap-3 justify-between bg-white dark:bg-dark-1 rounded p-3",ref:D},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&&w>1&&React.createElement(dg,{isLoading:o,filter:m,setFilterHandler:E})),null!=h&&h.pro?React.createElement(vg,{label:fbox_admin_js_object.langs.VIEW_HOURS}):null!==h&&o&&c?React.createElement(og,null):React.createElement(cg,{labels:x,data:h}))};function kg(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}}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}Yv.register(qv,Zm,Mm);const Og=function(t){var n=t.labelIsEvent,r=void 0!==n&&n,a=t.filter,i=t.data,o=t.showPieLegends,l=function(e){return function(e){if(Array.isArray(e))return Sg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||kg(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||kg(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)(vc()),2),c=s[0],u=s[1],f=l.map((function(e){return e.label})),d=["#83D2FF","#FF83CD","#B983FF"];(0,e.useEffect)((function(){var e=function(){u(vc())};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=xc({num:parseFloat(e.raw),decimalPoints:"conversionrate"===a}),n=r?e.label:pc[a].label;return t=0!==t?t.toLocaleString("en-US"):t,"conversionrate"===a&&(t+="%")," "+t+" "+n}}}}};return React.createElement(Ty,{className:"self-center",data:h,options:p,width:210,height:210,key:Date.now()})},Cg=function(e){var t=e.labelLayout,n=void 0===t?null:t,r=e.data,a=e.filter;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===(i=pc[a])||void 0===i?void 0:i.suffix)&&void 0!==r?r:"",u="";"conversionrate"===a&&(u=xc({num:s})+c);var f=xc({num:s,decimalPoints:"conversionrate"===a});return 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(pc[a].colorClass),title:u},f+c))}))};function jg(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 Eg=function(t){var n=t.filter,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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return jg(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)?jg(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)(vc()),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(vc())};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,r=xc({num:parseFloat(e.raw),decimalPoints:"conversionrate"===n}),a=pc[n].label,i=(null===(t=pc[n])||void 0===t?void 0:t.suffix)||"";return" "+(r=0!==r?r.toLocaleString("en-US"):r)+i+" "+a}}}}},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(Ny,{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))};var Ag=(0,e.memo)((function(e){var t,n,r,a=e.labelIsEvent,i=void 0!==a&&a,o=e.labelLayout,l=e.label,s=e.showMetricLabel,c=void 0===s||s,u=e.data,f=e.filter,d=e.chartType,h=e.showPieLegends,p=void 0===h||h,v=(null===(t=u[f])||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;return React.createElement("div",{className:"flex flex-col gap-3 flex-grow max-h-[256px]"},"list"===d||c?React.createElement("div",{className:"flex gap-3 text-xs text-grey-1 ".concat("pie"===d?"justify-center":"justify-between")},"list"===d&&React.createElement("div",null,l),c&&React.createElement("div",{className:"list"!==d?"flex flex-grow justify-center":""},pc[f].label)):"",!v||v<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"===d?React.createElement("div",null,React.createElement(Og,{filter:f,data:u[f],labelIsEvent:i,showPieLegends:p})):"bar"===d?React.createElement(Eg,{filter:f,data:u[f]}):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(Cg,{labelLayout:o,data:u[f],filter:f}),30===(null===(r=u[f])||void 0===r?void 0:r.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 Dg=Ag,Mg=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"})))};function Pg(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 Rg=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 Pg(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)?Pg(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 b(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(Mg,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(pc).map((function(e,t){return c.includes(e)?null:React.createElement("div",{key:t,className:"".concat(0===t?"rounded-tl rounded-tr ":"","p-1 hover:bg-pale-blue dark:hover:bg-[#6b7a84] text-default hover:text-black dark:hover:text-white ").concat(e===n?"bg-pale-blue text-black dark:text-black pointer-events-none":"dark:text-grey-3 "),onClick:function(){return function(e){r(e),d(!1)}(e)}},pc[e].label)}))),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])}))))))},Ig=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 Lg=(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(Rg,{excludeMetrics:x,filter:u,setFilterHandler:f,chartType:d,setChartTypeHandler:h,chartsFilterable:p})),null===c?React.createElement(Ig,{chartType:d}):null!=c&&c.pro?React.createElement(vg,{label:i}):s?React.createElement(Ig,{chartType:d}):React.createElement(Dg,{showMetricLabel:l,labelIsEvent:n,labelLayout:a,label:i,data:c,filter:u,chartType:d,showPieLegends:g}))}));const Ng=Lg;function Tg(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 zg=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 Tg(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)?Tg(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 $g(e){return $g="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},$g(e)}function Vg(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 Hg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vg(Object(n),!0).forEach((function(t){Wg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wg(e,t,n){var r;return r=function(e,t){if("object"!=$g(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=$g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==$g(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bg(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(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 Ug=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Bg((0,e.useState)([]),2),r=n[0],a=n[1],i=Bg((0,e.useState)(!1),2),o=i[0],l=i[1],s=Bg((0,e.useState)(!1),2),c=s[0],f=s[1],d=Bg((0,e.useState)((null==t?void 0:t.referrersFilter)||"views"),2),h=d[0],p=d[1],v=Bg((0,e.useState)("list"),2),m=v[0],y=v[1],b=Bg((0,e.useState)(null),2),x=b[0],_=b[1],w=u(),k=w.date_period,S=w.custom_date_period,O=w.selected_campaign,C=(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(k)&&null!=r&&null!==(t=r[Rc(O)])&&void 0!==t&&t[k])return _(r[Rc(O)][k]),void f(!1);var n=Mc(k,S),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",O),fetch(fpf_js_object.ajax_url,{method:"POST",body:l}).then((function(e){return e.json()})).then((function(t){_(t),f(!1),["today","custom"].includes(k)||a((function(e){return Hg(Hg({},e),{},Wg({},Rc(O),Hg(Hg({},e[Rc(O)]),{},Wg({},k,t))))})),e&&e()}))},A=React.createRef();return g((function(){E(),l(!0)}),A,[k,S,O]),(0,e.useEffect)((function(){o&&(null!=x&&x.pro||(f(!0),E()))}),[O]),(0,e.useEffect)((function(){o&&"custom"===k&&(2===S.length&&(null===S[0]||null===S[1])||null!=x&&x.pro||(f(!0),E()))}),[S]),(0,e.useEffect)((function(){o&&"custom"!==k&&(null!=x&&x.pro||(f(!0),E()))}),[k]),React.createElement(Ng,{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(zg,{url:n,height:16}),React.createElement("div",{className:"truncate",title:n},t))},label:fbox_admin_js_object.langs.REFERRERS,isLoading:null!==x&&c&&o,data:x,filter:h,setFilterHandler:C,chartType:m,setChartTypeHandler:j,chartsFilterable:!1})},Gg=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 Zg(e){return Zg="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},Zg(e)}function qg(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 Kg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qg(Object(n),!0).forEach((function(t){Xg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xg(e,t,n){var r;return r=function(e,t){if("object"!=Zg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Zg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==Zg(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jg(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(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 eb=function(){var t=Jg((0,e.useState)([]),2),n=t[0],r=t[1],a=Jg((0,e.useState)(!1),2),i=a[0],o=a[1],l=Jg((0,e.useState)(!1),2),s=l[0],c=l[1],f=Jg((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=Mc(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 Kg(Kg({},e),{},Xg({},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 b=(0,e.useRef)();return g((function(){y(),o(!0)}),b,[v,m]),React.createElement("div",{ref:b,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(vg,{label:fbox_admin_js_object.langs.CONVERSIONS}):null===d||s?React.createElement(Gg,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(pc.conversions.colorClass," w-[67px]")},xc({num:r}),pc.conversions.suffix||""),React.createElement("div",{className:"font-bold ".concat(pc.conversionrate.colorClass," w-[88px]")},xc({num:a,decimalPoints:!0}),pc.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 tb(e){return tb="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},tb(e)}function nb(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 rb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nb(Object(n),!0).forEach((function(t){ab(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ab(e,t,n){var r;return r=function(e,t){if("object"!=tb(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=tb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==tb(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ib(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(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.")}()}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(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=ib((0,e.useState)([]),2),r=n[0],a=n[1],i=ib((0,e.useState)(!1),2),o=i[0],l=i[1],s=ib((0,e.useState)(!1),2),c=s[0],f=s[1],d=ib((0,e.useState)((null==t?void 0:t.countriesFilter)||"views"),2),h=d[0],p=d[1],v=ib((0,e.useState)("list"),2),m=v[0],y=(v[1],ib((0,e.useState)(null),2)),b=y[0],x=y[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.countriesFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),p(e)}),[h]),C=function(e){var t;if(!["today","custom"].includes(w)&&null!=r&&null!==(t=r[Rc(S)])&&void 0!==t&&t[w])return x(r[Rc(S)][w]),void f(!1);var n=Mc(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","countries"),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 rb(rb({},e),{},ab({},Rc(S),rb(rb({},e[Rc(S)]),{},ab({},w,t))))})),e&&e()}))},j=React.createRef();return g((function(){C(),l(!0)}),j,[w,k,S]),(0,e.useEffect)((function(){o&&(null!=b&&b.pro||(f(!0),C()))}),[S]),(0,e.useEffect)((function(){o&&"custom"===w&&(2===k.length&&(null===k[0]||null===k[1])||null!=b&&b.pro||(f(!0),C()))}),[k]),(0,e.useEffect)((function(){o&&"custom"!==w&&(null!=b&&b.pro||(f(!0),C()))}),[w]),React.createElement(Ng,{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!==b&&c&&o,data:b,filter:h,setFilterHandler:O,chartType:m,chartsFilterable:!1})};function sb(e){return sb="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},sb(e)}function cb(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 ub(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cb(Object(n),!0).forEach((function(t){fb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fb(e,t,n){var r;return r=function(e,t){if("object"!=sb(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=sb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==sb(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function db(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return hb(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)?hb(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 hb(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 pb=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=db((0,e.useState)([]),2),r=n[0],a=n[1],i=db((0,e.useState)(!1),2),o=i[0],l=i[1],s=db((0,e.useState)(!1),2),c=s[0],f=s[1],d=db((0,e.useState)((null==t?void 0:t.devicesFilter)||"views"),2),h=d[0],p=d[1],v=db((0,e.useState)(null),2),m=v[0],y=v[1],b=u(),x=b.date_period,_=b.custom_date_period,w=b.selected_campaign,k=(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]),S=function(e){var t;if(!["today","custom"].includes(x)&&null!=r&&null!==(t=r[Rc(w)])&&void 0!==t&&t[x])return y(r[Rc(w)][x]),void f(!1);var n=Mc(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",w),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(x)||a((function(e){return ub(ub({},e),{},fb({},Rc(w),ub(ub({},e[Rc(w)]),{},fb({},x,t))))})),e&&e()}))},O=React.createRef();return g((function(){S(),l(!0)}),O,[x,_,w]),(0,e.useEffect)((function(){o&&(null!=m&&m.pro||(f(!0),S()))}),[w]),(0,e.useEffect)((function(){o&&"custom"===x&&(2===_.length&&(null===_[0]||null===_[1])||null!=m&&m.pro||(f(!0),S()))}),[_]),(0,e.useEffect)((function(){o&&"custom"!==x&&(null!=m&&m.pro||(f(!0),S()))}),[x]),React.createElement(Ng,{boxRef:O,label:fbox_admin_js_object.langs.DEVICES,isLoading:null!==m&&c&&o,data:m,filter:h,setFilterHandler:k,chartType:"pie",chartsFilterable:!1})};function vb(e){return vb="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},vb(e)}function mb(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 yb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mb(Object(n),!0).forEach((function(t){gb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gb(e,t,n){var r;return r=function(e,t){if("object"!=vb(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=vb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==vb(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bb(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xb(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)?xb(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 xb(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 _b=function(){var t=bb((0,e.useState)([]),2),n=t[0],r=t[1],a=bb((0,e.useState)(!1),2),i=a[0],o=a[1],l=bb((0,e.useState)(!1),2),s=l[0],c=l[1],f=bb((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,b=function(e){var t;if(!["today","custom"].includes(v)&&null!=n&&null!==(t=n[Rc(y)])&&void 0!==t&&t[v])return h(n[Rc(y)][v]),void c(!1);var a=Mc(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 yb(yb({},e),{},gb({},Rc(y),yb(yb({},e[Rc(y)]),{},gb({},v,t))))})),e&&e()}))},x=React.createRef();return g((function(){b(),o(!0)}),x,[v,m,y]),(0,e.useEffect)((function(){i&&(null!=d&&d.pro||(c(!0),b()))}),[y]),(0,e.useEffect)((function(){i&&"custom"===v&&(2===m.length&&(null===m[0]||null===m[1])||null!=d&&d.pro||(c(!0),b()))}),[m]),(0,e.useEffect)((function(){i&&"custom"!==v&&(null!=d&&d.pro||(c(!0),b()))}),[v]),React.createElement(Ng,{boxRef:x,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 wb(e){return wb="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},wb(e)}function kb(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 Sb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kb(Object(n),!0).forEach((function(t){Ob(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ob(e,t,n){var r;return r=function(e,t){if("object"!=wb(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=wb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==wb(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cb(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return jb(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)?jb(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 jb(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 Eb=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Cb((0,e.useState)([]),2),r=n[0],a=n[1],i=Cb((0,e.useState)(!1),2),o=i[0],l=i[1],s=Cb((0,e.useState)(!1),2),c=s[0],f=s[1],d=Cb((0,e.useState)((null==t?void 0:t.pathsFilter)||"views"),2),h=d[0],p=d[1],v=Cb((0,e.useState)("list"),2),m=v[0],y=v[1],b=Cb((0,e.useState)(null),2),x=b[0],_=b[1],w=u(),k=w.date_period,S=w.custom_date_period,O=w.selected_campaign,C=(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(k)&&null!=r&&null!==(t=r[Rc(O)])&&void 0!==t&&t[k])return _(r[Rc(O)][k]),void f(!1);var n=Mc(k,S),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",O),fetch(fpf_js_object.ajax_url,{method:"POST",body:l}).then((function(e){return e.json()})).then((function(t){_(t),f(!1),["today","custom"].includes(k)||a((function(e){return Sb(Sb({},e),{},Ob({},Rc(O),Sb(Sb({},e[Rc(O)]),{},Ob({},k,t))))})),e&&e()}))},A=React.createRef();return g((function(){E(),l(!0)}),A,[k,S,O]),(0,e.useEffect)((function(){o&&(null!=x&&x.pro||(f(!0),E()))}),[O]),(0,e.useEffect)((function(){o&&"custom"===k&&(2===S.length&&(null===S[0]||null===S[1])||null!=x&&x.pro||(f(!0),E()))}),[S]),(0,e.useEffect)((function(){o&&"custom"!==k&&(null!=x&&x.pro||(f(!0),E()))}),[k]),React.createElement(Ng,{boxRef:A,label:fbox_admin_js_object.langs.PATHS,isLoading:null!==x&&c&&o,data:x,filter:h,setFilterHandler:C,chartType:m,setChartTypeHandler:j,chartsFilterable:!1})};function Ab(e){return Ab="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},Ab(e)}function Db(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 Mb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Db(Object(n),!0).forEach((function(t){Pb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Db(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pb(e,t,n){var r;return r=function(e,t){if("object"!=Ab(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Ab(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==Ab(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rb(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ib(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)?Ib(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 Ib(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(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Rb((0,e.useState)([]),2),r=n[0],a=n[1],i=Rb((0,e.useState)(!1),2),o=i[0],l=i[1],s=Rb((0,e.useState)(!1),2),c=s[0],f=s[1],d=Rb((0,e.useState)((null==t?void 0:t.topCampaignsFilter)||"views"),2),h=d[0],p=d[1],v=Rb((0,e.useState)(null),2),m=v[0],y=v[1],b=u(),x=b.date_period,_=b.custom_date_period,w=b.selected_campaign,k=(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]),S=function(e){var t;if(!["today","custom"].includes(x)&&null!=r&&null!==(t=r[Rc(w)])&&void 0!==t&&t[x])return y(r[Rc(w)][x]),void f(!1);var n=Mc(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(x)||a((function(e){return Mb(Mb({},e),{},Pb({},Rc(w),Mb(Mb({},e[Rc(w)]),{},Pb({},x,t))))})),f(!1),e&&e()}))},O=React.createRef();return g((function(){S(),l(!0)}),O,[x,_]),(0,e.useEffect)((function(){o&&(null!=m&&m.pro||(f(!0),S()))}),[w]),(0,e.useEffect)((function(){o&&"custom"===x&&(2===_.length&&(null===_[0]||null===_[1])||null!=m&&m.pro||(f(!0),S()))}),[_]),(0,e.useEffect)((function(){o&&"custom"!==x&&(null!=m&&m.pro||(f(!0),S()))}),[x]),React.createElement(Ng,{boxRef:O,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:k,chartType:"list",chartsFilterable:!1})};Yv.register(Km,Qm,im,rm,Rm,Zm,Mm,jm);const Nb=function(e){var t=e.labels,n=e.data,r=e.metricKey,a={labels:t,datasets:[{label:pc[r],data:n,borderColor:pc[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,pc[r].color),t.addColorStop(1,"rgba(255, 255, 255, 0)"),t},spanGaps:!0}]};return React.createElement(Ly,{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 Tb=(0,e.memo)((function(e){var t=e.data;return React.createElement("div",{className:"grid gap-4 grid-cols-2 grid-rows-2 flex-grow"},Object.keys(t.data).map((function(e,n){var r,a,i,o,l,s,c=pc[e].label,u=t.data[e].title||"",f=(null===(r=t.data[e])||void 0===r?void 0:r.currentTotal)||0,d=(null===(a=t.data[e])||void 0===a?void 0:a.previousTotal)||0,h=(null===(i=t.data[e])||void 0===i||null===(o=i.data)||void 0===o?void 0:o.map((function(e){return e.total})))||[],p=_c(f,d),v=xc({num:p}),m=null!==(l=null===(s=pc[e])||void 0===s?void 0:s.suffix)&&void 0!==l?l:"",y="";"conversionrate"===e&&(y=xc({num:f})+m);var g=xc({num:f,decimalPoints:!1});return React.createElement("div",{className:"flex flex-col gap-[4px]".concat(n>=2?" justify-end":""),key:n},React.createElement("div",{className:"text-xs text-grey-1"},c),React.createElement("div",{className:"truncate dark:text-white",title:u},u||fbox_admin_js_object.langs["N/A"]),(u||0!=p)&&React.createElement("div",{className:"flex gap-1 dark:text-white"},u&&React.createElement("span",{className:"font-bold text-[20px]",title:y},g,m),0!=p&&React.createElement("div",{className:"inline-flex items-center gap-[4px] leading-none",title:fbox_admin_js_object.langs.PERCENTAGE_DIFFERENCE_AGAINST_PREVIOUS_PERIOD},React.createElement("span",{className:"text-[12px] font-bold ".concat(p>0?"text-custom-green":"text-custom-red")},v,"%"),p>0?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"})))),h.length>0&&React.createElement("div",null,React.createElement(Nb,{metricKey:e,labels:t.labels,data:h})),h.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 Fb=Tb;function zb(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 $b=function(){return React.createElement("div",{className:"grid gap-4 grid-cols-2 grid-rows-2 flex-grow"},function(e){return function(e){if(Array.isArray(e))return zb(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 zb(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)?zb(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(4).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 Vb(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 Hb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vb(Object(n),!0).forEach((function(t){Wb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vb(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 Bb(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 Yb(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)?Yb(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 Yb(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 Ub=function(){var t=React.createRef(),n=Bb((0,e.useState)([]),2),r=n[0],a=n[1],i=Bb((0,e.useState)(!1),2),o=i[0],l=i[1],s=Bb((0,e.useState)(!1),2),c=s[0],f=s[1],d=u(),h=d.date_period,p=d.custom_date_period,v=Bb((0,e.useState)(null),2),m=v[0],y=v[1],b=function(e){if(!["today","custom"].includes(h)&&null!=r&&r[h])return y(r[h]),l(!1),void(e&&e());var t=Mc(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?hc(n.labels,n.data[e].data):dc(n.labels,n.data[e].data))})),["today","custom"].includes(h)||a((function(e){return Hb(Hb({},e),{},Wb({},h,n))})),y(n),l(!1),e&&e()}))};return g((function(){b(),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),b()))}),[p]),(0,e.useEffect)((function(){c&&"custom"!==h&&(null!=m&&m.pro||(l(!0),b()))}),[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(vg,{label:fbox_admin_js_object.langs.MOST_POPULAR_CAMPAIGNS}):null!=m&&m.labels&&0!==m.labels.length?o?React.createElement($b,null):React.createElement(Fb,{data:m}):React.createElement($b,null))};function Gb(e){return Gb="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},Gb(e)}function Zb(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 qb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zb(Object(n),!0).forEach((function(t){Kb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Kb(e,t,n){var r;return r=function(e,t){if("object"!=Gb(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Gb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==Gb(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xb(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Jb(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)?Jb(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 Jb(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 Qb=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Xb((0,e.useState)([]),2),r=n[0],a=n[1],i=Xb((0,e.useState)(!1),2),o=i[0],l=i[1],s=Xb((0,e.useState)(!1),2),c=s[0],f=s[1],d=Xb((0,e.useState)((null==t?void 0:t.dayOfTheWeekFilter)||"views"),2),h=d[0],p=d[1],v=Xb((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],Xb((0,e.useState)(null),2)),b=y[0],x=y[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.dayOfTheWeekFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),p(e)}),[h]),C=function(e){var t;if(!["today","custom"].includes(w)&&null!=r&&null!==(t=r[Rc(S)])&&void 0!==t&&t[w])return x(r[Rc(S)][w]),l(!1),void(e&&e());var n=Mc(w,k),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",S),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])})),x(n),l(!1),["today","custom"].includes(w)||a((function(e){return qb(qb({},e),{},Kb({},Rc(S),qb(qb({},e[Rc(S)]),{},Kb({},w,n))))})),l(!1),e&&e()}))},j=React.createRef();return g((function(){C(),f(!0)}),j,[w,k,S]),(0,e.useEffect)((function(){c&&(null!=b&&b.pro||(l(!0),C()))}),[S]),(0,e.useEffect)((function(){c&&"custom"===w&&(2===k.length&&(null===k[0]||null===k[1])||null!=b&&b.pro||(l(!0),C()))}),[k]),(0,e.useEffect)((function(){c&&"custom"!==w&&(null!=b&&b.pro||(l(!0),C()))}),[w]),React.createElement(Ng,{boxRef:j,label:fbox_admin_js_object.langs.DAY_OF_THE_WEEK,isLoading:null!==b&&o&&c,data:b,filter:h,setFilterHandler:O,chartType:"bar",chartsFilterable:!1})};function ex(e){return ex="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},ex(e)}function tx(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 nx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tx(Object(n),!0).forEach((function(t){rx(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rx(e,t,n){var r;return r=function(e,t){if("object"!=ex(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=ex(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"),(t="symbol"==ex(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ax(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 ix=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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ax(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)?ax(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=f(),c=Mc(o,l),d=c.start_date,h=c.end_date,p=Math.round((Date.parse(h)-Date.parse(d))/864e5);return(0,e.useEffect)((function(){if(null!==i){if(n[i])return void s({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(nx(nx({},n),{},rx({},i,a))),s({type:"SET_CAMPAIGN",payload:a})}(e)}))}(i)}}),[i]),React.createElement("div",{className:"grid gap-5 grid-cols-1 lg:grid-cols-2 grid-rows-4"},i?React.createElement(ig,null):React.createElement(Ub,null),React.createElement(wg,null),p>1&&React.createElement(Qb,null),!i&&React.createElement(Lb,null),React.createElement(lb,null),React.createElement(Ug,null),React.createElement(pb,null),React.createElement(Eb,null),React.createElement(_b,null),!i&&React.createElement(eb,null))};function ox(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 lx={campaign:null,date_period:localStorage.getItem("firebox_analytics_date_period")||"last_7_days",custom_date_period:localStorage.getItem("firebox_analytics_custom_date_period")?JSON.parse(localStorage.getItem("firebox_analytics_custom_date_period")).map((function(e){return new Date(e)})):[null,null],selected_campaign:new URLSearchParams(window.location.search).get("campaign")||null},sx=function(n){var r=n.children,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 ox(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)?ox(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,lx),2),i=a[0],o=a[1];return t().createElement(s.Provider,{value:i},t().createElement(c.Provider,{value:o},r))};function cx(){return t().createElement(t().Fragment,null,t().createElement(sx,null,t().createElement(h,{_title:fbox_admin_js_object.langs.ANALYTICS,call_to_action:!1}),t().createElement(bc,null),t().createElement(Vc,null),t().createElement(ag,null),t().createElement(ix,null)))}(0,r.s)(document.querySelector("#fpf-firebox-analytics")).render(t().createElement(cx,null))})()})(); |