1import{bD as M,bE as ie,r as i,y as H,A as le,j as e,u as Y,O as oe,s as G,S as q,B as N,t as w,bF as J,z as P,q as _,D as ne,d as ce,J as ge,g as xe,L,ar as U,G as me,C as be,T as ue,E as ye}from"./index-Coid6E-g.js";import{T as pe}from"./Table-BuhwMz9a.js";import{P as he}from"./Pagination-CAta2Afg.js";import{F as ke}from"./ShieldExclamationIcon-1zEf9PSj.js";import{F as fe}from"./ClockIcon-D1saSO4I.js";import{F as B}from"./DocumentDuplicateIcon-BaoVflhg.js";import{F as je}from"./LinkIcon-DSxmABd2.js";function W(r,a){const d=M(r),g=M(a),n=V(d,g),c=Math.abs(ie(d,g));d.setDate(d.getDate()-n*c);const t=+(V(d,g)===-n),l=n*(c-t);return l===0?0:l}function V(r,a){const d=r.getFullYear()-a.getFullYear()||r.getMonth()-a.getMonth()||r.getDate()-a.getDate()||r.getHours()-a.getHours()||r.getMinutes()-a.getMinutes()||r.getSeconds()-a.getSeconds()||r.getMilliseconds()-a.getMilliseconds();return d<0?-1:d>0?1:d}function ve({title:r,titleId:a,...d},g){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:g,"aria-labelledby":a},d),r?i.createElement("title",{id:a},r):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z"}))}const Z=i.forwardRef(ve),Ne=({stats:r})=>{const a=[{title:"Total Requests",value:r.total,icon:Z,borderColor:"border-l-gray-400 dark:border-l-gray-500",iconBg:"bg-gray-100 dark:bg-gray-700",iconColor:"text-gray-500 dark:text-gray-400",valueColor:"text-gray-900 dark:text-gray-100",bgColor:"bg-white dark:bg-gray-800"},{title:"Awaiting Verification",value:r.pendingVerification,icon:ke,borderColor:"border-l-gray-400 dark:border-l-gray-500",iconBg:"bg-gray-100 dark:bg-gray-700",iconColor:"text-gray-500 dark:text-gray-400",valueColor:"text-gray-900 dark:text-gray-100",bgColor:"bg-white dark:bg-gray-800"},{title:"Pending",value:r.new+r.inReview,icon:fe,borderColor:"border-l-amber-400 dark:border-l-amber-500",iconBg:"bg-amber-100 dark:bg-amber-900/30",iconColor:"text-amber-600 dark:text-amber-400",valueColor:"text-amber-900 dark:text-amber-100",bgColor:"bg-white dark:bg-gray-800"},{title:"Overdue",value:r.overdue,icon:H,borderColor:r.overdue>0?"border-l-red-500 dark:border-l-red-400":"border-l-gray-400 dark:border-l-gray-500",iconBg:r.overdue>0?"bg-red-100 dark:bg-red-900/30":"bg-gray-100 dark:bg-gray-700",iconColor:r.overdue>0?"text-red-600 dark:text-red-400":"text-gray-500 dark:text-gray-400",valueColor:r.overdue>0?"text-red-700 dark:text-red-300":"text-gray-900 dark:text-gray-100",bgColor:r.overdue>0?"bg-red-50/50 dark:bg-red-950/10":"bg-white dark:bg-gray-800",ring:r.overdue>0},{title:"Avg Response Time",value:r.avgResponseTimeDays!==null?`${r.avgResponseTimeDays}d`:"--",icon:le,borderColor:"border-l-primary-400 dark:border-l-primary-500",iconBg:"bg-primary-100 dark:bg-primary-900/30",iconColor:"text-primary-600 dark:text-primary-400",valueColor:"text-gray-900 dark:text-gray-100",bgColor:"bg-white dark:bg-gray-800"}];return e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-4",children:a.map(d=>e.jsxs("div",{className:`${d.bgColor} rounded-lg border border-gray-200 dark:border-gray-700 border-l-4 ${d.borderColor} p-4 shadow-sm transition-shadow hover:shadow-md ${d.ring?"ring-2 ring-red-300 dark:ring-red-700 animate-pulse":""}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:`p-2 rounded-lg ${d.iconBg}`,children:e.jsx(d.icon,{className:`w-5 h-5 ${d.iconColor}`})}),e.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:d.title})]}),e.jsx("p",{className:`text-3xl font-bold ${d.valueColor}`,children:d.value})]},d.title))})}
1,we={pending_verification:{label:"Awaiting Verification",dotColor:"bg-gray-400 animate-pulse",bgColor:"bg-gray-100 dark:bg-gray-700/50",textColor:"text-gray-600 dark:text-gray-300"},new:{label:"New",dotColor:"bg-blue-500",bgColor:"bg-blue-50 dark:bg-blue-900/30",textColor:"text-blue-700 dark:text-blue-300"},in_review:{label:"In Review",dotColor:"bg-amber-500",bgColor:"bg-amber-50 dark:bg-amber-900/30",textColor:"text-amber-700 dark:text-amber-300"},processing:{label:"Processing",dotColor:"bg-purple-500",bgColor:"bg-purple-50 dark:bg-purple-900/30",textColor:"text-purple-700 dark:text-purple-300"},completed:{label:"Completed",dotColor:"bg-green-500",bgColor:"bg-green-50 dark:bg-green-900/30",textColor:"text-green-700 dark:text-green-300"},denied:{label:"Denied",dotColor:"bg-red-500",bgColor:"bg-red-50 dark:bg-red-900/30",textColor:"text-red-700 dark:text-red-300"}},K=({status:r})=>{const a=we[r];return e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium ${a.bgColor} ${a.textColor}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${a.dotColor}`}),a.label]})},Ce={pending_verification:["denied"],new:["in_review","denied"],in_review:["processing","denied"],processing:["completed","denied"],completed:[],denied:[]},O={pending_verification:"Awaiting Verification",new:"New",in_review:"In Review",processing:"Processing",completed:"Completed",denied:"Denied"},Se=({deadline:r})=>{const a=i.useMemo(()=>{if(!r)return{color:"text-gray-500 dark:text-gray-400",bgColor:"bg-gray-50 dark:bg-gray-800/50 border border-gray-200 dark:border-gray-700",label:"Awaiting verification"};const d=new Date,g=J(r),n=W(g,d);let c="text-green-600 dark:text-green-400",t="bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800";n<0||n<5?(c="text-red-600 dark:text-red-400",t="bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800"):n<10&&(c="text-amber-600 dark:text-amber-400",t="bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800");const l=n<0?`${Math.abs(n)} days overdue`:n===0?"Due today":`${n} days remaining`;return{color:c,bgColor:t,label:l}},[r]);return e.jsx("div",{className:`mt-1 inline-flex items-center px-2.5 py-1 rounded-md text-sm font-medium ${a.bgColor} ${a.color}`,children:a.label})},De=({isOpen:r,onClose:a,domainId:d,requestId:g,onStatusUpdated:n})=>{const{t:c}=Y(),[t,l]=i.useState(null),[f,p]=i.useState(!1),[h,m]=i.useState(null),[u,x]=i.useState(""),[C,S]=i.useState(""),[j,v]=i.useState(!1);i.useEffect(()=>{if(!r||!g)return;(async()=>{p(!0),m(null);try{const y=await w.getConsumerRequest(d,g);l(y),x(y.status)}catch{m("Failed to load request details")}finally{p(!1)}})()},[r,d,g]);const D=async()=>{if(!(!t||!u||u===t.status)){v(!0);try{await w.updateConsumerRequestStatus(d,t.id,u,C||void 0),P.success(c("toasts.dsarStatusUpdated")),S(""),n(),a()}catch{P.error(c("toasts.dsarStatusUpdateError"))}finally{v(!1)}}},R=t?Ce[t.status]:[],A=t?[{value:t.status,label:`${O[t.status]} (current)`},...R.map(o=>({value:o,label:O[o]}))]:[];return e.jsx(oe,{isOpen:r,onClose:a,title:c("dsarDetail.title"),size:"large",children:f?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):h?e.jsx("p",{className:"text-sm text-red-600",children:h}):t?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-gradient-to-r from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-750 border border-gray-200 dark:border-gray-700 px-4 py-3",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsx("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-xs font-semibold ${t.type==="access"?"bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300 ring-1 ring-blue-300 dark:ring-blue-700":"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 ring-1 ring-red-300 dark:ring-red-700"}`,children:t.type==="access"?"Data Access Request":"Data Deletion Request"})}),e.jsx(K,{status:t.status})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Email"}),e.jsx("p",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:t.email})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Verified"}),e.jsx("p",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:t.verified?"Yes":"Not yet - awaiting confirmation email"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Submitted"}),e.jsx("p",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:q(t.createdAt)})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:["SLA Deadline (",t.slaDays," days)"]}),e.jsx(Se,{deadline:t.slaDeadline})]})]}),t.dataCategories&&t.dataCategories.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-1",children:"Data Categories"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.dataCategories.map(o=>e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300",children:o},o))})]}),t.denialReason&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-1",children:"Denial Reason"}),e.jsx("p",{className:"text-sm text-red-700 dark:text-red-300 bg-red-50 dark:bg-red-900/20 rounded-lg p-3 border border-red-200 dark:border-red-800",children:t.denialReason})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:e.jsx("div",{className:"w-full border-t border-gray-200 dark:border-gray-700"})}),e.jsx("div",{className:"relative flex justify-center",children:e.jsx("span",{className:"bg-white dark:bg-gray-900 px-3 text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider",children:"Update Status"})})]}),e.jsx("div",{className:"bg-gray-50 dark:bg-gray-800/50 rounded-lg border border-gray-200 dark:border-gray-700 p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"dsar-status",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"New Status"}),e.jsx("select",{id:"dsar-status",value:u,onChange:o=>x(o.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-primary-500 focus:border-transparent",children:A.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"dsar-notes",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Notes (optional)"}),e.jsx("textarea",{id:"dsar-notes",value:C,onChange:o=>S(o.target.value),rows:3,placeholder:c("dsarDetail.notesPlaceholder"),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),e.jsx(N,{onClick:D,isLoading:j,disabled:j||u===t.status,size:"small",children:"Update Status"})]})}),t.auditTrail&&t.auditTrail.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:e.jsx("div",{className:"w-full border-t border-gray-200 dark:border-gray-700"})}),e.jsx("div",{className:"relative flex justify-center",children:e.jsx("span",{className:"bg-white dark:bg-gray-900 px-3 text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider",children:"Audit Trail"})})]}),e.jsx("div",{className:"space-y-0",children:t.auditTrail.map((o,y)=>e.jsxs("div",{className:`relative pl-8 pb-4 ${y<t.auditTrail.length-1?"border-l-2 border-gray-200 dark:border-gray-700 ml-[5px]":"ml-[5px]"}`,children:[e.jsx("div",{className:"absolute left-[-7px] top-0 w-3 h-3 rounded-full bg-primary-500 dark:bg-primary-400 ring-4 ring-white dark:ring-gray-900"}),e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:o.action.replace(/[:_]/g," ")}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:q(o.timestamp)})]}),o.actor&&e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["by ",o.actor]}),typeof o.changes?.notes=="string"&&o.changes.notes&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mt-1 bg-gray-50 dark:bg-gray-800/50 rounded px-2 py-1",children:o.changes.notes})]},o.id))})]})]}):null})},Re=({domainId:r})=>{const[a,d]=i.useState(null),[g,n]=i.useState(!0),[c,t]=i.useState(null),[l,f]=i.useState(null);i.useEffect(()=>{(async()=>{n(!0),t(null);try{const m=await w.getDSAREmbedSnippet(r);d(m)}catch{t("Failed to load embed snippet")}finally{n(!1)}})()},[r]);const p=async(h,m)=>{try{await navigator.clipboard.writeText(h),f(m),setTimeout(()=>f(null),2e3)}catch{}};return g?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):c?e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:c})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-xl p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"DSAR Request Form Embed"}),e.jsxs("p",{className:"text-blue-800 dark:text-blue-200",children:["Embed a data subject access request form on your website - or link straight to a hosted page - so visitors can submit privacy requests (data access or deleti
1on) directly. Submissions require the requester to confirm via email before they appear in this dashboard, and we'll respond within"," ",a?.slaDays??30," days."]})]}),a?.hostedUrl&&e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-gray-900 dark:text-gray-100",children:"Hosted Request Page"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"No embedding needed - link to this branded page from your privacy policy"})]}),e.jsxs(N,{size:"small",variant:"outline",onClick:()=>p(a.hostedUrl,"hosted-url"),children:[l==="hosted-url"?e.jsx(_,{className:"w-4 h-4 mr-1 text-green-600"}):e.jsx(B,{className:"w-4 h-4 mr-1"}),l==="hosted-url"?"Copied!":"Copy Link"]})]})}),e.jsxs("div",{className:"flex items-center gap-2 p-4 bg-white dark:bg-gray-900",children:[e.jsx(je,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),e.jsx("a",{href:a.hostedUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary-600 dark:text-primary-400 hover:underline break-all",children:a.hostedUrl})]})]}),a?.snippet&&e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-gray-900 dark:text-gray-100",children:"HTML Embed Code"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Add this to your privacy or contact page"})]}),e.jsxs(N,{size:"small",variant:"outline",onClick:()=>p(a.snippet,"html"),children:[l==="html"?e.jsx(_,{className:"w-4 h-4 mr-1 text-green-600"}):e.jsx(B,{className:"w-4 h-4 mr-1"}),l==="html"?"Copied!":"Copy Code"]})]})}),e.jsx("pre",{className:"bg-gray-900 text-gray-100 p-4 overflow-x-auto text-sm",children:e.jsx("code",{children:a.snippet})})]}),e.jsxs("div",{className:"bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-xl p-4",children:[e.jsx("h4",{className:"font-semibold text-amber-900 dark:text-amber-100 mb-1",children:"How it works"}),e.jsxs("ul",{className:"text-sm text-amber-800 dark:text-amber-200 space-y-1",children:[e.jsx("li",{children:"1. Embed the form (or share the hosted link) on your privacy policy or contact page"}),e.jsx("li",{children:"2. Visitors submit data access or deletion requests and confirm via a one-time email link"}),e.jsx("li",{children:"3. Verified requests appear in this DSAR dashboard with SLA tracking"}),e.jsx("li",{children:"4. Process requests and update their status to stay compliant"})]})]})]})},z=10,Ie=()=>{const{t:r}=Y(),{domainId:a}=ne(),{getDomain:d}=ce(),[g,n]=i.useState(""),[c,t]=i.useState([]),[l,f]=i.useState(null),[p,h]=i.useState(0),[m,u]=i.useState(1),[x,C]=i.useState("active"),[S,j]=i.useState(!0),[v,D]=i.useState(!0),[R,A]=i.useState(null),[o,y]=i.useState(null),[Q,T]=i.useState(!1),E=i.useCallback(async()=>{if(a){D(!0);try{const s=await w.getConsumerRequestStats(a);f(s)}catch{}finally{D(!1)}}},[a]),F=i.useCallback(async()=>{if(a){j(!0),A(null);try{const s=x==="unverified"?"pending_verification":x==="active"?"new,in_review,processing":x==="completed"?"completed,denied":void 0,b=await w.getConsumerRequests(a,{status:s,page:m,limit:z});t(b.items||[]),h(b.total||0)}catch{A(r("dsar.loadError"))}finally{j(!1)}}},[a,x,m]);i.useEffect(()=>{if(!a)return;(async()=>{const b=await d(a);b&&n(b.domain)})(),E()},[a,d,E]),i.useEffect(()=>{x!=="embed"&&F()},[x,m,F]);const I=s=>{C(s),u(1)},X=s=>{y(s.id),T(!0)},ee=()=>{F(),E()},re=s=>{if(!s)return e.jsx("span",{className:"text-gray-500 dark:text-gray-400 italic",children:r("dsar.awaitingVerificationSla")});const b=new Date,de=J(s),k=W(de,b);return k<0?e.jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:r("dsar.daysOverdue",{days:Math.abs(k)})}):k<5?e.jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:r("dsar.daysLeft",{days:k})}
1):k<10?e.jsx("span",{className:"text-amber-600 dark:text-amber-400 font-medium",children:r("dsar.daysLeft",{days:k})}):e.jsx("span",{className:"text-green-600 dark:text-green-400",children:r("dsar.daysLeft",{days:k})})},ae=[{header:r("common.email"),accessor:s=>e.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:s.email})},{header:r("dsar.columnType"),accessor:s=>e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${s.type==="access"?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"bg-red-50 dark:bg-red-900/30 text-red-700 dark:text-red-300"}`,children:s.type==="access"?r("dsar.typeAccess"):r("dsar.typeDeletion")})},{header:r("common.status"),accessor:s=>e.jsx(K,{status:s.status})},{header:r("dsar.columnSubmitted"),accessor:s=>e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:q(s.createdAt)})},{header:r("dsar.columnSla"),accessor:s=>re(s.slaDeadline)},{header:r("common.actions"),accessor:s=>e.jsxs(N,{size:"small",variant:"outline",onClick:b=>{b.stopPropagation(),y(s.id),T(!0)},children:[e.jsx(ge,{className:"w-4 h-4 mr-1"}),r("common.view")]})}],te=[{key:"unverified",label:r("dsar.tabAwaitingVerification"),count:l?.pendingVerification},{key:"active",label:r("common.active"),count:l?l.new+l.inReview+l.processing:void 0},{key:"completed",label:r("dsar.tabCompleted"),count:l?l.completed+l.denied:void 0},{key:"all",label:r("common.all"),count:l?.total},{key:"embed",label:r("dsar.tabEmbedForm")}],$=l?.overdue??0,se=l?.slaDays??30;return e.jsxs(xe,{children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("nav",{className:"flex mb-4","aria-label":"Breadcrumb",children:e.jsxs("ol",{className:"flex items-center space-x-2",children:[e.jsx("li",{children:e.jsx(L,{to:"/domains",className:"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",children:r("common.domains")})}),e.jsx("li",{children:e.jsx("span",{className:"text-gray-400 mx-2",children:"/"})}),g&&e.jsxs(e.Fragment,{children:[e.jsx("li",{children:e.jsx(L,{to:`/domains/${a}`,className:"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",children:g})}),e.jsx("li",{children:e.jsx("span",{className:"text-gray-400 mx-2",children:"/"})})]}),e.jsx("li",{className:"text-gray-900 dark:text-gray-100 font-medium",children:r("dsar.breadcrumb")})]})}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-gray-100",children:r("dsar.title")}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:r("dsar.subtitle",{domain:g||r("dsar.thisDomain")})})]}),$>0&&!v&&e.jsxs("div",{className:"mb-6 flex items-center gap-3 rounded-lg border border-red-300 dark:border-red-700 bg-red-50 dark:bg-red-900/20 px-4 py-3",children:[e.jsx(H,{className:"w-5 h-5 text-red-600 dark:text-red-400 flex-shrink-0"}),e.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:r($===1?"dsar.overdueAlertOne":"dsar.overdueAlertOther",{count:$,slaDays:se})})]}),v?e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[1,2,3,4].map(s=>e.jsxs("div",{className:"card p-4 space-y-2",children:[e.jsx(U,{width:"50%",height:14}),e.jsx(U,{width:"40%",height:28})]},s))}):l?e.jsx("div",{className:"mb-6",children:e.jsx(Ne,{stats:l})}):null,e.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700 mb-6",children:e.jsx("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:te.map(s=>e.jsxs("button",{onClick:()=>I(s.key),className:`whitespace-nowrap py-3 px-1 border-b-2 text-sm font-medium transition-colors ${x===s.key?"border-primary-500 text-primary-600 dark:text-primary-400":"border-transparent text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:border-gray-300 dark:hover:border-gray-600"}`,children:[s.label,s.count!==void 0&&e.jsx("span",{className:`ml-2 inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${x===s.key?"bg-primary-100 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400":"bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400"}`,children:s.count})]},s.key))})}),x==="embed"?e.jsx(Re,{domainId:a}):e.jsxs(e.Fragment,{children:[R&&e.jsx("div",{className:"mb-6",children:e.jsx(me,{message:R})}),e.jsx(be,{children:S?e.jsx(ue,{rows:5}):c.length===0?e.jsx(ye,{icon:Z,title:r("dsar.noRequestsFound"),description:r(x==="unverified"?"dsar.emptyUnverified":x==="active"?"dsar.emptyActive":x==="completed"?"dsar.emptyCompleted":"dsar.emptyAll"),action:x!=="all"&&x!=="unverified"?e.jsx(N,{onClick:()=>
1I("embed"),children:r("dsar.setupEmbedForm")}):void 0}):e.jsxs(e.Fragment,{children:[e.jsx(pe,{columns:ae,data:c,keyExtractor:s=>s.id,onRowClick:X}),e.jsx(he,{currentPage:m,totalItems:p,itemsPerPage:z,onPageChange:u})]})})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(L,{to:`/domains/${a}`,className:"text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 transition-colors",children:["â ",r("dsar.backToDomain")]})}),e.jsx(De,{isOpen:Q,onClose:()=>{T(!1),y(null)},domainId:a,requestId:o,onStatusUpdated:ee})]})};export{Ie 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.