1import{g as U,m as H,h as q,C as x,a6 as D,k as A,u as X,a as ee,r as h,j as e,b as z,M as te,T as se,P as ae,F as K,a3 as N,a4 as G,a5 as oe}from"./main-C5Vsh36q.js";import{s as ie}from"./send-CboUYJ2O.js";import{P as ne}from"./printer-CzBdz9H6.js";import{B as le}from"./briefcase-C6wfqU8L.js";import{P as re}from"./pencil-BxBBbQbf.js";import{P as T}from"./plus-DaMYw_kG.js";import{M as de}from"./message-square-D2GNXD2Q.js";import{C as ce}from"./camera-CjmdMt6W.js";import{C as F}from"./clock-B6lY9Bqu.js";import{C as me,L as pe}from"./log-in-RtsruYek.js";const xe=U({method:"POST"}).middleware([H]).handler(q("0be09b5250344ba934422d743678cf8e086ad370b35df390ce27b84df17349fc")),he=U({method:"GET"}).middleware([H]).handler(q("d8bb111e93010e5af2a525dab2c80a38cdb8d3078599dd0522f2b7e060c382de")),I={login:"Logins",login_fail:"Failed logins",clock_in:"Clock-ins",clock_out:"Clock-outs",daily_log:"Daily logs",photo:"Photos",comment:"Comments",document:"Documents",job_created:"Jobs created",task_created:"Tasks created",co_created:"Change orders",bill_created:"Bills",audit_update:"Edits",audit_delete:"Deletes"};function i(s){return String(s??"").replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n])}function B(s){if(!s)return"0m";const n=Math.floor(s/60),a=Math.round(s%60);return n?`${n}h ${a}m`:`${a}m`}function be(s,n){const a=s.report,d=a.days.length?(a.totals.hours/a.days.length).toFixed(1):"0",m=`Activity Report â ${s.memberName}`,b=new Date(new Date(s.to).getTime()-864e5);return`<!doctype html> 2<html lang="en"> 3<head> 4<meta charset="utf-8" /> 5<title>${i(m)} â ${i(x.name)}</title> 6<meta name="viewport" content="width=device-width, initial-scale=1" /> 7<style> 8 *, *::before, *::after { box-sizing: border-box; } 9 html, body { margin: 0; padding: 0; background: #f1f5f9; color: #0f1b33; 10 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; 11 font-size: 13px; line-height: 1.45; } 12 .toolbar { position: sticky; top: 0; z-index: 10; background: #0f1b33; color: #fff; 13 padding: 10px 16px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; } 14 .toolbar .spacer { flex: 1; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 12px; } 15 .toolbar button { background: #f4b400; color: #0f1b33; border: none; padding: 8px 14px; 16 border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; } 17 .toolbar button.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4); } 18 .page { width: 8.5in; min-height: 11in; margin: 16px auto; background: #fff; 19 padding: 0.55in 0.6in; box-shadow: 0 6px 24px rgba(0,0,0,0.08); } 20 .header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; 21 padding-bottom: 14px; border-bottom: 2px solid #0f1b33; } 22 .brand { display: flex; gap: 14px; align-items: center; } 23 .brand img { height: 76px; width: auto; } 24 .brand .co-name { font-size: 18px; font-weight: 800; color: #0f1b33; letter-spacing: 0.02em; } 25 .brand .co-meta { font-size: 11px; color: #475569; line-height: 1.5; margin-top: 2px; } 26 .doc-title { text-align: right; } 27 .doc-title h1 { margin: 0; font-size: 26px; letter-spacing: 0.06em; color: #0f1b33; 28 text-transform: uppercase; font-weight: 800; } 29 .doc-title .sub { font-size: 12px; color: #475569; margin-top: 4px; } 30 .doc-title .status { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; 31 background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 700; text-transform: uppercase; 32 letter-spacing: 0.1em; } 33 34 .meta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; } 35 .meta-block h4 { margin: 0 0 6px; font-size: 10px; text-transform: uppercase; 36 letter-spacing: 0.12em; color: #94a3b8; font-weight: 700; } 37 .meta-block .val { font-size: 13px; color: #0f1b33; white-space: pre-line; } 38 39 .stats { margin-top: 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; } 40 .stat { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; } 41 .stat .lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em; color: #94a3b8; font-weight: 700; } 42 .stat .val { font-size: 18px; font-weight: 800; color: #0f1b33; margin-top: 2px; font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; } 43 .stat .hint { font-size: 9px; color: #94a3b8; margin-top: 2px; } 44 45 h2.section-h { margin: 22px 0 8px; font-size: 11px; text-transform: uppercase; 46 letter-spacing: 0.14em; color: #0f1b33; font-weight: 800; 47 border-bottom: 1px solid #e2e8f0; padding-bottom: 6px; } 48 49 table.items { width: 100%; border-collapse: collapse; } 50 table.items thead th { background: #0f1b33; color: #f4b400; font-size: 10px; text-transform: uppercase; 51 letter-spacing: 0.12em; padding: 9px 10px; text-align: left; font-weight: 700; } 52 table.items thead th.amt { text-align: right; } 53 table.items tbody td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; vertical-align: top; font-size: 12.5px; } 54 table.items tbody td.date { font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; color: #475569; width: 110px; white-space: nowrap; } 55 table.items tbody td.amt { text-align: right; font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; 56 white-space: nowrap; width: 90px; } 57 .chip { display: inline-block; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; 58 background: #f1f5f9; color: #334155; margin: 0 4px 4px 0; } 59 .job-tag { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 999px; 60 background: #fef3c7; color: #92400e; font-weight: 700; margin-left: 6px; } 61 62 .timeline { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; } 63 .ev { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #f1f5f9; font-size: 12px; page-break-inside: avoid; } 64 .ev:last-child { border-bottom: none; } 65 .ev .when { font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; color: #475569; font-size: 11px; } 66 .ev .what .ttl { font-weight: 600; color: #0f1b33; } 67 .ev .what .det { color: #64748b; font-size: 11px;
67 margin-top: 1px; } 68 69 .footer { margin-top: 30px; padding-top: 12px; border-top: 1px solid #e2e8f0; 70 text-align: center; font-size: 10.5px; color: #64748b; line-height: 1.6; } 71 .footer .lic { color: #0f1b33; font-weight: 700; letter-spacing: 0.06em; } 72 73 @media print { 74 @page { size: Letter; margin: 0.45in; } 75 html, body { background: #fff; } 76 .toolbar { display: none !important; } 77 .page { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; } 78 table, .timeline { page-break-inside: auto; } 79 tr, .ev { page-break-inside: avoid; } 80 } 81</style> 82</head> 83<body> 84 <div class="toolbar"> 85 <div class="spacer">${i(m)}</div> 86 <button class="ghost" onclick="window.close()">Close</button> 87 <button onclick="window.print()">Print / Save PDF</button> 88 </div> 89 90 <div class="page"> 91 <div class="header"> 92 <div class="brand"> 93 <img src="${n}" alt="${i(x.name)}" /> 94 <div> 95 <div class="co-name">${i(x.name)}</div> 96 <div class="co-meta"> 97 ${i(x.address)}<br/> 98 ${i(x.phone)} · ${i(x.email)}<br/> 99 ${i(x.website)} 100 </div> 101 </div> 102 </div> 103 <div class="doc-title"> 104 <h1>Activity Report</h1> 105 <div class="sub">${i(D(s.from))} â ${i(D(b.toISOString()))}</div> 106 <div class="status">Confidential</div> 107 </div> 108 </div> 109 110 <div class="meta-row"> 111 <div class="meta-block"> 112 <h4>Team Member</h4> 113 <div class="val">${[s.memberName,s.memberTitle,s.memberRoles&&s.memberRoles.length?`Roles: ${s.memberRoles.join(", ")}`:""].filter(Boolean).map(i).join("<br/>")}</div> 114 </div> 115 <div class="meta-block"> 116 <h4>Report Period</h4> 117 <div class="val">${i(D(s.from))} â ${i(D(b.toISOString()))}<br/> 118 Generated ${i(A(new Date().toISOString()))}</div> 119 </div> 120 </div> 121 122 <div class="stats"> 123 <div class="stat"><div class="lbl">Jobsite Hours</div><div class="val">${a.totals.hours.toFixed(1)}</div><div class="hint">Clock in / out</div></div> 124 <div class="stat"><div class="lbl">App Working Time</div><div class="val">${B(a.totals.appMinutes)}</div><div class="hint">${a.totals.sessions} session${a.totals.sessions===1?"":"s"}</div></div> 125 <div class="stat"><div class="lbl">Activities</div><div class="val">${a.totals.events}</div></div> 126 <div class="stat"><div class="lbl">Days Active</div><div class="val">${a.days.length}</div><div class="hint">Avg ${d} hrs/day</div></div> 127 <div class="stat"><div class="lbl">Jobs Touched</div><div class="val">${a.jobs.length}</div></div> 128 </div> 129 130 <h2 class="section-h">By Job</h2> 131 <table class="items"> 132 <thead> 133 <tr> 134 <th>Job</th> 135 <th class="amt">Jobsite Hrs</th> 136 <th class="amt">Activities</th> 137 <th>Breakdown</th> 138 </tr> 139 </thead> 140 <tbody> 141 ${a.jobs.length===0?'<tr><td colspan="4" style="text-align:center; color:#94a3b8; padding:20px">No job-related activity in this range.</td></tr>':a.jobs.map(r=>` 142 <tr> 143 <td style="font-weight:600">${i(r.jobName)}</td> 144 <td class="amt">${r.hours.toFixed(2)}</td> 145 <td class="amt">${r.events}</td> 146 <td>${Object.entries(r.counts).map(([l,f])=>`<span class="chip">${i(I[l]??l)}: ${f}</span>`).join("")}</td> 147 </tr>`).join("")} 148 </tbody> 149 </table> 150 151 <h2 class="section-h">Daily Breakdown</h2> 152 <table class="items"> 153 <thead> 154 <tr> 155 <th>Date</th> 156 <th class="amt">Jobsite Hrs</th> 157 <th class="amt">App Time</th> 158 <th>Activity</th> 159 </tr> 160 </thead> 161 <tbody> 162 ${a.days.length===0?'<tr><td colspan="4" style="text-align:center; color:#94a3b8; padding:20px">No activity in this range.</td></tr>':a.days.map(r=>` 163 <tr> 164 <td class="date">${i(r.date)}</td> 165 <td class="amt">${r.hours.toFixed(2)}</td> 166 <td class="amt">${i(B(r.appMinutes))}</td> 167 <td>${Object.entries(r.counts).map(([l,f])=>`<span class="chip">${i(I[l]??l)}: ${f}</span>`).join("")}</td> 168 </tr>`).join("")} 169 </tbody> 170 </table> 171 172 <h2 class="section-h">Timeline (${a.events.length} ${a.events.length===1?"event":"events"})</h2> 173 <div class="timeline"> 174 ${a.events.length===0?'<div style="text-align:center; color:#94a3b8; padding:20px">No events.</div>':a.events.map(r=>` 175 <div class="ev"> 176 <div class="when">${i(A(r.at))}</div> 177 <div class="what"> 178 <div class="ttl">${i(r.title)}
178${r.jobName?`<span class="job-tag">${i(r.jobName)}</span>`:""}</div> 179 ${r.detail?`<div class="det">${i(r.detail)}</div>`:""} 180 </div> 181 </div>`).join("")} 182 </div> 183 184 <div class="footer"> 185 <div><strong>${i(x.name)}</strong> · ${i(x.address)} · ${i(x.phone)} · ${i(x.email)}</div> 186 <div class="lic">Licensed: ${i(x.licenses)}</div> 187 <div style="margin-top:6px; font-style:italic;">Confidential â for internal management use only.</div> 188 </div> 189 </div> 190</body> 191</html>`}async function ue(){try{const n=await(await fetch(x.logoUrl)).blob();return await new Promise((a,d)=>{const m=new FileReader;m.onload=()=>a(m.result),m.onerror=d,m.readAsDataURL(n)})}catch{return x.logoUrl}}async function ge(s){const n=await ue(),a=be(s,n),d=window.open("","_blank");if(!d){alert("Please allow pop-ups to view the PDF.");return}d.document.open(),d.document.write(a),d.document.close()}function E(s){if(!s)return"0m";const n=Math.floor(s/60),a=Math.round(s%60);return n?`${n}h ${a}m`:`${a}m`}const fe={login:pe,login_fail:me,clock_in:F,clock_out:F,daily_log:K,photo:ce,comment:de,document:ae,job_created:T,task_created:T,co_created:T,bill_created:T,audit_update:re,audit_delete:se},J={login:"Logins",login_fail:"Failed logins",clock_in:"Clock-ins",clock_out:"Clock-outs",daily_log:"Daily logs",photo:"Photos",comment:"Comments",document:"Documents",job_created:"Jobs created",task_created:"Tasks created",co_created:"Change orders",bill_created:"Bills",audit_update:"Edits",audit_delete:"Deletes"};function O(){return G()}function R(s){const n=new Date(N(G())),a=new Date(n.getTime()-s*864e5),d=new Intl.DateTimeFormat("en-CA",{timeZone:oe,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(a),m=d.find(l=>l.type==="year").value,b=d.find(l=>l.type==="month").value,r=d.find(l=>l.type==="day").value;return`${m}-${b}-${r}`}function L(s,n){const[a,d,m]=s.split("-").map(Number);return new Date(Date.UTC(a,d-1,m+n)).toISOString().slice(0,10)}function Ae(){const{session:s,loading:n,roles:a}=X(),d=ee(),m=a.includes("owner"),[b,r]=h.useState([]),[l,f]=h.useState(""),[v,C]=h.useState(R(7)),[y,S]=h.useState(O()),[o,Z]=h.useState(null),[$,k]=h.useState(!1),[M,j]=h.useState(null);h.useEffect(()=>{!n&&!s&&d({to:"/login"})},[n,s,d]),h.useEffect(()=>{!s||!m||he().then(t=>{r(t),t.length&&!l&&f(t[0].id)}).catch(t=>j(t.message))},[s,m]);const P=async()=>{if(l){k(!0),j(null);try{const t=N(v),p=N(L(y,1)),g=await xe({data:{userId:l,from:t,to:p}});Z(g)}catch(t){j(t.message??"Failed to load")}finally{k(!1)}}};h.useEffect(()=>{l&&P()},[l]);const u=h.useMemo(()=>b.find(t=>t.id===l),[b,l]),W=async()=>{!o||!u||await ge({memberName:u.name,memberTitle:u.title,memberRoles:u.roles,from:N(v),to:N(L(y,1)),report:o})},Y=async()=>{if(!o||!u)return;const t=s?.user?.email??"",p=window.prompt("Send report to (email):",t);if(!p)return;const g=window.prompt("Optional message to include:","")??"";k(!0),j(null);try{const _=o.days.map(c=>({date:c.date,hours:c.hours,appMinutes:c.appMinutes,counts:c.counts})),Q=o.jobs.map(c=>({jobId:c.jobId,jobName:c.jobName,events:c.events,hours:c.hours,counts:c.counts})),V=o.events.slice(0,50).map(c=>({at:c.at,title:c.title,detail:c.detail,kind:c.kind,jobName:c.jobName}));await ie({templateName:"activity-report",recipientEmail:p,idempotencyKey:`activity-${l}-${v}-${y}-${Date.now()}`,templateData:{memberName:u.name,memberTitle:u.title,memberRoles:u.roles,fromDate:v,toDate:y,totalHours:o.totals.hours,totalEvents:o.totals.events,daysActive:o.days.length,avgHoursPerDay:o.days.length?o.totals.hours/o.days.length:0,appMinutes:o.totals.appMinutes,sessions:o.totals.sessions,jobsTouched:o.jobs.length,days:_,jobs:Q,recentEvents:V,totalEventsCount:o.events.length,senderName:s?.user?.email??void 0,message:g||void 0}}),alert(`Report sent to ${p}.`)}catch(_){j(_.message??"Failed to send email")}finally{k(!1)}};return n||!s?e.jsx("div",{className:"min-h-screen flex items-center justify-center text-sm text-muted-foreground",children:"Loadingâ¦"}):m?e.jsxs("div",{className:"min-h-screen bg-background text-foreground p-4 md:p-8 max-w-6xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6 gap-3 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Team activity"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Per-user performance report. Owner-only."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:W,disabled:!o||$,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded border bg-card text-sm font-semibold hover:bg-muted disabled:opacity-50",title:"Open printable PDF",children:[e.jsx(ne,{className:"h-4 w-4"})," Print / PDF"]}),e.jsxs("button",{onClick:Y,disabled:!o||$,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded bg-primary text-primary-foreground text-sm font-semibold hover:opacity-90 disabled:opacity-50",title:"Email this report",children:[e.jsx(te,{className:"h-4 w-4"})," Email"]}),e.jsx(z,{to:"/app",className:"text-sm underline ml-2",children:"â Back"})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 mb-6 grid grid-cols-1 md:grid-cols-4 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold block mb-1",children:"Team member"}
191),e.jsx("select",{value:l,onChange:t=>f(t.target.value),className:"w-full rounded border bg-background px-2 py-1.5 text-sm",children:b.map(t=>e.jsxs("option",{value:t.id,children:[t.name," ",t.title?`· ${t.title}`:""," ",t.roles.length?`(${t.roles.join(",")})`:""]},t.id))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold block mb-1",children:"From"}),e.jsx("input",{type:"date",value:v,onChange:t=>C(t.target.value),className:"w-full rounded border bg-background px-2 py-1.5 text-sm"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold block mb-1",children:"To"}),e.jsx("input",{type:"date",value:y,onChange:t=>S(t.target.value),className:"w-full rounded border bg-background px-2 py-1.5 text-sm"})]}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsx("button",{onClick:P,disabled:$,className:"px-3 py-1.5 rounded bg-primary text-primary-foreground text-sm font-semibold disabled:opacity-50",children:$?"Loadingâ¦":"Refresh"}),[7,14,30].map(t=>e.jsxs("button",{onClick:()=>{C(R(t)),S(O())},className:"px-2 py-1.5 rounded border text-xs hover:bg-muted",children:[t,"d"]},t))]})]}),M&&e.jsx("div",{className:"mb-4 p-3 rounded border border-destructive/40 bg-destructive/10 text-sm text-destructive",children:M}),o&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3 mb-6",children:[e.jsx(w,{label:"Jobsite hours",value:o.totals.hours.toFixed(1),hint:"Clock in / out"}),e.jsx(w,{label:"App working time",value:E(o.totals.appMinutes),hint:`${o.totals.sessions} session${o.totals.sessions===1?"":"s"}`}),e.jsx(w,{label:"Activities",value:String(o.totals.events)}),e.jsx(w,{label:"Days active",value:String(o.days.length)}),e.jsx(w,{label:"Jobs touched",value:String(o.jobs.length)})]}),e.jsxs("h2",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground mb-2 flex items-center gap-2",children:[e.jsx(le,{className:"h-4 w-4"})," By job"]}),e.jsx("div",{className:"rounded-lg border bg-card overflow-hidden mb-8",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/50 text-left",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2",children:"Job"}),e.jsx("th",{className:"px-3 py-2 whitespace-nowrap",children:"Jobsite hrs"}),e.jsx("th",{className:"px-3 py-2 whitespace-nowrap",children:"Activities"}),e.jsx("th",{className:"px-3 py-2",children:"Breakdown"})]})}),e.jsxs("tbody",{children:[o.jobs.map(t=>e.jsxs("tr",{className:"border-t align-top",children:[e.jsx("td",{className:"px-3 py-2 font-medium",children:t.jobName}),e.jsx("td",{className:"px-3 py-2 whitespace-nowrap",children:t.hours.toFixed(2)}),e.jsx("td",{className:"px-3 py-2 whitespace-nowrap",children:t.events}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(t.counts).map(([p,g])=>e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-muted",children:[J[p]??p,": ",g]},p))})})]},t.jobId)),o.jobs.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"px-3 py-6 text-center text-muted-foreground",children:"No job-related activity in this range."})})]})]})}),e.jsxs("h2",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:["Daily breakdown â ",u?.name]}),e.jsx("div",{className:"rounded-lg border bg-card overflow-hidden mb-8",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/50 text-left",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2",children:"Date"}),e.jsx("th",{className:"px-3 py-2 whitespace-nowrap",children:"Jobsite hrs"}),e.jsx("th",{className:"px-3 py-2 whitespace-nowrap",children:"App time"}),e.jsx("th",{className:"px-3 py-2",children:"Activity"})]})}),e.jsxs("tbody",{children:[o.days.map(t=>e.jsxs("tr",{className:"border-t align-top",children:[e.jsx("td",{className:"px-3 py-2 whitespace-nowrap font-medium",children:t.date}),e.jsx("td",{className:"px-3 py-2 whitespace-nowrap",children:t.hours.toFixed(2)}),e.jsx("td",{className:"px-3 py-2 whitespace-nowrap",children:E(t.appMinutes)}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(t.counts).map(([p,g])=>e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-muted",children:[J[p]??p,": ",g]},p))})})]},t.date)),o.days.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"px-3 py-6 text-center text-muted-foreground",children:"No activity in this range."})})]})]})}),e.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:"Timeline"}),e.jsxs("div",{className:"rounded-lg border bg-card divide-y",children:[o.events.map((t,p)=>{const g=fe[t.kind]??K;return e.jsxs("div",{className:"flex items-start gap-3 px-3 py-2.5",children:[e.jsx("div",{className:"mt-0.5 h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:e.jsx(g,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-sm font-medium",children:[t.title,t.jobName&&e.jsx("span",{className:"ml-2 text-xs px-1.5 py-0.5 rounded bg-primary/10 text-primary font-semibold",children:t.jobName})]}),t.detail&&e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:t.detail})]}),e.jsx("div",{className:"text-xs text-muted-foreground whitespace-nowrap",children:A(t.at)})]},p)}),o.events.length===0&&e.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:"No events."})]})]})]}):e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Owners only."}),e.jsx(z,{to:"/app",className:"text-sm underline",children:"Back to app"})]})}function w({label:s,value:n,hint:a}){return e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s}),e.jsx("div",{className:"text-2xl font-bold mt-1",children:n}),a&&e.jsx("div",{className:"text-[10px] text-muted-foreground mt-1",children:a})]})}export{Ae as component};
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.