function AgentSupport(){const[s,i]=React.useState("tab"),[m,r]=React.useState(!1),[d,h]=React.useState(0),[n,f]=React.useState(3),[u,g]=React.useState([{from:"agent",text:"Hi \u2014 I'm a demo agent. Ask me anything about deploying autonomous AI workforces."}]),[o,c]=React.useState(""),p=React.useRef(null),l=React.useRef(Date.now());React.useEffect(()=>{function e(){l.current=Date.now()}function a(){const t=Date.now(),N=t-l.current,k=t-d>6e4;s==="tab"&&N>18e3&&k&&!m&&r(!0)}return["mousemove","keydown","click","scroll","touchstart"].forEach(t=>window.addEventListener(t,e,{passive:!0})),p.current=setInterval(a,3e3),()=>{["mousemove","keydown","click","scroll","touchstart"].forEach(t=>window.removeEventListener(t,e)),clearInterval(p.current)}},[s,d,m]);function v(){if(!o.trim()||n<=0)return;const e=o.trim();g(a=>[...a,{from:"user",text:e}]),c(""),f(a=>a-1),setTimeout(()=>{const a=pickReply(e);g(t=>[...t,{from:"agent",text:a}])},700)}function b(){i("tab"),h(Date.now()),r(!1),l.current=Date.now()}function y(){i("open"),r(!1)}return s==="hidden"?null:React.createElement(React.Fragment,null,s==="tab"&&React.createElement("button",{className:"ag-tab",onClick:y,title:"Ask a demo agent"},React.createElement("span",{className:"ag-tab-dot"}),React.createElement(MIcon,{name:"auto_awesome",size:16}),React.createElement("span",{className:"ag-tab-label"},"Demo agent")),s==="open"&&React.createElement("div",{className:"ag-panel",role:"complementary","aria-label":"Agent support"},React.createElement("header",{className:"ag-head"},React.createElement("div",{className:"ag-head-l"},React.createElement("div",{className:"ag-title"},"TRY A DEMO AGENT",React.createElement("span",{className:"ag-title-dot"},".")),React.createElement("div",{className:"ag-meta mono"},React.createElement("span",{className:"ag-live-dot"}),React.createElement("span",null,"Live"),React.createElement("span",{className:"ag-sep"},"\xB7"),React.createElement("span",null,"rate-limited"))),React.createElement("div",{className:"ag-head-r"},React.createElement("div",{className:"ag-turns mono"},n,"/3"),React.createElement("button",{className:"ag-close",onClick:b,title:"Minimize"},React.createElement(MIcon,{name:"south_east",size:14})))),React.createElement("div",{className:"ag-canvas"},React.createElement("div",{className:"ag-bg"}),React.createElement("div",{className:"ag-messages"},u.map((e,a)=>React.createElement("div",{key:a,className:`ag-msg ag-msg-${e.from}`},e.text)),n===0&&React.createElement("div",{className:"ag-end mono"},"Demo limit reached \xB7 Sign up for unlimited.")),u.length===1&&React.createElement("div",{className:"ag-suggests mono"},React.createElement("span",null,"Try:"),["Show me Decisions","Train a LoRA on my face","What is the Vault?"].map((e,a)=>React.createElement("button",{key:a,className:"ag-suggest",onClick:()=>c(e)},e)))),React.createElement("footer",{className:"ag-foot"},React.createElement("div",{className:"ag-input-row"},React.createElement("input",{className:"ag-input",placeholder:"Ask the agent\u2026",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key==="Enter"&&v()},disabled:n===0}),React.createElement("button",{className:"ag-send mono",onClick:v,disabled:!o.trim()||n===0},"SEND")),React.createElement("div",{className:"ag-foot-meta mono"},React.createElement("span",null,n,"/3 DEMO TURNS REMAINING"),React.createElement("span",{className:"ag-foot-meta-r"},React.createElement("span",{className:"ag-skills-label"},"SKILLS:"),React.createElement("span",{className:"ag-skills-v"},"5,400+"))),React.createElement("div",{className:"ag-watermark mono"},"AaaS Framework"))))}const REPLY_MAP=[{match:/lora|train|pics|photo/i,reply:"Sure \u2014 open the .pics studio from the Services rail. The flow is: connect Google Photos \u2192 auto-select 20 photos \u2192 train ~6 min \u2192 pick a vibe \u2192 generate. Want me to show you?"},{match:/decision|zooey/i,reply:"Decisions/Zooey lives under Select \u2192 Run detail. Every agent step shows its alternates with reasoning. Try the run 4827 mock \u2014 3 decision branches expanded by default."},{match:/vault|skill/i,reply:"Vault is our 5,400+ skill library \u2014 Intelligence \u2192 Vault. Skills carry quality tiers (gold/silver/bronze). The featured ones drive the AP-Reconciliation and Meeting-Prep agents."},{match:/price|cost|pay|subscribe|billing/i,reply:"Pricing varies by surface. AaaS Pics: \u20AC19 / pack; Pro \u20AC29/mo. Decisions retention: 7d free, 30d Pro, 90d Enterprise. Want a walkthrough of the billing page?"},{match:/onboard|signup|start/i,reply:"The onboarding flow is 6 steps under Home \u2192 Onboarding. Pick role + goal \u2192 first agent \u2192 first task \u2192 vault \u2192 welcome \u2192 services. ~3 minutes total."},{match:/agent|how/i,reply:"Agents live in Select. Every run shows its Decision Timeline with every alternate considered. Try the AP-Reconciliation agent at #select/run-detail."}];function pickReply(s){for(const i of REPLY_MAP)if(i.match.test(s))return i.reply;return"Good question. The mock-agent doesn't know that one \u2014 try asking about Decisions, Vault, .pics, or pricing."}window.AgentSupport=AgentSupport;
