chordia-ui 3.5.2 → 3.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("react"),h=require("lucide-react"),Ve=require("../UpdatedInteractionRecording.cjs.js"),G={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",absent:"var(--Grey-absent, #D9D9D9)",accent:"var(--rail-orange, #C98A5A)",itemText:"var(--text-item, #3F3F3F)",quoteLine:"var(--border-warm, #B2AEA8)",quoteText:"var(--text-subtle-warm, #767473)",iconBg:"var(--surface-hover, #F3F7F7)"},Lt={effective:"Effective",strong:"Strong",needs_improvement:"Needs Improvement",mixed:"Mixed"},Pe="updated-coaching-synthesis-keyframes";function Bt(){if(typeof document>"u"||document.getElementById(Pe))return;const t=document.createElement("style");t.id=Pe,t.textContent=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("react"),x=require("lucide-react"),Qe=require("../UpdatedInteractionRecording.cjs.js"),M={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",absent:"var(--Grey-absent, #D9D9D9)",accent:"var(--rail-orange, #C98A5A)",itemText:"var(--text-item, #3F3F3F)",quoteLine:"var(--border-warm, #B2AEA8)",quoteText:"var(--text-subtle-warm, #767473)",iconBg:"var(--surface-hover, #F3F7F7)"},Bt={effective:"Effective",strong:"Strong",needs_improvement:"Needs Improvement",mixed:"Mixed"},Oe="updated-coaching-synthesis-keyframes";function Pt(){if(typeof document>"u"||document.getElementById(Oe))return;const t=document.createElement("style");t.id=Oe,t.textContent=`
2
2
  @keyframes updated-coaching-shimmer {
3
3
  0% { background-position: -200% 0; }
4
4
  100% { background-position: 200% 0; }
@@ -7,11 +7,11 @@
7
7
  0%, 100% { opacity: 0.4; }
8
8
  50% { opacity: 1; }
9
9
  }
10
- `,document.head.appendChild(t)}function Pt({overall:t}){const n=Lt[t]||(t?t.replace(/_/g," "):"");return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:G.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Overall:"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(h.ThumbsUp,{size:14,color:G.strong,strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:G.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:n})]})]})}function Ot({item:t}){const n=typeof t=="string"?t:(t==null?void 0:t.text)||"",i=typeof t=="object"?t==null?void 0:t.quote:null;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsx("div",{style:{fontSize:14,fontWeight:600,color:G.itemText,fontFamily:"var(--font-sans)",lineHeight:1.5},children:n}),i&&e.jsxs("div",{style:{display:"flex",gap:10},children:[e.jsx("div",{style:{width:1,flexShrink:0,alignSelf:"stretch",background:G.quoteLine}}),e.jsxs("div",{style:{fontSize:14,fontWeight:400,color:G.quoteText,fontFamily:"var(--font-sans)",lineHeight:1.5},children:["“",i,"”"]})]})]})}function Oe({icon:t,label:n,items:i}){return!i||i.length===0?null:e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,borderRadius:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:9999,background:G.iconBg,flexShrink:0},children:t}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:G.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:n})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:24},children:i.map((r,s)=>e.jsx(Ot,{item:r},s))})]})}const Ze=({data:t,loading:n,error:i})=>{var v,b;if(f.useEffect(()=>{Bt()},[]),n)return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
10
+ `,document.head.appendChild(t)}function $t({overall:t}){const n=Bt[t]||(t?t.replace(/_/g," "):"");return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Overall:"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(x.ThumbsUp,{size:14,color:M.strong,strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:n})]})]})}function Ot({item:t}){const n=typeof t=="string"?t:(t==null?void 0:t.text)||"",i=typeof t=="object"?t==null?void 0:t.quote:null;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsx("div",{style:{fontSize:14,fontWeight:600,color:M.itemText,fontFamily:"var(--font-sans)",lineHeight:1.5},children:n}),i&&e.jsxs("div",{style:{display:"flex",gap:10},children:[e.jsx("div",{style:{width:1,flexShrink:0,alignSelf:"stretch",background:M.quoteLine}}),e.jsxs("div",{style:{fontSize:14,fontWeight:400,color:M.quoteText,fontFamily:"var(--font-sans)",lineHeight:1.5},children:["“",i,"”"]})]})]})}function Ne({icon:t,label:n,items:i}){return!i||i.length===0?null:e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,borderRadius:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:9999,background:M.iconBg,flexShrink:0},children:t}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:n})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:24},children:i.map((l,r)=>e.jsx(Ot,{item:l},r))})]})}const Je=({data:t,loading:n,error:i})=>{var v,m;if(f.useEffect(()=>{Pt()},[]),n)return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
11
11
  @keyframes coaching-spinner-spin {
12
12
  from { transform: rotate(0deg); }
13
13
  to { transform: rotate(360deg); }
14
14
  }
15
- `}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,padding:"48px 24px"},children:[e.jsxs("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"coaching-spinner-spin 1.2s linear infinite"},children:[e.jsx("path",{d:"M43 24C43 26.4951 42.5086 28.9658 41.5537 31.271C40.5989 33.5762 39.1993 35.6707 37.435 37.435C35.6707 39.1993 33.5762 40.5989 31.271 41.5537C28.9658 42.5086 26.4951 43 24 43C21.5049 43 19.0342 42.5086 16.729 41.5537C14.4238 40.5989 12.3293 39.1993 10.565 37.435C8.80066 35.6707 7.40113 33.5762 6.44629 31.271C5.49145 28.9658 5 26.4951 5 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M12 24C12 22.4241 12.3104 20.8637 12.9134 19.4078C13.5165 17.9519 14.4004 16.629 15.5147 15.5147C16.629 14.4004 17.9519 13.5165 19.4078 12.9134C20.8637 12.3104 22.4241 12 24 12C25.5759 12 27.1363 12.3104 28.5922 12.9134C30.0481 13.5165 31.371 14.4004 32.4853 15.5147C33.5996 16.629 34.4835 17.9519 35.0866 19.4078C35.6896 20.8637 36 22.4241 36 24",stroke:"#00A66E",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M20 24C20 24.5253 20.1035 25.0454 20.3045 25.5307C20.5055 26.016 20.8001 26.457 21.1716 26.8284C21.543 27.1999 21.984 27.4945 22.4693 27.6955C22.9546 27.8965 23.4747 28 24 28C24.5253 28 25.0454 27.8965 25.5307 27.6955C26.016 27.4945 26.457 27.1999 26.8284 26.8284C27.1999 26.457 27.4945 26.016 27.6955 25.5307C27.8965 25.0454 28 24.5253 28 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"})]}),e.jsx("span",{style:{fontSize:14,color:G.muted,fontWeight:500,textAlign:"center"},children:"Synthesizing coaching summary..."})]})]});if(i)return e.jsx("div",{style:{fontSize:14,color:G.muted},children:"Unable to generate coaching summary."});if(!t)return null;const r=t.strengths||[],s=t.improvements||[],d=typeof t.one_liner=="string"?t.one_liner:((v=t.one_liner)==null?void 0:v.text)||"",y=typeof t.context=="string"?t.context:((b=t.context)==null?void 0:b.text)||"";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,background:"#FFF"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(h.ShieldCheck,{size:20,color:G.accent,strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:G.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textTransform:"uppercase"},children:"Coaching Summary"})]}),d&&e.jsx("div",{style:{fontSize:14,fontWeight:500,color:G.strong,fontFamily:"var(--font-sans)",lineHeight:1.5},children:d}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:16,justifyContent:"space-between"},children:[y&&e.jsx("div",{style:{fontSize:14,fontWeight:400,color:G.muted,fontFamily:"var(--font-sans)",lineHeight:1.5,flex:1},children:y}),t.overall&&e.jsx(Pt,{overall:t.overall})]}),(r.length>0||s.length>0)&&e.jsxs("div",{style:{display:"flex",gap:24,paddingTop:24,borderTop:`1px solid ${G.absent}`},children:[e.jsx(Oe,{icon:e.jsx(h.TrendingUp,{size:14,color:G.strong,strokeWidth:1.5}),label:"Key Strengths",items:r}),e.jsx(Oe,{icon:e.jsx(h.Lightbulb,{size:14,color:G.strong,strokeWidth:1.5}),label:"Improvements",items:s})]})]})};function $t(t){const n=Math.floor(t/60),i=Math.round(t%60);return`${n}:${i.toString().padStart(2,"0")}`}const Nt={display:"flex",justifyContent:"space-between",padding:"8px 8px 12px 8px",alignItems:"center",gap:24,fontFamily:"var(--font-sans)",fontSize:13,fontWeight:400,lineHeight:"normal",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)"},$e={display:"flex",flexDirection:"column",flex:"1 0 0",gap:0,minWidth:0},Qe=({meta:t={},callPurpose:n={},classification:i={},dimensions:r=[],outcomeQuality:s="Neutral",onMoreDetails:d,moreDetails:y=[],resolutionOutcome:v,customerIntent:b})=>{const[j,W]=f.useState(!1),k=t.duration_seconds!=null?$t(t.duration_seconds):null,c=t.message_count,w=n.interaction_driver,m=i.interaction_paradigm,x=l=>r.find(P=>(P.key||"").toLowerCase().includes(l)),z=x("resolution_outcome"),F=x("customer_intent"),C=x("outcome_quality"),_=l=>l?l.replace(/_/g," ").replace(/\b\w/g,P=>P.toUpperCase()):null,M=s!=="Neutral"?s:C?_(C.value):s,L=v??(z?_(z.value):null),T=b??(F?_(F.value):null),u=new Set(["resolution_outcome","customer_intent","outcome_quality"].map(l=>`dim.${l}`)),p=r.filter(l=>!u.has(l.key)),o=[],R=[[k!=null?{label:"Duration",value:k}:null,c!=null?{label:"Messages",value:c}:null],[w!=null?{label:"Driver",value:w}:null,m!=null?{label:"Paradigm",value:m}:null]];for(let l=0;l<p.length;l+=2){const P=p[l]?{label:p[l].display_name||p[l].label||p[l].key,value:_(p[l].value)}:null,H=p[l+1]?{label:p[l+1].display_name||p[l+1].label||p[l+1].key,value:_(p[l+1].value)}:null;R.push([P,H])}R.push([{label:"Outcome Quality",value:M},{isMoreDetails:!0}]),R.forEach(l=>o.push(l));const $=[L!=null&&{label:"Resolution Outcome",value:L},T!=null&&{label:"Customer Intent",value:T},...y||[]].filter(Boolean),q=l=>e.jsxs("div",{style:Nt,children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",whiteSpace:"nowrap",flexShrink:0},children:l.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",textAlign:"right",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:l.value})]},l.label),Z=()=>e.jsxs("div",{onClick:()=>{W(l=>!l),d&&!j&&d()},style:{display:"flex",alignItems:"center",gap:6,padding:"8px 8px 12px 8px",cursor:"pointer",fontFamily:"var(--font-sans)",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)"},children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",fontSize:13,fontWeight:500,lineHeight:"normal"},children:"More Details"}),j?e.jsx(h.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(h.ChevronDown,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5})]},"more-details");return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0,position:"relative",overflow:"visible"},children:[o.map((l,P)=>{var H;return e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:24,alignSelf:"stretch"},children:[e.jsx("div",{style:$e,children:l[0]&&!l[0].isMoreDetails?q(l[0]):e.jsx("div",{style:{flex:1}})}),e.jsx("div",{style:$e,children:l[1]&&!l[1].isMoreDetails?q(l[1]):(H=l[1])!=null&&H.isMoreDetails?Z():e.jsx("div",{style:{flex:1}})})]},P)}),j&&$.length>0&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,display:"flex",width:340,flexDirection:"column",alignItems:"flex-start",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxShadow:"-2px 2px 2px 0 rgba(0, 0, 0, 0.25)",overflow:"hidden",fontFamily:"var(--font-sans)",zIndex:50},children:[e.jsx("div",{style:{padding:"12px 16px",fontSize:13,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",alignSelf:"stretch"},children:"More details"}),$.map(l=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",gap:24,fontSize:13,fontWeight:400,lineHeight:"normal",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",alignSelf:"stretch"},children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",whiteSpace:"nowrap",flexShrink:0},children:l.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontSize:13,fontStyle:"normal",fontWeight:400,lineHeight:"120%",textAlign:"right"},children:l.value})]},l.label))]})]})},S={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",absent:"var(--Grey-absent, #D9D9D9)",white:"var(--Grey-White, #FFF)",cardBg:"var(--surface-warm-40, rgba(243, 241, 229, 0.40))"},E=1.2,Ne=3,qe=t=>t!=null?Math.round(t*100)+"%":"—",Ke=t=>{if(t==null)return"—";const n=(t*100).toFixed(1);return t>0?`+${n}pp`:`${n}pp`},Je=({outcomeLift:t,driverLabels:n=[]})=>{var c;if(!t||t.lift==null)return null;const i=t.p_expected,r=t.p_full,s=t.lift_raw??(r!=null&&i!=null?r-i:null),d=t.lift,y=(c=t.interpretation)!=null&&c.lift_band?t.interpretation.lift_band.replace(/_/g," "):d>=0?"Positive":"Negative",v=y.charAt(0).toUpperCase()+y.slice(1),j=/negative/i.test(y)?h.ThumbsDown:h.ThumbsUp,W=n.slice(0,Ne),k=n.length-Ne;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,gap:24,borderRadius:8,border:`1px solid ${S.absent}`,background:S.cardBg,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:32},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:24,alignSelf:"stretch"},children:[e.jsx("span",{style:{fontSize:15,fontWeight:600,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:E},children:"Agent Lift Analysis"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--font-sans)"},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.strong,lineHeight:E},children:"vs. Average Agent:"}),e.jsx("span",{style:{fontSize:14,fontWeight:600,color:S.strong,lineHeight:E},children:Ke(d)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,paddingLeft:8,borderLeft:`1px solid ${S.absent}`},children:[e.jsx(j,{size:14,color:S.strong}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:S.strong,lineHeight:E},children:v})]})]})]}),e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"center",flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:E},children:qe(i)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:E,whiteSpace:"nowrap"},children:"Expected Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:E,textAlign:"center"},children:"Based on call type & difficulty"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"center",paddingLeft:24,borderLeft:`1px solid ${S.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:E},children:Ke(s)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:E,whiteSpace:"nowrap"},children:"Agent Impact"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:E,textAlign:"center"},children:"Behavior-driven change"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"center",paddingLeft:24,borderLeft:`1px solid ${S.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:E},children:qe(r)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:600,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:E,whiteSpace:"nowrap"},children:"Predicted Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:E,textAlign:"center"},children:"With agent behaviors"})]})]})]})]}),n.length>0&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,alignSelf:"stretch"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:E},children:"Key Drivers"}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[W.map((w,m)=>e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${S.absent}`,background:S.white},children:e.jsx("span",{style:{fontSize:12,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:E,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},children:w})},m)),k>0&&e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${S.absent}`,background:S.white},children:e.jsxs("span",{style:{fontSize:12,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:E,whiteSpace:"nowrap"},children:["+ ",k]})})]})]})]})},Ye=({children:t,size:n=28,onClick:i,title:r})=>{const[s,d]=f.useState(!1);return e.jsx("div",{title:r,onClick:i,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",width:n,height:n,borderRadius:9999,background:s?"var(--surface-hover, #F3F7F7)":"transparent",cursor:"pointer",flexShrink:0,transition:"background 0.15s"},children:t})},Ue=({signals:t={signals:[],present_count:0,total_signals_evaluated:0},expandedSignals:n=new Set,toggleSignal:i=()=>{},playEvidence:r=()=>{},highlightTurns:s=()=>{},onShowInTranscript:d=()=>{},timelinePlaying:y=!1,currentTimeSeconds:v=0})=>{const b=(t==null?void 0:t.signals)??[],j=(t==null?void 0:t.present_count)??b.length,W=c=>{const w=Math.floor(c/6e4),m=Math.floor(c%6e4/1e3);return`${w.toString().padStart(2,"0")}:${m.toString().padStart(2,"0")}`},k=c=>y&&c.start_ms!=null&&v*1e3>=c.start_ms&&v*1e3<=(c.end_ms??c.start_ms+5e3);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",alignSelf:"stretch",width:"100%",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:34,height:34,borderRadius:9999,background:"var(--surface-hover, #F3F7F7)",flexShrink:0},children:e.jsx(h.FileSignal,{size:20,color:"#2E3236",strokeWidth:1.5})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flex:1},children:[e.jsx("span",{style:{fontSize:15,fontWeight:500,color:"var(--Grey-Strong, #2E3236)"},children:"Signals"}),e.jsxs("span",{style:{fontSize:14,fontWeight:500,color:"var(--Grey-Strong, #2E3236)"},children:[j," Signals Detected"]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",background:"var(--Grey-White, #FFF)",gap:8},children:[b.length===0&&e.jsx("div",{style:{padding:"8px 0",fontSize:14,color:"var(--Grey-Muted, #808183)"},children:"No signals detected."}),b.map((c,w)=>{var F,C,_;const m=c.key??c.id??w,x=n.has(m),z=((F=c.observations)==null?void 0:F.length)??0;return e.jsxs("div",{id:`signal-${m}`,style:{display:"flex",flexDirection:"column",width:"100%",gap:8},children:[e.jsxs("button",{onClick:()=>i(m),style:{display:"flex",padding:"8px 0",alignItems:"center",gap:12,alignSelf:"stretch",width:"100%",background:"none",border:"none",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",cursor:"pointer"},children:[e.jsxs("span",{style:{flex:1,textAlign:"left",fontSize:14,fontWeight:600,color:"var(--text-dark, #0B0A0A)",lineHeight:1.71},children:[c.display_name||((C=c.key)==null?void 0:C.replace(/_/g," ")),z>0&&e.jsxs("span",{style:{fontWeight:600,color:"var(--text-dark, #0B0A0A)",marginLeft:6},children:["(",z,")"]})]}),x?e.jsx(h.ChevronUp,{size:20,color:"#767473"}):e.jsx(h.ChevronDown,{size:20,color:"#767473"})]}),x&&((_=c.observations)==null?void 0:_.length)>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0},children:c.observations.map((M,L)=>{var T,u,p;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:8},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"8px 0",justifyContent:"space-between"},children:[e.jsx("span",{style:{flex:1,fontSize:14,fontWeight:400,color:"var(--text-subtle-warm, #767473)",lineHeight:1.5},children:M.reason||M.explanation}),((u=(T=M.evidence)==null?void 0:T[0])==null?void 0:u.start_ms)!=null&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx(Ye,{size:28,title:"Show in transcript",onClick:o=>{o.stopPropagation(),d(M.evidence[0].start_ms)},children:e.jsx(h.ScrollText,{size:16,color:"#808183",strokeWidth:1.5})}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1.2,whiteSpace:"nowrap"},children:W(M.evidence[0].start_ms)})]})]}),(p=M.evidence)==null?void 0:p.map((o,R)=>{const $=o.start_ms!=null&&o.end_ms!=null;return o.text&&e.jsxs("div",{onClick:q=>{q.stopPropagation(),$&&r(o)},onMouseEnter:()=>s(o.turn_ids??[]),onMouseLeave:()=>s([]),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0",cursor:$?"pointer":"default"},children:[$&&e.jsx(Ye,{size:28,children:k(o)?e.jsx(h.PauseCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(h.PlayCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1})}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:["“",o.text,"”"]})]},R)})]},M.key??L)})})]},m)})]})]})},A={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",absent:"var(--Grey-absent, #D9D9D9)",white:"var(--Grey-White, #FFF)",accent:"var(--rail-orange, #C98A5A)",track:"var(--rail-surface-2, #E3E1D7)",infoIcon:"var(--color-input-border, #ACACAD)"},qt=({score:t=4,maxScore:n=10})=>{const j=Math.min(Math.round(t/n*5),5),W=180/5,k=m=>{const x=m*Math.PI/180;return{x:121.5+85*Math.cos(x),y:123-85*Math.sin(x)}},c=(m,x)=>{const z=k(m),F=k(x),C=m-x>180?1:0;return`M ${z.x} ${z.y} A 85 85 0 ${C} 1 ${F.x} ${F.y}`},w=2;return e.jsx("svg",{width:"100%",viewBox:"0 0 243 130",fill:"none",style:{maxWidth:243},children:Array.from({length:5},(m,x)=>{const z=180-x*W-(x>0?w/2:0),F=180-(x+1)*W+(x<5-1?w/2:0),C=x<j;return e.jsx("path",{d:c(z,F),stroke:C?A.strong:A.track,strokeWidth:30,strokeLinecap:"butt",fill:"none"},x)})})},Kt=({value:t=0,maxValue:n=5})=>e.jsx("div",{style:{display:"flex",gap:2},children:Array.from({length:n},(i,r)=>e.jsx("div",{style:{width:22,height:6,borderRadius:1,background:r<t?A.strong:A.track}},r))}),Yt={CSAT:"Predicted Customer Satisfaction",Resolution:"Predicted Resolution: was the issue fully resolved?","Process Adherence":"Process Adherence: Did the agent follow procedures?",Communication:"Predicted Communication Quality: Clarity, Empathy, Professionalism"},Vt=({text:t,children:n})=>{const[i,r]=f.useState(!1),s=f.useRef(null),[d,y]=f.useState({top:0,left:0}),v=()=>{if(s.current){const b=s.current.getBoundingClientRect();y({top:b.top-8,left:b.left+b.width/2})}r(!0)};return e.jsxs("div",{ref:s,style:{position:"relative",display:"inline-flex"},onMouseEnter:v,onMouseLeave:()=>r(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:d.top,left:d.left,transform:"translate(-50%, -100%)",display:"flex",width:"max-content",maxWidth:300,padding:10,alignItems:"center",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-Strong, #2E3236)",zIndex:9999,pointerEvents:"none"},children:e.jsx("span",{style:{color:"#FFF",fontSize:12,fontWeight:400,lineHeight:"140%"},children:t})})]})},Zt=({label:t,value:n=0,maxValue:i=5})=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:8,alignItems:"center"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{fontSize:12,fontWeight:400,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:t}),e.jsx(Vt,{text:Yt[t]||t,children:e.jsx(h.Info,{size:14,color:A.infoIcon,strokeWidth:1,style:{cursor:"pointer"}})})]}),e.jsx(Kt,{value:n,maxValue:i})]}),Xe=({score:t=83,maxScore:n=100,predictedScore:i=4,predictedLabel:r="Predicted Objective",description:s="",legends:d=[{label:"CSAT",value:3},{label:"Resolution",value:4},{label:"Process Adherence",value:5},{label:"Communication",value:3}]})=>(String(i).padStart(2,"0"),e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,borderRadius:8,border:`1px solid ${A.absent}`,background:A.white,alignSelf:"stretch",flex:1,gap:24},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx("span",{style:{fontSize:15,fontWeight:600,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Compass Score"}),e.jsx("span",{style:{fontSize:14,fontWeight:400,color:A.muted,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:s})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:24,flex:1,overflow:"hidden"},children:[e.jsxs("div",{style:{position:"relative",maxWidth:243,minWidth:160,flex:"0 1 243px",flexDirection:"column",alignItems:"center",display:"flex"},children:[e.jsx(qt,{score:t,maxScore:n}),(()=>{const b=-(180-(n>0?Math.min(t/n,1):0)*180-45);return e.jsxs("svg",{width:"34",height:"35",viewBox:"0 0 34 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{marginTop:-24,transform:`rotate(${b}deg)`,transformOrigin:"center center"},children:[e.jsx("path",{d:"M16 25.2169C19.958 25.2169 23.1667 22.0083 23.1667 18.0503C23.1667 14.0922 19.958 10.8836 16 10.8836C12.042 10.8836 8.83334 14.0922 8.83334 18.0503C8.83334 22.0083 12.042 25.2169 16 25.2169Z",fill:"var(--rail-orange, #C98A5A)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.4791 11.2328L33.4351 0L21.6888 3.09113C19.9212 2.41855 18.0036 2.05025 16 2.05025C7.16344 2.05025 0 9.2137 0 18.0503C0 26.8868 7.16344 34.0503 16 34.0503C24.8366 34.0503 32 26.8868 32 18.0503C32 15.6119 31.4546 13.301 30.4791 11.2328ZM16 30.5503C22.9036 30.5503 28.5 24.9538 28.5 18.0503C28.5 11.1467 22.9036 5.55025 16 5.55025C9.09644 5.55025 3.5 11.1467 3.5 18.0503C3.5 24.9538 9.09644 30.5503 16 30.5503Z",fill:"var(--rail-orange, #C98A5A)"})]})})(),e.jsx("div",{style:{fontSize:28,fontWeight:400,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:1,textAlign:"center",marginTop:8},children:t})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center",justifyContent:"center",flex:1},children:[e.jsx("div",{style:{fontSize:15,fontWeight:500,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textAlign:"center"},children:"Overall Score"}),e.jsx("div",{style:{width:"100%",height:1,background:A.absent}}),d.map((y,v)=>e.jsx(Zt,{label:y.label,value:y.value},v))]})]})]})),je=t=>{if(!t)return null;const n=String(t).toLowerCase();return n==="supervisor"?"var(--rail-compliance, #C98A5A)":n==="admin"||n==="administrator"?"var(--rail-discovery, #5E88B0)":n==="agent"?"var(--rail-outcome, #6B7C93)":null},ae=t=>(t||"").split(" ").map(n=>n[0]).join("").toUpperCase()||"U",Qt=t=>{if(!t||t==="Just now")return!0;if(/^\d{4}-\d{2}-\d{2}T/.test(t))try{const i=/Z$|[+-]\d{2}:\d{2}$/.test(t)?t:t+"Z",r=new Date(i);return Number.isNaN(r.getTime())?!1:Date.now()-r.getTime()<15*60*1e3}catch{return!1}const n=t.match(/^(\d+)\s*min/);return n?parseInt(n[1],10)<15:!(/\d+\s*h/.test(t)||/\d+\s*day/.test(t))},Jt=t=>{if(!t)return"";if(!/^\d{4}-\d{2}-\d{2}T/.test(t))return t;try{const n=/Z$|[+-]\d{2}:\d{2}$/.test(t)?t:t+"Z",i=new Date(n);if(Number.isNaN(i.getTime()))return t;const s=new Date().getTime()-i.getTime(),d=Math.floor(s/6e4),y=Math.floor(s/36e5);if(d<1)return"Just now";if(d<60)return`${d} min`;if(y<24)return`${y} h`;const v=Math.floor(y/24);return v===1?"1 day":`${v} days`}catch{return t}},et=({name:t,initials:n,color:i,avatar:r,size:s=36})=>r?e.jsx("img",{src:r,alt:t,style:{width:s,height:s,borderRadius:"50%",objectFit:"cover",flexShrink:0}}):e.jsx("div",{style:{width:s,height:s,borderRadius:"50%",background:i||"#6B7C93",color:"#FFF",display:"flex",alignItems:"center",justifyContent:"center",fontSize:s<=32?"10px":"11px",fontWeight:650,flexShrink:0,fontFamily:"var(--default-font-family)",letterSpacing:"0.02em"},title:t,children:n||ae(t)}),Ut=({comment:t,isReply:n=!1,onReply:i,onSendReply:r,onEdit:s,onDelete:d,onMenuClick:y,showReply:v=!0})=>{var ne,ce;const[b,j]=f.useState(!1),[W,k]=f.useState(!1),[c,w]=f.useState(!1),[m,x]=f.useState(""),[z,F]=f.useState(!1),[C,_]=f.useState(""),[M,L]=f.useState(!1),T=f.useRef(null),u=f.useRef(null),p=t.author||{},o=p.name||t.author_name||"Unknown",R=p.initials||ae(o),$=p.role||t.author_role,q=p.color||je($)||"#6B7C93",Z=p.avatar||t.avatar,l=t.timestamp||t.created_at,P=Jt(l),H=Qt(l),de=Array.isArray(t.content)?t.content:[t.content||t.text||""];return f.useEffect(()=>{if(!W)return;const a=Q=>{T.current&&!T.current.contains(Q.target)&&k(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[W]),e.jsxs("div",{onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),style:{display:"flex",paddingLeft:n?48:0,alignItems:"flex-start",gap:16,paddingTop:8,paddingBottom:8},children:[e.jsx(et,{name:o,initials:R,color:q,avatar:Z}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:6},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[e.jsx("span",{style:{fontSize:13,fontWeight:650,color:"var(--text-ink, #1E2125)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:o}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:P}),(t.isEdited||t.is_edited)&&e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:"(Edited)"})]}),e.jsxs("div",{style:{position:"relative"},ref:T,children:[e.jsx("button",{type:"button",onClick:()=>k(a=>!a),style:{padding:2,border:"none",background:"transparent",cursor:"pointer",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",opacity:b||W?1:0,transition:"opacity 0.15s",flexShrink:0},children:e.jsx(h.Ellipsis,{size:24,color:"var(--Grey-Muted, #808183)"})}),W&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,display:"flex",width:99,flexDirection:"column",alignItems:"flex-start",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxShadow:"-2px 2px 2px 0 rgba(0, 0, 0, 0.25)",zIndex:50,overflow:"hidden"},children:[i&&e.jsx("button",{type:"button",onClick:()=>{k(!1),F(!1),w(!0)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left"},onMouseEnter:a=>{a.currentTarget.style.background="var(--surface-hover, #F3F7F7)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:"Reply"}),s&&e.jsx("button",{type:"button",disabled:!H,onClick:()=>{if(!H)return;k(!1);const a=Array.isArray(t.content)?t.content.join(`
16
- `):t.content||t.text||"";_(a),F(!0),w(!1)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:H?"pointer":"not-allowed",fontSize:13,fontWeight:400,color:H?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left",opacity:H?1:.5},onMouseEnter:a=>{H&&(a.currentTarget.style.background="var(--surface-hover, #F3F7F7)")},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:"Edit"}),d&&e.jsx("button",{type:"button",onClick:()=>{k(!1),L(!0)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left"},onMouseEnter:a=>{a.currentTarget.style.background="var(--surface-hover, #F3F7F7)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:"Delete"})]})]})]}),z?e.jsxs("div",{style:{display:"flex",width:662,maxWidth:"100%",padding:"8px 12px 12px 12px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box",marginTop:4},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"normal"},children:["“"," ",((ne=t.author)==null?void 0:ne.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>F(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(h.X,{size:20,color:"var(--Grey-Muted, #808183)"})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%"},children:[e.jsx("input",{value:C,onChange:a=>_(a.target.value),onKeyDown:a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),C.trim()&&(s==null||s({...t,content:C.trim(),isEdited:!0}),F(!1))),a.key==="Escape"&&F(!1)},autoFocus:!0,style:{flex:1,padding:"10px 12px",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",border:"none",background:"transparent",outline:"none",boxSizing:"border-box"}}),e.jsx("button",{type:"button",onClick:()=>{C.trim()&&(s==null||s({...t,content:C.trim(),isEdited:!0}),F(!1))},disabled:!C.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:C.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:C.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:C.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",flexShrink:0,transition:"all 0.15s",lineHeight:"150%"},children:"Save"})]})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"flex-start"},children:de.map((a,Q)=>e.jsx("div",{style:{fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",lineHeight:"160%",fontFamily:"var(--default-font-family)",padding:"8px 12px",background:n?"var(--surface-hover, #F3F7F7)":"var(--surface-warm-40, rgba(243, 241, 229, 0.40))",borderRadius:8,wordBreak:"break-word"},children:a},Q))}),M&&e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,marginTop:8,fontSize:13,fontFamily:"var(--default-font-family)"},children:[e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontWeight:400},children:"Confirm: delete this comment?"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),d==null||d(t)},style:{background:"var(--grey-light, #e9e8e8a1)",border:"none",cursor:"pointer",fontSize:13,fontWeight:600,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",padding:"4px 10px",borderRadius:6,transition:"background 0.15s"},onMouseEnter:a=>{a.currentTarget.style.background="var(--Grey-absent, #D9D9D9)"},onMouseLeave:a=>{a.currentTarget.style.background="var(--grey-light, #e9e8e8a1)"},children:"Yes"}),e.jsx("button",{type:"button",onClick:()=>L(!1),style:{background:"none",border:"none",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",padding:"4px 10px",borderRadius:6,transition:"background 0.15s"},onMouseEnter:a=>{a.currentTarget.style.background="var(--grey-light, #e9e8e8a1)"},onMouseLeave:a=>{a.currentTarget.style.background="none"},children:"No"})]}),v&&i&&!c&&!M&&e.jsxs("button",{type:"button",onClick:()=>{F(!1),w(!0)},style:{display:"flex",alignItems:"center",gap:6,marginTop:8,padding:0,border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",transition:"color 0.15s"},children:[e.jsx(h.CornerDownRight,{size:20,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),"Reply"]}),c&&e.jsxs("div",{style:{display:"flex",width:662,maxWidth:"100%",padding:"8px 12px 12px 12px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box",marginTop:12},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"normal"},children:["“"," ",((ce=t.author)==null?void 0:ce.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>{x(""),w(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(h.X,{size:20,color:"var(--Grey-Muted, #808183)"})})]}),e.jsx("div",{style:{display:"flex",height:36,padding:16,alignItems:"center",gap:5,borderRadius:"0 8px 8px 8px",background:"var(--Grey-Strong, #2E3236)",boxSizing:"border-box",width:"100%"},children:e.jsx("span",{style:{color:"var(--Grey-White, #FFF)",fontSize:13,fontWeight:400,fontFamily:"var(--default-font-family)",lineHeight:"normal",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Array.isArray(t.content)?t.content[0]:t.content})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%"},children:[e.jsx("input",{ref:u,value:m,onChange:a=>x(a.target.value),onKeyDown:a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),m.trim()&&(r==null||r({content:m.trim(),parentId:t.id}),x(""),w(!1))),a.key==="Escape"&&(x(""),w(!1))},autoFocus:!0,placeholder:"Add a reply",style:{flex:1,padding:"10px 12px",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",border:"none",background:"transparent",outline:"none",boxSizing:"border-box"}}),e.jsx("button",{type:"button",onClick:()=>{m.trim()&&(r==null||r({content:m.trim(),parentId:t.id}),x(""),w(!1))},disabled:!m.trim(),style:{display:"flex",height:28,padding:"8px 12px",justifyContent:"center",alignItems:"center",gap:8,fontSize:13,fontWeight:600,color:m.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:m.trim()?"var(--Neutral-850, #272727)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:10,cursor:m.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Post"})]})]})]})]})},Xt=({currentUser:t,onSubmit:n})=>{const[i,r]=f.useState(""),[s,d]=f.useState(!1),y=f.useRef(null),v=()=>{const c=i.trim();c&&(n==null||n(c),r(""))},b=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),v())},j=(t==null?void 0:t.initials)||ae(t==null?void 0:t.name),W=(t==null?void 0:t.color)||je(t==null?void 0:t.role)||"#6B7C93",k=t==null?void 0:t.avatar;return e.jsxs("div",{style:{display:"flex",gap:16,alignItems:"flex-start"},children:[e.jsx(et,{name:t==null?void 0:t.name,initials:j,color:W,avatar:k}),e.jsx("div",{style:{flex:1,padding:12,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:s?"1px solid var(--Grey-Strong, #2E3236)":"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",transition:"border-color 0.15s"},children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:8,width:"100%"},children:[e.jsx("textarea",{ref:y,value:i,onChange:c=>r(c.target.value),onFocus:()=>d(!0),onBlur:()=>d(!1),onKeyDown:b,placeholder:"Add a comment",rows:1,style:{flex:1,border:"none",outline:"none",resize:"none",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",background:"transparent",padding:0,minHeight:24}}),e.jsx("button",{type:"button",onClick:v,disabled:!i.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:i.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:i.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:i.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",transition:"all 0.15s",flexShrink:0,lineHeight:"150%"},children:"Post"})]})})]})},tt=({comment:t,depth:n=0,onReply:i,onSendReply:r,onEdit:s,onDelete:d,onMenuClick:y})=>{const v=t.replies&&t.replies.length>0,b=!v;return e.jsxs(f.Fragment,{children:[e.jsx("div",{style:{paddingLeft:n>0?Math.min(n*32,128):0},children:e.jsx(Ut,{comment:t,isReply:n>0,onReply:i,onSendReply:r,onEdit:s,onDelete:d,onMenuClick:y,showReply:b})}),v&&t.replies.map(j=>e.jsx(tt,{comment:j,depth:n+1,onReply:i,onSendReply:r,onEdit:s,onDelete:d,onMenuClick:y},j.id))]})},nt=({comments:t=[],totalComments:n,onSendComment:i,onReply:r,onSendReply:s,onEdit:d,onDelete:y,onMenuClick:v,onMarkResolved:b,currentUser:j,isResolved:W=!1})=>{const[k,c]=f.useState([]),[w,m]=f.useState(!1),x=f.useMemo(()=>{const u=new Set(t.map(o=>o.id)),p=k.filter(o=>!u.has(o.id));return[...t,...p]},[t,k]);f.useEffect(()=>{const u=new Set(t.map(p=>p.id));c(p=>p.filter(o=>!u.has(o.id)))},[t]);const z=f.useMemo(()=>{if(!j)return{name:"You",initials:"YO",color:"#6B7C93"};const u=j.name||"You",p=j.initials||ae(u),o=j.role&&String(j.role).toLowerCase(),R=j.color||je(o)||"#6B7C93";return{...j,name:u,initials:p,color:R}},[j]),F=async({content:u,parentId:p})=>{if(s){m(!0);try{await s({content:u,parentId:p})}finally{m(!1)}}else{const o={id:`temp-${Date.now()}`,author:z,content:u,timestamp:"Just now",parentId:p,isOptimistic:!0};c(R=>[...R,o])}},C=async u=>{if(i){m(!0);try{await i(u)}finally{m(!1)}}else{const p={id:`temp-${Date.now()}`,author:z,content:u,timestamp:"Just now",isOptimistic:!0};c(o=>[...o,p])}},_=u=>{c(p=>p.map(o=>o.id===u.id?{...o,content:u.content,isEdited:!0}:o)),d==null||d(u)},M=u=>{c(p=>p.filter(o=>o.id!==u.id)),y==null||y(u)},L=f.useMemo(()=>{const u={};x.forEach(o=>{o.parentId&&(u[o.parentId]||(u[o.parentId]=[]),u[o.parentId].push(o))});const p=o=>({...o,replies:(u[o.id]||[]).map(p)});return x.filter(o=>!o.parentId).map(p)},[x]),T=n??x.length;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",background:"var(--Grey-White, #FFF)",width:"100%",fontFamily:"var(--default-font-family)"},children:[e.jsxs("div",{style:{display:"flex",height:40,paddingBottom:8,alignItems:"center",gap:16,alignSelf:"stretch",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",justifyContent:"space-between"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(h.MessagesSquare,{size:24,color:"var(--rail-orange, #C98A5A)",strokeWidth:1.5}),e.jsxs("span",{style:{fontSize:14,fontWeight:650,color:"var(--Grey-Strong, #2E3236)",letterSpacing:"0.08em",textTransform:"uppercase",lineHeight:"150%"},children:["COMMENTS",T>0?` (${T<10?"0":""}${T})`:""]})]}),W?e.jsxs("div",{style:{display:"inline-flex",height:32,padding:"12px 16px 12px 12px",justifyContent:"flex-end",alignItems:"center",gap:8,borderRadius:10,background:"var(--Rail-Surface-2, #E3E1D7)",flexShrink:0},children:[e.jsx(h.Check,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:2}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Resolved"})]}):b?e.jsxs("button",{type:"button",onClick:b,style:{display:"flex",alignItems:"center",gap:8,padding:"8px 16px",fontSize:13,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:20,cursor:"pointer",fontFamily:"var(--default-font-family)",transition:"background 0.15s",lineHeight:"150%",flexShrink:0},children:[e.jsx(h.CircleCheck,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5}),"Mark as Resolved"]}):null]}),e.jsx("div",{style:{display:"flex",paddingTop:24,flexDirection:"column",alignItems:"flex-start",gap:10,alignSelf:"stretch",borderTop:"1px solid var(--Grey-absent, #D9D9D9)"},children:e.jsxs("div",{style:{width:662,maxWidth:"100%"},children:[x.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:0,marginBottom:24,maxHeight:600,overflowY:x.length>6?"auto":"visible"},children:L.map(u=>e.jsx(tt,{comment:u,depth:0,onReply:r,onSendReply:F,onEdit:_,onDelete:M,onMenuClick:v},u.id))}),x.length>0&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:16,marginLeft:48},children:[e.jsx(h.Info,{size:16,color:"var(--Grey-Muted, #808183)"}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontSize:13,fontStyle:"normal",fontWeight:400,lineHeight:"normal"},children:"Comments can be edited within 15 minutes."})]}),w&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0"},children:[e.jsx("div",{style:{width:16,height:16,border:"2px solid var(--Grey-absent, #D9D9D9)",borderTopColor:"var(--Grey-Strong, #2E3236)",borderRadius:"50%",animation:"spin 0.8s linear infinite"}}),e.jsx("span",{style:{fontSize:13,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)"},children:"Sending..."}),e.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}),e.jsx(Xt,{currentUser:z,onSubmit:C})]})})]})},te=({text:t,children:n})=>{const[i,r]=f.useState(!1),s=f.useRef(null),[d,y]=f.useState({top:0,left:0});if(!t)return n;const v=()=>{if(s.current){const b=s.current.getBoundingClientRect();y({top:b.top-2,left:b.left+b.width/2})}r(!0)};return e.jsxs("div",{ref:s,style:{position:"relative",display:"inline-flex"},onMouseEnter:v,onMouseLeave:()=>r(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:d.top,left:d.left,transform:"translate(-50%, -100%)",display:"flex",padding:10,alignItems:"center",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-Strong, #2E3236)",zIndex:9999,pointerEvents:"none",whiteSpace:"nowrap"},children:e.jsx("span",{style:{color:"#FFF",fontSize:12,fontWeight:400,lineHeight:"normal"},children:t})})]})},en=[{key:"overview",label:"Overview"},{key:"coaching",label:"Coaching Summary"},{key:"signals",label:"Signals & Recording"},{key:"comments",label:"Comments"}],tn=({title:t="Wheel Stud Replacement Enquiry",onBack:n,data:i,coachingData:r,coachingLoading:s=!1,audioUrl:d,audioRef:y,currentTimeSeconds:v,timelinePlaying:b,playbackRate:j,timelineSegments:W,onSeek:k,onTogglePlay:c,onSeekBack:w,onSeekForward:m,onSetPlaybackRate:x,agentName:z,agentFullName:F,customerName:C,customerFullName:_,transcript:M,activeTurnIndex:L,turnObservations:T,highlightedTurns:u,onTurnPlayPause:p,onPlayEvidence:o,onHighlightTurns:R,callPurpose:$,classification:q,outcomeQuality:Z,resolutionOutcome:l,customerIntent:P,interactionId:H,moreDetails:de,compassScore:ne,compassMaxScore:ce=10,predictedCsat:a,predictedLabel:Q="Predicted Objective",compassLegends:it,customerSessions:st,customerSessionCount:rt,onSessionClick:Se,onViewAllSessions:ke,prevSessionDesc:ot,prevSessionDisabled:ie=!1,nextSessionDesc:lt,nextSessionDisabled:se=!1,onPreviousSession:we,onNextSession:Ce,comments:Fe=[],currentUser:at,onSendComment:dt,onSendReply:ct,onReply:ft,onEdit:pt,onDelete:gt,onMenuClick:ht,onMarkResolved:ut,commentsResolved:yt})=>{var Ae,Le;const[fe,De]=f.useState("overview"),[xt,Ie]=f.useState(new Set),[We,pe]=f.useState(!1),[ze,Ge]=f.useState(null),[mt,Me]=f.useState(!1),[vt,bt]=f.useState(0),J=f.useRef(null),ge=f.useRef(null),he=f.useRef(null),ue=f.useRef(null),ye=f.useRef(null),jt={overview:ge,coaching:he,signals:ue,comments:ye},xe=f.useRef(null),me=f.useRef(!1);f.useEffect(()=>{const g=xe.current;if(!g)return;const D=["overview","coaching","signals","comments"],I=[ge,he,ue,ye],B=(V=>{let N=V.parentElement;for(;N;){const{overflow:le,overflowY:Be}=window.getComputedStyle(N);if(/(auto|scroll)/.test(le+Be))return N;N=N.parentElement}return null})(g),Y=()=>{if(me.current)return;let V=D[0];for(let N=I.length-1;N>=0;N--){const le=I[N].current;if(!le)continue;if(le.getBoundingClientRect().top<=150){V=D[N];break}}De(V)};return g.addEventListener("scroll",Y,{passive:!0}),B&&B!==g&&B.addEventListener("scroll",Y,{passive:!0}),window.addEventListener("scroll",Y,{passive:!0,capture:!0}),()=>{g.removeEventListener("scroll",Y),B&&B!==g&&B.removeEventListener("scroll",Y),window.removeEventListener("scroll",Y,{capture:!0})}},[]);const St=g=>{var I;De(g),me.current=!0;const D=(I=jt[g])==null?void 0:I.current;if(D){const K=xe.current;if(K&&K.scrollHeight>K.clientHeight){const B=K.getBoundingClientRect().top,V=D.getBoundingClientRect().top-B+K.scrollTop-16;K.scrollTo({top:V,behavior:"smooth"})}else{const B=D.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:B,behavior:"smooth"})}}setTimeout(()=>{me.current=!1},800)},Ee=st||[],kt=g=>{var I;const D=g/1e3;(I=J.current)!=null&&I.scrollToTranscript&&J.current.scrollToTranscript(D)},wt=g=>{var D;if(o)o(g);else{const I=g.start_ms??g.startMs;if(I!=null&&((D=J.current)!=null&&D.seekTo)){J.current.seekTo(I/1e3),Me(!0),bt(I/1e3);const B=(g.end_ms??g.endMs??I+5e3)-I;setTimeout(()=>Me(!1),B)}}},Ct=g=>{R&&R(g)},Ft=g=>{Ie(D=>{const I=new Set(D);return I.has(g)?I.delete(g):I.add(g),I})},Dt=(i==null?void 0:i.blocks)||[],U=g=>{var D;return((D=Dt.find(I=>I.block_id===g))==null?void 0:D.payload)||{}},O=U("interaction-metadata"),X=U("interaction-context"),re=U("interaction-signals"),_e=U("interaction-outcome-lift"),It=U("interaction-dimensions").dimensions||[],Wt=X.call_purpose||{},zt=X.classification||{},Te={duration_seconds:156,message_count:25,...O},Re={interaction_driver:"General Information",interaction_direction:"inbound",...Wt},Gt={interaction_paradigm:"Informational",...zt},Mt={p_expected:.94,p_full:.83,lift_raw:-.11,lift:.043,interpretation:{lift_band:"positive"},..._e},Et=((Ae=_e.driver_signal_keys)==null?void 0:Ae.map(g=>g.replace(/^sig\./,"").replace(/_/g," ")))||["customer needs fully addressed","call flow expectations set","Opening expectations set","Active listening demonstrated","Resolution confirmed"],_t=r||{one_liner:"David provided the customer with information on wheel stud replacement and pricing, but did not secure an appointment.",context:"The customer was seeking information on wheel stud replacement for a 2013 Chevy Bolt and was unsure about doing the repair themselves.",strengths:[{text:"Anthony effectively scheduled the appointment and confirmed the details clearly.",quote:"Alright. That is all set up for Saturday, the twenty eighth, at 12:00."},{text:"Handled customer objections well by explaining the need for a separate appointment for alignment.",quote:"I don't have the alignment changeover the weekend. So I would have to set up a separate appointment for the alignment."},{text:"Demonstrated courtesy and professionalism throughout the call.",quote:"Have a great day."}],improvements:[{text:"Close the loop by restating the plan and confirming next steps to ensure customer certainty.",quote:"Alright. That is all set up for Saturday, the twenty eighth, at 12:00."},{text:"Frame solutions positively by leading with what can be done rather than limitations.",quote:"I don't have the alignment changeover the weekend."}],overall:"effective"},Tt=(Le=re==null?void 0:re.signals)!=null&&Le.length?re:{present_count:9,total_signals_evaluated:146,signals:[{key:"price_estimate_provided",display_name:"Price Estimate Provided",observations:[{key:"obs1",reason:"Evidence shows a price estimate or quote was provided.",evidence:[{start_ms:92e3,end_ms:97e3,text:"From Casper, you're probably looking at, like, a half hour labor plus a stud, so you'd probably be somewhere around $90 or something.",turn_ids:[8]}]}]},{key:"fee_or_cost_discussed",display_name:"Fee or Cost Discussed",observations:[{key:"obs2",reason:"Agent discussed pricing details with the customer."}]},{key:"engagement_budget",display_name:"Engagement Budget Discussed",observations:[{key:"obs3a",reason:"Budget expectations were set."},{key:"obs3b",reason:"Customer confirmed budget range."}]},{key:"projected_revenue",display_name:"Projected Revenue Discussed",observations:[{key:"obs4a",reason:"Revenue projection shared."},{key:"obs4b",reason:"Timeline for revenue discussed."},{key:"obs4c",reason:"Quarterly targets mentioned."}]},{key:"market_analysis",display_name:"Market Analysis Completed",observations:[{key:"obs5a",reason:"Market analysis referenced."},{key:"obs5b",reason:"Competitive landscape discussed."},{key:"obs5c",reason:"Market trends mentioned."},{key:"obs5d",reason:"Regional analysis provided."}]},{key:"target_audience",display_name:"Target Audience Defined",observations:[{key:"obs6a",reason:"Target audience identified."},{key:"obs6b",reason:"Demographics discussed."},{key:"obs6c",reason:"Audience segmentation reviewed."},{key:"obs6d",reason:"Persona mapping completed."},{key:"obs6e",reason:"Channel preferences noted."}]},{key:"concept_approval",display_name:"Concept Approval Received",observations:[{key:"obs7a",reason:"Concept approved by stakeholder."},{key:"obs7b",reason:"Feedback incorporated."},{key:"obs7c",reason:"Sign-off confirmed."},{key:"obs7d",reason:"Revisions requested."},{key:"obs7e",reason:"Final version accepted."},{key:"obs7f",reason:"Timeline approved."}]},{key:"prototype_developed",display_name:"Prototype Developed",observations:[{key:"obs8a",reason:"Prototype shared."},{key:"obs8b",reason:"Testing initiated."},{key:"obs8c",reason:"Feedback collected."},{key:"obs8d",reason:"Iterations completed."},{key:"obs8e",reason:"Usability tested."},{key:"obs8f",reason:"Design finalized."},{key:"obs8g",reason:"Stakeholder demo done."}]},{key:"user_testing",display_name:"User Testing Scheduled",observations:[{key:"obs9a",reason:"Testing sessions planned."},{key:"obs9b",reason:"Participants recruited."},{key:"obs9c",reason:"Test scripts prepared."},{key:"obs9d",reason:"Environment set up."},{key:"obs9e",reason:"Accessibility testing included."},{key:"obs9f",reason:"Results framework defined."},{key:"obs9g",reason:"Timeline confirmed."},{key:"obs9h",reason:"Backup plan discussed."}]}]},ve=z||O.agent_name||O.agent||X.agent_name||"Agent",Rt=F||O.agent_full_name||O.agent_name||ve,ee=C||O.customer_name||O.customer||X.customer_name||"Customer",He=_||O.customer_full_name||O.customer_name||ee,be=rt??Ee.length,oe=O.created_dt||(i==null?void 0:i.created_dt)||X.created_dt||"",Ht=oe?new Date(/Z$|[+-]\d{2}:\d{2}$/.test(oe)?oe:oe+"Z").toLocaleString():"",At=Re.interaction_direction==="inbound"?"Inbound":"Outbound";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",background:"var(--Grey-White, #FFF)"},children:[e.jsxs("div",{style:{position:"sticky",top:0,zIndex:20,background:"var(--Grey-White, #FFF)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"24px 24px 0"},children:[e.jsx("button",{onClick:n,style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0,flexShrink:0},children:e.jsx(h.ArrowLeft,{size:24,color:"var(--Grey-Strong, #2E3236)"})}),e.jsx("div",{style:{width:1,height:28,background:"var(--Base-absent, #D9D9D9)"}}),e.jsx("h1",{style:{color:"var(--Grey-Strong, #2E3236)",fontSize:24,fontStyle:"normal",fontWeight:400,lineHeight:"normal",margin:0,flex:1},children:t}),(we||Ce)&&e.jsxs("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[e.jsx(te,{text:ot,children:e.jsxs("button",{onClick:ie?void 0:we,disabled:ie,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:ie?"default":"pointer",opacity:ie?.4:1},children:[e.jsx(h.ArrowLeft,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5}),e.jsx("span",{style:{color:"var(--Neutral-800, #323232)",fontSize:13,fontWeight:400,lineHeight:"24px",fontFamily:"var(--default-font-family)",whiteSpace:"nowrap"},children:"Previous Session"})]})}),e.jsx("div",{style:{width:1,height:20,background:"var(--Grey-absent, #D9D9D9)",flexShrink:0}}),e.jsx(te,{text:lt,children:e.jsxs("button",{onClick:se?void 0:Ce,disabled:se,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:se?"default":"pointer",opacity:se?.4:1},children:[e.jsx("span",{style:{color:"var(--Neutral-800, #323232)",fontSize:13,fontWeight:400,lineHeight:"24px",fontFamily:"var(--default-font-family)",whiteSpace:"nowrap"},children:"Next Session"}),e.jsx(h.ArrowRight,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5})]})})]})]}),e.jsx("div",{style:{display:"flex",alignItems:"flex-start",background:"var(--Grey-White, #FFF)",borderBottom:"1px solid var(--Grey-Faint, #ACADAD)",padding:"0 24px",marginTop:8},children:en.map(g=>e.jsx("button",{onClick:()=>St(g.key),style:{display:"flex",padding:16,alignItems:"center",gap:10,background:"none",border:"none",borderBottom:fe===g.key?"3px solid var(--Grey-Strong, #2E3236)":"3px solid transparent",cursor:"pointer",fontSize:15,fontWeight:fe===g.key?500:400,color:fe===g.key?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",whiteSpace:"nowrap",transition:"border-color 0.2s ease, color 0.2s ease"},children:g.label},g.key))})]}),e.jsxs("div",{ref:xe,style:{padding:24,flex:1,overflowY:"auto"},children:[e.jsxs("div",{ref:ge,style:{display:"flex",flexDirection:"column",justifyContent:"flex-end",alignItems:"flex-start",gap:24,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",height:40,alignItems:"center",gap:16,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1},children:[e.jsx(h.ClipboardList,{size:24,color:"var(--rail-orange, #C98A5A)",strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,textTransform:"uppercase"},children:"Overview"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0"},children:[e.jsx(h.CalendarDays,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:Ht})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0"},children:[e.jsx(h.PhoneIncoming,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:At})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingLeft:16,borderLeft:"1px solid var(--Grey-absent, #D9D9D9)"},children:[e.jsx(te,{text:Rt,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0",cursor:"pointer"},children:[e.jsx(h.Headset,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:ve})]})}),e.jsx(h.Repeat,{size:16,color:"var(--color-input-border, #ACACAD)",strokeWidth:1.5}),be>1?e.jsxs("div",{style:{position:"relative"},children:[e.jsx(te,{text:He,children:e.jsxs("button",{onClick:()=>pe(g=>!g),style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",background:"none",border:"none",cursor:"pointer"},children:[e.jsx(h.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:[ee," (",be," Sessions)"]}),We?e.jsx(h.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(h.ChevronDown,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5})]})}),We&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,width:264,background:"var(--Grey-White, #FFF)",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",zIndex:50,overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,padding:16},children:[e.jsx(h.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5,style:{marginTop:2,flexShrink:0}}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1},children:ee}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1},children:[be," Sessions in past"]})]})]}),Ee.slice(0,5).map((g,D)=>e.jsxs("div",{onClick:()=>{Se&&Se(g),pe(!1)},onMouseEnter:()=>Ge(D),onMouseLeave:()=>Ge(null),style:{display:"flex",width:264,padding:"12px 16px",justifyContent:"space-between",alignItems:"center",background:ze===D?"var(--surface-hover, #F3F7F7)":"var(--Grey-White, #FFF)",borderTop:"1px solid var(--Grey-absent, #D9D9D9)",cursor:"pointer",boxSizing:"border-box",transition:"background 0.15s"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1},children:g.title}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1},children:g.date})]}),ze===D&&e.jsx(h.ExternalLink,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1,style:{flexShrink:0}})]},g.id||D)),e.jsx("div",{style:{padding:16,borderTop:"1px solid var(--Grey-absent, #D9D9D9)",display:"flex",justifyContent:"center"},children:e.jsxs("button",{onClick:()=>{ke&&ke(),pe(!1)},style:{display:"flex",height:32,padding:"16px 16px 16px 12px",justifyContent:"center",alignItems:"center",gap:6,background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:10,cursor:"pointer"},children:[e.jsx(h.History,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--Grey-Strong, #2E3236)"},children:"View All Sessions"})]})})]})]}):e.jsx(te,{text:He,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",cursor:"pointer"},children:[e.jsx(h.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:ee})]})})]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"stretch",gap:24,alignSelf:"stretch"},children:[e.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:e.jsx(Xe,{score:ne??0,maxScore:5,predictedScore:a??0,predictedLabel:Q,legends:it})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"flex-end",gap:24,flex:1,minWidth:0},children:[e.jsx(Qe,{meta:Te,callPurpose:$||Re,classification:q||Gt,outcomeQuality:Z||"Neutral",dimensions:It,resolutionOutcome:l,customerIntent:P,interactionId:H??O.interaction_id,moreDetails:de}),e.jsx(Je,{outcomeLift:Mt,driverLabels:Et})]})]})]}),e.jsx("div",{ref:he,style:{paddingTop:24},children:e.jsx(Ze,{data:s?null:_t,loading:s})}),e.jsxs("div",{ref:ue,style:{display:"flex",flexDirection:"column",gap:16,alignSelf:"stretch",paddingTop:24},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(h.FileSignal,{size:24,color:"#C98A5A",strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,textTransform:"uppercase"},children:"Signals & Recording"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:24,alignSelf:"stretch",paddingTop:16,borderTop:"1px solid #D9D9D9"},children:[e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(Ue,{signals:Tt,expandedSignals:xt,toggleSignal:Ft,playEvidence:wt,highlightTurns:Ct,onShowInTranscript:kt,timelinePlaying:b||mt,currentTimeSeconds:v??vt})}),e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(Ve.UpdatedInteractionRecording,{ref:J,audioUrl:d,durationSeconds:Te.duration_seconds,audioRef:y,agentName:ve,customerName:ee.split(" ")[0],currentTimeSeconds:v,timelinePlaying:b,playbackRate:j,timelineSegments:W,onSeek:k,onTogglePlay:c,onSeekBack:w,onSeekForward:m,onSetPlaybackRate:x,transcript:M,activeTurnIndex:L,turnObservations:T,highlightedTurns:u,onTurnPlayPause:p,setExpandedSignals:Ie})})]})]}),e.jsx("div",{ref:ye,style:{paddingTop:24},children:e.jsx(nt,{comments:Fe,totalComments:Fe.length,currentUser:at,onSendComment:dt||(()=>{}),onSendReply:ct||(()=>{}),onReply:ft||(()=>{}),onEdit:pt||(()=>{}),onDelete:gt||(()=>{}),onMenuClick:ht||(()=>{}),onMarkResolved:ut||(()=>{}),isResolved:yt})})]})]})};exports.UpdatedInteractionRecording=Ve.UpdatedInteractionRecording;exports.UpdatedCoachingSynthesisCard=Ze;exports.UpdatedCompassScore=Xe;exports.UpdatedInteractionContext=Qe;exports.UpdatedInteractionDetails=tn;exports.UpdatedInteractionScores=Je;exports.UpdatedInteractionSignals=Ue;exports.UpdatedThreads=nt;
15
+ `}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,padding:"48px 24px"},children:[e.jsxs("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"coaching-spinner-spin 1.2s linear infinite"},children:[e.jsx("path",{d:"M43 24C43 26.4951 42.5086 28.9658 41.5537 31.271C40.5989 33.5762 39.1993 35.6707 37.435 37.435C35.6707 39.1993 33.5762 40.5989 31.271 41.5537C28.9658 42.5086 26.4951 43 24 43C21.5049 43 19.0342 42.5086 16.729 41.5537C14.4238 40.5989 12.3293 39.1993 10.565 37.435C8.80066 35.6707 7.40113 33.5762 6.44629 31.271C5.49145 28.9658 5 26.4951 5 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M12 24C12 22.4241 12.3104 20.8637 12.9134 19.4078C13.5165 17.9519 14.4004 16.629 15.5147 15.5147C16.629 14.4004 17.9519 13.5165 19.4078 12.9134C20.8637 12.3104 22.4241 12 24 12C25.5759 12 27.1363 12.3104 28.5922 12.9134C30.0481 13.5165 31.371 14.4004 32.4853 15.5147C33.5996 16.629 34.4835 17.9519 35.0866 19.4078C35.6896 20.8637 36 22.4241 36 24",stroke:"#00A66E",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M20 24C20 24.5253 20.1035 25.0454 20.3045 25.5307C20.5055 26.016 20.8001 26.457 21.1716 26.8284C21.543 27.1999 21.984 27.4945 22.4693 27.6955C22.9546 27.8965 23.4747 28 24 28C24.5253 28 25.0454 27.8965 25.5307 27.6955C26.016 27.4945 26.457 27.1999 26.8284 26.8284C27.1999 26.457 27.4945 26.016 27.6955 25.5307C27.8965 25.0454 28 24.5253 28 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"})]}),e.jsx("span",{style:{fontSize:14,color:M.muted,fontWeight:500,textAlign:"center"},children:"Synthesizing coaching summary..."})]})]});if(i)return e.jsx("div",{style:{fontSize:14,color:M.muted},children:"Unable to generate coaching summary."});if(!t)return null;const l=t.strengths||[],r=t.improvements||[],a=typeof t.one_liner=="string"?t.one_liner:((v=t.one_liner)==null?void 0:v.text)||"",u=typeof t.context=="string"?t.context:((m=t.context)==null?void 0:m.text)||"";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,background:"#FFF"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(x.ShieldCheck,{size:20,color:M.accent,strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textTransform:"uppercase"},children:"Coaching Summary"})]}),a&&e.jsx("div",{style:{fontSize:14,fontWeight:500,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:1.5},children:a}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:16,justifyContent:"space-between"},children:[u&&e.jsx("div",{style:{fontSize:14,fontWeight:400,color:M.muted,fontFamily:"var(--font-sans)",lineHeight:1.5,flex:1},children:u}),t.overall&&e.jsx($t,{overall:t.overall})]}),(l.length>0||r.length>0)&&e.jsxs("div",{style:{display:"flex",gap:24,paddingTop:24,borderTop:`1px solid ${M.absent}`},children:[e.jsx(Ne,{icon:e.jsx(x.TrendingUp,{size:14,color:M.strong,strokeWidth:1.5}),label:"Key Strengths",items:l}),e.jsx(Ne,{icon:e.jsx(x.Lightbulb,{size:14,color:M.strong,strokeWidth:1.5}),label:"Improvements",items:r})]})]})};function Nt(t){const n=Math.floor(t/60),i=Math.round(t%60);return`${n}:${i.toString().padStart(2,"0")}`}const qt={display:"flex",justifyContent:"space-between",padding:"8px 8px 12px 8px",alignItems:"center",gap:24,fontFamily:"var(--font-sans)",fontSize:13,fontWeight:400,lineHeight:"normal",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)"},qe={display:"flex",flexDirection:"column",flex:"1 0 0",gap:0,minWidth:0},Ue=({meta:t={},callPurpose:n={},classification:i={},dimensions:l=[],outcomeQuality:r="Neutral",onMoreDetails:a,moreDetails:u=[],resolutionOutcome:v,customerIntent:m})=>{const[j,W]=f.useState(!1),k=t.duration_seconds!=null?Nt(t.duration_seconds):null,d=t.message_count,z=n.interaction_driver,b=i.interaction_paradigm,y=o=>l.find(B=>(B.key||"").toLowerCase().includes(o)),w=y("resolution_outcome"),E=y("customer_intent"),F=y("outcome_quality"),C=o=>o?o.replace(/_/g," ").replace(/\b\w/g,B=>B.toUpperCase()):null,_=r!=="Neutral"?r:F?C(F.value):r,H=v??(w?C(w.value):null),R=m??(E?C(E.value):null),h=new Set(["resolution_outcome","customer_intent","outcome_quality"].map(o=>`dim.${o}`)),g=l.filter(o=>!h.has(o.key)),s=[],G=[[k!=null?{label:"Duration",value:k}:null,d!=null?{label:"Messages",value:d}:null],[z!=null?{label:"Driver",value:z}:null,b!=null?{label:"Paradigm",value:b}:null]];for(let o=0;o<g.length;o+=2){const B=g[o]?{label:g[o].display_name||g[o].label||g[o].key,value:C(g[o].value)}:null,K=g[o+1]?{label:g[o+1].display_name||g[o+1].label||g[o+1].key,value:C(g[o+1].value)}:null;G.push([B,K])}G.push([{label:"Outcome Quality",value:_},{isMoreDetails:!0}]),G.forEach(o=>s.push(o));const L=[H!=null&&{label:"Resolution Outcome",value:H},R!=null&&{label:"Customer Intent",value:R},...u||[]].filter(Boolean),O=o=>e.jsxs("div",{style:qt,children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",whiteSpace:"nowrap",flexShrink:0},children:o.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",textAlign:"right",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:o.value})]},o.label),q=()=>e.jsxs("div",{onClick:()=>{W(o=>!o),a&&!j&&a()},style:{display:"flex",alignItems:"center",gap:6,padding:"8px 8px 12px 8px",cursor:"pointer",fontFamily:"var(--font-sans)",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)"},children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",fontSize:13,fontWeight:500,lineHeight:"normal"},children:"More Details"}),j?e.jsx(x.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(x.ChevronDown,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5})]},"more-details");return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0,position:"relative",overflow:"visible"},children:[s.map((o,B)=>{var K;return e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:24,alignSelf:"stretch"},children:[e.jsx("div",{style:qe,children:o[0]&&!o[0].isMoreDetails?O(o[0]):e.jsx("div",{style:{flex:1}})}),e.jsx("div",{style:qe,children:o[1]&&!o[1].isMoreDetails?O(o[1]):(K=o[1])!=null&&K.isMoreDetails?q():e.jsx("div",{style:{flex:1}})})]},B)}),j&&L.length>0&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,display:"flex",width:340,flexDirection:"column",alignItems:"flex-start",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxShadow:"-2px 2px 2px 0 rgba(0, 0, 0, 0.25)",overflow:"hidden",fontFamily:"var(--font-sans)",zIndex:50},children:[e.jsx("div",{style:{padding:"12px 16px",fontSize:13,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",alignSelf:"stretch"},children:"More details"}),L.map(o=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",gap:24,fontSize:13,fontWeight:400,lineHeight:"normal",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",alignSelf:"stretch"},children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",whiteSpace:"nowrap",flexShrink:0},children:o.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontSize:13,fontStyle:"normal",fontWeight:400,lineHeight:"120%",textAlign:"right"},children:o.value})]},o.label))]})]})},S={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",absent:"var(--Grey-absent, #D9D9D9)",white:"var(--Grey-White, #FFF)",cardBg:"var(--surface-warm-40, rgba(243, 241, 229, 0.40))"},T=1.2,Ke=3,Ve=t=>t!=null?Math.round(t*100)+"%":"—",Ye=t=>{if(t==null)return"—";const n=(t*100).toFixed(1);return t>0?`+${n}pp`:`${n}pp`},Xe=({outcomeLift:t,driverLabels:n=[]})=>{var d;if(!t||t.lift==null)return null;const i=t.p_expected,l=t.p_full,r=t.lift_raw??(l!=null&&i!=null?l-i:null),a=t.lift,u=(d=t.interpretation)!=null&&d.lift_band?t.interpretation.lift_band.replace(/_/g," "):a>=0?"Positive":"Negative",v=u.charAt(0).toUpperCase()+u.slice(1),j=/negative/i.test(u)?x.ThumbsDown:x.ThumbsUp,W=n.slice(0,Ke),k=n.length-Ke;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,gap:24,borderRadius:8,border:`1px solid ${S.absent}`,background:S.cardBg,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:32},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:24,alignSelf:"stretch"},children:[e.jsx("span",{style:{fontSize:15,fontWeight:600,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T},children:"Agent Lift Analysis"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--font-sans)"},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.strong,lineHeight:T},children:"vs. Average Agent:"}),e.jsx("span",{style:{fontSize:14,fontWeight:600,color:S.strong,lineHeight:T},children:Ye(a)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,paddingLeft:8,borderLeft:`1px solid ${S.absent}`},children:[e.jsx(j,{size:14,color:S.strong}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:S.strong,lineHeight:T},children:v})]})]})]}),e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"flex-start",flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:T},children:Ve(i)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T,whiteSpace:"nowrap"},children:"Expected Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:T,textAlign:"left"},children:"Based on call type & difficulty"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"flex-start",paddingLeft:24,borderLeft:`1px solid ${S.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:T},children:Ye(r)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T,whiteSpace:"nowrap"},children:"Agent Impact"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:T,textAlign:"left"},children:"Behavior-driven change"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"flex-start",paddingLeft:24,borderLeft:`1px solid ${S.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T},children:Ve(l)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:600,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T,whiteSpace:"nowrap"},children:"Predicted Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:T,textAlign:"left"},children:"With agent behaviors"})]})]})]})]}),n.length>0&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,alignSelf:"stretch"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T},children:"Key Drivers"}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[W.map((z,b)=>e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${S.absent}`,background:S.white},children:e.jsx("span",{style:{fontSize:12,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},children:z})},b)),k>0&&e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${S.absent}`,background:S.white},children:e.jsxs("span",{style:{fontSize:12,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T,whiteSpace:"nowrap"},children:["+ ",k]})})]})]})]})},Ze=({children:t,size:n=28,onClick:i,title:l})=>{const[r,a]=f.useState(!1);return e.jsx("div",{title:l,onClick:i,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",width:n,height:n,borderRadius:9999,background:r?"var(--surface-hover, #F3F7F7)":"transparent",cursor:"pointer",flexShrink:0,transition:"background 0.15s"},children:t})},et=({signals:t={signals:[],present_count:0,total_signals_evaluated:0},expandedSignals:n=new Set,toggleSignal:i=()=>{},playEvidence:l=()=>{},highlightTurns:r=()=>{},onShowInTranscript:a=()=>{},timelinePlaying:u=!1,currentTimeSeconds:v=0})=>{const m=(t==null?void 0:t.signals)??[],j=(t==null?void 0:t.present_count)??m.length,W=d=>{const z=Math.floor(d/6e4),b=Math.floor(d%6e4/1e3);return`${z.toString().padStart(2,"0")}:${b.toString().padStart(2,"0")}`},k=d=>u&&d.start_ms!=null&&v*1e3>=d.start_ms&&v*1e3<=(d.end_ms??d.start_ms+5e3);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",alignSelf:"stretch",width:"100%",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:34,height:34,borderRadius:9999,background:"var(--surface-hover, #F3F7F7)",flexShrink:0},children:e.jsx(x.FileSignal,{size:20,color:"#2E3236",strokeWidth:1.5})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flex:1},children:[e.jsx("span",{style:{fontSize:15,fontWeight:500,color:"var(--Grey-Strong, #2E3236)"},children:"Signals"}),e.jsxs("span",{style:{fontSize:14,fontWeight:500,color:"var(--Grey-Strong, #2E3236)"},children:[j," Signals Detected"]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",background:"var(--Grey-White, #FFF)",gap:8},children:[m.length===0&&e.jsx("div",{style:{padding:"8px 0",fontSize:14,color:"var(--Grey-Muted, #808183)"},children:"No signals detected."}),m.map((d,z)=>{var E,F,C;const b=d.key??d.id??z,y=n.has(b),w=((E=d.observations)==null?void 0:E.length)??0;return e.jsxs("div",{id:`signal-${b}`,style:{display:"flex",flexDirection:"column",width:"100%",gap:8},children:[e.jsxs("button",{onClick:()=>i(b),style:{display:"flex",padding:"8px 0",alignItems:"center",gap:12,alignSelf:"stretch",width:"100%",background:"none",border:"none",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",cursor:"pointer"},children:[e.jsxs("span",{style:{flex:1,textAlign:"left",fontSize:14,fontWeight:600,color:"var(--text-dark, #0B0A0A)",lineHeight:1.71},children:[d.display_name||((F=d.key)==null?void 0:F.replace(/_/g," ")),w>0&&e.jsxs("span",{style:{fontWeight:600,color:"var(--text-dark, #0B0A0A)",marginLeft:6},children:["(",w,")"]})]}),y?e.jsx(x.ChevronUp,{size:20,color:"#767473"}):e.jsx(x.ChevronDown,{size:20,color:"#767473"})]}),y&&((C=d.observations)==null?void 0:C.length)>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0},children:d.observations.map((_,H)=>{var R,h,g;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:8},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"8px 0",justifyContent:"space-between"},children:[e.jsx("span",{style:{flex:1,fontSize:14,fontWeight:400,color:"var(--text-subtle-warm, #767473)",lineHeight:1.5},children:_.reason||_.explanation}),((h=(R=_.evidence)==null?void 0:R[0])==null?void 0:h.start_ms)!=null&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx(Ze,{size:28,title:"Show in transcript",onClick:s=>{s.stopPropagation(),a(_.evidence[0].start_ms)},children:e.jsx(x.ScrollText,{size:16,color:"#808183",strokeWidth:1.5})}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1.2,whiteSpace:"nowrap"},children:W(_.evidence[0].start_ms)})]})]}),(g=_.evidence)==null?void 0:g.map((s,G)=>{const L=s.start_ms!=null&&s.end_ms!=null;return s.text&&e.jsxs("div",{onClick:O=>{O.stopPropagation(),L&&l(s)},onMouseEnter:()=>r(s.turn_ids??[]),onMouseLeave:()=>r([]),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0",cursor:L?"pointer":"default"},children:[L&&e.jsx(Ze,{size:28,children:k(s)?e.jsx(x.PauseCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(x.PlayCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1})}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:["“",s.text,"”"]})]},G)})]},_.key??H)})})]},b)})]})]})},A={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",absent:"var(--Grey-absent, #D9D9D9)",white:"var(--Grey-White, #FFF)",accent:"var(--rail-orange, #C98A5A)",track:"var(--rail-surface-2, #E3E1D7)",infoIcon:"var(--color-input-border, #ACACAD)"},Kt=({score:t=4,maxScore:n=10})=>{const j=Math.min(Math.round(t/n*5),5),W=180/5,k=b=>{const y=b*Math.PI/180;return{x:121.5+85*Math.cos(y),y:123-85*Math.sin(y)}},d=(b,y)=>{const w=k(b),E=k(y),F=b-y>180?1:0;return`M ${w.x} ${w.y} A 85 85 0 ${F} 1 ${E.x} ${E.y}`},z=2;return e.jsx("svg",{width:"100%",viewBox:"0 0 243 130",fill:"none",style:{maxWidth:243},children:Array.from({length:5},(b,y)=>{const w=180-y*W-(y>0?z/2:0),E=180-(y+1)*W+(y<5-1?z/2:0),F=y<j;return e.jsx("path",{d:d(w,E),stroke:F?A.strong:A.track,strokeWidth:30,strokeLinecap:"butt",fill:"none"},y)})})},Vt=({value:t=0,maxValue:n=5})=>e.jsx("div",{style:{display:"flex",gap:2},children:Array.from({length:n},(i,l)=>e.jsx("div",{style:{width:22,height:6,borderRadius:1,background:l<t?A.strong:A.track}},l))}),Yt={CSAT:"Predicted Customer Satisfaction",Resolution:"Predicted Resolution: was the issue fully resolved?","Process Adherence":"Process Adherence: Did the agent follow procedures?",Communication:"Predicted Communication Quality: Clarity, Empathy, Professionalism"},Zt=({text:t,children:n})=>{const[i,l]=f.useState(!1),r=f.useRef(null),[a,u]=f.useState({top:0,left:0}),v=()=>{if(r.current){const m=r.current.getBoundingClientRect();u({top:m.top-8,left:m.left+m.width/2})}l(!0)};return e.jsxs("div",{ref:r,style:{position:"relative",display:"inline-flex"},onMouseEnter:v,onMouseLeave:()=>l(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:a.top,left:a.left,transform:"translate(-50%, -100%)",display:"flex",width:"max-content",maxWidth:300,padding:10,alignItems:"center",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-Strong, #2E3236)",zIndex:9999,pointerEvents:"none"},children:e.jsx("span",{style:{color:"#FFF",fontSize:12,fontWeight:400,lineHeight:"140%"},children:t})})]})},Qt=({label:t,value:n=0,maxValue:i=5})=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:8,alignItems:"flex-start"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{fontSize:12,fontWeight:400,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:t}),e.jsx(Zt,{text:Yt[t]||t,children:e.jsx(x.Info,{size:14,color:A.infoIcon,strokeWidth:1,style:{cursor:"pointer"}})})]}),e.jsx(Vt,{value:n,maxValue:i})]}),tt=({score:t=83,maxScore:n=100,predictedScore:i=4,predictedLabel:l="Predicted Objective",description:r="",legends:a=[{label:"CSAT",value:3},{label:"Resolution",value:4},{label:"Process Adherence",value:5},{label:"Communication",value:3}]})=>(String(i).padStart(2,"0"),e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,borderRadius:8,border:`1px solid ${A.absent}`,background:A.white,alignSelf:"stretch",flex:1,gap:24},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx("span",{style:{fontSize:15,fontWeight:600,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Compass Score"}),e.jsx("span",{style:{fontSize:14,fontWeight:400,color:A.muted,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:24,flex:1,overflow:"hidden"},children:[e.jsxs("div",{style:{position:"relative",maxWidth:243,minWidth:160,flex:"0 1 243px",flexDirection:"column",alignItems:"center",display:"flex"},children:[e.jsx(Kt,{score:t,maxScore:n}),(()=>{const m=-(180-(n>0?Math.min(t/n,1):0)*180-45);return e.jsxs("svg",{width:"34",height:"35",viewBox:"0 0 34 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{marginTop:-24,transform:`rotate(${m}deg)`,transformOrigin:"center center"},children:[e.jsx("path",{d:"M16 25.2169C19.958 25.2169 23.1667 22.0083 23.1667 18.0503C23.1667 14.0922 19.958 10.8836 16 10.8836C12.042 10.8836 8.83334 14.0922 8.83334 18.0503C8.83334 22.0083 12.042 25.2169 16 25.2169Z",fill:"var(--rail-orange, #C98A5A)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.4791 11.2328L33.4351 0L21.6888 3.09113C19.9212 2.41855 18.0036 2.05025 16 2.05025C7.16344 2.05025 0 9.2137 0 18.0503C0 26.8868 7.16344 34.0503 16 34.0503C24.8366 34.0503 32 26.8868 32 18.0503C32 15.6119 31.4546 13.301 30.4791 11.2328ZM16 30.5503C22.9036 30.5503 28.5 24.9538 28.5 18.0503C28.5 11.1467 22.9036 5.55025 16 5.55025C9.09644 5.55025 3.5 11.1467 3.5 18.0503C3.5 24.9538 9.09644 30.5503 16 30.5503Z",fill:"var(--rail-orange, #C98A5A)"})]})})(),e.jsx("div",{style:{fontSize:28,fontWeight:400,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:1,textAlign:"center",marginTop:8},children:t})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",justifyContent:"center",flex:1},children:[e.jsx("div",{style:{fontSize:15,fontWeight:500,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textAlign:"left"},children:"Interaction Quality Index"}),e.jsx("div",{style:{width:"100%",height:1,background:A.absent}}),a.map((u,v)=>e.jsx(Qt,{label:u.label,value:u.value},v))]})]})]})),Se=t=>{if(!t)return null;const n=String(t).toLowerCase();return n==="supervisor"?"var(--rail-compliance, #C98A5A)":n==="admin"||n==="administrator"?"var(--rail-discovery, #5E88B0)":n==="agent"?"var(--rail-outcome, #6B7C93)":null},de=t=>(t||"").split(" ").map(n=>n[0]).join("").toUpperCase()||"U",Jt=t=>{if(!t||t==="Just now")return!0;if(/^\d{4}-\d{2}-\d{2}T/.test(t))try{const i=/Z$|[+-]\d{2}:\d{2}$/.test(t)?t:t+"Z",l=new Date(i);return Number.isNaN(l.getTime())?!1:Date.now()-l.getTime()<15*60*1e3}catch{return!1}const n=t.match(/^(\d+)\s*min/);return n?parseInt(n[1],10)<15:!(/\d+\s*h/.test(t)||/\d+\s*day/.test(t))},Ut=t=>{if(!t)return"";if(!/^\d{4}-\d{2}-\d{2}T/.test(t))return t;try{const n=/Z$|[+-]\d{2}:\d{2}$/.test(t)?t:t+"Z",i=new Date(n);if(Number.isNaN(i.getTime()))return t;const r=new Date().getTime()-i.getTime(),a=Math.floor(r/6e4),u=Math.floor(r/36e5);if(a<1)return"Just now";if(a<60)return`${a} min`;if(u<24)return`${u} h`;const v=Math.floor(u/24);return v===1?"1 day":`${v} days`}catch{return t}},nt=({name:t,initials:n,color:i,avatar:l,size:r=36})=>l?e.jsx("img",{src:l,alt:t,style:{width:r,height:r,borderRadius:"50%",objectFit:"cover",flexShrink:0}}):e.jsx("div",{style:{width:r,height:r,borderRadius:"50%",background:i||"#6B7C93",color:"#FFF",display:"flex",alignItems:"center",justifyContent:"center",fontSize:r<=32?"10px":"11px",fontWeight:650,flexShrink:0,fontFamily:"var(--default-font-family)",letterSpacing:"0.02em"},title:t,children:n||de(t)}),Xt=({comment:t,isReply:n=!1,isConsecutive:i=!1,onReply:l,onSendReply:r,onEdit:a,onDelete:u,onMenuClick:v,showReply:m=!0})=>{var fe,ie;const[j,W]=f.useState(!1),[k,d]=f.useState(!1),[z,b]=f.useState(!1),[y,w]=f.useState(""),[E,F]=f.useState(!1),[C,_]=f.useState(""),[H,R]=f.useState(!1),h=f.useRef(null),g=f.useRef(null),s=t.author||{},G=s.name||t.author_name||"Unknown",L=s.initials||de(G),O=s.role||t.author_role,q=s.color||Se(O)||"#6B7C93",o=s.avatar||t.avatar,B=t.timestamp||t.created_at,K=Ut(B),V=Jt(B),ce=Array.isArray(t.content)?t.content:[t.content||t.text||""];return f.useEffect(()=>{if(!k)return;const c=J=>{h.current&&!h.current.contains(J.target)&&d(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[k]),e.jsxs("div",{onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),style:{display:"flex",paddingLeft:n?48:0,alignItems:"flex-start",gap:16,paddingTop:i?0:8,paddingBottom:8},children:[i?e.jsx("div",{style:{width:36,flexShrink:0}}):e.jsx(nt,{name:G,initials:L,color:q,avatar:o}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:i?"flex-end":"space-between",marginBottom:i?0:6},children:[!i&&e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[e.jsx("span",{style:{fontSize:13,fontWeight:650,color:"var(--text-ink, #1E2125)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:G}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:K}),(t.isEdited||t.is_edited)&&e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:"(Edited)"})]}),e.jsxs("div",{style:{position:"relative"},ref:h,children:[e.jsx("button",{type:"button",onClick:()=>d(c=>!c),style:{padding:2,border:"none",background:"transparent",cursor:"pointer",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",opacity:j||k?1:0,transition:"opacity 0.15s",flexShrink:0},children:e.jsx(x.Ellipsis,{size:24,color:"var(--Grey-Muted, #808183)"})}),k&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,display:"flex",width:99,flexDirection:"column",alignItems:"flex-start",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxShadow:"-2px 2px 2px 0 rgba(0, 0, 0, 0.25)",zIndex:50,overflow:"hidden"},children:[l&&e.jsx("button",{type:"button",onClick:()=>{d(!1),F(!1),b(!0)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left"},onMouseEnter:c=>{c.currentTarget.style.background="var(--surface-hover, #F3F7F7)"},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Reply"}),a&&e.jsx("button",{type:"button",disabled:!V,onClick:()=>{if(!V)return;d(!1);const c=Array.isArray(t.content)?t.content.join(`
16
+ `):t.content||t.text||"";_(c),F(!0),b(!1)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:V?"pointer":"not-allowed",fontSize:13,fontWeight:400,color:V?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left",opacity:V?1:.5},onMouseEnter:c=>{V&&(c.currentTarget.style.background="var(--surface-hover, #F3F7F7)")},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Edit"}),u&&e.jsx("button",{type:"button",onClick:()=>{d(!1),R(!0)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left"},onMouseEnter:c=>{c.currentTarget.style.background="var(--surface-hover, #F3F7F7)"},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Delete"})]})]})]}),E?e.jsxs("div",{style:{display:"flex",width:662,maxWidth:"100%",padding:"8px 12px 12px 12px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box",marginTop:4},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"normal"},children:["“"," ",((fe=t.author)==null?void 0:fe.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>F(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(x.X,{size:20,color:"var(--Grey-Muted, #808183)"})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%"},children:[e.jsx("input",{value:C,onChange:c=>_(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),C.trim()&&(a==null||a({...t,content:C.trim(),isEdited:!0}),F(!1))),c.key==="Escape"&&F(!1)},autoFocus:!0,style:{flex:1,padding:"10px 12px",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",border:"none",background:"transparent",outline:"none",boxSizing:"border-box"}}),e.jsx("button",{type:"button",onClick:()=>{C.trim()&&(a==null||a({...t,content:C.trim(),isEdited:!0}),F(!1))},disabled:!C.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:C.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:C.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:C.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",flexShrink:0,transition:"all 0.15s",lineHeight:"150%"},children:"Save"})]})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"flex-start"},children:ce.map((c,J)=>e.jsx("div",{style:{fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",lineHeight:"160%",fontFamily:"var(--default-font-family)",padding:"8px 12px",background:n?"var(--surface-hover, #F3F7F7)":"var(--surface-warm-40, rgba(243, 241, 229, 0.40))",borderRadius:8,wordBreak:"break-word"},children:c},J))}),H&&e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,marginTop:8,fontSize:13,fontFamily:"var(--default-font-family)"},children:[e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontWeight:400},children:"Confirm: delete this comment?"}),e.jsx("button",{type:"button",onClick:()=>{R(!1),u==null||u(t)},style:{background:"var(--grey-light, #e9e8e8a1)",border:"none",cursor:"pointer",fontSize:13,fontWeight:600,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",padding:"4px 10px",borderRadius:6,transition:"background 0.15s"},onMouseEnter:c=>{c.currentTarget.style.background="var(--Grey-absent, #D9D9D9)"},onMouseLeave:c=>{c.currentTarget.style.background="var(--grey-light, #e9e8e8a1)"},children:"Delete"}),e.jsx("button",{type:"button",onClick:()=>R(!1),style:{background:"none",border:"none",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",padding:"4px 10px",borderRadius:6,transition:"background 0.15s"},onMouseEnter:c=>{c.currentTarget.style.background="var(--grey-light, #e9e8e8a1)"},onMouseLeave:c=>{c.currentTarget.style.background="none"},children:"Cancel"})]}),m&&l&&!z&&!H&&e.jsxs("button",{type:"button",onClick:()=>{F(!1),b(!0)},style:{display:"flex",alignItems:"center",gap:6,marginTop:8,padding:0,border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",transition:"color 0.15s"},children:[e.jsx(x.CornerDownRight,{size:20,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),"Reply"]}),z&&e.jsxs("div",{style:{display:"flex",width:662,maxWidth:"100%",padding:"8px 12px 12px 12px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box",marginTop:12},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"normal"},children:["“"," ",((ie=t.author)==null?void 0:ie.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>{w(""),b(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(x.X,{size:20,color:"var(--Grey-Muted, #808183)"})})]}),e.jsx("div",{style:{display:"flex",height:36,padding:16,alignItems:"center",gap:5,borderRadius:"0 8px 8px 8px",background:"var(--Grey-Strong, #2E3236)",boxSizing:"border-box",width:"100%"},children:e.jsx("span",{style:{color:"var(--Grey-White, #FFF)",fontSize:13,fontWeight:400,fontFamily:"var(--default-font-family)",lineHeight:"normal",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Array.isArray(t.content)?t.content[0]:t.content})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%"},children:[e.jsx("input",{ref:g,value:y,onChange:c=>w(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),y.trim()&&(r==null||r({content:y.trim(),parentId:t.id}),w(""),b(!1))),c.key==="Escape"&&(w(""),b(!1))},autoFocus:!0,placeholder:"Add a reply",style:{flex:1,padding:"10px 12px",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",border:"none",background:"transparent",outline:"none",boxSizing:"border-box"}}),e.jsx("button",{type:"button",onClick:()=>{y.trim()&&(r==null||r({content:y.trim(),parentId:t.id}),w(""),b(!1))},disabled:!y.trim(),style:{display:"flex",height:28,padding:"8px 12px",justifyContent:"center",alignItems:"center",gap:8,fontSize:13,fontWeight:600,color:y.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:y.trim()?"var(--Neutral-850, #272727)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:10,cursor:y.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Post"})]})]})]})]})},en=({currentUser:t,onSubmit:n})=>{const[i,l]=f.useState(""),[r,a]=f.useState(!1),u=f.useRef(null),v=()=>{const d=i.trim();d&&(n==null||n(d),l(""))},m=d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),v())},j=(t==null?void 0:t.initials)||de(t==null?void 0:t.name),W=(t==null?void 0:t.color)||Se(t==null?void 0:t.role)||"#6B7C93",k=t==null?void 0:t.avatar;return e.jsxs("div",{style:{display:"flex",gap:16,alignItems:"flex-start"},children:[e.jsx(nt,{name:t==null?void 0:t.name,initials:j,color:W,avatar:k}),e.jsx("div",{style:{flex:1,padding:12,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:r?"1px solid var(--Grey-Strong, #2E3236)":"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",transition:"border-color 0.15s"},children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:8,width:"100%"},children:[e.jsx("textarea",{ref:u,value:i,onChange:d=>l(d.target.value),onFocus:()=>a(!0),onBlur:()=>a(!1),onKeyDown:m,placeholder:"Add feedback",rows:1,style:{flex:1,border:"none",outline:"none",resize:"none",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",background:"transparent",padding:0,minHeight:24}}),e.jsx("button",{type:"button",onClick:v,disabled:!i.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:i.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:i.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:i.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",transition:"all 0.15s",flexShrink:0,lineHeight:"150%"},children:"Post"})]})})]})},it=({comment:t,depth:n=0,isConsecutive:i=!1,onReply:l,onSendReply:r,onEdit:a,onDelete:u,onMenuClick:v})=>{const m=t.replies&&t.replies.length>0,j=!m;return e.jsxs(f.Fragment,{children:[e.jsx("div",{style:{paddingLeft:n>0?Math.min(n*32,128):0},children:e.jsx(Xt,{comment:t,isReply:n>0,isConsecutive:i,onReply:l,onSendReply:r,onEdit:a,onDelete:u,onMenuClick:v,showReply:j})}),m&&t.replies.map(W=>e.jsx(it,{comment:W,depth:n+1,onReply:l,onSendReply:r,onEdit:a,onDelete:u,onMenuClick:v},W.id))]})},st=({comments:t=[],totalComments:n,onSendComment:i,onReply:l,onSendReply:r,onEdit:a,onDelete:u,onMenuClick:v,onMarkResolved:m,currentUser:j,isResolved:W=!1})=>{const[k,d]=f.useState([]),[z,b]=f.useState(!1),y=f.useMemo(()=>{const h=new Set(t.map(s=>s.id)),g=k.filter(s=>!h.has(s.id));return[...t,...g]},[t,k]);f.useEffect(()=>{const h=new Set(t.map(g=>g.id));d(g=>g.filter(s=>!h.has(s.id)))},[t]);const w=f.useMemo(()=>{if(!j)return{name:"You",initials:"YO",color:"#6B7C93"};const h=j.name||"You",g=j.initials||de(h),s=j.role&&String(j.role).toLowerCase(),G=j.color||Se(s)||"#6B7C93";return{...j,name:h,initials:g,color:G}},[j]),E=async({content:h,parentId:g})=>{if(r){b(!0);try{await r({content:h,parentId:g})}finally{b(!1)}}else{const s={id:`temp-${Date.now()}`,author:w,content:h,timestamp:"Just now",parentId:g,isOptimistic:!0};d(G=>[...G,s])}},F=async h=>{if(i){b(!0);try{await i(h)}finally{b(!1)}}else{const g={id:`temp-${Date.now()}`,author:w,content:h,timestamp:"Just now",isOptimistic:!0};d(s=>[...s,g])}},C=h=>{d(g=>g.map(s=>s.id===h.id?{...s,content:h.content,isEdited:!0}:s)),a==null||a(h)},_=h=>{d(g=>g.filter(s=>s.id!==h.id)),u==null||u(h)},H=f.useMemo(()=>{const h={};y.forEach(s=>{s.parentId&&(h[s.parentId]||(h[s.parentId]=[]),h[s.parentId].push(s))});const g=s=>({...s,replies:(h[s.id]||[]).map(g)});return y.filter(s=>!s.parentId).map(g)},[y]),R=n??y.length;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",background:"var(--Grey-White, #FFF)",width:"100%",fontFamily:"var(--default-font-family)"},children:[e.jsxs("div",{style:{display:"flex",height:40,paddingBottom:8,alignItems:"center",gap:16,alignSelf:"stretch",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",justifyContent:"space-between"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(x.MessagesSquare,{size:24,color:"var(--rail-orange, #C98A5A)",strokeWidth:1.5}),e.jsxs("span",{style:{fontSize:14,fontWeight:650,color:"var(--Grey-Strong, #2E3236)",letterSpacing:"0.08em",textTransform:"uppercase",lineHeight:"150%"},children:["FEEDBACK",R>0?` (${R<10?"0":""}${R})`:""]})]}),W?e.jsxs("div",{style:{display:"inline-flex",height:32,padding:"12px 16px 12px 12px",justifyContent:"flex-end",alignItems:"center",gap:8,borderRadius:10,background:"var(--Rail-Surface-2, #E3E1D7)",flexShrink:0},children:[e.jsx(x.Check,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:2}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Resolved"})]}):m?e.jsxs("button",{type:"button",onClick:m,style:{display:"flex",alignItems:"center",gap:8,padding:"8px 16px",fontSize:13,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:20,cursor:"pointer",fontFamily:"var(--default-font-family)",transition:"background 0.15s",lineHeight:"150%",flexShrink:0},children:[e.jsx(x.CircleCheck,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5}),"Mark as Resolved"]}):null]}),e.jsx("div",{style:{display:"flex",paddingTop:24,flexDirection:"column",alignItems:"flex-start",gap:10,alignSelf:"stretch",borderTop:"1px solid var(--Grey-absent, #D9D9D9)"},children:e.jsxs("div",{style:{width:662,maxWidth:"100%"},children:[y.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:0,marginBottom:24,maxHeight:600,overflowY:y.length>6?"auto":"visible"},children:H.map((h,g)=>{var q,o;const s=g>0?H[g-1]:null,G=((q=s==null?void 0:s.author)==null?void 0:q.name)||(s==null?void 0:s.author_name),L=((o=h.author)==null?void 0:o.name)||h.author_name,O=s&&G===L&&(!s.replies||s.replies.length===0);return e.jsx(it,{comment:h,depth:0,isConsecutive:!!O,onReply:l,onSendReply:E,onEdit:C,onDelete:_,onMenuClick:v},h.id)})}),y.length>0&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:16,marginLeft:48},children:[e.jsx(x.Info,{size:16,color:"var(--Grey-Muted, #808183)"}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontSize:13,fontStyle:"normal",fontWeight:400,lineHeight:"normal"},children:"Comments can be edited within 15 minutes."})]}),z&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0"},children:[e.jsx("div",{style:{width:16,height:16,border:"2px solid var(--Grey-absent, #D9D9D9)",borderTopColor:"var(--Grey-Strong, #2E3236)",borderRadius:"50%",animation:"spin 0.8s linear infinite"}}),e.jsx("span",{style:{fontSize:13,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)"},children:"Sending..."}),e.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}),e.jsx(en,{currentUser:w,onSubmit:F})]})})]})},ne=({text:t,children:n})=>{const[i,l]=f.useState(!1),r=f.useRef(null),[a,u]=f.useState({top:0,left:0});if(!t)return n;const v=()=>{if(r.current){const m=r.current.getBoundingClientRect();u({top:m.top-2,left:m.left+m.width/2})}l(!0)};return e.jsxs("div",{ref:r,style:{position:"relative",display:"inline-flex"},onMouseEnter:v,onMouseLeave:()=>l(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:a.top,left:a.left,transform:"translate(-50%, -100%)",display:"flex",padding:10,alignItems:"center",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-Strong, #2E3236)",zIndex:9999,pointerEvents:"none",whiteSpace:"nowrap"},children:e.jsx("span",{style:{color:"#FFF",fontSize:12,fontWeight:400,lineHeight:"normal"},children:t})})]})},tn=[{key:"overview",label:"Overview"},{key:"coaching",label:"Coaching Summary"},{key:"signals",label:"Signals & Recording"},{key:"comments",label:"Feedback"}],nn=({title:t="Wheel Stud Replacement Enquiry",onBack:n,data:i,coachingData:l,coachingLoading:r=!1,audioUrl:a,audioRef:u,currentTimeSeconds:v,timelinePlaying:m,playbackRate:j,timelineSegments:W,onSeek:k,onTogglePlay:d,onSeekBack:z,onSeekForward:b,onSetPlaybackRate:y,agentName:w,agentFullName:E,customerName:F,customerFullName:C,transcript:_,activeTurnIndex:H,turnObservations:R,highlightedTurns:h,onTurnPlayPause:g,onPlayEvidence:s,onHighlightTurns:G,callPurpose:L,classification:O,outcomeQuality:q,resolutionOutcome:o,customerIntent:B,interactionId:K,moreDetails:V,compassScore:ce,compassMaxScore:fe=10,predictedCsat:ie,predictedLabel:c="Predicted Objective",compassLegends:J,customerSessions:rt,customerSessionCount:ot,onSessionClick:ke,onViewAllSessions:we,prevSessionDesc:lt,prevSessionDisabled:se=!1,nextSessionDesc:at,nextSessionDisabled:re=!1,onPreviousSession:Ce,onNextSession:Fe,comments:De=[],currentUser:dt,onSendComment:ct,onSendReply:ft,onReply:pt,onEdit:gt,onDelete:ht,onMenuClick:ut,onMarkResolved:yt,commentsResolved:xt})=>{var Be,Pe;const[pe,Ie]=f.useState("overview"),[mt,We]=f.useState(new Set),[ze,ge]=f.useState(!1),[Ge,Me]=f.useState(null),[vt,Ee]=f.useState(!1),[bt,jt]=f.useState(0),U=f.useRef(null),he=f.useRef(null),ue=f.useRef(null),ye=f.useRef(null),xe=f.useRef(null),St={overview:he,coaching:ue,signals:ye,comments:xe},me=f.useRef(null),ve=f.useRef(!1);f.useEffect(()=>{const p=me.current;if(!p)return;const D=["overview","coaching","signals","comments"],I=[he,ue,ye,xe],P=(Q=>{let N=Q.parentElement;for(;N;){const{overflow:ae,overflowY:$e}=window.getComputedStyle(N);if(/(auto|scroll)/.test(ae+$e))return N;N=N.parentElement}return null})(p),Z=()=>{if(ve.current)return;let Q=D[0];for(let N=I.length-1;N>=0;N--){const ae=I[N].current;if(!ae)continue;if(ae.getBoundingClientRect().top<=150){Q=D[N];break}}Ie(Q)};return p.addEventListener("scroll",Z,{passive:!0}),P&&P!==p&&P.addEventListener("scroll",Z,{passive:!0}),window.addEventListener("scroll",Z,{passive:!0,capture:!0}),()=>{p.removeEventListener("scroll",Z),P&&P!==p&&P.removeEventListener("scroll",Z),window.removeEventListener("scroll",Z,{capture:!0})}},[]);const _e=f.useRef(null),kt=p=>{var I;Ie(p),ve.current=!0,_e.current=p;const D=(I=St[p])==null?void 0:I.current;if(D){const Y=me.current;if(Y&&Y.scrollHeight>Y.clientHeight){const P=Y.getBoundingClientRect().top,Q=D.getBoundingClientRect().top-P+Y.scrollTop-16;Y.scrollTo({top:Q,behavior:"smooth"})}else{const P=D.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:P,behavior:"smooth"})}}setTimeout(()=>{ve.current=!1,_e.current=null},1200)},Te=rt||[],wt=p=>{var I;const D=p/1e3;(I=U.current)!=null&&I.scrollToTranscript&&U.current.scrollToTranscript(D)},Ct=p=>{var D;if(s)s(p);else{const I=p.start_ms??p.startMs;if(I!=null&&((D=U.current)!=null&&D.seekTo)){U.current.seekTo(I/1e3),Ee(!0),jt(I/1e3);const P=(p.end_ms??p.endMs??I+5e3)-I;setTimeout(()=>Ee(!1),P)}}},Ft=p=>{G&&G(p)},Dt=p=>{We(D=>{const I=new Set(D);return I.has(p)?I.delete(p):I.add(p),I})},It=(i==null?void 0:i.blocks)||[],X=p=>{var D;return((D=It.find(I=>I.block_id===p))==null?void 0:D.payload)||{}},$=X("interaction-metadata"),ee=X("interaction-context"),oe=X("interaction-signals"),Re=X("interaction-outcome-lift"),Wt=X("interaction-dimensions").dimensions||[],zt=ee.call_purpose||{},Gt=ee.classification||{},Ae={duration_seconds:156,message_count:25,...$},He={interaction_driver:"General Information",interaction_direction:"inbound",...zt},Mt={interaction_paradigm:"Informational",...Gt},Et={p_expected:.94,p_full:.83,lift_raw:-.11,lift:.043,interpretation:{lift_band:"positive"},...Re},_t=((Be=Re.driver_signal_keys)==null?void 0:Be.map(p=>p.replace(/^sig\./,"").replace(/_/g," ")))||["customer needs fully addressed","call flow expectations set","Opening expectations set","Active listening demonstrated","Resolution confirmed"],Tt=l||{one_liner:"David provided the customer with information on wheel stud replacement and pricing, but did not secure an appointment.",context:"The customer was seeking information on wheel stud replacement for a 2013 Chevy Bolt and was unsure about doing the repair themselves.",strengths:[{text:"Anthony effectively scheduled the appointment and confirmed the details clearly.",quote:"Alright. That is all set up for Saturday, the twenty eighth, at 12:00."},{text:"Handled customer objections well by explaining the need for a separate appointment for alignment.",quote:"I don't have the alignment changeover the weekend. So I would have to set up a separate appointment for the alignment."},{text:"Demonstrated courtesy and professionalism throughout the call.",quote:"Have a great day."}],improvements:[{text:"Close the loop by restating the plan and confirming next steps to ensure customer certainty.",quote:"Alright. That is all set up for Saturday, the twenty eighth, at 12:00."},{text:"Frame solutions positively by leading with what can be done rather than limitations.",quote:"I don't have the alignment changeover the weekend."}],overall:"effective"},Rt=(Pe=oe==null?void 0:oe.signals)!=null&&Pe.length?oe:{present_count:9,total_signals_evaluated:146,signals:[{key:"price_estimate_provided",display_name:"Price Estimate Provided",observations:[{key:"obs1",reason:"Evidence shows a price estimate or quote was provided.",evidence:[{start_ms:92e3,end_ms:97e3,text:"From Casper, you're probably looking at, like, a half hour labor plus a stud, so you'd probably be somewhere around $90 or something.",turn_ids:[8]}]}]},{key:"fee_or_cost_discussed",display_name:"Fee or Cost Discussed",observations:[{key:"obs2",reason:"Agent discussed pricing details with the customer."}]},{key:"engagement_budget",display_name:"Engagement Budget Discussed",observations:[{key:"obs3a",reason:"Budget expectations were set."},{key:"obs3b",reason:"Customer confirmed budget range."}]},{key:"projected_revenue",display_name:"Projected Revenue Discussed",observations:[{key:"obs4a",reason:"Revenue projection shared."},{key:"obs4b",reason:"Timeline for revenue discussed."},{key:"obs4c",reason:"Quarterly targets mentioned."}]},{key:"market_analysis",display_name:"Market Analysis Completed",observations:[{key:"obs5a",reason:"Market analysis referenced."},{key:"obs5b",reason:"Competitive landscape discussed."},{key:"obs5c",reason:"Market trends mentioned."},{key:"obs5d",reason:"Regional analysis provided."}]},{key:"target_audience",display_name:"Target Audience Defined",observations:[{key:"obs6a",reason:"Target audience identified."},{key:"obs6b",reason:"Demographics discussed."},{key:"obs6c",reason:"Audience segmentation reviewed."},{key:"obs6d",reason:"Persona mapping completed."},{key:"obs6e",reason:"Channel preferences noted."}]},{key:"concept_approval",display_name:"Concept Approval Received",observations:[{key:"obs7a",reason:"Concept approved by stakeholder."},{key:"obs7b",reason:"Feedback incorporated."},{key:"obs7c",reason:"Sign-off confirmed."},{key:"obs7d",reason:"Revisions requested."},{key:"obs7e",reason:"Final version accepted."},{key:"obs7f",reason:"Timeline approved."}]},{key:"prototype_developed",display_name:"Prototype Developed",observations:[{key:"obs8a",reason:"Prototype shared."},{key:"obs8b",reason:"Testing initiated."},{key:"obs8c",reason:"Feedback collected."},{key:"obs8d",reason:"Iterations completed."},{key:"obs8e",reason:"Usability tested."},{key:"obs8f",reason:"Design finalized."},{key:"obs8g",reason:"Stakeholder demo done."}]},{key:"user_testing",display_name:"User Testing Scheduled",observations:[{key:"obs9a",reason:"Testing sessions planned."},{key:"obs9b",reason:"Participants recruited."},{key:"obs9c",reason:"Test scripts prepared."},{key:"obs9d",reason:"Environment set up."},{key:"obs9e",reason:"Accessibility testing included."},{key:"obs9f",reason:"Results framework defined."},{key:"obs9g",reason:"Timeline confirmed."},{key:"obs9h",reason:"Backup plan discussed."}]}]},be=w||$.agent_name||$.agent||ee.agent_name||"Agent",At=E||$.agent_full_name||$.agent_name||be,te=F||$.customer_name||$.customer||ee.customer_name||"Customer",Le=C||$.customer_full_name||$.customer_name||te,je=ot??Te.length,le=$.created_dt||(i==null?void 0:i.created_dt)||ee.created_dt||"",Ht=le?new Date(/Z$|[+-]\d{2}:\d{2}$/.test(le)?le:le+"Z").toLocaleString():"",Lt=He.interaction_direction==="inbound"?"Inbound":"Outbound";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",background:"var(--Grey-White, #FFF)"},children:[e.jsxs("div",{style:{position:"sticky",top:0,zIndex:20,background:"var(--Grey-White, #FFF)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"24px 24px 0"},children:[e.jsx("button",{onClick:n,style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0,flexShrink:0},children:e.jsx(x.ArrowLeft,{size:24,color:"var(--Grey-Strong, #2E3236)"})}),e.jsx("div",{style:{width:1,height:28,background:"var(--Base-absent, #D9D9D9)"}}),e.jsx("h1",{style:{color:"var(--Grey-Strong, #2E3236)",fontSize:24,fontStyle:"normal",fontWeight:400,lineHeight:"normal",margin:0,flex:1},children:t}),(Ce||Fe)&&e.jsxs("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[e.jsx(ne,{text:lt,children:e.jsxs("button",{onClick:se?void 0:Ce,disabled:se,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:se?"default":"pointer",opacity:se?.4:1},children:[e.jsx(x.ArrowLeft,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5}),e.jsx("span",{style:{color:"var(--Neutral-800, #323232)",fontSize:13,fontWeight:400,lineHeight:"24px",fontFamily:"var(--default-font-family)",whiteSpace:"nowrap"},children:"Previous Session"})]})}),e.jsx("div",{style:{width:1,height:20,background:"var(--Grey-absent, #D9D9D9)",flexShrink:0}}),e.jsx(ne,{text:at,children:e.jsxs("button",{onClick:re?void 0:Fe,disabled:re,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:re?"default":"pointer",opacity:re?.4:1},children:[e.jsx("span",{style:{color:"var(--Neutral-800, #323232)",fontSize:13,fontWeight:400,lineHeight:"24px",fontFamily:"var(--default-font-family)",whiteSpace:"nowrap"},children:"Next Session"}),e.jsx(x.ArrowRight,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5})]})})]})]}),e.jsx("div",{style:{display:"flex",alignItems:"flex-start",background:"var(--Grey-White, #FFF)",borderBottom:"1px solid var(--Grey-Faint, #ACADAD)",padding:"0 24px",marginTop:8},children:tn.map(p=>e.jsx("button",{onClick:()=>kt(p.key),style:{display:"flex",padding:16,alignItems:"center",gap:10,background:"none",border:"none",borderBottom:pe===p.key?"3px solid var(--Grey-Strong, #2E3236)":"3px solid transparent",cursor:"pointer",fontSize:15,fontWeight:pe===p.key?500:400,color:pe===p.key?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",whiteSpace:"nowrap",transition:"border-color 0.2s ease, color 0.2s ease"},children:p.label},p.key))})]}),e.jsxs("div",{ref:me,style:{padding:24,flex:1,overflowY:"auto"},children:[e.jsxs("div",{ref:he,style:{display:"flex",flexDirection:"column",justifyContent:"flex-end",alignItems:"flex-start",gap:24,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",height:40,alignItems:"center",gap:16,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1},children:[e.jsx(x.ClipboardList,{size:24,color:"var(--rail-orange, #C98A5A)",strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,textTransform:"uppercase"},children:"Overview"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0"},children:[e.jsx(x.CalendarDays,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:Ht})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0"},children:[e.jsx(x.PhoneIncoming,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:Lt})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingLeft:16,borderLeft:"1px solid var(--Grey-absent, #D9D9D9)"},children:[e.jsx(ne,{text:At,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0",cursor:"pointer"},children:[e.jsx(x.Headset,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:be})]})}),e.jsx(x.Repeat,{size:16,color:"var(--color-input-border, #ACACAD)",strokeWidth:1.5}),je>1?e.jsxs("div",{style:{position:"relative"},children:[e.jsx(ne,{text:Le,children:e.jsxs("button",{onClick:()=>ge(p=>!p),style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",background:"none",border:"none",cursor:"pointer"},children:[e.jsx(x.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:[te," (",je," Sessions)"]}),ze?e.jsx(x.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(x.ChevronDown,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5})]})}),ze&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,width:264,background:"var(--Grey-White, #FFF)",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",zIndex:50,overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,padding:16},children:[e.jsx(x.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5,style:{marginTop:2,flexShrink:0}}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1},children:te}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1},children:[je," Sessions in past"]})]})]}),Te.slice(0,5).map((p,D)=>e.jsxs("div",{onClick:()=>{ke&&ke(p),ge(!1)},onMouseEnter:()=>Me(D),onMouseLeave:()=>Me(null),style:{display:"flex",width:264,padding:"12px 16px",justifyContent:"space-between",alignItems:"center",background:Ge===D?"var(--surface-hover, #F3F7F7)":"var(--Grey-White, #FFF)",borderTop:"1px solid var(--Grey-absent, #D9D9D9)",cursor:"pointer",boxSizing:"border-box",transition:"background 0.15s"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1},children:p.title}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1},children:p.date})]}),Ge===D&&e.jsx(x.ExternalLink,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1,style:{flexShrink:0}})]},p.id||D)),e.jsx("div",{style:{padding:16,borderTop:"1px solid var(--Grey-absent, #D9D9D9)",display:"flex",justifyContent:"center"},children:e.jsxs("button",{onClick:()=>{we&&we(),ge(!1)},style:{display:"flex",height:32,padding:"16px 16px 16px 12px",justifyContent:"center",alignItems:"center",gap:6,background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:10,cursor:"pointer"},children:[e.jsx(x.History,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--Grey-Strong, #2E3236)"},children:"View All Sessions"})]})})]})]}):e.jsx(ne,{text:Le,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",cursor:"pointer"},children:[e.jsx(x.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:te})]})})]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"stretch",gap:24,alignSelf:"stretch"},children:[e.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:e.jsx(tt,{score:ce??0,maxScore:5,predictedScore:ie??0,predictedLabel:c,legends:J})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"flex-end",gap:24,flex:1,minWidth:0},children:[e.jsx(Ue,{meta:Ae,callPurpose:L||He,classification:O||Mt,outcomeQuality:q||"Neutral",dimensions:Wt,resolutionOutcome:o,customerIntent:B,interactionId:K??$.interaction_id,moreDetails:V}),e.jsx(Xe,{outcomeLift:Et,driverLabels:_t})]})]})]}),e.jsx("div",{ref:ue,style:{paddingTop:24},children:e.jsx(Je,{data:r?null:Tt,loading:r})}),e.jsxs("div",{ref:ye,style:{display:"flex",flexDirection:"column",gap:16,alignSelf:"stretch",paddingTop:24},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(x.FileSignal,{size:24,color:"#C98A5A",strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,textTransform:"uppercase"},children:"Signals & Recording"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:24,alignSelf:"stretch",paddingTop:16,borderTop:"1px solid #D9D9D9"},children:[e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(et,{signals:Rt,expandedSignals:mt,toggleSignal:Dt,playEvidence:Ct,highlightTurns:Ft,onShowInTranscript:wt,timelinePlaying:m||vt,currentTimeSeconds:v??bt})}),e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(Qe.UpdatedInteractionRecording,{ref:U,audioUrl:a,durationSeconds:Ae.duration_seconds,audioRef:u,agentName:be,customerName:te,currentTimeSeconds:v,timelinePlaying:m,playbackRate:j,timelineSegments:W,onSeek:k,onTogglePlay:d,onSeekBack:z,onSeekForward:b,onSetPlaybackRate:y,transcript:_,activeTurnIndex:H,turnObservations:R,highlightedTurns:h,onTurnPlayPause:g,setExpandedSignals:We})})]})]}),e.jsx("div",{ref:xe,style:{paddingTop:24},children:e.jsx(st,{comments:De,totalComments:De.length,currentUser:dt,onSendComment:ct||(()=>{}),onSendReply:ft||(()=>{}),onReply:pt||(()=>{}),onEdit:gt||(()=>{}),onDelete:ht||(()=>{}),onMenuClick:ut||(()=>{}),onMarkResolved:yt||(()=>{}),isResolved:xt})})]})]})};exports.UpdatedInteractionRecording=Qe.UpdatedInteractionRecording;exports.UpdatedCoachingSynthesisCard=Je;exports.UpdatedCompassScore=tt;exports.UpdatedInteractionContext=Ue;exports.UpdatedInteractionDetails=nn;exports.UpdatedInteractionScores=Xe;exports.UpdatedInteractionSignals=et;exports.UpdatedThreads=st;
17
17
  //# sourceMappingURL=UpdatedInteractionDetails.cjs.js.map