const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mammoth.browser.js","assets/storage.js","assets/storage.css"])))=>i.map(i=>d[i]);
import{u as y,p as _,c as W,j as n,r as k,e as z,l as X,a as G,s as V,b as K,d as Q,R as Y}from"./storage.js";const ee=["access control","analytics","api","aws","azure","building maintenance","c++","ci/cd","cmms","compliance","css","customer service","data analysis","docker","electrical","excel","facility maintenance","figma","firebase","gcp","github","go","graphql","html","hvac","javascript","kubernetes","leadership","machine learning","maintenance operations","microsoft office","next.js","node","plumbing","postgres","preventative maintenance","project management","python","react","regulatory compliance","rest","sql","supabase","tailwind","team leadership","typescript","vercel"],se=["professional summary","summary","perfil","perfil profesional","resume professionnel","experience","work experience","professional experience","employment history","experiencia","experiencia laboral","experience professionnelle","berufserfahrung","skills","technical skills","core competencies","habilidades","competencias","competences","kenntnisse","education","educacion","formation","ausbildung","certifications","licenses","certificaciones","licences","projects","portfolio","proyectos","projets","references"],ne=se.map($);function U(e){var R,P;const t=te(e),a=t.split(/\r?\n/).map(g=>g.trim()).filter(Boolean),i=((R=e.match(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/i))==null?void 0:R[0])??"",o=(P=t.match(/(?:\+?1[-.\s]?)?(?:\(?\d{3}\)?[-.\s]?)\d{3}[-.\s]?\d{4}/))==null?void 0:P[0],c=re(t),d=ae(a),f=d.split(/\s+/),b=ee.filter(g=>new RegExp(`(^|[^a-z0-9])${de(g)}([^a-z0-9]|$)`,"i").test(t)),x=oe(a),w=L(a,["education"]).concat(a.filter(g=>/(university|college|bachelor|master|associate|degree|bootcamp|school)/i.test(g))).filter(J).slice(0,5).map(g=>({id:y("edu"),school:g})),p=L(a,["experience","work experience","professional experience","employment history"]).filter(g=>/(advisor|developer|designer|director|engineer|facility|installer|lead|maintenance|manager|operator|specialist|supervisor|technician|analyst|consultant|coordinator)/i.test(g)).filter(ce).slice(0,5).map(g=>({id:y("work"),company:"",title:g})),u=L(a,["certifications","licenses"]).concat(a.filter(g=>/(certified|certification|certificate|license|osha|epa|comptia|aws|azure|google cloud)/i.test(g))).filter(J).slice(0,8).map(g=>({id:y("cert"),name:g})),C=L(a,["projects","portfolio"]).slice(0,8).map(g=>({id:y("project"),name:g})),v={};return d&&(v.firstName=f[0]??"",v.lastName=f.slice(1).join(" "),v.fullName=d),i&&(v.email=i),o&&(v.phone=o),Object.values(x).some(Boolean)&&(v.address=x),Object.values(c).some(Boolean)&&(v.links=c),b.length&&(v.skills=b),w.length&&(v.education=w),p.length&&(v.workExperience=p),u.length&&(v.certifications=u),C.length&&(v.projects=C),v}function te(e){return e.replace(/\u2028|\u2029/g,`
`).replace(/[•●▪]/g,`
`).replace(/\r/g,`
`).replace(/[ \t]+/g," ").replace(/\n{3,}/g,`

`).trim()}function ae(e){const t=e.slice(0,8).find(a=>B(a)||/@|\d{3}|\||https?:|linkedin|github/i.test(a)?!1:/^[A-Za-z][A-Za-z.'-]+(?:\s+[A-Za-z][A-Za-z.'-]+){1,3}$/.test(a)||/^[A-Z][A-Z.'-]+(?:\s+[A-Z][A-Z.'-]+){1,3}$/.test(a));return t?ie(t):""}function ie(e){return e.toLowerCase().split(/\s+/).map(t=>t.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join("-")).join(" ")}function re(e){const t=Array.from(e.matchAll(/(?:https?:\/\/|www\.)[^\s)>,]+|(?:linkedin\.com|github\.com)\/[^\s)>,]+/gi)).map(a=>le(a[0]));return{linkedin:t.find(a=>/linkedin\.com/i.test(a)),github:t.find(a=>/github\.com/i.test(a)),portfolio:t.find(a=>!/(linkedin|github)\.com/i.test(a)),website:t.find(a=>!/(linkedin|github)\.com/i.test(a))}}function le(e){const t=e.replace(/[.,;:]+$/g,"");return/^https?:\/\//i.test(t)?t:`https://${t.replace(/^www\./i,"")}`}function oe(e){const a=e.slice(0,8).flatMap(c=>c.split("|").map(d=>d.trim())).find(c=>/,\s*[A-Z]{2}\s+\d{5}/.test(c)),i=a==null?void 0:a.match(/([A-Za-z][A-Za-z .'-]+),\s*([A-Z]{2})\s+(\d{5}(?:-\d{4})?)/);return i?{city:(i[1]??"").replace(/^[A-Z][A-Z.'-]+(?:\s+[A-Z][A-Z.'-]+){1,3}\s+/,"").trim(),state:i[2],postalCode:i[3],country:"United States"}:{}}function L(e,t){const a=new Set(t.map($)),i=[];let o=!1;for(const c of e){const d=$(c);if(a.has(d)){o=!0;continue}if(o&&B(c))break;o&&c.length>2&&i.push(c)}return i}function B(e){return ne.includes($(e))}function $(e){return e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]/g,"")}function J(e,t,a){return a.findIndex(i=>i.toLowerCase()===e.toLowerCase())===t}function ce(e){return!(e.length>90||/, including\b/i.test(e)||/^(achieved|assist|assisted|coordinate|coordinated|created|deliver|delivered|develop|developed|ensure|ensured|independently|maintain|maintained|manage|managed|oversee|oversaw|perform|performed|provide|provided|support|supported|troubleshoot|troubleshot)\b/i.test(e))}function de(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const ue="modulepreload",pe=function(e){return"/"+e},Z={},I=function(t,a,i){let o=Promise.resolve();if(a&&a.length>0){let d=function(x){return Promise.all(x.map(w=>Promise.resolve(w).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),b=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=d(a.map(x=>{if(x=pe(x),x in Z)return;Z[x]=!0;const w=x.endsWith(".css"),p=w?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${p}`))return;const u=document.createElement("link");if(u.rel=w?"stylesheet":ue,w||(u.as="script"),u.crossOrigin="",u.href=x,b&&u.setAttribute("nonce",b),document.head.appendChild(u),w)return new Promise((C,v)=>{u.addEventListener("load",C),u.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${x}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return o.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})},fe=new Set(["text/plain","text/markdown","text/x-markdown","text/csv"]);async function he(e){var d;const t=((d=e.name.split(".").pop())==null?void 0:d.toLowerCase())??"",a={name:e.name,type:e.type||t,size:e.size,updatedAt:new Date().toISOString()};if(t==="json"||e.type==="application/json")return je(e,a);const{text:i,warnings:o,sourceType:c}=await me(e,t);return{file:a,text:i,profile:{...U(i),resumeFile:a},warnings:o,sourceType:c}}async function me(e,t){return t==="pdf"||e.type==="application/pdf"?{text:await xe(e),warnings:["PDF import works for text-layer PDFs. Scanned image PDFs need OCR in a future opt-in cloud service."],sourceType:"pdf"}:t==="docx"||e.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?{text:await ve(e),warnings:[],sourceType:"docx"}:t==="doc"?{text:"",warnings:["Legacy .doc files are detected but not parsed locally. Save as DOCX or PDF, or use a future opt-in cloud conversion service."],sourceType:"doc"}:t==="html"||t==="htm"||e.type==="text/html"?{text:we(await F(e)),warnings:[],sourceType:"html"}:t==="rtf"||e.type==="application/rtf"||e.type==="text/rtf"?{text:ye(await F(e)),warnings:[],sourceType:"rtf"}:fe.has(e.type)||["txt","md","markdown","csv"].includes(t)?{text:await F(e),warnings:[],sourceType:t||"text"}:{text:"",warnings:[`${e.name} is not a supported local resume format yet. Use PDF, DOCX, TXT, MD, HTML, RTF, or ApplyPilot JSON.`],sourceType:t||"unknown"}}async function xe(e){const t=await I(()=>import("./webpack.js"),[]),a=new Uint8Array(await e.arrayBuffer()),i=await t.getDocument({data:a,isEvalSupported:!1,useWorkerFetch:!1}).promise,o=[];for(let c=1;c<=i.numPages;c+=1){const f=await(await i.getPage(c)).getTextContent();o.push(ge(f.items))}return o.join(`
`)}function ge(e){const t=e.map((i,o)=>{var c,d,f;return{text:((c=i.str)==null?void 0:c.trim())??"",x:((d=i.transform)==null?void 0:d[4])??o,y:((f=i.transform)==null?void 0:f[5])??0}}).filter(i=>i.text);if(!t.some(i=>i.y))return t.map(i=>i.text).join(" ");const a=new Map;for(const i of t){const o=Math.round(i.y/2)*2,c=a.get(o)??[];c.push({text:i.text,x:i.x}),a.set(o,c)}return Array.from(a.entries()).sort(([i],[o])=>o-i).map(([,i])=>i.sort((o,c)=>o.x-c.x).map(o=>o.text).join(" ").replace(/\s+/g," ").trim()).filter(Boolean).join(`
`)}async function ve(e){const t=await I(()=>import("./mammoth.browser.js").then(o=>o.m),__vite__mapDeps([0,1,2]));return(await("default"in t?t.default:t).extractRawText({arrayBuffer:await e.arrayBuffer()})).value}async function je(e,t){const a=JSON.parse(await F(e)),i=_.parse(a);return{file:t,text:"",profile:{...i,resumeFile:t},warnings:[],sourceType:"json"}}async function F(e){return typeof e.text=="function"?e.text():typeof FileReader<"u"?new Promise((t,a)=>{const i=new FileReader;i.onload=()=>t(String(i.result??"")),i.onerror=()=>a(i.error??new Error("Could not read file")),i.readAsText(e)}):typeof e.arrayBuffer=="function"?new TextDecoder().decode(await e.arrayBuffer()):new Response(e).text()}function we(e){var i;const t=e.replace(/<\s*br\s*\/?>/gi,`
`).replace(/<\s*\/?(p|div|section|article|header|footer|h[1-6]|li|tr|td|th)[^>]*>/gi,`
`);return((i=new DOMParser().parseFromString(t,"text/html").body.textContent)==null?void 0:i.replace(/\s+/g," ").trim())??""}function ye(e){return e.replace(/\\'[0-9a-fA-F]{2}/g," ").replace(/\\par[d]?/g,`
`).replace(/\\[a-zA-Z]+-?\d* ?/g,"").replace(/[{}]/g,"").replace(/\s+\n/g,`
`).replace(/\n{3,}/g,`

`).trim()}function be(){const[e,t]=k.useState(z),[a,i]=k.useState({allowSensitiveAutofill:!1,allowReferenceAutofill:!1,allowSalaryAutofill:!1,allowLegalAutofill:!1,autoSelectMediumRisk:!1}),[o,c]=k.useState(""),[d,f]=k.useState(""),[b,x]=k.useState("Profile data stays in local Chrome storage unless you export it.");k.useEffect(()=>{Promise.all([X(),G()]).then(([s,m])=>{t(s),i(m),f(JSON.stringify(s,null,2))})},[]);const w=k.useMemo(()=>Ce(e),[e]);function p(s,m){t(r=>({...r,[s]:m}))}function u(s,m){t(r=>({...r,[s]:m}))}async function C(){const s={...e,fullName:e.fullName||[e.firstName,e.middleName,e.lastName].filter(Boolean).join(" ")};await V(s),await K(a),t(s),f(JSON.stringify(s,null,2)),x("Saved locally. Re-scan application pages to use the latest profile.")}function v(){const s=U(o);t(m=>q(m,s)),x("Résumé text was parsed with deterministic rules. Review the structured fields before saving.")}async function R(s){var r;const m=(r=s.currentTarget.files)==null?void 0:r[0];if(m){x(`Reading ${m.name} locally...`);try{const j=await he(m);j.text&&c(j.text),t(M=>q(M,j.profile));const H=j.warnings.length?` ${j.warnings.join(" ")}`:"";x(`Imported ${m.name} as ${j.sourceType}. Review extracted fields before saving.${H}`)}catch(j){x(j instanceof Error?`Import failed: ${j.message}`:"Import failed. Try PDF, DOCX, TXT, MD, HTML, RTF, or ApplyPilot JSON.")}finally{s.currentTarget.value=""}}}function P(){try{const s=JSON.parse(d);t(s),x("JSON imported into the editor. Save when you are ready.")}catch{x("JSON import failed. Check the file format.")}}async function g(){await Q(),t(z),f(JSON.stringify(z,null,2)),x("All local ApplyPilot data was cleared.")}return n.jsxs("main",{className:"options-shell",children:[n.jsxs("header",{className:"page-hero",children:[n.jsxs("div",{children:[n.jsx("p",{className:"eyebrow",children:"ApplyPilot profile workspace"}),n.jsx("h1",{children:"Build one reusable application profile"}),n.jsx("p",{className:"hero-copy",children:"Save your candidate data locally, import from resumes, decide what sensitive categories can ever be filled, and export a profile you control."})]}),n.jsxs("div",{className:"hero-actions",children:[n.jsx("button",{onClick:C,children:"Save profile"}),n.jsx("button",{className:"secondary",onClick:()=>f(JSON.stringify(e,null,2)),children:"Refresh export JSON"}),n.jsx("button",{className:"danger",onClick:g,children:"Clear all data"})]})]}),n.jsxs("section",{className:"panel stack",children:[n.jsxs("div",{className:"overview-grid",children:[n.jsx(D,{label:"Profile completion",value:`${w}%`,detail:"Fill the basics, add work history, and keep one source of truth."}),n.jsx(D,{label:"Work experience",value:`${e.workExperience.length}`,detail:"Roles available for application mapping and saved answers."}),n.jsx(D,{label:"Projects",value:`${e.projects.length}`,detail:"Helpful for GitHub, portfolio, and custom question context."}),n.jsx(D,{label:"Saved answers",value:`${e.savedAnswers.length}`,detail:"Used for open-ended questions when you already have a strong answer."})]}),n.jsx("div",{className:"message-card",children:n.jsx("p",{children:b})})]}),n.jsxs("section",{className:"form-grid",children:[n.jsx(T,{title:"Professional basics",description:"Core identity fields used across most application forms.",children:n.jsxs("div",{className:"grid two",children:[n.jsx(l,{label:"First name",value:e.firstName,onChange:s=>p("firstName",s)}),n.jsx(l,{label:"Middle name",value:e.middleName??"",onChange:s=>p("middleName",s)}),n.jsx(l,{label:"Last name",value:e.lastName,onChange:s=>p("lastName",s)}),n.jsx(l,{label:"Full name",value:e.fullName,onChange:s=>p("fullName",s)}),n.jsx(l,{label:"Email",value:e.email,onChange:s=>p("email",s)}),n.jsx(l,{label:"Phone",value:e.phone??"",onChange:s=>p("phone",s)})]})}),n.jsx(T,{title:"Address",description:"Used only when applications ask for it.",children:n.jsxs("div",{className:"grid two",children:[n.jsx(l,{label:"Address line 1",value:e.address.line1??"",onChange:s=>u("address",{...e.address,line1:s})}),n.jsx(l,{label:"Address line 2",value:e.address.line2??"",onChange:s=>u("address",{...e.address,line2:s})}),n.jsx(l,{label:"City",value:e.address.city??"",onChange:s=>u("address",{...e.address,city:s})}),n.jsx(l,{label:"State or province",value:e.address.state??"",onChange:s=>u("address",{...e.address,state:s})}),n.jsx(l,{label:"Postal code",value:e.address.postalCode??"",onChange:s=>u("address",{...e.address,postalCode:s})}),n.jsx(l,{label:"Country",value:e.address.country??"",onChange:s=>u("address",{...e.address,country:s})})]})}),n.jsx(T,{title:"Links and preferences",description:"Useful for portfolio, GitHub, compensation, and availability questions.",children:n.jsxs("div",{className:"grid two",children:[n.jsx(l,{label:"LinkedIn URL",value:e.links.linkedin??"",onChange:s=>u("links",{...e.links,linkedin:s})}),n.jsx(l,{label:"Portfolio URL",value:e.links.portfolio??"",onChange:s=>u("links",{...e.links,portfolio:s})}),n.jsx(l,{label:"GitHub URL",value:e.links.github??"",onChange:s=>u("links",{...e.links,github:s})}),n.jsx(l,{label:"Personal website",value:e.links.website??"",onChange:s=>u("links",{...e.links,website:s})}),n.jsx(l,{label:"Work authorization",value:e.preferences.workAuthorization??"",onChange:s=>u("preferences",{...e.preferences,workAuthorization:s})}),n.jsx(l,{label:"Sponsorship requirement",value:e.preferences.sponsorshipRequirement??"",onChange:s=>u("preferences",{...e.preferences,sponsorshipRequirement:s})}),n.jsx(l,{label:"Desired salary",value:e.preferences.desiredSalary??"",onChange:s=>u("preferences",{...e.preferences,desiredSalary:s})}),n.jsx(l,{label:"Availability date",value:e.preferences.availabilityDate??"",onChange:s=>u("preferences",{...e.preferences,availabilityDate:s})})]})}),n.jsx(T,{title:"Sensitive optional fields",description:"These remain opt-in. They are not auto-selected by default in the popup.",children:n.jsxs("div",{className:"grid two",children:[n.jsx(l,{label:"Veteran status",value:e.sensitive.veteranStatus??"",onChange:s=>u("sensitive",{...e.sensitive,veteranStatus:s})}),n.jsx(l,{label:"Disability status",value:e.sensitive.disabilityStatus??"",onChange:s=>u("sensitive",{...e.sensitive,disabilityStatus:s})}),n.jsx(l,{label:"Gender",value:e.sensitive.gender??"",onChange:s=>u("sensitive",{...e.sensitive,gender:s})}),n.jsx(l,{label:"Race or ethnicity",value:e.sensitive.raceEthnicity??"",onChange:s=>u("sensitive",{...e.sensitive,raceEthnicity:s})}),n.jsx(l,{label:"Pronouns",value:e.sensitive.pronouns??"",onChange:s=>u("sensitive",{...e.sensitive,pronouns:s})})]})})]}),n.jsxs("section",{className:"panel stack",children:[n.jsx("div",{className:"section-heading",children:n.jsxs("div",{children:[n.jsx("h2",{children:"Autofill controls"}),n.jsx("p",{className:"muted",children:"Choose what ApplyPilot may preselect. High-risk fields still require your review on each page."})]})}),n.jsxs("div",{className:"toggle-grid",children:[n.jsx(E,{label:"Allow sensitive demographic autofill",detail:"For veteran, disability, gender, race, ethnicity, and pronouns.",checked:a.allowSensitiveAutofill,onChange:s=>i({...a,allowSensitiveAutofill:s})}),n.jsx(E,{label:"Allow reference autofill",detail:"Still review references per application before filling them.",checked:a.allowReferenceAutofill,onChange:s=>i({...a,allowReferenceAutofill:s})}),n.jsx(E,{label:"Allow salary autofill",detail:"Salary fields stay high-risk and off unless you enable them.",checked:a.allowSalaryAutofill,onChange:s=>i({...a,allowSalaryAutofill:s})}),n.jsx(E,{label:"Allow legal or sponsorship autofill",detail:"Useful for work authorization or visa sponsorship questions.",checked:a.allowLegalAutofill,onChange:s=>i({...a,allowLegalAutofill:s})}),n.jsx(E,{label:"Auto-select medium-risk matches",detail:"For lower-impact location and availability style fields.",checked:a.autoSelectMediumRisk,onChange:s=>i({...a,autoSelectMediumRisk:s})})]})]}),n.jsx(T,{title:"Skills",description:"Separate skills with commas or line breaks.",children:n.jsx("textarea",{value:e.skills.join(", "),onChange:s=>p("skills",s.currentTarget.value.split(/,|\n/).map(m=>m.trim()).filter(Boolean)),placeholder:"React, TypeScript, SQL, project management"})}),n.jsx(N,{title:"Work experience",description:"Roles and accomplishments you want to reuse in applications.",addLabel:"Add role",emptyLabel:"No work experience yet.",onAdd:()=>p("workExperience",[...e.workExperience,{id:y("work"),company:"",title:""}]),children:e.workExperience.map((s,m)=>n.jsxs(A,{title:s.title||s.company||`Role ${m+1}`,onDelete:()=>p("workExperience",e.workExperience.filter(r=>r.id!==s.id)),children:[n.jsxs("div",{className:"grid two",children:[n.jsx(l,{label:"Company",value:s.company,onChange:r=>h(e.workExperience,s.id,t,"workExperience",{company:r})}),n.jsx(l,{label:"Title",value:s.title,onChange:r=>h(e.workExperience,s.id,t,"workExperience",{title:r})}),n.jsx(l,{label:"Start date",value:s.startDate??"",onChange:r=>h(e.workExperience,s.id,t,"workExperience",{startDate:r})}),n.jsx(l,{label:"End date",value:s.endDate??"",onChange:r=>h(e.workExperience,s.id,t,"workExperience",{endDate:r})})]}),n.jsxs("label",{children:["Description",n.jsx("textarea",{value:s.description??"",onChange:r=>h(e.workExperience,s.id,t,"workExperience",{description:r.currentTarget.value})})]})]},s.id))}),n.jsx(N,{title:"Education",description:"Degrees, schools, and study areas.",addLabel:"Add education",emptyLabel:"No education entries yet.",onAdd:()=>p("education",[...e.education,{id:y("education"),school:""}]),children:e.education.map((s,m)=>n.jsxs(A,{title:s.school||`Education ${m+1}`,onDelete:()=>p("education",e.education.filter(r=>r.id!==s.id)),children:[n.jsxs("div",{className:"grid two",children:[n.jsx(l,{label:"School",value:s.school,onChange:r=>h(e.education,s.id,t,"education",{school:r})}),n.jsx(l,{label:"Degree",value:s.degree??"",onChange:r=>h(e.education,s.id,t,"education",{degree:r})}),n.jsx(l,{label:"Field",value:s.field??"",onChange:r=>h(e.education,s.id,t,"education",{field:r})}),n.jsx(l,{label:"Start date",value:s.startDate??"",onChange:r=>h(e.education,s.id,t,"education",{startDate:r})}),n.jsx(l,{label:"End date",value:s.endDate??"",onChange:r=>h(e.education,s.id,t,"education",{endDate:r})})]}),n.jsxs("label",{children:["Notes",n.jsx("textarea",{value:s.notes??"",onChange:r=>h(e.education,s.id,t,"education",{notes:r.currentTarget.value})})]})]},s.id))}),n.jsx(N,{title:"Certifications",description:"Useful for applications with licensing or credential questions.",addLabel:"Add certification",emptyLabel:"No certifications yet.",onAdd:()=>p("certifications",[...e.certifications,{id:y("cert"),name:""}]),children:e.certifications.map((s,m)=>n.jsx(A,{title:s.name||`Certification ${m+1}`,onDelete:()=>p("certifications",e.certifications.filter(r=>r.id!==s.id)),children:n.jsxs("div",{className:"grid two",children:[n.jsx(l,{label:"Name",value:s.name,onChange:r=>h(e.certifications,s.id,t,"certifications",{name:r})}),n.jsx(l,{label:"Issuer",value:s.issuer??"",onChange:r=>h(e.certifications,s.id,t,"certifications",{issuer:r})}),n.jsx(l,{label:"Date",value:s.date??"",onChange:r=>h(e.certifications,s.id,t,"certifications",{date:r})}),n.jsx(l,{label:"Credential URL",value:s.url??"",onChange:r=>h(e.certifications,s.id,t,"certifications",{url:r})})]})},s.id))}),n.jsx(N,{title:"Projects",description:"Helpful for portfolio and open-ended questions.",addLabel:"Add project",emptyLabel:"No projects yet.",onAdd:()=>p("projects",[...e.projects,{id:y("project"),name:""}]),children:e.projects.map((s,m)=>n.jsxs(A,{title:s.name||`Project ${m+1}`,onDelete:()=>p("projects",e.projects.filter(r=>r.id!==s.id)),children:[n.jsxs("div",{className:"grid two",children:[n.jsx(l,{label:"Project name",value:s.name,onChange:r=>h(e.projects,s.id,t,"projects",{name:r})}),n.jsx(l,{label:"Project URL",value:s.url??"",onChange:r=>h(e.projects,s.id,t,"projects",{url:r})})]}),n.jsxs("label",{children:["Description",n.jsx("textarea",{value:s.description??"",onChange:r=>h(e.projects,s.id,t,"projects",{description:r.currentTarget.value})})]}),n.jsx(l,{label:"Technologies",value:(s.technologies??[]).join(", "),onChange:r=>h(e.projects,s.id,t,"projects",{technologies:r.split(/,|\n/).map(j=>j.trim()).filter(Boolean)})})]},s.id))}),n.jsx(N,{title:"References",description:"Stored locally and never auto-filled unless you enable references.",addLabel:"Add reference",emptyLabel:"No references yet.",onAdd:()=>p("references",[...e.references,{id:y("reference"),name:""}]),children:e.references.map((s,m)=>n.jsxs(A,{title:s.name||`Reference ${m+1}`,onDelete:()=>p("references",e.references.filter(r=>r.id!==s.id)),children:[n.jsxs("div",{className:"grid two",children:[n.jsx(l,{label:"Name",value:s.name,onChange:r=>h(e.references,s.id,t,"references",{name:r})}),n.jsx(l,{label:"Relationship",value:s.relationship??"",onChange:r=>h(e.references,s.id,t,"references",{relationship:r})}),n.jsx(l,{label:"Email",value:s.email??"",onChange:r=>h(e.references,s.id,t,"references",{email:r})}),n.jsx(l,{label:"Phone",value:s.phone??"",onChange:r=>h(e.references,s.id,t,"references",{phone:r})})]}),n.jsxs("label",{children:["Notes",n.jsx("textarea",{value:s.notes??"",onChange:r=>h(e.references,s.id,t,"references",{notes:r.currentTarget.value})})]})]},s.id))}),n.jsx(N,{title:"Saved answers",description:"These are used for open-ended prompts such as “Why are you interested?” when you already have a reusable draft.",addLabel:"Add saved answer",emptyLabel:"No saved answers yet.",onAdd:()=>p("savedAnswers",[...e.savedAnswers,{id:y("answer"),question:"",answer:""}]),children:e.savedAnswers.map((s,m)=>n.jsxs(A,{title:s.question||`Saved answer ${m+1}`,onDelete:()=>p("savedAnswers",e.savedAnswers.filter(r=>r.id!==s.id)),children:[n.jsx(l,{label:"Question or prompt",value:s.question,onChange:r=>h(e.savedAnswers,s.id,t,"savedAnswers",{question:r})}),n.jsxs("label",{children:["Answer",n.jsx("textarea",{value:s.answer,onChange:r=>h(e.savedAnswers,s.id,t,"savedAnswers",{answer:r.currentTarget.value})})]}),n.jsx(l,{label:"Tags",value:(s.tags??[]).join(", "),onChange:r=>h(e.savedAnswers,s.id,t,"savedAnswers",{tags:r.split(/,|\n/).map(j=>j.trim()).filter(Boolean)})})]},s.id))}),n.jsxs("section",{className:"panel stack",children:[n.jsx("div",{className:"section-heading",children:n.jsxs("div",{children:[n.jsx("h2",{children:"Résumé import"}),n.jsx("p",{className:"muted",children:"Import locally from file or pasted text. Advanced OCR or legacy DOC conversion is still outside the local-first MVP."})]})}),n.jsxs("label",{children:["Resume file",n.jsx("input",{type:"file",accept:".pdf,.doc,.docx,.txt,.md,.markdown,.html,.htm,.rtf,.json,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,text/plain,text/markdown,text/html,application/rtf,application/json",onChange:s=>void R(s)})]}),n.jsx("textarea",{value:o,onChange:s=>c(s.currentTarget.value),placeholder:"Paste résumé text here"}),n.jsx("div",{className:"row",children:n.jsx("button",{onClick:v,children:"Extract obvious fields"})})]}),n.jsxs("section",{className:"panel stack",children:[n.jsx("div",{className:"section-heading",children:n.jsxs("div",{children:[n.jsx("h2",{children:"Import and export JSON"}),n.jsx("p",{className:"muted",children:"Use this to back up your local profile or move it between browsers."})]})}),n.jsx("textarea",{value:d,onChange:s=>f(s.currentTarget.value)}),n.jsxs("div",{className:"row",children:[n.jsx("button",{onClick:P,children:"Import JSON"}),n.jsx("button",{className:"secondary",onClick:()=>navigator.clipboard.writeText(JSON.stringify(e,null,2)),children:"Copy export JSON"})]})]})]})}function T({title:e,description:t,children:a}){return n.jsxs("section",{className:"panel stack",children:[n.jsx("div",{className:"section-heading",children:n.jsxs("div",{children:[n.jsx("h2",{children:e}),n.jsx("p",{className:"muted",children:t})]})}),a]})}function N({title:e,description:t,addLabel:a,emptyLabel:i,onAdd:o,children:c}){const d=Y.Children.toArray(c);return n.jsxs("section",{className:"panel stack",children:[n.jsxs("div",{className:"section-heading section-heading-between",children:[n.jsxs("div",{children:[n.jsx("h2",{children:e}),n.jsx("p",{className:"muted",children:t})]}),n.jsx("button",{className:"secondary",onClick:o,children:a})]}),d.length>0?d:n.jsx("p",{className:"muted",children:i})]})}function A({title:e,onDelete:t,children:a}){return n.jsxs("article",{className:"entry-card",children:[n.jsxs("div",{className:"entry-card-header",children:[n.jsx("strong",{children:e}),n.jsx("button",{className:"danger",onClick:t,children:"Delete"})]}),n.jsx("div",{className:"stack",children:a})]})}function D({label:e,value:t,detail:a}){return n.jsxs("div",{className:"metric-card",children:[n.jsx("span",{className:"metric-label",children:e}),n.jsx("strong",{className:"metric-value metric-value-lg",children:t}),n.jsx("span",{className:"muted",children:a})]})}function l({label:e,value:t,onChange:a}){return n.jsxs("label",{children:[e,n.jsx("input",{value:t,onChange:i=>a(i.currentTarget.value)})]})}function E({label:e,detail:t,checked:a,onChange:i}){return n.jsxs("label",{className:"toggle-card",children:[n.jsxs("div",{children:[n.jsx("strong",{children:e}),n.jsx("p",{className:"muted",children:t})]}),n.jsx("input",{type:"checkbox",checked:a,onChange:o=>i(o.currentTarget.checked)})]})}function h(e,t,a,i,o){a(c=>({...c,[i]:e.map(d=>d.id===t?{...d,...o}:d)}))}function q(e,t){return{...e,firstName:t.firstName||e.firstName,middleName:t.middleName||e.middleName,lastName:t.lastName||e.lastName,fullName:t.fullName||e.fullName,email:t.email||e.email,phone:t.phone||e.phone,address:{...e.address,...O(t.address)},links:{...e.links,...O(t.links)},preferences:{...e.preferences,...O(t.preferences)},sensitive:{...e.sensitive,...O(t.sensitive)},education:S(e.education,t.education),workExperience:S(e.workExperience,t.workExperience),certifications:S(e.certifications,t.certifications),projects:S(e.projects,t.projects),references:S(e.references,t.references),savedAnswers:S(e.savedAnswers,t.savedAnswers),skills:ke(e.skills,t.skills),resumeFile:t.resumeFile??e.resumeFile}}function O(e){return e?Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0&&t!=="")):{}}function S(e,t){if(!(t!=null&&t.length))return e;const a=new Set(e.map(i=>JSON.stringify(i).toLowerCase()));return e.concat(t.filter(i=>{const o=JSON.stringify(i).toLowerCase();return a.has(o)?!1:(a.add(o),!0)}))}function ke(e,t){if(!(t!=null&&t.length))return e;const a=new Set(e.map(i=>i.toLowerCase()));return e.concat(t.filter(i=>{const o=i.toLowerCase();return a.has(o)?!1:(a.add(o),!0)}))}function Ce(e){const t=[e.firstName,e.lastName,e.email,e.phone,e.links.linkedin,e.skills.length,e.workExperience.length,e.education.length,e.projects.length];return Math.round(t.filter(Boolean).length/t.length*100)}W.createRoot(document.getElementById("root")).render(n.jsx(be,{}));
//# sourceMappingURL=options.js.map
