PageSourceSearch

https://app.metty.ai/assets/Profile-k4uv0nhK.js

js metty.ai collected 2026-10-05 14:00:01 UTC 71,333 bytes, 1 lines download raw bytes

1import{b0 as s,bd as ke,aU as e,x as je,aY as W,a as Ne,ar as fe,aj as at,T as Le,E as st,aw as ae,aP as xe,a6 as lt,g as Pe,C as nt,W as it,h as ot,H as Oe,l as ct,bo as ne,P as Ve,G as We,ai as He,N as $e,F as dt,be as Be,bh as mt,bg as ut,aX as xt,aH as gt}from"./index-DzBlipNH.js";import{P as we}from"./plus-BlvbeQM2.js";import{P as be,L as pt,a as Ce,b as ht}from"./ProfileHandleField-zEfLUbRk.js";import{T as yt}from"./trash-2-vYyZcTqs.js";import{F as Ye}from"./file-BuLjPA7x.js";import{I as ft}from"./image-kXBGWeG2.js";import{P as bt}from"./ProfileCompletionCard-MDzF6FvT.js";import{C as kt}from"./camera-2w4O-pIm.js";import{L as vt}from"./LayerContent-B4Jx8IGs.js";import"./copy-CHrcEgpE.js";import"./circle-x-Ol9C2w9Z.js";const jt=({user:r,onTriggerAdd:u})=>{const[x,F]=s.useState([]),[E,m]=s.useState(!1),[n,j]=s.useState(!1),[w,P]=s.useState(null),[z,Z]=s.useState(!1),[U,o]=s.useState(!1),[_,te]=s.useState({}),[g,ee]=s.useState(null),R=ke(),[ie,H]=s.useState(!1),[S,K]=s.useState({projectName:"",description:"",companyName:"",cost:"",startDate:"",endDate:"",inProgress:!1,attachments:[],attachmentUrls:[],skills:[],newSkill:""}),q=Array.isArray(x)&&x.length>0,se=a=>/\.(jpg|jpeg|png|gif|bmp|webp|svg|avif|tiff|jfif)$/i.test(a),oe=a=>/\.(mp4|mov|avi|wmv|flv|webm|mkv|m4v|3gp)$/i.test(a),le=a=>/\.(pdf)$/i.test(a),i=a=>{var p;switch((p=a.split(".").pop())==null?void 0:p.toLowerCase()){case"pdf":return"PDF Document";case"doc":case"docx":return"Word Document";case"xls":case"xlsx":return"Excel Spreadsheet";case"ppt":case"pptx":return"PowerPoint Presentation";case"txt":return"Text File";case"zip":case"rar":return"Compressed File";case"jpg":case"jpeg":case"png":case"gif":case"webp":return"Image File";case"mp4":case"mov":case"avi":return"Video File";default:return"Document"}},f=a=>a.split("/").pop()||"Download File";s.useEffect(()=>{var a;if((a=r==null?void 0:r.profile)!=null&&a.projects){let d=r.profile.projects;d&&typeof d=="object"&&!Array.isArray(d)&&(d=[]);const p=d.map((h,T)=>({id:h.id||`project-${T}`,projectName:h.projectName||"Untitled Project",description:h.description||"No description available",companyName:h.companyName||"No company specified",cost:h.cost||"Not specified",startDate:h.startDate||"",endDate:h.endDate||"",inProgress:h.inProgress||!1,attachments:h.attachments||[],skills:h.skills||[]}));F(p)}},[r]),s.useEffect(()=>{u&&u(()=>{m(!0),j(!1),P(null)})},[u]);const C=async a=>{try{o(!0);const d=new FormData;d.append("file",a);const p=await ae.post("/bidding/uploadToS3",d,{headers:{"Content-Type":"multipart/form-data"}});if(p.success&&p.url)return p.url;throw new Error("Upload failed")}catch(d){throw console.error("Error uploading file:",d),d}finally{o(!1)}},J=async a=>{const d=[];for(const p of a)try{te(T=>({...T,[p.name]:0}));const h=await C(p);d.push(h),te(T=>({...T,[p.name]:100}))}catch(h){throw console.error(`Failed to upload ${p.name}:`,h),h}return d},Q=(a,d)=>{K(p=>({...p,[a]:d}))},t=a=>{const d=a.target.files;if(d){const p=Array.from(d);K(h=>({...h,attachments:[...h.attachments,...p]}))}},b=a=>{K(d=>({...d,attachments:d.attachments.filter((p,h)=>h!==a)}))},y=a=>a.type.startsWith("image/")?e.jsx(ft,{size:16,className:"text-green-500"}):a.type==="application/pdf"?e.jsx(je,{size:16,className:"text-red-500"}):a.type.includes("video")?e.jsx(lt,{size:16,className:"text-purple-500"}):e.jsx(Ye,{size:16,className:"text-blue-500"}),$=a=>{if(a===0)return"0 Bytes";const d=1024,p=["Bytes","KB","MB","GB"],h=Math.floor(Math.log(a)/Math.log(d));return parseFloat((a/Math.pow(d,h)).toFixed(2))+" "+p[h]},D=()=>{K({projectName:"",description:"",companyName:"",cost:"",startDate:"",endDate:"",inProgress:!1,attachments:[],attachmentUrls:[],skills:[],newSkill:""}),P(null),j(!1),te({})},ge=()=>{D(),m(!0)},ce=a=>{K({projectName:a.projectName,description:a.description,companyName:a.companyName,cost:a.cost,startDate:a.startDate,endDate:a.endDate,inProgress:a.inProgress,attachments:[],attachmentUrls:a.attachments||[],skills:a.skills||[],newSkill:""}),P(a),j(!0),m(!0)},de=async a=>{a.preventDefault(),Z(!0);try{let d=[];S.attachments.length>0&&(d=await J(S.attachments));const p=[...S.attachmentUrls,...d],h={id:(w==null?void 0:w.id)||Date.now().toString(),projectName:S.projectName,description:S.description,companyName:S.companyName,cost:S.cost,startDate:S.startDate,endD
1ate:S.endDate,inProgress:S.inProgress,attachments:p,skills:S.skills};let T;n&&w?T=x.map(M=>M.id===w.id?h:M):T=[...x,h],F(T);const v={projects:T.map(M=>({projectName:M.projectName,description:M.description,companyName:M.companyName,cost:M.cost,startDate:M.startDate,endDate:M.endDate,inProgress:M.inProgress,attachments:M.attachments,skills:M.skills}))};console.log("Sending portfolio data:",v);const A=await ae.post("/editProfile/edit-Current-User",v),re=await R(xe()).unwrap();console.log("Portfolio saved successfully:",A),m(!1),D()}catch(d){console.error("Error saving portfolio:",d)}finally{Z(!1)}},pe=async a=>{console.log("Delete portfolio with id:",a)},ye=a=>{ee(a),H(!0)},he=({item:a})=>{const d=a.attachments||[],p=d.filter(v=>se(v)),h=d.filter(v=>!se(v)&&!oe(v)),T=v=>{if(!v)return"Not specified";try{return new Date(v).toLocaleDateString("en-US",{day:"numeric",month:"short",year:"numeric"})}catch{return v}};return e.jsxs(W.div,{className:" rounded-md overflow-hidden border border-gray-200 dark:border-gray-700",children:[p.length>0&&e.jsx("div",{className:"relative h-48  overflow-hidden",children:p.length===1?e.jsx("div",{className:"w-full h-full cursor-pointer",onClick:()=>ye(p[0]),children:e.jsx("img",{src:p[0],alt:a.projectName,className:"w-full h-full object-cover hover:scale-105 transition-transform duration-300",onError:v=>{v.currentTarget.src="https://via.placeholder.com/400x200?text=Image+Not+Found"}})}):e.jsx("div",{className:"grid grid-cols-2 h-full gap-1",children:p.slice(0,4).map((v,A)=>e.jsxs("div",{className:`relative overflow-hidden cursor-pointer ${A===0&&p.length>1?"col-span-2":""}`,onClick:()=>ye(v),children:[e.jsx("img",{src:v,alt:`${a.projectName} ${A+1}`,className:"w-full h-full object-cover hover:scale-110 transition-transform duration-300",onError:re=>{re.currentTarget.src="https://via.placeholder.com/200x200?text=Image+Error"}}),A===3&&p.length>4&&e.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-60 flex items-center justify-center",children:e.jsxs("span",{className:"text-white font-semibold text-sm",children:["+",p.length-4," more"]})})]},A))})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex justify-between items-start mb-4",children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900 dark:text-white mb-1 line-clamp-1",children:a.projectName.slice(0,20)||"Untitled Project"}),e.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-400 font-medium",children:a.companyName.slice(0,30)||"No company specified"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>ce(a),className:"ml-2 p-2 text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-all duration-200",children:e.jsx(be,{size:16})}),e.jsx("button",{onClick:()=>pe(a.id),className:"text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300 text-sm font-medium transition-colors duration-200",children:e.jsx(yt,{size:16})})]})]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300 text-xs leading-relaxed mb-4 line-clamp-3",children:a.description}),e.jsxs("div",{className:"space-y-2 mb-4",children:[e.jsxs("div",{className:"flex justify-between items-center text-sm",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"Budget:"}),e.jsx("span",{className:"font-semibold text-gray-900 dark:text-white",children:a.cost})]}),e.jsxs("div",{className:"flex justify-between items-center text-sm",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"Timeline:"}),e.jsxs("span",{className:"font-medium text-gray-900 dark:text-white",children:[T(a.startDate)," -"," ",a.inProgress?"Present":T(a.endDate)]})]})]}),a.inProgress&&e.jsx("div",{className:"mb-4",children:e.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:[e.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full mr-1 animate-pulse"}),"In Progress"]})}),a.skills&&a.skills.length>0&&e.jsx("div",{className:"mb-4",children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[a.skills.slice(0,4).map((v,A)=>e.jsx("span",{className:"inline-block bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 px-2 py-1 rounded text-xs",children:v},A)),a.skills.length>4&&e.jsxs("span",{className:"inline-block bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 px-2 py-1 rounded text-xs",children:["+",a.skills.length-4," more"]})]})}),d.length>0&&e.jsx("div",{className:"mt-4",children:h.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2 font-medium",children:"Documents:"}),e.jsx("div",{className:"space-y-2",children:h.map((v,A)=>e.jsxs("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-200 group border border-gray-200 dark:border-gray-600",children:[e.jsxs("div",{className:"flex items-center space-x-3 flex-1 min-w-0",children:[le(v)?e.jsx(je,{size:16,className:"text-red-500 flex-shrink-0"}):e.jsx(Ye,{size:16,className:"text-blue-500 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dar
1k:group-hover:text-blue-400 transition-colors",children:f(v)}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:i(v)})]})]}),e.jsx(st,{size:14,className:"text-gray-400 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors flex-shrink-0"})]},A))})]})})]})]})};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:" overflow-hidden border border-primary dark:border-gray-400 mt-6 mb-6",children:e.jsxs("div",{className:"p-6 sm:p-8",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("h3",{className:"text-lg flex gap-3 items-center font-semibold text-gray-900 dark:text-white",children:[e.jsx(je,{size:18})," Work Show Case"]}),!E&&e.jsxs("button",{onClick:ge,className:"flex items-center gap-2 underline  text-sm font-medium text-primary dark:text-gray-400 hover:text-primary-800 dark:hover:text-gray-300 transition-colors duration-200",children:[e.jsx(we,{size:16}),"Add You Work"]})]}),e.jsx("div",{className:"space-y-6",children:q?e.jsx(W.div,{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",initial:"hidden",animate:"visible",variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1}}},children:x.map(a=>e.jsx(he,{item:a},a.id))}):e.jsxs("div",{className:"text-center ",children:[e.jsx("div",{className:"text-gray-400 dark:text-gray-500 mb-3",children:e.jsx(je,{size:48,className:"mx-auto"})}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm mb-4",children:"No work added yet. Showcase your work to attract clients."})]})})]})}),e.jsx(Ne,{children:ie&&g&&e.jsx(W.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black bg-opacity-90 z-50 flex items-center justify-center p-4",onClick:()=>H(!1),children:e.jsxs(W.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},className:"relative max-w-4xl max-h-full",onClick:a=>a.stopPropagation(),children:[e.jsx("img",{src:g,alt:"Project preview",className:"max-w-full max-h-full object-contain rounded-lg"}),e.jsx("button",{onClick:()=>H(!1),className:"absolute top-4 right-4 text-white hover:text-gray-300 transition-colors duration-200 bg-black bg-opacity-50 rounded-full p-2",children:e.jsx(fe,{size:24})})]})})}),e.jsx(Ne,{children:E&&e.jsxs(e.Fragment,{children:[e.jsx(W.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black bg-opacity-50 z-40",onClick:()=>m(!1)}),e.jsx(W.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed right-0 top-0 h-full w-full max-w-md bg-background dark:bg-gray-900 shadow-xl z-50 overflow-y-auto",children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:n?"Edit Work":"Add Work"}),e.jsx("button",{onClick:()=>m(!1),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:e.jsx(fe,{size:24})})]}),e.jsxs("form",{onSubmit:de,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Title *"}),e.jsx("input",{type:"text",required:!0,value:S.projectName,onChange:a=>Q("projectName",a.target.value),className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter project name"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Description *"}),e.jsx("textarea",{required:!0,value:S.description,onChange:a=>Q("description",a.target.value),rows:4,className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Describe the project, your role, and achievements..."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Project Cost"}),e.jsx("input",{type:"text",value:S.cost,onChange:a=>Q("cost",a.target.value),className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"e.g., $50,000 or 50L INR"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Attachments"}),e.jsxs("div",{className:"border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-4 text-center",children:[e.jsx("input",{type:"file",multiple:!0,onChange:t,className:"hidden",id:"file-upload",accept:"image/*,.pdf,.doc,.docx,.txt,.mp4,.mov,.avi"}),e.jsxs("label",{htmlFor:"file-upload",className:"cursor-pointer flex flex-col items-center justify-center",children:[e.jsx(at,{size:24,className:"text-gray-400 mb-2"}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Click to upload files or drag and drop"}),e.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500 mt-1",children:"Images, PDF, DOC, Videos (Max 10MB each)"})]})]}),S.attachments.length>0&&e.jsx("div",{className:"mt-3 space-y-2",children:S.attachments.map((a,d)=>e.jsxs("div",{className:"flex items-center justify-between p-2 bg-transparent border border-gray-300 dark:bg-gray-800 rounded",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[U&&_[a.name]!==100?e.jsx(Le,{size:16,className:"animate-spin text-blue-500"}):y(a),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:a.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:["(",$(a.size),")"]}),U&&_[a.name]!==100&&e.jsx("span",{className:"text-xs text-blue-500",children:"Uploading..."}),_[a.name]===100&&e.jsx("span",{className:"text-xs text-green-500",children:"✓ Uploaded"})]}),e.jsx("button",{type:"button",onClick:()=>b(d),className:"text-red-500 hover:text-red-700",disabled:U,children:e.jsx(fe,{size:16})})]},d))})]}),e.jsxs("div",{className:"flex gap-3 pt-4",children:[e.jsx("button",{type:"submit",disabled:z||U,className:"flex-1 bg-primary disabled:bgprimary/50 dark:bg-secondary text-white py-2 px-4 roun
1ded-lg transition-colors duration-200 flex items-center justify-center",children:z||U?e.jsxs(e.Fragment,{children:[e.jsx(Le,{size:16,className:"animate-spin mr-2"}),U?"Uploading...":"Saving..."]}):n?"Update Portfolio":"Add Portfolio"}),e.jsx("button",{type:"button",onClick:()=>m(!1),disabled:z||U,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors duration-200 disabled:opacity-50",children:"Cancel"})]})]})]})})]})})]})},Nt=({user:r,onTriggerAdd:u})=>{const[x,F]=s.useState([]),[E,m]=s.useState(!1),[n,j]=s.useState(!1),[w,P]=s.useState(null),[z,Z]=s.useState(!1),U=ke(),[o,_]=s.useState({title:"",employmentType:"",companyName:"",startYear:"",startMonth:"",endYear:"",endMonth:"",currentlyWorking:!1,location:"",locationType:"",description:"",companyURL:""}),te=x.length>0;s.useEffect(()=>{var t;if((t=r==null?void 0:r.profile)!=null&&t.fullPositions){const b=r.profile.fullPositions.map((y,$)=>{var D;return{id:y.id||`position-${$}`,title:y.title||"",employmentType:y.employmentType||"",companyName:y.companyName||"",start:y.start||{year:0,month:0,day:0},end:y.end||{year:0,month:0,day:0},currentlyWorking:!((D=y.end)!=null&&D.year)||y.end.year===0,location:y.location||"",locationType:y.locationType||"",description:y.description||"",companyURL:y.companyURL||"",companyLogo:y.companyLogo,companyIndustry:y.companyIndustry}});F(b)}},[r]),s.useEffect(()=>{u&&u(()=>{m(!0),j(!1),P(null)})},[u]);const g=(t,b)=>{_(y=>({...y,[t]:b}))},ee=()=>{_({title:"",employmentType:"",companyName:"",startYear:"",startMonth:"",endYear:"",endMonth:"",currentlyWorking:!1,location:"",locationType:"",description:"",companyURL:""}),P(null),j(!1)},R=()=>{ee(),m(!0)},ie=t=>{var b,y,$,D,ge,ce,de,pe;_({title:t.title,employmentType:t.employmentType,companyName:t.companyName,startYear:((y=(b=t.start)==null?void 0:b.year)==null?void 0:y.toString())||"",startMonth:((D=($=t.start)==null?void 0:$.month)==null?void 0:D.toString())||"",endYear:((ce=(ge=t.end)==null?void 0:ge.year)==null?void 0:ce.toString())||"",endMonth:((pe=(de=t.end)==null?void 0:de.month)==null?void 0:pe.toString())||"",currentlyWorking:t.currentlyWorking,location:t.location,locationType:t.locationType,description:t.description,companyURL:t.companyURL||""}),P(t),j(!0),m(!0)},H=t=>t.year?`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.month-1]||""} ${t.year}`:"",S=(t,b,y)=>{const $=H(t),D=y?"Present":H(b);return`${$} - ${D}`},K=t=>({"Full-time":"Full-time","Part-time":"Part-time","Self-employed":"Self-employed",Freelance:"Freelance",Internship:"Internship",Trainee:"Trainee",Contract:"Contract"})[t]||t,q=t=>({"On-site":"On-site",Remote:"Remote",Hybrid:"Hybrid"})[t]||t,se=async t=>{t.preventDefault(),Z(!0);try{const b={title:o.title,employmentType:o.employmentType,companyName:o.companyName,start:{year:parseInt(o.startYear),month:parseInt(o.startMonth),day:0},end:o.currentlyWorking?{year:0,month:0,day:0}:{year:parseInt(o.endYear),month:parseInt(o.endMonth),day:0},location:o.location,locationType:o.locationType,description:o.description,companyURL:o.companyURL},y={fullPositions:n&&w?x.map(D=>D.id===w.id?b:D):[...x,b]};console.log("Sending position data:",y);const $=await ae.post("/editProfile/edit-Current-User",y);await U(xe()).unwrap(),console.log("Position saved successfully:",$),m(!1),ee()}catch(b){console.error("Error saving position:",b)}finally{Z(!1)}},oe=async t=>{try{const b=x.filter(D=>D.id!==t),y={fullPositions:b},$=await ae.post("/editProfile/edit-Current-User",y);console.log("Position deleted successfully:",$),F(b)}catch(b){console.error("Error deleting position:",b)}},le=({item:t})=>e.jsx(W.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:" overflow-hidden border border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex justify-between items-start mb-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:"flex items-start gap-3",children:e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900 dark:text-white mb-1",children:t.title}
1),e.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-400 font-medium mb-2",children:t.companyName})]})})}),e.jsx("button",{onClick:()=>ie(t),className:"ml-2 p-2 text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-all duration-200",children:e.jsx(be,{size:16})})]}),e.jsxs("div",{className:"space-y-2 mb-4",children:[e.jsxs("div",{className:"flex items-center text-sm text-gray-600 dark:text-gray-400",children:[e.jsx(Pe,{size:16,className:"mr-2"}),K(t.employmentType)]}),e.jsxs("div",{className:"flex items-center text-sm text-gray-600 dark:text-gray-400",children:[e.jsx(nt,{size:16,className:"mr-2"}),S(t.start,t.end,t.currentlyWorking),t.currentlyWorking&&e.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Current"})]}),t.location&&e.jsxs("div",{className:"flex items-center text-sm text-gray-600 dark:text-gray-400",children:[e.jsx(it,{size:16,className:"mr-2"}),t.location,t.locationType&&e.jsx("span",{className:"ml-2 text-xs bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-2 py-1 rounded",children:q(t.locationType)})]}),t.companyIndustry&&e.jsxs("div",{className:"flex items-center text-sm text-gray-600 dark:text-gray-400",children:[e.jsx(ot,{size:16,className:"mr-2"}),t.companyIndustry]})]}),t.description&&e.jsx("div",{className:"mb-4",children:e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 leading-relaxed",children:t.description})}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t dark:border-gray-700",children:[e.jsx("button",{onClick:()=>oe(t.id),className:"text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300 text-sm font-medium transition-colors duration-200",children:"Delete Position"}),t.companyURL&&e.jsxs("a",{href:t.companyURL,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-sm font-medium transition-colors duration-200",children:[e.jsx(Oe,{size:14,className:"mr-1"}),"Company Website"]})]})]})}),i=[{value:"1",label:"January"},{value:"2",label:"February"},{value:"3",label:"March"},{value:"4",label:"April"},{value:"5",label:"May"},{value:"6",label:"June"},{value:"7",label:"July"},{value:"8",label:"August"},{value:"9",label:"September"},{value:"10",label:"October"},{value:"11",label:"November"},{value:"12",label:"December"}],f=new Date().getFullYear(),C=Array.from({length:50},(t,b)=>f-b),J=[{value:"Full-time",label:"Full-time"},{value:"Part-time",label:"Part-time"},{value:"Self-employed",label:"Self-employed"},{value:"Freelance",label:"Freelance"},{value:"Internship",label:"Internship"},{value:"Trainee",label:"Trainee"},{value:"Contract",label:"Contract"}],Q=[{value:"On-site",label:"On-site"},{value:"Remote",label:"Remote"},{value:"Hybrid",label:"Hybrid"}];return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:" overflow-hidden border border-primary dark:border-gray-400",children:e.jsxs("div",{className:"p-6 sm:p-8",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("h3",{className:"text-lg flex gap-3 items-center font-semibold text-gray-900 dark:text-white",children:[e.jsx(Pe,{size:18})," Work Experience"]}),!E&&e.jsxs("button",{onClick:R,className:"flex items-center gap-2 underline  text-sm font-medium text-primary dark:text-gray-400 hover:text-primary-800 dark:hover:text-gray-300 transition-colors duration-200",children:[e.jsx(we,{size:16}),"Add Position"]})]}),e.jsx("div",{className:"space-y-6",children:te?e.jsx(W.div,{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",initial:"hidden",animate:"visible",variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1}}},children:x.map(t=>e.jsx(le,{item:t},t.id))}):e.jsxs("div",{className:"text-center ",children:[e.jsx("div",{className:"text-gray-400 dark:text-gray-500 mb-3",children:e.jsx(Pe,{size:48,className:"mx-auto"})}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm mb-4",children:"No work experience added yet. Add your professional positions to showcase your career journey."})]})})]})}),e.jsx(Ne,{children:E&&e.jsxs(e.Fragment,{children:[e.jsx(W.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black bg-opacity-50 z-40",onClick:()=>m(!1)}),e.jsx(W.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed right-0 top-0 h-full w-full max-w-md bg-background dark:bg-gray-900 shadow-xl z-50 overflow-y-auto",children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:n?"Edit Position":"Add Position"}),e.jsx("button",{onClick:()=>m(!1),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:e.jsx(fe,{size:24})})]}),e.jsxs("form",{onSubmit:se,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Job Title *"}),e.jsx("input",{type:"text",required:!0,value:o.title,onChange:t=>g("title",t.target.value),className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"e.g., Software Engineer"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Employment Type *"}),e.jsxs("select",{required:!0,value:o.employmentType,onChange:t=>g("employmentType",t.target.value),className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"Select Employment Type"}),J.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Company/Organization *"}),e.jsx("input",{type:"text",required:!0,value:o.companyName,onChange:t=>g("companyName",t.target.value),className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter company name"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Start Month *"}),e.jsxs("select",{required:!0,value:o.startMonth,onChange:t=>g("startMonth",t.target.value),className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"Select Month"}),i.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Start Year *"}),e.jsxs("select",{required:!0,value:o.startYear,onChange:t=>g("startYear",t.target.value),className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"Select Year"}),C.map(t=>e.jsx("option",{value:t,children:t},t))]})]})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"checkbox",id:"currentlyWorking",checked:o.currentlyWorking,onChange:t=>g("currentlyWorking",t.target.checked),className:"w-4 h-4 text-blue-600 bg-transparent border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),e.jsx("label",{htmlFor:"currentlyWorking",className:"ml-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:"I currently work here"})]}),!o.currentlyWorking&&e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"End Month *"}),e.jsxs("select",{required:!0,value:o.endMonth,onChange:t=>g("endMonth",t.target.value),className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"Select Month"}),i.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"End Year *"}),e.jsxs("select",{required:!0,value:o.endYear,onChange:t=>g("endYear",t.target.value),className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"Select Year"}),C.map(t=>e.jsx("option",{value:t,children:t},t))]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Location"}),e.jsx("input",{type:"text",value:o.location,onChange:t=>g("location",t.target.value),className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"e.g., San Francisco, CA"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Location Type"}
1),e.jsxs("select",{value:o.locationType,onChange:t=>g("locationType",t.target.value),className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"Select Location Type"}),Q.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Company Website (Optional)"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx(pt,{size:16,className:"text-gray-400"})}),e.jsx("input",{type:"url",value:o.companyURL,onChange:t=>g("companyURL",t.target.value),className:"text-sm w-full pl-10 pr-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"https://company.com"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Description"}),e.jsx("textarea",{value:o.description,onChange:t=>g("description",t.target.value),rows:4,className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Describe your responsibilities, achievements, and key projects..."})]}),e.jsxs("div",{className:"flex gap-3 pt-4",children:[e.jsx("button",{type:"submit",disabled:z,className:"flex-1 bg-primary-600 hover:bg-primary-700 dark:bg-secondary disabled:bg-primary-400 text-white py-2 px-4 rounded-lg transition-colors duration-200 flex items-center justify-center",children:z?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Saving..."]}):n?"Update Position":"Add Position"}),e.jsx("button",{type:"button",onClick:()=>m(!1),disabled:z,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors duration-200 disabled:opacity-50",children:"Cancel"})]})]})]})})]})})]})},wt=({user:r,onTriggerAdd:u})=>{const[x,F]=s.useState([]),[E,m]=s.useState(!1),[n,j]=s.useState(""),[w,P]=s.useState(!1),[z,Z]=s.useState(null),U=ke();s.useEffect(()=>{var g;(g=r==null?void 0:r.profile)!=null&&g.skills&&F(r.profile.skills)},[r]),s.useEffect(()=>{u&&u(()=>{m(!0)})},[u]);const o=async()=>{if(!n.trim())return;const g={name:n.trim(),passedSkillAssessment:!1},ee=[...x,g];j(""),m(!1),P(!0);try{const R=await ae.post("/editProfile/edit-Current-User",{skills:ee});await U(xe()).unwrap(),console.log("All skills saved successfully:",R),ne.success("Skill added successfully!")}catch(R){console.error("Error adding skill:",R)}finally{P(!1)}},_=g=>{g.key==="Enter"&&o()},te=()=>{j(""),m(!1)};return e.jsx("div",{className:" overflow-hidden border border-primary dark:border-gray-400",children:e.jsxs("div",{className:"p-6 sm:p-8",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("h3",{className:"text-lg flex gap-3 items-center font-semibold text-gray-900 dark:text-white",children:[e.jsx("svg",{className:"w-7 h-7 text-primary dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})}),"Skills & Expertise"]}),!E&&e.jsxs("button",{onClick:()=>m(!0),className:"underline cursor-pointer text-sm text-primary dark:text-gray-400 font-medium  px-3 py-1 rounded-lg transition-all duration-200 flex items-center gap-1",children:[e.jsx(we,{size:16}),"Add Skill"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(Ne,{children:E&&e.jsxs(W.div,{initial:{opacity:0,height:0}
1,animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"text",value:n,onChange:g=>j(g.target.value),onKeyPress:_,placeholder:"Enter skill name...",className:"flex-1 px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-sm text-gray-900 bg-transparent dark:text-white focus:ring-2 focus:ring-primary-500 focus:border-transparent",autoFocus:!0}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:o,disabled:!n.trim()||w,className:"underline text-sm text-primary   dark:text-gray-400 font-medium px-3 py-1 rounded-lg transition-all duration-200 flex items-center gap-1 disabled:opacity-50",children:[w?e.jsx(Le,{size:16,className:"animate-spin"}):e.jsx(ct,{size:16}),e.jsx("span",{children:"Add"})]}),e.jsxs("button",{onClick:te,disabled:w,className:"underline text-sm text-gray-500 dark:text-gray-400 font-medium px-3 py-1 rounded-lg transition-all duration-200 flex items-center gap-1 disabled:opacity-50",children:[e.jsx(fe,{size:16}),"Cancel"]})]})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:"Press Enter or click the check icon to save"})]})}),x.length>0?e.jsx("div",{className:"grid gap-3 grid-cols-2 sm:grid-cols-3 lg:grid-cols-5",children:x.map((g,ee)=>e.jsx("div",{className:"  border border-gray-200 dark:border-gray-600 rounded-lg px-4 py-3 transition-all duration-200",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white pr-6",children:g.name})})},g.name))}):e.jsxs(W.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"text-center ",children:[e.jsx("div",{className:"text-gray-400 dark:text-gray-500 mb-3",children:e.jsx("div",{className:"w-12 h-12 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center mx-auto",children:e.jsx(be,{size:24})})}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm mb-2",children:"No skills added yet"}),e.jsx("p",{className:"text-gray-400 dark:text-gray-500 text-xs",children:"Add your skills to showcase your expertise"})]})]}),x.length>0&&e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-4",children:[x.length," skill",x.length!==1?"s":""," added"]})]})})},St=({user:r,onTriggerAdd:u})=>{const[x,F]=s.useState([]),[E,m]=s.useState(!1),[n,j]=s.useState(!1),[w,P]=s.useState(null),[z,Z]=s.useState(!1),U=ke(),[o,_]=s.useState({platform:"",url:"",description:""}),te=x.length>0,g=[{value:"website",label:"Personal Website",icon:Oe,color:"text-gray-600"},{value:"linkedin",label:"LinkedIn",icon:Ve,color:"text-blue-600"},{value:"github",label:"GitHub",icon:We,color:"text-gray-800"},{value:"twitter",label:"Twitter",icon:He,color:"text-blue-400"},{value:"instagram",label:"Instagram",icon:$e,color:"text-pink-600"},{value:"facebook",label:"Facebook",icon:dt,color:"text-blue-600"}];s.useEffect(()=>{var i;if((i=r==null?void 0:r.profile)!=null&&i.socialLinks){const f=r.profile.socialLinks.map((C,J)=>({id:C.id||`social-${J}`,platform:C.platform||"",url:C.url||"",description:C.description||""}));F(f)}},[r]),s.useEffect(()=>{u&&u(()=>{m(!0),j(!1),P(null)})},[u]);const ee=(i,f)=>{_(C=>({...C,[i]:f}))},R=()=>{_({platform:"",url:"",description:""}),P(null),j(!1)},ie=()=>{R(),m(!0)},H=i=>{_({platform:i.platform,url:i.url,description:i.description}),P(i),j(!0),m(!0)},S=i=>{const f=g.find(Q=>Q.value===i),C=(f==null?void 0:f.icon)||Ce,J=(f==null?void 0:f.color)||"text-gray-600";return e.jsx(C,{size:20,className:J})},K=i=>{var f;return((f=g.find(C=>C.value===i))==null?void 0:f.label)||i},q=i=>{try{return new URL(i),!0}catch{return!1}},se=async i=>{if(i.preventDefault(),Z(!0),!q(o.url)){alert("Please enter a valid URL (include http:// or https://)"),Z(!1);return}try{const f={platform:o.platform,url:o.url,description:o.description},C={socialLinks:n&&w?x.map(Q=>Q.id===w.id?f:Q):[...x,f]};console.log("Sending social links data:",C);const J=await ae.post("/editProfile/edit-Current-User",C);await U(xe()).unwrap(),console.log("Social link saved successfully:",J),m(!1),R()}catch(f){console.error("Error saving social link:",f)}finally{Z(!1)}},oe=async i=>{try{const f=x.filter(Q=>Q.id!==i),C={socialLinks:f},J=await ae.post("/editProfile/edit-Current-User",C);console.log("Social link deleted successfully:",J),F(f)}catch(f){console.error("Error deleting social link:",f)}},le=({link:i})=>e.jsx(W.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"rounded-sm overflow-hidden border border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex justify-between items-start mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-shrink-0",children:S(i.platform)}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900 dark:text-white",children:K(i.platform)}),e.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 text-sm transition-colors duration-200 break-all",children:i.url})]})]}),e.jsx("button",{onClick:()=>H(i),className:"p-2 text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-all duration-200",children:e.jsx(be,{size:16})})]}),i.description&&e.jsx("div",{className:"mb-4",children:e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 leading-relaxed",children:i.description})}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t dark:border-gray-700",children:[e.jsx("button",{onClick:()=>oe(i.id),className:"text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300 text-sm font-medium transition-colors duration-200",children:"Delete"}),e.jsxs("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-sm font-medium transition-colors duration-200",children:[e.jsx(Ce,{size:14,className:"mr-1"}),"Visit"]})]})]})});return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border border-primary dark:border-gray-400 overflow-hidden mb-6 mt-6",children:e.jsxs("div",{className:"p-6 sm:p-8",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("h3",{className:"text-lg flex gap-3 items-center font-semibold text-gray-900 dark:text-white",children:[e.jsx(Ce,{size:18})," Social Links"]}),!E&&e.jsxs("button",{onClick:ie,className:"underline flex items-center gap-2 text-sm text-primary dark:text-gray-400 font-medium transition-colors duration-200",children:[e.jsx(we,{size:16}),"Add Social Link"]})]}),e.jsx("div",{className:"space-y-6",children:te?e.jsx(W.div,{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",initial:"hidden",animate:"visible",variants:{hidden:{opacity:0}
1,visible:{opacity:1,transition:{staggerChildren:.1}}},children:x.map(i=>e.jsx(le,{link:i},i.id))}):e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-gray-400 dark:text-gray-500 mb-3",children:e.jsxs("div",{className:"flex justify-center gap-4 mb-4",children:[e.jsx(Ve,{size:32,className:"text-blue-600"}),e.jsx(We,{size:32,className:"text-gray-800 dark:text-gray-200"}),e.jsx(He,{size:32,className:"text-blue-400"}),e.jsx($e,{size:32,className:"text-pink-600"})]})}),e.jsx("h3",{className:"text-xl font-bold text-gray-900 dark:text-white mb-2",children:"Connect Your Social Profiles"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm mb-4 max-w-md mx-auto",children:"Add your social media profiles and websites to showcase your online presence and connect with others."})]})})]})}),e.jsx(Ne,{children:E&&e.jsxs(e.Fragment,{children:[e.jsx(W.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black bg-opacity-50 z-40 backdrop-blur-sm",onClick:()=>m(!1)}),e.jsx(W.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:()=>m(!1),children:e.jsx(W.div,{initial:{y:20},animate:{y:0},exit:{y:20},className:"bg-background dark:bg-gray-900 rounded-2xl shadow-2xl w-full max-w-md mx-auto",onClick:i=>i.stopPropagation(),children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:n?"Edit Social Link":"Add Social Link"}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:n?"Update your social profile information":"Add a new social media profile or website"})]}),e.jsx("button",{onClick:()=>m(!1),className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-all duration-200",children:e.jsx(fe,{size:24})})]}),e.jsxs("form",{onSubmit:se,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Social Profile *"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:g.map(i=>{const f=i.icon;return e.jsx("button",{type:"button",onClick:()=>ee("platform",i.value),className:`p-3 border-2 rounded-lg text-left transition-all duration-200 ${o.platform===i.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-600 hover:border-gray-300 dark:hover:border-gray-500"}`,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{size:18,className:i.color}),e.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:i.label})]})},i.value)})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Profile URL *"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx(Ce,{size:16,className:"text-gray-400"})}),e.jsx("input",{type:"url",required:!0,value:o.url,onChange:i=>ee("url",i.target.value),className:"text-sm w-full pl-10 pr-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"https://example.com/yourprofile"})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Include https:// in the URL"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Description (Optional)"}),e.jsx("textarea",{value:o.description,onChange:i=>ee("description",i.target.value),rows:3,className:"text-sm w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Brief description of this profile..."})]}),e.jsxs("div",{className:"flex gap-3 pt-1",children:[e.jsx("button",{type:"submit",disabled:z||!o.platform||!o.url,className:"flex-1 text-sm bg-primary dark:bg-secondary text-white py-2 px-4 roun
1ded-lg font-medium transition-colors duration-200 flex items-center justify-center",children:z?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Saving..."]}):n?"Update Link":"Add Social Link"}),e.jsx("button",{type:"button",onClick:()=>m(!1),disabled:z,className:"px-4 py-2 text-sm border-2 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg font-medium hover:bg-gray-50 dark:hover:bg-gray-800 transition-all duration-200 disabled:opacity-50",children:"Cancel"})]})]})]})})})]})})]})},Ct=()=>{const{user:r}=Be(l=>l.auth),u=ke(),[x,F]=s.useState(!1),[E,m]=s.useState(!1),[n,j]=s.useState({firstName:"",lastName:"",headline:"",location:"",email:"",mobileNo:"",summary:""}),[w,P]=s.useState(!1),[z,Z]=s.useState(!1),[U,o]=s.useState(""),[_,te]=s.useState(!1),g=s.useRef(null),ee=mt(),R=ut(),[ie,H]=s.useState(""),[S,K]=s.useState([]),[q,se]=s.useState(null),[oe,le]=s.useState(!1),[i,f]=s.useState(!1),C=s.useRef(null),J=s.useRef(null),Q=localStorage.getItem("onboarding_selectedUserType"),t=R.pathname==="/dashboard/Agency/edit-profile",b=R.pathname==="/get-started"&&Q==="agency/firm",y=s.useRef(null),$=s.useRef(null),D=s.useRef(null),ge=s.useRef(null),ce=s.useRef(null),de=s.useRef(null),pe=s.useRef(null),ye=s.useRef(null),he=s.useRef(null),a=s.useRef(null),d=s.useRef(null),p=s.useRef(null),h=s.useRef(null),T=s.useRef(null),v=s.useRef(null),A=s.useRef(null),re=s.useRef(null),M=s.useRef(null),Ie=()=>{var l;return!!(r!=null&&r.firstName||(l=r==null?void 0:r.profile)!=null&&l.firstName)},Fe=()=>{var l;return!!((l=r==null?void 0:r.profile)!=null&&l.summary||U)};s.useEffect(()=>{var l,c,k,L,Y,N,V,I,O,G,B,X,me,ue,Te,ze,Ue,De,Ee,Re;if(r){const Se=((c=(l=r.profile)==null?void 0:l.geo)==null?void 0:c.full)||((L=(k=r.profile)==null?void 0:k.geo)==null?void 0:L.city)||"";H(Se);const Ae=Number((N=(Y=r.profile)==null?void 0:Y.geo)==null?void 0:N.lat),Me=Number((I=(V=r.profile)==null?void 0:V.geo)==null?void 0:I.lng);Se&&Number.isFinite(Ae)&&Number.isFinite(Me)?se({display_name:Se,lat:Ae,lng:Me,city:(G=(O=r.profile)==null?void 0:O.geo)==null?void 0:G.city}):se(null);const rt={firstName:((B=r.profile)==null?void 0:B.firstName)||r.firstName||"",lastName:((X=r.profile)==null?void 0:X.lastName)||r.lastName||"",headline:((me=r.profile)==null?void 0:me.headline)||((Te=(ue=r.profile)==null?void 0:ue.multiLocaleHeadline)==null?void 0:Te.en)||"",location:Se,email:((ze=r.profile)==null?void 0:ze.emailId)||r.email||"",mobileNo:r.mobileNo||"",summary:((Ue=r.profile)==null?void 0:Ue.summary)||"",profilePicture:((De=r.profile)==null?void 0:De.profilePicture)||"",linkedinUrl:((Ee=r.profile)==null?void 0:Ee.linkedinUrl)||(r==null?void 0:r.linkedinUrl)||""};j(rt),o(((Re=r.profile)==null?void 0:Re.summary)||""),Ie()||F(!0)}},[r]),s.useEffect(()=>{x&&H(n.location||"")},[x,n.location]);const _e=l=>{if(H(l),!l||l.length<2){K([]),le(!1);return}J.current&&window.clearTimeout(J.current),J.current=window.setTimeout(async()=>{try{f(!0),le(!0),C.current&&C.current.abort();const c=new AbortController;C.current=c;const k=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(l)}&addressdetails=1&limit=5`,{signal:c.signal,headers:{Accept:"application/json"}});if(!k.ok)throw new Error("Failed");const Y=(await k.json()??[]).map(N=>{var V,I,O,G,B,X;return{display_name:N.display_name,lat:Number(N.lat),lng:Number(N.lon),city:((V=N.address)==null?void 0:V.city)||((I=N.address)==null?void 0:I.town)||((O=N.address)==null?void 0:O.village)||((G=N.address)==null?void 0:G.suburb)||(((X=(B=N.display_name)==null?void 0:B.split(",")[0])==null?void 0:X.trim())??"")}}).filter(N=>Number.isFinite(N.lat)&&Number.isFinite(N.lng));K(Y)}catch(c){c.name!=="AbortError"&&(console.error("location fetch error",c),K([]))}finally{f(!1)}},300)},ve=(l,c)=>{l!=="location"&&j(k=>({...k,[l]:c}))},qe=async l=>{try{Z(!0);const c=new FormData;c.append("file",l);const k=await ae.post("/bidding/uploadToS3",c,{headers:{"Content-Type":"multipart/form-data"}});if(k.success&&k.url)return k.url;throw new Error("Upload failed")}catch(c){throw console.error("Error uploading file:",c),c}finally{Z(!1)}},Je=async l=>{try{const c=await ae.post("/editProfile/edit-Current-User",{profilePicture:l}),k=await u(xe()).unwrap();return j(L=>({...L,profilePicture:l})),c}catch(c){throw console.error("Error updating profile picture:",c),c}},Ge=async l=>{var k;const c=(k=l.target.files)==null?void 0:k[0];if(c){if(!c.type.startsWith("image/")){alert("Please select an image file");return}if(c.size>5*1024*1024){alert("Please select an image smaller than 5MB");return}try{const L=await qe(c);await Je(L),g.current&&(g.current.value="")}catch(L){console.error("Error uploading image:",L),alert("Failed to upload image. Please try again.")}}},Ke=()=>{var l;(l=g.current)==null||l.click()},Qe=async()=>{var L,Y,N,V;if(!((L=n.email)!=null&&L.trim())){ne.error("Email is required!");return}if(!((Y=n.linkedinUrl)!=null&&Y.trim())){ne.error("LinkedIn URL is required!");return}const l=n.linkedinUrl.trim();if(!/^(https?:\/\/)?(www\.)?linkedin\.com\/.*$/i.test(l)){ne.error("Please enter a valid LinkedIn URL");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.email.trim())){ne.error("Please enter a valid email address");return}if(!((N=n.location)!=null&&N.trim())){ne.error("Location is required!");return}if(!q||q.display_name!==n.location.trim()||!Number.isFinite(q.lat)||!Number.isFinite(q.lng)){ne.error("Please pick your exact location from the suggestions list.");return}P(!0);try{const I={firstName:n.firstName,lastName:n.lastName,headline:n.headline,geo:{full:n.location,city:q.city||((V=n.location.split(",")[0])==null?void 0:V.trim())||n.location,lat:q.lat,lng:q.lng},summary:n.summary,emailId:n.email,linkedinUrl:n.linkedinUrl},O=await ae.post("/editProfile/edit-Current-User",I);console.log("Profile updated successfully:",O);const G=await u(xe()).unwrap();ne.success("Profile updated successfully!"),j(B=>({...B,...I})),H(I.geo.full||""),F(!1)}catch(I){console.error("Error updating profile:",I),ne.error("Failed to update profile. Please try again.")}finally{P(!1)}},Xe=async()=>{P(!0);try{const l=await ae.post("/editProfile/edit-Current-User",{summary:U});console.log("Summary updated successfully:",l),m(!1),j(c=>({...c,summary:U}))}catch(l){console.error("Error updating summary:",l)}finally{P(!1)}},Ze=()=>{var l,c,k,L,Y,N,V,I,O,G,B,X,me;if(r){const ue=((c=(l=r.profile)==null?void 0:l.geo)==null?void 0:c.full)||((L=(k=r.profile)==null?void 0:k.geo)==null?void 0:L.city)||"";
1j({firstName:r.firstName||((Y=r.profile)==null?void 0:Y.firstName)||"",lastName:r.lastName||((N=r.profile)==null?void 0:N.lastName)||"",headline:((V=r.profile)==null?void 0:V.headline)||((O=(I=r.profile)==null?void 0:I.multiLocaleHeadline)==null?void 0:O.en)||"",location:ue,email:r.email||((G=r.profile)==null?void 0:G.email)||"",mobileNo:r.mobileNo||"",summary:((B=r.profile)==null?void 0:B.summary)||"",profilePicture:((X=r.profile)==null?void 0:X.profilePicture)||"",linkedinUrl:((me=r==null?void 0:r.profile)==null?void 0:me.linkedinUrl)||(r==null?void 0:r.linkedinUrl)||""}),H(ue)}F(!1)},et=()=>{o(n.summary||""),m(!1)},tt=l=>{var c,k,L,Y,N,V,I,O,G,B,X;switch(console.log("Field clicked:",l),l){case"firstName":case"lastName":case"headline":case"location":case"profilePicture":(c=y.current)==null||c.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>F(!0),500);break;case"summary":(k=$.current)==null||k.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>m(!0),500);break;case"email":case"universalId":break;case"linkedinUrl":(L=he.current)==null||L.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{re.current&&re.current()},500);break;case"skills":(Y=de.current)==null||Y.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{d.current&&d.current()},500);break;case"educations":(N=pe.current)==null||N.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{p.current&&p.current()},500);break;case"position":case"fullPositions":(V=ye.current)==null||V.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{h.current&&h.current()},500);break;case"projects":(I=ce.current)==null||I.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{T.current&&T.current()},500);break;case"vettedFor":(O=ge.current)==null||O.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{v.current&&v.current()},500);break;case"certifications":(G=a.current)==null||G.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{A.current&&A.current()},500);break;case"socialLinks":(B=he.current)==null||B.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{re.current&&re.current()},500);break;case"introVideo":(X=D.current)==null||X.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{M.current&&M.current()},500);break;case"verificationRecordNotFound":ee("/dashboard/service-provider",{state:{highlightVerification:!0}});break;default:ne.info(`Please complete the ${l} section.`);break}};return s.useEffect(()=>{var l,c;if((l=R.state)!=null&&l.scrollToField&&((c=R.state)!=null&&c.openEditMode)){const k=R.state.scrollToField;setTimeout(()=>{var L,Y,N,V,I,O,G,B,X,me,ue;switch(k){case"firstName":case"lastName":case"headline":case"location":case"profilePicture":(L=y.current)==null||L.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>F(!0),500);break;case"summary":(Y=$.current)==null||Y.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>m(!0),500);break;case"linkedinUrl":(N=he.current)==null||N.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{re.current&&re.current()},500);break;case"skills":(V=de.current)==null||V.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{d.current&&d.current()},500);break;case"educations":(I=pe.current)==null||I.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{p.current&&p.current()},500);break;case"position":case"fullPositions":(O=ye.current)==null||O.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{h.current&&h.current()},500);break;case"projects":(G=ce.current)==null||G.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{T.current&&T.current()},500);break;case"vettedFor":(B=ge.current)==null||B.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{v.current&&v.current()},500);break;case"certifications":(X=a.current)==null||X.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{A.current&&A.current()},500);break;case"socialLinks":(me=he.current)==null||me.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{re.current&&re.current()},500);break;case"introVideo":(ue=D.current)==null||ue.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>
1{M.current&&M.current()},500);break}window.history.replaceState({},document.title)},300)}},[R.state]),r?e.jsx("div",{className:`${t?"":"min-h-screen"}`,children:e.jsxs("div",{className:"",children:[(r==null?void 0:r.profileCompletionScoredetails)&&!t&&!b&&e.jsx(bt,{user:r,onFieldClick:tt}),e.jsx("div",{className:"flex justify-end items-center mb-2"}),e.jsx("input",{type:"file",ref:g,onChange:Ge,accept:"image/*",className:"hidden "}),e.jsx("div",{className:" border border-primary dark:border-gray-400 overflow-hidden mt-5 mb-6 ",ref:y,children:e.jsx("div",{className:"p-6 sm:p-8",children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[e.jsx("div",{className:"flex-shrink-0 w-fit",children:e.jsx("div",{className:"relative",onMouseEnter:()=>te(!0),onMouseLeave:()=>te(!1),children:e.jsxs("div",{className:"relative ",children:[e.jsx("img",{src:n.profilePicture||gt,alt:`${n.firstName} ${n.lastName}`,className:"w-32 h-32 rounded-full object-cover border-4 border-gray-200 dark:border-gray-600"}),(_||z)&&e.jsx("div",{className:"absolute inset-0 w-32 h-32 bg-black bg-opacity-50 rounded-full flex items-center justify-center",children:z?e.jsxs("div",{className:"text-white",children:[e.jsxs("svg",{className:"animate-spin h-8 w-8 mx-auto",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e.jsx("span",{className:"text-xs mt-1",children:"Updating..."})]}):e.jsx("button",{onClick:Ke,className:"bg-gray-600 text-white p-3 rounded-full hover:bg-gary-700 transition-colors duration-200",disabled:z,children:e.jsx(kt,{size:20})})})]})})}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4",children:x?e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"text",value:n.firstName,onChange:l=>ve("firstName",l.target.value),className:"flex-1 text-sm px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"First Name"}),e.jsx("input",{type:"text",value:n.lastName,onChange:l=>ve("lastName",l.target.value),className:"flex-1 text-sm px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Last Name"})]}):e.jsxs("h2",{className:"text-xl font-bold capitalize text-gray-900 dark:text-white",children:[n.firstName," ",n.lastName]})})}),e.jsx("div",{className:"",children:x?e.jsx("textarea",{value:n.headline,onChange:l=>ve("headline",l.target.value),rows:3,className:"w-full px-4 text-sm py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Enter your professional headline"}):e.jsx("p",{className:"text-gray-600 text-sm dark:text-gray-400 leading-relaxed",children:n.headline||"No headline provided"})}),e.jsx("div",{className:"space-y-2",children:x?e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",value:ie,onChange:l=>{const c=l.target.value;H(c),j(k=>({...k,location:c})),q&&c!==q.display_name&&se(null),_e(c)},onFocus:()=>{ie&&S.length>0&&le(!0)},onBlur:()=>{setTimeout(()=>le(!1),200)},className:"w-full px-4 py-2 border text-sm border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Search for your location..."}),i&&e.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500"})}),oe&&S.length>0&&e.jsx("div",{className:"absolute z-[999] w-full mt-1 bg-background dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg shadow-lg  overflow-y-auto",children:S.map((l,c)=>e.jsx("div",{onMouseDown:k=>k.preventDefault(),onClick:()=>{j(k=>({...k,location:l.display_name})),H(l.display_name),se(l),K([]),le(!1)},className:"px-4 py-2 text-sm text-gray-900 dark:text-white hover:bg-gray-100 dark:hover:bg-gray-600 cursor-pointer border-b border-gray-100 dark:border-gray-600 last:border-b-0",children:l.display_name},c))}),oe&&!i&&S.length===0&&ie.length>=2&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-background dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg shadow-lg",children:e.jsx("div",{className:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",children:"No locations foun
1d"})})]}):e.jsxs("div",{className:"flex text-sm items-center text-gray-600 dark:text-gray-400",children:[e.jsxs("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),n.location||"Location not set"]})}),e.jsxs("div",{className:"flex md:flex-row w-full flex-col gap-4",children:[e.jsxs("div",{className:"flex  items-center  text-gray-600 dark:text-gray-400",children:[e.jsx("svg",{className:"w-4 h-4 mr-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})}),e.jsx("span",{className:"text-xs",children:n.mobileNo||"Mobile number not provided"})]}),e.jsx("div",{className:`space-y-2   ${x?"w-full":"lg:w-[200px]"} `,children:x?e.jsx("input",{type:"email",value:n.email,onChange:l=>ve("email",l.target.value),className:"w-full px-4 py-2 border text-sm border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your email"}):e.jsxs("div",{className:"flex text-xs items-center text-gray-600 dark:text-gray-400",children:[e.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),n.email||"Email not provided"]})}),e.jsx("div",{className:" w-full",children:x?e.jsx("input",{type:"url",value:n.linkedinUrl||"",onChange:l=>ve("linkedinUrl",l.target.value),className:"w-full px-4 py-2 border text-sm border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"https://linkedin.com/in/your-profile"}):e.jsxs("div",{className:"flex items-center text-gray-600 dark:text-gray-400",children:[e.jsx("svg",{className:"w-4 h-4 mr-3",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})}),n.linkedinUrl?e.jsx("a",{href:n.linkedinUrl,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 text-xs hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 transition-colors duration-200",children:"LinkedIn Profile"}):e.jsx("span",{className:"text-xs",children:"LinkedIn not provided"})]})})]}),e.jsx("div",{className:"flex flex-col sm:flex-row gap-3 pt-4",children:x?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:Qe,disabled:w,className:"underline font-semibold text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 pr-2",children:w?"Saving...":"Save Changes"}),Ie()&&e.jsx("button",{onClick:Ze,disabled:w,className:"underline font-semibold text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 pr-2",children:"Cancel"})]}):e.jsxs("button",{onClick:()=>F(!0),className:"flex items-center gap-2 underline  text-sm font-medium text-primary dark:text-gray-400 hover:text-primary-800 dark:hover:text-gray-300 transition-colors duration-200",children:[e.jsx(be,{size:16}),"Edit Profile"]})})]})]})})}),!t&&e.jsx("div",{className:" border border-primary dark:border-gray-400 overflow-hidden mb-6",ref:$,children:e.jsxs("div",{className:"p-6 sm:p-8",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("h3",{className:"text-lg flex gap-3 items-center font-semibold text-gray-900 dark:text-white",children:[e.jsx(je,{size:18})," Summary"]}),E?null:e.jsx("button",{onClick:()=>m(!0),className:"flex items-center gap-2 underline  text-sm font-medium text-primary dark:text-gray-400 hover:text-primary-800 dark:hover:text-gray-300 transition-colors duration-200",children:Fe()?e.jsxs(e.Fragment,{children:[e.jsx(be,{size:16}),"Edit Summary"]}):e.jsxs(e.Fragment,{children:[e.jsx(we,{size:16}),"Add Summary"]})})]}
1),e.jsx("div",{className:"space-y-4",children:E?e.jsxs("div",{className:"space-y-4",children:[e.jsx("textarea",{value:U,onChange:l=>o(l.target.value),rows:4,className:"w-full px-4 py-3 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-transparent dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Write a brief summary about yourself, your experience, skills, and what you bring to the table..."}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:Xe,disabled:w,className:"underline font-semibold text-gray-600 dark:text-gray-400 pr-2",children:w?"Saving...":"Save Summary"}),e.jsx("button",{onClick:et,disabled:w,className:"underline font-semibold text-gray-600 dark:text-gray-400 pr-2",children:"Cancel"})]})]}):e.jsx("div",{children:Fe()?e.jsx("p",{className:"text-gray-600 text-sm dark:text-gray-400 leading-relaxed whitespace-pre-wrap",children:n.summary}):e.jsxs("div",{className:"text-center py-2",children:[e.jsx("div",{className:"text-gray-400 dark:text-gray-500 mb-2",children:e.jsx("svg",{className:"w-12 h-12 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z"})})}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:'No summary added yet. Click "Add Summary" to tell people about yourself.'})]})})})]})}),!t&&!b&&e.jsx("div",{ref:ce,children:e.jsx(jt,{user:r,onTriggerAdd:l=>{T.current=l}})}),!t&&!b&&e.jsx("div",{ref:de,className:"mb-6",children:e.jsx(wt,{user:r,onTriggerAdd:l=>{d.current=l}})}),!t&&!b&&e.jsx("div",{ref:ye,children:e.jsx(Nt,{user:r,onTriggerAdd:l=>{h.current=l}})}),!t&&!b&&e.jsx("div",{ref:he,children:e.jsx(St,{user:r,onTriggerAdd:l=>{re.current=l}})})]})}):e.jsx("div",{className:"w-full h-[calc(100vh-270px)] flex items-center justify-center  ",children:e.jsxs("div",{className:"relative w-24 h-24 md:w-28 md:h-28",children:[e.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-to-r from-primary via-primary/50 to-primary dark:from-gray-600 dark:via-gray-300 dark:to-gray-600 animate-spin",style:{animationDuration:"1.2s"},children:e.jsx("div",{className:"absolute inset-[2px] bg-background dark:bg-gray-900 rounded-full"})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"w-16 h-16 md:w-20 md:h-20 rounded-full overflow-hidden bg-transparent dark:bg-gray-400 shadow-lg flex items-center justify-center",children:e.jsx("img",{src:xt,alt:"Metty AI",className:"w-12 h-12 md:w-14 md:h-14 object-contain"})})})]})})},Mt=()=>{const r=ke(),{user:u}=Be(m=>m.auth),[x,F]=s.useState(!1),E=localStorage.getItem("accessToken");return s.useEffect(()=>{E||F(!0)},[E]),s.useEffect(()=>{var w,P;if(!u)return;const m=((w=u==null?void 0:u.verificationForm)==null?void 0:w.verified)==="approved",j=(((P=u==null?void 0:u.profileCompletionScoredetails)==null?void 0:P.missingFields)||[]).includes("verificationRecordNotFound");m&&j&&(async()=>{try{await ae.post("/editProfile/edit-Current-User",{firstName:u==null?void 0:u.firstName}),await r(xe()).unwrap()}catch(z){console.error("Auto update failed:",z)}})()},[u]),e.jsxs("div",{children:[(u==null?void 0:u.isServiceProvider)&&e.jsx("div",{className:"mb-4",children:e.jsx(ht,{type:"user",currentSlug:u==null?void 0:u.slugUrl,onSaved:()=>r(xe())})}),e.jsx(Ct,{}),x&&e.jsx(vt,{})]})};export{Mt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.