@opengis/bi 1.2.4 → 1.2.5
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.
- package/dist/bi.js +1 -1
- package/dist/bi.umd.cjs +1 -1
- package/dist/{import-file-MEpI7PGd.js → import-file-iZU4En2W.js} +408 -408
- package/dist/{vs-funnel-bar-BdVcgrYG.js → vs-funnel-bar-CyPcyYTP.js} +1 -1
- package/dist/{vs-list-_1Ub562I.js → vs-list-BoMIMCT2.js} +1 -1
- package/dist/{vs-map-BQwf_Vmm.js → vs-map-DesSaN8x.js} +2 -2
- package/dist/{vs-map-cluster-Bu0fgucv.js → vs-map-cluster-Br3XHcWM.js} +2 -2
- package/dist/{vs-number-Dke5ThxE.js → vs-number-sHlpEuZn.js} +1 -1
- package/dist/{vs-table-C95epuWz.js → vs-table-C8ibl5_z.js} +1 -1
- package/dist/{vs-text-DAq6rCjJ.js → vs-text-CK4PX9CJ.js} +1 -1
- package/package.json +1 -1
- package/server/routes/data/controllers/data.js +1 -1
package/dist/bi.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V, m as r, v as t, h as e, k as i, g as o, l as g, j as n, i as B, n as P } from "./import-file-
|
|
1
|
+
import { V, m as r, v as t, h as e, k as i, g as o, l as g, j as n, i as B, n as P } from "./import-file-iZU4En2W.js";
|
|
2
2
|
export {
|
|
3
3
|
V as VsBar,
|
|
4
4
|
r as VsDashboard,
|
package/dist/bi.umd.cjs
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
</div>`},prepareData(){var t,e,n,s,r,i;try{if(this.styleData=this.styleData||{},!((t=this.sourceData)!=null&&t.length))return console.warn("No source data available"),null;const a=Array.from(new Set((this.sourceData||[]).map(u=>u[this.dimensions[0]]))),l=Array.from(new Set((this.sourceData||[]).map(u=>u[this.dimensions[1]]))),c=parseInt((this.sourceData||[]).reduce((u,b)=>u+parseFloat((b==null?void 0:b.metric)||0),0),10),h=a.map((u,b)=>{const y=(l[b]/c*100).toFixed(2);return{name:`${u} (${y}%)`,value:l[b]}}),d=((e=this.styleData)==null?void 0:e.innerRadius)||"80%",p=((n=this.styleData)==null?void 0:n.outerRadius)||"100%",m=[d,p];return this.styleData.legend=ke.getLegendOpions({borderRadius:10,height:"100%",padding:10,bottom:"0",type:"scroll",itemWidth:14,itemHeight:14,formatter:u=>{var b;return(b=u==null?void 0:u.replace("null","Не визначено"))==null?void 0:b.replace("NaN","0.00")},...((s=this.styleData)==null?void 0:s.legend)||{}}),this.styleData.label=ke.getLabelOptions((r=this.styleData)==null?void 0:r.label),this.styleData.show_legend=((i=this.styleData)==null?void 0:i.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:m,center:["50%","60%"],height:"75%",...Z(this.styleData),data:h}]}}catch(a){return console.error("Error in prepareData:",a),null}},async initChart(t){try{if(!t){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=echarts.init(e);const n=parseInt((this.sourceData||[]).reduce((r,i)=>r+parseFloat((i==null?void 0:i.metric)||0),0),10),s={tooltip:{trigger:"item",formatter:r=>this.buildTooltipForDonut(r,[r.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:t,...Z(this.styleData||{}),title:{text:R(n),left:"center",top:"41%",textStyle:{color:"black",fontWeight:400,fontSize:"22px"}}};this.chartInstance.setOption(s),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var r;(r=this.chartInstance)==null||r.resize()})}catch(e){console.error("Error in initChart:",e)}}}},Ks=["id"];function Qs(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:i.uniqueID,ref:"chart",class:"h-full min-h-[200px] flex items-center"},null,8,Ks)}const Pt=E(Gs,[["render",Qs]]),vs=Object.freeze(Object.defineProperty({__proto__:null,default:Pt},Symbol.toStringTag,{value:"Module"})),Xs={name:"VsPie",props:["currentWidget"],mixins:[A],data(){return{chartInstance:null,resizeObserver:null}},computed:{uniqueID(){return this.widget}},async mounted(){var n;await this.$nextTick(),await this.getData();const{series:t}=this.prepareData()||{};t&&this.initChart(t);const e=(n=this.$refs)==null?void 0:n.chart;e&&(this.resizeObserver=new ResizeObserver(()=>{this.chartInstance&&this.chartInstance.resize()}),this.resizeObserver.observe(e))},unmounted(){var t;(t=this.resizeObserver)==null||t.disconnect()},methods:{onChangedData(){try{if(this.sourceData){const{series:t,xs:e,ys:n}=this.prepareData();t&&this.initChart(t,e,n)}}catch(t){console.error(t)}},buildTooltipForDonut(t,e){const{name:n,value:s,percent:r}=t;return`
|
|
23
23
|
<div style="background-color:${e[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
|
|
24
24
|
${n==null?void 0:n.replace("null","Не визначено")}: ${R(s)} (${r}%)
|
|
25
|
-
</div>`},prepareData(){var t,e,n,s,r;try{this.styleData=this.styleData||{};const i=Array.from(new Set((this.sourceData||[]).map(g=>g[this.dimensions[0]]))),a=Array.from(new Set((this.sourceData||[]).map(g=>g[this.dimensions[1]]))),l=parseInt((this.sourceData||[]).reduce((g,u)=>g+parseFloat(u==null?void 0:u.metric),0),10),c=i.map((g,u)=>{const b=(a[u]/l*100).toFixed(2);return{name:`${g} (${b}%)`,value:a[u]}}),h=((t=this.styleData)==null?void 0:t.innerRadius)||"0%",d=((e=this.styleData)==null?void 0:e.outerRadius)||"100%",p=[h,d];return this.styleData.legend=ke.getLegendOpions({borderRadius:10,height:"100%",padding:10,type:"scroll",itemWidth:14,itemHeight:14,formatter:g=>g==null?void 0:g.replace("null","Не визначено"),textStyle:{fontSize:"14px"},...((n=this.styleData)==null?void 0:n.legend)||{}}),this.styleData.label=ke.getLabelOptions((s=this.styleData)==null?void 0:s.label),this.styleData.show_legend=((r=this.styleData)==null?void 0:r.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:p,center:["50%","60%"],height:"75%",...Z(this.styleData),data:c}]}}catch(i){return console.error("Error in prepareData:",i),null}},async initChart(t){try{if(!t){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=echarts.init(e);const n={tooltip:{trigger:"item",formatter:s=>this.buildTooltipForDonut(s,[s.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:t,...Z(this.styleData||{})};this.chartInstance.setOption(n),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var s;(s=this.chartInstance)==null||s.resize()})}catch(e){console.error("Error in initChart:",e)}}}},Ys=["id"];function er(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:i.uniqueID,ref:"chart",class:"h-full min-h-[200px] flex items-center"},null,8,Ys)}const It=E(Xs,[["render",er]]),tr=Object.freeze(Object.defineProperty({__proto__:null,default:It},Symbol.toStringTag,{value:"Module"})),nr={name:"VsLine",mixins:[A],data(){return{chartInstance:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget,await this.$nextTick(),await this.getData();const{series:t,xs:e}=this.prepareData();t&&this.initChart(t,e)},methods:{onChangedData(){try{if(this.sourceData){const{series:t,xs:e,ys:n}=this.prepareData();t&&(this==null||this.initChart(t,e,n))}}catch(t){console.error(t)}},prepareData(){var t,e;try{const n=Array.from(new Set(this.sourceData.map(a=>a[this.dimensions[0]])));let s;this.dimensions[0].includes("date")?s=n.map(a=>v(a)):s=[...n];const r=this.sourceData.map(a=>parseFloat(a[this.dimensions[1]]));let i;return(t=this.styleData)!=null&&t.stack?i=this.dimensions.slice(1).map(l=>({name:l,type:"line",stack:"a",areaStyle:this.styleData.area?{}:null,data:this.sourceData.filter(c=>parseFloat(c[l])).map(c=>parseFloat(c[l]))})):i=[{name:this.title,type:"line",areaStyle:(e=this.styleData)!=null&&e.area?{}:null,data:r,stack:"a"}],{series:i,xs:s}}catch(n){return console.error(n),null}}}},sr=["id"];function rr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:r.uniqueID,ref:"chart",style:{height:"400px"}},null,8,sr)}const jt=E(nr,[["render",rr]]),or=Object.freeze(Object.defineProperty({__proto__:null,default:jt},Symbol.toStringTag,{value:"Module"})),ir={name:"VsStat",mixins:[A],data(){return{restDimensions:[],sumValue:0,columns:null,showTooltip:-1}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){this.columns=Object.keys(this.sourceData[0]);const t=this.getValues();this.sumValue=t.reduce((e,n)=>e+n,0),this.sourceData.forEach((e,n)=>{e.color=n<Mt.length-1?Mt[n]:qs()})},formattedValue(t){const e=parseFloat(t);return R(e)}}},ar={class:"flex flex-col w-full h-full pt-[16px] rounded-xl"},lr={class:"flex flex-col justify-between w-full h-full"},cr={class:"w-full h-full pb-6 space-y-4"},dr={class:"flex w-full h-3 rounded-full gap-x-1 min-h-3 custom-x-scrollbar"},hr=["onMouseover"],pr={key:0,class:"absolute top-[-1] left-1/2 transform -translate-x-1/2 -translate-y-full bg-black text-white rounded px-2 py-1"},ur={class:"h-[calc(100%-20px)] w-full custom-scrollbar"},fr={class:"grid items-center justify-between grid-cols-2 py-2 gap-x-4"},mr={class:"flex items-center"},gr={class:"text-sm text-gray-800"},br={class:"text-end"},yr={class:"text-sm text-gray-500"};function xr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",ar,[o.createElementVNode("div",lr,[o.createElementVNode("div",cr,[o.createElementVNode("div",dr,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>{var c,h,d,p;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col min-w-[5px] justify-center min-h-2.5 h-2.5 text-xs text-white text-center whitespace-nowrap",`bg-[${a.color}]`]),style:o.normalizeStyle({width:`${parseFloat(a==null?void 0:a[(c=r.columns)==null?void 0:c[1]])/r.sumValue*100}%`}),role:"progressbar","aria-valuenow":"42","aria-valuemin":"0","aria-valuemax":"100",onMouseover:m=>r.showTooltip=l,onMouseleave:e[0]||(e[0]=m=>r.showTooltip=-1)},[r.showTooltip>-1?(o.openBlock(),o.createElementBlock("div",pr,o.toDisplayString(t.sourceData[r.showTooltip][r.columns[0]])+" "+o.toDisplayString((parseFloat((p=(h=t.sourceData)==null?void 0:h[r.showTooltip])==null?void 0:p[(d=r.columns)==null?void 0:d[1]])/r.sumValue*100).toFixed(2))+"% ",1)):o.createCommentVNode("",!0)],46,hr)}),256))]),o.createElementVNode("ul",ur,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,a=>{var l,c;return o.openBlock(),o.createElementBlock("li",fr,[o.createElementVNode("div",mr,[o.createElementVNode("span",{class:o.normalizeClass(["shrink-0 size-2.5 inline-block rounded-sm me-2.5 min-w-[10px] w-[10px] h-[10px] min-h-[10px]",`bg-[${a.color}]`])},null,2),o.createElementVNode("span",gr,o.toDisplayString((a==null?void 0:a[(l=r.columns)==null?void 0:l[0]])||"Не визначено"),1)]),o.createElementVNode("div",br,[o.createElementVNode("span",yr,o.toDisplayString(i.formattedValue(a==null?void 0:a[(c=r.columns)==null?void 0:c[1]])||"-"),1)])])}),256))])])])])}const Ut=E(ir,[["render",xr]]),wr=Object.freeze(Object.defineProperty({__proto__:null,default:Ut},Symbol.toStringTag,{value:"Module"})),kr={name:"VsProgressBar",mixins:[A],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){var e;this.columns=Object.keys((e=this.sourceData)==null?void 0:e[0])||null;const t=this.getValues();this.maxValue=Math.max(...t)},formattedValue(t){return R(t)}}},_r={key:0,class:"flex flex-col h-full pt-[16px] rounded-xl"},Er={class:"h-full pt-0 pb-6 space-y-4"},Sr={class:"h-full space-y-4 custom-scrollbar"},$r={class:"flex items-center justify-between mr-2 gap-x-2"},Cr={class:"grid items-center w-full grid-cols-2 gap-x-2"},Br={class:"text-sm text-gray-800"},Dr={class:"flex justify-end",role:"progressbar","aria-valuenow":"100","aria-valuemin":"0","aria-valuemax":"100"},Nr={class:"min-w-[60px] text-end"},Vr={class:"text-sm text-gray-500"};function Tr(t,e,n,s,r,i){return r.columns?(o.openBlock(),o.createElementBlock("div",_r,[o.createElementVNode("div",Er,[o.createElementVNode("ul",Sr,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>(o.openBlock(),o.createElementBlock("li",$r,[o.createElementVNode("div",Cr,[o.createElementVNode("span",Br,o.toDisplayString(a[r.columns[0]]),1),o.createElementVNode("div",Dr,[o.createElementVNode("div",{class:"h-1.5 flex flex-col justify-center overflow-hidden bg-indigo-500 rounded-full text-xs text-white text-center whitespace-nowrap",style:o.normalizeStyle({width:`${parseFloat(a[r.columns[1]])/r.maxValue*100}%`})},null,4)])]),o.createElementVNode("div",Nr,[o.createElementVNode("span",Vr,o.toDisplayString(i.formattedValue(a[r.columns[1]])),1)])]))),256))])])])):o.createCommentVNode("",!0)}const qt=E(kr,[["render",Tr]]),Rr=Object.freeze(Object.defineProperty({__proto__:null,default:qt},Symbol.toStringTag,{value:"Module"})),zr={name:"VsListbar",mixins:[A],props:["source"],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch(t){console.error(t)}},prepareData(){var e,n,s;this.columns=Object.keys(((e=this.sourceData)==null?void 0:e[0])||{});const t=(n=this.sourceData)==null?void 0:n.map(r=>{var i;return r==null?void 0:r[(i=this.columns)==null?void 0:i[1]]});this.maxValue=Math.max(...t||[]),this.restDimensions=(s=this.columns)==null?void 0:s.filter((r,i)=>i!==0)},formattedValue(t){return R(t)},getWidth(t){return`${t/this.maxValue*100}%`}}},Lr={class:"h-full pt-[20px] list-bar"},Or={class:"space-y-2 custom-scrollbar h-full h-[calc(100%-20px)]"},Ar={class:"relative w-full truncate"},Fr={class:"relative z-[1] text-sm block py-1 px-2 w-full text-sm truncate text-gray-800"},Mr={class:"text-[14px] text-gray-500"};function Pr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Lr,[o.createElementVNode("ul",Or,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>{var c,h,d;return o.openBlock(),o.createElementBlock("li",{key:l,class:"flex items-center justify-between w-full gap-x-2"},[o.createElementVNode("div",Ar,[o.createElementVNode("span",Fr,o.toDisplayString((a==null?void 0:a[(c=r.columns)==null?void 0:c[0]])||"Без категорії"),1),o.createElementVNode("div",{class:o.normalizeClass(["absolute inset-y-0 h-full rounded start-0",a!=null&&a[(h=r.columns)==null?void 0:h[0]]?"bg-indigo-100":"bg-gray-100"]),style:o.normalizeStyle({width:i.getWidth(a==null?void 0:a[(d=r.columns)==null?void 0:d[1]])})},null,6)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.restDimensions,(p,m)=>(o.openBlock(),o.createElementBlock("div",{key:m,class:"w-20 mr-2 text-end"},[o.createElementVNode("span",Mr,o.toDisplayString(i.formattedValue(a==null?void 0:a[p])),1)]))),128))])}),128))])])}const Ht=E(zr,[["render",Pr]]),Ir=Object.freeze(Object.defineProperty({__proto__:null,default:Ht},Symbol.toStringTag,{value:"Module"})),je={week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік"},jr=["onClick"],Ur={class:"flex items-center justify-between w-full"},qr={key:0},Hr={__name:"vs-bi-dropdown",props:{title:String,options:[Array,String],value:{type:String}},emits:["selected"],setup(t,{emit:e}){const n=t,s=e,r=o.ref(!1),i=o.ref(n.value||null),a=o.ref(null),l=o.computed(()=>typeof n.options=="string"?n.options.split(",").map((g,u)=>({id:u,text:g.trim()})):n.options),c=o.computed(()=>{const g=l.value.find(u=>(u.id||u)===i.value);return g?g.text||g:n.title}),h=g=>{i.value=g.id||g,r.value=!1,s("selected",(g==null?void 0:g.id)||g),document.removeEventListener("click",d)},d=g=>{a.value&&!a.value.contains(g.target)&&(r.value=!1,document.removeEventListener("click",d))},p=()=>{r.value=!r.value,r.value?setTimeout(()=>{document.addEventListener("click",d)},200):document.removeEventListener("click",d)},m=g=>(je==null?void 0:je[g])||g;return o.onUnmounted(()=>{document.removeEventListener("click",d)}),(g,u)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("button",{type:"button","aria-expanded":"true",class:"hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",onClick:p},[o.createTextVNode(o.toDisplayString(m(c.value))+" ",1),u[0]||(u[0]=o.createElementVNode("svg",{class:"shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("path",{d:"m6 9 6 6 6-6"})],-1))]),r.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"biDropdown",ref:a,"data-hs-select-dropdown":"",class:"absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",role:"listbox",tabindex:"-1","aria-orientation":"vertical",style:{"margin-top":"10px"}},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,b=>(o.openBlock(),o.createElementBlock("div",{key:b.id||b,class:"cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:y=>h(b)},[o.createElementVNode("div",Ur,[o.createElementVNode("span",null,o.toDisplayString(m(b.text||b)),1),i.value===(b.id||b)?(o.openBlock(),o.createElementBlock("span",qr,[...u[1]||(u[1]=[o.createElementVNode("svg",{class:"shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("polyline",{points:"20 6 9 17 4 12"})],-1)])])):o.createCommentVNode("",!0)])],8,jr))),128))],512)):o.createCommentVNode("",!0)],64))}},Wr={"bi-bar":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Js)),"bi-number":o.defineAsyncComponent(()=>Promise.resolve().then(()=>ii)),"bi-text":o.defineAsyncComponent(()=>Promise.resolve().then(()=>qi)),"bi-listbar":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Ir)),"bi-pie":o.defineAsyncComponent(()=>Promise.resolve().then(()=>tr)),"bi-donut":o.defineAsyncComponent(()=>Promise.resolve().then(()=>vs)),"bi-line":o.defineAsyncComponent(()=>Promise.resolve().then(()=>or)),"bi-stat":o.defineAsyncComponent(()=>Promise.resolve().then(()=>wr)),"bi-pivot":o.defineAsyncComponent(()=>Promise.resolve().then(()=>ni)),"bi-progress":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Rr)),"bi-funnel":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Ji)),"bi-map":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Ya)),"bi-cluster":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Vl)),"bi-table":o.defineAsyncComponent(()=>Promise.resolve().then(()=>ql))},Zr={class:"flex items-center space-x-2"},Jr=o.defineComponent({__name:"vs-bi-switch",props:o.mergeModels({leftLabel:{},rightLabel:{},modelValue:{type:Boolean}},{modelValue:{default:()=>!1,type:Boolean},modelModifiers:{}}),emits:o.mergeModels(["update:is-enabled"],["update:modelValue"]),setup(t,{emit:e}){const n=e,s=o.useModel(t,"modelValue"),r=()=>{n("update:is-enabled",s)};return(i,a)=>(o.openBlock(),o.createElementBlock("div",Zr,[i.leftLabel?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["transition-colors",{"text-blue-500":!s.value}])},o.toDisplayString(i.leftLabel),3)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>s.value=l),type:"checkbox",class:"relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",onChange:r},null,544),[[o.vModelCheckbox,s.value]]),i.rightLabel?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["transition-colors",{"text-blue-500":s.value}])},o.toDisplayString(i.rightLabel),3)):o.createCommentVNode("",!0)]))}}),Gr={},Kr={class:"flex items-center justify-center h-full"};function Qr(t,e){return o.openBlock(),o.createElementBlock("div",Kr,[...e[0]||(e[0]=[o.createElementVNode("div",{class:"text-center text-gray-500"},[o.createElementVNode("h2",{class:"text-2xl font-bold"},"No data available")],-1)])])}const vr=E(Gr,[["render",Qr]]),Xr={},Yr={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function eo(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("svg",Yr,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),o.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),o.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const to={components:{VsBiDropdown:Hr,VsBiSwitch:Jr,VsNoDataChart:vr,IconDownload:E(Xr,[["render",eo]]),...Wr},props:{dashboard:{type:String},prefix:{type:String,default:""},widget:{type:String},filterURl:{type:String},dashboardWidgets:{type:Object},selectedWidget:{type:String}},data(){return{checked:[],selected:[],currentWidget:null,widgetData:[]}},computed:{computedTitle(){var e,n;const t=(e=this.dashboardWidgets)==null?void 0:e.find(s=>s.name===this.widget);return((n=t==null?void 0:t.data)==null?void 0:n.title)||(t==null?void 0:t.title)||""},computedType(){var e;const t=(e=this.dashboardWidgets)==null?void 0:e.find(n=>n.name===this.widget);return(t==null?void 0:t.type)||"text"},controls(){var e;return Object.keys(((e=this.widgetData)==null?void 0:e.controls)||{}).map(n=>{var s,r,i;return{name:n,options:typeof((s=this.widgetData)==null?void 0:s.controls)=="boolean"?!1:(i=(r=this.widgetData)==null?void 0:r.controls)==null?void 0:i[n]}})}},mounted(){this.prefix&&(V.defaults.baseURL=this.prefix)},watch:{filterURl(t){var e,n;(n=(e=this.$refs)==null?void 0:e.chart)==null||n.setFilter(t)},selectedWidget(t,e){var n;t!==e&&t===((n=this.widgetData)==null?void 0:n.id)&&this.$emit("update:current-widget-data",this.widgetData)},widgetData(t,e){if((t==null?void 0:t.id)===(e==null?void 0:e.id))return;const s=new URLSearchParams(window.top.location.search).get("widget");s&&s===(t==null?void 0:t.id)&&this.$emit("update:current-widget-data",t)}},methods:{changeStyleHandler(t,e){var n;(n=this.$refs.chart)==null||n.changeStyle(t,e)},selectedOptionHandler(t,e){let n=!0;this.selected.forEach(s=>{s.name===e&&(s.option=t,n=!1)}),n&&this.selected.push({name:e,option:t}),this.makeUpUrl()},makeUpUrl(){var e;let t=`/bi-data?dashboard=${this.dashboard}&widget=${this.widget}`;this.selected.forEach((n,s)=>{t+=`&${n.name}=${n.option}`}),(e=this.$refs.chart)==null||e.getDataFromURL(t)},exportChart(){if(this.currentWidget){const t=this.currentWidget.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#ffffff"}),e=document.createElement("a");e.href=t,e.download="chart.png",document.body.appendChild(e),e.click(),document.body.removeChild(e)}}}},no={key:0,class:"text-[16px] flex max-w-full items-center min-h-0 flex justify-between max-h-[50px] h-fit shrink-0"},so={class:"flex items-center justify-between w-full"},ro={class:"grid"},oo={class:"text-gray-800 max-h-[30px] inline-block text-nowrap font-semibold"},io={class:"flex flex-col justify-end"},ao={key:0,class:"flex items-center justify-end w-full gap-2"},lo={class:"w-full h-full"};function co(t,e,n,s,r,i){var d,p,m,g,u,b,y,_,w;const a=o.resolveComponent("VsBiDropdown"),l=o.resolveComponent("VsBiSwitch"),c=o.resolveComponent("IconDownload"),h=o.resolveComponent("VsNoDataChart");return o.openBlock(),o.createElementBlock("div",{ref:"widget",class:o.normalizeClass(["box-border relative h-full p-4 bg-white border border-gray-200 select-auto rounded-xl",[(p=(d=r.widgetData)==null?void 0:d.style)!=null&&p.height?`max-h-[${(g=(m=r.widgetData)==null?void 0:m.style)==null?void 0:g.height}px] h-[${(b=(u=r.widgetData)==null?void 0:u.style)==null?void 0:b.height}px]`:"max-h-[460px]"]])},[["text","cluster","map"].includes(i.computedType)?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",no,[o.createElementVNode("div",so,[o.createElementVNode("div",ro,[o.createElementVNode("span",oo,o.toDisplayString(i.computedTitle),1)]),o.createElementVNode("div",io,[(y=i.controls)!=null&&y.length?(o.openBlock(),o.createElementBlock("span",ao,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((_=i.controls)==null?void 0:_.filter(x=>(x==null?void 0:x.options)&&(x==null?void 0:x.name)!=="export"),x=>{var N;return o.openBlock(),o.createElementBlock("div",null,[Array.isArray(x==null?void 0:x.options)?(o.openBlock(),o.createBlock(a,{key:0,title:x==null?void 0:x.name,options:x==null?void 0:x.options,value:(N=r.widgetData)==null?void 0:N.data[x==null?void 0:x.name],onSelected:$=>i.selectedOptionHandler($,x==null?void 0:x.name)},null,8,["title","options","value","onSelected"])):typeof x.options=="boolean"?(o.openBlock(),o.createBlock(l,{key:1,"left-label":x==null?void 0:x.name,"is-enabled":x==null?void 0:x.options,"onUpdate:isEnabled":$=>i.changeStyleHandler(x==null?void 0:x.name,$)},null,8,["left-label","is-enabled","onUpdate:isEnabled"])):o.createCommentVNode("",!0)])}),256)),(w=i.controls)!=null&&w.some(x=>(x==null?void 0:x.name)==="export")?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:e[0]||(e[0]=(...x)=>i.exportChart&&i.exportChart(...x)),class:"h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center"},[o.createVNode(c,{height:"16",width:"16",class:"text-gray-800"})])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)])])])),o.createElementVNode("div",lo,[r.widgetData?(o.openBlock(),o.createBlock(o.resolveDynamicComponent("bi-"+i.computedType),{key:0,currentWidget:r.currentWidget,"onUpdate:currentWidget":e[1]||(e[1]=x=>r.currentWidget=x),widgetData:r.widgetData,"onUpdate:widgetData":e[2]||(e[2]=x=>r.widgetData=x),ref:"chart",dashboard:n.dashboard,title:i.computedTitle,widget:n.widget},null,40,["currentWidget","widgetData","dashboard","title","widget"])):(o.openBlock(),o.createBlock(h,{key:1,class:"w-full h-full"}))])],2)}const Wt=E(to,[["render",co]]),ho={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},po={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},uo={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},fo={class:"max-w-sm mx-auto mt-6"},mo={class:"font-medium text-gray-800 dark:text-neutral-200"},go={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function bo(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",po,[o.createElementVNode("div",null,[o.createElementVNode("div",uo,[e[0]||(e[0]=o.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),o.createElementVNode("div",fo,[o.createElementVNode("p",mo,o.toDisplayString(n.title),1),o.createElementVNode("p",go,o.toDisplayString(n.text),1)])])])])}const yo=E(ho,[["render",bo]]),xo={},wo={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function ko(t,e){return o.openBlock(),o.createElementBlock("svg",wo,[...e[0]||(e[0]=[o.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)])])}const _o=E(xo,[["render",ko]]),Eo={},So={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-refresh"};function $o(t,e){return o.openBlock(),o.createElementBlock("svg",So,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"},null,-1),o.createElementVNode("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const Co={components:{filterIcon:_o,refreshIcon:E(Eo,[["render",$o]])},props:["filterScheme"],emits:["filters:changed"],data(){return{rows:[],isFilterVisible:!1,rowList:[],activeFilters:"",filters:{}}},async mounted(){const e=await(await new URLSearchParams(window.top.location.search)).get("filter");this.filters.url=e||""},computed:{activeFiltersCount(){var t,e;return(t=this.filters)!=null&&t.url?((e=this.filters)==null?void 0:e.url.split("=").length)-1:0}},methods:{toggleFilterShown(){this.isFilterVisible=!this.isFilterVisible},handleFilterChange(t){var e,n;this.filters=t,this.activeFilters=(n=(e=this.$refs)==null?void 0:e.filter)==null?void 0:n.activeFilters,this.$emit("filters:changed",this.filters)},resetFilters(){this.$refs.filter&&this.$refs.filter.clearAll(),this.isFilterVisible=!1,this.$emit("filters:changed",""),this.activeFilters=null},closeFilter({target:t}){this.isFilterVisible&&t.classList.contains("filter-container")&&(this.isFilterVisible=!1)}}},Bo={class:"flex items-center"},Do={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"};function No(t,e,n,s,r,i){const a=o.resolveComponent("filterIcon"),l=o.resolveComponent("VsFilterList");return o.openBlock(),o.createElementBlock("div",Bo,[n.filterScheme?(o.openBlock(),o.createBlock(l,{key:0,ref:"filter",scheme:n.filterScheme,closeFilterBtn:!0,onFilterClose:e[1]||(e[1]=c=>r.isFilterVisible=!1),layout:"default","apply-vue-router":"",history:"",view:"plain",token:t.table,name:"filter",footer:!0,background:!0,onFilterChange:i.handleFilterChange},{button:o.withCtx(()=>[o.createElementVNode("button",{type:"button",class:"py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[0]||(e[0]=(...c)=>i.toggleFilterShown&&i.toggleFilterShown(...c))},[o.createVNode(a),e[2]||(e[2]=o.createTextVNode(" Фільтри ",-1)),i.activeFiltersCount>=1?(o.openBlock(),o.createElementBlock("span",Do,o.toDisplayString(i.activeFiltersCount),1)):o.createCommentVNode("",!0)])]),_:1},8,["scheme","token","onFilterChange"])):o.createCommentVNode("",!0)])}const Vo={props:["dashboardData","filters"],components:{VsFilterHeader:E(Co,[["render",No]])}},To={class:"bg-white px-5 flex gap-4 h-[90px] border border-gray-200 mt-2 rounded-xl mb-2 pt-[3px] justify-between items-center"},Ro={class:"grow"},zo={class:"text-lg font-semibold text-stone-800 dark:text-neutral-200"},Lo={type:"button",class:"inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400","data-clipboard-target":"#hs-erc","data-clipboard-action":"copy","data-clipboard-success-text":"Copied"};function Oo(t,e,n,s,r,i){var l,c;const a=o.resolveComponent("VsFilterHeader");return o.openBlock(),o.createElementBlock("div",To,[o.createElementVNode("div",Ro,[o.createElementVNode("h1",zo,o.toDisplayString((l=n.dashboardData)==null?void 0:l.title),1),o.createElementVNode("button",Lo,o.toDisplayString((c=n.dashboardData)==null?void 0:c.description),1)]),o.createVNode(a,{filterScheme:n.filters,"onFilters:changed":e[0]||(e[0]=h=>t.$emit("filters:changed",h))},null,8,["filterScheme"])])}const Ao={components:{VsWidget:Wt,VsNewNodata:yo,VsHeader:E(Vo,[["render",Oo]])},props:["id","prefix"],data(){return{widgets:[],panels:[],error:!1,selectedPanel:"",filterURl:null,dashboardData:null}},async mounted(){V.defaults.baseURL=this.prefix||"/api",await this.fetchData()},methods:{async fetchData(){if(this.id)try{const{data:t}=await V.get(`/bi-dashboard/${this.id}`);this.dashboardData=t}catch(t){console.error(t)}},columnClass(t){const e=t!=null&&t.col?t==null?void 0:t.col:12;return{1:"md:w-1/12 sm:w-full",2:"md:w-1/6 sm:w-full",3:"md:w-1/4 sm:w-full",4:"md:w-1/3 sm:w-full",6:"md:w-1/2 sm:w-full",8:"md:w-2/3 sm:w-full",10:"md:w-5/6 sm:w-full",12:"w-full"}[e]||"w-full"},async filterHandler(t){var n;this.filterURl="";let e="&filter=";(n=t==null?void 0:t.url)!=null&&n.length&&(t.url.split("|").forEach(r=>{const i=r.split("=");e+=`${i[0]}=${i[1]}`}),this.filterURl+=e)}}},Fo={class:"w-full pb-8 overflow-y-auto"},Mo={class:"grid flex-grow w-full grid-cols-12 gap-4 h-fit"};function Po(t,e,n,s,r,i){var h,d,p;const a=o.resolveComponent("VsHeader"),l=o.resolveComponent("VsNewNodata"),c=o.resolveComponent("VsWidget");return o.openBlock(),o.createElementBlock("div",Fo,[o.createElementVNode("div",null,[(h=r.dashboardData)!=null&&h.filters?(o.openBlock(),o.createBlock(a,{key:0,filters:(d=r.dashboardData)==null?void 0:d.filters,dashboardData:r.dashboardData,"onFilters:changed":e[0]||(e[0]=m=>i.filterHandler(m))},null,8,["filters","dashboardData"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Mo,[r.error||!r.dashboardData?(o.openBlock(),o.createBlock(l,{key:0,class:"col-span-12"})):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((p=r.dashboardData)==null?void 0:p.panels)||[],(m,g)=>{var u;return o.openBlock(),o.createElementBlock("div",{key:g,class:o.normalizeClass([`col-span-${m.col||12}`,"flex flex-col gap-[10px]"])},[(u=m.widgets)!=null&&u.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(m.widgets,b=>(o.openBlock(),o.createBlock(c,{key:b,dashboard:n.id,widget:b,"dashboard-widgets":r.dashboardData.widgets,"filter-u-rl":r.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))),128)):(o.openBlock(),o.createBlock(c,{key:1,class:"flex flex-col",dashboard:n.id,widget:m.widget,"dashboard-widgets":r.dashboardData.widgets,"filter-u-rl":r.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))],2)}),128))])])}const Io=E(Ao,[["render",Po]]),jo={name:"VsPivotTable",mixins:[A],data(){return{values:null,xs:null,products:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){try{const t=Array.from(new Set(this.sourceData.map(e=>e[this.dimensions[0]])));this.dimensions[0].includes("date")?this.xs=t.map(e=>v(e)):this.xs=[...t],this.products=this.dimensions.filter((e,n)=>n!=0),this.values=this.products.map((e,n)=>({name:e,data:this.sourceData.filter(s=>parseFloat(s[e])).map(s=>R(parseFloat(s[e])))}))}catch(t){console.error(t)}}}},Uo={class:"flex flex-col h-full p-5 space-y-4 rounded-xl custom-scrollbar"},qo={class:"overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 custom-scrollbar"},Ho={class:"inline-block min-w-full align-middle"},Wo={class:"min-w-full divide-y divide-gray-200"},Zo={class:"space-x-2"},Jo={scope:"col",class:"xl:min-w-[120px] min-w-48"},Go={class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"},Ko={class:"divide-y divide-gray-200 text-[12px]"},Qo={class:"py-3 size-px whitespace-nowrap"},vo={class:"flex items-center gap-x-3"},Xo={class:"font-medium text-gray-800"},Yo={class:"py-3 size-px whitespace-nowrap"},ei={class:"text-gray-600"};function ti(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Uo,[o.createElementVNode("div",qo,[o.createElementVNode("div",Ho,[o.createElementVNode("table",Wo,[o.createElementVNode("thead",null,[o.createElementVNode("tr",Zo,[e[0]||(e[0]=o.createElementVNode("th",{scope:"col",class:"min-w-[200px]"},[o.createElementVNode("div",{class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"})],-1)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.xs,a=>(o.openBlock(),o.createElementBlock("th",Jo,[o.createElementVNode("div",Go,o.toDisplayString(a),1)]))),256))])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.values,a=>(o.openBlock(),o.createElementBlock("tbody",Ko,[o.createElementVNode("tr",null,[o.createElementVNode("td",Qo,[o.createElementVNode("div",vo,[o.createElementVNode("span",Xo,o.toDisplayString(a.name),1)])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.xs,(l,c)=>(o.openBlock(),o.createElementBlock("td",Yo,[o.createElementVNode("span",ei,o.toDisplayString(a.data[c]),1)]))),256))])]))),256))])])])])}const Zt=E(jo,[["render",ti]]),ni=Object.freeze(Object.defineProperty({__proto__:null,default:Zt},Symbol.toStringTag,{value:"Module"})),si={name:"VsNumber",mixins:[A],data(){return{number:""}},computed:{formattedNumber(){return bn(this.number)},prefix(){var t,e;return(t=this.styleData)!=null&&t.prefix?(e=this.styleData)==null?void 0:e.prefix:""}},watch:{sourceData:{async handler(){this.getNumber()},deep:!0}},async mounted(){await this.getData(),this.getNumber()},methods:{onChangedData(){try{this.sourceData&&this.getNumber()}catch(t){console.error(t)}},async getNumber(){var t,e;try{this.number=((e=this.sourceData[0])==null?void 0:e[Object.keys((t=this.sourceData)==null?void 0:t[0])])||0}catch(n){console.error(n)}}}},ri={class:"text-lg lg:text-xl xl:text-2xl text-gray-800 h-[32px] flex items-center"};function oi(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",ri,o.toDisplayString(i.prefix)+o.toDisplayString(i.formattedNumber),1)}const ii=Object.freeze(Object.defineProperty({__proto__:null,default:E(si,[["render",oi]])},Symbol.toStringTag,{value:"Module"}));function Ue(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let J=Ue();function Jt(t){J=t}const Gt=/[&<>"']/,ai=new RegExp(Gt.source,"g"),Kt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,li=new RegExp(Kt.source,"g"),ci={"&":"&","<":"<",">":">",'"':""","'":"'"},Qt=t=>ci[t];function M(t,e){if(e){if(Gt.test(t))return t.replace(ai,Qt)}else if(Kt.test(t))return t.replace(li,Qt);return t}const di=/(^|[^\[])\^/g;function B(t,e){let n=typeof t=="string"?t:t.source;e=e||"";const s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(di,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,e)};return s}function vt(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const re={exec:()=>null};function Xt(t,e){const n=t.replace(/\|/g,(i,a,l)=>{let c=!1,h=a;for(;--h>=0&&l[h]==="\\";)c=!c;return c?"|":" |"}),s=n.split(/ \|/);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!s[s.length-1].trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(/\\\|/g,"|");return s}function oe(t,e,n){const s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function hi(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return-1}function Yt(t,e,n,s){const r=e.href,i=e.title?M(e.title):null,a=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){s.state.inLink=!0;const l={type:"link",raw:n,href:r,title:i,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}return{type:"image",raw:n,href:r,title:i,text:M(a)}}function pi(t,e){const n=t.match(/^(\s+)(?:```)/);if(n===null)return e;const s=n[1];return e.split(`
|
|
25
|
+
</div>`},prepareData(){var t,e,n,s,r;try{this.styleData=this.styleData||{};const i=Array.from(new Set((this.sourceData||[]).map(g=>g[this.dimensions[0]]))),a=Array.from(new Set((this.sourceData||[]).map(g=>g[this.dimensions[1]]))),l=parseInt((this.sourceData||[]).reduce((g,u)=>g+parseFloat(u==null?void 0:u.metric),0),10),c=i.map((g,u)=>{const b=(a[u]/l*100).toFixed(2);return{name:`${g} (${b}%)`,value:a[u]}}),h=((t=this.styleData)==null?void 0:t.innerRadius)||"0%",d=((e=this.styleData)==null?void 0:e.outerRadius)||"100%",p=[h,d];return this.styleData.legend=ke.getLegendOpions({borderRadius:10,height:"100%",padding:10,type:"scroll",itemWidth:14,itemHeight:14,formatter:g=>g==null?void 0:g.replace("null","Не визначено"),textStyle:{fontSize:"14px"},...((n=this.styleData)==null?void 0:n.legend)||{}}),this.styleData.label=ke.getLabelOptions((s=this.styleData)==null?void 0:s.label),this.styleData.show_legend=((r=this.styleData)==null?void 0:r.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:p,center:["50%","60%"],height:"75%",...Z(this.styleData),data:c}]}}catch(i){return console.error("Error in prepareData:",i),null}},async initChart(t){try{if(!t){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=echarts.init(e);const n={tooltip:{trigger:"item",formatter:s=>this.buildTooltipForDonut(s,[s.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:t,...Z(this.styleData||{})};this.chartInstance.setOption(n),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var s;(s=this.chartInstance)==null||s.resize()})}catch(e){console.error("Error in initChart:",e)}}}},Ys=["id"];function er(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:i.uniqueID,ref:"chart",class:"h-full min-h-[200px] flex items-center"},null,8,Ys)}const It=E(Xs,[["render",er]]),tr=Object.freeze(Object.defineProperty({__proto__:null,default:It},Symbol.toStringTag,{value:"Module"})),nr={name:"VsLine",mixins:[A],data(){return{chartInstance:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget,await this.$nextTick(),await this.getData();const{series:t,xs:e}=this.prepareData();t&&this.initChart(t,e)},methods:{onChangedData(){try{if(this.sourceData){const{series:t,xs:e,ys:n}=this.prepareData();t&&(this==null||this.initChart(t,e,n))}}catch(t){console.error(t)}},prepareData(){var t,e;try{const n=Array.from(new Set(this.sourceData.map(a=>a[this.dimensions[0]])));let s;this.dimensions[0].includes("date")?s=n.map(a=>v(a)):s=[...n];const r=this.sourceData.map(a=>parseFloat(a[this.dimensions[1]]));let i;return(t=this.styleData)!=null&&t.stack?i=this.dimensions.slice(1).map(l=>({name:l,type:"line",stack:"a",areaStyle:this.styleData.area?{}:null,data:this.sourceData.filter(c=>parseFloat(c[l])).map(c=>parseFloat(c[l]))})):i=[{name:this.title,type:"line",areaStyle:(e=this.styleData)!=null&&e.area?{}:null,data:r,stack:"a"}],{series:i,xs:s}}catch(n){return console.error(n),null}}}},sr=["id"];function rr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:r.uniqueID,ref:"chart",style:{height:"400px"}},null,8,sr)}const jt=E(nr,[["render",rr]]),or=Object.freeze(Object.defineProperty({__proto__:null,default:jt},Symbol.toStringTag,{value:"Module"})),ir={name:"VsStat",mixins:[A],data(){return{restDimensions:[],sumValue:0,columns:null,showTooltip:-1}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){this.columns=Object.keys(this.sourceData[0]);const t=this.getValues();this.sumValue=t.reduce((e,n)=>e+n,0),this.sourceData.forEach((e,n)=>{e.color=n<Mt.length-1?Mt[n]:qs()})},formattedValue(t){const e=parseFloat(t);return R(e)}}},ar={class:"flex flex-col w-full h-full pt-[16px] rounded-xl"},lr={class:"flex flex-col justify-between w-full h-full"},cr={class:"w-full h-full pb-6 space-y-4"},dr={class:"flex w-full h-3 rounded-full gap-x-1 min-h-3 custom-x-scrollbar"},hr=["onMouseover"],pr={key:0,class:"absolute top-[-1] left-1/2 transform -translate-x-1/2 -translate-y-full bg-black text-white rounded px-2 py-1"},ur={class:"h-[calc(100%-20px)] w-full custom-scrollbar"},fr={class:"grid items-center justify-between grid-cols-2 py-2 gap-x-4"},mr={class:"flex items-center"},gr={class:"text-sm text-gray-800"},br={class:"text-end"},yr={class:"text-sm text-gray-500"};function xr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",ar,[o.createElementVNode("div",lr,[o.createElementVNode("div",cr,[o.createElementVNode("div",dr,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>{var c,h,d,p;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col min-w-[5px] justify-center min-h-2.5 h-2.5 text-xs text-white text-center whitespace-nowrap",`bg-[${a.color}]`]),style:o.normalizeStyle({width:`${parseFloat(a==null?void 0:a[(c=r.columns)==null?void 0:c[1]])/r.sumValue*100}%`}),role:"progressbar","aria-valuenow":"42","aria-valuemin":"0","aria-valuemax":"100",onMouseover:m=>r.showTooltip=l,onMouseleave:e[0]||(e[0]=m=>r.showTooltip=-1)},[r.showTooltip>-1?(o.openBlock(),o.createElementBlock("div",pr,o.toDisplayString(t.sourceData[r.showTooltip][r.columns[0]])+" "+o.toDisplayString((parseFloat((p=(h=t.sourceData)==null?void 0:h[r.showTooltip])==null?void 0:p[(d=r.columns)==null?void 0:d[1]])/r.sumValue*100).toFixed(2))+"% ",1)):o.createCommentVNode("",!0)],46,hr)}),256))]),o.createElementVNode("ul",ur,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,a=>{var l,c;return o.openBlock(),o.createElementBlock("li",fr,[o.createElementVNode("div",mr,[o.createElementVNode("span",{class:o.normalizeClass(["shrink-0 size-2.5 inline-block rounded-sm me-2.5 min-w-[10px] w-[10px] h-[10px] min-h-[10px]",`bg-[${a.color}]`])},null,2),o.createElementVNode("span",gr,o.toDisplayString((a==null?void 0:a[(l=r.columns)==null?void 0:l[0]])||"Не визначено"),1)]),o.createElementVNode("div",br,[o.createElementVNode("span",yr,o.toDisplayString(i.formattedValue(a==null?void 0:a[(c=r.columns)==null?void 0:c[1]])||"-"),1)])])}),256))])])])])}const Ut=E(ir,[["render",xr]]),wr=Object.freeze(Object.defineProperty({__proto__:null,default:Ut},Symbol.toStringTag,{value:"Module"})),kr={name:"VsProgressBar",mixins:[A],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){var e;this.columns=Object.keys((e=this.sourceData)==null?void 0:e[0])||null;const t=this.getValues();this.maxValue=Math.max(...t)},formattedValue(t){return R(t)}}},_r={key:0,class:"flex flex-col h-full pt-[16px] rounded-xl"},Er={class:"h-full pt-0 pb-6 space-y-4"},Sr={class:"h-full space-y-4 custom-scrollbar"},$r={class:"flex items-center justify-between mr-2 gap-x-2"},Cr={class:"grid items-center w-full grid-cols-2 gap-x-2"},Br={class:"text-sm text-gray-800"},Dr={class:"flex justify-end",role:"progressbar","aria-valuenow":"100","aria-valuemin":"0","aria-valuemax":"100"},Nr={class:"min-w-[60px] text-end"},Vr={class:"text-sm text-gray-500"};function Tr(t,e,n,s,r,i){return r.columns?(o.openBlock(),o.createElementBlock("div",_r,[o.createElementVNode("div",Er,[o.createElementVNode("ul",Sr,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>(o.openBlock(),o.createElementBlock("li",$r,[o.createElementVNode("div",Cr,[o.createElementVNode("span",Br,o.toDisplayString(a[r.columns[0]]),1),o.createElementVNode("div",Dr,[o.createElementVNode("div",{class:"h-1.5 flex flex-col justify-center overflow-hidden bg-indigo-500 rounded-full text-xs text-white text-center whitespace-nowrap",style:o.normalizeStyle({width:`${parseFloat(a[r.columns[1]])/r.maxValue*100}%`})},null,4)])]),o.createElementVNode("div",Nr,[o.createElementVNode("span",Vr,o.toDisplayString(i.formattedValue(a[r.columns[1]])),1)])]))),256))])])])):o.createCommentVNode("",!0)}const qt=E(kr,[["render",Tr]]),Rr=Object.freeze(Object.defineProperty({__proto__:null,default:qt},Symbol.toStringTag,{value:"Module"})),zr={name:"VsListbar",mixins:[A],props:["source"],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch(t){console.error(t)}},prepareData(){var e,n,s;this.columns=Object.keys(((e=this.sourceData)==null?void 0:e[0])||{});const t=(n=this.sourceData)==null?void 0:n.map(r=>{var i;return r==null?void 0:r[(i=this.columns)==null?void 0:i[1]]});this.maxValue=Math.max(...t||[]),this.restDimensions=(s=this.columns)==null?void 0:s.filter((r,i)=>i!==0)},formattedValue(t){return R(t)},getWidth(t){return`${t/this.maxValue*100}%`}}},Lr={class:"h-full pt-[20px] list-bar"},Or={class:"space-y-2 custom-scrollbar h-full h-[calc(100%-20px)]"},Ar={class:"relative w-full truncate"},Fr={class:"relative z-[1] text-sm block py-1 px-2 w-full text-sm truncate text-gray-800"},Mr={class:"text-[14px] text-gray-500"};function Pr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Lr,[o.createElementVNode("ul",Or,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>{var c,h,d;return o.openBlock(),o.createElementBlock("li",{key:l,class:"flex items-center justify-between w-full gap-x-2"},[o.createElementVNode("div",Ar,[o.createElementVNode("span",Fr,o.toDisplayString((a==null?void 0:a[(c=r.columns)==null?void 0:c[0]])||"Без категорії"),1),o.createElementVNode("div",{class:o.normalizeClass(["absolute inset-y-0 h-full rounded start-0",a!=null&&a[(h=r.columns)==null?void 0:h[0]]?"bg-indigo-100":"bg-gray-100"]),style:o.normalizeStyle({width:i.getWidth(a==null?void 0:a[(d=r.columns)==null?void 0:d[1]])})},null,6)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.restDimensions,(p,m)=>(o.openBlock(),o.createElementBlock("div",{key:m,class:"w-20 mr-2 text-end"},[o.createElementVNode("span",Mr,o.toDisplayString(i.formattedValue(a==null?void 0:a[p])),1)]))),128))])}),128))])])}const Ht=E(zr,[["render",Pr]]),Ir=Object.freeze(Object.defineProperty({__proto__:null,default:Ht},Symbol.toStringTag,{value:"Module"})),je={week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік"},jr=["onClick"],Ur={class:"flex items-center justify-between w-full"},qr={key:0},Hr={__name:"vs-bi-dropdown",props:{title:String,options:[Array,String],value:{type:String}},emits:["selected"],setup(t,{emit:e}){const n=t,s=e,r=o.ref(!1),i=o.ref(n.value||null),a=o.ref(null),l=o.computed(()=>typeof n.options=="string"?n.options.split(",").map((g,u)=>({id:u,text:g.trim()})):n.options),c=o.computed(()=>{const g=l.value.find(u=>(u.id||u)===i.value);return g?g.text||g:n.title}),h=g=>{i.value=g.id||g,r.value=!1,s("selected",(g==null?void 0:g.id)||g),document.removeEventListener("click",d)},d=g=>{a.value&&!a.value.contains(g.target)&&(r.value=!1,document.removeEventListener("click",d))},p=()=>{r.value=!r.value,r.value?setTimeout(()=>{document.addEventListener("click",d)},200):document.removeEventListener("click",d)},m=g=>(je==null?void 0:je[g])||g;return o.onUnmounted(()=>{document.removeEventListener("click",d)}),(g,u)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("button",{type:"button","aria-expanded":"true",class:"hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",onClick:p},[o.createTextVNode(o.toDisplayString(m(c.value))+" ",1),u[0]||(u[0]=o.createElementVNode("svg",{class:"shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("path",{d:"m6 9 6 6 6-6"})],-1))]),r.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"biDropdown",ref:a,"data-hs-select-dropdown":"",class:"absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",role:"listbox",tabindex:"-1","aria-orientation":"vertical",style:{"margin-top":"10px"}},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,b=>(o.openBlock(),o.createElementBlock("div",{key:b.id||b,class:"cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:y=>h(b)},[o.createElementVNode("div",Ur,[o.createElementVNode("span",null,o.toDisplayString(m(b.text||b)),1),i.value===(b.id||b)?(o.openBlock(),o.createElementBlock("span",qr,[...u[1]||(u[1]=[o.createElementVNode("svg",{class:"shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("polyline",{points:"20 6 9 17 4 12"})],-1)])])):o.createCommentVNode("",!0)])],8,jr))),128))],512)):o.createCommentVNode("",!0)],64))}},Wr={"bi-bar":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Js)),"bi-number":o.defineAsyncComponent(()=>Promise.resolve().then(()=>ii)),"bi-text":o.defineAsyncComponent(()=>Promise.resolve().then(()=>qi)),"bi-listbar":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Ir)),"bi-pie":o.defineAsyncComponent(()=>Promise.resolve().then(()=>tr)),"bi-donut":o.defineAsyncComponent(()=>Promise.resolve().then(()=>vs)),"bi-line":o.defineAsyncComponent(()=>Promise.resolve().then(()=>or)),"bi-stat":o.defineAsyncComponent(()=>Promise.resolve().then(()=>wr)),"bi-pivot":o.defineAsyncComponent(()=>Promise.resolve().then(()=>ni)),"bi-progress":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Rr)),"bi-funnel":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Ji)),"bi-map":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Ya)),"bi-cluster":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Vl)),"bi-table":o.defineAsyncComponent(()=>Promise.resolve().then(()=>ql))},Zr={class:"flex items-center space-x-2"},Jr=o.defineComponent({__name:"vs-bi-switch",props:o.mergeModels({leftLabel:{},rightLabel:{},modelValue:{type:Boolean}},{modelValue:{default:()=>!1,type:Boolean},modelModifiers:{}}),emits:o.mergeModels(["update:is-enabled"],["update:modelValue"]),setup(t,{emit:e}){const n=e,s=o.useModel(t,"modelValue"),r=()=>{n("update:is-enabled",s)};return(i,a)=>(o.openBlock(),o.createElementBlock("div",Zr,[i.leftLabel?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["transition-colors",{"text-blue-500":!s.value}])},o.toDisplayString(i.leftLabel),3)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>s.value=l),type:"checkbox",class:"relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",onChange:r},null,544),[[o.vModelCheckbox,s.value]]),i.rightLabel?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["transition-colors",{"text-blue-500":s.value}])},o.toDisplayString(i.rightLabel),3)):o.createCommentVNode("",!0)]))}}),Gr={},Kr={class:"flex items-center justify-center h-full"};function Qr(t,e){return o.openBlock(),o.createElementBlock("div",Kr,[...e[0]||(e[0]=[o.createElementVNode("div",{class:"text-center text-gray-500"},[o.createElementVNode("h2",{class:"text-2xl font-bold"},"No data available")],-1)])])}const vr=E(Gr,[["render",Qr]]),Xr={},Yr={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function eo(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("svg",Yr,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),o.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),o.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const to={components:{VsBiDropdown:Hr,VsBiSwitch:Jr,VsNoDataChart:vr,IconDownload:E(Xr,[["render",eo]]),...Wr},props:{dashboard:{type:String},prefix:{type:String,default:""},widget:{type:String},filterURl:{type:String},dashboardWidgets:{type:Object},selectedWidget:{type:String}},data(){return{checked:[],selected:[],currentWidget:null,widgetData:[]}},computed:{computedTitle(){var e,n;const t=(e=this.dashboardWidgets)==null?void 0:e.find(s=>s.name===this.widget);return((n=t==null?void 0:t.data)==null?void 0:n.title)||(t==null?void 0:t.title)||""},computedType(){var e;const t=(e=this.dashboardWidgets)==null?void 0:e.find(n=>n.name===this.widget);return(t==null?void 0:t.type)||"text"},controls(){var e;return Object.keys(((e=this.widgetData)==null?void 0:e.controls)||{}).map(n=>{var s,r,i;return{name:n,options:typeof((s=this.widgetData)==null?void 0:s.controls)=="boolean"?!1:(i=(r=this.widgetData)==null?void 0:r.controls)==null?void 0:i[n]}})}},mounted(){this.prefix&&(V.defaults.baseURL=this.prefix)},watch:{filterURl(t){var e,n;(n=(e=this.$refs)==null?void 0:e.chart)==null||n.setFilter(t)},selectedWidget(t,e){var n;t!==e&&t===((n=this.widgetData)==null?void 0:n.id)&&this.$emit("update:current-widget-data",this.widgetData)},widgetData(t,e){if((t==null?void 0:t.id)===(e==null?void 0:e.id))return;const s=new URLSearchParams(window.top.location.search).get("widget");s&&s===(t==null?void 0:t.id)&&this.$emit("update:current-widget-data",t)}},methods:{changeStyleHandler(t,e){var n;(n=this.$refs.chart)==null||n.changeStyle(t,e)},selectedOptionHandler(t,e){let n=!0;this.selected.forEach(s=>{s.name===e&&(s.option=t,n=!1)}),n&&this.selected.push({name:e,option:t}),this.makeUpUrl()},makeUpUrl(){var e;let t=`/bi-data?dashboard=${this.dashboard}&widget=${this.widget}`;this.selected.forEach((n,s)=>{t+=`&${n.name}=${n.option}`}),(e=this.$refs.chart)==null||e.getDataFromURL(t)},exportChart(){if(this.currentWidget){const t=this.currentWidget.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#ffffff"}),e=document.createElement("a");e.href=t,e.download="chart.png",document.body.appendChild(e),e.click(),document.body.removeChild(e)}}}},no={key:0,class:"text-[16px] flex max-w-full items-center min-h-0 flex justify-between max-h-[50px] h-fit shrink-0"},so={class:"flex items-center justify-between w-full"},ro={class:"grid"},oo={class:"text-gray-800 max-h-[30px] inline-block line-clamp-1 font-semibold"},io={class:"flex flex-col justify-end"},ao={key:0,class:"flex items-center justify-end w-full gap-2"},lo={class:"w-full h-full"};function co(t,e,n,s,r,i){var d,p,m,g,u,b,y,_,w;const a=o.resolveComponent("VsBiDropdown"),l=o.resolveComponent("VsBiSwitch"),c=o.resolveComponent("IconDownload"),h=o.resolveComponent("VsNoDataChart");return o.openBlock(),o.createElementBlock("div",{ref:"widget",class:o.normalizeClass(["box-border relative h-full p-4 bg-white border border-gray-200 select-auto rounded-xl",[(p=(d=r.widgetData)==null?void 0:d.style)!=null&&p.height?`max-h-[${(g=(m=r.widgetData)==null?void 0:m.style)==null?void 0:g.height}px] h-[${(b=(u=r.widgetData)==null?void 0:u.style)==null?void 0:b.height}px]`:"max-h-[460px]"]])},[["text","cluster","map"].includes(i.computedType)?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",no,[o.createElementVNode("div",so,[o.createElementVNode("div",ro,[o.createElementVNode("span",oo,o.toDisplayString(i.computedTitle),1)]),o.createElementVNode("div",io,[(y=i.controls)!=null&&y.length?(o.openBlock(),o.createElementBlock("span",ao,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((_=i.controls)==null?void 0:_.filter(x=>(x==null?void 0:x.options)&&(x==null?void 0:x.name)!=="export"),x=>{var N;return o.openBlock(),o.createElementBlock("div",null,[Array.isArray(x==null?void 0:x.options)?(o.openBlock(),o.createBlock(a,{key:0,title:x==null?void 0:x.name,options:x==null?void 0:x.options,value:(N=r.widgetData)==null?void 0:N.data[x==null?void 0:x.name],onSelected:$=>i.selectedOptionHandler($,x==null?void 0:x.name)},null,8,["title","options","value","onSelected"])):typeof x.options=="boolean"?(o.openBlock(),o.createBlock(l,{key:1,"left-label":x==null?void 0:x.name,"is-enabled":x==null?void 0:x.options,"onUpdate:isEnabled":$=>i.changeStyleHandler(x==null?void 0:x.name,$)},null,8,["left-label","is-enabled","onUpdate:isEnabled"])):o.createCommentVNode("",!0)])}),256)),(w=i.controls)!=null&&w.some(x=>(x==null?void 0:x.name)==="export")?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:e[0]||(e[0]=(...x)=>i.exportChart&&i.exportChart(...x)),class:"h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center"},[o.createVNode(c,{height:"16",width:"16",class:"text-gray-800"})])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)])])])),o.createElementVNode("div",lo,[r.widgetData?(o.openBlock(),o.createBlock(o.resolveDynamicComponent("bi-"+i.computedType),{key:0,currentWidget:r.currentWidget,"onUpdate:currentWidget":e[1]||(e[1]=x=>r.currentWidget=x),widgetData:r.widgetData,"onUpdate:widgetData":e[2]||(e[2]=x=>r.widgetData=x),ref:"chart",dashboard:n.dashboard,title:i.computedTitle,widget:n.widget},null,40,["currentWidget","widgetData","dashboard","title","widget"])):(o.openBlock(),o.createBlock(h,{key:1,class:"w-full h-full"}))])],2)}const Wt=E(to,[["render",co]]),ho={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},po={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},uo={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},fo={class:"max-w-sm mx-auto mt-6"},mo={class:"font-medium text-gray-800 dark:text-neutral-200"},go={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function bo(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",po,[o.createElementVNode("div",null,[o.createElementVNode("div",uo,[e[0]||(e[0]=o.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),o.createElementVNode("div",fo,[o.createElementVNode("p",mo,o.toDisplayString(n.title),1),o.createElementVNode("p",go,o.toDisplayString(n.text),1)])])])])}const yo=E(ho,[["render",bo]]),xo={},wo={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function ko(t,e){return o.openBlock(),o.createElementBlock("svg",wo,[...e[0]||(e[0]=[o.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)])])}const _o=E(xo,[["render",ko]]),Eo={},So={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-refresh"};function $o(t,e){return o.openBlock(),o.createElementBlock("svg",So,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"},null,-1),o.createElementVNode("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const Co={components:{filterIcon:_o,refreshIcon:E(Eo,[["render",$o]])},props:["filterScheme"],emits:["filters:changed"],data(){return{rows:[],isFilterVisible:!1,rowList:[],activeFilters:"",filters:{}}},async mounted(){const e=await(await new URLSearchParams(window.top.location.search)).get("filter");this.filters.url=e||""},computed:{activeFiltersCount(){var t,e;return(t=this.filters)!=null&&t.url?((e=this.filters)==null?void 0:e.url.split("=").length)-1:0}},methods:{toggleFilterShown(){this.isFilterVisible=!this.isFilterVisible},handleFilterChange(t){var e,n;this.filters=t,this.activeFilters=(n=(e=this.$refs)==null?void 0:e.filter)==null?void 0:n.activeFilters,this.$emit("filters:changed",this.filters)},resetFilters(){this.$refs.filter&&this.$refs.filter.clearAll(),this.isFilterVisible=!1,this.$emit("filters:changed",""),this.activeFilters=null},closeFilter({target:t}){this.isFilterVisible&&t.classList.contains("filter-container")&&(this.isFilterVisible=!1)}}},Bo={class:"flex items-center"},Do={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"};function No(t,e,n,s,r,i){const a=o.resolveComponent("filterIcon"),l=o.resolveComponent("VsFilterList");return o.openBlock(),o.createElementBlock("div",Bo,[n.filterScheme?(o.openBlock(),o.createBlock(l,{key:0,ref:"filter",scheme:n.filterScheme,closeFilterBtn:!0,onFilterClose:e[1]||(e[1]=c=>r.isFilterVisible=!1),layout:"default","apply-vue-router":"",history:"",view:"plain",token:t.table,name:"filter",footer:!0,background:!0,onFilterChange:i.handleFilterChange},{button:o.withCtx(()=>[o.createElementVNode("button",{type:"button",class:"py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[0]||(e[0]=(...c)=>i.toggleFilterShown&&i.toggleFilterShown(...c))},[o.createVNode(a),e[2]||(e[2]=o.createTextVNode(" Фільтри ",-1)),i.activeFiltersCount>=1?(o.openBlock(),o.createElementBlock("span",Do,o.toDisplayString(i.activeFiltersCount),1)):o.createCommentVNode("",!0)])]),_:1},8,["scheme","token","onFilterChange"])):o.createCommentVNode("",!0)])}const Vo={props:["dashboardData","filters"],components:{VsFilterHeader:E(Co,[["render",No]])}},To={class:"bg-white px-5 flex gap-4 h-[90px] border border-gray-200 mt-2 rounded-xl mb-2 pt-[3px] justify-between items-center"},Ro={class:"grow"},zo={class:"text-lg font-semibold text-stone-800 dark:text-neutral-200"},Lo={type:"button",class:"inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400","data-clipboard-target":"#hs-erc","data-clipboard-action":"copy","data-clipboard-success-text":"Copied"};function Oo(t,e,n,s,r,i){var l,c;const a=o.resolveComponent("VsFilterHeader");return o.openBlock(),o.createElementBlock("div",To,[o.createElementVNode("div",Ro,[o.createElementVNode("h1",zo,o.toDisplayString((l=n.dashboardData)==null?void 0:l.title),1),o.createElementVNode("button",Lo,o.toDisplayString((c=n.dashboardData)==null?void 0:c.description),1)]),o.createVNode(a,{filterScheme:n.filters,"onFilters:changed":e[0]||(e[0]=h=>t.$emit("filters:changed",h))},null,8,["filterScheme"])])}const Ao={components:{VsWidget:Wt,VsNewNodata:yo,VsHeader:E(Vo,[["render",Oo]])},props:["id","prefix"],data(){return{widgets:[],panels:[],error:!1,selectedPanel:"",filterURl:null,dashboardData:null}},async mounted(){V.defaults.baseURL=this.prefix||"/api",await this.fetchData()},methods:{async fetchData(){if(this.id)try{const{data:t}=await V.get(`/bi-dashboard/${this.id}`);this.dashboardData=t}catch(t){console.error(t)}},columnClass(t){const e=t!=null&&t.col?t==null?void 0:t.col:12;return{1:"md:w-1/12 sm:w-full",2:"md:w-1/6 sm:w-full",3:"md:w-1/4 sm:w-full",4:"md:w-1/3 sm:w-full",6:"md:w-1/2 sm:w-full",8:"md:w-2/3 sm:w-full",10:"md:w-5/6 sm:w-full",12:"w-full"}[e]||"w-full"},async filterHandler(t){var n;this.filterURl="";let e="&filter=";(n=t==null?void 0:t.url)!=null&&n.length&&(t.url.split("|").forEach(r=>{const i=r.split("=");e+=`${i[0]}=${i[1]}`}),this.filterURl+=e)}}},Fo={class:"w-full pb-8 overflow-y-auto"},Mo={class:"grid flex-grow w-full grid-cols-12 gap-4 h-fit"};function Po(t,e,n,s,r,i){var h,d,p;const a=o.resolveComponent("VsHeader"),l=o.resolveComponent("VsNewNodata"),c=o.resolveComponent("VsWidget");return o.openBlock(),o.createElementBlock("div",Fo,[o.createElementVNode("div",null,[(h=r.dashboardData)!=null&&h.filters?(o.openBlock(),o.createBlock(a,{key:0,filters:(d=r.dashboardData)==null?void 0:d.filters,dashboardData:r.dashboardData,"onFilters:changed":e[0]||(e[0]=m=>i.filterHandler(m))},null,8,["filters","dashboardData"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Mo,[r.error||!r.dashboardData?(o.openBlock(),o.createBlock(l,{key:0,class:"col-span-12"})):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((p=r.dashboardData)==null?void 0:p.panels)||[],(m,g)=>{var u;return o.openBlock(),o.createElementBlock("div",{key:g,class:o.normalizeClass([`col-span-${m.col||12}`,"flex flex-col gap-[10px]"])},[(u=m.widgets)!=null&&u.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(m.widgets,b=>(o.openBlock(),o.createBlock(c,{key:b,dashboard:n.id,widget:b,"dashboard-widgets":r.dashboardData.widgets,"filter-u-rl":r.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))),128)):(o.openBlock(),o.createBlock(c,{key:1,class:"flex flex-col",dashboard:n.id,widget:m.widget,"dashboard-widgets":r.dashboardData.widgets,"filter-u-rl":r.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))],2)}),128))])])}const Io=E(Ao,[["render",Po]]),jo={name:"VsPivotTable",mixins:[A],data(){return{values:null,xs:null,products:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){try{const t=Array.from(new Set(this.sourceData.map(e=>e[this.dimensions[0]])));this.dimensions[0].includes("date")?this.xs=t.map(e=>v(e)):this.xs=[...t],this.products=this.dimensions.filter((e,n)=>n!=0),this.values=this.products.map((e,n)=>({name:e,data:this.sourceData.filter(s=>parseFloat(s[e])).map(s=>R(parseFloat(s[e])))}))}catch(t){console.error(t)}}}},Uo={class:"flex flex-col h-full p-5 space-y-4 rounded-xl custom-scrollbar"},qo={class:"overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 custom-scrollbar"},Ho={class:"inline-block min-w-full align-middle"},Wo={class:"min-w-full divide-y divide-gray-200"},Zo={class:"space-x-2"},Jo={scope:"col",class:"xl:min-w-[120px] min-w-48"},Go={class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"},Ko={class:"divide-y divide-gray-200 text-[12px]"},Qo={class:"py-3 size-px whitespace-nowrap"},vo={class:"flex items-center gap-x-3"},Xo={class:"font-medium text-gray-800"},Yo={class:"py-3 size-px whitespace-nowrap"},ei={class:"text-gray-600"};function ti(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Uo,[o.createElementVNode("div",qo,[o.createElementVNode("div",Ho,[o.createElementVNode("table",Wo,[o.createElementVNode("thead",null,[o.createElementVNode("tr",Zo,[e[0]||(e[0]=o.createElementVNode("th",{scope:"col",class:"min-w-[200px]"},[o.createElementVNode("div",{class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"})],-1)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.xs,a=>(o.openBlock(),o.createElementBlock("th",Jo,[o.createElementVNode("div",Go,o.toDisplayString(a),1)]))),256))])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.values,a=>(o.openBlock(),o.createElementBlock("tbody",Ko,[o.createElementVNode("tr",null,[o.createElementVNode("td",Qo,[o.createElementVNode("div",vo,[o.createElementVNode("span",Xo,o.toDisplayString(a.name),1)])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.xs,(l,c)=>(o.openBlock(),o.createElementBlock("td",Yo,[o.createElementVNode("span",ei,o.toDisplayString(a.data[c]),1)]))),256))])]))),256))])])])])}const Zt=E(jo,[["render",ti]]),ni=Object.freeze(Object.defineProperty({__proto__:null,default:Zt},Symbol.toStringTag,{value:"Module"})),si={name:"VsNumber",mixins:[A],data(){return{number:""}},computed:{formattedNumber(){return bn(this.number)},prefix(){var t,e;return(t=this.styleData)!=null&&t.prefix?(e=this.styleData)==null?void 0:e.prefix:""}},watch:{sourceData:{async handler(){this.getNumber()},deep:!0}},async mounted(){await this.getData(),this.getNumber()},methods:{onChangedData(){try{this.sourceData&&this.getNumber()}catch(t){console.error(t)}},async getNumber(){var t,e;try{this.number=((e=this.sourceData[0])==null?void 0:e[Object.keys((t=this.sourceData)==null?void 0:t[0])])||0}catch(n){console.error(n)}}}},ri={class:"text-lg lg:text-xl xl:text-2xl text-gray-800 h-[32px] flex items-center"};function oi(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",ri,o.toDisplayString(i.prefix)+o.toDisplayString(i.formattedNumber),1)}const ii=Object.freeze(Object.defineProperty({__proto__:null,default:E(si,[["render",oi]])},Symbol.toStringTag,{value:"Module"}));function Ue(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let J=Ue();function Jt(t){J=t}const Gt=/[&<>"']/,ai=new RegExp(Gt.source,"g"),Kt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,li=new RegExp(Kt.source,"g"),ci={"&":"&","<":"<",">":">",'"':""","'":"'"},Qt=t=>ci[t];function M(t,e){if(e){if(Gt.test(t))return t.replace(ai,Qt)}else if(Kt.test(t))return t.replace(li,Qt);return t}const di=/(^|[^\[])\^/g;function B(t,e){let n=typeof t=="string"?t:t.source;e=e||"";const s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(di,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,e)};return s}function vt(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const re={exec:()=>null};function Xt(t,e){const n=t.replace(/\|/g,(i,a,l)=>{let c=!1,h=a;for(;--h>=0&&l[h]==="\\";)c=!c;return c?"|":" |"}),s=n.split(/ \|/);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!s[s.length-1].trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(/\\\|/g,"|");return s}function oe(t,e,n){const s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function hi(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return-1}function Yt(t,e,n,s){const r=e.href,i=e.title?M(e.title):null,a=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){s.state.inLink=!0;const l={type:"link",raw:n,href:r,title:i,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}return{type:"image",raw:n,href:r,title:i,text:M(a)}}function pi(t,e){const n=t.match(/^(\s+)(?:```)/);if(n===null)return e;const s=n[1];return e.split(`
|
|
26
26
|
`).map(r=>{const i=r.match(/^\s+/);if(i===null)return r;const[a]=i;return a.length>=s.length?r.slice(s.length):r}).join(`
|
|
27
27
|
`)}class _e{constructor(e){D(this,"options");D(this,"rules");D(this,"lexer");this.options=e||J}space(e){const n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){const n=this.rules.block.code.exec(e);if(n){const s=n[0].replace(/^(?: {1,4}| {0,3}\t)/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?s:oe(s,`
|
|
28
28
|
`)}}}fences(e){const n=this.rules.block.fences.exec(e);if(n){const s=n[0],r=pi(s,n[3]||"");return{type:"code",raw:s,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:r}}}heading(e){const n=this.rules.block.heading.exec(e);if(n){let s=n[2].trim();if(/#$/.test(s)){const r=oe(s,"#");(this.options.pedantic||!r||/ $/.test(r))&&(s=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){const n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:oe(n[0],`
|