@justifi/webcomponents 4.7.0-rc.2 → 4.7.1-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/dist/cjs/Api-548eaa62.js.map +1 -1
  2. package/dist/cjs/Payout-68a99ee3.js.map +1 -1
  3. package/dist/cjs/config-a156df17.js +17 -0
  4. package/dist/cjs/config-a156df17.js.map +1 -0
  5. package/dist/cjs/justifi-business-details.cjs.entry.js +1 -1
  6. package/dist/cjs/justifi-business-form-stepped.cjs.entry.js +1 -1
  7. package/dist/cjs/justifi-business-form.cjs.entry.js +1 -1
  8. package/dist/cjs/justifi-business-list.cjs.entry.js +1 -1
  9. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +1 -1
  10. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +2 -1
  11. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js.map +1 -1
  12. package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -5
  13. package/dist/cjs/justifi-payment-details.cjs.entry.js.map +1 -1
  14. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +3 -6
  15. package/dist/cjs/justifi-payment-method-form.cjs.entry.js.map +1 -1
  16. package/dist/cjs/justifi-payments-list.cjs.entry.js +10 -2
  17. package/dist/cjs/justifi-payments-list.cjs.entry.js.map +1 -1
  18. package/dist/cjs/justifi-payout-details.cjs.entry.js +1 -1
  19. package/dist/cjs/justifi-payouts-list.cjs.entry.js +1 -1
  20. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +1 -1
  21. package/dist/cjs/justifi-refund-form.cjs.entry.js +1 -1
  22. package/dist/cjs/justifi-subaccount-details.cjs.entry.js +1 -1
  23. package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +1 -1
  24. package/dist/cjs/justifi-table_2.cjs.entry.js +1 -1
  25. package/dist/cjs/justifi-table_2.cjs.entry.js.map +1 -1
  26. package/dist/collection/api/Api.js.map +1 -1
  27. package/dist/collection/api/Payment.js.map +1 -1
  28. package/dist/collection/components/bank-account-form/bank-account-form.stories.js +0 -8
  29. package/dist/collection/components/bank-account-form/bank-account-form.stories.js.map +1 -1
  30. package/dist/collection/components/business-form/business-form-stepped.stories.js +4 -4
  31. package/dist/collection/components/business-form/business-form-stepped.stories.js.map +1 -1
  32. package/dist/collection/components/business-form/business-form.stories.js +2 -2
  33. package/dist/collection/components/business-form/business-form.stories.js.map +1 -1
  34. package/dist/collection/components/business-list/business-list.stories.js +1 -1
  35. package/dist/collection/components/business-list/business-list.stories.js.map +1 -1
  36. package/dist/collection/components/card-form/card-form.stories.js +0 -8
  37. package/dist/collection/components/card-form/card-form.stories.js.map +1 -1
  38. package/dist/collection/components/gross-payment-chart/gross-payment-chart.stories.js +3 -2
  39. package/dist/collection/components/gross-payment-chart/gross-payment-chart.stories.js.map +1 -1
  40. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.js +2 -1
  41. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.js.map +1 -1
  42. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.stories.js +5 -4
  43. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.stories.js.map +1 -1
  44. package/dist/collection/components/payment-details/payment-details.js +2 -4
  45. package/dist/collection/components/payment-details/payment-details.js.map +1 -1
  46. package/dist/collection/components/payments-list/payments-list.js +9 -1
  47. package/dist/collection/components/payments-list/payments-list.js.map +1 -1
  48. package/dist/collection/components/payments-list/payments-list.stories.js +1 -1
  49. package/dist/collection/components/payments-list/payments-list.stories.js.map +1 -1
  50. package/dist/collection/components/payouts-list/payouts-list.stories.js +1 -1
  51. package/dist/collection/components/payouts-list/payouts-list.stories.js.map +1 -1
  52. package/dist/collection/components/proceeds-list/proceeds-list.stories.js +1 -1
  53. package/dist/collection/components/proceeds-list/proceeds-list.stories.js.map +1 -1
  54. package/dist/collection/components/subaccount-details/subaccount-details.stories.js +1 -1
  55. package/dist/collection/components/subaccount-details/subaccount-details.stories.js.map +1 -1
  56. package/dist/collection/components/subaccounts-list/subaccounts-list.stories.js +1 -1
  57. package/dist/collection/components/subaccounts-list/subaccounts-list.stories.js.map +1 -1
  58. package/dist/collection/components/table/table.js +1 -1
  59. package/dist/collection/components/table/table.js.map +1 -1
  60. package/dist/components/Api.js.map +1 -1
  61. package/dist/components/Payout.js.map +1 -1
  62. package/dist/components/config.js +6 -8
  63. package/dist/components/config.js.map +1 -1
  64. package/dist/components/justifi-payment-balance-transactions.js +2 -1
  65. package/dist/components/justifi-payment-balance-transactions.js.map +1 -1
  66. package/dist/components/justifi-payment-details.js +2 -4
  67. package/dist/components/justifi-payment-details.js.map +1 -1
  68. package/dist/components/justifi-payments-list.js +9 -1
  69. package/dist/components/justifi-payments-list.js.map +1 -1
  70. package/dist/components/payment-method-form.js +2 -5
  71. package/dist/components/payment-method-form.js.map +1 -1
  72. package/dist/components/table.js +1 -1
  73. package/dist/components/table.js.map +1 -1
  74. package/dist/config.js +9 -11
  75. package/dist/config.js.map +1 -1
  76. package/dist/esm/Api-c65d3ed8.js.map +1 -1
  77. package/dist/esm/Payout-fcf16887.js.map +1 -1
  78. package/dist/esm/config-ceb0f902.js +15 -0
  79. package/dist/esm/config-ceb0f902.js.map +1 -0
  80. package/dist/esm/justifi-business-details.entry.js +1 -1
  81. package/dist/esm/justifi-business-form-stepped.entry.js +1 -1
  82. package/dist/esm/justifi-business-form.entry.js +1 -1
  83. package/dist/esm/justifi-business-list.entry.js +1 -1
  84. package/dist/esm/justifi-gross-payment-chart.entry.js +1 -1
  85. package/dist/esm/justifi-payment-balance-transactions.entry.js +2 -1
  86. package/dist/esm/justifi-payment-balance-transactions.entry.js.map +1 -1
  87. package/dist/esm/justifi-payment-details.entry.js +4 -6
  88. package/dist/esm/justifi-payment-details.entry.js.map +1 -1
  89. package/dist/esm/justifi-payment-method-form.entry.js +3 -6
  90. package/dist/esm/justifi-payment-method-form.entry.js.map +1 -1
  91. package/dist/esm/justifi-payments-list.entry.js +10 -2
  92. package/dist/esm/justifi-payments-list.entry.js.map +1 -1
  93. package/dist/esm/justifi-payout-details.entry.js +1 -1
  94. package/dist/esm/justifi-payouts-list.entry.js +1 -1
  95. package/dist/esm/justifi-proceeds-list.entry.js +1 -1
  96. package/dist/esm/justifi-refund-form.entry.js +1 -1
  97. package/dist/esm/justifi-subaccount-details.entry.js +1 -1
  98. package/dist/esm/justifi-subaccounts-list.entry.js +1 -1
  99. package/dist/esm/justifi-table_2.entry.js +1 -1
  100. package/dist/esm/justifi-table_2.entry.js.map +1 -1
  101. package/dist/types/api/Api.d.ts +1 -1
  102. package/dist/types/api/Payment.d.ts +2 -2
  103. package/dist/types/components/bank-account-form/bank-account-form.stories.d.ts +0 -1
  104. package/dist/types/components/card-form/card-form.stories.d.ts +0 -1
  105. package/dist/types/components/payments-list/payments-list.d.ts +2 -1
  106. package/dist/types/home/runner/work/web-component-library/web-component-library/stencil-library/.stencil/config.d.ts +2 -4
  107. package/dist/webcomponents/p-160c9fbb.entry.js +2 -0
  108. package/dist/webcomponents/p-160c9fbb.entry.js.map +1 -0
  109. package/dist/webcomponents/{p-8c4c3d60.entry.js → p-26245f01.entry.js} +2 -2
  110. package/dist/webcomponents/p-26dfa274.entry.js +2 -0
  111. package/dist/webcomponents/p-26dfa274.entry.js.map +1 -0
  112. package/dist/webcomponents/{p-c2845c5d.entry.js → p-285a50a6.entry.js} +2 -2
  113. package/dist/webcomponents/{p-ffcbf779.entry.js → p-378e163d.entry.js} +2 -2
  114. package/dist/webcomponents/{p-798483dd.entry.js → p-3d82c8a3.entry.js} +2 -2
  115. package/dist/webcomponents/p-3d82c8a3.entry.js.map +1 -0
  116. package/dist/webcomponents/{p-1920e118.entry.js → p-5b8f004d.entry.js} +2 -2
  117. package/dist/webcomponents/{p-d40718da.entry.js → p-64af0ae9.entry.js} +2 -2
  118. package/dist/webcomponents/p-76983a7e.js.map +1 -1
  119. package/dist/webcomponents/p-9b6dcac5.js +2 -0
  120. package/dist/webcomponents/p-9b6dcac5.js.map +1 -0
  121. package/dist/webcomponents/{p-d7630f46.entry.js → p-9ce9561a.entry.js} +2 -2
  122. package/dist/webcomponents/{p-d7630f46.entry.js.map → p-9ce9561a.entry.js.map} +1 -1
  123. package/dist/webcomponents/{p-b08a9520.entry.js → p-abc05a34.entry.js} +2 -2
  124. package/dist/webcomponents/{p-0e9a7fa7.entry.js → p-b12691c3.entry.js} +2 -2
  125. package/dist/webcomponents/p-b157f6ae.js.map +1 -1
  126. package/dist/webcomponents/{p-6c3236e8.entry.js → p-b98a3f94.entry.js} +2 -2
  127. package/dist/webcomponents/{p-64184a0c.entry.js → p-c1ae571b.entry.js} +2 -2
  128. package/dist/webcomponents/p-c1ae571b.entry.js.map +1 -0
  129. package/dist/webcomponents/{p-491d5c69.entry.js → p-c4c8fb44.entry.js} +2 -2
  130. package/dist/webcomponents/{p-a4c78757.entry.js → p-dbbd2611.entry.js} +2 -2
  131. package/dist/webcomponents/{p-b45453ea.entry.js → p-f0897468.entry.js} +2 -2
  132. package/dist/webcomponents/webcomponents.esm.js +1 -1
  133. package/package.json +3 -6
  134. package/readme.md +4 -9
  135. package/dist/cjs/config-70f62990.js +0 -19
  136. package/dist/cjs/config-70f62990.js.map +0 -1
  137. package/dist/esm/config-b1976dbd.js +0 -17
  138. package/dist/esm/config-b1976dbd.js.map +0 -1
  139. package/dist/webcomponents/p-301a23aa.js +0 -2
  140. package/dist/webcomponents/p-301a23aa.js.map +0 -1
  141. package/dist/webcomponents/p-64184a0c.entry.js.map +0 -1
  142. package/dist/webcomponents/p-798483dd.entry.js.map +0 -1
  143. package/dist/webcomponents/p-7a24ab66.entry.js +0 -2
  144. package/dist/webcomponents/p-7a24ab66.entry.js.map +0 -1
  145. package/dist/webcomponents/p-8367b46c.entry.js +0 -2
  146. package/dist/webcomponents/p-8367b46c.entry.js.map +0 -1
  147. /package/dist/webcomponents/{p-8c4c3d60.entry.js.map → p-26245f01.entry.js.map} +0 -0
  148. /package/dist/webcomponents/{p-c2845c5d.entry.js.map → p-285a50a6.entry.js.map} +0 -0
  149. /package/dist/webcomponents/{p-ffcbf779.entry.js.map → p-378e163d.entry.js.map} +0 -0
  150. /package/dist/webcomponents/{p-1920e118.entry.js.map → p-5b8f004d.entry.js.map} +0 -0
  151. /package/dist/webcomponents/{p-d40718da.entry.js.map → p-64af0ae9.entry.js.map} +0 -0
  152. /package/dist/webcomponents/{p-b08a9520.entry.js.map → p-abc05a34.entry.js.map} +0 -0
  153. /package/dist/webcomponents/{p-0e9a7fa7.entry.js.map → p-b12691c3.entry.js.map} +0 -0
  154. /package/dist/webcomponents/{p-6c3236e8.entry.js.map → p-b98a3f94.entry.js.map} +0 -0
  155. /package/dist/webcomponents/{p-491d5c69.entry.js.map → p-c4c8fb44.entry.js.map} +0 -0
  156. /package/dist/webcomponents/{p-a4c78757.entry.js.map → p-dbbd2611.entry.js.map} +0 -0
  157. /package/dist/webcomponents/{p-b45453ea.entry.js.map → p-f0897468.entry.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{r as t,h as e,H as s}from"./p-cbb60191.js";import{A as i}from"./p-b157f6ae.js";import"./p-0d5d02d7.js";import"./p-76983a7e.js";import{a as n,b as o}from"./p-d6b5793d.js";import{E as r}from"./p-76dffeec.js";import{c}from"./p-301a23aa.js";
1
+ import{r as t,h as e,H as s}from"./p-cbb60191.js";import{A as i}from"./p-b157f6ae.js";import"./p-0d5d02d7.js";import"./p-76983a7e.js";import{a as n,b as o}from"./p-d6b5793d.js";import{E as r}from"./p-76dffeec.js";import{c}from"./p-9b6dcac5.js";
2
2
  /*!
3
3
  * @kurkle/color v0.3.2
4
4
  * https://github.com/kurkle/color#readme
@@ -17,4 +17,4 @@ import{r as t,h as e,H as s}from"./p-cbb60191.js";import{A as i}from"./p-b157f6a
17
17
  * (c) 2023 Chart.js Contributors
18
18
  * Released under the MIT License
19
19
  */class Us{constructor(){this._request=null;this._charts=new Map;this._running=false;this._lastDate=undefined}_notify(t,e,s,i){const n=e.listeners[i];const o=e.duration;n.forEach((i=>i({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(s-e.start,o)})))}_refresh(){if(this._request){return}this._running=true;this._request=oe.call(window,(()=>{this._update();this._request=null;if(this._running){this._refresh()}}))}_update(t=Date.now()){let e=0;this._charts.forEach(((s,i)=>{if(!s.running||!s.items.length){return}const n=s.items;let o=n.length-1;let r=false;let c;for(;o>=0;--o){c=n[o];if(c._active){if(c._total>s.duration){s.duration=c._total}c.tick(t);r=true}else{n[o]=n[n.length-1];n.pop()}}if(r){i.draw();this._notify(i,s,t,"progress")}if(!n.length){s.running=false;this._notify(i,s,t,"complete");s.initial=false}e+=n.length}));this._lastDate=t;if(e===0){this._running=false}}_getAnims(t){const e=this._charts;let s=e.get(t);if(!s){s={running:false,initial:true,items:[],listeners:{complete:[],progress:[]}};e.set(t,s)}return s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){if(!e||!e.length){return}this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);if(!e){return}e.running=true;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 false}const e=this._charts.get(t);if(!e||!e.running||!e.items.length){return false}return true}stop(t){const e=this._charts.get(t);if(!e||!e.items.length){return}const s=e.items;let i=s.length-1;for(;i>=0;--i){s[i].cancel()}e.items=[];this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Zs=new Us;const Ks="transparent";const Qs={boolean(t,e,s){return s>.5?e:t},color(t,e,s){const i=ge(t||Ks);const n=i.valid&&ge(e||Ks);return n&&n.valid?n.mix(i,s).hexString():e},number(t,e,s){return t+(e-t)*s}};class qs{constructor(t,e,s,i){const n=e[s];i=ns([t.to,i,n,t.from]);const o=ns([t.from,n,i]);this._active=true;this._fn=t.fn||Qs[t.type||typeof o];this._easing=be[t.easing]||be.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=s;this._from=o;this._to=i;this._promises=undefined}active(){return this._active}update(t,e,s){if(this._active){this._notify(false);const i=this._target[this._prop];const n=s-this._start;const o=this._duration-n;this._start=s;this._duration=Math.floor(Math.max(o,t.duration));this._total+=n;this._loop=!!t.loop;this._to=ns([t.to,e,i,t.from]);this._from=ns([t.from,i,e])}}cancel(){if(this._active){this.tick(Date.now());this._active=false;this._notify(false)}}tick(t){const e=t-this._start;const s=this._duration;const i=this._prop;const n=this._from;const o=this._loop;const r=this._to;let c;this._active=n!==r&&(o||e<s);if(!this._active){this._target[i]=r;this._notify(true);return}if(e<0){this._target[i]=n;return}c=e/s%2;c=o&&c>1?2-c:c;c=this._easing(Math.min(1,Math.max(0,c)));this._target[i]=this._fn(n,r,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,s)=>{t.push({res:e,rej:s})}))}_notify(t){const e=t?"res":"rej";const s=this._promises||[];for(let t=0;t<s.length;t++){s[t][e]()}}}class Js{constructor(t,e){this._chart=t;this._properties=new Map;this.configure(e)}configure(t){if(!it(t)){return}const e=Object.keys(Le.animation);const s=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const n=t[i];if(!it(n)){return}const o={};for(const t of e){o[t]=n[t]}(st(n.properties)&&n.properties||[i]).forEach((t=>{if(t===i||!s.has(t)){s.set(t,o)}}))}))}_animateOptions(t,e){const s=e.options;const i=ei(t,s);if(!i){return[]}const n=this._createAnimations(i,s);if(s.$shared){ti(t.options.$animations,s).then((()=>{t.options=s}),(()=>{}))}return n}_createAnimations(t,e){const s=this._properties;const i=[];const n=t.$animations||(t.$animations={});const o=Object.keys(e);const r=Date.now();let c;for(c=o.length-1;c>=0;--c){const a=o[c];if(a.charAt(0)==="$"){continue}if(a==="options"){i.push(...this._animateOptions(t,e));continue}const h=e[a];let f=n[a];const l=s.get(a);if(f){if(l&&f.active()){f.update(l,h,r);continue}else{f.cancel()}}if(!l||!l.duration){t[a]=h;continue}n[a]=f=new qs(l,t,a,h);i.push(f)}return i}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length){Zs.add(this._chart,s);return true}}}function ti(t,e){const s=[];const i=Object.keys(e);for(let e=0;e<i.length;e++){const n=t[i[e]];if(n&&n.active()){s.push(n.wait())}}return Promise.all(s)}function ei(t,e){if(!e){return}let s=t.options;if(!s){t.options=e;return}if(s.$shared){t.options=s=Object.assign({},s,{$shared:false,$animations:{}})}return s}function si(t,e){const s=t&&t.options||{};const i=s.reverse;const n=s.min===undefined?e:0;const o=s.max===undefined?e:0;return{start:i?o:n,end:i?n:o}}function ii(t,e,s){if(s===false){return false}const i=si(t,s);const n=si(e,s);return{top:n.end,right:i.end,bottom:n.start,left:i.start}}function ni(t){let e,s,i,n;if(it(t)){e=t.top;s=t.right;i=t.bottom;n=t.left}else{e=s=i=n=t}return{top:e,right:s,bottom:i,left:n,disabled:t===false}}function oi(t,e){const s=[];const i=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=i.length;n<o;++n){s.push(i[n].index)}return s}function ri(t,e,s,i={}){const n=t.keys;const o=i.mode==="single";let r,c,a,h;if(e===null){return}for(r=0,c=n.length;r<c;++r){a=+n[r];if(a===s){if(i.all){continue}break}h=t.values[a];if(nt(h)&&(o||e===0||Pt(e)===Pt(h))){e+=h}}return e}function ci(t){const e=Object.keys(t);const s=new Array(e.length);let i,n,o;for(i=0,n=e.length;i<n;++i){o=e[i];s[i]={x:o,y:t[o]}}return s}function ai(t,e){const s=t&&t.options.stacked;return s||s===undefined&&e.stack!==undefined}function hi(t,e,s){return`${t.id}.${e.id}.${s.stack||s.type}`}function fi(t){const{min:e,max:s,minDefined:i,maxDefined:n}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:n?s:Number.POSITIVE_INFINITY}}function li(t,e,s){const i=t[e]||(t[e]={});return i[s]||(i[s]={})}function ui(t,e,s,i){for(const n of e.getMatchingVisibleMetas(i).reverse()){const e=t[n.index];if(s&&e>0||!s&&e<0){return n.index}}return null}function di(t,e){const{chart:s,_cachedMeta:i}=t;const n=s._stacks||(s._stacks={});const{iScale:o,vScale:r,index:c}=i;const a=o.axis;const h=r.axis;const f=hi(o,r,i);const l=e.length;let u;for(let t=0;t<l;++t){const s=e[t];const{[a]:o,[h]:l}=s;const d=s._stacks||(s._stacks={});u=d[h]=li(n,f,o);u[c]=l;u._top=ui(u,r,true,i.type);u._bottom=ui(u,r,false,i.type);const b=u._visualValues||(u._visualValues={});b[c]=l}}function bi(t,e){const s=t.scales;return Object.keys(s).filter((t=>s[t].axis===e)).shift()}function pi(t,e){return rs(t,{active:false,dataset:undefined,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function gi(t,e,s){return rs(t,{active:false,dataIndex:e,parsed:undefined,raw:undefined,element:s,index:e,mode:"default",type:"data"})}function mi(t,e){const s=t.controller.index;const i=t.vScale&&t.vScale.axis;if(!i){return}e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||e[i]===undefined||e[i][s]===undefined){return}delete e[i][s];if(e[i]._visualValues!==undefined&&e[i]._visualValues[s]!==undefined){delete e[i]._visualValues[s]}}}const yi=t=>t==="reset"||t==="none";const xi=(t,e)=>e?t:Object.assign({},t);const vi=(t,e,s)=>t&&!e.hidden&&e._stacked&&{keys:oi(s,true),values:null};class Mi{static defaults={};static datasetElementType=null;static dataElementType=null;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=undefined;this._parsing=false;this._data=undefined;this._objectData=undefined;this._sharedOptions=undefined;this._drawStart=undefined;this._drawCount=undefined;this.enableOptionSharing=false;this.supportsDecimation=false;this.$context=undefined;this._syncList=[];this.datasetElementType=new.target.datasetElementType;this.dataElementType=new.target.dataElementType;this.initialize()}initialize(){const t=this._cachedMeta;this.configure();this.linkScales();t._stacked=ai(t.vScale,t);this.addElements();if(this.options.fill&&!this.chart.isPluginEnabled("filler")){console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}}updateIndex(t){if(this.index!==t){mi(this._cachedMeta)}this.index=t}linkScales(){const t=this.chart;const e=this._cachedMeta;const s=this.getDataset();const i=(t,e,s,i)=>t==="x"?e:t==="r"?i:s;const n=e.xAxisID=rt(s.xAxisID,bi(t,"x"));const o=e.yAxisID=rt(s.yAxisID,bi(t,"y"));const r=e.rAxisID=rt(s.rAxisID,bi(t,"r"));const c=e.indexAxis;const a=e.iAxisID=i(c,n,o,r);const h=e.vAxisID=i(c,o,n,r);e.xScale=this.getScaleForId(n);e.yScale=this.getScaleForId(o);e.rScale=this.getScaleForId(r);e.iScale=this.getScaleForId(a);e.vScale=this.getScaleForId(h)}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;if(this._data){ie(this._data,this)}if(t._stacked){mi(t)}}_dataCheck(){const t=this.getDataset();const e=t.data||(t.data=[]);const s=this._data;if(it(e)){this._data=ci(e)}else if(s!==e){if(s){ie(s,this);const t=this._cachedMeta;mi(t);t._parsed=[]}if(e&&Object.isExtensible(e)){se(e,this)}this._syncList=[];this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck();if(this.datasetElementType){t.dataset=new this.datasetElementType}}buildOrUpdateElements(t){const e=this._cachedMeta;const s=this.getDataset();let i=false;this._dataCheck();const n=e._stacked;e._stacked=ai(e.vScale,e);if(e.stack!==s.stack){i=true;mi(e);e.stack=s.stack}this._resyncElements(t);if(i||n!==e._stacked){di(this,e._parsed)}}configure(){const t=this.chart.config;const e=t.datasetScopeKeys(this._type);const s=t.getOptionScopes(this.getDataset(),e,true);this.options=t.createResolver(s,this.getContext());this._parsing=this.options.parsing;this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:i}=this;const{iScale:n,_stacked:o}=s;const r=n.axis;let c=t===0&&e===i.length?true:s._sorted;let a=t>0&&s._parsed[t-1];let h,f,l;if(this._parsing===false){s._parsed=i;s._sorted=true;l=i}else{if(st(i[t])){l=this.parseArrayData(s,i,t,e)}else if(it(i[t])){l=this.parseObjectData(s,i,t,e)}else{l=this.parsePrimitiveData(s,i,t,e)}const n=()=>f[r]===null||a&&f[r]<a[r];for(h=0;h<e;++h){s._parsed[h+t]=f=l[h];if(c){if(n()){c=false}a=f}}s._sorted=c}if(o){di(this,l)}}parsePrimitiveData(t,e,s,i){const{iScale:n,vScale:o}=t;const r=n.axis;const c=o.axis;const a=n.getLabels();const h=n===o;const f=new Array(i);let l,u,d;for(l=0,u=i;l<u;++l){d=l+s;f[l]={[r]:h||n.parse(a[d],d),[c]:o.parse(e[d],d)}}return f}parseArrayData(t,e,s,i){const{xScale:n,yScale:o}=t;const r=new Array(i);let c,a,h,f;for(c=0,a=i;c<a;++c){h=c+s;f=e[h];r[c]={x:n.parse(f[0],h),y:o.parse(f[1],h)}}return r}parseObjectData(t,e,s,i){const{xScale:n,yScale:o}=t;const{xAxisKey:r="x",yAxisKey:c="y"}=this._parsing;const a=new Array(i);let h,f,l,u;for(h=0,f=i;h<f;++h){l=h+s;u=e[l];a[h]={x:n.parse(Mt(u,r),l),y:o.parse(Mt(u,c),l)}}return a}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const i=this.chart;const n=this._cachedMeta;const o=e[t.axis];const r={keys:oi(i,true),values:e._stacks[t.axis]._visualValues};return ri(r,o,n.index,{mode:s})}updateRangeFromParsed(t,e,s,i){const n=s[e.axis];let o=n===null?NaN:n;const r=i&&s._stacks[e.axis];if(i&&r){i.values=r;o=ri(i,n,this._cachedMeta.index)}t.min=Math.min(t.min,o);t.max=Math.max(t.max,o)}getMinMax(t,e){const s=this._cachedMeta;const i=s._parsed;const n=s._sorted&&t===s.iScale;const o=i.length;const r=this._getOtherScale(t);const c=vi(e,s,this.chart);const a={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};const{min:h,max:f}=fi(r);let l,u;function d(){u=i[l];const e=u[r.axis];return!nt(u[t.axis])||h>e||f<e}for(l=0;l<o;++l){if(d()){continue}this.updateRangeFromParsed(a,t,u,c);if(n){break}}if(n){for(l=o-1;l>=0;--l){if(d()){continue}this.updateRangeFromParsed(a,t,u,c);break}}return a}getAllParsedValues(t){const e=this._cachedMeta._parsed;const s=[];let i,n,o;for(i=0,n=e.length;i<n;++i){o=e[i][t.axis];if(nt(o)){s.push(o)}}return s}getMaxOverflow(){return false}getLabelAndValue(t){const e=this._cachedMeta;const s=e.iScale;const i=e.vScale;const n=this.getParsed(t);return{label:s?""+s.getLabelForValue(n[s.axis]):"",value:i?""+i.getLabelForValue(n[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default");e._clip=ni(rt(this.options.clip,ii(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx;const e=this.chart;const s=this._cachedMeta;const i=s.data||[];const n=e.chartArea;const o=[];const r=this._drawStart||0;const c=this._drawCount||i.length-r;const a=this.options.drawActiveElementsOnTop;let h;if(s.dataset){s.dataset.draw(t,n,r,c)}for(h=r;h<r+c;++h){const e=i[h];if(e.hidden){continue}if(e.active&&a){o.push(e)}else{e.draw(t,n)}}for(h=0;h<o.length;++h){o[h].draw(t,n)}}getStyle(t,e){const s=e?"active":"default";return t===undefined&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const i=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=gi(this.getContext(),t,e));n.parsed=this.getParsed(t);n.raw=i.data[t];n.index=n.dataIndex=t}else{n=this.$context||(this.$context=pi(this.chart.getContext(),this.index));n.dataset=i;n.index=n.datasetIndex=this.index}n.active=!!e;n.mode=s;return n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const i=e==="active";const n=this._cachedDataOpts;const o=t+"-"+e;const r=n[o];const c=this.enableOptionSharing&&wt(s);if(r){return xi(r,c)}const a=this.chart.config;const h=a.datasetElementScopeKeys(this._type,t);const f=i?[`${t}Hover`,"hover",t,""]:[t,""];const l=a.getOptionScopes(this.getDataset(),h);const u=Object.keys(Le.elements[t]);const d=()=>this.getContext(s,i,e);const b=a.resolveNamedOptions(l,u,d,f);if(b.$shared){b.$shared=c;n[o]=Object.freeze(xi(b,c))}return b}_resolveAnimations(t,e,s){const i=this.chart;const n=this._cachedDataOpts;const o=`animation-${e}`;const r=n[o];if(r){return r}let c;if(i.options.animation!==false){const i=this.chart.config;const n=i.datasetAnimationScopeKeys(this._type,e);const o=i.getOptionScopes(this.getDataset(),n);c=i.createResolver(o,this.getContext(t,s,e))}const a=new Js(i,c&&c.animations);if(c&&c._cacheable){n[o]=Object.freeze(a)}return a}getSharedOptions(t){if(!t.$shared){return}return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||yi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e);const i=this._sharedOptions;const n=this.getSharedOptions(s);const o=this.includeOptions(e,n)||n!==i;this.updateSharedOptions(n,e,s);return{sharedOptions:n,includeOptions:o}}updateElement(t,e,s,i){if(yi(i)){Object.assign(t,s)}else{this._resolveAnimations(e,i).update(t,s)}}updateSharedOptions(t,e,s){if(t&&!yi(e)){this._resolveAnimations(undefined,e).update(t,s)}}_setStyle(t,e,s,i){t.active=i;const n=this.getStyle(e,i);this._resolveAnimations(e,s,i).update(t,{options:!i&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",false)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",true)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;if(t){this._setStyle(t,undefined,"active",false)}}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;if(t){this._setStyle(t,undefined,"active",true)}}_resyncElements(t){const e=this._data;const s=this._cachedMeta.data;for(const[t,e,s]of this._syncList){this[t](e,s)}this._syncList=[];const i=s.length;const n=e.length;const o=Math.min(n,i);if(o){this.parse(0,o)}if(n>i){this._insertElements(i,n-i,t)}else if(n<i){this._removeElements(n,i-n)}}_insertElements(t,e,s=true){const i=this._cachedMeta;const n=i.data;const o=t+e;let r;const c=t=>{t.length+=e;for(r=t.length-1;r>=o;r--){t[r]=t[r-e]}};c(n);for(r=t;r<o;++r){n[r]=new this.dataElementType}if(this._parsing){c(i._parsed)}this.parse(t,e);if(s){this.updateElements(n,t,e,"reset")}}updateElements(t,e,s,i){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const i=s._parsed.splice(t,e);if(s._stacked){mi(s,i)}}s.data.splice(t,e)}_sync(t){if(this._parsing){this._syncList.push(t)}else{const[e,s,i]=t;this[e](s,i)}this.chart._dataChanges.push([this.index,...t])}_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){if(e){this._sync(["_removeElements",t,e])}const s=arguments.length-2;if(s){this._sync(["_insertElements",t,s])}}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function ki(t,e){if(!t._cache.$bar){const s=t.getMatchingVisibleMetas(e);let i=[];for(let e=0,n=s.length;e<n;e++){i=i.concat(s[e].controller.getAllParsedValues(t))}t._cache.$bar=ne(i.sort(((t,e)=>t-e)))}return t._cache.$bar}function wi(t){const e=t.iScale;const s=ki(e,t.type);let i=e._length;let n,o,r,c;const a=()=>{if(r===32767||r===-32768){return}if(wt(c)){i=Math.min(i,Math.abs(r-c)||i)}c=r};for(n=0,o=s.length;n<o;++n){r=e.getPixelForValue(s[n]);a()}c=undefined;for(n=0,o=e.ticks.length;n<o;++n){r=e.getPixelForTick(n);a()}return i}function _i(t,e,s,i){const n=s.barThickness;let o,r;if(et(n)){o=e.min*s.categoryPercentage;r=s.barPercentage}else{o=n*i;r=1}return{chunk:o/i,ratio:r,start:e.pixels[t]-o/2}}function Ai(t,e,s,i){const n=e.pixels;const o=n[t];let r=t>0?n[t-1]:null;let c=t<n.length-1?n[t+1]:null;const a=s.categoryPercentage;if(r===null){r=o-(c===null?e.end-e.start:c-o)}if(c===null){c=o+o-r}const h=o-(o-Math.min(r,c))/2*a;const f=Math.abs(c-r)/2*a;return{chunk:f/i,ratio:s.barPercentage,start:h}}function Oi(t,e,s,i){const n=s.parse(t[0],i);const o=s.parse(t[1],i);const r=Math.min(n,o);const c=Math.max(n,o);let a=r;let h=c;if(Math.abs(r)>Math.abs(c)){a=c;h=r}e[s.axis]=h;e._custom={barStart:a,barEnd:h,start:n,end:o,min:r,max:c}}function Si(t,e,s,i){if(st(t)){Oi(t,e,s,i)}else{e[s.axis]=s.parse(t,i)}return e}function Ri(t,e,s,i){const n=t.iScale;const o=t.vScale;const r=n.getLabels();const c=n===o;const a=[];let h,f,l,u;for(h=s,f=s+i;h<f;++h){u=e[h];l={};l[n.axis]=c||n.parse(r[h],h);a.push(Si(u,l,o,h))}return a}function Di(t){return t&&t.barStart!==undefined&&t.barEnd!==undefined}function ji(t,e,s){if(t!==0){return Pt(t)}return(e.isHorizontal()?1:-1)*(e.min>=s?1:-1)}function Bi(t){let e,s,i,n,o;if(t.horizontal){e=t.base>t.x;s="left";i="right"}else{e=t.base<t.y;s="bottom";i="top"}if(e){n="end";o="start"}else{n="start";o="end"}return{start:s,end:i,reverse:e,top:n,bottom:o}}function Ci(t,e,s,i){let n=e.borderSkipped;const o={};if(!n){t.borderSkipped=o;return}if(n===true){t.borderSkipped={top:true,right:true,bottom:true,left:true};return}const{start:r,end:c,reverse:a,top:h,bottom:f}=Bi(t);if(n==="middle"&&s){t.enableBorderRadius=true;if((s._top||0)===i){n=h}else if((s._bottom||0)===i){n=f}else{o[Ei(f,r,c,a)]=true;n=h}}o[Ei(n,r,c,a)]=true;t.borderSkipped=o}function Ei(t,e,s,i){if(i){t=Li(t,e,s);t=Pi(t,s,e)}else{t=Pi(t,e,s)}return t}function Li(t,e,s){return t===e?s:t===s?e:t}function Pi(t,e,s){return t==="start"?e:t==="end"?s:t}function Ii(t,{inflateAmount:e},s){t.inflateAmount=e==="auto"?s===1?.33:0:e}class Ti extends Mi{static id="bar";static defaults={datasetElementType:false,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:true,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:true,grid:{offset:true}},_value_:{type:"linear",beginAtZero:true}}};parsePrimitiveData(t,e,s,i){return Ri(t,e,s,i)}parseArrayData(t,e,s,i){return Ri(t,e,s,i)}parseObjectData(t,e,s,i){const{iScale:n,vScale:o}=t;const{xAxisKey:r="x",yAxisKey:c="y"}=this._parsing;const a=n.axis==="x"?r:c;const h=o.axis==="x"?r:c;const f=[];let l,u,d,b;for(l=s,u=s+i;l<u;++l){b=e[l];d={};d[n.axis]=n.parse(Mt(b,a),l);f.push(Si(Mt(b,h),d,o,l))}return f}updateRangeFromParsed(t,e,s,i){super.updateRangeFromParsed(t,e,s,i);const n=s._custom;if(n&&e===this._cachedMeta.vScale){t.min=Math.min(t.min,n.min);t.max=Math.max(t.max,n.max)}}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta;const{iScale:s,vScale:i}=e;const n=this.getParsed(t);const o=n._custom;const r=Di(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(n[i.axis]);return{label:""+s.getLabelForValue(n[s.axis]),value:r}}initialize(){this.enableOptionSharing=true;super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,i){const n=i==="reset";const{index:o,_cachedMeta:{vScale:r}}=this;const c=r.getBasePixel();const a=r.isHorizontal();const h=this._getRuler();const{sharedOptions:f,includeOptions:l}=this._getSharedOptions(e,i);for(let u=e;u<e+s;u++){const e=this.getParsed(u);const s=n||et(e[r.axis])?{base:c,head:c}:this._calculateBarValuePixels(u);const d=this._calculateBarIndexPixels(u,h);const b=(e._stacks||{})[r.axis];const p={horizontal:a,base:s.base,enableBorderRadius:!b||Di(e._custom)||o===b._top||o===b._bottom,x:a?s.head:d.center,y:a?d.center:s.head,height:a?d.size:Math.abs(s.size),width:a?Math.abs(s.size):d.size};if(l){p.options=f||this.resolveDataElementOptions(u,t[u].active?"active":i)}const g=p.options||t[u].options;Ci(p,g,b,o);Ii(p,g,h.ratio);this.updateElement(t[u],u,p,i)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta;const i=s.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped));const n=s.options.stacked;const o=[];const r=t=>{const s=t.controller.getParsed(e);const i=s&&s[t.vScale.axis];if(et(i)||isNaN(i)){return true}};for(const s of i){if(e!==undefined&&r(s)){continue}if(n===false||o.indexOf(s.stack)===-1||n===undefined&&s.stack===undefined){o.push(s.stack)}if(s.index===t){break}}if(!o.length){o.push(undefined)}return o}_getStackCount(t){return this._getStacks(undefined,t).length}_getStackIndex(t,e,s){const i=this._getStacks(t,s);const n=e!==undefined?i.indexOf(e):-1;return n===-1?i.length-1:n}_getRuler(){const t=this.options;const e=this._cachedMeta;const s=e.iScale;const i=[];let n,o;for(n=0,o=e.data.length;n<o;++n){i.push(s.getPixelForValue(this.getParsed(n)[s.axis],n))}const r=t.barThickness;const c=r||wi(e);return{min:c,pixels:i,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:i},options:{base:n,minBarLength:o}}=this;const r=n||0;const c=this.getParsed(t);const a=c._custom;const h=Di(a);let f=c[e.axis];let l=0;let u=s?this.applyStack(e,c,s):f;let d,b;if(u!==f){l=u-f;u=f}if(h){f=a.barStart;u=a.barEnd-a.barStart;if(f!==0&&Pt(f)!==Pt(a.barEnd)){l=0}l+=f}const p=!et(n)&&!h?n:l;let g=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)){d=e.getPixelForValue(l+u)}else{d=g}b=d-g;if(Math.abs(b)<o){b=ji(b,e,r)*o;if(f===r){g-=b/2}const t=e.getPixelForDecimal(0);const n=e.getPixelForDecimal(1);const a=Math.min(t,n);const l=Math.max(t,n);g=Math.max(Math.min(g,l),a);d=g+b;if(s&&!h){c._stacks[e.axis]._visualValues[i]=e.getValueForPixel(d)-e.getValueForPixel(g)}}if(g===e.getPixelForValue(r)){const t=Pt(b)*e.getLineWidthForValue(r)/2;g+=t;b-=t}return{size:b,base:g,head:d,center:d+b/2}}_calculateBarIndexPixels(t,e){const s=e.scale;const i=this.options;const n=i.skipNull;const o=rt(i.maxBarThickness,Infinity);let r,c;if(e.grouped){const s=n?this._getStackCount(t):e.stackCount;const a=i.barThickness==="flex"?Ai(t,e,i,s):_i(t,e,i,s);const h=this._getStackIndex(this.index,this._cachedMeta.stack,n?t:undefined);r=a.start+a.chunk*h+a.chunk/2;c=Math.min(o,a.chunk*a.ratio)}else{r=s.getPixelForValue(this.getParsed(t)[s.axis],t);c=Math.min(o,e.min*e.ratio)}return{base:r-c/2,head:r+c/2,center:r,size:c}}draw(){const t=this._cachedMeta;const e=t.vScale;const s=t.data;const i=s.length;let n=0;for(;n<i;++n){if(this.getParsed(n)[e.axis]!==null){s[n].draw(this._ctx)}}}}function Fi(t,e,s){let i=1;let n=1;let o=0;let r=0;if(e<Rt){const c=t;const a=c+e;const h=Math.cos(c);const f=Math.sin(c);const l=Math.cos(a);const u=Math.sin(a);const d=(t,e,i)=>Ut(t,c,a,true)?1:Math.max(e,e*s,i,i*s);const b=(t,e,i)=>Ut(t,c,a,true)?-1:Math.min(e,e*s,i,i*s);const p=d(0,h,l);const g=d(Bt,f,u);const m=b(St,h,l);const y=b(St+Bt,f,u);i=(p-m)/2;n=(g-y)/2;o=-(p+m)/2;r=-(g+y)/2}return{ratioX:i,ratioY:n,offsetX:o,offsetY:r}}class zi extends Mi{static id="doughnut";static defaults={datasetElementType:false,dataElementType:"arc",animation:{animateRotate:true,animateScale:false},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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:i}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0);const r=o.controller.getStyle(n);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:i,lineWidth:r.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index);s.chart.update()}}}};constructor(t,e){super(t,e);this.enableOptionSharing=true;this.innerRadius=undefined;this.outerRadius=undefined;this.offsetX=undefined;this.offsetY=undefined}linkScales(){}parse(t,e){const s=this.getDataset().data;const i=this._cachedMeta;if(this._parsing===false){i._parsed=s}else{let n=t=>+s[t];if(it(s[t])){const{key:t="value"}=this._parsing;n=e=>+Mt(s[e],t)}let o,r;for(o=t,r=t+e;o<r;++o){i._parsed[o]=n(o)}}}_getRotation(){return Ht(this.options.rotation-90)}_getCircumference(){return Ht(this.options.circumference)}_getRotationExtents(){let t=Rt;let e=-Rt;for(let s=0;s<this.chart.data.datasets.length;++s){if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const i=this.chart.getDatasetMeta(s).controller;const n=i._getRotation();const o=i._getCircumference();t=Math.min(t,n);e=Math.max(e,n+o)}}return{rotation:t,circumference:e-t}}update(t){const e=this.chart;const{chartArea:s}=e;const i=this._cachedMeta;const n=i.data;const o=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing;const r=Math.max((Math.min(s.width,s.height)-o)/2,0);const c=Math.min(ct(this.options.cutout,r),1);const a=this._getRingWeight(this.index);const{circumference:h,rotation:f}=this._getRotationExtents();const{ratioX:l,ratioY:u,offsetX:d,offsetY:b}=Fi(f,h,c);const p=(s.width-o)/l;const g=(s.height-o)/u;const m=Math.max(Math.min(p,g)/2,0);const y=at(this.options.radius,m);const x=Math.max(y*c,0);const v=(y-x)/this._getVisibleDatasetWeightTotal();this.offsetX=d*y;this.offsetY=b*y;i.total=this.calculateTotal();this.outerRadius=y-v*this._getRingWeightOffset(this.index);this.innerRadius=Math.max(this.outerRadius-v*a,0);this.updateElements(n,0,n.length,t)}_circumference(t,e){const s=this.options;const i=this._cachedMeta;const n=this._getCircumference();if(e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden){return 0}return this.calculateCircumference(i._parsed[t]*n/Rt)}updateElements(t,e,s,i){const n=i==="reset";const o=this.chart;const r=o.chartArea;const c=o.options;const a=c.animation;const h=(r.left+r.right)/2;const f=(r.top+r.bottom)/2;const l=n&&a.animateScale;const u=l?0:this.innerRadius;const d=l?0:this.outerRadius;const{sharedOptions:b,includeOptions:p}=this._getSharedOptions(e,i);let g=this._getRotation();let m;for(m=0;m<e;++m){g+=this._circumference(m,n)}for(m=e;m<e+s;++m){const e=this._circumference(m,n);const s=t[m];const o={x:h+this.offsetX,y:f+this.offsetY,startAngle:g,endAngle:g+e,circumference:e,outerRadius:d,innerRadius:u};if(p){o.options=b||this.resolveDataElementOptions(m,s.active?"active":i)}g+=e;this.updateElement(s,m,o,i)}}calculateTotal(){const t=this._cachedMeta;const e=t.data;let s=0;let i;for(i=0;i<e.length;i++){const n=t._parsed[i];if(n!==null&&!isNaN(n)&&this.chart.getDataVisibility(i)&&!e[i].hidden){s+=Math.abs(n)}}return s}calculateCircumference(t){const e=this._cachedMeta.total;if(e>0&&!isNaN(t)){return Rt*(Math.abs(t)/e)}return 0}getLabelAndValue(t){const e=this._cachedMeta;const s=this.chart;const i=s.data.labels||[];const n=_e(e._parsed[t],s.options.locale);return{label:i[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const s=this.chart;let i,n,o,r,c;if(!t){for(i=0,n=s.data.datasets.length;i<n;++i){if(s.isDatasetVisible(i)){o=s.getDatasetMeta(i);t=o.data;r=o.controller;break}}}if(!t){return 0}for(i=0,n=t.length;i<n;++i){c=r.resolveDataElementOptions(i);if(c.borderAlign!=="inner"){e=Math.max(e,c.borderWidth||0,c.hoverBorderWidth||0)}}return e}getMaxOffset(t){let e=0;for(let s=0,i=t.length;s<i;++s){const t=this.resolveDataElementOptions(s);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s){if(this.chart.isDatasetVisible(s)){e+=this._getRingWeight(s)}}return e}_getRingWeight(t){return Math.max(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Ni extends Mi{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:true,animateScale:true},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:i}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0);const r=o.controller.getStyle(n);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:i,lineWidth:r.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index);s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:false},beginAtZero:true,grid:{circular:true},pointLabels:{display:false},startAngle:0}}};constructor(t,e){super(t,e);this.innerRadius=undefined;this.outerRadius=undefined}getLabelAndValue(t){const e=this._cachedMeta;const s=this.chart;const i=s.data.labels||[];const n=_e(e._parsed[t].r,s.options.locale);return{label:i[t]||"",value:n}}parseObjectData(t,e,s,i){return Os.bind(this)(t,e,s,i)}update(t){const e=this._cachedMeta.data;this._updateRadius();this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta;const e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};t.data.forEach(((t,s)=>{const i=this.getParsed(s).r;if(!isNaN(i)&&this.chart.getDataVisibility(s)){if(i<e.min){e.min=i}if(i>e.max){e.max=i}}}));return e}_updateRadius(){const t=this.chart;const e=t.chartArea;const s=t.options;const i=Math.min(e.right-e.left,e.bottom-e.top);const n=Math.max(i/2,0);const o=Math.max(s.cutoutPercentage?n/100*s.cutoutPercentage:1,0);const r=(n-o)/t.getVisibleDatasetCount();this.outerRadius=n-r*this.index;this.innerRadius=this.outerRadius-r}updateElements(t,e,s,i){const n=i==="reset";const o=this.chart;const r=o.options;const c=r.animation;const a=this._cachedMeta.rScale;const h=a.xCenter;const f=a.yCenter;const l=a.getIndexAngle(0)-.5*St;let u=l;let d;const b=360/this.countVisibleElements();for(d=0;d<e;++d){u+=this._computeAngle(d,i,b)}for(d=e;d<e+s;d++){const e=t[d];let s=u;let r=u+this._computeAngle(d,i,b);let p=o.getDataVisibility(d)?a.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=r;if(n){if(c.animateScale){p=0}if(c.animateRotate){s=r=l}}const g={x:h,y:f,innerRadius:0,outerRadius:p,startAngle:s,endAngle:r,options:this.resolveDataElementOptions(d,e.active?"active":i)};this.updateElement(e,d,g,i)}}countVisibleElements(){const t=this._cachedMeta;let e=0;t.data.forEach(((t,s)=>{if(!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)){e++}}));return e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?Ht(this.resolveDataElementOptions(t,e).angle||s):0}}function Wi(t,e,s,i){const{controller:n,data:o,_sorted:r}=t;const c=n._cachedMeta.iScale;if(c&&e===c.axis&&e!=="r"&&r&&o.length){const t=c._reversePixels?te:Jt;if(!i){return t(o,e,s)}else if(n._sharedOptions){const i=o[0];const n=typeof i.getRange==="function"&&i.getRange(e);if(n){const i=t(o,e,s-n);const r=t(o,e,s+n);return{lo:i.lo,hi:r.hi}}}}return{lo:0,hi:o.length-1}}function Hi(t,e,s,i,n){const o=t.getSortedVisibleDatasetMetas();const r=s[e];for(let t=0,s=o.length;t<s;++t){const{index:s,data:c}=o[t];const{lo:a,hi:h}=Wi(o[t],e,r,n);for(let t=a;t<=h;++t){const e=c[t];if(!e.skip){i(e,s,t)}}}}function $i(t){const e=t.indexOf("x")!==-1;const s=t.indexOf("y")!==-1;return function(t,i){const n=e?Math.abs(t.x-i.x):0;const o=s?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}function Gi(t,e,s,i,n){const o=[];if(!n&&!t.isPointInArea(e)){return o}const r=function(s,r,c){if(!n&&!We(s,t.chartArea,0)){return}if(s.inRange(e.x,e.y,i)){o.push({element:s,datasetIndex:r,index:c})}};Hi(t,s,e,r,true);return o}function Yi(t,e,s,i){let n=[];function o(t,s,o){const{startAngle:r,endAngle:c}=t.getProps(["startAngle","endAngle"],i);const{angle:a}=Yt(t,{x:e.x,y:e.y});if(Ut(a,r,c)){n.push({element:t,datasetIndex:s,index:o})}}Hi(t,s,e,o);return n}function Vi(t,e,s,i,n,o){let r=[];const c=$i(s);let a=Number.POSITIVE_INFINITY;function h(s,h,f){const l=s.inRange(e.x,e.y,n);if(i&&!l){return}const u=s.getCenterPoint(n);const d=!!o||t.isPointInArea(u);if(!d&&!l){return}const b=c(e,u);if(b<a){r=[{element:s,datasetIndex:h,index:f}];a=b}else if(b===a){r.push({element:s,datasetIndex:h,index:f})}}Hi(t,s,e,h);return r}function Xi(t,e,s,i,n,o){if(!o&&!t.isPointInArea(e)){return[]}return s==="r"&&!i?Yi(t,e,s,n):Vi(t,e,s,i,n,o)}function Ui(t,e,s,i,n){const o=[];const r=s==="x"?"inXRange":"inYRange";let c=false;Hi(t,s,e,((t,i,a)=>{if(t[r](e[s],n)){o.push({element:t,datasetIndex:i,index:a});c=c||t.inRange(e.x,e.y,n)}}));if(i&&!c){return[]}return o}var Zi={evaluateInteractionItems:Hi,modes:{index(t,e,s,i){const n=Is(e,t);const o=s.axis||"x";const r=s.includeInvisible||false;const c=s.intersect?Gi(t,n,o,i,r):Xi(t,n,o,false,i,r);const a=[];if(!c.length){return[]}t.getSortedVisibleDatasetMetas().forEach((t=>{const e=c[0].index;const s=t.data[e];if(s&&!s.skip){a.push({element:s,datasetIndex:t.index,index:e})}}));return a},dataset(t,e,s,i){const n=Is(e,t);const o=s.axis||"xy";const r=s.includeInvisible||false;let c=s.intersect?Gi(t,n,o,i,r):Xi(t,n,o,false,i,r);if(c.length>0){const e=c[0].datasetIndex;const s=t.getDatasetMeta(e).data;c=[];for(let t=0;t<s.length;++t){c.push({element:s[t],datasetIndex:e,index:t})}}return c},point(t,e,s,i){const n=Is(e,t);const o=s.axis||"xy";const r=s.includeInvisible||false;return Gi(t,n,o,i,r)},nearest(t,e,s,i){const n=Is(e,t);const o=s.axis||"xy";const r=s.includeInvisible||false;return Xi(t,n,o,s.intersect,i,r)},x(t,e,s,i){const n=Is(e,t);return Ui(t,n,"x",s.intersect,i)},y(t,e,s,i){const n=Is(e,t);return Ui(t,n,"y",s.intersect,i)}}};const Ki=["left","top","right","bottom"];function Qi(t,e){return t.filter((t=>t.pos===e))}function qi(t,e){return t.filter((t=>Ki.indexOf(t.pos)===-1&&t.box.axis===e))}function Ji(t,e){return t.sort(((t,s)=>{const i=e?s:t;const n=e?t:s;return i.weight===n.weight?i.index-n.index:i.weight-n.weight}))}function tn(t){const e=[];let s,i,n,o,r,c;for(s=0,i=(t||[]).length;s<i;++s){n=t[s];({position:o,options:{stack:r,stackWeight:c=1}}=n);e.push({index:s,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:c})}return e}function en(t){const e={};for(const s of t){const{stack:t,pos:i,stackWeight:n}=s;if(!t||!Ki.includes(i)){continue}const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++;o.weight+=n}return e}function sn(t,e){const s=en(t);const{vBoxMaxWidth:i,hBoxMaxHeight:n}=e;let o,r,c;for(o=0,r=t.length;o<r;++o){c=t[o];const{fullSize:r}=c.box;const a=s[c.stack];const h=a&&c.stackWeight/a.weight;if(c.horizontal){c.width=h?h*i:r&&e.availableWidth;c.height=n}else{c.width=i;c.height=h?h*n:r&&e.availableHeight}}return s}function nn(t){const e=tn(t);const s=Ji(e.filter((t=>t.box.fullSize)),true);const i=Ji(Qi(e,"left"),true);const n=Ji(Qi(e,"right"));const o=Ji(Qi(e,"top"),true);const r=Ji(Qi(e,"bottom"));const c=qi(e,"x");const a=qi(e,"y");return{fullSize:s,leftAndTop:i.concat(o),rightAndBottom:n.concat(a).concat(r).concat(c),chartArea:Qi(e,"chartArea"),vertical:i.concat(n).concat(a),horizontal:o.concat(r).concat(c)}}function on(t,e,s,i){return Math.max(t[s],e[s])+Math.max(t[i],e[i])}function rn(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 cn(t,e,s,i){const{pos:n,box:o}=s;const r=t.maxPadding;if(!it(n)){if(s.size){t[n]-=s.size}const e=i[s.stack]||{size:0,count:1};e.size=Math.max(e.size,s.horizontal?o.height:o.width);s.size=e.size/e.count;t[n]+=s.size}if(o.getPadding){rn(r,o.getPadding())}const c=Math.max(0,e.outerWidth-on(r,t,"left","right"));const a=Math.max(0,e.outerHeight-on(r,t,"top","bottom"));const h=c!==t.w;const f=a!==t.h;t.w=c;t.h=a;return s.horizontal?{same:h,other:f}:{same:f,other:h}}function an(t){const e=t.maxPadding;function s(s){const i=Math.max(e[s]-t[s],0);t[s]+=i;return i}t.y+=s("top");t.x+=s("left");s("right");s("bottom")}function hn(t,e){const s=e.maxPadding;function i(t){const i={left:0,top:0,right:0,bottom:0};t.forEach((t=>{i[t]=Math.max(e[t],s[t])}));return i}return t?i(["left","right"]):i(["top","bottom"])}function fn(t,e,s,i){const n=[];let o,r,c,a,h,f;for(o=0,r=t.length,h=0;o<r;++o){c=t[o];a=c.box;a.update(c.width||e.w,c.height||e.h,hn(c.horizontal,e));const{same:r,other:l}=cn(e,s,c,i);h|=r&&n.length;f=f||l;if(!a.fullSize){n.push(c)}}return h&&fn(n,e,s,i)||f}function ln(t,e,s,i,n){t.top=s;t.left=e;t.right=e+i;t.bottom=s+n;t.width=i;t.height=n}function un(t,e,s,i){const n=s.padding;let{x:o,y:r}=e;for(const c of t){const t=c.box;const a=i[c.stack]||{count:1,placed:0,weight:1};const h=c.stackWeight/a.weight||1;if(c.horizontal){const i=e.w*h;const o=a.size||t.height;if(wt(a.start)){r=a.start}if(t.fullSize){ln(t,n.left,r,s.outerWidth-n.right-n.left,o)}else{ln(t,e.left+a.placed,r,i,o)}a.start=r;a.placed+=i;r=t.bottom}else{const i=e.h*h;const r=a.size||t.width;if(wt(a.start)){o=a.start}if(t.fullSize){ln(t,o,n.top,r,s.outerHeight-n.bottom-n.top)}else{ln(t,o,e.top+a.placed,r,i)}a.start=o;a.placed+=i;o=t.right}}e.x=o;e.y=r}var dn={addBox(t,e){if(!t.boxes){t.boxes=[]}e.fullSize=e.fullSize||false;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 s=t.boxes?t.boxes.indexOf(e):-1;if(s!==-1){t.boxes.splice(s,1)}},configure(t,e,s){e.fullSize=s.fullSize;e.position=s.position;e.weight=s.weight},update(t,e,s,i){if(!t){return}const n=ss(t.options.layout.padding);const o=Math.max(e-n.width,0);const r=Math.max(s-n.height,0);const c=nn(t.boxes);const a=c.vertical;const h=c.horizontal;ft(t.boxes,(t=>{if(typeof t.beforeLayout==="function"){t.beforeLayout()}}));const f=a.reduce(((t,e)=>e.box.options&&e.box.options.display===false?t:t+1),0)||1;const l=Object.freeze({outerWidth:e,outerHeight:s,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/f,hBoxMaxHeight:r/2});const u=Object.assign({},n);rn(u,ss(i));const d=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n);const b=sn(a.concat(h),l);fn(c.fullSize,d,l,b);fn(a,d,l,b);if(fn(h,d,l,b)){fn(a,d,l,b)}an(d);un(c.leftAndTop,d,l,b);d.x+=d.w;d.y+=d.h;un(c.rightAndBottom,d,l,b);t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w};ft(c.chartArea,(e=>{const s=e.box;Object.assign(s,t.chartArea);s.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})}))}};class bn{acquireContext(t,e){}releaseContext(t){return false}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,i){e=Math.max(0,e||t.width);s=s||t.height;return{width:e,height:Math.max(0,i?Math.floor(e/i):s)}}isAttached(t){return true}updateConfig(t){}}class pn extends bn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=false}}const gn="$chartjs";const mn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};const yn=t=>t===null||t==="";function xn(t,e){const s=t.style;const i=t.getAttribute("height");const n=t.getAttribute("width");t[gn]={initial:{height:i,width:n,style:{display:s.display,height:s.height,width:s.width}}};s.display=s.display||"block";s.boxSizing=s.boxSizing||"border-box";if(yn(n)){const e=Hs(t,"width");if(e!==undefined){t.width=e}}if(yn(i)){if(t.style.height===""){t.height=t.width/(e||2)}else{const e=Hs(t,"height");if(e!==undefined){t.height=e}}}return t}const vn=Ws?{passive:true}:false;function Mn(t,e,s){t.addEventListener(e,s,vn)}function kn(t,e,s){t.canvas.removeEventListener(e,s,vn)}function wn(t,e){const s=mn[t.type]||t.type;const{x:i,y:n}=Is(t,e);return{type:s,chart:e,native:t,x:i!==undefined?i:null,y:n!==undefined?n:null}}function _n(t,e){for(const s of t){if(s===e||s.contains(e)){return true}}}function An(t,e,s){const i=t.canvas;const n=new MutationObserver((t=>{let e=false;for(const s of t){e=e||_n(s.addedNodes,i);e=e&&!_n(s.removedNodes,i)}if(e){s()}}));n.observe(document,{childList:true,subtree:true});return n}function On(t,e,s){const i=t.canvas;const n=new MutationObserver((t=>{let e=false;for(const s of t){e=e||_n(s.removedNodes,i);e=e&&!_n(s.addedNodes,i)}if(e){s()}}));n.observe(document,{childList:true,subtree:true});return n}const Sn=new Map;let Rn=0;function Dn(){const t=window.devicePixelRatio;if(t===Rn){return}Rn=t;Sn.forEach(((e,s)=>{if(s.currentDevicePixelRatio!==t){e()}}))}function jn(t,e){if(!Sn.size){window.addEventListener("resize",Dn)}Sn.set(t,e)}function Bn(t){Sn.delete(t);if(!Sn.size){window.removeEventListener("resize",Dn)}}function Cn(t,e,s){const i=t.canvas;const n=i&&Rs(i);if(!n){return}const o=re(((t,e)=>{const i=n.clientWidth;s(t,e);if(i<n.clientWidth){s()}}),window);const r=new ResizeObserver((t=>{const e=t[0];const s=e.contentRect.width;const i=e.contentRect.height;if(s===0&&i===0){return}o(s,i)}));r.observe(n);jn(t,o);return r}function En(t,e,s){if(s){s.disconnect()}if(e==="resize"){Bn(t)}}function Ln(t,e,s){const i=t.canvas;const n=re((e=>{if(t.ctx!==null){s(wn(e,t))}}),t);Mn(i,e,n);return n}class Pn extends bn{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");if(s&&s.canvas===t){xn(t,e);return s}return null}releaseContext(t){const e=t.canvas;if(!e[gn]){return false}const s=e[gn].initial;["height","width"].forEach((t=>{const i=s[t];if(et(i)){e.removeAttribute(t)}else{e.setAttribute(t,i)}}));const i=s.style||{};Object.keys(i).forEach((t=>{e.style[t]=i[t]}));e.width=e.width;delete e[gn];return true}addEventListener(t,e,s){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={});const n={attach:An,detach:On,resize:Cn};const o=n[e]||Ln;i[e]=o(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={});const i=s[e];if(!i){return}const n={attach:En,detach:En,resize:En};const o=n[e]||kn;o(t,e,i);s[e]=undefined}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,i){return zs(t,e,s,i)}isAttached(t){const e=Rs(t);return!!(e&&e.isConnected)}}function In(t){if(!Ss()||typeof OffscreenCanvas!=="undefined"&&t instanceof OffscreenCanvas){return pn}return Pn}class Tn{static defaults={};static defaultRoutes=undefined;x;y;active=false;options;$animations;tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return zt(this.x)&&zt(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s){return this}const i={};t.forEach((t=>{i[t]=s[t]&&s[t].active()?s[t]._to:this[t]}));return i}}function Fn(t,e){const s=t.options.ticks;const i=zn(t);const n=Math.min(s.maxTicksLimit||i,i);const o=s.major.enabled?Wn(e):[];const r=o.length;const c=o[0];const a=o[r-1];const h=[];if(r>n){Hn(e,h,o,r/n);return h}const f=Nn(o,e,n);if(r>0){let t,s;const i=r>1?Math.round((a-c)/(r-1)):null;$n(e,h,f,et(i)?0:c-i,c);for(t=0,s=r-1;t<s;t++){$n(e,h,f,o[t],o[t+1])}$n(e,h,f,a,et(i)?e.length:a+i);return h}$n(e,h,f);return h}function zn(t){const e=t.options.offset;const s=t._tickSize();const i=t._length/s+(e?0:1);const n=t._maxLength/s;return Math.floor(Math.min(i,n))}function Nn(t,e,s){const i=Gn(t);const n=e.length/s;if(!i){return Math.max(n,1)}const o=Ft(i);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>n){return e}}return Math.max(n,1)}function Wn(t){const e=[];let s,i;for(s=0,i=t.length;s<i;s++){if(t[s].major){e.push(s)}}return e}function Hn(t,e,s,i){let n=0;let o=s[0];let r;i=Math.ceil(i);for(r=0;r<t.length;r++){if(r===o){e.push(t[r]);n++;o=s[n*i]}}}function $n(t,e,s,i,n){const o=rt(i,0);const r=Math.min(rt(n,t.length),t.length);let c=0;let a,h,f;s=Math.ceil(s);if(n){a=n-i;s=a/Math.floor(a/s)}f=o;while(f<0){c++;f=Math.round(o+c*s)}for(h=Math.max(o,0);h<r;h++){if(h===f){e.push(t[h]);c++;f=Math.round(o+c*s)}}}function Gn(t){const e=t.length;let s,i;if(e<2){return false}for(i=t[0],s=1;s<e;++s){if(t[s]-t[s-1]!==i){return false}}return i}const Yn=t=>t==="left"?"right":t==="right"?"left":t;const Vn=(t,e,s)=>e==="top"||e==="left"?t[e]+s:t[e]-s;const Xn=(t,e)=>Math.min(e||t,t);function Un(t,e){const s=[];const i=t.length/e;const n=t.length;let o=0;for(;o<n;o+=i){s.push(t[Math.floor(o)])}return s}function Zn(t,e,s){const i=t.ticks.length;const n=Math.min(e,i-1);const o=t._startPixel;const r=t._endPixel;const c=1e-6;let a=t.getPixelForTick(n);let h;if(s){if(i===1){h=Math.max(a-o,r-a)}else if(e===0){h=(t.getPixelForTick(1)-a)/2}else{h=(a-t.getPixelForTick(n-1))/2}a+=n<e?h:-h;if(a<o-c||a>r+c){return}}return a}function Kn(t,e){ft(t,(t=>{const s=t.gc;const i=s.length/2;let n;if(i>e){for(n=0;n<i;++n){delete t.data[s[n]]}s.splice(0,i)}}))}function Qn(t){return t.drawTicks?t.tickLength:0}function qn(t,e){if(!t.display){return 0}const s=is(t.font,e);const i=ss(t.padding);const n=st(t.text)?t.text.length:1;return n*s.lineHeight+i.height}function Jn(t,e){return rs(t,{scale:e,type:"scale"})}function to(t,e,s){return rs(t,{tick:s,index:e,type:"tick"})}function eo(t,e,s){let i=ae(t);if(s&&e!=="right"||!s&&e==="right"){i=Yn(i)}return i}function so(t,e,s,i){const{top:n,left:o,bottom:r,right:c,chart:a}=t;const{chartArea:h,scales:f}=a;let l=0;let u,d,b;const p=r-n;const g=c-o;if(t.isHorizontal()){d=he(i,o,c);if(it(s)){const t=Object.keys(s)[0];const i=s[t];b=f[t].getPixelForValue(i)+p-e}else if(s==="center"){b=(h.bottom+h.top)/2+p-e}else{b=Vn(t,s,e)}u=c-o}else{if(it(s)){const t=Object.keys(s)[0];const i=s[t];d=f[t].getPixelForValue(i)-g+e}else if(s==="center"){d=(h.left+h.right)/2-g+e}else{d=Vn(t,s,e)}b=he(i,r,n);l=s==="left"?-Bt:Bt}return{titleX:d,titleY:b,maxWidth:u,rotation:l}}class io extends Tn{constructor(t){super();this.id=t.id;this.type=t.type;this.options=undefined;this.ctx=t.ctx;this.chart=t.chart;this.top=undefined;this.bottom=undefined;this.left=undefined;this.right=undefined;this.width=undefined;this.height=undefined;this._margins={left:0,right:0,top:0,bottom:0};this.maxWidth=undefined;this.maxHeight=undefined;this.paddingTop=undefined;this.paddingBottom=undefined;this.paddingLeft=undefined;this.paddingRight=undefined;this.axis=undefined;this.labelRotation=undefined;this.min=undefined;this.max=undefined;this._range=undefined;this.ticks=[];this._gridLineItems=null;this._labelItems=null;this._labelSizes=null;this._length=0;this._maxLength=0;this._longestTextCache={};this._startPixel=undefined;this._endPixel=undefined;this._reversePixels=false;this._userMax=undefined;this._userMin=undefined;this._suggestedMax=undefined;this._suggestedMin=undefined;this._ticksLength=0;this._borderValue=0;this._cache={};this._dataLimitsCached=false;this.$context=undefined}init(t){this.options=t.setContext(this.getContext());this.axis=t.axis;this._userMin=this.parse(t.min);this._userMax=this.parse(t.max);this._suggestedMin=this.parse(t.suggestedMin);this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:i}=this;t=ot(t,Number.POSITIVE_INFINITY);e=ot(e,Number.NEGATIVE_INFINITY);s=ot(s,Number.POSITIVE_INFINITY);i=ot(i,Number.NEGATIVE_INFINITY);return{min:ot(t,s),max:ot(e,i),minDefined:nt(t),maxDefined:nt(e)}}getMinMax(t){let{min:e,max:s,minDefined:i,maxDefined:n}=this.getUserBounds();let o;if(i&&n){return{min:e,max:s}}const r=this.getMatchingVisibleMetas();for(let c=0,a=r.length;c<a;++c){o=r[c].controller.getMinMax(this,t);if(!i){e=Math.min(e,o.min)}if(!n){s=Math.max(s,o.max)}}e=n&&e>s?s:e;s=i&&e>s?e:s;return{min:ot(e,ot(s,e)),max:ot(s,ot(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){const e=this._labelItems||(this._labelItems=this._computeLabelItems(t));return e}beforeLayout(){this._cache={};this._dataLimitsCached=false}beforeUpdate(){ht(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:i,grace:n,ticks:o}=this.options;const r=o.sampleSize;this.beforeUpdate();this.maxWidth=t;this.maxHeight=e;this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s);this.ticks=null;this._labelSizes=null;this._gridLineItems=null;this._labelItems=null;this.beforeSetDimensions();this.setDimensions();this.afterSetDimensions();this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom;if(!this._dataLimitsCached){this.beforeDataLimits();this.determineDataLimits();this.afterDataLimits();this._range=os(this,n,i);this._dataLimitsCached=true}this.beforeBuildTicks();this.ticks=this.buildTicks()||[];this.afterBuildTicks();const c=r<this.ticks.length;this._convertTicksToLabels(c?Un(this.ticks,r):this.ticks);this.configure();this.beforeCalculateLabelRotation();this.calculateLabelRotation();this.afterCalculateLabelRotation();if(o.display&&(o.autoSkip||o.source==="auto")){this.ticks=Fn(this,this.ticks);this._labelSizes=null;this.afterAutoSkip()}if(c){this._convertTicksToLabels(this.ticks)}this.beforeFit();this.fit();this.afterFit();this.afterUpdate()}configure(){let t=this.options.reverse;let e,s;if(this.isHorizontal()){e=this.left;s=this.right}else{e=this.top;s=this.bottom;t=!t}this._startPixel=e;this._endPixel=s;this._reversePixels=t;this._length=s-e;this._alignToPixels=this.options.alignToPixels}afterUpdate(){ht(this.options.afterUpdate,[this])}beforeSetDimensions(){ht(this.options.beforeSetDimensions,[this])}setDimensions(){if(this.isHorizontal()){this.width=this.maxWidth;this.left=0;this.right=this.width}else{this.height=this.maxHeight;this.top=0;this.bottom=this.height}this.paddingLeft=0;this.paddingTop=0;this.paddingRight=0;this.paddingBottom=0}afterSetDimensions(){ht(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext());ht(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ht(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,i,n;for(s=0,i=t.length;s<i;s++){n=t[s];n.label=ht(e.callback,[n.value,s,t],this)}}afterTickToLabelConversion(){ht(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ht(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options;const e=t.ticks;const s=Xn(this.ticks.length,t.ticks.maxTicksLimit);const i=e.minRotation||0;const n=e.maxRotation;let o=i;let r,c,a;if(!this._isVisible()||!e.display||i>=n||s<=1||!this.isHorizontal()){this.labelRotation=i;return}const h=this._getLabelSizes();const f=h.widest.width;const l=h.highest.height;const u=Zt(this.chart.width-f,0,this.maxWidth);r=t.offset?this.maxWidth/s:u/(s-1);if(f+6>r){r=u/(s-(t.offset?.5:1));c=this.maxHeight-Qn(t.grid)-e.padding-qn(t.title,this.chart.options.font);a=Math.sqrt(f*f+l*l);o=$t(Math.min(Math.asin(Zt((h.highest.height+6)/r,-1,1)),Math.asin(Zt(c/a,-1,1))-Math.asin(Zt(l/a,-1,1))));o=Math.max(i,Math.min(n,o))}this.labelRotation=o}afterCalculateLabelRotation(){ht(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ht(this.options.beforeFit,[this])}fit(){const t={width:0,height:0};const{chart:e,options:{ticks:s,title:i,grid:n}}=this;const o=this._isVisible();const r=this.isHorizontal();if(o){const o=qn(i,e.options.font);if(r){t.width=this.maxWidth;t.height=Qn(n)+o}else{t.height=this.maxHeight;t.width=Qn(n)+o}if(s.display&&this.ticks.length){const{first:e,last:i,widest:n,highest:o}=this._getLabelSizes();const c=s.padding*2;const a=Ht(this.labelRotation);const h=Math.cos(a);const f=Math.sin(a);if(r){const e=s.mirror?0:f*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+c)}else{const e=s.mirror?0:h*n.width+f*o.height;t.width=Math.min(this.maxWidth,t.width+e+c)}this._calculatePadding(e,i,f,h)}}this._handleMargins();if(r){this.width=this._length=e.width-this._margins.left-this._margins.right;this.height=t.height}else{this.width=t.width;this.height=this._length=e.height-this._margins.top-this._margins.bottom}}_calculatePadding(t,e,s,i){const{ticks:{align:n,padding:o},position:r}=this.options;const c=this.labelRotation!==0;const a=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left;const h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0;let l=0;if(c){if(a){f=i*t.width;l=s*e.height}else{f=s*t.height;l=i*e.width}}else if(n==="start"){l=e.width}else if(n==="end"){f=t.width}else if(n!=="inner"){f=t.width/2;l=e.width/2}this.paddingLeft=Math.max((f-r+o)*this.width/(this.width-r),0);this.paddingRight=Math.max((l-h+o)*this.width/(this.width-h),0)}else{let s=e.height/2;let i=t.height/2;if(n==="start"){s=0;i=t.height}else if(n==="end"){s=e.height;i=0}this.paddingTop=s+o;this.paddingBottom=i+o}}_handleMargins(){if(this._margins){this._margins.left=Math.max(this.paddingLeft,this._margins.left);this._margins.top=Math.max(this.paddingTop,this._margins.top);this._margins.right=Math.max(this.paddingRight,this._margins.right);this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom)}}afterFit(){ht(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion();this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++){if(et(t[e].label)){t.splice(e,1);s--;e--}}this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;if(e<s.length){s=Un(s,e)}this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:i,_longestTextCache:n}=this;const o=[];const r=[];const c=Math.floor(e/Xn(e,s));let a=0;let h=0;let f,l,u,d,b,p,g,m,y,x,v;for(f=0;f<e;f+=c){d=t[f].label;b=this._resolveTickFontOptions(f);i.font=p=b.string;g=n[p]=n[p]||{data:{},gc:[]};m=b.lineHeight;y=x=0;if(!et(d)&&!st(d)){y=Ie(i,g.data,g.gc,y,d);x=m}else if(st(d)){for(l=0,u=d.length;l<u;++l){v=d[l];if(!et(v)&&!st(v)){y=Ie(i,g.data,g.gc,y,v);x+=m}}}o.push(y);r.push(x);a=Math.max(y,a);h=Math.max(x,h)}Kn(n,e);const M=o.indexOf(a);const k=r.indexOf(h);const w=t=>({width:o[t]||0,height:r[t]||0});return{first:w(0),last:w(e-1),widest:w(M),highest:w(k),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;if(t<0||t>e.length-1){return null}return this.getPixelForValue(e[t].value)}getPixelForDecimal(t){if(this._reversePixels){t=1-t}const e=this._startPixel+t*this._length;return Kt(this._alignToPixels?Te(this.chart,e,0):e)}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.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=to(this.getContext(),t,s))}return this.$context||(this.$context=Jn(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks;const e=Ht(this.labelRotation);const s=Math.abs(Math.cos(e));const i=Math.abs(Math.sin(e));const n=this._getLabelSizes();const o=t.autoSkipPadding||0;const r=n?n.widest.width+o:0;const c=n?n.highest.height+o:0;return this.isHorizontal()?c*s>r*i?r/s:c/i:c*i<r*s?c/s:r/i}_isVisible(){const t=this.options.display;if(t!=="auto"){return!!t}return this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis;const s=this.chart;const i=this.options;const{grid:n,position:o,border:r}=i;const c=n.offset;const a=this.isHorizontal();const h=this.ticks;const f=h.length+(c?1:0);const l=Qn(n);const u=[];const d=r.setContext(this.getContext());const b=d.display?d.width:0;const p=b/2;const g=function(t){return Te(s,t,b)};let m,y,x,v;let M,k,w,_,A,O,S,R;if(o==="top"){m=g(this.bottom);k=this.bottom-l;_=m-p;O=g(t.top)+p;R=t.bottom}else if(o==="bottom"){m=g(this.top);O=t.top;R=g(t.bottom)-p;k=m+p;_=this.top+l}else if(o==="left"){m=g(this.right);M=this.right-l;w=m-p;A=g(t.left)+p;S=t.right}else if(o==="right"){m=g(this.left);A=t.left;S=g(t.right)-p;M=m+p;w=this.left+l}else if(e==="x"){if(o==="center"){m=g((t.top+t.bottom)/2+.5)}else if(it(o)){const t=Object.keys(o)[0];const e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}O=t.top;R=t.bottom;k=m+p;_=k+l}else if(e==="y"){if(o==="center"){m=g((t.left+t.right)/2)}else if(it(o)){const t=Object.keys(o)[0];const e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}M=m-p;w=M-l;A=t.left;S=t.right}const D=rt(i.ticks.maxTicksLimit,f);const j=Math.max(1,Math.ceil(f/D));for(y=0;y<f;y+=j){const t=this.getContext(y);const e=n.setContext(t);const i=r.setContext(t);const o=e.lineWidth;const h=e.color;const f=i.dash||[];const l=i.dashOffset;const d=e.tickWidth;const b=e.tickColor;const p=e.tickBorderDash||[];const g=e.tickBorderDashOffset;x=Zn(this,y,c);if(x===undefined){continue}v=Te(s,x,o);if(a){M=w=A=S=v}else{k=_=O=R=v}u.push({tx1:M,ty1:k,tx2:w,ty2:_,x1:A,y1:O,x2:S,y2:R,width:o,color:h,borderDash:f,borderDashOffset:l,tickWidth:d,tickColor:b,tickBorderDash:p,tickBorderDashOffset:g})}this._ticksLength=f;this._borderValue=m;return u}_computeLabelItems(t){const e=this.axis;const s=this.options;const{position:i,ticks:n}=s;const o=this.isHorizontal();const r=this.ticks;const{align:c,crossAlign:a,padding:h,mirror:f}=n;const l=Qn(s.grid);const u=l+h;const d=f?-h:u;const b=-Ht(this.labelRotation);const p=[];let g,m,y,x,v,M,k,w,_,A,O,S;let R="middle";if(i==="top"){M=this.bottom-d;k=this._getXAxisLabelAlignment()}else if(i==="bottom"){M=this.top+d;k=this._getXAxisLabelAlignment()}else if(i==="left"){const t=this._getYAxisLabelAlignment(l);k=t.textAlign;v=t.x}else if(i==="right"){const t=this._getYAxisLabelAlignment(l);k=t.textAlign;v=t.x}else if(e==="x"){if(i==="center"){M=(t.top+t.bottom)/2+u}else if(it(i)){const t=Object.keys(i)[0];const e=i[t];M=this.chart.scales[t].getPixelForValue(e)+u}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(i==="center"){v=(t.left+t.right)/2-u}else if(it(i)){const t=Object.keys(i)[0];const e=i[t];v=this.chart.scales[t].getPixelForValue(e)}k=this._getYAxisLabelAlignment(l).textAlign}if(e==="y"){if(c==="start"){R="top"}else if(c==="end"){R="bottom"}}const D=this._getLabelSizes();for(g=0,m=r.length;g<m;++g){y=r[g];x=y.label;const t=n.setContext(this.getContext(g));w=this.getPixelForTick(g)+n.labelOffset;_=this._resolveTickFontOptions(g);A=_.lineHeight;O=st(x)?x.length:1;const e=O/2;const s=t.color;const c=t.textStrokeColor;const h=t.textStrokeWidth;let l=k;if(o){v=w;if(k==="inner"){if(g===m-1){l=!this.options.reverse?"right":"left"}else if(g===0){l=!this.options.reverse?"left":"right"}else{l="center"}}if(i==="top"){if(a==="near"||b!==0){S=-O*A+A/2}else if(a==="center"){S=-D.highest.height/2-e*A+A}else{S=-D.highest.height+A/2}}else{if(a==="near"||b!==0){S=A/2}else if(a==="center"){S=D.highest.height/2-e*A}else{S=D.highest.height-O*A}}if(f){S*=-1}if(b!==0&&!t.showLabelBackdrop){v+=A/2*Math.sin(b)}}else{M=w;S=(1-O)*A/2}let u;if(t.showLabelBackdrop){const e=ss(t.backdropPadding);const s=D.heights[g];const i=D.widths[g];let n=S-e.top;let o=0-e.left;switch(R){case"middle":n-=s/2;break;case"bottom":n-=s;break}switch(k){case"center":o-=i/2;break;case"right":o-=i;break;case"inner":if(g===m-1){o-=i}else if(g>0){o-=i/2}break}u={left:o,top:n,width:i+e.width,height:s+e.height,color:t.backdropColor}}p.push({label:x,font:_,textOffset:S,options:{rotation:b,color:s,strokeColor:c,strokeWidth:h,textAlign:l,textBaseline:R,translation:[v,M],backdrop:u}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;const s=-Ht(this.labelRotation);if(s){return t==="top"?"left":"right"}let i="center";if(e.align==="start"){i="left"}else if(e.align==="end"){i="right"}else if(e.align==="inner"){i="inner"}return i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:i,padding:n}}=this.options;const o=this._getLabelSizes();const r=t+n;const c=o.widest.width;let a;let h;if(e==="left"){if(i){h=this.right+n;if(s==="near"){a="left"}else if(s==="center"){a="center";h+=c/2}else{a="right";h+=c}}else{h=this.right-r;if(s==="near"){a="right"}else if(s==="center"){a="center";h-=c/2}else{a="left";h=this.left}}}else if(e==="right"){if(i){h=this.left+n;if(s==="near"){a="right"}else if(s==="center"){a="center";h-=c/2}else{a="left";h-=c}}else{h=this.left+r;if(s==="near"){a="left"}else if(s==="center"){a="center";h+=c/2}else{a="right";h=this.right}}}else{a="right"}return{textAlign:a,x:h}}_computeLabelArea(){if(this.options.ticks.mirror){return}const t=this.chart;const e=this.options.position;if(e==="left"||e==="right"){return{top:0,left:this.left,bottom:t.height,right:this.right}}if(e==="top"||e==="bottom"){return{top:this.top,left:0,bottom:this.bottom,right:t.width}}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:i,width:n,height:o}=this;if(e){t.save();t.fillStyle=e;t.fillRect(s,i,n,o);t.restore()}}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display){return 0}const s=this.ticks;const i=s.findIndex((e=>e.value===t));if(i>=0){const t=e.setContext(this.getContext(i));return t.lineWidth}return 0}drawGrid(t){const e=this.options.grid;const s=this.ctx;const i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const r=(t,e,i)=>{if(!i.width||!i.color){return}s.save();s.lineWidth=i.width;s.strokeStyle=i.color;s.setLineDash(i.borderDash||[]);s.lineDashOffset=i.borderDashOffset;s.beginPath();s.moveTo(t.x,t.y);s.lineTo(e.x,e.y);s.stroke();s.restore()};if(e.display){for(n=0,o=i.length;n<o;++n){const t=i[n];if(e.drawOnChartArea){r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t)}if(e.drawTicks){r({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{chart:t,ctx:e,options:{border:s,grid:i}}=this;const n=s.setContext(this.getContext());const o=s.display?n.width:0;if(!o){return}const r=i.setContext(this.getContext(0)).lineWidth;const c=this._borderValue;let a,h,f,l;if(this.isHorizontal()){a=Te(t,this.left,o)-o/2;h=Te(t,this.right,r)+r/2;f=l=c}else{f=Te(t,this.top,o)-o/2;l=Te(t,this.bottom,r)+r/2;a=h=c}e.save();e.lineWidth=n.width;e.strokeStyle=n.color;e.beginPath();e.moveTo(a,f);e.lineTo(h,l);e.stroke();e.restore()}drawLabels(t){const e=this.options.ticks;if(!e.display){return}const s=this.ctx;const i=this._computeLabelArea();if(i){He(s,i)}const n=this.getLabelItems(t);for(const t of n){const e=t.options;const i=t.font;const n=t.label;const o=t.textOffset;Xe(s,n,0,o,i,e)}if(i){$e(s)}}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:i}}=this;if(!s.display){return}const n=is(s.font);const o=ss(s.padding);const r=s.align;let c=n.lineHeight/2;if(e==="bottom"||e==="center"||it(e)){c+=o.bottom;if(st(s.text)){c+=n.lineHeight*(s.text.length-1)}}else{c+=o.top}const{titleX:a,titleY:h,maxWidth:f,rotation:l}=so(this,c,e,r);Xe(t,s.text,0,0,n,{color:s.color,maxWidth:f,rotation:l,textAlign:eo(r,e,i),textBaseline:"middle",translation:[a,h]})}draw(t){if(!this._isVisible()){return}this.drawBackground();this.drawGrid(t);this.drawBorder();this.drawTitle();this.drawLabels(t)}_layers(){const t=this.options;const e=t.ticks&&t.ticks.z||0;const s=rt(t.grid&&t.grid.z,-1);const i=rt(t.border&&t.border.z,0);if(!this._isVisible()||this.draw!==io.prototype.draw){return[{z:e,draw:t=>{this.draw(t)}}]}return[{z:s,draw:t=>{this.drawBackground();this.drawGrid(t);this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas();const s=this.axis+"AxisID";const i=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];if(o[s]===this.id&&(!t||o.type===t)){i.push(o)}}return i}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return is(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class no{constructor(t,e,s){this.type=t;this.scope=e;this.override=s;this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;if(co(e)){s=this.register(e)}const i=this.items;const n=t.id;const o=this.scope+"."+n;if(!n){throw new Error("class does not have id: "+t)}if(n in i){return o}i[n]=t;oo(t,o,s);if(this.override){Le.override(t.id,t.overrides)}return o}get(t){return this.items[t]}unregister(t){const e=this.items;const s=t.id;const i=this.scope;if(s in e){delete e[s]}if(i&&s in Le[i]){delete Le[i][s];if(this.override){delete De[s]}}}}function oo(t,e,s){const i=pt(Object.create(null),[s?Le.get(s):{},Le.get(e),t.defaults]);Le.set(e,i);if(t.defaultRoutes){ro(e,t.defaultRoutes)}if(t.descriptors){Le.describe(e,t.descriptors)}}function ro(t,e){Object.keys(e).forEach((s=>{const i=s.split(".");const n=i.pop();const o=[t].concat(i).join(".");const r=e[s].split(".");const c=r.pop();const a=r.join(".");Le.route(o,n,a,c)}))}function co(t){return"id"in t&&"defaults"in t}class ao{constructor(){this.controllers=new no(Mi,"datasets",true);this.elements=new no(Tn,"elements");this.plugins=new no(Object,"plugins");this.scales=new no(io,"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,s){[...e].forEach((e=>{const i=s||this._getRegistryForType(e);if(s||i.isForType(e)||i===this.plugins&&e.id){this._exec(t,i,e)}else{ft(e,(e=>{const i=s||this._getRegistryForType(e);this._exec(t,i,e)}))}}))}_exec(t,e,s){const i=kt(t);ht(s["before"+i],[],s);e[t](s);ht(s["after"+i],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t)){return s}}return this.plugins}_get(t,e,s){const i=e.get(t);if(i===undefined){throw new Error('"'+t+'" is not a registered '+s+".")}return i}}var ho=new ao;class fo{constructor(){this._init=[]}notify(t,e,s,i){if(e==="beforeInit"){this._init=this._createDescriptors(t,true);this._notify(this._init,t,"install")}const n=i?this._descriptors(t).filter(i):this._descriptors(t);const o=this._notify(n,t,e,s);if(e==="afterDestroy"){this._notify(n,t,"stop");this._notify(this._init,t,"uninstall")}return o}_notify(t,e,s,i){i=i||{};for(const n of t){const t=n.plugin;const o=t[s];const r=[e,i,n.options];if(ht(o,r,t)===false&&i.cancelable){return false}}return true}invalidate(){if(!et(this._cache)){this._oldCache=this._cache;this._cache=undefined}}_descriptors(t){if(this._cache){return this._cache}const e=this._cache=this._createDescriptors(t);this._notifyStateChanges(t);return e}_createDescriptors(t,e){const s=t&&t.config;const i=rt(s.options&&s.options.plugins,{});const n=lo(s);return i===false&&!e?[]:bo(t,n,i,e)}_notifyStateChanges(t){const e=this._oldCache||[];const s=this._cache;const i=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(i(e,s),t,"stop");this._notify(i(s,e),t,"start")}}function lo(t){const e={};const s=[];const i=Object.keys(ho.plugins.items);for(let t=0;t<i.length;t++){s.push(ho.getPlugin(i[t]))}const n=t.plugins||[];for(let t=0;t<n.length;t++){const i=n[t];if(s.indexOf(i)===-1){s.push(i);e[i.id]=true}}return{plugins:s,localIds:e}}function uo(t,e){if(!e&&t===false){return null}if(t===true){return{}}return t}function bo(t,{plugins:e,localIds:s},i,n){const o=[];const r=t.getContext();for(const c of e){const e=c.id;const a=uo(i[e],n);if(a===null){continue}o.push({plugin:c,options:po(t.config,{plugin:c,local:s[e]},a,r)})}return o}function po(t,{plugin:e,local:s},i,n){const o=t.pluginScopeKeys(e);const r=t.getOptionScopes(i,o);if(s&&e.defaults){r.push(e.defaults)}return t.createResolver(r,n,[""],{scriptable:false,indexable:false,allKeys:true})}function go(t,e){const s=Le.datasets[t]||{};const i=(e.datasets||{})[t]||{};return i.indexAxis||e.indexAxis||s.indexAxis||"x"}function mo(t,e){let s=t;if(t==="_index_"){s=e}else if(t==="_value_"){s=e==="x"?"y":"x"}return s}function yo(t,e){return t===e?"_index_":"_value_"}function xo(t){if(t==="x"||t==="y"||t==="r"){return t}}function vo(t){if(t==="top"||t==="bottom"){return"x"}if(t==="left"||t==="right"){return"y"}}function Mo(t,...e){if(xo(t)){return t}for(const s of e){const e=s.axis||vo(s.position)||t.length>1&&xo(t[0].toLowerCase());if(e){return e}}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function ko(t,e,s){if(s[e+"AxisID"]===t){return{axis:e}}}function wo(t,e){if(e.data&&e.data.datasets){const s=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(s.length){return ko(t,"x",s[0])||ko(t,"y",s[0])}}return{}}function _o(t,e){const s=De[t.type]||{scales:{}};const i=e.scales||{};const n=go(t.type,e);const o=Object.create(null);Object.keys(i).forEach((e=>{const r=i[e];if(!it(r)){return console.error(`Invalid scale configuration for scale: ${e}`)}if(r._proxy){return console.warn(`Ignoring resolver passed as options for scale: ${e}`)}const c=Mo(e,r,wo(e,t),Le.scales[r.type]);const a=yo(c,n);const h=s.scales||{};o[e]=gt(Object.create(null),[{axis:c},r,h[c],h[a]])}));t.data.datasets.forEach((s=>{const n=s.type||t.type;const r=s.indexAxis||go(n,e);const c=De[n]||{};const a=c.scales||{};Object.keys(a).forEach((t=>{const e=mo(t,r);const n=s[e+"AxisID"]||e;o[n]=o[n]||Object.create(null);gt(o[n],[{axis:e},i[n],a[t]])}))}));Object.keys(o).forEach((t=>{const e=o[t];gt(e,[Le.scales[e.type],Le.scale])}));return o}function Ao(t){const e=t.options||(t.options={});e.plugins=rt(e.plugins,{});e.scales=_o(t,e)}function Oo(t){t=t||{};t.datasets=t.datasets||[];t.labels=t.labels||[];return t}function So(t){t=t||{};t.data=Oo(t.data);Ao(t);return t}const Ro=new Map;const Do=new Set;function jo(t,e){let s=Ro.get(t);if(!s){s=e();Ro.set(t,s);Do.add(s)}return s}const Bo=(t,e,s)=>{const i=Mt(e,s);if(i!==undefined){t.add(i)}};class Co{constructor(t){this._config=So(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=Oo(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();Ao(t)}clearCache(){this._scopeCache.clear();this._resolverCache.clear()}datasetScopeKeys(t){return jo(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return jo(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return jo(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;const s=this.type;return jo(`${s}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const s=this._scopeCache;let i=s.get(t);if(!i||e){i=new Map;s.set(t,i)}return i}getOptionScopes(t,e,s){const{options:i,type:n}=this;const o=this._cachedScopes(t,s);const r=o.get(e);if(r){return r}const c=new Set;e.forEach((e=>{if(t){c.add(t);e.forEach((e=>Bo(c,t,e)))}e.forEach((t=>Bo(c,i,t)));e.forEach((t=>Bo(c,De[n]||{},t)));e.forEach((t=>Bo(c,Le,t)));e.forEach((t=>Bo(c,je,t)))}));const a=Array.from(c);if(a.length===0){a.push(Object.create(null))}if(Do.has(e)){o.set(e,a)}return a}chartOptionScopes(){const{options:t,type:e}=this;return[t,De[e]||{},Le.datasets[e]||{},{type:e},Le,je]}resolveNamedOptions(t,e,s,i=[""]){const n={$shared:true};const{resolver:o,subPrefixes:r}=Eo(this._resolverCache,t,i);let c=o;if(Po(o,e)){n.$shared=false;s=_t(s)?s():s;const e=this.createResolver(t,s,r);c=as(o,s,e)}for(const t of e){n[t]=c[t]}return n}createResolver(t,e,s=[""],i){const{resolver:n}=Eo(this._resolverCache,t,s);return it(e)?as(n,e,undefined,i):n}}function Eo(t,e,s){let i=t.get(e);if(!i){i=new Map;t.set(e,i)}const n=s.join();let o=i.get(n);if(!o){const t=cs(e,s);o={resolver:t,subPrefixes:s.filter((t=>!t.toLowerCase().includes("hover")))};i.set(n,o)}return o}const Lo=t=>it(t)&&Object.getOwnPropertyNames(t).some((e=>_t(t[e])));function Po(t,e){const{isScriptable:s,isIndexable:i}=hs(t);for(const n of e){const e=s(n);const o=i(n);const r=(o||e)&&t[n];if(e&&(_t(r)||Lo(r))||o&&st(r)){return true}}return false}var Io="4.4.1";const To=["top","bottom","left","right","chartArea"];function Fo(t,e){return t==="top"||t==="bottom"||To.indexOf(t)===-1&&e==="x"}function zo(t,e){return function(s,i){return s[t]===i[t]?s[e]-i[e]:s[t]-i[t]}}function No(t){const e=t.chart;const s=e.options.animation;e.notifyPlugins("afterRender");ht(s&&s.onComplete,[t],e)}function Wo(t){const e=t.chart;const s=e.options.animation;ht(s&&s.onProgress,[t],e)}function Ho(t){if(Ss()&&typeof t==="string"){t=document.getElementById(t)}else if(t&&t.length){t=t[0]}if(t&&t.canvas){t=t.canvas}return t}const $o={};const Go=t=>{const e=Ho(t);return Object.values($o).filter((t=>t.canvas===e)).pop()};function Yo(t,e,s){const i=Object.keys(t);for(const n of i){const i=+n;if(i>=e){const o=t[n];delete t[n];if(s>0||i>e){t[i+s]=o}}}}function Vo(t,e,s,i){if(!s||t.type==="mouseout"){return null}if(i){return e}return t}function Xo(t,e,s){return t.options.clip?t[s]:e[s]}function Uo(t,e){const{xScale:s,yScale:i}=t;if(s&&i){return{left:Xo(s,e,"left"),right:Xo(s,e,"right"),top:Xo(i,e,"top"),bottom:Xo(i,e,"bottom")}}return e}class Zo{static defaults=Le;static instances=$o;static overrides=De;static registry=ho;static version=Io;static getChart=Go;static register(...t){ho.add(...t);Ko()}static unregister(...t){ho.remove(...t);Ko()}constructor(t,e){const s=this.config=new Co(e);const i=Ho(t);const n=Go(i);if(n){throw new Error("Canvas is already in use. Chart with ID '"+n.id+"'"+" must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.")}const o=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||In(i));this.platform.updateConfig(s);const r=this.platform.acquireContext(i,o.aspectRatio);const c=r&&r.canvas;const a=c&&c.height;const h=c&&c.width;this.id=tt();this.ctx=r;this.canvas=c;this.width=h;this.height=a;this._options=o;this._aspectRatio=this.aspectRatio;this._layers=[];this._metasets=[];this._stacks=undefined;this.boxes=[];this.currentDevicePixelRatio=undefined;this.chartArea=undefined;this._active=[];this._lastEvent=undefined;this._listeners={};this._responsiveListeners=undefined;this._sortedMetasets=[];this.scales={};this._plugins=new fo;this.$proxies={};this._hiddenIndices={};this.attached=false;this._animationsDisabled=undefined;this.$context=undefined;this._doResize=ce((t=>this.update(t)),o.resizeDelay||0);this._dataChanges=[];$o[this.id]=this;if(!r||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Zs.listen(this,"complete",No);Zs.listen(this,"progress",Wo);this._initialize();if(this.attached){this.update()}}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:i,_aspectRatio:n}=this;if(!et(t)){return t}if(e&&n){return n}return i?s/i:null}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}get registry(){return ho}_initialize(){this.notifyPlugins("beforeInit");if(this.options.responsive){this.resize()}else{Ns(this,this.options.devicePixelRatio)}this.bindEvents();this.notifyPlugins("afterInit");return this}clear(){Fe(this.canvas,this.ctx);return this}stop(){Zs.stop(this);return this}resize(t,e){if(!Zs.running(this)){this._resize(t,e)}else{this._resizeBeforeDraw={width:t,height:e}}}_resize(t,e){const s=this.options;const i=this.canvas;const n=s.maintainAspectRatio&&this.aspectRatio;const o=this.platform.getMaximumSize(i,t,e,n);const r=s.devicePixelRatio||this.platform.getDevicePixelRatio();const c=this.width?"resize":"attach";this.width=o.width;this.height=o.height;this._aspectRatio=this.aspectRatio;if(!Ns(this,r,true)){return}this.notifyPlugins("resize",{size:o});ht(s.onResize,[this,o],this);if(this.attached){if(this._doResize(c)){this.render()}}}ensureScalesHaveIDs(){const t=this.options;const e=t.scales||{};ft(e,((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options;const e=t.scales;const s=this.scales;const i=Object.keys(s).reduce(((t,e)=>{t[e]=false;return t}),{});let n=[];if(e){n=n.concat(Object.keys(e).map((t=>{const s=e[t];const i=Mo(t,s);const n=i==="r";const o=i==="x";return{options:s,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))}ft(n,(e=>{const n=e.options;const o=n.id;const r=Mo(o,n);const c=rt(n.type,e.dtype);if(n.position===undefined||Fo(n.position,r)!==Fo(e.dposition)){n.position=e.dposition}i[o]=true;let a=null;if(o in s&&s[o].type===c){a=s[o]}else{const t=ho.getScale(c);a=new t({id:o,type:c,ctx:this.ctx,chart:this});s[a.id]=a}a.init(n,t)}));ft(i,((t,e)=>{if(!t){delete s[e]}}));ft(s,(t=>{dn.configure(this,t,t.options);dn.addBox(this,t)}))}_updateMetasets(){const t=this._metasets;const e=this.data.datasets.length;const s=t.length;t.sort(((t,e)=>t.index-e.index));if(s>e){for(let t=e;t<s;++t){this._destroyDatasetMeta(t)}t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(zo("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;if(t.length>e.length){delete this._stacks}t.forEach(((t,s)=>{if(e.filter((e=>e===t._dataset)).length===0){this._destroyDatasetMeta(s)}}))}buildOrUpdateControllers(){const t=[];const e=this.data.datasets;let s,i;this._removeUnreferencedMetasets();for(s=0,i=e.length;s<i;s++){const i=e[s];let n=this.getDatasetMeta(s);const o=i.type||this.config.type;if(n.type&&n.type!==o){this._destroyDatasetMeta(s);n=this.getDatasetMeta(s)}n.type=o;n.indexAxis=i.indexAxis||go(o,this.options);n.order=i.order||0;n.index=s;n.label=""+i.label;n.visible=this.isDatasetVisible(s);if(n.controller){n.controller.updateIndex(s);n.controller.linkScales()}else{const e=ho.getController(o);const{datasetElementType:i,dataElementType:r}=Le.datasets[o];Object.assign(e,{dataElementType:ho.getElement(r),datasetElementType:i&&ho.getElement(i)});n.controller=new e(this,s);t.push(n.controller)}}this._updateMetasets();return t}_resetElements(){ft(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements();this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext());const i=this._animationsDisabled=!s.animation;this._updateScales();this._checkEventBindings();this._updateHiddenIndices();this._plugins.invalidate();if(this.notifyPlugins("beforeUpdate",{mode:t,cancelable:true})===false){return}const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t);const s=!i&&n.indexOf(e)===-1;e.buildOrUpdateElements(s);o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=s.layout.autoPadding?o:0;this._updateLayout(o);if(!i){ft(n,(t=>{t.reset()}))}this._updateDatasets(t);this.notifyPlugins("afterUpdate",{mode:t});this._layers.sort(zo("z","_idx"));const{_active:r,_lastEvent:c}=this;if(c){this._eventHandler(c,true)}else if(r.length){this._updateHoverStyles(r,r,true)}this.render()}_updateScales(){ft(this.scales,(t=>{dn.removeBox(this,t)}));this.ensureScalesHaveIDs();this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options;const e=new Set(Object.keys(this._listeners));const s=new Set(t.events);if(!At(e,s)||!!this._responsiveListeners!==t.responsive){this.unbindEvents();this.bindEvents()}}_updateHiddenIndices(){const{_hiddenIndices:t}=this;const e=this._getUniformDataChanges()||[];for(const{method:s,start:i,count:n}of e){const e=s==="_removeElements"?-n:n;Yo(t,i,e)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length){return}this._dataChanges=[];const e=this.data.datasets.length;const s=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(","))));const i=s(0);for(let t=1;t<e;t++){if(!At(i,s(t))){return}}return Array.from(i).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:true})===false){return}dn.update(this,this.width,this.height,t);const e=this.chartArea;const s=e.width<=0||e.height<=0;this._layers=[];ft(this.boxes,(t=>{if(s&&t.position==="chartArea"){return}if(t.configure){t.configure()}this._layers.push(...t._layers())}),this);this._layers.forEach(((t,e)=>{t._idx=e}));this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:true})===false){return}for(let t=0,e=this.data.datasets.length;t<e;++t){this.getDatasetMeta(t).controller.configure()}for(let e=0,s=this.data.datasets.length;e<s;++e){this._updateDataset(e,_t(t)?t({datasetIndex:e}):t)}this.notifyPlugins("afterDatasetsUpdate",{mode:t})}_updateDataset(t,e){const s=this.getDatasetMeta(t);const i={meta:s,index:t,mode:e,cancelable:true};if(this.notifyPlugins("beforeDatasetUpdate",i)===false){return}s.controller._update(e);i.cancelable=false;this.notifyPlugins("afterDatasetUpdate",i)}render(){if(this.notifyPlugins("beforeRender",{cancelable:true})===false){return}if(Zs.has(this)){if(this.attached&&!Zs.running(this)){Zs.start(this)}}else{this.draw();No({chart:this})}}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e);this._resizeBeforeDraw=null}this.clear();if(this.width<=0||this.height<=0){return}if(this.notifyPlugins("beforeDraw",{cancelable:true})===false){return}const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t){e[t].draw(this.chartArea)}this._drawDatasets();for(;t<e.length;++t){e[t].draw(this.chartArea)}this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets;const s=[];let i,n;for(i=0,n=e.length;i<n;++i){const n=e[i];if(!t||n.visible){s.push(n)}}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(true)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:true})===false){return}const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e){this._drawDataset(t[e])}this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx;const s=t._clip;const i=!s.disabled;const n=Uo(t,this.chartArea);const o={meta:t,index:t.index,cancelable:true};if(this.notifyPlugins("beforeDatasetDraw",o)===false){return}if(i){He(e,{left:s.left===false?0:n.left-s.left,right:s.right===false?this.width:n.right+s.right,top:s.top===false?0:n.top-s.top,bottom:s.bottom===false?this.height:n.bottom+s.bottom})}t.controller.draw();if(i){$e(e)}o.cancelable=false;this.notifyPlugins("afterDatasetDraw",o)}isPointInArea(t){return We(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,i){const n=Zi.modes[e];if(typeof n==="function"){return n(this,t,s,i)}return[]}getDatasetMeta(t){const e=this.data.datasets[t];const s=this._metasets;let i=s.filter((t=>t&&t._dataset===e)).pop();if(!i){i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:false};s.push(i)}return i}getContext(){return this.$context||(this.$context=rs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e){return false}const s=this.getDatasetMeta(t);return typeof s.hidden==="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const i=s?"show":"hide";const n=this.getDatasetMeta(t);const o=n.controller._resolveAnimations(undefined,i);if(wt(e)){n.data[e].hidden=!s;this.update()}else{this.setDatasetVisibility(t,s);o.update(n,{visible:s});this.update((e=>e.datasetIndex===t?i:undefined))}}hide(t,e){this._updateVisibility(t,e,false)}show(t,e){this._updateVisibility(t,e,true)}_destroyDatasetMeta(t){const e=this._metasets[t];if(e&&e.controller){e.controller._destroy()}delete this._metasets[t]}_stop(){let t,e;this.stop();Zs.remove(this);for(t=0,e=this.data.datasets.length;t<e;++t){this._destroyDatasetMeta(t)}}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop();this.config.clearCache();if(t){this.unbindEvents();Fe(t,e);this.platform.releaseContext(e);this.canvas=null;this.ctx=null}delete $o[this.id];this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents();if(this.options.responsive){this.bindResponsiveEvents()}else{this.attached=true}}bindUserEvents(){const t=this._listeners;const e=this.platform;const s=(s,i)=>{e.addEventListener(this,s,i);t[s]=i};const i=(t,e,s)=>{t.offsetX=e;t.offsetY=s;this._eventHandler(t)};ft(this.options.events,(t=>s(t,i)))}bindResponsiveEvents(){if(!this._responsiveListeners){this._responsiveListeners={}}const t=this._responsiveListeners;const e=this.platform;const s=(s,i)=>{e.addEventListener(this,s,i);t[s]=i};const i=(s,i)=>{if(t[s]){e.removeEventListener(this,s,i);delete t[s]}};const n=(t,e)=>{if(this.canvas){this.resize(t,e)}};let o;const r=()=>{i("attach",r);this.attached=true;this.resize();s("resize",n);s("detach",o)};o=()=>{this.attached=false;i("resize",n);this._stop();this._resize(0,0);s("attach",r)};if(e.isAttached(this.canvas)){r()}else{o()}}unbindEvents(){ft(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)}));this._listeners={};ft(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)}));this._responsiveListeners=undefined}updateHoverStyle(t,e,s){const i=s?"set":"remove";let n,o,r,c;if(e==="dataset"){n=this.getDatasetMeta(t[0].datasetIndex);n.controller["_"+i+"DatasetHoverStyle"]()}for(r=0,c=t.length;r<c;++r){o=t[r];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;if(e){e[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[];const s=t.map((({datasetIndex:t,index:e})=>{const s=this.getDatasetMeta(t);if(!s){throw new Error("No dataset found at index "+t)}return{datasetIndex:t,element:s.data[e],index:e}}));const i=!lt(s,e);if(i){this._active=s;this._lastEvent=null;this._updateHoverStyles(s,e)}}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter((e=>e.plugin.id===t)).length===1}_updateHoverStyles(t,e,s){const i=this.options.hover;const n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index))));const o=n(e,t);const r=s?t:n(t,e);if(o.length){this.updateHoverStyle(o,i.mode,false)}if(r.length&&i.mode){this.updateHoverStyle(r,i.mode,true)}}_eventHandler(t,e){const s={event:t,replay:e,cancelable:true,inChartArea:this.isPointInArea(t)};const i=e=>(e.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,i)===false){return}const n=this._handleEvent(t,e,s.inChartArea);s.cancelable=false;this.notifyPlugins("afterEvent",s,i);if(n||s.changed){this.render()}return this}_handleEvent(t,e,s){const{_active:i=[],options:n}=this;const o=e;const r=this._getActiveElements(t,i,s,o);const c=Ot(t);const a=Vo(t,this._lastEvent,s,c);if(s){this._lastEvent=null;ht(n.onHover,[t,r,this],this);if(c){ht(n.onClick,[t,r,this],this)}}const h=!lt(r,i);if(h||e){this._active=r;this._updateHoverStyles(r,i,e)}this._lastEvent=a;return h}_getActiveElements(t,e,s,i){if(t.type==="mouseout"){return[]}if(!s){return e}const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,i)}}function Ko(){return ft(Zo.instances,(t=>t._plugins.invalidate()))}function Qo(t,e){const{x:s,y:i,base:n,width:o,height:r}=t.getProps(["x","y","base","width","height"],e);let c,a,h,f,l;if(t.horizontal){l=r/2;c=Math.min(s,n);a=Math.max(s,n);h=i-l;f=i+l}else{l=o/2;c=s-l;a=s+l;h=Math.min(i,n);f=Math.max(i,n)}return{left:c,top:h,right:a,bottom:f}}function qo(t,e,s,i){return t?0:Zt(e,s,i)}function Jo(t,e,s){const i=t.options.borderWidth;const n=t.borderSkipped;const o=ts(i);return{t:qo(n.top,o.top,0,s),r:qo(n.right,o.right,0,e),b:qo(n.bottom,o.bottom,0,s),l:qo(n.left,o.left,0,e)}}function tr(t,e,s){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]);const n=t.options.borderRadius;const o=es(n);const r=Math.min(e,s);const c=t.borderSkipped;const a=i||it(n);return{topLeft:qo(!a||c.top||c.left,o.topLeft,0,r),topRight:qo(!a||c.top||c.right,o.topRight,0,r),bottomLeft:qo(!a||c.bottom||c.left,o.bottomLeft,0,r),bottomRight:qo(!a||c.bottom||c.right,o.bottomRight,0,r)}}function er(t){const e=Qo(t);const s=e.right-e.left;const i=e.bottom-e.top;const n=Jo(t,s/2,i/2);const o=tr(t,s/2,i/2);return{outer:{x:e.left,y:e.top,w:s,h:i,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:s-n.l-n.r,h:i-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function sr(t,e,s,i){const n=e===null;const o=s===null;const r=n&&o;const c=t&&!r&&Qo(t,i);return c&&(n||Qt(e,c.left,c.right))&&(o||Qt(s,c.top,c.bottom))}function ir(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function nr(t,e){t.rect(e.x,e.y,e.w,e.h)}function or(t,e,s={}){const i=t.x!==s.x?-e:0;const n=t.y!==s.y?-e:0;const o=(t.x+t.w!==s.x+s.w?e:0)-i;const r=(t.y+t.h!==s.y+s.h?e:0)-n;return{x:t.x+i,y:t.y+n,w:t.w+o,h:t.h+r,radius:t.radius}}class rr extends Tn{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:undefined};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super();this.options=undefined;this.horizontal=undefined;this.base=undefined;this.width=undefined;this.height=undefined;this.inflateAmount=undefined;if(t){Object.assign(this,t)}}draw(t){const{inflateAmount:e,options:{borderColor:s,backgroundColor:i}}=this;const{inner:n,outer:o}=er(this);const r=ir(o.radius)?Ue:nr;t.save();if(o.w!==n.w||o.h!==n.h){t.beginPath();r(t,or(o,e,n));t.clip();r(t,or(n,-e,o));t.fillStyle=s;t.fill("evenodd")}t.beginPath();r(t,or(n,e));t.fillStyle=i;t.fill();t.restore()}inRange(t,e,s){return sr(this,t,e,s)}inXRange(t,e){return sr(this,t,null,e)}inYRange(t,e){return sr(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:i,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+i)/2:e,y:n?s:(s+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}const cr=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"];const ar=cr.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function hr(t){return cr[t%cr.length]}function fr(t){return ar[t%ar.length]}function lr(t,e){t.borderColor=hr(e);t.backgroundColor=fr(e);return++e}function ur(t,e){t.backgroundColor=t.data.map((()=>hr(e++)));return e}function dr(t,e){t.backgroundColor=t.data.map((()=>fr(e++)));return e}function br(t){let e=0;return(s,i)=>{const n=t.getDatasetMeta(i).controller;if(n instanceof zi){e=ur(s,e)}else if(n instanceof Ni){e=dr(s,e)}else if(n){e=lr(s,e)}}}function pr(t){let e;for(e in t){if(t[e].borderColor||t[e].backgroundColor){return true}}return false}function gr(t){return t&&(t.borderColor||t.backgroundColor)}var mr={id:"colors",defaults:{enabled:true,forceOverride:false},beforeLayout(t,e,s){if(!s.enabled){return}const{data:{datasets:i},options:n}=t.config;const{elements:o}=n;if(!s.forceOverride&&(pr(i)||gr(n)||o&&pr(o))){return}const r=br(t);i.forEach(r)}};const yr=(t,e)=>{let{boxHeight:s=e,boxWidth:i=e}=t;if(t.usePointStyle){s=Math.min(s,e);i=t.pointStyleWidth||Math.min(i,e)}return{boxWidth:i,boxHeight:s,itemHeight:Math.max(e,s)}};const xr=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class vr extends Tn{constructor(t){super();this._added=false;this.legendHitBoxes=[];this._hoveredItem=null;this.doughnutMode=false;this.chart=t.chart;this.options=t.options;this.ctx=t.ctx;this.legendItems=undefined;this.columnSizes=undefined;this.lineWidths=undefined;this.maxHeight=undefined;this.maxWidth=undefined;this.top=undefined;this.bottom=undefined;this.left=undefined;this.right=undefined;this.height=undefined;this.width=undefined;this._margins=undefined;this.position=undefined;this.weight=undefined;this.fullSize=undefined}update(t,e,s){this.maxWidth=t;this.maxHeight=e;this._margins=s;this.setDimensions();this.buildLabels();this.fit()}setDimensions(){if(this.isHorizontal()){this.width=this.maxWidth;this.left=this._margins.left;this.right=this.width}else{this.height=this.maxHeight;this.top=this._margins.top;this.bottom=this.height}}buildLabels(){const t=this.options.labels||{};let e=ht(t.generateLabels,[this.chart],this)||[];if(t.filter){e=e.filter((e=>t.filter(e,this.chart.data)))}if(t.sort){e=e.sort(((e,s)=>t.sort(e,s,this.chart.data)))}if(this.options.reverse){e.reverse()}this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels;const i=is(s.font);const n=i.size;const o=this._computeTitleHeight();const{boxWidth:r,itemHeight:c}=yr(s,n);let a,h;e.font=i.string;if(this.isHorizontal()){a=this.maxWidth;h=this._fitRows(o,n,r,c)+10}else{h=this.maxHeight;a=this._fitCols(o,i,r,c)+10}this.width=Math.min(a,t.maxWidth||this.maxWidth);this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,i){const{ctx:n,maxWidth:o,options:{labels:{padding:r}}}=this;const c=this.legendHitBoxes=[];const a=this.lineWidths=[0];const h=i+r;let f=t;n.textAlign="left";n.textBaseline="middle";let l=-1;let u=-h;this.legendItems.forEach(((t,d)=>{const b=s+e/2+n.measureText(t.text).width;if(d===0||a[a.length-1]+b+2*r>o){f+=h;a[a.length-(d>0?0:1)]=0;u+=h;l++}c[d]={left:0,top:u,row:l,width:b,height:i};a[a.length-1]+=b+r}));return f}_fitCols(t,e,s,i){const{ctx:n,maxHeight:o,options:{labels:{padding:r}}}=this;const c=this.legendHitBoxes=[];const a=this.columnSizes=[];const h=o-t;let f=r;let l=0;let u=0;let d=0;let b=0;this.legendItems.forEach(((t,o)=>{const{itemWidth:p,itemHeight:g}=Mr(s,e,n,t,i);if(o>0&&u+g+2*r>h){f+=l+r;a.push({width:l,height:u});d+=l+r;b++;l=u=0}c[o]={left:d,top:u,col:b,width:p,height:g};l=Math.max(l,p);u+=g+r}));f+=l;a.push({width:l,height:u});return f}adjustHitBoxes(){if(!this.options.display){return}const t=this._computeTitleHeight();const{legendHitBoxes:e,options:{align:s,labels:{padding:i},rtl:n}}=this;const o=Ys(n,this.left,this.width);if(this.isHorizontal()){let n=0;let r=he(s,this.left+i,this.right-this.lineWidths[n]);for(const c of e){if(n!==c.row){n=c.row;r=he(s,this.left+i,this.right-this.lineWidths[n])}c.top+=this.top+t+i;c.left=o.leftForLtr(o.x(r),c.width);r+=c.width+i}}else{let n=0;let r=he(s,this.top+t+i,this.bottom-this.columnSizes[n].height);for(const c of e){if(c.col!==n){n=c.col;r=he(s,this.top+t+i,this.bottom-this.columnSizes[n].height)}c.top=r;c.left+=this.left+i;c.left=o.leftForLtr(o.x(c.left),c.width);r+=c.height+i}}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;He(t,this);this._draw();$e(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:i}=this;const{align:n,labels:o}=t;const r=Le.color;const c=Ys(t.rtl,this.left,this.width);const a=is(o.font);const{padding:h}=o;const f=a.size;const l=f/2;let u;this.drawTitle();i.textAlign=c.textAlign("left");i.textBaseline="middle";i.lineWidth=.5;i.font=a.string;const{boxWidth:d,boxHeight:b,itemHeight:p}=yr(o,f);const g=function(t,e,s){if(isNaN(d)||d<=0||isNaN(b)||b<0){return}i.save();const n=rt(s.lineWidth,1);i.fillStyle=rt(s.fillStyle,r);i.lineCap=rt(s.lineCap,"butt");i.lineDashOffset=rt(s.lineDashOffset,0);i.lineJoin=rt(s.lineJoin,"miter");i.lineWidth=n;i.strokeStyle=rt(s.strokeStyle,r);i.setLineDash(rt(s.lineDash,[]));if(o.usePointStyle){const r={radius:b*Math.SQRT2/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:n};const a=c.xPlus(t,d/2);const h=e+l;Ne(i,r,a,h,o.pointStyleWidth&&d)}else{const o=e+Math.max((f-b)/2,0);const r=c.leftForLtr(t,d);const a=es(s.borderRadius);i.beginPath();if(Object.values(a).some((t=>t!==0))){Ue(i,{x:r,y:o,w:d,h:b,radius:a})}else{i.rect(r,o,d,b)}i.fill();if(n!==0){i.stroke()}}i.restore()};const m=function(t,e,s){Xe(i,s.text,t,e+p/2,a,{strikethrough:s.hidden,textAlign:c.textAlign(s.textAlign)})};const y=this.isHorizontal();const x=this._computeTitleHeight();if(y){u={x:he(n,this.left+h,this.right-s[0]),y:this.top+h+x,line:0}}else{u={x:this.left+h,y:he(n,this.top+x+h,this.bottom-e[0].height),line:0}}Vs(this.ctx,t.textDirection);const v=p+h;this.legendItems.forEach(((r,f)=>{i.strokeStyle=r.fontColor;i.fillStyle=r.fontColor;const b=i.measureText(r.text).width;const p=c.textAlign(r.textAlign||(r.textAlign=o.textAlign));const M=d+l+b;let k=u.x;let w=u.y;c.setWidth(this.width);if(y){if(f>0&&k+M+h>this.right){w=u.y+=v;u.line++;k=u.x=he(n,this.left+h,this.right-s[u.line])}}else if(f>0&&w+v>this.bottom){k=u.x=k+e[u.line].width+h;u.line++;w=u.y=he(n,this.top+x+h,this.bottom-e[u.line].height)}const _=c.x(k);g(_,w,r);k=fe(p,k+d+l,y?k+M:this.right,t.rtl);m(c.x(k),w,r);if(y){u.x+=M+h}else if(typeof r.text!=="string"){const t=a.lineHeight;u.y+=_r(r,t)+h}else{u.y+=v}}));Xs(this.ctx,t.textDirection)}drawTitle(){const t=this.options;const e=t.title;const s=is(e.font);const i=ss(e.padding);if(!e.display){return}const n=Ys(t.rtl,this.left,this.width);const o=this.ctx;const r=e.position;const c=s.size/2;const a=i.top+c;let h;let f=this.left;let l=this.width;if(this.isHorizontal()){l=Math.max(...this.lineWidths);h=this.top+a;f=he(t.align,f,this.right-l)}else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=a+he(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=he(r,f,f+l);o.textAlign=n.textAlign(ae(r));o.textBaseline="middle";o.strokeStyle=e.color;o.fillStyle=e.color;o.font=s.string;Xe(o,e.text,u,h,s)}_computeTitleHeight(){const t=this.options.title;const e=is(t.font);const s=ss(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,i,n;if(Qt(t,this.left,this.right)&&Qt(e,this.top,this.bottom)){n=this.legendHitBoxes;for(s=0;s<n.length;++s){i=n[s];if(Qt(t,i.left,i.left+i.width)&&Qt(e,i.top,i.top+i.height)){return this.legendItems[s]}}}return null}handleEvent(t){const e=this.options;if(!Ar(t.type,e)){return}const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem;const n=xr(i,s);if(i&&!n){ht(e.onLeave,[t,i,this],this)}this._hoveredItem=s;if(s&&!n){ht(e.onHover,[t,s,this],this)}}else if(s){ht(e.onClick,[t,s,this],this)}}}function Mr(t,e,s,i,n){const o=kr(i,t,e,s);const r=wr(n,i,e.lineHeight);return{itemWidth:o,itemHeight:r}}function kr(t,e,s,i){let n=t.text;if(n&&typeof n!=="string"){n=n.reduce(((t,e)=>t.length>e.length?t:e))}return e+s.size/2+i.measureText(n).width}function wr(t,e,s){let i=t;if(typeof e.text!=="string"){i=_r(e,s)}return i}function _r(t,e){const s=t.text?t.text.length:0;return e*s}function Ar(t,e){if((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)){return true}if(e.onClick&&(t==="click"||t==="mouseup")){return true}return false}var Or={id:"legend",_element:vr,start(t,e,s){const i=t.legend=new vr({ctx:t.ctx,options:s,chart:t});dn.configure(t,i,s);dn.addBox(t,i)},stop(t){dn.removeBox(t,t.legend);delete t.legend},beforeUpdate(t,e,s){const i=t.legend;dn.configure(t,i,s);i.options=s},afterUpdate(t){const e=t.legend;e.buildLabels();e.adjustHitBoxes()},afterEvent(t,e){if(!e.replay){t.legend.handleEvent(e.event)}},defaults:{display:true,position:"top",align:"center",fullSize:true,reverse:false,weight:1e3,onClick(t,e,s){const i=e.datasetIndex;const n=s.chart;if(n.isDatasetVisible(i)){n.hide(i);e.hidden=true}else{n.show(i);e.hidden=false}},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets;const{labels:{usePointStyle:s,pointStyle:i,textAlign:n,color:o,useBorderRadius:r,borderRadius:c}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(s?0:undefined);const h=ss(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:r&&(c||a.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:false,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Sr extends Tn{constructor(t){super();this.chart=t.chart;this.options=t.options;this.ctx=t.ctx;this._padding=undefined;this.top=undefined;this.bottom=undefined;this.left=undefined;this.right=undefined;this.width=undefined;this.height=undefined;this.position=undefined;this.weight=undefined;this.fullSize=undefined}update(t,e){const s=this.options;this.left=0;this.top=0;if(!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t;this.height=this.bottom=e;const i=st(s.text)?s.text.length:1;this._padding=ss(s.padding);const n=i*is(s.font).lineHeight+this._padding.height;if(this.isHorizontal()){this.height=n}else{this.width=n}}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:i,right:n,options:o}=this;const r=o.align;let c=0;let a,h,f;if(this.isHorizontal()){h=he(r,s,n);f=e+t;a=n-s}else{if(o.position==="left"){h=s+t;f=he(r,i,e);c=St*-.5}else{h=n-t;f=he(r,e,i);c=St*.5}a=i-e}return{titleX:h,titleY:f,maxWidth:a,rotation:c}}draw(){const t=this.ctx;const e=this.options;if(!e.display){return}const s=is(e.font);const i=s.lineHeight;const n=i/2+this._padding.top;const{titleX:o,titleY:r,maxWidth:c,rotation:a}=this._drawArgs(n);Xe(t,e.text,0,0,s,{color:e.color,maxWidth:c,rotation:a,textAlign:ae(e.align),textBaseline:"middle",translation:[o,r]})}}function Rr(t,e){const s=new Sr({ctx:t.ctx,options:e,chart:t});dn.configure(t,s,e);dn.addBox(t,s);t.titleBlock=s}var Dr={id:"title",_element:Sr,start(t,e,s){Rr(t,s)},stop(t){const e=t.titleBlock;dn.removeBox(t,e);delete t.titleBlock},beforeUpdate(t,e,s){const i=t.titleBlock;dn.configure(t,i,s);i.options=s},defaults:{align:"center",display:false,font:{weight:"bold"},fullSize:true,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:true,_indexable:false}};const jr={average(t){if(!t.length){return false}let e,s;let i=0;let n=0;let o=0;for(e=0,s=t.length;e<s;++e){const s=t[e].element;if(s&&s.hasValue()){const t=s.tooltipPosition();i+=t.x;n+=t.y;++o}}return{x:i/o,y:n/o}},nearest(t,e){if(!t.length){return false}let s=e.x;let i=e.y;let n=Number.POSITIVE_INFINITY;let o,r,c;for(o=0,r=t.length;o<r;++o){const s=t[o].element;if(s&&s.hasValue()){const t=s.getCenterPoint();const i=Vt(e,t);if(i<n){n=i;c=s}}}if(c){const t=c.tooltipPosition();s=t.x;i=t.y}return{x:s,y:i}}};function Br(t,e){if(e){if(st(e)){Array.prototype.push.apply(t,e)}else{t.push(e)}}return t}function Cr(t){if((typeof t==="string"||t instanceof String)&&t.indexOf("\n")>-1){return t.split("\n")}return t}function Er(t,e){const{element:s,datasetIndex:i,index:n}=e;const o=t.getDatasetMeta(i).controller;const{label:r,value:c}=o.getLabelAndValue(n);return{chart:t,label:r,parsed:o.getParsed(n),raw:t.data.datasets[i].data[n],formattedValue:c,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:s}}function Lr(t,e){const s=t.chart.ctx;const{body:i,footer:n,title:o}=t;const{boxWidth:r,boxHeight:c}=e;const a=is(e.bodyFont);const h=is(e.titleFont);const f=is(e.footerFont);const l=o.length;const u=n.length;const d=i.length;const b=ss(e.padding);let p=b.height;let g=0;let m=i.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);m+=t.beforeBody.length+t.afterBody.length;if(l){p+=l*h.lineHeight+(l-1)*e.titleSpacing+e.titleMarginBottom}if(m){const t=e.displayColors?Math.max(c,a.lineHeight):a.lineHeight;p+=d*t+(m-d)*a.lineHeight+(m-1)*e.bodySpacing}if(u){p+=e.footerMarginTop+u*f.lineHeight+(u-1)*e.footerSpacing}let y=0;const x=function(t){g=Math.max(g,s.measureText(t).width+y)};s.save();s.font=h.string;ft(t.title,x);s.font=a.string;ft(t.beforeBody.concat(t.afterBody),x);y=e.displayColors?r+2+e.boxPadding:0;ft(i,(t=>{ft(t.before,x);ft(t.lines,x);ft(t.after,x)}));y=0;s.font=f.string;ft(t.footer,x);s.restore();g+=b.width;return{width:g,height:p}}function Pr(t,e){const{y:s,height:i}=e;if(s<i/2){return"top"}else if(s>t.height-i/2){return"bottom"}return"center"}function Ir(t,e,s,i){const{x:n,width:o}=i;const r=s.caretSize+s.caretPadding;if(t==="left"&&n+o+r>e.width){return true}if(t==="right"&&n-o-r<0){return true}}function Tr(t,e,s,i){const{x:n,width:o}=s;const{width:r,chartArea:{left:c,right:a}}=t;let h="center";if(i==="center"){h=n<=(c+a)/2?"left":"right"}else if(n<=o/2){h="left"}else if(n>=r-o/2){h="right"}if(Ir(h,t,e,s)){h="center"}return h}function Fr(t,e,s){const i=s.yAlign||e.yAlign||Pr(t,s);return{xAlign:s.xAlign||e.xAlign||Tr(t,e,s,i),yAlign:i}}function zr(t,e){let{x:s,width:i}=t;if(e==="right"){s-=i}else if(e==="center"){s-=i/2}return s}function Nr(t,e,s){let{y:i,height:n}=t;if(e==="top"){i+=s}else if(e==="bottom"){i-=n+s}else{i-=n/2}return i}function Wr(t,e,s,i){const{caretSize:n,caretPadding:o,cornerRadius:r}=t;const{xAlign:c,yAlign:a}=s;const h=n+o;const{topLeft:f,topRight:l,bottomLeft:u,bottomRight:d}=es(r);let b=zr(e,c);const p=Nr(e,a,h);if(a==="center"){if(c==="left"){b+=h}else if(c==="right"){b-=h}}else if(c==="left"){b-=Math.max(f,u)+n}else if(c==="right"){b+=Math.max(l,d)+n}return{x:Zt(b,0,i.width-e.width),y:Zt(p,0,i.height-e.height)}}function Hr(t,e,s){const i=ss(s.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-i.right:t.x+i.left}function $r(t){return Br([],Cr(t))}function Gr(t,e,s){return rs(t,{tooltip:e,tooltipItems:s,type:"tooltip"})}function Yr(t,e){const s=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return s?t.override(s):t}const Vr={beforeTitle:J,title(t){if(t.length>0){const e=t[0];const s=e.chart.data.labels;const i=s?s.length:0;if(this&&this.options&&this.options.mode==="dataset"){return e.dataset.label||""}else if(e.label){return e.label}else if(i>0&&e.dataIndex<i){return s[e.dataIndex]}}return""},afterTitle:J,beforeBody:J,beforeLabel:J,label(t){if(this&&this.options&&this.options.mode==="dataset"){return t.label+": "+t.formattedValue||t.formattedValue}let e=t.dataset.label||"";if(e){e+=": "}const s=t.formattedValue;if(!et(s)){e+=s}return e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex);const s=e.controller.getStyle(t.dataIndex);return{borderColor:s.borderColor,backgroundColor:s.backgroundColor,borderWidth:s.borderWidth,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex);const s=e.controller.getStyle(t.dataIndex);return{pointStyle:s.pointStyle,rotation:s.rotation}},afterLabel:J,afterBody:J,beforeFooter:J,footer:J,afterFooter:J};function Xr(t,e,s,i){const n=t[e].call(s,i);if(typeof n==="undefined"){return Vr[e].call(s,i)}return n}class Ur extends Tn{static positioners=jr;constructor(t){super();this.opacity=0;this._active=[];this._eventPosition=undefined;this._size=undefined;this._cachedAnimations=undefined;this._tooltipItems=[];this.$animations=undefined;this.$context=undefined;this.chart=t.chart;this.options=t.options;this.dataPoints=undefined;this.title=undefined;this.beforeBody=undefined;this.body=undefined;this.afterBody=undefined;this.footer=undefined;this.xAlign=undefined;this.yAlign=undefined;this.x=undefined;this.y=undefined;this.height=undefined;this.width=undefined;this.caretX=undefined;this.caretY=undefined;this.labelColors=undefined;this.labelPointStyles=undefined;this.labelTextColors=undefined}initialize(t){this.options=t;this._cachedAnimations=undefined;this.$context=undefined}_resolveAnimations(){const t=this._cachedAnimations;if(t){return t}const e=this.chart;const s=this.options.setContext(this.getContext());const i=s.enabled&&e.options.animation&&s.animations;const n=new Js(this.chart,i);if(i._cacheable){this._cachedAnimations=Object.freeze(n)}return n}getContext(){return this.$context||(this.$context=Gr(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e;const i=Xr(s,"beforeTitle",this,t);const n=Xr(s,"title",this,t);const o=Xr(s,"afterTitle",this,t);let r=[];r=Br(r,Cr(i));r=Br(r,Cr(n));r=Br(r,Cr(o));return r}getBeforeBody(t,e){return $r(Xr(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e;const i=[];ft(t,(t=>{const e={before:[],lines:[],after:[]};const n=Yr(s,t);Br(e.before,Cr(Xr(n,"beforeLabel",this,t)));Br(e.lines,Xr(n,"label",this,t));Br(e.after,Cr(Xr(n,"afterLabel",this,t)));i.push(e)}));return i}getAfterBody(t,e){return $r(Xr(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e;const i=Xr(s,"beforeFooter",this,t);const n=Xr(s,"footer",this,t);const o=Xr(s,"afterFooter",this,t);let r=[];r=Br(r,Cr(i));r=Br(r,Cr(n));r=Br(r,Cr(o));return r}_createItems(t){const e=this._active;const s=this.chart.data;const i=[];const n=[];const o=[];let r=[];let c,a;for(c=0,a=e.length;c<a;++c){r.push(Er(this.chart,e[c]))}if(t.filter){r=r.filter(((e,i,n)=>t.filter(e,i,n,s)))}if(t.itemSort){r=r.sort(((e,i)=>t.itemSort(e,i,s)))}ft(r,(e=>{const s=Yr(t.callbacks,e);i.push(Xr(s,"labelColor",this,e));n.push(Xr(s,"labelPointStyle",this,e));o.push(Xr(s,"labelTextColor",this,e))}));this.labelColors=i;this.labelPointStyles=n;this.labelTextColors=o;this.dataPoints=r;return r}update(t,e){const s=this.options.setContext(this.getContext());const i=this._active;let n;let o=[];if(!i.length){if(this.opacity!==0){n={opacity:0}}}else{const t=jr[s.position].call(this,i,this._eventPosition);o=this._createItems(s);this.title=this.getTitle(o,s);this.beforeBody=this.getBeforeBody(o,s);this.body=this.getBody(o,s);this.afterBody=this.getAfterBody(o,s);this.footer=this.getFooter(o,s);const e=this._size=Lr(this,s);const r=Object.assign({},t,e);const c=Fr(this.chart,s,r);const a=Wr(s,r,c,this.chart);this.xAlign=c.xAlign;this.yAlign=c.yAlign;n={opacity:1,x:a.x,y:a.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}this._tooltipItems=o;this.$context=undefined;if(n){this._resolveAnimations().update(this,n)}if(t&&s.external){s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}}drawCaret(t,e,s,i){const n=this.getCaretPosition(t,s,i);e.lineTo(n.x1,n.y1);e.lineTo(n.x2,n.y2);e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,s){const{xAlign:i,yAlign:n}=this;const{caretSize:o,cornerRadius:r}=s;const{topLeft:c,topRight:a,bottomLeft:h,bottomRight:f}=es(r);const{x:l,y:u}=t;const{width:d,height:b}=e;let p,g,m,y,x,v;if(n==="center"){x=u+b/2;if(i==="left"){p=l;g=p-o;y=x+o;v=x-o}else{p=l+d;g=p+o;y=x-o;v=x+o}m=p}else{if(i==="left"){g=l+Math.max(c,h)+o}else if(i==="right"){g=l+d-Math.max(a,f)-o}else{g=this.caretX}if(n==="top"){y=u;x=y-o;p=g-o;m=g+o}else{y=u+b;x=y+o;p=g+o;m=g-o}v=y}return{x1:p,x2:g,x3:m,y1:y,y2:x,y3:v}}drawTitle(t,e,s){const i=this.title;const n=i.length;let o,r,c;if(n){const a=Ys(s.rtl,this.x,this.width);t.x=Hr(this,s.titleAlign,s);e.textAlign=a.textAlign(s.titleAlign);e.textBaseline="middle";o=is(s.titleFont);r=s.titleSpacing;e.fillStyle=s.titleColor;e.font=o.string;for(c=0;c<n;++c){e.fillText(i[c],a.x(t.x),t.y+o.lineHeight/2);t.y+=o.lineHeight+r;if(c+1===n){t.y+=s.titleMarginBottom-r}}}}_drawColorBox(t,e,s,i,n){const o=this.labelColors[s];const r=this.labelPointStyles[s];const{boxHeight:c,boxWidth:a}=n;const h=is(n.bodyFont);const f=Hr(this,"left",n);const l=i.x(f);const u=c<h.lineHeight?(h.lineHeight-c)/2:0;const d=e.y+u;if(n.usePointStyle){const e={radius:Math.min(a,c)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1};const s=i.leftForLtr(l,a)+a/2;const h=d+c/2;t.strokeStyle=n.multiKeyBackground;t.fillStyle=n.multiKeyBackground;ze(t,e,s,h);t.strokeStyle=o.borderColor;t.fillStyle=o.backgroundColor;ze(t,e,s,h)}else{t.lineWidth=it(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1;t.strokeStyle=o.borderColor;t.setLineDash(o.borderDash||[]);t.lineDashOffset=o.borderDashOffset||0;const e=i.leftForLtr(l,a);const s=i.leftForLtr(i.xPlus(l,1),a-2);const r=es(o.borderRadius);if(Object.values(r).some((t=>t!==0))){t.beginPath();t.fillStyle=n.multiKeyBackground;Ue(t,{x:e,y:d,w:a,h:c,radius:r});t.fill();t.stroke();t.fillStyle=o.backgroundColor;t.beginPath();Ue(t,{x:s,y:d+1,w:a-2,h:c-2,radius:r});t.fill()}else{t.fillStyle=n.multiKeyBackground;t.fillRect(e,d,a,c);t.strokeRect(e,d,a,c);t.fillStyle=o.backgroundColor;t.fillRect(s,d+1,a-2,c-2)}}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:i}=this;const{bodySpacing:n,bodyAlign:o,displayColors:r,boxHeight:c,boxWidth:a,boxPadding:h}=s;const f=is(s.bodyFont);let l=f.lineHeight;let u=0;const d=Ys(s.rtl,this.x,this.width);const b=function(s){e.fillText(s,d.x(t.x+u),t.y+l/2);t.y+=l+n};const p=d.textAlign(o);let g,m,y,x,v,M,k;e.textAlign=o;e.textBaseline="middle";e.font=f.string;t.x=Hr(this,p,s);e.fillStyle=s.bodyColor;ft(this.beforeBody,b);u=r&&p!=="right"?o==="center"?a/2+h:a+2+h:0;for(x=0,M=i.length;x<M;++x){g=i[x];m=this.labelTextColors[x];e.fillStyle=m;ft(g.before,b);y=g.lines;if(r&&y.length){this._drawColorBox(e,t,x,d,s);l=Math.max(f.lineHeight,c)}for(v=0,k=y.length;v<k;++v){b(y[v]);l=f.lineHeight}ft(g.after,b)}u=0;l=f.lineHeight;ft(this.afterBody,b);t.y-=n}drawFooter(t,e,s){const i=this.footer;const n=i.length;let o,r;if(n){const c=Ys(s.rtl,this.x,this.width);t.x=Hr(this,s.footerAlign,s);t.y+=s.footerMarginTop;e.textAlign=c.textAlign(s.footerAlign);e.textBaseline="middle";o=is(s.footerFont);e.fillStyle=s.footerColor;e.font=o.string;for(r=0;r<n;++r){e.fillText(i[r],c.x(t.x),t.y+o.lineHeight/2);t.y+=o.lineHeight+s.footerSpacing}}}drawBackground(t,e,s,i){const{xAlign:n,yAlign:o}=this;const{x:r,y:c}=t;const{width:a,height:h}=s;const{topLeft:f,topRight:l,bottomLeft:u,bottomRight:d}=es(i.cornerRadius);e.fillStyle=i.backgroundColor;e.strokeStyle=i.borderColor;e.lineWidth=i.borderWidth;e.beginPath();e.moveTo(r+f,c);if(o==="top"){this.drawCaret(t,e,s,i)}e.lineTo(r+a-l,c);e.quadraticCurveTo(r+a,c,r+a,c+l);if(o==="center"&&n==="right"){this.drawCaret(t,e,s,i)}e.lineTo(r+a,c+h-d);e.quadraticCurveTo(r+a,c+h,r+a-d,c+h);if(o==="bottom"){this.drawCaret(t,e,s,i)}e.lineTo(r+u,c+h);e.quadraticCurveTo(r,c+h,r,c+h-u);if(o==="center"&&n==="left"){this.drawCaret(t,e,s,i)}e.lineTo(r,c+f);e.quadraticCurveTo(r,c,r+f,c);e.closePath();e.fill();if(i.borderWidth>0){e.stroke()}}_updateAnimationTarget(t){const e=this.chart;const s=this.$animations;const i=s&&s.x;const n=s&&s.y;if(i||n){const s=jr[t.position].call(this,this._active,this._eventPosition);if(!s){return}const o=this._size=Lr(this,t);const r=Object.assign({},s,this._size);const c=Fr(e,t,r);const a=Wr(t,r,c,e);if(i._to!==a.x||n._to!==a.y){this.xAlign=c.xAlign;this.yAlign=c.yAlign;this.width=o.width;this.height=o.height;this.caretX=s.x;this.caretY=s.y;this._resolveAnimations().update(this,a)}}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s){return}this._updateAnimationTarget(e);const i={width:this.width,height:this.height};const n={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const o=ss(e.padding);const r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;if(e.enabled&&r){t.save();t.globalAlpha=s;this.drawBackground(n,t,i,e);Vs(t,e.textDirection);n.y+=o.top;this.drawTitle(n,t,e);this.drawBody(n,t,e);this.drawFooter(n,t,e);Xs(t,e.textDirection);t.restore()}}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active;const i=t.map((({datasetIndex:t,index:e})=>{const s=this.chart.getDatasetMeta(t);if(!s){throw new Error("Cannot find a dataset at index "+t)}return{datasetIndex:t,element:s.data[e],index:e}}));const n=!lt(s,i);const o=this._positionChanged(i,e);if(n||o){this._active=i;this._eventPosition=e;this._ignoreReplayEvents=true;this.update(true)}}handleEvent(t,e,s=true){if(e&&this._ignoreReplayEvents){return false}this._ignoreReplayEvents=false;const i=this.options;const n=this._active||[];const o=this._getActiveElements(t,n,e,s);const r=this._positionChanged(o,t);const c=e||!lt(o,n)||r;if(c){this._active=o;if(i.enabled||i.external){this._eventPosition={x:t.x,y:t.y};this.update(true,e)}}return c}_getActiveElements(t,e,s,i){const n=this.options;if(t.type==="mouseout"){return[]}if(!i){return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)!==undefined))}const o=this.chart.getElementsAtEventForMode(t,n.mode,n,s);if(n.reverse){o.reverse()}return o}_positionChanged(t,e){const{caretX:s,caretY:i,options:n}=this;const o=jr[n.position].call(this,t,e);return o!==false&&(s!==o.x||i!==o.y)}}var Zr={id:"tooltip",_element:Ur,positioners:jr,afterInit(t,e,s){if(s){t.tooltip=new Ur({chart:t,options:s})}},beforeUpdate(t,e,s){if(t.tooltip){t.tooltip.initialize(s)}},reset(t,e,s){if(t.tooltip){t.tooltip.initialize(s)}},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const s={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...s,cancelable:true})===false){return}e.draw(t.ctx);t.notifyPlugins("afterTooltipDraw",s)}},afterEvent(t,e){if(t.tooltip){const s=e.replay;if(t.tooltip.handleEvent(e.event,s,e.inChartArea)){e.changed=true}}},defaults:{enabled:true,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:true,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Vr},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:false,callbacks:{_scriptable:false,_indexable:false},animation:{_fallback:false},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Kr=(t,e,s,i)=>{if(typeof e==="string"){s=t.push(e)-1;i.unshift({index:s,label:e})}else if(isNaN(e)){s=null}return s};function Qr(t,e,s,i){const n=t.indexOf(e);if(n===-1){return Kr(t,e,s,i)}const o=t.lastIndexOf(e);return n!==o?s:n}const qr=(t,e)=>t===null?null:Zt(Math.round(t),0,e);function Jr(t){const e=this.getLabels();if(t>=0&&t<e.length){return e[t]}return t}class tc extends io{static id="category";static defaults={ticks:{callback:Jr}};constructor(t){super(t);this._startValue=undefined;this._valueRange=0;this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:s,label:i}of e){if(t[s]===i){t.splice(s,1)}}this._addedLabels=[]}super.init(t)}parse(t,e){if(et(t)){return null}const s=this.getLabels();e=isFinite(e)&&s[e]===t?e:Qr(s,t,rt(e,t),this._addedLabels);return qr(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:i}=this.getMinMax(true);if(this.options.bounds==="ticks"){if(!t){s=0}if(!e){i=this.getLabels().length-1}}this.min=s;this.max=i}buildTicks(){const t=this.min;const e=this.max;const s=this.options.offset;const i=[];let n=this.getLabels();n=t===0&&e===n.length-1?n:n.slice(t,e+1);this._valueRange=Math.max(n.length-(s?0:1),1);this._startValue=this.min-(s?.5:0);for(let s=t;s<=e;s++){i.push({value:s})}return i}getLabelForValue(t){return Jr.call(this,t)}configure(){super.configure();if(!this.isHorizontal()){this._reversePixels=!this._reversePixels}}getPixelForValue(t){if(typeof t!=="number"){t=this.parse(t)}return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;if(t<0||t>e.length-1){return null}return this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function ec(t,e){const s=[];const i=1e-14;const{bounds:n,step:o,min:r,max:c,precision:a,count:h,maxTicks:f,maxDigits:l,includeBounds:u}=t;const d=o||1;const b=f-1;const{min:p,max:g}=e;const m=!et(r);const y=!et(c);const x=!et(h);const v=(g-p)/(l+1);let M=Tt((g-p)/b/d)*d;let k,w,_,A;if(M<i&&!m&&!y){return[{value:p},{value:g}]}A=Math.ceil(g/M)-Math.floor(p/M);if(A>b){M=Tt(A*M/b/d)*d}if(!et(a)){k=Math.pow(10,a);M=Math.ceil(M*k)/k}if(n==="ticks"){w=Math.floor(p/M)*M;_=Math.ceil(g/M)*M}else{w=p;_=g}if(m&&y&&o&&Nt((c-r)/o,M/1e3)){A=Math.round(Math.min((c-r)/M,f));M=(c-r)/A;w=r;_=c}else if(x){w=m?r:w;_=y?c:_;A=h-1;M=(_-w)/A}else{A=(_-w)/M;if(It(A,Math.round(A),M/1e3)){A=Math.round(A)}else{A=Math.ceil(A)}}const O=Math.max(Gt(M),Gt(w));k=Math.pow(10,et(a)?O:a);w=Math.round(w*k)/k;_=Math.round(_*k)/k;let S=0;if(m){if(u&&w!==r){s.push({value:r});if(w<r){S++}if(It(Math.round((w+S*M)*k)/k,r,sc(r,v,t))){S++}}else if(w<r){S++}}for(;S<A;++S){const t=Math.round((w+S*M)*k)/k;if(y&&t>c){break}s.push({value:t})}if(y&&u&&_!==c){if(s.length&&It(s[s.length-1].value,c,sc(c,v,t))){s[s.length-1].value=c}else{s.push({value:c})}}else if(!y||_===c){s.push({value:_})}return s}function sc(t,e,{horizontal:s,minRotation:i}){const n=Ht(i);const o=(s?Math.sin(n):Math.cos(n))||.001;const r=.75*e*(""+t).length;return Math.min(e/o,r)}class ic extends io{constructor(t){super(t);this.start=undefined;this.end=undefined;this._startValue=undefined;this._endValue=undefined;this._valueRange=0}parse(t,e){if(et(t)){return null}if((typeof t==="number"||t instanceof Number)&&!isFinite(+t)){return null}return+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options;const{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:i,max:n}=this;const o=t=>i=e?i:t;const r=t=>n=s?n:t;if(t){const t=Pt(i);const e=Pt(n);if(t<0&&e<0){r(0)}else if(t>0&&e>0){o(0)}}if(i===n){let e=n===0?1:Math.abs(n*.05);r(n+e);if(!t){o(i-e)}}this.min=i;this.max=n}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t;let i;if(s){i=Math.ceil(this.max/s)-Math.floor(this.min/s)+1;if(i>1e3){console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${i} ticks. Limiting to 1000.`);i=1e3}}else{i=this.computeTickLimit();e=e||11}if(e){i=Math.min(e,i)}return i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options;const e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const i={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==false};const n=this._range||this;const o=ec(i,n);if(t.bounds==="ticks"){Wt(o,this,"value")}if(t.reverse){o.reverse();this.start=this.max;this.end=this.min}else{this.start=this.min;this.end=this.max}return o}configure(){const t=this.ticks;let e=this.min;let s=this.max;super.configure();if(this.options.offset&&t.length){const i=(s-e)/Math.max(t.length-1,1)/2;e-=i;s+=i}this._startValue=e;this._endValue=s;this._valueRange=s-e}getLabelForValue(t){return _e(t,this.chart.options.locale,this.options.ticks.format)}}class nc extends ic{static id="linear";static defaults={ticks:{callback:Se.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(true);this.min=nt(t)?t:0;this.max=nt(e)?e:1;this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal();const e=t?this.width:this.height;const s=Ht(this.options.ticks.minRotation);const i=(t?Math.sin(s):Math.cos(s))||.001;const n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const oc=(t,e,s)=>({type:"bar",options:{plugins:{legend:{display:false},title:{display:true,text:["Trailing 30 Days","Gross Payments",n(t)],position:"top",align:"start"},tooltip:{displayColors:false,intersect:false,callbacks:{label:t=>{let i=t.dataIndex;let r=o(e[i].date,s);let c=n(e[i].value);return[r,c]}}}},scales:{x:{grid:{drawOnChartArea:false,drawTicks:false},ticks:{callback:t=>{if(t===0||t===e.length-1){return o(e[t].date,s)}}}},y:{display:false}}},data:{labels:e.map((()=>"")),datasets:[{label:"Gross Volume by Date",data:e.map((t=>t.value))}]}});const rc=':root,[data-bs-theme=light]{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13, 110, 253;--bs-secondary-rgb:108, 117, 125;--bs-success-rgb:25, 135, 84;--bs-info-rgb:13, 202, 240;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:220, 53, 69;--bs-light-rgb:248, 249, 250;--bs-dark-rgb:33, 37, 41;--bs-primary-text-emphasis:#052c65;--bs-secondary-text-emphasis:#2b2f32;--bs-success-text-emphasis:#0a3622;--bs-info-text-emphasis:#055160;--bs-warning-text-emphasis:#664d03;--bs-danger-text-emphasis:#58151c;--bs-light-text-emphasis:#495057;--bs-dark-text-emphasis:#495057;--bs-primary-bg-subtle:#cfe2ff;--bs-secondary-bg-subtle:#e2e3e5;--bs-success-bg-subtle:#d1e7dd;--bs-info-bg-subtle:#cff4fc;--bs-warning-bg-subtle:#fff3cd;--bs-danger-bg-subtle:#f8d7da;--bs-light-bg-subtle:#fcfcfd;--bs-dark-bg-subtle:#ced4da;--bs-primary-border-subtle:#9ec5fe;--bs-secondary-border-subtle:#c4c8cb;--bs-success-border-subtle:#a3cfbb;--bs-info-border-subtle:#9eeaf9;--bs-warning-border-subtle:#ffe69c;--bs-danger-border-subtle:#f1aeb5;--bs-light-border-subtle:#e9ecef;--bs-dark-border-subtle:#adb5bd;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-color-rgb:33, 37, 41;--bs-body-bg:#fff;--bs-body-bg-rgb:255, 255, 255;--bs-emphasis-color:#000;--bs-emphasis-color-rgb:0, 0, 0;--bs-secondary-color:rgba(33, 37, 41, 0.75);--bs-secondary-color-rgb:33, 37, 41;--bs-secondary-bg:#e9ecef;--bs-secondary-bg-rgb:233, 236, 239;--bs-tertiary-color:rgba(33, 37, 41, 0.5);--bs-tertiary-color-rgb:33, 37, 41;--bs-tertiary-bg:#f8f9fa;--bs-tertiary-bg-rgb:248, 249, 250;--bs-heading-color:inherit;--bs-link-color:#0d6efd;--bs-link-color-rgb:13, 110, 253;--bs-link-decoration:underline;--bs-link-hover-color:#0a58ca;--bs-link-hover-color-rgb:10, 88, 202;--bs-code-color:#d63384;--bs-highlight-bg:#fff3cd;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, 0.175);--bs-border-radius:0.375rem;--bs-border-radius-sm:0.25rem;--bs-border-radius-lg:0.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-xxl:2rem;--bs-border-radius-2xl:var(--bs-border-radius-xxl);--bs-border-radius-pill:50rem;--bs-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg:0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset:inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width:0.25rem;--bs-focus-ring-opacity:0.25;--bs-focus-ring-color:rgba(13, 110, 253, 0.25);--bs-form-valid-color:#198754;--bs-form-valid-border-color:#198754;--bs-form-invalid-color:#dc3545;--bs-form-invalid-border-color:#dc3545}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color:#dee2e6;--bs-body-color-rgb:222, 226, 230;--bs-body-bg:#212529;--bs-body-bg-rgb:33, 37, 41;--bs-emphasis-color:#fff;--bs-emphasis-color-rgb:255, 255, 255;--bs-secondary-color:rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb:222, 226, 230;--bs-secondary-bg:#343a40;--bs-secondary-bg-rgb:52, 58, 64;--bs-tertiary-color:rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb:222, 226, 230;--bs-tertiary-bg:#2b3035;--bs-tertiary-bg-rgb:43, 48, 53;--bs-primary-text-emphasis:#6ea8fe;--bs-secondary-text-emphasis:#a7acb1;--bs-success-text-emphasis:#75b798;--bs-info-text-emphasis:#6edff6;--bs-warning-text-emphasis:#ffda6a;--bs-danger-text-emphasis:#ea868f;--bs-light-text-emphasis:#f8f9fa;--bs-dark-text-emphasis:#dee2e6;--bs-primary-bg-subtle:#031633;--bs-secondary-bg-subtle:#161719;--bs-success-bg-subtle:#051b11;--bs-info-bg-subtle:#032830;--bs-warning-bg-subtle:#332701;--bs-danger-bg-subtle:#2c0b0e;--bs-light-bg-subtle:#343a40;--bs-dark-bg-subtle:#1a1d20;--bs-primary-border-subtle:#084298;--bs-secondary-border-subtle:#41464b;--bs-success-border-subtle:#0f5132;--bs-info-border-subtle:#087990;--bs-warning-border-subtle:#997404;--bs-danger-border-subtle:#842029;--bs-light-border-subtle:#495057;--bs-dark-border-subtle:#343a40;--bs-heading-color:inherit;--bs-link-color:#6ea8fe;--bs-link-hover-color:#8bb9fe;--bs-link-color-rgb:110, 168, 254;--bs-link-hover-color-rgb:139, 185, 254;--bs-code-color:#e685b5;--bs-border-color:#495057;--bs-border-color-translucent:rgba(255, 255, 255, 0.15);--bs-form-valid-color:#75b798;--bs-form-valid-border-color:#75b798;--bs-form-invalid-color:#ea868f;--bs-form-invalid-border-color:#ea868f}.spinner-grow,.spinner-border{display:inline-block;width:var(--bs-spinner-width);height:var(--bs-spinner-height);vertical-align:var(--bs-spinner-vertical-align);border-radius:50%;animation:var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name)}@keyframes spinner-border{to{transform:rotate(360deg) }}.spinner-border{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-border-width:0.25em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-border;border:var(--bs-spinner-border-width) solid currentcolor;border-right-color:transparent}.spinner-border-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem;--bs-spinner-border-width:0.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-grow;background-color:currentcolor;opacity:0}.spinner-grow-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem}@media (prefers-reduced-motion: reduce){.spinner-border,.spinner-grow{--bs-spinner-animation-speed:1.5s}}.clearfix::after{display:block;clear:both;content:""}.text-bg-primary{color:#fff !important;background-color:RGBA(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-secondary{color:#fff !important;background-color:RGBA(var(--bs-secondary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-success{color:#fff !important;background-color:RGBA(var(--bs-success-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-info{color:#000 !important;background-color:RGBA(var(--bs-info-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-warning{color:#000 !important;background-color:RGBA(var(--bs-warning-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-danger{color:#fff !important;background-color:RGBA(var(--bs-danger-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-light{color:#000 !important;background-color:RGBA(var(--bs-light-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-dark{color:#fff !important;background-color:RGBA(var(--bs-dark-rgb), var(--bs-bg-opacity, 1)) !important}.link-primary{color:RGBA(var(--bs-primary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-primary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-primary:hover,.link-primary:focus{color:RGBA(10, 88, 202, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(10, 88, 202, var(--bs-link-underline-opacity, 1)) !important}.link-secondary{color:RGBA(var(--bs-secondary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-secondary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-secondary:hover,.link-secondary:focus{color:RGBA(86, 94, 100, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(86, 94, 100, var(--bs-link-underline-opacity, 1)) !important}.link-success{color:RGBA(var(--bs-success-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-success-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-success:hover,.link-success:focus{color:RGBA(20, 108, 67, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(20, 108, 67, var(--bs-link-underline-opacity, 1)) !important}.link-info{color:RGBA(var(--bs-info-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-info-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-info:hover,.link-info:focus{color:RGBA(61, 213, 243, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(61, 213, 243, var(--bs-link-underline-opacity, 1)) !important}.link-warning{color:RGBA(var(--bs-warning-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-warning-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-warning:hover,.link-warning:focus{color:RGBA(255, 205, 57, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(255, 205, 57, var(--bs-link-underline-opacity, 1)) !important}.link-danger{color:RGBA(var(--bs-danger-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-danger-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-danger:hover,.link-danger:focus{color:RGBA(176, 42, 55, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(176, 42, 55, var(--bs-link-underline-opacity, 1)) !important}.link-light{color:RGBA(var(--bs-light-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-light-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-light:hover,.link-light:focus{color:RGBA(249, 250, 251, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(249, 250, 251, var(--bs-link-underline-opacity, 1)) !important}.link-dark{color:RGBA(var(--bs-dark-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-dark-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-dark:hover,.link-dark:focus{color:RGBA(26, 30, 33, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(26, 30, 33, var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis:hover,.link-body-emphasis:focus{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 0.75)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 0.75)) !important}.focus-ring:focus{outline:0;box-shadow:var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.icon-link{display:inline-flex;gap:0.375rem;align-items:center;text-decoration-color:rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 0.5));text-underline-offset:0.25em;backface-visibility:hidden}.icon-link>.bi{flex-shrink:0;width:1em;height:1em;fill:currentcolor;transition:0.2s ease-in-out transform}@media (prefers-reduced-motion: reduce){.icon-link>.bi{transition:none}}.icon-link-hover:hover>.bi,.icon-link-hover:focus-visible>.bi{transform:var(--bs-icon-link-transform, translate3d(0.25em, 0, 0))}.ratio{position:relative;width:100%}.ratio::before{display:block;padding-top:var(--bs-aspect-ratio);content:""}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-1x1{--bs-aspect-ratio:100%}.ratio-4x3{--bs-aspect-ratio:75%}.ratio-16x9{--bs-aspect-ratio:56.25%}.ratio-21x9{--bs-aspect-ratio:42.8571428571%}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}.sticky-top{position:sticky;top:0;z-index:1020}.sticky-bottom{position:sticky;bottom:0;z-index:1020}@media (min-width: 576px){.sticky-sm-top{position:sticky;top:0;z-index:1020}.sticky-sm-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 768px){.sticky-md-top{position:sticky;top:0;z-index:1020}.sticky-md-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 992px){.sticky-lg-top{position:sticky;top:0;z-index:1020}.sticky-lg-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1200px){.sticky-xl-top{position:sticky;top:0;z-index:1020}.sticky-xl-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1400px){.sticky-xxl-top{position:sticky;top:0;z-index:1020}.sticky-xxl-bottom{position:sticky;bottom:0;z-index:1020}}.hstack{display:flex;flex-direction:row;align-items:center;align-self:stretch}.vstack{display:flex;flex:1 1 auto;flex-direction:column;align-self:stretch}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption),.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption){position:absolute !important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vr{display:inline-block;align-self:stretch;width:var(--bs-border-width);min-height:1em;background-color:currentcolor;opacity:0.25}:host{display:block}';const cc=class{constructor(e){t(this,e);this.accountId=undefined;this.authToken=undefined;this.data=undefined;this.total=undefined;this.dates=undefined;this.endDate=undefined;this.loading=true;this.errorMessage=""}updateOnPropChange(){this.fetchData()}connectedCallback(){this.fetchData()}componentDidRender(){this.renderChart()}async fetchData(){if(!this.accountId||!this.authToken){this.errorMessage="Can not fetch any data without an AccountID and an AuthToken";this.loading=false;return}this.loading=true;const t=i(this.authToken,c.proxyApiOrigin);const e=`account/${this.accountId}/reports/gross_volume`;const s=await t.get(e);if(!s.error){this.total=s===null||s===void 0?void 0:s.data.total;this.dates=s===null||s===void 0?void 0:s.data.dates.reverse();this.endDate=this.dates[this.dates.length-1].date}this.loading=false}renderChart(){if(this.chart){this.chart.update()}else if(this.chartRef&&this.endDate){Zo.register(mr,Ti,rr,tc,nc,Or,Zr,Dr);this.chart=new Zo(this.chartRef.getContext("2d"),oc(this.total,this.dates,this.endDate));this.chart.render()}}render(){return e(s,null,this.errorMessage?r(this.errorMessage):e("canvas",{id:"chart",ref:t=>this.chartRef=t}))}static get watchers(){return{accountId:["updateOnPropChange"],authToken:["updateOnPropChange"]}}};cc.style=rc;export{cc as justifi_gross_payment_chart};
20
- //# sourceMappingURL=p-8c4c3d60.entry.js.map
20
+ //# sourceMappingURL=p-26245f01.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{r as t,h as s,H as e}from"./p-cbb60191.js";import{A as i}from"./p-b157f6ae.js";import{p as a}from"./p-0d5d02d7.js";import{P as n}from"./p-76983a7e.js";import{f as r,c as o,s as c,a as h}from"./p-d6b5793d.js";import{c as d}from"./p-9b6dcac5.js";const u="";const p=class{constructor(s){t(this,s);this.handleClickPrevious=t=>{const s=Object.assign({},this.params);delete s.after_cursor;this.params=Object.assign(Object.assign({},s),{before_cursor:t})};this.handleClickNext=t=>{const s=Object.assign({},this.params);delete s.before_cursor;this.params=Object.assign(Object.assign({},s),{after_cursor:t})};this.accountId=undefined;this.authToken=undefined;this.paymentId=undefined;this.balanceTransactions=[];this.loading=true;this.errorMessage=undefined;this.paging=a;this.params=undefined}updateOnPropChange(){this.fetchData()}connectedCallback(){this.fetchData()}async fetchData(){this.loading=true;if(!this.accountId||!this.paymentId){this.errorMessage="Missing required props: accountId or paymentId";this.loading=false;return}const t=`account/${this.accountId}/payments/${this.paymentId}/payment_balance_transactions`;const s=await i(this.authToken,d.proxyApiOrigin).get(t,this.params);if(!s.error){this.paging=Object.assign(Object.assign({},this.paging),s.page_info);this.balanceTransactions=s.data.map((t=>new n(t)))}else{this.errorMessage=typeof s.error==="string"?s.error:s.error.message}this.loading=false}render(){return s(e,null,s("justifi-table",{columnData:[["Processed On","The date each transaction occurred"],["Type","The type of each transaction"],["ID","The unique identifier of each transaction"],["Amout","The dollar amount of each transaction"],["Balance","The running total amount of this payment that belongs to you"]],entityId:this.balanceTransactions.map((t=>t.id)),rowData:this.balanceTransactions.map((t=>[s("div",null,s("div",null,r(t.created_at)),s("div",null,o(t.created_at))),c(t.payment_balance_txn_type),t.payment_id,h(t.amount),h(t.balance)])),loading:this.loading,"error-message":this.errorMessage,params:this.params,paging:Object.assign(Object.assign({},this.paging),{handleClickNext:this.handleClickNext,handleClickPrevious:this.handleClickPrevious})}))}static get watchers(){return{params:["updateOnPropChange"]}}};p.style=u;export{p as justifi_payment_balance_transactions};
2
+ //# sourceMappingURL=p-26dfa274.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["paymentBalanceTransactionsCss","PaymentBalanceTransactions","this","handleClickPrevious","beforeCursor","newParams","Object","assign","params","after_cursor","before_cursor","handleClickNext","afterCursor","pagingDefaults","updateOnPropChange","fetchData","connectedCallback","loading","accountId","paymentId","errorMessage","endpoint","response","Api","authToken","config","proxyApiOrigin","get","error","paging","page_info","balanceTransactions","data","map","dataItem","PaymentBalanceTransaction","message","render","h","Host","columnData","entityId","transaction","id","rowData","balanceTransaction","formatDate","created_at","formatTime","snakeCaseToHumanReadable","payment_balance_txn_type","payment_id","formatCurrency","amount","balance"],"sources":["src/components/payment-balance-transactions/payment-balance-transactions.scss?tag=justifi-payment-balance-transactions&encapsulation=shadow","src/components/payment-balance-transactions/payment-balance-transactions.tsx"],"sourcesContent":[null,"import { Component, Host, h, Prop, State, Watch } from '@stencil/core';\nimport {\n Api,\n IApiResponseCollection,\n IPaymentBalanceTransaction,\n PagingInfo,\n PaymentBalanceTransaction,\n pagingDefaults,\n} from '../../api';\n\nimport {\n formatCurrency,\n formatDate,\n formatTime,\n snakeCaseToHumanReadable,\n} from '../../utils/utils';\nimport { config } from '../../../config';\n\n@Component({\n tag: 'justifi-payment-balance-transactions',\n styleUrl: 'payment-balance-transactions.scss',\n shadow: true,\n})\nexport class PaymentBalanceTransactions {\n @Prop() accountId: string;\n @Prop() authToken: string;\n @Prop() paymentId: string;\n @State() balanceTransactions: IPaymentBalanceTransaction[] = [];\n @State() loading: boolean = true;\n @State() errorMessage: string;\n @State() paging: PagingInfo = pagingDefaults;\n @State() params: any\n\n @Watch('params')\n updateOnPropChange() {\n this.fetchData();\n }\n\n connectedCallback() {\n this.fetchData();\n }\n\n handleClickPrevious = (beforeCursor: string) => {\n const newParams: any = { ...this.params };\n delete newParams.after_cursor;\n this.params = ({ ...newParams, before_cursor: beforeCursor });\n };\n\n handleClickNext = (afterCursor: string) => {\n const newParams: any = { ...this.params };\n delete newParams.before_cursor;\n this.params = ({ ...newParams, after_cursor: afterCursor });\n };\n\n async fetchData(): Promise<void> {\n this.loading = true;\n\n if (!this.accountId || !this.paymentId) {\n this.errorMessage = 'Missing required props: accountId or paymentId';\n this.loading = false;\n return;\n }\n const endpoint = `account/${this.accountId}/payments/${this.paymentId}/payment_balance_transactions`;\n\n const response: IApiResponseCollection<IPaymentBalanceTransaction[]> =\n await Api(this.authToken, config.proxyApiOrigin).get(endpoint, this.params);\n\n if (!response.error) {\n this.paging = {\n ...this.paging,\n ...response.page_info,\n };\n this.balanceTransactions = response.data.map(\n dataItem => new PaymentBalanceTransaction(dataItem),\n );\n } else {\n this.errorMessage =\n typeof response.error === 'string'\n ? response.error\n : response.error.message;\n }\n this.loading = false;\n }\n\n render() {\n return (\n <Host>\n <justifi-table\n columnData={[\n ['Processed On', 'The date each transaction occurred'],\n ['Type', 'The type of each transaction'],\n ['ID', 'The unique identifier of each transaction'],\n ['Amout', 'The dollar amount of each transaction'],\n [\n 'Balance',\n 'The running total amount of this payment that belongs to you',\n ],\n ]}\n entityId={this.balanceTransactions.map(transaction => transaction.id)}\n rowData={this.balanceTransactions.map(balanceTransaction => [\n <div>\n <div>{formatDate(balanceTransaction.created_at)}</div>\n <div>{formatTime(balanceTransaction.created_at)}</div>\n </div>,\n snakeCaseToHumanReadable(\n balanceTransaction.payment_balance_txn_type,\n ),\n balanceTransaction.payment_id,\n formatCurrency(balanceTransaction.amount),\n formatCurrency(balanceTransaction.balance),\n ])}\n loading={this.loading}\n error-message={this.errorMessage}\n params={this.params}\n paging={{\n ...this.paging,\n handleClickNext: this.handleClickNext,\n handleClickPrevious: this.handleClickPrevious\n }}\n />\n </Host>\n );\n }\n}\n"],"mappings":"2PAAA,MAAMA,EAAgC,G,MCuBzBC,EAA0B,M,yBAmBrCC,KAAAC,oBAAuBC,IACrB,MAAMC,EAASC,OAAAC,OAAA,GAAaL,KAAKM,eAC1BH,EAAUI,aACjBP,KAAKM,OAAMF,OAAAC,OAAAD,OAAAC,OAAA,GAASF,GAAS,CAAEK,cAAeN,GAAe,EAG/DF,KAAAS,gBAAmBC,IACjB,MAAMP,EAASC,OAAAC,OAAA,GAAaL,KAAKM,eAC1BH,EAAUK,cACjBR,KAAKM,OAAMF,OAAAC,OAAAD,OAAAC,OAAA,GAASF,GAAS,CAAEI,aAAcG,GAAc,E,oGAxBA,G,aACjC,K,wCAEEC,E,sBAI9B,kBAAAC,GACEZ,KAAKa,W,CAGP,iBAAAC,GACEd,KAAKa,W,CAeP,eAAMA,GACJb,KAAKe,QAAU,KAEf,IAAKf,KAAKgB,YAAchB,KAAKiB,UAAW,CACtCjB,KAAKkB,aAAe,iDACpBlB,KAAKe,QAAU,MACf,M,CAEF,MAAMI,EAAW,WAAWnB,KAAKgB,sBAAsBhB,KAAKiB,yCAE5D,MAAMG,QACEC,EAAIrB,KAAKsB,UAAWC,EAAOC,gBAAgBC,IAAIN,EAAUnB,KAAKM,QAEtE,IAAKc,EAASM,MAAO,CACnB1B,KAAK2B,OAAMvB,OAAAC,OAAAD,OAAAC,OAAA,GACNL,KAAK2B,QACLP,EAASQ,WAEd5B,KAAK6B,oBAAsBT,EAASU,KAAKC,KACvCC,GAAY,IAAIC,EAA0BD,I,KAEvC,CACLhC,KAAKkB,oBACIE,EAASM,QAAU,SACtBN,EAASM,MACTN,EAASM,MAAMQ,O,CAEvBlC,KAAKe,QAAU,K,CAGjB,MAAAoB,GACE,OACEC,EAACC,EAAI,KACHD,EAAA,iBACEE,WAAY,CACV,CAAC,eAAgB,sCACjB,CAAC,OAAQ,gCACT,CAAC,KAAM,6CACP,CAAC,QAAS,yCACV,CACE,UACA,iEAGJC,SAAUvC,KAAK6B,oBAAoBE,KAAIS,GAAeA,EAAYC,KAClEC,QAAS1C,KAAK6B,oBAAoBE,KAAIY,GAAsB,CAC1DP,EAAA,WACEA,EAAA,WAAMQ,EAAWD,EAAmBE,aACpCT,EAAA,WAAMU,EAAWH,EAAmBE,cAEtCE,EACEJ,EAAmBK,0BAErBL,EAAmBM,WACnBC,EAAeP,EAAmBQ,QAClCD,EAAeP,EAAmBS,YAEpCrC,QAASf,KAAKe,QAAO,gBACNf,KAAKkB,aACpBZ,OAAQN,KAAKM,OACbqB,OAAMvB,OAAAC,OAAAD,OAAAC,OAAA,GACDL,KAAK2B,QAAM,CACdlB,gBAAiBT,KAAKS,gBACtBR,oBAAqBD,KAAKC,wB"}