PageSourceSearch

https://careerdiary.io/assets/ProfilePage-ChretcRq.js

js careerdiary.io collected 2026-10-02 01:57:38 UTC 33,837 bytes, 2 lines download raw bytes

1import{r as b,j as e,m as S,A as le}from"./animation-CddyXVCz.js";import{a as ne}from"./tailorOutcome-9inHuXL0.js";import{u as C,S as w,U as ie,B as g,j as oe,z as _,aB as D,T as L,ai as z,l as de,P as ce,p as xe,L as ee,h as k,af as me,b7 as he,aV as ue,b8 as pe,r as ge}from"./index-DnWsV7cE.js";import{L as fe}from"./LocationInput-B_tiwdQR.js";import{S as be}from"./SectionHeader-HhrOkJ88.js";import"./react-vendor-CbN3pvl2.js";import"./supabase-iKSPld20.js";import"./docgen-Bp8WKBAE.js";import"./query-DPqpbKNH.js";import"./LocationAutocomplete-63SJVXpj.js";const ve=()=>{const{state:a,actions:t}=C(),{profileChatHistory:s,isChattingWithProfile:c}=a,{handleSendProfileChatMessage:o}=t,[r,i]=b.useState(""),m=b.useRef(null);b.useEffect(()=>{m.current&&requestAnimationFrame(()=>{var n;(n=m.current)==null||n.scrollTo({top:m.current.scrollHeight,behavior:"smooth"})})},[s]);const u=n=>{n.preventDefault(),r.trim()&&!c&&(o(r),i(""))};return e.jsxs("div",{className:"border border-blue-200 dark:border-blue-500/30 rounded-lg bg-blue-50 dark:bg-blue-900/30 p-4 flex flex-col h-[300px]",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-800 dark:text-slate-100 mb-4 text-center",children:"AI Instruction Terminal"}),e.jsxs("div",{ref:m,className:"flex-grow overflow-y-auto space-y-4 pr-2",children:[s.length===0&&e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsxs("p",{className:"text-sm text-center text-gray-500 dark:text-slate-400",children:["Ask the AI to add or edit your profile.",e.jsx("br",{}),`e.g., "Add a new skill: 'Agile Methodologies'"`]})}),s.map((n,d)=>{const x=n.role==="model"&&n.text.trim().startsWith("✓"),p=n.role==="model"&&n.text.trim().startsWith("✗"),h=n.text.replace(/^[✓✗]\s*/,"").split(`
2`)[0],f=h.length>80?h.substring(0,77)+"...":h;return e.jsxs("div",{className:`flex items-start gap-3 ${n.role==="user"?"justify-end":""}`,children:[n.role==="model"&&e.jsx("div",{className:`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center ${x?"bg-green-100 dark:bg-green-500/20":p?"bg-red-100 dark:bg-red-500/20":"bg-blue-100 dark:bg-blue-500/20"}`,children:x?e.jsx("span",{className:"text-green-600 dark:text-green-400 text-lg font-bold",children:"✓"}):p?e.jsx("span",{className:"text-red-600 dark:text-red-400 text-lg font-bold",children:"✗"}):e.jsx(w,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"})}),e.jsx("div",{className:`max-w-md p-3 rounded-lg ${n.role==="user"?"bg-blue-500 text-white":x?"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-500/30 text-green-800 dark:text-green-300":p?"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-500/30 text-red-800 dark:text-red-300":"bg-white dark:bg-slate-700 border border-[var(--border-default)] text-gray-700 dark:text-slate-200"}`,children:e.jsx("p",{className:`text-sm whitespace-pre-wrap ${x||p?"font-medium":""}`,children:n.role==="user"?n.text:f})}),n.role==="user"&&e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-gray-200 dark:bg-slate-600 flex items-center justify-center",children:e.jsx(ie,{className:"w-5 h-5 text-gray-600 dark:text-slate-300"})})]},d)}),c&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-blue-100 dark:bg-blue-500/20 flex items-center justify-center",children:e.jsx(w,{className:"w-5 h-5 text-blue-600 dark:text-blue-400 animate-pulse"})}),e.jsx("div",{className:"max-w-md p-3 rounded-lg bg-white dark:bg-slate-700 border border-[var(--border-default)] text-gray-700 dark:text-slate-200",children:e.jsx("span",{className:"text-sm text-gray-600 dark:text-slate-400",children:"Processing..."})})]})]}),e.jsxs("form",{onSubmit:u,className:"mt-4 flex items-center gap-3",children:[e.jsx("input",{type:"text",value:r,onChange:n=>i(n.target.value),placeholder:"Enter instructions to update your Career Diary above...",className:"flex-grow p-3 border border-gray-300 dark:border-slate-600 rounded-lg focus:ring-2 focus:ring-blue-500 bg-white dark:bg-slate-700 dark:text-white dark:placeholder-slate-400 transition-colors",disabled:c}),e.jsx(g,{type:"submit",disabled:!r.trim()||c,loading:c,variant:"primary",size:"md",className:"flex-shrink-0 w-12 h-12 rounded-full p-0","aria-label":"Send message",children:e.jsx(oe,{className:"w-6 h-6"})})]})]})},Q=({isOpen:a,title:t,message:s,confirmLabel:c="Confirm",cancelLabel:o="Cancel",variant:r="danger",isLoading:i=!1,onConfirm:m,onCancel:u})=>
2{if(!a)return null;const d={danger:{icon:"text-red-500 dark:text-red-400",confirmBtn:"bg-red-600 hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600 text-white",border:"border-red-200 dark:border-red-500/40"},warning:{icon:"text-amber-500 dark:text-amber-400",confirmBtn:"bg-amber-600 hover:bg-amber-700 dark:bg-amber-500 dark:hover:bg-amber-600 text-white",border:"border-amber-200 dark:border-amber-500/40"},info:{icon:"text-blue-500 dark:text-blue-400",confirmBtn:"bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 text-white",border:"border-blue-200 dark:border-blue-500/40"}}[r];return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:u,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:e.jsxs("div",{className:`bg-white dark:bg-slate-800 rounded-2xl shadow-xl max-w-md w-full p-5 sm:p-6 border ${d.border} animate-in fade-in zoom-in-95 duration-base`,onClick:x=>x.stopPropagation(),children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:`flex-shrink-0 ${d.icon}`,children:e.jsx(_,{className:"h-6 w-6"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{id:"modal-title",className:"text-lg font-semibold text-gray-900 dark:text-white",children:t}),e.jsx("p",{className:"mt-2 text-sm text-gray-600 dark:text-slate-300",children:s})]})]}),e.jsxs("div",{className:"mt-6 flex flex-col-reverse sm:flex-row sm:justify-end gap-3",children:[e.jsx(g,{onClick:u,disabled:i,variant:"secondary",size:"sm",className:"w-full sm:w-auto",children:o}),e.jsx(g,{onClick:m,loading:i,variant:r==="danger"?"danger":"primary",size:"sm",className:"w-full sm:w-auto",children:c})]})]})})},je=({compact:a=!1,showUpload:t=!0,showClear:s=!0,onAfterClear:c})=>{const{state:o,actions:r}=C(),{corpusFiles:i}=o,{handleFileParse:m,handleClearCareerDiary:u}=r,n=b.useRef(null),[d,x]=b.useState(!1),[p,v]=b.useState(!1),h=j=>{var I;const P=(I=j.target.files)==null?void 0:I[0];P&&m(P),n.current&&(n.current.value="")},f=()=>{d||v(!0)},N=async()=>{x(!0);try{await u(),c==null||c()}finally{x(!1),v(!1)}};return a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(g,{onClick:()=>{var j;return(j=n.current)==null?void 0:j.click()},variant:"ghost",size:"sm",className:"p-2 rounded-lg bg-gray-100 dark:bg-slate-700 text-gray-600 dark:text-slate-300 hover:bg-gray-200 dark:hover:bg-slate-600 transition-colors h-auto border-none",title:"Upload/Merge Resume","aria-label":"Upload or merge resume",children:e.jsx(D,{className:"h-5 w-5"})}),e.jsx("input",{type:"file",ref:n,onChange:h,className:"hidden",accept:".pdf,.docx"})]}),s&&e.jsx(g,{onClick:f,disabled:d,variant:"ghost",size:"sm",className:"p-2 rounded-lg bg-red-50 dark:bg-red-500/20 text-red-600 dark:text-red-300 hover:bg-red-100 dark:hover:bg-red-500/30 border border-transparent dark:border-red-500/30 disabled:opacity-50 disabled:cursor-not-allowed transition-colors h-auto",title:"Clear Career Diary","aria-label":"Clear career diary",loading:d,children:e.jsx(L,{className:"h-5 w-5"})})]}),e.jsx(Q,{isOpen:p,title:"Clear Career Diary",message:i.length>0?`This will permanently delete all entries from your Career Diary AND all ${i.length} document${i.length>1?"s":""} in your Documents folder. This action cannot be undone.`:"This will permanently delete all entries from your Career Diary. This action cannot be undone.",confirmLabel:"Clear Diary",cancelLabel:"Keep Diary",variant:"danger",isLoading:d,onConfirm:N,onCancel:()=>v(!1)})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[t&&e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-gray-800 dark:text-slate-200",children:"Update Diary from Resume"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mb-2",children:"Upload another resume to merge accomplishments or replace your current diary."}),e.jsx(g,{onClick:()=>{var j;return(j=n.current)==null?void 0:j.click()},variant:"secondary",size:"md",className:"w-full flex items-center justify-center space-x-2 iconic-surface-soft text-[var(--text-secondary)] font-semibold py-2 px-4 hover:shadow transition-shadow h-auto border-none","aria-label":"Upload or merge resume",leftIcon:e.jsx(D,{className:"h-5 w-5"}),children:"Upload/Merge Resume"}),e.jsx("input",{type:"file",ref:n,onChange:h,className:"hidden",accept:".pdf,.docx"})]}),s&&e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-gray-800 dark:text-slate-200",children:"Clear Diary"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mb-2",children:"Start fresh by removing all career diary entries."}),e.jsx(g,{onClick:f,disabled:d,variant:"danger",size:"md",className:"w-full flex items-center justify-center space-x-2 bg-red-50 dark:bg-red-500/20 text-red-600 dark:text-red-300 border border-red-200 dark:border-red-500/40 font-semibold py-2 px-4 roun
2ded-lg hover:bg-red-100 dark:hover:bg-red-500/30 disabled:opacity-50 disabled:cursor-not-allowed transition-colors h-auto","aria-label":"Clear career diary","aria-disabled":d,loading:d,leftIcon:e.jsx(L,{className:"h-5 w-5"}),children:d?"Clearing...":"Clear Diary"})]})]}),e.jsx(Q,{isOpen:p,title:"Clear Career Diary",message:i.length>0?`This will permanently delete all entries from your Career Diary AND all ${i.length} document${i.length>1?"s":""} in your Documents folder. This action cannot be undone.`:"This will permanently delete all entries from your Career Diary. This action cannot be undone.",confirmLabel:"Clear Diary",cancelLabel:"Keep Diary",variant:"danger",isLoading:d,onConfirm:N,onCancel:()=>v(!1)})]})};function ye(a){var o;if(!a)return 0;let t=0;const s={name:15,summary:15,contact:10,experience:25,skills:15,education:10,photo:5,accomplishments:5};return a.fullName&&z(a.fullName)&&(t+=s.name),a.summary&&z(a.summary).length>50&&(t+=s.summary),(a.contactDetails||a.contactInfo&&z(a.contactInfo))&&(t+=s.contact),a.experience&&a.experience.length>0&&(t+=s.experience),a.skills&&a.skills.length>=3&&(t+=s.skills),a.education&&a.education.length>0&&(t+=s.education),a.photoUrl&&(t+=s.photo),(((o=a.experience)==null?void 0:o.reduce((r,i)=>{var m;return r+(((m=i.accomplishments)==null?void 0:m.length)||0)},0))||0)>0&&(t+=s.accomplishments),Math.min(100,Math.max(0,t))}const Ne=a=>{if(!a)return null;const t=ye(a);return{percent:t,tone:t>80?"good":t>50?"fair":"low"}},ke=({accomplishment:a,onUpdate:t,onDelete:s,isLast:c=!1})=>{const[o,r]=b.useState(a.description),i=b.useRef(null),m=()=>{const u=o.trim();if(!u&&!c){s(a.id);return}u!==a.description&&t(a.id,u)};return b.useEffect(()=>{i.current&&(i.current.style.height="auto",i.current.style.height=`${i.current.scrollHeight}px`)},[o]),e.jsxs("div",{className:"flex items-start gap-2 group",children:[e.jsx(w,{className:"h-5 w-5 text-[var(--color-accent-subtle)] mt-2 flex-shrink-0"}),e.jsx("textarea",{ref:i,value:o,onChange:u=>r(u.target.value),onBlur:m,placeholder:"Describe an achievement, project, or task...",className:"w-full p-2 border border-[var(--border-default)] rounded-xl focus:ring-2 focus:ring-[var(--color-accent)] text-sm bg-[var(--bg-tertiary)] dark:text-slate-200 resize-none transition-colors",rows:1}),e.jsx(g,{onClick:()=>s(a.id),variant:"ghost",size:"sm",className:"p-1 text-gray-400 hover:text-red-600 opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity mt-1 dark:text-slate-500 dark:hover:text-red-500 h-auto","aria-label":"Delete accomplishment",children:e.jsx(L,{className:"h-4 w-4"})})]})},we=({experience:a,isExpanded:t,onToggleExpand:s})=>{var d;const{actions:c}=C(),{handleAddAccomplishment:o,handleUpdateAccomplishment:r,handleDeleteAccomplishment:i}=c,m=()=>{a.accomplishments.filter((p,v)=>{var h;return!((h=p.description)!=null&&h.trim())&&v!==a.accomplishments.length-1}).forEach(p=>i(a.id,p.id))},u=()=>{m(),o(a.id)},n=()=>{t&&m(),s()};return e.jsxs(S.div,{layout:!0,whileHover:{y:-2},className:"iconic-surface-glass accent-border-left p-5 rounded-2xl space-y-3 group",children:[e.jsx(g,{onClick:n,variant:"ghost",className:"w-full text-left focus:outline-none focus:ring-2 focus:ring-blue-600/20 rounded-lg transition-all h-auto p-0 border-none justify-start whitespace-normal","aria-expanded":t,children:e.jsxs("div",{className:"flex justify-between items-start gap-4 w-full",children:[e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:a.jobTitle}),e.jsx("p",{className:"text-base font-semibold text-blue-600 dark:text-blue-400",children:a.company}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-slate-600 dark:text-slate-400",children:[((d=a.location)==null?void 0:d.trim())&&e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsxs("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",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"})]}),a.location]}),e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),a.dates]})]})]}),e.jsx(S.div,{animate:{rotate:t?180:0},transition:{duration:.3,ease:[.16,1,.3,1]},className:"flex-shrink-0 p-2 rounded-lg bg-slate-50 dark:bg-slate-800/50 group-hover:bg-blue-50 dark:group-hover:bg-blue-500/10 transition-colors",children:e.jsx(de,{className:"h-5 w-5 text-slate-600 dar
2k:text-slate-400 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"})})]})}),e.jsx(le,{children:t&&e.jsx(S.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3,ease:[.16,1,.3,1]},className:"overflow-hidden",children:e.jsx("div",{className:"pt-4 border-t border-slate-200 dark:border-slate-700",children:e.jsxs("div",{className:"pl-4 border-l-2 border-blue-600/30 space-y-3",children:[e.jsxs("h4",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 flex items-center gap-2",children:[e.jsx("svg",{className:"h-4 w-4 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),"Key Accomplishments"]}),a.accomplishments.map((x,p)=>{var v;return e.jsx(ke,{accomplishment:x,onUpdate:(h,f)=>r(a.id,h,f),onDelete:h=>i(a.id,h),isLast:a.accomplishments.length===1},x.id||`acc-${a.id}-${p}-${(v=x.description)==null?void 0:v.substring(0,20)}`)}),e.jsx(g,{onClick:u,variant:"ghost",size:"sm",leftIcon:e.jsx(ce,{className:"h-5 w-5"}),className:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-semibold transition-colors",children:"Add Accomplishment"})]})})})})]})},Ce=({summary:a,onConfirmMerge:t,onConfirmReplace:s,onCancel:c})=>e.jsxs("div",{className:"p-4 bg-[var(--bg-tertiary)] border border-[var(--border-default)] rounded-2xl space-y-4",children:[e.jsx("h3",{className:"font-bold text-lg text-[var(--text-primary)] text-center",children:"Update Your Career Diary"}),e.jsx("p",{className:"text-sm text-[var(--text-secondary)] text-center",children:"We've analyzed your uploaded resume. How would you like to update your profile?"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 text-left",children:[e.jsxs("div",{className:"bg-[var(--bg-secondary)] p-4 rounded-xl border border-[var(--border-default)] hover:border-[var(--color-accent)]/50 flex flex-col transition-all hover:shadow-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(w,{className:"h-5 w-5 text-[var(--color-accent)]"}),e.jsx("h4",{className:"font-semibold text-[var(--text-primary)]",children:"Merge with Diary"})]}),e.jsx("p",{className:"text-xs text-[var(--text-secondary)] flex-grow",children:"Adds new roles and accomplishments from the upload to your existing diary, creating a single, comprehensive profile."}),e.jsxs("div",{className:"mt-3 p-2 bg-[var(--bg-tertiary)] rounded-lg text-xs text-[var(--text-secondary)]",children:[e.jsx("strong",{children:"AI Summary:"})," ",a]}),e.jsx(g,{onClick:t,variant:"primary",size:"md",className:"mt-4 w-full",children:"Merge"})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] p-4 rounded-xl border border-[var(--border-default)] hover:border-[var(--border-default)] flex flex-col transition-all hover:shadow-md",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(he,{className:"h-5 w-5 text-[var(--text-secondary)]"}),e.jsx("h4",{className:"font-semibold text-[var(--text-primary)]",children:"Replace Diary"})]}),e.jsx("p",{className:"text-xs text-[var(--text-secondary)] flex-grow",children:"Completely replaces your current diary with the contents of the new resume. Good for a clean start."}),e.jsxs("div",{className:"mt-3 p-2 bg-[var(--bg-tertiary)] rounded-lg text-xs text-[var(--text-secondary)] invisible",children:[e.jsx("strong",{children:"AI Summary:"})," No summary needed for replace."]}),e.jsx(g,{onClick:s,variant:"secondary",size:"md",className:"mt-4 w-full",children:"Replace"})]})]}),e.jsx("div",{className:"flex justify-center",children:e.jsx(g,{onClick:c,variant:"ghost",size:"sm",leftIcon:e.jsx(_,{className:"h-4 w-4"}),className:"text-[var(--text-secondary)] hover:text-red-600 dark:hover:text-red-400",children:"Cancel"})})]}),re=({updateMessage:a,progress:t,hasExistingProfile:s})=>{const c=s?["Reading document","AI parsing structure","AI merging with diary","Finalizing Career Diary"]:["Reading document","AI parsing structure","Creating Career Diary"];let o=c.findIndex(r=>a.toLowerCase().includes(r.split(" ")[0].toLowerCase()));return o===-1&&a&&(o=0),e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsx(w,{className:"h-12 w-12 text-[var(--color-accent)] mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-slate-100 mb-2",children:"Building Your Diary..."}),e.jsx("div",{className:"w-full bg-gray-200 dark:bg-slate-700 rounded-full h-2.5 mb-6 overflow-hidden",children:e.jsx("div",{className:"bg-[var(--color-accent)] h-2.5 rounded-full transition-all duration-slow ease-out",style:{width:`${t}%`}})}),e.jsx("ul",{className:"space-y-4 text-left",children:c.map((r,i)=>{const m=i<o,u=i===o,n=i>o;let d;return m?d=e.jsx(ge,{className:"h-6 w-6 text-green-500"}):u?d=e.jsx(ee,{className:"h-6 w-6 text-[var(--color-accent)]"}):d=e.jsx("div",{className:"h-6 w-6 flex items-center justify-center",children:e.jsx("div",{className:"h-3 w-3 bg-gray-300 dark:bg-slate-600 rounded-full"})}),e.jsxs("li",{className:`flex items-center gap-3 transition-opacity duration-base ${n?"opacity-50":"opacity-100"}`,children:[d,e.jsx("span",{className:`font-semibold ${n?"text-gray-500 dark:text-slate-400":"text-gray-800 dark:text-slate-200"}`,children:r})]},`step-${i}-${r}`)})})]})},Pe=()=>{const{state:a,actions:t,toast:s}=C(),{isUpdating:c,updateMessage:o,updateProgress:r,profile:i}=a,{handleFileParse:m}=t,u=b.useRef(null),[n,d]=b.useState(""),x=b.useRef(!1),p=async h=>{var N;const f=(N=h.target.files)==null?void 0:N[0];if(f){x.current=!1;try{await m(f),!a.error&&!x.current&&(s.success("Resume Parsed","Your resume has been successfully added to your Career Diary."),x.current=!0)}catch(j){x.current=!1,s.error("Parse Failed",j instanceof Error?j.message:"Failed to parse resume. Please check the file format and try again.")}}},v=async()=>{const h=n.trim()||await navigator.clipboard.readText();if(h){x.current=!1;try{const f=new Blob([h],{type:"text/plain"}),N=new File([f],"pasted-resume.txt",{type:"text/plain"});await m(N),!a.error&&!x.current&&(s.success("Resume Parsed","Your pasted resume has been successfully added to your Career Diary."),x.current=!0),d("")}catch(f){x.current=!1,s.error("Parse Failed",f instanceof Error?f.message:"Failed to parse pasted text. Please try again.")}}};return c?e.jsx("div",{className:"bg-white dark:bg-slate-800 p-6 rounded-xl shadow-md flex flex-col items-center justify-center min-h-[400px]",children:e.jsx(re,{updateMessage:o,progress:r,hasExistingProfile:!!(i!=null&&i.fullName)})}):e.jsxs("div",{className:"bg-white dark:bg-slate-800 p-4 md:p-6 rounded-xl shadow-md space-y-4 md:space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(w,{className:"h-12 w-12 text-[var(--color-accent)] mx-auto mb-3"}),e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-slate-100",children:"Let's Build Your Career Diary"}),e.jsx("p",{className:"text-gray-600 dark:text-slate-400 mt-1",children:"Upload or paste your resume to get started. The AI will parse it into a structured profile you can edit."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{onClick:()=>{var h;
2return(h=u.current)==null?void 0:h.click()},variant:"secondary",size:"lg",leftIcon:e.jsx(D,{className:"h-8 w-8 text-[var(--color-accent)]"}),className:"w-full flex-col py-6 md:py-8 border-2 border-dashed hover:border-[var(--color-accent)]",children:"Upload Resume (.pdf, .docx)"}),e.jsx("input",{type:"file",ref:u,onChange:p,className:"hidden",accept:".pdf,.docx"}),e.jsxs("div",{className:"flex items-center text-center",children:[e.jsx("div",{className:"flex-grow border-t border-gray-300 dark:border-slate-600"}),e.jsx("span",{className:"flex-shrink mx-4 text-gray-500 dark:text-slate-400 text-sm font-semibold",children:"OR"}),e.jsx("div",{className:"flex-grow border-t border-gray-300 dark:border-slate-600"})]}),e.jsx("textarea",{value:n,onChange:h=>d(h.target.value),placeholder:"Paste your resume here...",className:"w-full h-48 p-3 border rounded-lg focus:ring-2 focus:ring-[var(--color-accent)] focus:border-[var(--color-accent)] transition-colors bg-transparent dark:text-white dark:placeholder-slate-400 border-gray-300 dark:border-slate-600"}),e.jsx(g,{onClick:v,variant:"primary",size:"lg",leftIcon:e.jsx(w,{className:"h-5 w-5"}),className:"w-full",children:"Parse Pasted Text"})]})]})},Ie=()=>e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 pt-6 border-t border-[var(--border-default)]",children:[e.jsx("div",{className:"space-y-4",children:e.jsx(je,{showUpload:!0,showClear:!0})}),e.jsx("div",{children:e.jsx(ve,{})})]}),Re=(a,t)=>{const s=ue(a||""),c=pe((t==null?void 0:t.email)||s.email||""),o=(t==null?void 0:t.phone)||s.phone||"",r=(t==null?void 0:t.linkedIn)||s.linkedIn||"",i=(t==null?void 0:t.github)||s.github||"",m=(t==null?void 0:t.portfolio)||(t==null?void 0:t.website)||s.portfolio||s.website||"";return[c,o,r,i,m].filter(Boolean).join(" | ")},Be=({onNavigateToDiary:a,onNavigateToTailor:t})=>{var A,E,M,U,B,F,W,H,Y,O,G,K,V,q,Z,J,X;const{state:s,actions:c,toast:o}=C(),{profile:r,isUpdating:i,updateMessage:m,showSuccess:u,tailoredResume:n,alignmentImprovement:d,pendingResumeUpdate:x,isHydratingProfile:p}=s,{handleMergeResumeUpdate:v,handleReplaceResumeUpdate:h,handleCancelResumeUpdate:f,handleLocationChange:N,handleZipcodeChange:j,handleProfileMutation:P}=c,[I,$]=b.useState(null),T=b.useRef(!1);xe({title:"Profile | CareerDiary",description:"Review and edit your CareerDiary profile, experience, and contact details.",canonical:"https://careerdiary.io/app/profile"}),b.useEffect(()=>{r&&r.experience&&r.experience.length>0&&$(r.experience[0].id)},[r]),b.useEffect(()=>{if(u&&n&&!T.current){const l=ne(d);l==="worse"?o.info("Tailoring finished","This version scored lower than your original — open the tailor to compare.",4e3):l==="similar"?o.info("Tailoring finished","The score is about the same as your original.",3e3):o.success("Resume tailored!","Your customized resume is ready for review.",3e3),T.current=!0}u||(T.current=!1)},[u,n,d,o]);const ae=l=>{$(y=>y===l?null:l)};if(p||!r)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(ee,{})});const te=!r.fullName&&(!r.experience||r.experience.length===0),R=Ne(r);return e.jsx("div",{className:"space-y-6 max-w-[95vw] xl:max-w-[92vw] 2xl:max-w-[90vw] mx-auto",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs(k,{variant:"glass",padding:"lg",className:"relative overflow-hidden",children:[e.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[e.jsx("div",{className:"flex-shrink-0 p-3 bg-gradient-to-br from-[var(--color-accent)] to-[var(--color-accent-subtle)] rounded-xl shadow-lg",children:e.jsx(me,{className:"h-7 w-7 text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-xl font-bold text-[var(--text-primary)] mb-1",children:"Career Diary"}),e.jsx("p",{className:"text-sm text-[var(--text-secondary)] leading-relaxed",children:"Your professional foundation. Build your comprehensive career story with all your accomplishments in one place."})]})]}),e.jsx(g,{onClick:a,variant:"primary",size:"lg",rightIcon:e.jsx("svg",{className:"h-4 w-4 transition-transform group-hover:translate-x-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),children:"Open Career Diary"})]}),te?e.jsx(Pe,{}):e.jsxs(e.Fragment,{children:[e.jsxs(k,{variant:"glass",padding:"lg",className:"space-y-8 relative",children:[i&&!x&&e.jsx("div",{className:"absolute inset-0 bg-[var(--bg-secondary)]/90 backdrop-blur-md flex flex-col items-center justify-center rounded-2xl z-10 p-4",children:e.jsx(re,{updateMessage:m,progress:s.updateProgress,hasExistingProfile:!!(r!=null&&r.fullName)})}),e.jsx(be,{title:"Your Career Diary",description:"This is your comprehensive career history. Add accomplishments as they happen.",icon:e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-[var(--color-accent)]/10 to-[var(--color-accent)]/5 rounded-lg flex items-center justify-center",children:e.jsx("span",{className:"text-sm font-bold text-[var(--color-accent)]",children:"1"})}),action:e.jsx(fe,{location:s.location,zipcode:s.zipcode,radius:(A=r==null?void 0:r.jobPreferences)==null?void 0:A.searchR
2adius,onSave:l=>N(l),onZipcodeSave:l=>j(l),onRadiusSave:l=>P(y=>({...y,jobPreferences:{...y.jobPreferences||{},searchRadius:l}})),onError:l=>o.error("Invalid Location",l)})}),x&&e.jsx(Ce,{summary:x.mergeSummary,onConfirmMerge:v,onConfirmReplace:h,onCancel:f}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs(k,{variant:"default",padding:"md",className:"border-l-4 border-[var(--color-accent)]",children:[e.jsxs("h3",{className:"text-lg font-bold text-[var(--text-primary)] mb-2",children:[r.fullName,R&&e.jsxs("span",{className:`ml-3 text-xs font-medium px-2 py-1 rounded-full ${R.tone==="good"?"bg-green-100 text-green-700":R.tone==="fair"?"bg-yellow-100 text-yellow-700":"bg-red-100 text-red-700"}`,children:["Profile completeness: ",R.percent,"%"]})]}),e.jsx("p",{className:"text-sm text-[var(--text-secondary)] mb-3 break-all",children:Re(r.contactInfo,r.contactDetails)}),r.summary&&e.jsx("p",{className:"text-sm text-[var(--text-secondary)] leading-relaxed whitespace-pre-wrap",children:r.summary})]}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold text-[var(--text-primary)] mb-6 flex items-center gap-2",children:[e.jsx("div",{className:"h-5 w-1 bg-gradient-to-b from-[var(--color-accent)] to-[var(--color-accent-subtle)] rounded-full"}),"Work Experience"]}),e.jsx("div",{className:"space-y-5",children:r.experience&&r.experience.map((l,y)=>{const se=l.id&&typeof l.id=="string"&&l.id.trim()!==""?l.id:`exp-${y}-${l.company||"unknown"}-${l.jobTitle||"untitled"}-${y}`;return e.jsx(we,{experience:l,isExpanded:I===l.id,onToggleExpand:()=>ae(l.id)},se)})})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsxs(k,{variant:"default",padding:"md",className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-[var(--text-primary)]",children:"Education"}),(r.education||[]).length?e.jsx("div",{className:"space-y-4",children:r.education.map((l,y)=>e.jsxs("div",{className:"rounded-2xl border border-[var(--border-default)] bg-[var(--bg-secondary)]/60 p-4",children:[e.jsx("p",{className:"font-semibold text-[var(--text-primary)]",children:l.degree||"Education entry"}),e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:l.university||l.school||l.institution||"Institution not provided"}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)]/80",children:l.dates||l.graduationDate||l.endDate||"Dates not provided"}),l.description&&e.jsx("p",{className:"mt-3 whitespace-pre-wrap text-sm text-[var(--text-secondary)]",children:l.description})]},l.id||`${l.degree}-${l.university}-${y}`))}):e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:"No education entries added yet."})]}),e.jsxs(k,{variant:"default",padding:"md",className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-[var(--text-primary)]",children:"Skills"}),(r.skills||[]).length?e.jsx("div",{className:"flex flex-wrap gap-2",children:r.skills.map((l,y)=>e.jsx("span",{className:"rounded-full bg-[var(--color-accent)]/10 px-3 py-1 text-xs font-semibold text-[var(--color-accent)]",children:l},`${l}-${y}`))}):e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:"No skills tracked yet."})]}),e.jsxs(k,{variant:"default",padding:"md",className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-[var(--text-primary)]",children:"Contact Details"}),e.jsxs("div",{className:"space-y-2 text-sm text-[var(--text-secondary)]",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-[var(--text-primary)]",children:"Email:"})," ",((E=r.contactDetails)==null?void 0:E.email)||"Not provided"]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-[var(--text-primary)]",children:"Phone:"})," ",((M=r.contactDetails)==null?void 0:M.phone)||"Not provided"]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-[var(--text-primary)]",children:"LinkedIn:"})," ",((U=r.contactDetails)==null?void 0:U.linkedIn)||((B=r.contactDetails)==null?void 0:B.linkedin)||"Not provided"]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-[var(--text-primary)]",children:"GitHub:"})," ",((F=r.contactDetails)==null?void 0:F.github)||"Not provided"]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-[var(--text-primary)]",children:"Website:"})," ",((W=r.contactDetails)==null?void 0:W.website)||((H=r.contactDetails)==null?void 0:H.portfolio)||"Not provided"]})]})]}),e.jsxs(k,{variant:"default",padding:"md",className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-[var(--text-primary)]",children:"Job Preferences"}),e.jsxs("div",{className:"space-y-3 text-sm text-[var(--text-secondary)]",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-[var(--text-primary)]",children:"Target roles"}),e.jsx("p",{children:((O=(Y=r.jobPreferences)==null?void 0:Y.targetRoles)==null?void 0:O.join(", "))||"Not provided"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-[var(--text-primary)]",children:"Preferred locations"}),e.jsx("p",{children:((K=(G=r.jobPreferences)==null?void 0:G.preferredLocations)==null?void 0:K.join(", "))||"Not provided"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-[var(--text-primary)]",children:"Preferred industries"}
2),e.jsx("p",{children:((q=(V=r.jobPreferences)==null?void 0:V.preferredIndustries)==null?void 0:q.join(", "))||"Not provided"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-[var(--text-primary)]",children:"Working style"}),e.jsx("p",{children:((J=(Z=r.jobPreferences)==null?void 0:Z.locationTypes)==null?void 0:J.join(", "))||"Not provided"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-[var(--text-primary)]",children:"Salary expectations"}),e.jsx("p",{children:((X=r.jobPreferences)==null?void 0:X.salaryExpectation)||"Not provided"})]})]})]})]})]}),e.jsx(Ie,{})]}),e.jsx(k,{variant:"glass",padding:"lg",className:"border-l-4 border-[var(--color-accent)]",children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 min-w-0",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-lg font-bold text-[var(--text-primary)] mb-1",children:"Ready to Tailor Your Resume?"}),e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:"Use your Career Diary to generate tailored resumes for any job description in seconds."})]}),e.jsx(g,{onClick:t||(()=>window.location.href="/app/tailor"),variant:"primary",size:"lg",rightIcon:e.jsx("svg",{className:"h-4 w-4 transition-transform group-hover:translate-x-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),children:"Go to Resume Tailor"})]})})]})]})})};export{Be as ProfilePage};

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.