PageSourceSearch

https://ezyitai.com/assets/Workspace-ZF-DI3Js.js

js ezyitai.com collected 2026-10-02 01:30:02 UTC 15,923 bytes, 2 lines download raw bytes

1import{d as fe,r as s,j as e}from"./vendor-react-CkwDUE0G.js";import{c as L,t,b as k,i as Q,f as X}from"./index-COncakSI.js";import{B as c,I as i,M as N,F as n,a as U}from"./controls-C_3QZHJi.js";import{u as A}from"./useFeatureFlag--2G_W9nu.js";import{h as M,bo as ye,aR as Z,$ as be,ab as ee,ay as ae,am as je}from"./vendor-icons-DfuxPcmc.js";import"./vendor-supabase-DJDI_vqi.js";import"./vendor-motion-CrL80kFJ.js";(function(){try{var d=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},m=new d.Error().stack;m&&(d._sentryDebugIds=d._sentryDebugIds||{},d._sentryDebugIds[m]="c4764932-31fb-4657-8b77-2eb7aac4cd20",d._sentryDebugIdIdentifier="sentry-dbid-c4764932-31fb-4657-8b77-2eb7aac4cd20")}catch{}})();function Ee(){const d=fe(),m=A("workspace.pause_submissions"),v=A("workspace.excluded_companies"),C=A("workspace.suggest_a_role"),[T,$]=s.useState([]),[z,q]=s.useState([]),[S,f]=s.useState(null),[te,O]=s.useState(!0),[P,W]=s.useState(""),[B,G]=s.useState(""),[F,y]=s.useState(null),[u,E]=s.useState({companyName:"",reason:""}),[R,V]=s.useState(!1),[se,b]=s.useState(!1),[Y,re]=s.useState("7"),[H,oe]=s.useState(""),[le,j]=s.useState(!1),[r,p]=s.useState({title:"",company:"",location:"",url:"",description:""}),[J,w]=s.useState(null),[l,h]=s.useState({title:"",company:"",location:"",url:"",description:""}),[D,K]=s.useState(!1);s.useEffect(()=>{!m&&!v&&!C&&d("/dashboard",{replace:!0})},[m,v,C,d]);async function x(){var a;try{O(!0);const[o,g]=await Promise.all([L("/api/workspace/flagged-companies"),L("/api/workspace/self-added-jobs")]);$(o.companies||[]),q(g.jobs||[]);try{const _=await L("/api/profile"),I=(a=_==null?void 0:_.profile)==null?void 0:a.paused_until;if(I){const ve=new Date(I);f(ve>new Date?I:null)}else f(null)}catch{}}catch(o){t.error(o.message||"Failed to load workspace")}finally{O(!1)}}s.useEffect(()=>{x()},[]);async function ne(){const a=P.trim();if(!a){t.error("Enter a company name to exclude.");return}if(a.length>120){t.error("Company name is too long. Max 120 characters.");return}try{await k("/api/workspace/flagged-companies",{companyName:a,reason:(B||"").trim().slice(0,280)||null}),t.success("Company flagged"),W(""),G(""),x()}catch(o){t.error(o.message||"Flag failed")}}async function ie(a){try{await Q(`/api/workspace/flagged-companies/${a}`),$(o=>o.filter(g=>g.id!==a))}catch(o){t.error(o.message)}}function ce(a){y(a.id),E({companyName:a.company_name||"",reason:a.reason||""})}async function de(){if(F){if(!u.companyName.trim()){t.error("Company name required");return}try{V(!0),await X(`/api/workspace/flagged-companies/${F}`,{companyName:u.companyName.trim(),reason:u.reason||null}),t.success("Updated"),y(null),x()}catch(a){t.error(a.message||"Failed to update")}finally{V(!1)}}}async function ue(){try{const a=parseInt(Y,10)||7,o=new Date(Date.now()+a*24*60*60*1e3).toISOString();await k("/api/workspace/pause",{pausedUntil:o,reason:H||null}),f(o),b(!1),t.success(`Paused for ${a} days`)}catch(a){t.error(a.message||"Pause failed")}}async function me(){try{await k("/api/workspace/resume",{}),f(null),t.success("Resumed")}catch(a){t.error(a.message)}}async function pe(){if(!r.title||!r.company){t.error("Title and company required");return}if(!r.description||r.description.trim().length<50){t.error("Paste the job description, your admin needs it to tailor your resume.");return}if(r.url&&r.url.trim())try{const a=new URL(r.url.trim());if(a.protocol!=="http:"&&a.protocol!=="https:")throw new Error("scheme")}catch{t.error("URL must be a valid http(s) link (or leave blank).");return}try{await k("/api/workspace/self-added-jobs",r),t.success("Job added"),j(!1),p({title:"",company:"",location:"",url:"",description:""}),x()}catch(a){t.error(a.message)}}function he(a){w(a.id),h({title:a.title||"",company:a.company||"",location:a.location||"",url:a.url||"",description:a.description||""})}async function xe(){if(J){if(!l.title||!l.company){t.error("Title and company required");return}if(!l.description||l.description.trim().length<50){t.error("Paste the job description, your admin needs it to tailor your resume.");return}try{K(!0),await X(`/api/workspace/self-added-jobs/${J}`,l),t.success("Updated"),w(null),x()}catch(a){t.error(a.message||"Failed to update")}finally{K(!1)}}}async function ge(a){if(confirm("Remove this suggested role?"))try{await Q(`/api/workspace/self-added-jobs/${a}
1`),q(o=>o.filter(g=>g.id!==a)),t.success("Removed")}catch(o){t.error(o.message||"Failed to delete")}}return e.jsxs("div",{className:"animate-fade-in",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"font-display ts-h1 font-bold text-[var(--color-ink)] dark:text-[var(--color-moon)]",style:{fontVariationSettings:'"opsz" 72, "SOFT" 50'},children:"Workspace"}),e.jsx("p",{className:"ts-body-sm text-[var(--color-ink-muted)] dark:text-[var(--color-moon-soft)] mt-1",children:"Pause submissions, exclude companies, or suggest a role for your specialist."})]}),te?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(M,{className:"w-6 h-6 animate-spin text-[var(--color-terracotta)]"})}):e.jsxs("div",{className:"space-y-6 max-w-3xl",children:[m&&e.jsxs("div",{id:"ws-pause",className:"group rounded-xl border border-[var(--color-rule)] dark:border-[var(--color-night-rule)] p-5 transition-colors hover:border-[var(--color-terracotta)]/40",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-1.5",children:[e.jsxs("h3",{className:"font-display text-[1.2rem] sm:text-[1.3rem] leading-[1.15] tracking-[-0.015em] text-[var(--color-ink)] dark:text-[var(--color-moon)] flex items-center gap-2",children:[e.jsxs("span",{className:"relative inline-flex w-4 h-4 items-center justify-center",children:[e.jsx(ye,{className:"w-4 h-4 text-[var(--color-ink-muted)] transition-all duration-300 group-hover:opacity-0 group-hover:-rotate-90 group-hover:scale-50"}),e.jsx(Z,{className:"absolute inset-0 w-4 h-4 text-[var(--color-terracotta)] opacity-0 scale-50 rotate-90 transition-all duration-300 group-hover:opacity-100 group-hover:rotate-0 group-hover:scale-100"})]}),"Pause submissions"]}),S?e.jsxs(c,{size:"sm",variant:"ghost",onClick:me,children:[e.jsx(Z,{className:"w-4 h-4 mr-1"})," Resume now"]}):e.jsx(c,{size:"sm",onClick:()=>b(!0),"data-testid":"pause-btn",children:"Pause"})]}),S?e.jsxs("p",{className:"ts-body-sm text-[var(--color-ink-muted)] dark:text-[var(--color-moon-soft)]",children:["Paused until ",e.jsx("span",{className:"font-semibold text-[var(--color-ink)] dark:text-[var(--color-moon)]",children:new Date(S).toLocaleString()}),". Your specialist sees this within seconds and will stop submitting new applications. Anything already mid-flight today may still complete."]}):e.jsx("p",{className:"ts-body-sm text-[var(--color-ink-muted)] dark:text-[var(--color-moon-soft)] leading-snug",children:"Signal your specialist to stop new submissions for a chosen window. They see the pause on their dashboard within seconds."})]}),v&&e.jsxs("div",{id:"ws-excluded",className:"group rounded-xl border border-[var(--color-rule)] dark:border-[var(--color-night-rule)] p-5 transition-colors hover:border-[var(--color-terracotta)]/40",children:[e.jsxs("h3",{className:"font-display text-[1.2rem] sm:text-[1.3rem] leading-[1.15] tracking-[-0.015em] text-[var(--color-ink)] dark:text-[var(--color-moon)] flex items-center gap-2 mb-1",children:[e.jsx(be,{className:"w-4 h-4 text-[var(--color-ink-muted)] origin-bottom transition-transform duration-300 group-hover:text-[var(--color-terracotta)] group-hover:[animation:flagWave_0.6s_ease-in-out]"}),"Excluded companies"]}),e.jsx("p",{className:"ts-body-sm text-[var(--color-ink-muted)] dark:text-[var(--color-moon-soft)] mb-4",children:"Companies you list here are skipped during admin submissions."}),e.jsxs("div",{className:"flex gap-2 mb-3 flex-wrap",children:[e.jsx(i,{value:P,onChange:a=>W(a.target.value),placeholder:"Company name",className:"w-full sm:flex-1 sm:min-w-[200px]","data-testid":"flag-company-input",maxLength:120}),e.jsx(i,{value:B,onChange:a=>G(a.target.value),placeholder:"Reason (optional)",className:"w-full sm:flex-1 sm:min-w-[200px]",maxLength:280}),e.jsx(c,{size:"sm",onClick:ne,"data-testid":"flag-company-btn",disabled:!P.trim(),children:"Add"})]}),T.length===0?e.jsx("p",{className:"ts-caption text-[var(--color-ink-faint)] dark:text-[var(--color-moon-soft)]",children:"No companies excluded yet."}):e.jsx("ul",{className:"space-y-2",children:T.map(a=>e.jsxs("li",{className:"flex items-center justify-between gap-3 ts-body-sm",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"font-semibold text-[var(--color-ink)] dark:text-[var(--color-moon)]",children:a.company_name}),a.reason&&e.jsxs("span",{className:"text-[var(--color-ink-muted)] dark:text-[var(--color-moon-soft)]",children:[" · ",a.reason]})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-1 shrink-0",children:[e.jsx("button",{onClick:()=>ce(a),className:"w-10 h-10 sm:w-9 sm:h-9 inline-flex items-center justify-center rounded text-[var(--color-ink-muted)] hover:text-[var(--color-terracotta)] hover:bg-[var(--color-paper-deep)]/60 dark:hover:bg-[var(--color-night)]/50 transition-colors","aria-label":"Edit excluded company",title:"Edit",children:e.jsx(ee,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>ie(a.id),className:"w-10 h-10 sm:w-9 sm:h-9 inline-flex items-center justify-center rounded text-[var(--color-ink-faint)] hover:text-[var(--color-terracotta)] hover:bg-[var(--color-paper-deep)]/60 dark:hover:bg-[var(--color-night)]/50 transition-colors","aria-label":"Remove from excluded list",title:"Remove",children:e.jsx(ae,{className:"w-4 h-4"})})]})]},a.id))})]}),C&&e.jsxs("div",{id:"ws-suggest",className:"group rounded-xl border border-[var(--color-rule)] dark:border-[var(--color-night-rule)] p-5 transition-colors hover:border-[var(--color-terracotta)]/40",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-1",children:[e.jsxs("h3",{className:"font-display text-[1.2rem] 
1sm:text-[1.3rem] leading-[1.15] tracking-[-0.015em] text-[var(--color-ink)] dark:text-[var(--color-moon)] flex items-center gap-2",children:[e.jsx(je,{className:"w-4 h-4 text-[var(--color-ink-muted)] transition-all duration-300 group-hover:rotate-90 group-hover:scale-110 group-hover:text-[var(--color-terracotta)]"}),"Suggest a role"]}),e.jsx(c,{size:"sm",onClick:()=>j(!0),"data-testid":"add-job-btn",children:"Add"})]}),e.jsx("p",{className:"ts-body-sm text-[var(--color-ink-muted)] dark:text-[var(--color-moon-soft)] mb-4",children:"Found a role you want? Add the title, company, and description (a link helps too) and the Ezy·it team will review it on the next round."}),z.length===0?e.jsx("p",{className:"ts-caption text-[var(--color-ink-faint)] dark:text-[var(--color-moon-soft)]",children:"Nothing suggested yet."}):e.jsx("ul",{className:"space-y-3",children:z.map(a=>e.jsxs("li",{className:"ts-body-sm flex items-start justify-between gap-3 pb-3 border-b border-[var(--color-rule-soft)] dark:border-[var(--color-night-rule)] last:border-0 last:pb-0",children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0 flex-1",children:[e.jsx("span",{className:"font-semibold text-[var(--color-ink)] dark:text-[var(--color-moon)]",children:a.title}),e.jsxs("span",{className:"ts-caption text-[var(--color-ink-muted)] dark:text-[var(--color-moon-soft)]",children:[a.company,a.location?` · ${a.location}`:""," · added ",new Date(a.created_at).toLocaleDateString()]}),a.url&&e.jsx("a",{href:a.url,target:"_blank",rel:"noreferrer",className:"ts-caption text-[var(--color-terracotta)] underline underline-offset-2 mt-0.5",children:"Open posting"})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-1 shrink-0",children:[e.jsx("button",{onClick:()=>he(a),className:"w-10 h-10 sm:w-9 sm:h-9 inline-flex items-center justify-center rounded text-[var(--color-ink-muted)] hover:text-[var(--color-terracotta)] hover:bg-[var(--color-paper-deep)]/60 dark:hover:bg-[var(--color-night)]/50 transition-colors","aria-label":"Edit suggested role",title:"Edit",children:e.jsx(ee,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>ge(a.id),className:"w-10 h-10 sm:w-9 sm:h-9 inline-flex items-center justify-center rounded text-[var(--color-ink-faint)] hover:text-[var(--color-terracotta)] hover:bg-[var(--color-paper-deep)]/60 dark:hover:bg-[var(--color-night)]/50 transition-colors","aria-label":"Remove suggested role",title:"Remove",children:e.jsx(ae,{className:"w-4 h-4"})})]})]},a.id))})]})]}),e.jsx(N,{open:se,onClose:()=>b(!1),title:"Pause applications",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(n,{label:"Pause for how many days?",children:e.jsx(i,{type:"number",value:Y,onChange:a=>re(a.target.value)})}),e.jsx(n,{label:"Reason (optional)",hint:"Only visible to your admin",children:e.jsx(U,{value:H,onChange:a=>oe(a.target.value),rows:2})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(c,{variant:"ghost",onClick:()=>b(!1),children:"Cancel"}),e.jsx(c,{onClick:ue,children:"Pause"})]})]})}),e.jsx(N,{open:le,onClose:()=>j(!1),title:"Suggest a role",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(n,{label:"Job title *",children:e.jsx(i,{value:r.title,onChange:a=>p({...r,title:a.target.value})})}),e.jsx(n,{label:"Company *",children:e.jsx(i,{value:r.company,onChange:a=>p({...r,company:a.target.value})})}),e.jsx(n,{label:"Location",children:e.jsx(i,{value:r.location,onChange:a=>p({...r,location:a.target.value})})}),e.jsx(n,{label:"URL",children:e.jsx(i,{type:"url",inputMode:"url",value:r.url,onChange:a=>p({...r,url:a.target.value}),placeholder:"https://…"})}),e.jsx(n,{label:"Job description *",hint:"Paste the full posting, the admin uses this to tailor your resume. Required.",children:e.jsx(U,{rows:6,value:r.description,onChange:a=>p({...r,description:a.target.value}),placeholder:"Paste the full job description here…"})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(c,{variant:"ghost",onClick:()=>j(!1),children:"Cancel"}),e.jsx(c,{onClick:pe,children:"Add"})]})]})}),e.jsx(N,{open:!!F,onClose:()=>y(null),title:"Edit excluded company",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(n,{label:"Company name *",children:e.jsx(i,{value:u.companyName,onChange:a=>E({...u,companyName:a.target.value})})}),e.jsx(n,{label:"Reason (optional)",children:e.jsx(i,{value:u.reason,onChange:a=>E({...u,reason:a.target.value}),placeholder:"Why skip this company?"})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(c,{variant:"ghost",onClick:()=>y(null),disabled:R,children:"Cancel"}),e.jsx(c,{onClick:de,disabled:R,children:R?e.jsx(M,{className:"w-4 h-4 animate-spin"}):"Save"})]})]})}),e.jsx(N,{open:!!J,onClose:()=>w(null),title:"Edit suggested role",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(n,{label:"Job title *",children:e.jsx(i,{value:l.title,onChange:a=>h({...l,title:a.target.value})})}),e.jsx(n,{label:"Company *",children:e.jsx(i,{value:l.company,onChange:a=>h({...l,company:a.target.value})})}),e.jsx(n,{label:"Location",children:e.jsx(i,{value:l.location,onChange:a=>h({...l,location:a.target.value})})}),e.jsx(n,{label:"URL",children:e.jsx(i,{value:l.url,onChange:a=>h({...l,url:a.target.value}),placeholder:"https://…"})}),e.jsx(n,{label:"Job description *",hint:"Paste the full posting, the admin uses this to tailor your resume. Required.",children:e.jsx(U,{rows:6,value:l.description,onChange:a=>h({...l,description:a.target.value}),placeholder:"Paste the full job description here…"})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(c,{variant:"ghost",onClick:()=>w(null),disabled:D,children:"Cancel"}),e.jsx(c,{onClick:xe,disabled:D,children:D?e.jsx(M,{className:"w-4 h-4 animate-spin"}):"Save"})]})]})})]})}export{Ee as default};
2//# sourceMappingURL=Workspace-ZF-DI3Js.js.map

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