@stlhorizon/vue-ui 3.8.7 → 3.8.8
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/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -604,7 +604,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
604
604
|
<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
605
605
|
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
|
|
606
606
|
</svg>
|
|
607
|
-
`},a=t,o=e.ref(!1),r=()=>o.value=!o.value,l=T.cva("",{variants:{variant:{default:"",bordered:"border border-slate-200 rounded-lg overflow-hidden",filled:"bg-slate-50 border border-slate-200 rounded-lg overflow-hidden",flush:""}}}),i=T.cva("flex items-center justify-between w-full text-left transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",{variants:{size:{sm:"p-3 text-sm",md:"p-4 text-base",lg:"p-6 text-lg"}}}),u=T.cva("overflow-hidden text-slate-600 border-t border-slate-200",{variants:{size:{sm:"p-3 text-sm",md:"p-4 text-base",lg:"p-6 text-lg"}}}),m=e.computed(()=>x(l({variant:a.variant}))),p=e.computed(()=>x(i({size:a.size}))),v=e.computed(()=>x(u({size:a.size})));return(h,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(m.value)},[e.createVNode(J,{class:e.normalizeClass(p.value),"aria-expanded":o.value,onClick:r},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"header",{isOpen:o.value}),e.createVNode(n,{class:e.normalizeClass(e.unref(x)("w-5 h-5 transition-transform ml-2",{"rotate-180":o.value}))},null,8,["class"])]),_:3},8,["class","aria-expanded"]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-96","leave-active-class":"transition-all duration-200 ease-in","leave-from-class":"opacity-100 max-h-96","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(v.value)},[e.renderSlot(h.$slots,"content",{isOpen:o.value})],2)):e.createCommentVNode("",!0)]),_:3})],2))}},Du={class:"relative w-full"},Tu={class:"relative"},Au=["id","value","disabled","placeholder","required","aria-describedby"],Fu={class:"flex items-center justify-between mb-3"},Pu={class:"text-sm font-medium"},Mu={class:"grid grid-cols-7 gap-1 mb-2"},Lu={class:"grid grid-cols-7 gap-1"},ju=["disabled","onClick"],Ou={key:0,class:"mt-4 pt-3 border-t border-slate-200"},Lo={__name:"Calendar",props:{id:String,modelValue:[String,Date],disabled:Boolean,required:Boolean,min:[String,Date],max:[String,Date],placeholder:{type:String,default:"Select date"},format:{type:String,default:"MM/DD/YYYY"},clearable:{type:Boolean,default:!0},showToday:{type:Boolean,default:!0},calendarPosition:{type:String,default:"left-0"},ariaDescribedby:String},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=new Date,i=e.ref(l.getMonth()),u=e.ref(l.getFullYear()),m=e.ref(null),p=["Su","Mo","Tu","We","Th","Fr","Sa"],v=e.computed(()=>new Date(u.value,i.value).toLocaleString("default",{month:"long"})),h=e.computed(()=>new Date(u.value,i.value+1,0).getDate()),E=e.computed(()=>new Date(u.value,i.value,1).getDay()),y=e.computed(()=>{const _=new Date(u.value,i.value,0).getDate(),C=E.value;return Array.from({length:C},(z,O)=>_-C+O+1)}),b=e.computed(()=>{const _=y.value.length+h.value,C=_%7===0?0:7-_%7;return Array.from({length:C},(z,O)=>O+1)}),f=e.computed(()=>m.value?d(m.value):"");function d(_){if(!_)return"";const C=new Date(_),z=String(C.getMonth()+1).padStart(2,"0"),O=String(C.getDate()).padStart(2,"0"),G=C.getFullYear();return a.format.replace("MM",z).replace("DD",O).replace("YYYY",G)}function s(_){if(!_)return null;if(_ instanceof Date)return _;const C=new Date(_);return isNaN(C.getTime())?null:C}function c(_){if(!m.value)return!1;const C=new Date(m.value);return C.getDate()===_&&C.getMonth()===i.value&&C.getFullYear()===u.value}function g(_){const C=new Date(u.value,i.value,_);if(a.min){const z=s(a.min);if(z&&C<z)return!0}if(a.max){const z=s(a.max);if(z&&C>z)return!0}return!1}function S(){a.disabled||(r.value=!r.value)}function k(){r.value=!1}function N(){i.value===0?(i.value=11,u.value--):i.value--}function F(){i.value===11?(i.value=0,u.value++):i.value++}function L(_){if(g(_))return;const C=new Date(u.value,i.value,_);m.value=C,o("update:modelValue",C.toISOString().split("T")[0]),r.value=!1}function q(){i.value=l.getMonth(),u.value=l.getFullYear(),L(l.getDate())}function w(){m.value=null,o("update:modelValue","")}e.watch(()=>a.modelValue,_=>{if(_){const C=s(_);C&&(m.value=C,i.value=C.getMonth(),u.value=C.getFullYear())}else m.value=null},{immediate:!0});function M(_){_.key==="Escape"&&r.value&&k()}return e.onMounted(()=>{document.addEventListener("keydown",M)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",M)}),(_,C)=>(e.openBlock(),e.createElementBlock("div",Du,[e.createElementVNode("div",Tu,[e.createElementVNode("input",{id:t.id,type:"text",value:f.value,readonly:"",disabled:t.disabled,placeholder:t.placeholder,required:t.required,"aria-describedby":t.ariaDescribedby,class:"w-full px-3 py-2 pr-10 border border-slate-300 rounded-md bg-white text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 cursor-pointer disabled:bg-slate-50 disabled:text-slate-500 disabled:cursor-not-allowed",onClick:S},null,8,Au),C[2]||(C[2]=e.createElementVNode("div",{class:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"},[e.createElementVNode("svg",{class:"w-5 h-5 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1)),t.clearable&&f.value&&!t.disabled?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute right-9 top-1/2 -translate-y-1/2 p-1 hover:bg-slate-100 rounded","aria-label":"Clear date",onClick:e.withModifiers(w,["stop"])},[...C[1]||(C[1]=[e.createElementVNode("svg",{class:"w-4 h-4 text-slate-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute z-[99999] mt-2 bg-white border border-slate-200 rounded-lg shadow-lg p-4",t.calendarPosition]),onClick:C[0]||(C[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Fu,[e.createElementVNode("button",{type:"button",class:"p-1 hover:bg-gray-100 rounded","aria-label":"Previous Month",onClick:N},[...C[3]||(C[3]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 18l-6-6 6-6"})],-1)])]),e.createElementVNode("div",Pu,e.toDisplayString(v.value)+" "+e.toDisplayString(u.value),1),e.createElementVNode("button",{type:"button",class:"p-1 hover:bg-gray-100 rounded","aria-label":"Next Month",onClick:F},[...C[4]||(C[4]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 18l6-6-6-6"})],-1)])])]),e.createElementVNode("div",Mu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(p,z=>e.createElementVNode("div",{key:z,class:"text-center text-xs font-medium text-slate-600 py-1"},e.toDisplayString(z),1)),64))]),e.createElementVNode("div",Lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(z,O)=>(e.openBlock(),e.createElementBlock("div",{key:"prev-"+O,class:"text-center text-sm text-slate-300 py-2"},e.toDisplayString(z),1))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z,type:"button",disabled:g(z),class:e.normalizeClass(["w-8 h-8 text-sm rounded flex items-center justify-center",c(z)?"bg-blue-500 text-white":"hover:bg-gray-100",g(z)?"text-gray-300 cursor-not-allowed":""]),onClick:O=>L(z)},e.toDisplayString(z),11,ju))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(z,O)=>(e.openBlock(),e.createElementBlock("div",{key:"next-"+O,class:"text-center text-sm text-slate-300 py-2"},e.toDisplayString(z),1))),128))]),t.showToday?(e.openBlock(),e.createElementBlock("div",Ou,[e.createElementVNode("button",{type:"button",class:"w-full px-3 py-2 text-sm font-medium text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",onClick:q}," Today ")])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:1}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-[99998]",onClick:k})):e.createCommentVNode("",!0)]))}},Iu={class:"flex items-start justify-between"},_u={class:"flex-1 min-w-0"},Ru={key:0,class:"flex-shrink-0 ml-4"},Uu="text-lg font-semibold text-slate-900 truncate",qu="text-sm text-slate-600 mt-1",jo={__name:"Graph",props:{variant:{type:String,default:"default",validator:t=>["default","outlined","elevated","filled"].includes(t)},padding:{type:String,default:"md",validator:t=>["none","sm","md","lg","xl"].includes(t)},title:String,description:String},setup(t){const n=T.cva("rounded-lg overflow-hidden transition-all duration-200",{variants:{variant:{default:"bg-white border border-slate-200",outlined:"bg-white border-2 border-slate-300",elevated:"bg-white shadow-lg border border-slate-100",filled:"bg-slate-50 border border-slate-200"},padding:{none:"",sm:"p-3",md:"p-4",lg:"p-6",xl:"p-8"}},defaultVariants:{variant:"default",padding:"md"}}),a=T.cva("border-b border-slate-100 last:border-b-0",{variants:{padding:{none:"p-4 pb-0",sm:"px-3 pt-3",md:"px-4 pt-4",lg:"px-6 pt-6",xl:"px-8 pt-8"}}}),o=T.cva("border-b border-slate-100",{variants:{padding:{none:"p-4 pb-0",sm:"px-3 py-3",md:"px-4 py-4",lg:"px-6 py-6",xl:"px-8 py-8"}}}),r=T.cva("",{variants:{padding:{none:"p-4",sm:"p-3",md:"p-4",lg:"p-6",xl:"p-8"}}}),l=T.cva("border-t border-slate-100 bg-slate-50/50",{variants:{padding:{none:"p-4 pt-0",sm:"px-3 pb-3",md:"px-4 pb-4",lg:"px-6 pb-6",xl:"px-8 pb-8"}}}),i=T.cva("border-t border-slate-100 bg-slate-50/50",{variants:{padding:{none:"p-4 pt-0",sm:"px-3 pb-3",md:"px-4 pb-4",lg:"px-6 pb-6",xl:"px-8 pb-8"}}});return(u,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(x)(e.unref(n)({variant:t.variant,padding:t.padding})))},[u.$slots.header||t.title||t.description?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(x)(e.unref(a)({padding:t.padding})))},[e.renderSlot(u.$slots,"header",{},()=>[e.createElementVNode("div",Iu,[e.createElementVNode("div",_u,[t.title?(e.openBlock(),e.createElementBlock("h3",{key:0,class:e.normalizeClass(Uu)},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(qu)},e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),u.$slots.actions?(e.openBlock(),e.createElementBlock("div",Ru,[e.renderSlot(u.$slots,"actions")])):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),u.$slots.filters?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(x)(e.unref(o)({padding:t.padding})))},[e.renderSlot(u.$slots,"filters")],2)):e.createCommentVNode("",!0),u.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(x)(e.unref(r)({padding:t.padding})))},[e.renderSlot(u.$slots,"default")],2)):e.createCommentVNode("",!0),u.$slots.legend?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(e.unref(x)(e.unref(l)({padding:t.padding})))},[e.renderSlot(u.$slots,"legend")],2)):e.createCommentVNode("",!0),u.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(e.unref(x)(e.unref(i)({padding:t.padding})))},[e.renderSlot(u.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}},Hu={class:"w-full h-full"},Wu=["width","height","viewBox"],Yu={key:0},Gu=["x1","y1","x2","y2","stroke"],Ku=["x","y","width","height","fill","onMouseenter"],Xu={key:1},Qu=["x","y"],Ju={key:2},Zu=["x","y"],em={key:3},tm=["x","y","width","height","fill","stroke"],am=["x","y"],Oo={__name:"BarChart",props:{data:{type:Array,required:!0},labels:{type:Array,default:()=>[]},colors:{type:Array,default:()=>["#3b82f6","#ef4444","#10b981","#f59e0b","#8b5cf6"]},width:{type:Number,default:400},height:{type:Number,default:300},padding:{type:Object,default:()=>({top:20,right:20,bottom:60,left:60})},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},gridColor:{type:String,default:"#e5e7eb"},barClasses:{type:String,default:"transition-all duration-200 hover:opacity-80 cursor-pointer"},axisLabelClasses:{type:String,default:"fill-slate-600 text-xs font-medium"},tooltipBackground:{type:String,default:"#1f2937"},tooltipBorder:{type:String,default:"#374151"},tooltipTextClasses:{type:String,default:"fill-white text-xs font-medium"},maxValue:{type:Number,default:null}},emits:["bar-click","bar-hover"],setup(t,{emit:n}){const a=t,o=n,r=e.ref({visible:!1,x:0,y:0,width:0,height:0,content:""}),l=e.computed(()=>a.maxValue||Math.max(...a.data)),i=e.computed(()=>(a.width-a.padding.left-a.padding.right)/a.data.length*.8),u=e.computed(()=>(a.width-a.padding.left-a.padding.right)/a.data.length*.2),m=e.computed(()=>{const d=[],s=a.height-a.padding.top-a.padding.bottom,c=5;for(let g=0;g<=c;g++){const S=a.padding.top+s/c*g;d.push(S)}return d}),p=d=>a.padding.left+d*(i.value+u.value)+u.value/2,v=d=>{const s=a.height-a.padding.top-a.padding.bottom,c=s/l.value;return a.padding.top+s-d*c},h=d=>{const c=(a.height-a.padding.top-a.padding.bottom)/l.value;return d*c},E=d=>a.colors[d%a.colors.length],y=d=>{const s=a.height-a.padding.top-a.padding.bottom,c=(a.height-a.padding.bottom-d)/s*l.value;return Math.round(c)},b=(d,s,c)=>{const g=d.target.getBoundingClientRect(),S=a.labels[c]||`Item ${c+1}`;r.value={visible:!0,x:g.left+g.width/2,y:g.top,width:80,height:24,content:`${S}: ${s}`},o("bar-hover",{value:s,index:c,label:S})},f=()=>{r.value.visible=!1};return(d,s)=>(e.openBlock(),e.createElementBlock("div",Hu,[(e.openBlock(),e.createElementBlock("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,class:"overflow-visible"},[t.showGrid?(e.openBlock(),e.createElementBlock("g",Yu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,c=>(e.openBlock(),e.createElementBlock("line",{key:`grid-${c}`,x1:t.padding.left,y1:c,x2:t.width-t.padding.right,y2:c,stroke:t.gridColor,"stroke-width":"1","stroke-dasharray":"2,2"},null,8,Gu))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(c,g)=>(e.openBlock(),e.createElementBlock("rect",{key:`bar-${g}`,x:p(g),y:v(c),width:i.value,height:h(c),fill:E(g),class:e.normalizeClass(t.barClasses),onMouseenter:S=>b(S,c,g),onMouseleave:f},null,42,Ku))),128))]),t.showXAxis?(e.openBlock(),e.createElementBlock("g",Xu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.labels,(c,g)=>(e.openBlock(),e.createElementBlock("text",{key:`xlabel-${g}`,x:p(g)+i.value/2,y:t.height-t.padding.bottom+20,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"middle"},e.toDisplayString(c),11,Qu))),128))])):e.createCommentVNode("",!0),t.showYAxis?(e.openBlock(),e.createElementBlock("g",Ju,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,c=>(e.openBlock(),e.createElementBlock("text",{key:`ylabel-${c}`,x:t.padding.left-10,y:c+4,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"end"},e.toDisplayString(y(c)),11,Zu))),128))])):e.createCommentVNode("",!0),r.value.visible?(e.openBlock(),e.createElementBlock("g",em,[e.createElementVNode("rect",{x:r.value.x-r.value.width/2,y:r.value.y-r.value.height-10,width:r.value.width,height:r.value.height,fill:t.tooltipBackground,stroke:t.tooltipBorder,"stroke-width":"1",rx:"4"},null,8,tm),e.createElementVNode("text",{x:r.value.x,y:r.value.y-r.value.height/2-2,class:e.normalizeClass(t.tooltipTextClasses),"text-anchor":"middle"},e.toDisplayString(r.value.content),11,am)])):e.createCommentVNode("",!0)],8,Wu))]))}},nm={class:"w-full h-full"},om=["width","height","viewBox"],rm={key:0},lm=["x1","y1","x2","y2","stroke"],sm=["d","stroke","stroke-width"],im={key:1},cm=["cx","cy","r","fill","stroke","onMouseenter"],dm=["d","fill","fill-opacity"],um={key:3},mm=["x","y"],fm={key:4},pm=["x","y"],gm={key:5},vm=["x","y","width","height","fill","stroke"],hm=["x","y"],Io={__name:"LineChart",props:{data:{type:Array,required:!0},labels:{type:Array,default:()=>[]},width:{type:Number||String,default:400},height:{type:Number,default:300},padding:{type:Object,default:()=>({top:20,right:20,bottom:60,left:60})},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},showPoints:{type:Boolean,default:!0},fillArea:{type:Boolean,default:!1},gridColor:{type:String,default:"#e5e7eb"},lineColor:{type:String,default:"#3b82f6"},strokeWidth:{type:Number,default:2},pointRadius:{type:Number,default:4},pointColor:{type:String,default:"#ffffff"},fillColor:{type:String,default:"#3b82f6"},fillOpacity:{type:Number,default:.1},lineClasses:{type:String,default:"transition-all duration-200"},pointClasses:{type:String,default:"transition-all duration-200 hover:r-6 cursor-pointer"},axisLabelClasses:{type:String,default:"fill-slate-600 text-xs font-medium"},tooltipBackground:{type:String,default:"#1f2937"},tooltipBorder:{type:String,default:"#374151"},tooltipTextClasses:{type:String,default:"fill-white text-xs font-medium"},maxValue:{type:Number,default:null}},emits:["point-click","point-hover"],setup(t,{emit:n}){const a=t,o=n,r=e.ref({visible:!1,x:0,y:0,width:0,height:0,content:""}),l=e.computed(()=>a.maxValue||Math.max(...a.data)),i=e.computed(()=>a.data.map((f,d)=>({x:v(d),y:h(f),value:f}))),u=e.computed(()=>i.value.length===0?"":i.value.map((d,s)=>`${s===0?"M":"L"} ${d.x} ${d.y}`).join(" ")),m=e.computed(()=>{if(i.value.length===0)return"";const f=i.value.map((c,g)=>`${g===0?"M":"L"} ${c.x} ${c.y}`).join(" "),d=a.height-a.padding.bottom,s=`L ${i.value[i.value.length-1].x} ${d} L ${i.value[0].x} ${d} Z`;return f+" "+s}),p=e.computed(()=>{const f=[],d=a.height-a.padding.top-a.padding.bottom,s=5;for(let c=0;c<=s;c++){const g=a.padding.top+d/s*c;f.push(g)}return f}),v=f=>{const s=(a.width-a.padding.left-a.padding.right)/(a.data.length-1||1);return a.padding.left+f*s},h=f=>{const d=a.height-a.padding.top-a.padding.bottom,s=d/l.value;return a.padding.top+d-f*s},E=f=>{const d=a.height-a.padding.top-a.padding.bottom,s=(a.height-a.padding.bottom-f)/d*l.value;return Math.round(s)},y=(f,d,s)=>{const c=f.target.getBoundingClientRect(),g=a.labels[s]||`Point ${s+1}`;r.value={visible:!0,x:c.left+c.width/2,y:c.top,width:80,height:24,content:`${g}: ${d}`},o("point-hover",{value:d,index:s,label:g})},b=()=>{r.value.visible=!1};return(f,d)=>(e.openBlock(),e.createElementBlock("div",nm,[(e.openBlock(),e.createElementBlock("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,class:"overflow-visible"},[t.showGrid?(e.openBlock(),e.createElementBlock("g",rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,s=>(e.openBlock(),e.createElementBlock("line",{key:`grid-${s}`,x1:t.padding.left,y1:s,x2:t.width-t.padding.right,y2:s,stroke:t.gridColor,"stroke-width":"1","stroke-dasharray":"2,2"},null,8,lm))),128))])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:u.value,stroke:t.lineColor,"stroke-width":t.strokeWidth,fill:"none",class:e.normalizeClass(t.lineClasses)},null,10,sm),t.showPoints?(e.openBlock(),e.createElementBlock("g",im,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(s,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:s.x,cy:s.y,r:t.pointRadius,fill:t.pointColor,stroke:t.lineColor,"stroke-width":2,class:e.normalizeClass(t.pointClasses),onMouseenter:g=>y(g,s.value,c),onMouseleave:b},null,42,cm))),128))])):e.createCommentVNode("",!0),t.fillArea?(e.openBlock(),e.createElementBlock("path",{key:2,d:m.value,fill:t.fillColor,"fill-opacity":t.fillOpacity},null,8,dm)):e.createCommentVNode("",!0),t.showXAxis?(e.openBlock(),e.createElementBlock("g",um,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.labels,(s,c)=>(e.openBlock(),e.createElementBlock("text",{key:`xlabel-${c}`,x:v(c),y:t.height-t.padding.bottom+20,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"middle"},e.toDisplayString(s),11,mm))),128))])):e.createCommentVNode("",!0),t.showYAxis?(e.openBlock(),e.createElementBlock("g",fm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,s=>(e.openBlock(),e.createElementBlock("text",{key:`ylabel-${s}`,x:t.padding.left-10,y:s+4,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"end"},e.toDisplayString(E(s)),11,pm))),128))])):e.createCommentVNode("",!0),r.value.visible?(e.openBlock(),e.createElementBlock("g",gm,[e.createElementVNode("rect",{x:r.value.x-r.value.width/2,y:r.value.y-r.value.height-10,width:r.value.width,height:r.value.height,fill:t.tooltipBackground,stroke:t.tooltipBorder,"stroke-width":"1",rx:"4"},null,8,vm),e.createElementVNode("text",{x:r.value.x,y:r.value.y-r.value.height/2-2,class:e.normalizeClass(t.tooltipTextClasses),"text-anchor":"middle"},e.toDisplayString(r.value.content),11,hm)])):e.createCommentVNode("",!0)],8,om))]))}},bm={class:"bg-white border-b border-gray-200"},ym={key:0,class:"flex items-center gap-3 min-w-64"},xm={class:"relative flex-1"},km={class:"relative flex-1"},wm={key:1,class:"min-w-40"},Cm={class:"relative"},Bm={key:2,class:"min-w-40"},Vm={class:"relative"},Sm=["value"],Em={key:3,class:"flex items-center gap-2"},Nm={class:"flex items-center gap-3 ml-auto"},$m={class:"flex items-center gap-3 flex-wrap"},zm=["onClick"],_o={__name:"GraphFilters",props:{showDateFilter:{type:Boolean,default:!0},showChartTypeFilter:{type:Boolean,default:!0},showExport:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!0},dataSources:{type:Array,default:()=>[]},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:dateFrom","update:dateTo","update:chartType","update:dataSource","export","refresh","clear-filters"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),l=e.ref(""),i=e.ref("bar"),u=e.ref(""),m=T.cva("flex flex-wrap items-center gap-4",{variants:{variant:{default:"bg-white",minimal:"bg-transparent",bordered:"bg-gray-50"},padding:{compact:"px-4 py-3",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),p=e.computed(()=>r.value||l.value||u.value),v=e.computed(()=>{const q=[];if(r.value||l.value){let w="";r.value&&l.value?w=`${r.value} to ${l.value}`:r.value?w=`From ${r.value}`:l.value&&(w=`Until ${l.value}`),w&&q.push({key:"date",label:"Date Range",value:w,icon:"calendar"})}if(u.value){const w=a.dataSources.find(M=>M.value===u.value);q.push({key:"dataSource",label:"Data Source",value:w?.label||u.value,icon:"database"})}return q}),h=e.computed(()=>x(m({variant:a.variant,padding:a.padding}))),E=e.computed(()=>"w-full pl-10 pr-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm"),y=e.computed(()=>"w-full pr-8 appearance-none border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm py-2 pl-3"),b=e.computed(()=>"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 bg-white px-3 py-2 rounded-lg text-sm font-medium transition-all"),f=e.computed(()=>"text-white bg-blue-600 hover:bg-blue-700 border border-blue-600 px-3 py-2 rounded-lg text-sm font-medium transition-all"),d=e.computed(()=>"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 bg-white px-3 py-2 rounded-lg text-sm font-medium transition-all"),s=e.computed(()=>"px-6 py-3 bg-blue-50 border-t border-blue-100"),c=e.computed(()=>"text-sm font-semibold text-blue-800"),g=e.computed(()=>"flex items-center gap-1.5 bg-white border border-blue-200 text-blue-800 px-3 py-1.5 rounded-full text-sm font-medium"),S=e.computed(()=>"text-blue-600 hover:text-blue-800 ml-1 hover:bg-blue-100 rounded-full p-0.5 transition-all"),k=q=>{i.value=q.target.value,o("update:chartType",q.target.value)},N=q=>{u.value=q.target.value,o("update:dataSource",q.target.value)},F=()=>{r.value="",l.value="",u.value="",o("clear-filters")},L=q=>{switch(q){case"date":r.value="",l.value="";break;case"dataSource":u.value="";break}};return e.watch(()=>r.value,q=>{o("update:dateFrom",q)}),e.watch(()=>l.value,q=>{o("update:dateTo",q)}),(q,w)=>(e.openBlock(),e.createElementBlock("div",bm,[e.createElementVNode("div",{class:e.normalizeClass(h.value)},[t.showDateFilter?(e.openBlock(),e.createElementBlock("div",ym,[e.createElementVNode("div",xm,[e.createVNode(I,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":w[0]||(w[0]=M=>r.value=M),type:"date",class:e.normalizeClass(E.value),placeholder:"From date"},null,2),[[e.vModelText,r.value]])]),w[6]||(w[6]=e.createElementVNode("span",{class:"text-gray-500 text-sm"},"to",-1)),e.createElementVNode("div",km,[e.createVNode(I,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":w[1]||(w[1]=M=>l.value=M),type:"date",class:e.normalizeClass(E.value),placeholder:"To date"},null,2),[[e.vModelText,l.value]])])])):e.createCommentVNode("",!0),t.showChartTypeFilter?(e.openBlock(),e.createElementBlock("div",wm,[e.createElementVNode("div",Cm,[e.createVNode(se,{modelValue:i.value,"onUpdate:modelValue":w[2]||(w[2]=M=>i.value=M),class:e.normalizeClass(y.value),onChange:k},{default:e.withCtx(()=>[...w[7]||(w[7]=[e.createElementVNode("option",{value:"bar"}," Bar Chart ",-1),e.createElementVNode("option",{value:"line"}," Line Chart ",-1),e.createElementVNode("option",{value:"pie"}," Pie Chart ",-1)])]),_:1},8,["modelValue","class"]),e.createVNode(I,{icon:"chart-bar",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),t.dataSources.length>0?(e.openBlock(),e.createElementBlock("div",Bm,[e.createElementVNode("div",Vm,[e.createVNode(se,{modelValue:u.value,"onUpdate:modelValue":w[3]||(w[3]=M=>u.value=M),class:e.normalizeClass(y.value),onChange:N},{default:e.withCtx(()=>[w[8]||(w[8]=e.createElementVNode("option",{value:""}," All Sources ",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataSources,M=>(e.openBlock(),e.createElementBlock("option",{key:M.value,value:M.value},e.toDisplayString(M.label),9,Sm))),128))]),_:1},8,["modelValue","class"]),e.createVNode(I,{icon:"database",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),q.$slots.filters?(e.openBlock(),e.createElementBlock("div",Em,[e.renderSlot(q.$slots,"filters")])):e.createCommentVNode("",!0),e.createElementVNode("div",Nm,[p.value?(e.openBlock(),e.createBlock(J,{key:0,class:e.normalizeClass(b.value),onClick:F},{default:e.withCtx(()=>[e.createVNode(I,{icon:"rotate-left",class:"w-4 h-4 mr-2"}),w[9]||(w[9]=e.createTextVNode(" Clear Filters ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showExport?(e.openBlock(),e.createBlock(J,{key:1,class:e.normalizeClass(f.value),onClick:w[4]||(w[4]=M=>q.$emit("export"))},{default:e.withCtx(()=>[e.createVNode(I,{icon:"download",class:"w-4 h-4 mr-2"}),w[10]||(w[10]=e.createTextVNode(" Export ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showRefresh?(e.openBlock(),e.createBlock(J,{key:2,class:e.normalizeClass(d.value),onClick:w[5]||(w[5]=M=>q.$emit("refresh"))},{default:e.withCtx(()=>[e.createVNode(I,{icon:"sync",class:"w-4 h-4 mr-2"}),w[11]||(w[11]=e.createTextVNode(" Refresh ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0)])],2),v.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(s.value)},[e.createElementVNode("div",$m,[e.createElementVNode("span",{class:e.normalizeClass(c.value)},"Active filters:",2),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,M=>(e.openBlock(),e.createElementBlock("div",{key:M.key,class:e.normalizeClass(g.value)},[e.createVNode(I,{icon:M.icon,class:"w-3 h-3"},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(M.label)+": "+e.toDisplayString(M.value),1),e.createElementVNode("button",{class:e.normalizeClass(S.value),onClick:_=>L(M.key)},[e.createVNode(I,{icon:"xmark",class:"w-3 h-3"})],10,zm)],2))),128))])],2)):e.createCommentVNode("",!0)]))}},Dm={class:"flex items-start justify-between"},Tm={key:0,class:"flex items-center gap-2"},ga={__name:"DataTableHeader",props:{title:{type:String,default:null},description:{type:String,default:null},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},setup(t){const n=t,a=T.cva("border-b border-slate-200",{variants:{variant:{default:"bg-white",minimal:"bg-transparent border-none",bordered:"bg-slate-50 border-2"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),o=T.cva("font-semibold text-slate-900",{variants:{size:{sm:"text-base",md:"text-lg",lg:"text-xl"}},defaultVariants:{size:"md"}}),r=T.cva("text-slate-600 mt-1",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),l=e.computed(()=>x(a({variant:n.variant,padding:n.padding}))),i=e.computed(()=>x(o({size:"md"}))),u=e.computed(()=>x(r({size:"md"})));return(m,p)=>t.title||t.description||m.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(l.value)},[e.renderSlot(m.$slots,"header",{},()=>[e.createElementVNode("div",Dm,[e.createElementVNode("div",null,[t.title?(e.openBlock(),e.createBlock(it,{key:0,class:e.normalizeClass(i.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1},8,["class"])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createBlock(it,{key:1,class:e.normalizeClass(u.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1},8,["class"])):e.createCommentVNode("",!0)]),m.$slots.filters?(e.openBlock(),e.createElementBlock("div",Tm,[e.renderSlot(m.$slots,"filters")])):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0)}},Am={class:"flex items-center justify-between"},Fm={key:0,class:"text-sm text-slate-600"},Pm={key:1,class:"text-sm text-slate-600"},Mm={key:2,class:"flex items-center gap-4"},Lm={key:3,class:"flex items-center gap-4"},jm={class:"flex items-center gap-2"},Om={class:"flex items-center gap-1"},Im=["disabled"],_m=["disabled"],Rm={class:"flex items-center gap-1"},Um=["onClick"],qm=["disabled"],Hm=["disabled"],Wm={class:"text-sm text-slate-600 ml-4"},va={__name:"DataTablePagination",props:{currentPage:{type:Number,required:!0},totalPages:{type:Number,required:!0},total:{type:Number,required:!0},pageSize:{type:Number,required:!0},showPagination:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},selectedCount:{type:Number,default:0},pageSizeOptions:{type:Array,default:()=>[5,10,25,50,100]},maxVisiblePages:{type:Number,default:7},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:currentPage","update:pageSize"],setup(t){const n=t,a=T.cva("border-t border-slate-200",{variants:{variant:{default:"bg-slate-50",minimal:"bg-transparent border-slate-100",bordered:"bg-slate-100 border-t-2 border-slate-300"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),o=T.cva("text-sm font-medium border rounded-md transition-colors duration-200",{variants:{state:{active:"bg-blue-600 text-white border-blue-600",inactive:"bg-white text-slate-700 border-slate-300 hover:bg-slate-50",disabled:"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed"},size:{sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"}},defaultVariants:{state:"inactive",size:"md"}}),r=T.cva("text-slate-700",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{size:"md"}}),l=T.cva("border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm min-w-[60px] focus:border-transparent",{variants:{size:{sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"}},defaultVariants:{size:"sm"}}),i=e.computed(()=>(n.currentPage-1)*n.pageSize+1),u=e.computed(()=>Math.min(n.currentPage*n.pageSize,n.total)),m=e.computed(()=>{const y=[],b=n.totalPages,f=n.currentPage,d=n.maxVisiblePages;if(b<=d)for(let s=1;s<=b;s++)y.push(s);else{const s=Math.floor(d/2);let c=Math.max(1,f-s),g=Math.min(b,c+d-1);g-c+1<d&&(c=Math.max(1,g-d+1));for(let S=c;S<=g;S++)y.push(S)}return y}),p=e.computed(()=>x(a({variant:n.variant,padding:n.padding}))),v=e.computed(()=>x(r({size:"md"}))),h=e.computed(()=>x(l({size:"sm"}))),E=(y,b)=>{let f="inactive";return b?f="disabled":y&&(f="active"),x(o({state:f,size:"md"}))};return(y,b)=>t.showPagination||y.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(p.value)},[e.createElementVNode("div",Am,[t.selectable&&t.selectedCount>0?(e.openBlock(),e.createElementBlock("div",Fm,e.toDisplayString(t.selectedCount)+" of "+e.toDisplayString(t.total)+" selected ",1)):(e.openBlock(),e.createElementBlock("div",Pm," Showing "+e.toDisplayString(i.value)+" to "+e.toDisplayString(u.value)+" of "+e.toDisplayString(t.total)+" entries ",1)),y.$slots.footer?(e.openBlock(),e.createElementBlock("div",Mm,[e.renderSlot(y.$slots,"footer")])):e.createCommentVNode("",!0),t.showPagination?(e.openBlock(),e.createElementBlock("div",Lm,[e.createElementVNode("div",jm,[e.createVNode(me,{for:"pageSize",class:e.normalizeClass(v.value),inline:!0},{default:e.withCtx(()=>[...b[5]||(b[5]=[e.createTextVNode("Show:",-1)])]),_:1},8,["class"]),e.createVNode(se,{id:"pageSize","model-value":t.pageSize.toString(),class:e.normalizeClass(h.value),"onUpdate:modelValue":b[0]||(b[0]=f=>y.$emit("update:pageSize",parseInt(f)))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pageSizeOptions,f=>(e.openBlock(),e.createBlock(ua,{key:f,value:f.toString(),label:f.toString()},null,8,["value","label"]))),128))]),_:1},8,["model-value","class"])]),e.createElementVNode("div",Om,[e.createElementVNode("button",{disabled:t.currentPage===1,class:e.normalizeClass(E(!1,t.currentPage===1)),title:"First page",onClick:b[1]||(b[1]=f=>y.$emit("update:currentPage",1))},[...b[6]||(b[6]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"})],-1)])],10,Im),e.createElementVNode("button",{disabled:t.currentPage===1,class:e.normalizeClass(E(!1,t.currentPage===1)),title:"Previous page",onClick:b[2]||(b[2]=f=>y.$emit("update:currentPage",t.currentPage-1))},[...b[7]||(b[7]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)])],10,_m),e.createElementVNode("div",Rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,f=>(e.openBlock(),e.createElementBlock("button",{key:f,class:e.normalizeClass(E(f===t.currentPage,!1)),onClick:d=>y.$emit("update:currentPage",f)},e.toDisplayString(f),11,Um))),128))]),e.createElementVNode("button",{disabled:t.currentPage===t.totalPages,class:e.normalizeClass(E(!1,t.currentPage===t.totalPages)),title:"Next page",onClick:b[3]||(b[3]=f=>y.$emit("update:currentPage",t.currentPage+1))},[...b[8]||(b[8]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})],-1)])],10,qm),e.createElementVNode("button",{disabled:t.currentPage===t.totalPages,class:e.normalizeClass(E(!1,t.currentPage===t.totalPages)),title:"Last page",onClick:b[4]||(b[4]=f=>y.$emit("update:currentPage",t.totalPages))},[...b[9]||(b[9]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5"})],-1)])],10,Hm)]),e.createElementVNode("div",Wm," Page "+e.toDisplayString(t.currentPage)+" of "+e.toDisplayString(t.totalPages),1)])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)}},yt=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},Ym={key:0,class:"loader__backdrop"},Gm={class:"loader__container"},Km={key:0,class:"loader__text loader__text--top"},Xm={key:1,class:"loader__spin"},Qm={key:2,class:"loader__pulse"},Jm={key:3,class:"loader__bounce"},Zm={key:4,class:"loader__ripple"},ef={key:5,class:"loader__bars"},tf={key:6,class:"loader__dots"},af={key:7,class:"loader__ring"},nf={key:8,class:"loader__spinner-text"},of={key:9,class:"loader__text loader__text--bottom"},rf={__name:"Loader",props:{loading:{type:Boolean,default:!0},type:{type:String,default:"spin",validator:t=>["spin","pulse","bounce","ripple","bars","dots","ring","spinner-text"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large","xl"].includes(t)},color:{type:String,default:"#3b82f6"},backgroundColor:{type:String,default:"rgba(255, 255, 255, 0.9)"},text:{type:String,default:""},textPosition:{type:String,default:"bottom",validator:t=>["top","bottom"].includes(t)},overlay:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(t){return(n,a)=>t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loader",`loader--${t.type}`,`loader--${t.size}`,t.overlay?"loader--overlay":"",t.fullscreen?"loader--fullscreen":""]),style:e.normalizeStyle({"--loader-color":t.color,"--loader-bg":t.backgroundColor})},[t.overlay?(e.openBlock(),e.createElementBlock("div",Ym)):e.createCommentVNode("",!0),e.createElementVNode("div",Gm,[t.text&&t.textPosition==="top"?(e.openBlock(),e.createElementBlock("div",Km,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),t.type==="spin"?(e.openBlock(),e.createElementBlock("div",Xm)):t.type==="pulse"?(e.openBlock(),e.createElementBlock("div",Qm)):t.type==="bounce"?(e.openBlock(),e.createElementBlock("div",Jm,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,o=>e.createElementVNode("div",{key:o,class:"loader__bounce-dot",style:e.normalizeStyle({animationDelay:`${(o-1)*.1}s`})},null,4)),64))])):t.type==="ripple"?(e.openBlock(),e.createElementBlock("div",Zm,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,o=>e.createElementVNode("div",{key:o,class:"loader__ripple-ring",style:e.normalizeStyle({animationDelay:`${(o-1)*.5}s`})},null,4)),64))])):t.type==="bars"?(e.openBlock(),e.createElementBlock("div",ef,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,o=>e.createElementVNode("div",{key:o,class:"loader__bar",style:e.normalizeStyle({animationDelay:`${(o-1)*.1}s`})},null,4)),64))])):t.type==="dots"?(e.openBlock(),e.createElementBlock("div",tf,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,o=>e.createElementVNode("div",{key:o,class:"loader__dot",style:e.normalizeStyle({animationDelay:`${(o-1)*.16}s`})},null,4)),64))])):t.type==="ring"?(e.openBlock(),e.createElementBlock("div",af,[...a[0]||(a[0]=[e.createElementVNode("div",{class:"loader__ring-track"},null,-1),e.createElementVNode("div",{class:"loader__ring-fill"},null,-1)])])):t.type==="spinner-text"?(e.openBlock(),e.createElementBlock("div",nf,[...a[1]||(a[1]=[e.createElementVNode("div",{class:"loader__spinner"},null,-1)])])):e.createCommentVNode("",!0),t.text&&t.textPosition==="bottom"?(e.openBlock(),e.createElementBlock("div",of,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)])],6)):e.createCommentVNode("",!0)}},Oe=yt(rf,[["__scopeId","data-v-68532350"]]),lf={class:"relative"},sf={class:"flex items-center justify-center"},cf=["onClick"],df={class:"flex items-center gap-2"},uf={key:1,class:"flex flex-col"},mf=["onClick"],ff=["onClick"],pf={key:1},gf={key:1,class:"flex items-center gap-1 justify-center"},vf={key:1,class:"text-xs"},hf={key:2},bf=["colspan"],yf={class:"flex flex-col items-center justify-center py-12"},xf={class:"text-slate-400 mb-4 flex justify-center"},kf={class:"text-slate-600 text-lg font-medium mb-2"},wf={class:"text-slate-500 text-sm"},Cf={class:"p-6"},Bf={class:"text-xl font-bold text-gray-700 whitespace-pre-wrap break-words"},Vf={__name:"DataTable",props:{data:{type:Array,required:!0},columns:{type:Array,required:!0},title:{type:String,default:null},description:{type:String,default:null},selectable:{type:Boolean,default:!1},selectedItems:{type:Array,default:()=>[]},sortBy:{type:String,default:null},sortOrder:{type:String,default:"asc",validator:t=>["asc","desc"].includes(t)},pageSize:{type:Number,default:10},showPagination:{type:Boolean,default:!0},striped:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},clickableRows:{type:Boolean,default:!1},emptyText:{type:String,default:"No data available"},emptySubtitle:{type:String,default:"Try adjusting your search or filter criteria"},rowKey:{type:String,default:"id"},variant:{type:String,default:"default",validator:t=>["default","bordered","minimal"].includes(t)},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},headerVariant:{type:String,default:"default"},headerPadding:{type:String,default:"normal"},paginationVariant:{type:String,default:"default"},paginationPadding:{type:String,default:"normal"},actions:{type:Array,default:()=>[]},showActionsColumn:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},dataLoading:{type:Boolean,default:!1},sortLoading:{type:Boolean,default:!1},paginationLoading:{type:Boolean,default:!1},bulkLoading:{type:Boolean,default:!1},rowLoading:{type:Object,default:()=>({})},loadingType:{type:String,default:"dots",validator:t=>["spin","pulse","bounce","ripple","bars","dots","ring"].includes(t)},loadingSize:{type:String,default:"medium",validator:t=>["small","medium","large","xl"].includes(t)},loadingColor:{type:String,default:"#3b82f6"},loadingText:{type:String,default:"Loading..."},loadingTextPosition:{type:String,default:"bottom",validator:t=>["top","bottom"].includes(t)},loadingBackground:{type:String,default:"rgba(255, 255, 255, 0.95)"},showSkeleton:{type:Boolean,default:!0},skeletonRows:{type:Number,default:5}},emits:["selection-change","sort-change","row-click","page-change","page-size-change","refresh","action"],setup(t,{expose:n,emit:a}){const o=t,r=a,l=e.ref(1),i=e.ref(o.pageSize),u=e.ref(o.sortBy),m=e.ref(o.sortOrder),p=e.ref(!1),v=e.ref(""),h=T.cva("bg-white border border-slate-200 rounded-lg overflow-hidden",{variants:{variant:{default:"shadow-sm",bordered:"border-2 border-slate-300",minimal:"border-none shadow-none bg-transparent"}},defaultVariants:{variant:"default"}}),E=T.cva("min-w-full",{variants:{variant:{default:"divide-y divide-slate-200",bordered:"border-collapse [&_td]:border [&_th]:border",minimal:"divide-y divide-slate-100"}},defaultVariants:{variant:"default"}}),y=T.cva("",{variants:{variant:{default:"bg-slate-50",bordered:"bg-slate-100 border-b-2 border-slate-300",minimal:"bg-transparent border-b border-slate-200"}},defaultVariants:{variant:"default"}}),b=T.cva("divide-y",{variants:{variant:{default:"bg-white divide-slate-200",bordered:"bg-white divide-slate-300",minimal:"bg-transparent divide-slate-100"}},defaultVariants:{variant:"default"}}),f=e.computed(()=>{let $=[...o.data];if(u.value){const j=o.columns.find(R=>R.key===u.value);j&&$.sort((R,ee)=>{const Y=w(R,j),Se=w(ee,j);return Y<Se?m.value==="asc"?-1:1:Y>Se?m.value==="asc"?1:-1:0})}return $}),d=e.computed(()=>Math.ceil(f.value.length/i.value)),s=e.computed(()=>{if(!o.showPagination)return f.value;const $=(l.value-1)*i.value,j=$+i.value;return f.value.slice($,j)}),c=e.computed(()=>{let $=o.columns.length;return o.selectable&&$++,(o.$slots?.actions||o.actions.length>0&&o.showActionsColumn)&&$++,$}),g=$=>o.actions.filter(j=>j.visible&&typeof j.visible=="function"?j.visible($):!0),S=($,j)=>$.permission&&typeof $.permission=="function"?$.permission(j):!0,k=($,j)=>$.disabled&&typeof $.disabled=="function"?$.disabled(j):!1,N=($,j)=>{k($,j)||!S($,j)||(r("action",{action:$.key,item:j,actionConfig:$}),$.onClick&&typeof $.onClick=="function"&&$.onClick(j))},F=$=>({default:"default",primary:"gradient",secondary:"secondary",danger:"danger",success:"success",warning:"warning",info:"info",subtle:"subtle",dark:"dark",light:"light",primaryOutline:"primaryOutline",dangerOutline:"dangerOutline",successOutline:"successOutline",outline:"outline",link:"link",ghost:"ghost"})[$]||"ghost",L=e.computed(()=>f.value.length>0&&f.value.every($=>_($))),q=e.computed(()=>{const $=f.value.filter(j=>_(j)).length;return $>0&&$<f.value.length}),w=($,j)=>j.accessor?j.accessor($):j.key.split(".").reduce((R,ee)=>R?.[ee],$),M=($,j)=>$[o.rowKey]||j,_=$=>o.selectedItems.some(j=>M(j)===M($)),C=$=>{const j=[...o.selectedItems],R=j.findIndex(ee=>M(ee)===M($));R>-1?j.splice(R,1):j.push($),r("selection-change",j)},z=()=>{if(o.loading||o.dataLoading)return;const $=L.value?[]:[...f.value];r("selection-change",$)},O=async $=>{!$.sortable||o.loading||o.sortLoading||(u.value===$.key?m.value=m.value==="asc"?"desc":"asc":(u.value=$.key,m.value="asc"),r("sort-change",{column:$.key,direction:m.value}))},G=$=>{o.loading||r("row-click",$)},H=async $=>{o.paginationLoading||o.loading||(l.value=$,r("page-change",$))},oe=async $=>{o.paginationLoading||o.loading||(i.value=$,l.value=1,r("page-size-change",$))},Ye=e.computed(()=>x(h({variant:o.variant}))),Ge=e.computed(()=>x(E({variant:o.variant}))),xt=e.computed(()=>x(y({variant:o.variant}))),kt=e.computed(()=>x(b({variant:o.variant}))),wt=$=>x({compact:"px-4 py-2",normal:"px-6 py-3",comfortable:"px-8 py-4"}[o.density],"text-left text-xs font-medium text-slate-500 uppercase tracking-wider",{"cursor-pointer hover:bg-slate-100 transition-colors":$.sortable&&!o.loading&&!o.sortLoading,"cursor-not-allowed opacity-50":o.loading||o.sortLoading&&u.value===$.key}),Ke=()=>x({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm text-slate-900"),Te=($,j)=>{const R=[];return o.striped&&j%2===1&&R.push("bg-slate-50/50"),o.hoverable&&!o.clickableRows&&R.push("hover:bg-slate-50"),o.clickableRows&&R.push("cursor-pointer hover:bg-slate-100"),o.selectable&&_($)&&R.push("bg-blue-50 border-blue-200"),o.variant==="bordered"?R.push("border-b border-slate-200"):o.variant==="minimal"&&R.push("border-b border-slate-100"),x("transition-colors",...R)},Ce=($,j)=>{const R=w($,j);return typeof j=="object"&&j.formatter?j.formatter(R,$):R==null?"":R instanceof Date?R.toLocaleDateString():Array.isArray(R)?R.join(", "):R},Ct=($,j=10)=>{if(!$)return $;const R=$.toString().split(" ");return R.length<=j?$:R.slice(0,j).join(" ")+"..."},Bt=$=>{v.value||(v.value=$,p.value=!0)},Be=()=>{p.value=!1,v.value=""},ye=e.computed(()=>x({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm text-slate-900 w-12")),Ve=e.computed(()=>x({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm font-medium text-center")),Xe=e.computed(()=>x({compact:"px-4 py-4",normal:"px-6 py-6",comfortable:"px-8 py-8"}[o.density],"text-center")),Qe=($,j)=>x({"text-blue-600":u.value===$.key&&m.value===j,"text-slate-300":u.value!==$.key||m.value!==j});return e.watch(()=>o.selectedItems,()=>{},{deep:!0}),e.watch(()=>o.pageSize,$=>{i.value=$}),n({refresh:()=>{r("refresh")},goToPage:$=>{H($)},selectAll:()=>{z()},clearSelection:()=>{r("selection-change",[])},getCurrentPage:()=>l.value,getTotalPages:()=>d.value,getSelectedItems:()=>o.selectedItems}),($,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(Ye.value)},[t.title||t.description||$.$slots.header?(e.openBlock(),e.createBlock(ga,{key:0,title:t.title,description:t.description,variant:t.headerVariant,padding:t.headerPadding},{header:e.withCtx(()=>[e.renderSlot($.$slots,"header",{},void 0,!0)]),filters:e.withCtx(()=>[e.renderSlot($.$slots,"filters",{},void 0,!0)]),_:3},8,["title","description","variant","padding"])):e.createCommentVNode("",!0),e.createElementVNode("div",lf,[t.loading?(e.openBlock(),e.createBlock(Oe,{key:0,loading:!0,type:t.loadingType,size:t.loadingSize,color:t.loadingColor,overlay:!0,text:t.loadingText,"text-position":t.loadingTextPosition,"background-color":t.loadingBackground,class:"table-loading-overlay"},null,8,["type","size","color","text","text-position","background-color"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["overflow-x-auto",{"opacity-50":t.loading}])},[e.createElementVNode("table",{class:e.normalizeClass(Ge.value)},[e.createElementVNode("thead",{class:e.normalizeClass(xt.value)},[e.createElementVNode("tr",null,[t.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(ye.value)},[e.createElementVNode("div",sf,[t.bulkLoading?(e.openBlock(),e.createBlock(Oe,{key:0,loading:!0,type:"spin",size:"small",color:t.loadingColor},null,8,["color"])):(e.openBlock(),e.createBlock(_e,{key:1,"model-value":L.value,indeterminate:q.value,disabled:t.loading||t.dataLoading,"onUpdate:modelValue":z},null,8,["model-value","indeterminate","disabled"]))])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,R=>(e.openBlock(),e.createElementBlock("th",{key:R.key,class:e.normalizeClass(wt(R)),onClick:ee=>O(R)},[e.createElementVNode("div",df,[e.createElementVNode("span",null,e.toDisplayString(R.label),1),t.sortLoading&&u.value===R.key?(e.openBlock(),e.createBlock(Oe,{key:0,loading:!0,type:"spin",size:"small",color:t.loadingColor},null,8,["color"])):R.sortable?(e.openBlock(),e.createElementBlock("div",uf,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([Qe(R,"asc"),"w-3 h-3 transition-colors"]),fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[...j[1]||(j[1]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"},null,-1)])],2)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([Qe(R,"desc"),"w-3 h-3 transition-colors"]),fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[...j[2]||(j[2]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)])],2))])):e.createCommentVNode("",!0)])],10,cf))),128)),$.$slots.actions||t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(Ve.value)}," Actions ",2)):e.createCommentVNode("",!0)])],2),e.createElementVNode("tbody",{class:e.normalizeClass(kt.value)},[t.showSkeleton&&(t.loading||t.dataLoading)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.skeletonRows,R=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${R}`,class:"animate-pulse"},[t.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(ye.value)},[...j[3]||(j[3]=[e.createElementVNode("div",{class:"w-4 h-4 bg-slate-200 rounded"},null,-1)])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,ee=>(e.openBlock(),e.createElementBlock("td",{key:ee.key,class:e.normalizeClass(Ke())},[...j[4]||(j[4]=[e.createElementVNode("div",{class:"h-4 bg-slate-200 rounded w-3/4"},null,-1)])],2))),128)),$.$slots.actions||t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(Ve.value)},[...j[5]||(j[5]=[e.createElementVNode("div",{class:"flex gap-2 justify-center"},[e.createElementVNode("div",{class:"w-6 h-6 bg-slate-200 rounded"}),e.createElementVNode("div",{class:"w-6 h-6 bg-slate-200 rounded"})],-1)])],2)):e.createCommentVNode("",!0)]))),128)):s.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(s.value,(R,ee)=>(e.openBlock(),e.createElementBlock("tr",{key:M(R,ee),class:e.normalizeClass(Te(R,ee)),onClick:Y=>G({item:R,index:ee})},[t.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(ye.value)},[e.createVNode(_e,{"model-value":_(R),"onUpdate:modelValue":Y=>C(R)},null,8,["model-value","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,Y=>(e.openBlock(),e.createElementBlock("td",{key:Y.key,class:e.normalizeClass(Ke())},[e.renderSlot($.$slots,`cell-${Y.key}`,{item:R,value:w(R,Y),column:Y,index:ee},()=>[Ce(R,Y).toString().split(" ").length>10?(e.openBlock(),e.createElementBlock("span",{key:0,class:"cursor-pointer text-blue-600 hover:text-blue-800",onClick:e.withModifiers(Se=>Bt(Ce(R,Y)),["stop"])},e.toDisplayString(Ct(Ce(R,Y))),9,ff)):(e.openBlock(),e.createElementBlock("span",pf,e.toDisplayString(Ce(R,Y)),1))],!0)],2))),128)),$.$slots.actions||t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(Ve.value)},[$.$slots.actions?e.renderSlot($.$slots,"actions",{key:0,item:R,index:ee},void 0,!0):t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("div",gf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g(R),Y=>(e.openBlock(),e.createBlock(fa,{key:Y.key,content:Y.tooltip||Y.label||Y.key,placement:"top"},{default:e.withCtx(()=>[e.createVNode(J,{variant:F(Y.variant),size:"xs",disabled:k(Y,R)||!S(Y,R),class:"h-8 w-8",onClick:e.withModifiers(Se=>N(Y,R),["stop"])},{default:e.withCtx(()=>[Y.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:Y.icon,class:"w-4 h-4"},null,8,["icon"])):Y.label?(e.openBlock(),e.createElementBlock("span",vf,e.toDisplayString(Y.label),1)):e.createCommentVNode("",!0)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["content"]))),128))])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],10,mf))),128)):(e.openBlock(),e.createElementBlock("tr",hf,[e.createElementVNode("td",{colspan:c.value,class:e.normalizeClass(Xe.value)},[e.renderSlot($.$slots,"empty",{},()=>[e.createElementVNode("div",yf,[e.createElementVNode("div",xf,[e.createVNode(I,{icon:"search",class:"w-16 h-16"})]),e.createElementVNode("p",kf,e.toDisplayString(t.emptyText),1),e.createElementVNode("p",wf,e.toDisplayString(t.emptySubtitle),1)])],!0)],10,bf)]))],2)],2)],2)]),t.showPagination||$.$slots.footer?(e.openBlock(),e.createBlock(va,{key:1,"current-page":l.value,"total-pages":d.value,total:f.value.length,"page-size":i.value,"show-pagination":t.showPagination,selectable:t.selectable,"selected-count":t.selectedItems.length,variant:t.paginationVariant,padding:t.paginationPadding,loading:t.paginationLoading,disabled:t.loading||t.dataLoading,"onUpdate:currentPage":H,"onUpdate:pageSize":oe},{footer:e.withCtx(()=>[e.renderSlot($.$slots,"footer",{},void 0,!0)]),_:3},8,["current-page","total-pages","total","page-size","show-pagination","selectable","selected-count","variant","padding","loading","disabled"])):e.createCommentVNode("",!0),e.createVNode(ht,{modelValue:p.value,"onUpdate:modelValue":j[0]||(j[0]=R=>p.value=R),size:"lg",height:"auto",onClose:Be},{default:e.withCtx(()=>[e.createElementVNode("div",Cf,[j[6]||(j[6]=e.createElementVNode("h3",{class:"text-md font-semibold mb-4"}," Full Text ",-1)),e.createElementVNode("div",Bf,e.toDisplayString(v.value),1)])]),_:1},8,["modelValue"])],2))}},Ro=yt(Vf,[["__scopeId","data-v-30b63d46"]]),Uo={__name:"DataTableRow",props:{item:{type:Object,required:!0},columns:{type:Array,required:!0},index:{type:Number,required:!0},selectable:{type:Boolean,default:!1},isSelected:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},clickableRows:{type:Boolean,default:!1},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},variant:{type:String,default:"default",validator:t=>["default","bordered","minimal"].includes(t)}},emits:["toggle-selection","row-click"],setup(t,{emit:n}){const a=t,o=n,r=T.cva("transition-colors",{variants:{striped:{true:"odd:bg-slate-50/50",false:""},hoverable:{true:"hover:bg-slate-50",false:""},clickable:{true:"cursor-pointer hover:bg-slate-100",false:""},selected:{true:"bg-blue-50 border-blue-200",false:""},variant:{default:"",bordered:"border-b border-slate-200",minimal:"border-b border-slate-100"}},compoundVariants:[{hoverable:!0,clickable:!0,class:"hover:bg-slate-100"}],defaultVariants:{striped:!1,hoverable:!0,clickable:!1,selected:!1,variant:"default"}}),l=T.cva("whitespace-nowrap text-sm text-slate-900",{variants:{density:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{density:"normal",align:"left"}}),i=f=>typeof f=="string"?f:f?.key||f?.field||"unknown",u=(f,d)=>{const s=i(d);return typeof d=="object"&&d.accessor?d.accessor(f):s&&s.includes(".")?s.split(".").reduce((c,g)=>c?.[g],f):f?.[s]},m=(f,d)=>{const s=u(f,d);return typeof d=="object"&&d.formatter?d.formatter(s,f):s==null?"":s instanceof Date?s.toLocaleDateString():Array.isArray(s)?s.join(", "):s},p=()=>{a.clickableRows&&o("row-click",{item:a.item,index:a.index})},v=f=>typeof f=="object"&&f.align?f.align:"left",h=e.computed(()=>x(r({striped:a.striped,hoverable:a.hoverable&&!a.clickableRows,clickable:a.clickableRows,selected:a.isSelected,variant:a.variant}))),E=f=>{const d=v(f);return x(l({density:a.density,align:d}),f.cellClasses)},y=e.computed(()=>x(l({density:a.density}),"w-12")),b=e.computed(()=>x(l({density:a.density,align:"right"}),"font-medium"));return(f,d)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass(h.value),onClick:p},[t.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(y.value)},[e.createVNode(_e,{"model-value":t.isSelected,"onUpdate:modelValue":d[0]||(d[0]=s=>f.$emit("toggle-selection",t.item))},null,8,["model-value"])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,s=>(e.openBlock(),e.createElementBlock("td",{key:i(s),class:e.normalizeClass(E(s))},[e.renderSlot(f.$slots,`cell-${i(s)}`,{item:t.item,value:u(t.item,s),column:s,index:t.index},()=>[e.createTextVNode(e.toDisplayString(m(t.item,s)),1)])],2))),128)),f.$slots.actions?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(b.value)},[e.renderSlot(f.$slots,"actions",{item:t.item,index:t.index})],2)):e.createCommentVNode("",!0)],2))}},qo={__name:"DataTableCell",props:{item:{type:Object,required:!0},column:{type:Object,required:!0},value:{type:[String,Number,Boolean,Object,Array],default:null},align:{type:String,default:"left",validator:t=>["left","center","right"].includes(t)},width:{type:String,default:null},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},textSize:{type:String,default:"sm",validator:t=>["xs","sm","base","lg"].includes(t)},textColor:{type:String,default:"slate-900"}},setup(t){const n=t,a=e.computed(()=>{const i=n.value??o();return n.column.formatter?n.column.formatter(i,n.item):i}),o=()=>n.column.accessor?n.column.accessor(n.item):n.column.key.split(".").reduce((i,u)=>i?.[u],n.item),r=T.cva("whitespace-nowrap",{variants:{align:{left:"text-left",center:"text-center",right:"text-right"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"},textSize:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg"}},defaultVariants:{align:"left",padding:"normal",textSize:"sm"}}),l=e.computed(()=>{const i=n.align||n.column.align||"left",u=`text-${n.textColor}`,m=n.width?`w-${n.width}`:"";return x(r({align:i,padding:n.padding,textSize:n.textSize}),u,m,n.column.cellClasses)});return(i,u)=>(e.openBlock(),e.createElementBlock("td",{class:e.normalizeClass(l.value)},[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.value),1)])],2))}},Sf={class:"bg-white border-b border-gray-200"},Ef={key:0,class:"flex-1 min-w-80 max-w-md"},Nf={class:"relative group"},$f=["model-value","placeholder"],zf={class:"relative"},Df={value:""},Tf=["value"],Af={key:1,class:"min-w-36"},Ff={class:"relative"},Pf=["value"],Mf={key:3,class:"flex items-center gap-2"},Lf={class:"flex items-center gap-3 ml-auto"},jf={key:0},Of={key:3},If={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},_f={class:"flex items-center justify-between"},Rf={class:"flex items-center gap-3"},Uf={class:"relative flex-1"},qf=["model-value","placeholder","onInput"],Hf={class:"relative flex-1"},Wf=["model-value","placeholder","onInput"],Yf=["onClick"],Gf={class:"flex items-center justify-between"},Kf={class:"flex items-center gap-3"},Xf={class:"relative flex-1"},Qf=["model-value","placeholder","step","onInput"],Jf={class:"relative flex-1"},Zf=["model-value","placeholder","step","onInput"],ep=["onClick"],tp={class:"flex items-center justify-between"},ap={class:"relative"},np={value:""},op=["value"],rp={key:0,class:"flex flex-wrap gap-2 mt-2"},lp=["onClick"],sp={class:"flex items-center gap-3 flex-wrap"},ip=["onClick"],cp={key:2,class:"px-6 py-3 bg-gray-50 border-t border-gray-200"},dp={class:"flex items-center justify-between"},up={class:"flex items-center gap-4"},mp={class:"text-sm text-gray-600"},fp={class:"font-medium"},pp={class:"bg-white rounded-xl shadow-2xl max-w-2xl w-full p-6"},gp={class:"flex items-center justify-between mb-4"},vp={class:"flex justify-end gap-3 mt-6"},Ho={__name:"DataTableFilters",props:{searchQuery:{type:String,default:""},searchPlaceholder:{type:String,default:"Search..."},selectedStatus:{type:String,default:""},statusOptions:{type:Array,default:()=>[]},showDateFilter:{type:Boolean,default:!1},dateFrom:{type:String,default:""},dateTo:{type:String,default:""},selectFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"options")&&Object.prototype.hasOwnProperty.call(n,"value"))},dateFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"from")&&Object.prototype.hasOwnProperty.call(n,"to"))},numberFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"min")&&Object.prototype.hasOwnProperty.call(n,"max"))},multiSelectFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"options")&&Object.prototype.hasOwnProperty.call(n,"selected"))},showExport:{type:Boolean,default:!1},showAdd:{type:Boolean,default:!1},addButton:{type:Object,default:()=>({})},showTableInfo:{type:Boolean,default:!0},showSearch:{type:Boolean,default:!0},showFilters:{type:Boolean,default:!0},showFileUpload:{type:Boolean,default:!1},fileUploadMultiple:{type:Boolean,default:!1},fileUploadAccept:{type:String,default:""},fileUploadMaxSize:{type:Number,default:null},fileUploadVariant:{type:String,default:"default",validator:t=>["default","dashed"].includes(t)},totalItems:{type:Number,default:0},itemLabel:{type:String,default:"items"},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:searchQuery","update:selectedStatus","update:dateFrom","update:dateTo","update:dateFilters","update:selectFilters","update:numberFilters","update:multiSelectFilters","export","add","clear-filters","add-button-click","files-selected","file-removed"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(!1),i=e.computed(()=>Object.keys(a.addButton).length>0),u=e.computed(()=>i.value?a.addButton.visible&&typeof a.addButton.visible=="function"?a.addButton.visible():!0:a.showAdd),m=e.computed(()=>i.value&&a.addButton.permission&&typeof a.addButton.permission=="function"?a.addButton.permission():!0),p=e.computed(()=>i.value&&a.addButton.disabled&&typeof a.addButton.disabled=="function"?a.addButton.disabled():!1),v=()=>{l.value=!0},h=()=>{l.value=!1},E=A=>{o("files-selected",A)},y=A=>{o("file-removed",A)},b=()=>{p.value||!m.value||(o("add"),o("add-button-click",a.addButton),a.addButton.onClick&&typeof a.addButton.onClick=="function"&&a.addButton.onClick())},f=T.cva("flex flex-wrap items-center gap-4",{variants:{variant:{default:"bg-white",minimal:"bg-transparent",bordered:"bg-gray-50"},padding:{compact:"px-4 py-3",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),d=T.cva("border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-sm",{variants:{size:{sm:"px-2 py-1.5",md:"px-3 py-2.5",lg:"px-4 py-3"}},defaultVariants:{size:"md"}}),s=T.cva("rounded-lg flex items-center font-medium transition-all",{variants:{variant:{default:"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 hover:border-gray-300 bg-white",primary:"text-white bg-blue-600 hover:bg-blue-700 border border-blue-600 shadow-sm",success:"text-white bg-green-600 hover:bg-green-700 border border-green-600 shadow-sm",ghost:"text-gray-600 hover:text-gray-800 hover:bg-gray-100"},size:{sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),c=(A,B)=>{const V=a.selectFilters.map(P=>P.key===A?{...P,value:B}:P);o("update:selectFilters",V)},g=A=>!!(A.from||A.to),S=A=>{const B=a.dateFilters.map(V=>V.key===A?{...V,from:"",to:""}:V);o("update:dateFilters",B)},k=A=>`text-xs px-2 py-1 rounded ${g(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,N=(A,B,V)=>{const P=a.dateFilters.map(K=>K.key===A?{...K,[B]:V}:K);o("update:dateFilters",P)},F=A=>!!(A.min||A.max),L=A=>{const B=a.numberFilters.map(V=>V.key===A?{...V,min:"",max:""}:V);o("update:numberFilters",B)},q=A=>`text-xs px-2 py-1 rounded ${F(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,w=(A,B,V)=>{const P=a.numberFilters.map(K=>K.key===A?{...K,[B]:V}:K);o("update:numberFilters",P)},M=A=>A.selected&&A.selected.length>0,_=A=>`text-xs px-2 py-1 rounded ${M(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,C=(A,B)=>{if(!B)return;const V=a.multiSelectFilters.map(P=>{if(P.key===A){const K=P.selected||[],Ae=K.includes(B);return{...P,selected:Ae?K.filter(Vt=>Vt!==B):[...K,B]}}return P});o("update:multiSelectFilters",V)},z=(A,B)=>{const V=a.multiSelectFilters.map(P=>P.key===A?{...P,selected:P.selected.filter(K=>K!==B)}:P);o("update:multiSelectFilters",V)},O=(A,B)=>{const V=A.options.find(P=>P.value===B);return V?V.label:B},G=()=>{r.value=!r.value},H=e.computed(()=>a.numberFilters.length>0||a.multiSelectFilters.length>0),oe=e.computed(()=>{const A=a.searchQuery,B=a.selectedStatus,V=a.dateFrom||a.dateTo,P=a.selectFilters.some(ce=>ce.value),K=a.dateFilters.some(ce=>ce.from||ce.to),Ae=a.numberFilters.some(ce=>ce.min||ce.max),Vt=a.multiSelectFilters.some(ce=>ce.selected&&ce.selected.length>0);return A||B||V||P||K||Ae||Vt}),Ye=e.computed(()=>{let A=0;return a.searchQuery&&A++,a.selectedStatus&&A++,(a.dateFrom||a.dateTo)&&A++,A+=a.selectFilters.filter(B=>B.value).length,A+=a.dateFilters.filter(B=>B.from||B.to).length,A+=a.numberFilters.filter(B=>B.min||B.max).length,A+=a.multiSelectFilters.filter(B=>B.selected&&B.selected.length>0).length,A}),Ge=e.computed(()=>{const A=[];if(a.searchQuery&&a.searchQuery.trim()&&A.push({key:"search",label:"Search",value:`"${a.searchQuery}"`,icon:"magnifying-glass"}),a.selectedStatus){const B=a.statusOptions.find(V=>V.value===a.selectedStatus);A.push({key:"status",label:"Status",value:B?.label||a.selectedStatus,icon:"filter"})}if(a.selectFilters.forEach(B=>{if(B.value){const V=B.options.find(P=>P.value===B.value);A.push({key:`select-${B.key}`,label:B.label,value:V?.label||B.value,icon:"filter"})}}),a.dateFrom||a.dateTo){let B="";a.dateFrom&&a.dateTo?B=`${a.dateFrom} to ${a.dateTo}`:a.dateFrom?B=`From ${a.dateFrom}`:a.dateTo&&(B=`Until ${a.dateTo}`),B&&A.push({key:"date",label:"Date Range",value:B,icon:"calendar"})}return a.dateFilters.forEach(B=>{if(B.from||B.to){let V="";B.from&&B.to?V=`${B.from} to ${B.to}`:B.from?V=`From ${B.from}`:B.to&&(V=`Until ${B.to}`),V&&A.push({key:`date-${B.key}`,label:B.label,value:V,icon:"calendar"})}}),a.numberFilters.forEach(B=>{if(B.min||B.max){let V="";B.min&&B.max?V=`${B.min} to ${B.max}`:B.min?V=`Min ${B.min}`:B.max&&(V=`Max ${B.max}`),V&&A.push({key:`number-${B.key}`,label:B.label,value:V,icon:"hashtag"})}}),a.multiSelectFilters.forEach(B=>{if(B.selected&&B.selected.length>0){const V=B.selected.map(P=>{const K=B.options.find(Ae=>Ae.value===P);return K?K.label:P});A.push({key:`multi-${B.key}`,label:B.label,value:V.join(", "),icon:"list"})}}),A}),xt=e.computed(()=>x(f({variant:a.variant,padding:a.padding}))),kt=e.computed(()=>"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 group-hover:text-gray-600 transition-colors"),wt=e.computed(()=>x(d({size:"md"}),"w-full pl-10 pr-10 hover:border-gray-300")),Ke=e.computed(()=>"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600 p-1 hover:bg-gray-100 rounded-full transition-all"),Te=e.computed(()=>x(d({size:"md"}),"w-full pr-8 appearance-none hover:border-gray-300")),Ce=e.computed(()=>{const A=r.value||oe.value;return x(s({variant:A?"primary":"default",size:"lg"}),"gap-2")}),Ct=e.computed(()=>"bg-white text-blue-600 text-xs px-1.5 py-0.5 rounded-full min-w-[20px] text-center font-semibold"),Bt=e.computed(()=>"px-6 py-4 border-t border-gray-100 bg-gray-50"),Be=e.computed(()=>x(d({size:"md"}),"pl-10 pr-3")),ye=e.computed(()=>"text-sm font-semibold text-gray-700"),Ve=e.computed(()=>"text-gray-500 text-sm font-medium"),Xe=e.computed(()=>"text-gray-400 hover:text-gray-600 p-1.5 hover:bg-gray-200 rounded-full transition-all"),Qe=e.computed(()=>x(s({variant:"ghost",size:"md"}))),$=e.computed(()=>x(s({variant:"default",size:"lg"}))),j=e.computed(()=>"px-6 py-3 bg-blue-50 border-t border-blue-100"),R=e.computed(()=>"text-sm font-semibold text-blue-800"),ee=e.computed(()=>"flex items-center gap-1.5 bg-white border border-blue-200 text-blue-800 px-3 py-1.5 rounded-full text-sm font-medium"),Y=e.computed(()=>"text-blue-600 hover:text-blue-800 ml-1 hover:bg-blue-100 rounded-full p-0.5 transition-all"),Se=()=>{o("update:searchQuery",""),o("update:selectedStatus",""),o("update:dateFrom",""),o("update:dateTo","");const A=a.selectFilters.map(K=>({...K,value:""}));o("update:selectFilters",A);const B=a.dateFilters.map(K=>({...K,from:"",to:""}));o("update:dateFilters",B);const V=a.numberFilters.map(K=>({...K,min:"",max:""}));o("update:numberFilters",V);const P=a.multiSelectFilters.map(K=>({...K,selected:[]}));o("update:multiSelectFilters",P),o("clear-filters")},or=A=>{switch(A){case"search":o("update:searchQuery","");break;case"status":o("update:selectedStatus","");break;case"date":o("update:dateFrom",""),o("update:dateTo","");break;default:if(A.startsWith("select-")){const B=A.replace("select-",""),V=a.selectFilters.map(P=>P.key===B?{...P,value:""}:P);o("update:selectFilters",V)}else if(A.startsWith("date-")){const B=A.replace("date-",""),V=a.dateFilters.map(P=>P.key===B?{...P,from:"",to:""}:P);o("update:dateFilters",V)}else if(A.startsWith("number-")){const B=A.replace("number-",""),V=a.numberFilters.map(P=>P.key===B?{...P,min:"",max:""}:P);o("update:numberFilters",V)}else if(A.startsWith("multi-")){const B=A.replace("multi-",""),V=a.multiSelectFilters.map(P=>P.key===B?{...P,selected:[]}:P);o("update:multiSelectFilters",V)}break}};return(A,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Sf,[e.createElementVNode("div",{class:e.normalizeClass(xt.value)},[t.showSearch?(e.openBlock(),e.createElementBlock("div",Ef,[e.createElementVNode("div",Nf,[e.createVNode(I,{icon:"magnifying-glass",class:e.normalizeClass(kt.value)},null,8,["class"]),e.createElementVNode("input",{"model-value":t.searchQuery,placeholder:t.searchPlaceholder,class:e.normalizeClass(wt.value),onInput:B[0]||(B[0]=V=>A.$emit("update:searchQuery",V.target.value))},null,42,$f),t.searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(Ke.value),onClick:B[1]||(B[1]=V=>A.$emit("update:searchQuery",""))},[e.createVNode(I,{icon:"xmark",class:"w-3 h-3"})],2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.selectFilters,V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:"min-w-36"},[e.createElementVNode("div",zf,[e.createVNode(se,{"model-value":V.value,class:e.normalizeClass(Te.value),onChange:P=>c(V.key,P.target.value)},{default:e.withCtx(()=>[e.createElementVNode("option",Df,e.toDisplayString(V.placeholder||`All ${V.label}`),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.options,P=>(e.openBlock(),e.createElementBlock("option",{key:P.value,value:P.value},e.toDisplayString(P.label),9,Tf))),128))]),_:2},1032,["model-value","class","onChange"]),e.createVNode(I,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])]))),128)),t.showFilters&&t.statusOptions.length>0?(e.openBlock(),e.createElementBlock("div",Af,[e.createElementVNode("div",Ff,[e.createVNode(se,{"model-value":t.selectedStatus,class:e.normalizeClass(Te.value),onChange:B[2]||(B[2]=V=>A.$emit("update:selectedStatus",V.target.value))},{default:e.withCtx(()=>[B[5]||(B[5]=e.createElementVNode("option",{value:""}," All Status ",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.statusOptions,V=>(e.openBlock(),e.createElementBlock("option",{key:V.value,value:V.value},e.toDisplayString(V.label),9,Pf))),128))]),_:1},8,["model-value","class"]),e.createVNode(I,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),t.showFilters&&(t.dateFilters.length>0||H.value)?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(Ce.value),onClick:G},[e.createVNode(I,{icon:"filter",class:"w-4 h-4"}),B[6]||(B[6]=e.createTextVNode(" Filters ",-1)),Ye.value>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(Ct.value)},e.toDisplayString(Ye.value),3)):e.createCommentVNode("",!0),e.createVNode(I,{icon:r.value?"chevron-up":"chevron-down",class:"w-4 h-4 ml-1"},null,8,["icon"])],2)):e.createCommentVNode("",!0),A.$slots.filters?(e.openBlock(),e.createElementBlock("div",Mf,[e.renderSlot(A.$slots,"filters")])):e.createCommentVNode("",!0),e.createElementVNode("div",Lf,[t.showFileUpload?(e.openBlock(),e.createElementBlock("div",jf,[e.createVNode(J,{variant:"default",size:"lg",onClick:v},{default:e.withCtx(()=>[e.createVNode(I,{icon:"upload",class:"w-4 h-4 mr-2"}),B[7]||(B[7]=e.createTextVNode(" Upload Files ",-1))]),_:1})])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createBlock(J,{key:1,class:e.normalizeClass(Qe.value),onClick:Se},{default:e.withCtx(()=>[e.createVNode(I,{icon:"rotate-left",class:"w-4 h-4 mr-2"}),B[8]||(B[8]=e.createTextVNode(" Clear All ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showExport?(e.openBlock(),e.createBlock(J,{key:2,class:e.normalizeClass($.value),onClick:B[3]||(B[3]=V=>A.$emit("export"))},{default:e.withCtx(()=>[e.createVNode(I,{icon:"download",class:"w-4 h-4 mr-2"}),B[9]||(B[9]=e.createTextVNode(" Export ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showAdd&&u.value?(e.openBlock(),e.createElementBlock("div",Of,[i.value?(e.openBlock(),e.createBlock(J,{key:0,variant:t.addButton.variant||"success",size:t.addButton.size||"lg",disabled:p.value||!m.value,title:t.addButton.tooltip,onClick:b},{default:e.withCtx(()=>[t.addButton.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:t.addButton.icon,class:"w-4 h-4 mr-2"},null,8,["icon"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.addButton.label||"Add"),1)]),_:1},8,["variant","size","disabled","title"])):e.renderSlot(A.$slots,"add",{key:1},()=>[e.createVNode(J,{variant:"success",size:"lg",onClick:B[4]||(B[4]=V=>A.$emit("add"))},{default:e.withCtx(()=>[e.createVNode(I,{icon:"plus",class:"w-4 h-4 mr-2"}),B[10]||(B[10]=e.createTextVNode(" Add ",-1))]),_:1})])])):e.createCommentVNode("",!0)])],2),t.showFilters&&r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(Bt.value)},[e.createElementVNode("div",If,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dateFilters,V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:"space-y-3"},[e.createElementVNode("div",_f,[e.createElementVNode("label",{class:e.normalizeClass(ye.value)},e.toDisplayString(V.label),3),e.createElementVNode("span",{class:e.normalizeClass(k(V))},e.toDisplayString(g(V)?"Active":"Inactive"),3)]),e.createElementVNode("div",Rf,[e.createElementVNode("div",Uf,[e.createVNode(I,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.createElementVNode("input",{type:"date","model-value":V.from,class:e.normalizeClass(Be.value),placeholder:`From ${V.label}`,onInput:P=>N(V.key,"from",P.target.value)},null,42,qf)]),e.createElementVNode("span",{class:e.normalizeClass(Ve.value)},"to",2),e.createElementVNode("div",Hf,[e.createVNode(I,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.createElementVNode("input",{type:"date","model-value":V.to,class:e.normalizeClass(Be.value),placeholder:`To ${V.label}`,onInput:P=>N(V.key,"to",P.target.value)},null,42,Wf)]),g(V)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(Xe.value),title:"Clear this filter",onClick:P=>S(V.key)},[e.createVNode(I,{icon:"xmark",class:"w-4 h-4"})],10,Yf)):e.createCommentVNode("",!0)])]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.numberFilters,V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:"space-y-3"},[e.createElementVNode("div",Gf,[e.createElementVNode("label",{class:e.normalizeClass(ye.value)},e.toDisplayString(V.label),3),e.createElementVNode("span",{class:e.normalizeClass(q(V))},e.toDisplayString(F(V)?"Active":"Inactive"),3)]),e.createElementVNode("div",Kf,[e.createElementVNode("div",Xf,[e.createElementVNode("input",{type:"number","model-value":V.min,class:e.normalizeClass(Be.value),placeholder:`Min ${V.label}`,step:V.step||1,onInput:P=>w(V.key,"min",P.target.value)},null,42,Qf)]),e.createElementVNode("span",{class:e.normalizeClass(Ve.value)},"to",2),e.createElementVNode("div",Jf,[e.createElementVNode("input",{type:"number","model-value":V.max,class:e.normalizeClass(Be.value),placeholder:`Max ${V.label}`,step:V.step||1,onInput:P=>w(V.key,"max",P.target.value)},null,42,Zf)]),F(V)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(Xe.value),title:"Clear this filter",onClick:P=>L(V.key)},[e.createVNode(I,{icon:"xmark",class:"w-4 h-4"})],10,ep)):e.createCommentVNode("",!0)])]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.multiSelectFilters,V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:"space-y-3"},[e.createElementVNode("div",tp,[e.createElementVNode("label",{class:e.normalizeClass(ye.value)},e.toDisplayString(V.label),3),e.createElementVNode("span",{class:e.normalizeClass(_(V))},e.toDisplayString(M(V)?`${V.selected.length} selected`:"None"),3)]),e.createElementVNode("div",ap,[e.createVNode(se,{"model-value":"",class:e.normalizeClass(Te.value),onChange:P=>C(V.key,P.target.value)},{default:e.withCtx(()=>[e.createElementVNode("option",np," Select "+e.toDisplayString(V.label),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.options,P=>(e.openBlock(),e.createElementBlock("option",{key:P.value,value:P.value},e.toDisplayString(P.label),9,op))),128))]),_:2},1032,["class","onChange"]),e.createVNode(I,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})]),V.selected.length>0?(e.openBlock(),e.createElementBlock("div",rp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.selected,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"inline-flex items-center gap-1 bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full"},[e.createTextVNode(e.toDisplayString(O(V,P))+" ",1),e.createElementVNode("button",{class:"hover:bg-blue-200 rounded-full p-0.5",onClick:K=>z(V.key,P)},[e.createVNode(I,{icon:"xmark",class:"w-3 h-3"})],8,lp)]))),128))])):e.createCommentVNode("",!0)]))),128))])],2)):e.createCommentVNode("",!0),t.showFilters&&Ge.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(j.value)},[e.createElementVNode("div",sp,[e.createElementVNode("span",{class:e.normalizeClass(R.value)},"Active filters:",2),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:e.normalizeClass(ee.value)},[e.createVNode(I,{icon:V.icon,class:"w-3 h-3"},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(V.label)+": "+e.toDisplayString(V.value),1),e.createElementVNode("button",{class:e.normalizeClass(Y.value),onClick:P=>or(V.key)},[e.createVNode(I,{icon:"xmark",class:"w-3 h-3"})],10,ip)],2))),128))])],2)):e.createCommentVNode("",!0),t.showTableInfo?(e.openBlock(),e.createElementBlock("div",cp,[e.createElementVNode("div",dp,[e.createElementVNode("div",up,[e.createElementVNode("span",mp,[e.createElementVNode("span",fp,e.toDisplayString(t.totalItems||0),1),e.createTextVNode(" "+e.toDisplayString(t.itemLabel||"items")+" found ",1)])])])])):e.createCommentVNode("",!0)]),t.showFileUpload&&l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-4",onClick:e.withModifiers(h,["self"])},[e.createElementVNode("div",pp,[e.createElementVNode("div",gp,[B[11]||(B[11]=e.createElementVNode("h3",{class:"text-lg font-semibold text-gray-900"}," Upload Files ",-1)),e.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 p-2 hover:bg-gray-100 rounded-full transition-all",onClick:h},[e.createVNode(I,{icon:"xmark",class:"w-5 h-5"})])]),e.createVNode(pa,{multiple:t.fileUploadMultiple,accept:t.fileUploadAccept,"max-size":t.fileUploadMaxSize,variant:t.fileUploadVariant,onFilesSelected:E,onFileRemoved:y},null,8,["multiple","accept","max-size","variant"]),e.createElementVNode("div",vp,[e.createVNode(J,{variant:"default",onClick:h},{default:e.withCtx(()=>[...B[12]||(B[12]=[e.createTextVNode(" Close ",-1)])]),_:1})])])])):e.createCommentVNode("",!0)],64))}},hp={class:"flex items-center gap-3"},bp={key:0,class:"flex items-center gap-3"},yp={class:"text-sm text-slate-600"},xp={class:"flex items-center gap-2"},kp={class:"flex items-center gap-3"},wp=["title","onClick"],Cp={key:1,class:"relative"},Bp={class:"p-3"},Vp={class:"space-y-1"},Sp={class:"flex items-center gap-2 cursor-pointer w-full"},Ep=["checked","onChange"],Np=["disabled"],$p={key:3,class:"flex items-center gap-2"},zp=[{key:"delete",label:"Delete",icon:{template:'<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" /></svg>'},variant:"danger"},{key:"edit",label:"Edit",icon:{template:'<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" /></svg>'},variant:"primary"}],Dp={name:"DataTableToolBar"},Wo=Object.assign(Dp,{props:{selectedItems:{type:Array,default:()=>[]},totalItems:{type:Number,default:0},bulkActions:{type:Array,default:()=>zp},showDensityToggle:{type:Boolean,default:!0},showColumnToggle:{type:Boolean,default:!0},showRefresh:{type:Boolean,default:!0},isRefreshing:{type:Boolean,default:!1},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},toggleableColumns:{type:Array,default:()=>[]},visibleColumns:{type:Array,default:()=>[]},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["bulk-action","update:density","toggle-column","refresh"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(null),i=e.ref(null),u=e.computed(()=>a.selectedItems.length),m=[{value:"compact",label:"Compact",icon:["fas","minus"]},{value:"normal",label:"Normal",icon:["fas","bars"]},{value:"comfortable",label:"Comfortable",icon:["fas","bars-staggered"]}],p=T.cva("flex items-center justify-between border-b border-slate-200",{variants:{variant:{default:"bg-white",minimal:"bg-transparent border-slate-100",bordered:"bg-slate-50 border-slate-300"},padding:{compact:"p-2",normal:"p-4",comfortable:"p-6"}},defaultVariants:{variant:"default",padding:"normal"}}),v=T.cva("px-3 py-1.5 text-sm font-medium rounded-md flex items-center gap-1 transition-colors",{variants:{variant:{danger:"text-red-700 bg-red-500 hover:bg-red-400 border border-red-200",primary:"text-blue-700 bg-blue-50 hover:bg-blue-100 border border-blue-200",secondary:"text-slate-700 bg-slate-500 hover:bg-slate-400 border border-slate-200"}},defaultVariants:{variant:"secondary"}}),h=T.cva("p-2 border border-slate-300 transition-colors",{variants:{active:{true:"bg-blue-50 text-blue-600 border-blue-300",false:"bg-white text-slate-600 hover:bg-slate-50"},position:{first:"rounded-l-md border-r-0",middle:"border-x-0",last:"rounded-r-md border-l-0"}},defaultVariants:{active:!1,position:"middle"}}),E=T.cva("px-3 py-2 text-sm border border-slate-300 rounded-md flex items-center gap-2 transition-colors",{variants:{state:{normal:"text-slate-600 hover:text-slate-800 hover:bg-slate-50",refreshing:"text-slate-600 opacity-75 cursor-not-allowed"}},defaultVariants:{state:"normal"}}),y=e.computed(()=>x(p({variant:a.variant,padding:a.padding}))),b=e.computed(()=>"text-sm text-slate-600"),f=e.computed(()=>"flex items-center"),d=e.computed(()=>"flex items-center gap-2 px-3 py-2 text-sm text-slate-600 hover:text-slate-800 border border-slate-300 rounded-md hover:bg-slate-50 transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1"),s=e.computed(()=>"absolute right-0 top-full mt-1 w-56 bg-white border border-slate-200 rounded-lg shadow-lg z-50 max-h-64 overflow-y-auto"),c=e.computed(()=>"text-xs font-medium text-slate-500 uppercase tracking-wider mb-2 border-b border-slate-100 pb-2"),g=e.computed(()=>"py-1 hover:bg-slate-50 rounded transition-colors"),S=e.computed(()=>"w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500 focus:ring-2 focus:ring-offset-1"),k=e.computed(()=>"text-sm text-slate-700 flex-1 select-none"),N=z=>{l.value&&i.value&&!l.value.contains(z.target)&&!i.value.contains(z.target)&&(r.value=!1)},F=()=>{r.value=!r.value},L=z=>x(v({variant:z.variant||"secondary"})),q=z=>{let O="middle";return z==="compact"?O="first":z==="comfortable"&&(O="last"),x(h({active:a.density===z,position:O}))},w=()=>x(E({state:a.isRefreshing?"refreshing":"normal"})),M=()=>x("w-4 h-4",{"animate-spin":a.isRefreshing}),_=z=>a.visibleColumns.includes(z),C=(z,O)=>{o("toggle-column",{column:z,visible:O})};return e.onMounted(()=>{document.addEventListener("click",N)}),e.onUnmounted(()=>{document.removeEventListener("click",N)}),(z,O)=>{const G=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(y.value)},[e.createElementVNode("div",hp,[u.value>0?(e.openBlock(),e.createElementBlock("div",bp,[e.createElementVNode("span",yp,e.toDisplayString(u.value)+" selected ",1),e.createElementVNode("div",xp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bulkActions,H=>(e.openBlock(),e.createBlock(J,{key:H.key,class:e.normalizeClass(L(H)),onClick:oe=>z.$emit("bulk-action",{action:H.key,items:t.selectedItems})},{default:e.withCtx(()=>[H.icon?(e.openBlock(),e.createBlock(G,{key:0,icon:H.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(H.label),1)]),_:2},1032,["class","onClick"]))),128))])])):t.totalItems>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(b.value)},e.toDisplayString(t.totalItems)+" "+e.toDisplayString(t.totalItems===1?"item":"items"),3)):e.createCommentVNode("",!0)]),e.createElementVNode("div",kp,[t.showDensityToggle?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(f.value)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(m,H=>e.createElementVNode("button",{key:H.value,class:e.normalizeClass(q(H.value)),title:H.label,type:"button",onClick:oe=>z.$emit("update:density",H.value)},[e.createVNode(G,{icon:H.icon,class:"w-4 h-4"},null,8,["icon"])],10,wp)),64))],2)):e.createCommentVNode("",!0),t.showColumnToggle?(e.openBlock(),e.createElementBlock("div",Cp,[e.createElementVNode("button",{ref_key:"columnToggleButton",ref:l,class:e.normalizeClass(d.value),type:"button",onClick:e.withModifiers(F,["stop"])},[e.createVNode(G,{icon:"columns",class:"w-4 h-4"}),O[2]||(O[2]=e.createElementVNode("span",null,"Columns",-1))],2),e.withDirectives(e.createElementVNode("div",{ref_key:"columnMenu",ref:i,class:e.normalizeClass(s.value),onClick:O[0]||(O[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Bp,[e.createElementVNode("div",{class:e.normalizeClass(c.value)}," Show Columns ",2),e.createElementVNode("div",Vp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.toggleableColumns,H=>(e.openBlock(),e.createElementBlock("div",{key:H.key,class:e.normalizeClass(g.value)},[e.createElementVNode("label",Sp,[e.createElementVNode("input",{type:"checkbox",checked:_(H.key),class:e.normalizeClass(S.value),onChange:oe=>C(H.key,oe.target.checked)},null,42,Ep),e.createElementVNode("span",{class:e.normalizeClass(k.value)},e.toDisplayString(H.label),3)])],2))),128))])])],2),[[e.vShow,r.value]])])):e.createCommentVNode("",!0),t.showRefresh?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.isRefreshing,class:e.normalizeClass(w()),type:"button",onClick:O[1]||(O[1]=H=>z.$emit("refresh"))},[e.createVNode(G,{icon:"sync",class:e.normalizeClass(M())},null,8,["class"]),O[3]||(O[3]=e.createElementVNode("span",null,"Refresh",-1))],10,Np)):e.createCommentVNode("",!0),z.$slots.actions?(e.openBlock(),e.createElementBlock("div",$p,[e.renderSlot(z.$slots,"actions")])):e.createCommentVNode("",!0)])],2)}}}),Tp={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12"},Ap={class:"grid grid-cols-1 md:grid-cols-4 gap-8"},Fp={class:"col-span-1 md:col-span-2"},Pp={class:"space-y-2"},Mp={class:"flex space-x-4"},Lp={class:"flex flex-col md:flex-row justify-between items-center"},jp={class:"flex space-x-6 mt-4 md:mt-0"},Yo={__name:"Footer",props:{className:{type:String,default:""}},setup(t){return(n,a)=>{const o=e.resolveComponent("Logo"),r=e.resolveComponent("Text"),l=e.resolveComponent("Typography"),i=e.resolveComponent("Link"),u=e.resolveComponent("Icon"),m=e.resolveComponent("Divider");return e.openBlock(),e.createElementBlock("footer",{class:e.normalizeClass(e.unref(x)("bg-gray-50 border-t border-gray-200",t.className))},[e.createElementVNode("div",Tp,[e.createElementVNode("div",Ap,[e.createElementVNode("div",Fp,[e.renderSlot(n.$slots,"brand",{},()=>[e.createVNode(o,{class:"mb-4"}),e.createVNode(r,{class:"text-gray-600 max-w-md"},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode(" Building beautiful applications with modern Vue.js components. ",-1)])]),_:1})])]),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"links",{},()=>[e.createVNode(l,{variant:"h6",class:"mb-4"},{default:e.withCtx(()=>[...a[1]||(a[1]=[e.createTextVNode(" Quick Links ",-1)])]),_:1}),e.createElementVNode("div",Pp,[e.createVNode(i,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[2]||(a[2]=[e.createTextVNode(" About ",-1)])]),_:1}),e.createVNode(i,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[3]||(a[3]=[e.createTextVNode(" Services ",-1)])]),_:1}),e.createVNode(i,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[4]||(a[4]=[e.createTextVNode(" Contact ",-1)])]),_:1})])])]),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"social",{},()=>[e.createVNode(l,{variant:"h6",class:"mb-4"},{default:e.withCtx(()=>[...a[5]||(a[5]=[e.createTextVNode(" Follow Us ",-1)])]),_:1}),e.createElementVNode("div",Mp,[e.createVNode(i,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[e.createVNode(u,{name:"twitter",class:"h-5 w-5"})]),_:1}),e.createVNode(i,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[e.createVNode(u,{name:"github",class:"h-5 w-5"})]),_:1})])])])]),e.createVNode(m,{class:"my-8"}),e.createElementVNode("div",Lp,[e.renderSlot(n.$slots,"copyright",{},()=>[e.createVNode(r,{class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(" © "+e.toDisplayString(new Date().getFullYear())+" Your Company. All rights reserved. ",1)]),_:1})]),e.renderSlot(n.$slots,"legal",{},()=>[e.createElementVNode("div",jp,[e.createVNode(i,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[6]||(a[6]=[e.createTextVNode(" Privacy ",-1)])]),_:1}),e.createVNode(i,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[7]||(a[7]=[e.createTextVNode(" Terms ",-1)])]),_:1})])])])])],2)}}},Op={class:"flex items-center justify-between h-16 px-4 md:px-6"},Ip={class:"flex items-center"},_p={key:0,class:"mr-4 flex-shrink-0 bg-gradient-to-r from-blue-50 to-indigo-50 px-3 py-2 rounded-lg border border-blue-100 flex items-center gap-3 relative"},Rp={key:0,class:"flex-shrink-0"},Up=["src"],qp={key:1,class:"flex-shrink-0"},Hp=["src","alt"],Wp={class:"min-w-0"},Yp={class:"text-lg font-bold text-blue-900 truncate max-w-[200px]"},Gp={key:0,class:"text-xs text-blue-600 truncate font-medium"},Kp={class:"w-4 h-4 text-blue-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Xp=["d"],Qp={key:3,class:"min-w-0"},Jp={class:"text-lg font-bold text-blue-900 truncate max-w-[200px]"},Zp={key:0,class:"text-xs text-blue-600 truncate font-medium"},eg={key:0,class:"absolute top-full left-0 mt-2 w-80 bg-white rounded-lg shadow-lg border border-gray-200 z-50 max-h-96 overflow-y-auto"},tg={class:"py-2"},ag=["onClick"],ng={key:0,class:"flex-shrink-0 mr-3"},og=["src","alt"],rg={class:"flex-1 text-left min-w-0"},lg={class:"font-medium truncate"},sg={key:0,class:"text-xs text-gray-500 truncate"},ig={key:1,class:"w-4 h-4 text-blue-500 flex-shrink-0 ml-2",fill:"currentColor",viewBox:"0 0 20 20"},cg={class:"hidden md:flex items-center space-x-2 text-sm truncate"},dg={class:"text-gray-500 truncate"},ug={class:"text-gray-900 font-medium truncate"},mg={class:"flex items-center space-x-3 md:space-x-4"},fg={key:1,class:"relative"},pg={key:0,class:"absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white text-xs rounded-full flex items-center justify-center"},gg={key:0,class:"absolute right-4 md:right-6 top-16 mt-2 w-72 md:w-80 bg-white rounded-lg shadow-lg border border-gray-200 z-50"},vg={class:"max-h-96 overflow-y-auto"},hg={class:"flex items-start space-x-3"},bg={class:"flex-1"},yg={class:"text-sm text-gray-900"},xg={class:"text-xs text-gray-500 mt-1"},kg={class:"relative"},wg={class:"w-8 h-8 bg-gradient-to-br from-blue-100 to-indigo-100 rounded-full flex items-center justify-center transition-colors shadow-sm"},Cg={class:"text-blue-700 text-sm font-medium"},Bg={class:"hidden md:block text-left max-w-[160px] truncate"},Vg={class:"text-sm font-medium text-gray-900 truncate"},Sg={class:"text-xs text-gray-500 truncate leading-tight"},Eg={key:0,class:"absolute right-0 mt-2 w-58 bg-white rounded-lg shadow-lg border border-gray-200 z-50"},Ng={class:"p-4 border-b border-gray-200"},$g={class:"text-sm font-medium text-gray-900"},zg={class:"text-xs text-gray-500"},Dg={class:"py-2"},Tg={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Ag=["onClick"],Fg={class:"flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2 bg-gray-100 text-gray-600 group-hover:bg-gray-200"},Pg={class:"flex-1 truncate font-semibold text-gray-700"},Go={__name:"Header",props:{sidebarWidth:{type:Number,default:256},currentSection:{type:String,default:"Dashboard"},currentPage:{type:String,default:"Overview"},currentRoute:{type:String,default:""},user:{type:Object,required:!0},notifications:{type:Array,default:()=>[]},profileMenuItems:{type:Array,required:!0},mobileOpen:{type:Boolean,default:!1},currentOrganisation:{type:Object,default:null},companyLogo:{type:String,default:""},organisationLogo:{type:String,default:""},organisations:{type:Array,default:()=>[]}},emits:["search","profile-action","logout","navigate","toggle-mobile-sidebar","organisation-change"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),l=e.ref(!1),i=e.ref(!1),u=e.ref(a.notifications.length),m=e.ref(!1),p=e.ref(!1),v=e.ref(!1),h=e.computed(()=>(a.user?.name||"Guest").split(" ").map(L=>L[0]||"").join("").toUpperCase()),E=e.computed(()=>a.user?.roles?.length?a.user.roles.map(F=>F.name).join(", "):"No role"),y=()=>{l.value=!l.value,i.value=!1},b=()=>{i.value=!i.value,l.value=!1,v.value=!1},f=()=>{v.value=!v.value,i.value=!1,l.value=!1},d=F=>{o("navigate",F),i.value=!1},s=F=>F.route?!!(a.currentRoute===F.route||a.currentRoute.startsWith(F.route+"/")):!1,c=F=>{o("profile-action",F),i.value=!1},g=()=>{o("logout"),i.value=!1},S=F=>{o("organisation-change",F),v.value=!1},k=F=>{!F.target.closest(".absolute")&&!F.target.closest("button")&&(l.value=!1,i.value=!1,v.value=!1)},N=()=>{p.value=window.innerWidth<768};return e.onMounted(()=>{document.addEventListener("click",k),N(),window.addEventListener("resize",N)}),e.onUnmounted(()=>{document.removeEventListener("click",k),window.removeEventListener("resize",N)}),e.watch(r,F=>o("search",F)),(F,L)=>{const q=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("header",{class:e.normalizeClass(e.unref(x)("fixed top-0 z-50 bg-white border-b border-gray-200 transition-all duration-300 ease-in-out w-full")),style:{left:"0"}},[e.createElementVNode("div",Op,[e.createElementVNode("div",Ip,[t.currentOrganisation?(e.openBlock(),e.createElementBlock("div",_p,[t.companyLogo?(e.openBlock(),e.createElementBlock("div",Rp,[e.createElementVNode("img",{src:t.companyLogo,alt:"Company logo",class:"w-6 h-6 object-contain rounded"},null,8,Up)])):e.createCommentVNode("",!0),t.organisationLogo?(e.openBlock(),e.createElementBlock("div",qp,[e.createElementVNode("img",{src:t.organisationLogo,alt:`${t.currentOrganisation.organisation_name} logo`,class:"w-8 h-8 object-contain rounded border border-blue-200"},null,8,Hp)])):e.createCommentVNode("",!0),t.organisations.length>1?(e.openBlock(),e.createElementBlock("button",{key:2,class:"flex items-center gap-2 min-w-0 cursor-pointer hover:bg-blue-100/50 rounded-md px-2 py-1 transition-colors",onClick:f},[e.createElementVNode("div",Wp,[e.createElementVNode("p",Yp,e.toDisplayString(t.currentOrganisation.organisation_name),1),t.currentOrganisation.role?(e.openBlock(),e.createElementBlock("p",Gp,e.toDisplayString(t.currentOrganisation.role),1)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createElementBlock("svg",Kp,[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:v.value?"m5 15 7-7 7 7":"m19 9-7 7-7-7"},null,8,Xp)]))])):(e.openBlock(),e.createElementBlock("div",Qp,[e.createElementVNode("p",Jp,e.toDisplayString(t.currentOrganisation.organisation_name),1),t.currentOrganisation.role?(e.openBlock(),e.createElementBlock("p",Zp,e.toDisplayString(t.currentOrganisation.role),1)):e.createCommentVNode("",!0)])),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[v.value?(e.openBlock(),e.createElementBlock("div",eg,[L[5]||(L[5]=e.createElementVNode("div",{class:"p-3 border-b border-gray-200"},[e.createElementVNode("h3",{class:"text-sm font-semibold text-gray-900"}," Switch Organisation "),e.createElementVNode("p",{class:"text-xs text-gray-500 mt-1"}," Select an organisation to view its data ")],-1)),e.createElementVNode("div",tg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.organisations,w=>(e.openBlock(),e.createElementBlock("button",{key:w.org_id||w.organisation_name,class:e.normalizeClass(e.unref(x)("flex items-center w-full px-3 py-2.5 text-sm transition-colors",w.org_id===t.currentOrganisation?.org_id?"bg-blue-50 text-blue-700 border-l-4 border-blue-500":"text-gray-700 hover:bg-gray-50")),onClick:M=>S(w)},[w.logo?(e.openBlock(),e.createElementBlock("div",ng,[e.createElementVNode("img",{src:w.logo,alt:`${w.organisation_name} logo`,class:"w-6 h-6 object-contain rounded"},null,8,og)])):e.createCommentVNode("",!0),e.createElementVNode("div",rg,[e.createElementVNode("p",lg,e.toDisplayString(w.organisation_name),1),w.role?(e.openBlock(),e.createElementBlock("p",sg,e.toDisplayString(w.role),1)):e.createCommentVNode("",!0)]),w.org_id===t.currentOrganisation?.org_id?(e.openBlock(),e.createElementBlock("svg",ig,[...L[4]||(L[4]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 01 1.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)],10,ag))),128))])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("nav",cg,[e.createElementVNode("span",dg,e.toDisplayString(t.currentSection),1),L[6]||(L[6]=e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)),e.createElementVNode("span",ug,e.toDisplayString(t.currentPage),1)])]),e.createElementVNode("div",mg,[p.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:L[0]||(L[0]=w=>o("toggle-mobile-sidebar"))},[...L[7]||(L[7]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])])):e.createCommentVNode("",!0),!p.value||m.value?(e.openBlock(),e.createElementBlock("div",fg,[L[8]||(L[8]=e.createElementVNode("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})])],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":L[1]||(L[1]=w=>r.value=w),type:"text",placeholder:"Search...",class:"pl-10 pr-4 py-2 w-48 md:w-64 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none"},null,512),[[e.vModelText,r.value]]),p.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",onClick:L[2]||(L[2]=w=>m.value=!1)}," ✕ ")):e.createCommentVNode("",!0)])):p.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:L[3]||(L[3]=w=>m.value=!0)},[...L[9]||(L[9]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"relative p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:y},[L[10]||(L[10]=e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 17h5l-5 5v-5z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 3h2.586a1 1 0 01.707.293l6.414 6.414a1 1 0 01.293.707V19a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h4L13 3z"})],-1)),u.value>0?(e.openBlock(),e.createElementBlock("span",pg,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",gg,[L[12]||(L[12]=e.createElementVNode("div",{class:"p-4 border-b border-gray-200"},[e.createElementVNode("h3",{class:"text-lg font-semibold text-gray-900"}," Notifications ")],-1)),e.createElementVNode("div",vg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.notifications,w=>(e.openBlock(),e.createElementBlock("div",{key:w.id,class:"p-4 border-b border-gray-100 hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",hg,[L[11]||(L[11]=e.createElementVNode("div",{class:"flex-shrink-0 w-2 h-2 mt-2 bg-blue-500 rounded-full"},null,-1)),e.createElementVNode("div",bg,[e.createElementVNode("p",yg,e.toDisplayString(w.title),1),e.createElementVNode("p",xg,e.toDisplayString(w.time),1)])])]))),128))]),L[13]||(L[13]=e.createElementVNode("div",{class:"p-4 text-center"},[e.createElementVNode("button",{class:"text-sm text-blue-600 hover:text-blue-800"}," View all notifications ")],-1))])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",kg,[e.createElementVNode("button",{class:"flex items-center space-x-2 md:space-x-3 p-2 rounded-lg hover:bg-gray-50 transition-colors",onClick:b},[e.createElementVNode("div",wg,[e.createElementVNode("span",Cg,e.toDisplayString(h.value),1)]),e.createElementVNode("div",Bg,[e.createElementVNode("p",Vg,e.toDisplayString(t.user.name),1),e.createElementVNode("p",Sg,e.toDisplayString(E.value),1)]),L[14]||(L[14]=e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",Eg,[e.createElementVNode("div",Ng,[e.createElementVNode("p",$g,e.toDisplayString(t.user.name),1),e.createElementVNode("p",zg,e.toDisplayString(t.user.email),1)]),e.createElementVNode("div",Dg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.profileMenuItems,w=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w.name},[w.route?(e.openBlock(),e.createBlock(q,{key:0,to:w.route,class:e.normalizeClass(e.unref(x)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",s(w)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:M=>d(w)},{default:e.withCtx(()=>[s(w)?(e.openBlock(),e.createElementBlock("div",Tg)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2",s(w)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[w.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:w.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("flex-1 truncate font-semibold",s(w)?"text-blue-700":"text-gray-700"))},e.toDisplayString(w.label),3)]),_:2},1032,["to","class","onClick"])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"flex items-center w-full px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent",onClick:M=>c(w)},[e.createElementVNode("div",Fg,[w.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:w.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Pg,e.toDisplayString(w.label),1)],8,Ag))],64))),128))]),e.createElementVNode("div",{class:"border-t border-gray-200 py-2"},[e.createElementVNode("button",{class:"flex items-center w-full px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative text-red-600 hover:bg-red-50 border border-transparent",onClick:g},[...L[15]||(L[15]=[e.createElementVNode("div",{class:"flex items-center justify-center w-8 h-8 rounded-lg mr-1 flex-shrink-0 transition-colors ml-2 bg-red-100 text-red-600 group-hover:bg-red-200"},[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a2 2 0 013-3h4a3 3 0 013 3v1"})])],-1),e.createElementVNode("span",{class:"truncate font-semibold text-red-600"}," Sign out ",-1)])])])])):e.createCommentVNode("",!0)]),_:1})])])])],2)}}},Mg={class:"relative"},Lg=["id","disabled"],jg={key:0,class:"text-gray-500"},Og={key:1,class:"flex flex-wrap gap-1.5"},Ig={class:"px-3 py-2.5 border-b border-gray-200 bg-gray-50"},_g={key:0,class:"max-h-52 overflow-y-auto py-1"},Rg=["onClick"],Ug={class:"flex items-center gap-3"},qg=["checked"],Hg={key:1,class:"px-4 py-6 text-sm text-gray-500 text-center"},Ko={__name:"MultiSelect",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,required:!0,validator:t=>t.every(n=>n.value!==void 0&&n.label)},id:{type:String,default:null},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:"Select options"},hasError:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(""),i=e.ref(null),u=e.ref([...a.options]),m=e.ref(null),p=e.ref({}),v=e.computed(()=>a.options.filter(s=>a.modelValue.includes(s.value)).map(s=>s.label)),h=()=>{if(!m.value)return;const s=m.value.getBoundingClientRect(),c=window.innerHeight,g=c-s.bottom,S=320;g<S&&s.top>S?p.value={position:"fixed",bottom:`${c-s.top+4}px`,left:`${s.left}px`,width:`${s.width}px`,zIndex:9999}:p.value={position:"fixed",top:`${s.bottom+4}px`,left:`${s.left}px`,width:`${s.width}px`,zIndex:9999}},E=()=>{a.disabled||(r.value=!r.value,r.value?(h(),e.nextTick(()=>{i.value?.focus()})):(l.value="",u.value=[...a.options]))},y=s=>{let c;a.modelValue.includes(s)?c=a.modelValue.filter(g=>g!==s):c=[...a.modelValue,s],o("update:modelValue",c)},b=()=>{if(!l.value.trim())u.value=[...a.options];else{const s=l.value.toLowerCase();u.value=a.options.filter(c=>c.label.toLowerCase().includes(s))}},f=s=>{s.key==="Escape"&&(r.value=!1,l.value="",u.value=[...a.options])},d=s=>{if(!m.value)return;const c=s.target;c&&!m.value.contains(c)&&!c.closest("[data-multiselect-dropdown]")&&(r.value=!1,l.value="",u.value=[...a.options])};return e.onMounted(()=>{document.addEventListener("click",d),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),e.onUnmounted(()=>{document.removeEventListener("click",d),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),e.watch(()=>a.options,s=>{u.value=[...s]},{immediate:!0}),e.watch(r,s=>{s&&h()}),(s,c)=>(e.openBlock(),e.createElementBlock("div",Mg,[e.createElementVNode("button",{id:t.id,ref_key:"buttonRef",ref:m,type:"button",disabled:t.disabled,class:e.normalizeClass(["w-full px-3 py-2.5 text-left border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white min-h-[42px]",t.hasError?"border-red-500":"border-slate-300",t.disabled?"bg-gray-100 cursor-not-allowed opacity-50":"hover:border-slate-400"]),onClick:E,onKeydown:f},[v.value.length===0?(e.openBlock(),e.createElementBlock("div",jg,e.toDisplayString(t.placeholder||"Select options"),1)):(e.openBlock(),e.createElementBlock("div",Og,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,g=>(e.openBlock(),e.createBlock(da,{key:g,variant:"primary",size:"sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g),1)]),_:2},1024))),128))])),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["absolute right-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400 pointer-events-none transition-transform duration-200",{"rotate-180":r.value}]),fill:"currentColor",viewBox:"0 0 20 20"},[...c[2]||(c[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],42,Lg),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(p.value),"data-multiselect-dropdown":"",class:"bg-white shadow-lg max-h-72 rounded-md text-base ring-1 ring-black ring-opacity-5 overflow-hidden focus:outline-none"},[e.createElementVNode("div",Ig,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:i,"onUpdate:modelValue":c[0]||(c[0]=g=>l.value=g),type:"text",placeholder:"Search options...",class:"w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white",onInput:b,onKeydown:c[1]||(c[1]=e.withModifiers(()=>{},["stop"]))},null,544),[[e.vModelText,l.value]])]),u.value.length>0?(e.openBlock(),e.createElementBlock("div",_g,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,type:"button",class:e.normalizeClass(["cursor-pointer select-none relative py-2.5 pl-3 pr-9 w-full text-left hover:bg-blue-50 focus:bg-blue-50 focus:outline-none transition-colors duration-150",{"bg-blue-50":t.modelValue.includes(g.value)}]),onClick:S=>y(g.value)},[e.createElementVNode("div",Ug,[e.createElementVNode("input",{type:"checkbox",checked:t.modelValue.includes(g.value),class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded cursor-pointer pointer-events-none",readonly:"",tabindex:"-1"},null,8,qg),e.createElementVNode("span",{class:e.normalizeClass(["block font-normal truncate",{"text-blue-900 font-medium":t.modelValue.includes(g.value)}])},e.toDisplayString(g.label),3)])],10,Rg))),128))])):(e.openBlock(),e.createElementBlock("div",Hg," No options found "))],4)):e.createCommentVNode("",!0)]),_:1})]))]))}},Wg={class:"mb-6"},Yg={class:"text-xl font-semibold text-gray-900"},Gg={class:"text-sm text-gray-600 mt-1"},Kg=["onUpdate:modelValue"],Xg={key:5,class:"flex items-center"},Qg={key:6,class:"flex items-center"},Jg=["id","aria-checked","disabled","onClick"],Zg={key:7,class:"space-y-2"},ev={key:8,class:"space-y-2"},tv={key:0,class:"text-xs text-gray-500"},av={key:10,class:"space-y-2"},nv={class:"flex items-center gap-4"},ov={class:"text-sm font-medium text-gray-700 min-w-[3rem] text-right"},rv={class:"flex justify-end gap-3 pt-6"},Xo={__name:"ReusableFormModal",props:{modelValue:{type:Boolean,default:!1},modalType:{type:String,required:!0,validator:t=>["create","edit"].includes(t)},entityName:{type:String,default:"Item"},fields:{type:Array,required:!0,validator:t=>t.every(n=>n.name&&n.label&&n.type&&["text","number","password","textarea","select","checkbox","slider","date","color","email","tel","url","time","datetime-local","month","week","file","radio","switch","range","search","hidden","multiselect","combobox"].includes(n.type))},initialData:{type:Object,default:null},loading:{type:Boolean,default:!1},customValidation:{type:Function,default:null},modalSize:{type:String,default:"4xl",validator:t=>["sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","full"].includes(t)},modalHeight:{type:String,default:"auto"},modalResizable:{type:Boolean,default:!1}},emits:["update:modelValue","submit","close"],setup(t,{emit:n}){const a=t,o=n,r=e.computed({get:()=>a.modelValue,set:d=>o("update:modelValue",d)}),l=e.computed(()=>a.loading),i=e.ref({}),u=e.ref({}),m=e.ref(!1),p=()=>{const d={};return a.fields.forEach(s=>{s.type==="checkbox"||s.type==="switch"?d[s.name]=!1:s.type==="number"||s.type==="slider"||s.type==="range"?d[s.name]=s.min!==void 0?s.min:0:s.type==="file"?d[s.name]=null:s.type==="radio"?d[s.name]=s.options?.[0]?.value||"":s.type==="multiselect"?d[s.name]=[]:(s.type,d[s.name]="")}),d};e.watch(()=>a.initialData,d=>{if(a.modalType==="edit"&&d){const s={};a.fields.forEach(c=>{c.type==="checkbox"||c.type==="switch"?s[c.name]=d[c.name]??!1:c.type==="number"||c.type==="slider"||c.type==="range"?s[c.name]=d[c.name]??(c.min!==void 0?c.min:0):c.type==="file"?s[c.name]=null:c.type==="multiselect"?s[c.name]=Array.isArray(d[c.name])?d[c.name]:[]:(c.type,s[c.name]=d[c.name]??"")}),i.value=s,m.value=!0}else if(a.modalType==="create"&&d&&!m.value){const s={};a.fields.forEach(c=>{d[c.name]!==void 0&&d[c.name]!==null?s[c.name]=d[c.name]:c.type==="checkbox"||c.type==="switch"?s[c.name]=!1:c.type==="number"||c.type==="slider"||c.type==="range"?s[c.name]=c.min!==void 0?c.min:0:c.type==="file"?s[c.name]=null:c.type==="radio"?s[c.name]=c.options?.[0]?.value||"":c.type==="multiselect"?s[c.name]=[]:(c.type,s[c.name]="")}),i.value=s,m.value=!0}else a.modalType==="create"&&!d&&(i.value=p(),m.value=!1)},{immediate:!0,deep:!0}),e.watch(()=>a.modelValue,d=>{if(d&&(u.value={},a.modalType==="create")){if(m.value=!1,a.initialData){const s={};a.fields.forEach(c=>{a.initialData[c.name]!==void 0&&a.initialData[c.name]!==null?s[c.name]=a.initialData[c.name]:c.type==="checkbox"||c.type==="switch"?s[c.name]=!1:c.type==="number"||c.type==="slider"||c.type==="range"?s[c.name]=c.min!==void 0?c.min:0:c.type==="file"?s[c.name]=null:c.type==="radio"?s[c.name]=c.options?.[0]?.value||"":c.type==="multiselect"?s[c.name]=[]:(c.type,s[c.name]="")}),i.value=s}else i.value=p();m.value=!0}}),e.watch(()=>a.initialData,d=>{m.value&&d&&Object.keys(d).forEach(s=>{Object.prototype.hasOwnProperty.call(i.value,s)&&d[s]!==void 0&&d[s]!==null&&(i.value[s]=d[s])})},{deep:!0});const v=()=>{if(u.value={},a.fields.forEach(d=>{if(d.required&&!d.disabled&&d.type!=="hidden"){const s=i.value[d.name];d.type==="checkbox"||d.type==="switch"?d.required&&!s&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="number"||d.type==="slider"||d.type==="range"?s===""||s===null||s===void 0?u.value[d.name]=d.errorMessage||`${d.label} is required`:d.min!==void 0&&Number(s)<d.min?u.value[d.name]=`${d.label} must be at least ${d.min}`:d.max!==void 0&&Number(s)>d.max&&(u.value[d.name]=`${d.label} must be at most ${d.max}`):d.type==="email"?!s||!s.trim()?u.value[d.name]=d.errorMessage||`${d.label} is required`:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)||(u.value[d.name]="Please enter a valid email address"):d.type==="url"?!s||!s.trim()?u.value[d.name]=d.errorMessage||`${d.label} is required`:/^https?:\/\/.+/.test(s)||(u.value[d.name]="Please enter a valid URL"):d.type==="tel"?(!s||!s.trim())&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="file"?s||(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="radio"?s||(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="multiselect"?(!Array.isArray(s)||s.length===0)&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="combobox"?(!s||typeof s=="string"&&!s.trim())&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="date"||d.type==="time"||d.type==="datetime-local"||d.type==="month"||d.type==="week"?(!s||typeof s=="string"&&!s.trim())&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="password"?(!s||typeof s=="string"&&!s.trim())&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):(!s||typeof s=="string"&&!s.trim())&&(u.value[d.name]=d.errorMessage||`${d.label} is required`)}if(d.validate&&typeof d.validate=="function"){const s=d.validate(i.value[d.name],i.value);s&&(u.value[d.name]=s)}}),a.customValidation){const d=a.customValidation(i.value);d&&Object.keys(d).length>0&&(u.value={...u.value,...d})}return Object.keys(u.value).length===0},h=async(d,s)=>{if(i.value[d.name]=s,d.onChange&&typeof d.onChange=="function")try{await d.onChange(s,i.value)}catch(c){console.error("Error in onChange handler:",c),ae.error("An error occurred while processing the change")}},E=(d,s)=>{if(i.value[d.name]=s,d.onChange&&typeof d.onChange=="function")try{d.onChange(s,i.value)}catch(c){console.error("Error in onChange handler:",c),ae.error("An error occurred while processing the change")}},y=(d,s)=>{const c=s.target.files?.[0]||null;if(i.value[d.name]=c,d.onChange&&typeof d.onChange=="function")try{d.onChange(c,i.value)}catch(g){console.error("Error in onChange handler:",g),ae.error("An error occurred while processing the file")}},b=async()=>{try{if(!v()){ae.error("Please fix the validation errors before submitting");return}const d={};a.fields.forEach(s=>{const c=i.value[s.name];s.type==="number"||s.type==="slider"||s.type==="range"?d[s.name]=Number(c):s.type==="text"||s.type==="textarea"||s.type==="date"||s.type==="email"||s.type==="url"||s.type==="tel"||s.type==="search"||s.type==="time"||s.type==="datetime-local"||s.type==="month"||s.type==="week"?d[s.name]=typeof c=="string"?c.trim():c:(s.type==="password"||s.type,d[s.name]=c)}),o("submit",{formData:d,modalType:a.modalType,originalData:a.initialData})}catch(d){console.error("Error during form submission:",d),ae.error("An error occurred during submission")}},f=()=>{i.value=p(),u.value={},m.value=!1,o("close")};return(d,s)=>(e.openBlock(),e.createBlock(ht,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=c=>r.value=c),"show-close":!0,"close-on-backdrop":!0,size:t.modalSize,class:e.normalizeClass(t.modalHeight==="auto"?"":t.modalHeight),resizable:t.modalResizable,onClose:f},{default:e.withCtx(()=>[e.createElementVNode("div",Wg,[e.createElementVNode("h2",Yg,e.toDisplayString(t.modalType==="create"?`Add New ${t.entityName}`:`Edit ${t.entityName}`),1),e.createElementVNode("p",Gg,e.toDisplayString(t.modalType==="create"?`Fill in the details to create a new ${t.entityName.toLowerCase()}.`:`Update the ${t.entityName.toLowerCase()} information below.`),1)]),e.createElementVNode("form",{class:"space-y-6 overflow-y-auto",onSubmit:e.withModifiers(b,["prevent"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,c=>(e.openBlock(),e.createElementBlock("div",{key:c.name},[c.type==="hidden"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":g=>i.value[c.name]=g,type:"hidden"},null,8,Kg)),[[e.vModelText,i.value[c.name]]]):(e.openBlock(),e.createBlock(vt,{key:1,id:`form-${t.entityName}-${c.name}-${Math.random().toString(36).slice(2,5)}`,label:c.label,required:c.required&&!c.disabled,error:u.value[c.name],"error-message":u.value[c.name]},{default:e.withCtx(({fieldId:g,hasError:S,ariaDescribedBy:k})=>[["text","number","password","color","email","tel","url","search"].includes(c.type)?(e.openBlock(),e.createBlock(Q,{key:0,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:c.type,placeholder:c.placeholder,disabled:l.value||c.disabled,readonly:c.disabled,class:e.normalizeClass(S?"border-red-500":"border-slate-300"),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","disabled","readonly","class","aria-describedby"])):c.type==="textarea"?(e.openBlock(),e.createBlock(gt,{key:1,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,placeholder:c.placeholder,disabled:l.value||c.disabled,rows:c.rows||3,class:e.normalizeClass(["w-full px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",S?"border-red-500":"border-slate-300"]),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","placeholder","disabled","rows","class","aria-describedby"])):c.type==="select"?(e.openBlock(),e.createBlock(se,{key:2,id:g,"model-value":i.value[c.name],options:c.options,placeholder:c.placeholder||"Select an option",disabled:l.value||c.disabled,"has-error":S,"aria-describedby":k,"onUpdate:modelValue":N=>h(c,N)},null,8,["id","model-value","options","placeholder","disabled","has-error","aria-describedby","onUpdate:modelValue"])):c.type==="multiselect"?(e.openBlock(),e.createBlock(Ko,{key:3,id:g,"model-value":i.value[c.name],options:c.options,disabled:l.value||c.disabled,placeholder:c.placeholder||"Select options","has-error":S,"aria-describedby":k,"onUpdate:modelValue":N=>i.value[c.name]=N},null,8,["id","model-value","options","disabled","placeholder","has-error","aria-describedby","onUpdate:modelValue"])):c.type==="combobox"?(e.openBlock(),e.createBlock(se,{key:4,id:g,"model-value":i.value[c.name],options:c.options,placeholder:c.placeholder||"Select or type to add new",disabled:l.value||c.disabled,"has-error":S,"aria-describedby":k,"allow-create":c.allowCreate,"onUpdate:modelValue":N=>h(c,N)},null,8,["id","model-value","options","placeholder","disabled","has-error","aria-describedby","allow-create","onUpdate:modelValue"])):c.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",Xg,[e.createVNode(Q,{id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"checkbox",disabled:l.value||c.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded","aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","aria-describedby"]),e.createVNode(me,{for:g,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.checkboxLabel||c.label),1)]),_:2},1032,["for"])])):c.type==="switch"?(e.openBlock(),e.createElementBlock("div",Qg,[e.createElementVNode("button",{id:g,type:"button",role:"switch","aria-checked":i.value[c.name],disabled:l.value||c.disabled,class:e.normalizeClass(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",i.value[c.name]?"bg-blue-600":"bg-gray-200",l.value||c.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:N=>i.value[c.name]=!i.value[c.name]},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",i.value[c.name]?"translate-x-6":"translate-x-1"])},null,2)],10,Jg),e.createVNode(me,{for:g,class:"ml-3 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.checkboxLabel||c.label),1)]),_:2},1032,["for"])])):c.type==="radio"?(e.openBlock(),e.createElementBlock("div",Zg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.options,N=>(e.openBlock(),e.createElementBlock("div",{key:N.value,class:"flex items-center"},[e.createVNode(Q,{id:`${g}-${N.value}`,modelValue:i.value[c.name],"onUpdate:modelValue":F=>i.value[c.name]=F,type:"radio",value:N.value,disabled:l.value||c.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300","aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","value","disabled","aria-describedby"]),e.createVNode(me,{for:`${g}-${N.value}`,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.label),1)]),_:2},1032,["for"])]))),128))])):c.type==="file"?(e.openBlock(),e.createElementBlock("div",ev,[e.createVNode(Q,{id:g,type:"file",accept:c.accept,disabled:l.value||c.disabled,class:e.normalizeClass(["w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100",S?"border-red-500":"border-slate-300"]),"aria-describedby":k,onChange:N=>y(c,N)},null,8,["id","accept","disabled","class","aria-describedby","onChange"]),c.helpText?(e.openBlock(),e.createElementBlock("p",tv,e.toDisplayString(c.helpText),1)):e.createCommentVNode("",!0)])):c.type==="slider"?(e.openBlock(),e.createBlock(bt,{key:9,"model-value":i.value[c.name],min:c.min,max:c.max,step:c.step,disabled:l.value||c.disabled,"onUpdate:modelValue":N=>E(c,N)},null,8,["model-value","min","max","step","disabled","onUpdate:modelValue"])):c.type==="range"?(e.openBlock(),e.createElementBlock("div",av,[e.createElementVNode("div",nv,[e.createVNode(Q,{id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"range",min:c.min,max:c.max,step:c.step||1,disabled:l.value||c.disabled,class:"flex-1","aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","min","max","step","disabled","aria-describedby"]),e.createElementVNode("span",ov,e.toDisplayString(i.value[c.name]),1)])])):c.type==="date"?(e.openBlock(),e.createBlock(We,{key:11,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,disabled:l.value||c.disabled,required:c.required,min:c.min,max:c.max,placeholder:c.placeholder||"Select date",format:c.format||"MM/DD/YYYY",clearable:c.clearable!==!1,"show-today":c.showToday!==!1,"calendar-position":c.calendarPosition||"left-0 bottom-full","aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","required","min","max","placeholder","format","clearable","show-today","calendar-position","aria-describedby"])):c.type==="time"?(e.openBlock(),e.createBlock(Q,{key:12,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"time",disabled:l.value||c.disabled,class:e.normalizeClass(S?"border-red-500":"border-slate-300"),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="datetime-local"?(e.openBlock(),e.createBlock(Q,{key:13,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"datetime-local",disabled:l.value||c.disabled,class:e.normalizeClass(S?"border-red-500":"border-slate-300"),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="month"?(e.openBlock(),e.createBlock(Q,{key:14,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"month",disabled:l.value||c.disabled,class:e.normalizeClass(S?"border-red-500":"border-slate-300"),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="week"?(e.openBlock(),e.createBlock(Q,{key:15,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"week",disabled:l.value||c.disabled,class:e.normalizeClass(S?"border-red-500":"border-slate-300"),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):e.createCommentVNode("",!0)]),_:2},1032,["id","label","required","error","error-message"]))]))),128)),e.createElementVNode("div",rv,[e.createVNode(J,{type:"button",variant:"outline",disabled:l.value,onClick:f},{default:e.withCtx(()=>[...s[1]||(s[1]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["disabled"]),e.createVNode(J,{type:"submit",disabled:l.value,loading:l.value,variant:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.modalType==="create"?`Create ${t.entityName}`:`Update ${t.entityName}`),1)]),_:1},8,["disabled","loading"])])],32)]),_:1},8,["modelValue","size","class","resizable"]))}},lv={class:"w-full p-6"},sv={key:0,class:"mb-6"},iv={class:"text-xl font-semibold text-gray-900"},cv=["onUpdate:modelValue"],dv={key:4,class:"flex items-center"},uv={key:5,class:"flex items-center"},mv=["id","aria-checked","disabled","onClick"],fv={key:6,class:"space-y-2"},pv={key:7,class:"space-y-2"},gv={key:0,class:"text-xs text-gray-500"},vv={key:9,class:"space-y-2"},hv={class:"flex items-center gap-4"},bv={class:"text-sm font-medium text-gray-700 min-w-[3rem] text-right"},yv={class:"flex justify-end gap-3 pt-6"},Qo={__name:"ReusableForm",props:{title:{type:String,default:"Form"},entityName:{type:String,default:"Item"},fields:{type:Array,required:!0,validator:t=>t.every(n=>n.name&&n.label&&n.type&&["text","number","password","textarea","select","checkbox","slider","date","color","email","tel","url","time","datetime-local","month","week","file","radio","switch","range","search","hidden","multiselect"].includes(n.type))},initialData:{type:Object,default:null},loading:{type:Boolean,default:!1},customValidation:{type:Function,default:null}},emits:["submit","reset"],setup(t,{emit:n}){const a=t,o=n,r=e.computed(()=>a.loading),l=e.ref({}),i=e.ref({}),u=e.ref(!1),m=()=>{const f={};return a.fields.forEach(d=>{d.type==="checkbox"||d.type==="switch"?f[d.name]=!1:d.type==="number"||d.type==="slider"||d.type==="range"?f[d.name]=d.min!==void 0?d.min:0:d.type==="file"?f[d.name]=null:d.type==="radio"?f[d.name]=d.options?.[0]?.value||"":d.type==="multiselect"?f[d.name]=[]:f[d.name]=""}),f};e.watch(()=>a.initialData,f=>{if(f){const d={};a.fields.forEach(s=>{s.type==="checkbox"||s.type==="switch"?d[s.name]=f[s.name]??!1:s.type==="number"||s.type==="slider"||s.type==="range"?d[s.name]=f[s.name]??(s.min!==void 0?s.min:0):s.type==="file"?d[s.name]=null:s.type==="multiselect"?d[s.name]=Array.isArray(f[s.name])?f[s.name]:[]:d[s.name]=f[s.name]??""}),l.value=d,u.value=!0}else l.value=m(),u.value=!1},{immediate:!0,deep:!0}),e.watch(()=>a.initialData,f=>{u.value&&f&&Object.keys(f).forEach(d=>{Object.prototype.hasOwnProperty.call(l.value,d)&&f[d]!==void 0&&f[d]!==null&&(l.value[d]=f[d])})},{deep:!0});const p=()=>{if(i.value={},a.fields.forEach(f=>{if(f.required&&!f.disabled&&f.type!=="hidden"){const d=l.value[f.name];f.type==="checkbox"||f.type==="switch"?f.required&&!d&&(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="number"||f.type==="slider"||f.type==="range"?d===""||d===null||d===void 0?i.value[f.name]=f.errorMessage||`${f.label} is required`:f.min!==void 0&&Number(d)<f.min?i.value[f.name]=`${f.label} must be at least ${f.min}`:f.max!==void 0&&Number(d)>f.max&&(i.value[f.name]=`${f.label} must be at most ${f.max}`):f.type==="email"?!d||!d.trim()?i.value[f.name]=f.errorMessage||`${f.label} is required`:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d)||(i.value[f.name]="Please enter a valid email address"):f.type==="url"?!d||!d.trim()?i.value[f.name]=f.errorMessage||`${f.label} is required`:/^https?:\/\/.+/.test(d)||(i.value[f.name]="Please enter a valid URL"):f.type==="tel"?(!d||!d.trim())&&(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="file"?d||(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="radio"?d||(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="multiselect"?(!Array.isArray(d)||d.length===0)&&(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="date"||f.type==="time"||f.type==="datetime-local"||f.type==="month"||f.type==="week"?(!d||typeof d=="string"&&!d.trim())&&(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="password"?(!d||typeof d=="string"&&!d.trim())&&(i.value[f.name]=f.errorMessage||`${f.label} is required`):(!d||typeof d=="string"&&!d.trim())&&(i.value[f.name]=f.errorMessage||`${f.label} is required`)}if(f.validate&&typeof f.validate=="function"){const d=f.validate(l.value[f.name],l.value);d&&(i.value[f.name]=d)}}),a.customValidation){const f=a.customValidation(l.value);f&&Object.keys(f).length>0&&(i.value={...i.value,...f})}return Object.keys(i.value).length===0},v=async(f,d)=>{if(l.value[f.name]=d,f.onChange&&typeof f.onChange=="function")try{await f.onChange(d,l.value)}catch(s){console.error("Error in onChange handler:",s),ae.error("An error occurred while processing the change")}},h=(f,d)=>{if(l.value[f.name]=d,f.onChange&&typeof f.onChange=="function")try{f.onChange(d,l.value)}catch(s){console.error("Error in onChange handler:",s),ae.error("An error occurred while processing the change")}},E=(f,d)=>{const s=d.target.files?.[0]||null;if(l.value[f.name]=s,f.onChange&&typeof f.onChange=="function")try{f.onChange(s,l.value)}catch(c){console.error("Error in onChange handler:",c),ae.error("An error occurred while processing the file")}},y=async()=>{try{if(!p()){ae.error("Please fix the validation errors before submitting");return}const f={};a.fields.forEach(d=>{const s=l.value[d.name];d.type==="number"||d.type==="slider"||d.type==="range"?f[d.name]=Number(s):d.type==="text"||d.type==="textarea"||d.type==="date"||d.type==="email"||d.type==="url"||d.type==="tel"||d.type==="search"||d.type==="time"||d.type==="datetime-local"||d.type==="month"||d.type==="week"?f[d.name]=typeof s=="string"?s.trim():s:(d.type==="password"||d.type,f[d.name]=s)}),o("submit",{formData:f,originalData:a.initialData})}catch(f){console.error("Error during form submission:",f),ae.error("An error occurred during submission")}},b=()=>{l.value=m(),i.value={},u.value=!1,o("reset")};return(f,d)=>(e.openBlock(),e.createElementBlock("div",lv,[t.title?(e.openBlock(),e.createElementBlock("div",sv,[e.createElementVNode("h2",iv,e.toDisplayString(t.title),1)])):e.createCommentVNode("",!0),e.createElementVNode("form",{class:"space-y-8",onSubmit:e.withModifiers(y,["prevent"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,s=>(e.openBlock(),e.createElementBlock("div",{key:s.name},[s.type==="hidden"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":c=>l.value[s.name]=c,type:"hidden"},null,8,cv)),[[e.vModelText,l.value[s.name]]]):(e.openBlock(),e.createBlock(vt,{key:1,id:`form-${t.entityName}-${s.name}-${Math.random().toString(36).slice(2,5)}`,label:s.label,required:s.required&&!s.disabled,error:i.value[s.name],"error-message":i.value[s.name]},{default:e.withCtx(({fieldId:c,hasError:g,ariaDescribedBy:S})=>[["text","number","password","color","email","tel","url","search"].includes(s.type)?(e.openBlock(),e.createBlock(Q,{key:0,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:s.type,placeholder:s.placeholder,disabled:r.value||s.disabled,readonly:s.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","disabled","readonly","class","aria-describedby"])):s.type==="textarea"?(e.openBlock(),e.createBlock(gt,{key:1,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,placeholder:s.placeholder,disabled:r.value||s.disabled,rows:s.rows||3,class:e.normalizeClass(["w-full px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",g?"border-red-500":"border-slate-300"]),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","placeholder","disabled","rows","class","aria-describedby"])):s.type==="select"?(e.openBlock(),e.createBlock(se,{key:2,id:c,"model-value":l.value[s.name],options:s.options,placeholder:s.placeholder||"Select an option",disabled:r.value||s.disabled,"has-error":g,"aria-describedby":S,"onUpdate:modelValue":k=>v(s,k)},null,8,["id","model-value","options","placeholder","disabled","has-error","aria-describedby","onUpdate:modelValue"])):s.type==="multiselect"?(e.openBlock(),e.createBlock(Ko,{key:3,id:c,"model-value":l.value[s.name],options:s.options,disabled:r.value||s.disabled,placeholder:s.placeholder||"Select options","has-error":g,"aria-describedby":S,"onUpdate:modelValue":k=>l.value[s.name]=k},null,8,["id","model-value","options","disabled","placeholder","has-error","aria-describedby","onUpdate:modelValue"])):s.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",dv,[e.createVNode(Q,{id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"checkbox",disabled:r.value||s.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded","aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","aria-describedby"]),e.createVNode(me,{for:c,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.checkboxLabel||s.label),1)]),_:2},1032,["for"])])):s.type==="switch"?(e.openBlock(),e.createElementBlock("div",uv,[e.createElementVNode("button",{id:c,type:"button",role:"switch","aria-checked":l.value[s.name],disabled:r.value||s.disabled,class:e.normalizeClass(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",l.value[s.name]?"bg-blue-600":"bg-gray-200",r.value||s.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:k=>l.value[s.name]=!l.value[s.name]},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",l.value[s.name]?"translate-x-6":"translate-x-1"])},null,2)],10,mv),e.createVNode(me,{for:c,class:"ml-3 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.checkboxLabel||s.label),1)]),_:2},1032,["for"])])):s.type==="radio"?(e.openBlock(),e.createElementBlock("div",fv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.options,k=>(e.openBlock(),e.createElementBlock("div",{key:k.value,class:"flex items-center"},[e.createVNode(Q,{id:`${c}-${k.value}`,modelValue:l.value[s.name],"onUpdate:modelValue":N=>l.value[s.name]=N,type:"radio",value:k.value,disabled:r.value||s.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300","aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","value","disabled","aria-describedby"]),e.createVNode(me,{for:`${c}-${k.value}`,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.label),1)]),_:2},1032,["for"])]))),128))])):s.type==="file"?(e.openBlock(),e.createElementBlock("div",pv,[e.createVNode(Q,{id:c,type:"file",accept:s.accept,disabled:r.value||s.disabled,class:e.normalizeClass(["w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100",g?"border-red-500":"border-slate-300"]),"aria-describedby":S,onChange:k=>E(s,k)},null,8,["id","accept","disabled","class","aria-describedby","onChange"]),s.helpText?(e.openBlock(),e.createElementBlock("p",gv,e.toDisplayString(s.helpText),1)):e.createCommentVNode("",!0)])):s.type==="slider"?(e.openBlock(),e.createBlock(bt,{key:8,"model-value":l.value[s.name],min:s.min,max:s.max,step:s.step,disabled:r.value||s.disabled,"onUpdate:modelValue":k=>h(s,k)},null,8,["model-value","min","max","step","disabled","onUpdate:modelValue"])):s.type==="range"?(e.openBlock(),e.createElementBlock("div",vv,[e.createElementVNode("div",hv,[e.createVNode(Q,{id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"range",min:s.min,max:s.max,step:s.step||1,disabled:r.value||s.disabled,class:"flex-1","aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","min","max","step","disabled","aria-describedby"]),e.createElementVNode("span",bv,e.toDisplayString(l.value[s.name]),1)])])):s.type==="date"?(e.openBlock(),e.createBlock(We,{key:10,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,disabled:r.value||s.disabled,required:s.required,min:s.min,max:s.max,placeholder:s.placeholder||"Select date",format:s.format||"MM/DD/YYYY",clearable:s.clearable!==!1,"show-today":s.showToday!==!1,"calendar-position":s.calendarPosition||"left-0 bottom-full","aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","required","min","max","placeholder","format","clearable","show-today","calendar-position","aria-describedby"])):s.type==="time"?(e.openBlock(),e.createBlock(Q,{key:11,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"time",disabled:r.value||s.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):s.type==="datetime-local"?(e.openBlock(),e.createBlock(Q,{key:12,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"datetime-local",disabled:r.value||s.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):s.type==="month"?(e.openBlock(),e.createBlock(Q,{key:13,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"month",disabled:r.value||s.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):s.type==="week"?(e.openBlock(),e.createBlock(Q,{key:14,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"week",disabled:r.value||s.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):e.createCommentVNode("",!0)]),_:2},1032,["id","label","required","error","error-message"]))]))),128)),e.createElementVNode("div",yv,[e.createVNode(J,{type:"button",variant:"outline",disabled:r.value,onClick:b},{default:e.withCtx(()=>[...d[0]||(d[0]=[e.createTextVNode(" Reset ",-1)])]),_:1},8,["disabled"]),e.createVNode(J,{type:"submit",disabled:r.value,loading:r.value,variant:"default"},{default:e.withCtx(()=>[...d[1]||(d[1]=[e.createTextVNode(" Submit ",-1)])]),_:1},8,["disabled","loading"])])],32)]))}},xv={key:0,class:"flex items-center justify-between p-4 border-b border-gray-200 flex-shrink-0 lg:hidden"},kv={class:"text-lg font-bold text-gray-900"},wv={class:"flex-1 overflow-y-auto overflow-x-hidden p-4"},Cv={class:"space-y-2"},Bv={key:0},Vv={key:0,class:"absolute top-2 right-2 inline-flex items-center justify-center w-5 h-5 text-xs font-bold rounded-full bg-red-500 text-white"},Sv=["onClick"],Ev={key:0,class:"absolute top-2 right-2 inline-flex items-center justify-center w-5 h-5 text-xs font-bold rounded-full bg-red-500 text-white"},Nv={key:1,class:"absolute top-1.5 right-1.5 w-2 h-2 bg-blue-500 rounded-full"},$v={key:1,class:"border-t border-gray-200 p-4 flex-shrink-0"},zv={key:0,class:"absolute top-1.5 right-1.5 w-2 h-2 bg-blue-500 rounded-full"},Dv={class:"sticky top-0 bg-white border-b border-gray-200 z-10"},Tv={class:"flex items-center justify-between p-4"},Av={class:"flex-1 text-sm font-bold text-gray-900 ml-2"},Fv={class:"p-3"},Pv={class:"space-y-1"},Mv={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Lv={key:1,class:"ml-2 inline-flex items-center justify-center px-2 py-0.5 text-xs font-bold rounded-full bg-red-500 text-white"},jv={class:"p-3"},Ov={class:"space-y-1"},Iv={key:0,class:"px-3 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wider"},_v={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Jo={__name:"Sidebar",props:{sidebarWidth:{type:Number,default:130},header:{type:Object,default:null},navigationItems:{type:Array,required:!0},managementSettings:{type:Array,default:()=>[]},showManagementSettings:{type:Boolean,default:!0},mobileOpen:{type:Boolean,default:!1},isManagementSettingsActive:{type:Boolean,default:!1},currentPath:{type:String,default:""}},emits:["navigate","update:mobileOpen"],setup(t,{expose:n,emit:a}){const o=t,r=a,l=e.ref(!1),i=e.ref(!1),u=e.ref(null),m=e.ref(!1),p=e.computed(()=>o.mobileOpen),v=e.computed(()=>l.value?{}:{left:`${o.sidebarWidth}px`}),h=e.computed(()=>l.value?{}:{left:`${o.sidebarWidth}px`}),E=e.computed(()=>{if(l.value)return 0;let w=o.sidebarWidth;return i.value&&(w+=220),m.value&&(w+=220),w}),y=w=>{r("navigate",w),l.value&&b();const M=i.value&&u.value&&u.value.subItems.some(C=>C.route===w.route),_=m.value&&o.managementSettings.some(C=>C.route===w.route);(l.value||!(M||_))&&S()},b=()=>{r("update:mobileOpen",!1)},f=w=>w.subItems&&w.subItems.length>0,d=w=>{m.value&&g(),i.value&&u.value!==w?(c(),setTimeout(()=>{u.value=w,i.value=!0},300)):i.value?u.value===w&&c():(u.value=w,i.value=!0),l.value&&b()},s=()=>{i.value&&c(),m.value?g():m.value=!0,l.value&&b()},c=()=>{i.value=!1,setTimeout(()=>{u.value=null},300)},g=()=>{m.value=!1},S=()=>{c(),g()},k=w=>{y(w)},N=w=>{y(w)},F=w=>{const M=o.currentPath;return w.route?!!(M===w.route||M.startsWith(w.route+"/")):w.subItems&&w.subItems.length>0?w.subItems.some(_=>_.route?M===_.route||M.startsWith(_.route+"/"):!1):!1},L=()=>{const w=l.value;l.value=window.innerWidth<1024,w&&!l.value&&p.value&&b()},q=w=>{w.key==="Escape"&&(i.value||m.value?S():l.value&&p.value&&b())};return e.onMounted(()=>{L(),window.addEventListener("resize",L),document.addEventListener("keydown",q)}),e.onUnmounted(()=>{window.removeEventListener("resize",L),document.removeEventListener("keydown",q)}),n({isMobile:l,isMobileOpen:p,submenuOpen:i,managementSettingsOpen:m,contentMarginLeft:E,closeAllMenus:S}),(w,M)=>{const _=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.Transition,{"enter-active-class":"transition-opacity duration-300","leave-active-class":"transition-opacity duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[p.value&&l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-30 lg:hidden",onClick:b})):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("aside",{class:e.normalizeClass(e.unref(x)("fixed left-0 z-40 border-r overflow-hidden flex flex-col","transition-all duration-300 ease-in-out","bg-white border-gray-200",l.value?e.unref(x)("transform h-screen",p.value?"translate-x-0":"-translate-x-full"):"translate-x-0 h-[calc(100vh-4rem)]")),style:e.normalizeStyle({width:t.sidebarWidth+"px",top:l.value?"0px":"4rem"})},[l.value?(e.openBlock(),e.createElementBlock("div",xv,[e.createElementVNode("h2",kv,e.toDisplayString(t.header?.title),1),e.createElementVNode("button",{class:"p-2 rounded-lg text-gray-500 hover:text-gray-900 hover:bg-gray-100 transition-colors","aria-label":"Close sidebar",onClick:b},[...M[0]||(M[0]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])):e.createCommentVNode("",!0),e.createElementVNode("nav",wv,[e.createElementVNode("div",Cv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.navigationItems,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.name||C.label},[C.type==="link"?(e.openBlock(),e.createElementBlock("div",Bv,[f(C)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(x)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 cursor-pointer group relative py-4 px-3",F(C)?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:z=>d(C)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",F(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(I,{icon:C.icon,class:"w-6 h-6"},null,8,["icon"])],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("text-xs font-medium text-center",F(C)?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Ev,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0),F(C)&&f(C)?(e.openBlock(),e.createElementBlock("div",Nv)):e.createCommentVNode("",!0)],10,Sv)):(e.openBlock(),e.createBlock(_,{key:0,to:C.route,class:e.normalizeClass(e.unref(x)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 group relative py-4 px-3",F(C)?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:z=>y(C)},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",F(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(I,{icon:C.icon,class:"w-6 h-6"},null,8,["icon"])],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("text-xs font-medium text-center",F(C)?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Vv,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0)]),_:2},1032,["to","class","onClick"]))])):e.createCommentVNode("",!0)],64))),128))])]),t.showManagementSettings?(e.openBlock(),e.createElementBlock("div",$v,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 cursor-pointer group relative py-4 px-3",t.isManagementSettingsActive?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:s},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",t.isManagementSettingsActive?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(I,{icon:"cog",class:"w-6 h-6"})],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("text-xs font-medium text-center",t.isManagementSettingsActive?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))}," Settings ",2),t.isManagementSettingsActive?(e.openBlock(),e.createElementBlock("div",zv)):e.createCommentVNode("",!0)],2)])):e.createCommentVNode("",!0)],6),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 -translate-x-full","enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-full"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(e.unref(x)("fixed z-40 bg-white border-r border-gray-200 overflow-y-auto shadow-lg",l.value?"left-0 w-52 top-20 h-screen":"w-56 top-16 h-[calc(100vh-4rem)]")),style:e.normalizeStyle(v.value)},[e.createElementVNode("div",Dv,[e.createElementVNode("div",Tv,[e.createElementVNode("button",{class:"p-2 -ml-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors","aria-label":"Close submenu",onClick:c},[...M[1]||(M[1]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e.createElementVNode("h3",Av,e.toDisplayString(u.value?.label),1)])]),e.createElementVNode("nav",Fv,[e.createElementVNode("div",Pv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value?.subItems,C=>(e.openBlock(),e.createBlock(_,{key:C.name,to:C.route,class:e.normalizeClass(e.unref(x)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",F(C)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:z=>k(C)},{default:e.withCtx(()=>[F(C)?(e.openBlock(),e.createElementBlock("div",Mv)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2",F(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[C.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:C.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("flex-1 truncate font-semibold",F(C)?"text-blue-700":"text-gray-700"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Lv,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0)]),_:2},1032,["to","class","onClick"]))),128))])])],6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 -translate-x-full","enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-full"},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(e.unref(x)("fixed z-40 bg-white border-r border-gray-200 overflow-y-auto shadow-lg",l.value?"left-0 w-52 top-20 h-full":"w-58 h-[calc(100vh-4rem)]")),style:e.normalizeStyle({...h.value,top:l.value?"55px":"4rem"})},[e.createElementVNode("div",{class:"sticky top-0 z-10 bg-white border-b border-gray-200"},[e.createElementVNode("div",{class:"flex items-center justify-between p-4"},[e.createElementVNode("button",{class:"p-2 -ml-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors","aria-label":"Close management settings",onClick:g},[...M[2]||(M[2]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),M[3]||(M[3]=e.createElementVNode("h3",{class:"flex-1 text-sm font-bold text-gray-900 ml-2"}," Management Settings ",-1))])]),e.createElementVNode("nav",jv,[e.createElementVNode("div",Ov,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.managementSettings,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.name},[C.type==="section"?(e.openBlock(),e.createElementBlock("div",Iv,e.toDisplayString(C.label),1)):C.route?(e.openBlock(),e.createBlock(_,{key:1,to:C.route,class:e.normalizeClass(e.unref(x)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",F(C)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:z=>N(C)},{default:e.withCtx(()=>[F(C)?(e.openBlock(),e.createElementBlock("div",_v)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors",F(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[C.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:C.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("flex-1 truncate font-semibold",F(C)?"text-blue-700":"text-gray-700"))},e.toDisplayString(C.label),3)]),_:2},1032,["to","class","onClick"])):e.createCommentVNode("",!0)],64))),128))])])],6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{"enter-active-class":"transition-opacity duration-300","leave-active-class":"transition-opacity duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(i.value||m.value)&&l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-30 bg-transparent",onClick:S})):e.createCommentVNode("",!0)]),_:1})])}}},Zo={__name:"Timeline",props:{orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex",t.orientation==="vertical"?"flex-col":"flex-row"])},[e.renderSlot(n.$slots,"default")],2))}},Rv={key:0,class:"absolute left-3 top-0 w-0.5 h-full bg-slate-200"},Uv={class:"z-10 flex items-center justify-center w-6 h-6 rounded-full border-2 border-blue-500 bg-white text-blue-500"},qv={class:"text-slate-900 font-medium"},Hv={key:0,class:"text-slate-500 text-sm"},Wv={class:"mt-2 text-slate-600 text-sm"},er={__name:"TimelineItem",props:{title:{type:String,required:!0},subtitle:{type:String,default:""},orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex",t.orientation==="vertical"?"items-start mb-8 last:mb-0":"flex-col items-center mx-8 last:mx-0"])},[t.orientation==="vertical"?(e.openBlock(),e.createElementBlock("div",Rv)):e.createCommentVNode("",!0),e.createElementVNode("div",Uv,[e.renderSlot(n.$slots,"icon",{},()=>[a[0]||(a[0]=e.createElementVNode("div",{class:"w-2 h-2 rounded-full bg-blue-500"},null,-1))])]),e.createElementVNode("div",{class:e.normalizeClass(["ml-6",t.orientation==="horizontal"?"mt-2 text-center":""])},[e.createElementVNode("h3",qv,[e.renderSlot(n.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])]),t.subtitle?(e.openBlock(),e.createElementBlock("p",Hv,[e.renderSlot(n.$slots,"subtitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subtitle),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Wv,[e.renderSlot(n.$slots,"default")])],2)],2))}},Yv={name:"AuthLayout",props:{title:{type:String,default:null},subtitle:{type:String,default:null},primaryLogoPrefix:{type:String,default:"e"},primaryLogoText:{type:String,default:"HORIZON"},secondaryLogoPrefix:{type:String,default:"e"},secondaryLogoText:{type:String,default:"Risk & Compliance"},quote:{type:String,default:""},primaryColor:{type:String,default:"#e74c3c"},backgroundColor:{type:String,default:"#2c2c2c"},backgroundImage:{type:String,default:"https://images.unsplash.com/photo-1497366216548-37526070297c?ixlib=rb-4.0.3&auto=format&fit=crop&w=2069&q=80"},backgroundOpacity:{type:Number,default:.4},companyName:{type:String,default:"SOFTWARE"},companyType:{type:String,default:"TECHNOLOGIES"},companyTagline:{type:String,default:"People | Processes | Governance"},companyInitials:{type:String,default:"ST"},appName:{type:String,default:"eHorizon eBoard X"},appVersion:{type:String,default:"Version 2.0"},copyright:{type:String,default:"Copyright © 2025 Software Technologies Limited"},socialLinks:{type:Array,default:()=>[{name:"linkedin",url:"#",icon:"linkedin-in",variant:"primary"},{name:"facebook",url:"#",icon:"facebook-f",variant:"primary"},{name:"twitter",url:"#",icon:"twitter",variant:"info"}]}},setup(){return{currentYear:e.computed(()=>new Date().getFullYear())}}},Gv={class:"container mx-auto px-4 relative z-10"},Kv={class:"grid lg:grid-cols-10 gap-8 items-center min-h-screen"},Xv={class:"lg:col-span-6 text-white text-center lg:text-left space-y-6"},Qv={class:"mb-6"},Jv={class:"text-4xl lg:text-6xl font-bold mb-2"},Zv={class:"text-white"},e0={class:"flex items-center justify-center lg:justify-start mb-6"},t0={class:"text-3xl lg:text-4xl font-bold text-white"},a0={class:"lg:col-span-4"},n0={class:"bg-white rounded-lg shadow-xl p-6 lg:p-8 max-w-md mx-auto"},o0={key:0,class:"mb-6"},r0={class:"text-center"},l0={class:"text-2xl font-bold text-gray-900"},s0={key:0,class:"text-gray-600 mt-2"},i0={class:"space-y-6"},c0={key:1,class:"mt-6"},d0={key:0,class:"mt-6 text-center"},u0={class:"absolute bottom-4 right-4 text-right"},m0={class:"flex items-end justify-end mb-2"},f0={class:"text-right mr-3"},p0={class:"text-red-500 font-bold text-xs"},g0={class:"text-white text-xs"},v0={class:"text-white/70 text-xs"},h0={class:"w-8 h-8 bg-red-500 rounded flex items-center justify-center text-white font-bold text-xs"},b0={class:"text-white/70 text-xs"},y0={class:"absolute bottom-4 left-4 flex gap-2"},x0=["href"];function k0(t,n,a,o,r,l){const i=e.resolveComponent("router-view"),u=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock("div",{class:"min-h-screen relative flex items-center justify-center",style:e.normalizeStyle({backgroundColor:a.backgroundColor})},[e.createElementVNode("div",{class:"absolute inset-0 bg-cover bg-center",style:e.normalizeStyle({backgroundImage:`url('${a.backgroundImage}')`,opacity:a.backgroundOpacity})},null,4),e.createElementVNode("div",Gv,[e.createElementVNode("div",Kv,[e.createElementVNode("div",Xv,[e.createElementVNode("div",Qv,[e.createElementVNode("div",Jv,[e.createElementVNode("span",{style:e.normalizeStyle({color:a.primaryColor})},e.toDisplayString(a.primaryLogoPrefix),5),e.createElementVNode("span",Zv,e.toDisplayString(a.primaryLogoText),1)]),e.createElementVNode("div",{class:"h-0.5 w-30 mx-auto lg:mx-0",style:e.normalizeStyle({backgroundColor:a.primaryColor})},null,4)]),e.createElementVNode("div",e0,[e.createElementVNode("div",{class:"flex items-center justify-center w-15 h-15 rounded-lg mr-4 text-white font-bold text-xl",style:e.normalizeStyle({backgroundColor:a.primaryColor})},e.toDisplayString(a.secondaryLogoPrefix),5),e.createElementVNode("span",t0,e.toDisplayString(a.secondaryLogoText),1)]),n[0]||(n[0]=e.createElementVNode("div",{class:"max-w-md mx-auto lg:mx-0"},[e.createElementVNode("p",{class:"text-sm lg:text-base font-light text-white/70 italic leading-relaxed"})],-1))]),e.createElementVNode("div",a0,[e.createElementVNode("div",n0,[t.$slots["card-header"]||a.title?(e.openBlock(),e.createElementBlock("div",o0,[e.renderSlot(t.$slots,"card-header",{},()=>[e.createElementVNode("div",r0,[e.createElementVNode("h1",l0,e.toDisplayString(a.title),1),a.subtitle?(e.openBlock(),e.createElementBlock("p",s0,e.toDisplayString(a.subtitle),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",i0,[e.createVNode(i)]),t.$slots["card-footer"]?(e.openBlock(),e.createElementBlock("div",c0,[e.renderSlot(t.$slots,"card-footer")])):e.createCommentVNode("",!0)]),t.$slots.links?(e.openBlock(),e.createElementBlock("div",d0,[e.renderSlot(t.$slots,"links")])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",u0,[e.createElementVNode("div",m0,[e.createElementVNode("div",f0,[e.createElementVNode("div",p0,e.toDisplayString(a.companyName),1),e.createElementVNode("div",g0,e.toDisplayString(a.companyType),1),e.createElementVNode("div",v0,e.toDisplayString(a.companyTagline),1)]),e.createElementVNode("div",h0,e.toDisplayString(a.companyInitials),1)]),e.createElementVNode("div",b0,[e.createElementVNode("div",null,e.toDisplayString(a.appName)+" ("+e.toDisplayString(a.appVersion)+")",1),e.createElementVNode("div",null,e.toDisplayString(a.copyright),1)])]),e.createElementVNode("div",y0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.socialLinks,m=>(e.openBlock(),e.createElementBlock("a",{key:m.name,href:m.url,class:e.normalizeClass(["w-8 h-7 flex items-center justify-center rounded text-xs transition-colors",m.variant==="primary"?"bg-blue-600 hover:bg-blue-700 text-white":m.variant==="info"?"bg-cyan-500 hover:bg-cyan-600 text-white":"bg-gray-600 hover:bg-gray-700 text-white"])},[e.createVNode(u,{icon:["fab",m.icon]},null,8,["icon"])],10,x0))),128))])],4)}const tr=yt(Yv,[["render",k0]]),w0={class:"min-h-screen bg-gray-50"},C0={class:"flex-1"},B0={key:0,class:"bg-white border-b border-gray-200"},V0={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"},S0={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},ar={__name:"DefaultLayout",props:{navigationItems:{type:Array,default:()=>[{label:"Home",href:"/",active:!0},{label:"About",href:"/about"},{label:"Services",href:"/services"},{label:"Contact",href:"/contact"}]},breadcrumbItems:{type:Array,default:()=>[]},showBreadcrumb:{type:Boolean,default:!1}},setup(t){return(n,a)=>{const o=e.resolveComponent("Logo"),r=e.resolveComponent("MainNavigation"),l=e.resolveComponent("Button"),i=e.resolveComponent("Header"),u=e.resolveComponent("Breadcrumb"),m=e.resolveComponent("Text"),p=e.resolveComponent("Footer");return e.openBlock(),e.createElementBlock("div",w0,[e.createVNode(i,null,{logo:e.withCtx(()=>[e.renderSlot(n.$slots,"logo",{},()=>[e.createVNode(o)])]),navigation:e.withCtx(()=>[e.renderSlot(n.$slots,"navigation",{},()=>[e.createVNode(r,{items:t.navigationItems},null,8,["items"])])]),actions:e.withCtx(()=>[e.renderSlot(n.$slots,"header-actions",{},()=>[e.createVNode(l,{variant:"ghost",size:"sm"},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode(" Sign In ",-1)])]),_:1}),e.createVNode(l,{size:"sm"},{default:e.withCtx(()=>[...a[1]||(a[1]=[e.createTextVNode(" Get Started ",-1)])]),_:1})])]),_:3}),e.createElementVNode("main",C0,[t.showBreadcrumb?(e.openBlock(),e.createElementBlock("div",B0,[e.createElementVNode("div",V0,[e.renderSlot(n.$slots,"breadcrumb",{},()=>[e.createVNode(u,{items:t.breadcrumbItems},null,8,["items"])])])])):e.createCommentVNode("",!0),e.createElementVNode("div",S0,[e.renderSlot(n.$slots,"default")])]),e.createVNode(p,null,{brand:e.withCtx(()=>[e.renderSlot(n.$slots,"footer-brand",{},()=>[e.createVNode(o,{class:"mb-4"}),e.createVNode(m,{class:"text-gray-600 max-w-md"},{default:e.withCtx(()=>[...a[2]||(a[2]=[e.createTextVNode(" Your application description goes here. ",-1)])]),_:1})])]),_:3})])}}},E0={name:"ErrorLayout",props:{errorType:{type:[String,Number],default:"404"},errorCode:{type:[String,Number],default:null},errorTitle:{type:String,default:null},errorMessage:{type:String,default:null},brandName:{type:String,default:"Software Technologies"},showLogo:{type:Boolean,default:!0},showBackground:{type:Boolean,default:!0},showDefaultIllustration:{type:Boolean,default:!0},showDefaultActions:{type:Boolean,default:!0},showHomeButton:{type:Boolean,default:!0},showBackButton:{type:Boolean,default:!0},showRetryButton:{type:Boolean,default:!1},showSupportButton:{type:Boolean,default:!1},showAdditionalInfo:{type:Boolean,default:!1},homeUrl:{type:String,default:"/"},homeButtonText:{type:String,default:"Go Home"},backButtonText:{type:String,default:"Go Back"},retryButtonText:{type:String,default:"Try Again"},helpText:{type:String,default:null},supportUrl:{type:String,default:null}},emits:["retry","back","contact-support"],setup(t,{emit:n}){const a=e.getCurrentInstance(),o=e.inject("$router",null)||a?.appContext.app.config.globalProperties?.$router,r=e.ref(!1),l=e.ref(!1),i=e.ref(navigator.onLine),u=e.ref(`err_${Date.now()}_${Math.random().toString(36).substr(2,9)}`),m=e.ref(!1),p=()=>{i.value=navigator.onLine};e.onMounted(()=>{window.addEventListener("online",p),window.addEventListener("offline",p)}),e.onUnmounted(()=>{window.removeEventListener("online",p),window.removeEventListener("offline",p)});const v=e.computed(()=>{const H={404:{title:"Page Not Found",message:"Sorry, we couldn't find the page you're looking for.",icon:"🔍",color:"#64748b",homeButtonIcon:"🏠",additionalInfo:{title:"What can you do?",items:[{icon:"✓",iconColor:"green-500",text:"Check the URL for typos"},{icon:"✓",iconColor:"green-500",text:"Go back to the previous page"},{icon:"✓",iconColor:"green-500",text:"Visit our homepage"}]}},403:{title:"Unauthorized Access",message:"You are not authorized to view this page.",icon:"🚫",color:"#ef4444",homeButtonIcon:"🔐",additionalInfo:{title:"Why am I seeing this?",items:[{icon:"⚠️",iconColor:"yellow-500",text:"You may need to log in to access this page"},{icon:"⚠️",iconColor:"yellow-500",text:"Your account might not have the required permissions"},{icon:"⚠️",iconColor:"yellow-500",text:"Contact support if you believe this is an error"}]}},401:{title:"Authentication Required",message:"You need to log in to access this resource.",icon:"🔐",color:"#f59e0b",homeButtonIcon:"🔐",additionalInfo:{title:"How to proceed?",items:[{icon:"✓",iconColor:"blue-500",text:"Log in with your credentials"},{icon:"✓",iconColor:"blue-500",text:"Create an account if you don't have one"},{icon:"✓",iconColor:"blue-500",text:"Reset your password if you forgot it"}]}},500:{title:"Internal Server Error",message:"Something went wrong on our end. Please try again later.",icon:"🔧",color:"#ef4444",homeButtonIcon:"🏠",additionalInfo:{title:"What happened?",items:[{icon:"⚠️",iconColor:"red-500",text:"Our servers are experiencing issues"},{icon:"⚠️",iconColor:"red-500",text:"The problem is temporary"},{icon:"⚠️",iconColor:"red-500",text:"Try refreshing the page or come back later"}]}},503:{title:"Service Unavailable",message:"The service is temporarily unavailable. Please try again later.",icon:"🔧",color:"#f59e0b",homeButtonIcon:"🏠",additionalInfo:{title:"Service Status",items:[{icon:"⚠️",iconColor:"amber-500",text:"We're performing scheduled maintenance"},{icon:"⚠️",iconColor:"amber-500",text:"Normal service will resume shortly"},{icon:"⚠️",iconColor:"amber-500",text:"Check our status page for updates"}]}},network:{title:"Network Error",message:"Unable to connect to the server. Please check your internet connection.",icon:"📶",color:"#ef4444",homeButtonIcon:"🏠",additionalInfo:{title:"Connection Issues",items:[{icon:"⚠️",iconColor:"red-500",text:"Check your internet connection"},{icon:"⚠️",iconColor:"red-500",text:"Try refreshing the page"},{icon:"⚠️",iconColor:"red-500",text:"Contact your network administrator"}]}}};return H[t.errorType]||H[404]}),h=e.computed(()=>v.value),E=e.computed(()=>t.errorTitle||h.value.title),y=e.computed(()=>t.errorMessage||h.value.message),b=e.computed(()=>h.value.homeButtonIcon||"🏠"),f=e.computed(()=>t.showAdditionalInfo?h.value.additionalInfo:null),d=()=>{o?o.push(t.homeUrl):window.location.href=t.homeUrl},s=()=>{o&&window.history.length>1?o.back():window.history.length>1?window.history.back():d(),n("back")},c=async()=>{r.value=!0;try{await new Promise(H=>setTimeout(H,1e3)),window.location.reload()}catch(H){console.error("Retry failed:",H)}finally{r.value=!1}n("retry")},g=e.computed(()=>["min-h-screen relative flex items-center justify-center","px-4 sm:px-6 lg:px-8"]),S=e.computed(()=>["absolute inset-0 -z-10"]),k=e.computed(()=>["w-full max-w-2xl mx-auto text-center"]),N=e.computed(()=>["mb-8"]),F=e.computed(()=>["space-y-8"]),L=e.computed(()=>["flex justify-center mb-6"]),q=e.computed(()=>["w-32 h-32 flex items-center justify-center"]),w=e.computed(()=>["space-y-4"]),M=e.computed(()=>["text-6xl font-bold text-slate-300 mb-4"]),_=e.computed(()=>["text-3xl font-bold text-slate-900"]),C=e.computed(()=>["text-lg text-slate-600 max-w-lg mx-auto"]),z=e.computed(()=>["mt-8"]),O=e.computed(()=>["mt-8"]),G=e.computed(()=>["mt-6"]);return{isRetrying:r,reportSent:l,isOnline:i,errorId:u,isDev:m,errorConfig:h,title:E,message:y,homeButtonIcon:b,additionalInfoConfig:f,goHome:d,goBack:s,retry:c,layoutClasses:g,backgroundClasses:S,contentClasses:k,headerClasses:N,errorContentClasses:F,illustrationClasses:L,iconContainerClasses:q,detailsClasses:w,codeClasses:M,titleClasses:_,messageClasses:C,actionsClasses:z,additionalInfoClasses:O,helpClasses:G}}},N0={class:"flex justify-center"},$0={class:"flex items-center gap-3"},z0={class:"text-2xl font-bold text-slate-900"},D0={key:1,class:"bg-red-100 border border-red-200 rounded-lg p-4 mx-auto max-w-md mb-6"},T0={class:"flex flex-col sm:flex-row gap-4 justify-center"},A0=["disabled"],F0={key:0,class:"animate-spin"},P0={key:1},M0=["disabled"],L0={key:0},j0={key:1},O0={key:0,class:"mt-8 max-w-md mx-auto"},I0={class:"bg-white rounded-lg border border-slate-200 shadow-sm p-6"},_0={class:"text-lg font-semibold text-slate-900 mb-4"},R0={class:"space-y-3"},U0={class:"text-sm text-slate-600"},q0=["href"],H0={key:5,class:"text-xs text-slate-400 font-mono mt-4"};function W0(t,n,a,o,r,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o.layoutClasses)},[a.showBackground?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.backgroundClasses)},[e.renderSlot(t.$slots,"background",{},()=>[n[4]||(n[4]=e.createElementVNode("div",{class:"absolute inset-0 bg-gradient-to-br from-slate-50 to-slate-100"},null,-1))])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.contentClasses)},[t.$slots.header||a.showLogo?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.headerClasses)},[e.renderSlot(t.$slots,"header",{},()=>[e.createElementVNode("div",N0,[e.renderSlot(t.$slots,"logo",{},()=>[e.createElementVNode("div",$0,[n[5]||(n[5]=e.createElementVNode("div",{class:"w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center"},[e.createElementVNode("span",{class:"text-white font-bold text-lg"},"STL")],-1)),e.createElementVNode("span",z0,e.toDisplayString(a.brandName),1)])])])])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.errorContentClasses)},[t.$slots.illustration||a.showDefaultIllustration?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.illustrationClasses)},[e.renderSlot(t.$slots,"illustration",{},()=>[e.createElementVNode("div",{class:e.normalizeClass(o.iconContainerClasses)},[e.createElementVNode("div",{class:"text-8xl",style:e.normalizeStyle({color:o.errorConfig.color})},e.toDisplayString(o.errorConfig.icon),5)],2)])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.detailsClasses)},[a.errorCode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.codeClasses)},e.toDisplayString(a.errorCode),3)):e.createCommentVNode("",!0),e.createElementVNode("h1",{class:e.normalizeClass(o.titleClasses)},[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)])],2),e.createElementVNode("p",{class:e.normalizeClass(o.messageClasses)},[e.renderSlot(t.$slots,"message",{},()=>[e.createTextVNode(e.toDisplayString(o.message),1)])],2)],2),o.isOnline?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",D0,[...n[6]||(n[6]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-2 text-red-700"},[e.createElementVNode("span",{class:"w-3 h-3 bg-red-500 rounded-full animate-pulse"}),e.createElementVNode("span",{class:"font-medium"},"No Internet Connection")],-1)])])),t.$slots.actions||a.showDefaultActions?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(o.actionsClasses)},[e.renderSlot(t.$slots,"actions",{},()=>[e.createElementVNode("div",T0,[a.showHomeButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"bg-blue-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-blue-700 transition-colors flex items-center justify-center gap-2",onClick:n[0]||(n[0]=(...i)=>o.goHome&&o.goHome(...i))},[e.createElementVNode("span",null,e.toDisplayString(o.homeButtonIcon),1),e.createTextVNode(" "+e.toDisplayString(a.homeButtonText),1)])):e.createCommentVNode("",!0),a.showBackButton?(e.openBlock(),e.createElementBlock("button",{key:1,class:"border border-slate-300 text-slate-700 px-6 py-3 rounded-lg font-medium hover:bg-slate-50 transition-colors flex items-center justify-center gap-2",onClick:n[1]||(n[1]=(...i)=>o.goBack&&o.goBack(...i))},[n[7]||(n[7]=e.createElementVNode("span",null,"←",-1)),e.createTextVNode(" "+e.toDisplayString(a.backButtonText),1)])):e.createCommentVNode("",!0),a.showRetryButton?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:o.isRetrying||!o.isOnline,class:"border border-slate-300 text-slate-700 px-6 py-3 rounded-lg font-medium hover:bg-slate-50 transition-colors flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",onClick:n[2]||(n[2]=(...i)=>o.retry&&o.retry(...i))},[o.isRetrying?(e.openBlock(),e.createElementBlock("span",F0,"↻")):(e.openBlock(),e.createElementBlock("span",P0,"🔄")),e.createTextVNode(" "+e.toDisplayString(o.isRetrying?"Retrying...":a.retryButtonText),1)],8,A0)):e.createCommentVNode("",!0),a.showSupportButton?(e.openBlock(),e.createElementBlock("button",{key:3,disabled:o.reportSent,class:"bg-slate-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-slate-700 transition-colors flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",onClick:n[3]||(n[3]=i=>t.$emit("contact-support"))},[o.reportSent?(e.openBlock(),e.createElementBlock("span",L0,"✓")):(e.openBlock(),e.createElementBlock("span",j0,"📝")),e.createTextVNode(" "+e.toDisplayString(o.reportSent?"Report Sent":"Contact Support"),1)],8,M0)):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),t.$slots["additional-info"]||a.showAdditionalInfo?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(o.additionalInfoClasses)},[e.renderSlot(t.$slots,"additional-info",{},()=>[o.additionalInfoConfig?(e.openBlock(),e.createElementBlock("div",O0,[e.createElementVNode("div",I0,[e.createElementVNode("h3",_0,e.toDisplayString(o.additionalInfoConfig.title),1),e.createElementVNode("ul",R0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.additionalInfoConfig.items,(i,u)=>(e.openBlock(),e.createElementBlock("li",{key:u,class:"flex items-start gap-3 text-sm text-slate-600"},[e.createElementVNode("span",{class:e.normalizeClass(`w-4 h-4 text-${i.iconColor||"slate-400"} flex-shrink-0 mt-0.5`)},e.toDisplayString(i.icon),3),e.createElementVNode("span",null,e.toDisplayString(i.text),1)]))),128))])])])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0),t.$slots.help||a.helpText?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(o.helpClasses)},[e.renderSlot(t.$slots,"help",{},()=>[e.createElementVNode("p",U0,[e.createTextVNode(e.toDisplayString(a.helpText)+" ",1),a.supportUrl?(e.openBlock(),e.createElementBlock("a",{key:0,href:a.supportUrl,class:"text-blue-600 hover:text-blue-700 underline ml-1"},[...n[8]||(n[8]=[e.createElementVNode("span",{class:"inline-block w-4 h-4 mr-1"},"❓",-1),e.createTextVNode(" Get Help ",-1)])],8,q0)):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),o.isDev?(e.openBlock(),e.createElementBlock("div",H0," Error ID: "+e.toDisplayString(o.errorId),1)):e.createCommentVNode("",!0)],2)],2)],2)}const nr=yt(E0,[["render",W0]]),Xt={mounted(t,n){if(!n.value)return;const a=Object.keys(n.modifiers)[0]||"top",o=document.createElement("div");o.textContent=n.value,o.className="tooltip-custom",o.style.cssText=`
|
|
607
|
+
`},a=t,o=e.ref(!1),r=()=>o.value=!o.value,l=T.cva("",{variants:{variant:{default:"",bordered:"border border-slate-200 rounded-lg overflow-hidden",filled:"bg-slate-50 border border-slate-200 rounded-lg overflow-hidden",flush:""}}}),i=T.cva("flex items-center justify-between w-full text-left transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",{variants:{size:{sm:"p-3 text-sm",md:"p-4 text-base",lg:"p-6 text-lg"}}}),u=T.cva("overflow-hidden text-slate-600 border-t border-slate-200",{variants:{size:{sm:"p-3 text-sm",md:"p-4 text-base",lg:"p-6 text-lg"}}}),m=e.computed(()=>x(l({variant:a.variant}))),p=e.computed(()=>x(i({size:a.size}))),v=e.computed(()=>x(u({size:a.size})));return(h,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(m.value)},[e.createVNode(J,{class:e.normalizeClass(p.value),"aria-expanded":o.value,onClick:r},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"header",{isOpen:o.value}),e.createVNode(n,{class:e.normalizeClass(e.unref(x)("w-5 h-5 transition-transform ml-2",{"rotate-180":o.value}))},null,8,["class"])]),_:3},8,["class","aria-expanded"]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-96","leave-active-class":"transition-all duration-200 ease-in","leave-from-class":"opacity-100 max-h-96","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(v.value)},[e.renderSlot(h.$slots,"content",{isOpen:o.value})],2)):e.createCommentVNode("",!0)]),_:3})],2))}},Du={class:"relative w-full"},Tu={class:"relative"},Au=["id","value","disabled","placeholder","required","aria-describedby"],Fu={class:"flex items-center justify-between mb-3"},Pu={class:"text-sm font-medium"},Mu={class:"grid grid-cols-7 gap-1 mb-2"},Lu={class:"grid grid-cols-7 gap-1"},ju=["disabled","onClick"],Ou={key:0,class:"mt-4 pt-3 border-t border-slate-200"},Lo={__name:"Calendar",props:{id:String,modelValue:[String,Date],disabled:Boolean,required:Boolean,min:[String,Date],max:[String,Date],placeholder:{type:String,default:"Select date"},format:{type:String,default:"MM/DD/YYYY"},clearable:{type:Boolean,default:!0},showToday:{type:Boolean,default:!0},calendarPosition:{type:String,default:"left-0"},ariaDescribedby:String},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=new Date,i=e.ref(l.getMonth()),u=e.ref(l.getFullYear()),m=e.ref(null),p=["Su","Mo","Tu","We","Th","Fr","Sa"],v=e.computed(()=>new Date(u.value,i.value).toLocaleString("default",{month:"long"})),h=e.computed(()=>new Date(u.value,i.value+1,0).getDate()),E=e.computed(()=>new Date(u.value,i.value,1).getDay()),y=e.computed(()=>{const _=new Date(u.value,i.value,0).getDate(),C=E.value;return Array.from({length:C},(z,O)=>_-C+O+1)}),b=e.computed(()=>{const _=y.value.length+h.value,C=_%7===0?0:7-_%7;return Array.from({length:C},(z,O)=>O+1)}),f=e.computed(()=>m.value?d(m.value):"");function d(_){if(!_)return"";const C=new Date(_),z=String(C.getMonth()+1).padStart(2,"0"),O=String(C.getDate()).padStart(2,"0"),G=C.getFullYear();return a.format.replace("MM",z).replace("DD",O).replace("YYYY",G)}function s(_){if(!_)return null;if(_ instanceof Date)return _;const C=new Date(_);return isNaN(C.getTime())?null:C}function c(_){if(!m.value)return!1;const C=new Date(m.value);return C.getDate()===_&&C.getMonth()===i.value&&C.getFullYear()===u.value}function g(_){const C=new Date(u.value,i.value,_);if(a.min){const z=s(a.min);if(z&&C<z)return!0}if(a.max){const z=s(a.max);if(z&&C>z)return!0}return!1}function S(){a.disabled||(r.value=!r.value)}function k(){r.value=!1}function N(){i.value===0?(i.value=11,u.value--):i.value--}function F(){i.value===11?(i.value=0,u.value++):i.value++}function L(_){if(g(_))return;const C=new Date(u.value,i.value,_);m.value=C,o("update:modelValue",C.toISOString().split("T")[0]),r.value=!1}function q(){i.value=l.getMonth(),u.value=l.getFullYear(),L(l.getDate())}function w(){m.value=null,o("update:modelValue","")}e.watch(()=>a.modelValue,_=>{if(_){const C=s(_);C&&(m.value=C,i.value=C.getMonth(),u.value=C.getFullYear())}else m.value=null},{immediate:!0});function M(_){_.key==="Escape"&&r.value&&k()}return e.onMounted(()=>{document.addEventListener("keydown",M)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",M)}),(_,C)=>(e.openBlock(),e.createElementBlock("div",Du,[e.createElementVNode("div",Tu,[e.createElementVNode("input",{id:t.id,type:"text",value:f.value,readonly:"",disabled:t.disabled,placeholder:t.placeholder,required:t.required,"aria-describedby":t.ariaDescribedby,class:"w-full px-3 py-2 pr-10 border border-slate-300 rounded-md bg-white text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 cursor-pointer disabled:bg-slate-50 disabled:text-slate-500 disabled:cursor-not-allowed",onClick:S},null,8,Au),C[2]||(C[2]=e.createElementVNode("div",{class:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"},[e.createElementVNode("svg",{class:"w-5 h-5 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1)),t.clearable&&f.value&&!t.disabled?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute right-9 top-1/2 -translate-y-1/2 p-1 hover:bg-slate-100 rounded","aria-label":"Clear date",onClick:e.withModifiers(w,["stop"])},[...C[1]||(C[1]=[e.createElementVNode("svg",{class:"w-4 h-4 text-slate-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute z-[99999] mt-2 bg-white border border-slate-200 rounded-lg shadow-lg p-4",t.calendarPosition]),onClick:C[0]||(C[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Fu,[e.createElementVNode("button",{type:"button",class:"p-1 hover:bg-gray-100 rounded","aria-label":"Previous Month",onClick:N},[...C[3]||(C[3]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 18l-6-6 6-6"})],-1)])]),e.createElementVNode("div",Pu,e.toDisplayString(v.value)+" "+e.toDisplayString(u.value),1),e.createElementVNode("button",{type:"button",class:"p-1 hover:bg-gray-100 rounded","aria-label":"Next Month",onClick:F},[...C[4]||(C[4]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 18l6-6-6-6"})],-1)])])]),e.createElementVNode("div",Mu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(p,z=>e.createElementVNode("div",{key:z,class:"text-center text-xs font-medium text-slate-600 py-1"},e.toDisplayString(z),1)),64))]),e.createElementVNode("div",Lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(z,O)=>(e.openBlock(),e.createElementBlock("div",{key:"prev-"+O,class:"text-center text-sm text-slate-300 py-2"},e.toDisplayString(z),1))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z,type:"button",disabled:g(z),class:e.normalizeClass(["w-8 h-8 text-sm rounded flex items-center justify-center",c(z)?"bg-blue-500 text-white":"hover:bg-gray-100",g(z)?"text-gray-300 cursor-not-allowed":""]),onClick:O=>L(z)},e.toDisplayString(z),11,ju))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(z,O)=>(e.openBlock(),e.createElementBlock("div",{key:"next-"+O,class:"text-center text-sm text-slate-300 py-2"},e.toDisplayString(z),1))),128))]),t.showToday?(e.openBlock(),e.createElementBlock("div",Ou,[e.createElementVNode("button",{type:"button",class:"w-full px-3 py-2 text-sm font-medium text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",onClick:q}," Today ")])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:1}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-[99998]",onClick:k})):e.createCommentVNode("",!0)]))}},Iu={class:"flex items-start justify-between"},_u={class:"flex-1 min-w-0"},Ru={key:0,class:"flex-shrink-0 ml-4"},Uu="text-lg font-semibold text-slate-900 truncate",qu="text-sm text-slate-600 mt-1",jo={__name:"Graph",props:{variant:{type:String,default:"default",validator:t=>["default","outlined","elevated","filled"].includes(t)},padding:{type:String,default:"md",validator:t=>["none","sm","md","lg","xl"].includes(t)},title:String,description:String},setup(t){const n=T.cva("rounded-lg overflow-hidden transition-all duration-200",{variants:{variant:{default:"bg-white border border-slate-200",outlined:"bg-white border-2 border-slate-300",elevated:"bg-white shadow-lg border border-slate-100",filled:"bg-slate-50 border border-slate-200"},padding:{none:"",sm:"p-3",md:"p-4",lg:"p-6",xl:"p-8"}},defaultVariants:{variant:"default",padding:"md"}}),a=T.cva("border-b border-slate-100 last:border-b-0",{variants:{padding:{none:"p-4 pb-0",sm:"px-3 pt-3",md:"px-4 pt-4",lg:"px-6 pt-6",xl:"px-8 pt-8"}}}),o=T.cva("border-b border-slate-100",{variants:{padding:{none:"p-4 pb-0",sm:"px-3 py-3",md:"px-4 py-4",lg:"px-6 py-6",xl:"px-8 py-8"}}}),r=T.cva("",{variants:{padding:{none:"p-4",sm:"p-3",md:"p-4",lg:"p-6",xl:"p-8"}}}),l=T.cva("border-t border-slate-100 bg-slate-50/50",{variants:{padding:{none:"p-4 pt-0",sm:"px-3 pb-3",md:"px-4 pb-4",lg:"px-6 pb-6",xl:"px-8 pb-8"}}}),i=T.cva("border-t border-slate-100 bg-slate-50/50",{variants:{padding:{none:"p-4 pt-0",sm:"px-3 pb-3",md:"px-4 pb-4",lg:"px-6 pb-6",xl:"px-8 pb-8"}}});return(u,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(x)(e.unref(n)({variant:t.variant,padding:t.padding})))},[u.$slots.header||t.title||t.description?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(x)(e.unref(a)({padding:t.padding})))},[e.renderSlot(u.$slots,"header",{},()=>[e.createElementVNode("div",Iu,[e.createElementVNode("div",_u,[t.title?(e.openBlock(),e.createElementBlock("h3",{key:0,class:e.normalizeClass(Uu)},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(qu)},e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),u.$slots.actions?(e.openBlock(),e.createElementBlock("div",Ru,[e.renderSlot(u.$slots,"actions")])):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),u.$slots.filters?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(x)(e.unref(o)({padding:t.padding})))},[e.renderSlot(u.$slots,"filters")],2)):e.createCommentVNode("",!0),u.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(x)(e.unref(r)({padding:t.padding})))},[e.renderSlot(u.$slots,"default")],2)):e.createCommentVNode("",!0),u.$slots.legend?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(e.unref(x)(e.unref(l)({padding:t.padding})))},[e.renderSlot(u.$slots,"legend")],2)):e.createCommentVNode("",!0),u.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(e.unref(x)(e.unref(i)({padding:t.padding})))},[e.renderSlot(u.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}},Hu={class:"w-full h-full"},Wu=["width","height","viewBox"],Yu={key:0},Gu=["x1","y1","x2","y2","stroke"],Ku=["x","y","width","height","fill","onMouseenter"],Xu={key:1},Qu=["x","y"],Ju={key:2},Zu=["x","y"],em={key:3},tm=["x","y","width","height","fill","stroke"],am=["x","y"],Oo={__name:"BarChart",props:{data:{type:Array,required:!0},labels:{type:Array,default:()=>[]},colors:{type:Array,default:()=>["#3b82f6","#ef4444","#10b981","#f59e0b","#8b5cf6"]},width:{type:Number,default:400},height:{type:Number,default:300},padding:{type:Object,default:()=>({top:20,right:20,bottom:60,left:60})},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},gridColor:{type:String,default:"#e5e7eb"},barClasses:{type:String,default:"transition-all duration-200 hover:opacity-80 cursor-pointer"},axisLabelClasses:{type:String,default:"fill-slate-600 text-xs font-medium"},tooltipBackground:{type:String,default:"#1f2937"},tooltipBorder:{type:String,default:"#374151"},tooltipTextClasses:{type:String,default:"fill-white text-xs font-medium"},maxValue:{type:Number,default:null}},emits:["bar-click","bar-hover"],setup(t,{emit:n}){const a=t,o=n,r=e.ref({visible:!1,x:0,y:0,width:0,height:0,content:""}),l=e.computed(()=>a.maxValue||Math.max(...a.data)),i=e.computed(()=>(a.width-a.padding.left-a.padding.right)/a.data.length*.8),u=e.computed(()=>(a.width-a.padding.left-a.padding.right)/a.data.length*.2),m=e.computed(()=>{const d=[],s=a.height-a.padding.top-a.padding.bottom,c=5;for(let g=0;g<=c;g++){const S=a.padding.top+s/c*g;d.push(S)}return d}),p=d=>a.padding.left+d*(i.value+u.value)+u.value/2,v=d=>{const s=a.height-a.padding.top-a.padding.bottom,c=s/l.value;return a.padding.top+s-d*c},h=d=>{const c=(a.height-a.padding.top-a.padding.bottom)/l.value;return d*c},E=d=>a.colors[d%a.colors.length],y=d=>{const s=a.height-a.padding.top-a.padding.bottom,c=(a.height-a.padding.bottom-d)/s*l.value;return Math.round(c)},b=(d,s,c)=>{const g=d.target.getBoundingClientRect(),S=a.labels[c]||`Item ${c+1}`;r.value={visible:!0,x:g.left+g.width/2,y:g.top,width:80,height:24,content:`${S}: ${s}`},o("bar-hover",{value:s,index:c,label:S})},f=()=>{r.value.visible=!1};return(d,s)=>(e.openBlock(),e.createElementBlock("div",Hu,[(e.openBlock(),e.createElementBlock("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,class:"overflow-visible"},[t.showGrid?(e.openBlock(),e.createElementBlock("g",Yu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,c=>(e.openBlock(),e.createElementBlock("line",{key:`grid-${c}`,x1:t.padding.left,y1:c,x2:t.width-t.padding.right,y2:c,stroke:t.gridColor,"stroke-width":"1","stroke-dasharray":"2,2"},null,8,Gu))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(c,g)=>(e.openBlock(),e.createElementBlock("rect",{key:`bar-${g}`,x:p(g),y:v(c),width:i.value,height:h(c),fill:E(g),class:e.normalizeClass(t.barClasses),onMouseenter:S=>b(S,c,g),onMouseleave:f},null,42,Ku))),128))]),t.showXAxis?(e.openBlock(),e.createElementBlock("g",Xu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.labels,(c,g)=>(e.openBlock(),e.createElementBlock("text",{key:`xlabel-${g}`,x:p(g)+i.value/2,y:t.height-t.padding.bottom+20,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"middle"},e.toDisplayString(c),11,Qu))),128))])):e.createCommentVNode("",!0),t.showYAxis?(e.openBlock(),e.createElementBlock("g",Ju,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,c=>(e.openBlock(),e.createElementBlock("text",{key:`ylabel-${c}`,x:t.padding.left-10,y:c+4,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"end"},e.toDisplayString(y(c)),11,Zu))),128))])):e.createCommentVNode("",!0),r.value.visible?(e.openBlock(),e.createElementBlock("g",em,[e.createElementVNode("rect",{x:r.value.x-r.value.width/2,y:r.value.y-r.value.height-10,width:r.value.width,height:r.value.height,fill:t.tooltipBackground,stroke:t.tooltipBorder,"stroke-width":"1",rx:"4"},null,8,tm),e.createElementVNode("text",{x:r.value.x,y:r.value.y-r.value.height/2-2,class:e.normalizeClass(t.tooltipTextClasses),"text-anchor":"middle"},e.toDisplayString(r.value.content),11,am)])):e.createCommentVNode("",!0)],8,Wu))]))}},nm={class:"w-full h-full"},om=["width","height","viewBox"],rm={key:0},lm=["x1","y1","x2","y2","stroke"],sm=["d","stroke","stroke-width"],im={key:1},cm=["cx","cy","r","fill","stroke","onMouseenter"],dm=["d","fill","fill-opacity"],um={key:3},mm=["x","y"],fm={key:4},pm=["x","y"],gm={key:5},vm=["x","y","width","height","fill","stroke"],hm=["x","y"],Io={__name:"LineChart",props:{data:{type:Array,required:!0},labels:{type:Array,default:()=>[]},width:{type:Number||String,default:400},height:{type:Number,default:300},padding:{type:Object,default:()=>({top:20,right:20,bottom:60,left:60})},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},showPoints:{type:Boolean,default:!0},fillArea:{type:Boolean,default:!1},gridColor:{type:String,default:"#e5e7eb"},lineColor:{type:String,default:"#3b82f6"},strokeWidth:{type:Number,default:2},pointRadius:{type:Number,default:4},pointColor:{type:String,default:"#ffffff"},fillColor:{type:String,default:"#3b82f6"},fillOpacity:{type:Number,default:.1},lineClasses:{type:String,default:"transition-all duration-200"},pointClasses:{type:String,default:"transition-all duration-200 hover:r-6 cursor-pointer"},axisLabelClasses:{type:String,default:"fill-slate-600 text-xs font-medium"},tooltipBackground:{type:String,default:"#1f2937"},tooltipBorder:{type:String,default:"#374151"},tooltipTextClasses:{type:String,default:"fill-white text-xs font-medium"},maxValue:{type:Number,default:null}},emits:["point-click","point-hover"],setup(t,{emit:n}){const a=t,o=n,r=e.ref({visible:!1,x:0,y:0,width:0,height:0,content:""}),l=e.computed(()=>a.maxValue||Math.max(...a.data)),i=e.computed(()=>a.data.map((f,d)=>({x:v(d),y:h(f),value:f}))),u=e.computed(()=>i.value.length===0?"":i.value.map((d,s)=>`${s===0?"M":"L"} ${d.x} ${d.y}`).join(" ")),m=e.computed(()=>{if(i.value.length===0)return"";const f=i.value.map((c,g)=>`${g===0?"M":"L"} ${c.x} ${c.y}`).join(" "),d=a.height-a.padding.bottom,s=`L ${i.value[i.value.length-1].x} ${d} L ${i.value[0].x} ${d} Z`;return f+" "+s}),p=e.computed(()=>{const f=[],d=a.height-a.padding.top-a.padding.bottom,s=5;for(let c=0;c<=s;c++){const g=a.padding.top+d/s*c;f.push(g)}return f}),v=f=>{const s=(a.width-a.padding.left-a.padding.right)/(a.data.length-1||1);return a.padding.left+f*s},h=f=>{const d=a.height-a.padding.top-a.padding.bottom,s=d/l.value;return a.padding.top+d-f*s},E=f=>{const d=a.height-a.padding.top-a.padding.bottom,s=(a.height-a.padding.bottom-f)/d*l.value;return Math.round(s)},y=(f,d,s)=>{const c=f.target.getBoundingClientRect(),g=a.labels[s]||`Point ${s+1}`;r.value={visible:!0,x:c.left+c.width/2,y:c.top,width:80,height:24,content:`${g}: ${d}`},o("point-hover",{value:d,index:s,label:g})},b=()=>{r.value.visible=!1};return(f,d)=>(e.openBlock(),e.createElementBlock("div",nm,[(e.openBlock(),e.createElementBlock("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,class:"overflow-visible"},[t.showGrid?(e.openBlock(),e.createElementBlock("g",rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,s=>(e.openBlock(),e.createElementBlock("line",{key:`grid-${s}`,x1:t.padding.left,y1:s,x2:t.width-t.padding.right,y2:s,stroke:t.gridColor,"stroke-width":"1","stroke-dasharray":"2,2"},null,8,lm))),128))])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:u.value,stroke:t.lineColor,"stroke-width":t.strokeWidth,fill:"none",class:e.normalizeClass(t.lineClasses)},null,10,sm),t.showPoints?(e.openBlock(),e.createElementBlock("g",im,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(s,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:s.x,cy:s.y,r:t.pointRadius,fill:t.pointColor,stroke:t.lineColor,"stroke-width":2,class:e.normalizeClass(t.pointClasses),onMouseenter:g=>y(g,s.value,c),onMouseleave:b},null,42,cm))),128))])):e.createCommentVNode("",!0),t.fillArea?(e.openBlock(),e.createElementBlock("path",{key:2,d:m.value,fill:t.fillColor,"fill-opacity":t.fillOpacity},null,8,dm)):e.createCommentVNode("",!0),t.showXAxis?(e.openBlock(),e.createElementBlock("g",um,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.labels,(s,c)=>(e.openBlock(),e.createElementBlock("text",{key:`xlabel-${c}`,x:v(c),y:t.height-t.padding.bottom+20,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"middle"},e.toDisplayString(s),11,mm))),128))])):e.createCommentVNode("",!0),t.showYAxis?(e.openBlock(),e.createElementBlock("g",fm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,s=>(e.openBlock(),e.createElementBlock("text",{key:`ylabel-${s}`,x:t.padding.left-10,y:s+4,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"end"},e.toDisplayString(E(s)),11,pm))),128))])):e.createCommentVNode("",!0),r.value.visible?(e.openBlock(),e.createElementBlock("g",gm,[e.createElementVNode("rect",{x:r.value.x-r.value.width/2,y:r.value.y-r.value.height-10,width:r.value.width,height:r.value.height,fill:t.tooltipBackground,stroke:t.tooltipBorder,"stroke-width":"1",rx:"4"},null,8,vm),e.createElementVNode("text",{x:r.value.x,y:r.value.y-r.value.height/2-2,class:e.normalizeClass(t.tooltipTextClasses),"text-anchor":"middle"},e.toDisplayString(r.value.content),11,hm)])):e.createCommentVNode("",!0)],8,om))]))}},bm={class:"bg-white border-b border-gray-200"},ym={key:0,class:"flex items-center gap-3 min-w-64"},xm={class:"relative flex-1"},km={class:"relative flex-1"},wm={key:1,class:"min-w-40"},Cm={class:"relative"},Bm={key:2,class:"min-w-40"},Vm={class:"relative"},Sm=["value"],Em={key:3,class:"flex items-center gap-2"},Nm={class:"flex items-center gap-3 ml-auto"},$m={class:"flex items-center gap-3 flex-wrap"},zm=["onClick"],_o={__name:"GraphFilters",props:{showDateFilter:{type:Boolean,default:!0},showChartTypeFilter:{type:Boolean,default:!0},showExport:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!0},dataSources:{type:Array,default:()=>[]},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:dateFrom","update:dateTo","update:chartType","update:dataSource","export","refresh","clear-filters"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),l=e.ref(""),i=e.ref("bar"),u=e.ref(""),m=T.cva("flex flex-wrap items-center gap-4",{variants:{variant:{default:"bg-white",minimal:"bg-transparent",bordered:"bg-gray-50"},padding:{compact:"px-4 py-3",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),p=e.computed(()=>r.value||l.value||u.value),v=e.computed(()=>{const q=[];if(r.value||l.value){let w="";r.value&&l.value?w=`${r.value} to ${l.value}`:r.value?w=`From ${r.value}`:l.value&&(w=`Until ${l.value}`),w&&q.push({key:"date",label:"Date Range",value:w,icon:"calendar"})}if(u.value){const w=a.dataSources.find(M=>M.value===u.value);q.push({key:"dataSource",label:"Data Source",value:w?.label||u.value,icon:"database"})}return q}),h=e.computed(()=>x(m({variant:a.variant,padding:a.padding}))),E=e.computed(()=>"w-full pl-10 pr-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm"),y=e.computed(()=>"w-full pr-8 appearance-none border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm py-2 pl-3"),b=e.computed(()=>"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 bg-white px-3 py-2 rounded-lg text-sm font-medium transition-all"),f=e.computed(()=>"text-white bg-blue-600 hover:bg-blue-700 border border-blue-600 px-3 py-2 rounded-lg text-sm font-medium transition-all"),d=e.computed(()=>"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 bg-white px-3 py-2 rounded-lg text-sm font-medium transition-all"),s=e.computed(()=>"px-6 py-3 bg-blue-50 border-t border-blue-100"),c=e.computed(()=>"text-sm font-semibold text-blue-800"),g=e.computed(()=>"flex items-center gap-1.5 bg-white border border-blue-200 text-blue-800 px-3 py-1.5 rounded-full text-sm font-medium"),S=e.computed(()=>"text-blue-600 hover:text-blue-800 ml-1 hover:bg-blue-100 rounded-full p-0.5 transition-all"),k=q=>{i.value=q.target.value,o("update:chartType",q.target.value)},N=q=>{u.value=q.target.value,o("update:dataSource",q.target.value)},F=()=>{r.value="",l.value="",u.value="",o("clear-filters")},L=q=>{switch(q){case"date":r.value="",l.value="";break;case"dataSource":u.value="";break}};return e.watch(()=>r.value,q=>{o("update:dateFrom",q)}),e.watch(()=>l.value,q=>{o("update:dateTo",q)}),(q,w)=>(e.openBlock(),e.createElementBlock("div",bm,[e.createElementVNode("div",{class:e.normalizeClass(h.value)},[t.showDateFilter?(e.openBlock(),e.createElementBlock("div",ym,[e.createElementVNode("div",xm,[e.createVNode(I,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":w[0]||(w[0]=M=>r.value=M),type:"date",class:e.normalizeClass(E.value),placeholder:"From date"},null,2),[[e.vModelText,r.value]])]),w[6]||(w[6]=e.createElementVNode("span",{class:"text-gray-500 text-sm"},"to",-1)),e.createElementVNode("div",km,[e.createVNode(I,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":w[1]||(w[1]=M=>l.value=M),type:"date",class:e.normalizeClass(E.value),placeholder:"To date"},null,2),[[e.vModelText,l.value]])])])):e.createCommentVNode("",!0),t.showChartTypeFilter?(e.openBlock(),e.createElementBlock("div",wm,[e.createElementVNode("div",Cm,[e.createVNode(se,{modelValue:i.value,"onUpdate:modelValue":w[2]||(w[2]=M=>i.value=M),class:e.normalizeClass(y.value),onChange:k},{default:e.withCtx(()=>[...w[7]||(w[7]=[e.createElementVNode("option",{value:"bar"}," Bar Chart ",-1),e.createElementVNode("option",{value:"line"}," Line Chart ",-1),e.createElementVNode("option",{value:"pie"}," Pie Chart ",-1)])]),_:1},8,["modelValue","class"]),e.createVNode(I,{icon:"chart-bar",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),t.dataSources.length>0?(e.openBlock(),e.createElementBlock("div",Bm,[e.createElementVNode("div",Vm,[e.createVNode(se,{modelValue:u.value,"onUpdate:modelValue":w[3]||(w[3]=M=>u.value=M),class:e.normalizeClass(y.value),onChange:N},{default:e.withCtx(()=>[w[8]||(w[8]=e.createElementVNode("option",{value:""}," All Sources ",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataSources,M=>(e.openBlock(),e.createElementBlock("option",{key:M.value,value:M.value},e.toDisplayString(M.label),9,Sm))),128))]),_:1},8,["modelValue","class"]),e.createVNode(I,{icon:"database",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),q.$slots.filters?(e.openBlock(),e.createElementBlock("div",Em,[e.renderSlot(q.$slots,"filters")])):e.createCommentVNode("",!0),e.createElementVNode("div",Nm,[p.value?(e.openBlock(),e.createBlock(J,{key:0,class:e.normalizeClass(b.value),onClick:F},{default:e.withCtx(()=>[e.createVNode(I,{icon:"rotate-left",class:"w-4 h-4 mr-2"}),w[9]||(w[9]=e.createTextVNode(" Clear Filters ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showExport?(e.openBlock(),e.createBlock(J,{key:1,class:e.normalizeClass(f.value),onClick:w[4]||(w[4]=M=>q.$emit("export"))},{default:e.withCtx(()=>[e.createVNode(I,{icon:"download",class:"w-4 h-4 mr-2"}),w[10]||(w[10]=e.createTextVNode(" Export ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showRefresh?(e.openBlock(),e.createBlock(J,{key:2,class:e.normalizeClass(d.value),onClick:w[5]||(w[5]=M=>q.$emit("refresh"))},{default:e.withCtx(()=>[e.createVNode(I,{icon:"sync",class:"w-4 h-4 mr-2"}),w[11]||(w[11]=e.createTextVNode(" Refresh ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0)])],2),v.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(s.value)},[e.createElementVNode("div",$m,[e.createElementVNode("span",{class:e.normalizeClass(c.value)},"Active filters:",2),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,M=>(e.openBlock(),e.createElementBlock("div",{key:M.key,class:e.normalizeClass(g.value)},[e.createVNode(I,{icon:M.icon,class:"w-3 h-3"},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(M.label)+": "+e.toDisplayString(M.value),1),e.createElementVNode("button",{class:e.normalizeClass(S.value),onClick:_=>L(M.key)},[e.createVNode(I,{icon:"xmark",class:"w-3 h-3"})],10,zm)],2))),128))])],2)):e.createCommentVNode("",!0)]))}},Dm={class:"flex items-start justify-between"},Tm={key:0,class:"flex items-center gap-2"},ga={__name:"DataTableHeader",props:{title:{type:String,default:null},description:{type:String,default:null},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},setup(t){const n=t,a=T.cva("border-b border-slate-200",{variants:{variant:{default:"bg-white",minimal:"bg-transparent border-none",bordered:"bg-slate-50 border-2"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),o=T.cva("font-semibold text-slate-900",{variants:{size:{sm:"text-base",md:"text-lg",lg:"text-xl"}},defaultVariants:{size:"md"}}),r=T.cva("text-slate-600 mt-1",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),l=e.computed(()=>x(a({variant:n.variant,padding:n.padding}))),i=e.computed(()=>x(o({size:"md"}))),u=e.computed(()=>x(r({size:"md"})));return(m,p)=>t.title||t.description||m.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(l.value)},[e.renderSlot(m.$slots,"header",{},()=>[e.createElementVNode("div",Dm,[e.createElementVNode("div",null,[t.title?(e.openBlock(),e.createBlock(it,{key:0,class:e.normalizeClass(i.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1},8,["class"])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createBlock(it,{key:1,class:e.normalizeClass(u.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1},8,["class"])):e.createCommentVNode("",!0)]),m.$slots.filters?(e.openBlock(),e.createElementBlock("div",Tm,[e.renderSlot(m.$slots,"filters")])):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0)}},Am={class:"flex items-center justify-between"},Fm={key:0,class:"text-sm text-slate-600"},Pm={key:1,class:"text-sm text-slate-600"},Mm={key:2,class:"flex items-center gap-4"},Lm={key:3,class:"flex items-center gap-4"},jm={class:"flex items-center gap-2"},Om={class:"flex items-center gap-1"},Im=["disabled"],_m=["disabled"],Rm={class:"flex items-center gap-1"},Um=["onClick"],qm=["disabled"],Hm=["disabled"],Wm={class:"text-sm text-slate-600 ml-4"},va={__name:"DataTablePagination",props:{currentPage:{type:Number,required:!0},totalPages:{type:Number,required:!0},total:{type:Number,required:!0},pageSize:{type:Number,required:!0},showPagination:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},selectedCount:{type:Number,default:0},pageSizeOptions:{type:Array,default:()=>[5,10,25,50,100]},maxVisiblePages:{type:Number,default:7},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:currentPage","update:pageSize"],setup(t){const n=t,a=T.cva("border-t border-slate-200",{variants:{variant:{default:"bg-slate-50",minimal:"bg-transparent border-slate-100",bordered:"bg-slate-100 border-t-2 border-slate-300"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),o=T.cva("text-sm font-medium border rounded-md transition-colors duration-200",{variants:{state:{active:"bg-blue-600 text-white border-blue-600",inactive:"bg-white text-slate-700 border-slate-300 hover:bg-slate-50",disabled:"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed"},size:{sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"}},defaultVariants:{state:"inactive",size:"md"}}),r=T.cva("text-slate-700",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{size:"md"}}),l=T.cva("border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm min-w-[60px] focus:border-transparent",{variants:{size:{sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"}},defaultVariants:{size:"sm"}}),i=e.computed(()=>(n.currentPage-1)*n.pageSize+1),u=e.computed(()=>Math.min(n.currentPage*n.pageSize,n.total)),m=e.computed(()=>{const y=[],b=n.totalPages,f=n.currentPage,d=n.maxVisiblePages;if(b<=d)for(let s=1;s<=b;s++)y.push(s);else{const s=Math.floor(d/2);let c=Math.max(1,f-s),g=Math.min(b,c+d-1);g-c+1<d&&(c=Math.max(1,g-d+1));for(let S=c;S<=g;S++)y.push(S)}return y}),p=e.computed(()=>x(a({variant:n.variant,padding:n.padding}))),v=e.computed(()=>x(r({size:"md"}))),h=e.computed(()=>x(l({size:"sm"}))),E=(y,b)=>{let f="inactive";return b?f="disabled":y&&(f="active"),x(o({state:f,size:"md"}))};return(y,b)=>t.showPagination||y.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(p.value)},[e.createElementVNode("div",Am,[t.selectable&&t.selectedCount>0?(e.openBlock(),e.createElementBlock("div",Fm,e.toDisplayString(t.selectedCount)+" of "+e.toDisplayString(t.total)+" selected ",1)):(e.openBlock(),e.createElementBlock("div",Pm," Showing "+e.toDisplayString(i.value)+" to "+e.toDisplayString(u.value)+" of "+e.toDisplayString(t.total)+" entries ",1)),y.$slots.footer?(e.openBlock(),e.createElementBlock("div",Mm,[e.renderSlot(y.$slots,"footer")])):e.createCommentVNode("",!0),t.showPagination?(e.openBlock(),e.createElementBlock("div",Lm,[e.createElementVNode("div",jm,[e.createVNode(me,{for:"pageSize",class:e.normalizeClass(v.value),inline:!0},{default:e.withCtx(()=>[...b[5]||(b[5]=[e.createTextVNode("Show:",-1)])]),_:1},8,["class"]),e.createVNode(se,{id:"pageSize","model-value":t.pageSize.toString(),class:e.normalizeClass(h.value),"onUpdate:modelValue":b[0]||(b[0]=f=>y.$emit("update:pageSize",parseInt(f)))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pageSizeOptions,f=>(e.openBlock(),e.createBlock(ua,{key:f,value:f.toString(),label:f.toString()},null,8,["value","label"]))),128))]),_:1},8,["model-value","class"])]),e.createElementVNode("div",Om,[e.createElementVNode("button",{disabled:t.currentPage===1,class:e.normalizeClass(E(!1,t.currentPage===1)),title:"First page",onClick:b[1]||(b[1]=f=>y.$emit("update:currentPage",1))},[...b[6]||(b[6]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"})],-1)])],10,Im),e.createElementVNode("button",{disabled:t.currentPage===1,class:e.normalizeClass(E(!1,t.currentPage===1)),title:"Previous page",onClick:b[2]||(b[2]=f=>y.$emit("update:currentPage",t.currentPage-1))},[...b[7]||(b[7]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)])],10,_m),e.createElementVNode("div",Rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,f=>(e.openBlock(),e.createElementBlock("button",{key:f,class:e.normalizeClass(E(f===t.currentPage,!1)),onClick:d=>y.$emit("update:currentPage",f)},e.toDisplayString(f),11,Um))),128))]),e.createElementVNode("button",{disabled:t.currentPage===t.totalPages,class:e.normalizeClass(E(!1,t.currentPage===t.totalPages)),title:"Next page",onClick:b[3]||(b[3]=f=>y.$emit("update:currentPage",t.currentPage+1))},[...b[8]||(b[8]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})],-1)])],10,qm),e.createElementVNode("button",{disabled:t.currentPage===t.totalPages,class:e.normalizeClass(E(!1,t.currentPage===t.totalPages)),title:"Last page",onClick:b[4]||(b[4]=f=>y.$emit("update:currentPage",t.totalPages))},[...b[9]||(b[9]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5"})],-1)])],10,Hm)]),e.createElementVNode("div",Wm," Page "+e.toDisplayString(t.currentPage)+" of "+e.toDisplayString(t.totalPages),1)])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)}},yt=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},Ym={key:0,class:"loader__backdrop"},Gm={class:"loader__container"},Km={key:0,class:"loader__text loader__text--top"},Xm={key:1,class:"loader__spin"},Qm={key:2,class:"loader__pulse"},Jm={key:3,class:"loader__bounce"},Zm={key:4,class:"loader__ripple"},ef={key:5,class:"loader__bars"},tf={key:6,class:"loader__dots"},af={key:7,class:"loader__ring"},nf={key:8,class:"loader__spinner-text"},of={key:9,class:"loader__text loader__text--bottom"},rf={__name:"Loader",props:{loading:{type:Boolean,default:!0},type:{type:String,default:"spin",validator:t=>["spin","pulse","bounce","ripple","bars","dots","ring","spinner-text"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large","xl"].includes(t)},color:{type:String,default:"#3b82f6"},backgroundColor:{type:String,default:"rgba(255, 255, 255, 0.9)"},text:{type:String,default:""},textPosition:{type:String,default:"bottom",validator:t=>["top","bottom"].includes(t)},overlay:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(t){return(n,a)=>t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loader",`loader--${t.type}`,`loader--${t.size}`,t.overlay?"loader--overlay":"",t.fullscreen?"loader--fullscreen":""]),style:e.normalizeStyle({"--loader-color":t.color,"--loader-bg":t.backgroundColor})},[t.overlay?(e.openBlock(),e.createElementBlock("div",Ym)):e.createCommentVNode("",!0),e.createElementVNode("div",Gm,[t.text&&t.textPosition==="top"?(e.openBlock(),e.createElementBlock("div",Km,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),t.type==="spin"?(e.openBlock(),e.createElementBlock("div",Xm)):t.type==="pulse"?(e.openBlock(),e.createElementBlock("div",Qm)):t.type==="bounce"?(e.openBlock(),e.createElementBlock("div",Jm,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,o=>e.createElementVNode("div",{key:o,class:"loader__bounce-dot",style:e.normalizeStyle({animationDelay:`${(o-1)*.1}s`})},null,4)),64))])):t.type==="ripple"?(e.openBlock(),e.createElementBlock("div",Zm,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,o=>e.createElementVNode("div",{key:o,class:"loader__ripple-ring",style:e.normalizeStyle({animationDelay:`${(o-1)*.5}s`})},null,4)),64))])):t.type==="bars"?(e.openBlock(),e.createElementBlock("div",ef,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,o=>e.createElementVNode("div",{key:o,class:"loader__bar",style:e.normalizeStyle({animationDelay:`${(o-1)*.1}s`})},null,4)),64))])):t.type==="dots"?(e.openBlock(),e.createElementBlock("div",tf,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,o=>e.createElementVNode("div",{key:o,class:"loader__dot",style:e.normalizeStyle({animationDelay:`${(o-1)*.16}s`})},null,4)),64))])):t.type==="ring"?(e.openBlock(),e.createElementBlock("div",af,[...a[0]||(a[0]=[e.createElementVNode("div",{class:"loader__ring-track"},null,-1),e.createElementVNode("div",{class:"loader__ring-fill"},null,-1)])])):t.type==="spinner-text"?(e.openBlock(),e.createElementBlock("div",nf,[...a[1]||(a[1]=[e.createElementVNode("div",{class:"loader__spinner"},null,-1)])])):e.createCommentVNode("",!0),t.text&&t.textPosition==="bottom"?(e.openBlock(),e.createElementBlock("div",of,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)])],6)):e.createCommentVNode("",!0)}},Oe=yt(rf,[["__scopeId","data-v-68532350"]]),lf={class:"relative"},sf={class:"flex items-center justify-center"},cf=["onClick"],df={class:"flex items-center gap-2"},uf={key:1,class:"flex flex-col"},mf=["onClick"],ff=["onClick"],pf={key:1},gf={key:1,class:"flex items-center gap-1 justify-center"},vf={key:1,class:"text-xs"},hf={key:2},bf=["colspan"],yf={class:"flex flex-col items-center justify-center py-12"},xf={class:"text-slate-400 mb-4 flex justify-center"},kf={class:"text-slate-600 text-lg font-medium mb-2"},wf={class:"text-slate-500 text-sm"},Cf={class:"p-6"},Bf={class:"text-xl font-bold text-gray-700 whitespace-pre-wrap break-words"},Vf={__name:"DataTable",props:{data:{type:Array,required:!0},columns:{type:Array,required:!0},title:{type:String,default:null},description:{type:String,default:null},selectable:{type:Boolean,default:!1},selectedItems:{type:Array,default:()=>[]},sortBy:{type:String,default:null},sortOrder:{type:String,default:"asc",validator:t=>["asc","desc"].includes(t)},pageSize:{type:Number,default:10},showPagination:{type:Boolean,default:!0},striped:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},clickableRows:{type:Boolean,default:!1},emptyText:{type:String,default:"No data available"},emptySubtitle:{type:String,default:"Try adjusting your search or filter criteria"},rowKey:{type:String,default:"id"},variant:{type:String,default:"default",validator:t=>["default","bordered","minimal"].includes(t)},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},headerVariant:{type:String,default:"default"},headerPadding:{type:String,default:"normal"},paginationVariant:{type:String,default:"default"},paginationPadding:{type:String,default:"normal"},actions:{type:Array,default:()=>[]},showActionsColumn:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},dataLoading:{type:Boolean,default:!1},sortLoading:{type:Boolean,default:!1},paginationLoading:{type:Boolean,default:!1},bulkLoading:{type:Boolean,default:!1},rowLoading:{type:Object,default:()=>({})},loadingType:{type:String,default:"dots",validator:t=>["spin","pulse","bounce","ripple","bars","dots","ring"].includes(t)},loadingSize:{type:String,default:"medium",validator:t=>["small","medium","large","xl"].includes(t)},loadingColor:{type:String,default:"#3b82f6"},loadingText:{type:String,default:"Loading..."},loadingTextPosition:{type:String,default:"bottom",validator:t=>["top","bottom"].includes(t)},loadingBackground:{type:String,default:"rgba(255, 255, 255, 0.95)"},showSkeleton:{type:Boolean,default:!0},skeletonRows:{type:Number,default:5}},emits:["selection-change","sort-change","row-click","page-change","page-size-change","refresh","action"],setup(t,{expose:n,emit:a}){const o=t,r=a,l=e.ref(1),i=e.ref(o.pageSize),u=e.ref(o.sortBy),m=e.ref(o.sortOrder),p=e.ref(!1),v=e.ref(""),h=T.cva("bg-white border border-slate-200 rounded-lg overflow-hidden",{variants:{variant:{default:"shadow-sm",bordered:"border-2 border-slate-300",minimal:"border-none shadow-none bg-transparent"}},defaultVariants:{variant:"default"}}),E=T.cva("min-w-full",{variants:{variant:{default:"divide-y divide-slate-200",bordered:"border-collapse [&_td]:border [&_th]:border",minimal:"divide-y divide-slate-100"}},defaultVariants:{variant:"default"}}),y=T.cva("",{variants:{variant:{default:"bg-slate-50",bordered:"bg-slate-100 border-b-2 border-slate-300",minimal:"bg-transparent border-b border-slate-200"}},defaultVariants:{variant:"default"}}),b=T.cva("divide-y",{variants:{variant:{default:"bg-white divide-slate-200",bordered:"bg-white divide-slate-300",minimal:"bg-transparent divide-slate-100"}},defaultVariants:{variant:"default"}}),f=e.computed(()=>{let $=[...o.data];if(u.value){const j=o.columns.find(R=>R.key===u.value);j&&$.sort((R,ee)=>{const Y=w(R,j),Se=w(ee,j);return Y<Se?m.value==="asc"?-1:1:Y>Se?m.value==="asc"?1:-1:0})}return $}),d=e.computed(()=>Math.ceil(f.value.length/i.value)),s=e.computed(()=>{if(!o.showPagination)return f.value;const $=(l.value-1)*i.value,j=$+i.value;return f.value.slice($,j)}),c=e.computed(()=>{let $=o.columns.length;return o.selectable&&$++,(o.$slots?.actions||o.actions.length>0&&o.showActionsColumn)&&$++,$}),g=$=>o.actions.filter(j=>j.visible&&typeof j.visible=="function"?j.visible($):!0),S=($,j)=>$.permission&&typeof $.permission=="function"?$.permission(j):!0,k=($,j)=>$.disabled&&typeof $.disabled=="function"?$.disabled(j):!1,N=($,j)=>{k($,j)||!S($,j)||(r("action",{action:$.key,item:j,actionConfig:$}),$.onClick&&typeof $.onClick=="function"&&$.onClick(j))},F=$=>({default:"default",primary:"gradient",secondary:"secondary",danger:"danger",success:"success",warning:"warning",info:"info",subtle:"subtle",dark:"dark",light:"light",primaryOutline:"primaryOutline",dangerOutline:"dangerOutline",successOutline:"successOutline",outline:"outline",link:"link",ghost:"ghost"})[$]||"ghost",L=e.computed(()=>f.value.length>0&&f.value.every($=>_($))),q=e.computed(()=>{const $=f.value.filter(j=>_(j)).length;return $>0&&$<f.value.length}),w=($,j)=>j.accessor?j.accessor($):j.key.split(".").reduce((R,ee)=>R?.[ee],$),M=($,j)=>$[o.rowKey]||j,_=$=>o.selectedItems.some(j=>M(j)===M($)),C=$=>{const j=[...o.selectedItems],R=j.findIndex(ee=>M(ee)===M($));R>-1?j.splice(R,1):j.push($),r("selection-change",j)},z=()=>{if(o.loading||o.dataLoading)return;const $=L.value?[]:[...f.value];r("selection-change",$)},O=async $=>{!$.sortable||o.loading||o.sortLoading||(u.value===$.key?m.value=m.value==="asc"?"desc":"asc":(u.value=$.key,m.value="asc"),r("sort-change",{column:$.key,direction:m.value}))},G=$=>{o.loading||r("row-click",$)},H=async $=>{o.paginationLoading||o.loading||(l.value=$,r("page-change",$))},oe=async $=>{o.paginationLoading||o.loading||(i.value=$,l.value=1,r("page-size-change",$))},Ye=e.computed(()=>x(h({variant:o.variant}))),Ge=e.computed(()=>x(E({variant:o.variant}))),xt=e.computed(()=>x(y({variant:o.variant}))),kt=e.computed(()=>x(b({variant:o.variant}))),wt=$=>x({compact:"px-4 py-2",normal:"px-6 py-3",comfortable:"px-8 py-4"}[o.density],"text-left text-xs font-medium text-slate-500 uppercase tracking-wider",{"cursor-pointer hover:bg-slate-100 transition-colors":$.sortable&&!o.loading&&!o.sortLoading,"cursor-not-allowed opacity-50":o.loading||o.sortLoading&&u.value===$.key}),Ke=()=>x({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm text-slate-900"),Te=($,j)=>{const R=[];return o.striped&&j%2===1&&R.push("bg-slate-50/50"),o.hoverable&&!o.clickableRows&&R.push("hover:bg-slate-50"),o.clickableRows&&R.push("cursor-pointer hover:bg-slate-100"),o.selectable&&_($)&&R.push("bg-blue-50 border-blue-200"),o.variant==="bordered"?R.push("border-b border-slate-200"):o.variant==="minimal"&&R.push("border-b border-slate-100"),x("transition-colors",...R)},Ce=($,j)=>{const R=w($,j);return typeof j=="object"&&j.formatter?j.formatter(R,$):R==null?"":R instanceof Date?R.toLocaleDateString():Array.isArray(R)?R.join(", "):R},Ct=($,j=10)=>{if(!$)return $;const R=$.toString().split(" ");return R.length<=j?$:R.slice(0,j).join(" ")+"..."},Bt=$=>{v.value||(v.value=$,p.value=!0)},Be=()=>{p.value=!1,v.value=""},ye=e.computed(()=>x({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm text-slate-900 w-12")),Ve=e.computed(()=>x({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm font-medium text-center")),Xe=e.computed(()=>x({compact:"px-4 py-4",normal:"px-6 py-6",comfortable:"px-8 py-8"}[o.density],"text-center")),Qe=($,j)=>x({"text-blue-600":u.value===$.key&&m.value===j,"text-slate-300":u.value!==$.key||m.value!==j});return e.watch(()=>o.selectedItems,()=>{},{deep:!0}),e.watch(()=>o.pageSize,$=>{i.value=$}),n({refresh:()=>{r("refresh")},goToPage:$=>{H($)},selectAll:()=>{z()},clearSelection:()=>{r("selection-change",[])},getCurrentPage:()=>l.value,getTotalPages:()=>d.value,getSelectedItems:()=>o.selectedItems}),($,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(Ye.value)},[t.title||t.description||$.$slots.header?(e.openBlock(),e.createBlock(ga,{key:0,title:t.title,description:t.description,variant:t.headerVariant,padding:t.headerPadding},{header:e.withCtx(()=>[e.renderSlot($.$slots,"header",{},void 0,!0)]),filters:e.withCtx(()=>[e.renderSlot($.$slots,"filters",{},void 0,!0)]),_:3},8,["title","description","variant","padding"])):e.createCommentVNode("",!0),e.createElementVNode("div",lf,[t.loading?(e.openBlock(),e.createBlock(Oe,{key:0,loading:!0,type:t.loadingType,size:t.loadingSize,color:t.loadingColor,overlay:!0,text:t.loadingText,"text-position":t.loadingTextPosition,"background-color":t.loadingBackground,class:"table-loading-overlay"},null,8,["type","size","color","text","text-position","background-color"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["overflow-x-auto",{"opacity-50":t.loading}])},[e.createElementVNode("table",{class:e.normalizeClass(Ge.value)},[e.createElementVNode("thead",{class:e.normalizeClass(xt.value)},[e.createElementVNode("tr",null,[t.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(ye.value)},[e.createElementVNode("div",sf,[t.bulkLoading?(e.openBlock(),e.createBlock(Oe,{key:0,loading:!0,type:"spin",size:"small",color:t.loadingColor},null,8,["color"])):(e.openBlock(),e.createBlock(_e,{key:1,"model-value":L.value,indeterminate:q.value,disabled:t.loading||t.dataLoading,"onUpdate:modelValue":z},null,8,["model-value","indeterminate","disabled"]))])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,R=>(e.openBlock(),e.createElementBlock("th",{key:R.key,class:e.normalizeClass(wt(R)),onClick:ee=>O(R)},[e.createElementVNode("div",df,[e.createElementVNode("span",null,e.toDisplayString(R.label),1),t.sortLoading&&u.value===R.key?(e.openBlock(),e.createBlock(Oe,{key:0,loading:!0,type:"spin",size:"small",color:t.loadingColor},null,8,["color"])):R.sortable?(e.openBlock(),e.createElementBlock("div",uf,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([Qe(R,"asc"),"w-3 h-3 transition-colors"]),fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[...j[1]||(j[1]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"},null,-1)])],2)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([Qe(R,"desc"),"w-3 h-3 transition-colors"]),fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[...j[2]||(j[2]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)])],2))])):e.createCommentVNode("",!0)])],10,cf))),128)),$.$slots.actions||t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(Ve.value)}," Actions ",2)):e.createCommentVNode("",!0)])],2),e.createElementVNode("tbody",{class:e.normalizeClass(kt.value)},[t.showSkeleton&&(t.loading||t.dataLoading)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.skeletonRows,R=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${R}`,class:"animate-pulse"},[t.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(ye.value)},[...j[3]||(j[3]=[e.createElementVNode("div",{class:"w-4 h-4 bg-slate-200 rounded"},null,-1)])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,ee=>(e.openBlock(),e.createElementBlock("td",{key:ee.key,class:e.normalizeClass(Ke())},[...j[4]||(j[4]=[e.createElementVNode("div",{class:"h-4 bg-slate-200 rounded w-3/4"},null,-1)])],2))),128)),$.$slots.actions||t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(Ve.value)},[...j[5]||(j[5]=[e.createElementVNode("div",{class:"flex gap-2 justify-center"},[e.createElementVNode("div",{class:"w-6 h-6 bg-slate-200 rounded"}),e.createElementVNode("div",{class:"w-6 h-6 bg-slate-200 rounded"})],-1)])],2)):e.createCommentVNode("",!0)]))),128)):s.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(s.value,(R,ee)=>(e.openBlock(),e.createElementBlock("tr",{key:M(R,ee),class:e.normalizeClass(Te(R,ee)),onClick:Y=>G({item:R,index:ee})},[t.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(ye.value)},[e.createVNode(_e,{"model-value":_(R),"onUpdate:modelValue":Y=>C(R)},null,8,["model-value","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,Y=>(e.openBlock(),e.createElementBlock("td",{key:Y.key,class:e.normalizeClass(Ke())},[e.renderSlot($.$slots,`cell-${Y.key}`,{item:R,value:w(R,Y),column:Y,index:ee},()=>[Ce(R,Y).toString().split(" ").length>10?(e.openBlock(),e.createElementBlock("span",{key:0,class:"cursor-pointer text-blue-600 hover:text-blue-800",onClick:e.withModifiers(Se=>Bt(Ce(R,Y)),["stop"])},e.toDisplayString(Ct(Ce(R,Y))),9,ff)):(e.openBlock(),e.createElementBlock("span",pf,e.toDisplayString(Ce(R,Y)),1))],!0)],2))),128)),$.$slots.actions||t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(Ve.value)},[$.$slots.actions?e.renderSlot($.$slots,"actions",{key:0,item:R,index:ee},void 0,!0):t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("div",gf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g(R),Y=>(e.openBlock(),e.createBlock(fa,{key:Y.key,content:Y.tooltip||Y.label||Y.key,placement:"top"},{default:e.withCtx(()=>[e.createVNode(J,{variant:F(Y.variant),size:"xs",disabled:k(Y,R)||!S(Y,R),class:"h-8 w-8",onClick:e.withModifiers(Se=>N(Y,R),["stop"])},{default:e.withCtx(()=>[Y.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:Y.icon,class:"w-4 h-4"},null,8,["icon"])):Y.label?(e.openBlock(),e.createElementBlock("span",vf,e.toDisplayString(Y.label),1)):e.createCommentVNode("",!0)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["content"]))),128))])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],10,mf))),128)):(e.openBlock(),e.createElementBlock("tr",hf,[e.createElementVNode("td",{colspan:c.value,class:e.normalizeClass(Xe.value)},[e.renderSlot($.$slots,"empty",{},()=>[e.createElementVNode("div",yf,[e.createElementVNode("div",xf,[e.createVNode(I,{icon:"search",class:"w-16 h-16"})]),e.createElementVNode("p",kf,e.toDisplayString(t.emptyText),1),e.createElementVNode("p",wf,e.toDisplayString(t.emptySubtitle),1)])],!0)],10,bf)]))],2)],2)],2)]),t.showPagination||$.$slots.footer?(e.openBlock(),e.createBlock(va,{key:1,"current-page":l.value,"total-pages":d.value,total:f.value.length,"page-size":i.value,"show-pagination":t.showPagination,selectable:t.selectable,"selected-count":t.selectedItems.length,variant:t.paginationVariant,padding:t.paginationPadding,loading:t.paginationLoading,disabled:t.loading||t.dataLoading,"onUpdate:currentPage":H,"onUpdate:pageSize":oe},{footer:e.withCtx(()=>[e.renderSlot($.$slots,"footer",{},void 0,!0)]),_:3},8,["current-page","total-pages","total","page-size","show-pagination","selectable","selected-count","variant","padding","loading","disabled"])):e.createCommentVNode("",!0),e.createVNode(ht,{modelValue:p.value,"onUpdate:modelValue":j[0]||(j[0]=R=>p.value=R),size:"lg",height:"auto",onClose:Be},{default:e.withCtx(()=>[e.createElementVNode("div",Cf,[j[6]||(j[6]=e.createElementVNode("h3",{class:"text-md font-semibold mb-4"}," Full Text ",-1)),e.createElementVNode("div",Bf,e.toDisplayString(v.value),1)])]),_:1},8,["modelValue"])],2))}},Ro=yt(Vf,[["__scopeId","data-v-30b63d46"]]),Uo={__name:"DataTableRow",props:{item:{type:Object,required:!0},columns:{type:Array,required:!0},index:{type:Number,required:!0},selectable:{type:Boolean,default:!1},isSelected:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},clickableRows:{type:Boolean,default:!1},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},variant:{type:String,default:"default",validator:t=>["default","bordered","minimal"].includes(t)}},emits:["toggle-selection","row-click"],setup(t,{emit:n}){const a=t,o=n,r=T.cva("transition-colors",{variants:{striped:{true:"odd:bg-slate-50/50",false:""},hoverable:{true:"hover:bg-slate-50",false:""},clickable:{true:"cursor-pointer hover:bg-slate-100",false:""},selected:{true:"bg-blue-50 border-blue-200",false:""},variant:{default:"",bordered:"border-b border-slate-200",minimal:"border-b border-slate-100"}},compoundVariants:[{hoverable:!0,clickable:!0,class:"hover:bg-slate-100"}],defaultVariants:{striped:!1,hoverable:!0,clickable:!1,selected:!1,variant:"default"}}),l=T.cva("whitespace-nowrap text-sm text-slate-900",{variants:{density:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{density:"normal",align:"left"}}),i=f=>typeof f=="string"?f:f?.key||f?.field||"unknown",u=(f,d)=>{const s=i(d);return typeof d=="object"&&d.accessor?d.accessor(f):s&&s.includes(".")?s.split(".").reduce((c,g)=>c?.[g],f):f?.[s]},m=(f,d)=>{const s=u(f,d);return typeof d=="object"&&d.formatter?d.formatter(s,f):s==null?"":s instanceof Date?s.toLocaleDateString():Array.isArray(s)?s.join(", "):s},p=()=>{a.clickableRows&&o("row-click",{item:a.item,index:a.index})},v=f=>typeof f=="object"&&f.align?f.align:"left",h=e.computed(()=>x(r({striped:a.striped,hoverable:a.hoverable&&!a.clickableRows,clickable:a.clickableRows,selected:a.isSelected,variant:a.variant}))),E=f=>{const d=v(f);return x(l({density:a.density,align:d}),f.cellClasses)},y=e.computed(()=>x(l({density:a.density}),"w-12")),b=e.computed(()=>x(l({density:a.density,align:"right"}),"font-medium"));return(f,d)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass(h.value),onClick:p},[t.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(y.value)},[e.createVNode(_e,{"model-value":t.isSelected,"onUpdate:modelValue":d[0]||(d[0]=s=>f.$emit("toggle-selection",t.item))},null,8,["model-value"])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,s=>(e.openBlock(),e.createElementBlock("td",{key:i(s),class:e.normalizeClass(E(s))},[e.renderSlot(f.$slots,`cell-${i(s)}`,{item:t.item,value:u(t.item,s),column:s,index:t.index},()=>[e.createTextVNode(e.toDisplayString(m(t.item,s)),1)])],2))),128)),f.$slots.actions?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(b.value)},[e.renderSlot(f.$slots,"actions",{item:t.item,index:t.index})],2)):e.createCommentVNode("",!0)],2))}},qo={__name:"DataTableCell",props:{item:{type:Object,required:!0},column:{type:Object,required:!0},value:{type:[String,Number,Boolean,Object,Array],default:null},align:{type:String,default:"left",validator:t=>["left","center","right"].includes(t)},width:{type:String,default:null},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},textSize:{type:String,default:"sm",validator:t=>["xs","sm","base","lg"].includes(t)},textColor:{type:String,default:"slate-900"}},setup(t){const n=t,a=e.computed(()=>{const i=n.value??o();return n.column.formatter?n.column.formatter(i,n.item):i}),o=()=>n.column.accessor?n.column.accessor(n.item):n.column.key.split(".").reduce((i,u)=>i?.[u],n.item),r=T.cva("whitespace-nowrap",{variants:{align:{left:"text-left",center:"text-center",right:"text-right"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"},textSize:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg"}},defaultVariants:{align:"left",padding:"normal",textSize:"sm"}}),l=e.computed(()=>{const i=n.align||n.column.align||"left",u=`text-${n.textColor}`,m=n.width?`w-${n.width}`:"";return x(r({align:i,padding:n.padding,textSize:n.textSize}),u,m,n.column.cellClasses)});return(i,u)=>(e.openBlock(),e.createElementBlock("td",{class:e.normalizeClass(l.value)},[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.value),1)])],2))}},Sf={class:"bg-white border-b border-gray-200"},Ef={key:0,class:"flex-1 min-w-80 max-w-md"},Nf={class:"relative group"},$f=["model-value","placeholder"],zf={class:"relative"},Df={value:""},Tf=["value"],Af={key:1,class:"min-w-36"},Ff={class:"relative"},Pf=["value"],Mf={key:3,class:"flex items-center gap-2"},Lf={class:"flex items-center gap-3 ml-auto"},jf={key:0},Of={key:3},If={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},_f={class:"flex items-center justify-between"},Rf={class:"flex items-center gap-3"},Uf={class:"relative flex-1"},qf=["model-value","placeholder","onInput"],Hf={class:"relative flex-1"},Wf=["model-value","placeholder","onInput"],Yf=["onClick"],Gf={class:"flex items-center justify-between"},Kf={class:"flex items-center gap-3"},Xf={class:"relative flex-1"},Qf=["model-value","placeholder","step","onInput"],Jf={class:"relative flex-1"},Zf=["model-value","placeholder","step","onInput"],ep=["onClick"],tp={class:"flex items-center justify-between"},ap={class:"relative"},np={value:""},op=["value"],rp={key:0,class:"flex flex-wrap gap-2 mt-2"},lp=["onClick"],sp={class:"flex items-center gap-3 flex-wrap"},ip=["onClick"],cp={key:2,class:"px-6 py-3 bg-gray-50 border-t border-gray-200"},dp={class:"flex items-center justify-between"},up={class:"flex items-center gap-4"},mp={class:"text-sm text-gray-600"},fp={class:"font-medium"},pp={class:"bg-white rounded-xl shadow-2xl max-w-2xl w-full p-6"},gp={class:"flex items-center justify-between mb-4"},vp={class:"flex justify-end gap-3 mt-6"},Ho={__name:"DataTableFilters",props:{searchQuery:{type:String,default:""},searchPlaceholder:{type:String,default:"Search..."},selectedStatus:{type:String,default:""},statusOptions:{type:Array,default:()=>[]},showDateFilter:{type:Boolean,default:!1},dateFrom:{type:String,default:""},dateTo:{type:String,default:""},selectFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"options")&&Object.prototype.hasOwnProperty.call(n,"value"))},dateFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"from")&&Object.prototype.hasOwnProperty.call(n,"to"))},numberFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"min")&&Object.prototype.hasOwnProperty.call(n,"max"))},multiSelectFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"options")&&Object.prototype.hasOwnProperty.call(n,"selected"))},showExport:{type:Boolean,default:!1},showAdd:{type:Boolean,default:!1},addButton:{type:Object,default:()=>({})},showTableInfo:{type:Boolean,default:!0},showSearch:{type:Boolean,default:!0},showFilters:{type:Boolean,default:!0},showFileUpload:{type:Boolean,default:!1},fileUploadMultiple:{type:Boolean,default:!1},fileUploadAccept:{type:String,default:""},fileUploadMaxSize:{type:Number,default:null},fileUploadVariant:{type:String,default:"default",validator:t=>["default","dashed"].includes(t)},totalItems:{type:Number,default:0},itemLabel:{type:String,default:"items"},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:searchQuery","update:selectedStatus","update:dateFrom","update:dateTo","update:dateFilters","update:selectFilters","update:numberFilters","update:multiSelectFilters","export","add","clear-filters","add-button-click","files-selected","file-removed"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(!1),i=e.computed(()=>Object.keys(a.addButton).length>0),u=e.computed(()=>i.value?a.addButton.visible&&typeof a.addButton.visible=="function"?a.addButton.visible():!0:a.showAdd),m=e.computed(()=>i.value&&a.addButton.permission&&typeof a.addButton.permission=="function"?a.addButton.permission():!0),p=e.computed(()=>i.value&&a.addButton.disabled&&typeof a.addButton.disabled=="function"?a.addButton.disabled():!1),v=()=>{l.value=!0},h=()=>{l.value=!1},E=A=>{o("files-selected",A)},y=A=>{o("file-removed",A)},b=()=>{p.value||!m.value||(o("add"),o("add-button-click",a.addButton),a.addButton.onClick&&typeof a.addButton.onClick=="function"&&a.addButton.onClick())},f=T.cva("flex flex-wrap items-center gap-4",{variants:{variant:{default:"bg-white",minimal:"bg-transparent",bordered:"bg-gray-50"},padding:{compact:"px-4 py-3",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),d=T.cva("border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-sm",{variants:{size:{sm:"px-2 py-1.5",md:"px-3 py-2.5",lg:"px-4 py-3"}},defaultVariants:{size:"md"}}),s=T.cva("rounded-lg flex items-center font-medium transition-all",{variants:{variant:{default:"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 hover:border-gray-300 bg-white",primary:"text-white bg-blue-600 hover:bg-blue-700 border border-blue-600 shadow-sm",success:"text-white bg-green-600 hover:bg-green-700 border border-green-600 shadow-sm",ghost:"text-gray-600 hover:text-gray-800 hover:bg-gray-100"},size:{sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),c=(A,B)=>{const V=a.selectFilters.map(P=>P.key===A?{...P,value:B}:P);o("update:selectFilters",V)},g=A=>!!(A.from||A.to),S=A=>{const B=a.dateFilters.map(V=>V.key===A?{...V,from:"",to:""}:V);o("update:dateFilters",B)},k=A=>`text-xs px-2 py-1 rounded ${g(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,N=(A,B,V)=>{const P=a.dateFilters.map(K=>K.key===A?{...K,[B]:V}:K);o("update:dateFilters",P)},F=A=>!!(A.min||A.max),L=A=>{const B=a.numberFilters.map(V=>V.key===A?{...V,min:"",max:""}:V);o("update:numberFilters",B)},q=A=>`text-xs px-2 py-1 rounded ${F(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,w=(A,B,V)=>{const P=a.numberFilters.map(K=>K.key===A?{...K,[B]:V}:K);o("update:numberFilters",P)},M=A=>A.selected&&A.selected.length>0,_=A=>`text-xs px-2 py-1 rounded ${M(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,C=(A,B)=>{if(!B)return;const V=a.multiSelectFilters.map(P=>{if(P.key===A){const K=P.selected||[],Ae=K.includes(B);return{...P,selected:Ae?K.filter(Vt=>Vt!==B):[...K,B]}}return P});o("update:multiSelectFilters",V)},z=(A,B)=>{const V=a.multiSelectFilters.map(P=>P.key===A?{...P,selected:P.selected.filter(K=>K!==B)}:P);o("update:multiSelectFilters",V)},O=(A,B)=>{const V=A.options.find(P=>P.value===B);return V?V.label:B},G=()=>{r.value=!r.value},H=e.computed(()=>a.numberFilters.length>0||a.multiSelectFilters.length>0),oe=e.computed(()=>{const A=a.searchQuery,B=a.selectedStatus,V=a.dateFrom||a.dateTo,P=a.selectFilters.some(ce=>ce.value),K=a.dateFilters.some(ce=>ce.from||ce.to),Ae=a.numberFilters.some(ce=>ce.min||ce.max),Vt=a.multiSelectFilters.some(ce=>ce.selected&&ce.selected.length>0);return A||B||V||P||K||Ae||Vt}),Ye=e.computed(()=>{let A=0;return a.searchQuery&&A++,a.selectedStatus&&A++,(a.dateFrom||a.dateTo)&&A++,A+=a.selectFilters.filter(B=>B.value).length,A+=a.dateFilters.filter(B=>B.from||B.to).length,A+=a.numberFilters.filter(B=>B.min||B.max).length,A+=a.multiSelectFilters.filter(B=>B.selected&&B.selected.length>0).length,A}),Ge=e.computed(()=>{const A=[];if(a.searchQuery&&a.searchQuery.trim()&&A.push({key:"search",label:"Search",value:`"${a.searchQuery}"`,icon:"magnifying-glass"}),a.selectedStatus){const B=a.statusOptions.find(V=>V.value===a.selectedStatus);A.push({key:"status",label:"Status",value:B?.label||a.selectedStatus,icon:"filter"})}if(a.selectFilters.forEach(B=>{if(B.value){const V=B.options.find(P=>P.value===B.value);A.push({key:`select-${B.key}`,label:B.label,value:V?.label||B.value,icon:"filter"})}}),a.dateFrom||a.dateTo){let B="";a.dateFrom&&a.dateTo?B=`${a.dateFrom} to ${a.dateTo}`:a.dateFrom?B=`From ${a.dateFrom}`:a.dateTo&&(B=`Until ${a.dateTo}`),B&&A.push({key:"date",label:"Date Range",value:B,icon:"calendar"})}return a.dateFilters.forEach(B=>{if(B.from||B.to){let V="";B.from&&B.to?V=`${B.from} to ${B.to}`:B.from?V=`From ${B.from}`:B.to&&(V=`Until ${B.to}`),V&&A.push({key:`date-${B.key}`,label:B.label,value:V,icon:"calendar"})}}),a.numberFilters.forEach(B=>{if(B.min||B.max){let V="";B.min&&B.max?V=`${B.min} to ${B.max}`:B.min?V=`Min ${B.min}`:B.max&&(V=`Max ${B.max}`),V&&A.push({key:`number-${B.key}`,label:B.label,value:V,icon:"hashtag"})}}),a.multiSelectFilters.forEach(B=>{if(B.selected&&B.selected.length>0){const V=B.selected.map(P=>{const K=B.options.find(Ae=>Ae.value===P);return K?K.label:P});A.push({key:`multi-${B.key}`,label:B.label,value:V.join(", "),icon:"list"})}}),A}),xt=e.computed(()=>x(f({variant:a.variant,padding:a.padding}))),kt=e.computed(()=>"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 group-hover:text-gray-600 transition-colors"),wt=e.computed(()=>x(d({size:"md"}),"w-full pl-10 pr-10 hover:border-gray-300")),Ke=e.computed(()=>"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600 p-1 hover:bg-gray-100 rounded-full transition-all"),Te=e.computed(()=>x(d({size:"md"}),"w-full pr-8 appearance-none hover:border-gray-300")),Ce=e.computed(()=>{const A=r.value||oe.value;return x(s({variant:A?"primary":"default",size:"lg"}),"gap-2")}),Ct=e.computed(()=>"bg-white text-blue-600 text-xs px-1.5 py-0.5 rounded-full min-w-[20px] text-center font-semibold"),Bt=e.computed(()=>"px-6 py-4 border-t border-gray-100 bg-gray-50"),Be=e.computed(()=>x(d({size:"md"}),"pl-10 pr-3")),ye=e.computed(()=>"text-sm font-semibold text-gray-700"),Ve=e.computed(()=>"text-gray-500 text-sm font-medium"),Xe=e.computed(()=>"text-gray-400 hover:text-gray-600 p-1.5 hover:bg-gray-200 rounded-full transition-all"),Qe=e.computed(()=>x(s({variant:"ghost",size:"md"}))),$=e.computed(()=>x(s({variant:"default",size:"lg"}))),j=e.computed(()=>"px-6 py-3 bg-blue-50 border-t border-blue-100"),R=e.computed(()=>"text-sm font-semibold text-blue-800"),ee=e.computed(()=>"flex items-center gap-1.5 bg-white border border-blue-200 text-blue-800 px-3 py-1.5 rounded-full text-sm font-medium"),Y=e.computed(()=>"text-blue-600 hover:text-blue-800 ml-1 hover:bg-blue-100 rounded-full p-0.5 transition-all"),Se=()=>{o("update:searchQuery",""),o("update:selectedStatus",""),o("update:dateFrom",""),o("update:dateTo","");const A=a.selectFilters.map(K=>({...K,value:""}));o("update:selectFilters",A);const B=a.dateFilters.map(K=>({...K,from:"",to:""}));o("update:dateFilters",B);const V=a.numberFilters.map(K=>({...K,min:"",max:""}));o("update:numberFilters",V);const P=a.multiSelectFilters.map(K=>({...K,selected:[]}));o("update:multiSelectFilters",P),o("clear-filters")},or=A=>{switch(A){case"search":o("update:searchQuery","");break;case"status":o("update:selectedStatus","");break;case"date":o("update:dateFrom",""),o("update:dateTo","");break;default:if(A.startsWith("select-")){const B=A.replace("select-",""),V=a.selectFilters.map(P=>P.key===B?{...P,value:""}:P);o("update:selectFilters",V)}else if(A.startsWith("date-")){const B=A.replace("date-",""),V=a.dateFilters.map(P=>P.key===B?{...P,from:"",to:""}:P);o("update:dateFilters",V)}else if(A.startsWith("number-")){const B=A.replace("number-",""),V=a.numberFilters.map(P=>P.key===B?{...P,min:"",max:""}:P);o("update:numberFilters",V)}else if(A.startsWith("multi-")){const B=A.replace("multi-",""),V=a.multiSelectFilters.map(P=>P.key===B?{...P,selected:[]}:P);o("update:multiSelectFilters",V)}break}};return(A,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Sf,[e.createElementVNode("div",{class:e.normalizeClass(xt.value)},[t.showSearch?(e.openBlock(),e.createElementBlock("div",Ef,[e.createElementVNode("div",Nf,[e.createVNode(I,{icon:"magnifying-glass",class:e.normalizeClass(kt.value)},null,8,["class"]),e.createElementVNode("input",{"model-value":t.searchQuery,placeholder:t.searchPlaceholder,class:e.normalizeClass(wt.value),onInput:B[0]||(B[0]=V=>A.$emit("update:searchQuery",V.target.value))},null,42,$f),t.searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(Ke.value),onClick:B[1]||(B[1]=V=>A.$emit("update:searchQuery",""))},[e.createVNode(I,{icon:"xmark",class:"w-3 h-3"})],2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.selectFilters,V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:"min-w-36"},[e.createElementVNode("div",zf,[e.createVNode(se,{"model-value":V.value,class:e.normalizeClass(Te.value),onChange:P=>c(V.key,P.target.value)},{default:e.withCtx(()=>[e.createElementVNode("option",Df,e.toDisplayString(V.placeholder||`All ${V.label}`),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.options,P=>(e.openBlock(),e.createElementBlock("option",{key:P.value,value:P.value},e.toDisplayString(P.label),9,Tf))),128))]),_:2},1032,["model-value","class","onChange"]),e.createVNode(I,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])]))),128)),t.showFilters&&t.statusOptions.length>0?(e.openBlock(),e.createElementBlock("div",Af,[e.createElementVNode("div",Ff,[e.createVNode(se,{"model-value":t.selectedStatus,class:e.normalizeClass(Te.value),onChange:B[2]||(B[2]=V=>A.$emit("update:selectedStatus",V.target.value))},{default:e.withCtx(()=>[B[5]||(B[5]=e.createElementVNode("option",{value:""}," All Status ",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.statusOptions,V=>(e.openBlock(),e.createElementBlock("option",{key:V.value,value:V.value},e.toDisplayString(V.label),9,Pf))),128))]),_:1},8,["model-value","class"]),e.createVNode(I,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),t.showFilters&&(t.dateFilters.length>0||H.value)?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(Ce.value),onClick:G},[e.createVNode(I,{icon:"filter",class:"w-4 h-4"}),B[6]||(B[6]=e.createTextVNode(" Filters ",-1)),Ye.value>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(Ct.value)},e.toDisplayString(Ye.value),3)):e.createCommentVNode("",!0),e.createVNode(I,{icon:r.value?"chevron-up":"chevron-down",class:"w-4 h-4 ml-1"},null,8,["icon"])],2)):e.createCommentVNode("",!0),A.$slots.filters?(e.openBlock(),e.createElementBlock("div",Mf,[e.renderSlot(A.$slots,"filters")])):e.createCommentVNode("",!0),e.createElementVNode("div",Lf,[t.showFileUpload?(e.openBlock(),e.createElementBlock("div",jf,[e.createVNode(J,{variant:"default",size:"lg",onClick:v},{default:e.withCtx(()=>[e.createVNode(I,{icon:"upload",class:"w-4 h-4 mr-2"}),B[7]||(B[7]=e.createTextVNode(" Upload Files ",-1))]),_:1})])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createBlock(J,{key:1,class:e.normalizeClass(Qe.value),onClick:Se},{default:e.withCtx(()=>[e.createVNode(I,{icon:"rotate-left",class:"w-4 h-4 mr-2"}),B[8]||(B[8]=e.createTextVNode(" Clear All ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showExport?(e.openBlock(),e.createBlock(J,{key:2,class:e.normalizeClass($.value),onClick:B[3]||(B[3]=V=>A.$emit("export"))},{default:e.withCtx(()=>[e.createVNode(I,{icon:"download",class:"w-4 h-4 mr-2"}),B[9]||(B[9]=e.createTextVNode(" Export ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showAdd&&u.value?(e.openBlock(),e.createElementBlock("div",Of,[i.value?(e.openBlock(),e.createBlock(J,{key:0,variant:t.addButton.variant||"success",size:t.addButton.size||"lg",disabled:p.value||!m.value,title:t.addButton.tooltip,onClick:b},{default:e.withCtx(()=>[t.addButton.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:t.addButton.icon,class:"w-4 h-4 mr-2"},null,8,["icon"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.addButton.label||"Add"),1)]),_:1},8,["variant","size","disabled","title"])):e.renderSlot(A.$slots,"add",{key:1},()=>[e.createVNode(J,{variant:"success",size:"lg",onClick:B[4]||(B[4]=V=>A.$emit("add"))},{default:e.withCtx(()=>[e.createVNode(I,{icon:"plus",class:"w-4 h-4 mr-2"}),B[10]||(B[10]=e.createTextVNode(" Add ",-1))]),_:1})])])):e.createCommentVNode("",!0)])],2),t.showFilters&&r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(Bt.value)},[e.createElementVNode("div",If,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dateFilters,V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:"space-y-3"},[e.createElementVNode("div",_f,[e.createElementVNode("label",{class:e.normalizeClass(ye.value)},e.toDisplayString(V.label),3),e.createElementVNode("span",{class:e.normalizeClass(k(V))},e.toDisplayString(g(V)?"Active":"Inactive"),3)]),e.createElementVNode("div",Rf,[e.createElementVNode("div",Uf,[e.createVNode(I,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.createElementVNode("input",{type:"date","model-value":V.from,class:e.normalizeClass(Be.value),placeholder:`From ${V.label}`,onInput:P=>N(V.key,"from",P.target.value)},null,42,qf)]),e.createElementVNode("span",{class:e.normalizeClass(Ve.value)},"to",2),e.createElementVNode("div",Hf,[e.createVNode(I,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.createElementVNode("input",{type:"date","model-value":V.to,class:e.normalizeClass(Be.value),placeholder:`To ${V.label}`,onInput:P=>N(V.key,"to",P.target.value)},null,42,Wf)]),g(V)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(Xe.value),title:"Clear this filter",onClick:P=>S(V.key)},[e.createVNode(I,{icon:"xmark",class:"w-4 h-4"})],10,Yf)):e.createCommentVNode("",!0)])]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.numberFilters,V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:"space-y-3"},[e.createElementVNode("div",Gf,[e.createElementVNode("label",{class:e.normalizeClass(ye.value)},e.toDisplayString(V.label),3),e.createElementVNode("span",{class:e.normalizeClass(q(V))},e.toDisplayString(F(V)?"Active":"Inactive"),3)]),e.createElementVNode("div",Kf,[e.createElementVNode("div",Xf,[e.createElementVNode("input",{type:"number","model-value":V.min,class:e.normalizeClass(Be.value),placeholder:`Min ${V.label}`,step:V.step||1,onInput:P=>w(V.key,"min",P.target.value)},null,42,Qf)]),e.createElementVNode("span",{class:e.normalizeClass(Ve.value)},"to",2),e.createElementVNode("div",Jf,[e.createElementVNode("input",{type:"number","model-value":V.max,class:e.normalizeClass(Be.value),placeholder:`Max ${V.label}`,step:V.step||1,onInput:P=>w(V.key,"max",P.target.value)},null,42,Zf)]),F(V)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(Xe.value),title:"Clear this filter",onClick:P=>L(V.key)},[e.createVNode(I,{icon:"xmark",class:"w-4 h-4"})],10,ep)):e.createCommentVNode("",!0)])]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.multiSelectFilters,V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:"space-y-3"},[e.createElementVNode("div",tp,[e.createElementVNode("label",{class:e.normalizeClass(ye.value)},e.toDisplayString(V.label),3),e.createElementVNode("span",{class:e.normalizeClass(_(V))},e.toDisplayString(M(V)?`${V.selected.length} selected`:"None"),3)]),e.createElementVNode("div",ap,[e.createVNode(se,{"model-value":"",class:e.normalizeClass(Te.value),onChange:P=>C(V.key,P.target.value)},{default:e.withCtx(()=>[e.createElementVNode("option",np," Select "+e.toDisplayString(V.label),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.options,P=>(e.openBlock(),e.createElementBlock("option",{key:P.value,value:P.value},e.toDisplayString(P.label),9,op))),128))]),_:2},1032,["class","onChange"]),e.createVNode(I,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})]),V.selected.length>0?(e.openBlock(),e.createElementBlock("div",rp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.selected,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"inline-flex items-center gap-1 bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full"},[e.createTextVNode(e.toDisplayString(O(V,P))+" ",1),e.createElementVNode("button",{class:"hover:bg-blue-200 rounded-full p-0.5",onClick:K=>z(V.key,P)},[e.createVNode(I,{icon:"xmark",class:"w-3 h-3"})],8,lp)]))),128))])):e.createCommentVNode("",!0)]))),128))])],2)):e.createCommentVNode("",!0),t.showFilters&&Ge.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(j.value)},[e.createElementVNode("div",sp,[e.createElementVNode("span",{class:e.normalizeClass(R.value)},"Active filters:",2),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:e.normalizeClass(ee.value)},[e.createVNode(I,{icon:V.icon,class:"w-3 h-3"},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(V.label)+": "+e.toDisplayString(V.value),1),e.createElementVNode("button",{class:e.normalizeClass(Y.value),onClick:P=>or(V.key)},[e.createVNode(I,{icon:"xmark",class:"w-3 h-3"})],10,ip)],2))),128))])],2)):e.createCommentVNode("",!0),t.showTableInfo?(e.openBlock(),e.createElementBlock("div",cp,[e.createElementVNode("div",dp,[e.createElementVNode("div",up,[e.createElementVNode("span",mp,[e.createElementVNode("span",fp,e.toDisplayString(t.totalItems||0),1),e.createTextVNode(" "+e.toDisplayString(t.itemLabel||"items")+" found ",1)])])])])):e.createCommentVNode("",!0)]),t.showFileUpload&&l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-4",onClick:e.withModifiers(h,["self"])},[e.createElementVNode("div",pp,[e.createElementVNode("div",gp,[B[11]||(B[11]=e.createElementVNode("h3",{class:"text-lg font-semibold text-gray-900"}," Upload Files ",-1)),e.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 p-2 hover:bg-gray-100 rounded-full transition-all",onClick:h},[e.createVNode(I,{icon:"xmark",class:"w-5 h-5"})])]),e.createVNode(pa,{multiple:t.fileUploadMultiple,accept:t.fileUploadAccept,"max-size":t.fileUploadMaxSize,variant:t.fileUploadVariant,onFilesSelected:E,onFileRemoved:y},null,8,["multiple","accept","max-size","variant"]),e.createElementVNode("div",vp,[e.createVNode(J,{variant:"default",onClick:h},{default:e.withCtx(()=>[...B[12]||(B[12]=[e.createTextVNode(" Close ",-1)])]),_:1})])])])):e.createCommentVNode("",!0)],64))}},hp={class:"flex items-center gap-3"},bp={key:0,class:"flex items-center gap-3"},yp={class:"text-sm text-slate-600"},xp={class:"flex items-center gap-2"},kp={class:"flex items-center gap-3"},wp=["title","onClick"],Cp={key:1,class:"relative"},Bp={class:"p-3"},Vp={class:"space-y-1"},Sp={class:"flex items-center gap-2 cursor-pointer w-full"},Ep=["checked","onChange"],Np=["disabled"],$p={key:3,class:"flex items-center gap-2"},zp=[{key:"delete",label:"Delete",icon:{template:'<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" /></svg>'},variant:"danger"},{key:"edit",label:"Edit",icon:{template:'<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" /></svg>'},variant:"primary"}],Dp={name:"DataTableToolBar"},Wo=Object.assign(Dp,{props:{selectedItems:{type:Array,default:()=>[]},totalItems:{type:Number,default:0},bulkActions:{type:Array,default:()=>zp},showDensityToggle:{type:Boolean,default:!0},showColumnToggle:{type:Boolean,default:!0},showRefresh:{type:Boolean,default:!0},isRefreshing:{type:Boolean,default:!1},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},toggleableColumns:{type:Array,default:()=>[]},visibleColumns:{type:Array,default:()=>[]},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["bulk-action","update:density","toggle-column","refresh"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(null),i=e.ref(null),u=e.computed(()=>a.selectedItems.length),m=[{value:"compact",label:"Compact",icon:["fas","minus"]},{value:"normal",label:"Normal",icon:["fas","bars"]},{value:"comfortable",label:"Comfortable",icon:["fas","bars-staggered"]}],p=T.cva("flex items-center justify-between border-b border-slate-200",{variants:{variant:{default:"bg-white",minimal:"bg-transparent border-slate-100",bordered:"bg-slate-50 border-slate-300"},padding:{compact:"p-2",normal:"p-4",comfortable:"p-6"}},defaultVariants:{variant:"default",padding:"normal"}}),v=T.cva("px-3 py-1.5 text-sm font-medium rounded-md flex items-center gap-1 transition-colors",{variants:{variant:{danger:"text-red-700 bg-red-500 hover:bg-red-400 border border-red-200",primary:"text-blue-700 bg-blue-50 hover:bg-blue-100 border border-blue-200",secondary:"text-slate-700 bg-slate-500 hover:bg-slate-400 border border-slate-200"}},defaultVariants:{variant:"secondary"}}),h=T.cva("p-2 border border-slate-300 transition-colors",{variants:{active:{true:"bg-blue-50 text-blue-600 border-blue-300",false:"bg-white text-slate-600 hover:bg-slate-50"},position:{first:"rounded-l-md border-r-0",middle:"border-x-0",last:"rounded-r-md border-l-0"}},defaultVariants:{active:!1,position:"middle"}}),E=T.cva("px-3 py-2 text-sm border border-slate-300 rounded-md flex items-center gap-2 transition-colors",{variants:{state:{normal:"text-slate-600 hover:text-slate-800 hover:bg-slate-50",refreshing:"text-slate-600 opacity-75 cursor-not-allowed"}},defaultVariants:{state:"normal"}}),y=e.computed(()=>x(p({variant:a.variant,padding:a.padding}))),b=e.computed(()=>"text-sm text-slate-600"),f=e.computed(()=>"flex items-center"),d=e.computed(()=>"flex items-center gap-2 px-3 py-2 text-sm text-slate-600 hover:text-slate-800 border border-slate-300 rounded-md hover:bg-slate-50 transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1"),s=e.computed(()=>"absolute right-0 top-full mt-1 w-56 bg-white border border-slate-200 rounded-lg shadow-lg z-50 max-h-64 overflow-y-auto"),c=e.computed(()=>"text-xs font-medium text-slate-500 uppercase tracking-wider mb-2 border-b border-slate-100 pb-2"),g=e.computed(()=>"py-1 hover:bg-slate-50 rounded transition-colors"),S=e.computed(()=>"w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500 focus:ring-2 focus:ring-offset-1"),k=e.computed(()=>"text-sm text-slate-700 flex-1 select-none"),N=z=>{l.value&&i.value&&!l.value.contains(z.target)&&!i.value.contains(z.target)&&(r.value=!1)},F=()=>{r.value=!r.value},L=z=>x(v({variant:z.variant||"secondary"})),q=z=>{let O="middle";return z==="compact"?O="first":z==="comfortable"&&(O="last"),x(h({active:a.density===z,position:O}))},w=()=>x(E({state:a.isRefreshing?"refreshing":"normal"})),M=()=>x("w-4 h-4",{"animate-spin":a.isRefreshing}),_=z=>a.visibleColumns.includes(z),C=(z,O)=>{o("toggle-column",{column:z,visible:O})};return e.onMounted(()=>{document.addEventListener("click",N)}),e.onUnmounted(()=>{document.removeEventListener("click",N)}),(z,O)=>{const G=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(y.value)},[e.createElementVNode("div",hp,[u.value>0?(e.openBlock(),e.createElementBlock("div",bp,[e.createElementVNode("span",yp,e.toDisplayString(u.value)+" selected ",1),e.createElementVNode("div",xp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bulkActions,H=>(e.openBlock(),e.createBlock(J,{key:H.key,class:e.normalizeClass(L(H)),onClick:oe=>z.$emit("bulk-action",{action:H.key,items:t.selectedItems})},{default:e.withCtx(()=>[H.icon?(e.openBlock(),e.createBlock(G,{key:0,icon:H.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(H.label),1)]),_:2},1032,["class","onClick"]))),128))])])):t.totalItems>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(b.value)},e.toDisplayString(t.totalItems)+" "+e.toDisplayString(t.totalItems===1?"item":"items"),3)):e.createCommentVNode("",!0)]),e.createElementVNode("div",kp,[t.showDensityToggle?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(f.value)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(m,H=>e.createElementVNode("button",{key:H.value,class:e.normalizeClass(q(H.value)),title:H.label,type:"button",onClick:oe=>z.$emit("update:density",H.value)},[e.createVNode(G,{icon:H.icon,class:"w-4 h-4"},null,8,["icon"])],10,wp)),64))],2)):e.createCommentVNode("",!0),t.showColumnToggle?(e.openBlock(),e.createElementBlock("div",Cp,[e.createElementVNode("button",{ref_key:"columnToggleButton",ref:l,class:e.normalizeClass(d.value),type:"button",onClick:e.withModifiers(F,["stop"])},[e.createVNode(G,{icon:"columns",class:"w-4 h-4"}),O[2]||(O[2]=e.createElementVNode("span",null,"Columns",-1))],2),e.withDirectives(e.createElementVNode("div",{ref_key:"columnMenu",ref:i,class:e.normalizeClass(s.value),onClick:O[0]||(O[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Bp,[e.createElementVNode("div",{class:e.normalizeClass(c.value)}," Show Columns ",2),e.createElementVNode("div",Vp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.toggleableColumns,H=>(e.openBlock(),e.createElementBlock("div",{key:H.key,class:e.normalizeClass(g.value)},[e.createElementVNode("label",Sp,[e.createElementVNode("input",{type:"checkbox",checked:_(H.key),class:e.normalizeClass(S.value),onChange:oe=>C(H.key,oe.target.checked)},null,42,Ep),e.createElementVNode("span",{class:e.normalizeClass(k.value)},e.toDisplayString(H.label),3)])],2))),128))])])],2),[[e.vShow,r.value]])])):e.createCommentVNode("",!0),t.showRefresh?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.isRefreshing,class:e.normalizeClass(w()),type:"button",onClick:O[1]||(O[1]=H=>z.$emit("refresh"))},[e.createVNode(G,{icon:"sync",class:e.normalizeClass(M())},null,8,["class"]),O[3]||(O[3]=e.createElementVNode("span",null,"Refresh",-1))],10,Np)):e.createCommentVNode("",!0),z.$slots.actions?(e.openBlock(),e.createElementBlock("div",$p,[e.renderSlot(z.$slots,"actions")])):e.createCommentVNode("",!0)])],2)}}}),Tp={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12"},Ap={class:"grid grid-cols-1 md:grid-cols-4 gap-8"},Fp={class:"col-span-1 md:col-span-2"},Pp={class:"space-y-2"},Mp={class:"flex space-x-4"},Lp={class:"flex flex-col md:flex-row justify-between items-center"},jp={class:"flex space-x-6 mt-4 md:mt-0"},Yo={__name:"Footer",props:{className:{type:String,default:""}},setup(t){return(n,a)=>{const o=e.resolveComponent("Logo"),r=e.resolveComponent("Text"),l=e.resolveComponent("Typography"),i=e.resolveComponent("Link"),u=e.resolveComponent("Icon"),m=e.resolveComponent("Divider");return e.openBlock(),e.createElementBlock("footer",{class:e.normalizeClass(e.unref(x)("bg-gray-50 border-t border-gray-200",t.className))},[e.createElementVNode("div",Tp,[e.createElementVNode("div",Ap,[e.createElementVNode("div",Fp,[e.renderSlot(n.$slots,"brand",{},()=>[e.createVNode(o,{class:"mb-4"}),e.createVNode(r,{class:"text-gray-600 max-w-md"},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode(" Building beautiful applications with modern Vue.js components. ",-1)])]),_:1})])]),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"links",{},()=>[e.createVNode(l,{variant:"h6",class:"mb-4"},{default:e.withCtx(()=>[...a[1]||(a[1]=[e.createTextVNode(" Quick Links ",-1)])]),_:1}),e.createElementVNode("div",Pp,[e.createVNode(i,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[2]||(a[2]=[e.createTextVNode(" About ",-1)])]),_:1}),e.createVNode(i,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[3]||(a[3]=[e.createTextVNode(" Services ",-1)])]),_:1}),e.createVNode(i,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[4]||(a[4]=[e.createTextVNode(" Contact ",-1)])]),_:1})])])]),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"social",{},()=>[e.createVNode(l,{variant:"h6",class:"mb-4"},{default:e.withCtx(()=>[...a[5]||(a[5]=[e.createTextVNode(" Follow Us ",-1)])]),_:1}),e.createElementVNode("div",Mp,[e.createVNode(i,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[e.createVNode(u,{name:"twitter",class:"h-5 w-5"})]),_:1}),e.createVNode(i,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[e.createVNode(u,{name:"github",class:"h-5 w-5"})]),_:1})])])])]),e.createVNode(m,{class:"my-8"}),e.createElementVNode("div",Lp,[e.renderSlot(n.$slots,"copyright",{},()=>[e.createVNode(r,{class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(" © "+e.toDisplayString(new Date().getFullYear())+" Your Company. All rights reserved. ",1)]),_:1})]),e.renderSlot(n.$slots,"legal",{},()=>[e.createElementVNode("div",jp,[e.createVNode(i,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[6]||(a[6]=[e.createTextVNode(" Privacy ",-1)])]),_:1}),e.createVNode(i,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[7]||(a[7]=[e.createTextVNode(" Terms ",-1)])]),_:1})])])])])],2)}}},Op={class:"flex items-center justify-between h-16 px-4 md:px-6"},Ip={class:"flex items-center"},_p={key:0,class:"mr-4 flex-shrink-0 bg-gradient-to-r from-blue-50 to-indigo-50 px-3 py-2 rounded-lg border border-blue-100 flex items-center gap-3 relative"},Rp={key:0,class:"flex-shrink-0"},Up=["src"],qp={key:1,class:"flex-shrink-0"},Hp=["src","alt"],Wp={class:"min-w-0"},Yp={class:"text-lg font-bold text-blue-900 truncate max-w-[200px]"},Gp={key:0,class:"text-xs text-blue-600 truncate font-medium"},Kp={class:"w-4 h-4 text-blue-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Xp=["d"],Qp={key:3,class:"min-w-0"},Jp={class:"text-lg font-bold text-blue-900 truncate max-w-[200px]"},Zp={key:0,class:"text-xs text-blue-600 truncate font-medium"},eg={key:0,class:"absolute top-full left-0 mt-2 w-80 bg-white rounded-lg shadow-lg border border-gray-200 z-50 max-h-96 overflow-y-auto"},tg={class:"py-2"},ag=["onClick"],ng={key:0,class:"flex-shrink-0 mr-3"},og=["src","alt"],rg={class:"flex-1 text-left min-w-0"},lg={class:"font-medium truncate"},sg={key:0,class:"text-xs text-gray-500 truncate"},ig={key:1,class:"w-4 h-4 text-blue-500 flex-shrink-0 ml-2",fill:"currentColor",viewBox:"0 0 20 20"},cg={class:"hidden md:flex items-center space-x-2 text-sm truncate"},dg={class:"text-gray-500 truncate"},ug={class:"text-gray-900 font-medium truncate"},mg={class:"flex items-center space-x-3 md:space-x-4"},fg={key:1,class:"relative"},pg={key:0,class:"absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white text-xs rounded-full flex items-center justify-center"},gg={key:0,class:"absolute right-4 md:right-6 top-16 mt-2 w-72 md:w-80 bg-white rounded-lg shadow-lg border border-gray-200 z-50"},vg={class:"max-h-96 overflow-y-auto"},hg={class:"flex items-start space-x-3"},bg={class:"flex-1"},yg={class:"text-sm text-gray-900"},xg={class:"text-xs text-gray-500 mt-1"},kg={class:"relative"},wg={class:"w-8 h-8 bg-gradient-to-br from-blue-100 to-indigo-100 rounded-full flex items-center justify-center transition-colors shadow-sm"},Cg={class:"text-blue-700 text-sm font-medium"},Bg={class:"hidden md:block text-left max-w-[160px] truncate"},Vg={class:"text-sm font-medium text-gray-900 truncate"},Sg={class:"text-xs text-gray-500 truncate leading-tight"},Eg={key:0,class:"absolute right-0 mt-2 w-58 bg-white rounded-lg shadow-lg border border-gray-200 z-50"},Ng={class:"p-4 border-b border-gray-200"},$g={class:"text-sm font-medium text-gray-900"},zg={class:"text-xs text-gray-500"},Dg={class:"py-2"},Tg={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Ag=["onClick"],Fg={class:"flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2 bg-gray-100 text-gray-600 group-hover:bg-gray-200"},Pg={class:"flex-1 truncate font-semibold text-gray-700"},Go={__name:"Header",props:{sidebarWidth:{type:Number,default:256},currentSection:{type:String,default:"Dashboard"},currentPage:{type:String,default:"Overview"},currentRoute:{type:String,default:""},user:{type:Object,required:!0},notifications:{type:Array,default:()=>[]},profileMenuItems:{type:Array,required:!0},mobileOpen:{type:Boolean,default:!1},currentOrganisation:{type:Object,default:null},companyLogo:{type:String,default:""},organisationLogo:{type:String,default:""},organisations:{type:Array,default:()=>[]}},emits:["search","profile-action","logout","navigate","toggle-mobile-sidebar","organisation-change"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),l=e.ref(!1),i=e.ref(!1),u=e.ref(a.notifications.length),m=e.ref(!1),p=e.ref(!1),v=e.ref(!1),h=e.computed(()=>(a.user?.name||"Guest").split(" ").map(L=>L[0]||"").join("").toUpperCase()),E=e.computed(()=>a.user?.roles?.length?a.user.roles.map(F=>F.name).join(", "):"No role"),y=()=>{l.value=!l.value,i.value=!1},b=()=>{i.value=!i.value,l.value=!1,v.value=!1},f=()=>{v.value=!v.value,i.value=!1,l.value=!1},d=F=>{o("navigate",F),i.value=!1},s=F=>F.route?!!(a.currentRoute===F.route||a.currentRoute.startsWith(F.route+"/")):!1,c=F=>{o("profile-action",F),i.value=!1},g=()=>{o("logout"),i.value=!1},S=F=>{o("organisation-change",F),v.value=!1},k=F=>{!F.target.closest(".absolute")&&!F.target.closest("button")&&(l.value=!1,i.value=!1,v.value=!1)},N=()=>{p.value=window.innerWidth<768};return e.onMounted(()=>{document.addEventListener("click",k),N(),window.addEventListener("resize",N)}),e.onUnmounted(()=>{document.removeEventListener("click",k),window.removeEventListener("resize",N)}),e.watch(r,F=>o("search",F)),(F,L)=>{const q=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("header",{class:e.normalizeClass(e.unref(x)("fixed top-0 z-50 bg-white border-b border-gray-200 transition-all duration-300 ease-in-out w-full")),style:{left:"0"}},[e.createElementVNode("div",Op,[e.createElementVNode("div",Ip,[t.currentOrganisation?(e.openBlock(),e.createElementBlock("div",_p,[t.companyLogo?(e.openBlock(),e.createElementBlock("div",Rp,[e.createElementVNode("img",{src:t.companyLogo,alt:"Company logo",class:"w-6 h-6 object-contain rounded"},null,8,Up)])):e.createCommentVNode("",!0),t.organisationLogo?(e.openBlock(),e.createElementBlock("div",qp,[e.createElementVNode("img",{src:t.organisationLogo,alt:`${t.currentOrganisation.organisation_name} logo`,class:"w-8 h-8 object-contain rounded border border-blue-200"},null,8,Hp)])):e.createCommentVNode("",!0),t.organisations.length>1?(e.openBlock(),e.createElementBlock("button",{key:2,class:"flex items-center gap-2 min-w-0 cursor-pointer hover:bg-blue-100/50 rounded-md px-2 py-1 transition-colors",onClick:f},[e.createElementVNode("div",Wp,[e.createElementVNode("p",Yp,e.toDisplayString(t.currentOrganisation.organisation_name),1),t.currentOrganisation.role?(e.openBlock(),e.createElementBlock("p",Gp,e.toDisplayString(t.currentOrganisation.role),1)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createElementBlock("svg",Kp,[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:v.value?"m5 15 7-7 7 7":"m19 9-7 7-7-7"},null,8,Xp)]))])):(e.openBlock(),e.createElementBlock("div",Qp,[e.createElementVNode("p",Jp,e.toDisplayString(t.currentOrganisation.organisation_name),1),t.currentOrganisation.role?(e.openBlock(),e.createElementBlock("p",Zp,e.toDisplayString(t.currentOrganisation.role),1)):e.createCommentVNode("",!0)])),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[v.value?(e.openBlock(),e.createElementBlock("div",eg,[L[5]||(L[5]=e.createElementVNode("div",{class:"p-3 border-b border-gray-200"},[e.createElementVNode("h3",{class:"text-sm font-semibold text-gray-900"}," Switch Organisation "),e.createElementVNode("p",{class:"text-xs text-gray-500 mt-1"}," Select an organisation to view its data ")],-1)),e.createElementVNode("div",tg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.organisations,w=>(e.openBlock(),e.createElementBlock("button",{key:w.org_id||w.organisation_name,class:e.normalizeClass(e.unref(x)("flex items-center w-full px-3 py-2.5 text-sm transition-colors",w.org_id===t.currentOrganisation?.org_id?"bg-blue-50 text-blue-700 border-l-4 border-blue-500":"text-gray-700 hover:bg-gray-50")),onClick:M=>S(w)},[w.logo?(e.openBlock(),e.createElementBlock("div",ng,[e.createElementVNode("img",{src:w.logo,alt:`${w.organisation_name} logo`,class:"w-6 h-6 object-contain rounded"},null,8,og)])):e.createCommentVNode("",!0),e.createElementVNode("div",rg,[e.createElementVNode("p",lg,e.toDisplayString(w.organisation_name),1),w.role?(e.openBlock(),e.createElementBlock("p",sg,e.toDisplayString(w.role),1)):e.createCommentVNode("",!0)]),w.org_id===t.currentOrganisation?.org_id?(e.openBlock(),e.createElementBlock("svg",ig,[...L[4]||(L[4]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 01 1.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)],10,ag))),128))])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("nav",cg,[e.createElementVNode("span",dg,e.toDisplayString(t.currentSection),1),L[6]||(L[6]=e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)),e.createElementVNode("span",ug,e.toDisplayString(t.currentPage),1)])]),e.createElementVNode("div",mg,[p.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:L[0]||(L[0]=w=>o("toggle-mobile-sidebar"))},[...L[7]||(L[7]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])])):e.createCommentVNode("",!0),!p.value||m.value?(e.openBlock(),e.createElementBlock("div",fg,[L[8]||(L[8]=e.createElementVNode("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})])],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":L[1]||(L[1]=w=>r.value=w),type:"text",placeholder:"Search...",class:"pl-10 pr-4 py-2 w-48 md:w-64 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none"},null,512),[[e.vModelText,r.value]]),p.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",onClick:L[2]||(L[2]=w=>m.value=!1)}," ✕ ")):e.createCommentVNode("",!0)])):p.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:L[3]||(L[3]=w=>m.value=!0)},[...L[9]||(L[9]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"relative p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:y},[L[10]||(L[10]=e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 17h5l-5 5v-5z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 3h2.586a1 1 0 01.707.293l6.414 6.414a1 1 0 01.293.707V19a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h4L13 3z"})],-1)),u.value>0?(e.openBlock(),e.createElementBlock("span",pg,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",gg,[L[12]||(L[12]=e.createElementVNode("div",{class:"p-4 border-b border-gray-200"},[e.createElementVNode("h3",{class:"text-lg font-semibold text-gray-900"}," Notifications ")],-1)),e.createElementVNode("div",vg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.notifications,w=>(e.openBlock(),e.createElementBlock("div",{key:w.id,class:"p-4 border-b border-gray-100 hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",hg,[L[11]||(L[11]=e.createElementVNode("div",{class:"flex-shrink-0 w-2 h-2 mt-2 bg-blue-500 rounded-full"},null,-1)),e.createElementVNode("div",bg,[e.createElementVNode("p",yg,e.toDisplayString(w.title),1),e.createElementVNode("p",xg,e.toDisplayString(w.time),1)])])]))),128))]),L[13]||(L[13]=e.createElementVNode("div",{class:"p-4 text-center"},[e.createElementVNode("button",{class:"text-sm text-blue-600 hover:text-blue-800"}," View all notifications ")],-1))])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",kg,[e.createElementVNode("button",{class:"flex items-center space-x-2 md:space-x-3 p-2 rounded-lg hover:bg-gray-50 transition-colors",onClick:b},[e.createElementVNode("div",wg,[e.createElementVNode("span",Cg,e.toDisplayString(h.value),1)]),e.createElementVNode("div",Bg,[e.createElementVNode("p",Vg,e.toDisplayString(t.user.name),1),e.createElementVNode("p",Sg,e.toDisplayString(E.value),1)]),L[14]||(L[14]=e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",Eg,[e.createElementVNode("div",Ng,[e.createElementVNode("p",$g,e.toDisplayString(t.user.name),1),e.createElementVNode("p",zg,e.toDisplayString(t.user.email),1)]),e.createElementVNode("div",Dg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.profileMenuItems,w=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w.name},[w.route?(e.openBlock(),e.createBlock(q,{key:0,to:w.route,class:e.normalizeClass(e.unref(x)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",s(w)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:M=>d(w)},{default:e.withCtx(()=>[s(w)?(e.openBlock(),e.createElementBlock("div",Tg)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2",s(w)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[w.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:w.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("flex-1 truncate font-semibold",s(w)?"text-blue-700":"text-gray-700"))},e.toDisplayString(w.label),3)]),_:2},1032,["to","class","onClick"])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"flex items-center w-full px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent",onClick:M=>c(w)},[e.createElementVNode("div",Fg,[w.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:w.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Pg,e.toDisplayString(w.label),1)],8,Ag))],64))),128))]),e.createElementVNode("div",{class:"border-t border-gray-200 py-2"},[e.createElementVNode("button",{class:"flex items-center w-full px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative text-red-600 hover:bg-red-50 border border-transparent",onClick:g},[...L[15]||(L[15]=[e.createElementVNode("div",{class:"flex items-center justify-center w-8 h-8 rounded-lg mr-1 flex-shrink-0 transition-colors ml-2 bg-red-100 text-red-600 group-hover:bg-red-200"},[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a2 2 0 013-3h4a3 3 0 013 3v1"})])],-1),e.createElementVNode("span",{class:"truncate font-semibold text-red-600"}," Sign out ",-1)])])])])):e.createCommentVNode("",!0)]),_:1})])])])],2)}}},Mg={class:"relative"},Lg=["id","disabled"],jg={key:0,class:"text-gray-500"},Og={key:1,class:"flex flex-wrap gap-1.5"},Ig={class:"px-3 py-2.5 border-b border-gray-200 bg-gray-50"},_g={key:0,class:"max-h-52 overflow-y-auto py-1"},Rg=["onClick"],Ug={class:"flex items-center gap-3"},qg=["checked"],Hg={key:1,class:"px-4 py-6 text-sm text-gray-500 text-center"},Ko={__name:"MultiSelect",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,required:!0,validator:t=>t.every(n=>n.value!==void 0&&n.label)},id:{type:String,default:null},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:"Select options"},hasError:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(""),i=e.ref(null),u=e.ref([...a.options]),m=e.ref(null),p=e.ref({}),v=e.computed(()=>a.options.filter(s=>a.modelValue.includes(s.value)).map(s=>s.label)),h=()=>{if(!m.value)return;const s=m.value.getBoundingClientRect(),c=window.innerHeight,g=c-s.bottom,S=320;g<S&&s.top>S?p.value={position:"fixed",bottom:`${c-s.top+4}px`,left:`${s.left}px`,width:`${s.width}px`,zIndex:9999}:p.value={position:"fixed",top:`${s.bottom+4}px`,left:`${s.left}px`,width:`${s.width}px`,zIndex:9999}},E=()=>{a.disabled||(r.value=!r.value,r.value?(h(),e.nextTick(()=>{i.value?.focus()})):(l.value="",u.value=[...a.options]))},y=s=>{let c;a.modelValue.includes(s)?c=a.modelValue.filter(g=>g!==s):c=[...a.modelValue,s],o("update:modelValue",c)},b=()=>{if(!l.value.trim())u.value=[...a.options];else{const s=l.value.toLowerCase();u.value=a.options.filter(c=>c.label.toLowerCase().includes(s))}},f=s=>{s.key==="Escape"&&(r.value=!1,l.value="",u.value=[...a.options])},d=s=>{if(!m.value)return;const c=s.target;c&&!m.value.contains(c)&&!c.closest("[data-multiselect-dropdown]")&&(r.value=!1,l.value="",u.value=[...a.options])};return e.onMounted(()=>{document.addEventListener("click",d),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),e.onUnmounted(()=>{document.removeEventListener("click",d),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),e.watch(()=>a.options,s=>{u.value=[...s]},{immediate:!0}),e.watch(r,s=>{s&&h()}),(s,c)=>(e.openBlock(),e.createElementBlock("div",Mg,[e.createElementVNode("button",{id:t.id,ref_key:"buttonRef",ref:m,type:"button",disabled:t.disabled,class:e.normalizeClass(["w-full px-3 py-2.5 text-left border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white min-h-[42px]",t.hasError?"border-red-500":"border-slate-300",t.disabled?"bg-gray-100 cursor-not-allowed opacity-50":"hover:border-slate-400"]),onClick:E,onKeydown:f},[v.value.length===0?(e.openBlock(),e.createElementBlock("div",jg,e.toDisplayString(t.placeholder||"Select options"),1)):(e.openBlock(),e.createElementBlock("div",Og,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,g=>(e.openBlock(),e.createBlock(da,{key:g,variant:"primary",size:"sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g),1)]),_:2},1024))),128))])),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["absolute right-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400 pointer-events-none transition-transform duration-200",{"rotate-180":r.value}]),fill:"currentColor",viewBox:"0 0 20 20"},[...c[2]||(c[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],42,Lg),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(p.value),"data-multiselect-dropdown":"",class:"bg-white shadow-lg max-h-72 rounded-md text-base ring-1 ring-black ring-opacity-5 overflow-hidden focus:outline-none"},[e.createElementVNode("div",Ig,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:i,"onUpdate:modelValue":c[0]||(c[0]=g=>l.value=g),type:"text",placeholder:"Search options...",class:"w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white",onInput:b,onKeydown:c[1]||(c[1]=e.withModifiers(()=>{},["stop"]))},null,544),[[e.vModelText,l.value]])]),u.value.length>0?(e.openBlock(),e.createElementBlock("div",_g,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,type:"button",class:e.normalizeClass(["cursor-pointer select-none relative py-2.5 pl-3 pr-9 w-full text-left hover:bg-blue-50 focus:bg-blue-50 focus:outline-none transition-colors duration-150",{"bg-blue-50":t.modelValue.includes(g.value)}]),onClick:S=>y(g.value)},[e.createElementVNode("div",Ug,[e.createElementVNode("input",{type:"checkbox",checked:t.modelValue.includes(g.value),class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded cursor-pointer pointer-events-none",readonly:"",tabindex:"-1"},null,8,qg),e.createElementVNode("span",{class:e.normalizeClass(["block font-normal truncate",{"text-blue-900 font-medium":t.modelValue.includes(g.value)}])},e.toDisplayString(g.label),3)])],10,Rg))),128))])):(e.openBlock(),e.createElementBlock("div",Hg," No options found "))],4)):e.createCommentVNode("",!0)]),_:1})]))]))}},Wg={class:"mb-6"},Yg={class:"text-xl font-semibold text-gray-900"},Gg={class:"text-sm text-gray-600 mt-1"},Kg=["onUpdate:modelValue"],Xg={key:5,class:"flex items-center"},Qg={key:6,class:"flex items-center"},Jg=["id","aria-checked","disabled","onClick"],Zg={key:7,class:"space-y-2"},ev={key:8,class:"space-y-2"},tv={key:0,class:"text-xs text-gray-500"},av={key:10,class:"space-y-2"},nv={class:"flex items-center gap-4"},ov={class:"text-sm font-medium text-gray-700 min-w-[3rem] text-right"},rv={class:"flex justify-end gap-3 pt-6"},Xo={__name:"ReusableFormModal",props:{modelValue:{type:Boolean,default:!1},modalType:{type:String,required:!0,validator:t=>["create","edit"].includes(t)},entityName:{type:String,default:"Item"},fields:{type:Array,required:!0,validator:t=>t.every(n=>n.name&&n.label&&n.type&&["text","number","password","textarea","select","checkbox","slider","date","color","email","tel","url","time","datetime-local","month","week","file","radio","switch","range","search","hidden","multiselect","combobox"].includes(n.type))},initialData:{type:Object,default:null},loading:{type:Boolean,default:!1},customValidation:{type:Function,default:null},modalSize:{type:String,default:"4xl",validator:t=>["sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","full"].includes(t)},modalHeight:{type:String,default:"auto"},modalResizable:{type:Boolean,default:!1}},emits:["update:modelValue","submit","close"],setup(t,{emit:n}){const a=t,o=n,r=e.computed({get:()=>a.modelValue,set:d=>o("update:modelValue",d)}),l=e.computed(()=>a.loading),i=e.ref({}),u=e.ref({}),m=e.ref(!1),p=()=>{const d={};return a.fields.forEach(s=>{s.type==="checkbox"||s.type==="switch"?d[s.name]=!1:s.type==="number"||s.type==="slider"||s.type==="range"?d[s.name]=s.min!==void 0?s.min:0:s.type==="file"?d[s.name]=null:s.type==="radio"?d[s.name]=s.options?.[0]?.value||"":s.type==="multiselect"?d[s.name]=[]:(s.type,d[s.name]="")}),d};e.watch(()=>a.initialData,d=>{if(a.modalType==="edit"&&d){const s={};a.fields.forEach(c=>{c.type==="checkbox"||c.type==="switch"?s[c.name]=d[c.name]??!1:c.type==="number"||c.type==="slider"||c.type==="range"?s[c.name]=d[c.name]??(c.min!==void 0?c.min:0):c.type==="file"?s[c.name]=null:c.type==="multiselect"?s[c.name]=Array.isArray(d[c.name])?d[c.name]:[]:(c.type,s[c.name]=d[c.name]??"")}),i.value=s,m.value=!0}else if(a.modalType==="create"&&d&&!m.value){const s={};a.fields.forEach(c=>{d[c.name]!==void 0&&d[c.name]!==null?s[c.name]=d[c.name]:c.type==="checkbox"||c.type==="switch"?s[c.name]=!1:c.type==="number"||c.type==="slider"||c.type==="range"?s[c.name]=c.min!==void 0?c.min:0:c.type==="file"?s[c.name]=null:c.type==="radio"?s[c.name]=c.options?.[0]?.value||"":c.type==="multiselect"?s[c.name]=[]:(c.type,s[c.name]="")}),i.value=s,m.value=!0}else a.modalType==="create"&&!d&&(i.value=p(),m.value=!1)},{immediate:!0,deep:!0}),e.watch(()=>a.modelValue,d=>{if(d&&(u.value={},a.modalType==="create")){if(m.value=!1,a.initialData){const s={};a.fields.forEach(c=>{a.initialData[c.name]!==void 0&&a.initialData[c.name]!==null?s[c.name]=a.initialData[c.name]:c.type==="checkbox"||c.type==="switch"?s[c.name]=!1:c.type==="number"||c.type==="slider"||c.type==="range"?s[c.name]=c.min!==void 0?c.min:0:c.type==="file"?s[c.name]=null:c.type==="radio"?s[c.name]=c.options?.[0]?.value||"":c.type==="multiselect"?s[c.name]=[]:(c.type,s[c.name]="")}),i.value=s}else i.value=p();m.value=!0}}),e.watch(()=>a.initialData,d=>{m.value&&d&&Object.keys(d).forEach(s=>{Object.prototype.hasOwnProperty.call(i.value,s)&&d[s]!==void 0&&d[s]!==null&&(i.value[s]=d[s])})},{deep:!0});const v=()=>{if(u.value={},a.fields.forEach(d=>{if(d.required&&!d.disabled&&d.type!=="hidden"){const s=i.value[d.name];d.type==="checkbox"||d.type==="switch"?d.required&&!s&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="number"||d.type==="slider"||d.type==="range"?s===""||s===null||s===void 0?u.value[d.name]=d.errorMessage||`${d.label} is required`:d.min!==void 0&&Number(s)<d.min?u.value[d.name]=`${d.label} must be at least ${d.min}`:d.max!==void 0&&Number(s)>d.max&&(u.value[d.name]=`${d.label} must be at most ${d.max}`):d.type==="email"?!s||!s.trim()?u.value[d.name]=d.errorMessage||`${d.label} is required`:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)||(u.value[d.name]="Please enter a valid email address"):d.type==="url"?!s||!s.trim()?u.value[d.name]=d.errorMessage||`${d.label} is required`:/^https?:\/\/.+/.test(s)||(u.value[d.name]="Please enter a valid URL"):d.type==="tel"?(!s||!s.trim())&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="file"?s||(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="radio"?s||(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="multiselect"?(!Array.isArray(s)||s.length===0)&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="combobox"?(!s||typeof s=="string"&&!s.trim())&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="date"||d.type==="time"||d.type==="datetime-local"||d.type==="month"||d.type==="week"?(!s||typeof s=="string"&&!s.trim())&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):d.type==="password"?(!s||typeof s=="string"&&!s.trim())&&(u.value[d.name]=d.errorMessage||`${d.label} is required`):(!s||typeof s=="string"&&!s.trim())&&(u.value[d.name]=d.errorMessage||`${d.label} is required`)}if(d.validate&&typeof d.validate=="function"){const s=d.validate(i.value[d.name],i.value);s&&(u.value[d.name]=s)}}),a.customValidation){const d=a.customValidation(i.value);d&&Object.keys(d).length>0&&(u.value={...u.value,...d})}return Object.keys(u.value).length===0},h=async(d,s)=>{if(i.value[d.name]=s,d.onChange&&typeof d.onChange=="function")try{await d.onChange(s,i.value)}catch(c){console.error("Error in onChange handler:",c),ae.error("An error occurred while processing the change")}},E=(d,s)=>{if(i.value[d.name]=s,d.onChange&&typeof d.onChange=="function")try{d.onChange(s,i.value)}catch(c){console.error("Error in onChange handler:",c),ae.error("An error occurred while processing the change")}},y=(d,s)=>{const c=s.target.files?.[0]||null;if(i.value[d.name]=c,d.onChange&&typeof d.onChange=="function")try{d.onChange(c,i.value)}catch(g){console.error("Error in onChange handler:",g),ae.error("An error occurred while processing the file")}},b=async()=>{try{if(!v()){ae.error("Please fix the validation errors before submitting");return}const d={};a.fields.forEach(s=>{const c=i.value[s.name];s.type==="number"||s.type==="slider"||s.type==="range"?d[s.name]=Number(c):s.type==="text"||s.type==="textarea"||s.type==="date"||s.type==="email"||s.type==="url"||s.type==="tel"||s.type==="search"||s.type==="time"||s.type==="datetime-local"||s.type==="month"||s.type==="week"?d[s.name]=typeof c=="string"?c.trim():c:(s.type==="password"||s.type,d[s.name]=c)}),o("submit",{formData:d,modalType:a.modalType,originalData:a.initialData})}catch(d){console.error("Error during form submission:",d),ae.error("An error occurred during submission")}},f=()=>{i.value=p(),u.value={},m.value=!1,o("close")};return(d,s)=>(e.openBlock(),e.createBlock(ht,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=c=>r.value=c),"show-close":!0,"close-on-backdrop":!0,size:t.modalSize,class:e.normalizeClass(t.modalHeight==="auto"?"":t.modalHeight),resizable:t.modalResizable,onClose:f},{default:e.withCtx(()=>[e.createElementVNode("div",Wg,[e.createElementVNode("h2",Yg,e.toDisplayString(t.modalType==="create"?`Add New ${t.entityName}`:`Edit ${t.entityName}`),1),e.createElementVNode("p",Gg,e.toDisplayString(t.modalType==="create"?`Fill in the details to create a new ${t.entityName.toLowerCase()}.`:`Update the ${t.entityName.toLowerCase()} information below.`),1)]),e.createElementVNode("form",{class:"space-y-6 overflow-y-auto",onSubmit:e.withModifiers(b,["prevent"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,c=>(e.openBlock(),e.createElementBlock("div",{key:c.name},[c.type==="hidden"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":g=>i.value[c.name]=g,type:"hidden"},null,8,Kg)),[[e.vModelText,i.value[c.name]]]):(e.openBlock(),e.createBlock(vt,{key:1,id:`form-${t.entityName}-${c.name}-${Math.random().toString(36).slice(2,5)}`,label:c.label,required:c.required&&!c.disabled,error:u.value[c.name],"error-message":u.value[c.name]},{default:e.withCtx(({fieldId:g,hasError:S,ariaDescribedBy:k})=>[["text","number","password","color","email","tel","url","search"].includes(c.type)?(e.openBlock(),e.createBlock(Q,{key:0,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:c.type,placeholder:c.placeholder,disabled:l.value||c.disabled,readonly:c.disabled,class:e.normalizeClass(S?"border-red-500":"border-slate-300"),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","disabled","readonly","class","aria-describedby"])):c.type==="textarea"?(e.openBlock(),e.createBlock(gt,{key:1,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,placeholder:c.placeholder,disabled:l.value||c.disabled,rows:c.rows||3,class:e.normalizeClass(["w-full px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",S?"border-red-500":"border-slate-300"]),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","placeholder","disabled","rows","class","aria-describedby"])):c.type==="select"?(e.openBlock(),e.createBlock(se,{key:2,id:g,"model-value":i.value[c.name],options:c.options,placeholder:c.placeholder||"Select an option",disabled:l.value||c.disabled,"has-error":S,"aria-describedby":k,"onUpdate:modelValue":N=>h(c,N)},null,8,["id","model-value","options","placeholder","disabled","has-error","aria-describedby","onUpdate:modelValue"])):c.type==="multiselect"?(e.openBlock(),e.createBlock(Ko,{key:3,id:g,"model-value":i.value[c.name],options:c.options,disabled:l.value||c.disabled,placeholder:c.placeholder||"Select options","has-error":S,"aria-describedby":k,"onUpdate:modelValue":N=>i.value[c.name]=N},null,8,["id","model-value","options","disabled","placeholder","has-error","aria-describedby","onUpdate:modelValue"])):c.type==="combobox"?(e.openBlock(),e.createBlock(se,{key:4,id:g,"model-value":i.value[c.name],options:c.options,placeholder:c.placeholder||"Select or type to add new",disabled:l.value||c.disabled,"has-error":S,"aria-describedby":k,"allow-create":c.allowCreate,"onUpdate:modelValue":N=>h(c,N)},null,8,["id","model-value","options","placeholder","disabled","has-error","aria-describedby","allow-create","onUpdate:modelValue"])):c.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",Xg,[e.createVNode(Q,{id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"checkbox",disabled:l.value||c.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded","aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","aria-describedby"]),e.createVNode(me,{for:g,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.checkboxLabel||c.label),1)]),_:2},1032,["for"])])):c.type==="switch"?(e.openBlock(),e.createElementBlock("div",Qg,[e.createElementVNode("button",{id:g,type:"button",role:"switch","aria-checked":i.value[c.name],disabled:l.value||c.disabled,class:e.normalizeClass(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",i.value[c.name]?"bg-blue-600":"bg-gray-200",l.value||c.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:N=>i.value[c.name]=!i.value[c.name]},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",i.value[c.name]?"translate-x-6":"translate-x-1"])},null,2)],10,Jg),e.createVNode(me,{for:g,class:"ml-3 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.checkboxLabel||c.label),1)]),_:2},1032,["for"])])):c.type==="radio"?(e.openBlock(),e.createElementBlock("div",Zg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.options,N=>(e.openBlock(),e.createElementBlock("div",{key:N.value,class:"flex items-center"},[e.createVNode(Q,{id:`${g}-${N.value}`,modelValue:i.value[c.name],"onUpdate:modelValue":F=>i.value[c.name]=F,type:"radio",value:N.value,disabled:l.value||c.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300","aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","value","disabled","aria-describedby"]),e.createVNode(me,{for:`${g}-${N.value}`,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.label),1)]),_:2},1032,["for"])]))),128))])):c.type==="file"?(e.openBlock(),e.createElementBlock("div",ev,[e.createVNode(Q,{id:g,type:"file",accept:c.accept,disabled:l.value||c.disabled,class:e.normalizeClass(["w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100",S?"border-red-500":"border-slate-300"]),"aria-describedby":k,onChange:N=>y(c,N)},null,8,["id","accept","disabled","class","aria-describedby","onChange"]),c.helpText?(e.openBlock(),e.createElementBlock("p",tv,e.toDisplayString(c.helpText),1)):e.createCommentVNode("",!0)])):c.type==="slider"?(e.openBlock(),e.createBlock(bt,{key:9,"model-value":i.value[c.name],min:c.min,max:c.max,step:c.step,disabled:l.value||c.disabled,"onUpdate:modelValue":N=>E(c,N)},null,8,["model-value","min","max","step","disabled","onUpdate:modelValue"])):c.type==="range"?(e.openBlock(),e.createElementBlock("div",av,[e.createElementVNode("div",nv,[e.createVNode(Q,{id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"range",min:c.min,max:c.max,step:c.step||1,disabled:l.value||c.disabled,class:"flex-1","aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","min","max","step","disabled","aria-describedby"]),e.createElementVNode("span",ov,e.toDisplayString(i.value[c.name]),1)])])):c.type==="date"?(e.openBlock(),e.createBlock(We,{key:11,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,disabled:l.value||c.disabled,required:c.required,min:c.min,max:c.max,placeholder:c.placeholder||"Select date",format:c.format||"MM/DD/YYYY",clearable:c.clearable!==!1,"show-today":c.showToday!==!1,"calendar-position":c.calendarPosition||"left-0 bottom-full","aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","required","min","max","placeholder","format","clearable","show-today","calendar-position","aria-describedby"])):c.type==="time"?(e.openBlock(),e.createBlock(Q,{key:12,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"time",disabled:l.value||c.disabled,class:e.normalizeClass(S?"border-red-500":"border-slate-300"),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="datetime-local"?(e.openBlock(),e.createBlock(Q,{key:13,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"datetime-local",disabled:l.value||c.disabled,class:e.normalizeClass(S?"border-red-500":"border-slate-300"),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="month"?(e.openBlock(),e.createBlock(Q,{key:14,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"month",disabled:l.value||c.disabled,class:e.normalizeClass(S?"border-red-500":"border-slate-300"),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="week"?(e.openBlock(),e.createBlock(Q,{key:15,id:g,modelValue:i.value[c.name],"onUpdate:modelValue":N=>i.value[c.name]=N,type:"week",disabled:l.value||c.disabled,class:e.normalizeClass(S?"border-red-500":"border-slate-300"),"aria-describedby":k},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):e.createCommentVNode("",!0)]),_:2},1032,["id","label","required","error","error-message"]))]))),128)),e.createElementVNode("div",rv,[e.createVNode(J,{type:"button",variant:"outline",disabled:l.value,onClick:f},{default:e.withCtx(()=>[...s[1]||(s[1]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["disabled"]),e.createVNode(J,{type:"submit",disabled:l.value,loading:l.value,variant:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.modalType==="create"?`Create ${t.entityName}`:`Update ${t.entityName}`),1)]),_:1},8,["disabled","loading"])])],32)]),_:1},8,["modelValue","size","class","resizable"]))}},lv={class:"w-full p-2"},sv={key:0,class:"mb-6"},iv={class:"text-xl font-semibold text-gray-900"},cv=["onUpdate:modelValue"],dv={key:4,class:"flex items-center"},uv={key:5,class:"flex items-center"},mv=["id","aria-checked","disabled","onClick"],fv={key:6,class:"space-y-2"},pv={key:7,class:"space-y-2"},gv={key:0,class:"text-xs text-gray-500"},vv={key:9,class:"space-y-2"},hv={class:"flex items-center gap-4"},bv={class:"text-sm font-medium text-gray-700 min-w-[3rem] text-right"},yv={class:"flex justify-end gap-3 pt-6"},Qo={__name:"ReusableForm",props:{title:{type:String,default:"Form"},entityName:{type:String,default:"Item"},fields:{type:Array,required:!0,validator:t=>t.every(n=>n.name&&n.label&&n.type&&["text","number","password","textarea","select","checkbox","slider","date","color","email","tel","url","time","datetime-local","month","week","file","radio","switch","range","search","hidden","multiselect"].includes(n.type))},initialData:{type:Object,default:null},loading:{type:Boolean,default:!1},customValidation:{type:Function,default:null}},emits:["submit","reset"],setup(t,{emit:n}){const a=t,o=n,r=e.computed(()=>a.loading),l=e.ref({}),i=e.ref({}),u=e.ref(!1),m=()=>{const f={};return a.fields.forEach(d=>{d.type==="checkbox"||d.type==="switch"?f[d.name]=!1:d.type==="number"||d.type==="slider"||d.type==="range"?f[d.name]=d.min!==void 0?d.min:0:d.type==="file"?f[d.name]=null:d.type==="radio"?f[d.name]=d.options?.[0]?.value||"":d.type==="multiselect"?f[d.name]=[]:f[d.name]=""}),f};e.watch(()=>a.initialData,f=>{if(f){const d={};a.fields.forEach(s=>{s.type==="checkbox"||s.type==="switch"?d[s.name]=f[s.name]??!1:s.type==="number"||s.type==="slider"||s.type==="range"?d[s.name]=f[s.name]??(s.min!==void 0?s.min:0):s.type==="file"?d[s.name]=null:s.type==="multiselect"?d[s.name]=Array.isArray(f[s.name])?f[s.name]:[]:d[s.name]=f[s.name]??""}),l.value=d,u.value=!0}else l.value=m(),u.value=!1},{immediate:!0,deep:!0}),e.watch(()=>a.initialData,f=>{u.value&&f&&Object.keys(f).forEach(d=>{Object.prototype.hasOwnProperty.call(l.value,d)&&f[d]!==void 0&&f[d]!==null&&(l.value[d]=f[d])})},{deep:!0});const p=()=>{if(i.value={},a.fields.forEach(f=>{if(f.required&&!f.disabled&&f.type!=="hidden"){const d=l.value[f.name];f.type==="checkbox"||f.type==="switch"?f.required&&!d&&(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="number"||f.type==="slider"||f.type==="range"?d===""||d===null||d===void 0?i.value[f.name]=f.errorMessage||`${f.label} is required`:f.min!==void 0&&Number(d)<f.min?i.value[f.name]=`${f.label} must be at least ${f.min}`:f.max!==void 0&&Number(d)>f.max&&(i.value[f.name]=`${f.label} must be at most ${f.max}`):f.type==="email"?!d||!d.trim()?i.value[f.name]=f.errorMessage||`${f.label} is required`:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d)||(i.value[f.name]="Please enter a valid email address"):f.type==="url"?!d||!d.trim()?i.value[f.name]=f.errorMessage||`${f.label} is required`:/^https?:\/\/.+/.test(d)||(i.value[f.name]="Please enter a valid URL"):f.type==="tel"?(!d||!d.trim())&&(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="file"?d||(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="radio"?d||(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="multiselect"?(!Array.isArray(d)||d.length===0)&&(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="date"||f.type==="time"||f.type==="datetime-local"||f.type==="month"||f.type==="week"?(!d||typeof d=="string"&&!d.trim())&&(i.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="password"?(!d||typeof d=="string"&&!d.trim())&&(i.value[f.name]=f.errorMessage||`${f.label} is required`):(!d||typeof d=="string"&&!d.trim())&&(i.value[f.name]=f.errorMessage||`${f.label} is required`)}if(f.validate&&typeof f.validate=="function"){const d=f.validate(l.value[f.name],l.value);d&&(i.value[f.name]=d)}}),a.customValidation){const f=a.customValidation(l.value);f&&Object.keys(f).length>0&&(i.value={...i.value,...f})}return Object.keys(i.value).length===0},v=async(f,d)=>{if(l.value[f.name]=d,f.onChange&&typeof f.onChange=="function")try{await f.onChange(d,l.value)}catch(s){console.error("Error in onChange handler:",s),ae.error("An error occurred while processing the change")}},h=(f,d)=>{if(l.value[f.name]=d,f.onChange&&typeof f.onChange=="function")try{f.onChange(d,l.value)}catch(s){console.error("Error in onChange handler:",s),ae.error("An error occurred while processing the change")}},E=(f,d)=>{const s=d.target.files?.[0]||null;if(l.value[f.name]=s,f.onChange&&typeof f.onChange=="function")try{f.onChange(s,l.value)}catch(c){console.error("Error in onChange handler:",c),ae.error("An error occurred while processing the file")}},y=async()=>{try{if(!p()){ae.error("Please fix the validation errors before submitting");return}const f={};a.fields.forEach(d=>{const s=l.value[d.name];d.type==="number"||d.type==="slider"||d.type==="range"?f[d.name]=Number(s):d.type==="text"||d.type==="textarea"||d.type==="date"||d.type==="email"||d.type==="url"||d.type==="tel"||d.type==="search"||d.type==="time"||d.type==="datetime-local"||d.type==="month"||d.type==="week"?f[d.name]=typeof s=="string"?s.trim():s:(d.type==="password"||d.type,f[d.name]=s)}),o("submit",{formData:f,originalData:a.initialData})}catch(f){console.error("Error during form submission:",f),ae.error("An error occurred during submission")}},b=()=>{l.value=m(),i.value={},u.value=!1,o("reset")};return(f,d)=>(e.openBlock(),e.createElementBlock("div",lv,[t.title?(e.openBlock(),e.createElementBlock("div",sv,[e.createElementVNode("h2",iv,e.toDisplayString(t.title),1)])):e.createCommentVNode("",!0),e.createElementVNode("form",{class:"space-y-8",onSubmit:e.withModifiers(y,["prevent"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,s=>(e.openBlock(),e.createElementBlock("div",{key:s.name},[s.type==="hidden"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":c=>l.value[s.name]=c,type:"hidden"},null,8,cv)),[[e.vModelText,l.value[s.name]]]):(e.openBlock(),e.createBlock(vt,{key:1,id:`form-${t.entityName}-${s.name}-${Math.random().toString(36).slice(2,5)}`,label:s.label,required:s.required&&!s.disabled,error:i.value[s.name],"error-message":i.value[s.name]},{default:e.withCtx(({fieldId:c,hasError:g,ariaDescribedBy:S})=>[["text","number","password","color","email","tel","url","search"].includes(s.type)?(e.openBlock(),e.createBlock(Q,{key:0,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:s.type,placeholder:s.placeholder,disabled:r.value||s.disabled,readonly:s.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","disabled","readonly","class","aria-describedby"])):s.type==="textarea"?(e.openBlock(),e.createBlock(gt,{key:1,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,placeholder:s.placeholder,disabled:r.value||s.disabled,rows:s.rows||3,class:e.normalizeClass(["w-full px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",g?"border-red-500":"border-slate-300"]),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","placeholder","disabled","rows","class","aria-describedby"])):s.type==="select"?(e.openBlock(),e.createBlock(se,{key:2,id:c,"model-value":l.value[s.name],options:s.options,placeholder:s.placeholder||"Select an option",disabled:r.value||s.disabled,"has-error":g,"aria-describedby":S,"onUpdate:modelValue":k=>v(s,k)},null,8,["id","model-value","options","placeholder","disabled","has-error","aria-describedby","onUpdate:modelValue"])):s.type==="multiselect"?(e.openBlock(),e.createBlock(Ko,{key:3,id:c,"model-value":l.value[s.name],options:s.options,disabled:r.value||s.disabled,placeholder:s.placeholder||"Select options","has-error":g,"aria-describedby":S,"onUpdate:modelValue":k=>l.value[s.name]=k},null,8,["id","model-value","options","disabled","placeholder","has-error","aria-describedby","onUpdate:modelValue"])):s.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",dv,[e.createVNode(Q,{id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"checkbox",disabled:r.value||s.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded","aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","aria-describedby"]),e.createVNode(me,{for:c,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.checkboxLabel||s.label),1)]),_:2},1032,["for"])])):s.type==="switch"?(e.openBlock(),e.createElementBlock("div",uv,[e.createElementVNode("button",{id:c,type:"button",role:"switch","aria-checked":l.value[s.name],disabled:r.value||s.disabled,class:e.normalizeClass(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",l.value[s.name]?"bg-blue-600":"bg-gray-200",r.value||s.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:k=>l.value[s.name]=!l.value[s.name]},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",l.value[s.name]?"translate-x-6":"translate-x-1"])},null,2)],10,mv),e.createVNode(me,{for:c,class:"ml-3 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.checkboxLabel||s.label),1)]),_:2},1032,["for"])])):s.type==="radio"?(e.openBlock(),e.createElementBlock("div",fv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.options,k=>(e.openBlock(),e.createElementBlock("div",{key:k.value,class:"flex items-center"},[e.createVNode(Q,{id:`${c}-${k.value}`,modelValue:l.value[s.name],"onUpdate:modelValue":N=>l.value[s.name]=N,type:"radio",value:k.value,disabled:r.value||s.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300","aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","value","disabled","aria-describedby"]),e.createVNode(me,{for:`${c}-${k.value}`,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.label),1)]),_:2},1032,["for"])]))),128))])):s.type==="file"?(e.openBlock(),e.createElementBlock("div",pv,[e.createVNode(Q,{id:c,type:"file",accept:s.accept,disabled:r.value||s.disabled,class:e.normalizeClass(["w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100",g?"border-red-500":"border-slate-300"]),"aria-describedby":S,onChange:k=>E(s,k)},null,8,["id","accept","disabled","class","aria-describedby","onChange"]),s.helpText?(e.openBlock(),e.createElementBlock("p",gv,e.toDisplayString(s.helpText),1)):e.createCommentVNode("",!0)])):s.type==="slider"?(e.openBlock(),e.createBlock(bt,{key:8,"model-value":l.value[s.name],min:s.min,max:s.max,step:s.step,disabled:r.value||s.disabled,"onUpdate:modelValue":k=>h(s,k)},null,8,["model-value","min","max","step","disabled","onUpdate:modelValue"])):s.type==="range"?(e.openBlock(),e.createElementBlock("div",vv,[e.createElementVNode("div",hv,[e.createVNode(Q,{id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"range",min:s.min,max:s.max,step:s.step||1,disabled:r.value||s.disabled,class:"flex-1","aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","min","max","step","disabled","aria-describedby"]),e.createElementVNode("span",bv,e.toDisplayString(l.value[s.name]),1)])])):s.type==="date"?(e.openBlock(),e.createBlock(We,{key:10,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,disabled:r.value||s.disabled,required:s.required,min:s.min,max:s.max,placeholder:s.placeholder||"Select date",format:s.format||"MM/DD/YYYY",clearable:s.clearable!==!1,"show-today":s.showToday!==!1,"calendar-position":s.calendarPosition||"left-0 bottom-full","aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","required","min","max","placeholder","format","clearable","show-today","calendar-position","aria-describedby"])):s.type==="time"?(e.openBlock(),e.createBlock(Q,{key:11,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"time",disabled:r.value||s.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):s.type==="datetime-local"?(e.openBlock(),e.createBlock(Q,{key:12,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"datetime-local",disabled:r.value||s.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):s.type==="month"?(e.openBlock(),e.createBlock(Q,{key:13,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"month",disabled:r.value||s.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):s.type==="week"?(e.openBlock(),e.createBlock(Q,{key:14,id:c,modelValue:l.value[s.name],"onUpdate:modelValue":k=>l.value[s.name]=k,type:"week",disabled:r.value||s.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":S},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):e.createCommentVNode("",!0)]),_:2},1032,["id","label","required","error","error-message"]))]))),128)),e.createElementVNode("div",yv,[e.createVNode(J,{type:"button",variant:"outline",disabled:r.value,onClick:b},{default:e.withCtx(()=>[...d[0]||(d[0]=[e.createTextVNode(" Reset ",-1)])]),_:1},8,["disabled"]),e.createVNode(J,{type:"submit",disabled:r.value,loading:r.value,variant:"default"},{default:e.withCtx(()=>[...d[1]||(d[1]=[e.createTextVNode(" Submit ",-1)])]),_:1},8,["disabled","loading"])])],32)]))}},xv={key:0,class:"flex items-center justify-between p-4 border-b border-gray-200 flex-shrink-0 lg:hidden"},kv={class:"text-lg font-bold text-gray-900"},wv={class:"flex-1 overflow-y-auto overflow-x-hidden p-4"},Cv={class:"space-y-2"},Bv={key:0},Vv={key:0,class:"absolute top-2 right-2 inline-flex items-center justify-center w-5 h-5 text-xs font-bold rounded-full bg-red-500 text-white"},Sv=["onClick"],Ev={key:0,class:"absolute top-2 right-2 inline-flex items-center justify-center w-5 h-5 text-xs font-bold rounded-full bg-red-500 text-white"},Nv={key:1,class:"absolute top-1.5 right-1.5 w-2 h-2 bg-blue-500 rounded-full"},$v={key:1,class:"border-t border-gray-200 p-4 flex-shrink-0"},zv={key:0,class:"absolute top-1.5 right-1.5 w-2 h-2 bg-blue-500 rounded-full"},Dv={class:"sticky top-0 bg-white border-b border-gray-200 z-10"},Tv={class:"flex items-center justify-between p-4"},Av={class:"flex-1 text-sm font-bold text-gray-900 ml-2"},Fv={class:"p-3"},Pv={class:"space-y-1"},Mv={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Lv={key:1,class:"ml-2 inline-flex items-center justify-center px-2 py-0.5 text-xs font-bold rounded-full bg-red-500 text-white"},jv={class:"p-3"},Ov={class:"space-y-1"},Iv={key:0,class:"px-3 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wider"},_v={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Jo={__name:"Sidebar",props:{sidebarWidth:{type:Number,default:130},header:{type:Object,default:null},navigationItems:{type:Array,required:!0},managementSettings:{type:Array,default:()=>[]},showManagementSettings:{type:Boolean,default:!0},mobileOpen:{type:Boolean,default:!1},isManagementSettingsActive:{type:Boolean,default:!1},currentPath:{type:String,default:""}},emits:["navigate","update:mobileOpen"],setup(t,{expose:n,emit:a}){const o=t,r=a,l=e.ref(!1),i=e.ref(!1),u=e.ref(null),m=e.ref(!1),p=e.computed(()=>o.mobileOpen),v=e.computed(()=>l.value?{}:{left:`${o.sidebarWidth}px`}),h=e.computed(()=>l.value?{}:{left:`${o.sidebarWidth}px`}),E=e.computed(()=>{if(l.value)return 0;let w=o.sidebarWidth;return i.value&&(w+=220),m.value&&(w+=220),w}),y=w=>{r("navigate",w),l.value&&b();const M=i.value&&u.value&&u.value.subItems.some(C=>C.route===w.route),_=m.value&&o.managementSettings.some(C=>C.route===w.route);(l.value||!(M||_))&&S()},b=()=>{r("update:mobileOpen",!1)},f=w=>w.subItems&&w.subItems.length>0,d=w=>{m.value&&g(),i.value&&u.value!==w?(c(),setTimeout(()=>{u.value=w,i.value=!0},300)):i.value?u.value===w&&c():(u.value=w,i.value=!0),l.value&&b()},s=()=>{i.value&&c(),m.value?g():m.value=!0,l.value&&b()},c=()=>{i.value=!1,setTimeout(()=>{u.value=null},300)},g=()=>{m.value=!1},S=()=>{c(),g()},k=w=>{y(w)},N=w=>{y(w)},F=w=>{const M=o.currentPath;return w.route?!!(M===w.route||M.startsWith(w.route+"/")):w.subItems&&w.subItems.length>0?w.subItems.some(_=>_.route?M===_.route||M.startsWith(_.route+"/"):!1):!1},L=()=>{const w=l.value;l.value=window.innerWidth<1024,w&&!l.value&&p.value&&b()},q=w=>{w.key==="Escape"&&(i.value||m.value?S():l.value&&p.value&&b())};return e.onMounted(()=>{L(),window.addEventListener("resize",L),document.addEventListener("keydown",q)}),e.onUnmounted(()=>{window.removeEventListener("resize",L),document.removeEventListener("keydown",q)}),n({isMobile:l,isMobileOpen:p,submenuOpen:i,managementSettingsOpen:m,contentMarginLeft:E,closeAllMenus:S}),(w,M)=>{const _=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.Transition,{"enter-active-class":"transition-opacity duration-300","leave-active-class":"transition-opacity duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[p.value&&l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-30 lg:hidden",onClick:b})):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("aside",{class:e.normalizeClass(e.unref(x)("fixed left-0 z-40 border-r overflow-hidden flex flex-col","transition-all duration-300 ease-in-out","bg-white border-gray-200",l.value?e.unref(x)("transform h-screen",p.value?"translate-x-0":"-translate-x-full"):"translate-x-0 h-[calc(100vh-4rem)]")),style:e.normalizeStyle({width:t.sidebarWidth+"px",top:l.value?"0px":"4rem"})},[l.value?(e.openBlock(),e.createElementBlock("div",xv,[e.createElementVNode("h2",kv,e.toDisplayString(t.header?.title),1),e.createElementVNode("button",{class:"p-2 rounded-lg text-gray-500 hover:text-gray-900 hover:bg-gray-100 transition-colors","aria-label":"Close sidebar",onClick:b},[...M[0]||(M[0]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])):e.createCommentVNode("",!0),e.createElementVNode("nav",wv,[e.createElementVNode("div",Cv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.navigationItems,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.name||C.label},[C.type==="link"?(e.openBlock(),e.createElementBlock("div",Bv,[f(C)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(x)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 cursor-pointer group relative py-4 px-3",F(C)?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:z=>d(C)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",F(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(I,{icon:C.icon,class:"w-6 h-6"},null,8,["icon"])],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("text-xs font-medium text-center",F(C)?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Ev,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0),F(C)&&f(C)?(e.openBlock(),e.createElementBlock("div",Nv)):e.createCommentVNode("",!0)],10,Sv)):(e.openBlock(),e.createBlock(_,{key:0,to:C.route,class:e.normalizeClass(e.unref(x)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 group relative py-4 px-3",F(C)?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:z=>y(C)},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",F(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(I,{icon:C.icon,class:"w-6 h-6"},null,8,["icon"])],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("text-xs font-medium text-center",F(C)?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Vv,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0)]),_:2},1032,["to","class","onClick"]))])):e.createCommentVNode("",!0)],64))),128))])]),t.showManagementSettings?(e.openBlock(),e.createElementBlock("div",$v,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 cursor-pointer group relative py-4 px-3",t.isManagementSettingsActive?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:s},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",t.isManagementSettingsActive?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(I,{icon:"cog",class:"w-6 h-6"})],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("text-xs font-medium text-center",t.isManagementSettingsActive?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))}," Settings ",2),t.isManagementSettingsActive?(e.openBlock(),e.createElementBlock("div",zv)):e.createCommentVNode("",!0)],2)])):e.createCommentVNode("",!0)],6),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 -translate-x-full","enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-full"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(e.unref(x)("fixed z-40 bg-white border-r border-gray-200 overflow-y-auto shadow-lg",l.value?"left-0 w-52 top-20 h-screen":"w-56 top-16 h-[calc(100vh-4rem)]")),style:e.normalizeStyle(v.value)},[e.createElementVNode("div",Dv,[e.createElementVNode("div",Tv,[e.createElementVNode("button",{class:"p-2 -ml-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors","aria-label":"Close submenu",onClick:c},[...M[1]||(M[1]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e.createElementVNode("h3",Av,e.toDisplayString(u.value?.label),1)])]),e.createElementVNode("nav",Fv,[e.createElementVNode("div",Pv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value?.subItems,C=>(e.openBlock(),e.createBlock(_,{key:C.name,to:C.route,class:e.normalizeClass(e.unref(x)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",F(C)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:z=>k(C)},{default:e.withCtx(()=>[F(C)?(e.openBlock(),e.createElementBlock("div",Mv)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2",F(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[C.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:C.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("flex-1 truncate font-semibold",F(C)?"text-blue-700":"text-gray-700"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Lv,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0)]),_:2},1032,["to","class","onClick"]))),128))])])],6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 -translate-x-full","enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-full"},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(e.unref(x)("fixed z-40 bg-white border-r border-gray-200 overflow-y-auto shadow-lg",l.value?"left-0 w-52 top-20 h-full":"w-58 h-[calc(100vh-4rem)]")),style:e.normalizeStyle({...h.value,top:l.value?"55px":"4rem"})},[e.createElementVNode("div",{class:"sticky top-0 z-10 bg-white border-b border-gray-200"},[e.createElementVNode("div",{class:"flex items-center justify-between p-4"},[e.createElementVNode("button",{class:"p-2 -ml-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors","aria-label":"Close management settings",onClick:g},[...M[2]||(M[2]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),M[3]||(M[3]=e.createElementVNode("h3",{class:"flex-1 text-sm font-bold text-gray-900 ml-2"}," Management Settings ",-1))])]),e.createElementVNode("nav",jv,[e.createElementVNode("div",Ov,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.managementSettings,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.name},[C.type==="section"?(e.openBlock(),e.createElementBlock("div",Iv,e.toDisplayString(C.label),1)):C.route?(e.openBlock(),e.createBlock(_,{key:1,to:C.route,class:e.normalizeClass(e.unref(x)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",F(C)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:z=>N(C)},{default:e.withCtx(()=>[F(C)?(e.openBlock(),e.createElementBlock("div",_v)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(x)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors",F(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[C.icon?(e.openBlock(),e.createBlock(I,{key:0,icon:C.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(x)("flex-1 truncate font-semibold",F(C)?"text-blue-700":"text-gray-700"))},e.toDisplayString(C.label),3)]),_:2},1032,["to","class","onClick"])):e.createCommentVNode("",!0)],64))),128))])])],6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{"enter-active-class":"transition-opacity duration-300","leave-active-class":"transition-opacity duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(i.value||m.value)&&l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-30 bg-transparent",onClick:S})):e.createCommentVNode("",!0)]),_:1})])}}},Zo={__name:"Timeline",props:{orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex",t.orientation==="vertical"?"flex-col":"flex-row"])},[e.renderSlot(n.$slots,"default")],2))}},Rv={key:0,class:"absolute left-3 top-0 w-0.5 h-full bg-slate-200"},Uv={class:"z-10 flex items-center justify-center w-6 h-6 rounded-full border-2 border-blue-500 bg-white text-blue-500"},qv={class:"text-slate-900 font-medium"},Hv={key:0,class:"text-slate-500 text-sm"},Wv={class:"mt-2 text-slate-600 text-sm"},er={__name:"TimelineItem",props:{title:{type:String,required:!0},subtitle:{type:String,default:""},orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex",t.orientation==="vertical"?"items-start mb-8 last:mb-0":"flex-col items-center mx-8 last:mx-0"])},[t.orientation==="vertical"?(e.openBlock(),e.createElementBlock("div",Rv)):e.createCommentVNode("",!0),e.createElementVNode("div",Uv,[e.renderSlot(n.$slots,"icon",{},()=>[a[0]||(a[0]=e.createElementVNode("div",{class:"w-2 h-2 rounded-full bg-blue-500"},null,-1))])]),e.createElementVNode("div",{class:e.normalizeClass(["ml-6",t.orientation==="horizontal"?"mt-2 text-center":""])},[e.createElementVNode("h3",qv,[e.renderSlot(n.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])]),t.subtitle?(e.openBlock(),e.createElementBlock("p",Hv,[e.renderSlot(n.$slots,"subtitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subtitle),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Wv,[e.renderSlot(n.$slots,"default")])],2)],2))}},Yv={name:"AuthLayout",props:{title:{type:String,default:null},subtitle:{type:String,default:null},primaryLogoPrefix:{type:String,default:"e"},primaryLogoText:{type:String,default:"HORIZON"},secondaryLogoPrefix:{type:String,default:"e"},secondaryLogoText:{type:String,default:"Risk & Compliance"},quote:{type:String,default:""},primaryColor:{type:String,default:"#e74c3c"},backgroundColor:{type:String,default:"#2c2c2c"},backgroundImage:{type:String,default:"https://images.unsplash.com/photo-1497366216548-37526070297c?ixlib=rb-4.0.3&auto=format&fit=crop&w=2069&q=80"},backgroundOpacity:{type:Number,default:.4},companyName:{type:String,default:"SOFTWARE"},companyType:{type:String,default:"TECHNOLOGIES"},companyTagline:{type:String,default:"People | Processes | Governance"},companyInitials:{type:String,default:"ST"},appName:{type:String,default:"eHorizon eBoard X"},appVersion:{type:String,default:"Version 2.0"},copyright:{type:String,default:"Copyright © 2025 Software Technologies Limited"},socialLinks:{type:Array,default:()=>[{name:"linkedin",url:"#",icon:"linkedin-in",variant:"primary"},{name:"facebook",url:"#",icon:"facebook-f",variant:"primary"},{name:"twitter",url:"#",icon:"twitter",variant:"info"}]}},setup(){return{currentYear:e.computed(()=>new Date().getFullYear())}}},Gv={class:"container mx-auto px-4 relative z-10"},Kv={class:"grid lg:grid-cols-10 gap-8 items-center min-h-screen"},Xv={class:"lg:col-span-6 text-white text-center lg:text-left space-y-6"},Qv={class:"mb-6"},Jv={class:"text-4xl lg:text-6xl font-bold mb-2"},Zv={class:"text-white"},e0={class:"flex items-center justify-center lg:justify-start mb-6"},t0={class:"text-3xl lg:text-4xl font-bold text-white"},a0={class:"lg:col-span-4"},n0={class:"bg-white rounded-lg shadow-xl p-6 lg:p-8 max-w-md mx-auto"},o0={key:0,class:"mb-6"},r0={class:"text-center"},l0={class:"text-2xl font-bold text-gray-900"},s0={key:0,class:"text-gray-600 mt-2"},i0={class:"space-y-6"},c0={key:1,class:"mt-6"},d0={key:0,class:"mt-6 text-center"},u0={class:"absolute bottom-4 right-4 text-right"},m0={class:"flex items-end justify-end mb-2"},f0={class:"text-right mr-3"},p0={class:"text-red-500 font-bold text-xs"},g0={class:"text-white text-xs"},v0={class:"text-white/70 text-xs"},h0={class:"w-8 h-8 bg-red-500 rounded flex items-center justify-center text-white font-bold text-xs"},b0={class:"text-white/70 text-xs"},y0={class:"absolute bottom-4 left-4 flex gap-2"},x0=["href"];function k0(t,n,a,o,r,l){const i=e.resolveComponent("router-view"),u=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock("div",{class:"min-h-screen relative flex items-center justify-center",style:e.normalizeStyle({backgroundColor:a.backgroundColor})},[e.createElementVNode("div",{class:"absolute inset-0 bg-cover bg-center",style:e.normalizeStyle({backgroundImage:`url('${a.backgroundImage}')`,opacity:a.backgroundOpacity})},null,4),e.createElementVNode("div",Gv,[e.createElementVNode("div",Kv,[e.createElementVNode("div",Xv,[e.createElementVNode("div",Qv,[e.createElementVNode("div",Jv,[e.createElementVNode("span",{style:e.normalizeStyle({color:a.primaryColor})},e.toDisplayString(a.primaryLogoPrefix),5),e.createElementVNode("span",Zv,e.toDisplayString(a.primaryLogoText),1)]),e.createElementVNode("div",{class:"h-0.5 w-30 mx-auto lg:mx-0",style:e.normalizeStyle({backgroundColor:a.primaryColor})},null,4)]),e.createElementVNode("div",e0,[e.createElementVNode("div",{class:"flex items-center justify-center w-15 h-15 rounded-lg mr-4 text-white font-bold text-xl",style:e.normalizeStyle({backgroundColor:a.primaryColor})},e.toDisplayString(a.secondaryLogoPrefix),5),e.createElementVNode("span",t0,e.toDisplayString(a.secondaryLogoText),1)]),n[0]||(n[0]=e.createElementVNode("div",{class:"max-w-md mx-auto lg:mx-0"},[e.createElementVNode("p",{class:"text-sm lg:text-base font-light text-white/70 italic leading-relaxed"})],-1))]),e.createElementVNode("div",a0,[e.createElementVNode("div",n0,[t.$slots["card-header"]||a.title?(e.openBlock(),e.createElementBlock("div",o0,[e.renderSlot(t.$slots,"card-header",{},()=>[e.createElementVNode("div",r0,[e.createElementVNode("h1",l0,e.toDisplayString(a.title),1),a.subtitle?(e.openBlock(),e.createElementBlock("p",s0,e.toDisplayString(a.subtitle),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",i0,[e.createVNode(i)]),t.$slots["card-footer"]?(e.openBlock(),e.createElementBlock("div",c0,[e.renderSlot(t.$slots,"card-footer")])):e.createCommentVNode("",!0)]),t.$slots.links?(e.openBlock(),e.createElementBlock("div",d0,[e.renderSlot(t.$slots,"links")])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",u0,[e.createElementVNode("div",m0,[e.createElementVNode("div",f0,[e.createElementVNode("div",p0,e.toDisplayString(a.companyName),1),e.createElementVNode("div",g0,e.toDisplayString(a.companyType),1),e.createElementVNode("div",v0,e.toDisplayString(a.companyTagline),1)]),e.createElementVNode("div",h0,e.toDisplayString(a.companyInitials),1)]),e.createElementVNode("div",b0,[e.createElementVNode("div",null,e.toDisplayString(a.appName)+" ("+e.toDisplayString(a.appVersion)+")",1),e.createElementVNode("div",null,e.toDisplayString(a.copyright),1)])]),e.createElementVNode("div",y0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.socialLinks,m=>(e.openBlock(),e.createElementBlock("a",{key:m.name,href:m.url,class:e.normalizeClass(["w-8 h-7 flex items-center justify-center rounded text-xs transition-colors",m.variant==="primary"?"bg-blue-600 hover:bg-blue-700 text-white":m.variant==="info"?"bg-cyan-500 hover:bg-cyan-600 text-white":"bg-gray-600 hover:bg-gray-700 text-white"])},[e.createVNode(u,{icon:["fab",m.icon]},null,8,["icon"])],10,x0))),128))])],4)}const tr=yt(Yv,[["render",k0]]),w0={class:"min-h-screen bg-gray-50"},C0={class:"flex-1"},B0={key:0,class:"bg-white border-b border-gray-200"},V0={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"},S0={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},ar={__name:"DefaultLayout",props:{navigationItems:{type:Array,default:()=>[{label:"Home",href:"/",active:!0},{label:"About",href:"/about"},{label:"Services",href:"/services"},{label:"Contact",href:"/contact"}]},breadcrumbItems:{type:Array,default:()=>[]},showBreadcrumb:{type:Boolean,default:!1}},setup(t){return(n,a)=>{const o=e.resolveComponent("Logo"),r=e.resolveComponent("MainNavigation"),l=e.resolveComponent("Button"),i=e.resolveComponent("Header"),u=e.resolveComponent("Breadcrumb"),m=e.resolveComponent("Text"),p=e.resolveComponent("Footer");return e.openBlock(),e.createElementBlock("div",w0,[e.createVNode(i,null,{logo:e.withCtx(()=>[e.renderSlot(n.$slots,"logo",{},()=>[e.createVNode(o)])]),navigation:e.withCtx(()=>[e.renderSlot(n.$slots,"navigation",{},()=>[e.createVNode(r,{items:t.navigationItems},null,8,["items"])])]),actions:e.withCtx(()=>[e.renderSlot(n.$slots,"header-actions",{},()=>[e.createVNode(l,{variant:"ghost",size:"sm"},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode(" Sign In ",-1)])]),_:1}),e.createVNode(l,{size:"sm"},{default:e.withCtx(()=>[...a[1]||(a[1]=[e.createTextVNode(" Get Started ",-1)])]),_:1})])]),_:3}),e.createElementVNode("main",C0,[t.showBreadcrumb?(e.openBlock(),e.createElementBlock("div",B0,[e.createElementVNode("div",V0,[e.renderSlot(n.$slots,"breadcrumb",{},()=>[e.createVNode(u,{items:t.breadcrumbItems},null,8,["items"])])])])):e.createCommentVNode("",!0),e.createElementVNode("div",S0,[e.renderSlot(n.$slots,"default")])]),e.createVNode(p,null,{brand:e.withCtx(()=>[e.renderSlot(n.$slots,"footer-brand",{},()=>[e.createVNode(o,{class:"mb-4"}),e.createVNode(m,{class:"text-gray-600 max-w-md"},{default:e.withCtx(()=>[...a[2]||(a[2]=[e.createTextVNode(" Your application description goes here. ",-1)])]),_:1})])]),_:3})])}}},E0={name:"ErrorLayout",props:{errorType:{type:[String,Number],default:"404"},errorCode:{type:[String,Number],default:null},errorTitle:{type:String,default:null},errorMessage:{type:String,default:null},brandName:{type:String,default:"Software Technologies"},showLogo:{type:Boolean,default:!0},showBackground:{type:Boolean,default:!0},showDefaultIllustration:{type:Boolean,default:!0},showDefaultActions:{type:Boolean,default:!0},showHomeButton:{type:Boolean,default:!0},showBackButton:{type:Boolean,default:!0},showRetryButton:{type:Boolean,default:!1},showSupportButton:{type:Boolean,default:!1},showAdditionalInfo:{type:Boolean,default:!1},homeUrl:{type:String,default:"/"},homeButtonText:{type:String,default:"Go Home"},backButtonText:{type:String,default:"Go Back"},retryButtonText:{type:String,default:"Try Again"},helpText:{type:String,default:null},supportUrl:{type:String,default:null}},emits:["retry","back","contact-support"],setup(t,{emit:n}){const a=e.getCurrentInstance(),o=e.inject("$router",null)||a?.appContext.app.config.globalProperties?.$router,r=e.ref(!1),l=e.ref(!1),i=e.ref(navigator.onLine),u=e.ref(`err_${Date.now()}_${Math.random().toString(36).substr(2,9)}`),m=e.ref(!1),p=()=>{i.value=navigator.onLine};e.onMounted(()=>{window.addEventListener("online",p),window.addEventListener("offline",p)}),e.onUnmounted(()=>{window.removeEventListener("online",p),window.removeEventListener("offline",p)});const v=e.computed(()=>{const H={404:{title:"Page Not Found",message:"Sorry, we couldn't find the page you're looking for.",icon:"🔍",color:"#64748b",homeButtonIcon:"🏠",additionalInfo:{title:"What can you do?",items:[{icon:"✓",iconColor:"green-500",text:"Check the URL for typos"},{icon:"✓",iconColor:"green-500",text:"Go back to the previous page"},{icon:"✓",iconColor:"green-500",text:"Visit our homepage"}]}},403:{title:"Unauthorized Access",message:"You are not authorized to view this page.",icon:"🚫",color:"#ef4444",homeButtonIcon:"🔐",additionalInfo:{title:"Why am I seeing this?",items:[{icon:"⚠️",iconColor:"yellow-500",text:"You may need to log in to access this page"},{icon:"⚠️",iconColor:"yellow-500",text:"Your account might not have the required permissions"},{icon:"⚠️",iconColor:"yellow-500",text:"Contact support if you believe this is an error"}]}},401:{title:"Authentication Required",message:"You need to log in to access this resource.",icon:"🔐",color:"#f59e0b",homeButtonIcon:"🔐",additionalInfo:{title:"How to proceed?",items:[{icon:"✓",iconColor:"blue-500",text:"Log in with your credentials"},{icon:"✓",iconColor:"blue-500",text:"Create an account if you don't have one"},{icon:"✓",iconColor:"blue-500",text:"Reset your password if you forgot it"}]}},500:{title:"Internal Server Error",message:"Something went wrong on our end. Please try again later.",icon:"🔧",color:"#ef4444",homeButtonIcon:"🏠",additionalInfo:{title:"What happened?",items:[{icon:"⚠️",iconColor:"red-500",text:"Our servers are experiencing issues"},{icon:"⚠️",iconColor:"red-500",text:"The problem is temporary"},{icon:"⚠️",iconColor:"red-500",text:"Try refreshing the page or come back later"}]}},503:{title:"Service Unavailable",message:"The service is temporarily unavailable. Please try again later.",icon:"🔧",color:"#f59e0b",homeButtonIcon:"🏠",additionalInfo:{title:"Service Status",items:[{icon:"⚠️",iconColor:"amber-500",text:"We're performing scheduled maintenance"},{icon:"⚠️",iconColor:"amber-500",text:"Normal service will resume shortly"},{icon:"⚠️",iconColor:"amber-500",text:"Check our status page for updates"}]}},network:{title:"Network Error",message:"Unable to connect to the server. Please check your internet connection.",icon:"📶",color:"#ef4444",homeButtonIcon:"🏠",additionalInfo:{title:"Connection Issues",items:[{icon:"⚠️",iconColor:"red-500",text:"Check your internet connection"},{icon:"⚠️",iconColor:"red-500",text:"Try refreshing the page"},{icon:"⚠️",iconColor:"red-500",text:"Contact your network administrator"}]}}};return H[t.errorType]||H[404]}),h=e.computed(()=>v.value),E=e.computed(()=>t.errorTitle||h.value.title),y=e.computed(()=>t.errorMessage||h.value.message),b=e.computed(()=>h.value.homeButtonIcon||"🏠"),f=e.computed(()=>t.showAdditionalInfo?h.value.additionalInfo:null),d=()=>{o?o.push(t.homeUrl):window.location.href=t.homeUrl},s=()=>{o&&window.history.length>1?o.back():window.history.length>1?window.history.back():d(),n("back")},c=async()=>{r.value=!0;try{await new Promise(H=>setTimeout(H,1e3)),window.location.reload()}catch(H){console.error("Retry failed:",H)}finally{r.value=!1}n("retry")},g=e.computed(()=>["min-h-screen relative flex items-center justify-center","px-4 sm:px-6 lg:px-8"]),S=e.computed(()=>["absolute inset-0 -z-10"]),k=e.computed(()=>["w-full max-w-2xl mx-auto text-center"]),N=e.computed(()=>["mb-8"]),F=e.computed(()=>["space-y-8"]),L=e.computed(()=>["flex justify-center mb-6"]),q=e.computed(()=>["w-32 h-32 flex items-center justify-center"]),w=e.computed(()=>["space-y-4"]),M=e.computed(()=>["text-6xl font-bold text-slate-300 mb-4"]),_=e.computed(()=>["text-3xl font-bold text-slate-900"]),C=e.computed(()=>["text-lg text-slate-600 max-w-lg mx-auto"]),z=e.computed(()=>["mt-8"]),O=e.computed(()=>["mt-8"]),G=e.computed(()=>["mt-6"]);return{isRetrying:r,reportSent:l,isOnline:i,errorId:u,isDev:m,errorConfig:h,title:E,message:y,homeButtonIcon:b,additionalInfoConfig:f,goHome:d,goBack:s,retry:c,layoutClasses:g,backgroundClasses:S,contentClasses:k,headerClasses:N,errorContentClasses:F,illustrationClasses:L,iconContainerClasses:q,detailsClasses:w,codeClasses:M,titleClasses:_,messageClasses:C,actionsClasses:z,additionalInfoClasses:O,helpClasses:G}}},N0={class:"flex justify-center"},$0={class:"flex items-center gap-3"},z0={class:"text-2xl font-bold text-slate-900"},D0={key:1,class:"bg-red-100 border border-red-200 rounded-lg p-4 mx-auto max-w-md mb-6"},T0={class:"flex flex-col sm:flex-row gap-4 justify-center"},A0=["disabled"],F0={key:0,class:"animate-spin"},P0={key:1},M0=["disabled"],L0={key:0},j0={key:1},O0={key:0,class:"mt-8 max-w-md mx-auto"},I0={class:"bg-white rounded-lg border border-slate-200 shadow-sm p-6"},_0={class:"text-lg font-semibold text-slate-900 mb-4"},R0={class:"space-y-3"},U0={class:"text-sm text-slate-600"},q0=["href"],H0={key:5,class:"text-xs text-slate-400 font-mono mt-4"};function W0(t,n,a,o,r,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o.layoutClasses)},[a.showBackground?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.backgroundClasses)},[e.renderSlot(t.$slots,"background",{},()=>[n[4]||(n[4]=e.createElementVNode("div",{class:"absolute inset-0 bg-gradient-to-br from-slate-50 to-slate-100"},null,-1))])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.contentClasses)},[t.$slots.header||a.showLogo?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.headerClasses)},[e.renderSlot(t.$slots,"header",{},()=>[e.createElementVNode("div",N0,[e.renderSlot(t.$slots,"logo",{},()=>[e.createElementVNode("div",$0,[n[5]||(n[5]=e.createElementVNode("div",{class:"w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center"},[e.createElementVNode("span",{class:"text-white font-bold text-lg"},"STL")],-1)),e.createElementVNode("span",z0,e.toDisplayString(a.brandName),1)])])])])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.errorContentClasses)},[t.$slots.illustration||a.showDefaultIllustration?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.illustrationClasses)},[e.renderSlot(t.$slots,"illustration",{},()=>[e.createElementVNode("div",{class:e.normalizeClass(o.iconContainerClasses)},[e.createElementVNode("div",{class:"text-8xl",style:e.normalizeStyle({color:o.errorConfig.color})},e.toDisplayString(o.errorConfig.icon),5)],2)])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.detailsClasses)},[a.errorCode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.codeClasses)},e.toDisplayString(a.errorCode),3)):e.createCommentVNode("",!0),e.createElementVNode("h1",{class:e.normalizeClass(o.titleClasses)},[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)])],2),e.createElementVNode("p",{class:e.normalizeClass(o.messageClasses)},[e.renderSlot(t.$slots,"message",{},()=>[e.createTextVNode(e.toDisplayString(o.message),1)])],2)],2),o.isOnline?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",D0,[...n[6]||(n[6]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-2 text-red-700"},[e.createElementVNode("span",{class:"w-3 h-3 bg-red-500 rounded-full animate-pulse"}),e.createElementVNode("span",{class:"font-medium"},"No Internet Connection")],-1)])])),t.$slots.actions||a.showDefaultActions?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(o.actionsClasses)},[e.renderSlot(t.$slots,"actions",{},()=>[e.createElementVNode("div",T0,[a.showHomeButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"bg-blue-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-blue-700 transition-colors flex items-center justify-center gap-2",onClick:n[0]||(n[0]=(...i)=>o.goHome&&o.goHome(...i))},[e.createElementVNode("span",null,e.toDisplayString(o.homeButtonIcon),1),e.createTextVNode(" "+e.toDisplayString(a.homeButtonText),1)])):e.createCommentVNode("",!0),a.showBackButton?(e.openBlock(),e.createElementBlock("button",{key:1,class:"border border-slate-300 text-slate-700 px-6 py-3 rounded-lg font-medium hover:bg-slate-50 transition-colors flex items-center justify-center gap-2",onClick:n[1]||(n[1]=(...i)=>o.goBack&&o.goBack(...i))},[n[7]||(n[7]=e.createElementVNode("span",null,"←",-1)),e.createTextVNode(" "+e.toDisplayString(a.backButtonText),1)])):e.createCommentVNode("",!0),a.showRetryButton?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:o.isRetrying||!o.isOnline,class:"border border-slate-300 text-slate-700 px-6 py-3 rounded-lg font-medium hover:bg-slate-50 transition-colors flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",onClick:n[2]||(n[2]=(...i)=>o.retry&&o.retry(...i))},[o.isRetrying?(e.openBlock(),e.createElementBlock("span",F0,"↻")):(e.openBlock(),e.createElementBlock("span",P0,"🔄")),e.createTextVNode(" "+e.toDisplayString(o.isRetrying?"Retrying...":a.retryButtonText),1)],8,A0)):e.createCommentVNode("",!0),a.showSupportButton?(e.openBlock(),e.createElementBlock("button",{key:3,disabled:o.reportSent,class:"bg-slate-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-slate-700 transition-colors flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",onClick:n[3]||(n[3]=i=>t.$emit("contact-support"))},[o.reportSent?(e.openBlock(),e.createElementBlock("span",L0,"✓")):(e.openBlock(),e.createElementBlock("span",j0,"📝")),e.createTextVNode(" "+e.toDisplayString(o.reportSent?"Report Sent":"Contact Support"),1)],8,M0)):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),t.$slots["additional-info"]||a.showAdditionalInfo?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(o.additionalInfoClasses)},[e.renderSlot(t.$slots,"additional-info",{},()=>[o.additionalInfoConfig?(e.openBlock(),e.createElementBlock("div",O0,[e.createElementVNode("div",I0,[e.createElementVNode("h3",_0,e.toDisplayString(o.additionalInfoConfig.title),1),e.createElementVNode("ul",R0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.additionalInfoConfig.items,(i,u)=>(e.openBlock(),e.createElementBlock("li",{key:u,class:"flex items-start gap-3 text-sm text-slate-600"},[e.createElementVNode("span",{class:e.normalizeClass(`w-4 h-4 text-${i.iconColor||"slate-400"} flex-shrink-0 mt-0.5`)},e.toDisplayString(i.icon),3),e.createElementVNode("span",null,e.toDisplayString(i.text),1)]))),128))])])])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0),t.$slots.help||a.helpText?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(o.helpClasses)},[e.renderSlot(t.$slots,"help",{},()=>[e.createElementVNode("p",U0,[e.createTextVNode(e.toDisplayString(a.helpText)+" ",1),a.supportUrl?(e.openBlock(),e.createElementBlock("a",{key:0,href:a.supportUrl,class:"text-blue-600 hover:text-blue-700 underline ml-1"},[...n[8]||(n[8]=[e.createElementVNode("span",{class:"inline-block w-4 h-4 mr-1"},"❓",-1),e.createTextVNode(" Get Help ",-1)])],8,q0)):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),o.isDev?(e.openBlock(),e.createElementBlock("div",H0," Error ID: "+e.toDisplayString(o.errorId),1)):e.createCommentVNode("",!0)],2)],2)],2)}const nr=yt(E0,[["render",W0]]),Xt={mounted(t,n){if(!n.value)return;const a=Object.keys(n.modifiers)[0]||"top",o=document.createElement("div");o.textContent=n.value,o.className="tooltip-custom",o.style.cssText=`
|
|
608
608
|
position: fixed;
|
|
609
609
|
z-index: 9999;
|
|
610
610
|
background-color: rgba(0, 0, 0, 0.9);
|