| Server IP : 104.21.28.229 / Your IP : 216.73.216.142 Web Server : Apache/2 System : Linux hosting8537.lvs 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : mienphi ( 1014) PHP Version : 8.2.14 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/mienphi/public_html/wp-content/plugins/learnpress-gradebook/build/min/ |
Upload File : |
(()=>{var t={8566:function(t,e,n){var r,a=a||function(t){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,n=function(){return t.URL||t.webkitURL||t},r=e.createElementNS("http://www.w3.org/1999/xhtml","a"),a="download"in r,i=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),o=t.webkitRequestFileSystem,s=t.requestFileSystem||o||t.mozRequestFileSystem,l=function(e){(t.setImmediate||t.setTimeout)((function(){throw e}),0)},c="application/octet-stream",u=0,d=function(t){setTimeout((function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()}),4e4)},h=function(t,e,n){for(var r=(e=[].concat(e)).length;r--;){var a=t["on"+e[r]];if("function"==typeof a)try{a.call(t,n||t)}catch(t){l(t)}}},p=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t},f=function(e,l,f){f||(e=p(e));var g,m,b,x=this,_=e.type,v=!1,y=function(){h(x,"writestart progress write writeend".split(" "))},w=function(){if(m&&i&&"undefined"!=typeof FileReader){var r=new FileReader;return r.onloadend=function(){var t=r.result;m.location.href="data:attachment/file"+t.slice(t.search(/[,;]/)),x.readyState=x.DONE,y()},r.readAsDataURL(e),void(x.readyState=x.INIT)}!v&&g||(g=n().createObjectURL(e)),m?m.location.href=g:void 0===t.open(g,"_blank")&&i&&(t.location.href=g),x.readyState=x.DONE,y(),d(g)},k=function(t){return function(){if(x.readyState!==x.DONE)return t.apply(this,arguments)}},S={create:!0,exclusive:!1};if(x.readyState=x.INIT,l||(l="download"),a)return g=n().createObjectURL(e),void setTimeout((function(){var t,e;r.href=g,r.download=l,t=r,e=new MouseEvent("click"),t.dispatchEvent(e),y(),d(g),x.readyState=x.DONE}));t.chrome&&_&&_!==c&&(b=e.slice||e.webkitSlice,e=b.call(e,0,e.size,c),v=!0),o&&"download"!==l&&(l+=".download"),(_===c||o)&&(m=t),s?(u+=e.size,s(t.TEMPORARY,u,k((function(t){t.root.getDirectory("saved",S,k((function(t){var n=function(){t.getFile(l,S,k((function(t){t.createWriter(k((function(n){n.onwriteend=function(e){m.location.href=t.toURL(),x.readyState=x.DONE,h(x,"writeend",e),d(t)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&w()},"writestart progress write abort".split(" ").forEach((function(t){n["on"+t]=x["on"+t]})),n.write(e),x.abort=function(){n.abort(),x.readyState=x.DONE},x.readyState=x.WRITING})),w)})),w)};t.getFile(l,{create:!1},k((function(t){t.remove(),n()})),k((function(t){t.code===t.NOT_FOUND_ERR?n():w()})))})),w)})),w)):w()},g=f.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return n||(t=p(t)),navigator.msSaveOrOpenBlob(t,e||"download")}:(g.abort=function(){var t=this;t.readyState=t.DONE,h(t,"abort")},g.readyState=g.INIT=0,g.WRITING=1,g.DONE=2,g.error=g.onwritestart=g.onprogress=g.onwrite=g.onabort=g.onerror=g.onwriteend=null,function(t,e,n){return new f(t,e,n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);t.exports?t.exports.saveAs=a:null!==n.amdD&&null!==n.amdO&&(void 0===(r=function(){return a}.apply(e,[]))||(t.exports=r))},5580:(t,e,n)=>{var r=n(6110)(n(9325),"DataView");t.exports=r},1549:(t,e,n)=>{var r=n(2032),a=n(3862),i=n(6721),o=n(2749),s=n(5749);function l(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=o,l.prototype.set=s,t.exports=l},79:(t,e,n)=>{var r=n(3702),a=n(80),i=n(4739),o=n(8655),s=n(1175);function l(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=o,l.prototype.set=s,t.exports=l},8223:(t,e,n)=>{var r=n(6110)(n(9325),"Map");t.exports=r},3661:(t,e,n)=>{var r=n(3040),a=n(7670),i=n(289),o=n(4509),s=n(2949);function l(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=o,l.prototype.set=s,t.exports=l},2804:(t,e,n)=>{var r=n(6110)(n(9325),"Promise");t.exports=r},6545:(t,e,n)=>{var r=n(6110)(n(9325),"Set");t.exports=r},8859:(t,e,n)=>{var r=n(3661),a=n(1380),i=n(1459);function o(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}o.prototype.add=o.prototype.push=a,o.prototype.has=i,t.exports=o},7217:(t,e,n)=>{var r=n(79),a=n(1420),i=n(938),o=n(3605),s=n(9817),l=n(945);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=a,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=s,c.prototype.set=l,t.exports=c},1873:(t,e,n)=>{var r=n(9325).Symbol;t.exports=r},7828:(t,e,n)=>{var r=n(9325).Uint8Array;t.exports=r},8303:(t,e,n)=>{var r=n(6110)(n(9325),"WeakMap");t.exports=r},1033:t=>{t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},9770:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,a=0,i=[];++n<r;){var o=t[n];e(o,n,t)&&(i[a++]=o)}return i}},695:(t,e,n)=>{var r=n(8096),a=n(2428),i=n(6449),o=n(3656),s=n(361),l=n(7167),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),u=!n&&a(t),d=!n&&!u&&o(t),h=!n&&!u&&!d&&l(t),p=n||u||d||h,f=p?r(t.length,String):[],g=f.length;for(var m in t)!e&&!c.call(t,m)||p&&("length"==m||d&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,g))||f.push(m);return f}},4932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,a=Array(r);++n<r;)a[n]=e(t[n],n,t);return a}},4528:t=>{t.exports=function(t,e){for(var n=-1,r=e.length,a=t.length;++n<r;)t[a+n]=e[n];return t}},4248:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},7805:(t,e,n)=>{var r=n(3360),a=n(5288);t.exports=function(t,e,n){(void 0!==n&&!a(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},6547:(t,e,n)=>{var r=n(3360),a=n(5288),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var o=t[e];i.call(t,e)&&a(o,n)&&(void 0!==n||e in t)||r(t,e,n)}},6025:(t,e,n)=>{var r=n(5288);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},3360:(t,e,n)=>{var r=n(3243);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},9344:(t,e,n)=>{var r=n(3805),a=Object.create,i=function(){function t(){}return function(e){if(!r(e))return{};if(a)return a(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=i},2523:t=>{t.exports=function(t,e,n,r){for(var a=t.length,i=n+(r?1:-1);r?i--:++i<a;)if(e(t[i],i,t))return i;return-1}},6649:(t,e,n)=>{var r=n(3221)();t.exports=r},7422:(t,e,n)=>{var r=n(1769),a=n(7797);t.exports=function(t,e){for(var n=0,i=(e=r(e,t)).length;null!=t&&n<i;)t=t[a(e[n++])];return n&&n==i?t:void 0}},2199:(t,e,n)=>{var r=n(4528),a=n(6449);t.exports=function(t,e,n){var i=e(t);return a(t)?i:r(i,n(t))}},2552:(t,e,n)=>{var r=n(1873),a=n(659),i=n(9350),o=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":o&&o in Object(t)?a(t):i(t)}},8077:t=>{t.exports=function(t,e){return null!=t&&e in Object(t)}},7534:(t,e,n)=>{var r=n(2552),a=n(346);t.exports=function(t){return a(t)&&"[object Arguments]"==r(t)}},270:(t,e,n)=>{var r=n(7068),a=n(346);t.exports=function t(e,n,i,o,s){return e===n||(null==e||null==n||!a(e)&&!a(n)?e!=e&&n!=n:r(e,n,i,o,t,s))}},7068:(t,e,n)=>{var r=n(7217),a=n(5911),i=n(1986),o=n(689),s=n(5861),l=n(6449),c=n(3656),u=n(7167),d="[object Arguments]",h="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,g,m,b){var x=l(t),_=l(e),v=x?h:s(t),y=_?h:s(e),w=(v=v==d?p:v)==p,k=(y=y==d?p:y)==p,S=v==y;if(S&&c(t)){if(!c(e))return!1;x=!0,w=!1}if(S&&!w)return b||(b=new r),x||u(t)?a(t,e,n,g,m,b):i(t,e,v,n,g,m,b);if(!(1&n)){var E=w&&f.call(t,"__wrapped__"),M=k&&f.call(e,"__wrapped__");if(E||M){var C=E?t.value():t,P=M?e.value():e;return b||(b=new r),m(C,P,n,g,b)}}return!!S&&(b||(b=new r),o(t,e,n,g,m,b))}},1799:(t,e,n)=>{var r=n(7217),a=n(270);t.exports=function(t,e,n,i){var o=n.length,s=o,l=!i;if(null==t)return!s;for(t=Object(t);o--;){var c=n[o];if(l&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<s;){var u=(c=n[o])[0],d=t[u],h=c[1];if(l&&c[2]){if(void 0===d&&!(u in t))return!1}else{var p=new r;if(i)var f=i(d,h,u,t,e,p);if(!(void 0===f?a(h,d,3,i,p):f))return!1}}return!0}},5083:(t,e,n)=>{var r=n(1882),a=n(7296),i=n(3805),o=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,d=c.hasOwnProperty,h=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||a(t))&&(r(t)?h:s).test(o(t))}},4901:(t,e,n)=>{var r=n(2552),a=n(294),i=n(346),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&a(t.length)&&!!o[r(t)]}},5389:(t,e,n)=>{var r=n(3663),a=n(7978),i=n(3488),o=n(6449),s=n(583);t.exports=function(t){return"function"==typeof t?t:null==t?i:"object"==typeof t?o(t)?a(t[0],t[1]):r(t):s(t)}},8984:(t,e,n)=>{var r=n(5527),a=n(3650),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return a(t);var e=[];for(var n in Object(t))i.call(t,n)&&"constructor"!=n&&e.push(n);return e}},2903:(t,e,n)=>{var r=n(3805),a=n(5527),i=n(181),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=a(t),n=[];for(var s in t)("constructor"!=s||!e&&o.call(t,s))&&n.push(s);return n}},3663:(t,e,n)=>{var r=n(1799),a=n(776),i=n(7197);t.exports=function(t){var e=a(t);return 1==e.length&&e[0][2]?i(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},7978:(t,e,n)=>{var r=n(270),a=n(8156),i=n(631),o=n(8586),s=n(756),l=n(7197),c=n(7797);t.exports=function(t,e){return o(t)&&s(e)?l(c(t),e):function(n){var o=a(n,t);return void 0===o&&o===e?i(n,t):r(e,o,3)}}},5250:(t,e,n)=>{var r=n(7217),a=n(7805),i=n(6649),o=n(2824),s=n(3805),l=n(7241),c=n(4974);t.exports=function t(e,n,u,d,h){e!==n&&i(n,(function(i,l){if(h||(h=new r),s(i))o(e,n,l,u,t,d,h);else{var p=d?d(c(e,l),i,l+"",e,n,h):void 0;void 0===p&&(p=i),a(e,l,p)}}),l)}},2824:(t,e,n)=>{var r=n(7805),a=n(3290),i=n(1961),o=n(3007),s=n(5529),l=n(2428),c=n(6449),u=n(3693),d=n(3656),h=n(1882),p=n(3805),f=n(1331),g=n(7167),m=n(4974),b=n(9884);t.exports=function(t,e,n,x,_,v,y){var w=m(t,n),k=m(e,n),S=y.get(k);if(S)r(t,n,S);else{var E=v?v(w,k,n+"",t,e,y):void 0,M=void 0===E;if(M){var C=c(k),P=!C&&d(k),D=!C&&!P&&g(k);E=k,C||P||D?c(w)?E=w:u(w)?E=o(w):P?(M=!1,E=a(k,!0)):D?(M=!1,E=i(k,!0)):E=[]:f(k)||l(k)?(E=w,l(w)?E=b(w):p(w)&&!h(w)||(E=s(k))):M=!1}M&&(y.set(k,E),_(E,k,x,v,y),y.delete(k)),r(t,n,E)}}},7237:t=>{t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},7255:(t,e,n)=>{var r=n(7422);t.exports=function(t){return function(e){return r(e,t)}}},9302:(t,e,n)=>{var r=n(3488),a=n(6757),i=n(2865);t.exports=function(t,e){return i(a(t,e,r),t+"")}},9570:(t,e,n)=>{var r=n(7334),a=n(3243),i=n(3488),o=a?function(t,e){return a(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=o},8096:t=>{t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},7556:(t,e,n)=>{var r=n(1873),a=n(4932),i=n(6449),o=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return a(e,t)+"";if(o(e))return l?l.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},4128:(t,e,n)=>{var r=n(1800),a=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(a,""):t}},7301:t=>{t.exports=function(t){return function(e){return t(e)}}},9219:t=>{t.exports=function(t,e){return t.has(e)}},1769:(t,e,n)=>{var r=n(6449),a=n(8586),i=n(1802),o=n(3222);t.exports=function(t,e){return r(t)?t:a(t,e)?[t]:i(o(t))}},9653:(t,e,n)=>{var r=n(7828);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},3290:(t,e,n)=>{t=n.nmd(t);var r=n(9325),a=e&&!e.nodeType&&e,i=a&&t&&!t.nodeType&&t,o=i&&i.exports===a?r.Buffer:void 0,s=o?o.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=s?s(n):new t.constructor(n);return t.copy(r),r}},1961:(t,e,n)=>{var r=n(9653);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},3007:t=>{t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},1791:(t,e,n)=>{var r=n(6547),a=n(3360);t.exports=function(t,e,n,i){var o=!n;n||(n={});for(var s=-1,l=e.length;++s<l;){var c=e[s],u=i?i(n[c],t[c],c,n,t):void 0;void 0===u&&(u=t[c]),o?a(n,c,u):r(n,c,u)}return n}},5481:(t,e,n)=>{var r=n(9325)["__core-js_shared__"];t.exports=r},999:(t,e,n)=>{var r=n(9302),a=n(6800);t.exports=function(t){return r((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&a(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var l=n[r];l&&t(e,l,r,o)}return e}))}},3221:t=>{t.exports=function(t){return function(e,n,r){for(var a=-1,i=Object(e),o=r(e),s=o.length;s--;){var l=o[t?s:++a];if(!1===n(i[l],l,i))break}return e}}},2006:(t,e,n)=>{var r=n(5389),a=n(4894),i=n(5950);t.exports=function(t){return function(e,n,o){var s=Object(e);if(!a(e)){var l=r(n,3);e=i(e),n=function(t){return l(s[t],t,s)}}var c=t(e,n,o);return c>-1?s[l?e[c]:c]:void 0}}},3243:(t,e,n)=>{var r=n(6110),a=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=a},5911:(t,e,n)=>{var r=n(8859),a=n(4248),i=n(9219);t.exports=function(t,e,n,o,s,l){var c=1&n,u=t.length,d=e.length;if(u!=d&&!(c&&d>u))return!1;var h=l.get(t),p=l.get(e);if(h&&p)return h==e&&p==t;var f=-1,g=!0,m=2&n?new r:void 0;for(l.set(t,e),l.set(e,t);++f<u;){var b=t[f],x=e[f];if(o)var _=c?o(x,b,f,e,t,l):o(b,x,f,t,e,l);if(void 0!==_){if(_)continue;g=!1;break}if(m){if(!a(e,(function(t,e){if(!i(m,e)&&(b===t||s(b,t,n,o,l)))return m.push(e)}))){g=!1;break}}else if(b!==x&&!s(b,x,n,o,l)){g=!1;break}}return l.delete(t),l.delete(e),g}},1986:(t,e,n)=>{var r=n(1873),a=n(7828),i=n(5288),o=n(5911),s=n(317),l=n(4247),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;t.exports=function(t,e,n,r,c,d,h){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!d(new a(t),new a(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var p=s;case"[object Set]":var f=1&r;if(p||(p=l),t.size!=e.size&&!f)return!1;var g=h.get(t);if(g)return g==e;r|=2,h.set(t,e);var m=o(p(t),p(e),r,c,d,h);return h.delete(t),m;case"[object Symbol]":if(u)return u.call(t)==u.call(e)}return!1}},689:(t,e,n)=>{var r=n(2),a=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,i,o,s){var l=1&n,c=r(t),u=c.length;if(u!=r(e).length&&!l)return!1;for(var d=u;d--;){var h=c[d];if(!(l?h in e:a.call(e,h)))return!1}var p=s.get(t),f=s.get(e);if(p&&f)return p==e&&f==t;var g=!0;s.set(t,e),s.set(e,t);for(var m=l;++d<u;){var b=t[h=c[d]],x=e[h];if(i)var _=l?i(x,b,h,e,t,s):i(b,x,h,t,e,s);if(!(void 0===_?b===x||o(b,x,n,i,s):_)){g=!1;break}m||(m="constructor"==h)}if(g&&!m){var v=t.constructor,y=e.constructor;v==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof y&&y instanceof y||(g=!1)}return s.delete(t),s.delete(e),g}},4840:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},2:(t,e,n)=>{var r=n(2199),a=n(4664),i=n(5950);t.exports=function(t){return r(t,i,a)}},2651:(t,e,n)=>{var r=n(4218);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},776:(t,e,n)=>{var r=n(756),a=n(5950);t.exports=function(t){for(var e=a(t),n=e.length;n--;){var i=e[n],o=t[i];e[n]=[i,o,r(o)]}return e}},6110:(t,e,n)=>{var r=n(5083),a=n(392);t.exports=function(t,e){var n=a(t,e);return r(n)?n:void 0}},8879:(t,e,n)=>{var r=n(4335)(Object.getPrototypeOf,Object);t.exports=r},659:(t,e,n)=>{var r=n(1873),a=Object.prototype,i=a.hasOwnProperty,o=a.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var a=o.call(t);return r&&(e?t[s]=n:delete t[s]),a}},4664:(t,e,n)=>{var r=n(9770),a=n(3345),i=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,s=o?function(t){return null==t?[]:(t=Object(t),r(o(t),(function(e){return i.call(t,e)})))}:a;t.exports=s},5861:(t,e,n)=>{var r=n(5580),a=n(8223),i=n(2804),o=n(6545),s=n(8303),l=n(2552),c=n(7473),u="[object Map]",d="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",g=c(r),m=c(a),b=c(i),x=c(o),_=c(s),v=l;(r&&v(new r(new ArrayBuffer(1)))!=f||a&&v(new a)!=u||i&&v(i.resolve())!=d||o&&v(new o)!=h||s&&v(new s)!=p)&&(v=function(t){var e=l(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case g:return f;case m:return u;case b:return d;case x:return h;case _:return p}return e}),t.exports=v},392:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},9326:(t,e,n)=>{var r=n(1769),a=n(2428),i=n(6449),o=n(361),s=n(294),l=n(7797);t.exports=function(t,e,n){for(var c=-1,u=(e=r(e,t)).length,d=!1;++c<u;){var h=l(e[c]);if(!(d=null!=t&&n(t,h)))break;t=t[h]}return d||++c!=u?d:!!(u=null==t?0:t.length)&&s(u)&&o(h,u)&&(i(t)||a(t))}},2032:(t,e,n)=>{var r=n(1042);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},6721:(t,e,n)=>{var r=n(1042),a=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return a.call(e,t)?e[t]:void 0}},2749:(t,e,n)=>{var r=n(1042),a=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:a.call(e,t)}},5749:(t,e,n)=>{var r=n(1042);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},5529:(t,e,n)=>{var r=n(9344),a=n(8879),i=n(5527);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(a(t))}},361:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},6800:(t,e,n)=>{var r=n(5288),a=n(4894),i=n(361),o=n(3805);t.exports=function(t,e,n){if(!o(n))return!1;var s=typeof e;return!!("number"==s?a(n)&&i(e,n.length):"string"==s&&e in n)&&r(n[e],t)}},8586:(t,e,n)=>{var r=n(6449),a=n(4394),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!a(t))||o.test(t)||!i.test(t)||null!=e&&t in Object(e)}},4218:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},7296:(t,e,n)=>{var r,a=n(5481),i=(r=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},5527:t=>{var e=Object.prototype;t.exports=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}},756:(t,e,n)=>{var r=n(3805);t.exports=function(t){return t==t&&!r(t)}},3702:t=>{t.exports=function(){this.__data__=[],this.size=0}},80:(t,e,n)=>{var r=n(6025),a=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():a.call(e,n,1),--this.size,0))}},4739:(t,e,n)=>{var r=n(6025);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},8655:(t,e,n)=>{var r=n(6025);t.exports=function(t){return r(this.__data__,t)>-1}},1175:(t,e,n)=>{var r=n(6025);t.exports=function(t,e){var n=this.__data__,a=r(n,t);return a<0?(++this.size,n.push([t,e])):n[a][1]=e,this}},3040:(t,e,n)=>{var r=n(1549),a=n(79),i=n(8223);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||a),string:new r}}},7670:(t,e,n)=>{var r=n(2651);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},289:(t,e,n)=>{var r=n(2651);t.exports=function(t){return r(this,t).get(t)}},4509:(t,e,n)=>{var r=n(2651);t.exports=function(t){return r(this,t).has(t)}},2949:(t,e,n)=>{var r=n(2651);t.exports=function(t,e){var n=r(this,t),a=n.size;return n.set(t,e),this.size+=n.size==a?0:1,this}},317:t=>{t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},7197:t=>{t.exports=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}},2224:(t,e,n)=>{var r=n(104);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},1042:(t,e,n)=>{var r=n(6110)(Object,"create");t.exports=r},3650:(t,e,n)=>{var r=n(4335)(Object.keys,Object);t.exports=r},181:t=>{t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},6009:(t,e,n)=>{t=n.nmd(t);var r=n(4840),a=e&&!e.nodeType&&e,i=a&&t&&!t.nodeType&&t,o=i&&i.exports===a&&r.process,s=function(){try{return i&&i.require&&i.require("util").types||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=s},9350:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},4335:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},6757:(t,e,n)=>{var r=n(1033),a=Math.max;t.exports=function(t,e,n){return e=a(void 0===e?t.length-1:e,0),function(){for(var i=arguments,o=-1,s=a(i.length-e,0),l=Array(s);++o<s;)l[o]=i[e+o];o=-1;for(var c=Array(e+1);++o<e;)c[o]=i[o];return c[e]=n(l),r(t,this,c)}}},9325:(t,e,n)=>{var r=n(4840),a="object"==typeof self&&self&&self.Object===Object&&self,i=r||a||Function("return this")();t.exports=i},4974:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},1380:t=>{t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},1459:t=>{t.exports=function(t){return this.__data__.has(t)}},4247:t=>{t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},2865:(t,e,n)=>{var r=n(9570),a=n(1811)(r);t.exports=a},1811:t=>{var e=Date.now;t.exports=function(t){var n=0,r=0;return function(){var a=e(),i=16-(a-r);if(r=a,i>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}},1420:(t,e,n)=>{var r=n(79);t.exports=function(){this.__data__=new r,this.size=0}},938:t=>{t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},3605:t=>{t.exports=function(t){return this.__data__.get(t)}},9817:t=>{t.exports=function(t){return this.__data__.has(t)}},945:(t,e,n)=>{var r=n(79),a=n(8223),i=n(3661);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var o=n.__data__;if(!a||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(o)}return n.set(t,e),this.size=n.size,this}},1802:(t,e,n)=>{var r=n(2224),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,o=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(a,(function(t,n,r,a){e.push(r?a.replace(i,"$1"):n||t)})),e}));t.exports=o},7797:(t,e,n)=>{var r=n(4394);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},7473:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},1800:t=>{var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},6139:(t,e,n)=>{var r=n(6547),a=n(1791),i=n(999),o=n(4894),s=n(5527),l=n(5950),c=Object.prototype.hasOwnProperty,u=i((function(t,e){if(s(e)||o(e))a(e,l(e),t);else for(var n in e)c.call(e,n)&&r(t,n,e[n])}));t.exports=u},7334:t=>{t.exports=function(t){return function(){return t}}},5288:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},7309:(t,e,n)=>{var r=n(2006)(n(4713));t.exports=r},4713:(t,e,n)=>{var r=n(2523),a=n(5389),i=n(1489),o=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var l=null==n?0:i(n);return l<0&&(l=o(s+l,0)),r(t,a(e,3),l)}},8156:(t,e,n)=>{var r=n(7422);t.exports=function(t,e,n){var a=null==t?void 0:r(t,e);return void 0===a?n:a}},631:(t,e,n)=>{var r=n(8077),a=n(9326);t.exports=function(t,e){return null!=t&&a(t,e,r)}},3488:t=>{t.exports=function(t){return t}},2428:(t,e,n)=>{var r=n(7534),a=n(346),i=Object.prototype,o=i.hasOwnProperty,s=i.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(t){return a(t)&&o.call(t,"callee")&&!s.call(t,"callee")};t.exports=l},6449:t=>{var e=Array.isArray;t.exports=e},4894:(t,e,n)=>{var r=n(1882),a=n(294);t.exports=function(t){return null!=t&&a(t.length)&&!r(t)}},3693:(t,e,n)=>{var r=n(4894),a=n(346);t.exports=function(t){return a(t)&&r(t)}},3656:(t,e,n)=>{t=n.nmd(t);var r=n(9325),a=n(9935),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,s=o&&o.exports===i?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||a;t.exports=l},1882:(t,e,n)=>{var r=n(2552),a=n(3805);t.exports=function(t){if(!a(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},294:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3805:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},346:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},1331:(t,e,n)=>{var r=n(2552),a=n(8879),i=n(346),o=Function.prototype,s=Object.prototype,l=o.toString,c=s.hasOwnProperty,u=l.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=a(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==u}},4394:(t,e,n)=>{var r=n(2552),a=n(346);t.exports=function(t){return"symbol"==typeof t||a(t)&&"[object Symbol]"==r(t)}},7167:(t,e,n)=>{var r=n(4901),a=n(7301),i=n(6009),o=i&&i.isTypedArray,s=o?a(o):r;t.exports=s},5950:(t,e,n)=>{var r=n(695),a=n(8984),i=n(4894);t.exports=function(t){return i(t)?r(t):a(t)}},7241:(t,e,n)=>{var r=n(695),a=n(2903),i=n(4894);t.exports=function(t){return i(t)?r(t,!0):a(t)}},104:(t,e,n)=>{var r=n(3661);function a(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=e?e.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var o=t.apply(this,r);return n.cache=i.set(a,o)||i,o};return n.cache=new(a.Cache||r),n}a.Cache=r,t.exports=a},5364:(t,e,n)=>{var r=n(5250),a=n(999)((function(t,e,n){r(t,e,n)}));t.exports=a},583:(t,e,n)=>{var r=n(7237),a=n(7255),i=n(8586),o=n(7797);t.exports=function(t){return i(t)?r(o(t)):a(t)}},3345:t=>{t.exports=function(){return[]}},9935:t=>{t.exports=function(){return!1}},7400:(t,e,n)=>{var r=n(9374),a=1/0;t.exports=function(t){return t?(t=r(t))===a||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},1489:(t,e,n)=>{var r=n(7400);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},9374:(t,e,n)=>{var r=n(4128),a=n(3805),i=n(4394),o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(a(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=a(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=s.test(t);return n||l.test(t)?c(t.slice(2),n?2:8):o.test(t)?NaN:+t}},9884:(t,e,n)=>{var r=n(1791),a=n(7241);t.exports=function(t){return r(t,a(t))}},3222:(t,e,n)=>{var r=n(7556);t.exports=function(t){return null==t?"":r(t)}},9764:function(t,e,n){var r;t.exports=(r=n(1609),function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(r,a,function(e){return t[e]}.bind(null,a));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){t.exports=n(2)()},function(t,e){t.exports=r},function(t,e,n){"use strict";var r=n(3);function a(){}function i(){}i.resetWarningCache=a,t.exports=function(){function t(t,e,n,a,i,o){if(o!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:a};return n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";n.r(e);var r=n(1),a=n.n(r),i=n(0),o=n.n(i);function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var l=function(t){var e=t.pageClassName,n=t.pageLinkClassName,r=t.page,i=t.selected,o=t.activeClassName,l=t.activeLinkClassName,c=t.getEventListener,u=t.pageSelectedHandler,d=t.href,h=t.extraAriaContext,p=t.pageLabelBuilder,f=t.ariaLabel||"Page "+r+(h?" "+h:""),g=null;return i&&(g="page",f=t.ariaLabel||"Page "+r+" is your current page",e=void 0!==e?e+" "+o:o,void 0!==n?void 0!==l&&(n=n+" "+l):n=l),a.a.createElement("li",{className:e},a.a.createElement("a",s({role:"button",className:n,href:d,tabIndex:"0","aria-label":f,"aria-current":g,onKeyPress:u},c(u)),p(r)))};l.propTypes={pageSelectedHandler:o.a.func.isRequired,selected:o.a.bool.isRequired,pageClassName:o.a.string,pageLinkClassName:o.a.string,activeClassName:o.a.string,activeLinkClassName:o.a.string,extraAriaContext:o.a.string,href:o.a.string,ariaLabel:o.a.string,page:o.a.number.isRequired,getEventListener:o.a.func.isRequired,pageLabelBuilder:o.a.func.isRequired};var c=l;function u(){return(u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var d=function(t){var e=t.breakLabel,n=t.breakClassName,r=t.breakLinkClassName,i=t.breakHandler,o=t.getEventListener,s=n||"break";return a.a.createElement("li",{className:s},a.a.createElement("a",u({className:r,role:"button",tabIndex:"0",onKeyPress:i},o(i)),e))};d.propTypes={breakLabel:o.a.oneOfType([o.a.string,o.a.node]),breakClassName:o.a.string,breakLinkClassName:o.a.string,breakHandler:o.a.func.isRequired,getEventListener:o.a.func.isRequired};var h=d;function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(){return(f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function m(t,e){return(m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function b(t){var e=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(t){return!1}}();return function(){var n,r=_(t);if(e){var a=_(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return x(t)}(this,n)}}function x(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&m(t,e)}(i,t);var e,n,r=b(i);function i(t){var e,n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),v(x(e=r.call(this,t)),"handlePreviousPage",(function(t){var n=e.state.selected;t.preventDefault?t.preventDefault():t.returnValue=!1,n>0&&e.handlePageSelected(n-1,t)})),v(x(e),"handleNextPage",(function(t){var n=e.state.selected,r=e.props.pageCount;t.preventDefault?t.preventDefault():t.returnValue=!1,n<r-1&&e.handlePageSelected(n+1,t)})),v(x(e),"handlePageSelected",(function(t,n){n.preventDefault?n.preventDefault():n.returnValue=!1,e.state.selected!==t?(e.setState({selected:t}),e.callCallback(t)):e.callActiveCallback(t)})),v(x(e),"getEventListener",(function(t){return v({},e.props.eventListener,t)})),v(x(e),"handleBreakClick",(function(t,n){n.preventDefault?n.preventDefault():n.returnValue=!1;var r=e.state.selected;e.handlePageSelected(r<t?e.getForwardJump():e.getBackwardJump(),n)})),v(x(e),"callCallback",(function(t){void 0!==e.props.onPageChange&&"function"==typeof e.props.onPageChange&&e.props.onPageChange({selected:t})})),v(x(e),"callActiveCallback",(function(t){void 0!==e.props.onPageActive&&"function"==typeof e.props.onPageActive&&e.props.onPageActive({selected:t})})),v(x(e),"pagination",(function(){var t=[],n=e.props,r=n.pageRangeDisplayed,i=n.pageCount,o=n.marginPagesDisplayed,s=n.breakLabel,l=n.breakClassName,c=n.breakLinkClassName,u=e.state.selected;if(i<=r)for(var d=0;d<i;d++)t.push(e.getPageElement(d));else{var p,f,g,m=r/2,b=r-m;u>i-r/2?m=r-(b=i-u):u<r/2&&(b=r-(m=u));var x=function(t){return e.getPageElement(t)};for(p=0;p<i;p++)(f=p+1)<=o||f>i-o||p>=u-m&&p<=u+b?t.push(x(p)):s&&t[t.length-1]!==g&&(g=a.a.createElement(h,{key:p,breakLabel:s,breakClassName:l,breakLinkClassName:c,breakHandler:e.handleBreakClick.bind(null,p),getEventListener:e.getEventListener}),t.push(g))}return t})),void 0!==t.initialPage&&void 0!==t.forcePage&&console.warn("(react-paginate): Both initialPage (".concat(t.initialPage,") and forcePage (").concat(t.forcePage,") props are provided, which is discouraged.")+" Use exclusively forcePage prop for a controlled component.\nSee https://reactjs.org/docs/forms.html#controlled-components"),n=t.initialPage?t.initialPage:t.forcePage?t.forcePage:0,e.state={selected:n},e}return e=i,(n=[{key:"componentDidMount",value:function(){var t=this.props,e=t.initialPage,n=t.disableInitialCallback,r=t.extraAriaContext,a=t.pageCount;void 0===e||n||this.callCallback(e),r&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead."),Number.isInteger(a)||console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(this.props.pageCount,"). Did you forget a Math.ceil()?"))}},{key:"componentDidUpdate",value:function(t){void 0!==this.props.forcePage&&this.props.forcePage!==t.forcePage&&this.setState({selected:this.props.forcePage}),Number.isInteger(t.pageCount)&&!Number.isInteger(this.props.pageCount)&&console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(this.props.pageCount,"). Did you forget a Math.ceil()?"))}},{key:"getForwardJump",value:function(){var t=this.state.selected,e=this.props,n=e.pageCount,r=t+e.pageRangeDisplayed;return r>=n?n-1:r}},{key:"getBackwardJump",value:function(){var t=this.state.selected-this.props.pageRangeDisplayed;return t<0?0:t}},{key:"hrefBuilder",value:function(t){var e=this.props,n=e.hrefBuilder,r=e.pageCount;if(n&&t!==this.state.selected&&t>=0&&t<r)return n(t+1)}},{key:"ariaLabelBuilder",value:function(t){var e=t===this.state.selected;if(this.props.ariaLabelBuilder&&t>=0&&t<this.props.pageCount){var n=this.props.ariaLabelBuilder(t+1,e);return this.props.extraAriaContext&&!e&&(n=n+" "+this.props.extraAriaContext),n}}},{key:"getPageElement",value:function(t){var e=this.state.selected,n=this.props,r=n.pageClassName,i=n.pageLinkClassName,o=n.activeClassName,s=n.activeLinkClassName,l=n.extraAriaContext,u=n.pageLabelBuilder;return a.a.createElement(c,{key:t,pageSelectedHandler:this.handlePageSelected.bind(null,t),selected:e===t,pageClassName:r,pageLinkClassName:i,activeClassName:o,activeLinkClassName:s,extraAriaContext:l,href:this.hrefBuilder(t),ariaLabel:this.ariaLabelBuilder(t),page:t+1,pageLabelBuilder:u,getEventListener:this.getEventListener})}},{key:"render",value:function(){var t=this.props.renderOnZeroPageCount;if(0===this.props.pageCount&&void 0!==t)return t?t(this.props):t;var e=this.props,n=e.disabledClassName,r=e.pageCount,i=e.className,o=e.containerClassName,s=e.previousLabel,l=e.previousClassName,c=e.previousLinkClassName,u=e.previousAriaLabel,d=e.prevRel,h=e.nextLabel,p=e.nextClassName,g=e.nextLinkClassName,m=e.nextAriaLabel,b=e.nextRel,x=this.state.selected,_=l+(0===x?" ".concat(n):""),v=p+(x===r-1?" ".concat(n):""),y=0===x?"true":"false",w=x===r-1?"true":"false";return a.a.createElement("ul",{className:i||o},a.a.createElement("li",{className:_},a.a.createElement("a",f({className:c,href:this.hrefBuilder(x-1),tabIndex:"0",role:"button",onKeyPress:this.handlePreviousPage,"aria-disabled":y,"aria-label":u,rel:d},this.getEventListener(this.handlePreviousPage)),s)),this.pagination(),a.a.createElement("li",{className:v},a.a.createElement("a",f({className:g,href:this.hrefBuilder(x+1),tabIndex:"0",role:"button",onKeyPress:this.handleNextPage,"aria-disabled":w,"aria-label":m,rel:b},this.getEventListener(this.handleNextPage)),h)))}}])&&g(e.prototype,n),i}(r.Component);v(y,"propTypes",{pageCount:o.a.number.isRequired,pageRangeDisplayed:o.a.number.isRequired,marginPagesDisplayed:o.a.number.isRequired,previousLabel:o.a.node,previousAriaLabel:o.a.string,prevRel:o.a.string,nextLabel:o.a.node,nextAriaLabel:o.a.string,nextRel:o.a.string,breakLabel:o.a.oneOfType([o.a.string,o.a.node]),hrefBuilder:o.a.func,onPageChange:o.a.func,onPageActive:o.a.func,initialPage:o.a.number,forcePage:o.a.number,disableInitialCallback:o.a.bool,containerClassName:o.a.string,className:o.a.string,pageClassName:o.a.string,pageLinkClassName:o.a.string,pageLabelBuilder:o.a.func,activeClassName:o.a.string,activeLinkClassName:o.a.string,previousClassName:o.a.string,nextClassName:o.a.string,previousLinkClassName:o.a.string,nextLinkClassName:o.a.string,disabledClassName:o.a.string,breakClassName:o.a.string,breakLinkClassName:o.a.string,extraAriaContext:o.a.string,ariaLabelBuilder:o.a.func,eventListener:o.a.string,renderOnZeroPageCount:o.a.func}),v(y,"defaultProps",{pageCount:10,pageRangeDisplayed:2,marginPagesDisplayed:3,activeClassName:"selected",previousLabel:"Previous",previousClassName:"previous",previousAriaLabel:"Previous page",prevRel:"prev",nextLabel:"Next",nextClassName:"next",nextAriaLabel:"Next page",nextRel:"next",breakLabel:"...",disabledClassName:"disabled",disableInitialCallback:!1,pageLabelBuilder:function(t){return t},eventListener:"onClick",renderOnZeroPageCount:void 0}),e.default=y}]))},1609:t=>{"use strict";t.exports=window.React}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.amdD=function(){throw new Error("define cannot be used indirect")},n.amdO={},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";const t=window.wp.element,e=window.wp.i18n,r=window.wp.components,a=window.wp.url,i=window.wp.apiFetch;var o=n.n(i);const s=window.wp.primitives,l=(0,t.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(s.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})),c=window.moment;var u=n.n(c),d=n(8566);function h(t){let e=t.toString();return["=","+","-","@",String.fromCharCode(9),String.fromCharCode(13)].includes(e.charAt(0))?e="\"'"+e+'"':e.match(/[,"\s]/)&&(e='"'+e.replace(/"/g,'""')+'"'),e}function p(t){return Array.isArray(t)?t.map((t=>h(t.label))).join(","):[]}function f(t){return Array.isArray(t)?t.map((t=>t.map((t=>void 0===t.value||null===t.value?"":h(t.value))).join(","))).join("\n"):[]}function g(t,e){return[p(t),f(e)].filter((t=>t.length)).join("\n")}function m(t="",e={}){return[t.toLowerCase().replace(/[^a-z0-9]/g,"-"),u()().format("YYYY-MM-DD"),Object.keys(e).map((t=>t.toLowerCase().replace(/[^a-z0-9]/g,"-")+"-"+decodeURIComponent(e[t]).toLowerCase().replace(/[^a-z0-9]/g,"-"))).join("_")].filter((t=>t.length)).join("_")+".csv"}function b(t,e){const n=new Blob([e],{type:"text/csv;charset=utf-8"});(0,d.saveAs)(n,t)}const x=[{label:(0,e.__)("Title","learnpress-gradebook"),key:'"post_title"'},{label:(0,e.__)("Type","learnpress-gradebook"),key:'"item_type"'},{label:(0,e.__)("Start time","learnpress-gradebook"),key:'"start_time"'},{label:(0,e.__)("End time","learnpress-gradebook"),key:'"end_time"'},{label:(0,e.__)("Graduation","learnpress-gradebook"),key:'"graduation"'},{label:(0,e.__)("Status","learnpress-gradebook"),key:'"status"'}];function _({studentID:n,courseID:i}){const[s,c]=(0,t.useState)(!1);return(0,t.createElement)(r.Button,{className:"learnpress-gradebook__export__button",isSecondary:!0,variant:"secondary",onClick:async function(){c(!0);try{const t=await o()({path:(0,a.addQueryArgs)("lp-gradebook/export-items",{studentID:n,courseID:i}),method:"GET"});if(t?.data){const e=g(x,t.data);b(m("gradebook",{list:"items"}),e)}c(!1)}catch(t){c(!1)}},icon:s?(0,t.createElement)(r.Spinner,null):l,iconSize:20,text:(0,e.__)("Export CSV","learnpress-gradebook")})}const v=(0,t.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(s.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),y=(0,t.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(s.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));var w=n(1609),k=n.n(w);const S="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function E(t,e,n){const r=n||(t=>Array.prototype.slice.call(t));let a=!1,i=[];return function(...n){i=r(n),a||(a=!0,S.call(window,(()=>{a=!1,t.apply(e,i)})))}}const M=t=>"start"===t?"left":"end"===t?"right":"center",C=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2;function P(){}const D=function(){let t=0;return function(){return t++}}();function O(t){return null==t}function L(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function T(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const A=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function I(t,e){return A(t)?t:e}function R(t,e){return void 0===t?e:t}const z=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function N(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function j(t,e,n,r){let a,i,o;if(L(t))if(i=t.length,r)for(a=i-1;a>=0;a--)e.call(n,t[a],a);else for(a=0;a<i;a++)e.call(n,t[a],a);else if(T(t))for(o=Object.keys(t),i=o.length,a=0;a<i;a++)e.call(n,t[o[a]],o[a])}function F(t,e){let n,r,a,i;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(a=t[n],i=e[n],a.datasetIndex!==i.datasetIndex||a.index!==i.index)return!1;return!0}function B(t){if(L(t))return t.map(B);if(T(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let a=0;for(;a<r;++a)e[n[a]]=B(t[n[a]]);return e}return t}function V(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function W(t,e,n,r){if(!V(t))return;const a=e[t],i=n[t];T(a)&&T(i)?H(a,i,r):e[t]=B(i)}function H(t,e,n){const r=L(e)?e:[e],a=r.length;if(!T(t))return t;const i=(n=n||{}).merger||W;for(let o=0;o<a;++o){if(!T(e=r[o]))continue;const a=Object.keys(e);for(let r=0,o=a.length;r<o;++r)i(a[r],t,e,n)}return t}function $(t,e){return H(t,e,{merger:U})}function U(t,e,n){if(!V(t))return;const r=e[t],a=n[t];T(r)&&T(a)?$(r,a):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=B(a))}const q=".";function Y(t,e){const n=t.indexOf(q,e);return-1===n?t.length:n}function X(t,e){if(""===e)return t;let n=0,r=Y(e,n);for(;t&&r>n;)t=t[e.substr(n,r-n)],n=r+1,r=Y(e,n);return t}function G(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Q=t=>void 0!==t,K=t=>"function"==typeof t,Z=Math.PI,J=2*Z,tt=J+Z,et=Number.POSITIVE_INFINITY,nt=Z/180,rt=Z/2,at=Z/4,it=2*Z/3,ot=Math.log10,st=Math.sign;function lt(t){const e=Math.round(t);t=ut(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(ot(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function ct(t){return!isNaN(parseFloat(t))&&isFinite(t)}function ut(t,e,n){return Math.abs(t-e)<n}function dt(t,e,n){let r,a,i;for(r=0,a=t.length;r<a;r++)i=t[r][n],isNaN(i)||(e.min=Math.min(e.min,i),e.max=Math.max(e.max,i))}function ht(t){return t*(Z/180)}function pt(t){return t*(180/Z)}function ft(t){if(!A(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function gt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function mt(t,e){return(t-e+tt)%J-Z}function bt(t){return(t%J+J)%J}function xt(t,e,n,r){const a=bt(t),i=bt(e),o=bt(n),s=bt(i-a),l=bt(o-a),c=bt(a-i),u=bt(a-o);return a===i||a===o||r&&i===o||s>l&&c<u}function _t(t,e,n){return Math.max(e,Math.min(n,t))}const vt=t=>0===t||1===t,yt=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*J/n),wt=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*J/n)+1,kt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*rt),easeOutSine:t=>Math.sin(t*rt),easeInOutSine:t=>-.5*(Math.cos(Z*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>vt(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>vt(t)?t:yt(t,.075,.3),easeOutElastic:t=>vt(t)?t:wt(t,.075,.3),easeInOutElastic(t){const e=.1125;return vt(t)?t:t<.5?.5*yt(2*t,e,.45):.5+.5*wt(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-kt.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*kt.easeInBounce(2*t):.5*kt.easeOutBounce(2*t-1)+.5},St={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},Et="0123456789ABCDEF",Mt=t=>Et[15&t],Ct=t=>Et[(240&t)>>4]+Et[15&t],Pt=t=>(240&t)>>4==(15&t);function Dt(t){return t+.5|0}const Ot=(t,e,n)=>Math.max(Math.min(t,n),e);function Lt(t){return Ot(Dt(2.55*t),0,255)}function Tt(t){return Ot(Dt(255*t),0,255)}function At(t){return Ot(Dt(t/2.55)/100,0,1)}function It(t){return Ot(Dt(100*t),0,100)}const Rt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,zt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Nt(t,e,n){const r=e*Math.min(n,1-n),a=(e,a=(e+t/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function jt(t,e,n){const r=(r,a=(r+t/60)%6)=>n-n*e*Math.max(Math.min(a,4-a,1),0);return[r(5),r(3),r(1)]}function Ft(t,e,n){const r=Nt(t,1,.5);let a;for(e+n>1&&(a=1/(e+n),e*=a,n*=a),a=0;a<3;a++)r[a]*=1-e-n,r[a]+=e;return r}function Bt(t){const e=t.r/255,n=t.g/255,r=t.b/255,a=Math.max(e,n,r),i=Math.min(e,n,r),o=(a+i)/2;let s,l,c;return a!==i&&(c=a-i,l=o>.5?c/(2-a-i):c/(a+i),s=a===e?(n-r)/c+(n<r?6:0):a===n?(r-e)/c+2:(e-n)/c+4,s=60*s+.5),[0|s,l||0,o]}function Vt(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(Tt)}function Wt(t,e,n){return Vt(Nt,t,e,n)}function Ht(t){return(t%360+360)%360}const $t={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"},Ut={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"};let qt;function Yt(t,e,n){if(t){let r=Bt(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,0===e?360:1)),r=Wt(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function Xt(t,e){return t?Object.assign(e||{},t):t}function Gt(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Tt(t[3]))):(e=Xt(t,{r:0,g:0,b:0,a:1})).a=Tt(e.a),e}function Qt(t){return"r"===t.charAt(0)?function(t){const e=Rt.exec(t);let n,r,a,i=255;if(e){if(e[7]!==n){const t=+e[7];i=255&(e[8]?Lt(t):255*t)}return n=+e[1],r=+e[3],a=+e[5],n=255&(e[2]?Lt(n):n),r=255&(e[4]?Lt(r):r),a=255&(e[6]?Lt(a):a),{r:n,g:r,b:a,a:i}}}(t):function(t){const e=zt.exec(t);let n,r=255;if(!e)return;e[5]!==n&&(r=e[6]?Lt(+e[5]):Tt(+e[5]));const a=Ht(+e[2]),i=+e[3]/100,o=+e[4]/100;return n="hwb"===e[1]?function(t,e,n){return Vt(Ft,t,e,n)}(a,i,o):"hsv"===e[1]?function(t,e,n){return Vt(jt,t,e,n)}(a,i,o):Wt(a,i,o),{r:n[0],g:n[1],b:n[2],a:r}}(t)}class Kt{constructor(t){if(t instanceof Kt)return t;const e=typeof t;let n;var r,a,i;"object"===e?n=Gt(t):"string"===e&&(i=(r=t).length,"#"===r[0]&&(4===i||5===i?a={r:255&17*St[r[1]],g:255&17*St[r[2]],b:255&17*St[r[3]],a:5===i?17*St[r[4]]:255}:7!==i&&9!==i||(a={r:St[r[1]]<<4|St[r[2]],g:St[r[3]]<<4|St[r[4]],b:St[r[5]]<<4|St[r[6]],a:9===i?St[r[7]]<<4|St[r[8]]:255})),n=a||function(t){qt||(qt=function(){const t={},e=Object.keys(Ut),n=Object.keys($t);let r,a,i,o,s;for(r=0;r<e.length;r++){for(o=s=e[r],a=0;a<n.length;a++)i=n[a],s=s.replace(i,$t[i]);i=parseInt(Ut[o],16),t[s]=[i>>16&255,i>>8&255,255&i]}return t}(),qt.transparent=[0,0,0,0]);const e=qt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||Qt(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Xt(this._rgb);return t&&(t.a=At(t.a)),t}set rgb(t){this._rgb=Gt(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${At(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return Pt(t.r)&&Pt(t.g)&&Pt(t.b)&&Pt(t.a)}(t)?Mt:Ct,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=Bt(t),n=e[0],r=It(e[1]),a=It(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${a}%, ${At(t.a)})`:`hsl(${n}, ${r}%, ${a}%)`}(this._rgb):this._rgb}mix(t,e){const n=this;if(t){const r=n.rgb,a=t.rgb;let i;const o=e===i?.5:e,s=2*o-1,l=r.a-a.a,c=((s*l==-1?s:(s+l)/(1+s*l))+1)/2;i=1-c,r.r=255&c*r.r+i*a.r+.5,r.g=255&c*r.g+i*a.g+.5,r.b=255&c*r.b+i*a.b+.5,r.a=o*r.a+(1-o)*a.a,n.rgb=r}return n}clone(){return new Kt(this.rgb)}alpha(t){return this._rgb.a=Tt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=Dt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Yt(this._rgb,2,t),this}darken(t){return Yt(this._rgb,2,-t),this}saturate(t){return Yt(this._rgb,1,t),this}desaturate(t){return Yt(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=Bt(t);n[0]=Ht(n[0]+e),n=Wt(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}function Zt(t){return new Kt(t)}const Jt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function te(t){return Jt(t)?t:Zt(t)}function ee(t){return Jt(t)?t:Zt(t).saturate(.5).darken(.1).hexString()}const ne=Object.create(null),re=Object.create(null);function ae(t,e){if(!e)return t;const n=e.split(".");for(let e=0,r=n.length;e<r;++e){const r=n[e];t=t[r]||(t[r]=Object.create(null))}return t}function ie(t,e,n){return"string"==typeof e?H(ae(t,e),n):H(ae(t,""),e)}var oe=new class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>ee(e.backgroundColor),this.hoverBorderColor=(t,e)=>ee(e.borderColor),this.hoverColor=(t,e)=>ee(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},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.describe(t)}set(t,e){return ie(this,t,e)}get(t){return ae(this,t)}describe(t,e){return ie(re,t,e)}override(t,e){return ie(ne,t,e)}route(t,e,n,r){const a=ae(this,t),i=ae(this,n),o="_"+e;Object.defineProperties(a,{[o]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=i[r];return T(t)?Object.assign({},e,t):R(t,e)},set(t){this[o]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function se(t,e,n,r,a){let i=e[a];return i||(i=e[a]=t.measureText(a).width,n.push(a)),i>r&&(r=i),r}function le(t,e,n,r){let a=(r=r||{}).data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(a=r.data={},i=r.garbageCollect=[],r.font=e),t.save(),t.font=e;let o=0;const s=n.length;let l,c,u,d,h;for(l=0;l<s;l++)if(d=n[l],null!=d&&!0!==L(d))o=se(t,a,i,o,d);else if(L(d))for(c=0,u=d.length;c<u;c++)h=d[c],null==h||L(h)||(o=se(t,a,i,o,h));t.restore();const p=i.length/2;if(p>n.length){for(l=0;l<p;l++)delete a[i[l]];i.splice(0,p)}return o}function ce(t,e,n){const r=t.currentDevicePixelRatio,a=0!==n?Math.max(n/2,.5):0;return Math.round((e-a)*r)/r+a}function ue(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function de(t,e,n,r){let a,i,o,s,l;const c=e.pointStyle,u=e.rotation,d=e.radius;let h=(u||0)*nt;if(c&&"object"==typeof c&&(a=c.toString(),"[object HTMLImageElement]"===a||"[object HTMLCanvasElement]"===a))return t.save(),t.translate(n,r),t.rotate(h),t.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),c){default:t.arc(n,r,d,0,J),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(h)*d,r-Math.cos(h)*d),h+=it,t.lineTo(n+Math.sin(h)*d,r-Math.cos(h)*d),h+=it,t.lineTo(n+Math.sin(h)*d,r-Math.cos(h)*d),t.closePath();break;case"rectRounded":l=.516*d,s=d-l,i=Math.cos(h+at)*s,o=Math.sin(h+at)*s,t.arc(n-i,r-o,l,h-Z,h-rt),t.arc(n+o,r-i,l,h-rt,h),t.arc(n+i,r+o,l,h,h+rt),t.arc(n-o,r+i,l,h+rt,h+Z),t.closePath();break;case"rect":if(!u){s=Math.SQRT1_2*d,t.rect(n-s,r-s,2*s,2*s);break}h+=at;case"rectRot":i=Math.cos(h)*d,o=Math.sin(h)*d,t.moveTo(n-i,r-o),t.lineTo(n+o,r-i),t.lineTo(n+i,r+o),t.lineTo(n-o,r+i),t.closePath();break;case"crossRot":h+=at;case"cross":i=Math.cos(h)*d,o=Math.sin(h)*d,t.moveTo(n-i,r-o),t.lineTo(n+i,r+o),t.moveTo(n+o,r-i),t.lineTo(n-o,r+i);break;case"star":i=Math.cos(h)*d,o=Math.sin(h)*d,t.moveTo(n-i,r-o),t.lineTo(n+i,r+o),t.moveTo(n+o,r-i),t.lineTo(n-o,r+i),h+=at,i=Math.cos(h)*d,o=Math.sin(h)*d,t.moveTo(n-i,r-o),t.lineTo(n+i,r+o),t.moveTo(n+o,r-i),t.lineTo(n-o,r+i);break;case"line":i=Math.cos(h)*d,o=Math.sin(h)*d,t.moveTo(n-i,r-o),t.lineTo(n+i,r+o);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(h)*d,r+Math.sin(h)*d)}t.fill(),e.borderWidth>0&&t.stroke()}}function he(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function pe(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function fe(t){t.restore()}function ge(t,e,n,r,a){if(!e)return t.lineTo(n.x,n.y);if("middle"===a){const r=(e.x+n.x)/2;t.lineTo(r,e.y),t.lineTo(r,n.y)}else"after"===a!=!!r?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function me(t,e,n,r){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(r?e.cp1x:e.cp2x,r?e.cp1y:e.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function be(t,e,n,r,a,i={}){const o=L(e)?e:[e],s=i.strokeWidth>0&&""!==i.strokeColor;let l,c;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),O(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,i),l=0;l<o.length;++l)c=o[l],s&&(i.strokeColor&&(t.strokeStyle=i.strokeColor),O(i.strokeWidth)||(t.lineWidth=i.strokeWidth),t.strokeText(c,n,r,i.maxWidth)),t.fillText(c,n,r,i.maxWidth),xe(t,n,r,c,i),r+=a.lineHeight;t.restore()}function xe(t,e,n,r,a){if(a.strikethrough||a.underline){const i=t.measureText(r),o=e-i.actualBoundingBoxLeft,s=e+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=a.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(o,u),t.lineTo(s,u),t.stroke()}}function _e(t,e){const{x:n,y:r,w:a,h:i,radius:o}=e;t.arc(n+o.topLeft,r+o.topLeft,o.topLeft,-rt,Z,!0),t.lineTo(n,r+i-o.bottomLeft),t.arc(n+o.bottomLeft,r+i-o.bottomLeft,o.bottomLeft,Z,rt,!0),t.lineTo(n+a-o.bottomRight,r+i),t.arc(n+a-o.bottomRight,r+i-o.bottomRight,o.bottomRight,rt,0,!0),t.lineTo(n+a,r+o.topRight),t.arc(n+a-o.topRight,r+o.topRight,o.topRight,0,-rt,!0),t.lineTo(n+o.topLeft,r)}const ve=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),ye=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function we(t,e){const n=(""+t).match(ve);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}const ke=t=>+t||0;function Se(t,e){const n={},r=T(e),a=r?Object.keys(e):e,i=T(t)?r?n=>R(t[n],t[e[n]]):e=>t[e]:()=>t;for(const t of a)n[t]=ke(i(t));return n}function Ee(t){return Se(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Me(t){return Se(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ce(t){const e=Ee(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Pe(t,e){t=t||{},e=e||oe.font;let n=R(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let r=R(t.style,e.style);r&&!(""+r).match(ye)&&(console.warn('Invalid font style specified: "'+r+'"'),r="");const a={family:R(t.family,e.family),lineHeight:we(R(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:R(t.weight,e.weight),string:""};return a.string=function(t){return!t||O(t.size)||O(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(a),a}function De(t,e,n,r){let a,i,o,s=!0;for(a=0,i=t.length;a<i;++a)if(o=t[a],void 0!==o&&(void 0!==e&&"function"==typeof o&&(o=o(e),s=!1),void 0!==n&&L(o)&&(o=o[n%o.length],s=!1),void 0!==o))return r&&!s&&(r.cacheable=!1),o}function Oe(t,e,n){n=n||(n=>t[n]<e);let r,a=t.length-1,i=0;for(;a-i>1;)r=i+a>>1,n(r)?i=r:a=r;return{lo:i,hi:a}}const Le=(t,e,n)=>Oe(t,n,(r=>t[r][e]<n)),Te=(t,e,n)=>Oe(t,n,(r=>t[r][e]>=n)),Ae=["push","pop","shift","splice","unshift"];function Ie(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,a=r.indexOf(e);-1!==a&&r.splice(a,1),r.length>0||(Ae.forEach((e=>{delete t[e]})),delete t._chartjs)}function Re(t){const e=new Set;let n,r;for(n=0,r=t.length;n<r;++n)e.add(t[n]);return e.size===r?t:Array.from(e)}function ze(t,e=[""],n=t,r,a=(()=>t[0])){Q(r)||(r=Ye("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:r,_getTarget:a,override:a=>ze([a,...t],e,n,r)};return new Proxy(i,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,r)=>Ve(n,r,(()=>function(t,e,n,r){let a;for(const i of e)if(a=Ye(Fe(i,t),n),Q(a))return Be(t,a)?Ue(n,r,t,a):a}(r,e,t,n))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Xe(t).includes(e),ownKeys:t=>Xe(t),set:(t,e,n)=>((t._storage||(t._storage=a()))[e]=n,delete t[e],delete t._keys,!0)})}function Ne(t,e,n,r){const a={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:je(t,r),setContext:e=>Ne(t,e,n,r),override:a=>Ne(t.override(a),e,n,r)};return new Proxy(a,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>Ve(t,e,(()=>function(t,e,n){const{_proxy:r,_context:a,_subProxy:i,_descriptors:o}=t;let s=r[e];return K(s)&&o.isScriptable(e)&&(s=function(t,e,n,r){const{_proxy:a,_context:i,_subProxy:o,_stack:s}=n;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);return s.add(t),e=e(i,o||r),s.delete(t),T(e)&&(e=Ue(a._scopes,a,t,e)),e}(e,s,t,n)),L(s)&&s.length&&(s=function(t,e,n,r){const{_proxy:a,_context:i,_subProxy:o,_descriptors:s}=n;if(Q(i.index)&&r(t))e=e[i.index%e.length];else if(T(e[0])){const n=e,r=a._scopes.filter((t=>t!==n));e=[];for(const l of n){const n=Ue(r,a,t,l);e.push(Ne(n,i,o&&o[t],s))}}return e}(e,s,t,o.isIndexable)),Be(e,s)&&(s=Ne(s,a,i&&i[e],o)),s}(t,e,n))),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,r)=>(t[n]=r,delete e[n],!0)})}function je(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:a=e.allKeys}=t;return{allKeys:a,scriptable:n,indexable:r,isScriptable:K(n)?n:()=>n,isIndexable:K(r)?r:()=>r}}const Fe=(t,e)=>t?t+G(e):e,Be=(t,e)=>T(e)&&"adapters"!==t;function Ve(t,e,n){let r=t[e];return Q(r)||(r=n(),Q(r)&&(t[e]=r)),r}function We(t,e,n){return K(t)?t(e,n):t}const He=(t,e)=>!0===t?e:"string"==typeof t?X(e,t):void 0;function $e(t,e,n,r){for(const a of e){const e=He(n,a);if(e){t.add(e);const a=We(e._fallback,n,e);if(Q(a)&&a!==n&&a!==r)return a}else if(!1===e&&Q(r)&&n!==r)return null}return!1}function Ue(t,e,n,r){const a=e._rootScopes,i=We(e._fallback,n,r),o=[...t,...a],s=new Set;s.add(r);let l=qe(s,o,n,i||n);return null!==l&&(!Q(i)||i===n||(l=qe(s,o,i,l),null!==l))&&ze(Array.from(s),[""],a,i,(()=>function(t,e,n){const r=t._getTarget();e in r||(r[e]={});const a=r[e];return L(a)&&T(n)?n:a}(e,n,r)))}function qe(t,e,n,r){for(;n;)n=$e(t,e,n,r);return n}function Ye(t,e){for(const n of e){if(!n)continue;const e=n[t];if(Q(e))return e}}function Xe(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const Ge=Number.EPSILON||1e-14,Qe=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ke=t=>"x"===t?"y":"x";function Ze(t,e,n,r){const a=t.skip?e:t,i=e,o=n.skip?e:n,s=gt(i,a),l=gt(o,i);let c=s/(s+l),u=l/(s+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,h=r*u;return{previous:{x:i.x-d*(o.x-a.x),y:i.y-d*(o.y-a.y)},next:{x:i.x+h*(o.x-a.x),y:i.y+h*(o.y-a.y)}}}function Je(t,e,n){return Math.max(Math.min(t,n),e)}function tn(t,e,n,r,a){let i,o,s,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const n=Ke(e),r=t.length,a=Array(r).fill(0),i=Array(r);let o,s,l,c=Qe(t,0);for(o=0;o<r;++o)if(s=l,l=c,c=Qe(t,o+1),l){if(c){const t=c[e]-l[e];a[o]=0!==t?(c[n]-l[n])/t:0}i[o]=s?c?st(a[o-1])!==st(a[o])?0:(a[o-1]+a[o])/2:a[o-1]:a[o]}!function(t,e,n){const r=t.length;let a,i,o,s,l,c=Qe(t,0);for(let u=0;u<r-1;++u)l=c,c=Qe(t,u+1),l&&c&&(ut(e[u],0,Ge)?n[u]=n[u+1]=0:(a=n[u]/e[u],i=n[u+1]/e[u],s=Math.pow(a,2)+Math.pow(i,2),s<=9||(o=3/Math.sqrt(s),n[u]=a*o*e[u],n[u+1]=i*o*e[u])))}(t,a,i),function(t,e,n="x"){const r=Ke(n),a=t.length;let i,o,s,l=Qe(t,0);for(let c=0;c<a;++c){if(o=s,s=l,l=Qe(t,c+1),!s)continue;const a=s[n],u=s[r];o&&(i=(a-o[n])/3,s[`cp1${n}`]=a-i,s[`cp1${r}`]=u-i*e[c]),l&&(i=(l[n]-a)/3,s[`cp2${n}`]=a+i,s[`cp2${r}`]=u+i*e[c])}}(t,i,e)}(t,a);else{let n=r?t[t.length-1]:t[0];for(i=0,o=t.length;i<o;++i)s=t[i],l=Ze(n,s,t[Math.min(i+1,o-(r?0:1))%o],e.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,n=s}e.capBezierPoints&&function(t,e){let n,r,a,i,o,s=he(t[0],e);for(n=0,r=t.length;n<r;++n)o=i,i=s,s=n<r-1&&he(t[n+1],e),i&&(a=t[n],o&&(a.cp1x=Je(a.cp1x,e.left,e.right),a.cp1y=Je(a.cp1y,e.top,e.bottom)),s&&(a.cp2x=Je(a.cp2x,e.left,e.right),a.cp2y=Je(a.cp2y,e.top,e.bottom)))}(t,n)}function en(){return"undefined"!=typeof window&&"undefined"!=typeof document}function nn(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function rn(t,e,n){let r;return"string"==typeof t?(r=parseInt(t,10),-1!==t.indexOf("%")&&(r=r/100*e.parentNode[n])):r=t,r}const an=t=>window.getComputedStyle(t,null),on=["top","right","bottom","left"];function sn(t,e,n){const r={};n=n?"-"+n:"";for(let a=0;a<4;a++){const i=on[a];r[i]=parseFloat(t[e+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const ln=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function cn(t,e){const{canvas:n,currentDevicePixelRatio:r}=e,a=an(n),i="border-box"===a.boxSizing,o=sn(a,"padding"),s=sn(a,"border","width"),{x:l,y:c,box:u}=function(t,e){const n=t.native||t,r=n.touches,a=r&&r.length?r[0]:n,{offsetX:i,offsetY:o}=a;let s,l,c=!1;if(ln(i,o,n.target))s=i,l=o;else{const t=e.getBoundingClientRect();s=a.clientX-t.left,l=a.clientY-t.top,c=!0}return{x:s,y:l,box:c}}(t,n),d=o.left+(u&&s.left),h=o.top+(u&&s.top);let{width:p,height:f}=e;return i&&(p-=o.width+s.width,f-=o.height+s.height),{x:Math.round((l-d)/p*n.width/r),y:Math.round((c-h)/f*n.height/r)}}const un=t=>Math.round(10*t)/10;function dn(t,e,n){const r=e||1,a=Math.floor(t.height*r),i=Math.floor(t.width*r);t.height=a/r,t.width=i/r;const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==r||o.height!==a||o.width!==i)&&(t.currentDevicePixelRatio=r,o.height=a,o.width=i,t.ctx.setTransform(r,0,0,r,0,0),!0)}const hn=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function pn(t,e){const n=function(t,e){return an(t).getPropertyValue(e)}(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function fn(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function gn(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:"middle"===r?n<.5?t.y:e.y:"after"===r?n<1?t.y:e.y:n>0?e.y:t.y}}function mn(t,e,n,r){const a={x:t.cp2x,y:t.cp2y},i={x:e.cp1x,y:e.cp1y},o=fn(t,a,n),s=fn(a,i,n),l=fn(i,e,n),c=fn(o,s,n),u=fn(s,l,n);return fn(c,u,n)}const bn=new Map;function xn(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let r=bn.get(n);return r||(r=new Intl.NumberFormat(t,e),bn.set(n,r)),r}(e,n).format(t)}function vn(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function yn(t,e){let n,r;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function wn(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function kn(t){return"angle"===t?{between:xt,compare:mt,normalize:bt}:{between:(t,e,n)=>t>=Math.min(e,n)&&t<=Math.max(n,e),compare:(t,e)=>t-e,normalize:t=>t}}function Sn({start:t,end:e,count:n,loop:r,style:a}){return{start:t%n,end:e%n,loop:r&&(e-t+1)%n==0,style:a}}function En(t,e,n){if(!n)return[t];const{property:r,start:a,end:i}=n,o=e.length,{compare:s,between:l,normalize:c}=kn(r),{start:u,end:d,loop:h,style:p}=function(t,e,n){const{property:r,start:a,end:i}=n,{between:o,normalize:s}=kn(r),l=e.length;let c,u,{start:d,end:h,loop:p}=t;if(p){for(d+=l,h+=l,c=0,u=l;c<u&&o(s(e[d%l][r]),a,i);++c)d--,h--;d%=l,h%=l}return h<d&&(h+=l),{start:d,end:h,loop:p,style:t.style}}(t,e,n),f=[];let g,m,b,x=!1,_=null;for(let t=u,n=u;t<=d;++t)m=e[t%o],m.skip||(g=c(m[r]),g!==b&&(x=l(g,a,i),null===_&&(x||l(a,b,g)&&0!==s(a,b))&&(_=0===s(g,a)?t:n),null!==_&&(!x||0===s(i,g)||l(i,b,g))&&(f.push(Sn({start:_,end:t,loop:h,count:o,style:p})),_=null),n=t,b=g));return null!==_&&f.push(Sn({start:_,end:d,loop:h,count:o,style:p})),f}function Mn(t,e){const n=[],r=t.segments;for(let a=0;a<r.length;a++){const i=En(r[a],t.points,e);i.length&&n.push(...i)}return n}function Cn(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Pn(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var Dn=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,r){const a=e.listeners[r],i=e.duration;a.forEach((r=>r({chart:t,initial:e.initial,numSteps:i,currentStep:Math.min(n-e.start,i)})))}_refresh(){const t=this;t._request||(t._running=!0,t._request=S.call(window,(()=>{t._update(),t._request=null,t._running&&t._refresh()})))}_update(t=Date.now()){const e=this;let n=0;e._charts.forEach(((r,a)=>{if(!r.running||!r.items.length)return;const i=r.items;let o,s=i.length-1,l=!1;for(;s>=0;--s)o=i[s],o._active?(o._total>r.duration&&(r.duration=o._total),o.tick(t),l=!0):(i[s]=i[i.length-1],i.pop());l&&(a.draw(),e._notify(a,r,t,"progress")),i.length||(r.running=!1,e._notify(a,r,t,"complete"),r.initial=!1),n+=i.length})),e._lastDate=t,0===n&&(e._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let r=n.length-1;for(;r>=0;--r)n[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const On="transparent",Ln={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const r=te(t||On),a=r.valid&&te(e||On);return a&&a.valid?a.mix(r,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class Tn{constructor(t,e,n,r){const a=e[n];r=De([t.to,r,a,t.from]);const i=De([t.from,a,r]);this._active=!0,this._fn=t.fn||Ln[t.type||typeof i],this._easing=kt[t.easing]||kt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,n){const r=this;if(r._active){r._notify(!1);const a=r._target[r._prop],i=n-r._start,o=r._duration-i;r._start=n,r._duration=Math.floor(Math.max(o,t.duration)),r._total+=i,r._loop=!!t.loop,r._to=De([t.to,e,a,t.from]),r._from=De([t.from,a,e])}}cancel(){const t=this;t._active&&(t.tick(Date.now()),t._active=!1,t._notify(!1))}tick(t){const e=this,n=t-e._start,r=e._duration,a=e._prop,i=e._from,o=e._loop,s=e._to;let l;if(e._active=i!==s&&(o||n<r),!e._active)return e._target[a]=s,void e._notify(!0);n<0?e._target[a]=i:(l=n/r%2,l=o&&l>1?2-l:l,l=e._easing(Math.min(1,Math.max(0,l))),e._target[a]=e._fn(i,s,l))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,n)=>{t.push({res:e,rej:n})}))}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t<n.length;t++)n[t][e]()}}oe.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const An=Object.keys(oe.animation);oe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),oe.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),oe.describe("animations",{_fallback:"animation"}),oe.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class In{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!T(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const r=t[n];if(!T(r))return;const a={};for(const t of An)a[t]=r[t];(L(r.properties)&&r.properties||[n]).forEach((t=>{t!==n&&e.has(t)||e.set(t,a)}))}))}_animateOptions(t,e){const n=e.options,r=function(t,e){if(!e)return;let n=t.options;if(n)return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n;t.options=e}(t,n);if(!r)return[];const a=this._createAnimations(r,n);return n.$shared&&function(t,e){const n=[],r=Object.keys(e);for(let e=0;e<r.length;e++){const a=t[r[e]];a&&a.active()&&n.push(a.wait())}return Promise.all(n)}(t.options.$animations,n).then((()=>{t.options=n}),(()=>{})),a}_createAnimations(t,e){const n=this._properties,r=[],a=t.$animations||(t.$animations={}),i=Object.keys(e),o=Date.now();let s;for(s=i.length-1;s>=0;--s){const l=i[s];if("$"===l.charAt(0))continue;if("options"===l){r.push(...this._animateOptions(t,e));continue}const c=e[l];let u=a[l];const d=n.get(l);if(u){if(d&&u.active()){u.update(d,c,o);continue}u.cancel()}d&&d.duration?(a[l]=u=new Tn(d,t,l,c),r.push(u)):t[l]=c}return r}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(Dn.add(this._chart,n),!0):void 0}}function Rn(t,e){const n=t&&t.options||{},r=n.reverse,a=void 0===n.min?e:0,i=void 0===n.max?e:0;return{start:r?i:a,end:r?a:i}}function zn(t,e){const n=[],r=t._getSortedDatasetMetas(e);let a,i;for(a=0,i=r.length;a<i;++a)n.push(r[a].index);return n}function Nn(t,e,n,r){const a=t.keys,i="single"===r.mode;let o,s,l,c;if(null!==e){for(o=0,s=a.length;o<s;++o){if(l=+a[o],l===n){if(r.all)continue;break}c=t.values[l],A(c)&&(i||0===e||st(e)===st(c))&&(e+=c)}return e}}function jn(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function Fn(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function Bn(t,e,n){for(const r of e.getMatchingVisibleMetas("bar").reverse()){const e=t[r.index];if(n&&e>0||!n&&e<0)return r.index}return null}function Vn(t,e){const{chart:n,_cachedMeta:r}=t,a=n._stacks||(n._stacks={}),{iScale:i,vScale:o,index:s}=r,l=i.axis,c=o.axis,u=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(i,o,r),d=e.length;let h;for(let t=0;t<d;++t){const n=e[t],{[l]:r,[c]:i}=n;h=(n._stacks||(n._stacks={}))[c]=Fn(a,u,r),h[s]=i,h._top=Bn(h,o,!0),h._bottom=Bn(h,o,!1)}}function Wn(t,e){const n=t.scales;return Object.keys(n).filter((t=>n[t].axis===e)).shift()}function Hn(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[r]||void 0===e[r][n])return;delete e[r][n]}}}const $n=t=>"reset"===t||"none"===t,Un=(t,e)=>e?t:Object.assign({},t);class qn{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this,e=t._cachedMeta;t.configure(),t.linkScales(),e._stacked=jn(e.vScale,e),t.addElements()}updateIndex(t){this.index!==t&&Hn(this._cachedMeta),this.index=t}linkScales(){const t=this,e=t.chart,n=t._cachedMeta,r=t.getDataset(),a=(t,e,n,r)=>"x"===t?e:"r"===t?r:n,i=n.xAxisID=R(r.xAxisID,Wn(e,"x")),o=n.yAxisID=R(r.yAxisID,Wn(e,"y")),s=n.rAxisID=R(r.rAxisID,Wn(e,"r")),l=n.indexAxis,c=n.iAxisID=a(l,i,o,s),u=n.vAxisID=a(l,o,i,s);n.xScale=t.getScaleForId(i),n.yScale=t.getScaleForId(o),n.rScale=t.getScaleForId(s),n.iScale=t.getScaleForId(c),n.vScale=t.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ie(this._data,this),t._stacked&&Hn(t)}_dataCheck(){const t=this,e=t.getDataset(),n=e.data||(e.data=[]),r=t._data;if(T(n))t._data=function(t){const e=Object.keys(t),n=new Array(e.length);let r,a,i;for(r=0,a=e.length;r<a;++r)i=e[r],n[r]={x:i,y:t[i]};return n}(n);else if(r!==n){if(r){Ie(r,t);const e=t._cachedMeta;Hn(e),e._parsed=[]}n&&Object.isExtensible(n)&&(i=t,(a=n)._chartjs?a._chartjs.listeners.push(i):(Object.defineProperty(a,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[i]}}),Ae.forEach((t=>{const e="_onData"+G(t),n=a[t];Object.defineProperty(a,t,{configurable:!0,enumerable:!1,value(...t){const r=n.apply(this,t);return a._chartjs.listeners.forEach((n=>{"function"==typeof n[e]&&n[e](...t)})),r}})})))),t._syncList=[],t._data=n}var a,i}addElements(){const t=this,e=t._cachedMeta;t._dataCheck(),t.datasetElementType&&(e.dataset=new t.datasetElementType)}buildOrUpdateElements(t){const e=this,n=e._cachedMeta,r=e.getDataset();let a=!1;e._dataCheck();const i=n._stacked;n._stacked=jn(n.vScale,n),n.stack!==r.stack&&(a=!0,Hn(n),n.stack=r.stack),e._resyncElements(t),(a||i!==n._stacked)&&Vn(e,n._parsed)}configure(){const t=this,e=t.chart.config,n=e.datasetScopeKeys(t._type),r=e.getOptionScopes(t.getDataset(),n,!0);t.options=e.createResolver(r,t.getContext()),t._parsing=t.options.parsing}parse(t,e){const n=this,{_cachedMeta:r,_data:a}=n,{iScale:i,_stacked:o}=r,s=i.axis;let l,c,u,d=0===t&&e===a.length||r._sorted,h=t>0&&r._parsed[t-1];if(!1===n._parsing)r._parsed=a,r._sorted=!0,u=a;else{u=L(a[t])?n.parseArrayData(r,a,t,e):T(a[t])?n.parseObjectData(r,a,t,e):n.parsePrimitiveData(r,a,t,e);const i=()=>null===c[s]||h&&c[s]<h[s];for(l=0;l<e;++l)r._parsed[l+t]=c=u[l],d&&(i()&&(d=!1),h=c);r._sorted=d}o&&Vn(n,u)}parsePrimitiveData(t,e,n,r){const{iScale:a,vScale:i}=t,o=a.axis,s=i.axis,l=a.getLabels(),c=a===i,u=new Array(r);let d,h,p;for(d=0,h=r;d<h;++d)p=d+n,u[d]={[o]:c||a.parse(l[p],p),[s]:i.parse(e[p],p)};return u}parseArrayData(t,e,n,r){const{xScale:a,yScale:i}=t,o=new Array(r);let s,l,c,u;for(s=0,l=r;s<l;++s)c=s+n,u=e[c],o[s]={x:a.parse(u[0],c),y:i.parse(u[1],c)};return o}parseObjectData(t,e,n,r){const{xScale:a,yScale:i}=t,{xAxisKey:o="x",yAxisKey:s="y"}=this._parsing,l=new Array(r);let c,u,d,h;for(c=0,u=r;c<u;++c)d=c+n,h=e[d],l[c]={x:a.parse(X(h,o),d),y:i.parse(X(h,s),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const r=this.chart,a=this._cachedMeta,i=e[t.axis];return Nn({keys:zn(r,!0),values:e._stacks[t.axis]},i,a.index,{mode:n})}updateRangeFromParsed(t,e,n,r){const a=n[e.axis];let i=null===a?NaN:a;const o=r&&n._stacks[e.axis];r&&o&&(r.values=o,t.min=Math.min(t.min,i),t.max=Math.max(t.max,i),i=Nn(r,a,this._cachedMeta.index,{all:!0})),t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}getMinMax(t,e){const n=this,r=n._cachedMeta,a=r._parsed,i=r._sorted&&t===r.iScale,o=a.length,s=n._getOtherScale(t),l=e&&r._stacked&&{keys:zn(n.chart,!0),values:null},c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=function(t){const{min:e,max:n,minDefined:r,maxDefined:a}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:a?n:Number.POSITIVE_INFINITY}}(s);let h,p,f,g;function m(){return f=a[h],p=f[t.axis],g=f[s.axis],!A(p)||u>g||d<g}for(h=0;h<o&&(m()||(n.updateRangeFromParsed(c,t,f,l),!i));++h);if(i)for(h=o-1;h>=0;--h)if(!m()){n.updateRangeFromParsed(c,t,f,l);break}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let r,a,i;for(r=0,a=e.length;r<a;++r)i=e[r][t.axis],A(i)&&n.push(i);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,r=e.vScale,a=this.getParsed(t);return{label:n?""+n.getLabelForValue(a[n.axis]):"",value:r?""+r.getLabelForValue(a[r.axis]):""}}_update(t){const e=this,n=e._cachedMeta;e.configure(),e._cachedDataOpts={},e.update(t||"default"),n._clip=function(t){let e,n,r,a;return T(t)?(e=t.top,n=t.right,r=t.bottom,a=t.left):e=n=r=a=t,{top:e,right:n,bottom:r,left:a,disabled:!1===t}}(R(e.options.clip,function(t,e,n){if(!1===n)return!1;const r=Rn(t,n),a=Rn(e,n);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}(n.xScale,n.yScale,e.getMaxOverflow())))}update(t){}draw(){const t=this,e=t._ctx,n=t.chart,r=t._cachedMeta,a=r.data||[],i=n.chartArea,o=[],s=t._drawStart||0,l=t._drawCount||a.length-s;let c;for(r.dataset&&r.dataset.draw(e,i,s,l),c=s;c<s+l;++c){const t=a[c];t.hidden||(t.active?o.push(t):t.draw(e,i))}for(c=0;c<o.length;++c)o[c].draw(e,i)}getStyle(t,e){const n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const r=this,a=r.getDataset();let i;if(t>=0&&t<r._cachedMeta.data.length){const e=r._cachedMeta.data[t];i=e.$context||(e.$context=function(t,e,n){return Object.assign(Object.create(t),{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(r.getContext(),t,e)),i.parsed=r.getParsed(t),i.raw=a.data[t],i.index=i.dataIndex=t}else i=r.$context||(r.$context=function(t,e){return Object.assign(Object.create(t),{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(r.chart.getContext(),r.index)),i.dataset=a,i.index=i.datasetIndex=r.index;return i.active=!!e,i.mode=n,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const r=this,a="active"===e,i=r._cachedDataOpts,o=t+"-"+e,s=i[o],l=r.enableOptionSharing&&Q(n);if(s)return Un(s,l);const c=r.chart.config,u=c.datasetElementScopeKeys(r._type,t),d=a?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(r.getDataset(),u),p=Object.keys(oe.elements[t]),f=c.resolveNamedOptions(h,p,(()=>r.getContext(n,a)),d);return f.$shared&&(f.$shared=l,i[o]=Object.freeze(Un(f,l))),f}_resolveAnimations(t,e,n){const r=this,a=r.chart,i=r._cachedDataOpts,o=`animation-${e}`,s=i[o];if(s)return s;let l;if(!1!==a.options.animation){const a=r.chart.config,i=a.datasetAnimationScopeKeys(r._type,e),o=a.getOptionScopes(r.getDataset(),i);l=a.createResolver(o,r.getContext(t,n,e))}const c=new In(a,l&&l.animations);return l&&l._cacheable&&(i[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||$n(t)||this.chart._animationsDisabled}updateElement(t,e,n,r){$n(r)?Object.assign(t,n):this._resolveAnimations(e,r).update(t,n)}updateSharedOptions(t,e,n){t&&!$n(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,r){t.active=r;const a=this.getStyle(e,r);this._resolveAnimations(e,n,r).update(t,{options:!r&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this,n=e._data,r=e._cachedMeta.data;for(const[t,n,r]of e._syncList)e[t](n,r);e._syncList=[];const a=r.length,i=n.length,o=Math.min(i,a);o&&e.parse(0,o),i>a?e._insertElements(a,i-a,t):i<a&&e._removeElements(i,a-i)}_insertElements(t,e,n=!0){const r=this,a=r._cachedMeta,i=a.data,o=t+e;let s;const l=t=>{for(t.length+=e,s=t.length-1;s>=o;s--)t[s]=t[s-e]};for(l(i),s=t;s<o;++s)i[s]=new r.dataElementType;r._parsing&&l(a._parsed),r.parse(t,e),n&&r.updateElements(i,t,e,"reset")}updateElements(t,e,n,r){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const r=n._parsed.splice(t,e);n._stacked&&Hn(n,r)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,r]=t;this[e](n,r)}}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){this._sync(["_removeElements",t,e]),this._sync(["_insertElements",t,arguments.length-2])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Yn(t){const e=function(t){if(!t._cache.$bar){const e=t.getMatchingVisibleMetas("bar");let n=[];for(let r=0,a=e.length;r<a;r++)n=n.concat(e[r].controller.getAllParsedValues(t));t._cache.$bar=Re(n.sort(((t,e)=>t-e)))}return t._cache.$bar}(t);let n,r,a,i,o=t._length;const s=()=>{32767!==a&&-32768!==a&&(Q(i)&&(o=Math.min(o,Math.abs(a-i)||o)),i=a)};for(n=0,r=e.length;n<r;++n)a=t.getPixelForValue(e[n]),s();for(i=void 0,n=0,r=t.ticks.length;n<r;++n)a=t.getPixelForTick(n),s();return o}function Xn(t,e,n,r){return L(t)?function(t,e,n,r){const a=n.parse(t[0],r),i=n.parse(t[1],r),o=Math.min(a,i),s=Math.max(a,i);let l=o,c=s;Math.abs(o)>Math.abs(s)&&(l=s,c=o),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:a,end:i,min:o,max:s}}(t,e,n,r):e[n.axis]=n.parse(t,r),e}function Gn(t,e,n,r){const a=t.iScale,i=t.vScale,o=a.getLabels(),s=a===i,l=[];let c,u,d,h;for(c=n,u=n+r;c<u;++c)h=e[c],d={},d[a.axis]=s||a.parse(o[c],c),l.push(Xn(h,d,i,c));return l}function Qn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Kn(t,e,n,r){let a=e.borderSkipped;const i={};if(!a)return void(t.borderSkipped=i);const{start:o,end:s,reverse:l,top:c,bottom:u}=function(t){let e,n,r,a,i;return t.horizontal?(e=t.base>t.x,n="left",r="right"):(e=t.base<t.y,n="bottom",r="top"),e?(a="end",i="start"):(a="start",i="end"),{start:n,end:r,reverse:e,top:a,bottom:i}}(t);"middle"===a&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?a=c:(n._bottom||0)===r?a=u:(i[Zn(u,o,s,l)]=!0,a=c)),i[Zn(a,o,s,l)]=!0,t.borderSkipped=i}function Zn(t,e,n,r){var a,i,o;return r?(o=n,t=Jn(t=(a=t)===(i=e)?o:a===o?i:a,n,e)):t=Jn(t,e,n),t}function Jn(t,e,n){return"start"===t?e:"end"===t?n:t}qn.defaults={},qn.prototype.datasetElementType=null,qn.prototype.dataElementType=null;class tr extends qn{parsePrimitiveData(t,e,n,r){return Gn(t,e,n,r)}parseArrayData(t,e,n,r){return Gn(t,e,n,r)}parseObjectData(t,e,n,r){const{iScale:a,vScale:i}=t,{xAxisKey:o="x",yAxisKey:s="y"}=this._parsing,l="x"===a.axis?o:s,c="x"===i.axis?o:s,u=[];let d,h,p,f;for(d=n,h=n+r;d<h;++d)f=e[d],p={},p[a.axis]=a.parse(X(f,l),d),u.push(Xn(X(f,c),p,i,d));return u}updateRangeFromParsed(t,e,n,r){super.updateRangeFromParsed(t,e,n,r);const a=n._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:r}=e,a=this.getParsed(t),i=a._custom,o=Qn(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(a[r.axis]);return{label:""+n.getLabelForValue(a[n.axis]),value:o}}initialize(){const t=this;t.enableOptionSharing=!0,super.initialize(),t._cachedMeta.stack=t.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,r){const a=this,i="reset"===r,{index:o,_cachedMeta:{vScale:s}}=a,l=s.getBasePixel(),c=s.isHorizontal(),u=a._getRuler(),d=a.resolveDataElementOptions(e,r),h=a.getSharedOptions(d),p=a.includeOptions(r,h);a.updateSharedOptions(h,r,d);for(let d=e;d<e+n;d++){const e=a.getParsed(d),n=i||O(e[s.axis])?{base:l,head:l}:a._calculateBarValuePixels(d),f=a._calculateBarIndexPixels(d,u),g=(e._stacks||{})[s.axis],m={horizontal:c,base:n.base,enableBorderRadius:!g||Qn(e._custom)||o===g._top||o===g._bottom,x:c?n.head:f.center,y:c?f.center:n.head,height:c?f.size:Math.abs(n.size),width:c?Math.abs(n.size):f.size};p&&(m.options=h||a.resolveDataElementOptions(d,t[d].active?"active":r)),Kn(m,m.options||t[d].options,g,o),a.updateElement(t[d],d,m,r)}}_getStacks(t,e){const n=this._cachedMeta.iScale,r=n.getMatchingVisibleMetas(this._type),a=n.options.stacked,i=r.length,o=[];let s,l;for(s=0;s<i;++s)if(l=r[s],l.controller.options.grouped){if(void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(O(t)||isNaN(t))continue}if((!1===a||-1===o.indexOf(l.stack)||void 0===a&&void 0===l.stack)&&o.push(l.stack),l.index===t)break}return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const r=this._getStacks(t,n),a=void 0!==e?r.indexOf(e):-1;return-1===a?r.length-1:a}_getRuler(){const t=this,e=t.options,n=t._cachedMeta,r=n.iScale,a=[];let i,o;for(i=0,o=n.data.length;i<o;++i)a.push(r.getPixelForValue(t.getParsed(i)[r.axis],i));const s=e.barThickness;return{min:s||Yn(r),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:t._getStackCount(),scale:r,grouped:e.grouped,ratio:s?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(t){const e=this,{_cachedMeta:{vScale:n,_stacked:r},options:{base:a,minBarLength:i}}=e,o=a||0,s=e.getParsed(t),l=s._custom,c=Qn(l);let u,d,h=s[n.axis],p=0,f=r?e.applyStack(n,s,r):h;f!==h&&(p=f-h,f=h),c&&(h=l.barStart,f=l.barEnd-l.barStart,0!==h&&st(h)!==st(l.barEnd)&&(p=0),p+=h);const g=O(a)||c?p:a;let m=n.getPixelForValue(g);if(u=e.chart.getDataVisibility(t)?n.getPixelForValue(p+f):m,d=u-m,Math.abs(d)<i&&(d=function(t,e,n){return 0!==t?st(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}(d,n,o)*i,h===o&&(m-=d/2),u=m+d),m===n.getPixelForValue(o)){const t=st(d)*n.getLineWidthForValue(o)/2;m+=t,d-=t}return{size:d,base:m,head:u,center:u+d/2}}_calculateBarIndexPixels(t,e){const n=this,r=e.scale,a=n.options,i=a.skipNull,o=R(a.maxBarThickness,1/0);let s,l;if(e.grouped){const r=i?n._getStackCount(t):e.stackCount,c="flex"===a.barThickness?function(t,e,n,r){const a=e.pixels,i=a[t];let o=t>0?a[t-1]:null,s=t<a.length-1?a[t+1]:null;const l=n.categoryPercentage;null===o&&(o=i-(null===s?e.end-e.start:s-i)),null===s&&(s=i+i-o);const c=i-(i-Math.min(o,s))/2*l;return{chunk:Math.abs(s-o)/2*l/r,ratio:n.barPercentage,start:c}}(t,e,a,r):function(t,e,n,r){const a=n.barThickness;let i,o;return O(a)?(i=e.min*n.categoryPercentage,o=n.barPercentage):(i=a*r,o=1),{chunk:i/r,ratio:o,start:e.pixels[t]-i/2}}(t,e,a,r),u=n._getStackIndex(n.index,n._cachedMeta.stack,i?t:void 0);s=c.start+c.chunk*u+c.chunk/2,l=Math.min(o,c.chunk*c.ratio)}else s=r.getPixelForValue(n.getParsed(t)[r.axis],t),l=Math.min(o,e.min*e.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this,e=t._cachedMeta,n=e.vScale,r=e.data,a=r.length;let i=0;for(;i<a;++i)null!==t.getParsed(i)[n.axis]&&r[i].draw(t._ctx)}}tr.id="bar",tr.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},tr.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class er extends qn{initialize(){this.enableOptionSharing=!0,super.initialize()}parseObjectData(t,e,n,r){const{xScale:a,yScale:i}=t,{xAxisKey:o="x",yAxisKey:s="y"}=this._parsing,l=[];let c,u,d;for(c=n,u=n+r;c<u;++c)d=e[c],l.push({x:a.parse(X(d,o),c),y:i.parse(X(d,s),c),_custom:d&&d.r&&+d.r});return l}getMaxOverflow(){const{data:t,_parsed:e}=this._cachedMeta;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size()/2,e[r]._custom);return n>0&&n}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:r}=e,a=this.getParsed(t),i=n.getLabelForValue(a.x),o=r.getLabelForValue(a.y),s=a._custom;return{label:e.label,value:"("+i+", "+o+(s?", "+s:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,r){const a=this,i="reset"===r,{iScale:o,vScale:s}=a._cachedMeta,l=a.resolveDataElementOptions(e,r),c=a.getSharedOptions(l),u=a.includeOptions(r,c),d=o.axis,h=s.axis;for(let l=e;l<e+n;l++){const e=t[l],n=!i&&a.getParsed(l),c={},p=c[d]=i?o.getPixelForDecimal(.5):o.getPixelForValue(n[d]),f=c[h]=i?s.getBasePixel():s.getPixelForValue(n[h]);c.skip=isNaN(p)||isNaN(f),u&&(c.options=a.resolveDataElementOptions(l,e.active?"active":r),i&&(c.options.radius=0)),a.updateElement(e,l,c,r)}a.updateSharedOptions(c,r,l)}resolveDataElementOptions(t,e){const n=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const a=r.radius;return"active"!==e&&(r.radius=0),r.radius+=R(n&&n._custom,a),r}}er.id="bubble",er.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},er.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class nr extends qn{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,r=this._cachedMeta;let a,i;for(a=t,i=t+e;a<i;++a)r._parsed[a]=+n[a]}_getRotation(){return ht(this.options.rotation-90)}_getCircumference(){return ht(this.options.circumference)}_getRotationExtents(){let t=J,e=-J;const n=this;for(let r=0;r<n.chart.data.datasets.length;++r)if(n.chart.isDatasetVisible(r)){const a=n.chart.getDatasetMeta(r).controller,i=a._getRotation(),o=a._getCircumference();t=Math.min(t,i),e=Math.max(e,i+o)}return{rotation:t,circumference:e-t}}update(t){const e=this,n=e.chart,{chartArea:r}=n,a=e._cachedMeta,i=a.data,o=e.getMaxBorderWidth()+e.getMaxOffset(i)+e.options.spacing,s=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min((u=s,"string"==typeof(c=e.options.cutout)&&c.endsWith("%")?parseFloat(c)/100:c/u),1);var c,u;const d=e._getRingWeight(e.index),{circumference:h,rotation:p}=e._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:m,offsetY:b}=function(t,e,n){let r=1,a=1,i=0,o=0;if(e<J){const s=t,l=s+e,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),h=Math.sin(l),p=(t,e,r)=>xt(t,s,l,!0)?1:Math.max(e,e*n,r,r*n),f=(t,e,r)=>xt(t,s,l,!0)?-1:Math.min(e,e*n,r,r*n),g=p(0,c,d),m=p(rt,u,h),b=f(Z,c,d),x=f(Z+rt,u,h);r=(g-b)/2,a=(m-x)/2,i=-(g+b)/2,o=-(m+x)/2}return{ratioX:r,ratioY:a,offsetX:i,offsetY:o}}(p,h,l),x=(r.width-o)/f,_=(r.height-o)/g,v=Math.max(Math.min(x,_)/2,0),y=z(e.options.radius,v),w=(y-Math.max(y*l,0))/e._getVisibleDatasetWeightTotal();e.offsetX=m*y,e.offsetY=b*y,a.total=e.calculateTotal(),e.outerRadius=y-w*e._getRingWeightOffset(e.index),e.innerRadius=Math.max(e.outerRadius-w*d,0),e.updateElements(i,0,i.length,t)}_circumference(t,e){const n=this,r=n.options,a=n._cachedMeta,i=n._getCircumference();return e&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||null===a._parsed[t]||a.data[t].hidden?0:n.calculateCircumference(a._parsed[t]*i/J)}updateElements(t,e,n,r){const a=this,i="reset"===r,o=a.chart,s=o.chartArea,l=o.options.animation,c=(s.left+s.right)/2,u=(s.top+s.bottom)/2,d=i&&l.animateScale,h=d?0:a.innerRadius,p=d?0:a.outerRadius,f=a.resolveDataElementOptions(e,r),g=a.getSharedOptions(f),m=a.includeOptions(r,g);let b,x=a._getRotation();for(b=0;b<e;++b)x+=a._circumference(b,i);for(b=e;b<e+n;++b){const e=a._circumference(b,i),n=t[b],o={x:c+a.offsetX,y:u+a.offsetY,startAngle:x,endAngle:x+e,circumference:e,outerRadius:p,innerRadius:h};m&&(o.options=g||a.resolveDataElementOptions(b,n.active?"active":r)),x+=e,a.updateElement(n,b,o,r)}a.updateSharedOptions(g,r,f)}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,r=0;for(n=0;n<e.length;n++){const a=t._parsed[n];null===a||isNaN(a)||!this.chart.getDataVisibility(n)||e[n].hidden||(r+=Math.abs(a))}return r}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?J*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,r=n.data.labels||[],a=xn(e._parsed[t],n.options.locale);return{label:r[t]||"",value:a}}getMaxBorderWidth(t){const e=this;let n=0;const r=e.chart;let a,i,o,s,l;if(!t)for(a=0,i=r.data.datasets.length;a<i;++a)if(r.isDatasetVisible(a)){o=r.getDatasetMeta(a),t=o.data,s=o.controller,s!==e&&s.configure();break}if(!t)return 0;for(a=0,i=t.length;a<i;++a)l=s.resolveDataElementOptions(a),"inner"!==l.borderAlign&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let e=0;for(let n=0,r=t.length;n<r;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(R(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}nr.id="doughnut",nr.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"},nr.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},nr.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,r)=>{const a=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const n=": "+t.formattedValue;return L(e)?(e=e.slice(),e[0]+=n):e+=n,e}}}}};class rr extends qn{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this,n=e._cachedMeta,{dataset:r,data:a=[],_dataset:i}=n,o=e.chart._animationsDisabled;let{start:s,count:l}=function(t,e,n){const r=e.length;let a=0,i=r;if(t._sorted){const{iScale:o,_parsed:s}=t,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(a=_t(Math.min(Le(s,o.axis,c).lo,n?r:Le(e,l,o.getPixelForValue(c)).lo),0,r-1)),i=h?_t(Math.max(Le(s,o.axis,u).hi+1,n?0:Le(e,l,o.getPixelForValue(u)).hi+1),a,r)-a:r-a}return{start:a,count:i}}(n,a,o);e._drawStart=s,e._drawCount=l,function(t){const{xScale:e,yScale:n,_scaleRanges:r}=t,a={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!r)return t._scaleRanges=a,!0;const i=r.xmin!==e.min||r.xmax!==e.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,a),i}(n)&&(s=0,l=a.length),r._datasetIndex=e.index,r._decimated=!!i._decimated,r.points=a;const c=e.resolveDatasetElementOptions(t);e.options.showLine||(c.borderWidth=0),c.segment=e.options.segment,e.updateElement(r,void 0,{animated:!o,options:c},t),e.updateElements(a,s,l,t)}updateElements(t,e,n,r){const a=this,i="reset"===r,{iScale:o,vScale:s,_stacked:l}=a._cachedMeta,c=a.resolveDataElementOptions(e,r),u=a.getSharedOptions(c),d=a.includeOptions(r,u),h=o.axis,p=s.axis,f=a.options.spanGaps,g=ct(f)?f:Number.POSITIVE_INFINITY,m=a.chart._animationsDisabled||i||"none"===r;let b=e>0&&a.getParsed(e-1);for(let c=e;c<e+n;++c){const e=t[c],n=a.getParsed(c),f=m?e:{},x=O(n[p]),_=f[h]=o.getPixelForValue(n[h],c),v=f[p]=i||x?s.getBasePixel():s.getPixelForValue(l?a.applyStack(s,n,l):n[p],c);f.skip=isNaN(_)||isNaN(v)||x,f.stop=c>0&&n[h]-b[h]>g,f.parsed=n,d&&(f.options=u||a.resolveDataElementOptions(c,e.active?"active":r)),m||a.updateElement(e,c,f,r),b=n}a.updateSharedOptions(u,r,c)}getMaxOverflow(){const t=this,e=t._cachedMeta,n=e.dataset,r=n.options&&n.options.borderWidth||0,a=e.data||[];if(!a.length)return r;const i=a[0].size(t.resolveDataElementOptions(0)),o=a[a.length-1].size(t.resolveDataElementOptions(a.length-1));return Math.max(r,i,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}rr.id="line",rr.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},rr.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class ar extends qn{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,r=n.data.labels||[],a=xn(e._parsed[t].r,n.options.locale);return{label:r[t]||"",value:a}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this,e=t.chart,n=e.chartArea,r=e.options,a=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(a/2,0),o=(i-Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0))/e.getVisibleDatasetCount();t.outerRadius=i-o*t.index,t.innerRadius=t.outerRadius-o}updateElements(t,e,n,r){const a=this,i="reset"===r,o=a.chart,s=a.getDataset(),l=o.options.animation,c=a._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Z;let p,f=h;const g=360/a.countVisibleElements();for(p=0;p<e;++p)f+=a._computeAngle(p,r,g);for(p=e;p<e+n;p++){const e=t[p];let n=f,m=f+a._computeAngle(p,r,g),b=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(s.data[p]):0;f=m,i&&(l.animateScale&&(b=0),l.animateRotate&&(n=m=h));const x={x:u,y:d,innerRadius:0,outerRadius:b,startAngle:n,endAngle:m,options:a.resolveDataElementOptions(p,e.active?"active":r)};a.updateElement(e,p,x,r)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let n=0;return e.data.forEach(((e,r)=>{!isNaN(t.data[r])&&this.chart.getDataVisibility(r)&&n++})),n}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?ht(this.resolveDataElementOptions(t,e).angle||n):0}}ar.id="polarArea",ar.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},ar.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,r)=>{const a=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class ir extends nr{}ir.id="pie",ir.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class or extends qn{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}update(t){const e=this,n=e._cachedMeta,r=n.dataset,a=n.data||[],i=n.iScale.getLabels();if(r.points=a,"resize"!==t){const n=e.resolveDatasetElementOptions(t);e.options.showLine||(n.borderWidth=0);const o={_loop:!0,_fullLoop:i.length===a.length,options:n};e.updateElement(r,void 0,o,t)}e.updateElements(a,0,a.length,t)}updateElements(t,e,n,r){const a=this,i=a.getDataset(),o=a._cachedMeta.rScale,s="reset"===r;for(let l=e;l<e+n;l++){const e=t[l],n=a.resolveDataElementOptions(l,e.active?"active":r),c=o.getPointPositionForValue(l,i.data[l]),u=s?o.xCenter:c.x,d=s?o.yCenter:c.y,h={x:u,y:d,angle:c.angle,skip:isNaN(u)||isNaN(d),options:n};a.updateElement(e,l,h,r)}}}or.id="radar",or.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},or.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class sr extends rr{}sr.id="scatter",sr.defaults={showLine:!1,fill:!1},sr.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var lr=Object.freeze({__proto__:null,BarController:tr,BubbleController:er,DoughnutController:nr,LineController:rr,PolarAreaController:ar,PieController:ir,RadarController:or,ScatterController:sr});function cr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ur{constructor(t){this.options=t||{}}formats(){return cr()}parse(t,e){return cr()}format(t,e){return cr()}add(t,e,n){return cr()}diff(t,e,n){return cr()}startOf(t,e,n){return cr()}endOf(t,e){return cr()}}ur.override=function(t){Object.assign(ur.prototype,t)};var dr={_date:ur};function hr(t,e){return"native"in t?{x:t.x,y:t.y}:cn(t,e)}function pr(t,e,n,r){const{controller:a,data:i,_sorted:o}=t,s=a._cachedMeta.iScale;if(s&&e===s.axis&&o&&i.length){const t=s._reversePixels?Te:Le;if(!r)return t(i,e,n);if(a._sharedOptions){const r=i[0],a="function"==typeof r.getRange&&r.getRange(e);if(a){const r=t(i,e,n-a),o=t(i,e,n+a);return{lo:r.lo,hi:o.hi}}}}return{lo:0,hi:i.length-1}}function fr(t,e,n,r,a){const i=t.getSortedVisibleDatasetMetas(),o=n[e];for(let t=0,n=i.length;t<n;++t){const{index:n,data:s}=i[t],{lo:l,hi:c}=pr(i[t],e,o,a);for(let t=l;t<=c;++t){const e=s[t];e.skip||r(e,n,t)}}}function gr(t,e,n,r){const a=[];return he(e,t.chartArea,t._minPadding)?(fr(t,n,e,(function(t,n,i){t.inRange(e.x,e.y,r)&&a.push({element:t,datasetIndex:n,index:i})}),!0),a):a}function mr(t,e,n,r,a){const i=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,r){const a=e?Math.abs(t.x-r.x):0,i=n?Math.abs(t.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(i,2))}}(n);let o=Number.POSITIVE_INFINITY,s=[];return he(e,t.chartArea,t._minPadding)?(fr(t,n,e,(function(n,l,c){if(r&&!n.inRange(e.x,e.y,a))return;const u=n.getCenterPoint(a);if(!he(u,t.chartArea,t._minPadding)&&!n.inRange(e.x,e.y,a))return;const d=i(e,u);d<o?(s=[{element:n,datasetIndex:l,index:c}],o=d):d===o&&s.push({element:n,datasetIndex:l,index:c})})),s):s}function br(t,e,n,r){const a=hr(e,t),i=[],o=n.axis,s="x"===o?"inXRange":"inYRange";let l=!1;return function(t,e){const n=t.getSortedVisibleDatasetMetas();let r,a,i;for(let t=0,o=n.length;t<o;++t){({index:r,data:a}=n[t]);for(let t=0,n=a.length;t<n;++t)i=a[t],i.skip||e(i,r,t)}}(t,((t,e,n)=>{t[s](a[o],r)&&i.push({element:t,datasetIndex:e,index:n}),t.inRange(a.x,a.y,r)&&(l=!0)})),n.intersect&&!l?[]:i}var xr={modes:{index(t,e,n,r){const a=hr(e,t),i=n.axis||"x",o=n.intersect?gr(t,a,i,r):mr(t,a,i,!1,r),s=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=o[0].index,n=t.data[e];n&&!n.skip&&s.push({element:n,datasetIndex:t.index,index:e})})),s):[]},dataset(t,e,n,r){const a=hr(e,t),i=n.axis||"xy";let o=n.intersect?gr(t,a,i,r):mr(t,a,i,!1,r);if(o.length>0){const e=o[0].datasetIndex,n=t.getDatasetMeta(e).data;o=[];for(let t=0;t<n.length;++t)o.push({element:n[t],datasetIndex:e,index:t})}return o},point:(t,e,n,r)=>gr(t,hr(e,t),n.axis||"xy",r),nearest:(t,e,n,r)=>mr(t,hr(e,t),n.axis||"xy",n.intersect,r),x:(t,e,n,r)=>(n.axis="x",br(t,e,n,r)),y:(t,e,n,r)=>(n.axis="y",br(t,e,n,r))}};const _r=["left","top","right","bottom"];function vr(t,e){return t.filter((t=>t.pos===e))}function yr(t,e){return t.filter((t=>-1===_r.indexOf(t.pos)&&t.box.axis===e))}function wr(t,e){return t.sort(((t,n)=>{const r=e?n:t,a=e?t:n;return r.weight===a.weight?r.index-a.index:r.weight-a.weight}))}function kr(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function Sr(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Er(t,e,n,r){const{pos:a,box:i}=n,o=t.maxPadding;if(!T(a)){n.size&&(t[a]-=n.size);const e=r[n.stack]||{size:0,count:1};e.size=Math.max(e.size,n.horizontal?i.height:i.width),n.size=e.size/e.count,t[a]+=n.size}i.getPadding&&Sr(o,i.getPadding());const s=Math.max(0,e.outerWidth-kr(o,t,"left","right")),l=Math.max(0,e.outerHeight-kr(o,t,"top","bottom")),c=s!==t.w,u=l!==t.h;return t.w=s,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Mr(t,e){const n=e.maxPadding;return function(t){const r={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{r[t]=Math.max(e[t],n[t])})),r}(t?["left","right"]:["top","bottom"])}function Cr(t,e,n,r){const a=[];let i,o,s,l,c,u;for(i=0,o=t.length,c=0;i<o;++i){s=t[i],l=s.box,l.update(s.width||e.w,s.height||e.h,Mr(s.horizontal,e));const{same:o,other:d}=Er(e,n,s,r);c|=o&&a.length,u=u||d,l.fullSize||a.push(s)}return c&&Cr(a,e,n,r)||u}function Pr(t,e,n,r,a){t.top=n,t.left=e,t.right=e+r,t.bottom=n+a,t.width=r,t.height=a}function Dr(t,e,n,r){const a=n.padding;let{x:i,y:o}=e;for(const s of t){const t=s.box,l=r[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const r=e.w*c,i=l.size||t.height;Q(l.start)&&(o=l.start),t.fullSize?Pr(t,a.left,o,n.outerWidth-a.right-a.left,i):Pr(t,e.left+l.placed,o,r,i),l.start=o,l.placed+=r,o=t.bottom}else{const r=e.h*c,o=l.size||t.width;Q(l.start)&&(i=l.start),t.fullSize?Pr(t,i,a.top,o,n.outerHeight-a.bottom-a.top):Pr(t,i,e.top+l.placed,o,r),l.start=i,l.placed+=r,i=t.right}}e.x=i,e.y=o}oe.set("layout",{padding:{top:0,right:0,bottom:0,left:0}});var Or={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,r){if(!t)return;const a=Ce(t.options.layout.padding),i=Math.max(e-a.width,0),o=Math.max(n-a.height,0),s=function(t){const e=function(t){const e=[];let n,r,a,i,o,s;for(n=0,r=(t||[]).length;n<r;++n)a=t[n],({position:i,options:{stack:o,stackWeight:s=1}}=a),e.push({index:n,box:a,pos:i,horizontal:a.isHorizontal(),weight:a.weight,stack:o&&i+o,stackWeight:s});return e}(t),n=wr(e.filter((t=>t.box.fullSize)),!0),r=wr(vr(e,"left"),!0),a=wr(vr(e,"right")),i=wr(vr(e,"top"),!0),o=wr(vr(e,"bottom")),s=yr(e,"x"),l=yr(e,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:a.concat(l).concat(o).concat(s),chartArea:vr(e,"chartArea"),vertical:r.concat(a).concat(l),horizontal:i.concat(o).concat(s)}}(t.boxes),l=s.vertical,c=s.horizontal;j(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const u=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:a,availableWidth:i,availableHeight:o,vBoxMaxWidth:i/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},a);Sr(h,Ce(r));const p=Object.assign({maxPadding:h,w:i,h:o,x:a.left,y:a.top},a),f=function(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:r,stackWeight:a}=n;if(!t||!_r.includes(r))continue;const i=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=a}return e}(t),{vBoxMaxWidth:r,hBoxMaxHeight:a}=e;let i,o,s;for(i=0,o=t.length;i<o;++i){s=t[i];const{fullSize:o}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*r:o&&e.availableWidth,s.height=a):(s.width=r,s.height=c?c*a:o&&e.availableHeight)}return n}(l.concat(c),d);Cr(s.fullSize,p,d,f),Cr(l,p,d,f),Cr(c,p,d,f)&&Cr(l,p,d,f),function(t){const e=t.maxPadding;function n(n){const r=Math.max(e[n]-t[n],0);return t[n]+=r,r}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(p),Dr(s.leftAndTop,p,d,f),p.x+=p.w,p.y+=p.h,Dr(s.rightAndBottom,p,d,f),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},j(s.chartArea,(e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(p.w,p.h)}))}};class Lr{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,r){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):n)}}isAttached(t){return!0}}class Tr extends Lr{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}}const Ar="$chartjs",Ir={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Rr=t=>null===t||""===t,zr=!!hn&&{passive:!0};function Nr(t,e,n){t.canvas.removeEventListener(e,n,zr)}function jr(t,e,n){const r=t.canvas,a=r&&nn(r)||r,i=new MutationObserver((t=>{const e=nn(a);t.forEach((t=>{for(let r=0;r<t.addedNodes.length;r++){const i=t.addedNodes[r];i!==a&&i!==e||n(t.target)}}))}));return i.observe(document,{childList:!0,subtree:!0}),i}function Fr(t,e,n){const r=t.canvas,a=r&&nn(r);if(!a)return;const i=new MutationObserver((t=>{t.forEach((t=>{for(let e=0;e<t.removedNodes.length;e++)if(t.removedNodes[e]===r){n();break}}))}));return i.observe(a,{childList:!0}),i}const Br=new Map;let Vr=0;function Wr(){const t=window.devicePixelRatio;t!==Vr&&(Vr=t,Br.forEach(((e,n)=>{n.currentDevicePixelRatio!==t&&e()})))}function Hr(t,e,n){const r=t.canvas,a=r&&nn(r);if(!a)return;const i=E(((t,e)=>{const r=a.clientWidth;n(t,e),r<a.clientWidth&&n()}),window),o=new ResizeObserver((t=>{const e=t[0],n=e.contentRect.width,r=e.contentRect.height;0===n&&0===r||i(n,r)}));return o.observe(a),function(t,e){Br.size||window.addEventListener("resize",Wr),Br.set(t,e)}(t,i),o}function $r(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){Br.delete(t),Br.size||window.removeEventListener("resize",Wr)}(t)}function Ur(t,e,n){const r=t.canvas,a=E((e=>{null!==t.ctx&&n(function(t,e){const n=Ir[t.type]||t.type,{x:r,y:a}=cn(t,e);return{type:n,chart:e,native:t,x:void 0!==r?r:null,y:void 0!==a?a:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,n){t.addEventListener(e,n,zr)}(r,e,a),a}class qr extends Lr{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[Ar]={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",Rr(a)){const e=pn(t,"width");void 0!==e&&(t.width=e)}if(Rr(r))if(""===t.style.height)t.height=t.width/(e||2);else{const e=pn(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Ar])return!1;const n=e[Ar].initial;["height","width"].forEach((t=>{const r=n[t];O(r)?e.removeAttribute(t):e.setAttribute(t,r)}));const r=n.style||{};return Object.keys(r).forEach((t=>{e.style[t]=r[t]})),e.width=e.width,delete e[Ar],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:jr,detach:Fr,resize:Hr}[e]||Ur;r[e]=a(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),r=n[e];r&&(({attach:$r,detach:$r,resize:$r}[e]||Nr)(t,e,r),n[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,r){return function(t,e,n,r){const a=an(t),i=sn(a,"margin"),o=rn(a.maxWidth,t,"clientWidth")||et,s=rn(a.maxHeight,t,"clientHeight")||et,l=function(t,e,n){let r,a;if(void 0===e||void 0===n){const i=nn(t);if(i){const t=i.getBoundingClientRect(),o=an(i),s=sn(o,"border","width"),l=sn(o,"padding");e=t.width-l.width-s.width,n=t.height-l.height-s.height,r=rn(o.maxWidth,i,"clientWidth"),a=rn(o.maxHeight,i,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:r||et,maxHeight:a||et}}(t,e,n);let{width:c,height:u}=l;if("content-box"===a.boxSizing){const t=sn(a,"border","width"),e=sn(a,"padding");c-=e.width+t.width,u-=e.height+t.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?Math.floor(c/r):u-i.height),c=un(Math.min(c,o,l.maxWidth)),u=un(Math.min(u,s,l.maxHeight)),c&&!u&&(u=un(c/2)),{width:c,height:u}}(t,e,n,r)}isAttached(t){const e=nn(t);return!(!e||!e.isConnected)}}class Yr{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return ct(this.x)&&ct(this.y)}getProps(t,e){const n=this,r=this.$animations;if(!e||!r)return n;const a={};return t.forEach((t=>{a[t]=r[t]&&r[t].active()?r[t]._to:n[t]})),a}}Yr.defaults={},Yr.defaultRoutes=void 0;const Xr={values:t=>L(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const r=this.chart.options.locale;let a,i=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(a="scientific"),i=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}(t,n)}const o=ot(Math.abs(i)),s=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:a,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),xn(t,r,l)},logarithmic(t,e,n){if(0===t)return"0";const r=t/Math.pow(10,Math.floor(ot(t)));return 1===r||2===r||5===r?Xr.numeric.call(this,t,e,n):""}};var Gr={formatters:Xr};function Qr(t,e,n,r,a){const i=R(r,0),o=Math.min(R(a,t.length),t.length);let s,l,c,u=0;for(n=Math.ceil(n),a&&(s=a-r,n=s/Math.floor(s/n)),c=i;c<0;)u++,c=Math.round(i+u*n);for(l=Math.max(i,0);l<o;l++)l===c&&(e.push(t[l]),u++,c=Math.round(i+u*n))}oe.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Gr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),oe.route("scale.ticks","color","","color"),oe.route("scale.grid","color","","borderColor"),oe.route("scale.grid","borderColor","","borderColor"),oe.route("scale.title","color","","color"),oe.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),oe.describe("scales",{_fallback:"scale"}),oe.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Kr=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n;function Zr(t,e){const n=[],r=t.length/e,a=t.length;let i=0;for(;i<a;i+=r)n.push(t[Math.floor(i)]);return n}function Jr(t,e,n){const r=t.ticks.length,a=Math.min(e,r-1),i=t._startPixel,o=t._endPixel,s=1e-6;let l,c=t.getPixelForTick(a);if(!(n&&(l=1===r?Math.max(c-i,o-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(a-1))/2,c+=a<e?l:-l,c<i-s||c>o+s)))return c}function ta(t){return t.drawTicks?t.tickLength:0}function ea(t,e){if(!t.display)return 0;const n=Pe(t.font,e),r=Ce(t.padding);return(L(t.text)?t.text.length:1)*n.lineHeight+r.height}function na(t,e,n){let r=M(t);return(n&&"right"!==e||!n&&"right"===e)&&(r=(t=>"left"===t?"right":"right"===t?"left":t)(r)),r}class ra extends Yr{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){const e=this;e.options=t.setContext(e.getContext()),e.axis=t.axis,e._userMin=e.parse(t.min),e._userMax=e.parse(t.max),e._suggestedMin=e.parse(t.suggestedMin),e._suggestedMax=e.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:r}=this;return t=I(t,Number.POSITIVE_INFINITY),e=I(e,Number.NEGATIVE_INFINITY),n=I(n,Number.POSITIVE_INFINITY),r=I(r,Number.NEGATIVE_INFINITY),{min:I(t,n),max:I(e,r),minDefined:A(t),maxDefined:A(e)}}getMinMax(t){const e=this;let n,{min:r,max:a,minDefined:i,maxDefined:o}=e.getUserBounds();if(i&&o)return{min:r,max:a};const s=e.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)n=s[l].controller.getMinMax(e,t),i||(r=Math.min(r,n.min)),o||(a=Math.max(a,n.max));return{min:I(r,I(a,r)),max:I(a,I(r,a))}}getPadding(){const t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){N(this.options.beforeUpdate,[this])}update(t,e,n){const r=this,a=r.options.ticks,i=a.sampleSize;r.beforeUpdate(),r.maxWidth=t,r.maxHeight=e,r._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),r.ticks=null,r._labelSizes=null,r._gridLineItems=null,r._labelItems=null,r.beforeSetDimensions(),r.setDimensions(),r.afterSetDimensions(),r._maxLength=r.isHorizontal()?r.width+n.left+n.right:r.height+n.top+n.bottom,r._dataLimitsCached||(r.beforeDataLimits(),r.determineDataLimits(),r.afterDataLimits(),r._range=function(t,e){const{min:n,max:r}=t;return{min:n-Math.abs(z(e,n)),max:r+z(e,r)}}(r,r.options.grace),r._dataLimitsCached=!0),r.beforeBuildTicks(),r.ticks=r.buildTicks()||[],r.afterBuildTicks();const o=i<r.ticks.length;r._convertTicksToLabels(o?Zr(r.ticks,i):r.ticks),r.configure(),r.beforeCalculateLabelRotation(),r.calculateLabelRotation(),r.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(r.ticks=function(t,e){const n=t.options.ticks,r=n.maxTicksLimit||function(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),a=t._maxLength/n;return Math.floor(Math.min(r,a))}(t),a=n.major.enabled?function(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}(e):[],i=a.length,o=a[0],s=a[i-1],l=[];if(i>r)return function(t,e,n,r){let a,i=0,o=n[0];for(r=Math.ceil(r),a=0;a<t.length;a++)a===o&&(e.push(t[a]),i++,o=n[i*r])}(e,l,a,i/r),l;const c=function(t,e,n){const r=function(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}(t),a=e.length/n;if(!r)return Math.max(a,1);const i=function(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r==0&&(e.push(r),e.push(t/r));return n===(0|n)&&e.push(n),e.sort(((t,e)=>t-e)).pop(),e}(r);for(let t=0,e=i.length-1;t<e;t++){const e=i[t];if(e>a)return e}return Math.max(a,1)}(a,e,r);if(i>0){let t,n;const r=i>1?Math.round((s-o)/(i-1)):null;for(Qr(e,l,c,O(r)?0:o-r,o),t=0,n=i-1;t<n;t++)Qr(e,l,c,a[t],a[t+1]);return Qr(e,l,c,s,O(r)?e.length:s+r),l}return Qr(e,l,c),l}(r,r.ticks),r._labelSizes=null),o&&r._convertTicksToLabels(r.ticks),r.beforeFit(),r.fit(),r.afterFit(),r.afterUpdate()}configure(){const t=this;let e,n,r=t.options.reverse;t.isHorizontal()?(e=t.left,n=t.right):(e=t.top,n=t.bottom,r=!r),t._startPixel=e,t._endPixel=n,t._reversePixels=r,t._length=n-e,t._alignToPixels=t.options.alignToPixels}afterUpdate(){N(this.options.afterUpdate,[this])}beforeSetDimensions(){N(this.options.beforeSetDimensions,[this])}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0}afterSetDimensions(){N(this.options.afterSetDimensions,[this])}_callHooks(t){const e=this;e.chart.notifyPlugins(t,e.getContext()),N(e.options[t],[e])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){N(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this,n=e.options.ticks;let r,a,i;for(r=0,a=t.length;r<a;r++)i=t[r],i.label=N(n.callback,[i.value,r,t],e)}afterTickToLabelConversion(){N(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){N(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this,e=t.options,n=e.ticks,r=t.ticks.length,a=n.minRotation||0,i=n.maxRotation;let o,s,l,c=a;if(!t._isVisible()||!n.display||a>=i||r<=1||!t.isHorizontal())return void(t.labelRotation=a);const u=t._getLabelSizes(),d=u.widest.width,h=u.highest.height,p=_t(t.chart.width-d,0,t.maxWidth);o=e.offset?t.maxWidth/r:p/(r-1),d+6>o&&(o=p/(r-(e.offset?.5:1)),s=t.maxHeight-ta(e.grid)-n.padding-ea(e.title,t.chart.options.font),l=Math.sqrt(d*d+h*h),c=pt(Math.min(Math.asin(_t((u.highest.height+6)/o,-1,1)),Math.asin(_t(s/l,-1,1))-Math.asin(_t(h/l,-1,1)))),c=Math.max(a,Math.min(i,c))),t.labelRotation=c}afterCalculateLabelRotation(){N(this.options.afterCalculateLabelRotation,[this])}beforeFit(){N(this.options.beforeFit,[this])}fit(){const t=this,e={width:0,height:0},{chart:n,options:{ticks:r,title:a,grid:i}}=t,o=t._isVisible(),s=t.isHorizontal();if(o){const o=ea(a,n.options.font);if(s?(e.width=t.maxWidth,e.height=ta(i)+o):(e.height=t.maxHeight,e.width=ta(i)+o),r.display&&t.ticks.length){const{first:n,last:a,widest:i,highest:o}=t._getLabelSizes(),l=2*r.padding,c=ht(t.labelRotation),u=Math.cos(c),d=Math.sin(c);if(s){const n=r.mirror?0:d*i.width+u*o.height;e.height=Math.min(t.maxHeight,e.height+n+l)}else{const n=r.mirror?0:u*i.width+d*o.height;e.width=Math.min(t.maxWidth,e.width+n+l)}t._calculatePadding(n,a,d,u)}}t._handleMargins(),s?(t.width=t._length=n.width-t._margins.left-t._margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t._margins.top-t._margins.bottom)}_calculatePadding(t,e,n,r){const a=this,{ticks:{align:i,padding:o},position:s}=a.options,l=0!==a.labelRotation,c="top"!==s&&"x"===a.axis;if(a.isHorizontal()){const s=a.getPixelForTick(0)-a.left,u=a.right-a.getPixelForTick(a.ticks.length-1);let d=0,h=0;l?c?(d=r*t.width,h=n*e.height):(d=n*t.height,h=r*e.width):"start"===i?h=e.width:"end"===i?d=t.width:(d=t.width/2,h=e.width/2),a.paddingLeft=Math.max((d-s+o)*a.width/(a.width-s),0),a.paddingRight=Math.max((h-u+o)*a.width/(a.width-u),0)}else{let n=e.height/2,r=t.height/2;"start"===i?(n=0,r=t.height):"end"===i&&(n=e.height,r=0),a.paddingTop=n+o,a.paddingBottom=r+o}}_handleMargins(){const t=this;t._margins&&(t._margins.left=Math.max(t.paddingLeft,t._margins.left),t._margins.top=Math.max(t.paddingTop,t._margins.top),t._margins.right=Math.max(t.paddingRight,t._margins.right),t._margins.bottom=Math.max(t.paddingBottom,t._margins.bottom))}afterFit(){N(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){const e=this;let n,r;for(e.beforeTickToLabelConversion(),e.generateTickLabels(t),n=0,r=t.length;n<r;n++)O(t[n].label)&&(t.splice(n,1),r--,n--);e.afterTickToLabelConversion()}_getLabelSizes(){const t=this;let e=t._labelSizes;if(!e){const n=t.options.ticks.sampleSize;let r=t.ticks;n<r.length&&(r=Zr(r,n)),t._labelSizes=e=t._computeLabelSizes(r,r.length)}return e}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:r}=this,a=[],i=[];let o,s,l,c,u,d,h,p,f,g,m,b=0,x=0;for(o=0;o<e;++o){if(c=t[o].label,u=this._resolveTickFontOptions(o),n.font=d=u.string,h=r[d]=r[d]||{data:{},gc:[]},p=u.lineHeight,f=g=0,O(c)||L(c)){if(L(c))for(s=0,l=c.length;s<l;++s)m=c[s],O(m)||L(m)||(f=se(n,h.data,h.gc,f,m),g+=p)}else f=se(n,h.data,h.gc,f,c),g=p;a.push(f),i.push(g),b=Math.max(f,b),x=Math.max(g,x)}!function(t,e){j(t,(t=>{const n=t.gc,r=n.length/2;let a;if(r>e){for(a=0;a<r;++a)delete t.data[n[a]];n.splice(0,r)}}))}(r,e);const _=a.indexOf(b),v=i.indexOf(x),y=t=>({width:a[t]||0,height:i[t]||0});return{first:y(0),last:y(e-1),widest:y(_),highest:y(v),widths:a,heights:i}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){const e=this;e._reversePixels&&(t=1-t);const n=e._startPixel+t*e._length;return _t(e._alignToPixels?ce(e.chart,n,0):n,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this,n=e.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=function(t,e,n){return Object.assign(Object.create(t),{tick:n,index:e,type:"tick"})}(e.getContext(),t,r))}return e.$context||(e.$context=(r=e.chart.getContext(),a=e,Object.assign(Object.create(r),{scale:a,type:"scale"})));var r,a}_tickSize(){const t=this,e=t.options.ticks,n=ht(t.labelRotation),r=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),i=t._getLabelSizes(),o=e.autoSkipPadding||0,s=i?i.widest.width+o:0,l=i?i.highest.height+o:0;return t.isHorizontal()?l*r>s*a?s/r:l/a:l*a<s*r?l/r:s/a}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this,n=e.axis,r=e.chart,a=e.options,{grid:i,position:o}=a,s=i.offset,l=e.isHorizontal(),c=e.ticks.length+(s?1:0),u=ta(i),d=[],h=i.setContext(e.getContext()),p=h.drawBorder?h.borderWidth:0,f=p/2,g=function(t){return ce(r,t,p)};let m,b,x,_,v,y,w,k,S,E,M,C;if("top"===o)m=g(e.bottom),y=e.bottom-u,k=m-f,E=g(t.top)+f,C=t.bottom;else if("bottom"===o)m=g(e.top),E=t.top,C=g(t.bottom)-f,y=m+f,k=e.top+u;else if("left"===o)m=g(e.right),v=e.right-u,w=m-f,S=g(t.left)+f,M=t.right;else if("right"===o)m=g(e.left),S=t.left,M=g(t.right)-f,v=m+f,w=e.left+u;else if("x"===n){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(T(o)){const t=Object.keys(o)[0],n=o[t];m=g(e.chart.scales[t].getPixelForValue(n))}E=t.top,C=t.bottom,y=m+f,k=y+u}else if("y"===n){if("center"===o)m=g((t.left+t.right)/2);else if(T(o)){const t=Object.keys(o)[0],n=o[t];m=g(e.chart.scales[t].getPixelForValue(n))}v=m-f,w=v-u,S=t.left,M=t.right}const P=R(a.ticks.maxTicksLimit,c),D=Math.max(1,Math.ceil(c/P));for(b=0;b<c;b+=D){const t=i.setContext(e.getContext(b)),n=t.lineWidth,a=t.color,o=i.borderDash||[],c=t.borderDashOffset,u=t.tickWidth,h=t.tickColor,p=t.tickBorderDash||[],f=t.tickBorderDashOffset;x=Jr(e,b,s),void 0!==x&&(_=ce(r,x,n),l?v=w=S=M=_:y=k=E=C=_,d.push({tx1:v,ty1:y,tx2:w,ty2:k,x1:S,y1:E,x2:M,y2:C,width:n,color:a,borderDash:o,borderDashOffset:c,tickWidth:u,tickColor:h,tickBorderDash:p,tickBorderDashOffset:f}))}return e._ticksLength=c,e._borderValue=m,d}_computeLabelItems(t){const e=this,n=e.axis,r=e.options,{position:a,ticks:i}=r,o=e.isHorizontal(),s=e.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=i,h=ta(r.grid),p=h+u,f=d?-u:p,g=-ht(e.labelRotation),m=[];let b,x,_,v,y,w,k,S,E,M,C,P,D="middle";if("top"===a)w=e.bottom-f,k=e._getXAxisLabelAlignment();else if("bottom"===a)w=e.top+f,k=e._getXAxisLabelAlignment();else if("left"===a){const t=e._getYAxisLabelAlignment(h);k=t.textAlign,y=t.x}else if("right"===a){const t=e._getYAxisLabelAlignment(h);k=t.textAlign,y=t.x}else if("x"===n){if("center"===a)w=(t.top+t.bottom)/2+p;else if(T(a)){const t=Object.keys(a)[0],n=a[t];w=e.chart.scales[t].getPixelForValue(n)+p}k=e._getXAxisLabelAlignment()}else if("y"===n){if("center"===a)y=(t.left+t.right)/2-p;else if(T(a)){const t=Object.keys(a)[0],n=a[t];y=e.chart.scales[t].getPixelForValue(n)}k=e._getYAxisLabelAlignment(h).textAlign}"y"===n&&("start"===l?D="top":"end"===l&&(D="bottom"));const O=e._getLabelSizes();for(b=0,x=s.length;b<x;++b){_=s[b],v=_.label;const t=i.setContext(e.getContext(b));S=e.getPixelForTick(b)+i.labelOffset,E=e._resolveTickFontOptions(b),M=E.lineHeight,C=L(v)?v.length:1;const n=C/2,r=t.color,l=t.textStrokeColor,u=t.textStrokeWidth;let h;if(o?(y=S,P="top"===a?"near"===c||0!==g?-C*M+M/2:"center"===c?-O.highest.height/2-n*M+M:-O.highest.height+M/2:"near"===c||0!==g?M/2:"center"===c?O.highest.height/2-n*M:O.highest.height-C*M,d&&(P*=-1)):(w=S,P=(1-C)*M/2),t.showLabelBackdrop){const e=Ce(t.backdropPadding),n=O.heights[b],r=O.widths[b];let a=w+P-e.top,i=y-e.left;switch(D){case"middle":a-=n/2;break;case"bottom":a-=n}switch(k){case"center":i-=r/2;break;case"right":i-=r}h={left:i,top:a,width:r+e.width,height:n+e.height,color:t.backdropColor}}m.push({rotation:g,label:v,font:E,color:r,strokeColor:l,strokeWidth:u,textOffset:P,textAlign:k,textBaseline:D,translation:[y,w],backdrop:h})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ht(this.labelRotation))return"top"===t?"left":"right";let n="center";return"start"===e.align?n="left":"end"===e.align&&(n="right"),n}_getYAxisLabelAlignment(t){const e=this,{position:n,ticks:{crossAlign:r,mirror:a,padding:i}}=e.options,o=t+i,s=e._getLabelSizes().widest.width;let l,c;return"left"===n?a?(c=e.right+i,"near"===r?l="left":"center"===r?(l="center",c+=s/2):(l="right",c+=s)):(c=e.right-o,"near"===r?l="right":"center"===r?(l="center",c-=s/2):(l="left",c=e.left)):"right"===n?a?(c=e.left+i,"near"===r?l="right":"center"===r?(l="center",c-=s/2):(l="left",c-=s)):(c=e.left+o,"near"===r?l="left":"center"===r?(l="center",c+=s/2):(l="right",c=e.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){const t=this;if(t.options.ticks.mirror)return;const e=t.chart,n=t.options.position;return"left"===n||"right"===n?{top:0,left:t.left,bottom:e.height,right:t.right}:"top"===n||"bottom"===n?{top:t.top,left:0,bottom:t.bottom,right:e.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:r,width:a,height:i}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,r,a,i),t.restore())}getLineWidthForValue(t){const e=this,n=e.options.grid;if(!e._isVisible()||!n.display)return 0;const r=e.ticks.findIndex((e=>e.value===t));return r>=0?n.setContext(e.getContext(r)).lineWidth:0}drawGrid(t){const e=this,n=e.options.grid,r=e.ctx,a=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));let i,o;const s=(t,e,n)=>{n.width&&n.color&&(r.save(),r.lineWidth=n.width,r.strokeStyle=n.color,r.setLineDash(n.borderDash||[]),r.lineDashOffset=n.borderDashOffset,r.beginPath(),r.moveTo(t.x,t.y),r.lineTo(e.x,e.y),r.stroke(),r.restore())};if(n.display)for(i=0,o=a.length;i<o;++i){const t=a[i];n.drawOnChartArea&&s({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),n.drawTicks&&s({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const t=this,{chart:e,ctx:n,options:{grid:r}}=t,a=r.setContext(t.getContext()),i=r.drawBorder?a.borderWidth:0;if(!i)return;const o=r.setContext(t.getContext(0)).lineWidth,s=t._borderValue;let l,c,u,d;t.isHorizontal()?(l=ce(e,t.left,i)-i/2,c=ce(e,t.right,o)+o/2,u=d=s):(u=ce(e,t.top,i)-i/2,d=ce(e,t.bottom,o)+o/2,l=c=s),n.save(),n.lineWidth=a.borderWidth,n.strokeStyle=a.borderColor,n.beginPath(),n.moveTo(l,u),n.lineTo(c,d),n.stroke(),n.restore()}drawLabels(t){const e=this;if(!e.options.ticks.display)return;const n=e.ctx,r=e._computeLabelArea();r&&pe(n,r);const a=e._labelItems||(e._labelItems=e._computeLabelItems(t));let i,o;for(i=0,o=a.length;i<o;++i){const t=a[i],e=t.font,r=t.label;t.backdrop&&(n.fillStyle=t.backdrop.color,n.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),be(n,r,0,t.textOffset,e,t)}r&&fe(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:r}}=this;if(!n.display)return;const a=Pe(n.font),i=Ce(n.padding),o=n.align;let s=a.lineHeight/2;"bottom"===e||"center"===e||T(e)?(s+=i.bottom,L(n.text)&&(s+=a.lineHeight*(n.text.length-1))):s+=i.top;const{titleX:l,titleY:c,maxWidth:u,rotation:d}=function(t,e,n,r){const{top:a,left:i,bottom:o,right:s,chart:l}=t,{chartArea:c,scales:u}=l;let d,h,p,f=0;const g=o-a,m=s-i;if(t.isHorizontal()){if(h=C(r,i,s),T(n)){const t=Object.keys(n)[0],r=n[t];p=u[t].getPixelForValue(r)+g-e}else p="center"===n?(c.bottom+c.top)/2+g-e:Kr(t,n,e);d=s-i}else{if(T(n)){const t=Object.keys(n)[0],r=n[t];h=u[t].getPixelForValue(r)-m+e}else h="center"===n?(c.left+c.right)/2-m+e:Kr(t,n,e);p=C(r,o,a),f="left"===n?-rt:rt}return{titleX:h,titleY:p,maxWidth:d,rotation:f}}(this,s,e,o);be(t,n.text,0,0,a,{color:n.color,maxWidth:u,rotation:d,textAlign:na(o,e,r),textBaseline:"middle",translation:[l,c]})}draw(t){const e=this;e._isVisible()&&(e.drawBackground(),e.drawGrid(t),e.drawBorder(),e.drawTitle(),e.drawLabels(t))}_layers(){const t=this,e=t.options,n=e.ticks&&e.ticks.z||0,r=R(e.grid&&e.grid.z,-1);return t._isVisible()&&t.draw===ra.prototype.draw?[{z:r,draw(e){t.drawBackground(),t.drawGrid(e),t.drawTitle()}},{z:r+1,draw(){t.drawBorder()}},{z:n,draw(e){t.drawLabels(e)}}]:[{z:n,draw(e){t.draw(e)}}]}getMatchingVisibleMetas(t){const e=this,n=e.chart.getSortedVisibleDatasetMetas(),r=e.axis+"AxisID",a=[];let i,o;for(i=0,o=n.length;i<o;++i){const o=n[i];o[r]!==e.id||t&&o.type!==t||a.push(o)}return a}_resolveTickFontOptions(t){return Pe(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this,e=t._resolveTickFontOptions(0).lineHeight;return(t.isHorizontal()?t.width:t.height)/e}}class aa{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=this,n=Object.getPrototypeOf(t);let r;(function(t){return"id"in t&&"defaults"in t})(n)&&(r=e.register(n));const a=e.items,i=t.id,o=e.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in a||(a[i]=t,function(t,e,n){const r=H(Object.create(null),[n?oe.get(n):{},oe.get(e),t.defaults]);oe.set(e,r),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((n=>{const r=n.split("."),a=r.pop(),i=[t].concat(r).join("."),o=e[n].split("."),s=o.pop(),l=o.join(".");oe.route(i,a,l,s)}))}(e,t.defaultRoutes),t.descriptors&&oe.describe(e,t.descriptors)}(t,o,r),e.override&&oe.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,r=this.scope;n in e&&delete e[n],r&&n in oe[r]&&(delete oe[r][n],this.override&&delete ne[n])}}var ia=new class{constructor(){this.controllers=new aa(qn,"datasets",!0),this.elements=new aa(Yr,"elements"),this.plugins=new aa(Object,"plugins"),this.scales=new aa(ra,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){const r=this;[...e].forEach((e=>{const a=n||r._getRegistryForType(e);n||a.isForType(e)||a===r.plugins&&e.id?r._exec(t,a,e):j(e,(e=>{const a=n||r._getRegistryForType(e);r._exec(t,a,e)}))}))}_exec(t,e,n){const r=G(t);N(n["before"+r],[],n),e[t](n),N(n["after"+r],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const r=e.get(t);if(void 0===r)throw new Error('"'+t+'" is not a registered '+n+".");return r}};class oa{constructor(){this._init=[]}notify(t,e,n,r){const a=this;"beforeInit"===e&&(a._init=a._createDescriptors(t,!0),a._notify(a._init,t,"install"));const i=r?a._descriptors(t).filter(r):a._descriptors(t),o=a._notify(i,t,e,n);return"destroy"===e&&(a._notify(i,t,"stop"),a._notify(a._init,t,"uninstall")),o}_notify(t,e,n,r){r=r||{};for(const a of t){const t=a.plugin;if(!1===N(t[n],[e,r,a.options],t)&&r.cancelable)return!1}return!0}invalidate(){O(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,r=R(n.options&&n.options.plugins,{}),a=function(t){const e=[],n=Object.keys(ia.plugins.items);for(let t=0;t<n.length;t++)e.push(ia.getPlugin(n[t]));const r=t.plugins||[];for(let t=0;t<r.length;t++){const n=r[t];-1===e.indexOf(n)&&e.push(n)}return e}(n);return!1!==r||e?function(t,e,n,r){const a=[],i=t.getContext();for(let o=0;o<e.length;o++){const s=e[o],l=sa(n[s.id],r);null!==l&&a.push({plugin:s,options:la(t.config,s,l,i)})}return a}(t,a,r,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,r=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(r(e,n),t,"stop"),this._notify(r(n,e),t,"start")}}function sa(t,e){return e||!1!==t?!0===t?{}:t:null}function la(t,e,n,r){const a=t.pluginScopeKeys(e),i=t.getOptionScopes(n,a);return t.createResolver(i,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ca(t,e){const n=oe.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function ua(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(n=e.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||t.charAt(0).toLowerCase();var n}function da(t){const e=t.options||(t.options={});e.plugins=R(e.plugins,{}),e.scales=function(t,e){const n=ne[t.type]||{scales:{}},r=e.scales||{},a=ca(t.type,e),i=Object.create(null),o=Object.create(null);return Object.keys(r).forEach((t=>{const e=r[t],s=ua(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(s,a),c=n.scales||{};i[s]=i[s]||t,o[t]=$(Object.create(null),[{axis:s},e,c[s],c[l]])})),t.data.datasets.forEach((n=>{const a=n.type||t.type,s=n.indexAxis||ca(a,e),l=(ne[a]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,s),a=n[e+"AxisID"]||i[e]||e;o[a]=o[a]||Object.create(null),$(o[a],[{axis:e},r[a],l[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];$(e,[oe.scales[e.type],oe.scale])})),o}(t,e)}function ha(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const pa=new Map,fa=new Set;function ga(t,e){let n=pa.get(t);return n||(n=e(),pa.set(t,n),fa.add(n)),n}const ma=(t,e,n)=>{const r=X(e,n);void 0!==r&&t.add(r)};class ba{constructor(t){this._config=function(t){return(t=t||{}).data=ha(t.data),da(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=ha(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),da(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ga(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return ga(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return ga(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return ga(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const n=this._scopeCache;let r=n.get(t);return r&&!e||(r=new Map,n.set(t,r)),r}getOptionScopes(t,e,n){const{options:r,type:a}=this,i=this._cachedScopes(t,n),o=i.get(e);if(o)return o;const s=new Set;e.forEach((e=>{t&&(s.add(t),e.forEach((e=>ma(s,t,e)))),e.forEach((t=>ma(s,r,t))),e.forEach((t=>ma(s,ne[a]||{},t))),e.forEach((t=>ma(s,oe,t))),e.forEach((t=>ma(s,re,t)))}));const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),fa.has(e)&&i.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,ne[e]||{},oe.datasets[e]||{},{type:e},oe,re]}resolveNamedOptions(t,e,n,r=[""]){const a={$shared:!0},{resolver:i,subPrefixes:o}=xa(this._resolverCache,t,r);let s=i;(function(t,e){const{isScriptable:n,isIndexable:r}=je(t);for(const a of e)if(n(a)&&K(t[a])||r(a)&&L(t[a]))return!0;return!1})(i,e)&&(a.$shared=!1,s=Ne(i,n=K(n)?n():n,this.createResolver(t,n,o)));for(const t of e)a[t]=s[t];return a}createResolver(t,e,n=[""],r){const{resolver:a}=xa(this._resolverCache,t,n);return T(e)?Ne(a,e,void 0,r):a}}function xa(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const a=n.join();let i=r.get(a);return i||(i={resolver:ze(e,n),subPrefixes:n.filter((t=>!t.toLowerCase().includes("hover")))},r.set(a,i)),i}const _a=["top","bottom","left","right","chartArea"];function va(t,e){return"top"===t||"bottom"===t||-1===_a.indexOf(t)&&"x"===e}function ya(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function wa(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),N(n&&n.onComplete,[t],e)}function ka(t){const e=t.chart,n=e.options.animation;N(n&&n.onProgress,[t],e)}function Sa(t){return en()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Ea={},Ma=t=>{const e=Sa(t);return Object.values(Ea).filter((t=>t.canvas===e)).pop()};class Ca{constructor(t,e){const n=this,r=this.config=new ba(e),a=Sa(t),i=Ma(a);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas can be reused.");const o=r.createResolver(r.chartOptionScopes(),n.getContext());this.platform=new(r.platform||function(t){return!en()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Tr:qr}(a));const s=n.platform.acquireContext(a,o.aspectRatio),l=s&&s.canvas,c=l&&l.height,u=l&&l.width;this.id=D(),this.ctx=s,this.canvas=l,this.width=u,this.height=c,this._options=o,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 oa,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(){return e?(clearTimeout(n),n=setTimeout(t,e)):t(),e}}((()=>this.update("resize")),o.resizeDelay||0),Ea[n.id]=n,s&&l?(Dn.listen(n,"complete",wa),Dn.listen(n,"progress",ka),n._initialize(),n.attached&&n.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:r,_aspectRatio:a}=this;return O(t)?e&&a?a:r?n/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){const t=this;return t.notifyPlugins("beforeInit"),t.options.responsive?t.resize():dn(t,t.options.devicePixelRatio),t.bindEvents(),t.notifyPlugins("afterInit"),t}clear(){return ue(this.canvas,this.ctx),this}stop(){return Dn.stop(this),this}resize(t,e){Dn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this,r=n.options,a=n.canvas,i=r.maintainAspectRatio&&n.aspectRatio,o=n.platform.getMaximumSize(a,t,e,i),s=r.devicePixelRatio||n.platform.getDevicePixelRatio();n.width=o.width,n.height=o.height,n._aspectRatio=n.aspectRatio,dn(n,s,!0)&&(n.notifyPlugins("resize",{size:o}),N(r.onResize,[n,o],n),n.attached&&n._doResize()&&n.render())}ensureScalesHaveIDs(){j(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this,e=t.options,n=e.scales,r=t.scales,a=Object.keys(r).reduce(((t,e)=>(t[e]=!1,t)),{});let i=[];n&&(i=i.concat(Object.keys(n).map((t=>{const e=n[t],r=ua(t,e),a="r"===r,i="x"===r;return{options:e,dposition:a?"chartArea":i?"bottom":"left",dtype:a?"radialLinear":i?"category":"linear"}})))),j(i,(n=>{const i=n.options,o=i.id,s=ua(o,i),l=R(i.type,n.dtype);void 0!==i.position&&va(i.position,s)===va(n.dposition)||(i.position=n.dposition),a[o]=!0;let c=null;o in r&&r[o].type===l?c=r[o]:(c=new(ia.getScale(l))({id:o,type:l,ctx:t.ctx,chart:t}),r[c.id]=c),c.init(i,e)})),j(a,((t,e)=>{t||delete r[e]})),j(r,(e=>{Or.configure(t,e,e.options),Or.addBox(t,e)}))}_updateMetasets(){const t=this,e=t._metasets,n=t.data.datasets.length,r=e.length;if(e.sort(((t,e)=>t.index-e.index)),r>n){for(let e=n;e<r;++e)t._destroyDatasetMeta(e);e.splice(n,r-n)}t._sortedMetasets=e.slice(0).sort(ya("order","index"))}_removeUnreferencedMetasets(){const t=this,{_metasets:e,data:{datasets:n}}=t;e.length>n.length&&delete t._stacks,e.forEach(((e,r)=>{0===n.filter((t=>t===e._dataset)).length&&t._destroyDatasetMeta(r)}))}buildOrUpdateControllers(){const t=this,e=[],n=t.data.datasets;let r,a;for(t._removeUnreferencedMetasets(),r=0,a=n.length;r<a;r++){const a=n[r];let i=t.getDatasetMeta(r);const o=a.type||t.config.type;if(i.type&&i.type!==o&&(t._destroyDatasetMeta(r),i=t.getDatasetMeta(r)),i.type=o,i.indexAxis=a.indexAxis||ca(o,t.options),i.order=a.order||0,i.index=r,i.label=""+a.label,i.visible=t.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const n=ia.getController(o),{datasetElementType:a,dataElementType:s}=oe.datasets[o];Object.assign(n.prototype,{dataElementType:ia.getElement(s),datasetElementType:a&&ia.getElement(a)}),i.controller=new n(t,r),e.push(i.controller)}}return t._updateMetasets(),e}_resetElements(){const t=this;j(t.data.datasets,((e,n)=>{t.getDatasetMeta(n).controller.reset()}),t)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this,n=e.config;n.update(),e._options=n.createResolver(n.chartOptionScopes(),e.getContext()),j(e.scales,(t=>{Or.removeBox(e,t)}));const r=e._animationsDisabled=!e.options.animation;if(e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),((t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0})(new Set(Object.keys(e._listeners)),new Set(e.options.events))&&!!this._responsiveListeners===e.options.responsive||(e.unbindEvents(),e.bindEvents()),e._plugins.invalidate(),!1===e.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const a=e.buildOrUpdateControllers();e.notifyPlugins("beforeElementsUpdate");let i=0;for(let t=0,n=e.data.datasets.length;t<n;t++){const{controller:n}=e.getDatasetMeta(t),o=!r&&-1===a.indexOf(n);n.buildOrUpdateElements(o),i=Math.max(+n.getMaxOverflow(),i)}e._minPadding=i,e._updateLayout(i),r||j(a,(t=>{t.reset()})),e._updateDatasets(t),e.notifyPlugins("afterUpdate",{mode:t}),e._layers.sort(ya("z","_idx")),e._lastEvent&&e._eventHandler(e._lastEvent,!0),e.render()}_updateLayout(t){const e=this;if(!1===e.notifyPlugins("beforeLayout",{cancelable:!0}))return;Or.update(e,e.width,e.height,t);const n=e.chartArea,r=n.width<=0||n.height<=0;e._layers=[],j(e.boxes,(t=>{r&&"chartArea"===t.position||(t.configure&&t.configure(),e._layers.push(...t._layers()))}),e),e._layers.forEach(((t,e)=>{t._idx=e})),e.notifyPlugins("afterLayout")}_updateDatasets(t){const e=this,n="function"==typeof t;if(!1!==e.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let r=0,a=e.data.datasets.length;r<a;++r)e._updateDataset(r,n?t({datasetIndex:r}):t);e.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this,r=n.getDatasetMeta(t),a={meta:r,index:t,mode:e,cancelable:!0};!1!==n.notifyPlugins("beforeDatasetUpdate",a)&&(r.controller._update(e),a.cancelable=!1,n.notifyPlugins("afterDatasetUpdate",a))}render(){const t=this;!1!==t.notifyPlugins("beforeRender",{cancelable:!0})&&(Dn.has(t)?t.attached&&!Dn.running(t)&&Dn.start(t):(t.draw(),wa({chart:t})))}draw(){const t=this;let e;if(t._resizeBeforeDraw){const{width:e,height:n}=t._resizeBeforeDraw;t._resize(e,n),t._resizeBeforeDraw=null}if(t.clear(),t.width<=0||t.height<=0)return;if(!1===t.notifyPlugins("beforeDraw",{cancelable:!0}))return;const n=t._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(t.chartArea);for(t._drawDatasets();e<n.length;++e)n[e].draw(t.chartArea);t.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let r,a;for(r=0,a=e.length;r<a;++r){const a=e[r];t&&!a.visible||n.push(a)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){const t=this;if(!1===t.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=t.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)t._drawDataset(e[n]);t.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this,n=e.ctx,r=t._clip,a=!r.disabled,i=e.chartArea,o={meta:t,index:t.index,cancelable:!0};!1!==e.notifyPlugins("beforeDatasetDraw",o)&&(a&&pe(n,{left:!1===r.left?0:i.left-r.left,right:!1===r.right?e.width:i.right+r.right,top:!1===r.top?0:i.top-r.top,bottom:!1===r.bottom?e.height:i.bottom+r.bottom}),t.controller.draw(),a&&fe(n),o.cancelable=!1,e.notifyPlugins("afterDatasetDraw",o))}getElementsAtEventForMode(t,e,n,r){const a=xr.modes[e];return"function"==typeof a?a(this,t,n,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let r=n.filter((t=>t&&t._dataset===e)).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||(this.$context={chart:this,type:"chart"})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const r=this,a=n?"show":"hide",i=r.getDatasetMeta(t),o=i.controller._resolveAnimations(void 0,a);Q(e)?(i.data[e].hidden=!n,r.update()):(r.setDatasetVisibility(t,n),o.update(i,{visible:n}),r.update((e=>e.datasetIndex===t?a:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this,n=e._metasets&&e._metasets[t];n&&n.controller&&(n.controller._destroy(),delete e._metasets[t])}destroy(){const t=this,{canvas:e,ctx:n}=t;let r,a;for(t.stop(),Dn.remove(t),r=0,a=t.data.datasets.length;r<a;++r)t._destroyDatasetMeta(r);t.config.clearCache(),e&&(t.unbindEvents(),ue(e,n),t.platform.releaseContext(n),t.canvas=null,t.ctx=null),t.notifyPlugins("destroy"),delete Ea[t.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this,e=t._listeners,n=t.platform,r=function(e,n,r){e.offsetX=n,e.offsetY=r,t._eventHandler(e)};j(t.options.events,(a=>((r,a)=>{n.addEventListener(t,r,a),e[r]=a})(a,r)))}bindResponsiveEvents(){const t=this;t._responsiveListeners||(t._responsiveListeners={});const e=t._responsiveListeners,n=t.platform,r=(r,a)=>{n.addEventListener(t,r,a),e[r]=a},a=(r,a)=>{e[r]&&(n.removeEventListener(t,r,a),delete e[r])},i=(e,n)=>{t.canvas&&t.resize(e,n)};let o;const s=()=>{a("attach",s),t.attached=!0,t.resize(),r("resize",i),r("detach",o)};o=()=>{t.attached=!1,a("resize",i),r("attach",s)},n.isAttached(t.canvas)?s():o()}unbindEvents(){const t=this;j(t._listeners,((e,n)=>{t.platform.removeEventListener(t,n,e)})),t._listeners={},j(t._responsiveListeners,((e,n)=>{t.platform.removeEventListener(t,n,e)})),t._responsiveListeners=void 0}updateHoverStyle(t,e,n){const r=n?"set":"remove";let a,i,o,s;for("dataset"===e&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+r+"DatasetHoverStyle"]()),o=0,s=t.length;o<s;++o){i=t[o];const e=i&&this.getDatasetMeta(i.datasetIndex).controller;e&&e[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this,n=e._active||[],r=t.map((({datasetIndex:t,index:n})=>{const r=e.getDatasetMeta(t);if(!r)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:r.data[n],index:n}}));!F(r,n)&&(e._active=r,e._updateHoverStyles(r,n))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const r=this,a=r.options.hover,i=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=i(e,t),s=n?t:i(t,e);o.length&&r.updateHoverStyle(o,a.mode,!1),s.length&&a.mode&&r.updateHoverStyle(s,a.mode,!0)}_eventHandler(t,e){const n=this,r={event:t,replay:e,cancelable:!0},a=e=>(e.options.events||this.options.events).includes(t.type);if(!1===n.notifyPlugins("beforeEvent",r,a))return;const i=n._handleEvent(t,e);return r.cancelable=!1,n.notifyPlugins("afterEvent",r,a),(i||r.changed)&&n.render(),n}_handleEvent(t,e){const n=this,{_active:r=[],options:a}=n,i=a.hover,o=e;let s=[],l=!1,c=null;return"mouseout"!==t.type&&(s=n.getElementsAtEventForMode(t,i.mode,i,o),c="click"===t.type?n._lastEvent:t),n._lastEvent=null,he(t,n.chartArea,n._minPadding)&&(N(a.onHover,[t,s,n],n),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||N(a.onClick,[t,s,n],n)),l=!F(s,r),(l||e)&&(n._active=s,n._updateHoverStyles(s,r,e)),n._lastEvent=c,l}}const Pa=()=>j(Ca.instances,(t=>t._plugins.invalidate())),Da=!0;function Oa(t,e,n){const{startAngle:r,pixelMargin:a,x:i,y:o,outerRadius:s,innerRadius:l}=e;let c=a/s;t.beginPath(),t.arc(i,o,s,r-c,n+c),l>a?(c=a/l,t.arc(i,o,l,n+c,r-c,!0)):t.arc(i,o,a,n+rt,r-rt),t.closePath(),t.clip()}function La(t,e,n,r){return{x:n+t*Math.cos(e),y:r+t*Math.sin(e)}}function Ta(t,e,n,r,a){const{x:i,y:o,startAngle:s,pixelMargin:l,innerRadius:c}=e,u=Math.max(e.outerRadius+r+n-l,0),d=c>0?c+r+n+l:0;let h=0;const p=a-s;if(r){const t=((c>0?c-r:0)+(u>0?u-r:0))/2;h=(p-(0!==t?p*t/(t+r):p))/2}const f=(p-Math.max(.001,p*u-n/Z)/u)/2,g=s+f+h,m=a-f-h,{outerStart:b,outerEnd:x,innerStart:_,innerEnd:v}=function(t,e,n,r){const a=Se(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),i=(n-e)/2,o=Math.min(i,r*e/2),s=t=>{const e=(n-Math.min(i,t))*r/2;return _t(t,0,Math.min(i,e))};return{outerStart:s(a.outerStart),outerEnd:s(a.outerEnd),innerStart:_t(a.innerStart,0,o),innerEnd:_t(a.innerEnd,0,o)}}(e,d,u,m-g),y=u-b,w=u-x,k=g+b/y,S=m-x/w,E=d+_,M=d+v,C=g+_/E,P=m-v/M;if(t.beginPath(),t.arc(i,o,u,k,S),x>0){const e=La(w,S,i,o);t.arc(e.x,e.y,x,S,m+rt)}const D=La(M,m,i,o);if(t.lineTo(D.x,D.y),v>0){const e=La(M,P,i,o);t.arc(e.x,e.y,v,m+rt,P+Math.PI)}if(t.arc(i,o,d,m-v/d,g+_/d,!0),_>0){const e=La(E,C,i,o);t.arc(e.x,e.y,_,C+Math.PI,g-rt)}const O=La(y,g,i,o);if(t.lineTo(O.x,O.y),b>0){const e=La(y,k,i,o);t.arc(e.x,e.y,b,g-rt,k)}t.closePath()}Object.defineProperties(Ca,{defaults:{enumerable:Da,value:oe},instances:{enumerable:Da,value:Ea},overrides:{enumerable:Da,value:ne},registry:{enumerable:Da,value:ia},version:{enumerable:Da,value:"3.5.1"},getChart:{enumerable:Da,value:Ma},register:{enumerable:Da,value:(...t)=>{ia.add(...t),Pa()}},unregister:{enumerable:Da,value:(...t)=>{ia.remove(...t),Pa()}}});class Aa extends Yr{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const r=this.getProps(["x","y"],n),{angle:a,distance:i}=function(t,e){const n=e.x-t.x,r=e.y-t.y,a=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*Z&&(i+=J),{angle:i,distance:a}}(r,{x:t,y:e}),{startAngle:o,endAngle:s,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=this.options.spacing/2;return(u>=J||xt(a,o,s))&&i>=l+d&&i<=c+d}getCenterPoint(t){const{x:e,y:n,startAngle:r,endAngle:a,innerRadius:i,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:s,spacing:l}=this.options,c=(r+a)/2,u=(i+o+l+s)/2;return{x:e+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const e=this,{options:n,circumference:r}=e,a=(n.offset||0)/2,i=(n.spacing||0)/2;if(e.pixelMargin="inner"===n.borderAlign?.33:0,e.fullCircles=r>J?Math.floor(r/J):0,0===r||e.innerRadius<0||e.outerRadius<0)return;t.save();let o=0;if(a){o=a/2;const n=(e.startAngle+e.endAngle)/2;t.translate(Math.cos(n)*o,Math.sin(n)*o),e.circumference>=Z&&(o=a)}t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor;const s=function(t,e,n,r){const{fullCircles:a,startAngle:i,circumference:o}=e;let s=e.endAngle;if(a){Ta(t,e,n,r,i+J);for(let e=0;e<a;++e)t.fill();isNaN(o)||(s=i+o%J,o%J==0&&(s+=J))}return Ta(t,e,n,r,s),t.fill(),s}(t,e,o,i);(function(t,e,n,r,a){const{options:i}=e,o="inner"===i.borderAlign;i.borderWidth&&(o?(t.lineWidth=2*i.borderWidth,t.lineJoin="round"):(t.lineWidth=i.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,n){const{x:r,y:a,startAngle:i,pixelMargin:o,fullCircles:s}=e,l=Math.max(e.outerRadius-o,0),c=e.innerRadius+o;let u;for(n&&Oa(t,e,i+J),t.beginPath(),t.arc(r,a,c,i+J,i,!0),u=0;u<s;++u)t.stroke();for(t.beginPath(),t.arc(r,a,l,i,i+J),u=0;u<s;++u)t.stroke()}(t,e,o),o&&Oa(t,e,a),Ta(t,e,n,r,a),t.stroke())})(t,e,o,i,s),t.restore()}}function Ia(t,e,n=e){t.lineCap=R(n.borderCapStyle,e.borderCapStyle),t.setLineDash(R(n.borderDash,e.borderDash)),t.lineDashOffset=R(n.borderDashOffset,e.borderDashOffset),t.lineJoin=R(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=R(n.borderWidth,e.borderWidth),t.strokeStyle=R(n.borderColor,e.borderColor)}function Ra(t,e,n){t.lineTo(n.x,n.y)}function za(t,e,n={}){const r=t.length,{start:a=0,end:i=r-1}=n,{start:o,end:s}=e,l=Math.max(a,o),c=Math.min(i,s),u=a<o&&i<o||a>s&&i>s;return{count:r,start:l,loop:e.loop,ilen:c<l&&!u?r+c-l:c-l}}function Na(t,e,n,r){const{points:a,options:i}=e,{count:o,start:s,loop:l,ilen:c}=za(a,n,r),u=function(t){return t.stepped?ge:t.tension||"monotone"===t.cubicInterpolationMode?me:Ra}(i);let d,h,p,{move:f=!0,reverse:g}=r||{};for(d=0;d<=c;++d)h=a[(s+(g?c-d:d))%o],h.skip||(f?(t.moveTo(h.x,h.y),f=!1):u(t,p,h,g,i.stepped),p=h);return l&&(h=a[(s+(g?c:0))%o],u(t,p,h,g,i.stepped)),!!l}function ja(t,e,n,r){const a=e.points,{count:i,start:o,ilen:s}=za(a,n,r),{move:l=!0,reverse:c}=r||{};let u,d,h,p,f,g,m=0,b=0;const x=t=>(o+(c?s-t:t))%i,_=()=>{p!==f&&(t.lineTo(m,f),t.lineTo(m,p),t.lineTo(m,g))};for(l&&(d=a[x(0)],t.moveTo(d.x,d.y)),u=0;u<=s;++u){if(d=a[x(u)],d.skip)continue;const e=d.x,n=d.y,r=0|e;r===h?(n<p?p=n:n>f&&(f=n),m=(b*m+e)/++b):(_(),t.lineTo(e,n),h=r,b=0,p=f=n),g=n}_()}function Fa(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n?Na:ja}Aa.id="arc",Aa.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},Aa.defaultRoutes={backgroundColor:"backgroundColor"};const Ba="function"==typeof Path2D;class Va extends Yr{constructor(t){super(),this.animated=!0,this.options=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this,r=n.options;if((r.tension||"monotone"===r.cubicInterpolationMode)&&!r.stepped&&!n._pointsUpdated){const a=r.spanGaps?n._loop:n._fullLoop;tn(n._points,r,t,a,e),n._pointsUpdated=!0}}set points(t){const e=this;e._points=t,delete e._segments,delete e._path,e._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const n=t.points,r=t.options.spanGaps,a=n.length;if(!a)return[];const i=!!t._loop,{start:o,end:s}=function(t,e,n,r){let a=0,i=e-1;if(n&&!r)for(;a<e&&!t[a].skip;)a++;for(;a<e&&t[a].skip;)a++;for(a%=e,n&&(i+=a);i>a&&t[i%e].skip;)i--;return i%=e,{start:a,end:i}}(n,a,i,r);return function(t,e,n,r){return r&&r.setContext&&n?function(t,e,n,r){const a=Cn(t.options),i=n.length,o=[];let s=e[0].start,l=s;for(const c of e){let e,u=a,d=n[s%i];for(l=s+1;l<=c.end;l++){const a=n[l%i];e=Cn(r.setContext({type:"segment",p0:d,p1:a,p0DataIndex:(l-1)%i,p1DataIndex:l%i,datasetIndex:t._datasetIndex})),Pn(e,u)&&(o.push({start:s,end:l-1,loop:c.loop,style:u}),u=e,s=l-1),d=a,u=e}s<l-1&&(o.push({start:s,end:l-1,loop:c.loop,style:e}),s=l-1)}return o}(t,e,n,r):e}(t,!0===r?[{start:o,end:s,loop:i}]:function(t,e,n,r){const a=t.length,i=[];let o,s=e,l=t[e];for(o=e+1;o<=n;++o){const n=t[o%a];n.skip||n.stop?l.skip||(r=!1,i.push({start:e%a,end:(o-1)%a,loop:r}),e=s=n.stop?o:null):(s=o,l.skip&&(e=o)),l=n}return null!==s&&i.push({start:e%a,end:s%a,loop:r}),i}(n,o,s<o?s+a:s,!!t._fullLoop&&0===o&&s===a-1),n,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this,r=n.options,a=t[e],i=n.points,o=Mn(n,{property:e,start:a,end:a});if(!o.length)return;const s=[],l=function(t){return t.stepped?gn:t.tension||"monotone"===t.cubicInterpolationMode?mn:fn}(r);let c,u;for(c=0,u=o.length;c<u;++c){const{start:n,end:u}=o[c],d=i[n],h=i[u];if(d===h){s.push(d);continue}const p=l(d,h,Math.abs((a-d[e])/(h[e]-d[e])),r.stepped);p[e]=t[e],s.push(p)}return 1===s.length?s[0]:s}pathSegment(t,e,n){return Fa(this)(t,this,e,n)}path(t,e,n){const r=this,a=r.segments,i=Fa(r);let o=r._loop;e=e||0,n=n||r.points.length-e;for(const s of a)o&=i(t,r,s,{start:e,end:e+n-1});return!!o}draw(t,e,n,r){const a=this,i=a.options||{};(a.points||[]).length&&i.borderWidth&&(t.save(),function(t,e,n,r){Ba&&1===e.segments.length?function(t,e,n,r){let a=e._path;a||(a=e._path=new Path2D,e.path(a,n,r)&&a.closePath()),Ia(t,e.options),t.stroke(a)}(t,e,n,r):function(t,e,n,r){const{segments:a,options:i}=e,o=Fa(e);for(const s of a)Ia(t,i,s.style),t.beginPath(),o(t,e,s,{start:n,end:n+r-1})&&t.closePath(),t.stroke()}(t,e,n,r)}(t,a,n,r),t.restore(),a.animated&&(a._pointsUpdated=!1,a._path=void 0))}}function Wa(t,e,n,r){const a=t.options,{[n]:i}=t.getProps([n],r);return Math.abs(e-i)<a.radius+a.hitRadius}Va.id="line",Va.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Va.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Va.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class Ha extends Yr{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const r=this.options,{x:a,y:i}=this.getProps(["x","y"],n);return Math.pow(t-a,2)+Math.pow(e-i,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return Wa(this,t,"x",e)}inYRange(t,e){return Wa(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const n=this,r=n.options;n.skip||r.radius<.1||!he(n,e,n.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,de(t,r,n.x,n.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function $a(t,e){const{x:n,y:r,base:a,width:i,height:o}=t.getProps(["x","y","base","width","height"],e);let s,l,c,u,d;return t.horizontal?(d=o/2,s=Math.min(n,a),l=Math.max(n,a),c=r-d,u=r+d):(d=i/2,s=n-d,l=n+d,c=Math.min(r,a),u=Math.max(r,a)),{left:s,top:c,right:l,bottom:u}}function Ua(t,e,n,r){return t?0:_t(e,n,r)}function qa(t,e,n,r){const a=null===e,i=null===n,o=t&&!(a&&i)&&$a(t,r);return o&&(a||e>=o.left&&e<=o.right)&&(i||n>=o.top&&n<=o.bottom)}function Ya(t,e){t.rect(e.x,e.y,e.w,e.h)}function Xa(t,e,n={}){const r=t.x!==n.x?-e:0,a=t.y!==n.y?-e:0,i=(t.x+t.w!==n.x+n.w?e:0)-r,o=(t.y+t.h!==n.y+n.h?e:0)-a;return{x:t.x+r,y:t.y+a,w:t.w+i,h:t.h+o,radius:t.radius}}Ha.id="point",Ha.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Ha.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Ga extends Yr{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){const e=this.options,{inner:n,outer:r}=function(t){const e=$a(t),n=e.right-e.left,r=e.bottom-e.top,a=function(t,e,n){const r=t.options.borderWidth,a=t.borderSkipped,i=Ee(r);return{t:Ua(a.top,i.top,0,n),r:Ua(a.right,i.right,0,e),b:Ua(a.bottom,i.bottom,0,n),l:Ua(a.left,i.left,0,e)}}(t,n/2,r/2),i=function(t,e,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,i=Me(a),o=Math.min(e,n),s=t.borderSkipped,l=r||T(a);return{topLeft:Ua(!l||s.top||s.left,i.topLeft,0,o),topRight:Ua(!l||s.top||s.right,i.topRight,0,o),bottomLeft:Ua(!l||s.bottom||s.left,i.bottomLeft,0,o),bottomRight:Ua(!l||s.bottom||s.right,i.bottomRight,0,o)}}(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,i.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(a.b,a.r))}}}}(this),a=(i=r.radius).topLeft||i.topRight||i.bottomLeft||i.bottomRight?_e:Ya;var i;t.save(),r.w===n.w&&r.h===n.h||(t.beginPath(),a(t,Xa(r,.33,n)),t.clip(),a(t,Xa(n,-.33,r)),t.fillStyle=e.borderColor,t.fill("evenodd")),t.beginPath(),a(t,Xa(n,.33,r)),t.fillStyle=e.backgroundColor,t.fill(),t.restore()}inRange(t,e,n){return qa(this,t,e,n)}inXRange(t,e){return qa(this,t,null,e)}inYRange(t,e){return qa(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:r,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+r)/2:e,y:a?n:(n+r)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}Ga.id="bar",Ga.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},Ga.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Qa=Object.freeze({__proto__:null,ArcElement:Aa,LineElement:Va,PointElement:Ha,BarElement:Ga});function Ka(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function Za(t){t.data.datasets.forEach((t=>{Ka(t)}))}var Ja={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled)return void Za(t);const r=t.width;t.data.datasets.forEach(((e,a)=>{const{_data:i,indexAxis:o}=e,s=t.getDatasetMeta(a),l=i||e.data;if("y"===De([o,t.options.indexAxis]))return;if("line"!==s.type)return;const c=t.scales[s.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let u,{start:d,count:h}=function(t,e){const n=e.length;let r,a=0;const{iScale:i}=t,{min:o,max:s,minDefined:l,maxDefined:c}=i.getUserBounds();return l&&(a=_t(Le(e,i.axis,o).lo,0,n-1)),r=c?_t(Le(e,i.axis,s).hi+1,a,n)-a:n-a,{start:a,count:r}}(s,l);if(h<=(n.threshold||4*r))Ka(e);else{switch(O(i)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),n.algorithm){case"lttb":u=function(t,e,n,r,a){const i=a.samples||r;if(i>=n)return t.slice(e,e+n);const o=[],s=(n-2)/(i-2);let l=0;const c=e+n-1;let u,d,h,p,f,g=e;for(o[l++]=t[g],u=0;u<i-2;u++){let r,a=0,i=0;const c=Math.floor((u+1)*s)+1+e,m=Math.min(Math.floor((u+2)*s)+1,n)+e,b=m-c;for(r=c;r<m;r++)a+=t[r].x,i+=t[r].y;a/=b,i/=b;const x=Math.floor(u*s)+1+e,_=Math.min(Math.floor((u+1)*s)+1,n)+e,{x:v,y}=t[g];for(h=p=-1,r=x;r<_;r++)p=.5*Math.abs((v-a)*(t[r].y-y)-(v-t[r].x)*(i-y)),p>h&&(h=p,d=t[r],f=r);o[l++]=d,g=f}return o[l++]=t[c],o}(l,d,h,r,n);break;case"min-max":u=function(t,e,n,r){let a,i,o,s,l,c,u,d,h,p,f=0,g=0;const m=[],b=e+n-1,x=t[e].x,_=t[b].x-x;for(a=e;a<e+n;++a){i=t[a],o=(i.x-x)/_*r,s=i.y;const e=0|o;if(e===l)s<h?(h=s,c=a):s>p&&(p=s,u=a),f=(g*f+i.x)/++g;else{const n=a-1;if(!O(c)&&!O(u)){const e=Math.min(c,u),r=Math.max(c,u);e!==d&&e!==n&&m.push({...t[e],x:f}),r!==d&&r!==n&&m.push({...t[r],x:f})}a>0&&n!==d&&m.push(t[n]),m.push(i),l=e,g=0,h=p=s,c=u=d=a}}return m}(l,d,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}e._decimated=u}}))},destroy(t){Za(t)}};function ti(t,e,n){const r=function(t){const e=t.options,n=e.fill;let r=R(n&&n.target,n);return void 0===r&&(r=!!e.backgroundColor),!1!==r&&null!==r&&(!0===r?"origin":r)}(t);if(T(r))return!isNaN(r.value)&&r;let a=parseFloat(r);return A(a)&&Math.floor(a)===a?("-"!==r[0]&&"+"!==r[0]||(a=e+a),!(a===e||a<0||a>=n)&&a):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}class ei{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:r,y:a,radius:i}=this;return e=e||{start:0,end:J},t.arc(r,a,i,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:r}=this,a=t.angle;return{x:e+Math.cos(a)*r,y:n+Math.sin(a)*r,angle:a}}}function ni(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}const ri=t=>"line"===t.type&&!t.hidden;function ai(t,e,n){const r=[];for(let a=0;a<n.length;a++){const i=n[a],{first:o,last:s,point:l}=ii(i,e,"x");if(!(!l||o&&s))if(o)r.unshift(l);else if(t.push(l),!s)break}t.push(...r)}function ii(t,e,n){const r=t.interpolate(e,n);if(!r)return{};const a=r[n],i=t.segments,o=t.points;let s=!1,l=!1;for(let t=0;t<i.length;t++){const e=i[t],r=o[e.start][n],c=o[e.end][n];if(a>=r&&a<=c){s=a===r,l=a===c;break}}return{first:s,last:l,point:r}}function oi(t,e){let n=[],r=!1;return L(t)?(r=!0,n=t):n=function(t,e){const{x:n=null,y:r=null}=t||{},a=e.points,i=[];return e.segments.forEach((({start:t,end:e})=>{e=ni(t,e,a);const o=a[t],s=a[e];null!==r?(i.push({x:o.x,y:r}),i.push({x:s.x,y:r})):null!==n&&(i.push({x:n,y:o.y}),i.push({x:n,y:s.y}))})),i}(t,e),n.length?new Va({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function si(t,e,n){let r=t[e].fill;const a=[e];let i;if(!n)return r;for(;!1!==r&&-1===a.indexOf(r);){if(!A(r))return r;if(i=t[r],!i)return!1;if(i.visible)return r;a.push(r),r=i.fill}return!1}function li(t,e,n){t.beginPath(),e.path(t),t.lineTo(e.last().x,n),t.lineTo(e.first().x,n),t.closePath(),t.clip()}function ci(t,e,n,r){if(r)return;let a=e[t],i=n[t];return"angle"===t&&(a=bt(a),i=bt(i)),{property:t,start:a,end:i}}function ui(t,e,n,r){return t&&e?r(t[n],e[n]):t?t[n]:e?e[n]:0}function di(t,e,n){const{top:r,bottom:a}=e.chart.chartArea,{property:i,start:o,end:s}=n||{};"x"===i&&(t.beginPath(),t.rect(o,r,s-o,a-r),t.clip())}function hi(t,e,n,r){const a=e.interpolate(n,r);a&&t.lineTo(a.x,a.y)}function pi(t,e){const{line:n,target:r,property:a,color:i,scale:o}=e,s=function(t,e,n){const r=t.segments,a=t.points,i=e.points,o=[];for(const t of r){let{start:r,end:s}=t;s=ni(r,s,a);const l=ci(n,a[r],a[s],t.loop);if(!e.segments){o.push({source:t,target:l,start:a[r],end:a[s]});continue}const c=Mn(e,l);for(const e of c){const r=ci(n,i[e.start],i[e.end],e.loop),s=En(t,a,r);for(const t of s)o.push({source:t,target:e,start:{[n]:ui(l,r,"start",Math.max)},end:{[n]:ui(l,r,"end",Math.min)}})}}return o}(n,r,a);for(const{source:e,target:l,start:c,end:u}of s){const{style:{backgroundColor:s=i}={}}=e,d=!0!==r;t.save(),t.fillStyle=s,di(t,o,d&&ci(a,c,u)),t.beginPath();const h=!!n.pathSegment(t,e);let p;if(d){h?t.closePath():hi(t,r,u,a);const e=!!r.pathSegment(t,l,{move:h,reverse:!0});p=h&&e,p||hi(t,r,c,a)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function fi(t,e,n){const r=function(t){const{chart:e,fill:n,line:r}=t;if(A(n))return function(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}(e,n);if("stack"===n)return function(t){const{chart:e,scale:n,index:r,line:a}=t,i=[],o=a.segments,s=a.points,l=function(t,e){const n=[],r=t.getSortedVisibleDatasetMetas();for(let t=0;t<r.length;t++){const a=r[t];if(a.index===e)break;ri(a)&&n.unshift(a.dataset)}return n}(e,r);l.push(oi({x:null,y:n.bottom},a));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)ai(i,s[t],l)}return new Va({points:i,options:{}})}(t);if("shape"===n)return!0;const a=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:n}=t,r=e.options,a=e.getLabels().length,i=[],o=r.reverse?e.max:e.min,s=r.reverse?e.min:e.max;let l,c,u;if(u="start"===n?o:"end"===n?s:T(n)?n.value:e.getBaseValue(),r.grid.circular)return c=e.getPointPositionForValue(0,o),new ei({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(u)});for(l=0;l<a;++l)i.push(e.getPointPositionForValue(l,u));return i}(t):function(t){const{scale:e={},fill:n}=t;let r,a=null;return"start"===n?a=e.bottom:"end"===n?a=e.top:T(n)?a=e.getPixelForValue(n.value):e.getBasePixel&&(a=e.getBasePixel()),A(a)?(r=e.isHorizontal(),{x:r?a:null,y:r?null:a}):null}(t)}(t);return a instanceof ei?a:oi(a,r)}(e),{line:a,scale:i,axis:o}=e,s=a.options,l=s.fill,c=s.backgroundColor,{above:u=c,below:d=c}=l||{};r&&a.points.length&&(pe(t,n),function(t,e){const{line:n,target:r,above:a,below:i,area:o,scale:s}=e,l=n._loop?"angle":e.axis;t.save(),"x"===l&&i!==a&&(li(t,r,o.top),pi(t,{line:n,target:r,color:a,scale:s,property:l}),t.restore(),t.save(),li(t,r,o.bottom)),pi(t,{line:n,target:r,color:i,scale:s,property:l}),t.restore()}(t,{line:a,target:r,above:u,below:d,area:n,scale:i,axis:o}),fe(t))}var gi={id:"filler",afterDatasetsUpdate(t,e,n){const r=(t.data.datasets||[]).length,a=[];let i,o,s,l;for(o=0;o<r;++o)i=t.getDatasetMeta(o),s=i.dataset,l=null,s&&s.options&&s instanceof Va&&(l={visible:t.isDatasetVisible(o),index:o,fill:ti(s,o,r),chart:t,axis:i.controller.options.indexAxis,scale:i.vScale,line:s}),i.$filler=l,a.push(l);for(o=0;o<r;++o)l=a[o],l&&!1!==l.fill&&(l.fill=si(a,o,n.propagate))},beforeDraw(t,e,n){const r="beforeDraw"===n.drawTime,a=t.getSortedVisibleDatasetMetas(),i=t.chartArea;for(let e=a.length-1;e>=0;--e){const n=a[e].$filler;n&&(n.line.updateControlPoints(i,n.axis),r&&fi(t.ctx,n,i))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const r=t.getSortedVisibleDatasetMetas();for(let e=r.length-1;e>=0;--e){const n=r[e].$filler;n&&fi(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const r=e.meta.$filler;r&&!1!==r.fill&&"beforeDatasetDraw"===n.drawTime&&fi(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const mi=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}};class bi extends Yr{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){const r=this;r.maxWidth=t,r.maxHeight=e,r._margins=n,r.setDimensions(),r.buildLabels(),r.fit()}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=t._margins.left,t.right=t.width):(t.height=t.maxHeight,t.top=t._margins.top,t.bottom=t.height)}buildLabels(){const t=this,e=t.options.labels||{};let n=N(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter((n=>e.filter(n,t.chart.data)))),e.sort&&(n=n.sort(((n,r)=>e.sort(n,r,t.chart.data)))),t.options.reverse&&n.reverse(),t.legendItems=n}fit(){const t=this,{options:e,ctx:n}=t;if(!e.display)return void(t.width=t.height=0);const r=e.labels,a=Pe(r.font),i=a.size,o=t._computeTitleHeight(),{boxWidth:s,itemHeight:l}=mi(r,i);let c,u;n.font=a.string,t.isHorizontal()?(c=t.maxWidth,u=t._fitRows(o,i,s,l)+10):(u=t.maxHeight,c=t._fitCols(o,i,s,l)+10),t.width=Math.min(c,e.maxWidth||t.maxWidth),t.height=Math.min(u,e.maxHeight||t.maxHeight)}_fitRows(t,e,n,r){const a=this,{ctx:i,maxWidth:o,options:{labels:{padding:s}}}=a,l=a.legendHitBoxes=[],c=a.lineWidths=[0],u=r+s;let d=t;i.textAlign="left",i.textBaseline="middle";let h=-1,p=-u;return a.legendItems.forEach(((t,a)=>{const f=n+e/2+i.measureText(t.text).width;(0===a||c[c.length-1]+f+2*s>o)&&(d+=u,c[c.length-(a>0?0:1)]=0,p+=u,h++),l[a]={left:0,top:p,row:h,width:f,height:r},c[c.length-1]+=f+s})),d}_fitCols(t,e,n,r){const a=this,{ctx:i,maxHeight:o,options:{labels:{padding:s}}}=a,l=a.legendHitBoxes=[],c=a.columnSizes=[],u=o-t;let d=s,h=0,p=0,f=0,g=0;return a.legendItems.forEach(((t,a)=>{const o=n+e/2+i.measureText(t.text).width;a>0&&p+r+2*s>u&&(d+=h+s,c.push({width:h,height:p}),f+=h+s,g++,h=p=0),l[a]={left:f,top:p,col:g,width:o,height:r},h=Math.max(h,o),p+=r+s})),d+=h,c.push({width:h,height:p}),d}adjustHitBoxes(){const t=this;if(!t.options.display)return;const e=t._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:a},rtl:i}}=t,o=vn(i,t.left,t.width);if(this.isHorizontal()){let i=0,s=C(r,t.left+a,t.right-t.lineWidths[i]);for(const l of n)i!==l.row&&(i=l.row,s=C(r,t.left+a,t.right-t.lineWidths[i])),l.top+=t.top+e+a,l.left=o.leftForLtr(o.x(s),l.width),s+=l.width+a}else{let i=0,s=C(r,t.top+e+a,t.bottom-t.columnSizes[i].height);for(const l of n)l.col!==i&&(i=l.col,s=C(r,t.top+e+a,t.bottom-t.columnSizes[i].height)),l.top=s,l.left+=t.left+a,l.left=o.leftForLtr(o.x(l.left),l.width),s+=l.height+a}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){const t=this;if(t.options.display){const e=t.ctx;pe(e,t),t._draw(),fe(e)}}_draw(){const t=this,{options:e,columnSizes:n,lineWidths:r,ctx:a}=t,{align:i,labels:o}=e,s=oe.color,l=vn(e.rtl,t.left,t.width),c=Pe(o.font),{color:u,padding:d}=o,h=c.size,p=h/2;let f;t.drawTitle(),a.textAlign=l.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:b}=mi(o,h),x=t.isHorizontal(),_=this._computeTitleHeight();f=x?{x:C(i,t.left+d,t.right-r[0]),y:t.top+d+_,line:0}:{x:t.left+d,y:C(i,t.top+_+d,t.bottom-n[0].height),line:0},yn(t.ctx,e.textDirection);const v=b+d;t.legendItems.forEach(((y,w)=>{a.strokeStyle=y.fontColor||u,a.fillStyle=y.fontColor||u;const k=a.measureText(y.text).width,S=l.textAlign(y.textAlign||(y.textAlign=o.textAlign)),E=g+p+k;let M=f.x,P=f.y;l.setWidth(t.width),x?w>0&&M+E+d>t.right&&(P=f.y+=v,f.line++,M=f.x=C(i,t.left+d,t.right-r[f.line])):w>0&&P+v>t.bottom&&(M=f.x=M+n[f.line].width+d,f.line++,P=f.y=C(i,t.top+_+d,t.bottom-n[f.line].height)),function(t,e,n){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;a.save();const r=R(n.lineWidth,1);if(a.fillStyle=R(n.fillStyle,s),a.lineCap=R(n.lineCap,"butt"),a.lineDashOffset=R(n.lineDashOffset,0),a.lineJoin=R(n.lineJoin,"miter"),a.lineWidth=r,a.strokeStyle=R(n.strokeStyle,s),a.setLineDash(R(n.lineDash,[])),o.usePointStyle){const i={radius:g*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},o=l.xPlus(t,g/2);de(a,i,o,e+p)}else{const i=e+Math.max((h-m)/2,0),o=l.leftForLtr(t,g),s=Me(n.borderRadius);a.beginPath(),Object.values(s).some((t=>0!==t))?_e(a,{x:o,y:i,w:g,h:m,radius:s}):a.rect(o,i,g,m),a.fill(),0!==r&&a.stroke()}a.restore()}(l.x(M),P,y),M=((t,e,n,r)=>t===(r?"left":"right")?n:"center"===t?(e+n)/2:e)(S,M+g+p,x?M+E:t.right,e.rtl),function(t,e,n){be(a,n.text,t,e+b/2,c,{strikethrough:n.hidden,textAlign:l.textAlign(n.textAlign)})}(l.x(M),P,y),x?f.x+=E+d:f.y+=v})),wn(t.ctx,e.textDirection)}drawTitle(){const t=this,e=t.options,n=e.title,r=Pe(n.font),a=Ce(n.padding);if(!n.display)return;const i=vn(e.rtl,t.left,t.width),o=t.ctx,s=n.position,l=r.size/2,c=a.top+l;let u,d=t.left,h=t.width;if(this.isHorizontal())h=Math.max(...t.lineWidths),u=t.top+c,d=C(e.align,d,t.right-h);else{const n=t.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);u=c+C(e.align,t.top,t.bottom-n-e.labels.padding-t._computeTitleHeight())}const p=C(s,d,d+h);o.textAlign=i.textAlign(M(s)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,be(o,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,e=Pe(t.font),n=Ce(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){const n=this;let r,a,i;if(t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom)for(i=n.legendHitBoxes,r=0;r<i.length;++r)if(a=i[r],t>=a.left&&t<=a.left+a.width&&e>=a.top&&e<=a.top+a.height)return n.legendItems[r];return null}handleEvent(t){const e=this,n=e.options;if(!function(t,e){return!("mousemove"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,n))return;const r=e._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const o=e._hoveredItem,s=(i=r,null!==(a=o)&&null!==i&&a.datasetIndex===i.datasetIndex&&a.index===i.index);o&&!s&&N(n.onLeave,[t,o,e],e),e._hoveredItem=r,r&&!s&&N(n.onHover,[t,r,e],e)}else r&&N(n.onClick,[t,r,e],e);var a,i}}var xi={id:"legend",_element:bi,start(t,e,n){const r=t.legend=new bi({ctx:t.ctx,options:n,chart:t});Or.configure(t,r,n),Or.addBox(t,r)},stop(t){Or.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;Or.configure(t,r,n),r.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const r=e.datasetIndex,a=n.chart;a.isDatasetVisible(r)?(a.hide(r),e.hidden=!0):(a.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:a,color:i}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const o=t.controller.getStyle(n?0:void 0),s=Ce(o.borderWidth);return{text:e[t.index].label,fillStyle:o.backgroundColor,fontColor:i,hidden:!t.visible,lineCap:o.borderCapStyle,lineDash:o.borderDash,lineDashOffset:o.borderDashOffset,lineJoin:o.borderJoinStyle,lineWidth:(s.width+s.height)/4,strokeStyle:o.borderColor,pointStyle:r||o.pointStyle,rotation:o.rotation,textAlign:a||o.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class _i extends Yr{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this,r=n.options;if(n.left=0,n.top=0,!r.display)return void(n.width=n.height=n.right=n.bottom=0);n.width=n.right=t,n.height=n.bottom=e;const a=L(r.text)?r.text.length:1;n._padding=Ce(r.padding);const i=a*Pe(r.font).lineHeight+n._padding.height;n.isHorizontal()?n.height=i:n.width=i}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:n,bottom:r,right:a,options:i}=this,o=i.align;let s,l,c,u=0;return this.isHorizontal()?(l=C(o,n,a),c=e+t,s=a-n):("left"===i.position?(l=n+t,c=C(o,r,e),u=-.5*Z):(l=a-t,c=C(o,e,r),u=.5*Z),s=r-e),{titleX:l,titleY:c,maxWidth:s,rotation:u}}draw(){const t=this,e=t.ctx,n=t.options;if(!n.display)return;const r=Pe(n.font),a=r.lineHeight/2+t._padding.top,{titleX:i,titleY:o,maxWidth:s,rotation:l}=t._drawArgs(a);be(e,n.text,0,0,r,{color:n.color,maxWidth:s,rotation:l,textAlign:M(n.align),textBaseline:"middle",translation:[i,o]})}}var vi={id:"title",_element:_i,start(t,e,n){!function(t,e){const n=new _i({ctx:t.ctx,options:e,chart:t});Or.configure(t,n,e),Or.addBox(t,n),t.titleBlock=n}(t,n)},stop(t){const e=t.titleBlock;Or.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const r=t.titleBlock;Or.configure(t,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}};const yi=new WeakMap;var wi={id:"subtitle",start(t,e,n){const r=new _i({ctx:t.ctx,options:n,chart:t});Or.configure(t,r,n),Or.addBox(t,r),yi.set(t,r)},stop(t){Or.removeBox(t,yi.get(t)),yi.delete(t)},beforeUpdate(t,e,n){const r=yi.get(t);Or.configure(t,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ki={average(t){if(!t.length)return!1;let e,n,r=0,a=0,i=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();r+=t.x,a+=t.y,++i}}return{x:r/i,y:a/i}},nearest(t,e){if(!t.length)return!1;let n,r,a,i=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(n=0,r=t.length;n<r;++n){const r=t[n].element;if(r&&r.hasValue()){const t=gt(e,r.getCenterPoint());t<s&&(s=t,a=r)}}if(a){const t=a.tooltipPosition();i=t.x,o=t.y}return{x:i,y:o}}};function Si(t,e){return e&&(L(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ei(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Mi(t,e){const{element:n,datasetIndex:r,index:a}=e,i=t.getDatasetMeta(r).controller,{label:o,value:s}=i.getLabelAndValue(a);return{chart:t,label:o,parsed:i.getParsed(a),raw:t.data.datasets[r].data[a],formattedValue:s,dataset:i.getDataset(),dataIndex:a,datasetIndex:r,element:n}}function Ci(t,e){const n=t._chart.ctx,{body:r,footer:a,title:i}=t,{boxWidth:o,boxHeight:s}=e,l=Pe(e.bodyFont),c=Pe(e.titleFont),u=Pe(e.footerFont),d=i.length,h=a.length,p=r.length,f=Ce(e.padding);let g=f.height,m=0,b=r.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(g+=p*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(b-p)*l.lineHeight+(b-1)*e.bodySpacing),h&&(g+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let x=0;const _=function(t){m=Math.max(m,n.measureText(t).width+x)};return n.save(),n.font=c.string,j(t.title,_),n.font=l.string,j(t.beforeBody.concat(t.afterBody),_),x=e.displayColors?o+2:0,j(r,(t=>{j(t.before,_),j(t.lines,_),j(t.after,_)})),x=0,n.font=u.string,j(t.footer,_),n.restore(),m+=f.width,{width:m,height:g}}function Pi(t,e,n,r){const{x:a,width:i}=n,{width:o,chartArea:{left:s,right:l}}=t;let c="center";return"center"===r?c=a<=(s+l)/2?"left":"right":a<=i/2?c="left":a>=o-i/2&&(c="right"),function(t,e,n,r){const{x:a,width:i}=r,o=n.caretSize+n.caretPadding;return"left"===t&&a+i+o>e.width||"right"===t&&a-i-o<0||void 0}(c,t,e,n)&&(c="center"),c}function Di(t,e,n){const r=e.yAlign||function(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}(t,n);return{xAlign:e.xAlign||Pi(t,e,n,r),yAlign:r}}function Oi(t,e,n,r){const{caretSize:a,caretPadding:i,cornerRadius:o}=t,{xAlign:s,yAlign:l}=n,c=a+i,u=o+i;let d=function(t,e){let{x:n,width:r}=t;return"right"===e?n-=r:"center"===e&&(n-=r/2),n}(e,s);const h=function(t,e,n){let{y:r,height:a}=t;return"top"===e?r+=n:r-="bottom"===e?a+n:a/2,r}(e,l,c);return"center"===l?"left"===s?d+=c:"right"===s&&(d-=c):"left"===s?d-=u:"right"===s&&(d+=u),{x:_t(d,0,r.width-e.width),y:_t(h,0,r.height-e.height)}}function Li(t,e,n){const r=Ce(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-r.right:t.x+r.left}function Ti(t){return Si([],Ei(t))}function Ai(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}class Ii extends Yr{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this,e=t._cachedAnimations;if(e)return e;const n=t._chart,r=t.options.setContext(t.getContext()),a=r.enabled&&n.options.animation&&r.animations,i=new In(t._chart,a);return a._cacheable&&(t._cachedAnimations=Object.freeze(i)),i}getContext(){const t=this;return t.$context||(t.$context=(e=t._chart.getContext(),n=t,r=t._tooltipItems,Object.assign(Object.create(e),{tooltip:n,tooltipItems:r,type:"tooltip"})));var e,n,r}getTitle(t,e){const n=this,{callbacks:r}=e,a=r.beforeTitle.apply(n,[t]),i=r.title.apply(n,[t]),o=r.afterTitle.apply(n,[t]);let s=[];return s=Si(s,Ei(a)),s=Si(s,Ei(i)),s=Si(s,Ei(o)),s}getBeforeBody(t,e){return Ti(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const n=this,{callbacks:r}=e,a=[];return j(t,(t=>{const e={before:[],lines:[],after:[]},i=Ai(r,t);Si(e.before,Ei(i.beforeLabel.call(n,t))),Si(e.lines,i.label.call(n,t)),Si(e.after,Ei(i.afterLabel.call(n,t))),a.push(e)})),a}getAfterBody(t,e){return Ti(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const n=this,{callbacks:r}=e,a=r.beforeFooter.apply(n,[t]),i=r.footer.apply(n,[t]),o=r.afterFooter.apply(n,[t]);let s=[];return s=Si(s,Ei(a)),s=Si(s,Ei(i)),s=Si(s,Ei(o)),s}_createItems(t){const e=this,n=e._active,r=e._chart.data,a=[],i=[],o=[];let s,l,c=[];for(s=0,l=n.length;s<l;++s)c.push(Mi(e._chart,n[s]));return t.filter&&(c=c.filter(((e,n,a)=>t.filter(e,n,a,r)))),t.itemSort&&(c=c.sort(((e,n)=>t.itemSort(e,n,r)))),j(c,(n=>{const r=Ai(t.callbacks,n);a.push(r.labelColor.call(e,n)),i.push(r.labelPointStyle.call(e,n)),o.push(r.labelTextColor.call(e,n))})),e.labelColors=a,e.labelPointStyles=i,e.labelTextColors=o,e.dataPoints=c,c}update(t,e){const n=this,r=n.options.setContext(n.getContext()),a=n._active;let i,o=[];if(a.length){const t=ki[r.position].call(n,a,n._eventPosition);o=n._createItems(r),n.title=n.getTitle(o,r),n.beforeBody=n.getBeforeBody(o,r),n.body=n.getBody(o,r),n.afterBody=n.getAfterBody(o,r),n.footer=n.getFooter(o,r);const e=n._size=Ci(n,r),s=Object.assign({},t,e),l=Di(n._chart,r,s),c=Oi(r,s,l,n._chart);n.xAlign=l.xAlign,n.yAlign=l.yAlign,i={opacity:1,x:c.x,y:c.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==n.opacity&&(i={opacity:0});n._tooltipItems=o,n.$context=void 0,i&&n._resolveAnimations().update(n,i),t&&r.external&&r.external.call(n,{chart:n._chart,tooltip:n,replay:e})}drawCaret(t,e,n,r){const a=this.getCaretPosition(t,n,r);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,n){const{xAlign:r,yAlign:a}=this,{cornerRadius:i,caretSize:o}=n,{x:s,y:l}=t,{width:c,height:u}=e;let d,h,p,f,g,m;return"center"===a?(g=l+u/2,"left"===r?(d=s,h=d-o,f=g+o,m=g-o):(d=s+c,h=d+o,f=g-o,m=g+o),p=d):(h="left"===r?s+i+o:"right"===r?s+c-i-o:this.caretX,"top"===a?(f=l,g=f-o,d=h-o,p=h+o):(f=l+u,g=f+o,d=h+o,p=h-o),m=f),{x1:d,x2:h,x3:p,y1:f,y2:g,y3:m}}drawTitle(t,e,n){const r=this,a=r.title,i=a.length;let o,s,l;if(i){const c=vn(n.rtl,r.x,r.width);for(t.x=Li(r,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",o=Pe(n.titleFont),s=n.titleSpacing,e.fillStyle=n.titleColor,e.font=o.string,l=0;l<i;++l)e.fillText(a[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+s,l+1===i&&(t.y+=n.titleMarginBottom-s)}}_drawColorBox(t,e,n,r,a){const i=this,o=i.labelColors[n],s=i.labelPointStyles[n],{boxHeight:l,boxWidth:c}=a,u=Pe(a.bodyFont),d=Li(i,"left",a),h=r.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,f=e.y+p;if(a.usePointStyle){const e={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},n=r.leftForLtr(h,c)+c/2,i=f+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,de(t,e,n,i),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,de(t,e,n,i)}else{t.lineWidth=o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=r.leftForLtr(h,c),n=r.leftForLtr(r.xPlus(h,1),c-2),i=Me(o.borderRadius);Object.values(i).some((t=>0!==t))?(t.beginPath(),t.fillStyle=a.multiKeyBackground,_e(t,{x:e,y:f,w:c,h:l,radius:i}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),_e(t,{x:n,y:f+1,w:c-2,h:l-2,radius:i}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(e,f,c,l),t.strokeRect(e,f,c,l),t.fillStyle=o.backgroundColor,t.fillRect(n,f+1,c-2,l-2))}t.fillStyle=i.labelTextColors[n]}drawBody(t,e,n){const r=this,{body:a}=r,{bodySpacing:i,bodyAlign:o,displayColors:s,boxHeight:l,boxWidth:c}=n,u=Pe(n.bodyFont);let d=u.lineHeight,h=0;const p=vn(n.rtl,r.x,r.width),f=function(n){e.fillText(n,p.x(t.x+h),t.y+d/2),t.y+=d+i},g=p.textAlign(o);let m,b,x,_,v,y,w;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=Li(r,g,n),e.fillStyle=n.bodyColor,j(r.beforeBody,f),h=s&&"right"!==g?"center"===o?c/2+1:c+2:0,_=0,y=a.length;_<y;++_){for(m=a[_],b=r.labelTextColors[_],e.fillStyle=b,j(m.before,f),x=m.lines,s&&x.length&&(r._drawColorBox(e,t,_,p,n),d=Math.max(u.lineHeight,l)),v=0,w=x.length;v<w;++v)f(x[v]),d=u.lineHeight;j(m.after,f)}h=0,d=u.lineHeight,j(r.afterBody,f),t.y-=i}drawFooter(t,e,n){const r=this,a=r.footer,i=a.length;let o,s;if(i){const l=vn(n.rtl,r.x,r.width);for(t.x=Li(r,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",o=Pe(n.footerFont),e.fillStyle=n.footerColor,e.font=o.string,s=0;s<i;++s)e.fillText(a[s],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+n.footerSpacing}}drawBackground(t,e,n,r){const{xAlign:a,yAlign:i}=this,{x:o,y:s}=t,{width:l,height:c}=n,u=r.cornerRadius;e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(o+u,s),"top"===i&&this.drawCaret(t,e,n,r),e.lineTo(o+l-u,s),e.quadraticCurveTo(o+l,s,o+l,s+u),"center"===i&&"right"===a&&this.drawCaret(t,e,n,r),e.lineTo(o+l,s+c-u),e.quadraticCurveTo(o+l,s+c,o+l-u,s+c),"bottom"===i&&this.drawCaret(t,e,n,r),e.lineTo(o+u,s+c),e.quadraticCurveTo(o,s+c,o,s+c-u),"center"===i&&"left"===a&&this.drawCaret(t,e,n,r),e.lineTo(o,s+u),e.quadraticCurveTo(o,s,o+u,s),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this,n=e._chart,r=e.$animations,a=r&&r.x,i=r&&r.y;if(a||i){const r=ki[t.position].call(e,e._active,e._eventPosition);if(!r)return;const o=e._size=Ci(e,t),s=Object.assign({},r,e._size),l=Di(n,t,s),c=Oi(t,s,l,n);a._to===c.x&&i._to===c.y||(e.xAlign=l.xAlign,e.yAlign=l.yAlign,e.width=o.width,e.height=o.height,e.caretX=r.x,e.caretY=r.y,e._resolveAnimations().update(e,c))}}draw(t){const e=this,n=e.options.setContext(e.getContext());let r=e.opacity;if(!r)return;e._updateAnimationTarget(n);const a={width:e.width,height:e.height},i={x:e.x,y:e.y};r=Math.abs(r)<.001?0:r;const o=Ce(n.padding),s=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,e.drawBackground(i,t,a,n),yn(t,n.textDirection),i.y+=o.top,e.drawTitle(i,t,n),e.drawBody(i,t,n),e.drawFooter(i,t,n),wn(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this,r=n._active,a=t.map((({datasetIndex:t,index:e})=>{const r=n._chart.getDatasetMeta(t);if(!r)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:r.data[e],index:e}})),i=!F(r,a),o=n._positionChanged(a,e);(i||o)&&(n._active=a,n._eventPosition=e,n.update(!0))}handleEvent(t,e){const n=this,r=n.options,a=n._active||[];let i=!1,o=[];"mouseout"!==t.type&&(o=n._chart.getElementsAtEventForMode(t,r.mode,r,e),r.reverse&&o.reverse());const s=n._positionChanged(o,t);return i=e||!F(o,a)||s,i&&(n._active=o,(r.enabled||r.external)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0,e))),i}_positionChanged(t,e){const{caretX:n,caretY:r,options:a}=this,i=ki[a.position].call(this,t,e);return!1!==i&&(n!==i.x||r!==i.y)}}Ii.positioners=ki;var Ri={id:"tooltip",_element:Ii,positioners:ki,afterInit(t,e,n){n&&(t.tooltip=new Ii({_chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip,n={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",n)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n))},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!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:{beforeTitle:P,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:P,beforeBody:P,beforeLabel:P,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return O(n)||(e+=n),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:P,afterBody:P,beforeFooter:P,footer:P,afterFooter:P}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},zi=Object.freeze({__proto__:null,Decimation:Ja,Filler:gi,Legend:xi,SubTitle:wi,Title:vi,Tooltip:Ri});class Ni extends ra{constructor(t){super(t),this._startValue=void 0,this._valueRange=0}parse(t,e){if(O(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:_t(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:function(t,e,n){const r=t.indexOf(e);return-1===r?((t,e,n)=>"string"==typeof e?t.push(e)-1:isNaN(e)?null:n)(t,e,n):r!==t.lastIndexOf(e)?n:r}(n,t,R(e,t)),n.length-1)}determineDataLimits(){const t=this,{minDefined:e,maxDefined:n}=t.getUserBounds();let{min:r,max:a}=t.getMinMax(!0);"ticks"===t.options.bounds&&(e||(r=0),n||(a=t.getLabels().length-1)),t.min=r,t.max=a}buildTicks(){const t=this,e=t.min,n=t.max,r=t.options.offset,a=[];let i=t.getLabels();i=0===e&&n===i.length-1?i:i.slice(e,n+1),t._valueRange=Math.max(i.length-(r?0:1),1),t._startValue=t.min-(r?.5:0);for(let t=e;t<=n;t++)a.push({value:t});return a}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){const t=this;super.configure(),t.isHorizontal()||(t._reversePixels=!t._reversePixels)}getPixelForValue(t){const e=this;return"number"!=typeof t&&(t=e.parse(t)),null===t?NaN:e.getPixelForDecimal((t-e._startValue)/e._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){const e=this;return Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange)}getBasePixel(){return this.bottom}}function ji(t,e,{horizontal:n,minRotation:r}){const a=ht(r),i=(n?Math.sin(a):Math.cos(a))||.001,o=.75*e*(""+t).length;return Math.min(e/i,o)}Ni.id="category",Ni.defaults={ticks:{callback:Ni.prototype.getLabelForValue}};class Fi extends ra{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return O(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const t=this,{beginAtZero:e}=t.options,{minDefined:n,maxDefined:r}=t.getUserBounds();let{min:a,max:i}=t;const o=t=>a=n?a:t,s=t=>i=r?i:t;if(e){const t=st(a),e=st(i);t<0&&e<0?s(0):t>0&&e>0&&o(0)}if(a===i){let t=1;(i>=Number.MAX_SAFE_INTEGER||a<=Number.MIN_SAFE_INTEGER)&&(t=Math.abs(.05*i)),s(i+t),e||o(a-t)}t.min=a,t.max=i}getTickLimit(){const t=this,e=t.options.ticks;let n,{maxTicksLimit:r,stepSize:a}=e;return a?n=Math.ceil(t.max/a)-Math.floor(t.min/a)+1:(n=t.computeTickLimit(),r=r||11),r&&(n=Math.min(r,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this,e=t.options,n=e.ticks;let r=t.getTickLimit();r=Math.max(2,r);const a=function(t,e){const n=[],{bounds:r,step:a,min:i,max:o,precision:s,count:l,maxTicks:c,maxDigits:u,includeBounds:d}=t,h=a||1,p=c-1,{min:f,max:g}=e,m=!O(i),b=!O(o),x=!O(l),_=(g-f)/(u+1);let v,y,w,k,S=lt((g-f)/p/h)*h;if(S<1e-14&&!m&&!b)return[{value:f},{value:g}];k=Math.ceil(g/S)-Math.floor(f/S),k>p&&(S=lt(k*S/p/h)*h),O(s)||(v=Math.pow(10,s),S=Math.ceil(S*v)/v),"ticks"===r?(y=Math.floor(f/S)*S,w=Math.ceil(g/S)*S):(y=f,w=g),m&&b&&a&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((o-i)/a,S/1e3)?(k=Math.round(Math.min((o-i)/S,c)),S=(o-i)/k,y=i,w=o):x?(y=m?i:y,w=b?o:w,k=l-1,S=(w-y)/k):(k=(w-y)/S,k=ut(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const E=Math.max(ft(S),ft(y));v=Math.pow(10,O(s)?E:s),y=Math.round(y*v)/v,w=Math.round(w*v)/v;let M=0;for(m&&(d&&y!==i?(n.push({value:i}),y<i&&M++,ut(Math.round((y+M*S)*v)/v,i,ji(i,_,t))&&M++):y<i&&M++);M<k;++M)n.push({value:Math.round((y+M*S)*v)/v});return b&&d&&w!==o?ut(n[n.length-1].value,o,ji(o,_,t))?n[n.length-1].value=o:n.push({value:o}):b&&w!==o||n.push({value:w}),n}({maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:t._maxDigits(),horizontal:t.isHorizontal(),minRotation:n.minRotation||0,includeBounds:!1!==n.includeBounds},t._range||t);return"ticks"===e.bounds&&dt(a,t,"value"),e.reverse?(a.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),a}configure(){const t=this,e=t.ticks;let n=t.min,r=t.max;if(super.configure(),t.options.offset&&e.length){const t=(r-n)/Math.max(e.length-1,1)/2;n-=t,r+=t}t._startValue=n,t._endValue=r,t._valueRange=r-n}getLabelForValue(t){return xn(t,this.chart.options.locale)}}class Bi extends Fi{determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!0);t.min=A(e)?e:0,t.max=A(n)?n:1,t.handleTickRangeOptions()}computeTickLimit(){const t=this,e=t.isHorizontal(),n=e?t.width:t.height,r=ht(t.options.ticks.minRotation),a=(e?Math.sin(r):Math.cos(r))||.001,i=t._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/a))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Vi(t){return 1==t/Math.pow(10,Math.floor(ot(t)))}Bi.id="linear",Bi.defaults={ticks:{callback:Gr.formatters.numeric}};class Wi extends ra{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=Fi.prototype.parse.apply(this,[t,e]);if(0!==n)return A(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!0);t.min=A(e)?Math.max(0,e):null,t.max=A(n)?Math.max(0,n):null,t.options.beginAtZero&&(t._zero=!0),t.handleTickRangeOptions()}handleTickRangeOptions(){const t=this,{minDefined:e,maxDefined:n}=t.getUserBounds();let r=t.min,a=t.max;const i=t=>r=e?r:t,o=t=>a=n?a:t,s=(t,e)=>Math.pow(10,Math.floor(ot(t))+e);r===a&&(r<=0?(i(1),o(10)):(i(s(r,-1)),o(s(a,1)))),r<=0&&i(s(a,-1)),a<=0&&o(s(r,1)),t._zero&&t.min!==t._suggestedMin&&r===s(t.min,0)&&i(s(r,-1)),t.min=r,t.max=a}buildTicks(){const t=this,e=t.options,n=function(t,e){const n=Math.floor(ot(e.max)),r=Math.ceil(e.max/Math.pow(10,n)),a=[];let i=I(t.min,Math.pow(10,Math.floor(ot(e.min)))),o=Math.floor(ot(i)),s=Math.floor(i/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{a.push({value:i,major:Vi(i)}),++s,10===s&&(s=1,++o,l=o>=0?1:l),i=Math.round(s*Math.pow(10,o)*l)/l}while(o<n||o===n&&s<r);const c=I(t.max,i);return a.push({value:c,major:Vi(i)}),a}({min:t._userMin,max:t._userMax},t);return"ticks"===e.bounds&&dt(n,t,"value"),e.reverse?(n.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n}getLabelForValue(t){return void 0===t?"0":xn(t,this.chart.options.locale)}configure(){const t=this,e=t.min;super.configure(),t._startValue=ot(e),t._valueRange=ot(t.max)-ot(e)}getPixelForValue(t){const e=this;return void 0!==t&&0!==t||(t=e.min),null===t||isNaN(t)?NaN:e.getPixelForDecimal(t===e.min?0:(ot(t)-e._startValue)/e._valueRange)}getValueForPixel(t){const e=this,n=e.getDecimalForPixel(t);return Math.pow(10,e._startValue+n*e._valueRange)}}function Hi(t){const e=t.ticks;if(e.display&&t.display){const t=Ce(e.backdropPadding);return R(e.font&&e.font.size,oe.font.size)+t.height}return 0}function $i(t,e,n,r,a){return t===r||t===a?{start:e-n/2,end:e+n/2}:t<r||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function Ui(t){return 0===t||180===t?"center":t<180?"left":"right"}function qi(t,e,n){return 90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e),t}function Yi(t,e,n,r){const{ctx:a}=t;if(n)a.arc(t.xCenter,t.yCenter,e,0,J);else{let n=t.getPointPosition(0,e);a.moveTo(n.x,n.y);for(let i=1;i<r;i++)n=t.getPointPosition(i,e),a.lineTo(n.x,n.y)}}function Xi(t){return ct(t)?t:0}Wi.id="logarithmic",Wi.defaults={ticks:{callback:Gr.formatters.logarithmic,major:{enabled:!0}}};class Gi extends Fi{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Hi(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2}determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!1);t.min=A(e)&&!isNaN(e)?e:0,t.max=A(n)&&!isNaN(n)?n:0,t.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Hi(this.options))}generateTickLabels(t){const e=this;Fi.prototype.generateTickLabels.call(e,t),e._pointLabels=e.getLabels().map(((t,n)=>{const r=N(e.options.pointLabels.callback,[t,n],e);return r||0===r?r:""}))}fit(){const t=this,e=t.options;e.display&&e.pointLabels.display?function(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},n={},r=[],a=[],i=t.getLabels().length;for(let c=0;c<i;c++){const i=t.options.pointLabels.setContext(t.getPointLabelContext(c));a[c]=i.padding;const u=t.getPointPosition(c,t.drawingArea+a[c]),d=Pe(i.font),h=(o=t.ctx,s=d,l=L(l=t._pointLabels[c])?l:[l],{w:le(o,s.string,l),h:l.length*s.lineHeight});r[c]=h;const p=t.getIndexAngle(c),f=pt(p),g=$i(f,u.x,h.w,0,180),m=$i(f,u.y,h.h,90,270);g.start<e.l&&(e.l=g.start,n.l=p),g.end>e.r&&(e.r=g.end,n.r=p),m.start<e.t&&(e.t=m.start,n.t=p),m.end>e.b&&(e.b=m.end,n.b=p)}var o,s,l;t._setReductions(t.drawingArea,e,n),t._pointLabelItems=function(t,e,n){const r=[],a=t.getLabels().length,i=t.options,o=Hi(i),s=t.getDistanceFromCenterForValue(i.ticks.reverse?t.min:t.max);for(let i=0;i<a;i++){const a=0===i?o/2:0,d=t.getPointPosition(i,s+a+n[i]),h=pt(t.getIndexAngle(i)),p=e[i],f=qi(d.y,p.h,h),g=Ui(h),m=(l=d.x,c=p.w,"right"===(u=g)?l-=c:"center"===u&&(l-=c/2),l);r.push({x:d.x,y:f,textAlign:g,left:m,top:f,right:m+p.w,bottom:f+p.h})}var l,c,u;return r}(t,r,a)}(t):t.setCenterPoint(0,0,0,0)}_setReductions(t,e,n){const r=this;let a=e.l/Math.sin(n.l),i=Math.max(e.r-r.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(r.height-r.paddingTop),0)/Math.cos(n.b);a=Xi(a),i=Xi(i),o=Xi(o),s=Xi(s),r.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(a+i)/2),Math.floor(t-(o+s)/2))),r.setCenterPoint(a,i,o,s)}setCenterPoint(t,e,n,r){const a=this,i=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-a.paddingTop-r-a.drawingArea;a.xCenter=Math.floor((o+i)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)}getIndexAngle(t){return bt(t*(J/this.getLabels().length)+ht(this.options.startAngle||0))}getDistanceFromCenterForValue(t){const e=this;if(O(t))return NaN;const n=e.drawingArea/(e.max-e.min);return e.options.reverse?(e.max-t)*n:(t-e.min)*n}getValueForDistanceFromCenter(t){if(O(t))return NaN;const e=this,n=t/(e.drawingArea/(e.max-e.min));return e.options.reverse?e.max-n:e.min+n}getPointLabelContext(t){const e=this,n=e._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return function(t,e,n){return Object.assign(Object.create(t),{label:n,index:e,type:"pointLabel"})}(e.getContext(),t,r)}}getPointPosition(t,e){const n=this,r=n.getIndexAngle(t)-rt;return{x:Math.cos(r)*e+n.xCenter,y:Math.sin(r)*e+n.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:r,bottom:a}=this._pointLabelItems[t];return{left:e,top:n,right:r,bottom:a}}drawBackground(){const t=this,{backgroundColor:e,grid:{circular:n}}=t.options;if(e){const r=t.ctx;r.save(),r.beginPath(),Yi(t,t.getDistanceFromCenterForValue(t._endValue),n,t.getLabels().length),r.closePath(),r.fillStyle=e,r.fill(),r.restore()}}drawGrid(){const t=this,e=t.ctx,n=t.options,{angleLines:r,grid:a}=n,i=t.getLabels().length;let o,s,l;if(n.pointLabels.display&&function(t,e){const{ctx:n,options:{pointLabels:r}}=t;for(let a=e-1;a>=0;a--){const e=r.setContext(t.getPointLabelContext(a)),i=Pe(e.font),{x:o,y:s,textAlign:l,left:c,top:u,right:d,bottom:h}=t._pointLabelItems[a],{backdropColor:p}=e;if(!O(p)){const t=Ce(e.backdropPadding);n.fillStyle=p,n.fillRect(c-t.left,u-t.top,d-c+t.width,h-u+t.height)}be(n,t._pointLabels[a],o,s+i.lineHeight/2,i,{color:e.color,textAlign:l,textBaseline:"middle"})}}(t,i),a.display&&t.ticks.forEach(((e,n)=>{if(0!==n){s=t.getDistanceFromCenterForValue(e.value);const r=a.setContext(t.getContext(n-1));!function(t,e,n,r){const a=t.ctx,i=e.circular,{color:o,lineWidth:s}=e;!i&&!r||!o||!s||n<0||(a.save(),a.strokeStyle=o,a.lineWidth=s,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),Yi(t,n,i,r),a.closePath(),a.stroke(),a.restore())}(t,r,s,i)}})),r.display){for(e.save(),o=t.getLabels().length-1;o>=0;o--){const a=r.setContext(t.getPointLabelContext(o)),{color:i,lineWidth:c}=a;c&&i&&(e.lineWidth=c,e.strokeStyle=i,e.setLineDash(a.borderDash),e.lineDashOffset=a.borderDashOffset,s=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),l=t.getPointPosition(o,s),e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const t=this,e=t.ctx,n=t.options,r=n.ticks;if(!r.display)return;const a=t.getIndexAngle(0);let i,o;e.save(),e.translate(t.xCenter,t.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",t.ticks.forEach(((a,s)=>{if(0===s&&!n.reverse)return;const l=r.setContext(t.getContext(s)),c=Pe(l.font);if(i=t.getDistanceFromCenterForValue(t.ticks[s].value),l.showLabelBackdrop){e.font=c.string,o=e.measureText(a.label).width,e.fillStyle=l.backdropColor;const t=Ce(l.backdropPadding);e.fillRect(-o/2-t.left,-i-c.size/2-t.top,o+t.width,c.size+t.height)}be(e,a.label,0,-i,c,{color:l.color})})),e.restore()}drawTitle(){}}Gi.id="radialLinear",Gi.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Gr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},Gi.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Gi.descriptors={angleLines:{_fallback:"grid"}};const Qi={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}},Ki=Object.keys(Qi);function Zi(t,e){return t-e}function Ji(t,e){if(O(e))return null;const n=t._adapter,{parser:r,round:a,isoWeekday:i}=t._parseOpts;let o=e;return"function"==typeof r&&(o=r(o)),A(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null===o?null:(a&&(o="week"!==a||!ct(i)&&!0!==i?n.startOf(o,a):n.startOf(o,"isoWeek",i)),+o)}function to(t,e,n,r){const a=Ki.length;for(let i=Ki.indexOf(t);i<a-1;++i){const t=Qi[Ki[i]],a=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((n-e)/(a*t.size))<=r)return Ki[i]}return Ki[a-1]}function eo(t,e,n){if(n){if(n.length){const{lo:r,hi:a}=Oe(n,e);t[n[r]>=e?n[r]:n[a]]=!0}}else t[e]=!0}function no(t,e,n){const r=[],a={},i=e.length;let o,s;for(o=0;o<i;++o)s=e[o],a[s]=o,r.push({value:s,major:!1});return 0!==i&&n?function(t,e,n,r){const a=t._adapter,i=+a.startOf(e[0].value,r),o=e[e.length-1].value;let s,l;for(s=i;s<=o;s=+a.add(s,1,r))l=n[s],l>=0&&(e[l].major=!0);return e}(t,r,a,n):r}class ro extends ra{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const n=t.time||(t.time={}),r=this._adapter=new dr._date(t.adapters.date);$(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Ji(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this,e=t.options,n=t._adapter,r=e.time.unit||"day";let{min:a,max:i,minDefined:o,maxDefined:s}=t.getUserBounds();function l(t){o||isNaN(t.min)||(a=Math.min(a,t.min)),s||isNaN(t.max)||(i=Math.max(i,t.max))}o&&s||(l(t._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||l(t.getMinMax(!1))),a=A(a)&&!isNaN(a)?a:+n.startOf(Date.now(),r),i=A(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,t.min=Math.min(a,i-1),t.max=Math.max(a+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this,e=t.options,n=e.time,r=e.ticks,a="labels"===r.source?t.getLabelTimestamps():t._generate();"ticks"===e.bounds&&a.length&&(t.min=t._userMin||a[0],t.max=t._userMax||a[a.length-1]);const i=t.min,o=function(t,e,n){let r=0,a=t.length;for(;r<a&&t[r]<e;)r++;for(;a>r&&t[a-1]>n;)a--;return r>0||a<t.length?t.slice(r,a):t}(a,i,t.max);return t._unit=n.unit||(r.autoSkip?to(n.minUnit,t.min,t.max,t._getLabelCapacity(i)):function(t,e,n,r,a){for(let i=Ki.length-1;i>=Ki.indexOf(n);i--){const n=Ki[i];if(Qi[n].common&&t._adapter.diff(a,r,n)>=e-1)return n}return Ki[n?Ki.indexOf(n):0]}(t,o.length,n.minUnit,t.min,t.max)),t._majorUnit=r.major.enabled&&"year"!==t._unit?function(t){for(let e=Ki.indexOf(t)+1,n=Ki.length;e<n;++e)if(Qi[Ki[e]].common)return Ki[e]}(t._unit):void 0,t.initOffsets(a),e.reverse&&o.reverse(),no(t,o,t._majorUnit)}initOffsets(t){const e=this;let n,r,a=0,i=0;e.options.offset&&t.length&&(n=e.getDecimalForValue(t[0]),a=1===t.length?1-n:(e.getDecimalForValue(t[1])-n)/2,r=e.getDecimalForValue(t[t.length-1]),i=1===t.length?r:(r-e.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;a=_t(a,0,o),i=_t(i,0,o),e._offsets={start:a,end:i,factor:1/(a+1+i)}}_generate(){const t=this,e=t._adapter,n=t.min,r=t.max,a=t.options,i=a.time,o=i.unit||to(i.minUnit,n,r,t._getLabelCapacity(n)),s=R(i.stepSize,1),l="week"===o&&i.isoWeekday,c=ct(l)||!0===l,u={};let d,h,p=n;if(c&&(p=+e.startOf(p,"isoWeek",l)),p=+e.startOf(p,c?"day":o),e.diff(r,n,o)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+o);const f="data"===a.ticks.source&&t.getDataTimestamps();for(d=p,h=0;d<r;d=+e.add(d,s,o),h++)eo(u,d,f);return d!==r&&"ticks"!==a.bounds&&1!==h||eo(u,d,f),Object.keys(u).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,r){const a=this,i=a.options,o=i.time.displayFormats,s=a._unit,l=a._majorUnit,c=s&&o[s],u=l&&o[l],d=n[e],h=l&&u&&d&&d.major,p=a._adapter.format(t,r||(h?u:c)),f=i.ticks.callback;return f?N(f,[p,e,n],a):p}generateTickLabels(t){let e,n,r;for(e=0,n=t.length;e<n;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){const e=this;return null===t?NaN:(t-e.min)/(e.max-e.min)}getPixelForValue(t){const e=this,n=e._offsets,r=e.getDecimalForValue(t);return e.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const e=this,n=e._offsets,r=e.getDecimalForPixel(t)/n.factor-n.end;return e.min+r*(e.max-e.min)}_getLabelSize(t){const e=this,n=e.options.ticks,r=e.ctx.measureText(t).width,a=ht(e.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(a),o=Math.sin(a),s=e._resolveTickFontOptions(0).size;return{w:r*i+s*o,h:r*o+s*i}}_getLabelCapacity(t){const e=this,n=e.options.time,r=n.displayFormats,a=r[n.unit]||r.millisecond,i=e._tickFormatFunction(t,0,no(e,[t],e._majorUnit),a),o=e._getLabelSize(i),s=Math.floor(e.isHorizontal()?e.width/o.w:e.height/o.h)-1;return s>0?s:1}getDataTimestamps(){const t=this;let e,n,r=t._cache.data||[];if(r.length)return r;const a=t.getMatchingVisibleMetas();if(t._normalized&&a.length)return t._cache.data=a[0].controller.getAllParsedValues(t);for(e=0,n=a.length;e<n;++e)r=r.concat(a[e].controller.getAllParsedValues(t));return t._cache.data=t.normalize(r)}getLabelTimestamps(){const t=this,e=t._cache.labels||[];let n,r;if(e.length)return e;const a=t.getLabels();for(n=0,r=a.length;n<r;++n)e.push(Ji(t,a[n]));return t._cache.labels=t._normalized?e:t.normalize(e)}normalize(t){return Re(t.sort(Zi))}}function ao(t,e,n){let r,a,i,o,s=0,l=t.length-1;n?(e>=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=Le(t,"pos",e)),({pos:r,time:i}=t[s]),({pos:a,time:o}=t[l])):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=Le(t,"time",e)),({time:r,pos:i}=t[s]),({time:a,pos:o}=t[l]));const c=a-r;return c?i+(o-i)*(e-r)/c:i}ro.id="time",ro.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class io extends ro{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this,e=t._getTimestampsForTable(),n=t._table=t.buildLookupTable(e);t._minPos=ao(n,t.min),t._tableRange=ao(n,t.max)-t._minPos,super.initOffsets(e)}buildLookupTable(t){const{min:e,max:n}=this,r=[],a=[];let i,o,s,l,c;for(i=0,o=t.length;i<o;++i)l=t[i],l>=e&&l<=n&&r.push(l);if(r.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(i=0,o=r.length;i<o;++i)c=r[i+1],s=r[i-1],l=r[i],Math.round((c+s)/2)!==l&&a.push({time:l,pos:i/(o-1)});return a}_getTimestampsForTable(){const t=this;let e=t._cache.all||[];if(e.length)return e;const n=t.getDataTimestamps(),r=t.getLabelTimestamps();return e=n.length&&r.length?t.normalize(n.concat(r)):n.length?n:r,e=t._cache.all=e,e}getDecimalForValue(t){return(ao(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this,n=e._offsets,r=e.getDecimalForPixel(t)/n.factor-n.end;return ao(e._table,r*e._tableRange+e._minPos,!0)}}io.id="timeseries",io.defaults=ro.defaults;const oo=[lr,Qa,zi,Object.freeze({__proto__:null,CategoryScale:Ni,LinearScale:Bi,LogarithmicScale:Wi,RadialLinearScale:Gi,TimeScale:ro,TimeSeriesScale:io})];Ca.register(...oo);const so=Ca;var lo=n(5364),co=n.n(lo),uo=n(6139),ho=n.n(uo),po=n(7309),fo=n.n(po);function go(){return go=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},go.apply(this,arguments)}function mo(t,e){if(null==t)return{};var n,r,a={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(a[n]=t[n]);return a}var bo=(0,w.forwardRef)((function(t,e){var n=t.id,r=t.className,a=t.height,i=void 0===a?150:a,o=t.width,s=void 0===o?300:o,l=t.redraw,c=void 0!==l&&l,u=t.type,d=t.data,h=t.options,p=void 0===h?{}:h,f=t.plugins,g=void 0===f?[]:f,m=t.getDatasetAtEvent,b=t.getElementAtEvent,x=t.getElementsAtEvent,_=t.fallbackContent,v=mo(t,["id","className","height","width","redraw","type","data","options","plugins","getDatasetAtEvent","getElementAtEvent","getElementsAtEvent","fallbackContent"]),y=(0,w.useRef)(null),S=(0,w.useMemo)((function(){return"function"==typeof d?y.current?d(y.current):{}:co()({},d)}),[d,y.current]),E=(0,w.useState)(),M=E[0],C=E[1];(0,w.useImperativeHandle)(e,(function(){return M}),[M]);var P=function(){y.current&&C(new so(y.current,{type:u,data:S,options:p,plugins:g}))},D=function(){M&&M.destroy()};return(0,w.useEffect)((function(){return P(),function(){return D()}}),[]),(0,w.useEffect)((function(){c?(D(),setTimeout((function(){P()}),0)):function(){if(M){if(p&&(M.options=go({},p)),!M.config.data)return M.config.data=S,void M.update();var t=S.datasets,e=void 0===t?[]:t,n=mo(S,["datasets"]),r=M.config.data.datasets,a=void 0===r?[]:r;ho()(M.config.data,n),M.config.data.datasets=e.map((function(t){var e=fo()(a,(function(e){return e.label===t.label&&e.type===t.type}));return e&&t.data?(e.data?e.data.length=t.data.length:e.data=[],ho()(e.data,t.data),go({},e,t,{data:e.data})):t})),M.update()}}()}),[t,S]),k().createElement("canvas",Object.assign({},v,{height:i,width:s,ref:y,id:n,className:r,onClick:function(t){M&&(m&&m(M.getElementsAtEventForMode(t,"dataset",{intersect:!0},!1),t),b&&b(M.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1),t),x&&x(M.getElementsAtEventForMode(t,"index",{intersect:!0},!1),t))},"data-testid":"canvas",role:"img"}),_)})),xo=((0,w.forwardRef)((function(t,e){return k().createElement(bo,Object.assign({},t,{type:"line",ref:e,options:t.options||{}}))})),(0,w.forwardRef)((function(t,e){return k().createElement(bo,Object.assign({},t,{type:"bar",ref:e,options:t.options||{}}))}))),_o=((0,w.forwardRef)((function(t,e){return k().createElement(bo,Object.assign({},t,{type:"radar",ref:e,options:t.options||{}}))})),(0,w.forwardRef)((function(t,e){return k().createElement(bo,Object.assign({},t,{type:"doughnut",ref:e,options:t.options||{}}))})),(0,w.forwardRef)((function(t,e){return k().createElement(bo,Object.assign({},t,{type:"polarArea",ref:e,options:t.options||{}}))})),(0,w.forwardRef)((function(t,e){return k().createElement(bo,Object.assign({},t,{type:"bubble",ref:e,options:t.options||{}}))})),(0,w.forwardRef)((function(t,e){return k().createElement(bo,Object.assign({},t,{type:"pie",ref:e,options:t.options||{}}))})));(0,w.forwardRef)((function(t,e){return k().createElement(bo,Object.assign({},t,{type:"scatter",ref:e,options:t.options||{}}))}));const vo=[{label:(0,e.__)("Last 7 days","learnpress-gradebook"),value:"last-7-days"},{label:(0,e.__)("Last 30 days","learnpress-gradebook"),value:"last-30-days"},{label:(0,e.__)("Last 12 months","learnpress-gradebook"),value:"last-12-month"}],yo={scales:{yAxes:[{ticks:{beginAtZero:!0}}]}};function wo({courseID:n}){const[i,s]=(0,t.useState)({}),[l,c]=(0,t.useState)(!1),[u,d]=(0,t.useState)(vo[0].value);return(0,t.useEffect)((()=>{if(!i[u]){c(!0);try{async function t(){const t=await o()({path:(0,a.addQueryArgs)("lp-gradebook/get-chart-student",{courseID:n,typeChart:u}),method:"GET"}),e=t.data.datasets.map((t=>({label:t.label,data:t.data,fill:!1,backgroundColor:t.backgroundColor,borderColor:t.borderColor})));s({...i,[u]:{labels:t.data.labels,datasets:e}}),c(!1)}t()}catch(e){s(""),c(!1)}}}),[n,u]),(0,t.createElement)("div",{className:"detail-chart"},(0,t.createElement)("div",{style:{marginBottom:20}},(0,t.createElement)(r.ButtonGroup,null,vo.map((e=>(0,t.createElement)(r.Button,{key:e.value,onClick:()=>(t=>{if(t===u)return!1;d(t)})(e.value),isPrimary:u===e.value},e.label))))),(0,t.createElement)("div",null,(0,t.createElement)("div",{className:l?"detail-chart__loading":""},(0,t.createElement)(xo,{data:i[u]||{},options:yo,height:160}),l&&(0,t.createElement)(r.Spinner,null)),(0,t.createElement)("div",{className:"title-chart"},(0,t.createElement)("h3",null,(0,e.__)("Chart 1:","learnpress-gradebook")),(0,t.createElement)("p",null,(0,e.__)("Number of students registered and finished the course by date","learnpress-gradebook")))))}function ko({courseID:n}){const[i,s]=(0,t.useState)(""),[l,c]=(0,t.useState)(!1),[u,d]=(0,t.useState)(0),[h,p]=(0,t.useState)(0);return(0,t.useEffect)((()=>{c(!0);try{async function t(){const t=await o()({path:(0,a.addQueryArgs)("lp-gradebook/get-pie-chart-student",{courseID:n}),method:"GET"});d(t.data.datasets.data[0]?parseInt(t.data.datasets.data[0]):0),p(t.data.datasets.data[0]?parseInt(t.data.datasets.data[1]):0),s({labels:t.data.labels,datasets:[{data:t.data.datasets.data,backgroundColor:t.data.datasets.backgroundColor,borderColor:t.data.datasets.borderColor}]}),c(!1)}t()}catch(e){s(""),c(!1)}}),[n]),(0,t.createElement)("div",{className:"detail-chart"},(0,t.createElement)("div",{className:"ct-chart"},(0,t.createElement)("div",{className:l?"ct-left detail-chart__loading":"ct-left"},(0,t.createElement)(_o,{data:i,height:160}),l&&(0,t.createElement)(r.Spinner,null)),(0,t.createElement)("div",{className:"ct-right"},(0,t.createElement)("p",null,(0,e.__)("Total students enrolled:","learnpress-gradebook")," ",(0,t.createElement)("b",null,u)),(0,t.createElement)("p",null,(0,e.__)("Total students finished:","learnpress-gradebook")," ",(0,t.createElement)("b",null,h)),(0,t.createElement)("p",null,(0,e.__)("Total:","learnpress-gradebook")," ",(0,t.createElement)("b",null,h+u)))),(0,t.createElement)("div",{className:"title-chart"},(0,t.createElement)("h3",null,(0,e.__)("Chart 2:","learnpress-gradebook")),(0,t.createElement)("p",null,(0,e.__)("All students registered and finished the course","learnpress-gradebook"))))}function So({courseID:n}){const[a,i]=(0,t.useState)(!0),o=(0,t.useMemo)((()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"chart_sc"},(0,t.createElement)(wo,{courseID:n}),(0,t.createElement)(ko,{courseID:n})))),[n]);return(0,t.createElement)(t.Fragment,null,!a&&o,(0,t.createElement)("div",{style:{marginBottom:20}},(0,t.createElement)(r.Button,{isPrimary:!0,variant:"primary",onClick:()=>i(!a),icon:a?v:y,iconSize:20},a?(0,e.__)("View Chart","learnpress-gradebook"):(0,e.__)("Close Chart","learnpress-gradebook"))))}var Eo=n(9764),Mo=n.n(Eo);function Co({add:t,remove:e}){const n=new URL(window.location);t&&t.forEach((t=>{n.searchParams.set(t.param,t.value)})),e&&e.forEach((t=>{n.searchParams.delete(t)})),window.history.pushState({},"",n.href)}function Po({screen:n,setScreen:a,titleCourse:i,studentName:o,quizName:s}){return(0,t.createElement)("div",null,(0,t.createElement)("div",null,(0,t.createElement)(r.Button,{isSecondary:!0,variant:"secondary",onClick:()=>{a(n-1),2===n?Co({remove:["screen","student"]}):3===n&&Co({remove:["quiz_id"]})}},(0,t.createElement)("svg",{width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},(0,t.createElement)("path",{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),(0,e.__)("Back","learnpress-gradebook"))),i?(0,t.createElement)("nav",{"aria-label":"breadcrumb"},(0,t.createElement)("ol",{className:"breadcrumb"},(0,t.createElement)("li",{className:"breadcrumb-item"},(0,t.createElement)("a",{onClick:t=>{t.preventDefault(),Co({remove:["screen","student","quiz_id"]}),a(1)},dangerouslySetInnerHTML:{__html:i}})),2===n?(0,t.createElement)("li",{className:"breadcrumb-item active","aria-current":"page",dangerouslySetInnerHTML:{__html:o}}):(0,t.createElement)(t.Fragment,null,(0,t.createElement)("li",{className:"breadcrumb-item"},(0,t.createElement)("a",{onClick:t=>{t.preventDefault(),Co({remove:["quiz_id"],add:[{param:"screen",value:2}]}),a(2)},dangerouslySetInnerHTML:{__html:o}})),(0,t.createElement)("li",{className:"breadcrumb-item active","aria-current":"page",dangerouslySetInnerHTML:{__html:s}})))):(0,t.createElement)("ul",{className:"lp-skeleton-animation"},(0,t.createElement)("li",null)))}function Do({data:n,loading:a,setLoading:i,pagination:o,setPage:s,setScreen:l,setQuizzID:c}){return(0,t.createElement)("div",null,n.posts&&n.posts.length>0?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("table",{className:"wp-list-table widefat fixed striped table-view-list student "+(a?"lp-gradebook-spinner":"")},(0,t.createElement)("thead",null,(0,t.createElement)("tr",{className:"table-headers"},(0,t.createElement)("th",null),(0,t.createElement)("th",null,(0,e.__)("Title","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("Type","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("Start time","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("End time","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("Graduation","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("Status","learnpress-gradebook")))),(0,t.createElement)("tbody",null,n.posts.map(((e,n)=>(0,t.createElement)("tr",{key:n},(0,t.createElement)("td",null,n+1),(0,t.createElement)("td",null,"lp_quiz"===e?.type?.raw?(0,t.createElement)("a",{href:"",onClick:t=>{t.preventDefault(),l(3),c(e.id),Co({add:[{param:"screen",value:"3"},{param:"quiz_id",value:e.id}]})},dangerouslySetInnerHTML:{__html:e.title}}):(0,t.createElement)("span",{className:"lp-gradebook-item__title",dangerouslySetInnerHTML:{__html:e.title}})),(0,t.createElement)("td",{dangerouslySetInnerHTML:{__html:e?.type?.render}}),(0,t.createElement)("td",null,e.start_time),(0,t.createElement)("td",null,e.end_time),(0,t.createElement)("td",{dangerouslySetInnerHTML:{__html:e.graduation}}),(0,t.createElement)("td",{dangerouslySetInnerHTML:{__html:e?.status?.render}}))))),a&&(0,t.createElement)(r.Spinner,null)),n.total_posts>10&&(0,t.createElement)(Mo(),{previousLabel:"«",nextLabel:"»",breakLabel:"...",breakClassName:"break-me",pageCount:o,marginPagesDisplayed:2,pageRangeDisplayed:3,onPageChange:t=>{s(t.selected+1),i(!0)},containerClassName:"pagination",activeClassName:"active"})):(0,t.createElement)(r.Notice,{status:"error",isDismissible:!1},(0,t.createElement)("p",null,(0,e.__)("No data available","learnpress-gradebook"))))}function Oo(){return(0,t.createElement)("ul",{className:"lp-skeleton-animation"},(0,t.createElement)("li",null),(0,t.createElement)("li",null),(0,t.createElement)("li",null),(0,t.createElement)("li",null),(0,t.createElement)("li",null))}function Lo({screen:n,courseID:i,setScreen:s,studentID:l,setQuizzID:c}){const[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!1),[f,g]=(0,t.useState)(""),[m,b]=(0,t.useState)(""),[x,v]=(0,t.useState)(),[y,w]=(0,t.useState)(1),[k,S]=(0,t.useState)(1),[E,M]=(0,t.useState)(""),[C,P]=(0,t.useState)(""),[D,O]=(0,t.useState)(!1);(0,t.useEffect)((()=>{try{async function t(){const t=await o()({path:(0,a.addQueryArgs)("lp-gradebook/get-items",{studentID:l,courseID:i,itemType:f,page:y,limit:10,status:m,postTitle:x}),method:"GET"});console.log(t),d(t.data),M(t.data.studentName),P(t.data.titleCourse),p(!1),O(!1),S(t?.data?.total_posts/10||1)}t()}catch(e){d(""),p(!1),O(!1)}}),[l,i,h,y]);let L=u?.types&&Object.keys(u.types).map((t=>({label:u.types[t],value:t})));return L=L?[{label:(0,e.__)("Type","learnpress-gradebook"),value:""},...L]:[],(0,t.createElement)("div",null,(0,t.createElement)(Po,{titleCourse:C,studentName:E,screen:n,setScreen:s}),(0,t.createElement)(So,{courseID:i}),(0,t.createElement)(r.Flex,null,(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(_,{setPostsTitle:v,studentID:l,courseID:i,data:u})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)("form",{onSubmit:t=>{t.preventDefault(),p(!0)}},(0,t.createElement)(r.Flex,{align:"flex-start"},(0,t.createElement)(r.TextControl,{style:{height:36},label:null,value:x,onChange:t=>v(t),placeholder:(0,e.__)("Search lesson, quiz…","learnpress-gradebook")}),(0,t.createElement)(r.SelectControl,{style:{height:36},label:null,value:f,onChange:t=>g(t),options:L}),(0,t.createElement)(r.SelectControl,{style:{height:36},label:null,value:m,onChange:t=>b(t),options:[{label:(0,e.__)("Status","learnpress-gradebook"),value:""},{label:(0,e.__)("Started","learnpress-gradebook"),value:"started"},{label:(0,e.__)("Completed","learnpress-gradebook"),value:"completed"}]}),(0,t.createElement)(r.Button,{isPrimary:!0,variant:"primary",onClick:()=>p(!0),style:{height:36}},(0,e.__)("Filters","learnpress-gradebook")))))),!u||h?(0,t.createElement)(Oo,null):(0,t.createElement)(Do,{data:u,loading:D,setLoading:O,setSubmit:p,pagination:k,setPage:w,setScreen:s,setQuizzID:c}))}const To=[{label:(0,e.__)("User ID","learnpress-gradebook"),key:'"user_id"'},{label:(0,e.__)("Username","learnpress-gradebook"),key:'"user_nicename"'},{label:(0,e.__)("Email","learnpress-gradebook"),key:'"user_email"'},{label:(0,e.__)("Start time","learnpress-gradebook"),key:'"start_time"'},{label:(0,e.__)("Status","learnpress-gradebook"),key:'"graduation"'},{label:(0,e.__)("Average","learnpress-gradebook"),key:'"average"'}],Ao=[{label:(0,e.__)("User ID","learnpress-gradebook"),key:'"user_id"'},{label:(0,e.__)("Username","learnpress-gradebook"),key:'"user_nicename"'},{label:(0,e.__)("Email","learnpress-gradebook"),key:'"user_email"'},{label:(0,e.__)("Start time","learnpress-gradebook"),key:'"start_time"'},{label:(0,e.__)("End time","learnpress-gradebook"),key:'"end_time"'},{label:(0,e.__)("Status","learnpress-gradebook"),key:'"graduation"'},{label:(0,e.__)("Average","learnpress-gradebook"),key:'"average"'}];function Io({courseID:n}){const[i,s]=(0,t.useState)(!1),[c,u]=(0,t.useState)(!1);async function d(t,e,n,r,i){try{const s=await o()({path:(0,a.addQueryArgs)("lp-gradebook/export-students-full",{courseID:n,limit:r,offset:i}),method:"GET"}),{status:l,data:c,header:u,count:h}=s;return"success"===l&&(t=[...t,...u],e=[...e,...c],h>r*i?d(t,e,n,r,i+1):{headerData:t,dataList:e})}catch(t){return!1}}return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{className:"learnpress-gradebook__export__button",isSecondary:!0,variant:"secondary",onClick:async()=>{s(!0);try{const t=await o()({path:(0,a.addQueryArgs)("lp-gradebook/export-students",{courseID:n}),method:"GET"}),e=await t.data,r=await g(To,e);b(await m("gradebook",{list:"students"}),r),s(!1)}catch(t){console.log(t.message),s(!1)}},icon:i?(0,t.createElement)(r.Spinner,null):l,iconSize:20,text:(0,e.__)("Export CSV","learnpress-gradebook")}),(0,t.createElement)(r.Button,{className:"learnpress-gradebook__export__button",isSecondary:!0,variant:"secondary",onClick:async()=>{u(!0);try{const t=await d([],[],n,10,1);if(!t)return void u(!1);const{headerData:e,dataList:r}=t,a=g([...Ao,...e],r);b(m("gradebook",{list:"students"}),a),u(!1)}catch(t){console.log(t.message),u(!1)}},icon:c?(0,t.createElement)(r.Spinner,null):l,iconSize:20,text:(0,e.__)("Export Full CSV","learnpress-gradebook")}))}function Ro({data:n,loading:a,setLoading:i,count:o,pagination:s,setPage:l,setScreen:c,setStudent:u}){return(0,t.createElement)("div",null,n?.data?.result?.length>0?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("table",{className:"wp-list-table widefat fixed striped table-view-list student "+(a?"lp-gradebook-spinner":"")},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{className:"index"}),(0,t.createElement)("th",null,(0,e.__)("Student","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("Email","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("Start time","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("Average","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("Status","learnpress-gradebook")))),(0,t.createElement)("tbody",null,n.data.result.map(((e,n)=>{let r=0;return r=e.result?Number.isInteger(e.result)?parseInt(e.result):parseFloat(e.result).toFixed(2):0,(0,t.createElement)("tr",{key:n},(0,t.createElement)("td",null,n+1),(0,t.createElement)("td",null,(0,t.createElement)("a",{href:"",onClick:t=>{t.preventDefault(),c(2),u(e.user_id),Co({add:[{param:"screen",value:"2"},{param:"student",value:e.user_id}]})},dangerouslySetInnerHTML:{__html:e.user_nicename}})),(0,t.createElement)("td",{dangerouslySetInnerHTML:{__html:e.user_email}}),(0,t.createElement)("td",null,e.start_time),(0,t.createElement)("td",null,`${r}%`),(0,t.createElement)("td",{dangerouslySetInnerHTML:{__html:e.graduation}}))}))),a&&(0,t.createElement)(r.Spinner,null)),o>10&&(0,t.createElement)(Mo(),{previousLabel:"«",nextLabel:"»",breakLabel:"...",breakClassName:"break-me",pageCount:s,marginPagesDisplayed:2,pageRangeDisplayed:3,onPageChange:t=>{l(t.selected+1),i(!0)},containerClassName:"pagination",activeClassName:"active"})):(0,t.createElement)(r.Notice,{status:"error",isDismissible:!1},(0,t.createElement)("p",null,(0,e.__)("No data available","learnpress-gradebook"))))}function zo({courseID:n,setScreen:i,setStudent:s}){const[l,c]=(0,t.useState)(""),[u,d]=(0,t.useState)(1),[h,p]=(0,t.useState)(1),[f,g]=(0,t.useState)(""),[m,b]=(0,t.useState)(0),[x,_]=(0,t.useState)(!1),[v,y]=(0,t.useState)(),[w,k]=(0,t.useState)(""),[S,E]=(0,t.useState)(""),[M,C]=(0,t.useState)(!1);return(0,t.useEffect)((()=>{try{async function t(){const t=await o()({path:(0,a.addQueryArgs)("lp-gradebook/get-students",{courseID:n,limit:10,page:u,graduation:S,average:w,userName:v}),method:"GET"});"success"===t?.status&&(c(t),g(t?.data?.title||""),b(t?.data?.count||0),p(t?.data?.count/10||1)),C(!1),_(!1)}t()}catch(e){c("")}}),[n,u,x]),(0,t.createElement)("div",null,(0,t.createElement)(So,{courseID:n}),(0,t.createElement)(r.Flex,null,(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Flex,null,(0,t.createElement)(Io,{courseID:n}),(0,t.createElement)("h2",{className:"title-head",dangerouslySetInnerHTML:{__html:f}}))),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)("form",{onSubmit:t=>{t.preventDefault(),_(!0)}},(0,t.createElement)(r.Flex,{align:"flex-start"},(0,t.createElement)(r.TextControl,{style:{height:36},label:null,value:v,onChange:t=>y(t),placeholder:(0,e.__)("Search student…","learnpress-gradebook")}),(0,t.createElement)(r.SelectControl,{style:{height:36},label:null,value:S,onChange:t=>E(t),options:[{label:(0,e.__)("Status","learnpress-gradebook"),value:""},{label:(0,e.__)("Passed","learnpress-gradebook"),value:"passed"},{label:(0,e.__)("Failed","learnpress-gradebook"),value:"failed"},{label:(0,e.__)("In Progress","learnpress-gradebook"),value:"in-progress"}]}),(0,t.createElement)(r.Button,{isPrimary:!0,variant:"primary",onClick:()=>_(!0),style:{height:36}},(0,e.__)("Filters","learnpress-gradebook")))))),!l||x?(0,t.createElement)(Oo,null):(0,t.createElement)(Ro,{data:l,loading:M,setLoading:C,count:m,pagination:h,setPage:d,setScreen:i,setStudent:s}))}function No({courseID:n,quizzID:i,studentID:s}){const[l,c]=(0,t.useState)(""),[u,d]=(0,t.useState)(!1);return(0,t.useEffect)((()=>{d(!0);try{async function t(){const t=await o()({path:(0,a.addQueryArgs)("lp-gradebook/get-chart-questions",{courseID:n,quizzID:i,studentID:s}),method:"GET"});t?.data&&c({labels:t.data.labels,datasets:[{data:t.data.datasets.data,backgroundColor:t.data.datasets.backgroundColor,borderColor:t.data.datasets.borderColor}]}),d(!1)}t()}catch(e){c(""),d(!1)}}),[i,s]),(0,t.createElement)(t.Fragment,null,u?(0,t.createElement)(Oo,null):(0,t.createElement)(t.Fragment,null,l?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:u?"detail-chart__loading":""},(0,t.createElement)(_o,{data:l,height:160}),u&&(0,t.createElement)(r.Spinner,null)),(0,t.createElement)("div",{className:"title-chart center"},(0,t.createElement)("h3",null,(0,e.__)("Chart:","learnpress-gradebook")),(0,t.createElement)("p",null,(0,e.__)("Total number of true and false questions's quiz","learnpress-gradebook")))):(0,t.createElement)(r.Notice,{status:"warning",isDismissible:!1},(0,t.createElement)("p",null,(0,e.__)("No data available","learnpress-gradebook")))))}function jo({studentID:n,quizzID:i}){const[s,l]=(0,t.useState)(!1),[c,u]=(0,t.useState)(""),[d,h]=(0,t.useState)("");return(0,t.useEffect)((()=>{l(!0);try{async function t(){const t=await o()({path:(0,a.addQueryArgs)("lp-gradebook/questions-attempted",{studentID:n,quizzID:i}),method:"GET"});u(t.data.result),h(Object.keys(t.data.result).length?JSON.parse(t.data.result.result):""),l(!1)}t()}catch(e){setData(""),l(!1)}}),[n,i]),(0,t.createElement)("div",null,(0,t.createElement)(t.Fragment,null,s?(0,t.createElement)(Oo,null):(0,t.createElement)(t.Fragment,null,Object.keys(c).length>0?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("h2",null,(0,e.__)("Result Quiz","learnpress-gradebook")," "),(0,t.createElement)("p",null,(0,e.__)("Date finish:","learnpress-gradebook"),(0,t.createElement)("strong",null," ",c["end-time"])),(0,t.createElement)("p",null,(0,e.__)("Questions:","learnpress-gradebook")," ",(0,t.createElement)("strong",null,d.question_correct," / ",d.question_count)),(0,t.createElement)("p",null,(0,e.__)("Time spent:","learnpress-gradebook")," ",(0,t.createElement)("strong",null,d.time_spend)),(0,t.createElement)("p",null,(0,e.__)("Marks:","learnpress-gradebook")," ",(0,t.createElement)("strong",null,d.user_mark," / ",d.mark)),(0,t.createElement)("p",null,(0,e.__)("Passing grade:","learnpress-gradebook")," ",(0,t.createElement)("strong",null,d.passing_grade)),(0,t.createElement)("p",null,(0,e.__)("Result:","learnpress-gradebook")," ",(0,t.createElement)("strong",null,`${d?.result?.toFixed(2)||0}%`))):(0,t.createElement)(r.Notice,{status:"warning",isDismissible:!1},(0,t.createElement)("p",null,(0,e.__)("No data available","learnpress-gradebook"))))))}function Fo({courseID:n,studentID:a,quizzID:i}){const[o,s]=(0,t.useState)(!0),l=(0,t.useMemo)((()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"chart_sc chart_sc3"},(0,t.createElement)("div",{className:"quiz_detail"},(0,t.createElement)(jo,{studentID:a,quizzID:i})),(0,t.createElement)("div",{className:"detail-chart"},(0,t.createElement)(No,{courseID:n,studentID:a,quizzID:i}))))),[a,i,n]);return(0,t.createElement)(t.Fragment,null,!o&&l,(0,t.createElement)("div",{style:{marginBottom:20}},(0,t.createElement)(r.Button,{isPrimary:!0,variant:"primary",onClick:()=>s(!o),icon:o?v:y,iconSize:20},o?(0,e.__)("View Chart","learnpress-gradebook"):(0,e.__)("Close Chart","learnpress-gradebook"))))}const Bo=(0,t.createElement)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(s.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),Vo=[{label:(0,e.__)("Question","leanpress-gradebook"),key:'"title"'},{label:(0,e.__)("Type","learnpress-gradebook"),key:'"type"'},{label:(0,e.__)("Retake","learnpress-gradebook"),key:'"retake_count"'},{label:(0,e.__)("Correct","learnpress-gradebook"),key:'"correct"'},{label:(0,e.__)("Retake detail","learnpress-gradebook"),key:'"retake"'}];function Wo({courseID:n,quizzID:i,studentID:s}){const[c,u]=(0,t.useState)(!1);return(0,t.createElement)(r.Button,{className:"learnpress-gradebook__export__button",isSecondary:!0,variant:"secondary",onClick:async function(){u(!0);try{const t=await o()({path:(0,a.addQueryArgs)("lp-gradebook/export-questions",{courseID:n,quizzID:i,studentID:s}),method:"GET"}),e=g(Vo,t.data.export);b(m("gradebook",{list:"questions"}),e),u(!1)}catch(t){u(!1)}},icon:c?(0,t.createElement)(r.Spinner,null):l,iconSize:20,text:(0,e.__)("Export CSV","learnpress-gradebook")})}function Ho({data:n,pagination:a,count:i,setQuestionTitle:o,questionTitle:s,courseID:l,quizzID:c,studentID:u,setPage:d,quizTitle:h,loading:p,paginateLoading:f,setPaginateLoading:g}){const[m,b]=(0,t.useState)(s);return(0,t.createElement)("div",null,(0,t.createElement)(r.Flex,{align:"flex-start",justify:"flex-start"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(Wo,{courseID:l,quizzID:c,studentID:u})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)("form",{onSubmit:t=>{t.preventDefault(),o(m)}},(0,t.createElement)(r.Flex,{align:"flex-start",justify:"flex-start"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.TextControl,{style:{height:36},label:null,placeholder:(0,e.__)("Search quesion…","leanpress-gradebook"),value:m,onChange:t=>b(t)})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{isPrimary:!0,variant:"primary",onClick:()=>o(m)},(0,e.__)("Search","leanpress-gradebook"))))))),0!==Object.keys(n).length?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("table",{className:"wp-list-table widefat fixed striped table-view-list student "+(p?"lp-gradebook-spinner":"")},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null),(0,t.createElement)("th",null,(0,e.__)("Title","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("Type","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("Correct","learnpress-gradebook")),(0,t.createElement)("th",null,(0,e.__)("Retake Detail","learnpress-gradebook")))),(0,t.createElement)("tbody",null,Object.values(n).map(((n,a)=>(0,t.createElement)("tr",{key:a},(0,t.createElement)("td",null,a+1),(0,t.createElement)("td",{dangerouslySetInnerHTML:{__html:n.title||""}}),(0,t.createElement)("td",{dangerouslySetInnerHTML:{__html:n.type}}),(0,t.createElement)("td",null,n.correct||""),(0,t.createElement)("td",null,(0,t.createElement)("div",{className:"number_retake"},(0,t.createElement)("span",{className:"count_retake"},"(",n.retake_count,")",n.retake_count>0?(0,t.createElement)(r.Dropdown,{className:"lp-gradebook_my_container",contentClassName:"lp-gradebook_my_popover_content",position:"bottom right",renderToggle:({isOpen:n,onToggle:a})=>(0,t.createElement)(r.Button,{variant:"link",onClick:a,"aria-expanded":n,isLink:!0,icon:Bo,iconSize:20,iconPosition:"right",text:`${(0,e.__)("View","learnpress-gradebook")}`}),renderContent:()=>(0,t.createElement)("div",{className:"lp-gradebook_retake"},n.retake?(0,t.createElement)(t.Fragment,null,n.retake.map(((e,n)=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"lp-gradebook_retake_detail"},(0,t.createElement)("span",null,n+1),(0,t.createElement)("span",null,e)))))):"")}):"")))))))),i>10&&(0,t.createElement)(Mo(),{previousLabel:"«",nextLabel:"»",breakLabel:"...",breakClassName:"break-me",pageCount:a,marginPagesDisplayed:2,pageRangeDisplayed:3,onPageChange:t=>{d(t.selected+1),g(!0)},containerClassName:"pagination",activeClassName:"active"})):(0,t.createElement)(r.Notice,{status:"error",isDismissible:!1},(0,t.createElement)("p",null,(0,e.__)("No data available","learnpress-gradebook"))))}function $o({courseID:e,screen:n,setScreen:r,studentID:i,quizzID:s}){const[l,c]=(0,t.useState)(""),[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(""),[f,g]=(0,t.useState)(1),[m,b]=(0,t.useState)(""),[x,_]=(0,t.useState)(1),[v,y]=(0,t.useState)(""),[w,k]=(0,t.useState)(""),[S,E]=(0,t.useState)(!1),[M,C]=(0,t.useState)(!1);return(0,t.useEffect)((()=>{E(!0);try{async function t(){const t=await o()({path:(0,a.addQueryArgs)("lp-gradebook/get-questions",{courseID:e,quizzID:s,studentID:i,questionTitle:h,limit:10,page:x}),mothod:"GET"});console.log(t),c(t.data.item),d(t.data.quizTitle),k(t.data.courseTitle),y(t.data.studentName),b(t.data.count||1),g(t.data.count/10||1),E(!1),C(!1)}t()}catch(n){c(""),E(!1),C(!1)}}),[s,i,h,x]),(0,t.createElement)("div",null,(0,t.createElement)(Po,{titleCourse:w,studentName:v,screen:n,setScreen:r,quizName:u}),(0,t.createElement)(Fo,{courseID:e,quizzID:s,studentID:i}),l?(0,t.createElement)(Ho,{data:l,pagination:f,count:m,setQuestionTitle:p,questionTitle:h,courseID:e,quizzID:s,studentID:i,setPage:_,quizTitle:u,studentName:v,loading:S,paginateLoading:M,setPaginateLoading:C}):(0,t.createElement)(Oo,null))}wp.element.render((0,t.createElement)((function(){const[e,n]=(0,t.useState)(""),[a,i]=(0,t.useState)(""),[o,s]=(0,t.useState)(),[l,c]=(0,t.useState)(1);return(0,t.useEffect)((()=>{function t(){const t=window.location.href,e=new URL(t),r=e.searchParams.get("course_id"),a=e.searchParams.get("screen"),o=e.searchParams.get("student"),l=e.searchParams.get("quiz_id");c(a?parseInt(a):1),l&&s(l),o&&n(o),r&&i(r)}return t(),document.defaultView.addEventListener("popstate",t),document.defaultView.addEventListener("pushstate",t),document.defaultView.addEventListener("replacestate",t),()=>{document.defaultView.removeEventListener("popstate",t),document.defaultView.removeEventListener("pushstate",t),document.defaultView.removeEventListener("replacestate",t)}}),[e]),a?(0,t.createElement)("div",{className:"learnpress-gradebook"},(0,t.createElement)(t.Fragment,null,1===l&&(0,t.createElement)(zo,{courseID:a,setScreen:c,setStudent:n}),2===l&&(0,t.createElement)(Lo,{courseID:a,screen:l,setScreen:c,studentID:e,setQuizzID:s}),3===l&&(0,t.createElement)($o,{courseID:a,screen:l,setScreen:c,studentID:e,quizzID:o}))):(0,t.createElement)(r.Spinner,null)}),null),document.getElementById("learnpress-gradebook-react"))})()})();