1/*! For license information please see 8527.7c96a726.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[8527],{516(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},1286(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]])},2054(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},3002(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]])},5088(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},5131(e,s,a){a.d(s,{b:()=>m});var t=a(9379),l=a(5043),n=a(3986),i=(a(7950),a(6851)),c=a(579);const r=["asChild"];var d=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,s)=>{const a=(0,i.TL)("Primitive.".concat(s)),d=l.forwardRef((e,l)=>{const{asChild:i}=e,d=(0,n.A)(e,r),o=i?a:s;return"undefined"!==typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,c.jsx)(o,(0,t.A)((0,t.A)({},d),{},{ref:l}))});return d.displayName="Primitive.".concat(s),(0,t.A)((0,t.A)({},e),{},{[s]:d})},{});var o=l.forwardRef((e,s)=>(0,c.jsx)(d.label,(0,t.A)((0,t.A)({},e),{},{ref:s,onMouseDown:s=>{var a;s.target.closest("button, input, select, textarea")||(null===(a=e.onMouseDown)||void 0===a||a.call(e,s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}})));o.displayName="Label";var m=o},5469(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},5598(e,s,a){a.d(s,{Cf:()=>g,Es:()=>y,L3:()=>b,c7:()=>N,lG:()=>j,rr:()=>A});var t=a(9379),l=a(3986),n=a(5043),i=a(7427),c=a(614),r=a(9766),d=a(579);const o=["className"],m=["className","children"],x=["className"],h=["className"],p=["className"],u=["className"],j=i.bL,f=(i.l9,i.ZL),v=(i.bm,n.forwardRef((e,s)=>{let{className:a}=e,n=(0,l.A)(e,o);return(0,d.jsx)(i.hJ,(0,t.A)({ref:s,className:(0,r.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a)},n))}));v.displayName=i.hJ.displayName;const g=n.forwardRef((e,s)=>{let{className:a,children:n}=e,o=(0,l.A)(e,m);return(0,d.jsxs)(f,{children:[(0,d.jsx)(v,{}),(0,d.jsxs)(i.UC,(0,t.A)((0,t.A)({ref:s,className:(0,r.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a)},o),{},{children:[n,(0,d.jsxs)(i.bm,{className:"absolute right-4 top-4 roun
2ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,d.jsx)(c.A,{className:"h-4 w-4"}),(0,d.jsx)("span",{className:"sr-only",children:"Close"})]})]}))]})});g.displayName=i.UC.displayName;const N=e=>{let{className:s}=e,a=(0,l.A)(e,x);return(0,d.jsx)("div",(0,t.A)({className:(0,r.cn)("flex flex-col space-y-1.5 text-center sm:text-left",s)},a))};N.displayName="DialogHeader";const y=e=>{let{className:s}=e,a=(0,l.A)(e,h);return(0,d.jsx)("div",(0,t.A)({className:(0,r.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s)},a))};y.displayName="DialogFooter";const b=n.forwardRef((e,s)=>{let{className:a}=e,n=(0,l.A)(e,p);return(0,d.jsx)(i.hE,(0,t.A)({ref:s,className:(0,r.cn)("text-lg font-semibold leading-none tracking-tight",a)},n))});b.displayName=i.hE.displayName;const A=n.forwardRef((e,s)=>{let{className:a}=e,n=(0,l.A)(e,u);return(0,d.jsx)(i.VY,(0,t.A)({ref:s,className:(0,r.cn)("text-sm text-muted-foreground",a)},n))});A.displayName=i.VY.displayName},5863(e,s,a){a.d(s,{L:()=>x});a(5043);var t=a(1140),l=a(5949),n=a(3390),i=a(2054),c=a(2024),r=a(6376),d=a(9766),o=a(579);const m=e=>{if("paid"===e.status)return"paid";const s=(new Date).toISOString();return e.due_date>s?"locked":"due"},x=e=>{let{enrollment:s,onPayInstallment:a,payingInstallment:x,renderRowAction:h}=e;const p=s.payment_plan;if(!p||"manual_monthly"!==p.type)return null;const u=p.installments||[],j=u.filter(e=>"paid"===e.status).length,f=u.filter(e=>"paid"!==e.status).reduce((e,s)=>e+(s.total||0),0),v=u.find(e=>"due"===m(e));return(0,o.jsx)(t.Zp,{className:"border-slate-100","data-testid":"course-plan-".concat(s.enrollment_id),children:(0,o.jsxs)(t.Wu,{className:"p-6 space-y-4",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("h3",{className:"font-semibold text-[#0D1B2A]",children:[s.course_title||"Course"," \u2014 Monthly Plan"]}),(0,o.jsxs)("p",{className:"text-sm text-slate-500",children:[p.deposit_ex_vat>0&&(0,o.jsxs)(o.Fragment,{children:["Deposit \xa3",p.deposit_ex_vat.toFixed(2)," ex VAT paid \xb7 "]}),j," of ",p.num_months," paid \xb7 \xa3",f.toFixed(2)," remaining"]})]}),j===u.length?(0,o.jsx)(l.E,{className:"bg-emerald-100 text-emerald-700",children:"Completed"}):(0,o.jsx)(l.E,{className:"bg-sky-100 text-sky-700",children:"Active"})]}),(0,o.jsx)("div",{className:"space-y-2",children:u.map(e=>{const t=m(e),p="".concat(s.enrollment_id,"_").concat(e.seq);return(0,o.jsxs)("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg",children:[(0,o.jsxs)("div",{className:"flex items-center gap-3",children:["paid"===t?(0,o.jsx)(i.A,{className:"w-4 h-4 text-emerald-600"}):(0,o.jsx)(r.A,{className:"w-4 h-4 text-slate-400"}),(0,o.jsxs)("span",{className:"text-sm text-slate-700",children:["Instalment ",e.seq," \xb7 \xa3",(e.total||0).toFixed(2)]}),(0,o.jsxs)("span",{className:"text-xs text-slate-400",children:["Due ",(0,d.Yq)(e.due_date)]})]}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:["paid"===t&&(0,o.jsx)(l.E,{className:"bg-emerald-100 text-emerald-700",children:"Paid"}),"locked"===t&&(0,o.jsx)(l.E,{className:"bg-slate-100 text-slate-500",children:"Upcoming"}),"due"===t&&a&&v&&e.seq===v.seq&&(0,o.jsx)(n.$,{size:"sm",className:"bg-[#0D1B2A] hover:bg-[#1B3A4B]",disabled:x===p,onClick:()=>a(s,e.seq),"data-testid":"pay-installment-".concat(p),children:x===p?(0,o.jsx)(c.A,{className:"w-4 h-4 animate-spin"}):"Pay now"}),"due"===t&&!a&&(0,o.jsx)(l.E,{className:"bg-amber-100 text-amber-700",children:"Due"}),h&&h(s,e)]})]},e.seq)})})]})})}},6245(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},6533(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]])},6788(e,s,a){a.d(s,{XM:()=>d,w1:()=>r,y0:()=>o});
2var t=a(9379),l=a(5043),n=a(2264),i=a(9938),c=a(579);const r=()=>({mode:"none",total_ex_vat:"",vat_rate:"20",num_months:"12",months_paid:"0",deposit_ex_vat:"0"}),d=e=>{if(!e||"none"===e.mode)return;const s={mode:e.mode,total_ex_vat:parseFloat(e.total_ex_vat)||0,vat_rate:parseFloat(e.vat_rate)||0};return"monthly"===e.mode&&(s.num_months=parseInt(e.num_months,10)||0,s.months_paid=parseInt(e.months_paid,10)||0,s.deposit_ex_vat=parseFloat(e.deposit_ex_vat)||0),s},o=e=>{let{value:s,onChange:a,course:r}=e;(0,l.useEffect)(()=>{var e,l;r&&""===s.total_ex_vat&&a((0,t.A)((0,t.A)({},s),{},{total_ex_vat:String(null!==(e=r.price)&&void 0!==e?e:""),vat_rate:String(null!==(l=r.vat_rate)&&void 0!==l?l:20)}))},[null===r||void 0===r?void 0:r.course_id]);const d=e=>l=>a((0,t.A)((0,t.A)({},s),{},{[e]:l.target.value})),o=parseInt(s.num_months,10)||0,m=parseInt(s.months_paid,10)||0,x=parseFloat(s.total_ex_vat)||0,h=parseFloat(s.vat_rate)||0,p="monthly"===s.mode&&parseFloat(s.deposit_ex_vat)||0,u=x*(1+h/100),j=p*(1+h/100),f=Math.max(x-p,0),v=o>0?f*(1+h/100)/o:0,g=v*Math.max(o-m,0),N=p>0&&p>=x&&x>0;return(0,c.jsxs)("div",{className:"space-y-3 border-t pt-4","data-testid":"enrollment-payment-fields",children:[(0,c.jsx)(i.J,{className:"font-medium",children:"Payment"}),(0,c.jsx)("div",{className:"flex gap-4",children:[["none","No payment recorded"],["full","Paid in full"],["monthly","Monthly plan"]].map(e=>{let[l,n]=e;return(0,c.jsxs)("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[(0,c.jsx)("input",{type:"radio",name:"payment-mode",checked:s.mode===l,onChange:()=>a((0,t.A)((0,t.A)({},s),{},{mode:l})),"data-testid":"payment-mode-".concat(l)}),n]},l)})}),"none"!==s.mode&&(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(i.J,{className:"text-xs text-slate-500",children:"Total (ex VAT) \xa3"}),(0,c.jsx)(n.p,{type:"number",min:"0",step:"0.01",value:s.total_ex_vat,onChange:d("total_ex_vat"),"data-testid":"payment-total"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(i.J,{className:"text-xs text-slate-500",children:"VAT %"}),(0,c.jsx)(n.p,{type:"number",min:"0",step:"0.1",value:s.vat_rate,onChange:d("vat_rate"),"data-testid":"payment-vat"})]}),"monthly"===s.mode&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(i.J,{className:"text-xs text-slate-500",children:"Deposit paid (ex VAT) \xa3"}),(0,c.jsx)(n.p,{type:"number",min:"0",step:"0.01",value:s.deposit_ex_vat,onChange:d("deposit_ex_vat"),"data-testid":"payment-deposit"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(i.J,{className:"text-xs text-slate-500",children:"Number of months"}),(0,c.jsx)(n.p,{type:"number",min:"1",value:s.num_months,onChange:d("num_months"),"data-testid":"payment-months"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(i.J,{className:"text-xs text-slate-500",children:"Installments already paid"}),(0,c.jsx)(n.p,{type:"number",min:"0",max:o,value:s.months_paid,onChange:d("months_paid"),"data-testid":"payment-months-paid"})]})]})]}),"full"===s.mode&&x>0&&(0,c.jsxs)("p",{className:"text-sm text-slate-500",children:["\xa3",u.toFixed(2)," inc VAT \u2014 recorded as paid."]}),"monthly"===s.mode&&N&&(0,c.jsx)("p",{className:"text-sm text-red-600",children:"Deposit must be less than the total \u2014 use \u201cPaid in full\u201d if everything is paid."}),"monthly"===s.mode&&o>0&&x>0&&!N&&(0,c.jsxs)("p",{className:"text-sm text-slate-500",children:[p>0&&(0,c.jsxs)(c.Fragment,{children:["Deposit \xa3",j.toFixed(2)," inc VAT \xb7 "]}),m," of ",o," paid \xb7 \xa3",v.toFixed(2),"/month \xb7 \xa3",g.toFixed(2)," remaining"]})]})}},7921(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},8006(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},8527(e,s,a){a.r(s),a.d(s,{AdminUserProfilePage:()=>T,default:()=>H});var t=a(9379),l=a(5043),n=a(5685),i=a(9970),c=a(4980),r=a(1140),d=a(3390),o=a(2264),m=a(9938),x=a(5949),h=a(3416),p=a(5598),u=a(5863),j=a(6788),f=
2a(2054),v=a(6245),g=a(5088),N=a(516),y=a(2024),b=a(4459),A=a(9797),w=a(4965),_=a(1680),k=a(5347),C=a(5469),D=a(5327),S=a(1286),F=a(8006),R=a(6533),E=a(614),B=a(8693),z=a(7921),M=a(8326),I=a(797),P=a(3002),L=a(7104),q=a(9855),J=a(4669);const $=(0,a(7784).A)("printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);var U=a(6328),Z=a(579);const V="https://plant4growthuk-production-a1cd.up.railway.app",T=()=>{var e,s;const{userId:a}=(0,n.g)(),T=(0,n.Zp)(),[H,W]=(0,l.useState)(!0),[G,O]=(0,l.useState)(null),[Y,X]=(0,l.useState)("personal"),[K,Q]=(0,l.useState)(!1),[ee,se]=(0,l.useState)({}),[ae,te]=(0,l.useState)(!1),[le,ne]=(0,l.useState)([]),[ie,ce]=(0,l.useState)([]),[re,de]=(0,l.useState)(null),[oe,me]=(0,l.useState)(!1),[xe,he]=(0,l.useState)(!1),[pe,ue]=(0,l.useState)(!1),[je,fe]=(0,l.useState)(0),[ve,ge]=(0,l.useState)([]),[Ne,ye]=(0,l.useState)(!1),[be,Ae]=(0,l.useState)(null),[we,_e]=(0,l.useState)({grade:"",feedback:"",status:"graded"}),[ke,Ce]=(0,l.useState)([]),[De,Se]=(0,l.useState)(!1),[Fe,Re]=(0,l.useState)([]),[Ee,Be]=(0,l.useState)(null),[ze,Me]=(0,l.useState)((0,j.w1)()),[Ie,Pe]=(0,l.useState)(!1),[Le,qe]=(0,l.useState)(null),Je=(0,l.useCallback)(async()=>{try{const e=await c.lu.getById(a);O(e.data),se(e.data)}catch(e){U.oR.error("Failed to load user"),T("/admin/users")}finally{W(!1)}},[a,T]),$e=(0,l.useCallback)(async()=>{he(!0);try{const e=await c.ER.getUserFolderTree(a);ne(e.data.folders||[]),fe(e.data.total_files||0)}catch(e){console.error("Failed to fetch folders")}finally{he(!1)}},[a]),Ue=(0,l.useCallback)(async e=>{ue(!0);try{const s=await c.ER.getUserFolderFiles(a,e);ce(s.data.files||[])}catch(s){console.error("Failed to fetch files")}finally{ue(!1)}},[a]),Ze=(0,l.useCallback)(async()=>{ye(!0);try{const e=localStorage.getItem("elevate360_token"),s=await fetch("".concat(V,"/api/users/").concat(a,"/assignments"),{headers:{Authorization:"Bearer ".concat(e)}});if(s.ok){const e=await s.json();ge(e||[])}}catch(e){console.error("Failed to fetch assignments")}finally{ye(!1)}},[a]),Ve=(0,l.useCallback)(async()=>{Se(!0);try{const e=localStorage.getItem("elevate360_token"),s=await fetch("".concat(V,"/api/users/").concat(a,"/certificates"),{headers:{Authorization:"Bearer ".concat(e)}});if(s.ok){const e=await s.json();Ce(e||[])}}catch(e){console.error("Failed to fetch certificates")}finally{Se(!1)}},[a]),Te=(0,l.useCallback)(async()=>{try{const e=await c.yl.getUserEnrollments(a);Re(e.data||[])}catch(e){console.error("Failed to fetch enrollments")}},[a]);(0,l.useEffect)(()=>{Je(),Te()},[Je,Te]),(0,l.useEffect)(()=>{"documents"===Y?$e():"assignments"===Y?Ze():"certificates"===Y&&Ve()},[Y,$e,Ze,Ve]),(0,l.useEffect)(()=>{re?Ue(re.folder_id):ce([])},[re,Ue]);const He=e=>(0,Z.jsx)(x.E,{className:{super_admin:"bg-purple-100 text-purple-700",mentor:"bg-blue-100 text-blue-700",delegate:"bg-emerald-100 text-emerald-700"}[e]||"bg-slate-100",children:null===e||void 0===e?void 0:e.replace("_"," ")}),We=e=>{const s={passed:{color:"bg-emerald-100 text-emerald-700",icon:f.A},approved:{color:"bg-emerald-100 text-emerald-700",icon:f.A},failed:{color:"bg-red-100 text-red-700",icon:v.A},rejected:{color:"bg-red-100 text-red-700",icon:v.A},submitted:{color:"bg-yellow-100 text-yellow-700",icon:g.A},pending:{color:"bg-slate-100 text-slate-700",icon:g.A},needs_revision:{color:"bg-orange-100 text-orange-700",icon:N.A},graded:{color:"bg-blue-100 text-blue-700",icon:f.A}},a=s[e]||s.pending;return(0,Z.jsxs)(x.E,{className:a.color,children:[(0,Z.jsx)(a.icon,{className:"w-3 h-3 mr-1"}),null===e||void 0===e?void 0:e.replace("_"," ")]})},Ge=e=>{switch(e){case"submissions":return"\ud83d\udce4";case"returned":return"\ud83d\udce5";case"documents":return"\ud83d\udcc1";default:return"\ud83d\udcc2"}};if(H)return(0,Z.jsx)(i.NI,{children:(0,Z.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,Z.jsx)(y.A,{className:"w-8 h-8 text-[#41EAD4] animate-spin"})})});if(!G)return null;const Oe=[{id:"personal",label:"Personal",icon:b.A},{id:"employment",label:"Courses",icon:A.A},{id:"documents",label:"Documents",icon:w.A},{id:"assignments",label:"Assignments",icon:_.A},{id:"certificates",label:"Certificates",icon:k.A}];return(0,Z.jsx)(i.NI,{children:(0,Z.jsxs)("div",{className:"space-y-6","data-testid":"admin-user-profile",children:[(0,Z.jsxs)(d.$,{variant:"ghost",onClick:()=>T("/admin/users"),className:"mb-2",children:[(0,Z.jsx)(C.A,{className:"w-4 h-4 mr-2"}),"Back to Users"]}),(0,Z.jsx)(r.Zp,{className:"border-slate-100",children:(0,Z.jsx)(r.Wu,{className:"p-6",children:(0,Z.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-6",children:[(0,Z.jsx)("div",{className:"w-20 h-20 bg-gradient-to-br from-[#41EAD4] to-[#0D1B2A] rounded-full flex items-center justify-center text-white text-2xl font-bold",children:(null===(e=G.name)||void 0===e||null===(s=e.charAt(0))||void 0===s?void 0:s.toUpperCase())||"U"}),(0,Z.jsxs)("div",{className:"flex-1",children:[(0,Z.jsxs)("div",{className:"flex items-center gap-3 mb-1",children:[(0,Z.jsx)("h1",{className:"text-2xl font-bold text-[#0D1B2A]",children:G.name}),He(G.role)]}),(0,Z.jsx)("p",{className:"text-slate-500",children:G.job_title||"Delegate"}),(0,Z.jsxs)("div",{className:"flex flex-wrap gap-4 mt-3 text-sm text-slate-600",children:[(0,Z.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Z.jsx)(D.A,{className:"w-4 h-4"})," ",G.email]}),G.phone&&(0,Z.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Z.jsx)(S.A,{className:"w-4 h-4"})," ",G.phone]}),G.location&&(0,Z.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Z.jsx)(F.A,{className:"w-4 h-4"})," ",G.location]})]})]}),(0,Z.jsx)("div",{className:"flex gap-2",children:K?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(d.$,{variant:"outline",onClick:()=>Q(!1),children:[(0,Z.jsx)(E.A,{className:"w-4 h-4 mr-2"}),"Cancel"]}),(0,Z.jsxs)(d.$,{onClick:async()=>{te(!0);try{const e=localStorage.getItem("elevate360_token");await fetch("".concat(V,"/api/users/").concat(a),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(ee)}),U.oR.success("Profile updated"),O(ee),Q(!1)}catch(e){U.oR.error("Failed to update profile")}finally{te(!1)}},disabled:ae,children:[ae?(0,Z.jsx)(y.A,{className:"w-4 h-4 mr-2 animate-spin"}):(0,Z.jsx)(B.A,{className:"w-4 h-4 mr-2"}),"Save"]})]}):(0,Z.jsxs)(d.$,{variant:"outline",onClick:()=>Q(!0),children:[(0,Z.jsx)(R.A,{className:"w-4 h-4 mr-2"}),"Edit Profile"]})})]})})}),(0,Z.jsx)("div",{className:"flex gap-1 border-b border-slate-200 overflow-x-auto",children:Oe.map(e=>(0,Z.jsxs)("button",{onClick:()=>X(e.id),className:"flex items-center gap-2 px-4 py-3 font-medium whitespace-nowrap transition-colors ".concat(Y===e.id?"text-[#0D1B2A] border-b-2 border-[#41EAD4] bg-[#41EAD4]/5":"text-slate-500 hover:text-slate-700 hover:bg-slate-50"),children:[(0,Z.jsx)(e.icon,{className:"w-4 h-4"}),e.label]},e.id))}),(0,Z.jsxs)("div",{className:"mt-6",children:["personal"===Y&&(0,Z.jsxs)(r.Zp,{className:"border-slate-100",children:[(0,Z.jsx)(r.aR,{children:(0,Z.jsx)(r.ZB,{className:"text-lg",children:"Personal Information"})}),(0,Z.jsxs)(r.Wu,{className:"space-y-4",children:[(0,Z.jsxs)("div",{className:"grid sm:grid-cols-2 gap-4",children:[(0,Z.jsxs)("div",{children:[(0,Z.jsx)(m.J,{children:"Full Name"}),K?(0,Z.jsx)(o.p,{value:ee.name||"",onChange:e=>se((0,t.A)((0,t.A)({},ee),{},{name:e.target.value}))}):(0,Z.jsx)("p",{className:"mt-1 text-[#0D1B2A]",children:G.name})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)(m.J,{children:"Email"}),(0,Z.jsx)("p",{className:"mt-1 text-[#0D1B2A]",children:G.email})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)(m.J,{children:"Phone"}),K?(0,Z.jsx)(o.p,{value:ee.phone||"",onChange:e=>se((0,t.A)((0,t.A)({},ee),{},{phone:e.target.value}))}):(0,Z.jsx)("p",{className:"mt-1 text-[#0D1B2A]",children:G.phone||"Not provided"})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)(m.J,{children:"Location"}),K?(0,Z.jsx)(o.p,{value:ee.location||"",onChange:e=>se((0,t.A)((0,t.A)({},ee),{},{location:e.target.value}))}):(0,Z.jsx)("p",{className:"mt-1 text-[#0D1B2A]",children:G.location||"Not provided"})]})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)(m.J,{children:"Bio / Notes"}),K?(0,Z.jsx)(h.T,{value:ee.bio||"",onChange:e=>se((0,t.A)((0,t.A)({},ee),{},{bio:e.target.value})),rows:3}):(0,Z.jsx)("p",{className:"mt-1 text-slate-600",children:G.bio||"No bio provided"})]}),(0,Z.jsxs)("div",{className:"grid sm:grid-cols-2 gap-4 pt-4 border-t",children:[(0,Z.jsxs)("div",{children:[(0,Z.jsx)(m.J,{children:"Role"}),(0,Z.jsx)("p",{className:"mt-1",children:He(G.role)})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)(m.J,{children:"Member Since"}),(0,Z.jsx)("p",{className:"mt-1 text-[#0D1B2A]",children:G.created_at?new Date(G.created_at).toLocaleDateString():"N/A"})]})]})]})]}),"employment"===Y&&(0,Z.jsxs)(r.Zp,{className:"border-slate-100",children:[(0,Z.jsx)(r.aR,{children:(0,Z.jsx)(r.ZB,{className:"text-lg",children:"Enrollments & Courses"})}),(0,Z.jsx)(r.Wu,{children:0===Fe.length?(0,Z.jsx)("p",{className:"text-slate-500 text-center py-8",children:"No enrollments yet"}):(0,Z.jsx)("div",{className:"space-y-4",children:Fe.map(e=>{var s,a,t;return(0,Z.jsxs)("div",{className:"space-y-3",children:[(0,Z.jsxs)("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-xl",children:[(0,Z.jsxs)("div",{children:[(0,Z.jsx)("p",{className:"font-medium text-[#0D1B2A]",children:e.course_title||"Course"}),(0,Z.jsx)("p",{className:"text-sm text-slate-500",children:e.cohort_name||"Cohort"})]}),(0,Z.jsxs)("div",{className:"text-right space-y-2",children:[(0,Z.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,Z.jsx)(x.E,{className:"active"===e.status?"bg-emerald-100 text-emerald-700":"bg-slate-100",children:e.status}),"paid_in_full"===e.payment_status&&(0,Z.jsx)(x.E,{className:"bg-emerald-100 text-emerald-700",children:"Paid in full"}),"manual_monthly"===e.payment_status&&(0,Z.jsxs)(x.E,{className:"bg-sky-100 text-sky-700",children:["Monthly plan \u2014 ",((null===(s=e.payment_plan)||void 0===s?void 0:s.installments)||[]).filter(e=>"paid"===e.status).length,"/",null===(a=e.payment_plan)||void 0===a?void 0:a.num_months," paid"]}),!e.payment_status&&(0,Z.jsx)(d.$,{variant:"outline",size:"sm",onClick:()=>{Be(e),Me((0,j.w1)())},"data-testid":"record-payment-".concat(e.enrollment_id),children:"Record payment"})]}),(0,Z.jsxs)("p",{className:"text-xs text-slate-500 mt-1",children:["Progress: ",e.progress||0,"%"]})]})]}),"manual_monthly"===(null===(t=e.payment_plan)||void 0===t?void 0:t.type)&&(0,Z.jsx)(u.L,{enrollment:e,renderRowAction:(e,s)=>"paid"!==s.status?(0,Z.jsx)(d.$,{variant:"outline",size:"sm",disabled:Le==="".concat(e.enrollment_id,"_").concat(s.seq),onClick:()=>(async(e,s)=>{const a="".concat(e.enrollment_id,"_").concat(s.seq);qe(a);try{await c.yl.markInstallmentPaid(e.enrollment_id,s.seq),U.oR.success("Instalment ".concat(s.seq," marked paid")),await Te()}catch(n){var t,l;U.oR.error((null===(t=n.response)||void 0===t||null===(l=t.data)||void 0===l?void 0:l.detail)||"Failed to mark instalment paid")}finally{qe(null)}})(e,s),"data-testid":"mark-paid-".concat(e.enrollment_id,"-").concat(s.seq),children:Le==="".concat(e.enrollment_id,"_").concat(s.seq)?"S
2aving\u2026":"Mark paid"}):null})]},e.enrollment_id)})})})]}),"documents"===Y&&(0,Z.jsxs)("div",{className:"grid lg:grid-cols-3 gap-6",children:[(0,Z.jsxs)(r.Zp,{className:"border-slate-100 lg:col-span-1",children:[(0,Z.jsx)(r.aR,{children:(0,Z.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Z.jsx)(r.ZB,{className:"text-lg",children:"Folders"}),0===le.length&&(0,Z.jsxs)(d.$,{size:"sm",onClick:async()=>{try{await c.ER.initUserFolders(a),U.oR.success("Folders initialized"),$e()}catch(e){U.oR.error("Failed to initialize folders")}},children:[(0,Z.jsx)(z.A,{className:"w-4 h-4 mr-1"}),"Initialize"]})]})}),(0,Z.jsxs)(r.Wu,{children:[xe?(0,Z.jsx)("div",{className:"flex justify-center py-4",children:(0,Z.jsx)(y.A,{className:"w-6 h-6 animate-spin text-[#41EAD4]"})}):0===le.length?(0,Z.jsxs)("div",{className:"text-center py-8 text-slate-500",children:[(0,Z.jsx)(w.A,{className:"w-10 h-10 mx-auto mb-2 text-slate-300"}),(0,Z.jsx)("p",{className:"text-sm",children:"No folders yet"}),(0,Z.jsx)("p",{className:"text-xs mt-1",children:"Click Initialize to create default folders"})]}):(0,Z.jsx)("div",{className:"space-y-2",children:le.map(e=>(0,Z.jsxs)("button",{onClick:()=>de(e),className:"w-full flex items-center justify-between p-3 rounded-lg transition-colors text-left ".concat((null===re||void 0===re?void 0:re.folder_id)===e.folder_id?"bg-[#41EAD4]/10 border border-[#41EAD4]":"bg-slate-50 hover:bg-slate-100"),children:[(0,Z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Z.jsx)("span",{className:"text-lg",children:Ge(e.folder_type)}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)("p",{className:"font-medium text-sm text-[#0D1B2A]",children:e.name}),(0,Z.jsxs)("p",{className:"text-xs text-slate-500",children:[e.file_count," files"]})]})]}),(0,Z.jsx)(M.A,{className:"w-4 h-4 text-slate-400"})]},e.folder_id))}),le.length>0&&(0,Z.jsx)("div",{className:"mt-4 pt-4 border-t text-center",children:(0,Z.jsxs)("p",{className:"text-sm text-slate-500",children:["Total: ",(0,Z.jsx)("span",{className:"font-semibold text-[#0D1B2A]",children:je})," files"]})})]})]}),(0,Z.jsxs)(r.Zp,{className:"border-slate-100 lg:col-span-2",children:[(0,Z.jsx)(r.aR,{children:(0,Z.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Z.jsx)(r.ZB,{className:"text-lg",children:re?re.name:"Select a folder"}),re&&(0,Z.jsxs)("label",{children:[(0,Z.jsxs)(d.$,{size:"sm",className:"bg-[#0D1B2A]",disabled:oe,children:[oe?(0,Z.jsx)(y.A,{className:"w-4 h-4 mr-2 animate-spin"}):(0,Z.jsx)(I.A,{className:"w-4 h-4 mr-2"}),"Upload File"]}),(0,Z.jsx)("input",{type:"file",className:"hidden",onChange:async e=>{const s=e.target.files[0];if(s&&re){me(!0);try{await c.ER.uploadUserFile(a,re.folder_id,s),U.oR.success("File uploaded"),Ue(re.folder_id),$e()}catch(t){U.oR.error("Failed to upload file")}finally{me(!1)}}}})]})]})}),(0,Z.jsx)(r.Wu,{children:re?pe?(0,Z.jsx)("div",{className:"flex justify-center py-8",children:(0,Z.jsx)(y.A,{className:"w-6 h-6 animate-spin text-[#41EAD4]"})}):0===ie.length?(0,Z.jsxs)("div",{className:"text-center py-12 text-slate-500",children:[(0,Z.jsx)(P.A,{className:"w-12 h-12 mx-auto mb-2 text-slate-300"}),(0,Z.jsx)("p",{children:"No files in this folder"}),(0,Z.jsx)("p",{className:"text-xs mt-1",children:"Upload files using the button above"})]}):(0,Z.jsx)("div",{className:"space-y-2",children:ie.map(e=>{return(0,Z.jsxs)("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg hover:bg-slate-100 transition-colors",children:[(0,Z.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,Z.jsx)(P.A,{className:"w-5 h-5 text-slate-500 flex-shrink-0"}),(0,Z.jsxs)("div",{className:"min-w-0",children:[(0,Z.jsx)("p",{className:"font-medium text-[#0D1B2A] truncate",children:e.filename}),(0,Z.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[(0,Z.jsx)("span",{children:(s=e.file_size,s<1024?s+" B":s<1048576?(s/1024).toFixed(1)+" KB":(s/1048576).toFixed(1)+" MB")}),(0,Z.jsx)("span",{children:"\u2022"}),(0,Z.jsx)("span",{children:e.uploaded_at?new Date(e.uploaded_at).toLocaleDateString():""})]})]})]}),(0,Z.jsxs)("div",{className:"flex gap-1 ml-2",children:[(0,Z.jsx)(d.$,{variant:"ghost",size:"sm",onClick:()=>(async e=>{try{const s=localStorage.getItem("elevate360_token"),t=await fetch("".concat(V,"/api/users/").concat(a,"/documents/").concat(e.document_id,"/download"),{headers:{Authorization:"Bearer ".concat(s)}});if(t.ok){const s=await t.blob(),a=window.URL.createObjectURL(s),l=document.createElement("a");l.href=a,l.download=e.filename,l.click(),window.URL.revokeObjectURL(a)}}catch(s){U.oR.error("Failed to download file")}})(e),title:"Download",children:(0,Z.jsx)(L.A,{className:"w-4 h-4"})}),(0,Z.jsx)(d.$,{variant:"ghost",size:"sm",onClick:()=>(async e=>{if(window.confirm("Delete this file?"))try{const s=localStorage.getItem("elevate360_token");await fetch("".concat(V,"/api/users/").concat(a,"/documents/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(s)}}),U.oR.success("File deleted"),re&&Ue(re.folder_id),$e()}catch(s){U.oR.error("Failed to delete file")}})(e.document_id),title:"Delete",children:(0,Z.jsx)(q.A,{className:"w-4 h-4 text-red-500"})})]})]},e.document_id);var s})}):(0,Z.jsxs)("div",{className:"text-center py-12 text-slate-500",children:[(0,Z.jsx)(w.A,{className:"w-12 h-12 mx-auto mb-2 text-slate-300"}),(0,Z.jsx)("p",{children:"Select a folder to view files"})]})})]})]}),"assignments"===Y&&(0,Z.jsxs)(r.Zp,{className:"border-slate-100",children:[(0,Z.jsx)(r.aR,{children:(0,Z.jsx)(r.ZB,{className:"text-lg",children:"Assignments & Submissions"})}),(0,Z.jsxs)(r.Wu,{children:[Ne?(0,Z.jsx)("div",{className:"flex justify-center py-8",children:(0,Z.jsx)(y.A,{className:"w-6 h-6 animate-spin text-[#41EAD4]"})}):0===ve.length?(0,Z.jsxs)("div",{className:"text-center py-12 text-slate-500",children:[(0,Z.jsx)(_.A,{className:"w-12 h-12 mx-auto mb-2 text-slate-300"}),(0,Z.jsx)("p",{children:"No assignments yet"})]}):(0,Z.jsx)("div",{className:"space-y-4",children:ve.map(e=>(0,Z.jsxs)("div",{className:"p-4 border rounded-xl",children:[(0,Z.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,Z.jsxs)("div",{children:[(0,Z.jsx)("h4",{className:"font-medium text-[#0D1B2A]",children:e.title}),(0,Z.jsx)("p",{className:"text-sm text-slate-500",children:e.course_title})]}),We(e.status)]}),e.submitted_at&&(0,Z.jsxs)("div",{className:"mb-3 p-3 bg-slate-50 rounded-lg",children:[(0,Z.jsx)("p",{className:"text-xs text-slate-500 mb-1",children:"Submitted:"}),(0,Z.jsx)("p",{className:"text-sm text-[#0D1B2A]",children:new Date(e.submitted_at).toLocaleStr
2ing()}),e.submission_url&&(0,Z.jsx)("a",{href:e.submission_url,target:"_blank",rel:"noopener noreferrer",className:"text-[#41EAD4] text-sm hover:underline mt-1 block",children:"View Submission"})]}),e.feedback&&(0,Z.jsxs)("div",{className:"mb-3 p-3 bg-blue-50 rounded-lg",children:[(0,Z.jsx)("p",{className:"text-xs text-blue-600 mb-1 font-medium",children:"Feedback:"}),(0,Z.jsx)("p",{className:"text-sm text-slate-700",children:e.feedback})]}),"submitted"===e.status&&(0,Z.jsx)("div",{className:"flex gap-2 mt-3",children:(0,Z.jsxs)(d.$,{size:"sm",className:"bg-emerald-600 hover:bg-emerald-700",onClick:()=>{Ae(e),_e({grade:"",feedback:"Great work!",status:"passed"})},children:[(0,Z.jsx)(f.A,{className:"w-4 h-4 mr-1"}),"Grade"]})})]},e.assignment_id))}),be&&(0,Z.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:(0,Z.jsxs)("div",{className:"bg-white rounded-xl max-w-md w-full p-6",children:[(0,Z.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Grade Submission"}),(0,Z.jsx)("p",{className:"text-sm text-slate-500 mb-4",children:be.title}),(0,Z.jsxs)("div",{className:"space-y-4",children:[(0,Z.jsxs)("div",{children:[(0,Z.jsx)(m.J,{children:"Grade (0-100)"}),(0,Z.jsx)(o.p,{type:"number",min:"0",max:"100",value:we.grade,onChange:e=>_e((0,t.A)((0,t.A)({},we),{},{grade:e.target.value})),placeholder:"Enter grade..."})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)(m.J,{children:"Status"}),(0,Z.jsxs)("div",{className:"flex gap-2 mt-1",children:[(0,Z.jsx)(d.$,{size:"sm",variant:"passed"===we.status?"default":"outline",onClick:()=>_e((0,t.A)((0,t.A)({},we),{},{status:"passed"})),className:"passed"===we.status?"bg-emerald-600":"",children:"Pass"}),(0,Z.jsx)(d.$,{size:"sm",variant:"failed"===we.status?"default":"outline",onClick:()=>_e((0,t.A)((0,t.A)({},we),{},{status:"failed"})),className:"failed"===we.status?"bg-red-600":"",children:"Fail"}),(0,Z.jsx)(d.$,{size:"sm",variant:"needs_revision"===we.status?"default":"outline",onClick:()=>_e((0,t.A)((0,t.A)({},we),{},{status:"needs_revision"})),className:"needs_revision"===we.status?"bg-orange-600":"",children:"Needs Revision"})]})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)(m.J,{children:"Feedback"}),(0,Z.jsx)(h.T,{value:we.feedback,onChange:e=>_e((0,t.A)((0,t.A)({},we),{},{feedback:e.target.value})),rows:3,placeholder:"Add feedback for the student..."})]})]}),(0,Z.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,Z.jsx)(d.$,{variant:"outline",onClick:()=>Ae(null),children:"Cancel"}),(0,Z.jsxs)(d.$,{onClick:async()=>{if(be)try{await c.ER.gradeSubmission(be.submission_id,{grade:parseInt(we.grade)||null,feedback:we.feedback,status:we.status}),U.oR.success("Submission graded"),Ae(null),_e({grade:"",feedback:"",status:"graded"}),Ze()}catch(e){U.oR.error("Failed to grade submission")}},className:"bg-[#0D1B2A]",children:[(0,Z.jsx)(J.A,{className:"w-4 h-4 mr-2"}),"Submit Grade"]})]})]})})]})]}),"certificates"===Y&&(0,Z.jsxs)(r.Zp,{className:"border-slate-100",children:[(0,Z.jsx)(r.aR,{children:(0,Z.jsx)(r.ZB,{className:"text-lg",children:"Certificates"})}),(0,Z.jsx)(r.Wu,{children:De?(0,Z.jsx)("div",{className:"flex justify-center py-8",children:(0,Z.jsx)(y.A,{className:"w-6 h-6 animate-spin text-[#41EAD4]"})}):0===ke.length?(0,Z.jsxs)("div",{className:"text-center py-12 text-slate-500",children:[(0,Z.jsx)(k.A,{className:"w-12 h-12 mx-auto mb-2 text-slate-300"}),(0,Z.jsx)("p",{children:"No certificates earned yet"})]}):(0,Z.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:ke.map(e=>(0,Z.jsxs)("div",{className:"p-4 border rounded-xl bg-gradient-to-br from-[#D4AF37]/10 to-white",children:[(0,Z.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,Z.jsx)(k.A,{className:"w-8 h-8 text-[#D4AF37]"}),(0,Z.jsx)(x.E,{className:"bg-emerald-100 text-emerald-700",children:"Earned"})]}),(0,Z.jsx)("h4",{className:"font-semibold text-[#0D1B2A] mb-1",children:e.course_title}),(0,Z.jsxs)("p",{className:"text-xs text-slate-500 mb-3",children:["Issued: ",e.issued_at?new Date(e.issued_at).toLocaleDateString():"N/A"]}),(0,Z.jsxs)(d.$,{size:"sm",className:"w-full bg-[#0D1B2A]",onClick:()=>{return s=e.certificate_id,void window.open("".concat(V,"/api/certificates/").concat(s,"/pdf"),"_blank");var s},children:[(0,Z.jsx)($,{className:"w-4 h-4 mr-2"}),"Print Certificate"]})]},e.certificate_id))})})]})]}),(0,Z.jsx)(p.lG,{open:!!Ee,onOpenChange:()=>Be(null),children:(0,Z.jsxs)(p.Cf,{children:[(0,Z.jsx)(p.c7,{children:(0,Z.jsxs)(p.L3,{children:["Record payment \u2014 ",(null===Ee||void 0===Ee?void 0:Ee.course_title)||"Course"]})}),(0,Z.jsx)(j.y0,{value:ze,onChange:Me,course:null}),(0,Z.jsxs)(p.Es,{children:[(0,Z.jsx)(d.$,{variant:"outline",onClick:()=>Be(null),children:"Cancel"}),(0,Z.jsx)(d.$,{onClick:async()=>{const e=(0,j.XM)(ze);if(e){Pe(!0);try{await c.yl.recordPayment(Ee.enrollment_id,e),U.oR.success("Payment recorded"),Be(null),Me((0,j.w1)()),await Te()}catch(t){var s,a;U.oR.error((null===(s=t.response)||void 0===s||null===(a=s.data)||void 0===a?void 0:a.detail)||"Failed to record payment")}finally{Pe(!1)}}else U.oR.error("Choose full payment or a monthly plan first.")},disabled:Ie,className:"bg-[#0D1B2A] hover:bg-[#1B3A4B]",children:Ie?"Saving\u2026":"Record payment"})]})]})})]})})},H=T},8693(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},9855(e,s,a){a.d(s,{A:()=>t});const t=(0,a(7784).A)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
2],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},9938(e,s,a){a.d(s,{J:()=>x});var t=a(9379),l=a(3986),n=a(5043),i=a(5131),c=a(917),r=a(9766),d=a(579);const o=["className"],m=(0,c.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),x=n.forwardRef((e,s)=>{let{className:a}=e,n=(0,l.A)(e,o);return(0,d.jsx)(i.b,(0,t.A)({ref:s,className:(0,r.cn)(m(),a)},n))});x.displayName=i.b.displayName}}]); 3//# sourceMappingURL=8527.7c96a726.chunk.js.map
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.