1var v=(a,m,r)=>new Promise((o,c)=>{var l=t=>{try{u(r.next(t))}catch(n){c(n)}},h=t=>{try{u(r.throw(t))}catch(n){c(n)}},u=t=>t.done?o(t.value):Promise.resolve(t.value).then(l,h);u((r=r.apply(a,m)).next())});import{j as e}from"./vendor-mui-BGS3mHwM.js";/* empty css */import{i as b,A as C}from"./ic-send-03-CN6Zu5op.js";import{r as i}from"./vendor-redux-FtDGt7Mz.js";import{u as k,b as S}from"./chat-keys-BLUTcyLG.js";import{ge as w}from"./index-D5apbUK-.js";import{u as N,a as E}from"./vendor-react-CUpnpRPD.js";import"./vendor-stream-CynyArsg.js";import"./vendor-pdf-Ddbn4B6C.js";import"./vendor-graphql-CuoeCPzn.js";import"./vendor-media-BEZy7yMd.js";import"./vendor-radix-NiTG7895.js";import"./vendor-mui-pickers-BdXKbjEa.js";import"./vendor-forms-BcpGzS3-.js";const K=({seed:a="",replaceHistory:m=!1})=>{const r=N(),{startChat:o,isStarting:c}=k(),[l,h]=i.useState(a),[u,t]=i.useState(null),n=i.useRef(null),x=i.useRef(!1),d=i.useCallback(s=>v(void 0,null,function*(){var j;const f=s.trim();if(!f)return;t(null);const g=((j=n.current)==null?void 0:j.text)===f?n.current.key:S();n.current={text:f,key:g};const p=yield o({clientIdempotencyKey:g,text:f});if(p){if(p.failure){t(p.failure.kind==="order-unavailable"?"Couldnât start the chat. Please try again.":p.failure.message);return}n.current=null,r(`/support/chat/c/${p.conversationId}`,{replace:m})}}),[r,m,o]),y=i.useCallback(s=>{s.trim()&&(w(),d(s))},[d]);return i.useEffect(()=>{!a||x.current||(x.current=!0,d(a))},[a,d]),e.jsxs(e.Fragment,{children:[u&&e.jsx("div",{className:"sc-error-note",children:u}),e.jsxs("div",{className:"sc-composer",children:[e.jsx("textarea",{className:"sc-composer-input",value:l,onChange:s=>h(s.target.value),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),y(l))},rows:1,placeholder:"Type a message",autoFocus:!0}),e.jsxs("button",{type:"button",className:"sc-send",onClick:()=>y(l),"aria-busy":c,disabled:!l.trim()||c,children:[c?"Startingâ¦":"Send",e.jsx("span",{className:"sc-send-icon","aria-hidden":!0,children:c?e.jsx("span",{className:"sc-spinner"}):e.jsx("img",{src:b,alt:""})})]})]})]})},M=()=>{var o;const a=N(),r=((o=E().state)==null?void 0:o.seed)||"";return e.jsxs("div",{className:"cnh-chat sc-screen sc-screen-chat",children:[e.jsx(C,{subtitle:"AI assistant · replies instantly",onBack:()=>a(-1)}),e.jsx("div",{className:"sc-msg-region",children:e.jsx("div",{className:"sc-msg-scroll",children:e.jsx("p",{className:"sc-msg-hint",children:"Describe your query in your own words â weâll connect you with our support team."})})}),e.jsx(K,{seed:r,replaceHistory:!0})]})};export{M as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.