1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9c7263f1-4daf-411d-8ce1-fc6bcb0d645f",e._sentryDebugIdIdentifier="sentry-dbid-9c7263f1-4daf-411d-8ce1-fc6bcb0d645f")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8992],{1111:(e,t,r)=>{"use strict";r.d(t,{B:()=>o});var n=r(73365);r(1521);let o=e=>{let{chips:t,onRemoveFilter:r,className:o="flex flex-wrap gap-1.5 mt-2 mb-1"}=e;return 0===t.length?null:(0,n.jsx)("div",{className:o,"data-sentry-component":"FilterChipList","data-sentry-source-file":"filter-chip-list.tsx",children:t.map((e,t)=>(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-medium bg-[#E0F8F7] text-[#1a6b5a] border border-[#CAFAED]",children:["category"===e.type&&(0,n.jsx)("svg",{className:"w-3 h-3 opacity-60",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"})}),"spec"===e.type&&(0,n.jsx)("svg",{className:"w-3 h-3 opacity-60",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.label,r&&(0,n.jsx)("button",{type:"button",onClick:()=>r(e.type,e.value),className:"ml-0.5 hover:text-red-600 transition-colors","aria-label":"Remove ".concat(e.label," filter"),children:(0,n.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},"".concat(e.type,"-").concat(e.value,"-").concat(t)))})}},5911:(e,t,r)=>{"use strict";r.d(t,{B:()=>s});var n=r(73365),o=r(1521);let l=(0,r(13923).A)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);var a=r(34493);let s=e=>{let{message:t,onRetry:r}=e,{sentence:s,reference:i}=function(e){let t=e.match(/\s*\(Reference\s+([^)]+)\)\s*$/i);return t?{sentence:e.slice(0,t.index).trim(),reference:t[1].trim()}:{sentence:e.trim(),reference:null}}(t),[d,c]=(0,o.useState)(!1);return(0,n.jsxs)("div",{className:"inline-flex max-w-full flex-col gap-2.5 rounded-xl border border-gray-200 bg-gray-50 px-4 py-3","data-sentry-component":"ChatErrorNotice","data-sentry-source-file":"ChatErrorNotice.tsx",children:[(0,n.jsx)("p",{className:"m-0 text-[14.5px] leading-[1.5] text-gray-700",children:s}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[r&&(0,n.jsxs)("button",{type:"button",disabled:d,onClick:()=>{d||(c(!0),r())},className:(0,a.cn)("inline-flex items-center gap-1.5 rounded-lg border border-[#0B9E93] bg-white px-3 py-1.5","text-[12px] font-semibold leading-none text-[#0B9E93] transition-colors",d?"cursor-default opacity-60":"hover:bg-[#0B9E93]/5"),children:[(0,n.jsx)(l,{className:(0,a.cn)("h-3.5 w-3.5",d&&"animate-spin"),"aria-hidden":"true"}),"Try again"]}),i&&(0,n.jsx)("span",{className:"select-all font-mono text-[11px] leading-none tracking-tight text-gray-400",title:"Quote this to support",children:i})]})]})}},10448:(e,t,r)=>{"use strict";r.d(t,{tq:()=>et});var n=r(73365),o=r(35544),l=r(1521),a=r(98196),s=r(40182),i=r(67494),d=r(46431),c=r(3382),u=r(54894),p=r(74484),m=r(95188),h=r(70453),x=r(97004),g=r(7984);r(15347);var f=r(34493);let y=e=>{let{label:t,className:r,disabled:o=!1,instant:l=!1,placement:a="bottom",align:s="center",children:i}=e;return(0,n.jsxs)("span",{className:(0,f.cn)("relative inline-flex flex-shrink-0 group/otistip",r),"data-sentry-component":"HoverTooltip","data-sentry-source-file":"HoverTooltip.tsx",children:[i,!o&&(0,n.jsx)("span",{role:"tooltip",className:(0,f.cn)("pointer-events-none absolute z-50 whitespace-nowrap rounded border border-gray-200 bg-white px-1.5 py-0.5 text-[10px] font-medium leading-tight text-gray-900 shadow-sm opacity-0 [@media(hover:hover)]:group-hover/otistip:opacity-100","end"===s?"right-0":"left-1/2 -translate-x-1/2","top"===a?"bottom-full mb-0.5":"top-full mt-0.5",l?"transition-none":"transition-opacity duration-100 group-hover/otistip:delay-150"),children:t})]})};var b=r(1111);let v=e=>{let{filters:t,onRemoveFilter:r}=e;return(0,n.jsx)(b.B,{chips:function(e){let t=[];if(e.categories)for(let r of e.categories)t.push({type:"category",label:r,value:r});if(e.tags)for(let r of e.tags)t.push({type:"tag",label:r,value:r});if(e.specs)for(let n of e.specs){var r;let o=null==(r=e.specsImportance)?void 0:r.find(e=>e.specId===n.specId),l=o?o.importance>=.9?" (must-have)":o.importance>=.7?" (important)":" (nice-to-have)":"";t.push({type:"spec",label:"".concat(n.specName,": ").concat(n.value).concat(l),value:n.specId})}return e.pricingModel&&t.push({type:"pricing",label:"Pricing: ".concat(e.pricingModel.replace(/_/g," ").toLowerCase()),value:e.pricingModel}),e.maxPrice&&t.push({type:"maxPrice",label:"Max $".concat(e.maxPrice,"/mo"),value:String(e.maxPrice)}),t}(t),onRemoveFilter:r,"data-sentry-element":"FilterChipList","data-sentry-component":"QuickMatchFilterChips","data-sentry-source-file":"QuickMatchFilterChips.tsx"})},w="#B42318",j=e=>{let{label:t,onRemove:r}=e,o=(0,l.useRef)(null),s=(0,l.useRef)(null),[i,d]=(0,l.useState)(null);return(0,n.jsxs)("span",{ref:o,onMouseEnter:()=>{let e=s.current;e&&e.scrollWidth>e.clientWidth+1&&o.current&&d(o.current.getBoundingClientRect())},onMouseLeave:()=>d(null),className:"inline-flex items-center gap-1 text-[12px] text-gray-900 rounded-full px-2.5 py-1 max-w-full min-w-0",style:{background:"rgba(75, 190, 179, 0.10)",border:"1px solid rgba(75, 190, 179, 0.45)"},"data-sentry-component":"Pill","data-sentry-source-file":"ProfileItemPills.tsx",children:[(0,n.jsx)("span",{ref:s,className:"truncate min-w-0",children:t}),r&&(0,n.jsx)("span",{role:"button",tabIndex:0,onClick:e=>{e.stopPropagation(),r()},onKeyDown:e=>
1{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),r())},"aria-label":"Remove ".concat(t),className:"ml-0.5 inline-flex items-center justify-center rounded-full transition-all flex-shrink-0 cursor-pointer",style:{width:18,height:18,opacity:.5,background:"transparent"},onMouseEnter:e=>{e.currentTarget.style.opacity="1",e.currentTarget.style.background="rgba(0,0,0,0.08)"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.5",e.currentTarget.style.background="transparent"},children:(0,n.jsx)("svg",{className:"text-gray-700",width:10,height:10,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),i&&"undefined"!=typeof document&&(0,a.createPortal)((0,n.jsx)("div",{style:{position:"fixed",left:i.left+i.width/2,top:i.top-8,transform:"translate(-50%, -100%)",maxWidth:260,zIndex:320,pointerEvents:"none",background:"#FFFFFF",color:"#1A1A1A",border:"1px solid rgba(0,0,0,0.08)",borderRadius:8,padding:"6px 9px",fontSize:12,lineHeight:1.4,whiteSpace:"normal",overflowWrap:"anywhere",boxShadow:"0 6px 20px rgba(0,0,0,0.12)"},children:t}),document.body)]})},N=e=>{let{items:t,onRemoveAll:r,onOpenProfile:o,currentLabels:s}=e,[i,d]=(0,l.useState)(!1),[c,u]=(0,l.useState)(null),[p,m]=(0,l.useState)(new Set),[h,x]=(0,l.useState)(null),g=(0,l.useMemo)(()=>t.filter(e=>!p.has(e.id)),[t,p]),f=e=>!!s&&("tag"===e.itemType||"unstructured_requirement"===e.itemType)&&!s.has(e.label.trim().toLowerCase());if(0===t.length)return null;if(0===g.length){var y;let e=(null==h?void 0:h.kind)==="already",r=null!=(y=null==h?void 0:h.count)?y:p.size||t.length;return(0,n.jsxs)("div",{className:"mb-2 flex items-center gap-1.5 text-xs",style:{color:"var(--od-text-secondary)"},children:[(0,n.jsx)("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),e?"Already removed from your profile":"Removing ".concat(r," item").concat(1!==r?"s":""," from your profileâ¦")]})}let b=e=>{if(0===e.length)return;let t=e.filter(e=>!f(e));m(t=>{let r=new Set(t);return e.forEach(e=>r.add(e.id)),r}),u(null),d(!1),t.length>0?(r(t),x({kind:"removing",count:t.length})):x({kind:"already",count:e.length})},v=e=>{f(e)?b([e]):u([e])},N=e=>{d(!1),u(e)};if(c)return(0,n.jsxs)("div",{className:"mb-2 rounded-xl px-3 py-2.5",style:{border:"1px solid rgba(0,0,0,0.10)",background:"#FFFFFF"},role:"alertdialog","aria-label":"Confirm removal",children:[(0,n.jsx)("p",{className:"text-xs font-semibold text-gray-900",children:1===c.length?"Remove this from your decision profile?":"Remove these ".concat(c.length," from your decision profile?")}),(0,n.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:c.map(e=>(0,n.jsx)(j,{label:e.label},e.id))}),(0,n.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[(0,n.jsx)("button",{onClick:()=>{c&&b(c)},className:"text-xs font-semibold px-3 py-1.5 rounded-lg text-white transition-colors hover:brightness-95",style:{background:w},children:"Remove"}),(0,n.jsx)("button",{onClick:()=>u(null),className:"text-xs font-medium px-3 py-1.5 rounded-lg border border-gray-200 text-gray-700 transition-colors hover:bg-gray-50",children:"Cancel"})]})]});let k=g.slice(0,3),C=g.length-k.length,A=g.length>=2,P=i&&"undefined"!=typeof document&&(0,a.createPortal)((0,n.jsxs)("div",{className:"fixed inset-0 z-[300] flex items-center justify-center p-4",onClick:()=>d(!1),role:"dialog","aria-modal":"true","aria-label":"Items added to your decision profile",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),(0,n.jsxs)("div",{className:"relative bg-white rounded-2xl shadow-xl w-full max-w-md flex flex-col max-h-[70vh]",onClick:e=>e.stopPropagation(),style:{boxShadow:"0 16px 48px rgba(0,0,0,0.18)"},children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-gray-100 shrink-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,n.jsx)("svg",{style:{width:16,height:16,color:"var(--od-otis)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 11-3 0m3 0a1.5 1.5 0 10-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-9.75 0h9.75"})}),(0,n.jsxs)("span",{className:"text-sm font-semibold text-gray-900",children:["Added to your profile (",g.length,")"]})]}),(0,n.jsx)("button",{onClick:()=>d(!1),className:"p-1 rounded-md hover:bg-gray-100","aria-label":"Close",children:(0,n.jsx)("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"#6B7280",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"overflow-auto flex-1 px-5 py-4",children:(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:g.map(e=>(0,n.jsx)(j,{label:e.label,onRemove:()=>v(e)},e.id))})}),(0,n.jsx)("div",{className:"flex justify-end px-5 py-3 border-t border-gray-100 shrink-0",children:(0,n.jsx)("button",{onClick:()=>N(g),className:"text-xs font-semibold px-3 py-1.5 rounded-lg border transition-colors hover:bg-red-50",style:{color:w,borderColor:"rgba(180, 35, 24, 0.32)"},children:"Remove all"})})]})]}),document.body);return(0,n.jsxs)("div",{className:"mb-2","data-sentry-component":"ProfileItemPills","data-sentry-source-file":"ProfileItemPills.tsx",children:[(0,n.jsxs)("p",{className:"mb-1 text-[11px] font-medium",style:{color:"var(--od-text-muted)"},children:["Added to your"," ",o?(0,n.jsx)("button",{type:"button",onClick:o,className:"font-semibold underline underline-offset-2 hover:no-underline",style:{color:"var(--od-otis)"},children:"Decision Profile"}):"Decision Profile"]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[k.map(e=>(0,n.jsx)(j,{label:e.label,onRemove:()=>v(e)}
1,e.id)),C>0&&(0,n.jsxs)("button",{onClick:()=>d(!0),className:"text-[12px] text-gray-500 px-1 transition-colors hover:text-gray-700",children:["+ ",C," more"]}),A&&(0,n.jsx)("button",{onClick:()=>N(g),className:"text-xs font-medium px-2 py-1 rounded-md transition-colors hover:bg-gray-100",style:{color:"var(--od-text-secondary)"},"aria-label":"Remove all added items",children:"Remove all"})]}),P]})};var k=r(69460),C=r(73109),A=r(24332),P=r(67916),S=r(4563),E=r(56181),R=r(20647),L=r(32778),T=r(5911);function M(e,t){let r,n=t.toLowerCase();if(!n)return[];let o=[],l=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:e=>{let t=e.parentElement;if(!t)return NodeFilter.FILTER_REJECT;let r=t.tagName;return"SCRIPT"===r||"STYLE"===r||"MARK"===r?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];for(;r=l.nextNode();)a.push(r);for(let e of a){var s;let t=null!=(s=e.textContent)?s:"",r=t.toLowerCase(),l=[],a=0;for(;;){let e=r.indexOf(n,a);if(-1===e)break;l.push([e,e+n.length]),a=e+n.length}if(0===l.length)continue;let i=e.parentNode;if(!i)continue;let d=document.createDocumentFragment(),c=0;for(let[e,r]of l){e>c&&d.appendChild(document.createTextNode(t.slice(c,e)));let n=document.createElement("mark");n.className="od-search-mark",n.textContent=t.slice(e,r),d.appendChild(n),o.push(n),c=r}c<t.length&&d.appendChild(document.createTextNode(t.slice(c))),i.replaceChild(d,e)}return o}let I=/\[([^\]]+)\]\(product:([^)]+)\)/g,F=e=>e.toLowerCase().replace(/[^a-z0-9]/g,""),_=new Set(["great","good","okay","poor","not_scored"].map(e=>(0,P.PN)(e).toLowerCase())),W=new Map,B=new Set,H=/\[[^\]]+\]\(product:([^)]+)\)/g,$=(e,t)=>{var r;let n=e.trim().toLowerCase();return!!n&&(!!_.has(n)||null!=(r=null==t?void 0:t.has(n))&&r)},q=e=>{var t;let{headers:r,rows:o,products:u,onProductClick:p,shortlistHelpers:m,mentionedNames:h,profileLabels:x}=e,[g,f]=(0,l.useState)(!1),[y,b]=(0,l.useState)(!1),v=e=>e.replace(I,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").trim(),w=r.map(v),j=o.map(e=>e.map(v)),N=null!=(t=w[0])?t:"item",k=w.slice(1),C=k.length>0?" â "+k.slice(0,3).join(", ")+(k.length>3?"â¦":""):"",A="".concat(o.length," ").concat(N.toLowerCase()).concat(1!==o.length?"s":"").concat(C),P=async()=>{let e=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\n/g,"<br>"),t=[w.join(" "),...j.map(e=>e.join(" "))].join("\n"),r="<table><thead><tr>"+w.map(t=>"<th>".concat(e(t),"</th>")).join("")+"</tr></thead><tbody>"+j.map(t=>"<tr>".concat(t.map(t=>"<td>".concat(e(t),"</td>")).join(""),"</tr>")).join("")+"</tbody></table>";try{var n;"undefined"!=typeof ClipboardItem&&(null==(n=navigator.clipboard)?void 0:n.write)?await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([r],{type:"text/html"}),"text/plain":new Blob([t],{type:"text/plain"})})]):await navigator.clipboard.writeText(t),b(!0),setTimeout(()=>b(!1),1500)}catch(e){try{await navigator.clipboard.writeText(t),b(!0),setTimeout(()=>b(!1),1500)}catch(e){}}},S=g&&"undefined"!=typeof document&&(0,a.createPortal)((0,n.jsxs)("div",{className:"fixed inset-0 flex items-center justify-center p-4",style:{zIndex:1e4},onClick:()=>f(!1),"data-od-table-modal":"1",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),(0,n.jsxs)("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-4xl flex flex-col",style:{maxHeight:"80vh"},onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-gray-100 shrink-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,n.jsx)(s.A,{className:"w-4 h-4 text-gray-400 shrink-0"}),(0,n.jsx)("span",{className:"text-sm font-medium text-gray-800 truncate",children:w.join(" \xb7 ")}),(0,n.jsxs)("span",{className:"text-xs text-gray-400 shrink-0",children:[o.length," rows"]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,n.jsxs)("button",{onClick:P,className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-700 transition-colors","aria-label":"Copy table",children:[y?(0,n.jsx)(i.A,{className:"w-3.5 h-3.5"}):(0,n.jsx)(d.A,{className:"w-3.5 h-3.5"}),y?"Copied":"Copy table"]}),(0,n.jsx)("button",{onClick:()=>f(!1),className:"p-1.5 rounded-full hover:bg-gray-100 text-gray-400 hover:text-gray-600 transition-colors","aria-label":"Close",children:(0,n.jsx)(c.A,{className:"w-4 h-4"})})]})]}),(0,n.jsx)("div",{className:"overflow-auto flex-1",children:(0,n.jsxs)("table",{className:"w-full text-xs border-collapse",children:[(0,n.jsx)("thead",{className:"sticky top-0 bg-gray-50 z-10",children:(0,n.jsx)("tr",{children:r.map((e,t)=>(0,n.jsx)("th",{className:"px-4 py-2.5 text-left font-semibold text-gray-700 border-b border-gray-200 whitespace-nowrap",children:D(e,"mth-".concat(t),u,p,!1,m,h,x)},t))})}),(0,n.jsx)("tbody",{children:o.map((e,t)=>(0,n.jsx)("tr",{className:t%2==0?"bg-white":"bg-gray-50/50",children:e.map((e,r)=>(0,n.jsx)("td",{className:"px-4 py-2.5 text-gray-700 border-b border-gray-100 align-top",children:D(e,"mtd-".concat(t,"-").concat(r),u,p,!1,m,h,x)},r))},t))})]})})]})]}),document.body);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{onClick:()=>f(!0),className:"flex items-center gap-2 my-2 pl-2.5 pr-3 py-1.5 rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 transition-colors w-fit group","data-od-table-trigger":"1",children:[(0,n.jsx)(s.A,{className:"w-4 h-4 text-teal-500 shrink-0","data-sentry-element":"List","data-sentry-source-file":"AIChatMessages.tsx"}),(0,n.jsx)("span",{className:"text-xs text-gray-600 font-medium",children:A}),(0,n.jsx)("span",{className:"text-[10px] text-gray-400 group-hover:text-gray-500 ml-1 font-normal",children:"View table"})]}),S]})},z=()=>(0,n.jsxs)("div",{className:"flex items-center gap-2 my-2 pl-2.5 pr-3 py-1.5 rounded-lg border border-gray-200 bg-gray-50 w-fit","data-sentry-component":"BuildingTablePlaceholder","data-sentry-source-file":"AIChatMessages.tsx",children:[(0,n.jsx)(u.A,{className:"w-4 h-4 text-teal-500 shrink-0 animate-spin","data-sentry-element":"Loader2","data-sentry-source-file":"AIChatMessages.tsx"}),(0,n.jsx)("span",{className:"text-xs text-gray-500 font-medium animate-pulse",children:"Building tableâ¦"})]}),D=function(e,t,r,o){var l;let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,d=arguments.length>7?arguments[7]:void 0,c=(null!=i?i:[]).filter(e=>!(0,x.d)(e)),u=Array.from(new Set([...null!=(l=null==r?void 0:r.map(e=>e.name))?l:[],...c])).filter(e=>!(0,x.d)(e)),p=[...u].sort((e,t)=>
1t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),m=p.length?"\\b(?:".concat(p.join("|"),")\\b"):"",h="\\[[^\\]]+\\]\\(product:[^)]+\\)",g="`[^`\\n]+`",f="\\*\\*[^*]+\\*\\*",y="\\[[^\\]]+\\]\\([^)\\s]+\\)",b="\\*[^\\s*][^*\\n]*\\*",v="(".concat((m?[h,g,f,y,b,m]:[h,g,f,y,b]).join("|"),")");return e.split(RegExp(v,"gi")).map((e,l)=>{var p,m,h,x;if(!e)return e;let g=/^\[([^\]]+)\]\(product:([^)]+)\)$/i.exec(e);if(g){let e=g[1],c=((e,t,r)=>{if(!r||0===r.length)return;let n=[F(e),F(t)].filter(Boolean);return r.find(e=>n.includes(F(e.name))||!!e.slug&&n.includes(F(e.slug)))})(g[2],e,r);if(c&&!$(e,d)&&((e,t)=>{let r=F(e);if(!r)return!1;for(let n of[t.name,t.slug].filter(Boolean)){let t=F(n);if(!t)continue;if(r===t||r.includes(t)||t.includes(r))return!0;let o=e=>new Set(e.toLowerCase().split(/[^a-z0-9]+/i).filter(e=>e.length>=3)),l=o(e);for(let e of o(n))if(l.has(e))return!0}return!1})(e,c))return(0,n.jsx)(S.Y,{productName:e,canonicalName:c.name,product:c,onProductClick:o,isAdded:null!=(m=null==s||null==(p=s.isProductAdded)?void 0:p.call(s,c.id))&&m,onAddProduct:null==s?void 0:s.onAddProduct,onRemoveProduct:null==s?void 0:s.onRemoveProduct,isHeader:a},"".concat(t,"-").concat(l));let u=(null!=i?i:[]).find(e=>e.toLowerCase()===g[2].trim().toLowerCase());return u&&!$(e,d)?(0,n.jsx)(S.Y,{productName:e,canonicalName:u,onProductClick:o,onResolveProduct:null==s?void 0:s.onResolveProduct,isProductAdded:null==s?void 0:s.isProductAdded,onAddProduct:null==s?void 0:s.onAddProduct,onRemoveProduct:null==s?void 0:s.onRemoveProduct,isHeader:a},"".concat(t,"-").concat(l)):e}if(e.length>1&&e.startsWith("`")&&e.endsWith("`"))return(0,n.jsx)("code",{className:"rounded bg-gray-100 px-1 py-0.5 font-mono text-[0.88em] text-gray-800",children:e.slice(1,-1)},"".concat(t,"-").concat(l));let f=/^\[([^\]]+)\]\(([^)\s]+)\)$/.exec(e);if(f){let e=f[2];return/^(https?:\/\/|mailto:)/i.test(e)?(0,n.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:no-underline",style:{color:"var(--od-otis)"},children:f[1]},"".concat(t,"-").concat(l)):f[1]}if(e.startsWith("**")&&e.endsWith("**")){let a=e.slice(2,-2);return(0,n.jsx)("strong",{className:"font-semibold text-midnight",children:D(a,"".concat(t,"-b").concat(l),r,o,!0,s,i,d)},"".concat(t,"-").concat(l))}if(e.length>2&&e.startsWith("*")&&e.endsWith("*"))return(0,n.jsx)("em",{children:D(e.slice(1,-1),"".concat(t,"-i").concat(l),r,o,a,s,i,d)},"".concat(t,"-").concat(l));let y=u.length?null==r?void 0:r.find(t=>t.name.toLowerCase()===e.toLowerCase()):void 0;if(y)return(0,n.jsx)(S.Y,{productName:e,product:y,onProductClick:o,isAdded:null!=(x=null==s||null==(h=s.isProductAdded)?void 0:h.call(s,y.id))&&x,onAddProduct:null==s?void 0:s.onAddProduct,onRemoveProduct:null==s?void 0:s.onRemoveProduct,isHeader:a},"".concat(t,"-").concat(l));let b=c.find(t=>t.toLowerCase()===e.toLowerCase());return b?(0,n.jsx)(S.Y,{productName:e,canonicalName:b,onProductClick:o,onResolveProduct:null==s?void 0:s.onResolveProduct,isProductAdded:null==s?void 0:s.isProductAdded,onAddProduct:null==s?void 0:s.onAddProduct,onRemoveProduct:null==s?void 0:s.onRemoveProduct,isHeader:a},"".concat(t,"-").concat(l)):e})},O={rightarrow:"â",to:"â",longrightarrow:"â¶",hookrightarrow:"âª",leftarrow:"â",gets:"â",longleftarrow:"âµ",hookleftarrow:"â©",Rightarrow:"â",Longrightarrow:"â¹",Leftarrow:"â",Longleftarrow:"â¸",leftrightarrow:"â",harr:"â",longleftrightarrow:"â·",Leftrightarrow:"â",iff:"â",uparrow:"â",downarrow:"â",updownarrow:"â",Uparrow:"â",Downarrow:"â",mapsto:"â¦",times:"\xd7",div:"\xf7",pm:"\xb1",mp:"â",cdot:"\xb7",bullet:"â¢",ast:"â",star:"â
",oplus:"â",otimes:"â",circ:"â",leq:"â¤",le:"â¤",geq:"â¥",ge:"â¥",neq:"â ",ne:"â ",approx:"â",equiv:"â¡",cong:"â
",sim:"â¼",simeq:"â",propto:"â",forall:"â",exists:"â",nexists:"â",in:"â",notin:"â",ni:"â",subset:"â",supset:"â",subseteq:"â",supseteq:"â",cup:"âª",cap:"â©",emptyset:"â
",varnothing:"â
",land:"â§",lor:"â¨",neg:"\xac",lnot:"\xac",infty:"â",ldots:"â¦",dots:"â¦",cdots:"â¯",vdots:"â®",degree:"\xb0",sqrt:"â",sum:"â",prod:"â",int:"â«",partial:"â",nabla:"â",ell:"â",hbar:"â",Re:"â",Im:"â",prime:"â²",dagger:"â ",ddagger:"â¡",checkmark:"â",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",varepsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",vartheta:"Ï",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",pi:"Ï",varpi:"Ï",rho:"Ï",varrho:"ϱ",sigma:"Ï",varsigma:"Ï",tau:"Ï",upsilon:"Ï
",phi:"Ï",varphi:"Ï",chi:"Ï",psi:"Ï",omega:"Ï",Gamma:"Î",Delta:"Î",Theta:"Î",Lambda:"Î",Xi:"Î",Pi:"Î ",Sigma:"Σ",Upsilon:"Î¥",Phi:"Φ",Psi:"Ψ",Omega:"Ω"},U={rarr:"â",larr:"â",uarr:"â",darr:"â",harr:"â",rArr:"â",lArr:"â",uArr:"â",dArr:"â",hArr:"â",hellip:"â¦",times:"\xd7",divide:"\xf7",deg:"\xb0",plusmn:"\xb1",ne:"â ",le:"â¤",ge:"â¥",infin:"â",bull:"â¢",middot:"\xb7",mdash:"â",ndash:"â",amp:"&",quot:'"',apos:"'",lt:"<",gt:">",nbsp:" ",copy:"\xa9",reg:"\xae",trade:"â¢",cent:"\xa2",euro:"â¬",pound:"\xa3",yen:"\xa5"},Y=(()=>{let e=Array.from(new Set([...Object.values(O),...Object.values(U)])).join("").replace(/[\]\\^-]/g,"\\$&");return"[".concat(e,"]")})(),V=[RegExp("\\$\\s*(".concat(Y,"+)\\s*\\$"),"g"),RegExp("\\$\\$\\s*(".concat(Y,"+)\\s*\\$\\$"),"g"),RegExp("\\\\\\(\\s*(".concat(Y,"+)\\s*\\\\\\)"),"g"),RegExp("\\\\\\[\\s*(".concat(Y,"+)\\s*\\\\\\]"),"g")],X=e=>
1{let{onAdminFlag:t}=e;return t?(0,n.jsx)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity","data-sentry-component":"FeedbackButtons","data-sentry-source-file":"AIChatMessages.tsx",children:(0,n.jsx)("button",{onClick:t,className:"p-1 rounded-full transition-colors text-gray-300 hover:text-amber-500 hover:bg-amber-50",title:"Flag for training review",children:(0,n.jsx)(p.A,{className:"w-3 h-3","data-sentry-element":"Flag","data-sentry-source-file":"AIChatMessages.tsx"})})}):null},Q=e=>{let{text:t}=e,[r,o]=(0,l.useState)(!1),a=async()=>{try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),1500)}catch(e){}};return(0,n.jsx)(y,{label:r?"Copied":"Copy",instant:!0,"data-sentry-element":"HoverTooltip","data-sentry-component":"CopyMessageButton","data-sentry-source-file":"AIChatMessages.tsx",children:(0,n.jsx)("button",{onClick:a,className:"p-1 rounded-full transition-colors text-gray-600 hover:text-gray-800 hover:bg-gray-100",children:r?(0,n.jsx)(i.A,{className:"w-4 h-4",strokeWidth:2}):(0,n.jsx)(d.A,{className:"w-4 h-4",strokeWidth:2})})})},Z=(0,E.L)(),G="text-[14.5px] leading-[1.5] whitespace-pre-wrap text-white",J={overflowWrap:"anywhere",wordBreak:"break-word"},K=e=>{let{text:t}=e,[r,o]=(0,l.useState)(!1),[a,s]=(0,l.useState)(!1),[i,d]=(0,l.useState)(null),c=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=c.current;if(!e)return;let r=()=>{let r=parseFloat(getComputedStyle(e).lineHeight);if(!r)return;if(e.scrollHeight/r<=Z+.1){s(!1),d(null);return}s(!0);let n=e.firstChild;if(!n||n.nodeType!==Node.TEXT_NODE)return void d(null);let o=e.getBoundingClientRect().top+(Z-1)*r-.5*r,l=document.createRange(),a=e=>(l.setStart(n,e),l.setEnd(n,e+1),l.getBoundingClientRect().top),i=0,c=t.length-1;for(;i<c;){let e=i+c>>1;a(e)>=o?c=e:i=e+1}let u=i;for(;u>0&&!/\s/.test(t[u-1]);)u--;d(t.slice(u))};r();let n=new ResizeObserver(r);return n.observe(e),()=>n.disconnect()},[t]);let u=!r,p=u&&a&&null!==i;return(0,n.jsxs)("div",{className:"relative","data-sentry-component":"CollapsibleUserText","data-sentry-source-file":"AIChatMessages.tsx",children:[(0,n.jsxs)("div",{ref:c,className:G,style:{...J,position:"relative",...u?{maxHeight:"calc(".concat(Z," * 1.5em)"),overflow:"hidden"}:{}},children:[t,p&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"aria-hidden":!0,className:"".concat(G," bg-gray-900"),style:{position:"absolute",left:0,right:0,top:"calc(".concat(Z-1," * 1.5em)"),height:"1.5em",overflow:"hidden",wordBreak:"break-all",pointerEvents:"none"},children:i}),(0,n.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute right-0 w-28 max-w-full bg-gradient-to-r from-transparent to-gray-900",style:{to
1p:"calc(".concat(Z-1," * 1.5em)"),height:"1.5em"}})]})]}),a&&(0,n.jsx)("div",{className:"absolute -bottom-1.5 -right-3",children:(0,n.jsx)(y,{label:u?"Expand text":"Collapse text",instant:!0,align:"end",children:(0,n.jsx)("button",{type:"button",onClick:()=>o(e=>!e),"aria-label":u?"Expand text":"Collapse text",className:"flex h-6 w-6 items-center justify-center rounded-full bg-gray-700/80 text-gray-200 transition-colors hover:bg-gray-600",children:u?(0,n.jsx)(m.A,{className:"h-4 w-4"}):(0,n.jsx)(h.A,{className:"h-4 w-4"})})})})]})},ee=e=>{var t,r,a;let{message:s,precedingUserQuery:i,isLastPendingNewSpace:d,products:c,onProductClick:u,shortlistHelpers:p,onAdminFlag:m,messageIndex:h,isFirstReply:x,onNewSpace:g,onContinueDecision:y,onRemoveProfileItems:b,onOpenProfile:w,currentProfileLabels:j,profileSurfaces:k,onRetry:C}=e,A="user"===s.role,P=(0,o.m)(),S=(0,l.useMemo)(()=>p?{...p,onAddProduct:p.onAddProduct?e=>p.onAddProduct(e,h):void 0}:p,[p,h]),E=s.isLoading,R=!!s.error,M=!A&&(null==(t=s.content)?void 0:t.includes("[NEW_SPACE]"))&&!s.newSpaceConfirmed&&d,[I,F]=(0,l.useState)(0);(0,l.useEffect)(()=>{let e=null==p?void 0:p.onResolveProduct,t=s.content;if(!e||!t||"assistant"!==s.role)return;let r=!1;for(let o of t.matchAll(H)){var n;let t=o[1].trim(),l=t.toLowerCase();!(!l||W.has(l)||B.has(l)||(null==c?void 0:c.some(e=>e.name.toLowerCase()===l)))&&(null!=(n=s.products_mentioned)&&n.some(e=>e.toLowerCase()===l)||(B.add(l),e(t).then(e=>{W.set(l,!!e)}).catch(()=>{W.set(l,!1)}).finally(()=>{B.delete(l),r||F(e=>e+1)})))}return()=>{r=!0}},[s.content,s.role,s.products_mentioned,c,p]);let _=(0,l.useMemo)(()=>{var e,t;let r=[...null!=(e=s.products_mentioned)?e:[]],n=new Set(r.map(e=>e.toLowerCase()));for(let e of(null!=(t=s.content)?t:"").matchAll(H)){let t=e[1].trim(),o=t.toLowerCase();!(!o||n.has(o))&&W.get(o)&&(r.push(t),n.add(o))}return r},[s.products_mentioned,s.content,I]),$=(null==(r=s.content)?void 0:r.includes("[NEW_SPACE]"))?s.content.replace("[NEW_SPACE]","").trim()||null:s.content;return(0,n.jsx)("div",{"data-role":s.role,"data-message-db-id":s.databaseId||s.id,"data-msg-index":h,className:(0,f.cn)("mb-3",P&&"od-fade-in",x&&"od-first-reply",A?"flex justify-end":"flex justify-start"),"data-sentry-component":"MessageBubble","data-sentry-source-file":"AIChatMessages.tsx",children:(0,n.jsxs)("div",{className:(0,f.cn)("group",A?"w-fit max-w-[85%] text-right":"pl-[10px] max-w-[88%]"),children:[(0,n.jsxs)("div",{"data-od-msg-content":!0,"data-od-flight-target":A?"message":void 0,className:(0,f.cn)("text-left",A&&"inline-block bg-gray-900 text-white rounded-2xl rounded-tr-[2.2px] px-4 py-2.5",!A&&"block text-gray-700"),children:[!A&&s.addedProfileItems&&s.addedProfileItems.length>0&&b&&(0,n.jsx)(N,{items:s.addedProfileItems,onRemoveAll:b,onOpenProfile:w,currentLabels:j}),R?(0,n.jsx)(T.B,{message:null!=(a=s.content)?a:"",onRetry:C}):E&&!$?(0,n.jsx)(L.ws,{openingReply:!0===s.opening}):(0,n.jsxs)(n.Fragment,{children:[$&&(A?(0,n.jsx)(K,{text:$}):(0,n.jsx)("div",{className:"text-gray-700",style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:((e,t,r,o,l,a,s)=>{let i=(null==l?void 0:l.isStreaming)===!0,d=(e=>{let t=e;for(let e of(t=(t=(t=(t=t.replace(/&([a-zA-Z]+);/g,(e,t)=>void 0!==U[t]?U[t]:e)).replace(/&#(\d+);/g,(e,t)=>{let r=parseInt(t,10);return Number.isFinite(r)?String.fromCodePoint(r):e})).replace(/&#x([0-9a-fA-F]+);/g,(e,t)=>{let r=parseInt(t,16);return Number.isFinite(r)?String.fromCodePoint(r):e})).replace(/\\{1,2}([a-zA-Z]+)(?:\{\})?(?![a-zA-Z])/g,(e,t)=>void 0!==O[t]?O[t]:e),V))t=t.replace(e,"$1");return(t=(t=(t=(t=t.replace(/\\textbf\{([^{}]+)\}/g,"**$1**")).replace(/\\(?:textit|emph|textsl)\{([^{}]+)\}/g,"*$1*")).replace(/\\texttt\{([^{}]+)\}/g,"`$1`")).replace(/\\underline\{([^{}]+)\}/g,"$1")).replace(/\\frac\{([^{}]+)\}\{([^{}]+)\}/g,"$1/$2")})(e).replace(/\[([^\]]*)\]\(product:[^)]*$/,"$1").replace(/\[([^\]]*)\]\((?:p(?:r(?:o(?:d(?:u(?:c(?:t)?)?)?)?)?)?)?$/,"$1").split("\n"),c=[],u=[],p=!1,m=[],h=/^([ \t]*)[-*]\s+/,x=/^([ \t]*)(\d{1,2})[.)]\s+/,g=/^[ \t]*([-*_])(?:[ \t]*\1){2,}[ \t]*$/,y=/^[ \t]*>[ \t]?/,b=e=>!g.test(e)&&(h.test(e)||x.test(e)),v=e=>+(e.replace(/\t/g," ").length>=2),w=[],j=null,N=!1,k=0,C=e=>e.trim().startsWith("|")&&e.trim().endsWith("|"),A=e=>/^\s*\|[\s|:-]+\|\s*$/.test(e),P=e=>e.trim().slice(1,-1).split("|").map(e=>e.trim()),S=()=>
1{if(!j)return;let e=k++,l=j,i=[...w];c.push((0,n.jsx)(q,{headers:l,rows:i,products:t,onProductClick:r,shortlistHelpers:o,mentionedNames:a,profileLabels:s},e)),j=null,w=[]},E=()=>{if(0===m.length)return;let e=k++,l=m.join(" ");m=[],c.push((0,n.jsx)("blockquote",{className:"my-2 border-l-2 border-gray-300 pl-3 text-[14.5px] leading-[1.5] text-gray-600",children:D(l,"q-".concat(e),t,r,!1,o,a,s)},e))},R=()=>{if(0===u.length)return;let e=p?"ol":"ul";c.push((0,n.jsx)(e,{className:"mt-1 mb-4 space-y-2 list-none pl-0",children:u.map((e,l)=>(0,n.jsxs)("li",{className:"flex gap-2 text-[14.5px] leading-[1.5]",style:e.depth>0?{paddingLeft:18}:void 0,children:[e.marker?(0,n.jsx)("span",{className:"shrink-0 tabular-nums text-gray-500",children:e.marker}):(0,n.jsx)("span",{className:(0,f.cn)("mt-1.5 w-1 h-1 rounded-full shrink-0",e.depth>0?"border border-gray-400":"bg-gray-400")}),(0,n.jsx)("span",{children:D(e.text,"li-".concat(l),t,r,!1,o,a,s)})]},l))},k++)),u=[],p=!1};for(let e=0;e<d.length;e++){let l=d[e];if(i&&e===d.length-1&&l.trimStart().startsWith("|")&&!C(l)){N=!0;continue}if(C(l)){A(l)||(null===j?(R(),j=P(l)):w.push(P(l)));continue}S();let L=/^(#{1,6})\s+(.*)$/.exec(l);if(L){R(),E();let e=k++,l=L[1].length<=2?"text-[15.5px]":"text-[15px]";c.push((0,n.jsx)("p",{className:(0,f.cn)(l,"font-semibold text-midnight mt-6 mb-1 first:mt-0"),children:D(L[2],"h-".concat(e),t,r,!0,o,a,s)},e))}else if(g.test(l))R(),E(),c.push((0,n.jsx)("hr",{className:"my-3 border-0 border-t border-gray-200"},k++));else if(y.test(l))R(),m.push(l.replace(y,""));else if(h.test(l)){E(),p&&R();let e=h.exec(l);u.push({text:l.slice(e[0].length),depth:v(e[1])})}else if(x.test(l)){E(),p||R(),p=!0;let e=x.exec(l);u.push({text:l.slice(e[0].length),depth:v(e[1]),marker:"".concat(e[2],".")})}else if(""===l.trim()){E();let t=d.slice(e+1).find(e=>""!==e.trim());void 0!==t&&b(t)||R()}else{R(),E();let e=k++;c.push((0,n.jsx)("p",{className:"od-otis-p text-[14.5px] leading-[1.5] mb-1",children:D(l,"p-".concat(e),t,r,!1,o,a,s)},e))}}return R(),E(),i&&(null!==j||N)?c.push((0,n.jsx)(z,{},k++)):S(),(0,n.jsx)(n.Fragment,{children:c})})($,c,u,S,{isStreaming:E},_,k)})),!A&&E&&s.awaitingContent&&(0,n.jsxs)("div",{className:"text-[14.5px] leading-[1.5] text-gray-400 mt-2 flex items-center gap-1.5",style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:[(0,n.jsx)(L.WU,{}),(0,n.jsx)(L.bv,{})]}),M&&(0,n.jsxs)("div",{style:{marginTop:8,padding:"12px 14px",borderRadius:10,background:"rgba(11, 158, 147, 0.06)",border:"1px solid rgba(11, 158, 147, 0.2)"},children:[(0,n.jsx)("p",{style:{fontSize:12,color:"#5A7A78",margin:"0 0 10px 0",lineHeight:1.5},children:"If this is a new requirement for your current decision, continue below. If it's a separate evaluation, start a new space."}),(0,n.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,n.jsx)("button",{onClick:()=>null==y?void 0:y(i),style:{flex:1,padding:"6px 12px",borderRadius:7,fontSize:12,fontWeight:600,background:"white",color:"#0B9E93",border:"1.5px solid #0B9E93",cursor:"pointer",lineHeight:1.3},children:"Continue this decision"}),(0,n.jsx)("button",{onClick:()=>null==g?void 0:g(i),style:{flex:1,padding:"6px 12px",borderRadius:7,fontSize:12,fontWeight:600,background:"#0B9E93",color:"white",border:"none",cursor:"pointer",lineHeight:1.3},children:"Start new decision"})]})]}),!A&&s.quickMatchFilters&&(0,n.jsx)(v,{filters:s.quickMatchFilters})]})]}),!A&&s.stopped?(0,n.jsxs)("div",{className:"mt-1 ml-1 flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-xs italic text-gray-400 select-none",children:"Stopped"}),!E&&!R&&s.content&&(0,n.jsx)(X,{onAdminFlag:m?()=>m(h):void 0})]}):!A&&!E&&!R&&s.content&&(0,n.jsx)("div",{className:"mt-1 ml-1",children:(0,n.jsx)(X,{onAdminFlag:m?()=>m(h):void 0})}),A&&$&&(0,n.jsx)("div",{className:"mt-1 mr-1 hidden [@media(hover:hover)]:flex justify-end opacity-0 group-hover:opacity-100 transition-opacity duration-150 group-hover:delay-300",children:(0,n.jsx)(Q,{text:$})})]})})},et=e=>{var t,r;let{messages:o,isEarliestSession:a=!1,products:s,onProductClick:i,isProductAdded:d,onAddProduct:c,onRemoveProduct:u,onResolveProduct:p,onAdminFlag:m,onNewSpace:h,onContinueDecision:x,onRemoveProfileItems:y,onOpenProfile:b,currentProfileLabels:v,className:w,highlightMessageDbId:j,highlightQuery:N,onHighlightApplied:P}=e,S=null==(t=(0,C.dC)())?void 0:t.retryLastTurn,{currentSpace:E,liveProfileContext:L}=(0,k.G1)(),T=null!=(r=null==E?void 0:E.id)?r:null,I=(0,l.useMemo)(()=>{var e,t,r;if(!L)return;let n=new Set,o=e=>{let t=null==e?void 0:e.trim().toLowerCase();t&&n.add(t)};return null==(e=L.tags)||e.forEach(o),null==(t=L.unstructured)||t.forEach(o),null==(r=L.specs)||r.forEach(e
1=>o(null==e?void 0:e.name)),n.size>0?n:void 0},[L]),{isTouchDevice:F}=(0,R.x)(),[_,W]=(0,l.useState)(!1),[B,H]=(0,l.useState)(null),[$,q]=(0,l.useState)(void 0),[z,D]=(0,l.useState)(void 0),[O,U]=(0,l.useState)(!1),Y=(0,l.useRef)(null),V=(0,l.useCallback)((e,t)=>{null==c||c(e),F||(window.dispatchEvent(new CustomEvent("od:expand-product-header")),H(null!=t?t:o.length-1),q(e.name),D(e.id),W(!0))},[c,o.length,F]);(0,l.useEffect)(()=>{if(!_)return;let e=()=>{var e;(0,g.g_)(900),null==(e=Y.current)||e.scrollIntoView({behavior:"smooth",block:"end"})},t=setTimeout(e,80),r=setTimeout(e,360);return()=>{clearTimeout(t),clearTimeout(r)}},[_,B]),(0,l.useEffect)(()=>{W(!1)},[o.length,T]),(0,l.useEffect)(()=>{var e;if(!_||!z)return;if(null==(e=null==d?void 0:d(z))||e)return void U(!1);U(!0);let t=setTimeout(()=>{W(!1),U(!1)},300);return()=>clearTimeout(t)},[_,z,d]);let X=(0,l.useMemo)(()=>({isProductAdded:d,onAddProduct:V,onRemoveProduct:u,onResolveProduct:p}),[d,V,u,p]),Q=(0,l.useCallback)(e=>{if(window.matchMedia("(hover: hover)").matches)return;let t=window.getSelection();if(!t||0===t.rangeCount||t.isCollapsed)return;let r=t.getRangeAt(0).cloneContents();if(!r.querySelector("[data-od-product-pill]"))return;let n=document.createElement("div");n.style.cssText="position:fixed;left:-9999px;top:0;white-space:pre-wrap",n.appendChild(r),document.body.appendChild(n);let o=n.innerText;document.body.removeChild(n),o&&o.trim()&&(e.clipboardData.setData("text/plain",o),e.preventDefault())},[]);(0,l.useEffect)(()=>{if(!j)return;let e=!1,t=0,r=[],n=()=>{if(e)return;let l=document.querySelector('[data-message-db-id="'.concat(CSS.escape(j),'"]'));if(!l){t++<20&&setTimeout(n,50);return}let a=(e=>{let t=e.parentElement;for(;t;){let e=getComputedStyle(t).overflowY;if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null})(l),s=(N||"").trim();if(s){var i;let e=o.find(e=>(e.databaseId||e.id)===j),t=null!=(i=null==e?void 0:e.content)?i:"";t&&((e,t,r)=>{let n=t.toLowerCase();if(!n)return;let o=r.split("\n"),l=e=>e.trim().startsWith("|")&&e.trim().endsWith("|"),a=-1,s=!1,i=-1;for(let e of o)if(l(e)){if(!s&&(s=!0,a++),e.toLowerCase().includes(n)){i=a;break}}else s=!1;if(-1===i)return;let d=Array.from(e.querySelectorAll('button[data-od-table-trigger="1"]'))[i];d&&!d.dataset.odHighlightOpened&&(d.dataset.odHighlightOpened="1",d.click())})(l,s,t)}a&&(a.scrollTop=a.scrollHeight),s&&(r=M(l,s)),setTimeout(()=>{a?(a.scrollTop=a.scrollHeight,requestAnimationFrame(()=>{let e=r[0]||l,t=e.getBoundingClientRect(),n=a.getBoundingClientRect(),o=a.scrollTop+(t.top-n.top)-Math.max(0,(a.clientHeight-e.offsetHeight)/2);a.scrollTo({top:Math.max(0,o),behavior:"smooth"})})):((0,g.g_)(900),(r[0]||l).scrollIntoView({behavior:"smooth",block:"center"}))},220),s&&setTimeout(()=>{document.querySelectorAll('[data-od-table-modal="1"]').forEach(e=>{r.push(...M(e,s))}),setTimeout(()=>{r.forEach(e=>{if(!e.parentNode)return;let t=document.createTextNode(e.textContent||"");e.parentNode.replaceChild(t,e)})},5700)},50),null==P||P()};return n(),()=>{e=!0}},[j,N,P,o]);let Z=(0,l.useMemo)(()=>{for(let t=o.length-1;t>=0;t--){var e;let r=o[t];if("assistant"===r.role&&(null==(e=r.content)?void 0:e.includes("[NEW_SPACE]"))&&!r.newSpaceConfirmed)return t}return -1},[o]);return(0,n.jsx)("div",{className:(0,f.cn)("space-y-2",w),onCopy:Q,"data-sentry-component":"AIChatMessages","data-sentry-source-file":"AIChatMessages.tsx",children:o.map((e,t)=>{var r,d,c;let u="";for(let e=t-1;e>=0;e--)if("user"===o[e].role){u=null!=(d=o[e].content)?d:"";break}return(0,n.jsxs)(l.Fragment,{children:[(0,n.jsx)(ee,{message:e,messageIndex:t,isFirstReply:a&&"user"!==e.role&&o.findIndex(e=>"user"!==e.role)===t,precedingUserQuery:u,isLastPendingNewSpace:t===Z,products:s,onProductClick:i,shortlistHelpers:X,onAdminFlag:m,onNewSpace:h,onContinueDecision:x,onRemoveProfileItems:y,onOpenProfile:b,currentProfileLabels:v,profileSurfaces:I,onRetry:t===o.length-1?S:void 0}),_&&B===t&&(0,n.jsx)("div",{ref:Y,className:(0,f.cn)("pt-1 scroll-mt-4 scroll-mb-8 transition-opacity duration-300",O&&"opacity-0 pointer-events-none"),children:(0,n.jsx)(A.Z,{spaceId:T,productName:$,productId:z,onOpenProduct:$?()=>null==i?void 0:i($):void 0,product:null==s?void 0:s.find(e=>e.id===z||e.name===$),isAdded:!z||null==(c=null==X||null==(r=X.isProductAdded)?void 0:r.call(X,z))||c,onAddProduct:null==X?void 0:X.onAddProduct,onRemoveProduct:null==X?void 0:X.onRemoveProduct,onDismiss:()=>W(!1)})})]},e.id)})})}},15347:()=>{},74484:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(13923).A)("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]])},99647:(e,t,r)=>{"use strict";r.d(t,{g:()=>m});var n=r(73365);r(1521);
1var o=r(16226),l=r(59076),a=r(15504),s=r(84580),i=r(6534),d=r(34969),c=r(34582),u=r(82938);let p={[u.y.SET_PRIORITIES]:a.A,[u.y.COMPARE]:s.A,[u.y.CATCH_ME_UP]:i.A},m=e=>{let{prompts:t,onSelect:r,className:a,roomy:s=!1,revealFrom:i,revealStep:u=.11}=e,m=(0,o.I)(),h=void 0!==i&&!m;return(0,n.jsxs)("div",{className:"flex flex-col ".concat(s?"gap-3.5":"gap-2.5"," w-full ").concat(null!=a?a:""),"data-sentry-component":"OtisStarterButtons","data-sentry-source-file":"otis-starter-buttons.tsx",children:[(0,n.jsx)("style",{children:"\n @keyframes otisChevSlide {\n 0% { transform: translateX(0); }\n 100% { transform: translateX(6px); }\n }\n .otis-starter-btn:hover .otis-chev { animation: otisChevSlide 0.22s ease-out forwards; }\n "}),t.map((e,t)=>{var o;let a=null!=(o=p[e])?o:d.A;return(0,n.jsxs)(l.P.button,{type:"button",onClick:()=>r(e),...h?{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.45,ease:[.22,1,.36,1],delay:i+t*u}}:{},className:"otis-starter-btn group flex w-full items-center gap-2.5 rounded-xl border border-black/5 bg-white ".concat(s?"px-3 py-1.5":"px-2.5 py-2.5"," text-left shadow-[0_1px_2px_rgba(0,0,0,0.06),0_4px_12px_rgba(0,0,0,0.10)] transition-shadow duration-200 ease-out hover:shadow-[0_2px_4px_rgba(0,0,0,0.07),0_5px_12px_rgba(0,0,0,0.10)] outline-none focus:outline-none focus-visible:outline-none"),style:{WebkitTapHighlightColor:"transparent"},children:[(0,n.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center",style:{color:"var(--od-otis)"},children:(0,n.jsx)(a,{className:"h-[18px] w-[18px]",strokeWidth:2})}),(0,n.jsx)("span",{className:"flex-1 ".concat(s?"text-[14.5px]":"text-[13.5px]"," font-medium leading-tight"),style:{color:"var(--od-text-primary)"},children:e}),(0,n.jsx)(c.A,{className:"otis-chev h-4 w-4 shrink-0 mr-1.5 opacity-50",style:{color:"var(--od-otis)"},strokeWidth:2.5})]},t)})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.