PageSourceSearch

https://jhasolutions.com/assets/CRMDashboard-B1816_Jt.js

js jhasolutions.com collected 2026-10-02 01:33:27 UTC 14,816 bytes, 2 lines download raw bytes

1import{r as b,j as e}from"./query-vendor-CqOtiPNe.js";import{a4 as U,D as M,a5 as $}from"./DashboardLayout-bhpyg6kK.js";import{P as R}from"./PageHeader-CZkE0AwI.js";import{T as P,a as B,b as l,c as n}from"./tabs-DhAXdYsK.js";import{u as V,a as H,b as O,c as z,L as E,C as F,D as q,d as G,e as J,f as K,A as Q}from"./AnalyticsTab-C24eA5_4.js";import{T as W}from"./TasksPanel-OtwbsxEW.js";import{u as T,h as X,i as Y,k as Z,l as ee,B as te,m as se,z as ie}from"./index-CgiuONvO.js";import{I as ae}from"./input-oPoHA7Fw.js";import{S as re,a as me,b as oe,c as le,d as u}from"./select-DLa9MRfA.js";import{B as ne}from"./badge-CSzvBtO5.js";import{u as pe}from"./useClients-BPo67_sU.js";import{D as ce}from"./download-CVkjVrJo.js";import{S as de}from"./search-CT8fLn3_.js";import{C as N}from"./calendar-njTWr43i.js";import{f as h}from"./format-Ch7dQtBq.js";import{U as xe}from"./user-C4n8hF8r.js";import{d as ue}from"./react-vendor-Oyj1q24G.js";import"./ui-vendor-C92kXd7i.js";import"./use-mobile-Bs-uMLmp.js";import"./separator-BBHmpRWz.js";import"./sheet-Dt5T48FQ.js";import"./skeleton-B97PTBMn.js";import"./tooltip-DukMi9Yb.js";import"./Logo-BMQirxBI.js";import"./house-C9sHcoTX.js";import"./calendar-days-BvC5INej.js";import"./building-2-Dhg-JMoH.js";import"./users-BKG6ZMTq.js";import"./map-pin-C3B4zHzE.js";import"./wrench-BveqLzJ6.js";import"./wifi-off--tLv87Xm.js";import"./message-square-BqIfb2eA.js";import"./file-text-BqBFGr3S.js";import"./credit-card-B4XMcBmh.js";import"./panel-top-C_rCNK16.js";import"./mail-dnbKMUvE.js";import"./log-out-BzS-CLno.js";import"./scroll-area-Cf6pvS46.js";import"./index-BdQq_4o_.js";import"./bell-CJIBHycy.js";import"./check-check-XSobeTl0.js";import"./formatDistanceToNow-DExfhm_y.js";import"./en-US-5rFTtd83.js";import"./LanguageSwitcher-k7A6VFzv.js";import"./dropdown-menu-D-1fS2hr.js";import"./chevron-right-Cl4Mx2Wq.js";import"./check-EsNBkSFR.js";import"./circle-QNrbGPhh.js";import"./languages-1QBd6nWm.js";import"./message-circle-C3Kdh8KU.js";import"./activity-DmUxG0fV.js";import"./arrow-down-C4HxAdL9.js";import"./arrow-left-Cg5pwYzI.js";import"./arrow-right-left-tf9Dbt9n.js";import"./arrow-right-CcjvJnjH.js";import"./banknote-wg82AAG7.js";import"./bed--FRu_ZOR.js";import"./list-ordered-CD-hc5AR.js";import"./book-open-check-DeGSCDpn.js";import"./book-open-CkJItcBu.js";import"./brain-QP504LxU.js";import"./building-B1y8ifkf.js";import"./calculator-BuA7e-mZ.js";import"./car-BBeSSily.js";import"./landmark-DVOwzqRj.js";import"./chart-no-axes-column-increasing-DINm0A4J.js";import"./chart-pie-BH1JXQN4.js";import"./chevron-down-C04YKbFY.js";import"./chevron-left-ChhJq7GD.js";import"./chevron-up-YEko4sQ9.js";import"./circle-check-big-B-nqExcc.js";import"./circle-check-DJQ0aRpE.js";import"./message-square-text-CGi8Ghec.js";import"./circle-help-C7Zpw0pA.js";import"./circle-x-BuyswQ-Z.js";import"./clipboard-check-BqHgjlQp.js";import"./clipboard-list-Csw_7fPS.js";import"./clipboard-BrLc9XKt.js";import"./clock-DZbyb8Zh.js";import"./copy-B3hQhSgM.js";import"./database-BFqeg3FR.js";import"./dollar-sign-BoJmMuTa.js";import"./zoom-out-CZzr-t9-.js";import"./external-link-DLbL3mEn.js";import"./twitter-DZP3beY2.js";import"./file-chart-column-increasing-B5g6evDe.js";import"./file-check-2P_f7S4-.js";import"./file-spreadsheet-BbKDqPhp.js";import"./filter-DOTkE5Cb.js";import"./folder-open-CQAcdSBr.js";import"./tree-pine-BPQJJftn.js";import"./globe-CnUNDEKq.js";import"./video-CEw6mOAP.js";import"./hammer-wk7AQWqX.js";import"./heart-BnQgcucT.js";import"./hotel-GOTEiWOT.js";import"./image-plus-DfX-_AyQ.js";import"./image-DrO_YHf9.js";import"./infinity-BeOXN0LM.js";import"./key-round-Cl3pyXjD.js";import"./pen-tool-ErvG_pvg.js";import"./keyboard-CzV9enBr.js";import"./layers-BFQ0OLI3.js";import"./lightbulb-IBP3Qpkq.js";import"./list-checks-CsRR_GQp.js";import"./list-Cj3mFARp.js";import"./lock-rMWs3zu_.js";import"./map-pinned-DBhEITMu.js";import"./map-Dml-fuwB.js";import"./maximize-2-BAo6X0VP.js";import"./maximize-DllRQL4I.js";import"./menu-B6QavzjZ.js";import"./minus-BWhsihkF.js";import"./mouse-pointer-click-BX0OFv2U.js";import"./mouse-z7gxK0yj.js";import"./navigation-CE5W2bfp.js";import"./pause-DMf9J0er.js";import"./pencil-s0UamddO.js";import"./ruler-PMZpHEX4.js";import"./phone-CCpZm87m.js";import"./play-jGttOVZX.js";import"./plus-DhJDBkeB.js";import"./printer-DPItEGKX.js";import"./refresh-ccw-D8-NZbc0.js";import"./rocket-o5dk1x7z.js";import"./rotate-ccw-D5LvpNON.js";import"./rotate-cw-qBQXdDzU.js";import"./route-BHkgA-GC.js";import"./save-CD5NOpBU.js";import"./scale-ChbaOrX5.js";import"./send-Dev9pED3.js";import"./share-2-CZ8fruyy.js";import"./square-plus-BYoTN96c.js";import"./skip-forward-B2g28Adz.js";import"./smartphone-BVaS8Ogf.js";import"./square-check-big-S7f3xHqK.js";import"./square-pen-Cd8FE6iD.js";import"./square-DpPlSXOl.js";import"./star-DgTF5ai2.js";
1import"./trash-2-XdlKjO4t.js";import"./trending-down-BOTbmgUi.js";import"./trending-up-BVHf_RoK.js";import"./upload-B2TjyuSq.js";import"./user-check-DLa2T6BS.js";import"./volume-2-CyzFl9Wm.js";import"./volume-x-DwUdAb_B.js";import"./wallet-DFZjOwp1.js";import"./workflow-eRF_Iozj.js";import"./zap-CZwSyBya.js";import"./useIsRTL-CvXztNyx.js";import"./useOrganization-BfvJJCCq.js";import"./index.esm-D5lf4VrX.js";import"./textarea-CxLaKExY.js";import"./useProperties-DAUpZ_Uw.js";import"./ClientDialog-SR37mOKh.js";import"./useWhatsAppIntegration-DBhbP0EQ.js";import"./whatsappBrowser-Bk8kXzkW.js";import"./useWhatsAppTemplates-PCjsFKWj.js";import"./EmptyState-B8Ncwn5F.js";import"./checkbox-DKjJLhPq.js";import"./alert-dialog-3FMVIuPP.js";import"./progress-CGtqSgOL.js";import"./index-qfhom09g.js";import"./useCurrency-BwCXcmAr.js";import"./subMonths-DSv0VBrP.js";import"./addMonths-YCl4V_qS.js";import"./startOfMonth-CR-gPZr_.js";import"./chart-vendor-De-uRwFm.js";import"./useUserRole-kvNPaeKq.js";import"./calendar-DaWx4mTj.js";import"./isSameMonth-9MImqN3e.js";import"./isBefore-CgCj7brn.js";import"./isSameDay-DKb4pGQS.js";import"./addDays-DdzlNAKv.js";import"./subDays-CTCG_ujS.js";import"./useRouteAction-DcIrIJiC.js";const he=()=>{const{t:i}=T(),[p,y]=b.useState(""),[r,j]=b.useState("all"),[a,c]=b.useState(null),{interactions:d=[]}=V(),{interactions:C=[]}=H(),{deals:v=[]}=O(),{leads:_=[]}=z(),{clients:f=[]}=pe(),x=[...r==="all"||r==="lead_interaction"?d.map(t=>{const s=_.find(o=>o.id===t.lead_id);return{id:t.id,type:"lead_interaction",timestamp:t.created_at,title:`${t.interaction_type.charAt(0).toUpperCase()+t.interaction_type.slice(1)}: ${t.subject||"No subject"}`,description:t.description,entityId:t.lead_id,entityName:(s==null?void 0:s.name)||"Unknown Lead",entityType:"lead",interactionType:t.interaction_type}}):[],...r==="all"||r==="client_interaction"?C.map(t=>{const s=f.find(o=>o.id===t.client_id);return{id:t.id,type:"client_interaction",timestamp:t.created_at,title:`${t.interaction_type.charAt(0).toUpperCase()+t.interaction_type.slice(1)}: ${t.subject||"No subject"}`,description:t.description,entityId:t.client_id,entityName:(s==null?void 0:s.name)||"Unknown Client",entityType:"client",interactionType:t.interaction_type}}):[],...r==="all"||r==="deal_update"?v.map(t=>{const s=f.find(o=>o.id===t.client_id);return{id:t.id,type:"deal_update",timestamp:t.updated_at,title:`Deal ${t.status.replace("_"," ").toUpperCase()}`,description:t.notes||`Deal moved to ${t.status}`,entityId:t.id,entityName:(s==null?void 0:s.name)||"Unknown Client",entityType:"deal",status:t.status}}):[]].sort((t,s)=>new Date(s.timestamp).getTime()-new Date(t.timestamp).getTime()).filter(t=>{if(!p)return!0;const s=p.toLowerCase();return t.title.toLowerCase().includes(s)||t.description.toLowerCase().includes(s)||t.entityName.toLowerCase().includes(s)}),D=(t,s)=>{if(t==="lead_interaction"||t==="client_interaction")switch(s){case"email":return"📧";case"call":return"📞";case"meeting":return"🤝";case"message":return"💬";case"note":return"📝";case"property_view":return"🏠";case"document_shared":return"📄";default:return"📋"}return t==="deal_update"?"💼":"📌"},S=t=>{switch(t){case"new":return"bg-blue-500/10 text-blue-500";case"negotiation":return"bg-yellow-500/10 text-yellow-500";case"under_contract":return"bg-purple-500/10 text-purple-500";case"closed_won":return"bg-green-500/10 text-green-500";case"closed_lost":return"bg-red-500/10 text-red-500";default:return"bg-muted text-muted-foreground"}},L=()=>{const t=["Date","Time","Type","Entity","Title","Description"],s=x.map(m=>[h(new Date(m.timestamp),"yyyy-MM-dd"),h(new Date(m.timestamp),"HH:mm"),m.type.replace("_"," "),`${m.entityType}: ${m.entityName}`,m.title,m.description.replace(/\n/g," ")]),o=[t.join(","),...s.map(m=>m.map(A=>`"${A}"`).join(","))].join(`
2`),k=new Blob([o],{type:"text/csv"}),g=window.URL.createObjectURL(k),w=document.createElement("a");w.href=g,w.download=`activity-timeline-${h(new Date,"yyyy-MM-dd")}.csv`,w.click(),window.URL.revokeObjectURL(g)},I=t=>{(t.entityType==="lead"||t.entityType==="client")&&c({type:t.entityType,id:t.entityId})};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(X,{children:[e.jsx(Y,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(Z,{children:i("crm.timeline.title","Unified Activity Timeline")}
2),e.jsx(ee,{children:i("crm.timeline.subtitle","All interactions, meetings, and deal updates in one place")})]}),e.jsxs(te,{onClick:L,variant:"outline",size:"sm",children:[e.jsx(ce,{className:"h-4 w-4 mr-2"}),i("crm.timeline.exportCsv","Export CSV")]})]})}),e.jsxs(se,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx("div",{className:"flex-1 min-w-[200px]",children:e.jsxs("div",{className:"relative",children:[e.jsx(de,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ae,{placeholder:i("crm.timeline.searchPlaceholder","Search activities..."),value:p,onChange:t=>y(t.target.value),className:"pl-10"})]})}),e.jsxs(re,{value:r,onValueChange:t=>j(t),children:[e.jsx(me,{className:"w-full sm:w-[200px]",children:e.jsx(oe,{})}),e.jsxs(le,{children:[e.jsx(u,{value:"all",children:i("crm.timeline.allActivities","All Activities")}),e.jsx(u,{value:"lead_interaction",children:i("crm.timeline.leadInteractions","Lead Interactions")}),e.jsx(u,{value:"client_interaction",children:i("crm.timeline.clientInteractions","Client Interactions")}),e.jsx(u,{value:"deal_update",children:i("crm.timeline.dealUpdates","Deal Updates")})]})]})]}),e.jsx("div",{className:"space-y-3 max-h-[600px] overflow-y-auto",children:x.length===0?e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx(N,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:i("crm.timeline.noActivities","No activities to display")}),e.jsx("p",{className:"text-sm mt-2",children:i("crm.timeline.noActivitiesDesc","Start logging interactions to see your timeline")})]}):x.map((t,s)=>e.jsxs("div",{className:`relative pl-8 pb-4 ${s!==x.length-1?"border-l-2 border-border ml-4":""}`,children:[e.jsx("div",{className:"absolute left-0 top-0 -ml-[9px] h-4 w-4 rounded-full bg-primary border-4 border-background"}),e.jsx("div",{className:"bg-card border rounded-lg p-4 hover:shadow-md transition-shadow cursor-pointer",onClick:()=>I(t),children:e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-lg",children:D(t.type,t.interactionType)}),e.jsx("span",{className:"font-medium",children:t.title}),t.status&&e.jsx(ne,{className:S(t.status),children:t.status})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(N,{className:"h-3 w-3"}),e.jsx("span",{children:h(new Date(t.timestamp),"MMM dd, yyyy 'at' h:mm a")}),e.jsx("span",{children:"•"}),t.entityType==="lead"&&e.jsx(ie,{className:"h-3 w-3"}),t.entityType==="client"&&e.jsx(xe,{className:"h-3 w-3"}),t.entityType==="deal"&&e.jsx(U,{className:"h-3 w-3"}),e.jsxs("span",{className:"capitalize",children:[t.entityType,": ",t.entityName]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:t.description})]})})})]},t.id))})]})]}),(a==null?void 0:a.type)==="lead"&&e.jsx(E,{open:!!a,onOpenChange:t=>!t&&c(null),leadId:a.id}),(a==null?void 0:a.type)==="client"&&e.jsx(F,{open:!!a,onOpenChange:t=>!t&&c(null),clientId:a.id})]})},ye=new Set(["deals","clients","leads","timeline","tasks","commissions","analytics"]),ki=()=>{const{t:i}=T(),[p,y]=ue(),r=p.get("tab"),j=r&&ye.has(r)?r:"deals",a=c=>{const d=new URLSearchParams(p);c==="deals"?d.delete("tab"):d.set("tab",c),y(d,{replace:!0})};return e.jsx(M,{children:e.jsxs("div",{className:"mx-auto mobile-comfortable space-y-3 sm:space-y-4 lg:space-y-6",children:[e.jsx(R,{title:i("crm.title","CRM Dashboard"),subtitle:i("crm.subtitle","Manage your deals, clients, and sales pipeline"),icon:e.jsx($,{className:"h-5 w-5"})}),e.jsxs(P,{value:j,onValueChange:a,className:"space-y-3 sm:space-y-4 lg:space-y-6",children:[e.jsx("div",{className:"w-full overflow-x-auto -mx-2 px-2 pb-2 xl:mx-0 xl:px-0 xl:pb-0 xl:overflow-visible",children:e.jsxs(B,{className:"inline-flex w-max gap-1 bg-muted p-1 xl:grid xl:w-full xl:grid-cols-7",children:[e.jsx(l,{value:"deals",className:"text-xs sm:text-sm px-3 py-1.5 whitespace-nowrap",children:i("crm.tabs.deals","Deals")}),e.jsx(l,{value:"clients",className:"text-xs sm:text-sm px-3 py-1.5 whitespace-nowrap",children:i("crm.tabs.clients","Clients")}),e.jsx(l,{value:"leads",className:"text-xs sm:text-sm px-3 py-1.5 whitespace-nowrap",children:i("crm.tabs.leads","Leads")}),e.jsx(l,{value:"timeline",className:"text-xs sm:text-sm px-3 py-1.5 whitespace-nowrap",children:i("crm.tabs.timeline","Timeline")}),e.jsx(l,{value:"tasks",className:"text-xs sm:text-sm px-3 py-1.5 whitespace-nowrap",children:i("crm.tabs.tasks","Tasks")}),e.jsx(l,{value:"commissions",className:"text-xs sm:text-sm px-3 py-1.5 whitespace-nowrap",children:i("crm.tabs.commissions","Commissions")}),e.jsx(l,{value:"analytics",className:"text-xs sm:text-sm px-3 py-1.5 whitespace-nowrap",children:i("crm.tabs.analytics","Analytics")})]})}),e.jsx(n,{value:"deals",className:"space-y-3 sm:space-y-4",children:e.jsx(q,{})}),e.jsx(n,{value:"clients",className:"space-y-3 sm:space-y-4",children:e.jsx(G,{})}),e.jsx(n,{value:"leads",className:"space-y-3 sm:space-y-4",children:e.jsx(J,{})}),e.jsx(n,{value:"timeline",className:"space-y-3 sm:space-y-4",children:e.jsx(he,{})}),e.jsx(n,{value:"tasks",className:"space-y-3 sm:space-y-4",children:e.jsx(W,{})}),e.jsx(n,{value:"commissions",className:"space-y-3 sm:space-y-4",children:e.jsx(K,{})}),e.jsx(n,{value:"analytics",className:"space-y-3 sm:space-y-4",children:e.jsx(Q,{})})]})]})})};export{ki 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.