PageSourceSearch

https://rentamaids247.com/assets/AdminMaidProfile-DCibaaoE.js

js rentamaids247.com collected 2026-10-02 01:41:22 UTC 52,490 bytes, 1 lines download raw bytes

1import{aw as pt,ax as bt,aI as gt,aQ as ht,aR as yt,aS as ft,aT as jt,aU as vt,j as e,U as te,P as ae,v as Nt,M as Fe,w as H,aM as O,a6 as _t,C as G,B as T,ai as wt,aV as kt,a8 as St,am as Me,aa as $e,S as Ct,al as Pt,aW as At,aX as Pe,aY as Dt,aZ as Ae,a_ as Et,Z as De,a$ as Tt,b0 as Ft,X as Mt,aO as $t}from"./index-ldhLsBZg.js";import{e as Lt,b as Rt,r as p,u as It}from"./react-vendor-D2UoAUYf.js";import{M as Bt}from"./Modal-DVtu92k7.js";import{T as Ut}from"./Toast-B41YKfWe.js";import{u as Jt}from"./useToast-DvLUY4kv.js";import{G as Ot,M as Gt}from"./GradeBadge-DkOxsdTs.js";import{A as Ee}from"./arrow-left-aV1FYMC9.js";import{C as Ht}from"./chevron-right-BRr1NzNN.js";import{M as $}from"./message-circle-CdjqmctV.js";import{S as Wt}from"./share-2-Cdm9AlSi.js";import{P as Le}from"./pen-DVdXkNL5.js";import{B as zt}from"./badge-check-CFohq_4F.js";import{C as Vt}from"./copy-D6nFTpoj.js";import{C as Yt}from"./check-circle-2-BrigMaox.js";import{P as L}from"./plus-vNdJdMI3.js";import{C as qt}from"./check-CYscmLjc.js";import{F as R}from"./file-text-uik-qefh.js";import{T as Xt}from"./trending-up-C4kFmxra.js";import{A as I}from"./activity-DUpssGgx.js";import{I as le}from"./indian-rupee-D59XQuK9.js";import{E as Kt}from"./eye-LLkwmk6A.js";import{S as se}from"./sticky-note-CmwCBxwG.js";import{T as Qt}from"./trash-2-RAx7ox0C.js";import"./supabase-DnPY-mAy.js";import"./alert-circle-DLHnu5gf.js";const re=[{key:"new_lead",label:"New Lead"},{key:"contacted",label:"Contacted"},{key:"interested",label:"Interested"},{key:"office_visit",label:"Office Visit"},{key:"registered",label:"Registered"},{key:"verified",label:"Verified"},{key:"ready_for_placement",label:"Ready for Placement"},{key:"placed",label:"Placed"}],Zt=[...re,{key:"rejected",label:"Rejected"},{key:"inactive",label:"Inactive"}],Re={new_lead:"bg-sky-100 text-sky-700",contacted:"bg-cyan-100 text-cyan-700",interested:"bg-teal-100 text-teal-700",office_visit:"bg-amber-100 text-amber-700",registered:"bg-indigo-100 text-indigo-700",verified:"bg-blue-100 text-blue-700",ready_for_placement:"bg-emerald-100 text-emerald-700",placed:"bg-green-100 text-green-700",rejected:"bg-red-100 text-red-600",inactive:"bg-gray-100 text-gray-500"},ie=["Aadhaar Card","PAN Card","Photo","Address Proof","Police Verification","Medical Certificate","Bank Details"],Ie={pending:"bg-amber-100 text-amber-700",uploaded:"bg-blue-100 text-blue-700",verified:"bg-emerald-100 text-emerald-700",rejected:"bg-red-100 text-red-600"},Z=["pending","uploaded","verified","rejected"],ea=["Overview","Personal Information","Experience & Skills","Job Preference","Documents","Follow-ups","Placements","Notes","Timeline"],ta=["Hindu","Muslim","Christian","Sikh","Jain","Buddhist"],aa=["Karnataka","Tamil Nadu","Andhra Pradesh","Telangana","Kerala","Maharashtra","West Bengal","Bihar","Jharkhand","Odisha","Assam","Uttar Pradesh","Nepal"],Te=["skills","languages","service_ids","package_type_ids","instant_service_ids","preferred_pincodes"],sa=["age","children_count","experience_years","expected_salary_min","expected_salary_max","previous_salary","rating","max_family_size","instant_hourly_rate","hourly_rate","daily_rate"],la=["is_available","is_active","comfortable_with_pets","available_for_instant","salary_negotiable","is_public"],ee=[{title:"Basic Details",fields:[{key:"full_name",label:"Full Name *",type:"text"},{key:"photo_url",label:"Photo URL",type:"text"},{key:"phone",label:"Phone",type:"text"},{key:"whatsapp_number",label:"WhatsApp Number",type:"text"},{key:"email",label:"Email",type:"text"},{key:"age",label:"Age",type:"number"},{key:"date_of_birth",label:"Date of Birth",type:"date"},{key:"gender",label:"Gender",type:"select",options:["female","male","other"]},{key:"native_state",label:"Native State",type:"text",suggestions:aa}]},{title:"Personal Information",fields:[{key:"father_husband_name",label:"Father's / Husband's Name",type:"text"},{key:"marital_status",label:"Marital Status",type:"select",options:["Single","Married","Widowed","Divorced"]},{key:"children_count",label:"No. of Children",type:"number"},{key:"height_weight",label:"Height / Weight",type:"text"},{key:"religion",label:"Religion",type:"text",suggestions:ta},{key:"caste",label:"Caste",type:"text"},{key:"education_level",label:"Education",type:"select",options:["No Formal Education","Primary School","High School","Graduate"]},{key:"emergency_contact",label:"Emergency Contact",type:"text"},{key:"aadhaar_number",label:"Aadhaar Number",type:"text"}]},{title:"Skills, Languages & Bio",fields:[{key:"skills",label:"Skills",type:"tags",full:!0},{key:"languages",label:"Languages",type:"tags",full:!0},{key:"bio",label:"Short Bio",type:"textarea",full:!0}]},{title:"Work Profile",fields:[{key:"service_ids",label:"Service Categories",type:"services",full:!0},{key:"package_type_ids",label:"Packages",type:"packages",full:!0},{key:"experience_years",label:"Experience (years)",type:"number"},{key:"verification_level",label:"Verification Level",type:"select",options:["pending","id_verified","police_verified","fully_verified"]},{key:"rating",label:"Rating (0–5)",type:"number"},{key:"quality_grade",label:"Quality Grade",type:"select",options:[...Gt]}]},{title:"Salary & Rates",fields:[{key:"expected_salary_min",label:"Monthly Salary Min (₹)",type:"number"},{key:"expected_salary_max",label:"Monthly Salary Max (₹)",type:"number"},{key:"daily_rate",label:"Per Day Rate (₹)",type:"number"},{key:"hourly_rate",label:"Per Hour Rate (₹)",type:"number"},{key:"salary_negotiable",label:"Salary negotiable",type:"checkbox"}]},{title:"Job Preference",fields:[{key:"preferred_job",label:"Preferred Job",type:"text"},{key:"live_in_preference",label:"Live-in / Full-time",type:"select",options:["Live-in","Full-time","Part-time"]},{key:"food_preference",label:"Food Preference",type:"select",options:["Veg","Non-Veg","Veg & Non-Veg"]},{key:"accommodation_required",label:"Accommodation",type:"select",options:["Required","Not Required"]},{key:"preferred_area",label:"Preferred Area",type:"text"},{key:"preferred_pincodes",label:"Preferred Job Pincodes (Multiple)",type:"tags",full:!0},{key:"preferred_shift",label:"Preferred Shift",type:"select",options:["Morning","Evening","Night","Morning + Night","Flexible"]},{key:"joining_availability",label:"Joining Availability",type:"text"}]},{title:"Experience Details",fields:[{key:"previous_job",label:"Previous Job",type:"text"},{key:"previous_location",label:"Previous Location",type:"text"},{key:"previous_salary",label:"Previous Salary (₹)",type:"number"},{key:"reason_for_leaving",label:"Reason for Leaving",type:"text"}]},{title:"Location / Current Address",fields:[{key:"location_area",label:"Area / Locality",type:"text"},{key:"city",label:"City",type:"text"},{key:"pincode",label:"Home Pincode (Single)",type:"text"},{key:"latitude",label:"Latitude",type:"text"},{key:"longitude",label:"Longitude",type:"text"}]},{title:"Availability & Trust",fields:[{key:"is_available",label:"Available for new bookings",type:"checkbox"},{key:"is_active",label:"Active profile",type:"checkbox"},{key:"comfortable_with_pets",label:"Comfortable with pets",type:"checkbox"},{key:"max_family_size",label:"Max Family Size",type:"number"}]},{title:"Instant Settings",fields:[{key:"available_for_instant",label:"Available for instant jobs",type:"checkbox"},{key:"instant_status",label:"Instant Status",type:"select",options:["online","busy","offline"]},{key:"instant_hourly_rate",label:"Instant Hourly Rate (₹)",type:"number"},{key:"instant_service_ids",label:"Instant Services",type:"instant",full:!0}]},{title:"Lead Details",fields:[{key:"lead_source",label:"Lead Source",type:"select",options:["Website","Walk-in","Referral","WhatsApp","Job Portal","WorkIndia","Other"]},{key:"lead_date",label:"Lead Date",type:"date"},{key:"referred_by",label:"Referred By",type:"text"},{key:"assigned_recruiter",label:"Assigned Recruiter",type:"text"}]},{title:"Public Shareable Profile",fields:[{key:"is_public",label:"Enable public profile link (contact number & email stay hidden)",type:"checkbox",full:!0}]}],C=a=>a?new Date(a).toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}):"—",W=a=>
1a?new Date(a).toLocaleString("en-IN",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}):"—",w=a=>a?`₹${Number(a).toLocaleString("en-IN")}`:"—",ra=(a,c)=>{if(a){const r=Date.now()-new Date(a).getTime();return`${Math.floor(r/(365.25*24*3600*1e3))} Years`}return c?`${c} Years`:"—"},Be=a=>a&&a.replace(/\D/g,"").length>=4?`XXXX XXXX ${a.replace(/\D/g,"").slice(-4)}`:"—";function Ja(){const{id:a}=Lt(),c=Rt(),{toast:r,showToast:x,hideToast:g}=Jt(),[s,f]=p.useState(null),[N,P]=p.useState([]),[u,b]=p.useState([]),[_,S]=p.useState([]),[A,Ue]=p.useState({monthly:[],instant:[]}),[Je,z]=p.useState(!0),[k,V]=p.useState("Overview"),[Y,ne]=p.useState("new_lead"),[oe,ce]=p.useState(""),[de,xe]=p.useState(!1),[q,ue]=p.useState(!1),[Oe,B]=p.useState(!1),[F,D]=p.useState({}),[me,pe]=p.useState(!1),[be,U]=p.useState({}),[Ge,He]=p.useState([]),[We,ze]=p.useState([]),[Ve,Ye]=p.useState([]),[X,ge]=p.useState(""),[he,ye]=p.useState(""),[fe,je]=p.useState(""),[qe,ve]=p.useState(!1),[K,Ne]=p.useState(""),[Xe,_e]=p.useState(!1);p.useEffect(()=>{a&&M(a)},[a]),p.useEffect(()=>{(async()=>{const[t,l,n]=await Promise.all([pt(),bt(),gt()]);t.data&&He(t.data.filter(o=>o.is_active)),l.data&&ze(l.data.filter(o=>o.is_active)),n.data&&Ye(n.data.filter(o=>o.is_active))})()},[]);const M=async t=>{z(!0);const{data:l}=await ht(t),n=l;if(!n){z(!1);return}f(n),ne(n.pipeline_status||"new_lead"),ce(n.next_follow_up||"");const[o,d,h,v]=await Promise.all([yt(t),ft(t),jt(t),vt(t,n.full_name)]);P(o.data||[]),b(d.data||[]),S(h.data||[]),Ue({monthly:v.monthly,instant:v.instant}),z(!1)},Ke=p.useMemo(()=>re.findIndex(t=>t.key===s?.pipeline_status),[s?.pipeline_status]),Qe=u.filter(t=>t.status==="verified"||t.status==="uploaded").length,Ze=s?.lead_date?Math.max(0,Math.floor((Date.now()-new Date(s.lead_date).getTime())/864e5)):null,we=A.monthly.length+A.instant.length,et=async()=>{if(!s)return;xe(!0);const{error:t}=await O(s.id,{pipeline_status:Y,next_follow_up:oe||null});if(xe(!1),t){x("Error updating status","error");return}x("Status updated","success"),M(s.id)},tt=async()=>{if(!(!s||q)){ue(!0);try{if(!s.is_active){x("This maid is inactive — reactivate her in Edit Profile before sharing","error"),E();return}if(!s.is_public){const{error:o}=await O(s.id,{is_public:!0});if(o){x(o.message||"Could not make this profile public","error"),E();return}f({...s,is_public:!0})}const{data:t,error:l}=await _t(s.id);if(l){x(l.message||"Public profile link is not working right now","error");return}if(!t){x("Public link is not resolving — check the maid is active and public","error");return}const n=`${window.location.origin}/maid/${s.id}`;try{await navigator.clipboard?.writeText(n),x("Public profile link copied — verified working","success")}catch{window.prompt("Copy this public profile link:",n)}}finally{ue(!1)}}},E=()=>{if(!s)return;const t={};ee.forEach(l=>l.fields.forEach(n=>{const o=s[n.key];Te.includes(n.key)?t[n.key]=Array.isArray(o)?[...o]:[]:n.type==="checkbox"?t[n.key]=!!o:t[n.key]=o??""})),D(t),U({}),B(!0)},at=async()=>{if(!s)return;if(!String(F.full_name||"").trim()){x("Full name is required","error");return}pe(!0);const t={};ee.forEach(n=>n.fields.forEach(o=>{const d=F[o.key];Te.includes(o.key)?t[o.key]=Array.isArray(d)?d:[]:la.includes(o.key)?t[o.key]=!!d:sa.includes(o.key)?t[o.key]=d===""||d===null||d===void 0?null:Number(d):t[o.key]=d===""?null:d}));let{error:l}=await O(s.id,t);if(l&&/quality_grade/i.test(l.message||"")&&(delete t.quality_grade,{error:l}=await O(s.id,t),l||x("Saved, but quality grade needs migration 20260729100000 — run it in the Supabase SQL editor","error")),pe(!1),l){x("Error saving details","error");return}x("Profile updated","success"),B(!1),M(s.id)},J=(t,l)=>D(n=>({...n,[t]:l})),st=(t,l)=>D(n=>{const o=n[t]||[];return{...n,[t]:o.includes(l)?o.filter(d=>d!==l):[...o,l]}}),ke=t=>{const l=(be[t]||"").trim();if(l){if(t==="preferred_pincodes"){const n=$t(l);if(n.length===0)return;D(o=>{const h=[...o[t]||[]];for(const v of n)h.includes(v)||h.push(v);return{...o,[t]:h}}),U(o=>({...o,[t]:""}));return}D(n=>{const o=n[t]||[];return o.some(d=>d.toLowerCase()===l.toLowerCase())?n:{...n,[t]:[...o,l]}}),U(n=>({...n,[t]:""}))}},lt=(t,l)=>D(n=>({...n,[t]:(n[t]||[]).filter(o=>o!==l)})),rt=t=>{const l=F[t.key],n="block text-xs font-medium text-gray-600 mb-1",o="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500";if(t.type==="checkbox")return e.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-700 cursor-pointer py-2 h-full",children:[e.jsx("input",{type:"checkbox",checked:!!l,onChange:d=>J(t.key,d.target.checked),className:"h-4 w-4 text-blue-600 rounded border-gray-300"}),t.label]});if(t.type==="tags"){const d=l||[];return e.jsxs("div",{children:[e.jsx("label",{className:n,children:t.label}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-1.5",children:[d.map(h=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 bg-purple-50 text-purple-700 rounded-full text-xs font-medium",children:[h,e.jsx("button",{type:"button",onClick:()=>lt(t.key,h),children:e.jsx(Mt,{className:"h-3 w-3"})})]},h)),d.length===0&&e.jsx("span",{className:"text-xs text-gray-400",children:"None yet"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:be[t.key]||"",onChange:h=>U(v=>({...v,[t.key]:h.target.value})),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),ke(t.key))},className:o,placeholder:`Add ${t.label.toLowerCase()} + Enter`}),e.jsx("button",{type:"button",onClick:()=>ke(t.key),className:"px-3 py-2 bg-gray-100 rounded-lg text-sm font-medium shrink-0",children:"Add"})]})]})}if(t.type==="services"||t.type==="packages"||t.type==="instant"){const d=l||[],h=t.type==="services"?Ge.map(j=>({id:j.id,label:j.name})):t.type==="packages"?We.filter(j=>(F.service_ids||[]).length===0||(F.service_ids||[]).includes(j.service_id||"")).map(j=>({id:j.id,label:j.title})):Ve.map(j=>({id:j.id,label:j.name})),v=t.type==="instant"?"bg-emerald-500 border-emerald-500":t.type==="packages"?"bg-indigo-600 border-indigo-600":"bg-blue-600 border-blue-600";return e.jsxs("div",{children:[e.jsxs("label",{className:n,children:[t.label," ",e.jsx("span",{className:"text-gray-400 font-normal",children:"(tap to select)"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 max-h-36 overflow-y-auto p-1",children:[h.map(j=>
1{const Q=d.includes(j.id);return e.jsx("button",{type:"button",onClick:()=>st(t.key,j.id),className:`px-3 py-1.5 rounded-full text-sm font-medium border transition-colors ${Q?`${v} text-white`:"bg-white text-gray-600 border-gray-300 hover:border-gray-400"}`,children:j.label},j.id)}),h.length===0&&e.jsx("span",{className:"text-xs text-gray-400",children:"No options available"})]})]})}return t.type==="select"?e.jsxs("div",{children:[e.jsx("label",{className:n,children:t.label}),e.jsxs("select",{value:l??"",onChange:d=>J(t.key,d.target.value),className:o,children:[e.jsx("option",{value:"",children:"—"}),t.options.map(d=>e.jsx("option",{value:d,children:d},d))]})]}):t.type==="textarea"?e.jsxs("div",{children:[e.jsx("label",{className:n,children:t.label}),e.jsx("textarea",{value:l??"",onChange:d=>J(t.key,d.target.value),rows:2,className:o})]}):e.jsxs("div",{children:[e.jsx("label",{className:n,children:t.label}),e.jsx("input",{type:t.type,value:l??"",onChange:d=>J(t.key,d.target.value),className:o,list:t.suggestions?`hint-${t.key}`:void 0}),t.suggestions&&e.jsx("datalist",{id:`hint-${t.key}`,children:t.suggestions.map(d=>e.jsx("option",{value:d},d))})]})},it=async()=>{if(!s||!X.trim())return;ve(!0);const t=await Ae(),{error:l}=await Et({maid_id:s.id,discussion:X.trim(),recruiter:he.trim()||t?.email||"Admin",next_follow_up:fe||null,status:"pending"});if(ve(!1),l){x("Error adding follow-up","error");return}ge(""),ye(""),je(""),x("Follow-up added","success"),M(s.id)},nt=async t=>{const l=t.status==="pending"?"done":"pending";P(n=>n.map(o=>o.id===t.id?{...o,status:l}:o)),await Dt(t.id,{status:l})},ot=async t=>{if(!s)return;const l=u.find(v=>v.doc_type===t),n=l?Z.indexOf(l.status):-1,o=Z[(n+1)%Z.length],{data:d,error:h}=await Pe({maid_id:s.id,doc_type:t,status:o,file_url:l?.file_url??null});if(h){x("Error updating document","error");return}d&&b(v=>[...v.filter(Q=>Q.doc_type!==t),d])},ct=async t=>{if(!s)return;const l=u.find(h=>h.doc_type===t),n=window.prompt(`Paste the file URL for "${t}"`,l?.file_url||"");if(n===null)return;const{data:o,error:d}=await Pe({maid_id:s.id,doc_type:t,status:n?l?.status==="verified"?"verified":"uploaded":l?.status||"pending",file_url:n||null});if(d){x("Error saving file","error");return}o&&b(h=>[...h.filter(v=>v.doc_type!==t),o]),x(n?"Document file linked":"File link removed","success")},dt=async()=>{if(!s||!K.trim())return;_e(!0);const t=await Ae(),{error:l}=await Ft({maid_id:s.id,note:K.trim(),created_by:t?.email||"Admin"});if(_e(!1),l){x("Error adding note","error");return}Ne(""),x("Note added","success"),M(s.id)},xt=async t=>{S(l=>l.filter(n=>n.id!==t)),await Tt(t)},ut=p.useMemo(()=>{if(!s)return[];const t=[];return N.forEach(l=>t.push({date:l.created_at||l.followup_date||"",kind:l.recruiter==="System"?"status":"followup",title:l.recruiter==="System"?"Status update":"Follow-up",desc:l.discussion,who:l.recruiter||void 0})),_.forEach(l=>t.push({date:l.created_at,kind:"note",title:"Note added",desc:l.note,who:l.created_by||void 0})),u.filter(l=>l.status==="verified"||l.status==="uploaded").forEach(l=>t.push({date:l.updated_at||l.created_at,kind:"doc",title:`${l.doc_type} ${l.status}`,desc:void 0})),A.monthly.forEach(l=>t.push({date:l.created_at,kind:"placement",title:`Monthly placement ${l.booking_number}`,desc:`${l.customer_name} • ${w(l.total_amount)}`})),A.instant.forEach(l=>t.push({date:l.created_at,kind:"placement",title:`Instant placement ${l.booking_number}`,desc:`${l.customer_name} • ${w(l.total_amount)}`})),(s.lead_date||s.created_at)&&t.push({date:s.lead_date||s.created_at,kind:"lead",title:"Lead created",desc:s.lead_source?`via ${s.lead_source}`:void 0}),t.filter(l=>l.date).sort((l,n)=>new Date(n.date).getTime()-new Date(l.date).getTime())},[s,N,_,u,A]);if(Je)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-blue-600"})});if(!s)return e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[e.jsx(te,{className:"h-12 w-12 text-gray-300 mx-auto mb-3"}),e.jsx("h3",{className:"text-gray-900 font-semibold mb-2",children:"Maid not found"}),e.jsx("button",{onClick:()=>c("/admin/maids"),className:"text-blue-600 font-semibold text-sm",children:"← Back to Maids"})]});const Se=(s.whatsapp_number||s.phone||"").replace(/\D/g,""),Ce=s.expected_salary_min?`${w(s.expected_salary_min)} - ${w(s.expected_salary_max||s.expected_salary_min)}`:"—",mt=It().state?.from==="smart-match";return e.jsxs("div",{className:"space-y-4 pb-4",children:[r.visible&&e.jsx(Ut,{message:r.message,type:r.type,onClose:g}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[mt?e.jsxs("button",{onClick:()=>c("/admin/smart-match"),className:"flex items-center gap-1.5 font-bold text-violet-600 hover:text-violet-900",children:[e.jsx(Ee,{className:"h-4 w-4"})," Smart Match Engine"]}):e.jsxs("button",{onClick:()=>c("/admin/maids"),className:"flex items-center gap-1.5 font-semibold text-gray-500 hover:text-gray-900",children:[e.jsx(Ee,{className:"h-4 w-4"})," Candidates"]}),e.jsx(Ht,{className:"h-3.5 w-3.5 text-gray-300"}),e.jsx("span",{className:"font-bold text-gray-900",children:s.full_name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Se&&e.jsxs("a",{href:`https://wa.me/${Se}`,target:"_blank",rel:"noreferrer",className:"flex items-center gap-1.5 px-3 py-2 bg-emerald-50 text-emerald-700 rounded-lg text-sm font-bold hover:bg-emerald-100",children:[e.jsx($,{className:"h-4 w-4"})," ",e.jsx("span",{className:"hidden sm:inline",children:"WhatsApp"})]}),s.phone&&e.jsxs("a",{href:`tel:${s.phone}`,className:"flex items-center gap-1.5 px-3 py-2 bg-blue-50 text-blue-700 rounded-lg text-sm font-bold hover:bg-blue-100",children:[e.jsx(ae,{className:"h-4 w-4"})," ",e.jsx("span",{className:"hidden sm:inline",children:"Call"})]}),e.jsxs("button",{onClick:tt,disabled:q,className:`flex items-center gap-1.5 px-3 py-2 rounded-lg text-sm font-bold disabled:opacity-60 ${s.is_public?"bg-vi
1olet-50 text-violet-700 hover:bg-violet-100":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:[e.jsx(Wt,{className:"h-4 w-4"})," ",q?"Checking…":s.is_public?"Share Link":"Make Public"]}),e.jsxs("button",{onClick:E,className:"flex items-center gap-1.5 px-3 py-2 bg-blue-600 text-white rounded-lg text-sm font-bold hover:bg-blue-700",children:[e.jsx(Le,{className:"h-4 w-4"})," Edit Profile"]})]})]}),e.jsx("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6",children:[e.jsxs("div",{className:"lg:col-span-5 flex gap-4",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx("div",{className:"h-28 w-28 rounded-2xl bg-gradient-to-br from-blue-100 to-indigo-100 border border-blue-100 overflow-hidden flex items-center justify-center",children:s.photo_url?e.jsx("img",{src:s.photo_url,alt:s.full_name,className:"h-full w-full object-cover"}):e.jsx(te,{className:"h-12 w-12 text-blue-300"})}),(s.verification_level==="fully_verified"||s.verification_level==="police_verified")&&e.jsxs("span",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 flex items-center gap-0.5 bg-emerald-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full shadow",children:[e.jsx(zt,{className:"h-3 w-3"})," Verified"]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h1",{className:"text-xl font-extrabold text-gray-900 uppercase tracking-tight",children:s.full_name}),e.jsx(Ot,{grade:s.quality_grade,className:"text-xs px-2 py-1"}),s.candidate_code&&e.jsxs("button",{onClick:()=>{navigator.clipboard?.writeText(s.candidate_code),x("ID copied","info")},className:"flex items-center gap-1 bg-emerald-50 text-emerald-700 text-[11px] font-bold px-2 py-0.5 rounded border border-emerald-100",children:["ID: ",s.candidate_code," ",e.jsx(Vt,{className:"h-3 w-3"})]})]}),e.jsxs("div",{className:"mt-2 space-y-1 text-sm text-gray-600",children:[s.phone&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{className:"h-3.5 w-3.5 text-gray-400"})," ",s.phone]}),s.whatsapp_number&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{className:"h-3.5 w-3.5 text-gray-400"})," ",s.whatsapp_number]}),s.email&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Nt,{className:"h-3.5 w-3.5 text-gray-400"})," ",s.email]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"h-3.5 w-3.5 text-gray-400"})," ",[s.location_area,s.city].filter(Boolean).join(", ")||"—"]})]})]})]}),e.jsxs("div",{className:"lg:col-span-4 grid grid-cols-2 gap-x-4 text-sm border-t lg:border-t-0 lg:border-l border-gray-100 pt-4 lg:pt-0 lg:pl-6",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 text-xs",children:"Age / DOB"}),e.jsxs("div",{className:"font-semibold text-gray-900",children:[ra(s.date_of_birth,s.age),s.date_of_birth?` / ${C(s.date_of_birth)}`:""]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 text-xs",children:"Gender"}),e.jsx("div",{className:"font-semibold text-gray-900 capitalize",children:s.gender})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 text-xs",children:"Marital Status"}),e.jsx("div",{className:"font-semibold text-gray-900",children:s.marital_status||"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 text-xs",children:"Current Location"}),e.jsx("div",{className:"font-semibold text-gray-900",children:s.city||"—"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 text-xs",children:"Lead Source"}),e.jsx("div",{className:"font-semibold text-gray-900",children:s.lead_source||"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 text-xs",children:"Recruiter"}),e.jsx("div",{className:"font-semibold text-gray-900",children:s.assigned_recruiter||"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 text-xs",children:"Languages"}),e.jsx("div",{className:"font-semibold text-gray-900",children:(s.languages||[]).join(", ")||"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 text-xs",children:"Aadhaar"}),e.jsx("div",{className:"font-semibold text-gray-900",children:Be(s.aadhaar_number)})]})]})]}),e.jsxs("div",{className:"lg:col-span-3 bg-gray-50 rounded-xl p-4 border border-gray-100",children:[e.jsx("div",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-wider mb-2",children:"Current Status"}),e.jsx("select",{value:Y,onChange:t=>ne(t.target.value),className:`w-full px-3 py-2 rounded-lg text-sm font-bold border-0 mb-2 ${Re[Y]}`,children:Zt.map(t=>e.jsx("option",{value:t.key,children:t.label},t.key))}),e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(H,{className:"h-4 w-4 text-gray-400 shrink-0"}),e.jsx("input",{type:"date",value:oe,onChange:t=>ce(t.target.value),className:"flex-1 min-w-0 px-2 py-1.5 border border-gray-200 rounded-lg text-xs"})]}),e.jsxs("button",{onClick:et,disabled:de,className:"w-full py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-bold disabled:opacity-50 flex items-center justify-center gap-1.5 mb-1.5",children:[e.jsx(Yt,{className:"h-4 w-4"})," ",de?"Updating...":"Update Status"]}),e.jsxs("button",{onClick:()=>V("Follow-ups"),className:"w-full py-2 border border-blue-200 text-blue-700 rounded-lg text-sm font-bold hover:bg-blue-50 flex items-center justify-center gap-1.5",children:[e.jsx(L,{className:"h-4 w-4"})," Add Follow-up"]})]})]})}),e.jsx("div",{className:"bg-white rounded-xl border border-gray-200 px-2",children:e.jsx("div",{className:"flex gap-1 overflow-x-auto no-scrollbar",children:ea.map(t=>{const l=k===t,n=t==="Documents"?u.length:t==="Follow-ups"?N.length:t==="Notes"?_.length:t==="Placements"?we:0;return e.jsxs("button",{onClick:()=>V(t),className:`relative whitespace-nowrap px-3.5 py-3 text-sm font-semibold transition-colors ${l?"text-blue-700":"text-gray-500 hover:text-gray-800"}`,children:[t,n>0&&e.jsx("span",{className:`ml-1.5 text-[10px] font-bold px-1.5 py-0.5 rounded-full ${l?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-500"}`,children:n}),l&&e.jsx("span",{className:"absolute bottom-0 left-2 right-2 h-0.5 bg-blue-600 rounded-full"})]},t)})})}),k==="Overview"&&e.jsx(ia,{maid:s,pipelineIndex:Ke,stats:{followups:N.length,docs:`${Qe}/${ie.length}`,placements:we,days:Ze},documents:u,followups:N,placements:A,salaryRange:Ce,onTab:V}),k==="Personal Information"&&e.jsx(na,{maid:s,onEdit:E}),k==="Experience & Skills"&&e.jsx(oa,{maid:s,onEdit:E}),k==="Job Preference"&&e.jsx(ca,{maid:s,salaryRange:Ce,onEdit:E}),k==="Documents"&&e.jsx(da,{documents:u,onCycle:ot,onAttach:ct}),k==="Follow-ups"&&e.jsx(xa,{followups:N,adding:qe,discussion:X,recruiter:he,nextDate:fe,setDiscussion:ge,setRecruiter:ye,setNextDate:je,onAdd:it,onToggle:nt}),k==="Placements"&&e.jsx(ua,{placements:A}),k==="Notes"&&e.jsx(ma,{notes:_,draft:K,setDraft:Ne,adding:Xe,onAdd:dt,onDelete:xt}),k==="Timeline"&&e.jsx(pa,{events:ut}),e.jsx(Bt,{isOpen:Oe,onClose:()=>B(!1),title:`Edit Profile — ${s.full_name}`,size:"lg",children:e.jsxs("div",{className:"space-y-6",children:[ee.map(t=>e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-blue-600 uppercase tracking-wider border-b border-gray-100 pb-2 mb-3",children:t.title}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:t.fields.map(l=>e.jsx("div",{className:l.full?"md:col-span-2":"",children:rt(l)},l.key))})]},t.title)),e.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-gray-100 sticky bottom-0 bg-white",children:[e.jsx("button",{onClick:()=>B(!1),className:"px-4 py-2 border border-gray-300 rounded-lg text-sm font-semibold text-gray-700 hover:bg-gray-50",children:"Cancel"}),e.jsx("button",{onClick:at,disabled:me,className:"px-6 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50",children:me?"Saving...":"Save Profile"})]})]})})]})}
1const m=({title:a,icon:c,color:r="text-blue-600",action:x,children:g})=>e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b border-gray-100",children:[e.jsxs("h3",{className:"font-bold text-gray-900 text-sm flex items-center gap-2",children:[e.jsx(c,{className:`h-4 w-4 ${r}`})," ",a]}),x]}),g]}),i=({label:a,value:c})=>e.jsxs("div",{className:"flex justify-between gap-3 py-1.5 text-sm",children:[e.jsx("span",{className:"text-gray-500 shrink-0",children:a}),e.jsx("span",{className:"font-semibold text-gray-900 text-right",children:c||e.jsx("span",{className:"text-gray-300",children:"—"})})]}),y=({onClick:a})=>e.jsxs("button",{onClick:a,className:"flex items-center gap-1 text-xs font-bold text-blue-600 hover:text-blue-800",children:[e.jsx(Le,{className:"h-3 w-3"})," Edit"]});function ia({maid:a,pipelineIndex:c,stats:r,documents:x,followups:g,placements:s,salaryRange:f,onTab:N}){const P=[...g].slice(0,5);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-bold text-gray-900 text-sm mb-4",children:"RECRUITMENT PIPELINE"}),e.jsx("div",{className:"overflow-x-auto pb-1",children:e.jsx("div",{className:"flex items-start min-w-[720px]",children:re.map((u,b)=>{const _=c>=0&&b<c,S=b===c;return e.jsxs("div",{className:"flex-1 flex flex-col items-center relative",children:[b>0&&e.jsx("div",{className:`absolute top-3.5 right-1/2 w-full h-0.5 ${_||S?"bg-emerald-400":"bg-gray-200"}`}),e.jsx("div",{className:`relative z-10 h-7 w-7 rounded-full flex items-center justify-center border-2 ${S?"bg-white border-emerald-500 ring-4 ring-emerald-100":_?"bg-emerald-500 border-emerald-500":"bg-white border-gray-300"}`,children:_?e.jsx(qt,{className:"h-3.5 w-3.5 text-white"}):e.jsx("span",{className:`h-2 w-2 rounded-full ${S?"bg-emerald-500":"bg-gray-300"}`})}),e.jsx("div",{className:`mt-1.5 text-[11px] font-bold text-center leading-tight px-1 ${S?"text-emerald-600":_?"text-gray-700":"text-gray-400"}`,children:u.label})]},u.key)})})}),(a.pipeline_status==="rejected"||a.pipeline_status==="inactive")&&e.jsxs("div",{className:`mt-3 inline-flex px-3 py-1 rounded-full text-xs font-bold ${Re[a.pipeline_status]}`,children:["Marked ",a.pipeline_status==="rejected"?"Rejected":"Inactive"]})]}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[{label:"Follow-ups",value:r.followups,icon:G,color:"text-blue-600 bg-blue-50"},{label:"Docs On File",value:r.docs,icon:R,color:"text-emerald-600 bg-emerald-50"},{label:"Placements",value:r.placements,icon:T,color:"text-violet-600 bg-violet-50"},{label:"Days in Pipeline",value:r.days??"—",icon:H,color:"text-amber-600 bg-amber-50"}].map(u=>e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4 flex items-center gap-3",children:[e.jsx("div",{className:`p-2.5 rounded-lg ${u.color}`,children:e.jsx(u.icon,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xl font-bold text-gray-900 leading-none",children:u.value}),e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:u.label})]})]},u.label))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-4",children:[e.jsxs(m,{title:"Quick Details",icon:T,action:e.jsx("button",{onClick:()=>N("Job Preference"),className:"text-xs font-bold text-blue-600",children:"View"}),children:[e.jsx(i,{label:"Work Profile",value:a.preferred_job}),e.jsx(i,{label:"Experience",value:`${a.experience_years||0} Years`}),e.jsx(i,{label:"Previous Location",value:a.previous_location}),e.jsx(i,{label:"Expected Salary",value:f}),e.jsx(i,{label:"Preferred Area",value:a.preferred_area}),e.jsx(i,{label:"Preferred Job Pincodes",value:a.preferred_pincodes?.length?a.preferred_pincodes.join(", "):void 0}),e.jsx(i,{label:"Shift Preference",value:a.preferred_shift}),e.jsx(i,{label:"Joining Date",value:a.joining_availability})]}),e.jsx(m,{title:"Documents Summary",icon:R,color:"text-emerald-600",action:e.jsx("button",{onClick:()=>N("Documents"),className:"text-xs font-bold text-blue-600",children:"All"}),children:e.jsx("div",{className:"space-y-1.5",children:ie.map(u=>{const _=x.find(S=>S.doc_type===u)?.status||"pending";return e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600 truncate",children:u}),e.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-bold capitalize shrink-0 ${Ie[_]}`,children:_})]},u)})})}),e.jsxs(m,{title:"Follow-up Summary",icon:G,action:e.jsx("button",{onClick:()=>N("Follow-ups"),className:"text-xs font-bold text-blue-600",children:"All"}),children:[e.jsx(i,{label:"Total Follow-ups",value:g.length}),e.jsx(i,{label:"Last Follow-up",value:g[0]?C(g[0].created_at):void 0}),e.jsx(i,{label:"Next Follow-up",value:a.next_follow_up?C(a.next_follow_up):void 0}),e.jsx(i,{label:"Pending",value:g.filter(u=>u.status==="pending").length})]}),e.jsxs(m,{title:"Placement Summary",icon:Xt,color:"text-violet-600",action:e.jsx("button",{onClick:()=>N("Placements"),className:"text-xs font-bold text-blue-600",children:"All"}),children:[e.jsx(i,{label:"Total Placements",value:s.monthly.length+s.instant.length}),e.jsx(i,{label:"Monthly",value:s.monthly.length}),e.jsx(i,{label:"Instant",value:s.instant.length}),e.jsx(i,{label:"Current Status",value:e.jsx("span",{className:"capitalize",children:(a.pipeline_status||"").replace(/_/g," ")})})]})]}),e.jsx(m,{title:"Recent Activity",icon:I,children:P.length===0?e.jsx("p",{className:"text-sm text-gray-400 text-center py-4",children:"No activity yet"}):e.jsx("div",{className:"space-y-3",children:P.map(u=>e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"h-8 w-8 rounded-full bg-blue-50 text-blue-600 flex items-center justify-center shrink-0",children:u.recruiter==="System"?e.jsx(I,{className:"h-4 w-4"}):e.jsx($,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm text-gray-800",children:u.discussion}),e.jsxs("p",{className:"text-[11px] text-gray-400",children:[W(u.created_at),u.recruiter?` • ${u.recruiter}`:""]})]})]},u.id))})})]})}function na({maid:a,onEdit:c}){return e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs(m,{title:"Family Details",icon:wt,action:e.jsx(y,{onClick:c}),children:[e.jsx(i,{label:"Father's / Husband's Name",value:a.father_husband_name}),e.jsx(i,{label:"Marital Status",value:a.marital_status}),e.jsx(i,{label:"No. of Children",value:a.children_count??void 0}),e.jsx(i,{label:"Native State",value:a.native_state})]}),e.jsxs(m,{title:"Personal Details",icon:te,action:e.jsx(y,{onClick:c}),children:[e.jsx(i,{label:"Height / Weight",value:a.height_weight}),e.jsx(i,{label:"Date of Birth",value:a.date_of_birth?C(a.date_of_birth):void 0}),e.jsx(i,{label:"Age",value:a.age?`${a.age} Years`:void 0}),e.jsx(i,{label:"Gender",value:e.jsx("span",{className:"capitalize",children:a.gender})})]}),e.jsxs(m,{title:"Religion & Caste",icon:kt,color:"text-rose-500",action:e.jsx(y,{onClick:c}),children:[e.jsx(i,{label:"Religion",value:a.religion}),e.jsx(i,{label:"Caste",value:a.caste})]}),e.jsx(m,{title:"Education",icon:St,color:"text-indigo-600",action:e.jsx(y,{onClick:c}),children:e.jsx(i,{label:"Education",value:a.education_level})}),e.jsx(m,{title:"Languages Known",icon:Me,color:"text-cyan-600",action:e.jsx(y,{onClick:c}),children:(a.languages||[]).length?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:(a.languages||[]).map(r=>e.jsx("span",{className:"px-2.5 py-1 bg-cyan-50 text-cyan-700 rounded-full text-xs font-medium",children:r},r))}):e.jsx("p",{className:"text-sm text-gray-300",children:"—"})}),e.jsxs(m,{title:"Emergency & Contact",icon:ae,color:"text-emerald-600",action:e.jsx(y,{onClick:c}),children:[e.jsx(i,{label:"Emergency Contact",value:a.emergency_contact}
1),e.jsx(i,{label:"Phone",value:a.phone}),e.jsx(i,{label:"WhatsApp",value:a.whatsapp_number}),e.jsx(i,{label:"Email",value:a.email}),e.jsx(i,{label:"Aadhaar",value:Be(a.aadhaar_number)})]}),e.jsxs(m,{title:"Current Address",icon:$e,color:"text-amber-600",action:e.jsx(y,{onClick:c}),children:[e.jsx(i,{label:"Area / Locality",value:a.location_area}),e.jsx(i,{label:"City",value:a.city}),e.jsx(i,{label:"Pincode",value:a.pincode})]})]})}function oa({maid:a,onEdit:c}){return e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs(m,{title:"Work Experience",icon:T,action:e.jsx(y,{onClick:c}),children:[e.jsx(i,{label:"Total Experience",value:`${a.experience_years||0} Years`}),e.jsx(i,{label:"Preferred Job",value:a.preferred_job}),e.jsx(i,{label:"Work Type",value:a.live_in_preference})]}),e.jsxs(m,{title:"Previous Employment",icon:G,color:"text-slate-600",action:e.jsx(y,{onClick:c}),children:[e.jsx(i,{label:"Previous Job",value:a.previous_job}),e.jsx(i,{label:"Location",value:a.previous_location}),e.jsx(i,{label:"Reason for Leaving",value:a.reason_for_leaving})]}),e.jsxs(m,{title:"Previous Salary",icon:le,color:"text-emerald-600",action:e.jsx(y,{onClick:c}),children:[e.jsx(i,{label:"Last Drawn",value:w(a.previous_salary)}),e.jsx(i,{label:"Expected Min",value:w(a.expected_salary_min)}),e.jsx(i,{label:"Expected Max",value:w(a.expected_salary_max)})]}),e.jsx(m,{title:"Skills",icon:Ct,color:"text-amber-500",action:e.jsx(y,{onClick:c}),children:(a.skills||[]).length?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:(a.skills||[]).map(r=>e.jsx("span",{className:"px-2.5 py-1 bg-amber-50 text-amber-700 rounded-full text-xs font-medium",children:r},r))}):e.jsx("p",{className:"text-sm text-gray-300",children:"—"})}),e.jsx(m,{title:"Languages Known",icon:Me,color:"text-cyan-600",action:e.jsx(y,{onClick:c}),children:(a.languages||[]).length?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:(a.languages||[]).map(r=>e.jsx("span",{className:"px-2.5 py-1 bg-cyan-50 text-cyan-700 rounded-full text-xs font-medium",children:r},r))}):e.jsx("p",{className:"text-sm text-gray-300",children:"—"})}),e.jsxs(m,{title:"Additional Information",icon:Pt,color:"text-indigo-600",action:e.jsx(y,{onClick:c}),children:[e.jsx(i,{label:"Comfortable with Pets",value:a.comfortable_with_pets?"Yes":"No"}),e.jsx(i,{label:"Max Family Size",value:a.max_family_size??void 0}),e.jsx(i,{label:"Verification",value:e.jsx("span",{className:"capitalize",children:(a.verification_level||"").replace(/_/g," ")})}),e.jsx(i,{label:"Rating",value:a.rating?`${Number(a.rating).toFixed(1)} / 5`:void 0})]})]})}function ca({maid:a,salaryRange:c,onEdit:r}){return e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs(m,{title:"Preferred Job Details",icon:T,action:e.jsx(y,{onClick:r}),children:[e.jsx(i,{label:"Preferred Job",value:a.preferred_job}),e.jsx(i,{label:"Work Type",value:a.live_in_preference}),e.jsx(i,{label:"Availability",value:a.is_available?"Available":"Not available"})]}),e.jsxs(m,{title:"Salary Preference",icon:le,color:"text-emerald-600",action:e.jsx(y,{onClick:r}),children:[e.jsx(i,{label:"Expected Range",value:c}),e.jsx(i,{label:"Per Day",value:w(a.daily_rate)}),e.jsx(i,{label:"Per Hour",value:w(a.hourly_rate)}),e.jsx(i,{label:"Negotiable",value:a.salary_negotiable?"Yes":"No"})]}),e.jsxs(m,{title:"Accommodation",icon:$e,color:"text-amber-600",action:e.jsx(y,{onClick:r}),children:[e.jsx(i,{label:"Accommodation",value:a.accommodation_required}),e.jsx(i,{label:"Live-in / Full-time",value:a.live_in_preference})]}),e.jsx(m,{title:"Food Preference",icon:At,color:"text-rose-500",action:e.jsx(y,{onClick:r}),children:e.jsx(i,{label:"Food",value:a.food_preference})}),e.jsxs(m,{title:"Job Location Preference",icon:Fe,color:"text-blue-600",action:e.jsx(y,{onClick:r}),children:[e.jsx(i,{label:"Preferred Area",value:a.preferred_area}),e.jsx(i,{label:"Preferred Job Pincodes",value:a.preferred_pincodes?.length?a.preferred_pincodes.join(", "):void 0}),e.jsx(i,{label:"Home Locality & City",value:[a.location_area,a.city].filter(Boolean).join(", ")||void 0}),e.jsx(i,{label:"Home Pincode",value:a.pincode})]}),e.jsxs(m,{title:"Other Preferences",icon:H,color:"text-indigo-600",action:e.jsx(y,{onClick:r}),children:[e.jsx(i,{label:"Preferred Shift",value:a.preferred_shift}),e.jsx(i,{label:"Joining Availability",value:a.joining_availability})]})]})}function da({documents:a,onCycle:c,onAttach:r}){return e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between",children:[e.jsxs("h3",{className:"font-bold text-gray-900 text-sm flex items-center gap-2",children:[e.jsx(R,{className:"h-4 w-4 text-blue-600"})," Documents"]}),e.jsx("span",{className:"text-[11px] text-gray-400",children:"Tap a status to cycle • pending → uploaded → verified → rejected"})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-left text-[11px] text-gray-400 uppercase tracking-wide bg-gray-50",children:[e.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Document Type"}),e.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"File"}),e.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Status"}),e.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Updated"}),e.jsx("th",{className:"px-4 py-2.5 font-semibold text-right",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-50",children:ie.map(x=>{const g=a.find(f=>f.doc_type===x),s=g?.status||"pending";return e.jsxs("tr",{className:"hover:bg-gray-50/50",children:[e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"h-9 w-9 rounded-lg bg-blue-50 text-blue-600 flex items-center justify-center shrink-0",children:e.jsx(R,{className:"h-4 w-4"})}),e.jsx("span",{className:"font-semibold text-gray-800",children:x})]})}),e.jsx("td",{className:"px-4 py-3",children:g?.file_url?e.jsx("a",{href:g.file_url,target:"_blank",rel:"noreferrer",className:"text-blue-600 font-medium text-xs truncate max-w-[10rem] inline-block",children:g.file_url.split("/").pop()}):e.jsx("span",{className:"text-gray-300 text-xs",children:"No file"})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("button",{onClick:()=>c(x),className:`px-2.5 py-1 rounded-full text-[11px] font-bold capitalize ${Ie[s]}`,children:s})}),e.jsx("td",{className:"px-4 py-3 text-gray-500 text-xs whitespace-nowrap",children:g?.updated_at?C(g.updated_at):"—"}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[g?.file_url&&e.jsx("a",{href:g.file_url,target:"_blank",rel:"noreferrer",className:"p-1.5 rounded-lg hover:bg-blue-50 text-blue-600",title:"View",children:e.jsx(Kt,{className:"h-4 w-4"})}),e.jsx("button",{onClick:()=>r(x),className:"px-2.5 py-1.5 rounded-lg border border-gray-200 text-xs font-semibold text-gray-600 hover:bg-gray-50",children:g?.file_url?"Change":"Add File"})]})})]},x)})})]})})]})}function xa({followups:a,adding:c,discussion:r,recruiter:x,nextDate:g,setDiscussion:s,setRecruiter:f,setNextDate:N,onAdd:P,onToggle:u}){return e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsx(m,{title:"Follow-up History",icon:G,children:a.length===0?e.jsx("p",{className:"text-sm text-gray-400 text-center py-6",children:"No follow-ups yet"}):e.jsx("div",{className:"space-y-3",children:a.map(b=>e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:`h-8 w-8 rounded-full flex items-center justify-center shrink-0 ${b.recruiter==="System"?"bg-slate-100 text-slate-500":"bg-blue-50 text-blue-600"}`,children:b.recruiter==="System"?e.jsx(I,{className:"h-4 w-4"}):e.jsx($,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1 pb-3 border-b border-gray-50",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-sm text-gray-800",children:b.discussion}),e.jsx("button",{onClick:()=>u(b),className:`px-2 py-0.5 rounded-full text-[10px] font-bold capitalize shrink-0 ${b.status==="done"?"bg-emerald-100 text-emerald-700":"bg-amber-100 text-amber-700"}`,children:b.status})]}),e.jsxs("p",{className:"text-[11px] text-gray-400 mt-0.5",children:[W(b.created_at),b.recruiter?` • ${b.recruiter}`:"",b.next_follow_up?` • Next: ${C(b.next_follow_up)}`:""]})]})]},b.id))})})}),e.jsx(m,{title:"Add Follow-up",icon:L,color:"text-emerald-600",children:e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("textarea",{value:r,onChange:b=>s(b.target.value),rows:3,placeholder:"Discussion / outcome…",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm"}),e.jsx("input",{value:x,onChange:b=>f(b.target.value),placeholder:"Recruiter",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 mb-1",children:"Next Follow-up Date"}),e.jsx("input",{type:"date",value:g,onChange:b=>N(b.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm"})]}),e.jsxs("button",{onClick:P,disabled:c||!r.trim(),className:"w-full py-2.5 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-bold disabled:opacity-40 flex items-center justify-center gap-1.5",children:[e.jsx(L,{className:"h-4 w-4"})," ",c?"Saving…":"Save Follow-up"]})]})})]})}function ua({placements:a}){const c=[...a.monthly.map(r=>({...r,kind:"monthly"})),...a.instant.map(r=>({...r,kind:"instant"}))];return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[{label:"Total Placements",value:c.length,color:"text-violet-600 bg-violet-50",icon:T},{label:"Monthly",value:a.monthly.length,color:"text-blue-600 bg-blue-50",icon:H},{label:"Instant",value:a.instant.length,color:"text-emerald-600 bg-emerald-50",icon:De},{label:"Total Value",value:w(c.reduce((r,x)=>r+Number(x.total_amount||0),0)),color:"text-amber-600 bg-amber-50",icon:le}].map(r=>e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4 flex items-center gap-3",children:[e.jsx("div",{className:`p-2.5 rounded-lg ${r.color}`,children:e.jsx(r.icon,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-lg font-bold text-gray-900 leading-none",children:r.value}),e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:r.label})]})]},r.label))}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[e.jsx("div",{className:"p-4 border-b border-gray-100",children:e.jsx("h3",{className:"font-bold text-gray-900 text-sm",children:"Placement History"})}),c.length===0?e.jsxs("div",{className:"text-center py-10",children:[e.jsx("span",{className:"inline-flex px-3 py-1 rounded-full text-xs font-bold bg-red-50 text-red-500",children:"Not Placed Yet"}),e.jsx("p",{className:"text-xs text-gray-400 mt-2",children:"Assign this maid on a booking to see placements here."})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-left text-[11px] text-gray-400 uppercase tracking-wide bg-gray-50",children:[e.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Booking"}),e.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Type"}),e.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Customer"}),e.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Date"}),e.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Amount"}),e.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Status"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-50",children:c.map(r=>e.jsxs("tr",{className:"hover:bg-gray-50/50",children:[e.jsx("td",{className:"px-4 py-3 font-mono font-bold text-gray-900",children:r.booking_number}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("span",{className:`inline-flex items-center gap-0.5 text-[10px] font-extrabold text-white px-2 py-0.5 rounded-full ${r.kind==="instant"?"bg-emerald-500":"bg-blue-600"}`,children:[r.kind==="instant"&&e.jsx(De,{className:"h-2.5 w-2.5 fill-white"}),r.kind.toUpperCase()]})}),e.jsx("td",{className:"px-4 py-3 text-gray-700",children:r.customer_name}),e.jsx("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:r.kind==="instant"?r.is_asap?"ASAP":C(r.scheduled_date):C(r.start_date)}),e.jsx("td",{className:"px-4 py-3 font-bold text-gray-900",children:w(r.total_amount)}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"capitalize text-gray-500",children:String(r.status).replace(/_/g," ")})})]},r.id))})]})})]})]})}function ma({notes:a,draft:c,setDraft:r,adding:x,onAdd:g,onDelete:s}){return e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs(m,{title:"Add Note",icon:se,color:"text-amber-500",children:[e.jsx("textarea",{value:c,onChange:f=>r(f.target.value),rows:4,placeholder:"Add a new note…",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm mb-2"}),e.jsxs("button",{onClick:g,disabled:x||!c.trim(),className:"w-full py-2.5 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-bold disabled:opacity-40 flex items-center justify-center gap-1.5",children:[e.jsx(L,{className:"h-4 w-4"})," ",x?"Saving…":"Add Note"]})]}),e.jsx("div",{className:"lg:col-span-2",children:e.jsx(m,{title:`All Notes (${a.length})`,icon:se,color:"text-amber-500",children:a.length===0?e.jsx("p",{className:"text-sm text-gray-400 text-center py-6",children:"No notes yet"}):e.jsx("div",{className:"space-y-2 max-h-[32rem] overflow-y-auto",children:a.map(f=>e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-lg p-3 relative group",children:[e.jsxs("div",{className:"text-[11px] font-bold text-amber-700 mb-1",children:[W(f.created_at),f.created_by?` — ${f.created_by}`:""]}),e.jsx("p",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:f.note}),e.jsx("button",{onClick:()=>s(f.id),className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 text-amber-400 hover:text-red-500 transition-opacity",children:e.jsx(Qt,{className:"h-3.5 w-3.5"})})]},f.id))})})})]})}function pa({events:a}){const c={lead:{icon:L,cls:"bg-sky-100 text-sky-600"},followup:{icon:$,cls:"bg-blue-100 text-blue-600"},status:{icon:I,cls:"bg-violet-100 text-violet-600"},note:{icon:se,cls:"bg-amber-100 text-amber-600"},doc:{icon:R,cls:"bg-emerald-100 text-emerald-600"},placement:{icon:T,cls:"bg-green-100 text-green-600"}};return e.jsx(m,{title:"Activity Timeline",icon:I,children:a.length===0?e.jsx("p",{className:"text-sm text-gray-400 text-center py-6",children:"No activity yet"}):e.jsx("div",{className:"relative pl-2",children:a.map((r,x)=>{const g=c[r.kind]||c.followup;return e.jsxs("div",{className:"flex gap-3 pb-4 relative",children:[x<a.length-1&&e.jsx("span",{className:"absolute left-[15px] top-8 bottom-0 w-px bg-gray-200"}),e.jsx("div",{className:`h-8 w-8 rounded-full flex items-center justify-center shrink-0 z-10 ${g.cls}`,children:e.jsx(g.icon,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-900",children:r.title}),r.desc&&e.jsx("p",{className:"text-sm text-gray-600",children:r.desc}),e.jsxs("p",{className:"text-[11px] text-gray-400 mt-0.5",children:[W(r.date),r.who?` • ${r.who}`:""]})]})]},x)})})})}export{Ja as AdminMaidProfile};

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.