PageSourceSearch

https://app.benefitly.ai/assets/BrokerPlanDetailPage-C_mvejF-.js

js benefitly.ai collected 2026-10-05 14:31:42 UTC 7,683 bytes, 1 lines download raw bytes

1import{Y as M,a3 as T,r as k,a4 as U,a5 as A,t as F,j as e,L as S,M as O,$ as V,a as _}from"./index-CFYEvtKP.js";import{u as H,C as J}from"./CategoryMismatchBadge-D6ttpMlw.js";import{u as Y}from"./useBrokerClients-C2D8zc0n.js";import{P as z}from"./PlanProcessingBadge-B5b7A-qh.js";const h=["Parse PDF","Hydrate","Navigator","Exec summary","Embeddings","Complete"];function X(){var w,P;const{planId:r}=M(),{plans:n}=T(),s=n.find(t=>t.planId===r),i=(s==null?void 0:s.name)??"Plan",{review:d,isSubmitting:l,error:c,disposition:j}=H(r??"",s==null?void 0:s.categoryReview),{clients:I,refetch:R}=Y(),x=I.filter(t=>t.planId===r),[$,y]=k.useState(!1),u=(s==null?void 0:s.navigatorExtractionStatus)==="success"||(s==null?void 0:s.navigatorExtractionStatus)==="partial",p=(s==null?void 0:s.navigatorExtractionStatus)==="failed",D=p?0:u?h.length:1,{url:g,isLoading:B}=U(r),{data:f}=A(r),a=f==null?void 0:f.quickAccess,N=F(),[v,C]=k.useState(!1),L=async()=>{if(!(!(s!=null&&s.sponsorId)||!r)){C(!0);try{await _.request(`/broker/sponsors/${encodeURIComponent(s.sponsorId)}/plans/${encodeURIComponent(r)}/reprocess`,{method:"POST"}),N.success("Reprocessing started — extraction status will update shortly.")}catch{N.error("Could not start reprocessing. Please try again.")}finally{C(!1)}}};return e.jsxs("div",{"data-testid":"broker-plan-detail",children:[e.jsxs("nav",{className:"mb-3 text-sm text-foreground-muted",children:[e.jsx(S,{to:"/brokers/plans",className:"hover:text-foreground",children:"Plans"})," ","/ ",e.jsx("span",{className:"text-foreground",children:i})]}),e.jsxs("header",{className:"mb-6 flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h1",{"data-testid":"broker-plan-detail-title",className:"font-serif text-3xl text-foreground",children:i}),e.jsx(z,{status:s==null?void 0:s.navigatorExtractionStatus})]}),O("showCategoryMismatchBanner")&&d==="flagged"&&(s==null?void 0:s.category)!==void 0&&(s==null?void 0:s.detectedCategory)!==void 0&&e.jsx("div",{className:"mt-2",children:e.jsx(J,{category:s.category,detectedCategory:s.detectedCategory,isSubmitting:l,error:c,onConfirm:()=>void j({action:"confirm"}),onChange:t=>void j({action:"change",category:t})})}),e.jsxs("p",{className:"mt-1 text-foreground-muted",children:[(s==null?void 0:s.sponsorName)??"—"," · ",(s==null?void 0:s.clientCount)??x.length," clients"]})]}),e.jsxs("div",{className:"flex shrink-0 gap-2",children:[e.jsx("button",{type:"button","data-testid":"broker-plan-view-doc",onClick:()=>g&&window.open(g,"_blank","noopener,noreferrer"),disabled:!g||B,className:"rounded-lg bg-primary px-4 py-2 text-sm text-primary-foreground hover:opacity-90 transition-opacity disabled:opacity-40",children:"View document"}),e.jsx("button",{type:"button","data-testid":"broker-plan-reprocess",onClick:()=>void L(),disabled:v||!(s!=null&&s.sponsorId),className:"rounded-lg border border-border px-4 py-2 text-sm text-foreground hover:border-primary transition-colors disabled:opacity-40",children:v?"Reprocessing…":"Reprocess"})]})]}),e.jsxs("div",{"data-testid":"broker-plan-pipeline",className:"mb-8 rounded-xl border border-border bg-surface p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-foreground",children:"Extraction pipeline"}),e.jsx("p",{"data-testid":"broker-plan-pipeline-status",className:"text-sm text-foreground-muted",children:p?"Extraction failed — reprocess to retry.":u?"Parsed — sections + embeddings ready.":"Processing…"})]}),u&&e.jsx("span",{className:"rounded-full bg-success/15 px-2.5 py-1 text-xs text-success",children:"Embeddings ready"})]}),e.jsx("ol",{"data-testid":"broker-plan-pipeline-steps",className:"flex flex-wrap items-center gap-x-2 gap-y-3",children:h.map((t,o)=>{const b=o<D;return e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`flex h-5 w-5 items-center justify-center rounded-full text-[10px] ${b?"bg-success text-success-foreground":p&&o===0?"bg-destructive text-destructive-foreground":"bg-surface-muted text-foreground-muted"}`,children:b?"✓":o+1}),e.jsx("span",{className:`text-sm ${b?"text-foreground":"text-foreground-muted"}`,children:t}),o<h.length-1&&e.jsx("span",{className:"mx-1 h-px w-6 bg-border"})]},t)})})]}),e.jsxs("div",{className:"mb-8 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(m,{label:"Deductible",value:E(a==null?void 0:a.deductible),sub:"individual · family"}),e.jsx(m,{label:"Out-of-pocket max",value:E(a==null?void 0:a.oopMax),sub:"individual · family"}),e.jsx(m,{label:"Coinsurance",value:"—",sub:"in-network"}),e.jsx(m,{label:"PCP copay",value:((P=(w=a==null?void 0:a.pcpCopay)==null?void 0:w.tier1)==null?void 0:P.displayValue)??"—",sub:"primary care"})]}),e.jsxs("div",{"data-testid":"broker-plan-clients-section",className:"mb-3 flex items-center justify-between",children:[e.jsxs("h2",{className:"font-serif text-xl text-foreground",children:["Clients on this plan"," ",e.jsxs("span",{className:"ml-1 text-sm font-normal text-foreground-muted",children:[x.length," clients"]})]}),e.jsx("button",{type:"button","data-testid":"broker-plan-invite-clients",onClick:()=>y(!0),className:"rounded-lg border border-border px-3 py-1.5 text-sm text-foreground hover:border-primary transition-colors",children:"+ Invite clients"})]}),$&&(s==null?void 0:s.sponsorId)&&e.jsx(V,{presetSponsorId:s.sponsorId,onClose:()=>y(!1),onCreated:R}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-surface",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-left text-xs uppercase tracking-wide text-foreground-muted",children:[e.jsx("th",{className:"px-5 py-3 font-medium",children:"Client"}),e.jsx("th",{className:"px-3 py-3 font-medium",children:"Status"}),e.jsx("th",{className:"px-5 py-3 font-medium text-right",children:"Joined"})]})}),e.jsxs("tbody",{children:[x.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:3,className:"px-5 py-6 text-sm text-foreground-muted",children:"No clients on this plan yet."})}),x.map(t=>{const o=new Date(t.joinedAt);return e.jsxs("tr",{className:"border-b border-border last:border-0",children:[e.jsxs("td",{className:"px-5 py-4",children:[e.jsx(S,{to:`/brokers/clients/${t.id}`,className:"font-medium text-foreground hover:underline",children:t.name??t.email??"Unnamed client"}),t.name&&t.email&&e.jsx("div",{className:"text-xs text-foreground-muted",children:t.email})]}),e.jsx("td",{className:"px-3 py-4",children:e.jsx("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs ${t.status==="pending"?"bg-warning/15 text-warning":"bg-success/15 text-success"}`,children:t.status==="pending"?"Pending":"Active"})}),e.jsx("td",{className:"px-5 py-4 text-right text-foreground-muted",children:Number.isNaN(o.getTime())?"—":o.toLocaleDateString()})]},t.id)})]})]})})]})}function E(r){var i,d,l,c;const n=(d=(i=r==null?void 0:r.tier1)==null?void 0:i.individual)==null?void 0:d.trim(),s=(c=(l=r==null?void 0:r.tier1)==null?void 0:l.family)==null?void 0:c.trim();return!n&&!s?"—":`${n||"—"} / ${s||"—"}`}function m({label:r,value:n,sub:s}){return e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-5",children:[e.jsx("div",{className:"text-sm text-foreground-muted",children:r}),e.jsx("div",{className:"mt-2 font-serif text-2xl text-foreground",children:n}),e.jsx("p",{className:"mt-1 text-xs text-foreground-muted",children:s})]})}export{X as BrokerPlanDetailPage,X 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.