import D from"./DgZ9OEJo.js";import{_ as b,o as a,c as n,v as S,N as C,B as p,O,a as i,t as c,b as m,d as y,q as v,p as k,P as x,D as j,E as L}from"./CChoqk00.js";import{d as f}from"./4Fu3KWqy.js";const B={},H={class:"loadingSpinner"};function N(t,l){return a(),n("div",H)}const w=Object.assign(b(B,[["render",N],["__file","LoadingSpinner.vue"]]),{__name:"LoadingSpinner"}),z=S({__name:"ChartCard",props:{title:{type:String,default:""},chartData:{type:Object,default:()=>{}},chartOptions:{type:Object,default:()=>({})},inset:{type:Boolean,default:!1},pending:{type:Boolean,default:!1},chartHeight:{type:String,default:"400px"}},setup(t,{expose:l}){l();const e=t,r={chart:{style:{direction:"rtl"}},xAxis:{reversed:!0},yAxis:{opposite:!0},legend:{style:{direction:"rtl"}},labels:{style:{direction:"rtl"},useHtml:!0,align:"left"}},{isRTLLanguage:d}=C(),_=s=>(s=s||"unknown",s.replaceAll(/\s+/g,"_").toLocaleLowerCase()),u=p(()=>"card-"+_(e.title)),o=p(()=>e.chartData?e.chartData.series.every(s=>s.data.length===0):!1),h=p(()=>{if(o.value)return{};if(!e.chartData)return{};if(!d.value)return f(e.chartOptions,e.chartData);const s=f(r,e.chartOptions);return f(s,e.chartData)}),g={props:e,rtlChartOptions:r,isRTLLanguage:d,slugify:_,titleSlug:u,allSeriesHasNoData:o,setChartData:h};return Object.defineProperty(g,"__isScriptSetup",{enumerable:!1,value:!0}),g}}),$=["data-testid"],V={class:"p-4 border-b border-neutral-200 font-medium"},A={class:"p-[2px] relative"},P={key:0,class:"absolute top-0 right-0 p-2 text-xs text-right z-10"},E={key:1},T={class:"overflow-hidden size-5 flex items-center justify-center"},q={class:"text-center px-6"},F={key:0,class:"p-[1px] border-t border-neutral-200"};function I(t,l,e,r,d,_){const u=D,o=O("highcharts"),h=w;return a(),n("div",{class:L([e.inset?"":"bg-white card"]),"data-testid":r.titleSlug},[i("div",V,c(t.$t(e.title)),1),i("div",A,[e.pending?(a(),n("div",P,[m(u,{name:"svg-spinners:90-ring-with-bg",class:"size-3"}),y(" "+c(t.$t("refreshingData")),1)])):v("",!0),r.allSeriesHasNoData?(a(),n("div",{key:2,class:"flex items-center justify-center text-sm text-gray-500",style:x({height:e.chartHeight})},[i("p",q,c(t.$t("noDataForSelectedPeriod")),1)],4)):(a(),n("div",E,[e.chartData?(a(),k(o,{key:0,options:r.setChartData},null,8,["options"])):(a(),n("div",{key:1,class:"flex gap-2 items-center justify-center text-sm text-gray-500",style:x({height:e.chartHeight})},[i("div",T,[m(h,{class:"size-4"})]),y(" "+c(t.$t("loadingData")),1)],4))]))]),t.$slots.default?(a(),n("div",F,[j(t.$slots,"default")])):v("",!0)],10,$)}const J=Object.assign(b(z,[["render",I],["__file","ChartCard.vue"]]),{__name:"ChartCard"});export{J as _};
