1import{_ as Y}from"./DdcQtXmf.js";import{_ as Z}from"./DPdnR-Xr.js";import{D as K,_ as P,A as ye}from"./C-KGT4Z-.js";import{A as be}from"./CaZ4G8Fp.js";import{_ as M}from"./Ce5UstYs.js";import{_ as j}from"./CmnROxsM.js";import{u as ke}from"./BUKF7xmH.js";import{d as I,u as J,K as Q,I as O,o as s,b as x,e as t,t as m,f as i,w as l,p as T,g as e,h as u,F as H,k as y,x as p,_ as B,a3 as ee,M as G,j as W,P as we,L as Ce,ay as Ae,a9 as me,r as q,B as E,v as ge,ac as De}from"./Doa4AFmo.js";import{u as ne}from"./Cs7m4BS8.js";import{u as ie}from"./EFp2JO65.js";import{A as V}from"./BIqlOZV-.js";import{T as le}from"./CwqavqX7.js";import{u as Se}from"./3L5oPVIH.js";import{u as Pe}from"./Co3Uxx3G.js";import{T as pe}from"./CjHpPwPD.js";import{A as _e}from"./CKAg2oCj.js";import{u as Le}from"./uw59dHpu.js";import{F as fe}from"./aU6nVMZw.js";import{_ as se}from"./CXEMAxGV.js";import{a as te,_ as ae}from"./BU2Wftem.js";import{C as Re}from"./smIIYsLS.js";import{_ as X}from"./BW_9FyxG.js";import{u as Te}from"./BlUYB_PW.js";import{L as ve}from"./CAwJeAnT.js";import{D as Fe}from"./2Q6ug9Pz.js";import{C as ze}from"./C6FjEUWg.js";import{Z as He}from"./BcdDUZEA.js";import{C as he}from"./CO69zZTA.js";import{B as Ke}from"./D-tc_MvG.js";import{A as Me}from"./CZIUzbzA.js";import"./DN1Y8Ja6.js";import"./DPDk5al4.js";import"./CUFj9rgX.js";import"./BCoKEPdg.js";import"./n03tvo1P.js";import"./CDz6nY8t.js";import"./Bw26tYaD.js";import"./CQ4pixCQ.js";import"./Dz0xEBdU.js";import"./CRZ2yVMU.js";import"./i-6ScfrA.js";import"./DUV02Fey.js";import"./BDKo45SJ.js";import"./CHIgUVhi.js";import"./ChOKVcqp.js";import"./DERlQqGs.js";import"./15l93Rve.js";import"./P_KTFL2f.js";import"./DZXeywCU.js";import"./CkeuFeG3.js";import"./jFYhBC76.js";import"./BUlUuVWp.js";import"./Cv0WOPc0.js";import"./BGxwVcHF.js";import"./0ssFvjcK.js";import"./BAZ3ZleX.js";import"./DJTNenQx.js";import"./BR0M1vqG.js";import"./M0R3iYGM.js";import"./Bd2bO7ri.js";import"./BsxQX2vZ.js";import"./DBZsv077.js";const je={class:"space-y-4"},Ie={class:"flex items-end justify-between gap-4"},Ue={class:"section-title"},We={class:"section-description"},Ve={class:"grid grid-cols-2 lg:grid-cols-4 gap-4"},Ne=I({__name:"RevenueHeadlineWidget",props:{titleKey:{}},setup(b){const d=J(),v=p(()=>`/app/org/${d.params.orgid}/workspace/${d.params.workspaceid}/analytics/revenue`),{t:c}=Q(),{isLoading:_,hasData:$,kpis:n,chartData:C,loadAnalytics:D}=ke(),{formatCurrency:A}=ne(),{hasFeature:r}=ie(),S=p(()=>C.value?.revenueTrend?C.value.revenueTrend.map((h,L)=>({date:new Date(2024,L,1),label:h.month,totalRevenue:h.totalRevenue})):[]),a=p(()=>[{key:"totalRevenue",label:c("analytics.revenue.revenueLabel"),color:"var(--chart-1)"}]);return O(()=>{r("advanced_analytics")&&D()}),(h,L)=>{const f=Y,g=Z;return s(),x("section",je,[t("div",Ie,[t("div",null,[t("h2",Ue,m(h.$t("dashboard.revenueHeadline")),1),t("p",We,m(h.$t("dashboard.revenueSubtitle")),1)]),i(f,{to:v.value,class:"shrink-0 inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline"},{default:l(()=>[T(m(h.$t("common.viewDetails"))+" ",1),i(e(V),{class:"size-3.5 rtl:rotate-180"})]),_:1},8,["to"])]),e(_)&&!e($)?(s(),u(e(K),{key:0,variant:"section",message:h.$t("dashboard.revenueHeadline")},null,8,["message"])):(s(),x(H,{key:1},[t("div",Ve,[e(n)?(s(),u(P,{key:0,title:h.$t("analytics.revenue.totalRevenue"),value:e(A)(e(n).totalRevenue),insight:h.$t("analytics.revenue.allTimeEarnings"),context:h.$t("analytics.revenue.acrossAllContracts")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:1,title:h.$t("analytics.revenue.monthlyRevenue"),value:e(A)(e(n).monthlyRevenue),trend:{value:Math.abs(e(n).trends.revenueChange),direction:e(n).trends.revenueChange>=0?"up":"down"},insight:h.$t("analytics.revenue.currentMonth"),context:h.$t("analytics.revenue.vsLastMonth")},null,8,["title","value","trend","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:2,title:h.$t("analytics.revenue.collectionRate"),value:`${e(n).collectionRate.toFixed(1)}%`,insight:h.$t("analytics.revenue.collectionHealth"),context:h.$t("analytics.revenue.onTimeRatio")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:3,title:h.$t("analytics.revenue.outstanding"),value:e(A)(e(n).outstandingAmount),insight:h.$t("analytics.revenue.pendingCollection"),context:h.$t("analytics.revenue.unpaidInvoices")},null,8,["title","value","insight","context"])):y("",!0)]),i(g,null,{fallback:l(()=>[i(e(M),null,{default:l(()=>[i(e(j),{class:"h-[300px] flex items-center justify-center"},{default:l(()=>[i(e(K),{variant:"card",message:h.$t("dashboard.loadingChart")},null,8,["message"])]),_:1})]),_:1})]),default:l(()=>[e(C)?(s(),u(be,{key:0,title:h.$t("analytics.revenue.revenueTrends"),description:h.$t("analytics.revenue.monthlyTrend"),icon:e(le),"icon-color":"green",data:S.value,series:a.value,"format-value":e(A),height:"240px"},null,8,["title","description","icon","data","series","format-value"])):y("",!0)]),_:1})],64))])}}}),Oe=B(Ne,[["__scopeId","data-v-0100eb5e"]]),Be={class:"space-y-4"},Ee={class:"flex items-end justify-between gap-4"},Ge={class:"section-title"},qe={class:"section-description"},Ye={class:"grid grid-cols-2 lg:grid-cols-4 gap-4"},Ze=I({__name:"CollectionsHeadlineWidget",props:{titleKey:{}},setup(b){const d=J(),v=p(()=>`/app/org/${d.params.orgid}/workspace/${d.params.workspaceid}/analytics/payments`),{t:c}=Q(),{isLoading:_,hasData:$,kpis:n,chartData:C,loadAnalytics:D}=Se(),{formatCurrency:A}=ne(),r=p(()=>C.value?.collectionTrend?C.value.collectionTrend.map(a=>({date:new Date(a.date),label:new Date(a.date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),collections:a.amount})):[]),S=p(()=>[{key:"collections",label:c("analytics.payments.collections"),color:"var(--chart-2)"}]);return O(()=>{D()}),(a,h)=>{const L=Y,f=Z;return s(),x("section",Be,[t("div",Ee,[t("div",null,[t("h2",Ge,m(a.$t("dashboard.collectionsHeadline")),1),t("p",qe,m(a.$t("dashboard.collectionsSubtitle")),1)]),i(L,{to:v.value,class:"shrink-0 inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline"},{default:l(()=>[T(m(a.$t("common.viewDetails"))+" ",1),i(e(V),{class:"size-3.5 rtl:rotate-180"})]),_:1},8,["to"])]),e(_)&&!e($)?(s(),u(e(K),{key:0,variant:"section",message:a.$t("dashboard.collectionsHeadline")},null,8,["message"])):(s(),x(H,{key:1},[t("div",Ye,[e(n)?(s(),u(P,{key:0,title:a.$t("analytics.payments.todaysCollections"),value:e(A)(e(n).todayCollections),trend:{value:Math.abs(e(n).trends.dailyChange),direction:e(n).trends.dailyChange>=0?"up":"down"},insight:a.$t("analytics.payments.dailyPerformance"),context:a.$t("analytics.payments.vsYesterday")},null,8,["title","value","trend","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:1,title:a.$t("analytics.payments.thisWeek"),value:e(A)(e(n).weeklyCollections),trend:{value:Math.abs(e(n).trends.weeklyChange),direction:e(n).trends.weeklyChange>=0?"up":"down"},insight:a.$t("analytics.payments.weeklyTotal"),context:a.$t("analytics.payments.vsLastWeek")},null,8,["title","value","trend","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:2,title:a.$t("analytics.payments.thisMonth"),value:e(A)(e(n).monthlyCollections),insight:a.$t("analytics.payments.monthlyTotal"),context:a.$t("analytics.payments.currentMonth")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:3,title:a.$t("analytics.payments.overdue"),value:e(A)(e(n).overduePayments),insight:a.$t("analytics.payments.requiresAttention"),context:a.$t("analytics.payments.pastDueDate")},null,8,["title","value","insight","context"])):y("",!0)]),i(f,null,{fallback:l(()=>[i(e(M),null,{default:l(()=>[i(e(j),{class:"h-[300px] flex items-center justify-center"},{default:l(()=>[i(e(K),{variant:"card",message:a.$t("dashboard.loadingChart")},null,8,["message"])]),_:1})]),_:1})]),default:l(()=>[e(C)?(s(),u(be,{key:0,title:a.$t("analytics.payments.collectionTrend"),description:a.$t("analytics.payments.collectionTrendDescription"),icon:e(le),"icon-color":"emerald",data:r.value,series:S.value,stacked:!1,"format-value":e(A),height:"240px"},null,8,["title","description","icon","data","series","format-value"])):y("",!0)]),_:1})],64))])}}}),Je=B(Ze,[["__scopeId","data-v-4b689507"]]),Qe={class:"space-y-4"},Xe={class:"flex items-end justify-between gap-4"},et={class:"section-title"},tt={class:"section-description"},at={class:"grid grid-cols-2 lg:grid-cols-4 gap-4"},st=I({__name:"FleetStatusHeadlineWidget",props:{titleKey:{}},setup(b){const d=J(),v=p(()=>`/app/org/${d.params.orgid}/workspace/${d.params.workspaceid}/analytics/fleet`),{t:c}=Q(),{isLoading:_,hasData:$,kpis:n,chartData:C,loadAnalytics:D}=Pe(),A=p(()=>
1{if(!C.value?.fleetStatusDistribution)return[];const r=C.value.fleetStatusDistribution;return[{key:"available",label:c("analytics.fleet.statusAvailable"),value:r.available,color:"var(--chart-2)"},{key:"rented",label:c("analytics.fleet.statusRented"),value:r.rented,color:"var(--chart-1)"},{key:"maintenance",label:c("analytics.fleet.statusMaintenance"),value:r.maintenance,color:"var(--chart-3)"},{key:"reserved",label:c("analytics.fleet.statusReserved"),value:r.reserved,color:"var(--chart-4)"},{key:"other",label:c("analytics.fleet.statusOther"),value:r.other,color:"var(--chart-5)"}]});return O(()=>{D()}),(r,S)=>{const a=Y,h=Z;return s(),x("section",Qe,[t("div",Xe,[t("div",null,[t("h2",et,m(r.$t("dashboard.fleetStatusHeadline")),1),t("p",tt,m(r.$t("dashboard.fleetStatusSubtitle")),1)]),i(a,{to:v.value,class:"shrink-0 inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline"},{default:l(()=>[T(m(r.$t("common.viewDetails"))+" ",1),i(e(V),{class:"size-3.5 rtl:rotate-180"})]),_:1},8,["to"])]),e(_)&&!e($)?(s(),u(e(K),{key:0,variant:"section",message:r.$t("dashboard.fleetStatusHeadline")},null,8,["message"])):(s(),x(H,{key:1},[t("div",at,[e(n)?(s(),u(P,{key:0,title:r.$t("analytics.fleet.totalVehicles"),value:e(n).totalVehicles.toLocaleString(),insight:r.$t("analytics.fleet.entireFleet"),context:r.$t("analytics.fleet.allVehicles")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:1,title:r.$t("analytics.fleet.available"),value:e(n).availableVehicles.toLocaleString(),insight:r.$t("analytics.fleet.readyToRent"),context:r.$t("analytics.fleet.idleVehicles")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:2,title:r.$t("analytics.fleet.inMaintenance"),value:e(n).vehiclesInMaintenance.toLocaleString(),insight:r.$t("analytics.fleet.underService"),context:r.$t("analytics.fleet.outOfService")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:3,title:r.$t("analytics.fleet.utilization"),value:`${e(n).fleetUtilizationPercentage.toFixed(1)}%`,insight:r.$t("analytics.fleet.fleetEfficiency"),context:r.$t("analytics.fleet.activeRatio")},null,8,["title","value","insight","context"])):y("",!0)]),i(h,null,{fallback:l(()=>[i(e(M),null,{default:l(()=>[i(e(j),{class:"h-[300px] flex items-center justify-center"},{default:l(()=>[i(e(K),{variant:"card",message:r.$t("dashboard.loadingChart")},null,8,["message"])]),_:1})]),_:1})]),default:l(()=>[e(C)?(s(),u(ye,{key:0,title:r.$t("analytics.fleet.fleetStatus"),description:r.$t("analytics.fleet.currentDistribution"),icon:e(pe),"icon-color":"emerald",data:A.value,"show-legend":!0},null,8,["title","description","icon","data"])):y("",!0)]),_:1})],64))])}}}),nt=B(st,[["__scopeId","data-v-8bfc4b4d"]]);function it(){const b=W(null),d=W(!1),v=W(null),c=p(()=>b.value!==null);async function _(){if(!d.value){d.value=!0,v.value=null;try{const{data:$}=await ee("/api/analytics/fleet-performance");$.value?.success&&$.value.data?b.value=$.value.data:(v.value=$.value?.error||"Failed to load fleet performance",G.error("Failed to load fleet performance"))}catch($){console.error("â Error loading fleet performance:",$),v.value=$.message||"An unexpected error occurred",G.error("Error loading fleet performance data")}finally{d.value=!1}}}return{data:b,isLoading:d,error:v,hasData:c,loadAnalytics:_}}const lt={class:"space-y-4"},ot={class:"flex items-end justify-between gap-4"},rt={class:"section-title"},ct={class:"section-description"},ut={class:"grid grid-cols-2 lg:grid-cols-4 gap-4"},dt=I({__name:"FleetPerformanceHeadlineWidget",props:{titleKey:{}},setup(b){const d=J(),v=p(()=>`/app/org/${d.params.orgid}/workspace/${d.params.workspaceid}/analytics/fleet`),{t:c}=Q(),{isLoading:_,hasData:$,data:n,loadAnalytics:C}=it(),{formatCurrency:D}=ne(),{hasFeature:A}=ie(),r=p(()=>{const g=n.value?.avgRoiPct;return g==null?"â":`${g.toFixed(1)}%`}),S=p(()=>n.value?.topPerformers?.[0]??null),a=p(()=>S.value?.vehicleNumber??"â"),h=p(()=>{const g=S.value?.roiPct;return g==null?c("analytics.fleetPerformance.bestPerformerContext"):`${g.toFixed(1)}%`}),L=p(()=>(n.value?.topPerformers??[]).map((U,z)=>({date:new Date(2024,0,z+1),label:U.vehicleNumber,roiPct:U.roiPct??0}))),f=p(()=>[{key:"roiPct",label:c("analytics.fleetPerformance.roiLabel"),color:"var(--chart-1)"}]);return O(()=>{A("advanced_analytics")&&C()}),(g,U)=>{const z=Y,R=Z;return s(),x("section",lt,[t("div",ot,[t("div",null,[t("h2",rt,m(g.$t("dashboard.fleetPerformanceHeadline")),1),t("p",ct,m(g.$t("dashboard.fleetPerformanceSubtitle")),1)]),i(z,{to:v.value,class:"shrink-0 inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline"},{default:l(()=>[T(m(g.$t("common.viewDetails"))+" ",1),i(e(V),{class:"size-3.5 rtl:rotate-180"})]),_:1},8,["to"])]),e(_)&&!e($)?(s(),u(e(K),{key:0,variant:"section",message:g.$t("dashboard.fleetPerformanceHeadline")},null,8,["message"])):(s(),x(H,{key:1},[t("div",ut,[e(n)?(s(),u(P,{key:0,title:g.$t("analytics.fleetPerformance.cashContribution"),value:e(D)(e(n).totalContribution),insight:g.$t("analytics.fleetPerformance.cashContributionInsight"),context:g.$t("analytics.fleetPerformance.cashContributionContext")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:1,title:g.$t("analytics.fleetPerformance.avgRoi"),value:r.value,insight:g.$t("analytics.fleetPerformance.avgRoiInsight"),context:g.$t("analytics.fleetPerformance.avgRoiContext")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:2,title:g.$t("analytics.fleetPerformance.profitableVehicles"),value:`${e(n).profitableCount} / ${e(n).vehicleCount}`,insight:g.$t("analytics.fleetPerformance.profitableVehiclesInsight"),context:g.$t("analytics.fleetPerformance.profitableVehiclesContext")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:3,title:g.$t("analytics.fleetPerformance.bestPerformer"),value:a.value,insight:g.$t("analytics.fleetPerformance.bestPerformerInsight"),context:h.value},null,8,["title","value","insight","context"])):y("",!0)]),i(R,null,{fallback:l(()=>[i(e(M),null,{default:l(()=>[i(e(j),{class:"h-[300px] flex items-center justify-center"},{default:l(()=>[i(e(K),{variant:"card",message:g.$t("dashboard.loadingChart")},null,8,["message"])]),_:1})]),_:1})]),default:l(()=>[e(n)?(s(),u(_e,{key:0,title:g.$t("analytics.fleetPerformance.topPerformersTitle"),description:g.$t("analytics.fleetPerformance.topPerformersDescription"),icon:e(le),"icon-color":"emerald",data:L.value,series:f.value,orientation:"horizontal",height:"240px","format-value":F=>`${F.toFixed(1)}%`},null,8,["title","description","icon","data","series","format-value"])):y("",!0)]),_:1})],64))])}}}),mt=B(dt,[["__scopeId","data-v-801a743b"]]),gt={class:"space-y-4"},pt={class:"flex items-end justify-between gap-4"},ft={class:"section-title"},vt={class:"section-description"},ht={class:"grid grid-cols-2 lg:grid-cols-4 gap-4"},yt=I({__name:"CustomersHeadlineWidget",props:{titleKey:{}},setup(b){const d=J(),v=p(()=>`/app/org/${d.params.orgid}/workspace/${d.params.workspaceid}/analytics/customers`),{t:c}=Q(),{isLoading:_,hasData:$,kpis:n,chartData:C,loadAnalytics:D}=Le(),{hasFeature:A}=ie(),r=p(()=>C.value?.customerGrowthTrend?C.value.customerGrowthTrend.map((a,h)=>({date:new Date(2024,h,1),label:a.month,newCustomers:a.newCustomers,newAgreements:a.newAgreements})):[]),S=p(()=>[{key:"newCustomers",label:c("analytics.customers.newCustomers"),color:"var(--chart-1)"},{key:"newAgreements",label:c("analytics.customers.newAgreements"),color:"var(--chart-2)"}]);return O(()=>{A("advanced_analytics")&&D()}),(a,h)=>{const L=Y,f=Z;return s(),x("section",gt,[t("div",pt,[t("div",null,[t("h2",ft,m(a.$t("dashboard.customersHeadline")),1),t("p",vt,m(a.$t("dashboard.customersSubtitle")),1)]),i(L,{to:v.value,class:"shrink-0 inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline"},{default:l(()=>[T(m(a.$t("common.viewDetails"))+" ",1),i(e(V),{class:"size-3.5 rtl:rotate-180"})]),_:1},8,["to"])]),e(_)&&!e($)?(s(),u(e(K),{key:0,variant:"section",message:a.$t("dashboard.customersHeadline")},null,8,["message"])):(s(),x(H,{key:1},[t("div",ht,[e(n)?(s(),u(P,{key:0,title:a.$t("analytics.customers.totalCustomers"),value:e(n).totalCustomers.toLocaleStr
1ing(),insight:a.$t("analytics.customers.allCustomers"),context:a.$t("analytics.customers.entireBase")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:1,title:a.$t("analytics.customers.activeCustomers"),value:e(n).activeCustomers.toLocaleString(),insight:a.$t("analytics.customers.withAgreements"),context:a.$t("analytics.customers.currentlyEngaged")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:2,title:a.$t("analytics.customers.newThisMonth"),value:e(n).newCustomersThisMonth.toLocaleString(),trend:{value:Math.abs(e(n).trends.customerGrowth),direction:e(n).trends.customerGrowth>=0?"up":"down"},insight:a.$t("analytics.customers.newAcquisitions"),context:a.$t("analytics.customers.vsLastMonth")},null,8,["title","value","trend","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:3,title:a.$t("analytics.customers.retention"),value:`${e(n).customerRetentionRate.toFixed(1)}%`,insight:a.$t("analytics.customers.retentionHealth"),context:a.$t("analytics.customers.repeatRatio")},null,8,["title","value","insight","context"])):y("",!0)]),i(f,null,{fallback:l(()=>[i(e(M),null,{default:l(()=>[i(e(j),{class:"h-[300px] flex items-center justify-center"},{default:l(()=>[i(e(K),{variant:"card",message:a.$t("dashboard.loadingChart")},null,8,["message"])]),_:1})]),_:1})]),default:l(()=>[e(C)?(s(),u(_e,{key:0,title:a.$t("analytics.customers.customerGrowth"),description:a.$t("analytics.customers.acquisitionTrend"),icon:e(le),"icon-color":"blue",data:r.value,series:S.value,height:"240px","show-footer":!0,"format-value":g=>g.toLocaleString()},null,8,["title","description","icon","data","series","format-value"])):y("",!0)]),_:1})],64))])}}}),bt=B(yt,[["__scopeId","data-v-9488171f"]]);function _t(b={}){const{autoLoad:d=!1}=b,v=W(null),c=W(!1),_=W(null),$=p(()=>v.value!==null),n=p(()=>v.value?.kpis||null),C=p(()=>v.value?.statusDistribution||[]),D=p(()=>v.value?.expiringAgreements||[]);async function A(){if(!c.value){c.value=!0,_.value=null;try{const{data:S}=await ee("/api/analytics/agreements");S.value?.success&&S.value.data?v.value=S.value.data:(_.value=S.value?.error||"Failed to load analytics",G.error("Failed to load agreement analytics"))}catch(S){console.error("â Error loading agreement analytics:",S),_.value=S.message||"An unexpected error occurred",G.error("Error loading analytics data")}finally{c.value=!1}}}async function r(){await A(),G.success("Analytics data refreshed")}return d&&A(),{analytics:v,isLoading:c,error:_,hasData:$,kpis:n,statusDistribution:C,expiringAgreements:D,loadAnalytics:A,refresh:r}}const $t={class:"space-y-4"},xt={class:"flex items-end justify-between gap-4"},kt={class:"section-title"},wt={class:"section-description"},Ct={class:"grid grid-cols-2 lg:grid-cols-4 gap-4"},At=I({__name:"AgreementsHeadlineWidget",props:{titleKey:{}},setup(b){const d=J(),v=p(()=>`/app/org/${d.params.orgid}/workspace/${d.params.workspaceid}/search/agreement`),{t:c}=Q(),{isLoading:_,hasData:$,kpis:n,statusDistribution:C,loadAnalytics:D}=_t(),{formatCurrency:A}=ne(),r={active:{labelKey:"analytics.agreements.statusActive",color:"var(--chart-1)"},draft:{labelKey:"analytics.agreements.statusDraft",color:"var(--chart-2)"},pending_signature:{labelKey:"analytics.agreements.statusPendingSignature",color:"var(--chart-3)"},signed:{labelKey:"analytics.agreements.statusSigned",color:"var(--chart-4)"},expired:{labelKey:"analytics.agreements.statusExpired",color:"var(--chart-5)"},reserved:{labelKey:"analytics.agreements.statusReserved",color:"var(--chart-1)"},closed:{labelKey:"analytics.agreements.statusClosed",color:"var(--chart-2)"},terminated:{labelKey:"analytics.agreements.statusTerminated",color:"var(--chart-3)"},cancelled:{labelKey:"analytics.agreements.statusCancelled",color:"var(--chart-4)"}},S=p(()=>C.value.map((a,h)=>{const L=r[a.status];return{key:a.status,label:L?c(L.labelKey):a.status,value:a.count,color:L?L.color:`var(--chart-${h%5+1})`}}));return O(()=>{D()}),(a,h)=>{const L=Y,f=Z;return s(),x("section",$t,[t("div",xt,[t("div",null,[t("h2",kt,m(a.$t("dashboard.agreementsHeadline")),1),t("p",wt,m(a.$t("dashboard.agreementsSubtitle")),1)]),i(L,{to:v.value,class:"shrink-0 inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline"},{default:l(()=>[T(m(a.$t("common.viewDetails"))+" ",1),i(e(V),{class:"size-3.5 rtl:rotate-180"})]),_:1},8,["to"])]),e(_)&&!e($)?(s(),u(e(K),{key:0,variant:"section",message:a.$t("dashboard.agreementsHeadline")},null,8,["message"])):(s(),x(H,{key:1},[t("div",Ct,[e(n)?(s(),u(P,{key:0,title:a.$t("analytics.agreements.active"),value:e(n).active.toLocaleStr
1ing(),insight:a.$t("analytics.agreements.activeInsight"),context:a.$t("analytics.agreements.activeContext")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:1,title:a.$t("analytics.agreements.expiringSoon"),value:e(n).expiringSoon.toLocaleString(),insight:a.$t("analytics.agreements.expiringSoonInsight"),context:a.$t("analytics.agreements.expiringSoonContext")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:2,title:a.$t("analytics.agreements.pending"),value:e(n).pending.toLocaleString(),insight:a.$t("analytics.agreements.pendingInsight"),context:a.$t("analytics.agreements.pendingContext")},null,8,["title","value","insight","context"])):y("",!0),e(n)?(s(),u(P,{key:3,title:a.$t("analytics.agreements.activeValue"),value:e(A)(e(n).activeContractValue),insight:a.$t("analytics.agreements.activeValueInsight"),context:a.$t("analytics.agreements.activeValueContext")},null,8,["title","value","insight","context"])):y("",!0)]),i(f,null,{fallback:l(()=>[i(e(M),null,{default:l(()=>[i(e(j),{class:"h-[300px] flex items-center justify-center"},{default:l(()=>[i(e(K),{variant:"card",message:a.$t("dashboard.loadingChart")},null,8,["message"])]),_:1})]),_:1})]),default:l(()=>[e($)?(s(),u(ye,{key:0,title:a.$t("analytics.agreements.statusDistribution"),description:a.$t("analytics.agreements.statusDistributionDescription"),icon:e(fe),"icon-color":"blue",data:S.value,"show-legend":!0},null,8,["title","description","icon","data"])):y("",!0)]),_:1})],64))])}}}),Dt=B(At,[["__scopeId","data-v-650d4cfb"]]),St=[{id:"revenue_headline",slice:"revenue",requiresFeature:"advanced_analytics",home:!0,order:1,dataStatus:"live",titleKey:"dashboard.revenueHeadline",defaultSize:"lg",component:Oe},{id:"collections_headline",slice:"collections",home:!0,order:1,dataStatus:"live",titleKey:"dashboard.collectionsHeadline",defaultSize:"lg",component:Je},{id:"fleet_status_headline",slice:"fleet_status",home:!0,order:1,dataStatus:"live",titleKey:"dashboard.fleetStatusHeadline",defaultSize:"md",component:nt},{id:"fleet_performance_headline",slice:"fleet_performance",requiresFeature:"advanced_analytics",home:!0,order:1,dataStatus:"live",titleKey:"dashboard.fleetPerformanceHeadline",defaultSize:"lg",component:mt},{id:"customers_headline",slice:"customers",requiresFeature:"advanced_analytics",home:!0,order:1,dataStatus:"live",titleKey:"dashboard.customersHeadline",defaultSize:"md",component:bt},{id:"agreements_headline",slice:"agreements",home:!0,order:1,dataStatus:"live",titleKey:"dashboard.agreementsHeadline",defaultSize:"md",component:Dt}];function Pt(b,d,v={}){return b.filter(c=>v.homeOnly?c.home:!0).filter(c=>d.hasDashboard(c.slice)).sort((c,_)=>c.order-_.order).map(c=>c.dataStatus==="coming_soon"?{def:c,mode:"coming_soon"}:c.requiresFeature&&!d.hasFeature(c.requiresFeature)?{def:c,mode:"teaser",minPlan:d.getFeatureMinPlan(c.requiresFeature)}:{def:c,mode:"live"})}const Lt=I({__name:"ComingSoonWidget",props:{titleKey:{default:"dashboard.metric"}},setup(b){return(d,v)=>(s(),u(e(M),{class:"opacity-80"},{default:l(()=>[i(e(ae),null,{default:l(()=>[i(e(te),{class:"section-title"},{default:l(()=>[T(m(d.$t(b.titleKey)),1)]),_:1}),i(e(se),{class:"section-description"},{default:l(()=>[T(m(d.$t("dashboard.comingSoon")),1)]),_:1})]),_:1}),i(e(j),{class:"flex items-center justify-center py-8 text-muted-foreground"},{default:l(()=>[i(e(Re),{class:"size-5 me-2"}),t("span",null,m(d.$t("dashboard.comingSoonHint")),1)]),_:1})]),_:1}))}}),Rt={class:"text-sm text-muted-foreground"},Tt={key:0},Ft={key:1},zt=I({__name:"WidgetTeaser",props:{titleKey:{},minPlan:{},feature:{}},setup(b){const d=b,{openUpgradeContact:v}=Te();function c(){v(d.feature)}return(_,$)=>(s(),u(e(M),{class:"relative overflow-hidden opacity-90"},{default:l(()=>[i(e(ae),null,{default:l(()=>[i(e(te),{class:"section-title flex items-center gap-2"},{default:l(()=>[i(e(ve),{class:"size-4 text-muted-foreground"}),t("span",null,m(_.$t(b.titleKey)),1)]),_:1})]),_:1}),i(e(j),{class:"space-y-4"},{default:l(()=>[$[0]||($[0]=t("div",{class:"flex items-end gap-2 h-24 blur-sm select-none pointer-events-none","aria-hidden":"true"},[t("div",{class:"flex-1 rounded-md bg-muted h-1/3"}),t("div",{class:"flex-1 rounded-md bg-muted h-2/3"}),t("div",{class:"flex-1 rounded-md bg-muted h-1/2"}),t("div",{class:"flex-1 rounded-md bg-muted h-full"}),t("div",{class:"flex-1 rounded-md bg-muted h-3/4"}),t("div",{class:"flex-1 rounded-md bg-muted h-2/5"})],-1)),t("p",Rt,m(_.$t("dashboard.lockedPreview")),1),i(e(X),{variant:"outline",size:"sm",class:"w-full",onClick:c},{default:l(()=>[i(e(ve),{class:"size-3.5 me-2"}),b.minPlan?(s(),x("span",Tt,m(_.$t("dashboard.upgradeToUnlock",{plan:b.minPlan}
1)),1)):(s(),x("span",Ft,m(_.$t("dashboard.upgradeToUnlockGeneric")),1))]),_:1})]),_:1})]),_:1}))}});function Ht(){const b=W(null),d=W(!1),v=W(null),c=W(new Set),_=p(()=>b.value?.metrics??null),$=p(()=>b.value?.trends??null),n=p(()=>b.value?.alerts?b.value.alerts.filter(f=>!c.value.has(f.id)):[]),C=p(()=>b.value?.activity??[]),D=p(()=>b.value?.charts??null);async function A(){d.value=!0,v.value=null;try{const[f,g,U]=await Promise.all([ee("/api/agreements/stats"),ee("/api/vehicles/stats"),ee("/api/invoices/stats")]),z=f.data.value?.data,R=g.data.value?.data,F=U.data.value?.data,N={activeAgreements:z?.activeCount??z?.active??0,monthlyRevenue:F?.monthlyRevenue??F?.totalRevenue??0,fleetUtilization:R?.utilizationRate??S(R),collectionRate:F?.collectionRate??0},oe={agreementsTrend:{value:z?.trend??5,direction:"up"},revenueTrend:{value:F?.revenueTrend??8,direction:"up"},utilizationTrend:{value:R?.utilizationTrend??2,direction:"up"},collectionTrend:{value:F?.collectionTrend??1,direction:"up"}},re=a(N,z,R,F),ce=h(),ue={revenueByMonth:[],fleetStatus:{available:R?.available??0,rented:R?.rented??R?.inUse??0,maintenance:R?.maintenance??R?.inMaintenance??0}};b.value={metrics:N,trends:oe,alerts:re,activity:ce,charts:ue}}catch(f){console.error("â Error loading dashboard:",f),v.value=f.message||"Failed to load dashboard data",b.value=L(),G.error("Failed to load some dashboard data")}finally{d.value=!1}}function r(f){c.value.add(f)}function S(f){if(!f)return 0;const g=f.total??f.totalVehicles??0,U=f.rented??f.inUse??f.active??0;return g===0?0:Math.round(U/g*100)}function a(f,g,U,z){const R=[];f.collectionRate<85&&f.collectionRate>0&&R.push({id:"low-collection-rate",title:"Collection Rate Below Target",description:`Current collection rate is ${f.collectionRate}%. Target is 85%+`,type:"payment",severity:f.collectionRate<70?"high":"medium",createdAt:new Date});const F=z?.overdueCount??0;F>0&&R.push({id:"overdue-payments",title:`${F} Overdue Payment${F>1?"s":""}`,description:"Payments require immediate attention",type:"payment",severity:F>5?"high":"medium",createdAt:new Date}),f.fleetUtilization<60&&f.fleetUtilization>0&&R.push({id:"low-utilization",title:"Fleet Underutilized",description:`Only ${f.fleetUtilization}% of fleet is currently in use`,type:"maintenance",severity:"low",createdAt:new Date});const N=g?.expiringSoon??0;return N>0&&R.push({id:"expiring-agreements",title:`${N} Agreement${N>1?"s":""} Expiring Soon`,description:"Review and renew upcoming expirations",type:"agreement",severity:"medium",createdAt:new Date}),R}function h(){return[{id:"1",title:"System Ready",description:"Dashboard loaded successfully",type:"system",timestamp:new Date}]}function L(){return{metrics:{activeAgreements:0,monthlyRevenue:0,fleetUtilization:0,collectionRate:0},trends:{agreementsTrend:{value:0,direction:"neutral"},revenueTrend:{value:0,direction:"neutral"},utilizationTrend:{value:0,direction:"neutral"},collectionTrend:{value:0,direction:"neutral"}},alerts:[],activity:[],charts:{revenueByMonth:[],fleetStatus:{available:0,rented:0,maintenance:0}}}}return{dashboard:b,isLoading:d,error:v,metrics:_,trends:$,alerts:n,activity:C,charts:D,load:A,dismissAlert:r}}const Kt={key:0,class:"space-y-6"},Mt={class:"flex items-center justify-center py-12"},jt={class:"flex flex-col items-center gap-3"},It={key:1,class:"space-y-6"},Ut={class:"flex flex-col gap-4 border-b border-border/60 pb-6 sm:flex-row sm:items-end sm:justify-between"},Wt={class:"space-y-1"},Vt={class:"text-2xl font-semibold tracking-tight text-foreground"},Nt={class:"text-sm text-muted-foreground"},Ot={class:"hidden items-center gap-5 rounded-lg border border-border/50 bg-muted/40 px-4 py-2.5 sm:flex"},Bt={class:"text-end"},Et={class:"text-[10px] uppercase tracking-wider text-muted-foreground"},Gt={class:"text-base font-semibold tabular-nums text-foreground"},qt={class:"flex items-center gap-1.5"},Yt={class:"text-xs text-muted-foreground"},Zt={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},Jt={class:"lg:col-span-2"},Qt={class:"flex items-center justify-between"},Xt={class:"flex items-center gap-2.5"},ea={class:"w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center"},ta={key:0,class:"py-6 text-center"},aa={class:"w-10 h-10 rounded-lg bg-emerald-500/10 flex items-center justify-center mx-auto mb-2"},sa={key:1,class:"space-y-3"},na={class:"flex items-start gap-2.5 pl-2"},ia={class:"flex-1 min-w-0"},la={class:"text-sm font-medium text-foreground"},oa={class:"text-xs text-muted-foreground mt-0.5"},ra={class:"flex gap-2 mt-2.5"},ca={class:"flex items-center gap-2.5"},ua={class:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center"},da={class:"space-y-2"},ma=["onClick"],ga={class:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center group-hover:bg-primary/15 transition-colors duration-150"},pa={class:"flex-1 min-w-0"},fa={class:"text-sm font-medium text-foreground"},va={class:"text-xs text-muted-foreground"},ha={class:"flex items-center justify-between"},ya={class:"flex items-center gap-2.5"},ba={class:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center"},_a={key:0,class:"py-6 text-center"},$a={key:1,class:"space-y-0"},xa={class:"relative flex flex-col items-center pt-0.5"}
1,ka={key:0,class:"w-px flex-1 bg-border/50 mt-1.5 min-h-[20px]"},wa={class:"flex-1 min-w-0 pb-1"},Ca={class:"flex items-start justify-between gap-2"},Aa={class:"text-sm font-medium text-foreground"},Da={class:"text-xs text-muted-foreground mt-0.5"},Sa={class:"flex items-center gap-2 flex-shrink-0"},Pa={class:"text-xs text-muted-foreground whitespace-nowrap"},La=I({__name:"DashboardChrome",setup(b){const{dashboard:d,isLoading:v,metrics:c,alerts:_,activity:$,load:n,dismissAlert:C}=Ht(),{user:D}=we(),A=p(()=>D.value?.UserData&&(D.value.UserData.firstName||D.value.UserData.displayName)||""),r=p(()=>({activeAgreements:c.value?.activeAgreements??0,monthlyRevenue:c.value?.monthlyRevenue??0})),S=p(()=>_.value),a=p(()=>{const k=new Date().getHours();return k<12?"Good morning":k<17?"Good afternoon":"Good evening"}),h=p(()=>new Date().toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"})),L=[{label:"New Agreement",description:"Create lease contract",icon:fe,handler:()=>console.log("Creating agreement...")},{label:"Process Payment",description:"Record transaction",icon:he,handler:()=>console.log("Processing payment...")},{label:"Add Vehicle",description:"Register to fleet",icon:pe,handler:()=>console.log("Adding vehicle...")},{label:"Generate Report",description:"Export analytics",icon:Ke,handler:()=>console.log("Generating report...")}],f=p(()=>$.value),{now:g}=De();function U(k){const o=Fe.minutesSince(k,g());if(o<1)return"Just now";if(o<60)return`${o}m ago`;const w=Math.floor(o/60);return w<24?`${w}h ago`:w<48?"Yesterday":k.toLocaleDateString()}function z(k){const o={high:"border-red-500/20 bg-gradient-to-r from-red-500/5 to-transparent",medium:"border-amber-500/20 bg-gradient-to-r from-amber-500/5 to-transparent",low:"border-blue-500/20 bg-gradient-to-r from-blue-500/5 to-transparent"};return o[k]||o.medium}function R(k){const o={high:"bg-red-500",medium:"bg-amber-500",low:"bg-blue-500"};return o[k]||o.medium}function F(k){const o={high:"bg-red-500/10",medium:"bg-amber-500/10",low:"bg-blue-500/10"};return o[k]||o.medium}function N(k){const o={high:"text-red-500",medium:"text-amber-500",low:"text-blue-500"};return o[k]||o.medium}function oe(k){return{payment:he,maintenance:pe,system:me,agreement:fe}[k]||me}function re(k){return{payment:"bg-emerald-500",agreement:"bg-orange-500",vehicle:"bg-blue-500",maintenance:"bg-amber-500",system:"bg-gray-400"}[k]||"bg-gray-400"}function ce(k){return{payment:"ring-emerald-500/10",agreement:"ring-orange-500/10",vehicle:"ring-blue-500/10",maintenance:"ring-amber-500/10",system:"ring-gray-400/10"}[k]||"ring-gray-400/10"}function ue(k){const o={payment:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",agreement:"bg-orange-500/10 text-orange-600 dark:text-orange-400",vehicle:"bg-blue-500/10 text-blue-600 dark:text-blue-400",maintenance:"bg-amber-500/10 text-amber-600 dark:text-amber-400",system:"bg-gray-500/10 text-gray-600 dark:text-gray-400"};return o[k]||o.system}function $e(k){console.log("Handling alert:",k.id)}function xe(k){C(k)}return O(()=>{n()}),(k,o)=>e(v)&&!e(d)?(s(),x("div",Kt,[t("div",Mt,[t("div",jt,[i(e(Ce),{class:"h-8 w-8 animate-spin text-primary"}),o[0]||(o[0]=t("p",{class:"text-sm text-muted-foreground"},"Loading dashboard...",-1))])])])):(s(),x("div",It,[t("header",Ut,[t("div",Wt,[t("h1",Vt,m(a.value)+", "+m(A.value),1),t("p",Nt,m(h.value)+" · "+m(k.$t("dashboard.businessOverview")),1)]),t("div",Ot,[t("div",Bt,[t("p",Et,m(k.$t("dashboard.activeLeases")),1),t("p",Gt,m(r.value.activeAgreements),1)]),o[2]||(o[2]=t("div",{class:"h-7 w-px bg-border"},null,-1)),t("div",qt,[o[1]||(o[1]=t("span",{class:"relative flex h-1.5 w-1.5"},[t("span",{class:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}),t("span",{class:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-500"})],-1)),t("span",Yt,m(k.$t("dashboard.allSystemsOperational")),1)])])]),Ae(k.$slots,"headline",{},void 0,!0),t("section",Zt,[t("div",Jt,[i(e(M),null,{default:l(()=>[i(e(ae),{class:"pb-3"},{default:l(()=>[t("div",Qt,[t("div",Xt,[t("div",ea,[i(e(me),{class:"w-4 h-4 text-amber-500"})]),t("div",null,[i(e(te),{class:"text-sm font-medium"},{default:l(()=>[...o[3]||(o[3]=[T("Alerts",-1)])]),_:1}),i(e(se),{class:"text-xs"},{default:l(()=>[T(m(S.value.length)+" requiring attention",1)]),_:1})])]),S.value.length>0?(s(),u(e(X),{key:0,variant:"ghost",size:"sm",class:"text-xs h-7"},{default:l(()=>[o[4]||(o[4]=T(" View All ",-1)),i(e(V),{class:"w-3 h-3 ml-1"})]),_:1})):y("",!0)])]),_:1}),i(e(j),null,{default:l(()=>[S.value.length===0?(s(),x("div",ta,[t("div",aa,[i(e(ze),{class:"w-5 h-5 text-emerald-500"})]),o[5]||(o[5]=t("p",{class:"text-sm font-medium text-foreground"},"All systems operational",-1)),o[6]||(o[6]=t("p",{class:"text-xs text-muted-foreground mt-0.5"},"No critical alerts at this time",-1))])):(s(),x("div",sa,[(s(!0),x(H,null,q(S.value,w=>(s(),x("div",{key:w.id,class:E(["relative overflow-hidden rounded-lg border p-3 transition-all duration-200",z(w.severity)])},[t("div",{class:E(["absolute left-0 top-0 bottom-0 w-0.5",R(w.severity)])},null,2),t("div",na,[t("div",{class:E(["w-7 h-7 rounded-md flex items-center justify-center flex-shrink-0",F(w.severity)])},[(s(),u(ge(oe(w.type)),{class:E(["w-3.5 h-3.5",N(w.severity)])},null,8,["class"]))],2),t("div",ia,[t("h4",la,m(w.title),1),t("p",oa,m(w.description),1),t("div",ra,[i(e(X),{onClick:de=>$e(w),size:"sm",class:"h-6 text-xs px-2",variant:w.severity==="high"?"destructive":"default"},{default:l(()=>[...o[7]||(o[7]=[T(" Take Action ",-1)])]),_:1},8,["onClick","variant"]),i(e(X),{onClick:de=>xe(w.id),variant:"ghost",size:"sm",class:"h-6 text-xs px-2"},{default:l(()=>[...o[8]||(o[8]=[T(" Dismiss ",-1)])]),_:1},8,["onClick"])])])])],2))),128))]))]),_:1})]),_:1})]),i(e(M),null,{default:l(()=>[i(e(ae),{class:"pb-3"},{default:l(()=>[t("div",ca,[t("div",ua,[i(e(He),{class:"w-4 h-4 text-primary"})]),t("div",null,[i(e(te),{class:"text-sm font-medium"},{default:l(()=>[...o[9]||(o[9]=[T("Quick Actions",-1)])]),_:1}),i(e(se),{class:"text-xs"},{default:l(()=>[...o[10]||(o[10]=[T("Common operations",-1)])]),_:1})])])]),_:1}),i(e(j),null,{default:l(()=>[t("div",da,[(s(),x(H,null,q(L,w=>t("button",{key:w.label,onClick:w.handler,class:"group flex items-center gap-2.5 w-full p-2.5 rounded-lg border border-border/50 bg-card text-left transition-all duration-150 hover:border-primary/30 hover:bg-primary/5"},[t("div",ga,[(s(),u(ge(w.icon),{class:"w-3.5 h-3.5 text-primary"}))]),t("div",pa,[t("span",fa,m(w.label),1),t("p",va,m(w.description),1)]),i(e(V),{class:"w-3.5 h-3.5 text-muted-foreground group-hover:text-primary group-hover:translate-x-0.5 transition-all duration-150"})],8,ma)),64))])]),_:1})]),_:1})]),i(e(M),null,{default:l(()=>[i(e(ae),{class:"pb-3"},{default:l(()=>[t("div",ha,[t("div",ya,[t("div",ba,[i(e(Me),{class:"w-4 h-4 text-blue-500"})]),t("div",null,[i(e(te),{class:"text-sm font-medium"},{default:l(()=>[...o[11]||(o[11]=[T("Recent Activity",-1)])]),_:1}),i(e(se),{class:"text-xs"},{default:l(()=>[...o[12]||(o[12]=[T("Latest system updates",-1)])]),_:1})])]),i(e(X),{variant:"ghost",size:"sm",class:"text-xs h-7"},{default:l(()=>[o[13]||(o[13]=T(" View All ",-1)),i(e(V),{class:"w-3 h-3 ml-1"})]),_:1})])]),_:1}),i(e(j),null,{default:l(()=>[f.value.length===0?(s(),x("div",_a,[...o[14]||(o[14]=[t("p",{class:"text-sm text-muted-foreground"},"No recent activity",-1)])])):(s(),x("div",$a,[(s(!0),x(H,null,q(f.value,(w,de)=>(s(),x("div",{key:w.id,class:"group flex gap-2.5 p-2.5 rounded-lg hover:bg-muted/50 transition-colors duration-150"},[t("div",xa,[t("div",{class:E(["w-2 h-2 rounded-full ring-[3px] transition-colors duration-150",[re(w.type),ce(w.type)]])},null,2),de<f.value.length-1?(s(),x("div",ka)):y("",!0)]),t("div",wa,[t("div",Ca,[t("div",null,[t("p",Aa,m(w.title),1),t("p",Da,m(w.description),1)]),t("div",Sa,[t("span",{class:E(["inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium uppercase tracking-wide",ue(w.type)])},m(w.type),3),t("span",Pa,m(U(w.timestamp)),1)])])])]))),128))]))]),_:1})]),_:1})]))}}),Ra=B(La,[["__scopeId","data-v-da43ce7d"]]),Ta={key:0,class:"space-y-10"},Fa={key:1,class:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4"},za=I({__name:"MainDashboard",setup(b){const{hasDashboard:d,hasFeature:v,getFeatureMinPlan:c}=ie(),_=p(()=>Pt(St,{hasDashboard:d,hasFeature:v,getFeatureMinPlan:c},{homeOnly:!0})),$=p(()=>_.value.filter(D=>D.mode==="live")),n=p(()=>_.value.filter(D=>D.mode==="teaser")),C=p(()=>_.value.filter(D=>D.mode==="coming_soon"));return(D,A)=>(s(),u(Ra,null,{headline:l(()=>[$.value.length?(s(),x("div",Ta,[(s(!0),x(H,null,q($.value,r=>(s(),u(ge(r.def.component),{key:r.def.id,"title-key":r.def.titleKey},null,8,["title-key"]))),128))])):y("",!0),n.value.length||C.value.length?(s(),x("div",Fa,[(s(!0),x(H,null,q(n.value,r=>(s(),u(zt,{key:r.def.id,"title-key":r.def.titleKey,"min-plan":r.minPlan},null,8,["title-key","min-plan"]))),128)),(s(!0),x(H,null,q(C.value,r=>(s(),u(Lt,{key:r.def.id,"title-key":r.def.titleKey},null,8,["title-key"]))),128))])):y("",!0)]),_:1}))}}),Ns=I({__name:"home",setup(b){return(d,v)=>(s(),u(za))}});
1export{Ns as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.