1import{H as Ne,aw as Fe,f as g,a as J,s as Q,r as ee,J as ye,aC as ve,aD as Pe,j as e,B as re,c as G,K as Te,P as ue,d as pe,g as xe,I as ze,X as Ke,ac as T,ad as z,bw as He,am as H,an as O,U as Oe,e as Ue,aY as Ye,aI as Ge,aJ as Ve,aK as We,a6 as Be}from"./index-D5R9CWr2.js";import{g as Xe,h as Ze,i as Je,A as Me}from"./AppLayout-CreL9Axy.js";import{P as Qe}from"./PageSkeleton-SVGO8oUf.js";import{s as Y}from"./subMonths-CrVfi4o7.js";import{e as Ie}from"./eachDayOfInterval-DbKHaPHh.js";import{p as y}from"./parseISO-CPTq0D6Q.js";import{d as Z}from"./differenceInDays-Dc8ONZsv.js";import{B as ne}from"./badge-B4iIB_GH.js";import{C as he}from"./checkbox-Dl54z5Ln.js";import{S as ge,a as et}from"./scroll-area-XzMpmktT.js";import{S as tt}from"./switch-0RmuZVXc.js";import{A as st}from"./arrow-down-right-OzF-FclR.js";import{M as at}from"./minus-VQjC59cM.js";import{f as M}from"./format-CcRAgX_T.js";import{R as be,X as rt,Y as nt,T as ke,a2 as ot,B as Re,C as Ee}from"./generateCategoricalChart-BdSggeAh.js";import{C as ct,L as it}from"./ComposedChart-Djs5zCBq.js";import{C as dt}from"./CartesianGrid-BsPtk3uK.js";import{P as Le,a as qe}from"./PieChart-BMDiTRGh.js";import{P as lt}from"./progress-KLlK8Lw_.js";import{T as mt}from"./trending-down-Dl_Sk8wE.js";import{u as ut}from"./usePlatformColorLookup-CvVHh6fK.js";import{C as pt}from"./clock-D72xm9Eo.js";import{C as xt}from"./circle-alert-KF09QkyG.js";import{H as ht}from"./house-BSdFTc93.js";import{L as gt}from"./lightbulb-CPXoXIsr.js";import{T as yt}from"./triangle-alert-Dz_0sbeG.js";import{I as ft}from"./info-iO_2lkQq.js";import{Z as jt}from"./zap-CeqPb_xt.js";import"./wrench-CpPDVHpr.js";import"./pull-to-refresh-8r31CQoz.js";import"./calendar-D7YPT7FB.js";import"./send-DYbGN6xe.js";import"./dollar-sign-CFXmjBgO.js";import"./wallet-NSknHVIW.js";import"./file-text-D50dZpGo.js";import"./chart-column-DDD70TP6.js";import"./message-square-_pho9Wsv.js";import"./database-CyS6yrr_.js";import"./upload-DnTsq47q.js";import"./formatDistanceToNow-BOhoyb6f.js";import"./constructNow-DQ2n3FBI.js";import"./differenceInMonths-6myfc76I.js";import"./sheet-BMeEmOG3.js";import"./index-BQJE0D3x.js";import"./index-Cj3i9dis.js";import"./receipt-B0GYoCdB.js";import"./drawer-B05fz228.js";import"./circle-check-CLbUexCi.js";import"./credit-card-C-BRGzyw.js";import"./dialog-CLC4v4pI.js";import"./textarea-rQZs_wSe.js";import"./trash-2-KxEfpDSI.js";import"./plus-C_cXJ1zJ.js";import"./ticket-plus-CmgMFVQN.js";import"./arrow-left-ZzXpuph4.js";import"./skeleton-Cjb14kQh.js";import"./Area-CfGdf3_N.js";import"./usePlatformProviders-azUNS-RB.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const vt=Ne("GitCompareArrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Nt=Ne("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 12 * @license lucide-react v0.462.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const bt=Ne("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);function De(t){const{workspace:s}=Fe(),c=g(Y(new Date,11),"yyyy-MM-dd"),n=g(new Date,"yyyy-MM-dd"),o=(t==null?void 0:t.startDate)||c,x=(t==null?void 0:t.endDate)||n,{data:b=[],isLoading:B}=J({queryKey:["booking-stats-bookings",s==null?void 0:s.id,o,x,t==null?void 0:t.propertyId],queryFn:async()=>
16{if(!(s!=null&&s.id))return[];let j=Q.from("bookings").select(` 17 id, 18 booking_number, 19 property_id, 20 check_in, 21 check_out, 22 status, 23 total_price, 24 nightly_rate, 25 cleaning_fee, 26 platform_fee, 27 source, 28 guests_count, 29 created_at, 30 property:properties(id, name, internal_reference) 31 `).eq("workspace_id",s.id).gte("check_in",o).lte("check_in",x).in("status",["confirmed","in_progress","closed"]);t!=null&&t.propertyId&&(j=j.eq("property_id",t.propertyId));const{data:_,error:v}=await j;if(v)throw v;return _},enabled:!!(s!=null&&s.id)}),{data:f=[]}=J({queryKey:["booking-stats-properties",s==null?void 0:s.id,t==null?void 0:t.propertyId],queryFn:async()=>{if(!(s!=null&&s.id))return[];let j=Q.from("properties").select("id, name, internal_reference").eq("workspace_id",s.id);t!=null&&t.propertyId&&(j=j.eq("id",t.propertyId));const{data:_,error:v}=await j;if(v)throw v;return _},enabled:!!(s!=null&&s.id)}),{data:U=[]}=J({queryKey:["booking-stats-future",s==null?void 0:s.id,t==null?void 0:t.propertyId],queryFn:async()=>{if(!(s!=null&&s.id))return[];const j=g(new Date,"yyyy-MM-dd");let _=Q.from("bookings").select(` 32 id, 33 property_id, 34 check_in, 35 check_out, 36 total_price, 37 property:properties(id, name) 38 `).eq("workspace_id",s.id).gte("check_in",j).in("status",["confirmed","to_complete"]);t!=null&&t.propertyId&&(_=_.eq("property_id",t.propertyId));const{data:v,error:F}=await _;if(F)throw F;return v},enabled:!!(s!=null&&s.id)});return{stats:ee.useMemo(()=>{if(b.length===0||f.length===0)return{totalRevenue:0,totalBookings:0,averageDailyRate:0,revPAN:0,occupancyRate:0,averageStayLength:0,revenueByProperty:[],revenueBySource:[],revenueByMonth:[],upcomingRevenue:0,gapAnalysis:[]};const j=b.reduce((d,p)=>d+(p.total_price||0),0),_=b.length;let v=0;b.forEach(d=>{d.check_in&&d.check_out&&(v+=ye(d.check_in,d.check_out))});const F=v>0?j/v:0,A=_>0?v/_:0,P=y(o),i=y(x),E=(Z(i,P)+1)*f.length,V=E>0?v/E*100:0,l=E>0?j/E:0,u=f.map(d=>{const p=b.filter(I=>I.property_id===d.id),w=p.reduce((I,q)=>I+(q.total_price||0),0);return{propertyId:d.id,propertyName:d.name,revenue:w,bookings:p.length}}).sort((d,p)=>p.revenue-d.revenue),W=new Map;b.forEach(d=>{var I;const p=((I=d.source)==null?void 0:I.toLowerCase())||"direct",w=W.get(p)||{revenue:0,bookings:0};W.set(p,{revenue:w.revenue+(d.total_price||0),bookings:w.bookings+1})});const oe=Array.from(W.entries()).map(([d,p])=>({source:d,revenue:p.revenue,bookings:p.bookings,percentage:j>0?p.revenue/j*100:0})).sort((d,p)=>p.revenue-d.revenue),te=new Map;b.forEach(d=>{if(d.check_in){const p=g(y(d.check_in),"yyyy-MM"),w=te.get(p)||{revenue:0,bookings:0,nightsBooked:0},I=d.check_in&&d.check_out?ye(d.check_in,d.check_out):0;te.set(p,{revenue:w.revenue+(d.total_price||0),bookings:w.bookings+1,nightsBooked:w.nightsBooked+I})}});const le=Array.from(te.entries()).map(([d,p])=>{const w=ve(y(`${d}-01`)),I=Pe(w),R=(Z(I,w)+1)*f.length;return{month:d,revenue:p.revenue,bookings:p.bookings,occupancy:R>0?p.nightsBooked/R*100:0}}).sort((d,p)=>d.month.localeCompare(p.month)),fe=U.reduce((d,p)=>d+(p.total_price||0),0),L=f.map(d=>{const p=b.filter(R=>R.property_id===d.id),w=new Set;p.forEach(R=>{R.check_in&&R.check_out&&Ie({start:y(R.check_in),end:y(R.check_out)}).forEach(je=>w.add(g(je,"yyyy-MM-dd")))});const q=Ie({start:P,end:i}).filter(R=>!w.has(g(R,"yyyy-MM-dd"))).length;return{propertyId:d.id,propertyName:d.name,gapDays:q,potentialRevenue:q*F}}).filter(d=>d.gapDays>0).sort((d,p)=>p.potentialRevenue-d.potentialRevenue);return{totalRevenue:j,totalBookings:_,averageDailyRate:F,revPAN:l,occupancyRate:V,averageStayLength:A,revenueByProperty:u,revenueBySource:oe,revenueByMonth:le,upcomingRevenue:fe,gapAnalysis:L}},[b,f,U,o,x]),isLoading:B,bookings:b,properties:f}}function kt(t){var E,V;const{workspace:s}=Fe(),{stats:c,isLoading:n,bookings:o,properties:x}
38=De({startDate:t.startDate,endDate:t.endDate,propertyId:((E=t.propertyIds)==null?void 0:E.length)===1?t.propertyIds[0]:void 0}),b=g(Y(y(t.startDate),Z(y(t.endDate),y(t.startDate))>180?12:Math.ceil(Z(y(t.endDate),y(t.startDate))/30)),"yyyy-MM-dd"),B=t.startDate,{stats:f}=De({startDate:b,endDate:B,propertyId:((V=t.propertyIds)==null?void 0:V.length)===1?t.propertyIds[0]:void 0}),{data:U=[],isLoading:de}=J({queryKey:["company-stats-expenses",s==null?void 0:s.id,t.startDate,t.endDate],queryFn:async()=>{if(!(s!=null&&s.id))return[];const{data:l,error:u}=await Q.from("expenses").select("id, amount, category, date, property_id, booking_id, status, description, expense_number").eq("workspace_id",s.id).gte("date",t.startDate).lte("date",t.endDate);if(u)throw u;return l||[]},enabled:!!(s!=null&&s.id)}),{data:j=[],isLoading:_}=J({queryKey:["company-stats-payouts",s==null?void 0:s.id,t.startDate,t.endDate],queryFn:async()=>{if(!(s!=null&&s.id))return[];const{data:l,error:u}=await Q.from("payouts").select("id, amount, owner_id, property_id, booking_id, status, created_at, period_start, period_end").eq("workspace_id",s.id).gte("created_at",t.startDate).lte("created_at",t.endDate);if(u)throw u;return l||[]},enabled:!!(s!=null&&s.id)}),{data:v=[]}=J({queryKey:["company-stats-agents",s==null?void 0:s.id],queryFn:async()=>{if(!(s!=null&&s.id))return[];const{data:l,error:u}=await Q.from("agents").select("id, name, avatar_url, is_active").eq("workspace_id",s.id);if(u)throw u;return l||[]},enabled:!!(s!=null&&s.id)}),{data:F=[]}=J({queryKey:["company-stats-owners",s==null?void 0:s.id],queryFn:async()=>{if(!(s!=null&&s.id))return[];const{data:l,error:u}=await Q.from("owners").select("id, name, commission_rate, pricing_model").eq("workspace_id",s.id);if(u)throw u;return l||[]},enabled:!!(s!=null&&s.id)}),A=ee.useMemo(()=>{let l=o||[];return t.propertyIds&&t.propertyIds.length>0&&(l=l.filter(u=>t.propertyIds.includes(u.property_id||""))),t.agentIds&&t.agentIds.length>0&&(l=l.filter(u=>t.agentIds.includes(u.assigned_to||""))),t.sources&&t.sources.length>0&&(l=l.filter(u=>t.sources.includes((u.source||"direct").toLowerCase()))),t.statuses&&t.statuses.length>0&&(l=l.filter(u=>t.statuses.includes(u.status||""))),l},[o,t]),P=ee.useMemo(()=>{let l=U;return t.propertyIds&&t.propertyIds.length>0&&(l=l.filter(u=>t.propertyIds.includes(u.property_id||""))),l},[U,t.propertyIds]),i=ee.useMemo(()=>{let l=j;return t.ownerIds&&t.ownerIds.length>0&&(l=l.filter(u=>t.ownerIds.includes(u.owner_id||""))),t.propertyIds&&t.propertyIds.length>0&&(l=l.filter(u=>t.propertyIds.includes(u.property_id||""))),l},[j,t.ownerIds,t.propertyIds]);return{...ee.useMemo(()=>{const l=c.totalRevenue,u=P.reduce((a,r)=>a+(r.amount||0),0),W=i.reduce((a,r)=>a+(r.amount||0),0),oe=l-u-W,te=l>0?oe/l*100:0,le=l>0?u/l*100:0,fe=c.totalBookings>0?u/c.totalBookings:0,L=(a,r,m,D)=>{const h=m>0?(r-m)/m*100:0;return{label:a,value:r,previousValue:m,format:D,changePercent:h,trend:h>1?"up":h<-1?"down":"flat"}},d=[L("Total Revenue",l,f.totalRevenue,"currency"),L("Net Profit",oe,f.totalRevenue-u-W,"currency"),L("Profit Margin",te,0,"percent"),L("Total Bookings",c.totalBookings,f.totalBookings,"number"),L("Occupancy Rate",c.occupancyRate,f.occupancyRate,"percent"),L("ADR",c.averageDailyRate,f.averageDailyRate,"currency"),L("RevPAN",c.revPAN,f.revPAN,"currency"),L("Expense Ratio",le,0,"percent")],p=(x||[]).map(a=>{var ie;const r=A.filter(C=>C.property_id===a.id),m=r.reduce((C,ae)=>C+(ae.total_price||0),0),D=P.filter(C=>C.property_id===a.id).reduce((C,ae)=>C+(ae.amount||0),0);let h=0;r.forEach(C=>{C.check_in&&C.check_out&&(h+=ye(C.check_in,C.check_out))});const S=Z(y(t.endDate),y(t.startDate))+1,K=S>0?h/S*100:0,N=h>0?m/h:0,$=m>0?D/m*100:0,X=m>0?(m-D)/m*100:0,me=K*.3+Math.min(m/1e3,100)*.4+X*.3;return{propertyId:a.id,propertyName:a.name,ownerId:a.owner_id,ownerName:(ie=a.owner)==null?void 0:ie.name,revenue:m,bookings:r.length,occupancy:K,adr:N,expenses:D,expenseRatio:$,profitMargin:X,score:me}}).sort((a,r)=>r.score-a.score),w=(v||[]).map(a=>{const r=A.filter(h=>h.assigned_to===a.id),m=r.reduce((h,S)=>h+(S.total_price||0),0),D=new Set(r.map(h=>h.property_id));return{agentId:a.id,agentName:a.name,avatarUrl:a.avatar_url,bookings:r.length,revenue:m,avgBookingValue:r.length>0?m/r.length:0,properties:D.size}}
38).filter(a=>a.bookings>0).sort((a,r)=>r.revenue-a.revenue),I=new Map;A.forEach(a=>{const r=(a.source||"direct").toLowerCase(),m=I.get(r)||{revenue:0,bookings:0,nights:0};let D=0;a.check_in&&a.check_out&&(D=ye(a.check_in,a.check_out)),I.set(r,{revenue:m.revenue+(a.total_price||0),bookings:m.bookings+1,nights:m.nights+D})});const q=Array.from(I.entries()).map(([a,r])=>({source:a,revenue:r.revenue,bookings:r.bookings,avgStayLength:r.bookings>0?r.nights/r.bookings:0,adr:r.nights>0?r.revenue/r.nights:0,percentage:l>0?r.revenue/l*100:0})).sort((a,r)=>r.revenue-a.revenue),R=new Map;P.forEach(a=>{const r=a.category||"other",m=R.get(r)||{amount:0,count:0};R.set(r,{amount:m.amount+(a.amount||0),count:m.count+1})});const we=Array.from(R.entries()).map(([a,r])=>({category:a,amount:r.amount,count:r.count,percentage:u>0?r.amount/u*100:0})).sort((a,r)=>r.amount-a.amount),je=(F||[]).map(a=>{const r=(x||[]).filter(N=>N.owner_id===a.id),m=new Set(r.map(N=>N.id)),h=A.filter(N=>m.has(N.property_id||"")).reduce((N,$)=>N+($.total_price||0),0),S=P.filter(N=>m.has(N.property_id||"")).reduce((N,$)=>N+($.amount||0),0),K=i.filter(N=>N.owner_id===a.id).reduce((N,$)=>N+($.amount||0),0);return{ownerId:a.id,ownerName:a.name,properties:r.length,grossRevenue:h,expenses:S,payouts:K,netForAgency:h-S-K,commissionRate:a.commission_rate||0}}).filter(a=>a.grossRevenue>0||a.properties>0).sort((a,r)=>r.netForAgency-a.netForAgency),ce=new Map;A.forEach(a=>{if(!a.check_in)return;const r=g(y(a.check_in),"yyyy-MM"),m=ce.get(r)||{month:r,revenue:0,expenses:0,payouts:0,netProfit:0,bookings:0,occupancy:0};m.revenue+=a.total_price||0,m.bookings+=1,ce.set(r,m)}),P.forEach(a=>{if(!a.date)return;const r=g(y(a.date),"yyyy-MM"),m=ce.get(r)||{month:r,revenue:0,expenses:0,payouts:0,netProfit:0,bookings:0,occupancy:0};m.expenses+=a.amount||0,ce.set(r,m)});const $e=Array.from(ce.values()).map(a=>({...a,netProfit:a.revenue-a.expenses-a.payouts})).sort((a,r)=>a.month.localeCompare(r.month)),_e=[];(x||[]).forEach(a=>{const r=A.filter(S=>S.property_id===a.id),m=y(t.startDate),D=y(t.endDate);let h=ve(m);for(;h<=D;){const S=h,K=Pe(h),N=Z(K,S)+1;let $=0;r.forEach(X=>{if(!X.check_in||!X.check_out)return;const me=y(X.check_in),ie=y(X.check_out),C=me>S?me:S,ae=ie<K?ie:K;C<=ae&&($+=Z(ae,C))}),_e.push({propertyId:a.id,propertyName:a.name,month:g(h,"yyyy-MM"),occupancy:N>0?$/N*100:0}),h=ve(Y(h,-1))}});const se=[];if(p.forEach(a=>{a.expenseRatio>40&&se.push({type:"warning",title:`High expense ratio on ${a.propertyName}`,description:`${a.expenseRatio.toFixed(0)}% of revenue goes to expenses â investigate costs`,metric:`${a.expenseRatio.toFixed(0)}%`}),a.occupancy<30&&a.occupancy>0&&se.push({type:"action",title:`Low occupancy on ${a.propertyName}`,description:`Only ${a.occupancy.toFixed(0)}% occupied â consider adjusting pricing or marketing`,metric:`${a.occupancy.toFixed(0)}%`})}),q.length>=2){const a=q[0],r=q[1];a.adr>r.adr*1.5&&se.push({type:"success",title:`${a.source} generates highest ADR`,description:`â¬${a.adr.toFixed(0)}/night vs â¬${r.adr.toFixed(0)} on ${r.source} â optimize this channel`,metric:`â¬${a.adr.toFixed(0)}`})}if(w.length>=2){const a=w[0],r=w.reduce((m,D)=>m+D.bookings,0);a.bookings>r*.4&&se.push({type:"info",title:`${a.agentName} manages ${(a.bookings/r*100).toFixed(0)}% of bookings`,description:"Consider load balancing across agents",metric:`${a.bookings} bookings`})}if(c.gapAnalysis.length>0){const a=c.gapAnalysis.reduce((r,m)=>r+m.potentialRevenue,0);a>5e3&&se.push({type:"action",title:`â¬${(a/1e3).toFixed(0)}k potential revenue from gaps`,description:`${c.gapAnalysis.reduce((r,m)=>r+m.gapDays,0)} unfilled days across properties`,metric:`â¬${(a/1e3).toFixed(0)}k`})}return{kpis:d,totalRevenue:l,totalExpenses:u,totalPayouts:W,netProfit:oe,profitMargin:te,expenseRatio:le,costPerBooking:fe,propertyRankings:p,agentStats:w,sourceStats:q,expenseBreakdown:we,ownerStats:je,monthlyFinance:$e,occupancyHeatmap:_e,insights:se,gapAnalysis:c.gapAnalysis,upcomingRevenue:c.upcomingRevenue}},[c,f,A,P,i,v,F,x,t]),properties:x||[],agents:v||[],owners:F||[],bookings:A,isLoading:n||de||_}}const wt=[{value:"30d",label:"30d"},{value:"90d",label:"90d"},{value:"6m",label:"6m"},{value:"12m",label:"12m"},{value:"ytd",label:"YTD"}];function _t({filters:t,onFiltersChange:s,properties:c,owners:n,agents:o}){var _,v,F,A,P;const[x,b]=ee.useState(""),B=i=>{s({...t,...i})},f=(i,k)=>{const E=t[i]||[],V=E.includes(k)?E.filter(l=>l!==k):[...E,k];B({[i]:V.length>0?V:void 0})},U=[((_=t.propertyIds)==null?void 0:_.length)||0,((v=t.ownerIds)==null?void 0:v.length)||0,((F=t.agentIds)==null?void 0:F.length)||0,((A=t.sources)==null?void 0:A.length)||0,((P=t.statuses)==null?void 0:P.length)||0].reduce((i,k)=>i+k,0),de=c.filter(i=>i.name.toLowerCase().includes(x.toLowerCase())),j=["airbnb","booking","vrbo","direct","ical","other"];return e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"flex items-center gap-1 p-1 bg-muted rounded-lg",children:wt.map(i=>e.jsx(re,{variant:t.dateRange===i.value?"default":"ghost",size:"sm",className:G("h-7 px-3 text-xs",t.dateRange!==i.value&&"hover:bg-background"),onClick:()=>B({dateRange:i.value}),children:i.label},i.value))}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2",children:[e.jsx(tt,{id:"yoy",checked:t.compareLastYear||!1,onCheckedChange:i=>B({compareLastYear:i}),className:"scale-75"}),e.jsxs(Te,{htmlFor:"yoy",className:"text-xs text-muted-foreground cursor-pointer",children:[e.jsx(vt,{className:"h-3.5 w-3.5 inline mr-1"}),"YoY"]})]}),e.jsxs(ue,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs(re,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",children:["Properties",t.propertyIds&&t.propertyIds.length>0&&e.jsx(ne,{variant:"secondary",className:"h-4 px-1 text-micro",children:t.propertyIds.length})]})}),e.jsxs(xe,{className:"w-64 p-3",align:"start",children:[e.jsx(ze,{placeholder:"Search properties...",value:x,onChange:i=>b(i.target.value),className:"h-8 text-xs mb-2"}),e.jsx(ge,{className:"h-48",children:e.jsx("div",{className:"space-y-1",children:de.map(i=>{var k;return e.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted cursor-pointer text-xs",children:[e.jsx(he,{checked:((k=t.propertyIds)==null?void 0:k.includes(i.id))||!1,onCheckedChange:()=>f("propertyIds",i.id)}),e.jsx("span",{className:"truncate",children:i.name})]},i.id)})})})]})]}),n.length>0&&e.jsxs(ue,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs(re,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",children:["Owners",t.ownerIds&&t.ownerIds.length>0&&e.jsx(ne,{variant:"secondary",className:"h-4 px-1 text-micro",children:t.ownerIds.length})]})}),e.jsx(xe,{className:"w-56 p-3",align:"start",children:e.jsx(ge,{className:"h-40",children:e.jsx("div",{className:"space-y-1",children:n.map(i=>{var k;return e.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted cursor-pointer text-xs",children:[e.jsx(he,{checked:((k=t.ownerIds)==null?void 0:k.includes(i.id))||!1,onCheckedChange:()=>f("ownerIds",i.id)}),e.jsx("span",{className:"truncate",children:i.name})]},i.id)})})})})]}),o.length>0&&e.jsxs(ue,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs(re,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",children:["Agents",t.agentIds&&t.agentIds.length>0&&e.jsx(ne,{variant:"secondary",className:"h-4 px-1 text-micro",children:t.agentIds.length})]})}),e.jsx(xe,{className:"w-56 p-3",align:"start",children:e.jsx(ge,{className:"h-40",children:e.jsx("div",{className:"space-y-1",children:o.map(i=>{var k;return e.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted cursor-pointer text-xs",children:[e.jsx(he,{checked:((k=t.agentIds)==null?void 0:k.includes(i.id))||!1,onCheckedChange:()=>f("agentIds",i.id)}),e.jsx("span",{className:"truncate",children:i.name})]},i.id)})})})})]}),e.jsxs(ue,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs(re,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",children:["Sources",t.sources&&t.sources.length>0&&e.jsx(ne,{variant:"secondary",className:"h-4 px-1 text-micro",children:t.sources.length})]})}),e.jsx(xe,{className:"w-48 p-3",align:"start",children:e.jsx("div",{className:"space-y-1",children:j.map(i=>{var k;return e.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted cursor-pointer text-xs capitalize",children:[e.jsx(he,{checked:((k=t.sources)==null?void 0:k.includes(i))||!1,onCheckedChange:()=>f("sources",i)}),i]},i)})})})]}),U>0&&e.jsxs(re,{variant:"ghost",size:"sm",className:"h-8 text-xs text-muted-foreground gap-1",onClick:()=>B({propertyIds:void 0,ownerIds:void 0,agentIds:void 0,sources:void 0,statuses:void 0}),children:[e.jsx(Ke,{className:"h-3 w-3"}),"Clear (",U,")"]})]})}const Mt=(t,s)=>s==="currency"?Math.abs(t)>=1e3?new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR",minimumFractionDigits:0,maximumFractionDigits:0}).format(t):new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR",minimumFractionDigits:0}).format(t):s==="percent"?`${t.toFixed(1)}
38%`:t.toLocaleString();function It({kpis:t}){return e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 xl:grid-cols-8 gap-3",children:t.map((s,c)=>e.jsx(T,{className:"relative overflow-hidden",children:e.jsxs(z,{className:"p-4",children:[e.jsx("p",{className:"text-caption font-medium text-muted-foreground mb-1 truncate",children:s.label}),e.jsx("p",{className:"text-lg font-bold leading-tight",children:Mt(s.value,s.format)}),s.changePercent!==0&&e.jsxs("div",{className:G("flex items-center gap-0.5 mt-1 text-caption font-medium",s.trend==="up"?"text-success":s.trend==="down"?"text-destructive":"text-muted-foreground"),children:[s.trend==="up"?e.jsx(He,{className:"h-3 w-3"}):s.trend==="down"?e.jsx(st,{className:"h-3 w-3"}):e.jsx(at,{className:"h-3 w-3"}),Math.abs(s.changePercent).toFixed(1),"%"]})]})},c))})}function Rt({data:t}){const s=t.map(c=>({...c,month:g(y(`${c.month}-01`),"MMM yy")}));return e.jsxs(T,{className:"col-span-2",children:[e.jsx(H,{className:"pb-2",children:e.jsx(O,{className:"text-base",children:"Revenue vs Expenses"})}),e.jsx(z,{children:e.jsx("div",{className:"h-72",children:e.jsx(be,{width:"100%",height:"100%",children:e.jsxs(ct,{data:s,children:[e.jsx(dt,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(rt,{dataKey:"month",className:"text-micro"}),e.jsx(nt,{className:"text-micro",tickFormatter:c=>`â¬${(c/1e3).toFixed(0)}k`}),e.jsx(ke,{formatter:(c,n)=>[M(c),n==="revenue"?"Revenue":n==="expenses"?"Expenses":"Net Profit"],contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",fontSize:"12px"}}),e.jsx(ot,{wrapperStyle:{fontSize:"11px"}}),e.jsx(Re,{dataKey:"revenue",name:"Revenue",fill:"hsl(var(--chart-2))",radius:[3,3,0,0]}),e.jsx(Re,{dataKey:"expenses",name:"Expenses",fill:"hsl(var(--destructive))",radius:[3,3,0,0],opacity:.7}),e.jsx(it,{type:"monotone",dataKey:"netProfit",name:"Net Profit",stroke:"hsl(var(--chart-1))",strokeWidth:2,dot:!1})]})})})})]})}const Ce=["hsl(var(--chart-4))","hsl(var(--chart-1))","hsl(var(--chart-2))","hsl(var(--chart-5))","hsl(var(--chart-3))"],Dt={cleaning:"ð§¹",repair:"ð§",supplies:"ð¦",transport:"ð",other:"ð"};function Ct({data:t,totalExpenses:s,expenseRatio:c}){const n=t.map((o,x)=>({name:o.category.charAt(0).toUpperCase()+o.category.slice(1),value:o.amount,fill:Ce[x%Ce.length]}));return e.jsxs(T,{children:[e.jsx(H,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(O,{className:"text-base",children:"Expense Breakdown"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.toFixed(1),"% of revenue"]})]})}),e.jsx(z,{children:t.length===0?e.jsx("p",{className:"text-center text-sm text-muted-foreground py-8",children:"No expenses recorded"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-44",children:e.jsx(be,{width:"100%",height:"100%",children:e.jsxs(Le,{children:[e.jsx(qe,{data:n,cx:"50%",cy:"50%",innerRadius:35,outerRadius:65,paddingAngle:2,dataKey:"value",children:n.map((o,x)=>e.jsx(Ee,{fill:o.fill},x))}),e.jsx(ke,{formatter:o=>M(o),contentStyle:{fontSize:"12px",borderRadius:"8px"}})]})})}),e.jsx("div",{className:"space-y-2 mt-2",children:t.map((o,x)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{children:Dt[o.category]||"ð"}),e.jsx("span",{className:"flex-1 capitalize",children:o.category}),e.jsx("span",{className:"font-medium",children:M(o.amount)}),e.jsxs("span",{className:"text-muted-foreground w-10 text-right",children:[o.percentage.toFixed(0),"%"]})]},o.category))})]})})]})}const At=t=>t===0?"text-warning":t===1?"text-muted-foreground":t===2?"text-warning":"text-muted-foreground";function St({data:t,onPropertyClick:s}){return e.jsxs(T,{children:[e.jsx(H,{className:"pb-2",children:e.jsxs(O,{className:"text-base flex items-center gap-2",children:[e.jsx(bt,{className:"h-4 w-4 text-warning"}),"Property Leaderboard"]})}),e.jsx(z,{children:t.length===0?e.jsx("p",{className:"text-center text-sm text-muted-foreground py-8",children:"No data available"}):e.jsx("div",{className:"space-y-3 max-h-[400px] overflow-y-auto pr-1",children:t.slice(0,10).map((c,n)=>e.jsxs("div",{className:"flex items-start gap-3 p-2.5 rounded-lg hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>s==null?void 0:s(c.propertyId),children:[e.jsx("span",{className:G("text-sm font-bold w-5 text-center mt-0.5",At(n)),children:n<3?["ð¥","ð¥","ð¥"][n]:`#${n+1}`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:c.propertyName}),e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-caption text-muted-foreground",children:[e.jsxs("span",{children:[c.bookings," bookings"]}),e.jsxs("span",{children:["ADR ",M(c.adr)]}),e.jsxs("span",{children:[c.occupancy.toFixed(0),"% occ."]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[e.jsx(lt,{value:Math.min(c.occupancy,100),className:"h-1.5 flex-1"}),c.expenseRatio>35&&e.jsxs(ne,{variant:"outline",className:"text-micro h-4 px-1 text-destructive border-destructive/30",children:[e.jsx(mt,{className:"h-2.5 w-2.5 mr-0.5"}),c.expenseRatio.toFixed(0),"% costs"]})]})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsx("p",{className:"text-sm font-bold",children:M(c.revenue)}),e.jsxs("p",{className:G("text-caption",c.profitMargin>=50?"text-success":c.profitMargin>=20?"text-muted-foreground":"text-destructive"),children:[c.profitMargin.toFixed(0),"% margin"]})]})]},c.propertyId))})})]})}function Ft({data:t}){return e.jsxs(T,{children:[e.jsx(H,{className:"pb-2",children:e.jsxs(O,{className:"text-base flex items-center gap-2",children:[e.jsx(Oe,{className:"h-4 w-4 text-primary"}),"Agent Performance"]})}),e.jsx(z,{children:t.length===0?e.jsx("p",{className:"text-center text-sm text-muted-foreground py-8",children:"No agents with bookings"}):e.jsx("div",{className:"space-y-3 max-h-[400px] overflow-y-auto pr-1",children:t.map((s,c)=>e.jsxs("div",{className:"flex items-center gap-3 p-2.5 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"relative",children:[e.jsxs(Xe,{className:"h-9 w-9",children:[e.jsx(Ze,{src:s.avatarUrl}),e.jsx(Je,{className:"text-xs bg-primary/10 text-primary",children:s.agentName.slice(0,2).toUpperCase()})]}),c<3&&e.jsx("span",{className:"absolute -top-1 -right-1 text-micro",children:["ð¥","ð¥","ð¥"][c]})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:s.agentName}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-caption text-muted-foreground",children:[e.jsxs("span",{children:[s.bookings," bookings"]}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.properties," properties"]})]})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsx("p",{className:"text-sm font-bold",children:M(s.revenue)}),e.jsxs("p",{className:"text-caption text-muted-foreground",children:["avg ",M(s.avgBookingValue)]})]})]},s.agentId))})})]})}function Pt({data:t}){const{getPlatformHex:s}=ut(),c=t.map(n=>({name:n.source.charAt(0).toUpperCase()+n.source.slice(1),value:n.revenue,fill:s(n.source)}));return e.jsxs(T,{children:[e.jsx(H,{className:"pb-2",children:e.jsx(O,{className:"text-base",children:"Source Analysis"})}),e.jsx(z,{children:t.length===0?e.jsx("p",{className:"text-center text-sm text-muted-foreground py-8",children:"No source data"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-40",children:e.jsx(be,{width:"100%",height:"100%",children:e.jsxs(Le,{children:[e.jsx(qe,{data:c,cx:"50%",cy:"50%",innerRadius:30,outerRadius:60,paddingAngle:2,dataKey:"value",children:c.map((n,o)=>e.jsx(Ee,{fill:n.fill},o))}),e.jsx(ke,{formatter:n=>M(n),contentStyle:{fontSize:"12px",borderRadius:"8px"}})]})})}),e.jsx("div",{className:"space-y-2 mt-2",children:t.map(n=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:s(n.source)}}),e.jsx("span",{className:"flex-1 capitalize font-medium",children:n.source}),e.jsxs("span",{className:"text-muted-foreground",children:[n.bookings,"b"]}),e.jsxs("span",{className:"text-muted-foreground",children:["ADR ",M(n.adr)]}),e.jsxs("span",{className:"font-medium",children:[n.percentage.toFixed(0),"%"]})]},n.source))})]})})]})}function Bt({data:t}){return e.jsxs(T,{children:[e.jsx(H,{className:"pb-2",children:e.jsxs(O,{className:"text-base flex items-center gap-2",children:[e.jsx(Ue,{className:"h-4 w-4"}),"Owner Profitability"]})}),e.jsx(z,{children:t.length===0?e.jsx("p",{className:"text-center text-sm text-muted-foreground py-8",children:"No owner data"}):e.jsx("div",{className:"space-y-3 max-h-[300px] overflow-y-auto pr-1",children:t.map(s=>e.jsxs("div",{className:"p-2.5 rounded-lg border border-border/50 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:s.ownerName}),e.jsxs("span",{className:"text-caption text-muted-foreground",children:[s.properties," prop."]})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-1 text-caption",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Revenue"}),e.jsx("p",{className:"font-medium",children:M(s.grossRevenue)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Expenses"}),e.jsx("p",{className:"font-medium text-destructive",children:M(s.expenses)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Payouts"}),e.jsx("p",{className:"font-medium",children:M(s.payouts)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Net Agency"}),e.jsx("p",{className:G("font-bold",s.netForAgency>=0?"text-success":"text-destructive"),children:M(s.netForAgency)})]})]})]},s.ownerId))})})]})}const Et=t=>t>=80?"bg-success-light":t>=60?"bg-success-light/60":t>=40?"bg-warning-light":t>=20?"bg-warning-light/60":t>0?"bg-urgent-light":"bg-muted";function Lt({data:t,properties:s}){const c=[...new Set(t.map(n=>n.month))].sort();return e.jsxs(T,{children:[e.jsx(H,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(O,{className:"text-base",children:"Occupancy Heatmap"}),e.jsxs("div",{className:"flex items-center gap-1 text-micro text-muted-foreground",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-urgent-light"})," Low",e.jsx("span",{className:"w-3 h-3 rounded bg-warning-light ml-1"})," Mid",e.jsx("span",{className:"w-3 h-3 rounded bg-success-light ml-1"})," High"]})]})}),e.jsx(z,{children:s.length===0?e.jsx("p",{className:"text-center text-sm text-muted-foreground py-8",children:"No data"}):e.jsxs(ge,{className:"w-full",children:[e.jsxs("div",{className:"min-w-[500px]",children:[e.jsxs("div",{className:"flex items-center gap-1 mb-1.5",children:[e.jsx("div",{className:"w-28 shrink-0"}),c.map(n=>e.jsx("div",{className:"flex-1 text-center text-micro text-muted-foreground font-medium",children:g(y(`${n}-01`),"MMM")},n))]}),s.slice(0,15).map(n=>e.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[e.jsx("div",{className:"w-28 shrink-0 text-caption truncate text-muted-foreground",children:n.name}),c.map(o=>{const x=t.find(B=>B.propertyId===n.id&&B.month===o),b=(x==null?void 0:x.occupancy)||0;return e.jsx(Ye,{children:e.jsxs(Ge,{children:[e.jsx(Ve,{asChild:!0,children:e.jsx("div",{className:G("flex-1 h-6 rounded-sm cursor-default transition-colors",Et(b))})}),e.jsxs(We,{className:"text-xs",children:[n.name," â ",g(y(`${o}-01`),"MMM yyyy"),": ",b.toFixed(0),"%"]})]})},o)})]},n.id))]}),e.jsx(et,{orientation:"horizontal"})]})})]})}function qt({upcomingRevenue:t,gapAnalysis:s}){const c=s.reduce((o,x)=>o+x.gapDays,0),n=s.reduce((o,x)=>o+x.potentialRevenue,0);return e.jsxs(T,{children:[e.jsx(H,{className:"pb-2",children:e.jsx(O,{className:"text-base",children:"Forecast & Gaps"})}),e.jsxs(z,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"p-3 bg-success-light dark:bg-success-light rounded-lg",children:[e.jsx(Nt,{className:"h-4 w-4 text-success mb-1"}),e.jsx("p",{className:"text-caption text-muted-foreground",children:"Upcoming"}),e.jsx("p",{className:"text-sm font-bold text-success",children:M(t)})]}),e.jsxs("div",{className:"p-3 bg-warning-light dark:bg-warning-light rounded-lg",children:[e.jsx(pt,{className:"h-4 w-4 text-warning mb-1"}),e.jsx("p",{className:"text-caption text-muted-foreground",children:"Gap Days"}),e.jsx("p",{className:"text-sm font-bold",children:c})]}),e.jsxs("div",{className:"p-3 bg-urgent-light dark:bg-urgent-light rounded-lg",children:[e.jsx(xt,{className:"h-4 w-4 text-destructive mb-1"}),e.jsx("p",{className:"text-caption text-muted-foreground",children:"Lost Rev."}),e.jsx("p",{className:"text-sm font-bold text-destructive",children:M(n)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Biggest gaps"}),s.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No gaps detected â
"}):s.slice(0,5).map(o=>e.jsxs("div",{className:"flex items-center gap-2 text-xs p-2 bg-muted/30 rounded",children:[e.jsx(ht,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),e.jsx("span",{className:"flex-1 truncate",children:o.propertyName}),e.jsxs("span",{className:"text-muted-foreground",children:[o.gapDays,"d"]}),e.jsx("span",{className:"font-medium text-destructive",children:M(o.potentialRevenue)})]},o.propertyId))]})]})]})}const Ae={warning:{icon:yt,color:"text-warning",bg:"bg-warning-light dark:bg-warning-light"},success:{icon:Be,color:"text-success",bg:"bg-success-light dark:bg-success-light"},info:{icon:ft,color:"text-info",bg:"bg-info-light dark:bg-info-light"},action:{icon:jt,color:"text-accent",bg:"bg-accent/10 dark:bg-accent/10"}};function $t({insights:t}){return e.jsxs(T,{children:[e.jsx(H,{className:"pb-2",children:e.jsxs(O,{className:"text-base flex items-center gap-2",children:[e.jsx(gt,{className:"h-4 w-4 text-warning"}),"Actionable Insights"]})}),e.jsx(z,{children:t.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Be,{className:"h-8 w-8 mx-auto mb-2 text-success opacity-50"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Everything looks great! ð"})]}):e.jsx("div",{className:"space-y-2.5 max-h-[350px] overflow-y-auto pr-1",children:t.map((s,c)=>{const n=Ae[s.type]||Ae.info,o=n.icon;return e.jsx("div",{className:G("p-3 rounded-lg",n.bg),children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(o,{className:G("h-4 w-4 mt-0.5 shrink-0",n.color)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium",children:s.title}),e.jsx("p",{className:"text-caption text-muted-foreground mt-0.5",children:s.description})]}),s.metric&&e.jsx(ne,{variant:"outline",className:"shrink-0 text-micro h-5",children:s.metric})]})},c)})})})]})}function Se(t){const s=new Date;switch(t){case"30d":return{start:g(Y(s,1),"yyyy-MM-dd"),end:g(s,"yyyy-MM-dd")};case"90d":return{start:g(Y(s,3),"yyyy-MM-dd"),end:g(s,"yyyy-MM-dd")};case"6m":return{start:g(Y(s,6),"yyyy-MM-dd"),end:g(s,"yyyy-MM-dd")};case"12m":return{start:g(Y(s,12),"yyyy-MM-dd"),end:g(s,"yyyy-MM-dd")};case"ytd":return{start:`${s.getFullYear()}-01-01`,end:g(s,"yyyy-MM-dd")};default:return{start:g(Y(s,12),"yyyy-MM-dd"),end:g(s,"yyyy-MM-dd")}}}function Os(){const[t,s]=ee.useState(()=>{const o=Se("12m");return{dateRange:"12m",startDate:o.start,endDate:o.end,compareLastYear:!1}}),c=o=>
38{if(o.dateRange!==t.dateRange){const x=Se(o.dateRange);s({...o,startDate:x.start,endDate:x.end})}else s(o)},n=kt(t);return n.isLoading?e.jsx(Me,{title:"Company Pilot",subtitle:"Business intelligence dashboard",activeRoute:"/app/statistics",children:e.jsx(Qe,{})}):e.jsx(Me,{title:"Company Pilot",subtitle:"Business intelligence dashboard",activeRoute:"/app/statistics",children:e.jsxs("div",{className:"page-container-wide page-section",children:[e.jsx("div",{className:"sticky top-0 z-10 bg-background/95 backdrop-blur-sm py-3 -mt-2 border-b border-border/50",children:e.jsx(_t,{filters:t,onFiltersChange:c,properties:n.properties.map(o=>({id:o.id,name:o.name})),owners:n.owners,agents:n.agents})}),e.jsx(It,{kpis:n.kpis}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsx(Rt,{data:n.monthlyFinance}),e.jsx(Ct,{data:n.expenseBreakdown,totalExpenses:n.totalExpenses,expenseRatio:n.expenseRatio})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsx(St,{data:n.propertyRankings,onPropertyClick:o=>{var x;c({...t,propertyIds:(x=t.propertyIds)!=null&&x.includes(o)?t.propertyIds.filter(b=>b!==o):[o]})}}),e.jsx(Ft,{data:n.agentStats})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsx(Pt,{data:n.sourceStats}),e.jsx(Bt,{data:n.ownerStats}),e.jsx(Lt,{data:n.occupancyHeatmap,properties:n.properties.map(o=>({id:o.id,name:o.name}))})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsx(qt,{upcomingRevenue:n.upcomingRevenue,gapAnalysis:n.gapAnalysis}),e.jsx($t,{insights:n.insights})]})]})})}export{Os as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.