@gemafajarramadhan/dynamic-ui 1.3.28 → 1.3.29

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.
@@ -22627,6 +22627,8 @@ const TS = {
22627
22627
  primary: "hsl(var(--primary))",
22628
22628
  text: "hsl(var(--primary-foreground))",
22629
22629
  hover: "hsl(var(--accent))",
22630
+ selectedHover: "hsl(var(--primary) / 0.9)",
22631
+ selectedText: "hsl(var(--primary-foreground))",
22630
22632
  border: "hsl(var(--border))",
22631
22633
  range: "#bfdbfe"
22632
22634
  // blue-200 (darker, more saturated)
@@ -22634,7 +22636,9 @@ const TS = {
22634
22636
  dark: {
22635
22637
  primary: "hsl(var(--primary))",
22636
22638
  text: "hsl(var(--primary-foreground))",
22637
- hover: "hsl(var(--accent))",
22639
+ hover: "hsl(var(--accent) /0.5)",
22640
+ selectedHover: "hsl(var(--primary) / 0.9)",
22641
+ selectedText: "#ffffff",
22638
22642
  border: "hsl(var(--border))",
22639
22643
  range: "rgba(30, 58, 138, 0.3)"
22640
22644
  // blue-900 30%
@@ -22645,6 +22649,8 @@ const TS = {
22645
22649
  primary: "#16a34a",
22646
22650
  text: "#ffffff",
22647
22651
  hover: "#dcfce7",
22652
+ selectedHover: "#15803d",
22653
+ selectedText: "#ffffff",
22648
22654
  border: "#16a34a",
22649
22655
  range: "#ecfdf5"
22650
22656
  },
@@ -22652,6 +22658,8 @@ const TS = {
22652
22658
  primary: "#22c55e",
22653
22659
  text: "#0b1220",
22654
22660
  hover: "#14532d",
22661
+ selectedHover: "#16a34a",
22662
+ selectedText: "#ffffff",
22655
22663
  border: "#22c55e",
22656
22664
  range: "rgba(6, 78, 59, 0.3)"
22657
22665
  }
@@ -22661,6 +22669,8 @@ const TS = {
22661
22669
  primary: "#d97706",
22662
22670
  text: "#ffffff",
22663
22671
  hover: "#fffbeb",
22672
+ selectedHover: "#b45309",
22673
+ selectedText: "#ffffff",
22664
22674
  border: "#d97706",
22665
22675
  range: "#fffbeb"
22666
22676
  },
@@ -22668,6 +22678,8 @@ const TS = {
22668
22678
  primary: "#f59e0b",
22669
22679
  text: "#0b1220",
22670
22680
  hover: "#78350f",
22681
+ selectedHover: "#d97706",
22682
+ selectedText: "#0b1220",
22671
22683
  border: "#f59e0b",
22672
22684
  range: "rgba(120, 53, 15, 0.3)"
22673
22685
  }
@@ -22677,6 +22689,8 @@ const TS = {
22677
22689
  primary: "#7c3aed",
22678
22690
  text: "#ffffff",
22679
22691
  hover: "#f5f3ff",
22692
+ selectedHover: "#6d28d9",
22693
+ selectedText: "#ffffff",
22680
22694
  border: "#7c3aed",
22681
22695
  range: "#f5f3ff"
22682
22696
  },
@@ -22684,6 +22698,8 @@ const TS = {
22684
22698
  primary: "#8b5cf6",
22685
22699
  text: "#0b1220",
22686
22700
  hover: "#2e1065",
22701
+ selectedHover: "#7c3aed",
22702
+ selectedText: "#ffffff",
22687
22703
  border: "#8b5cf6",
22688
22704
  range: "rgba(46, 16, 101, 0.3)"
22689
22705
  }
@@ -22693,6 +22709,8 @@ const TS = {
22693
22709
  primary: "hsl(var(--destructive))",
22694
22710
  text: "hsl(var(--destructive-foreground))",
22695
22711
  hover: "hsl(var(--destructive) / 0.10)",
22712
+ selectedHover: "hsl(var(--destructive) / 0.8)",
22713
+ selectedText: "hsl(var(--destructive-foreground))",
22696
22714
  border: "hsl(var(--destructive))",
22697
22715
  range: "#fef2f2"
22698
22716
  // red-50
@@ -22701,6 +22719,8 @@ const TS = {
22701
22719
  primary: "hsl(var(--destructive))",
22702
22720
  text: "hsl(var(--destructive-foreground))",
22703
22721
  hover: "hsl(var(--destructive) / 0.18)",
22722
+ selectedHover: "hsl(var(--destructive) / 0.7)",
22723
+ selectedText: "hsl(var(--destructive-foreground))",
22704
22724
  border: "hsl(var(--destructive))",
22705
22725
  range: "rgba(127, 29, 29, 0.3)"
22706
22726
  // red-900 30%
@@ -22723,6 +22743,17 @@ function a5(e, t = up) {
22723
22743
  --dp-border-color: ${n.dark.border} !important;
22724
22744
  }
22725
22745
 
22746
+ /* Selected Date Hover Effect */
22747
+ .dp__active_date:hover {
22748
+ background-color: ${n.light.selectedHover} !important;
22749
+ color: ${n.light.selectedText} !important;
22750
+ cursor: pointer !important;
22751
+ }
22752
+ .dark .dp__active_date:hover {
22753
+ background-color: ${n.dark.selectedHover} !important;
22754
+ color: ${n.dark.selectedText} !important;
22755
+ }
22756
+
22726
22757
  /* ✅ Custom Border & Layout Logic (Moved from .vue) */
22727
22758
  .dcode-datepicker-calendar .dp__action_row,
22728
22759
  .dcode-datepicker-menu .dp__action_row,
@@ -38,7 +38,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),O=y,N=D),T===void 0&&(
38
38
  * Released under the MIT License
39
39
  */class kx{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(o,n,r,a){const s=n.listeners[a],i=n.duration;s.forEach(l=>l({chart:o,initial:n.initial,numSteps:i,currentStep:Math.min(r-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=Ad.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(o=Date.now()){let n=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const s=r.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(o),l=!0):(s[i]=s[s.length-1],s.pop());l&&(a.draw(),this._notify(a,r,o,"progress")),s.length||(r.running=!1,this._notify(a,r,o,"complete"),r.initial=!1),n+=s.length}),this._lastDate=o,n===0&&(this._running=!1)}_getAnims(o){const n=this._charts;let r=n.get(o);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(o,r)),r}listen(o,n,r){this._getAnims(o).listeners[n].push(r)}add(o,n){!n||!n.length||this._getAnims(o).items.push(...n)}has(o){return this._getAnims(o).items.length>0}start(o){const n=this._charts.get(o);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,a)=>Math.max(r,a._duration),0),this._refresh())}running(o){if(!this._running)return!1;const n=this._charts.get(o);return!(!n||!n.running||!n.items.length)}stop(o){const n=this._charts.get(o);if(!n||!n.items.length)return;const r=n.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();n.items=[],this._notify(o,n,Date.now(),"complete")}remove(o){return this._charts.delete(o)}}var so=new kx;const nu="transparent",xx={boolean(t,o,n){return n>.5?o:t},color(t,o,n){const r=Md(t||nu),a=r.valid&&Md(o||nu);return a&&a.valid?a.mix(r,n).hexString():o},number(t,o,n){return t+(o-t)*n}};class wx{constructor(o,n,r,a){const s=n[r];a=ua([o.to,a,s,o.from]);const i=ua([o.from,s,a]);this._active=!0,this._fn=o.fn||xx[o.type||typeof i],this._easing=er[o.easing]||er.linear,this._start=Math.floor(Date.now()+(o.delay||0)),this._duration=this._total=Math.floor(o.duration),this._loop=!!o.loop,this._target=n,this._prop=r,this._from=i,this._to=a,this._promises=void 0}active(){return this._active}update(o,n,r){if(this._active){this._notify(!1);const a=this._target[this._prop],s=r-this._start,i=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(i,o.duration)),this._total+=s,this._loop=!!o.loop,this._to=ua([o.to,n,a,o.from]),this._from=ua([o.from,a,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(o){const n=o-this._start,r=this._duration,a=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||n<r),!this._active){this._target[a]=l,this._notify(!0);return}if(n<0){this._target[a]=s;return}c=n/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[a]=this._fn(s,l,c)}wait(){const o=this._promises||(this._promises=[]);return new Promise((n,r)=>{o.push({res:n,rej:r})})}_notify(o){const n=o?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][n]()}}class ru{constructor(o,n){this._chart=o,this._properties=new Map,this.configure(n)}configure(o){if(!Re(o))return;const n=Object.keys(tt.animation),r=this._properties;Object.getOwnPropertyNames(o).forEach(a=>{const s=o[a];if(!Re(s))return;const i={};for(const l of n)i[l]=s[l];(nt(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(o,n){const r=n.options,a=Ex(o,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&Cx(o.options.$animations,r).then(()=>{o.options=r},()=>{}),s}_createAnimations(o,n){const r=this._properties,a=[],s=o.$animations||(o.$animations={}),i=Object.keys(n),l=Date.now();let c;for(c=i.length-1;c>=0;--c){const d=i[c];if(d.charAt(0)==="$")continue;if(d==="options"){a.push(...this._animateOptions(o,n));continue}const u=n[d];let f=s[d];const h=r.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){o[d]=u;continue}s[d]=f=new wx(h,o,d,u),a.push(f)}return a}update(o,n){if(this._properties.size===0){Object.assign(o,n);return}const r=this._createAnimations(o,n);if(r.length)return so.add(this._chart,r),!0}}function Cx(t,o){const n=[],r=Object.keys(o);for(let a=0;a<r.length;a++){const s=t[r[a]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function Ex(t,o){if(!o)return;let n=t.options;if(!n){t.options=o;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function au(t,o){const n=t&&t.options||{},r=n.reverse,a=n.min===void 0?o:0,s=n.max===void 0?o:0;return{start:r?s:a,end:r?a:s}}function Sx(t,o,n){if(n===!1)return!1;const r=au(t,n),a=au(o,n);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function _x(t){let o,n,r,a;return Re(t)?(o=t.top,n=t.right,r=t.bottom,a=t.left):o=n=r=a=t,{top:o,right:n,bottom:r,left:a,disabled:t===!1}}function su(t,o){const n=[],r=t._getSortedDatasetMetas(o);let a,s;for(a=0,s=r.length;a<s;++a)n.push(r[a].index);return n}function iu(t,o,n,r={}){const a=t.keys,s=r.mode==="single";let i,l,c,d;if(o===null)return;let u=!1;for(i=0,l=a.length;i<l;++i){if(c=+a[i],c===n){if(u=!0,r.all)continue;break}d=t.values[c],ut(d)&&(s||o===0||Ut(o)===Ut(d))&&(o+=d)}return!u&&!r.all?0:o}function Bx(t,o){const{iScale:n,vScale:r}=o,a=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",i=Object.keys(t),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[a]:u,[s]:t[u]};return l}function mi(t,o){const n=t&&t.options.stacked;return n||n===void 0&&o.stack!==void 0}function Dx(t,o,n){return`${t.id}.${o.id}.${n.stack||n.type}`}function Ax(t){const{min:o,max:n,minDefined:r,maxDefined:a}=t.getUserBounds();return{min:r?o:Number.NEGATIVE_INFINITY,max:a?n:Number.POSITIVE_INFINITY}}function vx(t,o,n){const r=t[o]||(t[o]={});return r[n]||(r[n]={})}function lu(t,o,n,r){for(const a of o.getMatchingVisibleMetas(r).reverse()){const s=t[a.index];if(n&&s>0||!n&&s<0)return a.index}return null}function cu(t,o){const{chart:n,_cachedMeta:r}=t,a=n._stacks||(n._stacks={}),{iScale:s,vScale:i,index:l}=r,c=s.axis,d=i.axis,u=Dx(s,i,r),f=o.length;let h;for(let m=0;m<f;++m){const p=o[m],{[c]:b,[d]:x}=p,g=p._stacks||(p._stacks={});h=g[d]=vx(a,u,b),h[l]=x,h._top=lu(h,i,!0,r.type),h._bottom=lu(h,i,!1,r.type);const k=h._visualValues||(h._visualValues={});k[l]=x}}function pi(t,o){const n=t.scales;return Object.keys(n).filter(r=>n[r].axis===o).shift()}function Nx(t,o){return Ko(t,{active:!1,dataset:void 0,datasetIndex:o,index:o,mode:"default",type:"dataset"})}function Vx(t,o,n){return Ko(t,{active:!1,dataIndex:o,parsed:void 0,raw:void 0,element:n,index:o,mode:"default",type:"data"})}function rr(t,o){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){o=o||t._parsed;for(const a of o){const s=a._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const gi=t=>t==="reset"||t==="none",du=(t,o)=>o?t:Object.assign({},t),Mx=(t,o,n)=>t&&!o.hidden&&o._stacked&&{keys:su(n,!0),values:null};class Qo{constructor(o,n){this.chart=o,this._ctx=o.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const o=this._cachedMeta;this.configure(),this.linkScales(),o._stacked=mi(o.vScale,o),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(o){this.index!==o&&rr(this._cachedMeta),this.index=o}linkScales(){const o=this.chart,n=this._cachedMeta,r=this.getDataset(),a=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,s=n.xAxisID=Pe(r.xAxisID,pi(o,"x")),i=n.yAxisID=Pe(r.yAxisID,pi(o,"y")),l=n.rAxisID=Pe(r.rAxisID,pi(o,"r")),c=n.indexAxis,d=n.iAxisID=a(c,s,i,l),u=n.vAxisID=a(c,i,s,l);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(i),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(o){return this.chart.scales[o]}_getOtherScale(o){const n=this._cachedMeta;return o===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const o=this._cachedMeta;this._data&&Bd(this._data,this),o._stacked&&rr(o)}_dataCheck(){const o=this.getDataset(),n=o.data||(o.data=[]),r=this._data;if(Re(n)){const a=this._cachedMeta;this._data=Bx(n,a)}else if(r!==n){if(r){Bd(r,this);const a=this._cachedMeta;rr(a),a._parsed=[]}n&&Object.isExtensible(n)&&mk(n,this),this._syncList=[],this._data=n}}addElements(){const o=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(o.dataset=new this.datasetElementType)}buildOrUpdateElements(o){const n=this._cachedMeta,r=this.getDataset();let a=!1;this._dataCheck();const s=n._stacked;n._stacked=mi(n.vScale,n),n.stack!==r.stack&&(a=!0,rr(n),n.stack=r.stack),this._resyncElements(o),(a||s!==n._stacked)&&(cu(this,n._parsed),n._stacked=mi(n.vScale,n))}configure(){const o=this.chart.config,n=o.datasetScopeKeys(this._type),r=o.getOptionScopes(this.getDataset(),n,!0);this.options=o.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(o,n){const{_cachedMeta:r,_data:a}=this,{iScale:s,_stacked:i}=r,l=s.axis;let c=o===0&&n===a.length?!0:r._sorted,d=o>0&&r._parsed[o-1],u,f,h;if(this._parsing===!1)r._parsed=a,r._sorted=!0,h=a;else{nt(a[o])?h=this.parseArrayData(r,a,o,n):Re(a[o])?h=this.parseObjectData(r,a,o,n):h=this.parsePrimitiveData(r,a,o,n);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<n;++u)r._parsed[u+o]=f=h[u],c&&(m()&&(c=!1),d=f);r._sorted=c}i&&cu(this,h)}parsePrimitiveData(o,n,r,a){const{iScale:s,vScale:i}=o,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(a);let h,m,p;for(h=0,m=a;h<m;++h)p=h+r,f[h]={[l]:u||s.parse(d[p],p),[c]:i.parse(n[p],p)};return f}parseArrayData(o,n,r,a){const{xScale:s,yScale:i}=o,l=new Array(a);let c,d,u,f;for(c=0,d=a;c<d;++c)u=c+r,f=n[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(o,n,r,a){const{xScale:s,yScale:i}=o,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(a);let u,f,h,m;for(u=0,f=a;u<f;++u)h=u+r,m=n[h],d[u]={x:s.parse(Uo(m,l),h),y:i.parse(Uo(m,c),h)};return d}getParsed(o){return this._cachedMeta._parsed[o]}getDataElement(o){return this._cachedMeta.data[o]}applyStack(o,n,r){const a=this.chart,s=this._cachedMeta,i=n[o.axis],l={keys:su(a,!0),values:n._stacks[o.axis]._visualValues};return iu(l,i,s.index,{mode:r})}updateRangeFromParsed(o,n,r,a){const s=r[n.axis];let i=s===null?NaN:s;const l=a&&r._stacks[n.axis];a&&l&&(a.values=l,i=iu(a,s,this._cachedMeta.index)),o.min=Math.min(o.min,i),o.max=Math.max(o.max,i)}getMinMax(o,n){const r=this._cachedMeta,a=r._parsed,s=r._sorted&&o===r.iScale,i=a.length,l=this._getOtherScale(o),c=Mx(n,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Ax(l);let h,m;function p(){m=a[h];const b=m[l.axis];return!ut(m[o.axis])||u>b||f<b}for(h=0;h<i&&!(!p()&&(this.updateRangeFromParsed(d,o,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(d,o,m,c);break}}return d}getAllParsedValues(o){const n=this._cachedMeta._parsed,r=[];let a,s,i;for(a=0,s=n.length;a<s;++a)i=n[a][o.axis],ut(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(o){const n=this._cachedMeta,r=n.iScale,a=n.vScale,s=this.getParsed(o);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:a?""+a.getLabelForValue(s[a.axis]):""}}_update(o){const n=this._cachedMeta;this.update(o||"default"),n._clip=_x(Pe(this.options.clip,Sx(n.xScale,n.yScale,this.getMaxOverflow())))}update(o){}draw(){const o=this._ctx,n=this.chart,r=this._cachedMeta,a=r.data||[],s=n.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||a.length-l,d=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(o,s,l,c),u=l;u<l+c;++u){const f=a[u];f.hidden||(f.active&&d?i.push(f):f.draw(o,s))}for(u=0;u<i.length;++u)i[u].draw(o,s)}getStyle(o,n){const r=n?"active":"default";return o===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(o||0,r)}getContext(o,n,r){const a=this.getDataset();let s;if(o>=0&&o<this._cachedMeta.data.length){const i=this._cachedMeta.data[o];s=i.$context||(i.$context=Vx(this.getContext(),o,i)),s.parsed=this.getParsed(o),s.raw=a.data[o],s.index=s.dataIndex=o}else s=this.$context||(this.$context=Nx(this.chart.getContext(),this.index)),s.dataset=a,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(o){return this._resolveElementOptions(this.datasetElementType.id,o)}resolveDataElementOptions(o,n){return this._resolveElementOptions(this.dataElementType.id,n,o)}_resolveElementOptions(o,n="default",r){const a=n==="active",s=this._cachedDataOpts,i=o+"-"+n,l=s[i],c=this.enableOptionSharing&&Yn(r);if(l)return du(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,o),f=a?[`${o}Hover`,"hover",o,""]:[o,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(tt.elements[o]),p=()=>this.getContext(r,a,n),b=d.resolveNamedOptions(h,m,p,f);return b.$shared&&(b.$shared=c,s[i]=Object.freeze(du(b,c))),b}_resolveAnimations(o,n,r){const a=this.chart,s=this._cachedDataOpts,i=`animation-${n}`,l=s[i];if(l)return l;let c;if(a.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(o,r,n))}const d=new ru(a,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(o){if(o.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},o))}includeOptions(o,n){return!n||gi(o)||this.chart._animationsDisabled}_getSharedOptions(o,n){const r=this.resolveDataElementOptions(o,n),a=this._sharedOptions,s=this.getSharedOptions(r),i=this.includeOptions(n,s)||s!==a;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:i}}updateElement(o,n,r,a){gi(a)?Object.assign(o,r):this._resolveAnimations(n,a).update(o,r)}updateSharedOptions(o,n,r){o&&!gi(n)&&this._resolveAnimations(void 0,n).update(o,r)}_setStyle(o,n,r,a){o.active=a;const s=this.getStyle(n,a);this._resolveAnimations(n,r,a).update(o,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(o,n,r){this._setStyle(o,r,"active",!1)}setHoverStyle(o,n,r){this._setStyle(o,r,"active",!0)}_removeDatasetHoverStyle(){const o=this._cachedMeta.dataset;o&&this._setStyle(o,void 0,"active",!1)}_setDatasetHoverStyle(){const o=this._cachedMeta.dataset;o&&this._setStyle(o,void 0,"active",!0)}_resyncElements(o){const n=this._data,r=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const a=r.length,s=n.length,i=Math.min(s,a);i&&this.parse(0,i),s>a?this._insertElements(a,s-a,o):s<a&&this._removeElements(s,a-s)}_insertElements(o,n,r=!0){const a=this._cachedMeta,s=a.data,i=o+n;let l;const c=d=>{for(d.length+=n,l=d.length-1;l>=i;l--)d[l]=d[l-n]};for(c(s),l=o;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(a._parsed),this.parse(o,n),r&&this.updateElements(s,o,n,"reset")}updateElements(o,n,r,a){}_removeElements(o,n){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(o,n);r._stacked&&rr(r,a)}r.data.splice(o,n)}_sync(o){if(this._parsing)this._syncList.push(o);else{const[n,r,a]=o;this[n](r,a)}this.chart._dataChanges.push([this.index,...o])}_onDataPush(){const o=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-o,o])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(o,n){n&&this._sync(["_removeElements",o,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",o,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Ae(Qo,"defaults",{}),Ae(Qo,"datasetElementType",null),Ae(Qo,"dataElementType",null);function Tx(t,o){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(o);let r=[];for(let a=0,s=n.length;a<s;a++)r=r.concat(n[a].controller.getAllParsedValues(t));t._cache.$bar=Dd(r.sort((a,s)=>a-s))}return t._cache.$bar}function Px(t){const o=t.iScale,n=Tx(o,t.type);let r=o._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(Yn(l)&&(r=Math.min(r,Math.abs(i-l)||r)),l=i)};for(a=0,s=n.length;a<s;++a)i=o.getPixelForValue(n[a]),c();for(l=void 0,a=0,s=o.ticks.length;a<s;++a)i=o.getPixelForTick(a),c();return r}function Ox(t,o,n,r){const a=n.barThickness;let s,i;return je(a)?(s=o.min*n.categoryPercentage,i=n.barPercentage):(s=a*r,i=1),{chunk:s/r,ratio:i,start:o.pixels[t]-s/2}}function Fx(t,o,n,r){const a=o.pixels,s=a[t];let i=t>0?a[t-1]:null,l=t<a.length-1?a[t+1]:null;const c=n.categoryPercentage;i===null&&(i=s-(l===null?o.end-o.start:l-s)),l===null&&(l=s+s-i);const d=s-(s-Math.min(i,l))/2*c;return{chunk:Math.abs(l-i)/2*c/r,ratio:n.barPercentage,start:d}}function Rx(t,o,n,r){const a=n.parse(t[0],r),s=n.parse(t[1],r),i=Math.min(a,s),l=Math.max(a,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),o[n.axis]=d,o._custom={barStart:c,barEnd:d,start:a,end:s,min:i,max:l}}function uu(t,o,n,r){return nt(t)?Rx(t,o,n,r):o[n.axis]=n.parse(t,r),o}function fu(t,o,n,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,f,h;for(d=n,u=n+r;d<u;++d)h=o[d],f={},f[a.axis]=l||a.parse(i[d],d),c.push(uu(h,f,s,d));return c}function bi(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Lx(t,o,n){return t!==0?Ut(t):(o.isHorizontal()?1:-1)*(o.min>=n?1:-1)}function $x(t){let o,n,r,a,s;return t.horizontal?(o=t.base>t.x,n="left",r="right"):(o=t.base<t.y,n="bottom",r="top"),o?(a="end",s="start"):(a="start",s="end"),{start:n,end:r,reverse:o,top:a,bottom:s}}function Ix(t,o,n,r){let a=o.borderSkipped;const s={};if(!a){t.borderSkipped=s;return}if(a===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=$x(t);a==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?a=d:(n._bottom||0)===r?a=u:(s[hu(u,i,l,c)]=!0,a=d)),s[hu(a,i,l,c)]=!0,t.borderSkipped=s}function hu(t,o,n,r){return r?(t=zx(t,o,n),t=mu(t,n,o)):t=mu(t,o,n),t}function zx(t,o,n){return t===o?n:t===n?o:t}function mu(t,o,n){return t==="start"?o:t==="end"?n:t}function jx(t,{inflateAmount:o},n){t.inflateAmount=o==="auto"?n===1?.33:0:o}class ga extends Qo{parsePrimitiveData(o,n,r,a){return fu(o,n,r,a)}parseArrayData(o,n,r,a){return fu(o,n,r,a)}parseObjectData(o,n,r,a){const{iScale:s,vScale:i}=o,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let h,m,p,b;for(h=r,m=r+a;h<m;++h)b=n[h],p={},p[s.axis]=s.parse(Uo(b,d),h),f.push(uu(Uo(b,u),p,i,h));return f}updateRangeFromParsed(o,n,r,a){super.updateRangeFromParsed(o,n,r,a);const s=r._custom;s&&n===this._cachedMeta.vScale&&(o.min=Math.min(o.min,s.min),o.max=Math.max(o.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(o){const n=this._cachedMeta,{iScale:r,vScale:a}=n,s=this.getParsed(o),i=s._custom,l=bi(i)?"["+i.start+", "+i.end+"]":""+a.getLabelForValue(s[a.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const o=this._cachedMeta;o.stack=this.getDataset().stack}update(o){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,o)}updateElements(o,n,r,a){const s=a==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(n,a);for(let m=n;m<n+r;m++){const p=this.getParsed(m),b=s||je(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),g=(p._stacks||{})[l.axis],k={horizontal:d,base:b.base,enableBorderRadius:!g||bi(p._custom)||i===g._top||i===g._bottom,x:d?b.head:x.center,y:d?x.center:b.head,height:d?x.size:Math.abs(b.size),width:d?Math.abs(b.size):x.size};h&&(k.options=f||this.resolveDataElementOptions(m,o[m].active?"active":a));const w=k.options||o[m].options;Ix(k,w,g,i),jx(k,w,u.ratio),this.updateElement(o[m],m,k,a)}}_getStacks(o,n){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(n),c=l&&l[r.axis],d=u=>{const f=u._parsed.find(m=>m[r.axis]===c),h=f&&f[u.vScale.axis];if(je(h)||isNaN(h))return!0};for(const u of a)if(!(n!==void 0&&d(u))&&((s===!1||i.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===o))break;return i.length||i.push(void 0),i}_getStackCount(o){return this._getStacks(void 0,o).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const o=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(o).filter(r=>o[r].axis===n).shift()}_getAxis(){const o={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)o[Pe(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(o)}_getStackIndex(o,n,r){const a=this._getStacks(o,r),s=n!==void 0?a.indexOf(n):-1;return s===-1?a.length-1:s}_getRuler(){const o=this.options,n=this._cachedMeta,r=n.iScale,a=[];let s,i;for(s=0,i=n.data.length;s<i;++s)a.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const l=o.barThickness;return{min:l||Px(n),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:o.grouped,ratio:l?1:o.categoryPercentage*o.barPercentage}}_calculateBarValuePixels(o){const{_cachedMeta:{vScale:n,_stacked:r,index:a},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(o),d=c._custom,u=bi(d);let f=c[n.axis],h=0,m=r?this.applyStack(n,c,r):f,p,b;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&Ut(f)!==Ut(d.barEnd)&&(h=0),h+=f);const x=!je(s)&&!u?s:h;let g=n.getPixelForValue(x);if(this.chart.getDataVisibility(o)?p=n.getPixelForValue(h+m):p=g,b=p-g,Math.abs(b)<i){b=Lx(b,n,l)*i,f===l&&(g-=b/2);const k=n.getPixelForDecimal(0),w=n.getPixelForDecimal(1),E=Math.min(k,w),v=Math.max(k,w);g=Math.max(Math.min(g,v),E),p=g+b,r&&!u&&(c._stacks[n.axis]._visualValues[a]=n.getValueForPixel(p)-n.getValueForPixel(g))}if(g===n.getPixelForValue(l)){const k=Ut(b)*n.getLineWidthForValue(l)/2;g+=k,b-=k}return{size:b,base:g,head:p,center:p+b/2}}_calculateBarIndexPixels(o,n){const r=n.scale,a=this.options,s=a.skipNull,i=Pe(a.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(n.grouped){const u=s?this._getStackCount(o):n.stackCount,f=a.barThickness==="flex"?Fx(o,n,a,u*d):Ox(o,n,a,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Pe(h,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,s?o:void 0)+m;l=f.start+f.chunk*p+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=r.getPixelForValue(this.getParsed(o)[r.axis],o),c=Math.min(i,n.min*n.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const o=this._cachedMeta,n=o.vScale,r=o.data,a=r.length;let s=0;for(;s<a;++s)this.getParsed(s)[n.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}Ae(ga,"id","bar"),Ae(ga,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ae(ga,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function Ux(t,o,n){let r=1,a=1,s=0,i=0;if(o<Ze){const l=t,c=l+o,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(w,E,v)=>Zn(w,l,c,!0)?1:Math.max(E,E*n,v,v*n),p=(w,E,v)=>Zn(w,l,c,!0)?-1:Math.min(E,E*n,v,v*n),b=m(0,d,f),x=m(st,u,h),g=p(He,d,f),k=p(He+st,u,h);r=(b-g)/2,a=(x-k)/2,s=-(b+g)/2,i=-(x+k)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class Cn extends Qo{constructor(o,n){super(o,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(o,n){const r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let s=c=>+r[c];if(Re(r[o])){const{key:c="value"}=this._parsing;s=d=>+Uo(r[d],c)}let i,l;for(i=o,l=o+n;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return ro(this.options.rotation-90)}_getCircumference(){return ro(this.options.circumference)}_getRotationExtents(){let o=Ze,n=-Ze;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,s=a._getRotation(),i=a._getCircumference();o=Math.min(o,s),n=Math.max(n,s+i)}return{rotation:o,circumference:n-o}}update(o){const n=this.chart,{chartArea:r}=n,a=this._cachedMeta,s=a.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(Jy(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:b}=Ux(f,u,c),x=(r.width-i)/h,g=(r.height-i)/m,k=Math.max(Math.min(x,g)/2,0),w=gd(this.options.radius,k),E=Math.max(w*c,0),v=(w-E)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=b*w,a.total=this.calculateTotal(),this.outerRadius=w-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*d,0),this.updateElements(s,0,s.length,o)}_circumference(o,n){const r=this.options,a=this._cachedMeta,s=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(o)||a._parsed[o]===null||a.data[o].hidden?0:this.calculateCircumference(a._parsed[o]*s/Ze)}updateElements(o,n,r,a){const s=a==="reset",i=this.chart,l=i.chartArea,d=i.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,h=s&&d.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(n,a);let g=this._getRotation(),k;for(k=0;k<n;++k)g+=this._circumference(k,s);for(k=n;k<n+r;++k){const w=this._circumference(k,s),E=o[k],v={x:u+this.offsetX,y:f+this.offsetY,startAngle:g,endAngle:g+w,circumference:w,outerRadius:p,innerRadius:m};x&&(v.options=b||this.resolveDataElementOptions(k,E.active?"active":a)),g+=w,this.updateElement(E,k,v,a)}}calculateTotal(){const o=this._cachedMeta,n=o.data;let r=0,a;for(a=0;a<n.length;a++){const s=o._parsed[a];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(a)&&!n[a].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(o){const n=this._cachedMeta.total;return n>0&&!isNaN(o)?Ze*(Math.abs(o)/n):0}getLabelAndValue(o){const n=this._cachedMeta,r=this.chart,a=r.data.labels||[],s=ri(n._parsed[o],r.options.locale);return{label:a[o]||"",value:s}}getMaxBorderWidth(o){let n=0;const r=this.chart;let a,s,i,l,c;if(!o){for(a=0,s=r.data.datasets.length;a<s;++a)if(r.isDatasetVisible(a)){i=r.getDatasetMeta(a),o=i.data,l=i.controller;break}}if(!o)return 0;for(a=0,s=o.length;a<s;++a)c=l.resolveDataElementOptions(a),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(o){let n=0;for(let r=0,a=o.length;r<a;++r){const s=this.resolveDataElementOptions(r);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(o){let n=0;for(let r=0;r<o;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(o){return Math.max(Pe(this.chart.data.datasets[o].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ae(Cn,"id","doughnut"),Ae(Cn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Ae(Cn,"descriptors",{_scriptable:o=>o!=="spacing",_indexable:o=>o!=="spacing"&&!o.startsWith("borderDash")&&!o.startsWith("hoverBorderDash")}),Ae(Cn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(o){const n=o.data,{labels:{pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=o.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,d)=>{const f=o.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!o.getDataVisibility(d),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:a,pointStyle:r,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(o,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class ba extends Qo{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(o){const n=this._cachedMeta,{dataset:r,data:a=[],_dataset:s}=n,i=this.chart._animationsDisabled;let{start:l,count:c}=bk(n,a,i);this._drawStart=l,this._drawCount=c,yk(n)&&(l=0,c=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=a;const d=this.resolveDatasetElementOptions(o);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:d},o),this.updateElements(a,l,c,o)}updateElements(o,n,r,a){const s=a==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,a),h=i.axis,m=l.axis,{spanGaps:p,segment:b}=this.options,x=Qn(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||s||a==="none",k=n+r,w=o.length;let E=n>0&&this.getParsed(n-1);for(let v=0;v<w;++v){const V=o[v],A=g?V:{};if(v<n||v>=k){A.skip=!0;continue}const S=this.getParsed(v),P=je(S[m]),B=A[h]=i.getPixelForValue(S[h],v),M=A[m]=s||P?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,S,c):S[m],v);A.skip=isNaN(B)||isNaN(M)||P,A.stop=v>0&&Math.abs(S[h]-E[h])>x,b&&(A.parsed=S,A.raw=d.data[v]),f&&(A.options=u||this.resolveDataElementOptions(v,V.active?"active":a)),g||this.updateElement(V,v,A,a),E=S}}getMaxOverflow(){const o=this._cachedMeta,n=o.dataset,r=n.options&&n.options.borderWidth||0,a=o.data||[];if(!a.length)return r;const s=a[0].size(this.resolveDataElementOptions(0)),i=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,s,i)/2}draw(){const o=this._cachedMeta;o.dataset.updateControlPoints(this.chart.chartArea,o.iScale.axis),super.draw()}}Ae(ba,"id","line"),Ae(ba,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ae(ba,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class yi extends Cn{}Ae(yi,"id","pie"),Ae(yi,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Zo(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ki{constructor(o){Ae(this,"options");this.options=o||{}}static override(o){Object.assign(ki.prototype,o)}init(){}formats(){return Zo()}parse(){return Zo()}format(){return Zo()}add(){return Zo()}diff(){return Zo()}startOf(){return Zo()}endOf(){return Zo()}}var Wx={_date:ki};function Hx(t,o,n,r){const{controller:a,data:s,_sorted:i}=t,l=a._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&o===l.axis&&o!=="r"&&i&&s.length){const d=l._reversePixels?fk:Ho;if(r){if(a._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(o);if(f){const h=d(s,o,n-f),m=d(s,o,n+f);return{lo:h.lo,hi:m.hi}}}}else{const u=d(s,o,n);if(c){const{vScale:f}=a._cachedMeta,{_parsed:h}=t,m=h.slice(0,u.lo+1).reverse().findIndex(b=>!je(b[f.axis]));u.lo-=Math.max(0,m);const p=h.slice(u.hi).findIndex(b=>!je(b[f.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:s.length-1}}function ya(t,o,n,r,a){const s=t.getSortedVisibleDatasetMetas(),i=n[o];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:h}=Hx(s[l],o,i,a);for(let m=f;m<=h;++m){const p=u[m];p.skip||r(p,d,m)}}}function Gx(t){const o=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(r,a){const s=o?Math.abs(r.x-a.x):0,i=n?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function xi(t,o,n,r,a){const s=[];return!a&&!t.isPointInArea(o)||ya(t,n,o,function(l,c,d){!a&&!or(l,t.chartArea,0)||l.inRange(o.x,o.y,r)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function qx(t,o,n,r){let a=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:f}=Sd(i,{x:o.x,y:o.y});Zn(f,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return ya(t,n,o,s),a}function Kx(t,o,n,r,a,s){let i=[];const l=Gx(n);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(o.x,o.y,a);if(r&&!m)return;const p=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(p))&&!m)return;const x=l(o,p);x<c?(i=[{element:u,datasetIndex:f,index:h}],c=x):x===c&&i.push({element:u,datasetIndex:f,index:h})}return ya(t,n,o,d),i}function wi(t,o,n,r,a,s){return!s&&!t.isPointInArea(o)?[]:n==="r"&&!r?qx(t,o,n,a):Kx(t,o,n,r,a,s)}function pu(t,o,n,r,a){const s=[],i=n==="x"?"inXRange":"inYRange";let l=!1;return ya(t,n,o,(c,d,u)=>{c[i]&&c[i](o[n],a)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(o.x,o.y,a))}),r&&!l?[]:s}var Xx={modes:{index(t,o,n,r){const a=Yo(o,t),s=n.axis||"x",i=n.includeInvisible||!1,l=n.intersect?xi(t,a,s,r,i):wi(t,a,s,!1,r,i),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,o,n,r){const a=Yo(o,t),s=n.axis||"xy",i=n.includeInvisible||!1;let l=n.intersect?xi(t,a,s,r,i):wi(t,a,s,!1,r,i);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,o,n,r){const a=Yo(o,t),s=n.axis||"xy",i=n.includeInvisible||!1;return xi(t,a,s,r,i)},nearest(t,o,n,r){const a=Yo(o,t),s=n.axis||"xy",i=n.includeInvisible||!1;return wi(t,a,s,n.intersect,r,i)},x(t,o,n,r){const a=Yo(o,t);return pu(t,a,"x",n.intersect,r)},y(t,o,n,r){const a=Yo(o,t);return pu(t,a,"y",n.intersect,r)}}};const gu=["left","top","right","bottom"];function ar(t,o){return t.filter(n=>n.pos===o)}function bu(t,o){return t.filter(n=>gu.indexOf(n.pos)===-1&&n.box.axis===o)}function sr(t,o){return t.sort((n,r)=>{const a=o?r:n,s=o?n:r;return a.weight===s.weight?a.index-s.index:a.weight-s.weight})}function Yx(t){const o=[];let n,r,a,s,i,l;for(n=0,r=(t||[]).length;n<r;++n)a=t[n],{position:s,options:{stack:i,stackWeight:l=1}}=a,o.push({index:n,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:i&&s+i,stackWeight:l});return o}function Jx(t){const o={};for(const n of t){const{stack:r,pos:a,stackWeight:s}=n;if(!r||!gu.includes(a))continue;const i=o[r]||(o[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return o}function Qx(t,o){const n=Jx(t),{vBoxMaxWidth:r,hBoxMaxHeight:a}=o;let s,i,l;for(s=0,i=t.length;s<i;++s){l=t[s];const{fullSize:c}=l.box,d=n[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*r:c&&o.availableWidth,l.height=a):(l.width=r,l.height=u?u*a:c&&o.availableHeight)}return n}function Zx(t){const o=Yx(t),n=sr(o.filter(d=>d.box.fullSize),!0),r=sr(ar(o,"left"),!0),a=sr(ar(o,"right")),s=sr(ar(o,"top"),!0),i=sr(ar(o,"bottom")),l=bu(o,"x"),c=bu(o,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:ar(o,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function yu(t,o,n,r){return Math.max(t[n],o[n])+Math.max(t[r],o[r])}function ku(t,o){t.top=Math.max(t.top,o.top),t.left=Math.max(t.left,o.left),t.bottom=Math.max(t.bottom,o.bottom),t.right=Math.max(t.right,o.right)}function e1(t,o,n,r){const{pos:a,box:s}=n,i=t.maxPadding;if(!Re(a)){n.size&&(t[a]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?s.height:s.width),n.size=f.size/f.count,t[a]+=n.size}s.getPadding&&ku(i,s.getPadding());const l=Math.max(0,o.outerWidth-yu(i,t,"left","right")),c=Math.max(0,o.outerHeight-yu(i,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,n.horizontal?{same:d,other:u}:{same:u,other:d}}function t1(t){const o=t.maxPadding;function n(r){const a=Math.max(o[r]-t[r],0);return t[r]+=a,a}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function o1(t,o){const n=o.maxPadding;function r(a){const s={left:0,top:0,right:0,bottom:0};return a.forEach(i=>{s[i]=Math.max(o[i],n[i])}),s}return r(t?["left","right"]:["top","bottom"])}function ir(t,o,n,r){const a=[];let s,i,l,c,d,u;for(s=0,i=t.length,d=0;s<i;++s){l=t[s],c=l.box,c.update(l.width||o.w,l.height||o.h,o1(l.horizontal,o));const{same:f,other:h}=e1(o,n,l,r);d|=f&&a.length,u=u||h,c.fullSize||a.push(l)}return d&&ir(a,o,n,r)||u}function ka(t,o,n,r,a){t.top=n,t.left=o,t.right=o+r,t.bottom=n+a,t.width=r,t.height=a}function xu(t,o,n,r){const a=n.padding;let{x:s,y:i}=o;for(const l of t){const c=l.box,d=r[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=o.w*u,h=d.size||c.height;Yn(d.start)&&(i=d.start),c.fullSize?ka(c,a.left,i,n.outerWidth-a.right-a.left,h):ka(c,o.left+d.placed,i,f,h),d.start=i,d.placed+=f,i=c.bottom}else{const f=o.h*u,h=d.size||c.width;Yn(d.start)&&(s=d.start),c.fullSize?ka(c,s,a.top,h,n.outerHeight-a.bottom-a.top):ka(c,s,o.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}o.x=s,o.y=i}var Mt={addBox(t,o){t.boxes||(t.boxes=[]),o.fullSize=o.fullSize||!1,o.position=o.position||"top",o.weight=o.weight||0,o._layers=o._layers||function(){return[{z:0,draw(n){o.draw(n)}}]},t.boxes.push(o)},removeBox(t,o){const n=t.boxes?t.boxes.indexOf(o):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,o,n){o.fullSize=n.fullSize,o.position=n.position,o.weight=n.weight},update(t,o,n,r){if(!t)return;const a=Vt(t.options.layout.padding),s=Math.max(o-a.width,0),i=Math.max(n-a.height,0),l=Zx(t.boxes),c=l.vertical,d=l.horizontal;We(t.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=c.reduce((b,x)=>x.box.options&&x.box.options.display===!1?b:b+1,0)||1,f=Object.freeze({outerWidth:o,outerHeight:n,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},a);ku(h,Vt(r));const m=Object.assign({maxPadding:h,w:s,h:i,x:a.left,y:a.top},a),p=Qx(c.concat(d),f);ir(l.fullSize,m,f,p),ir(c,m,f,p),ir(d,m,f,p)&&ir(c,m,f,p),t1(m),xu(l.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,xu(l.rightAndBottom,m,f,p),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},We(l.chartArea,b=>{const x=b.box;Object.assign(x,t.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class wu{acquireContext(o,n){}releaseContext(o){return!1}addEventListener(o,n,r){}removeEventListener(o,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(o,n,r,a){return n=Math.max(0,n||o.width),r=r||o.height,{width:n,height:Math.max(0,a?Math.floor(n/a):r)}}isAttached(o){return!0}updateConfig(o){}}class n1 extends wu{acquireContext(o){return o&&o.getContext&&o.getContext("2d")||null}updateConfig(o){o.options.animation=!1}}const xa="$chartjs",r1={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Cu=t=>t===null||t==="";function a1(t,o){const n=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[xa]={initial:{height:r,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Cu(a)){const s=qd(t,"width");s!==void 0&&(t.width=s)}if(Cu(r))if(t.style.height==="")t.height=t.width/(o||2);else{const s=qd(t,"height");s!==void 0&&(t.height=s)}return t}const Eu=ix?{passive:!0}:!1;function s1(t,o,n){t&&t.addEventListener(o,n,Eu)}function i1(t,o,n){t&&t.canvas&&t.canvas.removeEventListener(o,n,Eu)}function l1(t,o){const n=r1[t.type]||t.type,{x:r,y:a}=Yo(t,o);return{type:n,chart:o,native:t,x:r!==void 0?r:null,y:a!==void 0?a:null}}function wa(t,o){for(const n of t)if(n===o||n.contains(o))return!0}function c1(t,o,n){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||wa(l.addedNodes,r),i=i&&!wa(l.removedNodes,r);i&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}function d1(t,o,n){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||wa(l.removedNodes,r),i=i&&!wa(l.addedNodes,r);i&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}const lr=new Map;let Su=0;function _u(){const t=window.devicePixelRatio;t!==Su&&(Su=t,lr.forEach((o,n)=>{n.currentDevicePixelRatio!==t&&o()}))}function u1(t,o){lr.size||window.addEventListener("resize",_u),lr.set(t,o)}function f1(t){lr.delete(t),lr.size||window.removeEventListener("resize",_u)}function h1(t,o,n){const r=t.canvas,a=r&&hi(r);if(!a)return;const s=vd((l,c)=>{const d=a.clientWidth;n(l,c),d<a.clientWidth&&n()},window),i=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return i.observe(a),u1(t,s),i}function Ci(t,o,n){n&&n.disconnect(),o==="resize"&&f1(t)}function m1(t,o,n){const r=t.canvas,a=vd(s=>{t.ctx!==null&&n(l1(s,t))},t);return s1(r,o,a),a}class p1 extends wu{acquireContext(o,n){const r=o&&o.getContext&&o.getContext("2d");return r&&r.canvas===o?(a1(o,n),r):null}releaseContext(o){const n=o.canvas;if(!n[xa])return!1;const r=n[xa].initial;["height","width"].forEach(s=>{const i=r[s];je(i)?n.removeAttribute(s):n.setAttribute(s,i)});const a=r.style||{};return Object.keys(a).forEach(s=>{n.style[s]=a[s]}),n.width=n.width,delete n[xa],!0}addEventListener(o,n,r){this.removeEventListener(o,n);const a=o.$proxies||(o.$proxies={}),i={attach:c1,detach:d1,resize:h1}[n]||m1;a[n]=i(o,n,r)}removeEventListener(o,n){const r=o.$proxies||(o.$proxies={}),a=r[n];if(!a)return;({attach:Ci,detach:Ci,resize:Ci}[n]||i1)(o,n,a),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(o,n,r,a){return sx(o,n,r,a)}isAttached(o){const n=o&&hi(o);return!!(n&&n.isConnected)}}function g1(t){return!fi()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?n1:p1}let io=(ns=class{constructor(){Ae(this,"x");Ae(this,"y");Ae(this,"active",!1);Ae(this,"options");Ae(this,"$animations")}tooltipPosition(o){const{x:n,y:r}=this.getProps(["x","y"],o);return{x:n,y:r}}hasValue(){return Qn(this.x)&&Qn(this.y)}getProps(o,n){const r=this.$animations;if(!n||!r)return this;const a={};return o.forEach(s=>{a[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),a}},Ae(ns,"defaults",{}),Ae(ns,"defaultRoutes"),ns);function b1(t,o){const n=t.options.ticks,r=y1(t),a=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?x1(o):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return w1(o,d,s,i/a),d;const u=k1(s,o,a);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(Ca(o,d,u,je(m)?0:l-m,l),f=0,h=i-1;f<h;f++)Ca(o,d,u,s[f],s[f+1]);return Ca(o,d,u,c,je(m)?o.length:c+m),d}return Ca(o,d,u),d}function y1(t){const o=t.options.offset,n=t._tickSize(),r=t._length/n+(o?0:1),a=t._maxLength/n;return Math.floor(Math.min(r,a))}function k1(t,o,n){const r=C1(t),a=o.length/n;if(!r)return Math.max(a,1);const s=ak(r);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>a)return c}return Math.max(a,1)}function x1(t){const o=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&o.push(n);return o}function w1(t,o,n,r){let a=0,s=n[0],i;for(r=Math.ceil(r),i=0;i<t.length;i++)i===s&&(o.push(t[i]),a++,s=n[a*r])}function Ca(t,o,n,r,a){const s=Pe(r,0),i=Math.min(Pe(a,t.length),t.length);let l=0,c,d,u;for(n=Math.ceil(n),a&&(c=a-r,n=c/Math.floor(c/n)),u=s;u<0;)l++,u=Math.round(s+l*n);for(d=Math.max(s,0);d<i;d++)d===u&&(o.push(t[d]),l++,u=Math.round(s+l*n))}function C1(t){const o=t.length;let n,r;if(o<2)return!1;for(r=t[0],n=1;n<o;++n)if(t[n]-t[n-1]!==r)return!1;return r}const E1=t=>t==="left"?"right":t==="right"?"left":t,Bu=(t,o,n)=>o==="top"||o==="left"?t[o]+n:t[o]-n,Du=(t,o)=>Math.min(o||t,t);function Au(t,o){const n=[],r=t.length/o,a=t.length;let s=0;for(;s<a;s+=r)n.push(t[Math.floor(s)]);return n}function S1(t,o,n){const r=t.ticks.length,a=Math.min(o,r-1),s=t._startPixel,i=t._endPixel,l=1e-6;let c=t.getPixelForTick(a),d;if(!(n&&(r===1?d=Math.max(c-s,i-c):o===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(a-1))/2,c+=a<o?d:-d,c<s-l||c>i+l)))return c}function _1(t,o){We(t,n=>{const r=n.gc,a=r.length/2;let s;if(a>o){for(s=0;s<a;++s)delete n.data[r[s]];r.splice(0,a)}})}function cr(t){return t.drawTicks?t.tickLength:0}function vu(t,o){if(!t.display)return 0;const n=mt(t.font,o),r=Vt(t.padding);return(nt(t.text)?t.text.length:1)*n.lineHeight+r.height}function B1(t,o){return Ko(t,{scale:o,type:"scale"})}function D1(t,o,n){return Ko(t,{tick:n,index:o,type:"tick"})}function A1(t,o,n){let r=ti(t);return(n&&o!=="right"||!n&&o==="right")&&(r=E1(r)),r}function v1(t,o,n,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,h,m,p;const b=i-a,x=l-s;if(t.isHorizontal()){if(m=ht(r,s,l),Re(n)){const g=Object.keys(n)[0],k=n[g];p=u[g].getPixelForValue(k)+b-o}else n==="center"?p=(d.bottom+d.top)/2+b-o:p=Bu(t,n,o);h=l-s}else{if(Re(n)){const g=Object.keys(n)[0],k=n[g];m=u[g].getPixelForValue(k)-x+o}else n==="center"?m=(d.left+d.right)/2-x+o:m=Bu(t,n,o);p=ht(r,i,a),f=n==="left"?-st:st}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class En extends io{constructor(o){super(),this.id=o.id,this.type=o.type,this.options=void 0,this.ctx=o.ctx,this.chart=o.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(o){this.options=o.setContext(this.getContext()),this.axis=o.axis,this._userMin=this.parse(o.min),this._userMax=this.parse(o.max),this._suggestedMin=this.parse(o.suggestedMin),this._suggestedMax=this.parse(o.suggestedMax)}parse(o,n){return o}getUserBounds(){let{_userMin:o,_userMax:n,_suggestedMin:r,_suggestedMax:a}=this;return o=jt(o,Number.POSITIVE_INFINITY),n=jt(n,Number.NEGATIVE_INFINITY),r=jt(r,Number.POSITIVE_INFINITY),a=jt(a,Number.NEGATIVE_INFINITY),{min:jt(o,r),max:jt(n,a),minDefined:ut(o),maxDefined:ut(n)}}getMinMax(o){let{min:n,max:r,minDefined:a,maxDefined:s}=this.getUserBounds(),i;if(a&&s)return{min:n,max:r};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,o),a||(n=Math.min(n,i.min)),s||(r=Math.max(r,i.max));return n=s&&n>r?r:n,r=a&&n>r?n:r,{min:jt(n,jt(r,n)),max:jt(r,jt(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const o=this.chart.data;return this.options.labels||(this.isHorizontal()?o.xLabels:o.yLabels)||o.labels||[]}getLabelItems(o=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(o))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Je(this.options.beforeUpdate,[this])}update(o,n,r){const{beginAtZero:a,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=o,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Lk(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?Au(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=b1(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let o=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,o=!o),this._startPixel=n,this._endPixel=r,this._reversePixels=o,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Je(this.options.afterUpdate,[this])}beforeSetDimensions(){Je(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Je(this.options.afterSetDimensions,[this])}_callHooks(o){this.chart.notifyPlugins(o,this.getContext()),Je(this.options[o],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Je(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(o){const n=this.options.ticks;let r,a,s;for(r=0,a=o.length;r<a;r++)s=o[r],s.label=Je(n.callback,[s.value,r,o],this)}afterTickToLabelConversion(){Je(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Je(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const o=this.options,n=o.ticks,r=Du(this.ticks.length,o.ticks.maxTicksLimit),a=n.minRotation||0,s=n.maxRotation;let i=a,l,c,d;if(!this._isVisible()||!n.display||a>=s||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=ft(this.chart.width-f,0,this.maxWidth);l=o.offset?this.maxWidth/r:m/(r-1),f+6>l&&(l=m/(r-(o.offset?.5:1)),c=this.maxHeight-cr(o.grid)-n.padding-vu(o.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=ck(Math.min(Math.asin(ft((u.highest.height+6)/l,-1,1)),Math.asin(ft(c/d,-1,1))-Math.asin(ft(h/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){Je(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Je(this.options.beforeFit,[this])}fit(){const o={width:0,height:0},{chart:n,options:{ticks:r,title:a,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=vu(a,n.options.font);if(l?(o.width=this.maxWidth,o.height=cr(s)+c):(o.height=this.maxHeight,o.width=cr(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=r.padding*2,p=ro(this.labelRotation),b=Math.cos(p),x=Math.sin(p);if(l){const g=r.mirror?0:x*f.width+b*h.height;o.height=Math.min(this.maxHeight,o.height+g+m)}else{const g=r.mirror?0:b*f.width+x*h.height;o.width=Math.min(this.maxWidth,o.width+g+m)}this._calculatePadding(d,u,x,b)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=o.height):(this.width=o.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(o,n,r,a){const{ticks:{align:s,padding:i},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,m=0;c?d?(h=a*o.width,m=r*n.height):(h=r*o.height,m=a*n.width):s==="start"?m=n.width:s==="end"?h=o.width:s!=="inner"&&(h=o.width/2,m=n.width/2),this.paddingLeft=Math.max((h-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+i)*this.width/(this.width-f),0)}else{let u=n.height/2,f=o.height/2;s==="start"?(u=0,f=o.height):s==="end"&&(u=n.height,f=0),this.paddingTop=u+i,this.paddingBottom=f+i}}_handleMargins(){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(){Je(this.options.afterFit,[this])}isHorizontal(){const{axis:o,position:n}=this.options;return n==="top"||n==="bottom"||o==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(o){this.beforeTickToLabelConversion(),this.generateTickLabels(o);let n,r;for(n=0,r=o.length;n<r;n++)je(o[n].label)&&(o.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let o=this._labelSizes;if(!o){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Au(r,n)),this._labelSizes=o=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return o}_computeLabelSizes(o,n,r){const{ctx:a,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(n/Du(n,r));let d=0,u=0,f,h,m,p,b,x,g,k,w,E,v;for(f=0;f<n;f+=c){if(p=o[f].label,b=this._resolveTickFontOptions(f),a.font=x=b.string,g=s[x]=s[x]||{data:{},gc:[]},k=b.lineHeight,w=E=0,!je(p)&&!nt(p))w=Od(a,g.data,g.gc,w,p),E=k;else if(nt(p))for(h=0,m=p.length;h<m;++h)v=p[h],!je(v)&&!nt(v)&&(w=Od(a,g.data,g.gc,w,v),E+=k);i.push(w),l.push(E),d=Math.max(w,d),u=Math.max(E,u)}_1(s,n);const V=i.indexOf(d),A=l.indexOf(u),S=P=>({width:i[P]||0,height:l[P]||0});return{first:S(0),last:S(n-1),widest:S(V),highest:S(A),widths:i,heights:l}}getLabelForValue(o){return o}getPixelForValue(o,n){return NaN}getValueForPixel(o){}getPixelForTick(o){const n=this.ticks;return o<0||o>n.length-1?null:this.getPixelForValue(n[o].value)}getPixelForDecimal(o){this._reversePixels&&(o=1-o);const n=this._startPixel+o*this._length;return uk(this._alignToPixels?qo(this.chart,n,0):n)}getDecimalForPixel(o){const n=(o-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:o,max:n}=this;return o<0&&n<0?n:o>0&&n>0?o:0}getContext(o){const n=this.ticks||[];if(o>=0&&o<n.length){const r=n[o];return r.$context||(r.$context=D1(this.getContext(),o,r))}return this.$context||(this.$context=B1(this.chart.getContext(),this))}_tickSize(){const o=this.options.ticks,n=ro(this.labelRotation),r=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),s=this._getLabelSizes(),i=o.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*r>l*a?l/r:c/a:c*a<l*r?c/r:l/a}_isVisible(){const o=this.options.display;return o!=="auto"?!!o:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(o){const n=this.axis,r=this.chart,a=this.options,{grid:s,position:i,border:l}=a,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=cr(s),m=[],p=l.setContext(this.getContext()),b=p.display?p.width:0,x=b/2,g=function(W){return qo(r,W,b)};let k,w,E,v,V,A,S,P,B,M,C,F;if(i==="top")k=g(this.bottom),A=this.bottom-h,P=k-x,M=g(o.top)+x,F=o.bottom;else if(i==="bottom")k=g(this.top),M=o.top,F=g(o.bottom)-x,A=k+x,P=this.top+h;else if(i==="left")k=g(this.right),V=this.right-h,S=k-x,B=g(o.left)+x,C=o.right;else if(i==="right")k=g(this.left),B=o.left,C=g(o.right)-x,V=k+x,S=this.left+h;else if(n==="x"){if(i==="center")k=g((o.top+o.bottom)/2+.5);else if(Re(i)){const W=Object.keys(i)[0],y=i[W];k=g(this.chart.scales[W].getPixelForValue(y))}M=o.top,F=o.bottom,A=k+x,P=A+h}else if(n==="y"){if(i==="center")k=g((o.left+o.right)/2);else if(Re(i)){const W=Object.keys(i)[0],y=i[W];k=g(this.chart.scales[W].getPixelForValue(y))}V=k-x,S=V-h,B=o.left,C=o.right}const $=Pe(a.ticks.maxTicksLimit,f),U=Math.max(1,Math.ceil(f/$));for(w=0;w<f;w+=U){const W=this.getContext(w),y=s.setContext(W),D=l.setContext(W),T=y.lineWidth,N=y.color,O=D.dash||[],G=D.dashOffset,R=y.tickWidth,z=y.tickColor,q=y.tickBorderDash||[],Y=y.tickBorderDashOffset;E=S1(this,w,c),E!==void 0&&(v=qo(r,E,T),d?V=S=B=C=v:A=P=M=F=v,m.push({tx1:V,ty1:A,tx2:S,ty2:P,x1:B,y1:M,x2:C,y2:F,width:T,color:N,borderDash:O,borderDashOffset:G,tickWidth:R,tickColor:z,tickBorderDash:q,tickBorderDashOffset:Y}))}return this._ticksLength=f,this._borderValue=k,m}_computeLabelItems(o){const n=this.axis,r=this.options,{position:a,ticks:s}=r,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,h=cr(r.grid),m=h+u,p=f?-u:m,b=-ro(this.labelRotation),x=[];let g,k,w,E,v,V,A,S,P,B,M,C,F="middle";if(a==="top")V=this.bottom-p,A=this._getXAxisLabelAlignment();else if(a==="bottom")V=this.top+p,A=this._getXAxisLabelAlignment();else if(a==="left"){const U=this._getYAxisLabelAlignment(h);A=U.textAlign,v=U.x}else if(a==="right"){const U=this._getYAxisLabelAlignment(h);A=U.textAlign,v=U.x}else if(n==="x"){if(a==="center")V=(o.top+o.bottom)/2+m;else if(Re(a)){const U=Object.keys(a)[0],W=a[U];V=this.chart.scales[U].getPixelForValue(W)+m}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(a==="center")v=(o.left+o.right)/2-m;else if(Re(a)){const U=Object.keys(a)[0],W=a[U];v=this.chart.scales[U].getPixelForValue(W)}A=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(c==="start"?F="top":c==="end"&&(F="bottom"));const $=this._getLabelSizes();for(g=0,k=l.length;g<k;++g){w=l[g],E=w.label;const U=s.setContext(this.getContext(g));S=this.getPixelForTick(g)+s.labelOffset,P=this._resolveTickFontOptions(g),B=P.lineHeight,M=nt(E)?E.length:1;const W=M/2,y=U.color,D=U.textStrokeColor,T=U.textStrokeWidth;let N=A;i?(v=S,A==="inner"&&(g===k-1?N=this.options.reverse?"left":"right":g===0?N=this.options.reverse?"right":"left":N="center"),a==="top"?d==="near"||b!==0?C=-M*B+B/2:d==="center"?C=-$.highest.height/2-W*B+B:C=-$.highest.height+B/2:d==="near"||b!==0?C=B/2:d==="center"?C=$.highest.height/2-W*B:C=$.highest.height-M*B,f&&(C*=-1),b!==0&&!U.showLabelBackdrop&&(v+=B/2*Math.sin(b))):(V=S,C=(1-M)*B/2);let O;if(U.showLabelBackdrop){const G=Vt(U.backdropPadding),R=$.heights[g],z=$.widths[g];let q=C-G.top,Y=0-G.left;switch(F){case"middle":q-=R/2;break;case"bottom":q-=R;break}switch(A){case"center":Y-=z/2;break;case"right":Y-=z;break;case"inner":g===k-1?Y-=z:g>0&&(Y-=z/2);break}O={left:Y,top:q,width:z+G.width,height:R+G.height,color:U.backdropColor}}x.push({label:E,font:P,textOffset:C,options:{rotation:b,color:y,strokeColor:D,strokeWidth:T,textAlign:N,textBaseline:F,translation:[v,V],backdrop:O}})}return x}_getXAxisLabelAlignment(){const{position:o,ticks:n}=this.options;if(-ro(this.labelRotation))return o==="top"?"left":"right";let a="center";return n.align==="start"?a="left":n.align==="end"?a="right":n.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(o){const{position:n,ticks:{crossAlign:r,mirror:a,padding:s}}=this.options,i=this._getLabelSizes(),l=o+s,c=i.widest.width;let d,u;return n==="left"?a?(u=this.right+s,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u=this.left)):n==="right"?a?(u=this.left+s,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const o=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:o.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:o.width}}drawBackground(){const{ctx:o,options:{backgroundColor:n},left:r,top:a,width:s,height:i}=this;n&&(o.save(),o.fillStyle=n,o.fillRect(r,a,s,i),o.restore())}getLineWidthForValue(o){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const a=this.ticks.findIndex(s=>s.value===o);return a>=0?n.setContext(this.getContext(a)).lineWidth:0}drawGrid(o){const n=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(o));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(n.display)for(s=0,i=a.length;s<i;++s){const c=a[s];n.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:o,ctx:n,options:{border:r,grid:a}}=this,s=r.setContext(this.getContext()),i=r.display?s.width:0;if(!i)return;const l=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=qo(o,this.left,i)-i/2,u=qo(o,this.right,l)+l/2,f=h=c):(f=qo(o,this.top,i)-i/2,h=qo(o,this.bottom,l)+l/2,d=u=c),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(d,f),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(o){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&la(r,a);const s=this.getLabelItems(o);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;nr(r,d,0,u,c,l)}a&&ca(r)}drawTitle(){const{ctx:o,options:{position:n,title:r,reverse:a}}=this;if(!r.display)return;const s=mt(r.font),i=Vt(r.padding),l=r.align;let c=s.lineHeight/2;n==="bottom"||n==="center"||Re(n)?(c+=i.bottom,nt(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=v1(this,c,n,l);nr(o,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:h,textAlign:A1(l,n,a),textBaseline:"middle",translation:[d,u]})}draw(o){this._isVisible()&&(this.drawBackground(),this.drawGrid(o),this.drawBorder(),this.drawTitle(),this.drawLabels(o))}_layers(){const o=this.options,n=o.ticks&&o.ticks.z||0,r=Pe(o.grid&&o.grid.z,-1),a=Pe(o.border&&o.border.z,0);return!this._isVisible()||this.draw!==En.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(o){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let s,i;for(s=0,i=n.length;s<i;++s){const l=n[s];l[r]===this.id&&(!o||l.type===o)&&a.push(l)}return a}_resolveTickFontOptions(o){const n=this.options.ticks.setContext(this.getContext(o));return mt(n.font)}_maxDigits(){const o=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/o}}class Ea{constructor(o,n,r){this.type=o,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(o){return Object.prototype.isPrototypeOf.call(this.type.prototype,o.prototype)}register(o){const n=Object.getPrototypeOf(o);let r;M1(n)&&(r=this.register(n));const a=this.items,s=o.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+o);return s in a||(a[s]=o,N1(o,i,r),this.override&&tt.override(o.id,o.overrides)),i}get(o){return this.items[o]}unregister(o){const n=this.items,r=o.id,a=this.scope;r in n&&delete n[r],a&&r in tt[a]&&(delete tt[a][r],this.override&&delete Go[r])}}function N1(t,o,n){const r=Kn(Object.create(null),[n?tt.get(n):{},tt.get(o),t.defaults]);tt.set(o,r),t.defaultRoutes&&V1(o,t.defaultRoutes),t.descriptors&&tt.describe(o,t.descriptors)}function V1(t,o){Object.keys(o).forEach(n=>{const r=n.split("."),a=r.pop(),s=[t].concat(r).join("."),i=o[n].split("."),l=i.pop(),c=i.join(".");tt.route(s,a,c,l)})}function M1(t){return"id"in t&&"defaults"in t}class T1{constructor(){this.controllers=new Ea(Qo,"datasets",!0),this.elements=new Ea(io,"elements"),this.plugins=new Ea(Object,"plugins"),this.scales=new Ea(En,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...o){this._each("register",o)}remove(...o){this._each("unregister",o)}addControllers(...o){this._each("register",o,this.controllers)}addElements(...o){this._each("register",o,this.elements)}addPlugins(...o){this._each("register",o,this.plugins)}addScales(...o){this._each("register",o,this.scales)}getController(o){return this._get(o,this.controllers,"controller")}getElement(o){return this._get(o,this.elements,"element")}getPlugin(o){return this._get(o,this.plugins,"plugin")}getScale(o){return this._get(o,this.scales,"scale")}removeControllers(...o){this._each("unregister",o,this.controllers)}removeElements(...o){this._each("unregister",o,this.elements)}removePlugins(...o){this._each("unregister",o,this.plugins)}removeScales(...o){this._each("unregister",o,this.scales)}_each(o,n,r){[...n].forEach(a=>{const s=r||this._getRegistryForType(a);r||s.isForType(a)||s===this.plugins&&a.id?this._exec(o,s,a):We(a,i=>{const l=r||this._getRegistryForType(i);this._exec(o,l,i)})})}_exec(o,n,r){const a=Qs(o);Je(r["before"+a],[],r),n[o](r),Je(r["after"+a],[],r)}_getRegistryForType(o){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(o))return r}return this.plugins}_get(o,n,r){const a=n.get(o);if(a===void 0)throw new Error('"'+o+'" is not a registered '+r+".");return a}}var Wt=new T1;class P1{constructor(){this._init=void 0}notify(o,n,r,a){if(n==="beforeInit"&&(this._init=this._createDescriptors(o,!0),this._notify(this._init,o,"install")),this._init===void 0)return;const s=a?this._descriptors(o).filter(a):this._descriptors(o),i=this._notify(s,o,n,r);return n==="afterDestroy"&&(this._notify(s,o,"stop"),this._notify(this._init,o,"uninstall"),this._init=void 0),i}_notify(o,n,r,a){a=a||{};for(const s of o){const i=s.plugin,l=i[r],c=[n,a,s.options];if(Je(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){je(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(o){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(o);return this._notifyStateChanges(o),n}_createDescriptors(o,n){const r=o&&o.config,a=Pe(r.options&&r.options.plugins,{}),s=O1(r);return a===!1&&!n?[]:R1(o,s,a,n)}_notifyStateChanges(o){const n=this._oldCache||[],r=this._cache,a=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(a(n,r),o,"stop"),this._notify(a(r,n),o,"start")}}function O1(t){const o={},n=[],r=Object.keys(Wt.plugins.items);for(let s=0;s<r.length;s++)n.push(Wt.getPlugin(r[s]));const a=t.plugins||[];for(let s=0;s<a.length;s++){const i=a[s];n.indexOf(i)===-1&&(n.push(i),o[i.id]=!0)}return{plugins:n,localIds:o}}function F1(t,o){return!o&&t===!1?null:t===!0?{}:t}function R1(t,{plugins:o,localIds:n},r,a){const s=[],i=t.getContext();for(const l of o){const c=l.id,d=F1(r[c],a);d!==null&&s.push({plugin:l,options:L1(t.config,{plugin:l,local:n[c]},d,i)})}return s}function L1(t,{plugin:o,local:n},r,a){const s=t.pluginScopeKeys(o),i=t.getOptionScopes(r,s);return n&&o.defaults&&i.push(o.defaults),t.createResolver(i,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ei(t,o){const n=tt.datasets[t]||{};return((o.datasets||{})[t]||{}).indexAxis||o.indexAxis||n.indexAxis||"x"}function $1(t,o){let n=t;return t==="_index_"?n=o:t==="_value_"&&(n=o==="x"?"y":"x"),n}function I1(t,o){return t===o?"_index_":"_value_"}function Nu(t){if(t==="x"||t==="y"||t==="r")return t}function z1(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Si(t,...o){if(Nu(t))return t;for(const n of o){const r=n.axis||z1(n.position)||t.length>1&&Nu(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Vu(t,o,n){if(n[o+"AxisID"]===t)return{axis:o}}function j1(t,o){if(o.data&&o.data.datasets){const n=o.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(n.length)return Vu(t,"x",n[0])||Vu(t,"y",n[0])}return{}}function U1(t,o){const n=Go[t.type]||{scales:{}},r=o.scales||{},a=Ei(t.type,o),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!Re(l))return console.error(`Invalid scale configuration for scale: ${i}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=Si(i,l,j1(i,t),tt.scales[l.type]),d=I1(c,a),u=n.scales||{};s[i]=Xn(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||Ei(l,o),u=(Go[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=$1(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),Xn(s[m],[{axis:h},r[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];Xn(l,[tt.scales[l.type],tt.scale])}),s}function Mu(t){const o=t.options||(t.options={});o.plugins=Pe(o.plugins,{}),o.scales=U1(t,o)}function Tu(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function W1(t){return t=t||{},t.data=Tu(t.data),Mu(t),t}const Pu=new Map,Ou=new Set;function Sa(t,o){let n=Pu.get(t);return n||(n=o(),Pu.set(t,n),Ou.add(n)),n}const dr=(t,o,n)=>{const r=Uo(o,n);r!==void 0&&t.add(r)};class H1{constructor(o){this._config=W1(o),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(o){this._config.type=o}get data(){return this._config.data}set data(o){this._config.data=Tu(o)}get options(){return this._config.options}set options(o){this._config.options=o}get plugins(){return this._config.plugins}update(){const o=this._config;this.clearCache(),Mu(o)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(o){return Sa(o,()=>[[`datasets.${o}`,""]])}datasetAnimationScopeKeys(o,n){return Sa(`${o}.transition.${n}`,()=>[[`datasets.${o}.transitions.${n}`,`transitions.${n}`],[`datasets.${o}`,""]])}datasetElementScopeKeys(o,n){return Sa(`${o}-${n}`,()=>[[`datasets.${o}.elements.${n}`,`datasets.${o}`,`elements.${n}`,""]])}pluginScopeKeys(o){const n=o.id,r=this.type;return Sa(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...o.additionalOptionScopes||[]]])}_cachedScopes(o,n){const r=this._scopeCache;let a=r.get(o);return(!a||n)&&(a=new Map,r.set(o,a)),a}getOptionScopes(o,n,r){const{options:a,type:s}=this,i=this._cachedScopes(o,r),l=i.get(n);if(l)return l;const c=new Set;n.forEach(u=>{o&&(c.add(o),u.forEach(f=>dr(c,o,f))),u.forEach(f=>dr(c,a,f)),u.forEach(f=>dr(c,Go[s]||{},f)),u.forEach(f=>dr(c,tt,f)),u.forEach(f=>dr(c,ai,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Ou.has(n)&&i.set(n,d),d}chartOptionScopes(){const{options:o,type:n}=this;return[o,Go[n]||{},tt.datasets[n]||{},{type:n},tt,ai]}resolveNamedOptions(o,n,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=Fu(this._resolverCache,o,a);let c=i;if(q1(i,n)){s.$shared=!1,r=_o(r)?r():r;const d=this.createResolver(o,r,l);c=kn(i,r,d)}for(const d of n)s[d]=c[d];return s}createResolver(o,n,r=[""],a){const{resolver:s}=Fu(this._resolverCache,o,r);return Re(n)?kn(s,n,void 0,a):s}}function Fu(t,o,n){let r=t.get(o);r||(r=new Map,t.set(o,r));const a=n.join();let s=r.get(a);return s||(s={resolver:ci(o,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const G1=t=>Re(t)&&Object.getOwnPropertyNames(t).some(o=>_o(t[o]));function q1(t,o){const{isScriptable:n,isIndexable:r}=$d(t);for(const a of o){const s=n(a),i=r(a),l=(i||s)&&t[a];if(s&&(_o(l)||G1(l))||i&&nt(l))return!0}return!1}var K1="4.5.1";const X1=["top","bottom","left","right","chartArea"];function Ru(t,o){return t==="top"||t==="bottom"||X1.indexOf(t)===-1&&o==="x"}function Lu(t,o){return function(n,r){return n[t]===r[t]?n[o]-r[o]:n[t]-r[t]}}function $u(t){const o=t.chart,n=o.options.animation;o.notifyPlugins("afterRender"),Je(n&&n.onComplete,[t],o)}function Y1(t){const o=t.chart,n=o.options.animation;Je(n&&n.onProgress,[t],o)}function Iu(t){return fi()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const _a={},zu=t=>{const o=Iu(t);return Object.values(_a).filter(n=>n.canvas===o).pop()};function J1(t,o,n){const r=Object.keys(t);for(const a of r){const s=+a;if(s>=o){const i=t[a];delete t[a],(n>0||s>o)&&(t[s+n]=i)}}}function Q1(t,o,n,r){return!n||t.type==="mouseout"?null:r?o:t}class lo{static register(...o){Wt.add(...o),ju()}static unregister(...o){Wt.remove(...o),ju()}constructor(o,n){const r=this.config=new H1(n),a=Iu(o),s=zu(a);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||g1(a)),this.platform.updateConfig(r);const l=this.platform.acquireContext(a,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Yy(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new P1,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=pk(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],_a[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}so.listen(this,"complete",$u),so.listen(this,"progress",Y1),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:o,maintainAspectRatio:n},width:r,height:a,_aspectRatio:s}=this;return je(o)?n&&s?s:a?r/a:null:o}get data(){return this.config.data}set data(o){this.config.data=o}get options(){return this._options}set options(o){this.config.options=o}get registry(){return Wt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Gd(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Fd(this.canvas,this.ctx),this}stop(){return so.stop(this),this}resize(o,n){so.running(this)?this._resizeBeforeDraw={width:o,height:n}:this._resize(o,n)}_resize(o,n){const r=this.options,a=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(a,o,n,s),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Gd(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),Je(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};We(n,(r,a)=>{r.id=a})}buildOrUpdateScales(){const o=this.options,n=o.scales,r=this.scales,a=Object.keys(r).reduce((i,l)=>(i[l]=!1,i),{});let s=[];n&&(s=s.concat(Object.keys(n).map(i=>{const l=n[i],c=Si(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),We(s,i=>{const l=i.options,c=l.id,d=Si(c,l),u=Pe(l.type,i.dtype);(l.position===void 0||Ru(l.position,d)!==Ru(i.dposition))&&(l.position=i.dposition),a[c]=!0;let f=null;if(c in r&&r[c].type===u)f=r[c];else{const h=Wt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(l,o)}),We(a,(i,l)=>{i||delete r[l]}),We(r,i=>{Mt.configure(this,i,i.options),Mt.addBox(this,i)})}_updateMetasets(){const o=this._metasets,n=this.data.datasets.length,r=o.length;if(o.sort((a,s)=>a.index-s.index),r>n){for(let a=n;a<r;++a)this._destroyDatasetMeta(a);o.splice(n,r-n)}this._sortedMetasets=o.slice(0).sort(Lu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:o,data:{datasets:n}}=this;o.length>n.length&&delete this._stacks,o.forEach((r,a)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const o=[],n=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=n.length;r<a;r++){const s=n[r];let i=this.getDatasetMeta(r);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=l,i.indexAxis=s.indexAxis||Ei(l,this.options),i.order=s.order||0,i.index=r,i.label=""+s.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=Wt.getController(l),{datasetElementType:d,dataElementType:u}=tt.datasets[l];Object.assign(c,{dataElementType:Wt.getElement(u),datasetElementType:d&&Wt.getElement(d)}),i.controller=new c(this,r),o.push(i.controller)}}return this._updateMetasets(),o}_resetElements(){We(this.data.datasets,(o,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(o){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:o,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),h=!a&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||We(s,d=>{d.reset()}),this._updateDatasets(o),this.notifyPlugins("afterUpdate",{mode:o}),this._layers.sort(Lu("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){We(this.scales,o=>{Mt.removeBox(this,o)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const o=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(o.events);(!kd(n,r)||!!this._responsiveListeners!==o.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:o}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:s}of n){const i=r==="_removeElements"?-s:s;J1(o,a,i)}}_getUniformDataChanges(){const o=this._dataChanges;if(!o||!o.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(o.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),a=r(0);for(let s=1;s<n;s++)if(!kd(a,r(s)))return;return Array.from(a).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(o){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Mt.update(this,this.width,this.height,o);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],We(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,s)=>{a._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(o){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:o,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,_o(o)?o({datasetIndex:n}):o);this.notifyPlugins("afterDatasetsUpdate",{mode:o})}}_updateDataset(o,n){const r=this.getDatasetMeta(o),a={meta:r,index:o,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(n),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(so.has(this)?this.attached&&!so.running(this)&&so.start(this):(this.draw(),$u({chart:this})))}draw(){let o;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,a)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(o=0;o<n.length&&n[o].z<=0;++o)n[o].draw(this.chartArea);for(this._drawDatasets();o<n.length;++o)n[o].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(o){const n=this._sortedMetasets,r=[];let a,s;for(a=0,s=n.length;a<s;++a){const i=n[a];(!o||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const o=this.getSortedVisibleDatasetMetas();for(let n=o.length-1;n>=0;--n)this._drawDataset(o[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(o){const n=this.ctx,r={meta:o,index:o.index,cancelable:!0},a=ou(this,o);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&la(n,a),o.controller.draw(),a&&ca(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(o){return or(o,this.chartArea,this._minPadding)}getElementsAtEventForMode(o,n,r,a){const s=Xx.modes[n];return typeof s=="function"?s(this,o,r,a):[]}getDatasetMeta(o){const n=this.data.datasets[o],r=this._metasets;let a=r.filter(s=>s&&s._dataset===n).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:o,_dataset:n,_parsed:[],_sorted:!1},r.push(a)),a}getContext(){return this.$context||(this.$context=Ko(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(o){const n=this.data.datasets[o];if(!n)return!1;const r=this.getDatasetMeta(o);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(o,n){const r=this.getDatasetMeta(o);r.hidden=!n}toggleDataVisibility(o){this._hiddenIndices[o]=!this._hiddenIndices[o]}getDataVisibility(o){return!this._hiddenIndices[o]}_updateVisibility(o,n,r){const a=r?"show":"hide",s=this.getDatasetMeta(o),i=s.controller._resolveAnimations(void 0,a);Yn(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(o,r),i.update(s,{visible:r}),this.update(l=>l.datasetIndex===o?a:void 0))}hide(o,n){this._updateVisibility(o,n,!1)}show(o,n){this._updateVisibility(o,n,!0)}_destroyDatasetMeta(o){const n=this._metasets[o];n&&n.controller&&n.controller._destroy(),delete this._metasets[o]}_stop(){let o,n;for(this.stop(),so.remove(this),o=0,n=this.data.datasets.length;o<n;++o)this._destroyDatasetMeta(o)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:o,ctx:n}=this;this._stop(),this.config.clearCache(),o&&(this.unbindEvents(),Fd(o,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete _a[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...o){return this.canvas.toDataURL(...o)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const o=this._listeners,n=this.platform,r=(s,i)=>{n.addEventListener(this,s,i),o[s]=i},a=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};We(this.options.events,s=>r(s,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const o=this._responsiveListeners,n=this.platform,r=(c,d)=>{n.addEventListener(this,c,d),o[c]=d},a=(c,d)=>{o[c]&&(n.removeEventListener(this,c,d),delete o[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{a("attach",l),this.attached=!0,this.resize(),r("resize",s),r("detach",i)};i=()=>{this.attached=!1,a("resize",s),this._stop(),this._resize(0,0),r("attach",l)},n.isAttached(this.canvas)?l():i()}unbindEvents(){We(this._listeners,(o,n)=>{this.platform.removeEventListener(this,n,o)}),this._listeners={},We(this._responsiveListeners,(o,n)=>{this.platform.removeEventListener(this,n,o)}),this._responsiveListeners=void 0}updateHoverStyle(o,n,r){const a=r?"set":"remove";let s,i,l,c;for(n==="dataset"&&(s=this.getDatasetMeta(o[0].datasetIndex),s.controller["_"+a+"DatasetHoverStyle"]()),l=0,c=o.length;l<c;++l){i=o[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[a+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(o){const n=this._active||[],r=o.map(({datasetIndex:s,index:i})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[i],index:i}});!ra(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(o,n,r){return this._plugins.notify(this,o,n,r)}isPluginEnabled(o){return this._plugins._cache.filter(n=>n.plugin.id===o).length===1}_updateHoverStyles(o,n,r){const a=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),i=s(n,o),l=r?o:s(o,n);i.length&&this.updateHoverStyle(i,a.mode,!1),l.length&&a.mode&&this.updateHoverStyle(l,a.mode,!0)}_eventHandler(o,n){const r={event:o,replay:n,cancelable:!0,inChartArea:this.isPointInArea(o)},a=i=>(i.options.events||this.options.events).includes(o.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const s=this._handleEvent(o,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(s||r.changed)&&this.render(),this}_handleEvent(o,n,r){const{_active:a=[],options:s}=this,i=n,l=this._getActiveElements(o,a,r,i),c=ok(o),d=Q1(o,this._lastEvent,r,c);r&&(this._lastEvent=null,Je(s.onHover,[o,l,this],this),c&&Je(s.onClick,[o,l,this],this));const u=!ra(l,a);return(u||n)&&(this._active=l,this._updateHoverStyles(l,a,n)),this._lastEvent=d,u}_getActiveElements(o,n,r,a){if(o.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(o,s.mode,s,a)}}Ae(lo,"defaults",tt),Ae(lo,"instances",_a),Ae(lo,"overrides",Go),Ae(lo,"registry",Wt),Ae(lo,"version",K1),Ae(lo,"getChart",zu);function ju(){return We(lo.instances,t=>t._plugins.invalidate())}function Z1(t,o,n){const{startAngle:r,x:a,y:s,outerRadius:i,innerRadius:l,options:c}=o,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,Bt(r-n));if(t.beginPath(),t.arc(a,s,i-d/2,r+f/2,n-f/2),l>0){const h=Math.min(d/l,Bt(r-n));t.arc(a,s,l+d/2,n-h/2,r+h/2,!0)}else{const h=Math.min(d/2,i*Bt(r-n));if(u==="round")t.arc(a,s,h,n-He/2,r+He/2,!0);else if(u==="bevel"){const m=2*h*h,p=-m*Math.cos(n+He/2)+a,b=-m*Math.sin(n+He/2)+s,x=m*Math.cos(r+He/2)+a,g=m*Math.sin(r+He/2)+s;t.lineTo(p,b),t.lineTo(x,g)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function ew(t,o,n){const{startAngle:r,pixelMargin:a,x:s,y:i,outerRadius:l,innerRadius:c}=o;let d=a/l;t.beginPath(),t.arc(s,i,l,r-d,n+d),c>a?(d=a/c,t.arc(s,i,c,n+d,r-d,!0)):t.arc(s,i,a,n+st,r-st),t.closePath(),t.clip()}function tw(t){return li(t,["outerStart","outerEnd","innerStart","innerEnd"])}function ow(t,o,n,r){const a=tw(t.options.borderRadius),s=(n-o)/2,i=Math.min(s,r*o/2),l=c=>{const d=(n-Math.min(s,c))*r/2;return ft(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:ft(a.innerStart,0,i),innerEnd:ft(a.innerEnd,0,i)}}function Sn(t,o,n,r){return{x:n+t*Math.cos(o),y:r+t*Math.sin(o)}}function Ba(t,o,n,r,a,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=o,f=Math.max(o.outerRadius+r+n-d,0),h=u>0?u+r+n+d:0;let m=0;const p=a-c;if(r){const U=u>0?u-r:0,W=f>0?f-r:0,y=(U+W)/2,D=y!==0?p*y/(y+r):p;m=(p-D)/2}const b=Math.max(.001,p*f-n/He)/f,x=(p-b)/2,g=c+x+m,k=a-x-m,{outerStart:w,outerEnd:E,innerStart:v,innerEnd:V}=ow(o,h,f,k-g),A=f-w,S=f-E,P=g+w/A,B=k-E/S,M=h+v,C=h+V,F=g+v/M,$=k-V/C;if(t.beginPath(),s){const U=(P+B)/2;if(t.arc(i,l,f,P,U),t.arc(i,l,f,U,B),E>0){const T=Sn(S,B,i,l);t.arc(T.x,T.y,E,B,k+st)}const W=Sn(C,k,i,l);if(t.lineTo(W.x,W.y),V>0){const T=Sn(C,$,i,l);t.arc(T.x,T.y,V,k+st,$+Math.PI)}const y=(k-V/h+(g+v/h))/2;if(t.arc(i,l,h,k-V/h,y,!0),t.arc(i,l,h,y,g+v/h,!0),v>0){const T=Sn(M,F,i,l);t.arc(T.x,T.y,v,F+Math.PI,g-st)}const D=Sn(A,g,i,l);if(t.lineTo(D.x,D.y),w>0){const T=Sn(A,P,i,l);t.arc(T.x,T.y,w,g-st,P)}}else{t.moveTo(i,l);const U=Math.cos(P)*f+i,W=Math.sin(P)*f+l;t.lineTo(U,W);const y=Math.cos(B)*f+i,D=Math.sin(B)*f+l;t.lineTo(y,D)}t.closePath()}function nw(t,o,n,r,a){const{fullCircles:s,startAngle:i,circumference:l}=o;let c=o.endAngle;if(s){Ba(t,o,n,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%Ze||Ze))}return Ba(t,o,n,r,c,a),t.fill(),c}function rw(t,o,n,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=o,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,p=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=h,p?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let b=o.endAngle;if(s){Ba(t,o,n,r,b,a);for(let x=0;x<s;++x)t.stroke();isNaN(l)||(b=i+(l%Ze||Ze))}p&&ew(t,o,b),c.selfJoin&&b-i>=He&&m===0&&u!=="miter"&&Z1(t,o,b),s||(Ba(t,o,n,r,b,a),t.stroke())}class ur extends io{constructor(n){super();Ae(this,"circumference");Ae(this,"endAngle");Ae(this,"fullCircles");Ae(this,"innerRadius");Ae(this,"outerRadius");Ae(this,"pixelMargin");Ae(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,a){const s=this.getProps(["x","y"],a),{angle:i,distance:l}=Sd(s,{x:n,y:r}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),m=(this.options.spacing+this.options.borderWidth)/2,p=Pe(h,d-c),b=Zn(i,c,d)&&c!==d,x=p>=Ze||b,g=ao(l,u+m,f+m);return x&&g}getCenterPoint(n){const{x:r,y:a,startAngle:s,endAngle:i,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:d,spacing:u}=this.options,f=(s+i)/2,h=(l+c+u+d)/2;return{x:r+Math.cos(f)*h,y:a+Math.sin(f)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:a}=this,s=(r.offset||0)/4,i=(r.spacing||0)/2,l=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>Ze?Math.floor(a/Ze):0,a===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(He,a||0)),u=s*d;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,nw(n,this,u,i,l),rw(n,this,u,i,l),n.restore()}}Ae(ur,"id","arc"),Ae(ur,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),Ae(ur,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ae(ur,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Uu(t,o,n=o){t.lineCap=Pe(n.borderCapStyle,o.borderCapStyle),t.setLineDash(Pe(n.borderDash,o.borderDash)),t.lineDashOffset=Pe(n.borderDashOffset,o.borderDashOffset),t.lineJoin=Pe(n.borderJoinStyle,o.borderJoinStyle),t.lineWidth=Pe(n.borderWidth,o.borderWidth),t.strokeStyle=Pe(n.borderColor,o.borderColor)}function aw(t,o,n){t.lineTo(n.x,n.y)}function sw(t){return t.stepped?vk:t.tension||t.cubicInterpolationMode==="monotone"?Nk:aw}function Wu(t,o,n={}){const r=t.length,{start:a=0,end:s=r-1}=n,{start:i,end:l}=o,c=Math.max(a,i),d=Math.min(s,l),u=a<i&&s<i||a>l&&s>l;return{count:r,start:c,loop:o.loop,ilen:d<c&&!u?r+d-c:d-c}}function iw(t,o,n,r){const{points:a,options:s}=o,{count:i,start:l,loop:c,ilen:d}=Wu(a,n,r),u=sw(s);let{move:f=!0,reverse:h}=r||{},m,p,b;for(m=0;m<=d;++m)p=a[(l+(h?d-m:m))%i],!p.skip&&(f?(t.moveTo(p.x,p.y),f=!1):u(t,b,p,h,s.stepped),b=p);return c&&(p=a[(l+(h?d:0))%i],u(t,b,p,h,s.stepped)),!!c}function lw(t,o,n,r){const a=o.points,{count:s,start:i,ilen:l}=Wu(a,n,r),{move:c=!0,reverse:d}=r||{};let u=0,f=0,h,m,p,b,x,g;const k=E=>(i+(d?l-E:E))%s,w=()=>{b!==x&&(t.lineTo(u,x),t.lineTo(u,b),t.lineTo(u,g))};for(c&&(m=a[k(0)],t.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=a[k(h)],m.skip)continue;const E=m.x,v=m.y,V=E|0;V===p?(v<b?b=v:v>x&&(x=v),u=(f*u+E)/++f):(w(),t.lineTo(E,v),p=V,f=0,b=x=v),g=v}w()}function _i(t){const o=t.options,n=o.borderDash&&o.borderDash.length;return!t._decimated&&!t._loop&&!o.tension&&o.cubicInterpolationMode!=="monotone"&&!o.stepped&&!n?lw:iw}function cw(t){return t.stepped?lx:t.tension||t.cubicInterpolationMode==="monotone"?cx:Jo}function dw(t,o,n,r){let a=o._path;a||(a=o._path=new Path2D,o.path(a,n,r)&&a.closePath()),Uu(t,o.options),t.stroke(a)}function uw(t,o,n,r){const{segments:a,options:s}=o,i=_i(o);for(const l of a)Uu(t,s,l.style),t.beginPath(),i(t,o,l,{start:n,end:n+r-1})&&t.closePath(),t.stroke()}const fw=typeof Path2D=="function";function hw(t,o,n,r){fw&&!o.options.segment?dw(t,o,n,r):uw(t,o,n,r)}class Do extends io{constructor(o){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,o&&Object.assign(this,o)}updateControlPoints(o,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;ex(this._points,r,o,a,n),this._pointsUpdated=!0}}set points(o){this._points=o,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=px(this,this.options.segment))}first(){const o=this.segments,n=this.points;return o.length&&n[o[0].start]}last(){const o=this.segments,n=this.points,r=o.length;return r&&n[o[r-1].end]}interpolate(o,n){const r=this.options,a=o[n],s=this.points,i=Zd(this,{property:n,start:a,end:a});if(!i.length)return;const l=[],c=cw(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],p=s[h];if(m===p){l.push(m);continue}const b=Math.abs((a-m[n])/(p[n]-m[n])),x=c(m,p,b,r.stepped);x[n]=o[n],l.push(x)}return l.length===1?l[0]:l}pathSegment(o,n,r){return _i(this)(o,this,n,r)}path(o,n,r){const a=this.segments,s=_i(this);let i=this._loop;n=n||0,r=r||this.points.length-n;for(const l of a)i&=s(o,this,l,{start:n,end:n+r-1});return!!i}draw(o,n,r,a){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(o.save(),hw(o,this,r,a),o.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ae(Do,"id","line"),Ae(Do,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ae(Do,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ae(Do,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"&&o!=="fill"});function Hu(t,o,n,r){const a=t.options,{[n]:s}=t.getProps([n],r);return Math.abs(o-s)<a.radius+a.hitRadius}class Da extends io{constructor(n){super();Ae(this,"parsed");Ae(this,"skip");Ae(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,a){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],a);return Math.pow(n-i,2)+Math.pow(r-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return Hu(this,n,"x",r)}inYRange(n,r){return Hu(this,n,"y",r)}getCenterPoint(n){const{x:r,y:a}=this.getProps(["x","y"],n);return{x:r,y:a}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const a=r&&n.borderWidth||0;return(r+a)*2}draw(n,r){const a=this.options;this.skip||a.radius<.1||!or(this,r,this.size(a)/2)||(n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.fillStyle=a.backgroundColor,ii(n,a,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ae(Da,"id","point"),Ae(Da,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ae(Da,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Gu(t,o){const{x:n,y:r,base:a,width:s,height:i}=t.getProps(["x","y","base","width","height"],o);let l,c,d,u,f;return t.horizontal?(f=i/2,l=Math.min(n,a),c=Math.max(n,a),d=r-f,u=r+f):(f=s/2,l=n-f,c=n+f,d=Math.min(r,a),u=Math.max(r,a)),{left:l,top:d,right:c,bottom:u}}function Ao(t,o,n,r){return t?0:ft(o,n,r)}function mw(t,o,n){const r=t.options.borderWidth,a=t.borderSkipped,s=Ld(r);return{t:Ao(a.top,s.top,0,n),r:Ao(a.right,s.right,0,o),b:Ao(a.bottom,s.bottom,0,n),l:Ao(a.left,s.left,0,o)}}function pw(t,o,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=yn(a),i=Math.min(o,n),l=t.borderSkipped,c=r||Re(a);return{topLeft:Ao(!c||l.top||l.left,s.topLeft,0,i),topRight:Ao(!c||l.top||l.right,s.topRight,0,i),bottomLeft:Ao(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:Ao(!c||l.bottom||l.right,s.bottomRight,0,i)}}function gw(t){const o=Gu(t),n=o.right-o.left,r=o.bottom-o.top,a=mw(t,n/2,r/2),s=pw(t,n/2,r/2);return{outer:{x:o.left,y:o.top,w:n,h:r,radius:s},inner:{x:o.left+a.l,y:o.top+a.t,w:n-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function Bi(t,o,n,r){const a=o===null,s=n===null,l=t&&!(a&&s)&&Gu(t,r);return l&&(a||ao(o,l.left,l.right))&&(s||ao(n,l.top,l.bottom))}function bw(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function yw(t,o){t.rect(o.x,o.y,o.w,o.h)}function Di(t,o,n={}){const r=t.x!==n.x?-o:0,a=t.y!==n.y?-o:0,s=(t.x+t.w!==n.x+n.w?o:0)-r,i=(t.y+t.h!==n.y+n.h?o:0)-a;return{x:t.x+r,y:t.y+a,w:t.w+s,h:t.h+i,radius:t.radius}}class Aa extends io{constructor(o){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,o&&Object.assign(this,o)}draw(o){const{inflateAmount:n,options:{borderColor:r,backgroundColor:a}}=this,{inner:s,outer:i}=gw(this),l=bw(i.radius)?da:yw;o.save(),(i.w!==s.w||i.h!==s.h)&&(o.beginPath(),l(o,Di(i,n,s)),o.clip(),l(o,Di(s,-n,i)),o.fillStyle=r,o.fill("evenodd")),o.beginPath(),l(o,Di(s,n)),o.fillStyle=a,o.fill(),o.restore()}inRange(o,n,r){return Bi(this,o,n,r)}inXRange(o,n){return Bi(this,o,null,n)}inYRange(o,n){return Bi(this,null,o,n)}getCenterPoint(o){const{x:n,y:r,base:a,horizontal:s}=this.getProps(["x","y","base","horizontal"],o);return{x:s?(n+a)/2:n,y:s?r:(r+a)/2}}getRange(o){return o==="x"?this.width/2:this.height/2}}Ae(Aa,"id","bar"),Ae(Aa,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ae(Aa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function kw(t,o,n){const r=t.segments,a=t.points,s=o.points,i=[];for(const l of r){let{start:c,end:d}=l;d=va(c,d,a);const u=Ai(n,a[c],a[d],l.loop);if(!o.segments){i.push({source:l,target:u,start:a[c],end:a[d]});continue}const f=Zd(o,u);for(const h of f){const m=Ai(n,s[h.start],s[h.end],h.loop),p=Qd(l,a,m);for(const b of p)i.push({source:b,target:h,start:{[n]:qu(u,m,"start",Math.max)},end:{[n]:qu(u,m,"end",Math.min)}})}}return i}function Ai(t,o,n,r){if(r)return;let a=o[t],s=n[t];return t==="angle"&&(a=Bt(a),s=Bt(s)),{property:t,start:a,end:s}}function xw(t,o){const{x:n=null,y:r=null}=t||{},a=o.points,s=[];return o.segments.forEach(({start:i,end:l})=>{l=va(i,l,a);const c=a[i],d=a[l];r!==null?(s.push({x:c.x,y:r}),s.push({x:d.x,y:r})):n!==null&&(s.push({x:n,y:c.y}),s.push({x:n,y:d.y}))}),s}function va(t,o,n){for(;o>t;o--){const r=n[o];if(!isNaN(r.x)&&!isNaN(r.y))break}return o}function qu(t,o,n,r){return t&&o?r(t[n],o[n]):t?t[n]:o?o[n]:0}function Ku(t,o){let n=[],r=!1;return nt(t)?(r=!0,n=t):n=xw(t,o),n.length?new Do({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Xu(t){return t&&t.fill!==!1}function ww(t,o,n){let a=t[o].fill;const s=[o];let i;if(!n)return a;for(;a!==!1&&s.indexOf(a)===-1;){if(!ut(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function Cw(t,o,n){const r=Bw(t);if(Re(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return ut(a)&&Math.floor(a)===a?Ew(r[0],o,a,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Ew(t,o,n,r){return(t==="-"||t==="+")&&(n=o+n),n===o||n<0||n>=r?!1:n}function Sw(t,o){let n=null;return t==="start"?n=o.bottom:t==="end"?n=o.top:Re(t)?n=o.getPixelForValue(t.value):o.getBasePixel&&(n=o.getBasePixel()),n}function _w(t,o,n){let r;return t==="start"?r=n:t==="end"?r=o.options.reverse?o.min:o.max:Re(t)?r=t.value:r=o.getBaseValue(),r}function Bw(t){const o=t.options,n=o.fill;let r=Pe(n&&n.target,n);return r===void 0&&(r=!!o.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Dw(t){const{scale:o,index:n,line:r}=t,a=[],s=r.segments,i=r.points,l=Aw(o,n);l.push(Ku({x:null,y:o.bottom},r));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)vw(a,i[u],l)}return new Do({points:a,options:{}})}function Aw(t,o){const n=[],r=t.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const s=r[a];if(s.index===o)break;s.hidden||n.unshift(s.dataset)}return n}function vw(t,o,n){const r=[];for(let a=0;a<n.length;a++){const s=n[a],{first:i,last:l,point:c}=Nw(s,o,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function Nw(t,o,n){const r=t.interpolate(o,n);if(!r)return{};const a=r[n],s=t.segments,i=t.points;let l=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],f=i[u.start][n],h=i[u.end][n];if(ao(a,f,h)){l=a===f,c=a===h;break}}return{first:l,last:c,point:r}}class Yu{constructor(o){this.x=o.x,this.y=o.y,this.radius=o.radius}pathSegment(o,n,r){const{x:a,y:s,radius:i}=this;return n=n||{start:0,end:Ze},o.arc(a,s,i,n.end,n.start,!0),!r.bounds}interpolate(o){const{x:n,y:r,radius:a}=this,s=o.angle;return{x:n+Math.cos(s)*a,y:r+Math.sin(s)*a,angle:s}}}function Vw(t){const{chart:o,fill:n,line:r}=t;if(ut(n))return Mw(o,n);if(n==="stack")return Dw(t);if(n==="shape")return!0;const a=Tw(t);return a instanceof Yu?a:Ku(a,r)}function Mw(t,o){const n=t.getDatasetMeta(o);return n&&t.isDatasetVisible(o)?n.dataset:null}function Tw(t){return(t.scale||{}).getPointPositionForValue?Ow(t):Pw(t)}function Pw(t){const{scale:o={},fill:n}=t,r=Sw(n,o);if(ut(r)){const a=o.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function Ow(t){const{scale:o,fill:n}=t,r=o.options,a=o.getLabels().length,s=r.reverse?o.max:o.min,i=_w(n,o,s),l=[];if(r.grid.circular){const c=o.getPointPositionForValue(0,s);return new Yu({x:c.x,y:c.y,radius:o.getDistanceFromCenterForValue(i)})}for(let c=0;c<a;++c)l.push(o.getPointPositionForValue(c,i));return l}function vi(t,o,n){const r=Vw(o),{chart:a,index:s,line:i,scale:l,axis:c}=o,d=i.options,u=d.fill,f=d.backgroundColor,{above:h=f,below:m=f}=u||{},p=a.getDatasetMeta(s),b=ou(a,p);r&&i.points.length&&(la(t,n),Fw(t,{line:i,target:r,above:h,below:m,area:n,scale:l,axis:c,clip:b}),ca(t))}function Fw(t,o){const{line:n,target:r,above:a,below:s,area:i,scale:l,clip:c}=o,d=n._loop?"angle":o.axis;t.save();let u=s;s!==a&&(d==="x"?(Ju(t,r,i.top),Ni(t,{line:n,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),Ju(t,r,i.bottom)):d==="y"&&(Qu(t,r,i.left),Ni(t,{line:n,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),Qu(t,r,i.right),u=a)),Ni(t,{line:n,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function Ju(t,o,n){const{segments:r,points:a}=o;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[va(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),i=!!o.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(f.x,n)}t.lineTo(o.first().x,n),t.closePath(),t.clip()}function Qu(t,o,n){const{segments:r,points:a}=o;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[va(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(n,u.y),t.lineTo(u.x,u.y)),i=!!o.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(n,f.y)}t.lineTo(n,o.first().y),t.closePath(),t.clip()}function Ni(t,o){const{line:n,target:r,property:a,color:s,scale:i,clip:l}=o,c=kw(n,r,a);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,p=r!==!0;t.save(),t.fillStyle=m,Rw(t,i,l,p&&Ai(a,f,h)),t.beginPath();const b=!!n.pathSegment(t,d);let x;if(p){b?t.closePath():Zu(t,r,h,a);const g=!!r.pathSegment(t,u,{move:b,reverse:!0});x=b&&g,x||Zu(t,r,f,a)}t.closePath(),t.fill(x?"evenodd":"nonzero"),t.restore()}}function Rw(t,o,n,r){const a=o.chart.chartArea,{property:s,start:i,end:l}=r||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=a.top,u=l,f=a.bottom):(c=a.left,d=i,u=a.right,f=l),t.beginPath(),n&&(c=Math.max(c,n.left),u=Math.min(u,n.right),d=Math.max(d,n.top),f=Math.min(f,n.bottom)),t.rect(c,d,u-c,f-d),t.clip()}}function Zu(t,o,n,r){const a=o.interpolate(n,r);a&&t.lineTo(a.x,a.y)}var Lw={id:"filler",afterDatasetsUpdate(t,o,n){const r=(t.data.datasets||[]).length,a=[];let s,i,l,c;for(i=0;i<r;++i)s=t.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof Do&&(c={visible:t.isDatasetVisible(i),index:i,fill:Cw(l,i,r),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,a.push(c);for(i=0;i<r;++i)c=a[i],!(!c||c.fill===!1)&&(c.fill=ww(a,i,n.propagate))},beforeDraw(t,o,n){const r=n.drawTime==="beforeDraw",a=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let i=a.length-1;i>=0;--i){const l=a[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),r&&l.fill&&vi(t.ctx,l,s))}},beforeDatasetsDraw(t,o,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=t.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const s=r[a].$filler;Xu(s)&&vi(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,o,n){const r=o.meta.$filler;!Xu(r)||n.drawTime!=="beforeDatasetDraw"||vi(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ef=(t,o)=>{let{boxHeight:n=o,boxWidth:r=o}=t;return t.usePointStyle&&(n=Math.min(n,o),r=t.pointStyleWidth||Math.min(r,o)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(o,n)}},$w=(t,o)=>t!==null&&o!==null&&t.datasetIndex===o.datasetIndex&&t.index===o.index;class tf extends io{constructor(o){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=o.chart,this.options=o.options,this.ctx=o.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(o,n,r){this.maxWidth=o,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const o=this.options.labels||{};let n=Je(o.generateLabels,[this.chart],this)||[];o.filter&&(n=n.filter(r=>o.filter(r,this.chart.data))),o.sort&&(n=n.sort((r,a)=>o.sort(r,a,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:o,ctx:n}=this;if(!o.display){this.width=this.height=0;return}const r=o.labels,a=mt(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=ef(r,s);let d,u;n.font=a.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,a,l,c)+10),this.width=Math.min(d,o.maxWidth||this.maxWidth),this.height=Math.min(u,o.maxHeight||this.maxHeight)}_fitRows(o,n,r,a){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=a+l;let f=o;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,b)=>{const x=r+n/2+s.measureText(p.text).width;(b===0||d[d.length-1]+x+2*l>i)&&(f+=u,d[d.length-(b>0?0:1)]=0,m+=u,h++),c[b]={left:0,top:m,row:h,width:x,height:a},d[d.length-1]+=x+l}),f}_fitCols(o,n,r,a){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-o;let f=l,h=0,m=0,p=0,b=0;return this.legendItems.forEach((x,g)=>{const{itemWidth:k,itemHeight:w}=Iw(r,n,s,x,a);g>0&&m+w+2*l>u&&(f+=h+l,d.push({width:h,height:m}),p+=h+l,b++,h=m=0),c[g]={left:p,top:m,col:b,width:k,height:w},h=Math.max(h,k),m+=w+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const o=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:a},rtl:s}}=this,i=wn(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=ht(r,this.left+a,this.right-this.lineWidths[l]);for(const d of n)l!==d.row&&(l=d.row,c=ht(r,this.left+a,this.right-this.lineWidths[l])),d.top+=this.top+o+a,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+a}else{let l=0,c=ht(r,this.top+o+a,this.bottom-this.columnSizes[l].height);for(const d of n)d.col!==l&&(l=d.col,c=ht(r,this.top+o+a,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+a,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const o=this.ctx;la(o,this),this._draw(),ca(o)}}_draw(){const{options:o,columnSizes:n,lineWidths:r,ctx:a}=this,{align:s,labels:i}=o,l=tt.color,c=wn(o.rtl,this.left,this.width),d=mt(i.font),{padding:u}=i,f=d.size,h=f/2;let m;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:p,boxHeight:b,itemHeight:x}=ef(i,f),g=function(V,A,S){if(isNaN(p)||p<=0||isNaN(b)||b<0)return;a.save();const P=Pe(S.lineWidth,1);if(a.fillStyle=Pe(S.fillStyle,l),a.lineCap=Pe(S.lineCap,"butt"),a.lineDashOffset=Pe(S.lineDashOffset,0),a.lineJoin=Pe(S.lineJoin,"miter"),a.lineWidth=P,a.strokeStyle=Pe(S.strokeStyle,l),a.setLineDash(Pe(S.lineDash,[])),i.usePointStyle){const B={radius:b*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:P},M=c.xPlus(V,p/2),C=A+h;Rd(a,B,M,C,i.pointStyleWidth&&p)}else{const B=A+Math.max((f-b)/2,0),M=c.leftForLtr(V,p),C=yn(S.borderRadius);a.beginPath(),Object.values(C).some(F=>F!==0)?da(a,{x:M,y:B,w:p,h:b,radius:C}):a.rect(M,B,p,b),a.fill(),P!==0&&a.stroke()}a.restore()},k=function(V,A,S){nr(a,S.text,V,A+x/2,d,{strikethrough:S.hidden,textAlign:c.textAlign(S.textAlign)})},w=this.isHorizontal(),E=this._computeTitleHeight();w?m={x:ht(s,this.left+u,this.right-r[0]),y:this.top+u+E,line:0}:m={x:this.left+u,y:ht(s,this.top+E+u,this.bottom-n[0].height),line:0},Kd(this.ctx,o.textDirection);const v=x+u;this.legendItems.forEach((V,A)=>{a.strokeStyle=V.fontColor,a.fillStyle=V.fontColor;const S=a.measureText(V.text).width,P=c.textAlign(V.textAlign||(V.textAlign=i.textAlign)),B=p+h+S;let M=m.x,C=m.y;c.setWidth(this.width),w?A>0&&M+B+u>this.right&&(C=m.y+=v,m.line++,M=m.x=ht(s,this.left+u,this.right-r[m.line])):A>0&&C+v>this.bottom&&(M=m.x=M+n[m.line].width+u,m.line++,C=m.y=ht(s,this.top+E+u,this.bottom-n[m.line].height));const F=c.x(M);if(g(F,C,V),M=gk(P,M+p+h,w?M+B:this.right,o.rtl),k(c.x(M),C,V),w)m.x+=B+u;else if(typeof V.text!="string"){const $=d.lineHeight;m.y+=of(V,$)+u}else m.y+=v}),Xd(this.ctx,o.textDirection)}drawTitle(){const o=this.options,n=o.title,r=mt(n.font),a=Vt(n.padding);if(!n.display)return;const s=wn(o.rtl,this.left,this.width),i=this.ctx,l=n.position,c=r.size/2,d=a.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=ht(o.align,f,this.right-h);else{const p=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);u=d+ht(o.align,this.top,this.bottom-p-o.labels.padding-this._computeTitleHeight())}const m=ht(l,f,f+h);i.textAlign=s.textAlign(ti(l)),i.textBaseline="middle",i.strokeStyle=n.color,i.fillStyle=n.color,i.font=r.string,nr(i,n.text,m,u,r)}_computeTitleHeight(){const o=this.options.title,n=mt(o.font),r=Vt(o.padding);return o.display?n.lineHeight+r.height:0}_getLegendItemAt(o,n){let r,a,s;if(ao(o,this.left,this.right)&&ao(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],ao(o,a.left,a.left+a.width)&&ao(n,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(o){const n=this.options;if(!Uw(o.type,n))return;const r=this._getLegendItemAt(o.x,o.y);if(o.type==="mousemove"||o.type==="mouseout"){const a=this._hoveredItem,s=$w(a,r);a&&!s&&Je(n.onLeave,[o,a,this],this),this._hoveredItem=r,r&&!s&&Je(n.onHover,[o,r,this],this)}else r&&Je(n.onClick,[o,r,this],this)}}function Iw(t,o,n,r,a){const s=zw(r,t,o,n),i=jw(a,r,o.lineHeight);return{itemWidth:s,itemHeight:i}}function zw(t,o,n,r){let a=t.text;return a&&typeof a!="string"&&(a=a.reduce((s,i)=>s.length>i.length?s:i)),o+n.size/2+r.measureText(a).width}function jw(t,o,n){let r=t;return typeof o.text!="string"&&(r=of(o,n)),r}function of(t,o){const n=t.text?t.text.length:0;return o*n}function Uw(t,o){return!!((t==="mousemove"||t==="mouseout")&&(o.onHover||o.onLeave)||o.onClick&&(t==="click"||t==="mouseup"))}var Ww={id:"legend",_element:tf,start(t,o,n){const r=t.legend=new tf({ctx:t.ctx,options:n,chart:t});Mt.configure(t,r,n),Mt.addBox(t,r)},stop(t){Mt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,o,n){const r=t.legend;Mt.configure(t,r,n),r.options=n},afterUpdate(t){const o=t.legend;o.buildLabels(),o.adjustHitBoxes()},afterEvent(t,o){o.replay||t.legend.handleEvent(o.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,o,n){const r=o.datasetIndex,a=n.chart;a.isDatasetVisible(r)?(a.hide(r),o.hidden=!0):(a.show(r),o.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const o=t.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(n?0:void 0),u=Vt(d.borderWidth);return{text:o[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:r||d.pointStyle,rotation:d.rotation,textAlign:a||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class nf extends io{constructor(o){super(),this.chart=o.chart,this.options=o.options,this.ctx=o.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(o,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=o,this.height=this.bottom=n;const a=nt(r.text)?r.text.length:1;this._padding=Vt(r.padding);const s=a*mt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const o=this.options.position;return o==="top"||o==="bottom"}_drawArgs(o){const{top:n,left:r,bottom:a,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=ht(l,r,s),f=n+o,d=s-r):(i.position==="left"?(u=r+o,f=ht(l,a,n),c=He*-.5):(u=s-o,f=ht(l,n,a),c=He*.5),d=a-n),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const o=this.ctx,n=this.options;if(!n.display)return;const r=mt(n.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);nr(o,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:d,textAlign:ti(n.align),textBaseline:"middle",translation:[i,l]})}}function Hw(t,o){const n=new nf({ctx:t.ctx,options:o,chart:t});Mt.configure(t,n,o),Mt.addBox(t,n),t.titleBlock=n}var Gw={id:"title",_element:nf,start(t,o,n){Hw(t,n)},stop(t){const o=t.titleBlock;Mt.removeBox(t,o),delete t.titleBlock},beforeUpdate(t,o,n){const r=t.titleBlock;Mt.configure(t,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const fr={average(t){if(!t.length)return!1;let o,n,r=new Set,a=0,s=0;for(o=0,n=t.length;o<n;++o){const l=t[o].element;if(l&&l.hasValue()){const c=l.tooltipPosition();r.add(c.x),a+=c.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((l,c)=>l+c)/r.size,y:a/s}},nearest(t,o){if(!t.length)return!1;let n=o.x,r=o.y,a=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=t.length;s<i;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Zs(o,d);u<a&&(a=u,l=c)}}if(l){const c=l.tooltipPosition();n=c.x,r=c.y}return{x:n,y:r}}};function Ht(t,o){return o&&(nt(o)?Array.prototype.push.apply(t,o):t.push(o)),t}function co(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
40
40
  `)>-1?t.split(`
41
- `):t}function qw(t,o){const{element:n,datasetIndex:r,index:a}=o,s=t.getDatasetMeta(r).controller,{label:i,value:l}=s.getLabelAndValue(a);return{chart:t,label:i,parsed:s.getParsed(a),raw:t.data.datasets[r].data[a],formattedValue:l,dataset:s.getDataset(),dataIndex:a,datasetIndex:r,element:n}}function rf(t,o){const n=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=o,c=mt(o.bodyFont),d=mt(o.titleFont),u=mt(o.footerFont),f=s.length,h=a.length,m=r.length,p=Vt(o.padding);let b=p.height,x=0,g=r.reduce((E,v)=>E+v.before.length+v.lines.length+v.after.length,0);if(g+=t.beforeBody.length+t.afterBody.length,f&&(b+=f*d.lineHeight+(f-1)*o.titleSpacing+o.titleMarginBottom),g){const E=o.displayColors?Math.max(l,c.lineHeight):c.lineHeight;b+=m*E+(g-m)*c.lineHeight+(g-1)*o.bodySpacing}h&&(b+=o.footerMarginTop+h*u.lineHeight+(h-1)*o.footerSpacing);let k=0;const w=function(E){x=Math.max(x,n.measureText(E).width+k)};return n.save(),n.font=d.string,We(t.title,w),n.font=c.string,We(t.beforeBody.concat(t.afterBody),w),k=o.displayColors?i+2+o.boxPadding:0,We(r,E=>{We(E.before,w),We(E.lines,w),We(E.after,w)}),k=0,n.font=u.string,We(t.footer,w),n.restore(),x+=p.width,{width:x,height:b}}function Kw(t,o){const{y:n,height:r}=o;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function Xw(t,o,n,r){const{x:a,width:s}=r,i=n.caretSize+n.caretPadding;if(t==="left"&&a+s+i>o.width||t==="right"&&a-s-i<0)return!0}function Yw(t,o,n,r){const{x:a,width:s}=n,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=a<=(l+c)/2?"left":"right":a<=s/2?d="left":a>=i-s/2&&(d="right"),Xw(d,t,o,n)&&(d="center"),d}function af(t,o,n){const r=n.yAlign||o.yAlign||Kw(t,n);return{xAlign:n.xAlign||o.xAlign||Yw(t,o,n,r),yAlign:r}}function Jw(t,o){let{x:n,width:r}=t;return o==="right"?n-=r:o==="center"&&(n-=r/2),n}function Qw(t,o,n){let{y:r,height:a}=t;return o==="top"?r+=n:o==="bottom"?r-=a+n:r-=a/2,r}function sf(t,o,n,r){const{caretSize:a,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=n,d=a+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=yn(i);let p=Jw(o,l);const b=Qw(o,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,h)+a:l==="right"&&(p+=Math.max(f,m)+a),{x:ft(p,0,r.width-o.width),y:ft(b,0,r.height-o.height)}}function Na(t,o,n){const r=Vt(n.padding);return o==="center"?t.x+t.width/2:o==="right"?t.x+t.width-r.right:t.x+r.left}function lf(t){return Ht([],co(t))}function Zw(t,o,n){return Ko(t,{tooltip:o,tooltipItems:n,type:"tooltip"})}function cf(t,o){const n=o&&o.dataset&&o.dataset.tooltip&&o.dataset.tooltip.callbacks;return n?t.override(n):t}const df={beforeTitle:no,title(t){if(t.length>0){const o=t[0],n=o.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return o.dataset.label||"";if(o.label)return o.label;if(r>0&&o.dataIndex<r)return n[o.dataIndex]}return""},afterTitle:no,beforeBody:no,beforeLabel:no,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let o=t.dataset.label||"";o&&(o+=": ");const n=t.formattedValue;return je(n)||(o+=n),o},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:no,afterBody:no,beforeFooter:no,footer:no,afterFooter:no};function wt(t,o,n,r){const a=t[o].call(n,r);return typeof a>"u"?df[o].call(n,r):a}class Vi extends io{constructor(o){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=o.chart,this.options=o.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(o){this.options=o,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const o=this._cachedAnimations;if(o)return o;const n=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&n.options.animation&&r.animations,s=new ru(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Zw(this.chart.getContext(),this,this._tooltipItems))}getTitle(o,n){const{callbacks:r}=n,a=wt(r,"beforeTitle",this,o),s=wt(r,"title",this,o),i=wt(r,"afterTitle",this,o);let l=[];return l=Ht(l,co(a)),l=Ht(l,co(s)),l=Ht(l,co(i)),l}getBeforeBody(o,n){return lf(wt(n.callbacks,"beforeBody",this,o))}getBody(o,n){const{callbacks:r}=n,a=[];return We(o,s=>{const i={before:[],lines:[],after:[]},l=cf(r,s);Ht(i.before,co(wt(l,"beforeLabel",this,s))),Ht(i.lines,wt(l,"label",this,s)),Ht(i.after,co(wt(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(o,n){return lf(wt(n.callbacks,"afterBody",this,o))}getFooter(o,n){const{callbacks:r}=n,a=wt(r,"beforeFooter",this,o),s=wt(r,"footer",this,o),i=wt(r,"afterFooter",this,o);let l=[];return l=Ht(l,co(a)),l=Ht(l,co(s)),l=Ht(l,co(i)),l}_createItems(o){const n=this._active,r=this.chart.data,a=[],s=[],i=[];let l=[],c,d;for(c=0,d=n.length;c<d;++c)l.push(qw(this.chart,n[c]));return o.filter&&(l=l.filter((u,f,h)=>o.filter(u,f,h,r))),o.itemSort&&(l=l.sort((u,f)=>o.itemSort(u,f,r))),We(l,u=>{const f=cf(o.callbacks,u);a.push(wt(f,"labelColor",this,u)),s.push(wt(f,"labelPointStyle",this,u)),i.push(wt(f,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(o,n){const r=this.options.setContext(this.getContext()),a=this._active;let s,i=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const l=fr[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=rf(this,r),d=Object.assign({},l,c),u=af(this.chart,r,d),f=sf(r,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=i,this.$context=void 0,s&&this._resolveAnimations().update(this,s),o&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(o,n,r,a){const s=this.getCaretPosition(o,r,a);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(o,n,r){const{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=yn(l),{x:h,y:m}=o,{width:p,height:b}=n;let x,g,k,w,E,v;return s==="center"?(E=m+b/2,a==="left"?(x=h,g=x-i,w=E+i,v=E-i):(x=h+p,g=x+i,w=E-i,v=E+i),k=x):(a==="left"?g=h+Math.max(c,u)+i:a==="right"?g=h+p-Math.max(d,f)-i:g=this.caretX,s==="top"?(w=m,E=w-i,x=g-i,k=g+i):(w=m+b,E=w+i,x=g+i,k=g-i),v=w),{x1:x,x2:g,x3:k,y1:w,y2:E,y3:v}}drawTitle(o,n,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=wn(r.rtl,this.x,this.width);for(o.x=Na(this,r.titleAlign,r),n.textAlign=d.textAlign(r.titleAlign),n.textBaseline="middle",i=mt(r.titleFont),l=r.titleSpacing,n.fillStyle=r.titleColor,n.font=i.string,c=0;c<s;++c)n.fillText(a[c],d.x(o.x),o.y+i.lineHeight/2),o.y+=i.lineHeight+l,c+1===s&&(o.y+=r.titleMarginBottom-l)}}_drawColorBox(o,n,r,a,s){const i=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=s,u=mt(s.bodyFont),f=Na(this,"left",s),h=a.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+m;if(s.usePointStyle){const b={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},x=a.leftForLtr(h,d)+d/2,g=p+c/2;o.strokeStyle=s.multiKeyBackground,o.fillStyle=s.multiKeyBackground,ii(o,b,x,g),o.strokeStyle=i.borderColor,o.fillStyle=i.backgroundColor,ii(o,b,x,g)}else{o.lineWidth=Re(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,o.strokeStyle=i.borderColor,o.setLineDash(i.borderDash||[]),o.lineDashOffset=i.borderDashOffset||0;const b=a.leftForLtr(h,d),x=a.leftForLtr(a.xPlus(h,1),d-2),g=yn(i.borderRadius);Object.values(g).some(k=>k!==0)?(o.beginPath(),o.fillStyle=s.multiKeyBackground,da(o,{x:b,y:p,w:d,h:c,radius:g}),o.fill(),o.stroke(),o.fillStyle=i.backgroundColor,o.beginPath(),da(o,{x,y:p+1,w:d-2,h:c-2,radius:g}),o.fill()):(o.fillStyle=s.multiKeyBackground,o.fillRect(b,p,d,c),o.strokeRect(b,p,d,c),o.fillStyle=i.backgroundColor,o.fillRect(x,p+1,d-2,c-2))}o.fillStyle=this.labelTextColors[r]}drawBody(o,n,r){const{body:a}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,f=mt(r.bodyFont);let h=f.lineHeight,m=0;const p=wn(r.rtl,this.x,this.width),b=function(S){n.fillText(S,p.x(o.x+m),o.y+h/2),o.y+=h+s},x=p.textAlign(i);let g,k,w,E,v,V,A;for(n.textAlign=i,n.textBaseline="middle",n.font=f.string,o.x=Na(this,x,r),n.fillStyle=r.bodyColor,We(this.beforeBody,b),m=l&&x!=="right"?i==="center"?d/2+u:d+2+u:0,E=0,V=a.length;E<V;++E){for(g=a[E],k=this.labelTextColors[E],n.fillStyle=k,We(g.before,b),w=g.lines,l&&w.length&&(this._drawColorBox(n,o,E,p,r),h=Math.max(f.lineHeight,c)),v=0,A=w.length;v<A;++v)b(w[v]),h=f.lineHeight;We(g.after,b)}m=0,h=f.lineHeight,We(this.afterBody,b),o.y-=s}drawFooter(o,n,r){const a=this.footer,s=a.length;let i,l;if(s){const c=wn(r.rtl,this.x,this.width);for(o.x=Na(this,r.footerAlign,r),o.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",i=mt(r.footerFont),n.fillStyle=r.footerColor,n.font=i.string,l=0;l<s;++l)n.fillText(a[l],c.x(o.x),o.y+i.lineHeight/2),o.y+=i.lineHeight+r.footerSpacing}}drawBackground(o,n,r,a){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=o,{width:d,height:u}=r,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=yn(a.cornerRadius);n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.beginPath(),n.moveTo(l+f,c),i==="top"&&this.drawCaret(o,n,r,a),n.lineTo(l+d-h,c),n.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(o,n,r,a),n.lineTo(l+d,c+u-p),n.quadraticCurveTo(l+d,c+u,l+d-p,c+u),i==="bottom"&&this.drawCaret(o,n,r,a),n.lineTo(l+m,c+u),n.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(o,n,r,a),n.lineTo(l,c+f),n.quadraticCurveTo(l,c,l+f,c),n.closePath(),n.fill(),a.borderWidth>0&&n.stroke()}_updateAnimationTarget(o){const n=this.chart,r=this.$animations,a=r&&r.x,s=r&&r.y;if(a||s){const i=fr[o.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=rf(this,o),c=Object.assign({},i,this._size),d=af(n,o,c),u=sf(o,c,d,n);(a._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(o){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=Vt(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(o.save(),o.globalAlpha=r,this.drawBackground(s,o,a,n),Kd(o,n.textDirection),s.y+=i.top,this.drawTitle(s,o,n),this.drawBody(s,o,n),this.drawFooter(s,o,n),Xd(o,n.textDirection),o.restore())}getActiveElements(){return this._active||[]}setActiveElements(o,n){const r=this._active,a=o.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),s=!ra(r,a),i=this._positionChanged(a,n);(s||i)&&(this._active=a,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(o,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],i=this._getActiveElements(o,s,n,r),l=this._positionChanged(i,o),c=n||!ra(i,s)||l;return c&&(this._active=i,(a.enabled||a.external)&&(this._eventPosition={x:o.x,y:o.y},this.update(!0,n))),c}_getActiveElements(o,n,r,a){const s=this.options;if(o.type==="mouseout")return[];if(!a)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(o,s.mode,s,r);return s.reverse&&i.reverse(),i}_positionChanged(o,n){const{caretX:r,caretY:a,options:s}=this,i=fr[s.position].call(this,o,n);return i!==!1&&(r!==i.x||a!==i.y)}}Ae(Vi,"positioners",fr);var eC={id:"tooltip",_element:Vi,positioners:fr,afterInit(t,o,n){n&&(t.tooltip=new Vi({chart:t,options:n}))},beforeUpdate(t,o,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,o,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const o=t.tooltip;if(o&&o._willRender()){const n={tooltip:o};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;o.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,o){if(t.tooltip){const n=o.replay;t.tooltip.handleEvent(o.event,n,o.inChartArea)&&(o.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,o)=>o.bodyFont.size,boxWidth:(t,o)=>o.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:df},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const tC=(t,o,n,r)=>(typeof o=="string"?(n=t.push(o)-1,r.unshift({index:n,label:o})):isNaN(o)&&(n=null),n);function oC(t,o,n,r){const a=t.indexOf(o);if(a===-1)return tC(t,o,n,r);const s=t.lastIndexOf(o);return a!==s?n:a}const nC=(t,o)=>t===null?null:ft(Math.round(t),0,o);function uf(t){const o=this.getLabels();return t>=0&&t<o.length?o[t]:t}class Mi extends En{constructor(o){super(o),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(o){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:a,label:s}of n)r[a]===s&&r.splice(a,1);this._addedLabels=[]}super.init(o)}parse(o,n){if(je(o))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===o?n:oC(r,o,Pe(n,o),this._addedLabels),nC(n,r.length-1)}determineDataLimits(){const{minDefined:o,maxDefined:n}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(o||(r=0),n||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const o=this.min,n=this.max,r=this.options.offset,a=[];let s=this.getLabels();s=o===0&&n===s.length-1?s:s.slice(o,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=o;i<=n;i++)a.push({value:i});return a}getLabelForValue(o){return uf.call(this,o)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(o){return typeof o!="number"&&(o=this.parse(o)),o===null?NaN:this.getPixelForDecimal((o-this._startValue)/this._valueRange)}getPixelForTick(o){const n=this.ticks;return o<0||o>n.length-1?null:this.getPixelForValue(n[o].value)}getValueForPixel(o){return Math.round(this._startValue+this.getDecimalForPixel(o)*this._valueRange)}getBasePixel(){return this.bottom}}Ae(Mi,"id","category"),Ae(Mi,"defaults",{ticks:{callback:uf}});function rC(t,o){const n=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=s||1,p=u-1,{min:b,max:x}=o,g=!je(i),k=!je(l),w=!je(d),E=(x-b)/(f+1);let v=Cd((x-b)/p/m)*m,V,A,S,P;if(v<1e-14&&!g&&!k)return[{value:b},{value:x}];P=Math.ceil(x/v)-Math.floor(b/v),P>p&&(v=Cd(P*v/p/m)*m),je(c)||(V=Math.pow(10,c),v=Math.ceil(v*V)/V),a==="ticks"?(A=Math.floor(b/v)*v,S=Math.ceil(x/v)*v):(A=b,S=x),g&&k&&s&&ik((l-i)/s,v/1e3)?(P=Math.round(Math.min((l-i)/v,u)),v=(l-i)/P,A=i,S=l):w?(A=g?i:A,S=k?l:S,P=d-1,v=(S-A)/P):(P=(S-A)/v,Jn(P,Math.round(P),v/1e3)?P=Math.round(P):P=Math.ceil(P));const B=Math.max(Ed(v),Ed(A));V=Math.pow(10,je(c)?B:c),A=Math.round(A*V)/V,S=Math.round(S*V)/V;let M=0;for(g&&(h&&A!==i?(n.push({value:i}),A<i&&M++,Jn(Math.round((A+M*v)*V)/V,i,ff(i,E,t))&&M++):A<i&&M++);M<P;++M){const C=Math.round((A+M*v)*V)/V;if(k&&C>l)break;n.push({value:C})}return k&&h&&S!==l?n.length&&Jn(n[n.length-1].value,l,ff(l,E,t))?n[n.length-1].value=l:n.push({value:l}):(!k||S===l)&&n.push({value:S}),n}function ff(t,o,{horizontal:n,minRotation:r}){const a=ro(r),s=(n?Math.sin(a):Math.cos(a))||.001,i=.75*o*(""+t).length;return Math.min(o/s,i)}class aC extends En{constructor(o){super(o),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(o,n){return je(o)||(typeof o=="number"||o instanceof Number)&&!isFinite(+o)?null:+o}handleTickRangeOptions(){const{beginAtZero:o}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:a,max:s}=this;const i=c=>a=n?a:c,l=c=>s=r?s:c;if(o){const c=Ut(a),d=Ut(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);l(s+c),o||i(a-c)}this.min=a,this.max=s}getTickLimit(){const o=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=o,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),n=n||11),n&&(a=Math.min(n,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const o=this.options,n=o.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:o.bounds,min:o.min,max:o.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,i=rC(a,s);return o.bounds==="ticks"&&lk(i,this,"value"),o.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const o=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&o.length){const a=(r-n)/Math.max(o.length-1,1)/2;n-=a,r+=a}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(o){return ri(o,this.chart.options.locale,this.options.ticks.format)}}class Ti extends aC{determineDataLimits(){const{min:o,max:n}=this.getMinMax(!0);this.min=ut(o)?o:0,this.max=ut(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const o=this.isHorizontal(),n=o?this.width:this.height,r=ro(this.options.ticks.minRotation),a=(o?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/a))}getPixelForValue(o){return o===null?NaN:this.getPixelForDecimal((o-this._startValue)/this._valueRange)}getValueForPixel(o){return this._startValue+this.getDecimalForPixel(o)*this._valueRange}}Ae(Ti,"id","linear"),Ae(Ti,"defaults",{ticks:{callback:Pd.formatters.numeric}});const Va={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ct=Object.keys(Va);function hf(t,o){return t-o}function mf(t,o){if(je(o))return null;const n=t._adapter,{parser:r,round:a,isoWeekday:s}=t._parseOpts;let i=o;return typeof r=="function"&&(i=r(i)),ut(i)||(i=typeof r=="string"?n.parse(i,r):n.parse(i)),i===null?null:(a&&(i=a==="week"&&(Qn(s)||s===!0)?n.startOf(i,"isoWeek",s):n.startOf(i,a)),+i)}function pf(t,o,n,r){const a=Ct.length;for(let s=Ct.indexOf(t);s<a-1;++s){const i=Va[Ct[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-o)/(l*i.size))<=r)return Ct[s]}return Ct[a-1]}function sC(t,o,n,r,a){for(let s=Ct.length-1;s>=Ct.indexOf(n);s--){const i=Ct[s];if(Va[i].common&&t._adapter.diff(a,r,i)>=o-1)return i}return Ct[n?Ct.indexOf(n):0]}function iC(t){for(let o=Ct.indexOf(t)+1,n=Ct.length;o<n;++o)if(Va[Ct[o]].common)return Ct[o]}function gf(t,o,n){if(!n)t[o]=!0;else if(n.length){const{lo:r,hi:a}=ei(n,o),s=n[r]>=o?n[r]:n[a];t[s]=!0}}function lC(t,o,n,r){const a=t._adapter,s=+a.startOf(o[0].value,r),i=o[o.length-1].value;let l,c;for(l=s;l<=i;l=+a.add(l,1,r))c=n[l],c>=0&&(o[c].major=!0);return o}function bf(t,o,n){const r=[],a={},s=o.length;let i,l;for(i=0;i<s;++i)l=o[i],a[l]=i,r.push({value:l,major:!1});return s===0||!n?r:lC(t,r,a,n)}class Ma extends En{constructor(o){super(o),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(o,n={}){const r=o.time||(o.time={}),a=this._adapter=new Wx._date(o.adapters.date);a.init(n),Xn(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(o),this._normalized=n.normalized}parse(o,n){return o===void 0?null:mf(this,o)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const o=this.options,n=this._adapter,r=o.time.unit||"day";let{min:a,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(a=Math.min(a,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(o.bounds!=="ticks"||o.ticks.source!=="labels")&&c(this.getMinMax(!1))),a=ut(a)&&!isNaN(a)?a:+n.startOf(Date.now(),r),s=ut(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const o=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return o.length&&(n=o[0],r=o[o.length-1]),{min:n,max:r}}buildTicks(){const o=this.options,n=o.time,r=o.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();o.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,i=this.max,l=hk(a,s,i);return this._unit=n.unit||(r.autoSkip?pf(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):sC(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:iC(this._unit),this.initOffsets(a),o.reverse&&l.reverse(),bf(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(o=>+o.value))}initOffsets(o=[]){let n=0,r=0,a,s;this.options.offset&&o.length&&(a=this.getDecimalForValue(o[0]),o.length===1?n=1-a:n=(this.getDecimalForValue(o[1])-a)/2,s=this.getDecimalForValue(o[o.length-1]),o.length===1?r=s:r=(s-this.getDecimalForValue(o[o.length-2]))/2);const i=o.length<3?.5:.25;n=ft(n,0,i),r=ft(r,0,i),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const o=this._adapter,n=this.min,r=this.max,a=this.options,s=a.time,i=s.unit||pf(s.minUnit,n,r,this._getLabelCapacity(n)),l=Pe(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=Qn(c)||c===!0,u={};let f=n,h,m;if(d&&(f=+o.startOf(f,"isoWeek",c)),f=+o.startOf(f,d?"day":i),o.diff(r,n,i)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+i);const p=a.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<r;h=+o.add(h,l,i),m++)gf(u,h,p);return(h===r||a.bounds==="ticks"||m===1)&&gf(u,h,p),Object.keys(u).sort(hf).map(b=>+b)}getLabelForValue(o){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(o,r.tooltipFormat):n.format(o,r.displayFormats.datetime)}format(o,n){const a=this.options.time.displayFormats,s=this._unit,i=n||a[s];return this._adapter.format(o,i)}_tickFormatFunction(o,n,r,a){const s=this.options,i=s.ticks.callback;if(i)return Je(i,[o,n,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=r[n],m=d&&f&&h&&h.major;return this._adapter.format(o,a||(m?f:u))}generateTickLabels(o){let n,r,a;for(n=0,r=o.length;n<r;++n)a=o[n],a.label=this._tickFormatFunction(a.value,n,o)}getDecimalForValue(o){return o===null?NaN:(o-this.min)/(this.max-this.min)}getPixelForValue(o){const n=this._offsets,r=this.getDecimalForValue(o);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(o){const n=this._offsets,r=this.getDecimalForPixel(o)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(o){const n=this.options.ticks,r=this.ctx.measureText(o).width,a=ro(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(a),i=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:r*s+l*i,h:r*i+l*s}}_getLabelCapacity(o){const n=this.options.time,r=n.displayFormats,a=r[n.unit]||r.millisecond,s=this._tickFormatFunction(o,0,bf(this,[o],this._majorUnit),a),i=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return l>0?l:1}getDataTimestamps(){let o=this._cache.data||[],n,r;if(o.length)return o;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(n=0,r=a.length;n<r;++n)o=o.concat(a[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(o)}getLabelTimestamps(){const o=this._cache.labels||[];let n,r;if(o.length)return o;const a=this.getLabels();for(n=0,r=a.length;n<r;++n)o.push(mf(this,a[n]));return this._cache.labels=this._normalized?o:this.normalize(o)}normalize(o){return Dd(o.sort(hf))}}Ae(Ma,"id","time"),Ae(Ma,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ta(t,o,n){let r=0,a=t.length-1,s,i,l,c;n?(o>=t[r].pos&&o<=t[a].pos&&({lo:r,hi:a}=Ho(t,"pos",o)),{pos:s,time:l}=t[r],{pos:i,time:c}=t[a]):(o>=t[r].time&&o<=t[a].time&&({lo:r,hi:a}=Ho(t,"time",o)),{time:s,pos:l}=t[r],{time:i,pos:c}=t[a]);const d=i-s;return d?l+(c-l)*(o-s)/d:l}class yf extends Ma{constructor(o){super(o),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const o=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(o);this._minPos=Ta(n,this.min),this._tableRange=Ta(n,this.max)-this._minPos,super.initOffsets(o)}buildLookupTable(o){const{min:n,max:r}=this,a=[],s=[];let i,l,c,d,u;for(i=0,l=o.length;i<l;++i)d=o[i],d>=n&&d<=r&&a.push(d);if(a.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(i=0,l=a.length;i<l;++i)u=a[i+1],c=a[i-1],d=a[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const o=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(o)||!r.length)&&r.splice(0,0,o),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((a,s)=>a-s)}_getTimestampsForTable(){let o=this._cache.all||[];if(o.length)return o;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?o=this.normalize(n.concat(r)):o=n.length?n:r,o=this._cache.all=o,o}getDecimalForValue(o){return(Ta(this._table,o)-this._minPos)/this._tableRange}getValueForPixel(o){const n=this._offsets,r=this.getDecimalForPixel(o)/n.factor-n.end;return Ta(this._table,r*this._tableRange+this._minPos,!0)}}Ae(yf,"id","timeseries"),Ae(yf,"defaults",Ma.defaults);const cC={key:0,class:"mb-2 text-sm font-medium text-gray-700"},dC={key:0,class:"text-red-500 ml-1"},uC={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},fC={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},hC={class:"text-red-600 text-sm"},mC={key:1,class:"mt-2 text-xs text-gray-500"},pC={key:0},kf=dt(e.defineComponent({name:"DCodeChart",__name:"DCodeChart",props:{type:{default:"line"},width:{default:400},height:{default:300},required:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},error:{default:null},showInfo:{type:Boolean,default:!1},responsive:{type:Boolean,default:!0},maintainAspectRatio:{type:Boolean,default:!1},theme:{default:"light"},colors:{default:()=>["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#6366F1","#84CC16"]},data:{},modelValue:{},options:{},onClick:{},onHover:{},label:{}},emits:["update:modelValue","click","hover","ready"],setup(t,{expose:o,emit:n}){lo.register(Mi,Ti,Da,Do,Aa,ur,Gw,eC,Ww,Lw,ba,ga,yi,Cn);const r=t,a=n,s=e.ref(null),i=e.shallowRef(null),l=e.ref(null),c=e.computed(()=>({"opacity-50 pointer-events-none":r.loading||r.error})),d=()=>{const h=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let p=0;return m.type==="data"&&m.mode==="default"&&(p=m.dataIndex*100+m.datasetIndex*50),p},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:h?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:h?"#1F2937":"#FFFFFF",titleColor:h?"#F3F4F6":"#111827",bodyColor:h?"#D1D5DB":"#4B5563",borderColor:h?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:r.type!=="pie"&&r.type!=="doughnut"&&r.type!=="polarArea"?{x:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}},y:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}}}:void 0}},u=h=>!h||!h.datasets?h:{...h,datasets:h.datasets.map((m,p)=>{const b=p%r.colors.length,x=r.colors[b];let g=m.backgroundColor,k=m.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!g||g.length===0)?m.data&&(g=m.data.map((w,E)=>r.colors[E%r.colors.length]+"80"),k=m.data.map((w,E)=>r.colors[E%r.colors.length])):(g=g||x+"40",k=k||x),{...m,borderColor:k,backgroundColor:g,pointBackgroundColor:m.pointBackgroundColor||x,pointBorderColor:m.pointBorderColor||x,hoverBackgroundColor:m.hoverBackgroundColor||x+"60",hoverBorderColor:m.hoverBorderColor||x}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const h=r.data||r.modelValue;let m=h;if(Array.isArray(h))if(h.length>0&&typeof h[0]=="object"&&h[0]!==null){const b=Object.keys(h[0]),x=b.find(k=>["label","name","x","category","title"].includes(k.toLowerCase()))||b[0],g=b.find(k=>k!==x&&["value","y","count","amount","total","data"].includes(k.toLowerCase()))||b.find(k=>k!==x&&typeof h[0][k]=="number")||(b.length>1?b.find(k=>k!==x):b[0]);m={labels:h.map(k=>k[x||""]),datasets:[{label:r.label||"Data",data:h.map(k=>k[g||""])}]}}else h.length>0?m={labels:h.map((b,x)=>`Data ${x+1}`),datasets:[{label:r.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const p={...d(),...r.options,onClick:(b,x)=>{a("click",b,x),r.onClick&&r.onClick(b,x)},onHover:(b,x)=>{a("hover",b,x),r.onHover&&r.onHover(b,x)}};i.value=new lo(s.value,{type:r.type,data:l.value,options:p}),a("ready",i.value)};return e.watch(()=>[r.data,r.modelValue,r.type,r.options,r.theme],()=>{f()},{deep:!0}),e.watch(()=>[r.width,r.height],()=>{i.value&&i.value.resize()}),e.onMounted(()=>{f()}),e.onUnmounted(()=>{i.value&&i.value.destroy()}),o({chart:i,updateChart:f}),(h,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",cC,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",dC,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"relative",style:e.normalizeStyle({height:t.height+"px"})},[e.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(e.openBlock(),e.createElementBlock("div",uC,[...m[0]||(m[0]=[e.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("div",fC,[e.createElementVNode("div",hC,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",mC,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",pC,e.toDisplayString(l.value.datasets.length)+" dataset(s) • "+e.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),hr=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const o=t,n=ot.reactiveOmit(o,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Ne.Label),e.mergeProps(e.unref(n),{class:e.unref($e)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",o.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),gC={key:0,class:"ml-1 text-destructive"},bC=["aria-busy"],yC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},kC={key:1,class:"flex items-center"},xC=["id","checked","indeterminate","disabled","required"],en=dt(e.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{id:{default:""},label:{default:""},title:{default:""},required:{type:Boolean,default:!1},modelValue:{type:[Boolean,null]},checked:{type:[Boolean,null]},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:o}){const n=e.useAttrs(),r=o,a=t,s=e.computed(()=>a.visible??!0),i=e.computed(()=>a.required),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-checkbox-${a.id||a.label||"checkbox"}-${l}`),d=e.ref(!!(a.modelValue??a.checked));e.watch(()=>[a.modelValue,a.checked],([h,m])=>{d.value=!!(h??m)},{immediate:!0});const u=()=>{if(a.disabled||a.readonly)return;const h=!d.value;d.value=h,r("update:modelValue",h),r("change",h)},f=h=>{(h.key===" "||h.key==="Enter")&&(h.preventDefault(),u())};return(h,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-1.5",a.disabled?"cursor-not-allowed":""])},[t.label?(e.openBlock(),e.createBlock(hr,{key:0,class:"text-sm font-medium mb-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",gC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(n).class,{"opacity-60 cursor-not-allowed":t.disabled}]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",yC)):e.createCommentVNode("",!0),m[0]||(m[0]=e.createElementVNode("div",{class:"flex items-center gap-2.5"},[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(e.openBlock(),e.createElementBlock("div",kC,[e.createElementVNode("label",{class:e.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!t.disabled&&!t.readonly,"opacity-50 cursor-not-allowed":t.disabled,"cursor-default opacity-80":t.readonly}])},[e.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:t.indeterminate,disabled:t.disabled,required:i.value,onChange:u,onKeydown:f},null,40,xC),e.createElementVNode("div",{class:e.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-all focus:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-neutral-400 dark:peer-focus-visible:ring-neutral-600 peer-focus-visible:ring-offset-2 flex items-center justify-center",[d.value||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800",t.disabled?"cursor-not-allowed":t.readonly?"cursor-default":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!t.indeterminate?(e.openBlock(),e.createBlock(e.unref(pe.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(pe.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):e.createCommentVNode("",!0)],2),t.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[t.disabled?"text-gray-400 dark:text-gray-500":"text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100"]])},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0)],2)]))],10,bC),[[e.vShow,s.value]])],2))}}),[["__scopeId","data-v-cc52c77a"]]),wC={class:"w-full"},CC={key:0,class:"mb-4"},EC={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},SC={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},_C={key:0,class:"ml-1 text-destructive"},BC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},DC={key:1,class:"flex flex-wrap gap-4"},AC={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},vC={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},NC={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},Pi=dt(e.defineComponent({name:"DCodeCardCheckboxList",inheritAttrs:!1,__name:"DCodeCardCheckboxList",props:{modelValue:{default:()=>[]},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},items:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},apiModule:{},apiAction:{},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""},columns:{default:2},apiParams:{default:()=>({})},returnArray:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:o}){e.useAttrs();const{apiUrl:n,DCodeApi:r}=e.inject("externalApi")||{},a=o,s=t,i=e.ref(new Set);e.watch(()=>s.modelValue,V=>{if(!V){i.value=new Set;return}const A=V.map(S=>typeof S=="object"&&S!==null?S.id!==void 0?S.id:S.value:S);i.value=new Set(A)},{immediate:!0,deep:!0});const l=e.ref([]),c=e.ref(!1),d=e.ref(null),u=async()=>{var A,S;const V=((A=s.endpoint)==null?void 0:A.apiUrl)||s.apiUrl;if(!(!V&&!s.apiModule&&!s.apiAction)){c.value=!0,d.value=null;try{let P;const B=((S=s.endpoint)==null?void 0:S.apiMethod)||s.apiMethod||"GET",M={page:1,perPage:100,...s.apiParams};V?P=await n(V,B,M):s.apiModule&&s.apiAction&&r&&(P=await r(s.apiModule,s.apiAction,M));let C=P;s.dataPath?C=s.dataPath.split(".").reduce(($,U)=>$&&$[U]!==void 0?$[U]:void 0,P):typeof P=="object"&&!Array.isArray(P)&&P.data&&(C=P.data),Array.isArray(C)?l.value=C:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),d.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(P){console.error("DCodeCardCheckboxList fetch error:",P),d.value="Gagal memuat data dari endpoint."}finally{c.value=!1}}},f=e.ref(!1);let h=null;const m=()=>{typeof document<"u"&&(f.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var V;((V=s.endpoint)!=null&&V.apiUrl||s.apiUrl||s.apiModule&&s.apiAction)&&u(),m(),typeof document<"u"&&(h=new MutationObserver(m),h.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),h.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{h&&h.disconnect()});const p=e.computed(()=>s.options&&s.options.length>0?s.options:s.items&&s.items.length>0?s.items:l.value),b=V=>{if(typeof V!="object"||V===null)return V;const A=s.itemValue||s.model||"id";return V[A]},x=V=>{if(typeof V!="object"||V===null)return String(V);const A=s.itemTitle||"name";return V[A]},g=V=>i.value.has(V),k=(V,A)=>{if(s.disabled)return;const S=new Set(i.value);A?S.add(V):S.delete(V),i.value=S;const P=Array.from(i.value);a("update:modelValue",P),a("change",P)};e.watch(()=>{var V;return((V=s.endpoint)==null?void 0:V.apiUrl)||s.apiUrl},(V,A)=>{V&&V!==A&&u()});const w=e.computed(()=>s.skeleton||c.value),E=e.computed(()=>!!s.error||!!d.value),v=e.computed(()=>s.error||d.value);return(V,A)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",wC,[t.label||w.value?(e.openBlock(),e.createElementBlock("div",CC,[w.value?(e.openBlock(),e.createElementBlock("div",EC)):(e.openBlock(),e.createElementBlock("h3",SC,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",_C,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",BC,[e.createVNode(e.unref(pe.Loader2),{class:"w-4 h-4 animate-spin"}),A[0]||(A[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("div",DC,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,S=>e.createElementVNode("div",{key:`skeleton-${S}`,class:"flex items-center gap-2.5 min-w-[120px]"},[...A[1]||(A[1]=[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])),64))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[p.value.length===0?(e.openBlock(),e.createElementBlock("div",AC," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",vC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(S,P)=>(e.openBlock(),e.createElementBlock("div",{key:P,class:"flex items-start"},[e.createVNode(en,{"model-value":g(b(S)),title:x(S),disabled:t.disabled,"onUpdate:modelValue":B=>k(b(S),B)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),E.value&&v.value?(e.openBlock(),e.createElementBlock("div",NC,[e.createVNode(e.unref(pe.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(v.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-9fb8103d"]]),VC=["aria-busy"],MC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},TC={key:1,class:"flex justify-end"},PC=["for"],OC={key:0,class:"ml-1 text-destructive"},FC={class:"relative w-full group"},RC={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700 flex-shrink-0"},LC={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},$C=["id","disabled","readonly","placeholder"],IC={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},zC={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Oi=e.defineComponent({name:"DCodeCurrencyField",inheritAttrs:!1,__name:"DCodeCurrencyField",props:{modelValue:{},currency:{default:"IDR"},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},prependInner:{},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},minValue:{},maxValue:{}},emits:["update:modelValue","clear"],setup(t,{emit:o}){const n=e.useAttrs(),r=o,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-currency-field-${n.id||a.label||"currency-field"}-${s}`),l=e.computed(()=>{const C=n.required,F=n["aria-required"];return C===""||C===!0||C==="true"||(F==="true"||F===!0)}),c=e.computed(()=>{const C=n.maxlength??n.maxLength;let F=Number.NaN;return typeof C=="number"?F=C:typeof C=="string"&&(F=Number.parseInt(C,10)),Number.isFinite(F)&&F>0?F:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>a.prependInner?a.prependInner:a.currency==="USD"?"$":a.currency==="IDR"?"Rp":a.currency),f=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=C=>{const F=C.replaceAll(/\D/g,"");return F?Number(F):null},m=C=>f.value.format(C),p=e.ref(""),b=e.ref(null);e.watch(()=>a.modelValue,C=>{C==null?p.value="":h(p.value)!==C&&(p.value=m(C))},{immediate:!0});const x=(C,F)=>{let $=0;for(let U=0;U<F;U++)/\d/.test(C[U])&&$++;return $},g=(C,F)=>{let $=0;for(let U=0;U<C.length;U++)if(/\d/.test(C[U])&&($++,$===F))return U+1;return C.length},k=C=>{const F=C.target,$=F.value,U=F.selectionStart??$.length,W=$.replace(/\D/g,"");if(W===""){p.value="",r("update:modelValue",null);return}let y=W;c.value&&W.length>c.value&&(y=W.slice(0,c.value));const D=Number(y),T=m(D);if($!==T){const N=x($,U);p.value=T,e.nextTick(()=>{if(b.value){const O=g(T,N);b.value.setSelectionRange(O,O)}})}r("update:modelValue",D)},w=()=>{p.value="",r("update:modelValue",null),r("clear")},E=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?p.value.length>0:!0),v=e.computed(()=>!!a.error||!!V.value),V=e.computed(()=>{if(a.modelValue===null||a.modelValue===void 0)return null;const C=a.modelValue;return a.minValue!==void 0&&a.minValue!==null&&C<a.minValue?`Minimum value is ${u.value} ${m(a.minValue)}`:a.maxValue!==void 0&&a.maxValue!==null&&C>a.maxValue?`Maximum value is ${u.value} ${m(a.maxValue)}`:null}),A=e.computed(()=>{const{class:C,maxlength:F,maxLength:$,...U}=n;return U}),S=e.computed(()=>p.value.replace(/\D/g,"").length),P=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),B=e.computed(()=>P.value&&S.value>0),M=e.computed(()=>`${S.value} / ${c.value}`);return(C,F)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",[e.unref(n).class,a.disabled?"cursor-not-allowed":""]]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",MC)):e.createCommentVNode("",!0),F[2]||(F[2]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),P.value?(e.openBlock(),e.createElementBlock("div",TC,[...F[1]||(F[1]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",OC,"*")):e.createCommentVNode("",!0)],8,PC)):e.createCommentVNode("",!0),e.createElementVNode("div",FC,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50",v.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-neutral-400 focus-within:ring-1 focus-within:ring-neutral-400 dark:focus-within:border-neutral-600 dark:focus-within:ring-neutral-600",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":"",a.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":""])},[e.createElementVNode("div",RC,[e.createElementVNode("span",LC,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:b,"onUpdate:modelValue":F[0]||(F[0]=$=>p.value=$),onInput:k,type:"text",inputmode:"numeric"},A.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.placeholder,class:["flex-1 min-w-0 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400",E.value?"pr-8":""]}),null,16,$C),[[e.vModelText,p.value]]),E.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:w},[e.createVNode(e.unref(pe.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),B.value?(e.openBlock(),e.createElementBlock("p",IC,e.toDisplayString(M.value),1)):e.createCommentVNode("",!0)]),v.value?(e.openBlock(),e.createElementBlock("p",zC,[e.createVNode(e.unref(pe.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(V.value||a.error),1)])):e.createCommentVNode("",!0)],64))],10,VC))}}),jC=["aria-busy"],UC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},WC={key:1,class:"flex justify-end"},HC=["for"],GC={key:0,class:"ml-1 text-destructive"},qC={class:"relative w-full group"},KC=["id","value","disabled","readonly","placeholder"],XC={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-l border-gray-300 dark:border-gray-700"},YC={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},JC={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},QC={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Fi=e.defineComponent({name:"DCodePercentField",inheritAttrs:!1,__name:"DCodePercentField",props:{modelValue:{},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},suffix:{default:"%"},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},minValue:{default:0},maxValue:{default:100},minLength:{default:0},maxLength:{default:10},returnNumber:{type:Boolean,default:!1}},emits:["update:modelValue","clear"],setup(t,{emit:o}){const n=e.useAttrs(),r=o,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-percent-field-${n.id||a.label||"percent-field"}-${s}`),l=e.computed(()=>{const M=n.required,C=n["aria-required"];return M===""||M===!0||M==="true"||(C==="true"||C===!0)}),c=e.computed(()=>{const M=n.maxlength??n.maxLength;let C=Number.NaN;return typeof M=="number"?C=M:typeof M=="string"&&(C=Number.parseInt(M,10)),Number.isFinite(C)&&C>0?C:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",useGrouping:!1,minimumFractionDigits:0,maximumFractionDigits:a.maxLength||20})),f=M=>{const F=d.value==="id-ID"||d.value==="id"?M.replace(/[^0-9,]/g,"").replace(",","."):M.replace(/[^0-9.]/g,"");if(!F)return null;const $=Number(F);return isNaN($)?null:$},h=M=>u.value.format(M),m=e.ref(""),p=e.ref(null);e.watch(()=>a.modelValue,M=>{if(M==null||M==="")m.value="";else{const C=typeof M=="string"?Number(M):M;f(m.value)!==C&&(m.value=h(C))}},{immediate:!0});const b=M=>{const C=M.target,F=C.value;C.selectionStart??F.length;const $=d.value==="id-ID"||d.value==="id",U=$?",":".",W=$?".":",";let y=F.replace(W,U),D=$?y.replace(/[^0-9,]/g,""):y.replace(/[^0-9.]/g,"");const T=D.split(U);if(T.length>2&&(D=T[0]+U+T.slice(1).join("")),T.length===2&&T[1].length>10&&(D=T[0]+U+T[1].slice(0,10)),a.maxLength&&D.replace(U,"").length>a.maxLength)if(D.includes(U)){const R=D.indexOf(U),z=D.slice(0,R),q=D.slice(R+1);if(z.length>=a.maxLength)D=z.slice(0,a.maxLength);else{const Y=a.maxLength-z.length;D=z+U+q.slice(0,Y)}}else D=D.slice(0,a.maxLength);if(!D.includes(U)&&D.length>1&&D.startsWith("0")&&(D=D.replace(/^0+/,"")||"0"),D===""||D===U){m.value=D,r("update:modelValue",null);return}const N=f(D);if(N===null)return;h(N),m.value=D;const O=a.returnNumber?N:N!==null?String(N):null;r("update:modelValue",O),e.nextTick(()=>{p.value&&p.value.value!==m.value&&(p.value.value=m.value)})},x=M=>{if(["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","Home","End"].includes(M.key)||(M.ctrlKey||M.metaKey)&&["a","c","v","x"].includes(M.key.toLowerCase()))return;const F=d.value==="id-ID"||d.value==="id",$=F?",":".",U=F?".":",";if(M.key===$||M.key===U){m.value.includes($)&&M.preventDefault();return}/^[0-9]$/.test(M.key)||M.preventDefault()},g=()=>{},k=()=>{m.value="",r("update:modelValue",null),r("clear")},w=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?m.value.length>0:!0),E=e.computed(()=>!!a.error||!!v.value),v=e.computed(()=>{if(a.modelValue===null||a.modelValue===void 0||a.modelValue==="")return null;const M=typeof a.modelValue=="string"?Number(a.modelValue):a.modelValue;return a.minValue!==void 0&&a.minValue!==null&&M<a.minValue?`Minimum value is ${a.minValue}${a.suffix}`:a.maxValue!==void 0&&a.maxValue!==null&&M>a.maxValue?`Maximum value is ${a.maxValue}${a.suffix}`:null}),V=e.computed(()=>{const{class:M,maxlength:C,maxLength:F,...$}=n;return $}),A=e.computed(()=>m.value.replace(/[^0-9]/g,"").length),S=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),P=e.computed(()=>S.value&&A.value>0),B=e.computed(()=>`${A.value} / ${c.value}`);return(M,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",[e.unref(n).class,a.disabled?"cursor-not-allowed":""]]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",UC)):e.createCommentVNode("",!0),C[1]||(C[1]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),S.value?(e.openBlock(),e.createElementBlock("div",WC,[...C[0]||(C[0]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",GC,"*")):e.createCommentVNode("",!0)],8,HC)):e.createCommentVNode("",!0),e.createElementVNode("div",qC,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50",E.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-neutral-400 focus-within:ring-1 focus-within:ring-neutral-400 dark:focus-within:border-neutral-600 dark:focus-within:ring-neutral-600",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":"",a.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":""])},[e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:p,value:m.value,onInput:b,onKeydown:x,onBlur:g,type:"text",inputmode:"decimal"},V.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.placeholder,class:["flex-1 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400"]}),null,16,KC),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:k},[e.createVNode(e.unref(pe.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0),e.createElementVNode("div",XC,[e.createElementVNode("span",YC,e.toDisplayString(t.suffix),1)])],2),P.value?(e.openBlock(),e.createElementBlock("p",JC,e.toDisplayString(B.value),1)):e.createCommentVNode("",!0)]),E.value?(e.openBlock(),e.createElementBlock("p",QC,[e.createVNode(e.unref(pe.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(v.value||a.error),1)])):e.createCommentVNode("",!0)],64))],10,jC))}}),xf=6048e5,ZC=864e5,wf=6e4,Cf=36e5,Ef=Symbol.for("constructDateFrom");function uo(t,o){return typeof t=="function"?t(o):t&&typeof t=="object"&&Ef in t?t[Ef](o):t instanceof Date?new t.constructor(o):new Date(o)}function Dt(t,o){return uo(o||t,t)}let e2={};function Pa(){return e2}function mr(t,o){var l,c,d,u;const n=Pa(),r=(o==null?void 0:o.weekStartsOn)??((c=(l=o==null?void 0:o.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=Dt(t,o==null?void 0:o.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function Oa(t,o){return mr(t,{...o,weekStartsOn:1})}function Sf(t,o){const n=Dt(t,o==null?void 0:o.in),r=n.getFullYear(),a=uo(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=Oa(a),i=uo(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=Oa(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function _f(t){const o=Dt(t),n=new Date(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()));return n.setUTCFullYear(o.getFullYear()),+t-+n}function t2(t,...o){const n=uo.bind(null,o.find(r=>typeof r=="object"));return o.map(n)}function Bf(t,o){const n=Dt(t,o==null?void 0:o.in);return n.setHours(0,0,0,0),n}function o2(t,o,n){const[r,a]=t2(n==null?void 0:n.in,t,o),s=Bf(r),i=Bf(a),l=+s-_f(s),c=+i-_f(i);return Math.round((l-c)/ZC)}function n2(t,o){const n=Sf(t,o),r=uo(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Oa(r)}function r2(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function a2(t){return!(!r2(t)&&typeof t!="number"||isNaN(+Dt(t)))}function s2(t,o){const n=Dt(t,o==null?void 0:o.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const i2={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},l2=(t,o,n)=>{let r;const a=i2[t];return typeof a=="string"?r=a:o===1?r=a.one:r=a.other.replace("{{count}}",o.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function _n(t){return(o={})=>{const n=o.width?String(o.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const c2={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},d2={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},u2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},f2={date:_n({formats:c2,defaultWidth:"full"}),time:_n({formats:d2,defaultWidth:"full"}),dateTime:_n({formats:u2,defaultWidth:"full"})},h2={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},m2=(t,o,n,r)=>h2[t];function Gt(t){return(o,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):i;a=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(o):o;return a[s]}}const p2={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},g2={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},b2={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},y2={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},k2={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},x2={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},w2={ordinalNumber:(t,o)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Gt({values:p2,defaultWidth:"wide"}),quarter:Gt({values:g2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Gt({values:b2,defaultWidth:"wide"}),day:Gt({values:y2,defaultWidth:"wide"}),dayPeriod:Gt({values:k2,defaultWidth:"wide",formattingValues:x2,defaultFormattingWidth:"wide"})};function qt(t){return(o,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=o.match(a);if(!s)return null;const i=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?E2(l,f=>f.test(i)):C2(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=o.slice(i.length);return{value:d,rest:u}}}function C2(t,o){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&o(t[n]))return n}function E2(t,o){for(let n=0;n<t.length;n++)if(o(t[n]))return n}function Df(t){return(o,n={})=>{const r=o.match(t.matchPattern);if(!r)return null;const a=r[0],s=o.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const l=o.slice(a.length);return{value:i,rest:l}}}const S2=/^(\d+)(th|st|nd|rd)?/i,_2=/\d+/i,B2={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},D2={any:[/^b/i,/^(a|c)/i]},A2={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},v2={any:[/1/i,/2/i,/3/i,/4/i]},N2={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},V2={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},M2={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},T2={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},P2={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},O2={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},F2={ordinalNumber:Df({matchPattern:S2,parsePattern:_2,valueCallback:t=>parseInt(t,10)}),era:qt({matchPatterns:B2,defaultMatchWidth:"wide",parsePatterns:D2,defaultParseWidth:"any"}),quarter:qt({matchPatterns:A2,defaultMatchWidth:"wide",parsePatterns:v2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:qt({matchPatterns:N2,defaultMatchWidth:"wide",parsePatterns:V2,defaultParseWidth:"any"}),day:qt({matchPatterns:M2,defaultMatchWidth:"wide",parsePatterns:T2,defaultParseWidth:"any"}),dayPeriod:qt({matchPatterns:P2,defaultMatchWidth:"any",parsePatterns:O2,defaultParseWidth:"any"})},Ri={code:"en-US",formatDistance:l2,formatLong:f2,formatRelative:m2,localize:w2,match:F2,options:{weekStartsOn:0,firstWeekContainsDate:1}};function R2(t,o){const n=Dt(t,o==null?void 0:o.in);return o2(n,s2(n))+1}function L2(t,o){const n=Dt(t,o==null?void 0:o.in),r=+Oa(n)-+n2(n);return Math.round(r/xf)+1}function Af(t,o){var u,f,h,m;const n=Dt(t,o==null?void 0:o.in),r=n.getFullYear(),a=Pa(),s=(o==null?void 0:o.firstWeekContainsDate)??((f=(u=o==null?void 0:o.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=uo((o==null?void 0:o.in)||t,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=mr(i,o),c=uo((o==null?void 0:o.in)||t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=mr(c,o);return+n>=+l?r+1:+n>=+d?r:r-1}function $2(t,o){var l,c,d,u;const n=Pa(),r=(o==null?void 0:o.firstWeekContainsDate)??((c=(l=o==null?void 0:o.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=Af(t,o),s=uo((o==null?void 0:o.in)||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),mr(s,o)}function I2(t,o){const n=Dt(t,o==null?void 0:o.in),r=+mr(n,o)-+$2(n,o);return Math.round(r/xf)+1}function Ge(t,o){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(o,"0");return n+r}const vo={y(t,o){const n=t.getFullYear(),r=n>0?n:1-n;return Ge(o==="yy"?r%100:r,o.length)},M(t,o){const n=t.getMonth();return o==="M"?String(n+1):Ge(n+1,2)},d(t,o){return Ge(t.getDate(),o.length)},a(t,o){const n=t.getHours()/12>=1?"pm":"am";switch(o){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,o){return Ge(t.getHours()%12||12,o.length)},H(t,o){return Ge(t.getHours(),o.length)},m(t,o){return Ge(t.getMinutes(),o.length)},s(t,o){return Ge(t.getSeconds(),o.length)},S(t,o){const n=o.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Ge(a,o.length)}},Bn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vf={G:function(t,o,n){const r=t.getFullYear()>0?1:0;switch(o){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,o,n){if(o==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return vo.y(t,o)},Y:function(t,o,n,r){const a=Af(t,r),s=a>0?a:1-a;if(o==="YY"){const i=s%100;return Ge(i,2)}return o==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ge(s,o.length)},R:function(t,o){const n=Sf(t);return Ge(n,o.length)},u:function(t,o){const n=t.getFullYear();return Ge(n,o.length)},Q:function(t,o,n){const r=Math.ceil((t.getMonth()+1)/3);switch(o){case"Q":return String(r);case"QQ":return Ge(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,o,n){const r=Math.ceil((t.getMonth()+1)/3);switch(o){case"q":return String(r);case"qq":return Ge(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,o,n){const r=t.getMonth();switch(o){case"M":case"MM":return vo.M(t,o);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,o,n){const r=t.getMonth();switch(o){case"L":return String(r+1);case"LL":return Ge(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,o,n,r){const a=I2(t,r);return o==="wo"?n.ordinalNumber(a,{unit:"week"}):Ge(a,o.length)},I:function(t,o,n){const r=L2(t);return o==="Io"?n.ordinalNumber(r,{unit:"week"}):Ge(r,o.length)},d:function(t,o,n){return o==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):vo.d(t,o)},D:function(t,o,n){const r=R2(t);return o==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ge(r,o.length)},E:function(t,o,n){const r=t.getDay();switch(o){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,o,n,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(o){case"e":return String(s);case"ee":return Ge(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,o,n,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(o){case"c":return String(s);case"cc":return Ge(s,o.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,o,n){const r=t.getDay(),a=r===0?7:r;switch(o){case"i":return String(a);case"ii":return Ge(a,o.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,o,n){const a=t.getHours()/12>=1?"pm":"am";switch(o){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,o,n){const r=t.getHours();let a;switch(r===12?a=Bn.noon:r===0?a=Bn.midnight:a=r/12>=1?"pm":"am",o){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,o,n){const r=t.getHours();let a;switch(r>=17?a=Bn.evening:r>=12?a=Bn.afternoon:r>=4?a=Bn.morning:a=Bn.night,o){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,o,n){if(o==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return vo.h(t,o)},H:function(t,o,n){return o==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):vo.H(t,o)},K:function(t,o,n){const r=t.getHours()%12;return o==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,o.length)},k:function(t,o,n){let r=t.getHours();return r===0&&(r=24),o==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,o.length)},m:function(t,o,n){return o==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):vo.m(t,o)},s:function(t,o,n){return o==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):vo.s(t,o)},S:function(t,o){return vo.S(t,o)},X:function(t,o,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(o){case"X":return Vf(r);case"XXXX":case"XX":return tn(r);case"XXXXX":case"XXX":default:return tn(r,":")}},x:function(t,o,n){const r=t.getTimezoneOffset();switch(o){case"x":return Vf(r);case"xxxx":case"xx":return tn(r);case"xxxxx":case"xxx":default:return tn(r,":")}},O:function(t,o,n){const r=t.getTimezoneOffset();switch(o){case"O":case"OO":case"OOO":return"GMT"+Nf(r,":");case"OOOO":default:return"GMT"+tn(r,":")}},z:function(t,o,n){const r=t.getTimezoneOffset();switch(o){case"z":case"zz":case"zzz":return"GMT"+Nf(r,":");case"zzzz":default:return"GMT"+tn(r,":")}},t:function(t,o,n){const r=Math.trunc(+t/1e3);return Ge(r,o.length)},T:function(t,o,n){return Ge(+t,o.length)}};function Nf(t,o=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?n+String(a):n+String(a)+o+Ge(s,2)}function Vf(t,o){return t%60===0?(t>0?"-":"+")+Ge(Math.abs(t)/60,2):tn(t,o)}function tn(t,o=""){const n=t>0?"-":"+",r=Math.abs(t),a=Ge(Math.trunc(r/60),2),s=Ge(r%60,2);return n+a+o+s}const Mf=(t,o)=>{switch(t){case"P":return o.date({width:"short"});case"PP":return o.date({width:"medium"});case"PPP":return o.date({width:"long"});case"PPPP":default:return o.date({width:"full"})}},Tf=(t,o)=>{switch(t){case"p":return o.time({width:"short"});case"pp":return o.time({width:"medium"});case"ppp":return o.time({width:"long"});case"pppp":default:return o.time({width:"full"})}},z2={p:Tf,P:(t,o)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Mf(t,o);let s;switch(r){case"P":s=o.dateTime({width:"short"});break;case"PP":s=o.dateTime({width:"medium"});break;case"PPP":s=o.dateTime({width:"long"});break;case"PPPP":default:s=o.dateTime({width:"full"});break}return s.replace("{{date}}",Mf(r,o)).replace("{{time}}",Tf(a,o))}},j2=/^D+$/,U2=/^Y+$/,W2=["D","DD","YY","YYYY"];function H2(t){return j2.test(t)}function G2(t){return U2.test(t)}function q2(t,o,n){const r=K2(t,o,n);if(console.warn(r),W2.includes(t))throw new RangeError(r)}function K2(t,o,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${o}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const X2=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Y2=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J2=/^'([^]*?)'?$/,Q2=/''/g,Z2=/[a-zA-Z]/;function Pf(t,o,n){var u,f,h,m;const r=Pa(),a=r.locale??Ri,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=Dt(t,n==null?void 0:n.in);if(!a2(l))throw new RangeError("Invalid time value");let c=o.match(Y2).map(p=>{const b=p[0];if(b==="p"||b==="P"){const x=z2[b];return x(p,a.formatLong)}return p}).join("").match(X2).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const b=p[0];if(b==="'")return{isToken:!1,value:eE(p)};if(vf[b])return{isToken:!0,value:p};if(b.match(Z2))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:p}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(p=>{if(!p.isToken)return p.value;const b=p.value;(G2(b)||H2(b))&&q2(b,o,String(t));const x=vf[b[0]];return x(l,b,a.localize,d)}).join("")}function eE(t){const o=t.match(J2);return o?o[1].replace(Q2,"'"):t}function Of(t,o){const n=()=>uo(o==null?void 0:o.in,NaN),a=rE(t);let s;if(a.date){const d=aE(a.date,2);s=sE(d.restDateString,d.year)}if(!s||isNaN(+s))return n();const i=+s;let l=0,c;if(a.time&&(l=iE(a.time),isNaN(l)))return n();if(a.timezone){if(c=lE(a.timezone),isNaN(c))return n()}else{const d=new Date(i+l),u=Dt(0,o==null?void 0:o.in);return u.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),u.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),u}return Dt(i+l+c,o==null?void 0:o.in)}const Fa={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},tE=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,oE=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nE=/^([+-])(\d{2})(?::?(\d{2}))?$/;function rE(t){const o={},n=t.split(Fa.dateTimeDelimiter);let r;if(n.length>2)return o;if(/:/.test(n[0])?r=n[0]:(o.date=n[0],r=n[1],Fa.timeZoneDelimiter.test(o.date)&&(o.date=t.split(Fa.timeZoneDelimiter)[0],r=t.substr(o.date.length,t.length))),r){const a=Fa.timezone.exec(r);a?(o.time=r.replace(a[1],""),o.timezone=a[1]):o.time=r}return o}function aE(t,o){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+o)+"})|(\\d{2}|[+-]\\d{"+(2+o)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,s=r[2]?parseInt(r[2]):null;return{year:s===null?a:s*100,restDateString:t.slice((r[1]||r[2]).length)}}function sE(t,o){if(o===null)return new Date(NaN);const n=t.match(tE);if(!n)return new Date(NaN);const r=!!n[4],a=pr(n[1]),s=pr(n[2])-1,i=pr(n[3]),l=pr(n[4]),c=pr(n[5])-1;if(r)return hE(o,l,c)?cE(o,l,c):new Date(NaN);{const d=new Date(0);return!uE(o,s,i)||!fE(o,a)?new Date(NaN):(d.setUTCFullYear(o,s,Math.max(a,i)),d)}}function pr(t){return t?parseInt(t):1}function iE(t){const o=t.match(oE);if(!o)return NaN;const n=Li(o[1]),r=Li(o[2]),a=Li(o[3]);return mE(n,r,a)?n*Cf+r*wf+a*1e3:NaN}function Li(t){return t&&parseFloat(t.replace(",","."))||0}function lE(t){if(t==="Z")return 0;const o=t.match(nE);if(!o)return 0;const n=o[1]==="+"?-1:1,r=parseInt(o[2]),a=o[3]&&parseInt(o[3])||0;return pE(r,a)?n*(r*Cf+a*wf):NaN}function cE(t,o,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,s=(o-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+s),r}const dE=[31,null,31,30,31,30,31,31,30,31,30,31];function Ff(t){return t%400===0||t%4===0&&t%100!==0}function uE(t,o,n){return o>=0&&o<=11&&n>=1&&n<=(dE[o]||(Ff(t)?29:28))}function fE(t,o){return o>=1&&o<=(Ff(t)?366:365)}function hE(t,o,n){return o>=1&&o<=53&&n>=0&&n<=6}function mE(t,o,n){return t===24?o===0&&n===0:n>=0&&n<60&&o>=0&&o<60&&t>=0&&t<25}function pE(t,o){return o>=0&&o<=59}const gE={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},bE=(t,o,n)=>{let r;const a=gE[t];return typeof a=="string"?r=a:o===1?r=a.one:r=a.other.replace("{{count}}",o.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"dalam waktu "+r:r+" yang lalu":r},yE={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},kE={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},xE={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wE={date:_n({formats:yE,defaultWidth:"full"}),time:_n({formats:kE,defaultWidth:"full"}),dateTime:_n({formats:xE,defaultWidth:"full"})},CE={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},EE=(t,o,n,r)=>CE[t],SE={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},_E={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},BE={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},DE={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},AE={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},vE={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},NE={ordinalNumber:(t,o)=>"ke-"+Number(t),era:Gt({values:SE,defaultWidth:"wide"}),quarter:Gt({values:_E,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Gt({values:BE,defaultWidth:"wide"}),day:Gt({values:DE,defaultWidth:"wide"}),dayPeriod:Gt({values:AE,defaultWidth:"wide",formattingValues:vE,defaultFormattingWidth:"wide"})},VE=/^ke-(\d+)?/i,ME=/\d+/i,TE={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},PE={any:[/^s/i,/^(m|e)/i]},OE={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},FE={any:[/1/i,/2/i,/3/i,/4/i]},RE={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},LE={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},$E={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},IE={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},zE={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},jE={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},UE={ordinalNumber:Df({matchPattern:VE,parsePattern:ME,valueCallback:t=>parseInt(t,10)}),era:qt({matchPatterns:TE,defaultMatchWidth:"wide",parsePatterns:PE,defaultParseWidth:"any"}),quarter:qt({matchPatterns:OE,defaultMatchWidth:"wide",parsePatterns:FE,defaultParseWidth:"any",valueCallback:t=>t+1}),month:qt({matchPatterns:RE,defaultMatchWidth:"wide",parsePatterns:LE,defaultParseWidth:"any"}),day:qt({matchPatterns:$E,defaultMatchWidth:"wide",parsePatterns:IE,defaultParseWidth:"any"}),dayPeriod:qt({matchPatterns:zE,defaultMatchWidth:"any",parsePatterns:jE,defaultParseWidth:"any"})},Rf={code:"id",formatDistance:bE,formatLong:wE,formatRelative:EE,localize:NE,match:UE,options:{weekStartsOn:1,firstWeekContainsDate:1}},Lf={primary:{light:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"#bfdbfe"},dark:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"rgba(30, 58, 138, 0.3)"}},emerald:{light:{primary:"#16a34a",text:"#ffffff",hover:"#dcfce7",border:"#16a34a",range:"#ecfdf5"},dark:{primary:"#22c55e",text:"#0b1220",hover:"#14532d",border:"#22c55e",range:"rgba(6, 78, 59, 0.3)"}},amber:{light:{primary:"#d97706",text:"#ffffff",hover:"#fffbeb",border:"#d97706",range:"#fffbeb"},dark:{primary:"#f59e0b",text:"#0b1220",hover:"#78350f",border:"#f59e0b",range:"rgba(120, 53, 15, 0.3)"}},violet:{light:{primary:"#7c3aed",text:"#ffffff",hover:"#f5f3ff",border:"#7c3aed",range:"#f5f3ff"},dark:{primary:"#8b5cf6",text:"#0b1220",hover:"#2e1065",border:"#8b5cf6",range:"rgba(46, 16, 101, 0.3)"}},destructive:{light:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.10)",border:"hsl(var(--destructive))",range:"#fef2f2"},dark:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.18)",border:"hsl(var(--destructive))",range:"rgba(127, 29, 29, 0.3)"}}},$f="dcode-dp-theme-forced";function WE(t,o=$f){const n=Lf[t]??Lf.primary,r=`
41
+ `):t}function qw(t,o){const{element:n,datasetIndex:r,index:a}=o,s=t.getDatasetMeta(r).controller,{label:i,value:l}=s.getLabelAndValue(a);return{chart:t,label:i,parsed:s.getParsed(a),raw:t.data.datasets[r].data[a],formattedValue:l,dataset:s.getDataset(),dataIndex:a,datasetIndex:r,element:n}}function rf(t,o){const n=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=o,c=mt(o.bodyFont),d=mt(o.titleFont),u=mt(o.footerFont),f=s.length,h=a.length,m=r.length,p=Vt(o.padding);let b=p.height,x=0,g=r.reduce((E,v)=>E+v.before.length+v.lines.length+v.after.length,0);if(g+=t.beforeBody.length+t.afterBody.length,f&&(b+=f*d.lineHeight+(f-1)*o.titleSpacing+o.titleMarginBottom),g){const E=o.displayColors?Math.max(l,c.lineHeight):c.lineHeight;b+=m*E+(g-m)*c.lineHeight+(g-1)*o.bodySpacing}h&&(b+=o.footerMarginTop+h*u.lineHeight+(h-1)*o.footerSpacing);let k=0;const w=function(E){x=Math.max(x,n.measureText(E).width+k)};return n.save(),n.font=d.string,We(t.title,w),n.font=c.string,We(t.beforeBody.concat(t.afterBody),w),k=o.displayColors?i+2+o.boxPadding:0,We(r,E=>{We(E.before,w),We(E.lines,w),We(E.after,w)}),k=0,n.font=u.string,We(t.footer,w),n.restore(),x+=p.width,{width:x,height:b}}function Kw(t,o){const{y:n,height:r}=o;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function Xw(t,o,n,r){const{x:a,width:s}=r,i=n.caretSize+n.caretPadding;if(t==="left"&&a+s+i>o.width||t==="right"&&a-s-i<0)return!0}function Yw(t,o,n,r){const{x:a,width:s}=n,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=a<=(l+c)/2?"left":"right":a<=s/2?d="left":a>=i-s/2&&(d="right"),Xw(d,t,o,n)&&(d="center"),d}function af(t,o,n){const r=n.yAlign||o.yAlign||Kw(t,n);return{xAlign:n.xAlign||o.xAlign||Yw(t,o,n,r),yAlign:r}}function Jw(t,o){let{x:n,width:r}=t;return o==="right"?n-=r:o==="center"&&(n-=r/2),n}function Qw(t,o,n){let{y:r,height:a}=t;return o==="top"?r+=n:o==="bottom"?r-=a+n:r-=a/2,r}function sf(t,o,n,r){const{caretSize:a,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=n,d=a+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=yn(i);let p=Jw(o,l);const b=Qw(o,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,h)+a:l==="right"&&(p+=Math.max(f,m)+a),{x:ft(p,0,r.width-o.width),y:ft(b,0,r.height-o.height)}}function Na(t,o,n){const r=Vt(n.padding);return o==="center"?t.x+t.width/2:o==="right"?t.x+t.width-r.right:t.x+r.left}function lf(t){return Ht([],co(t))}function Zw(t,o,n){return Ko(t,{tooltip:o,tooltipItems:n,type:"tooltip"})}function cf(t,o){const n=o&&o.dataset&&o.dataset.tooltip&&o.dataset.tooltip.callbacks;return n?t.override(n):t}const df={beforeTitle:no,title(t){if(t.length>0){const o=t[0],n=o.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return o.dataset.label||"";if(o.label)return o.label;if(r>0&&o.dataIndex<r)return n[o.dataIndex]}return""},afterTitle:no,beforeBody:no,beforeLabel:no,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let o=t.dataset.label||"";o&&(o+=": ");const n=t.formattedValue;return je(n)||(o+=n),o},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:no,afterBody:no,beforeFooter:no,footer:no,afterFooter:no};function wt(t,o,n,r){const a=t[o].call(n,r);return typeof a>"u"?df[o].call(n,r):a}class Vi extends io{constructor(o){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=o.chart,this.options=o.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(o){this.options=o,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const o=this._cachedAnimations;if(o)return o;const n=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&n.options.animation&&r.animations,s=new ru(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Zw(this.chart.getContext(),this,this._tooltipItems))}getTitle(o,n){const{callbacks:r}=n,a=wt(r,"beforeTitle",this,o),s=wt(r,"title",this,o),i=wt(r,"afterTitle",this,o);let l=[];return l=Ht(l,co(a)),l=Ht(l,co(s)),l=Ht(l,co(i)),l}getBeforeBody(o,n){return lf(wt(n.callbacks,"beforeBody",this,o))}getBody(o,n){const{callbacks:r}=n,a=[];return We(o,s=>{const i={before:[],lines:[],after:[]},l=cf(r,s);Ht(i.before,co(wt(l,"beforeLabel",this,s))),Ht(i.lines,wt(l,"label",this,s)),Ht(i.after,co(wt(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(o,n){return lf(wt(n.callbacks,"afterBody",this,o))}getFooter(o,n){const{callbacks:r}=n,a=wt(r,"beforeFooter",this,o),s=wt(r,"footer",this,o),i=wt(r,"afterFooter",this,o);let l=[];return l=Ht(l,co(a)),l=Ht(l,co(s)),l=Ht(l,co(i)),l}_createItems(o){const n=this._active,r=this.chart.data,a=[],s=[],i=[];let l=[],c,d;for(c=0,d=n.length;c<d;++c)l.push(qw(this.chart,n[c]));return o.filter&&(l=l.filter((u,f,h)=>o.filter(u,f,h,r))),o.itemSort&&(l=l.sort((u,f)=>o.itemSort(u,f,r))),We(l,u=>{const f=cf(o.callbacks,u);a.push(wt(f,"labelColor",this,u)),s.push(wt(f,"labelPointStyle",this,u)),i.push(wt(f,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(o,n){const r=this.options.setContext(this.getContext()),a=this._active;let s,i=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const l=fr[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=rf(this,r),d=Object.assign({},l,c),u=af(this.chart,r,d),f=sf(r,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=i,this.$context=void 0,s&&this._resolveAnimations().update(this,s),o&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(o,n,r,a){const s=this.getCaretPosition(o,r,a);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(o,n,r){const{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=yn(l),{x:h,y:m}=o,{width:p,height:b}=n;let x,g,k,w,E,v;return s==="center"?(E=m+b/2,a==="left"?(x=h,g=x-i,w=E+i,v=E-i):(x=h+p,g=x+i,w=E-i,v=E+i),k=x):(a==="left"?g=h+Math.max(c,u)+i:a==="right"?g=h+p-Math.max(d,f)-i:g=this.caretX,s==="top"?(w=m,E=w-i,x=g-i,k=g+i):(w=m+b,E=w+i,x=g+i,k=g-i),v=w),{x1:x,x2:g,x3:k,y1:w,y2:E,y3:v}}drawTitle(o,n,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=wn(r.rtl,this.x,this.width);for(o.x=Na(this,r.titleAlign,r),n.textAlign=d.textAlign(r.titleAlign),n.textBaseline="middle",i=mt(r.titleFont),l=r.titleSpacing,n.fillStyle=r.titleColor,n.font=i.string,c=0;c<s;++c)n.fillText(a[c],d.x(o.x),o.y+i.lineHeight/2),o.y+=i.lineHeight+l,c+1===s&&(o.y+=r.titleMarginBottom-l)}}_drawColorBox(o,n,r,a,s){const i=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=s,u=mt(s.bodyFont),f=Na(this,"left",s),h=a.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+m;if(s.usePointStyle){const b={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},x=a.leftForLtr(h,d)+d/2,g=p+c/2;o.strokeStyle=s.multiKeyBackground,o.fillStyle=s.multiKeyBackground,ii(o,b,x,g),o.strokeStyle=i.borderColor,o.fillStyle=i.backgroundColor,ii(o,b,x,g)}else{o.lineWidth=Re(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,o.strokeStyle=i.borderColor,o.setLineDash(i.borderDash||[]),o.lineDashOffset=i.borderDashOffset||0;const b=a.leftForLtr(h,d),x=a.leftForLtr(a.xPlus(h,1),d-2),g=yn(i.borderRadius);Object.values(g).some(k=>k!==0)?(o.beginPath(),o.fillStyle=s.multiKeyBackground,da(o,{x:b,y:p,w:d,h:c,radius:g}),o.fill(),o.stroke(),o.fillStyle=i.backgroundColor,o.beginPath(),da(o,{x,y:p+1,w:d-2,h:c-2,radius:g}),o.fill()):(o.fillStyle=s.multiKeyBackground,o.fillRect(b,p,d,c),o.strokeRect(b,p,d,c),o.fillStyle=i.backgroundColor,o.fillRect(x,p+1,d-2,c-2))}o.fillStyle=this.labelTextColors[r]}drawBody(o,n,r){const{body:a}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,f=mt(r.bodyFont);let h=f.lineHeight,m=0;const p=wn(r.rtl,this.x,this.width),b=function(S){n.fillText(S,p.x(o.x+m),o.y+h/2),o.y+=h+s},x=p.textAlign(i);let g,k,w,E,v,V,A;for(n.textAlign=i,n.textBaseline="middle",n.font=f.string,o.x=Na(this,x,r),n.fillStyle=r.bodyColor,We(this.beforeBody,b),m=l&&x!=="right"?i==="center"?d/2+u:d+2+u:0,E=0,V=a.length;E<V;++E){for(g=a[E],k=this.labelTextColors[E],n.fillStyle=k,We(g.before,b),w=g.lines,l&&w.length&&(this._drawColorBox(n,o,E,p,r),h=Math.max(f.lineHeight,c)),v=0,A=w.length;v<A;++v)b(w[v]),h=f.lineHeight;We(g.after,b)}m=0,h=f.lineHeight,We(this.afterBody,b),o.y-=s}drawFooter(o,n,r){const a=this.footer,s=a.length;let i,l;if(s){const c=wn(r.rtl,this.x,this.width);for(o.x=Na(this,r.footerAlign,r),o.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",i=mt(r.footerFont),n.fillStyle=r.footerColor,n.font=i.string,l=0;l<s;++l)n.fillText(a[l],c.x(o.x),o.y+i.lineHeight/2),o.y+=i.lineHeight+r.footerSpacing}}drawBackground(o,n,r,a){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=o,{width:d,height:u}=r,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=yn(a.cornerRadius);n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.beginPath(),n.moveTo(l+f,c),i==="top"&&this.drawCaret(o,n,r,a),n.lineTo(l+d-h,c),n.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(o,n,r,a),n.lineTo(l+d,c+u-p),n.quadraticCurveTo(l+d,c+u,l+d-p,c+u),i==="bottom"&&this.drawCaret(o,n,r,a),n.lineTo(l+m,c+u),n.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(o,n,r,a),n.lineTo(l,c+f),n.quadraticCurveTo(l,c,l+f,c),n.closePath(),n.fill(),a.borderWidth>0&&n.stroke()}_updateAnimationTarget(o){const n=this.chart,r=this.$animations,a=r&&r.x,s=r&&r.y;if(a||s){const i=fr[o.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=rf(this,o),c=Object.assign({},i,this._size),d=af(n,o,c),u=sf(o,c,d,n);(a._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(o){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=Vt(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(o.save(),o.globalAlpha=r,this.drawBackground(s,o,a,n),Kd(o,n.textDirection),s.y+=i.top,this.drawTitle(s,o,n),this.drawBody(s,o,n),this.drawFooter(s,o,n),Xd(o,n.textDirection),o.restore())}getActiveElements(){return this._active||[]}setActiveElements(o,n){const r=this._active,a=o.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),s=!ra(r,a),i=this._positionChanged(a,n);(s||i)&&(this._active=a,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(o,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],i=this._getActiveElements(o,s,n,r),l=this._positionChanged(i,o),c=n||!ra(i,s)||l;return c&&(this._active=i,(a.enabled||a.external)&&(this._eventPosition={x:o.x,y:o.y},this.update(!0,n))),c}_getActiveElements(o,n,r,a){const s=this.options;if(o.type==="mouseout")return[];if(!a)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(o,s.mode,s,r);return s.reverse&&i.reverse(),i}_positionChanged(o,n){const{caretX:r,caretY:a,options:s}=this,i=fr[s.position].call(this,o,n);return i!==!1&&(r!==i.x||a!==i.y)}}Ae(Vi,"positioners",fr);var eC={id:"tooltip",_element:Vi,positioners:fr,afterInit(t,o,n){n&&(t.tooltip=new Vi({chart:t,options:n}))},beforeUpdate(t,o,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,o,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const o=t.tooltip;if(o&&o._willRender()){const n={tooltip:o};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;o.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,o){if(t.tooltip){const n=o.replay;t.tooltip.handleEvent(o.event,n,o.inChartArea)&&(o.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,o)=>o.bodyFont.size,boxWidth:(t,o)=>o.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:df},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const tC=(t,o,n,r)=>(typeof o=="string"?(n=t.push(o)-1,r.unshift({index:n,label:o})):isNaN(o)&&(n=null),n);function oC(t,o,n,r){const a=t.indexOf(o);if(a===-1)return tC(t,o,n,r);const s=t.lastIndexOf(o);return a!==s?n:a}const nC=(t,o)=>t===null?null:ft(Math.round(t),0,o);function uf(t){const o=this.getLabels();return t>=0&&t<o.length?o[t]:t}class Mi extends En{constructor(o){super(o),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(o){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:a,label:s}of n)r[a]===s&&r.splice(a,1);this._addedLabels=[]}super.init(o)}parse(o,n){if(je(o))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===o?n:oC(r,o,Pe(n,o),this._addedLabels),nC(n,r.length-1)}determineDataLimits(){const{minDefined:o,maxDefined:n}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(o||(r=0),n||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const o=this.min,n=this.max,r=this.options.offset,a=[];let s=this.getLabels();s=o===0&&n===s.length-1?s:s.slice(o,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=o;i<=n;i++)a.push({value:i});return a}getLabelForValue(o){return uf.call(this,o)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(o){return typeof o!="number"&&(o=this.parse(o)),o===null?NaN:this.getPixelForDecimal((o-this._startValue)/this._valueRange)}getPixelForTick(o){const n=this.ticks;return o<0||o>n.length-1?null:this.getPixelForValue(n[o].value)}getValueForPixel(o){return Math.round(this._startValue+this.getDecimalForPixel(o)*this._valueRange)}getBasePixel(){return this.bottom}}Ae(Mi,"id","category"),Ae(Mi,"defaults",{ticks:{callback:uf}});function rC(t,o){const n=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=s||1,p=u-1,{min:b,max:x}=o,g=!je(i),k=!je(l),w=!je(d),E=(x-b)/(f+1);let v=Cd((x-b)/p/m)*m,V,A,S,P;if(v<1e-14&&!g&&!k)return[{value:b},{value:x}];P=Math.ceil(x/v)-Math.floor(b/v),P>p&&(v=Cd(P*v/p/m)*m),je(c)||(V=Math.pow(10,c),v=Math.ceil(v*V)/V),a==="ticks"?(A=Math.floor(b/v)*v,S=Math.ceil(x/v)*v):(A=b,S=x),g&&k&&s&&ik((l-i)/s,v/1e3)?(P=Math.round(Math.min((l-i)/v,u)),v=(l-i)/P,A=i,S=l):w?(A=g?i:A,S=k?l:S,P=d-1,v=(S-A)/P):(P=(S-A)/v,Jn(P,Math.round(P),v/1e3)?P=Math.round(P):P=Math.ceil(P));const B=Math.max(Ed(v),Ed(A));V=Math.pow(10,je(c)?B:c),A=Math.round(A*V)/V,S=Math.round(S*V)/V;let M=0;for(g&&(h&&A!==i?(n.push({value:i}),A<i&&M++,Jn(Math.round((A+M*v)*V)/V,i,ff(i,E,t))&&M++):A<i&&M++);M<P;++M){const C=Math.round((A+M*v)*V)/V;if(k&&C>l)break;n.push({value:C})}return k&&h&&S!==l?n.length&&Jn(n[n.length-1].value,l,ff(l,E,t))?n[n.length-1].value=l:n.push({value:l}):(!k||S===l)&&n.push({value:S}),n}function ff(t,o,{horizontal:n,minRotation:r}){const a=ro(r),s=(n?Math.sin(a):Math.cos(a))||.001,i=.75*o*(""+t).length;return Math.min(o/s,i)}class aC extends En{constructor(o){super(o),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(o,n){return je(o)||(typeof o=="number"||o instanceof Number)&&!isFinite(+o)?null:+o}handleTickRangeOptions(){const{beginAtZero:o}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:a,max:s}=this;const i=c=>a=n?a:c,l=c=>s=r?s:c;if(o){const c=Ut(a),d=Ut(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);l(s+c),o||i(a-c)}this.min=a,this.max=s}getTickLimit(){const o=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=o,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),n=n||11),n&&(a=Math.min(n,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const o=this.options,n=o.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:o.bounds,min:o.min,max:o.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,i=rC(a,s);return o.bounds==="ticks"&&lk(i,this,"value"),o.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const o=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&o.length){const a=(r-n)/Math.max(o.length-1,1)/2;n-=a,r+=a}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(o){return ri(o,this.chart.options.locale,this.options.ticks.format)}}class Ti extends aC{determineDataLimits(){const{min:o,max:n}=this.getMinMax(!0);this.min=ut(o)?o:0,this.max=ut(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const o=this.isHorizontal(),n=o?this.width:this.height,r=ro(this.options.ticks.minRotation),a=(o?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/a))}getPixelForValue(o){return o===null?NaN:this.getPixelForDecimal((o-this._startValue)/this._valueRange)}getValueForPixel(o){return this._startValue+this.getDecimalForPixel(o)*this._valueRange}}Ae(Ti,"id","linear"),Ae(Ti,"defaults",{ticks:{callback:Pd.formatters.numeric}});const Va={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ct=Object.keys(Va);function hf(t,o){return t-o}function mf(t,o){if(je(o))return null;const n=t._adapter,{parser:r,round:a,isoWeekday:s}=t._parseOpts;let i=o;return typeof r=="function"&&(i=r(i)),ut(i)||(i=typeof r=="string"?n.parse(i,r):n.parse(i)),i===null?null:(a&&(i=a==="week"&&(Qn(s)||s===!0)?n.startOf(i,"isoWeek",s):n.startOf(i,a)),+i)}function pf(t,o,n,r){const a=Ct.length;for(let s=Ct.indexOf(t);s<a-1;++s){const i=Va[Ct[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-o)/(l*i.size))<=r)return Ct[s]}return Ct[a-1]}function sC(t,o,n,r,a){for(let s=Ct.length-1;s>=Ct.indexOf(n);s--){const i=Ct[s];if(Va[i].common&&t._adapter.diff(a,r,i)>=o-1)return i}return Ct[n?Ct.indexOf(n):0]}function iC(t){for(let o=Ct.indexOf(t)+1,n=Ct.length;o<n;++o)if(Va[Ct[o]].common)return Ct[o]}function gf(t,o,n){if(!n)t[o]=!0;else if(n.length){const{lo:r,hi:a}=ei(n,o),s=n[r]>=o?n[r]:n[a];t[s]=!0}}function lC(t,o,n,r){const a=t._adapter,s=+a.startOf(o[0].value,r),i=o[o.length-1].value;let l,c;for(l=s;l<=i;l=+a.add(l,1,r))c=n[l],c>=0&&(o[c].major=!0);return o}function bf(t,o,n){const r=[],a={},s=o.length;let i,l;for(i=0;i<s;++i)l=o[i],a[l]=i,r.push({value:l,major:!1});return s===0||!n?r:lC(t,r,a,n)}class Ma extends En{constructor(o){super(o),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(o,n={}){const r=o.time||(o.time={}),a=this._adapter=new Wx._date(o.adapters.date);a.init(n),Xn(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(o),this._normalized=n.normalized}parse(o,n){return o===void 0?null:mf(this,o)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const o=this.options,n=this._adapter,r=o.time.unit||"day";let{min:a,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(a=Math.min(a,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(o.bounds!=="ticks"||o.ticks.source!=="labels")&&c(this.getMinMax(!1))),a=ut(a)&&!isNaN(a)?a:+n.startOf(Date.now(),r),s=ut(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const o=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return o.length&&(n=o[0],r=o[o.length-1]),{min:n,max:r}}buildTicks(){const o=this.options,n=o.time,r=o.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();o.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,i=this.max,l=hk(a,s,i);return this._unit=n.unit||(r.autoSkip?pf(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):sC(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:iC(this._unit),this.initOffsets(a),o.reverse&&l.reverse(),bf(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(o=>+o.value))}initOffsets(o=[]){let n=0,r=0,a,s;this.options.offset&&o.length&&(a=this.getDecimalForValue(o[0]),o.length===1?n=1-a:n=(this.getDecimalForValue(o[1])-a)/2,s=this.getDecimalForValue(o[o.length-1]),o.length===1?r=s:r=(s-this.getDecimalForValue(o[o.length-2]))/2);const i=o.length<3?.5:.25;n=ft(n,0,i),r=ft(r,0,i),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const o=this._adapter,n=this.min,r=this.max,a=this.options,s=a.time,i=s.unit||pf(s.minUnit,n,r,this._getLabelCapacity(n)),l=Pe(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=Qn(c)||c===!0,u={};let f=n,h,m;if(d&&(f=+o.startOf(f,"isoWeek",c)),f=+o.startOf(f,d?"day":i),o.diff(r,n,i)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+i);const p=a.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<r;h=+o.add(h,l,i),m++)gf(u,h,p);return(h===r||a.bounds==="ticks"||m===1)&&gf(u,h,p),Object.keys(u).sort(hf).map(b=>+b)}getLabelForValue(o){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(o,r.tooltipFormat):n.format(o,r.displayFormats.datetime)}format(o,n){const a=this.options.time.displayFormats,s=this._unit,i=n||a[s];return this._adapter.format(o,i)}_tickFormatFunction(o,n,r,a){const s=this.options,i=s.ticks.callback;if(i)return Je(i,[o,n,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=r[n],m=d&&f&&h&&h.major;return this._adapter.format(o,a||(m?f:u))}generateTickLabels(o){let n,r,a;for(n=0,r=o.length;n<r;++n)a=o[n],a.label=this._tickFormatFunction(a.value,n,o)}getDecimalForValue(o){return o===null?NaN:(o-this.min)/(this.max-this.min)}getPixelForValue(o){const n=this._offsets,r=this.getDecimalForValue(o);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(o){const n=this._offsets,r=this.getDecimalForPixel(o)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(o){const n=this.options.ticks,r=this.ctx.measureText(o).width,a=ro(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(a),i=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:r*s+l*i,h:r*i+l*s}}_getLabelCapacity(o){const n=this.options.time,r=n.displayFormats,a=r[n.unit]||r.millisecond,s=this._tickFormatFunction(o,0,bf(this,[o],this._majorUnit),a),i=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return l>0?l:1}getDataTimestamps(){let o=this._cache.data||[],n,r;if(o.length)return o;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(n=0,r=a.length;n<r;++n)o=o.concat(a[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(o)}getLabelTimestamps(){const o=this._cache.labels||[];let n,r;if(o.length)return o;const a=this.getLabels();for(n=0,r=a.length;n<r;++n)o.push(mf(this,a[n]));return this._cache.labels=this._normalized?o:this.normalize(o)}normalize(o){return Dd(o.sort(hf))}}Ae(Ma,"id","time"),Ae(Ma,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ta(t,o,n){let r=0,a=t.length-1,s,i,l,c;n?(o>=t[r].pos&&o<=t[a].pos&&({lo:r,hi:a}=Ho(t,"pos",o)),{pos:s,time:l}=t[r],{pos:i,time:c}=t[a]):(o>=t[r].time&&o<=t[a].time&&({lo:r,hi:a}=Ho(t,"time",o)),{time:s,pos:l}=t[r],{time:i,pos:c}=t[a]);const d=i-s;return d?l+(c-l)*(o-s)/d:l}class yf extends Ma{constructor(o){super(o),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const o=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(o);this._minPos=Ta(n,this.min),this._tableRange=Ta(n,this.max)-this._minPos,super.initOffsets(o)}buildLookupTable(o){const{min:n,max:r}=this,a=[],s=[];let i,l,c,d,u;for(i=0,l=o.length;i<l;++i)d=o[i],d>=n&&d<=r&&a.push(d);if(a.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(i=0,l=a.length;i<l;++i)u=a[i+1],c=a[i-1],d=a[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const o=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(o)||!r.length)&&r.splice(0,0,o),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((a,s)=>a-s)}_getTimestampsForTable(){let o=this._cache.all||[];if(o.length)return o;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?o=this.normalize(n.concat(r)):o=n.length?n:r,o=this._cache.all=o,o}getDecimalForValue(o){return(Ta(this._table,o)-this._minPos)/this._tableRange}getValueForPixel(o){const n=this._offsets,r=this.getDecimalForPixel(o)/n.factor-n.end;return Ta(this._table,r*this._tableRange+this._minPos,!0)}}Ae(yf,"id","timeseries"),Ae(yf,"defaults",Ma.defaults);const cC={key:0,class:"mb-2 text-sm font-medium text-gray-700"},dC={key:0,class:"text-red-500 ml-1"},uC={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},fC={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},hC={class:"text-red-600 text-sm"},mC={key:1,class:"mt-2 text-xs text-gray-500"},pC={key:0},kf=dt(e.defineComponent({name:"DCodeChart",__name:"DCodeChart",props:{type:{default:"line"},width:{default:400},height:{default:300},required:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},error:{default:null},showInfo:{type:Boolean,default:!1},responsive:{type:Boolean,default:!0},maintainAspectRatio:{type:Boolean,default:!1},theme:{default:"light"},colors:{default:()=>["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#6366F1","#84CC16"]},data:{},modelValue:{},options:{},onClick:{},onHover:{},label:{}},emits:["update:modelValue","click","hover","ready"],setup(t,{expose:o,emit:n}){lo.register(Mi,Ti,Da,Do,Aa,ur,Gw,eC,Ww,Lw,ba,ga,yi,Cn);const r=t,a=n,s=e.ref(null),i=e.shallowRef(null),l=e.ref(null),c=e.computed(()=>({"opacity-50 pointer-events-none":r.loading||r.error})),d=()=>{const h=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let p=0;return m.type==="data"&&m.mode==="default"&&(p=m.dataIndex*100+m.datasetIndex*50),p},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:h?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:h?"#1F2937":"#FFFFFF",titleColor:h?"#F3F4F6":"#111827",bodyColor:h?"#D1D5DB":"#4B5563",borderColor:h?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:r.type!=="pie"&&r.type!=="doughnut"&&r.type!=="polarArea"?{x:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}},y:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}}}:void 0}},u=h=>!h||!h.datasets?h:{...h,datasets:h.datasets.map((m,p)=>{const b=p%r.colors.length,x=r.colors[b];let g=m.backgroundColor,k=m.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!g||g.length===0)?m.data&&(g=m.data.map((w,E)=>r.colors[E%r.colors.length]+"80"),k=m.data.map((w,E)=>r.colors[E%r.colors.length])):(g=g||x+"40",k=k||x),{...m,borderColor:k,backgroundColor:g,pointBackgroundColor:m.pointBackgroundColor||x,pointBorderColor:m.pointBorderColor||x,hoverBackgroundColor:m.hoverBackgroundColor||x+"60",hoverBorderColor:m.hoverBorderColor||x}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const h=r.data||r.modelValue;let m=h;if(Array.isArray(h))if(h.length>0&&typeof h[0]=="object"&&h[0]!==null){const b=Object.keys(h[0]),x=b.find(k=>["label","name","x","category","title"].includes(k.toLowerCase()))||b[0],g=b.find(k=>k!==x&&["value","y","count","amount","total","data"].includes(k.toLowerCase()))||b.find(k=>k!==x&&typeof h[0][k]=="number")||(b.length>1?b.find(k=>k!==x):b[0]);m={labels:h.map(k=>k[x||""]),datasets:[{label:r.label||"Data",data:h.map(k=>k[g||""])}]}}else h.length>0?m={labels:h.map((b,x)=>`Data ${x+1}`),datasets:[{label:r.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const p={...d(),...r.options,onClick:(b,x)=>{a("click",b,x),r.onClick&&r.onClick(b,x)},onHover:(b,x)=>{a("hover",b,x),r.onHover&&r.onHover(b,x)}};i.value=new lo(s.value,{type:r.type,data:l.value,options:p}),a("ready",i.value)};return e.watch(()=>[r.data,r.modelValue,r.type,r.options,r.theme],()=>{f()},{deep:!0}),e.watch(()=>[r.width,r.height],()=>{i.value&&i.value.resize()}),e.onMounted(()=>{f()}),e.onUnmounted(()=>{i.value&&i.value.destroy()}),o({chart:i,updateChart:f}),(h,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",cC,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",dC,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"relative",style:e.normalizeStyle({height:t.height+"px"})},[e.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(e.openBlock(),e.createElementBlock("div",uC,[...m[0]||(m[0]=[e.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("div",fC,[e.createElementVNode("div",hC,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",mC,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",pC,e.toDisplayString(l.value.datasets.length)+" dataset(s) • "+e.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),hr=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const o=t,n=ot.reactiveOmit(o,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Ne.Label),e.mergeProps(e.unref(n),{class:e.unref($e)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",o.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),gC={key:0,class:"ml-1 text-destructive"},bC=["aria-busy"],yC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},kC={key:1,class:"flex items-center"},xC=["id","checked","indeterminate","disabled","required"],en=dt(e.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{id:{default:""},label:{default:""},title:{default:""},required:{type:Boolean,default:!1},modelValue:{type:[Boolean,null]},checked:{type:[Boolean,null]},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:o}){const n=e.useAttrs(),r=o,a=t,s=e.computed(()=>a.visible??!0),i=e.computed(()=>a.required),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-checkbox-${a.id||a.label||"checkbox"}-${l}`),d=e.ref(!!(a.modelValue??a.checked));e.watch(()=>[a.modelValue,a.checked],([h,m])=>{d.value=!!(h??m)},{immediate:!0});const u=()=>{if(a.disabled||a.readonly)return;const h=!d.value;d.value=h,r("update:modelValue",h),r("change",h)},f=h=>{(h.key===" "||h.key==="Enter")&&(h.preventDefault(),u())};return(h,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-1.5",a.disabled?"cursor-not-allowed":""])},[t.label?(e.openBlock(),e.createBlock(hr,{key:0,class:"text-sm font-medium mb-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",gC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(n).class,{"opacity-60 cursor-not-allowed":t.disabled}]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",yC)):e.createCommentVNode("",!0),m[0]||(m[0]=e.createElementVNode("div",{class:"flex items-center gap-2.5"},[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(e.openBlock(),e.createElementBlock("div",kC,[e.createElementVNode("label",{class:e.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!t.disabled&&!t.readonly,"opacity-50 cursor-not-allowed":t.disabled,"cursor-default opacity-80":t.readonly}])},[e.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:t.indeterminate,disabled:t.disabled,required:i.value,onChange:u,onKeydown:f},null,40,xC),e.createElementVNode("div",{class:e.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-all focus:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-neutral-400 dark:peer-focus-visible:ring-neutral-600 peer-focus-visible:ring-offset-2 flex items-center justify-center",[d.value||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800",t.disabled?"cursor-not-allowed":t.readonly?"cursor-default":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!t.indeterminate?(e.openBlock(),e.createBlock(e.unref(pe.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(pe.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):e.createCommentVNode("",!0)],2),t.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[t.disabled?"text-gray-400 dark:text-gray-500":"text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100"]])},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0)],2)]))],10,bC),[[e.vShow,s.value]])],2))}}),[["__scopeId","data-v-cc52c77a"]]),wC={class:"w-full"},CC={key:0,class:"mb-4"},EC={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},SC={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},_C={key:0,class:"ml-1 text-destructive"},BC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},DC={key:1,class:"flex flex-wrap gap-4"},AC={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},vC={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},NC={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},Pi=dt(e.defineComponent({name:"DCodeCardCheckboxList",inheritAttrs:!1,__name:"DCodeCardCheckboxList",props:{modelValue:{default:()=>[]},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},items:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},apiModule:{},apiAction:{},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""},columns:{default:2},apiParams:{default:()=>({})},returnArray:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:o}){e.useAttrs();const{apiUrl:n,DCodeApi:r}=e.inject("externalApi")||{},a=o,s=t,i=e.ref(new Set);e.watch(()=>s.modelValue,V=>{if(!V){i.value=new Set;return}const A=V.map(S=>typeof S=="object"&&S!==null?S.id!==void 0?S.id:S.value:S);i.value=new Set(A)},{immediate:!0,deep:!0});const l=e.ref([]),c=e.ref(!1),d=e.ref(null),u=async()=>{var A,S;const V=((A=s.endpoint)==null?void 0:A.apiUrl)||s.apiUrl;if(!(!V&&!s.apiModule&&!s.apiAction)){c.value=!0,d.value=null;try{let P;const B=((S=s.endpoint)==null?void 0:S.apiMethod)||s.apiMethod||"GET",M={page:1,perPage:100,...s.apiParams};V?P=await n(V,B,M):s.apiModule&&s.apiAction&&r&&(P=await r(s.apiModule,s.apiAction,M));let C=P;s.dataPath?C=s.dataPath.split(".").reduce(($,U)=>$&&$[U]!==void 0?$[U]:void 0,P):typeof P=="object"&&!Array.isArray(P)&&P.data&&(C=P.data),Array.isArray(C)?l.value=C:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),d.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(P){console.error("DCodeCardCheckboxList fetch error:",P),d.value="Gagal memuat data dari endpoint."}finally{c.value=!1}}},f=e.ref(!1);let h=null;const m=()=>{typeof document<"u"&&(f.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var V;((V=s.endpoint)!=null&&V.apiUrl||s.apiUrl||s.apiModule&&s.apiAction)&&u(),m(),typeof document<"u"&&(h=new MutationObserver(m),h.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),h.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{h&&h.disconnect()});const p=e.computed(()=>s.options&&s.options.length>0?s.options:s.items&&s.items.length>0?s.items:l.value),b=V=>{if(typeof V!="object"||V===null)return V;const A=s.itemValue||s.model||"id";return V[A]},x=V=>{if(typeof V!="object"||V===null)return String(V);const A=s.itemTitle||"name";return V[A]},g=V=>i.value.has(V),k=(V,A)=>{if(s.disabled)return;const S=new Set(i.value);A?S.add(V):S.delete(V),i.value=S;const P=Array.from(i.value);a("update:modelValue",P),a("change",P)};e.watch(()=>{var V;return((V=s.endpoint)==null?void 0:V.apiUrl)||s.apiUrl},(V,A)=>{V&&V!==A&&u()});const w=e.computed(()=>s.skeleton||c.value),E=e.computed(()=>!!s.error||!!d.value),v=e.computed(()=>s.error||d.value);return(V,A)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",wC,[t.label||w.value?(e.openBlock(),e.createElementBlock("div",CC,[w.value?(e.openBlock(),e.createElementBlock("div",EC)):(e.openBlock(),e.createElementBlock("h3",SC,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",_C,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",BC,[e.createVNode(e.unref(pe.Loader2),{class:"w-4 h-4 animate-spin"}),A[0]||(A[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("div",DC,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,S=>e.createElementVNode("div",{key:`skeleton-${S}`,class:"flex items-center gap-2.5 min-w-[120px]"},[...A[1]||(A[1]=[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])),64))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[p.value.length===0?(e.openBlock(),e.createElementBlock("div",AC," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",vC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(S,P)=>(e.openBlock(),e.createElementBlock("div",{key:P,class:"flex items-start"},[e.createVNode(en,{"model-value":g(b(S)),title:x(S),disabled:t.disabled,"onUpdate:modelValue":B=>k(b(S),B)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),E.value&&v.value?(e.openBlock(),e.createElementBlock("div",NC,[e.createVNode(e.unref(pe.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(v.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-9fb8103d"]]),VC=["aria-busy"],MC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},TC={key:1,class:"flex justify-end"},PC=["for"],OC={key:0,class:"ml-1 text-destructive"},FC={class:"relative w-full group"},RC={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700 flex-shrink-0"},LC={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},$C=["id","disabled","readonly","placeholder"],IC={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},zC={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Oi=e.defineComponent({name:"DCodeCurrencyField",inheritAttrs:!1,__name:"DCodeCurrencyField",props:{modelValue:{},currency:{default:"IDR"},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},prependInner:{},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},minValue:{},maxValue:{}},emits:["update:modelValue","clear"],setup(t,{emit:o}){const n=e.useAttrs(),r=o,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-currency-field-${n.id||a.label||"currency-field"}-${s}`),l=e.computed(()=>{const C=n.required,F=n["aria-required"];return C===""||C===!0||C==="true"||(F==="true"||F===!0)}),c=e.computed(()=>{const C=n.maxlength??n.maxLength;let F=Number.NaN;return typeof C=="number"?F=C:typeof C=="string"&&(F=Number.parseInt(C,10)),Number.isFinite(F)&&F>0?F:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>a.prependInner?a.prependInner:a.currency==="USD"?"$":a.currency==="IDR"?"Rp":a.currency),f=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=C=>{const F=C.replaceAll(/\D/g,"");return F?Number(F):null},m=C=>f.value.format(C),p=e.ref(""),b=e.ref(null);e.watch(()=>a.modelValue,C=>{C==null?p.value="":h(p.value)!==C&&(p.value=m(C))},{immediate:!0});const x=(C,F)=>{let $=0;for(let U=0;U<F;U++)/\d/.test(C[U])&&$++;return $},g=(C,F)=>{let $=0;for(let U=0;U<C.length;U++)if(/\d/.test(C[U])&&($++,$===F))return U+1;return C.length},k=C=>{const F=C.target,$=F.value,U=F.selectionStart??$.length,W=$.replace(/\D/g,"");if(W===""){p.value="",r("update:modelValue",null);return}let y=W;c.value&&W.length>c.value&&(y=W.slice(0,c.value));const D=Number(y),T=m(D);if($!==T){const N=x($,U);p.value=T,e.nextTick(()=>{if(b.value){const O=g(T,N);b.value.setSelectionRange(O,O)}})}r("update:modelValue",D)},w=()=>{p.value="",r("update:modelValue",null),r("clear")},E=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?p.value.length>0:!0),v=e.computed(()=>!!a.error||!!V.value),V=e.computed(()=>{if(a.modelValue===null||a.modelValue===void 0)return null;const C=a.modelValue;return a.minValue!==void 0&&a.minValue!==null&&C<a.minValue?`Minimum value is ${u.value} ${m(a.minValue)}`:a.maxValue!==void 0&&a.maxValue!==null&&C>a.maxValue?`Maximum value is ${u.value} ${m(a.maxValue)}`:null}),A=e.computed(()=>{const{class:C,maxlength:F,maxLength:$,...U}=n;return U}),S=e.computed(()=>p.value.replace(/\D/g,"").length),P=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),B=e.computed(()=>P.value&&S.value>0),M=e.computed(()=>`${S.value} / ${c.value}`);return(C,F)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",[e.unref(n).class,a.disabled?"cursor-not-allowed":""]]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",MC)):e.createCommentVNode("",!0),F[2]||(F[2]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),P.value?(e.openBlock(),e.createElementBlock("div",TC,[...F[1]||(F[1]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",OC,"*")):e.createCommentVNode("",!0)],8,PC)):e.createCommentVNode("",!0),e.createElementVNode("div",FC,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50",v.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-neutral-400 focus-within:ring-1 focus-within:ring-neutral-400 dark:focus-within:border-neutral-600 dark:focus-within:ring-neutral-600",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":"",a.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":""])},[e.createElementVNode("div",RC,[e.createElementVNode("span",LC,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:b,"onUpdate:modelValue":F[0]||(F[0]=$=>p.value=$),onInput:k,type:"text",inputmode:"numeric"},A.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.placeholder,class:["flex-1 min-w-0 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400",E.value?"pr-8":""]}),null,16,$C),[[e.vModelText,p.value]]),E.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:w},[e.createVNode(e.unref(pe.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),B.value?(e.openBlock(),e.createElementBlock("p",IC,e.toDisplayString(M.value),1)):e.createCommentVNode("",!0)]),v.value?(e.openBlock(),e.createElementBlock("p",zC,[e.createVNode(e.unref(pe.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(V.value||a.error),1)])):e.createCommentVNode("",!0)],64))],10,VC))}}),jC=["aria-busy"],UC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},WC={key:1,class:"flex justify-end"},HC=["for"],GC={key:0,class:"ml-1 text-destructive"},qC={class:"relative w-full group"},KC=["id","value","disabled","readonly","placeholder"],XC={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-l border-gray-300 dark:border-gray-700"},YC={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},JC={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},QC={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Fi=e.defineComponent({name:"DCodePercentField",inheritAttrs:!1,__name:"DCodePercentField",props:{modelValue:{},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},suffix:{default:"%"},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},minValue:{default:0},maxValue:{default:100},minLength:{default:0},maxLength:{default:10},returnNumber:{type:Boolean,default:!1}},emits:["update:modelValue","clear"],setup(t,{emit:o}){const n=e.useAttrs(),r=o,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-percent-field-${n.id||a.label||"percent-field"}-${s}`),l=e.computed(()=>{const M=n.required,C=n["aria-required"];return M===""||M===!0||M==="true"||(C==="true"||C===!0)}),c=e.computed(()=>{const M=n.maxlength??n.maxLength;let C=Number.NaN;return typeof M=="number"?C=M:typeof M=="string"&&(C=Number.parseInt(M,10)),Number.isFinite(C)&&C>0?C:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",useGrouping:!1,minimumFractionDigits:0,maximumFractionDigits:a.maxLength||20})),f=M=>{const F=d.value==="id-ID"||d.value==="id"?M.replace(/[^0-9,]/g,"").replace(",","."):M.replace(/[^0-9.]/g,"");if(!F)return null;const $=Number(F);return isNaN($)?null:$},h=M=>u.value.format(M),m=e.ref(""),p=e.ref(null);e.watch(()=>a.modelValue,M=>{if(M==null||M==="")m.value="";else{const C=typeof M=="string"?Number(M):M;f(m.value)!==C&&(m.value=h(C))}},{immediate:!0});const b=M=>{const C=M.target,F=C.value;C.selectionStart??F.length;const $=d.value==="id-ID"||d.value==="id",U=$?",":".",W=$?".":",";let y=F.replace(W,U),D=$?y.replace(/[^0-9,]/g,""):y.replace(/[^0-9.]/g,"");const T=D.split(U);if(T.length>2&&(D=T[0]+U+T.slice(1).join("")),T.length===2&&T[1].length>10&&(D=T[0]+U+T[1].slice(0,10)),a.maxLength&&D.replace(U,"").length>a.maxLength)if(D.includes(U)){const R=D.indexOf(U),z=D.slice(0,R),q=D.slice(R+1);if(z.length>=a.maxLength)D=z.slice(0,a.maxLength);else{const Y=a.maxLength-z.length;D=z+U+q.slice(0,Y)}}else D=D.slice(0,a.maxLength);if(!D.includes(U)&&D.length>1&&D.startsWith("0")&&(D=D.replace(/^0+/,"")||"0"),D===""||D===U){m.value=D,r("update:modelValue",null);return}const N=f(D);if(N===null)return;h(N),m.value=D;const O=a.returnNumber?N:N!==null?String(N):null;r("update:modelValue",O),e.nextTick(()=>{p.value&&p.value.value!==m.value&&(p.value.value=m.value)})},x=M=>{if(["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","Home","End"].includes(M.key)||(M.ctrlKey||M.metaKey)&&["a","c","v","x"].includes(M.key.toLowerCase()))return;const F=d.value==="id-ID"||d.value==="id",$=F?",":".",U=F?".":",";if(M.key===$||M.key===U){m.value.includes($)&&M.preventDefault();return}/^[0-9]$/.test(M.key)||M.preventDefault()},g=()=>{},k=()=>{m.value="",r("update:modelValue",null),r("clear")},w=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?m.value.length>0:!0),E=e.computed(()=>!!a.error||!!v.value),v=e.computed(()=>{if(a.modelValue===null||a.modelValue===void 0||a.modelValue==="")return null;const M=typeof a.modelValue=="string"?Number(a.modelValue):a.modelValue;return a.minValue!==void 0&&a.minValue!==null&&M<a.minValue?`Minimum value is ${a.minValue}${a.suffix}`:a.maxValue!==void 0&&a.maxValue!==null&&M>a.maxValue?`Maximum value is ${a.maxValue}${a.suffix}`:null}),V=e.computed(()=>{const{class:M,maxlength:C,maxLength:F,...$}=n;return $}),A=e.computed(()=>m.value.replace(/[^0-9]/g,"").length),S=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),P=e.computed(()=>S.value&&A.value>0),B=e.computed(()=>`${A.value} / ${c.value}`);return(M,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",[e.unref(n).class,a.disabled?"cursor-not-allowed":""]]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",UC)):e.createCommentVNode("",!0),C[1]||(C[1]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),S.value?(e.openBlock(),e.createElementBlock("div",WC,[...C[0]||(C[0]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",GC,"*")):e.createCommentVNode("",!0)],8,HC)):e.createCommentVNode("",!0),e.createElementVNode("div",qC,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50",E.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-neutral-400 focus-within:ring-1 focus-within:ring-neutral-400 dark:focus-within:border-neutral-600 dark:focus-within:ring-neutral-600",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":"",a.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":""])},[e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:p,value:m.value,onInput:b,onKeydown:x,onBlur:g,type:"text",inputmode:"decimal"},V.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.placeholder,class:["flex-1 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400"]}),null,16,KC),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:k},[e.createVNode(e.unref(pe.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0),e.createElementVNode("div",XC,[e.createElementVNode("span",YC,e.toDisplayString(t.suffix),1)])],2),P.value?(e.openBlock(),e.createElementBlock("p",JC,e.toDisplayString(B.value),1)):e.createCommentVNode("",!0)]),E.value?(e.openBlock(),e.createElementBlock("p",QC,[e.createVNode(e.unref(pe.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(v.value||a.error),1)])):e.createCommentVNode("",!0)],64))],10,jC))}}),xf=6048e5,ZC=864e5,wf=6e4,Cf=36e5,Ef=Symbol.for("constructDateFrom");function uo(t,o){return typeof t=="function"?t(o):t&&typeof t=="object"&&Ef in t?t[Ef](o):t instanceof Date?new t.constructor(o):new Date(o)}function Dt(t,o){return uo(o||t,t)}let e2={};function Pa(){return e2}function mr(t,o){var l,c,d,u;const n=Pa(),r=(o==null?void 0:o.weekStartsOn)??((c=(l=o==null?void 0:o.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=Dt(t,o==null?void 0:o.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function Oa(t,o){return mr(t,{...o,weekStartsOn:1})}function Sf(t,o){const n=Dt(t,o==null?void 0:o.in),r=n.getFullYear(),a=uo(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=Oa(a),i=uo(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=Oa(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function _f(t){const o=Dt(t),n=new Date(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()));return n.setUTCFullYear(o.getFullYear()),+t-+n}function t2(t,...o){const n=uo.bind(null,o.find(r=>typeof r=="object"));return o.map(n)}function Bf(t,o){const n=Dt(t,o==null?void 0:o.in);return n.setHours(0,0,0,0),n}function o2(t,o,n){const[r,a]=t2(n==null?void 0:n.in,t,o),s=Bf(r),i=Bf(a),l=+s-_f(s),c=+i-_f(i);return Math.round((l-c)/ZC)}function n2(t,o){const n=Sf(t,o),r=uo(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Oa(r)}function r2(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function a2(t){return!(!r2(t)&&typeof t!="number"||isNaN(+Dt(t)))}function s2(t,o){const n=Dt(t,o==null?void 0:o.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const i2={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},l2=(t,o,n)=>{let r;const a=i2[t];return typeof a=="string"?r=a:o===1?r=a.one:r=a.other.replace("{{count}}",o.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function _n(t){return(o={})=>{const n=o.width?String(o.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const c2={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},d2={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},u2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},f2={date:_n({formats:c2,defaultWidth:"full"}),time:_n({formats:d2,defaultWidth:"full"}),dateTime:_n({formats:u2,defaultWidth:"full"})},h2={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},m2=(t,o,n,r)=>h2[t];function Gt(t){return(o,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):i;a=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(o):o;return a[s]}}const p2={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},g2={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},b2={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},y2={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},k2={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},x2={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},w2={ordinalNumber:(t,o)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Gt({values:p2,defaultWidth:"wide"}),quarter:Gt({values:g2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Gt({values:b2,defaultWidth:"wide"}),day:Gt({values:y2,defaultWidth:"wide"}),dayPeriod:Gt({values:k2,defaultWidth:"wide",formattingValues:x2,defaultFormattingWidth:"wide"})};function qt(t){return(o,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=o.match(a);if(!s)return null;const i=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?E2(l,f=>f.test(i)):C2(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=o.slice(i.length);return{value:d,rest:u}}}function C2(t,o){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&o(t[n]))return n}function E2(t,o){for(let n=0;n<t.length;n++)if(o(t[n]))return n}function Df(t){return(o,n={})=>{const r=o.match(t.matchPattern);if(!r)return null;const a=r[0],s=o.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const l=o.slice(a.length);return{value:i,rest:l}}}const S2=/^(\d+)(th|st|nd|rd)?/i,_2=/\d+/i,B2={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},D2={any:[/^b/i,/^(a|c)/i]},A2={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},v2={any:[/1/i,/2/i,/3/i,/4/i]},N2={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},V2={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},M2={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},T2={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},P2={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},O2={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},F2={ordinalNumber:Df({matchPattern:S2,parsePattern:_2,valueCallback:t=>parseInt(t,10)}),era:qt({matchPatterns:B2,defaultMatchWidth:"wide",parsePatterns:D2,defaultParseWidth:"any"}),quarter:qt({matchPatterns:A2,defaultMatchWidth:"wide",parsePatterns:v2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:qt({matchPatterns:N2,defaultMatchWidth:"wide",parsePatterns:V2,defaultParseWidth:"any"}),day:qt({matchPatterns:M2,defaultMatchWidth:"wide",parsePatterns:T2,defaultParseWidth:"any"}),dayPeriod:qt({matchPatterns:P2,defaultMatchWidth:"any",parsePatterns:O2,defaultParseWidth:"any"})},Ri={code:"en-US",formatDistance:l2,formatLong:f2,formatRelative:m2,localize:w2,match:F2,options:{weekStartsOn:0,firstWeekContainsDate:1}};function R2(t,o){const n=Dt(t,o==null?void 0:o.in);return o2(n,s2(n))+1}function L2(t,o){const n=Dt(t,o==null?void 0:o.in),r=+Oa(n)-+n2(n);return Math.round(r/xf)+1}function Af(t,o){var u,f,h,m;const n=Dt(t,o==null?void 0:o.in),r=n.getFullYear(),a=Pa(),s=(o==null?void 0:o.firstWeekContainsDate)??((f=(u=o==null?void 0:o.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=uo((o==null?void 0:o.in)||t,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=mr(i,o),c=uo((o==null?void 0:o.in)||t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=mr(c,o);return+n>=+l?r+1:+n>=+d?r:r-1}function $2(t,o){var l,c,d,u;const n=Pa(),r=(o==null?void 0:o.firstWeekContainsDate)??((c=(l=o==null?void 0:o.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=Af(t,o),s=uo((o==null?void 0:o.in)||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),mr(s,o)}function I2(t,o){const n=Dt(t,o==null?void 0:o.in),r=+mr(n,o)-+$2(n,o);return Math.round(r/xf)+1}function Ge(t,o){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(o,"0");return n+r}const vo={y(t,o){const n=t.getFullYear(),r=n>0?n:1-n;return Ge(o==="yy"?r%100:r,o.length)},M(t,o){const n=t.getMonth();return o==="M"?String(n+1):Ge(n+1,2)},d(t,o){return Ge(t.getDate(),o.length)},a(t,o){const n=t.getHours()/12>=1?"pm":"am";switch(o){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,o){return Ge(t.getHours()%12||12,o.length)},H(t,o){return Ge(t.getHours(),o.length)},m(t,o){return Ge(t.getMinutes(),o.length)},s(t,o){return Ge(t.getSeconds(),o.length)},S(t,o){const n=o.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Ge(a,o.length)}},Bn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vf={G:function(t,o,n){const r=t.getFullYear()>0?1:0;switch(o){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,o,n){if(o==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return vo.y(t,o)},Y:function(t,o,n,r){const a=Af(t,r),s=a>0?a:1-a;if(o==="YY"){const i=s%100;return Ge(i,2)}return o==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ge(s,o.length)},R:function(t,o){const n=Sf(t);return Ge(n,o.length)},u:function(t,o){const n=t.getFullYear();return Ge(n,o.length)},Q:function(t,o,n){const r=Math.ceil((t.getMonth()+1)/3);switch(o){case"Q":return String(r);case"QQ":return Ge(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,o,n){const r=Math.ceil((t.getMonth()+1)/3);switch(o){case"q":return String(r);case"qq":return Ge(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,o,n){const r=t.getMonth();switch(o){case"M":case"MM":return vo.M(t,o);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,o,n){const r=t.getMonth();switch(o){case"L":return String(r+1);case"LL":return Ge(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,o,n,r){const a=I2(t,r);return o==="wo"?n.ordinalNumber(a,{unit:"week"}):Ge(a,o.length)},I:function(t,o,n){const r=L2(t);return o==="Io"?n.ordinalNumber(r,{unit:"week"}):Ge(r,o.length)},d:function(t,o,n){return o==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):vo.d(t,o)},D:function(t,o,n){const r=R2(t);return o==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ge(r,o.length)},E:function(t,o,n){const r=t.getDay();switch(o){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,o,n,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(o){case"e":return String(s);case"ee":return Ge(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,o,n,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(o){case"c":return String(s);case"cc":return Ge(s,o.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,o,n){const r=t.getDay(),a=r===0?7:r;switch(o){case"i":return String(a);case"ii":return Ge(a,o.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,o,n){const a=t.getHours()/12>=1?"pm":"am";switch(o){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,o,n){const r=t.getHours();let a;switch(r===12?a=Bn.noon:r===0?a=Bn.midnight:a=r/12>=1?"pm":"am",o){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,o,n){const r=t.getHours();let a;switch(r>=17?a=Bn.evening:r>=12?a=Bn.afternoon:r>=4?a=Bn.morning:a=Bn.night,o){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,o,n){if(o==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return vo.h(t,o)},H:function(t,o,n){return o==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):vo.H(t,o)},K:function(t,o,n){const r=t.getHours()%12;return o==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,o.length)},k:function(t,o,n){let r=t.getHours();return r===0&&(r=24),o==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,o.length)},m:function(t,o,n){return o==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):vo.m(t,o)},s:function(t,o,n){return o==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):vo.s(t,o)},S:function(t,o){return vo.S(t,o)},X:function(t,o,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(o){case"X":return Vf(r);case"XXXX":case"XX":return tn(r);case"XXXXX":case"XXX":default:return tn(r,":")}},x:function(t,o,n){const r=t.getTimezoneOffset();switch(o){case"x":return Vf(r);case"xxxx":case"xx":return tn(r);case"xxxxx":case"xxx":default:return tn(r,":")}},O:function(t,o,n){const r=t.getTimezoneOffset();switch(o){case"O":case"OO":case"OOO":return"GMT"+Nf(r,":");case"OOOO":default:return"GMT"+tn(r,":")}},z:function(t,o,n){const r=t.getTimezoneOffset();switch(o){case"z":case"zz":case"zzz":return"GMT"+Nf(r,":");case"zzzz":default:return"GMT"+tn(r,":")}},t:function(t,o,n){const r=Math.trunc(+t/1e3);return Ge(r,o.length)},T:function(t,o,n){return Ge(+t,o.length)}};function Nf(t,o=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?n+String(a):n+String(a)+o+Ge(s,2)}function Vf(t,o){return t%60===0?(t>0?"-":"+")+Ge(Math.abs(t)/60,2):tn(t,o)}function tn(t,o=""){const n=t>0?"-":"+",r=Math.abs(t),a=Ge(Math.trunc(r/60),2),s=Ge(r%60,2);return n+a+o+s}const Mf=(t,o)=>{switch(t){case"P":return o.date({width:"short"});case"PP":return o.date({width:"medium"});case"PPP":return o.date({width:"long"});case"PPPP":default:return o.date({width:"full"})}},Tf=(t,o)=>{switch(t){case"p":return o.time({width:"short"});case"pp":return o.time({width:"medium"});case"ppp":return o.time({width:"long"});case"pppp":default:return o.time({width:"full"})}},z2={p:Tf,P:(t,o)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Mf(t,o);let s;switch(r){case"P":s=o.dateTime({width:"short"});break;case"PP":s=o.dateTime({width:"medium"});break;case"PPP":s=o.dateTime({width:"long"});break;case"PPPP":default:s=o.dateTime({width:"full"});break}return s.replace("{{date}}",Mf(r,o)).replace("{{time}}",Tf(a,o))}},j2=/^D+$/,U2=/^Y+$/,W2=["D","DD","YY","YYYY"];function H2(t){return j2.test(t)}function G2(t){return U2.test(t)}function q2(t,o,n){const r=K2(t,o,n);if(console.warn(r),W2.includes(t))throw new RangeError(r)}function K2(t,o,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${o}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const X2=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Y2=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J2=/^'([^]*?)'?$/,Q2=/''/g,Z2=/[a-zA-Z]/;function Pf(t,o,n){var u,f,h,m;const r=Pa(),a=r.locale??Ri,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=Dt(t,n==null?void 0:n.in);if(!a2(l))throw new RangeError("Invalid time value");let c=o.match(Y2).map(p=>{const b=p[0];if(b==="p"||b==="P"){const x=z2[b];return x(p,a.formatLong)}return p}).join("").match(X2).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const b=p[0];if(b==="'")return{isToken:!1,value:eE(p)};if(vf[b])return{isToken:!0,value:p};if(b.match(Z2))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:p}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(p=>{if(!p.isToken)return p.value;const b=p.value;(G2(b)||H2(b))&&q2(b,o,String(t));const x=vf[b[0]];return x(l,b,a.localize,d)}).join("")}function eE(t){const o=t.match(J2);return o?o[1].replace(Q2,"'"):t}function Of(t,o){const n=()=>uo(o==null?void 0:o.in,NaN),a=rE(t);let s;if(a.date){const d=aE(a.date,2);s=sE(d.restDateString,d.year)}if(!s||isNaN(+s))return n();const i=+s;let l=0,c;if(a.time&&(l=iE(a.time),isNaN(l)))return n();if(a.timezone){if(c=lE(a.timezone),isNaN(c))return n()}else{const d=new Date(i+l),u=Dt(0,o==null?void 0:o.in);return u.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),u.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),u}return Dt(i+l+c,o==null?void 0:o.in)}const Fa={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},tE=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,oE=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nE=/^([+-])(\d{2})(?::?(\d{2}))?$/;function rE(t){const o={},n=t.split(Fa.dateTimeDelimiter);let r;if(n.length>2)return o;if(/:/.test(n[0])?r=n[0]:(o.date=n[0],r=n[1],Fa.timeZoneDelimiter.test(o.date)&&(o.date=t.split(Fa.timeZoneDelimiter)[0],r=t.substr(o.date.length,t.length))),r){const a=Fa.timezone.exec(r);a?(o.time=r.replace(a[1],""),o.timezone=a[1]):o.time=r}return o}function aE(t,o){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+o)+"})|(\\d{2}|[+-]\\d{"+(2+o)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,s=r[2]?parseInt(r[2]):null;return{year:s===null?a:s*100,restDateString:t.slice((r[1]||r[2]).length)}}function sE(t,o){if(o===null)return new Date(NaN);const n=t.match(tE);if(!n)return new Date(NaN);const r=!!n[4],a=pr(n[1]),s=pr(n[2])-1,i=pr(n[3]),l=pr(n[4]),c=pr(n[5])-1;if(r)return hE(o,l,c)?cE(o,l,c):new Date(NaN);{const d=new Date(0);return!uE(o,s,i)||!fE(o,a)?new Date(NaN):(d.setUTCFullYear(o,s,Math.max(a,i)),d)}}function pr(t){return t?parseInt(t):1}function iE(t){const o=t.match(oE);if(!o)return NaN;const n=Li(o[1]),r=Li(o[2]),a=Li(o[3]);return mE(n,r,a)?n*Cf+r*wf+a*1e3:NaN}function Li(t){return t&&parseFloat(t.replace(",","."))||0}function lE(t){if(t==="Z")return 0;const o=t.match(nE);if(!o)return 0;const n=o[1]==="+"?-1:1,r=parseInt(o[2]),a=o[3]&&parseInt(o[3])||0;return pE(r,a)?n*(r*Cf+a*wf):NaN}function cE(t,o,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,s=(o-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+s),r}const dE=[31,null,31,30,31,30,31,31,30,31,30,31];function Ff(t){return t%400===0||t%4===0&&t%100!==0}function uE(t,o,n){return o>=0&&o<=11&&n>=1&&n<=(dE[o]||(Ff(t)?29:28))}function fE(t,o){return o>=1&&o<=(Ff(t)?366:365)}function hE(t,o,n){return o>=1&&o<=53&&n>=0&&n<=6}function mE(t,o,n){return t===24?o===0&&n===0:n>=0&&n<60&&o>=0&&o<60&&t>=0&&t<25}function pE(t,o){return o>=0&&o<=59}const gE={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},bE=(t,o,n)=>{let r;const a=gE[t];return typeof a=="string"?r=a:o===1?r=a.one:r=a.other.replace("{{count}}",o.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"dalam waktu "+r:r+" yang lalu":r},yE={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},kE={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},xE={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wE={date:_n({formats:yE,defaultWidth:"full"}),time:_n({formats:kE,defaultWidth:"full"}),dateTime:_n({formats:xE,defaultWidth:"full"})},CE={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},EE=(t,o,n,r)=>CE[t],SE={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},_E={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},BE={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},DE={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},AE={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},vE={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},NE={ordinalNumber:(t,o)=>"ke-"+Number(t),era:Gt({values:SE,defaultWidth:"wide"}),quarter:Gt({values:_E,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Gt({values:BE,defaultWidth:"wide"}),day:Gt({values:DE,defaultWidth:"wide"}),dayPeriod:Gt({values:AE,defaultWidth:"wide",formattingValues:vE,defaultFormattingWidth:"wide"})},VE=/^ke-(\d+)?/i,ME=/\d+/i,TE={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},PE={any:[/^s/i,/^(m|e)/i]},OE={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},FE={any:[/1/i,/2/i,/3/i,/4/i]},RE={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},LE={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},$E={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},IE={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},zE={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},jE={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},UE={ordinalNumber:Df({matchPattern:VE,parsePattern:ME,valueCallback:t=>parseInt(t,10)}),era:qt({matchPatterns:TE,defaultMatchWidth:"wide",parsePatterns:PE,defaultParseWidth:"any"}),quarter:qt({matchPatterns:OE,defaultMatchWidth:"wide",parsePatterns:FE,defaultParseWidth:"any",valueCallback:t=>t+1}),month:qt({matchPatterns:RE,defaultMatchWidth:"wide",parsePatterns:LE,defaultParseWidth:"any"}),day:qt({matchPatterns:$E,defaultMatchWidth:"wide",parsePatterns:IE,defaultParseWidth:"any"}),dayPeriod:qt({matchPatterns:zE,defaultMatchWidth:"any",parsePatterns:jE,defaultParseWidth:"any"})},Rf={code:"id",formatDistance:bE,formatLong:wE,formatRelative:EE,localize:NE,match:UE,options:{weekStartsOn:1,firstWeekContainsDate:1}},Lf={primary:{light:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",selectedHover:"hsl(var(--primary) / 0.9)",selectedText:"hsl(var(--primary-foreground))",border:"hsl(var(--border))",range:"#bfdbfe"},dark:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent) /0.5)",selectedHover:"hsl(var(--primary) / 0.9)",selectedText:"#ffffff",border:"hsl(var(--border))",range:"rgba(30, 58, 138, 0.3)"}},emerald:{light:{primary:"#16a34a",text:"#ffffff",hover:"#dcfce7",selectedHover:"#15803d",selectedText:"#ffffff",border:"#16a34a",range:"#ecfdf5"},dark:{primary:"#22c55e",text:"#0b1220",hover:"#14532d",selectedHover:"#16a34a",selectedText:"#ffffff",border:"#22c55e",range:"rgba(6, 78, 59, 0.3)"}},amber:{light:{primary:"#d97706",text:"#ffffff",hover:"#fffbeb",selectedHover:"#b45309",selectedText:"#ffffff",border:"#d97706",range:"#fffbeb"},dark:{primary:"#f59e0b",text:"#0b1220",hover:"#78350f",selectedHover:"#d97706",selectedText:"#0b1220",border:"#f59e0b",range:"rgba(120, 53, 15, 0.3)"}},violet:{light:{primary:"#7c3aed",text:"#ffffff",hover:"#f5f3ff",selectedHover:"#6d28d9",selectedText:"#ffffff",border:"#7c3aed",range:"#f5f3ff"},dark:{primary:"#8b5cf6",text:"#0b1220",hover:"#2e1065",selectedHover:"#7c3aed",selectedText:"#ffffff",border:"#8b5cf6",range:"rgba(46, 16, 101, 0.3)"}},destructive:{light:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.10)",selectedHover:"hsl(var(--destructive) / 0.8)",selectedText:"hsl(var(--destructive-foreground))",border:"hsl(var(--destructive))",range:"#fef2f2"},dark:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.18)",selectedHover:"hsl(var(--destructive) / 0.7)",selectedText:"hsl(var(--destructive-foreground))",border:"hsl(var(--destructive))",range:"rgba(127, 29, 29, 0.3)"}}},$f="dcode-dp-theme-forced";function WE(t,o=$f){const n=Lf[t]??Lf.primary,r=`
42
42
  .dp__theme_light {
43
43
  --dp-primary-color: ${n.light.primary} !important;
44
44
  --dp-primary-text-color: ${n.light.text} !important;
@@ -53,6 +53,17 @@ https://github.com/highlightjs/highlight.js/issues/2277`),O=y,N=D),T===void 0&&(
53
53
  --dp-border-color: ${n.dark.border} !important;
54
54
  }
55
55
 
56
+ /* Selected Date Hover Effect */
57
+ .dp__active_date:hover {
58
+ background-color: ${n.light.selectedHover} !important;
59
+ color: ${n.light.selectedText} !important;
60
+ cursor: pointer !important;
61
+ }
62
+ .dark .dp__active_date:hover {
63
+ background-color: ${n.dark.selectedHover} !important;
64
+ color: ${n.dark.selectedText} !important;
65
+ }
66
+
56
67
  /* ✅ Custom Border & Layout Logic (Moved from .vue) */
57
68
  .dcode-datepicker-calendar .dp__action_row,
58
69
  .dcode-datepicker-menu .dp__action_row,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gemafajarramadhan/dynamic-ui",
3
- "version": "1.3.28",
3
+ "version": "1.3.29",
4
4
  "description": "Vue 3 Dynamic UI Component Library - Compatible with Vue, React, Angular, and any other framework via Web Components",
5
5
  "type": "module",
6
6
  "license": "MIT",