1import{r as d,j as e,t as L}from"./vendor-react-zwv87yMD.js";import{b as ge,u as he,O as s}from"./authStore-Bv6p2Ne2.js";import{u as be}from"./useOrgTimezone-C1UagyKl.js";import{k as Ne}from"./timezoneFormatters-Lg56xFv0.js";import{S as ye}from"./SendDocumentsWizard-BnveiAfO.js";import{c as fe,b as je}from"./vendor-router-DimZLiZb.js";import"./vendor-charts-CtrTLS4K.js";import"./vendor-i18n-BdYkS11p.js";import"./vendor-ui-CfDMlrKu.js";import"./vendor-pdf-DQuePnfN.js";import"./vendor-state-ByI9XJey.js";import"./vendor-editor-C_dhmuey.js";import"./api-client-wl3SCNAO.js";import"./vendor-query-DYq8g7OI.js";import"./i18n-CwjSIy0a.js";import"./vendor-icons-bLSWzydc.js";import"./employeeAuthStore-lYSKMuhw.js";import"./state-tax-MSedVyrL.js";import"./document-signing-4b_jQdUI.js";import"./business-documents-BU88rFEc.js";function $e(){const K=fe(),{workflows:c,isLoadingWorkflows:Q,fetchWorkflows:u,fetchDeletedWorkflows:ee,restoreWorkflow:te}=ge(),{permissions:R,currentRole:P,currentOrganizationId:k}=he(),C=be(),[a,x]=d.useState(()=>{const t=new URLSearchParams(window.location.search).get("status");return t==="review"?s.PENDING_REVIEW:t==="pending"?s.PENDING:"ALL"}),[se,g]=d.useState(!1),[re,S]=d.useState(void 0),[ae,O]=d.useState(void 0),[ne,W]=d.useState(void 0),[h,ie]=je();d.useEffect(()=>{const t=h.get("send"),r=h.get("employee");let n=!1;t&&(O(t),g(!0),h.delete("send"),n=!0),r&&(W(r),g(!0),h.delete("employee"),n=!0),n&&ie(h,{replace:!0})},[]);const[v,A]=d.useState([]),[de,G]=d.useState(!1),[T,_]=d.useState(null),[le,M]=d.useState(!1),b=R.includes("MANAGE_ONBOARDING"),N=R.includes("VIEW_ONBOARDING"),oe=R.includes("DELETE_ONBOARDING"),V=P==="OWNER"||P==="ADMIN";d.useEffect(()=>{A([]),M(!1),N&&k&&u()},[k,u,N]),d.useEffect(()=>{if(!N)return;const t=120*1e3;let r=null;const n=()=>{r||(r=setInterval(()=>{document.visibilityState==="visible"&&u()},t))},l=()=>{r&&(clearInterval(r),r=null)},m=()=>{document.visibilityState==="visible"?(u(),n()):l()};return document.visibilityState==="visible"&&n(),document.addEventListener("visibilitychange",m),()=>{l(),document.removeEventListener("visibilitychange",m)}},[N,u]);const me=async()=>{var t,r;if(V){G(!0);try{const n=await ee();A(n),M(!0)}catch(n){L.error(((r=(t=n.response)==null?void 0:t.data)==null?void 0:r.message)||"Failed to load archived workflows")}finally{G(!1)}}},ce=()=>{x("ARCHIVED"),le||me()},xe=async t=>{var r,n;_(t);try{await te(t),L.success("Workflow restored successfully"),A(l=>l.filter(m=>m.id!==t))}catch(l){L.error(((n=(r=l.response)==null?void 0:r.data)==null?void 0:n.message)||"Failed to restore workflow")}finally{_(null)}},w=t=>{switch(t){case s.COMPLETED:return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";case s.IN_PROGRESS:return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case s.PENDING_REVIEW:return"bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200";case s.PENDING:return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case s.DRAFT:return"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200";case s.EXPIRED:return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";case s.CANCELLED:return"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200";default:return"bg-gray-100 text-gray-800"}},F=t=>t.totalSteps===0?0:Math.round(t.completedSteps/t.totalSteps*100),D=t=>Ne(t,C,"N/A"),I=()=>{S(void 0),g(!0)},pe=t=>{var p,y,f,j,E;const r=t.employee?`${t.employee.firstName} ${t.employee.lastName}`:((p=t.contact)==null?void 0:p.name)||"Unknown",n=((y=t.employee)==null?void 0:y.email)||((f=t.contact)==null?void 0:f.email)||void 0,l=((j=t.employee)==null?void 0:j.phoneNumber)||((E=t.contact)==null?void 0:E.phone)||void 0,m=t.contactId?"contact":"employee";S([{id:t.id,recipientName:r,recipientEmail:n,recipientPhone:l??void 0,entityType:m,status:"pending"}]),g(!0)},ue=()=>{g(!1),S(void 0),O(void 0),W(void 0)},$=t=>t.status===s.PENDING_REVIEW,X=d.useMemo(()=>c.filter(t=>a===s.PENDING_REVIEW?$(t):!(a!=="ALL"&&t.status!==a)),[c,a]),i=d.useMemo(()=>({ALL:c.length,[s.PENDING_REVIEW]:c.filter(t=>$(t)).length,[s.IN_PROGRESS]:c.filter(t=>t.status===s.IN_PROGRESS).length,[s.DRAFT]:c.filter(t=>t.status===s.DRAFT).length,[s.PENDING]:c.filter(t=>t.status===s.PENDING).length,[s.COMPLETED]:c.filter(t=>t.status===s.COMPLETED).length,[s.EXPIRED]:c.filter(t=>t.status===s.EXPIRED).length,[s.CANCELLED]:c.filter(t=>t.status===s.CANCELLED).length}),[c]);
1return N?e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-bold",children:"Send & Sign"}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"Send documents, forms, and notices to sign or acknowledge"})]}),b&&e.jsx("button",{onClick:I,className:"w-full sm:w-auto px-4 py-2.5 sm:py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 text-sm font-medium whitespace-nowrap min-h-[44px] sm:min-h-0 shrink-0",children:"New Signing Request"})]}),e.jsxs("div",{className:"flex gap-1.5 sm:gap-2 flex-nowrap sm:flex-wrap items-center overflow-x-auto pb-1 -mx-1 px-1",children:[e.jsxs("button",{onClick:()=>x("ALL"),title:"View all assignments regardless of status",className:`px-2.5 sm:px-3 py-2 sm:py-1.5 rounded-md text-xs sm:text-sm font-medium transition-colors shrink-0 whitespace-nowrap min-h-[44px] sm:min-h-0 ${a==="ALL"?"bg-primary text-primary-foreground":"bg-card text-muted-foreground hover:bg-accent border"}`,children:["All"," ",i.ALL>0&&e.jsxs("span",{className:"ml-1 opacity-70",children:["(",i.ALL,")"]})]}),e.jsxs("button",{onClick:()=>x(s.DRAFT),title:"Assignments created but not yet sent",className:`px-2.5 sm:px-3 py-2 sm:py-1.5 rounded-md text-xs sm:text-sm font-medium transition-colors shrink-0 whitespace-nowrap min-h-[44px] sm:min-h-0 ${a===s.DRAFT?"bg-gray-600 text-white":"bg-card text-muted-foreground hover:bg-accent border"}`,children:["Drafts"," ",i[s.DRAFT]>0&&e.jsxs("span",{className:"opacity-70",children:["(",i[s.DRAFT],")"]})]}),e.jsxs("button",{onClick:()=>x(s.PENDING),title:"Sent to employee, waiting for them to begin",className:`px-2.5 sm:px-3 py-2 sm:py-1.5 rounded-md text-xs sm:text-sm font-medium transition-colors shrink-0 whitespace-nowrap min-h-[44px] sm:min-h-0 ${a===s.PENDING?"bg-yellow-600 text-white":"bg-yellow-50 text-yellow-700 hover:bg-yellow-100 dark:bg-yellow-900/30 dark:text-yellow-300 border border-yellow-200 dark:border-yellow-800"}`,children:["Pending"," ",i[s.PENDING]>0&&e.jsxs("span",{className:"opacity-70",children:["(",i[s.PENDING],")"]})]}),e.jsxs("button",{onClick:()=>x(s.IN_PROGRESS),title:"Employee is actively working on this assignment",className:`px-2.5 sm:px-3 py-2 sm:py-1.5 rounded-md text-xs sm:text-sm font-medium transition-colors shrink-0 whitespace-nowrap min-h-[44px] sm:min-h-0 ${a===s.IN_PROGRESS?"bg-blue-600 text-white":"bg-blue-50 text-blue-700 hover:bg-blue-100 dark:bg-blue-900/30 dark:text-blue-300 border border-blue-200 dark:border-blue-800"}`,children:[e.jsx("span",{className:"hidden sm:inline",children:"In "}),"Progress"," ",i[s.IN_PROGRESS]>0&&e.jsxs("span",{className:"opacity-70",children:["(",i[s.IN_PROGRESS],")"]})]}),e.jsxs("button",{onClick:()=>x(s.PENDING_REVIEW),title:"Employee has submitted, waiting for your review",className:`px-2.5 sm:px-3 py-2 sm:py-1.5 rounded-md text-xs sm:text-sm font-medium transition-colors inline-flex items-center gap-1 sm:gap-1.5 shrink-0 whitespace-nowrap min-h-[44px] sm:min-h-0 ${a===s.PENDING_REVIEW?"bg-amber-600 text-white":"bg-amber-50 text-amber-700 hover:bg-amber-100 dark:bg-amber-900/30 dark:text-amber-300 border border-amber-200 dark:border-amber-800"}`,children:[i[s.PENDING_REVIEW]>0&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-current animate-pulse"}),"Review"," ",i[s.PENDING_REVIEW]>0&&e.jsxs("span",{className:"opacity-70",children:["(",i[s.PENDING_REVIEW],")"]})]}),e.jsxs("button",{onClick:()=>x(s.COMPLETED),title:"All tasks completed and approved",className:`px-2.5 sm:px-3 py-2 sm:py-1.5 rounded-md text-xs sm:text-sm font-medium transition-colors shrink-0 whitespace-nowrap min-h-[44px] sm:min-h-0 ${a===s.COMPLETED?"bg-green-600 text-white":"bg-green-50 text-green-700 hover:bg-green-100 dark:bg-green-900/30 dark:text-green-300 border border-green-200 dark:border-green-800"}`,children:["Done"," ",i[s.COMPLETED]>0&&e.jsxs("span",{className:"opacity-70",children:["(",i[s.COMPLETED],")"]})]}),(i[s.EXPIRED]>0||a===s.EXPIRED)&&e.jsxs("button",{onClick:()=>x(s.EXPIRED),title:"Assignment link expired before employee completed",className:`px-2.5 sm:px-3 py-2 sm:py-1.5 rounded-md text-xs sm:text-sm font-medium transition-colors shrink-0 whitespace-nowrap min-h-[44px] sm:min-h-0 ${a===s.EXPIRED?"bg-red-600 text-white":"bg-card text-muted-foreground hover:bg-accent border"}`,children:["Expired"," ",i[s.EXPIRED]>0&&e.jsxs("span",{className:"opacity-70",children:["(",i[s.EXPIRED],")"]})]}),(i[s.CANCELLED]>0||a===s.CANCELLED)&&e.jsxs("button",{onClick:()=>x(s.CANCELLED),title:"Assignment was manually cancelled",className:`px-2.5 sm:px-3 py-2 sm:py-1.5 rounded-md text-xs sm:text-sm font-medium transition-colors shrink-0 whitespace-nowrap min-h-[44px] sm:min-h-0 ${a===s.CANCELLED?"bg-gray-600 text-white":"bg-card text-muted-foreground hover:bg-accent border"}`,children:["Cancelled"," ",i[s.CANCELLED]>0&&e.jsxs("span",{className:"opacity-70",children:["(",i[s.CANCELLED],")"]})]}),V&&oe&&e.jsxs("button",{onClick:ce,title:"Deleted assignments that can be restored within 30 days",className:`inline-flex px-2.5 sm:px-3 py-2 sm:py-1.5 rounded-md text-xs sm:text-sm font-medium transition-colors items-center gap-1 sm:gap-1.5 shrink-0 whitespace-nowrap min-h-[44px] sm:min-h-0 ${a==="ARCHIVED"?"bg-slate-600 text-white":"bg-slate-50 text-slate-700 hover:bg-slate-100 dar
1k:bg-slate-900/30 dark:text-slate-300 border border-slate-200 dark:border-slate-800"}`,children:["ðï¸ Archived"," ",v.length>0&&e.jsxs("span",{className:"opacity-70",children:["(",v.length,")"]})]})]}),a==="ARCHIVED"?e.jsx("div",{className:"mt-4",children:de?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent"}),e.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading archived workflows..."})]}):v.length===0?e.jsxs("div",{className:"text-center py-12 border rounded-lg bg-card",children:[e.jsx("p",{className:"text-muted-foreground mb-2",children:"No archived workflows found."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Deleted workflows can be restored within 30 days before permanent removal."})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded-lg p-3",children:e.jsx("p",{className:"text-sm text-amber-800 dark:text-amber-200",children:"â ï¸ These workflows have been deleted and will be permanently removed after 30 days. Only administrators can restore them."})}),e.jsx("div",{className:"grid gap-4",children:v.map(t=>{var r,n,l,m,p;return e.jsx("div",{className:"border rounded-lg bg-card p-4 sm:p-6 opacity-75 hover:opacity-100 transition-opacity",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 mb-2 flex-wrap",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold",children:t.employee?`${t.employee.firstName} ${t.employee.lastName}`:((r=t.contact)==null?void 0:r.name)||"Unknown"}),e.jsx("span",{className:`px-2 py-0.5 text-xs rounded ${w(t.status)}`,children:t.status.replace(/_/g," ")}),t.contact&&e.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300",children:"Contact"}),e.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-300",children:"Archived"})]}),(((n=t.employee)==null?void 0:n.email)||((l=t.contact)==null?void 0:l.email))&&e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:((m=t.employee)==null?void 0:m.email)||((p=t.contact)==null?void 0:p.email)}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Deleted:"})," ",new Date(t.deletedAt).toLocaleDateString(void 0,{timeZone:C})," ","at"," ",new Date(t.deletedAt).toLocaleTimeString(void 0,{timeZone:C})]}),t.deleteReason&&e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Reason:"})," ",t.deleteReason]})]}),e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded text-sm text-amber-700 dark:text-amber-300",children:[e.jsx("span",{children:"â±ï¸"}),e.jsxs("span",{children:[t.daysUntilPermanentDeletion," days until permanent deletion"]})]})]}),e.jsx("button",{onClick:()=>xe(t.id),disabled:T===t.id,className:"w-full sm:w-auto px-4 py-2.5 sm:py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 flex items-center justify-center gap-2",children:T===t.id?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-solid border-current border-r-transparent"}),"Restoring..."]}):e.jsx(e.Fragment,{children:"â©ï¸ Restore"})})]})},t.id)})})]})}):Q?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent"}),e.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading workflows..."})]}):X.length===0?e.jsx("div",{className:"border rounded-lg bg-card",children:a===s.DRAFT&&b?e.jsx("div",{className:"p-8",children:e.jsxs("div",{onClick:I,className:"border-2 border-dashed border-primary/30 rounded-lg p-8 text-center cursor-pointer hover:border-primary/50 hover:bg-primary/5 transition-colors",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:e.jsx("svg",{className:"w-6 h-6 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Create an Assignment"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:"Select employees and a package to create a new assignment. You can review it here before sending."})]})}):e.jsxs("div",{className:"text-center py-16 px-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mx-auto mb-4",children:e.jsx("svg",{className:"w-8 h-8 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),a==="ALL"?e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No assignments yet"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto mb-6",children:"Send documents and forms to employees or contacts for signing. Create a document package first, then send it here."}),b&&e.jsx("button",{onClick:I,className:"px-5 py-2.5 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 font-medium",children:"New Signing Request"})]}):e.jsx("p",{className:"text-muted-foreground",children:a===s.DRAFT?"No draft assignments":`No ${a.toLowerCase().replace("_"," ")} assignments`})]})}):e.jsxs("div",{className:"grid gap-4",children:[a===s.DRAFT&&b&&e.jsx("div",{onClick:I,className:"border-2 border-dashed border-primary/30 rounded-lg p-6 text-center cursor-pointer hover:border-primary/50 hover:bg-primary/5 transition-colors",children:e.jsxs("div",{className:"flex items-center justify-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx("svg",{className:"w-5 h-5 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}),e.jsxs("div",{className:"text-left",children:[e.jsx("h3",{className:"font-semibold",children:"Create Another Assignment"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select employees and a package to create a new assignment"})]})]})}),X.map(t=>{var f,j,E,z,B,H,U,q,Y,Z,J;const r=((f=t.formData)==null?void 0:f.filter(o=>o.reviewStatus==="PENDING_REVIEW").length)||0,n=((j=t.formData)==null?void 0:j.filter(o=>o.reviewStatus==="NEEDS_CORRECTIONS").length)||0,l=((E=t.formData)==null?void 0:E.filter(o=>o.reviewStatus==="APPROVED").length)||0,m=((z=t.formData)==null?void 0:z.length)||0,p=((B=t.documentSigningInstances)==null?void 0:B.filter(o=>o.currentSignerRole==="REVIEWER"&&o.status!=="COMPLETED"&&o.status!=="VOIDED").length)||0,y=((H=t.documentSigningInstances)==null?void 0:H.filter(o=>o.reviewStatus==="PENDING_REVIEW").length)||0;return e.jsxs("div",{onClick:()=>K(`/dashboard/document-signing/${t.id}`),className:"border rounded-lg bg-card p-4 sm:p-6 hover:shadow-md transition-shadow cursor-pointer",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-1 truncate",children:t.employee?`${t.employee.firstName} ${t.employee.lastName}`:((U=t.contact)==null?void 0:U.name)||"Unknown"}),(((q=t.employee)==null?void 0:q.email)||((Y=t.contact)==null?void 0:Y.email))&&e.jsx("p",{className:"text-sm text-muted-foreground mb-2 truncate",children:((Z=t.employee)==null?void 0:Z.email)||((J=t.contact)==null?void 0:J.email)}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-wrap",children:[e.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${w(t.status)}`,children:t.status.replace(/_/g," ")}),t.contactId&&e.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300",children:"Contact"}),r>0&&e.jsxs("span",{className:"px-2 py-1 rounded text-xs font-medium bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200 inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 animate-pulse"}),r," to review"]}),p>0&&e.jsxs("span",{className:"px-2 py-1 rounded text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200 inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-500 animate-pulse"}),p," e-doc to complete"]}),y>0&&e.jsxs("span",{className:"px-2 py-1 rounded text-xs font-medium bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200 inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-purple-500 animate-pulse"}),y," e-doc review"]}),n>0&&e.jsxs("span",{className:"px-2 py-1 rounded text-xs font-medium bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200 inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500"}),n," awaiting fixes"]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Created ",D(t.createdAt)]})]})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsxs("div",{className:"text-xl sm:text-2xl font-bold text-primary",children:[F(t),"%"]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[t.completedSteps," / ",t.totalSteps," tasks"]}),m>0&&e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[l,"/",m," forms approved"]})]})]}),e.jsx("div",{className:"mb-4",children:e.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2",children:e.jsx("div",{className:`h-2 rounded-full transition-all ${t.status===s.COMPLETED?"bg-green-500":t.status===s.PENDING_REVIEW?"bg-amber-500":"bg-primary"}`,style:{width:`${F(t)}%`}})})}),t.status===s.DRAFT&&b&&e.jsxs("div",{className:"mb-4 p-3 bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 rounded-lg flex flex-col sm:flex-row sm:items-center justify-between gap-2 sm:gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-blue-800 dark:text-blue-200",children:[e.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})}),e.jsx("span",{children:"Ready to send signing link"})]}),e.jsx("button",{onClick:o=>{o.stopPropagation(),pe(t)},className:"w-full sm:w-auto px-3 py-2 sm:py-1.5 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 min-h-[44px] sm:min-h-0",children:"Review & Send â"})]}),(t.sentAt||t.startedAt||t.completedAt)&&e.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-1 text-sm",children:[t.sentAt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Sent: "}),e.jsx("span",{className:"font-medium",children:D(t.sentAt)})]}),t.startedAt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Started: "}),e.jsx("span",{className:"font-medium",children:D(t.startedAt)})]}),t.completedAt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Completed: "}),e.jsx("span",{className:"font-medium",children:D(t.completedAt)})]})]}),t.notes&&e.jsxs("div",{className:"mt-4 p-3 bg-accent/50 rounded text-sm",children:[e.jsx("span",{className:"font-medium",children:"Notes: "}),t.notes]})]},t.id)})]}),e.jsx(ye,{open:se,onClose:ue,onWorkflowsCreated:()=>u(),initialWorkflows:re,initialDocumentId:ae,initialEmployeeId:ne})]}):e.jsx("div",{className:"space-y-6",children:e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-muted-foreground",children:"You don't have permission to view assignments."})})})}export{$e 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.