anarock-widgets 1.0.363 → 1.0.364
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.cjs.js +1 -1
- package/dist/index.es.js +35 -35
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -391,4 +391,4 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
391
391
|
* See the LICENSE file in the root directory of this source tree.
|
|
392
392
|
*/const Gfe=[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]],Xfe=Yi("waves-ladder",Gfe),Et=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,rightContent:f,onCalendarClick:p,onPrevClick:m,onNextClick:g})=>{const v=s==="semi-bold"?600:500;return h.jsxs("div",{className:`relative bg-white p-[24px] !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[t&&h.jsx("div",{className:c,children:t}),h.jsx("div",{style:{fontWeight:v,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),h.jsxs("div",{className:"flex items-center gap-[12px]",children:[f&&f,n&&!r&&h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&h.jsxs("div",{className:"flex items-center gap-[12px] px-[16px] py-[8px] rounded-[8px] bg-white text-sm text-[#64748B]",children:[h.jsx(Ife,{size:16,className:"text-[#64748B] cursor-pointer",onClick:p}),h.jsx(jI,{size:16,className:"cursor-pointer",onClick:m}),h.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),h.jsx(RI,{size:16,className:"cursor-pointer",onClick:g})]})]})]}),h.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&h.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},Qfe={completed:18,not_completed:6,missed:4};function Zfe({data:e={}}){const t=e&&Object.keys(e).length>0?e:Qfe,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return h.jsx(Et,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"flex flex-col items-center justify-center",children:[h.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Vi,{children:[h.jsx(ci,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>h.jsx(In,{fill:o?.color??"#ccc"},`cell-${a}`))}),h.jsx(Dt,{content:h.jsx(hs,{}),wrapperStyle:{zIndex:9999}})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),h.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>h.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[h.jsxs("div",{className:"flex items-center gap-[10px]",children:[h.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):h.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No patrol data"})})]})})}$n.register(Ro,Io,N1,M1,Pr,Xr);const Jfe=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],tf={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},epe=[{key:"Guest",datasetIndex:0,color:"#EF4444"},{key:"Cab",datasetIndex:1,color:"#7C3AED"},{key:"Delivery",datasetIndex:2,color:"#10B981"},{key:"Service",datasetIndex:3,color:"#F59E0B"}],tpe=({color:e,size:t=12})=>h.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",style:{display:"block",flexShrink:0},children:h.jsx("rect",{x:"1",y:"1",width:"10",height:"10",rx:"0",fill:e,transform:"rotate(45 6 6)"})}),npe=({chartRef:e})=>{const[t,n]=k.useState({}),r=i=>{const o=e.current;if(!o)return;const a=o.getDatasetMeta(i),s=!!a.hidden;a.hidden=!s,o.update(),n(l=>({...l,[i]:!s}))};return h.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"76px",marginTop:"10px",paddingBottom:"8px",flexWrap:"wrap"},children:epe.map(({key:i,datasetIndex:o,color:a})=>{const s=!!t[o];return h.jsxs("div",{onClick:()=>r(o),style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",userSelect:"none",opacity:s?.45:1,transition:"opacity 0.2s ease"},children:[h.jsx(tpe,{color:a,size:12}),h.jsx("span",{style:{fontSize:"13px",color:"#64748B",fontWeight:400,lineHeight:1,textDecoration:s?"line-through":"none",transition:"text-decoration 0.15s ease"},children:i})]},i)})})},rpe=({data:e})=>{const t=k.useRef(null),r={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:Jfe,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:tf.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:tf.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:tf.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:tf.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{enabled:!1,external:ai({titleFormatter:o=>o.title?.[0]||"",hideTitleForSingle:!1})}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return h.jsxs(Ie,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",children:[h.jsx("div",{style:{height:"calc(100% - 44px)",width:"100%"},children:h.jsx(R1,{ref:t,data:r,options:i})}),h.jsx(npe,{chartRef:t})]})},ipe={open:4,in_progress:7,closed:12},ope=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function ape({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:ipe,r=Array.isArray(t)?t:ope,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return h.jsx(Et,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[h.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] h-[76px] rounded",children:[h.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),h.jsxs("div",{className:"flex-1 py-[12px] bg-[#FFFBF2] h-[76px] rounded",children:[h.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),h.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] h-[76px] rounded",children:[h.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[h.jsx("div",{className:"flex items-center gap-[8px]",children:h.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),h.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:h.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):h.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No incidents found"})})]})})}const spe=[{total_staff:42,absent_staff:6}],lpe=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function cpe({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:spe,r=Array.isArray(t)&&t.length>0?t:lpe,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return h.jsx(Et,{title:"Staff Attendance",className:"h-[362px] overflow-hidden ",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex gap-[16px] text-center mt-[24px]",children:[h.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] rounded h-[76px]",children:[h.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),h.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),h.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] rounded h-[76px]",children:[h.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),h.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),h.jsx("div",{className:"mt-[24px] pb-[16px] space-y-[8px] overflow-y-auto max-h-[200px] hide-scrollbar",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#F8FAFC] rounded-md",children:[h.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),h.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):h.jsx(h.Fragment,{})})]})})}function upe(e){return tt({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function dpe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=bu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return h.jsxs(Ie,{title:e,icon:h.jsx("div",{className:"h-6 w-6 grid place-items-center",children:h.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[h.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),h.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[h.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),h.jsx("div",{className:"text-slate-500",children:r})]})]})}const fpe=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Ub,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Zoe,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:upe,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:m8,iconColor:"text-[#36AB6C]"}];function ppe({data:e}){const t=Array.isArray(e)&&e.length>0?e:fpe;return h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>h.jsx(dpe,{...n},r))})}const hpe=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],mpe=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function gpe({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:mpe(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):hpe;return h.jsx(Ie,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:h.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>h.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),h.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),h.jsxs("div",{className:"flex flex-col items-end",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const vpe=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},ype=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],bpe=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return h.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[h.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),h.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},xpe=({data:e})=>{const t=k.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:ype).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=k.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return h.jsxs(Ie,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[h.jsx(Ct,{width:"100%",height:"85%",children:h.jsxs(No,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[h.jsx(ur,{strokeDasharray:"0",vertical:!1}),h.jsx(Kn,{dataKey:"level"}),h.jsx(Ln,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),h.jsx(Dt,{content:h.jsx(hs,{titleFormatter:a=>a,hideTitleForSingle:!1,rowFormatter:({payload:a})=>a.map(s=>({color:s.color||s.fill||s.payload?.color||"",label:s.name||s.dataKey,value:vpe(s.value??0)}))}),cursor:!1}),h.jsx(Kt,{dataKey:"open_count",name:"Open",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),h.jsx(Kt,{dataKey:"in_progress_count",name:"In Progress",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),h.jsx(Kt,{dataKey:"closed_count",name:"Closed",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),h.jsx(bpe,{})]})},wpe=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function _pe({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):wpe;return h.jsx(Ie,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:h.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>h.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),h.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),h.jsxs("div",{className:"flex flex-col items-end",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function Epe(e){return tt({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const Spe=["open_complaints","pending_requests","avg_response_time","resolution_rate"],Ope={open_complaints:{title:"Open Complaints",Icon:ND,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:Epe,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:S8,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:x8,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},Cpe=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>h.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),kpe={primary:{size:28,lineHeight:32,weight:500}},Ppe={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function Dpe({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?h.jsx(Qk,{id:e,data:t}):h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:Spe.map(n=>h.jsx(Qk,{id:n},n))})}function Qk({id:e,data:t}){const n=Ope[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=bu,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:Ppe[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,h.jsx("div",{className:"h-[132px]",children:h.jsxs(Ie,{title:i,titleColor:a,icon:h.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:h.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[h.jsx(Cpe,{...kpe.primary,children:c}),h.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[h.jsx(hh,{value:u}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const Ape=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function Tpe({title:e,date:t,rsvp:n,utilisation:r,status:i}){return h.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-[12px] mt-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),h.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-[8px] py-[4px] ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),h.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),h.jsxs("div",{className:"flex justify-between items-center mt-2",children:[h.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),h.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),h.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:h.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Mpe({data:e}){const t=Array.isArray(e)?e:Ape;return h.jsx(Ie,{title:"Events Utilisation",className:"w-full h-[360px] overflow-y-auto hide-scrollbar",children:h.jsx("div",{className:"m-auto",children:t?.length>0?t.map((n,r)=>h.jsx(Tpe,{...n},`${n.title}-${r}`)):h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(En,{})})})})}const Npe=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function jpe({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return h.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} h-[124px]`,children:[h.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),h.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function Rpe({data:e}){const t=Array.isArray(e)&&e.length>0?e:Npe;return h.jsx(Ie,{title:"Notice Board Status",className:"w-full h-[360px]",children:h.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>h.jsx(jpe,{...n},`${n.label}-${r}`))})})}function Ipe(e){return tt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function Lpe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=bu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50",iconUrl:l}){return h.jsx(Ie,{title:e,icon:h.jsx("div",{className:"grid place-items-center ",children:l?h.jsx("img",{src:l,alt:"icon",className:"h-8 w-8 object-contain"}):h.jsx(o,{className:`h-8 w-8 ${a}`})}),className:"h-[132px]",children:h.jsxs("div",{children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),h.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[h.jsx(hh,{value:n}),h.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function Fpe({data:e}){const t=[{title:e?.title||"Total Bookings",value:e?.value??0,delta:e?.delta??"0%",deltaLabel:e?.deltaLabel||"Compared to last month",positive:e?.positive??!1,Icon:e?.Icon,iconUrl:e?.iconUrl,iconColor:e?.iconColor||"text-emerald-600",iconBg:e?.iconBg||"bg-emerald-50"}];return h.jsx("div",{className:"h-full",children:t.map((n,r)=>h.jsx(Lpe,{...n},r))})}function $pe(e){return tt({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function Bpe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=bu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return h.jsx(Ie,{title:e,icon:h.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:h.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:h.jsxs("div",{children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),h.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[h.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),h.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const Wpe=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Ipe,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:g8,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Xoe,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:$pe,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function zpe({data:e}){const t=Array.isArray(e)&&e.length>0?e:Wpe;return h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>h.jsx(Bpe,{...n},r))})}const Zk=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return h.jsxs("div",{className:"flex flex-col items-start",children:[h.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:h.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),h.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},Vpe=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return h.jsx("div",{children:h.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[h.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[h.jsx(Ub,{className:"!text-[20px] text-[#329DFF]"}),h.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"flex flex-col gap-[4px]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),h.jsxs("div",{className:"flex items-end gap-[4px]",children:[h.jsx(Zk,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),h.jsx(Zk,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};$n.register(Ro,Io,$l,Pr);const Hpe=({data:e})=>{const t=e!=null,n=e?.employee_data,r=["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],i=[2e3,1700,1500,1200,900,800],o=[],a=[];if(t){if(n&&n.length>0)for(let d=0;d<n.length;d++)o.push(n[d].name),a.push(n[d].employees)}else for(let d=0;d<r.length;d++)o.push(r[d]),a.push(i[d]);let s=!1;if(t)if(!n||n.length===0)s=!0;else{s=!0;for(let d=0;d<n.length;d++)if(n[d].employees!==0){s=!1;break}}let l=0;for(let d=0;d<a.length;d++)a[d]>l&&(l=a[d]);const c={labels:o,datasets:[{data:a,backgroundColor:[],barThickness:34}]};for(let d=0;d<a.length;d++)c.datasets[0].backgroundColor.push("#3C81F6");const u={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:d=>`Employees: ${d.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:l>0?l+5:2e3,ticks:{stepSize:l>0?Math.ceil((l+5)/5):500,color:"#64748B",callback:d=>d},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return t&&s?h.jsx(Ie,{className:"w-full h-[238px]",title:"Employee Footfall",period:"Today",icon:h.jsx(Xk,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(En,{title:"No Employee footfall Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsxs(Ie,{className:"w-full h-[238px]",title:"Employee Footfall",period:"Today",icon:h.jsx(Xk,{className:"!text-[24px] text-[#8B5CF6]"}),children:[h.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),h.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:t?e.total_employees:7500})]}),h.jsx("div",{className:"h-[110px]",children:h.jsx(Bl,{data:c,options:u})})]})},Ype="Rs",Jk=["bg-blue-500","bg-red-500","bg-purple-700"],Ea={title:"Food & Beverages (Static Data)",period:"Today",summary:{totalOrders:247,revenueGenerated:"82K",growthPercentage:8,growthTotalPercentage:0},outlets:[{name:"HP",orders:120,revenue:"45K",percentage:70,color:"bg-[#3C81F6]"},{name:"Adobe",orders:85,revenue:"23K",percentage:50,color:"bg-[#3C81F6]"},{name:"Anarock",orders:42,revenue:"14K",percentage:25,color:"bg-[#3C81F6]"}]};function $p(e,t=null){if(typeof e=="number")return e;if(typeof e=="string"){const n=Number(e.replace("%","").trim());return Number.isNaN(n)?t:n}return t}function eP(e){if(e==null||e==="")return"0";if(typeof e=="number")return C_(e);const t=Number(e);return Number.isNaN(t)?String(e):C_(t)}function Upe(e){const t=e?.food_beverage_summary?{title:e?.title,period:e?.period,summary:{totalOrders:e?.food_beverage_summary?.total_orders,revenueGenerated:e?.food_beverage_summary?.revenue_generated,growthPercentage:e?.food_beverage_summary?.growth_percentage??e?.food_beverage_summary?.revenue_growth,growthTotalPercentage:e?.food_beverage_summary?.order_growth,currencyType:e?.food_beverage_summary?.currency_type},outlets:e?.chart_data}:e||{},n=t?.summary||{},i=(Array.isArray(t?.outlets)?t.outlets:[]).map((f,p)=>({name:f?.name||f?.outlet_name||f?.tenant_name||f?.company_name||"Unknown",orders:f?.orders??f?.total_orders??f?.count??0,revenue:f?.revenue??f?.revenue_generated??f?.total_revenue??0,percentage:f?.percentage,color:f?.color||Jk[p%Jk.length]})),o=n?.totalOrders??n?.orders??Ea.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??Ea.summary.revenueGenerated,s=$p(n?.growthPercentage??n?.revenueGrowth,Ea.summary.growthPercentage),l=$p(n?.growthTotalPercentage??n?.orderGrowth,Ea.summary.growthTotalPercentage),c=n?.currencyType||n?.currency||Ype,u=i.reduce((f,p)=>f+(Number(p?.orders)||0),0),d=i.map(f=>({...f,percentage:f?.percentage!==null&&f?.percentage!==void 0?Number(f.percentage)||0:u>0?Math.round((Number(f?.orders)||0)/u*100):0}));return{title:t?.title||Ea.title,period:t?.period||Ea.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,growthTotalPercentage:l,currencyType:c},outlets:d.length>0?d:Ea.outlets}}function Kpe({data:e,title:t,period:n,icon:r}){const i=Upe(e),o=t||i.title,a=n||i.period,s=r||h.jsx(qfe,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=eP(i.summary.revenueGenerated),u=$p(i.summary.growthPercentage,0),d=$p(i.summary.growthTotalPercentage,0),f=u>=0,p=d>=0;return h.jsx(Ie,{className:"h-[324px]",title:o,period:a,icon:s,children:h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex gap-[24px]",children:[h.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l}),h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?h.jsx(ns,{}):h.jsx(ts,{}),d,"%",h.jsx("span",{children:"from last month"})]})]}),h.jsxs("div",{className:"w-[30%] flex flex-col gap-[8px] ",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),h.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[i.summary.currencyType," ",c]}),h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] whitespace-nowrap ${f?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[f?h.jsx(ns,{}):h.jsx(ts,{}),u,"%",h.jsx("span",{children:"from last month"})]})]})]}),h.jsx("div",{className:"mt-[16px]",children:i.outlets.map((m,g)=>h.jsxs("div",{className:g===i.outlets.length-1?"":"mb-[16px]",children:[h.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:m.name}),h.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[h.jsxs("div",{className:"text-[#64748B] inline-block",children:[m.orders," orders"]}),h.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",eP(m.revenue)]})]})]}),h.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:h.jsx("div",{className:`h-[11px] rounded-full ${m.color}`,style:{width:`${m.percentage}%`}})})]},`${m.name}-${g}`))})]})})}function qpe({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"Rs"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(m=>({facility_name:m?.facility_name,total_bookings:m?.total_bookings??0,paid_revenue:m?.paid_revenue??"0",isPaid:m?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(m=>({...m,isPaid:m?.isPaid===!0})),o=i.length>0&&i.every(m=>m?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const m=s.replace("%","").trim(),g=Number(m);l=isNaN(g)?0:g}const c=i.reduce((m,g)=>{const v=g?.total_bookings||0;return m+v},0),u=i.map(m=>{const g=m?.total_bookings||0,v=m?.isPaid?`${n?.currencyType||"Rs"} ${m?.paid_revenue||"0.00"}`:"",x=c>0?Math.round(g/c*100):0;return{name:m?.facility_name||"Unknown",bookings:g,revenue:v,percentage:x,color:"bg-[#3C81F6]",isPaid:m?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const m=d.replace("%","").trim(),g=Number(m);f=isNaN(g)?null:g}const p=f!==null?f>=0:!0;return h.jsx(Ie,{className:"h-[324px]",title:"Amenities",period:"Today",icon:h.jsx(Xfe,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex gap-[24px]",children:[h.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?h.jsx(ns,{}):h.jsx(ts,{}),l,"%",h.jsx("span",{children:"from last month"})]})]}),!o&&h.jsxs("div",{className:"w-[30%] flex flex-col gap-[8px] ",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),h.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[n?.currencyType||"Rs"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] whitespace-nowrap ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?h.jsx(ns,{}):h.jsx(ts,{}),f,"%",h.jsx("span",{children:"from last month"})]})]})]}),h.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((m,g)=>h.jsxs("div",{className:g===u.length-1?"":"mb-[16px]",children:[h.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:m?.name}),h.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[h.jsxs("div",{className:"text-[#64748B] inline",children:[m?.bookings," ",m?.bookings<=1?"booking":"bookings"]}),m?.isPaid&&h.jsx("div",{className:"mx-2 text-[#121212] inline",children:m?.revenue})]})]}),h.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:h.jsx("div",{className:`h-[11px] rounded-full ${m?.color}`,style:{width:`${m?.percentage}%`}})})]},g)):h.jsx("div",{className:"flex items-center justify-center h-[120px]",children:h.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}$n.register(Ro,Io,$l,Pr,Xr);function Gpe({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Cancelled",data:s,backgroundColor:"#FB2C36",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!1,pointStyle:"rect",padding:12,boxWidth:20,boxHeight:8,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return h.jsx(Ie,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:h.jsx(w8,{className:"!text-[24px] text-[#3C81F6]"}),children:h.jsx("div",{className:"h-full",children:h.jsx(Bl,{data:l,options:c})})})}const Xpe=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return h.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:h.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[h.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),h.jsx("div",{children:n.name}),h.jsx("div",{className:"ml-2",children:n.value})]})})};function Qpe({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return h.jsx(Ie,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:h.jsx(Jv,{className:"!text-[24px] text-[#EF4444]"}),children:h.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[h.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Vi,{children:[h.jsx(ci,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>h.jsx(In,{fill:a.color},s))}),h.jsx(Dt,{content:a=>h.jsx(dr,{...a,data:i,children:h.jsx(Xpe,{...a})})})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[h.jsx("div",{children:r(n.completed)}),h.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),h.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>h.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const tP={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function Zpe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function Jpe(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function ehe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>Jpe(i?.hour)===n)||{};return{hour:n,time:Zpe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function nP({title:e,color:t,rows:n=[],children:r}){const i=h.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px] border-[0.5px] border-[#EBEBEB] shadow-[0px_0px_12px_0px_#EAF2FF]",children:[h.jsx("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:h.jsx("div",{children:e??""})}),h.jsx("div",{className:"mt-[16px] pt-[16px] border-t border-dashed border-[#EBEBEB] space-y-[16px]",children:n?.map(({label:o,value:a,valueColor:s})=>h.jsxs("div",{className:"flex justify-between text-[14px] leading-[18px]",children:[h.jsx("div",{className:"text-[#64748B]",children:o??""}),h.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return h.jsx(zR,{placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,maxWidth:"none",render:o=>h.jsx("div",{tabIndex:"-1",...o,children:i}),children:r})}function the({active:e,payload:t}){return!e||!t?.length?null:h.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),h.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),h.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function nhe({data:e}){const t=e&&Object.keys(e).length?e:tP,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=k.useMemo(()=>{const l=t?.chart_data??[];return ehe(l.length?l:tP.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=k.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return h.jsx(Ie,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:h.jsx(Hb,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsxs("div",{className:"flex flex-col gap-[24px]",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6",children:[h.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),h.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),h.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),h.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),h.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),h.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[h.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),h.jsx(nP,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:h.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),h.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),h.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[h.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),h.jsx(nP,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:h.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),h.jsx("div",{className:"w-full h-[149px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Kx,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[h.jsx(ur,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),h.jsx(Kn,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),h.jsx(Ln,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),h.jsx(Dt,{content:l=>h.jsx(dr,{...l,data:i,children:h.jsx(the,{...l})})}),h.jsx(Qo,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),h.jsx(Qo,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}function rhe({data:e=null}){const t={total_entries:79.6,entries:59350,exit:40950},n=e&&Object.keys(e).length>0?e:t,r=c=>{const u=Number(c);return isNaN(u)?0:u},i=r(n.entries),o=r(n.exit),a=e&&Object.keys(e).length>0&&Number(e.entries)===0&&Number(e.exit)===0,s=[{name:"Entries",value:i,color:"#8B5CF6"},{name:"Exit",value:o,color:"#329DFF"}],l=r(n.total_entries);return h.jsx(Et,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:a?h.jsx("div",{className:"h-[300px] flex items-center justify-center",children:h.jsx(En,{title:"No access Point Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[h.jsxs("div",{className:"relative w-[212px] h-[212px]",children:[h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),h.jsx("div",{className:"h-[212px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Vi,{children:[h.jsx(ci,{data:s,dataKey:"value",innerRadius:65,outerRadius:100,startAngle:360,endAngle:-180,paddingAngle:1,stroke:"transparent",children:s.map((c,u)=>h.jsx(In,{fill:c.color},u))}),h.jsx(Dt,{content:c=>h.jsx(dr,{...c,data:s,children:h.jsx(si,{...c})})})]})})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[22px] leading-[27px] font-medium text-[#121212]",children:l}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B]",children:"Total Access"})]})]}),h.jsxs("div",{className:"mt-[28px] flex justify-between w-full px-[20px]",children:[h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("div",{className:"w-[14px] h-[6px] bg-[#8B5CF6]"}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Entries"})]}),h.jsx("div",{className:"text-[18px] font-medium text-[#8B5CF6] mt-[4px]",children:i.toLocaleString()})]}),h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("div",{className:"w-[14px] h-[6px] bg-[#329DFF]"}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Exit"})]}),h.jsx("div",{className:"text-[18px] font-medium text-[#329DFF] mt-[4px]",children:o.toLocaleString()})]})]})]})})}function II({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return h.jsx(Et,{className:n,title:e,titleWeight:"semi-bold",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[h.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[h.jsx("div",{children:"Point"}),h.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),h.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function ihe({data:e=[]}){const[t,n]=k.useState([]),r=e&&e.length?e:[],i=!e||e.length===0,o=e&&e.length>0&&e.every(c=>Number(c.entries)===0&&Number(c.exit)===0),a=i||o,s=c=>c>=1e3?`${c/1e3}K`:c,l=c=>{n(u=>u.includes(c)?u.filter(d=>d!==c):[...u,c])};return h.jsx(Et,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:a?h.jsx("div",{className:"h-[270px] flex items-center justify-center",children:h.jsx(En,{title:"No access Point Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(No,{data:r,barSize:54,margin:{top:0,right:0,left:-20,bottom:0},children:[h.jsx(ur,{strokeDasharray:"8 8",vertical:!1}),h.jsx(Lx,{y:0,stroke:"#EBEBEB"}),h.jsx(Kn,{dataKey:"block_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),h.jsx(Ln,{tickFormatter:s,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),h.jsx(Dt,{cursor:!1,content:c=>h.jsx(dr,{...c,data:r,children:(()=>{if(!c.active||!c.label)return null;const u=r.find(d=>d.block_name===c.label);return h.jsxs("div",{className:"bg-[#111] text-white px-[14px] py-[8px] rounded-[6px] flex flex-col gap-[6px] text-[13px]",children:[h.jsx("div",{className:"font-semibold",children:c.label}),!t.includes("entries")&&h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#329DFF]"}),h.jsx("div",{className:"text-[#aaa]",children:"Entries"}),h.jsx("div",{className:"font-bold",children:u?.entries??0})]}),!t.includes("exit")&&h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#76BDFF]"}),h.jsx("div",{className:"text-[#aaa]",children:"Exit"}),h.jsx("div",{className:"font-bold",children:u?.exit??0})]})]})})()})}),h.jsx(El,{verticalAlign:"bottom",height:36,content:()=>{const c=[{key:"entries",label:"Entries",color:"#329DFF"},{key:"exit",label:"Exit",color:"#76BDFF"}];return h.jsx("div",{style:{display:"flex",gap:"20px",justifyContent:"center",marginTop:"20px"},children:c.map((u,d)=>{const f=t.includes(u.key);return h.jsxs("div",{onClick:()=>l(u.key),style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",opacity:f?.4:1},children:[h.jsx("div",{style:{width:"20px",height:"8px",backgroundColor:u.color}}),h.jsx("div",{style:{fontSize:"12px",color:"#64748B"},children:u.label})]},d)})})}}),h.jsx(Kt,{dataKey:"entries",stackId:"a",fill:"#329DFF",hide:t.includes("entries")}),h.jsx(Kt,{dataKey:"exit",stackId:"a",fill:"#76BDFF",hide:t.includes("exit")})]})})})})}$n.register(um,Pr,Xr);const ohe={id:"bottomGlow",afterDatasetsDraw(e,t,n){if(!n?.enabled)return;const r=e.getDatasetMeta(0);if(!r?.data?.[0])return;const{ctx:i}=e,{x:o,y:a,innerRadius:s}=r.data[0],l=Math.max(s-2,0),c=a+l*.9,u=i.createRadialGradient(o,c,0,o,c,l*1.08);u.addColorStop(0,n.color??"rgba(186, 230, 253, 0.72)"),u.addColorStop(.3,"rgba(186, 230, 253, 0.4)"),u.addColorStop(.58,"rgba(186, 230, 253, 0.16)"),u.addColorStop(1,"rgba(186, 230, 253, 0)"),i.save(),i.beginPath(),i.arc(o,a,l,0,Math.PI*2),i.clip(),i.fillStyle=u,i.beginPath(),i.ellipse(o,c,l*1.08,l*.52,0,0,Math.PI*2),i.fill(),i.restore()}},ahe={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=24,bottomSize:u=9,topColor:d="#121212",bottomColor:f="#121212"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-6),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+22),r.restore()}},she=({title:e="Tickets",icon:t,firstLabel:n="First",firstValue:r=0,firstColor:i="#12B981",secondLabel:o="Second",secondValue:a=0,secondColor:s="#AB0000",growthPercentage:l="+0%",growthText:c="Compared to last month",totalLabel:u="Total",centerTopColor:d="#0F172A",centerBottomColor:f="#64748B",centerTopSize:p,centerBottomSize:m,showBottomGlow:g=!1,bottomGlowColor:v="rgba(186, 230, 253, 0.75)",widgetType:x="",resolvedWidgetType:_="",data:w})=>{const y=w?.title??e;w?.icon;const E=w?.firstLabel??n,S=Number(w?.firstValue??r??0),P=w?.firstColor??i,D=w?.secondLabel??o,T=Number(w?.secondValue??a??0),R=w?.secondColor??s,A=w?.growthPercentage??l??"+0%",C=w?.growthText??c,N=w?.totalLabel??u,M=w?.widgetType??x??_,j=w?.centerTopSize??p??(M==="commercial"?34:20),F=w?.centerBottomSize??m??(M==="commercial"?14:10),B=w?.showBottomGlow??g,V=w?.bottomGlowColor??v,z=S+T,W={labels:[E,D],datasets:[{data:[S,T],backgroundColor:[P,R],borderWidth:2,hoverOffset:4}]},Q={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{enabled:!1,external:ai()},centerText:{top:`${z}`,bottom:N,topSize:j,bottomSize:F,topColor:d,bottomColor:f},bottomGlow:{enabled:B,color:V}}},G=[{label:E,value:S,color:P},{label:D,value:T,color:R}],oe=A.toString().includes("+"),Z=A.toString().includes("-"),re=oe?"#1FA05B":"#AB0000";return h.jsx(Et,{title:y,className:"h-[362px] leading-[24px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[h.jsxs("div",{className:"col-span-5 space-y-[12px]",children:[G.map((ie,le)=>h.jsxs("div",{children:[h.jsx("div",{className:"text-[12px] text-[#64748B] mb-[8px]",children:ie.label}),h.jsx("div",{className:"text-[28px] leading-[32px]",style:{color:ie.color},children:ie.value})]},le)),h.jsxs("div",{className:`text-[12px] flex gap-[4px] ${M==="commercial"?"mt-[20px]":""} items-center`,style:{color:re},children:[oe&&h.jsx(ns,{}),Z&&h.jsx(ts,{}),h.jsx("div",{children:A.replace("+","").replace("-","")}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[14px] ml-[4px] whitespace-nowrap",children:C})]})]}),h.jsx("div",{className:"col-span-7",children:h.jsx("div",{className:`${M==="commercial"?"h-[260px] max-w-[263px]":"h-[158px] w-[158px]"} ml-auto mr-2`,children:h.jsx(fm,{data:W,options:Q,plugins:[ohe,ahe]})})})]})})},lhe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return h.jsx("g",{transform:`translate(${e},${t})`,children:h.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>h.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function che({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints,color:"#08B6D4"}));return h.jsx(Et,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full mt-[24px]!",children:t?h.jsx("div",{className:"w-full h-[262px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(No,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[h.jsx(ur,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),h.jsx(Kn,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,tickMargin:10,allowDecimals:!1}),h.jsx(Ln,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:132,tick:h.jsx(lhe,{})}),h.jsx(Dt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(dr,{...r,data:n,children:h.jsx(si,{...r})}):null}),h.jsx(Kt,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):h.jsx(En,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function uhe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return h.jsxs("div",{className:"relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&h.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:h.jsx(e,{className:"h-[20px] w-[20px]"})}),h.jsx("div",{className:"text-[16px] leading-[20px] tracking-[-2%] font-medium text-[#64748B]",children:n})]}),h.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&h.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&h.jsxs("div",{className:"flex items-center gap-[4px] text-[10px] leading-[14px] font-medium",style:{color:l},children:[s?h.jsx(ns,{}):h.jsx(ts,{}),Math.abs(a),"%"]}),o&&h.jsx("div",{className:"text-[10px] leading-[14px] text-[#64748B]",children:o})]})]})}const dhe=({data:e=[],onDateChange:t})=>{const[n,r]=k.useState(new Date),[i,o]=k.useState(!1),s=(v=>{const x=new Date(v);return x.setDate(x.getDate()-6),x})(n),l=v=>{try{return v.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=v=>{const x=new Date(v),_=new Date(x);_.setDate(_.getDate()-6),t&&t(_.toISOString(),x.toISOString())},u=()=>{const v=new Date(n);v.setDate(v.getDate()-7),r(v),c(v)},d=()=>{const v=new Date(n);v.setDate(v.getDate()+7),r(v),c(v)},f=()=>{o(v=>!v)},p=v=>{const x=v||new Date;r(x),c(x),o(!1)},m=Array.isArray(e)?e:[],g=!m.length||m.every(v=>v.no_of_visitors===0);return h.jsxs(Et,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&h.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50",children:h.jsx(PD,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),g?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(En,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Pj,{data:m,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Kn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:v=>new Date(v).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),h.jsx(Ln,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(Dt,{cursor:!1,content:v=>{const{active:x,payload:_,label:w}=v;if(!x||!_?.length)return null;const y=new Date(w).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return h.jsx(dr,{...v,data:m,children:h.jsx(si,{active:x,payload:_,label:y})})}}),h.jsx(zx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:v=>{const{cx:x,cy:_,stroke:w}=v;return h.jsxs("g",{children:[h.jsx("circle",{cx:x,cy:_,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:x,cy:_,r:2.5,fill:"#6466F1"})]})}})]})})})]})},fhe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],phe=({data:e,title:t,bar:n})=>{const r=Array.isArray(e)&&e?.length===0,i=e==null?fhe:Array.isArray(e)?e:[];return h.jsx(Et,{title:t||"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:r?h.jsx(En,{title:t||"Organisation Wise Visitors",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(No,{data:i||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[h.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Kn,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),h.jsx(Ln,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(Dt,{cursor:!1,content:o=>o.active?h.jsx(dr,{...o,data:i,children:h.jsx(si,{...o})}):null}),h.jsx(Kt,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:n||"#3C81F6"})]})})})})};function hhe({data:e}){return h.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return h.jsx(Ie,{iconClassName:"!gap-[8px]",title:h.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:h.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:`${t?.widget==="amenities"?"h-[139px]":"h-[124px]"}`,children:h.jsxs("div",{className:`flex flex-col gap-[8px] ${t?.widget==="amenities"?"mt-[3.5px]":"mt-0"}`,children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),h.jsxs("div",{className:`flex items-center text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&h.jsxs("div",{className:`flex items-center gap-[4px] px-[6px] py-[2px] rounded-[4px] font-medium
|
|
393
393
|
${i?"text-[#1FA05B] bg-[#F7FEFA]":"text-[#E11D48] bg-[#FBF4F4]"}
|
|
394
|
-
`,children:[i?h.jsx(ns,{}):h.jsx(ts,{}),Math.abs(r),"%"]}),h.jsx("div",{className:t.deltaColor?`text-[${t.deltaColor}] font-[600]`:"text-[#64748B]",children:t.deltaLabel})]})]})},n)})})}const mhe=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],ghe=({x:e,y:t,payload:n})=>h.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:h.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function vhe({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?mhe:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return h.jsx(Ie,{title:"Bookings",icon:h.jsx(Ufe,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:n?h.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(No,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[h.jsx(Kn,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),h.jsx(Ln,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:h.jsx(ghe,{})}),h.jsx(Dt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?h.jsx(dr,{...o,data:i,children:h.jsx(si,{...o})}):null}),h.jsx(Kt,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const yhe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function bhe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?yhe:Array.isArray(e)?e:[];return h.jsx(Et,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?h.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(No,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[h.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),h.jsx(Kn,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),h.jsx(Ln,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(dr,{...r,data:n,children:h.jsx(si,{...r})}):null}),h.jsx(Kt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const xhe=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],nf=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function whe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??xhe,i=Array?.isArray(r)&&r?.length>0?r?.map(l=>({name:l?.facility_name||"Unknown",value:Number(l?.paid_revenue)||0})):[],a=(i?.length>0?i?.every(l=>l?.value===0):!1)?i?.map((l,c)=>({...l,value:c===0?1:0})):i,s=l=>`${t||"Rs"} ${l?.toLocaleString?.("en-IN")||0}`;return h.jsx(Et,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?h.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:h.jsx(En,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Vi,{children:[h.jsx(ci,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>h.jsx(In,{fill:nf?.[c%nf?.length]},`cell-${c}`))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?h.jsx(dr,{...l,data:a,children:h.jsx(si,{...l,formatter:c=>s(c)})}):null})]})})}),h.jsx("div",{className:"col-span-6",children:h.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Amenity"}),h.jsx("div",{className:"text-right",children:"Revenue"})]}),h.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>h.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[h.jsxs("div",{className:"flex items-center gap-[12px]",children:[h.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:nf?.[c%nf?.length]}}),h.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),h.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const rf=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],_he=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],Ehe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:rf[o%rf.length]})):_he.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:rf[o%rf.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(Et,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Et,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Vi,{children:[h.jsx(ci,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,isAnimationActive:!1,children:n.map((i,o)=>h.jsx(In,{fill:i.fill},o))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(dr,{...i,data:n,children:h.jsx(si,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>h.jsxs("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar flex items-center justify-between px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},She=({data:e,title:t})=>{const[n,r]=k.useState({}),i=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],o=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:i,[e]),a=s=>{const{dataKey:l}=s;r(c=>({...c,[l]:!c[l]}))};return Array.isArray(e)&&e.length===0?h.jsx(Et,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Et,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(No,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Kn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(Dt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:s=>!s.active||!s.payload||!s.payload.length?null:h.jsx(dr,{...s,data:o,children:h.jsxs("div",{className:"bg-black rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:s.label}),s.payload.map((l,c)=>{const u=l.color||l.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:u}}),h.jsx("span",{className:"text-[#D1D3D4]",children:l.name}),h.jsx("span",{className:"text-white font-semibold",children:l.value})]},c)})]})})}),h.jsx(El,{verticalAlign:"bottom",align:"center",onClick:a,content:({payload:s})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:s.map((l,c)=>h.jsxs("div",{onClick:()=>a({dataKey:l.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[l.dataKey]?"#CBD5E1":l.color}}),h.jsx("span",{style:{fontSize:"12px",color:n[l.dataKey]?"#CBD5E1":"#64748B"},children:l.value})]},c))})}),h.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(Kt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),h.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function Ohe({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return h.jsx(Et,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"flex flex-col items-center justify-center",children:[h.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Vi,{children:[h.jsx(ci,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>h.jsx(In,{fill:i.color},`cell-${o}`))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(dr,{...i,data:t,children:h.jsx(si,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),h.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>h.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[h.jsxs("div",{className:"flex items-center gap-[10px]",children:[h.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function Che({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return h.jsx(Et,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.escalation_level==="Danger"?"text-[#AB0000]":o?.escalation_level==="High"?"text-[#E7A015]":"text-[#1FA05B]";return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[h.jsx("div",{className:"flex items-center gap-[8px]",children:h.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_reporting_id})}),h.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:h.jsxs("div",{children:[o?.escalation_value," - ",o?.escalation_level]})})]},a)}):h.jsx(h.Fragment,{})})]})})}function khe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,m=a===0&&c.length===0,g=`repeat(${u.length}, 1fr)`;return h.jsxs("div",{className:"w-full bg-white rounded-[12px] h-[390px] !border-[0.5px] !border-[#EBEBEB] !shadow-[0_0_12px_0_#EAF2FF] overflow-hidden flex flex-col",children:[h.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:g},children:u.map((v,x)=>h.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},x))}),h.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:m?h.jsx(En,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):p.map((v,x)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:g},children:u.map((_,w)=>{const y=v[_.key],E=_.label==="Closed",S=_.label==="Open",P=typeof y=="string"&&y.includes("%"),D=y==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return h.jsx("div",{className:`px-[24px] py-[16px] flex items-center justify-start ${w===0?"bg-white":"bg-gray-50"} text-[#121212]`,children:E?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:y??"-"}):S?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:y??"-"}):P?h.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:y}):h.jsx("div",{children:y??"-"})},w)})},x))})]}),h.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px] shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,x)=>h.jsx("option",{value:v,children:v},x))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(zfe,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(jI,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(RI,{size:18})}),h.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(Hfe,{size:18})})]})]})]})}const LI=({options:e=[],value:t,onChange:n})=>{const[r,i]=k.useState(!1),o=k.useRef(null);return k.useEffect(()=>{const a=s=>{o.current&&!o.current.contains(s.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]),h.jsxs("div",{ref:o,className:"relative h-[32px]",children:[h.jsxs("div",{className:"flex items-center justify-between gap-[10px] px-[12px] py-[8px] border border-[#E2E8F0] rounded-[4px] cursor-pointer min-w-[140px]",onClick:()=>i(!r),children:[h.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),h.jsx(Ffe,{size:16,className:"text-[#64748B]"})]}),r&&h.jsx("div",{className:"absolute top-[110%] left-0 w-full bg-white border border-[#E2E8F0] rounded-[8px] shadow-md z-10",children:e.map((a,s)=>h.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},Phe=({data:e,communities:t})=>{const[n,r]=k.useState({}),[i,o]=k.useState(""),a=t?t.map(u=>u.community_name):[];k.useEffect(()=>{a.length>0&&!i&&o(a[0])},[a,i]);const s=[{community_name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{community_name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{community_name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],l=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:s,[e]),c=u=>{const{dataKey:d}=u;r(f=>({...f,[d]:!f[d]}))};return Array.isArray(e)&&e.length===0?h.jsx(Et,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Et,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:h.jsx(LI,{options:a,value:i,onChange:u=>o(u)}),children:h.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[261px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(No,{data:l,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Kn,{dataKey:"community_name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(Dt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:u,payload:d,label:f})=>!u||!d||!d.length?null:h.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[h.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:f}),d.map((p,m)=>{const g=p.color||p.fill||"#fff";return h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[h.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:g,display:"inline-block"}}),h.jsx("span",{style:{color:"#D1D3D4"},children:p.name}),h.jsx("span",{style:{color:"#fff",fontWeight:600},children:p.value})]},m)})]})}),h.jsx(El,{verticalAlign:"bottom",align:"center",onClick:c,content:({payload:u})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:u.map((d,f)=>h.jsxs("div",{onClick:()=>c({dataKey:d.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[d.dataKey]?"#CBD5E1":d.color}}),h.jsx("span",{style:{fontSize:"12px",color:n[d.dataKey]?"#CBD5E1":"#64748B"},children:d.value})]},f))})}),h.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})},Dhe=({data:e=[]})=>{const[t,n]=k.useState("Kosmo One"),r=["Kosmo One","Kosmo Two","Kosmo Three"],i=Array.isArray(e)?e:[],o=!i.length||i.every(a=>a.no_of_visitors===0);return h.jsx(Et,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:h.jsx(LI,{options:r,value:t,onChange:a=>n(a)}),children:o?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(En,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Pj,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Kn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),h.jsx(Ln,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(Dt,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return h.jsx(si,{active:a,payload:s,label:u})}}),h.jsx(zx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return h.jsxs("g",{children:[h.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},Ahe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return h.jsx(Et,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children:h.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[h.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Tenant"}),h.jsx("div",{className:"flex justify-end",children:"Total"}),h.jsx("div",{className:"flex justify-end",children:"Pending"}),h.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),h.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((r,i)=>h.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[h.jsx("div",{className:"text-[#475569]",children:r.name}),h.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),h.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),h.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},of=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],The=[{asset_group_name:"Lifts",asset_count:3,investment:"₹ 45L"},{asset_group_name:"Fire Systems",asset_count:16,investment:"₹ 28L"},{asset_group_name:"Generators",asset_count:16,investment:"₹ 95L"},{asset_group_name:"HVAC",asset_count:24,investment:"₹ 1.2Cr"},{asset_group_name:"Others",asset_count:97,investment:"₹ 52L"}],Mhe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:of[o%of.length]})):The.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:of[o%of.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(Et,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Et,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Ct,{width:"100%",height:"100%",children:h.jsx(Vi,{children:h.jsx(ci,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>h.jsx(In,{fill:i.color},o))})})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),h.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};exports.AccessPointsUsage=ihe;exports.Accounting=lfe;exports.Amenities=qpe;exports.AmenitiesStatsCard=hhe;exports.AmenityWiseRevenue=whe;exports.AssetValueBreakdown=wfe;exports.AssetsByType=Ehe;exports.BlockWiseOccupancy=Jde;exports.BookingTrendChart=bhe;exports.Bookings=vhe;exports.Budgets=pfe;exports.BuildingWiseApprovals=Ahe;exports.Card=Ie;exports.CardAccess=II;exports.CashBankBalance=mfe;exports.CommercialAccessOverview=rhe;exports.CommercialGuardPatrols=Ohe;exports.CommercialIncidentReports=Che;exports.CommercialOccupancy=Vpe;exports.CommercialReportTable=khe;exports.Community=Joe;exports.Complaints=gpe;exports.ComplaintsByLevel=xpe;exports.DuesAgeing=vfe;exports.EmployeeFootfall=Hpe;exports.Engagement=Iae;exports.EngagementStatsGrid=zpe;exports.EscalationLevel=Phe;exports.EventsUtilisation=Mpe;exports.ExpenseCategories=bfe;exports.Facilities=Lae;exports.FinanceSummary=Fae;exports.FoodBeverages=Kpe;exports.GateAndSecurityStatsGrid=ppe;exports.GateUpdates=Ose;exports.GuardPatrols=Zfe;exports.Header=a8;exports.Helpdesk=Cse;exports.HelpdeskStatsGrid=Dpe;exports.HourlyTrafficFlow=rpe;exports.IncidentReports=ape;exports.IncomeExpenditure=MI;exports.MainHeader=b8;exports.MaintenanceStatus=She;exports.MetricCard=uhe;exports.MobileAccess=II;exports.MoveInOutTrends=nfe;exports.NoticeBoardStatus=Rpe;exports.OccupancyOverview=Xde;exports.OrganisationWiseVisitors=phe;exports.PortfolioAssetsByType=Mhe;exports.RequestBox=_pe;exports.ResidentOverview=Qde;exports.RevenuebyCategory=Efe;exports.SingleStats=Fpe;exports.StaffAttendance=cpe;exports.StatsGrid=Pfe;exports.TenantsByVisitors=Dhe;exports.TicketEscalation=Gpe;exports.TicketStatus=Qpe;exports.Tickets=she;exports.TicketsperCategory=che;exports.UnitStatus=Gde;exports.VisitorUpdates=nhe;exports.WeeklyVisitorPattern=dhe;
|
|
394
|
+
`,children:[i?h.jsx(ns,{}):h.jsx(ts,{}),Math.abs(r),"%"]}),h.jsx("div",{className:t.deltaColor?`text-[${t.deltaColor}] font-[600]`:"text-[#64748B]",children:t.deltaLabel})]})]})},n)})})}const mhe=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],ghe=({x:e,y:t,payload:n})=>h.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:h.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function vhe({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?mhe:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return h.jsx(Ie,{title:"Bookings",icon:h.jsx(Ufe,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:n?h.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(No,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[h.jsx(Kn,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),h.jsx(Ln,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:h.jsx(ghe,{})}),h.jsx(Dt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?h.jsx(dr,{...o,data:i,children:h.jsx(si,{...o})}):null}),h.jsx(Kt,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const yhe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function bhe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?yhe:Array.isArray(e)?e:[];return h.jsx(Et,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?h.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(No,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[h.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),h.jsx(Kn,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),h.jsx(Ln,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(dr,{...r,data:n,children:h.jsx(si,{...r})}):null}),h.jsx(Kt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const xhe=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],nf=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function whe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??xhe,i=Array?.isArray(r)&&r?.length>0?r?.map(l=>({name:l?.facility_name||"Unknown",value:Number(l?.paid_revenue)||0})):[],a=(i?.length>0?i?.every(l=>l?.value===0):!1)?i?.map((l,c)=>({...l,value:c===0?1:0})):i,s=l=>`${t||"Rs"} ${l?.toLocaleString?.("en-IN")||0}`;return h.jsx(Et,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?h.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:h.jsx(En,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Vi,{children:[h.jsx(ci,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>h.jsx(In,{fill:nf?.[c%nf?.length]},`cell-${c}`))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?h.jsx(dr,{...l,data:a,children:h.jsx(si,{...l,formatter:c=>s(c)})}):null})]})})}),h.jsx("div",{className:"col-span-6",children:h.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Amenity"}),h.jsx("div",{className:"text-right",children:"Revenue"})]}),h.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>h.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[h.jsxs("div",{className:"flex items-center gap-[12px]",children:[h.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:nf?.[c%nf?.length]}}),h.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),h.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const rf=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],_he=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],Ehe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:rf[o%rf.length]})):_he.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:rf[o%rf.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(Et,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Et,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Vi,{children:[h.jsx(ci,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,isAnimationActive:!1,children:n.map((i,o)=>h.jsx(In,{fill:i.fill},o))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(dr,{...i,data:n,children:h.jsx(si,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>h.jsxs("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar flex items-center justify-between px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},She=({data:e,title:t})=>{const[n,r]=k.useState({}),i=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],o=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:i,[e]),a=s=>{const{dataKey:l}=s;r(c=>({...c,[l]:!c[l]}))};return Array.isArray(e)&&e.length===0?h.jsx(Et,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Et,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(No,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Kn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(Dt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:s=>!s.active||!s.payload||!s.payload.length?null:h.jsx(dr,{...s,data:o,children:h.jsxs("div",{className:"bg-black rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:s.label}),s.payload.map((l,c)=>{const u=l.color||l.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:u}}),h.jsx("span",{className:"text-[#D1D3D4]",children:l.name}),h.jsx("span",{className:"text-white font-semibold",children:l.value})]},c)})]})})}),h.jsx(El,{verticalAlign:"bottom",align:"center",onClick:a,content:({payload:s})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:s.map((l,c)=>h.jsxs("div",{onClick:()=>a({dataKey:l.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[l.dataKey]?"#CBD5E1":l.color}}),h.jsx("span",{style:{fontSize:"12px",color:n[l.dataKey]?"#CBD5E1":"#64748B"},children:l.value})]},c))})}),h.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(Kt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),h.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function Ohe({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return h.jsx(Et,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"flex flex-col items-center justify-center",children:[h.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Vi,{children:[h.jsx(ci,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>h.jsx(In,{fill:i.color},`cell-${o}`))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(dr,{...i,data:t,children:h.jsx(si,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),h.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>h.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[h.jsxs("div",{className:"flex items-center gap-[10px]",children:[h.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function Che({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return h.jsx(Et,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.escalation_level==="Danger"?"text-[#AB0000]":o?.escalation_level==="High"?"text-[#E7A015]":"text-[#1FA05B]";return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[h.jsx("div",{className:"flex items-center gap-[8px]",children:h.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_reporting_id})}),h.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:h.jsxs("div",{children:[o?.escalation_value," - ",o?.escalation_level]})})]},a)}):h.jsx(h.Fragment,{})})]})})}function khe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,m=a===0&&c.length===0,g=`repeat(${u.length}, 1fr)`;return h.jsxs("div",{className:"w-full bg-white rounded-[12px] h-[390px] !border-[0.5px] !border-[#EBEBEB] !shadow-[0_0_12px_0_#EAF2FF] overflow-hidden flex flex-col",children:[h.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:g},children:u.map((v,x)=>h.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},x))}),h.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:m?h.jsx(En,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):p.map((v,x)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:g},children:u.map((_,w)=>{const y=v[_.key],E=_.label==="Closed",S=_.label==="Open",P=typeof y=="string"&&y.includes("%"),D=y==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return h.jsx("div",{className:`px-[24px] py-[16px] flex items-center justify-start ${w===0?"bg-white":"bg-gray-50"} text-[#121212]`,children:E?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:y??"-"}):S?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:y??"-"}):P?h.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:y}):h.jsx("div",{children:y??"-"})},w)})},x))})]}),h.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px] shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,x)=>h.jsx("option",{value:v,children:v},x))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(zfe,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(jI,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(RI,{size:18})}),h.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(Hfe,{size:18})})]})]})]})}const LI=({options:e=[],value:t,onChange:n})=>{const[r,i]=k.useState(!1),o=k.useRef(null);return k.useEffect(()=>{const a=s=>{o.current&&!o.current.contains(s.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]),h.jsxs("div",{ref:o,className:"relative h-[32px]",children:[h.jsxs("div",{className:"flex items-center justify-between gap-[10px] px-[12px] py-[8px] border border-[#E2E8F0] rounded-[4px] cursor-pointer min-w-[140px]",onClick:()=>i(!r),children:[h.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),h.jsx(Ffe,{size:16,className:"text-[#64748B]"})]}),r&&h.jsx("div",{className:"absolute top-[110%] left-0 w-full bg-white border border-[#E2E8F0] rounded-[8px] shadow-md z-10",children:e.map((a,s)=>h.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},Phe=({data:e,communities:t,title:n})=>{const[r,i]=k.useState({}),[o,a]=k.useState(""),s=t?t.map(d=>d.community_name):[];k.useEffect(()=>{s.length>0&&!o&&a(s[0])},[s,o]);const l=[{community_name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{community_name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{community_name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],c=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:l,[e]),u=d=>{const{dataKey:f}=d;i(p=>({...p,[f]:!p[f]}))};return Array.isArray(e)&&e.length===0?h.jsx(Et,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Et,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:h.jsx(LI,{options:s,value:o,onChange:d=>a(d)}),children:h.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[261px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(No,{data:c,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Kn,{dataKey:"community_name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(Dt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:d,payload:f,label:p})=>!d||!f||!f.length?null:h.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[h.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:p}),f.map((m,g)=>{const v=m.color||m.fill||"#fff";return h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[h.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:v,display:"inline-block"}}),h.jsx("span",{style:{color:"#D1D3D4"},children:m.name}),h.jsx("span",{style:{color:"#fff",fontWeight:600},children:m.value})]},g)})]})}),h.jsx(El,{verticalAlign:"bottom",align:"center",onClick:u,content:({payload:d})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:d.map((f,p)=>h.jsxs("div",{onClick:()=>u({dataKey:f.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:r[f.dataKey]?"#CBD5E1":f.color}}),h.jsx("span",{style:{fontSize:"12px",color:r[f.dataKey]?"#CBD5E1":"#64748B"},children:f.value})]},p))})}),h.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:r.Open}),h.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:r.Cancelled}),h.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:r.OnHold,name:"On-Hold"}),h.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:r.InProgress,name:"In Progress"})]})})})})})},Dhe=({data:e=[]})=>{const[t,n]=k.useState("Kosmo One"),r=["Kosmo One","Kosmo Two","Kosmo Three"],i=Array.isArray(e)?e:[],o=!i.length||i.every(a=>a.no_of_visitors===0);return h.jsx(Et,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:h.jsx(LI,{options:r,value:t,onChange:a=>n(a)}),children:o?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(En,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Ct,{width:"100%",height:"100%",children:h.jsxs(Pj,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Kn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),h.jsx(Ln,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(Dt,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return h.jsx(si,{active:a,payload:s,label:u})}}),h.jsx(zx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return h.jsxs("g",{children:[h.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},Ahe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return h.jsx(Et,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children:h.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[h.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Tenant"}),h.jsx("div",{className:"flex justify-end",children:"Total"}),h.jsx("div",{className:"flex justify-end",children:"Pending"}),h.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),h.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((r,i)=>h.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[h.jsx("div",{className:"text-[#475569]",children:r.name}),h.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),h.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),h.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},of=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],The=[{asset_group_name:"Lifts",asset_count:3,investment:"₹ 45L"},{asset_group_name:"Fire Systems",asset_count:16,investment:"₹ 28L"},{asset_group_name:"Generators",asset_count:16,investment:"₹ 95L"},{asset_group_name:"HVAC",asset_count:24,investment:"₹ 1.2Cr"},{asset_group_name:"Others",asset_count:97,investment:"₹ 52L"}],Mhe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:of[o%of.length]})):The.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:of[o%of.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(Et,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Et,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Ct,{width:"100%",height:"100%",children:h.jsx(Vi,{children:h.jsx(ci,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>h.jsx(In,{fill:i.color},o))})})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),h.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};exports.AccessPointsUsage=ihe;exports.Accounting=lfe;exports.Amenities=qpe;exports.AmenitiesStatsCard=hhe;exports.AmenityWiseRevenue=whe;exports.AssetValueBreakdown=wfe;exports.AssetsByType=Ehe;exports.BlockWiseOccupancy=Jde;exports.BookingTrendChart=bhe;exports.Bookings=vhe;exports.Budgets=pfe;exports.BuildingWiseApprovals=Ahe;exports.Card=Ie;exports.CardAccess=II;exports.CashBankBalance=mfe;exports.CommercialAccessOverview=rhe;exports.CommercialGuardPatrols=Ohe;exports.CommercialIncidentReports=Che;exports.CommercialOccupancy=Vpe;exports.CommercialReportTable=khe;exports.Community=Joe;exports.Complaints=gpe;exports.ComplaintsByLevel=xpe;exports.DuesAgeing=vfe;exports.EmployeeFootfall=Hpe;exports.Engagement=Iae;exports.EngagementStatsGrid=zpe;exports.EscalationLevel=Phe;exports.EventsUtilisation=Mpe;exports.ExpenseCategories=bfe;exports.Facilities=Lae;exports.FinanceSummary=Fae;exports.FoodBeverages=Kpe;exports.GateAndSecurityStatsGrid=ppe;exports.GateUpdates=Ose;exports.GuardPatrols=Zfe;exports.Header=a8;exports.Helpdesk=Cse;exports.HelpdeskStatsGrid=Dpe;exports.HourlyTrafficFlow=rpe;exports.IncidentReports=ape;exports.IncomeExpenditure=MI;exports.MainHeader=b8;exports.MaintenanceStatus=She;exports.MetricCard=uhe;exports.MobileAccess=II;exports.MoveInOutTrends=nfe;exports.NoticeBoardStatus=Rpe;exports.OccupancyOverview=Xde;exports.OrganisationWiseVisitors=phe;exports.PortfolioAssetsByType=Mhe;exports.RequestBox=_pe;exports.ResidentOverview=Qde;exports.RevenuebyCategory=Efe;exports.SingleStats=Fpe;exports.StaffAttendance=cpe;exports.StatsGrid=Pfe;exports.TenantsByVisitors=Dhe;exports.TicketEscalation=Gpe;exports.TicketStatus=Qpe;exports.Tickets=she;exports.TicketsperCategory=che;exports.UnitStatus=Gde;exports.VisitorUpdates=nhe;exports.WeeklyVisitorPattern=dhe;
|
package/dist/index.es.js
CHANGED
|
@@ -56292,12 +56292,12 @@ const QI = ({ options: e = [], value: t, onChange: n }) => {
|
|
|
56292
56292
|
s
|
|
56293
56293
|
)) })
|
|
56294
56294
|
] });
|
|
56295
|
-
}, pme = ({ data: e, communities: t }) => {
|
|
56296
|
-
const [
|
|
56295
|
+
}, pme = ({ data: e, communities: t, title: n }) => {
|
|
56296
|
+
const [r, i] = Se({}), [o, a] = Se(""), s = t ? t.map((d) => d.community_name) : [];
|
|
56297
56297
|
Ee(() => {
|
|
56298
|
-
|
|
56299
|
-
}, [
|
|
56300
|
-
const
|
|
56298
|
+
s.length > 0 && !o && a(s[0]);
|
|
56299
|
+
}, [s, o]);
|
|
56300
|
+
const l = [
|
|
56301
56301
|
{
|
|
56302
56302
|
community_name: "L1",
|
|
56303
56303
|
Cancelled: 55,
|
|
@@ -56319,17 +56319,17 @@ const QI = ({ options: e = [], value: t, onChange: n }) => {
|
|
|
56319
56319
|
OnHold: 18,
|
|
56320
56320
|
InProgress: 7
|
|
56321
56321
|
}
|
|
56322
|
-
],
|
|
56323
|
-
const { dataKey:
|
|
56324
|
-
|
|
56325
|
-
...
|
|
56326
|
-
[
|
|
56322
|
+
], c = sn(() => e ? Array.isArray(e) && e.length === 0 ? [] : e : l, [e]), u = (d) => {
|
|
56323
|
+
const { dataKey: f } = d;
|
|
56324
|
+
i((p) => ({
|
|
56325
|
+
...p,
|
|
56326
|
+
[f]: !p[f]
|
|
56327
56327
|
}));
|
|
56328
56328
|
};
|
|
56329
56329
|
return Array.isArray(e) && e.length === 0 ? /* @__PURE__ */ h.jsx(
|
|
56330
56330
|
Pt,
|
|
56331
56331
|
{
|
|
56332
|
-
title: "Escalation Level By Building",
|
|
56332
|
+
title: n || "Escalation Level By Building",
|
|
56333
56333
|
titleWeight: "semi-bold",
|
|
56334
56334
|
className: "h-full",
|
|
56335
56335
|
children: /* @__PURE__ */ h.jsx("div", { className: "w-full h-[362px] flex items-center justify-center", children: /* @__PURE__ */ h.jsx(
|
|
@@ -56343,22 +56343,22 @@ const QI = ({ options: e = [], value: t, onChange: n }) => {
|
|
|
56343
56343
|
) : /* @__PURE__ */ h.jsx(
|
|
56344
56344
|
Pt,
|
|
56345
56345
|
{
|
|
56346
|
-
title: "Escalation Level By Building",
|
|
56346
|
+
title: n || "Escalation Level By Building",
|
|
56347
56347
|
titleWeight: "semi-bold",
|
|
56348
56348
|
className: "h-[362px]",
|
|
56349
56349
|
childrenClassName: "mt-[21px]",
|
|
56350
56350
|
rightContent: /* @__PURE__ */ h.jsx(
|
|
56351
56351
|
QI,
|
|
56352
56352
|
{
|
|
56353
|
-
options:
|
|
56354
|
-
value:
|
|
56355
|
-
onChange: (
|
|
56353
|
+
options: s,
|
|
56354
|
+
value: o,
|
|
56355
|
+
onChange: (d) => a(d)
|
|
56356
56356
|
}
|
|
56357
56357
|
),
|
|
56358
56358
|
children: /* @__PURE__ */ h.jsx("div", { className: "w-full flex items-center justify-center", children: Array.isArray(e) && e.length === 0 ? /* @__PURE__ */ h.jsx("div", { className: "text-[#94A3B8] text-sm", children: "No Data Found" }) : /* @__PURE__ */ h.jsx("div", { className: "relative w-full h-[261px]", children: /* @__PURE__ */ h.jsx(At, { width: "100%", height: "100%", children: /* @__PURE__ */ h.jsxs(
|
|
56359
56359
|
Vo,
|
|
56360
56360
|
{
|
|
56361
|
-
data:
|
|
56361
|
+
data: c,
|
|
56362
56362
|
barSize: 54,
|
|
56363
56363
|
barCategoryGap: "40%",
|
|
56364
56364
|
margin: { top: 20, right: 20, left: -20, bottom: 0 },
|
|
@@ -56393,7 +56393,7 @@ const QI = ({ options: e = [], value: t, onChange: n }) => {
|
|
|
56393
56393
|
Nt,
|
|
56394
56394
|
{
|
|
56395
56395
|
cursor: { fill: "rgba(148, 163, 184, 0.12)" },
|
|
56396
|
-
content: ({ active:
|
|
56396
|
+
content: ({ active: d, payload: f, label: p }) => !d || !f || !f.length ? null : /* @__PURE__ */ h.jsxs(
|
|
56397
56397
|
"div",
|
|
56398
56398
|
{
|
|
56399
56399
|
style: {
|
|
@@ -56404,9 +56404,9 @@ const QI = ({ options: e = [], value: t, onChange: n }) => {
|
|
|
56404
56404
|
color: "#fff"
|
|
56405
56405
|
},
|
|
56406
56406
|
children: [
|
|
56407
|
-
/* @__PURE__ */ h.jsx("div", { style: { marginBottom: "6px", fontWeight: 600 }, children:
|
|
56408
|
-
|
|
56409
|
-
const
|
|
56407
|
+
/* @__PURE__ */ h.jsx("div", { style: { marginBottom: "6px", fontWeight: 600 }, children: p }),
|
|
56408
|
+
f.map((m, g) => {
|
|
56409
|
+
const v = m.color || m.fill || "#fff";
|
|
56410
56410
|
return /* @__PURE__ */ h.jsxs(
|
|
56411
56411
|
"div",
|
|
56412
56412
|
{
|
|
@@ -56419,16 +56419,16 @@ const QI = ({ options: e = [], value: t, onChange: n }) => {
|
|
|
56419
56419
|
width: "8px",
|
|
56420
56420
|
height: "8px",
|
|
56421
56421
|
borderRadius: "50%",
|
|
56422
|
-
backgroundColor:
|
|
56422
|
+
backgroundColor: v,
|
|
56423
56423
|
display: "inline-block"
|
|
56424
56424
|
}
|
|
56425
56425
|
}
|
|
56426
56426
|
),
|
|
56427
|
-
/* @__PURE__ */ h.jsx("span", { style: { color: "#D1D3D4" }, children:
|
|
56428
|
-
/* @__PURE__ */ h.jsx("span", { style: { color: "#fff", fontWeight: 600 }, children:
|
|
56427
|
+
/* @__PURE__ */ h.jsx("span", { style: { color: "#D1D3D4" }, children: m.name }),
|
|
56428
|
+
/* @__PURE__ */ h.jsx("span", { style: { color: "#fff", fontWeight: 600 }, children: m.value })
|
|
56429
56429
|
]
|
|
56430
56430
|
},
|
|
56431
|
-
|
|
56431
|
+
g
|
|
56432
56432
|
);
|
|
56433
56433
|
})
|
|
56434
56434
|
]
|
|
@@ -56441,11 +56441,11 @@ const QI = ({ options: e = [], value: t, onChange: n }) => {
|
|
|
56441
56441
|
{
|
|
56442
56442
|
verticalAlign: "bottom",
|
|
56443
56443
|
align: "center",
|
|
56444
|
-
onClick:
|
|
56445
|
-
content: ({ payload:
|
|
56444
|
+
onClick: u,
|
|
56445
|
+
content: ({ payload: d }) => /* @__PURE__ */ h.jsx("div", { className: "flex items-center justify-center gap-[16px] pt-4 flex-wrap", children: d.map((f, p) => /* @__PURE__ */ h.jsxs(
|
|
56446
56446
|
"div",
|
|
56447
56447
|
{
|
|
56448
|
-
onClick: () =>
|
|
56448
|
+
onClick: () => u({ dataKey: f.dataKey }),
|
|
56449
56449
|
className: "flex items-center gap-[8px] cursor-pointer",
|
|
56450
56450
|
children: [
|
|
56451
56451
|
/* @__PURE__ */ h.jsx(
|
|
@@ -56454,7 +56454,7 @@ const QI = ({ options: e = [], value: t, onChange: n }) => {
|
|
|
56454
56454
|
style: {
|
|
56455
56455
|
width: "16px",
|
|
56456
56456
|
height: "8px",
|
|
56457
|
-
backgroundColor:
|
|
56457
|
+
backgroundColor: r[f.dataKey] ? "#CBD5E1" : f.color
|
|
56458
56458
|
}
|
|
56459
56459
|
}
|
|
56460
56460
|
),
|
|
@@ -56463,21 +56463,21 @@ const QI = ({ options: e = [], value: t, onChange: n }) => {
|
|
|
56463
56463
|
{
|
|
56464
56464
|
style: {
|
|
56465
56465
|
fontSize: "12px",
|
|
56466
|
-
color:
|
|
56466
|
+
color: r[f.dataKey] ? "#CBD5E1" : "#64748B"
|
|
56467
56467
|
},
|
|
56468
|
-
children:
|
|
56468
|
+
children: f.value
|
|
56469
56469
|
}
|
|
56470
56470
|
)
|
|
56471
56471
|
]
|
|
56472
56472
|
},
|
|
56473
|
-
|
|
56473
|
+
p
|
|
56474
56474
|
)) })
|
|
56475
56475
|
}
|
|
56476
56476
|
),
|
|
56477
|
-
/* @__PURE__ */ h.jsx(Zt, { dataKey: "Open", stackId: "a", fill: "#3B82F6", hide:
|
|
56478
|
-
/* @__PURE__ */ h.jsx(Zt, { dataKey: "Cancelled", stackId: "a", fill: "#B91C1C", hide:
|
|
56479
|
-
/* @__PURE__ */ h.jsx(Zt, { dataKey: "OnHold", stackId: "a", fill: "#64748B", hide:
|
|
56480
|
-
/* @__PURE__ */ h.jsx(Zt, { dataKey: "InProgress", stackId: "a", fill: "#F59E0B", hide:
|
|
56477
|
+
/* @__PURE__ */ h.jsx(Zt, { dataKey: "Open", stackId: "a", fill: "#3B82F6", hide: r.Open }),
|
|
56478
|
+
/* @__PURE__ */ h.jsx(Zt, { dataKey: "Cancelled", stackId: "a", fill: "#B91C1C", hide: r.Cancelled }),
|
|
56479
|
+
/* @__PURE__ */ h.jsx(Zt, { dataKey: "OnHold", stackId: "a", fill: "#64748B", hide: r.OnHold, name: "On-Hold" }),
|
|
56480
|
+
/* @__PURE__ */ h.jsx(Zt, { dataKey: "InProgress", stackId: "a", fill: "#F59E0B", hide: r.InProgress, name: "In Progress" })
|
|
56481
56481
|
]
|
|
56482
56482
|
}
|
|
56483
56483
|
) }) }) })
|
package/dist/index.umd.js
CHANGED
|
@@ -391,4 +391,4 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
391
391
|
* See the LICENSE file in the root directory of this source tree.
|
|
392
392
|
*/const Cfe=Ui("waves-ladder",[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]]),Ot=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,rightContent:f,onCalendarClick:p,onPrevClick:m,onNextClick:g})=>{const v=s==="semi-bold"?600:500;return h.jsxs("div",{className:`relative bg-white p-[24px] !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[t&&h.jsx("div",{className:c,children:t}),h.jsx("div",{style:{fontWeight:v,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),h.jsxs("div",{className:"flex items-center gap-[12px]",children:[f&&f,n&&!r&&h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&h.jsxs("div",{className:"flex items-center gap-[12px] px-[16px] py-[8px] rounded-[8px] bg-white text-sm text-[#64748B]",children:[h.jsx(xfe,{size:16,className:"text-[#64748B] cursor-pointer",onClick:p}),h.jsx(kL,{size:16,className:"cursor-pointer",onClick:m}),h.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),h.jsx(PL,{size:16,className:"cursor-pointer",onClick:g})]})]})]}),h.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&h.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},kfe={completed:18,not_completed:6,missed:4};function Pfe({data:e={}}){const t=e&&Object.keys(e).length>0?e:kfe,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return h.jsx(Ot,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"flex flex-col items-center justify-center",children:[h.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(oi,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>h.jsx(Nn,{fill:o?.color??"#ccc"},`cell-${a}`))}),h.jsx(At,{content:h.jsx(Ta,{}),wrapperStyle:{zIndex:9999}})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),h.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>h.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[h.jsxs("div",{className:"flex items-center gap-[10px]",children:[h.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):h.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No patrol data"})})]})})}Fn.register(Lo,Ro,T1,A1,Dr,Xr);const Dfe=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],cm={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},Afe=[{key:"Guest",datasetIndex:0,color:"#EF4444"},{key:"Cab",datasetIndex:1,color:"#7C3AED"},{key:"Delivery",datasetIndex:2,color:"#10B981"},{key:"Service",datasetIndex:3,color:"#F59E0B"}],Tfe=({color:e,size:t=12})=>h.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",style:{display:"block",flexShrink:0},children:h.jsx("rect",{x:"1",y:"1",width:"10",height:"10",rx:"0",fill:e,transform:"rotate(45 6 6)"})}),Mfe=({chartRef:e})=>{const[t,n]=k.useState({}),r=i=>{const o=e.current;if(!o)return;const a=o.getDatasetMeta(i),s=!!a.hidden;a.hidden=!s,o.update(),n(l=>({...l,[i]:!s}))};return h.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"76px",marginTop:"10px",paddingBottom:"8px",flexWrap:"wrap"},children:Afe.map(({key:i,datasetIndex:o,color:a})=>{const s=!!t[o];return h.jsxs("div",{onClick:()=>r(o),style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",userSelect:"none",opacity:s?.45:1,transition:"opacity 0.2s ease"},children:[h.jsx(Tfe,{color:a,size:12}),h.jsx("span",{style:{fontSize:"13px",color:"#64748B",fontWeight:400,lineHeight:1,textDecoration:s?"line-through":"none",transition:"text-decoration 0.15s ease"},children:i})]},i)})})},Nfe=({data:e})=>{const t=k.useRef(null),r={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:Dfe,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:cm.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:cm.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:cm.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:cm.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{enabled:!1,external:ti({titleFormatter:o=>o.title?.[0]||"",hideTitleForSingle:!1})}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return h.jsxs(Re,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",children:[h.jsx("div",{style:{height:"calc(100% - 44px)",width:"100%"},children:h.jsx(I1,{ref:t,data:r,options:i})}),h.jsx(Mfe,{chartRef:t})]})},jfe={open:4,in_progress:7,closed:12},Ife=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function Lfe({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:jfe,r=Array.isArray(t)?t:Ife,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return h.jsx(Ot,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[h.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] h-[76px] rounded",children:[h.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),h.jsxs("div",{className:"flex-1 py-[12px] bg-[#FFFBF2] h-[76px] rounded",children:[h.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),h.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] h-[76px] rounded",children:[h.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[h.jsx("div",{className:"flex items-center gap-[8px]",children:h.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),h.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:h.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):h.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No incidents found"})})]})})}const Rfe=[{total_staff:42,absent_staff:6}],Ffe=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function $fe({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:Rfe,r=Array.isArray(t)&&t.length>0?t:Ffe,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return h.jsx(Ot,{title:"Staff Attendance",className:"h-[362px] overflow-hidden ",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex gap-[16px] text-center mt-[24px]",children:[h.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] rounded h-[76px]",children:[h.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),h.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),h.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] rounded h-[76px]",children:[h.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),h.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),h.jsx("div",{className:"mt-[24px] pb-[16px] space-y-[8px] overflow-y-auto max-h-[200px] hide-scrollbar",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#F8FAFC] rounded-md",children:[h.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),h.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):h.jsx(h.Fragment,{})})]})})}function Bfe(e){return Je({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function Wfe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=rc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return h.jsxs(Re,{title:e,icon:h.jsx("div",{className:"h-6 w-6 grid place-items-center",children:h.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[h.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),h.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[h.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),h.jsx("div",{className:"text-slate-500",children:r})]})]})}const zfe=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Dg,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Foe,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Bfe,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:n8,iconColor:"text-[#36AB6C]"}];function Vfe({data:e}){const t=Array.isArray(e)&&e.length>0?e:zfe;return h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>h.jsx(Wfe,{...n},r))})}const Hfe=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Yfe=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function Ufe({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Yfe(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Hfe;return h.jsx(Re,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:h.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>h.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),h.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),h.jsxs("div",{className:"flex flex-col items-end",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Kfe=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},qfe=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],Gfe=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return h.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[h.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),h.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},Xfe=({data:e})=>{const t=k.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:qfe).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=k.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return h.jsxs(Re,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[h.jsx(Et,{width:"100%",height:"85%",children:h.jsxs(Oo,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[h.jsx(rr,{strokeDasharray:"0",vertical:!1}),h.jsx(Kn,{dataKey:"level"}),h.jsx(Ln,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),h.jsx(At,{content:h.jsx(Ta,{titleFormatter:a=>a,hideTitleForSingle:!1,rowFormatter:({payload:a})=>a.map(s=>({color:s.color||s.fill||s.payload?.color||"",label:s.name||s.dataKey,value:Kfe(s.value??0)}))}),cursor:!1}),h.jsx(Ut,{dataKey:"open_count",name:"Open",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),h.jsx(Ut,{dataKey:"in_progress_count",name:"In Progress",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),h.jsx(Ut,{dataKey:"closed_count",name:"Closed",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),h.jsx(Gfe,{})]})},Qfe=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function Zfe({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):Qfe;return h.jsx(Re,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:h.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>h.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),h.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),h.jsxs("div",{className:"flex flex-col items-end",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function Jfe(e){return Je({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const epe=["open_complaints","pending_requests","avg_response_time","resolution_rate"],tpe={open_complaints:{title:"Open Complaints",Icon:eS,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:Jfe,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:d8,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:s8,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},npe=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>h.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),rpe={primary:{size:28,lineHeight:32,weight:500}},ipe={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function ope({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?h.jsx(DL,{id:e,data:t}):h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:epe.map(n=>h.jsx(DL,{id:n},n))})}function DL({id:e,data:t}){const n=tpe[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=rc,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:ipe[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,h.jsx("div",{className:"h-[132px]",children:h.jsxs(Re,{title:i,titleColor:a,icon:h.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:h.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[h.jsx(npe,{...rpe.primary,children:c}),h.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[h.jsx(vf,{value:u}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const ape=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function spe({title:e,date:t,rsvp:n,utilisation:r,status:i}){return h.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-[12px] mt-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),h.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-[8px] py-[4px] ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),h.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),h.jsxs("div",{className:"flex justify-between items-center mt-2",children:[h.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),h.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),h.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:h.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function lpe({data:e}){const t=Array.isArray(e)?e:ape;return h.jsx(Re,{title:"Events Utilisation",className:"w-full h-[360px] overflow-y-auto hide-scrollbar",children:h.jsx("div",{className:"m-auto",children:t?.length>0?t.map((n,r)=>h.jsx(spe,{...n},`${n.title}-${r}`)):h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(En,{})})})})}const cpe=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function upe({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return h.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} h-[124px]`,children:[h.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),h.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function dpe({data:e}){const t=Array.isArray(e)&&e.length>0?e:cpe;return h.jsx(Re,{title:"Notice Board Status",className:"w-full h-[360px]",children:h.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>h.jsx(upe,{...n},`${n.label}-${r}`))})})}function fpe(e){return Je({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function ppe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=rc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50",iconUrl:l}){return h.jsx(Re,{title:e,icon:h.jsx("div",{className:"grid place-items-center ",children:l?h.jsx("img",{src:l,alt:"icon",className:"h-8 w-8 object-contain"}):h.jsx(o,{className:`h-8 w-8 ${a}`})}),className:"h-[132px]",children:h.jsxs("div",{children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),h.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[h.jsx(vf,{value:n}),h.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function hpe({data:e}){const t=[{title:e?.title||"Total Bookings",value:e?.value??0,delta:e?.delta??"0%",deltaLabel:e?.deltaLabel||"Compared to last month",positive:e?.positive??!1,Icon:e?.Icon,iconUrl:e?.iconUrl,iconColor:e?.iconColor||"text-emerald-600",iconBg:e?.iconBg||"bg-emerald-50"}];return h.jsx("div",{className:"h-full",children:t.map((n,r)=>h.jsx(ppe,{...n},r))})}function mpe(e){return Je({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function gpe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=rc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return h.jsx(Re,{title:e,icon:h.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:h.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:h.jsxs("div",{children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),h.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[h.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),h.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const vpe=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:fpe,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:r8,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Loe,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:mpe,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function ype({data:e}){const t=Array.isArray(e)&&e.length>0?e:vpe;return h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>h.jsx(gpe,{...n},r))})}const AL=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return h.jsxs("div",{className:"flex flex-col items-start",children:[h.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:h.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),h.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},bpe=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return h.jsx("div",{children:h.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[h.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[h.jsx(Dg,{className:"!text-[20px] text-[#329DFF]"}),h.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"flex flex-col gap-[4px]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),h.jsxs("div",{className:"flex items-end gap-[4px]",children:[h.jsx(AL,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),h.jsx(AL,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};Fn.register(Lo,Ro,$l,Dr);const xpe=({data:e})=>{const t=e!=null,n=e?.employee_data,r=["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],i=[2e3,1700,1500,1200,900,800],o=[],a=[];if(t){if(n&&n.length>0)for(let d=0;d<n.length;d++)o.push(n[d].name),a.push(n[d].employees)}else for(let d=0;d<r.length;d++)o.push(r[d]),a.push(i[d]);let s=!1;if(t)if(!n||n.length===0)s=!0;else{s=!0;for(let d=0;d<n.length;d++)if(n[d].employees!==0){s=!1;break}}let l=0;for(let d=0;d<a.length;d++)a[d]>l&&(l=a[d]);const c={labels:o,datasets:[{data:a,backgroundColor:[],barThickness:34}]};for(let d=0;d<a.length;d++)c.datasets[0].backgroundColor.push("#3C81F6");const u={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:d=>`Employees: ${d.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:l>0?l+5:2e3,ticks:{stepSize:l>0?Math.ceil((l+5)/5):500,color:"#64748B",callback:d=>d},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return t&&s?h.jsx(Re,{className:"w-full h-[238px]",title:"Employee Footfall",period:"Today",icon:h.jsx(CL,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(En,{title:"No Employee footfall Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsxs(Re,{className:"w-full h-[238px]",title:"Employee Footfall",period:"Today",icon:h.jsx(CL,{className:"!text-[24px] text-[#8B5CF6]"}),children:[h.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),h.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:t?e.total_employees:7500})]}),h.jsx("div",{className:"h-[110px]",children:h.jsx(Bl,{data:c,options:u})})]})},wpe="Rs",TL=["bg-blue-500","bg-red-500","bg-purple-700"],bs={title:"Food & Beverages (Static Data)",period:"Today",summary:{totalOrders:247,revenueGenerated:"82K",growthPercentage:8,growthTotalPercentage:0},outlets:[{name:"HP",orders:120,revenue:"45K",percentage:70,color:"bg-[#3C81F6]"},{name:"Adobe",orders:85,revenue:"23K",percentage:50,color:"bg-[#3C81F6]"},{name:"Anarock",orders:42,revenue:"14K",percentage:25,color:"bg-[#3C81F6]"}]};function um(e,t=null){if(typeof e=="number")return e;if(typeof e=="string"){const n=Number(e.replace("%","").trim());return Number.isNaN(n)?t:n}return t}function ML(e){if(e==null||e==="")return"0";if(typeof e=="number")return iS(e);const t=Number(e);return Number.isNaN(t)?String(e):iS(t)}function _pe(e){const t=e?.food_beverage_summary?{title:e?.title,period:e?.period,summary:{totalOrders:e?.food_beverage_summary?.total_orders,revenueGenerated:e?.food_beverage_summary?.revenue_generated,growthPercentage:e?.food_beverage_summary?.growth_percentage??e?.food_beverage_summary?.revenue_growth,growthTotalPercentage:e?.food_beverage_summary?.order_growth,currencyType:e?.food_beverage_summary?.currency_type},outlets:e?.chart_data}:e||{},n=t?.summary||{},i=(Array.isArray(t?.outlets)?t.outlets:[]).map((f,p)=>({name:f?.name||f?.outlet_name||f?.tenant_name||f?.company_name||"Unknown",orders:f?.orders??f?.total_orders??f?.count??0,revenue:f?.revenue??f?.revenue_generated??f?.total_revenue??0,percentage:f?.percentage,color:f?.color||TL[p%TL.length]})),o=n?.totalOrders??n?.orders??bs.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??bs.summary.revenueGenerated,s=um(n?.growthPercentage??n?.revenueGrowth,bs.summary.growthPercentage),l=um(n?.growthTotalPercentage??n?.orderGrowth,bs.summary.growthTotalPercentage),c=n?.currencyType||n?.currency||wpe,u=i.reduce((f,p)=>f+(Number(p?.orders)||0),0),d=i.map(f=>({...f,percentage:f?.percentage!==null&&f?.percentage!==void 0?Number(f.percentage)||0:u>0?Math.round((Number(f?.orders)||0)/u*100):0}));return{title:t?.title||bs.title,period:t?.period||bs.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,growthTotalPercentage:l,currencyType:c},outlets:d.length>0?d:bs.outlets}}function Epe({data:e,title:t,period:n,icon:r}){const i=_pe(e),o=t||i.title,a=n||i.period,s=r||h.jsx(Ofe,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=ML(i.summary.revenueGenerated),u=um(i.summary.growthPercentage,0),d=um(i.summary.growthTotalPercentage,0),f=u>=0,p=d>=0;return h.jsx(Re,{className:"h-[324px]",title:o,period:a,icon:s,children:h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex gap-[24px]",children:[h.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l}),h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?h.jsx(Aa,{}):h.jsx(Da,{}),d,"%",h.jsx("span",{children:"from last month"})]})]}),h.jsxs("div",{className:"w-[30%] flex flex-col gap-[8px] ",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),h.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[i.summary.currencyType," ",c]}),h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] whitespace-nowrap ${f?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[f?h.jsx(Aa,{}):h.jsx(Da,{}),u,"%",h.jsx("span",{children:"from last month"})]})]})]}),h.jsx("div",{className:"mt-[16px]",children:i.outlets.map((m,g)=>h.jsxs("div",{className:g===i.outlets.length-1?"":"mb-[16px]",children:[h.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:m.name}),h.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[h.jsxs("div",{className:"text-[#64748B] inline-block",children:[m.orders," orders"]}),h.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",ML(m.revenue)]})]})]}),h.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:h.jsx("div",{className:`h-[11px] rounded-full ${m.color}`,style:{width:`${m.percentage}%`}})})]},`${m.name}-${g}`))})]})})}function Spe({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"Rs"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(m=>({facility_name:m?.facility_name,total_bookings:m?.total_bookings??0,paid_revenue:m?.paid_revenue??"0",isPaid:m?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(m=>({...m,isPaid:m?.isPaid===!0})),o=i.length>0&&i.every(m=>m?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const m=s.replace("%","").trim(),g=Number(m);l=isNaN(g)?0:g}const c=i.reduce((m,g)=>{const v=g?.total_bookings||0;return m+v},0),u=i.map(m=>{const g=m?.total_bookings||0,v=m?.isPaid?`${n?.currencyType||"Rs"} ${m?.paid_revenue||"0.00"}`:"",x=c>0?Math.round(g/c*100):0;return{name:m?.facility_name||"Unknown",bookings:g,revenue:v,percentage:x,color:"bg-[#3C81F6]",isPaid:m?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const m=d.replace("%","").trim(),g=Number(m);f=isNaN(g)?null:g}const p=f!==null?f>=0:!0;return h.jsx(Re,{className:"h-[324px]",title:"Amenities",period:"Today",icon:h.jsx(Cfe,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex gap-[24px]",children:[h.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?h.jsx(Aa,{}):h.jsx(Da,{}),l,"%",h.jsx("span",{children:"from last month"})]})]}),!o&&h.jsxs("div",{className:"w-[30%] flex flex-col gap-[8px] ",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),h.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[n?.currencyType||"Rs"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] whitespace-nowrap ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?h.jsx(Aa,{}):h.jsx(Da,{}),f,"%",h.jsx("span",{children:"from last month"})]})]})]}),h.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((m,g)=>h.jsxs("div",{className:g===u.length-1?"":"mb-[16px]",children:[h.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:m?.name}),h.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[h.jsxs("div",{className:"text-[#64748B] inline",children:[m?.bookings," ",m?.bookings<=1?"booking":"bookings"]}),m?.isPaid&&h.jsx("div",{className:"mx-2 text-[#121212] inline",children:m?.revenue})]})]}),h.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:h.jsx("div",{className:`h-[11px] rounded-full ${m?.color}`,style:{width:`${m?.percentage}%`}})})]},g)):h.jsx("div",{className:"flex items-center justify-center h-[120px]",children:h.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Fn.register(Lo,Ro,$l,Dr,Xr);function Ope({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Cancelled",data:s,backgroundColor:"#FB2C36",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!1,pointStyle:"rect",padding:12,boxWidth:20,boxHeight:8,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return h.jsx(Re,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:h.jsx(l8,{className:"!text-[24px] text-[#3C81F6]"}),children:h.jsx("div",{className:"h-full",children:h.jsx(Bl,{data:l,options:c})})})}const Cpe=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return h.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:h.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[h.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),h.jsx("div",{children:n.name}),h.jsx("div",{className:"ml-2",children:n.value})]})})};function kpe({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return h.jsx(Re,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:h.jsx(kg,{className:"!text-[24px] text-[#EF4444]"}),children:h.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[h.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(oi,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>h.jsx(Nn,{fill:a.color},s))}),h.jsx(At,{content:a=>h.jsx(sr,{...a,data:i,children:h.jsx(Cpe,{...a})})})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[h.jsx("div",{children:r(n.completed)}),h.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),h.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>h.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const NL={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function Ppe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function Dpe(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function Ape(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>Dpe(i?.hour)===n)||{};return{hour:n,time:Ppe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function jL({title:e,color:t,rows:n=[],children:r}){const i=h.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px] border-[0.5px] border-[#EBEBEB] shadow-[0px_0px_12px_0px_#EAF2FF]",children:[h.jsx("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:h.jsx("div",{children:e??""})}),h.jsx("div",{className:"mt-[16px] pt-[16px] border-t border-dashed border-[#EBEBEB] space-y-[16px]",children:n?.map(({label:o,value:a,valueColor:s})=>h.jsxs("div",{className:"flex justify-between text-[14px] leading-[18px]",children:[h.jsx("div",{className:"text-[#64748B]",children:o??""}),h.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return h.jsx(mj,{placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,maxWidth:"none",render:o=>h.jsx("div",{tabIndex:"-1",...o,children:i}),children:r})}function Tpe({active:e,payload:t}){return!e||!t?.length?null:h.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),h.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),h.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function Mpe({data:e}){const t=e&&Object.keys(e).length?e:NL,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=k.useMemo(()=>{const l=t?.chart_data??[];return Ape(l.length?l:NL.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=k.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return h.jsx(Re,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:h.jsx(Cg,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsxs("div",{className:"flex flex-col gap-[24px]",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6",children:[h.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),h.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),h.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),h.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),h.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),h.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[h.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),h.jsx(jL,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:h.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),h.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),h.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[h.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),h.jsx(jL,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:h.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),h.jsx("div",{className:"w-full h-[149px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(tx,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[h.jsx(rr,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),h.jsx(Kn,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),h.jsx(Ln,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),h.jsx(At,{content:l=>h.jsx(sr,{...l,data:i,children:h.jsx(Tpe,{...l})})}),h.jsx(sa,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),h.jsx(sa,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}function Npe({data:e=null}){const t={total_entries:79.6,entries:59350,exit:40950},n=e&&Object.keys(e).length>0?e:t,r=c=>{const u=Number(c);return isNaN(u)?0:u},i=r(n.entries),o=r(n.exit),a=e&&Object.keys(e).length>0&&Number(e.entries)===0&&Number(e.exit)===0,s=[{name:"Entries",value:i,color:"#8B5CF6"},{name:"Exit",value:o,color:"#329DFF"}],l=r(n.total_entries);return h.jsx(Ot,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:a?h.jsx("div",{className:"h-[300px] flex items-center justify-center",children:h.jsx(En,{title:"No access Point Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[h.jsxs("div",{className:"relative w-[212px] h-[212px]",children:[h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),h.jsx("div",{className:"h-[212px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(oi,{data:s,dataKey:"value",innerRadius:65,outerRadius:100,startAngle:360,endAngle:-180,paddingAngle:1,stroke:"transparent",children:s.map((c,u)=>h.jsx(Nn,{fill:c.color},u))}),h.jsx(At,{content:c=>h.jsx(sr,{...c,data:s,children:h.jsx(ni,{...c})})})]})})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[22px] leading-[27px] font-medium text-[#121212]",children:l}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B]",children:"Total Access"})]})]}),h.jsxs("div",{className:"mt-[28px] flex justify-between w-full px-[20px]",children:[h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("div",{className:"w-[14px] h-[6px] bg-[#8B5CF6]"}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Entries"})]}),h.jsx("div",{className:"text-[18px] font-medium text-[#8B5CF6] mt-[4px]",children:i.toLocaleString()})]}),h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("div",{className:"w-[14px] h-[6px] bg-[#329DFF]"}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Exit"})]}),h.jsx("div",{className:"text-[18px] font-medium text-[#329DFF] mt-[4px]",children:o.toLocaleString()})]})]})]})})}function IL({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return h.jsx(Ot,{className:n,title:e,titleWeight:"semi-bold",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[h.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[h.jsx("div",{children:"Point"}),h.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),h.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function jpe({data:e=[]}){const[t,n]=k.useState([]),r=e&&e.length?e:[],i=!e||e.length===0,o=e&&e.length>0&&e.every(c=>Number(c.entries)===0&&Number(c.exit)===0),a=i||o,s=c=>c>=1e3?`${c/1e3}K`:c,l=c=>{n(u=>u.includes(c)?u.filter(d=>d!==c):[...u,c])};return h.jsx(Ot,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:a?h.jsx("div",{className:"h-[270px] flex items-center justify-center",children:h.jsx(En,{title:"No access Point Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:r,barSize:54,margin:{top:0,right:0,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"8 8",vertical:!1}),h.jsx(F0,{y:0,stroke:"#EBEBEB"}),h.jsx(Kn,{dataKey:"block_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),h.jsx(Ln,{tickFormatter:s,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),h.jsx(At,{cursor:!1,content:c=>h.jsx(sr,{...c,data:r,children:(()=>{if(!c.active||!c.label)return null;const u=r.find(d=>d.block_name===c.label);return h.jsxs("div",{className:"bg-[#111] text-white px-[14px] py-[8px] rounded-[6px] flex flex-col gap-[6px] text-[13px]",children:[h.jsx("div",{className:"font-semibold",children:c.label}),!t.includes("entries")&&h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#329DFF]"}),h.jsx("div",{className:"text-[#aaa]",children:"Entries"}),h.jsx("div",{className:"font-bold",children:u?.entries??0})]}),!t.includes("exit")&&h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#76BDFF]"}),h.jsx("div",{className:"text-[#aaa]",children:"Exit"}),h.jsx("div",{className:"font-bold",children:u?.exit??0})]})]})})()})}),h.jsx(Gs,{verticalAlign:"bottom",height:36,content:()=>{const c=[{key:"entries",label:"Entries",color:"#329DFF"},{key:"exit",label:"Exit",color:"#76BDFF"}];return h.jsx("div",{style:{display:"flex",gap:"20px",justifyContent:"center",marginTop:"20px"},children:c.map((u,d)=>{const f=t.includes(u.key);return h.jsxs("div",{onClick:()=>l(u.key),style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",opacity:f?.4:1},children:[h.jsx("div",{style:{width:"20px",height:"8px",backgroundColor:u.color}}),h.jsx("div",{style:{fontSize:"12px",color:"#64748B"},children:u.label})]},d)})})}}),h.jsx(Ut,{dataKey:"entries",stackId:"a",fill:"#329DFF",hide:t.includes("entries")}),h.jsx(Ut,{dataKey:"exit",stackId:"a",fill:"#76BDFF",hide:t.includes("exit")})]})})})})}Fn.register(im,Dr,Xr);const Ipe={id:"bottomGlow",afterDatasetsDraw(e,t,n){if(!n?.enabled)return;const r=e.getDatasetMeta(0);if(!r?.data?.[0])return;const{ctx:i}=e,{x:o,y:a,innerRadius:s}=r.data[0],l=Math.max(s-2,0),c=a+l*.9,u=i.createRadialGradient(o,c,0,o,c,l*1.08);u.addColorStop(0,n.color??"rgba(186, 230, 253, 0.72)"),u.addColorStop(.3,"rgba(186, 230, 253, 0.4)"),u.addColorStop(.58,"rgba(186, 230, 253, 0.16)"),u.addColorStop(1,"rgba(186, 230, 253, 0)"),i.save(),i.beginPath(),i.arc(o,a,l,0,Math.PI*2),i.clip(),i.fillStyle=u,i.beginPath(),i.ellipse(o,c,l*1.08,l*.52,0,0,Math.PI*2),i.fill(),i.restore()}},Lpe={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=24,bottomSize:u=9,topColor:d="#121212",bottomColor:f="#121212"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-6),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+22),r.restore()}},Rpe=({title:e="Tickets",icon:t,firstLabel:n="First",firstValue:r=0,firstColor:i="#12B981",secondLabel:o="Second",secondValue:a=0,secondColor:s="#AB0000",growthPercentage:l="+0%",growthText:c="Compared to last month",totalLabel:u="Total",centerTopColor:d="#0F172A",centerBottomColor:f="#64748B",centerTopSize:p,centerBottomSize:m,showBottomGlow:g=!1,bottomGlowColor:v="rgba(186, 230, 253, 0.75)",widgetType:x="",resolvedWidgetType:_="",data:w})=>{const y=w?.title??e;w?.icon;const E=w?.firstLabel??n,S=Number(w?.firstValue??r??0),P=w?.firstColor??i,D=w?.secondLabel??o,T=Number(w?.secondValue??a??0),I=w?.secondColor??s,A=w?.growthPercentage??l??"+0%",C=w?.growthText??c,N=w?.totalLabel??u,M=w?.widgetType??x??_,j=w?.centerTopSize??p??(M==="commercial"?34:20),F=w?.centerBottomSize??m??(M==="commercial"?14:10),B=w?.showBottomGlow??g,V=w?.bottomGlowColor??v,z=S+T,W={labels:[E,D],datasets:[{data:[S,T],backgroundColor:[P,I],borderWidth:2,hoverOffset:4}]},Q={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{enabled:!1,external:ti()},centerText:{top:`${z}`,bottom:N,topSize:j,bottomSize:F,topColor:d,bottomColor:f},bottomGlow:{enabled:B,color:V}}},G=[{label:E,value:S,color:P},{label:D,value:T,color:I}],oe=A.toString().includes("+"),Z=A.toString().includes("-"),re=oe?"#1FA05B":"#AB0000";return h.jsx(Ot,{title:y,className:"h-[362px] leading-[24px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[h.jsxs("div",{className:"col-span-5 space-y-[12px]",children:[G.map((ie,ce)=>h.jsxs("div",{children:[h.jsx("div",{className:"text-[12px] text-[#64748B] mb-[8px]",children:ie.label}),h.jsx("div",{className:"text-[28px] leading-[32px]",style:{color:ie.color},children:ie.value})]},ce)),h.jsxs("div",{className:`text-[12px] flex gap-[4px] ${M==="commercial"?"mt-[20px]":""} items-center`,style:{color:re},children:[oe&&h.jsx(Aa,{}),Z&&h.jsx(Da,{}),h.jsx("div",{children:A.replace("+","").replace("-","")}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[14px] ml-[4px] whitespace-nowrap",children:C})]})]}),h.jsx("div",{className:"col-span-7",children:h.jsx("div",{className:`${M==="commercial"?"h-[260px] max-w-[263px]":"h-[158px] w-[158px]"} ml-auto mr-2`,children:h.jsx(lm,{data:W,options:Q,plugins:[Ipe,Lpe]})})})]})})},Fpe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return h.jsx("g",{transform:`translate(${e},${t})`,children:h.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>h.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function $pe({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints,color:"#08B6D4"}));return h.jsx(Ot,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full mt-[24px]!",children:t?h.jsx("div",{className:"w-full h-[262px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),h.jsx(Kn,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,tickMargin:10,allowDecimals:!1}),h.jsx(Ln,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:132,tick:h.jsx(Fpe,{})}),h.jsx(At,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(sr,{...r,data:n,children:h.jsx(ni,{...r})}):null}),h.jsx(Ut,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):h.jsx(En,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function Bpe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return h.jsxs("div",{className:"relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&h.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:h.jsx(e,{className:"h-[20px] w-[20px]"})}),h.jsx("div",{className:"text-[16px] leading-[20px] tracking-[-2%] font-medium text-[#64748B]",children:n})]}),h.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&h.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&h.jsxs("div",{className:"flex items-center gap-[4px] text-[10px] leading-[14px] font-medium",style:{color:l},children:[s?h.jsx(Aa,{}):h.jsx(Da,{}),Math.abs(a),"%"]}),o&&h.jsx("div",{className:"text-[10px] leading-[14px] text-[#64748B]",children:o})]})]})}const Wpe=({data:e=[],onDateChange:t})=>{const[n,r]=k.useState(new Date),[i,o]=k.useState(!1),s=(v=>{const x=new Date(v);return x.setDate(x.getDate()-6),x})(n),l=v=>{try{return v.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=v=>{const x=new Date(v),_=new Date(x);_.setDate(_.getDate()-6),t&&t(_.toISOString(),x.toISOString())},u=()=>{const v=new Date(n);v.setDate(v.getDate()-7),r(v),c(v)},d=()=>{const v=new Date(n);v.setDate(v.getDate()+7),r(v),c(v)},f=()=>{o(v=>!v)},p=v=>{const x=v||new Date;r(x),c(x),o(!1)},m=Array.isArray(e)?e:[],g=!m.length||m.every(v=>v.no_of_visitors===0);return h.jsxs(Ot,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&h.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50",children:h.jsx(KE,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),g?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(En,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(iM,{data:m,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Kn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:v=>new Date(v).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),h.jsx(Ln,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(At,{cursor:!1,content:v=>{const{active:x,payload:_,label:w}=v;if(!x||!_?.length)return null;const y=new Date(w).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return h.jsx(sr,{...v,data:m,children:h.jsx(ni,{active:x,payload:_,label:y})})}}),h.jsx(H0,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:v=>{const{cx:x,cy:_,stroke:w}=v;return h.jsxs("g",{children:[h.jsx("circle",{cx:x,cy:_,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:x,cy:_,r:2.5,fill:"#6466F1"})]})}})]})})})]})},zpe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],Vpe=({data:e,title:t,bar:n})=>{const r=Array.isArray(e)&&e?.length===0,i=e==null?zpe:Array.isArray(e)?e:[];return h.jsx(Ot,{title:t||"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:r?h.jsx(En,{title:t||"Organisation Wise Visitors",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:i||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Kn,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),h.jsx(Ln,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(At,{cursor:!1,content:o=>o.active?h.jsx(sr,{...o,data:i,children:h.jsx(ni,{...o})}):null}),h.jsx(Ut,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:n||"#3C81F6"})]})})})})};function Hpe({data:e}){return h.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return h.jsx(Re,{iconClassName:"!gap-[8px]",title:h.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:h.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:`${t?.widget==="amenities"?"h-[139px]":"h-[124px]"}`,children:h.jsxs("div",{className:`flex flex-col gap-[8px] ${t?.widget==="amenities"?"mt-[3.5px]":"mt-0"}`,children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),h.jsxs("div",{className:`flex items-center text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&h.jsxs("div",{className:`flex items-center gap-[4px] px-[6px] py-[2px] rounded-[4px] font-medium
|
|
393
393
|
${i?"text-[#1FA05B] bg-[#F7FEFA]":"text-[#E11D48] bg-[#FBF4F4]"}
|
|
394
|
-
`,children:[i?h.jsx(Aa,{}):h.jsx(Da,{}),Math.abs(r),"%"]}),h.jsx("div",{className:t.deltaColor?`text-[${t.deltaColor}] font-[600]`:"text-[#64748B]",children:t.deltaLabel})]})]})},n)})})}const Ype=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],Upe=({x:e,y:t,payload:n})=>h.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:h.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function Kpe({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?Ype:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return h.jsx(Re,{title:"Bookings",icon:h.jsx(Sfe,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:n?h.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[h.jsx(Kn,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),h.jsx(Ln,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:h.jsx(Upe,{})}),h.jsx(At,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?h.jsx(sr,{...o,data:i,children:h.jsx(ni,{...o})}):null}),h.jsx(Ut,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const qpe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function Gpe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?qpe:Array.isArray(e)?e:[];return h.jsx(Ot,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?h.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),h.jsx(Kn,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),h.jsx(Ln,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),h.jsx(At,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(sr,{...r,data:n,children:h.jsx(ni,{...r})}):null}),h.jsx(Ut,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const Xpe=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],dm=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function Qpe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??Xpe,i=Array?.isArray(r)&&r?.length>0?r?.map(l=>({name:l?.facility_name||"Unknown",value:Number(l?.paid_revenue)||0})):[],a=(i?.length>0?i?.every(l=>l?.value===0):!1)?i?.map((l,c)=>({...l,value:c===0?1:0})):i,s=l=>`${t||"Rs"} ${l?.toLocaleString?.("en-IN")||0}`;return h.jsx(Ot,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?h.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:h.jsx(En,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(oi,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>h.jsx(Nn,{fill:dm?.[c%dm?.length]},`cell-${c}`))}),h.jsx(At,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?h.jsx(sr,{...l,data:a,children:h.jsx(ni,{...l,formatter:c=>s(c)})}):null})]})})}),h.jsx("div",{className:"col-span-6",children:h.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Amenity"}),h.jsx("div",{className:"text-right",children:"Revenue"})]}),h.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>h.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[h.jsxs("div",{className:"flex items-center gap-[12px]",children:[h.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:dm?.[c%dm?.length]}}),h.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),h.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const fm=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Zpe=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],Jpe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:fm[o%fm.length]})):Zpe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:fm[o%fm.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(Ot,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Ot,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(oi,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,isAnimationActive:!1,children:n.map((i,o)=>h.jsx(Nn,{fill:i.fill},o))}),h.jsx(At,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(sr,{...i,data:n,children:h.jsx(ni,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>h.jsxs("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar flex items-center justify-between px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},ehe=({data:e,title:t})=>{const[n,r]=k.useState({}),i=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],o=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:i,[e]),a=s=>{const{dataKey:l}=s;r(c=>({...c,[l]:!c[l]}))};return Array.isArray(e)&&e.length===0?h.jsx(Ot,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Ot,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Kn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(At,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:s=>!s.active||!s.payload||!s.payload.length?null:h.jsx(sr,{...s,data:o,children:h.jsxs("div",{className:"bg-black rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:s.label}),s.payload.map((l,c)=>{const u=l.color||l.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:u}}),h.jsx("span",{className:"text-[#D1D3D4]",children:l.name}),h.jsx("span",{className:"text-white font-semibold",children:l.value})]},c)})]})})}),h.jsx(Gs,{verticalAlign:"bottom",align:"center",onClick:a,content:({payload:s})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:s.map((l,c)=>h.jsxs("div",{onClick:()=>a({dataKey:l.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[l.dataKey]?"#CBD5E1":l.color}}),h.jsx("span",{style:{fontSize:"12px",color:n[l.dataKey]?"#CBD5E1":"#64748B"},children:l.value})]},c))})}),h.jsx(Ut,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(Ut,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),h.jsx(Ut,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(Ut,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(Ut,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function the({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return h.jsx(Ot,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"flex flex-col items-center justify-center",children:[h.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(oi,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>h.jsx(Nn,{fill:i.color},`cell-${o}`))}),h.jsx(At,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(sr,{...i,data:t,children:h.jsx(ni,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),h.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>h.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[h.jsxs("div",{className:"flex items-center gap-[10px]",children:[h.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function nhe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return h.jsx(Ot,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.escalation_level==="Danger"?"text-[#AB0000]":o?.escalation_level==="High"?"text-[#E7A015]":"text-[#1FA05B]";return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[h.jsx("div",{className:"flex items-center gap-[8px]",children:h.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_reporting_id})}),h.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:h.jsxs("div",{children:[o?.escalation_value," - ",o?.escalation_level]})})]},a)}):h.jsx(h.Fragment,{})})]})})}function rhe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,m=a===0&&c.length===0,g=`repeat(${u.length}, 1fr)`;return h.jsxs("div",{className:"w-full bg-white rounded-[12px] h-[390px] !border-[0.5px] !border-[#EBEBEB] !shadow-[0_0_12px_0_#EAF2FF] overflow-hidden flex flex-col",children:[h.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:g},children:u.map((v,x)=>h.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},x))}),h.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:m?h.jsx(En,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):p.map((v,x)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:g},children:u.map((_,w)=>{const y=v[_.key],E=_.label==="Closed",S=_.label==="Open",P=typeof y=="string"&&y.includes("%"),D=y==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return h.jsx("div",{className:`px-[24px] py-[16px] flex items-center justify-start ${w===0?"bg-white":"bg-gray-50"} text-[#121212]`,children:E?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:y??"-"}):S?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:y??"-"}):P?h.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:y}):h.jsx("div",{children:y??"-"})},w)})},x))})]}),h.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px] shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,x)=>h.jsx("option",{value:v,children:v},x))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(_fe,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(kL,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(PL,{size:18})}),h.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(Efe,{size:18})})]})]})]})}const LL=({options:e=[],value:t,onChange:n})=>{const[r,i]=k.useState(!1),o=k.useRef(null);return k.useEffect(()=>{const a=s=>{o.current&&!o.current.contains(s.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]),h.jsxs("div",{ref:o,className:"relative h-[32px]",children:[h.jsxs("div",{className:"flex items-center justify-between gap-[10px] px-[12px] py-[8px] border border-[#E2E8F0] rounded-[4px] cursor-pointer min-w-[140px]",onClick:()=>i(!r),children:[h.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),h.jsx(wfe,{size:16,className:"text-[#64748B]"})]}),r&&h.jsx("div",{className:"absolute top-[110%] left-0 w-full bg-white border border-[#E2E8F0] rounded-[8px] shadow-md z-10",children:e.map((a,s)=>h.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},ihe=({data:e,communities:t})=>{const[n,r]=k.useState({}),[i,o]=k.useState(""),a=t?t.map(u=>u.community_name):[];k.useEffect(()=>{a.length>0&&!i&&o(a[0])},[a,i]);const s=[{community_name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{community_name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{community_name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],l=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:s,[e]),c=u=>{const{dataKey:d}=u;r(f=>({...f,[d]:!f[d]}))};return Array.isArray(e)&&e.length===0?h.jsx(Ot,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Ot,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:h.jsx(LL,{options:a,value:i,onChange:u=>o(u)}),children:h.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[261px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:l,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Kn,{dataKey:"community_name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(At,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:u,payload:d,label:f})=>!u||!d||!d.length?null:h.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[h.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:f}),d.map((p,m)=>{const g=p.color||p.fill||"#fff";return h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[h.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:g,display:"inline-block"}}),h.jsx("span",{style:{color:"#D1D3D4"},children:p.name}),h.jsx("span",{style:{color:"#fff",fontWeight:600},children:p.value})]},m)})]})}),h.jsx(Gs,{verticalAlign:"bottom",align:"center",onClick:c,content:({payload:u})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:u.map((d,f)=>h.jsxs("div",{onClick:()=>c({dataKey:d.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[d.dataKey]?"#CBD5E1":d.color}}),h.jsx("span",{style:{fontSize:"12px",color:n[d.dataKey]?"#CBD5E1":"#64748B"},children:d.value})]},f))})}),h.jsx(Ut,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(Ut,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(Ut,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(Ut,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})},ohe=({data:e=[]})=>{const[t,n]=k.useState("Kosmo One"),r=["Kosmo One","Kosmo Two","Kosmo Three"],i=Array.isArray(e)?e:[],o=!i.length||i.every(a=>a.no_of_visitors===0);return h.jsx(Ot,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:h.jsx(LL,{options:r,value:t,onChange:a=>n(a)}),children:o?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(En,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(iM,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Kn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),h.jsx(Ln,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(At,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return h.jsx(ni,{active:a,payload:s,label:u})}}),h.jsx(H0,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return h.jsxs("g",{children:[h.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},ahe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return h.jsx(Ot,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children:h.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[h.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Tenant"}),h.jsx("div",{className:"flex justify-end",children:"Total"}),h.jsx("div",{className:"flex justify-end",children:"Pending"}),h.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),h.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((r,i)=>h.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[h.jsx("div",{className:"text-[#475569]",children:r.name}),h.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),h.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),h.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},pm=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],she=[{asset_group_name:"Lifts",asset_count:3,investment:"₹ 45L"},{asset_group_name:"Fire Systems",asset_count:16,investment:"₹ 28L"},{asset_group_name:"Generators",asset_count:16,investment:"₹ 95L"},{asset_group_name:"HVAC",asset_count:24,investment:"₹ 1.2Cr"},{asset_group_name:"Others",asset_count:97,investment:"₹ 52L"}],lhe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:pm[o%pm.length]})):she.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:pm[o%pm.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(Ot,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Ot,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Et,{width:"100%",height:"100%",children:h.jsx(Ii,{children:h.jsx(oi,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>h.jsx(Nn,{fill:i.color},o))})})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),h.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};ue.AccessPointsUsage=jpe,ue.Accounting=qde,ue.Amenities=Spe,ue.AmenitiesStatsCard=Hpe,ue.AmenityWiseRevenue=Qpe,ue.AssetValueBreakdown=sfe,ue.AssetsByType=Jpe,ue.BlockWiseOccupancy=$de,ue.BookingTrendChart=Gpe,ue.Bookings=Kpe,ue.Budgets=Jde,ue.BuildingWiseApprovals=ahe,ue.Card=Re,ue.CardAccess=IL,ue.CashBankBalance=tfe,ue.CommercialAccessOverview=Npe,ue.CommercialGuardPatrols=the,ue.CommercialIncidentReports=nhe,ue.CommercialOccupancy=bpe,ue.CommercialReportTable=rhe,ue.Community=$oe,ue.Complaints=Ufe,ue.ComplaintsByLevel=Xfe,ue.DuesAgeing=rfe,ue.EmployeeFootfall=xpe,ue.Engagement=_ae,ue.EngagementStatsGrid=ype,ue.EscalationLevel=ihe,ue.EventsUtilisation=lpe,ue.ExpenseCategories=ofe,ue.Facilities=Eae,ue.FinanceSummary=Sae,ue.FoodBeverages=Epe,ue.GateAndSecurityStatsGrid=Vfe,ue.GateUpdates=dse,ue.GuardPatrols=Pfe,ue.Header=K3,ue.Helpdesk=fse,ue.HelpdeskStatsGrid=ope,ue.HourlyTrafficFlow=Nfe,ue.IncidentReports=Lfe,ue.IncomeExpenditure=_L,ue.MainHeader=a8,ue.MaintenanceStatus=ehe,ue.MetricCard=Bpe,ue.MobileAccess=IL,ue.MoveInOutTrends=zde,ue.NoticeBoardStatus=dpe,ue.OccupancyOverview=Lde,ue.OrganisationWiseVisitors=Vpe,ue.PortfolioAssetsByType=lhe,ue.RequestBox=Zfe,ue.ResidentOverview=Rde,ue.RevenuebyCategory=cfe,ue.SingleStats=hpe,ue.StaffAttendance=$fe,ue.StatsGrid=hfe,ue.TenantsByVisitors=ohe,ue.TicketEscalation=Ope,ue.TicketStatus=kpe,ue.Tickets=Rpe,ue.TicketsperCategory=$pe,ue.UnitStatus=Ide,ue.VisitorUpdates=Mpe,ue.WeeklyVisitorPattern=Wpe,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})}));
|
|
394
|
+
`,children:[i?h.jsx(Aa,{}):h.jsx(Da,{}),Math.abs(r),"%"]}),h.jsx("div",{className:t.deltaColor?`text-[${t.deltaColor}] font-[600]`:"text-[#64748B]",children:t.deltaLabel})]})]})},n)})})}const Ype=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],Upe=({x:e,y:t,payload:n})=>h.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:h.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function Kpe({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?Ype:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return h.jsx(Re,{title:"Bookings",icon:h.jsx(Sfe,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:n?h.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[h.jsx(Kn,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),h.jsx(Ln,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:h.jsx(Upe,{})}),h.jsx(At,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?h.jsx(sr,{...o,data:i,children:h.jsx(ni,{...o})}):null}),h.jsx(Ut,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const qpe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function Gpe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?qpe:Array.isArray(e)?e:[];return h.jsx(Ot,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?h.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),h.jsx(Kn,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),h.jsx(Ln,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),h.jsx(At,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(sr,{...r,data:n,children:h.jsx(ni,{...r})}):null}),h.jsx(Ut,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const Xpe=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],dm=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function Qpe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??Xpe,i=Array?.isArray(r)&&r?.length>0?r?.map(l=>({name:l?.facility_name||"Unknown",value:Number(l?.paid_revenue)||0})):[],a=(i?.length>0?i?.every(l=>l?.value===0):!1)?i?.map((l,c)=>({...l,value:c===0?1:0})):i,s=l=>`${t||"Rs"} ${l?.toLocaleString?.("en-IN")||0}`;return h.jsx(Ot,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?h.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:h.jsx(En,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(oi,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>h.jsx(Nn,{fill:dm?.[c%dm?.length]},`cell-${c}`))}),h.jsx(At,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?h.jsx(sr,{...l,data:a,children:h.jsx(ni,{...l,formatter:c=>s(c)})}):null})]})})}),h.jsx("div",{className:"col-span-6",children:h.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Amenity"}),h.jsx("div",{className:"text-right",children:"Revenue"})]}),h.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>h.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[h.jsxs("div",{className:"flex items-center gap-[12px]",children:[h.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:dm?.[c%dm?.length]}}),h.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),h.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const fm=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Zpe=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],Jpe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:fm[o%fm.length]})):Zpe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:fm[o%fm.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(Ot,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Ot,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(oi,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,isAnimationActive:!1,children:n.map((i,o)=>h.jsx(Nn,{fill:i.fill},o))}),h.jsx(At,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(sr,{...i,data:n,children:h.jsx(ni,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>h.jsxs("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar flex items-center justify-between px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},ehe=({data:e,title:t})=>{const[n,r]=k.useState({}),i=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],o=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:i,[e]),a=s=>{const{dataKey:l}=s;r(c=>({...c,[l]:!c[l]}))};return Array.isArray(e)&&e.length===0?h.jsx(Ot,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Ot,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Kn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(At,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:s=>!s.active||!s.payload||!s.payload.length?null:h.jsx(sr,{...s,data:o,children:h.jsxs("div",{className:"bg-black rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:s.label}),s.payload.map((l,c)=>{const u=l.color||l.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:u}}),h.jsx("span",{className:"text-[#D1D3D4]",children:l.name}),h.jsx("span",{className:"text-white font-semibold",children:l.value})]},c)})]})})}),h.jsx(Gs,{verticalAlign:"bottom",align:"center",onClick:a,content:({payload:s})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:s.map((l,c)=>h.jsxs("div",{onClick:()=>a({dataKey:l.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[l.dataKey]?"#CBD5E1":l.color}}),h.jsx("span",{style:{fontSize:"12px",color:n[l.dataKey]?"#CBD5E1":"#64748B"},children:l.value})]},c))})}),h.jsx(Ut,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(Ut,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),h.jsx(Ut,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(Ut,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(Ut,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function the({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return h.jsx(Ot,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"flex flex-col items-center justify-center",children:[h.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(oi,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>h.jsx(Nn,{fill:i.color},`cell-${o}`))}),h.jsx(At,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(sr,{...i,data:t,children:h.jsx(ni,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),h.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>h.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[h.jsxs("div",{className:"flex items-center gap-[10px]",children:[h.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function nhe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return h.jsx(Ot,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.escalation_level==="Danger"?"text-[#AB0000]":o?.escalation_level==="High"?"text-[#E7A015]":"text-[#1FA05B]";return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[h.jsx("div",{className:"flex items-center gap-[8px]",children:h.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_reporting_id})}),h.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:h.jsxs("div",{children:[o?.escalation_value," - ",o?.escalation_level]})})]},a)}):h.jsx(h.Fragment,{})})]})})}function rhe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,m=a===0&&c.length===0,g=`repeat(${u.length}, 1fr)`;return h.jsxs("div",{className:"w-full bg-white rounded-[12px] h-[390px] !border-[0.5px] !border-[#EBEBEB] !shadow-[0_0_12px_0_#EAF2FF] overflow-hidden flex flex-col",children:[h.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:g},children:u.map((v,x)=>h.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},x))}),h.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:m?h.jsx(En,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):p.map((v,x)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:g},children:u.map((_,w)=>{const y=v[_.key],E=_.label==="Closed",S=_.label==="Open",P=typeof y=="string"&&y.includes("%"),D=y==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return h.jsx("div",{className:`px-[24px] py-[16px] flex items-center justify-start ${w===0?"bg-white":"bg-gray-50"} text-[#121212]`,children:E?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:y??"-"}):S?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:y??"-"}):P?h.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:y}):h.jsx("div",{children:y??"-"})},w)})},x))})]}),h.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px] shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,x)=>h.jsx("option",{value:v,children:v},x))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(_fe,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(kL,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(PL,{size:18})}),h.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(Efe,{size:18})})]})]})]})}const LL=({options:e=[],value:t,onChange:n})=>{const[r,i]=k.useState(!1),o=k.useRef(null);return k.useEffect(()=>{const a=s=>{o.current&&!o.current.contains(s.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]),h.jsxs("div",{ref:o,className:"relative h-[32px]",children:[h.jsxs("div",{className:"flex items-center justify-between gap-[10px] px-[12px] py-[8px] border border-[#E2E8F0] rounded-[4px] cursor-pointer min-w-[140px]",onClick:()=>i(!r),children:[h.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),h.jsx(wfe,{size:16,className:"text-[#64748B]"})]}),r&&h.jsx("div",{className:"absolute top-[110%] left-0 w-full bg-white border border-[#E2E8F0] rounded-[8px] shadow-md z-10",children:e.map((a,s)=>h.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},ihe=({data:e,communities:t,title:n})=>{const[r,i]=k.useState({}),[o,a]=k.useState(""),s=t?t.map(d=>d.community_name):[];k.useEffect(()=>{s.length>0&&!o&&a(s[0])},[s,o]);const l=[{community_name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{community_name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{community_name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],c=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:l,[e]),u=d=>{const{dataKey:f}=d;i(p=>({...p,[f]:!p[f]}))};return Array.isArray(e)&&e.length===0?h.jsx(Ot,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Ot,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:h.jsx(LL,{options:s,value:o,onChange:d=>a(d)}),children:h.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[261px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:c,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Kn,{dataKey:"community_name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(At,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:d,payload:f,label:p})=>!d||!f||!f.length?null:h.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[h.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:p}),f.map((m,g)=>{const v=m.color||m.fill||"#fff";return h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[h.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:v,display:"inline-block"}}),h.jsx("span",{style:{color:"#D1D3D4"},children:m.name}),h.jsx("span",{style:{color:"#fff",fontWeight:600},children:m.value})]},g)})]})}),h.jsx(Gs,{verticalAlign:"bottom",align:"center",onClick:u,content:({payload:d})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:d.map((f,p)=>h.jsxs("div",{onClick:()=>u({dataKey:f.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:r[f.dataKey]?"#CBD5E1":f.color}}),h.jsx("span",{style:{fontSize:"12px",color:r[f.dataKey]?"#CBD5E1":"#64748B"},children:f.value})]},p))})}),h.jsx(Ut,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:r.Open}),h.jsx(Ut,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:r.Cancelled}),h.jsx(Ut,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:r.OnHold,name:"On-Hold"}),h.jsx(Ut,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:r.InProgress,name:"In Progress"})]})})})})})},ohe=({data:e=[]})=>{const[t,n]=k.useState("Kosmo One"),r=["Kosmo One","Kosmo Two","Kosmo Three"],i=Array.isArray(e)?e:[],o=!i.length||i.every(a=>a.no_of_visitors===0);return h.jsx(Ot,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:h.jsx(LL,{options:r,value:t,onChange:a=>n(a)}),children:o?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(En,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(iM,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Kn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),h.jsx(Ln,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(At,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return h.jsx(ni,{active:a,payload:s,label:u})}}),h.jsx(H0,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return h.jsxs("g",{children:[h.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},ahe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return h.jsx(Ot,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children:h.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[h.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Tenant"}),h.jsx("div",{className:"flex justify-end",children:"Total"}),h.jsx("div",{className:"flex justify-end",children:"Pending"}),h.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),h.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((r,i)=>h.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[h.jsx("div",{className:"text-[#475569]",children:r.name}),h.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),h.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),h.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},pm=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],she=[{asset_group_name:"Lifts",asset_count:3,investment:"₹ 45L"},{asset_group_name:"Fire Systems",asset_count:16,investment:"₹ 28L"},{asset_group_name:"Generators",asset_count:16,investment:"₹ 95L"},{asset_group_name:"HVAC",asset_count:24,investment:"₹ 1.2Cr"},{asset_group_name:"Others",asset_count:97,investment:"₹ 52L"}],lhe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:pm[o%pm.length]})):she.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:pm[o%pm.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(Ot,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(Ot,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Et,{width:"100%",height:"100%",children:h.jsx(Ii,{children:h.jsx(oi,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>h.jsx(Nn,{fill:i.color},o))})})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),h.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};ue.AccessPointsUsage=jpe,ue.Accounting=qde,ue.Amenities=Spe,ue.AmenitiesStatsCard=Hpe,ue.AmenityWiseRevenue=Qpe,ue.AssetValueBreakdown=sfe,ue.AssetsByType=Jpe,ue.BlockWiseOccupancy=$de,ue.BookingTrendChart=Gpe,ue.Bookings=Kpe,ue.Budgets=Jde,ue.BuildingWiseApprovals=ahe,ue.Card=Re,ue.CardAccess=IL,ue.CashBankBalance=tfe,ue.CommercialAccessOverview=Npe,ue.CommercialGuardPatrols=the,ue.CommercialIncidentReports=nhe,ue.CommercialOccupancy=bpe,ue.CommercialReportTable=rhe,ue.Community=$oe,ue.Complaints=Ufe,ue.ComplaintsByLevel=Xfe,ue.DuesAgeing=rfe,ue.EmployeeFootfall=xpe,ue.Engagement=_ae,ue.EngagementStatsGrid=ype,ue.EscalationLevel=ihe,ue.EventsUtilisation=lpe,ue.ExpenseCategories=ofe,ue.Facilities=Eae,ue.FinanceSummary=Sae,ue.FoodBeverages=Epe,ue.GateAndSecurityStatsGrid=Vfe,ue.GateUpdates=dse,ue.GuardPatrols=Pfe,ue.Header=K3,ue.Helpdesk=fse,ue.HelpdeskStatsGrid=ope,ue.HourlyTrafficFlow=Nfe,ue.IncidentReports=Lfe,ue.IncomeExpenditure=_L,ue.MainHeader=a8,ue.MaintenanceStatus=ehe,ue.MetricCard=Bpe,ue.MobileAccess=IL,ue.MoveInOutTrends=zde,ue.NoticeBoardStatus=dpe,ue.OccupancyOverview=Lde,ue.OrganisationWiseVisitors=Vpe,ue.PortfolioAssetsByType=lhe,ue.RequestBox=Zfe,ue.ResidentOverview=Rde,ue.RevenuebyCategory=cfe,ue.SingleStats=hpe,ue.StaffAttendance=$fe,ue.StatsGrid=hfe,ue.TenantsByVisitors=ohe,ue.TicketEscalation=Ope,ue.TicketStatus=kpe,ue.Tickets=Rpe,ue.TicketsperCategory=$pe,ue.UnitStatus=Ide,ue.VisitorUpdates=Mpe,ue.WeeklyVisitorPattern=Wpe,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})}));
|