chordia-ui 3.5.0 → 3.5.1

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"),c=require("react"),g=require("lucide-react"),Oe=require("../UpdatedInteractionRecording.cjs.js"),W={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)"},Tt={effective:"Effective",strong:"Strong",needs_improvement:"Needs Improvement",mixed:"Mixed"},Ee="updated-coaching-synthesis-keyframes";function Ht(){if(typeof document>"u"||document.getElementById(Ee))return;const t=document.createElement("style");t.id=Ee,t.textContent=`
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=`
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 Lt({overall:t}){const i=Tt[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:W.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Overall:"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(g.ThumbsUp,{size:14,color:W.strong,strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:W.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:i})]})]})}function Bt({item:t}){const i=typeof t=="string"?t:(t==null?void 0:t.text)||"",o=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:W.itemText,fontFamily:"var(--font-sans)",lineHeight:1.5},children:i}),o&&e.jsxs("div",{style:{display:"flex",gap:10},children:[e.jsx("div",{style:{width:1,flexShrink:0,alignSelf:"stretch",background:W.quoteLine}}),e.jsxs("div",{style:{fontSize:14,fontWeight:400,color:W.quoteText,fontFamily:"var(--font-sans)",lineHeight:1.5},children:["“",o,"”"]})]})]})}function Re({icon:t,label:i,items:o}){return!o||o.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:W.iconBg,flexShrink:0},children:t}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:W.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:i})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:24},children:o.map((r,s)=>e.jsx(Bt,{item:r},s))})]})}const $e=({data:t,loading:i,error:o})=>{var u,h;if(c.useEffect(()=>{Ht()},[]),i)return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
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:`
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:W.muted,fontWeight:500,textAlign:"center"},children:"Synthesizing coaching summary..."})]})]});if(o)return e.jsx("div",{style:{fontSize:14,color:W.muted},children:"Unable to generate coaching summary."});if(!t)return null;const r=t.strengths||[],s=t.improvements||[],f=typeof t.one_liner=="string"?t.one_liner:((u=t.one_liner)==null?void 0:u.text)||"",x=typeof t.context=="string"?t.context:((h=t.context)==null?void 0:h.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(g.ShieldCheck,{size:20,color:W.accent,strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:W.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textTransform:"uppercase"},children:"Coaching Summary"})]}),f&&e.jsx("div",{style:{fontSize:14,fontWeight:500,color:W.strong,fontFamily:"var(--font-sans)",lineHeight:1.5},children:f}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:16,justifyContent:"space-between"},children:[x&&e.jsx("div",{style:{fontSize:14,fontWeight:400,color:W.muted,fontFamily:"var(--font-sans)",lineHeight:1.5,flex:1},children:x}),t.overall&&e.jsx(Lt,{overall:t.overall})]}),(r.length>0||s.length>0)&&e.jsxs("div",{style:{display:"flex",gap:24,paddingTop:24,borderTop:`1px solid ${W.absent}`},children:[e.jsx(Re,{icon:e.jsx(g.TrendingUp,{size:14,color:W.strong,strokeWidth:1.5}),label:"Key Strengths",items:r}),e.jsx(Re,{icon:e.jsx(g.Lightbulb,{size:14,color:W.strong,strokeWidth:1.5}),label:"Improvements",items:s})]})]})};function Pt(t){const i=Math.floor(t/60),o=Math.round(t%60);return`${i}:${o.toString().padStart(2,"0")}`}const Ot={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)"},Ae={display:"flex",flexDirection:"column",flex:"1 0 0",gap:0,minWidth:0},Ne=({meta:t={},callPurpose:i={},classification:o={},dimensions:r=[],outcomeQuality:s="Neutral",onMoreDetails:f,moreDetails:x=[],resolutionOutcome:u,customerIntent:h})=>{const[m,F]=c.useState(!1),j=t.duration_seconds!=null?Pt(t.duration_seconds):null,d=t.message_count,b=i.interaction_driver,a=o.interaction_paradigm,p=n=>r.find(R=>(R.key||"").toLowerCase().includes(n)),y=p("resolution_outcome"),w=p("customer_intent"),S=p("outcome_quality"),M=n=>n?n.replace(/_/g," ").replace(/\b\w/g,R=>R.toUpperCase()):null,G=s!=="Neutral"?s:S?M(S.value):s,O=u??(y?M(y.value):null),E=h??(w?M(w.value):null),H=new Set(["resolution_outcome","customer_intent","outcome_quality"].map(n=>`dim.${n}`)),D=r.filter(n=>!H.has(n.key)),I=[],L=[[j!=null?{label:"Duration",value:j}:null,d!=null?{label:"Messages",value:d}:null],[b!=null?{label:"Driver",value:b}:null,a!=null?{label:"Paradigm",value:a}:null]];for(let n=0;n<D.length;n+=2){const R=D[n]?{label:D[n].display_name||D[n].label||D[n].key,value:M(D[n].value)}:null,K=D[n+1]?{label:D[n+1].display_name||D[n+1].label||D[n+1].key,value:M(D[n+1].value)}:null;L.push([R,K])}L.push([{label:"Outcome Quality",value:G},{isMoreDetails:!0}]),L.forEach(n=>I.push(n));const B=[O!=null&&{label:"Resolution Outcome",value:O},E!=null&&{label:"Customer Intent",value:E},...x||[]].filter(Boolean),$=n=>e.jsxs("div",{style:Ot,children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",whiteSpace:"nowrap",flexShrink:0},children:n.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",textAlign:"right",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:n.value})]},n.label),V=()=>e.jsxs("div",{onClick:()=>{F(n=>!n),f&&!m&&f()},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"}),m?e.jsx(g.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(g.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:[I.map((n,R)=>{var K;return e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:24,alignSelf:"stretch"},children:[e.jsx("div",{style:Ae,children:n[0]&&!n[0].isMoreDetails?$(n[0]):e.jsx("div",{style:{flex:1}})}),e.jsx("div",{style:Ae,children:n[1]&&!n[1].isMoreDetails?$(n[1]):(K=n[1])!=null&&K.isMoreDetails?V():e.jsx("div",{style:{flex:1}})})]},R)}),m&&B.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"}),B.map(n=>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:n.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontSize:13,fontStyle:"normal",fontWeight:400,lineHeight:"120%",textAlign:"right"},children:n.value})]},n.label))]})]})},v={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))"},z=1.2,Te=3,He=t=>t!=null?Math.round(t*100)+"%":"—",Le=t=>{if(t==null)return"—";const i=(t*100).toFixed(1);return t>0?`+${i}pp`:`${i}pp`},qe=({outcomeLift:t,driverLabels:i=[]})=>{var d;if(!t||t.lift==null)return null;const o=t.p_expected,r=t.p_full,s=t.lift_raw??(r!=null&&o!=null?r-o:null),f=t.lift,x=(d=t.interpretation)!=null&&d.lift_band?t.interpretation.lift_band.replace(/_/g," "):f>=0?"Positive":"Negative",u=x.charAt(0).toUpperCase()+x.slice(1),m=/negative/i.test(x)?g.ThumbsDown:g.ThumbsUp,F=i.slice(0,Te),j=i.length-Te;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,gap:24,borderRadius:8,border:`1px solid ${v.absent}`,background:v.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:v.strong,fontFamily:"var(--font-sans)",lineHeight:z},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:v.strong,lineHeight:z},children:"vs. Average Agent:"}),e.jsx("span",{style:{fontSize:14,fontWeight:600,color:v.strong,lineHeight:z},children:Le(f)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,paddingLeft:8,borderLeft:`1px solid ${v.absent}`},children:[e.jsx(m,{size:14,color:v.strong}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:v.strong,lineHeight:z},children:u})]})]})]}),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:v.muted,fontFamily:"var(--font-sans)",lineHeight:z},children:He(o)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:v.strong,fontFamily:"var(--font-sans)",lineHeight:z,whiteSpace:"nowrap"},children:"Expected Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:v.muted,fontFamily:"var(--font-sans)",lineHeight:z,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 ${v.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:v.muted,fontFamily:"var(--font-sans)",lineHeight:z},children:Le(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:v.strong,fontFamily:"var(--font-sans)",lineHeight:z,whiteSpace:"nowrap"},children:"Agent Impact"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:v.muted,fontFamily:"var(--font-sans)",lineHeight:z,textAlign:"center"},children:"Behavior-driven change"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"center",paddingLeft:24,borderLeft:`1px solid ${v.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:v.strong,fontFamily:"var(--font-sans)",lineHeight:z},children:He(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:v.strong,fontFamily:"var(--font-sans)",lineHeight:z,whiteSpace:"nowrap"},children:"Predicted Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:v.muted,fontFamily:"var(--font-sans)",lineHeight:z,textAlign:"center"},children:"With agent behaviors"})]})]})]})]}),i.length>0&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,alignSelf:"stretch"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:v.strong,fontFamily:"var(--font-sans)",lineHeight:z},children:"Key Drivers"}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[F.map((b,a)=>e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${v.absent}`,background:v.white},children:e.jsx("span",{style:{fontSize:12,fontWeight:400,color:v.strong,fontFamily:"var(--font-sans)",lineHeight:z,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},children:b})},a)),j>0&&e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${v.absent}`,background:v.white},children:e.jsxs("span",{style:{fontSize:12,fontWeight:400,color:v.strong,fontFamily:"var(--font-sans)",lineHeight:z,whiteSpace:"nowrap"},children:["+ ",j]})})]})]})]})},Be=({children:t,size:i=28,onClick:o,title:r})=>{const[s,f]=c.useState(!1);return e.jsx("div",{title:r,onClick:o,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",width:i,height:i,borderRadius:9999,background:s?"var(--surface-hover, #F3F7F7)":"transparent",cursor:"pointer",flexShrink:0,transition:"background 0.15s"},children:t})},Ke=({signals:t={signals:[],present_count:0,total_signals_evaluated:0},expandedSignals:i=new Set,toggleSignal:o=()=>{},playEvidence:r=()=>{},highlightTurns:s=()=>{},onShowInTranscript:f=()=>{},timelinePlaying:x=!1,currentTimeSeconds:u=0})=>{const h=(t==null?void 0:t.signals)??[],m=(t==null?void 0:t.present_count)??h.length,F=d=>{const b=Math.floor(d/6e4),a=Math.floor(d%6e4/1e3);return`${b.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`},j=d=>x&&d.start_ms!=null&&u*1e3>=d.start_ms&&u*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(g.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:[m," Signals Detected"]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",background:"var(--Grey-White, #FFF)",gap:8},children:[h.length===0&&e.jsx("div",{style:{padding:"8px 0",fontSize:14,color:"var(--Grey-Muted, #808183)"},children:"No signals detected."}),h.map((d,b)=>{var w,S,M;const a=d.key??d.id??b,p=i.has(a),y=((w=d.observations)==null?void 0:w.length)??0;return e.jsxs("div",{id:`signal-${a}`,style:{display:"flex",flexDirection:"column",width:"100%",gap:8},children:[e.jsxs("button",{onClick:()=>o(a),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||((S=d.key)==null?void 0:S.replace(/_/g," ")),y>0&&e.jsxs("span",{style:{fontWeight:600,color:"var(--text-dark, #0B0A0A)",marginLeft:6},children:["(",y,")"]})]}),p?e.jsx(g.ChevronUp,{size:20,color:"#767473"}):e.jsx(g.ChevronDown,{size:20,color:"#767473"})]}),p&&((M=d.observations)==null?void 0:M.length)>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0},children:d.observations.map((G,O)=>{var E,H,D;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:G.reason||G.explanation}),((H=(E=G.evidence)==null?void 0:E[0])==null?void 0:H.start_ms)!=null&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx(Be,{size:28,title:"Show in transcript",onClick:I=>{I.stopPropagation(),f(G.evidence[0].start_ms)},children:e.jsx(g.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:F(G.evidence[0].start_ms)})]})]}),(D=G.evidence)==null?void 0:D.map((I,L)=>{const B=I.start_ms!=null&&I.end_ms!=null;return I.text&&e.jsxs("div",{onClick:$=>{$.stopPropagation(),B&&r(I)},onMouseEnter:()=>s(I.turn_ids??[]),onMouseLeave:()=>s([]),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0",cursor:B?"pointer":"default"},children:[B&&e.jsx(Be,{size:28,children:j(I)?e.jsx(g.PauseCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(g.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:["“",I.text,"”"]})]},L)})]},G.key??O)})})]},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)"},$t=({score:t=4,maxScore:i=10})=>{const m=Math.min(Math.round(t/i*5),5),F=180/5,j=a=>{const p=a*Math.PI/180;return{x:121.5+85*Math.cos(p),y:123-85*Math.sin(p)}},d=(a,p)=>{const y=j(a),w=j(p),S=a-p>180?1:0;return`M ${y.x} ${y.y} A 85 85 0 ${S} 1 ${w.x} ${w.y}`},b=2;return e.jsx("svg",{width:"100%",viewBox:"0 0 243 130",fill:"none",style:{maxWidth:243},children:Array.from({length:5},(a,p)=>{const y=180-p*F-(p>0?b/2:0),w=180-(p+1)*F+(p<5-1?b/2:0),S=p<m;return e.jsx("path",{d:d(y,w),stroke:S?_.strong:_.track,strokeWidth:30,strokeLinecap:"butt",fill:"none"},p)})})},Nt=({value:t=0,maxValue:i=5})=>e.jsx("div",{style:{display:"flex",gap:2},children:Array.from({length:i},(o,r)=>e.jsx("div",{style:{width:22,height:6,borderRadius:1,background:r<t?_.strong:_.track}},r))}),qt={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"},Kt=({text:t,children:i})=>{const[o,r]=c.useState(!1),s=c.useRef(null),[f,x]=c.useState({top:0,left:0}),u=()=>{if(s.current){const h=s.current.getBoundingClientRect();x({top:h.top-8,left:h.left+h.width/2})}r(!0)};return e.jsxs("div",{ref:s,style:{position:"relative",display:"inline-flex"},onMouseEnter:u,onMouseLeave:()=>r(!1),children:[i,o&&e.jsx("div",{style:{position:"fixed",top:f.top,left:f.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})})]})},Yt=({label:t,value:i=0,maxValue:o=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:_.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:t}),e.jsx(Kt,{text:qt[t]||t,children:e.jsx(g.Info,{size:14,color:_.infoIcon,strokeWidth:1,style:{cursor:"pointer"}})})]}),e.jsx(Nt,{value:i,maxValue:o})]}),Ye=({score:t=83,maxScore:i=100,predictedScore:o=4,predictedLabel:r="Predicted Objective",description:s="",legends:f=[{label:"CSAT",value:3},{label:"Resolution",value:4},{label:"Process Adherence",value:5},{label:"Communication",value:3}]})=>{const x=String(o).padStart(2,"0");return e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,borderRadius:8,border:`1px solid ${_.absent}`,background:_.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:_.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Compass Score"}),e.jsx("span",{style:{fontSize:14,fontWeight:400,color:_.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($t,{score:t,maxScore:i}),(()=>{const m=-(180-(i>0?Math.min(t/i,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:_.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.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[e.jsx("div",{style:{fontSize:28,fontWeight:400,color:_.strong,fontFamily:"var(--font-sans)",lineHeight:1,textAlign:"center"},children:x}),e.jsx("div",{style:{fontSize:14,fontWeight:400,color:_.muted,fontFamily:"var(--font-sans)",lineHeight:1.43,textAlign:"center"},children:r})]}),e.jsx("div",{style:{width:"100%",height:1,background:_.absent}}),f.map((u,h)=>e.jsx(Yt,{label:u.label,value:u.value},h))]})]})]})},ue=t=>{if(!t)return null;const i=String(t).toLowerCase();return i==="supervisor"?"var(--rail-compliance, #C98A5A)":i==="admin"||i==="administrator"?"var(--rail-discovery, #5E88B0)":i==="agent"?"var(--rail-outcome, #6B7C93)":null},se=t=>(t||"").split(" ").map(i=>i[0]).join("").toUpperCase()||"U",Vt=t=>{if(!t)return"";if(!/^\d{4}-\d{2}-\d{2}T/.test(t))return t;try{const i=new Date(t);if(Number.isNaN(i.getTime()))return t;const r=new Date().getTime()-i.getTime(),s=Math.floor(r/6e4),f=Math.floor(r/36e5);if(s<1)return"Just now";if(s<60)return`${s} min`;if(f<24)return`${f} h`;const x=Math.floor(f/24);return x===1?"1 day":`${x} days`}catch{return t}},Ve=({name:t,initials:i,color:o,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:o||"#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:i||se(t)}),Pe=({comment:t,isReply:i=!1,onReply:o,onSendReply:r,onEdit:s,onDelete:f,onMenuClick:x,showReply:u=!0})=>{const[h,m]=c.useState(!1),[F,j]=c.useState(!1),[d,b]=c.useState(!1),[a,p]=c.useState(""),[y,w]=c.useState(!1),[S,M]=c.useState(""),G=c.useRef(null),O=c.useRef(null),E=t.author||{},H=E.name||t.author_name||"Unknown",D=E.initials||se(H),I=E.role||t.author_role,L=E.color||ue(I)||"#6B7C93",B=E.avatar||t.avatar,$=Vt(t.timestamp||t.created_at),V=Array.isArray(t.content)?t.content:[t.content||t.text||""];return c.useEffect(()=>{if(!F)return;const n=R=>{G.current&&!G.current.contains(R.target)&&j(!1)};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[F]),e.jsxs("div",{onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),style:{display:"flex",paddingLeft:i?48:0,alignItems:"flex-start",gap:16,paddingTop:8,paddingBottom:8},children:[e.jsx(Ve,{name:H,initials:D,color:L,avatar:B}),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:H}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:$})]}),e.jsxs("div",{style:{position:"relative"},ref:G,children:[e.jsx("button",{type:"button",onClick:()=>j(n=>!n),style:{padding:2,border:"none",background:"transparent",cursor:"pointer",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",opacity:h||F?1:0,transition:"opacity 0.15s",flexShrink:0},children:e.jsx(g.Ellipsis,{size:24,color:"var(--Grey-Muted, #808183)"})}),F&&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:[o&&e.jsx("button",{type:"button",onClick:()=>{j(!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:n=>{n.currentTarget.style.background="var(--surface-hover, #F3F7F7)"},onMouseLeave:n=>{n.currentTarget.style.background="transparent"},children:"Reply"}),s&&e.jsx("button",{type:"button",onClick:()=>{j(!1);const n=Array.isArray(t.content)?t.content.join(`
16
- `):t.content||t.text||"";M(n),w(!0),b(!1)},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:n=>{n.currentTarget.style.background="var(--surface-hover, #F3F7F7)"},onMouseLeave:n=>{n.currentTarget.style.background="transparent"},children:"Edit"}),f&&e.jsx("button",{type:"button",onClick:()=>{j(!1),f(t)},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:n=>{n.currentTarget.style.background="var(--surface-hover, #F3F7F7)"},onMouseLeave:n=>{n.currentTarget.style.background="transparent"},children:"Delete"})]})]})]}),y?e.jsxs("div",{style:{marginTop:4,display:"flex",flexDirection:"column",gap:8,width:"100%"},children:[e.jsx("textarea",{value:S,onChange:n=>M(n.target.value),onKeyDown:n=>{n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),S.trim()&&(s==null||s({...t,content:S.trim()}),w(!1))),n.key==="Escape"&&w(!1)},autoFocus:!0,rows:3,style:{width:"100%",padding:"10px 12px",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:8,background:"var(--Grey-White, #FFF)",outline:"none",resize:"vertical",boxSizing:"border-box"}}),e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[e.jsx("button",{type:"button",onClick:()=>w(!1),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:"var(--Grey-Muted, #808183)",background:"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>{S.trim()&&(s==null||s({...t,content:S.trim()}),w(!1))},disabled:!S.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:S.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:S.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:S.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Save"})]})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"flex-start"},children:V.map((n,R)=>e.jsx("div",{style:{fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",lineHeight:"160%",fontFamily:"var(--default-font-family)",padding:"8px 12px",background:i?"var(--surface-hover, #F3F7F7)":"var(--surface-warm-40, rgba(243, 241, 229, 0.40))",borderRadius:8,wordBreak:"break-word"},children:n},R))}),u&&o&&!d&&e.jsxs("button",{type:"button",onClick:()=>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(g.CornerDownRight,{size:20,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),"Reply"]}),d&&e.jsxs("div",{style:{marginTop:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx("textarea",{ref:O,value:a,onChange:n=>p(n.target.value),onKeyDown:n=>{n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),a.trim()&&(r==null||r({content:a.trim(),parentId:t.id}),p(""),b(!1))),n.key==="Escape"&&(p(""),b(!1))},autoFocus:!0,placeholder:"Type your reply...",rows:3,style:{width:"100%",padding:"10px 12px",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:8,background:"var(--Grey-White, #FFF)",outline:"none",resize:"vertical",boxSizing:"border-box"}}),e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[e.jsx("button",{type:"button",onClick:()=>{p(""),b(!1)},style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:"var(--Grey-Muted, #808183)",background:"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>{a.trim()&&(r==null||r({content:a.trim(),parentId:t.id}),p(""),b(!1))},disabled:!a.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:a.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:a.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:a.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Reply"})]})]})]})]})},Qt=({currentUser:t,onSubmit:i})=>{const[o,r]=c.useState(""),[s,f]=c.useState(!1),x=c.useRef(null),u=()=>{const d=o.trim();d&&(i==null||i(d),r(""))},h=d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),u())},m=(t==null?void 0:t.initials)||se(t==null?void 0:t.name),F=(t==null?void 0:t.color)||ue(t==null?void 0:t.role)||"#6B7C93",j=t==null?void 0:t.avatar;return e.jsxs("div",{style:{display:"flex",gap:16,alignItems:"flex-start"},children:[e.jsx(Ve,{name:t==null?void 0:t.name,initials:m,color:F,avatar:j}),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:x,value:o,onChange:d=>r(d.target.value),onFocus:()=>f(!0),onBlur:()=>f(!1),onKeyDown:h,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:u,disabled:!o.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:o.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:o.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:o.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",transition:"all 0.15s",flexShrink:0,lineHeight:"150%"},children:"Post"})]})})]})},Qe=({comments:t=[],totalComments:i,onSendComment:o,onReply:r,onSendReply:s,onEdit:f,onDelete:x,onMenuClick:u,onMarkResolved:h,currentUser:m,isResolved:F=!1})=>{const j=c.useMemo(()=>{const a=t.filter(y=>!y.parentId),p={};return t.forEach(y=>{y.parentId&&(p[y.parentId]||(p[y.parentId]=[]),p[y.parentId].push(y))}),a.map(y=>({...y,replies:p[y.id]||[]}))},[t]),d=c.useMemo(()=>{if(!m)return{name:"You",initials:"YO",color:"#6B7C93"};const a=m.name||"You",p=m.initials||se(a),y=m.role&&String(m.role).toLowerCase(),w=m.color||ue(y)||"#6B7C93";return{...m,name:a,initials:p,color:w}},[m]),b=i??t.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(g.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",b>0?` (${b<10?"0":""}${b})`:""]})]}),F?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(g.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"})]}):h?e.jsxs("button",{type:"button",onClick:h,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(g.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:552,maxWidth:"100%"},children:[t.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:0,marginBottom:24},children:j.map(a=>e.jsxs(c.Fragment,{children:[e.jsx(Pe,{comment:a,isReply:!1,onReply:r,onSendReply:s,onEdit:f,onDelete:x,onMenuClick:u,showReply:a.replies.length===0}),a.replies.map((p,y)=>e.jsx(Pe,{comment:p,isReply:!0,onReply:r,onSendReply:s,onEdit:f,onDelete:x,onMenuClick:u,showReply:y===a.replies.length-1},p.id))]},a.id))}),e.jsx(Qt,{currentUser:d,onSubmit:o})]})})]})},X=({text:t,children:i})=>{const[o,r]=c.useState(!1),s=c.useRef(null),[f,x]=c.useState({top:0,left:0});if(!t)return i;const u=()=>{if(s.current){const h=s.current.getBoundingClientRect();x({top:h.top-2,left:h.left+h.width/2})}r(!0)};return e.jsxs("div",{ref:s,style:{position:"relative",display:"inline-flex"},onMouseEnter:u,onMouseLeave:()=>r(!1),children:[i,o&&e.jsx("div",{style:{position:"fixed",top:f.top,left:f.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})})]})},Ut=[{key:"overview",label:"Overview"},{key:"coaching",label:"Coaching Summary"},{key:"signals",label:"Signals & Recording"},{key:"comments",label:"Comments"}],Zt=({title:t="Wheel Stud Replacement Enquiry",onBack:i,data:o,coachingData:r,coachingLoading:s=!1,audioUrl:f,audioRef:x,currentTimeSeconds:u,timelinePlaying:h,playbackRate:m,timelineSegments:F,onSeek:j,onTogglePlay:d,onSeekBack:b,onSeekForward:a,onSetPlaybackRate:p,agentName:y,agentFullName:w,customerName:S,customerFullName:M,transcript:G,activeTurnIndex:O,turnObservations:E,highlightedTurns:H,onTurnPlayPause:D,onPlayEvidence:I,onHighlightTurns:L,callPurpose:B,classification:$,outcomeQuality:V,resolutionOutcome:n,customerIntent:R,interactionId:K,moreDetails:Ue,compassScore:Ze,compassMaxScore:Xt=10,predictedCsat:Xe,predictedLabel:Je="Predicted Objective",compassLegends:et,customerSessions:tt,customerSessionCount:nt,onSessionClick:ye,onViewAllSessions:xe,prevSessionDesc:it,prevSessionDisabled:J=!1,nextSessionDesc:st,nextSessionDisabled:ee=!1,onPreviousSession:me,onNextSession:ve,comments:ot,currentUser:rt,onSendComment:lt,onSendReply:at,onReply:dt,onEdit:ct,onDelete:ft,onMenuClick:pt,onMarkResolved:gt,commentsResolved:ht})=>{var Ge,_e;const[oe,be]=c.useState("overview"),[ut,je]=c.useState(new Set),[Se,re]=c.useState(!1),[ke,Ce]=c.useState(null),[yt,we]=c.useState(!1),[xt,mt]=c.useState(0),Q=c.useRef(null),le=c.useRef(null),ae=c.useRef(null),de=c.useRef(null),ce=c.useRef(null),vt={overview:le,coaching:ae,signals:de,comments:ce},fe=c.useRef(null),pe=c.useRef(!1);c.useEffect(()=>{const l=fe.current;if(!l)return;const k=["overview","coaching","signals","comments"],C=[le,ae,de,ce],T=(Y=>{let P=Y.parentElement;for(;P;){const{overflow:ie,overflowY:Me}=window.getComputedStyle(P);if(/(auto|scroll)/.test(ie+Me))return P;P=P.parentElement}return null})(l),q=()=>{if(pe.current)return;let Y=k[0];for(let P=C.length-1;P>=0;P--){const ie=C[P].current;if(!ie)continue;if(ie.getBoundingClientRect().top<=150){Y=k[P];break}}be(Y)};return l.addEventListener("scroll",q,{passive:!0}),T&&T!==l&&T.addEventListener("scroll",q,{passive:!0}),window.addEventListener("scroll",q,{passive:!0,capture:!0}),()=>{l.removeEventListener("scroll",q),T&&T!==l&&T.removeEventListener("scroll",q),window.removeEventListener("scroll",q,{capture:!0})}},[]);const bt=l=>{var C;be(l),pe.current=!0;const k=(C=vt[l])==null?void 0:C.current;if(k){const N=fe.current;if(N&&N.scrollHeight>N.clientHeight){const T=N.getBoundingClientRect().top,Y=k.getBoundingClientRect().top-T+N.scrollTop-16;N.scrollTo({top:Y,behavior:"smooth"})}else{const T=k.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:T,behavior:"smooth"})}}setTimeout(()=>{pe.current=!1},800)},Fe=tt||[],jt=l=>{var C;const k=l/1e3;(C=Q.current)!=null&&C.scrollToTranscript&&Q.current.scrollToTranscript(k)},St=l=>{var k;if(I)I(l);else{const C=l.start_ms??l.startMs;if(C!=null&&((k=Q.current)!=null&&k.seekTo)){Q.current.seekTo(C/1e3),we(!0),mt(C/1e3);const T=(l.end_ms??l.endMs??C+5e3)-C;setTimeout(()=>we(!1),T)}}},kt=l=>{L&&L(l)},Ct=l=>{je(k=>{const C=new Set(k);return C.has(l)?C.delete(l):C.add(l),C})},wt=(o==null?void 0:o.blocks)||[],U=l=>{var k;return((k=wt.find(C=>C.block_id===l))==null?void 0:k.payload)||{}},A=U("interaction-metadata"),te=U("interaction-context"),ne=U("interaction-signals"),De=U("interaction-outcome-lift"),Ft=U("interaction-dimensions").dimensions||[],Dt=te.call_purpose||{},It=te.classification||{},Ie={duration_seconds:156,message_count:25,...A},We={interaction_driver:"General Information",interaction_direction:"inbound",...Dt},Wt={interaction_paradigm:"Informational",...It},zt={p_expected:.94,p_full:.83,lift_raw:-.11,lift:.043,interpretation:{lift_band:"positive"},...De},Gt=((Ge=De.driver_signal_keys)==null?void 0:Ge.map(l=>l.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"},Mt=(_e=ne==null?void 0:ne.signals)!=null&&_e.length?ne:{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."}]}]},ge=y||A.agent_name||A.agent||te.agent_name||"Agent",Et=w||A.agent_full_name||A.agent_name||ge,Z=S||A.customer_name||A.customer||te.customer_name||"Customer",ze=M||A.customer_full_name||A.customer_name||Z,he=nt??Fe.length,Rt=A.evaluated_dt?new Date(A.evaluated_dt).toLocaleString():"3/29/2026, 8:30:00 AM",At=We.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:i,style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0,flexShrink:0},children:e.jsx(g.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}),(me||ve)&&e.jsxs("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[e.jsx(X,{text:it,children:e.jsxs("button",{onClick:J?void 0:me,disabled:J,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:J?"default":"pointer",opacity:J?.4:1},children:[e.jsx(g.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(X,{text:st,children:e.jsxs("button",{onClick:ee?void 0:ve,disabled:ee,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:ee?"default":"pointer",opacity:ee?.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(g.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:Ut.map(l=>e.jsx("button",{onClick:()=>bt(l.key),style:{display:"flex",padding:16,alignItems:"center",gap:10,background:"none",border:"none",borderBottom:oe===l.key?"3px solid var(--Grey-Strong, #2E3236)":"3px solid transparent",cursor:"pointer",fontSize:15,fontWeight:oe===l.key?500:400,color:oe===l.key?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",whiteSpace:"nowrap",transition:"border-color 0.2s ease, color 0.2s ease"},children:l.label},l.key))})]}),e.jsxs("div",{ref:fe,style:{padding:24,flex:1,overflowY:"auto"},children:[e.jsxs("div",{ref:le,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(g.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(g.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:Rt})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0"},children:[e.jsx(g.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(X,{text:Et,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0",cursor:"default"},children:[e.jsx(g.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:ge})]})}),e.jsx(g.Repeat,{size:16,color:"var(--color-input-border, #ACACAD)",strokeWidth:1.5}),he>1?e.jsxs("div",{style:{position:"relative"},children:[e.jsx(X,{text:ze,children:e.jsxs("button",{onClick:()=>re(l=>!l),style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",background:"none",border:"none",cursor:"pointer"},children:[e.jsx(g.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:[Z," (",he," Sessions)"]}),Se?e.jsx(g.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(g.ChevronDown,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5})]})}),Se&&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(g.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:Z}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1},children:[he," Sessions in past"]})]})]}),Fe.slice(0,5).map((l,k)=>e.jsxs("div",{onClick:()=>{ye&&ye(l),re(!1)},onMouseEnter:()=>Ce(k),onMouseLeave:()=>Ce(null),style:{display:"flex",width:264,padding:"12px 16px",justifyContent:"space-between",alignItems:"center",background:ke===k?"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:l.title}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1},children:l.date})]}),ke===k&&e.jsx(g.ExternalLink,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1,style:{flexShrink:0}})]},l.id||k)),e.jsx("div",{style:{padding:16,borderTop:"1px solid var(--Grey-absent, #D9D9D9)",display:"flex",justifyContent:"center"},children:e.jsxs("button",{onClick:()=>{xe&&xe(),re(!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(g.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(X,{text:ze,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",cursor:"default"},children:[e.jsx(g.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:Z})]})})]})]})]}),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(Ye,{score:Ze??0,maxScore:5,predictedScore:Xe??0,predictedLabel:Je,legends:et})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"flex-end",gap:24,flex:1,minWidth:0},children:[e.jsx(Ne,{meta:Ie,callPurpose:B||We,classification:$||Wt,outcomeQuality:V||"Neutral",dimensions:Ft,resolutionOutcome:n,customerIntent:R,interactionId:K??A.interaction_id,moreDetails:Ue}),e.jsx(qe,{outcomeLift:zt,driverLabels:Gt})]})]})]}),e.jsx("div",{ref:ae,style:{paddingTop:24},children:e.jsx($e,{data:s?null:_t,loading:s})}),e.jsxs("div",{ref:de,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(g.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(Ke,{signals:Mt,expandedSignals:ut,toggleSignal:Ct,playEvidence:St,highlightTurns:kt,onShowInTranscript:jt,timelinePlaying:h||yt,currentTimeSeconds:u??xt})}),e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(Oe.UpdatedInteractionRecording,{ref:Q,audioUrl:f,durationSeconds:Ie.duration_seconds,audioRef:x,agentName:ge,customerName:Z.split(" ")[0],currentTimeSeconds:u,timelinePlaying:h,playbackRate:m,timelineSegments:F,onSeek:j,onTogglePlay:d,onSeekBack:b,onSeekForward:a,onSetPlaybackRate:p,transcript:G,activeTurnIndex:O,turnObservations:E,highlightedTurns:H,onTurnPlayPause:D,setExpandedSignals:je})})]})]}),e.jsx("div",{ref:ce,style:{paddingTop:24},children:e.jsx(Qe,{comments:ot||[{id:"c1",author:{name:"Lucy",initials:"LU",color:"var(--rail-compliance, #C98A5A)",role:"supervisor"},content:"Demonstrated courtesy and professionalism throughout the call. Close the loop by restating the plan and confirming next steps to ensure customer certainty.",timestamp:"2 days"},{id:"c2",author:{name:"David",initials:"DA",color:"var(--rail-outcome, #6B7C93)",role:"agent"},content:"Sounds good! Please share link with me. Thanks",timestamp:"51 min",parentId:"c1"},{id:"c3",author:{name:"Lucy",initials:"LU",color:"var(--rail-compliance, #C98A5A)",role:"supervisor"},content:"Sure, will do",timestamp:"12 h",parentId:"c2"},{id:"c4",author:{name:"Lucy",initials:"LU",color:"var(--rail-compliance, #C98A5A)",role:"supervisor"},content:"Please follow guidelines thoroughly.",timestamp:"12 h"},{id:"c5",author:{name:"David",initials:"DA",color:"var(--rail-outcome, #6B7C93)",role:"agent"},content:["Sounds great! I will make sure to follow guidelines and make it even better in next conversations. Thanks for your feedback!","Please let me know if we need to connect?"],timestamp:"51 min",parentId:"c4"}],totalComments:6,currentUser:rt,onSendComment:lt||(()=>{}),onSendReply:at||(()=>{}),onReply:dt||(()=>{}),onEdit:ct||(()=>{}),onDelete:ft||(()=>{}),onMenuClick:pt||(()=>{}),onMarkResolved:gt||(()=>{}),isResolved:ht})})]})]})};exports.UpdatedInteractionRecording=Oe.UpdatedInteractionRecording;exports.UpdatedCoachingSynthesisCard=$e;exports.UpdatedCompassScore=Ye;exports.UpdatedInteractionContext=Ne;exports.UpdatedInteractionDetails=Zt;exports.UpdatedInteractionScores=qe;exports.UpdatedInteractionSignals=Ke;exports.UpdatedThreads=Qe;
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:"Overview205"},{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;
17
17
  //# sourceMappingURL=UpdatedInteractionDetails.cjs.js.map