1import{d as D,a as L,$ as V,o as a,m as o,j as e,h as p,ab as u,ah as N,aW as A,ad as y,t as r,e as n,i as F,aH as d,bP as B,r as m,c as x,D as M,E as $}from"./index63916.js";import{_ as E}from"./spinnerFullScreen.component.vue_vue_type_script_setup_true_lang63916.js";import{r as S}from"./HandThumbDownIcon63916.js";const H={"aria-labelledby":"assistant-feedback-title",class:"space-y-4"},P={key:0,class:"flex items-center justify-center py-16"},R={class:"grid grid-cols-1 gap-3 sm:grid-cols-2"},W=["value"],q=["value"],z={class:"rounded-md border border-gray-200 bg-white p-4 shadow-sm"},G={class:"flex items-center space-x-3"},J={class:"text-2xl font-semibold text-gray-900"},K={class:"text-sm text-gray-500"},O={class:"rounded-md border border-gray-200 bg-white shadow-sm"},Q={class:"border-b border-gray-200 px-4 py-4 sm:px-6"},X={id:"feedback-title",class:"font-montserrat text-lg font-semibold text-gray-900"},Y={class:"font-normal text-gray-400"},Z={class:"max-h-80 overflow-y-auto px-4 py-4 sm:px-6"},ee={key:0,class:"flex flex-col items-center justify-center space-y-1 py-4"},te={key:1,role:"list",class:"divide-y divide-gray-100"},se={class:"min-w-0"},ae={class:"truncate text-sm font-medium text-gray-900"},oe={class:"truncate text-xs text-gray-500"},le=["title"],re={class:"rounded-md border border-gray-200 bg-white shadow-sm"},ne={class:"border-b border-gray-200 px-4 py-4 sm:px-6"},de={class:"font-montserrat text-lg font-semibold text-gray-900"},ie={class:"font-normal text-gray-400"},ce={class:"max-h-80 overflow-y-auto px-4 py-4 sm:px-6"},ue={key:0,class:"flex flex-col items-center justify-center space-y-1 py-4"},me={key:1,role:"list",class:"space-y-6"},fe={class:"flex items-center justify-between"},pe={class:"text-sm font-medium text-gray-900"},ye=["title"],xe={class:"text-xs text-gray-500"},be={class:"mt-1 whitespace-pre-line text-sm text-gray-700"},ke=D({__name:"AssistantFeedbackTab.component",props:{assistant:{}},setup(j){const _=j,C=L(),b=m([]),g=m([]),v=m(!1),i=m("all"),c=m("all"),I=[{value:"all",label:"All time"},{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"},{value:"90",label:"Last 90 days"}],T=x(()=>{const l=new Map;for(const t of[...b.value,...g.value]){const s=String(t.companyId);l.has(s)||l.set(s,{id:s,name:t.companyName??"Unknown company"})}return[...l.values()].sort((t,s)=>t.name.localeCompare(s.name))}),U=x(()=>i.value!=="all"||c.value!=="all"),k=l=>{if(i.value!=="all"&&String(l.companyId)!==i.value)return!1;if(c.value!=="all"){const t=d().subtract(Number(c.value),"days");if(d(l.createdAt).isBefore(t))return!1}return!0},h=x(()=>b.value.filter(k)),f=x(()=>g.value.filter(k));return V(async()=>{if(C.role==="admin"&&_.assistant.id){v.value=!0;try{const l=await M.getAssistantFeedback(_.assistant.id);l.data.success&&(b.value=l.data.data.notes,g.value=l.data.data.thumbs)}catch(l){$.error(l)}v.value=!1}}),(l,t)=>(a(),o("section",H,[t[11]||(t[11]=e("h2",{id:"assistant-feedback-title",class:"sr-only"},"Feedback",-1)),v.value?(a(),o("div",P,[p(E,{overlay:!1,fullscreen:!1,textColor:"text-gray-600"})])):(a(),o(u,{key:1},[e("div",R,[e("div",null,[t[3]||(t[3]=e("label",{for:"feedback-company-filter",class:"mb-1 block text-xs font-medium text-gray-600"},"Company",-1)),N(e("select",{id:"feedback-company-filter","onUpdate:modelValue":t[0]||(t[0]=s=>i.value=s),class:"block w-full rounded-md border border-gray-300 py-2 pl-3 pr-8 text-sm text-gray-900 focus:border-pink-500 focus:outline-none focus:ring-1 focus:ring-pink-500"},[t[2]||(t[2]=e("option",{value:"all"},"All companies",-1)),(a(!0),o(u,null,y(T.value,s=>(a(),o("option",{key:s.id,value:s.id},r(s.name),9,W))),128))],512),[[A,i.value]])]),e("div",null,[t[4]||(t[4]=e("label",{for:"feedback-date-filter",class:"mb-1 block text-xs font-medium text-gray-600"},"Date",-1)),N(e("select",{id:"feedback-date-filter","onUpdate:modelValue":t[1]||(t[1]=s=>c.value=s),class:"block w-full rounded-md border border-gray-300 py-2 pl-3 pr-8 text-sm text-gray-900 focus:border-pink-500 focus:outline-none focus:ring-1 focus:ring-pink-500"},[(a(),o(u,null,y(I,s=>e("option",{key:s.value,value:s.value},r(s.label),9,q)),64))],512),[[A,c.value]])])]),e("div",z,[e("div",G,[p(n(S),{class:"h-7 w-7 flex-shrink-0 text-red-500","aria-hidden":"true"}),e("div",null,[e("p",J,r(f.value.length),1),e("p",K,r(U.value?"Thumbs down matching filters":"Total thumbs down across all companies"),1)])])]),e("div",O,[e("div",Q,[e("h2",X,[t[5]||(t[5]=F(" Thumbs Down ",-1)),e("span",Y,"("+r(f.value.length)+")",1)]),t[6]||(t[6]=e("p",{class:"text-sm text-gray-500"},"Companies that marked this assistant as unpreferred",-1))]),e("div",Z,[f.value.length?(a(),o("ul",te,[(a(!0),o(u,null,y(f.value,(s,w)=>(a(),o("li",{key:String(s.companyId)+"-"+s.createdAt,class:"flex items-center justify-between py-3"},[e("div",se,[e("p",ae,r(s.companyName??"Unknown company"),1),e("p",oe,r(s.managerName),1)]),e("span",{class:"ml-3 flex-shrink-0 text-xs text-gray-500",title:n(d)(s.createdAt).format("lll")},r(n(d)(s.createdAt).fromNow()),9,le)]))),128))])):(a(),o("div",ee,[p(n(S),{class:"h-8 w-8 text-gray-300","aria-hidden":"true"}
1),t[7]||(t[7]=e("h5",{class:"text-sm font-medium text-gray-400"},"No thumbs down",-1))]))])]),e("div",re,[e("div",ne,[e("h2",de,[t[8]||(t[8]=F(" Notes ",-1)),e("span",ie,"("+r(h.value.length)+")",1)]),t[9]||(t[9]=e("p",{class:"text-sm text-gray-500"},"Notes added by companies about this assistant",-1))]),e("div",ce,[h.value.length?(a(),o("ul",me,[(a(!0),o(u,null,y(h.value,(s,w)=>(a(),o("li",{key:w},[e("div",fe,[e("p",pe,r(s.companyName??"Unknown company"),1),e("span",{class:"text-xs text-gray-500",title:n(d)(s.createdAt).format("lll")},r(n(d)(s.createdAt).fromNow()),9,ye)]),e("p",xe,r(s.managerName),1),e("p",be,r(s.note),1)]))),128))])):(a(),o("div",ue,[p(n(B),{class:"h-8 w-8 text-gray-300","aria-hidden":"true"}),t[10]||(t[10]=e("h5",{class:"text-sm font-medium text-gray-400"},"No notes added",-1))]))])])],64))]))}});export{ke 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.