1import{k as m,r as i,j as e}from"./vendor-CspWRbDh.js";import{P as u}from"./PageHeader-D-ZjVpga.js";import"./index-KgDEeEkX.js";const h=({message:a,sender:t})=>e.jsx("div",{className:`flex ${t==="user"?"justify-end":"justify-start"} mb-2`,children:e.jsx("div",{className:`max-w-[80vw] md:max-w-xs px-4 py-2 rounded-2xl text-sm shadow ${t==="user"?"bg-black text-white rounded-br-none":"bg-gray-100 text-gray-900 rounded-bl-none"}`,children:a})}),b=()=>{var n;const t=(n=m().state)==null?void 0:n.order,[r,o]=i.useState(""),[x,l]=i.useState([{sender:"bot",message:t?`Hi! How can I help you with your order: ${t.productTitle}?`:"Hi! How can I help you with your online order today?"}]),d=()=>{r.trim()!==""&&(l(s=>[...s,{sender:"user",message:r}]),setTimeout(()=>{l(s=>[...s,{sender:"bot",message:"Thank you for your message! Our team will reply soon."}])},800),o(""))};return e.jsxs("div",{className:"flex flex-col h-[100dvh] md:h-screen bg-white max-w-md md:max-w-2xl mx-auto shadow md:rounded-2xl relative",children:[e.jsx("div",{className:"sticky top-0 z-20 bg-white",children:e.jsx(u,{title:"Chat"})}),t&&e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b bg-white sticky top-[56px] z-10",children:[e.jsx("img",{src:t.productImage,alt:t.productTitle,className:"w-12 h-12 object-cover rounded-lg border"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-semibold text-sm",children:t.productTitle}),e.jsxs("div",{className:"text-xs text-gray-500",children:["Order Item: ",t.orderItemNumber]}),e.jsxs("div",{className:"text-xs text-gray-400",children:["Order: ",t.orderNumber]})]}),e.jsxs("span",{className:"text-xs bg-gray-200 px-2 py-1 rounded-full",children:[t.size," / ",t.color]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-4 bg-gray-50",style:{paddingBottom:"70px"},children:x.map((s,c)=>e.jsx(h,{message:s.message,sender:s.sender},c))}),e.jsxs("div",{className:"p-3 border-t bg-white flex gap-2 fixed left-0 right-0 bottom-0 max-w-md md:max-w-2xl mx-auto w-full z-30",style:{marginLeft:"auto",marginRight:"auto"},children:[e.jsx("input",{type:"text",className:"flex-1 border rounded-full px-4 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-black",placeholder:"Type your message...",value:r,onChange:s=>o(s.target.value),onKeyDown:s=>{s.key==="Enter"&&d()},autoFocus:!0}),e.jsx("button",{className:"bg-black text-white px-4 py-2 rounded-full text-sm font-semibold hover:bg-gray-900 transition",onClick:d,children:"Send"})]})]})};export{b 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.