PageSourceSearch

https://revby.co/_nuxt/Diqg8BTs.js

js revby.co collected 2026-10-03 21:02:34 UTC 39,804 bytes, 3 lines download raw bytes

1import{_ as Ae,u as Ue}from"./BHVOOCG5.js";import{_ as fe}from"./BqpT7-Em.js";import{Q as Y,e as _e,g as B,c as a,a as e,j,F as N,r as L,k as t,t as v,o as n,d as R,n as z,b as l,N as H,w as M,s as $,_ as ve,B as ge,m as te,q as Te,z as G,i as we,X as pe,a2 as ze,a6 as K,Z as he,a0 as be,h as ke,a7 as re,A as Ne}from"./DbfHA8MV.js";import{_ as $e}from"./Csc4NbIj.js";import{t as ee,f as ye,l as Se,a as me,d as Ie,b as Me,c as je,e as Le,g as Ee,h as Be,i as Ve}from"./Cttm96qS.js";import{_ as He}from"./DlAUqK2U.js";import{_ as qe}from"./C9Niw-P9.js";import{_ as We}from"./B6x3R7Wg.js";import{_ as Qe}from"./wqLag8B5.js";import{_ as Ke}from"./ylP3mNTH.js";import{_ as Ge}from"./Hs3FbryR.js";import{u as De}from"./M6IrOpCE.js";import"./BAMDYEQl.js";import"./BskQ2YPd.js";import"./fH7ddL5S.js";import"./DlolBEDk.js";import"./DvO3trJ3.js";import"./q0bCqwrh.js";import"./DLIKFUPq.js";import"./L2V1ucyS.js";import"./BRtod-ZM.js";const Ye={"aria-labelledby":"rfp-deadline-calendar-heading"},Ze={class:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between"},Je={class:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-neutral-600","aria-label":"Workflow stage legend"},Xe={key:0,class:"grid grid-cols-2 gap-2 sm:grid-cols-5"},et={key:1,class:"rounded-xl border border-error-200 bg-error-50 px-4 py-6 text-sm text-error-700"},tt={key:2,class:"overflow-x-auto pb-2"},st={class:"grid min-w-[60rem] grid-cols-5 gap-2"},nt={class:"mb-2 border-b border-neutral-100 pb-2"},lt={class:"text-sm font-semibold text-neutral-950"},ot={key:0,class:"space-y-2"},at=["datetime"],it={class:"mt-0.5 line-clamp-2 text-xs font-semibold text-neutral-950"},rt={class:"mt-1 line-clamp-2 text-[11px] leading-snug text-neutral-600"},dt={key:1,class:"py-4 text-center text-xs text-neutral-400"},ut={key:3,class:"mt-3 text-sm text-neutral-500"},de=5,ct=Y({__name:"DeadlineCalendar",props:{events:{},pending:{type:Boolean},error:{}},setup(p){const _=p,m=B(null),h={"need-human-review":{eventClass:"border-amber-400 bg-amber-50 hover:bg-amber-100/70"},"needs-michael-approval":{eventClass:"border-sky-400 bg-sky-50 hover:bg-sky-100/70"},"response-in-progress":{eventClass:"border-emerald-400 bg-emerald-50 hover:bg-emerald-100/70"},"hubspot-default-pipeline":{eventClass:"border-violet-400 bg-violet-50 hover:bg-violet-100/70"}},C=[{key:"need-human-review",label:"Needs review",dotClass:"bg-amber-400"},{key:"needs-michael-approval",label:"Needs Go / No Go",dotClass:"bg-sky-400"},{key:"response-in-progress",label:"Move to HubSpot",dotClass:"bg-emerald-400"},{key:"hubspot-default-pipeline",label:"RFP In Progress",dotClass:"bg-violet-400"}],y=b=>[b.getFullYear(),String(b.getMonth()+1).padStart(2,"0"),String(b.getDate()).padStart(2,"0")].join("-"),c=$(()=>{if(!m.value)return[];const b=new Date(m.value);b.setHours(0,0,0,0);const D=new Date(b);D.setDate(D.getDate()+de);const T=new Map;for(const A of _.events){const g=Date.parse(A.timestamp);if(!Number.isFinite(g)||g<m.value.getTime()||g>=D.getTime())continue;const f=new Date(g),u=y(f),o=T.get(u)||[];o.push(A),T.set(u,o)}return Array.from({length:de},(A,g)=>{const f=new Date(b);f.setDate(b.getDate()+g);const u=y(f),o=T.get(u)||[];return o.sort((U,k)=>Date.parse(U.timestamp)-Date.parse(k.timestamp)),{key:u,weekday:f.toLocaleDateString(void 0,{weekday:"short"}),dateLabel:f.toLocaleDateString(void 0,{month:"short",day:"numeric"}),isToday:g===0,events:o}})}),w=$(()=>c.value.reduce((b,D)=>b+D.events.length,0)),S=b=>new Date(b).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),P=b=>{const D=b.timezone?`
2Source timezone: ${b.timezone}`:"";return`${b.opportunityTitle}
3${b.snippet}${D}`};return _e(()=>{m.value=new Date}),(b,D)=>{const T=fe,A=ve;return n(),a("section",Ye,[e("div",Ze,[D[0]||(D[0]=e("div",null,[e("h2",{id:"rfp-deadline-calendar-heading",class:"text-xl font-semibold text-neutral-950"}," Upcoming deadlines ")],-1)),e("div",Je,[(n(),a(N,null,L(C,g=>e("span",{key:g.key,class:"inline-flex items-center gap-1.5"},[e("span",{class:z(["size-2.5 rounded-full",g.dotClass])},null,2),R(" "+v(g.label),1)])),64))])]),p.pending||!t(m)?(n(),a("div",Xe,[(n(),a(N,null,L(de,g=>e("div",{key:g,class:"min-h-40 rounded-xl border border-neutral-200 p-3"},[l(T,{class:"h-4 w-20"}),l(T,{class:"mt-4 h-14 w-full rounded-lg"}
3)])),64))])):p.error?(n(),a("div",et," Failed to load upcoming deadlines. "+v(p.error.statusMessage||p.error.message||"Request failed."),1)):(n(),a("div",tt,[e("div",st,[(n(!0),a(N,null,L(t(c),g=>(n(),a("article",{key:g.key,class:z(["min-h-44 rounded-xl border bg-white p-2.5",g.isToday?"border-brand/40 ring-1 ring-brand/10":"border-neutral-200"])},[e("header",nt,[e("p",{class:z(["text-[11px] font-medium uppercase tracking-wider",g.isToday?"text-brand":"text-neutral-500"])},v(g.isToday?"Today":g.weekday),3),e("p",lt,v(g.dateLabel),1)]),g.events.length?(n(),a("div",ot,[(n(!0),a(N,null,L(g.events,f=>(n(),H(A,{key:`${f.opportunityId}-${f.timestamp}-${f.title}`,to:`/admin/rfp/opportunities/${f.opportunityId}`,class:z(["block rounded-lg border-l-4 px-2.5 py-2 transition hover:-translate-y-0.5 hover:shadow-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand",h[f.stage].eventClass]),title:P(f)},{default:M(()=>[e("time",{datetime:f.timestamp,class:"block text-[11px] font-semibold tabular-nums"},v(S(f.timestamp)),9,at),e("p",it,v(f.title),1),e("p",rt,v(f.opportunityTitle),1)]),_:2},1032,["to","class","title"]))),128))])):(n(),a("p",dt,"No deadlines"))],2))),128))])])),t(m)&&!p.pending&&!p.error&&t(w)===0?(n(),a("p",ut," No extracted deadlines fall within this 5-day window. ")):j("",!0)])}}}),pt={class:"bg-white"},mt={class:"mb-6 space-y-3"},ft={class:"flex items-end justify-between gap-3"},vt={class:"flex flex-wrap items-center gap-2 text-sm font-medium text-neutral-700"},xt={key:0,class:"inline-flex items-center gap-1.5 rounded-full border border-neutral-200 bg-gradient-to-r from-white to-neutral-50 px-3 py-1 text-xs font-medium text-neutral-500 shadow-sm"},gt={class:"grid min-w-[1600px] grid-cols-5 gap-4"},ht={class:"mb-4"},bt={class:"mt-2 flex items-center gap-2 text-xs text-neutral-500"},yt={class:"space-y-3"},_t={class:"mt-3 flex items-center justify-between gap-3"},wt={key:1,class:"py-8 text-sm text-error-600"},kt={class:"grid min-w-[1600px] grid-cols-5 gap-4"},$t={class:"mb-4"},St={class:"flex flex-row justify-between"},Dt={key:0,class:"space-y-3"},Ct={class:"line-clamp-2 text-sm font-semibold text-neutral-950"},Ot={class:"mt-1 text-xs italic text-neutral-500"},Pt={class:"mt-3 flex items-center justify-between gap-3"},Ft={key:0,class:"inline-flex rounded-full bg-red-100 px-2.5 py-1 text-[11px] font-medium text-red-700 items-center"},Rt={class:"inline-flex items-center gap-2 shrink-0"},At={class:"relative flex h-4 w-4 items-center justify-center"},Ut={key:1,class:"space-y-3"},Tt={key:1,class:"line-clamp-2 text-sm font-semibold text-neutral-950"},zt={class:"mt-2 flex items-center justify-between gap-3"},Nt={class:"text-xs italic text-neutral-500"},It={class:"inline-flex items-center gap-2 shrink-0"},Mt={class:"relative flex h-4 w-4 items-center justify-center"},jt={class:"rounded-md border border-neutral-200 px-2 py-0.5 text-sm tabular-nums text-neutral-700"},Lt={class:"mt-2 text-xs text-neutral-500"},Et={key:2,class:"mt-3 rounded-lg bg-neutral-50 px-2.5 py-2"},Bt={key:0,class:"space-y-1.5"},Vt={class:"flex items-center justify-between gap-3 text-[11px] font-medium text-neutral-600"},Ht={class:"tabular-nums"},qt=["aria-label","aria-valuenow","aria-valuemax"],Wt={key:1,class:"text-[11px] text-neutral-500"},Qt={class:"mt-3 flex items-center justify-between gap-3"},Kt={key:0,class:"inline-flex rounded-full bg-red-100 px-2.5 py-1 text-[11px] font-medium text-red-700 items-center"},Gt={class:"inline-flex items-center gap-3"},Yt={key:2,class:"flex min-h-[6rem] items-center justify-center rounded-2xl border border-dashed border-neutral-300 bg-transparent px-4 text-center text-sm text-neutral-500"},Zt={class:"mt-auto pt-3 text-xs leading-relaxed text-neutral-500"},Jt=7*24*60*60*1e3,Xt=15*24*60*60*1e3,es=Y({__name:"WorkflowBoard",props:{workflow:{},pending:{type:Boolean},error:{},isRefreshing:{type:Boolean}},emits:["refresh"],setup(p){const _=p,m=new Date;m.setHours(0,0,0,0);const h=B(null),C=B(!1),y=B("__all__");let c=null;const w=$(()=>{var u;return[{label:"All deal owners",value:"__all__"},...((u=_.workflow)==null?void 0:u.hubspotDealOwnerOptions)||[]]}),S=()=>{const u=h.value;if(!u){C.value=!1;return}const o=u.scrollWidth-u.clientWidth-u.scrollLeft;C.value=o>24},P=u=>{if(!Number.isFinite(u))return"—";const o=u/1e3;return`$${o>=100?Math.round(o).toString():o.toFixed(o>=10?0:1).replace(/\.0$/,"")}k`},b=u=>{if(!u)return"text-neutral-500";const o=new Date(u);if(Number.isNaN(o.getTime()))return"text-neutral-500";const U=o.getTime()-m.getTime();return U<=Jt?"text-red-600":U<Xt?"text-orange-600":"text-neutral-500"},D=u=>{if(!u)return!1;const o=new Date(u);return Number.isNaN(o.getTime())?!1:o.getTime()<m.getTime()},T=u=>
3b(u),A=$(()=>{var o,U,k,s,d;if(!_.pending)return!1;const u=_.workflow||{};return!((o=u.needHumanReview)!=null&&o.length)&&!((U=u.needsMichaelApproval)!=null&&U.length)&&!((k=u.responseInProgress)!=null&&k.length)&&!((s=u.hubspotDefaultPipelineDeals)!=null&&s.length)&&!((d=u.hubspotProposalBidSubmittedDeals)!=null&&d.length)}),g=u=>y.value==="__all__"?u:u.filter(o=>o.ownerId===y.value),f=$(()=>{const u=_.workflow||{};return[{key:"need-human-review",kind:"rfp",title:"Needs review",description:"RFP scores 70+, has no admin status, and is not marked with a rejected review status",columnClass:"border-amber-200 bg-amber-50/70",headingClass:"text-amber-900",subheadingClass:"text-amber-700",items:u.needHumanReview||[]},{key:"needs-michael-approval",kind:"rfp",title:"Needs Go / No Go",description:'RFP admin status is set to "in review with Michael"',columnClass:"border-sky-200 bg-sky-50/70",headingClass:"text-sky-900",subheadingClass:"text-sky-700",items:u.needsMichaelApproval||[]},{key:"response-in-progress",kind:"rfp",title:"Move to HubSpot",description:"RFP admin status is set to responding and no HubSpot deal has been linked yet",columnClass:"border-emerald-200 bg-emerald-50/70",headingClass:"text-emerald-900",subheadingClass:"text-emerald-700",items:u.responseInProgress||[]},{key:"hubspot-default-pipeline",kind:"hubspot",title:"RFP In Progress",description:"Shows HubSpot deals in EDO pipeline with status: Qualified lead, Discovery / Scope Requested, or Negotiation active.",columnClass:"border-violet-200 bg-violet-50/80",headingClass:"text-violet-900",subheadingClass:"text-violet-700",items:g(u.hubspotDefaultPipelineDeals||[])},{key:"hubspot-proposal-bid-submitted",kind:"hubspot",title:"RFP submitted",description:"Shows HubSpot deals in the EDO/ESO pipeline with status: Proposal/Bid Subitted or Proposal/Bid Submitted.",columnClass:"border-fuchsia-200 bg-fuchsia-50/80",headingClass:"text-fuchsia-900",subheadingClass:"text-fuchsia-700",items:g(u.hubspotProposalBidSubmittedDeals||[])}]});return _e(async()=>{await ge(),S(),typeof ResizeObserver<"u"&&(c=new ResizeObserver(()=>{S()}),h.value&&c.observe(h.value)),window.addEventListener("resize",S)}),te(()=>[_.pending,_.error,f.value.length,...f.value.map(u=>u.items.length)],async()=>{await ge(),c&&(c.disconnect(),h.value&&c.observe(h.value)),S()}),Te(()=>{c==null||c.disconnect(),c=null,window.removeEventListener("resize",S)}),(u,o)=>{const U=$e,k=we,s=fe,d=ve;return n(),a("section",pt,[e("div",mt,[o[5]||(o[5]=e("div",null,[e("h3",{class:"text-xl font-semibold text-neutral-950"},"RFP Workflow")],-1)),e("div",ft,[e("label",vt,[o[3]||(o[3]=e("span",null,"Show HubSpot deals from:",-1)),l(U,{modelValue:t(y),"onUpdate:modelValue":o[0]||(o[0]=x=>G(y)?y.value=x:null),items:t(w),"option-attribute":"label","value-attribute":"value",class:"w-40",disabled:t(w).length<=1},null,8,["modelValue","items","disabled"])]),t(C)?(n(),a("div",xt,[o[4]||(o[4]=e("span",null,"scroll for more",-1)),l(k,{name:"i-lucide-arrow-right",class:"size-3.5 animate-[wiggle-right_1.4s_ease-in-out_infinite]"})])):j("",!0)])]),t(A)?(n(),a("div",{key:0,ref_key:"workflowScrollContainer",ref:h,class:"overflow-x-auto",onScroll:S},[e("div",gt,[(n(!0),a(N,null,L(t(f),x=>(n(),a("div",{key:`${x.key}-skeleton`,class:z(["rounded-2xl border p-4 shadow-sm",x.columnClass])},[e("div",ht,[e("h4",{class:z(["text-sm font-semibold uppercase tracking-[0.2em]",x.headingClass])},v(x.title),3),e("div",bt,[l(k,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),o[6]||(o[6]=e("span",null,"Loading opportunities...",-1))])]),e("div",yt,[(n(),a(N,null,L(3,i=>e("div",{key:`${x.key}-placeholder-${i}`,class:"rounded-2xl border border-white/80 bg-white p-4 shadow-sm"},[l(s,{class:"h-4 w-full"}),l(s,{class:"mt-2 h-3 w-2/3"}),e("div",_t,[l(s,{class:"h-3 w-24"}),l(s,{class:"h-6 w-14 rounded-md"})])])),64))])],2))),128))])],544)):p.error?(n(),a("div",wt," Failed to load workflow. "+v(p.error.statusMessage||p.error.message||"Request failed."),1)):(n(),a("div",{key:2,ref_key:"workflowScrollContainer",ref:h,class:"overflow-x-auto",onScroll:S},[e("div",kt,[(n(!0),a(N,null,L(t(f),x=>(n(),a("div",{key:x.key,class:z(["flex h-full flex-col rounded-2xl border p-4 shadow-sm",x.columnClass])},[e("div",$t,[e("div",St,[e("h4",{class:z(["text-sm font-semibold uppercase tracking-[0.2em]",x.headingClass])},v(x.title),3),x.kind==="hubspot"?(n(),a("p",{key:0,class:z(["text-right text-xs",x.subheadingClass])}," HubSpot ",2)):j("",!0)]),e("div",{class:z(["mt-1 flex items-center justify-between gap-3 text-xs",x.subheadingClass])},[e("p",null,v(x.items.length)+" "+v(x.items.length===1?"opportunity":"opportunities"),1)],2)]),x.items.length&&x.kind==="rfp"?(n(),a("div",Dt,[(n(!0),a(N,null,L(x.items,i=>{var V;return n(),a("div",{key:i.id,class:"group relative block rounded-2xl border border-white/80 bg-white p-3.5 shadow-sm transition hover:-translate-y-0.5 hover:border-brand/30 hover:shadow-md"},[l(d,{to:`/admin/rfp/opportunities/${i.id}`,class:"absolute inset-0 rounded-2xl","aria-label":`Open ${t(ee)(i.title,100)}`},null,8,["to","aria-label"]),e("p",Ct,v(t(ee)(i.title,100)),1),e("p",Ot,v(((V=i.source)==null?void 0:V.name)||"Unknown source"),1),e("div",Pt,[D(i.due_at)?(n(),a("span",Ft,[l(k,{name:"i-lucide-clock",class:"ms-0 me-1"}),o[7]||(o[7]=R(" Expired ",-1))])):(n(),a("p",{key:1,class:z(["inline-flex items-center text-xs",T(i.due_at)])},[i.due_at?(n(),a(N,{key:0},[l(k,{name:"i-lucide-alarm-clock-check",class:"me-1 size-4"}),o[8]||(o[8]=R("Due: ",-1))],64)):j("",!0),R(v(t(ye)(i.due_at||i.first_seen_at)),1)],2)),e("div",Rt,[i.hasRfpDocument?(n(),H(d,{key:0,to:`/admin/rfp/opportunities/${i.id}#uploaded-rfp-section`,onClick:o[1]||(o[1]=pe(()=>{},["stop"])),class:"inline-flex h-6 w-6 items-center justify-center text-emerald-500",title:"RFP document uploaded","aria-label":"RFP document uploaded"},{default:M(()=>[e("span",At,[l(k,{name:"i-lucide-file-text",class:"size-4"}),l(k,{name:"i-lucide-check",class:"absolute -bottom-0.5 -right-1 size-2.5 rounded-full bg-emerald-50"})])]),_:1},8,["to"])):j("",!0),e("span",{class:z(["relative inline-flex min-w-[3.5rem] items-center justify-center rounded-md px-2 py-1 text-xs font-medium tabular-nums",t(Se)(i.llm_score)])},v(t(me)(i.llm_score)),3)])])])}),128))])):x.items.length&&x.kind==="hubspot"?(n(),a("div",Ut,[(n(!0),a(N,null,L(x.items,i=>(n(),a("div",{key:i.id,class:"block rounded-2xl border border-white/80 bg-white p-3.5 shadow-sm transition hover:-translate-y-0.5 hover:border-brand/30 hover:shadow-md"},[i.hubspotUrl?(n(),H(d,{key:0,to:i.hubspotUrl,target:"_blank",class:"line-clamp-2 text-sm font-semibold text-neutral-950"},{default:M(()=>[R(v(t(ee)(i.title,100)),1)]),_:2},1032,["to"])):(n(),a("p",Tt,v(t(ee)(i.title,100)),1)),e("div",zt,[e("span",Nt,v(i.status||"Unknown stage"),1),e("div",It,[i.hasRfpDocument?(n(),H(d,{key:0,to:i.revbyUrl?`${i.revbyUrl}#uploaded-rfp-section`:void 0,onClick:o[2]||(o[2]=pe(()=>{},["stop"])),class:"inline-flex h-6 w-6 items-center justify-center text-emerald-500",title:"RFP document uploaded","aria-label":"RFP document uploaded"},{default:M(()=>[e("span",Mt,[l(k,{name:"i-lucide-file-text",class:"size-4"}),l(k,{name:"i-lucide-check",class:"absolute -bottom-0.5 -right-1 size-2.5 rounded-full bg-emerald-50"})])]),_:1},8,["to"])):j("",!0),e("span",jt,v(P(i.amount)),1)])]),e("p",Lt,v(i.ownerName||"Unassigned owner"),1),x.key==="hubspot-default-pipeline"&&i.taskProgress&&(i.taskProgress.state==="unavailable"||i.taskProgress.totalCount>0)?(n(),a("div",Et,[i.taskProgress.state==="ready"?(n(),a("div",Bt,[e("div",Vt,[o[9]||(o[9]=e("span",null,"Tasks",-1)),e("span",Ht,v
3(i.taskProgress.completedCount)+" / "+v(i.taskProgress.totalCount),1)]),e("div",{class:"h-1.5 overflow-hidden rounded-full bg-neutral-200",role:"progressbar","aria-label":`Task progress for ${i.title}`,"aria-valuenow":i.taskProgress.completedCount,"aria-valuemin":"0","aria-valuemax":i.taskProgress.totalCount},[e("div",{class:z(["h-full rounded-full transition-[width] duration-500",i.taskProgress.percent===100?"bg-emerald-500":"bg-sky-500"]),style:ze({width:`${i.taskProgress.percent}%`})},null,6)],8,qt)])):(n(),a("p",Wt," Task progress unavailable "))])):j("",!0),e("div",Qt,[D(i.closeDate)?(n(),a("span",Kt,[l(k,{name:"i-lucide-clock",class:"ms-0 me-1"}),o[10]||(o[10]=R(" Expired ",-1))])):(n(),a("p",{key:1,class:z(["inline-flex items-center text-xs",b(i.closeDate)])},[i.closeDate?(n(),H(k,{key:0,name:"i-lucide-clock",class:"me-1 size-3"})):j("",!0),R("Due: "+v(t(ye)(i.closeDate)),1)],2)),e("div",Gt,[i.revbyUrl?(n(),H(d,{key:0,to:i.revbyUrl,class:"text-xs font-medium text-brand hover:underline"},{default:M(()=>[...o[11]||(o[11]=[R(" Revby ",-1)])]),_:1},8,["to"])):j("",!0),i.hubspotUrl?(n(),H(d,{key:1,to:i.hubspotUrl,target:"_blank",class:"inline-flex items-center gap-1 text-xs font-medium text-purple-700 hover:underline"},{default:M(()=>[o[12]||(o[12]=e("span",null,"HubSpot",-1)),l(k,{name:"i-lucide-external-link",class:"size-3.5"})]),_:1},8,["to"])):j("",!0)])])]))),128))])):(n(),a("div",Yt," No opportunities in this column. ")),e("p",Zt,[o[13]||(o[13]=e("span",{class:"font-medium"},"Criteria:",-1)),R(" "+v(x.description),1)])],2))),128))])],544))])}}}),ts=He(es,[["__scopeId","data-v-a321e593"]]),ss=[{label:"All opportunities",value:"all"},{label:"Approved",value:"approved"},{label:"Rejected",value:"rejected"},{label:"Not yet rated",value:"not_yet_rated"},{label:"Not rated + Approved",value:"not_rated_plus_approved"}],ns=[{label:"All statuses",value:"all"},{label:"Responding + unset",value:"active"},{label:"Unset",value:"unset"},{label:"Responding",value:"responding"},{label:"In review with Michael",value:"in review with michael"},{label:"Not responding",value:"not responding"},{label:"Archived",value:"archived"}],ue=1,ce=20,ls=p=>{const _=K("admin-rfp-selected-review-filter",()=>"all"),m=K("admin-rfp-selected-admin-status-filter",()=>"all"),h=p||K("admin-rfp-opportunities-search-query",()=>""),C=K("admin-rfp-opportunities-page",()=>ue),y=K("admin-rfp-opportunities-sort-key",()=>"seen"),c=K("admin-rfp-opportunities-sort-direction",()=>"desc"),{data:w,error:S,pending:P,refresh:b}=De("/api/admin/rfp/opportunities",{key:"admin-rfp-opportunities",default:()=>({items:[],total:0,page:ue,pageSize:ce}),lazy:!0,server:!1,watch:[_,m,C,y,c],query:$(()=>({...h.value.trim()?{q:h.value.trim()}:{},page:C.value,pageSize:ce,reviewFilter:_.value,adminStatusFilter:m.value,sortKey:y.value,sortDirection:c.value}))},"$i-HAO4PvJf"),D=$(()=>{var f;return((f=w.value)==null?void 0:f.items)||[]}),T=$(()=>D.value),A=$(()=>{var f;return((f=w.value)==null?void 0:f.total)||0}),g=$(()=>{var f;return((f=w.value)==null?void 0:f.pageSize)||ce});return te([_,m,h],()=>{C.value=ue}),{opportunities:D,opportunitiesError:S,opportunitiesPending:P,refreshOpportunities:b,currentPage:C,pageSize:g,selectedReviewFilter:_,selectedAdminStatusFilter:m,searchQuery:h,sortKey:y,sortDirection:c,totalOpportunities:A,filteredOpportunities:T,reviewFilterOptions:ss,opportunityAdminStatusFilterOptions:ns}},os=({filteredOpportunities:p,totalOpportunities:_,currentOpportunityPage:m,opportunitiesPageSize:h,opportunitySortKey:C,opportunitySortDirection:y,selectedReviewFilter:c,selectedAdminStatusFilter:w,searchQuery:S,appliedSearchQuery:P,reviewFilterOptions:b,opportunityAdminStatusFilterOptions:D,clearOpportunitySearch:T})=>{const A=B(P.value),g=$(()=>{const d=_.value;return`${d} result${d===1?"":"s"}`}),f=$(()=>{var d;return((d=b.find(x=>x.value===c.value))==null?void 0:d.label)||"Review filter"}),u=$(()=>{var d;return((d=D.find(x=>x.value===w.value))==null?void 0:d.label)||"Status filter"}),o=$(()=>{const d=[];return P.value&&d.push({key:"search",label:`Searching for: "${P.value}"`,clear:T}),c.value!=="all"&&d.push({key:"review",label:`Review: ${f.value}`,clear:()=>{c.value="all"}}),w.value!=="all"&&d.push({key:"status",label:`Status: ${u.value}`,clear:()=>{w.value="all"}}),d}),U=$(()=>Math.max(1,Math.ceil(_.value/h.value))),k=$(()=>p.value);return te(U,d=>{m.value>d&&(m.value=d)}),te(S,()=>{A.value=S.value}),{activeOpportunityFilters:o,currentOpportunityPage:m,discoveryReasonItems:Ie,f
3ilteredOpportunityCountLabel:g,opportunitiesPageSize:h,paginatedOpportunities:k,searchInput:A,sortIcon:d=>C.value!==d?"i-lucide-arrow-up-down":y.value==="asc"?"i-lucide-arrow-up":"i-lucide-arrow-down",totalOpportunityPages:U}},as={class:"rounded-2xl border border-neutral-200 bg-white p-5 shadow-sm"},is={class:"mb-0 flex flex-col gap-4"},rs={class:"text-xl font-semibold text-neutral-950"},ds={key:0,class:"space-y-4"},us={class:"flex flex-col gap-4 md:flex-row md:items-end"},cs={class:"flex flex-col gap-1 md:max-w-xs"},ps={class:"flex flex-col gap-1 md:w-80 md:max-w-none"},ms={class:"flex flex-col gap-3 md:ml-auto md:min-w-[26rem] md:items-end"},fs={class:"flex w-full flex-col gap-3 sm:flex-row"},vs={class:"flex h-10 items-center justify-center rounded-xl border border-neutral-200 px-4 text-sm text-neutral-500"},xs={class:"overflow-x-auto"},gs={class:"min-w-full text-sm"},hs={class:"border-t border-neutral-200 align-top"},bs={class:"py-3 pr-4"},ys={class:"py-3 pr-4"},_s={class:"py-3 pr-4"},ws={class:"space-y-2"},ks={class:"py-3 pr-4"},$s={class:"py-3 pr-4"},Ss={class:"py-3 pr-4"},Ds={class:"space-y-2"},Cs={class:"py-3 pr-4"},Os={class:"flex items-center gap-2"},Ps={class:"py-3 pr-4"},Fs={class:"border-b border-neutral-200"},Rs={colspan:"8",class:"pb-3 pr-4"},As={class:"rounded-lg px-3 py-2"},Us={key:1,class:"py-8 text-sm text-error-600"},Ts={key:2,class:"space-y-4"},zs={class:"flex flex-col gap-4 md:flex-row md:items-end"},Ns={class:"flex flex-col gap-1 md:max-w-xs"},Is={class:"flex flex-col gap-1 md:w-80 md:max-w-none"},Ms={class:"flex w-full flex-col gap-3 sm:flex-row"},js={key:0,class:"flex flex-wrap items-center gap-2"},Ls={class:"text-sm font-medium text-neutral-700"},Es=["aria-label","onClick"],Bs={key:1,class:"py-8 text-neutral-500"},Vs={key:2,class:"space-y-4"},Hs={class:"overflow-x-auto"},qs={class:"min-w-full text-sm"},Ws={class:"text-left text-neutral-500"},Qs={class:"py-2 pr-4"},Ks={class:"py-2 pr-4"},Gs={class:"py-2 pr-4"},Ys={class:"py-2 pr-4"},Zs={class:"border-t border-neutral-200 align-top"},Js={class:"py-3 pr-4 text-neutral-700"},Xs={class:"py-3 pr-4 text-neutral-700"},en={class:"max-w-[300px] py-3 pr-4"},tn={class:"space-y-1"},sn={class:"max-w-[300px] break-all text-xs text-neutral-500"},nn={key:0,class:"text-xs text-neutral-400"},ln=["href"],on={class:"py-3 pr-4 text-neutral-700"},an={class:"py-3 pr-4 text-neutral-700"},rn={class:"py-3 pr-4 text-neutral-700"},dn={class:"max-w-sm space-y-1"},un={class:"text-xs text-neutral-500"},cn={key:0,class:"text-xs text-amber-700"},pn={class:"py-3 pr-4"},mn={class:"flex items-center gap-2"},fn={class:"py-3 pr-4"},vn={class:"border-b border-neutral-200"},xn={colspan:"8",class:"pb-3 pr-4 text-neutral-500"},gn={class:"rounded-lg px-3 py-2"},hn={class:"mt-1 list-disc space-y-1 pl-5"},bn={key:0,class:"flex justify-center"},yn=Y({__name:"OpportunitiesTable",props:he({opportunities:{},filteredOpportunities:{},totalOpportunities:{},currentPage:{},pageSize:{},pending:{type:Boolean},error:{},appliedSearchQuery:{},searchQuery:{},reviewFilterOptions:{},opportunityAdminStatusFilterOptions:{},adminStatusPendingId:{},reviewPendingId:{},reviewPendingStatus:{},deletePending:{type:Boolean},opportunityToDelete:{},sortKey:{},sortDirection:{}},{selectedReviewFilter:{required:!0},selectedReviewFilterModifiers:{},selectedAdminStatusFilter:{required:!0},selectedAdminStatusFilterModifiers:{}}),emits:he(["apply-search","clear-search","delete","update:currentPage","update-admin-status","update-review-status","update-sort"],["update:selectedReviewFilter","update:selectedAdminStatusFilter"]),setup(p,{emit:_}){const m=p,h=_,C=be(p,"selectedReviewFilter"),y=be(p,"selectedAdminStatusFilter"),c=re(m,"filteredOpportunities"),w=re(m,"searchQuery"),S=re(m,"appliedSearchQuery"),{activeOpportunityFilters:P,currentOpportunityPage:b,discoveryReasonItems:D,filteredOpportunityCountLabel:T,paginatedOpportunities:A,searchInput:g,sortIcon:f,totalOpportunityPages:u}=os({filteredOpportunities:$(()=>c.value),totalOpportunities:$(()=>m.totalOpportunities),currentOpportunityPage:$({get:()=>m.currentPage,set:k=>h("update:currentPage",k)}),opportunitiesPageSize:$(()=>m.pageSize),opportunitySortKey:$(()=>m.sortKey),opportunitySortDirection:$(()=>m.sortDirection),selectedReviewFilter:C,selectedAdminStatusFilter:y,searchQuery:w,appliedSearchQuery:S,reviewFilterOptions:m.reviewFilterOptions,opportunityAdminStatusFilterOptions:m.opportunityAdminStatusFilterOptions,clearOpportunitySearch:()=>h("clear-search")}),o=$(()=>m.pending&&!m.opportunities.length&&m.totalOpportunities===0),U=$(()=>m.appliedSearchQuery?"No opportunities matched that search.":P.value.length?"No opportunities match the selected filters.":"No opportunities discovered yet.");return(k,s)=>{const d=fe,x=we,i=qe,V=$e,se=We,Q=ke,ne=Qe,le=ve,oe=Ke;return n(),a("section",as,[e("div",is,[e("h3",rs,"Discovered opportunities ("+v(p.totalOpportunities)+")",1)]),t(o)?(n(),a("div",ds,[e("div",us,[e("div",cs,[s[10]||(s[10]=e("span",{class:"text-xs font-medium text-neutral-600"},"Review filter",-1)),l(d,{class:"h-10 w-full rounded-xl"})]),e("div",ps,[s[11]||(s[11]=e("span",{class:"text-xs font-medium text-neutral-600"},"Status filter",-1)),l(d,{class:"h-10 w-full rounded-xl"})]),e("div",ms,[e("div",fs,[l(d,{class:"h-10 w-full rounded-xl"}),e("div",vs,[l(x,{name:"i-lucide-loader-2",class:"mr-2 size-4 animate-spin"}),s[12]||(s[12]=R(" Loading ",-1))])])])]),l(i,{class:"my-8"}),e("div",xs,[e("table",gs,[s[13]||(s[13]=e("thead",{class:"text-left text-neutral-500"},[e("tr",null,[e("th",{class:"py-2 pr-4"},"Seen"),e("th",{class:"py-2 pr-4"},"Source"),e("th",{class:"py-2 pr-4"},"Opportunity"),e("th",{class:"py-2 pr-4"},"Status"),e("th",{class:"py-2 pr-4"},"Discovery"),e("th",{class:"py-2 pr-4"},"LLM fit"),e("th",{class:"py-2 pr-4"},"Review"),e("th",{class:"py-2 pr-4"},"Actions")])],-1)),e("tbody",null,[(n(),a(N,null,L(6,r=>(n(),a(N,{key:`opportunity-loading-${r}`},[e("tr",hs,[e("td",bs,[l(d,{class:"h-4 w-20"})]),e("td",ys,[l(d,{class:"h-4 w-28"})]),e("td",_s,[e("div",ws,[l(d,{class:"h-4 w-full max-w-[18rem]"}),l(d,{class:"h-3 w-full max-w-[14rem]"}),l(d,{class:"h-3 w-24"})])]),e("td",ks,[l(d,{class:"h-10 w-44 rounded-xl"})]),e("td",$s,[l(d,{class:"h-8 w-16 rounded-md"})]),e("td",Ss,[e("div",Ds,[l(d,{class:"h-8 w-16 rounded-md"}),l(d,{class:"h-3 w-20"})])]),e("td",Cs,[e("div",Os,[l(d,{class:"h-7 w-7 rounded-md"}),l(d,{class:"h-7 w-7 rounded-md"})])]),e("td",Ps,[l(d,{class:"h-8 w-16 rounded-md"})])]),e("tr",Fs,[e("td",Rs,[e("div",As,[l(d,{class:"h-3 w-24"}),l(d,{class:"mt-2 h-3 w-full"}),l(d,{class:"mt-1 h-3 w-5/6"})])])])],64))),64))])])])])):p.error?(n(),a("div",Us," Failed to load opportunities. "+v(p.error.statusMessage||p.error.message||"Request failed."),1)):(n(),a("div",Ts,[e("div",zs,[e("div",Ns,[s[14]||(s[14]=e("span",{class:"text-xs font-medium text-neutral-600"},"Review filter",-1)),l(V,{modelValue:C.value,"onUpdate:modelValue":s[0]||(s[0]=r=>C.value=r),items:p.reviewFilterOptions,"option-attribute":"label","value-attribute":"value",class:"w-full"},null,8,["modelValue","items"])]),e("div",Is,[s[15]||(s[15]=e("span",{class:"text-xs font-medium text-neutral-600"},"Status filter",-1)),l(V,{modelValue:y.value,"onUpdate:modelValue":s[1]||(s[1]=r=>y.value=r),items:p.opportunityAdminStatusFilterOptions,"option-attribute":"label","value-attribute":"value",class:"w-fit"},null,8,["modelValue","items"])]),e("form",{class:"flex flex-col gap-3 md:ml-auto md:min-w-[26rem] md:items-end",onSubmit:s[4]||(s[4]=pe(r=>h("apply-search",t(g)),["prevent"]))},[e("div",Ms,[l(se,{modelValue:t(g),"onUpdate:modelValue":s[2]||(s[2]=r=>G(g)?g.value=r:null),class:"w-full sm:min-w-[20rem]",placeholder:"Search evaluated page text"},null,8,["modelValue"]),l(Q,{type:"submit",loading:p.pending,class:"justify-center"},{default:M(()=>[...s[16]||(s[16]=[R(" Search ",-1)])]),_:1},8,["loading"]),l(Q,{type:"button",variant:"outline",color:"neutral",class:"justify-center",disabled:!t(g)&&!t(S),onClick:s[3]||(s[3]=r=>h("clear-search"))},{default:M(()=>[...s[17]||(s[17]=[R(" Clear ",-1)])]),_:1},8,["disabled"])])],32)]),l(i,{class:"my-8"}),t(P).length?(n(),a("div",js,[e("span",Ls,v(t(T)),1),(n(!0),a(N,null,L(t(P),r=>(n(),H(ne,{key:r.key,variant:"soft",color:"neutral",class:"inline-flex items-center gap-1.5 px-2 py-1 text-sm"},{default:M(()=>[e("span",null,v(r.label),1),e("button",{type:"button",class:"inline-flex items-center text-neutral-500 transition-colors hover:text-neutral-800","aria-label":`Clear ${r.label}`,onClick:r.clear},[l(x,{name:"i-lucide-x",class:"size-3.5"})],8,Es)]),_:2},1024))),128))])):j("",!0),t(c).length?(n(),a("div",Vs,[e("div",Hs,[e("table",qs,[e("thead",Ws,[e("tr",null,[e("th",Qs,[e("button",{type:"button",class:"inline-flex items-center gap-1 font-medium transition-colors hover:text-brand",onClick:s[5
3]||(s[5]=r=>h("update-sort","seen"))},[s[18]||(s[18]=e("span",null,"Seen",-1)),l(x,{name:t(f)("seen"),class:"size-4"},null,8,["name"])])]),e("th",Ks,[e("button",{type:"button",class:"inline-flex items-center gap-1 font-medium transition-colors hover:text-brand",onClick:s[6]||(s[6]=r=>h("update-sort","source"))},[s[19]||(s[19]=e("span",null,"Source",-1)),l(x,{name:t(f)("source"),class:"size-4"},null,8,["name"])])]),s[22]||(s[22]=e("th",{class:"py-2 pr-4"},"Opportunity",-1)),e("th",Gs,[e("button",{type:"button",class:"inline-flex items-center gap-1 font-medium transition-colors hover:text-brand",onClick:s[7]||(s[7]=r=>h("update-sort","status"))},[s[20]||(s[20]=e("span",null,"Status",-1)),l(x,{name:t(f)("status"),class:"size-4"},null,8,["name"])])]),s[23]||(s[23]=e("th",{class:"py-2 pr-4"},"Discovery",-1)),e("th",Ys,[e("button",{type:"button",class:"inline-flex items-center gap-1 font-medium transition-colors hover:text-brand",onClick:s[8]||(s[8]=r=>h("update-sort","llm_fit"))},[s[21]||(s[21]=e("span",null,"LLM fit",-1)),l(x,{name:t(f)("llm_fit"),class:"size-4"},null,8,["name"])])]),s[24]||(s[24]=e("th",{class:"py-2 pr-4"},"Review",-1)),s[25]||(s[25]=e("th",{class:"py-2 pr-4"},"Actions",-1))])]),e("tbody",null,[(n(!0),a(N,null,L(t(A),r=>{var Z,J;return n(),a(N,{key:r.id},[e("tr",Zs,[e("td",Js,v(t(Me)(r.last_seen_at)),1),e("td",Xs,v(((Z=r.source)==null?void 0:Z.name)||"Unknown source"),1),e("td",en,[e("div",tn,[l(le,{to:`/admin/rfp/opportunities/${r.id}`,class:"block truncate text-brand hover:underline"},{default:M(()=>[R(v(r.title),1)]),_:2},1032,["to"]),e("p",sn,v(t(je)(r.detail_url)),1),r.detail_url?(n(),a("a",{key:1,href:r.detail_url,target:"_blank",rel:"noreferrer",class:"text-xs text-neutral-500 hover:text-brand hover:underline"}," Open source page ",8,ln)):(n(),a("span",nn," Open source page unavailable "))])]),e("td",on,[l(V,{"model-value":r.admin_status,items:t(Le),"option-attribute":"label","value-attribute":"value",class:"min-w-[11rem]",disabled:p.adminStatusPendingId===r.id,loading:p.adminStatusPendingId===r.id,"onUpdate:modelValue":q=>h("update-admin-status",r,q)},null,8,["model-value","items","disabled","loading","onUpdate:modelValue"])]),e("td",an,[e("span",{class:z(["inline-flex min-w-[5rem] items-center justify-center rounded-md px-2 py-1 font-medium tabular-nums",t(Ee)(r.discovery_score)])},v(t(me)(r.discovery_score)),3)]),e("td",rn,[e("div",dn,[e("p",null,[e("span",{class:z(["inline-flex min-w-[5rem] items-center justify-center rounded-md px-2 py-1 font-medium tabular-nums",t(Se)(r.llm_score)])},v(t(me)(r.llm_score)),3)]),e("p",un,v(t(Be)(r.llm_verdict)),1),r.llm_is_stale?(n(),a("p",cn,"Stale after detail update")):j("",!0)])]),e("td",pn,[e("div",mn,[l(Q,{size:"xs",variant:"outline",color:r.review_status==="approved"?"success":"neutral",icon:"i-lucide-thumbs-up",loading:p.reviewPendingId===r.id&&p.reviewPendingStatus==="approved",onClick:q=>h("update-review-status",r,r.review_status==="approved"?null:"approved")},null,8,["color","loading","onClick"]),l(Q,{size:"xs",variant:"outline",color:r.review_status==="rejected"?"error":"neutral",icon:"i-lucide-thumbs-down",loading:p.reviewPendingId===r.id&&p.reviewPendingStatus==="rejected",onClick:q=>h("update-review-status",r,r.review_status==="rejected"?null:"rejected")},null,8,["color","loading","onClick"])])]),e("td",fn,[l(Q,{size:"xs",color:"error",variant:"outline",icon:"i-lucide-trash-2",loading:p.deletePending&&((J=p.opportunityToDelete)==null?void 0:J.id)===r.id,onClick:q=>h("delete",r)},{default:M(()=>[...s[26]||(s[26]=[R(" Delete ",-1)])]),_:1},8,["loading","onClick"])])]),e("tr",vn,[e("td",xn,[e("div",gn,[s[27]||(s[27]=e("p",{class:"text-xs font-medium uppercase tracking-wide text-neutral-400"},"Why flagged",-1)),e("ul",hn,[(n(!0),a(N,null,L(t(D)(r),(q,ae)=>(n(),a("li",{key:`${r.id}-reason-${ae}`},v(q),1))),128))])])])])],64)}),128))])])]),t(u)>1?(n(),a("div",bn,[l(oe,{page:t(b),"onUpdate:page":s[9]||(s[9]=r=>G(b)?b.value=r:null),total:p.totalOpportunities,"items-per-page":p.pageSize},null,8,["page","total","items-per-page"])])):j("",!0)])):(n(),a("div",Bs,v(t(U)),1))]))])}}}),_n={class:"p-6"},wn={class:"flex items-start justify-between gap-4"},kn={class:"mt-4 text-sm text-neutral-700"},$n={class:"mt-6 flex justify-end gap-3"},Sn=Y({__name:"DeleteOpportunityModal",props:{open:{type:Boolean},pending:{type:Boolean},opportunity:{}},emits:["close","confirm"],setup(p,{emit:_}){const m=p,h=_,C=y=>{!y&&m.open&&h("close")};return(y,c)=>{const w=ke,S=Ge;return n(),H(S,{open:p.open,"onUpdate:open":C},{content:M(()=>{var P;return[e("div",_n,[e("div",wn,[c[3]||(c[3]=e("div",null,[e("h2",{class:"text-xl font-semibold text-error-600"},"Delete opportunity"),e("p",{class:"mt-1 text-sm text-neutral-500"},"This action cannot be undone.")],-1)),l(w,{icon:"i-lucide-x",variant:"ghost",color:"neutral",onClick:c[0]||(c[0]=b=>y.$emit("close"))})]),e("p",kn,[c[4]||(c[4]=R(" Are you sure you want to delete ",-1)),e("strong",null,v((P=p.opportunity)==null?void 0:P.title),
31),c[5]||(c[5]=R("? ",-1))]),e("div",$n,[l(w,{type:"button",variant:"outline",color:"neutral",onClick:c[1]||(c[1]=b=>y.$emit("close"))},{default:M(()=>[...c[6]||(c[6]=[R("Cancel",-1)])]),_:1}),l(w,{type:"button",color:"error",loading:p.pending,onClick:c[2]||(c[2]=b=>y.$emit("confirm"))},{default:M(()=>[...c[7]||(c[7]=[R("Delete",-1)])]),_:1},8,["loading"])])])]}),_:1},8,["open"])}}}),Dn={class:"w-full px-4 py-10"},Cn={class:"mx-auto flex max-w-6xl flex-col gap-8"},On={class:"my-8"},Pn={class:"my-8"},Fn={class:"mx-auto flex max-w-6xl flex-col gap-8"},Jn=Y({__name:"index",setup(p){const _=Ne(),m=B(null),h=B(null),C=B(null),y=B(!1),c=B(!1),w=B(null),S=K("admin-rfp-applied-search-query",()=>""),{data:P,error:b,pending:D,refresh:T}=De("/api/admin/rfp/workflow",{default:()=>({needHumanReview:[],needsMichaelApproval:[],responseInProgress:[],hubspotDefaultPipelineDeals:[],hubspotProposalBidSubmittedDeals:[],hubspotDealOwnerOptions:[],deadlineCalendarEvents:[]}),lazy:!0,server:!1},"$N4ScdU-4w7"),A=$(()=>P.value||{}),{opportunities:g,opportunitiesError:f,opportunitiesPending:u,currentPage:o,pageSize:U,refreshOpportunities:k,selectedReviewFilter:s,selectedAdminStatusFilter:d,searchQuery:x,sortDirection:i,sortKey:V,totalOpportunities:se,filteredOpportunities:Q,reviewFilterOptions:ne,opportunityAdminStatusFilterOptions:le}=ls(S),oe=Ue(),r=async(O,I)=>{var E;const F=typeof I=="string"?I:null;if(!(!F||F===O.admin_status)){m.value=O.id;try{await $fetch(`/api/admin/rfp/opportunities/${O.id}`,{method:"PATCH",body:{adminStatus:F}}),await X(),_.add({title:"Opportunity updated",description:`Status set to ${Ve(F)}.`,color:"success"})}catch(W){_.add({title:"Failed to update opportunity",description:((E=W==null?void 0:W.data)==null?void 0:E.statusMessage)||(W==null?void 0:W.message)||"Request failed",color:"error"})}finally{m.value=null}}},Z=async(O,I)=>{var F;h.value=O.id,C.value=I;try{await $fetch(`/api/admin/rfp/opportunities/${O.id}`,{method:"PATCH",body:{reviewStatus:I}}),await X(),_.add({title:"Opportunity updated",description:I?`Marked as ${I}.`:"Review cleared.",color:"success"})}catch(E){_.add({title:"Failed to update opportunity",description:((F=E==null?void 0:E.data)==null?void 0:F.statusMessage)||(E==null?void 0:E.message)||"Request failed",color:"error"})}finally{h.value=null,C.value=null}},J=O=>{w.value=O,c.value=!0},q=async O=>{S.value=O.trim(),await k()},ae=async()=>{S.value="",await k()},Ce=O=>{o.value=O},Oe=O=>{V.value===O?i.value=i.value==="asc"?"desc":"asc":(V.value=O,i.value=O==="seen"||O==="llm_fit"?"desc":"asc"),o.value=1},X=async()=>{await Promise.all([k(),T()])},xe=()=>{c.value=!1,w.value=null},Pe=async()=>{var O,I;if((O=w.value)!=null&&O.id){y.value=!0;try{await $fetch(`/api/admin/rfp/opportunities/${w.value.id}`,{method:"DELETE"});const F=w.value.title;await X(),xe(),_.add({title:"Opportunity deleted",description:`${F} was removed successfully.`,color:"success"})}catch(F){_.add({title:"Failed to delete opportunity",description:((I=F==null?void 0:F.data)==null?void 0:I.statusMessage)||(F==null?void 0:F.message)||"Request failed",color:"error"})}finally{y.value=!1}}};return(O,I)=>{const F=Ae,E=ct,W=ts,Fe=yn,Re=Sn;return n(),a("div",Dn,[e("div",Cn,[l(F,{tabs:t(oe)},null,8,["tabs"])]),e("div",On,[l(E,{events:t(A).deadlineCalendarEvents||[],pending:t(D),error:t(b)},null,8,["events","pending","error"])]),e("div",Pn,[l(W,{workflow:t(A),pending:t(D),error:t(b),"is-refreshing":t(u),onRefresh:X},null,8,["workflow","pending","error","is-refreshing"])]),e("div",Fn,[l(Fe,{"selected-review-filter":t(s),"onUpdate:selectedReviewFilter":I[0]||(I[0]=ie=>G(s)?s.value=ie:null),"selected-admin-status-filter":t(d),"onUpdate:selectedAdminStatusFilter":I[1]||(I[1]=ie=>G(d)?d.value=ie:null),"current-page":t(o),opportunities:t(g),"filtered-opportunities":t(Q),"total-opportunities":t(se),"page-size":t(U),pending:t(u),error:t(f),"applied-search-query":t(S),"search-query":t(x),"review-filter-options":t(ne),"opportunity-admin-status-filter-options":t(le),"admin-status-pending-id":t(m),"review-pending-id":t(h),"review-pending-status":t(C),"delete-pending":t(y),"opportunity-to-delete":t(w),"sort-key":t(V),"s
3ort-direction":t(i),onApplySearch:q,onClearSearch:ae,"onUpdate:currentPage":Ce,onUpdateSort:Oe,onUpdateAdminStatus:r,onUpdateReviewStatus:Z,onDelete:J},null,8,["selected-review-filter","selected-admin-status-filter","current-page","opportunities","filtered-opportunities","total-opportunities","page-size","pending","error","applied-search-query","search-query","review-filter-options","opportunity-admin-status-filter-options","admin-status-pending-id","review-pending-id","review-pending-status","delete-pending","opportunity-to-delete","sort-key","sort-direction"])]),l(Re,{open:t(c),pending:t(y),opportunity:t(w),onClose:xe,onConfirm:Pe},null,8,["open","pending","opportunity"])])}}});export{Jn 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.