1import{J as e}from"./UGqdMWRp.js";import{n as t}from"./j1Y6arPy.js";import{B as n,F as r,H as i,I as a,L as o,On as s,R as c,U as l,V as u,W as d,bt as f,wn as p,xt as m}from"./CCCnGatr.js";var h=`clesk-agent-consented-v2`,g=e({messages:[],consented:!1,thinking:!1});function _(){try{localStorage.removeItem(`clesk-agent-consented-v1`),g.consented=localStorage.getItem(h)===`1`}catch{}}function v(){g.consented=!0;try{localStorage.setItem(h,`1`)}catch{}}function y(){g.messages=[]}function b(){return[{cmd:c(),href:`/loesungen/`,label:m(),aliases:[`/loesungen`,`/solutions`]},{cmd:o(),href:`/#leistungen`,label:p(),aliases:[`/leistungen`,`/services`]},{cmd:a(),href:`/produkte/`,label:f(),aliases:[`/produkte`,`/products`]},{cmd:r(),href:`/kontakt/`,label:s(),aliases:[`/kontakt`,`/contact`]}]}function x(e){let t=e.trim().toLowerCase();return b().find(e=>e.aliases.includes(t))}async function S(e){g.messages=[...g.messages,{role:`user`,content:e}],g.thinking=!0;try{let e=await fetch(`/api/agent`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({messages:g.messages,consented:!0,locale:t()})});if(!e.ok){let t=e.status===429?l():e.status===503?d():i();return g.messages=[...g.messages,{role:`assistant`,content:t}],t}let r=((await e.json()).reply??``).trim()||n();return g.messages=[...g.messages,{role:`assistant`,content:r}],r}catch{let e=u();return g.messages=[...g.messages,{role:`assistant`,content:e}],e}finally{g.thinking=!1}}export{x as a,_ as i,b as n,y as o,v as r,S as s,g as 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.