1import{j as e}from"./ui-CMTTTAxa.js";import{a as o}from"./vendor-BDindXV3.js";import{n as D,s as J}from"./sendKey-B5jjAEZp.js";import{u as Q,y as ee,H as B,L as z,s as b,t as u}from"./index-Bqrg_C6x.js";import{c as X}from"./auditLog-2drJP7iA.js";import{d as te}from"./downloadFile-cfGiYll6.js";import{R as re}from"./refresh-cw-BT4SDfzU.js";import{P as se}from"./plus-WgQwEo1z.js";import{F}from"./file-text-BsGfDO2N.js";import{D as P}from"./download-Db7EzTEf.js";import{M as V}from"./mail-Fao2IFo4.js";import{U as G}from"./upload-9zjHSCi3.js";import{T as ae}from"./trash-2-CIngIOnQ.js";import{X as W}from"./x-YAgHnB88.js";import{S as oe}from"./send-CAuZIzc6.js";import"./supabase-Czj9ajwo.js";const I="firm-documents",ne=50*1024*1024,q=["Lending","Trust & Legal","Compliance","Marketing","Onboarding","Other"],K=[{value:"loan_application",label:"Loan Application"},{value:"asset_declaration",label:"Asset Declaration"},{value:"lending_agreement",label:"Lending Agreement"},{value:"engagement_letter",label:"Engagement Letter"},{value:"change_of_trustee",label:"Change of Trustee"},{value:"assignment_of_assets",label:"Assignment of Assets"},{value:"cpa_acknowledgment",label:"CPA Acknowledgment"},{value:"other",label:"Other"}],le=new Set(["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/msword","image/png","image/jpeg","image/svg+xml"]),de=".pdf,.docx,.doc,.png,.jpg,.jpeg,.svg";function Y(a){return a?a<1024?`${a} B`:a<1024*1024?`${Math.round(a/1024)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`:""}function ie(a){return a?new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"â"}function ce(a){return a.replace(/[^a-zA-Z0-9._-]/g,"_")}function me(a){const r=new Uint8Array(a);let n="";const f=32768;for(let g=0;g<r.length;g+=f)n+=String.fromCharCode.apply(null,r.subarray(g,g+f));return btoa(n)}const ue={pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",doc:"application/msword",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",svg:"image/svg+xml"},pe=a=>ue[String(a||"").toLowerCase()]||"application/octet-stream";function Me(){const{user:a}=Q(),r=ee(a==null?void 0:a.role),[n,f]=o.useState([]),[g,k]=o.useState(!0),[c,E]=o.useState(!1),[y,T]=o.useState(0),[j,N]=o.useState("all"),[p,$]=o.useState(""),[A,w]=o.useState(null),[C,d]=o.useState(null),[x,v]=o.useState(null),[S,_]=o.useState(null),[O,M]=o.useState(null);async function s(){E(!0);const{data:t,error:l}=await b.from("document_templates").select("*").eq("is_active",!0).order("created_at",{ascending:!1});l?(console.error("[firmDocs] load failed:",l),u.error(`Load failed: ${l.message}`)):f((t||[]).map(i=>({...i,name:i.label,file_url:i.storage_path}))),k(!1),E(!1)}o.useEffect(()=>{s()},[y]);const h=o.useMemo(()=>{const t=new Set(q);return n.forEach(l=>{l.category&&t.add(l.category)}),[...t]},[n]),m=o.useMemo(()=>{let t=n;if(j!=="all"&&(t=t.filter(l=>(l.category||"Uncategorized")===j)),p.trim()){const l=p.toLowerCase();t=t.filter(i=>(i.name||"").toLowerCase().includes(l)||(i.description||"").toLowerCase().includes(l))}return t},[n,j,p]);async function L(t){w(t.id);const{data:l,error:i}=await b.storage.from(I).createSignedUrl(t.file_url,300);if(i){w(null),u.error(`Download failed: ${i.message}`);return}const R=(t.file_url.split(".").pop()||"pdf").toLowerCase(),Z=(t.name||"document").replace(/[^\w.-]+/g,"_").replace(/^_+|_+$/g,"")||"document";await te(l.signedUrl,`${Z}.${R}`),w(null)}async function U(){if(!S)return;d(S.id);const t=S;_(null);const[{error:l},{error:i}]=await Promise.all([b.storage.from(I).remove([t.file_url]),b.from("document_templates").delete().eq("id",t.id)]);if(d(null),i){u.error(`Delete failed: ${i.message}`);return}l&&console.warn("[firmDocs] storage delete failed (metadata removed):",l),X({docId:t.id,action:"delete",before:t,user:a}),u.success("Document deleted"),T(R=>R+1)}return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Firm Documents"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Internal blank-form templates the team can re-use. Lending agreements, trust documents, marketing collateral, etc. Distinct from client-specific uploads."})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(H,{label:"All",active:j==="all",count:n.length,onClick:()=>N("all")}),h.map(t=>{const l=n.filter(i=>(i.category||"Uncategorized")===t).length;return e.jsx(H,{label:t,active:j===t,count:l,onClick:()=>N(t)},t)}
1),e.jsx("div",{className:"flex-1"}),e.jsx("input",{type:"text",value:p,onChange:t=>$(t.target.value),placeholder:"Searchâ¦",className:"px-3 py-1.5 text-xs bg-card border border-border rounded-lg text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-[#5BC8E8]",style:{minWidth:180}}),e.jsx(B,{text:"Reloads the firm document list.",children:e.jsx("button",{onClick:s,disabled:c,className:"p-2 rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors",children:e.jsx(re,{className:`w-4 h-4 ${c?"animate-spin":""}`})})}),r&&e.jsx(B,{text:"Opens a form to add a new blank template to the firm's shared documents.",children:e.jsxs("button",{onClick:()=>v({mode:"create"}),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg bg-[#5BC8E8] text-black text-xs font-semibold hover:bg-[#4ab8d8] transition-colors",children:[e.jsx(se,{className:"w-3.5 h-3.5"}),"Upload document"]})})]}),e.jsxs("a",{href:"/sample-donation-receipt.html?print=1",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 px-4 py-3 bg-card border border-[#5BC8E8]/30 rounded-xl hover:border-[#5BC8E8]/60 transition-colors",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-[#5BC8E8]/10 border border-[#5BC8E8]/20 flex items-center justify-center flex-shrink-0",children:e.jsx(F,{className:"w-4 h-4 text-[#5BC8E8]"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium text-foreground truncate",children:["Sample Donation Receipt",e.jsx("span",{className:"ml-2 text-[9px] font-bold uppercase tracking-wide text-red-500 border border-red-500/40 rounded px-1.5 py-0.5 align-middle",children:"Sample"})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Watermarked example to show prospective clients what the official receipt looks like â not a valid receipt."})]}),e.jsxs("span",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-[#5BC8E8] text-black text-xs font-semibold flex-shrink-0",children:[e.jsx(P,{className:"w-3.5 h-3.5"}),"Download"]})]}),g?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx("div",{className:"w-6 h-6 border-3 border-muted border-t-[#5BC8E8] rounded-full animate-spin"})}):m.length===0?e.jsxs("div",{className:"text-center py-16 bg-card border border-border/50 rounded-xl",children:[e.jsx(F,{className:"w-8 h-8 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:n.length===0?"No firm documents yet":"No documents match the filter"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n.length>0?"Try a different category or clear search.":r?"Upload your first blank-form template above.":"An Owner or Admin can upload blank-form templates here."})]}):e.jsx("div",{className:"bg-card border border-border/50 rounded-xl overflow-hidden",children:e.jsx("div",{className:"divide-y divide-border/30",children:m.map(t=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-[#5BC8E8]/10 border border-[#5BC8E8]/20 flex items-center justify-center flex-shrink-0",children:e.jsx(F,{className:"w-4 h-4 text-[#5BC8E8]"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:t.name}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:[t.category,t.uploaded_by_name,ie(t.created_at),Y(t.file_size)].filter(Boolean).join(" · ")}),t.description&&e.jsx("p",{className:"text-[11px] text-muted-foreground mt-1 italic",children:t.description})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx(B,{text:"Opens an email to send this blank template as an attachment from your Gmail.",children:e.jsx("button",{onClick:()=>M(t),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors",children:e.jsx(V,{className:"w-3.5 h-3.5"})})}),e.jsx(B,{text:"Saves this template to your computer.",children:e.jsx("button",{onClick:()=>L(t),disabled:A===t.id,className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors disabled:opacity-50",children:A===t.id?e.jsx(z,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(P,{className:"w-3.5 h-3.5"})})}),r&&e.jsx(B,{text:"Uploads a new version of this template; the current version stops being the one in use.",children:e.jsx("button",{onClick:()=>v({mode:"replace",existingDoc:t}),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors",children:e.jsx(G,{className:"w-3.5 h-3.5"})})}),r&&e.jsx(B,{text:"Deletes this template and its file after you confirm. Can't be und
1one; the deletion is logged.",children:e.jsx("button",{onClick:()=>_(t),disabled:C===t.id,className:"p-1.5 rounded-md text-muted-foreground hover:text-red-500 hover:bg-red-500/10 transition-colors disabled:opacity-50",children:C===t.id?e.jsx(z,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(ae,{className:"w-3.5 h-3.5"})})})]})]},t.id))})}),x&&r&&e.jsx(fe,{mode:x.mode,existingDoc:x.existingDoc,user:a,suggestedCategories:q,onClose:()=>v(null),onSaved:()=>{v(null),T(t=>t+1)}}),S&&e.jsx(ge,{title:"Delete this document?",body:`"${S.name}" will be removed from the firm document repository. This action is logged.`,confirmLabel:"Delete",confirmTone:"danger",onCancel:()=>_(null),onConfirm:U}),O&&e.jsx(xe,{doc:O,user:a,onClose:()=>M(null)})]})}function xe({doc:a,user:r,onClose:n}){const[f,g]=o.useState(""),[k,c]=o.useState(""),[E,y]=o.useState(`${a.name} â Closehaul Capital`),[T,j]=o.useState(`Hi, 2 3Please find attached ${a.name} for your review. 4 5Best regards, 6${(r==null?void 0:r.full_name)||"Closehaul Capital"}`),[N,p]=o.useState(!1),$=o.useRef(D());async function A(){const d=f.trim();if(!d||!d.includes("@")){u.error("Enter a valid recipient email.");return}p(!0);const{data:x,error:v}=await b.storage.from(I).createSignedUrl(a.file_url,300);if(v||!(x!=null&&x.signedUrl)){p(!1),u.error("Could not read the file to attach.");return}let S="";try{const m=await fetch(x.signedUrl);if(!m.ok)throw new Error(String(m.status));S=me(await m.arrayBuffer())}catch{p(!1),u.error("Could not read the file to attach.");return}const _=(a.file_url.split(".").pop()||"pdf").toLowerCase(),M=`${(a.name||"document").replace(/[^\w.-]+/g,"_").replace(/^_+|_+$/g,"")||"document"}.${_}`,{data:s,error:h}=await b.functions.invoke("send-personal-email",{body:{from_profile_id:r==null?void 0:r.id,to_email:d,to_name:k.trim()||null,subject:E,body_text:T,attachments:[{filename:M,mimeType:pe(_),content:S,encoding:"base64"}],send_key:$.current}});if(p(!1),h){u.error("Could not send the email. Please try again.");return}if(s&&s.success===!1){const m=s.code==="NO_GOOGLE_CONNECTION"?"Connect your Google account in Settings to send email.":s.code==="GMAIL_SEND_SCOPE_MISSING"?"Reconnect Google in Settings to grant send permission.":s.details||"Could not send the email.";u.error(m);return}$.current=D(),u.success(J(s,`Sent to ${d}`)),n()}const w="text-[10px] uppercase tracking-wide text-muted-foreground font-semibold",C="mt-1.5 w-full px-3 py-2 bg-background border border-border rounded-lg text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-[#5BC8E8]";return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:e.jsxs("div",{className:"w-full max-w-md bg-card border border-border rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border/50",children:[e.jsxs("p",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4"})," Send document"]}),e.jsx("button",{type:"button",onClick:n,disabled:N,className:"text-muted-foreground hover:text-foreground disabled:opacity-50",children:e.jsx(W,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:w,children:["To ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"email",value:f,onChange:d=>g(d.target.value),placeholder:"[email protected]",className:C})]}),e.jsxs("div",{children:[e.jsxs("label",{className:w,children:["Recipient name ",e.jsx("span",{className:"normal-case font-normal text-muted-foreground",children:"(optional)"})]}),e.jsx("input",{type:"text",value:k,onChange:d=>c(d.target.value),className:C})]}),e.jsxs("div",{children:[e.jsx("label",{className:w,children:"Subject"}),e.jsx("input",{type:"text",value:E,onChange:d=>y(d.target.value),className:C})]}),e.jsxs("div",{children:[e.jsx("label",{className:w,children:"Message"}),e.jsx("textarea",{rows:5,value:T,onChange:d=>j(d.target.value),className:`${C} resize-y`,style:{lineHeight:1.5}})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-[#5BC8E8]/8 border border-border rounded-lg px-3 py-2",children:[e.jsx(P,{className:"w-3.5 h-3.5 text-[#5BC8E8]"}),"Attaching ",e.jsx("strong",{className:"text-foreground font-semibold",children:a.name})," (blank template)"]})]}),e.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border/50",children:[e.jsx("button",{type:"button",onClick:n,disabled:N,className:"px-3 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors disabled:opacity-50",children:"Cancel"}),e.jsx(B,{text:"Emails this template as an attachment to the recipient, sent from your Gmail.",children:e.jsxs("button",{type:"button",onClick:A,disabled:N,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold rounded-lg bg-[#5BC8E8] text-black hover:bg-[#4ab8d8] transition-colors disabled:opacity-50",children:[N?e.jsx(z,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(oe,{className:"w-3.5 h-3.5"}),N?"Sendingâ¦":"Send email"]})})]})]})})}function fe({mode:a,existingDoc:r,user:n,suggestedCategories:f,onClose:g,onSaved:k}){var M;const c=a==="replace",E=o.useRef(null),[y,T]=o.useState(null),[j,N]=o.useState((r==null?void 0:r.doc_type)||""),[p,$]=o.useState((r==null?void 0:r.name)||""),[A,w]=o.useState((r==null?void 0:r.category)||""),[C,d]=o.use
6State((r==null?void 0:r.description)||""),[x,v]=o.useState(!1);function S(s){var m;const h=(m=s.target.files)==null?void 0:m[0];if(h){if(h.size>ne){u.error(`${h.name} exceeds the 50 MB limit`),s.target.value="";return}if(!le.has(h.type)){u.error(`${h.name}: unsupported file type`),s.target.value="";return}if(T(h),!p.trim()){const L=h.name.replace(/\.[^.]+$/,"");$(L)}s.target.value=""}}const _=!!y&&p.trim().length>0&&(c||!!j);async function O(){if(!_||x)return;v(!0);const s=c?r.doc_type:j,h=ce(y.name),m=`${Date.now()}_${h}`,{error:L}=await b.storage.from(I).upload(m,y);if(L){u.error(`Upload failed: ${L.message}`),v(!1);return}const{data:U}=await b.from("document_templates").select("id, version").eq("doc_type",s).eq("is_active",!0).maybeSingle();let t=1;if(U){const{error:R}=await b.from("document_templates").update({is_active:!1}).eq("id",U.id);if(R){u.error(`Save failed: ${R.message}`),b.storage.from(I).remove([m]).catch(()=>{}),v(!1);return}t=(U.version||1)+1}const{data:l,error:i}=await b.from("document_templates").insert({doc_type:s,label:p.trim(),category:A.trim()||null,description:C.trim()||null,storage_path:m,version:t,is_active:!0,sensitivity:"standard"}).select().single();if(v(!1),i){u.error(`Save failed: ${i.message}`),b.storage.from(I).remove([m]).catch(()=>{}),U&&b.from("document_templates").update({is_active:!0}).eq("id",U.id).then(()=>{},()=>{});return}X({docId:l.id,action:c?"replace":"create",after:l,user:n}),u.success(c?`New version uploaded (v${t})`:"Document uploaded"),k()}return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:e.jsxs("div",{className:"w-full max-w-md bg-card border border-border rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border/50",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:c?"Replace document":"Upload firm document"}),e.jsx("button",{type:"button",onClick:g,disabled:x,className:"text-muted-foreground hover:text-foreground disabled:opacity-50",children:e.jsx(W,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"text-[10px] uppercase tracking-wide text-muted-foreground font-semibold",children:["File ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{ref:E,type:"file",accept:de,onChange:S,className:"hidden"}),e.jsx("button",{type:"button",onClick:()=>{var s;return(s=E.current)==null?void 0:s.click()},className:"mt-1.5 w-full px-3 py-2 border-2 border-dashed border-border rounded-lg text-left text-sm text-foreground hover:border-[#5BC8E8] hover:bg-secondary/40 transition-colors",children:y?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(F,{className:"w-4 h-4 text-[#5BC8E8]"}),e.jsx("span",{className:"flex-1 truncate",children:y.name}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:Y(y.size)})]}):e.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(G,{className:"w-4 h-4"}),c?"Choose new fileâ¦":"Choose fileâ¦"]})}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"PDF, DOCX, DOC, PNG, JPG, SVG · max 50 MB"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-[10px] uppercase tracking-wide text-muted-foreground font-semibold",children:["Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:p,onChange:s=>$(s.target.value),placeholder:"e.g. Lending Agreement Template",className:"mt-1.5 w-full px-3 py-2 bg-background border border-border rounded-lg text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-[#5BC8E8]"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-[10px] uppercase tracking-wide text-muted-foreground font-semibold",children:["Document type ",e.jsx("span",{className:"text-red-500",children:"*"})]}),c?e.jsxs("p",{className:"mt-1.5 text-sm text-foreground px-3 py-2 bg-background border border-border rounded-lg",children:[((M=K.find(s=>s.value===(r==null?void 0:r.doc_type)))==null?void 0:M.label)||(r==null?void 0:r.doc_type)||"â",e.jsx("span",{className:"text-[10px] text-muted-foreground ml-2",children:"· new version"})]}):e.jsxs("select",{value:j,onChange:s=>N(s.target.value),className:"mt-1.5 w-full px-3 py-2 bg-background border border-border rounded-lg text-sm text-foreground focus:outline-none focus:border-[#5BC8E8]",children:[e.jsx("option",{value:"",children:"Select a typeâ¦"}),K.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wide text-muted-foreground font-semibold",children:"Category"}),e.jsx("input",{type:"text",value:A,onChange:s=>w(s.target.value),list:"firm-doc-categories",placeholder:"e.g. Lending",className:"mt-1.5 w-full px-3 py-2 bg-background border border-border rounded-lg text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-[#5BC8E8]"}),e.jsx("datalist",{id:"firm-doc-categories",children:f.map(s=>e.jsx("option",{value:s},s))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wide text-muted-foreground font-semibold",children:"Description"}),e.jsx("textarea",{value:C,onChange:s=>d(s.target.value),rows:2,placeholder:"Optional â what's this template for?",className:"mt-1.5 w-full px-3 py-2 bg-background border border-border rounded-lg text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-[#5BC8E8] resize-y"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border/50",children:[e.jsx("button",{type:"button",onClick:g,disabled:x,className:"px-3 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors disabled:opacity-50",children:"Cancel"}),e.jsx(B,{text:c?"Makes this file the version in use; the old version is kept but no longer used.":"Adds this file to the firm documents for the whole team.",children:e.jsxs("button",{type:"button",onClick:O,disabled:!_||x,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold rounded-lg bg-[#5BC8E8] text-black hover:bg-[#4ab8d8] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[x?e.jsx(z,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(G,{className:"w-3.5 h-3.5"}),c?"Replace":"Upload"]})})]})]})})}function H({label:a,active:r,count:n,onClick:f}){return e.jsxs("button",{onClick:f,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium transition-colors border ${r?"bg-[#5BC8E8]/15 border-[#5BC8E8] text-[#5BC8E8]":"bg-transparent border-border text-muted-foreground hover:text-foreground hover:bg-secondary/40"}`,children:[a,e.jsx("span",{className:"text-[10px] opacity-70",children:n})]})}function ge({title:a,body:r,confirmLabel:n,confirmTone:f,onCancel:g,onConfirm:k}){const c=f==="danger"?"bg-red-500 text-white hover:bg-red-600":"bg-[#5BC8E8] text-black hover:bg-[#4ab8d8]";return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:e.jsxs("div",{className:"w-full max-w-sm bg-card border border-border rounded-xl p-5",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground mb-1.5",children:a}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:r}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:g,className:"px-3 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors",children:"Cancel"}),e.jsx("button",{onClick:k,className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-colors ${c}`,children:n})]})]})})}export{Me 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.