(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47099,e=>{"use strict";let t="en-LK",r="Asia/Colombo",s=/^\d{4}-\d{2}-\d{2}$/;function a(e,t){return e.find(e=>e.type===t)?.value??""}function i(e){return e instanceof Date?e:new Date("string"==typeof e&&s.test(e)?`${e}T00:00:00+05:30`:e)}function n(e){let t=i(e);if(Number.isNaN(t.getTime()))return"";let s=new Intl.DateTimeFormat("en-CA",{timeZone:r,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(t),n=a(s,"year"),l=a(s,"month"),c=a(s,"day");return`${n}-${l}-${c}`}e.s(["formatDate",0,function(e,s={}){if(null==e||""===e)return"";let a=i(e);return Number.isNaN(a.getTime())?"":new Intl.DateTimeFormat(t,{day:"2-digit",month:"short",year:"numeric",timeZone:r,...s}).format(a)},"formatDateTime",0,function(e,s={}){if(null==e||""===e)return"";let a=i(e);return Number.isNaN(a.getTime())?"":new Intl.DateTimeFormat(t,{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZone:r,...s}).format(a)},"formatNumber",0,function(e,r={}){let s="number"==typeof e?e:Number(e??0);return new Intl.NumberFormat(t,r).format(Number.isFinite(s)?s:0)},"getTodayDateInputValue",0,function(e=new Date){return n(e)},"isDateBefore",0,function(e,t){if(null==e||null==t)return!1;let r=n(e),s=n(t);return""!==r&&""!==s&&r<s}])},31155,e=>{"use strict";let t=(0,e.i(85124).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",0,t],31155)},96739,e=>{"use strict";let t=(0,e.i(85124).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,t],96739)},49401,e=>{"use strict";var t=e.i(19985),r=e.i(35335),s=e.i(29375),a=e.i(31155),i=e.i(96739),n=e.i(47099);e.s(["default",0,function(){let[e,l]=(0,r.useState)([]),[c,d]=(0,r.useState)(!0);(0,r.useEffect)(()=>{m()},[]);let m=async()=>{d(!0);try{let e=await s.default.get("/recoveries/completed");e.success&&l(e.data)}catch(e){console.error(e)}finally{d(!1)}};return(0,t.jsxs)("div",{className:"pb-8",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-full bg-success-light text-success flex items-center justify-center",children:(0,t.jsx)(a.CheckCircle2,{size:20})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-xl font-bold",children:"Completed"}),(0,t.jsx)("p",{className:"text-sm text-[var(--text-muted)]",children:"Your recent successful collections"})]})]}),(0,t.jsx)("div",{className:"space-y-4",children:c?(0,t.jsx)("div",{className:"text-center py-12 text-[var(--text-muted)] animate-pulse",children:"Loading..."}):0===e.length?(0,t.jsx)("div",{className:"text-center py-12 text-[var(--text-muted)] bg-[var(--card)] rounded-xl border border-[var(--border-color)]",children:"No completed collections yet."}):(0,t.jsx)("div",{className:"card overflow-hidden p-0",children:(0,t.jsx)("div",{className:"divide-y divide-[var(--border-color)]",children:e.map(e=>(0,t.jsxs)("div",{className:"p-4 flex gap-4 items-center bg-[var(--background)]",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-success-light text-success flex items-center justify-center shrink-0",children:(0,t.jsx)(i.FileText,{size:20})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"font-bold text-[var(--foreground)] text-sm",children:e.customer_name}),(0,t.jsxs)("p",{className:"text-xs text-[var(--text-muted)] mt-0.5",children:["Loan #L-",e.loan_id?.toString().padStart(4,"0")]}),(0,t.jsx)("p",{className:"text-xs text-[var(--text-muted)] flex items-center gap-1 mt-1",children:(0,n.formatDateTime)(e.collection_date)})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsxs)("p",{className:"font-bold text-success",children:["Rs ",(0,n.formatNumber)(e.amount_collected)]}),(0,t.jsx)("p",{className:"text-xs text-[var(--text-muted)] uppercase mt-0.5",children:e.payment_method})]})]},e.id))})})})]})}])}]);